summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-18 15:55:08 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-18 15:55:08 +0100
commit4fdd55226d2972e3a256426db3122ac23b0615c6 (patch)
tree23f5b3a68382d6d3b8db0cb5e2537ed74a228d7c
parentc3d5444d84e18fa82235bb9d419861ac5e54f544 (diff)
parente1028d9225bc47922c387aa462887c7643bc6c40 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts: comphelper/source/misc/servicedecl.cxx i18npool/source/breakiterator/breakiteratorImpl.cxx l10ntools/scripts/localize.pl svl/source/items/itemset.cxx svl/source/memtools/svarray.cxx svl/source/numbers/zformat.cxx svtools/source/brwbox/brwbox1.cxx tools/source/stream/strmwnt.cxx vcl/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_layout.hxx vcl/inc/vcl/graphite_serverfont.hxx vcl/source/control/imgctrl.cxx vcl/source/gdi/outdev.cxx vcl/source/gdi/outdev3.cxx vcl/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/graphite_adaptors.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/window/winproc.cxx vcl/unx/source/fontmanager/fontconfig.cxx
-rw-r--r--basebmp/test/makefile.mk7
-rw-r--r--basegfx/source/curve/b2dcubicbezier.cxx67
-rw-r--r--basegfx/test/makefile.mk7
-rw-r--r--canvas/prj/build.lst2
-rw-r--r--canvas/prj/d.lst7
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx4
-rw-r--r--canvas/source/cairo/cairo_canvashelper_text.cxx2
-rw-r--r--canvas/source/cairo/cairo_canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/cairo/cairo_devicehelper.cxx2
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx37
-rw-r--r--canvas/source/cairo/cairocanvas.component37
-rw-r--r--canvas/source/cairo/exports.dxp1
-rw-r--r--canvas/source/cairo/makefile.mk8
-rw-r--r--canvas/source/directx/directx5canvas.component34
-rw-r--r--canvas/source/directx/directx9canvas.component34
-rw-r--r--canvas/source/directx/dx_5rm.cxx6
-rw-r--r--canvas/source/directx/dx_9rm.cxx4
-rw-r--r--canvas/source/directx/dx_canvashelper_texturefill.cxx4
-rw-r--r--canvas/source/directx/dx_textlayout_drawhelper.cxx8
-rw-r--r--canvas/source/directx/dx_winstuff.hxx6
-rw-r--r--canvas/source/directx/exports.dxp1
-rw-r--r--canvas/source/directx/gdipluscanvas.component37
-rw-r--r--canvas/source/directx/makefile.mk22
-rw-r--r--canvas/source/factory/canvasfactory.component34
-rw-r--r--canvas/source/factory/cf_service.cxx8
-rw-r--r--canvas/source/factory/makefile.mk7
-rw-r--r--canvas/source/null/exports.dxp1
-rw-r--r--canvas/source/simplecanvas/exports.dxp1
-rw-r--r--canvas/source/simplecanvas/makefile.mk8
-rw-r--r--canvas/source/simplecanvas/simplecanvas.component34
-rw-r--r--canvas/source/tools/elapsedtime.cxx4
-rw-r--r--canvas/source/vcl/backbuffer.cxx2
-rw-r--r--canvas/source/vcl/bitmapbackbuffer.cxx8
-rw-r--r--canvas/source/vcl/canvasbitmap.cxx2
-rw-r--r--canvas/source/vcl/canvasbitmaphelper.cxx12
-rw-r--r--canvas/source/vcl/canvasfont.cxx4
-rw-r--r--canvas/source/vcl/canvashelper.cxx54
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx50
-rw-r--r--canvas/source/vcl/devicehelper.cxx2
-rw-r--r--canvas/source/vcl/exports.dxp1
-rw-r--r--canvas/source/vcl/impltools.cxx18
-rw-r--r--canvas/source/vcl/impltools.hxx2
-rw-r--r--canvas/source/vcl/makefile.mk8
-rw-r--r--canvas/source/vcl/spritecanvashelper.cxx10
-rw-r--r--canvas/source/vcl/spritedevicehelper.cxx4
-rwxr-xr-x[-rw-r--r--]canvas/source/vcl/spritehelper.cxx21
-rw-r--r--canvas/source/vcl/textlayout.cxx28
-rw-r--r--canvas/source/vcl/vclcanvas.component37
-rw-r--r--comphelper/JunitTest_comphelper_complex.mk (renamed from comphelper/inc/makefile.mk)36
-rw-r--r--comphelper/Library_comphelp.mk156
-rw-r--r--comphelper/Makefile (renamed from comphelper/version.mk)24
-rw-r--r--comphelper/Module_comphelper.mk39
-rw-r--r--comphelper/Package_inc.mk137
-rw-r--r--comphelper/inc/comphelper/TypeGeneration.hxx1
-rwxr-xr-xcomphelper/inc/comphelper/anycompare.hxx226
-rw-r--r--comphelper/inc/comphelper/asyncnotification.hxx3
-rwxr-xr-xcomphelper/inc/comphelper/componentguard.hxx70
-rw-r--r--comphelper/inc/comphelper/componentmodule.hxx29
-rw-r--r--comphelper/inc/comphelper/docpasswordhelper.hxx63
-rw-r--r--comphelper/inc/comphelper/docpasswordrequest.hxx54
-rw-r--r--comphelper/inc/comphelper/documentconstants.hxx38
-rwxr-xr-xcomphelper/inc/comphelper/flagguard.hxx83
-rw-r--r--comphelper/inc/comphelper/mediadescriptor.hxx27
-rw-r--r--comphelper/inc/comphelper/mimeconfighelper.hxx15
-rw-r--r--comphelper/inc/comphelper/namedvaluecollection.hxx12
-rw-r--r--comphelper/inc/comphelper/optionalvalue.hxx190
-rw-r--r--comphelper/inc/comphelper/property.hxx8
-rw-r--r--comphelper/inc/comphelper/querydeep.hxx486
-rw-r--r--comphelper/inc/comphelper/scopeguard.hxx1
-rw-r--r--comphelper/inc/comphelper/sequenceasvector.hxx11
-rw-r--r--comphelper/inc/comphelper/servicedecl.hxx31
-rw-r--r--comphelper/inc/comphelper/storagehelper.hxx11
-rw-r--r--comphelper/prj/build.lst17
-rw-r--r--comphelper/prj/d.lst14
-rw-r--r--comphelper/prj/makefile.mk (renamed from toolkit/util/makefile.pmk)18
-rw-r--r--comphelper/qa/complex/comphelper/Map.java205
-rw-r--r--comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java153
-rw-r--r--comphelper/qa/complex/comphelper/Test01.java107
-rw-r--r--comphelper/qa/complex/comphelper/TestHelper.java49
-rw-r--r--comphelper/qa/complex/makefile.mk83
-rw-r--r--comphelper/source/container/enumerablemap.cxx205
-rwxr-xr-xcomphelper/source/misc/anycompare.cxx131
-rw-r--r--comphelper/source/misc/componentmodule.cxx58
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx152
-rwxr-xr-x[-rw-r--r--]comphelper/source/misc/docpasswordrequest.cxx67
-rw-r--r--comphelper/source/misc/makefile.mk101
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx42
-rw-r--r--comphelper/source/misc/mimeconfighelper.cxx200
-rw-r--r--comphelper/source/misc/namedvaluecollection.cxx47
-rw-r--r--comphelper/source/misc/querydeep.cxx78
-rw-r--r--comphelper/source/misc/scopeguard.cxx10
-rw-r--r--comphelper/source/misc/servicedecl.cxx31
-rw-r--r--comphelper/source/misc/storagehelper.cxx52
-rw-r--r--comphelper/source/misc/uieventslogger.cxx9
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx92
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.hxx6
-rw-r--r--comphelper/source/property/TypeGeneration.cxx4
-rw-r--r--comphelper/source/property/makefile.mk65
-rw-r--r--comphelper/source/property/propagg.cxx24
-rw-r--r--comphelper/source/streaming/makefile.mk54
-rw-r--r--comphelper/test/uno_iterators/makefile.mk48
-rw-r--r--comphelper/util/comphelp.component70
-rw-r--r--comphelper/util/exports.dxp3
-rw-r--r--comphelper/util/makefile.mk70
-rw-r--r--cppcanvas/inc/cppcanvas/renderer.hxx20
-rw-r--r--cppcanvas/source/inc/implrenderer.hxx6
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx32
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx98
-rw-r--r--cppcanvas/source/mtfrenderer/mtftools.cxx4
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx36
-rw-r--r--cppcanvas/source/uno/exports.dxp1
-rw-r--r--cppcanvas/source/uno/exports.map1
-rw-r--r--cppcanvas/source/wrapper/vclfactory.cxx4
-rw-r--r--dtrans/prj/build.lst2
-rw-r--r--dtrans/prj/d.lst5
-rw-r--r--dtrans/source/cnttype/exports.dxp1
-rw-r--r--dtrans/source/cnttype/mctfentry.cxx29
-rw-r--r--dtrans/source/generic/dtrans.component37
-rw-r--r--dtrans/source/generic/dtrans.cxx37
-rw-r--r--dtrans/source/generic/exports.dxp1
-rw-r--r--dtrans/source/generic/makefile.mk8
-rw-r--r--dtrans/source/os2/clipb/Os2Service.cxx22
-rw-r--r--dtrans/source/os2/clipb/exports.dxp1
-rw-r--r--dtrans/source/win32/clipb/exports.dxp1
-rw-r--r--dtrans/source/win32/clipb/wcbentry.cxx29
-rw-r--r--dtrans/source/win32/dnd/dndentry.cxx33
-rw-r--r--dtrans/source/win32/dnd/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/DOTransferable.cxx9
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.cxx43
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.hxx6
-rw-r--r--dtrans/source/win32/ftransl/exports.dxp1
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/ftransl/ftransl.cxx1
-rw-r--r--dtrans/source/win32/ftransl/ftranslentry.cxx29
-rw-r--r--dtrans/util/dnd.component37
-rw-r--r--dtrans/util/exports.dxp1
-rw-r--r--dtrans/util/ftransl.component34
-rw-r--r--dtrans/util/makefile.mk29
-rw-r--r--dtrans/util/mcnttype.component34
-rw-r--r--dtrans/util/sysdtrans.component34
-rw-r--r--i18npool/inc/i18npool/lang.h5
-rw-r--r--i18npool/inc/i18npool/paper.hxx7
-rw-r--r--i18npool/prj/build.lst4
-rw-r--r--i18npool/prj/d.lst2
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx93
-rw-r--r--i18npool/source/calendar/calendar_gregorian.cxx6
-rw-r--r--i18npool/source/isolang/isolang.cxx9
-rw-r--r--i18npool/source/isolang/mslangid.cxx2
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx77
-rw-r--r--i18npool/source/localedata/data/dsb_DE.xml350
-rw-r--r--i18npool/source/localedata/data/fi_FI.xml2
-rw-r--r--i18npool/source/localedata/data/haw_US.xml358
-rw-r--r--i18npool/source/localedata/data/hsb_DE.xml2
-rw-r--r--i18npool/source/localedata/data/ht_HT.xml358
-rw-r--r--i18npool/source/localedata/data/jbo.xml358
-rw-r--r--i18npool/source/localedata/data/lif_NP.xml357
-rw-r--r--i18npool/source/localedata/data/localedata_euro.map17
-rw-r--r--i18npool/source/localedata/data/localedata_others.map104
-rw-r--r--i18npool/source/localedata/data/makefile.mk219
-rw-r--r--i18npool/source/localedata/data/no_NO.xml2
-rw-r--r--i18npool/source/localedata/data/sv_SE.xml2
-rw-r--r--i18npool/source/localedata/data/ur_PK.xml358
-rw-r--r--i18npool/source/localedata/data/yi_US.xml163
-rw-r--r--i18npool/source/localedata/localedata.cxx7
-rw-r--r--i18npool/source/localedata/saxparser.cxx34
-rw-r--r--i18npool/source/paper/paper.cxx6
-rw-r--r--i18npool/source/registerservices/registerservices.cxx23
-rw-r--r--i18npool/source/search/i18nsearch.component34
-rw-r--r--i18npool/source/search/makefile.mk8
-rw-r--r--i18npool/source/search/textsearch.cxx19
-rw-r--r--i18npool/util/i18npool.component484
-rw-r--r--i18npool/util/makefile.mk8
-rw-r--r--l10ntools/inc/cfgmerge.hxx6
-rw-r--r--l10ntools/inc/export.hxx169
-rw-r--r--l10ntools/inc/gsicheck.hxx52
-rw-r--r--l10ntools/inc/l10ntools/vosapp.hxx8
-rw-r--r--l10ntools/inc/lngmerge.hxx12
-rw-r--r--l10ntools/inc/srciter.hxx2
-rw-r--r--l10ntools/inc/tagtest.hxx90
-rw-r--r--l10ntools/inc/wtranode.hxx4
-rw-r--r--l10ntools/inc/wtratree.hxx4
-rw-r--r--l10ntools/inc/xmlparse.hxx34
-rw-r--r--l10ntools/inc/xrmmerge.hxx8
-rw-r--r--l10ntools/layout/layoutparse.cxx2
-rw-r--r--l10ntools/layout/layoutparse.hxx2
-rw-r--r--l10ntools/layout/tralay.cxx4
-rwxr-xr-x[-rw-r--r--]l10ntools/scripts/localize.pl0
-rw-r--r--l10ntools/scripts/tool/l10ntool.py10
-rwxr-xr-xl10ntools/scripts/xhtex8
-rwxr-xr-xl10ntools/scripts/xtxex8
-rw-r--r--l10ntools/source/cfgmerge.cxx64
-rw-r--r--l10ntools/source/directory.cxx6
-rw-r--r--l10ntools/source/export.cxx344
-rw-r--r--l10ntools/source/export2.cxx18
-rw-r--r--l10ntools/source/filter/utils/Cache.java8
-rw-r--r--l10ntools/source/gsicheck.cxx238
-rw-r--r--l10ntools/source/gsiconv.cxx26
-rw-r--r--l10ntools/source/help/HelpLinker.cxx68
-rw-r--r--l10ntools/source/helpex.cxx48
-rw-r--r--l10ntools/source/helpmerge.cxx6
-rw-r--r--l10ntools/source/lngex.cxx44
-rw-r--r--l10ntools/source/lngmerge.cxx28
-rw-r--r--l10ntools/source/localize.cxx96
-rw-r--r--l10ntools/source/merge.cxx296
-rw-r--r--l10ntools/source/srciter.cxx16
-rw-r--r--l10ntools/source/tagtest.cxx234
-rw-r--r--l10ntools/source/wtranode.cxx4
-rw-r--r--l10ntools/source/wtratree.cxx12
-rw-r--r--l10ntools/source/xgfconv.cxx6
-rw-r--r--l10ntools/source/xmlparse.cxx44
-rw-r--r--l10ntools/source/xrmmerge.cxx48
-rw-r--r--o3tl/qa/makefile.mk7
-rw-r--r--padmin/AllLangResTarget_spa.mk (renamed from comphelper/source/compare/makefile.mk)33
-rw-r--r--padmin/Executable_spadmin.bin.mk (renamed from svtools/source/svhtml/makefile.mk)56
-rw-r--r--padmin/Library_spa.mk (renamed from tools/source/stream/makefile.mk)67
-rw-r--r--padmin/Makefile38
-rw-r--r--padmin/Module_padmin.mk (renamed from svl/util/svl.pmk)16
-rw-r--r--padmin/Package_inc.mk30
-rw-r--r--padmin/prj/build.lst2
-rw-r--r--padmin/prj/d.lst7
-rw-r--r--padmin/prj/makefile.mk (renamed from comphelper/util/makefile.pmk)17
-rw-r--r--padmin/source/adddlg.cxx104
-rw-r--r--padmin/source/cmddlg.cxx24
-rw-r--r--padmin/source/cmddlg.hxx6
-rw-r--r--padmin/source/fontentry.cxx28
-rw-r--r--padmin/source/helper.cxx8
-rw-r--r--padmin/source/helper.hxx9
-rw-r--r--padmin/source/makefile.mk115
-rw-r--r--padmin/source/newppdlg.cxx2
-rw-r--r--padmin/source/padialog.cxx40
-rw-r--r--padmin/source/padialog.hxx6
-rw-r--r--padmin/source/padialog.src79
-rw-r--r--padmin/source/pamain.cxx8
-rw-r--r--padmin/source/progress.cxx10
-rw-r--r--padmin/source/progress.hxx6
-rw-r--r--padmin/source/prtsetup.cxx95
-rw-r--r--padmin/source/prtsetup.hxx7
-rw-r--r--padmin/source/rtsetup.hrc10
-rw-r--r--padmin/source/rtsetup.src52
-rw-r--r--rsc/inc/rsc/rscsfx.hxx (renamed from rsc/inc/rscsfx.hxx)0
-rw-r--r--rsc/inc/rscall.h2
-rw-r--r--rsc/inc/rscarray.hxx14
-rw-r--r--rsc/inc/rscclass.hxx34
-rw-r--r--rsc/inc/rscclobj.hxx16
-rw-r--r--rsc/inc/rscconst.hxx26
-rw-r--r--rsc/inc/rsccont.hxx36
-rw-r--r--rsc/inc/rscdb.hxx46
-rw-r--r--rsc/inc/rscdef.hxx138
-rw-r--r--rsc/inc/rscerror.h6
-rw-r--r--rsc/inc/rscflag.hxx28
-rw-r--r--rsc/inc/rscinst.hxx60
-rw-r--r--rsc/inc/rsckey.hxx8
-rw-r--r--rsc/inc/rsclst.hxx8
-rw-r--r--rsc/inc/rscmgr.hxx16
-rw-r--r--rsc/inc/rscpar.hxx24
-rw-r--r--rsc/inc/rscrange.hxx90
-rw-r--r--rsc/inc/rscrsc.hxx4
-rw-r--r--rsc/inc/rscstr.hxx12
-rw-r--r--rsc/inc/rsctools.hxx12
-rw-r--r--rsc/inc/rsctop.hxx30
-rw-r--r--rsc/inc/rsctree.hxx6
-rw-r--r--rsc/inc/vclrsc.hxx179
-rw-r--r--rsc/prj/d.lst2
-rw-r--r--rsc/source/misc/rscdbl.cxx6
-rw-r--r--rsc/source/misc/rsclst.cxx4
-rw-r--r--rsc/source/parser/erscerr.cxx2
-rw-r--r--rsc/source/parser/rscdb.cxx79
-rw-r--r--rsc/source/parser/rscibas.cxx32
-rw-r--r--rsc/source/parser/rscicpx.cxx61
-rw-r--r--rsc/source/parser/rscinit.cxx108
-rw-r--r--rsc/source/parser/rsckey.cxx10
-rwxr-xr-x[-rw-r--r--]rsc/source/parser/rsclex.cxx43
-rw-r--r--rsc/source/parser/rsclex.hxx2
-rw-r--r--rsc/source/parser/rscpar.cxx12
-rw-r--r--rsc/source/parser/rscyacc.cxx22
-rw-r--r--rsc/source/parser/rscyacc.y42
-rw-r--r--rsc/source/prj/start.cxx38
-rw-r--r--rsc/source/res/rscall.cxx4
-rw-r--r--rsc/source/res/rscarray.cxx40
-rw-r--r--rsc/source/res/rscclass.cxx142
-rw-r--r--rsc/source/res/rscclobj.cxx24
-rw-r--r--rsc/source/res/rscconst.cxx38
-rw-r--r--rsc/source/res/rsccont.cxx66
-rw-r--r--rsc/source/res/rscflag.cxx54
-rw-r--r--rsc/source/res/rscmgr.cxx30
-rw-r--r--rsc/source/res/rscrange.cxx102
-rw-r--r--rsc/source/res/rscstr.cxx28
-rw-r--r--rsc/source/res/rsctop.cxx38
-rw-r--r--rsc/source/rsc/rsc.cxx188
-rw-r--r--rsc/source/tools/rscchar.cxx10
-rw-r--r--rsc/source/tools/rscdef.cxx187
-rw-r--r--rsc/source/tools/rsctools.cxx20
-rw-r--r--rsc/source/tools/rsctree.cxx28
-rw-r--r--sax/prj/build.lst2
-rw-r--r--sax/prj/d.lst3
-rw-r--r--sax/qa/cppunit/makefile.mk7
-rw-r--r--sax/source/expatwrap/makefile.mk11
-rw-r--r--sax/source/expatwrap/sax.component37
-rw-r--r--sax/source/expatwrap/sax_expat.cxx31
-rw-r--r--sax/source/fastparser/facreg.cxx28
-rw-r--r--sax/source/fastparser/fastsax.component37
-rw-r--r--sax/source/fastparser/makefile.mk7
-rw-r--r--sax/source/tools/converter.cxx4
-rw-r--r--sax/source/tools/fshelper.cxx11
-rw-r--r--sot/JunitTest_sot_complex.mk49
-rw-r--r--sot/Library_sot.mk80
-rw-r--r--sot/Makefile38
-rw-r--r--sot/Module_sot.mk38
-rw-r--r--sot/Package_inc.mk42
-rw-r--r--sot/inc/makefile.mk48
-rw-r--r--sot/inc/sot/absdev.hxx (renamed from sot/inc/absdev.hxx)2
-rw-r--r--sot/inc/sot/agg.hxx (renamed from sot/inc/agg.hxx)16
-rw-r--r--sot/inc/sot/clsids.hxx (renamed from sot/inc/clsids.hxx)0
-rw-r--r--sot/inc/sot/exchange.hxx184
-rw-r--r--sot/inc/sot/factory.hxx11
-rw-r--r--sot/inc/sot/filelist.hxx (renamed from sot/inc/filelist.hxx)2
-rw-r--r--sot/inc/sot/formats.hxx276
-rw-r--r--sot/inc/sot/object.hxx92
-rw-r--r--sot/inc/sot/sotdata.hxx2
-rw-r--r--sot/inc/sot/sotref.hxx8
-rw-r--r--sot/inc/sot/stg.hxx (renamed from sot/inc/stg.hxx)280
-rw-r--r--sot/inc/sot/storage.hxx90
-rw-r--r--sot/inc/sot/storinfo.hxx (renamed from sot/inc/storinfo.hxx)16
-rwxr-xr-x[-rw-r--r--]sot/prj/build.lst8
-rw-r--r--sot/prj/d.lst27
-rw-r--r--sot/prj/makefile.mk (renamed from svtools/util/svt.pmk)15
-rw-r--r--sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java79
-rw-r--r--sot/qa/complex/olesimplestorage/Test01.java20
-rw-r--r--sot/qa/complex/olesimplestorage/TestHelper.java15
-rw-r--r--sot/qa/complex/olesimplestorage/makefile.mk84
-rw-r--r--sot/source/base/exchange.cxx36
-rw-r--r--sot/source/base/factory.cxx61
-rw-r--r--sot/source/base/filelist.cxx4
-rw-r--r--sot/source/base/formats.cxx60
-rw-r--r--sot/source/base/makefile.mk58
-rw-r--r--sot/source/base/object.cxx318
-rw-r--r--sot/source/sdstor/makefile.mk64
-rw-r--r--sot/source/sdstor/stg.cxx296
-rw-r--r--sot/source/sdstor/stgavl.cxx36
-rw-r--r--sot/source/sdstor/stgavl.hxx8
-rw-r--r--sot/source/sdstor/stgcache.cxx110
-rw-r--r--sot/source/sdstor/stgcache.hxx66
-rw-r--r--sot/source/sdstor/stgdir.cxx279
-rw-r--r--sot/source/sdstor/stgdir.hxx78
-rw-r--r--sot/source/sdstor/stgelem.cxx108
-rw-r--r--sot/source/sdstor/stgelem.hxx124
-rw-r--r--sot/source/sdstor/stgio.cxx112
-rw-r--r--sot/source/sdstor/stgio.hxx12
-rw-r--r--sot/source/sdstor/stgole.cxx76
-rw-r--r--sot/source/sdstor/stgole.hxx26
-rw-r--r--sot/source/sdstor/stgstrms.cxx344
-rw-r--r--sot/source/sdstor/stgstrms.hxx106
-rw-r--r--sot/source/sdstor/storage.cxx218
-rw-r--r--sot/source/sdstor/storinfo.cxx24
-rw-r--r--sot/source/sdstor/ucbstorage.cxx594
-rw-r--r--sot/source/sdstor/unostorageholder.cxx4
-rw-r--r--sot/source/unoolestorage/makefile.mk51
-rw-r--r--sot/source/unoolestorage/register.cxx28
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx2
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.hxx2
-rw-r--r--sot/util/makefile.mk81
-rw-r--r--sot/util/sot.component34
-rw-r--r--svl/AllLangResTarget_svl.mk (renamed from svl/source/memtools/makefile.mk)28
-rwxr-xr-xsvl/JunitTest_svl_complex.mk59
-rw-r--r--svl/Library_fsstorage.mk62
-rw-r--r--svl/Library_passwordcontainer.mk58
-rw-r--r--svl/Library_svl.mk168
-rw-r--r--svl/Makefile38
-rw-r--r--svl/Module_svl.mk (renamed from svl/source/filerec/makefile.mk)32
-rw-r--r--svl/Package_inc.mk129
-rw-r--r--svl/inc/makefile.mk48
-rw-r--r--svl/inc/svl/PasswordHelper.hxx (renamed from svl/inc/PasswordHelper.hxx)0
-rw-r--r--svl/inc/svl/adrparse.hxx (renamed from svl/inc/adrparse.hxx)0
-rw-r--r--svl/inc/svl/aeitem.hxx30
-rw-r--r--svl/inc/svl/brdcst.hxx8
-rw-r--r--svl/inc/svl/broadcast.hxx (renamed from svl/inc/broadcast.hxx)2
-rw-r--r--svl/inc/svl/cenumitm.hxx64
-rw-r--r--svl/inc/svl/cintitem.hxx96
-rw-r--r--svl/inc/svl/cntnrsrt.hxx (renamed from svl/inc/cntnrsrt.hxx)38
-rw-r--r--svl/inc/svl/cntwall.hxx20
-rw-r--r--svl/inc/svl/cntwids.hrc (renamed from svl/inc/cntwids.hrc)0
-rw-r--r--svl/inc/svl/converter.hxx (renamed from svl/inc/converter.hxx)4
-rw-r--r--svl/inc/svl/ctypeitm.hxx14
-rw-r--r--svl/inc/svl/custritm.hxx8
-rw-r--r--svl/inc/svl/dateitem.hxx16
-rw-r--r--svl/inc/svl/eitem.hxx10
-rw-r--r--svl/inc/svl/filenotation.hxx (renamed from svl/inc/filenotation.hxx)2
-rw-r--r--svl/inc/svl/filerec.hxx290
-rw-r--r--svl/inc/svl/flagitem.hxx24
-rw-r--r--svl/inc/svl/folderrestriction.hxx (renamed from svl/inc/folderrestriction.hxx)0
-rw-r--r--svl/inc/svl/fstathelper.hxx (renamed from svl/inc/fstathelper.hxx)0
-rw-r--r--svl/inc/svl/globalnameitem.hxx6
-rw-r--r--svl/inc/svl/hint.hxx10
-rw-r--r--svl/inc/svl/httpcook.hxx10
-rw-r--r--svl/inc/svl/ilstitem.hxx6
-rw-r--r--svl/inc/svl/imageitm.hxx12
-rw-r--r--svl/inc/svl/inetdef.hxx (renamed from svl/inc/inetdef.hxx)0
-rw-r--r--svl/inc/svl/inethist.hxx12
-rw-r--r--svl/inc/svl/inetmsg.hxx (renamed from svl/inc/inetmsg.hxx)0
-rw-r--r--svl/inc/svl/inetstrm.hxx (renamed from svl/inc/inetstrm.hxx)0
-rw-r--r--svl/inc/svl/instrm.hxx (renamed from svl/inc/instrm.hxx)16
-rw-r--r--svl/inc/svl/intitem.hxx48
-rw-r--r--svl/inc/svl/itemiter.hxx12
-rw-r--r--svl/inc/svl/itempool.hxx112
-rw-r--r--svl/inc/svl/itemprop.hxx16
-rw-r--r--svl/inc/svl/itemset.hxx68
-rw-r--r--svl/inc/svl/lckbitem.hxx12
-rw-r--r--svl/inc/svl/listener.hxx (renamed from svl/inc/listener.hxx)8
-rw-r--r--svl/inc/svl/listeneriter.hxx (renamed from svl/inc/listeneriter.hxx)0
-rw-r--r--svl/inc/svl/lngmisc.hxx (renamed from svl/inc/lngmisc.hxx)17
-rw-r--r--svl/inc/svl/lstner.hxx12
-rw-r--r--svl/inc/svl/macitem.hxx36
-rw-r--r--svl/inc/svl/mailenum.hxx8
-rw-r--r--svl/inc/svl/metitem.hxx4
-rw-r--r--svl/inc/svl/nfsymbol.hxx (renamed from svl/inc/nfsymbol.hxx)0
-rw-r--r--svl/inc/svl/nranges.hxx14
-rw-r--r--svl/inc/svl/numuno.hxx (renamed from svl/inc/numuno.hxx)0
-rw-r--r--svl/inc/svl/outstrm.hxx (renamed from svl/inc/outstrm.hxx)10
-rw-r--r--svl/inc/svl/ownlist.hxx4
-rw-r--r--svl/inc/svl/pickerhelper.hxx (renamed from svl/inc/pickerhelper.hxx)0
-rw-r--r--svl/inc/svl/pickerhistory.hxx (renamed from svl/inc/pickerhistory.hxx)0
-rw-r--r--svl/inc/svl/pickerhistoryaccess.hxx (renamed from svl/inc/pickerhistoryaccess.hxx)0
-rw-r--r--svl/inc/svl/poolcach.hxx (renamed from svl/inc/poolcach.hxx)15
-rw-r--r--svl/inc/svl/poolitem.hxx65
-rw-r--r--svl/inc/svl/ptitem.hxx12
-rw-r--r--svl/inc/svl/rectitem.hxx12
-rw-r--r--svl/inc/svl/rngitem.hxx22
-rw-r--r--svl/inc/svl/sfontitm.hxx8
-rw-r--r--svl/inc/svl/slstitm.hxx14
-rw-r--r--svl/inc/svl/smplhint.hxx10
-rw-r--r--svl/inc/svl/srchitem.hxx10
-rw-r--r--svl/inc/svl/stritem.hxx8
-rw-r--r--svl/inc/svl/strmadpt.hxx (renamed from svl/inc/strmadpt.hxx)16
-rw-r--r--svl/inc/svl/style.hxx120
-rw-r--r--svl/inc/svl/stylepool.hxx (renamed from svl/inc/stylepool.hxx)0
-rw-r--r--svl/inc/svl/svarray.hxx494
-rw-r--r--svl/inc/svl/svdde.hxx64
-rw-r--r--svl/inc/svl/svldata.hxx2
-rw-r--r--svl/inc/svl/svstdarr.hxx45
-rw-r--r--svl/inc/svl/szitem.hxx12
-rw-r--r--svl/inc/svl/undo.hxx377
-rw-r--r--svl/inc/svl/urihelper.hxx (renamed from svl/inc/urihelper.hxx)0
-rw-r--r--svl/inc/svl/urlbmk.hxx (renamed from svl/inc/urlbmk.hxx)0
-rw-r--r--svl/inc/svl/visitem.hxx20
-rw-r--r--svl/inc/svl/whiter.hxx (renamed from svl/inc/whiter.hxx)16
-rw-r--r--svl/inc/svl/xmlement.hxx (renamed from svl/inc/xmlement.hxx)0
-rw-r--r--svl/inc/svl/zforlist.hxx176
-rw-r--r--svl/inc/svl/zformat.hxx224
-rw-r--r--svl/prj/build.lst26
-rw-r--r--svl/prj/d.lst22
-rw-r--r--svl/prj/makefile.mk (renamed from sot/util/makefile.pmk)15
-rw-r--r--svl/qa/complex/ConfigItems/CheckConfigItems.java129
-rw-r--r--svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx26
-rw-r--r--svl/qa/complex/ConfigItems/helper/makefile.mk72
-rw-r--r--svl/qa/complex/ConfigItems/makefile.mk83
-rw-r--r--svl/qa/complex/passwordcontainer/MasterPasswdHandler.java8
-rw-r--r--svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java81
-rw-r--r--svl/qa/complex/passwordcontainer/Test01.java10
-rw-r--r--svl/qa/complex/passwordcontainer/Test02.java11
-rw-r--r--svl/qa/complex/passwordcontainer/Test03.java12
-rw-r--r--svl/qa/complex/passwordcontainer/TestHelper.java14
-rw-r--r--svl/qa/complex/passwordcontainer/makefile.mk87
-rw-r--r--svl/qa/makefile.mk91
-rw-r--r--svl/source/config/languageoptions.cxx2
-rw-r--r--svl/source/config/makefile.mk52
-rw-r--r--svl/source/filepicker/makefile.mk47
-rw-r--r--svl/source/filepicker/pickerhelper.cxx101
-rw-r--r--svl/source/filepicker/pickerhistory.cxx4
-rw-r--r--svl/source/filerec/filerec.cxx190
-rw-r--r--svl/source/fsstor/fsfactory.cxx24
-rw-r--r--svl/source/fsstor/fsstorage.component35
-rw-r--r--svl/source/fsstor/makefile.mk66
-rw-r--r--svl/source/inc/passwordcontainer.hxx6
-rw-r--r--svl/source/inc/poolio.hxx111
-rw-r--r--svl/source/items/aeitem.cxx50
-rw-r--r--svl/source/items/cenumitm.cxx52
-rw-r--r--svl/source/items/cintitem.cxx64
-rw-r--r--svl/source/items/cntwall.cxx28
-rw-r--r--svl/source/items/ctypeitm.cxx24
-rw-r--r--svl/source/items/custritm.cxx4
-rw-r--r--svl/source/items/dateitem.cxx16
-rw-r--r--svl/source/items/flagitem.cxx22
-rw-r--r--svl/source/items/globalnameitem.cxx6
-rw-r--r--svl/source/items/ilstitem.cxx12
-rw-r--r--svl/source/items/imageitm.cxx18
-rw-r--r--svl/source/items/intitem.cxx22
-rw-r--r--svl/source/items/itempool.cxx205
-rw-r--r--svl/source/items/itemprop.cxx22
-rw-r--r--svl/source/items/itemset.cxx521
-rw-r--r--svl/source/items/lckbitem.cxx22
-rw-r--r--svl/source/items/macitem.cxx26
-rw-r--r--svl/source/items/makefile.mk84
-rw-r--r--svl/source/items/nranges.cxx32
-rw-r--r--svl/source/items/poolcach.cxx24
-rw-r--r--svl/source/items/poolio.cxx445
-rw-r--r--svl/source/items/poolitem.cxx30
-rw-r--r--svl/source/items/ptitem.cxx16
-rw-r--r--svl/source/items/rectitem.cxx12
-rw-r--r--svl/source/items/rngitem.cxx2
-rwxr-xr-x[-rw-r--r--]svl/source/items/rngitem_inc.cxx20
-rw-r--r--svl/source/items/sfontitm.cxx12
-rw-r--r--svl/source/items/sitem.cxx10
-rw-r--r--svl/source/items/slstitm.cxx42
-rw-r--r--svl/source/items/srchitem.cxx12
-rw-r--r--svl/source/items/stritem.cxx6
-rw-r--r--svl/source/items/style.cxx238
-rw-r--r--svl/source/items/stylepool.cxx6
-rw-r--r--svl/source/items/szitem.cxx12
-rw-r--r--svl/source/items/visitem.cxx18
-rw-r--r--svl/source/items/whassert.hxx2
-rw-r--r--svl/source/items/whiter.cxx20
-rw-r--r--svl/source/memtools/svarray.cxx119
-rw-r--r--svl/source/misc/PasswordHelper.cxx2
-rw-r--r--svl/source/misc/adrparse.cxx2
-rw-r--r--svl/source/misc/filenotation.cxx2
-rw-r--r--svl/source/misc/folderrestriction.cxx2
-rw-r--r--svl/source/misc/fstathelper.cxx9
-rw-r--r--svl/source/misc/inethist.cxx98
-rw-r--r--svl/source/misc/inettype.cxx22
-rw-r--r--svl/source/misc/lngmisc.cxx78
-rw-r--r--svl/source/misc/makefile.mk70
-rw-r--r--svl/source/misc/ownlist.cxx40
-rw-r--r--svl/source/misc/strmadpt.cxx66
-rw-r--r--svl/source/misc/svldata.cxx2
-rw-r--r--svl/source/misc/urihelper.cxx2
-rw-r--r--svl/source/notify/brdcst.cxx28
-rw-r--r--svl/source/notify/broadcast.cxx14
-rw-r--r--svl/source/notify/listener.cxx21
-rw-r--r--svl/source/notify/listenerbase.cxx7
-rw-r--r--svl/source/notify/listeneriter.cxx6
-rw-r--r--svl/source/notify/lstner.cxx20
-rw-r--r--svl/source/notify/makefile.mk62
-rw-r--r--svl/source/notify/smplhint.cxx2
-rw-r--r--svl/source/numbers/makefile.mk74
-rw-r--r--svl/source/numbers/nbdll.cxx76
-rw-r--r--svl/source/numbers/numfmuno.cxx58
-rw-r--r--svl/source/numbers/numfmuno.hxx4
-rw-r--r--svl/source/numbers/numhead.cxx38
-rw-r--r--svl/source/numbers/numhead.hxx22
-rw-r--r--svl/source/numbers/numuno.cxx2
-rw-r--r--svl/source/numbers/supservs.cxx4
-rw-r--r--svl/source/numbers/supservs.hxx2
-rw-r--r--svl/source/numbers/zforfind.cxx446
-rw-r--r--svl/source/numbers/zforfind.hxx132
-rw-r--r--svl/source/numbers/zforlist.cxx502
-rw-r--r--svl/source/numbers/zformat.cxx654
-rw-r--r--svl/source/numbers/zforscan.cxx168
-rw-r--r--svl/source/numbers/zforscan.hxx86
-rw-r--r--svl/source/passwordcontainer/makefile.mk62
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.component34
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx18
-rw-r--r--svl/source/svdde/ddecli.cxx28
-rw-r--r--svl/source/svdde/ddedata.cxx22
-rw-r--r--svl/source/svdde/ddeimp.hxx14
-rw-r--r--svl/source/svdde/ddemlos2.h377
-rw-r--r--svl/source/svdde/ddestrg.cxx4
-rw-r--r--svl/source/svdde/ddesvr.cxx98
-rw-r--r--svl/source/svdde/makefile.mk60
-rw-r--r--svl/source/svsql/converter.cxx6
-rw-r--r--svl/source/svsql/makefile.mk46
-rw-r--r--svl/source/undo/makefile.mk47
-rw-r--r--svl/source/undo/undo.cxx1242
-rw-r--r--svl/source/uno/makefile.mk47
-rw-r--r--svl/source/uno/registerservices.cxx31
-rw-r--r--svl/unx/source/svdde/ddedummy.cxx52
-rw-r--r--svl/unx/source/svdde/makefile.mk46
-rw-r--r--svl/util/makefile.mk120
-rw-r--r--svl/util/svl.component40
-rw-r--r--svtools/AllLangResTarget_productregistration.mk (renamed from comphelper/source/processfactory/makefile.mk)33
-rw-r--r--svtools/AllLangResTarget_svt.mk71
-rw-r--r--svtools/Executable_bmp.mk54
-rw-r--r--svtools/Executable_bmpsum.mk (renamed from comphelper/source/officeinstdir/makefile.mk)48
-rw-r--r--svtools/Executable_g2g.mk (renamed from comphelper/source/eventattachermgr/makefile.mk)50
-rw-r--r--svtools/JunitTest_svtools_unoapi.mk (renamed from comphelper/source/container/makefile.mk)46
-rw-r--r--svtools/Library_hatchwindowfactory.mk60
-rw-r--r--svtools/Library_productregistration.mk60
-rw-r--r--svtools/Library_svt.mk309
-rw-r--r--svtools/Makefile38
-rw-r--r--svtools/Module_svtools.mk52
-rw-r--r--svtools/Package_inc.mk196
-rw-r--r--svtools/bmpmaker/bmp.cxx26
-rw-r--r--svtools/bmpmaker/bmp.src8
-rw-r--r--svtools/bmpmaker/bmpcore.cxx12
-rw-r--r--svtools/bmpmaker/bmpcore.hxx8
-rw-r--r--svtools/bmpmaker/bmpsum.cxx14
-rw-r--r--svtools/bmpmaker/g2g.cxx24
-rw-r--r--svtools/bmpmaker/makefile.mk72
-rw-r--r--svtools/inc/makefile.mk48
-rw-r--r--svtools/inc/pch/precompiled_svtools.hxx4
-rw-r--r--svtools/inc/svtools/DocumentInfoPreview.hxx (renamed from svtools/inc/DocumentInfoPreview.hxx)2
-rw-r--r--svtools/inc/svtools/QueryFolderName.hxx (renamed from svtools/inc/QueryFolderName.hxx)0
-rw-r--r--svtools/inc/svtools/acceleratorexecute.hxx (renamed from svtools/inc/acceleratorexecute.hxx)2
-rw-r--r--svtools/inc/svtools/accessiblefactory.hxx11
-rw-r--r--svtools/inc/svtools/accessibletable.hxx16
-rw-r--r--svtools/inc/svtools/accessibletableprovider.hxx16
-rw-r--r--svtools/inc/svtools/addresstemplate.hxx (renamed from svtools/inc/addresstemplate.hxx)2
-rw-r--r--svtools/inc/svtools/apearcfg.hxx (renamed from svtools/inc/apearcfg.hxx)52
-rw-r--r--svtools/inc/svtools/asynclink.hxx (renamed from svtools/inc/asynclink.hxx)16
-rw-r--r--svtools/inc/svtools/borderhelper.hxx (renamed from svtools/inc/borderhelper.hxx)4
-rw-r--r--svtools/inc/svtools/brwbox.hxx254
-rw-r--r--svtools/inc/svtools/calendar.hxx (renamed from svtools/inc/calendar.hxx)96
-rw-r--r--svtools/inc/svtools/cliplistener.hxx (renamed from svtools/inc/cliplistener.hxx)2
-rw-r--r--svtools/inc/svtools/colctrl.hxx70
-rw-r--r--svtools/inc/svtools/collatorres.hxx (renamed from svtools/inc/collatorres.hxx)0
-rw-r--r--svtools/inc/svtools/contextmenuhelper.hxx (renamed from svtools/inc/contextmenuhelper.hxx)0
-rw-r--r--svtools/inc/svtools/controldims.hrc (renamed from svtools/inc/controldims.hrc)0
-rw-r--r--svtools/inc/svtools/ctrlbox.hxx (renamed from svtools/inc/ctrlbox.hxx)164
-rw-r--r--svtools/inc/svtools/ctrltool.hxx (renamed from svtools/inc/ctrltool.hxx)44
-rw-r--r--svtools/inc/svtools/dialogclosedlistener.hxx (renamed from svtools/inc/dialogclosedlistener.hxx)0
-rw-r--r--svtools/inc/svtools/dialogcontrolling.hxx (renamed from svtools/inc/dialogcontrolling.hxx)0
-rw-r--r--svtools/inc/svtools/editbrowsebox.hxx22
-rw-r--r--svtools/inc/svtools/editimplementation.hxx4
-rw-r--r--svtools/inc/svtools/editsyntaxhighlighter.hxx2
-rw-r--r--svtools/inc/svtools/ehdl.hxx32
-rw-r--r--svtools/inc/svtools/embedhlp.hxx20
-rw-r--r--svtools/inc/svtools/expander.hxx (renamed from svtools/inc/expander.hxx)10
-rw-r--r--svtools/inc/svtools/extcolorcfg.hxx (renamed from svtools/inc/extcolorcfg.hxx)0
-rw-r--r--svtools/inc/svtools/filectrl.hxx (renamed from svtools/inc/filectrl.hxx)22
-rw-r--r--svtools/inc/svtools/filedlg.hxx (renamed from svtools/inc/filedlg.hxx)8
-rw-r--r--svtools/inc/svtools/filedlg2.hrc (renamed from svtools/inc/filedlg2.hrc)0
-rw-r--r--svtools/inc/svtools/fileview.hxx (renamed from svtools/inc/fileview.hxx)8
-rw-r--r--svtools/inc/svtools/filter.hxx297
-rw-r--r--svtools/inc/svtools/filterutils.hxx (renamed from svtools/inc/filterutils.hxx)0
-rw-r--r--svtools/inc/svtools/fltcall.hxx8
-rw-r--r--svtools/inc/svtools/fltdefs.hxx (renamed from svtools/inc/fltdefs.hxx)80
-rw-r--r--svtools/inc/svtools/fmtfield.hxx100
-rw-r--r--svtools/inc/svtools/fontsubstconfig.hxx (renamed from svtools/inc/fontsubstconfig.hxx)0
-rw-r--r--svtools/inc/svtools/framestatuslistener.hxx (renamed from svtools/inc/framestatuslistener.hxx)0
-rw-r--r--svtools/inc/svtools/generictoolboxcontroller.hxx2
-rw-r--r--svtools/inc/svtools/grfmgr.hxx192
-rw-r--r--svtools/inc/svtools/headbar.hxx140
-rw-r--r--svtools/inc/svtools/helpagentwindow.hxx (renamed from svtools/inc/helpagentwindow.hxx)0
-rw-r--r--svtools/inc/svtools/helpid.hrc141
-rw-r--r--svtools/inc/svtools/htmlcfg.hxx36
-rw-r--r--svtools/inc/svtools/htmlkywd.hxx (renamed from svtools/inc/htmlkywd.hxx)0
-rw-r--r--svtools/inc/svtools/htmlout.hxx16
-rw-r--r--svtools/inc/svtools/htmltokn.h (renamed from svtools/inc/htmltokn.h)2
-rw-r--r--svtools/inc/svtools/imagemgr.hrc (renamed from svtools/inc/imagemgr.hrc)0
-rw-r--r--svtools/inc/svtools/imagemgr.hxx (renamed from svtools/inc/imagemgr.hxx)0
-rw-r--r--svtools/inc/svtools/imageresourceaccess.hxx (renamed from svtools/inc/imageresourceaccess.hxx)0
-rw-r--r--svtools/inc/svtools/imap.hxx34
-rw-r--r--svtools/inc/svtools/imapcirc.hxx20
-rw-r--r--svtools/inc/svtools/imapobj.hxx44
-rw-r--r--svtools/inc/svtools/imappoly.hxx20
-rw-r--r--svtools/inc/svtools/imaprect.hxx14
-rw-r--r--svtools/inc/svtools/imgdef.hxx (renamed from svtools/inc/imgdef.hxx)0
-rw-r--r--svtools/inc/svtools/indexentryres.hxx (renamed from svtools/inc/indexentryres.hxx)0
-rw-r--r--svtools/inc/svtools/inetimg.hxx (renamed from svtools/inc/inetimg.hxx)4
-rw-r--r--svtools/inc/svtools/inettbc.hxx28
-rw-r--r--svtools/inc/svtools/itemdel.hxx (renamed from svtools/inc/itemdel.hxx)0
-rw-r--r--svtools/inc/svtools/ivctrl.hxx (renamed from svtools/inc/ivctrl.hxx)108
-rw-r--r--svtools/inc/svtools/javainteractionhandler.hxx2
-rw-r--r--svtools/inc/svtools/localresaccess.hxx (renamed from svtools/inc/localresaccess.hxx)2
-rw-r--r--svtools/inc/svtools/parhtml.hxx96
-rw-r--r--svtools/inc/svtools/parrtf.hxx12
-rw-r--r--svtools/inc/svtools/prgsbar.hxx (renamed from svtools/inc/prgsbar.hxx)14
-rw-r--r--svtools/inc/svtools/printdlg.hxx285
-rw-r--r--svtools/inc/svtools/prnsetup.hxx2
-rw-r--r--svtools/inc/svtools/roadmap.hxx (renamed from svtools/inc/roadmap.hxx)0
-rw-r--r--svtools/inc/svtools/roadmapwizard.hxx4
-rw-r--r--svtools/inc/svtools/rtfkeywd.hxx (renamed from svtools/inc/rtfkeywd.hxx)0
-rw-r--r--svtools/inc/svtools/rtfout.hxx (renamed from svtools/inc/rtfout.hxx)10
-rw-r--r--svtools/inc/svtools/rtftoken.h (renamed from svtools/inc/rtftoken.h)0
-rw-r--r--svtools/inc/svtools/ruler.hxx (renamed from svtools/inc/ruler.hxx)194
-rw-r--r--svtools/inc/svtools/scriptedtext.hxx (renamed from svtools/inc/scriptedtext.hxx)0
-rw-r--r--svtools/inc/svtools/scrwin.hxx (renamed from svtools/inc/scrwin.hxx)14
-rw-r--r--svtools/inc/svtools/sfxecode.hxx (renamed from svtools/inc/sfxecode.hxx)0
-rw-r--r--svtools/inc/svtools/soerr.hxx (renamed from svtools/inc/soerr.hxx)0
-rw-r--r--svtools/inc/svtools/sores.hxx (renamed from svtools/inc/sores.hxx)0
-rw-r--r--svtools/inc/svtools/statusbarcontroller.hxx (renamed from svtools/inc/statusbarcontroller.hxx)0
-rw-r--r--svtools/inc/svtools/stdmenu.hxx (renamed from svtools/inc/stdmenu.hxx)2
-rw-r--r--svtools/inc/svtools/svicnvw.hxx79
-rw-r--r--svtools/inc/svtools/svlbitm.hxx72
-rw-r--r--svtools/inc/svtools/svlbox.hxx190
-rw-r--r--svtools/inc/svtools/svmedit.hxx36
-rw-r--r--svtools/inc/svtools/svmedit2.hxx12
-rw-r--r--svtools/inc/svtools/svparser.hxx72
-rw-r--r--svtools/inc/svtools/svtabbx.hxx94
-rw-r--r--svtools/inc/svtools/svtdata.hxx26
-rw-r--r--svtools/inc/svtools/svtools.hrc35
-rw-r--r--svtools/inc/svtools/svtreebx.hxx142
-rw-r--r--svtools/inc/svtools/svxbox.hxx74
-rw-r--r--svtools/inc/svtools/sychconv.hxx (renamed from svtools/inc/sychconv.hxx)2
-rw-r--r--svtools/inc/svtools/syntaxhighlight.hxx33
-rw-r--r--svtools/inc/svtools/tabbar.hxx (renamed from svtools/inc/tabbar.hxx)192
-rw-r--r--svtools/inc/svtools/table/abstracttablecontrol.hxx137
-rw-r--r--svtools/inc/svtools/table/defaultinputhandler.hxx41
-rw-r--r--svtools/inc/svtools/table/gridtablerenderer.hxx50
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx165
-rw-r--r--svtools/inc/svtools/table/tablecontrolinterface.hxx254
-rw-r--r--svtools/inc/svtools/table/tableinputhandler.hxx22
-rwxr-xr-x[-rw-r--r--]svtools/inc/svtools/table/tablemodel.hxx331
-rw-r--r--svtools/inc/svtools/table/tablerenderer.hxx79
-rwxr-xr-xsvtools/inc/svtools/table/tablesort.hxx91
-rw-r--r--svtools/inc/svtools/table/tabletypes.hxx7
-rw-r--r--svtools/inc/svtools/taskbar.hxx (renamed from svtools/inc/taskbar.hxx)126
-rw-r--r--svtools/inc/svtools/templatefoldercache.hxx (renamed from svtools/inc/templatefoldercache.hxx)0
-rw-r--r--svtools/inc/svtools/templdlg.hxx (renamed from svtools/inc/templdlg.hxx)0
-rw-r--r--svtools/inc/svtools/testtool.hxx (renamed from svtools/inc/testtool.hxx)6
-rw-r--r--svtools/inc/svtools/textdata.hxx96
-rw-r--r--svtools/inc/svtools/texteng.hxx223
-rw-r--r--svtools/inc/svtools/textview.hxx70
-rw-r--r--svtools/inc/svtools/toolpanel/paneltabbar.hxx2
-rw-r--r--svtools/inc/svtools/toolpanel/toolpanel.hxx3
-rw-r--r--svtools/inc/svtools/toolpanel/toolpaneldeck.hxx2
-rw-r--r--svtools/inc/svtools/tooltiplbox.hxx (renamed from svtools/inc/tooltiplbox.hxx)0
-rw-r--r--svtools/inc/svtools/transfer.hxx8
-rw-r--r--svtools/inc/svtools/treelist.hxx236
-rw-r--r--svtools/inc/svtools/ttprops.hxx40
-rw-r--r--svtools/inc/svtools/txtattr.hxx (renamed from svtools/inc/txtattr.hxx)54
-rw-r--r--svtools/inc/svtools/txtcmp.hxx (renamed from svtools/inc/txtcmp.hxx)0
-rw-r--r--svtools/inc/svtools/unitconv.hxx6
-rw-r--r--svtools/inc/svtools/unoevent.hxx (renamed from svtools/inc/unoevent.hxx)0
-rw-r--r--svtools/inc/svtools/unoimap.hxx (renamed from svtools/inc/unoimap.hxx)0
-rw-r--r--svtools/inc/svtools/valueset.hxx162
-rw-r--r--svtools/inc/svtools/wallitem.hxx (renamed from svtools/inc/wallitem.hxx)2
-rw-r--r--svtools/inc/svtools/wizardmachine.hxx4
-rw-r--r--svtools/inc/svtools/wizdlg.hxx30
-rw-r--r--svtools/inc/svtools/wmf.hxx12
-rw-r--r--svtools/inc/svtools/xtextedt.hxx18
-rw-r--r--svtools/inc/svtools/xwindowitem.hxx4
-rw-r--r--svtools/prj/build.lst35
-rw-r--r--svtools/prj/d.lst40
-rw-r--r--svtools/prj/makefile.mk40
-rw-r--r--svtools/qa/unoapi/Test.java5
-rw-r--r--svtools/qa/unoapi/makefile.mk48
-rw-r--r--svtools/source/brwbox/brwbox1.cxx340
-rw-r--r--svtools/source/brwbox/brwbox2.cxx322
-rw-r--r--svtools/source/brwbox/brwbox3.cxx14
-rw-r--r--svtools/source/brwbox/brwhead.cxx4
-rw-r--r--svtools/source/brwbox/datwin.cxx105
-rw-r--r--svtools/source/brwbox/datwin.hxx60
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx28
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/brwbox/editbrowsebox2.cxx8
-rw-r--r--svtools/source/brwbox/makefile.mk59
-rw-r--r--svtools/source/config/accessibilityoptions.cxx4
-rw-r--r--svtools/source/config/apearcfg.cxx103
-rw-r--r--svtools/source/config/colorcfg.cxx10
-rw-r--r--svtools/source/config/extcolorcfg.cxx2
-rw-r--r--svtools/source/config/fontsubstconfig.cxx2
-rw-r--r--svtools/source/config/htmlcfg.cxx44
-rw-r--r--svtools/source/config/itemholder2.cxx4
-rw-r--r--svtools/source/config/makefile.mk58
-rw-r--r--svtools/source/config/menuoptions.cxx13
-rw-r--r--svtools/source/config/miscopt.cxx6
-rw-r--r--svtools/source/config/printoptions.cxx6
-rw-r--r--svtools/source/contnr/cont_pch.cxx43
-rw-r--r--svtools/source/contnr/contentenumeration.cxx2
-rw-r--r--svtools/source/contnr/ctrdll.cxx76
-rw-r--r--svtools/source/contnr/fileview.cxx97
-rw-r--r--svtools/source/contnr/fileview.src4
-rw-r--r--svtools/source/contnr/imivctl.hxx278
-rw-r--r--svtools/source/contnr/imivctl1.cxx850
-rw-r--r--svtools/source/contnr/imivctl2.cxx182
-rw-r--r--svtools/source/contnr/ivctrl.cxx90
-rw-r--r--svtools/source/contnr/makefile.mk82
-rw-r--r--svtools/source/contnr/svicnvw.cxx102
-rw-r--r--svtools/source/contnr/svimpbox.cxx730
-rw-r--r--svtools/source/contnr/svimpicn.cxx662
-rw-r--r--svtools/source/contnr/svlbitm.cxx130
-rw-r--r--svtools/source/contnr/svlbox.cxx351
-rw-r--r--svtools/source/contnr/svtabbx.cxx166
-rw-r--r--svtools/source/contnr/svtreebx.cxx317
-rw-r--r--svtools/source/contnr/templwin.cxx83
-rw-r--r--svtools/source/contnr/templwin.hxx16
-rw-r--r--svtools/source/contnr/templwin.src4
-rw-r--r--svtools/source/contnr/tooltiplbox.cxx2
-rw-r--r--svtools/source/contnr/treelist.cxx314
-rwxr-xr-x[-rw-r--r--]svtools/source/control/asynclink.cxx14
-rw-r--r--svtools/source/control/calendar.cxx496
-rw-r--r--svtools/source/control/collatorres.cxx4
-rw-r--r--svtools/source/control/ctrlbox.cxx203
-rw-r--r--svtools/source/control/ctrldll.cxx75
-rw-r--r--svtools/source/control/ctrltool.cxx63
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl.cxx14
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl.src17
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl2.cxx2
-rwxr-xr-x[-rw-r--r--]svtools/source/control/fmtfield.cxx170
-rwxr-xr-x[-rw-r--r--]svtools/source/control/headbar.cxx302
-rw-r--r--svtools/source/control/indexentryres.cxx4
-rwxr-xr-x[-rw-r--r--]svtools/source/control/inettbc.cxx156
-rwxr-xr-xsvtools/source/control/makefile.mk87
-rwxr-xr-x[-rw-r--r--]svtools/source/control/prgsbar.cxx34
-rwxr-xr-x[-rw-r--r--]svtools/source/control/roadmap.cxx15
-rwxr-xr-x[-rw-r--r--]svtools/source/control/ruler.cxx369
-rwxr-xr-x[-rw-r--r--]svtools/source/control/scriptedtext.cxx5
-rwxr-xr-x[-rw-r--r--]svtools/source/control/scrwin.cxx44
-rwxr-xr-x[-rw-r--r--]svtools/source/control/stdctrl.cxx2
-rwxr-xr-x[-rw-r--r--]svtools/source/control/stdmenu.cxx107
-rwxr-xr-x[-rw-r--r--]svtools/source/control/svxbox.cxx132
-rw-r--r--svtools/source/control/tabbar.cxx481
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskbar.cxx27
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskbox.cxx25
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskmisc.cxx23
-rwxr-xr-x[-rw-r--r--]svtools/source/control/taskstat.cxx140
-rw-r--r--svtools/source/control/toolbarmenu.cxx42
-rw-r--r--svtools/source/control/toolbarmenuacc.cxx8
-rw-r--r--svtools/source/control/toolbarmenuimp.hxx2
-rw-r--r--svtools/source/control/valueacc.cxx38
-rw-r--r--svtools/source/control/valueimp.hxx12
-rw-r--r--svtools/source/control/valueset.cxx362
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx13
-rw-r--r--svtools/source/dialogs/addresstemplate.src6
-rw-r--r--svtools/source/dialogs/colctrl.cxx100
-rw-r--r--svtools/source/dialogs/colrdlg.cxx30
-rw-r--r--svtools/source/dialogs/colrdlg.hrc2
-rw-r--r--svtools/source/dialogs/colrdlg.src22
-rw-r--r--svtools/source/dialogs/filedlg.cxx14
-rw-r--r--svtools/source/dialogs/filedlg2.cxx145
-rw-r--r--svtools/source/dialogs/filedlg2.hxx20
-rw-r--r--svtools/source/dialogs/filedlg2.src3
-rw-r--r--svtools/source/dialogs/formats.src2
-rw-r--r--svtools/source/dialogs/insdlg.cxx10
-rwxr-xr-xsvtools/source/dialogs/makefile.mk81
-rw-r--r--svtools/source/dialogs/mcvmath.cxx32
-rw-r--r--svtools/source/dialogs/mcvmath.hxx16
-rw-r--r--svtools/source/dialogs/printdlg.cxx787
-rw-r--r--svtools/source/dialogs/printdlg.hrc74
-rw-r--r--svtools/source/dialogs/printdlg.src289
-rw-r--r--svtools/source/dialogs/prnsetup.cxx14
-rw-r--r--svtools/source/dialogs/prnsetup.src4
-rw-r--r--svtools/source/dialogs/propctrl.cxx499
-rw-r--r--svtools/source/dialogs/propctrl.hxx109
-rw-r--r--svtools/source/dialogs/property.cxx172
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx10
-rw-r--r--svtools/source/dialogs/so3res.src5
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx4
-rw-r--r--svtools/source/dialogs/wizdlg.cxx52
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx26
-rw-r--r--svtools/source/edit/makefile.mk71
-rw-r--r--svtools/source/edit/svmedit.cxx278
-rw-r--r--svtools/source/edit/svmedit2.cxx14
-rw-r--r--svtools/source/edit/sychconv.cxx20
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx213
-rw-r--r--svtools/source/edit/textdat2.hxx138
-rw-r--r--svtools/source/edit/textdata.cxx76
-rw-r--r--svtools/source/edit/textdoc.cxx163
-rw-r--r--svtools/source/edit/textdoc.hxx62
-rw-r--r--svtools/source/edit/texteng.cxx678
-rw-r--r--svtools/source/edit/textund2.hxx32
-rw-r--r--svtools/source/edit/textundo.cxx75
-rw-r--r--svtools/source/edit/textundo.hxx8
-rw-r--r--svtools/source/edit/textview.cxx442
-rw-r--r--svtools/source/edit/txtattr.cxx2
-rw-r--r--svtools/source/edit/xtextedt.cxx86
-rw-r--r--svtools/source/filter.vcl/filter/FilterConfigCache.cxx2
-rw-r--r--svtools/source/filter.vcl/filter/FilterConfigItem.cxx6
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx143
-rw-r--r--svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx20
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.cxx98
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hxx74
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.src101
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.cxx93
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hrc35
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.hxx74
-rw-r--r--svtools/source/filter.vcl/filter/dlgepng.src89
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.cxx444
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hrc58
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hxx129
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.src276
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.cxx1513
-rwxr-xr-xsvtools/source/filter.vcl/filter/exportdialog.hrc99
-rwxr-xr-xsvtools/source/filter.vcl/filter/exportdialog.hxx216
-rw-r--r--svtools/source/filter.vcl/filter/exportdialog.src529
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx386
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx874
-rw-r--r--svtools/source/filter.vcl/filter/makefile.mk97
-rw-r--r--svtools/source/filter.vcl/filter/sgfbram.cxx138
-rw-r--r--svtools/source/filter.vcl/filter/sgvmain.cxx213
-rw-r--r--svtools/source/filter.vcl/filter/sgvspln.cxx87
-rw-r--r--svtools/source/filter.vcl/filter/sgvtext.cxx374
-rw-r--r--svtools/source/filter.vcl/filter/strings.hrc27
-rw-r--r--svtools/source/filter.vcl/filter/strings.src58
-rw-r--r--svtools/source/filter.vcl/igif/decode.cxx50
-rw-r--r--svtools/source/filter.vcl/igif/decode.hxx32
-rw-r--r--svtools/source/filter.vcl/igif/gifread.cxx170
-rw-r--r--svtools/source/filter.vcl/igif/makefile.mk45
-rw-r--r--svtools/source/filter.vcl/ixbm/xbmread.cxx52
-rw-r--r--svtools/source/filter.vcl/ixpm/makefile.mk43
-rw-r--r--svtools/source/filter.vcl/ixpm/rgbtable.hxx6
-rw-r--r--svtools/source/filter.vcl/ixpm/xpmread.cxx164
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx58
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.h5
-rw-r--r--svtools/source/filter.vcl/jpeg/jpegc.c14
-rw-r--r--svtools/source/filter.vcl/jpeg/makefile.mk48
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.cxx168
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.hxx30
-rw-r--r--svtools/source/filter.vcl/wmf/enhwmf.cxx224
-rw-r--r--svtools/source/filter.vcl/wmf/makefile.mk50
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx94
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.hxx100
-rw-r--r--svtools/source/filter.vcl/wmf/winwmf.cxx100
-rw-r--r--svtools/source/filter.vcl/wmf/wmf.cxx32
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.cxx134
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.hxx56
-rw-r--r--svtools/source/graphic/descriptor.cxx2
-rw-r--r--svtools/source/graphic/descriptor.hxx2
-rw-r--r--svtools/source/graphic/grfattr.cxx8
-rw-r--r--svtools/source/graphic/grfcache.cxx136
-rw-r--r--svtools/source/graphic/grfcache.hxx42
-rw-r--r--svtools/source/graphic/grfmgr.cxx136
-rw-r--r--svtools/source/graphic/grfmgr2.cxx142
-rw-r--r--svtools/source/graphic/makefile.mk69
-rw-r--r--svtools/source/graphic/provider.cxx2
-rw-r--r--svtools/source/hatchwindow/hatchwindow.cxx6
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.component38
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.cxx41
-rw-r--r--svtools/source/hatchwindow/ipwin.cxx24
-rw-r--r--svtools/source/hatchwindow/ipwin.hxx8
-rw-r--r--svtools/source/hatchwindow/makefile.mk65
-rw-r--r--svtools/source/inc/filectrl.hrc7
-rw-r--r--svtools/source/inc/gifread.hxx66
-rw-r--r--svtools/source/inc/jpeg.hxx10
-rw-r--r--svtools/source/inc/msgrd.hxx6
-rw-r--r--svtools/source/inc/msgwr.hxx6
-rw-r--r--svtools/source/inc/property.hxx108
-rw-r--r--svtools/source/inc/sgfbram.hxx100
-rw-r--r--svtools/source/inc/sgffilt.hxx8
-rw-r--r--svtools/source/inc/sgvmain.hxx226
-rw-r--r--svtools/source/inc/sgvspln.hxx10
-rw-r--r--svtools/source/inc/svimpbox.hxx128
-rw-r--r--svtools/source/inc/svimpicn.hxx67
-rw-r--r--svtools/source/inc/xbmread.hxx6
-rw-r--r--svtools/source/inc/xpmread.hxx60
-rw-r--r--svtools/source/java/javainteractionhandler.cxx111
-rw-r--r--svtools/source/java/makefile.mk54
-rw-r--r--svtools/source/java/patchjavaerror.src91
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx4
-rw-r--r--svtools/source/misc/cliplistener.cxx4
-rw-r--r--svtools/source/misc/dialogclosedlistener.cxx2
-rw-r--r--svtools/source/misc/dialogcontrolling.cxx2
-rw-r--r--svtools/source/misc/ehdl.cxx90
-rw-r--r--svtools/source/misc/ehdl.src3
-rw-r--r--svtools/source/misc/embedhlp.cxx43
-rw-r--r--svtools/source/misc/embedtransfer.cxx10
-rw-r--r--svtools/source/misc/errtxt.src515
-rw-r--r--svtools/source/misc/filterutils.cxx2
-rw-r--r--svtools/source/misc/helpagentwindow.cxx5
-rw-r--r--svtools/source/misc/imagemgr.cxx403
-rw-r--r--svtools/source/misc/imagemgr.src21
-rw-r--r--svtools/source/misc/imageresourceaccess.cxx2
-rw-r--r--svtools/source/misc/imap.cxx163
-rw-r--r--svtools/source/misc/imap2.cxx46
-rw-r--r--svtools/source/misc/imap3.cxx10
-rw-r--r--svtools/source/misc/itemdel.cxx4
-rwxr-xr-x[-rw-r--r--]svtools/source/misc/langtab.cxx4
-rw-r--r--svtools/source/misc/langtab.src8
-rwxr-xr-xsvtools/source/misc/makefile.mk88
-rw-r--r--svtools/source/misc/svtdata.cxx24
-rw-r--r--svtools/source/misc/templatefoldercache.cxx13
-rw-r--r--svtools/source/misc/transfer.cxx8
-rw-r--r--svtools/source/misc/transfer2.cxx15
-rw-r--r--svtools/source/misc/undo.src (renamed from svtools/source/filter.vcl/filter/dlgejpg.hrc)24
-rw-r--r--svtools/source/misc/unitconv.cxx10
-rw-r--r--svtools/source/misc/wallitem.cxx2
-rw-r--r--svtools/source/misc/xwindowitem.cxx4
-rw-r--r--svtools/source/plugapp/commtest.cxx262
-rw-r--r--svtools/source/plugapp/commtest.hrc34
-rw-r--r--svtools/source/plugapp/commtest.src59
-rw-r--r--svtools/source/plugapp/makefile.mk64
-rw-r--r--svtools/source/plugapp/testtool.src7
-rw-r--r--svtools/source/plugapp/ttprops.cxx14
-rw-r--r--svtools/source/productregistration/makefile.mk78
-rw-r--r--svtools/source/productregistration/productregistration.cxx19
-rw-r--r--svtools/source/productregistration/productregistration.uno.component34
-rw-r--r--svtools/source/productregistration/registrationdlg.cxx2
-rw-r--r--svtools/source/productregistration/registrationdlg.src4
-rw-r--r--svtools/source/svhtml/htmlkywd.cxx26
-rw-r--r--svtools/source/svhtml/htmlout.cxx34
-rw-r--r--svtools/source/svhtml/htmlsupp.cxx14
-rw-r--r--svtools/source/svhtml/parhtml.cxx306
-rw-r--r--svtools/source/svrtf/makefile.mk49
-rw-r--r--svtools/source/svrtf/parrtf.cxx45
-rw-r--r--svtools/source/svrtf/rtfkey2.cxx1159
-rw-r--r--svtools/source/svrtf/rtfkeywd.cxx8
-rw-r--r--svtools/source/svrtf/rtfout.cxx14
-rw-r--r--svtools/source/svrtf/svparser.cxx66
-rwxr-xr-xsvtools/source/table/cellvalueconversion.cxx77
-rwxr-xr-x[-rw-r--r--]svtools/source/table/cellvalueconversion.hxx (renamed from svtools/source/inc/accessibletableimp.hxx)51
-rw-r--r--svtools/source/table/defaultinputhandler.cxx203
-rw-r--r--svtools/source/table/gridtablerenderer.cxx663
-rw-r--r--svtools/source/table/makefile.mk51
-rwxr-xr-xsvtools/source/table/mousefunction.cxx320
-rwxr-xr-xsvtools/source/table/mousefunction.hxx161
-rw-r--r--svtools/source/table/tablecontrol.cxx785
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.cxx2606
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.hxx315
-rw-r--r--svtools/source/table/tabledatawindow.cxx199
-rw-r--r--svtools/source/table/tabledatawindow.hxx (renamed from svtools/inc/svtools/table/tabledatawindow.hxx)11
-rw-r--r--svtools/source/table/tablegeometry.cxx132
-rw-r--r--svtools/source/table/tablegeometry.hxx40
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx6
-rw-r--r--svtools/source/toolpanel/dummypanel.cxx4
-rw-r--r--svtools/source/toolpanel/dummypanel.hxx2
-rwxr-xr-xsvtools/source/toolpanel/makefile.mk64
-rw-r--r--svtools/source/toolpanel/paneltabbar.cxx14
-rw-r--r--svtools/source/toolpanel/tablayouter.cxx2
-rw-r--r--svtools/source/toolpanel/toolpaneldeck.cxx4
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx18
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.hxx4
-rw-r--r--svtools/source/uno/addrtempuno.cxx4
-rw-r--r--svtools/source/uno/contextmenuhelper.cxx2
-rw-r--r--svtools/source/uno/framestatuslistener.cxx2
-rw-r--r--svtools/source/uno/generictoolboxcontroller.cxx4
-rw-r--r--svtools/source/uno/genericunodialog.cxx2
-rw-r--r--svtools/source/uno/makefile.mk61
-rw-r--r--svtools/source/uno/miscservices.cxx49
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx4
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx1044
-rw-r--r--svtools/source/uno/svtxgridcontrol.hxx88
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx7
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx78
-rw-r--r--svtools/source/uno/treecontrolpeer.hxx2
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx980
-rw-r--r--svtools/source/uno/unocontroltablemodel.hxx240
-rw-r--r--svtools/source/uno/unoevent.cxx4
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.cxx427
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.hxx114
-rw-r--r--svtools/source/uno/unoiface.cxx20
-rw-r--r--svtools/source/uno/unoimap.cxx26
-rw-r--r--svtools/source/uno/wizard/makefile.mk48
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx31
-rw-r--r--svtools/source/uno/wizard/wizardpagecontroller.cxx2
-rw-r--r--svtools/source/urlobj/inetimg.cxx22
-rw-r--r--svtools/source/urlobj/makefile.mk46
-rw-r--r--svtools/util/hidother.src20
-rw-r--r--svtools/util/makefile.mk192
-rw-r--r--svtools/util/svt.component49
-rw-r--r--svtools/workben/cui/makefile.mk59
-rw-r--r--svtools/workben/makefile.mk68
-rw-r--r--svtools/workben/svdem.cxx52
-rw-r--r--svtools/workben/toolpanel/makefile.mk106
-rw-r--r--svtools/workben/toolpanel/toolpaneltest.cxx12
-rw-r--r--svtools/workben/treecontrol/makefile.mk91
-rw-r--r--svtools/workben/unodialog/makefile.mk90
-rw-r--r--svtools/workben/unodialog/roadmapskeleton.src5
-rw-r--r--toolkit/AllLangResTarget_tk.mk (renamed from comphelper/source/xml/makefile.mk)30
-rwxr-xr-xtoolkit/JunitTest_toolkit_unoapi.mk53
-rw-r--r--toolkit/Library_tk.mk172
-rw-r--r--toolkit/Makefile38
-rw-r--r--toolkit/Module_toolkit.mk (renamed from tools/source/inet/makefile.mk)29
-rw-r--r--toolkit/Package_inc.mk66
-rw-r--r--toolkit/Package_source.mk47
-rw-r--r--toolkit/Package_util.mk (renamed from tools/util/makefile.pmk)8
-rw-r--r--toolkit/inc/layout/layout.hxx27
-rw-r--r--toolkit/inc/makefile.mk48
-rw-r--r--toolkit/inc/pch/precompiled_toolkit.hxx2
-rwxr-xr-xtoolkit/inc/toolkit/awt/animatedimagespeer.hxx106
-rw-r--r--toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx4
-rw-r--r--toolkit/inc/toolkit/awt/vclxcontainer.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxdevice.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxfont.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxmenu.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx90
-rw-r--r--toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx82
-rw-r--r--toolkit/inc/toolkit/awt/vclxtoolkit.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxtopwindow.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindow.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx10
-rw-r--r--toolkit/inc/toolkit/awt/xsimpleanimation.hxx27
-rw-r--r--toolkit/inc/toolkit/awt/xthrobber.hxx26
-rwxr-xr-xtoolkit/inc/toolkit/controls/animatedimages.hxx144
-rw-r--r--toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx266
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx419
-rw-r--r--toolkit/inc/toolkit/controls/formattedcontrol.hxx9
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx10
-rw-r--r--toolkit/inc/toolkit/controls/roadmapcontrol.hxx38
-rwxr-xr-xtoolkit/inc/toolkit/controls/spinningprogress.hxx70
-rw-r--r--toolkit/inc/toolkit/controls/tabpagecontainer.hxx147
-rw-r--r--toolkit/inc/toolkit/controls/tabpagemodel.hxx146
-rw-r--r--toolkit/inc/toolkit/controls/tkscrollbar.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tksimpleanimation.hxx22
-rw-r--r--toolkit/inc/toolkit/controls/tkspinbutton.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tkthrobber.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/unocontrol.hxx7
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolbase.hxx8
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolcontainer.hxx5
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolmodel.hxx49
-rw-r--r--toolkit/inc/toolkit/controls/unocontrols.hxx112
-rw-r--r--toolkit/inc/toolkit/helper/listenermultiplexer.hxx8
-rw-r--r--toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx8
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx14
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx11
-rw-r--r--toolkit/inc/toolkit/helper/throbberimpl.hxx87
-rw-r--r--toolkit/inc/toolkit/helper/tkresmgr.hxx1
-rw-r--r--toolkit/inc/toolkit/helper/unowrapper.hxx4
-rw-r--r--toolkit/inc/toolkit/helper/vclunohelper.hxx4
-rw-r--r--toolkit/prj/build.lst17
-rw-r--r--toolkit/prj/d.lst65
-rw-r--r--toolkit/prj/makefile.mk40
-rwxr-xr-xtoolkit/qa/complex/toolkit/AccessibleStatusBar.java338
-rwxr-xr-xtoolkit/qa/complex/toolkit/AccessibleStatusBarItem.java381
-rwxr-xr-xtoolkit/qa/complex/toolkit/Assert.java234
-rw-r--r--toolkit/qa/complex/toolkit/CallbackClass.java67
-rwxr-xr-xtoolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java331
-rwxr-xr-xtoolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java385
-rw-r--r--toolkit/qa/complex/toolkit/CheckAsyncCallback.java127
-rwxr-xr-xtoolkit/qa/complex/toolkit/GridControl.java687
-rw-r--r--toolkit/qa/complex/toolkit/UnitConversion.java247
-rw-r--r--toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java)135
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java)66
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java)41
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java)28
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java (renamed from toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java)374
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/DummyColumn.java180
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/GridDataListener.java98
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java314
-rw-r--r--toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java88
-rwxr-xr-xtoolkit/qa/complex/toolkit/interface_tests/makefile.mk57
-rwxr-xr-xtoolkit/qa/complex/toolkit/makefile.mk81
-rw-r--r--toolkit/qa/complex/xunitconversion/XUnitConversionTest.java222
-rw-r--r--toolkit/qa/complex/xunitconversion/makefile.mk77
-rw-r--r--toolkit/qa/unoapi/Test.java5
-rw-r--r--toolkit/qa/unoapi/knownissues.xcl16
-rw-r--r--toolkit/qa/unoapi/makefile.mk48
-rw-r--r--toolkit/qa/unoapi/toolkit.sce6
-rwxr-xr-xtoolkit/source/awt/animatedimagespeer.cxx539
-rw-r--r--toolkit/source/awt/asynccallback.cxx7
-rw-r--r--toolkit/source/awt/makefile.mk84
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx12
-rw-r--r--toolkit/source/awt/vclxdialog.cxx4
-rw-r--r--toolkit/source/awt/vclxdialog.hxx2
-rw-r--r--toolkit/source/awt/vclxfont.cxx10
-rw-r--r--toolkit/source/awt/vclxmenu.cxx8
-rw-r--r--toolkit/source/awt/vclxplugin.hxx2
-rw-r--r--toolkit/source/awt/vclxregion.cxx2
-rw-r--r--toolkit/source/awt/vclxtabcontrol.cxx32
-rw-r--r--toolkit/source/awt/vclxtabpagecontainer.cxx234
-rw-r--r--toolkit/source/awt/vclxtabpagemodel.cxx150
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx78
-rw-r--r--toolkit/source/awt/vclxwindow.cxx122
-rw-r--r--toolkit/source/awt/vclxwindow1.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx135
-rw-r--r--toolkit/source/awt/xsimpleanimation.cxx116
-rw-r--r--toolkit/source/awt/xthrobber.cxx73
-rwxr-xr-xtoolkit/source/controls/animatedimages.cxx493
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx1860
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx2928
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx10
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx462
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.hxx80
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx567
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.hxx99
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx480
-rw-r--r--toolkit/source/controls/grid/gridcolumn.hxx114
-rw-r--r--toolkit/source/controls/grid/gridcontrol.cxx313
-rw-r--r--toolkit/source/controls/grid/gridcontrol.hxx55
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.cxx149
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.hxx85
-rwxr-xr-xtoolkit/source/controls/grid/initguard.hxx67
-rw-r--r--toolkit/source/controls/grid/makefile.mk50
-rwxr-xr-xtoolkit/source/controls/grid/sortablegriddatamodel.cxx877
-rwxr-xr-xtoolkit/source/controls/grid/sortablegriddatamodel.hxx198
-rw-r--r--toolkit/source/controls/makefile.mk66
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx8
-rwxr-xr-xtoolkit/source/controls/spinningprogress.cxx140
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx294
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx395
-rw-r--r--toolkit/source/controls/tkscrollbar.cxx8
-rw-r--r--toolkit/source/controls/tksimpleanimation.cxx61
-rw-r--r--toolkit/source/controls/tkspinbutton.cxx8
-rw-r--r--toolkit/source/controls/tkthrobber.cxx6
-rw-r--r--toolkit/source/controls/tree/makefile.mk48
-rw-r--r--toolkit/source/controls/tree/treecontrol.cxx20
-rw-r--r--toolkit/source/controls/tree/treecontrol.hxx7
-rw-r--r--toolkit/source/controls/unocontrol.cxx22
-rw-r--r--toolkit/source/controls/unocontrolbase.cxx9
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx9
-rw-r--r--toolkit/source/controls/unocontrolcontainermodel.cxx3
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx70
-rw-r--r--toolkit/source/controls/unocontrols.cxx185
-rw-r--r--toolkit/source/helper/listenermultiplexer.cxx7
-rw-r--r--toolkit/source/helper/makefile.mk64
-rw-r--r--toolkit/source/helper/property.cxx26
-rw-r--r--toolkit/source/helper/registerservices.cxx406
-rw-r--r--toolkit/source/helper/servicenames.cxx8
-rw-r--r--toolkit/source/helper/throbberimpl.cxx128
-rw-r--r--toolkit/source/helper/tkresmgr.cxx34
-rw-r--r--toolkit/source/helper/unopropertyarrayhelper.cxx2
-rw-r--r--toolkit/source/helper/unowrapper.cxx7
-rw-r--r--toolkit/source/helper/vclunohelper.cxx5
-rw-r--r--toolkit/source/layout/core/factory.cxx27
-rw-r--r--toolkit/source/layout/core/helper.cxx2
-rw-r--r--toolkit/source/layout/core/import.cxx2
-rw-r--r--toolkit/source/layout/core/makefile.mk65
-rw-r--r--toolkit/source/layout/core/vcl.cxx2
-rw-r--r--toolkit/source/layout/core/vcl.hxx2
-rw-r--r--toolkit/source/layout/vcl/makefile.mk52
-rw-r--r--toolkit/source/layout/vcl/wrapper.cxx46
-rw-r--r--toolkit/src2xml/src-sw.lst1
-rw-r--r--toolkit/src2xml/src.lst1
-rw-r--r--toolkit/test/accessibility/makefile.mk127
-rw-r--r--toolkit/test/accessibility/ov/makefile.mk51
-rw-r--r--toolkit/test/accessibility/tools/makefile.mk42
-rw-r--r--toolkit/uiconfig/layout/makefile.mk54
-rw-r--r--toolkit/util/makefile.mk85
-rw-r--r--toolkit/util/tk.component322
-rw-r--r--toolkit/workben/layout/makefile.mk151
-rw-r--r--toolkit/workben/layout/sortdlg.src22
-rw-r--r--toolkit/workben/makefile.mk84
-rw-r--r--tools/Executable_bestreversemap.mk38
-rw-r--r--tools/Executable_mkunroll.mk59
-rw-r--r--tools/Executable_rscdep.mk69
-rw-r--r--tools/Executable_so_checksum.mk54
-rw-r--r--tools/Executable_sspretty.mk57
-rw-r--r--tools/Library_tl.mk168
-rw-r--r--tools/Makefile38
-rw-r--r--tools/Module_tools.mk (renamed from svtools/source/filter.vcl/ixbm/makefile.mk)31
-rw-r--r--tools/Package_inc.mk108
-rw-r--r--tools/Package_reversemap.mk (renamed from tools/source/reversemap/makefile.mk)32
-rwxr-xr-x[-rw-r--r--]tools/StaticLibrary_ooopathutils.mk (renamed from svtools/source/config/test/makefile.mk)51
-rw-r--r--tools/bootstrp/addexes/makefile.mk47
-rw-r--r--tools/bootstrp/addexes/replace.cxx2
-rw-r--r--tools/bootstrp/addexes2/makefile.mk56
-rw-r--r--tools/bootstrp/addexes2/mkfilt.cxx24
-rw-r--r--tools/bootstrp/command.cxx639
-rw-r--r--tools/bootstrp/cppdep.cxx20
-rw-r--r--tools/bootstrp/cppdep.hxx6
-rw-r--r--tools/bootstrp/inimgr.cxx10
-rw-r--r--tools/bootstrp/makefile.mk106
-rw-r--r--tools/bootstrp/mkcreate.cxx98
-rw-r--r--tools/bootstrp/prj.cxx1408
-rw-r--r--tools/bootstrp/rscdep.cxx8
-rw-r--r--tools/bootstrp/sstring.cxx216
-rw-r--r--tools/inc/bootstrp/command.hxx166
-rw-r--r--tools/inc/bootstrp/inimgr.hxx2
-rw-r--r--tools/inc/bootstrp/mkcreate.hxx56
-rw-r--r--tools/inc/bootstrp/prj.hxx364
-rw-r--r--tools/inc/bootstrp/sstring.hxx77
-rw-r--r--tools/inc/impcont.hxx32
-rw-r--r--tools/inc/makefile.mk48
-rw-r--r--tools/inc/poly.h39
-rw-r--r--tools/inc/tools/StringListResource.hxx2
-rw-r--r--tools/inc/tools/agapi.hxx69
-rw-r--r--tools/inc/tools/agitem.hxx53
-rw-r--r--tools/inc/tools/bigint.hxx8
-rw-r--r--tools/inc/tools/cachestr.hxx22
-rw-r--r--tools/inc/tools/chapi.hxx71
-rw-r--r--tools/inc/tools/color.hxx108
-rw-r--r--tools/inc/tools/config.hxx30
-rw-r--r--tools/inc/tools/contnr.hxx56
-rw-r--r--tools/inc/tools/date.hxx42
-rw-r--r--tools/inc/tools/datetime.hxx20
-rw-r--r--tools/inc/tools/debug.hxx80
-rw-r--r--tools/inc/tools/download.hxx59
-rw-r--r--tools/inc/tools/dynary.hxx32
-rw-r--r--tools/inc/tools/eacopier.hxx49
-rw-r--r--tools/inc/tools/errcode.hxx6
-rw-r--r--tools/inc/tools/errinf.hxx64
-rw-r--r--tools/inc/tools/fldunit.hxx1
-rw-r--r--tools/inc/tools/fontenum.hxx2
-rw-r--r--tools/inc/tools/fsys.hxx129
-rw-r--r--tools/inc/tools/gen.hxx52
-rw-r--r--tools/inc/tools/geninfo.hxx75
-rwxr-xr-x[-rw-r--r--]tools/inc/tools/globname.hxx30
-rwxr-xr-x[-rw-r--r--]tools/inc/tools/inetmime.hxx4
-rw-r--r--tools/inc/tools/inetmsg.hxx82
-rw-r--r--tools/inc/tools/inetstrm.hxx44
-rw-r--r--tools/inc/tools/iparser.hxx30
-rw-r--r--tools/inc/tools/line.hxx6
-rw-r--r--tools/inc/tools/link.hxx24
-rw-r--r--tools/inc/tools/list.hxx36
-rw-r--r--tools/inc/tools/mapunit.hxx1
-rw-r--r--tools/inc/tools/mempool.hxx6
-rw-r--r--tools/inc/tools/multisel.hxx34
-rw-r--r--tools/inc/tools/ownlist.hxx18
-rw-r--r--tools/inc/tools/poly.hxx102
-rw-r--r--tools/inc/tools/postsys.h9
-rw-r--r--tools/inc/tools/presys.h6
-rw-r--r--tools/inc/tools/prex.h4
-rw-r--r--tools/inc/tools/pstm.hxx68
-rw-r--r--tools/inc/tools/queue.hxx24
-rw-r--r--tools/inc/tools/rc.h1
-rw-r--r--tools/inc/tools/rc.hxx7
-rw-r--r--tools/inc/tools/ref.hxx78
-rw-r--r--tools/inc/tools/resid.hxx6
-rw-r--r--tools/inc/tools/resmgr.hxx29
-rw-r--r--tools/inc/tools/rtti.hxx26
-rw-r--r--tools/inc/tools/shl.hxx2
-rw-r--r--tools/inc/tools/solar.h147
-rw-r--r--tools/inc/tools/stack.hxx22
-rw-r--r--tools/inc/tools/stream.hxx41
-rwxr-xr-x[-rw-r--r--]tools/inc/tools/string.hxx116
-rw-r--r--tools/inc/tools/svborder.hxx6
-rw-r--r--tools/inc/tools/table.hxx60
-rw-r--r--tools/inc/tools/tenccvt.hxx4
-rw-r--r--tools/inc/tools/time.hxx56
-rw-r--r--tools/inc/tools/unqid.hxx24
-rw-r--r--tools/inc/tools/unqidx.hxx64
-rw-r--r--tools/inc/tools/urlkeys.hxx79
-rw-r--r--tools/inc/tools/urlobj.hxx6
-rw-r--r--tools/inc/tools/vcompat.hxx22
-rw-r--r--tools/inc/tools/vector2d.hxx12
-rw-r--r--tools/inc/tools/wintypes.hxx26
-rw-r--r--tools/inc/tools/wldcrd.hxx8
-rw-r--r--tools/inc/tools/zcodec.hxx50
-rw-r--r--tools/os2/source/dll/makefile.mk46
-rw-r--r--tools/prj/build.lst34
-rw-r--r--tools/prj/d.lst120
-rw-r--r--tools/prj/makefile.mk40
-rw-r--r--tools/qa/makefile.mk51
-rw-r--r--tools/source/communi/geninfo.cxx44
-rw-r--r--tools/source/communi/makefile.mk50
-rw-r--r--tools/source/communi/parser.cxx56
-rw-r--r--tools/source/datetime/datetime.cxx54
-rw-r--r--tools/source/datetime/makefile.mk50
-rw-r--r--tools/source/datetime/tdate.cxx158
-rw-r--r--tools/source/datetime/ttime.cxx48
-rw-r--r--tools/source/debug/debug.cxx238
-rw-r--r--tools/source/debug/makefile.mk53
-rw-r--r--tools/source/debug/stcktree.cxx62
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/comdep.hxx16
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/dirent.cxx202
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/filecopy.cxx10
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/fstat.cxx65
-rw-r--r--tools/source/fsys/makefile.mk67
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/tdir.cxx84
-rw-r--r--tools/source/fsys/unx.cxx80
-rw-r--r--tools/source/fsys/urlobj.cxx7
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wldcrd.cxx12
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wntmsc.cxx102
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wntmsc.hxx4
-rw-r--r--tools/source/generic/bigint.cxx4
-rw-r--r--tools/source/generic/color.cxx112
-rw-r--r--tools/source/generic/config.cxx156
-rw-r--r--tools/source/generic/fract.cxx8
-rw-r--r--tools/source/generic/gen.cxx54
-rw-r--r--tools/source/generic/line.cxx34
-rw-r--r--tools/source/generic/link.cxx10
-rw-r--r--tools/source/generic/makefile.mk71
-rw-r--r--tools/source/generic/poly.cxx304
-rw-r--r--tools/source/generic/poly2.cxx102
-rw-r--r--tools/source/generic/svborder.cxx2
-rw-r--r--tools/source/inet/inetmsg.cxx134
-rw-r--r--tools/source/inet/inetstrm.cxx124
-rw-r--r--tools/source/makefile.mk58
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/contnr.cxx116
-rw-r--r--tools/source/memtools/makefile.mk56
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/mempool.cxx2
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/multisel.cxx100
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/table.cxx82
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/unqidx.cxx60
-rw-r--r--tools/source/misc/makefile.mk47
-rw-r--r--tools/source/misc/pathutils.cxx1
-rw-r--r--tools/source/rc/makefile.mk53
-rw-r--r--tools/source/rc/rc.cxx18
-rw-r--r--tools/source/rc/resmgr.cxx308
-rw-r--r--tools/source/ref/errinf.cxx84
-rwxr-xr-x[-rw-r--r--]tools/source/ref/globname.cxx70
-rw-r--r--tools/source/ref/makefile.mk53
-rw-r--r--tools/source/ref/pstm.cxx218
-rw-r--r--tools/source/reversemap/Makefile32
-rw-r--r--tools/source/reversemap/bestreversemap.cxx3
-rw-r--r--tools/source/solar/makefile.mk63
-rw-r--r--tools/source/solar/solar.c520
-rw-r--r--tools/source/stream/cachestr.cxx32
-rwxr-xr-x[-rw-r--r--]tools/source/stream/stream.cxx170
-rw-r--r--tools/source/stream/strmos2.cxx90
-rw-r--r--tools/source/stream/strmwnt.cxx82
-rw-r--r--tools/source/stream/vcompat.cxx6
-rw-r--r--tools/source/string/makefile.mk89
-rw-r--r--tools/source/string/strascii.cxx14
-rw-r--r--tools/source/string/strcvt.cxx12
-rw-r--r--tools/source/string/strimp.cxx32
-rw-r--r--tools/source/string/tenccvt.cxx4
-rw-r--r--tools/source/string/tstring.cxx30
-rw-r--r--tools/source/testtoolloader/makefile.mk45
-rw-r--r--tools/source/testtoolloader/testtoolloader.cxx4
-rw-r--r--tools/source/zcodec/makefile.mk47
-rw-r--r--tools/source/zcodec/zcodec.cxx82
-rw-r--r--tools/test/makefile.mk64
-rw-r--r--tools/unx/source/dll/makefile.mk48
-rw-r--r--tools/unx/source/dll/toolsdll.cxx2
-rw-r--r--tools/util/makefile.mk171
-rw-r--r--tools/util/tools.r17
-rw-r--r--tools/win/inc/dll.hxx4
-rw-r--r--tools/win/inc/parser.hxx51
-rw-r--r--tools/win/inc/shellex.h117
-rw-r--r--tools/win/inc/shutil.h217
-rw-r--r--tools/win/inc/toolsdll.hxx38
-rw-r--r--tools/win/inc/winshell.hxx389
-rw-r--r--tools/win/source/dll/makefile.mk56
-rw-r--r--tools/win/source/dll/toolsdll.cxx1
-rw-r--r--tools/win/source/fastfsys/makefile.mk71
-rw-r--r--tools/workben/makefile.mk89
-rw-r--r--ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx8
-rw-r--r--ucbhelper/source/client/proxydecider.cxx239
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.hrc7
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.src2
-rw-r--r--unotools/inc/unotools/accelcfg.hxx2
-rw-r--r--unotools/inc/unotools/componentresmodule.hxx4
-rw-r--r--unotools/inc/unotools/configvaluecontainer.hxx4
-rw-r--r--unotools/inc/unotools/defaultoptions.hxx2
-rw-r--r--unotools/inc/unotools/fontcfg.hxx66
-rw-r--r--unotools/inc/unotools/fontcvt.hxx8
-rw-r--r--unotools/inc/unotools/fontdefs.hxx56
-rw-r--r--unotools/inc/unotools/intlwrapper.hxx6
-rw-r--r--unotools/inc/unotools/lingucfg.hxx118
-rw-r--r--unotools/inc/unotools/localedatawrapper.hxx56
-rw-r--r--unotools/inc/unotools/misccfg.hxx12
-rw-r--r--unotools/inc/unotools/pathoptions.hxx7
-rw-r--r--unotools/inc/unotools/searchopt.hxx110
-rwxr-xr-x[-rw-r--r--]unotools/inc/unotools/syslocaleoptions.hxx12
-rw-r--r--unotools/inc/unotools/textsearch.hxx10
-rw-r--r--unotools/inc/unotools/ucbhelper.hxx6
-rw-r--r--unotools/inc/unotools/ucblockbytes.hxx10
-rw-r--r--unotools/inc/unotools/unotunnelhelper.hxx3
-rw-r--r--unotools/inc/unotools/useroptions.hxx38
-rw-r--r--unotools/prj/build.lst4
-rw-r--r--unotools/prj/d.lst1
-rw-r--r--unotools/qa/complex/tempfile/TempFileUnitTest.java81
-rw-r--r--unotools/qa/complex/tempfile/Test01.java12
-rw-r--r--unotools/qa/complex/tempfile/Test02.java14
-rw-r--r--unotools/qa/complex/tempfile/TestHelper.java20
-rw-r--r--unotools/qa/complex/tempfile/makefile.mk70
-rw-r--r--unotools/source/config/accelcfg.cxx2
-rw-r--r--unotools/source/config/defaultoptions.cxx8
-rw-r--r--unotools/source/config/fltrcfg.cxx22
-rw-r--r--unotools/source/config/fontcfg.cxx10
-rw-r--r--unotools/source/config/lingucfg.cxx180
-rw-r--r--unotools/source/config/misccfg.cxx42
-rw-r--r--unotools/source/config/moduleoptions.cxx2
-rw-r--r--unotools/source/config/pathoptions.cxx84
-rw-r--r--unotools/source/config/regoptions.cxx6
-rw-r--r--unotools/source/config/saveopt.cxx60
-rw-r--r--unotools/source/config/searchopt.cxx170
-rwxr-xr-x[-rw-r--r--]unotools/source/config/syslocaleoptions.cxx6
-rw-r--r--unotools/source/config/useroptions.cxx12
-rw-r--r--unotools/source/config/viewoptions.cxx2
-rw-r--r--unotools/source/i18n/intlwrapper.cxx2
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx138
-rw-r--r--unotools/source/i18n/textsearch.cxx20
-rw-r--r--unotools/source/misc/fontcvt.cxx4
-rw-r--r--unotools/source/misc/fontdefs.cxx2
-rw-r--r--unotools/source/streaming/streamwrap.cxx4
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx16
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx24
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx31
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx54
-rw-r--r--unotools/util/makefile.mk8
-rw-r--r--unotools/util/utl.component34
-rw-r--r--vcl/aqua/inc/aqua11yfactory.h4
-rw-r--r--vcl/aqua/inc/aqua11ywrapper.h16
-rw-r--r--vcl/aqua/inc/aquaprintview.h2
-rw-r--r--vcl/aqua/inc/salbmp.h6
-rw-r--r--vcl/aqua/inc/saldata.hxx2
-rw-r--r--vcl/aqua/inc/salframe.h42
-rw-r--r--vcl/aqua/inc/salframeview.h33
-rw-r--r--vcl/aqua/inc/salgdi.h62
-rw-r--r--vcl/aqua/inc/salinst.h29
-rw-r--r--vcl/aqua/inc/salmenu.h18
-rw-r--r--vcl/aqua/inc/salobj.h9
-rw-r--r--vcl/aqua/inc/salprn.h40
-rw-r--r--vcl/aqua/inc/salsys.h5
-rw-r--r--vcl/aqua/inc/saltimer.h2
-rw-r--r--vcl/aqua/inc/salvd.h4
-rw-r--r--vcl/aqua/inc/vclnsapp.h8
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yfactory.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yselectionwrapper.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm10
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextwrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11yvaluewrapper.mm4
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapper.mm28
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrappercombobox.mm2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h2
-rw-r--r--vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm2
-rw-r--r--vcl/aqua/source/app/salinst.cxx58
-rw-r--r--vcl/aqua/source/app/salsys.cxx101
-rw-r--r--vcl/aqua/source/app/saltimer.cxx6
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm83
-rw-r--r--vcl/aqua/source/dtrans/DataFlavorMapping.cxx10
-rw-r--r--vcl/aqua/source/dtrans/DragSource.cxx29
-rw-r--r--vcl/aqua/source/dtrans/DragSource.hxx4
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.cxx8
-rw-r--r--vcl/aqua/source/dtrans/DropTarget.hxx8
-rw-r--r--vcl/aqua/source/dtrans/aqua_service.cxx22
-rw-r--r--vcl/aqua/source/dtrans/service_entry.cxx24
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm737
-rwxr-xr-xvcl/aqua/source/gdi/aquaprintview.mm2
-rw-r--r--vcl/aqua/source/gdi/salatslayout.cxx2
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx16
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx161
-rw-r--r--vcl/aqua/source/gdi/salgdiutils.cxx4
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx64
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx78
-rw-r--r--vcl/aqua/source/gdi/salvd.cxx31
-rw-r--r--vcl/aqua/source/window/salframe.cxx245
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm112
-rw-r--r--vcl/aqua/source/window/salmenu.cxx35
-rw-r--r--vcl/aqua/source/window/salobj.cxx14
-rw-r--r--vcl/inc/cupsmgr.hxx4
-rw-r--r--vcl/inc/vcl/abstdlg.hxx2
-rw-r--r--vcl/inc/vcl/accel.h6
-rw-r--r--vcl/inc/vcl/accel.hxx54
-rw-r--r--vcl/inc/vcl/accmgr.hxx8
-rw-r--r--vcl/inc/vcl/alpha.hxx42
-rw-r--r--vcl/inc/vcl/animate.hxx86
-rw-r--r--vcl/inc/vcl/apptypes.hxx24
-rw-r--r--vcl/inc/vcl/arrange.hxx77
-rw-r--r--vcl/inc/vcl/bitmap.hxx256
-rw-r--r--vcl/inc/vcl/bitmapex.hxx94
-rw-r--r--vcl/inc/vcl/bmpacc.hxx78
-rw-r--r--vcl/inc/vcl/brdwin.hxx190
-rw-r--r--vcl/inc/vcl/btndlg.hxx56
-rw-r--r--vcl/inc/vcl/button.hxx131
-rw-r--r--vcl/inc/vcl/canvasbitmap.hxx2
-rw-r--r--vcl/inc/vcl/cmdevt.hxx208
-rw-r--r--vcl/inc/vcl/combobox.h8
-rw-r--r--vcl/inc/vcl/combobox.hxx100
-rw-r--r--vcl/inc/vcl/ctrl.hxx10
-rw-r--r--vcl/inc/vcl/cursor.hxx18
-rw-r--r--vcl/inc/vcl/cvtgrf.hxx8
-rw-r--r--vcl/inc/vcl/cvtsvm.hxx8
-rw-r--r--vcl/inc/vcl/dbggui.hxx2
-rw-r--r--vcl/inc/vcl/decoview.hxx74
-rw-r--r--vcl/inc/vcl/dialog.hxx28
-rw-r--r--vcl/inc/vcl/displayconnectiondispatch.hxx52
-rw-r--r--vcl/inc/vcl/dllapi.h6
-rw-r--r--vcl/inc/vcl/dockingarea.hxx2
-rw-r--r--vcl/inc/vcl/dockwin.hxx132
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/edit.hxx44
-rw-r--r--vcl/inc/vcl/event.hxx190
-rw-r--r--vcl/inc/vcl/evntpost.hxx4
-rw-r--r--vcl/inc/vcl/field.hxx200
-rw-r--r--vcl/inc/vcl/fixbrd.hxx16
-rw-r--r--vcl/inc/vcl/fixed.hxx28
-rw-r--r--vcl/inc/vcl/fldunit.hxx36
-rw-r--r--vcl/inc/vcl/floatwin.hxx128
-rw-r--r--vcl/inc/vcl/fntstyle.hxx2
-rw-r--r--vcl/inc/vcl/font.hxx28
-rw-r--r--vcl/inc/vcl/fontcache.hxx2
-rw-r--r--vcl/inc/vcl/fontmanager.hxx2
-rw-r--r--vcl/inc/vcl/gdimtf.hxx70
-rw-r--r--vcl/inc/vcl/gfxlink.hxx38
-rw-r--r--vcl/inc/vcl/glyphcache.hxx37
-rw-r--r--vcl/inc/vcl/gradient.hxx50
-rw-r--r--vcl/inc/vcl/graph.h8
-rw-r--r--vcl/inc/vcl/graph.hxx44
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx4
-rw-r--r--vcl/inc/vcl/graphite_serverfont.hxx6
-rw-r--r--vcl/inc/vcl/group.hxx6
-rw-r--r--vcl/inc/vcl/hatch.hxx16
-rw-r--r--vcl/inc/vcl/help.hxx75
-rw-r--r--vcl/inc/vcl/helpwin.hxx17
-rw-r--r--vcl/inc/vcl/i18nhelp.hxx2
-rw-r--r--vcl/inc/vcl/idlemgr.hxx2
-rw-r--r--vcl/inc/vcl/ilstbox.hxx318
-rw-r--r--vcl/inc/vcl/image.h42
-rw-r--r--vcl/inc/vcl/image.hxx52
-rw-r--r--vcl/inc/vcl/imgctrl.hxx12
-rw-r--r--vcl/inc/vcl/impbmp.hxx24
-rw-r--r--vcl/inc/vcl/impfont.hxx28
-rw-r--r--vcl/inc/vcl/impgraph.hxx52
-rw-r--r--vcl/inc/vcl/impoct.hxx16
-rw-r--r--vcl/inc/vcl/inputctx.hxx22
-rw-r--r--vcl/inc/vcl/javachild.hxx2
-rw-r--r--vcl/inc/vcl/jobdata.hxx4
-rw-r--r--vcl/inc/vcl/jobset.h10
-rw-r--r--vcl/inc/vcl/jobset.hxx4
-rw-r--r--vcl/inc/vcl/keycod.hxx44
-rw-r--r--vcl/inc/vcl/keycodes.hxx264
-rw-r--r--vcl/inc/vcl/lazydelete.hxx39
-rw-r--r--vcl/inc/vcl/lineinfo.hxx24
-rw-r--r--vcl/inc/vcl/longcurr.hxx26
-rw-r--r--vcl/inc/vcl/lstbox.h8
-rw-r--r--vcl/inc/vcl/lstbox.hxx116
-rw-r--r--vcl/inc/vcl/mapmod.hxx14
-rw-r--r--vcl/inc/vcl/mapunit.hxx36
-rw-r--r--vcl/inc/vcl/menu.hxx280
-rw-r--r--vcl/inc/vcl/menubtn.hxx12
-rw-r--r--vcl/inc/vcl/metaact.hxx112
-rw-r--r--vcl/inc/vcl/metric.hxx38
-rw-r--r--vcl/inc/vcl/mnemonic.hxx8
-rw-r--r--vcl/inc/vcl/mnemonicengine.hxx6
-rw-r--r--vcl/inc/vcl/morebtn.hxx14
-rw-r--r--vcl/inc/vcl/msgbox.hxx18
-rw-r--r--vcl/inc/vcl/octree.hxx54
-rw-r--r--vcl/inc/vcl/outdev.h30
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/outdev.hxx399
-rw-r--r--vcl/inc/vcl/outfont.hxx34
-rw-r--r--vcl/inc/vcl/pdfextoutdevdata.hxx2
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx135
-rw-r--r--vcl/inc/vcl/pointr.hxx4
-rw-r--r--vcl/inc/vcl/polyscan.hxx20
-rw-r--r--vcl/inc/vcl/ppdparser.hxx8
-rw-r--r--vcl/inc/vcl/print.h2
-rw-r--r--vcl/inc/vcl/print.hxx199
-rw-r--r--vcl/inc/vcl/printergfx.hxx6
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx6
-rw-r--r--vcl/inc/vcl/prndlg.hxx22
-rw-r--r--vcl/inc/vcl/prntypes.hxx75
-rw-r--r--vcl/inc/vcl/ptrstyle.hxx2
-rw-r--r--vcl/inc/vcl/quickselectionengine.hxx95
-rw-r--r--vcl/inc/vcl/regband.hxx22
-rw-r--r--vcl/inc/vcl/region.h16
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/region.hxx55
-rw-r--r--vcl/inc/vcl/salatype.hxx50
-rw-r--r--vcl/inc/vcl/salbmp.hxx8
-rw-r--r--vcl/inc/vcl/salbtype.hxx324
-rw-r--r--vcl/inc/vcl/salctrlhandle.hxx51
-rw-r--r--vcl/inc/vcl/salctype.hxx22
-rw-r--r--vcl/inc/vcl/saldatabasic.hxx12
-rw-r--r--vcl/inc/vcl/salframe.hxx109
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salgdi.hxx106
-rw-r--r--vcl/inc/vcl/salgtype.hxx14
-rw-r--r--vcl/inc/vcl/salimestatus.hxx2
-rw-r--r--vcl/inc/vcl/salinst.hxx63
-rw-r--r--vcl/inc/vcl/sallayout.hxx12
-rw-r--r--vcl/inc/vcl/salmenu.hxx22
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salnativewidgets.hxx37
-rw-r--r--vcl/inc/vcl/salobj.hxx34
-rw-r--r--vcl/inc/vcl/salprn.hxx40
-rw-r--r--vcl/inc/vcl/salptype.hxx8
-rw-r--r--vcl/inc/vcl/salsession.hxx2
-rw-r--r--vcl/inc/vcl/salsys.hxx2
-rw-r--r--vcl/inc/vcl/saltimer.hxx4
-rw-r--r--vcl/inc/vcl/salvd.hxx4
-rw-r--r--vcl/inc/vcl/salwtype.hxx234
-rw-r--r--vcl/inc/vcl/scrbar.hxx28
-rw-r--r--vcl/inc/vcl/seleng.hxx106
-rw-r--r--vcl/inc/vcl/settings.hxx606
-rw-r--r--vcl/inc/vcl/slider.hxx28
-rw-r--r--vcl/inc/vcl/smartid.hxx90
-rw-r--r--vcl/inc/vcl/sndstyle.hxx2
-rw-r--r--vcl/inc/vcl/spin.h8
-rw-r--r--vcl/inc/vcl/spin.hxx26
-rw-r--r--vcl/inc/vcl/spinfld.hxx8
-rw-r--r--vcl/inc/vcl/split.hxx10
-rw-r--r--vcl/inc/vcl/splitwin.hxx156
-rw-r--r--vcl/inc/vcl/status.hxx120
-rw-r--r--vcl/inc/vcl/stdtext.hxx6
-rw-r--r--vcl/inc/vcl/strhelper.hxx6
-rw-r--r--vcl/inc/vcl/svapp.hxx190
-rw-r--r--vcl/inc/vcl/svcompat.hxx22
-rw-r--r--vcl/inc/vcl/svdata.hxx166
-rw-r--r--vcl/inc/vcl/svids.hrc19
-rw-r--r--vcl/inc/vcl/symbol.hxx5
-rw-r--r--vcl/inc/vcl/syschild.hxx15
-rw-r--r--vcl/inc/vcl/sysdata.hxx1
-rw-r--r--vcl/inc/vcl/syswin.hxx96
-rw-r--r--vcl/inc/vcl/tabctrl.hxx105
-rw-r--r--vcl/inc/vcl/tabdlg.hxx2
-rw-r--r--vcl/inc/vcl/tabpage.hxx2
-rw-r--r--vcl/inc/vcl/taskpanelist.hxx10
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/textlayout.hxx2
-rw-r--r--vcl/inc/vcl/throbber.hxx101
-rw-r--r--vcl/inc/vcl/timer.hxx12
-rw-r--r--vcl/inc/vcl/toolbox.h32
-rw-r--r--vcl/inc/vcl/toolbox.hxx392
-rw-r--r--vcl/inc/vcl/vclenum.hxx2
-rw-r--r--vcl/inc/vcl/vclevent.hxx26
-rw-r--r--vcl/inc/vcl/virdev.hxx22
-rw-r--r--vcl/inc/vcl/wall.hxx18
-rw-r--r--vcl/inc/vcl/wall2.hxx2
-rw-r--r--vcl/inc/vcl/windata.hxx52
-rw-r--r--vcl/inc/vcl/window.h125
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/window.hxx708
-rw-r--r--vcl/inc/vcl/wintypes.hxx35
-rw-r--r--vcl/inc/vcl/wpropset.hxx (renamed from vcl/inc/vcl/impbmpconv.hxx)37
-rw-r--r--vcl/inc/vcl/wrkwin.hxx34
-rw-r--r--vcl/inc/vcl/xconnection.hxx15
-rw-r--r--vcl/os2/inc/salgdi.h12
-rw-r--r--vcl/os2/inc/salinst.h5
-rw-r--r--vcl/os2/inc/salobj.h1
-rw-r--r--vcl/os2/source/app/salinst.cxx14
-rw-r--r--vcl/os2/source/gdi/salgdi.cxx50
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx10
-rw-r--r--vcl/os2/source/window/makefile.mk2
-rw-r--r--vcl/os2/source/window/salframe.cxx51
-rw-r--r--vcl/os2/source/window/salmenu.cxx134
-rw-r--r--vcl/os2/source/window/salobj.cxx6
-rw-r--r--vcl/prj/build.lst9
-rw-r--r--vcl/prj/d.lst14
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java600
-rw-r--r--vcl/qa/complex/memCheck/FileHelper.java90
-rw-r--r--vcl/qa/complex/memCheck/TestDocument.java45
-rwxr-xr-xvcl/qa/complex/memCheck/makefile.mk138
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc (renamed from vcl/qa/testdocuments/CalcDoc.sxc)bin9547 -> 9547 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi (renamed from vcl/qa/testdocuments/ImpressDoc.sxi)bin35135 -> 35135 bytes
-rwxr-xr-xvcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw (renamed from vcl/qa/testdocuments/WriterDoc.sxw)bin5754 -> 5754 bytes
-rw-r--r--vcl/qa/complex/persistent_window_states/DocumentHandle.java11
-rw-r--r--vcl/qa/complex/persistent_window_states/PersistentWindowTest.java420
-rw-r--r--vcl/qa/complex/persistent_window_states/makefile.mk62
-rw-r--r--vcl/source/app/dbggui.cxx227
-rw-r--r--vcl/source/app/help.cxx170
-rw-r--r--vcl/source/app/i18nhelp.cxx10
-rw-r--r--vcl/source/app/idlemgr.cxx16
-rw-r--r--vcl/source/app/salvtables.cxx37
-rw-r--r--vcl/source/app/session.cxx44
-rw-r--r--vcl/source/app/settings.cxx257
-rw-r--r--vcl/source/app/sound.cxx5
-rw-r--r--vcl/source/app/stdtext.cxx4
-rw-r--r--vcl/source/app/svapp.cxx218
-rw-r--r--vcl/source/app/svdata.cxx153
-rw-r--r--vcl/source/app/svmain.cxx57
-rw-r--r--vcl/source/app/svmainhook.cxx10
-rw-r--r--vcl/source/app/timer.cxx64
-rw-r--r--vcl/source/app/unohelp2.cxx4
-rw-r--r--vcl/source/app/vclevent.cxx10
-rw-r--r--vcl/source/components/factory.cxx66
-rw-r--r--vcl/source/components/makefile.mk7
-rw-r--r--vcl/source/components/stringmirror.cxx123
-rw-r--r--vcl/source/control/button.cxx512
-rw-r--r--vcl/source/control/combobox.cxx254
-rw-r--r--vcl/source/control/ctrl.cxx24
-rwxr-xr-x[-rw-r--r--]vcl/source/control/edit.cxx299
-rw-r--r--vcl/source/control/field.cxx343
-rw-r--r--vcl/source/control/field2.cxx542
-rw-r--r--vcl/source/control/fixbrd.cxx24
-rw-r--r--vcl/source/control/fixed.cxx155
-rw-r--r--vcl/source/control/group.cxx30
-rw-r--r--vcl/source/control/ilstbox.cxx823
-rw-r--r--vcl/source/control/imgctrl.cxx184
-rw-r--r--vcl/source/control/longcurr.cxx128
-rw-r--r--vcl/source/control/lstbox.cxx214
-rw-r--r--vcl/source/control/makefile.mk37
-rw-r--r--vcl/source/control/menubtn.cxx19
-rw-r--r--vcl/source/control/morebtn.cxx8
-rw-r--r--vcl/source/control/quickselectionengine.cxx183
-rw-r--r--vcl/source/control/scrbar.cxx199
-rw-r--r--vcl/source/control/slider.cxx105
-rw-r--r--vcl/source/control/spinbtn.cxx68
-rw-r--r--vcl/source/control/spinfld.cxx106
-rw-r--r--vcl/source/control/tabctrl.cxx441
-rw-r--r--vcl/source/control/throbber.cxx325
-rw-r--r--vcl/source/fontsubset/gsub.cxx132
-rw-r--r--vcl/source/fontsubset/sft.cxx2
-rw-r--r--vcl/source/gdi/alpha.cxx58
-rw-r--r--vcl/source/gdi/animate.cxx200
-rw-r--r--vcl/source/gdi/bitmap.cxx242
-rw-r--r--vcl/source/gdi/bitmap2.cxx266
-rw-r--r--vcl/source/gdi/bitmap3.cxx370
-rw-r--r--vcl/source/gdi/bitmap4.cxx154
-rw-r--r--vcl/source/gdi/bitmapex.cxx134
-rw-r--r--vcl/source/gdi/bmpacc.cxx30
-rw-r--r--vcl/source/gdi/bmpacc2.cxx8
-rw-r--r--vcl/source/gdi/bmpacc3.cxx24
-rw-r--r--vcl/source/gdi/bmpconv.cxx18
-rw-r--r--vcl/source/gdi/bmpfast.cxx34
-rw-r--r--vcl/source/gdi/cvtgrf.cxx22
-rw-r--r--vcl/source/gdi/cvtsvm.cxx612
-rw-r--r--vcl/source/gdi/font.cxx76
-rw-r--r--vcl/source/gdi/gdimtf.cxx300
-rw-r--r--vcl/source/gdi/gfxlink.cxx40
-rw-r--r--vcl/source/gdi/gradient.cxx28
-rw-r--r--vcl/source/gdi/graph.cxx72
-rw-r--r--vcl/source/gdi/graphictools.cxx20
-rw-r--r--vcl/source/gdi/hatch.cxx10
-rw-r--r--vcl/source/gdi/image.cxx82
-rw-r--r--vcl/source/gdi/impanmvw.cxx42
-rw-r--r--vcl/source/gdi/impanmvw.hxx30
-rw-r--r--vcl/source/gdi/impbmp.cxx16
-rw-r--r--vcl/source/gdi/impgraph.cxx186
-rw-r--r--vcl/source/gdi/impimage.cxx70
-rw-r--r--vcl/source/gdi/impvect.cxx192
-rw-r--r--vcl/source/gdi/impvect.hxx14
-rw-r--r--vcl/source/gdi/jobset.cxx42
-rw-r--r--vcl/source/gdi/lineinfo.cxx34
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/makefile.mk1
-rw-r--r--vcl/source/gdi/mapmod.cxx26
-rw-r--r--vcl/source/gdi/metaact.cxx110
-rw-r--r--vcl/source/gdi/metric.cxx108
-rw-r--r--vcl/source/gdi/octree.cxx84
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev.cxx1067
-rw-r--r--vcl/source/gdi/outdev2.cxx134
-rw-r--r--vcl/source/gdi/outdev3.cxx653
-rw-r--r--vcl/source/gdi/outdev4.cxx120
-rw-r--r--vcl/source/gdi/outdev5.cxx2
-rw-r--r--vcl/source/gdi/outdev6.cxx102
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdevnative.cxx53
-rw-r--r--vcl/source/gdi/outmap.cxx78
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter.cxx48
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx961
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx205
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2037
-rw-r--r--vcl/source/gdi/pngread.cxx236
-rw-r--r--vcl/source/gdi/pngwrite.cxx140
-rw-r--r--vcl/source/gdi/polyscan.cxx32
-rw-r--r--vcl/source/gdi/print.cxx389
-rw-r--r--vcl/source/gdi/print2.cxx103
-rw-r--r--vcl/source/gdi/print3.cxx199
-rw-r--r--vcl/source/gdi/regband.cxx86
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/region.cxx435
-rw-r--r--vcl/source/gdi/salgdilayout.cxx120
-rw-r--r--vcl/source/gdi/salmisc.cxx24
-rw-r--r--vcl/source/gdi/salnativewidgets-none.cxx30
-rw-r--r--vcl/source/gdi/svcompat.cxx6
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/textlayout.cxx8
-rw-r--r--vcl/source/gdi/virdev.cxx56
-rw-r--r--vcl/source/gdi/wall.cxx58
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx264
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx13
-rwxr-xr-x[-rw-r--r--]vcl/source/glyphs/gcach_layout.cxx2
-rwxr-xr-x[-rw-r--r--]vcl/source/glyphs/gcach_rbmp.cxx6
-rw-r--r--vcl/source/glyphs/gcach_vdev.cxx10
-rw-r--r--vcl/source/glyphs/gcach_vdev.hxx2
-rw-r--r--vcl/source/glyphs/glyphcache.cxx16
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx2
-rw-r--r--vcl/source/helper/canvasbitmap.cxx48
-rw-r--r--vcl/source/helper/canvastools.cxx20
-rw-r--r--vcl/source/helper/lazydelete.cxx2
-rw-r--r--vcl/source/helper/makefile.mk1
-rw-r--r--vcl/source/helper/smartid.cxx267
-rw-r--r--vcl/source/helper/strhelper.cxx16
-rw-r--r--vcl/source/helper/threadex.cxx4
-rw-r--r--vcl/source/helper/xconnection.cxx77
-rw-r--r--vcl/source/salmain/makefile.mk5
-rw-r--r--vcl/source/src/images.src39
-rw-r--r--vcl/source/src/makefile.mk2
-rw-r--r--vcl/source/src/print.src126
-rw-r--r--vcl/source/src/stdtext.src5
-rwxr-xr-xvcl/source/src/throbber.src114
-rw-r--r--vcl/source/window/accel.cxx128
-rw-r--r--vcl/source/window/accmgr.cxx42
-rw-r--r--vcl/source/window/arrange.cxx303
-rw-r--r--vcl/source/window/brdwin.cxx196
-rw-r--r--vcl/source/window/btndlg.cxx68
-rw-r--r--vcl/source/window/cmdevt.cxx16
-rw-r--r--vcl/source/window/cursor.cxx32
-rw-r--r--vcl/source/window/decoview.cxx154
-rw-r--r--vcl/source/window/dialog.cxx120
-rw-r--r--vcl/source/window/dlgctrl.cxx319
-rw-r--r--vcl/source/window/dockingarea.cxx14
-rw-r--r--vcl/source/window/dockmgr.cxx226
-rw-r--r--vcl/source/window/dockwin.cxx142
-rw-r--r--vcl/source/window/floatwin.cxx122
-rw-r--r--vcl/source/window/javachild.cxx152
-rw-r--r--vcl/source/window/keycod.cxx30
-rw-r--r--vcl/source/window/keyevent.cxx4
-rw-r--r--vcl/source/window/makefile.mk2
-rwxr-xr-x[-rw-r--r--]vcl/source/window/menu.cxx1421
-rw-r--r--vcl/source/window/mnemonic.cxx48
-rw-r--r--vcl/source/window/mnemonicengine.cxx2
-rw-r--r--vcl/source/window/mouseevent.cxx2
-rw-r--r--vcl/source/window/msgbox.cxx67
-rw-r--r--vcl/source/window/printdlg.cxx529
-rw-r--r--vcl/source/window/scrwnd.cxx40
-rw-r--r--vcl/source/window/scrwnd.hxx16
-rw-r--r--vcl/source/window/seleng.cxx64
-rw-r--r--vcl/source/window/split.cxx28
-rw-r--r--vcl/source/window/splitwin.cxx651
-rw-r--r--vcl/source/window/status.cxx294
-rw-r--r--vcl/source/window/syschild.cxx194
-rw-r--r--vcl/source/window/syswin.cxx106
-rw-r--r--vcl/source/window/tabdlg.cxx10
-rw-r--r--vcl/source/window/tabpage.cxx12
-rw-r--r--vcl/source/window/taskpanelist.cxx48
-rw-r--r--vcl/source/window/toolbox.cxx962
-rw-r--r--vcl/source/window/toolbox2.cxx571
-rw-r--r--vcl/source/window/window.cxx1423
-rw-r--r--vcl/source/window/window2.cxx346
-rw-r--r--vcl/source/window/window4.cxx224
-rw-r--r--vcl/source/window/winproc.cxx303
-rw-r--r--vcl/source/window/wpropset.cxx346
-rw-r--r--vcl/source/window/wrkwin.cxx66
-rw-r--r--vcl/test/canvasbitmaptest.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx2
-rw-r--r--vcl/unx/gtk/a11y/makefile.mk4
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx12
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx33
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx315
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx204
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx16
-rw-r--r--vcl/unx/headless/svpbmp.cxx14
-rw-r--r--vcl/unx/headless/svpbmp.hxx6
-rw-r--r--vcl/unx/headless/svpdummies.cxx9
-rw-r--r--vcl/unx/headless/svpdummies.hxx10
-rw-r--r--vcl/unx/headless/svpframe.cxx42
-rw-r--r--vcl/unx/headless/svpframe.hxx40
-rw-r--r--vcl/unx/headless/svpgdi.cxx82
-rw-r--r--vcl/unx/headless/svpgdi.hxx41
-rw-r--r--vcl/unx/headless/svpinst.cxx62
-rw-r--r--vcl/unx/headless/svpinst.hxx39
-rw-r--r--vcl/unx/headless/svpprn.cxx6
-rw-r--r--vcl/unx/headless/svpprn.hxx6
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx97
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx39
-rw-r--r--vcl/unx/headless/svptext.cxx36
-rw-r--r--vcl/unx/headless/svpvd.cxx2
-rw-r--r--vcl/unx/headless/svpvd.hxx6
-rw-r--r--vcl/unx/inc/dtint.hxx9
-rw-r--r--vcl/unx/inc/i18n_cb.hxx2
-rw-r--r--vcl/unx/inc/i18n_ic.hxx2
-rw-r--r--vcl/unx/inc/i18n_im.hxx4
-rw-r--r--vcl/unx/inc/kde_headers.h98
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkdata.hxx2
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx50
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx65
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkinst.hxx8
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkobject.hxx13
-rw-r--r--vcl/unx/inc/plugins/kde/kdedata.hxx6
-rw-r--r--vcl/unx/inc/pspgraphics.h39
-rw-r--r--vcl/unx/inc/salbmp.h16
-rw-r--r--vcl/unx/inc/saldata.hxx8
-rw-r--r--vcl/unx/inc/saldisp.hxx80
-rw-r--r--vcl/unx/inc/salframe.h64
-rw-r--r--vcl/unx/inc/salgdi.h102
-rw-r--r--vcl/unx/inc/salinst.h23
-rw-r--r--vcl/unx/inc/salobj.h21
-rw-r--r--vcl/unx/inc/salprn.h34
-rw-r--r--vcl/unx/inc/saltimer.h2
-rw-r--r--vcl/unx/inc/salunx.h6
-rw-r--r--vcl/unx/inc/salvd.h18
-rw-r--r--vcl/unx/inc/soicon.hxx4
-rw-r--r--vcl/unx/inc/wmadaptor.hxx6
-rw-r--r--vcl/unx/inc/xfont.hxx165
-rw-r--r--vcl/unx/kde/kdedata.cxx4
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx130
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx8
-rw-r--r--vcl/unx/kde4/KDESalFrame.hxx2
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx2
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx2
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx2
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx4
-rw-r--r--vcl/unx/kde4/KDEXLib.hxx2
-rw-r--r--vcl/unx/source/app/i18n_cb.cxx12
-rw-r--r--vcl/unx/source/app/i18n_ic.cxx4
-rw-r--r--vcl/unx/source/app/i18n_status.cxx10
-rw-r--r--vcl/unx/source/app/saldata.cxx6
-rw-r--r--vcl/unx/source/app/saldisp.cxx150
-rw-r--r--vcl/unx/source/app/salinst.cxx47
-rw-r--r--vcl/unx/source/app/salsys.cxx6
-rw-r--r--vcl/unx/source/app/saltimer.cxx4
-rw-r--r--vcl/unx/source/app/sm.cxx8
-rw-r--r--vcl/unx/source/app/soicon.cxx14
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx56
-rw-r--r--vcl/unx/source/dtrans/X11_clipboard.hxx26
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.hxx6
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx68
-rw-r--r--vcl/unx/source/dtrans/X11_selection.hxx39
-rw-r--r--vcl/unx/source/dtrans/X11_service.cxx22
-rw-r--r--vcl/unx/source/dtrans/X11_transferable.hxx4
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx75
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx10
-rw-r--r--vcl/unx/source/gdi/cdeint.cxx6
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.cxx6
-rw-r--r--vcl/unx/source/gdi/makefile.mk37
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx97
-rw-r--r--vcl/unx/source/gdi/salbmp.cxx58
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx284
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx40
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx639
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx379
-rw-r--r--vcl/unx/source/gdi/salvd.cxx30
-rw-r--r--vcl/unx/source/gdi/xfont.cxx763
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.cxx698
-rw-r--r--vcl/unx/source/gdi/xlfd_attr.hxx230
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.cxx1002
-rw-r--r--vcl/unx/source/gdi/xlfd_extd.hxx271
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.cxx270
-rw-r--r--vcl/unx/source/gdi/xlfd_smpl.hxx94
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx5
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx42
-rw-r--r--vcl/unx/source/printer/jobdata.cxx43
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx82
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx58
-rw-r--r--vcl/unx/source/printergfx/common_gfx.cxx8
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx15
-rw-r--r--vcl/unx/source/window/makefile.mk2
-rw-r--r--vcl/unx/source/window/salframe.cxx284
-rw-r--r--vcl/unx/source/window/salmenu.cxx134
-rw-r--r--vcl/unx/source/window/salobj.cxx36
-rwxr-xr-xvcl/util/makefile.mk19
-rw-r--r--vcl/util/target.pmk5
-rw-r--r--vcl/util/vcl.component49
-rw-r--r--vcl/util/vcl.macosx.component49
-rw-r--r--vcl/util/vcl.windows.component40
-rw-r--r--vcl/win/inc/salbmp.h12
-rw-r--r--vcl/win/inc/saldata.hxx62
-rw-r--r--vcl/win/inc/salframe.h82
-rw-r--r--vcl/win/inc/salgdi.h106
-rw-r--r--vcl/win/inc/salinst.h28
-rw-r--r--vcl/win/inc/salmenu.h8
-rw-r--r--vcl/win/inc/salobj.h12
-rw-r--r--vcl/win/inc/salprn.h44
-rw-r--r--vcl/win/inc/salsys.h2
-rw-r--r--vcl/win/inc/saltimer.h2
-rw-r--r--vcl/win/inc/salvd.h8
-rw-r--r--vcl/win/inc/wincomp.hxx6
-rw-r--r--vcl/win/source/app/saldata.cxx10
-rw-r--r--vcl/win/source/app/salinfo.cxx6
-rw-r--r--vcl/win/source/app/salinst.cxx81
-rw-r--r--vcl/win/source/app/salshl.cxx8
-rw-r--r--vcl/win/source/app/saltimer.cxx6
-rw-r--r--vcl/win/source/gdi/salbmp.cxx46
-rw-r--r--vcl/win/source/gdi/salgdi.cxx297
-rw-r--r--vcl/win/source/gdi/salgdi2.cxx15
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx345
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx173
-rw-r--r--vcl/win/source/gdi/salprn.cxx128
-rw-r--r--vcl/win/source/gdi/salvd.cxx8
-rw-r--r--vcl/win/source/gdi/winlayout.cxx105
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/ase.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asn.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asne.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asns.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asnswe.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asnw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/ass.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asse.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/assw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/asw.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/aswe.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/chain.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/chainnot.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/timemove.curbin326 -> 326 bytes
-rw-r--r--[-rwxr-xr-x]vcl/win/source/src/timesize.curbin326 -> 326 bytes
-rw-r--r--vcl/win/source/window/salframe.cxx397
-rw-r--r--vcl/win/source/window/salmenu.cxx10
-rw-r--r--vcl/win/source/window/salobj.cxx79
-rw-r--r--vcl/workben/makefile.mk24
-rw-r--r--vcl/workben/outdevgrind.cxx44
-rw-r--r--vcl/workben/svdem.cxx2
-rw-r--r--vcl/workben/svpclient.cxx10
-rw-r--r--vcl/workben/svptest.cxx4
-rw-r--r--vcl/workben/vcldemo.cxx2
2028 files changed, 82276 insertions, 83966 deletions
diff --git a/basebmp/test/makefile.mk b/basebmp/test/makefile.mk
index cdb4ccef5d52..4fdc39bb6fd4 100644
--- a/basebmp/test/makefile.mk
+++ b/basebmp/test/makefile.mk
@@ -60,6 +60,13 @@ CDEFS+=-xalias_level=compatible
.ENDIF
.ENDIF
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
# --- Common ----------------------------------------------------------
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index 3e7fdedeeee8..18b72fabb819 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -979,10 +979,10 @@ namespace basegfx
// calculate the x-extrema parameters by zeroing first x-derivative
// of the cubic bezier's parametric formula, which results in a
// quadratic equation: dBezier/dt = t*t*fAX - 2*t*fBX + fCX
- const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint);
- const double fAX = 3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX();
- const double fBX = 2 * maControlPointA.getX() - maControlPointB.getX() - maStartPoint.getX();
- double fCX(maControlPointA.getX() - maStartPoint.getX());
+ const B2DPoint aControlDiff( maControlPointA - maControlPointB );
+ double fCX = maControlPointA.getX() - maStartPoint.getX();
+ const double fBX = fCX + aControlDiff.getX();
+ const double fAX = 3 * aControlDiff.getX() + (maEndPoint.getX() - maStartPoint.getX());
if(fTools::equalZero(fCX))
{
@@ -997,12 +997,11 @@ namespace basegfx
if( fD >= 0.0 )
{
const double fS = sqrt(fD);
- // same as above but for very small fAX and/or fCX
- // this has much better numerical stability
- // see NRC chapter 5-6 (thanks THB!)
+ // calculate both roots (avoiding a numerically unstable subtraction)
const double fQ = fBX + ((fBX >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAX, rResults);
- impCheckExtremumResult(fCX / fQ, rResults);
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
+ impCheckExtremumResult(fCX / fQ, rResults);
}
}
else if( !fTools::equalZero(fBX) )
@@ -1012,9 +1011,9 @@ namespace basegfx
}
// calculate the y-extrema parameters by zeroing first y-derivative
- const double fAY = 3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY();
- const double fBY = 2 * maControlPointA.getY() - maControlPointB.getY() - maStartPoint.getY();
- double fCY(maControlPointA.getY() - maStartPoint.getY());
+ double fCY = maControlPointA.getY() - maStartPoint.getY();
+ const double fBY = fCY + aControlDiff.getY();
+ const double fAY = 3 * aControlDiff.getY() + (maEndPoint.getY() - maStartPoint.getY());
if(fTools::equalZero(fCY))
{
@@ -1026,15 +1025,14 @@ namespace basegfx
{
// derivative is polynomial of order 2 => use binomial formula
const double fD = fBY*fBY - fAY*fCY;
- if( fD >= 0 )
+ if( fD >= 0.0 )
{
const double fS = sqrt(fD);
- // same as above but for very small fAX and/or fCX
- // this has much better numerical stability
- // see NRC chapter 5-6 (thanks THB!)
+ // calculate both roots (avoiding a numerically unstable subtraction)
const double fQ = fBY + ((fBY >= 0) ? +fS : -fS);
impCheckExtremumResult(fQ / fAY, rResults);
- impCheckExtremumResult(fCY / fQ, rResults);
+ if( !fTools::equalZero(fS) ) // ignore root multiplicity
+ impCheckExtremumResult(fCY / fQ, rResults);
}
}
else if( !fTools::equalZero(fBY) )
@@ -1047,29 +1045,29 @@ namespace basegfx
int B2DCubicBezier::getMaxDistancePositions( double pResult[2]) const
{
// the distance from the bezier to a line through start and end
- // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t),-BEZIERx(t))
+ // is proportional to (ENDx-STARTx,ENDy-STARTy)*(+BEZIERy(t)-STARTy,-BEZIERx(t)-STARTx)
// this distance becomes zero for at least t==0 and t==1
// its extrema that are between 0..1 are interesting as split candidates
// its derived function has the form dD/dt = fA*t^2 + 2*fB*t + fC
const B2DPoint aRelativeEndPoint(maEndPoint-maStartPoint);
- const double fA = 3 * (maEndPoint.getX() - maControlPointB.getX()) * aRelativeEndPoint.getY()
- - 3 * (maEndPoint.getY() - maControlPointB.getY()) * aRelativeEndPoint.getX();
- const double fB = (maControlPointB.getX() - maControlPointA.getX()) * aRelativeEndPoint.getY()
- - (maControlPointB.getY() - maControlPointA.getY()) * aRelativeEndPoint.getX();
+ const double fA = (3 * (maControlPointA.getX() - maControlPointB.getX()) + aRelativeEndPoint.getX()) * aRelativeEndPoint.getY()
+ - (3 * (maControlPointA.getY() - maControlPointB.getY()) + aRelativeEndPoint.getY()) * aRelativeEndPoint.getX();
+ const double fB = (maControlPointB.getX() - 2 * maControlPointA.getX() + maStartPoint.getX()) * aRelativeEndPoint.getY()
+ - (maControlPointB.getY() - 2 * maControlPointA.getY() + maStartPoint.getY()) * aRelativeEndPoint.getX();
const double fC = (maControlPointA.getX() - maStartPoint.getX()) * aRelativeEndPoint.getY()
- (maControlPointA.getY() - maStartPoint.getY()) * aRelativeEndPoint.getX();
- // test for degenerated case: non-cubic curve
+ // test for degenerated case: order<2
if( fTools::equalZero(fA) )
{
- // test for degenerated case: straight line
+ // test for degenerated case: order==0
if( fTools::equalZero(fB) )
return 0;
- // degenerated case: quadratic bezier
+ // solving the order==1 polynomial is trivial
pResult[0] = -fC / (2*fB);
- // test root: ignore it when it is outside the curve
+ // test root and ignore it when it is outside the curve
int nCount = ((pResult[0] > 0) && (pResult[0] < 1));
return nCount;
}
@@ -1079,21 +1077,22 @@ namespace basegfx
const double fD = fB*fB - fA*fC;
if( fD >= 0.0 ) // TODO: is this test needed? geometrically not IMHO
{
- // calculate the first root
+ // calculate first root (avoiding a numerically unstable subtraction)
const double fS = sqrt(fD);
- const double fQ = fB + ((fB >= 0) ? +fS : -fS);
+ const double fQ = -(fB + ((fB >= 0) ? +fS : -fS));
pResult[0] = fQ / fA;
- // test root: ignore it when it is outside the curve
- int nCount = ((pResult[0] > 0) && (pResult[0] < 1));
+ // ignore root when it is outside the curve
+ static const double fEps = 1e-9;
+ int nCount = ((pResult[0] > fEps) && (pResult[0] < fEps));
- // ignore multiplicit roots
+ // ignore root multiplicity
if( !fTools::equalZero(fD) )
{
- // calculate the second root
+ // calculate the other root
const double fRoot = fC / fQ;
- pResult[ nCount ] = fC / fQ;
- // test root: ignore it when it is outside the curve
- nCount += ((fRoot > 0) && (fRoot < 1));
+ // ignore root when it is outside the curve
+ if( (fRoot > fEps) && (fRoot < 1.0-fEps) )
+ pResult[ nCount++ ] = fRoot;
}
return nCount;
diff --git a/basegfx/test/makefile.mk b/basegfx/test/makefile.mk
index 2c0f30c291a9..09d8b805f9f5 100644
--- a/basegfx/test/makefile.mk
+++ b/basegfx/test/makefile.mk
@@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
# --- Common ----------------------------------------------------------
diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst
index d75602dbe5f2..121be382208f 100644
--- a/canvas/prj/build.lst
+++ b/canvas/prj/build.lst
@@ -1,4 +1,4 @@
-cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo NULL
+cv canvas : javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl basegfx CAIRO:cairo LIBXSLT:libxslt NULL
cv canvas usr1 - all cv_mkout NULL
cv canvas\inc nmake - all cv_inc NULL
cv canvas\source\tools nmake - all cv_tools cv_inc NULL
diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst
index 986253a3b3e5..701b9967f92a 100644
--- a/canvas/prj/d.lst
+++ b/canvas/prj/d.lst
@@ -15,6 +15,7 @@
..\%__SRC%\lib\canvasfactory.uno.so %_DEST%\lib%_EXT%\canvasfactory.uno.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\class\javacanvas.uno.jar %_DEST%\bin%_EXT%\javacanvas.uno.jar
+..\%__SRC%\misc\cairocanvas.component %_DEST%\xml%_EXT%\cairocanvas.component
mkdir: %_DEST%\inc%_EXT%\canvas\base
..\inc\canvas\base\*.hxx %_DEST%\inc%_EXT%\canvas\base\*.hxx
@@ -24,3 +25,9 @@ mkdir: %_DEST%\inc%_EXT%\canvas\rendering
mkdir: %_DEST%\inc%_EXT%\canvas
..\inc\canvas\*.hxx %_DEST%\inc%_EXT%\canvas\*.hxx
+..\%__SRC%\misc\canvasfactory.component %_DEST%\xml%_EXT%\canvasfactory.component
+..\%__SRC%\misc\directx5canvas.component %_DEST%\xml%_EXT%\directx5canvas.component
+..\%__SRC%\misc\directx9canvas.component %_DEST%\xml%_EXT%\directx9canvas.component
+..\%__SRC%\misc\gdipluscanvas.component %_DEST%\xml%_EXT%\gdipluscanvas.component
+..\%__SRC%\misc\simplecanvas.component %_DEST%\xml%_EXT%\simplecanvas.component
+..\%__SRC%\misc\vclcanvas.component %_DEST%\xml%_EXT%\vclcanvas.component
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index b6d83413e113..8f4f992aa808 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -60,7 +60,7 @@ namespace cairocanvas
{
maFont->SetAlign( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
- maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
// TODO(F2): improve panose->vclenum conversion
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
@@ -79,7 +79,7 @@ namespace cairocanvas
if( pOutDev )
{
const bool bOldMapState( pOutDev->IsMapModeEnabled() );
- pOutDev->EnableMapMode(FALSE);
+ pOutDev->EnableMapMode(sal_False);
const Size aSize = pOutDev->GetFontMetric( *maFont ).GetSize();
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx
index c7764617be05..91d98103d041 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -319,7 +319,7 @@ namespace cairocanvas
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// change text direction and layout mode
- ULONG nLayoutMode(0);
+ sal_uLong nLayoutMode(0);
switch( textDirection )
{
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
diff --git a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx b/canvas/source/cairo/cairo_canvashelper_texturefill.cxx
index 7d4f459c8908..85959d358894 100644
--- a/canvas/source/cairo/cairo_canvashelper_texturefill.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_texturefill.cxx
@@ -83,7 +83,7 @@ namespace cairocanvas
const ::Size& rTileSize,
const GraphicAttr& rAttr)
{
- BOOL bRet( false );
+ bool bRet( false );
Point aCurrPos;
int nX, nY;
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx
index 6d5aa8660d1c..f6b5e24c5a63 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -271,7 +271,7 @@ namespace cairocanvas
const ::Point aEmptyPoint;
bool bOldMap( mpRefDevice->IsMapModeEnabled() );
- mpRefDevice->EnableMapMode( FALSE );
+ mpRefDevice->EnableMapMode( sal_False );
aStream << mpRefDevice->GetBitmap(aEmptyPoint,
mpRefDevice->GetOutputSizePixel());
mpRefDevice->EnableMapMode( bOldMap );
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index cae25d2c8863..add009fca6c8 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -81,7 +81,7 @@ namespace cairocanvas
sal_Int8 nTextDirection )
{
// TODO(P3): avoid if already correctly set
- ULONG nLayoutMode;
+ sal_uLong nLayoutMode;
switch( nTextDirection )
{
default:
@@ -214,8 +214,8 @@ namespace cairocanvas
return geometry::RealRectangle2D( 0, nAboveBaseline,
aVDev.GetTextWidth(
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) ),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
nBelowBaseline );
}
}
@@ -404,8 +404,8 @@ namespace cairocanvas
}
aSysLayoutData = rOutDev.GetSysTextLayoutData(rOutpos, maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
maLogicalAdvancements.getLength() ? aOffsets.get() : NULL);
// Sort them so that all glyphs on the same glyph fallback level are consecutive
@@ -416,14 +416,14 @@ namespace cairocanvas
typedef std::pair<SystemFontData,int> FontLevel;
typedef std::vector<FontLevel> FontLevelVector;
FontLevelVector aFontData;
- SystemGlyphDataVector::const_iterator aGlyphIter=aSysLayoutData.rGlyphData.begin();
- const SystemGlyphDataVector::const_iterator aGlyphEnd=aSysLayoutData.rGlyphData.end();
- for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter )
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
{
- if( aFontData.empty() || aGlyphIter->fallbacklevel != aFontData.back().second )
+ if( aFontData.empty() || aIter->fallbacklevel != aFontData.back().second )
{
- aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aGlyphIter->fallbacklevel),
- aGlyphIter->fallbacklevel));
+ aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aIter->fallbacklevel),
+ aIter->fallbacklevel));
if( !isCairoRenderable(aFontData.back().first) )
{
bCairoRenderable = false;
@@ -446,15 +446,15 @@ namespace cairocanvas
if (maLogicalAdvancements.getLength()) // VCL FALLBACK - with glyph advances
{
rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets.get(),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
return true;
}
else // VCL FALLBACK - without advances
{
rOutDev.DrawText( rOutpos, maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
return true;
}
}
@@ -476,10 +476,11 @@ namespace cairocanvas
std::vector<cairo_glyph_t> cairo_glyphs;
cairo_glyphs.reserve( 256 );
- aGlyphIter=aSysLayoutData.rGlyphData.begin();
- for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter )
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
{
- SystemGlyphData systemGlyph = *aGlyphIter;
+ SystemGlyphData systemGlyph = *aIter;
if( systemGlyph.fallbacklevel != aFontDataIter->second )
continue;
diff --git a/canvas/source/cairo/cairocanvas.component b/canvas/source/cairo/cairocanvas.component
new file mode 100644
index 000000000000..126ad2b44ee1
--- /dev/null
+++ b/canvas/source/cairo/cairocanvas.component
@@ -0,0 +1,37 @@
+<?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.rendering.Canvas.Cairo">
+ <service name="com.sun.star.rendering.Canvas.Cairo"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.Cairo">
+ <service name="com.sun.star.rendering.SpriteCanvas.Cairo"/>
+ </implementation>
+</component>
diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/cairo/exports.dxp
+++ b/canvas/source/cairo/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk
index 5c0d237da821..bde5fac59a2e 100644
--- a/canvas/source/cairo/makefile.mk
+++ b/canvas/source/cairo/makefile.mk
@@ -130,3 +130,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/cairocanvas.component
+
+$(MISC)/cairocanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt cairocanvas.component
diff --git a/canvas/source/directx/directx5canvas.component b/canvas/source/directx/directx5canvas.component
new file mode 100644
index 000000000000..80133e724df6
--- /dev/null
+++ b/canvas/source/directx/directx5canvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX5">
+ <service name="com.sun.star.rendering.SpriteCanvas.DX5"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/directx9canvas.component b/canvas/source/directx/directx9canvas.component
new file mode 100644
index 000000000000..0d395892d4cb
--- /dev/null
+++ b/canvas/source/directx/directx9canvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.DX9">
+ <service name="com.sun.star.rendering.SpriteCanvas.DX9"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/dx_5rm.cxx b/canvas/source/directx/dx_5rm.cxx
index 152c15ccdf3a..25ac0bd828b9 100644
--- a/canvas/source/directx/dx_5rm.cxx
+++ b/canvas/source/directx/dx_5rm.cxx
@@ -1109,7 +1109,7 @@ namespace dxcanvas
const_cast<Window *>(&rWindow), 0) );
// system child window must not receive mouse events
- mpWindow->SetMouseTransparent( TRUE );
+ mpWindow->SetMouseTransparent( sal_True );
// parent should receive paint messages as well
// [PARENTCLIPMODE_NOCLIP], the argument is here
@@ -1118,11 +1118,11 @@ namespace dxcanvas
mpWindow->SetParentClipMode(0x0002);
// the system child window must not clear its background
- mpWindow->EnableEraseBackground( FALSE );
+ mpWindow->EnableEraseBackground( sal_False );
mpWindow->SetControlForeground();
mpWindow->SetControlBackground();
- mpWindow->EnablePaint(FALSE);
+ mpWindow->EnablePaint(sal_False);
const SystemEnvData *pData = mpWindow->GetSystemData();
const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd));
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index aaae34e64198..4464d1fb7781 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -697,11 +697,11 @@ namespace dxcanvas
mpWindow->SetParentClipMode(0x0002);
// the system child window must not clear its background
- mpWindow->EnableEraseBackground( FALSE );
+ mpWindow->EnableEraseBackground( sal_False );
mpWindow->SetControlForeground();
mpWindow->SetControlBackground();
- mpWindow->EnablePaint(FALSE);
+ mpWindow->EnablePaint(sal_False);
const SystemEnvData *pData = mpWindow->GetSystemData();
const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd));
diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx
index 473798f0bd46..bd269a6aab66 100644
--- a/canvas/source/directx/dx_canvashelper_texturefill.cxx
+++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx
@@ -228,6 +228,7 @@ namespace dxcanvas
Gdiplus::SolidBrush aBackgroundBrush( rColors[0] );
rGraphics->FillPath( &aBackgroundBrush, pFillPath.get() );
+ Gdiplus::Matrix aMatrix;
// scale focus according to aspect ratio: for wider-than-tall
// bounds (nAspectRatio > 1.0), the focus must have non-zero
// width. Specifically, a bound rect twice as wide as tall has
@@ -384,7 +385,6 @@ namespace dxcanvas
// one sets both, only the translational components of the
// texture is respected.
- Gdiplus::Matrix aMatrix;
tools::gdiPlusMatrixFromAffineMatrix2D( aMatrix,
texture.AffineTransform );
GraphicsPathSharedPtr pGradientPath(
@@ -423,8 +423,6 @@ namespace dxcanvas
}
#if defined(VERBOSE) && defined(DBG_UTIL)
- rGraphics->MultiplyTransform( &aMatrix );
-
Gdiplus::Pen aPen( Gdiplus::Color( 255, 255, 0, 0 ),
0.0001f );
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index 33e8a08f79c1..f52243d8a9e9 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -131,7 +131,7 @@ namespace dxcanvas
aFont.SetAlign( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
- aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
aFont.SetPitch(
@@ -266,7 +266,7 @@ namespace dxcanvas
aFont.SetAlign( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
- aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
aFont.SetPitch(
@@ -309,8 +309,8 @@ namespace dxcanvas
return geometry::RealRectangle2D( 0, nAboveBaseline,
aVirtualDevice.GetTextWidth(
rText.Text,
- ::canvas::tools::numeric_cast<USHORT>(rText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(rText.Length) ),
+ ::canvas::tools::numeric_cast<sal_uInt16>(rText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(rText.Length) ),
nBelowBaseline );
}
}
diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx
index c8f43990e9f8..595022e10182 100644
--- a/canvas/source/directx/dx_winstuff.hxx
+++ b/canvas/source/directx/dx_winstuff.hxx
@@ -56,9 +56,6 @@
#endif
-#define BOOL win32BOOL
-#define INT32 win32INT32
-#define UINT32 win32UINT32
#define ULONG win32ULONG
#define GradientStyle_RECT win32GradientStyle_RECT
#define Polygon win32Polygon
@@ -218,9 +215,6 @@ namespace dxcanvas
#endif
#undef DELETE
-#undef BOOL
-#undef INT32
-#undef UINT32
#undef PolyPolygon
#endif /* _DXCANVAS_WINSTUFF_HXX */
diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/directx/exports.dxp
+++ b/canvas/source/directx/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/directx/gdipluscanvas.component b/canvas/source/directx/gdipluscanvas.component
new file mode 100644
index 000000000000..e39e77444d59
--- /dev/null
+++ b/canvas/source/directx/gdipluscanvas.component
@@ -0,0 +1,37 @@
+<?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.rendering.BitmapCanvas.GDI+">
+ <service name="com.sun.star.rendering.BitmapCanvas.GDI+"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.Canvas.GDI+">
+ <service name="com.sun.star.rendering.Canvas.GDI+"/>
+ </implementation>
+</component>
diff --git a/canvas/source/directx/makefile.mk b/canvas/source/directx/makefile.mk
index 4ccd5a8448b2..9547fef40cc7 100644
--- a/canvas/source/directx/makefile.mk
+++ b/canvas/source/directx/makefile.mk
@@ -217,3 +217,25 @@ SHL3STDLIBS += imdebug.lib
.INCLUDE : target.mk
+ALLTAR : \
+ $(MISC)/directx5canvas.component \
+ $(MISC)/directx9canvas.component \
+ $(MISC)/gdipluscanvas.component
+
+$(MISC)/directx5canvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt directx5canvas.component
+
+$(MISC)/directx9canvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt directx9canvas.component
+
+$(MISC)/gdipluscanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt gdipluscanvas.component
diff --git a/canvas/source/factory/canvasfactory.component b/canvas/source/factory/canvasfactory.component
new file mode 100644
index 000000000000..3896f4197d2f
--- /dev/null
+++ b/canvas/source/factory/canvasfactory.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.CanvasFactory">
+ <service name="com.sun.star.rendering.CanvasFactory"/>
+ </implementation>
+</component>
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index 3ce6cfeacd22..516ac006af33 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -533,14 +533,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, s_entries );
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/canvas/source/factory/makefile.mk b/canvas/source/factory/makefile.mk
index fc6d423192d6..eee24ea8ba85 100644
--- a/canvas/source/factory/makefile.mk
+++ b/canvas/source/factory/makefile.mk
@@ -54,3 +54,10 @@ DEF1NAME = $(SHL1TARGET)
.ENDIF
.INCLUDE : target.mk
+ALLTAR : $(MISC)/canvasfactory.component
+
+$(MISC)/canvasfactory.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt canvasfactory.component
diff --git a/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/canvas/source/null/exports.dxp
+++ b/canvas/source/null/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/canvas/source/simplecanvas/exports.dxp
+++ b/canvas/source/simplecanvas/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/canvas/source/simplecanvas/makefile.mk b/canvas/source/simplecanvas/makefile.mk
index 4d5a7e7bb3a1..8c3a9deede72 100644
--- a/canvas/source/simplecanvas/makefile.mk
+++ b/canvas/source/simplecanvas/makefile.mk
@@ -61,3 +61,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/simplecanvas.component
+
+$(MISC)/simplecanvas.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt simplecanvas.component
diff --git a/canvas/source/simplecanvas/simplecanvas.component b/canvas/source/simplecanvas/simplecanvas.component
new file mode 100644
index 000000000000..3a00b407375e
--- /dev/null
+++ b/canvas/source/simplecanvas/simplecanvas.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.rendering.SimpleCanvas">
+ <service name="com.sun.star.rendering.SimpleCanvas"/>
+ </implementation>
+</component>
diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx
index 1d6e53e36eac..26f0894fa29a 100644
--- a/canvas/source/tools/elapsedtime.cxx
+++ b/canvas/source/tools/elapsedtime.cxx
@@ -33,7 +33,7 @@
#include "osl/diagnose.h"
#include "canvas/elapsedtime.hxx"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
#if defined _MSC_VER
#pragma warning(push,1)
@@ -59,7 +59,7 @@ namespace canvas {
namespace tools {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
// TODO(Q2): is 0 okay for the failure case here?
double ElapsedTime::getSystemTime()
{
diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx
index ea99b371a483..0cb4556fb851 100644
--- a/canvas/source/vcl/backbuffer.cxx
+++ b/canvas/source/vcl/backbuffer.cxx
@@ -49,7 +49,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- maVDev->SetAntialiasing( maVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx
index 6865a70f1e31..37130b575dc1 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -89,7 +89,7 @@ namespace vclcanvas
if( mbVDevContentIsCurrent && mpVDev )
{
// VDev content is more current than bitmap - copy contents before!
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
const Point aEmptyPoint;
*maBitmap = mpVDev->GetBitmapEx( aEmptyPoint,
mpVDev->GetOutputSizePixel() );
@@ -109,7 +109,7 @@ namespace vclcanvas
if( mbVDevContentIsCurrent && mpVDev )
{
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
aSize = mpVDev->GetOutputSizePixel();
}
@@ -139,7 +139,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
}
@@ -152,7 +152,7 @@ namespace vclcanvas
if( mpVDev && mbBitmapContentIsCurrent )
{
// fill with bitmap content
- mpVDev->EnableMapMode( FALSE );
+ mpVDev->EnableMapMode( sal_False );
const Point aEmptyPoint;
mpVDev->DrawBitmapEx( aEmptyPoint, *maBitmap );
}
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index 300617f417eb..1f8840afc264 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -50,7 +50,7 @@ namespace vclcanvas
{
// create bitmap for given reference device
// ========================================
- const USHORT nBitCount( (USHORT)24U );
+ const sal_uInt16 nBitCount( (sal_uInt16)24U );
const BitmapPalette* pPalette = NULL;
Bitmap aBitmap( rSize, nBitCount, pPalette );
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index 39ee411bf34c..38dcc9e844e8 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -267,7 +267,7 @@ namespace vclcanvas
x<aBmpSize.Width() && x<rect.X2;
++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
@@ -275,7 +275,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -297,7 +297,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -319,7 +319,7 @@ namespace vclcanvas
nCurrPos += 3;
// cast to unsigned byte, for correct subtraction result
- *pAScan++ = static_cast<BYTE>(255 -
+ *pAScan++ = static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ]));
}
}
@@ -339,7 +339,7 @@ namespace vclcanvas
// cast to unsigned byte, for correct subtraction result
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
- static_cast<BYTE>(255 -
+ static_cast<sal_uInt8>(255 -
static_cast<sal_uInt8>(data[ nCurrPos++ ])) ) );
}
}
@@ -360,7 +360,7 @@ namespace vclcanvas
x<aBmpSize.Width() && x<rect.X2;
++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 71962cf3b45c..4d1cb2b087c3 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -61,7 +61,7 @@ namespace vclcanvas
{
maFont->SetAlign( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==com::sun::star::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
- maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ maFont->SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? sal_True : sal_False );
// TODO(F2): improve panose->vclenum conversion
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
@@ -78,7 +78,7 @@ namespace vclcanvas
OutputDevice& rOutDev( rOutDevProvider->getOutDev() );
const bool bOldMapState( rOutDev.IsMapModeEnabled() );
- rOutDev.EnableMapMode(FALSE);
+ rOutDev.EnableMapMode(sal_False);
const Size aSize = rOutDev.GetFontMetric( *maFont ).GetSize();
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 7ae02c7c3492..6fb918df8f1c 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -145,7 +145,7 @@ namespace vclcanvas
void CanvasHelper::setBackgroundOutDev( const OutDevProviderSharedPtr& rOutDev )
{
mp2ndOutDev = rOutDev;
- mp2ndOutDev->getOutDev().EnableMapMode( FALSE );
+ mp2ndOutDev->getOutDev().EnableMapMode( sal_False );
}
void CanvasHelper::clear()
@@ -156,7 +156,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetLineColor( COL_TRANSPARENT );
rOutDev.SetFillColor( COL_TRANSPARENT );
rOutDev.DrawRect( Rectangle( Point(),
@@ -167,7 +167,7 @@ namespace vclcanvas
OutputDevice& rOutDev2( mp2ndOutDev->getOutDev() );
rOutDev2.SetDrawMode( DRAWMODE_DEFAULT );
- rOutDev2.EnableMapMode( FALSE );
+ rOutDev2.EnableMapMode( sal_False );
rOutDev2.SetLineColor( COL_TRANSPARENT );
rOutDev2.SetFillColor( COL_TRANSPARENT );
rOutDev2.DrawRect( Rectangle( Point(),
@@ -298,9 +298,9 @@ namespace vclcanvas
// DrawPolygon(), and open ones via DrawPolyLine():
// closed polygons will simply already contain the
// closing segment.
- USHORT nSize( aPolyPoly.Count() );
+ sal_uInt16 nSize( aPolyPoly.Count() );
- for( USHORT i=0; i<nSize; ++i )
+ for( sal_uInt16 i=0; i<nSize; ++i )
{
mpOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] );
@@ -410,21 +410,21 @@ namespace vclcanvas
// self-intersections. Therefore, if we would render it
// via OutDev::DrawPolyPolygon(), on/off fill would
// generate off areas on those self-intersections.
- USHORT nSize( aVCLPolyPoly.Count() );
+ sal_uInt16 nSize( aVCLPolyPoly.Count() );
- for( USHORT i=0; i<nSize; ++i )
+ for( sal_uInt16 i=0; i<nSize; ++i )
{
if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) {
mpOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
} else {
- const USHORT nPolySize = aVCLPolyPoly[i].GetSize();
+ const sal_uInt16 nPolySize = aVCLPolyPoly[i].GetSize();
if( nPolySize ) {
Point rPrevPoint = aVCLPolyPoly[i].GetPoint( 0 );
Point rPoint;
- for( USHORT j=1; j<nPolySize; j++ ) {
+ for( sal_uInt16 j=1; j<nPolySize; j++ ) {
rPoint = aVCLPolyPoly[i].GetPoint( j );
mpOutDev->getOutDev().DrawLine( rPrevPoint, rPoint );
if( mp2ndOutDev )
@@ -497,7 +497,7 @@ namespace vclcanvas
}
else
{
- mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (USHORT)nTransPercent );
+ mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
if( mp2ndOutDev )
@@ -522,7 +522,7 @@ namespace vclcanvas
}
else
{
- mp2ndOutDev->getOutDev().DrawTransparent( aPolyPoly, (USHORT)nTransPercent );
+ mp2ndOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
}
}
@@ -584,7 +584,7 @@ namespace vclcanvas
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// change text direction and layout mode
- ULONG nLayoutMode(0);
+ sal_uIntPtr nLayoutMode(0);
switch( textDirection )
{
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
@@ -608,16 +608,16 @@ namespace vclcanvas
mpOutDev->getOutDev().SetLayoutMode( nLayoutMode );
mpOutDev->getOutDev().DrawText( aOutpos,
text.Text,
- ::canvas::tools::numeric_cast<USHORT>(text.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(text.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
if( mp2ndOutDev )
{
mp2ndOutDev->getOutDev().SetLayoutMode( nLayoutMode );
mp2ndOutDev->getOutDev().DrawText( aOutpos,
text.Text,
- ::canvas::tools::numeric_cast<USHORT>(text.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(text.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
}
}
@@ -760,7 +760,7 @@ namespace vclcanvas
// equivalent to the origAlpha*modulateAlpha the
// DX canvas performs)
aGrfAttr.SetTransparency(
- static_cast< BYTE >(
+ static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - nAlphaModulation ) ) ) );
}
@@ -779,7 +779,7 @@ namespace vclcanvas
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
- aGrfAttr.SetRotation( static_cast< USHORT >(::basegfx::fround(nAngleInTenthOfDegrees)) );
+ aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj.reset( new GraphicObject( aBmpEx ) );
}
@@ -914,7 +914,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
// TODO(F2): Support alpha vdev canvas here
const Point aEmptyPoint(0,0);
@@ -943,7 +943,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(),
aRect.GetSize()) );
@@ -996,11 +996,11 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
- const USHORT nBitCount( ::std::min( (USHORT)24U,
- (USHORT)rOutDev.GetBitCount() ) );
+ const sal_uInt16 nBitCount( ::std::min( (sal_uInt16)24U,
+ (sal_uInt16)rOutDev.GetBitCount() ) );
const BitmapPalette* pPalette = NULL;
if( nBitCount <= 8 )
@@ -1046,7 +1046,7 @@ namespace vclcanvas
for( x=0; x<nWidth; ++x )
{
- *pScan++ = (BYTE)pWriteAccess->GetBestPaletteIndex(
+ *pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
@@ -1122,7 +1122,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1159,7 +1159,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
@@ -1198,7 +1198,7 @@ namespace vclcanvas
OutputDevice& rOutDev( mpOutDev->getOutDev() );
OutputDevice* p2ndOutDev = NULL;
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
if( mp2ndOutDev )
p2ndOutDev = &mp2ndOutDev->getOutDev();
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 4d08f873deb1..e7ffe0e41356 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -89,7 +89,7 @@ namespace vclcanvas
const ::Size& rTileSize,
const GraphicAttr& rAttr)
{
- BOOL bRet( false );
+ bool bRet( false );
Point aCurrPos;
int nX, nY;
@@ -102,10 +102,10 @@ namespace vclcanvas
{
// update return value. This method should return true, if
// at least one of the looped Draws succeeded.
- bRet |= rGraphic.Draw( &rOutDev,
+ bRet |= ( sal_True == rGraphic.Draw( &rOutDev,
aCurrPos,
rTileSize,
- &rAttr );
+ &rAttr ) );
aCurrPos.X() += rNextTileX.Width();
aCurrPos.Y() += rNextTileX.Height();
@@ -179,7 +179,7 @@ namespace vclcanvas
// vertex values in the loop below (as ::Polygon is a
// pimpl class, creating one every loop turn would really
// stress the mem allocator)
- ::Polygon aTempPoly( static_cast<USHORT>(5) );
+ ::Polygon aTempPoly( static_cast<sal_uInt16>(5) );
OSL_ENSURE( nStepCount >= 3,
"fillLinearGradient(): stepcount smaller than 3" );
@@ -212,6 +212,8 @@ namespace vclcanvas
if( (rColors.size() % 2) != (nStepCount % 2) )
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
// only iterate nStepCount-1 steps, as the last strip is
@@ -223,9 +225,9 @@ namespace vclcanvas
boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(double(i)/nStepCount);
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
// copy right egde of polygon to left edge (and also
// copy the closing point)
@@ -349,7 +351,7 @@ namespace vclcanvas
const sal_uInt32 nNumPoints( aOuterPoly.count() );
- ::Polygon aTempPoly( static_cast<USHORT>(nNumPoints+1) );
+ ::Polygon aTempPoly( static_cast<sal_uInt16>(nNumPoints+1) );
// increase number of steps by one: polygonal gradients have
// the outermost polygon rendered in rColor2, and the
@@ -367,6 +369,8 @@ namespace vclcanvas
// color).
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
if( !bFillNonOverlapping )
@@ -388,9 +392,9 @@ namespace vclcanvas
// lerp color
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
// scale and render polygon, by interpolating between
// outer and inner polygon.
@@ -400,13 +404,13 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
- aTempPoly[(USHORT)p] = ::Point(
+ aTempPoly[(sal_uInt16)p] = ::Point(
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
}
// close polygon explicitely
- aTempPoly[(USHORT)p] = aTempPoly[0];
+ aTempPoly[(sal_uInt16)p] = aTempPoly[0];
// TODO(P1): compare with vcl/source/gdi/outdev4.cxx,
// OutputDevice::ImplDrawComplexGradient(), there's a note
@@ -425,7 +429,7 @@ namespace vclcanvas
// in the loop below (as ::Polygon is a pimpl class, creating
// one every loop turn would really stress the mem allocator)
::PolyPolygon aTempPolyPoly;
- ::Polygon aTempPoly2( static_cast<USHORT>(nNumPoints+1) );
+ ::Polygon aTempPoly2( static_cast<sal_uInt16>(nNumPoints+1) );
aTempPoly2[0] = rBounds.TopLeft();
aTempPoly2[1] = rBounds.TopRight();
@@ -446,9 +450,9 @@ namespace vclcanvas
// lerp color
rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
+ Color( (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
+ (sal_uInt8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
if( i && !(i % 10) )
@@ -464,13 +468,13 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
- aTempPoly[(USHORT)p] = ::Point(
+ aTempPoly[(sal_uInt16)p] = ::Point(
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
}
// close polygon explicitely
- aTempPoly[(USHORT)p] = aTempPoly[0];
+ aTempPoly[(sal_uInt16)p] = aTempPoly[0];
// swap inner and outer polygon
aTempPolyPoly.Replace( aTempPolyPoly.GetObject( 1 ), 0 );
@@ -701,7 +705,7 @@ namespace vclcanvas
}
#endif // complex-clipping vs. XOR-trick
-#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
+#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{
::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
::basegfx::B2DRectangle aTextureDeviceRect;
@@ -922,7 +926,7 @@ namespace vclcanvas
aGrfAttr.SetMirrorFlags(
( aScale.getX() < 0.0 ? BMP_MIRROR_HORZ : 0 ) |
( aScale.getY() < 0.0 ? BMP_MIRROR_VERT : 0 ) );
- aGrfAttr.SetRotation( static_cast< USHORT >(::basegfx::fround( nRotate*10.0 )) );
+ aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround( nRotate*10.0 )) );
pGrfObj.reset( new GraphicObject( aBmpEx ) );
}
@@ -1051,7 +1055,7 @@ namespace vclcanvas
// equivalent to the origAlpha*modulateAlpha
// the DX canvas performs)
aGrfAttr.SetTransparency(
- static_cast< BYTE >(
+ static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
}
@@ -1122,7 +1126,7 @@ namespace vclcanvas
aVDev.GetBitmap( aEmptyPoint,
aVDev.GetOutputSizePixel() ) );
- BYTE nCol( static_cast< BYTE >(
+ sal_uInt8 nCol( static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
AlphaMask aAlpha( aVDev.GetOutputSizePixel(),
&nCol );
diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx
index 02c4e547be76..96b14e2cfb73 100644
--- a/canvas/source/vcl/devicehelper.cxx
+++ b/canvas/source/vcl/devicehelper.cxx
@@ -231,7 +231,7 @@ namespace vclcanvas
const ::Point aEmptyPoint;
OutputDevice& rOutDev = mpOutDev->getOutDev();
bool bOldMap( rOutDev.IsMapModeEnabled() );
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
aStream << rOutDev.GetBitmap(aEmptyPoint,
rOutDev.GetOutputSizePixel());
rOutDev.EnableMapMode( bOldMap );
diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/canvas/source/vcl/exports.dxp
+++ b/canvas/source/vcl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index a6cfe4a0a7f1..24f32aadc237 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -180,7 +180,7 @@ namespace vclcanvas
const ::Polygon& rPoly( rPolyPoly[0] );
- USHORT nCount( rPoly.GetSize() );
+ sal_uInt16 nCount( rPoly.GetSize() );
if( nCount < 4 )
return false;
@@ -391,7 +391,7 @@ namespace vclcanvas
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
255U -
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nAlphaModulation*
(255U
- aAlphaMap[ pAlphaReadAccess->GetPixel(
@@ -402,15 +402,15 @@ namespace vclcanvas
nSrcX ) );
aColor.SetRed(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nRedModulation *
aColor.GetRed() + .5 ));
aColor.SetGreen(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nGreenModulation *
aColor.GetGreen() + .5 ));
aColor.SetBlue(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nBlueModulation *
aColor.GetBlue() + .5 ));
@@ -445,7 +445,7 @@ namespace vclcanvas
pAlphaWriteAccess->SetPixel( y, x,
BitmapColor(
255U -
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nAlphaModulation*255.0
+ .5 ) ) );
@@ -453,15 +453,15 @@ namespace vclcanvas
nSrcX ) );
aColor.SetRed(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nRedModulation *
aColor.GetRed() + .5 ));
aColor.SetGreen(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nGreenModulation *
aColor.GetGreen() + .5 ));
aColor.SetBlue(
- static_cast<BYTE>(
+ static_cast<sal_uInt8>(
nBlueModulation *
aColor.GetBlue() + .5 ));
diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx
index 963162b22587..8b9293acb44d 100644
--- a/canvas/source/vcl/impltools.hxx
+++ b/canvas/source/vcl/impltools.hxx
@@ -170,7 +170,7 @@ namespace vclcanvas
if( mpOutDev )
{
mpOutDev->Push();
- mpOutDev->EnableMapMode(FALSE);
+ mpOutDev->EnableMapMode(sal_False);
}
}
diff --git a/canvas/source/vcl/makefile.mk b/canvas/source/vcl/makefile.mk
index be2fc69894a4..7d5f9658c829 100644
--- a/canvas/source/vcl/makefile.mk
+++ b/canvas/source/vcl/makefile.mk
@@ -83,3 +83,11 @@ DEF1EXPORTFILE=exports.dxp
# ==========================================================================
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/vclcanvas.component
+
+$(MISC)/vclcanvas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vclcanvas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vclcanvas.component
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index 29c6725a70af..ac75508809fe 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -99,7 +99,7 @@ namespace vclcanvas
// clip output to actual update region (otherwise a)
// wouldn't save much render time, and b) will clutter
// scrolled sprite content outside this area)
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetClipRegion( rRequestedArea );
// repaint affected sprite directly to output device (at
@@ -319,7 +319,7 @@ namespace vclcanvas
// but repaint everything (or caller requested that)
maVDev->SetOutputSizePixel( aOutDevSize );
- maVDev->EnableMapMode( FALSE );
+ maVDev->EnableMapMode( sal_False );
maVDev->DrawOutDev( aEmptyPoint, aOutDevSize,
aEmptyPoint, aOutDevSize,
rBackOutDev );
@@ -333,7 +333,7 @@ namespace vclcanvas
_1 ) );
// flush to screen
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.SetClipRegion();
rOutDev.DrawOutDev( aEmptyPoint, aOutDevSize,
aEmptyPoint, aOutDevSize,
@@ -578,7 +578,7 @@ namespace vclcanvas
}
// paint background
- maVDev->EnableMapMode( FALSE );
+ maVDev->EnableMapMode( sal_False );
maVDev->SetClipRegion();
maVDev->DrawOutDev( aEmptyPoint, aOutputSize,
aOutputPosition, aOutputSize,
@@ -595,7 +595,7 @@ namespace vclcanvas
_1 ) );
// flush to screen
- rOutDev.EnableMapMode( FALSE );
+ rOutDev.EnableMapMode( sal_False );
rOutDev.DrawOutDev( aOutputPosition, aOutputSize,
aEmptyPoint, aOutputSize,
*maVDev );
diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx
index 5a3509612ba1..20129ea3fe16 100644
--- a/canvas/source/vcl/spritedevicehelper.cxx
+++ b/canvas/source/vcl/spritedevicehelper.cxx
@@ -68,7 +68,7 @@ namespace vclcanvas
// switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and
// is not required to do AA. It would need to be adapted to use it correctly
// (especially gradient painting). This will need extra work.
- mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & !ANTIALIASING_ENABLE_B2DDRAW);
+ mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
#endif
}
@@ -148,7 +148,7 @@ namespace vclcanvas
SvFileStream aStream( aFilename, STREAM_STD_READWRITE );
const ::Point aEmptyPoint;
- mpBackBuffer->getOutDev().EnableMapMode( FALSE );
+ mpBackBuffer->getOutDev().EnableMapMode( sal_False );
aStream << mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint,
mpBackBuffer->getOutDev().GetOutputSizePixel());
}
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 6dcf6868f165..e4226fac1f16 100644..100755
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -341,21 +341,8 @@ namespace vclcanvas
else
#endif
{
- // redraw is direcly on the front buffer,
- // or using alpha blending - cannot use
- // XOR, thus, employing the still somewhat
- // speedier triangle clip method
- ::basegfx::B2DPolygon aTriangulatedClip(::basegfx::triangulator::triangulate(aClipPoly));
-
- // restrict the clipping area to the visible portion of the output device.
- Size aSize(rTargetSurface.GetOutputSizePixel());
- ::basegfx::B2DRange aOutputRect(::basegfx::B2DPoint(0,0),::basegfx::B2DPoint(aSize.Width(),aSize.Height()));
- ::basegfx::B2DPolygon aClippedClip(::basegfx::tools::clipTriangleListOnRange(aTriangulatedClip,aOutputRect));
-
- // #i76339#
- const Polygon aPoly(aClippedClip);
- const PolyPolygon aPolyPoly(aPoly);
- rTargetSurface.SetTriangleClipRegion(aPolyPoly);
+ Region aClipRegion( aClipPoly );
+ rTargetSurface.SetClipRegion( aClipRegion );
}
}
}
@@ -376,7 +363,7 @@ namespace vclcanvas
// here
// draw semi-transparent
- BYTE nColor( static_cast<UINT8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
+ sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
AlphaMask aAlpha( maContent->GetSizePixel(),
&nColor );
@@ -408,7 +395,7 @@ namespace vclcanvas
for( int i=0; i<aMarkerPoly.Count(); ++i )
{
- rTargetSurface.DrawPolyLine( aMarkerPoly.GetObject((USHORT)i) );
+ rTargetSurface.DrawPolyLine( aMarkerPoly.GetObject((sal_uInt16)i) );
}
// paint sprite prio
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index ffd650dcd0bb..08cdd66abe00 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -59,7 +59,7 @@ namespace vclcanvas
sal_Int8 nTextDirection )
{
// TODO(P3): avoid if already correctly set
- ULONG nLayoutMode;
+ sal_uIntPtr nLayoutMode;
switch( nTextDirection )
{
default:
@@ -140,10 +140,10 @@ namespace vclcanvas
if (aVDev.GetTextOutlines(
aOutlines,
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length),
- FALSE,
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
+ sal_False,
0,
aOffsets.get()))
{
@@ -193,9 +193,9 @@ namespace vclcanvas
if (aVDev.GetGlyphBoundRects(
Point(0,0),
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
aMetricVector))
{
aBoundingBoxes.realloc(aMetricVector.size());
@@ -273,8 +273,8 @@ namespace vclcanvas
return geometry::RealRectangle2D( 0, nAboveBaseline,
aVDev.GetTextWidth(
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) ),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
nBelowBaseline );
}
}
@@ -406,15 +406,15 @@ namespace vclcanvas
rOutDev.DrawTextArray( rOutpos,
maText.Text,
aOffsets.get(),
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
else
{
rOutDev.DrawText( rOutpos,
maText.Text,
- ::canvas::tools::numeric_cast<USHORT>(maText.StartPosition),
- ::canvas::tools::numeric_cast<USHORT>(maText.Length) );
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
+ ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) );
}
return true;
diff --git a/canvas/source/vcl/vclcanvas.component b/canvas/source/vcl/vclcanvas.component
new file mode 100644
index 000000000000..f7e0bb8c0266
--- /dev/null
+++ b/canvas/source/vcl/vclcanvas.component
@@ -0,0 +1,37 @@
+<?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.rendering.Canvas.VCL">
+ <service name="com.sun.star.rendering.Canvas.VCL"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.rendering.SpriteCanvas.VCL">
+ <service name="com.sun.star.rendering.SpriteCanvas.VCL"/>
+ </implementation>
+</component>
diff --git a/comphelper/inc/makefile.mk b/comphelper/JunitTest_comphelper_complex.mk
index 5c466f93be42..5da6f2cd2061 100644
--- a/comphelper/inc/makefile.mk
+++ b/comphelper/JunitTest_comphelper_complex.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -24,25 +24,25 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..
-PRJNAME=comphelper
-TARGET=inc
+$(eval $(call gb_JunitTest_JunitTest,comphelper_complex))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_JunitTest_add_sourcefiles,comphelper_complex,\
+ comphelper/qa/complex/comphelper/Map \
+ comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_JunitTest_add_jars,comphelper_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
+$(eval $(call gb_JunitTest_add_classes,comphelper_complex,\
+ complex.comphelper.SequenceOutputStreamUnitTest \
+ complex.comphelper.Map \
+))
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk
new file mode 100644
index 000000000000..7c365bc97cd2
--- /dev/null
+++ b/comphelper/Library_comphelp.mk
@@ -0,0 +1,156 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,comphelper))
+
+$(eval $(call gb_Library_add_package_headers,comphelper,comphelper_inc))
+
+$(eval $(call gb_Library_add_precompiled_header,comphelper,$(SRCDIR)/comphelper/inc/pch/precompiled_comphelper))
+
+$(eval $(call gb_Library_set_componentfile,comphelper,comphelper/util/comphelp))
+
+$(eval $(call gb_Library_set_include,comphelper,\
+ -I$(realpath $(SRCDIR)/comphelper/inc/pch) \
+ -I$(realpath $(SRCDIR)/comphelper/source/inc) \
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,comphelper,\
+ $$(DEFS) \
+ -DCOMPHELPER_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,comphelper,\
+ sal \
+ cppuhelper \
+ cppu \
+ ucbhelper \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,comphelper,\
+ comphelper/source/compare/AnyCompareFactory \
+ comphelper/source/container/IndexedPropertyValuesContainer \
+ comphelper/source/container/NamedPropertyValuesContainer \
+ comphelper/source/container/container \
+ comphelper/source/container/containermultiplexer \
+ comphelper/source/container/embeddedobjectcontainer \
+ comphelper/source/container/enumerablemap \
+ comphelper/source/container/enumhelper \
+ comphelper/source/container/namecontainer \
+ comphelper/source/eventattachermgr/eventattachermgr \
+ comphelper/source/misc/accessiblecomponenthelper \
+ comphelper/source/misc/accessiblecontexthelper \
+ comphelper/source/misc/accessibleeventbuffer \
+ comphelper/source/misc/accessibleeventnotifier \
+ comphelper/source/misc/accessiblekeybindinghelper \
+ comphelper/source/misc/accessibleselectionhelper \
+ comphelper/source/misc/accessibletexthelper \
+ comphelper/source/misc/accessiblewrapper \
+ comphelper/source/misc/accimplaccess \
+ comphelper/source/misc/anytostring \
+ comphelper/source/misc/asyncnotification \
+ comphelper/source/misc/comphelper_module \
+ comphelper/source/misc/comphelper_services \
+ comphelper/source/misc/componentbase \
+ comphelper/source/misc/componentcontext \
+ comphelper/source/misc/componentmodule \
+ comphelper/source/misc/configurationhelper \
+ comphelper/source/misc/docpasswordhelper \
+ comphelper/source/misc/docpasswordrequest \
+ comphelper/source/misc/documentinfo \
+ comphelper/source/misc/documentiologring \
+ comphelper/source/misc/evtlistenerhlp \
+ comphelper/source/misc/evtmethodhelper \
+ comphelper/source/misc/ihwrapnofilter \
+ comphelper/source/misc/instancelocker \
+ comphelper/source/misc/interaction \
+ comphelper/source/misc/legacysingletonfactory \
+ comphelper/source/misc/listenernotification \
+ comphelper/source/misc/locale \
+ comphelper/source/misc/logging \
+ comphelper/source/misc/mediadescriptor \
+ comphelper/source/misc/mimeconfighelper \
+ comphelper/source/misc/namedvaluecollection \
+ comphelper/source/misc/numberedcollection \
+ comphelper/source/misc/numbers \
+ comphelper/source/misc/officeresourcebundle \
+ comphelper/source/misc/officerestartmanager \
+ comphelper/source/misc/proxyaggregation \
+ comphelper/source/misc/regpathhelper \
+ comphelper/source/misc/scopeguard \
+ comphelper/source/misc/SelectionMultiplex \
+ comphelper/source/misc/sequenceashashmap \
+ comphelper/source/misc/sequence \
+ comphelper/source/misc/servicedecl \
+ comphelper/source/misc/serviceinfohelper \
+ comphelper/source/misc/sharedmutex \
+ comphelper/source/misc/stillreadwriteinteraction \
+ comphelper/source/misc/anycompare \
+ comphelper/source/misc/storagehelper \
+ comphelper/source/misc/string \
+ comphelper/source/misc/synchronousdispatch \
+ comphelper/source/misc/types \
+ comphelper/source/misc/uieventslogger \
+ comphelper/source/misc/weak \
+ comphelper/source/misc/weakeventlistener \
+ comphelper/source/officeinstdir/officeinstallationdirectories \
+ comphelper/source/processfactory/componentfactory \
+ comphelper/source/processfactory/processfactory \
+ comphelper/source/property/ChainablePropertySet \
+ comphelper/source/property/ChainablePropertySetInfo \
+ comphelper/source/property/composedprops \
+ comphelper/source/property/genericpropertyset \
+ comphelper/source/property/MasterPropertySet \
+ comphelper/source/property/MasterPropertySetInfo \
+ comphelper/source/property/opropertybag \
+ comphelper/source/property/propagg \
+ comphelper/source/property/propertybag \
+ comphelper/source/property/propertycontainer \
+ comphelper/source/property/propertycontainerhelper \
+ comphelper/source/property/property \
+ comphelper/source/property/propertysethelper \
+ comphelper/source/property/propertysetinfo \
+ comphelper/source/property/propertystatecontainer \
+ comphelper/source/property/propmultiplex \
+ comphelper/source/property/propstate \
+ comphelper/source/property/TypeGeneration \
+ comphelper/source/streaming/basicio \
+ comphelper/source/streaming/memorystream \
+ comphelper/source/streaming/oslfile2streamwrap \
+ comphelper/source/streaming/otransactedfilestream \
+ comphelper/source/streaming/seekableinput \
+ comphelper/source/streaming/seqinputstreamserv \
+ comphelper/source/streaming/seqoutputstreamserv \
+ comphelper/source/streaming/seqstream \
+ comphelper/source/streaming/streamsection \
+ comphelper/source/xml/attributelist \
+ comphelper/source/xml/ofopxmlhelper \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/version.mk b/comphelper/Makefile
index f8d798a404b7..a79aff831024 100644
--- a/comphelper/version.mk
+++ b/comphelper/Makefile
@@ -25,22 +25,14 @@
#
#*************************************************************************
-# ----------------------------COMPHLP settings------------------------------------#
-# target
-COMPHLP_TARGET=comphelp
-
-# the major
-COMPHLP_MAJOR=4
-# the minor
-COMPHLP_MINOR=0
-# the micro
-COMPHLP_MICRO=0
-
-# this is a c++ compatible library
-COMPHLP_CPP=1
-
-COMPHLP=$(COMPHLP_TARGET_TARGET)_$(CMPEXT)
-
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/Module_comphelper.mk b/comphelper/Module_comphelper.mk
new file mode 100644
index 000000000000..e39d973fe23e
--- /dev/null
+++ b/comphelper/Module_comphelper.mk
@@ -0,0 +1,39 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Module_Module,comphelper))
+
+$(eval $(call gb_Module_add_targets,comphelper,\
+ Package_inc \
+ Library_comphelp \
+))
+
+$(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\
+ JunitTest_comphelper_complex \
+))
+
+# vim: set noet ts=4 sw=4:
diff --git a/comphelper/Package_inc.mk b/comphelper/Package_inc.mk
new file mode 100644
index 000000000000..5794c56ab74d
--- /dev/null
+++ b/comphelper/Package_inc.mk
@@ -0,0 +1,137 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,comphelper_inc,$(SRCDIR)/comphelper/inc))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/flagguard.hxx,comphelper/flagguard.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/stlunosequence.hxx,comphelper/stlunosequence.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/documentconstants.hxx,comphelper/documentconstants.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/evtmethodhelper.hxx,comphelper/evtmethodhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/weakbag.hxx,comphelper/weakbag.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/basicio.hxx,comphelper/basicio.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/classids.hxx,comphelper/classids.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/MasterPropertySet.hxx,comphelper/MasterPropertySet.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/stillreadwriteinteraction.hxx,comphelper/stillreadwriteinteraction.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/anycompare.hxx,comphelper/anycompare.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propagg.hxx,comphelper/propagg.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/scopeguard.hxx,comphelper/scopeguard.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/asyncnotification.hxx,comphelper/asyncnotification.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/namedvaluecollection.hxx,comphelper/namedvaluecollection.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/composedprops.hxx,comphelper/composedprops.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/mediadescriptor.hxx,comphelper/mediadescriptor.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/synchronousdispatch.hxx,comphelper/synchronousdispatch.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessiblecomponenthelper.hxx,comphelper/accessiblecomponenthelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/otransactedfilestream.hxx,comphelper/otransactedfilestream.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propmultiplex.hxx,comphelper/propmultiplex.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/servicehelper.hxx,comphelper/servicehelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/servicedecl.hxx,comphelper/servicedecl.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/mimeconfighelper.hxx,comphelper/mimeconfighelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/implbase_var.hxx,comphelper/implbase_var.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/TypeGeneration.hxx,comphelper/TypeGeneration.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/MasterPropertySetInfo.hxx,comphelper/MasterPropertySetInfo.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessiblewrapper.hxx,comphelper/accessiblewrapper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/sequence.hxx,comphelper/sequence.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/uieventslogger.hxx,comphelper/uieventslogger.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/docpasswordhelper.hxx,comphelper/docpasswordhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertystatecontainer.hxx,comphelper/propertystatecontainer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertysetinfo.hxx,comphelper/propertysetinfo.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accimplaccess.hxx,comphelper/accimplaccess.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/docpasswordrequest.hxx,comphelper/docpasswordrequest.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessibleeventbuffer.hxx,comphelper/accessibleeventbuffer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/regpathhelper.hxx,comphelper/regpathhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/extract.hxx,comphelper/extract.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/interaction.hxx,comphelper/interaction.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/uno3.hxx,comphelper/uno3.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/unwrapargs.hxx,comphelper/unwrapargs.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertycontainer.hxx,comphelper/propertycontainer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/guarding.hxx,comphelper/guarding.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/fileformat.h,comphelper/fileformat.h))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/ChainablePropertySetInfo.hxx,comphelper/ChainablePropertySetInfo.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/enumhelper.hxx,comphelper/enumhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/property.hxx,comphelper/property.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertysethelper.hxx,comphelper/propertysethelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessiblekeybindinghelper.hxx,comphelper/accessiblekeybindinghelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertycontainerhelper.hxx,comphelper/propertycontainerhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/make_shared_from_uno.hxx,comphelper/make_shared_from_uno.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/comphelperdllapi.h,comphelper/comphelperdllapi.h))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/listenernotification.hxx,comphelper/listenernotification.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/attributelist.hxx,comphelper/attributelist.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/streamsection.hxx,comphelper/streamsection.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessibletexthelper.hxx,comphelper/accessibletexthelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessibleselectionhelper.hxx,comphelper/accessibleselectionhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/serviceinfohelper.hxx,comphelper/serviceinfohelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/locale.hxx,comphelper/locale.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/numberedcollection.hxx,comphelper/numberedcollection.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/ChainablePropertySet.hxx,comphelper/ChainablePropertySet.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/stl_types.hxx,comphelper/stl_types.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/eventattachermgr.hxx,comphelper/eventattachermgr.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentcontext.hxx,comphelper/componentcontext.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/legacysingletonfactory.hxx,comphelper/legacysingletonfactory.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessibleeventnotifier.hxx,comphelper/accessibleeventnotifier.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/ihwrapnofilter.hxx,comphelper/ihwrapnofilter.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/sequenceasvector.hxx,comphelper/sequenceasvector.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/officeresourcebundle.hxx,comphelper/officeresourcebundle.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/types.hxx,comphelper/types.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/seekableinput.hxx,comphelper/seekableinput.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/IdPropArrayHelper.hxx,comphelper/IdPropArrayHelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/accessiblecontexthelper.hxx,comphelper/accessiblecontexthelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/SelectionMultiplex.hxx,comphelper/SelectionMultiplex.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/storagehelper.hxx,comphelper/storagehelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/logging.hxx,comphelper/logging.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/sharedmutex.hxx,comphelper/sharedmutex.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/documentinfo.hxx,comphelper/documentinfo.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/weakeventlistener.hxx,comphelper/weakeventlistener.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentfactory.hxx,comphelper/componentfactory.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/containermultiplexer.hxx,comphelper/containermultiplexer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/broadcasthelper.hxx,comphelper/broadcasthelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/numbers.hxx,comphelper/numbers.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/evtlistenerhlp.hxx,comphelper/evtlistenerhlp.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/optional.hxx,comphelper/optional.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentbase.hxx,comphelper/componentbase.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentguard.hxx,comphelper/componentguard.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/InlineContainer.hxx,comphelper/InlineContainer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertybag.hxx,comphelper/propertybag.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/embeddedobjectcontainer.hxx,comphelper/embeddedobjectcontainer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/anytostring.hxx,comphelper/anytostring.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/implementationreference.hxx,comphelper/implementationreference.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/proparrhlp.hxx,comphelper/proparrhlp.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/PropertyInfoHash.hxx,comphelper/PropertyInfoHash.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propstate.hxx,comphelper/propstate.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/proxyaggregation.hxx,comphelper/proxyaggregation.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/oslfile2streamwrap.hxx,comphelper/oslfile2streamwrap.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/genericpropertyset.hxx,comphelper/genericpropertyset.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/makesequence.hxx,comphelper/makesequence.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/ofopxmlhelper.hxx,comphelper/ofopxmlhelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/SettingsHelper.hxx,comphelper/SettingsHelper.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/string.hxx,comphelper/string.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/weak.hxx,comphelper/weak.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentmodule.hxx,comphelper/componentmodule.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/container.hxx,comphelper/container.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/seqstream.hxx,comphelper/seqstream.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/namecontainer.hxx,comphelper/namecontainer.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/processfactory.hxx,comphelper/processfactory.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/sequenceashashmap.hxx,comphelper/sequenceashashmap.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/configurationhelper.hxx,comphelper/configurationhelper.hxx))
diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index 13675c7d626f..c987b2adbe50 100644
--- a/comphelper/inc/comphelper/TypeGeneration.hxx
+++ b/comphelper/inc/comphelper/TypeGeneration.hxx
@@ -115,6 +115,7 @@ namespace comphelper
CPPUTYPE_SEQNAMEDVALUE, //getCppuType( (Sequence<beans::NamedValue>*)0 )
CPPUTYPE_REFXGRAPHIC, //getCppuType( Reference< graphic::XGraphic >*)0)
CPPUTYPE_TABLEBORDERDISTANCES, //getCppuType( (table::TableBorderDistances*)0 )
+ CPPUTPYE_REFEMBEDDEDOBJECT, // XEmbeddedObject::static_type
CPPUTYPE_END
};
diff --git a/comphelper/inc/comphelper/anycompare.hxx b/comphelper/inc/comphelper/anycompare.hxx
new file mode 100755
index 000000000000..03f41e108ba9
--- /dev/null
+++ b/comphelper/inc/comphelper/anycompare.hxx
@@ -0,0 +1,226 @@
+/*************************************************************************
+ * DO NOT ALTER 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 COMPHELPER_ANYCOMPARE_HXX
+#define COMPHELPER_ANYCOMPARE_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/extract.hxx>
+
+#include <functional>
+#include <memory>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= IKeyPredicateLess
+ //==================================================================================================================
+ class SAL_NO_VTABLE IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const = 0;
+ virtual ~IKeyPredicateLess() {}
+ };
+
+ //==================================================================================================================
+ //= LessPredicateAdapter
+ //==================================================================================================================
+ struct LessPredicateAdapter : public ::std::binary_function< ::com::sun::star::uno::Any, ::com::sun::star::uno::Any, bool >
+ {
+ LessPredicateAdapter( const IKeyPredicateLess& _predicate )
+ :m_predicate( _predicate )
+ {
+ }
+
+ bool operator()( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ return m_predicate.isLess( _lhs, _rhs );
+ }
+
+ private:
+ IKeyPredicateLess const & m_predicate;
+
+ private:
+ LessPredicateAdapter(); // never implemented
+ };
+
+ //==================================================================================================================
+ //= ScalarPredicateLess
+ //==================================================================================================================
+ template< typename SCALAR >
+ class ScalarPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ SCALAR lhs(0), rhs(0);
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringPredicateLess
+ //==================================================================================================================
+ class StringPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::rtl::OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringCollationPredicateLess
+ //==================================================================================================================
+ class StringCollationPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ StringCollationPredicateLess( ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator )
+ :m_collator( i_collator )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::rtl::OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return m_collator->compareString( lhs, rhs ) < 0;
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const m_collator;
+ };
+
+ //==================================================================================================================
+ //= TypePredicateLess
+ //==================================================================================================================
+ class TypePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::com::sun::star::uno::Type lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs.getTypeName() < rhs.getTypeName();
+ }
+ };
+
+ //==================================================================================================================
+ //= EnumPredicateLess
+ //==================================================================================================================
+ class EnumPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ EnumPredicateLess( ::com::sun::star::uno::Type const & _enumType )
+ :m_enumType( _enumType )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ sal_Int32 lhs(0), rhs(0);
+ if ( !::cppu::enum2int( lhs, _lhs )
+ || !::cppu::enum2int( rhs, _rhs )
+ || !_lhs.getValueType().equals( m_enumType )
+ || !_rhs.getValueType().equals( m_enumType )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+
+ private:
+ ::com::sun::star::uno::Type const m_enumType;
+ };
+
+ //==================================================================================================================
+ //= InterfacePredicateLess
+ //==================================================================================================================
+ class InterfacePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ if ( ( _lhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ || ( _rhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > lhs( _lhs, ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > rhs( _rhs, ::com::sun::star::uno::UNO_QUERY );
+ return lhs.get() < rhs.get();
+ }
+ };
+
+ //==================================================================================================================
+ //= getStandardLessPredicate
+ //==================================================================================================================
+ /** creates a default IKeyPredicateLess instance for the given UNO type
+ @param i_type
+ the type for which a predicate instance should be created
+ @param i_collator
+ specifies a collator instance to use, or <NULL/>. If <NULL/>, strings will be compared using the <code>&lt</code>
+ operator, otherwise the collator will be used. The parameter is ignored if <arg>i_type</arg> does not specify
+ the string type.
+ @return
+ a default implementation of IKeyPredicateLess, which is able to compare values of the given type. If no
+ such default implementation is known for the given type, then <NULL/> is returned.
+ */
+ ::std::auto_ptr< IKeyPredicateLess > COMPHELPER_DLLPUBLIC
+ getStandardLessPredicate(
+ ::com::sun::star::uno::Type const & i_type,
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator
+ );
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_ANYCOMPARE_HXX
diff --git a/comphelper/inc/comphelper/asyncnotification.hxx b/comphelper/inc/comphelper/asyncnotification.hxx
index 8f660d18559b..6f2f1af34dee 100644
--- a/comphelper/inc/comphelper/asyncnotification.hxx
+++ b/comphelper/inc/comphelper/asyncnotification.hxx
@@ -132,8 +132,9 @@ namespace comphelper
virtual oslInterlockedCount SAL_CALL acquire();
virtual oslInterlockedCount SAL_CALL release();
- /// creates (starts) the thread
using AsyncEventNotifier_TBASE::create;
+ using AsyncEventNotifier_TBASE::join;
+ using AsyncEventNotifier_TBASE::getIdentifier;
using AsyncEventNotifier_TBASE::operator new;
using AsyncEventNotifier_TBASE::operator delete;
diff --git a/comphelper/inc/comphelper/componentguard.hxx b/comphelper/inc/comphelper/componentguard.hxx
new file mode 100755
index 000000000000..820b901a5c55
--- /dev/null
+++ b/comphelper/inc/comphelper/componentguard.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ * DO NOT ALTER 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 COMPHELPER_COMPONENTGUARD_HXX
+#define COMPHELPER_COMPONENTGUARD_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ComponentGuard
+ //==================================================================================================================
+ class ComponentGuard
+ {
+ public:
+ ComponentGuard( ::cppu::OWeakObject& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper )
+ :m_aGuard( i_broadcastHelper.rMutex )
+ {
+ if ( i_broadcastHelper.bDisposed )
+ throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), &i_component );
+ }
+
+ ~ComponentGuard()
+ {
+ }
+
+ void clear() { m_aGuard.clear(); }
+ void reset() { m_aGuard.reset(); }
+
+ private:
+ ::osl::ResettableMutexGuard m_aGuard;
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_COMPONENTGUARD_HXX
diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx
index d117cc75bb0c..cd65ea50577d 100644
--- a/comphelper/inc/comphelper/componentmodule.hxx
+++ b/comphelper/inc/comphelper/componentmodule.hxx
@@ -35,7 +35,6 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
/** === end UNO includes === **/
#include <cppuhelper/factory.hxx>
@@ -141,28 +140,6 @@ namespace comphelper
*/
void registerImplementation( const ComponentDescription& _rComp );
- /** write the registration information of all known components
-
- Writes the registration information of all components which are currently registered into the
- specified registry.
-
- Usually used from within component_writeInfo.
-
- @param_rxServiceManager
- the service manager
- @param _rRootKey
- the registry key under which the information will be stored
- @return
- <TRUE/> if the registration of all implementations was successfull, <FALSE/> otherwise
- */
- sal_Bool writeComponentInfos(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager,
- const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey);
-
- /** version of writeComponentInfos which directly takes the arguments you got in your component_writeInfo call
- */
- sal_Bool writeComponentInfos( void* pServiceManager, void* pRegistryKey );
-
/** creates a Factory for the component with the given implementation name.
<p>Usually used from within component_getFactory.<p/>
@param _rxServiceManager
@@ -421,12 +398,6 @@ namespace comphelper
{ \
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
} \
- extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( \
- void* pServiceManager, void* pRegistryKey ) \
- { \
- initializer_function(); \
- return module_class::getInstance().writeComponentInfos( pServiceManager, pRegistryKey ); \
- } \
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( \
const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) \
{ \
diff --git a/comphelper/inc/comphelper/docpasswordhelper.hxx b/comphelper/inc/comphelper/docpasswordhelper.hxx
index 44dca362fb13..51c44d821def 100644
--- a/comphelper/inc/comphelper/docpasswordhelper.hxx
+++ b/comphelper/inc/comphelper/docpasswordhelper.hxx
@@ -29,6 +29,7 @@
#ifndef COMPHELPER_DOCPASSWORDHELPR_HXX
#define COMPHELPER_DOCPASSWORDHELPR_HXX
+#include <com/sun/star/beans/NamedValue.hpp>
#include "comphelper/comphelperdllapi.h"
#include <vector>
#include "comphelper/docpasswordrequest.hxx"
@@ -54,7 +55,7 @@ enum DocPasswordVerifierResult
/** Base class for a password verifier used by the DocPasswordHelper class
below.
- Users have to implement the virtual function and pass an instance of the
+ Users have to implement the virtual functions and pass an instance of the
verifier to one of the password request functions.
*/
class COMPHELPER_DLLPUBLIC IDocPasswordVerifier
@@ -64,6 +65,14 @@ public:
/** Will be called everytime a password needs to be verified.
+ @param rPassword
+ The password to be verified
+
+ @param o_rEncryptionData
+ Output parameter, that is filled with the EncryptionData generated
+ from the password. The data is filled only if the validation was
+ successful.
+
@return The result of the verification.
- DocPasswordVerifierResult_OK, if and only if the passed password
is valid and can be used to process the related document.
@@ -73,7 +82,23 @@ public:
occurred while password verification. The password request loop
will be aborted.
*/
- virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
+
+ /** Will be called everytime an encryption data needs to be verified.
+
+ @param rEncryptionData
+ The data will be validated
+
+ @return The result of the verification.
+ - DocPasswordVerifierResult_OK, if and only if the passed encryption data
+ is valid and can be used to process the related document.
+ - DocPasswordVerifierResult_WRONG_PASSWORD, if the encryption data is
+ wrong.
+ - DocPasswordVerifierResult_ABORT, if an unrecoverable error
+ occured while data verification. The password request loop
+ will be aborted.
+ */
+ virtual DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData ) = 0;
};
@@ -196,6 +221,35 @@ public:
// ------------------------------------------------------------------------
+ /** This helper function generates a random sequence of bytes of
+ requested length.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateRandomByteSequence(
+ sal_Int32 nLength );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const ::rtl::OUString& aPassword,
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
+ /** This helper function generates a byte sequence representing the
+ key digest value used by MSCodec_Std97 codec.
+ */
+
+ static ::com::sun::star::uno::Sequence< sal_Int8 > GenerateStd97Key(
+ const sal_uInt16 pPassData[16],
+ const ::com::sun::star::uno::Sequence< sal_Int8 >& aDocId );
+
+ // ------------------------------------------------------------------------
+
/** This helper function tries to request and verify a password to load a
protected document.
@@ -249,8 +303,9 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const ::rtl::OUString& rMediaPassword,
const ::com::sun::star::uno::Reference<
::com::sun::star::task::XInteractionHandler >& rxInteractHandler,
@@ -301,7 +356,7 @@ public:
passed password verifier. If empty, no valid password has been
found, or the user has chossen to cancel password input.
*/
- static ::rtl::OUString requestAndVerifyDocPassword(
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx
index 569160cc1809..2d42dcf453c8 100644
--- a/comphelper/inc/comphelper/docpasswordrequest.hxx
+++ b/comphelper/inc/comphelper/docpasswordrequest.hxx
@@ -35,8 +35,12 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weak.hxx>
+
namespace comphelper {
+class AbortContinuation;
+class PasswordContinuation;
+
// ============================================================================
/** Selects which UNO document password request type to use. */
@@ -48,8 +52,37 @@ enum DocPasswordRequestType
// ============================================================================
-class AbortContinuation;
-class PasswordContinuation;
+class COMPHELPER_DLLPUBLIC SimplePasswordRequest :
+ public ::com::sun::star::task::XInteractionRequest,
+ public ::cppu::OWeakObject
+{
+public:
+ explicit SimplePasswordRequest( com::sun::star::task::PasswordRequestMode eMode );
+ virtual ~SimplePasswordRequest();
+
+ // XInterface / OWeakObject
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ sal_Bool isAbort() const;
+ sal_Bool isPassword() const;
+
+ ::rtl::OUString getPassword() const;
+
+private:
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
+};
+
+// ============================================================================
/** Implements the task.XInteractionRequest interface for requesting a password
string for a document.
@@ -80,20 +113,15 @@ public:
sal_Bool getRecommendReadOnly() const;
private:
- virtual ::com::sun::star::uno::Any SAL_CALL
- getRequest() throw( ::com::sun::star::uno::RuntimeException );
-
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL
- getContinuations() throw( ::com::sun::star::uno::RuntimeException );
+ // XInteractionRequest
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Any maRequest;
+ ::com::sun::star::uno::Any maRequest;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations;
- AbortContinuation* mpAbort;
- PasswordContinuation* mpPassword;
-
- sal_Bool mbPasswordToModify;
+ AbortContinuation * mpAbort;
+ PasswordContinuation * mpPassword;
};
// ============================================================================
diff --git a/comphelper/inc/comphelper/documentconstants.hxx b/comphelper/inc/comphelper/documentconstants.hxx
index 01a315f984ac..cb280b2525f7 100644
--- a/comphelper/inc/comphelper/documentconstants.hxx
+++ b/comphelper/inc/comphelper/documentconstants.hxx
@@ -112,4 +112,40 @@
#define ODFVER_012_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODFVER_012_TEXT_ASCII ) )
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// filter flags
+// TODO/LATER: The flags should be part of the UNO specification
+#define SFX_FILTER_IMPORT 0x00000001L
+#define SFX_FILTER_EXPORT 0x00000002L
+#define SFX_FILTER_TEMPLATE 0x00000004L
+#define SFX_FILTER_INTERNAL 0x00000008L
+#define SFX_FILTER_TEMPLATEPATH 0x00000010L
+#define SFX_FILTER_OWN 0x00000020L
+#define SFX_FILTER_ALIEN 0x00000040L
+#define SFX_FILTER_USESOPTIONS 0x00000080L
+
+#define SFX_FILTER_DEFAULT 0x00000100L
+#define SFX_FILTER_EXECUTABLE 0x00000200L
+#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
+#define SFX_FILTER_MAPTOAPPPLUG 0x00000800L
+#define SFX_FILTER_NOTINFILEDLG 0x00001000L
+#define SFX_FILTER_NOTINCHOOSER 0x00002000L
+#define SFX_FILTER_ASYNC 0x00004000L
+#define SFX_FILTER_CREATOR 0x00008000L
+#define SFX_FILTER_OPENREADONLY 0x00010000L
+#define SFX_FILTER_MUSTINSTALL 0x00020000L
+#define SFX_FILTER_CONSULTSERVICE 0x00040000L
+
+#define SFX_FILTER_STARONEFILTER 0x00080000L
+#define SFX_FILTER_PACKED 0x00100000L
+
+#define SFX_FILTER_BROWSERPREFERED 0x00400000L
+
+#define SFX_FILTER_ENCRYPTION 0x01000000L
+#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
+
+#define SFX_FILTER_PREFERED 0x10000000L
+
+#define SFX_FILTER_VERSION_NONE 0
+#define SFX_FILTER_NOTINSTALLED SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/comphelper/inc/comphelper/flagguard.hxx b/comphelper/inc/comphelper/flagguard.hxx
new file mode 100755
index 000000000000..4fc1f4e97833
--- /dev/null
+++ b/comphelper/inc/comphelper/flagguard.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ * DO NOT ALTER 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 COMPHELPER_FLAGGUARD_HXX
+#define COMPHELPER_FLAGGUARD_HXX
+
+#include "comphelper/scopeguard.hxx"
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= FlagRestorationGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagRestorationGuard : public ScopeGuard
+ {
+ public:
+ FlagRestorationGuard( bool& i_flagRef, bool i_temporaryValue, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( RestoreFlag, ::boost::ref( i_flagRef ), !!i_flagRef ), i_excHandling )
+ {
+ i_flagRef = i_temporaryValue;
+ }
+
+ ~FlagRestorationGuard();
+
+ private:
+ static void RestoreFlag( bool& i_flagRef, bool i_originalValue )
+ {
+ i_flagRef = i_originalValue;
+ }
+ };
+
+ //==================================================================================================================
+ //= FlagGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagGuard : public ScopeGuard
+ {
+ public:
+ explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+ {
+ i_flagRef = true;
+ }
+
+ ~FlagGuard();
+
+ private:
+ static void ResetFlag( bool& i_flagRef )
+ {
+ i_flagRef = false;
+ }
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_FLAGGUARD_HXX
diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
index 774eacd6cb04..cc36fc62282e 100644
--- a/comphelper/inc/comphelper/mediadescriptor.hxx
+++ b/comphelper/inc/comphelper/mediadescriptor.hxx
@@ -79,6 +79,7 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
static const ::rtl::OUString& PROP_DEEPDETECTION();
static const ::rtl::OUString& PROP_DETECTSERVICE();
static const ::rtl::OUString& PROP_DOCUMENTSERVICE();
+ static const ::rtl::OUString& PROP_ENCRYPTIONDATA();
static const ::rtl::OUString& PROP_EXTENSION();
static const ::rtl::OUString& PROP_FILENAME();
static const ::rtl::OUString& PROP_FILTERNAME();
@@ -128,10 +129,6 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
//-------------------------------------------
// interface
public:
- /** Value type of the 'ComponentData' property.
- */
- typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > ComponentDataSequence;
-
//---------------------------------------
/** @short these ctors do nothing - excepting that they forward
the given parameters to the base class ctors.
@@ -205,8 +202,9 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
/** Returns a value from the sequence contained in the property
'ComponentData' of this media descriptor.
- @descr The property 'ComponentData' should be empty or should
- contain a value of type ComponentDataSequence (see above).
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>.
@return The value with the specified name, if existing in the
sequence of the 'ComponentData' property, otherwise an empty
@@ -219,10 +217,11 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
/** Inserts a value into the sequence contained in the property
'ComponentData' of the media descriptor.
- @descr The property 'ComponentData' should be empty or should
- contain a value of type ComponentDataSequence (see above). The
- passed value will be inserted into the sequence, or, if already
- existing, will be overwritten.
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>. The passed value
+ will be inserted into the sequence, or, if already existing,
+ will be overwritten.
@param rName The name of the value to be inserted into the
sequence of the 'ComponentData' property.
@@ -238,10 +237,10 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
/** Removes a value from the sequence contained in the property
'ComponentData' of the media descriptor.
- @descr The property 'ComponentData' should be empty or should
- contain a value of type ComponentDataSequence (see above). The
- value with the passed name will be removed from the sequence,
- if existing.
+ @descr The property 'ComponentData' should be empty, or should
+ contain a value of type sequence<com.sun.star.beans.NamedValue>
+ or sequence<com.sun.star.beans.PropertyValue>. The value with
+ the passed name will be removed from the sequence, if existing.
@param rName The name of the value to be removed from the sequence
of the 'ComponentData' property.
diff --git a/comphelper/inc/comphelper/mimeconfighelper.hxx b/comphelper/inc/comphelper/mimeconfighelper.hxx
index 613d3b591783..992f367d67df 100644
--- a/comphelper/inc/comphelper/mimeconfighelper.hxx
+++ b/comphelper/inc/comphelper/mimeconfighelper.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/embed/VerbDescriptor.hpp>
@@ -51,6 +52,8 @@ class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xVerbsConfig;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xMediaTypeConfig;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xFilterFactory;
+
public:
MimeConfigurationHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
@@ -107,6 +110,10 @@ public:
::rtl::OUString GetFactoryNameByMediaType( const ::rtl::OUString& aMediaType );
// typedetection related
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetFilterFactory();
+
+ sal_Int32 GetFilterFlags( const ::rtl::OUString& aFilterName );
+
::rtl::OUString UpdateMediaDescriptorWithFilterName(
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr,
sal_Bool bIgnoreType );
@@ -118,6 +125,14 @@ public:
::rtl::OUString GetDefaultFilterFromServiceName( const ::rtl::OUString& aServName, sal_Int32 nVersion );
+ ::rtl::OUString GetExportFilterFromImportFilter( const ::rtl::OUString& aImportFilterName );
+
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
+ sal_Int32 nMustFlags,
+ sal_Int32 nDontFlags );
+
static sal_Bool ClassIDsEqual( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID1,
const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID2 );
static ::com::sun::star::uno::Sequence< sal_Int8 > GetSequenceClassID( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
diff --git a/comphelper/inc/comphelper/namedvaluecollection.hxx b/comphelper/inc/comphelper/namedvaluecollection.hxx
index 04f68bc102d2..6ec12a6aa5c2 100644
--- a/comphelper/inc/comphelper/namedvaluecollection.hxx
+++ b/comphelper/inc/comphelper/namedvaluecollection.hxx
@@ -40,6 +40,7 @@
#include <memory>
#include <algorithm>
+#include <vector>
//........................................................................
namespace comphelper
@@ -92,6 +93,11 @@ namespace comphelper
~NamedValueCollection();
+ inline void assign( const ::com::sun::star::uno::Any& i_rWrappedElements )
+ {
+ impl_assign( i_rWrappedElements );
+ }
+
inline void assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments )
{
impl_assign( _rArguments );
@@ -118,6 +124,11 @@ namespace comphelper
/// determines whether the collection is empty
bool empty() const;
+ /** returns the names of all elements in the collection
+ */
+ ::std::vector< ::rtl::OUString >
+ getNames() const;
+
/** merges the content of another collection into |this|
@param _rAdditionalValues
the collection whose values are to be merged
@@ -313,6 +324,7 @@ namespace comphelper
}
private:
+ void impl_assign( const ::com::sun::star::uno::Any& i_rWrappedElements );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments );
void impl_assign( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rArguments );
diff --git a/comphelper/inc/comphelper/optionalvalue.hxx b/comphelper/inc/comphelper/optionalvalue.hxx
deleted file mode 100644
index 3bc5cdc7a19c..000000000000
--- a/comphelper/inc/comphelper/optionalvalue.hxx
+++ /dev/null
@@ -1,190 +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 _COMPHELPER_OPTIONALVALUE_HXX
-#define _COMPHELPER_OPTIONALVALUE_HXX
-
-#include <com/sun/star/uno/Any.hxx>
-
-namespace comphelper
-{
-
-/** @deprecated
- Use boost/optional.hpp instead.
-*/
-
-
-
- /* Definition of OptionalValue template */
-
- /** This template provides 'optionality' for the given value type.
-
- Especially for PODs, optionality either needs to be achieved
- by special 'magic' values (i.e. an int value is not set when
- -1 etc.), or an additional bool denoting value
- validity. This template encapsulates the latter into an atomic
- data type.
-
- @tpl Element
- The value type that should be made optional
- */
- template< typename Element > class OptionalValue
- {
- public:
- typedef Element ValueType;
-
- /** Default-construct the value.
-
- A default-constructed value is not valid. You have to
- explicitely set a value.
- */
- OptionalValue() :
- maValue(),
- mbValid( false )
- {
- }
-
- /** Construct the value.
-
- An explicitely constructed value is valid. To create an
- invalid value, you have to default-construct it.
- */
- OptionalValue( const Element& rValue ) :
- maValue( rValue ),
- mbValid( true )
- {
- }
-
- // default copy/assignment operators are okay here
- //OptionalValue(const OptionalValue&);
- //OptionalValue& operator=( const OptionalValue& );
-
- /** Query whether the value is valid
-
- @return true, if this object contains a valid value.
- */
- bool isValid() const
- {
- return mbValid;
- }
-
- /** Set a value.
-
- After this call, the object contains a valid value.
- */
- void setValue( const Element& rValue )
- {
- maValue = rValue;
- mbValid = true;
- }
-
- /** Get the value.
-
- The return value of this method is undefined, if the
- object does not contain a valid value.
- */
- Element getValue() const
- {
- return maValue;
- }
-
- /** Clear the value.
-
- After this call, the object no longer contains a valid
- value.
- */
- void clearValue()
- {
- mbValid = false;
- }
-
- // NOTE: The following two methods would optimally have been
- // implemented as operator>>=/operator<<=
- // overloads. Unfortunately, there's already a templatized
- // version for those two methods, namely for UNO interface
- // types. Adding a second would lead to ambiguities.
-
- /** Export the value into an Any.
-
- This method extracts the value into an Any. If the value
- is invalid, the Any will be cleared.
-
- @return true, if the value has been successfully
- transferred to the Any. Clearing the Any from an invalid
- object is also considered a successful operation.
- */
- bool exportValue( ::com::sun::star::uno::Any& o_rAny )
- {
- o_rAny.clear();
-
- if( isValid() )
- {
- if( !(o_rAny <<= getValue()) )
- return false;
- }
-
- return true;
- }
-
- /** Import the value from an Any.
-
- This method imports the value from an Any. If the Any
- is invalid, the object will get an invalid value.
-
- @return true, if the value has been successfully
- transferred from the Any. Setting the value to invalid
- from an empty Any is also considered a successful
- operation.
- */
- bool importValue( const ::com::sun::star::uno::Any& rAny )
- {
- clearValue();
-
- if( rAny.hasValue() )
- {
- Element tmp;
-
- if( !(rAny >>= tmp) )
- return false;
-
- setValue( tmp );
- }
-
- return true;
- }
-
- private:
- Element maValue;
- bool mbValid;
- };
-
-}
-
-#endif /* _COMPHELPER_OPTIONALVALUE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/inc/comphelper/property.hxx b/comphelper/inc/comphelper/property.hxx
index 2cb9c662ee80..662fa84903b8 100644
--- a/comphelper/inc/comphelper/property.hxx
+++ b/comphelper/inc/comphelper/property.hxx
@@ -151,11 +151,11 @@ COMPHELPER_DLLPUBLIC void copyProperties(const staruno::Reference<starbeans::XPr
sal_False, if the value could be converted and has not changed
@exception InvalidArgumentException thrown if the value could not be converted to the requested type (which is the template argument)
*/
-template <class TYPE>
-sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const TYPE& _rCurrentValue)
+template <typename T>
+sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, const T& _rCurrentValue)
{
sal_Bool bModified(sal_False);
- TYPE aNewValue;
+ T aNewValue = T();
::cppu::convertPropertyValue(aNewValue, _rValueToSet);
if (aNewValue != _rCurrentValue)
{
@@ -208,7 +208,7 @@ sal_Bool tryPropertyValueEnum(staruno::Any& /*out*/_rConvertedValue, staruno::An
inline sal_Bool tryPropertyValue(staruno::Any& /*out*/_rConvertedValue, staruno::Any& /*out*/_rOldValue, const staruno::Any& _rValueToSet, sal_Bool _bCurrentValue)
{
sal_Bool bModified(sal_False);
- sal_Bool bNewValue;
+ sal_Bool bNewValue(sal_False);
::cppu::convertPropertyValue(bNewValue, _rValueToSet);
if (bNewValue != _bCurrentValue)
{
diff --git a/comphelper/inc/comphelper/querydeep.hxx b/comphelper/inc/comphelper/querydeep.hxx
deleted file mode 100644
index af6d5ae6306f..000000000000
--- a/comphelper/inc/comphelper/querydeep.hxx
+++ /dev/null
@@ -1,486 +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 _COMPHELPER_QUERYDEEPINTERFACE_HXX
-#define _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-/** */ //for docpp
-namespace comphelper
-{
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interfaces types whether they are related by inheritance.
- *<BR>
- * @return true if rType is derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param rType a <type>Type</type> of an interface.
- */
-sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType );
-
-//--------------------------------------------------------------------------------------------------------
-/**
- * Inspect interface types whether they are related by inheritance.
- *<BR>
- * @return true if p is of a type derived from rBaseType
- * @param rBaseType a <type>Type</type> of an interface.
- * @param p a pointer to an interface.
- */
-template <class Interface>
-inline sal_Bool isDerivedFrom(
- const ::com::sun::star::uno::Type& rBaseType,
- Interface* /*p*/)
-{
- return isDerivedFrom(rBaseType, Interface::static_type());
-}
-
-//--------------------------------------------------------------------------------------------------------
-// possible optimization ?
-// Any aRet(::cppu::queryInterface(rType, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12));
-// if (aRet.hasValue())
-// return aRet;
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- */
-template< class Interface1 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- */
-template< class Interface1, class Interface2 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-/**
- * Inspect types and choose return proper interface.
- *<BR>
- * @param p1 a pointer to an interface.
- * @param p2 a pointer to an interface.
- * @param p3 a pointer to an interface.
- * @param p4 a pointer to an interface.
- * @param p5 a pointer to an interface.
- * @param p6 a pointer to an interface.
- * @param p7 a pointer to an interface.
- * @param p8 a pointer to an interface.
- * @param p9 a pointer to an interface.
- * @param p10 a pointer to an interface.
- * @param p11 a pointer to an interface.
- * @param p12 a pointer to an interface.
- */
-template< class Interface1, class Interface2, class Interface3, class Interface4, class Interface5,
- class Interface6, class Interface7, class Interface8, class Interface9, class Interface10,
- class Interface11, class Interface12 >
-inline ::com::sun::star::uno::Any queryDeepInterface(
- const ::com::sun::star::uno::Type & rType,
- Interface1 * p1, Interface2 * p2, Interface3 * p3, Interface4 * p4, Interface5 * p5,
- Interface6 * p6, Interface7 * p7, Interface8 * p8, Interface9 * p9, Interface10 * p10,
- Interface11 * p11, Interface12 * p12 )
-{
- if (isDerivedFrom(rType, Interface1::static_type()))
- return ::com::sun::star::uno::Any( &p1, rType );
- else if (isDerivedFrom(rType, Interface2::static_type()))
- return ::com::sun::star::uno::Any( &p2, rType );
- else if (isDerivedFrom(rType, Interface3::static_type()))
- return ::com::sun::star::uno::Any( &p3, rType );
- else if (isDerivedFrom(rType, Interface4::static_type()))
- return ::com::sun::star::uno::Any( &p4, rType );
- else if (isDerivedFrom(rType, Interface5::static_type()))
- return ::com::sun::star::uno::Any( &p5, rType );
- else if (isDerivedFrom(rType, Interface6::static_type()))
- return ::com::sun::star::uno::Any( &p6, rType );
- else if (isDerivedFrom(rType, Interface7::static_type()))
- return ::com::sun::star::uno::Any( &p7, rType );
- else if (isDerivedFrom(rType, Interface8::static_type()))
- return ::com::sun::star::uno::Any( &p8, rType );
- else if (isDerivedFrom(rType, Interface9::static_type()))
- return ::com::sun::star::uno::Any( &p9, rType );
- else if (isDerivedFrom(rType, Interface10::static_type()))
- return ::com::sun::star::uno::Any( &p10, rType );
- else if (isDerivedFrom(rType, Interface11::static_type()))
- return ::com::sun::star::uno::Any( &p11, rType );
- else if (isDerivedFrom(rType, Interface12::static_type()))
- return ::com::sun::star::uno::Any( &p12, rType );
- else
- return ::com::sun::star::uno::Any();
-}
-
-} // namespace comphelper
-
-#endif // _COMPHELPER_QUERYDEEPINTERFACE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/inc/comphelper/scopeguard.hxx b/comphelper/inc/comphelper/scopeguard.hxx
index 1c831c08ff20..33c4f710c945 100644
--- a/comphelper/inc/comphelper/scopeguard.hxx
+++ b/comphelper/inc/comphelper/scopeguard.hxx
@@ -34,6 +34,7 @@
#endif
#include "boost/function.hpp"
#include "boost/noncopyable.hpp"
+#include "boost/bind.hpp"
namespace comphelper {
diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx
index a68fa2093116..f44df7a63e1e 100644
--- a/comphelper/inc/comphelper/sequenceasvector.hxx
+++ b/comphelper/inc/comphelper/sequenceasvector.hxx
@@ -90,6 +90,17 @@ class SequenceAsVector : public ::std::vector< TElementType >
{}
//---------------------------------------
+ /** @short creates a new vector with the given length.
+
+ @param nLength
+ the number of elements for the new vector.
+ */
+ explicit SequenceAsVector(sal_Int32 nLength) :
+ ::std::vector< TElementType >( static_cast< size_t >( nLength ) )
+ {
+ }
+
+ //---------------------------------------
/** @short creates a new deque from the given uno sequence.
@param lSource
diff --git a/comphelper/inc/comphelper/servicedecl.hxx b/comphelper/inc/comphelper/servicedecl.hxx
index 77c56eafb417..4574406db031 100644
--- a/comphelper/inc/comphelper/servicedecl.hxx
+++ b/comphelper/inc/comphelper/servicedecl.hxx
@@ -68,7 +68,7 @@ typedef ::boost::function3<
The declaration can be done in various ways, the (simplest) form is
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Reference<uno::XComponentContext> const& xContext )
[...]
@@ -86,7 +86,7 @@ typedef ::boost::function3<
context:
<pre>
- class MyClass : cppu::WeakImplHelper2<XInterface1, XInterface2> {
+ class MyClass : public cppu::WeakImplHelper2<XInterface1, XInterface2> {
public:
MyClass( uno::Sequence<uno::Any> const& args,
uno::Reference<uno:XComponentContext> const& xContext )
@@ -135,8 +135,6 @@ public:
m_pServiceNames(pSupportedServiceNames),
m_cDelim(cDelim) {}
- /// @internal gets called by component_writeInfoHelper()
- bool writeInfo( ::com::sun::star::registry::XRegistryKey * xKey ) const;
/// @internal gets called by component_getFactoryHelper()
void * getFactory( sal_Char const* pImplName ) const;
@@ -324,9 +322,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
// component_... helpers with arbitrary service declarations:
//
-#define COMPHELPER_SERVICEDECL_writeInfo(z_, n_, unused_) \
- bRet &= BOOST_PP_CAT(s, n_).writeInfo( xRegistryKey );
-
#define COMPHELPER_SERVICEDECL_getFactory(z_, n_, unused_) \
if (pRet == 0) \
pRet = BOOST_PP_CAT(s, n_).getFactory(pImplName);
@@ -334,11 +329,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
/** The following preprocessor repetitions generate functions like
<pre>
- inline sal_Bool component_writeInfoHelper(
- ::com::sun::star::lang::XMultiServiceFactory *,
- ::com::sun::star::registry::XRegistryKey * xRegistryKey,
- ServiceDecl const& s0, ServiceDecl const& s1, ... );
-
inline void * component_getFactoryHelper(
sal_Char const* pImplName,
::com::sun::star::lang::XMultiServiceFactory *,
@@ -352,15 +342,6 @@ struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT
COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS; its default is 8.
*/
#define COMPHELPER_SERVICEDECL_make(z_, n_, unused_) \
-inline sal_Bool component_writeInfoHelper( \
- ::com::sun::star::lang::XMultiServiceFactory *, \
- ::com::sun::star::registry::XRegistryKey * xRegistryKey, \
- BOOST_PP_ENUM_PARAMS(n_, ServiceDecl const& s) ) \
-{ \
- bool bRet = true; \
- BOOST_PP_REPEAT(n_, COMPHELPER_SERVICEDECL_writeInfo, ~) \
- return bRet; \
-} \
inline void * component_getFactoryHelper( \
sal_Char const* pImplName, \
::com::sun::star::lang::XMultiServiceFactory *, \
@@ -382,7 +363,6 @@ BOOST_PP_REPEAT_FROM_TO(1, COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS,
#undef COMPHELPER_SERVICEDECL_COMPONENT_HELPER_MAX_ARGS
#undef COMPHELPER_SERVICEDECL_make
#undef COMPHELPER_SERVICEDECL_getFactory
-#undef COMPHELPER_SERVICEDECL_writeInfo
} // namespace service_decl
} // namespace comphelper
@@ -422,13 +402,6 @@ extern "C" \
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; \
} \
\
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \
- ::com::sun::star::registry::XRegistryKey* pRegistryKey ) \
- { \
- return component_writeInfoHelper( pServiceManager, pRegistryKey, \
- BOOST_PP_SEQ_ENUM(varargs_) ); \
- } \
- \
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( sal_Char const* pImplName, \
::com::sun::star::lang::XMultiServiceFactory* pServiceManager, \
::com::sun::star::registry::XRegistryKey* pRegistryKey ) \
diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx
index b8efa00b0d92..05afd901fc57 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
@@ -44,6 +45,9 @@
#define ZIP_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ZipFormat" ) )
#define OFOPXML_STORAGE_FORMAT_STRING ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OFOPXMLFormat" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1UTF8EncryptionKey" ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PackageSHA1MS1252EncryptionKey" ) )
+
namespace comphelper {
class COMPHELPER_DLLPUBLIC OStorageHelper
@@ -113,9 +117,9 @@ public:
= ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() )
throw ( ::com::sun::star::uno::Exception );
- static void SetCommonStoragePassword(
+ static void SetCommonStorageEncryptionData(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aEncryptionData )
throw ( ::com::sun::star::uno::Exception );
// the following method supports only storages of OOo formats
@@ -160,6 +164,9 @@ public:
sal_Bool bRepairStorage = sal_False )
throw ( ::com::sun::star::uno::Exception );
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ CreatePackageEncryptionData( const ::rtl::OUString& aPassword );
+
static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed );
static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed );
diff --git a/comphelper/prj/build.lst b/comphelper/prj/build.lst
index 8a4f18ad2905..a828870f2dbf 100644
--- a/comphelper/prj/build.lst
+++ b/comphelper/prj/build.lst
@@ -1,15 +1,2 @@
-ph comphelper : cppuhelper ucbhelper offuh salhelper NULL
-ph comphelper usr1 - all ph_mkout NULL
-ph comphelper\inc nmake - all ph_inc NULL
-ph comphelper\source\container nmake - all ph_container ph_inc NULL
-ph comphelper\source\eventattachermgr nmake - all ph_evtatmgr ph_inc NULL
-ph comphelper\source\misc nmake - all ph_misc ph_inc NULL
-ph comphelper\source\processfactory nmake - all ph_procfact ph_inc NULL
-ph comphelper\source\property nmake - all ph_property ph_inc NULL
-ph comphelper\source\streaming nmake - all ph_streaming ph_inc NULL
-ph comphelper\source\compare nmake - all ph_compare ph_inc NULL
-ph comphelper\source\officeinstdir nmake - all ph_officeinstdir ph_inc NULL
-ph comphelper\source\xml nmake - all ph_xml NULL
-ph comphelper\util nmake - all ph_util ph_container ph_evtatmgr ph_misc ph_procfact ph_property ph_streaming ph_compare ph_officeinstdir ph_xml NULL
-ph comphelper\qa\weakbag nmake - all qa_weakbag ph_util NULL
-ph comphelper\qa\string nmake - all qa_string ph_util NULL
+ph comphelper : cppuhelper ucbhelper offuh salhelper LIBXSLT:libxslt NULL
+ch comphelper\prj nmake - all ch_all NULL
diff --git a/comphelper/prj/d.lst b/comphelper/prj/d.lst
index f4d09c54ba70..e69de29bb2d1 100644
--- a/comphelper/prj/d.lst
+++ b/comphelper/prj/d.lst
@@ -1,14 +0,0 @@
-..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
-..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl
-..\%__SRC%\bin\*.bin %_DEST%\bin%_EXT%\*.bin
-..\%__SRC%\inc\*.bin %_DEST%\bin%_EXT%\*.bin
-
-mkdir: %_DEST%\inc%_EXT%\comphelper
-..\inc\comphelper\*.hxx %_DEST%\inc%_EXT%\comphelper\*.hxx
-..\inc\comphelper\*.h %_DEST%\inc%_EXT%\comphelper\*.h
-mkdir: %_DEST%\inc%_EXT%\cppuhelper
-..\inc\comphelper\extract.hxx %_DEST%\inc%_EXT%\cppuhelper\extract.hxx
-..\version.mk %_DEST%\inc%_EXT%\comphelper\version.mk
diff --git a/toolkit/util/makefile.pmk b/comphelper/prj/makefile.mk
index f04a39bac91b..e312a7ccab65 100644
--- a/toolkit/util/makefile.pmk
+++ b/comphelper/prj/makefile.mk
@@ -25,12 +25,16 @@
#
#*************************************************************************
-# Reduction of exported symbols:
-CDEFS += -DTOOLKIT_DLLIMPLEMENTATION
-VISIBILITY_HIDDEN=TRUE
+PRJ=..
+TARGET=prj
-CFLAGS+=-I$(PRJ)/source
+.INCLUDE : settings.mk
-.IF "$(ENABLE_LAYOUT)" == "TRUE"
-CFLAGS+=-DTEST_LAYOUT=1
-.ENDIF # ENABLE_LAYOUT == TRUE
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/comphelper/qa/complex/comphelper/Map.java b/comphelper/qa/complex/comphelper/Map.java
index deeffe6baf32..5571eadb7e6e 100644
--- a/comphelper/qa/complex/comphelper/Map.java
+++ b/comphelper/qa/complex/comphelper/Map.java
@@ -39,10 +39,10 @@ import com.sun.star.container.XIdentifierAccess;
import com.sun.star.container.XMap;
import com.sun.star.container.XSet;
import com.sun.star.form.XFormComponent;
-import com.sun.star.lang.DisposedException;
+// import com.sun.star.lang.DisposedException;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.Locale;
-import com.sun.star.lang.NoSupportException;
+// import com.sun.star.lang.NoSupportException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Any;
import com.sun.star.uno.AnyConverter;
@@ -53,28 +53,36 @@ import com.sun.star.uno.XInterface;
import java.util.HashSet;
import java.util.Set;
+// 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.*;
+
/** complex test case for the css.container.Map implementation
*
* @author frank.schoenheit@sun.com
*/
-public class Map extends complexlib.ComplexTestCase
+public class Map /* extends complexlib.ComplexTestCase */
{
- @Override
- public String[] getTestMethodNames()
- {
- return new String[] {
- "testSimpleKeyTypes",
- "testComplexKeyTypes",
- "testValueTypes",
- "testEnumerations",
- "testSpecialValues"
- };
- }
-
- public static String getShortTestDescription()
- {
- return "tests the css.container.Map implementation from comphelper/source/misc/map.cxx";
- }
+// @Override
+// public String[] getTestMethodNames()
+// {
+// return new String[] {
+// "testSimpleKeyTypes",
+// "testComplexKeyTypes",
+// "testValueTypes",
+// "testEnumerations",
+// "testSpecialValues"
+// };
+// }
+
+// public static String getShortTestDescription()
+// {
+// return "tests the css.container.Map implementation from comphelper/source/misc/map.cxx";
+// }
private String impl_getNth( int n )
{
@@ -98,11 +106,11 @@ public class Map extends complexlib.ComplexTestCase
{
for ( int i=0; i<_keys.length; ++i )
{
- assure( _context + ": " + impl_getNth(i) + " key (" + _keys[i].toString() + ") not found in map",
+ assertTrue( _context + ": " + impl_getNth(i) + " key (" + _keys[i].toString() + ") not found in map",
_map.containsKey( _keys[i] ) );
- assure( _context + ": " + impl_getNth(i) + " value (" + _values[i].toString() + ") not found in map",
+ assertTrue( _context + ": " + impl_getNth(i) + " value (" + _values[i].toString() + ") not found in map",
_map.containsValue( _values[i] ) );
- assureEquals( _context + ": wrong value for " + impl_getNth(i) + " key (" + _keys[i] + ")",
+ assertEquals( _context + ": wrong value for " + impl_getNth(i) + " key (" + _keys[i] + ")",
_values[i], _map.get( _keys[i] ) );
}
}
@@ -110,21 +118,21 @@ public class Map extends complexlib.ComplexTestCase
@SuppressWarnings("unchecked")
private void impl_checkMappings( Object[] _keys, Object[] _values, String _context ) throws com.sun.star.uno.Exception
{
- log.println( "checking mapping " + _context + "..." );
+ System.out.println( "checking mapping " + _context + "..." );
Type keyType = AnyConverter.getType( _keys[0] );
Type valueType = AnyConverter.getType( _values[0] );
// create a map for the given types
- XMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(),
+ XMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(),
keyType, valueType );
- assure( _context + ": key types do not match", map.getKeyType().equals( keyType ) );
- assure( _context + ": value types do not match", map.getValueType().equals( valueType ) );
+ assertTrue( _context + ": key types do not match", map.getKeyType().equals( keyType ) );
+ assertTrue( _context + ": value types do not match", map.getValueType().equals( valueType ) );
// insert all values
- assure( _context + ": initially created map is not empty", map.hasElements() );
+ assertTrue( _context + ": initially created map is not empty", map.hasElements() );
impl_putAll( map, _keys, _values );
- assure( _context + ": map filled with values is still empty", !map.hasElements() );
+ assertTrue( _context + ": map filled with values is still empty", !map.hasElements() );
// and verify them
impl_ceckContent( map, _keys, _values, _context );
@@ -132,32 +140,33 @@ public class Map extends complexlib.ComplexTestCase
for ( int i=_keys.length-1; i>=0; --i )
{
// ensure 'remove' really returns the old value
- assureEquals( _context + ": wrong 'old value' for removal of " + impl_getNth(i) + " value",
+ assertEquals( _context + ": wrong 'old value' for removal of " + impl_getNth(i) + " value",
_values[i], map.remove( _keys[i] ) );
}
- assure( _context + ":map not empty after removing all elements", map.hasElements() );
+ assertTrue( _context + ":map not empty after removing all elements", map.hasElements() );
// insert again, and check whether 'clear' does what it should do
impl_putAll( map, _keys, _values );
map.clear();
- assure( _context + ": 'clear' does not empty the map", map.hasElements() );
+ assertTrue( _context + ": 'clear' does not empty the map", map.hasElements() );
// try the constructor which creates an immutable version
Pair< ?, ? >[] initialMappings = new Pair< ?, ? >[ _keys.length ];
for ( int i=0; i<_keys.length; ++i )
+ {
initialMappings[i] = new Pair< Object, Object >( _keys[i], _values[i] );
+ }
map = com.sun.star.container.EnumerableMap.createImmutable(
- param.getComponentContext(), keyType, valueType, (Pair< Object, Object >[])initialMappings );
+ connection.getComponentContext(), keyType, valueType, (Pair< Object, Object >[])initialMappings );
impl_ceckContent( map, _keys, _values, _context );
// check the thing is actually immutable
- assureException( map, "clear", new Object[] {}, NoSupportException.class );
- assureException( map, "remove", new Class[] { Object.class }, new Object[] { _keys[0] }, NoSupportException.class );
- assureException( map, "put", new Class[] { Object.class, Object.class }, new Object[] { _keys[0], _values[0] },
- NoSupportException.class );
+ //? assureException( map, "clear", new Object[] {}, NoSupportException.class );
+ //? assureException( map, "remove", new Class[] { Object.class }, new Object[] { _keys[0] }, NoSupportException.class );
+ //? assureException( map, "put", new Class[] { Object.class, Object.class }, new Object[] { _keys[0], _values[0] }, NoSupportException.class );
}
- public void testSimpleKeyTypes() throws com.sun.star.uno.Exception
+ @Test public void testSimpleKeyTypes() throws com.sun.star.uno.Exception
{
impl_checkMappings(
new Long[] { (long)1, (long)2, (long)3, (long)4, (long)5 },
@@ -191,7 +200,7 @@ public class Map extends complexlib.ComplexTestCase
);
}
- public void testComplexKeyTypes() throws com.sun.star.uno.Exception
+ @Test public void testComplexKeyTypes() throws com.sun.star.uno.Exception
{
Type intType = new Type( Integer.class );
Type longType = new Type( Long.class );
@@ -212,7 +221,7 @@ public class Map extends complexlib.ComplexTestCase
Object[] components = new Object[ serviceNames.length ];
for ( int i=0; i<serviceNames.length; ++i )
{
- components[i] = ((XMultiServiceFactory)param.getMSF()).createInstance( "com.sun.star.form.component." + serviceNames[i] );
+ components[i] = getMSF().createInstance( "com.sun.star.form.component." + serviceNames[i] );
}
// "normalize" the first component, so it has the property type
Type formComponentType = new Type( XFormComponent.class );
@@ -248,7 +257,7 @@ public class Map extends complexlib.ComplexTestCase
case 12: valueClass = ContainerEvent.class; break;
case 13: valueClass = Object.class; break;
default:
- failed( "internal error: wrong position for getValueClass" );
+ fail( "internal error: wrong position for getValueClass" );
}
return valueClass;
}
@@ -274,7 +283,7 @@ public class Map extends complexlib.ComplexTestCase
case 12: someValue = new ContainerEvent(); break;
case 13: someValue = new Locale(); break; // just use *any* value which does not conflict with the others
default:
- failed( "internal error: wrong position for getSomeValue" );
+ fail( "internal error: wrong position for getSomeValue" );
}
return someValue;
}
@@ -313,7 +322,7 @@ public class Map extends complexlib.ComplexTestCase
public boolean hasElements() { throw new UnsupportedOperationException( "Not implemented." ); }
};
- public void testValueTypes() throws com.sun.star.uno.Exception
+ @Test public void testValueTypes() throws com.sun.star.uno.Exception
{
final Integer key = new Integer(1);
@@ -349,29 +358,31 @@ public class Map extends complexlib.ComplexTestCase
for ( int valueTypePos = 0; valueTypePos != typeCompatibility.length; ++valueTypePos )
{
- XMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(),
+ XMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(),
new Type( Integer.class ), new Type( impl_getValueClassByPos( valueTypePos ) ) );
for ( int checkTypePos = 0; checkTypePos != typeCompatibility[valueTypePos].length; ++checkTypePos )
{
Object value = impl_getSomeValueByTypePos( checkTypePos );
if ( typeCompatibility[valueTypePos][checkTypePos] != 0 )
+ {
// expected to succeed
- assureException(
- "(" + valueTypePos + "," + checkTypePos + ") putting an " +
- AnyConverter.getType( value ).getTypeName() + ", where " +
- map.getValueType().getTypeName() + " is expected, should succeed",
- map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
- null );
+//? assureException(
+//? "(" + valueTypePos + "," + checkTypePos + ") putting an " +
+//? AnyConverter.getType( value ).getTypeName() + ", where " +
+//? map.getValueType().getTypeName() + " is expected, should succeed",
+//? map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
+//? null );
+ }
else
{
// expected to fail
- assureException(
- "(" + valueTypePos + "," + checkTypePos + ") putting an " +
- AnyConverter.getType( value ).getTypeName() + ", where " +
- map.getValueType().getTypeName() + " is expected, should not succeed",
- map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
- IllegalTypeException.class );
+//? assureException(
+//? "(" + valueTypePos + "," + checkTypePos + ") putting an " +
+//? AnyConverter.getType( value ).getTypeName() + ", where " +
+//? map.getValueType().getTypeName() + " is expected, should not succeed",
+//? map, "put", new Class[] { Object.class, Object.class }, new Object[] { key, value },
+//? IllegalTypeException.class );
}
}
}
@@ -409,7 +420,9 @@ public class Map extends complexlib.ComplexTestCase
// are provided by the enumeration
Set set = new HashSet();
for ( int i=0; i<_expectedElements.length; ++i )
+ {
set.add( i );
+ }
CompareEqual comparator = _expectedElements[0].getClass().equals( Pair.class )
? new PairCompareEqual()
@@ -417,12 +430,14 @@ public class Map extends complexlib.ComplexTestCase
for ( int i=0; i<_expectedElements.length; ++i )
{
- assure( _context + ": too few elements in the enumeration (still " + ( _expectedElements.length - i ) + " to go)",
+ assertTrue( _context + ": too few elements in the enumeration (still " + ( _expectedElements.length - i ) + " to go)",
_enum.hasMoreElements() );
Object nextElement = _enum.nextElement();
if ( nextElement.getClass().equals( Any.class ) )
+ {
nextElement = ((Any)nextElement).getObject();
+ }
int foundPos = -1;
for ( int j=0; j<_expectedElements.length; ++j )
@@ -434,24 +449,26 @@ public class Map extends complexlib.ComplexTestCase
}
}
- assure( _context + ": '" + nextElement.toString() + "' is not expected in the enumeration",
+ assertTrue( _context + ": '" + nextElement.toString() + "' is not expected in the enumeration",
set.contains( foundPos ) );
set.remove( foundPos );
}
- assure( _context + ": too many elements returned by the enumeration", set.isEmpty() );
+ assertTrue( _context + ": too many elements returned by the enumeration", set.isEmpty() );
}
- public void testEnumerations() throws com.sun.star.uno.Exception
+ @Test public void testEnumerations() throws com.sun.star.uno.Exception
{
// fill a map
final String[] keys = new String[] { "This", "is", "an", "enumeration", "test" };
final String[] values = new String[] { "for", "the", "map", "implementation", "." };
- XEnumerableMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(), new Type( String.class ), new Type( String.class ) );
+ XEnumerableMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(), new Type( String.class ), new Type( String.class ) );
impl_putAll( map, keys, values );
final Pair< ?, ? >[] paired = new Pair< ?, ? >[ keys.length ];
for ( int i=0; i<keys.length; ++i )
+ {
paired[i] = new Pair< Object, Object >( keys[i], values[i] );
+ }
// create non-isolated enumerators, and check their content
XEnumeration enumerateKeys = map.createKeyEnumeration( false );
@@ -464,9 +481,9 @@ public class Map extends complexlib.ComplexTestCase
// all enumerators above have been created as non-isolated iterators, so they're expected to die when
// the underlying map changes
map.remove( keys[0] );
- assureException( enumerateKeys, "hasMoreElements", new Object[] {}, DisposedException.class );
- assureException( enumerateValues, "hasMoreElements", new Object[] {}, DisposedException.class );
- assureException( enumerateAll, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateKeys, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateValues, "hasMoreElements", new Object[] {}, DisposedException.class );
+//? assureException( enumerateAll, "hasMoreElements", new Object[] {}, DisposedException.class );
// now try with isolated iterators
map.put( keys[0], values[0] );
@@ -479,36 +496,58 @@ public class Map extends complexlib.ComplexTestCase
impl_verifyEnumerationContent( enumerateAll, paired, "content enumeration" );
}
- public void testSpecialValues() throws com.sun.star.uno.Exception
+ @Test public void testSpecialValues() throws com.sun.star.uno.Exception
{
final Double[] keys = new Double[] { new Double( 0 ), Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY };
final Double[] values = new Double[] { Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, new Double( 0 ) };
- XEnumerableMap map = com.sun.star.container.EnumerableMap.create( param.getComponentContext(), new Type( Double.class ), new Type( Double.class ) );
+ XEnumerableMap map = com.sun.star.container.EnumerableMap.create( connection.getComponentContext(), new Type( Double.class ), new Type( Double.class ) );
impl_putAll( map, keys, values );
- assure( "containsKey( Double.+INF failed", map.containsKey( Double.POSITIVE_INFINITY ) );
- assure( "containsKey( Double.-INF failed", map.containsKey( Double.NEGATIVE_INFINITY ) );
- assure( "containsKey( 0 ) failed", map.containsKey( new Double( 0 ) ) );
+ assertTrue( "containsKey( Double.+INF failed", map.containsKey( Double.POSITIVE_INFINITY ) );
+ assertTrue( "containsKey( Double.-INF failed", map.containsKey( Double.NEGATIVE_INFINITY ) );
+ assertTrue( "containsKey( 0 ) failed", map.containsKey( new Double( 0 ) ) );
- assure( "containsValue( Double.+INF ) failed", map.containsValue( Double.POSITIVE_INFINITY ) );
- assure( "containsValue( Double.-INF ) failed", map.containsValue( Double.NEGATIVE_INFINITY ) );
- assure( "containsValue( 0 ) failed", map.containsValue( new Double( 0 ) ) );
+ assertTrue( "containsValue( Double.+INF ) failed", map.containsValue( Double.POSITIVE_INFINITY ) );
+ assertTrue( "containsValue( Double.-INF ) failed", map.containsValue( Double.NEGATIVE_INFINITY ) );
+ assertTrue( "containsValue( 0 ) failed", map.containsValue( new Double( 0 ) ) );
// put and containsKey should reject Double.NaN as key
- assureException( "Double.NaN should not be allowed as key in a call to 'put'", map, "put",
- new Class[] { Object.class, Object.class }, new Object[] { Double.NaN, new Double( 0 ) },
- com.sun.star.lang.IllegalArgumentException.class );
- assureException( "Double.NaN should not be allowed as key in a call to 'containsKey'", map, "containsKey",
- new Class[] { Object.class }, new Object[] { Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'put'", map, "put",
+//? new Class[] { Object.class, Object.class }, new Object[] { Double.NaN, new Double( 0 ) },
+//? com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'containsKey'", map, "containsKey",
+//? new Class[] { Object.class }, new Object[] { Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
// ditto for put and containsValue
- assureException( "Double.NaN should not be allowed as value in a call to 'put'", map, "put",
- new Class[] { Object.class, Object.class }, new Object[] { new Double( 0 ), Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
- assureException( "Double.NaN should not be allowed as key in a call to 'containsValue'", map, "containsValue",
- new Class[] { Object.class }, new Object[] { Double.NaN },
- com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as value in a call to 'put'", map, "put",
+//? new Class[] { Object.class, Object.class }, new Object[] { new Double( 0 ), Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
+//? assureException( "Double.NaN should not be allowed as key in a call to 'containsValue'", map, "containsValue",
+//? new Class[] { Object.class }, new Object[] { Double.NaN },
+//? com.sun.star.lang.IllegalArgumentException.class );
+ }
+
+
+ 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/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java b/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
index 26879a7c83ad..d6683e64bc83 100644
--- a/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
+++ b/comphelper/qa/complex/comphelper/SequenceOutputStreamUnitTest.java
@@ -26,46 +26,163 @@
************************************************************************/
package complex.comphelper;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+
+import com.sun.star.io.XSequenceOutputStream;
+import com.sun.star.io.XSeekableInputStream;
+
+import java.util.Random;
+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.*;
/* Document.
*/
-public class SequenceOutputStreamUnitTest extends ComplexTestCase {
- private XMultiServiceFactory m_xMSF = null;
+class TestHelper
+{
+ // LogWriter m_aLogWriter;
+ String m_sTestPrefix;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01"};
+ /** Creates a new instance of TestHelper
+ * @param sTestPrefix
+ */
+ public TestHelper ( String sTestPrefix ) {
+ m_sTestPrefix = sTestPrefix;
}
- public String getTestObjectName () {
- return "SequenceOutputStreamUnitTest";
+ public void Error ( String sError ) {
+ System.out.println ( m_sTestPrefix + "Error: " + sError );
}
- public static String getShortTestDescription() {
- return "tests the SequenceOutput/InputStream implementations";
+ public void Message ( String sMessage ) {
+ System.out.println ( m_sTestPrefix + sMessage );
}
+}
+
+public class SequenceOutputStreamUnitTest /* extends ComplexTestCase*/ {
+ private XMultiServiceFactory m_xMSF = null;
+
+ TestHelper m_aTestHelper = null;
- public void before() {
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01"};
+// }
+
+// public String getTestObjectName () {
+// return "SequenceOutputStreamUnitTest";
+// }
+
+// public static String getShortTestDescription() {
+// return "tests the SequenceOutput/InputStream implementations";
+// }
+
+ @Before public void before() {
try {
- m_xMSF = (XMultiServiceFactory)param.getMSF ();
+ m_xMSF = getMSF();
+ m_aTestHelper = new TestHelper ( "Test01: ");
} catch (Exception e) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
if (m_xMSF==null) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
}
- public void ExecuteTest01() {
- Test01 aTest = new Test01 (m_xMSF, log);
- assure ( "Test01 failed!", aTest.test() );
+// @Test public void ExecuteTest01() {
+// Test01 aTest = new Test01 (m_xMSF);
+// assertTrue( "Test01 failed!", aTest.test() );
+// }
+
+ @Test public void test () {
+ try {
+ final int nBytesCnt = 20;
+
+ //create SequenceOutputStream
+ Object oSequenceOutputStream = m_xMSF.createInstance (
+ "com.sun.star.io.SequenceOutputStream" );
+ XSequenceOutputStream xSeqOutStream =
+ UnoRuntime.queryInterface (
+ XSequenceOutputStream.class, oSequenceOutputStream );
+ m_aTestHelper.Message ( "SequenceOutputStream created." );
+
+ //write something to the stream
+ byte pBytesOriginal[] = new byte [nBytesCnt];
+ Random oRandom = new Random();
+ oRandom.nextBytes (pBytesOriginal);
+ xSeqOutStream.writeBytes (pBytesOriginal);
+ byte pBytesWritten[] = xSeqOutStream.getWrittenBytes ();
+ m_aTestHelper.Message ( "SeuenceOutputStream filled." );
+
+ //create SequenceInputstream
+ Object pArgs[] = new Object[1];
+ pArgs[0] = pBytesWritten;
+ Object oSequenceInputStream = m_xMSF.createInstanceWithArguments (
+ "com.sun.star.io.SequenceInputStream", pArgs );
+ XSeekableInputStream xSeekableInStream =
+ UnoRuntime.queryInterface (
+ XSeekableInputStream.class, oSequenceInputStream );
+ m_aTestHelper.Message ( "SequenceInputStream created." );
+
+ //read from the stream
+ byte pBytesRead[][] = new byte [1][nBytesCnt];
+ xSeekableInStream.readBytes ( pBytesRead, pBytesRead[0].length + 1 );
+ m_aTestHelper.Message ( "Read from SequenceInputStream." );
+
+ //close the streams
+ xSeqOutStream.closeOutput ();
+ xSeekableInStream.closeInput ();
+ m_aTestHelper.Message ( "Both streams closed." );
+
+ //compare the original, written and read arrys
+ for ( int i = 0; i < nBytesCnt; ++i ) {
+ if ( pBytesOriginal[i] != pBytesWritten[i] ) {
+ m_aTestHelper.Error ( "Written array not identical to " +
+ "original array. Position: " + i );
+ return /* false */;
+ } else if ( pBytesOriginal[i] != pBytesRead[0][i] ) {
+ m_aTestHelper.Error ( "Read array not identical to original " +
+ "array. Position: " + i );
+ return /* false */;
+ }
+ }
+ m_aTestHelper.Message ( "All data correct." );
+ } catch ( Exception e ) {
+ m_aTestHelper.Error ( "Exception: " + e );
+ return /* false */;
+ }
+ return /* true */;
+ }
+
+ 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();
} \ No newline at end of file
diff --git a/comphelper/qa/complex/comphelper/Test01.java b/comphelper/qa/complex/comphelper/Test01.java
deleted file mode 100644
index 6900b738aeba..000000000000
--- a/comphelper/qa/complex/comphelper/Test01.java
+++ /dev/null
@@ -1,107 +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.comphelper;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.io.XSequenceOutputStream;
-import com.sun.star.io.XSeekableInputStream;
-import com.sun.star.uno.UnoRuntime;
-
-import java.util.Random;
-import share.LogWriter;
-
-public class Test01 {
- XMultiServiceFactory m_xMSF = null;
- TestHelper m_aTestHelper = null;
-
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
- {
- m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
- }
-
-
- public boolean test () {
- try {
- final int nBytesCnt = 20;
-
- //create SequenceOutputStream
- Object oSequenceOutputStream = m_xMSF.createInstance (
- "com.sun.star.io.SequenceOutputStream" );
- XSequenceOutputStream xSeqOutStream =
- (XSequenceOutputStream) UnoRuntime.queryInterface (
- XSequenceOutputStream.class, oSequenceOutputStream );
- m_aTestHelper.Message ( "SequenceOutputStream created." );
-
- //write something to the stream
- byte pBytesOriginal[] = new byte [nBytesCnt];
- Random oRandom = new Random();
- oRandom.nextBytes (pBytesOriginal);
- xSeqOutStream.writeBytes (pBytesOriginal);
- byte pBytesWritten[] = xSeqOutStream.getWrittenBytes ();
- m_aTestHelper.Message ( "SeuenceOutputStream filled." );
-
- //create SequenceInputstream
- Object pArgs[] = new Object[1];
- pArgs[0] = pBytesWritten;
- Object oSequenceInputStream = m_xMSF.createInstanceWithArguments (
- "com.sun.star.io.SequenceInputStream", pArgs );
- XSeekableInputStream xSeekableInStream =
- (XSeekableInputStream)UnoRuntime.queryInterface (
- XSeekableInputStream.class, oSequenceInputStream );
- m_aTestHelper.Message ( "SequenceInputStream created." );
-
- //read from the stream
- byte pBytesRead[][] = new byte [1][nBytesCnt];
- xSeekableInStream.readBytes ( pBytesRead, pBytesRead[0].length + 1 );
- m_aTestHelper.Message ( "Read from SequenceInputStream." );
-
- //close the streams
- xSeqOutStream.closeOutput ();
- xSeekableInStream.closeInput ();
- m_aTestHelper.Message ( "Both streams closed." );
-
- //compare the original, written and read arrys
- for ( int i = 0; i < nBytesCnt; ++i ) {
- if ( pBytesOriginal[i] != pBytesWritten[i] ) {
- m_aTestHelper.Error ( "Written array not identical to " +
- "original array. Position: " + i );
- return false;
- } else if ( pBytesOriginal[i] != pBytesRead[0][i] ) {
- m_aTestHelper.Error ( "Read array not identical to original " +
- "array. Position: " + i );
- return false;
- }
- }
- m_aTestHelper.Message ( "All data correct." );
- } catch ( Exception e ) {
- m_aTestHelper.Error ( "Exception: " + e );
- return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/comphelper/qa/complex/comphelper/TestHelper.java b/comphelper/qa/complex/comphelper/TestHelper.java
deleted file mode 100644
index 0a6989e95271..000000000000
--- a/comphelper/qa/complex/comphelper/TestHelper.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package complex.comphelper;
-
-import share.LogWriter;
-
-public class TestHelper {
- LogWriter m_aLogWriter;
- String m_sTestPrefix;
-
- /** Creates a new instance of TestHelper */
- public TestHelper ( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
- m_sTestPrefix = sTestPrefix;
- }
-
- public void Error ( String sError ) {
- m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError );
- }
-
- public void Message ( String sMessage ) {
- m_aLogWriter.println ( m_sTestPrefix + sMessage );
- }
-}
-
diff --git a/comphelper/qa/complex/makefile.mk b/comphelper/qa/complex/makefile.mk
deleted file mode 100644
index 2ddba50b4d81..000000000000
--- a/comphelper/qa/complex/makefile.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-TARGET = ComphelperComplexTests
-PRJNAME = comphelper
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-#----- compile .java files -----------------------------------------
-
-JARFILES := ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES := $(shell @$(FIND) . -name "*.java")
-JAVACLASSFILES := $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(i:d)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Runner Settings ----------------------------------------------
-
-# classpath and argument list
-RUNNER_CLASSPATH = -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-RUNNER_APPEXECCOMMAND =
-.ELSE
-RUNNER_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-
-RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex $(RUNNER_APPEXECCOMMAND)
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(depend)" == ""
-ALL : ALLTAR
- @echo -----------------------------------------------------
- @echo - do a 'dmake show_targets' to show available targets
- @echo -----------------------------------------------------
-.ELSE
-ALL: ALLDEP
-.ENDIF
-
-.INCLUDE : target.mk
-
-show_targets:
- +@java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s#.java##:s#./#complex.#))
-
-run:
- +java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce comphelper_all.sce
-
-run_%:
- +java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o complex.$(PRJNAME).$(@:s/run_//)
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index ab0af3e53e8f..10727897b5a3 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -25,11 +25,11 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include "comphelper_module.hxx"
#include "comphelper/anytostring.hxx"
+#include "comphelper/anycompare.hxx"
#include "comphelper/componentbase.hxx"
#include "comphelper/componentcontext.hxx"
#include "comphelper/extract.hxx"
@@ -48,9 +48,7 @@
#include <rtl/ustrbuf.hxx>
#include <typelib/typedescription.hxx>
-#include <functional>
#include <map>
-#include <memory>
#include <boost/shared_ptr.hpp>
//........................................................................
@@ -80,26 +78,14 @@ namespace comphelper
using ::com::sun::star::beans::Pair;
using ::com::sun::star::uno::TypeClass;
using ::com::sun::star::uno::TypeClass_VOID;
- using ::com::sun::star::uno::TypeClass_CHAR;
- using ::com::sun::star::uno::TypeClass_BOOLEAN;
- using ::com::sun::star::uno::TypeClass_BYTE;
- using ::com::sun::star::uno::TypeClass_SHORT;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT;
- using ::com::sun::star::uno::TypeClass_LONG;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_LONG;
- using ::com::sun::star::uno::TypeClass_HYPER;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER;
- using ::com::sun::star::uno::TypeClass_FLOAT;
- using ::com::sun::star::uno::TypeClass_DOUBLE;
- using ::com::sun::star::uno::TypeClass_STRING;
- using ::com::sun::star::uno::TypeClass_TYPE;
- using ::com::sun::star::uno::TypeClass_ENUM;
- using ::com::sun::star::uno::TypeClass_INTERFACE;
using ::com::sun::star::uno::TypeClass_UNKNOWN;
using ::com::sun::star::uno::TypeClass_ANY;
using ::com::sun::star::uno::TypeClass_EXCEPTION;
using ::com::sun::star::uno::TypeClass_STRUCT;
using ::com::sun::star::uno::TypeClass_UNION;
+ using ::com::sun::star::uno::TypeClass_FLOAT;
+ using ::com::sun::star::uno::TypeClass_DOUBLE;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
using ::com::sun::star::lang::XServiceInfo;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::container::XEnumeration;
@@ -109,136 +95,6 @@ namespace comphelper
/** === end UNO using === **/
//====================================================================
- //= IKeyPredicateLess
- //====================================================================
- class SAL_NO_VTABLE IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const = 0;
- virtual ~IKeyPredicateLess() {}
- };
-
- //====================================================================
- //= LessPredicateAdapter
- //====================================================================
- struct LessPredicateAdapter : public ::std::binary_function< Any, Any, bool >
- {
- LessPredicateAdapter( const IKeyPredicateLess& _predicate )
- :m_predicate( _predicate )
- {
- }
-
- bool operator()( const Any& _lhs, const Any& _rhs ) const
- {
- return m_predicate.isLess( _lhs, _rhs );
- }
-
- private:
- const IKeyPredicateLess& m_predicate;
-
- private:
- LessPredicateAdapter(); // never implemented
- };
-
- //====================================================================
- //= ScalarPredicateLess
- //====================================================================
- template< typename SCALAR >
- class ScalarPredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- SCALAR lhs(0), rhs(0);
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
- };
-
- //====================================================================
- //= StringPredicateLess
- //====================================================================
- class StringPredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- ::rtl::OUString lhs, rhs;
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
- };
-
- //====================================================================
- //= TypePredicateLess
- //====================================================================
- class TypePredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- Type lhs, rhs;
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs.getTypeName() < rhs.getTypeName();
- }
- };
-
- //====================================================================
- //= EnumPredicateLess
- //====================================================================
- class EnumPredicateLess : public IKeyPredicateLess
- {
- public:
- EnumPredicateLess( const Type& _enumType )
- :m_enumType( _enumType )
- {
- }
-
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- sal_Int32 lhs(0), rhs(0);
- if ( !::cppu::enum2int( lhs, _lhs )
- || !::cppu::enum2int( rhs, _rhs )
- || !_lhs.getValueType().equals( m_enumType )
- || !_rhs.getValueType().equals( m_enumType )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
-
- private:
- const Type m_enumType;
- };
-
- //====================================================================
- //= InterfacePredicateLess
- //====================================================================
- class InterfacePredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- if ( ( _lhs.getValueTypeClass() != TypeClass_INTERFACE )
- || ( _rhs.getValueTypeClass() != TypeClass_INTERFACE )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
-
- Reference< XInterface > lhs( _lhs, UNO_QUERY );
- Reference< XInterface > rhs( _rhs, UNO_QUERY );
- return lhs.get() < rhs.get();
- }
- };
-
- //====================================================================
//= MapData
//====================================================================
class IMapModificationListener;
@@ -550,58 +406,9 @@ namespace comphelper
throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported value type." ) ), *this );
// create the comparator for the KeyType, and throw if the type is not supported
- TypeClass eKeyTypeClass = aKeyType.getTypeClass();
- ::std::auto_ptr< IKeyPredicateLess > pComparator;
- switch ( eKeyTypeClass )
- {
- case TypeClass_CHAR:
- pComparator.reset( new ScalarPredicateLess< sal_Unicode >() );
- break;
- case TypeClass_BOOLEAN:
- pComparator.reset( new ScalarPredicateLess< sal_Bool >() );
- break;
- case TypeClass_BYTE:
- pComparator.reset( new ScalarPredicateLess< sal_Int8 >() );
- break;
- case TypeClass_SHORT:
- pComparator.reset( new ScalarPredicateLess< sal_Int16 >() );
- break;
- case TypeClass_UNSIGNED_SHORT:
- pComparator.reset( new ScalarPredicateLess< sal_uInt16 >() );
- break;
- case TypeClass_LONG:
- pComparator.reset( new ScalarPredicateLess< sal_Int32 >() );
- break;
- case TypeClass_UNSIGNED_LONG:
- pComparator.reset( new ScalarPredicateLess< sal_uInt32 >() );
- break;
- case TypeClass_HYPER:
- pComparator.reset( new ScalarPredicateLess< sal_Int64 >() );
- break;
- case TypeClass_UNSIGNED_HYPER:
- pComparator.reset( new ScalarPredicateLess< sal_uInt64 >() );
- break;
- case TypeClass_FLOAT:
- pComparator.reset( new ScalarPredicateLess< float >() );
- break;
- case TypeClass_DOUBLE:
- pComparator.reset( new ScalarPredicateLess< double >() );
- break;
- case TypeClass_STRING:
- pComparator.reset( new StringPredicateLess() );
- break;
- case TypeClass_TYPE:
- pComparator.reset( new TypePredicateLess() );
- break;
- case TypeClass_ENUM:
- pComparator.reset( new EnumPredicateLess( aKeyType ) );
- break;
- case TypeClass_INTERFACE:
- pComparator.reset( new InterfacePredicateLess() );
- break;
- default:
+ ::std::auto_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) );
+ if ( !pComparator.get() )
throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), *this );
- }
// init members
m_aData.m_aKeyType = aKeyType;
diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx
new file mode 100755
index 000000000000..a86174daf08e
--- /dev/null
+++ b/comphelper/source/misc/anycompare.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ * DO NOT ALTER 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_comphelper.hxx"
+
+#include "comphelper/anycompare.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::uno::TypeClass_CHAR;
+ using ::com::sun::star::uno::TypeClass_BOOLEAN;
+ using ::com::sun::star::uno::TypeClass_BYTE;
+ using ::com::sun::star::uno::TypeClass_SHORT;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT;
+ using ::com::sun::star::uno::TypeClass_LONG;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_LONG;
+ using ::com::sun::star::uno::TypeClass_HYPER;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER;
+ using ::com::sun::star::uno::TypeClass_FLOAT;
+ using ::com::sun::star::uno::TypeClass_DOUBLE;
+ using ::com::sun::star::uno::TypeClass_STRING;
+ using ::com::sun::star::uno::TypeClass_TYPE;
+ using ::com::sun::star::uno::TypeClass_ENUM;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
+ using ::com::sun::star::i18n::XCollator;
+ /** === end UNO using === **/
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::std::auto_ptr< IKeyPredicateLess > getStandardLessPredicate( Type const & i_type, Reference< XCollator > const & i_collator )
+ {
+ ::std::auto_ptr< IKeyPredicateLess > pComparator;
+ switch ( i_type.getTypeClass() )
+ {
+ case TypeClass_CHAR:
+ pComparator.reset( new ScalarPredicateLess< sal_Unicode >() );
+ break;
+ case TypeClass_BOOLEAN:
+ pComparator.reset( new ScalarPredicateLess< sal_Bool >() );
+ break;
+ case TypeClass_BYTE:
+ pComparator.reset( new ScalarPredicateLess< sal_Int8 >() );
+ break;
+ case TypeClass_SHORT:
+ pComparator.reset( new ScalarPredicateLess< sal_Int16 >() );
+ break;
+ case TypeClass_UNSIGNED_SHORT:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt16 >() );
+ break;
+ case TypeClass_LONG:
+ pComparator.reset( new ScalarPredicateLess< sal_Int32 >() );
+ break;
+ case TypeClass_UNSIGNED_LONG:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt32 >() );
+ break;
+ case TypeClass_HYPER:
+ pComparator.reset( new ScalarPredicateLess< sal_Int64 >() );
+ break;
+ case TypeClass_UNSIGNED_HYPER:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt64 >() );
+ break;
+ case TypeClass_FLOAT:
+ pComparator.reset( new ScalarPredicateLess< float >() );
+ break;
+ case TypeClass_DOUBLE:
+ pComparator.reset( new ScalarPredicateLess< double >() );
+ break;
+ case TypeClass_STRING:
+ if ( i_collator.is() )
+ pComparator.reset( new StringCollationPredicateLess( i_collator ) );
+ else
+ pComparator.reset( new StringPredicateLess() );
+ break;
+ case TypeClass_TYPE:
+ pComparator.reset( new TypePredicateLess() );
+ break;
+ case TypeClass_ENUM:
+ pComparator.reset( new EnumPredicateLess( i_type ) );
+ break;
+ case TypeClass_INTERFACE:
+ pComparator.reset( new InterfacePredicateLess() );
+ break;
+ default:
+ break;
+ }
+ return pComparator;
+ }
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index 3e52a5875b7a..c42308c71508 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -136,64 +136,6 @@ namespace comphelper
}
//--------------------------------------------------------------------------
- sal_Bool OModule::writeComponentInfos( void* pServiceManager, void* pRegistryKey )
- {
- Reference< XMultiServiceFactory > xFactory( static_cast< XMultiServiceFactory* >( pServiceManager ) );
- Reference< XRegistryKey > xRegistryKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- return writeComponentInfos( xFactory, xRegistryKey );
- }
-
- //--------------------------------------------------------------------------
- sal_Bool OModule::writeComponentInfos(
- const Reference< XMultiServiceFactory >& /*_rxServiceManager*/,
- const Reference< XRegistryKey >& _rxRootKey )
- {
- OSL_ENSURE( _rxRootKey.is(), "OModule::writeComponentInfos: invalid argument!" );
-
- ::rtl::OUString sRootKey( "/", 1, RTL_TEXTENCODING_ASCII_US );
-
- for ( ComponentDescriptions::const_iterator component = m_pImpl->m_aRegisteredComponents.begin();
- component != m_pImpl->m_aRegisteredComponents.end();
- ++component
- )
- {
- ::rtl::OUString sMainKeyName( sRootKey );
- sMainKeyName += component->sImplementationName;
- sMainKeyName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
-
- try
- {
- Reference< XRegistryKey > xNewKey( _rxRootKey->createKey( sMainKeyName ) );
-
- const ::rtl::OUString* pService = component->aSupportedServices.getConstArray();
- const ::rtl::OUString* pServiceEnd = component->aSupportedServices.getConstArray() + component->aSupportedServices.getLength();
- for ( ; pService != pServiceEnd; ++pService )
- xNewKey->createKey( *pService );
-
- if ( component->sSingletonName.getLength() )
- {
- OSL_ENSURE( component->aSupportedServices.getLength() == 1, "OModule::writeComponentInfos: singletons should support exactly one service, shouldn't they?" );
-
- ::rtl::OUString sSingletonKeyName( sRootKey );
- sSingletonKeyName += component->sImplementationName;
- sSingletonKeyName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SINGLETONS/"));
- sSingletonKeyName += component->sSingletonName;
-
- xNewKey = _rxRootKey->createKey( sSingletonKeyName );
- xNewKey->setStringValue( component->aSupportedServices[ 0 ] );
- }
- }
- catch( Exception& )
- {
- OSL_FAIL( "OModule::writeComponentInfos: something went wrong while creating the keys!" );
- return sal_False;
- }
- }
-
- return sal_True;
- }
-
- //--------------------------------------------------------------------------
void* OModule::getComponentFactory( const sal_Char* _pImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
{
Reference< XInterface > xFactory( getComponentFactory(
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index ccc680729482..36cb3cd15aff 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -85,16 +85,9 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
{
uno::Sequence< beans::PropertyValue > aResult;
- uno::Sequence< sal_Int8 > aSalt( 16 );
+ uno::Sequence< sal_Int8 > aSalt = GenerateRandomByteSequence( 16 );
sal_Int32 nCount = 1024;
- TimeValue aTime;
- osl_getSystemTime( &aTime );
- rtlRandomPool aRandomPool = rtl_random_createPool ();
- rtl_random_addBytes ( aRandomPool, &aTime, 8 );
-
- rtl_random_getBytes ( aRandomPool, aSalt.getArray(), 16 );
-
uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, 16 );
if ( aNewHash.getLength() )
{
@@ -109,9 +102,6 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
aResult[3].Value <<= aNewHash;
}
- // Clean up random pool memory
- rtl_random_destroyPool ( aRandomPool );
-
return aResult;
}
@@ -283,9 +273,98 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
}
// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateRandomByteSequence( sal_Int32 nLength )
+{
+ uno::Sequence< sal_Int8 > aResult( nLength );
+
+ TimeValue aTime;
+ osl_getSystemTime( &aTime );
+ rtlRandomPool aRandomPool = rtl_random_createPool ();
+ rtl_random_addBytes ( aRandomPool, &aTime, 8 );
+ rtl_random_getBytes ( aRandomPool, aResult.getArray(), nLength );
+ rtl_random_destroyPool ( aRandomPool );
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+ return aResult;
+}
+
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( aPassword.getLength() && aDocId.getLength() == 16 )
+ {
+ sal_uInt16 pPassData[16];
+ rtl_zeroMemory( pPassData, sizeof(pPassData) );
+
+ sal_Int32 nPassLen = ::std::min< sal_Int32 >( aPassword.getLength(), 15 );
+ rtl_copyMemory( pPassData, aPassword.getStr(), nPassLen * sizeof(pPassData[0]) );
+
+ aResultKey = GenerateStd97Key( pPassData, aDocId );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const sal_uInt16 pPassData[16], const uno::Sequence< sal_Int8 >& aDocId )
+{
+ uno::Sequence< sal_Int8 > aResultKey;
+ if ( pPassData[0] && aDocId.getLength() == 16 )
+ {
+ sal_uInt8 pKeyData[64];
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+
+ sal_Int32 nInd = 0;
+
+ // Fill PassData into KeyData.
+ for ( nInd = 0; nInd < 16 && pPassData[nInd]; nInd++)
+ {
+ pKeyData[2*nInd] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 0) & 0xff );
+ pKeyData[2*nInd + 1] = sal::static_int_cast< sal_uInt8 >( (pPassData[nInd] >> 8) & 0xff );
+ }
+
+ pKeyData[2*nInd] = 0x80;
+ pKeyData[56] = sal::static_int_cast< sal_uInt8 >( nInd << 4 );
+
+ // Fill raw digest of KeyData into KeyData.
+ rtlDigest hDigest = rtl_digest_create ( rtl_Digest_AlgorithmMD5 );
+ (void)rtl_digest_updateMD5 (
+ hDigest, pKeyData, sizeof(pKeyData));
+ (void)rtl_digest_rawMD5 (
+ hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
+
+ // Update digest with KeyData and Unique.
+ for ( nInd = 0; nInd < 16; nInd++ )
+ {
+ rtl_digest_updateMD5( hDigest, pKeyData, 5 );
+ rtl_digest_updateMD5( hDigest, (const sal_uInt8*)aDocId.getConstArray(), aDocId.getLength() );
+ }
+
+ // Update digest with padding.
+ pKeyData[16] = 0x80;
+ rtl_zeroMemory( pKeyData + 17, sizeof(pKeyData) - 17 );
+ pKeyData[56] = 0x80;
+ pKeyData[57] = 0x0a;
+
+ rtl_digest_updateMD5( hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16 );
+
+ // Fill raw digest of above updates
+ aResultKey.realloc( RTL_DIGEST_LENGTH_MD5 );
+ rtl_digest_rawMD5 ( hDigest, (sal_uInt8*)aResultKey.getArray(), aResultKey.getLength() );
+
+ // Erase KeyData array and leave.
+ rtl_zeroMemory( pKeyData, sizeof(pKeyData) );
+ }
+
+ return aResultKey;
+}
+
+// ============================================================================
+
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rMediaEncData,
const OUString& rMediaPassword,
const Reference< XInteractionHandler >& rxInteractHandler,
const OUString& rDocumentName,
@@ -293,7 +372,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
const ::std::vector< OUString >* pDefaultPasswords,
bool* pbIsDefaultPassword )
{
- OUString aPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aEncData;
DocPasswordVerifierResult eResult = DocPasswordVerifierResult_WRONG_PASSWORD;
// first, try provided default passwords
@@ -303,23 +382,32 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
{
- aPassword = *aIt;
- OSL_ENSURE( aPassword.getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
- if( aPassword.getLength() > 0 )
+ OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
+ if( aIt->getLength() > 0 )
{
- eResult = rVerifier.verifyPassword( aPassword );
+ eResult = rVerifier.verifyPassword( *aIt, aEncData );
if( pbIsDefaultPassword )
*pbIsDefaultPassword = eResult == DocPasswordVerifierResult_OK;
}
}
}
+ // try media encryption data (skip, if result is OK or ABORT)
+ if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
+ {
+ if( rMediaEncData.getLength() > 0 )
+ {
+ eResult = rVerifier.verifyEncryptionData( rMediaEncData );
+ if( eResult == DocPasswordVerifierResult_OK )
+ aEncData = rMediaEncData;
+ }
+ }
+
// try media password (skip, if result is OK or ABORT)
if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
{
- aPassword = rMediaPassword;
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( rMediaPassword.getLength() > 0 )
+ eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
}
// request a password (skip, if result is OK or ABORT)
@@ -333,9 +421,8 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
rxInteractHandler->handle( xRequest );
if( pRequest->isPassword() )
{
- aPassword = pRequest->getPassword();
- if( aPassword.getLength() > 0 )
- eResult = rVerifier.verifyPassword( aPassword );
+ if( pRequest->getPassword().getLength() > 0 )
+ eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
}
else
{
@@ -348,15 +435,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
}
- return (eResult == DocPasswordVerifierResult_OK) ? aPassword : OUString();
+ return (eResult == DocPasswordVerifierResult_OK) ? aEncData : uno::Sequence< beans::NamedValue >();
}
-/*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword(
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > DocPasswordHelper::requestAndVerifyDocPassword(
IDocPasswordVerifier& rVerifier,
MediaDescriptor& rMediaDesc,
DocPasswordRequestType eRequestType,
const ::std::vector< OUString >* pDefaultPasswords )
{
+ uno::Sequence< beans::NamedValue > aMediaEncData = rMediaDesc.getUnpackedValueOrDefault(
+ MediaDescriptor::PROP_ENCRYPTIONDATA(), uno::Sequence< beans::NamedValue >() );
OUString aMediaPassword = rMediaDesc.getUnpackedValueOrDefault(
MediaDescriptor::PROP_PASSWORD(), OUString() );
Reference< XInteractionHandler > xInteractHandler = rMediaDesc.getUnpackedValueOrDefault(
@@ -365,14 +454,17 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
MediaDescriptor::PROP_URL(), OUString() );
bool bIsDefaultPassword = false;
- OUString aPassword = requestAndVerifyDocPassword(
- rVerifier, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+ uno::Sequence< beans::NamedValue > aEncryptionData = requestAndVerifyDocPassword(
+ rVerifier, aMediaEncData, aMediaPassword, xInteractHandler, aDocumentName, eRequestType, pDefaultPasswords, &bIsDefaultPassword );
+
+ rMediaDesc.erase( MediaDescriptor::PROP_PASSWORD() );
+ rMediaDesc.erase( MediaDescriptor::PROP_ENCRYPTIONDATA() );
// insert valid password into media descriptor (but not a default password)
- if( (aPassword.getLength() > 0) && !bIsDefaultPassword )
- rMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= aPassword;
+ if( (aEncryptionData.getLength() > 0) && !bIsDefaultPassword )
+ rMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] <<= aEncryptionData;
- return aPassword;
+ return aEncryptionData;
}
// ============================================================================
diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx
index a4381a3d89c7..ec9cf0ca21ed 100644..100755
--- a/comphelper/source/misc/docpasswordrequest.cxx
+++ b/comphelper/source/misc/docpasswordrequest.cxx
@@ -32,6 +32,7 @@
#include "comphelper/docpasswordrequest.hxx"
#include <com/sun/star/task/DocumentMSPasswordRequest2.hpp>
#include <com/sun/star/task/DocumentPasswordRequest2.hpp>
+#include <com/sun/star/task/PasswordRequest.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionPassword2.hpp>
@@ -45,6 +46,7 @@ using ::com::sun::star::uno::XInterface;
using ::com::sun::star::task::InteractionClassification_QUERY;
using ::com::sun::star::task::DocumentMSPasswordRequest2;
using ::com::sun::star::task::DocumentPasswordRequest2;
+using ::com::sun::star::task::PasswordRequest;
using ::com::sun::star::task::PasswordRequestMode;
using ::com::sun::star::task::XInteractionAbort;
using ::com::sun::star::task::XInteractionContinuation;
@@ -99,11 +101,74 @@ private:
// ============================================================================
+SimplePasswordRequest::SimplePasswordRequest( PasswordRequestMode eMode )
+: mpAbort( NULL )
+, mpPassword( NULL )
+{
+ PasswordRequest aRequest( OUString(), Reference< XInterface >(),
+ InteractionClassification_QUERY, eMode );
+ maRequest <<= aRequest;
+
+ maContinuations.realloc( 2 );
+ maContinuations[ 0 ].set( mpAbort = new AbortContinuation );
+ maContinuations[ 1 ].set( mpPassword = new PasswordContinuation );
+}
+
+SimplePasswordRequest::~SimplePasswordRequest()
+{
+}
+
+/*uno::*/Any SAL_CALL SimplePasswordRequest::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException)
+{
+ return ::cppu::queryInterface ( rType,
+ // OWeakObject interfaces
+ dynamic_cast< XInterface* > ( (XInteractionRequest *) this ),
+ static_cast< XWeak* > ( this ),
+ // my own interfaces
+ static_cast< XInteractionRequest* > ( this ) );
+}
+
+void SAL_CALL SimplePasswordRequest::acquire( ) throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL SimplePasswordRequest::release( ) throw ()
+{
+ OWeakObject::release();
+}
+
+sal_Bool SimplePasswordRequest::isAbort() const
+{
+ return mpAbort->isSelected();
+}
+
+sal_Bool SimplePasswordRequest::isPassword() const
+{
+ return mpPassword->isSelected();
+}
+
+OUString SimplePasswordRequest::getPassword() const
+{
+ return mpPassword->getPassword();
+}
+
+Any SAL_CALL SimplePasswordRequest::getRequest() throw( RuntimeException )
+{
+ return maRequest;
+}
+
+Sequence< Reference< XInteractionContinuation > > SAL_CALL SimplePasswordRequest::getContinuations() throw( RuntimeException )
+{
+ return maContinuations;
+}
+
+// ============================================================================
+
DocPasswordRequest::DocPasswordRequest( DocPasswordRequestType eType,
PasswordRequestMode eMode, const OUString& rDocumentName, sal_Bool bPasswordToModify )
: mpAbort( NULL )
, mpPassword( NULL )
-, mbPasswordToModify( bPasswordToModify )
{
switch( eType )
{
diff --git a/comphelper/source/misc/makefile.mk b/comphelper/source/misc/makefile.mk
deleted file mode 100644
index cecba554b332..000000000000
--- a/comphelper/source/misc/makefile.mk
+++ /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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=comphelper
-TARGET=misc
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/accessiblecomponenthelper.obj \
- $(SLO)$/accessiblecontexthelper.obj \
- $(SLO)$/accessibleeventbuffer.obj \
- $(SLO)$/accessibleeventnotifier.obj \
- $(SLO)$/accessiblekeybindinghelper.obj \
- $(SLO)$/accessibleselectionhelper.obj \
- $(SLO)$/accessibletexthelper.obj \
- $(SLO)$/accessiblewrapper.obj \
- $(SLO)$/accimplaccess.obj \
- $(SLO)$/anytostring.obj \
- $(SLO)$/asyncnotification.obj \
- $(SLO)$/componentcontext.obj \
- $(SLO)$/componentmodule.obj \
- $(SLO)$/configurationhelper.obj \
- $(SLO)$/docpasswordhelper.obj \
- $(SLO)$/docpasswordrequest.obj \
- $(SLO)$/documentinfo.obj \
- $(SLO)$/evtmethodhelper.obj \
- $(SLO)$/documentiologring.obj \
- $(SLO)$/evtlistenerhlp.obj \
- $(SLO)$/ihwrapnofilter.obj \
- $(SLO)$/instancelocker.obj \
- $(SLO)$/interaction.obj \
- $(SLO)$/legacysingletonfactory.obj \
- $(SLO)$/listenernotification.obj \
- $(SLO)$/locale.obj \
- $(SLO)$/logging.obj \
- $(SLO)$/mediadescriptor.obj \
- $(SLO)$/mimeconfighelper.obj \
- $(SLO)$/namedvaluecollection.obj \
- $(SLO)$/numberedcollection.obj \
- $(SLO)$/numbers.obj \
- $(SLO)$/officeresourcebundle.obj \
- $(SLO)$/officerestartmanager.obj \
- $(SLO)$/proxyaggregation.obj \
- $(SLO)$/querydeep.obj \
- $(SLO)$/regpathhelper.obj \
- $(SLO)$/scopeguard.obj \
- $(SLO)$/SelectionMultiplex.obj \
- $(SLO)$/sequenceashashmap.obj \
- $(SLO)$/sequence.obj \
- $(SLO)$/servicedecl.obj \
- $(SLO)$/serviceinfohelper.obj \
- $(SLO)$/sharedmutex.obj \
- $(SLO)$/synchronousdispatch.obj \
- $(SLO)$/storagehelper.obj \
- $(SLO)$/string.obj \
- $(SLO)$/types.obj \
- $(SLO)$/uieventslogger.obj \
- $(SLO)$/weakeventlistener.obj \
- $(SLO)$/weak.obj \
- $(SLO)$/comphelper_module.obj \
- $(SLO)$/comphelper_services.obj \
- $(SLO)$/componentbase.obj \
- $(SLO)$/stillreadwriteinteraction.obj \
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index f8b8ba7fde35..7bf1eaea266d 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/stillreadwriteinteraction.hxx>
#include <com/sun/star/ucb/XContent.hpp>
@@ -110,6 +111,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTSERVICE()
return sProp;
}
+const ::rtl::OUString& MediaDescriptor::PROP_ENCRYPTIONDATA()
+{
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("EncryptionData"));
+ return sProp;
+}
+
const ::rtl::OUString& MediaDescriptor::PROP_EXTENSION()
{
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Extension"));
@@ -463,27 +470,30 @@ sal_Bool MediaDescriptor::isStreamReadOnly() const
css::uno::Any MediaDescriptor::getComponentDataEntry( const ::rtl::OUString& rName ) const
{
- SequenceAsHashMap aCompDataMap( getUnpackedValueOrDefault( PROP_COMPONENTDATA(), ComponentDataSequence() ) );
- SequenceAsHashMap::iterator aIt = aCompDataMap.find( rName );
- return (aIt == aCompDataMap.end()) ? css::uno::Any() : aIt->second;
+ css::uno::Any aEntry;
+ SequenceAsHashMap::const_iterator aPropertyIter = find( PROP_COMPONENTDATA() );
+ if( aPropertyIter != end() )
+ return NamedValueCollection( aPropertyIter->second ).get( rName );
+ return css::uno::Any();
}
void MediaDescriptor::setComponentDataEntry( const ::rtl::OUString& rName, const css::uno::Any& rValue )
{
if( rValue.hasValue() )
{
- // get or craete the 'ComponentData' property entry
+ // get or create the 'ComponentData' property entry
css::uno::Any& rCompDataAny = operator[]( PROP_COMPONENTDATA() );
- // check type, insert the value
- OSL_ENSURE( !rCompDataAny.hasValue() || rCompDataAny.has< ComponentDataSequence >(),
- "MediaDescriptor::setComponentDataEntry - incompatible 'ComponentData' property in media descriptor" );
- if( !rCompDataAny.hasValue() || rCompDataAny.has< ComponentDataSequence >() )
+ // insert the value (retain sequence type, create NamedValue elements by default)
+ bool bHasNamedValues = !rCompDataAny.hasValue() || rCompDataAny.has< css::uno::Sequence< css::beans::NamedValue > >();
+ bool bHasPropValues = rCompDataAny.has< css::uno::Sequence< css::beans::PropertyValue > >();
+ OSL_ENSURE( bHasNamedValues || bHasPropValues, "MediaDescriptor::setComponentDataEntry - incompatible 'ComponentData' property in media descriptor" );
+ if( bHasNamedValues || bHasPropValues )
{
// insert or overwrite the passed value
SequenceAsHashMap aCompDataMap( rCompDataAny );
aCompDataMap[ rName ] = rValue;
- // write back the sequence (sal_False = use NamedValue instead of PropertyValue)
- rCompDataAny = aCompDataMap.getAsConstAny( sal_False );
+ // write back the sequence (restore sequence with correct element type)
+ rCompDataAny = aCompDataMap.getAsConstAny( bHasPropValues );
}
}
else
@@ -498,18 +508,20 @@ void MediaDescriptor::clearComponentDataEntry( const ::rtl::OUString& rName )
SequenceAsHashMap::iterator aPropertyIter = find( PROP_COMPONENTDATA() );
if( aPropertyIter != end() )
{
- OSL_ENSURE( aPropertyIter->second.has< ComponentDataSequence >(),
- "MediaDescriptor::clearComponentDataEntry - incompatible 'ComponentData' property in media descriptor" );
- if( aPropertyIter->second.has< ComponentDataSequence >() )
+ css::uno::Any& rCompDataAny = aPropertyIter->second;
+ bool bHasNamedValues = rCompDataAny.has< css::uno::Sequence< css::beans::NamedValue > >();
+ bool bHasPropValues = rCompDataAny.has< css::uno::Sequence< css::beans::PropertyValue > >();
+ OSL_ENSURE( bHasNamedValues || bHasPropValues, "MediaDescriptor::clearComponentDataEntry - incompatible 'ComponentData' property in media descriptor" );
+ if( bHasNamedValues || bHasPropValues )
{
// remove the value with the passed name
- SequenceAsHashMap aCompDataMap( aPropertyIter->second );
+ SequenceAsHashMap aCompDataMap( rCompDataAny );
aCompDataMap.erase( rName );
// write back the sequence, or remove it completely if it is empty
if( aCompDataMap.empty() )
erase( aPropertyIter );
else
- aPropertyIter->second = aCompDataMap.getAsConstAny( sal_False );
+ rCompDataAny = aCompDataMap.getAsConstAny( bHasPropValues );
}
}
}
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index 3b5e3c9ef652..fb6936ea6d1f 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -36,6 +36,7 @@
#include <comphelper/mimeconfighelper.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/documentconstants.hxx>
using namespace ::com::sun::star;
@@ -188,6 +189,46 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetMediaTypeCo
return m_xMediaTypeConfig;
}
+
+//-----------------------------------------------------------------------
+uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetFilterFactory()
+{
+ osl::MutexGuard aGuard( m_aMutex );
+
+ if ( !m_xFilterFactory.is() )
+ m_xFilterFactory.set(
+ m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.FilterFactory" ) ),
+ uno::UNO_QUERY );
+
+ return m_xFilterFactory;
+}
+
+//-----------------------------------------------------------------------
+sal_Int32 MimeConfigurationHelper::GetFilterFlags( const ::rtl::OUString& aFilterName )
+{
+ sal_Int32 nFlags = 0;
+ try
+ {
+ if ( aFilterName.getLength() )
+ {
+ uno::Reference< container::XNameAccess > xFilterFactory(
+ GetFilterFactory(),
+ uno::UNO_SET_THROW );
+
+ uno::Any aFilterAny = xFilterFactory->getByName( aFilterName );
+ uno::Sequence< beans::PropertyValue > aData;
+ if ( aFilterAny >>= aData )
+ {
+ SequenceAsHashMap aFilterHM( aData );
+ nFlags = aFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), (sal_Int32)0 );
+ }
+ }
+ } catch( uno::Exception& )
+ {}
+
+ return nFlags;
+}
+
//-------------------------------------------------------------------------
::rtl::OUString MimeConfigurationHelper::GetDocServiceNameFromFilter( const ::rtl::OUString& aFilterName )
{
@@ -196,8 +237,8 @@ uno::Reference< container::XNameAccess > MimeConfigurationHelper::GetMediaTypeCo
try
{
uno::Reference< container::XNameAccess > xFilterFactory(
- m_xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" )) ),
- uno::UNO_QUERY_THROW );
+ GetFilterFactory(),
+ uno::UNO_SET_THROW );
uno::Any aFilterAnyData = xFilterFactory->getByName( aFilterName );
uno::Sequence< beans::PropertyValue > aFilterData;
@@ -669,36 +710,17 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocu
sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
uno::Sequence< beans::PropertyValue >& aMediaDescr )
{
+ sal_Bool bResult = sal_False;
+
::rtl::OUString aFilterName = UpdateMediaDescriptorWithFilterName( aMediaDescr, sal_False );
if ( aFilterName.getLength() )
{
- try
- {
- uno::Reference< container::XNameAccess > xFilterFactory(
- m_xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" )) ),
- uno::UNO_QUERY_THROW );
-
- uno::Any aFilterAnyData = xFilterFactory->getByName( aFilterName );
- uno::Sequence< beans::PropertyValue > aFilterData;
- if ( aFilterAnyData >>= aFilterData )
- {
- for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ )
- if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Flags" ) ) )
- {
- uno::Any aVal = aFilterData[nInd].Value;
- sal_Int32 nFlags = 0;
- // check the OWN flag
- if ( ( aFilterData[nInd].Value >>= nFlags ) && ( nFlags & 0x20 ) )
- return sal_True;
- break;
- }
- }
- }
- catch( uno::Exception& )
- {}
+ sal_Int32 nFlags = GetFilterFlags( aFilterName );
+ // check the OWN flag
+ bResult = ( nFlags & SFX_FILTER_OWN );
}
- return sal_False;
+ return bResult;
}
//-----------------------------------------------------------
@@ -710,7 +732,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
try
{
uno::Reference< container::XContainerQuery > xFilterQuery(
- m_xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" )) ),
+ GetFilterFactory(),
uno::UNO_QUERY_THROW );
uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
@@ -735,14 +757,15 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
(sal_Int32)0 );
// that should be import, export, own filter and not a template filter ( TemplatePath flag )
- if ( ( ( nFlags & 0x23L ) == 0x23L ) && !( nFlags & 0x10 ) )
+ sal_Int32 nRequired = ( SFX_FILTER_OWN | SFX_FILTER_EXPORT | SFX_FILTER_IMPORT );
+ if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SFX_FILTER_TEMPLATEPATH ) )
{
// if there are more than one filter the preffered one should be used
// if there is no preffered filter the first one will be used
- if ( !aResult.getLength() || ( nFlags & 0x10000000L ) )
+ if ( !aResult.getLength() || ( nFlags & SFX_FILTER_PREFERED ) )
aResult = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" )),
::rtl::OUString() );
- if ( nFlags & 0x10000000L )
+ if ( nFlags & SFX_FILTER_PREFERED )
break; // the preffered filter was found
}
}
@@ -753,6 +776,116 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
return aResult;
}
+
+//-------------------------------------------------------------------------
+::rtl::OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const ::rtl::OUString& aImportFilterName )
+{
+ ::rtl::OUString aExportFilterName;
+
+ try
+ {
+ if ( aImportFilterName.getLength() )
+ {
+ uno::Reference< container::XNameAccess > xFilterFactory(
+ GetFilterFactory(),
+ uno::UNO_SET_THROW );
+
+ uno::Any aImpFilterAny = xFilterFactory->getByName( aImportFilterName );
+ uno::Sequence< beans::PropertyValue > aImpData;
+ if ( aImpFilterAny >>= aImpData )
+ {
+ SequenceAsHashMap aImpFilterHM( aImpData );
+ sal_Int32 nFlags = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ),
+ (sal_Int32)0 );
+
+ if ( !( nFlags & SFX_FILTER_IMPORT ) )
+ {
+ OSL_ENSURE( sal_False, "This is no import filter!" );
+ throw uno::Exception();
+ }
+
+ if ( nFlags & SFX_FILTER_EXPORT )
+ {
+ aExportFilterName = aImportFilterName;
+ }
+ else
+ {
+ ::rtl::OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "DocumentService" ), ::rtl::OUString() );
+ ::rtl::OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Type" ), ::rtl::OUString() );
+
+ OSL_ENSURE( aDocumentServiceName.getLength() && aTypeName.getLength(), "Incomplete filter data!" );
+ if ( aDocumentServiceName.getLength() && aTypeName.getLength() )
+ {
+ uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
+ aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "Type" );
+ aSearchRequest[0].Value <<= aTypeName;
+ aSearchRequest[1].Name = ::rtl::OUString::createFromAscii( "DocumentService" );
+ aSearchRequest[1].Value <<= aDocumentServiceName;
+
+ uno::Sequence< beans::PropertyValue > aExportFilterProps = SearchForFilter(
+ uno::Reference< container::XContainerQuery >( xFilterFactory, uno::UNO_QUERY_THROW ),
+ aSearchRequest,
+ SFX_FILTER_EXPORT,
+ SFX_FILTER_INTERNAL );
+
+ if ( aExportFilterProps.getLength() )
+ {
+ SequenceAsHashMap aExpPropsHM( aExportFilterProps );
+ aExportFilterName = aExpPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Name" ), ::rtl::OUString() );
+ }
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
+
+ return aExportFilterName;
+}
+
+//-------------------------------------------------------------------------
+// static
+uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
+ const uno::Reference< container::XContainerQuery >& xFilterQuery,
+ const uno::Sequence< beans::NamedValue >& aSearchRequest,
+ sal_Int32 nMustFlags,
+ sal_Int32 nDontFlags )
+{
+ uno::Sequence< beans::PropertyValue > aFilterProps;
+ uno::Reference< container::XEnumeration > xFilterEnum =
+ xFilterQuery->createSubSetEnumerationByProperties( aSearchRequest );
+
+ // the first default filter will be taken,
+ // if there is no filter with flag default the first acceptable filter will be taken
+ if ( xFilterEnum.is() )
+ {
+ while ( xFilterEnum->hasMoreElements() )
+ {
+ uno::Sequence< beans::PropertyValue > aProps;
+ if ( xFilterEnum->nextElement() >>= aProps )
+ {
+ SequenceAsHashMap aPropsHM( aProps );
+ sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ),
+ (sal_Int32)0 );
+ if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
+ {
+ if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
+ {
+ aFilterProps = aProps;
+ break;
+ }
+ else if ( !aFilterProps.getLength() )
+ aFilterProps = aProps;
+ }
+ }
+ }
+ }
+
+ return aFilterProps;
+}
+
+
//-------------------------------------------------------------------------
sal_Bool MimeConfigurationHelper::ClassIDsEqual( const uno::Sequence< sal_Int8 >& aClassID1, const uno::Sequence< sal_Int8 >& aClassID2 )
{
@@ -765,7 +898,8 @@ sal_Bool MimeConfigurationHelper::ClassIDsEqual( const uno::Sequence< sal_Int8 >
return sal_True;
}
-//----------------------------------------------
+
+//-------------------------------------------------------------------------
uno::Sequence< sal_Int8 > MimeConfigurationHelper::GetSequenceClassID( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 )
@@ -790,6 +924,8 @@ uno::Sequence< sal_Int8 > MimeConfigurationHelper::GetSequenceClassID( sal_uInt3
return aResult;
}
+
+//-------------------------------------------------------------------------
uno::Sequence<sal_Int8> MimeConfigurationHelper::GetSequenceClassIDFromObjectName(const ::rtl::OUString& _sObjectName)
{
uno::Sequence<sal_Int8> aClassId;
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx
index d758cee5f371..be789592bbf1 100644
--- a/comphelper/source/misc/namedvaluecollection.cxx
+++ b/comphelper/source/misc/namedvaluecollection.cxx
@@ -100,21 +100,7 @@ namespace comphelper
NamedValueCollection::NamedValueCollection( const Any& _rElements )
:m_pImpl( new NamedValueCollection_Impl )
{
- Sequence< NamedValue > aNamedValues;
- Sequence< PropertyValue > aPropertyValues;
- NamedValue aNamedValue;
- PropertyValue aPropertyValue;
-
- if ( _rElements >>= aNamedValues )
- impl_assign( aNamedValues );
- else if ( _rElements >>= aPropertyValues )
- impl_assign( aPropertyValues );
- else if ( _rElements >>= aNamedValue )
- impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
- else if ( _rElements >>= aPropertyValue )
- impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
- else
- OSL_ENSURE( !_rElements.hasValue(), "NamedValueCollection::NamedValueCollection(Any): unsupported type!" );
+ impl_assign( _rElements );
}
//--------------------------------------------------------------------
@@ -171,6 +157,37 @@ namespace comphelper
}
//--------------------------------------------------------------------
+ ::std::vector< ::rtl::OUString > NamedValueCollection::getNames() const
+ {
+ ::std::vector< ::rtl::OUString > aNames;
+ for ( NamedValueRepository::const_iterator it = m_pImpl->aValues.begin(), end = m_pImpl->aValues.end(); it != end; ++it )
+ {
+ aNames.push_back( it->first );
+ }
+ return aNames;
+ }
+
+ //--------------------------------------------------------------------
+ void NamedValueCollection::impl_assign( const Any& i_rWrappedElements )
+ {
+ Sequence< NamedValue > aNamedValues;
+ Sequence< PropertyValue > aPropertyValues;
+ NamedValue aNamedValue;
+ PropertyValue aPropertyValue;
+
+ if ( i_rWrappedElements >>= aNamedValues )
+ impl_assign( aNamedValues );
+ else if ( i_rWrappedElements >>= aPropertyValues )
+ impl_assign( aPropertyValues );
+ else if ( i_rWrappedElements >>= aNamedValue )
+ impl_assign( Sequence< NamedValue >( &aNamedValue, 1 ) );
+ else if ( i_rWrappedElements >>= aPropertyValue )
+ impl_assign( Sequence< PropertyValue >( &aPropertyValue, 1 ) );
+ else
+ OSL_ENSURE( !i_rWrappedElements.hasValue(), "NamedValueCollection::impl_assign(Any): unsupported type!" );
+ }
+
+ //--------------------------------------------------------------------
void NamedValueCollection::impl_assign( const Sequence< Any >& _rArguments )
{
{
diff --git a/comphelper/source/misc/querydeep.cxx b/comphelper/source/misc/querydeep.cxx
deleted file mode 100644
index 61cfb6c173f2..000000000000
--- a/comphelper/source/misc/querydeep.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_comphelper.hxx"
-#include <comphelper/querydeep.hxx>
-#include <typelib/typedescription.h>
-
-//__________________________________________________________________________________________________
-
-sal_Bool comphelper::isDerivedFrom(
- const ::com::sun::star::uno::Type & rBaseType,
- const ::com::sun::star::uno::Type & rType )
-{
- using namespace ::com::sun::star::uno;
-
- TypeClass eClass = rBaseType.getTypeClass();
-
- if (eClass != TypeClass_INTERFACE)
- return sal_False;
-
- // supported TypeClass - do the types match ?
- if (eClass != rType.getTypeClass())
- return sal_False;
-
- sal_Bool bRet;
-
- // shortcut for simple case
- if (rBaseType == ::getCppuType(static_cast<const Reference< XInterface > *>(0)))
- {
- bRet = sal_True;
- }
- else
- {
- // now ask in cppu (aka typelib)
- ::typelib_TypeDescription *pBaseTD = 0, *pTD = 0;
-
- rBaseType. getDescription(&pBaseTD);
- rType. getDescription(&pTD);
-
- // interfaces are assignable to a base
- bRet = ::typelib_typedescription_isAssignableFrom(pBaseTD, pTD);
-
- ::typelib_typedescription_release(pBaseTD);
- ::typelib_typedescription_release(pTD);
- }
-
- return bRet;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx
index a8df29a7ac81..c37484be5b07 100644
--- a/comphelper/source/misc/scopeguard.cxx
+++ b/comphelper/source/misc/scopeguard.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
-#include "comphelper/scopeguard.hxx"
+#include "comphelper/flagguard.hxx"
#include "osl/diagnose.h"
#include "com/sun/star/uno/Exception.hpp"
@@ -68,6 +68,14 @@ void ScopeGuard::dismiss()
m_func.clear();
}
+FlagGuard::~FlagGuard()
+{
+}
+
+FlagRestorationGuard::~FlagRestorationGuard()
+{
+}
+
} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/servicedecl.cxx b/comphelper/source/misc/servicedecl.cxx
index c842f6298c08..6048709fd061 100644
--- a/comphelper/source/misc/servicedecl.cxx
+++ b/comphelper/source/misc/servicedecl.cxx
@@ -117,37 +117,6 @@ ServiceDecl::Factory::createInstanceWithArgumentsAndContext(
m_rServiceDecl, args, xContext );
}
-bool ServiceDecl::writeInfo( registry::XRegistryKey * xKey ) const
-{
- bool bRet = false;
- if (xKey != 0) {
- rtl::OUStringBuffer buf;
- buf.append( static_cast<sal_Unicode>('/') );
- buf.appendAscii( m_pImplName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/UNO/SERVICES") );
- try {
- uno::Reference<registry::XRegistryKey> const xNewKey(
- xKey->createKey( buf.makeStringAndClear() ) );
-
- rtl::OString const str(m_pServiceNames);
- sal_Int32 nIndex = 0;
- do {
- rtl::OString const token( str.getToken( 0, m_cDelim, nIndex ) );
- xNewKey->createKey(
- rtl::OUString( token.getStr(), token.getLength(),
- RTL_TEXTENCODING_ASCII_US ) );
- }
- while (nIndex >= 0);
-
- bRet = true;
- }
- catch (registry::InvalidRegistryException const&) {
- OSL_FAIL( "### InvalidRegistryException!" );
- }
- }
- return bRet;
-}
-
void * ServiceDecl::getFactory( sal_Char const* pImplName ) const
{
if (rtl_str_compare(m_pImplName, pImplName) == 0) {
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index 4d14069be369..039ad82dacb3 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -29,12 +29,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/embed/XEncryptionProtectedSource.hpp>
+#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <rtl/digest.h>
+
#include <ucbhelper/content.hxx>
#include <comphelper/fileformat.h>
@@ -237,16 +240,16 @@ uno::Reference< io::XInputStream > OStorageHelper::GetInputStreamFromURL(
}
// ----------------------------------------------------------------------
-void OStorageHelper::SetCommonStoragePassword(
+void OStorageHelper::SetCommonStorageEncryptionData(
const uno::Reference< embed::XStorage >& xStorage,
- const ::rtl::OUString& aPass )
+ const uno::Sequence< beans::NamedValue >& aEncryptionData )
throw ( uno::Exception )
{
- uno::Reference< embed::XEncryptionProtectedSource > xEncrSet( xStorage, uno::UNO_QUERY );
+ uno::Reference< embed::XEncryptionProtectedSource2 > xEncrSet( xStorage, uno::UNO_QUERY );
if ( !xEncrSet.is() )
throw io::IOException(); // TODO
- xEncrSet->setEncryptionPassword( aPass );
+ xEncrSet->setEncryptionData( aEncryptionData );
}
// ----------------------------------------------------------------------
@@ -420,6 +423,45 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
}
// ----------------------------------------------------------------------
+uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const ::rtl::OUString& aPassword )
+{
+ // TODO/LATER: Should not the method be part of DocPasswordHelper?
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if ( aPassword.getLength() )
+ {
+ // MS_1252 encoding was used for SO60 document format password encoding,
+ // this encoding supports only a minor subset of nonascii characters,
+ // but for compatibility reasons it has to be used for old document formats
+ aEncryptionData.realloc( 2 );
+ aEncryptionData[0].Name = PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
+ aEncryptionData[1].Name = PACKAGE_ENCRYPTIONDATA_SHA1MS1252;
+
+ rtl_TextEncoding pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
+
+ for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
+ {
+ ::rtl::OString aByteStrPass = ::rtl::OUStringToOString( aPassword, pEncoding[nInd] );
+
+ sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_SHA1];
+ rtlDigestError nError = rtl_digest_SHA1( aByteStrPass.getStr(),
+ aByteStrPass.getLength(),
+ pBuffer,
+ RTL_DIGEST_LENGTH_SHA1 );
+
+ if ( nError != rtl_Digest_E_None )
+ {
+ aEncryptionData.realloc( 0 );
+ break;
+ }
+
+ aEncryptionData[nInd].Value <<= uno::Sequence< sal_Int8 >( (sal_Int8*)pBuffer, RTL_DIGEST_LENGTH_SHA1 );
+ }
+ }
+
+ return aEncryptionData;
+}
+
+// ----------------------------------------------------------------------
sal_Bool OStorageHelper::IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed )
{
return IsValidZipEntryFileName( aName.getStr(), aName.getLength(), bSlashAllowed );
diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx
index 99df5958200c..ab25d70c6e24 100644
--- a/comphelper/source/misc/uieventslogger.cxx
+++ b/comphelper/source/misc/uieventslogger.cxx
@@ -176,6 +176,7 @@ namespace comphelper
static const OUString FN_ROTATEDLOG;
static const OUString LOGROTATE_EVENTNAME;
static const OUString URL_UNO;
+ static const OUString URL_SPECIAL;
static const OUString URL_FILE;
};
}
@@ -210,6 +211,7 @@ namespace comphelper
const OUString UiEventsLogger_Impl::LOGROTATE_EVENTNAME(RTL_CONSTASCII_USTRINGPARAM("onOOoImprovementLogRotated"));
const OUString UiEventsLogger_Impl::URL_UNO(RTL_CONSTASCII_USTRINGPARAM(".uno:"));
+ const OUString UiEventsLogger_Impl::URL_SPECIAL(RTL_CONSTASCII_USTRINGPARAM(".special:"));
const OUString UiEventsLogger_Impl::URL_FILE(RTL_CONSTASCII_USTRINGPARAM("file:"));
@@ -348,7 +350,12 @@ namespace comphelper
const Sequence<PropertyValue>& args)
{
if(!m_Active) return;
- if(!url.Complete.match(URL_UNO) && !url.Complete.match(URL_FILE)) return;
+ if(!url.Complete.match(URL_UNO)
+ && !url.Complete.match(URL_FILE)
+ && !url.Complete.match(URL_SPECIAL))
+ {
+ return;
+ }
checkIdleTimeout();
Sequence<OUString> logdata = Sequence<OUString>(COLUMNS);
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 719ca340becd..de636191b1aa 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -102,10 +102,12 @@ static bool makeCanonicalFileURL( rtl::OUString & rURL )
OfficeInstallationDirectories::OfficeInstallationDirectories(
const uno::Reference< uno::XComponentContext > & xCtx )
-: m_aOfficeDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
+: m_aOfficeBrandDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(brandbaseurl)" ) ),
+ m_aOfficeBaseDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
m_aUserDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(userdataurl)" ) ),
m_xCtx( xCtx ),
- m_pOfficeDir( 0 ),
+ m_pOfficeBrandDir( 0 ),
+ m_pOfficeBaseDir( 0 ),
m_pUserDir( 0 )
{
}
@@ -114,6 +116,9 @@ OfficeInstallationDirectories::OfficeInstallationDirectories(
// virtual
OfficeInstallationDirectories::~OfficeInstallationDirectories()
{
+ delete m_pOfficeBrandDir;
+ delete m_pOfficeBaseDir;
+ delete m_pUserDir;
}
//=========================================================================
@@ -125,9 +130,8 @@ rtl::OUString SAL_CALL
OfficeInstallationDirectories::getOfficeInstallationDirectoryURL()
throw ( uno::RuntimeException )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
- return rtl::OUString( *m_pOfficeDir );
+ return rtl::OUString( *m_pOfficeBrandDir );
}
//=========================================================================
@@ -136,7 +140,6 @@ rtl::OUString SAL_CALL
OfficeInstallationDirectories::getOfficeUserDataDirectoryURL()
throw ( uno::RuntimeException )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString( *m_pUserDir );
}
@@ -150,29 +153,39 @@ OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL )
{
if ( URL.getLength() > 0 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
rtl::OUString aCanonicalURL( URL );
makeCanonicalFileURL( aCanonicalURL );
- sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeDir );
+ sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeBrandDir );
if ( nIndex != -1 )
{
return rtl::OUString(
URL.replaceAt( nIndex,
- m_pOfficeDir->getLength(),
- m_aOfficeDirMacro ) );
+ m_pOfficeBrandDir->getLength(),
+ m_aOfficeBrandDirMacro ) );
}
else
{
- nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+ nIndex = aCanonicalURL.indexOf( *m_pOfficeBaseDir );
if ( nIndex != -1 )
{
return rtl::OUString(
URL.replaceAt( nIndex,
- m_pUserDir->getLength(),
- m_aUserDirMacro ) );
+ m_pOfficeBaseDir->getLength(),
+ m_aOfficeBaseDirMacro ) );
+ }
+ else
+ {
+ nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+ if ( nIndex != -1 )
+ {
+ return rtl::OUString(
+ URL.replaceAt( nIndex,
+ m_pUserDir->getLength(),
+ m_aUserDirMacro ) );
+ }
}
}
}
@@ -187,29 +200,40 @@ OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL )
{
if ( URL.getLength() > 0 )
{
- sal_Int32 nIndex = URL.indexOf( m_aOfficeDirMacro );
+ sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro );
if ( nIndex != -1 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString(
URL.replaceAt( nIndex,
- m_aOfficeDirMacro.getLength(),
- *m_pOfficeDir ) );
+ m_aOfficeBrandDirMacro.getLength(),
+ *m_pOfficeBrandDir ) );
}
else
{
- nIndex = URL.indexOf( m_aUserDirMacro );
+ nIndex = URL.indexOf( m_aOfficeBaseDirMacro );
if ( nIndex != -1 )
{
- // late init m_pOfficeDir and m_pUserDir
initDirs();
return rtl::OUString(
URL.replaceAt( nIndex,
- m_aUserDirMacro.getLength(),
- *m_pUserDir ) );
+ m_aOfficeBaseDirMacro.getLength(),
+ *m_pOfficeBaseDir ) );
+ }
+ else
+ {
+ nIndex = URL.indexOf( m_aUserDirMacro );
+ if ( nIndex != -1 )
+ {
+ initDirs();
+
+ return rtl::OUString(
+ URL.replaceAt( nIndex,
+ m_aUserDirMacro.getLength(),
+ *m_pUserDir ) );
+ }
}
}
}
@@ -301,13 +325,14 @@ OfficeInstallationDirectories::Create(
void OfficeInstallationDirectories::initDirs()
{
- if ( m_pOfficeDir == 0 )
+ if ( m_pOfficeBrandDir == 0 )
{
osl::MutexGuard aGuard( m_aMutex );
- if ( m_pOfficeDir == 0 )
+ if ( m_pOfficeBrandDir == 0 )
{
- m_pOfficeDir = new rtl::OUString;
- m_pUserDir = new rtl::OUString;
+ m_pOfficeBrandDir = new rtl::OUString;
+ m_pOfficeBaseDir = new rtl::OUString;
+ m_pUserDir = new rtl::OUString;
uno::Reference< util::XMacroExpander > xExpander;
@@ -321,15 +346,24 @@ void OfficeInstallationDirectories::initDirs()
if ( xExpander.is() )
{
- *m_pOfficeDir =
+ *m_pOfficeBrandDir =
+ xExpander->expandMacros(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR" ) ) );
+
+ OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0,
+ "Unable to obtain office brand installation directory!" );
+
+ makeCanonicalFileURL( *m_pOfficeBrandDir );
+
+ *m_pOfficeBaseDir =
xExpander->expandMacros(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":BaseInstallation}" ) ) );
- OSL_ENSURE( m_pOfficeDir->getLength() > 0,
- "Unable to obtain office installation directory!" );
+ OSL_ENSURE( m_pOfficeBaseDir->getLength() > 0,
+ "Unable to obtain office base installation directory!" );
- makeCanonicalFileURL( *m_pOfficeDir );
+ makeCanonicalFileURL( *m_pOfficeBaseDir );
*m_pUserDir =
xExpander->expandMacros(
@@ -337,7 +371,7 @@ void OfficeInstallationDirectories::initDirs()
"${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) );
OSL_ENSURE( m_pUserDir->getLength() > 0,
- "Unable to obtain office user data directory!" );
+ "Unable to obtain office user data directory!" );
makeCanonicalFileURL( *m_pUserDir );
}
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
index 5139a70e9a30..00f5b81df3f9 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx
@@ -95,11 +95,13 @@ public:
private:
void initDirs();
- rtl::OUString m_aOfficeDirMacro;
+ rtl::OUString m_aOfficeBrandDirMacro;
+ rtl::OUString m_aOfficeBaseDirMacro;
rtl::OUString m_aUserDirMacro;
com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext > m_xCtx;
- rtl::OUString * m_pOfficeDir;
+ rtl::OUString * m_pOfficeBrandDir;
+ rtl::OUString * m_pOfficeBaseDir;
rtl::OUString * m_pUserDir;
};
diff --git a/comphelper/source/property/TypeGeneration.cxx b/comphelper/source/property/TypeGeneration.cxx
index 75f101ca6c07..6c5f9e009e90 100644
--- a/comphelper/source/property/TypeGeneration.cxx
+++ b/comphelper/source/property/TypeGeneration.cxx
@@ -128,7 +128,8 @@
#include <com/sun/star/frame/XModel.hpp>
// #i28749#
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -225,6 +226,7 @@ namespace comphelper
case CPPUTYPE_SEQNAMEDVALUE: pType = &::getCppuType( (Sequence<beans::NamedValue>*)0 ); break;
case CPPUTYPE_REFXGRAPHIC: pType = &::getCppuType( (Reference< graphic::XGraphic >*)0); break;
case CPPUTYPE_TABLEBORDERDISTANCES: pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
+ case CPPUTPYE_REFEMBEDDEDOBJECT: pType = &embed::XEmbeddedObject::static_type(); break;
default:
OSL_FAIL( "Unknown CPPU type" );
}
diff --git a/comphelper/source/property/makefile.mk b/comphelper/source/property/makefile.mk
deleted file mode 100644
index 1bcdb4c8dd63..000000000000
--- a/comphelper/source/property/makefile.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=..$/..$/inc
-PRJNAME=comphelper
-TARGET=property
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/MasterPropertySetInfo.obj \
- $(SLO)$/MasterPropertySet.obj \
- $(SLO)$/ChainablePropertySetInfo.obj \
- $(SLO)$/ChainablePropertySet.obj \
- $(SLO)$/TypeGeneration.obj \
- $(SLO)$/genericpropertyset.obj\
- $(SLO)$/propertysethelper.obj \
- $(SLO)$/propertysetinfo.obj \
- $(SLO)$/composedprops.obj \
- $(SLO)$/propagg.obj \
- $(SLO)$/property.obj \
- $(SLO)$/propmultiplex.obj \
- $(SLO)$/propstate.obj \
- $(SLO)$/propertystatecontainer.obj \
- $(SLO)$/propertycontainer.obj \
- $(SLO)$/propertycontainerhelper.obj \
- $(SLO)$/propertybag.obj \
- $(SLO)$/opropertybag.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index a0ae86c9a735..15c509378fb6 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -88,20 +88,36 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
const Property* pDelegateProps = _rProperties.getConstArray();
Property* pMergedProps = m_aProperties.getArray();
+ // if properties are present both at the delegatee and the aggregate, then the former are supposed to win.
+ // So, we'll need an existence check.
+ ::std::set< ::rtl::OUString > aDelegatorProps;
+
// create the map for the delegator properties
sal_Int32 nMPLoop = 0;
for ( ; nMPLoop < nDelegatorProps; ++nMPLoop, ++pDelegateProps )
+ {
m_aPropertyAccessors[ pDelegateProps->Handle ] = OPropertyAccessor( -1, nMPLoop, sal_False );
+ OSL_ENSURE( aDelegatorProps.find( pDelegateProps->Name ) == aDelegatorProps.end(),
+ "OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper: duplicate delegatee property!" );
+ aDelegatorProps.insert( pDelegateProps->Name );
+ }
// create the map for the aggregate properties
sal_Int32 nAggregateHandle = _nFirstAggregateId;
pMergedProps += nDelegatorProps;
- for ( ; nMPLoop < nMergedProps; ++nMPLoop, ++pMergedProps, ++pAggregateProps )
+ for ( ; nMPLoop < nMergedProps; ++pAggregateProps )
{
+ // if the aggregate property is present at the delegatee already, ignore it
+ if ( aDelegatorProps.find( pAggregateProps->Name ) != aDelegatorProps.end() )
+ {
+ --nMergedProps;
+ continue;
+ }
+
// next aggregate property - remember it
*pMergedProps = *pAggregateProps;
- // determine the handle for the property which we will expose to the ourside world
+ // determine the handle for the property which we will expose to the outside world
sal_Int32 nHandle = -1;
// ask the infor service first
if ( _pInfoService )
@@ -124,7 +140,11 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
// remember the accessor for this property
m_aPropertyAccessors[ nHandle ] = OPropertyAccessor( pMergedProps->Handle, nMPLoop, sal_True );
pMergedProps->Handle = nHandle;
+
+ ++nMPLoop;
+ ++pMergedProps;
}
+ m_aProperties.realloc( nMergedProps );
pMergedProps = m_aProperties.getArray(); // reset, needed again below
// sortieren der Properties nach Namen
diff --git a/comphelper/source/streaming/makefile.mk b/comphelper/source/streaming/makefile.mk
deleted file mode 100644
index 2a6ea38ca65e..000000000000
--- a/comphelper/source/streaming/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=comphelper
-TARGET=streaming
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= $(SLO)$/basicio.obj \
- $(SLO)$/oslfile2streamwrap.obj \
- $(SLO)$/seqstream.obj \
- $(SLO)$/seqinputstreamserv.obj \
- $(SLO)$/seqoutputstreamserv.obj \
- $(SLO)$/streamsection.obj \
- $(SLO)$/seekableinput.obj \
- $(SLO)$/otransactedfilestream.obj \
- $(SLO)$/memorystream.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/comphelper/test/uno_iterators/makefile.mk b/comphelper/test/uno_iterators/makefile.mk
deleted file mode 100644
index 2346a0d24742..000000000000
--- a/comphelper/test/uno_iterators/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#***********************************************************************/
-
-PRJNAME=extensions
-PRJ=..$/..
-
-TARGET=uno_iterators
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-
-OBJFILES= \
- $(OBJ)$/uno_iterators.obj
-
-APP1TARGET=uno_iterators
-APP1OBJS= \
- $(OBJ)$/uno_iterators.obj
-APP1STDLIBS= \
- $(SALLIB) \
- $(CPPULIB) \
- $(SALHELPERLIB) \
- $(CPPUHELPERLIB)
-
-.INCLUDE : target.mk
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
new file mode 100644
index 000000000000..10d23d48bcea
--- /dev/null
+++ b/comphelper/util/comphelp.component
@@ -0,0 +1,70 @@
+<?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="AnyCompareFactory">
+ <service name="com.sun.star.ucb.AnyCompareFactory"/>
+ </implementation>
+ <implementation name="IndexedPropertyValuesContainer">
+ <service name="com.sun.star.document.IndexedPropertyValues"/>
+ </implementation>
+ <implementation name="NamedPropertyValuesContainer">
+ <service name="com.sun.star.document.NamedPropertyValues"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.MemoryStream">
+ <service name="com.sun.star.comp.MemoryStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.SequenceInputStreamService">
+ <service name="com.sun.star.io.SequenceInputStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.SequenceOutputStreamService">
+ <service name="com.sun.star.io.SequenceOutputStream"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.comphelper.OPropertyBag">
+ <service name="com.sun.star.beans.PropertyBag"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.InstanceLocker">
+ <service name="com.sun.star.embed.InstanceLocker"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.logging.SimpleLogRing">
+ <service name="com.sun.star.logging.SimpleLogRing"/>
+ <singleton name="com.sun.star.logging.DocumentIOLogRing"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.task.OfficeRestartManager">
+ <service name="com.sun.star.comp.task.OfficeRestartManager"/>
+ <singleton name="com.sun.star.task.OfficeRestartManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.util.OfficeInstallationDirectories">
+ <service name="com.sun.star.util.OfficeInstallationDirectories"/>
+ <singleton name="com.sun.star.util.theOfficeInstallationDirectories"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.comphelper.EnumerableMap">
+ <service name="com.sun.star.container.EnumerableMap"/>
+ </implementation>
+</component>
diff --git a/comphelper/util/exports.dxp b/comphelper/util/exports.dxp
deleted file mode 100644
index 0c2e3e7cddd7..000000000000
--- a/comphelper/util/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory \ No newline at end of file
diff --git a/comphelper/util/makefile.mk b/comphelper/util/makefile.mk
deleted file mode 100644
index 33dcfbf98625..000000000000
--- a/comphelper/util/makefile.mk
+++ /dev/null
@@ -1,70 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-PRJNAME=comphelper
-TARGET=comphelper
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Library -----------------------------------
-
-LIB1TARGET= $(SLB)$/$(TARGET).lib
-LIB1FILES= $(SLB)$/container.lib \
- $(SLB)$/evtattmgr.lib \
- $(SLB)$/misc.lib \
- $(SLB)$/processfactory.lib \
- $(SLB)$/property.lib \
- $(SLB)$/streaming.lib \
- $(SLB)$/compare.lib \
- $(SLB)$/officeinstdir.lib \
- $(SLB)$/xml.lib
-
-SHL1TARGET=$(COMPHLP_TARGET)$(COMPHLP_MAJOR)$(COMID)
-.IF "$(GUI)" == "OS2"
-SHL1TARGET=comph$(COMPHLP_MAJOR)
-.ENDIF
-SHL1STDLIBS= \
- $(SALLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(UCBHELPERLIB) \
-
-
-SHL1DEPN=
-SHL1IMPLIB= i$(COMPHLP_TARGET)
-SHL1USE_EXPORTS=name
-SHL1LIBS= $(LIB1TARGET)
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEFLIB1NAME=$(TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx
index 79f1eb0744f7..a01b438670a8 100644
--- a/cppcanvas/inc/cppcanvas/renderer.hxx
+++ b/cppcanvas/inc/cppcanvas/renderer.hxx
@@ -33,7 +33,7 @@
#include <rtl/ustring.hxx>
#include <boost/shared_ptr.hpp>
-#include <comphelper/optionalvalue.hxx>
+#include <boost/optional.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <cppcanvas/canvasgraphic.hxx>
#include <cppcanvas/color.hxx>
@@ -110,16 +110,16 @@ namespace cppcanvas
struct Parameters
{
/// Optionally forces the fill color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maFillColor;
+ ::boost::optional< Color::IntSRGBA > maFillColor;
/// Optionally forces the line color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maLineColor;
+ ::boost::optional< Color::IntSRGBA > maLineColor;
/// Optionally forces the text color attribute for all actions
- ::comphelper::OptionalValue< Color::IntSRGBA > maTextColor;
+ ::boost::optional< Color::IntSRGBA > maTextColor;
/// Optionally forces the given fontname for all text actions
- ::comphelper::OptionalValue< ::rtl::OUString > maFontName;
+ ::boost::optional< ::rtl::OUString > maFontName;
/** Optionally transforms all text output actions with the
given matrix (in addition to the overall canvas
@@ -129,19 +129,19 @@ namespace cppcanvas
rect coordinate system, i.e. the metafile is assumed
to be contained in the unit rect.
*/
- ::comphelper::OptionalValue< ::basegfx::B2DHomMatrix > maTextTransformation;
+ ::boost::optional< ::basegfx::B2DHomMatrix > maTextTransformation;
/// Optionally forces the given font weight for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontWeight;
+ ::boost::optional< sal_Int8 > maFontWeight;
/// Optionally forces the given font letter form (italics etc.) for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontLetterForm;
+ ::boost::optional< sal_Int8 > maFontLetterForm;
/// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
- ::comphelper::OptionalValue< sal_Int8 > maFontProportion;
+ ::boost::optional< sal_Int8 > maFontProportion;
/// Optionally forces underlining for all text actions
- ::comphelper::OptionalValue< bool > maFontUnderline;
+ ::boost::optional< bool > maFontUnderline;
};
};
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 49da12816757..3c1ec6de127f 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -245,7 +245,7 @@ static float GetSwapFloat( SvStream& rSt )
bool isActionContained( GDIMetaFile& rMtf,
const char* pCommentString,
- USHORT nType ) const;
+ sal_uInt16 nType ) const;
void createGradientAction( const ::PolyPolygon& rPoly,
const ::Gradient& rGradient,
@@ -266,7 +266,7 @@ static float GetSwapFloat( SvStream& rSt )
ActionVector::const_iterator& o_rRangeBegin,
ActionVector::const_iterator& o_rRangeEnd ) const;
- void processObjectRecord(SvMemoryStream& rObjectStream, UINT16 flags);
+ void processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags);
void processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas );
void EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor);
@@ -293,7 +293,7 @@ static float GetSwapFloat( SvStream& rSt )
sal_Int32 nMmY;
/* multipart object data */
bool mbMultipart;
- UINT16 mMFlags;
+ sal_uInt16 mMFlags;
SvMemoryStream mMStream;
};
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 2059aaec486b..b2a582b1319d 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -144,12 +144,12 @@ namespace cppcanvas
}
// TODO: remove rR argument when debug code is not longer needed
- void Read (SvStream& s, UINT32 pathFlags, ImplRenderer& rR)
+ void Read (SvStream& s, sal_uInt32 pathFlags, ImplRenderer& rR)
{
for (int i = 0; i < nPoints; i ++) {
if (pathFlags & 0x4000) {
// points are stored in short 16bit integer format
- UINT16 x, y;
+ sal_uInt16 x, y;
s >> x >> y;
EMFP_DEBUG (printf ("EMF+\tpoint [x,y]: %hd,%hd\n", x, y));
@@ -341,12 +341,12 @@ namespace cppcanvas
}
}
- UINT32 GetType() const { return type; }
+ sal_uInt32 GetType() const { return type; }
const ::Color& GetColor() const { return solidColor; }
void Read (SvStream& s, ImplRenderer& rR)
{
- UINT32 header;
+ sal_uInt32 header;
s >> header >> type;
@@ -355,7 +355,7 @@ namespace cppcanvas
switch (type) {
case 0:
{
- UINT32 color;
+ sal_uInt32 color;
s >> color;
solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
@@ -370,7 +370,7 @@ namespace cppcanvas
EMFP_DEBUG (printf ("EMF+\tpath gradient, additional flags: 0x%02x\n", additionalFlags));
- UINT32 color;
+ sal_uInt32 color;
s >> color;
solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
@@ -483,7 +483,7 @@ namespace cppcanvas
EMFP_DEBUG (printf ("EMF+\tarea: %f,%f - %fx%f\n", areaX, areaY, areaWidth, areaHeight));
- UINT32 color;
+ sal_uInt32 color;
s >> color;
solidColor = ::Color (0xff - (color >> 24), (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
@@ -584,7 +584,7 @@ namespace cppcanvas
void Read (SvStream& s, ImplRenderer& rR, sal_Int32, sal_Int32 )
{
- UINT32 header, unknown, penFlags, unknown2;
+ sal_uInt32 header, unknown, penFlags, unknown2;
int i;
s >> header >> unknown >> penFlags >> unknown2 >> width;
@@ -1086,9 +1086,9 @@ namespace cppcanvas
}
}
- void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, UINT16 flags)
+ void ImplRenderer::processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags)
{
- EMFP_DEBUG (UINT32 objectLen);
+ EMFP_DEBUG (sal_uInt32 objectLen);
sal_uInt32 index;
EMFP_DEBUG (printf ("EMF+ Object slot: %hd flags: %hx\n", flags & 0xff, flags & 0xff00));
@@ -1169,8 +1169,8 @@ namespace cppcanvas
length -= 4;
while (length > 0) {
- UINT16 type, flags;
- UINT32 size, dataSize;
+ sal_uInt16 type, flags;
+ sal_uInt32 size, dataSize;
sal_uInt32 next;
rMF >> type >> flags >> size >> dataSize;
@@ -1201,7 +1201,7 @@ namespace cppcanvas
if (type != EmfPlusRecordTypeObject || !(flags & 0x8000))
switch (type) {
case EmfPlusRecordTypeHeader:
- UINT32 header, version;
+ sal_uInt32 header, version;
rMF >> header >> version >> nHDPI >> nVDPI;
@@ -1282,8 +1282,8 @@ namespace cppcanvas
sal_uInt32 brushIndexOrColor;
EMFP_DEBUG (sal_Int32 brushIndex);
sal_Int32 points;
- EMFP_DEBUG (UINT32 color);
- EMFP_DEBUG (USHORT transparency = 0);
+ EMFP_DEBUG (sal_uInt32 color);
+ EMFP_DEBUG (sal_uInt16 transparency = 0);
rMF >> brushIndexOrColor;
rMF >> points;
@@ -1343,7 +1343,7 @@ namespace cppcanvas
}
case EmfPlusRecordTypeDrawPath:
{
- UINT32 penIndex;
+ sal_uInt32 penIndex;
rMF >> penIndex;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 914a94e5822b..c71c09863234 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -147,7 +147,7 @@ namespace
}
void pushState( ::cppcanvas::internal::VectorOfOutDevStates& rStates,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
rStates.push_back( getState( rStates ) );
getState( rStates ).pushFlags = nFlags;
@@ -451,7 +451,7 @@ namespace
// translate characters to local preference
sal_Unicode cChar = getLocalizedChar( *pBegin, eTextLanguage );
if( cChar != *pBegin )
- rStr.SetChar( sal::static_int_cast<USHORT>(pBegin - pBase), cChar );
+ rStr.SetChar( sal::static_int_cast<sal_uInt16>(pBegin - pBase), cChar );
}
}
}
@@ -526,7 +526,7 @@ namespace cppcanvas
bool ImplRenderer::isActionContained( GDIMetaFile& rMtf,
const char* pCommentString,
- USHORT nType ) const
+ sal_uInt16 nType ) const
{
ENSURE_OR_THROW( pCommentString,
"ImplRenderer::isActionContained(): NULL string given" );
@@ -535,7 +535,7 @@ namespace cppcanvas
// at least _one_ call to GDIMetaFile::NextAction() is
// executed
- ULONG nPos( 1 );
+ sal_uIntPtr nPos( 1 );
MetaAction* pCurrAct;
while( (pCurrAct=rMtf.NextAction()) != NULL )
@@ -586,7 +586,7 @@ namespace cppcanvas
// decide, whether this gradient can be rendered natively
// by the canvas, or must be emulated via VCL gradient
// action extraction.
- const USHORT nSteps( rGradient.GetSteps() );
+ const sal_uInt16 nSteps( rGradient.GetSteps() );
if( // step count is infinite, can use native canvas
// gradients here
@@ -611,17 +611,17 @@ namespace cppcanvas
// ----------------------------
// scale color coefficients with gradient intensities
- const USHORT nStartIntensity( rGradient.GetStartIntensity() );
+ const sal_uInt16 nStartIntensity( rGradient.GetStartIntensity() );
::Color aVCLStartColor( rGradient.GetStartColor() );
- aVCLStartColor.SetRed( (UINT8)(aVCLStartColor.GetRed() * nStartIntensity / 100) );
- aVCLStartColor.SetGreen( (UINT8)(aVCLStartColor.GetGreen() * nStartIntensity / 100) );
- aVCLStartColor.SetBlue( (UINT8)(aVCLStartColor.GetBlue() * nStartIntensity / 100) );
+ aVCLStartColor.SetRed( (sal_uInt8)(aVCLStartColor.GetRed() * nStartIntensity / 100) );
+ aVCLStartColor.SetGreen( (sal_uInt8)(aVCLStartColor.GetGreen() * nStartIntensity / 100) );
+ aVCLStartColor.SetBlue( (sal_uInt8)(aVCLStartColor.GetBlue() * nStartIntensity / 100) );
- const USHORT nEndIntensity( rGradient.GetEndIntensity() );
+ const sal_uInt16 nEndIntensity( rGradient.GetEndIntensity() );
::Color aVCLEndColor( rGradient.GetEndColor() );
- aVCLEndColor.SetRed( (UINT8)(aVCLEndColor.GetRed() * nEndIntensity / 100) );
- aVCLEndColor.SetGreen( (UINT8)(aVCLEndColor.GetGreen() * nEndIntensity / 100) );
- aVCLEndColor.SetBlue( (UINT8)(aVCLEndColor.GetBlue() * nEndIntensity / 100) );
+ aVCLEndColor.SetRed( (sal_uInt8)(aVCLEndColor.GetRed() * nEndIntensity / 100) );
+ aVCLEndColor.SetGreen( (sal_uInt8)(aVCLEndColor.GetGreen() * nEndIntensity / 100) );
+ aVCLEndColor.SetBlue( (sal_uInt8)(aVCLEndColor.GetBlue() * nEndIntensity / 100) );
uno::Reference<rendering::XColorSpace> xColorSpace(
rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace());
@@ -848,8 +848,8 @@ namespace cppcanvas
{
rendering::FontRequest aFontRequest;
- if( rParms.mrParms.maFontName.isValid() )
- aFontRequest.FontDescription.FamilyName = rParms.mrParms.maFontName.getValue();
+ if( rParms.mrParms.maFontName.is_initialized() )
+ aFontRequest.FontDescription.FamilyName = *rParms.mrParms.maFontName;
else
aFontRequest.FontDescription.FamilyName = rFont.GetName();
@@ -860,16 +860,16 @@ namespace cppcanvas
// TODO(F2): improve vclenum->panose conversion
aFontRequest.FontDescription.FontDescription.Weight =
- rParms.mrParms.maFontWeight.isValid() ?
- rParms.mrParms.maFontWeight.getValue() :
+ rParms.mrParms.maFontWeight.is_initialized() ?
+ *rParms.mrParms.maFontWeight :
::canvas::tools::numeric_cast<sal_Int8>( ::basegfx::fround( rFont.GetWeight() ) );
aFontRequest.FontDescription.FontDescription.Letterform =
- rParms.mrParms.maFontLetterForm.isValid() ?
- rParms.mrParms.maFontLetterForm.getValue() :
+ rParms.mrParms.maFontLetterForm.is_initialized() ?
+ *rParms.mrParms.maFontLetterForm :
(rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
aFontRequest.FontDescription.FontDescription.Proportion =
- rParms.mrParms.maFontProportion.isValid() ?
- rParms.mrParms.maFontProportion.getValue() :
+ rParms.mrParms.maFontProportion.is_initialized() ?
+ *rParms.mrParms.maFontProportion :
(rFont.GetPitch() == PITCH_FIXED)
? rendering::PanoseProportion::MONO_SPACED
: rendering::PanoseProportion::ANYTHING;
@@ -1468,7 +1468,7 @@ namespace cppcanvas
break;
case META_LINECOLOR_ACTION:
- if( !rParms.maLineColor.isValid() )
+ if( !rParms.maLineColor.is_initialized() )
{
setStateColor( static_cast<MetaLineColorAction*>(pCurrAct),
getState( rStates ).isLineColorSet,
@@ -1478,7 +1478,7 @@ namespace cppcanvas
break;
case META_FILLCOLOR_ACTION:
- if( !rParms.maFillColor.isValid() )
+ if( !rParms.maFillColor.is_initialized() )
{
setStateColor( static_cast<MetaFillColorAction*>(pCurrAct),
getState( rStates ).isFillColorSet,
@@ -1489,7 +1489,7 @@ namespace cppcanvas
case META_TEXTCOLOR_ACTION:
{
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
// Text color is set unconditionally, thus, no
// use of setStateColor here
@@ -1509,7 +1509,7 @@ namespace cppcanvas
break;
case META_TEXTFILLCOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextFillColorAction*>(pCurrAct),
getState( rStates ).isTextFillColorSet,
@@ -1519,7 +1519,7 @@ namespace cppcanvas
break;
case META_TEXTLINECOLOR_ACTION:
- if( !rParms.maTextColor.isValid() )
+ if( !rParms.maTextColor.is_initialized() )
{
setStateColor( static_cast<MetaTextLineColorAction*>(pCurrAct),
getState( rStates ).isTextLineColorSet,
@@ -1549,14 +1549,14 @@ namespace cppcanvas
// TODO(Q2): define and use appropriate enumeration types
rState.textReliefStyle = (sal_Int8)rFont.GetRelief();
rState.textOverlineStyle = (sal_Int8)rFont.GetOverline();
- rState.textUnderlineStyle = rParms.maFontUnderline.isValid() ?
- (rParms.maFontUnderline.getValue() ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
+ rState.textUnderlineStyle = rParms.maFontUnderline.is_initialized() ?
+ (*rParms.maFontUnderline ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) :
(sal_Int8)rFont.GetUnderline();
rState.textStrikeoutStyle = (sal_Int8)rFont.GetStrikeout();
rState.textEmphasisMarkStyle = (sal_Int8)rFont.GetEmphasisMark();
- rState.isTextEffectShadowSet = (rFont.IsShadow() != FALSE);
- rState.isTextWordUnderlineSet = (rFont.IsWordLineMode() != FALSE);
- rState.isTextOutlineModeSet = (rFont.IsOutline() != FALSE);
+ rState.isTextEffectShadowSet = (rFont.IsShadow() != sal_False);
+ rState.isTextWordUnderlineSet = (rFont.IsWordLineMode() != sal_False);
+ rState.isTextOutlineModeSet = (rFont.IsOutline() != sal_False);
}
break;
@@ -1718,7 +1718,7 @@ namespace cppcanvas
// Handle drawing layer fills
else if( pAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
{
- const BYTE* pData = pAct->GetData();
+ const sal_uInt8* pData = pAct->GetData();
if ( pData )
{
SvMemoryStream aMemStm( (void*)pData, pAct->GetDataSize(), STREAM_READ );
@@ -2546,7 +2546,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
NULL,
rFactoryParms,
bSubsettableActions );
@@ -2565,7 +2565,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
pAct->GetDXArray(),
rFactoryParms,
bSubsettableActions );
@@ -2640,7 +2640,7 @@ namespace cppcanvas
if( rVDev.GetDigitLanguage())
convertToLocalizedNumerals ( sText,rVDev.GetDigitLanguage() );
- const USHORT nLen( pAct->GetLen() == (USHORT)STRING_LEN ?
+ const sal_uInt16 nLen( pAct->GetLen() == (sal_uInt16)STRING_LEN ?
pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen() );
// #i70897# Nothing to do, actually...
@@ -2661,7 +2661,7 @@ namespace cppcanvas
// Last entry of pDXArray contains total width of the text
sal_Int32* p=pDXArray.get();
- for( USHORT i=1; i<=nLen; ++i )
+ for( sal_uInt16 i=1; i<=nLen; ++i )
{
// calc ratio for every array entry, to
// distribute rounding errors 'evenly'
@@ -2676,7 +2676,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
pDXArray.get(),
rFactoryParms,
bSubsettableActions );
@@ -2950,7 +2950,7 @@ namespace cppcanvas
VectorOfOutDevStates aStateStack;
VirtualDevice aVDev;
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
// Setup VDev for state tracking and mapping
// =========================================
@@ -2995,29 +2995,29 @@ namespace cppcanvas
getState( aStateStack ).textLineColor = pColor->getDeviceColor( 0x000000FF );
// apply overrides from the Parameters struct
- if( rParams.maFillColor.isValid() )
+ if( rParams.maFillColor.is_initialized() )
{
getState( aStateStack ).isFillColorSet = true;
- getState( aStateStack ).fillColor = pColor->getDeviceColor( rParams.maFillColor.getValue() );
+ getState( aStateStack ).fillColor = pColor->getDeviceColor( *rParams.maFillColor );
}
- if( rParams.maLineColor.isValid() )
+ if( rParams.maLineColor.is_initialized() )
{
getState( aStateStack ).isLineColorSet = true;
- getState( aStateStack ).lineColor = pColor->getDeviceColor( rParams.maLineColor.getValue() );
+ getState( aStateStack ).lineColor = pColor->getDeviceColor( *rParams.maLineColor );
}
- if( rParams.maTextColor.isValid() )
+ if( rParams.maTextColor.is_initialized() )
{
getState( aStateStack ).isTextFillColorSet = true;
getState( aStateStack ).isTextLineColorSet = true;
getState( aStateStack ).textColor =
getState( aStateStack ).textFillColor =
- getState( aStateStack ).textLineColor = pColor->getDeviceColor( rParams.maTextColor.getValue() );
+ getState( aStateStack ).textLineColor = pColor->getDeviceColor( *rParams.maTextColor );
}
- if( rParams.maFontName.isValid() ||
- rParams.maFontWeight.isValid() ||
- rParams.maFontLetterForm.isValid() ||
- rParams.maFontUnderline.isValid() ||
- rParams.maFontProportion.isValid() )
+ if( rParams.maFontName.is_initialized() ||
+ rParams.maFontWeight.is_initialized() ||
+ rParams.maFontLetterForm.is_initialized() ||
+ rParams.maFontUnderline.is_initialized() ||
+ rParams.maFontProportion.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx
index 6633f29ed87d..4810268b7ca7 100644
--- a/cppcanvas/source/mtfrenderer/mtftools.cxx
+++ b/cppcanvas/source/mtfrenderer/mtftools.cxx
@@ -307,14 +307,14 @@ namespace cppcanvas
TextLineInfo createTextLineInfo( const ::VirtualDevice& rVDev,
const ::cppcanvas::internal::OutDevState& rState )
{
- const BOOL bOldMode( rVDev.IsMapModeEnabled() );
+ const sal_Bool bOldMode( rVDev.IsMapModeEnabled() );
// #i68512# Force metric regeneration with mapmode enabled
// (prolly OutDev bug)
rVDev.GetFontMetric();
// will restore map mode below
- const_cast< ::VirtualDevice& >(rVDev).EnableMapMode( FALSE );
+ const_cast< ::VirtualDevice& >(rVDev).EnableMapMode( sal_False );
const ::FontMetric aMetric = rVDev.GetFontMetric();
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index eefa2674b867..a80306df3e05 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -213,8 +213,8 @@ namespace cppcanvas
::boost::scoped_array< sal_Int32 > pCharWidths( new sal_Int32[nLen] );
rVDev.GetTextArray( rText, pCharWidths.get(),
- static_cast<USHORT>(nStartPos),
- static_cast<USHORT>(nLen) );
+ static_cast<sal_uInt16>(nStartPos),
+ static_cast<sal_uInt16>(nLen) );
return setupDXArray( pCharWidths.get(), nLen, rState );
}
@@ -288,8 +288,8 @@ namespace cppcanvas
{
// TODO(F2): use correct scale direction
const ::basegfx::B2DSize aSize( rVDev.GetTextWidth( rStringContext.Text,
- static_cast<USHORT>(rStringContext.StartPosition),
- static_cast<USHORT>(rStringContext.Length) ),
+ static_cast<sal_uInt16>(rStringContext.StartPosition),
+ static_cast<sal_uInt16>(rStringContext.Length) ),
0 );
return (rState.mapModeTransform * aSize).getX();
@@ -1976,10 +1976,10 @@ namespace cppcanvas
::basegfx::B2DPolyPolygon aResultingPolyPolygon;
PolyPolyVector aVCLPolyPolyVector;
const bool bHaveOutlines( rVDev.GetTextOutlines( aVCLPolyPolyVector, rText,
- static_cast<USHORT>(nStartPos),
- static_cast<USHORT>(nStartPos),
- static_cast<USHORT>(nLen),
- TRUE, 0, pDXArray ) );
+ static_cast<sal_uInt16>(nStartPos),
+ static_cast<sal_uInt16>(nStartPos),
+ static_cast<sal_uInt16>(nLen),
+ sal_True, 0, pDXArray ) );
rVDev.SetFont(aOrigFont);
if( !bHaveOutlines )
@@ -2051,7 +2051,7 @@ namespace cppcanvas
rCanvas->getUNOCanvas()->getDevice(),
aResultingPolyPolygon ) );
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr(
new OutlineAction(
@@ -2067,7 +2067,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2168,7 +2168,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
{
return ActionSharedPtr( new TextAction(
aStartPoint,
@@ -2177,7 +2177,7 @@ namespace cppcanvas
nLen,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
}
else
{
@@ -2193,7 +2193,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
aReliefOffset,
@@ -2206,7 +2206,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextAction(
aStartPoint,
@@ -2232,7 +2232,7 @@ namespace cppcanvas
rShadowColor == aEmptyColor )
{
// nope
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
rText,
@@ -2241,7 +2241,7 @@ namespace cppcanvas
aCharWidths,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new TextArrayAction(
aStartPoint,
@@ -2255,7 +2255,7 @@ namespace cppcanvas
else
{
// at least one of the effects requested
- if( rParms.maTextTransformation.isValid() )
+ if( rParms.maTextTransformation.is_initialized() )
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
aReliefOffset,
@@ -2269,7 +2269,7 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- rParms.maTextTransformation.getValue() ) );
+ *rParms.maTextTransformation ) );
else
return ActionSharedPtr( new EffectTextArrayAction(
aStartPoint,
diff --git a/cppcanvas/source/uno/exports.dxp b/cppcanvas/source/uno/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/cppcanvas/source/uno/exports.dxp
+++ b/cppcanvas/source/uno/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/cppcanvas/source/uno/exports.map b/cppcanvas/source/uno/exports.map
index 31a8b65a1f93..a488d5d06a43 100644
--- a/cppcanvas/source/uno/exports.map
+++ b/cppcanvas/source/uno/exports.map
@@ -2,7 +2,6 @@ UDK_3_0_0 {
global:
_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
component_getImplementationEnvironment;
- component_writeInfo;
component_getFactory;
local:
*;
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index 870de321055c..c0646d0fdba5 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -296,7 +296,7 @@ namespace cppcanvas
if( !pSpriteCanvas )
return SpriteSharedPtr();
- const USHORT nBitmaps( rAnim.Count() );
+ const sal_uInt16 nBitmaps( rAnim.Count() );
uno::Sequence< uno::Reference< rendering::XBitmap > > aBitmapSequence( nBitmaps );
uno::Reference< rendering::XBitmap >* pBitmaps = aBitmapSequence.getArray();
@@ -311,7 +311,7 @@ namespace cppcanvas
for( i=0; i<nBitmaps; ++i )
{
- const AnimationBitmap& rAnimBmp( rAnim.Get((USHORT)i) );
+ const AnimationBitmap& rAnimBmp( rAnim.Get((sal_uInt16)i) );
// Handle dispose according to GIF spec: a
// DISPOSE_PREVIOUS does _not_ mean to revert to the
diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst
index ebe88a70744e..6ee2b47d53af 100644
--- a/dtrans/prj/build.lst
+++ b/dtrans/prj/build.lst
@@ -1,4 +1,4 @@
-dr dtrans : unotools offapi offuh rdbmaker stoc NULL
+dr dtrans : unotools offapi offuh rdbmaker stoc LIBXSLT:libxslt NULL
dr dtrans usr1 - all dr_mkout NULL
dr dtrans\inc nmake - all dr_inc NULL
dr dtrans\source\cnttype nmake - all dr_cnttype dr_generic dr_inc NULL
diff --git a/dtrans/prj/d.lst b/dtrans/prj/d.lst
index a1a7c2e95480..955aa075f24b 100644
--- a/dtrans/prj/d.lst
+++ b/dtrans/prj/d.lst
@@ -7,3 +7,8 @@
..\source\win32\ftransl\ftransl.xml %_DEST%\xml%_EXT%\ftransl.xml
..\source\cnttype\mcnttype.xml %_DEST%\xml%_EXT%\mcnttype.xml
..\source\generic\dtrans.xml %_DEST%\xml%_EXT%\dtrans.xml
+..\%__SRC%\misc\dnd.component %_DEST%\xml%_EXT%\dnd.component
+..\%__SRC%\misc\dtrans.component %_DEST%\xml%_EXT%\dtrans.component
+..\%__SRC%\misc\ftransl.component %_DEST%\xml%_EXT%\ftransl.component
+..\%__SRC%\misc\mcnttype.component %_DEST%\xml%_EXT%\mcnttype.component
+..\%__SRC%\misc\sysdtrans.component %_DEST%\xml%_EXT%\sysdtrans.component
diff --git a/dtrans/source/cnttype/exports.dxp b/dtrans/source/cnttype/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/cnttype/exports.dxp
+++ b/dtrans/source/cnttype/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx
index 6b332f0f53d6..9aa350590bf0 100644
--- a/dtrans/source/cnttype/mctfentry.cxx
+++ b/dtrans/source/cnttype/mctfentry.cxx
@@ -100,35 +100,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-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( MIMECONTENTTYPEFACTORY_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/generic/dtrans.component b/dtrans/source/generic/dtrans.component
new file mode 100644
index 000000000000..69034f716907
--- /dev/null
+++ b/dtrans/source/generic/dtrans.component
@@ -0,0 +1,37 @@
+<?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.ClipboardManager">
+ <service name="com.sun.star.datatransfer.clipboard.ClipboardManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.clipboard.GenericClipboard">
+ <service name="com.sun.star.datatransfer.clipboard.GenericClipboard"/>
+ </implementation>
+</component>
diff --git a/dtrans/source/generic/dtrans.cxx b/dtrans/source/generic/dtrans.cxx
index 926e385749b8..4cf2f73d4c8e 100644
--- a/dtrans/source/generic/dtrans.cxx
+++ b/dtrans/source/generic/dtrans.cxx
@@ -54,43 +54,6 @@ void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvType
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM("/" CLIPBOARDMANAGER_IMPLEMENTATION_NAME "/UNO/SERVICES" )) ) );
-
- const Sequence< OUString > & rSNL = ClipboardManager_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- sal_Int32 nPos;
- for ( nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM("/" GENERIC_CLIPBOARD_IMPLEMENTATION_NAME "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL2 = GenericClipboard_getSupportedServiceNames();
- pArray = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return sal_False;
-}
-
-//==================================================================================================
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName,
void * pServiceManager,
diff --git a/dtrans/source/generic/exports.dxp b/dtrans/source/generic/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/dtrans/source/generic/exports.dxp
+++ b/dtrans/source/generic/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/generic/makefile.mk b/dtrans/source/generic/makefile.mk
index e015400c32d9..2518b86a2d92 100644
--- a/dtrans/source/generic/makefile.mk
+++ b/dtrans/source/generic/makefile.mk
@@ -65,3 +65,11 @@ DEF1EXPORTFILE= exports.dxp
.ENDIF # L10N_framework
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/dtrans.component
+
+$(MISC)/dtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dtrans.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dtrans.component
diff --git a/dtrans/source/os2/clipb/Os2Service.cxx b/dtrans/source/os2/clipb/Os2Service.cxx
index ddbdf6ecddaa..264d4230f237 100644
--- a/dtrans/source/os2/clipb/Os2Service.cxx
+++ b/dtrans/source/os2/clipb/Os2Service.cxx
@@ -58,28 +58,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( OS2_CLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
{
void* pRet = 0;
diff --git a/dtrans/source/os2/clipb/exports.dxp b/dtrans/source/os2/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/os2/clipb/exports.dxp
+++ b/dtrans/source/os2/clipb/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/clipb/exports.dxp b/dtrans/source/win32/clipb/exports.dxp
index f72beb0fcb31..926e49f5f1a5 100644
--- a/dtrans/source/win32/clipb/exports.dxp
+++ b/dtrans/source/win32/clipb/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx
index 579872c8eead..16c6bba65c94 100644
--- a/dtrans/source/win32/clipb/wcbentry.cxx
+++ b/dtrans/source/win32/clipb/wcbentry.cxx
@@ -98,35 +98,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-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( WINCLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx
index 34bc550d46c3..05de69261094 100644
--- a/dtrans/source/win32/dnd/dndentry.cxx
+++ b/dtrans/source/win32/dnd/dndentry.cxx
@@ -73,39 +73,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-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( DNDSOURCE_REGKEY_NAME ) ) );
- bRetVal = sal_True;
-
- pXNewKey= static_cast< XRegistryKey* >( pRegistryKey );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( DNDTARGET_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/source/win32/dnd/exports.dxp b/dtrans/source/win32/dnd/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/dnd/exports.dxp
+++ b/dtrans/source/win32/dnd/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx
index a8360095683b..bdbf09546a9c 100644..100755
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -348,6 +348,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor
byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile );
else if (CF_HDROP == aFormatEtc.getClipformat())
byteStream = CF_HDROPToFileList(stgmedium.hGlobal);
+ else if ( CF_BITMAP == aFormatEtc.getClipformat() )
+ {
+ byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap);
+ if( aFormatEtc.getTymed() == TYMED_GDI &&
+ ! stgmedium.pUnkForRelease )
+ {
+ DeleteObject(stgmedium.hBitmap);
+ }
+ }
else
{
clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream );
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index 7fd23567d16b..677d382df729 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -535,4 +535,47 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal)
return FileListToByteSequence(files);
}
+//------------------------------------------------------------------------
+// convert a windows bitmap handle into a openoffice bitmap
+//------------------------------------------------------------------------
+
+Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP )
+{
+ Sequence< sal_Int8 > ooBmpStream;
+
+ SIZE aBmpSize;
+ if( GetBitmapDimensionEx( aHBMP, &aBmpSize ) )
+ {
+ // fill bitmap info header
+ size_t nDataBytes = 4 * aBmpSize.cy * aBmpSize.cy;
+ Sequence< sal_Int8 > aBitmapStream(
+ sizeof(BITMAPINFO) +
+ nDataBytes
+ );
+ PBITMAPINFOHEADER pBmp = (PBITMAPINFOHEADER)aBitmapStream.getArray();
+ pBmp->biSize = sizeof( BITMAPINFOHEADER );
+ pBmp->biWidth = aBmpSize.cx;
+ pBmp->biHeight = aBmpSize.cy;
+ pBmp->biPlanes = 1;
+ pBmp->biBitCount = 32;
+ pBmp->biCompression = BI_RGB;
+ pBmp->biSizeImage = (DWORD)nDataBytes;
+ pBmp->biXPelsPerMeter = 1000;
+ pBmp->biYPelsPerMeter = 1000;
+ pBmp->biClrUsed = 0;
+ pBmp->biClrImportant = 0;
+ if( GetDIBits( 0, // DC, 0 is a default GC, basically that of the desktop
+ aHBMP,
+ 0, aBmpSize.cy,
+ aBitmapStream.getArray() + sizeof(BITMAPINFO),
+ (LPBITMAPINFO)pBmp,
+ DIB_RGB_COLORS ) )
+ {
+ ooBmpStream = WinDIBToOOBMP( aBitmapStream );
+ }
+ }
+
+ return ooBmpStream;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/dtrans/source/win32/dtobj/FmtFilter.hxx
index 0e91710729fc..a484a4d3df65 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.hxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.hxx
@@ -66,6 +66,12 @@ com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const com::sun
/*------------------------------------------------------------------------
input:
+ aWinDIB - sequence of bytes containing a windows bitmap handle
+------------------------------------------------------------------------*/
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP );
+
+/*------------------------------------------------------------------------
+ input:
aOOBmp - sequence of bytes containing a openoffice bitmap
------------------------------------------------------------------------*/
com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( com::sun::star::uno::Sequence< sal_Int8 >& aOOBmp );
diff --git a/dtrans/source/win32/ftransl/exports.dxp b/dtrans/source/win32/ftransl/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/source/win32/ftransl/exports.dxp
+++ b/dtrans/source/win32/ftransl/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index ca2d29448d7d..456510145ab5 100644..100755
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -278,6 +278,7 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable()
m_TranslTable.push_back(FormatEntry("application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", "DIF", CF_DIF, CPPUTYPE_DEFAULT));
// SOT_FORMAT_BITMAP
m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_DIB, CPPUTYPE_DEFAULT));
+ m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_BITMAP, CPPUTYPE_DEFAULT));
// SOT_FORMAT_STRING
m_TranslTable.push_back(FormatEntry("text/plain;charset=utf-16", "Unicode-Text", "", CF_UNICODETEXT, CppuType_String));
// Format Locale - for internal use
diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx
index 3d5bd247a199..b8491fbb0481 100644
--- a/dtrans/source/win32/ftransl/ftranslentry.cxx
+++ b/dtrans/source/win32/ftransl/ftranslentry.cxx
@@ -101,35 +101,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-------------------------------------------------------------------------
-// component_writeInfo - to register a UNO-Service
-// to register a UNO-Service use: regcomp -register -r *.rdb -c *.dll
-// to view the registry use: regview *.rdb /SERVICES/ServiceName
-// (you must use the full services name e.g. com.sun.star.frame.FilePicker
-//-------------------------------------------------------------------------
-
-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( REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/dtrans/util/dnd.component b/dtrans/util/dnd.component
new file mode 100644
index 000000000000..b56fe326f04f
--- /dev/null
+++ b/dtrans/util/dnd.component
@@ -0,0 +1,37 @@
+<?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>
+</component>
diff --git a/dtrans/util/exports.dxp b/dtrans/util/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/dtrans/util/exports.dxp
+++ b/dtrans/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/dtrans/util/ftransl.component b/dtrans/util/ftransl.component
new file mode 100644
index 000000000000..dad7d341cce7
--- /dev/null
+++ b/dtrans/util/ftransl.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.DataFormatTranslator">
+ <service name="com.sun.star.datatransfer.DataFormatTranslator"/>
+ </implementation>
+</component>
diff --git a/dtrans/util/makefile.mk b/dtrans/util/makefile.mk
index 0443c131ccb6..8df69bbf1d36 100644
--- a/dtrans/util/makefile.mk
+++ b/dtrans/util/makefile.mk
@@ -180,3 +180,32 @@ DEF3EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+ALLTAR : \
+ $(MISC)/dnd.component \
+ $(MISC)/ftransl.component \
+ $(MISC)/mcnttype.component \
+ $(MISC)/sysdtrans.component
+
+$(MISC)/dnd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dnd.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dnd.component
+
+$(MISC)/ftransl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ftransl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ftransl.component
+
+$(MISC)/mcnttype.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mcnttype.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mcnttype.component
+
+$(MISC)/sysdtrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sysdtrans.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sysdtrans.component
diff --git a/dtrans/util/mcnttype.component b/dtrans/util/mcnttype.component
new file mode 100644
index 000000000000..f5a937a7a77a
--- /dev/null
+++ b/dtrans/util/mcnttype.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.MimeCntTypeFactory">
+ <service name="com.sun.star.datatransfer.MimeContentTypeFactory"/>
+ </implementation>
+</component>
diff --git a/dtrans/util/sysdtrans.component b/dtrans/util/sysdtrans.component
new file mode 100644
index 000000000000..ec1807000b3f
--- /dev/null
+++ b/dtrans/util/sysdtrans.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.clipboard.ClipboardW32">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+</component>
diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h
index ddd149c5b809..a29e78b547ec 100644
--- a/i18npool/inc/i18npool/lang.h
+++ b/i18npool/inc/i18npool/lang.h
@@ -517,6 +517,11 @@ typedef unsigned short LanguageType;
#define LANGUAGE_USER_GIKUYU 0x0655
#define LANGUAGE_USER_RUSYN_UKRAINE 0x0656
#define LANGUAGE_USER_RUSYN_SLOVAKIA 0x8256 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_RUSYN_UKRAINE)) */
+#define LANGUAGE_USER_YIDDISH_US 0x083D /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_YIDDISH)) */
+#define LANGUAGE_USER_LIMBU 0x0657
+#define LANGUAGE_USER_LOJBAN 0x0658 /* no locale */
+#define LANGUAGE_USER_KABYLE 0x0659
+#define LANGUAGE_USER_HAITIAN 0x065A
#endif /* INCLUDED_I18NPOOL_LANG_H */
diff --git a/i18npool/inc/i18npool/paper.hxx b/i18npool/inc/i18npool/paper.hxx
index bfc0c59e10d3..ad95e0db8cc8 100644
--- a/i18npool/inc/i18npool/paper.hxx
+++ b/i18npool/inc/i18npool/paper.hxx
@@ -35,6 +35,10 @@
#include <rtl/string.hxx>
#include <com/sun/star/lang/Locale.hpp>
+//!! WARNING: be aware of cui/source/tabpages/page.h where someone had the broken idea
+//!! of duplicating the values of this enum in order to use those defines within
+//!! src files.
+//!! Thus don't reorder the enum values here without changing the code there as well.
enum Paper
{
PAPER_A0,
@@ -117,6 +121,9 @@ enum Paper
PAPER_ARCHE
};
+// defined for 'equal size' test with the implementation array
+#define NUM_PAPER_ENTRIES (PAPER_ARCHE - PAPER_A0 + 1)
+
// ---------
// - Paper -
// ---------
diff --git a/i18npool/prj/build.lst b/i18npool/prj/build.lst
index 29caab0f90db..4e4dd4a03b0d 100644
--- a/i18npool/prj/build.lst
+++ b/i18npool/prj/build.lst
@@ -1,4 +1,4 @@
-inp i18npool : bridges sax stoc comphelper ICU:icu i18nutil regexp cpputools NULL
+inp i18npool : bridges sax stoc comphelper ICU:icu i18nutil regexp cpputools LIBXSLT:libxslt NULL
inp i18npool usr1 - all inp_mkout NULL
inp i18npool\inc nmake - all inp_inc NULL
inp i18npool\source\registerservices nmake - all inp_rserv inp_inc NULL
@@ -24,4 +24,4 @@ inp i18npool\source\textconversion\data nmake - all inp_textconv_dic
inp i18npool\source\search nmake - all inp_search inp_inc NULL
inp i18npool\source\ordinalsuffix nmake - all inp_ordinalsuffix NULL
inp i18npool\util nmake - all inp_util inp_brkit inp_dict inp_chclass inp_translit inp_cal inp_dnum inp_natnum inp_localedata inp_locdata_data inp_numformat inp_rserv inp_index inp_index_data inp_collator inp_collator_data inp_inputchecker inp_textconversion inp_textconv_dict inp_search inp_isolang inp_paper inp_ordinalsuffix NULL
-inp i18npool\qa\cppunit nmake - all inp_qa_cppunit inp_util NULL
+#FIXME (needs update for new component registration): inp i18npool\qa\cppunit nmake - all inp_qa_cppunit inp_util NULL
diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst
index 54aefa732b89..8d27137424a9 100644
--- a/i18npool/prj/d.lst
+++ b/i18npool/prj/d.lst
@@ -46,3 +46,5 @@ mkdir: %_DEST%\inc%_EXT%\i18npool
..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib%_EXT%\libi18npaper*.so
..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib%_EXT%\libi18npaper*.dylib
+..\%__SRC%\misc\i18npool.component %_DEST%\xml%_EXT%\i18npool.component
+..\%__SRC%\misc\i18nsearch.component %_DEST%\xml%_EXT%\i18nsearch.component
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index f80010825b93..8e7c02f9c34c 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -443,47 +443,39 @@ sal_Int16 SAL_CALL BreakIteratorImpl::getWordType( const OUString& /*Text*/,
return 0;
}
-static sal_Int16 scriptTypes[] = {
- ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN,
-// 15
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, ScriptType::COMPLEX,
- ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
-// 30
- ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 45
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 60
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN,
-// 75
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 90
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX,
-// 105
- ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN,
-// 120
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 135
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX,
- ScriptType::WEAK};
+typedef struct {
+ UBlockCode from;
+ UBlockCode to;
+ sal_Int16 script;
+} UBlock2Script;
+
+// for a list of the UBLOCK_... values see:
+// http://icu-project.org/apiref/icu4c/uchar_8h.html
+// where enum UBlockCode is defined.
+// See also http://www.unicode.org/charts/ for general reference
+static UBlock2Script scriptList[] = {
+ {UBLOCK_NO_BLOCK, UBLOCK_NO_BLOCK, ScriptType::WEAK},
+ {UBLOCK_BASIC_LATIN, UBLOCK_ARMENIAN, ScriptType::LATIN},
+ {UBLOCK_HEBREW, UBLOCK_MYANMAR, ScriptType::COMPLEX},
+ {UBLOCK_GEORGIAN, UBLOCK_GEORGIAN, ScriptType::LATIN},
+ {UBLOCK_HANGUL_JAMO, UBLOCK_HANGUL_JAMO, ScriptType::ASIAN},
+ {UBLOCK_ETHIOPIC, UBLOCK_ETHIOPIC, ScriptType::COMPLEX},
+ {UBLOCK_CHEROKEE, UBLOCK_RUNIC, ScriptType::LATIN},
+ {UBLOCK_KHMER, UBLOCK_MONGOLIAN, ScriptType::COMPLEX},
+ {UBLOCK_LATIN_EXTENDED_ADDITIONAL, UBLOCK_GREEK_EXTENDED, ScriptType::LATIN},
+ {UBLOCK_GENERAL_PUNCTUATION, UBLOCK_GENERAL_PUNCTUATION, ScriptType::LATIN},
+ {UBLOCK_CJK_RADICALS_SUPPLEMENT, UBLOCK_HANGUL_SYLLABLES, ScriptType::ASIAN},
+ {UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, ScriptType::ASIAN},
+ {UBLOCK_ARABIC_PRESENTATION_FORMS_A, UBLOCK_ARABIC_PRESENTATION_FORMS_A, ScriptType::COMPLEX},
+ {UBLOCK_CJK_COMPATIBILITY_FORMS, UBLOCK_CJK_COMPATIBILITY_FORMS, ScriptType::ASIAN},
+ {UBLOCK_ARABIC_PRESENTATION_FORMS_B, UBLOCK_ARABIC_PRESENTATION_FORMS_B, ScriptType::COMPLEX},
+ {UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, ScriptType::ASIAN},
+ {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, ScriptType::ASIAN},
+ {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES, ScriptType::ASIAN},
+ {UBLOCK_LATIN_EXTENDED_C, UBLOCK_LATIN_EXTENDED_D, ScriptType::LATIN}
+};
+
+#define scriptListCount SAL_N_ELEMENTS(scriptList)
sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
{
@@ -496,10 +488,21 @@ sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
if (script < 0)
nRet = ScriptType::WEAK;
- else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes))
- nRet = ScriptType::COMPLEX; // anything new is going to be pretty wild
- else
- nRet = scriptTypes[script];
+ // workaround for Coptic
+ else if ( 0x2C80 <= currentChar && 0x2CE3 >= currentChar)
+ nRet = ScriptType::LATIN;
+ // work-around for ligatures (see http://www.unicode.org/charts/PDF/UFB00.pdf)
+ else if ((0xFB00 <= currentChar && currentChar <= 0xFB06) ||
+ (0xFB13 <= currentChar && currentChar <= 0xFB17))
+ nRet = ScriptType::LATIN;
+ else {
+ UBlockCode block=ublock_getCode(currentChar);
+ sal_uInt16 i;
+ for ( i = 0; i < scriptListCount; i++) {
+ if (block <= scriptList[i].to) break;
+ }
+ nRet=(i < scriptListCount && block >= scriptList[i].from) ? scriptList[i].script : ScriptType::WEAK;
+ }
}
return nRet;
}
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index 1ffed4efac3a..5cd86d7857db 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -994,9 +994,11 @@ Calendar_gregorian::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16
sprintf(aStr, "%02d", value); // #100211# - checked
break;
case CalendarDisplayCode::SHORT_YEAR:
- // Take last 2 digits, or only one if vallue<10, for example,
+ // Take last 2 digits, or only one if value<10, for example,
// in case of the Gengou calendar.
- if (value < 100)
+ // #i116701# For values in non-Gregorian era years use all
+ // digits.
+ if (value < 100 || eraArray)
sprintf(aStr, "%d", value); // #100211# - checked
else
sprintf(aStr, "%02d", value % 100); // #100211# - checked
diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx
index 408688496971..fdb01a6d15f1 100644
--- a/i18npool/source/isolang/isolang.cxx
+++ b/i18npool/source/isolang/isolang.cxx
@@ -293,7 +293,6 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
// { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "ES" }, // In case MS format files escaped into the wild, map them back.
{ LANGUAGE_FRENCH_CAMEROON, "fr", "CM" },
{ LANGUAGE_FRENCH_COTE_D_IVOIRE, "fr", "CI" },
- { LANGUAGE_FRENCH_HAITI, "fr", "HT" },
{ LANGUAGE_FRENCH_MALI, "fr", "ML" },
{ LANGUAGE_FRENCH_SENEGAL, "fr", "SN" },
{ LANGUAGE_FRENCH_ZAIRE, "fr", "CD" }, // Democratic Republic Of Congo
@@ -354,6 +353,7 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
{ LANGUAGE_PAPIAMENTU, "pap", "AN" },
{ LANGUAGE_USER_PAPIAMENTU_ARUBA, "pap", "AW" },
{ LANGUAGE_ENGLISH_SINGAPORE, "en", "SG" },
+ { LANGUAGE_USER_YIDDISH_US, "yi", "US" },
{ LANGUAGE_YIDDISH, "yi", "IL" }, // new: old was "ji"
{ LANGUAGE_YIDDISH, "ji", "IL" }, // old: new is "yi"
{ LANGUAGE_SYRIAC, "syr", "TR" }, // "TR" according to http://www.ethnologue.com/show_language.asp?code=SYC
@@ -464,6 +464,11 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
{ LANGUAGE_USER_GIKUYU, "ki", "KE" },
{ LANGUAGE_USER_RUSYN_UKRAINE, "rue", "UA" },
{ LANGUAGE_USER_RUSYN_SLOVAKIA, "rue", "SK" },
+ { LANGUAGE_USER_LIMBU, "lif", "NP" },
+ { LANGUAGE_USER_LOJBAN, "jbo", "" },
+ { LANGUAGE_USER_KABYLE, "kab", "DZ" },
+ { LANGUAGE_USER_HAITIAN, "ht", "HT" },
+ { LANGUAGE_FRENCH_HAITI, "fr", "HT" },
{ LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information
{ LANGUAGE_DONTKNOW, "", "" } // marks end of table
};
@@ -688,6 +693,7 @@ static const MsLangId::IsoLangEntry & lcl_lookupFallbackEntry( LanguageType nLan
case LANGUAGE_BASQUE:
case LANGUAGE_USER_ESPERANTO:
case LANGUAGE_USER_INTERLINGUA:
+ case LANGUAGE_USER_LOJBAN:
return *pEntry;
default:
; // nothing
@@ -768,6 +774,7 @@ static const MsLangId::IsoLangEntry & lcl_lookupFallbackEntry(
case LANGUAGE_BASQUE:
case LANGUAGE_USER_ESPERANTO:
case LANGUAGE_USER_INTERLINGUA:
+ case LANGUAGE_USER_LOJBAN:
return *pEntry;
default:
; // nothing
diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx
index 5000e2981b96..c11d4d6d1387 100644
--- a/i18npool/source/isolang/mslangid.cxx
+++ b/i18npool/source/isolang/mslangid.cxx
@@ -340,6 +340,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
case LANGUAGE_FARSI:
case LANGUAGE_HEBREW:
case LANGUAGE_YIDDISH:
+ case LANGUAGE_USER_YIDDISH_US:
case LANGUAGE_MARATHI:
case LANGUAGE_PUNJABI:
case LANGUAGE_GUJARATI:
@@ -375,6 +376,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
case LANGUAGE_USER_DOGRI_INDIA:
case LANGUAGE_USER_MAITHILI_INDIA:
case LANGUAGE_UIGHUR_CHINA:
+ case LANGUAGE_USER_LIMBU:
nScript = ::com::sun::star::i18n::ScriptType::COMPLEX;
break;
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 57e01e5ab340..05f6156489a6 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -163,9 +163,11 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr
// printf(" name: '%s'\n", p->getName().pData->buffer );
// printf("value: '%s'\n", p->getValue().pData->buffer );
+#define OSTR(s) (OUStringToOString( (s), RTL_TEXTENCODING_UTF8).getStr())
+
void print_OUString( const OUString& s )
{
- printf( "%s", OUStringToOString( s, RTL_TEXTENCODING_UTF8).getStr());
+ printf( "%s", OSTR(s));
}
bool is_empty_string( const OUString& s )
@@ -266,16 +268,16 @@ void LocaleNode :: generateCode (const OFileWriter &of) const
fprintf( stderr, "Error: less than %ld character%s (%ld) in %s '%s'.\n",
sal::static_int_cast< long >(nMinLen), (nMinLen > 1 ? "s" : ""),
sal::static_int_cast< long >(nLen),
- (pNode ? OUStringToOString( pNode->getName(), RTL_TEXTENCODING_UTF8).getStr() : ""),
- OUStringToOString( aVal, RTL_TEXTENCODING_UTF8).getStr());
+ (pNode ? OSTR( pNode->getName()) : ""),
+ OSTR( aVal));
}
else if (nLen > nMaxLen && nMaxLen >= 0)
fprintf( stderr,
"Warning: more than %ld character%s (%ld) in %s %s not supported by application.\n",
sal::static_int_cast< long >(nMaxLen), (nMaxLen > 1 ? "s" : ""),
sal::static_int_cast< long >(nLen),
- (pNode ? OUStringToOString( pNode->getName(), RTL_TEXTENCODING_UTF8).getStr() : ""),
- OUStringToOString( aVal, RTL_TEXTENCODING_UTF8).getStr());
+ (pNode ? OSTR( pNode->getName()) : ""),
+ OSTR( aVal));
return aVal;
}
@@ -306,7 +308,7 @@ void LocaleNode::incError( const char* pStr ) const
void LocaleNode::incError( const ::rtl::OUString& rStr ) const
{
- incError( OUStringToOString( rStr, RTL_TEXTENCODING_UTF8).getStr());
+ incError( OSTR( rStr));
}
char* LocaleNode::prepareErrorFormat( const char* pFormat, const char* pDefaultConversion ) const
@@ -332,8 +334,7 @@ void LocaleNode::incErrorInt( const char* pStr, int nVal ) const
void LocaleNode::incErrorStr( const char* pStr, const ::rtl::OUString& rVal ) const
{
++nError;
- fprintf( stderr, prepareErrorFormat( pStr, ": %s"), OUStringToOString(
- rVal, RTL_TEXTENCODING_UTF8).getStr());
+ fprintf( stderr, prepareErrorFormat( pStr, ": %s"), OSTR( rVal));
}
void LCInfoNode::generateCode (const OFileWriter &of) const
@@ -501,6 +502,64 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
if (aQuoteEnd == aDoubleQuoteEnd)
fprintf( stderr, "Warning: %s\n",
"QuotationEnd equals DoubleQuotationEnd. Not necessarily an error, but unusual.");
+ // Known good values, exclude ASCII single (U+0027, ') and double (U+0022, ") quotes.
+ int ic;
+ switch (ic = aQuoteStart.toChar())
+ {
+ case 0x2018: // LEFT SINGLE QUOTATION MARK
+ case 0x201a: // SINGLE LOW-9 QUOTATION MARK
+ case 0x201b: // SINGLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x2039: // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ case 0x203a: // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ case 0x300c: // LEFT CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "QuotationStart may be wrong:", ic, OSTR( aQuoteStart));
+ }
+ switch (ic = aQuoteEnd.toChar())
+ {
+ case 0x2019: // RIGHT SINGLE QUOTATION MARK
+ case 0x201a: // SINGLE LOW-9 QUOTATION MARK
+ case 0x201b: // SINGLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x2039: // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ case 0x203a: // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ case 0x300d: // RIGHT CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "QuotationEnd may be wrong:", ic, OSTR( aQuoteEnd));
+ }
+ switch (ic = aDoubleQuoteStart.toChar())
+ {
+ case 0x00ab: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x00bb: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x201c: // LEFT DOUBLE QUOTATION MARK
+ case 0x201e: // DOUBLE LOW-9 QUOTATION MARK
+ case 0x201f: // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x300e: // LEFT WHITE CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "DoubleQuotationStart may be wrong:", ic, OSTR( aDoubleQuoteStart));
+ }
+ switch (ic = aDoubleQuoteEnd.toChar())
+ {
+ case 0x00ab: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x00bb: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x201d: // RIGHT DOUBLE QUOTATION MARK
+ case 0x201e: // DOUBLE LOW-9 QUOTATION MARK
+ case 0x201f: // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x300f: // RIGHT WHITE CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "DoubleQuotationEnd may be wrong:", ic, OSTR( aDoubleQuoteEnd));
+ }
writeParameterCheckLen( of, "TimeAM", "timeAM", 1, -1);
writeParameterCheckLen( of, "TimePM", "timePM", 1, -1);
@@ -640,7 +699,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
fprintf( stderr,
"Warning: Can't check separators used in FormatCode due to LC_CTYPE ref=\"%s\".\n"
"If these two locales use identical format codes, you should consider to use the ref= mechanism also for the LC_FORMAT element, together with replaceFrom= and replaceTo= for the currency.\n",
- OUStringToOString( aRef, RTL_TEXTENCODING_UTF8).getStr());
+ OSTR( aRef));
bCtypeIsRef = true;
pCtype = 0;
}
diff --git a/i18npool/source/localedata/data/dsb_DE.xml b/i18npool/source/localedata/data/dsb_DE.xml
new file mode 100644
index 000000000000..fe953ec807c1
--- /dev/null
+++ b/i18npool/source/localedata/data/dsb_DE.xml
@@ -0,0 +1,350 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>dsb</LangID>
+ <DefaultName>Sorbian, Lower</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>DE</CountryID>
+ <DefaultName>Germany</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>.</DateSeparator>
+ <ThousandSeparator>&#160;</ThousandSeparator><!-- a non-breaking space (U+00A0) as a thousand separator; alternatively, there could be no separator at all -->
+ <DecimalSeparator>,</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>,</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>. </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‚</QuotationStart>
+ <QuotationEnd>‘</QuotationEnd>
+ <DoubleQuotationStart>„</DoubleQuotationStart>
+ <DoubleQuotationEnd>“</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>dopołdnja</TimeAM>
+ <TimePM>wótpołdnja</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-82E]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>Standard</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode># ##0</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode># ##0,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode># ###,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0,00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0,00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0,00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode># ##0 [CURRENCY];-# ##0 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode># ##0,00 [CURRENCY];-# ##0,00 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode># ##0 [CURRENCY];[RED]-# ##0 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode># ##0,00 [CURRENCY];[RED]-# ##0,00 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC# ##0,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode># ##0,-- [CURRENCY];[RED]-# ##0,-- [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D.MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNND. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD.MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD.MM.YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D. MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D. MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D. MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM.DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>D. MMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>H:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>H:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>H:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>H:MM:SS AM/PM</FormatCode><!-- with commonly used 24-hour time, the AM/PM indicator is not needed -->
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[H]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[H]:MM:SS,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD.MM.YY H:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD.MM.YYYY H:MM:SS AM/PM</FormatCode><!-- with commonly used 24-hour time, the AM/PM indicator is useless (and also never used) -->
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey unoid="alphanumeric" default="true" phonetic="false">A-C Č Ć D E Ě F-H {Ch} I-K Ł L-N Ń O Ó P-R Ŕ S Š Ś T-Z Ž Ź</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <UnicodeScript>2</UnicodeScript>
+ <FollowPageWord>bok</FollowPageWord><!-- there's no conventional abbreviation -->
+ <FollowPageWord>boki</FollowPageWord><!-- there's no conventional abbreviation -->
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>nje.</DefaultAbbrvName>
+ <DefaultFullName>njeźela</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>pón.</DefaultAbbrvName>
+ <DefaultFullName>pónjeźela</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>wał.</DefaultAbbrvName>
+ <DefaultFullName>wałtora</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>srj.</DefaultAbbrvName>
+ <DefaultFullName>srjoda</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>stw.</DefaultAbbrvName>
+ <DefaultFullName>stwórtk</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>pět.</DefaultAbbrvName>
+ <DefaultFullName>pětk</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>sob.</DefaultAbbrvName>
+ <DefaultFullName>sobota</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>jan.</DefaultAbbrvName>
+ <DefaultFullName>januar</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>feb.</DefaultAbbrvName>
+ <DefaultFullName>februar</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>měr.</DefaultAbbrvName>
+ <DefaultFullName>měrc</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>apr.</DefaultAbbrvName>
+ <DefaultFullName>apryl</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>maj</DefaultAbbrvName>
+ <DefaultFullName>maj</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>jun.</DefaultAbbrvName>
+ <DefaultFullName>junij</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>jul.</DefaultAbbrvName>
+ <DefaultFullName>julij</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>awg.</DefaultAbbrvName>
+ <DefaultFullName>awgust</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>sep.</DefaultAbbrvName>
+ <DefaultFullName>september</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>okt.</DefaultAbbrvName>
+ <DefaultFullName>oktober</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>now.</DefaultAbbrvName>
+ <DefaultFullName>nowember</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>dec.</DefaultAbbrvName>
+ <DefaultFullName>december</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>pś. Kr.</DefaultAbbrvName>
+ <DefaultFullName>pśed Kristusom</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>pó Kr.</DefaultAbbrvName>
+ <DefaultFullName>pó Kristusu</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>4</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>EUR</CurrencyID>
+ <CurrencySymbol>€</CurrencySymbol>
+ <BankSymbol>EUR</BankSymbol>
+ <CurrencyName>euro</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>wěrno</trueWord>
+ <falseWord>njewěrno</falseWord>
+ <quarter1Word>prědny kwartal</quarter1Word>
+ <quarter2Word>drugi kwartal</quarter2Word>
+ <quarter3Word>tśeśi kwartal</quarter3Word>
+ <quarter4Word>stwórty kwartal</quarter4Word>
+ <aboveWord>nad</aboveWord>
+ <belowWord>pód</belowWord>
+ <quarter1Abbreviation>K1</quarter1Abbreviation>
+ <quarter2Abbreviation>K2</quarter2Abbreviation>
+ <quarter3Abbreviation>K3</quarter3Abbreviation>
+ <quarter4Abbreviation>K4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel ref="en_US"/>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/fi_FI.xml b/i18npool/source/localedata/data/fi_FI.xml
index 432d5f155423..1f7747d8b97a 100644
--- a/i18npool/source/localedata/data/fi_FI.xml
+++ b/i18npool/source/localedata/data/fi_FI.xml
@@ -179,7 +179,7 @@
<LC_COLLATION ref="en_US" />
<LC_SEARCH ref="en_US"/>
<LC_INDEX>
- <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-V X-Z Ä Ö</IndexKey>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z Ä Ö</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>p.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/haw_US.xml b/i18npool/source/localedata/data/haw_US.xml
new file mode 100644
index 000000000000..b9fd553e24ef
--- /dev/null
+++ b/i18npool/source/localedata/data/haw_US.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>haw</LangID>
+ <DefaultName>Hawaiian</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>US</CountryID>
+ <DefaultName>United States</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator> </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>AM</TimeAM>
+ <TimePM>PM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$$-475]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;([CURRENCY]#,##0)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;([CURRENCY]#,##0.00)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]([CURRENCY]#,##0)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]([CURRENCY]#,##0.00)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]([CURRENCY]#,##0.--)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>YYYY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>YY/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>YY/MM/DD HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>YYYY/MM/DD HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A E I O U H K L M N P W</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>p.</FollowPageWord>
+ <FollowPageWord>pp.</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>LP</DefaultAbbrvName>
+ <DefaultFullName>Lāpule</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>P1</DefaultAbbrvName>
+ <DefaultFullName>Poʻakahi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>P2</DefaultAbbrvName>
+ <DefaultFullName>Poʻalua</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>P3</DefaultAbbrvName>
+ <DefaultFullName>Poʻakolu</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>P4</DefaultAbbrvName>
+ <DefaultFullName>Poʻahā</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>P5</DefaultAbbrvName>
+ <DefaultFullName>Poʻalima</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>P6</DefaultAbbrvName>
+ <DefaultFullName>Poʻaono</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>Ian.</DefaultAbbrvName>
+ <DefaultFullName>Ianuali</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>Pep.</DefaultAbbrvName>
+ <DefaultFullName>Pepeluali</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>Mal.</DefaultAbbrvName>
+ <DefaultFullName>Malaki</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>ʻAp.</DefaultAbbrvName>
+ <DefaultFullName>ʻApelila</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>Mei</DefaultAbbrvName>
+ <DefaultFullName>Mei</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>Iun.</DefaultAbbrvName>
+ <DefaultFullName>Iune</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>Iul.</DefaultAbbrvName>
+ <DefaultFullName>Iulai</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>ʻAuk.</DefaultAbbrvName>
+ <DefaultFullName>ʻAukake</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>Kep.</DefaultAbbrvName>
+ <DefaultFullName>Kepakemapa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>ʻOk.</DefaultAbbrvName>
+ <DefaultFullName>ʻOkakopa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>Now.</DefaultAbbrvName>
+ <DefaultFullName>Nowemapa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>Kek.</DefaultAbbrvName>
+ <DefaultFullName>Kekemapa</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>BC</DefaultAbbrvName>
+ <DefaultFullName>BC</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>CE</DefaultAbbrvName>
+ <DefaultFullName>CE</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>USD</CurrencyID>
+ <CurrencySymbol>$</CurrencySymbol>
+ <BankSymbol>USD</BankSymbol>
+ <CurrencyName>Kālā ʻAmelika</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>ʻOiaʻiʻo</trueWord>
+ <falseWord>Hewa</falseWord>
+ <quarter1Word>Kau Hapahā 1</quarter1Word>
+ <quarter2Word>Kau Hapaha 2</quarter2Word>
+ <quarter3Word>Kau Hapahā 3</quarter3Word>
+ <quarter4Word>Kau Hapahā 4</quarter4Word>
+ <aboveWord>Luna</aboveWord>
+ <belowWord>Lalo</belowWord>
+ <quarter1Abbreviation>KH1</quarter1Abbreviation>
+ <quarter2Abbreviation>KH2</quarter2Abbreviation>
+ <quarter3Abbreviation>KH3</quarter3Abbreviation>
+ <quarter4Abbreviation>KH4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/hsb_DE.xml b/i18npool/source/localedata/data/hsb_DE.xml
index 6513dad5f57e..1e4c70a26fd3 100644
--- a/i18npool/source/localedata/data/hsb_DE.xml
+++ b/i18npool/source/localedata/data/hsb_DE.xml
@@ -34,7 +34,7 @@
<TimePM>popołdnju</TimePM>
<MeasurementSystem>metric</MeasurementSystem>
</LC_CTYPE>
- <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-042E]">
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-42E]">
<FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
<FormatCode>Standard</FormatCode>
</FormatElement>
diff --git a/i18npool/source/localedata/data/ht_HT.xml b/i18npool/source/localedata/data/ht_HT.xml
new file mode 100644
index 000000000000..99109c72a909
--- /dev/null
+++ b/i18npool/source/localedata/data/ht_HT.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>ht</LangID>
+ <DefaultName>Haitian Creole</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>HT</CountryID>
+ <DefaultName>Haiti</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>AM</TimeAM>
+ <TimePM>PM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$G-65A]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>s</FollowPageWord>
+ <FollowPageWord>pl</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>Dim</DefaultAbbrvName>
+ <DefaultFullName>Dimanch</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>Len</DefaultAbbrvName>
+ <DefaultFullName>Lendi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>Mad</DefaultAbbrvName>
+ <DefaultFullName>Madi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>Mèk</DefaultAbbrvName>
+ <DefaultFullName>Mèkredi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>Jed</DefaultAbbrvName>
+ <DefaultFullName>Jedi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>Van</DefaultAbbrvName>
+ <DefaultFullName>Vandredi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>Sam</DefaultAbbrvName>
+ <DefaultFullName>Samdi</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>Jan</DefaultAbbrvName>
+ <DefaultFullName>Janvye</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>Fev</DefaultAbbrvName>
+ <DefaultFullName>Fevriye</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>Mas</DefaultAbbrvName>
+ <DefaultFullName>Mas</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>Avr</DefaultAbbrvName>
+ <DefaultFullName>Avril</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>Me</DefaultAbbrvName>
+ <DefaultFullName>Me</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>Jen</DefaultAbbrvName>
+ <DefaultFullName>Jen</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>Jiy</DefaultAbbrvName>
+ <DefaultFullName>Jiyè</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>Dao</DefaultAbbrvName>
+ <DefaultFullName>Daout</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>Sep</DefaultAbbrvName>
+ <DefaultFullName>Septanm</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>Okt</DefaultAbbrvName>
+ <DefaultFullName>Oktòb</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>Nov</DefaultAbbrvName>
+ <DefaultFullName>Novanm</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>Des</DefaultAbbrvName>
+ <DefaultFullName>Desanm</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>AJ</DefaultAbbrvName>
+ <DefaultFullName>Avan Jezikri</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>AP</DefaultAbbrvName>
+ <DefaultFullName>Apre Jezikri</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>HTG</CurrencyID>
+ <CurrencySymbol>G</CurrencySymbol>
+ <BankSymbol>HTG</BankSymbol>
+ <CurrencyName>Goud</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>Vre</trueWord>
+ <falseWord>Fo</falseWord>
+ <quarter1Word>Trimès 1</quarter1Word>
+ <quarter2Word>Trimès 2</quarter2Word>
+ <quarter3Word>Trimès 3</quarter3Word>
+ <quarter4Word>Trimès 4</quarter4Word>
+ <aboveWord>Anwo</aboveWord>
+ <belowWord>Anba</belowWord>
+ <quarter1Abbreviation>Trimès 1</quarter1Abbreviation>
+ <quarter2Abbreviation>Trimès 2</quarter2Abbreviation>
+ <quarter3Abbreviation>Trimès 3</quarter3Abbreviation>
+ <quarter4Abbreviation>Trimès 4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/jbo.xml b/i18npool/source/localedata/data/jbo.xml
new file mode 100644
index 000000000000..403442638bd0
--- /dev/null
+++ b/i18npool/source/localedata/data/jbo.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>jbo</LangID>
+ <DefaultName>Lojban</DefaultName>
+ </Language>
+ <Country>
+ <CountryID></CountryID>
+ <DefaultName></DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>PDM</TimeAM>
+ <TimePM>BDM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-658]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>DD/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>BP</FollowPageWord>
+ <FollowPageWord>BP</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>nondei</DefaultAbbrvName>
+ <DefaultFullName>nondei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>pavdei</DefaultAbbrvName>
+ <DefaultFullName>pavdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>reldei</DefaultAbbrvName>
+ <DefaultFullName>reldei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>cibdei</DefaultAbbrvName>
+ <DefaultFullName>cibdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>vondei</DefaultAbbrvName>
+ <DefaultFullName>vondei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>mumdei</DefaultAbbrvName>
+ <DefaultFullName>mumdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>xavdei</DefaultAbbrvName>
+ <DefaultFullName>xavdei</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>pavma'i</DefaultAbbrvName>
+ <DefaultFullName>pavmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>relma'i</DefaultAbbrvName>
+ <DefaultFullName>relmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>cibma'i</DefaultAbbrvName>
+ <DefaultFullName>cibmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>vonma'i</DefaultAbbrvName>
+ <DefaultFullName>vonmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>mumyma'i</DefaultAbbrvName>
+ <DefaultFullName>mumymasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>xavma'i</DefaultAbbrvName>
+ <DefaultFullName>xavmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>zelma'i</DefaultAbbrvName>
+ <DefaultFullName>zelmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>bivma'i</DefaultAbbrvName>
+ <DefaultFullName>bivmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>sozma'i</DefaultAbbrvName>
+ <DefaultFullName>sozmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>daurma'i</DefaultAbbrvName>
+ <DefaultFullName>daurmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>feirma'i</DefaultAbbrvName>
+ <DefaultFullName>feirmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>gairma'i</DefaultAbbrvName>
+ <DefaultFullName>gairmasti</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>PLK</DefaultAbbrvName>
+ <DefaultFullName>purci la .kraist.</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>NLK</DefaultAbbrvName>
+ <DefaultFullName>nanca la .kraist.</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>EUR</CurrencyID>
+ <CurrencySymbol>€</CurrencySymbol>
+ <BankSymbol>EUR</BankSymbol>
+ <CurrencyName>jdini</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>jetnu</trueWord>
+ <falseWord>jitfa</falseWord>
+ <quarter1Word>pa moi vo si'e</quarter1Word>
+ <quarter2Word>re moi vo si'e</quarter2Word>
+ <quarter3Word>ci moi vo si'e</quarter3Word>
+ <quarter4Word>vo moi vo si'e</quarter4Word>
+ <aboveWord>gapru</aboveWord>
+ <belowWord>cnita</belowWord>
+ <quarter1Abbreviation>1MVS</quarter1Abbreviation>
+ <quarter2Abbreviation>2MVS</quarter2Abbreviation>
+ <quarter3Abbreviation>3MVS</quarter3Abbreviation>
+ <quarter4Abbreviation>4MVS</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/lif_NP.xml b/i18npool/source/localedata/data/lif_NP.xml
new file mode 100644
index 000000000000..fadbfad11ff3
--- /dev/null
+++ b/i18npool/source/localedata/data/lif_NP.xml
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>lif</LangID>
+ <DefaultName>Limbu</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>NP</CountryID>
+ <DefaultName>Nepal</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>पूर्वान्ह</TimeAM>
+ <TimePM>अपरान्ह</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$रू-657]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY] #,##0;-[CURRENCY] #,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY] #,##0.00;-[CURRENCY] #,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY] #,##0;[RED]-[CURRENCY] #,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY] #,##0.00;[RED]-[CURRENCY] #,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY] #,##0.--;[RED]-[CURRENCY] #,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>YYYY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>YY/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>YY/MM/DD HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>YYYY/MM/DD HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">ᤁ-ᤜ</IndexKey>
+ <UnicodeScript>85</UnicodeScript>
+ <FollowPageWord>p.</FollowPageWord>
+ <FollowPageWord>pp.</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>ᤋᤧᤏᤧᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤋᤧᤏᤧᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>ᤑᤥᤖᤠᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤑᤥᤖᤠᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>ᤔᤡᤰᤜᤠᤱᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤔᤡᤰᤜᤠᤱᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>ᤂᤧᤰᤛᤢᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤂᤧᤰᤛᤢᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>ᤁᤢᤖᤢ᤺ᤵᤐᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤁᤢᤖᤢ᤺ᤵᤐᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>ᤑᤛᤢ᤺ᤵᤐᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤑᤛᤢ᤺ᤵᤐᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>ᤛᤧᤴᤇᤪᤧᤱᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤛᤧᤴᤇᤪᤧᤱᤒᤠ</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>जन</DefaultAbbrvName>
+ <DefaultFullName>जनवरी</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>फेब</DefaultAbbrvName>
+ <DefaultFullName>फेब्रुअरी</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>मार्च</DefaultAbbrvName>
+ <DefaultFullName>मार्च</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>अप्रि</DefaultAbbrvName>
+ <DefaultFullName>अप्रिल</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>मे</DefaultAbbrvName>
+ <DefaultFullName>मे</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>जुन</DefaultAbbrvName>
+ <DefaultFullName>जुन</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>जुला</DefaultAbbrvName>
+ <DefaultFullName>जुलाई</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>अग</DefaultAbbrvName>
+ <DefaultFullName>अगस्त</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>सेप्ट</DefaultAbbrvName>
+ <DefaultFullName>सेप्टेम्बर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>अक्टो</DefaultAbbrvName>
+ <DefaultFullName>अक्टोबर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>नोभे</DefaultAbbrvName>
+ <DefaultFullName>नोभेम्बर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>डिसे</DefaultAbbrvName>
+ <DefaultFullName>डिसेम्बर</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>ईसापूर्व</DefaultAbbrvName>
+ <DefaultFullName>ईसापूर्व</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>सन्</DefaultAbbrvName>
+ <DefaultFullName>सन्</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>NPR</CurrencyID>
+ <CurrencySymbol>रू</CurrencySymbol>
+ <BankSymbol>NPR</BankSymbol>
+ <CurrencyName>Nepalese Rupee</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>ठीक</trueWord>
+ <falseWord>बेठीक</falseWord>
+ <quarter1Word>पहिलो सत्र</quarter1Word>
+ <quarter2Word>दोस्रो सत्र</quarter2Word>
+ <quarter3Word>तेस्रो सत्र</quarter3Word>
+ <quarter4Word>चौथो सत्र</quarter4Word>
+ <aboveWord>माथि</aboveWord>
+ <belowWord>तल</belowWord>
+ <quarter1Abbreviation>Q1</quarter1Abbreviation>
+ <quarter2Abbreviation>Q2</quarter2Abbreviation>
+ <quarter3Abbreviation>Q3</quarter3Abbreviation>
+ <quarter4Abbreviation>Q4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="12" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="12" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="12" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="12" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/localedata_euro.map b/i18npool/source/localedata/data/localedata_euro.map
index e0564b85ea25..b9dd20c724d7 100644
--- a/i18npool/source/localedata/data/localedata_euro.map
+++ b/i18npool/source/localedata/data/localedata_euro.map
@@ -16,6 +16,7 @@ getAllCalendars_de_CH;
getAllCalendars_de_DE;
getAllCalendars_de_LI;
getAllCalendars_de_LU;
+getAllCalendars_dsb_DE;
getAllCalendars_el_GR;
getAllCalendars_et_EE;
getAllCalendars_eu;
@@ -86,6 +87,7 @@ getAllCurrencies_de_CH;
getAllCurrencies_de_DE;
getAllCurrencies_de_LI;
getAllCurrencies_de_LU;
+getAllCurrencies_dsb_DE;
getAllCurrencies_el_GR;
getAllCurrencies_et_EE;
getAllCurrencies_eu;
@@ -156,6 +158,7 @@ getAllFormats0_de_CH;
getAllFormats0_de_DE;
getAllFormats0_de_LI;
getAllFormats0_de_LU;
+getAllFormats0_dsb_DE;
getAllFormats0_el_GR;
getAllFormats0_et_EE;
getAllFormats0_eu;
@@ -226,6 +229,7 @@ getBreakIteratorRules_de_CH;
getBreakIteratorRules_de_DE;
getBreakIteratorRules_de_LI;
getBreakIteratorRules_de_LU;
+getBreakIteratorRules_dsb_DE;
getBreakIteratorRules_el_GR;
getBreakIteratorRules_et_EE;
getBreakIteratorRules_eu;
@@ -296,6 +300,7 @@ getCollationOptions_de_CH;
getCollationOptions_de_DE;
getCollationOptions_de_LI;
getCollationOptions_de_LU;
+getCollationOptions_dsb_DE;
getCollationOptions_el_GR;
getCollationOptions_et_EE;
getCollationOptions_eu;
@@ -366,6 +371,7 @@ getCollatorImplementation_de_CH;
getCollatorImplementation_de_DE;
getCollatorImplementation_de_LI;
getCollatorImplementation_de_LU;
+getCollatorImplementation_dsb_DE;
getCollatorImplementation_el_GR;
getCollatorImplementation_et_EE;
getCollatorImplementation_eu;
@@ -436,6 +442,7 @@ getContinuousNumberingLevels_de_CH;
getContinuousNumberingLevels_de_DE;
getContinuousNumberingLevels_de_LI;
getContinuousNumberingLevels_de_LU;
+getContinuousNumberingLevels_dsb_DE;
getContinuousNumberingLevels_el_GR;
getContinuousNumberingLevels_et_EE;
getContinuousNumberingLevels_eu;
@@ -506,6 +513,7 @@ getFollowPageWords_de_CH;
getFollowPageWords_de_DE;
getFollowPageWords_de_LI;
getFollowPageWords_de_LU;
+getFollowPageWords_dsb_DE;
getFollowPageWords_el_GR;
getFollowPageWords_et_EE;
getFollowPageWords_eu;
@@ -576,6 +584,7 @@ getForbiddenCharacters_de_CH;
getForbiddenCharacters_de_DE;
getForbiddenCharacters_de_LI;
getForbiddenCharacters_de_LU;
+getForbiddenCharacters_dsb_DE;
getForbiddenCharacters_el_GR;
getForbiddenCharacters_et_EE;
getForbiddenCharacters_eu;
@@ -646,6 +655,7 @@ getIndexAlgorithm_de_CH;
getIndexAlgorithm_de_DE;
getIndexAlgorithm_de_LI;
getIndexAlgorithm_de_LU;
+getIndexAlgorithm_dsb_DE;
getIndexAlgorithm_el_GR;
getIndexAlgorithm_et_EE;
getIndexAlgorithm_eu;
@@ -716,6 +726,7 @@ getLCInfo_de_CH;
getLCInfo_de_DE;
getLCInfo_de_LI;
getLCInfo_de_LU;
+getLCInfo_dsb_DE;
getLCInfo_el_GR;
getLCInfo_et_EE;
getLCInfo_eu;
@@ -786,6 +797,7 @@ getLocaleItem_de_CH;
getLocaleItem_de_DE;
getLocaleItem_de_LI;
getLocaleItem_de_LU;
+getLocaleItem_dsb_DE;
getLocaleItem_el_GR;
getLocaleItem_et_EE;
getLocaleItem_eu;
@@ -856,6 +868,7 @@ getOutlineNumberingLevels_de_CH;
getOutlineNumberingLevels_de_DE;
getOutlineNumberingLevels_de_LI;
getOutlineNumberingLevels_de_LU;
+getOutlineNumberingLevels_dsb_DE;
getOutlineNumberingLevels_el_GR;
getOutlineNumberingLevels_et_EE;
getOutlineNumberingLevels_eu;
@@ -926,6 +939,7 @@ getReservedWords_de_CH;
getReservedWords_de_DE;
getReservedWords_de_LI;
getReservedWords_de_LU;
+getReservedWords_dsb_DE;
getReservedWords_el_GR;
getReservedWords_et_EE;
getReservedWords_eu;
@@ -996,6 +1010,7 @@ getSearchOptions_de_CH;
getSearchOptions_de_DE;
getSearchOptions_de_LI;
getSearchOptions_de_LU;
+getSearchOptions_dsb_DE;
getSearchOptions_el_GR;
getSearchOptions_et_EE;
getSearchOptions_eu;
@@ -1066,6 +1081,7 @@ getTransliterations_de_CH;
getTransliterations_de_DE;
getTransliterations_de_LI;
getTransliterations_de_LU;
+getTransliterations_dsb_DE;
getTransliterations_el_GR;
getTransliterations_et_EE;
getTransliterations_eu;
@@ -1136,6 +1152,7 @@ getUnicodeScripts_de_CH;
getUnicodeScripts_de_DE;
getUnicodeScripts_de_LI;
getUnicodeScripts_de_LU;
+getUnicodeScripts_dsb_DE;
getUnicodeScripts_el_GR;
getUnicodeScripts_et_EE;
getUnicodeScripts_eu;
diff --git a/i18npool/source/localedata/data/localedata_others.map b/i18npool/source/localedata/data/localedata_others.map
index 5a77adff0244..5e9d81eaf31c 100644
--- a/i18npool/source/localedata/data/localedata_others.map
+++ b/i18npool/source/localedata/data/localedata_others.map
@@ -1,5 +1,6 @@
UDK_3_0_0 {
global:
+GetVersionInfo;
getAllCalendars_af_NA;
getAllCalendars_af_ZA;
getAllCalendars_ak_GH;
@@ -21,14 +22,17 @@ getAllCalendars_fa_IR;
getAllCalendars_gug_PY;
getAllCalendars_gu_IN;
getAllCalendars_ha_GH;
+getAllCalendars_haw_US;
getAllCalendars_he_IL;
getAllCalendars_hi_IN;
getAllCalendars_hil_PH;
+getAllCalendars_ht_HT;
getAllCalendars_hu_HU;
getAllCalendars_hy_AM;
getAllCalendars_ia;
getAllCalendars_id_ID;
getAllCalendars_ja_JP;
+getAllCalendars_jbo;
getAllCalendars_kab_DZ;
getAllCalendars_kk_KZ;
getAllCalendars_km_KH;
@@ -37,6 +41,7 @@ getAllCalendars_ko_KR;
getAllCalendars_ku_TR;
getAllCalendars_ky_KG;
getAllCalendars_lg_UG;
+getAllCalendars_lif_NP;
getAllCalendars_ln_CD;
getAllCalendars_lo_LA;
getAllCalendars_mai_IN;
@@ -69,10 +74,12 @@ getAllCalendars_tn_ZA;
getAllCalendars_tpi_PG;
getAllCalendars_ts_ZA;
getAllCalendars_ug_CN;
+getAllCalendars_ur_PK;
getAllCalendars_uz_UZ;
getAllCalendars_ve_ZA;
getAllCalendars_vi_VN;
getAllCalendars_xh_ZA;
+getAllCalendars_yi_US;
getAllCalendars_zh_CN;
getAllCalendars_zh_HK;
getAllCalendars_zh_MO;
@@ -100,14 +107,17 @@ getAllCurrencies_fa_IR;
getAllCurrencies_gug_PY;
getAllCurrencies_gu_IN;
getAllCurrencies_ha_GH;
+getAllCurrencies_haw_US;
getAllCurrencies_he_IL;
getAllCurrencies_hi_IN;
getAllCurrencies_hil_PH;
+getAllCurrencies_ht_HT;
getAllCurrencies_hu_HU;
getAllCurrencies_hy_AM;
getAllCurrencies_ia;
getAllCurrencies_id_ID;
getAllCurrencies_ja_JP;
+getAllCurrencies_jbo;
getAllCurrencies_kab_DZ;
getAllCurrencies_kk_KZ;
getAllCurrencies_km_KH;
@@ -116,6 +126,7 @@ getAllCurrencies_ko_KR;
getAllCurrencies_ku_TR;
getAllCurrencies_ky_KG;
getAllCurrencies_lg_UG;
+getAllCurrencies_lif_NP;
getAllCurrencies_ln_CD;
getAllCurrencies_lo_LA;
getAllCurrencies_mai_IN;
@@ -148,10 +159,12 @@ getAllCurrencies_tn_ZA;
getAllCurrencies_tpi_PG;
getAllCurrencies_ts_ZA;
getAllCurrencies_ug_CN;
+getAllCurrencies_ur_PK;
getAllCurrencies_uz_UZ;
getAllCurrencies_ve_ZA;
getAllCurrencies_vi_VN;
getAllCurrencies_xh_ZA;
+getAllCurrencies_yi_US;
getAllCurrencies_zh_CN;
getAllCurrencies_zh_HK;
getAllCurrencies_zh_MO;
@@ -179,14 +192,17 @@ getAllFormats0_fa_IR;
getAllFormats0_gug_PY;
getAllFormats0_gu_IN;
getAllFormats0_ha_GH;
+getAllFormats0_haw_US;
getAllFormats0_he_IL;
getAllFormats0_hi_IN;
getAllFormats0_hil_PH;
+getAllFormats0_ht_HT;
getAllFormats0_hu_HU;
getAllFormats0_hy_AM;
getAllFormats0_ia;
getAllFormats0_id_ID;
getAllFormats0_ja_JP;
+getAllFormats0_jbo;
getAllFormats0_kab_DZ;
getAllFormats0_kk_KZ;
getAllFormats0_km_KH;
@@ -195,6 +211,7 @@ getAllFormats0_ko_KR;
getAllFormats0_ku_TR;
getAllFormats0_ky_KG;
getAllFormats0_lg_UG;
+getAllFormats0_lif_NP;
getAllFormats0_ln_CD;
getAllFormats0_lo_LA;
getAllFormats0_mai_IN;
@@ -227,10 +244,12 @@ getAllFormats0_tn_ZA;
getAllFormats0_tpi_PG;
getAllFormats0_ts_ZA;
getAllFormats0_ug_CN;
+getAllFormats0_ur_PK;
getAllFormats0_uz_UZ;
getAllFormats0_ve_ZA;
getAllFormats0_vi_VN;
getAllFormats0_xh_ZA;
+getAllFormats0_yi_US;
getAllFormats0_zh_CN;
getAllFormats0_zh_HK;
getAllFormats0_zh_MO;
@@ -258,14 +277,17 @@ getBreakIteratorRules_fa_IR;
getBreakIteratorRules_gug_PY;
getBreakIteratorRules_gu_IN;
getBreakIteratorRules_ha_GH;
+getBreakIteratorRules_haw_US;
getBreakIteratorRules_he_IL;
getBreakIteratorRules_hi_IN;
getBreakIteratorRules_hil_PH;
+getBreakIteratorRules_ht_HT;
getBreakIteratorRules_hu_HU;
getBreakIteratorRules_hy_AM;
getBreakIteratorRules_ia;
getBreakIteratorRules_id_ID;
getBreakIteratorRules_ja_JP;
+getBreakIteratorRules_jbo;
getBreakIteratorRules_kab_DZ;
getBreakIteratorRules_kk_KZ;
getBreakIteratorRules_km_KH;
@@ -274,6 +296,7 @@ getBreakIteratorRules_ko_KR;
getBreakIteratorRules_ku_TR;
getBreakIteratorRules_ky_KG;
getBreakIteratorRules_lg_UG;
+getBreakIteratorRules_lif_NP;
getBreakIteratorRules_ln_CD;
getBreakIteratorRules_lo_LA;
getBreakIteratorRules_mai_IN;
@@ -306,10 +329,12 @@ getBreakIteratorRules_tn_ZA;
getBreakIteratorRules_tpi_PG;
getBreakIteratorRules_ts_ZA;
getBreakIteratorRules_ug_CN;
+getBreakIteratorRules_ur_PK;
getBreakIteratorRules_uz_UZ;
getBreakIteratorRules_ve_ZA;
getBreakIteratorRules_vi_VN;
getBreakIteratorRules_xh_ZA;
+getBreakIteratorRules_yi_US;
getBreakIteratorRules_zh_CN;
getBreakIteratorRules_zh_HK;
getBreakIteratorRules_zh_MO;
@@ -337,14 +362,17 @@ getCollationOptions_fa_IR;
getCollationOptions_gug_PY;
getCollationOptions_gu_IN;
getCollationOptions_ha_GH;
+getCollationOptions_haw_US;
getCollationOptions_he_IL;
getCollationOptions_hi_IN;
getCollationOptions_hil_PH;
+getCollationOptions_ht_HT;
getCollationOptions_hu_HU;
getCollationOptions_hy_AM;
getCollationOptions_ia;
getCollationOptions_id_ID;
getCollationOptions_ja_JP;
+getCollationOptions_jbo;
getCollationOptions_kab_DZ;
getCollationOptions_kk_KZ;
getCollationOptions_km_KH;
@@ -353,6 +381,7 @@ getCollationOptions_ko_KR;
getCollationOptions_ku_TR;
getCollationOptions_ky_KG;
getCollationOptions_lg_UG;
+getCollationOptions_lif_NP;
getCollationOptions_ln_CD;
getCollationOptions_lo_LA;
getCollationOptions_mai_IN;
@@ -385,10 +414,12 @@ getCollationOptions_tn_ZA;
getCollationOptions_tpi_PG;
getCollationOptions_ts_ZA;
getCollationOptions_ug_CN;
+getCollationOptions_ur_PK;
getCollationOptions_uz_UZ;
getCollationOptions_ve_ZA;
getCollationOptions_vi_VN;
getCollationOptions_xh_ZA;
+getCollationOptions_yi_US;
getCollationOptions_zh_CN;
getCollationOptions_zh_HK;
getCollationOptions_zh_MO;
@@ -416,14 +447,17 @@ getCollatorImplementation_fa_IR;
getCollatorImplementation_gug_PY;
getCollatorImplementation_gu_IN;
getCollatorImplementation_ha_GH;
+getCollatorImplementation_haw_US;
getCollatorImplementation_he_IL;
getCollatorImplementation_hi_IN;
getCollatorImplementation_hil_PH;
+getCollatorImplementation_ht_HT;
getCollatorImplementation_hu_HU;
getCollatorImplementation_hy_AM;
getCollatorImplementation_ia;
getCollatorImplementation_id_ID;
getCollatorImplementation_ja_JP;
+getCollatorImplementation_jbo;
getCollatorImplementation_kab_DZ;
getCollatorImplementation_kk_KZ;
getCollatorImplementation_km_KH;
@@ -432,6 +466,7 @@ getCollatorImplementation_ko_KR;
getCollatorImplementation_ku_TR;
getCollatorImplementation_ky_KG;
getCollatorImplementation_lg_UG;
+getCollatorImplementation_lif_NP;
getCollatorImplementation_ln_CD;
getCollatorImplementation_lo_LA;
getCollatorImplementation_mai_IN;
@@ -464,10 +499,12 @@ getCollatorImplementation_tn_ZA;
getCollatorImplementation_tpi_PG;
getCollatorImplementation_ts_ZA;
getCollatorImplementation_ug_CN;
+getCollatorImplementation_ur_PK;
getCollatorImplementation_uz_UZ;
getCollatorImplementation_ve_ZA;
getCollatorImplementation_vi_VN;
getCollatorImplementation_xh_ZA;
+getCollatorImplementation_yi_US;
getCollatorImplementation_zh_CN;
getCollatorImplementation_zh_HK;
getCollatorImplementation_zh_MO;
@@ -495,14 +532,17 @@ getContinuousNumberingLevels_fa_IR;
getContinuousNumberingLevels_gug_PY;
getContinuousNumberingLevels_gu_IN;
getContinuousNumberingLevels_ha_GH;
+getContinuousNumberingLevels_haw_US;
getContinuousNumberingLevels_he_IL;
getContinuousNumberingLevels_hi_IN;
getContinuousNumberingLevels_hil_PH;
+getContinuousNumberingLevels_ht_HT;
getContinuousNumberingLevels_hu_HU;
getContinuousNumberingLevels_hy_AM;
getContinuousNumberingLevels_ia;
getContinuousNumberingLevels_id_ID;
getContinuousNumberingLevels_ja_JP;
+getContinuousNumberingLevels_jbo;
getContinuousNumberingLevels_kab_DZ;
getContinuousNumberingLevels_kk_KZ;
getContinuousNumberingLevels_km_KH;
@@ -511,6 +551,7 @@ getContinuousNumberingLevels_ko_KR;
getContinuousNumberingLevels_ku_TR;
getContinuousNumberingLevels_ky_KG;
getContinuousNumberingLevels_lg_UG;
+getContinuousNumberingLevels_lif_NP;
getContinuousNumberingLevels_ln_CD;
getContinuousNumberingLevels_lo_LA;
getContinuousNumberingLevels_mai_IN;
@@ -543,10 +584,12 @@ getContinuousNumberingLevels_tn_ZA;
getContinuousNumberingLevels_tpi_PG;
getContinuousNumberingLevels_ts_ZA;
getContinuousNumberingLevels_ug_CN;
+getContinuousNumberingLevels_ur_PK;
getContinuousNumberingLevels_uz_UZ;
getContinuousNumberingLevels_ve_ZA;
getContinuousNumberingLevels_vi_VN;
getContinuousNumberingLevels_xh_ZA;
+getContinuousNumberingLevels_yi_US;
getContinuousNumberingLevels_zh_CN;
getContinuousNumberingLevels_zh_HK;
getContinuousNumberingLevels_zh_MO;
@@ -574,14 +617,17 @@ getFollowPageWords_fa_IR;
getFollowPageWords_gug_PY;
getFollowPageWords_gu_IN;
getFollowPageWords_ha_GH;
+getFollowPageWords_haw_US;
getFollowPageWords_he_IL;
getFollowPageWords_hi_IN;
getFollowPageWords_hil_PH;
+getFollowPageWords_ht_HT;
getFollowPageWords_hu_HU;
getFollowPageWords_hy_AM;
getFollowPageWords_ia;
getFollowPageWords_id_ID;
getFollowPageWords_ja_JP;
+getFollowPageWords_jbo;
getFollowPageWords_kab_DZ;
getFollowPageWords_kk_KZ;
getFollowPageWords_km_KH;
@@ -590,6 +636,7 @@ getFollowPageWords_ko_KR;
getFollowPageWords_ku_TR;
getFollowPageWords_ky_KG;
getFollowPageWords_lg_UG;
+getFollowPageWords_lif_NP;
getFollowPageWords_ln_CD;
getFollowPageWords_lo_LA;
getFollowPageWords_mai_IN;
@@ -622,10 +669,12 @@ getFollowPageWords_tn_ZA;
getFollowPageWords_tpi_PG;
getFollowPageWords_ts_ZA;
getFollowPageWords_ug_CN;
+getFollowPageWords_ur_PK;
getFollowPageWords_uz_UZ;
getFollowPageWords_ve_ZA;
getFollowPageWords_vi_VN;
getFollowPageWords_xh_ZA;
+getFollowPageWords_yi_US;
getFollowPageWords_zh_CN;
getFollowPageWords_zh_HK;
getFollowPageWords_zh_MO;
@@ -653,14 +702,17 @@ getForbiddenCharacters_fa_IR;
getForbiddenCharacters_gug_PY;
getForbiddenCharacters_gu_IN;
getForbiddenCharacters_ha_GH;
+getForbiddenCharacters_haw_US;
getForbiddenCharacters_he_IL;
getForbiddenCharacters_hi_IN;
getForbiddenCharacters_hil_PH;
+getForbiddenCharacters_ht_HT;
getForbiddenCharacters_hu_HU;
getForbiddenCharacters_hy_AM;
getForbiddenCharacters_ia;
getForbiddenCharacters_id_ID;
getForbiddenCharacters_ja_JP;
+getForbiddenCharacters_jbo;
getForbiddenCharacters_kab_DZ;
getForbiddenCharacters_kk_KZ;
getForbiddenCharacters_km_KH;
@@ -669,6 +721,7 @@ getForbiddenCharacters_ko_KR;
getForbiddenCharacters_ku_TR;
getForbiddenCharacters_ky_KG;
getForbiddenCharacters_lg_UG;
+getForbiddenCharacters_lif_NP;
getForbiddenCharacters_ln_CD;
getForbiddenCharacters_lo_LA;
getForbiddenCharacters_mai_IN;
@@ -701,10 +754,12 @@ getForbiddenCharacters_tn_ZA;
getForbiddenCharacters_tpi_PG;
getForbiddenCharacters_ts_ZA;
getForbiddenCharacters_ug_CN;
+getForbiddenCharacters_ur_PK;
getForbiddenCharacters_uz_UZ;
getForbiddenCharacters_ve_ZA;
getForbiddenCharacters_vi_VN;
getForbiddenCharacters_xh_ZA;
+getForbiddenCharacters_yi_US;
getForbiddenCharacters_zh_CN;
getForbiddenCharacters_zh_HK;
getForbiddenCharacters_zh_MO;
@@ -732,14 +787,17 @@ getIndexAlgorithm_fa_IR;
getIndexAlgorithm_gug_PY;
getIndexAlgorithm_gu_IN;
getIndexAlgorithm_ha_GH;
+getIndexAlgorithm_haw_US;
getIndexAlgorithm_he_IL;
getIndexAlgorithm_hi_IN;
getIndexAlgorithm_hil_PH;
+getIndexAlgorithm_ht_HT;
getIndexAlgorithm_hu_HU;
getIndexAlgorithm_hy_AM;
getIndexAlgorithm_ia;
getIndexAlgorithm_id_ID;
getIndexAlgorithm_ja_JP;
+getIndexAlgorithm_jbo;
getIndexAlgorithm_kab_DZ;
getIndexAlgorithm_kk_KZ;
getIndexAlgorithm_km_KH;
@@ -748,6 +806,7 @@ getIndexAlgorithm_ko_KR;
getIndexAlgorithm_ku_TR;
getIndexAlgorithm_ky_KG;
getIndexAlgorithm_lg_UG;
+getIndexAlgorithm_lif_NP;
getIndexAlgorithm_ln_CD;
getIndexAlgorithm_lo_LA;
getIndexAlgorithm_mai_IN;
@@ -780,10 +839,12 @@ getIndexAlgorithm_tn_ZA;
getIndexAlgorithm_tpi_PG;
getIndexAlgorithm_ts_ZA;
getIndexAlgorithm_ug_CN;
+getIndexAlgorithm_ur_PK;
getIndexAlgorithm_uz_UZ;
getIndexAlgorithm_ve_ZA;
getIndexAlgorithm_vi_VN;
getIndexAlgorithm_xh_ZA;
+getIndexAlgorithm_yi_US;
getIndexAlgorithm_zh_CN;
getIndexAlgorithm_zh_HK;
getIndexAlgorithm_zh_MO;
@@ -811,14 +872,17 @@ getLCInfo_fa_IR;
getLCInfo_gug_PY;
getLCInfo_gu_IN;
getLCInfo_ha_GH;
+getLCInfo_haw_US;
getLCInfo_he_IL;
getLCInfo_hi_IN;
getLCInfo_hil_PH;
+getLCInfo_ht_HT;
getLCInfo_hu_HU;
getLCInfo_hy_AM;
getLCInfo_ia;
getLCInfo_id_ID;
getLCInfo_ja_JP;
+getLCInfo_jbo;
getLCInfo_kab_DZ;
getLCInfo_kk_KZ;
getLCInfo_km_KH;
@@ -827,6 +891,7 @@ getLCInfo_ko_KR;
getLCInfo_ku_TR;
getLCInfo_ky_KG;
getLCInfo_lg_UG;
+getLCInfo_lif_NP;
getLCInfo_ln_CD;
getLCInfo_lo_LA;
getLCInfo_mai_IN;
@@ -859,10 +924,12 @@ getLCInfo_tn_ZA;
getLCInfo_tpi_PG;
getLCInfo_ts_ZA;
getLCInfo_ug_CN;
+getLCInfo_ur_PK;
getLCInfo_uz_UZ;
getLCInfo_ve_ZA;
getLCInfo_vi_VN;
getLCInfo_xh_ZA;
+getLCInfo_yi_US;
getLCInfo_zh_CN;
getLCInfo_zh_HK;
getLCInfo_zh_MO;
@@ -890,14 +957,17 @@ getLocaleItem_fa_IR;
getLocaleItem_gug_PY;
getLocaleItem_gu_IN;
getLocaleItem_ha_GH;
+getLocaleItem_haw_US;
getLocaleItem_he_IL;
getLocaleItem_hi_IN;
getLocaleItem_hil_PH;
+getLocaleItem_ht_HT;
getLocaleItem_hu_HU;
getLocaleItem_hy_AM;
getLocaleItem_ia;
getLocaleItem_id_ID;
getLocaleItem_ja_JP;
+getLocaleItem_jbo;
getLocaleItem_kab_DZ;
getLocaleItem_kk_KZ;
getLocaleItem_km_KH;
@@ -906,6 +976,7 @@ getLocaleItem_ko_KR;
getLocaleItem_ku_TR;
getLocaleItem_ky_KG;
getLocaleItem_lg_UG;
+getLocaleItem_lif_NP;
getLocaleItem_ln_CD;
getLocaleItem_lo_LA;
getLocaleItem_mai_IN;
@@ -938,10 +1009,12 @@ getLocaleItem_tn_ZA;
getLocaleItem_tpi_PG;
getLocaleItem_ts_ZA;
getLocaleItem_ug_CN;
+getLocaleItem_ur_PK;
getLocaleItem_uz_UZ;
getLocaleItem_ve_ZA;
getLocaleItem_vi_VN;
getLocaleItem_xh_ZA;
+getLocaleItem_yi_US;
getLocaleItem_zh_CN;
getLocaleItem_zh_HK;
getLocaleItem_zh_MO;
@@ -969,14 +1042,17 @@ getOutlineNumberingLevels_fa_IR;
getOutlineNumberingLevels_gug_PY;
getOutlineNumberingLevels_gu_IN;
getOutlineNumberingLevels_ha_GH;
+getOutlineNumberingLevels_haw_US;
getOutlineNumberingLevels_he_IL;
getOutlineNumberingLevels_hi_IN;
getOutlineNumberingLevels_hil_PH;
+getOutlineNumberingLevels_ht_HT;
getOutlineNumberingLevels_hu_HU;
getOutlineNumberingLevels_hy_AM;
getOutlineNumberingLevels_ia;
getOutlineNumberingLevels_id_ID;
getOutlineNumberingLevels_ja_JP;
+getOutlineNumberingLevels_jbo;
getOutlineNumberingLevels_kab_DZ;
getOutlineNumberingLevels_kk_KZ;
getOutlineNumberingLevels_km_KH;
@@ -985,6 +1061,7 @@ getOutlineNumberingLevels_ko_KR;
getOutlineNumberingLevels_ku_TR;
getOutlineNumberingLevels_ky_KG;
getOutlineNumberingLevels_lg_UG;
+getOutlineNumberingLevels_lif_NP;
getOutlineNumberingLevels_ln_CD;
getOutlineNumberingLevels_lo_LA;
getOutlineNumberingLevels_mai_IN;
@@ -1017,10 +1094,12 @@ getOutlineNumberingLevels_tn_ZA;
getOutlineNumberingLevels_tpi_PG;
getOutlineNumberingLevels_ts_ZA;
getOutlineNumberingLevels_ug_CN;
+getOutlineNumberingLevels_ur_PK;
getOutlineNumberingLevels_uz_UZ;
getOutlineNumberingLevels_ve_ZA;
getOutlineNumberingLevels_vi_VN;
getOutlineNumberingLevels_xh_ZA;
+getOutlineNumberingLevels_yi_US;
getOutlineNumberingLevels_zh_CN;
getOutlineNumberingLevels_zh_HK;
getOutlineNumberingLevels_zh_MO;
@@ -1048,14 +1127,17 @@ getReservedWords_fa_IR;
getReservedWords_gug_PY;
getReservedWords_gu_IN;
getReservedWords_ha_GH;
+getReservedWords_haw_US;
getReservedWords_he_IL;
getReservedWords_hi_IN;
getReservedWords_hil_PH;
+getReservedWords_ht_HT;
getReservedWords_hu_HU;
getReservedWords_hy_AM;
getReservedWords_ia;
getReservedWords_id_ID;
getReservedWords_ja_JP;
+getReservedWords_jbo;
getReservedWords_kab_DZ;
getReservedWords_kk_KZ;
getReservedWords_km_KH;
@@ -1064,6 +1146,7 @@ getReservedWords_ko_KR;
getReservedWords_ku_TR;
getReservedWords_ky_KG;
getReservedWords_lg_UG;
+getReservedWords_lif_NP;
getReservedWords_ln_CD;
getReservedWords_lo_LA;
getReservedWords_mai_IN;
@@ -1096,10 +1179,12 @@ getReservedWords_tn_ZA;
getReservedWords_tpi_PG;
getReservedWords_ts_ZA;
getReservedWords_ug_CN;
+getReservedWords_ur_PK;
getReservedWords_uz_UZ;
getReservedWords_ve_ZA;
getReservedWords_vi_VN;
getReservedWords_xh_ZA;
+getReservedWords_yi_US;
getReservedWords_zh_CN;
getReservedWords_zh_HK;
getReservedWords_zh_MO;
@@ -1127,14 +1212,17 @@ getSearchOptions_fa_IR;
getSearchOptions_gug_PY;
getSearchOptions_gu_IN;
getSearchOptions_ha_GH;
+getSearchOptions_haw_US;
getSearchOptions_he_IL;
getSearchOptions_hi_IN;
getSearchOptions_hil_PH;
+getSearchOptions_ht_HT;
getSearchOptions_hu_HU;
getSearchOptions_hy_AM;
getSearchOptions_ia;
getSearchOptions_id_ID;
getSearchOptions_ja_JP;
+getSearchOptions_jbo;
getSearchOptions_kab_DZ;
getSearchOptions_kk_KZ;
getSearchOptions_km_KH;
@@ -1143,6 +1231,7 @@ getSearchOptions_ko_KR;
getSearchOptions_ku_TR;
getSearchOptions_ky_KG;
getSearchOptions_lg_UG;
+getSearchOptions_lif_NP;
getSearchOptions_ln_CD;
getSearchOptions_lo_LA;
getSearchOptions_mai_IN;
@@ -1175,10 +1264,12 @@ getSearchOptions_tn_ZA;
getSearchOptions_tpi_PG;
getSearchOptions_ts_ZA;
getSearchOptions_ug_CN;
+getSearchOptions_ur_PK;
getSearchOptions_uz_UZ;
getSearchOptions_ve_ZA;
getSearchOptions_vi_VN;
getSearchOptions_xh_ZA;
+getSearchOptions_yi_US;
getSearchOptions_zh_CN;
getSearchOptions_zh_HK;
getSearchOptions_zh_MO;
@@ -1206,14 +1297,17 @@ getTransliterations_fa_IR;
getTransliterations_gug_PY;
getTransliterations_gu_IN;
getTransliterations_ha_GH;
+getTransliterations_haw_US;
getTransliterations_he_IL;
getTransliterations_hi_IN;
getTransliterations_hil_PH;
+getTransliterations_ht_HT;
getTransliterations_hu_HU;
getTransliterations_hy_AM;
getTransliterations_ia;
getTransliterations_id_ID;
getTransliterations_ja_JP;
+getTransliterations_jbo;
getTransliterations_kab_DZ;
getTransliterations_kk_KZ;
getTransliterations_km_KH;
@@ -1222,6 +1316,7 @@ getTransliterations_ko_KR;
getTransliterations_ku_TR;
getTransliterations_ky_KG;
getTransliterations_lg_UG;
+getTransliterations_lif_NP;
getTransliterations_ln_CD;
getTransliterations_lo_LA;
getTransliterations_mai_IN;
@@ -1254,10 +1349,12 @@ getTransliterations_tn_ZA;
getTransliterations_tpi_PG;
getTransliterations_ts_ZA;
getTransliterations_ug_CN;
+getTransliterations_ur_PK;
getTransliterations_uz_UZ;
getTransliterations_ve_ZA;
getTransliterations_vi_VN;
getTransliterations_xh_ZA;
+getTransliterations_yi_US;
getTransliterations_zh_CN;
getTransliterations_zh_HK;
getTransliterations_zh_MO;
@@ -1285,14 +1382,17 @@ getUnicodeScripts_fa_IR;
getUnicodeScripts_gug_PY;
getUnicodeScripts_gu_IN;
getUnicodeScripts_ha_GH;
+getUnicodeScripts_haw_US;
getUnicodeScripts_he_IL;
getUnicodeScripts_hi_IN;
getUnicodeScripts_hil_PH;
+getUnicodeScripts_ht_HT;
getUnicodeScripts_hu_HU;
getUnicodeScripts_hy_AM;
getUnicodeScripts_ia;
getUnicodeScripts_id_ID;
getUnicodeScripts_ja_JP;
+getUnicodeScripts_jbo;
getUnicodeScripts_kab_DZ;
getUnicodeScripts_kk_KZ;
getUnicodeScripts_km_KH;
@@ -1301,6 +1401,7 @@ getUnicodeScripts_ko_KR;
getUnicodeScripts_ku_TR;
getUnicodeScripts_ky_KG;
getUnicodeScripts_lg_UG;
+getUnicodeScripts_lif_NP;
getUnicodeScripts_ln_CD;
getUnicodeScripts_lo_LA;
getUnicodeScripts_mai_IN;
@@ -1333,17 +1434,18 @@ getUnicodeScripts_tn_ZA;
getUnicodeScripts_tpi_PG;
getUnicodeScripts_ts_ZA;
getUnicodeScripts_ug_CN;
+getUnicodeScripts_ur_PK;
getUnicodeScripts_uz_UZ;
getUnicodeScripts_ve_ZA;
getUnicodeScripts_vi_VN;
getUnicodeScripts_xh_ZA;
+getUnicodeScripts_yi_US;
getUnicodeScripts_zh_CN;
getUnicodeScripts_zh_HK;
getUnicodeScripts_zh_MO;
getUnicodeScripts_zh_SG;
getUnicodeScripts_zh_TW;
getUnicodeScripts_zu_ZA;
-GetVersionInfo;
local:
*;
diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
index 284bf07bb15b..ddf597d780d7 100644
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
@@ -39,6 +39,14 @@ LIBTARGET=NO
debug!=
.ENDIF
+.IF "$(OS)" == "WNT"
+my_file = file:///
+.ELSE
+my_file = file://
+.END
+
+my_components = sax.inbuild
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -62,191 +70,6 @@ LINK_LOCALEDATA_ES_LIB=-l$(SHL2TARGET)
# --- Files --------------------------------------------------------
-# Interim files generated by the saxparser executable, for dependencies
-MY_MISC_CXXFILES = \
- $(MISC)$/localedata_af_NA.cxx \
- $(MISC)$/localedata_af_ZA.cxx \
- $(MISC)$/localedata_ak_GH.cxx \
- $(MISC)$/localedata_am_ET.cxx \
- $(MISC)$/localedata_ar_DZ.cxx \
- $(MISC)$/localedata_ar_EG.cxx \
- $(MISC)$/localedata_ar_LB.cxx \
- $(MISC)$/localedata_ar_SA.cxx \
- $(MISC)$/localedata_ar_TN.cxx \
- $(MISC)$/localedata_ast_ES.cxx \
- $(MISC)$/localedata_az_AZ.cxx \
- $(MISC)$/localedata_be_BY.cxx \
- $(MISC)$/localedata_bg_BG.cxx \
- $(MISC)$/localedata_bn_IN.cxx \
- $(MISC)$/localedata_bn_BD.cxx \
- $(MISC)$/localedata_br_FR.cxx \
- $(MISC)$/localedata_bs_BA.cxx \
- $(MISC)$/localedata_ca_ES.cxx \
- $(MISC)$/localedata_cs_CZ.cxx \
- $(MISC)$/localedata_cv_RU.cxx \
- $(MISC)$/localedata_cy_GB.cxx \
- $(MISC)$/localedata_da_DK.cxx \
- $(MISC)$/localedata_de_AT.cxx \
- $(MISC)$/localedata_de_CH.cxx \
- $(MISC)$/localedata_de_DE.cxx \
- $(MISC)$/localedata_de_LI.cxx \
- $(MISC)$/localedata_de_LU.cxx \
- $(MISC)$/localedata_dz_BT.cxx \
- $(MISC)$/localedata_ee_GH.cxx \
- $(MISC)$/localedata_el_GR.cxx \
- $(MISC)$/localedata_en_AU.cxx \
- $(MISC)$/localedata_en_BZ.cxx \
- $(MISC)$/localedata_en_CA.cxx \
- $(MISC)$/localedata_en_GB.cxx \
- $(MISC)$/localedata_en_GH.cxx \
- $(MISC)$/localedata_en_IE.cxx \
- $(MISC)$/localedata_en_IN.cxx \
- $(MISC)$/localedata_en_JM.cxx \
- $(MISC)$/localedata_en_NA.cxx \
- $(MISC)$/localedata_en_NZ.cxx \
- $(MISC)$/localedata_en_PH.cxx \
- $(MISC)$/localedata_en_TT.cxx \
- $(MISC)$/localedata_en_US.cxx \
- $(MISC)$/localedata_en_ZA.cxx \
- $(MISC)$/localedata_en_ZW.cxx \
- $(MISC)$/localedata_eo.cxx \
- $(MISC)$/localedata_es_AR.cxx \
- $(MISC)$/localedata_es_BO.cxx \
- $(MISC)$/localedata_es_CL.cxx \
- $(MISC)$/localedata_es_CO.cxx \
- $(MISC)$/localedata_es_CR.cxx \
- $(MISC)$/localedata_es_DO.cxx \
- $(MISC)$/localedata_es_EC.cxx \
- $(MISC)$/localedata_es_ES.cxx \
- $(MISC)$/localedata_es_GT.cxx \
- $(MISC)$/localedata_es_HN.cxx \
- $(MISC)$/localedata_es_MX.cxx \
- $(MISC)$/localedata_es_NI.cxx \
- $(MISC)$/localedata_es_PA.cxx \
- $(MISC)$/localedata_es_PE.cxx \
- $(MISC)$/localedata_es_PR.cxx \
- $(MISC)$/localedata_es_PY.cxx \
- $(MISC)$/localedata_es_SV.cxx \
- $(MISC)$/localedata_es_UY.cxx \
- $(MISC)$/localedata_es_VE.cxx \
- $(MISC)$/localedata_et_EE.cxx \
- $(MISC)$/localedata_eu.cxx \
- $(MISC)$/localedata_fa_IR.cxx \
- $(MISC)$/localedata_fi_FI.cxx \
- $(MISC)$/localedata_fo_FO.cxx \
- $(MISC)$/localedata_fr_BE.cxx \
- $(MISC)$/localedata_fr_CA.cxx \
- $(MISC)$/localedata_fr_CH.cxx \
- $(MISC)$/localedata_fr_FR.cxx \
- $(MISC)$/localedata_fr_LU.cxx \
- $(MISC)$/localedata_fr_MC.cxx \
- $(MISC)$/localedata_fur_IT.cxx \
- $(MISC)$/localedata_fy_NL.cxx \
- $(MISC)$/localedata_ga_IE.cxx \
- $(MISC)$/localedata_gl_ES.cxx \
- $(MISC)$/localedata_gsc_FR.cxx \
- $(MISC)$/localedata_gu_IN.cxx \
- $(MISC)$/localedata_gug_PY.cxx \
- $(MISC)$/localedata_ha_GH.cxx \
- $(MISC)$/localedata_he_IL.cxx \
- $(MISC)$/localedata_hi_IN.cxx \
- $(MISC)$/localedata_hil_PH.cxx \
- $(MISC)$/localedata_hr_HR.cxx \
- $(MISC)$/localedata_hsb_DE.cxx \
- $(MISC)$/localedata_hu_HU.cxx \
- $(MISC)$/localedata_hy_AM.cxx \
- $(MISC)$/localedata_ia.cxx \
- $(MISC)$/localedata_id_ID.cxx \
- $(MISC)$/localedata_is_IS.cxx \
- $(MISC)$/localedata_it_CH.cxx \
- $(MISC)$/localedata_it_IT.cxx \
- $(MISC)$/localedata_ja_JP.cxx \
- $(MISC)$/localedata_ka_GE.cxx \
- $(MISC)$/localedata_kab_DZ.cxx \
- $(MISC)$/localedata_kk_KZ.cxx \
- $(MISC)$/localedata_kl_GL.cxx \
- $(MISC)$/localedata_km_KH.cxx \
- $(MISC)$/localedata_kn_IN.cxx \
- $(MISC)$/localedata_ko_KR.cxx \
- $(MISC)$/localedata_ku_TR.cxx \
- $(MISC)$/localedata_ky_KG.cxx \
- $(MISC)$/localedata_la_VA.cxx \
- $(MISC)$/localedata_lb_LU.cxx \
- $(MISC)$/localedata_lg_UG.cxx \
- $(MISC)$/localedata_ln_CD.cxx \
- $(MISC)$/localedata_lo_LA.cxx \
- $(MISC)$/localedata_lt_LT.cxx \
- $(MISC)$/localedata_ltg_LV.cxx \
- $(MISC)$/localedata_lv_LV.cxx \
- $(MISC)$/localedata_mai_IN.cxx \
- $(MISC)$/localedata_mk_MK.cxx \
- $(MISC)$/localedata_ml_IN.cxx \
- $(MISC)$/localedata_mn_MN.cxx \
- $(MISC)$/localedata_mr_IN.cxx \
- $(MISC)$/localedata_ms_MY.cxx \
- $(MISC)$/localedata_mt_MT.cxx \
- $(MISC)$/localedata_my_MM.cxx \
- $(MISC)$/localedata_nb_NO.cxx \
- $(MISC)$/localedata_ne_NP.cxx \
- $(MISC)$/localedata_nl_BE.cxx \
- $(MISC)$/localedata_nl_NL.cxx \
- $(MISC)$/localedata_nn_NO.cxx \
- $(MISC)$/localedata_no_NO.cxx \
- $(MISC)$/localedata_nr_ZA.cxx \
- $(MISC)$/localedata_nso_ZA.cxx \
- $(MISC)$/localedata_oc_FR.cxx \
- $(MISC)$/localedata_om_ET.cxx \
- $(MISC)$/localedata_or_IN.cxx \
- $(MISC)$/localedata_pa_IN.cxx \
- $(MISC)$/localedata_pl_PL.cxx \
- $(MISC)$/localedata_plt_MG.cxx \
- $(MISC)$/localedata_pt_BR.cxx \
- $(MISC)$/localedata_pt_PT.cxx \
- $(MISC)$/localedata_ro_RO.cxx \
- $(MISC)$/localedata_rue_SK.cxx \
- $(MISC)$/localedata_ru_RU.cxx \
- $(MISC)$/localedata_rw_RW.cxx \
- $(MISC)$/localedata_sg_CF.cxx \
- $(MISC)$/localedata_sh_ME.cxx \
- $(MISC)$/localedata_sh_RS.cxx \
- $(MISC)$/localedata_sh_YU.cxx \
- $(MISC)$/localedata_shs_CA.cxx \
- $(MISC)$/localedata_sk_SK.cxx \
- $(MISC)$/localedata_sl_SI.cxx \
- $(MISC)$/localedata_so_SO.cxx \
- $(MISC)$/localedata_sr_ME.cxx \
- $(MISC)$/localedata_sr_RS.cxx \
- $(MISC)$/localedata_sr_YU.cxx \
- $(MISC)$/localedata_ss_ZA.cxx \
- $(MISC)$/localedata_st_ZA.cxx \
- $(MISC)$/localedata_sv_FI.cxx \
- $(MISC)$/localedata_sv_SE.cxx \
- $(MISC)$/localedata_sw_TZ.cxx \
- $(MISC)$/localedata_ta_IN.cxx \
- $(MISC)$/localedata_te_IN.cxx \
- $(MISC)$/localedata_tg_TJ.cxx \
- $(MISC)$/localedata_th_TH.cxx \
- $(MISC)$/localedata_ti_ER.cxx \
- $(MISC)$/localedata_tk_TM.cxx \
- $(MISC)$/localedata_tn_ZA.cxx \
- $(MISC)$/localedata_tpi_PG.cxx \
- $(MISC)$/localedata_tr_TR.cxx \
- $(MISC)$/localedata_ts_ZA.cxx \
- $(MISC)$/localedata_ug_CN.cxx \
- $(MISC)$/localedata_uk_UA.cxx \
- $(MISC)$/localedata_uz_UZ.cxx \
- $(MISC)$/localedata_ve_ZA.cxx \
- $(MISC)$/localedata_vi_VN.cxx \
- $(MISC)$/localedata_wa_BE.cxx \
- $(MISC)$/localedata_xh_ZA.cxx \
- $(MISC)$/localedata_zh_CN.cxx \
- $(MISC)$/localedata_zh_HK.cxx \
- $(MISC)$/localedata_zh_MO.cxx \
- $(MISC)$/localedata_zh_SG.cxx \
- $(MISC)$/localedata_zh_TW.cxx \
- $(MISC)$/localedata_zu_ZA.cxx
-
-
# English Locales
SHL1TARGET=localedata_en
.IF "$(GUI)" == "OS2"
@@ -344,6 +167,7 @@ SHL3OBJS= \
$(SLO)$/localedata_de_DE.obj \
$(SLO)$/localedata_de_LI.obj \
$(SLO)$/localedata_de_LU.obj \
+ $(SLO)$/localedata_dsb_DE.obj \
$(SLO)$/localedata_el_GR.obj \
$(SLO)$/localedata_et_EE.obj \
$(SLO)$/localedata_eu.obj \
@@ -437,15 +261,18 @@ SHL4OBJS= \
$(SLO)$/localedata_fa_IR.obj \
$(SLO)$/localedata_gu_IN.obj \
$(SLO)$/localedata_gug_PY.obj \
+ $(SLO)$/localedata_haw_US.obj \
$(SLO)$/localedata_ha_GH.obj \
$(SLO)$/localedata_he_IL.obj \
$(SLO)$/localedata_hi_IN.obj \
$(SLO)$/localedata_hil_PH.obj \
+ $(SLO)$/localedata_ht_HT.obj \
$(SLO)$/localedata_hu_HU.obj \
$(SLO)$/localedata_hy_AM.obj \
$(SLO)$/localedata_ia.obj \
$(SLO)$/localedata_id_ID.obj \
$(SLO)$/localedata_ja_JP.obj \
+ $(SLO)$/localedata_jbo.obj \
$(SLO)$/localedata_kab_DZ.obj \
$(SLO)$/localedata_kk_KZ.obj \
$(SLO)$/localedata_km_KH.obj \
@@ -454,6 +281,7 @@ SHL4OBJS= \
$(SLO)$/localedata_ku_TR.obj \
$(SLO)$/localedata_ky_KG.obj \
$(SLO)$/localedata_lg_UG.obj \
+ $(SLO)$/localedata_lif_NP.obj \
$(SLO)$/localedata_ln_CD.obj \
$(SLO)$/localedata_lo_LA.obj \
$(SLO)$/localedata_mai_IN.obj \
@@ -486,10 +314,12 @@ SHL4OBJS= \
$(SLO)$/localedata_tpi_PG.obj \
$(SLO)$/localedata_ts_ZA.obj \
$(SLO)$/localedata_ug_CN.obj \
+ $(SLO)$/localedata_ur_PK.obj \
$(SLO)$/localedata_uz_UZ.obj \
$(SLO)$/localedata_ve_ZA.obj \
$(SLO)$/localedata_vi_VN.obj \
$(SLO)$/localedata_xh_ZA.obj \
+ $(SLO)$/localedata_yi_US.obj \
$(SLO)$/localedata_zh_CN.obj \
$(SLO)$/localedata_zh_HK.obj \
$(SLO)$/localedata_zh_MO.obj \
@@ -506,13 +336,28 @@ DEPOBJFILES= \
$(SHL3OBJS) \
$(SHL4OBJS)
+# Interim files generated by the saxparser executable, for dependencies
+MY_MISC_CXXFILES := $(foreach,i,$(DEPOBJFILES) $(MISC)/$(i:b).cxx)
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST)
+$(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST) $(MISC)/saxparser.rdb
$(MISC)$/localedata_%.cxx : %.xml
- $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb
+ $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ \
+ $(my_file)$(PWD)/$(MISC)/saxparser.rdb $(SOLARBINDIR)$/types.rdb \
+ -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(SOLARSHAREDBIN)
$(RM) $(BIN)$/$(@:b).rdb
+$(MISC)/saxparser.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+ $(MISC)/saxparser.input \
+ $(my_components:^"$(SOLARXMLDIR)/":+".component")
+ $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+ $(SOLARENV)/bin/packcomponents.xslt $(MISC)/saxparser.input
+
+$(MISC)/saxparser.input :
+ echo \
+ '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+ > $@
diff --git a/i18npool/source/localedata/data/no_NO.xml b/i18npool/source/localedata/data/no_NO.xml
index 21ac49181020..6df7b5e2d018 100644
--- a/i18npool/source/localedata/data/no_NO.xml
+++ b/i18npool/source/localedata/data/no_NO.xml
@@ -232,7 +232,7 @@
</SearchOptions>
</LC_SEARCH>
<LC_INDEX>
-<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-V X-Z Æ Ø Å</IndexKey>
+<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-Z Æ Ø Å</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>p.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/sv_SE.xml b/i18npool/source/localedata/data/sv_SE.xml
index 211f95c3e894..4afefebfa661 100644
--- a/i18npool/source/localedata/data/sv_SE.xml
+++ b/i18npool/source/localedata/data/sv_SE.xml
@@ -179,7 +179,7 @@
<LC_COLLATION ref="en_US" />
<LC_SEARCH ref="en_US"/>
<LC_INDEX>
- <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-V X-Z Å Ä Ö</IndexKey>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z Å Ä Ö</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>f.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/ur_PK.xml b/i18npool/source/localedata/data/ur_PK.xml
new file mode 100644
index 000000000000..53002e931068
--- /dev/null
+++ b/i18npool/source/localedata/data/ur_PK.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>ur</LangID>
+ <DefaultName>Urdu</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>PK</CountryID>
+ <DefaultName>Pakistan</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>قبل دوپہر</TimeAM>
+ <TimePM>بعد دوپہر</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$₨-420]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">أ ؤ ا آ ب پ ت ٹ ث ج چ ح خ د ڈ ذ ر ڑ ز ژ س ش ص ض ط ظ ع غ ف ق ک گ ل م ن ں و ہ ی ء ئ ے ٻ ة ٺ ټ ٽ ه ھ ي</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>صفحہ</FollowPageWord>
+ <FollowPageWord>صفحے</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اتوار</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>پ</DefaultAbbrvName>
+ <DefaultFullName>پير</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>منگل</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>ب</DefaultAbbrvName>
+ <DefaultFullName>بده</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جمعرات</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جمعہ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>ہ</DefaultAbbrvName>
+ <DefaultFullName>ہفتہ</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جنوری</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>ف</DefaultAbbrvName>
+ <DefaultFullName>فروری</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>مار چ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اپريل</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>مئ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جون</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جولائ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اگست</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>س</DefaultAbbrvName>
+ <DefaultFullName>ستمبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اکتوبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>ن</DefaultAbbrvName>
+ <DefaultFullName>نومبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>د</DefaultAbbrvName>
+ <DefaultFullName>دسمبر</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>ق م</DefaultAbbrvName>
+ <DefaultFullName>قبل مسيح</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>ء</DefaultAbbrvName>
+ <DefaultFullName>عيسوی سن</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>PKR</CurrencyID>
+ <CurrencySymbol>₨</CurrencySymbol>
+ <BankSymbol>PKR</BankSymbol>
+ <CurrencyName>پاکستانی روپیہ</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>راست</trueWord>
+ <falseWord>غلط</falseWord>
+ <quarter1Word>ایک چوتھائی</quarter1Word>
+ <quarter2Word>دو چوتھائی</quarter2Word>
+ <quarter3Word>تین چوتھائی</quarter3Word>
+ <quarter4Word>چار چوتھائی</quarter4Word>
+ <aboveWord>اوپر</aboveWord>
+ <belowWord>نیچے</belowWord>
+ <quarter1Abbreviation>چوتھائی 1</quarter1Abbreviation>
+ <quarter2Abbreviation>چوتھائی 2 </quarter2Abbreviation>
+ <quarter3Abbreviation>چوتھائی 3</quarter3Abbreviation>
+ <quarter4Abbreviation>چوتھائی 4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/yi_US.xml b/i18npool/source/localedata/data/yi_US.xml
new file mode 100644
index 000000000000..cf52c1ae1fdf
--- /dev/null
+++ b/i18npool/source/localedata/data/yi_US.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>yi</LangID>
+ <DefaultName>Yiddish</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>US</CountryID>
+ <DefaultName>United States</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE ref="en_US"/>
+ <LC_FORMAT ref="en_US" replaceTo="[$$-83D]"/>
+ <LC_COLLATION ref="en_US"/>
+ <LC_SEARCH ref="en_US"/>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">א-י כ ל מ נ ס ע פ צ-ת</IndexKey>
+ <UnicodeScript>10</UnicodeScript>
+ <FollowPageWord>ז“</FollowPageWord>
+ <FollowPageWord>ז“</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>זונ'</DefaultAbbrvName>
+ <DefaultFullName>זונטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>מאָנ'</DefaultAbbrvName>
+ <DefaultFullName>מאָנטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>דינ'</DefaultAbbrvName>
+ <DefaultFullName>דינסטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>מיט'</DefaultAbbrvName>
+ <DefaultFullName>מיטװאָך</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>דאָנ'</DefaultAbbrvName>
+ <DefaultFullName>דאָנערשטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>פֿרײַ'</DefaultAbbrvName>
+ <DefaultFullName>פֿרײַטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>שבת</DefaultAbbrvName>
+ <DefaultFullName>שבת</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>יאַנ</DefaultAbbrvName>
+ <DefaultFullName>יאַנואַר</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>פֿעב</DefaultAbbrvName>
+ <DefaultFullName>פֿעברואַר</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>מאַר</DefaultAbbrvName>
+ <DefaultFullName>מאַרץ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>אַפּר</DefaultAbbrvName>
+ <DefaultFullName>אַפּריל</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>מײַ</DefaultAbbrvName>
+ <DefaultFullName>מײַ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>יונ</DefaultAbbrvName>
+ <DefaultFullName>יוני</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>יול</DefaultAbbrvName>
+ <DefaultFullName>יולי</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>אױג</DefaultAbbrvName>
+ <DefaultFullName>אױגוסט</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>סעפּ</DefaultAbbrvName>
+ <DefaultFullName>סעפּטעמבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>אָקט</DefaultAbbrvName>
+ <DefaultFullName>אָקטאָבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>נאָװ</DefaultAbbrvName>
+ <DefaultFullName>נאָװעמבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>דעצ</DefaultAbbrvName>
+ <DefaultFullName>דעצעמבער</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>פֿ"ק</DefaultAbbrvName>
+ <DefaultFullName>פֿ"ק</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>אצ“ר</DefaultAbbrvName>
+ <DefaultFullName>אצ“ר</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY ref="en_US"/>
+ <LC_TRANSLITERATION ref="en_US"/>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>אמת</trueWord>
+ <falseWord>פֿאַלש</falseWord>
+ <quarter1Word>ערשט יאָרפֿערטל</quarter1Word>
+ <quarter2Word>צװײט יאָרפֿערטל</quarter2Word>
+ <quarter3Word>דריט יאָרפֿערטל</quarter3Word>
+ <quarter4Word>פֿערט יאָרפֿערטל</quarter4Word>
+ <aboveWord>אױבן</aboveWord>
+ <belowWord>אונטן</belowWord>
+ <quarter1Abbreviation>י“פֿ1</quarter1Abbreviation>
+ <quarter2Abbreviation>י“פֿ2</quarter2Abbreviation>
+ <quarter3Abbreviation>י“פֿ3</quarter3Abbreviation>
+ <quarter4Abbreviation>י“פֿ4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel ref="en_US"/>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 19f425bdab56..64f5c975374b 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -173,6 +173,7 @@ static const struct {
{ "ast_ES", lcl_DATA_EURO },
{ "ltg_LV", lcl_DATA_EURO },
{ "hsb_DE", lcl_DATA_EURO },
+ { "dsb_DE", lcl_DATA_EURO },
{ "rue_SK", lcl_DATA_EURO },
{ "ja_JP", lcl_DATA_OTHERS },
@@ -255,6 +256,12 @@ static const struct {
{ "om_ET", lcl_DATA_OTHERS },
{ "plt_MG", lcl_DATA_OTHERS },
{ "mai_IN", lcl_DATA_OTHERS },
+ { "yi_US", lcl_DATA_OTHERS },
+ { "haw_US", lcl_DATA_OTHERS },
+ { "lif_NP", lcl_DATA_OTHERS },
+ { "ur_PK", lcl_DATA_OTHERS },
+ { "ht_HT", lcl_DATA_OTHERS },
+ { "jbo", lcl_DATA_OTHERS },
{ "kab_DZ", lcl_DATA_OTHERS }
};
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx
index baa71abab278..1b6ddf47bd1f 100644
--- a/i18npool/source/localedata/saxparser.cxx
+++ b/i18npool/source/localedata/saxparser.cxx
@@ -35,7 +35,6 @@
#include "sal/main.h"
-#include <com/sun/star/registry/XImplementationRegistration.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
@@ -321,7 +320,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
xSMgr = createRegistryServiceFactory(
::rtl::OUString::createFromAscii(argv[4]),
- ::rtl::OUString::createFromAscii(argv[5]) );
+ ::rtl::OUString::createFromAscii(argv[5]), true );
}
catch ( Exception &e )
{
@@ -330,37 +329,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
exit(1);
}
- Reference < XImplementationRegistration > xReg;
- try
- {
- // Create registration service
- Reference < XInterface > x = xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) );
- xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
- }
- catch( Exception & ) {
- printf( "Couldn't create ImplementationRegistration service\n" );
- exit(1);
- }
-
- OString sTestName;
- try
- {
- // Load dll for the tested component
- OUString aDllName(RTL_CONSTASCII_USTRINGPARAM( "sax.uno" SAL_DLLEXTENSION ));
- xReg->registerImplementation(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),
- aDllName,
- Reference< XSimpleRegistry > () );
- }
- catch( Exception &e ) {
- printf( "Couldn't raise sax.uno library!\n" );
- printf( "%s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() );
-
- exit(1);
- }
-
-
//--------------------------------
// parser demo
// read xml from a file and count elements
diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx
index 98e0ea230cb9..9d9ac886a22e 100644
--- a/i18npool/source/paper/paper.cxx
+++ b/i18npool/source/paper/paper.cxx
@@ -28,6 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_i18npool.hxx"
+
+#include <osl/diagnose.h>
#include <sal/config.h>
#include <sal/macros.h>
#include <rtl/ustring.hxx>
@@ -131,7 +133,6 @@ static PageDesc aDinTab[] =
{ MM2MM100( 227 ), MM2MM100( 356 ), "SuperA", NULL },
{ MM2MM100( 305 ), MM2MM100( 487 ), "SuperB", NULL },
{ IN2MM100( 8.5 ), IN2MM100( 12.69 ), "LetterPlus", NULL },
- { IN2MM100( 8.5 ), IN2MM100( 12.69 ), "LetterPlus", NULL },
{ MM2MM100( 210 ), MM2MM100( 330 ), "A4Plus", NULL },
{ MM2MM100( 200 ), MM2MM100( 148 ), "DoublePostcard", NULL },
{ MM2MM100( 105 ), MM2MM100( 148 ), "A6", NULL },
@@ -392,6 +393,9 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
PaperInfo::PaperInfo(Paper eType) : m_eType(eType)
{
+ OSL_ENSURE( sizeof(aDinTab) / sizeof(aDinTab[0]) == NUM_PAPER_ENTRIES,
+ "mismatch between array entries and enum values" );
+
m_nPaperWidth = aDinTab[m_eType].m_nWidth;
m_nPaperHeight = aDinTab[m_eType].m_nHeight;
}
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 8e84bf0081be..8183b46d76cf 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -581,29 +581,6 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvType
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* /*_pServiceManager*/, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::registry::XRegistryKey * pRegistryKey =
- reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
- _pRegistryKey );
- ::com::sun::star::uno::Reference<
- ::com::sun::star::registry::XRegistryKey > xNewKey;
-
- for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
- {
- xNewKey = pRegistryKey->createKey(
- ::rtl::OUString::createFromAscii( pArr->pImplementationNm ) );
- xNewKey = xNewKey->createKey(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")) );
- xNewKey->createKey(
- ::rtl::OUString::createFromAscii( pArr->pServiceNm ) );
- }
- }
- return sal_True;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
{
void* pRet = NULL;
diff --git a/i18npool/source/search/i18nsearch.component b/i18npool/source/search/i18nsearch.component
new file mode 100644
index 000000000000..6288bcd7c840
--- /dev/null
+++ b/i18npool/source/search/i18nsearch.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.util.TextSearch_i18n">
+ <service name="com.sun.star.util.TextSearch"/>
+ </implementation>
+</component>
diff --git a/i18npool/source/search/makefile.mk b/i18npool/source/search/makefile.mk
index aed976edd896..372b32a216d1 100644
--- a/i18npool/source/search/makefile.mk
+++ b/i18npool/source/search/makefile.mk
@@ -76,3 +76,11 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/i18nsearch.component
+
+$(MISC)/i18nsearch.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ i18nsearch.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt i18nsearch.component
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index ab4d50f7397f..ce8e7b15bfea 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -988,25 +988,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- void* /*_pServiceManager*/, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::registry::XRegistryKey * pRegistryKey =
- reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
- _pRegistryKey );
- ::com::sun::star::uno::Reference<
- ::com::sun::star::registry::XRegistryKey > xNewKey;
-
- xNewKey = pRegistryKey->createKey( getImplementationName_Static() );
- xNewKey = xNewKey->createKey(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")) );
- xNewKey->createKey( getServiceName_Static() );
- }
- return sal_True;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* sImplementationName,
void* _pServiceManager, void* /*_pRegistryKey*/ )
{
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
new file mode 100644
index 000000000000..d11606efb6d4
--- /dev/null
+++ b/i18npool/util/i18npool.component
@@ -0,0 +1,484 @@
+<?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.i18n.BreakIterator">
+ <service name="com.sun.star.i18n.BreakIterator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_Unicode">
+ <service name="com.sun.star.i18n.BreakIterator_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_ja">
+ <service name="com.sun.star.i18n.BreakIterator_ja"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_ko">
+ <service name="com.sun.star.i18n.BreakIterator_ko"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_th">
+ <service name="com.sun.star.i18n.BreakIterator_th"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_zh">
+ <service name="com.sun.star.i18n.BreakIterator_zh"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.BreakIterator_zh_TW">
+ <service name="com.sun.star.i18n.BreakIterator_zh_TW"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CalendarImpl">
+ <service name="com.sun.star.i18n.LocaleCalendar"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_ROC">
+ <service name="com.sun.star.i18n.Calendar_ROC"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_buddhist">
+ <service name="com.sun.star.i18n.Calendar_buddhist"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_gengou">
+ <service name="com.sun.star.i18n.Calendar_gengou"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_gregorian">
+ <service name="com.sun.star.i18n.Calendar_gregorian"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hanja">
+ <service name="com.sun.star.i18n.Calendar_hanja"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hanja_yoil">
+ <service name="com.sun.star.i18n.Calendar_hanja_yoil"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_hijri">
+ <service name="com.sun.star.i18n.Calendar_hijri"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Calendar_jewish">
+ <service name="com.sun.star.i18n.Calendar_jewish"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.ChapterCollator">
+ <service name="com.sun.star.i18n.ChapterCollator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CharacterClassification">
+ <service name="com.sun.star.i18n.CharacterClassification"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.CharacterClassification_Unicode">
+ <service name="com.sun.star.i18n.CharacterClassification_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Collator">
+ <service name="com.sun.star.i18n.Collator"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Collator_Unicode">
+ <service name="com.sun.star.i18n.Collator_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier">
+ <service name="com.sun.star.i18n.IndexEntrySupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_Unicode">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_Unicode"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_asian">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_asian"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)">
+ <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker">
+ <service name="com.sun.star.i18n.InputSequenceChecker"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker_hi">
+ <service name="com.sun.star.i18n.InputSequenceChecker_hi"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.InputSequenceChecker_th">
+ <service name="com.sun.star.i18n.InputSequenceChecker_th"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.LocaleData">
+ <service name="com.sun.star.i18n.LocaleData"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.NativeNumberSupplier">
+ <service name="com.sun.star.i18n.NativeNumberSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.NumberFormatCodeMapper">
+ <service name="com.sun.star.i18n.NumberFormatMapper"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.OrdinalSuffix">
+ <service name="com.sun.star.i18n.OrdinalSuffix"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.ScriptTypeDetector">
+ <service name="com.sun.star.i18n.ScriptTypeDetector"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion">
+ <service name="com.sun.star.i18n.TextConversion"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion_ko">
+ <service name="com.sun.star.i18n.TextConversion_ko"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.TextConversion_zh">
+ <service name="com.sun.star.i18n.TextConversion_zh"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration">
+ <service name="com.sun.star.i18n.Transliteration"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumEastIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumFullwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumIndic_hi">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumKanjiShort_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumKanjiTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNumUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.CharToNum_th">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTHKATAKANA_HALFWIDTHKATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTH_HALFWIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.FULLWIDTH_HALFWIDTH_LIKE_ASC">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTHKATAKANA_FULLWIDTHKATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HALFWIDTH_FULLWIDTH_LIKE_JIS">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.HIRAGANA_KATAKANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_KANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.IGNORE_WIDTH">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.KATAKANA_HIRAGANA">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.LOWERCASE_UPPERCASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharEastIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharFullwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharHalfwidth">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharIndic_ar">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharIndic_hi">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharKanjiShort_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharKanjiTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToCharUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToChar_th">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextAIUFullWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextAIUHalfWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextCircledNumber">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextDate_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextDiZi_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFormalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextFullwidth_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulCircledJamo_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulCircledSyllable_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulJamo_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextHangulSyllable_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextIROHAFullWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextIROHAHalfWidth_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextInformalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiLongModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiLongTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiShortModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextKanjiShortTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextTianGan_zh">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.NumToTextUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.SENTENCE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TITLE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TOGGLE_CASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToChuyin_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumFormalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalHangul_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalLower_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumInformalUpper_ko">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumKanjiLongModern_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumKanjiLongTraditional_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumLower_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumLower_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumUpper_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToNumUpper_zh_TW">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.TextToPinyin_zh_CN">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.UPPERCASE_LOWERCASE">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreBaFa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreHyuByu_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreIandEfollowedByYa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreIterationMark_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreKana">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreKiKuFollowedBySa_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreMiddleDot_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreMinusSign_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreProlongedSoundMark_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSeZe_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSeparator_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSize_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreSpace_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTiJi_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTraditionalKana_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreTraditionalKanji_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreZiZu_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.largeToSmall_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.smallToLarge_ja_JP">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
+ <implementation name="com.sun.star.text.DefaultNumberingProvider">
+ <service name="com.sun.star.text.DefaultNumberingProvider"/>
+ </implementation>
+</component>
diff --git a/i18npool/util/makefile.mk b/i18npool/util/makefile.mk
index 57f802be62fe..8c9f1a83b2c0 100644
--- a/i18npool/util/makefile.mk
+++ b/i18npool/util/makefile.mk
@@ -79,3 +79,11 @@ SHL1STDLIBS= \
# --- Targets ------------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/i18npool.component
+
+$(MISC)/i18npool.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ i18npool.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt i18npool.component
diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index 4b13a12bb290..9308d0c727a8 100644
--- a/l10ntools/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
@@ -113,7 +113,7 @@ protected:
CfgStack aStack;
CfgStackData *pStackData;
- BOOL bLocalize;
+ sal_Bool bLocalize;
virtual void WorkOnText(
ByteString &rText,
@@ -133,7 +133,7 @@ private:
const ByteString &rIsoLang,
const ByteString &rResTyp );
-BOOL IsTokenClosed( const ByteString &rToken );
+sal_Bool IsTokenClosed( const ByteString &rToken );
public:
CfgParser();
@@ -194,7 +194,7 @@ private:
ResData *pResData;
ByteString sFilename;
- BOOL bEnglish;
+ sal_Bool bEnglish;
protected:
void WorkOnText(
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 37524ac7fec6..999eac78ec0a 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -58,7 +58,7 @@
struct eqstr{
- BOOL operator()(const char* s1, const char* s2) const{
+ sal_Bool operator()(const char* s1, const char* s2) const{
return strcmp(s1,s2)==0;
}
};
@@ -110,11 +110,11 @@ class ExportList
{
private:
ExportListBase maList;
- ULONG nSourceLanguageListEntryCount;
+ sal_uLong nSourceLanguageListEntryCount;
public:
ExportList() { nSourceLanguageListEntryCount = 0; }
- ULONG GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; }
+ sal_uLong GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; }
void NewSourceLanguageListEntry() { nSourceLanguageListEntryCount++; }
size_t size() const { return maList.size(); }
void push_back( ExportListEntry* item ) { maList.push_back( item ); }
@@ -147,21 +147,21 @@ class ResData
{
public:
~ResData();
- BOOL SetId( const ByteString &rId, USHORT nLevel );
+ sal_Bool SetId( const ByteString &rId, sal_uInt16 nLevel );
- USHORT nWidth;
- USHORT nChildIndex;
- USHORT nIdLevel;
- BOOL bChild;
- BOOL bChildWithText;
+ sal_uInt16 nWidth;
+ sal_uInt16 nChildIndex;
+ sal_uInt16 nIdLevel;
+ sal_Bool bChild;
+ sal_Bool bChildWithText;
- BOOL bText;
- BOOL bHelpText;
- BOOL bQuickHelpText;
- BOOL bTitle;
- BOOL bList;
+ sal_Bool bText;
+ sal_Bool bHelpText;
+ sal_Bool bQuickHelpText;
+ sal_Bool bTitle;
+ sal_Bool bList;
- BOOL bRestMerged;
+ sal_Bool bRestMerged;
ByteString sResTyp;
ByteString sId;
@@ -170,16 +170,16 @@ public:
ByteString sFilename;
ByteStringHashMap sText;
- USHORT nTextRefId;
+ sal_uInt16 nTextRefId;
ByteStringHashMap sHelpText;
- USHORT nHelpTextRefId;
+ sal_uInt16 nHelpTextRefId;
ByteStringHashMap sQuickHelpText;
- USHORT nQuickHelpTextRefId;
+ sal_uInt16 nQuickHelpTextRefId;
ByteStringHashMap sTitle;
- USHORT nTitleRefId;
+ sal_uInt16 nTitleRefId;
ByteString sTextTyp;
ByteStringHashMap aFallbackData;
@@ -204,14 +204,14 @@ public:
nWidth( 0 ),
nChildIndex( 0 ),
nIdLevel( ID_LEVEL_NULL ),
- bChild( FALSE ),
- bChildWithText( FALSE ),
- bText( FALSE ),
- bHelpText( FALSE ),
- bQuickHelpText( FALSE ),
- bTitle( FALSE ),
- bList( FALSE ),
- bRestMerged( FALSE ),
+ bChild( sal_False ),
+ bChildWithText( sal_False ),
+ bText( sal_False ),
+ bHelpText( sal_False ),
+ bQuickHelpText( sal_False ),
+ bTitle( sal_False ),
+ bList( sal_False ),
+ bRestMerged( sal_False ),
sGId( rGId ),
nTextRefId( REFID_NONE ),
nHelpTextRefId( REFID_NONE ),
@@ -232,14 +232,14 @@ public:
:
nChildIndex( 0 ),
nIdLevel( ID_LEVEL_NULL ),
- bChild( FALSE ),
- bChildWithText( FALSE ),
- bText( FALSE ),
- bHelpText( FALSE ),
- bQuickHelpText( FALSE ),
- bTitle( FALSE ),
- bList( FALSE ),
- bRestMerged( FALSE ),
+ bChild( sal_False ),
+ bChildWithText( sal_False ),
+ bText( sal_False ),
+ bHelpText( sal_False ),
+ bQuickHelpText( sal_False ),
+ bTitle( sal_False ),
+ bList( sal_False ),
+ bRestMerged( sal_False ),
sGId( rGId ),
sFilename( rFilename ),
nTextRefId( REFID_NONE ),
@@ -303,23 +303,23 @@ private:
ByteString sActPForm; // hold cur. system
- BOOL bDefine; // cur. res. in a define?
- BOOL bNextMustBeDefineEOL; // define but no \ at lineend
- size_t nLevel; // res. recursiv? how deep?
- USHORT nList; // cur. res. is String- or FilterList
+ sal_Bool bDefine; // cur. res. in a define?
+ sal_Bool bNextMustBeDefineEOL; // define but no \ at lineend
+ sal_uLong nLevel; // res. recursiv? how deep?
+ sal_uInt16 nList; // cur. res. is String- or FilterList
ByteString nListLang;
- ULONG nListIndex;
- ULONG nListLevel;
+ sal_uLong nListIndex;
+ sal_uLong nListLevel;
bool bSkipFile;
ByteString sProject;
ByteString sRoot;
- BOOL bEnableExport;
- BOOL bMergeMode;
+ sal_Bool bEnableExport;
+ sal_Bool bMergeMode;
ByteString sMergeSrc;
ByteString sLastListLine;
- BOOL bError; // any errors while export?
- BOOL bReadOver;
- BOOL bDontWriteOutput;
+ sal_Bool bError; // any errors while export?
+ sal_Bool bReadOver;
+ sal_Bool bDontWriteOutput;
ByteString sLastTextTyp;
static bool isInitialized;
ByteString sFilename;
@@ -342,7 +342,7 @@ public:
static bool hasUTF8ByteOrderMarker( const ByteString &rString );
static void RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename );
static bool fileHasUTF8ByteOrderMarker( const ByteString &rString );
- static ByteString GetIsoLangByIndex( USHORT nIndex );
+ static ByteString GetIsoLangByIndex( sal_uInt16 nIndex );
static void QuotHTML( ByteString &rString );
static bool CopyFile( const ByteString& source , const ByteString& dest );
@@ -367,7 +367,7 @@ public:
static void FillInFallbacks( ResData *pResData );
static void FillInListFallbacks( ExportList *pList, const ByteString &nSource, const ByteString &nFallback );
static ByteString GetTimeStamp();
- static BOOL ConvertLineEnds( ByteString sSource, ByteString sDestination );
+ static sal_Bool ConvertLineEnds( ByteString sSource, ByteString sDestination );
static ByteString GetNativeFile( ByteString sSource );
static DirEntry GetTempFile();
@@ -378,11 +378,11 @@ private:
static std::vector<ByteString> aLanguages;
static std::vector<ByteString> aForcedLanguages;
- BOOL ListExists( ResData *pResData, USHORT nLst );
+ sal_Bool ListExists( ResData *pResData, sal_uInt16 nLst );
- BOOL WriteData( ResData *pResData, BOOL bCreateNew = FALSE );// called befor dest. cur ResData
- BOOL WriteExportList( ResData *pResData, ExportList *pExportList,
- const ByteString &rTyp, BOOL bCreateNew = FALSE );
+ sal_Bool WriteData( ResData *pResData, sal_Bool bCreateNew = sal_False );// called befor dest. cur ResData
+ sal_Bool WriteExportList( ResData *pResData, ExportList *pExportList,
+ const ByteString &rTyp, sal_Bool bCreateNew = sal_False );
ByteString MergePairedList( ByteString& sLine , ByteString& sText );
@@ -399,10 +399,10 @@ private:
void CleanValue( ByteString &rValue );
ByteString GetText( const ByteString &rSource, int nToken );
- BOOL PrepareTextToMerge( ByteString &rText, USHORT nTyp,
+ sal_Bool PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp,
ByteString &nLangIndex, ResData *pResData );
- void MergeRest( ResData *pResData, USHORT nMode = MERGE_MODE_NORMAL );
+ void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
void ConvertMergeContent( ByteString &rText );
void WriteToMerged( const ByteString &rText , bool bSDFContent );
@@ -411,17 +411,17 @@ private:
void CutComment( ByteString &rText );
public:
- Export( const ByteString &rOutput, BOOL bWrite,
+ Export( const ByteString &rOutput, sal_Bool bWrite,
const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile );
- Export( const ByteString &rOutput, BOOL bWrite,
+ Export( const ByteString &rOutput, sal_Bool bWrite,
const ByteString &rPrj, const ByteString &rPrjRoot,
const ByteString &rMergeSource , const ByteString& rFile );
~Export();
void Init();
int Execute( int nToken, const char * pToken ); // called from lexer
- void SetError() { bError = TRUE; }
- BOOL GetError() { return bError; }
+ void SetError() { bError = sal_True; }
+ sal_Bool GetError() { return bError; }
};
@@ -463,8 +463,8 @@ public:
sTitle[ nId ] = rTitle;
bTitleFirst[ nId ] = true;
}
- BOOL GetText( ByteString &rReturn, USHORT nTyp, const ByteString &nLangIndex, BOOL bDel = FALSE );
- BOOL GetTransex3Text( ByteString &rReturn, USHORT nTyp, const ByteString &nLangIndex, BOOL bDel = FALSE );
+ sal_Bool GetText( ByteString &rReturn, sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel = sal_False );
+ sal_Bool GetTransex3Text( ByteString &rReturn, sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel = sal_False );
};
@@ -498,7 +498,7 @@ public:
PFormEntrys* GetPFObject( const ByteString& rPFO );
ByteString Dump();
- BOOL operator==( ResData *pData );
+ sal_Bool operator==( ResData *pData );
};
//
@@ -511,39 +511,34 @@ public:
class MergeDataFile
{
-private:
- BOOL bErrorLog;
- ByteString sErrorLog;
- SvFileStream aErrLog;
- ByteStringSet aLanguageSet;
+ private:
+ sal_Bool bErrorLog;
+ ByteString sErrorLog;
+ SvFileStream aErrLog;
MergeDataHashMap aMap;
- ByteStringHashMap aLanguageMap;
- std::vector<ByteString> aLanguageList;
- ByteStringHashMap aFilenames;
-
+ std::set<ByteString> aLanguageSet;
-public:
- MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, bool bCaseSensitive = false );
- ~MergeDataFile();
+ MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false );
+ void InsertEntry( const ByteString &rTYP, const ByteString &rGID, const ByteString &rLID,
+ const ByteString &rPFO,
+ const ByteString &nLang, const ByteString &rTEXT,
+ const ByteString &rQHTEXT, const ByteString &rTITLE,
+ const ByteString &sFilename, bool bCaseSensitive
+ );
+ ByteString Dump();
+ void WriteError( const ByteString &rLine );
+ public:
+ MergeDataFile( const ByteString &rFileName, const ByteString& rFile , sal_Bool bErrLog, CharSet aCharSet, bool bCaseSensitive = false );
+ ~MergeDataFile();
- std::vector<ByteString> GetLanguages();
- MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false );
- PFormEntrys *GetPFormEntrys( ResData *pResData );
- PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData );
+ std::vector<ByteString> GetLanguages();
- void InsertEntry( const ByteString &rTYP, const ByteString &rGID, const ByteString &rLID,
- const ByteString &rPFO,
- const ByteString &nLang , const ByteString &rTEXT,
- const ByteString &rQHTEXT, const ByteString &rTITLE ,
- const ByteString &sFilename , bool bCaseSensitive
- );
- static USHORT GetLangIndex( USHORT nId );
- static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false );
+ PFormEntrys *GetPFormEntrys( ResData *pResData );
+ PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData );
- ByteString Dump();
- void WriteError( const ByteString &rLine );
+ static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false );
};
diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx
index 660ddadd303a..971f85016fbd 100644
--- a/l10ntools/inc/gsicheck.hxx
+++ b/l10ntools/inc/gsicheck.hxx
@@ -43,7 +43,7 @@ private:
ParserMessageList aMessages;
LineFormat aFormat;
- ULONG nLineNumber;
+ sal_uLong nLineNumber;
ByteString aUniqId;
ByteString aLineType;
@@ -52,15 +52,15 @@ private:
ByteString aQuickHelpText;
ByteString aTitle;
- BOOL bOK;
- BOOL bFixed;
+ sal_Bool bOK;
+ sal_Bool bFixed;
void ReassembleLine();
public:
- GSILine( const ByteString &rLine, ULONG nLine );
+ GSILine( const ByteString &rLine, sal_uLong nLine );
LineFormat GetLineFormat() const { return aFormat; }
- ULONG GetLineNumber() const { return nLineNumber; }
+ sal_uLong GetLineNumber() const { return nLineNumber; }
ByteString const GetUniqId() const { return aUniqId; }
ByteString const GetLineType() const { return aLineType; }
@@ -76,13 +76,13 @@ public:
void SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); }
ParserMessageList* GetMessageList() { return &aMessages; };
- BOOL HasMessages(){ return ( !aMessages.empty() ); };
+ sal_Bool HasMessages(){ return ( aMessages.size() > 0 ); };
- BOOL IsOK() const { return bOK; }
+ sal_Bool IsOK() const { return bOK; }
void NotOK();
- BOOL IsFixed() const { return bFixed; }
- void SetFixed() { bFixed = TRUE; };
+ sal_Bool IsFixed() const { return bFixed; }
+ void SetFixed() { bFixed = sal_True; };
};
//
@@ -100,31 +100,31 @@ private:
GSILine *pSourceLine;
GSILine *pReferenceLine;
void PrintList( ParserMessageList *pList, ByteString aPrefix, GSILine *pLine );
- BOOL bPrintContext;
- BOOL bCheckSourceLang;
- BOOL bCheckTranslationLang;
- BOOL bReference;
- BOOL bAllowKeyIDs;
- BOOL bAllowSuspicious;
+ sal_Bool bPrintContext;
+ sal_Bool bCheckSourceLang;
+ sal_Bool bCheckTranslationLang;
+ sal_Bool bReference;
+ sal_Bool bAllowKeyIDs;
+ sal_Bool bAllowSuspicious;
- BOOL bHasBlockError;
+ sal_Bool bHasBlockError;
- BOOL IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const;
- BOOL TestUTF8( GSILine* pTestee, BOOL bFixTags );
- BOOL HasSuspiciousChars( GSILine* pTestee, GSILine* pSource );
+ sal_Bool IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uInt16 &nErrorPos, ByteString &aErrorMsg, sal_Bool &bHasBeenFixed, ByteString &aFixed ) const;
+ sal_Bool TestUTF8( GSILine* pTestee, sal_Bool bFixTags );
+ sal_Bool HasSuspiciousChars( GSILine* pTestee, GSILine* pSource );
public:
- GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp );
+ GSIBlock( sal_Bool PbPrintContext, sal_Bool bSource, sal_Bool bTrans, sal_Bool bRef, sal_Bool bAllowKID, sal_Bool bAllowSusp );
~GSIBlock();
- void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() );
- void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() );
+ void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, ByteString aContext, sal_uLong nLine, ByteString aUniqueId = ByteString() );
+ void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, sal_uLong nLine, ByteString aUniqueId = ByteString() );
void InsertLine( GSILine* pLine, const ByteString aSourceLang);
void SetReferenceLine( GSILine* pLine );
- BOOL CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags );
+ sal_Bool CheckSyntax( sal_uLong nLine, sal_Bool bRequireSourceLine, sal_Bool bFixTags );
- void WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine );
- void WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine );
- void WriteFixed( LazySvFileStream &aFixOut, BOOL bRequireSourceLine );
+ void WriteError( LazySvFileStream &aErrOut, sal_Bool bRequireSourceLine );
+ void WriteCorrect( LazySvFileStream &aOkOut, sal_Bool bRequireSourceLine );
+ void WriteFixed( LazySvFileStream &aFixOut, sal_Bool bRequireSourceLine );
};
#endif
diff --git a/l10ntools/inc/l10ntools/vosapp.hxx b/l10ntools/inc/l10ntools/vosapp.hxx
index e45840b4f9df..e8e97fb71fef 100644
--- a/l10ntools/inc/l10ntools/vosapp.hxx
+++ b/l10ntools/inc/l10ntools/vosapp.hxx
@@ -10,18 +10,18 @@
class Application
{
public:
- USHORT GetCommandLineParamCount();
- XubString GetCommandLineParam( USHORT nParam );
+ sal_uInt16 GetCommandLineParamCount();
+ XubString GetCommandLineParam( sal_uInt16 nParam );
virtual void Main() = 0;
};
// Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl
-USHORT Application::GetCommandLineParamCount()
+sal_uInt16 Application::GetCommandLineParamCount()
{
return osl_getCommandArgCount();
}
-XubString Application::GetCommandLineParam( USHORT nParam )
+XubString Application::GetCommandLineParam( sal_uInt16 nParam )
{
rtl::OUString aParam;
osl_getCommandArg( nParam, &aParam.pData );
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 7dbe884bb868..8aaf98d3d782 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -45,11 +45,11 @@ typedef ::std::vector< ByteString* > LngLineList;
class LngParser
{
private:
- USHORT nError;
+ sal_uInt16 nError;
LngLineList *pLines;
ByteString sSource;
- BOOL bDBIsUTF8;
- BOOL bULF;
+ sal_Bool bDBIsUTF8;
+ sal_Bool bULF;
bool bQuiet;
std::vector<ByteString> aLanguages;
@@ -60,11 +60,11 @@ private:
const ByteString &rPrj ,
const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID );
public:
- LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat );
+ LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat );
~LngParser();
- BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
- BOOL Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj );
+ sal_Bool CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
+ sal_Bool Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/inc/srciter.hxx b/l10ntools/inc/srciter.hxx
index 6583381359a4..c859d2356c1a 100644
--- a/l10ntools/inc/srciter.hxx
+++ b/l10ntools/inc/srciter.hxx
@@ -50,7 +50,7 @@ public:
SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in = false);
virtual ~SourceTreeIterator();
- BOOL StartExecute();
+ sal_Bool StartExecute();
void EndExecute();
virtual void OnExecuteDirectory( const rtl::OUString &rDirectory );
diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx
index f905ec627d72..1a41f508533f 100644
--- a/l10ntools/inc/tagtest.hxx
+++ b/l10ntools/inc/tagtest.hxx
@@ -35,9 +35,9 @@
class GSILine;
-typedef USHORT TokenId;
+typedef sal_uInt16 TokenId;
-#define TOK_INVALIDPOS USHORT( 0xFFFF )
+#define TOK_INVALIDPOS sal_uInt16( 0xFFFF )
class ParserMessage;
typedef ::std::vector< ParserMessage* > Impl_ParserMessageList;
@@ -71,24 +71,24 @@ private:
String aTagName;
StringHashMap aProperties;
- BOOL bClosed; // tag is closed <sdnf/>
- BOOL bCloseTag; // tag is close Tag </sdnf>
+ sal_Bool bClosed; // tag is closed <sdnf/>
+ sal_Bool bCloseTag; // tag is close Tag </sdnf>
- BOOL bIsBroken;
- BOOL bHasBeenFixed;
- BOOL bDone;
+ sal_Bool bIsBroken;
+ sal_Bool bHasBeenFixed;
+ sal_Bool bDone;
public:
String aTokenString;
TokenId nId;
- USHORT nPos; // Position in String
+ sal_uInt16 nPos; // Position in String
- TokenInfo():bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( 0 ){;}
-explicit TokenInfo( TokenId pnId, USHORT nP ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( pnId ),nPos(nP){;}
-explicit TokenInfo( TokenId pnId, USHORT nP, String paStr ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),aTokenString( paStr ),nId( pnId ),nPos(nP) {;}
-explicit TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList );
+ TokenInfo():bClosed(sal_False),bCloseTag(sal_False),bIsBroken(sal_False),bHasBeenFixed(sal_False),bDone(sal_False),nId( 0 ){;}
+explicit TokenInfo( TokenId pnId, sal_uInt16 nP ):bClosed(sal_False),bCloseTag(sal_False),bIsBroken(sal_False),bHasBeenFixed(sal_False),bDone(sal_False),nId( pnId ),nPos(nP){;}
+explicit TokenInfo( TokenId pnId, sal_uInt16 nP, String paStr ):bClosed(sal_False),bCloseTag(sal_False),bIsBroken(sal_False),bHasBeenFixed(sal_False),bDone(sal_False),aTokenString( paStr ),nId( pnId ),nPos(nP) {;}
+explicit TokenInfo( TokenId pnId, sal_uInt16 nP, String paStr, ParserMessageList &rErrorList );
String GetTagName() const;
@@ -97,25 +97,25 @@ explicit TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList
/**
Is the property to be ignored or does it have the default value anyways
**/
- BOOL IsPropertyRelevant( const ByteString &aName, const String &aValue ) const;
- BOOL IsPropertyValueValid( const ByteString &aName, const String &aValue ) const;
+ sal_Bool IsPropertyRelevant( const ByteString &aName, const String &aValue ) const;
+ sal_Bool IsPropertyValueValid( const ByteString &aName, const String &aValue ) const;
/**
Does the property contain the same value for all languages
e.g.: the href in a link tag
**/
- BOOL IsPropertyInvariant( const ByteString &aName, const String &aValue ) const;
+ sal_Bool IsPropertyInvariant( const ByteString &aName, const String &aValue ) const;
/**
a subset of IsPropertyInvariant but containing only those that are fixable
we dont wat to fix e.g.: ahelp :: visibility
**/
- BOOL IsPropertyFixable( const ByteString &aName ) const;
- BOOL MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags = FALSE ) const;
+ sal_Bool IsPropertyFixable( const ByteString &aName ) const;
+ sal_Bool MatchesTranslation( TokenInfo& rInfo, sal_Bool bGenErrors, ParserMessageList &rErrorList, sal_Bool bFixTags = sal_False ) const;
- BOOL IsDone() const { return bDone; }
- void SetDone( BOOL bNew = TRUE ) { bDone = bNew; }
+ sal_Bool IsDone() const { return bDone; }
+ void SetDone( sal_Bool bNew = sal_True ) { bDone = bNew; }
- BOOL HasBeenFixed() const { return bHasBeenFixed; }
- void SetHasBeenFixed( BOOL bNew = TRUE ) { bHasBeenFixed = bNew; }
+ sal_Bool HasBeenFixed() const { return bHasBeenFixed; }
+ void SetHasBeenFixed( sal_Bool bNew = sal_True ) { bHasBeenFixed = bNew; }
};
@@ -126,10 +126,10 @@ private:
public:
~ParserMessageList() { clear(); }
- void AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
- void AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
+ void AddError( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
+ void AddWarning( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag );
- BOOL HasErrors();
+ sal_Bool HasErrors();
bool empty() const { return maList.empty(); }
size_t size() const { return maList.size(); }
ParserMessage* operator [] ( size_t i ) { return ( i < maList.size() ) ? maList[ i ] : NULL; }
@@ -261,54 +261,54 @@ public:
class ParserMessage
{
- USHORT nErrorNr;
+ sal_uInt16 nErrorNr;
ByteString aErrorText;
- USHORT nTagBegin,nTagLength;
+ sal_uInt16 nTagBegin,nTagLength;
protected:
- ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
+ ParserMessage( sal_uInt16 PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
public:
- USHORT GetErrorNr() { return nErrorNr; }
+ sal_uInt16 GetErrorNr() { return nErrorNr; }
ByteString GetErrorText() { return aErrorText; }
- USHORT GetTagBegin() { return nTagBegin; }
- USHORT GetTagLength() { return nTagLength; }
+ sal_uInt16 GetTagBegin() { return nTagBegin; }
+ sal_uInt16 GetTagLength() { return nTagLength; }
virtual ~ParserMessage() {}
- virtual BOOL IsError() =0;
+ virtual sal_Bool IsError() =0;
virtual ByteString Prefix() =0;
};
class ParserError : public ParserMessage
{
public:
- ParserError( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
+ ParserError( sal_uInt16 PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
- virtual BOOL IsError() {return TRUE;};
+ virtual sal_Bool IsError() {return sal_True;};
virtual ByteString Prefix() {return "Error:"; };
};
class ParserWarning : public ParserMessage
{
public:
- ParserWarning( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
+ ParserWarning( sal_uInt16 PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag );
- virtual BOOL IsError() {return FALSE;};
+ virtual sal_Bool IsError() {return sal_False;};
virtual ByteString Prefix() {return "Warning:"; };
};
class SimpleParser
{
private:
- USHORT nPos;
+ sal_uInt16 nPos;
String aSource;
String aLastToken;
TokenList aTokenList;
TokenInfo aNextTag; // to store closetag in case of combined tags like <br/>
- String GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTokeStartPos );
+ String GetNextTokenString( ParserMessageList &rErrorList, sal_uInt16 &rTokeStartPos );
public:
SimpleParser();
@@ -320,9 +320,9 @@ public:
class TokenParser
{
- BOOL match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken );
- BOOL match( const TokenInfo &aCurrentToken, const TokenInfo &aExpectedToken );
- void ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo &rTag );
+ sal_Bool match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken );
+ sal_Bool match( const TokenInfo &aCurrentToken, const TokenInfo &aExpectedToken );
+ void ParseError( sal_uInt16 nErrNr, ByteString aErrMsg, const TokenInfo &rTag );
void Paragraph();
void PfCase();
void PfCaseBegin();
@@ -338,7 +338,7 @@ class TokenParser
TokenId nPfCaseOptions;
TokenId nAppCaseOptions;
- BOOL bPfCaseActive ,bAppCaseActive;
+ sal_Bool bPfCaseActive ,bAppCaseActive;
TokenId nActiveRefTypes;
@@ -356,15 +356,15 @@ private:
TokenParser aReferenceParser;
TokenParser aTesteeParser;
ParserMessageList aCompareWarningList;
- void CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags );
- BOOL IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens );
+ void CheckTags( TokenList &aReference, TokenList &aTestee, sal_Bool bFixTags );
+ sal_Bool IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens );
String aFixedTestee;
public:
void CheckReference( GSILine *aReference );
- void CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags );
+ void CheckTestee( GSILine *aTestee, sal_Bool bHasSourceLine, sal_Bool bFixTags );
ParserMessageList& GetCompareWarnings(){ return aCompareWarningList; }
- BOOL HasCompareWarnings(){ return ( !aCompareWarningList.empty() ); }
+ sal_Bool HasCompareWarnings(){ return ( !aCompareWarningList.empty() ); }
String GetFixedTestee(){ return aFixedTestee; }
};
diff --git a/l10ntools/inc/wtranode.hxx b/l10ntools/inc/wtranode.hxx
index 6283f4ea0c93..b2c10e07d2d2 100644
--- a/l10ntools/inc/wtranode.hxx
+++ b/l10ntools/inc/wtranode.hxx
@@ -81,7 +81,7 @@ class WTT_Node // WordTransTree-Node
// INQUIRY
E_TokenType TokenType() const;
UINT8 Value() const;
- BOOL IsOnDeleting() const;
+ sal_Bool IsOnDeleting() const;
const ByteString & ReplaceString() const;
private:
@@ -103,7 +103,7 @@ WTT_Node::TokenType() const
inline UINT8
WTT_Node::Value() const
{ return nValue; }
-inline BOOL
+inline sal_Bool
WTT_Node::IsOnDeleting() const
{ return bIsOnDeleting; }
inline const ByteString &
diff --git a/l10ntools/inc/wtratree.hxx b/l10ntools/inc/wtratree.hxx
index a658d27fd1ee..c06be49b183c 100644
--- a/l10ntools/inc/wtratree.hxx
+++ b/l10ntools/inc/wtratree.hxx
@@ -82,7 +82,7 @@ class WordTransTree
E_Result TransformNextToken();
// INQUIRY
- BOOL TextEndReached() const;
+ sal_Bool TextEndReached() const;
const char * Output() const;
// These 3 functions are valid between two calls of
@@ -133,7 +133,7 @@ class WordTransTree
-inline BOOL
+inline sal_Bool
WordTransTree::TextEndReached() const
{ return pInputPosition == pInputEnd; }
inline const char *
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 5a25b3d65959..9f67e7343633 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -86,7 +86,7 @@ public:
void setValue(const String &rValue){sValue=rValue;}
/// returns true if two attributes are equal and have the same value
- BOOL IsEqual(
+ sal_Bool IsEqual(
const XMLAttribute &rAttribute // the attribute which has to be equal
)
{
@@ -106,7 +106,7 @@ protected:
XMLNode() {}
public:
- virtual USHORT GetNodeType() = 0;
+ virtual sal_uInt16 GetNodeType() = 0;
virtual ~XMLNode() {}
};
@@ -125,7 +125,7 @@ protected:
XMLChildNode( const XMLChildNode& obj);
XMLChildNode& operator=(const XMLChildNode& obj);
public:
- virtual USHORT GetNodeType() = 0;
+ virtual sal_uInt16 GetNodeType() = 0;
/// returns the parent of this node
XMLParentNode *GetParent() { return pParent; }
@@ -161,7 +161,7 @@ protected:
public:
- virtual USHORT GetNodeType() = 0;
+ virtual sal_uInt16 GetNodeType() = 0;
/// returns child list of this node
XMLChildNodeList *GetChildList() { return pChildList; }
@@ -198,7 +198,7 @@ typedef boost::unordered_map<ByteString , LangHashMap* ,
typedef boost::unordered_map<ByteString, int, hashByteString,equalByteString> HashMap;
/// Mapping XML tag names <-> have localizable strings
-typedef boost::unordered_map<ByteString , BOOL ,
+typedef boost::unordered_map<ByteString , sal_Bool ,
hashByteString,equalByteString> TagMap;
/** Holds information of a XML file, is root node of tree
@@ -216,7 +216,7 @@ public:
~XMLFile();
ByteString* GetGroupID(std::deque<ByteString> &groupid);
- void Print( XMLNode *pCur = NULL, USHORT nLevel = 0 );
+ void Print( XMLNode *pCur = NULL, sal_uInt16 nLevel = 0 );
virtual void SearchL10NElements( XMLParentNode *pCur, int pos = 0 );
void Extract( XMLFile *pCur = NULL );
void View();
@@ -224,14 +224,14 @@ public:
void showType(XMLParentNode* node);
XMLHashMap* GetStrings(){return XMLStrings;}
- BOOL Write( ByteString &rFilename );
- BOOL Write( ofstream &rStream , XMLNode *pCur = NULL );
+ sal_Bool Write( ByteString &rFilename );
+ sal_Bool Write( ofstream &rStream , XMLNode *pCur = NULL );
bool CheckExportStatus( XMLParentNode *pCur = NULL );// , int pos = 0 );
XMLFile& operator=(const XMLFile& obj);
- virtual USHORT GetNodeType();
+ virtual sal_uInt16 GetNodeType();
/// returns file name
const String &GetName() { return sFileName; }
@@ -272,10 +272,10 @@ public:
static void UnQuotHTML ( String &rString );
/// Return the numeric iso language code
- //USHORT GetLangByIsoLang( const ByteString &rIsoLang );
+ //sal_uInt16 GetLangByIsoLang( const ByteString &rIsoLang );
/// Return the alpha strings representation
- ByteString GetIsoLangByIndex( USHORT nIndex );
+ ByteString GetIsoLangByIndex( sal_uInt16 nIndex );
static XMLUtil& Instance();
~XMLUtil();
@@ -341,7 +341,7 @@ public:
XMLElement& operator=(const XMLElement& obj);
/// returns node type XML_NODE_ELEMENT
- virtual USHORT GetNodeType();
+ virtual sal_uInt16 GetNodeType();
/// returns element name
const String &GetName() { return sElementName; }
@@ -411,7 +411,7 @@ public:
XMLData(const XMLData& obj);
XMLData& operator=(const XMLData& obj);
- virtual USHORT GetNodeType();
+ virtual sal_uInt16 GetNodeType();
/// returns the data
const String &GetData() { return sData; }
@@ -443,7 +443,7 @@ public:
)
: XMLChildNode( Parent ), sComment( rComment ) {}
- virtual USHORT GetNodeType();
+ virtual sal_uInt16 GetNodeType();
XMLComment( const XMLComment& obj );
@@ -475,7 +475,7 @@ public:
XMLDefault& operator=(const XMLDefault& obj);
/// returns node type XML_NODE_TYPE_COMMENT
- virtual USHORT GetNodeType();
+ virtual sal_uInt16 GetNodeType();
/// returns the comment
const String &GetDefault() { return sDefault; }
@@ -487,8 +487,8 @@ public:
*/
struct XMLError {
XML_Error eCode; // the error code
- ULONG nLine; // error line number
- ULONG nColumn; // error column number
+ sal_uLong nLine; // error line number
+ sal_uLong nColumn; // error column number
String sMessage; // readable error message
};
diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx
index 7be4d5dc70d0..f0b213a54ce3 100644
--- a/l10ntools/inc/xrmmerge.hxx
+++ b/l10ntools/inc/xrmmerge.hxx
@@ -39,8 +39,8 @@ private:
ByteString sGID;
ByteString sLID;
- BOOL bError;
- BOOL bText;
+ sal_Bool bError;
+ sal_Bool bText;
bool sLocalized;
@@ -75,8 +75,8 @@ public:
int Execute( int nToken, char * pToken );
- void SetError( BOOL bErr = TRUE ) { bError = bErr; }
- BOOL GetError() { return bError; }
+ void SetError( sal_Bool bErr = sal_True ) { bError = bErr; }
+ sal_Bool GetError() { return bError; }
};
//
diff --git a/l10ntools/layout/layoutparse.cxx b/l10ntools/layout/layoutparse.cxx
index 2d0e2f51b7f5..d3d80b6e95af 100644
--- a/l10ntools/layout/layoutparse.cxx
+++ b/l10ntools/layout/layoutparse.cxx
@@ -121,7 +121,7 @@ void LayoutXMLFile::InsertL10NElement( ByteString const& id, XMLElement* element
(*languageMap)[ language ] = element;
}
-BOOL LayoutXMLFile::Write( ByteString &aFilename )
+sal_Bool LayoutXMLFile::Write( ByteString &aFilename )
{
if ( aFilename.Len() )
diff --git a/l10ntools/layout/layoutparse.hxx b/l10ntools/layout/layoutparse.hxx
index 454ff0926bd0..a9155eaa7503 100644
--- a/l10ntools/layout/layoutparse.hxx
+++ b/l10ntools/layout/layoutparse.hxx
@@ -39,7 +39,7 @@ public:
LayoutXMLFile( bool mergeMode );
void SearchL10NElements( XMLParentNode *pCur, int pos = 0 );
- BOOL Write( ByteString &aFilename );
+ sal_Bool Write( ByteString &aFilename );
void HandleElement( XMLElement* element );
void InsertL10NElement( ByteString const& id, XMLElement* element );
diff --git a/l10ntools/layout/tralay.cxx b/l10ntools/layout/tralay.cxx
index b4600e3a2d77..8fc55c2e5428 100644
--- a/l10ntools/layout/tralay.cxx
+++ b/l10ntools/layout/tralay.cxx
@@ -114,7 +114,7 @@ static ByteString ConvertSystemPath( const ByteString& rPath )
ByteString TranslateLayout::GetCommandLineParam( int i )
{
- return ByteString( OUSTRING_CSTR( Application::GetCommandLineParam( sal::static_int_cast< USHORT >( i ) ) ) );
+ return ByteString( OUSTRING_CSTR( Application::GetCommandLineParam( sal::static_int_cast< sal_uInt16 >( i ) ) ) );
}
ByteString TranslateLayout::GetOptionArgument( int const i )
@@ -274,7 +274,7 @@ void TranslateLayout::MergeLanguage( ByteString const& language )
ByteString xmlFile = mFiles.front();
MergeDataFile mergeData( mLocalize, xmlFile,
- FALSE, RTL_TEXTENCODING_MS_1252 );
+ sal_False, RTL_TEXTENCODING_MS_1252 );
DirEntry aFile( xmlFile );
SimpleXMLParser aParser;
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 340357cca45b..340357cca45b 100644..100755
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py
index d8933331cf3f..6b1a75c775d4 100644
--- a/l10ntools/scripts/tool/l10ntool.py
+++ b/l10ntools/scripts/tool/l10ntool.py
@@ -116,6 +116,16 @@ class AbstractL10nTool:
return self._options.inputfile[0] == '@'
def copy_file(self, inputfilename, outputfilename):
+ try:
+ os.remove(outputfilename)
+ except:
+ pass
+
+ try:
+ os.remove(outputfilename)
+ except:
+ pass
+
try:
shutil.copy(inputfilename, outputfilename)
except IOError:
diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex
index d337694c589b..5409f179777d 100755
--- a/l10ntools/scripts/xhtex
+++ b/l10ntools/scripts/xhtex
@@ -31,8 +31,16 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
else
exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+else
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+fi
+fi
diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex
index 01a70ae57d80..39da89fd81ce 100755
--- a/l10ntools/scripts/xtxex
+++ b/l10ntools/scripts/xtxex
@@ -31,9 +31,17 @@ if [ x${SOLARENV}x = xx ]; then
exit 1
fi
+if [ ${GUI} = "WNT" ]; then
if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
else
exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
fi
+else
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+else
+ exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+fi
+fi
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 5e55e5823a79..5a007c175216 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -55,11 +55,11 @@ extern "C" { int YYWarning( char * ); }
#define STATE_FORCE 0x000B
// set of global variables
-BOOL bEnableExport;
-BOOL bMergeMode;
-BOOL bErrorLog;
-BOOL bForce;
-BOOL bUTF8;
+sal_Bool bEnableExport;
+sal_Bool bMergeMode;
+sal_Bool bErrorLog;
+sal_Bool bForce;
+sal_Bool bUTF8;
ByteString sPrj;
ByteString sPrjRoot;
ByteString sInputFileName;
@@ -78,18 +78,18 @@ extern "C" {
extern char *GetOutputFile( int argc, char* argv[])
/*****************************************************************************/
{
- bEnableExport = FALSE;
- bMergeMode = FALSE;
- bErrorLog = TRUE;
- bForce = FALSE;
- bUTF8 = TRUE;
+ bEnableExport = sal_False;
+ bMergeMode = sal_False;
+ bErrorLog = sal_True;
+ bForce = sal_False;
+ bUTF8 = sal_True;
sPrj = "";
sPrjRoot = "";
sInputFileName = "";
sActFileName = "";
- USHORT nState = STATE_NON;
- BOOL bInput = FALSE;
+ sal_uInt16 nState = STATE_NON;
+ sal_Bool bInput = sal_False;
// parse command line
for( int i = 1; i < argc; i++ ) {
@@ -113,19 +113,19 @@ extern char *GetOutputFile( int argc, char* argv[])
}
else if ( sSwitch == "-E" ) {
nState = STATE_ERRORLOG;
- bErrorLog = FALSE;
+ bErrorLog = sal_False;
}
else if ( sSwitch == "-UTF8" ) {
nState = STATE_UTF8;
- bUTF8 = TRUE;
+ bUTF8 = sal_True;
}
else if ( sSwitch == "-NOUTF8" ) {
nState = STATE_UTF8;
- bUTF8 = FALSE;
+ bUTF8 = sal_False;
}
else if ( sSwitch == "-F" ) {
nState = STATE_FORCE;
- bForce = TRUE;
+ bForce = sal_True;
}
else if ( sSwitch == "-L" ) {
nState = STATE_LANGUAGES;
@@ -140,7 +140,7 @@ extern char *GetOutputFile( int argc, char* argv[])
}
case STATE_INPUT: {
sInputFileName = argv[ i ];
- bInput = TRUE; // source file found
+ bInput = sal_True; // source file found
}
break;
case STATE_OUTPUT: {
@@ -158,7 +158,7 @@ extern char *GetOutputFile( int argc, char* argv[])
break;
case STATE_MERGESRC: {
sMergeSrc = ByteString( argv[ i ]);
- bMergeMode = TRUE; // activate merge mode, cause merge database found
+ bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
@@ -171,7 +171,7 @@ extern char *GetOutputFile( int argc, char* argv[])
if ( bInput ) {
// command line is valid
- bEnableExport = TRUE;
+ bEnableExport = sal_True;
char *pReturn = new char[ sOutputFile.Len() + 1 ];
strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked
return pReturn;
@@ -355,7 +355,7 @@ CfgStackData *CfgStack::GetStackData( size_t nPos )
CfgParser::CfgParser()
/*****************************************************************************/
: pStackData( NULL ),
- bLocalize( FALSE )
+ bLocalize( sal_False )
{
}
@@ -367,7 +367,7 @@ CfgParser::~CfgParser()
/*****************************************************************************/
-BOOL CfgParser::IsTokenClosed( const ByteString &rToken )
+sal_Bool CfgParser::IsTokenClosed( const ByteString &rToken )
/*****************************************************************************/
{
return rToken.GetChar( rToken.Len() - 2 ) == '/';
@@ -381,7 +381,7 @@ void CfgParser::AddText(
)
/*****************************************************************************/
{
- USHORT nTextLen = 0;
+ sal_uInt16 nTextLen = 0;
while ( rText.Len() != nTextLen ) {
nTextLen = rText.Len();
rText.SearchAndReplaceAll( "\n", " " );
@@ -414,7 +414,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
ByteString sTokenName;
ByteString sTokenId;
- BOOL bOutput = TRUE;
+ sal_Bool bOutput = sal_True;
switch ( nToken ) {
case CFG_TOKEN_PACKAGE:
@@ -446,7 +446,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
break;
case CFG_TOKEN_OORNAME:
sSearch = "oor:name=";
- bLocalize = TRUE;
+ bLocalize = sal_True;
break;
case CFG_TOKEN_OORVALUE:
sSearch = "oor:value=";
@@ -466,7 +466,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
sCurrentIsoLang = sTemp.GetToken( 1, '\"' ).GetToken( 0, '\"' );
if ( sCurrentIsoLang == NO_TRANSLATE_ISO )
- bLocalize = FALSE;
+ bLocalize = sal_False;
pStackData->sTextTag = sToken;
@@ -484,7 +484,7 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
ByteString sTemp( sToken );
sTemp.ToUpperAscii();
bLocalize = (( sTemp.Search( "CFG:TYPE=\"STRING\"" ) != STRING_NOTFOUND ) &&
- ( sTemp.Search( "CFG:LOCALIZED=\"TRUE\"" ) != STRING_NOTFOUND ));
+ ( sTemp.Search( "CFG:LOCALIZED=\"sal_True\"" ) != STRING_NOTFOUND ));
}
}
else if ( sTokenName == "label" ) {
@@ -521,11 +521,11 @@ int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken )
case CFG_TEXTCHAR:
sCurrentText += sToken;
- bOutput = FALSE;
+ bOutput = sal_False;
break;
case CFG_TOKEN_NO_TRANSLATE:
- bLocalize = FALSE;
+ bLocalize = sal_False;
break;
}
@@ -723,7 +723,7 @@ CfgMerge::CfgMerge(
pMergeDataFile( NULL ),
pResData( NULL ),
sFilename( rFilename ),
- bEnglish( FALSE )
+ bEnglish( sal_False )
{
if ( rMergeSource.Len()){
pMergeDataFile = new MergeDataFile(
@@ -773,7 +773,7 @@ void CfgMerge::WorkOnText(
}
if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") ))
- bEnglish = TRUE;
+ bEnglish = sal_True;
PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData );
if ( pEntrys ) {
@@ -821,7 +821,7 @@ void CfgMerge::WorkOnRessourceEnd()
sCur = aLanguages[ n ];
ByteString sContent;
- pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , TRUE );
+ pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , sal_True );
if (
( !sCur.EqualsIgnoreCaseAscii("en-US") ) &&
@@ -862,7 +862,7 @@ void CfgMerge::WorkOnRessourceEnd()
}
delete pResData;
pResData = NULL;
- bEnglish = FALSE;
+ bEnglish = sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx
index dbe7f67a0b1a..05823c74ba14 100644
--- a/l10ntools/source/directory.cxx
+++ b/l10ntools/source/directory.cxx
@@ -107,7 +107,7 @@ void Directory::readDirectory()
void Directory::readDirectory ( const rtl::OUString& sFullpath )
{
- BOOL fFinished;
+ sal_Bool fFinished;
HANDLE hList;
TCHAR szDir[MAX_PATH+1];
TCHAR szSubDir[MAX_PATH+1];
@@ -128,7 +128,7 @@ void Directory::readDirectory ( const rtl::OUString& sFullpath )
}
else
{
- fFinished = FALSE;
+ fFinished = sal_False;
while (!fFinished)
{
@@ -157,7 +157,7 @@ void Directory::readDirectory ( const rtl::OUString& sFullpath )
{
if (GetLastError() == ERROR_NO_MORE_FILES)
{
- fFinished = TRUE;
+ fFinished = sal_True;
}
}
}
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 1c91379d3587..e3ee7aee552a 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -58,12 +58,12 @@ Export *pExport = 0L;
// set of global variables
typedef ::std::vector< ByteString* > FileList;
FileList aInputFileList;
-BOOL bEnableExport;
-BOOL bMergeMode;
-BOOL bErrorLog;
-BOOL bBreakWhenHelpText;
-BOOL bUnmerge;
-BOOL bUTF8;
+sal_Bool bEnableExport;
+sal_Bool bMergeMode;
+sal_Bool bErrorLog;
+sal_Bool bBreakWhenHelpText;
+sal_Bool bUnmerge;
+sal_Bool bUTF8;
ByteString sPrj;
ByteString sPrjRoot;
ByteString sActFileName;
@@ -86,12 +86,12 @@ extern "C" {
extern char *GetOutputFile( int argc, char* argv[])
/*****************************************************************************/
{
- bEnableExport = FALSE;
- bMergeMode = FALSE;
- bErrorLog = TRUE;
- bBreakWhenHelpText = FALSE;
- bUnmerge = FALSE;
- bUTF8 = TRUE;
+ bEnableExport = sal_False;
+ bMergeMode = sal_False;
+ bErrorLog = sal_True;
+ bBreakWhenHelpText = sal_False;
+ bUnmerge = sal_False;
+ bUTF8 = sal_True;
sPrj = "";
sPrjRoot = "";
sActFileName = "";
@@ -99,8 +99,8 @@ extern char *GetOutputFile( int argc, char* argv[])
Export::sForcedLanguages = "";
sTempFile = "";
pTempFile = NULL;
- USHORT nState = STATE_NON;
- BOOL bInput = FALSE;
+ sal_uInt16 nState = STATE_NON;
+ sal_Bool bInput = sal_False;
// parse command line
for( int i = 1; i < argc; i++ ) {
@@ -124,24 +124,24 @@ extern char *GetOutputFile( int argc, char* argv[])
}
else if (sSwitch == "-e" || sSwitch == "-E" ) {
nState = STATE_ERRORLOG;
- bErrorLog = FALSE;
+ bErrorLog = sal_False;
}
else if (sSwitch == "-b" || sSwitch == "-B" ) {
nState = STATE_BREAKHELP;
- bBreakWhenHelpText = TRUE;
+ bBreakWhenHelpText = sal_True;
}
else if (sSwitch == "-u" || sSwitch == "-U" ) {
nState = STATE_UNMERGE;
- bUnmerge = TRUE;
- bMergeMode = TRUE;
+ bUnmerge = sal_True;
+ bMergeMode = sal_True;
}
else if ( sSwitch.ToUpperAscii() == "-UTF8" ) {
nState = STATE_UTF8;
- bUTF8 = TRUE;
+ bUTF8 = sal_True;
}
else if ( sSwitch.ToUpperAscii() == "-NOUTF8" ) {
nState = STATE_UTF8;
- bUTF8 = FALSE;
+ bUTF8 = sal_False;
}
else if ( sSwitch == "-l" || sSwitch == "-L" ) {
nState = STATE_LANGUAGES;
@@ -153,7 +153,7 @@ extern char *GetOutputFile( int argc, char* argv[])
}
case STATE_INPUT: {
aInputFileList.push_back( new ByteString( argv[ i ] ) );
- bInput = TRUE; // min. one source file found
+ bInput = sal_True; // min. one source file found
}
break;
case STATE_OUTPUT: {
@@ -170,7 +170,7 @@ extern char *GetOutputFile( int argc, char* argv[])
break;
case STATE_MERGESRC: {
sMergeSrc = ByteString( argv[ i ]);
- bMergeMode = TRUE; // activate merge mode, cause merge database found
+ bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
@@ -183,7 +183,7 @@ extern char *GetOutputFile( int argc, char* argv[])
if( bUnmerge ) sMergeSrc = ByteString();
if ( bInput ) {
// command line is valid
- bEnableExport = TRUE;
+ bEnableExport = sal_True;
char *pReturn = new char[ sOutputFile.Len() + 1 ];
strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked
return pReturn;
@@ -326,7 +326,7 @@ int GetError()
// get error at global instance of class Export
if ( pExport->GetError())
return 1;
- return FALSE;
+ return sal_False;
}
}
@@ -372,7 +372,7 @@ bool ResData::isMerged( ByteString& sLang ){
}
/*****************************************************************************/
-BOOL ResData::SetId( const ByteString &rId, USHORT nLevel )
+sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel )
/*****************************************************************************/
{
if ( nLevel > nIdLevel )
@@ -396,10 +396,10 @@ BOOL ResData::SetId( const ByteString &rId, USHORT nLevel )
sId.EraseTrailingChars( '\t' );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//
@@ -407,14 +407,14 @@ BOOL ResData::SetId( const ByteString &rId, USHORT nLevel )
//
/*****************************************************************************/
-Export::Export( const ByteString &rOutput, BOOL bWrite,
+Export::Export( const ByteString &rOutput, sal_Bool bWrite,
const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile )
/*****************************************************************************/
:
pWordTransformer( NULL ),
aCharSet( RTL_TEXTENCODING_MS_1252 ),
- bDefine( FALSE ),
- bNextMustBeDefineEOL( FALSE ),
+ bDefine( sal_False ),
+ bNextMustBeDefineEOL( sal_False ),
nLevel( 0 ),
nList( LIST_NON ),
nListIndex( 0 ),
@@ -424,9 +424,9 @@ Export::Export( const ByteString &rOutput, BOOL bWrite,
sRoot( sPrjRoot ),
bEnableExport( bWrite ),
bMergeMode( bUnmerge ),
- bError( FALSE ),
- bReadOver( FALSE ),
- bDontWriteOutput( FALSE ),
+ bError( sal_False ),
+ bReadOver( sal_False ),
+ bDontWriteOutput( sal_False ),
sFilename( rFile )
{
pParseQueue = new ParserQueue( *this );
@@ -451,15 +451,15 @@ Export::Export( const ByteString &rOutput, BOOL bWrite,
}
/*****************************************************************************/
-Export::Export( const ByteString &rOutput, BOOL bWrite,
+Export::Export( const ByteString &rOutput, sal_Bool bWrite,
const ByteString &rPrj, const ByteString &rPrjRoot,
const ByteString &rMergeSource , const ByteString& rFile )
/*****************************************************************************/
:
pWordTransformer( NULL ),
aCharSet( RTL_TEXTENCODING_MS_1252 ),
- bDefine( FALSE ),
- bNextMustBeDefineEOL( FALSE ),
+ bDefine( sal_False ),
+ bNextMustBeDefineEOL( sal_False ),
nLevel( 0 ),
nList( LIST_NON ),
nListIndex( 0 ),
@@ -468,11 +468,11 @@ Export::Export( const ByteString &rOutput, BOOL bWrite,
sProject( sPrj ),
sRoot( sPrjRoot ),
bEnableExport( bWrite ),
- bMergeMode( TRUE ),
+ bMergeMode( sal_True ),
sMergeSrc( rMergeSource ),
- bError( FALSE ),
- bReadOver( FALSE ),
- bDontWriteOutput( FALSE ),
+ bError( sal_False ),
+ bReadOver( sal_False ),
+ bDontWriteOutput( sal_False ),
sFilename( rFile )
{
(void) rPrj;
@@ -497,8 +497,8 @@ void Export::Init()
{
// resets the internal status, used before parseing another file
sActPForm = "";
- bDefine = FALSE;
- bNextMustBeDefineEOL = FALSE;
+ bDefine = sal_False;
+ bNextMustBeDefineEOL = sal_False;
nLevel = 0;
nList = LIST_NON;
nListLang = ByteString( String::CreateFromAscii(""),RTL_TEXTENCODING_ASCII_US );
@@ -536,16 +536,16 @@ int Export::Execute( int nToken, const char * pToken )
ByteString sToken( pToken );
ByteString sOrig( sToken );
- BOOL bWriteToMerged = bMergeMode;
+ sal_Bool bWriteToMerged = bMergeMode;
if ( nToken == CONDITION ) {
ByteString sTestToken( pToken );
sTestToken.EraseAllChars( '\t' );
sTestToken.EraseAllChars( ' ' );
if (( !bReadOver ) && ( sTestToken.Search( "#ifndef__RSC_PARSER" ) == 0 ))
- bReadOver = TRUE;
+ bReadOver = sal_True;
else if (( bReadOver ) && ( sTestToken.Search( "#endif" ) == 0 ))
- bReadOver = FALSE;
+ bReadOver = sal_False;
}
if ((( nToken < FILTER_LEVEL ) || ( bReadOver )) &&
(!(( bNextMustBeDefineEOL ) && ( sOrig == "\n" )))) {
@@ -589,16 +589,16 @@ int Export::Execute( int nToken, const char * pToken )
if ( bNextMustBeDefineEOL ) {
if ( nToken != RSCDEFINELEND ) {
// end of macro found, so destroy res.
- bDefine = FALSE;
+ bDefine = sal_False;
if ( bMergeMode ) {
MergeRest( pResData );
}
- bNextMustBeDefineEOL = FALSE;
+ bNextMustBeDefineEOL = sal_False;
Execute( LEVELDOWN, "" );
}
else {
// next line also in macro definition
- bNextMustBeDefineEOL = FALSE;
+ bNextMustBeDefineEOL = sal_False;
if ( bMergeMode )
WriteToMerged( sOrig , false );
return 1;
@@ -612,12 +612,12 @@ int Export::Execute( int nToken, const char * pToken )
}
}
- BOOL bExecuteDown = FALSE;
+ sal_Bool bExecuteDown = sal_False;
if ( nToken != LEVELDOWN ) {
- USHORT nOpen = 0;
- USHORT nClose = 0;
- BOOL bReadOver1 = FALSE;
- USHORT i = 0;
+ sal_uInt16 nOpen = 0;
+ sal_uInt16 nClose = 0;
+ sal_Bool bReadOver1 = sal_False;
+ sal_uInt16 i = 0;
for ( i = 0; i < sToken.Len(); i++ ) {
if ( sToken.GetChar( i ) == '\"' )
bReadOver1 = !bReadOver1;
@@ -625,7 +625,7 @@ int Export::Execute( int nToken, const char * pToken )
nOpen++;
}
- bReadOver1 = FALSE;
+ bReadOver1 = sal_False;
for ( i = 0; i < sToken.Len(); i++ ) {
if ( sToken.GetChar( i ) == '\"' )
bReadOver1 = !bReadOver1;
@@ -634,7 +634,7 @@ int Export::Execute( int nToken, const char * pToken )
}
if ( nOpen < nClose )
- bExecuteDown = TRUE;
+ bExecuteDown = sal_True;
}
switch ( nToken ) {
@@ -653,17 +653,17 @@ int Export::Execute( int nToken, const char * pToken )
case RSCDEFINE:
- bDefine = TRUE; // res. defined in macro
+ bDefine = sal_True; // res. defined in macro
case RESSOURCE:
case RESSOURCEEXPR: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
if ( nToken != RSCDEFINE )
- bNextMustBeDefineEOL = FALSE;
+ bNextMustBeDefineEOL = sal_False;
// this is the beginning of a new res.
nLevel++;
if ( nLevel > 1 ) {
- aResStack[ nLevel - 2 ]->bChild = TRUE;
+ aResStack[ nLevel - 2 ]->bChild = sal_True;
}
// create new instance for this res. and fill mandatory fields
@@ -700,12 +700,12 @@ int Export::Execute( int nToken, const char * pToken )
}
break;
case SMALRESSOURCE: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
// this is the beginning of a new res.
- bNextMustBeDefineEOL = FALSE;
+ bNextMustBeDefineEOL = sal_False;
nLevel++;
if ( nLevel > 1 ) {
- aResStack[ nLevel - 2 ]->bChild = TRUE;
+ aResStack[ nLevel - 2 ]->bChild = sal_True;
}
// create new instance for this res. and fill mandatory fields
@@ -728,13 +728,13 @@ int Export::Execute( int nToken, const char * pToken )
if ( nList )
break;
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
ByteString sLowerTyp;
if ( pResData )
sLowerTyp = "unknown";
nLevel++;
if ( nLevel > 1 ) {
- aResStack[ nLevel - 2 ]->bChild = TRUE;
+ aResStack[ nLevel - 2 ]->bChild = sal_True;
}
ResData *pNewData = new ResData( sActPForm, FullId() , sFilename );
@@ -745,11 +745,11 @@ int Export::Execute( int nToken, const char * pToken )
case LEVELDOWN: {
// pop
if ( !nList ) {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
if ( nLevel ) {
if ( bDefine && (nLevel == 1 )) {
- bDefine = FALSE;
- bNextMustBeDefineEOL = FALSE;
+ bDefine = sal_False;
+ bNextMustBeDefineEOL = sal_False;
}
WriteData( pResData );
ResStack::iterator it = aResStack.begin();
@@ -761,7 +761,7 @@ int Export::Execute( int nToken, const char * pToken )
}
else {
if ( bDefine )
- bNextMustBeDefineEOL = TRUE;
+ bNextMustBeDefineEOL = sal_True;
if ( !nListLevel ) {
if ( bMergeMode )
MergeRest( pResData, MERGE_MODE_LIST );
@@ -773,7 +773,7 @@ int Export::Execute( int nToken, const char * pToken )
}
break;
case ASSIGNMENT: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
// interpret different types of assignement
ByteString sKey = sToken.GetToken( 0, '=' );
sKey.EraseAllChars( ' ' );
@@ -788,21 +788,21 @@ int Export::Execute( int nToken, const char * pToken )
pResData->sHelpId = sValue;
}
else if ( sKey == "STRINGLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_STRING;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
else if ( sKey == "FILTERLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_FILTER;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
else if ( sKey == "UIENTRIES" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_UIENTRIES;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
@@ -817,10 +817,10 @@ int Export::Execute( int nToken, const char * pToken )
break;
case UIENTRIES:
case LISTASSIGNMENT: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
ByteString sTmpToken( sToken);
sTmpToken.EraseAllChars(' ');
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
nPos = sTmpToken.ToLowerAscii().Search("[en-us]=");
if( nPos != STRING_NOTFOUND ) {
ByteString sKey = sTmpToken.Copy( 0 , nPos );
@@ -829,14 +829,14 @@ int Export::Execute( int nToken, const char * pToken )
ByteString sValue = sToken.GetToken( 1, '=' );
CleanValue( sValue );
if ( sKey.ToUpperAscii() == "STRINGLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_STRING;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
else if ( sKey == "FILTERLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_FILTER;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
@@ -844,7 +844,7 @@ int Export::Execute( int nToken, const char * pToken )
}
// PairedList
else if ( sKey == "PAIREDLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_PAIRED;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
@@ -852,14 +852,14 @@ int Export::Execute( int nToken, const char * pToken )
}
else if ( sKey == "ITEMLIST" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_ITEM;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
nListLevel = 0;
}
else if ( sKey == "UIENTRIES" ) {
- pResData->bList = TRUE;
+ pResData->bList = sal_True;
nList = LIST_UIENTRIES;
nListLang = SOURCE_LANGUAGE;
nListIndex = 0;
@@ -911,7 +911,7 @@ int Export::Execute( int nToken, const char * pToken )
break;
case LONGTEXTLINE:
case TEXTLINE:
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
if ( nLevel ) {
CutComment( sToken );
@@ -940,7 +940,7 @@ int Export::Execute( int nToken, const char * pToken )
if ( Export::isSourceLanguage( nLangIndex ) )
pResData->SetId( sText, ID_LEVEL_TEXT );
- pResData->bText = TRUE;
+ pResData->bText = sal_True;
pResData->sTextTyp = sOrigKey;
if ( bMergeMode ) {
PrepareTextToMerge( sOrig, STRING_TYP_TEXT, nLangIndex, pResData );
@@ -956,7 +956,7 @@ int Export::Execute( int nToken, const char * pToken )
}
else if ( sKey == "HELPTEXT" ) {
SetChildWithText();
- pResData->bHelpText = TRUE;
+ pResData->bHelpText = sal_True;
if ( bBreakWhenHelpText ) {
ByteString sError( "\"HelpText\" found in source\n" );
YYWarning( sError.GetBufferAccess());
@@ -976,7 +976,7 @@ int Export::Execute( int nToken, const char * pToken )
}
else if ( sKey == "QUICKHELPTEXT" ) {
SetChildWithText();
- pResData->bQuickHelpText = TRUE;
+ pResData->bQuickHelpText = sal_True;
if ( bMergeMode )
PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, nLangIndex, pResData );
else {
@@ -990,7 +990,7 @@ int Export::Execute( int nToken, const char * pToken )
}
else if ( sKey == "TITLE" ) {
SetChildWithText();
- pResData->bTitle = TRUE;
+ pResData->bTitle = sal_True;
if ( bMergeMode )
PrepareTextToMerge( sOrig, STRING_TYP_TITLE, nLangIndex, pResData );
else {
@@ -1012,11 +1012,11 @@ int Export::Execute( int nToken, const char * pToken )
}
break;
case NEWTEXTINRES: {
- bDontWriteOutput = TRUE;
+ bDontWriteOutput = sal_True;
}
break;
case APPFONTMAPPING: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
// this is a AppfontMapping, so look if its a definition
// of field size
ByteString sKey = sToken.GetToken( 0, '=' );
@@ -1028,18 +1028,18 @@ int Export::Execute( int nToken, const char * pToken )
sMapping.EraseAllChars( ' ' );
sMapping.EraseAllChars( '\t' );
if ( sKey.ToUpperAscii() == "SIZE" ) {
- pResData->nWidth = ( USHORT ) sMapping.GetToken( 0, ',' ).ToInt64();
+ pResData->nWidth = ( sal_uInt16 ) sMapping.GetToken( 0, ',' ).ToInt64();
}
else if ( sKey == "POSSIZE" ) {
- pResData->nWidth = ( USHORT ) sMapping.GetToken( 2, ',' ).ToInt64();
+ pResData->nWidth = ( sal_uInt16 ) sMapping.GetToken( 2, ',' ).ToInt64();
}
}
break;
case RSCDEFINELEND:
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
break;
case CONDITION: {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {};
while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {};
@@ -1068,23 +1068,23 @@ int Export::Execute( int nToken, const char * pToken )
}
else break;
if ( nLevel ) {
- WriteData( pResData, TRUE );
+ WriteData( pResData, sal_True );
pResData->sPForm = sActPForm;
}
}
break;
case EMPTYLINE : {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
if ( bDefine ) {
- bNextMustBeDefineEOL = FALSE;
- bDefine = FALSE;
+ bNextMustBeDefineEOL = sal_False;
+ bDefine = sal_False;
while ( nLevel )
Parse( LEVELDOWN, "" );
}
}
break;
case PRAGMA : {
- bDontWriteOutput = FALSE;
+ bDontWriteOutput = sal_False;
while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {};
sToken.EraseLeadingChars( ' ' );
@@ -1107,14 +1107,14 @@ int Export::Execute( int nToken, const char * pToken )
}
break;
case TEXTREFID : {
- bDontWriteOutput = TRUE;
+ bDontWriteOutput = sal_True;
}
}
if ( bWriteToMerged ) {
// the current token must be written to dest. without merging
if( bDefine && sOrig.Len() > 2 ){
- for( USHORT n = 0 ; n < sOrig.Len() ; n++ ){
+ for( sal_uInt16 n = 0 ; n < sOrig.Len() ; n++ ){
if( sOrig.GetChar( n ) == '\n' && sOrig.GetChar( n-1 ) != '\\'){
sOrig.Insert('\\' , n++ );
}
@@ -1137,8 +1137,8 @@ void Export::CutComment( ByteString &rText )
if ( rText.Search( "//" ) != STRING_NOTFOUND ) {
ByteString sWork( rText );
sWork.SearchAndReplaceAll( "\\\"", "XX" );
- USHORT i = 0;
- BOOL bInner = FALSE;
+ sal_uInt16 i = 0;
+ sal_Bool bInner = sal_False;
while ( i < sWork.Len() - 1 ) {
if ( sWork.GetChar( i ) == '\"' )
@@ -1157,8 +1157,8 @@ void Export::CutComment( ByteString &rText )
}
void Export::UnmergeUTF8( ByteString& sOrig ){
- USHORT nPos1 = sOrig.Search('\"');
- USHORT nPos2 = sOrig.SearchBackward('\"');
+ sal_uInt16 nPos1 = sOrig.Search('\"');
+ sal_uInt16 nPos2 = sOrig.SearchBackward('\"');
if( nPos1 > 0 && nPos2 > 0 && nPos1 < nPos2){
ByteString sPart = sOrig.Copy(nPos1+1 , nPos2-1);
ByteString sPartUTF8 = sPart;
@@ -1168,7 +1168,7 @@ void Export::UnmergeUTF8( ByteString& sOrig ){
}
/*****************************************************************************/
-BOOL Export::ListExists( ResData *pResData, USHORT nLst )
+sal_Bool Export::ListExists( ResData *pResData, sal_uInt16 nLst )
/*****************************************************************************/
{
switch ( nLst ) {
@@ -1178,20 +1178,20 @@ BOOL Export::ListExists( ResData *pResData, USHORT nLst )
case LIST_PAIRED: return pResData->pPairedList != NULL;
case LIST_UIENTRIES: return pResData->pUIEntries != NULL;
}
- return FALSE;
+ return sal_False;
}
/*****************************************************************************/
-BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew )
+sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew )
/*****************************************************************************/
{
if ( bMergeMode ) {
MergeRest( pResData );
- return TRUE;
+ return sal_True;
}
if ( bUnmerge )
- return TRUE;
+ return sal_True;
// mandatory to export: en-US
@@ -1321,7 +1321,7 @@ BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew )
if ( bCreateNew )
pResData->pUIEntries = 0;
}
- return TRUE;
+ return sal_True;
}
ByteString Export::GetPairedListID( const ByteString& sText ){
// < "STRING" ; IDENTIFIER ; > ;
@@ -1349,8 +1349,8 @@ ByteString Export::StripList( const ByteString& sText ){
}
/*****************************************************************************/
-BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList,
- const ByteString &rTyp, BOOL bCreateNew )
+sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList,
+ const ByteString &rTyp, sal_Bool bCreateNew )
/*****************************************************************************/
{
ByteString sGID = pResData->sGId;
@@ -1416,7 +1416,7 @@ BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList,
if ( bCreateNew )
delete pExportList;
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
@@ -1554,7 +1554,7 @@ void Export::CleanValue( ByteString &rValue )
}
if ( rValue.Len()) {
- for ( USHORT i = rValue.Len() - 1; i > 0; i-- ) {
+ for ( sal_uInt16 i = rValue.Len() - 1; i > 0; i-- ) {
if (( rValue.GetChar( i ) == ' ' ) || ( rValue.GetChar( i ) == '\t' ) ||
( rValue.GetChar( i ) == '\n' ) || ( rValue.GetChar( i ) == ';' ) ||
( rValue.GetChar( i ) == '{' ) || ( rValue.GetChar( i ) == '\\' ) ||
@@ -1592,14 +1592,14 @@ ByteString Export::GetText( const ByteString &rSource, int nToken )
while ( sTmp.SearchAndReplace( "\\0x7F", "-=<[0x7F]>=-" )
!= STRING_NOTFOUND ) {};
- USHORT nStart = 0;
- USHORT nState = TXT_STATE_MACRO;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nState = TXT_STATE_MACRO;
nState = TXT_STATE_TEXT;
nStart = 1;
- for ( USHORT i = nStart; i < sTmp.GetTokenCount( '\"' ); i++ ) {
+ for ( sal_uInt16 i = nStart; i < sTmp.GetTokenCount( '\"' ); i++ ) {
ByteString sToken = sTmp.GetToken( i, '\"' );
if ( sToken.Len()) {
if ( nState == TXT_STATE_TEXT ) {
@@ -1654,7 +1654,7 @@ void Export::WriteToMerged( const ByteString &rText , bool bSDFContent )
ByteString sText( rText );
while ( sText.SearchAndReplace( " \n", "\n" ) != STRING_NOTFOUND ) {};
if( pParseQueue->bNextIsM && bSDFContent && sText.Len() > 2 ){
- for( USHORT n = 0 ; n < sText.Len() ; n++ ){
+ for( sal_uInt16 n = 0 ; n < sText.Len() ; n++ ){
if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){
sText.Insert('\\' , n++ );
@@ -1662,7 +1662,7 @@ void Export::WriteToMerged( const ByteString &rText , bool bSDFContent )
}
}
else if( pParseQueue->bLastWasM && sText.Len() > 2 ){
- for( USHORT n = 0 ; n < sText.Len() ; n++ ){
+ for( sal_uInt16 n = 0 ; n < sText.Len() ; n++ ){
if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){
sText.Insert('\\' , n++ );
}
@@ -1670,7 +1670,7 @@ void Export::WriteToMerged( const ByteString &rText , bool bSDFContent )
}
}
else if( pParseQueue->bCurrentIsM && bSDFContent && sText.Len() > 2 ){
- for( USHORT n = 0 ; n < sText.Len() ; n++ ){
+ for( sal_uInt16 n = 0 ; n < sText.Len() ; n++ ){
if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){
sText.Insert('\\' , n++ );
pParseQueue->bMflag=true;
@@ -1678,13 +1678,13 @@ void Export::WriteToMerged( const ByteString &rText , bool bSDFContent )
}
}
else if( pParseQueue->bMflag ){
- for( USHORT n = 1 ; n < sText.Len() ; n++ ){
+ for( sal_uInt16 n = 1 ; n < sText.Len() ; n++ ){
if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){
sText.Insert('\\' , n++ );
}
}
}
- for ( USHORT i = 0; i < sText.Len(); i++ ) {
+ for ( sal_uInt16 i = 0; i < sText.Len(); i++ ) {
if ( sText.GetChar( i ) != '\n' ){
aOutput.Write( ByteString( sText.GetChar( i )).GetBuffer(), 1 );
@@ -1701,11 +1701,11 @@ void Export::WriteToMerged( const ByteString &rText , bool bSDFContent )
void Export::ConvertMergeContent( ByteString &rText )
/*****************************************************************************/
{
- BOOL bNoOpen = ( rText.Search( "\\\"" ) != 0 );
+ sal_Bool bNoOpen = ( rText.Search( "\\\"" ) != 0 );
ByteString sClose( rText.Copy( rText.Len() - 2 ));
- BOOL bNoClose = ( sClose != "\\\"" );
+ sal_Bool bNoClose = ( sClose != "\\\"" );
ByteString sNew;
- for ( USHORT i = 0; i < rText.Len(); i++ ) {
+ for ( sal_uInt16 i = 0; i < rText.Len(); i++ ) {
ByteString sChar( rText.GetChar( i ));
if ( sChar == "\\" ) {
if (( i + 1 ) < rText.Len()) {
@@ -1754,13 +1754,13 @@ void Export::ConvertMergeContent( ByteString &rText )
}
/*****************************************************************************/
-BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
+sal_Bool Export::PrepareTextToMerge( ByteString &rText, sal_uInt16 nTyp,
ByteString &nLangIndex, ResData *pResData )
/*****************************************************************************/
{
// position to merge in:
- USHORT nStart = 0;
- USHORT nEnd = 0;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nEnd = 0;
ByteString sOldId = pResData->sId;
ByteString sOldGId = pResData->sGId;
ByteString sOldTyp = pResData->sResTyp;
@@ -1775,7 +1775,7 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
case LIST_ITEM :
{
if ( bUnmerge )
- return TRUE;
+ return sal_True;
ExportList *pList = NULL;
switch ( nTyp ) {
@@ -1819,17 +1819,17 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
nStart = rText.Search( "\"" );
if ( nStart == STRING_NOTFOUND ) {
rText = sOrigText;
- return FALSE;
+ return sal_False;
}
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for ( nEnd = nStart + 1; nEnd < rText.Len() && !bFound; nEnd++ ) {
if ( rText.GetChar( nEnd ) == '\"' )
- bFound = TRUE;
+ bFound = sal_True;
}
if ( !bFound ) {
rText = sOrigText;
- return FALSE;
+ return sal_False;
}
nEnd --;
@@ -1860,14 +1860,14 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
nStart = rText.Search( "=" );
if ( nStart == STRING_NOTFOUND ) {
rText = sOrigText;
- return FALSE;
+ return sal_False;
}
nStart++;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
while(( nStart < rText.Len()) && !bFound ) {
if (( rText.GetChar( nStart ) != ' ' ) && ( rText.GetChar( nStart ) != '\t' ))
- bFound = TRUE;
+ bFound = sal_True;
else
nStart ++;
}
@@ -1875,19 +1875,19 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
// no start position found
if ( !bFound ) {
rText = sOrigText;
- return FALSE;
+ return sal_False;
}
// position to end mergeing in
nEnd = rText.Len() - 1;
- bFound = FALSE;
+ bFound = sal_False;
while (( nEnd > nStart ) && !bFound ) {
if (( rText.GetChar( nEnd ) != ' ' ) && ( rText.GetChar( nEnd ) != '\t' ) &&
( rText.GetChar( nEnd ) != '\n' ) && ( rText.GetChar( nEnd ) != ';' ) &&
( rText.GetChar( nEnd ) != '{' ) && ( rText.GetChar( nEnd ) != '\\' ))
{
- bFound = TRUE;
+ bFound = sal_True;
}
else
nEnd --;
@@ -1915,18 +1915,18 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
if ( !pEntrys ) {
rText = sOrigText;
- return FALSE; // no data found
+ return sal_False; // no data found
}
ByteString sContent;
pEntrys->GetTransex3Text( sContent, nTyp, nLangIndex );
if ( !sContent.Len() && ( ! Export::isSourceLanguage( nLangIndex ) )) {
rText = sOrigText;
- return FALSE; // no data found
+ return sal_False; // no data found
}
if ( Export::isSourceLanguage( nLangIndex ) ) {
- return FALSE;
+ return sal_False;
}
ByteString sPostFix( rText.Copy( ++nEnd ));
@@ -1940,11 +1940,11 @@ BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp,
rText += sContent;
rText += sPostFix;
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-void Export::MergeRest( ResData *pResData, USHORT nMode )
+void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
/*****************************************************************************/
{
if ( !pMergeDataFile ){
@@ -1964,8 +1964,8 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
bool bWriteNoSlash = false;
if ( pEntry && pResData->bText ) {
- BOOL bAddSemikolon = FALSE;
- BOOL bFirst = TRUE;
+ sal_Bool bAddSemikolon = sal_False;
+ sal_Bool bFirst = sal_True;
ByteString sCur;
ByteString sTmp = Export::sLanguages;
@@ -1973,7 +1973,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
sCur = aLanguages[ n ];
ByteString sText;
- BOOL bText = pEntry->GetTransex3Text( sText, STRING_TYP_TEXT, sCur , TRUE );
+ sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_TEXT, sCur , sal_True );
if ( bText && sText.Len() && sText != "-" ) {
ByteString sOutput;
if ( bNextMustBeDefineEOL) {
@@ -1982,7 +1982,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else
sOutput += ";\t\\\n";
}
- bFirst=FALSE;
+ bFirst=sal_False;
sOutput += "\t";
sOutput += pResData->sTextTyp;
if ( ! Export::isSourceLanguage( sCur ) ) {
@@ -2002,8 +2002,8 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else if ( !bNextMustBeDefineEOL )
sOutput += ";\n";
else
- bAddSemikolon = TRUE;
- for ( USHORT j = 1; j < nLevel; j++ )
+ bAddSemikolon = sal_True;
+ for ( sal_uInt16 j = 1; j < nLevel; j++ )
sOutput += "\t";
WriteToMerged( sOutput , true );
}
@@ -2017,15 +2017,15 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
}
if ( pEntry && pResData->bQuickHelpText ) {
- BOOL bAddSemikolon = FALSE;
- BOOL bFirst = TRUE;
+ sal_Bool bAddSemikolon = sal_False;
+ sal_Bool bFirst = sal_True;
ByteString sCur;
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
ByteString sText;
- BOOL bText = pEntry->GetTransex3Text( sText, STRING_TYP_QUICKHELPTEXT, sCur, TRUE );
+ sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_QUICKHELPTEXT, sCur, sal_True );
if ( bText && sText.Len() && sText != "-" ) {
ByteString sOutput;
if ( bNextMustBeDefineEOL) {
@@ -2034,7 +2034,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else
sOutput += ";\t\\\n";
}
- bFirst=FALSE;
+ bFirst=sal_False;
sOutput += "\t";
sOutput += "QuickHelpText";
if ( ! Export::isSourceLanguage( sCur ) ) {
@@ -2050,8 +2050,8 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else if ( !bNextMustBeDefineEOL )
sOutput += ";\n";
else
- bAddSemikolon = TRUE;
- for ( USHORT j = 1; j < nLevel; j++ )
+ bAddSemikolon = sal_True;
+ for ( sal_uInt16 j = 1; j < nLevel; j++ )
sOutput += "\t";
WriteToMerged( sOutput ,true );
}
@@ -2063,15 +2063,15 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
}
if ( pEntry && pResData->bTitle ) {
- BOOL bAddSemikolon = FALSE;
- BOOL bFirst = TRUE;
+ sal_Bool bAddSemikolon = sal_False;
+ sal_Bool bFirst = sal_True;
ByteString sCur;
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
ByteString sText;
- BOOL bText = pEntry->GetTransex3Text( sText, STRING_TYP_TITLE, sCur, TRUE );
+ sal_Bool bText = pEntry->GetTransex3Text( sText, STRING_TYP_TITLE, sCur, sal_True );
if ( bText && sText.Len() && sText != "-" ) {
ByteString sOutput;
if ( bNextMustBeDefineEOL) {
@@ -2080,7 +2080,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else
sOutput += ";\t\\\n";
}
- bFirst=FALSE;
+ bFirst=sal_False;
sOutput += "\t";
sOutput += "Title";
if ( ! Export::isSourceLanguage( sCur ) ) {
@@ -2096,8 +2096,8 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
else if ( !bNextMustBeDefineEOL )
sOutput += ";\n";
else
- bAddSemikolon = TRUE;
- for ( USHORT j = 1; j < nLevel; j++ )
+ bAddSemikolon = sal_True;
+ for ( sal_uInt16 j = 1; j < nLevel; j++ )
sOutput += "\t";
WriteToMerged( sOutput ,true );
}
@@ -2118,9 +2118,9 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
pResData->sGId += ".";
pResData->sGId += sOldId;
ByteString sSpace;
- for ( USHORT i = 1; i < nLevel-1; i++ )
+ for ( sal_uInt16 i = 1; i < nLevel-1; i++ )
sSpace += "\t";
- for ( USHORT nT = LIST_STRING; nT <= LIST_UIENTRIES; nT++ ) {
+ for ( sal_uInt16 nT = LIST_STRING; nT <= LIST_UIENTRIES; nT++ ) {
ExportList *pList = NULL;
switch ( nT ) {
case LIST_STRING : pResData->sResTyp = "stringlist"; pList = pResData->pStringList; bPairedList = false; break;
@@ -2132,7 +2132,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
ByteString sCur;
for( unsigned int n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
- USHORT nIdx = 1;
+ sal_uInt16 nIdx = 1;
// Set matching pairedlist identifier
if( bPairedList && pResData->pPairedList && ( nIdx == 1 ) ){
@@ -2143,17 +2143,17 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
pResData->sId = ByteString("1");
PFormEntrys *pEntrys;
- ULONG nLIndex = 0;
- ULONG nMaxIndex = 0;
+ sal_uLong nLIndex = 0;
+ sal_uLong nMaxIndex = 0;
if ( pList )
nMaxIndex = pList->GetSourceLanguageListEntryCount();
pEntrys = pMergeDataFile->GetPFormEntrys( pResData );
while( pEntrys && ( nLIndex < nMaxIndex )) {
ByteString sText;
- BOOL bText;
- bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, TRUE );
+ sal_Bool bText;
+ bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True );
if( !bText )
- bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , FALSE );
+ bText = pEntrys->GetTransex3Text( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , sal_False );
// Use fallback, if data is missing in sdf file
if( !bText && bPairedList ){
@@ -2214,7 +2214,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
}
}
- USHORT nStart, nEnd;
+ sal_uInt16 nStart, nEnd;
nStart = sLine.Search( "\"" );
ByteString sPostFix;
@@ -2297,7 +2297,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
}
nListIndex++;
- ULONG nMaxIndex = 0;
+ sal_uLong nMaxIndex = 0;
if ( pList )
nMaxIndex = pList->GetSourceLanguageListEntryCount();
ByteString sLine;
@@ -2322,7 +2322,7 @@ void Export::MergeRest( ResData *pResData, USHORT nMode )
sText += sLine;
sText += " ;";
sText += "\n";
- for ( USHORT i = 0; i < nLevel; i++ )
+ for ( sal_uInt16 i = 0; i < nLevel; i++ )
sText += "\t";
WriteToMerged( sText ,false );
nListIndex++;
@@ -2353,13 +2353,13 @@ void Export::SetChildWithText()
{
if ( aResStack.size() > 1 ) {
for ( size_t i = 0; i < aResStack.size() - 1; i++ ) {
- aResStack[ i ]->bChildWithText = TRUE;
+ aResStack[ i ]->bChildWithText = sal_True;
}
}
}
void ParserQueue::Push( const QueueEntry& aEntry ){
- USHORT nLen = aEntry.sLine.Len();
+ sal_uInt16 nLen = aEntry.sLine.Len();
if( !bStart ){
aQueueCur->push( aEntry );
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 8dea46fe8a24..5659123304c8 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -147,7 +147,7 @@ void Export::QuotHTMLXRM( ByteString &rString )
/*****************************************************************************/
{
ByteString sReturn;
- for ( USHORT i = 0; i < rString.Len(); i++ ) {
+ for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) {
ByteString sTemp = rString.Copy( i );
if ( sTemp.Search( "<Arg n=" ) == 0 ) {
while ( i < rString.Len() && rString.GetChar( i ) != '>' ) {
@@ -215,7 +215,7 @@ void Export::QuotHTML( ByteString &rString )
/*****************************************************************************/
{
ByteString sReturn;
- for ( USHORT i = 0; i < rString.Len(); i++ ) {
+ for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) {
ByteString sTemp = rString.Copy( i );
if ( sTemp.Search( "<Arg n=" ) == 0 ) {
while ( i < rString.Len() && rString.GetChar( i ) != '>' ) {
@@ -418,7 +418,7 @@ void Export::InitLanguages( bool bMergeMode ){
if( !isInitialized ){
ByteString sTmp;
ByteStringBoolHashMap aEnvLangs;
- for ( USHORT x = 0; x < sLanguages.GetTokenCount( ',' ); x++ ){
+ for ( sal_uInt16 x = 0; x < sLanguages.GetTokenCount( ',' ); x++ ){
sTmp = sLanguages.GetToken( x, ',' ).GetToken( 0, '=' );
sTmp.EraseLeadingAndTrailingChars();
if( bMergeMode && !isAllowed( sTmp ) ){}
@@ -435,7 +435,7 @@ void Export::InitForcedLanguages( bool bMergeMode ){
/*****************************************************************************/
ByteString sTmp;
ByteStringBoolHashMap aEnvLangs;
- for ( USHORT x = 0; x < sForcedLanguages.GetTokenCount( ',' ); x++ ){
+ for ( sal_uInt16 x = 0; x < sForcedLanguages.GetTokenCount( ',' ); x++ ){
sTmp = sForcedLanguages.GetToken( x, ',' ).GetToken( 0, '=' );
sTmp.EraseLeadingAndTrailingChars();
if( bMergeMode && isAllowed( sTmp ) ){}
@@ -556,7 +556,7 @@ ByteString Export::GetTimeStamp()
}
/*****************************************************************************/
-BOOL Export::ConvertLineEnds(
+sal_Bool Export::ConvertLineEnds(
ByteString sSource, ByteString sDestination )
/*****************************************************************************/
{
@@ -565,11 +565,11 @@ BOOL Export::ConvertLineEnds(
SvFileStream aSource( sSourceFile, STREAM_READ );
if ( !aSource.IsOpen())
- return FALSE;
+ return sal_False;
SvFileStream aDestination( sDestinationFile, STREAM_STD_WRITE | STREAM_TRUNC );
if ( !aDestination.IsOpen()) {
aSource.Close();
- return FALSE;
+ return sal_False;
}
ByteString sLine;
@@ -587,7 +587,7 @@ BOOL Export::ConvertLineEnds(
aSource.Close();
aDestination.Close();
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
@@ -597,7 +597,7 @@ ByteString Export::GetNativeFile( ByteString sSource )
DirEntry aTemp( GetTempFile());
ByteString sReturn( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US );
- for ( USHORT i = 0; i < 10; i++ )
+ for ( sal_uInt16 i = 0; i < 10; i++ )
if ( ConvertLineEnds( sSource, sReturn ))
return sReturn;
diff --git a/l10ntools/source/filter/utils/Cache.java b/l10ntools/source/filter/utils/Cache.java
index 02bb1c302d8d..a8fbaaa953a9 100644
--- a/l10ntools/source/filter/utils/Cache.java
+++ b/l10ntools/source/filter/utils/Cache.java
@@ -159,7 +159,6 @@ public class Cache
private static final java.lang.String FLAGNAME_PACKED = "PACKED";
private static final java.lang.String FLAGNAME_PREFERRED = "PREFERRED";
private static final java.lang.String FLAGNAME_READONLY = "READONLY";
- private static final java.lang.String FLAGNAME_SILENTEXPORT = "SILENTEXPORT";
private static final java.lang.String FLAGNAME_TEMPLATE = "TEMPLATE";
private static final java.lang.String FLAGNAME_TEMPLATEPATH = "TEMPLATEPATH";
private static final java.lang.String FLAGNAME_USESOPTIONS = "USESOPTIONS";
@@ -185,7 +184,6 @@ public class Cache
private static final int FLAGVAL_PACKED = 0x00100000; // 1048576
private static final int FLAGVAL_PREFERRED = 0x10000000; // 268435456
private static final int FLAGVAL_READONLY = 0x00010000; // 65536
- private static final int FLAGVAL_SILENTEXPORT = 0x00200000; // 2097152
private static final int FLAGVAL_TEMPLATE = 0x00000004; // 4
private static final int FLAGVAL_TEMPLATEPATH = 0x00000010; // 16
private static final int FLAGVAL_USESOPTIONS = 0x00000080; // 128
@@ -1358,9 +1356,6 @@ public class Cache
if (sFlagName.equals(FLAGNAME_READONLY))
nFlags |= FLAGVAL_READONLY;
else
- if (sFlagName.equals(FLAGNAME_SILENTEXPORT))
- nFlags |= FLAGVAL_SILENTEXPORT;
- else
if (sFlagName.equals(FLAGNAME_TEMPLATE))
nFlags |= FLAGVAL_TEMPLATE;
else
@@ -1455,9 +1450,6 @@ public class Cache
if((field & FLAGVAL_PACKED) == FLAGVAL_PACKED)
lFlags.add(FLAGNAME_PACKED);
- if((field & FLAGVAL_SILENTEXPORT) == FLAGVAL_SILENTEXPORT)
- lFlags.add(FLAGNAME_SILENTEXPORT);
-
if((field & FLAGVAL_BROWSERPREFERRED) == FLAGVAL_BROWSERPREFERRED)
lFlags.add(FLAGNAME_BROWSERPREFERRED);
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 62bd546fb7ac..7c5c0b9bef40 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -40,7 +40,7 @@
/*****************************************************************************/
void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix,
- ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() )
+ ByteString aContext, sal_Bool bPrintContext, sal_uLong nLine, ByteString aUniqueId = ByteString() )
/*****************************************************************************/
{
fprintf( stdout, "%s %s, Line %lu", aType.GetBuffer(), aPrefix.GetBuffer(), nLine );
@@ -55,19 +55,19 @@ void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix,
/*****************************************************************************/
void PrintError( ByteString aMsg, ByteString aPrefix,
- ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() )
+ ByteString aContext, sal_Bool bPrintContext, sal_uLong nLine, ByteString aUniqueId = ByteString() )
/*****************************************************************************/
{
PrintMessage( "Error:", aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId );
}
-BOOL LanguageOK( ByteString aLang )
+sal_Bool LanguageOK( ByteString aLang )
{
if ( !aLang.Len() )
- return FALSE;
+ return sal_False;
if ( aLang.IsNumericAscii() )
- return TRUE;
+ return sal_True;
if ( aLang.GetTokenCount( '-' ) == 1 )
return aLang.IsAlphaAscii() && aLang.IsLowerAscii();
@@ -80,7 +80,7 @@ BOOL LanguageOK( ByteString aLang )
&& !aTok1.EqualsIgnoreCaseAscii( aTok0 );
}
- return FALSE;
+ return sal_False;
}
@@ -94,13 +94,13 @@ class LazySvFileStream : public SvFileStream
private:
String aFileName;
- BOOL bOpened;
+ sal_Bool bOpened;
StreamMode eOpenMode;
public:
LazySvFileStream()
: aFileName()
- , bOpened( FALSE )
+ , bOpened( sal_False )
, eOpenMode( 0 )
{};
@@ -123,7 +123,7 @@ void LazySvFileStream::LazyOpen()
fprintf( stderr, "\nERROR: Could not open Output-File %s!\n\n", ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ).GetBuffer() );
exit ( 4 );
}
- bOpened = TRUE;
+ bOpened = sal_True;
}
}
@@ -133,12 +133,12 @@ void LazySvFileStream::LazyOpen()
//
/*****************************************************************************/
-GSILine::GSILine( const ByteString &rLine, ULONG nLine )
+GSILine::GSILine( const ByteString &rLine, sal_uLong nLine )
/*****************************************************************************/
: ByteString( rLine )
, nLineNumber( nLine )
- , bOK( TRUE )
- , bFixed ( FALSE )
+ , bOK( sal_True )
+ , bFixed ( sal_False )
{
if ( rLine.GetTokenCount( '\t' ) == 15 )
{
@@ -154,18 +154,18 @@ GSILine::GSILine( const ByteString &rLine, ULONG nLine )
// do some more format checks here
if ( !rLine.GetToken( 8, '\t' ).IsNumericAscii() )
{
- PrintError( "The length field does not contain a number!", "Line format", rLine.GetToken( 8, '\t' ), TRUE, GetLineNumber(), GetUniqId() );
+ PrintError( "The length field does not contain a number!", "Line format", rLine.GetToken( 8, '\t' ), sal_True, GetLineNumber(), GetUniqId() );
NotOK();
}
if ( !LanguageOK( aLangId ) )
{
- PrintError( "The Language is invalid!", "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() );
+ PrintError( "The Language is invalid!", "Line format", aLangId, sal_True, GetLineNumber(), GetUniqId() );
NotOK();
}
// limit GID and LID to MAX_GID_LID_LEN chars each for database conformity, see #137575#
if ( rLine.GetToken( 4, '\t' ).Len() > MAX_GID_LID_LEN || rLine.GetToken( 5, '\t' ).Len() > MAX_GID_LID_LEN )
{
- PrintError( ByteString("GID and LID may only be ").Append( ByteString::CreateFromInt32(MAX_GID_LID_LEN) ).Append( " chars long each!" ), "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() );
+ PrintError( ByteString("GID and LID may only be ").Append( ByteString::CreateFromInt32(MAX_GID_LID_LEN) ).Append( " chars long each!" ), "Line format", aLangId, sal_True, GetLineNumber(), GetUniqId() );
NotOK();
}
}
@@ -173,8 +173,8 @@ GSILine::GSILine( const ByteString &rLine, ULONG nLine )
{
aFormat = FORMAT_GSI;
ByteString sTmp( rLine );
- USHORT nPos = sTmp.Search( "($$)" );
- USHORT nStart = 0;
+ sal_uInt16 nPos = sTmp.Search( "($$)" );
+ sal_uInt16 nStart = 0;
if ( nPos != STRING_NOTFOUND )
{
aUniqId = sTmp.Copy( nStart, nPos - nStart );
@@ -213,7 +213,7 @@ GSILine::GSILine( const ByteString &rLine, ULONG nLine )
void GSILine::NotOK()
/*****************************************************************************/
{
- bOK = FALSE;
+ bOK = sal_False;
}
/*****************************************************************************/
@@ -223,7 +223,7 @@ void GSILine::ReassembleLine()
ByteString aReassemble;
if ( GetLineFormat() == FORMAT_SDF )
{
- USHORT i;
+ sal_uInt16 i;
for ( i = 0 ; i < 10 ; i++ )
{
aReassemble.Append( GetToken( i, '\t' ) );
@@ -245,8 +245,8 @@ void GSILine::ReassembleLine()
}
else if ( GetLineFormat() == FORMAT_GSI )
{
- USHORT nPos = Search( "($$)" );
- USHORT nStart = 0;
+ sal_uInt16 nPos = Search( "($$)" );
+ sal_uInt16 nStart = 0;
if ( nPos != STRING_NOTFOUND )
{
nStart = nPos + 4; // + length of the delemiter
@@ -273,17 +273,17 @@ void GSILine::ReassembleLine()
*(ByteString*)this = aReassemble;
}
else
- PrintError( "Cannot reassemble GSI line (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() );
+ PrintError( "Cannot reassemble GSI line (internal Error).", "Line format", "", sal_False, GetLineNumber(), GetUniqId() );
}
else
- PrintError( "Cannot reassemble line of unknown type (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() );
+ PrintError( "Cannot reassemble line of unknown type (internal Error).", "Line format", "", sal_False, GetLineNumber(), GetUniqId() );
}
//
// class GSIBlock
//
/*****************************************************************************/
-GSIBlock::GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp )
+GSIBlock::GSIBlock( sal_Bool PbPrintContext, sal_Bool bSource, sal_Bool bTrans, sal_Bool bRef, sal_Bool bAllowKID, sal_Bool bAllowSusp )
/*****************************************************************************/
: pSourceLine( NULL )
, pReferenceLine( NULL )
@@ -293,7 +293,7 @@ GSIBlock::GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, B
, bReference( bRef )
, bAllowKeyIDs( bAllowKID )
, bAllowSuspicious( bAllowSusp )
- , bHasBlockError( FALSE )
+ , bHasBlockError( sal_False )
{
}
@@ -318,7 +318,7 @@ void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang)
if ( pSourceLine )
{
PrintError( "Source Language entry double. Treating as Translation.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() );
- bHasBlockError = TRUE;
+ bHasBlockError = sal_True;
pSourceLine->NotOK();
pLine->NotOK();
}
@@ -336,7 +336,7 @@ void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang)
if ( maList[ nPos ]->GetLanguageId().Equals( pLine->GetLanguageId() ) )
{
PrintError( "Translation Language entry double. Checking both.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() );
- bHasBlockError = TRUE;
+ bHasBlockError = sal_True;
maList[ nPos ]->NotOK();
pLine->NotOK();
}
@@ -355,7 +355,7 @@ void GSIBlock::SetReferenceLine( GSILine* pLine )
/*****************************************************************************/
void GSIBlock::PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix,
- ByteString aContext, ULONG nLine, ByteString aUniqueId )
+ ByteString aContext, sal_uLong nLine, ByteString aUniqueId )
/*****************************************************************************/
{
::PrintMessage( aType, aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId );
@@ -363,7 +363,7 @@ void GSIBlock::PrintMessage( ByteString aType, ByteString aMsg, ByteString aPref
/*****************************************************************************/
void GSIBlock::PrintError( ByteString aMsg, ByteString aPrefix,
- ByteString aContext, ULONG nLine, ByteString aUniqueId )
+ ByteString aContext, sal_uLong nLine, ByteString aUniqueId )
/*****************************************************************************/
{
PrintMessage( "Error:", aMsg, aPrefix, aContext, nLine, aUniqueId );
@@ -393,7 +393,7 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix,
}
/*****************************************************************************/
-BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const
+sal_Bool GSIBlock::IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uInt16 &nErrorPos, ByteString &aErrorMsg, sal_Bool &bHasBeenFixed, ByteString &aFixed ) const
/*****************************************************************************/
{
String aUTF8Tester( aTestee, RTL_TEXTENCODING_UTF8 );
@@ -402,7 +402,7 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
aUTF8Tester = String( aTestee.GetBuffer(), nErrorPos, RTL_TEXTENCODING_UTF8 );
nErrorPos = aUTF8Tester.Len();
aErrorMsg = ByteString( "UTF8 Encoding seems to be broken" );
- return FALSE;
+ return sal_False;
}
nErrorPos = aUTF8Tester.SearchChar( String::CreateFromAscii( "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f"
@@ -410,25 +410,25 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
if ( nErrorPos != STRING_NOTFOUND )
{
aErrorMsg = ByteString( "String contains illegal character" );
- return FALSE;
+ return sal_False;
}
if ( bFixTags )
{
- bHasBeenFixed = FALSE;
+ bHasBeenFixed = sal_False;
aFixed.Erase();
}
if ( !bAllowKeyIDs )
{
- BOOL bIsKeyID = FALSE;
- BOOL bNewId = FALSE;
+ sal_Bool bIsKeyID = sal_False;
+ sal_Bool bNewId = sal_False;
ByteString aID( aTestee );
- USHORT nAfterID = 0;
+ sal_uInt16 nAfterID = 0;
if ( aTestee.Equals( "{&", 0, 2 ) )
{ // check for strings from instset_native like "{&Tahoma8}335795.Installation Wiza ..."
- USHORT nTagEnd = aTestee.Search( '}' );
+ sal_uInt16 nTagEnd = aTestee.Search( '}' );
if ( nTagEnd != STRING_NOTFOUND )
{
if ( bFixTags )
@@ -443,7 +443,7 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
if ( aID.Equals( aDelimiter, 6, aDelimiter.Len() ) )
{ // New KeyId 6 Letters, digits and spechial chars followed by delimiter
- bNewId = TRUE;
+ bNewId = sal_True;
nErrorPos = 1;
aID = aID.Copy( 0, 6 );
nAfterID += 6;
@@ -451,7 +451,7 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
}
else if ( ( aID.GetChar(6) == '*' ) && aID.Equals( aDelimiter, 7, aDelimiter.Len() ) )
{ // New KeyId 6 Letters, digits and spechial chars followed by '*delimiter' to indicate translation in progress
- bNewId = TRUE;
+ bNewId = sal_True;
nErrorPos = 1;
aID = aID.Copy( 0, 6 );
nAfterID += 7;
@@ -459,7 +459,7 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
}
else if ( aID.GetTokenCount( '.' ) > 1 )
{ // test for old KeyIDs 5 to 6 digits followed by a dot '44373.'
- bNewId = FALSE;
+ bNewId = sal_False;
nErrorPos = 1;
aID = aID.GetToken( 0, '.' );
nAfterID = nAfterID + aID.Len();
@@ -473,12 +473,12 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
{
if ( aID.Len() == 6 )
{
- bIsKeyID = TRUE;
+ bIsKeyID = sal_True;
ByteString aDigits("0123456789abcdefghijklmnopqrstuvwxyz+-<=>");
- for ( USHORT i=0 ; i < aID.Len() ;i++ )
+ for ( sal_uInt16 i=0 ; i < aID.Len() ;i++ )
{
if ( aDigits.Search( aID.GetChar(i) ) == STRING_NOTFOUND )
- bIsKeyID = FALSE;
+ bIsKeyID = sal_False;
}
}
}
@@ -488,7 +488,7 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
aID.Erase( aID.Len()-1 );
if ( aID.IsNumericAscii() && aID.Len() >= 5 )
- bIsKeyID = TRUE;
+ bIsKeyID = sal_True;
}
if ( bIsKeyID )
@@ -497,32 +497,32 @@ BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorP
if ( bFixTags )
{
aFixed += aTestee.Copy( nAfterID );
- bHasBeenFixed = TRUE;
+ bHasBeenFixed = sal_True;
aErrorMsg = ByteString( "FIXED String containing KeyID" );
}
else
aErrorMsg = ByteString( "String contains KeyID" );
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags )
+sal_Bool GSIBlock::TestUTF8( GSILine* pTestee, sal_Bool bFixTags )
/*****************************************************************************/
{
- USHORT nErrorPos = 0;
+ sal_uInt16 nErrorPos = 0;
ByteString aErrorMsg;
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
ByteString aFixed;
- BOOL bHasBeenFixed = FALSE;
+ sal_Bool bHasBeenFixed = sal_False;
if ( !IsUTF8( pTestee->GetText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) )
{
ByteString aContext( pTestee->GetText().Copy( nErrorPos, 20 ) );
PrintError( aErrorMsg.Append(" in Text at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() );
- bError = TRUE;
+ bError = sal_True;
if ( bHasBeenFixed )
{
pTestee->SetText( aFixed );
@@ -533,7 +533,7 @@ BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags )
{
ByteString aContext( pTestee->GetQuickHelpText().Copy( nErrorPos, 20 ) );
PrintError( aErrorMsg.Append(" in QuickHelpText at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() );
- bError = TRUE;
+ bError = sal_True;
if ( bHasBeenFixed )
{
pTestee->SetQuickHelpText( aFixed );
@@ -544,7 +544,7 @@ BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags )
{
ByteString aContext( pTestee->GetTitle().Copy( nErrorPos, 20 ) );
PrintError( aErrorMsg.Append(" in Title at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() );
- bError = TRUE;
+ bError = sal_True;
if ( bHasBeenFixed )
{
pTestee->SetTitle( aFixed );
@@ -558,38 +558,38 @@ BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags )
/*****************************************************************************/
-BOOL GSIBlock::HasSuspiciousChars( GSILine* pTestee, GSILine* pSource )
+sal_Bool GSIBlock::HasSuspiciousChars( GSILine* pTestee, GSILine* pSource )
/*****************************************************************************/
{
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if ( !bAllowSuspicious && ( nPos = pTestee->GetText().Search("??")) != STRING_NOTFOUND )
if ( pSource->GetText().Search("??") == STRING_NOTFOUND )
{
String aUTF8Tester = String( pTestee->GetText(), 0, nPos, RTL_TEXTENCODING_UTF8 );
- USHORT nErrorPos = aUTF8Tester.Len();
+ sal_uInt16 nErrorPos = aUTF8Tester.Len();
ByteString aContext( pTestee->GetText().Copy( nPos, 20 ) );
PrintError( ByteString("Found double questionmark in translation only. Looks like an encoding problem at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() );
pTestee->NotOK();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*****************************************************************************/
-BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags )
+sal_Bool GSIBlock::CheckSyntax( sal_uLong nLine, sal_Bool bRequireSourceLine, sal_Bool bFixTags )
/*****************************************************************************/
{
static LingTest aTester;
- BOOL bHasError = FALSE;
+ sal_Bool bHasError = sal_False;
if ( !pSourceLine )
{
if ( bRequireSourceLine )
{
PrintError( "No source language entry defined!", "File format", "", nLine );
- bHasBlockError = TRUE;
+ bHasBlockError = sal_True;
}
}
else
@@ -599,7 +599,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags
{
PrintList( pSourceLine->GetMessageList(), "ReferenceString", pSourceLine );
pSourceLine->NotOK();
- bHasError = TRUE;
+ bHasError = sal_True;
}
}
if ( bReference )
@@ -615,7 +615,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags
PrintError( "No reference line found. Entry is new in source file", "File format", "", pSource->GetLineNumber(), pSource->GetUniqId() );
else
PrintError( "No reference line found. Entry is new in source file", "File format", "", nLine );
- bHasBlockError = TRUE;
+ bHasBlockError = sal_True;
}
else
{
@@ -626,7 +626,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags
aContext.Append( "\" --> \"" ).Append( pSourceLine->Copy( nPos - 5, 15) );
PrintError( "Source Language Entry has changed.", "File format", aContext, pSourceLine->GetLineNumber(), pSourceLine->GetUniqId() );
pSourceLine->NotOK();
- bHasError = TRUE;
+ bHasError = sal_True;
}
}
}
@@ -642,7 +642,7 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags
{
if ( pItem->HasMessages() || aTester.GetCompareWarnings().HasErrors() )
pItem->NotOK();
- bHasError = TRUE;
+ bHasError = sal_True;
PrintList( pItem->GetMessageList(), "Translation", pItem );
PrintList( &(aTester.GetCompareWarnings()), "Translation Tag Mismatch", pItem );
}
@@ -654,19 +654,19 @@ BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags
return bHasError || bHasBlockError;
}
-void GSIBlock::WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine )
+void GSIBlock::WriteError( LazySvFileStream &aErrOut, sal_Bool bRequireSourceLine )
{
if ( pSourceLine && pSourceLine->IsOK() && bCheckSourceLang && !bHasBlockError )
return;
- BOOL bHasError = FALSE;
- BOOL bCopyAll = ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) || bHasBlockError;
+ sal_Bool bHasError = sal_False;
+ sal_Bool bCopyAll = ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) || bHasBlockError;
for ( size_t i = 0, n = maList.size(); i < n; ++i )
{
GSILine* pItem = maList[ i ];
if ( !pItem->IsOK() || bCopyAll )
{
- bHasError = TRUE;
+ bHasError = sal_True;
aErrOut.LazyOpen();
aErrOut.WriteLine( *pItem );
}
@@ -679,18 +679,18 @@ void GSIBlock::WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine )
}
}
-void GSIBlock::WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine )
+void GSIBlock::WriteCorrect( LazySvFileStream &aOkOut, sal_Bool bRequireSourceLine )
{
if ( ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) )
return;
- BOOL bHasOK = FALSE;
+ sal_Bool bHasOK = sal_False;
for ( size_t i = 0, n = maList.size(); i < n; ++i )
{
GSILine* pItem = maList[ i ];
if ( ( pItem->IsOK() || bCheckSourceLang ) && !bHasBlockError )
{
- bHasOK = TRUE;
+ bHasOK = sal_True;
aOkOut.LazyOpen();
aOkOut.WriteLine( *pItem );
}
@@ -703,18 +703,18 @@ void GSIBlock::WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine )
}
}
-void GSIBlock::WriteFixed( LazySvFileStream &aFixOut, BOOL /*bRequireSourceLine*/ )
+void GSIBlock::WriteFixed( LazySvFileStream &aFixOut, sal_Bool /*bRequireSourceLine*/ )
{
if ( pSourceLine && !pSourceLine->IsFixed() && bCheckSourceLang )
return;
- BOOL bHasFixes = FALSE;
+ sal_Bool bHasFixes = sal_False;
for ( size_t i = 0, n = maList.size(); i < n; ++i )
{
GSILine* pItem = maList[ i ];
if ( pItem->IsFixed() )
{
- bHasFixes = TRUE;
+ bHasFixes = sal_True;
aFixOut.LazyOpen();
aFixOut.WriteLine( *pItem );
}
@@ -783,31 +783,31 @@ int _cdecl main( int argc, char *argv[] )
/*****************************************************************************/
{
- BOOL bError = FALSE;
- BOOL bPrintContext = FALSE;
- BOOL bCheckSourceLang = FALSE;
- BOOL bCheckTranslationLang = FALSE;
- BOOL bWriteError = FALSE;
- BOOL bWriteCorrect = FALSE;
- BOOL bWriteFixed = FALSE;
- BOOL bFixTags = FALSE;
- BOOL bAllowKID = FALSE;
- BOOL bAllowSuspicious = FALSE;
+ sal_Bool bError = sal_False;
+ sal_Bool bPrintContext = sal_False;
+ sal_Bool bCheckSourceLang = sal_False;
+ sal_Bool bCheckTranslationLang = sal_False;
+ sal_Bool bWriteError = sal_False;
+ sal_Bool bWriteCorrect = sal_False;
+ sal_Bool bWriteFixed = sal_False;
+ sal_Bool bFixTags = sal_False;
+ sal_Bool bAllowKID = sal_False;
+ sal_Bool bAllowSuspicious = sal_False;
String aErrorFilename;
String aCorrectFilename;
String aFixedFilename;
- BOOL bFileHasError = FALSE;
+ sal_Bool bFileHasError = sal_False;
ByteString aSourceLang( "en-US" ); // English is default
ByteString aFilename;
ByteString aReferenceFilename;
- BOOL bReferenceFile = FALSE;
- for ( USHORT i = 1 ; i < argc ; i++ )
+ sal_Bool bReferenceFile = sal_False;
+ for ( sal_uInt16 i = 1 ; i < argc ; i++ )
{
if ( *argv[ i ] == '-' )
{
switch (*(argv[ i ]+1))
{
- case 'c':bPrintContext = TRUE;
+ case 'c':bPrintContext = sal_True;
break;
case 'w':
{
@@ -817,61 +817,61 @@ int _cdecl main( int argc, char *argv[] )
if ( (i+1) < argc )
{
aErrorFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US );
- bWriteError = TRUE;
+ bWriteError = sal_True;
i++;
}
else
{
fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
else
- bWriteError = TRUE;
+ bWriteError = sal_True;
}
else if ( (*(argv[ i ]+2)) == 'c' )
if ( (*(argv[ i ]+3)) == 'f' )
if ( (i+1) < argc )
{
aCorrectFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US );
- bWriteCorrect = TRUE;
+ bWriteCorrect = sal_True;
i++;
}
else
{
fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
else
- bWriteCorrect = TRUE;
+ bWriteCorrect = sal_True;
else if ( (*(argv[ i ]+2)) == 'f' )
if ( (*(argv[ i ]+3)) == 'f' )
if ( (i+1) < argc )
{
aFixedFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US );
- bWriteFixed = TRUE;
- bFixTags = TRUE;
+ bWriteFixed = sal_True;
+ bFixTags = sal_True;
i++;
}
else
{
fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
else
{
- bWriteFixed = TRUE;
- bFixTags = TRUE;
+ bWriteFixed = sal_True;
+ bFixTags = sal_True;
}
else
{
fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
}
break;
- case 's':bCheckSourceLang = TRUE;
+ case 's':bCheckSourceLang = sal_True;
break;
- case 't':bCheckTranslationLang = TRUE;
+ case 't':bCheckTranslationLang = sal_True;
break;
case 'l':
{
@@ -885,7 +885,7 @@ int _cdecl main( int argc, char *argv[] )
else
{
fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
}
break;
@@ -894,34 +894,34 @@ int _cdecl main( int argc, char *argv[] )
if ( (i+1) < argc )
{
aReferenceFilename = argv[ i+1 ];
- bReferenceFile = TRUE;
+ bReferenceFile = sal_True;
i++;
}
else
{
fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
}
break;
case 'f':
{
- bFixTags = TRUE;
+ bFixTags = sal_True;
}
break;
case 'k':
{
- bAllowKID = TRUE;
+ bAllowKID = sal_True;
}
break;
case 'e':
{
- bAllowSuspicious = TRUE;
+ bAllowSuspicious = sal_True;
}
break;
default:
fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] );
- bError = TRUE;
+ bError = sal_True;
}
}
else
@@ -931,7 +931,7 @@ int _cdecl main( int argc, char *argv[] )
else
{
fprintf( stderr, "\nERROR: Only one filename may be specified!\n\n");
- bError = TRUE;
+ bError = sal_True;
}
}
}
@@ -1031,20 +1031,20 @@ int _cdecl main( int argc, char *argv[] )
ByteString sReferenceLine;
GSILine* pReferenceLine = NULL;
ByteString aOldReferenceId("No Valid ID"); // just set to something which can never be an ID
- ULONG nReferenceLine = 0;
+ sal_uLong nReferenceLine = 0;
ByteString sGSILine;
GSILine* pGSILine = NULL;
ByteString aOldId("No Valid ID"); // just set to something which can never be an ID
GSIBlock *pBlock = NULL;
- ULONG nLine = 0;
+ sal_uLong nLine = 0;
while ( !aGSI.IsEof() )
{
aGSI.ReadLine( sGSILine );
nLine++;
pGSILine = new GSILine( sGSILine, nLine );
- BOOL bDelete = TRUE;
+ sal_Bool bDelete = sal_True;
if ( pGSILine->Len() )
@@ -1055,7 +1055,7 @@ int _cdecl main( int argc, char *argv[] )
pGSILine->NotOK();
if ( bWriteError )
{
- bFileHasError = TRUE;
+ bFileHasError = sal_True;
aErrOut.LazyOpen();
aErrOut.WriteLine( *pGSILine );
}
@@ -1094,7 +1094,7 @@ int _cdecl main( int argc, char *argv[] )
// find corresponding line in reference file
if ( bReferenceFile )
{
- BOOL bContinueSearching = TRUE;
+ sal_Bool bContinueSearching = sal_True;
while ( ( !aReferenceGSI.IsEof() || pReferenceLine ) && bContinueSearching )
{
if ( !pReferenceLine )
@@ -1112,7 +1112,7 @@ int _cdecl main( int argc, char *argv[] )
}
else if ( pReferenceLine->GetUniqId() > aId )
{
- bContinueSearching = FALSE;
+ bContinueSearching = sal_False;
}
else
{
@@ -1134,7 +1134,7 @@ int _cdecl main( int argc, char *argv[] )
}
pBlock->InsertLine( pGSILine, aSourceLang );
- bDelete = FALSE;
+ bDelete = sal_False;
}
}
if ( bDelete )
diff --git a/l10ntools/source/gsiconv.cxx b/l10ntools/source/gsiconv.cxx
index f06104175c0d..7fd345b6e3aa 100644
--- a/l10ntools/source/gsiconv.cxx
+++ b/l10ntools/source/gsiconv.cxx
@@ -40,12 +40,12 @@
#define GSI_FILE_L10NFRAMEWORK 0x0002
/*****************************************************************************/
-USHORT GetGSIFileType( SvStream &rStream )
+sal_uInt16 GetGSIFileType( SvStream &rStream )
/*****************************************************************************/
{
- USHORT nFileType = GSI_FILE_UNKNOWN;
+ sal_uInt16 nFileType = GSI_FILE_UNKNOWN;
- ULONG nPos( rStream.Tell());
+ sal_uLong nPos( rStream.Tell());
rStream.Seek( STREAM_SEEK_TO_BEGIN );
ByteString sLine;
@@ -65,7 +65,7 @@ USHORT GetGSIFileType( SvStream &rStream )
}
/*****************************************************************************/
-ByteString GetGSILineId( const ByteString &rLine, USHORT nFileType )
+ByteString GetGSILineId( const ByteString &rLine, sal_uInt16 nFileType )
/*****************************************************************************/
{
ByteString sId;
@@ -90,7 +90,7 @@ ByteString GetGSILineId( const ByteString &rLine, USHORT nFileType )
}
/*****************************************************************************/
-ByteString GetGSILineLangId( const ByteString &rLine, USHORT nFileType )
+ByteString GetGSILineLangId( const ByteString &rLine, sal_uInt16 nFileType )
/*****************************************************************************/
{
ByteString sLangId;
@@ -109,8 +109,8 @@ ByteString GetGSILineLangId( const ByteString &rLine, USHORT nFileType )
}
/*****************************************************************************/
-void ConvertGSILine( BOOL bToUTF8, ByteString &rLine,
- rtl_TextEncoding nEncoding, USHORT nFileType )
+void ConvertGSILine( sal_Bool bToUTF8, ByteString &rLine,
+ rtl_TextEncoding nEncoding, sal_uInt16 nFileType )
/*****************************************************************************/
{
switch ( nFileType ) {
@@ -123,7 +123,7 @@ void ConvertGSILine( BOOL bToUTF8, ByteString &rLine,
case GSI_FILE_L10NFRAMEWORK: {
ByteString sConverted;
- for ( USHORT i = 0; i < rLine.GetTokenCount( '\t' ); i++ ) {
+ for ( sal_uInt16 i = 0; i < rLine.GetTokenCount( '\t' ); i++ ) {
ByteString sToken = rLine.GetToken( i, '\t' );
if (( i > 9 ) && ( i < 14 )) {
if( bToUTF8 )
@@ -232,9 +232,9 @@ int _cdecl main( int argc, char *argv[] )
exit ( 3 );
}
- USHORT nFileType( GetGSIFileType( aGSI ));
+ sal_uInt16 nFileType( GetGSIFileType( aGSI ));
- ULONG nMaxLines = (ULONG) ByteString( argv[ 2 ] ).ToInt64();
+ sal_uLong nMaxLines = (sal_uLong) ByteString( argv[ 2 ] ).ToInt64();
if ( !nMaxLines ) {
fprintf( stderr, "\nERROR: Linecount must be at least 1!\n\n" );
exit ( 3 );
@@ -242,8 +242,8 @@ int _cdecl main( int argc, char *argv[] )
ByteString sGSILine;
ByteString sOldId;
- ULONG nLine = 0;
- ULONG nOutputFile = 1;
+ sal_uLong nLine = 0;
+ sal_uLong nOutputFile = 1;
String sOutput( sBase );
sOutput += String( "_", RTL_TEXTENCODING_ASCII_US );
@@ -346,7 +346,7 @@ int _cdecl main( int argc, char *argv[] )
fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer());
exit ( 3 );
}
- USHORT nFileType( GetGSIFileType( aGSI ));
+ sal_uInt16 nFileType( GetGSIFileType( aGSI ));
ByteString sGSILine;
while ( !aGSI.IsEof()) {
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index a8eec6909914..32de3cc5efeb 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -51,17 +51,16 @@
#define DBHELP_ONLY
-
class IndexerPreProcessor
{
private:
- std::string m_aModuleName;
- fs::path m_fsIndexBaseDir;
- fs::path m_fsCaptionFilesDirName;
- fs::path m_fsContentFilesDirName;
+ std::string m_aModuleName;
+ fs::path m_fsIndexBaseDir;
+ fs::path m_fsCaptionFilesDirName;
+ fs::path m_fsContentFilesDirName;
- xsltStylesheetPtr m_xsltStylesheetPtrCaption;
- xsltStylesheetPtr m_xsltStylesheetPtrContent;
+ xsltStylesheetPtr m_xsltStylesheetPtrCaption;
+ xsltStylesheetPtr m_xsltStylesheetPtrContent;
public:
IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
@@ -250,7 +249,6 @@ class HelpLinker
{
public:
void main(std::vector<std::string> &args,
-// std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
std::string* pExtensionPath = NULL,
std::string* pDestination = NULL,
const rtl::OUString* pOfficeHelpPath = NULL )
@@ -278,12 +276,10 @@ private:
std::string extdestination;
std::string module;
std::string lang;
- std::string hid;
std::string extensionPath;
std::string extensionDestination;
bool bExtensionMode;
fs::path indexDirName;
- Stringtable hidlistTranslation;
fs::path indexDirParentName;
bool init;
IndexerPreProcessor* m_pIndexerPreProcessor;
@@ -324,13 +320,6 @@ void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishi
HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " <<
fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl);
- std::string temp = thishid;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
- const std::string& translatedHid = hidlistTranslation[temp];
- if (!translatedHid.empty())
- thishid = translatedHid;
-
thishid = URLEncoder::encode(thishid);
DBT key;
@@ -464,20 +453,6 @@ void HelpLinker::link() throw( HelpProcessingException )
try
{
- std::ifstream fileReader(hid.c_str());
- while (fileReader)
- {
- std::string key;
- fileReader >> key;
- std::transform (key.begin(), key.end(), key.begin(), toupper);
- std::replace(key.begin(), key.end(), ':', '_');
- std::string data;
- fileReader >> data;
- if (!key.empty() && !data.empty())
- hidlistTranslation[key] = data;
- }
- fileReader.close();
-
// lastly, initialize the indexBuilder
if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty())
initIndexerPreProcessor();
@@ -636,13 +611,6 @@ void HelpLinker::link() throw( HelpProcessingException )
std::string helpTextId = helpTextIter->first;
const std::string& helpTextText = helpTextIter->second;
- std::string temp = helpTextId;
- std::transform (temp.begin(), temp.end(), temp.begin(), toupper);
- std::replace(temp.begin(), temp.end(), ':', '_');
-
- const std::string& tHid = hidlistTranslation[temp];
- if (!tHid.empty())
- helpTextId = tHid;
helpTextId = URLEncoder::encode(helpTextId);
DBT keyDbt;
@@ -682,8 +650,8 @@ void HelpLinker::link() throw( HelpProcessingException )
if( !bExtensionMode )
std::cout << std::endl;
- } // try
- catch( HelpProcessingException& )
+ } // try
+ catch( const HelpProcessingException& )
{
// catch HelpProcessingException to avoid locking data bases
#ifndef DBHELP_ONLY
@@ -887,14 +855,7 @@ void HelpLinker::main( std::vector<std::string> &args,
else if (args[i].compare("-hid") == 0)
{
++i;
- if (i >= args.size())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
- hid = args[i];
+ throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, "obsolete -hid argument used" );
}
else if (args[i].compare("-add") == 0)
{
@@ -1051,13 +1012,6 @@ void HelpLinker::main( std::vector<std::string> &args,
aStrStream << "language missing" << std::endl;
throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
}
- if (!bExtensionMode && hid.empty())
- {
- std::stringstream aStrStream;
- aStrStream << "hid list missing" << std::endl;
- throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
- }
-
link();
}
@@ -1120,7 +1074,7 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr
// Returns true in case of success, false in case of error
HELPLINKER_DLLPUBLIC bool compileExtensionHelp
(
- const rtl::OUString& aOfficeHelpPath,
+ const rtl::OUString& aOfficeHelpPath,
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
@@ -1213,6 +1167,4 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
return bSuccess;
}
-// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index 2c73d36bd4cf..74d183185cfa 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -52,10 +52,10 @@
// set of global variables
ByteString sInputFile;
-BOOL bEnableExport;
-BOOL bMergeMode;
-BOOL bErrorLog;
-BOOL bUTF8;
+sal_Bool bEnableExport;
+sal_Bool bMergeMode;
+sal_Bool bErrorLog;
+sal_Bool bUTF8;
ByteString sPrj;
ByteString sPrjRoot;
ByteString sOutputFile;
@@ -64,20 +64,20 @@ ByteString sOutputFileY;
ByteString sSDFFile;
/*****************************************************************************/
-BOOL ParseCommandLine( int argc, char* argv[])
+sal_Bool ParseCommandLine( int argc, char* argv[])
/*****************************************************************************/
{
- bEnableExport = FALSE;
- bMergeMode = FALSE;
- bErrorLog = TRUE;
- bUTF8 = TRUE;
+ bEnableExport = sal_False;
+ bMergeMode = sal_False;
+ bErrorLog = sal_True;
+ bUTF8 = sal_True;
sPrj = "";
sPrjRoot = "";
Export::sLanguages = "";
Export::sForcedLanguages = "";
- USHORT nState = STATE_NON;
- BOOL bInput = FALSE;
+ sal_uInt16 nState = STATE_NON;
+ sal_Bool bInput = sal_False;
// parse command line
for( int i = 1; i < argc; i++ ) {
@@ -108,15 +108,15 @@ BOOL ParseCommandLine( int argc, char* argv[])
}
else if ( ByteString( argv[ i ]).ToUpperAscii() == "-E" ) {
nState = STATE_ERRORLOG;
- bErrorLog = FALSE;
+ bErrorLog = sal_False;
}
else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) {
nState = STATE_UTF8;
- bUTF8 = TRUE;
+ bUTF8 = sal_True;
}
else if ( ByteString( argv[ i ]).ToUpperAscii() == "-NOUTF8" ) {
nState = STATE_UTF8;
- bUTF8 = FALSE;
+ bUTF8 = sal_False;
}
else if ( ByteString( argv[ i ]).ToUpperAscii() == "-L" ) {
nState = STATE_LANGUAGES;
@@ -124,12 +124,12 @@ BOOL ParseCommandLine( int argc, char* argv[])
else {
switch ( nState ) {
case STATE_NON: {
- return FALSE; // no valid command line
+ return sal_False; // no valid command line
}
//break;
case STATE_INPUT: {
sInputFile = argv[ i ];
- bInput = TRUE; // source file found
+ bInput = sal_True; // source file found
}
break;
case STATE_OUTPUT: {
@@ -154,7 +154,7 @@ BOOL ParseCommandLine( int argc, char* argv[])
break;
case STATE_SDFFILE: {
sSDFFile = argv[ i ];
- bMergeMode = TRUE; // activate merge mode, cause merge database found
+ bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
@@ -170,12 +170,12 @@ BOOL ParseCommandLine( int argc, char* argv[])
if ( bInput ) {
// command line is valid
- bEnableExport = TRUE;
- return TRUE;
+ bEnableExport = sal_True;
+ return sal_True;
}
// command line is not valid
- return FALSE;
+ return sal_False;
}
@@ -227,8 +227,8 @@ int _cdecl main( int argc, char *argv[] )
{
//sal_uInt64 startreadloc = Export::startMessure();
- MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252 );
- //MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252, false );
+ MergeDataFile aMergeDataFile( sSDFFile, sInputFile , sal_False, RTL_TEXTENCODING_MS_1252 );
+ //MergeDataFile aMergeDataFile( sSDFFile, sInputFile , sal_False, RTL_TEXTENCODING_MS_1252, false );
//Export::stopMessure( ByteString("read localize.sdf") , startreadloc );
hasNoError = aParser.Merge( sSDFFile, sOutputFile , Export::sLanguages , aMergeDataFile );
@@ -260,8 +260,8 @@ int _cdecl main( int argc, char *argv[] )
aFStream.close();
ByteString sHelpFile(""); // dummy
- //MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252, false );
- MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252 );
+ //MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , sal_False, RTL_TEXTENCODING_MS_1252, false );
+ MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , sal_False, RTL_TEXTENCODING_MS_1252 );
//aMergeDataFile.Dump();
std::vector<ByteString> aLanguages;
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 03e303e1b8b1..66029f97a691 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -252,7 +252,7 @@ bool HelpParser::CreateSDF(
DirEntry aTempFile( sUsedTempFile );
aTempFile.Kill();
}
- return TRUE;
+ return sal_True;
}
ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in )
@@ -564,9 +564,9 @@ void HelpParser::MakeDir( const ByteString& sPath ){
ByteString sTPath( sPath );
ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
sTPath.SearchAndReplaceAll( sDelimiter , '/' );
- USHORT cnt = sTPath.GetTokenCount( '/' );
+ sal_uInt16 cnt = sTPath.GetTokenCount( '/' );
ByteString sCreateDir;
- for( USHORT i = 0 ; i < cnt ; i++ )
+ for( sal_uInt16 i = 0 ; i < cnt ; i++ )
{
sCreateDir += sTPath.GetToken( i , '/' );
sCreateDir += sDelimiter;
diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx
index 4efcc4c54525..723b54d21e01 100644
--- a/l10ntools/source/lngex.cxx
+++ b/l10ntools/source/lngex.cxx
@@ -49,31 +49,31 @@
// set of global variables
ByteString sInputFile;
-BOOL bEnableExport;
-BOOL bMergeMode;
-BOOL bErrorLog;
-BOOL bUTF8;
-BOOL bULF; // ULF = Unicode Language File
+sal_Bool bEnableExport;
+sal_Bool bMergeMode;
+sal_Bool bErrorLog;
+sal_Bool bUTF8;
+sal_Bool bULF; // ULF = Unicode Language File
ByteString sPrj;
ByteString sPrjRoot;
ByteString sOutputFile;
ByteString sMergeSrc;
/*****************************************************************************/
-BOOL ParseCommandLine( int argc, char* argv[])
+sal_Bool ParseCommandLine( int argc, char* argv[])
/*****************************************************************************/
{
- bEnableExport = FALSE;
- bMergeMode = FALSE;
- bErrorLog = TRUE;
- bUTF8 = TRUE;
- bULF = FALSE;
+ bEnableExport = sal_False;
+ bMergeMode = sal_False;
+ bErrorLog = sal_True;
+ bUTF8 = sal_True;
+ bULF = sal_False;
sPrj = "";
sPrjRoot = "";
Export::sLanguages = "";
- USHORT nState = STATE_NON;
- BOOL bInput = FALSE;
+ sal_uInt16 nState = STATE_NON;
+ sal_Bool bInput = sal_False;
// parse command line
for( int i = 1; i < argc; i++ ) {
@@ -96,11 +96,11 @@ BOOL ParseCommandLine( int argc, char* argv[])
}
else if ( sSwitch == "-E" ) {
nState = STATE_ERRORLOG;
- bErrorLog = FALSE;
+ bErrorLog = sal_False;
}
else if ( sSwitch == "-UTF8" ) {
nState = STATE_UTF8;
- bUTF8 = TRUE;
+ bUTF8 = sal_True;
}
else if ( sSwitch == "-L" ) {
nState = STATE_LANGUAGES;
@@ -108,12 +108,12 @@ BOOL ParseCommandLine( int argc, char* argv[])
else {
switch ( nState ) {
case STATE_NON: {
- return FALSE; // no valid command line
+ return sal_False; // no valid command line
}
//break;
case STATE_INPUT: {
sInputFile = argv[ i ];
- bInput = TRUE; // source file found
+ bInput = sal_True; // source file found
}
break;
case STATE_OUTPUT: {
@@ -130,7 +130,7 @@ BOOL ParseCommandLine( int argc, char* argv[])
break;
case STATE_MERGESRC: {
sMergeSrc = argv[ i ];
- bMergeMode = TRUE; // activate merge mode, cause merge database found
+ bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
@@ -143,13 +143,13 @@ BOOL ParseCommandLine( int argc, char* argv[])
if ( bInput ) {
// command line is valid
- bULF = TRUE;
- bEnableExport = TRUE;
- return TRUE;
+ bULF = sal_True;
+ bEnableExport = sal_True;
+ return sal_True;
}
// command line is not valid
- return FALSE;
+ return sal_False;
}
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 5f6273a24ac6..93513e2a8bfe 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -39,7 +39,7 @@ using namespace std;
// class LngParser
//
/*****************************************************************************/
-LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat )
+LngParser::LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat )
/*****************************************************************************/
:
nError( LNG_OK ),
@@ -101,7 +101,7 @@ void LngParser::FillInFallbacks( ByteStringHashMap Text )
}
/*****************************************************************************/
-BOOL LngParser::CreateSDF(
+sal_Bool LngParser::CreateSDF(
const ByteString &rSDFFile, const ByteString &rPrj,
const ByteString &rRoot )
/*****************************************************************************/
@@ -127,7 +127,7 @@ BOOL LngParser::CreateSDF(
sActFileName.SearchAndReplaceAll( "/", "\\" );
size_t nPos = 0;
- BOOL bStart = true;
+ sal_Bool bStart = true;
ByteString sGroup;
ByteStringHashMap Text;
ByteString sID;
@@ -157,7 +157,7 @@ BOOL LngParser::CreateSDF(
const ByteString &sActFileName , const ByteString &sID )
{
- BOOL bExport = true;
+ sal_Bool bExport = true;
if ( bExport ) {
ByteString sTimeStamp( Export::GetTimeStamp());
ByteString sCur;
@@ -203,7 +203,7 @@ BOOL LngParser::CreateSDF(
}
/*****************************************************************************/
-BOOL LngParser::Merge(
+sal_Bool LngParser::Merge(
const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj )
/*****************************************************************************/
{
@@ -217,14 +217,14 @@ BOOL LngParser::Merge(
}
nError = LNG_OK;
- MergeDataFile aMergeDataFile( rSDFFile, sSource , FALSE, RTL_TEXTENCODING_MS_1252);//, bDBIsUTF8 );
+ MergeDataFile aMergeDataFile( rSDFFile, sSource , sal_False, RTL_TEXTENCODING_MS_1252);//, bDBIsUTF8 );
ByteString sTmp( Export::sLanguages );
if( sTmp.ToUpperAscii().Equals("ALL") )
Export::SetLanguages( aMergeDataFile.GetLanguages() );
aLanguages = Export::GetLanguages();
size_t nPos = 0;
- BOOL bGroup = FALSE;
+ sal_Bool bGroup = sal_False;
ByteString sGroup;
// seek to next group
@@ -238,7 +238,7 @@ BOOL LngParser::Merge(
sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' );
sGroup.EraseLeadingChars( ' ' );
sGroup.EraseTrailingChars( ' ' );
- bGroup = TRUE;
+ bGroup = sal_True;
}
nPos ++;
}
@@ -246,13 +246,13 @@ BOOL LngParser::Merge(
while ( nPos < pLines->size()) {
ByteStringHashMap Text;
ByteString sID( sGroup );
- ULONG nLastLangPos = 0;
+ sal_uLong nLastLangPos = 0;
ResData *pResData = new ResData( "", sID , sSource );
pResData->sResTyp = "LngText";
PFormEntrys *pEntrys = aMergeDataFile.GetPFormEntrys( pResData );
// read languages
- bGroup = FALSE;
+ bGroup = sal_False;
ByteString sLanguagesDone;
@@ -266,7 +266,7 @@ BOOL LngParser::Merge(
sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' );
sGroup.EraseLeadingChars( ' ' );
sGroup.EraseTrailingChars( ' ' );
- bGroup = TRUE;
+ bGroup = sal_True;
nPos ++;
sLanguagesDone = "";
}
@@ -290,7 +290,7 @@ BOOL LngParser::Merge(
ByteString sText = sLine.GetToken( 1, '\"' ).GetToken( 0, '\"' );
if( sLang.Len() ){
ByteString sNewText;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, TRUE );
+ pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, sal_True );
if ( sNewText.Len()) {
ByteString *pLine = (*pLines)[ nPos ];
@@ -323,7 +323,7 @@ BOOL LngParser::Merge(
if( !sCur.EqualsIgnoreCaseAscii("en-US") && !Text[ sCur ].Len() && pEntrys ) {
ByteString sNewText;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, TRUE );
+ pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, sal_True );
if (( sNewText.Len()) &&
!(( sCur.Equals("x-comment") ) && ( sNewText == "-" )))
{
@@ -355,7 +355,7 @@ BOOL LngParser::Merge(
aDestination.WriteLine( *(*pLines)[ i ] );
aDestination.Close();
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index b6f646701f9a..c8db7ee8ec8d 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -180,7 +180,7 @@ class SourceTreeLocalizer : public SourceTreeIterator
{
private:
SvFileStream aSDF;
- USHORT nMode;
+ sal_uInt16 nMode;
ByteString sLanguageRestriction;
@@ -188,12 +188,12 @@ private:
int nFileCnt;
- const ByteString GetProjectName( BOOL bAbs = FALSE );
+ const ByteString GetProjectName( sal_Bool bAbs = sal_False );
const ByteString GetProjectRootRel();
- BOOL CheckNegativeList( const ByteString &rFileName );
- BOOL CheckPositiveList( const ByteString &rFileName );
+ sal_Bool CheckNegativeList( const ByteString &rFileName );
+ sal_Bool CheckPositiveList( const ByteString &rFileName );
void WorkOnFile(
const ByteString &rFileName,
@@ -209,8 +209,8 @@ private:
const ByteString &rCollectMode
);
void WorkOnDirectory( const ByteString &rDirectory );
- BOOL ExecuteMerge();
- BOOL MergeSingleFile(
+ sal_Bool ExecuteMerge();
+ sal_Bool MergeSingleFile(
const ByteString &rPrj,
const ByteString &rFile,
const ByteString &rSDFFile
@@ -225,8 +225,8 @@ public:
void SetLanguageRestriction( const ByteString& rRestrictions )
{ sLanguageRestriction = rRestrictions; }
int getFileCnt();
- BOOL Extract( const ByteString &rDestinationFile );
- BOOL Merge( const ByteString &rSourceFile , const ByteString &rOutput );
+ sal_Bool Extract( const ByteString &rDestinationFile );
+ sal_Bool Merge( const ByteString &rSourceFile , const ByteString &rOutput );
int GetFileCnt();
virtual void OnExecuteDirectory( const rtl::OUString &rDirectory );
};
@@ -249,10 +249,10 @@ SourceTreeLocalizer::~SourceTreeLocalizer()
}
/*****************************************************************************/
-const ByteString SourceTreeLocalizer::GetProjectName( BOOL bAbs )
+const ByteString SourceTreeLocalizer::GetProjectName( sal_Bool bAbs )
/*****************************************************************************/
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
DirEntry aCur;
aCur.ToAbs();
@@ -280,7 +280,7 @@ int SourceTreeLocalizer::GetFileCnt(){
const ByteString SourceTreeLocalizer::GetProjectRootRel()
/*****************************************************************************/
{
- ByteString sProjectRoot( GetProjectName( TRUE ));
+ ByteString sProjectRoot( GetProjectName( sal_True ));
DirEntry aCur;
aCur.ToAbs();
ByteString sCur( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US );
@@ -293,10 +293,10 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel()
sCur.SearchAndReplaceAll( sDelimiter, "/" );
sCur.EraseLeadingChars( '/' );
- ULONG nCount = sCur.GetTokenCount( '/' );
+ sal_uLong nCount = sCur.GetTokenCount( '/' );
ByteString sProjectRootRel;
- for ( ULONG i = 0; i < nCount; i++ ) {
+ for ( sal_uLong i = 0; i < nCount; i++ ) {
if ( sProjectRootRel.Len())
sProjectRootRel += sDelimiter;
sProjectRootRel += "..";
@@ -420,11 +420,11 @@ ByteString SourceTreeLocalizer::getSourceLanguages( ByteString sLanguageRestrict
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName )
+sal_Bool SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName )
/*****************************************************************************/
{
- ULONG nIndex = 0;
- BOOL bReturn = TRUE;
+ sal_uLong nIndex = 0;
+ sal_Bool bReturn = sal_True;
ByteString sDelimiter(
DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
@@ -439,7 +439,7 @@ BOOL SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName )
sNegative.ToLowerAscii();
if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len())
- bReturn = FALSE;
+ bReturn = sal_False;
nIndex++;
sNegative = NegativeList[ nIndex ];
@@ -449,11 +449,11 @@ BOOL SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName )
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName )
+sal_Bool SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName )
/*****************************************************************************/
{
- ULONG nIndex = 0;
- BOOL bReturn = FALSE;
+ sal_uLong nIndex = 0;
+ sal_Bool bReturn = sal_False;
ByteString sDelimiter(
DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
@@ -468,7 +468,7 @@ BOOL SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName )
sNegative.ToLowerAscii();
if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len())
- bReturn = TRUE;
+ bReturn = sal_True;
nIndex++;
sNegative = PositiveList[ nIndex ];
@@ -493,11 +493,11 @@ void SourceTreeLocalizer::WorkOnFileType(
DirEntry aEntry( sWild );
Dir aDir( sWild, FSYS_KIND_FILE );
- for ( USHORT i = 0; i < aDir.Count(); i++ ) {
+ for ( sal_uInt16 i = 0; i < aDir.Count(); i++ ) {
DirEntry aFile( aDir[ i ] );
ByteString sFile( aFile.GetFull(), RTL_TEXTENCODING_ASCII_US );
- BOOL bAllowed = TRUE;
+ sal_Bool bAllowed = sal_True;
if ( rCollectMode.Equals( "negative" ))
bAllowed = CheckNegativeList( sFile );
@@ -514,7 +514,7 @@ void SourceTreeLocalizer::WorkOnDirectory( const ByteString &rDirectory )
/*****************************************************************************/
{
//printf("Working on Directory %s\n",rDirectory.GetBuffer());
- ULONG nIndex = 0;
+ sal_uLong nIndex = 0;
ByteString sExtension( ExeTable[ nIndex ][ 0 ] );
ByteString sExecutable( ExeTable[ nIndex ][ 1 ] );
ByteString sParameter( ExeTable[ nIndex ][ 2 ] );
@@ -548,7 +548,7 @@ void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory )
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile )
+sal_Bool SourceTreeLocalizer::Extract( const ByteString &rDestinationFile )
/*****************************************************************************/
{
nMode = LOCALIZE_EXTRACT;
@@ -556,7 +556,7 @@ BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile )
aSDF.Open( String( rDestinationFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_STD_WRITE );
aSDF.SetLineDelimiter( LINEEND_CRLF );
- BOOL bReturn = aSDF.IsOpen();
+ sal_Bool bReturn = aSDF.IsOpen();
if ( bReturn ) {
aSDF.Seek( STREAM_SEEK_TO_END );
bReturn = StartExecute();
@@ -571,7 +571,7 @@ BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile )
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::MergeSingleFile(
+sal_Bool SourceTreeLocalizer::MergeSingleFile(
const ByteString &rPrj,
const ByteString &rFile,
const ByteString &rSDFFile
@@ -580,7 +580,7 @@ BOOL SourceTreeLocalizer::MergeSingleFile(
{
//printf("MergeSingleFile(%s,%s,%s)",rPrj.GetBuffer(),rFile.GetBuffer(),rSDFFile.GetBuffer());
if ( !rFile.Len())
- return TRUE;
+ return sal_True;
ByteString sRoot( Export::GetEnv( "SRC_ROOT" ));
DirEntry aEntry( String( sRoot, RTL_TEXTENCODING_ASCII_US ));
@@ -598,7 +598,7 @@ BOOL SourceTreeLocalizer::MergeSingleFile(
ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
- ULONG nIndex = 0;
+ sal_uLong nIndex = 0;
ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US );
ByteString sCandidate( ExeTable[ nIndex ][ 0 ] );
@@ -610,18 +610,18 @@ BOOL SourceTreeLocalizer::MergeSingleFile(
DirEntryKind theDir=FSYS_KIND_FILE;
Dir myDir( aEntry.GetPath(), theDir);
DirEntry current;
- BOOL found=FALSE;
- for( USHORT x=0; x < myDir.Count() && !found;){
+ sal_Bool found=sal_False;
+ for( sal_uInt16 x=0; x < myDir.Count() && !found;){
current=myDir[x++];
StringCompare result=current.GetName().CompareIgnoreCaseToAscii( aEntry.GetName() );
if( result==COMPARE_EQUAL ){
fprintf(stderr,"WARNING: %s not found\n", ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer() );
fprintf(stderr,"but use %s instead \n" , ByteString(current.GetFull(), RTL_TEXTENCODING_ASCII_US).GetBuffer() );
aEntry=current;
- found=TRUE;
+ found=sal_True;
}
}
- if(!found) return TRUE;
+ if(!found) return sal_True;
}
@@ -660,7 +660,7 @@ BOOL SourceTreeLocalizer::MergeSingleFile(
sOutput.GetBuffer());
}
else {
- FileStat::SetReadOnlyFlag( aEntry, FALSE );
+ FileStat::SetReadOnlyFlag( aEntry, sal_False );
String myStr2(aEntry.GetFull());
String aTemp22 = String::CreateFromAscii("_tmp");
myStr2.Append(aTemp22);
@@ -705,14 +705,14 @@ BOOL SourceTreeLocalizer::MergeSingleFile(
aOut.Kill();
} // else
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::ExecuteMerge( )
+sal_Bool SourceTreeLocalizer::ExecuteMerge( )
/*****************************************************************************/
{
DirEntry aEntry( Export::GetTempFile());
- BOOL bReturn = TRUE;
+ sal_Bool bReturn = sal_True;
bool bMerged = false;
ByteString sFileName;
@@ -774,18 +774,18 @@ BOOL SourceTreeLocalizer::ExecuteMerge( )
// Test
if( bLocal ){
- USHORT nPos = sFile.SearchBackward( '\\' );
+ sal_uInt16 nPos = sFile.SearchBackward( '\\' );
ByteString sTmp = sFile.Copy( nPos+1 , sFile.Len()-nPos-1 );
//printf("'%s'='%s'\n",sTmp.GetBuffer(), sOutputFileName.GetBuffer());
if( sTmp.CompareTo(sOutputFileName) == COMPARE_EQUAL ){
bMerged = true;
if ( !MergeSingleFile( sPrj, sFile, sSDFFile ))
- bReturn = FALSE;
+ bReturn = sal_False;
}else{
bMerged = true;
//printf("MergeSingleFile('%s','%s','%s')\n",sPrj.GetBuffer(),sFile.GetBuffer(),sSDFFile.GetBuffer());
if ( !MergeSingleFile( sPrj, sFile, sSDFFile ))
- bReturn = FALSE;
+ bReturn = sal_False;
}
}
}
@@ -804,7 +804,7 @@ BOOL SourceTreeLocalizer::ExecuteMerge( )
}
/*****************************************************************************/
-BOOL SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteString &rOutput )
+sal_Bool SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteString &rOutput )
/*****************************************************************************/
{
sOutputFile = rOutput;
@@ -812,7 +812,7 @@ BOOL SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteStrin
aSDF.Open( String( rSourceFile, RTL_TEXTENCODING_ASCII_US ),
STREAM_STD_READ );
- BOOL bReturn = aSDF.IsOpen();
+ sal_Bool bReturn = aSDF.IsOpen();
if ( bReturn ) {
bReturn = ExecuteMerge();
}
@@ -869,7 +869,7 @@ int Error()
}
/*****************************************************************************/
-BOOL CheckLanguages( ByteString &rLanguages )
+sal_Bool CheckLanguages( ByteString &rLanguages )
/*****************************************************************************/
{
ByteString sTmp( rLanguages );
@@ -886,17 +886,17 @@ int _cdecl main( int argc, char *argv[] )
{
String sTempBase( String::CreateFromAscii( "loc" ));
DirEntry::SetTempNameBase( sTempBase );
- USHORT nState = STATE_NONE;
+ sal_uInt16 nState = STATE_NONE;
- BOOL bExport = FALSE;
- BOOL bMerge = FALSE;
+ sal_Bool bExport = sal_False;
+ sal_Bool bMerge = sal_False;
bool bSkipLinks = false;
ByteString sLanguages;
ByteString sFileName;
ByteString sOutput;
- bExport = TRUE;
+ bExport = sal_True;
for( int i = 1; i < argc; i++ ) {
ByteString sSwitch( argv[ i ] );
@@ -906,7 +906,7 @@ int _cdecl main( int argc, char *argv[] )
nState = STATE_EXPORT;
if ( bMerge )
return Error();
- bExport = TRUE;
+ bExport = sal_True;
}
else if ( sSwitch.Equals( "-I" ) )
nState = STATE_ISOCODE;
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index e828f12343f8..fa7c914d233e 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -36,27 +36,38 @@
using namespace std;
+namespace
+{
+ static ::rtl::OString lcl_NormalizeFilename(const ::rtl::OString& rFilename)
+ {
+ return rFilename.copy(
+ ::std::max(
+ rFilename.lastIndexOf( "\\" ),
+ rFilename.lastIndexOf( "/" ))+1);
+ };
+}
+
extern void ConvertHalfwitdhToFullwidth( String& rString );
//
// class PFormEntrys
//
-ByteString PFormEntrys::Dump(){
+ByteString PFormEntrys::Dump()
+{
ByteString sRet( "PFormEntrys\n" );
- //sRet.Append( Export::DumpMap( ByteString("sText") , sText ) );
- //sRet.Append("\n");
ByteString a("sText");
- if ( sText.size() ) Export::DumpMap( a , sText );
+ if(sText.size())
+ Export::DumpMap(a , sText);
return sRet;
}
-BOOL PFormEntrys::GetTransex3Text( ByteString &rReturn,
- USHORT nTyp, const ByteString &nLangIndex, BOOL bDel )
+sal_Bool PFormEntrys::GetTransex3Text( ByteString &rReturn,
+ sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel )
{
- BOOL rc = GetText( rReturn , nTyp , nLangIndex , bDel );
+ sal_Bool rc = GetText( rReturn , nTyp , nLangIndex , bDel );
ByteString test( rReturn );
- for( USHORT idx = 0; idx < rReturn.Len(); idx++ )
+ for( sal_uInt16 idx = 0; idx < rReturn.Len(); idx++ )
{
if( rReturn.GetChar( idx ) == '\"' && ( idx >= 1 ) && rReturn.GetChar( idx-1 ) == '\\' )
{
@@ -68,31 +79,18 @@ BOOL PFormEntrys::GetTransex3Text( ByteString &rReturn,
return rc;
}
/*****************************************************************************/
-BOOL PFormEntrys::GetText( ByteString &rReturn,
- USHORT nTyp, const ByteString &nLangIndex, BOOL bDel )
-/*****************************************************************************/
+sal_Bool PFormEntrys::GetText( ByteString &rReturn,
+ sal_uInt16 nTyp, const ByteString &nLangIndex, sal_Bool bDel )
{
- /*printf("DBG: PFormEntrys::GetText(nId=%s)\n",nLangIndex.GetBuffer() );
-
- // DEBUG******************
- ByteStringHashMap::const_iterator idbg;
- std::cout << "HASHKEYS : \n";
- for( idbg = sText.begin() ; idbg != sText.end(); ++idbg )
- std::cout << (idbg->first).GetBuffer() << "\n";
- std::cout << "\n\n";
- std::cout << "String sText[ nLangIndex ] = " << sText[ nLangIndex ].GetBuffer() << "\n";
- // DEBUG******************
-*/
-
- BOOL bReturn=TRUE;
+ sal_Bool bReturn=sal_True;
switch ( nTyp ) {
case STRING_TYP_TEXT :
rReturn = sText[ nLangIndex ];
if ( bDel )
sText[ nLangIndex ] = "";
bReturn = bTextFirst[ nLangIndex ];
- bTextFirst[ nLangIndex ] = FALSE;
+ bTextFirst[ nLangIndex ] = sal_False;
break;
case STRING_TYP_HELPTEXT :
rReturn = sHelpText;
@@ -102,17 +100,16 @@ BOOL PFormEntrys::GetText( ByteString &rReturn,
if ( bDel )
sQuickHelpText[ nLangIndex ] = "";
bReturn = bQuickHelpTextFirst[ nLangIndex ];
- bQuickHelpTextFirst[ nLangIndex ] = FALSE;
+ bQuickHelpTextFirst[ nLangIndex ] = sal_False;
break;
case STRING_TYP_TITLE :
rReturn = sTitle[ nLangIndex ];
if ( bDel )
sTitle[ nLangIndex ] = "";
bReturn = bTitleFirst[ nLangIndex ];
- bTitleFirst[ nLangIndex ] = FALSE;
+ bTitleFirst[ nLangIndex ] = sal_False;
break;
}
- //printf("Returning '%s'\n",rReturn.GetBuffer());
return bReturn;
}
@@ -121,68 +118,53 @@ BOOL PFormEntrys::GetText( ByteString &rReturn,
// class MergeData
//
-/*****************************************************************************/
MergeData::~MergeData()
-/*****************************************************************************/
{
}
-/*****************************************************************************/
-PFormEntrys* MergeData::GetPFormEntrys( ResData *pResData )
-/*****************************************************************************/
+PFormEntrys* MergeData::GetPFormEntrys(ResData*)
{
-
- (void) pResData; // FIXME
- if( aMap.find( ByteString("HACK") ) != aMap.end() ){
- return aMap[ ByteString("HACK") ];
- }
- else{
- return 0;
- }
+ if( aMap.find( ByteString("HACK") ) != aMap.end() )
+ return aMap[ ByteString("HACK") ];
+ return NULL;
}
-void MergeData::Insert( const ByteString& rPFO , PFormEntrys* pfEntrys ){
- (void) rPFO; // FIXME
+void MergeData::Insert(const ByteString&, PFormEntrys* pfEntrys )
+{
aMap.insert( PFormEntrysHashMap::value_type( ByteString("HACK") , pfEntrys ) );
-
}
+
ByteString MergeData::Dump(){
ByteString sRet( "MergeData\n" );
printf("MergeData sTyp = %s , sGid = %s , sLid =%s , sFilename = %s\n",sTyp.GetBuffer(),sGID.GetBuffer(),sLID.GetBuffer(), sFilename.GetBuffer() );
PFormEntrysHashMap::const_iterator idbg;
- for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){
+ for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg )
+ {
printf("aMap[ %s ] = " ,idbg->first.GetBuffer());
( (PFormEntrys*)(idbg->second) )->Dump();
- printf("\n") ;
+ printf("\n");
}
- printf("\n") ;
+ printf("\n");
return sRet;
}
PFormEntrys* MergeData::GetPFObject( const ByteString& rPFO ){
- if( aMap.find( ByteString("HACK") ) != aMap.end() ){
+ if( aMap.find( ByteString("HACK") ) != aMap.end() )
return aMap[ rPFO ];
- }
- else{
- return 0;
- }
+ return NULL;
}
-/*****************************************************************************/
PFormEntrys *MergeData::InsertEntry( const ByteString &rPForm )
-/*****************************************************************************/
{
PFormEntrys* pFEntrys = new PFormEntrys( rPForm );
aMap.insert( PFormEntrysHashMap::value_type( rPForm , pFEntrys ) );
return pFEntrys;
}
-/*****************************************************************************/
-BOOL MergeData::operator==( ResData *pData )
-/*****************************************************************************/
+sal_Bool MergeData::operator==( ResData *pData )
{
ByteString sResTyp_upper( pData->sResTyp );
sResTyp_upper.ToUpperAscii();
@@ -203,121 +185,95 @@ BOOL MergeData::operator==( ResData *pData )
#define FFORMAT_NEW 0x0001
#define FFORMAT_OLD 0x0002
-/*****************************************************************************/
-MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,BOOL bErrLog,
- CharSet aCharSet, bool bCaseSensitive )
-/*****************************************************************************/
- : bErrorLog( bErrLog )
+MergeDataFile::MergeDataFile(
+ const ByteString &rFileName,
+ const ByteString& sFile,
+ sal_Bool bErrLog,
+ CharSet aCharSet,
+ bool bCaseSensitive)
+ : bErrorLog( bErrLog )
{
-
SvFileStream aInputStream( String( rFileName, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ );
aInputStream.SetStreamCharSet( aCharSet );
ByteString sLine;
-// printf("\nReading localize.sdf ...\n");
- ByteString sTYP;
- ByteString sGID;
- ByteString sLID;
- ByteString sPFO;
- ByteString nLANG;
- ByteString sTEXT;
- ByteString sQHTEXT;
- ByteString sTITLE;
- ByteString sHACK("HACK");
+ const ByteString sHACK("HACK");
+ const ::rtl::OString sFileNormalized(lcl_NormalizeFilename(sFile));
+ const bool isFileEmpty = sFileNormalized.getLength();
- const ByteString sEmpty("");
-
- if( !aInputStream.IsOpen() ) {
+ if( !aInputStream.IsOpen() )
+ {
printf("Warning : Can't open %s\n", rFileName.GetBuffer());
return;
}
- while ( !aInputStream.IsEof()) {
+ while ( !aInputStream.IsEof())
+ {
xub_StrLen nToks;
aInputStream.ReadLine( sLine );
sLine = sLine.Convert( RTL_TEXTENCODING_MS_1252, aCharSet );
nToks = sLine.GetTokenCount( '\t' );
- if ( nToks == 15 ) {
+ if ( nToks == 15 )
+ {
// Skip all wrong filenames
- ByteString filename = sLine.GetToken( 1 , '\t' );
- filename = filename.Copy( filename.SearchCharBackward( "\\" )+1 , filename.Len() );
-
- if( sFile.Equals( sEmpty ) || ( !sFile.Equals( sEmpty ) && filename.Equals( sFile ) ) )
+ const ::rtl::OString filename = lcl_NormalizeFilename(sLine.GetToken( 1 , '\t' ));
+ if(isFileEmpty || sFileNormalized.equals("") || (!isFileEmpty && filename.equals(sFileNormalized)) )
{
- xub_StrLen rIdx = 0;
- sTYP = sLine.GetToken( 3, '\t', rIdx );
- sGID = sLine.GetToken( 0, '\t', rIdx ); // 4
- sLID = sLine.GetToken( 0, '\t', rIdx ); // 5
- sPFO = sLine.GetToken( 1, '\t', rIdx ); // 7
- sPFO = sHACK;
- nLANG = sLine.GetToken( 1, '\t', rIdx ); // 9
- sTEXT = sLine.GetToken( 0, '\t', rIdx ); // 10
-
- sQHTEXT = sLine.GetToken( 1, '\t', rIdx ); // 12
- sTITLE = sLine.GetToken( 0, '\t', rIdx ); // 13
-
+ xub_StrLen rIdx = 0;
+ const ByteString sTYP = sLine.GetToken( 3, '\t', rIdx );
+ const ByteString sGID = sLine.GetToken( 0, '\t', rIdx ); // 4
+ const ByteString sLID = sLine.GetToken( 0, '\t', rIdx ); // 5
+ ByteString sPFO = sLine.GetToken( 1, '\t', rIdx ); // 7
+ sPFO = sHACK;
+ ByteString nLANG = sLine.GetToken( 1, '\t', rIdx ); // 9
nLANG.EraseLeadingAndTrailingChars();
+ const ByteString sTEXT = sLine.GetToken( 0, '\t', rIdx ); // 10
+ const ByteString sQHTEXT = sLine.GetToken( 1, '\t', rIdx ); // 12
+ const ByteString sTITLE = sLine.GetToken( 0, '\t', rIdx ); // 13
+
#ifdef MERGE_SOURCE_LANGUAGES
- if( true ){
+ if( true )
#else
- if ( !nLANG.EqualsIgnoreCaseAscii("en-US") ){
+ if( !nLANG.EqualsIgnoreCaseAscii("en-US") )
#endif
- ByteStringHashMap::const_iterator lit;
- lit = aLanguageMap.find (nLANG);
- ByteString aLANG;
- if (lit == aLanguageMap.end()) {
- aLANG = nLANG;
- aLanguageMap.insert( ByteStringHashMap::value_type( aLANG, aLANG ) );
- // Remember read languages for -l all switch
- aLanguageList.push_back( nLANG );
- } else
- aLANG = lit->first;
-
- InsertEntry( sTYP, sGID, sLID, sPFO, aLANG, sTEXT, sQHTEXT, sTITLE , filename , bCaseSensitive );
+ {
+ aLanguageSet.insert(nLANG);
+ InsertEntry( sTYP, sGID, sLID, sPFO, nLANG, sTEXT, sQHTEXT, sTITLE, filename, bCaseSensitive );
}
}
}
- else if ( nToks == 10 ) {
+ else if ( nToks == 10 )
+ {
printf("ERROR: File format is obsolete and no longer supported!\n");
}
}
aInputStream.Close();
}
-/*****************************************************************************/
+
MergeDataFile::~MergeDataFile()
-/*****************************************************************************/
{
}
ByteString MergeDataFile::Dump(){
ByteString sRet( "MergeDataFile\n" );
- //sRet.Append( Export::DumpMap( "aLanguageSet" , aLanguageSet ) );
- //sRet.Append( Export::DumpMap( "aLanguageList" , aLanguageList ) );
printf("MergeDataFile\n");
MergeDataHashMap::const_iterator idbg;
- for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){
- /*sRet.Append( "aMap[" );
- sRet.Append( idbg->first );
- sRet.Append( "]= " );
- sRet.Append( ((MergeData*) (idbg->second))->Dump() );
- sRet.Append("\n");*/
-
+ for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg )
+ {
printf("aMap[ %s ] = ",idbg->first.GetBuffer());
((MergeData*) (idbg->second))->Dump();
printf("\n");
}
printf("\n");
- //sRet.Append("\n");
return sRet;
}
-/*****************************************************************************/
void MergeDataFile::WriteError( const ByteString &rLine )
-/*****************************************************************************/
{
- if ( bErrorLog ) {
+ if ( bErrorLog )
+ {
if ( !aErrLog.IsOpen())
aErrLog.Open( String( sErrorLog, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC );
aErrLog.WriteLine( rLine );
@@ -325,44 +281,39 @@ void MergeDataFile::WriteError( const ByteString &rLine )
else
fprintf( stderr, "%s\n", rLine.GetBuffer());
}
+
std::vector<ByteString> MergeDataFile::GetLanguages(){
- return aLanguageList;
+ return std::vector<ByteString>(aLanguageSet.begin(),aLanguageSet.end());
}
-/*****************************************************************************/
MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive )
-/*****************************************************************************/
{
ByteString sOldG = pResData->sGId;
ByteString sOldL = pResData->sId;
ByteString sGID = pResData->sGId;
ByteString sLID;
- if ( !sGID.Len())
+ if(!sGID.Len())
sGID = pResData->sId;
else
sLID = pResData->sId;
pResData->sGId = sGID;
pResData->sId = sLID;
- //printf("MergeData:: Search gid=%s lid=%s filename=%s \n", pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sFilename.GetBuffer() );
+
ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive );
- //printf("DBG: Searching [%s]\n",sKey.GetBuffer());
- if( aMap.find( sKey ) != aMap.end() ){
+ if(aMap.find( sKey ) != aMap.end())
+ {
pResData->sGId = sOldG;
pResData->sId = sOldL;
- //printf("DBG: Found[%s]\n",sKey.GetBuffer());
return aMap[ sKey ];
}
pResData->sGId = sOldG;
pResData->sId = sOldL;
- //printf("DBG: Found[%s]\n",sKey.GetBuffer());
return NULL;
}
-/*****************************************************************************/
PFormEntrys *MergeDataFile::GetPFormEntrys( ResData *pResData )
-/*****************************************************************************/
{
// search for requested PFormEntrys
MergeData *pData = GetMergeData( pResData );
@@ -371,9 +322,7 @@ PFormEntrys *MergeDataFile::GetPFormEntrys( ResData *pResData )
return NULL;
}
-/*****************************************************************************/
PFormEntrys *MergeDataFile::GetPFormEntrysCaseSensitive( ResData *pResData )
-/*****************************************************************************/
{
// search for requested PFormEntrys
MergeData *pData = GetMergeData( pResData , true );
@@ -381,69 +330,60 @@ PFormEntrys *MergeDataFile::GetPFormEntrysCaseSensitive( ResData *pResData )
return pData->GetPFormEntrys( pResData );
return NULL;
}
-/*****************************************************************************/
+
void MergeDataFile::InsertEntry(
- const ByteString &rTYP, const ByteString &rGID,
- const ByteString &rLID, const ByteString &rPFO,
- const ByteString &nLANG, const ByteString &rTEXT,
- const ByteString &rQHTEXT, const ByteString &rTITLE ,
- const ByteString &rInFilename , bool bCaseSensitive
- )
-/*****************************************************************************/
+ const ByteString &rTYP, const ByteString &rGID,
+ const ByteString &rLID, const ByteString &rPFO,
+ const ByteString &nLANG, const ByteString &rTEXT,
+ const ByteString &rQHTEXT, const ByteString &rTITLE ,
+ const ByteString &rInFilename , bool bCaseSensitive
+ )
{
MergeData *pData;
- // uniquify the filename to save memory.
- ByteStringHashMap::const_iterator fit = aFilenames.find (rInFilename);
- ByteString aFilename;
- if (fit == aFilenames.end()) {
- aFilename = rInFilename;
- aFilenames.insert (ByteStringHashMap::value_type (aFilename, aFilename));
- } else
- aFilename = fit->first;
-
// search for MergeData
-
- ByteString sKey = CreateKey( rTYP , rGID , rLID , aFilename , bCaseSensitive );
+ ByteString sKey = CreateKey( rTYP , rGID , rLID , rInFilename , bCaseSensitive );
MergeDataHashMap::const_iterator mit;
mit = aMap.find( sKey );
- if( mit != aMap.end() ){
+ if( mit != aMap.end() )
+ {
pData = mit->second;
- }else{
- pData = new MergeData( rTYP, rGID, rLID, aFilename );
+ }
+ else
+ {
+ pData = new MergeData( rTYP, rGID, rLID, rInFilename );
aMap.insert( MergeDataHashMap::value_type( sKey, pData ) );
}
PFormEntrys *pFEntrys = 0;
// search for PFormEntrys
-
pFEntrys = pData->GetPFObject( rPFO );
- if( !pFEntrys ){
+ if( !pFEntrys )
+ {
// create new PFormEntrys, cause no one exists with current properties
pFEntrys = new PFormEntrys( rPFO );
pData->Insert( rPFO , pFEntrys );
}
// finaly insert the cur string
-
pFEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE );
-
- //printf("DBG: MergeDataFile::Insert[]=( sKey=%s,nLang=%s,rTEXT=%s)\n",sKey2.GetBuffer(),nLANG.GetBuffer(),rTEXT.GetBuffer());
-}
-ByteString MergeDataFile::CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive ){
-
- ByteString sKey( rTYP );
- sKey.Append( '-' );
- sKey.Append( rGID );
- sKey.Append( '-' );
- sKey.Append( rLID );
- sKey.Append( '-' );
- sKey.Append( rFilename );
-
- if( bCaseSensitive ) return sKey; // officecfg case sensitive identifier
- else return sKey.ToUpperAscii();
}
+ByteString MergeDataFile::CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive )
+{
+ static const ::rtl::OString sStroke('-');
+ ::rtl::OString sKey( rTYP );
+ sKey += sStroke;
+ sKey += rGID;
+ sKey += sStroke;
+ sKey += rLID;
+ sKey += sStroke;
+ sKey += lcl_NormalizeFilename(rFilename);
+ OSL_TRACE("created key: %s", sKey.getStr());
+ if(bCaseSensitive)
+ return sKey; // officecfg case sensitive identifier
+ return sKey.toAsciiUpperCase();
+}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx
index 6ec75336cf52..bf407c9189fa 100644
--- a/l10ntools/source/srciter.cxx
+++ b/l10ntools/source/srciter.cxx
@@ -41,7 +41,7 @@
SourceTreeIterator::SourceTreeIterator(
const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in )
/*****************************************************************************/
- : bInExecute( FALSE ) , bLocal( bLocal_in )
+ : bInExecute( sal_False ) , bLocal( bLocal_in )
{
(void) rVersion ;
@@ -108,31 +108,31 @@ void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory )
aDirectory.readDirectory();
OnExecuteDirectory( aDirectory.getFullName() );
if ( aDirectory.getSubDirectories().size() )
- for ( ULONG i=0;i < aDirectory.getSubDirectories().size();i++ )
+ for ( sal_uLong i=0;i < aDirectory.getSubDirectories().size();i++ )
ExecuteDirectory( aDirectory.getSubDirectories()[ i ] );
}
}
/*****************************************************************************/
-BOOL SourceTreeIterator::StartExecute()
+sal_Bool SourceTreeIterator::StartExecute()
/*****************************************************************************/
{
- bInExecute = TRUE; // FIXME
+ bInExecute = sal_True; // FIXME
ExecuteDirectory( aRootDirectory );
if ( bInExecute ) { // FIXME
- bInExecute = FALSE;
- return TRUE;
+ bInExecute = sal_False;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*****************************************************************************/
void SourceTreeIterator::EndExecute()
/*****************************************************************************/
{
- bInExecute = FALSE;
+ bInExecute = sal_False;
}
/*****************************************************************************/
diff --git a/l10ntools/source/tagtest.cxx b/l10ntools/source/tagtest.cxx
index 30cbdd190291..65bd70a32ef4 100644
--- a/l10ntools/source/tagtest.cxx
+++ b/l10ntools/source/tagtest.cxx
@@ -43,12 +43,12 @@
-TokenInfo::TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList )
-: bClosed(FALSE)
-, bCloseTag(FALSE)
-, bIsBroken(FALSE)
-, bHasBeenFixed(FALSE)
-, bDone(FALSE)
+TokenInfo::TokenInfo( TokenId pnId, sal_uInt16 nP, String paStr, ParserMessageList &rErrorList )
+: bClosed(sal_False)
+, bCloseTag(sal_False)
+, bIsBroken(sal_False)
+, bHasBeenFixed(sal_False)
+, bDone(sal_False)
, aTokenString( paStr )
, nId( pnId )
, nPos(nP)
@@ -91,14 +91,14 @@ CLOSETAG_HAS_TAG_NAME '>' -> FINISHED
*/
void TokenInfo::SplitTag( ParserMessageList &rErrorList )
{
- USHORT nLastPos = 2; // skip initial \<
- USHORT nCheckPos = nLastPos;
+ sal_uInt16 nLastPos = 2; // skip initial \<
+ sal_uInt16 nCheckPos = nLastPos;
String aDelims( String::CreateFromAscii( " \\=>/" ) );
String aPortion;
String aValue; // store the value of a property
ByteString aName; // store the name of a property/tag
- BOOL bCheckName = FALSE;
- BOOL bCheckEmpty = FALSE;
+ sal_Bool bCheckName = sal_False;
+ sal_Bool bCheckEmpty = sal_False;
sal_Unicode cDelim;
tagcheck aState = TC_START;
@@ -127,7 +127,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case ' ': aState = TC_HAS_TAG_NAME;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
case '/':
{
@@ -138,12 +138,12 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
else
{
aState = TC_CLOSED;
- bCheckName = TRUE;
+ bCheckName = sal_True;
}
}
break;
case '>': aState = TC_FINISHED;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -157,16 +157,16 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case '=': aState = TC_HAS_PROP_NAME_EQ;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
case ' ': aState = TC_HAS_PROP_NAME_SP;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
case '/': aState = TC_CLOSED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
case '>': aState = TC_FINISHED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -177,7 +177,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case '=': aState = TC_HAS_PROP_NAME_EQ;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -189,10 +189,10 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case ' ': aState = TC_HAS_PROP_NAME_EQ_SP;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
case '\"': aState = TC_INSIDE_STRING;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
aValue.Erase();
break;
default: aState = TC_ERROR;
@@ -204,7 +204,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case '\"': aState = TC_INSIDE_STRING;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
aValue.Erase();
break;
default: aState = TC_ERROR;
@@ -225,14 +225,14 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
if ( !IsPropertyValueValid( aName, aValue ) )
{
rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' has invalid value '").Append(ByteString( aValue, RTL_TEXTENCODING_UTF8 )).Append("' "), *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
aProperties[ aName ] = aValue;
}
else
{
rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' defined twice "), *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
}
break;
@@ -252,13 +252,13 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case ' ': aState = TC_HAS_TAG_NAME;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
case '/': aState = TC_CLOSED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
case '>': aState = TC_FINISHED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -270,11 +270,11 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case ' ': aState = TC_CLOSED_SPACE;
- bCheckEmpty = TRUE;
- bClosed = TRUE;
+ bCheckEmpty = sal_True;
+ bClosed = sal_True;
break;
case '>': aState = TC_FINISHED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -285,7 +285,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case '>': aState = TC_FINISHED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -294,16 +294,16 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
// CLOSETAG ' ' -> CLOSETAG_HAS_TAG_NAME
// CLOSETAG '>' -> FINISHED
case TC_CLOSETAG:
- bCloseTag = TRUE;
+ bCloseTag = sal_True;
switch ( cDelim )
{
case ' ': aState = TC_CLOSETAG_HAS_TAG_NAME;
aTagName = aPortion;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
case '>': aState = TC_FINISHED;
aTagName = aPortion;
- bCheckName = TRUE;
+ bCheckName = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -314,7 +314,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
switch ( cDelim )
{
case '>': aState = TC_FINISHED;
- bCheckEmpty = TRUE;
+ bCheckEmpty = sal_True;
break;
default: aState = TC_ERROR;
}
@@ -322,7 +322,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
default: rErrorList.AddError( 99, "Internal error Parsing Tag ", *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
@@ -331,14 +331,14 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
if ( aPortion.Len() == 0 )
{
rErrorList.AddError( 25, "Tag/Property name missing ", *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
else
{
aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 );
// "a-zA-Z_-.0-9"
xub_StrLen nCount;
- BOOL bBroken = FALSE;
+ sal_Bool bBroken = sal_False;
const sal_Char* aBuf = aName.GetBuffer();
for ( nCount = 0 ; !bBroken && nCount < aName.Len() ; nCount++ )
{
@@ -354,11 +354,11 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
if ( bBroken )
{
rErrorList.AddError( 25, "Found illegal character in Tag/Property name ", *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
}
- bCheckName = FALSE;
+ bCheckName = sal_False;
}
if ( bCheckEmpty )
@@ -366,9 +366,9 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
if ( aPortion.Len() )
{
rErrorList.AddError( 25, ByteString("Found displaced characters '").Append(ByteString( aPortion, RTL_TEXTENCODING_UTF8 )).Append("' in Tag "), *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
- bCheckEmpty = FALSE;
+ bCheckEmpty = sal_False;
}
@@ -384,23 +384,23 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
if ( aState != TC_FINISHED )
{
rErrorList.AddError( 25, "Parsing error in Tag ", *this );
- bIsBroken = TRUE;
+ bIsBroken = sal_True;
}
}
-BOOL TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &aValue ) const
+sal_Bool TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &aValue ) const
{
if ( aTagName.EqualsAscii( "alt" ) && aName.Equals( "xml-lang" ) )
- return FALSE;
+ return sal_False;
if ( aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "visibility" ) && aValue.EqualsAscii("visible") )
- return FALSE;
+ return sal_False;
if ( aTagName.EqualsAscii( "image" ) && (aName.Equals( "width" ) || aName.Equals( "height" )) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
-BOOL TokenInfo::IsPropertyValueValid( const ByteString &aName, const String &aValue ) const
+sal_Bool TokenInfo::IsPropertyValueValid( const ByteString &aName, const String &aValue ) const
{
/* removed due to i56740
if ( aTagName.EqualsAscii( "switchinline" ) && aName.Equals( "select" ) )
@@ -416,26 +416,26 @@ BOOL TokenInfo::IsPropertyValueValid( const ByteString &aName, const String &aVa
}
// we don't know any better so we assume it to be OK
- return TRUE;
+ return sal_True;
}
-BOOL TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aValue ) const
+sal_Bool TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aValue ) const
{
if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "name" ) )
- return FALSE;
+ return sal_False;
if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ) )
{ // check for external reference
if ( aValue.Copy( 0, 5 ).EqualsIgnoreCaseAscii( "http:" )
|| aValue.Copy( 0, 6 ).EqualsIgnoreCaseAscii( "https:" )
|| aValue.Copy( 0, 4 ).EqualsIgnoreCaseAscii( "ftp:" ) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
- return TRUE;
+ return sal_True;
}
-BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const
+sal_Bool TokenInfo::IsPropertyFixable( const ByteString &aName ) const
{
// name everything that is allowed to be fixed automatically here
if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" ))
@@ -444,25 +444,25 @@ BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const
|| (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" ))
|| (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" ))
|| (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) ))
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
-BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags ) const
+sal_Bool TokenInfo::MatchesTranslation( TokenInfo& rInfo, sal_Bool bGenErrors, ParserMessageList &rErrorList, sal_Bool bFixTags ) const
{
// check if tags are equal
// check if all existing properties are in the translation as well and
// wether they have a matching content (the same in most cases)
if ( nId != rInfo.nId )
- return FALSE;
+ return sal_False;
if ( !aTagName.Equals( rInfo.aTagName ) )
- return FALSE;
+ return sal_False;
// If one of the tags has formating errors already it does make no sense to check here, so return right away
if ( bGenErrors && ( bIsBroken || rInfo.bIsBroken ) )
- return TRUE;
+ return sal_True;
StringHashMap::const_iterator iProp;
for( iProp = aProperties.begin() ; iProp != aProperties.end(); ++iProp )
@@ -486,7 +486,7 @@ BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMes
else
rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("': value different in Translation "), *this );
}
- else return FALSE;
+ else return sal_False;
}
}
}
@@ -497,7 +497,7 @@ BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMes
{
if ( bGenErrors )
rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("' missing in Translation "), *this );
- else return FALSE;
+ else return sal_False;
}
}
}
@@ -509,7 +509,7 @@ BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMes
{
if ( bGenErrors )
rErrorList.AddError( 25, ByteString("Extra Property '").Append(iProp->first).Append("' in Translation "), rInfo );
- else return FALSE;
+ else return sal_False;
}
}
}
@@ -517,7 +517,7 @@ BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMes
// if we reach here eather
// the tags match completely or
// the tags match but not the properties and we generated errors for that
- return TRUE;
+ return sal_True;
}
String TokenInfo::GetTagName() const
@@ -549,22 +549,22 @@ String TokenInfo::MakeTag() const
}
-void ParserMessageList::AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
+void ParserMessageList::AddError( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
{
maList.push_back( new ParserError( nErrorNr, aErrorText, rTag ) );
}
-void ParserMessageList::AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
+void ParserMessageList::AddWarning( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
{
maList.push_back( new ParserWarning( nErrorNr, aErrorText, rTag ) );
}
-BOOL ParserMessageList::HasErrors()
+sal_Bool ParserMessageList::HasErrors()
{
for ( size_t i = 0, n = maList.size(); i < n; ++i )
if ( maList[ i ]->IsError() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
void ParserMessageList::clear()
@@ -676,7 +676,7 @@ void SimpleParser::Parse( String PaSource )
TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
{
TokenInfo aResult;
- USHORT nTokenStartPos = 0;
+ sal_uInt16 nTokenStartPos = 0;
if ( aNextTag.nId != TAG_NOMORETAGS )
{
aResult = aNextTag;
@@ -693,9 +693,9 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
{
// check for paired \" \"
bool bEven = true;
- USHORT nQuotePos = 0;
- USHORT nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"" );
- USHORT nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes
+ sal_uInt16 nQuotePos = 0;
+ sal_uInt16 nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"" );
+ sal_uInt16 nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes
while ( nQuotedQuotesPos != STRING_NOTFOUND )
{
if ( nQuotedBackPos <= nQuotedQuotesPos )
@@ -714,7 +714,7 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
}
// check if we have an end-tag or a start-tag
- USHORT nNonBlankStartPos,nNonBlankEndPos;
+ sal_uInt16 nNonBlankStartPos,nNonBlankEndPos;
nNonBlankStartPos = 2;
while ( aLastToken.GetChar(nNonBlankStartPos) == ' ' )
nNonBlankStartPos++;
@@ -732,7 +732,7 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
}
else
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG &&
aLastToken != aKnownTags[i].GetName() )
i++;
@@ -746,11 +746,11 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
return aResult;
}
-String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTagStartPos )
+String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, sal_uInt16 &rTagStartPos )
{
- USHORT nStyle2StartPos = aSource.SearchAscii( "$[", nPos );
- USHORT nStyle3StartPos = aSource.SearchAscii( "\\<", nPos );
- USHORT nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes
+ sal_uInt16 nStyle2StartPos = aSource.SearchAscii( "$[", nPos );
+ sal_uInt16 nStyle3StartPos = aSource.SearchAscii( "\\<", nPos );
+ sal_uInt16 nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes
rTagStartPos = 0;
@@ -765,7 +765,7 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &
if ( nStyle2StartPos < nStyle3StartPos )
{ // test for $[ ... ] style tokens
- USHORT nEndPos = aSource.SearchAscii( "]", nStyle2StartPos);
+ sal_uInt16 nEndPos = aSource.SearchAscii( "]", nStyle2StartPos);
if ( nEndPos == STRING_NOTFOUND )
{ // Token is incomplete. Skip start and search for better ones
nPos = nStyle2StartPos +2;
@@ -777,8 +777,8 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &
}
else
{ // test for \< ... \> style tokens
- USHORT nEndPos = aSource.SearchAscii( "\\>", nStyle3StartPos);
- USHORT nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes
+ sal_uInt16 nEndPos = aSource.SearchAscii( "\\>", nStyle3StartPos);
+ sal_uInt16 nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes
while ( nQuotedBackPos <= nEndPos && nQuotedBackPos != STRING_NOTFOUND )
{
nEndPos = aSource.SearchAscii( "\\>", nQuotedBackPos +2);
@@ -805,7 +805,7 @@ String SimpleParser::GetLexem( TokenInfo const &aToken )
return aToken.aTokenString;
else
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG &&
aKnownTags[i].nTag != aToken.nId )
i++;
@@ -830,8 +830,8 @@ void TokenParser::Parse( const String &aCode, ParserMessageList* pList )
nPfCaseOptions = 0;
nAppCaseOptions = 0;
- bPfCaseActive = FALSE;
- bAppCaseActive = FALSE;
+ bPfCaseActive = sal_False;
+ bAppCaseActive = sal_False;
nActiveRefTypes = 0;
@@ -961,11 +961,11 @@ void TokenParser::Paragraph()
if ( ! bPfCaseActive )
{
//PfCases duerfen nicht verschachtelt sein:
- bPfCaseActive = TRUE;
+ bPfCaseActive = sal_True;
PfCase();
//So jetzt kann wieder ein PfCase kommen:
- bPfCaseActive = FALSE;
+ bPfCaseActive = sal_False;
Paragraph();
}
}
@@ -983,11 +983,11 @@ void TokenParser::Paragraph()
if ( !bAppCaseActive )
{
//AppCases duerfen nicht verschachtelt sein:
- bAppCaseActive = TRUE;
+ bAppCaseActive = sal_True;
AppCase();
//jetzt koennen wieder AppCases kommen:
- bAppCaseActive = FALSE;
+ bAppCaseActive = sal_False;
Paragraph();
}
}
@@ -1295,12 +1295,12 @@ void TokenParser::TagRef()
}
}
-BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken )
+sal_Bool TokenParser::match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken )
{
return match( aCurrentToken, TokenInfo( aExpectedToken, TOK_INVALIDPOS ) );
}
-BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpectedToken )
+sal_Bool TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpectedToken )
{
TokenInfo aExpectedToken( rExpectedToken );
if ( aCurrentToken.nId == aExpectedToken.nId )
@@ -1310,7 +1310,7 @@ BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpec
|| aCurrentToken.nId != TAG_COMMONEND )
{
aTag = aParser.GetNextToken( *pErrorList );
- return TRUE;
+ return sal_True;
}
}
@@ -1331,10 +1331,10 @@ BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpec
sTmp += " near ";
ParseError( 7, sTmp, aCurrentToken );
}
- return FALSE;
+ return sal_False;
}
-void TokenParser::ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo &rTag )
+void TokenParser::ParseError( sal_uInt16 nErrNr, ByteString aErrMsg, const TokenInfo &rTag )
{
pErrorList->AddError( nErrNr, aErrMsg, rTag);
@@ -1343,7 +1343,7 @@ void TokenParser::ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo
}
-ParserMessage::ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag )
+ParserMessage::ParserMessage( sal_uInt16 PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag )
: nErrorNr( PnErrorNr )
, aErrorText( PaErrorText )
, nTagBegin( 0 )
@@ -1363,15 +1363,15 @@ ParserMessage::ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const To
nTagLength = aLexem.Len();
}
-ParserError::ParserError( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag )
+ParserError::ParserError( sal_uInt16 ErrorNr, ByteString ErrorText, const TokenInfo &rTag )
: ParserMessage( ErrorNr, ErrorText, rTag )
{}
-ParserWarning::ParserWarning( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag )
+ParserWarning::ParserWarning( sal_uInt16 ErrorNr, ByteString ErrorText, const TokenInfo &rTag )
: ParserMessage( ErrorNr, ErrorText, rTag )
{}
-BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens )
+sal_Bool LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens )
{
TokenId aTokenId = aToken.nId;
TokenId aTokenGroup = TAG_GROUP( aTokenId );
@@ -1388,7 +1388,7 @@ BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens )
{
if ( TAG_GROUP_META == aTokenGroup )
aMetaTokens |= aTokenId;
- return TRUE;
+ return sal_True;
}
else if ( TAG_COMMONSTART == aTokenId
|| TAG_COMMONEND == aTokenId )
@@ -1400,10 +1400,10 @@ BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens )
|| aTagName.EqualsIgnoreCaseAscii( "item" )
|| aTagName.EqualsIgnoreCaseAscii( "br" ) );
}
- return FALSE;
+ return sal_False;
}
-void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags )
+void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, sal_Bool bFixTags )
{
size_t i=0,j=0;
// Clean old Warnings
@@ -1438,39 +1438,39 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa
if ( aReference[ i ].IsDone() )
continue;
- BOOL bTagFound = FALSE;
+ sal_Bool bTagFound = sal_False;
for ( j=0 ; j < aTestee.size() && !bTagFound ; j++ )
{
if ( aTestee[ j ].IsDone() )
continue;
- if ( aReference[ i ].MatchesTranslation( aTestee[ j ], FALSE, aCompareWarningList ) )
+ if ( aReference[ i ].MatchesTranslation( aTestee[ j ], sal_False, aCompareWarningList ) )
{
aReference[ i ].SetDone();
aTestee[ j ].SetDone();
- bTagFound = TRUE;
+ bTagFound = sal_True;
}
}
}
- BOOL bCanFix = TRUE;
+ sal_Bool bCanFix = sal_True;
if ( bFixTags )
{
// we fix only if its a really simple case
- USHORT nTagCount = 0;
+ sal_uInt16 nTagCount = 0;
for ( i=0 ; i < aReference.size() ; i++ )
if ( !aReference[ i ].IsDone() )
nTagCount++;
if ( nTagCount > 1 )
- bCanFix = FALSE;
+ bCanFix = sal_False;
nTagCount = 0;
for ( i=0 ; i < aTestee.size() ; i++ )
if ( !aTestee[ i ].IsDone() )
nTagCount++;
if ( nTagCount > 1 )
- bCanFix = FALSE;
+ bCanFix = sal_False;
}
// generate errors for tags that have differing attributes
@@ -1479,17 +1479,17 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa
if ( aReference[ i ].IsDone() )
continue;
- BOOL bTagFound = FALSE;
+ sal_Bool bTagFound = sal_False;
for ( j=0 ; j < aTestee.size() && !bTagFound ; j++ )
{
if ( aTestee[ j ].IsDone() )
continue;
- if ( aReference[ i ].MatchesTranslation( aTestee[ j ], TRUE, aCompareWarningList, bCanFix && bFixTags ) )
+ if ( aReference[ i ].MatchesTranslation( aTestee[ j ], sal_True, aCompareWarningList, bCanFix && bFixTags ) )
{
aReference[ i ].SetDone();
aTestee[ j ].SetDone();
- bTagFound = TRUE;
+ bTagFound = sal_True;
}
}
}
@@ -1511,10 +1511,10 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTa
}
for ( i=0 ; i < aReference.size() ; i++ )
- aReference[ i ].SetDone( FALSE );
+ aReference[ i ].SetDone( sal_False );
for ( i=0 ; i < aTestee.size() ; i++ )
- aTestee[ i ].SetDone( FALSE );
+ aTestee[ i ].SetDone( sal_False );
}
void LingTest::CheckReference( GSILine *aReference )
@@ -1522,7 +1522,7 @@ void LingTest::CheckReference( GSILine *aReference )
aReferenceParser.Parse( aReference->GetUText(), aReference->GetMessageList() );
}
-void LingTest::CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags )
+void LingTest::CheckTestee( GSILine *aTestee, sal_Bool bHasSourceLine, sal_Bool bFixTags )
{
aFixedTestee = aTestee->GetUText();
aTesteeParser.Parse( aFixedTestee, aTestee->GetMessageList() );
@@ -1533,14 +1533,14 @@ void LingTest::CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags
if ( bFixTags )
{
TokenList& aTesteeTokens = aTesteeParser.GetTokenList();
- BOOL bFixesDone = FALSE;
+ sal_Bool bFixesDone = sal_False;
// count backwards to allow replacing from right to left
int i;
for ( i = aTesteeTokens.size() ; i > 0 ; )
{
if ( aTesteeTokens[ --i ].HasBeenFixed() )
{
- bFixesDone = TRUE;
+ bFixesDone = sal_True;
aFixedTestee.Replace( aTesteeTokens[ i ].nPos, aTesteeTokens[ i ].aTokenString.Len(), aTesteeTokens[ i ].MakeTag() );
}
}
diff --git a/l10ntools/source/wtranode.cxx b/l10ntools/source/wtranode.cxx
index 1a4e48fd6231..5ddbe0f0cd46 100644
--- a/l10ntools/source/wtranode.cxx
+++ b/l10ntools/source/wtranode.cxx
@@ -80,11 +80,11 @@ WTT_Node::~WTT_Node()
{
// Delete the tree hanging below this node:
- bIsOnDeleting = TRUE; // Avoid double deleting of multiple used nodes.
+ bIsOnDeleting = sal_True; // Avoid double deleting of multiple used nodes.
for (int i = 0; i < C_NR_OF_BRANCHES; i++)
{
- if (aBranches[i] != 0 ? ! aBranches[i]->IsOnDeleting() : FALSE)
+ if (aBranches[i] != 0 ? ! aBranches[i]->IsOnDeleting() : sal_False)
{
delete aBranches[i];
}
diff --git a/l10ntools/source/wtratree.cxx b/l10ntools/source/wtratree.cxx
index 26838e2fb29d..7e3bf4fda724 100644
--- a/l10ntools/source/wtratree.cxx
+++ b/l10ntools/source/wtratree.cxx
@@ -256,10 +256,10 @@ WordTransTree::TransformNextToken()
// 9. TB~Eot continue
// bNext and Prev are true, if there are alphabetic letters:
- BOOL bNext = pInputPosition + 1 != pInputEnd
+ sal_Bool bNext = pInputPosition + 1 != pInputEnd
? CalculateBranch(pInputPosition[1]) >= BR_ALPHABASE
- : FALSE;
- BOOL bPrev = pCurParseNode->Value() >= BR_ALPHABASE;
+ : sal_False;
+ sal_Bool bPrev = pCurParseNode->Value() >= BR_ALPHABASE;
if ( bNext && (bPrev || pCurParseNode == dpParsingTreeTop) )
{ // case 1. and 7.
@@ -331,11 +331,11 @@ WordTransTree::Handle_TokenToKeep()
void
WordTransTree::Handle_TokenToTransform()
{
- BOOL bHaveHotkey = CalculateBranch(cCurHotkey) >= BR_ALPHABASE;
+ sal_Bool bHaveHotkey = CalculateBranch(cCurHotkey) >= BR_ALPHABASE;
const ByteString & rReplace = pCurParseNode->ReplaceString();
// Find position of hotkey in replace-string:
- USHORT nHotkeyPos = bHaveHotkey
+ sal_uInt16 nHotkeyPos = bHaveHotkey
? rReplace.Search(char(cCurHotkey))
: STRING_NOTFOUND;
if (nHotkeyPos == STRING_NOTFOUND && bHaveHotkey)
@@ -366,7 +366,7 @@ WordTransTree::Handle_TokenToTransform()
if (nHotkeyPos == STRING_NOTFOUND)
{
eCurResult = HOTKEY_LOST;
- bHaveHotkey = FALSE;
+ bHaveHotkey = sal_False;
}
} // endif (nHotkeyPos == STRING_NOT_FOUND && bHaveHotkey)
diff --git a/l10ntools/source/xgfconv.cxx b/l10ntools/source/xgfconv.cxx
index 9e1b46d75cbb..211ea3cad402 100644
--- a/l10ntools/source/xgfconv.cxx
+++ b/l10ntools/source/xgfconv.cxx
@@ -37,14 +37,14 @@ int _cdecl main( int argc, char *argv[] )
}
ByteString sLine;
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
while ( !aInput.IsEof()) {
aInput.ReadLine( sLine );
ByteString sLangId = sLine.GetToken( 0, '\t' );
ByteString sFile = sLine.GetToken( 1, '\t' );
ByteString sText = sLine.Copy( sLangId.Len() + sFile.Len() + 2 );
- USHORT nLangId = sLangId.ToInt32();
+ sal_uInt16 nLangId = sLangId.ToInt32();
CharSet aCharSet = Export::GetCharSet( nLangId );
if ( aCharSet != 0xFFFF && sText.Len()) {
sText = UTF8Converter::ConvertToUTF8( sText, aCharSet );
@@ -56,7 +56,7 @@ int _cdecl main( int argc, char *argv[] )
aOutput.WriteLine( sEmpty );
}
else
- bFirst = FALSE;
+ bFirst = sal_False;
aOutput.Write( sOutput.GetBuffer(), sOutput.Len());
}
}
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index bb921b4a7fc5..b6a539a5db1e 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -248,14 +248,14 @@ XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement )
if ( !pList )
return ( XMLElement * ) pChild;
- BOOL bMatch = FALSE;
+ sal_Bool bMatch = sal_False;
for ( size_t j = 0; j < pList->size() && bMatch; j++ ) {
XMLAttribute *pAttribute = (*pList)[ j ];
XMLAttribute *pCandidate =
(( XMLElement * ) pChild )->GetAttribute(
*pAttribute );
if ( !pCandidate || !pAttribute->IsEqual( *pCandidate ))
- bMatch = FALSE;
+ bMatch = sal_False;
}
if ( bMatch )
return ( XMLElement * ) pChild;
@@ -269,14 +269,14 @@ XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement )
//
/*****************************************************************************/
-USHORT XMLFile::GetNodeType()
+sal_uInt16 XMLFile::GetNodeType()
/*****************************************************************************/
{
return XML_NODE_TYPE_FILE;
}
/*****************************************************************************/
-BOOL XMLFile::Write( ByteString &aFilename )
+sal_Bool XMLFile::Write( ByteString &aFilename )
/*****************************************************************************/
{
@@ -331,7 +331,7 @@ void XMLFile::WriteString( ofstream &rStream, const String &sString )
}
-BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur )
+sal_Bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
{
XMLUtil& xmlutil = XMLUtil::Instance();
(void) xmlutil;
@@ -395,11 +395,11 @@ BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur )
break;
}
}
- return TRUE;
+ return sal_True;
}
-void XMLFile::Print( XMLNode *pCur, USHORT nLevel )
+void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel )
{
if ( !pCur )
@@ -477,13 +477,13 @@ XMLFile::XMLFile( const String &rFileName ) // the file name, empty if created f
XMLStrings ( NULL )
{
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("variable"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("paragraph"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("alt"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("caption"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("title"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
- nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("link"),RTL_TEXTENCODING_ASCII_US) , TRUE) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("variable"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("paragraph"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("alt"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("caption"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("title"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
+ nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("link"),RTL_TEXTENCODING_ASCII_US) , sal_True) );
}
/*****************************************************************************/
void XMLFile::Extract( XMLFile *pCur )
@@ -750,7 +750,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur )
}
/*****************************************************************************/
-USHORT XMLElement::GetNodeType()
+sal_uInt16 XMLElement::GetNodeType()
/*****************************************************************************/
{
return XML_NODE_TYPE_ELEMENT;
@@ -1012,7 +1012,7 @@ void XMLData::AddData( const String &rData) {
}
/*****************************************************************************/
-USHORT XMLData::GetNodeType()
+sal_uInt16 XMLData::GetNodeType()
/*****************************************************************************/
{
return XML_NODE_TYPE_DATA;
@@ -1023,7 +1023,7 @@ USHORT XMLData::GetNodeType()
//
/*****************************************************************************/
-USHORT XMLComment::GetNodeType()
+sal_uInt16 XMLComment::GetNodeType()
/*****************************************************************************/
{
return XML_NODE_TYPE_COMMENT;
@@ -1049,7 +1049,7 @@ XMLComment& XMLComment::operator=(const XMLComment& obj){
//
/*****************************************************************************/
-USHORT XMLDefault::GetNodeType()
+sal_uInt16 XMLDefault::GetNodeType()
/*****************************************************************************/
{
return XML_NODE_TYPE_DEFAULT;
@@ -1247,7 +1247,7 @@ XMLFile *SimpleXMLParser::Execute( SvMemoryStream *pStream )
pCurNode = pXMLFile;
pCurData = NULL;
- ULONG nPos = pStream->Tell();
+ sal_uLong nPos = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_END );
aErrorInformation.eCode = XML_ERROR_NONE;
@@ -1262,7 +1262,7 @@ XMLFile *SimpleXMLParser::Execute( SvMemoryStream *pStream )
aErrorInformation.sMessage = String::CreateFromAscii( "XML-File parsed successfully" );
if ( !XML_Parse(
- aParser, ( char * ) pStream->GetData() + nPos, pStream->Tell() - nPos, TRUE ))
+ aParser, ( char * ) pStream->GetData() + nPos, pStream->Tell() - nPos, sal_True ))
{
aErrorInformation.eCode = XML_GetErrorCode( aParser );
aErrorInformation.nLine = XML_GetErrorLineNumber( aParser );
@@ -1332,7 +1332,7 @@ void XMLUtil::QuotHTML( String &rString )
static const String QAMP(String::CreateFromAscii("&amp;"));
static const String SLASH(String::CreateFromAscii("\\"));
- for ( USHORT i = 0; i < rString.Len(); i++) {
+ for ( sal_uInt16 i = 0; i < rString.Len(); i++) {
if ( i < rString.Len()) {
switch ( rString.GetChar( i )) {
case '\\': if( i+1 <= rString.Len() ){
@@ -1443,7 +1443,7 @@ XMLUtil& XMLUtil::Instance(){
XMLUtil::~XMLUtil(){}
/*****************************************************************************/
/*****************************************************************************/
-ByteString XMLUtil::GetIsoLangByIndex( USHORT nIndex )
+ByteString XMLUtil::GetIsoLangByIndex( sal_uInt16 nIndex )
/*****************************************************************************/
{
if(nIndex > 0 && MAX_LANGUAGES >= nIndex )
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 513d0f088874..69cc32c52306 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -58,10 +58,10 @@ extern "C" { int YYWarning( char * ); }
#define STATE_ISOCODE99 0x000D
// set of global variables
-BOOL bEnableExport;
-BOOL bMergeMode;
-BOOL bErrorLog;
-BOOL bUTF8;
+sal_Bool bEnableExport;
+sal_Bool bMergeMode;
+sal_Bool bErrorLog;
+sal_Bool bUTF8;
ByteString sPrj;
ByteString sPrjRoot;
ByteString sInputFileName;
@@ -78,17 +78,17 @@ extern "C" {
extern char *GetOutputFile( int argc, char* argv[])
/*****************************************************************************/
{
- bEnableExport = FALSE;
- bMergeMode = FALSE;
- bErrorLog = TRUE;
- bUTF8 = TRUE;
+ bEnableExport = sal_False;
+ bMergeMode = sal_False;
+ bErrorLog = sal_True;
+ bUTF8 = sal_True;
sPrj = "";
sPrjRoot = "";
sInputFileName = "";
sActFileName = "";
Export::sLanguages = "";
- USHORT nState = STATE_NON;
- BOOL bInput = FALSE;
+ sal_uInt16 nState = STATE_NON;
+ sal_Bool bInput = sal_False;
// parse command line
for( int i = 1; i < argc; i++ ) {
@@ -109,15 +109,15 @@ extern char *GetOutputFile( int argc, char* argv[])
}
else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-E" ) {
nState = STATE_ERRORLOG;
- bErrorLog = FALSE;
+ bErrorLog = sal_False;
}
else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-UTF8" ) {
nState = STATE_UTF8;
- bUTF8 = TRUE;
+ bUTF8 = sal_True;
}
else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-NOUTF8" ) {
nState = STATE_UTF8;
- bUTF8 = FALSE;
+ bUTF8 = sal_False;
}
else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-L" ) {
nState = STATE_LANGUAGES;
@@ -132,7 +132,7 @@ extern char *GetOutputFile( int argc, char* argv[])
}
case STATE_INPUT: {
sInputFileName = argv[ i ];
- bInput = TRUE; // source file found
+ bInput = sal_True; // source file found
}
break;
case STATE_OUTPUT: {
@@ -149,7 +149,7 @@ extern char *GetOutputFile( int argc, char* argv[])
break;
case STATE_MERGESRC: {
sMergeSrc = ByteString( argv[ i ]);
- bMergeMode = TRUE; // activate merge mode, cause merge database found
+ bMergeMode = sal_True; // activate merge mode, cause merge database found
}
break;
case STATE_LANGUAGES: {
@@ -162,7 +162,7 @@ extern char *GetOutputFile( int argc, char* argv[])
if ( bInput ) {
// command line is valid
- bEnableExport = TRUE;
+ bEnableExport = sal_True;
char *pReturn = new char[ sOutputFile.Len() + 1 ];
strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked
return pReturn;
@@ -290,8 +290,8 @@ int GetError()
/*****************************************************************************/
XRMResParser::XRMResParser()
/*****************************************************************************/
- : bError( FALSE ),
- bText( FALSE )
+ : bError( sal_False ),
+ bText( sal_False )
{
aLanguages = Export::GetLanguages();
}
@@ -341,7 +341,7 @@ int XRMResParser::Execute( int nToken, char * pToken )
EndOfText( sCurrentOpenTag, sCurrentCloseTag );
ByteString sTmp = sGID;
sGID = "";
- for ( USHORT i = 0; i + 1 < sTmp.GetTokenCount( '.' ); i++ ) {
+ for ( sal_uInt16 i = 0; i + 1 < sTmp.GetTokenCount( '.' ); i++ ) {
if ( sGID.Len())
sGID += ".";
sGID += sTmp.GetToken( i, '.' );
@@ -357,7 +357,7 @@ int XRMResParser::Execute( int nToken, char * pToken )
//EndOfText( sCurrentOpenTag, sCurrentCloseTag );
sLID = sNewLID;
}
- bText = TRUE;
+ bText = sal_True;
sCurrentText = "";
sCurrentOpenTag = rToken;
Output( rToken );
@@ -372,7 +372,7 @@ int XRMResParser::Execute( int nToken, char * pToken )
WorkOnText( sCurrentOpenTag, sCurrentText );
Output( sCurrentText );
EndOfText( sCurrentOpenTag, sCurrentCloseTag );// <---
- bText = FALSE;
+ bText = sal_False;
rToken = ByteString("");
sCurrentText = ByteString("");
//printf("<-XRM_TEXT_END");
@@ -412,7 +412,7 @@ ByteString XRMResParser::GetAttribute( const ByteString &rToken, const ByteStrin
ByteString sSearch( " " );
sSearch += rAttribute;
sSearch += "=";
- USHORT nPos = sTmp.Search( sSearch );
+ sal_uInt16 nPos = sTmp.Search( sSearch );
if ( nPos != STRING_NOTFOUND ) {
sTmp = sTmp.Copy( nPos );
@@ -682,7 +682,7 @@ void XRMResMerge::EndOfText(
ByteString sContent;
if ( !sCur.EqualsIgnoreCaseAscii("en-US") &&
( pEntrys->GetText(
- sContent, STRING_TYP_TEXT, sCur, TRUE )) &&
+ sContent, STRING_TYP_TEXT, sCur, sal_True )) &&
( sContent != "-" ) && ( sContent.Len()))
{
ByteString sText( sContent );
@@ -700,7 +700,7 @@ void XRMResMerge::EndOfText(
sAdditionalLine += rCloseTag;
sAdditionalLine += "\n";
- for ( USHORT i = 0; i + 1 < GetGID().GetTokenCount( '.' ); i++ )
+ for ( sal_uInt16 i = 0; i + 1 < GetGID().GetTokenCount( '.' ); i++ )
sAdditionalLine += "\t";
Output( sAdditionalLine );
diff --git a/o3tl/qa/makefile.mk b/o3tl/qa/makefile.mk
index 3475aeeca9bb..0c6ecd88e56b 100644
--- a/o3tl/qa/makefile.mk
+++ b/o3tl/qa/makefile.mk
@@ -36,6 +36,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
.IF "$(L10N_framework)"==""
diff --git a/comphelper/source/compare/makefile.mk b/padmin/AllLangResTarget_spa.mk
index 156701d1d969..1fd6e42dad56 100644
--- a/comphelper/source/compare/makefile.mk
+++ b/padmin/AllLangResTarget_spa.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2009 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -14,34 +14,35 @@
#
# 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
+# 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
+# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..$/..
-PRJINC=..$/..$/inc
-PRJNAME=comphelper
-TARGET=compare
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,spa))
-ENABLE_EXCEPTIONS=TRUE
+$(eval $(call gb_AllLangResTarget_set_reslocation,spa,padmin))
-# --- Settings ----------------------------------
+$(eval $(call gb_AllLangResTarget_add_srs,spa,\
+ padmin/source \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_SrsTarget_SrsTarget,padmin/source))
-# --- Files -------------------------------------
+$(eval $(call gb_SrsTarget_set_include,padmin/source,\
+ $$(INCLUDE) \
+))
-SLOFILES=$(SLO)$/AnyCompareFactory.obj
+$(eval $(call gb_SrsTarget_add_files,padmin/source,\
+ padmin/source/padialog.src \
+ padmin/source/rtsetup.src \
+))
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/source/svhtml/makefile.mk b/padmin/Executable_spadmin.bin.mk
index 7a8552f2b672..ac6f19cccdc8 100644
--- a/svtools/source/svhtml/makefile.mk
+++ b/padmin/Executable_spadmin.bin.mk
@@ -14,38 +14,56 @@
#
# 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
+# 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
+# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..$/..
+$(eval $(call gb_Executable_Executable,spadmin.bin))
-PRJNAME=svtools
-TARGET=svhtml
+$(eval $(call gb_Executable_set_include,spadmin.bin,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc \
+ -I$(OUTDIR)/inc/offuh \
+))
-ENABLE_EXCEPTIONS=TRUE
+$(eval $(call gb_Executable_set_cxxflags,spadmin.bin,\
+ $$(CXXFLAGS) \
+))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_Executable_add_linked_static_libs,spadmin.bin,\
+ vclmain \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
+$(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\
+ spa \
+ svt \
+ vcl \
+ utl \
+ ucbhelper \
+ comphelper \
+ tl \
+ cppuhelper \
+ cppu \
+ sal \
+))
-# --- Files --------------------------------------------------------
+$(eval $(call gb_Executable_add_exception_objects,spadmin.bin,\
+ padmin/source/desktopcontext \
+ padmin/source/pamain \
+))
-SLOFILES=\
- $(SLO)$/htmlkywd.obj \
- $(SLO)$/htmlsupp.obj \
- $(SLO)$/htmlout.obj \
- $(SLO)$/parhtml.obj
-
-# ==========================================================================
-
-.INCLUDE : target.mk
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\
+ dl \
+ pthread \
+))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/tools/source/stream/makefile.mk b/padmin/Library_spa.mk
index ee548934c6c6..6827729d5d8d 100644
--- a/tools/source/stream/makefile.mk
+++ b/padmin/Library_spa.mk
@@ -14,45 +14,60 @@
#
# 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
+# 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
+# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..$/..
+$(eval $(call gb_Library_Library,spa))
-PRJNAME=tools
-TARGET=stream
+$(eval $(call gb_Library_set_include,spa,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_Library_set_defs,spa,\
+ $$(DEFS) \
+ -DSPA_DLLIMPLEMENTATION \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_Library_add_linked_libs,spa,\
+ svt \
+ vcl \
+ utl \
+ tl \
+ basegfx \
+ comphelper \
+ i18nisolang1 \
+ cppu \
+ sal \
+))
-# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/stream.obj \
- $(SLO)$/strmsys.obj \
- $(SLO)$/cachestr.obj \
- $(SLO)$/vcompat.obj
+$(eval $(call gb_Library_add_exception_objects,spa,\
+ padmin/source/adddlg \
+ padmin/source/cmddlg \
+ padmin/source/fontentry \
+ padmin/source/helper \
+ padmin/source/newppdlg \
+ padmin/source/padialog \
+ padmin/source/progress \
+ padmin/source/prtsetup \
+ padmin/source/titlectrl \
+))
-OBJFILES+= $(OBJ)$/stream.obj \
- $(OBJ)$/strmsys.obj \
- $(OBJ)$/cachestr.obj \
- $(OBJ)$/vcompat.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(SLO)$/strmsys.obj : \
- strmwnt.cxx \
- strmos2.cxx \
- strmunx.cxx
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_linked_libs,spa,\
+ dl \
+ m \
+ pthread \
+))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/padmin/Makefile b/padmin/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/padmin/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svl/util/svl.pmk b/padmin/Module_padmin.mk
index 854fb6d6d453..01fd4c99af19 100644
--- a/svl/util/svl.pmk
+++ b/padmin/Module_padmin.mk
@@ -25,7 +25,17 @@
#
#*************************************************************************
-# define SVL_DLLIMPLEMENTATION (see @ svldllapi.h)
-CDEFS += -DSVL_DLLIMPLEMENTATION
-VISIBILITY_HIDDEN=TRUE
+$(eval $(call gb_Module_Module,padmin))
+
+ifeq ($(GUIBASE),unx)
+
+$(eval $(call gb_Module_add_targets,padmin,\
+ Executable_spadmin.bin \
+ Library_spa \
+ AllLangResTarget_spa \
+ Package_inc \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/padmin/Package_inc.mk b/padmin/Package_inc.mk
new file mode 100644
index 000000000000..3a2a3a3177e1
--- /dev/null
+++ b/padmin/Package_inc.mk
@@ -0,0 +1,30 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,padmin_src,$(SRCDIR)/padmin/source))
+$(eval $(call gb_Package_add_file,padmin_src,bin/spadmin,spadmin.sh))
+
diff --git a/padmin/prj/build.lst b/padmin/prj/build.lst
index 9aaab83cf7de..0e505f92f2a2 100644
--- a/padmin/prj/build.lst
+++ b/padmin/prj/build.lst
@@ -1,3 +1,3 @@
pd padmin : vcl svtools NULL
pd padmin usr1 - all pd_mkout NULL
-pd padmin\source nmake - all pd_source NULL
+pd padmin\prj nmake - all pd_prj NULL
diff --git a/padmin/prj/d.lst b/padmin/prj/d.lst
index 3b86822c24e8..8b137891791f 100644
--- a/padmin/prj/d.lst
+++ b/padmin/prj/d.lst
@@ -1,8 +1 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
-..\%__SRC%\bin\*.bin %_DEST%\bin%_EXT%\*.bin
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
-..\%__SRC%\misc\spadmin.sh %_DEST%\bin%_EXT%\spadmin
diff --git a/comphelper/util/makefile.pmk b/padmin/prj/makefile.mk
index 9a2e65bb0be7..c73a3d944bbf 100644
--- a/comphelper/util/makefile.pmk
+++ b/padmin/prj/makefile.mk
@@ -25,11 +25,16 @@
#
#*************************************************************************
-.IF "$(GUI)" == "OS2"
-STL_OS2_BUILDING=1
-.ENDIF
+PRJ=..
+TARGET=prj
+
+.INCLUDE : settings.mk
-# define COMPHELPER_DLLIMPLEMENTATION (see @ comphelperdllapi.h)
-CDEFS += -DCOMPHELPER_DLLIMPLEMENTATION
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
-VISIBILITY_HIDDEN=TRUE
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET)
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index d5fff0703c62..31e06881519a 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -66,18 +66,18 @@ APChooseDevicePage::APChooseDevicePage( AddPrinterDialog* pParent ) :
m_aOverTxt( this, PaResId( RID_ADDP_CHDEV_TXT_OVER ) )
{
FreeResource();
- m_aPrinterBtn.Check( TRUE );
- m_aFaxBtn.Check( FALSE );
- m_aPDFBtn.Check( FALSE );
- m_aOldBtn.Check( FALSE );
+ m_aPrinterBtn.Check( sal_True );
+ m_aFaxBtn.Check( sal_False );
+ m_aPDFBtn.Check( sal_False );
+ m_aOldBtn.Check( sal_False );
if( ! AddPrinterDialog::getOldPrinterLocation().Len() )
- m_aOldBtn.Enable( FALSE );
+ m_aOldBtn.Enable( sal_False );
if( ! PrinterInfoManager::get().addOrRemovePossible() )
{
- m_aPrinterBtn.Check( FALSE );
- m_aFaxBtn.Check( TRUE );
- m_aPrinterBtn.Enable( FALSE );
- m_aOldBtn.Enable( FALSE );
+ m_aPrinterBtn.Check( sal_False );
+ m_aFaxBtn.Check( sal_True );
+ m_aPrinterBtn.Enable( sal_False );
+ m_aOldBtn.Enable( sal_False );
}
}
@@ -134,7 +134,7 @@ bool APChooseDriverPage::check()
void APChooseDriverPage::fill( PrinterInfo& rInfo )
{
- USHORT nPos = m_aDriverBox.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aDriverBox.GetSelectEntryPos();
String* pDriver = (String*)m_aDriverBox.GetEntryData( nPos );
rInfo.m_aDriverName = *pDriver;
#if OSL_DEBUG_LEVEL > 1
@@ -337,15 +337,15 @@ APNamePage::APNamePage( AddPrinterDialog* pParent, const String& rInitName, Devi
{
FreeResource();
if( eKind != DeviceKind::Printer )
- m_aDefaultBox.Show( FALSE );
+ m_aDefaultBox.Show( sal_False );
else
m_aNameEdt.SetText( rInitName );
if( eKind != DeviceKind::Fax )
- m_aFaxSwallowBox.Show( FALSE );
+ m_aFaxSwallowBox.Show( sal_False );
m_aNameEdt.SetText( AddPrinterDialog::uniquePrinterName( m_aNameEdt.GetText() ) );
- m_aDefaultBox.Check( FALSE );
- m_aFaxSwallowBox.Check( FALSE );
+ m_aDefaultBox.Check( sal_False );
+ m_aFaxSwallowBox.Check( sal_False );
}
APNamePage::~APNamePage()
@@ -379,16 +379,16 @@ APCommandPage::APCommandPage( AddPrinterDialog* pParent, DeviceKind::type eKind
::std::list< String > aCommands;
if( m_eKind == DeviceKind::Printer )
{
- m_aHelpBtn.Show( FALSE );
+ m_aHelpBtn.Show( sal_False );
Size aSize = m_aCommandTxt.GetSizePixel();
aSize.Width() = m_aCommandBox.GetSizePixel().Width();
m_aCommandTxt.SetSizePixel( aSize );
}
if( m_eKind != DeviceKind::Pdf )
{
- m_aPdfDirBtn.Show( FALSE );
- m_aPdfDirEdt.Show( FALSE );
- m_aPdfDirTxt.Show( FALSE );
+ m_aPdfDirBtn.Show( sal_False );
+ m_aPdfDirEdt.Show( sal_False );
+ m_aPdfDirTxt.Show( sal_False );
}
switch( m_eKind )
{
@@ -680,8 +680,8 @@ APFaxDriverPage::APFaxDriverPage( AddPrinterDialog* pParent )
{
FreeResource();
- m_aDefBtn.Check( TRUE );
- m_aSelectBtn.Check( FALSE );
+ m_aDefBtn.Check( sal_True );
+ m_aSelectBtn.Check( sal_False );
m_aSelectBtn.SetStyle( m_aSelectBtn.GetStyle() | WB_WORDBREAK );
}
@@ -713,9 +713,9 @@ APPdfDriverPage::APPdfDriverPage( AddPrinterDialog* pParent )
{
FreeResource();
- m_aDefBtn.Check( TRUE );
- m_aDistBtn.Check( FALSE );
- m_aSelectBtn.Check( FALSE );
+ m_aDefBtn.Check( sal_True );
+ m_aDistBtn.Check( sal_False );
+ m_aSelectBtn.Check( sal_False );
m_aSelectBtn.SetStyle( m_aSelectBtn.GetStyle() | WB_WORDBREAK );
}
@@ -763,9 +763,9 @@ AddPrinterDialog::AddPrinterDialog( Window* pParent )
{
FreeResource();
m_pCurrentPage = m_pChooseDevicePage = new APChooseDevicePage( this );
- m_pCurrentPage->Show( TRUE );
- m_aFinishPB.Enable( FALSE );
- m_aPrevPB.Enable( FALSE );
+ m_pCurrentPage->Show( sal_True );
+ m_aFinishPB.Enable( sal_False );
+ m_aPrevPB.Enable( sal_False );
m_aNextPB.SetClickHdl( LINK( this, AddPrinterDialog, ClickBtnHdl ) );
m_aPrevPB.SetClickHdl( LINK( this, AddPrinterDialog, ClickBtnHdl ) );
@@ -824,7 +824,7 @@ void AddPrinterDialog::DataChanged( const DataChangedEvent& rEv )
void AddPrinterDialog::advance()
{
- m_pCurrentPage->Show( FALSE );
+ m_pCurrentPage->Show( sal_False );
if( m_pCurrentPage == m_pChooseDevicePage )
{
if( m_pChooseDevicePage->isPrinter() )
@@ -832,30 +832,30 @@ void AddPrinterDialog::advance()
if( ! m_pChooseDriverPage )
m_pChooseDriverPage = new APChooseDriverPage( this );
m_pCurrentPage = m_pChooseDriverPage;
- m_aPrevPB.Enable( TRUE );
+ m_aPrevPB.Enable( sal_True );
}
else if( m_pChooseDevicePage->isOld() )
{
if( ! m_pOldPrinterPage )
m_pOldPrinterPage = new APOldPrinterPage( this );
m_pCurrentPage = m_pOldPrinterPage;
- m_aPrevPB.Enable( TRUE );
- m_aFinishPB.Enable( TRUE );
- m_aNextPB.Enable( FALSE );
+ m_aPrevPB.Enable( sal_True );
+ m_aFinishPB.Enable( sal_True );
+ m_aNextPB.Enable( sal_False );
}
else if( m_pChooseDevicePage->isFax() )
{
if( ! m_pFaxDriverPage )
m_pFaxDriverPage = new APFaxDriverPage( this );
m_pCurrentPage = m_pFaxDriverPage;
- m_aPrevPB.Enable( TRUE );
+ m_aPrevPB.Enable( sal_True );
}
else if( m_pChooseDevicePage->isPDF() )
{
if( ! m_pPdfDriverPage )
m_pPdfDriverPage = new APPdfDriverPage( this );
m_pCurrentPage = m_pPdfDriverPage;
- m_aPrevPB.Enable( TRUE );
+ m_aPrevPB.Enable( sal_True );
}
}
else if( m_pCurrentPage == m_pChooseDriverPage )
@@ -871,8 +871,8 @@ void AddPrinterDialog::advance()
else
m_pNamePage->setText( m_aPrinter.m_aPrinterName );
m_pCurrentPage = m_pNamePage;
- m_aFinishPB.Enable( TRUE );
- m_aNextPB.Enable( FALSE );
+ m_aFinishPB.Enable( sal_True );
+ m_aNextPB.Enable( sal_False );
}
else if( m_pCurrentPage == m_pFaxDriverPage )
{
@@ -900,8 +900,8 @@ void AddPrinterDialog::advance()
if( ! m_pFaxNamePage )
m_pFaxNamePage = new APNamePage( this, String(), DeviceKind::Fax );
m_pCurrentPage = m_pFaxNamePage;
- m_aNextPB.Enable( FALSE );
- m_aFinishPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_False );
+ m_aFinishPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pPdfDriverPage )
{
@@ -929,26 +929,26 @@ void AddPrinterDialog::advance()
if( ! m_pPdfNamePage )
m_pPdfNamePage = new APNamePage( this, String(), DeviceKind::Pdf );
m_pCurrentPage = m_pPdfNamePage;
- m_aNextPB.Enable( FALSE );
- m_aFinishPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_False );
+ m_aFinishPB.Enable( sal_True );
}
- m_pCurrentPage->Show( TRUE );
+ m_pCurrentPage->Show( sal_True );
m_aTitleImage.SetText( m_pCurrentPage->getTitle() );
}
void AddPrinterDialog::back()
{
- m_pCurrentPage->Show( FALSE );
+ m_pCurrentPage->Show( sal_False );
if( m_pCurrentPage == m_pChooseDriverPage )
{
m_pCurrentPage = m_pChooseDevicePage;
- m_aPrevPB.Enable( FALSE );
+ m_aPrevPB.Enable( sal_False );
}
else if( m_pCurrentPage == m_pNamePage )
{
m_pCurrentPage = m_pCommandPage;
- m_aNextPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pCommandPage )
{
@@ -957,13 +957,13 @@ void AddPrinterDialog::back()
else if( m_pCurrentPage == m_pOldPrinterPage )
{
m_pCurrentPage = m_pChooseDevicePage;
- m_aPrevPB.Enable( FALSE );
- m_aNextPB.Enable( TRUE );
+ m_aPrevPB.Enable( sal_False );
+ m_aNextPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pFaxDriverPage )
{
m_pCurrentPage = m_pChooseDevicePage;
- m_aPrevPB.Enable( FALSE );
+ m_aPrevPB.Enable( sal_False );
}
else if( m_pCurrentPage == m_pFaxSelectDriverPage )
{
@@ -972,17 +972,17 @@ void AddPrinterDialog::back()
else if( m_pCurrentPage == m_pFaxNamePage )
{
m_pCurrentPage = m_pFaxCommandPage;
- m_aNextPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pFaxCommandPage )
{
m_pCurrentPage = m_pFaxDriverPage->isDefault() ? (APTabPage*)m_pFaxDriverPage : (APTabPage*)m_pFaxSelectDriverPage;
- m_aNextPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pPdfDriverPage )
{
m_pCurrentPage = m_pChooseDevicePage;
- m_aPrevPB.Enable( FALSE );
+ m_aPrevPB.Enable( sal_False );
}
else if( m_pCurrentPage == m_pPdfSelectDriverPage )
{
@@ -991,14 +991,14 @@ void AddPrinterDialog::back()
else if( m_pCurrentPage == m_pPdfNamePage )
{
m_pCurrentPage = m_pPdfCommandPage;
- m_aNextPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_True );
}
else if( m_pCurrentPage == m_pPdfCommandPage )
{
m_pCurrentPage = m_pPdfDriverPage->isDefault() || m_pPdfDriverPage->isDist() ? (APTabPage*)m_pPdfDriverPage : (APTabPage*)m_pPdfSelectDriverPage;
- m_aNextPB.Enable( TRUE );
+ m_aNextPB.Enable( sal_True );
}
- m_pCurrentPage->Show( TRUE );
+ m_pCurrentPage->Show( sal_True );
m_aTitleImage.SetText( m_pCurrentPage->getTitle() );
}
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index e986b7d94f6f..be87417891f4 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -270,10 +270,10 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
m_aPdfDirectoryButton.SetClickHdl( LINK( this, RTSCommandPage, ClickBtnHdl ) );
m_aExternalCB.SetToggleHdl( LINK( this, RTSCommandPage, ClickBtnHdl ) );
- m_aPdfDirectoryButton.Show( FALSE );
- m_aPdfDirectoryEdit.Show( FALSE );
- m_aPdfDirectoryText.Show( FALSE );
- m_aFaxSwallowBox.Show( FALSE );
+ m_aPdfDirectoryButton.Show( sal_False );
+ m_aPdfDirectoryEdit.Show( sal_False );
+ m_aPdfDirectoryText.Show( sal_False );
+ m_aFaxSwallowBox.Show( sal_False );
m_aCommandsCB.SetText( m_pParent->m_aJobData.m_aCommand );
m_aQuickCB.SetText( m_pParent->m_aJobData.m_aQuickCommand );
@@ -287,9 +287,9 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
if( ! aToken.compareToAscii( "fax", 3 ) )
{
m_bWasFax = true;
- m_aFaxSwallowBox.Show( TRUE );
+ m_aFaxSwallowBox.Show( sal_True );
sal_Int32 nPos = 0;
- m_aFaxSwallowBox.Check( ! aToken.getToken( 1, '=', nPos ).compareToAscii( "swallow", 7 ) ? TRUE : FALSE );
+ m_aFaxSwallowBox.Check( ! aToken.getToken( 1, '=', nPos ).compareToAscii( "swallow", 7 ) ? sal_True : sal_False );
m_aConfigureBox.SelectEntryPos( m_nFaxEntry );
}
else if( ! aToken.compareToAscii( "pdf=", 4 ) )
@@ -297,9 +297,9 @@ RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) :
m_bWasPdf = true;
sal_Int32 nPos = 0;
m_aPdfDirectoryEdit.SetText( aToken.getToken( 1, '=', nPos ) );
- m_aPdfDirectoryEdit.Show( TRUE );
- m_aPdfDirectoryButton.Show( TRUE );
- m_aPdfDirectoryText.Show( TRUE );
+ m_aPdfDirectoryEdit.Show( sal_True );
+ m_aPdfDirectoryButton.Show( sal_True );
+ m_aPdfDirectoryText.Show( sal_True );
m_aConfigureBox.SelectEntryPos( m_nPdfEntry );
}
else if( ! aToken.compareToAscii( "external_dialog" ) )
@@ -421,17 +421,17 @@ IMPL_LINK( RTSCommandPage, SelectHdl, Control*, pBox )
{
if( pBox == &m_aConfigureBox )
{
- BOOL bEnable = m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry ? TRUE : FALSE;
+ sal_Bool bEnable = m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry ? sal_True : sal_False;
m_aPdfDirectoryButton.Show( bEnable );
m_aPdfDirectoryEdit.Show( bEnable );
m_aPdfDirectoryText.Show( bEnable );
- bEnable = m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry ? TRUE : FALSE;
+ bEnable = m_aConfigureBox.GetSelectEntryPos() == m_nFaxEntry ? sal_True : sal_False;
m_aFaxSwallowBox.Show( bEnable );
UpdateCommands();
}
else if( pBox == &m_aCommandsCB )
{
- m_aRemovePB.Enable( TRUE );
+ m_aRemovePB.Enable( sal_True );
}
return 0;
diff --git a/padmin/source/cmddlg.hxx b/padmin/source/cmddlg.hxx
index 8c47530dab39..4dd49e59e391 100644
--- a/padmin/source/cmddlg.hxx
+++ b/padmin/source/cmddlg.hxx
@@ -78,9 +78,9 @@ private:
FixedText m_aConfigureText;
ListBox m_aConfigureBox;
- USHORT m_nPrinterEntry;
- USHORT m_nFaxEntry;
- USHORT m_nPdfEntry;
+ sal_uInt16 m_nPrinterEntry;
+ sal_uInt16 m_nFaxEntry;
+ sal_uInt16 m_nPdfEntry;
FixedText m_aPdfDirectoryText;
PushButton m_aPdfDirectoryButton;
Edit m_aPdfDirectoryEdit;
diff --git a/padmin/source/fontentry.cxx b/padmin/source/fontentry.cxx
index a660550589e1..14376e45b2ca 100644
--- a/padmin/source/fontentry.cxx
+++ b/padmin/source/fontentry.cxx
@@ -63,7 +63,7 @@ FontNameDlg::FontNameDlg( Window *pParent ) :
{
FreeResource();
- m_aFontBox.EnableMultiSelection( TRUE );
+ m_aFontBox.EnableMultiSelection( sal_True );
m_aOKButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
m_aRenameButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
@@ -176,8 +176,8 @@ void FontNameDlg::init()
::std::list< fontID > aFonts;
m_rFontManager.getFontList( aFonts );
m_aFontBox.Clear();
- m_aRemoveButton.Enable( FALSE );
- m_aRenameButton.Enable( FALSE );
+ m_aRemoveButton.Enable( sal_False );
+ m_aRenameButton.Enable( sal_False );
::boost::unordered_map< OUString, int, OUStringHash > aFamilies;
::std::list< fontID >::iterator font_it;
@@ -220,7 +220,7 @@ void FontNameDlg::init()
}
else
aEntry = fillFontEntry( aInfo, String( ByteString( aFile ), osl_getThreadTextEncoding() ), aFamilies[ aInfo.m_aFamilyName ] > 1 );
- USHORT nEntry = m_aFontBox.InsertEntry( aEntry );
+ sal_uInt16 nEntry = m_aFontBox.InsertEntry( aEntry );
m_aFontBox.SetEntryData( nEntry, (void*)(sal_IntPtr)(*font_it) );
}
}
@@ -230,7 +230,7 @@ IMPL_LINK( FontNameDlg, SelectHdl, ListBox*, pBox )
{
if( pBox == &m_aFontBox )
{
- BOOL bEnable = m_aFontBox.GetSelectEntryCount() ? TRUE : FALSE;
+ sal_Bool bEnable = m_aFontBox.GetSelectEntryCount() ? sal_True : sal_False;
m_aRemoveButton.Enable( bEnable );
m_aRenameButton.Enable( bEnable );
}
@@ -362,7 +362,7 @@ FontImportDialog::FontImportDialog( Window* pParent ) :
{
FreeResource();
- m_aNewFontsBox.EnableMultiSelection( TRUE );
+ m_aNewFontsBox.EnableMultiSelection( sal_True );
m_aOKBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
m_aSelectAllBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
@@ -370,8 +370,8 @@ FontImportDialog::FontImportDialog( Window* pParent ) :
m_aFromDirEdt.SetModifyHdl( LINK( this, FontImportDialog, ModifyHdl ) );
m_aRefreshTimer.SetTimeoutHdl( LINK( this, FontImportDialog, RefreshTimeoutHdl ) );
m_aRefreshTimer.SetTimeout( 2000 );
- m_aLinkOnlyBox.Check( FALSE );
- m_aSubDirsBox.Check( TRUE );
+ m_aLinkOnlyBox.Check( sal_False );
+ m_aSubDirsBox.Check( sal_True );
m_aSubDirsBox.SetToggleHdl( LINK( this, FontImportDialog, ToggleHdl ) );
Config& rPadminRC( getPadminRC() );
@@ -515,7 +515,7 @@ void FontImportDialog::fillFontBox()
aEntry = FontNameDlg::fillFontEntry( it->second.front(), aFile, aFamilies[ it->second.front().m_aFamilyName ] > 1 );
else
aEntry = FontNameDlg::fillFontEntry( it->second, aFile );
- USHORT nPos = m_aNewFontsBox.InsertEntry( aEntry );
+ sal_uInt16 nPos = m_aNewFontsBox.InsertEntry( aEntry );
m_aNewFontsBox.SetEntryData( nPos, (void*)&(it->first) );
}
}
@@ -536,12 +536,12 @@ void FontImportDialog::copyFonts()
m_pProgress = new ProgressDialog( this );
m_pProgress->setRange( 0, aFiles.size() );
m_pProgress->startOperation( m_aImportOperation );
- m_pProgress->Show( TRUE );
+ m_pProgress->Show( sal_True );
m_pProgress->setValue( 0 );
m_pProgress->Invalidate();
m_pProgress->Sync();
nSuccess = m_rFontManager.importFonts( aFiles, m_aLinkOnlyBox.IsChecked() ? true : false, this );
- m_pProgress->Show( FALSE );
+ m_pProgress->Show( sal_False );
delete m_pProgress;
m_pProgress = NULL;
}
@@ -569,10 +569,10 @@ IMPL_LINK( FontImportDialog, ClickBtnHdl, Button*, pButton )
}
else if( pButton == &m_aSelectAllBtn )
{
- m_aNewFontsBox.SetUpdateMode( FALSE );
+ m_aNewFontsBox.SetUpdateMode( sal_False );
for( int i = 0; i < m_aNewFontsBox.GetEntryCount(); i++ )
- m_aNewFontsBox.SelectEntryPos( i, TRUE );
- m_aNewFontsBox.SetUpdateMode( TRUE );
+ m_aNewFontsBox.SelectEntryPos( i, sal_True );
+ m_aNewFontsBox.SetUpdateMode( sal_True );
}
return 0;
}
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 2a51c30bd0d3..41950f8b1864 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -215,13 +215,13 @@ QueryString::QueryString( Window* pParent, String& rQuery, String& rRet, const :
m_aComboBox.InsertEntry( m_rReturnValue );
for( ::std::list<String>::const_iterator it = rChoices.begin(); it != rChoices.end(); ++it )
m_aComboBox.InsertEntry( *it );
- m_aEdit.Show( FALSE );
+ m_aEdit.Show( sal_False );
m_bUseEdit = false;
}
else
{
m_aEdit.SetText( m_rReturnValue );
- m_aComboBox.Show( FALSE );
+ m_aComboBox.Show( sal_False );
m_bUseEdit = true;
}
SetText( Application::GetDisplayName() );
@@ -247,13 +247,13 @@ IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton )
* AreYouSure
*/
-BOOL padmin::AreYouSure( Window* pParent, int nRid )
+sal_Bool padmin::AreYouSure( Window* pParent, int nRid )
{
if( nRid == -1 )
nRid = RID_YOU_SURE;
QueryBox aQueryBox( pParent, WB_YES_NO | WB_DEF_NO,
String( PaResId( nRid ) ) );
- return aQueryBox.Execute() == RET_NO ? FALSE : TRUE;
+ return aQueryBox.Execute() == RET_NO ? sal_False : sal_True;
}
/*
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index 503de2dda960..14cee58531bd 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -41,6 +41,13 @@
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
+#if defined SPA_DLLIMPLEMENTATION
+#define SPA_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SPA_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+
class Config;
#define PSPRINT_PPDDIR "driver"
@@ -105,7 +112,7 @@ public:
~QueryString();
};
-BOOL AreYouSure( Window*, int nRid = -1 );
+sal_Bool AreYouSure( Window*, int nRid = -1 );
ResId PaResId( sal_uInt32 nId );
diff --git a/padmin/source/makefile.mk b/padmin/source/makefile.mk
deleted file mode 100644
index 8bcbd51ef832..000000000000
--- a/padmin/source/makefile.mk
+++ /dev/null
@@ -1,115 +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.
-#
-#*************************************************************************
-
-.IF "$(GUIBASE)"=="aqua"
-
-dummy:
- @echo "Nothing to build for GUIBASE aqua."
-
-.ELSE
-
-PRJ=..
-PRJNAME=padmin
-TARGET=padmin
-TARGETTYPE=GUI
-ENABLE_EXCEPTIONS=TRUE
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=padialog.src rtsetup.src
-
-RESLIB1NAME=spa
-RESLIB1IMAGES=$(PRJ)$/source
-RESLIB1SRSFILES= $(SRS)$/padmin.srs
-RESLIB1DEPN=\
- padialog.src \
- padialog.hrc \
- rtsetup.src \
- rtsetup.hrc
-
-.IF "$(GUI)" == "UNX"
-
-SLOFILES=\
- $(SLO)$/padialog.obj \
- $(SLO)$/cmddlg.obj \
- $(SLO)$/progress.obj \
- $(SLO)$/newppdlg.obj \
- $(SLO)$/prtsetup.obj \
- $(SLO)$/fontentry.obj \
- $(SLO)$/helper.obj \
- $(SLO)$/adddlg.obj \
- $(SLO)$/titlectrl.obj
-
-
-OBJFILES=\
- $(OBJ)/pamain.obj
-
-SHL1TARGET= spa$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(SVTOOLLIB) \
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-APP1TARGET=spadmin.bin
-APP1DEPN+=$(SHL1TARGETN)
-
-APP1OBJS=\
- $(OBJ)$/desktopcontext.obj \
- $(OBJ)/pamain.obj
-
-APP1STDLIBS= \
- -l$(SHL1TARGET) \
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-UNIXTEXT = $(MISC)$/spadmin.sh
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.ENDIF # GUIBASE==aqua
-
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index 68c99eee4b78..6382ae1359dd 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -155,7 +155,7 @@ void PPDImportDialog::Import()
continue;
}
- USHORT nPos = m_aDriverLB.InsertEntry( aPrinterName );
+ sal_uInt16 nPos = m_aDriverLB.InsertEntry( aPrinterName );
m_aDriverLB.SetEntryData( nPos, new String( aPath.PathToFileName() ) );
}
}
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index a5ce16bcc55e..67b84a41716d 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -72,12 +72,12 @@ using namespace com::sun::star::beans;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-PADialog* PADialog::Create( Window* pParent, BOOL bAdmin )
+PADialog* PADialog::Create( Window* pParent, sal_Bool bAdmin )
{
return new PADialog( pParent, bAdmin );
}
-PADialog::PADialog( Window* pParent, BOOL /*bAdmin*/ ) :
+PADialog::PADialog( Window* pParent, sal_Bool /*bAdmin*/ ) :
ModalDialog( pParent, PaResId( RID_PADIALOG ) ),
m_aDevicesLB( this, PaResId( RID_PA_LB_DEV ) ),
m_aConfPB( this, PaResId( RID_PA_BTN_CONF ) ),
@@ -125,7 +125,7 @@ void PADialog::Init()
UpdateDevice();
UpdateText();
- m_aRemPB.Enable( FALSE );
+ m_aRemPB.Enable( sal_False );
m_aDevicesLB.SetDoubleClickHdl( LINK( this, PADialog, DoubleClickHdl ) );
m_aDevicesLB.SetSelectHdl( LINK( this, PADialog, SelectHdl ) );
@@ -141,11 +141,25 @@ void PADialog::Init()
::psp::PrintFontManager& rFontManager( ::psp::PrintFontManager::get() );
if( ! rFontManager.checkImportPossible() )
- m_aFontsPB.Enable( FALSE );
+ m_aFontsPB.Enable( sal_False );
if( rFontManager.hasFontconfig() )
{
- m_aFontsPB.Enable( FALSE );
- m_aFontsPB.Show( FALSE );
+ m_aFontsPB.Enable( sal_False );
+ m_aFontsPB.Show( sal_False );
+ }
+
+ // at this point no actual changes will be written
+ // but the write will have checked whether any writeable config exists
+ if( ! m_rPIManager.writePrinterConfig() )
+ {
+ m_aAddPB.Enable( sal_False );
+ m_aRemPB.Enable( sal_False );
+ m_aConfPB.Enable( sal_False );
+ m_aRenamePB.Enable( sal_False );
+ m_aStdPB.Enable( sal_False );
+ m_aCUPSCB.Enable( sal_False );
+ ErrorBox aBox( GetParent(), WB_OK | WB_DEF_OK, String( PaResId( RID_ERR_NOWRITE ) ) );
+ aBox.Execute();
}
}
@@ -241,9 +255,9 @@ IMPL_LINK( PADialog, SelectHdl, ListBox*, pListBox )
String sSelect = getSelectedDevice();
String sDefPrt = m_rPIManager.getDefaultPrinter();
if( sDefPrt == sSelect || ! m_rPIManager.removePrinter( sSelect, true ) )
- m_aRemPB.Enable( FALSE );
+ m_aRemPB.Enable( sal_False );
else
- m_aRemPB.Enable( TRUE );
+ m_aRemPB.Enable( sal_True );
UpdateText();
}
return 0;
@@ -258,7 +272,7 @@ void PADialog::UpdateDefPrt()
if( m_aRemPB.HasFocus() )
m_aDevicesLB.GetFocus();
- m_aRemPB.Enable( FALSE );
+ m_aRemPB.Enable( sal_False );
}
void PADialog::UpdateText()
@@ -312,7 +326,7 @@ static Point project( const Point& rPoint )
static Color approachColor( const Color& rFrom, const Color& rTo )
{
Color aColor;
- UINT8 nDiff;
+ sal_uInt8 nDiff;
// approach red
if( rFrom.GetRed() < rTo.GetRed() )
{
@@ -437,7 +451,7 @@ void SpaPrinterController::printPage( int ) const
static const struct
{
const char* const pDirect;
- USHORT nResId;
+ sal_uInt16 nResId;
} aResIds[] =
{
{ NULL, RID_TXT_TESTPAGE_NAME },
@@ -634,7 +648,7 @@ void PADialog::RemDevice()
{
if( m_aDevicesLB.GetEntry( i ).CompareTo( aDefPrinter, aDefPrinter.Len() ) == COMPARE_EQUAL )
{
- m_aDevicesLB.SelectEntryPos( i, TRUE );
+ m_aDevicesLB.SelectEntryPos( i, sal_True );
UpdateText();
break;
}
@@ -643,7 +657,7 @@ void PADialog::RemDevice()
m_aDevicesLB.GetFocus();
if( m_aDevicesLB.GetEntryCount() < 2 )
- m_aRemPB.Enable( FALSE );
+ m_aRemPB.Enable( sal_False );
}
void PADialog::ConfigureDevice()
diff --git a/padmin/source/padialog.hxx b/padmin/source/padialog.hxx
index 915158bc6eca..42f034b781b5 100644
--- a/padmin/source/padialog.hxx
+++ b/padmin/source/padialog.hxx
@@ -49,7 +49,7 @@ class Printer;
namespace padmin {
- class PADialog : public ModalDialog
+ class SPA_DLLPUBLIC PADialog : public ModalDialog
{
private:
DelListBox m_aDevicesLB;
@@ -91,7 +91,7 @@ namespace padmin {
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( DelPressedHdl, ListBox* );
- PADialog( Window*, BOOL );
+ PADialog( Window*, sal_Bool );
void Init();
void UpdateDefPrt();
@@ -111,7 +111,7 @@ namespace padmin {
public:
~PADialog();
- static PADialog* Create( Window*, BOOL );
+ static PADialog* Create( Window*, sal_Bool );
};
} // namespace
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 620411d72ddf..b3b46f5131f7 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -29,6 +29,7 @@
ModalDialog RID_FONTIMPORT_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTIMPORT_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 230 , 185 );
@@ -37,6 +38,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ListBox RID_FIMP_BOX_NEWFONTS
{
+ HelpID = "padmin:ListBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_NEWFONTS";
Border = TRUE;
Sort=TRUE;
AutoHScroll = TRUE;
@@ -58,18 +60,21 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
Edit RID_FIMP_EDT_FROM
{
+ HelpID = "padmin:Edit:RID_FONTIMPORT_DIALOG:RID_FIMP_EDT_FROM";
Border = TRUE;
Pos = MAP_APPFONT( 10, 97 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_FIMP_BTN_FROM
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_FROM";
Pos = MAP_APPFONT( 145, 97 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
};
CheckBox RID_FIMP_BOX_SUBDIRS
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_SUBDIRS";
Pos = MAP_APPFONT( 10, 115 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Sea~rch Subdirectories";
@@ -83,6 +88,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
CheckBox RID_FIMP_BOX_LINKONLY
{
+ HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_LINKONLY";
Pos = MAP_APPFONT( 10, 140 );
Size = MAP_APPFONT( 145, 10 );
Text [ en-US ] = "Create ~soft links only";
@@ -100,6 +106,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
};
PushButton RID_FIMP_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_SELECTALL";
Pos = MAP_APPFONT( 175, 44 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -146,6 +153,7 @@ ModalDialog RID_FONTIMPORT_DIALOG
ModalDialog RID_PADIALOG
{
+ HelpID = "padmin:ModalDialog:RID_PADIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 198 ) ;
@@ -160,6 +168,7 @@ ModalDialog RID_PADIALOG
};
CheckBox RID_PA_CB_CUPSUSAGE
{
+ HelpID = "padmin:CheckBox:RID_PADIALOG:RID_PA_CB_CUPSUSAGE";
Pos = MAP_APPFONT( 12, 158 );
Size = MAP_APPFONT( 168, 8 );
Text [ en-US ] = "Disable CUPS Support";
@@ -186,6 +195,7 @@ ModalDialog RID_PADIALOG
};
ListBox RID_PA_LB_DEV
{
+ HelpID = "padmin:ListBox:RID_PADIALOG:RID_PA_LB_DEV";
Pos = MAP_APPFONT( 12, 15 );
Size = MAP_APPFONT( 168, 80 );
Border = TRUE;
@@ -237,30 +247,35 @@ ModalDialog RID_PADIALOG
};
PushButton RID_PA_BTN_CONF
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_CONF";
Pos = MAP_APPFONT( 190, 15 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Properties...";
};
PushButton RID_PA_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_RENAME";
Pos = MAP_APPFONT( 190, 32 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "R~ename...";
};
PushButton RID_PA_BTN_STD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_STD";
Pos = MAP_APPFONT( 190, 49 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "~Default";
};
PushButton RID_PA_BTN_DEL
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_DEL";
Pos = MAP_APPFONT( 190, 66 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Remo~ve...";
};
PushButton RID_PA_TESTPAGE
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_TESTPAGE";
Pos = MAP_APPFONT( 190, 83 );
Size = MAP_APPFONT( 60, 12 );
Text [ en-US ] = "Test ~Page";
@@ -268,12 +283,14 @@ ModalDialog RID_PADIALOG
PushButton RID_PA_BTN_FONTS
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_FONTS";
Pos = MAP_APPFONT( 80, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "Fon~ts...";
};
PushButton RID_PA_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_ADD";
Pos = MAP_APPFONT( 5, 181 );
Size = MAP_APPFONT( 70, 12 );
Text [ en-US ] = "New Printer...";
@@ -292,6 +309,7 @@ ModalDialog RID_PADIALOG
ModalDialog RID_STRINGQUERYDLG
{
+ HelpID = "padmin:ModalDialog:RID_STRINGQUERYDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -306,12 +324,14 @@ ModalDialog RID_STRINGQUERYDLG
};
Edit RID_STRQRY_EDT_NEWNAME
{
+ HelpID = "padmin:Edit:RID_STRINGQUERYDLG:RID_STRQRY_EDT_NEWNAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 23 ) ;
Size = MAP_APPFONT ( 130 , 12 ) ;
};
ComboBox RID_STRQRY_BOX_NEWNAME
{
+ HelpID = "padmin:ComboBox:RID_STRINGQUERYDLG:RID_STRQRY_BOX_NEWNAME";
Border = TRUE ;
DropDown = TRUE;
Pos = MAP_APPFONT ( 6 , 23 ) ;
@@ -340,6 +360,11 @@ String RID_PA_TXT_TESTPAGE_PRINTED
Text [ en-US ] = "The test page was printed succesfully. Please check the result.";
};
+String RID_ERR_NOWRITE
+{
+ Text [en-US] = "No printers can be installed, because the file system is read-only.\nPlease contact your system administrator.";
+};
+
String RID_QRY_PRTNAME
{
Text [ en-US ] = "~New printer name";
@@ -378,6 +403,7 @@ String RID_TXT_TESTPAGE_TIME
ModalDialog RID_FONTNAMEDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_FONTNAMEDIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 255 , 110 ) ;
@@ -392,24 +418,28 @@ ModalDialog RID_FONTNAMEDIALOG
};
PushButton RID_FNTNM_BTN_RENAME
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_RENAME";
Pos = MAP_APPFONT( 196, 31 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "Re~name...";
};
PushButton RID_FNTNM_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_REMOVE";
Pos = MAP_APPFONT ( 196 , 48 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Remove...";
};
PushButton RID_FNTNM_BTN_IMPORT
{
+ HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_IMPORT";
Pos = MAP_APPFONT ( 196 , 65 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
Text [ en-US ] = "~Add...";
};
ListBox RID_FNTNM_LB_FONTS
{
+ HelpID = "padmin:ListBox:RID_FONTNAMEDIALOG:RID_FNTNM_LB_FONTS";
Border = TRUE ;
Sort = TRUE ;
AutoHScroll = TRUE;
@@ -455,27 +485,27 @@ String RID_YOU_SURE
Bitmap RID_BUTTERFLY
{
- File = "butter.png" ;
+ File = "source/butter.png" ;
};
Bitmap RID_BMP_SMALL_PRINTER
{
- File = "print.png";
+ File = "source/print.png";
};
Bitmap RID_BMP_SMALL_FAX
{
- File = "fax.png";
+ File = "source/fax.png";
};
Bitmap RID_BMP_SMALL_PDF
{
- File = "pdf.png";
+ File = "source/pdf.png";
};
Bitmap RID_BMP_PRINTER
{
- File = "printer_large.png";
+ File = "source/printer_large.png";
};
String RID_AFMERROR_OK
@@ -525,6 +555,7 @@ String RID_AFMERROR_BOX_TXT
ModelessDialog RID_PROGRESS_DLG
{
+ HelpID = "padmin:ModelessDialog:RID_PROGRESS_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 10 , 10 ) ;
@@ -570,6 +601,7 @@ String RID_OPERATION_CONVERTMETRIC
ModalDialog RID_PPDIMPORT_DLG
{
+ HelpID = "padmin:ModalDialog:RID_PPDIMPORT_DLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 265 , 225 ) ;
@@ -590,6 +622,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
ComboBox RID_PPDIMP_LB_PATH
{
+ HelpID = "padmin:ComboBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_PATH";
Dropdown = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -599,6 +632,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
PushButton RID_PPDIMP_BTN_SEARCH
{
+ HelpID = "padmin:PushButton:RID_PPDIMPORT_DLG:RID_PPDIMP_BTN_SEARCH";
Pos = MAP_APPFONT( 145, 15 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Browse...";
@@ -612,6 +646,7 @@ ModalDialog RID_PPDIMPORT_DLG
};
MultiListBox RID_PPDIMP_LB_DRIVER
{
+ HelpID = "padmin:MultiListBox:RID_PPDIMPORT_DLG:RID_PPDIMP_LB_DRIVER";
Border = TRUE;
Sort = TRUE;
SimpleMode = TRUE;
@@ -707,6 +742,7 @@ String RID_TXT_PRINTERADDFAILED
ModalDialog RID_ADD_PRINTER_DIALOG
{
+ HelpID = "padmin:ModalDialog:RID_ADD_PRINTER_DIALOG";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 240 , 172 ) ;
@@ -736,12 +772,14 @@ ModalDialog RID_ADD_PRINTER_DIALOG
};
PushButton RID_ADDP_BTN_NEXT
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_NEXT";
Pos = MAP_APPFONT( 130, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Next >>";
};
PushButton RID_ADDP_BTN_PREV
{
+ HelpID = "padmin:PushButton:RID_ADD_PRINTER_DIALOG:RID_ADDP_BTN_PREV";
Pos = MAP_APPFONT( 75, 155 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "<< ~Back";
@@ -751,6 +789,7 @@ ModalDialog RID_ADD_PRINTER_DIALOG
TabPage RID_ADDP_PAGE_CHOOSEDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -766,6 +805,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
ListBox RID_ADDP_CHDRV_BOX_DRIVER
{
+ HelpID = "padmin:ListBox:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BOX_DRIVER";
Pos = MAP_APPFONT( 5, 15 );
Size = MAP_APPFONT( 175, 100 );
Border = TRUE;
@@ -773,12 +813,14 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
};
PushButton RID_ADDP_CHDRV_BTN_ADD
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_ADD";
Pos = MAP_APPFONT( 185, 15 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Import...";
};
PushButton RID_ADDP_CHDRV_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_CHOOSEDRIVER:RID_ADDP_CHDRV_BTN_REMOVE";
Pos = MAP_APPFONT( 185, 32 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Delete";
@@ -791,6 +833,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDRIVER
TabPage RID_ADDP_PAGE_CHOOSEDEV
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_CHOOSEDEV";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -806,24 +849,28 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
};
RadioButton RID_ADDP_CHDEV_BTN_PRINTER
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PRINTER";
Pos = MAP_APPFONT ( 40, 40 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Add a ~printer";
};
RadioButton RID_ADDP_CHDEV_BTN_FAX
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_FAX";
Pos = MAP_APPFONT ( 40, 50 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a fa~x device";
};
RadioButton RID_ADDP_CHDEV_BTN_PDF
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_PDF";
Pos = MAP_APPFONT ( 40, 60 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "Connect a P~DF converter";
};
RadioButton RID_ADDP_CHDEV_BTN_OLD
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_CHOOSEDEV:RID_ADDP_CHDEV_BTN_OLD";
Pos = MAP_APPFONT ( 40, 70 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Import printers from a StarOffice installation";
@@ -832,6 +879,7 @@ TabPage RID_ADDP_PAGE_CHOOSEDEV
TabPage RID_ADDP_PAGE_NAME
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_NAME";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -859,12 +907,14 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_NAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_NAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
};
Edit RID_ADDP_NAME_EDT_FAXNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_FAXNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -872,6 +922,7 @@ TabPage RID_ADDP_PAGE_NAME
};
Edit RID_ADDP_NAME_EDT_PDFNAME
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_EDT_PDFNAME";
Pos = MAP_APPFONT( 40, 35 );
Size = MAP_APPFONT( 160, 12 );
Border = TRUE;
@@ -879,12 +930,14 @@ TabPage RID_ADDP_PAGE_NAME
};
CheckBox RID_ADDP_NAME_BOX_DEFAULT
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_DEFAULT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "~Use as default printer";
};
CheckBox RID_ADDP_NAME_BOX_FAXSWALLOW
{
+ HelpID = "padmin:CheckBox:RID_ADDP_PAGE_NAME:RID_ADDP_NAME_BOX_FAXSWALLOW";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160, 12 );
Text [ en-US ] = "Remo~ve fax number from output";
@@ -893,6 +946,7 @@ TabPage RID_ADDP_PAGE_NAME
TabPage RID_ADDP_PAGE_COMMAND
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_COMMAND";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -909,12 +963,14 @@ TabPage RID_ADDP_PAGE_COMMAND
};
ComboBox RID_ADDP_CMD_BOX_COMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_COMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 85 );
Border = TRUE;
};
ComboBox RID_ADDP_CMD_BOX_PDFCOMMAND
{
+ HelpID = "padmin:ComboBox:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BOX_PDFCOMMAND";
Pos = MAP_APPFONT( 10, 30);
Size = MAP_APPFONT( 220, 60 );
Border = TRUE;
@@ -927,18 +983,21 @@ TabPage RID_ADDP_PAGE_COMMAND
};
Edit RID_ADDP_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 10, 104 );
Size = MAP_APPFONT( 190, 12 );
};
PushButton RID_ADDP_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 205, 104 );
Size = MAP_APPFONT( 25, 12 );
Text = "~...";
};
PushButton RID_ADDP_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_COMMAND:RID_ADDP_CMD_BTN_HELP";
Pos = MAP_APPFONT( 180, 2 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
@@ -955,6 +1014,7 @@ TabPage RID_ADDP_PAGE_COMMAND
TabPage RID_ADDP_PAGE_OLDPRINTERS
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_OLDPRINTERS";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -971,12 +1031,14 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
};
MultiListBox RID_ADDP_OLD_BOX_PRINTERS
{
+ HelpID = "padmin:MultiListBox:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BOX_PRINTERS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 165, 80 );
Border = TRUE;
};
PushButton RID_ADDP_OLD_BTN_SELECTALL
{
+ HelpID = "padmin:PushButton:RID_ADDP_PAGE_OLDPRINTERS:RID_ADDP_OLD_BTN_SELECTALL";
Pos = MAP_APPFONT( 180, 35 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Select All";
@@ -985,6 +1047,7 @@ TabPage RID_ADDP_PAGE_OLDPRINTERS
TabPage RID_ADDP_PAGE_FAXDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_FAXDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1001,12 +1064,14 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
};
RadioButton RID_ADDP_FAXDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40,40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_FAXDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_FAXDRIVER:RID_ADDP_FAXDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 50 );
Size = MAP_APPFONT( 160,24 );
Text [ en-US ] = "A speci~fic driver, to adapt the format to another printer";
@@ -1015,6 +1080,7 @@ TabPage RID_ADDP_PAGE_FAXDRIVER
TabPage RID_ADDP_PAGE_PDFDRIVER
{
+ HelpID = "padmin:TabPage:RID_ADDP_PAGE_PDFDRIVER";
Hide = TRUE;
Pos = MAP_APPFONT( 0, 30 );
Size = MAP_APPFONT( 240, 120 );
@@ -1031,18 +1097,21 @@ TabPage RID_ADDP_PAGE_PDFDRIVER
};
RadioButton RID_ADDP_PDFDRV_BTN_DEFAULT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DEFAULT";
Pos = MAP_APPFONT( 40, 40 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "T~he default driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_DIST
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_DIST";
Pos = MAP_APPFONT( 40,50 );
Size = MAP_APPFONT( 160, 10 );
Text [ en-US ] = "The Adobe D~istiller(tm) driver";
};
RadioButton RID_ADDP_PDFDRV_BTN_SELECT
{
+ HelpID = "padmin:RadioButton:RID_ADDP_PAGE_PDFDRIVER:RID_ADDP_PDFDRV_BTN_SELECT";
Pos = MAP_APPFONT( 40, 60 );
Size = MAP_APPFONT( 160, 24 );
Text [ en-US ] = "A spec~ific driver, to adapt the format to another printer";
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx
index 0ea2ae14dcbd..7e47e4264d8c 100644
--- a/padmin/source/pamain.cxx
+++ b/padmin/source/pamain.cxx
@@ -61,7 +61,7 @@ class MyApp : public Application
{
public:
int Main();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
static void ReadStringHook( String& );
};
@@ -84,7 +84,7 @@ void MyApp::ReadStringHook( String& rStr )
// -----------------------------------------------------------------------
-USHORT MyApp::Exception( USHORT nError )
+sal_uInt16 MyApp::Exception( sal_uInt16 nError )
{
switch( nError & EXC_MAJORTYPE )
{
@@ -151,7 +151,7 @@ int MyApp::Main()
if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
{
- BOOL bQuitApp;
+ sal_Bool bQuitApp;
if( !InitAccessBridge( true, bQuitApp ) )
if( bQuitApp )
return EXIT_FAILURE;
@@ -162,7 +162,7 @@ int MyApp::Main()
ResMgr::SetReadStringHook( MyApp::ReadStringHook );
- pPADialog = PADialog::Create( NULL , FALSE );
+ pPADialog = PADialog::Create( NULL , sal_False );
Application::SetDisplayName( pPADialog->GetText() );
pPADialog->SetIcon(501);
pPADialog->Execute();
diff --git a/padmin/source/progress.cxx b/padmin/source/progress.cxx
index 8d191d816eaf..86055578ace3 100644
--- a/padmin/source/progress.cxx
+++ b/padmin/source/progress.cxx
@@ -39,7 +39,7 @@
using namespace padmin;
ProgressDialog::ProgressDialog( Window* pParent,
- BOOL bCancelable,
+ sal_Bool bCancelable,
int nMin, int nMax ) :
ModelessDialog( pParent, PaResId( RID_PROGRESS_DLG ) ),
maOperation( this, PaResId( RID_PROGRESS_OPERATION_TXT ) ),
@@ -49,7 +49,7 @@ ProgressDialog::ProgressDialog( Window* pParent,
maProgressBar( this, PaResId( RID_PROGRESS_STATUSBAR ) ),
mnMax( nMax ),
mnMin( nMin ),
- mbCanceled( FALSE )
+ mbCanceled( sal_False )
{
maFilename.SetStyle( maFilename.GetStyle() | WB_PATHELLIPSIS );
if( ! bCancelable )
@@ -73,9 +73,9 @@ void ProgressDialog::startOperation( const String& rOperation )
{
maOperation.SetText( rOperation );
maProgressBar.SetValue( 0 );
- mbCanceled = FALSE;
+ mbCanceled = sal_False;
if( ! IsVisible() )
- Show( TRUE );
+ Show( sal_True );
}
void ProgressDialog::setValue( int nValue )
@@ -95,7 +95,7 @@ IMPL_LINK( ProgressDialog, ClickBtnHdl, Button*, pButton )
{
if( pButton == &maCancelButton )
{
- mbCanceled = TRUE;
+ mbCanceled = sal_True;
}
return 0;
}
diff --git a/padmin/source/progress.hxx b/padmin/source/progress.hxx
index 50449ac6d520..06394a5a1c45 100644
--- a/padmin/source/progress.hxx
+++ b/padmin/source/progress.hxx
@@ -46,10 +46,10 @@ namespace padmin {
ProgressBar maProgressBar;
int mnMax, mnMin;
- BOOL mbCanceled;
+ sal_Bool mbCanceled;
public:
- ProgressDialog( Window*, BOOL bCancelable = TRUE, int nMin = 0, int nMax = 100 );
+ ProgressDialog( Window*, sal_Bool bCancelable = sal_True, int nMin = 0, int nMax = 100 );
~ProgressDialog();
DECL_LINK( ClickBtnHdl, Button* );
@@ -59,7 +59,7 @@ namespace padmin {
void startOperation( const String& );
void setFilename( const String& );
- BOOL isCanceled() { return mbCanceled; }
+ sal_Bool isCanceled() { return mbCanceled; }
};
} // namespace
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index ec9718880032..201f0875adc2 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -51,7 +51,7 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, con
return;
const PPDValue* pValue = NULL;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
String aOptionText;
for( int i = 0; i < pKey->countValues(); i++ )
@@ -154,7 +154,7 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl )
if( pTabCtrl != &m_aTabControl )
return 0;
- USHORT nId = m_aTabControl.GetCurPageId();
+ sal_uInt16 nId = m_aTabControl.GetCurPageId();
if ( ! m_aTabControl.GetTabPage( nId ) )
{
@@ -202,6 +202,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton )
m_aJobData.m_nColorDepth = m_pDevicePage->getDepth();
m_aJobData.m_nColorDevice = m_pDevicePage->getColorDevice();
m_aJobData.m_nPSLevel = m_pDevicePage->getLevel();
+ m_aJobData.m_nPDFDevice = m_pDevicePage->getPDFDevice();
}
if( m_pOtherPage )
// write other settings
@@ -245,7 +246,7 @@ RTSPaperPage::RTSPaperPage( RTSDialog* pParent ) :
FreeResource();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
m_aOrientBox.InsertEntry( PORTRAIT_STRING );
m_aOrientBox.InsertEntry( LSCAPE_STRING );
@@ -287,8 +288,8 @@ void RTSPaperPage::update()
}
else
{
- m_aDuplexText.Enable( FALSE );
- m_aDuplexBox.Enable( FALSE );
+ m_aDuplexText.Enable( sal_False );
+ m_aDuplexBox.Enable( sal_False );
}
// paper
@@ -299,8 +300,8 @@ void RTSPaperPage::update()
}
else
{
- m_aPaperText.Enable( FALSE );
- m_aPaperBox.Enable( FALSE );
+ m_aPaperText.Enable( sal_False );
+ m_aPaperBox.Enable( sal_False );
}
// input slots
@@ -311,8 +312,8 @@ void RTSPaperPage::update()
}
else
{
- m_aSlotText.Enable( FALSE );
- m_aSlotBox.Enable( FALSE );
+ m_aSlotText.Enable( sal_False );
+ m_aSlotBox.Enable( sal_False );
}
}
@@ -367,8 +368,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
m_aPPDKeyBox( this, PaResId( RID_RTS_DEVICE_PPDKEY_BOX ) ),
m_aPPDValueText( this, PaResId( RID_RTS_DEVICE_PPDVALUE_TXT ) ),
m_aPPDValueBox( this, PaResId( RID_RTS_DEVICE_PPDVALUE_BOX ) ),
- m_aLevelText( this, PaResId( RID_RTS_DEVICE_LEVEL_TXT ) ),
- m_aLevelBox( this, PaResId( RID_RTS_DEVICE_LEVEL_BOX ) ),
+ m_aLevelText( this, PaResId( RID_RTS_DEVICE_PRINTLANG_TXT ) ),
+ m_aLevelBox( this, PaResId( RID_RTS_DEVICE_PRINTLANG_BOX ) ),
m_aSpaceText( this, PaResId( RID_RTS_DEVICE_SPACE_TXT ) ),
m_aSpaceBox( this, PaResId( RID_RTS_DEVICE_SPACE_BOX ) ),
m_aDepthText( this, PaResId( RID_RTS_DEVICE_DEPTH_TXT ) ),
@@ -389,13 +390,19 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break;
}
- m_aLevelBox.InsertEntry( m_pParent->m_aFromDriverString );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "1" ) ) );
- m_aLevelBox.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "2" ) ) );
- if( m_pParent->m_aJobData.m_nPSLevel == 0 )
- m_aLevelBox.SelectEntry( m_pParent->m_aFromDriverString );
+ sal_uLong nLevelEntryData = 0;
+ if( m_pParent->m_aJobData.m_nPDFDevice > 0 )
+ nLevelEntryData = 10;
else
- m_aLevelBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nPSLevel ) );
+ nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1;
+ for( sal_uInt16 i = 0; i < m_aLevelBox.GetEntryCount(); i++ )
+ {
+ if( (sal_uLong)m_aLevelBox.GetEntryData( i ) == nLevelEntryData )
+ {
+ m_aLevelBox.SelectEntryPos( i );
+ break;
+ }
+ }
m_aDepthBox.SelectEntry( String::CreateFromInt32( m_pParent->m_aJobData.m_nColorDepth ).AppendAscii( " Bit" ) );
@@ -413,7 +420,7 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
)
{
String aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) );
- USHORT nPos = m_aPPDKeyBox.InsertEntry( aEntry );
+ sal_uInt16 nPos = m_aPPDKeyBox.InsertEntry( aEntry );
m_aPPDKeyBox.SetEntryData( nPos, (void*)pKey );
}
}
@@ -434,6 +441,22 @@ void RTSDevicePage::update()
// ------------------------------------------------------------------
+sal_uLong RTSDevicePage::getLevel()
+{
+ sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel < 10 ? nLevel-1 : 0;
+}
+
+// ------------------------------------------------------------------
+
+sal_uLong RTSDevicePage::getPDFDevice()
+{
+ sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
+ return nLevel > 9 ? 1 : 0;
+}
+
+// ------------------------------------------------------------------
+
IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox )
{
if( pBox == &m_aPPDKeyBox )
@@ -471,7 +494,7 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
m_pParent->m_aJobData.m_pParser )
{
String aEntry( m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ) );
- USHORT nPos = m_aPPDValueBox.InsertEntry( aEntry );
+ sal_uInt16 nPos = m_aPPDValueBox.InsertEntry( aEntry );
m_aPPDValueBox.SetEntryData( nPos, (void*)pValue );
}
}
@@ -502,10 +525,10 @@ RTSOtherPage::RTSOtherPage( RTSDialog* pParent ) :
{
FreeResource();
- m_aTopLB.EnableEmptyFieldValue( TRUE );
- m_aBottomLB.EnableEmptyFieldValue( TRUE );
- m_aLeftLB.EnableEmptyFieldValue( TRUE );
- m_aRightLB.EnableEmptyFieldValue( TRUE );
+ m_aTopLB.EnableEmptyFieldValue( sal_True );
+ m_aBottomLB.EnableEmptyFieldValue( sal_True );
+ m_aLeftLB.EnableEmptyFieldValue( sal_True );
+ m_aRightLB.EnableEmptyFieldValue( sal_True );
m_aDefaultBtn.SetClickHdl( LINK( this, RTSOtherPage, ClickBtnHdl ) );
@@ -639,16 +662,16 @@ RTSFontSubstPage::RTSFontSubstPage( RTSDialog* pParent ) :
}
m_aEnableBox.Check( m_pParent->m_aJobData.m_bPerformFontSubstitution );
- m_aRemoveButton.Enable( FALSE );
+ m_aRemoveButton.Enable( sal_False );
if( ! m_pParent->m_aJobData.m_bPerformFontSubstitution )
{
- m_aSubstitutionsBox.Enable( FALSE );
- m_aSubstitutionsText.Enable( FALSE );
- m_aAddButton.Enable( FALSE );
- m_aToFontBox.Enable( FALSE );
- m_aToFontText.Enable( FALSE );
- m_aFromFontBox.Enable( FALSE );
- m_aFromFontText.Enable( FALSE );
+ m_aSubstitutionsBox.Enable( sal_False );
+ m_aSubstitutionsText.Enable( sal_False );
+ m_aAddButton.Enable( sal_False );
+ m_aToFontBox.Enable( sal_False );
+ m_aToFontText.Enable( sal_False );
+ m_aFromFontBox.Enable( sal_False );
+ m_aFromFontText.Enable( sal_False );
}
update();
@@ -667,7 +690,7 @@ RTSFontSubstPage::~RTSFontSubstPage()
void RTSFontSubstPage::update()
{
m_aSubstitutionsBox.Clear();
- m_aRemoveButton.Enable( FALSE );
+ m_aRemoveButton.Enable( sal_False );
// fill substitutions box
::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it;
for( it = m_pParent->m_aJobData.m_aFontSubstitutes.begin();
@@ -709,7 +732,7 @@ IMPL_LINK( RTSFontSubstPage, ClickBtnHdl, Button*, pButton )
for( int i = 0; i < m_aSubstitutionsBox.GetSelectEntryCount(); i++ )
{
String aEntry( m_aSubstitutionsBox.GetSelectEntry( i ) );
- USHORT nPos = aEntry.SearchAscii( " -> " );
+ sal_uInt16 nPos = aEntry.SearchAscii( " -> " );
aEntry.Erase( nPos );
m_pParent->m_aJobData.m_aFontSubstitutes.erase( aEntry );
}
@@ -783,7 +806,7 @@ OString RTSPWDialog::getPassword() const
extern "C" {
- int Sal_SetupPrinterDriver( ::psp::PrinterInfo& rJobData )
+ int SPA_DLLPUBLIC Sal_SetupPrinterDriver( ::psp::PrinterInfo& rJobData )
{
int nRet = 0;
RTSDialog aDialog( rJobData, rJobData.m_aPrinterName, false );
@@ -797,14 +820,14 @@ extern "C" {
return nRet;
}
- int Sal_queryFaxNumber( String& rNumber )
+ int SPA_DLLPUBLIC Sal_queryFaxNumber( String& rNumber )
{
String aTmpString( PaResId( RID_TXT_QUERYFAXNUMBER ) );
QueryString aQuery( NULL, aTmpString, rNumber );
return aQuery.Execute();
}
- bool Sal_authenticateQuery( const OString& rServer, OString& rUserName, OString& rPassword )
+ bool SPA_DLLPUBLIC Sal_authenticateQuery( const OString& rServer, OString& rUserName, OString& rPassword )
{
bool bRet = false;
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 10a7b57e857b..b6de919cee04 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -148,9 +148,10 @@ public:
void update();
- ULONG getLevel() { return m_aLevelBox.GetSelectEntry().ToInt32(); }
- ULONG getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
- ULONG getColorDevice()
+ sal_uLong getLevel();
+ sal_uLong getPDFDevice();
+ sal_uLong getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
+ sal_uLong getColorDevice()
{
String aSpace( m_aSpaceBox.GetSelectEntry() );
return aSpace == m_aSpaceColor ? 1 : ( aSpace == m_aSpaceGray ? -1 : 0 );
diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc
index 30439088de8e..7b6677de7ec4 100644
--- a/padmin/source/rtsetup.hrc
+++ b/padmin/source/rtsetup.hrc
@@ -48,13 +48,13 @@
#define RID_RTS_DEVICEPAGE 4003
#define RID_RTS_DEVICE_COLOR_TXT 1
-#define RID_RTS_DEVICE_GRAY_TXT 2
+#define RID_RTS_DEVICE_GRAY_TXT 2
#define RID_RTS_DEVICE_PPDKEY_TXT 3
#define RID_RTS_DEVICE_PPDKEY_BOX 4
-#define RID_RTS_DEVICE_PPDVALUE_TXT 5
-#define RID_RTS_DEVICE_PPDVALUE_BOX 6
-#define RID_RTS_DEVICE_LEVEL_TXT 7
-#define RID_RTS_DEVICE_LEVEL_BOX 8
+#define RID_RTS_DEVICE_PPDVALUE_TXT 5
+#define RID_RTS_DEVICE_PPDVALUE_BOX 6
+#define RID_RTS_DEVICE_PRINTLANG_TXT 7
+#define RID_RTS_DEVICE_PRINTLANG_BOX 8
#define RID_RTS_DEVICE_SPACE_TXT 9
#define RID_RTS_DEVICE_SPACE_BOX 10
#define RID_RTS_DEVICE_DEPTH_TXT 11
diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src
index e04374a72245..38f3bf224a13 100644
--- a/padmin/source/rtsetup.src
+++ b/padmin/source/rtsetup.src
@@ -78,6 +78,7 @@ TabDialog RID_RTS_RTSDIALOG
TabPage RID_RTS_PAPERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_PAPERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
FixedText RID_RTS_PAPER_PAPER_TXT
@@ -88,6 +89,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_PAPER_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_PAPER_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 5 );
@@ -101,6 +103,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_ORIENTATION_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_ORIENTATION_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 20 );
@@ -114,6 +117,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_DUPLEX_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_DUPLEX_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 35 );
@@ -127,6 +131,7 @@ TabPage RID_RTS_PAPERPAGE
};
ListBox RID_RTS_PAPER_SLOT_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_PAPERPAGE:RID_RTS_PAPER_SLOT_BOX";
Border = TRUE;
DropDown = TRUE;
Pos = MAP_APPFONT( 115, 50 );
@@ -136,6 +141,7 @@ TabPage RID_RTS_PAPERPAGE
TabPage RID_RTS_DEVICEPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_DEVICEPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -156,6 +162,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDKEY_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDKEY_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 5, 14 );
Size = MAP_APPFONT( 105, 111 );
@@ -168,22 +175,32 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_PPDVALUE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_PPDVALUE_BOX";
Border = TRUE;
Pos = MAP_APPFONT( 120, 14 );
Size = MAP_APPFONT( 105, 111 );
};
- FixedText RID_RTS_DEVICE_LEVEL_TXT
+ FixedText RID_RTS_DEVICE_PRINTLANG_TXT
{
Pos = MAP_APPFONT( 5, 130 );
Size = MAP_APPFONT( 80, 8 );
- Text [ en-US ] = "PostScript ~Level";
+ Text [ en-US ] = "Printer ~Language type";
};
- ListBox RID_RTS_DEVICE_LEVEL_BOX
+ ListBox RID_RTS_DEVICE_PRINTLANG_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_LEVEL_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 130 );
Size = MAP_APPFONT( 105, 200 );
+ StringList [en-US] =
+ {
+ < "PostScript (Level from driver)" ; 1; > ;
+ < "PostScript Level 1" ; 2; > ;
+ < "PostScript Level 2"; 3; > ;
+ < "PostScript Level 3"; 3; > ;
+ < "PDF"; 10; > ;
+ };
};
FixedText RID_RTS_DEVICE_SPACE_TXT
{
@@ -193,6 +210,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_SPACE_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_SPACE_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 145 );
Size = MAP_APPFONT( 105, 200 );
@@ -205,6 +223,7 @@ TabPage RID_RTS_DEVICEPAGE
};
ListBox RID_RTS_DEVICE_DEPTH_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_DEVICEPAGE:RID_RTS_DEVICE_DEPTH_BOX";
DropDown = TRUE;
Pos = MAP_APPFONT( 120, 160 );
Size = MAP_APPFONT( 105, 200 );
@@ -218,11 +237,13 @@ TabPage RID_RTS_DEVICEPAGE
TabPage RID_RTS_FONTSUBSTPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_FONTSUBSTPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
CheckBox RID_RTS_FS_ENABLE_BTN
{
+ HelpID = "padmin:CheckBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ENABLE_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 180, 10 );
Text [ en-US ] = "~Enable font replacement";
@@ -236,6 +257,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
MultiListBox RID_RTS_FS_SUBST_BOX
{
+ HelpID = "padmin:MultiListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_SUBST_BOX";
AutoHScroll = TRUE;
Border = TRUE;
Sort = TRUE;
@@ -245,12 +267,14 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
PushButton RID_RTS_FS_ADD_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_ADD_BTN";
Pos = MAP_APPFONT( 5, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Add";
};
PushButton RID_RTS_FS_REMOVE_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_REMOVE_BTN";
Pos = MAP_APPFONT( 117, 125 );
Size = MAP_APPFONT( 107, 12 );
Text [ en-US ] = "~Remove";
@@ -263,6 +287,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ComboBox RID_RTS_FS_FROM_BOX
{
+ HelpID = "padmin:ComboBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_FROM_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -277,6 +302,7 @@ TabPage RID_RTS_FONTSUBSTPAGE
};
ListBox RID_RTS_FS_TO_BOX
{
+ HelpID = "padmin:ListBox:RID_RTS_FONTSUBSTPAGE:RID_RTS_FS_TO_BOX";
Border = TRUE;
DropDown = TRUE;
Sort = TRUE;
@@ -287,11 +313,13 @@ TabPage RID_RTS_FONTSUBSTPAGE
TabPage RID_RTS_COMMANDPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_COMMANDPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
ComboBox RID_RTS_CMD_CB_COMMANDS
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_COMMANDS";
Border = TRUE ;
Sort = TRUE ;
Dropdown = TRUE;
@@ -300,6 +328,7 @@ TabPage RID_RTS_COMMANDPAGE
};
CheckBox RID_RTS_CMD_CB_EXTERNAL
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_CB_EXTERNAL";
Pos = MAP_APPFONT( 11, 95 );
Size = MAP_APPFONT( 220, 10 );
Text [ en-US ] = "~Use system print dialog, disable %PRODUCTNAME's print dialog";
@@ -313,6 +342,7 @@ TabPage RID_RTS_COMMANDPAGE
};
ComboBox RIT_RTS_CMD_CB_QUICKCMD
{
+ HelpID = "padmin:ComboBox:RID_RTS_COMMANDPAGE:RIT_RTS_CMD_CB_QUICKCMD";
Border = TRUE;
Sort = TRUE;
Dropdown = TRUE;
@@ -340,6 +370,7 @@ TabPage RID_RTS_COMMANDPAGE
ListBox RID_RTS_CMD_LB_CONFIGURE
{
+ HelpID = "padmin:ListBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_LB_CONFIGURE";
DropDown = true;
Border = true;
Pos = MAP_APPFONT( 101, 56 );
@@ -354,6 +385,7 @@ TabPage RID_RTS_COMMANDPAGE
CheckBox RID_RTS_CMD_BOX_SWALLOWFAXNO
{
+ HelpID = "padmin:CheckBox:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BOX_SWALLOWFAXNO";
Pos = MAP_APPFONT( 11, 146 );
Size = MAP_APPFONT( 130, 8 );
Text [ en-US ] = "~Fax number will be removed from output";
@@ -366,12 +398,14 @@ TabPage RID_RTS_COMMANDPAGE
};
Edit RID_RTS_CMD_EDT_PDFDIR
{
+ HelpID = "padmin:Edit:RID_RTS_COMMANDPAGE:RID_RTS_CMD_EDT_PDFDIR";
Border = TRUE;
Pos = MAP_APPFONT( 11, 155 );
Size = MAP_APPFONT( 130, 12 );
};
PushButton RID_RTS_CMD_BTN_PDFDIR
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_PDFDIR";
Pos = MAP_APPFONT( 146, 155 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -395,12 +429,14 @@ TabPage RID_RTS_COMMANDPAGE
};
PushButton RID_RTS_CMD_BTN_HELP
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_HELP";
Pos = MAP_APPFONT( 170, 55 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Help";
};
PushButton RID_RTS_CMD_BTN_REMOVE
{
+ HelpID = "padmin:PushButton:RID_RTS_COMMANDPAGE:RID_RTS_CMD_BTN_REMOVE";
Pos = MAP_APPFONT( 170, 72 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Remove";
@@ -421,6 +457,7 @@ TabPage RID_RTS_COMMANDPAGE
TabPage RID_RTS_OTHERPAGE
{
+ HelpID = "padmin:TabPage:RID_RTS_OTHERPAGE";
Hide = TRUE;
Size = MAP_APPFONT( 230, 175 );
@@ -432,6 +469,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_LEFTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_LEFTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 5 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -448,6 +486,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_TOPMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_TOPMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 20 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -464,6 +503,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_RIGHTMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_RIGHTMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 35 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -480,6 +520,7 @@ TabPage RID_RTS_OTHERPAGE
};
MetricField RID_RTS_OTHER_BOTTOMMARGIN_BOX
{
+ HelpID = "padmin:MetricField:RID_RTS_OTHERPAGE:RID_RTS_OTHER_BOTTOMMARGIN_BOX";
Border = TRUE ;
Pos = MAP_APPFONT ( 100 , 50 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -496,12 +537,14 @@ TabPage RID_RTS_OTHERPAGE
};
Edit RID_RTS_OTHER_COMMENT_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_OTHERPAGE:RID_RTS_OTHER_COMMENT_EDT";
Border = TRUE ;
Pos = MAP_APPFONT ( 5 , 75 ) ;
Size = MAP_APPFONT ( 220 , 12 ) ;
};
PushButton RID_RTS_OTHER_DEFAULT_BTN
{
+ HelpID = "padmin:PushButton:RID_RTS_OTHERPAGE:RID_RTS_OTHER_DEFAULT_BTN";
Pos = MAP_APPFONT( 175, 5 );
Size = MAP_APPFONT( 50, 12 );
Text [ en-US ] = "~Default";
@@ -515,6 +558,7 @@ String RID_TXT_QUERYFAXNUMBER
ModalDialog RID_RTS_PWDIALOG
{
+ HelpID = "padmin:ModalDialog:RID_RTS_PWDIALOG";
Text [ en-US ] = "Authentication request";
OutputSize = TRUE ;
SVLook = TRUE ;
@@ -537,6 +581,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_USER_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_USER_EDT";
Pos = MAP_APPFONT( 70, 29 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
@@ -549,6 +594,7 @@ ModalDialog RID_RTS_PWDIALOG
};
Edit RID_RTS_PWDIALOG_PASS_EDT
{
+ HelpID = "padmin:Edit:RID_RTS_PWDIALOG:RID_RTS_PWDIALOG_PASS_EDT";
Pos = MAP_APPFONT( 70, 44 );
Size = MAP_APPFONT( 75, 12 );
Border = TRUE;
diff --git a/rsc/inc/rscsfx.hxx b/rsc/inc/rsc/rscsfx.hxx
index 36babfb8c520..36babfb8c520 100644
--- a/rsc/inc/rscsfx.hxx
+++ b/rsc/inc/rsc/rscsfx.hxx
diff --git a/rsc/inc/rscall.h b/rsc/inc/rscall.h
index d66f3aa325d6..fed155cc90d3 100644
--- a/rsc/inc/rscall.h
+++ b/rsc/inc/rscall.h
@@ -96,7 +96,7 @@ struct RSCINST {
pClass = pCl;
pData = pClassData;
}
- BOOL IsInst() const { return( pData != NULL ); }
+ sal_Bool IsInst() const { return( pData != NULL ); }
};
/********************** S U B I N F O S T R U C T ************************/
diff --git a/rsc/inc/rscarray.hxx b/rsc/inc/rscarray.hxx
index 9d91534728ce..52ef742b55f7 100644
--- a/rsc/inc/rscarray.hxx
+++ b/rsc/inc/rscarray.hxx
@@ -81,9 +81,9 @@ public:
pTypeClass = pClass;
}
virtual RscTop * GetTypeClass() const;
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
void Destroy( const RSCINST & rInst );
- virtual ERRTYPE GetValueEle( const RSCINST & rInst, INT32 lValue,
+ virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
RscTop * pCreateClass,
RSCINST * pGetInst );
virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
@@ -93,10 +93,10 @@ public:
// Gibt die Groesse der Klasse in Bytes
sal_uInt32 Size(){ return( nSize ); };
- BOOL IsConsistent( const RSCINST & rInst );
+ sal_Bool IsConsistent( const RSCINST & rInst );
virtual void SetToDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst );
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsDefault( const RSCINST & rInst );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab,
@@ -104,7 +104,7 @@ public:
void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
};
@@ -122,7 +122,7 @@ public:
RscTypCont * pTC, sal_uInt32 nTab, const char * );
virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, const RscId & aId,
- sal_uInt32 nDeep, BOOL bExtra );
+ sal_uInt32 nDeep, sal_Bool bExtra );
};
diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx
index 49d8250af0a7..7dc3e95488ad 100644
--- a/rsc/inc/rscclass.hxx
+++ b/rsc/inc/rscclass.hxx
@@ -38,7 +38,7 @@ class RscClass : public RscTop
{
protected:
struct RscClassInst{
- ULONG nVarDflt;
+ sal_uLong nVarDflt;
};
struct VARTYPE_STRUCT {
Atom nVarName; // Variablenname
@@ -55,13 +55,13 @@ protected:
sal_uInt32 nEntries; // Eintraege in pVarTypeList
VARTYPE_STRUCT * pVarTypeList; // Variablenliste
RSCINST GetInstData( CLASS_DATA pData, sal_uInt32 nEle,
- BOOL bGetCopy = FALSE );
+ sal_Bool bGetCopy = sal_False );
CLASS_DATA GetDfltData( sal_uInt32 nEle );
- BOOL IsDflt( CLASS_DATA pData, sal_uInt32 nEle );
- BOOL IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle );
+ sal_Bool IsDflt( CLASS_DATA pData, sal_uInt32 nEle );
+ sal_Bool IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle );
void SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle,
- BOOL bSet );
- INT32 GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos,
+ sal_Bool bSet );
+ sal_Int32 GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos,
sal_uInt32 nTupelIdx, RscTypCont * pTC );
public:
RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
@@ -77,29 +77,29 @@ public:
virtual void EnumVariables( void * pData, VarEnumCallbackProc );
RSCINST GetVariable( const RSCINST & rInst, Atom nVarName,
const RSCINST & rInitInst,
- BOOL nInitDflt = FALSE,
+ sal_Bool nInitDflt = sal_False,
RscTop * pCreateClass = NULL );
RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName );
// Gibt die Groesse der Klasse in Bytes
sal_uInt32 Size(){ return( nSize ); };
- BOOL IsConsistent( const RSCINST & rInst );
+ sal_Bool IsConsistent( const RSCINST & rInst );
void SetToDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst );
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsDefault( const RSCINST & rInst );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
void SetDefault( const RSCINST & rData, Atom nVarId );
using RscTop::GetDefault;
RSCINST GetDefault( Atom nVarId );
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
void Destroy( const RSCINST & rInst );
void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteInstRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
void WriteSyntax( FILE * fOutput, RscTypCont * pTC );
void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
@@ -112,10 +112,10 @@ class RscSysDepend : public RscClass
public:
RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
ERRTYPE WriteSysDependRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra,
- BOOL bFirst = FALSE );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra,
+ sal_Bool bFirst = sal_False );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
};
class RscFirstSysDepend : public RscSysDepend
@@ -124,7 +124,7 @@ public:
RscFirstSysDepend( Atom nId, sal_uInt32 nTypId,
RscTop * pSuper );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
};
class RscTupel : public RscClass
diff --git a/rsc/inc/rscclobj.hxx b/rsc/inc/rscclobj.hxx
index b75ab715feb6..3a6006501b7a 100644
--- a/rsc/inc/rscclobj.hxx
+++ b/rsc/inc/rscclobj.hxx
@@ -36,23 +36,23 @@
class ObjNode : public IdNode{
RscId aRscId; // Id der Resource
CLASS_DATA pRscObj;// pointer to a resourceobject
- ULONG lFileKey;// Dateischluessel
+ sal_uLong lFileKey;// Dateischluessel
protected:
using NameNode::Search;
public:
using NameNode::Insert;
- ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey );
- ObjNode * DelObjNode( RscTop * pClass, ULONG lFileKey );
+ ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey );
+ ObjNode * DelObjNode( RscTop * pClass, sal_uLong lFileKey );
sal_uInt32 GetId() const;
RscId GetRscId(){ return( aRscId ); }
- ULONG GetFileKey(){ return lFileKey; };
+ sal_uLong GetFileKey(){ return lFileKey; };
ObjNode* Search( const RscId &rName ) const{
// search the index in the b-tree
return( (ObjNode *)IdNode::Search( rName ) );
}
- BOOL Insert( ObjNode* pTN ){
+ sal_Bool Insert( ObjNode* pTN ){
// insert a new node in the b-tree
return( IdNode::Insert( (IdNode *)pTN ) );
}
@@ -60,7 +60,7 @@ public:
// get the Object from this Node
return( pRscObj );
}
- BOOL IsConsistent();
+ sal_Bool IsConsistent();
};
/******************* R e f N o d e ***************************************/
@@ -79,11 +79,11 @@ public:
// search the index in the b-tree
return( (RefNode *)IdNode::Search( typ ) );
};
- BOOL Insert( RefNode* pTN ){
+ sal_Bool Insert( RefNode* pTN ){
// insert a new node in the b-tree
return( IdNode::Insert( (IdNode *)pTN ) );
};
- BOOL PutObjNode( ObjNode * pPutObject );
+ sal_Bool PutObjNode( ObjNode * pPutObject );
// insert new node in b-tree pObjBiTree
ObjNode * GetObjNode( const RscId &rRscId );
diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx
index 6e13728f0448..d1ebeeff87d3 100644
--- a/rsc/inc/rscconst.hxx
+++ b/rsc/inc/rscconst.hxx
@@ -39,7 +39,7 @@ class RscConst : public RscTop
protected:
struct VarEle {
Atom nId; // Name der Konstante
- INT32 lValue; // Wert der Konstante
+ sal_Int32 lValue; // Wert der Konstante
};
VarEle * pVarArray; // Zeiger auf das Feld mit Konstanten
sal_uInt32 nEntries; // Anzahle der Eintraege im Feld
@@ -49,10 +49,10 @@ public:
virtual RSCCLASS_TYPE GetClassType() const;
sal_uInt32 GetEntryCount() const { return nEntries; }
// Die erlaubten Werte werden gesetzt
- ERRTYPE SetConstant( Atom nVarName, INT32 lValue );
+ ERRTYPE SetConstant( Atom nVarName, sal_Int32 lValue );
Atom GetConstant( sal_uInt32 nPos );
- BOOL GetConstValue( Atom nConstId, INT32 * pVal ) const;
- BOOL GetValueConst( INT32 nValue, Atom * pConstId ) const;
+ sal_Bool GetConstValue( Atom nConstId, sal_Int32 * pVal ) const;
+ sal_Bool GetValueConst( sal_Int32 nValue, Atom * pConstId ) const;
sal_uInt32 GetConstPos( Atom nConstId );
virtual void WriteSyntax( FILE * fOutput, RscTypCont * pTC );
virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
@@ -63,34 +63,34 @@ public:
class RscEnum : public RscConst {
struct RscEnumInst {
sal_uInt32 nValue; // Position der Konstanten im Array
- BOOL bDflt; // Ist Default
+ sal_Bool bDflt; // Ist Default
};
sal_uInt32 nSize;
public:
RscEnum( Atom nId, sal_uInt32 nTypId );
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
sal_uInt32 Size(){ return nSize; }
virtual void SetToDefault( const RSCINST & rInst )
{
- ((RscEnumInst*)rInst.pData)->bDflt = TRUE;
+ ((RscEnumInst*)rInst.pData)->bDflt = sal_True;
}
- BOOL IsDefault( const RSCINST & rInst )
+ sal_Bool IsDefault( const RSCINST & rInst )
{
return( ((RscEnumInst*)rInst.pData)->bDflt );
};
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- INT32 nValue );
- ERRTYPE SetNumber( const RSCINST & rInst, INT32 nValue );
+ sal_Int32 nValue );
+ ERRTYPE SetNumber( const RSCINST & rInst, sal_Int32 nValue );
ERRTYPE GetConst( const RSCINST & rInst, Atom * );
- ERRTYPE GetNumber( const RSCINST & rInst, INT32 * nValue );
+ ERRTYPE GetNumber( const RSCINST & rInst, sal_Int32 * nValue );
void WriteSrc( const RSCINST &rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
};
class RscNameTable;
diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx
index 07977cabbd52..3c34377bbe1a 100644
--- a/rsc/inc/rsccont.hxx
+++ b/rsc/inc/rsccont.hxx
@@ -42,7 +42,7 @@ struct ENTRY_STRUCT {
struct RscBaseContInst {
sal_uInt32 nEntries;
ENTRY_STRUCT * pEntries;
- BOOL bDflt;
+ sal_Bool bDflt;
};
class RscBaseCont : public RscTop
@@ -50,7 +50,7 @@ class RscBaseCont : public RscTop
protected:
RscTop * pTypeClass; // Typ der Eintraege
RscTop * pTypeClass1;// Zwei verschiedene Typen moeglich
- BOOL bNoId; // Keine Identifier
+ sal_Bool bNoId; // Keine Identifier
sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
// mit Superklassen
sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten
@@ -61,13 +61,13 @@ protected:
void ContWriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
void ContWriteRcAccess( FILE * fOutput, RscTypCont * pTC,
- const char *, BOOL nWriteSize );
+ const char *, sal_Bool nWriteSize );
public:
RscBaseCont( Atom nId, sal_uInt32 nTypId,
RscTop * pSuper = NULL,
- BOOL bNoId = TRUE );
+ sal_Bool bNoId = sal_True );
~RscBaseCont();
virtual RSCCLASS_TYPE GetClassType() const;
void SetTypeClass( RscTop * pClass, RscTop * pClass1 = NULL )
@@ -75,7 +75,7 @@ public:
pTypeClass = pClass;
pTypeClass1 = pClass1;
};
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
void Destroy( const RSCINST & rInst );
ERRTYPE GetElement( const RSCINST & rInst, const RscId & rEleName,
RscTop * pCreateClass, const RSCINST & rCreateInst,
@@ -90,19 +90,19 @@ public:
const RscId & rRscId);
SUBINFO_STRUCT GetInfoEle( const RSCINST & rInst, sal_uInt32 nPos );
ERRTYPE SetString( const RSCINST &, const char * pStr );
- ERRTYPE SetNumber( const RSCINST &, INT32 lValue );
- ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue );
+ ERRTYPE SetNumber( const RSCINST &, sal_Int32 lValue );
+ ERRTYPE SetBool( const RSCINST & rInst, sal_Bool bValue );
ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- INT32 nValue );
+ sal_Int32 nValue );
ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId );
// Gibt die Groesse der Klasse in Bytes
sal_uInt32 Size(){ return( nSize ); };
- BOOL IsConsistent( const RSCINST & rInst );
+ sal_Bool IsConsistent( const RSCINST & rInst );
void SetToDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst );
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsDefault( const RSCINST & rInst );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
void Delete( const RSCINST & rInst, RscTop * pClass,
const RscId & rId );
@@ -111,7 +111,7 @@ public:
void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32 , BOOL bExtra);
+ RscTypCont * pTC, sal_uInt32 , sal_Bool bExtra);
ERRTYPE WriteHxx( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, const RscId & rId );
ERRTYPE WriteCxx( const RSCINST & rInst, FILE * fOutput,
@@ -124,7 +124,7 @@ class RscContWriteSrc : public RscBaseCont
public:
RscContWriteSrc( Atom nId, sal_uInt32 nTypId,
RscTop * pSuper = NULL,
- BOOL bNoId = TRUE );
+ sal_Bool bNoId = sal_True );
void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
};
@@ -134,9 +134,9 @@ class RscCont : public RscContWriteSrc {
public:
RscCont( Atom nId, sal_uInt32 nTypId,
RscTop * pSuper = NULL,
- BOOL bNoId = TRUE );
+ sal_Bool bNoId = sal_True );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
};
@@ -146,9 +146,9 @@ class RscContExtraData : public RscContWriteSrc {
public:
RscContExtraData( Atom nId, sal_uInt32 nTypId,
RscTop * pSuper = NULL,
- BOOL bNoId = TRUE );
+ sal_Bool bNoId = sal_True );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
};
#endif //_RSCCONT_HXX
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 8f939e33f3e1..54c386dab315 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -81,7 +81,7 @@ class RscTypCont
ByteString aSearchPath; // Suchen der Bitmap, Icon, Pointer
ByteString aSysSearchPath; // aSearchPath plus language specific paths
sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen
- ULONG nFilePos; // Position in der Datei ( MTF )
+ sal_uLong nFilePos; // Position in der Datei ( MTF )
sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile
// muss groesser als RSC_VERSIONCONTROL_ID sein
RscTop * pRoot; // Zeiger auf die Wurzel vom Typenbaum
@@ -145,12 +145,11 @@ class RscTypCont
Atom nTopImageId;
Atom nNoLabelId;
Atom nVertId;
- Atom nSingleLineId;
Atom nSysWinId;
void Init(); // Initialisiert Klassen und Tabelle
- void SETCONST( RscConst *, const char *, UINT32 );
- void SETCONST( RscConst *, Atom, UINT32 );
+ void SETCONST( RscConst *, const char *, sal_uInt32 );
+ void SETCONST( RscConst *, Atom, sal_uInt32 );
RscEnum * InitLangType();
RscEnum * InitFieldUnitsType();
RscEnum * InitTimeFieldFormat();
@@ -269,7 +268,7 @@ class RscTypCont
void InsWinBit( RscTop * pClass, const ByteString & rName,
Atom nVal );
- void WriteInc( FILE * fOutput, ULONG lKey );
+ void WriteInc( FILE * fOutput, sal_uLong lKey );
public:
RscBool aBool;
@@ -288,6 +287,7 @@ public:
RscRange a0to9999Short;
RscIdRange aIdLong;
RscString aString;
+ RscString aStringLiteral;
RscFlag aWinBits;
RscLangEnum aLangType;
RscLangArray aLangString;
@@ -299,7 +299,7 @@ public:
RscNameTable aNmTb; // Tabelle fuer Namen
RscFileTab aFileTab; // Tabelle der Dateinamen
sal_uInt32 nFlags;
- std::map<sal_uInt64, ULONG> aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu
+ std::map<sal_uInt64, sal_uLong> aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu
//(unter PM), oder eine Dateiposition (MTF)
RscTypCont( RscError *, RSCBYTEORDER_TYPE, const ByteString & rSearchPath, sal_uInt32 nFlags );
@@ -307,14 +307,14 @@ public:
Atom AddLanguage( const char* );
- BOOL IsPreload() const
- { return (nFlags & PRELOAD_FLAG) ? TRUE : FALSE; }
- BOOL IsSmart() const
- { return (nFlags & SMART_FLAG) ? TRUE : FALSE; }
- BOOL IsSysResTest() const
- { return (nFlags & NOSYSRESTEST_FLAG) ? FALSE : TRUE; }
- BOOL IsSrsDefault() const
- { return (nFlags & SRSDEFAULT_FLAG) ? TRUE : FALSE; }
+ sal_Bool IsPreload() const
+ { return (nFlags & PRELOAD_FLAG) ? sal_True : sal_False; }
+ sal_Bool IsSmart() const
+ { return (nFlags & SMART_FLAG) ? sal_True : sal_False; }
+ sal_Bool IsSysResTest() const
+ { return (nFlags & NOSYSRESTEST_FLAG) ? sal_False : sal_True; }
+ sal_Bool IsSrsDefault() const
+ { return (nFlags & SRSDEFAULT_FLAG) ? sal_True : sal_False; }
ByteString ChangeLanguage( const ByteString& rNewLang );
const std::vector< sal_uInt32 >& GetFallbacks() const
{ return aLangFallbacks; }
@@ -340,23 +340,23 @@ public:
CLASS_DATA Search( Atom typ, const RscId & rId );
void Delete( Atom typ, const RscId & rId );
// loescht alle Resourceobjekte diese Datei
- void Delete( ULONG lFileKey );
+ void Delete( sal_uLong lFileKey );
RscTop * GetRoot() { return( pRoot ); };
sal_uInt32 PutSysName( sal_uInt32 nRscTyp, char * pName, sal_uInt32 nConst,
- sal_uInt32 nId, BOOL bFirst );
+ sal_uInt32 nId, sal_Bool bFirst );
void ClearSysNames();
ERRTYPE WriteRc( WriteRcContext& rContext );
- void WriteSrc( FILE * fOutput, ULONG nFileIndex,
- CharSet nCharSet, BOOL bName = TRUE );
- ERRTYPE WriteHxx( FILE * fOutput, ULONG nFileKey);
- ERRTYPE WriteCxx( FILE * fOutput, ULONG nFileKey,
+ void WriteSrc( FILE * fOutput, sal_uLong nFileIndex,
+ CharSet nCharSet, sal_Bool bName = sal_True );
+ ERRTYPE WriteHxx( FILE * fOutput, sal_uLong nFileKey);
+ ERRTYPE WriteCxx( FILE * fOutput, sal_uLong nFileKey,
const ByteString & rHxxName );
void WriteSyntax( FILE * fOutput );
void WriteRcCtor( FILE * fOutput );
- void FillNameIdList( REResourceList * pList, ULONG lFileKey );
- BOOL MakeConsistent();
+ void FillNameIdList( REResourceList * pList, sal_uLong lFileKey );
+ sal_Bool MakeConsistent();
sal_uInt32 PutTranslatorKey( sal_uInt64 nKey );
- void IncFilePos( ULONG nOffset ){ nFilePos += nOffset; }
+ void IncFilePos( sal_uLong nOffset ){ nFilePos += nOffset; }
};
#endif
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index 3e6c21288fbe..4ff5e2201dd6 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -56,37 +56,37 @@ public:
} aExp;
char cType;
char cUnused;
- BOOL IsNumber() const { return( RSCEXP_LONG == cType ); }
- BOOL IsExpression()const { return( RSCEXP_EXP == cType ); }
- BOOL IsDefinition()const { return( RSCEXP_DEF == cType ); }
- BOOL IsNothing() const { return( RSCEXP_NOTHING == cType ); }
- void SetLong( INT32 lValue ){
+ sal_Bool IsNumber() const { return( RSCEXP_LONG == cType ); }
+ sal_Bool IsExpression()const { return( RSCEXP_EXP == cType ); }
+ sal_Bool IsDefinition()const { return( RSCEXP_DEF == cType ); }
+ sal_Bool IsNothing() const { return( RSCEXP_NOTHING == cType ); }
+ void SetLong( sal_Int32 lValue ){
aExp.aLong.nHi = (short)(lValue >> 16);
aExp.aLong.nLo = (unsigned short)lValue;
cType = RSCEXP_LONG;
}
- INT32 GetLong() const{
+ sal_Int32 GetLong() const{
return aExp.aLong.nLo |
- ((INT32)aExp.aLong.nHi << 16);
+ ((sal_Int32)aExp.aLong.nHi << 16);
}
- BOOL Evaluate( INT32 * pValue ) const;
+ sal_Bool Evaluate( sal_Int32 * pValue ) const;
void GetMacro( ByteString & ) const;
};
/*********** R s c I d ***************************************************/
class RscId
{
- static BOOL bNames;// FALSE, bei den Namenoperation nur Zahlen
+ static sal_Bool bNames;// sal_False, bei den Namenoperation nur Zahlen
public:
RscExpType aExp; // Zahl, Define oder Ausdruck
- INT32 GetNumber() const;
+ sal_Int32 GetNumber() const;
void Create( const RscExpType & rExpType );
void Create(){ aExp.cType = RSCEXP_NOTHING; }
RscId() { Create(); }
RscId( RscDefine * pEle );
- RscId( INT32 lNumber )
+ RscId( sal_Int32 lNumber )
{ aExp.SetLong( lNumber ); }
RscId( const RscExpType & rExpType )
@@ -102,19 +102,19 @@ public:
RscId& operator = ( const RscId& rRscId );
- static BOOL IsSetNames();
- static void SetNames( BOOL bSet = TRUE );
- operator INT32() const; // Gibt Nummer zurueck
+ static sal_Bool IsSetNames();
+ static void SetNames( sal_Bool bSet = sal_True );
+ operator sal_Int32() const; // Gibt Nummer zurueck
ByteString GetName() const; // Gibt den Namen des Defines zurueck
ByteString GetMacro() const; // Gibt das Macro zurueck
- BOOL operator < ( const RscId& rRscId ) const;
- BOOL operator > ( const RscId& rRscId ) const;
- BOOL operator == ( const RscId& rRscId ) const;
- BOOL operator <= ( const RscId& rRscId ) const
+ sal_Bool operator < ( const RscId& rRscId ) const;
+ sal_Bool operator > ( const RscId& rRscId ) const;
+ sal_Bool operator == ( const RscId& rRscId ) const;
+ sal_Bool operator <= ( const RscId& rRscId ) const
{ return !(operator > ( rRscId )); }
- BOOL operator >= ( const RscId& rRscId ) const
+ sal_Bool operator >= ( const RscId& rRscId ) const
{ return !(operator < ( rRscId )); }
- BOOL IsId() const { return !aExp.IsNothing(); }
+ sal_Bool IsId() const { return !aExp.IsNothing(); }
};
/*********** R s c D e f i n e *******************************************/
@@ -125,15 +125,15 @@ friend class RscDefineList;
friend class RscDefTree;
friend class RscExpression;
friend class RscId;
- ULONG lFileKey; // zu welcher Datei gehoert das Define
+ sal_uLong lFileKey; // zu welcher Datei gehoert das Define
sal_uInt32 nRefCount; // Wieviele Referenzen auf dieses Objekt
- INT32 lId; // Identifier
+ sal_Int32 lId; // Identifier
RscExpression * pExp; // Ausdruck
protected:
- RscDefine( ULONG lFileKey, const ByteString & rDefName,
- INT32 lDefId );
- RscDefine( ULONG lFileKey, const ByteString & rDefName,
+ RscDefine( sal_uLong lFileKey, const ByteString & rDefName,
+ sal_Int32 lDefId );
+ RscDefine( sal_uLong lFileKey, const ByteString & rDefName,
RscExpression * pExpression );
~RscDefine();
void IncRef(){ nRefCount++; }
@@ -142,14 +142,14 @@ protected:
void DefineToNumber();
void SetName( const ByteString & rNewName ){ aName = rNewName; }
void ChangeMacro( RscExpression * pExpression );
- void ChangeMacro( INT32 lIdentifier );
+ void ChangeMacro( sal_Int32 lIdentifier );
using StringNode::Search;
public:
RscDefine * Search( const char * );
- ULONG GetFileKey() const { return lFileKey; }
- BOOL Evaluate();
- INT32 GetNumber() const { return lId; }
+ sal_uLong GetFileKey() const { return lFileKey; }
+ sal_Bool Evaluate();
+ sal_Int32 GetNumber() const { return lId; }
ByteString GetMacro();
};
@@ -161,14 +161,14 @@ friend class RscFileTab;
private:
RscSubDefList maList;
// pExpression wird auf jedenfall Eigentum der Liste
- RscDefine * New( ULONG lFileKey, const ByteString & rDefName,
- INT32 lDefId, size_t lPos );
- RscDefine * New( ULONG lFileKey, const ByteString & rDefName,
+ RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName,
+ sal_Int32 lDefId, size_t lPos );
+ RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName,
RscExpression * pExpression, size_t lPos );
- BOOL Befor( const RscDefine * pFree, const RscDefine * pDepend );
- BOOL Remove( RscDefine * pDef );
- BOOL Remove( size_t nIndex );
- BOOL Remove();
+ sal_Bool Befor( const RscDefine * pFree, const RscDefine * pDepend );
+ sal_Bool Remove( RscDefine * pDef );
+ sal_Bool Remove( size_t nIndex );
+ sal_Bool Remove();
size_t GetPos( RscDefine* item ) {
for ( size_t i = 0, n = maList.size(); i < n; ++i )
if ( maList[ i ] == item )
@@ -189,16 +189,16 @@ public:
RscExpression( RscExpType aLE, char cOp,
RscExpType aRE );
~RscExpression();
- BOOL Evaluate( INT32 * pValue );
+ sal_Bool Evaluate( sal_Int32 * pValue );
ByteString GetMacro();
};
/********************** R S C F I L E ************************************/
class RscDepend {
- ULONG lKey;
+ sal_uLong lKey;
public:
- RscDepend( ULONG lIncKey ){ lKey = lIncKey; };
- ULONG GetFileKey(){ return lKey; }
+ RscDepend( sal_uLong lIncKey ){ lKey = lIncKey; };
+ sal_uLong GetFileKey(){ return lKey; }
};
typedef ::std::vector< RscDepend* > RscDependList;
@@ -207,11 +207,11 @@ typedef ::std::vector< RscDepend* > RscDependList;
class RscFile
{
friend class RscFileTab;
- BOOL bIncFile; // Ist es eine Include-Datei
+ sal_Bool bIncFile; // Ist es eine Include-Datei
public:
- BOOL bLoaded; // Ist die Datei geladen
- BOOL bScanned; // Wurde Datei nach Inclide abgesucht
- BOOL bDirty; // Dirty-Flag
+ sal_Bool bLoaded; // Ist die Datei geladen
+ sal_Bool bScanned; // Wurde Datei nach Inclide abgesucht
+ sal_Bool bDirty; // Dirty-Flag
ByteString aFileName; // Name der Datei
ByteString aPathName; // Pfad und Name der Datei
RscDefineList aDefLst; // Liste der Defines
@@ -219,11 +219,11 @@ public:
RscFile();
~RscFile();
- BOOL InsertDependFile( ULONG lDepFile, size_t lPos );
- void RemoveDependFile( ULONG lDepFile );
- BOOL Depend( ULONG lDepend, ULONG lFree );
- void SetIncFlag(){ bIncFile = TRUE; };
- BOOL IsIncFile(){ return bIncFile; };
+ sal_Bool InsertDependFile( sal_uLong lDepFile, size_t lPos );
+ void RemoveDependFile( sal_uLong lDepFile );
+ sal_Bool Depend( sal_uLong lDepend, sal_uLong lFree );
+ void SetIncFlag(){ bIncFile = sal_True; };
+ sal_Bool IsIncFile(){ return bIncFile; };
};
DECLARE_UNIQUEINDEX( RscSubFileTab, RscFile * )
@@ -232,11 +232,11 @@ DECLARE_UNIQUEINDEX( RscSubFileTab, RscFile * )
class RscDefTree {
RscDefine * pDefRoot;
public:
- static BOOL Evaluate( RscDefine * pDef );
+ static sal_Bool Evaluate( RscDefine * pDef );
RscDefTree(){ pDefRoot = NULL; }
~RscDefTree();
void Remove();
- BOOL Evaluate();
+ sal_Bool Evaluate();
RscDefine * Search( const char * pName );
void Insert( RscDefine * pDef );
void Remove( RscDefine * pDef );
@@ -244,40 +244,40 @@ public:
class RscFileTab : public RscSubFileTab {
RscDefTree aDefTree;
- ULONG Find( const ByteString & rName );
+ sal_uLong Find( const ByteString & rName );
public:
RscFileTab();
~RscFileTab();
RscDefine * FindDef( const char * );
RscDefine * FindDef( const ByteString& rStr ) { return FindDef( rStr.GetBuffer() ); }
- RscDefine * FindDef( ULONG lKey, const ByteString & );
+ RscDefine * FindDef( sal_uLong lKey, const ByteString & );
- BOOL Depend( ULONG lDepend, ULONG lFree );
- BOOL TestDef( ULONG lFileKey, size_t lPos,
+ sal_Bool Depend( sal_uLong lDepend, sal_uLong lFree );
+ sal_Bool TestDef( sal_uLong lFileKey, size_t lPos,
const RscDefine * pDefDec );
- BOOL TestDef( ULONG lFileKey, size_t lPos,
+ sal_Bool TestDef( sal_uLong lFileKey, size_t lPos,
const RscExpression * pExpDec );
- RscDefine * NewDef( ULONG lKey, const ByteString & rDefName,
- INT32 lId, ULONG lPos );
- RscDefine * NewDef( ULONG lKey, const ByteString & rDefName,
- RscExpression *, ULONG lPos );
+ RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName,
+ sal_Int32 lId, sal_uLong lPos );
+ RscDefine * NewDef( sal_uLong lKey, const ByteString & rDefName,
+ RscExpression *, sal_uLong lPos );
- BOOL ChangeDef( const ByteString & rDefName, INT32 lId );
- BOOL ChangeDef( const ByteString & rDefName, RscExpression * );
+ sal_Bool ChangeDef( const ByteString & rDefName, sal_Int32 lId );
+ sal_Bool ChangeDef( const ByteString & rDefName, RscExpression * );
- BOOL IsDefUsed( const ByteString & );
+ sal_Bool IsDefUsed( const ByteString & );
void DeleteDef( const ByteString & );
- BOOL ChangeDefName( const ByteString & rDefName,
+ sal_Bool ChangeDefName( const ByteString & rDefName,
const ByteString & rNewName );
// Alle Defines die in dieser Datei Definiert sind loeschen
- void DeleteFileContext( ULONG lKey );
- void DeleteFile( ULONG lKey );
- ULONG NewCodeFile( const ByteString & rName );
- ULONG NewIncFile( const ByteString & rName, const ByteString & rPath );
- RscFile * GetFile( ULONG lFileKey ){ return Get( lFileKey ); }
+ void DeleteFileContext( sal_uLong lKey );
+ void DeleteFile( sal_uLong lKey );
+ sal_uLong NewCodeFile( const ByteString & rName );
+ sal_uLong NewIncFile( const ByteString & rName, const ByteString & rPath );
+ RscFile * GetFile( sal_uLong lFileKey ){ return Get( lFileKey ); }
};
#endif // _RSCDEF_HXX
diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h
index b532df468ca4..bc1516a73c41 100644
--- a/rsc/inc/rscerror.h
+++ b/rsc/inc/rscerror.h
@@ -106,9 +106,9 @@ public:
ERRTYPE( const ERRTYPE & rErr ) { nError = rErr.nError; };
ERRTYPE& operator = ( const ERRTYPE & rError );
operator sal_uInt32() const { return( nError ); }
- BOOL IsError() const { return( nError <= ERR_ERROREND ); }
- BOOL IsOk() const { return( !IsError() ); }
- BOOL IsWarning() const {
+ sal_Bool IsError() const { return( nError <= ERR_ERROREND ); }
+ sal_Bool IsOk() const { return( !IsError() ); }
+ sal_Bool IsWarning() const {
return( nError >= ERR_WARNINGSTART && nError <= ERR_WARNINGEND );
};
void Clear(){ nError = ERR_OK; }
diff --git a/rsc/inc/rscflag.hxx b/rsc/inc/rscflag.hxx
index a176a4f14114..48770605f0a3 100644
--- a/rsc/inc/rscflag.hxx
+++ b/rsc/inc/rscflag.hxx
@@ -42,30 +42,30 @@ class RscFlag : public RscConst {
RSCINST CreateBasic( RSCINST * pInst );
public:
RscFlag( Atom nId, sal_uInt32 nTypId );
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
RSCINST CreateClient( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass, Atom nConsId );
+ sal_Bool bOwnClass, Atom nConsId );
sal_uInt32 Size();
virtual void SetToDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst, Atom nConstId );
+ sal_Bool IsDefault( const RSCINST & rInst );
+ sal_Bool IsDefault( const RSCINST & rInst, Atom nConstId );
// Ist das Flag gesetzt
- BOOL IsSet( const RSCINST & rInst, Atom nConstId );
+ sal_Bool IsSet( const RSCINST & rInst, Atom nConstId );
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
Atom nConstId );
ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- INT32 nValue );
+ sal_Int32 nValue );
ERRTYPE SetNotConst( const RSCINST & rInst, Atom nConstId );
void WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
};
/******************* R s c C l i e n t ***********************************/
@@ -77,26 +77,26 @@ public:
RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass,
Atom nConstantId );
virtual RSCCLASS_TYPE GetClassType() const;
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
sal_uInt32 Size(){ return( pRefClass->Size() ); };
// Eine Zuweisung an eine Variable
- BOOL IsDefault( const RSCINST & rInst ){
+ sal_Bool IsDefault( const RSCINST & rInst ){
return( pRefClass->IsDefault( rInst, nConstId ) );
};
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
return pRefClass->IsValueDefault( rInst,
pDef, nConstId );
}
- ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue ){
+ ERRTYPE SetBool( const RSCINST & rInst, sal_Bool bValue ){
if( bValue )
return( pRefClass->SetConst( rInst, nConstId, bValue ) );
else
return( pRefClass->
SetNotConst( rInst, nConstId ) );
};
- ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB ){
+ ERRTYPE GetBool( const RSCINST & rInst, sal_Bool * pB ){
*pB = pRefClass->IsSet( rInst, nConstId );
return( ERR_OK );
};
diff --git a/rsc/inc/rscinst.hxx b/rsc/inc/rscinst.hxx
index 962444dd27ab..b64016bfac72 100644
--- a/rsc/inc/rscinst.hxx
+++ b/rsc/inc/rscinst.hxx
@@ -60,7 +60,7 @@ public:
RscInst& operator = ( const RscInst& rRscInst );
~RscInst();
void OverWrite( RscInstCopy & rInst );
- BOOL IsInst() const { return( aInst.IsInst() ); }
+ sal_Bool IsInst() const { return( aInst.IsInst() ); }
// Listen Methoden
ERRTYPE SetElement( const RscId & rName, RscInstCopy & rInst );
@@ -76,17 +76,17 @@ public:
ERRTYPE SetVar( Atom nVarName, RscInstCopy & rInst );
ERRTYPE SetConst( Atom nVarName, Atom nConstId );
- ERRTYPE SetBool( Atom nVarName, BOOL );
+ ERRTYPE SetBool( Atom nVarName, sal_Bool );
// Hack fuer X, Y, Width, Height
static ERRTYPE SetCorrectValues( RSCINST & rInst, RSCINST & rVarInst,
- INT32 lValue, sal_uInt32 nTupelIdx );
- ERRTYPE SetNumber( Atom nVarName, INT32 );
+ sal_Int32 lValue, sal_uInt32 nTupelIdx );
+ ERRTYPE SetNumber( Atom nVarName, sal_Int32 );
ERRTYPE SetString( Atom nVarName, const char * );
ERRTYPE SetConst( Atom nConstId );
- ERRTYPE SetBool( BOOL );
- ERRTYPE SetNumber( INT32 );
+ ERRTYPE SetBool( sal_Bool );
+ ERRTYPE SetNumber( sal_Int32 );
ERRTYPE SetString( const char * );
ERRTYPE SetRef( const RscId & rRscId );
ERRTYPE SetDefault( Atom nVarName );
@@ -94,17 +94,17 @@ public:
RscInst GetVar( Atom nVarName );
Atom GetConst( Atom nVarName = InvalidAtom );
sal_uInt32 GetConstPos( Atom nVarName = InvalidAtom );
- BOOL GetBool( Atom nVarName = InvalidAtom );
+ sal_Bool GetBool( Atom nVarName = InvalidAtom );
// Hack fuer X, Y, Width, Height
- static INT32 GetCorrectValues( RSCINST & rInst, RSCINST & rVarInst,
+ static sal_Int32 GetCorrectValues( RSCINST & rInst, RSCINST & rVarInst,
sal_uInt32 nTupelIdx );
- INT32 GetNumber( Atom nVarName = InvalidAtom );
+ sal_Int32 GetNumber( Atom nVarName = InvalidAtom );
const char *GetString( Atom nVarName = InvalidAtom );
RscId GetRef();
- BOOL IsDefault( Atom nVarName );
- BOOL IsConsistent( RscInconsList * pList );
+ sal_Bool IsDefault( Atom nVarName );
+ sal_Bool IsConsistent( RscInconsList * pList );
Atom GetClassEnum( Atom nVarName, sal_uInt32 nPos );
Atom GetClassEnum( sal_uInt32 nPos );
@@ -149,62 +149,62 @@ public:
// Konvertiert einen Namen in einen Typ
RscTop* GetClassType( Atom nClassName );
// Instanz einer Klasse erzeugen
- BOOL MakeConsistent( RscInconsList * pList );
+ sal_Bool MakeConsistent( RscInconsList * pList );
// Array mit Dateinamen
RscFileTab* GetFileTab();
// Eine Dateinamen-Instanz holen
- RscFile * GetFileStruct( ULONG lKey );
+ RscFile * GetFileStruct( sal_uLong lKey );
- ULONG AddSrcFile( const ByteString & rFileName );
- ULONG AddHrcFile( const ByteString & rFileName );
+ sal_uLong AddSrcFile( const ByteString & rFileName );
+ sal_uLong AddHrcFile( const ByteString & rFileName );
// Traegt die Include-Dateien in die Abhaengigkeitsliste
// von lFileKey ein
- void ScanForIncFiles( ULONG lFileKey );
- void RemoveFile( ULONG lKey );
+ void ScanForIncFiles( sal_uLong lFileKey );
+ void RemoveFile( sal_uLong lKey );
// Suche ueber alle DEFINES
RscDefine * FindDef( const ByteString & rName );
- ULONG GetFileKey( const ByteString & rFileName );
+ sal_uLong GetFileKey( const ByteString & rFileName );
};
class RscHrc
{
protected:
- ULONG lFileKey; // Index der Instanz
+ sal_uLong lFileKey; // Index der Instanz
RscDataBase * pDataBase;// Datenbasis
public:
// Kompilerinstanz erzeugen
- RscHrc( RscDataBase * pDBase, ULONG lKey );
+ RscHrc( RscDataBase * pDBase, sal_uLong lKey );
~RscHrc();
// Daten von Datei uebernehmen
ERRTYPE ReadFile();
- ULONG GetFileKey() const { return lFileKey; }
+ sal_uLong GetFileKey() const { return lFileKey; }
- void SetDirty( BOOL bSet );
- BOOL IsDirty();
+ void SetDirty( sal_Bool bSet );
+ sal_Bool IsDirty();
void SetPathName( const ByteString & );
ByteString GetPathName();
void SetFileName( const ByteString & );
ByteString GetFileName();
//Depend-Datei anhaengen
- void InsertDepend( ULONG lKey, ULONG lPos );
+ void InsertDepend( sal_uLong lKey, sal_uLong lPos );
// DefineList holen
RscDefineList * GetDefineList();
// Suche ueber all DEFINES im Zugriff
RscDefine * FindDef( const ByteString & rName );
- ERRTYPE NewDef( const ByteString & rMacroName, INT32 lValue,
- ULONG lPos );
+ ERRTYPE NewDef( const ByteString & rMacroName, sal_Int32 lValue,
+ sal_uLong lPos );
ERRTYPE NewDef( const ByteString & rMacroName, const ByteString & rMacro,
- ULONG lPos );
- ERRTYPE ChangeDef( const ByteString & rMacroName, INT32 lValue );
+ sal_uLong lPos );
+ ERRTYPE ChangeDef( const ByteString & rMacroName, sal_Int32 lValue );
ERRTYPE ChangeDef( const ByteString & rMacroName,
const ByteString & rMacro );
- BOOL IsDefUsed( const ByteString & );
+ sal_Bool IsDefUsed( const ByteString & );
void DeleteDef( const ByteString & rMacroName );
ERRTYPE ChangeDefName( const ByteString & rMacroName,
const ByteString & rNewName );
@@ -221,7 +221,7 @@ public:
class RscSrc : public RscHrc {
public:
// Kompilerinstanz erzeugen
- RscSrc( RscDataBase * pDBase, ULONG lKey );
+ RscSrc( RscDataBase * pDBase, sal_uLong lKey );
~RscSrc();
diff --git a/rsc/inc/rsckey.hxx b/rsc/inc/rsckey.hxx
index 6548601f0cc5..dd99b68b0fae 100644
--- a/rsc/inc/rsckey.hxx
+++ b/rsc/inc/rsckey.hxx
@@ -40,13 +40,13 @@ typedef struct {
} KEY_STRUCT;
class RscNameTable {
- BOOL bSort; //soll bei jedem einfuegen sortiert werden?
+ sal_Bool bSort; //soll bei jedem einfuegen sortiert werden?
sal_uInt32 nEntries; //Anzahl der Eintr�ge
KEY_STRUCT * pTable;
public:
RscNameTable();
~RscNameTable();
- void SetSort( BOOL bSorted = TRUE );
+ void SetSort( sal_Bool bSorted = sal_True );
Atom Put( Atom nName, sal_uInt32 nTyp, long nValue );
Atom Put( Atom nName, sal_uInt32 nTyp );
Atom Put( const char * pName, sal_uInt32 nTyp, long nValue );
@@ -54,8 +54,8 @@ public:
Atom Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass );
Atom Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass );
- // TRUE, wurde gefunden
- BOOL Get( Atom nName, KEY_STRUCT * pEle );
+ // sal_True, wurde gefunden
+ sal_Bool Get( Atom nName, KEY_STRUCT * pEle );
};
diff --git a/rsc/inc/rsclst.hxx b/rsc/inc/rsclst.hxx
index 0ae101a0c48d..32d64d424006 100644
--- a/rsc/inc/rsclst.hxx
+++ b/rsc/inc/rsclst.hxx
@@ -39,14 +39,14 @@ protected:
REResourceList* pParent;
RscId aRscId; //Id und Name des Resourceobjektes
ByteString aClassName;
- BOOL bVisible;
+ sal_Bool bVisible;
public:
REResourceList();
REResourceList( REResourceList * pParentList,
ByteString& rClassName,
const RscId & rResourceID,
- BOOL bVisible = FALSE );
+ sal_Bool bVisible = sal_False );
~REResourceList();
REResourceList* GetParent() { return pParent; }
@@ -55,9 +55,9 @@ public:
RscId GetRscId() { return aRscId; }
void SetRscId( const RscId & rId ){ aRscId = rId; }
- void SetVisible( BOOL bVis )
+ void SetVisible( sal_Bool bVis )
{ bVisible = bVis; }
- BOOL IsVisible() { return bVisible; }
+ sal_Bool IsVisible() { return bVisible; }
};
#endif // _RSCLST_HXX
diff --git a/rsc/inc/rscmgr.hxx b/rsc/inc/rscmgr.hxx
index fef2712d4e27..09303a4944bb 100644
--- a/rsc/inc/rscmgr.hxx
+++ b/rsc/inc/rscmgr.hxx
@@ -38,8 +38,8 @@
class RscMgr : public RscClass {
struct RscMgrInst {
RscId aRefId; // nRefId = Referenz Identifier
- BOOL bDflt; // Ist Default
- void Create(){ aRefId.Create(); bDflt = TRUE; }
+ sal_Bool bDflt; // Ist Default
+ void Create(){ aRefId.Create(); bDflt = sal_True; }
void Destroy(){ aRefId.Destroy(); }
};
ERRTYPE IsToDeep( const RSCINST & rInst, sal_uInt32 nDeep = 0 );
@@ -47,10 +47,10 @@ public:
RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
void SetToDefault( const RSCINST & rInst );
- BOOL IsDefault( const RSCINST & rInst );
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsDefault( const RSCINST & rInst );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
- RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
void Destroy( const RSCINST & rInst );
sal_uInt32 Size();
void WriteSrcHeader( const RSCINST & aInst, FILE * fOutput,
@@ -61,9 +61,9 @@ public:
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, const RscId & rId,
- sal_uInt32, BOOL bExtra );
+ sal_uInt32, sal_Bool bExtra );
ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
ERRTYPE WriteHxxHeader( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, const RscId & rId );
ERRTYPE WriteHxx( const RSCINST & rInst, FILE * fOutput,
@@ -72,7 +72,7 @@ public:
RscTypCont * pTC, const RscId & rId );
ERRTYPE WriteCxx( const RSCINST & rInst, FILE * fOutput,
RscTypCont * pTC, const RscId & rId );
- BOOL IsConsistent( const RSCINST & rInst );
+ sal_Bool IsConsistent( const RSCINST & rInst );
ERRTYPE GetRef( const RSCINST & rInst, RscId * );
ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId );
};
diff --git a/rsc/inc/rscpar.hxx b/rsc/inc/rscpar.hxx
index b235a48a12b0..69037ba8c027 100644
--- a/rsc/inc/rscpar.hxx
+++ b/rsc/inc/rscpar.hxx
@@ -42,10 +42,10 @@ class RscFileInst
ERRTYPE aFirstError;// Erster Fehler
sal_uInt32 nErrorLine; // Zeile des ersten Fehlers
sal_uInt32 nErrorPos; // Position des ersten Fehlers
- BOOL bIncLine; // Muss Zeilennummer incrementiert werden
+ sal_Bool bIncLine; // Muss Zeilennummer incrementiert werden
sal_uInt32 nLineNo; // Zeile in der Eingabedatei
- ULONG lFileIndex; // Index auf Eingabedatei
- ULONG lSrcIndex; // Index auf Basisdatei
+ sal_uLong lFileIndex; // Index auf Eingabedatei
+ sal_uLong lSrcIndex; // Index auf Basisdatei
FILE * fInputFile; // Eingabedatei
char * pInput; // Lesepuffer
sal_uInt32 nInputBufLen; // Laenge des Lesepuffers
@@ -55,20 +55,20 @@ class RscFileInst
sal_uInt32 nLineBufLen;//Lange des Zeilenpuffres
sal_uInt32 nScanPos; // Position in der Zeile
int cLastChar;
- BOOL bEof;
+ sal_Bool bEof;
public:
RscTypCont * pTypCont;
void Init(); // ctor initialisieren
- RscFileInst( RscTypCont * pTC, ULONG lIndexSrc,
- ULONG lFileIndex, FILE * fFile );
- RscFileInst( RscTypCont * pTC, ULONG lIndexSrc,
- ULONG lFileIndex, const ByteString & );
+ RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
+ sal_uLong lFileIndex, FILE * fFile );
+ RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
+ sal_uLong lFileIndex, const ByteString & );
~RscFileInst();
- BOOL IsEof() const { return bEof; }
- void SetFileIndex( ULONG lFIndex ) { lFileIndex = lFIndex; }
- ULONG GetFileIndex() { return( lFileIndex ); }
- ULONG GetSrcIndex() { return( lSrcIndex ); }
+ sal_Bool IsEof() const { return bEof; }
+ void SetFileIndex( sal_uLong lFIndex ) { lFileIndex = lFIndex; }
+ sal_uLong GetFileIndex() { return( lFileIndex ); }
+ sal_uLong GetSrcIndex() { return( lSrcIndex ); }
void SetLineNo( sal_uInt32 nLine ) { nLineNo = nLine; }
sal_uInt32 GetLineNo() { return( nLineNo ); }
sal_uInt32 GetScanPos() { return( nScanPos ); }
diff --git a/rsc/inc/rscrange.hxx b/rsc/inc/rscrange.hxx
index 48d0077e43c8..fc43ae88a388 100644
--- a/rsc/inc/rscrange.hxx
+++ b/rsc/inc/rscrange.hxx
@@ -39,36 +39,36 @@ class RscRange : public RscTop
protected:
struct RscRangeInst {
sal_uInt16 nValue; // nValue = Ausgangswert - nMin
- BOOL bDflt; // Ist Default
+ sal_Bool bDflt; // Ist Default
};
- INT32 nMin; // Minimum des Bereiches
- INT32 nMax; // Maximum des Bereiches
+ sal_Int32 nMin; // Minimum des Bereiches
+ sal_Int32 nMax; // Maximum des Bereiches
sal_uInt32 nSize;
public:
RscRange( Atom nId, sal_uInt32 nTypId );
virtual RSCCLASS_TYPE GetClassType() const;
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
// Der zulaessige Bereich wird gesetzt
- ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum );
+ ERRTYPE SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum );
// Gibt die Groesse der Klasse in Bytes
sal_uInt32 Size(){ return nSize; }
// Eine Zuweisung an eine Variable
virtual void SetToDefault( const RSCINST & rInst )
{
- ((RscRangeInst*)rInst.pData)->bDflt = TRUE;
+ ((RscRangeInst*)rInst.pData)->bDflt = sal_True;
}
- BOOL IsDefault( const RSCINST & rInst)
+ sal_Bool IsDefault( const RSCINST & rInst)
{
return( ((RscRangeInst*)rInst.pData)->bDflt );
};
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
- ERRTYPE SetNumber( const RSCINST &, INT32 );
- ERRTYPE GetNumber( const RSCINST &, INT32 * );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ ERRTYPE SetNumber( const RSCINST &, sal_Int32 );
+ ERRTYPE GetNumber( const RSCINST &, sal_Int32 * );
void WriteSrc( const RSCINST &, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
};
@@ -79,37 +79,37 @@ class RscLongRange : public RscTop
protected:
struct RscLongRangeInst
{
- INT32 nValue; // nValue = Ausgangswert - nMin
- BOOL bDflt; // Ist Default
+ sal_Int32 nValue; // nValue = Ausgangswert - nMin
+ sal_Bool bDflt; // Ist Default
};
- INT32 nMin; // Minimum des Bereiches
- INT32 nMax; // Maximum des Bereiches
+ sal_Int32 nMin; // Minimum des Bereiches
+ sal_Int32 nMax; // Maximum des Bereiches
sal_uInt32 nSize;
public:
RscLongRange( Atom nId, sal_uInt32 nTypId );
virtual RSCCLASS_TYPE GetClassType() const;
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
// Der zulaessige Bereich wird gesetzt
- ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum );
+ ERRTYPE SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum );
// Gibt die Groesse der Klasse in Bytes
sal_uInt32 Size(){ return nSize; }
// Eine Zuweisung an eine Variable
virtual void SetToDefault( const RSCINST & rInst )
{
- ((RscLongRangeInst*)rInst.pData)->bDflt = TRUE;
+ ((RscLongRangeInst*)rInst.pData)->bDflt = sal_True;
}
- BOOL IsDefault( const RSCINST & rInst)
+ sal_Bool IsDefault( const RSCINST & rInst)
{
return( ((RscLongRangeInst*)rInst.pData)->bDflt );
};
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
- ERRTYPE SetNumber( const RSCINST &, INT32 );
- ERRTYPE GetNumber( const RSCINST &, INT32 * );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ ERRTYPE SetNumber( const RSCINST &, sal_Int32 );
+ ERRTYPE GetNumber( const RSCINST &, sal_Int32 * );
void WriteSrc( const RSCINST &, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
@@ -122,7 +122,7 @@ public:
RscLongEnumRange( Atom nId, sal_uInt32 nTypId );
ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- INT32 nValue );
+ sal_Int32 nValue );
};
/******************* R s c I d R a n g e ***********************************/
@@ -130,41 +130,41 @@ class RscIdRange : public RscTop
{
sal_uInt32 nSize;
protected:
- INT32 nMin; // Minimum des Bereiches
- INT32 nMax; // Maximum des Bereiches
+ sal_Int32 nMin; // Minimum des Bereiches
+ sal_Int32 nMax; // Maximum des Bereiches
public:
RscIdRange( Atom nId, sal_uInt32 nTypId );
virtual RSCCLASS_TYPE GetClassType() const;
// Der zulaessige Bereich wird gesetzt
- ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum ){
+ ERRTYPE SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum ){
nMin = nMinimum;
nMax = nMaximum;
return ERR_OK;
}
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
void Destroy( const RSCINST & rInst );
sal_uInt32 Size(){ return nSize; }
virtual void SetToDefault( const RSCINST & rInst )
{
- ((RscId*)rInst.pData)->aExp.cUnused = TRUE;
+ ((RscId*)rInst.pData)->aExp.cUnused = sal_True;
}
- BOOL IsDefault( const RSCINST & rInst)
+ sal_Bool IsDefault( const RSCINST & rInst)
{
//cUnused wird fuer Defaultkennung verwendet
return ((RscId*)rInst.pData)->aExp.cUnused
- ? TRUE : FALSE;
+ ? sal_True : sal_False;
}
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
- ERRTYPE SetNumber( const RSCINST &, INT32 );
- ERRTYPE GetNumber( const RSCINST &, INT32 * );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ ERRTYPE SetNumber( const RSCINST &, sal_Int32 );
+ ERRTYPE GetNumber( const RSCINST &, sal_Int32 * );
ERRTYPE SetRef( const RSCINST &, const RscId & rRscId );
ERRTYPE GetRef( const RSCINST & rInst, RscId * );
void WriteSrc( const RSCINST &, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
- BOOL IsConsistent( const RSCINST & rInst );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
+ sal_Bool IsConsistent( const RSCINST & rInst );
void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
@@ -177,14 +177,14 @@ public:
RscBool( Atom nId, sal_uInt32 nTypId );
virtual RSCCLASS_TYPE GetClassType() const;
// Der zulaessige Bereich wird gesetzt
- ERRTYPE SetRange( INT32, INT32 ){
+ ERRTYPE SetRange( sal_Int32, sal_Int32 ){
return( ERR_UNKNOWN_METHOD );
};
- ERRTYPE SetBool( const RSCINST & rInst, BOOL b ){
- return( SetNumber( rInst, (INT32)b ) );
+ ERRTYPE SetBool( const RSCINST & rInst, sal_Bool b ){
+ return( SetNumber( rInst, (sal_Int32)b ) );
};
- ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB){
- INT32 l;
+ ERRTYPE GetBool( const RSCINST & rInst, sal_Bool * pB){
+ sal_Int32 l;
GetNumber( rInst, &l );
*pB = (0 != l);
return( ERR_OK );
@@ -197,14 +197,14 @@ public:
};
class RscBreakRange : public RscRange {
- INT32 nOutRange;
+ sal_Int32 nOutRange;
public:
RscBreakRange( Atom nId, sal_uInt32 nTypId );
- void SetOutRange( INT32 nNumber ){
+ void SetOutRange( sal_Int32 nNumber ){
nOutRange = nNumber;
}
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
- ERRTYPE SetNumber( const RSCINST &, INT32 );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
+ ERRTYPE SetNumber( const RSCINST &, sal_Int32 );
};
#endif // _RSCRANGE_HXX
diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index 9d92f90e48b5..367118858918 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -122,8 +122,8 @@ public:
ByteString GetTmpFileName(); // Die Dateien werden geloescht
// Include Statements lesen
- ERRTYPE IncludeParser( ULONG lFileKey );
- ERRTYPE ParseOneFile( ULONG lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
+ ERRTYPE IncludeParser( sal_uLong lFileKey );
+ ERRTYPE ParseOneFile( sal_uLong lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
ERRTYPE Link();
void EndCompile();
};
diff --git a/rsc/inc/rscstr.hxx b/rsc/inc/rscstr.hxx
index 3d3127f2ab5a..7df40992cdce 100644
--- a/rsc/inc/rscstr.hxx
+++ b/rsc/inc/rscstr.hxx
@@ -39,7 +39,7 @@ class RscString : public RscTop
RscTop * pRefClass;
struct RscStringInst {
char * pStr; // Zeiger auf String
- BOOL bDflt; // Ist Default
+ sal_Bool bDflt; // Ist Default
RscId aRefId; // ReferenzName
};
sal_uInt32 nSize;
@@ -51,20 +51,20 @@ public:
{
pRefClass = pClass;
};
- RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL );
+ RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
// Der zulaessige Bereich wird gesetzt
void Destroy( const RSCINST & rInst );
sal_uInt32 Size(){ return nSize; }
void SetToDefault( const RSCINST & rInst )
{
- ((RscStringInst*)rInst.pData)->bDflt = TRUE;
+ ((RscStringInst*)rInst.pData)->bDflt = sal_True;
}
- BOOL IsDefault( const RSCINST & rInst)
+ sal_Bool IsDefault( const RSCINST & rInst)
{
return( ((RscStringInst*)rInst.pData)->bDflt );
};
// Als Default setzen
- BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
ERRTYPE SetString( const RSCINST &, const char * pStr );
ERRTYPE GetString( const RSCINST &, char ** ppStr );
ERRTYPE GetRef( const RSCINST & rInst, RscId * );
@@ -72,7 +72,7 @@ public:
void WriteSrc( const RSCINST &, FILE * fOutput,
RscTypCont * pTC, sal_uInt32 nTab, const char * );
ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
const char * );
};
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx
index 5506412d42f6..b65207dafac3 100644
--- a/rsc/inc/rsctools.hxx
+++ b/rsc/inc/rsctools.hxx
@@ -49,8 +49,8 @@ enum RSCBYTEORDER_TYPE { RSC_BIGENDIAN, RSC_LITTLEENDIAN, RSC_SYSTEMENDIAN };
(nSize + sizeof( void * ) -1) / sizeof( void * ) * sizeof( void * )
/******************* F u n c t i o n F o r w a r d s *******************/
ByteString GetTmpFileName();
-BOOL Append( ByteString aDestFile, ByteString aSourceFile );
-BOOL Append( FILE * fDest, ByteString aSourceFile );
+sal_Bool Append( ByteString aDestFile, ByteString aSourceFile );
+sal_Bool Append( FILE * fDest, ByteString aSourceFile );
ByteString InputFile ( const char * pInput, const char * pExt );
ByteString OutputFile( ByteString aInput, const char * ext );
char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv,
@@ -70,7 +70,7 @@ typedef ::std::vector< ByteString* > RscStrList;
class RscChar
{
public:
- static char * MakeUTF8( char * pStr, UINT16 nTextEncoding );
+ static char * MakeUTF8( char * pStr, sal_uInt16 nTextEncoding );
};
/****************** R s c P t r P t r ************************************/
@@ -95,7 +95,7 @@ public:
class RscWriteRc
{
sal_uInt32 nLen;
- BOOL bSwap;
+ sal_Bool bSwap;
RSCBYTEORDER_TYPE nByteOrder;
char * pMem;
char * GetPointer( sal_uInt32 nSize );
@@ -181,7 +181,7 @@ public:
{ Put( (sal_uInt16)nValue ); }
void PutUTF8( char * pData );
- void PutAt( sal_uInt32 nPos, INT32 lVal )
+ void PutAt( sal_uInt32 nPos, sal_Int32 lVal )
{
union
{
@@ -203,7 +203,7 @@ public:
}
void PutAt( sal_uInt32 nPos, sal_uInt32 lVal )
{
- PutAt( nPos, (INT32)lVal);
+ PutAt( nPos, (sal_Int32)lVal);
}
void PutAt( sal_uInt32 nPos, short nVal )
{
diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx
index 777f45246aa8..77e32041ac8b 100644
--- a/rsc/inc/rsctop.hxx
+++ b/rsc/inc/rsctop.hxx
@@ -71,8 +71,8 @@ public:
sal_uInt32 GetTypId() const
{ return nTypId; };
// Gibt die Oberklasse zurueck
- BOOL InHierarchy( RscTop * pClass );
- BOOL IsCodeWriteable() const
+ sal_Bool InHierarchy( RscTop * pClass );
+ sal_Bool IsCodeWriteable() const
{
return( 0 != aCallParType.Len() );
}
@@ -115,7 +115,7 @@ public:
// pData, pClass im return koennen NULL sein
virtual RSCINST GetVariable( const RSCINST & rInst, Atom nVarName,
const RSCINST & rInitInst,
- BOOL nInitDflt = FALSE,
+ sal_Bool nInitDflt = sal_False,
RscTop * pCreateClass = NULL );
virtual RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName );
@@ -130,7 +130,7 @@ public:
// Liefert Instanz aus einem Feld zurueck
// pGetInst im return kann NULL sein
- virtual ERRTYPE GetValueEle( const RSCINST & rInst, INT32 lValue,
+ virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
RscTop * pCreateClass,
RSCINST * pGetInst );
@@ -162,45 +162,45 @@ public:
virtual sal_uInt32 GetCount( const RSCINST & rInst );
// Eine Zuweisung an eine Variable
- virtual ERRTYPE SetNumber( const RSCINST & rInst, INT32 lValue );
+ virtual ERRTYPE SetNumber( const RSCINST & rInst, sal_Int32 lValue );
// Eine Zuweisung an eine Variable
- virtual ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue );
+ virtual ERRTYPE SetBool( const RSCINST & rInst, sal_Bool bValue );
// Eine Zuweisung an eine Variable
virtual ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- INT32 nValue );
+ sal_Int32 nValue );
// Eine Zuweisung an eine Variable
virtual ERRTYPE SetNotConst( const RSCINST & rInst, Atom nId );
virtual ERRTYPE SetString( const RSCINST & rInst, const char * pStr );
- virtual ERRTYPE GetNumber( const RSCINST & rInst, INT32 * pN );
+ virtual ERRTYPE GetNumber( const RSCINST & rInst, sal_Int32 * pN );
- virtual ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB );
+ virtual ERRTYPE GetBool( const RSCINST & rInst, sal_Bool * pB );
virtual ERRTYPE GetConst( const RSCINST & rInst, Atom * pH );
virtual ERRTYPE GetString( const RSCINST & rInst, char ** ppStr );
virtual RSCINST Create( RSCINST * pInst,
- const RSCINST & rDefInst, BOOL bOwnClass = FALSE );
+ const RSCINST & rDefInst, sal_Bool bOwnClass = sal_False );
// Instanz zerstoeren
virtual void Destroy( const RSCINST & rInst );
// prueft auf konsistenz
- virtual BOOL IsConsistent( const RSCINST & rInst );
+ virtual sal_Bool IsConsistent( const RSCINST & rInst );
// Alles auf Default setzen
virtual void SetToDefault( const RSCINST & rInst );
// Ist Eingabe = Default
- virtual BOOL IsDefault( const RSCINST & rInst );
+ virtual sal_Bool IsDefault( const RSCINST & rInst );
// Gleiche Werte auf Default setzen
- virtual BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
+ virtual sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
// Instanz auf Default setzen
virtual void SetDefault( const RSCINST & rInst, Atom nVarId );
@@ -222,9 +222,9 @@ public:
RscTypCont * pTC, sal_uInt32 nTab,const char * );
virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, const RscId & aId,
- sal_uInt32 nDeep, BOOL bExtra );
+ sal_uInt32 nDeep, sal_Bool bExtra );
virtual ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra );
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra );
// Weiterleitung an Superklassen wird unterbunden
virtual ERRTYPE WriteHxxHeader( const RSCINST & rInst, FILE * fOutput,
diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx
index 0ab86dda7fca..0ff82212bbbf 100644
--- a/rsc/inc/rsctree.hxx
+++ b/rsc/inc/rsctree.hxx
@@ -71,15 +71,15 @@ public:
NameNode* Right() const{ return (NameNode *)pRight ; };
NameNode* Search( const NameNode * pName ) const;
// insert a new node in the b-tree
- BOOL Insert( NameNode * pTN, sal_uInt32 * nDepth );
- BOOL Insert( NameNode* pTN );
+ sal_Bool Insert( NameNode * pTN, sal_uInt32 * nDepth );
+ sal_Bool Insert( NameNode* pTN );
virtual COMPARE Compare( const NameNode * ) const;
virtual COMPARE Compare( const void * ) const;
NameNode* SearchParent( const NameNode * ) const;
// return ist neue Root
NameNode* Remove( NameNode * );
void OrderTree();
- BOOL IsOrderTree() const;
+ sal_Bool IsOrderTree() const;
};
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index d529a70c6d64..6e3ae27eeae0 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -31,158 +31,15 @@
#include <sal/types.h>
#include <tools/solar.h>
-
-// ---------------
-// - Window-Bits -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-typedef sal_Int64 WinBits;
-
-// Window-Bits fuer Window
-#define WB_CLIPCHILDREN ((WinBits)0x00000001)
-#define WB_DIALOGCONTROL ((WinBits)0x00000002)
-#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
-#define WB_BORDER ((WinBits)0x00000008)
-#define WB_NOBORDER ((WinBits)0x00000010)
-#define WB_SIZEABLE ((WinBits)0x00000020)
-#define WB_3DLOOK ((WinBits)0x00000040)
-#define WB_AUTOSIZE ((WinBits)0x00000080)
-
-// Window-Bits fuer SystemWindows
-#define WB_MOVEABLE ((WinBits)0x00000100)
-#define WB_ROLLABLE ((WinBits)0x00000200)
-#define WB_CLOSEABLE ((WinBits)0x00000400)
-#define WB_STANDALONE ((WinBits)0x00000800)
-#define WB_APP ((WinBits)0x00001000)
-#define WB_PINABLE ((WinBits)0x00002000)
-#define WB_SYSTEMWINDOW ((WinBits)0x40000000)
-#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
-
-// Standard-Window-Bits fuer ChildWindows
-#define WB_TABSTOP ((WinBits)0x00000100)
-#define WB_NOTABSTOP ((WinBits)0x00000200)
-#define WB_GROUP ((WinBits)0x00000400)
-#define WB_NOGROUP ((WinBits)0x00000800)
-#define WB_HORZ ((WinBits)0x00001000)
-#define WB_VERT ((WinBits)0x00002000)
-#define WB_LEFT ((WinBits)0x00004000)
-#define WB_CENTER ((WinBits)0x00008000)
-#define WB_RIGHT ((WinBits)0x00010000)
-#define WB_TOP ((WinBits)0x00020000)
-#define WB_VCENTER ((WinBits)0x00040000)
-#define WB_BOTTOM ((WinBits)0x00080000)
-#define WB_DRAG ((WinBits)0x00100000)
-#define WB_SPIN ((WinBits)0x00200000)
-#define WB_REPEAT ((WinBits)0x00400000)
-#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
-#define WB_WORDBREAK ((WinBits)0x01000000)
-#define WB_NOLABEL ((WinBits)0x02000000)
-#define WB_SORT ((WinBits)0x04000000)
-#define WB_DROPDOWN ((WinBits)0x08000000)
-#define WB_AUTOHSCROLL ((WinBits)0x10000000)
-#define WB_DOCKABLE ((WinBits)0x20000000)
-#define WB_AUTOVSCROLL ((WinBits)0x40000000)
-
-#define WB_HIDE ((WinBits)0x80000000)
+#include <tools/wintypes.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/mapunit.hxx>
// system floating window
#define WB_POPUP ((WinBits)0x20000000)
-#define WB_HSCROLL WB_HORZ
-#define WB_VSCROLL WB_VERT
-#define WB_TOPIMAGE WB_TOP
-
-// Window-Bits for PushButtons
-#define WB_DEFBUTTON ((WinBits)0x10000000)
-#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
-#define WB_RECTSTYLE ((WinBits)0x08000000)
-#define WB_SMALLSTYLE ((WinBits)0x04000000)
-
-// Window-Bits for FixedText
-#define WB_INFO ((WinBits)0x20000000)
-#define WB_PATHELLIPSIS ((WinBits)0x00100000)
-
-// Window-Bits for Edit
-#define WB_PASSWORD ((WinBits)0x01000000)
-#define WB_READONLY ((WinBits)0x02000000)
-#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
-
-// Window-Bits for MultiLineEdit
-#define WB_IGNORETAB ((WinBits)0x20000000)
-
-// Window-Bits for ListBox and MultiListBox
-#define WB_SIMPLEMODE ((WinBits)0x20000000)
-
-// Window-Bits for FixedBitmap
-#define WB_FAST ((WinBits)0x04000000)
-#define WB_SCALE ((WinBits)0x08000000)
-#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
-
-// Window-Bits for ToolBox
-#define WB_LINESPACING ((WinBits)0x01000000)
-#define WB_SCROLL ((WinBits)0x02000000)
-
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
-// Window-Bits for DockingWindows
-#define WB_DOCKBORDER ((WinBits)0x00001000)
-
-// Window-Bits for SplitWindow
-#define WB_NOSPLITDRAW ((WinBits)0x01000000)
-#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
-
-// Window-Bits for MessageBoxen
-#define WB_OK ((WinBits)0x00100000)
-#define WB_OK_CANCEL ((WinBits)0x00200000)
-#define WB_YES_NO ((WinBits)0x00400000)
-#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
-#define WB_RETRY_CANCEL ((WinBits)0x01000000)
-#define WB_DEF_OK ((WinBits)0x02000000)
-#define WB_DEF_CANCEL ((WinBits)0x04000000)
-#define WB_DEF_RETRY ((WinBits)0x08000000)
-#define WB_DEF_YES ((WinBits)0x10000000)
-#define WB_DEF_NO ((WinBits)0x20000000)
-#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Standard-WinBits
-#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
-#define WB_STDMDI (WB_CLOSEABLE)
-#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
-#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDMODELESS (WB_STDDIALOG)
-#define WB_STDMODAL (WB_STDDIALOG)
-#define WB_STDTABDIALOG (WB_STDDIALOG)
-#define WB_STDTABCONTROL 0
#define WB_STDPOPUP (WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL)
-// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
-
-// --------------
-// - Help-Types -
-// --------------
-
-// from vcl/inc/help.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
-
-// --------------
-// - FieldTypes -
-// --------------
-
-// from vcl/inc/fldunit.hxx
-enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
- FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
- FUNIT_PERCENT, FUNIT_100TH_MM };
-
-
// from vcl/inc/vclenum.hxx
#ifndef ENUM_TIMEFIELDFORMAT_DECLARED
#define ENUM_TIMEFIELDFORMAT_DECLARED
@@ -221,25 +78,6 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE,
#endif
-// ------------
-// - TriState -
-// ------------
-
-// from vcl/inc/wintypes.hxx
-enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
-
-// -----------------
-// - MapMode-Types -
-// -----------------
-
-// from vcl/inc/mapmod.hxx
-enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
- MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
- MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
- MAP_RELATIVE, MAP_REALAPPFONT };
-
-// Das Resourcesystem benutzt den Wert 0xFFFF (freihalten)
-
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -276,14 +114,6 @@ typedef sal_uInt16 WindowBorderStyle;
#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010)
#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000)
-// ---------------
-// - WindowAlign -
-// ---------------
-
-// from vcl/inc/wintypes.hxx
-enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
-enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM };
-
// --------------
// - Menu-Types -
// --------------
@@ -342,9 +172,6 @@ typedef sal_uInt16 SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/rsc/prj/d.lst b/rsc/prj/d.lst
index e59c9b2e9f3a..e79c03d9bb63 100644
--- a/rsc/prj/d.lst
+++ b/rsc/prj/d.lst
@@ -6,4 +6,4 @@
..\%__SRC%\bin\rscpp %_DEST%\bin%_EXT%\rscpp
mkdir: %_DEST%\inc%_EXT%\rsc
-..\inc\rscsfx.hxx %_DEST%\inc%_EXT%\rsc\rscsfx.hxx
+..\inc\rsc/rscsfx.hxx %_DEST%\inc%_EXT%\rsc\rscsfx.hxx
diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx
index 127a4d38a0e8..5e6faeb47c22 100644
--- a/rsc/source/misc/rscdbl.cxx
+++ b/rsc/source/misc/rscdbl.cxx
@@ -77,7 +77,7 @@ void FillSubList( RSCINST & rInst, REResourceList * pList )
}
void FillListObj( ObjNode * pObjNode, RscTop * pRscTop,
- REResourceList * pList, ULONG lFileKey )
+ REResourceList * pList, sal_uLong lFileKey )
{
if( pObjNode ){
if( pObjNode->GetFileKey() == lFileKey ){
@@ -100,7 +100,7 @@ void FillListObj( ObjNode * pObjNode, RscTop * pRscTop,
};
}
-void FillList( RscTop * pRscTop, REResourceList * pList, ULONG lFileKey ){
+void FillList( RscTop * pRscTop, REResourceList * pList, sal_uLong lFileKey ){
if( pRscTop ){
FillList( (RscTop*)pRscTop->Left(), pList, lFileKey );
@@ -110,7 +110,7 @@ void FillList( RscTop * pRscTop, REResourceList * pList, ULONG lFileKey ){
};
}
-void RscTypCont::FillNameIdList( REResourceList * pList, ULONG lFileKey ){
+void RscTypCont::FillNameIdList( REResourceList * pList, sal_uLong lFileKey ){
FillList( pRoot, pList, lFileKey );
}
diff --git a/rsc/source/misc/rsclst.cxx b/rsc/source/misc/rsclst.cxx
index 422ed80c489f..132b0ae1bcd3 100644
--- a/rsc/source/misc/rsclst.cxx
+++ b/rsc/source/misc/rsclst.cxx
@@ -33,13 +33,13 @@
REResourceList :: REResourceList()
{
- bVisible = FALSE;
+ bVisible = sal_False;
pParent = NULL;
}
REResourceList :: REResourceList( REResourceList* pParentList,
ByteString& rClassName,
- const RscId & rResourceID, BOOL bVis )
+ const RscId & rResourceID, sal_Bool bVis )
{
pParent = pParentList;
aClassName = rClassName;
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index 0b9f6e13e9d1..23337514b2c5 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -77,10 +77,8 @@ void RscError::StdOut( const char * pStr, const RscVerbosity _verbosityLevel )
*************************************************************************/
void RscError::StdErr( const char * pStr )
{
-#ifndef WIN
if( pStr )
fprintf( stderr, "%s", pStr );
-#endif
}
/*************************************************************************
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 8a0c7e517c01..a71b4a51eea2 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -64,9 +64,9 @@ RscTypCont :: RscTypCont( RscError * pErrHdl,
nSourceCharSet( RTL_TEXTENCODING_UTF8 ),
nByteOrder( nOrder ),
aSearchPath( rSearchPath ),
- aBool( pHS->getID( "BOOL" ), RSC_NOTYPE ),
+ aBool( pHS->getID( "sal_Bool" ), RSC_NOTYPE ),
aShort( pHS->getID( "short" ), RSC_NOTYPE ),
- aUShort( pHS->getID( "USHORT" ), RSC_NOTYPE ),
+ aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE ),
aLong( pHS->getID( "long" ), RSC_NOTYPE ),
aEnumLong( pHS->getID( "enum_long" ), RSC_NOTYPE ),
aIdUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE ),
@@ -80,6 +80,7 @@ RscTypCont :: RscTypCont( RscError * pErrHdl,
a0to9999Short( pHS->getID( "YearShort" ), RSC_NOTYPE ),
aIdLong( pHS->getID( "IDLONG" ), RSC_NOTYPE ),
aString( pHS->getID( "Chars" ), RSC_NOTYPE ),
+ aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ),
aWinBits( pHS->getID( "WinBits" ), RSC_NOTYPE ),
aLangType(),
aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ),
@@ -124,7 +125,7 @@ static sal_uInt32 getLangIdAndShortenLocale( RscTypCont* pTypCont,
else
rLang = rtl::OString();
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, " %s (0x%hx)", aL.getStr(), nRet );
+ fprintf( stderr, " %s (0x%hx)", aL.getStr(), (int)nRet );
#endif
return nRet;
}
@@ -368,17 +369,17 @@ void RscTypCont :: Delete( Atom nRT, const RscId & rId ){
|*
*************************************************************************/
sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
- sal_uInt32 nConst, sal_uInt32 nId, BOOL bFirst )
+ sal_uInt32 nConst, sal_uInt32 nId, sal_Bool bFirst )
{
RscSysEntry *pSysEntry;
RscSysEntry *pFoundEntry = NULL;
- BOOL bId1 = FALSE;
+ sal_Bool bId1 = sal_False;
for ( size_t i = 0, n = aSysLst.size(); i < n; ++i )
{
pSysEntry = aSysLst[ i ];
if( pSysEntry->nKey == 1 )
- bId1 = TRUE;
+ bId1 = sal_True;
if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) )
if( pSysEntry->nRscTyp == nRscTyp
&& pSysEntry->nTyp == nConst
@@ -415,7 +416,7 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
|* RscTypCont :: WriteInc
|*
*************************************************************************/
-void RscTypCont :: WriteInc( FILE * fOutput, ULONG lFileKey )
+void RscTypCont :: WriteInc( FILE * fOutput, sal_uLong lFileKey )
{
RscFile * pFName;
@@ -472,7 +473,7 @@ private:
ERRTYPE aError; // Enthaelt den ersten Fehler
RscTypCont* pTypCont;
FILE * fOutput; // AusgabeDatei
- ULONG lFileKey; // Welche src-Datei
+ sal_uLong lFileKey; // Welche src-Datei
RscTop * pClass;
DECL_LINK( CallBackWriteRc, ObjNode * );
@@ -520,7 +521,7 @@ IMPL_LINK( RscEnumerateObj, CallBackWriteRc, ObjNode *, pObjNode )
aError = pClass->WriteRcHeader( RSCINST( pClass, pObjNode->GetRscObj() ),
aMem, pTypCont,
- pObjNode->GetRscId(), 0, TRUE );
+ pObjNode->GetRscId(), 0, sal_True );
if( aError.IsError() || aError.IsWarning() )
pTypCont->pEH->Error( aError, pClass, pObjNode->GetRscId() );
@@ -599,18 +600,18 @@ void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ){
if( nRT == RSC_VERSIONCONTROL )
{ // kommt immmer als letztes
- INT32 nCount = pTypCont->aIdTranslator.size();
+ sal_Int32 nCount = pTypCont->aIdTranslator.size();
// groesse der Tabelle
- UINT32 nSize = (nCount * (sizeof(sal_uInt64)+sizeof(INT32))) + sizeof(INT32);
+ sal_uInt32 nSize = (nCount * (sizeof(sal_uInt64)+sizeof(sal_Int32))) + sizeof(sal_Int32);
rMem.Put( nCount ); //Anzahl speichern
- for( std::map< sal_uInt64, ULONG >::const_iterator it =
+ for( std::map< sal_uInt64, sal_uLong >::const_iterator it =
pTypCont->aIdTranslator.begin(); it != pTypCont->aIdTranslator.end(); ++it )
{
// Schluessel schreiben
rMem.Put( it->first );
// Objekt Id oder Position schreiben
- rMem.Put( (INT32)it->second );
+ rMem.Put( (sal_Int32)it->second );
}
rMem.Put( nSize ); // Groesse hinten Speichern
}
@@ -652,7 +653,7 @@ public:
return aEnumObj.aError;
};
- ERRTYPE WriteSrc( ULONG lFileKey )
+ ERRTYPE WriteSrc( sal_uLong lFileKey )
{
aEnumObj.lFileKey = lFileKey;
@@ -661,7 +662,7 @@ public:
return aEnumObj.aError;
}
- ERRTYPE WriteCxx( ULONG lFileKey )
+ ERRTYPE WriteCxx( sal_uLong lFileKey )
{
aEnumObj.lFileKey = lFileKey;
@@ -670,7 +671,7 @@ public:
return aEnumObj.aError;
}
- ERRTYPE WriteHxx( ULONG lFileKey )
+ ERRTYPE WriteHxx( sal_uLong lFileKey )
{
aEnumObj.lFileKey = lFileKey;
@@ -755,7 +756,7 @@ ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext )
// version control
RscWriteRc aMem( nByteOrder );
- aVersion.pClass->WriteRcHeader( aVersion, aMem, this, RscId( RSCVERSION_ID ), 0, TRUE );
+ aVersion.pClass->WriteRcHeader( aVersion, aMem, this, RscId( RSCVERSION_ID ), 0, sal_True );
aEnumRef.aEnumObj.WriteRcFile( aMem, rContext.fOutput );
return aError;
@@ -766,8 +767,8 @@ ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext )
|* RscTypCont :: WriteSrc
|*
*************************************************************************/
-void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey,
- CharSet /*nCharSet*/, BOOL bName )
+void RscTypCont :: WriteSrc( FILE * fOutput, sal_uLong nFileKey,
+ CharSet /*nCharSet*/, sal_Bool bName )
{
RscFile * pFName;
RscEnumerateRef aEnumRef( this, pRoot, fOutput );
@@ -799,7 +800,7 @@ void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey,
}
else
{
- RscId::SetNames( FALSE );
+ RscId::SetNames( sal_False );
if( NOFILE_INDEX == nFileKey )
{
pFName = aFileTab.First();
@@ -820,7 +821,7 @@ void RscTypCont :: WriteSrc( FILE * fOutput, ULONG nFileKey,
|* RscTypCont :: WriteHxx
|*
*************************************************************************/
-ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey )
+ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, sal_uLong nFileKey )
{
fprintf( fOutput, "#include <tools/rc.hxx>\n" );
fprintf( fOutput, "#include <tools/resid.hxx>\n" );
@@ -836,7 +837,7 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey )
fprintf( fOutput, "#include <vcl/fixed.hxx>\n" );
fprintf( fOutput, "#include <vcl/group.hxx>\n" );
fprintf( fOutput, "#include <vcl/image.hxx>\n" );
- fprintf( fOutput, "#include <vcl/imagebtn.hxx>\n" );
+ fprintf( fOutput, "#include <vcl/button.hxx>\n" );
fprintf( fOutput, "#include <vcl/keycod.hxx>\n" );
fprintf( fOutput, "#include <vcl/lstbox.hxx>\n" );
fprintf( fOutput, "#include <vcl/mapmod.hxx>\n" );
@@ -882,7 +883,7 @@ ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, ULONG nFileKey )
|* RscTypCont :: WriteCxx
|*
*************************************************************************/
-ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, ULONG nFileKey,
+ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, sal_uLong nFileKey,
const ByteString & rHxxName )
{
RscEnumerateRef aEnumRef( this, pRoot, fOutput );
@@ -940,14 +941,14 @@ void RscTypCont::WriteRcCtor
*************************************************************************/
class RscDel
{
- ULONG lFileKey;
+ sal_uLong lFileKey;
DECL_LINK( Delete, RscTop * );
public:
- RscDel( RscTop * pRoot, ULONG lKey );
+ RscDel( RscTop * pRoot, sal_uLong lKey );
};
-inline RscDel::RscDel( RscTop * pRoot, ULONG lKey )
+inline RscDel::RscDel( RscTop * pRoot, sal_uLong lKey )
{
lFileKey = lKey;
pRoot->EnumNodes( LINK( this, RscDel, Delete ) );
@@ -961,7 +962,7 @@ IMPL_LINK_INLINE_START( RscDel, Delete, RscTop *, pNode )
}
IMPL_LINK_INLINE_END( RscDel, Delete, RscTop *, pNode )
-void RscTypCont :: Delete( ULONG lFileKey ){
+void RscTypCont :: Delete( sal_uLong lFileKey ){
// Resourceinstanzen loeschen
RscDel aDel( pRoot, lFileKey );
// Defines loeschen
@@ -973,54 +974,54 @@ void RscTypCont :: Delete( ULONG lFileKey ){
|* RscTypCont :: MakeConsistent()
|*
*************************************************************************/
-BOOL IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop )
+sal_Bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pObjNode ){
RSCINST aTmpI;
if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop ) )
- bRet = FALSE;
+ bRet = sal_False;
aTmpI.pClass = pRscTop;
aTmpI.pData = pObjNode->GetRscObj();
if( ! aTmpI.pClass->IsConsistent( aTmpI ) )
- bRet = FALSE;
+ bRet = sal_False;
if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop ) )
- bRet = FALSE;
+ bRet = sal_False;
};
return( bRet );
}
-BOOL MakeConsistent( RscTop * pRscTop )
+sal_Bool MakeConsistent( RscTop * pRscTop )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pRscTop ){
if( ! ::MakeConsistent( (RscTop*)pRscTop->Left() ) )
- bRet = FALSE;
+ bRet = sal_False;
if( pRscTop->GetObjNode() ){
if( ! pRscTop->GetObjNode()->IsConsistent() ){
pRscTop->GetObjNode()->OrderTree();
if( ! pRscTop->GetObjNode()->IsConsistent() )
- bRet = FALSE;
+ bRet = sal_False;
}
if( ! IsInstConsistent( pRscTop->GetObjNode(), pRscTop ) )
- bRet = FALSE;
+ bRet = sal_False;
}
if( ! ::MakeConsistent( (RscTop*)pRscTop->Right() ) )
- bRet = FALSE;
+ bRet = sal_False;
};
return bRet;
}
-BOOL RscTypCont :: MakeConsistent(){
+sal_Bool RscTypCont :: MakeConsistent(){
return( ::MakeConsistent( pRoot ) );
}
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 1acd8abc3bf8..f2456cfca257 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -53,7 +53,7 @@
#include <boost/unordered_map.hpp>
/****************** M A C R O S ******************************************/
-void RscTypCont::SETCONST( RscConst * pClass, const char * szString, UINT32 nVal )
+void RscTypCont::SETCONST( RscConst * pClass, const char * szString, sal_uInt32 nVal )
{
#if OSL_DEBUG_LEVEL > 2
fprintf( stderr, "setconst : %s\n", szString );
@@ -62,7 +62,7 @@ void RscTypCont::SETCONST( RscConst * pClass, const char * szString, UINT32 nVal
CONSTNAME, nVal ), nVal );
}
-void RscTypCont::SETCONST( RscConst * pClass, Atom nName, UINT32 nVal )
+void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal )
{
#if OSL_DEBUG_LEVEL > 2
fprintf( stderr, "setconst hash: %u\n", (unsigned int)nName );
@@ -103,7 +103,7 @@ void RscLangEnum::Init( RscNameTable& rNames )
while ( NULL != ( pLangEntry = MsLangId::getIsoLangEntry( nIndex )) && ( pLangEntry->mnLang != LANGUAGE_DONTKNOW ))
{
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "ISO Language in : %d %d %s\n",
+ fprintf( stderr, "ISO Language in : %d\n",
(int)nIndex,
pLangEntry->mnLang,
MsLangId::convertLanguageToIsoByteString( pLangEntry->mnLang ).getStr() );
@@ -201,7 +201,7 @@ Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
mnLangId++;
}
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "AddLanguage( %s ) = 0x%lx\n", pLang, nResult );
+ fprintf( stderr, "AddLanguage( %s ) = %d\n", pLang, nResult );
#endif
return nResult;
}
@@ -460,12 +460,12 @@ RscEnum * RscTypCont::InitMessButtons()
{
RscEnum * pMessButtons;
pMessButtons = new RscEnum( pHS->getID( "EnumMessButtons" ), RSC_NOTYPE );
- SETCONST( pMessButtons, "WB_OK", sal::static_int_cast<UINT32>(WB_OK) );
- SETCONST( pMessButtons, "WB_OK_CANCEL", sal::static_int_cast<UINT32>(WB_OK_CANCEL) );
- SETCONST( pMessButtons, "WB_YES_NO", sal::static_int_cast<UINT32>(WB_YES_NO) );
- SETCONST( pMessButtons, "WB_YES_NO_CANCEL", sal::static_int_cast<UINT32>(WB_YES_NO_CANCEL) );
- SETCONST( pMessButtons, "WB_RETRY_CANCEL", sal::static_int_cast<UINT32>(WB_RETRY_CANCEL) );
- SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE", sal::static_int_cast<UINT32>(WB_ABORT_RETRY_IGNORE) );
+ SETCONST( pMessButtons, "WB_OK", sal::static_int_cast<sal_uInt32>(WB_OK) );
+ SETCONST( pMessButtons, "WB_OK_CANCEL", sal::static_int_cast<sal_uInt32>(WB_OK_CANCEL) );
+ SETCONST( pMessButtons, "WB_YES_NO", sal::static_int_cast<sal_uInt32>(WB_YES_NO) );
+ SETCONST( pMessButtons, "WB_YES_NO_CANCEL", sal::static_int_cast<sal_uInt32>(WB_YES_NO_CANCEL) );
+ SETCONST( pMessButtons, "WB_RETRY_CANCEL", sal::static_int_cast<sal_uInt32>(WB_RETRY_CANCEL) );
+ SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE", sal::static_int_cast<sal_uInt32>(WB_ABORT_RETRY_IGNORE) );
return( pMessButtons );
}
@@ -479,12 +479,12 @@ RscEnum * RscTypCont::InitMessDefButton(){
pMessDefButton = new RscEnum( pHS->getID( "EnumMessDefButton" ),
RSC_NOTYPE );
- SETCONST( pMessDefButton, "WB_DEF_OK", sal::static_int_cast<UINT32>(WB_DEF_OK) );
- SETCONST( pMessDefButton, "WB_DEF_CANCEL", sal::static_int_cast<UINT32>(WB_DEF_CANCEL) );
- SETCONST( pMessDefButton, "WB_DEF_RETRY", sal::static_int_cast<UINT32>(WB_DEF_RETRY) );
- SETCONST( pMessDefButton, "WB_DEF_YES", sal::static_int_cast<UINT32>(WB_DEF_YES) );
- SETCONST( pMessDefButton, "WB_DEF_NO", sal::static_int_cast<UINT32>(WB_DEF_NO) );
- SETCONST( pMessDefButton, "WB_DEF_IGNORE", sal::static_int_cast<UINT32>(WB_DEF_IGNORE) );
+ SETCONST( pMessDefButton, "WB_DEF_OK", sal::static_int_cast<sal_uInt32>(WB_DEF_OK) );
+ SETCONST( pMessDefButton, "WB_DEF_CANCEL", sal::static_int_cast<sal_uInt32>(WB_DEF_CANCEL) );
+ SETCONST( pMessDefButton, "WB_DEF_RETRY", sal::static_int_cast<sal_uInt32>(WB_DEF_RETRY) );
+ SETCONST( pMessDefButton, "WB_DEF_YES", sal::static_int_cast<sal_uInt32>(WB_DEF_YES) );
+ SETCONST( pMessDefButton, "WB_DEF_NO", sal::static_int_cast<sal_uInt32>(WB_DEF_NO) );
+ SETCONST( pMessDefButton, "WB_DEF_IGNORE", sal::static_int_cast<sal_uInt32>(WB_DEF_IGNORE) );
return( pMessDefButton );
}
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index d9210049ac9d..072f1f085649 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -41,7 +41,7 @@
#include <rscclass.hxx>
#include <rsccont.hxx>
#include <rscdb.hxx>
-#include <rscsfx.hxx>
+#include <rsc/rscsfx.hxx>
#include "rsclex.hxx"
#include <yyrscyacc.hxx>
@@ -56,7 +56,7 @@ void RscTypCont::InsWinBit( RscTop * pClass, const ByteString & rName,
// Clientvariablen einfuegen
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, &aWinBits, nVal )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, &aWinBits, nVal )
);
Atom nId = aNmTb.Put( rName.GetBuffer(), VARNAME );
pClass->SetVariable( nId, pClient, NULL,
@@ -75,7 +75,7 @@ RscTop * RscTypCont::InitClassMgr()
RscBaseCont * pClass;
Atom nId;
- aBaseLst.push_back( pClass = new RscBaseCont( InvalidAtom, RSC_NOTYPE, NULL, FALSE ) );
+ aBaseLst.push_back( pClass = new RscBaseCont( InvalidAtom, RSC_NOTYPE, NULL, sal_False ) );
nId = pHS->getID( "Resource" );
pClassMgr = new RscMgr( nId, RSC_RESOURCE, pClass );
@@ -213,7 +213,7 @@ RscTop * RscTypCont::InitClassImageList( RscTop * pSuper, RscTop * /*pClassBitma
pClassImageList->SetVariable( nId, pClassColor, NULL,
VAR_SVDYNAMIC, RSC_IMAGELIST_MASKCOLOR );
- RscCont * pCont = new RscCont( pHS->getID( "USHORT *" ), RSC_NOTYPE );
+ RscCont * pCont = new RscCont( pHS->getID( "sal_uInt16 *" ), RSC_NOTYPE );
pCont->SetTypeClass( &aIdUShort );
aBaseLst.push_back( pCont );
nId = aNmTb.Put( "IdList", VARNAME );
@@ -264,14 +264,14 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
VAR_HIDDEN | VAR_NOENUM );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nDisableId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nDisableId )
);
nId = aNmTb.Put( "Disable", VARNAME );
pClassWindow->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nOutputSizeId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nOutputSizeId )
);
nId = aNmTb.Put( "OutputSize", VARNAME );
pClassWindow->SetVariable( nId, pClient, NULL,
@@ -288,7 +288,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
InsWinBit( pClassWindow, "DialogControl", nTabControlId );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassWindow->SetVariable( nId, &aIdLong );
+ pClassWindow->SetVariable( nId, &aStringLiteral, NULL, 0, WINDOW_HELPID );
nRsc_XYMAPMODEId = nId = aNmTb.Put( "_XYMapMode", VARNAME );
@@ -316,7 +316,7 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
nId = aNmTb.Put( "ExtraLong", VARNAME );
pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_EXTRALONG );
nId = aNmTb.Put( "UniqueId", VARNAME );
- pClassWindow->SetVariable( nId, &aLong, NULL, 0, WINDOW_UNIQUEID );
+ pClassWindow->SetVariable( nId, &aString, NULL, 0, WINDOW_UNIQUEID );
// BorderStyle
RscEnum* pBorderStyleEnum = new RscEnum( pHS->getID( "WindowBorderStyle" ), RSC_NOTYPE );
@@ -688,7 +688,7 @@ RscTop * RscTypCont::InitClassScrollBar( RscTop * pSuper )
{
RSCINST aDfltI;
- aDfltI = aShort.Create( NULL, RSCINST(), FALSE );
+ aDfltI = aShort.Create( NULL, RSCINST(), sal_False );
aDfltI.pClass->SetNumber( aDfltI, 100 );
// aDfltI.pClass->MakeDefault( aDfltI );
@@ -700,7 +700,7 @@ RscTop * RscTypCont::InitClassScrollBar( RscTop * pSuper )
{
RSCINST aDfltI;
- aDfltI = aShort.Create( NULL, RSCINST(), FALSE );
+ aDfltI = aShort.Create( NULL, RSCINST(), sal_False );
aDfltI.pClass->SetNumber( aDfltI, 1 );
// aDfltI.pClass->MakeDefault( aDfltI );
@@ -710,7 +710,7 @@ RscTop * RscTypCont::InitClassScrollBar( RscTop * pSuper )
{
RSCINST aDfltI;
- aDfltI = aShort.Create( NULL, RSCINST(), FALSE );
+ aDfltI = aShort.Create( NULL, RSCINST(), sal_False );
aDfltI.pClass->SetNumber( aDfltI, 1 );
// aDfltI.pClass->MakeDefault( aDfltI );
nId = aNmTb.Put( "LineSize", VARNAME );
@@ -750,8 +750,8 @@ RscTop * RscTypCont::InitClassListBox( RscTop * pSuper, RscArray * pStrLst )
INS_WINBIT(pClassListBox,DDExtraWidth)
{
- RSCINST aDflt = aUShort.Create( NULL, RSCINST(), FALSE );
- aDflt.pClass->SetNumber( aDflt, (USHORT)0xFFFF );
+ RSCINST aDflt = aUShort.Create( NULL, RSCINST(), sal_False );
+ aDflt.pClass->SetNumber( aDflt, (sal_uInt16)0xFFFF );
nId = aNmTb.Put( "CurPos", VARNAME );
pClassListBox->SetVariable( nId, &aUShort, &aDflt );
}
@@ -968,14 +968,14 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey )
// Clientvariablen einfuegen
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nShiftId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nShiftId )
);
nId = aNmTb.Put( "Shift", VARNAME );
pClassKeyCode->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nMod1Id )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nMod1Id )
);
nId = aNmTb.Put( "Modifier1", VARNAME );
pClassKeyCode->SetVariable( nId, pClient, NULL,
@@ -983,7 +983,7 @@ RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey )
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nMod2Id )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nMod2Id )
);
nId = aNmTb.Put( "Modifier2", VARNAME );
pClassKeyCode->SetVariable( nId, pClient, NULL,
@@ -1129,35 +1129,35 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
// Clientvariablen einfuegen
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nCheckableId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nCheckableId )
);
nId = aNmTb.Put( "Checkable", VARNAME );
pClassMenuItem->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nAutoCheckId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAutoCheckId )
);
nId = aNmTb.Put( "AutoCheck", VARNAME );
pClassMenuItem->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nRadioCheckId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nRadioCheckId )
);
nId = aNmTb.Put( "RadioCheck", VARNAME );
pClassMenuItem->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nAboutId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nAboutId )
);
nId = aNmTb.Put( "About", VARNAME );
pClassMenuItem->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, nHelpId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, nHelpId )
);
nId = aNmTb.Put( "Help", VARNAME );
pClassMenuItem->SetVariable( nId, pClient, NULL,
@@ -1174,7 +1174,7 @@ RscTop * RscTypCont::InitClassMenuItem( RscTop * pSuper,
pClassMenuItem->SetVariable( nId, &aLangString, NULL, 0,
RSC_MENUITEM_HELPTEXT );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMenuItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassMenuItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_MENUITEM_HELPID );
nId = aNmTb.Put( "AccelKey", VARNAME );
pClassMenuItem->SetVariable( nId, pClassKeyCode, NULL, 0,
@@ -1247,7 +1247,7 @@ RscTop * RscTypCont::InitClassMessBox( RscTop * pSuper,
nId = aNmTb.Put( "DefButton", VARNAME );
pClassMessBox->SetVariable( nId, pMessDefButton );
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassMessBox->SetVariable( nId, &aIdLong );
+ pClassMessBox->SetVariable( nId, &aStringLiteral );
nId = aNmTb.Put( "SysModal", VARNAME );
pClassMessBox->SetVariable( nId, &aBool );
nId = aNmTb.Put( "Title", VARNAME );
@@ -1946,43 +1946,43 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
// Clientvariablen einfuegen
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nCheckableId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nCheckableId )
);
nId = aNmTb.Put( "Checkable", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nAutoCheckId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoCheckId )
);
nId = aNmTb.Put( "AutoCheck", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nRadioCheckId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nRadioCheckId )
);
nId = aNmTb.Put( "RadioCheck", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nLeftId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nLeftId )
);
nId = aNmTb.Put( "Left", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nAutoSizeId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoSizeId )
);
nId = aNmTb.Put( "AutoSize", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, pFlag, l_nDropDownId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nDropDownId )
);
nId = aNmTb.Put( "DropDown", VARNAME );
pClassToolBoxItem->SetVariable( nId, pClient, NULL, VAR_NODATAINST, 0, l_nVarId );
}
nId = aNmTb.Put( "HelpID", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aIdLong, NULL, 0,
+ pClassToolBoxItem->SetVariable( nId, &aStringLiteral, NULL, 0,
RSC_TOOLBOXITEM_HELPID );
nId = aNmTb.Put( "Text", VARNAME );
pClassToolBoxItem->SetVariable( nId, &aLangString, NULL, 0,
@@ -2239,7 +2239,6 @@ RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper,
pClassTabControl->SetVariable( nId, pCont, NULL, 0,
RSC_TABCONTROL_ITEMLIST );
- INS_WINBIT( pClassTabControl, SingleLine );
INS_WINBIT( pClassTabControl, DropDown );
}
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index c3dac0a6b009..c16c9826dbf7 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -191,7 +191,7 @@ void RscTypCont::Init()
Atom nId;
- aNmTb.SetSort( FALSE );
+ aNmTb.SetSort( sal_False );
{
/********** C O M P I L E R T Y P E N ******************************/
aNmTb.Put( "LINE", LINE, (long)0 );
@@ -204,12 +204,14 @@ void RscTypCont::Init()
aNmTb.Put( "writeifset", WRITEIFSET, (long)0 );
/* Werte fuer Aufzaehlungstypen */
- aNmTb.Put( "TRUE", BOOLEAN, (long)TRUE );
- aNmTb.Put( "FALSE", BOOLEAN, (long)FALSE );
+ aNmTb.Put( "TRUE", BOOLEAN, (long)sal_True );
+ aNmTb.Put( "FALSE", BOOLEAN, (long)sal_False );
+ #if 0
/* Vordefinierte HilfeId's */
aNmTb.Put( "HELP_INDEX", NUMBER, OOO_HELP_INDEX );
aNmTb.Put( "HELP_HELPONHELP", NUMBER, OOO_HELP_HELPONHELP );
+ #endif
aNmTb.Put( "XSCALE", XSCALE , (long)0 );
aNmTb.Put( "YSCALE", YSCALE , (long)0 );
@@ -260,119 +262,117 @@ void RscTypCont::Init()
// Windows
nBorderId = pHS->getID( "WB_BORDER" );
- aWinBits.SetConstant( nBorderId, sal::static_int_cast<INT32>(WB_BORDER) );
+ aWinBits.SetConstant( nBorderId, sal::static_int_cast<sal_Int32>(WB_BORDER) );
nHideId = pHS->getID( "WB_HIDE" );
- aWinBits.SetConstant( nHideId, sal::static_int_cast<INT32>(WB_HIDE) );
+ aWinBits.SetConstant( nHideId, sal::static_int_cast<sal_Int32>(WB_HIDE) );
nClipChildrenId = pHS->getID( "WB_CLIPCHILDREN" );
- aWinBits.SetConstant( nClipChildrenId, sal::static_int_cast<INT32>(WB_CLIPCHILDREN) );
+ aWinBits.SetConstant( nClipChildrenId, sal::static_int_cast<sal_Int32>(WB_CLIPCHILDREN) );
nSizeableId = pHS->getID( "WB_SIZEABLE" );
- aWinBits.SetConstant( nSizeableId, sal::static_int_cast<INT32>(WB_SIZEABLE) );
+ aWinBits.SetConstant( nSizeableId, sal::static_int_cast<sal_Int32>(WB_SIZEABLE) );
nMoveableId = pHS->getID( "WB_MOVEABLE" );
- aWinBits.SetConstant( nMoveableId, sal::static_int_cast<INT32>(WB_MOVEABLE) );
+ aWinBits.SetConstant( nMoveableId, sal::static_int_cast<sal_Int32>(WB_MOVEABLE) );
nMinimizeId = pHS->getID( "WB_MINABLE" );
aWinBits.SetConstant( nMinimizeId, 0 /*WB_MINABLE*/ );
nMaximizeId = pHS->getID( "WB_MAXABLE" );
aWinBits.SetConstant( nMaximizeId, 0 /*WB_MAXABLE*/ );
nCloseableId = pHS->getID( "WB_CLOSEABLE" );
- aWinBits.SetConstant( nCloseableId, sal::static_int_cast<INT32>(WB_CLOSEABLE) );
+ aWinBits.SetConstant( nCloseableId, sal::static_int_cast<sal_Int32>(WB_CLOSEABLE) );
nAppId = pHS->getID( "WB_APP" );
- aWinBits.SetConstant( nAppId, sal::static_int_cast<INT32>(WB_APP) );
+ aWinBits.SetConstant( nAppId, sal::static_int_cast<sal_Int32>(WB_APP) );
nTabstopId = pHS->getID( "WB_TABSTOP" );
- aWinBits.SetConstant( nTabstopId, sal::static_int_cast<INT32>(WB_TABSTOP) );
+ aWinBits.SetConstant( nTabstopId, sal::static_int_cast<sal_Int32>(WB_TABSTOP) );
nGroupId = pHS->getID( "WB_GROUP" );
- aWinBits.SetConstant( nGroupId, sal::static_int_cast<INT32>(WB_GROUP) );
+ aWinBits.SetConstant( nGroupId, sal::static_int_cast<sal_Int32>(WB_GROUP) );
nSysmodalId = pHS->getID( "WB_SYSMODAL" );
aWinBits.SetConstant( nSysmodalId, 0 /*WB_SYSMODAL*/ );
}
{
nLeftId = pHS->getID( "WB_LEFT" );
- aWinBits.SetConstant( nLeftId, sal::static_int_cast<INT32>(WB_LEFT) );
+ aWinBits.SetConstant( nLeftId, sal::static_int_cast<sal_Int32>(WB_LEFT) );
nCenterId = pHS->getID( "WB_CENTER" );
- aWinBits.SetConstant( nCenterId, sal::static_int_cast<INT32>(WB_CENTER) );
+ aWinBits.SetConstant( nCenterId, sal::static_int_cast<sal_Int32>(WB_CENTER) );
nRightId = pHS->getID( "WB_RIGHT" );
- aWinBits.SetConstant( nRightId, sal::static_int_cast<INT32>(WB_RIGHT) );
+ aWinBits.SetConstant( nRightId, sal::static_int_cast<sal_Int32>(WB_RIGHT) );
nTopId = pHS->getID( "WB_TOP" );
- aWinBits.SetConstant( nTopId, sal::static_int_cast<INT32>(WB_TOP) );
+ aWinBits.SetConstant( nTopId, sal::static_int_cast<sal_Int32>(WB_TOP) );
nVCenterId = pHS->getID( "WB_VCENTER" );
- aWinBits.SetConstant( nVCenterId, sal::static_int_cast<INT32>(WB_VCENTER) );
+ aWinBits.SetConstant( nVCenterId, sal::static_int_cast<sal_Int32>(WB_VCENTER) );
nBottomId = pHS->getID( "WB_BOTTOM" );
- aWinBits.SetConstant( nBottomId, sal::static_int_cast<INT32>(WB_BOTTOM) );
+ aWinBits.SetConstant( nBottomId, sal::static_int_cast<sal_Int32>(WB_BOTTOM) );
nHScrollId = pHS->getID( "WB_HSCROLL" );
- aWinBits.SetConstant( nHScrollId, sal::static_int_cast<INT32>(WB_HSCROLL) );
+ aWinBits.SetConstant( nHScrollId, sal::static_int_cast<sal_Int32>(WB_HSCROLL) );
nVScrollId = pHS->getID( "WB_VSCROLL" );
- aWinBits.SetConstant( nVScrollId, sal::static_int_cast<INT32>(WB_VSCROLL) );
+ aWinBits.SetConstant( nVScrollId, sal::static_int_cast<sal_Int32>(WB_VSCROLL) );
nSortId = pHS->getID( "WB_SORT" );
- aWinBits.SetConstant( nSortId, sal::static_int_cast<INT32>(WB_SORT) );
+ aWinBits.SetConstant( nSortId, sal::static_int_cast<sal_Int32>(WB_SORT) );
nDefaultId = pHS->getID( "WB_DEFBUTTON" );
- aWinBits.SetConstant( nDefaultId, sal::static_int_cast<INT32>(WB_DEFBUTTON) );
+ aWinBits.SetConstant( nDefaultId, sal::static_int_cast<sal_Int32>(WB_DEFBUTTON) );
nRepeatId = pHS->getID( "WB_REPEAT" );
- aWinBits.SetConstant( nRepeatId, sal::static_int_cast<INT32>(WB_REPEAT) );
+ aWinBits.SetConstant( nRepeatId, sal::static_int_cast<sal_Int32>(WB_REPEAT) );
nSVLookId = pHS->getID( "WB_SVLOOK" );
- aWinBits.SetConstant( nSVLookId, sal::static_int_cast<INT32>(WB_3DLOOK) );
+ aWinBits.SetConstant( nSVLookId, sal::static_int_cast<sal_Int32>(WB_3DLOOK) );
nDropDownId = pHS->getID( "WB_DROPDOWN" );
- aWinBits.SetConstant( nDropDownId, sal::static_int_cast<INT32>(WB_DROPDOWN) );
+ aWinBits.SetConstant( nDropDownId, sal::static_int_cast<sal_Int32>(WB_DROPDOWN) );
nPassWordId = pHS->getID( "WB_PASSWORD" );
- aWinBits.SetConstant( nPassWordId, sal::static_int_cast<INT32>(WB_PASSWORD) );
+ aWinBits.SetConstant( nPassWordId, sal::static_int_cast<sal_Int32>(WB_PASSWORD) );
nReadOnlyId = pHS->getID( "WB_READONLY" );
- aWinBits.SetConstant( nReadOnlyId, sal::static_int_cast<INT32>(WB_READONLY) );
+ aWinBits.SetConstant( nReadOnlyId, sal::static_int_cast<sal_Int32>(WB_READONLY) );
nAutoSizeId = pHS->getID( "WB_AUTOSIZE" );
- aWinBits.SetConstant( nAutoSizeId, sal::static_int_cast<INT32>(WB_AUTOSIZE) );
+ aWinBits.SetConstant( nAutoSizeId, sal::static_int_cast<sal_Int32>(WB_AUTOSIZE) );
nSpinId = pHS->getID( "WB_SPIN" );
- aWinBits.SetConstant( nSpinId, sal::static_int_cast<INT32>(WB_SPIN) );
+ aWinBits.SetConstant( nSpinId, sal::static_int_cast<sal_Int32>(WB_SPIN) );
nTabControlId = pHS->getID( "WB_DIALOGCONTROL" );
- aWinBits.SetConstant( nTabControlId, sal::static_int_cast<INT32>(WB_DIALOGCONTROL) );
+ aWinBits.SetConstant( nTabControlId, sal::static_int_cast<sal_Int32>(WB_DIALOGCONTROL) );
nSimpleModeId = pHS->getID( "WB_SIMPLEMODE" );
- aWinBits.SetConstant( nSimpleModeId, sal::static_int_cast<INT32>(WB_SIMPLEMODE) );
+ aWinBits.SetConstant( nSimpleModeId, sal::static_int_cast<sal_Int32>(WB_SIMPLEMODE) );
nDragId = pHS->getID( "WB_DRAG" );
- aWinBits.SetConstant( nDragId, sal::static_int_cast<INT32>(WB_DRAG) );
+ aWinBits.SetConstant( nDragId, sal::static_int_cast<sal_Int32>(WB_DRAG) );
nScrollId = pHS->getID( "WB_SCROLL" );
- aWinBits.SetConstant( nScrollId, sal::static_int_cast<INT32>(WB_SCROLL) );
+ aWinBits.SetConstant( nScrollId, sal::static_int_cast<sal_Int32>(WB_SCROLL) );
nZoomableId = pHS->getID( "WB_ZOOMABLE" );
- aWinBits.SetConstant( nZoomableId, sal::static_int_cast<INT32>(WB_ROLLABLE) );
+ aWinBits.SetConstant( nZoomableId, sal::static_int_cast<sal_Int32>(WB_ROLLABLE) );
nHideWhenDeactivateId = pHS->getID( "WB_HIDEWHENDEACTIVATE" );
aWinBits.SetConstant( nHideWhenDeactivateId, 0 /*WB_HIDEWHENDEACTIVATE*/ );
nAutoHScrollId = pHS->getID( "WB_AUTOHSCROLL" );
- aWinBits.SetConstant( nAutoHScrollId, sal::static_int_cast<INT32>(WB_AUTOHSCROLL) );
+ aWinBits.SetConstant( nAutoHScrollId, sal::static_int_cast<sal_Int32>(WB_AUTOHSCROLL) );
nAutoVScrollId = pHS->getID( "WB_AUTOVSCROLL" );
- aWinBits.SetConstant( nAutoVScrollId, sal::static_int_cast<INT32>(WB_AUTOVSCROLL) );
+ aWinBits.SetConstant( nAutoVScrollId, sal::static_int_cast<sal_Int32>(WB_AUTOVSCROLL) );
nDDExtraWidthId = pHS->getID( "WB_DDEXTRAWIDTH" );
aWinBits.SetConstant( nDDExtraWidthId, 0 /*WB_DDEXTRAWIDTH*/ );
nWordBreakId = pHS->getID( "WB_WORDBREAK" );
- aWinBits.SetConstant( nWordBreakId, sal::static_int_cast<INT32>(WB_WORDBREAK) );
+ aWinBits.SetConstant( nWordBreakId, sal::static_int_cast<sal_Int32>(WB_WORDBREAK) );
nLeftLabelId = pHS->getID( "WB_LEFTLABEL" );
aWinBits.SetConstant( nLeftLabelId, 0 /*WB_LEFTLABEL*/ );
nHasLinesId = pHS->getID( "WB_HASLINES" );
- aWinBits.SetConstant( nHasLinesId, sal::static_int_cast<INT32>(WB_HASLINES) );
+ aWinBits.SetConstant( nHasLinesId, sal::static_int_cast<sal_Int32>(WB_HASLINES) );
nHasButtonsId = pHS->getID( "WB_HASBUTTONS" );
- aWinBits.SetConstant( nHasButtonsId, sal::static_int_cast<INT32>(WB_HASBUTTONS) );
+ aWinBits.SetConstant( nHasButtonsId, sal::static_int_cast<sal_Int32>(WB_HASBUTTONS) );
nRectStyleId = pHS->getID( "WB_RECTSTYLE" );
- aWinBits.SetConstant( nRectStyleId, sal::static_int_cast<INT32>(WB_RECTSTYLE) );
+ aWinBits.SetConstant( nRectStyleId, sal::static_int_cast<sal_Int32>(WB_RECTSTYLE) );
nLineSpacingId = pHS->getID( "WB_LINESPACING" );
- aWinBits.SetConstant( nLineSpacingId, sal::static_int_cast<INT32>(WB_LINESPACING) );
+ aWinBits.SetConstant( nLineSpacingId, sal::static_int_cast<sal_Int32>(WB_LINESPACING) );
nSmallStyleId = pHS->getID( "WB_SMALLSTYLE" );
- aWinBits.SetConstant( nSmallStyleId, sal::static_int_cast<INT32>(WB_SMALLSTYLE) );
+ aWinBits.SetConstant( nSmallStyleId, sal::static_int_cast<sal_Int32>(WB_SMALLSTYLE) );
nEnableResizingId = pHS->getID( "WB_ENABLERESIZING" );
aWinBits.SetConstant( nEnableResizingId, 0 /*WB_ENABLERESIZING*/ );
nDockableId = pHS->getID( "WB_DOCKABLE" );
- aWinBits.SetConstant( nDockableId, sal::static_int_cast<INT32>(WB_DOCKABLE) );
+ aWinBits.SetConstant( nDockableId, sal::static_int_cast<sal_Int32>(WB_DOCKABLE) );
nScaleId = pHS->getID( "WB_SCALE" );
- aWinBits.SetConstant( nScaleId, sal::static_int_cast<INT32>(WB_SCALE) );
+ aWinBits.SetConstant( nScaleId, sal::static_int_cast<sal_Int32>(WB_SCALE) );
nIgnoreTabId = pHS->getID( "WB_IGNORETAB" );
- aWinBits.SetConstant( nIgnoreTabId, sal::static_int_cast<INT32>(WB_IGNORETAB) );
+ aWinBits.SetConstant( nIgnoreTabId, sal::static_int_cast<sal_Int32>(WB_IGNORETAB) );
nNoSplitDrawId = pHS->getID( "WB_NOSPLITDRAW" );
- aWinBits.SetConstant( nNoSplitDrawId, sal::static_int_cast<INT32>(WB_NOSPLITDRAW) );
+ aWinBits.SetConstant( nNoSplitDrawId, sal::static_int_cast<sal_Int32>(WB_NOSPLITDRAW) );
nTopImageId = pHS->getID( "WB_TOPIMAGE" );
- aWinBits.SetConstant( nTopImageId, sal::static_int_cast<INT32>(WB_TOPIMAGE) );
+ aWinBits.SetConstant( nTopImageId, sal::static_int_cast<sal_Int32>(WB_TOPIMAGE) );
nNoLabelId = pHS->getID( "WB_NOLABEL" );
- aWinBits.SetConstant( nNoLabelId, sal::static_int_cast<INT32>(WB_NOLABEL) );
+ aWinBits.SetConstant( nNoLabelId, sal::static_int_cast<sal_Int32>(WB_NOLABEL) );
nVertId = pHS->getID( "WB_VERT" );
- aWinBits.SetConstant( nVertId, sal::static_int_cast<INT32>(WB_VERT) );
- nSingleLineId = pHS->getID( "WB_SINGLELINE" );
- aWinBits.SetConstant( nSingleLineId, sal::static_int_cast<INT32>(WB_SINGLELINE) );
+ aWinBits.SetConstant( nVertId, sal::static_int_cast<sal_Int32>(WB_VERT) );
nSysWinId = pHS->getID( "WB_SYSTEMWINDOW" );
- aWinBits.SetConstant( nSysWinId, sal::static_int_cast<INT32>(WB_SYSTEMWINDOW) );
+ aWinBits.SetConstant( nSysWinId, sal::static_int_cast<sal_Int32>(WB_SYSTEMWINDOW) );
nStdPopupId = pHS->getID( "WB_STDPOPUP" );
- aWinBits.SetConstant( nStdPopupId, sal::static_int_cast<INT32>(WB_STDPOPUP) );
+ aWinBits.SetConstant( nStdPopupId, sal::static_int_cast<sal_Int32>(WB_STDPOPUP) );
}
{
/********** I n i t B a s i c T y p e s **************************/
@@ -695,7 +695,7 @@ void RscTypCont::Init()
// Clientvariablen einfuegen
// Sysmodal
aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "BOOL" ), RSC_NOTYPE, &aWinBits, nRepeatId )
+ pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, &aWinBits, nRepeatId )
);
nId = aNmTb.Put( "Repeat", VARNAME );
pClassSpinButton->SetVariable( nId, pClient, NULL,
diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx
index be0cefcf029b..e6e1559a4130 100644
--- a/rsc/source/parser/rsckey.cxx
+++ b/rsc/source/parser/rsckey.cxx
@@ -71,7 +71,7 @@ int KeyCompare( const void * pFirst, const void * pSecond ){
|*
*************************************************************************/
RscNameTable::RscNameTable() {
- bSort = TRUE;
+ bSort = sal_True;
nEntries = 0;
pTable = NULL;
};
@@ -92,7 +92,7 @@ RscNameTable::~RscNameTable() {
|* RscNameTable::SetSort()
|*
*************************************************************************/
-void RscNameTable::SetSort( BOOL bSorted ){
+void RscNameTable::SetSort( sal_Bool bSorted ){
bSort = bSorted;
if( bSort && pTable){
// Schluesselwort Feld sortieren
@@ -157,7 +157,7 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass )
|* RscNameTable::Get()
|*
*************************************************************************/
-BOOL RscNameTable::Get( Atom nName, KEY_STRUCT * pEle ){
+sal_Bool RscNameTable::Get( Atom nName, KEY_STRUCT * pEle ){
KEY_STRUCT * pKey = NULL;
KEY_STRUCT aSearchName;
sal_uInt32 i;
@@ -184,9 +184,9 @@ BOOL RscNameTable::Get( Atom nName, KEY_STRUCT * pEle ){
if( pKey ){ // Schluesselwort gefunden
*pEle = *pKey;
- return( TRUE );
+ return( sal_True );
};
- return( FALSE );
+ return( sal_False );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index 5c38c66790ca..0f59c7ab4cdf 100644..100755
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -68,7 +68,7 @@ const char* StringContainer::putString( const char* pString )
/*************************************************************************/
int c;
-BOOL bLastInclude;// War letztes Symbol INCLUDE
+sal_Bool bLastInclude;// War letztes Symbol INCLUDE
RscFileInst* pFI;
RscTypCont* pTC;
RscExpression * pExp;
@@ -76,15 +76,15 @@ struct KeyVal {
int nKeyWord;
YYSTYPE aYYSType;
} aKeyVal[ 1 ];
-BOOL bTargetDefined;
+sal_Bool bTargetDefined;
StringContainer* pStringContainer = NULL;
/****************** C O D E **********************************************/
-UINT32 GetNumber(){
- UINT32 l = 0;
- UINT32 nLog = 10;
+sal_uInt32 GetNumber(){
+ sal_uInt32 l = 0;
+ sal_uInt32 nLog = 10;
if( '0' == c ){
c = pFI->GetFastChar();
@@ -122,7 +122,7 @@ UINT32 GetNumber(){
int MakeToken( YYSTYPE * pTokenVal ){
int c1;
- while( TRUE ){ // Kommentare und Leerzeichen ueberlesen
+ while( sal_True ){ // Kommentare und Leerzeichen ueberlesen
while( isspace( c ) )
c = pFI->GetFastChar();
if( '/' == c ){
@@ -154,7 +154,7 @@ int MakeToken( YYSTYPE * pTokenVal ){
}
if( bLastInclude ){
- bLastInclude = FALSE; //Zuruecksetzten
+ bLastInclude = sal_False; //Zuruecksetzten
if( '<' == c ){
OStringBuffer aBuf( 256 );
c = pFI->GetFastChar();
@@ -172,20 +172,25 @@ int MakeToken( YYSTYPE * pTokenVal ){
if( c == '"' )
{
OStringBuffer aBuf( 256 );
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
while( !bDone && !pFI->IsEof() && c )
{
c = pFI->GetFastChar();
if( c == '"' )
{
- c = pFI->GetFastChar();
+ do
+ {
+ c = pFI->GetFastChar();
+ }
+ while( c == ' ' || c == '\t' );
if( c == '"' )
{
- aBuf.append( '"' );
- aBuf.append( '"' );
+ // this is a continued string
+ // note: multiline string continuations are handled by the parser
+ // see rscyacc.y
}
else
- bDone = TRUE;
+ bDone = sal_True;
}
else if( c == '\\' )
{
@@ -238,10 +243,10 @@ int MakeToken( YYSTYPE * pTokenVal ){
pTokenVal->constname.nValue = aKey.yylval;
break;
case BOOLEAN:
- pTokenVal->svbool = (BOOL)aKey.yylval;
+ pTokenVal->svbool = (sal_Bool)aKey.yylval;
break;
case INCLUDE:
- bLastInclude = TRUE;
+ bLastInclude = sal_True;
default:
pTokenVal->value = aKey.yylval;
};
@@ -305,7 +310,7 @@ int yylex()
#endif
{
if( bTargetDefined )
- bTargetDefined = FALSE;
+ bTargetDefined = sal_False;
else
aKeyVal[ 0 ].nKeyWord =
MakeToken( &aKeyVal[ 0 ].aYYSType );
@@ -333,10 +338,10 @@ void InitParser( RscFileInst * pFileInst )
pFI = pFileInst;
pStringContainer = new StringContainer();
pExp = NULL; //fuer MacroParser
- bTargetDefined = FALSE;
+ bTargetDefined = sal_False;
// Anfangszeichen initialisieren
- bLastInclude = FALSE;
+ bLastInclude = sal_False;
c = pFI->GetFastChar();
}
@@ -362,7 +367,7 @@ void IncludeParser( RscFileInst * pFileInst )
int nToken; // Wert des Tokens
YYSTYPE aYYSType; // Daten des Tokens
RscFile * pFName; // Filestruktur
- ULONG lKey; // Fileschluessel
+ sal_uLong lKey; // Fileschluessel
RscTypCont * pTypCon = pFileInst->pTypCont;
pFName = pTypCon->aFileTab.Get( pFileInst->GetFileIndex() );
@@ -418,7 +423,7 @@ RscExpression * MacroParser( RscFileInst & rFileInst )
//Ziel auf macro_expression setzen
aKeyVal[ 0 ].nKeyWord = MACROTARGET;
- bTargetDefined = TRUE;
+ bTargetDefined = sal_True;
aError = yyparse();
pExpression = pExp;
diff --git a/rsc/source/parser/rsclex.hxx b/rsc/source/parser/rsclex.hxx
index 2cc5a4193106..c861e89402f6 100644
--- a/rsc/source/parser/rsclex.hxx
+++ b/rsc/source/parser/rsclex.hxx
@@ -77,7 +77,7 @@ class ObjectStack {
ObjectStack () { pRoot = NULL; }
const RSCINST & Top () { return pRoot->aInst; }
- BOOL IsEmpty() { return( pRoot == NULL ); }
+ sal_Bool IsEmpty() { return( pRoot == NULL ); }
void IncTupelRec() { pRoot->nTupelRec++; }
void DecTupelRec() { pRoot->nTupelRec--; }
sal_uInt32 TupelRecCount() const { return pRoot->nTupelRec; }
diff --git a/rsc/source/parser/rscpar.cxx b/rsc/source/parser/rscpar.cxx
index 389d2c686c05..fc3c44c8754d 100644
--- a/rsc/source/parser/rscpar.cxx
+++ b/rsc/source/parser/rscpar.cxx
@@ -49,7 +49,7 @@ void RscFileInst::Init()
*pLine = '\0';
nScanPos = 0;
cLastChar = '\0';
- bEof = FALSE;
+ bEof = sal_False;
};
/*************************************************************************
@@ -57,8 +57,8 @@ void RscFileInst::Init()
|* RscFileInst::RscFileInst()
|*
*************************************************************************/
-RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc,
- ULONG lFIndex, FILE * fFile )
+RscFileInst::RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
+ sal_uLong lFIndex, FILE * fFile )
{
pTypCont = pTC;
Init();
@@ -72,8 +72,8 @@ RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc,
pInput = (char *)rtl_allocateMemory( nInputBufLen );
}
-RscFileInst::RscFileInst( RscTypCont * pTC, ULONG lIndexSrc,
- ULONG lFIndex, const ByteString& rBuf )
+RscFileInst::RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
+ sal_uLong lFIndex, const ByteString& rBuf )
{
pTypCont = pTC;
Init();
@@ -113,7 +113,7 @@ int RscFileInst::GetChar()
else if( nInputPos >= nInputEndPos && nInputEndPos != nInputBufLen )
{
// Dateiende
- bEof = TRUE;
+ bEof = sal_True;
return 0;
}
else
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index 8cbe5d0d2063..efef5f3b42ff 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -65,7 +65,7 @@ RSCINST GetVarInst( const RSCINST & rInst, const char * pVarName )
return( aInst );
}
-void SetNumber( const RSCINST & rInst, const char * pVarName, INT32 lValue )
+void SetNumber( const RSCINST & rInst, const char * pVarName, sal_Int32 lValue )
{
RSCINST aInst;
@@ -81,7 +81,7 @@ void SetNumber( const RSCINST & rInst, const char * pVarName, INT32 lValue )
}
void SetConst( const RSCINST & rInst, const char * pVarName,
- Atom nValueId, INT32 nVal )
+ Atom nValueId, sal_Int32 nVal )
{
RSCINST aInst;
@@ -113,11 +113,11 @@ void SetString( const RSCINST & rInst, const char * pVarName, const char * pStr
RscId MakeRscId( RscExpType aExpType )
{
if( !aExpType.IsNothing() ){
- INT32 lValue;
+ sal_Int32 lValue;
if( !aExpType.Evaluate( &lValue ) )
pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
- if( lValue < 1 || lValue > (INT32)0x7FFF )
+ if( lValue < 1 || lValue > (sal_Int32)0x7FFF )
{
pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(),
ByteString::CreateFromInt32( lValue ).GetBuffer() );
@@ -131,7 +131,7 @@ RscId MakeRscId( RscExpType aExpType )
return RscId();
}
-BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember )
+sal_Bool DoClassHeader( RSCHEADER * pHeader, sal_Bool bMember )
{
RSCINST aCopyInst;
RscId aName1 = MakeRscId( pHeader->nName1 );
@@ -179,7 +179,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember )
{
if( S.IsEmpty() )
{
- if( (INT32)aName1 < 256 )
+ if( (sal_Int32)aName1 < 256 )
pTC->pEH->Error( WRN_GLOBALID, pHeader->pClass, aName1 );
if( aCopyInst.IsInst() )
@@ -201,7 +201,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember )
RSCINST aTmpI;
ERRTYPE aError;
- if( (INT32)aName1 >= 256 && aName1.IsId() )
+ if( (sal_Int32)aName1 >= 256 && aName1.IsId() )
pTC->pEH->Error( WRN_LOCALID, pHeader->pClass, aName1 );
aError = S.Top().pClass->GetElement( S.Top(), aName1,
pHeader->pClass, aCopyInst, &aTmpI );
@@ -219,7 +219,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember )
pHeader->pClass, RSCINST(), &aTmpI );
if( !aTmpI.IsInst() )
- return( FALSE );
+ return( sal_False );
}
S.Push( aTmpI );
};
@@ -232,7 +232,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember )
pTC->pEH->Error( aError, S.Top().pClass, aName1 );
}
- return( TRUE );
+ return( sal_True );
}
RSCINST GetFirstTupelEle( const RSCINST & rTop )
@@ -255,12 +255,8 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
#ifdef UNX
#define YYMAXDEPTH 2000
#else
-#ifdef W30
-#define YYMAXDEPTH 300
-#else
#define YYMAXDEPTH 800
#endif
-#endif
#if defined _MSC_VER
#pragma warning(push, 1)
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index a522d7416782..329884e498b6 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -39,7 +39,7 @@
Atom varid;
struct {
Atom hashid;
- INT32 nValue;
+ sal_Int32 nValue;
} constname;
RscTop * pClass;
RSCHEADER header;
@@ -47,11 +47,11 @@
CLASS_DATA pData;
RscTop * pClass;
} instance;
- INT32 value;
- USHORT ushort;
+ sal_Int32 value;
+ sal_uInt16 ushort;
short exp_short;
char * string;
- BOOL svbool;
+ sal_Bool svbool;
REF_ENUM copyref;
RscDefine * defineele;
CharSet charset;
@@ -130,7 +130,7 @@ resource_definitions
| MACROTARGET macro_expression
{
RscExpType aExpType;
- INT32 lValue;
+ sal_Int32 lValue;
aExpType.cType = RSCEXP_NOTHING;
pExp = new RscExpression( aExpType, '+', $2 );
@@ -143,13 +143,13 @@ resource_definition
: line_number
| '#' DEFINE SYMBOL macro_expression
{
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
if( $4.IsNumber() ){
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
ByteString( $3 ),
$4.GetLong(), LIST_APPEND ) )
- bError = TRUE;
+ bError = sal_True;
}
else if( $4.IsDefinition() ){
RscExpType aExpType;
@@ -162,13 +162,13 @@ resource_definition
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
ByteString( $3 ), pExpr, LIST_APPEND ) )
- bError = TRUE;
+ bError = sal_True;
}
else if( $4.IsExpression() ){
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
ByteString( $3 ), $4.aExp.pExp,
LIST_APPEND ) )
- bError = TRUE;
+ bError = sal_True;
}
if( bError ){
@@ -200,7 +200,7 @@ resource_definition
new_class_definition_header
: CLASS SYMBOL id_expression ':' CLASSNAME
{
- INT32 lType;
+ sal_Int32 lType;
$3.Evaluate( &lType );
@@ -319,7 +319,7 @@ class_definition
class_header
: class_header_body
{
- if( !DoClassHeader( &$1, FALSE ) )
+ if( !DoClassHeader( &$1, sal_False ) )
return( ERR_ERROR );
$$ = $1;
}
@@ -528,7 +528,7 @@ var_header_class
{
RSCINST aInst;
- aInst = S.Top().pClass->GetVariable( S.Top(), $1, RSCINST(), FALSE, $3.pClass );
+ aInst = S.Top().pClass->GetVariable( S.Top(), $1, RSCINST(), sal_False, $3.pClass );
if( aInst.pData )
S.Push( aInst );
@@ -539,7 +539,7 @@ var_header_class
return( ERR_ERROR );
};
- if( !DoClassHeader( &$3, TRUE ) )
+ if( !DoClassHeader( &$3, sal_True ) )
return( ERR_ERROR );
$$ = $3;
}
@@ -567,7 +567,7 @@ var_header_class
pHS->getString( $1 ) );
return( ERR_ERROR );
};
- if( !DoClassHeader( &$6, TRUE ) )
+ if( !DoClassHeader( &$6, sal_True ) )
return( ERR_ERROR );
$$ = $6;
}
@@ -596,7 +596,7 @@ var_header_class
pHS->getString( $1 ) );
return( ERR_ERROR );
};
- if( !DoClassHeader( &$6, TRUE ) )
+ if( !DoClassHeader( &$6, sal_True ) )
return( ERR_ERROR );
$$ = $6;
}
@@ -784,7 +784,7 @@ list
var_bodysimple
: macro_expression
{
- INT32 l;
+ sal_Int32 l;
ERRTYPE aError;
if( !$1.Evaluate( &l ) )
@@ -1064,7 +1064,7 @@ id_expression
| macro_expression
{ // pExpession auswerten und loeschen
if( RSCEXP_EXP == $1.cType ){
- INT32 lValue;
+ sal_Int32 lValue;
if( !$1.Evaluate( &lValue ) )
pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
@@ -1094,8 +1094,8 @@ line_number
pFI->SetLineNo( $3 );
pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( ByteString( $4 ) ) );
pFName = pTC->aFileTab.Get( pFI->GetFileIndex() );
- pFName->bLoaded = TRUE;
- pFName->bScanned = TRUE;
+ pFName->bLoaded = sal_True;
+ pFName->bScanned = sal_True;
}
| '#' NUMBER STRING DUMMY_NUMBER
{
@@ -1104,8 +1104,8 @@ line_number
pFI->SetLineNo( $2 );
pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( ByteString( $3 ) ) );
pFName = pTC->aFileTab.Get( pFI->GetFileIndex() );
- pFName->bLoaded = TRUE;
- pFName->bScanned = TRUE;
+ pFName->bLoaded = sal_True;
+ pFName->bScanned = sal_True;
}
| '#' NUMBER
{
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index ec4586532475..532851ffbdea 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -86,11 +86,11 @@
|*
|* Beschreibung
*************************************************************************/
-static BOOL CallPrePro( const ByteString& rPrePro,
+static sal_Bool CallPrePro( const ByteString& rPrePro,
const ByteString& rInput,
const ByteString& rOutput,
RscPtrPtr * pCmdLine,
- BOOL bResponse )
+ sal_Bool bResponse )
{
RscPtrPtr aNewCmdL; // Kommandozeile
RscPtrPtr aRespCmdL; // Kommandozeile
@@ -184,9 +184,9 @@ static BOOL CallPrePro( const ByteString& rPrePro,
unlink( aRspFileName.GetBuffer() );
#endif
if ( nExit )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
@@ -195,7 +195,7 @@ static BOOL CallPrePro( const ByteString& rPrePro,
|*
|* Beschreibung
*************************************************************************/
-static BOOL CallRsc2( ByteString aRsc2Name,
+static sal_Bool CallRsc2( ByteString aRsc2Name,
RscStrList * pInputList,
ByteString aSrsName,
RscPtrPtr * pCmdLine )
@@ -294,8 +294,8 @@ static BOOL CallRsc2( ByteString aRsc2Name,
unlink( aRspFileName.GetBuffer() );
#endif
if( nExit )
- return( FALSE );
- return( TRUE );
+ return( sal_False );
+ return( sal_True );
}
/*************************************************************************
@@ -305,10 +305,10 @@ static BOOL CallRsc2( ByteString aRsc2Name,
*************************************************************************/
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
- BOOL bPrePro = TRUE;
- BOOL bHelp = FALSE;
- BOOL bError = FALSE;
- BOOL bResponse = FALSE;
+ sal_Bool bPrePro = sal_True;
+ sal_Bool bHelp = sal_False;
+ sal_Bool bError = sal_False;
+ sal_Bool bResponse = sal_False;
ByteString aSolarbin(getenv("SOLARBINDIR"));
ByteString aDelim("/");
ByteString aPrePro; //( aSolarbin + aDelim + ByteString("rscpp"));
@@ -341,7 +341,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
ppStr = (char **)aCmdLine.GetBlock();
ppStr++;
i = 1;
- BOOL bSetSrs = FALSE;
+ sal_Bool bSetSrs = sal_False;
while( ppStr && i < (aCmdLine.GetCount() -1) )
{
if( '-' == **ppStr )
@@ -349,15 +349,15 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( !rsc_stricmp( (*ppStr) + 1, "p" )
|| !rsc_stricmp( (*ppStr) + 1, "l" ) )
{ // kein Preprozessor
- bPrePro = FALSE;
+ bPrePro = sal_False;
}
else if( !rsc_stricmp( (*ppStr) + 1, "h" ) )
{ // Hilfe anzeigen
- bHelp = TRUE;
+ bHelp = sal_True;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "presponse", 9 ) )
{ // anderer Name fuer den Preprozessor
- bResponse = TRUE;
+ bResponse = sal_True;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "pp=", 3 ) )
{ // anderer Name fuer den Preprozessor
@@ -373,7 +373,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
}
else if( !rsc_strnicmp( (*ppStr) + 1, "fp=", 3 ) )
{ // anderer Name fuer .srs-file
- bSetSrs = TRUE;
+ bSetSrs = sal_True;
aSrsName = (*ppStr);
}
}
@@ -399,7 +399,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
};
if( bHelp )
- bPrePro = FALSE;
+ bPrePro = sal_False;
if( bPrePro && !aInputList.empty() )
{
ByteString aTmpName;
@@ -411,7 +411,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( !CallPrePro( aPrePro, *pString, aTmpName, &aCmdLine, bResponse ) )
{
printf( "Error starting preprocessor\n" );
- bError = TRUE;
+ bError = sal_True;
break;
}
aTmpList.push_back( new ByteString( aTmpName ) );
@@ -426,7 +426,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( !bHelp )
{
printf( "Error starting rsc2 compiler\n" );
- bError = TRUE;
+ bError = sal_True;
}
};
};
diff --git a/rsc/source/res/rscall.cxx b/rsc/source/res/rscall.cxx
index 4bd3db7b9aae..26193d4cae51 100644
--- a/rsc/source/res/rscall.cxx
+++ b/rsc/source/res/rscall.cxx
@@ -50,11 +50,11 @@ Atom nRsc_EXTRADATA = InvalidAtom;
void InitRscCompiler()
{
- pStdParType = new ByteString( "( const ResId & rResId, BOOL" );
+ pStdParType = new ByteString( "( const ResId & rResId, sal_Bool" );
pStdPar1 = new ByteString( '(' );
pStdPar2 = new ByteString( '(' );
- pWinParType = new ByteString( "( Window * pParent, const ResId & rResId, BOOL" );
+ pWinParType = new ByteString( "( Window * pParent, const ResId & rResId, sal_Bool" );
pWinPar1 = new ByteString( "( pParent," );
pWinPar2 = new ByteString( "( this," );
nRefDeep = 10;
diff --git a/rsc/source/res/rscarray.cxx b/rsc/source/res/rscarray.cxx
index a3030ef65b64..656bcfc7a1d3 100644
--- a/rsc/source/res/rscarray.cxx
+++ b/rsc/source/res/rscarray.cxx
@@ -143,7 +143,7 @@ static RscInstNode * Create( RscInstNode * pNode )
}
RSCINST RscArray::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aInst;
RscArrayInst * pClassData;
@@ -212,7 +212,7 @@ void RscArray::Destroy( const RSCINST & rInst )
ERRTYPE RscArray::GetValueEle
(
const RSCINST & rInst,
- INT32 lValue,
+ sal_Int32 lValue,
RscTop * pCreateClass,
RSCINST * pGetInst
)
@@ -280,7 +280,7 @@ ERRTYPE RscArray::GetArrayEle
RSCINST * pGetInst
)
{
- INT32 lValue;
+ sal_Int32 lValue;
if( !pTypeClass->GetConstValue( nId, &lValue ) )
{ // nicht gefunden
return ERR_ARRAY_INVALIDINDEX;
@@ -294,31 +294,31 @@ ERRTYPE RscArray::GetArrayEle
|* RscArray::IsConsistent()
|*
*************************************************************************/
-static BOOL IsConsistent( RscInstNode * pNode )
+static sal_Bool IsConsistent( RscInstNode * pNode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pNode )
{
bRet = pNode->aInst.pClass->IsConsistent( pNode->aInst );
if( !IsConsistent( pNode->Left() ) )
- bRet = FALSE;
+ bRet = sal_False;
if( !IsConsistent( pNode->Right() ) )
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-BOOL RscArray::IsConsistent( const RSCINST & rInst )
+sal_Bool RscArray::IsConsistent( const RSCINST & rInst )
{
RscArrayInst * pClassData;
- BOOL bRet;
+ sal_Bool bRet;
bRet = RscTop::IsConsistent( rInst );
pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
if( !::IsConsistent( pClassData->pNode ) )
- bRet = FALSE;
+ bRet = sal_False;
return( bRet );
}
@@ -354,9 +354,9 @@ void RscArray::SetToDefault( const RSCINST & rInst )
|* RscArray::IsDefault()
|*
*************************************************************************/
-static BOOL IsDefault( RscInstNode * pNode )
+static sal_Bool IsDefault( RscInstNode * pNode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pNode )
{
@@ -369,13 +369,13 @@ static BOOL IsDefault( RscInstNode * pNode )
return bRet;
}
-BOOL RscArray::IsDefault( const RSCINST & rInst )
+sal_Bool RscArray::IsDefault( const RSCINST & rInst )
{
RscArrayInst * pClassData;
pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
- BOOL bRet = ::IsDefault( pClassData->pNode );
+ sal_Bool bRet = ::IsDefault( pClassData->pNode );
if( bRet )
bRet = RscTop::IsDefault( rInst );
@@ -387,9 +387,9 @@ BOOL RscArray::IsDefault( const RSCINST & rInst )
|* RscArray::IsValueDefault()
|*
*************************************************************************/
-static BOOL IsValueDefault( RscInstNode * pNode, CLASS_DATA pDef )
+static sal_Bool IsValueDefault( RscInstNode * pNode, CLASS_DATA pDef )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( pNode )
{
@@ -402,10 +402,10 @@ static BOOL IsValueDefault( RscInstNode * pNode, CLASS_DATA pDef )
return bRet;
}
-BOOL RscArray::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscArray::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
RscArrayInst * pClassData;
- BOOL bRet;
+ sal_Bool bRet;
bRet = RscTop::IsValueDefault( rInst, pDef );
@@ -520,7 +520,7 @@ void RscArray::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|* Beschreibung
*************************************************************************/
ERRTYPE RscArray::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError;
RscArrayInst * pClassData;
@@ -617,7 +617,7 @@ void RscClassArray::WriteSrc( const RSCINST & rInst, FILE * fOutput,
*************************************************************************/
ERRTYPE RscClassArray::WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
RscTypCont * pTC, const RscId & aId,
- sal_uInt32 nDeep, BOOL bExtra )
+ sal_uInt32 nDeep, sal_Bool bExtra )
{
// Eigenen Typ schreiben
return GetSuperClass()->WriteRcHeader( rInst, aMem, pTC, aId,
diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx
index ad2a45e66892..6f2939cd2fd2 100644
--- a/rsc/source/res/rscclass.cxx
+++ b/rsc/source/res/rscclass.cxx
@@ -113,7 +113,7 @@ RSCINST RscClass::GetInstData
(
CLASS_DATA pData,
sal_uInt32 nEle,
- BOOL bGetCopy
+ sal_Bool bGetCopy
)
{
RSCINST aInst;
@@ -174,15 +174,15 @@ CLASS_DATA RscClass::GetDfltData( sal_uInt32 nEle )
|* RscClass::SetVarDflt()
|*
*************************************************************************/
-void RscClass::SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, BOOL bSet )
+void RscClass::SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, sal_Bool bSet )
{
RscClassInst * pClass;
pClass = (RscClassInst *)(pData + nSuperSize );
if( bSet )
- pClass->nVarDflt |= ((ULONG)1 << nEle);
+ pClass->nVarDflt |= ((sal_uLong)1 << nEle);
else
- pClass->nVarDflt &= ~((ULONG)1 << nEle);
+ pClass->nVarDflt &= ~((sal_uLong)1 << nEle);
}
/*************************************************************************
@@ -190,16 +190,16 @@ void RscClass::SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, BOOL bSet )
|* RscClass::IsDflt()
|*
*************************************************************************/
-BOOL RscClass::IsDflt( CLASS_DATA pData, sal_uInt32 nEle )
+sal_Bool RscClass::IsDflt( CLASS_DATA pData, sal_uInt32 nEle )
{
RscClassInst * pClass;
- BOOL bRet;
+ sal_Bool bRet;
pClass = (RscClassInst *)(pData + nSuperSize );
- if( pClass->nVarDflt & ((ULONG)1 << nEle) )
- bRet = TRUE;
+ if( pClass->nVarDflt & ((sal_uLong)1 << nEle) )
+ bRet = sal_True;
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -212,7 +212,7 @@ RSCINST RscClass::Create
(
RSCINST * pInst,
const RSCINST & rDflt,
- BOOL bOwnClass
+ sal_Bool bOwnClass
)
{
sal_uInt32 i;
@@ -236,11 +236,11 @@ RSCINST RscClass::Create
((RscClassInst *)(aInst.pData + nSuperSize))->nVarDflt =
((RscClassInst *)(rDflt.pData + nSuperSize))->nVarDflt;
else
- ((RscClassInst *)(aInst.pData + nSuperSize))->nVarDflt = ~((ULONG)0);
+ ((RscClassInst *)(aInst.pData + nSuperSize))->nVarDflt = ~((sal_uLong)0);
for( i = 0; i < nEntries; i++ )
{
- aDfltI = GetInstData( bOwnClass ? rDflt.pData : NULL, i, TRUE );
+ aDfltI = GetInstData( bOwnClass ? rDflt.pData : NULL, i, sal_True );
if( (VAR_POINTER & pVarTypeList[ i ].nVarType)
&& !(VAR_NODATAINST & pVarTypeList[ i ].nVarType) )
@@ -264,7 +264,7 @@ RSCINST RscClass::Create
}
else
{
- aMemInst = GetInstData( aInst.pData, i, TRUE );
+ aMemInst = GetInstData( aInst.pData, i, sal_True );
aMemInst = aMemInst.pClass->Create( &aMemInst, aDfltI );
};
}
@@ -291,7 +291,7 @@ void RscClass::Destroy( const RSCINST & rInst )
{
RSCINST aTmpI;
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
{
// Objekt loeschen
@@ -360,7 +360,7 @@ ERRTYPE RscClass::SetVariable
}
nEntries++;
- if( nEntries > (sizeof( ULONG ) * 8) )
+ if( nEntries > (sizeof( sal_uLong ) * 8) )
{
// Bereich fuer Default zu klein
RscExit( 16 );
@@ -400,7 +400,7 @@ RSCINST RscClass::GetVariable
const RSCINST & rInst,
Atom nVarName,
const RSCINST & rInitInst,
- BOOL bInitDflt,
+ sal_Bool bInitDflt,
RscTop * pCreateClass
)
{
@@ -460,7 +460,7 @@ RSCINST RscClass::GetVariable
}
};
// auf nicht Default setzen
- SetVarDflt( rInst.pData, i, FALSE );
+ SetVarDflt( rInst.pData, i, sal_False );
return( aTmpI );
};
@@ -499,11 +499,11 @@ RSCINST RscClass::GetCopyVar
if( IsDflt( rInst.pData, i ) )
{
// mit Variablen Default initialiaieren
- aVarI = GetVariable( rInst, nVarName, RSCINST(), TRUE );
- SetVarDflt( rInst.pData, i, TRUE );
+ aVarI = GetVariable( rInst, nVarName, RSCINST(), sal_True );
+ SetVarDflt( rInst.pData, i, sal_True );
}
else
- aVarI = GetInstData( rInst.pData, i, TRUE );
+ aVarI = GetInstData( rInst.pData, i, sal_True );
};
return aVarI ;
@@ -519,11 +519,11 @@ RSCINST RscClass::GetCopyVar
|* Beschreibung
|*
*************************************************************************/
-BOOL RscClass::IsConsistent( const RSCINST & rInst )
+sal_Bool RscClass::IsConsistent( const RSCINST & rInst )
{
sal_uInt32 i = 0;
RSCINST aTmpI;
- BOOL bRet;
+ sal_Bool bRet;
bRet = RscTop::IsConsistent( rInst );
@@ -531,11 +531,11 @@ BOOL RscClass::IsConsistent( const RSCINST & rInst )
{
if( !(VAR_NODATAINST & pVarTypeList[ i ].nVarType) )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
if( ! aTmpI.pClass->IsConsistent( aTmpI ) )
- bRet = FALSE;
+ bRet = sal_False;
}
};
@@ -563,12 +563,12 @@ void RscClass::SetToDefault( const RSCINST & rInst )
// auf Default gesetzt
if( !(VAR_NODATAINST & pVarTypeList[ i ].nVarType) )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
aTmpI.pClass->SetToDefault( aTmpI );
}
}
- pClass->nVarDflt = ~((ULONG)0); // alles auf Default
+ pClass->nVarDflt = ~((sal_uLong)0); // alles auf Default
RscTop::SetToDefault( rInst );
}
@@ -580,7 +580,7 @@ void RscClass::SetToDefault( const RSCINST & rInst )
|* Beschreibung
|*
*************************************************************************/
-BOOL RscClass::IsDefault( const RSCINST & rInst )
+sal_Bool RscClass::IsDefault( const RSCINST & rInst )
{
sal_uInt32 i;
RSCINST aTmpI;
@@ -591,7 +591,7 @@ BOOL RscClass::IsDefault( const RSCINST & rInst )
// auf Default untersucht
if( !(VAR_NODATAINST & pVarTypeList[ i ].nVarType) )
if( !IsDflt( rInst.pData, i ) )
- return( FALSE );
+ return( sal_False );
};
return( RscTop::IsDefault( rInst ) );
@@ -630,24 +630,24 @@ RSCINST RscClass::GetDefault( Atom nVarId )
|* Beschreibung
|*
*************************************************************************/
-BOOL RscClass::IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle )
+sal_Bool RscClass::IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle )
{
RSCINST aTmpI;
- aTmpI = GetInstData( pData, nEle, TRUE );
+ aTmpI = GetInstData( pData, nEle, sal_True );
if( aTmpI.IsInst() )
{
if( VAR_SVDYNAMIC & pVarTypeList[ nEle ].nVarType )
- return FALSE;
+ return sal_False;
if( aTmpI.pClass == pVarTypeList[ nEle ].pClass )
//sie haben auch die gleiche Klasse
return aTmpI.pClass->IsValueDefault( aTmpI, GetDfltData( nEle ) );
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -657,39 +657,39 @@ BOOL RscClass::IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle )
|* Beschreibung
|*
*************************************************************************/
-BOOL RscClass::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscClass::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
sal_uInt32 i = 0;
RSCINST aTmpI;
RSCINST aDfltI;
if( !RscTop::IsValueDefault( rInst, pDef ) )
- return FALSE;
+ return sal_False;
if( pDef )
{
for( i = 0; i < nEntries; i++ )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
{
if( aTmpI.pClass != pVarTypeList[ i ].pClass )
//sie haben nicht die gleiche Klasse
- return FALSE;
+ return sal_False;
- aDfltI = GetInstData( pDef, i, TRUE );
+ aDfltI = GetInstData( pDef, i, sal_True );
if( !aDfltI.IsInst() )
aDfltI.pData = GetDfltData( i );
if( !aTmpI.pClass->IsValueDefault( aTmpI, aDfltI.pData ) )
- return FALSE;
+ return sal_False;
}
}
}
else
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -709,12 +709,12 @@ void RscClass::SetDefault( const RSCINST & rInst, Atom nVarName )
if( i < nEntries )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
{
aTmpI.pClass->Destroy( aTmpI );
aTmpI.pClass->Create( &aTmpI, RSCINST() );
- SetVarDflt( rInst.pData, i, TRUE );
+ SetVarDflt( rInst.pData, i, sal_True );
}
}
else //In Superklasse nach Variable suchen
@@ -765,20 +765,20 @@ void RscClass::WriteSrc
if( !IsDflt( rInst.pData, i ) )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
aTmpI.pClass->WriteSrcHeader(
aTmpI, fOutput, pTC, nTab, RscId(), pVarName );
}
fprintf( fOutput, "( " );
- aTmpI = GetInstData( rInst.pData, i+1, TRUE );
+ aTmpI = GetInstData( rInst.pData, i+1, sal_True );
if( !aTmpI.IsInst() )
aTmpI.pData = GetDfltData( i+1 );
aTmpI.pClass->WriteSrcHeader(
aTmpI, fOutput, pTC, nTab, RscId(), pVarName );
fprintf( fOutput, ", " );
- aTmpI = GetInstData( rInst.pData, i+2, TRUE );
+ aTmpI = GetInstData( rInst.pData, i+2, sal_True );
if( !aTmpI.IsInst() )
aTmpI.pData = GetDfltData( i+2 );
aTmpI.pClass->WriteSrcHeader(
@@ -790,7 +790,7 @@ void RscClass::WriteSrc
else if( !IsDflt( rInst.pData, i )
&& !IsValueDflt( rInst.pData, i ) )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
{
@@ -818,7 +818,7 @@ void RscClass::WriteSrc
|* Beschreibung
|*
*************************************************************************/
-INT32 RscClass::GetCorrectValues
+sal_Int32 RscClass::GetCorrectValues
(
const RSCINST & rInst,
sal_uInt32 nVarPos,
@@ -826,11 +826,11 @@ INT32 RscClass::GetCorrectValues
RscTypCont * pTC
)
{
- INT32 nLang = 0;
- INT32 nBaseValue;
+ sal_Int32 nLang = 0;
+ sal_Int32 nBaseValue;
// Basiswert holen
- RSCINST aTmpI = GetInstData( rInst.pData, nVarPos, TRUE );
+ RSCINST aTmpI = GetInstData( rInst.pData, nVarPos, sal_True );
aTmpI.pClass->GetNumber( aTmpI, &nBaseValue );
// Sprach Delta holen
@@ -838,8 +838,8 @@ INT32 RscClass::GetCorrectValues
if( aTmpI.IsInst() )
{
RscWriteRc aMem;
- aTmpI.pClass->WriteRc( aTmpI, aMem, pTC, 0, FALSE );
- nLang = (INT32)aMem.GetShort( nTupelIdx * sizeof(sal_uInt16) );
+ aTmpI.pClass->WriteRc( aTmpI, aMem, pTC, 0, sal_False );
+ nLang = (sal_Int32)aMem.GetShort( nTupelIdx * sizeof(sal_uInt16) );
}
return nLang + nBaseValue;
@@ -851,7 +851,7 @@ ERRTYPE RscClass::WriteInstRc
RscWriteRc & rMem,
RscTypCont * pTC,
sal_uInt32 nDeep,
- BOOL bExtra
+ sal_Bool bExtra
)
{
sal_uInt32 i = 0;
@@ -880,35 +880,35 @@ ERRTYPE RscClass::WriteInstRc
{
if( nRsc_X == pVarTypeList[ i ].nVarName )
{
- INT32 nVal = GetCorrectValues( rInst, i, 0, pTC );
+ sal_Int32 nVal = GetCorrectValues( rInst, i, 0, pTC );
rMem.Put( nVal );
}
else if( nRsc_Y == pVarTypeList[ i ].nVarName )
{
- INT32 nVal = GetCorrectValues( rInst, i, 1, pTC );
+ sal_Int32 nVal = GetCorrectValues( rInst, i, 1, pTC );
rMem.Put( nVal );
}
else if( nRsc_WIDTH == pVarTypeList[ i ].nVarName )
{
- INT32 nVal = GetCorrectValues( rInst, i, 2, pTC );
+ sal_Int32 nVal = GetCorrectValues( rInst, i, 2, pTC );
rMem.Put( nVal );
}
else if( nRsc_HEIGHT == pVarTypeList[ i ].nVarName )
{
- INT32 nVal = GetCorrectValues( rInst, i, 3, pTC );
+ sal_Int32 nVal = GetCorrectValues( rInst, i, 3, pTC );
rMem.Put( nVal );
}
else
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
- // Nur an Variable Extradata bExtra nicht auf FALSE
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
+ // Nur an Variable Extradata bExtra nicht auf sal_False
// setzen
aError = aTmpI.pClass->
WriteRcHeader( aTmpI, rMem, pTC,
RscId(), nDeep,
(nRsc_EXTRADATA
== pVarTypeList[ i ].nVarName)
- ? bExtra : FALSE );
+ ? bExtra : sal_False );
}
sal_uInt32 nMask = rMem.GetLong( nMaskOff );
nMask |= pVarTypeList[ i ].nMask;
@@ -922,15 +922,15 @@ ERRTYPE RscClass::WriteInstRc
aTmpI.pData = GetDfltData( i );
}
else
- aTmpI = GetInstData( rInst.pData, i, TRUE );
- // Nur an Variable Extradata bExtra nicht auf FALSE
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
+ // Nur an Variable Extradata bExtra nicht auf sal_False
// setzen
aError = aTmpI.pClass->
WriteRcHeader( aTmpI, rMem, pTC,
RscId(), nDeep,
(nRsc_EXTRADATA
== pVarTypeList[ i ].nVarName)
- ? bExtra : FALSE );
+ ? bExtra : sal_False );
}
}
}
@@ -951,7 +951,7 @@ ERRTYPE RscClass::WriteRc
RscWriteRc & rMem,
RscTypCont * pTC,
sal_uInt32 nDeep,
- BOOL bExtra
+ sal_Bool bExtra
)
{
ERRTYPE aError;
@@ -1027,7 +1027,7 @@ void RscClass::WriteRcCtor( FILE * fOutput, RscTypCont * pTC )
fprintf( fOutput, "\tsal_uInt32\tnObjMask;\n" );
fprintf( fOutput, "\tsal_uInt32\tnOffset = 0;\n" );
fprintf( fOutput, "\tBYTE *\tpResData;\n\n" );
- fprintf( fOutput, "\tpResData = (BYTE *)GetClassRes();\n\n" );
+ fprintf( fOutput, "\tpResData = (tBYTE *)GetClassRes();\n\n" );
fprintf( fOutput, "\tnObjMask = *(sal_uInt32*)pResData;\n" );
fprintf( fOutput, "\tnOffset += 4;\n\n" );
@@ -1071,7 +1071,7 @@ RscSysDepend::RscSysDepend( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper )
|*
*************************************************************************/
ERRTYPE RscSysDepend::WriteSysDependRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra, BOOL bFirst )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra, sal_Bool bFirst )
{
sal_uInt32 nId = 0xFFFFFFFF;
ERRTYPE aError;
@@ -1112,7 +1112,7 @@ ERRTYPE RscSysDepend::WriteSysDependRc( const RSCINST & rInst, RscWriteRc & rMem
|*
*************************************************************************/
ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError = RscClass::WriteRc( rInst, rMem, pTC, nDeep, bExtra );
@@ -1142,10 +1142,10 @@ RscFirstSysDepend::RscFirstSysDepend( Atom nId, sal_uInt32 nTypeId,
|*
*************************************************************************/
ERRTYPE RscFirstSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError = RscClass::WriteRc( rInst, rMem, pTC, nDeep, bExtra );
- aError = WriteSysDependRc( rInst, rMem, pTC, nDeep, bExtra, TRUE );
+ aError = WriteSysDependRc( rInst, rMem, pTC, nDeep, bExtra, sal_True );
return aError;
}
@@ -1202,7 +1202,7 @@ void RscTupel::WriteSrc( const RSCINST & rInst, FILE * fOutput,
if( !IsDflt( rInst.pData, i )
&& !IsValueDflt( rInst.pData, i ) )
{
- aTmpI = GetInstData( rInst.pData, i, TRUE );
+ aTmpI = GetInstData( rInst.pData, i, sal_True );
if( aTmpI.IsInst() )
aTmpI.pClass->WriteSrcHeader(
diff --git a/rsc/source/res/rscclobj.cxx b/rsc/source/res/rscclobj.cxx
index 895c778525e8..7005c9b38f09 100644
--- a/rsc/source/res/rscclobj.cxx
+++ b/rsc/source/res/rscclobj.cxx
@@ -67,16 +67,16 @@ sal_uInt32 RefNode::GetId() const
|* RefNode::PutObjNode()
|*
*************************************************************************/
-BOOL RefNode::PutObjNode( ObjNode * pPutObject ){
+sal_Bool RefNode::PutObjNode( ObjNode * pPutObject ){
// insert a node in the b-tree pObjBiTree
// if the node with the same name is in pObjBiTree,
-// return FALSE and no insert,
+// return sal_False and no insert,
if( pObjBiTree )
return( pObjBiTree->Insert( pPutObject ) );
pObjBiTree = pPutObject;
- return( TRUE );
+ return( sal_True );
}
/****************** O b j N o d e ****************************************/
@@ -101,7 +101,7 @@ ObjNode * RefNode :: GetObjNode( const RscId & rRscId ){
|* ObjNode::ObjNode()
|*
*************************************************************************/
-ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey ){
+ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey ){
pRscObj = pData;
aRscId = rId;
lFileKey = lKey;
@@ -112,7 +112,7 @@ ObjNode::ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey ){
|* ObjNode::DelObjNode()
|*
*************************************************************************/
-ObjNode * ObjNode::DelObjNode( RscTop * pClass, ULONG nFileKey ){
+ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ){
ObjNode * pRetNode = this;
if( Right() )
@@ -152,33 +152,33 @@ sal_uInt32 ObjNode::GetId() const
|* ObjNode::IsConsistent()
|*
*************************************************************************/
-BOOL ObjNode::IsConsistent()
+sal_Bool ObjNode::IsConsistent()
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( (long)aRscId > 0x7FFF || (long)aRscId < 1 )
{
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
if( Left() )
{
if( !((ObjNode *)Left())->IsConsistent() )
- bRet = FALSE;
+ bRet = sal_False;
if( ((ObjNode *)Left())->aRscId >= aRscId )
{
- bRet = FALSE;
+ bRet = sal_False;
}
};
if( Right() )
{
if( ((ObjNode *)Right())->aRscId <= aRscId )
{
- bRet = FALSE;
+ bRet = sal_False;
}
if( !((ObjNode *)Right())->IsConsistent() )
- bRet = FALSE;
+ bRet = sal_False;
};
};
diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx
index 9903fe27c076..04f7b1ae00b1 100644
--- a/rsc/source/res/rscconst.cxx
+++ b/rsc/source/res/rscconst.cxx
@@ -84,7 +84,7 @@ RSCCLASS_TYPE RscConst::GetClassType() const
|* RscConst::SetConstance()
|*
*************************************************************************/
-ERRTYPE RscConst::SetConstant( Atom nVarName, INT32 lValue ){
+ERRTYPE RscConst::SetConstant( Atom nVarName, sal_Int32 lValue ){
if( pVarArray )
pVarArray = (VarEle *)
rtl_reallocateMemory( (void *)pVarArray,
@@ -115,7 +115,7 @@ Atom RscConst::GetConstant( sal_uInt32 nPos ){
|* RscConst::GetConstValue()
|*
*************************************************************************/
-BOOL RscConst::GetConstValue( Atom nConst, INT32 * pValue ) const
+sal_Bool RscConst::GetConstValue( Atom nConst, sal_Int32 * pValue ) const
{
sal_uInt32 i = 0;
@@ -123,9 +123,9 @@ BOOL RscConst::GetConstValue( Atom nConst, INT32 * pValue ) const
if( pVarArray[ i ].nId == nConst )
{
*pValue = pVarArray[ i ].lValue;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -133,7 +133,7 @@ BOOL RscConst::GetConstValue( Atom nConst, INT32 * pValue ) const
|* RscConst::GetValueConst()
|*
*************************************************************************/
-BOOL RscConst::GetValueConst( INT32 lValue, Atom * pConst ) const
+sal_Bool RscConst::GetValueConst( sal_Int32 lValue, Atom * pConst ) const
{
sal_uInt32 i = 0;
@@ -141,9 +141,9 @@ BOOL RscConst::GetValueConst( INT32 lValue, Atom * pConst ) const
if( pVarArray[ i ].lValue == lValue )
{
*pConst = pVarArray[ i ].nId;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -219,14 +219,14 @@ RscEnum::RscEnum( Atom nId, sal_uInt32 nTypeId )
|* RscEnum::SetConst()
|*
*************************************************************************/
-ERRTYPE RscEnum::SetConst( const RSCINST & rInst, Atom nConst, INT32 /*nVal*/ )
+ERRTYPE RscEnum::SetConst( const RSCINST & rInst, Atom nConst, sal_Int32 /*nVal*/ )
{
sal_uInt32 i = 0;
if( nEntries != (i = GetConstPos( nConst )) )
{
((RscEnumInst *)rInst.pData)->nValue = i;
- ((RscEnumInst *)rInst.pData)->bDflt = FALSE;
+ ((RscEnumInst *)rInst.pData)->bDflt = sal_False;
return( ERR_OK );
};
@@ -238,12 +238,12 @@ ERRTYPE RscEnum::SetConst( const RSCINST & rInst, Atom nConst, INT32 /*nVal*/ )
|* RscEnum::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscEnum::SetNumber( const RSCINST & rInst, INT32 lValue )
+ERRTYPE RscEnum::SetNumber( const RSCINST & rInst, sal_Int32 lValue )
{
sal_uInt32 i = 0;
for( i = 0; i < nEntries; i++ ){
- if( (INT32)pVarArray[ i ].lValue == lValue )
+ if( (sal_Int32)pVarArray[ i ].lValue == lValue )
return( SetConst( rInst, pVarArray[ i ].nId, lValue ) );
};
@@ -265,7 +265,7 @@ ERRTYPE RscEnum::GetConst( const RSCINST & rInst, Atom * pH ){
|* RscEnum::GetNumber()
|*
*************************************************************************/
-ERRTYPE RscEnum::GetNumber( const RSCINST & rInst, INT32 * pNumber ){
+ERRTYPE RscEnum::GetNumber( const RSCINST & rInst, sal_Int32 * pNumber ){
*pNumber = pVarArray[ ((RscEnumInst *)rInst.pData)->nValue ].lValue;
return( ERR_OK );
}
@@ -275,7 +275,7 @@ ERRTYPE RscEnum::GetNumber( const RSCINST & rInst, INT32 * pNumber ){
|* RscEnum::Create()
|*
*************************************************************************/
-RSCINST RscEnum::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass ){
+RSCINST RscEnum::Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool bOwnClass ){
RSCINST aInst;
if( !pInst ){
@@ -292,7 +292,7 @@ RSCINST RscEnum::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass
memmove( aInst.pData, rDflt.pData, Size() );
else{
((RscEnumInst *)aInst.pData)->nValue = 0;
- ((RscEnumInst *)aInst.pData)->bDflt = TRUE;
+ ((RscEnumInst *)aInst.pData)->bDflt = sal_True;
}
return( aInst );
@@ -303,16 +303,16 @@ RSCINST RscEnum::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass
|* RscEnum::IsValueDefault()
|*
*************************************************************************/
-BOOL RscEnum::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+sal_Bool RscEnum::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
if( pDef ){
if( ((RscEnumInst*)rInst.pData)->nValue ==
((RscEnumInst*)pDef)->nValue )
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -333,9 +333,9 @@ void RscEnum::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscEnum::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
- aMem.Put( (INT32)pVarArray[ ((RscEnumInst *)rInst.pData)->nValue ].lValue );
+ aMem.Put( (sal_Int32)pVarArray[ ((RscEnumInst *)rInst.pData)->nValue ].lValue );
return( ERR_OK );
}
diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx
index e2b49d7d9ab7..c39be82b5c7e 100644
--- a/rsc/source/res/rsccont.cxx
+++ b/rsc/source/res/rsccont.cxx
@@ -63,7 +63,7 @@ void ENTRY_STRUCT::Destroy()
|*
*************************************************************************/
RscBaseCont::RscBaseCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper,
- BOOL bNoIdent )
+ sal_Bool bNoIdent )
: RscTop( nId, nTypeId, pSuper ),
nSize( 0 )
{
@@ -118,7 +118,7 @@ void RscBaseCont::DestroyElements( RscBaseContInst * pClassData )
|*
*************************************************************************/
RSCINST RscBaseCont::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
sal_uInt32 i = 0;
RSCINST aInst;
@@ -138,7 +138,7 @@ RSCINST RscBaseCont::Create( RSCINST * pInst, const RSCINST & rDflt,
pClassData = (RscBaseContInst *)(aInst.pData + nOffInstData);
pClassData->nEntries = 0;
pClassData->pEntries = NULL;
- pClassData->bDflt = TRUE;
+ pClassData->bDflt = sal_True;
if( bOwnClass ){
RscBaseContInst * pDfltClassData;
@@ -251,7 +251,7 @@ ERRTYPE RscBaseCont::GetElement( const RSCINST & rInst, const RscId & rEleName,
else
pCreateClass = pTypeClass;
- pClassData->bDflt = FALSE;
+ pClassData->bDflt = sal_False;
if( !bNoId )
aTmpI = SearchEle( rInst, rEleName, pCreateClass );
// Eintrag gefunden
@@ -446,11 +446,11 @@ else
|* RscBaseCont::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscBaseCont::SetNumber( const RSCINST & rInst, INT32 lValue ){
+ERRTYPE RscBaseCont::SetNumber( const RSCINST & rInst, sal_Int32 lValue ){
RscBaseContInst * pClassData;
RSCINST aTmpI;
ERRTYPE aError;
- INT32 lNumber;
+ sal_Int32 lNumber;
pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData);
@@ -482,13 +482,13 @@ else
ERRTYPE RscBaseCont::SetBool
(
const RSCINST & rInst,
- BOOL bValue
+ sal_Bool bValue
)
{
RscBaseContInst * pClassData;
RSCINST aTmpI;
ERRTYPE aError;
- BOOL bBool;
+ sal_Bool bBool;
pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData);
@@ -522,7 +522,7 @@ ERRTYPE RscBaseCont::SetConst
(
const RSCINST & rInst,
Atom nValueId,
- INT32 lValue
+ sal_Int32 lValue
)
{
RscBaseContInst * pClassData;
@@ -598,10 +598,10 @@ else
|* RscBaseCont::IsConsistent()
|*
*************************************************************************/
-BOOL RscBaseCont::IsConsistent( const RSCINST & rInst ) {
+sal_Bool RscBaseCont::IsConsistent( const RSCINST & rInst ) {
sal_uInt32 i = 0;
RscBaseContInst * pClassData;
- BOOL bRet;
+ sal_Bool bRet;
bRet = RscTop::IsConsistent( rInst );
@@ -611,19 +611,19 @@ BOOL RscBaseCont::IsConsistent( const RSCINST & rInst ) {
// Komplexitaet = n^2 / 2
for( i = 0; i < pClassData->nEntries; i++ ){
if( !bNoId ){
- if( (INT32)pClassData->pEntries[ i ].aName > 0x7FFF
- || (INT32)pClassData->pEntries[ i ].aName < 1 ){
- bRet = FALSE;
+ if( (sal_Int32)pClassData->pEntries[ i ].aName > 0x7FFF
+ || (sal_Int32)pClassData->pEntries[ i ].aName < 1 ){
+ bRet = sal_False;
}
else if( SearchElePos( rInst, pClassData->pEntries[ i ].aName,
pClassData->pEntries[ i ].aInst.pClass, i +1 ).IsInst() )
{
- bRet = FALSE;
+ bRet = sal_False;
};
}
if( ! pClassData->pEntries[ i ].aInst.pClass->
IsConsistent( pClassData->pEntries[ i ].aInst ) )
- bRet = FALSE;
+ bRet = sal_False;
};
return( bRet );
@@ -655,20 +655,20 @@ void RscBaseCont::SetToDefault( const RSCINST & rInst )
|* RscBaseCont::IsDefault()
|*
*************************************************************************/
-BOOL RscBaseCont::IsDefault( const RSCINST & rInst ){
+sal_Bool RscBaseCont::IsDefault( const RSCINST & rInst ){
sal_uInt32 i = 0;
RscBaseContInst * pClassData;
pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData);
if( !pClassData->bDflt )
- return FALSE;
+ return sal_False;
for( i = 0; i < pClassData->nEntries; i++ ){
if( ! pClassData->pEntries[ i ].aInst.pClass->
IsDefault( pClassData->pEntries[ i ].aInst ) )
{
- return( FALSE );
+ return( sal_False );
};
};
@@ -680,19 +680,19 @@ BOOL RscBaseCont::IsDefault( const RSCINST & rInst ){
|* RscBaseCont::IsValueDefault()
|*
*************************************************************************/
-BOOL RscBaseCont::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscBaseCont::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
RscBaseContInst * pClassData;
if( !RscTop::IsValueDefault( rInst, pDef ) )
- return FALSE;
+ return sal_False;
pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData);
if( pClassData->nEntries )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -775,14 +775,14 @@ void RscBaseCont::ContWriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscBaseCont::ContWriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
sal_uInt32 i = 0;
RscBaseContInst * pClassData;
ERRTYPE aError;
if( bExtra || bNoId )
- { // Nur Subresourcen schreiben, wenn bExtra == TRUE
+ { // Nur Subresourcen schreiben, wenn bExtra == sal_True
pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData);
for( i = 0; i < pClassData->nEntries && aError.IsOk(); i++ ){
@@ -803,7 +803,7 @@ void RscBaseCont::ContWriteRcAccess
FILE * fOutput,
RscTypCont * pTC,
const char * pName,
- BOOL bWriteSize
+ sal_Bool bWriteSize
)
{
if( (bNoId || bWriteSize) && !pTypeClass1 )
@@ -846,7 +846,7 @@ void RscBaseCont::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscBaseCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError;
@@ -926,7 +926,7 @@ ERRTYPE RscBaseCont::WriteCxx( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
RscContWriteSrc::RscContWriteSrc( Atom nId, sal_uInt32 nTypeId,
- RscTop * pSuper, BOOL bNoIdent )
+ RscTop * pSuper, sal_Bool bNoIdent )
: RscBaseCont( nId, nTypeId, pSuper, bNoIdent )
{}
@@ -961,7 +961,7 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|* RscCont::RscCont()
|*
*************************************************************************/
-RscCont::RscCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, BOOL bNoIdent )
+RscCont::RscCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, sal_Bool bNoIdent )
: RscContWriteSrc( nId, nTypeId, pSuper, bNoIdent )
{}
@@ -971,7 +971,7 @@ RscCont::RscCont( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, BOOL bNoIdent )
|*
*************************************************************************/
ERRTYPE RscCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
RscBaseContInst * pClassData;
ERRTYPE aError;
@@ -996,7 +996,7 @@ void RscCont::WriteRcAccess
const char * pName
)
{
- ContWriteRcAccess( fOutput, pTC, pName, TRUE );
+ ContWriteRcAccess( fOutput, pTC, pName, sal_True );
}
/*************************************************************************
@@ -1005,7 +1005,7 @@ void RscCont::WriteRcAccess
|*
*************************************************************************/
RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId,
- RscTop * pSuper, BOOL bNoIdent )
+ RscTop * pSuper, sal_Bool bNoIdent )
: RscContWriteSrc( nId, nTypeId, pSuper, bNoIdent )
{}
@@ -1015,7 +1015,7 @@ RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId,
|*
*************************************************************************/
ERRTYPE RscContExtraData::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError;
diff --git a/rsc/source/res/rscflag.cxx b/rsc/source/res/rscflag.cxx
index 3f88b34dffd2..aeaf2fd2e43d 100644
--- a/rsc/source/res/rscflag.cxx
+++ b/rsc/source/res/rscflag.cxx
@@ -87,7 +87,7 @@ ERRTYPE RscFlag::SetNotConst( const RSCINST & rInst, Atom nConst )
|* RscFlag::SetConst()
|*
*************************************************************************/
-ERRTYPE RscFlag::SetConst( const RSCINST & rInst, Atom nConst, INT32 /*nVal*/ )
+ERRTYPE RscFlag::SetConst( const RSCINST & rInst, Atom nConst, sal_Int32 /*nVal*/ )
{
sal_uInt32 i = 0, nFlag = 0;
@@ -126,7 +126,7 @@ RSCINST RscFlag::CreateBasic( RSCINST * pInst )
|* RscFlag::Create()
|*
*************************************************************************/
-RSCINST RscFlag::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass )
+RSCINST RscFlag::Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool bOwnClass )
{
RSCINST aInst = CreateBasic( pInst );
sal_uInt32 i = 0;
@@ -154,7 +154,7 @@ RSCINST RscFlag::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass
|*
*************************************************************************/
RSCINST RscFlag::CreateClient( RSCINST * pInst, const RSCINST & rDfltI,
- BOOL bOwnClass, Atom nConstId )
+ sal_Bool bOwnClass, Atom nConstId )
{
RSCINST aInst = CreateBasic( pInst );
sal_uInt32 i = 0, nFlag = 0;
@@ -198,17 +198,17 @@ void RscFlag::SetToDefault( const RSCINST & rInst )
|* RscFlag::IsDlft()
|*
*************************************************************************/
-BOOL RscFlag::IsDefault( const RSCINST & rInst )
+sal_Bool RscFlag::IsDefault( const RSCINST & rInst )
{
sal_uInt32 i = 0;
for( i = 0; i < Size() / sizeof( RscFlagInst ); i++ )
if( ((RscFlagInst *)rInst.pData)[ i ].nDfltFlags != 0xFFFFFFFF )
- return( FALSE );
- return( TRUE );
+ return( sal_False );
+ return( sal_True );
}
-BOOL RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId )
+sal_Bool RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId )
{
sal_uInt32 i = 0, nFlag = 0;
@@ -216,11 +216,11 @@ BOOL RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId )
nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) );
i = i / (sizeof( sal_uInt32 ) * 8);
if( ((RscFlagInst *)rInst.pData)[ i ].nDfltFlags & nFlag )
- return( TRUE );
+ return( sal_True );
else
- return( FALSE );
+ return( sal_False );
};
- return( TRUE );
+ return( sal_True );
}
/*************************************************************************
@@ -228,7 +228,7 @@ BOOL RscFlag::IsDefault( const RSCINST & rInst, Atom nConstId )
|* RscFlag::IsValueDefault()
|*
*************************************************************************/
-BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
+sal_Bool RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
Atom nConstId )
{
sal_uInt32 i = 0, nFlag = 0;
@@ -241,15 +241,15 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
if( (((RscFlagInst *)rInst.pData)[ i ].nFlags & nFlag)
== (((RscFlagInst *)pDef)[ i ].nFlags & nFlag) )
{
- return TRUE;
+ return sal_True;
}
}
};
- return FALSE;
+ return sal_False;
}
-BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
sal_uInt32 i = 0;
@@ -262,7 +262,7 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
if( (((RscFlagInst *)rInst.pData)[ nIndex ].nFlags & Flag)
!= (((RscFlagInst *)pDef)[ nIndex ].nFlags & Flag) )
{
- return FALSE;
+ return sal_False;
}
Flag <<= 1;
if( !Flag )
@@ -270,9 +270,9 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
};
}
else
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -280,7 +280,7 @@ BOOL RscFlag::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
|* RscFlag::IsSet()
|*
*************************************************************************/
-BOOL RscFlag::IsSet( const RSCINST & rInst, Atom nConstId )
+sal_Bool RscFlag::IsSet( const RSCINST & rInst, Atom nConstId )
{
sal_uInt32 i = 0, nFlag = 0;
@@ -288,11 +288,11 @@ BOOL RscFlag::IsSet( const RSCINST & rInst, Atom nConstId )
nFlag = 1 << (i % (sizeof( sal_uInt32 ) * 8) );
i = i / (sizeof( sal_uInt32 ) * 8);
if( ((RscFlagInst *)rInst.pData)[ i ].nFlags & nFlag )
- return( TRUE );
+ return( sal_True );
else
- return( FALSE );
+ return( sal_False );
};
- return( TRUE );
+ return( sal_True );
}
/*************************************************************************
@@ -304,7 +304,7 @@ void RscFlag::WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont *, sal_uInt32, const char * )
{
sal_uInt32 i = 0, Flag = 0, nIndex = 0;
- BOOL bComma = FALSE;
+ sal_Bool bComma = sal_False;
Flag = 1;
for( i = 0; i < nEntries; i++ ){
@@ -318,7 +318,7 @@ void RscFlag::WriteSrc( const RSCINST & rInst, FILE * fOutput,
fprintf( fOutput, "not " );
fprintf( fOutput, "%s", pHS->getString( pVarArray[ i ].nId ).getStr() );
}
- bComma = TRUE;
+ bComma = sal_True;
}
Flag <<= 1;
if( !Flag )
@@ -332,9 +332,9 @@ void RscFlag::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
- INT32 lVal = 0;
+ sal_Int32 lVal = 0;
sal_uInt32 i = 0, Flag = 0, nIndex = 0;
Flag = 1;
@@ -348,7 +348,7 @@ ERRTYPE RscFlag::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
Flag = 1;
};
- aMem.Put( (INT32)lVal );
+ aMem.Put( (sal_Int32)lVal );
return( ERR_OK );
}
@@ -395,7 +395,7 @@ void RscClient::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
RSCINST RscClient::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aTmpI, aDfltI;
diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx
index 7a44aa4d8921..1e65962099a8 100644
--- a/rsc/source/res/rscmgr.cxx
+++ b/rsc/source/res/rscmgr.cxx
@@ -67,7 +67,7 @@ sal_uInt32 RscMgr::Size()
|* RscMgr::Create()
|*
*************************************************************************/
-RSCINST RscMgr::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass ){
+RSCINST RscMgr::Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool bOwnClass ){
RSCINST aInst;
RscMgrInst * pClassData;
@@ -117,7 +117,7 @@ void RscMgr::SetToDefault( const RSCINST & rInst )
RscMgrInst * pClassData;
pClassData = (RscMgrInst *)(rInst.pData + RscClass::Size());
- pClassData->bDflt = TRUE;
+ pClassData->bDflt = sal_True;
RscClass::SetToDefault( rInst );
}
@@ -127,12 +127,12 @@ void RscMgr::SetToDefault( const RSCINST & rInst )
|* RscMgr::IsDefault()
|*
*************************************************************************/
-BOOL RscMgr::IsDefault( const RSCINST & rInst ){
+sal_Bool RscMgr::IsDefault( const RSCINST & rInst ){
RscMgrInst * pClassData;
pClassData = (RscMgrInst *)(rInst.pData + RscClass::Size());
if( !pClassData->bDflt )
- return( FALSE );
+ return( sal_False );
return( RscClass::IsDefault( rInst ) );
}
@@ -142,23 +142,23 @@ BOOL RscMgr::IsDefault( const RSCINST & rInst ){
|* RscMgr::IsValueDefault()
|*
*************************************************************************/
-BOOL RscMgr::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+sal_Bool RscMgr::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
RscMgrInst * pClassData;
RscMgrInst * pDfltData;
if( !RscClass::IsValueDefault( rInst, pDef ) )
- return FALSE;
+ return sal_False;
if( pDef ){
pClassData = (RscMgrInst *)(rInst.pData + RscClass::Size());
pDfltData = (RscMgrInst *)(pDef + RscClass::Size());
if( !pClassData->aRefId.IsId() && !pDfltData->aRefId.IsId() ){
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
@@ -215,7 +215,7 @@ void RscMgr::WriteSrc( const RSCINST &, FILE *, RscTypCont *, sal_uInt32,
*************************************************************************/
ERRTYPE RscMgr::WriteRcHeader( const RSCINST & rInst, RscWriteRc & rMem,
RscTypCont * pTC, const RscId &rId,
- sal_uInt32 nDeep, BOOL bExtra )
+ sal_uInt32 nDeep, sal_Bool bExtra )
{
RscMgrInst * pClassData;
ERRTYPE aError;
@@ -307,7 +307,7 @@ ERRTYPE RscMgr::WriteRcHeader( const RSCINST & rInst, RscWriteRc & rMem,
|*
*************************************************************************/
ERRTYPE RscMgr::WriteRc( const RSCINST &, RscWriteRc &,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
return( ERR_OK );
@@ -530,9 +530,9 @@ ERRTYPE RscMgr::WriteCxx( const RSCINST & rInst, FILE * fOutput,
|* RscArray::IsConsistent()
|*
*************************************************************************/
-BOOL RscMgr::IsConsistent( const RSCINST & rInst )
+sal_Bool RscMgr::IsConsistent( const RSCINST & rInst )
{
- BOOL bRet;
+ sal_Bool bRet;
RscMgrInst * pClassData;
bRet = RscClass::IsConsistent( rInst );
@@ -543,7 +543,7 @@ BOOL RscMgr::IsConsistent( const RSCINST & rInst )
|| (pClassData->aRefId.GetNumber() > 0x7FFF)
|| IsToDeep( rInst ).IsError()) )
{
- bRet = FALSE;
+ bRet = sal_False;
}
return( bRet );
@@ -589,7 +589,7 @@ ERRTYPE RscMgr::IsToDeep( const RSCINST & rInst, sal_uInt32 nDeep )
aTmpI.pData = pObjNode->GetRscObj();
nDeep++;
}
- else //aTmpI.IsInst() wird FALSE, Schleife beenden
+ else //aTmpI.IsInst() wird sal_False, Schleife beenden
aTmpI.pData = NULL;
}
@@ -628,7 +628,7 @@ ERRTYPE RscMgr::SetRef( const RSCINST & rInst, const RscId & rRefId )
aError = IsToDeep( rInst );
if( aError.IsOk() )
- pClassData->bDflt = FALSE;
+ pClassData->bDflt = sal_False;
else
pClassData->aRefId = aOldId;
}
diff --git a/rsc/source/res/rscrange.cxx b/rsc/source/res/rscrange.cxx
index 0e1aa26736b6..132133d5fe76 100644
--- a/rsc/source/res/rscrange.cxx
+++ b/rsc/source/res/rscrange.cxx
@@ -71,7 +71,7 @@ RSCCLASS_TYPE RscRange::GetClassType() const
|* RscRange::SetRange()
|*
*************************************************************************/
-ERRTYPE RscRange::SetRange( INT32 nMinimum, INT32 nMaximum )
+ERRTYPE RscRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
{
if( nMinimum > nMaximum )
{
@@ -92,18 +92,18 @@ ERRTYPE RscRange::SetRange( INT32 nMinimum, INT32 nMaximum )
|* RscRange::IsValueDefault()
|*
*************************************************************************/
-BOOL RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
if( pDef )
{
if( ((RscRangeInst*)rInst.pData)->nValue ==
((RscRangeInst*)pDef)->nValue )
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -111,12 +111,12 @@ BOOL RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
|* RscRange::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscRange::SetNumber( const RSCINST & rInst, INT32 nValue )
+ERRTYPE RscRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
{
if( nMax < nValue || nMin > nValue )
return( ERR_RSCRANGE_OUTDEFSET );
((RscRangeInst *)rInst.pData)->nValue = (sal_uInt16)( nValue - nMin );
- ((RscRangeInst *)rInst.pData)->bDflt = FALSE;
+ ((RscRangeInst *)rInst.pData)->bDflt = sal_False;
return( ERR_OK );
}
@@ -125,7 +125,7 @@ ERRTYPE RscRange::SetNumber( const RSCINST & rInst, INT32 nValue )
|* RscRange::GetNumber()
|*
*************************************************************************/
-ERRTYPE RscRange::GetNumber( const RSCINST & rInst, INT32 * pN )
+ERRTYPE RscRange::GetNumber( const RSCINST & rInst, sal_Int32 * pN )
{
*pN = ((RscRangeInst *)rInst.pData)->nValue + nMin;
return( ERR_OK );
@@ -137,7 +137,7 @@ ERRTYPE RscRange::GetNumber( const RSCINST & rInst, INT32 * pN )
|*
*************************************************************************/
RSCINST RscRange::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aInst;
@@ -160,7 +160,7 @@ RSCINST RscRange::Create( RSCINST * pInst, const RSCINST & rDflt,
((RscRangeInst *)aInst.pData)->nValue = (sal_uInt16)(0L - nMin);
else
((RscRangeInst *)aInst.pData)->nValue = 0;
- ((RscRangeInst *)aInst.pData)->bDflt = TRUE;
+ ((RscRangeInst *)aInst.pData)->bDflt = sal_True;
}
return( aInst );
@@ -183,7 +183,7 @@ void RscRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
if( nMin >= 0 )
{
@@ -245,7 +245,7 @@ RSCCLASS_TYPE RscLongRange::GetClassType() const
|* RscLongRange::SetRange()
|*
*************************************************************************/
-ERRTYPE RscLongRange::SetRange( INT32 nMinimum, INT32 nMaximum )
+ERRTYPE RscLongRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
{
if( nMinimum > nMaximum )
{
@@ -266,14 +266,14 @@ ERRTYPE RscLongRange::SetRange( INT32 nMinimum, INT32 nMaximum )
|* RscLongRange::IsValueDefault()
|*
*************************************************************************/
-BOOL RscLongRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
+sal_Bool RscLongRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
{
if( pDef )
return 0 == memcmp( &((RscLongRangeInst*)rInst.pData)->nValue,
&((RscLongRangeInst*)pDef)->nValue,
- sizeof( INT32 ) );
+ sizeof( sal_Int32 ) );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -281,13 +281,13 @@ BOOL RscLongRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
|* RscLongRange::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscLongRange::SetNumber( const RSCINST & rInst, INT32 nValue )
+ERRTYPE RscLongRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
{
if( nMax < nValue || nMin > nValue )
return( ERR_RSCRANGE_OUTDEFSET );
void * pData = &((RscLongRangeInst*)rInst.pData)->nValue;
- memmove( pData, &nValue, sizeof( INT32 ) );
- ((RscLongRangeInst *)rInst.pData)->bDflt = FALSE;
+ memmove( pData, &nValue, sizeof( sal_Int32 ) );
+ ((RscLongRangeInst *)rInst.pData)->bDflt = sal_False;
return( ERR_OK );
}
@@ -296,10 +296,10 @@ ERRTYPE RscLongRange::SetNumber( const RSCINST & rInst, INT32 nValue )
|* RscLongRange::GetNumber()
|*
*************************************************************************/
-ERRTYPE RscLongRange::GetNumber( const RSCINST & rInst, INT32 * pN )
+ERRTYPE RscLongRange::GetNumber( const RSCINST & rInst, sal_Int32 * pN )
{
memmove( pN, &((RscLongRangeInst*)rInst.pData)->nValue,
- sizeof( INT32 ) );
+ sizeof( sal_Int32 ) );
return( ERR_OK );
}
@@ -309,7 +309,7 @@ ERRTYPE RscLongRange::GetNumber( const RSCINST & rInst, INT32 * pN )
|*
*************************************************************************/
RSCINST RscLongRange::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aInst;
@@ -328,14 +328,14 @@ RSCINST RscLongRange::Create( RSCINST * pInst, const RSCINST & rDflt,
memmove( aInst.pData, rDflt.pData, sizeof( RscLongRangeInst ) );
else
{
- INT32 lDflt;
+ sal_Int32 lDflt;
if( 0L >= nMin && 0L <= nMax )
lDflt = 0;
else
lDflt = nMin;
void * pData = &((RscLongRangeInst*)aInst.pData)->nValue;
- memmove( pData, &lDflt, sizeof( INT32 ) );
- ((RscLongRangeInst *)aInst.pData)->bDflt = TRUE;
+ memmove( pData, &lDflt, sizeof( sal_Int32 ) );
+ ((RscLongRangeInst *)aInst.pData)->bDflt = sal_True;
}
return( aInst );
@@ -349,7 +349,7 @@ RSCINST RscLongRange::Create( RSCINST * pInst, const RSCINST & rDflt,
void RscLongRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont *, sal_uInt32, const char * )
{
- INT32 lVal;
+ sal_Int32 lVal;
GetNumber( rInst, &lVal );
fprintf( fOutput, "%d", static_cast<int>(lVal) );
}
@@ -360,12 +360,12 @@ void RscLongRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscLongRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
- INT32 lVal;
+ sal_Int32 lVal;
GetNumber( rInst, &lVal );
- aMem.Put( (INT32)lVal );
+ aMem.Put( (sal_Int32)lVal );
return( ERR_OK );
}
@@ -380,7 +380,7 @@ void RscLongRange::WriteRcAccess
{
fprintf( fOutput, "\t\tSet%s( ", pName );
fprintf( fOutput, "GetLong( pResData+nOffset ) );\n" );
- fprintf( fOutput, "\t\tnOffset += sizeof( INT32 );\n" );
+ fprintf( fOutput, "\t\tnOffset += sizeof( sal_Int32 );\n" );
}
/****************** R s c L o n g E n u m R a n g e *********************/
@@ -400,7 +400,7 @@ RscLongEnumRange::RscLongEnumRange( Atom nId, sal_uInt32 nTypeId )
|* Beschreibung
*************************************************************************/
ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/,
- INT32 nValue )
+ sal_Int32 nValue )
{
return SetNumber( rInst, nValue );
}
@@ -433,7 +433,7 @@ RSCCLASS_TYPE RscIdRange::GetClassType() const
|* RscIdRange::Create()
|*
*************************************************************************/
-RSCINST RscIdRange::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnClass ){
+RSCINST RscIdRange::Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool bOwnClass ){
RSCINST aInst;
RscId * pClassData;
@@ -456,11 +456,11 @@ RSCINST RscIdRange::Create( RSCINST * pInst, const RSCINST & rDflt, BOOL bOwnCla
else{
*pClassData = RscId();
if( 0 >= nMin && 0 <= nMax )
- *pClassData = RscId( (INT32)0 );
+ *pClassData = RscId( (sal_Int32)0 );
else
*pClassData = RscId( nMin );
//cUnused wird fuer Defaultkennung verwendet
- ((RscId *)aInst.pData)->aExp.cUnused = TRUE;
+ ((RscId *)aInst.pData)->aExp.cUnused = sal_True;
}
return( aInst );
@@ -480,7 +480,7 @@ void RscIdRange :: Destroy( const RSCINST & rInst ){
|* RscIdRange::IsValueDefault()
|*
*************************************************************************/
-BOOL RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+sal_Bool RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
if( pDef ){
if( ((RscId*)rInst.pData)->aExp.IsNumber()
&& ((RscId*)pDef)->aExp.IsNumber() )
@@ -488,12 +488,12 @@ BOOL RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
if( ((RscId*)rInst.pData)->GetNumber() ==
((RscId*)pDef)->GetNumber() )
{
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -501,13 +501,13 @@ BOOL RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
|* RscIdRange::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, INT32 nValue )
+ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
{
if( nMax < nValue || nMin > nValue )
return( ERR_RSCRANGE_OUTDEFSET );
*(RscId *)rInst.pData = RscId( nValue );
- ((RscId *)rInst.pData)->aExp.cUnused = FALSE;
+ ((RscId *)rInst.pData)->aExp.cUnused = sal_False;
return( ERR_OK );
}
@@ -516,7 +516,7 @@ ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, INT32 nValue )
|* RscIdRange::GetNumber()
|*
*************************************************************************/
-ERRTYPE RscIdRange::GetNumber( const RSCINST & rInst, INT32 * plValue ){
+ERRTYPE RscIdRange::GetNumber( const RSCINST & rInst, sal_Int32 * plValue ){
*plValue = ((RscId *)rInst.pData)->GetNumber();
return( ERR_OK );
}
@@ -532,7 +532,7 @@ ERRTYPE RscIdRange::SetRef( const RSCINST & rInst, const RscId & rRscId ){
aError = SetNumber( rInst, rRscId );
if( aError.IsOk() ){
*(RscId *)rInst.pData = rRscId;
- ((RscId *)rInst.pData)->aExp.cUnused = FALSE;
+ ((RscId *)rInst.pData)->aExp.cUnused = sal_False;
}
}
else
@@ -569,11 +569,11 @@ void RscIdRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscIdRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont *, sal_uInt32, BOOL )
+ RscTypCont *, sal_uInt32, sal_Bool )
{
- INT32 lVal = ((RscId*)rInst.pData)->GetNumber();
+ sal_Int32 lVal = ((RscId*)rInst.pData)->GetNumber();
- aMem.Put( (INT32)lVal );
+ aMem.Put( (sal_Int32)lVal );
return( ERR_OK );
}
@@ -588,7 +588,7 @@ void RscIdRange::WriteRcAccess
{
fprintf( fOutput, "\t\tSet%s( ", pName );
fprintf( fOutput, "GetLong( pResData+nOffset ) );\n" );
- fprintf( fOutput, "\t\tnOffset += sizeof( INT32 );\n" );
+ fprintf( fOutput, "\t\tnOffset += sizeof( sal_Int32 );\n" );
}
/*************************************************************************
@@ -596,13 +596,13 @@ void RscIdRange::WriteRcAccess
|* RscIdRange::IsConsistent()
|*
*************************************************************************/
-BOOL RscIdRange::IsConsistent( const RSCINST & rInst )
+sal_Bool RscIdRange::IsConsistent( const RSCINST & rInst )
{
long nValue = ((RscId *)rInst.pData)->GetNumber();
if( (nMax >= nValue) && (nMin <= nValue) )
- return TRUE;
+ return sal_True;
else {
- return FALSE;
+ return sal_False;
}
}
@@ -636,7 +636,7 @@ RSCCLASS_TYPE RscBool::GetClassType() const
void RscBool::WriteSrc( const RSCINST & rInst, FILE * fOutput,
RscTypCont *, sal_uInt32, const char * )
{
- INT32 l;
+ sal_Int32 l;
GetNumber( rInst, &l );
if( l )
@@ -654,7 +654,7 @@ void RscBool::WriteRcAccess
)
{
fprintf( fOutput, "\t\tSet%s( ", pName );
- fprintf( fOutput, "(BOOL)*(short *)(pResData+nOffset) );\n" );
+ fprintf( fOutput, "(sal_Bool)*(short *)(pResData+nOffset) );\n" );
fprintf( fOutput, "\t\tnOffset += sizeof( short );\n" );
}
@@ -675,7 +675,7 @@ RscBreakRange :: RscBreakRange( Atom nId, sal_uInt32 nTypeId )
|* RscBreakRange::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscBreakRange::SetNumber( const RSCINST & rInst, INT32 nValue ){
+ERRTYPE RscBreakRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue ){
if( nValue == nOutRange )
return( ERR_RSCRANGE_OUTDEFSET );
else
@@ -688,10 +688,10 @@ ERRTYPE RscBreakRange::SetNumber( const RSCINST & rInst, INT32 nValue ){
|*
*************************************************************************/
RSCINST RscBreakRange::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aInst;
- INT32 l;
+ sal_Int32 l;
aInst = RscRange::Create( pInst, rDflt, bOwnClass );
diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx
index 94d69f860cc2..9126823b5f76 100644
--- a/rsc/source/res/rscstr.cxx
+++ b/rsc/source/res/rscstr.cxx
@@ -76,7 +76,7 @@ ERRTYPE RscString::SetString( const RSCINST & rInst, const char * pStr ){
ERRTYPE aError;
if( aError.IsOk() ){
- ((RscStringInst *)rInst.pData)->bDflt = FALSE;
+ ((RscStringInst *)rInst.pData)->bDflt = sal_False;
pTmp = ((RscStringInst *)rInst.pData)->pStr;
if( pTmp ){
@@ -124,7 +124,7 @@ ERRTYPE RscString::GetRef( const RSCINST & rInst, RscId * pRscId ){
ERRTYPE RscString::SetRef( const RSCINST & rInst, const RscId & rRefId ){
if( pRefClass ){
((RscStringInst *)rInst.pData)->aRefId = rRefId;
- ((RscStringInst *)rInst.pData)->bDflt = FALSE;
+ ((RscStringInst *)rInst.pData)->bDflt = sal_False;
}
else
return( ERR_REFNOTALLOWED );
@@ -138,7 +138,7 @@ ERRTYPE RscString::SetRef( const RSCINST & rInst, const RscId & rRefId ){
|*
*************************************************************************/
RSCINST RscString::Create( RSCINST * pInst, const RSCINST & rDflt,
- BOOL bOwnClass )
+ sal_Bool bOwnClass )
{
RSCINST aInst;
@@ -154,7 +154,7 @@ RSCINST RscString::Create( RSCINST * pInst, const RSCINST & rDflt,
((RscStringInst *)aInst.pData)->aRefId.Create();
((RscStringInst *)aInst.pData)->pStr = NULL;
- ((RscStringInst *)aInst.pData)->bDflt = TRUE;
+ ((RscStringInst *)aInst.pData)->bDflt = sal_True;
if( bOwnClass ){
((RscStringInst *)aInst.pData)->aRefId =
@@ -183,7 +183,7 @@ void RscString::Destroy( const RSCINST & rInst ){
|* RscString::IsValueDefault()
|*
*************************************************************************/
-BOOL RscString::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+sal_Bool RscString::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
RscStringInst * pData = (RscStringInst*)rInst.pData;
RscStringInst * pDefData = (RscStringInst*)pDef;
@@ -196,34 +196,34 @@ BOOL RscString::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
// Sind die Referenzidentifier gleich
if( pData->aRefId.GetNumber() == pDefData->aRefId.GetNumber() )
{
- return TRUE;
+ return sal_True;
}
}
}
else {
- BOOL bStrEmpty = FALSE;
- BOOL bDefStrEmpty = FALSE;
+ sal_Bool bStrEmpty = sal_False;
+ sal_Bool bDefStrEmpty = sal_False;
if( pData->pStr ){
bStrEmpty = ('\0' == *pData->pStr);
}
else
- bStrEmpty = TRUE;
+ bStrEmpty = sal_True;
if( pDefData->pStr ){
bDefStrEmpty = ('\0' == *pDefData->pStr);
}
else
- bDefStrEmpty = TRUE;
+ bDefStrEmpty = sal_True;
if( !bStrEmpty || !bDefStrEmpty ){
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -276,7 +276,7 @@ void RscString::WriteSrc( const RSCINST & rInst, FILE * fOutput,
|*
*************************************************************************/
ERRTYPE RscString::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
ERRTYPE aError;
ObjNode * pObjNode = NULL;
diff --git a/rsc/source/res/rsctop.cxx b/rsc/source/res/rsctop.cxx
index a3305412da10..db9eb6fec470 100644
--- a/rsc/source/res/rsctop.cxx
+++ b/rsc/source/res/rsctop.cxx
@@ -145,12 +145,12 @@ ERRTYPE RscTop :: GetRef( const RSCINST & rInst, RscId * pRscId ){
|* RscTop::InHierarchy()
|*
*************************************************************************/
-BOOL RscTop::InHierarchy( RscTop * pClass ){
+sal_Bool RscTop::InHierarchy( RscTop * pClass ){
if( this == pClass )
- return( TRUE );
+ return( sal_True );
if( pSuperClass )
return( pSuperClass->InHierarchy( pClass ) );
- return( FALSE );
+ return( sal_False );
}
/*************************************************************************
@@ -191,7 +191,7 @@ RSCINST RscTop::GetVariable
const RSCINST & rInst,
Atom nVarName,
const RSCINST & rInitInst,
- BOOL bInitDflt,
+ sal_Bool bInitDflt,
RscTop * pCreateClass
)
{
@@ -275,7 +275,7 @@ ERRTYPE RscTop::GetArrayEle
ERRTYPE RscTop::GetValueEle
(
const RSCINST & rInst,
- INT32 lValue,
+ sal_Int32 lValue,
RscTop * pCreateClass,
RSCINST * pGetInst
)
@@ -374,7 +374,7 @@ sal_uInt32 RscTop::GetCount( const RSCINST & rInst ){
|* RscTop::SetNumber()
|*
*************************************************************************/
-ERRTYPE RscTop::SetNumber( const RSCINST & rInst, INT32 lValue ){
+ERRTYPE RscTop::SetNumber( const RSCINST & rInst, sal_Int32 lValue ){
if( pSuperClass )
return pSuperClass->
SetNumber( rInst, lValue );
@@ -387,7 +387,7 @@ ERRTYPE RscTop::SetNumber( const RSCINST & rInst, INT32 lValue ){
|* RscTop::SetBool()
|*
*************************************************************************/
-ERRTYPE RscTop::SetBool( const RSCINST & rInst, BOOL bValue ){
+ERRTYPE RscTop::SetBool( const RSCINST & rInst, sal_Bool bValue ){
if( pSuperClass )
return pSuperClass->
SetBool( rInst, bValue );
@@ -400,7 +400,7 @@ ERRTYPE RscTop::SetBool( const RSCINST & rInst, BOOL bValue ){
|* RscTop::SetConst()
|*
*************************************************************************/
-ERRTYPE RscTop::SetConst( const RSCINST & rInst, Atom nId, INT32 nVal )
+ERRTYPE RscTop::SetConst( const RSCINST & rInst, Atom nId, sal_Int32 nVal )
{
if( pSuperClass )
return pSuperClass->SetConst( rInst, nId, nVal );
@@ -439,7 +439,7 @@ ERRTYPE RscTop::SetString( const RSCINST & rInst, const char * pStr ){
|* RscTop::GetNumber()
|*
*************************************************************************/
-ERRTYPE RscTop::GetNumber( const RSCINST & rInst, INT32 * pN ){
+ERRTYPE RscTop::GetNumber( const RSCINST & rInst, sal_Int32 * pN ){
if( pSuperClass )
return pSuperClass->
GetNumber( rInst, pN );
@@ -452,7 +452,7 @@ ERRTYPE RscTop::GetNumber( const RSCINST & rInst, INT32 * pN ){
|* RscTop::GetBool()
|*
*************************************************************************/
-ERRTYPE RscTop::GetBool( const RSCINST & rInst, BOOL * pB ){
+ERRTYPE RscTop::GetBool( const RSCINST & rInst, sal_Bool * pB ){
if( pSuperClass )
return pSuperClass->
GetBool( rInst, pB );
@@ -491,7 +491,7 @@ ERRTYPE RscTop::GetString( const RSCINST & rInst, char ** ppStr ){
|* RscTop::Create()
|*
*************************************************************************/
-RSCINST RscTop::Create( RSCINST * pInst, const RSCINST & rDefInst, BOOL bOwnRange )
+RSCINST RscTop::Create( RSCINST * pInst, const RSCINST & rDefInst, sal_Bool bOwnRange )
{
if( pSuperClass )
return pSuperClass->
@@ -518,12 +518,12 @@ void RscTop::Destroy( const RSCINST & rInst ){
|* RscTop::IsConsistent()
|*
*************************************************************************/
-BOOL RscTop::IsConsistent( const RSCINST & rInst )
+sal_Bool RscTop::IsConsistent( const RSCINST & rInst )
{
if( pSuperClass )
return pSuperClass->IsConsistent( rInst );
else
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -542,11 +542,11 @@ void RscTop::SetToDefault( const RSCINST & rInst )
|* RscTop::IsDefault()
|*
*************************************************************************/
-BOOL RscTop::IsDefault( const RSCINST & rInst ){
+sal_Bool RscTop::IsDefault( const RSCINST & rInst ){
if( pSuperClass )
return pSuperClass->IsDefault( rInst );
else
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -554,11 +554,11 @@ BOOL RscTop::IsDefault( const RSCINST & rInst ){
|* RscTop::IsValueDefault()
|*
*************************************************************************/
-BOOL RscTop::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
+sal_Bool RscTop::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
if( pSuperClass )
return pSuperClass->IsValueDefault( rInst, pDef );
else
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -707,7 +707,7 @@ void RscTop::WriteSrc( const RSCINST & rInst, FILE * fOutput,
*************************************************************************/
ERRTYPE RscTop::WriteRcHeader( const RSCINST & rInst, RscWriteRc & rMem,
RscTypCont * pTC, const RscId & rId,
- sal_uInt32 nDeep, BOOL bExtra )
+ sal_uInt32 nDeep, sal_Bool bExtra )
{
if( pSuperClass )
return( pSuperClass->
@@ -722,7 +722,7 @@ ERRTYPE RscTop::WriteRcHeader( const RSCINST & rInst, RscWriteRc & rMem,
|*
*************************************************************************/
ERRTYPE RscTop::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
- RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra )
+ RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
{
if( pSuperClass )
return( pSuperClass->
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 132d60483867..a4d9386126bb 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -60,12 +60,14 @@
#include <rschash.hxx>
#include <osl/file.h>
+#include <osl/file.hxx>
#include <osl/process.h>
#include <rtl/strbuf.hxx>
#include <rtl/tencinfo.h>
#include <rtl/textenc.h>
#include <vector>
+#include <algorithm>
using ::rtl::OUString;
@@ -130,7 +132,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
RscPtrPtr aCmdLine; // Kommandozeile
ByteString aString;
sal_uInt32 i;
- BOOL bOutputSrsIsSet = FALSE;
+ sal_Bool bOutputSrsIsSet = sal_False;
Init(); // Defaults setzen
@@ -241,7 +243,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
else if( !rsc_strnicmp( (*ppStr) + 1, "fp=", 3 ) )
{ // anderer Name fuer .srs-file
aOutputSrs = (*ppStr) + 4;
- bOutputSrsIsSet = TRUE;
+ bOutputSrsIsSet = sal_True;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "fl=", 3 ) )
{ // Name fuer listing-file
@@ -441,10 +443,8 @@ ERRTYPE RscCompiler::Start()
if( PRINTSYNTAX_FLAG & pCL->nCommands )
{
-#ifndef W30
pTC->WriteSyntax( stdout );
-printf( "khg\n" );
-#endif
+ printf( "khg\n" );
return ERR_OK;
}
@@ -537,7 +537,7 @@ void RscCompiler::EndCompile()
if( !pFN->IsIncFile() )
{
pTC->WriteSrc( foutput, NOFILE_INDEX,
- RTL_TEXTENCODING_UNICODE, FALSE );
+ RTL_TEXTENCODING_UNICODE, sal_False );
break; // ?T 281091MM nur eine Src-Datei
}
};
@@ -613,7 +613,7 @@ void RscCompiler::EndCompile()
|* RscCompiler::IncludeParser()
|*
*************************************************************************/
-ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey )
+ERRTYPE RscCompiler :: IncludeParser( sal_uLong lFileKey )
{
FILE * finput;
RscFile * pFName;
@@ -638,7 +638,7 @@ ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey )
RscDepend * pDep;
RscFileInst aFileInst( pTC, lFileKey, lFileKey, finput );
- pFName->bScanned = TRUE;
+ pFName->bScanned = sal_True;
::IncludeParser( &aFileInst );
fclose( finput );
@@ -675,9 +675,9 @@ ERRTYPE RscCompiler :: IncludeParser( ULONG lFileKey )
|* RscCompiler :: ParseOneFile()
|*
*************************************************************************/
-ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
+ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
const RscCmdLine::OutputFile* pOutputFile,
- const WriteRcContext* pContext )
+ const WriteRcContext* pContext )
{
FILE * finput = NULL;
ERRTYPE aError;
@@ -691,7 +691,7 @@ ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
RscDepend * pDep;
//Include-Dateien vorher lesen
- pFName->bLoaded = TRUE; //Endlos Rekursion vermeiden
+ pFName->bLoaded = sal_True; //Endlos Rekursion vermeiden
for ( size_t i = 0; i < pFName->aDepLst.size() && aError.IsOk(); ++i )
{
@@ -700,7 +700,7 @@ ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
}
if( aError.IsError() )
- pFName->bLoaded = FALSE; //bei Fehler nicht geladenen
+ pFName->bLoaded = sal_False; //bei Fehler nicht geladenen
else
{
String aTmpName( ::GetTmpFileName(), RTL_TEXTENCODING_ASCII_US );
@@ -750,13 +750,36 @@ ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey,
|*
*************************************************************************/
-static OString do_prefix( const char* pPrefix, const OUString& rFile )
+namespace
{
- OStringBuffer aBuf(256);
- aBuf.append( pPrefix );
- aBuf.append( ":" );
- aBuf.append( OUStringToOString( rFile, RTL_TEXTENCODING_MS_1252 ) );
- return aBuf.makeStringAndClear();
+ using namespace ::osl;
+ class RscIoError { };
+ static inline OUString lcl_getAbsoluteUrl(const OUString& i_sBaseUrl, const OString& i_sPath)
+ {
+ OUString sRelUrl, sAbsUrl;
+ if(FileBase::getFileURLFromSystemPath(OStringToOUString(i_sPath, RTL_TEXTENCODING_MS_1252), sRelUrl) != FileBase::E_None)
+ throw RscIoError();
+ if(FileBase::getAbsoluteFileURL(i_sBaseUrl, sRelUrl, sAbsUrl) != FileBase::E_None)
+ throw RscIoError();
+ return sAbsUrl;
+ };
+ static inline OString lcl_getSystemPath(const OUString& i_sUrl)
+ {
+ OUString sSys;
+ if(FileBase::getSystemPathFromFileURL(i_sUrl, sSys) != FileBase::E_None)
+ throw RscIoError();
+ OSL_TRACE("temporary file: %s", OUStringToOString(sSys, RTL_TEXTENCODING_UTF8).getStr());
+ return OUStringToOString(sSys, RTL_TEXTENCODING_MS_1252);
+ };
+ static inline OString lcl_getTempFile(OUString& sTempDirUrl)
+ {
+ // get a temp file name for the rc file
+ OUString sTempUrl;
+ if(FileBase::createTempFile(&sTempDirUrl, NULL, &sTempUrl) != FileBase::E_None)
+ throw RscIoError();
+ OSL_TRACE("temporary url: %s", OUStringToOString(sTempUrl, RTL_TEXTENCODING_UTF8).getStr());
+ return lcl_getSystemPath(sTempUrl);
+ };
}
ERRTYPE RscCompiler::Link()
@@ -765,12 +788,6 @@ ERRTYPE RscCompiler::Link()
ERRTYPE aError;
RscFile* pFName;
-#ifdef UNX
-#define PATHSEP '/'
-#else
-#define PATHSEP '\\'
-#endif
-
if( !(pCL->nCommands & NOLINK_FLAG) )
{
::std::list<RscCmdLine::OutputFile>::const_iterator it;
@@ -784,91 +801,60 @@ ERRTYPE RscCompiler::Link()
{
pTC->Delete( pTC->aFileTab.GetIndex( pFName ) );
pTC->aFileTab.Seek( pFName );
- pFName->bLoaded = FALSE;
+ pFName->bLoaded = sal_False;
}
}
- // rc-Datei schreiben
- ByteString aDir( it->aOutputRc );
- aDir.SetToken( aDir.GetTokenCount( PATHSEP )-1, PATHSEP, ByteString() );
- if( ! aDir.Len() )
- {
- char aBuf[1024];
- if( getcwd( aBuf, sizeof( aBuf ) ) )
- {
- aDir = aBuf;
- aDir.Append( PATHSEP );
- }
- }
- // work dir for absolute Urls
- OUString aCWD, aTmpUrl;
- osl_getProcessWorkingDir( &aCWD.pData );
// get two temp file urls
OString aRcTmp, aSysListTmp, aSysList;
- OUString aSysPath, aUrlDir;
- aSysPath = OStringToOUString( aDir, RTL_TEXTENCODING_MS_1252 );
- if( osl_getFileURLFromSystemPath( aSysPath.pData, &aUrlDir.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "url conversion", aUrlDir ) );
-
- if( osl_getAbsoluteFileURL( aCWD.pData, aUrlDir.pData, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "absolute url", aUrlDir ) );
- aUrlDir = aTmpUrl;
-
- // create temp file for rc target
- if( osl_createTempFile( aUrlDir.pData, NULL, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "temp file creation", aUrlDir ) );
+ try
+ {
+ OUString sPwdUrl;
+ osl_getProcessWorkingDir( &sPwdUrl.pData );
+ OUString sRcUrl = lcl_getAbsoluteUrl(sPwdUrl, it->aOutputRc);
+ // TempDir is either the directory where the rc file is located or pwd
+ OUString sTempDirUrl = sRcUrl.copy(0,sRcUrl.lastIndexOf('/'));
+ OSL_TRACE("rc directory URL: %s", OUStringToOString(sTempDirUrl, RTL_TEXTENCODING_UTF8).getStr());
+
+ aRcTmp = lcl_getTempFile(sTempDirUrl);
+ OSL_TRACE("temporary rc file: %s", aRcTmp.getStr());
+
+ OUString sOilDirUrl;
+ if(pCL->aILDir.Len())
+ sOilDirUrl = lcl_getAbsoluteUrl(sPwdUrl, pCL->aILDir);
+ else
+ sOilDirUrl = sTempDirUrl;
+ OSL_TRACE("ilst directory URL: %s", OUStringToOString(sOilDirUrl, RTL_TEXTENCODING_UTF8).getStr());
- if( osl_getSystemPathFromFileURL( aTmpUrl.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aTmpUrl ) );
- aRcTmp = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
+ aSysListTmp = lcl_getTempFile(sOilDirUrl);
+ OSL_TRACE("temporary ilst file: %s", aSysListTmp.getStr());
- if ( NULL == (fExitFile = foutput = fopen( aRcTmp.getStr(), "wb" )) )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() );
+ OUString sIlstUrl, sIlstSys;
+ sIlstUrl = sRcUrl.copy(sRcUrl.lastIndexOf('/')+1);
+ sIlstUrl = sIlstUrl.copy(0,sIlstUrl.lastIndexOf('.'));
+ sIlstUrl += OUString::createFromAscii(".ilst");
+ sIlstUrl = lcl_getAbsoluteUrl(sOilDirUrl, OUStringToOString(sIlstUrl, RTL_TEXTENCODING_UTF8));
- // make absolute path from IL dir (-oil switch)
- // if no -oil was given, use the same dir as for rc file
- if( pCL->aILDir.Len() )
+ aSysList = lcl_getSystemPath(sIlstUrl);
+ OSL_TRACE("ilst file: %s", aSysList.getStr());
+ }
+ catch (RscIoError&)
{
- aSysPath = OStringToOUString( pCL->aILDir, RTL_TEXTENCODING_MS_1252 );
- if( osl_getFileURLFromSystemPath( aSysPath.pData, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "url conversion", aSysPath ) );
- if( osl_getAbsoluteFileURL( aCWD.pData, aTmpUrl.pData, &aUrlDir.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "absolute url", aTmpUrl ) );
+ OString sMsg("Error with paths:\n");
+ sMsg += "temporary rc file: " + aRcTmp + "\n";
+ sMsg += "temporary ilst file: " + aSysListTmp + "\n";
+ sMsg += "ilst file: " + aSysList + "\n";
+ pTC->pEH->FatalError(ERR_OPENFILE, RscId(), sMsg);
}
-
- if( osl_getSystemPathFromFileURL( aUrlDir.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aUrlDir ) );
-
- aSysList = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
- aSysList = aSysList + "/";
- xub_StrLen nLastSep = it->aOutputRc.SearchBackward( PATHSEP );
- if( nLastSep == STRING_NOTFOUND )
- nLastSep = 0;
- xub_StrLen nLastPt = it->aOutputRc.Search( '.', nLastSep );
- if( nLastPt == STRING_NOTFOUND )
- nLastPt = it->aOutputRc.Len()+1;
- aSysList = aSysList + it->aOutputRc.Copy( nLastSep+1, nLastPt - nLastSep-1 );
- aSysList = aSysList + ".ilst";
- // create temp file for sys list target
- if( osl_createTempFile( aUrlDir.pData, NULL, &aTmpUrl.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "temp file creation", aUrlDir ) );
-
- if( osl_getSystemPathFromFileURL( aTmpUrl.pData, &aSysPath.pData ) != osl_File_E_None )
- pTC->pEH->FatalError( ERR_OPENFILE, RscId(), do_prefix( "sys path conversion", aTmpUrl ) );
- aSysListTmp = OUStringToOString( aSysPath, RTL_TEXTENCODING_MS_1252 );
-
- pTC->pEH->StdOut( "Generating .rc file\n" );
-
- rtl_TextEncoding aEnc = RTL_TEXTENCODING_UTF8;
- //if( it->aLangName.CompareIgnoreCaseToAscii( "de", 2 ) == COMPARE_EQUAL )
- // aEnc = RTL_TEXTENCODING_MS_1252;
+ if ( NULL == (fExitFile = foutput = fopen( aRcTmp.getStr(), "wb" )) )
+ pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() );
// Schreibe Datei
sal_Char cSearchDelim = ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
sal_Char cAccessDelim = ByteString( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
pTC->ChangeLanguage( it->aLangName );
- pTC->SetSourceCharSet( aEnc );
+ pTC->SetSourceCharSet( RTL_TEXTENCODING_UTF8 );
pTC->ClearSysNames();
ByteString aSysSearchPath( it->aLangSearchPath );
xub_StrLen nIndex = 0;
@@ -884,9 +870,7 @@ ERRTYPE RscCompiler::Link()
aSysSearchPath.Append( cSearchDelim );
aSysSearchPath.Append( aToken );
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "setting search path for language %s: %s\n", it->aLangName.GetBuffer(), aSysSearchPath.GetBuffer() );
-#endif
+ OSL_TRACE( "setting search path for language %s: %s\n", it->aLangName.GetBuffer(), aSysSearchPath.GetBuffer() );
pTC->SetSysSearchPath( aSysSearchPath );
WriteRcContext aContext;
@@ -1077,7 +1061,7 @@ ByteString RscCompiler::GetTmpFileName()
/********************************************************************/
/* */
-/* Function : BOOL openinput() */
+/* Function : sal_Bool openinput() */
/* */
/* Description : Check to see if the input file exists and can */
/* be opened for reading. */
@@ -1100,7 +1084,7 @@ void RscCompiler::OpenInput( const ByteString& rInput )
|*************************************************************************/
bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
+ const WriteRcContext& rContext,
const ByteString& rBaseFileName,
ByteString& rImagePath,
FILE* pSysListFile )
@@ -1190,9 +1174,9 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
// ------------------------------------------------------------------------------
void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
- const WriteRcContext& rContext,
- const DirEntry& rSrsInPath,
- const DirEntry& rSrsOutPath )
+ const WriteRcContext& rContext,
+ const DirEntry& rSrsInPath,
+ const DirEntry& rSrsOutPath )
{
SvFileStream aIStm( rSrsInPath.GetFull(), STREAM_READ );
SvFileStream aOStm( rSrsOutPath.GetFull(), STREAM_WRITE | STREAM_TRUNC );
@@ -1299,7 +1283,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
}
aOStm.WriteLine( "};" );
- }
+ }
else
aOStm.WriteLine( aLine );
}
diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx
index 0a476662c347..3031ff668bb8 100644
--- a/rsc/source/tools/rscchar.cxx
+++ b/rsc/source/tools/rscchar.cxx
@@ -50,7 +50,7 @@
|* Beschreibung Der String wird nach C-Konvention umgesetzt
|*
*************************************************************************/
-char * RscChar::MakeUTF8( char * pStr, UINT16 nTextEncoding )
+char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
{
sal_Size nMaxUniCodeBuf = strlen( pStr ) + 1;
char * pOrgStr = new char[ nMaxUniCodeBuf ];
@@ -110,7 +110,7 @@ char * RscChar::MakeUTF8( char * pStr, UINT16 nTextEncoding )
int i = 0;
while( '0' <= *pStr && '7' >= *pStr && i != 3 )
{
- nChar = nChar * 8 + (BYTE)*pStr - (BYTE)'0';
+ nChar = nChar * 8 + (sal_uInt8)*pStr - (sal_uInt8)'0';
++pStr;
i++;
}
@@ -132,11 +132,11 @@ char * RscChar::MakeUTF8( char * pStr, UINT16 nTextEncoding )
while( isxdigit( *pStr ) && i != 2 )
{
if( isdigit( *pStr ) )
- nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'0';
+ nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'0';
else if( isupper( *pStr ) )
- nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'A' +10;
+ nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'A' +10;
else
- nChar = nChar * 16 + (BYTE)*pStr - (BYTE)'a' +10;
+ nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'a' +10;
++pStr;
i++;
}
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 6bba925f32f0..99268b83d3d8 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -36,7 +36,7 @@
/****************** C o d e **********************************************/
/****************** R s c I d ********************************************/
-BOOL RscId::bNames = TRUE;
+sal_Bool RscId::bNames = sal_True;
/*************************************************************************
|*
@@ -44,16 +44,16 @@ BOOL RscId::bNames = TRUE;
|* static RscId::SetNoNames
|*
*************************************************************************/
-void RscId::SetNames( BOOL bSet ) { bNames = bSet; }
-BOOL RscId::IsSetNames() { return bNames; }
+void RscId::SetNames( sal_Bool bSet ) { bNames = bSet; }
+sal_Bool RscId::IsSetNames() { return bNames; }
/*************************************************************************
|*
|* RscId::GetNumber
|*
*************************************************************************/
-INT32 RscId::GetNumber() const{
- INT32 lVal;
+sal_Int32 RscId::GetNumber() const{
+ sal_Int32 lVal;
aExp.Evaluate( &lVal );
return lVal;
}
@@ -69,7 +69,7 @@ void RscId::Create( const RscExpType & rExpType )
if( aExp.IsDefinition() )
aExp.aExp.pDef->IncRef();
else if( aExp.IsExpression() ){
- INT32 lValue;
+ sal_Int32 lValue;
aExp.Evaluate( &lValue );
aExp.SetLong( lValue );
@@ -129,7 +129,7 @@ RscId& RscId::operator = ( const RscId& rRscId ){
|* RscId::operator ==
|*
*************************************************************************/
-BOOL RscId::operator == ( const RscId& rRscId ) const
+sal_Bool RscId::operator == ( const RscId& rRscId ) const
{
return( GetNumber() == rRscId.GetNumber() );
}
@@ -139,7 +139,7 @@ BOOL RscId::operator == ( const RscId& rRscId ) const
|* RscId::operator <
|*
*************************************************************************/
-BOOL RscId::operator < ( const RscId& rRscId ) const
+sal_Bool RscId::operator < ( const RscId& rRscId ) const
{
return( GetNumber() < rRscId.GetNumber() );
}
@@ -149,17 +149,17 @@ BOOL RscId::operator < ( const RscId& rRscId ) const
|* RscId::operator >
|*
*************************************************************************/
-BOOL RscId::operator > ( const RscId& rRscId ) const
+sal_Bool RscId::operator > ( const RscId& rRscId ) const
{
return( GetNumber() > rRscId.GetNumber() );
}
/*************************************************************************
|*
-|* RscId::INT32()
+|* RscId::sal_Int32()
|*
*************************************************************************/
-RscId::operator INT32() const
+RscId::operator sal_Int32() const
{
return( GetNumber() );
}
@@ -207,7 +207,7 @@ ByteString RscId::GetMacro() const
|* RscDefine::RscDefine()
|*
*************************************************************************/
-RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName, INT32 lDefId )
+RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName, sal_Int32 lDefId )
: StringNode( rDefName )
{
nRefCount = 0;
@@ -216,7 +216,7 @@ RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName, INT32 lDefId )
pExp = NULL;
}
-RscDefine::RscDefine( ULONG lKey, const ByteString & rDefName,
+RscDefine::RscDefine( sal_uLong lKey, const ByteString & rDefName,
RscExpression * pExpression )
: StringNode( rDefName )
{
@@ -275,7 +275,7 @@ void RscDefine::ChangeMacro( RscExpression * pExpression ){
pExp->Evaluate( &lId );
}
-void RscDefine::ChangeMacro( INT32 lIdentifier ){
+void RscDefine::ChangeMacro( sal_Int32 lIdentifier ){
if( pExp ){
delete pExp;
pExp = NULL;
@@ -288,8 +288,8 @@ void RscDefine::ChangeMacro( INT32 lIdentifier ){
|* RscDefine::Evaluate()
|*
*************************************************************************/
-BOOL RscDefine::Evaluate(){
- BOOL bRet = TRUE;
+sal_Bool RscDefine::Evaluate(){
+ sal_Bool bRet = sal_True;
if( pExp )
bRet = !pExp->Evaluate( &lId );
@@ -324,8 +324,8 @@ ByteString RscDefine::GetMacro()
|* RscDefineList::New()
|*
*************************************************************************/
-RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName,
- INT32 lDefId, size_t lPos )
+RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName,
+ sal_Int32 lDefId, size_t lPos )
{
RscDefine * pDef;
@@ -342,7 +342,7 @@ RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName,
return pDef;
}
-RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName,
+RscDefine * RscDefineList::New( sal_uLong lFileKey, const ByteString & rDefName,
RscExpression * pExpression, size_t lPos )
{
RscDefine * pDef;
@@ -365,37 +365,38 @@ RscDefine * RscDefineList::New( ULONG lFileKey, const ByteString & rDefName,
|* RscDefineList::Remove()
|*
*************************************************************************/
-BOOL RscDefineList::Remove( RscDefine * pDef ) {
+sal_Bool RscDefineList::Remove( RscDefine * pDef ) {
for ( RscSubDefList::iterator it = maList.begin(); it < maList.end(); ++it ) {
if ( *it == pDef ) {
(*it)->DefineToNumber();
(*it)->DecRef();
maList.erase( it );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
-BOOL RscDefineList::Remove( size_t lIndex ) {
+sal_Bool RscDefineList::Remove( size_t lIndex ) {
if ( lIndex < maList.size() ) {
RscSubDefList::iterator it = maList.begin();
::std::advance( it, lIndex );
(*it)->DefineToNumber();
(*it)->DecRef();
maList.erase( it );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL RscDefineList::Remove() {
- if ( maList.empty() ) return FALSE;
+sal_Bool RscDefineList::Remove() {
+ if ( maList.empty() )
+ return sal_False;
maList[ 0 ]->DefineToNumber();
maList[ 0 ]->DecRef();
maList.erase( maList.begin() );
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -403,7 +404,7 @@ BOOL RscDefineList::Remove() {
|* RscDefineList::Befor()
|*
*************************************************************************/
-BOOL RscDefineList::Befor( const RscDefine * pFree,
+sal_Bool RscDefineList::Befor( const RscDefine * pFree,
const RscDefine * pDepend )
{
size_t i = 0;
@@ -412,13 +413,13 @@ BOOL RscDefineList::Befor( const RscDefine * pFree,
if ( maList[ i ] == pFree ) {
for ( ++i ; i < n ; ++i ) {
if ( maList[ i ] == pDepend ) {
- return TRUE;
+ return sal_True;
}
}
}
++i;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -443,7 +444,7 @@ void RscDefineList::WriteAll( FILE * fOutput )
|* RscExpType::Evaluate()
|*
*************************************************************************/
-BOOL RscExpType::Evaluate( INT32 * plValue ) const{
+sal_Bool RscExpType::Evaluate( sal_Int32 * plValue ) const{
if( IsDefinition() ){
aExp.pDef->Evaluate();
// Eventuellen Fehler ignorieren
@@ -456,7 +457,7 @@ BOOL RscExpType::Evaluate( INT32 * plValue ) const{
else
*plValue = GetLong();
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -518,9 +519,9 @@ RscExpression::~RscExpression(){
|* RscExpression::Evaluate()
|*
*************************************************************************/
-BOOL RscExpression::Evaluate( INT32 * plValue ){
- INT32 lLeft;
- INT32 lRight;
+sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){
+ sal_Int32 lLeft;
+ sal_Int32 lRight;
// linken und rechten Zweig auswerten
if( aLeftExp.Evaluate( &lLeft ) && aRightExp.Evaluate( &lRight ) ){
@@ -540,12 +541,12 @@ BOOL RscExpression::Evaluate( INT32 * plValue ){
*plValue = lLeft << lRight;
else{
if( 0L == lRight )
- return FALSE;
+ return sal_False;
*plValue = lLeft / lRight;
};
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -596,10 +597,10 @@ ByteString RscExpression::GetMacro()
|*
*************************************************************************/
RscFile :: RscFile(){
- bLoaded = FALSE;
- bIncFile = FALSE;
- bDirty = FALSE;
- bScanned = FALSE;
+ bLoaded = sal_False;
+ bIncFile = sal_False;
+ bDirty = sal_False;
+ bScanned = sal_False;
}
/*************************************************************************
@@ -621,12 +622,12 @@ RscFile :: ~RscFile() {
|*
|* RscFile::Depend()
|*
-|* Beschreibung Diese Methode gibt TRUE zurueck, wenn lDepend
+|* Beschreibung Diese Methode gibt sal_True zurueck, wenn lDepend
|* existiert und hinter lFree steht, oder wenn
|* lDepend nicht existiert.
|*
*************************************************************************/
-BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){
+sal_Bool RscFile::Depend( sal_uLong lDepend, sal_uLong lFree ){
RscDepend * pDep;
for ( size_t i = aDepLst.size(); i > 0; )
@@ -637,12 +638,12 @@ BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){
{
pDep = aDepLst[ --j ];
if( pDep->GetFileKey() == lFree )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -650,13 +651,13 @@ BOOL RscFile::Depend( ULONG lDepend, ULONG lFree ){
|* RscFile::InsertDependFile()
|*
*************************************************************************/
-BOOL RscFile :: InsertDependFile( ULONG lIncFile, size_t lPos )
+sal_Bool RscFile :: InsertDependFile( sal_uLong lIncFile, size_t lPos )
{
for ( size_t i = 0, n = aDepLst.size(); i < n; ++i )
{
RscDepend* pDep = aDepLst[ i ];
if( pDep->GetFileKey() == lIncFile )
- return TRUE;
+ return sal_True;
}
// Current-Zeiger steht auf letztem Element
@@ -669,7 +670,7 @@ BOOL RscFile :: InsertDependFile( ULONG lIncFile, size_t lPos )
::std::advance( it, lPos );
aDepLst.insert( it, new RscDepend( lIncFile ) );
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -677,7 +678,7 @@ BOOL RscFile :: InsertDependFile( ULONG lIncFile, size_t lPos )
|* RscFile::RemoveDependFile()
|*
*************************************************************************/
-void RscFile :: RemoveDependFile( ULONG lDepFile )
+void RscFile :: RemoveDependFile( sal_uLong lDepFile )
{
for ( size_t i = aDepLst.size(); i > 0; )
{
@@ -757,17 +758,17 @@ void RscDefTree::Remove( RscDefine * pDef ){
|* RscDefTree::Evaluate()
|*
*************************************************************************/
-BOOL RscDefTree::Evaluate( RscDefine * pDef ){
+sal_Bool RscDefTree::Evaluate( RscDefine * pDef ){
if( pDef ){
if( !Evaluate( (RscDefine *)pDef->Left() ) )
- return FALSE;
+ return sal_False;
if( !Evaluate( (RscDefine *)pDef->Right() ) )
- return FALSE;
+ return sal_False;
};
- return TRUE;
+ return sal_True;
}
-BOOL RscDefTree::Evaluate(){
+sal_Bool RscDefTree::Evaluate(){
return Evaluate( pDefRoot );
}
@@ -803,7 +804,7 @@ RscFileTab :: ~RscFileTab(){
|* RscFileTab::Find()
|*
*************************************************************************/
-ULONG RscFileTab :: Find( const ByteString & rName )
+sal_uLong RscFileTab :: Find( const ByteString & rName )
{
RscFile * pFName;
@@ -831,7 +832,7 @@ RscDefine * RscFileTab::FindDef( const char * pName ){
|* RscFileTab::FindDef()
|*
*************************************************************************/
-RscDefine * RscFileTab::FindDef( ULONG lFileKey, const ByteString & rName )
+RscDefine * RscFileTab::FindDef( sal_uLong lFileKey, const ByteString & rName )
{
RscDefine * pDef = FindDef( rName );
@@ -848,20 +849,20 @@ RscDefine * RscFileTab::FindDef( ULONG lFileKey, const ByteString & rName )
|* RscFileTab::Depend()
|*
*************************************************************************/
-BOOL RscFileTab::Depend( ULONG lDepend, ULONG lFree ){
+sal_Bool RscFileTab::Depend( sal_uLong lDepend, sal_uLong lFree ){
if( lDepend == lFree )
- return TRUE;
+ return sal_True;
RscFile * pFile = First();
while( pFile ){
if( !pFile->IsIncFile() ){
if( !pFile->Depend( lDepend, lFree ) )
- return FALSE;
+ return sal_False;
};
pFile = Next();
};
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -869,17 +870,17 @@ BOOL RscFileTab::Depend( ULONG lDepend, ULONG lFree ){
|* RscFileTab::TestDef()
|*
*************************************************************************/
-BOOL RscFileTab::TestDef( ULONG lFileKey, size_t lPos,
+sal_Bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
const RscDefine * pDefDec )
{
if( lFileKey == pDefDec->GetFileKey() ) {
RscFile * pFile = GetFile( pDefDec->GetFileKey() );
if( pFile && (lPos <= pFile->aDefLst.GetPos( (RscDefine *)pDefDec ))
&& (lPos != LIST_APPEND) )
- return FALSE;
+ return sal_False;
}
else if( !Depend( lFileKey, pDefDec->GetFileKey() ) )
- return FALSE;
+ return sal_False;
return TestDef( lFileKey, lPos, pDefDec->pExp );
}
@@ -889,29 +890,29 @@ BOOL RscFileTab::TestDef( ULONG lFileKey, size_t lPos,
|* RscFileTab::TestDef()
|*
*************************************************************************/
-BOOL RscFileTab::TestDef( ULONG lFileKey, size_t lPos,
+sal_Bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
const RscExpression * pExpDec )
{
if( !pExpDec )
- return TRUE;
+ return sal_True;
if( pExpDec->aLeftExp.IsExpression() )
if( !TestDef( lFileKey, lPos, pExpDec->aLeftExp.aExp.pExp ) )
- return FALSE;
+ return sal_False;
if( pExpDec->aLeftExp.IsDefinition() )
if( !TestDef( lFileKey, lPos, pExpDec->aLeftExp.aExp.pDef ) )
- return FALSE;
+ return sal_False;
if( pExpDec->aRightExp.IsExpression() )
if( !TestDef( lFileKey, lPos, pExpDec->aRightExp.aExp.pExp ) )
- return FALSE;
+ return sal_False;
if( pExpDec->aRightExp.IsDefinition() )
if( !TestDef( lFileKey, lPos, pExpDec->aRightExp.aExp.pDef ) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -919,8 +920,8 @@ BOOL RscFileTab::TestDef( ULONG lFileKey, size_t lPos,
|* RscFileTab::NewDef()
|*
*************************************************************************/
-RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName,
- INT32 lId, ULONG lPos )
+RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName,
+ sal_Int32 lId, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
@@ -943,8 +944,8 @@ RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName,
|* RscFileTab::NewDef()
|*
*************************************************************************/
-RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName,
- RscExpression * pExp, ULONG lPos )
+RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName,
+ RscExpression * pExp, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
@@ -975,14 +976,14 @@ RscDefine * RscFileTab::NewDef( ULONG lFileKey, const ByteString & rDefName,
|* RscFileTab::IsDefUsed()
|*
*************************************************************************/
-BOOL RscFileTab::IsDefUsed( const ByteString & rDefName )
+sal_Bool RscFileTab::IsDefUsed( const ByteString & rDefName )
{
RscDefine * pDef = FindDef( rDefName );
if( pDef )
return( pDef->GetRefCount() != 2 );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1009,7 +1010,7 @@ void RscFileTab::DeleteDef( const ByteString & rDefName )
|* RscFileTab::ChangeDef()
|*
*************************************************************************/
-BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId )
+sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, sal_Int32 lId )
{
RscDefine * pDef = FindDef( rDefName );
@@ -1018,7 +1019,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId )
//alle Macros neu bewerten
return aDefTree.Evaluate();
};
- return( FALSE );
+ return( sal_False );
}
/*************************************************************************
@@ -1026,7 +1027,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName, INT32 lId )
|* RscFileTab::ChangeDef()
|*
*************************************************************************/
-BOOL RscFileTab::ChangeDef( const ByteString & rDefName,
+sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName,
RscExpression * pExp )
{
RscDefine * pDef = FindDef( rDefName );
@@ -1035,7 +1036,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName,
if( pDef )
{
pFile = GetFile( pDef->GetFileKey() );
- ULONG lPos = 0;
+ sal_uLong lPos = 0;
if( pFile )
lPos = pFile->aDefLst.GetPos( pDef );
//Macros in den Expressions sind definiert ?
@@ -1050,7 +1051,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName,
// geloescht werden
delete pExp;
- return( FALSE );
+ return( sal_False );
}
/*************************************************************************
@@ -1058,7 +1059,7 @@ BOOL RscFileTab::ChangeDef( const ByteString & rDefName,
|* RscFileTab::ChangeDefName()
|*
*************************************************************************/
-BOOL RscFileTab::ChangeDefName( const ByteString & rDefName,
+sal_Bool RscFileTab::ChangeDefName( const ByteString & rDefName,
const ByteString & rNewName )
{
RscDefine * pDef = FindDef( rDefName );
@@ -1070,11 +1071,11 @@ BOOL RscFileTab::ChangeDefName( const ByteString & rDefName,
aDefTree.Remove( pDef );
pDef->SetName( rNewName );
aDefTree.Insert( pDef );
- return( TRUE );
+ return( sal_True );
}
};
- return( FALSE );
+ return( sal_False );
}
/*************************************************************************
@@ -1082,7 +1083,7 @@ BOOL RscFileTab::ChangeDefName( const ByteString & rDefName,
|* RscFileTab::DeleteFileContext()
|*
*************************************************************************/
-void RscFileTab :: DeleteFileContext( ULONG lFileKey ){
+void RscFileTab :: DeleteFileContext( sal_uLong lFileKey ){
RscFile * pFName;
pFName = GetFile( lFileKey );
@@ -1102,7 +1103,7 @@ void RscFileTab :: DeleteFileContext( ULONG lFileKey ){
|* RscFileTab::DeleteFile()
|*
*************************************************************************/
-void RscFileTab :: DeleteFile( ULONG lFileKey ){
+void RscFileTab :: DeleteFile( sal_uLong lFileKey ){
RscFile * pFName;
//Defines freigeben
@@ -1125,9 +1126,9 @@ void RscFileTab :: DeleteFile( ULONG lFileKey ){
|* RscFileTab::NewCodeFile()
|*
*************************************************************************/
-ULONG RscFileTab :: NewCodeFile( const ByteString & rName )
+sal_uLong RscFileTab :: NewCodeFile( const ByteString & rName )
{
- ULONG lKey;
+ sal_uLong lKey;
RscFile * pFName;
lKey = Find( rName );
@@ -1147,10 +1148,10 @@ ULONG RscFileTab :: NewCodeFile( const ByteString & rName )
|* RscFileTab::NewIncFile()
|*
*************************************************************************/
-ULONG RscFileTab :: NewIncFile( const ByteString & rName,
+sal_uLong RscFileTab :: NewIncFile( const ByteString & rName,
const ByteString & rPath )
{
- ULONG lKey;
+ sal_uLong lKey;
RscFile * pFName;
lKey = Find( rName );
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index a5079d9f37d0..11f4fff7caf1 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -33,7 +33,7 @@
// C and C++ Includes.
#include <stdlib.h>
#include <stdio.h>
-#if defined ( DOS ) || defined ( WIN ) || defined (WNT )
+#if defined (WNT )
#include <direct.h>
#endif
#if defined ( OS2 ) && !defined ( GCC )
@@ -52,10 +52,6 @@
#include <rtl/alloc.h>
#include <rtl/memory.h>
-#if defined (WIN)
-#define ONLY_NEW
-#endif
-
using ::rtl::OUString;
using ::rtl::OUStringToOString;
@@ -144,7 +140,7 @@ ByteString GetTmpFileName()
/* */
/* Description : appends text files */
/********************************************************************/
-BOOL Append( FILE * fDest, ByteString aTmpFile )
+sal_Bool Append( FILE * fDest, ByteString aTmpFile )
{
#define MAX_BUF 4096
FILE *fSource = fopen( aTmpFile.GetBuffer(), "rb" );
@@ -152,7 +148,7 @@ BOOL Append( FILE * fDest, ByteString aTmpFile )
{
if( fSource )
fclose( fSource );
- return FALSE;
+ return sal_False;
}
else
{
@@ -167,14 +163,14 @@ BOOL Append( FILE * fDest, ByteString aTmpFile )
fclose( fSource );
};
- return TRUE;
+ return sal_True;
}
-BOOL Append( ByteString aOutputSrs, ByteString aTmpFile )
+sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile )
{
FILE * fDest = fopen( aOutputSrs.GetBuffer(), "ab" );
- BOOL bRet = Append( fDest, aTmpFile );
+ sal_Bool bRet = Append( fDest, aTmpFile );
if( fDest )
fclose( fDest );
@@ -370,10 +366,10 @@ RscWriteRc::RscWriteRc( RSCBYTEORDER_TYPE nOrder )
short nSwapTest = 1;
RSCBYTEORDER_TYPE nMachineOrder;
- bSwap = FALSE;
+ bSwap = sal_False;
if( nOrder != RSC_SYSTEMENDIAN )
{
- if( (BYTE)*(BYTE *)&nSwapTest )
+ if( (sal_uInt8)*(sal_uInt8 *)&nSwapTest )
nMachineOrder = RSC_LITTLEENDIAN;
else
nMachineOrder = RSC_BIGENDIAN;
diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx
index 762f29039b28..19a44f873949 100644
--- a/rsc/source/tools/rsctree.cxx
+++ b/rsc/source/tools/rsctree.cxx
@@ -277,12 +277,12 @@ NameNode* NameNode::Search( const void * pSearch ) const{
|* NameNode::Insert()
|*
*************************************************************************/
-BOOL NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){
+sal_Bool NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){
// Ein Knoten wird in den Baum eingefuegt
-// Gibt es einen Knoten mit dem gleichen Namen, dann return FALSE
-// sonst return TRUE. Der Knoten wird auf jeden Fall eingefuegt.
+// Gibt es einen Knoten mit dem gleichen Namen, dann return sal_False
+// sonst return sal_True. Der Knoten wird auf jeden Fall eingefuegt.
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
int nCmp = Compare( pTN );
*pnDepth += 1;
@@ -298,7 +298,7 @@ BOOL NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){
else
pRight = pTN;
if( nCmp == EQUAL )
- bRet = FALSE;
+ bRet = sal_False;
};
return( bRet );
}
@@ -308,12 +308,12 @@ BOOL NameNode::Insert( NameNode * pTN, sal_uInt32* pnDepth ){
|* NameNode::Insert()
|*
*************************************************************************/
-BOOL NameNode::Insert( NameNode * pTN ){
+sal_Bool NameNode::Insert( NameNode * pTN ){
// insert a node in the tree.
-// if the node with the same name is in, return FALSE and no insert.
+// if the node with the same name is in, return sal_False and no insert.
// if not return true.
sal_uInt32 nDepth = 0;
- BOOL bRet;
+ sal_Bool bRet;
bRet = Insert( pTN, &nDepth );
if( bRet ){
@@ -361,14 +361,14 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ){
|*
*************************************************************************/
class OrderCtrl {
- BOOL bOrder;
+ sal_Bool bOrder;
NameNode * pName;
DECL_LINK( CallBackFunc, NameNode * );
public:
- OrderCtrl() { bOrder = FALSE; pName = NULL; }
- BOOL IsOrder( const NameNode * pRoot )
+ OrderCtrl() { bOrder = sal_False; pName = NULL; }
+ sal_Bool IsOrder( const NameNode * pRoot )
{
- bOrder = TRUE;
+ bOrder = sal_True;
pName = NULL;
pRoot->EnumNodes( LINK( this, OrderCtrl, CallBackFunc ) );
return bOrder;
@@ -377,13 +377,13 @@ public:
IMPL_LINK_INLINE_START( OrderCtrl, CallBackFunc, NameNode *, pNext )
{
if( pName && pName->Compare( pNext ) != LESS )
- bOrder = FALSE;
+ bOrder = sal_False;
pName = pNext;
return 0;
}
IMPL_LINK_INLINE_END( OrderCtrl, CallBackFunc, NameNode *, pNext )
-BOOL NameNode::IsOrderTree() const{
+sal_Bool NameNode::IsOrderTree() const{
OrderCtrl aOrder;
return aOrder.IsOrder( this );
diff --git a/sax/prj/build.lst b/sax/prj/build.lst
index 653d77ce9e25..849700087ae7 100644
--- a/sax/prj/build.lst
+++ b/sax/prj/build.lst
@@ -1,4 +1,4 @@
-ax sax : offapi cppuhelper EXPAT:expat comphelper NULL
+ax sax : offapi cppuhelper EXPAT:expat comphelper LIBXSLT:libxslt NULL
ax sax usr1 - all ax_mkout NULL
ax sax\source\expatwrap nmake - all ax_expatwrap NULL
ax sax\source\tools nmake - all ax_tools NULL
diff --git a/sax/prj/d.lst b/sax/prj/d.lst
index c9e466d440e1..86617b9f3ed2 100644
--- a/sax/prj/d.lst
+++ b/sax/prj/d.lst
@@ -2,6 +2,9 @@
..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
+..\%__SRC%\misc\fastsax.component %_DEST%\xml%_EXT%\fastsax.component
+..\%__SRC%\misc\sax.component %_DEST%\xml%_EXT%\sax.component
+..\%__SRC%\misc\sax.inbuild.component %_DEST%\xml%_EXT%\sax.inbuild.component
mkdir: %_DEST%\inc%_EXT%\sax
mkdir: %_DEST%\inc%_EXT%\sax\tools
diff --git a/sax/qa/cppunit/makefile.mk b/sax/qa/cppunit/makefile.mk
index e06eca25a737..b28f0cbac2ab 100644
--- a/sax/qa/cppunit/makefile.mk
+++ b/sax/qa/cppunit/makefile.mk
@@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk
index bcb73b0443ac..6e1348c0d403 100644
--- a/sax/source/expatwrap/makefile.mk
+++ b/sax/source/expatwrap/makefile.mk
@@ -72,5 +72,16 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/sax.component $(MISC)/sax.inbuild.component
+$(MISC)/sax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+$(MISC)/sax.inbuild.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sax.component
diff --git a/sax/source/expatwrap/sax.component b/sax/source/expatwrap/sax.component
new file mode 100644
index 000000000000..5e6699d9dd33
--- /dev/null
+++ b/sax/source/expatwrap/sax.component
@@ -0,0 +1,37 @@
+<?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.extensions.xml.sax.ParserExpat">
+ <service name="com.sun.star.xml.sax.Parser"/>
+ </implementation>
+ <implementation name="com.sun.star.extensions.xml.sax.Writer">
+ <service name="com.sun.star.xml.sax.Writer"/>
+ </implementation>
+</component>
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index f1e5470da9bd..114d29bea648 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1035,37 +1035,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey = xKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" )) );
- xNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )) );
-
- xNewKey = xKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
- SaxWriter_getImplementationName()+
- OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")) );
- xNewKey->createKey( SaxWriter_getServiceName() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx
index bd66ab30c79e..af05616854c1 100644
--- a/sax/source/fastparser/facreg.cxx
+++ b/sax/source/fastparser/facreg.cxx
@@ -41,34 +41,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey( xKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "/" PARSER_IMPLEMENTATION_NAME "/UNO/SERVICES" )) ) );
- xNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( PARSER_SERVICE_NAME )) );
-
- Reference< XRegistryKey > xNewKey1( xKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "/" SERIALIZER_IMPLEMENTATION_NAME "/UNO/SERVICES" )) ) );
- xNewKey1->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( SERIALIZER_SERVICE_NAME )) );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
void * pRet = 0;
diff --git a/sax/source/fastparser/fastsax.component b/sax/source/fastparser/fastsax.component
new file mode 100644
index 000000000000..a184a76d2d83
--- /dev/null
+++ b/sax/source/fastparser/fastsax.component
@@ -0,0 +1,37 @@
+<?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.extensions.xml.sax.FastParser">
+ <service name="com.sun.star.xml.sax.FastParser"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.extensions.xml.sax.FastSerializer">
+ <service name="com.sun.star.xml.sax.FastSerializer"/>
+ </implementation>
+</component>
diff --git a/sax/source/fastparser/makefile.mk b/sax/source/fastparser/makefile.mk
index 7f70b7aee7bf..d8f9378c19b9 100644
--- a/sax/source/fastparser/makefile.mk
+++ b/sax/source/fastparser/makefile.mk
@@ -70,5 +70,10 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/fastsax.component
-
+$(MISC)/fastsax.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fastsax.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fastsax.component
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index fd4c1de5a509..efa9f1687d7f 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -67,7 +67,7 @@ bool Converter::convertMeasure( sal_Int32& rValue,
bool bNeg = false;
double nVal = 0;
- sal_Int32 nPos = 0L;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rString.getLength();
// skip white space
@@ -393,7 +393,7 @@ bool Converter::convertNumber( sal_Int32& rValue,
bool bNeg = false;
rValue = 0;
- sal_Int32 nPos = 0L;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rString.getLength();
// skip white space
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index 88b15a00be71..239096ae8a05 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -13,8 +13,9 @@ namespace sax_fastparser {
FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream, bool bWriteHeader ) :
mpSerializer(new FastSaxSerializer())
{
- Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
- mxTokenHandler = Reference<xml::sax::XFastTokenHandler> ( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ) ), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW );
+ Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), UNO_SET_THROW );
+ mxTokenHandler.set( xFactory->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastTokenHandler") ), xContext ), UNO_QUERY_THROW );
mpSerializer->setFastTokenHandler( mxTokenHandler );
mpSerializer->setOutputStream( xOutputStream );
@@ -25,11 +26,7 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >&
FastSerializerHelper::~FastSerializerHelper()
{
mpSerializer->endDocument();
-
- if (mpSerializer) {
- delete mpSerializer;
- mpSerializer = NULL;
- }
+ delete mpSerializer;
}
void FastSerializerHelper::startElement(const char* elementName, ...)
diff --git a/sot/JunitTest_sot_complex.mk b/sot/JunitTest_sot_complex.mk
new file mode 100644
index 000000000000..e515ab539659
--- /dev/null
+++ b/sot/JunitTest_sot_complex.mk
@@ -0,0 +1,49 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,sot_complex))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,sot_complex,\
+ sot/qa/complex/olesimplestorage/OLESimpleStorageTest \
+ sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest \
+ sot/qa/complex/olesimplestorage/Test01 \
+ sot/qa/complex/olesimplestorage/TestHelper \
+))
+
+$(eval $(call gb_JunitTest_add_jars,sot_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_classes,sot_complex,\
+ complex.olesimplestorage.OLESimpleStorageUnitTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk
new file mode 100644
index 000000000000..51679534763c
--- /dev/null
+++ b/sot/Library_sot.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,sot))
+
+$(eval $(call gb_Library_add_package_headers,sot,sot_inc))
+
+$(eval $(call gb_Library_add_precompiled_header,sot,$(SRCDIR)/sot/inc/pch/precompiled_sot))
+
+$(eval $(call gb_Library_set_componentfile,sot,sot/util/sot))
+
+$(eval $(call gb_Library_set_include,sot,\
+ -I$(realpath $(SRCDIR)/sot/inc/pch) \
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,sot,\
+ $$(DEFS) \
+ -DSOT_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,sot,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ tl \
+ ucbhelper \
+ utl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,sot,\
+ sot/source/unoolestorage/xolesimplestorage \
+ sot/source/unoolestorage/register \
+ sot/source/base/formats \
+ sot/source/base/object \
+ sot/source/base/exchange \
+ sot/source/base/filelist \
+ sot/source/base/factory \
+ sot/source/sdstor/stg \
+ sot/source/sdstor/stgavl \
+ sot/source/sdstor/stgcache \
+ sot/source/sdstor/stgdir \
+ sot/source/sdstor/stgelem \
+ sot/source/sdstor/stgio \
+ sot/source/sdstor/stgole \
+ sot/source/sdstor/stgstrms \
+ sot/source/sdstor/storage \
+ sot/source/sdstor/storinfo \
+ sot/source/sdstor/ucbstorage \
+ sot/source/sdstor/unostorageholder \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sot/Makefile b/sot/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/sot/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sot/Module_sot.mk b/sot/Module_sot.mk
new file mode 100644
index 000000000000..a9b72bf5f8d6
--- /dev/null
+++ b/sot/Module_sot.mk
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Module_Module,sot))
+
+$(eval $(call gb_Module_add_targets,sot,\
+ Package_inc \
+ Library_sot \
+))
+
+$(eval $(call gb_Module_add_subsequentcheck_targets,sot,\
+ JunitTest_sot_complex \
+))
+
diff --git a/sot/Package_inc.mk b/sot/Package_inc.mk
new file mode 100644
index 000000000000..1b664c263184
--- /dev/null
+++ b/sot/Package_inc.mk
@@ -0,0 +1,42 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,sot_inc,$(SRCDIR)/sot/inc))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/absdev.hxx,sot/absdev.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/agg.hxx,sot/agg.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/clsids.hxx,sot/clsids.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/exchange.hxx,sot/exchange.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/factory.hxx,sot/factory.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/filelist.hxx,sot/filelist.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/formats.hxx,sot/formats.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/object.hxx,sot/object.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdata.hxx,sot/sotdata.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdllapi.h,sot/sotdllapi.h))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotref.hxx,sot/sotref.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/stg.hxx,sot/stg.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storage.hxx,sot/storage.hxx))
+$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storinfo.hxx,sot/storinfo.hxx))
diff --git a/sot/inc/makefile.mk b/sot/inc/makefile.mk
deleted file mode 100644
index bc31cd07e06b..000000000000
--- a/sot/inc/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=sot
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/sot/inc/absdev.hxx b/sot/inc/sot/absdev.hxx
index a464ce1f3c55..b33954621c35 100644
--- a/sot/inc/absdev.hxx
+++ b/sot/inc/sot/absdev.hxx
@@ -39,7 +39,7 @@ protected:
public:
virtual ~AbstractDeviceData() {}
virtual AbstractDeviceData * Copy() const = 0;
- virtual BOOL Equals( const AbstractDeviceData & ) const = 0;
+ virtual sal_Bool Equals( const AbstractDeviceData & ) const = 0;
JobSetup * GetJobSetup() const { return pJobSetup; }
};
diff --git a/sot/inc/agg.hxx b/sot/inc/sot/agg.hxx
index 2521e4701f64..ff5b282160ae 100644
--- a/sot/inc/agg.hxx
+++ b/sot/inc/sot/agg.hxx
@@ -42,21 +42,21 @@ struct SvAggregate
SotFactory * pFact;
SotObject * pObj;
};
- BOOL bFactory;
- BOOL bMainObj; // TRUE, das Objekt, welches das casting steuert
+ sal_Bool bFactory;
+ sal_Bool bMainObj; // sal_True, das Objekt, welches das casting steuert
SvAggregate()
: pFact( NULL )
- , bFactory( FALSE )
- , bMainObj( FALSE ) {}
- SvAggregate( SotObject * pObjP, BOOL bMainP )
+ , bFactory( sal_False )
+ , bMainObj( sal_False ) {}
+ SvAggregate( SotObject * pObjP, sal_Bool bMainP )
: pObj( pObjP )
- , bFactory( FALSE )
+ , bFactory( sal_False )
, bMainObj( bMainP ) {}
SvAggregate( SotFactory * pFactP )
: pFact( pFactP )
- , bFactory( TRUE )
- , bMainObj( FALSE ) {}
+ , bFactory( sal_True )
+ , bMainObj( sal_False ) {}
};
/************** class SvAggregateMemberList *****************************/
diff --git a/sot/inc/clsids.hxx b/sot/inc/sot/clsids.hxx
index 56030d778f5c..56030d778f5c 100644
--- a/sot/inc/clsids.hxx
+++ b/sot/inc/sot/clsids.hxx
diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx
index 48dd74e57fde..7ab886f314ac 100644
--- a/sot/inc/sot/exchange.hxx
+++ b/sot/inc/sot/exchange.hxx
@@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star { namespace datatransfer {
// - SotFormatStringId -
// ---------------------
-typedef ULONG SotFormatStringId;
+typedef sal_uLong SotFormatStringId;
// ----------------
// - DataFlavorEx -
@@ -72,14 +72,14 @@ typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorLi
typedef ::std::list< DataFlavorEx > DataFlavorExList;
SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector,
- ULONG nId );
+ sal_uLong nId );
// -------------------------
// - Vordefinierte Formate -
// -------------------------
-// Die Reihenfolge und die Werte drfen nicht gendert werden,
-// da die Implementation sich darauf verlt.
+// Die Reihenfolge und die Werte d�rfen nicht ge�ndert werden,
+// da die Implementation sich darauf verl��t.
// Standard-Formate fuer die es auch Copy/Paste-Methoden gibt
#define FORMAT_STRING 1
#define FORMAT_BITMAP 2
@@ -92,70 +92,70 @@ SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorE
#define FORMAT_RTF 10
// Source-Options
-#define EXCHG_SOURCE_MOVEABLE ((USHORT)0x0001)
-#define EXCHG_SOURCE_COPYABLE ((USHORT)0x0002)
-#define EXCHG_SOURCE_LINKABLE ((USHORT)0x0004)
-#define EXCHG_SOURCE_PRINTABLE ((USHORT)0x0008)
-#define EXCHG_SOURCE_DISCARDABLE ((USHORT)0x0010)
-#define EXCHG_SOURCE_ALL ((USHORT)0x001F)
-#define EXCHG_SOURCE_DEF_COPYABLE ((USHORT)0x0020)
+#define EXCHG_SOURCE_MOVEABLE ((sal_uInt16)0x0001)
+#define EXCHG_SOURCE_COPYABLE ((sal_uInt16)0x0002)
+#define EXCHG_SOURCE_LINKABLE ((sal_uInt16)0x0004)
+#define EXCHG_SOURCE_PRINTABLE ((sal_uInt16)0x0008)
+#define EXCHG_SOURCE_DISCARDABLE ((sal_uInt16)0x0010)
+#define EXCHG_SOURCE_ALL ((sal_uInt16)0x001F)
+#define EXCHG_SOURCE_DEF_COPYABLE ((sal_uInt16)0x0020)
// Aktionen
-#define EXCHG_ACTION_MASK ((USHORT)0x00FF)
-#define EXCHG_INOUT_ACTION_NONE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE)
+#define EXCHG_ACTION_MASK ((sal_uInt16)0x00FF)
+#define EXCHG_INOUT_ACTION_NONE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE)
#define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE
-#define EXCHG_IN_ACTION_MOVE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE)
-#define EXCHG_IN_ACTION_COPY ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY)
-#define EXCHG_IN_ACTION_LINK ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK)
-#define EXCHG_INOUT_ACTION_PRINT ((USHORT)8)
-#define EXCHG_INOUT_ACTION_DISCARD ((USHORT)16)
-#define EXCHG_OUT_ACTION_INSERT_OBJ ((USHORT)17)
-#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((USHORT)18)
-#define EXCHG_OUT_ACTION_INSERT_FILELINK ((USHORT)19)
-#define EXCHG_OUT_ACTION_INSERT_FILE ((USHORT)20)
-#define EXCHG_OUT_ACTION_INSERT_FILELIST ((USHORT)21)
-#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((USHORT)22)
-#define EXCHG_OUT_ACTION_INSERT_OLE ((USHORT)23)
-#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((USHORT)24)
-#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((USHORT)25)
-#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((USHORT)26) // OBSOLET ab 500.b ?
-#define EXCHG_OUT_ACTION_REPLACE_OBJ ((USHORT)27)
-#define EXCHG_OUT_ACTION_REPLACE_LINK ((USHORT)28)
-#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((USHORT)29)
-#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((USHORT)30)
-#define EXCHG_OUT_ACTION_UPLOAD ((USHORT)31) // OBSOLET ab 500.b ?
-#define EXCHG_OUT_ACTION_MOVE_FILE ((USHORT)32)
-#define EXCHG_OUT_ACTION_MOVE_FILELIST ((USHORT)33)
-#define EXCHG_OUT_ACTION_UPDATE_RANGE ((USHORT)34)
-#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((USHORT)35)
-#define EXCHG_OUT_ACTION_INSERT_HTML ((USHORT)36)
-#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((USHORT)37)
-#define EXCHG_OUT_ACTION_INSERT_STRING ((USHORT)38)
-#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((USHORT)39)
-#define EXCHG_OUT_ACTION_INSERT_SVXB ((USHORT)40)
-#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((USHORT)41)
-#define EXCHG_OUT_ACTION_INSERT_BITMAP ((USHORT)42)
-#define EXCHG_OUT_ACTION_INSERT_DDE ((USHORT)43)
-#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((USHORT)44)
-#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((USHORT)45)
-#define EXCHG_OUT_ACTION_REPLACE_SVXB ((USHORT)46)
-#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((USHORT)47)
-#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((USHORT)48)
-#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((USHORT)49)
-#define EXCHG_OUT_ACTION_INSERT_GRAPH ((USHORT)50)
-#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((USHORT)51) // obsolet ab 500.b ?
-#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((USHORT)52)
-#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((USHORT)53)
-#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((USHORT)54)
-#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((USHORT)55)
-#define EXCHG_OUT_ACTION_COPY_FILE ((USHORT)56)
-
-#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((USHORT)0x0100)
-#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((USHORT)0x0200)
-#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((USHORT)0x0400)
-#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((USHORT)0x0800)
-#define EXCHG_OUT_ACTION_FLAG_FILL ((USHORT)0x1000)
-#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((USHORT)0x2000)
+#define EXCHG_IN_ACTION_MOVE ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE)
+#define EXCHG_IN_ACTION_COPY ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY)
+#define EXCHG_IN_ACTION_LINK ((sal_uInt16)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK)
+#define EXCHG_INOUT_ACTION_PRINT ((sal_uInt16)8)
+#define EXCHG_INOUT_ACTION_DISCARD ((sal_uInt16)16)
+#define EXCHG_OUT_ACTION_INSERT_OBJ ((sal_uInt16)17)
+#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((sal_uInt16)18)
+#define EXCHG_OUT_ACTION_INSERT_FILELINK ((sal_uInt16)19)
+#define EXCHG_OUT_ACTION_INSERT_FILE ((sal_uInt16)20)
+#define EXCHG_OUT_ACTION_INSERT_FILELIST ((sal_uInt16)21)
+#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((sal_uInt16)22)
+#define EXCHG_OUT_ACTION_INSERT_OLE ((sal_uInt16)23)
+#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((sal_uInt16)24)
+#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((sal_uInt16)25)
+#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((sal_uInt16)26) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_REPLACE_OBJ ((sal_uInt16)27)
+#define EXCHG_OUT_ACTION_REPLACE_LINK ((sal_uInt16)28)
+#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((sal_uInt16)29)
+#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((sal_uInt16)30)
+#define EXCHG_OUT_ACTION_UPLOAD ((sal_uInt16)31) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_MOVE_FILE ((sal_uInt16)32)
+#define EXCHG_OUT_ACTION_MOVE_FILELIST ((sal_uInt16)33)
+#define EXCHG_OUT_ACTION_UPDATE_RANGE ((sal_uInt16)34)
+#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((sal_uInt16)35)
+#define EXCHG_OUT_ACTION_INSERT_HTML ((sal_uInt16)36)
+#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((sal_uInt16)37)
+#define EXCHG_OUT_ACTION_INSERT_STRING ((sal_uInt16)38)
+#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((sal_uInt16)39)
+#define EXCHG_OUT_ACTION_INSERT_SVXB ((sal_uInt16)40)
+#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((sal_uInt16)41)
+#define EXCHG_OUT_ACTION_INSERT_BITMAP ((sal_uInt16)42)
+#define EXCHG_OUT_ACTION_INSERT_DDE ((sal_uInt16)43)
+#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((sal_uInt16)44)
+#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((sal_uInt16)45)
+#define EXCHG_OUT_ACTION_REPLACE_SVXB ((sal_uInt16)46)
+#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((sal_uInt16)47)
+#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((sal_uInt16)48)
+#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((sal_uInt16)49)
+#define EXCHG_OUT_ACTION_INSERT_GRAPH ((sal_uInt16)50)
+#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((sal_uInt16)51) // obsolet ab 500.b ?
+#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((sal_uInt16)52)
+#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((sal_uInt16)53)
+#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((sal_uInt16)54)
+#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((sal_uInt16)55)
+#define EXCHG_OUT_ACTION_COPY_FILE ((sal_uInt16)56)
+
+#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((sal_uInt16)0x0100)
+#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((sal_uInt16)0x0200)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((sal_uInt16)0x0400)
+#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((sal_uInt16)0x0800)
+#define EXCHG_OUT_ACTION_FLAG_FILL ((sal_uInt16)0x1000)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((sal_uInt16)0x2000)
// Ziele
#define EXCHG_DEST_DOC_OLEOBJ 1
@@ -183,66 +183,66 @@ class SvGlobalName;
class SOT_DLLPUBLIC SotExchange
{
public:
- static ULONG RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
- static ULONG RegisterFormatName( const String& rName );
- static ULONG RegisterFormatMimeType( const String& rMimeType );
+ static sal_uLong RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static sal_uLong RegisterFormatName( const String& rName );
+ static sal_uLong RegisterFormatMimeType( const String& rMimeType );
- static ULONG GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
- static String GetFormatName( ULONG nFormat );
- static sal_Bool GetFormatDataFlavor( ULONG nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor );
- static String GetFormatMimeType( ULONG nFormat );
- static BOOL IsInternal( const SvGlobalName& );
- static ULONG GetFormatIdFromMimeType( const String& rMimeType );
+ static sal_uLong GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatName( sal_uLong nFormat );
+ static sal_Bool GetFormatDataFlavor( sal_uLong nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatMimeType( sal_uLong nFormat );
+ static sal_Bool IsInternal( const SvGlobalName& );
+ static sal_uLong GetFormatIdFromMimeType( const String& rMimeType );
// bestimme die SotFormatStringId von dem registrierten Format
//JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da
// die ClipboardIds statisch sind und aequivalent zur
// SotFormatStringId ist!
- static SotFormatStringId GetFormatStringId( ULONG nFormat )
+ static SotFormatStringId GetFormatStringId( sal_uLong nFormat )
{ return nFormat; }
static SotFormatStringId GetFormatStringId( const String& rName )
{ return SotExchange::RegisterFormatMimeType( rName ); }
- static ULONG RegisterSotFormatName( SotFormatStringId nId )
+ static sal_uLong RegisterSotFormatName( SotFormatStringId nId )
{ return nId; }
// same for XTransferable interface
- static USHORT GetExchangeAction(
+ static sal_uInt16 GetExchangeAction(
// XTransferable
const DataFlavorExVector& rDataFlavorExVector,
// Ziel der Aktion (EXCHG_DEST_*)
- USHORT nDestination,
+ sal_uInt16 nDestination,
// Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...)
- USHORT nSourceOptions,
+ sal_uInt16 nSourceOptions,
// vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*)
- USHORT nUserAction,
+ sal_uInt16 nUserAction,
// In:- Out: Zu benutzendes Format
- ULONG& rFormat,
+ sal_uLong& rFormat,
// In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*)
- USHORT& rDefaultAction,
+ sal_uInt16& rDefaultAction,
// In:- optional - check only for this specific format
- ULONG nOnlyTestFormat = 0,
+ sal_uLong nOnlyTestFormat = 0,
// In:- optional - check the contents of Xtransferable
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL );
// same for XTransferable interface
- static USHORT GetExchangeAction(
+ static sal_uInt16 GetExchangeAction(
// XTransferable
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable,
// Ziel der Aktion (EXCHG_DEST_*)
- USHORT nDestination,
+ sal_uInt16 nDestination,
// Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...)
- USHORT nSourceOptions,
+ sal_uInt16 nSourceOptions,
// vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*)
- USHORT nUserAction,
+ sal_uInt16 nUserAction,
// In:- Out: Zu benutzendes Format
- ULONG& rFormat,
+ sal_uLong& rFormat,
// In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*)
- USHORT& rDefaultAction,
+ sal_uInt16& rDefaultAction,
// In:- optional - check only for this specific format
- ULONG nOnlyTestFormat = 0 );
+ sal_uLong nOnlyTestFormat = 0 );
- static USHORT IsChart( const SvGlobalName& rName );
- static USHORT IsMath( const SvGlobalName& rName );
+ static sal_uInt16 IsChart( const SvGlobalName& rName );
+ static sal_uInt16 IsMath( const SvGlobalName& rName );
};
#endif // _EXCHANGE_HXX
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx
index d27251987428..d6eba9afe60a 100644
--- a/sot/inc/sot/factory.hxx
+++ b/sot/inc/sot/factory.hxx
@@ -45,13 +45,13 @@ typedef void * (*CreateInstanceType)( SotObject ** );
//==================class SotFactory=======================================
class SOT_DLLPUBLIC SotFactory : public SvGlobalName
{
- USHORT nSuperCount; // Anzahl der Superklassen
+ sal_uInt16 nSuperCount; // Anzahl der Superklassen
const SotFactory ** pSuperClasses; // Superklassen
CreateInstanceType pCreateFunc;
String aClassName;
- static BOOL ExistTest( const SvGlobalName & );
+ static sal_Bool ExistTest( const SvGlobalName & );
protected:
virtual ~SotFactory();
public:
@@ -59,7 +59,7 @@ public:
static void DeInit();
static void IncSvObjectCount( SotObject * = NULL );
static void DecSvObjectCount( SotObject * = NULL );
- static UINT32 GetSvObjectCount();
+ static sal_uInt32 GetSvObjectCount();
static void TestInvariant();
static const SotFactory * Find( const SvGlobalName & );
@@ -71,10 +71,9 @@ public:
void PutSuperClass( const SotFactory * );
virtual void * CreateInstance( SotObject ** ppObj = NULL ) const;
void * CastAndAddRef( SotObject * ) const;
- void * AggCastAndAddRef( SotObject * ) const;
- BOOL Is( const SotFactory * pSuperClass ) const;
- const SotFactory * GetSuper( USHORT nPos ) const
+ sal_Bool Is( const SotFactory * pSuperClass ) const;
+ const SotFactory * GetSuper( sal_uInt16 nPos ) const
{
return nPos < nSuperCount ?
pSuperClasses[ nPos ]
diff --git a/sot/inc/filelist.hxx b/sot/inc/sot/filelist.hxx
index e4f920437165..0ba367fa9f72 100644
--- a/sot/inc/filelist.hxx
+++ b/sot/inc/sot/filelist.hxx
@@ -63,7 +63,7 @@ public:
SOT_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, FileList& rFileList );
// Clipboard, D&D usw.
- static ULONG GetFormat();
+ static sal_uLong GetFormat();
// Liste fuellen/abfragen
diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx
index 36c21d6075bb..595dd09e8cd8 100644
--- a/sot/inc/sot/formats.hxx
+++ b/sot/inc/sot/formats.hxx
@@ -47,145 +47,145 @@
#endif
#include <sot/exchange.hxx>
-#define SOT_FORMAT_SYSTEM_START ((ULONG)0)
-#define SOT_FORMAT_STRING ((ULONG)FORMAT_STRING)
-#define SOT_FORMAT_BITMAP ((ULONG)FORMAT_BITMAP)
-#define SOT_FORMAT_GDIMETAFILE ((ULONG)FORMAT_GDIMETAFILE)
-#define SOT_FORMAT_PRIVATE ((ULONG)FORMAT_PRIVATE)
-#define SOT_FORMAT_FILE ((ULONG)FORMAT_FILE)
-#define SOT_FORMAT_FILE_LIST ((ULONG)FORMAT_FILE_LIST)
-#define SOT_FORMAT_RTF ((ULONG)FORMAT_RTF)
+#define SOT_FORMAT_SYSTEM_START ((sal_uLong)0)
+#define SOT_FORMAT_STRING ((sal_uLong)FORMAT_STRING)
+#define SOT_FORMAT_BITMAP ((sal_uLong)FORMAT_BITMAP)
+#define SOT_FORMAT_GDIMETAFILE ((sal_uLong)FORMAT_GDIMETAFILE)
+#define SOT_FORMAT_PRIVATE ((sal_uLong)FORMAT_PRIVATE)
+#define SOT_FORMAT_FILE ((sal_uLong)FORMAT_FILE)
+#define SOT_FORMAT_FILE_LIST ((sal_uLong)FORMAT_FILE_LIST)
+#define SOT_FORMAT_RTF ((sal_uLong)FORMAT_RTF)
-#define SOT_FORMATSTR_ID_DRAWING ((ULONG)11)
-#define SOT_FORMATSTR_ID_SVXB ((ULONG)12)
-#define SOT_FORMATSTR_ID_SVIM ((ULONG)13)
-#define SOT_FORMATSTR_ID_XFA ((ULONG)14)
-#define SOT_FORMATSTR_ID_EDITENGINE ((ULONG)15)
-#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((ULONG)16)
-#define SOT_FORMATSTR_ID_SOLK ((ULONG)17)
-#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((ULONG)18)
-#define SOT_FORMATSTR_ID_TREELISTBOX ((ULONG)19)
-#define SOT_FORMATSTR_ID_NATIVE ((ULONG)20)
-#define SOT_FORMATSTR_ID_OWNERLINK ((ULONG)21)
-#define SOT_FORMATSTR_ID_STARSERVER ((ULONG)22)
-#define SOT_FORMATSTR_ID_STAROBJECT ((ULONG)23)
-#define SOT_FORMATSTR_ID_APPLETOBJECT ((ULONG)24)
-#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((ULONG)25)
-#define SOT_FORMATSTR_ID_STARWRITER_30 ((ULONG)26)
-#define SOT_FORMATSTR_ID_STARWRITER_40 ((ULONG)27)
-#define SOT_FORMATSTR_ID_STARWRITER_50 ((ULONG)28)
-#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((ULONG)29)
-#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((ULONG)30)
-#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((ULONG)31)
-#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((ULONG)32)
-#define SOT_FORMATSTR_ID_STARDRAW ((ULONG)33)
-#define SOT_FORMATSTR_ID_STARDRAW_40 ((ULONG)34)
-#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((ULONG)35)
-#define SOT_FORMATSTR_ID_STARDRAW_50 ((ULONG)36)
-#define SOT_FORMATSTR_ID_STARCALC ((ULONG)37)
-#define SOT_FORMATSTR_ID_STARCALC_40 ((ULONG)38)
-#define SOT_FORMATSTR_ID_STARCALC_50 ((ULONG)39)
-#define SOT_FORMATSTR_ID_STARCHART ((ULONG)40)
-#define SOT_FORMATSTR_ID_STARCHART_40 ((ULONG)41)
-#define SOT_FORMATSTR_ID_STARCHART_50 ((ULONG)42)
-#define SOT_FORMATSTR_ID_STARIMAGE ((ULONG)43)
-#define SOT_FORMATSTR_ID_STARIMAGE_40 ((ULONG)44)
-#define SOT_FORMATSTR_ID_STARIMAGE_50 ((ULONG)45)
-#define SOT_FORMATSTR_ID_STARMATH ((ULONG)46)
-#define SOT_FORMATSTR_ID_STARMATH_40 ((ULONG)47)
-#define SOT_FORMATSTR_ID_STARMATH_50 ((ULONG)48)
-#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((ULONG)49)
-#define SOT_FORMATSTR_ID_FILLED_AREA ((ULONG)50)
-#define SOT_FORMATSTR_ID_HTML ((ULONG)51)
-#define SOT_FORMATSTR_ID_HTML_SIMPLE ((ULONG)52)
-#define SOT_FORMATSTR_ID_CHAOS ((ULONG)53)
-#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((ULONG)54)
-#define SOT_FORMATSTR_ID_BIFF_5 ((ULONG)55)
-#define SOT_FORMATSTR_ID_BIFF__5 ((ULONG)56)
-#define SOT_FORMATSTR_ID_SYLK ((ULONG)57)
-#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((ULONG)58)
-#define SOT_FORMATSTR_ID_LINK ((ULONG)59)
-#define SOT_FORMATSTR_ID_DIF ((ULONG)60)
-#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((ULONG)61)
-#define SOT_FORMATSTR_ID_SONLK ((ULONG)62)
-#define SOT_FORMATSTR_ID_MSWORD_DOC ((ULONG)63)
-#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((ULONG)64)
-#define SOT_FORMATSTR_ID_OFFICE_DOC ((ULONG)65)
-#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((ULONG)66)
-#define SOT_FORMATSTR_ID_NOTES_HNOTE ((ULONG)67)
-#define SOT_FORMATSTR_ID_NOTES_NATIVE ((ULONG)68)
-#define SOT_FORMATSTR_ID_SFX_DOC ((ULONG)69)
-#define SOT_FORMATSTR_ID_EVDF ((ULONG)70)
-#define SOT_FORMATSTR_ID_ESDF ((ULONG)71)
-#define SOT_FORMATSTR_ID_IDF ((ULONG)72)
-#define SOT_FORMATSTR_ID_EFTP ((ULONG)73)
-#define SOT_FORMATSTR_ID_EFD ((ULONG)74)
-#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((ULONG)75)
-#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((ULONG)76)
-#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((ULONG)77)
-#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((ULONG)78)
-#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((ULONG)79)
-#define SOT_FORMATSTR_ID_SBA_TABED ((ULONG)80)
-#define SOT_FORMATSTR_ID_SBA_TABID ((ULONG)81)
-#define SOT_FORMATSTR_ID_SBA_JOIN ((ULONG)82)
-#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((ULONG)83)
-#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((ULONG)84)
-#define SOT_FORMATSTR_ID_EMBED_SOURCE ((ULONG)85)
-#define SOT_FORMATSTR_ID_LINK_SOURCE ((ULONG)86)
-#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((ULONG)87)
-#define SOT_FORMATSTR_ID_FILECONTENT ((ULONG)88)
-#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((ULONG)89)
-#define SOT_FORMATSTR_ID_FILENAME ((ULONG)90)
-#define SOT_FORMATSTR_ID_SD_OLE ((ULONG)91)
-#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((ULONG)92)
-#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((ULONG)93)
-#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((ULONG)94)
-#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((ULONG)95)
-#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((ULONG)96)
-#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((ULONG)97)
-#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((ULONG)98)
-#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((ULONG)99)
-#define SOT_FORMATSTR_ID_INET_IMAGE ((ULONG)100)
-#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((ULONG)101)
-#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((ULONG)102)
-#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((ULONG)103)
-#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((ULONG)104)
-#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((ULONG)105)
-#define SOT_FORMATSTR_ID_GRAPHOBJ ((ULONG)106)
-#define SOT_FORMATSTR_ID_STARWRITER_60 ((ULONG)107)
-#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((ULONG)108)
-#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((ULONG)109)
-#define SOT_FORMATSTR_ID_STARDRAW_60 ((ULONG)110)
-#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((ULONG)111)
-#define SOT_FORMATSTR_ID_STARCALC_60 ((ULONG)112)
-#define SOT_FORMATSTR_ID_STARCHART_60 ((ULONG)113)
-#define SOT_FORMATSTR_ID_STARMATH_60 ((ULONG)114)
-#define SOT_FORMATSTR_ID_WMF ((ULONG)115)
-#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((ULONG)116)
-#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((ULONG)117)
-#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((ULONG)118)
-#define SOT_FORMATSTR_ID_DIALOG_60 ((ULONG)119)
-#define SOT_FORMATSTR_ID_EMF ((ULONG)120)
-#define SOT_FORMATSTR_ID_BIFF_8 ((ULONG)121)
-#define SOT_FORMATSTR_ID_BMP ((ULONG)122)
-#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((ULONG)123)
-#define SOT_FORMATSTR_ID_STARWRITER_8 ((ULONG)124)
-#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((ULONG)125)
-#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((ULONG)126)
-#define SOT_FORMATSTR_ID_STARDRAW_8 ((ULONG)127)
-#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((ULONG)128)
-#define SOT_FORMATSTR_ID_STARCALC_8 ((ULONG)129)
-#define SOT_FORMATSTR_ID_STARCHART_8 ((ULONG)130)
-#define SOT_FORMATSTR_ID_STARMATH_8 ((ULONG)131)
-#define SOT_FORMATSTR_ID_XFORMS ((ULONG)132)
-#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((ULONG)133)
-#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((ULONG)134)
-#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((ULONG)135)
-#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((ULONG)136)
-#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((ULONG)137)
-#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((ULONG)138)
-#define SOT_FORMATSTR_ID_STARBASE_8 ((ULONG)139)
-#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((ULONG)140)
+#define SOT_FORMATSTR_ID_DRAWING ((sal_uLong)11)
+#define SOT_FORMATSTR_ID_SVXB ((sal_uLong)12)
+#define SOT_FORMATSTR_ID_SVIM ((sal_uLong)13)
+#define SOT_FORMATSTR_ID_XFA ((sal_uLong)14)
+#define SOT_FORMATSTR_ID_EDITENGINE ((sal_uLong)15)
+#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((sal_uLong)16)
+#define SOT_FORMATSTR_ID_SOLK ((sal_uLong)17)
+#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((sal_uLong)18)
+#define SOT_FORMATSTR_ID_TREELISTBOX ((sal_uLong)19)
+#define SOT_FORMATSTR_ID_NATIVE ((sal_uLong)20)
+#define SOT_FORMATSTR_ID_OWNERLINK ((sal_uLong)21)
+#define SOT_FORMATSTR_ID_STARSERVER ((sal_uLong)22)
+#define SOT_FORMATSTR_ID_STAROBJECT ((sal_uLong)23)
+#define SOT_FORMATSTR_ID_APPLETOBJECT ((sal_uLong)24)
+#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((sal_uLong)25)
+#define SOT_FORMATSTR_ID_STARWRITER_30 ((sal_uLong)26)
+#define SOT_FORMATSTR_ID_STARWRITER_40 ((sal_uLong)27)
+#define SOT_FORMATSTR_ID_STARWRITER_50 ((sal_uLong)28)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((sal_uLong)29)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((sal_uLong)30)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((sal_uLong)31)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((sal_uLong)32)
+#define SOT_FORMATSTR_ID_STARDRAW ((sal_uLong)33)
+#define SOT_FORMATSTR_ID_STARDRAW_40 ((sal_uLong)34)
+#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((sal_uLong)35)
+#define SOT_FORMATSTR_ID_STARDRAW_50 ((sal_uLong)36)
+#define SOT_FORMATSTR_ID_STARCALC ((sal_uLong)37)
+#define SOT_FORMATSTR_ID_STARCALC_40 ((sal_uLong)38)
+#define SOT_FORMATSTR_ID_STARCALC_50 ((sal_uLong)39)
+#define SOT_FORMATSTR_ID_STARCHART ((sal_uLong)40)
+#define SOT_FORMATSTR_ID_STARCHART_40 ((sal_uLong)41)
+#define SOT_FORMATSTR_ID_STARCHART_50 ((sal_uLong)42)
+#define SOT_FORMATSTR_ID_STARIMAGE ((sal_uLong)43)
+#define SOT_FORMATSTR_ID_STARIMAGE_40 ((sal_uLong)44)
+#define SOT_FORMATSTR_ID_STARIMAGE_50 ((sal_uLong)45)
+#define SOT_FORMATSTR_ID_STARMATH ((sal_uLong)46)
+#define SOT_FORMATSTR_ID_STARMATH_40 ((sal_uLong)47)
+#define SOT_FORMATSTR_ID_STARMATH_50 ((sal_uLong)48)
+#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((sal_uLong)49)
+#define SOT_FORMATSTR_ID_FILLED_AREA ((sal_uLong)50)
+#define SOT_FORMATSTR_ID_HTML ((sal_uLong)51)
+#define SOT_FORMATSTR_ID_HTML_SIMPLE ((sal_uLong)52)
+#define SOT_FORMATSTR_ID_CHAOS ((sal_uLong)53)
+#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((sal_uLong)54)
+#define SOT_FORMATSTR_ID_BIFF_5 ((sal_uLong)55)
+#define SOT_FORMATSTR_ID_BIFF__5 ((sal_uLong)56)
+#define SOT_FORMATSTR_ID_SYLK ((sal_uLong)57)
+#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((sal_uLong)58)
+#define SOT_FORMATSTR_ID_LINK ((sal_uLong)59)
+#define SOT_FORMATSTR_ID_DIF ((sal_uLong)60)
+#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((sal_uLong)61)
+#define SOT_FORMATSTR_ID_SONLK ((sal_uLong)62)
+#define SOT_FORMATSTR_ID_MSWORD_DOC ((sal_uLong)63)
+#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((sal_uLong)64)
+#define SOT_FORMATSTR_ID_OFFICE_DOC ((sal_uLong)65)
+#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((sal_uLong)66)
+#define SOT_FORMATSTR_ID_NOTES_HNOTE ((sal_uLong)67)
+#define SOT_FORMATSTR_ID_NOTES_NATIVE ((sal_uLong)68)
+#define SOT_FORMATSTR_ID_SFX_DOC ((sal_uLong)69)
+#define SOT_FORMATSTR_ID_EVDF ((sal_uLong)70)
+#define SOT_FORMATSTR_ID_ESDF ((sal_uLong)71)
+#define SOT_FORMATSTR_ID_IDF ((sal_uLong)72)
+#define SOT_FORMATSTR_ID_EFTP ((sal_uLong)73)
+#define SOT_FORMATSTR_ID_EFD ((sal_uLong)74)
+#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((sal_uLong)75)
+#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((sal_uLong)76)
+#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((sal_uLong)77)
+#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((sal_uLong)78)
+#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((sal_uLong)79)
+#define SOT_FORMATSTR_ID_SBA_TABED ((sal_uLong)80)
+#define SOT_FORMATSTR_ID_SBA_TABID ((sal_uLong)81)
+#define SOT_FORMATSTR_ID_SBA_JOIN ((sal_uLong)82)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((sal_uLong)83)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((sal_uLong)84)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE ((sal_uLong)85)
+#define SOT_FORMATSTR_ID_LINK_SOURCE ((sal_uLong)86)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((sal_uLong)87)
+#define SOT_FORMATSTR_ID_FILECONTENT ((sal_uLong)88)
+#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((sal_uLong)89)
+#define SOT_FORMATSTR_ID_FILENAME ((sal_uLong)90)
+#define SOT_FORMATSTR_ID_SD_OLE ((sal_uLong)91)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((sal_uLong)92)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((sal_uLong)93)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((sal_uLong)94)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((sal_uLong)95)
+#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((sal_uLong)96)
+#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((sal_uLong)97)
+#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((sal_uLong)98)
+#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((sal_uLong)99)
+#define SOT_FORMATSTR_ID_INET_IMAGE ((sal_uLong)100)
+#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((sal_uLong)101)
+#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((sal_uLong)102)
+#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((sal_uLong)103)
+#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((sal_uLong)104)
+#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((sal_uLong)105)
+#define SOT_FORMATSTR_ID_GRAPHOBJ ((sal_uLong)106)
+#define SOT_FORMATSTR_ID_STARWRITER_60 ((sal_uLong)107)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((sal_uLong)108)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((sal_uLong)109)
+#define SOT_FORMATSTR_ID_STARDRAW_60 ((sal_uLong)110)
+#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((sal_uLong)111)
+#define SOT_FORMATSTR_ID_STARCALC_60 ((sal_uLong)112)
+#define SOT_FORMATSTR_ID_STARCHART_60 ((sal_uLong)113)
+#define SOT_FORMATSTR_ID_STARMATH_60 ((sal_uLong)114)
+#define SOT_FORMATSTR_ID_WMF ((sal_uLong)115)
+#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((sal_uLong)116)
+#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((sal_uLong)117)
+#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((sal_uLong)118)
+#define SOT_FORMATSTR_ID_DIALOG_60 ((sal_uLong)119)
+#define SOT_FORMATSTR_ID_EMF ((sal_uLong)120)
+#define SOT_FORMATSTR_ID_BIFF_8 ((sal_uLong)121)
+#define SOT_FORMATSTR_ID_BMP ((sal_uLong)122)
+#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((sal_uLong)123)
+#define SOT_FORMATSTR_ID_STARWRITER_8 ((sal_uLong)124)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((sal_uLong)125)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((sal_uLong)126)
+#define SOT_FORMATSTR_ID_STARDRAW_8 ((sal_uLong)127)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((sal_uLong)128)
+#define SOT_FORMATSTR_ID_STARCALC_8 ((sal_uLong)129)
+#define SOT_FORMATSTR_ID_STARCHART_8 ((sal_uLong)130)
+#define SOT_FORMATSTR_ID_STARMATH_8 ((sal_uLong)131)
+#define SOT_FORMATSTR_ID_XFORMS ((sal_uLong)132)
+#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((sal_uLong)133)
+#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((sal_uLong)134)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((sal_uLong)135)
+#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((sal_uLong)136)
+#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((sal_uLong)137)
+#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((sal_uLong)138)
+#define SOT_FORMATSTR_ID_STARBASE_8 ((sal_uLong)139)
+#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((sal_uLong)140)
#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE
#endif // _SOT_FORMATS_HXX
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
index 28239d58c8e4..02ae430a38f8 100644
--- a/sot/inc/sot/object.hxx
+++ b/sot/inc/sot/object.hxx
@@ -40,41 +40,41 @@
#define TEST_INVARIANT
#ifdef TEST_INVARIANT
#define SO2_DECL_INVARIANT() \
- virtual void TestObjRef( BOOL bFree ); \
- void TestMemberObjRef( BOOL bFree ); \
- virtual void TestInvariant( BOOL bPrint ); \
- void TestMemberInvariant( BOOL bPrint );
+ virtual void TestObjRef( sal_Bool bFree ); \
+ void TestMemberObjRef( sal_Bool bFree ); \
+ virtual void TestInvariant( sal_Bool bPrint ); \
+ void TestMemberInvariant( sal_Bool bPrint );
#define SO2_IMPL_INVARIANT(ClassName) \
-void ClassName::TestObjRef( BOOL bFree ) \
+void ClassName::TestObjRef( sal_Bool bFree ) \
{ \
TestMemberObjRef( bFree ); \
} \
-void ClassName::TestInvariant( BOOL bPrint ) \
+void ClassName::TestInvariant( sal_Bool bPrint ) \
{ \
TestMemberInvariant( bPrint ); \
}
#define SO2_IMPL_INVARIANT1(ClassName,Super1) \
-void ClassName::TestObjRef( BOOL bFree ) \
+void ClassName::TestObjRef( sal_Bool bFree ) \
{ \
TestMemberObjRef( bFree ); \
Super1::TestObjRef( bFree ); \
} \
-void ClassName::TestInvariant( BOOL bPrint ) \
+void ClassName::TestInvariant( sal_Bool bPrint ) \
{ \
TestMemberInvariant( bPrint ); \
Super1::TestInvariant( bPrint ); \
}
#define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \
-void ClassName::TestObjRef( BOOL bFree ) \
+void ClassName::TestObjRef( sal_Bool bFree ) \
{ \
TestMemberObjRef( bFree ); \
Super1::TestObjRef( bFree ); \
Super2::TestObjRef( bFree ); \
} \
-void ClassName::TestInvariant( BOOL bPrint ) \
+void ClassName::TestInvariant( sal_Bool bPrint ) \
{ \
TestMemberInvariant( bPrint ); \
Super1::TestInvariant( bPrint ); \
@@ -82,14 +82,14 @@ void ClassName::TestInvariant( BOOL bPrint ) \
}
#define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \
-void ClassName::TestObjRef( BOOL bFree ) \
+void ClassName::TestObjRef( sal_Bool bFree ) \
{ \
TestMemberObjRef( bFree ); \
Super1::TestObjRef( bFree ); \
Super2::TestObjRef( bFree ); \
Super3::TestObjRef( bFree ); \
} \
-void ClassName::TestInvariant( BOOL bPrint ) \
+void ClassName::TestInvariant( sal_Bool bPrint ) \
{ \
TestMemberInvariant( bPrint ); \
Super1::TestInvariant( bPrint ); \
@@ -98,7 +98,7 @@ void ClassName::TestInvariant( BOOL bPrint ) \
}
#define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \
-void ClassName::TestObjRef( BOOL bFree ) \
+void ClassName::TestObjRef( sal_Bool bFree ) \
{ \
TestMemberObjRef( bFree ); \
Super1::TestObjRef( bFree ); \
@@ -106,7 +106,7 @@ void ClassName::TestObjRef( BOOL bFree ) \
Super3::TestObjRef( bFree ); \
Super4::TestObjRef( bFree ); \
} \
-void ClassName::TestInvariant( BOOL bPrint ) \
+void ClassName::TestInvariant( sal_Bool bPrint ) \
{ \
TestMemberInvariant( bPrint ); \
Super1::TestInvariant( bPrint ); \
@@ -378,30 +378,25 @@ SotFactory * ClassName::pFactory = NULL; \
#pragma warning(disable: 4250)
#endif
-class SvAggregateMemberList;
struct IUnknown;
class SOT_DLLPUBLIC SotObject : virtual public SvRefBase
{
friend class SotFactory;
friend class SvObject;
- SvAggregateMemberList * pAggList; // fuer Aggregation, erstes ist das MainObj
- USHORT nStrongLockCount;
- USHORT nOwnerLockCount;
- BOOL bOwner:1,
+ sal_uInt16 nStrongLockCount;
+ sal_uInt16 nOwnerLockCount;
+ sal_Bool bOwner:1,
bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist
bInClose:1; // TRUE, im DoClose
- void * DownAggCast( const SotFactory * pFact );
- void RemoveInterface( ULONG );
- void RemoveInterface( SotObject * );
#if defined (GCC) && (defined (C281) || defined (C290) || defined (C291))
public:
#else
protected:
#endif
virtual ~SotObject();
- void SetExtern() { bOwner = FALSE; }
- virtual BOOL Close();
+ void SetExtern() { bOwner = sal_False; }
+ virtual sal_Bool Close();
public:
SotObject();
SO2_DECL_BASIC_CLASS_DLL(SotObject,SOTDATA())
@@ -410,33 +405,18 @@ public:
// Nur damit die Makros in So3 nicht ganz ausufern
virtual IUnknown * GetInterface( const SvGlobalName & );
- BOOL Owner() const { return bOwner; }
- BOOL IsSvObject() const;
-
- // Methoden fuer die Aggregation (siehe OLE2-Spec)
- BOOL ShouldDelete();
- virtual void QueryDelete();
- SvAggregateMemberList & GetAggList();
- void AddInterface( SotObject * );
- void AddInterface( SotFactory * );
- virtual SotObjectRef CreateAggObj( const SotFactory * );
- void * AggCast( const SotFactory * pFact );
- void * CastAndAddRef( const SotFactory * pFact );
- SotObject * GetMainObj() const;
-
- // !!! Read the Manual !!!
- virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose );
- void Lock( BOOL bLock )
- {
- FuzzyLock( bLock, TRUE, TRUE );
- }
- USHORT GetOwnerLockCount() const { return nOwnerLockCount; }
- USHORT GetStrongLockCount() const { return nStrongLockCount; }
-
- void OwnerLock( BOOL bLock );
+ sal_Bool Owner() const { return bOwner; }
+
+ void* CastAndAddRef( const SotFactory * pFact );
+
+ sal_uInt16 Lock( sal_Bool bLock ); // affects nStrongLockCount
+ sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; }
+ sal_uInt16 GetStrongLockCount() const { return nStrongLockCount; }
+
+ void OwnerLock( sal_Bool bLock );
void RemoveOwnerLock();
- BOOL DoClose();
- BOOL IsInClose() const { return bInClose; }
+ sal_Bool DoClose();
+ sal_Bool IsInClose() const { return bInClose; }
private:
// Kopieren und Zuweisen dieses Objekttyps ist nicht erlaubt
@@ -447,18 +427,6 @@ private:
//==================class SotObjectRef======================================
SV_IMPL_REF(SotObject)
-inline SotObjectRef::SotObjectRef( SotObject * pObjP, SvCastEnum )
-{
- if( pObjP )
- {
- pObj = (SotObject *)pObjP->AggCast( SotObject::ClassFactory() );
- if( pObj )
- pObj->AddRef();
- }
- else
- pObj = NULL;
-}
-
//==================class SotObject*List====================================
SV_DECL_REF_LIST(SotObject,SotObject*)
SV_IMPL_REF_LIST(SotObject,SotObject*)
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
index 73c1b1010cb2..0e2564ee0ae9 100644
--- a/sot/inc/sot/sotdata.hxx
+++ b/sot/inc/sot/sotdata.hxx
@@ -46,7 +46,7 @@ typedef ::std::vector< SotFactory* > SotFactoryList;
struct SotData_Impl
{
- UINT32 nSvObjCount;
+ sal_uInt32 nSvObjCount;
SotObjectList * pObjectList;
SotFactoryList * pFactoryList;
SotFactory * pSotObjectFactory;
diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx
index cb1a991320ab..ab4b2c4e0a76 100644
--- a/sot/inc/sot/sotref.hxx
+++ b/sot/inc/sot/sotref.hxx
@@ -32,14 +32,12 @@
#include <tools/ref.hxx>
//========================================================================
-enum SvCastEnum { SV_AGGREGATION_CAST };
#ifndef SVT_DECL_SOTOBJECT_DEFINED
#define SVT_DECL_SOTOBJECT_DEFINED
class SotObject;
class SotObjectRef
{
PRV_SV_DECL_REF(SotObject)
- inline SotObjectRef( SotObject * pObjP, SvCastEnum );
};
#endif
@@ -51,7 +49,6 @@ class ClassName##Ref \
PRV_SV_DECL_REF(ClassName) \
inline ClassName##Ref( const SotObjectRef & ); \
inline ClassName##Ref( SotObject * pObjP ); \
- inline ClassName##Ref( SotObject * pObjP, SvCastEnum ); \
};
#define SO2_IMPL_REF(ClassName) \
@@ -63,12 +60,9 @@ inline ClassName##Ref::ClassName##Ref( const SotObjectRef & r ) \
inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \
{ \
pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( pObjP );\
-} \
-inline ClassName##Ref::ClassName##Ref( SotObject * pObjP, SvCastEnum ) \
-{ \
- pObj = (ClassName *)ClassName::ClassFactory()->AggCastAndAddRef( pObjP );\
}
+
#define SO2_DECL_IMPL_REF(ClassName) \
SO2_DECL_REF(ClassName) \
SO2_IMPL_REF(ClassName)
diff --git a/sot/inc/stg.hxx b/sot/inc/sot/stg.hxx
index a64390521d57..30ffbf06d2a7 100644
--- a/sot/inc/stg.hxx
+++ b/sot/inc/sot/stg.hxx
@@ -56,30 +56,30 @@ class StgStrm;
class SvGlobalName;
struct ClsId
{
- INT32 n1;
- INT16 n2, n3;
- UINT8 n4, n5, n6, n7, n8, n9, n10, n11;
+ sal_Int32 n1;
+ sal_Int16 n2, n3;
+ sal_uInt8 n4, n5, n6, n7, n8, n9, n10, n11;
};
class SOT_DLLPUBLIC StorageBase : public SvRefBase
{
protected:
- ULONG m_nError; // error code
+ sal_uLong m_nError; // error code
StreamMode m_nMode; // open mode
- BOOL m_bAutoCommit;
+ sal_Bool m_bAutoCommit;
StorageBase();
virtual ~StorageBase();
public:
TYPEINFO();
virtual const SvStream* GetSvStream() const = 0;
- virtual BOOL Validate( BOOL=FALSE ) const = 0;
- virtual BOOL ValidateMode( StreamMode ) const = 0;
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0;
+ virtual sal_Bool ValidateMode( StreamMode ) const = 0;
void ResetError() const;
- void SetError( ULONG ) const;
- ULONG GetError() const;
- BOOL Good() const { return BOOL( m_nError == SVSTREAM_OK ); }
+ void SetError( sal_uLong ) const;
+ sal_uLong GetError() const;
+ sal_Bool Good() const { return sal_Bool( m_nError == SVSTREAM_OK ); }
StreamMode GetMode() const { return m_nMode; }
- void SetAutoCommit( BOOL bSet )
+ void SetAutoCommit( sal_Bool bSet )
{ m_bAutoCommit = bSet; }
};
@@ -87,16 +87,16 @@ class BaseStorageStream : public StorageBase
{
public:
TYPEINFO();
- virtual ULONG Read( void * pData, ULONG nSize ) = 0;
- virtual ULONG Write( const void* pData, ULONG nSize ) = 0;
- virtual ULONG Seek( ULONG nPos ) = 0;
- virtual ULONG Tell() = 0;
+ virtual sal_uLong Read( void * pData, sal_uLong nSize ) = 0;
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize ) = 0;
+ virtual sal_uLong Seek( sal_uLong nPos ) = 0;
+ virtual sal_uLong Tell() = 0;
virtual void Flush() = 0;
- virtual BOOL SetSize( ULONG nNewSize ) = 0;
- virtual BOOL CopyTo( BaseStorageStream * pDestStm ) = 0;
- virtual BOOL Commit() = 0;
- virtual BOOL Revert() = 0;
- virtual BOOL Equals( const BaseStorageStream& rStream ) const = 0;
+ virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0;
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0;
+ virtual sal_Bool Commit() = 0;
+ virtual sal_Bool Revert() = 0;
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0;
};
class SvStorageInfoList;
@@ -105,45 +105,45 @@ class BaseStorage : public StorageBase
public:
TYPEINFO();
virtual const String& GetName() const = 0;
- virtual BOOL IsRoot() const = 0;
+ virtual sal_Bool IsRoot() const = 0;
virtual void SetClassId( const ClsId& ) = 0;
virtual const ClsId& GetClassId() const = 0;
virtual void SetDirty() = 0;
virtual void SetClass( const SvGlobalName & rClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName ) = 0;
virtual void SetConvertClass( const SvGlobalName & rConvertClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName ) = 0;
virtual SvGlobalName GetClassName() = 0;
- virtual ULONG GetFormat() = 0;
+ virtual sal_uLong GetFormat() = 0;
virtual String GetUserName() = 0;
- virtual BOOL ShouldConvert() = 0;
+ virtual sal_Bool ShouldConvert() = 0;
virtual void FillInfoList( SvStorageInfoList* ) const = 0;
- virtual BOOL CopyTo( BaseStorage* pDestStg ) const = 0;
- virtual BOOL Commit() = 0;
- virtual BOOL Revert() = 0;
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const = 0;
+ virtual sal_Bool Commit() = 0;
+ virtual sal_Bool Revert() = 0;
virtual BaseStorageStream* OpenStream( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = TRUE, const ByteString* pKey=0 ) = 0;
+ sal_Bool bDirect = sal_True, const ByteString* pKey=0 ) = 0;
virtual BaseStorage* OpenStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE ) = 0;
+ sal_Bool bDirect = sal_False ) = 0;
virtual BaseStorage* OpenUCBStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE ) = 0;
+ sal_Bool bDirect = sal_False ) = 0;
virtual BaseStorage* OpenOLEStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE ) = 0;
- virtual BOOL IsStream( const String& rEleName ) const = 0;
- virtual BOOL IsStorage( const String& rEleName ) const = 0;
- virtual BOOL IsContained( const String& rEleName ) const = 0;
- virtual BOOL Remove( const String & rEleName ) = 0;
- virtual BOOL Rename( const String & rEleName, const String & rNewName ) = 0;
- virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
- virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
- virtual BOOL ValidateFAT() = 0;
- virtual BOOL Equals( const BaseStorage& rStream ) const = 0;
+ sal_Bool bDirect = sal_False ) = 0;
+ virtual sal_Bool IsStream( const String& rEleName ) const = 0;
+ virtual sal_Bool IsStorage( const String& rEleName ) const = 0;
+ virtual sal_Bool IsContained( const String& rEleName ) const = 0;
+ virtual sal_Bool Remove( const String & rEleName ) = 0;
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName ) = 0;
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName ) = 0;
+ virtual sal_Bool ValidateFAT() = 0;
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const = 0;
};
class OLEStorageBase
@@ -154,8 +154,8 @@ protected:
StgDirEntry* pEntry; // the dir entry
OLEStorageBase( StgIo*, StgDirEntry*, StreamMode& );
~OLEStorageBase();
- BOOL Validate_Impl( BOOL=FALSE ) const;
- BOOL ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ;
+ sal_Bool Validate_Impl( sal_Bool=sal_False ) const;
+ sal_Bool ValidateMode_Impl( StreamMode, StgDirEntry* p = NULL ) const ;
const SvStream* GetSvStream_Impl() const;
public:
};
@@ -163,26 +163,26 @@ public:
class StorageStream : public BaseStorageStream, public OLEStorageBase
{
//friend class Storage;
- ULONG nPos; // current position
+ sal_uLong nPos; // current position
protected:
~StorageStream();
public:
TYPEINFO();
StorageStream( StgIo*, StgDirEntry*, StreamMode );
- virtual ULONG Read( void * pData, ULONG nSize );
- virtual ULONG Write( const void* pData, ULONG nSize );
- virtual ULONG Seek( ULONG nPos );
- virtual ULONG Tell() { return nPos; }
+ virtual sal_uLong Read( void * pData, sal_uLong nSize );
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize );
+ virtual sal_uLong Seek( sal_uLong nPos );
+ virtual sal_uLong Tell() { return nPos; }
virtual void Flush();
- virtual BOOL SetSize( ULONG nNewSize );
- virtual BOOL CopyTo( BaseStorageStream * pDestStm );
- virtual BOOL Commit();
- virtual BOOL Revert();
- virtual BOOL Validate( BOOL=FALSE ) const;
- virtual BOOL ValidateMode( StreamMode ) const;
- BOOL ValidateMode( StreamMode, StgDirEntry* p ) const;
+ virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const;
const SvStream* GetSvStream() const;
- virtual BOOL Equals( const BaseStorageStream& rStream ) const;
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
};
class UCBStorageStream;
@@ -190,64 +190,64 @@ class UCBStorageStream;
class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase
{
String aName;
- BOOL bIsRoot;
- void Init( BOOL bCreate );
+ sal_Bool bIsRoot;
+ void Init( sal_Bool bCreate );
Storage( StgIo*, StgDirEntry*, StreamMode );
protected:
~Storage();
public:
TYPEINFO();
- Storage( const String &, StreamMode = STREAM_STD_READWRITE, BOOL bDirect = TRUE );
- Storage( SvStream& rStrm, BOOL bDirect = TRUE );
- Storage( UCBStorageStream& rStrm, BOOL bDirect = TRUE );
+ Storage( const String &, StreamMode = STREAM_STD_READWRITE, sal_Bool bDirect = sal_True );
+ Storage( SvStream& rStrm, sal_Bool bDirect = sal_True );
+ Storage( UCBStorageStream& rStrm, sal_Bool bDirect = sal_True );
- static BOOL IsStorageFile( const String & rFileName );
- static BOOL IsStorageFile( SvStream* );
+ static sal_Bool IsStorageFile( const String & rFileName );
+ static sal_Bool IsStorageFile( SvStream* );
virtual const String& GetName() const;
- virtual BOOL IsRoot() const { return bIsRoot; }
+ virtual sal_Bool IsRoot() const { return bIsRoot; }
virtual void SetClassId( const ClsId& );
virtual const ClsId& GetClassId() const;
virtual void SetDirty();
virtual void SetClass( const SvGlobalName & rClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName );
virtual void SetConvertClass( const SvGlobalName & rConvertClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName );
virtual SvGlobalName GetClassName();
- virtual ULONG GetFormat();
+ virtual sal_uLong GetFormat();
virtual String GetUserName();
- virtual BOOL ShouldConvert();
+ virtual sal_Bool ShouldConvert();
virtual void FillInfoList( SvStorageInfoList* ) const;
- virtual BOOL CopyTo( BaseStorage* pDestStg ) const;
- virtual BOOL Commit();
- virtual BOOL Revert();
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const;
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
virtual BaseStorageStream* OpenStream( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = TRUE, const ByteString* pKey=0 );
+ sal_Bool bDirect = sal_True, const ByteString* pKey=0 );
virtual BaseStorage* OpenStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
+ sal_Bool bDirect = sal_False );
virtual BaseStorage* OpenUCBStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
+ sal_Bool bDirect = sal_False );
virtual BaseStorage* OpenOLEStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
- virtual BOOL IsStream( const String& rEleName ) const;
- virtual BOOL IsStorage( const String& rEleName ) const;
- virtual BOOL IsContained( const String& rEleName ) const;
- virtual BOOL Remove( const String & rEleName );
- virtual BOOL Rename( const String & rEleName, const String & rNewName );
- virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
- virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
- virtual BOOL ValidateFAT();
- virtual BOOL Validate( BOOL=FALSE ) const;
- virtual BOOL ValidateMode( StreamMode ) const;
- BOOL ValidateMode( StreamMode, StgDirEntry* p ) const;
+ sal_Bool bDirect = sal_False );
+ virtual sal_Bool IsStream( const String& rEleName ) const;
+ virtual sal_Bool IsStorage( const String& rEleName ) const;
+ virtual sal_Bool IsContained( const String& rEleName ) const;
+ virtual sal_Bool Remove( const String & rEleName );
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName );
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool ValidateFAT();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
+ sal_Bool ValidateMode( StreamMode, StgDirEntry* p ) const;
virtual const SvStream* GetSvStream() const;
- virtual BOOL Equals( const BaseStorage& rStream ) const;
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const;
};
class UCBStorageStream_Impl;
@@ -261,25 +261,25 @@ protected:
~UCBStorageStream();
public:
TYPEINFO();
- UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey=0 );
- UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
+ UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 );
+ UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
UCBStorageStream( UCBStorageStream_Impl* );
- virtual ULONG Read( void * pData, ULONG nSize );
- virtual ULONG Write( const void* pData, ULONG nSize );
- virtual ULONG Seek( ULONG nPos );
- virtual ULONG Tell();
+ virtual sal_uLong Read( void * pData, sal_uLong nSize );
+ virtual sal_uLong Write( const void* pData, sal_uLong nSize );
+ virtual sal_uLong Seek( sal_uLong nPos );
+ virtual sal_uLong Tell();
virtual void Flush();
- virtual BOOL SetSize( ULONG nNewSize );
- virtual BOOL CopyTo( BaseStorageStream * pDestStm );
- virtual BOOL Commit();
- virtual BOOL Revert();
- virtual BOOL Validate( BOOL=FALSE ) const;
- virtual BOOL ValidateMode( StreamMode ) const;
+ virtual sal_Bool SetSize( sal_uLong nNewSize );
+ virtual sal_Bool CopyTo( BaseStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
const SvStream* GetSvStream() const;
- virtual BOOL Equals( const BaseStorageStream& rStream ) const;
- BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ virtual sal_Bool Equals( const BaseStorageStream& rStream ) const;
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
SvStream* GetModifySvStream();
@@ -300,76 +300,76 @@ class SOT_DLLPUBLIC UCBStorage : public BaseStorage
protected:
~UCBStorage();
public:
- static BOOL IsStorageFile( SvStream* );
- static BOOL IsStorageFile( const String& rName );
- static BOOL IsDiskSpannedFile( SvStream* );
+ static sal_Bool IsStorageFile( SvStream* );
+ static sal_Bool IsStorageFile( const String& rName );
+ static sal_Bool IsDiskSpannedFile( SvStream* );
static String GetLinkedFile( SvStream& );
static String CreateLinkFile( const String& rName );
- UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect = TRUE, BOOL bIsRoot = TRUE );
+ UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect = sal_True, sal_Bool bIsRoot = sal_True );
UCBStorage( const String& rName,
StreamMode nMode,
- BOOL bDirect = TRUE,
- BOOL bIsRoot = TRUE );
+ sal_Bool bDirect = sal_True,
+ sal_Bool bIsRoot = sal_True );
UCBStorage( const String& rName,
StreamMode nMode,
- BOOL bDirect,
- BOOL bIsRoot,
- BOOL bIsRepair,
+ sal_Bool bDirect,
+ sal_Bool bIsRoot,
+ sal_Bool bIsRepair,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler >
xProgressHandler );
UCBStorage( UCBStorage_Impl* );
- UCBStorage( SvStream& rStrm, BOOL bDirect = TRUE );
+ UCBStorage( SvStream& rStrm, sal_Bool bDirect = sal_True );
TYPEINFO();
virtual const String& GetName() const;
- virtual BOOL IsRoot() const;
+ virtual sal_Bool IsRoot() const;
virtual void SetClassId( const ClsId& );
virtual const ClsId& GetClassId() const;
virtual void SetDirty();
virtual void SetClass( const SvGlobalName & rClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName );
virtual void SetConvertClass( const SvGlobalName & rConvertClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName );
virtual SvGlobalName GetClassName();
- virtual ULONG GetFormat();
+ virtual sal_uLong GetFormat();
virtual String GetUserName();
- virtual BOOL ShouldConvert();
+ virtual sal_Bool ShouldConvert();
virtual void FillInfoList( SvStorageInfoList* ) const;
- virtual BOOL CopyTo( BaseStorage* pDestStg ) const;
- virtual BOOL Commit();
- virtual BOOL Revert();
+ virtual sal_Bool CopyTo( BaseStorage* pDestStg ) const;
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
virtual BaseStorageStream* OpenStream( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = TRUE, const ByteString* pKey=0 );
+ sal_Bool bDirect = sal_True, const ByteString* pKey=0 );
virtual BaseStorage* OpenStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
+ sal_Bool bDirect = sal_False );
virtual BaseStorage* OpenUCBStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
+ sal_Bool bDirect = sal_False );
virtual BaseStorage* OpenOLEStorage( const String & rEleName,
StreamMode = STREAM_STD_READWRITE,
- BOOL bDirect = FALSE );
- virtual BOOL IsStream( const String& rEleName ) const;
- virtual BOOL IsStorage( const String& rEleName ) const;
- virtual BOOL IsContained( const String& rEleName ) const;
- virtual BOOL Remove( const String & rEleName );
- virtual BOOL Rename( const String & rEleName, const String & rNewName );
- virtual BOOL CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
- virtual BOOL MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
- virtual BOOL ValidateFAT();
- virtual BOOL Validate( BOOL=FALSE ) const;
- virtual BOOL ValidateMode( StreamMode ) const;
+ sal_Bool bDirect = sal_False );
+ virtual sal_Bool IsStream( const String& rEleName ) const;
+ virtual sal_Bool IsStorage( const String& rEleName ) const;
+ virtual sal_Bool IsContained( const String& rEleName ) const;
+ virtual sal_Bool Remove( const String & rEleName );
+ virtual sal_Bool Rename( const String & rEleName, const String & rNewName );
+ virtual sal_Bool CopyTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool MoveTo( const String & rEleName, BaseStorage * pDest, const String & rNewName );
+ virtual sal_Bool ValidateFAT();
+ virtual sal_Bool Validate( sal_Bool=sal_False ) const;
+ virtual sal_Bool ValidateMode( StreamMode ) const;
virtual const SvStream* GetSvStream() const;
- virtual BOOL Equals( const BaseStorage& rStream ) const;
- BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
+ virtual sal_Bool Equals( const BaseStorage& rStream ) const;
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
// HACK to avoid incompatible build, can be done since this feature is only for development
// should be removed before release
@@ -377,10 +377,10 @@ public:
//#if _SOLAR__PRIVATE
UCBStorageElement_Impl* FindElement_Impl( const String& rName ) const;
- BOOL CopyStorageElement_Impl( UCBStorageElement_Impl& rElement,
+ sal_Bool CopyStorageElement_Impl( UCBStorageElement_Impl& rElement,
BaseStorage* pDest, const String& rNew ) const;
BaseStorage* OpenStorage_Impl( const String & rEleName,
- StreamMode, BOOL bDirect, BOOL bForceUCBStorage );
+ StreamMode, sal_Bool bDirect, sal_Bool bForceUCBStorage );
//#endif
};
diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx
index 893837abac88..1e78865a3ef0 100644
--- a/sot/inc/sot/storage.hxx
+++ b/sot/inc/sot/storage.hxx
@@ -66,9 +66,9 @@ friend class SotStorage;
friend class ImpStream;
BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream
protected:
- virtual ULONG GetData( void* pData, ULONG nSize );
- virtual ULONG PutData( const void* pData, ULONG nSize );
- virtual ULONG SeekPos( ULONG nPos );
+ virtual sal_uLong GetData( void* pData, sal_uLong nSize );
+ virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
+ virtual sal_uLong SeekPos( sal_uLong nPos );
virtual void FlushData();
~SotStorageStream();
public:
@@ -86,13 +86,13 @@ public:
virtual void ResetError();
- virtual void SetSize( ULONG nNewSize );
- UINT32 GetSize() const;
- BOOL CopyTo( SotStorageStream * pDestStm );
- virtual BOOL Commit();
- virtual BOOL Revert();
- BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ virtual void SetSize( sal_uLong nNewSize );
+ sal_uInt32 GetSize() const;
+ sal_Bool CopyTo( SotStorageStream * pDestStm );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
GetXInputStream() const;
};
@@ -120,21 +120,21 @@ friend class ::binfilter::SvStorage;
BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ???
BaseStorage * m_pOwnStg; // Zielstorage
SvStream * m_pStorStm; // nur fuer SDSTORAGES
- ULONG m_nError;
+ sal_uLong m_nError;
String m_aName; // Name des Storage
- BOOL m_bIsRoot:1, // z.B.: File-Storage
+ sal_Bool m_bIsRoot:1, // z.B.: File-Storage
m_bDelStm:1;
ByteString m_aKey; // aKey.Len != 0 -> Verschluesselung
long m_nVersion;
protected:
~SotStorage();
- void CreateStorage( BOOL bUCBStorage, StreamMode, StorageMode );
+ void CreateStorage( sal_Bool bUCBStorage, StreamMode, StorageMode );
public:
SotStorage( const String &,
StreamMode = STREAM_STD_READWRITE,
StorageMode = 0 );
- SotStorage( BOOL bUCBStorage, const String &,
+ SotStorage( sal_Bool bUCBStorage, const String &,
StreamMode = STREAM_STD_READWRITE,
StorageMode = 0 );
SotStorage( const ::ucbhelper::Content& rContent, const String &,
@@ -142,8 +142,8 @@ public:
StorageMode = 0 );
SotStorage( BaseStorage * );
SotStorage( SvStream & rStm );
- SotStorage( BOOL bUCBStorage, SvStream & rStm );
- SotStorage( SvStream * pStm, BOOL bDelete );
+ SotStorage( sal_Bool bUCBStorage, SvStream & rStm );
+ SotStorage( SvStream * pStm, sal_Bool bDelete );
SotStorage();
SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA())
SO2_DECL_INVARIANT()
@@ -151,12 +151,12 @@ public:
SvMemoryStream * CreateMemoryStream();
const SvStream * GetSvStream();
- static BOOL IsStorageFile( const String & rFileName );
- static BOOL IsStorageFile( SvStream* pStream );
+ static sal_Bool IsStorageFile( const String & rFileName );
+ static sal_Bool IsStorageFile( SvStream* pStream );
virtual const String & GetName() const;
- virtual BOOL Validate();
+ virtual sal_Bool Validate();
void SetKey( const ByteString& rKey );
const ByteString & GetKey() const { return m_aKey; }
@@ -170,37 +170,37 @@ public:
return m_nVersion;
}
- ULONG GetErrorCode() const { return m_nError; }
- ULONG GetError() const { return ERRCODE_TOERROR(m_nError); }
- void SetError( ULONG nErrorCode )
+ sal_uLong GetErrorCode() const { return m_nError; }
+ sal_uLong GetError() const { return ERRCODE_TOERROR(m_nError); }
+ void SetError( sal_uLong nErrorCode )
{
if( m_nError == SVSTREAM_OK )
m_nError = nErrorCode;
}
virtual void ResetError();
- BOOL IsRoot() const { return m_bIsRoot; }
- void SignAsRoot( BOOL b = TRUE ) { m_bIsRoot = b; }
- void SetDeleteStream( BOOL bDelete ) { m_bDelStm = bDelete; }
+ sal_Bool IsRoot() const { return m_bIsRoot; }
+ void SignAsRoot( sal_Bool b = sal_True ) { m_bIsRoot = b; }
+ void SetDeleteStream( sal_Bool bDelete ) { m_bDelStm = bDelete; }
// eigener Datenbereich
virtual void SetClass( const SvGlobalName & rClass,
- ULONG bOriginalClipFormat,
+ sal_uLong bOriginalClipFormat,
const String & rUserTypeName );
virtual void SetConvertClass( const SvGlobalName & rConvertClass,
- ULONG bOriginalClipFormat,
+ sal_uLong bOriginalClipFormat,
const String & rUserTypeName );
virtual SvGlobalName GetClassName();// Typ der Daten im Storage
- virtual ULONG GetFormat();
+ virtual sal_uLong GetFormat();
virtual String GetUserName();
- virtual BOOL ShouldConvert();
+ virtual sal_Bool ShouldConvert();
void SetName( const String& rName );
// Liste aller Elemente
virtual void FillInfoList( SvStorageInfoList * ) const;
- virtual BOOL CopyTo( SotStorage * pDestStg );
- virtual BOOL Commit();
- virtual BOOL Revert();
+ virtual sal_Bool CopyTo( SotStorage * pDestStg );
+ virtual sal_Bool Commit();
+ virtual sal_Bool Revert();
/* Element Methoden */
// Stream mit Verbindung zu Storage erzeugen,
@@ -221,26 +221,26 @@ public:
StreamMode = STREAM_STD_READWRITE,
StorageMode = STORAGE_TRANSACTED );
// Abfrage auf Storage oder Stream
- virtual BOOL IsStream( const String & rEleName ) const;
- virtual BOOL IsStorage( const String & rEleName ) const;
- virtual BOOL IsContained( const String & rEleName ) const;
+ virtual sal_Bool IsStream( const String & rEleName ) const;
+ virtual sal_Bool IsStorage( const String & rEleName ) const;
+ virtual sal_Bool IsContained( const String & rEleName ) const;
// Element loeschen
- virtual BOOL Remove( const String & rEleName );
+ virtual sal_Bool Remove( const String & rEleName );
// Elementnamen aendern
- virtual BOOL Rename( const String & rEleName,
+ virtual sal_Bool Rename( const String & rEleName,
const String & rNewName );
- virtual BOOL CopyTo( const String & rEleName, SotStorage * pDest,
+ virtual sal_Bool CopyTo( const String & rEleName, SotStorage * pDest,
const String & rNewName );
- virtual BOOL MoveTo( const String & rEleName, SotStorage * pDest,
+ virtual sal_Bool MoveTo( const String & rEleName, SotStorage * pDest,
const String & rNewName );
SvStream* GetTargetSvStream() const;
- BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
- BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
- BOOL IsOLEStorage() const;
- static BOOL IsOLEStorage( const String & rFileName );
- static BOOL IsOLEStorage( SvStream* pStream );
+ sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ sal_Bool GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
+ sal_Bool IsOLEStorage() const;
+ static sal_Bool IsOLEStorage( const String & rFileName );
+ static sal_Bool IsOLEStorage( SvStream* pStream );
// this is temporary HACK, _MUST_ be removed before release
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
diff --git a/sot/inc/storinfo.hxx b/sot/inc/sot/storinfo.hxx
index af3c0ca15b95..0d7c73d3717c 100644
--- a/sot/inc/storinfo.hxx
+++ b/sot/inc/sot/storinfo.hxx
@@ -40,14 +40,14 @@ class SvStorageInfo
friend class SvStorage;
String aName;
SvGlobalName aClassName;
- ULONG nSize;
- BOOL bStream:1,
+ sal_uLong nSize;
+ sal_Bool bStream:1,
bStorage:1;
SvStorageInfo(){}; // Fuer SvStorage
public:
SvStorageInfo( const StgDirEntry& );
- SvStorageInfo( const String& rName, ULONG nSz, BOOL bIsStorage )
+ SvStorageInfo( const String& rName, sal_uLong nSz, sal_Bool bIsStorage )
: aName( rName )
, nSize( nSz )
, bStream( !bIsStorage )
@@ -56,9 +56,9 @@ public:
const SvGlobalName & GetClassName() const { return aClassName; }
const String & GetName() const { return aName; }
- BOOL IsStream() const { return bStream; }
- BOOL IsStorage() const { return bStorage; }
- ULONG GetSize() const { return nSize; }
+ sal_Bool IsStream() const { return bStream; }
+ sal_Bool IsStorage() const { return bStorage; }
+ sal_uLong GetSize() const { return nSize; }
};
class SOT_DLLPUBLIC SvStorageInfoList
@@ -67,8 +67,8 @@ class SOT_DLLPUBLIC SvStorageInfoList
const SvStorageInfo * Get( const String & rName );
};
-SOT_DLLPUBLIC ULONG ReadClipboardFormat( SvStream & rStm );
-SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, ULONG nFormat );
+SOT_DLLPUBLIC sal_uLong ReadClipboardFormat( SvStream & rStm );
+SOT_DLLPUBLIC void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat );
#endif // _STORINFO_HXX
diff --git a/sot/prj/build.lst b/sot/prj/build.lst
index f2696155fd97..63f7a94cf054 100644..100755
--- a/sot/prj/build.lst
+++ b/sot/prj/build.lst
@@ -1,8 +1,2 @@
to sot : tools ucbhelper unotools NULL
-to sot usr1 - all sot_mkout NULL
-to sot\inc nmake - all sot_inc NULL
-to sot\prj get - all sot_prj NULL
-to sot\source\base nmake - all sot_base sot_inc NULL
-to sot\source\sdstor nmake - all sot_sdst sot_inc NULL
-to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL
-to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL
+to sot\prj nmake - all sot_prj NULL
diff --git a/sot/prj/d.lst b/sot/prj/d.lst
index 528b6863ef3c..e69de29bb2d1 100644
--- a/sot/prj/d.lst
+++ b/sot/prj/d.lst
@@ -1,27 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\sot
-..\inc\clsids.hxx %_DEST%\inc%_EXT%\sot\clsids.hxx
-..\inc\sot\object.hxx %_DEST%\inc%_EXT%\sot\object.hxx
-..\inc\sot\factory.hxx %_DEST%\inc%_EXT%\sot\factory.hxx
-..\inc\sot\sotdata.hxx %_DEST%\inc%_EXT%\sot\sotdata.hxx
-..\inc\agg.hxx %_DEST%\inc%_EXT%\sot\agg.hxx
-..\inc\sot\storage.hxx %_DEST%\inc%_EXT%\sot\storage.hxx
-..\inc\storinfo.hxx %_DEST%\inc%_EXT%\sot\storinfo.hxx
-..\inc\sot\sotref.hxx %_DEST%\inc%_EXT%\sot\sotref.hxx
-..\inc\sot\exchange.hxx %_DEST%\inc%_EXT%\sot\exchange.hxx
-..\inc\sot\formats.hxx %_DEST%\inc%_EXT%\sot\formats.hxx
-..\inc\absdev.hxx %_DEST%\inc%_EXT%\sot\absdev.hxx
-..\inc\stg.hxx %_DEST%\inc%_EXT%\sot\stg.hxx
-..\inc\filelist.hxx %_DEST%\inc%_EXT%\sot\filelist.hxx
-..\inc\sot\sotdllapi.h %_DEST%\inc%_EXT%\sot\sotdllapi.h
-
-..\%__SRC%\inc\sdintern.hxx %_DEST%\inc%_EXT%\sot\sdintern.hxx
-..\%__SRC%\lib\sot.lib %_DEST%\lib%_EXT%\sot.lib
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
-..\%__SRC%\lib\lib*.so.* %_DEST%\lib%_EXT%
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl
-..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
-..\%__SRC%\slb\sot.lib %_DEST%\lib%_EXT%\xsot.lib
-..\%__SRC%\bin\sot?????.dll %_DEST%\bin%_EXT%\sot?????.dll
-..\%__SRC%\bin\sot?????.sym %_DEST%\bin%_EXT%\sot?????.sym
-..\%__SRC%\misc\sot?????.map %_DEST%\bin%_EXT%\sot?????.map
diff --git a/svtools/util/svt.pmk b/sot/prj/makefile.mk
index 24d898f030c1..e312a7ccab65 100644
--- a/svtools/util/svt.pmk
+++ b/sot/prj/makefile.mk
@@ -25,7 +25,16 @@
#
#*************************************************************************
-# define SVT_DLLIMPLEMENTATION (see @ svtdllapi.h)
-CDEFS += -DSVT_DLLIMPLEMENTATION
+PRJ=..
+TARGET=prj
-VISIBILITY_HIDDEN=TRUE
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
index 054480d377d1..2824b0fcbffa 100644
--- a/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
+++ b/sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
@@ -26,42 +26,85 @@
************************************************************************/
package complex.olesimplestorage;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
+
+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.*;
+
/* Document.
*/
-public class OLESimpleStorageUnitTest extends ComplexTestCase {
+public class OLESimpleStorageUnitTest /* extends ComplexTestCase */
+{
private XMultiServiceFactory m_xMSF = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01"};
- }
-
- public String getTestObjectName() {
- return "OLESimpleStorageUnitTest";
- }
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01"};
+// }
+//
+// public String getTestObjectName() {
+// return "OLESimpleStorageUnitTest";
+// }
- public void before () {
+ @Before public void before () {
+ System.out.println("before()");
try {
- m_xMSF = (XMultiServiceFactory)param.getMSF();
+ m_xMSF = getMSF();
} catch ( Exception e ){
- failed ( "Cannot create service factory!" );
+ fail( "Cannot create service factory!" );
}
if ( m_xMSF == null ) {
- failed ( "Cannot create service factory!" );
+ fail( "Cannot create service factory!" );
}
}
- public void after () {
+ @After public void after () {
+ System.out.println("after()");
m_xMSF = null;
}
- public void ExecuteTest01() {
- OLESimpleStorageTest aTest = new Test01( m_xMSF, log );
- assure( "Test01 failed!", aTest.test() );
+ @Test public void ExecuteTest01() {
+ System.out.println("ExecuteTest01()");
+ OLESimpleStorageTest aTest = new Test01( m_xMSF );
+ assertTrue( "Test01 failed!", aTest.test() );
}
+
+
+
+ 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
+ {
+// try
+// {
+// Thread.sleep(5000);
+// }
+// catch (java.lang.InterruptedException e)
+// {
+// }
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
} \ No newline at end of file
diff --git a/sot/qa/complex/olesimplestorage/Test01.java b/sot/qa/complex/olesimplestorage/Test01.java
index c9010e61231a..ad32e6e55a6b 100644
--- a/sot/qa/complex/olesimplestorage/Test01.java
+++ b/sot/qa/complex/olesimplestorage/Test01.java
@@ -1,6 +1,6 @@
package complex.olesimplestorage;
-import complexlib.ComplexTestCase;
+
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.io.XInputStream;
@@ -10,7 +10,7 @@ import com.sun.star.embed.XOLESimpleStorage;
import com.sun.star.uno.UnoRuntime;
import java.util.Random;
-import share.LogWriter;
+
public class Test01 implements OLESimpleStorageTest
{
@@ -19,10 +19,10 @@ public class Test01 implements OLESimpleStorageTest
final int pStreamCnt = 5;
final int pBytesCnt = 10;
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test01 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper ("Test01: ");
}
public boolean test ()
@@ -31,7 +31,7 @@ public class Test01 implements OLESimpleStorageTest
{
//create a new temporary stream
Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
- XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oTempFile );
+ XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message ( "A new temporary stream created." );
//create OLESimpleStorage based on it
@@ -39,7 +39,7 @@ public class Test01 implements OLESimpleStorageTest
pArgs[0] = (Object) xTempFile;
pArgs[1] = new Boolean( true );
Object oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs );
- XOLESimpleStorage xOLESimpleStorage = (XOLESimpleStorage) UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage );
+ XOLESimpleStorage xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage);
m_aTestHelper.Message ( "OLESimpleStorage based on XStream created." );
//fill it with some streams
@@ -53,7 +53,7 @@ public class Test01 implements OLESimpleStorageTest
{
oRandom.nextBytes (pBytesOut[i]);
oStream[i] = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
- xTempStream[i] = (XTempFile) UnoRuntime.queryInterface ( XTempFile.class, oStream[i] );
+ xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, oStream[i]);
xTempStream[i].getOutputStream ().writeBytes (pBytesOut[i]);
xTempStream[i].seek (0);
m_aTestHelper.Message ( "Substream " + i + " initialized." );
@@ -83,7 +83,7 @@ public class Test01 implements OLESimpleStorageTest
//open the same stream with the constructor for inputstream
pArgs[0] = (Object)xTempFile.getInputStream ();
oOLESimpleStorage = m_xMSF.createInstanceWithArguments ( "com.sun.star.embed.OLESimpleStorage", pArgs );
- xOLESimpleStorage = (XOLESimpleStorage)UnoRuntime.queryInterface ( XOLESimpleStorage.class, oOLESimpleStorage );
+ xOLESimpleStorage = UnoRuntime.queryInterface(XOLESimpleStorage.class, oOLESimpleStorage);
m_aTestHelper.Message ( "Storage reopened, based on XInputStream." );
//check that all the streams contain correct information
@@ -92,8 +92,7 @@ public class Test01 implements OLESimpleStorageTest
{
if ( xOLESimpleStorage.hasByName (sSubStreamPrefix + i) )
{
- xTempStream[i] = (XTempFile)UnoRuntime.queryInterface (
- XTempFile.class, xOLESimpleStorage.getByName (sSubStreamPrefix + i) );
+ xTempStream[i] = UnoRuntime.queryInterface(XTempFile.class, xOLESimpleStorage.getByName(sSubStreamPrefix + i));
xTempStream[i].seek (0);
xTempStream[i].getInputStream ().readBytes (pBytesIn[i], pBytesIn[i][0].length + 1 );
for ( int j = 0; j < pBytesCnt; ++j )
@@ -120,6 +119,7 @@ public class Test01 implements OLESimpleStorageTest
catch ( Exception e )
{
m_aTestHelper.Error ( "Exception: " + e );
+ return false;
}
return true;
}
diff --git a/sot/qa/complex/olesimplestorage/TestHelper.java b/sot/qa/complex/olesimplestorage/TestHelper.java
index 4b29ed15e393..e9e14f8d68c0 100644
--- a/sot/qa/complex/olesimplestorage/TestHelper.java
+++ b/sot/qa/complex/olesimplestorage/TestHelper.java
@@ -1,26 +1,27 @@
package complex.olesimplestorage;
-import share.LogWriter;
public class TestHelper
{
- LogWriter m_aLogWriter;
+
String m_sTestPrefix;
- /** Creates a new instance of TestHelper */
- public TestHelper ( LogWriter aLogWriter, String sTestPrefix )
+ /** Creates a new instance of TestHelper
+ * @param sTestPrefix
+ */
+ public TestHelper ( String sTestPrefix )
{
- m_aLogWriter = aLogWriter;
+
m_sTestPrefix = sTestPrefix;
}
public void Error ( String sError )
{
- m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError );
+ System.out.println ( m_sTestPrefix + "Error: " + sError );
}
public void Message ( String sMessage )
{
- m_aLogWriter.println ( m_sTestPrefix + sMessage );
+ System.out.println ( m_sTestPrefix + sMessage );
}
}
diff --git a/sot/qa/complex/olesimplestorage/makefile.mk b/sot/qa/complex/olesimplestorage/makefile.mk
deleted file mode 100644
index 3420d798c9bc..000000000000
--- a/sot/qa/complex/olesimplestorage/makefile.mk
+++ /dev/null
@@ -1,84 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..$/..
-TARGET = OLESimpleStorageUnitTest
-PRJNAME = sot
-PACKAGE = complex$/olesimplestorage
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- OLESimpleStorageUnitTest.java\
- OLESimpleStorageTest.java\
- TestHelper.java\
- Test01.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- 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
-
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
-
-# start the runner application
-CT_APP = org.openoffice.Runner
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE: target.mk
-
-RUN: run
-
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
-
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 2524e0c9b30a..04a0f22cf29d 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -39,7 +39,7 @@
#include <sot/sotdata.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
-#include <clsids.hxx>
+#include <sot/clsids.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
@@ -239,11 +239,11 @@ static List& InitFormats_Impl()
|*
|* Beschreibung CLIP.SDW
*************************************************************************/
-ULONG SotExchange::RegisterFormatName( const String& rName )
+sal_uLong SotExchange::RegisterFormatName( const String& rName )
{
const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
// teste zuerst die Standard - Name
- ULONG i, nMax = SOT_FORMAT_FILE_LIST;
+ sal_uLong i, nMax = SOT_FORMAT_FILE_LIST;
for( i = SOT_FORMAT_STRING; i <= nMax; ++i )
if( COMPARE_EQUAL == rName.CompareToAscii( pFormatArray_Impl[ i ].pName ) )
return i;
@@ -279,11 +279,11 @@ ULONG SotExchange::RegisterFormatName( const String& rName )
return nMax + SOT_FORMATSTR_ID_USER_END + 1;
}
-ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType )
+sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType )
{
const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
// teste zuerst die Standard - Name
- ULONG i, nMax = SOT_FORMAT_FILE_LIST;
+ sal_uLong i, nMax = SOT_FORMAT_FILE_LIST;
for( i = SOT_FORMAT_STRING; i <= nMax; ++i )
if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) )
return i;
@@ -320,9 +320,9 @@ ULONG SotExchange::RegisterFormatMimeType( const String& rMimeType )
|*
|* Beschreibung CLIP.SDW
*************************************************************************/
-ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor )
+sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor )
{
- ULONG nRet = GetFormat( rFlavor );
+ sal_uLong nRet = GetFormat( rFlavor );
if( !nRet )
{
@@ -340,7 +340,7 @@ ULONG SotExchange::RegisterFormat( const DataFlavor& rFlavor )
|*
*************************************************************************/
-sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor )
+sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavor )
{
sal_Bool bRet;
@@ -378,11 +378,11 @@ sal_Bool SotExchange::GetFormatDataFlavor( ULONG nFormat, DataFlavor& rFlavor )
/*************************************************************************
|*
-|* SotExchange::GetFormatMimeType( ULONG nFormat )
+|* SotExchange::GetFormatMimeType( sal_uLong nFormat )
|*
*************************************************************************/
-String SotExchange::GetFormatMimeType( ULONG nFormat )
+String SotExchange::GetFormatMimeType( sal_uLong nFormat )
{
String sMimeType;
if( SOT_FORMATSTR_ID_USER_END >= nFormat )
@@ -408,10 +408,10 @@ String SotExchange::GetFormatMimeType( ULONG nFormat )
|*
*************************************************************************/
-ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
+sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
{
const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
- ULONG i, nMax = SOT_FORMAT_FILE_LIST;
+ sal_uLong i, nMax = SOT_FORMAT_FILE_LIST;
for( i = SOT_FORMAT_STRING; i <= nMax; ++i )
if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) )
return i;
@@ -445,12 +445,12 @@ ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
|*
|* Beschreibung CLIP.SDW
*************************************************************************/
-ULONG SotExchange::GetFormat( const DataFlavor& rFlavor )
+sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor )
{
// teste zuerst die Standard - Name
const ::rtl::OUString& rMimeType = rFlavor.MimeType;
const String aMimeType( rMimeType );
- ULONG i, nMax = SOT_FORMAT_FILE_LIST;
+ sal_uLong i, nMax = SOT_FORMAT_FILE_LIST;
const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
for( i = SOT_FORMAT_STRING; i <= nMax; ++i )
if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) )
@@ -484,7 +484,7 @@ ULONG SotExchange::GetFormat( const DataFlavor& rFlavor )
|*
|* Beschreibung CLIP.SDW
*************************************************************************/
-String SotExchange::GetFormatName( ULONG nFormat )
+String SotExchange::GetFormatName( sal_uLong nFormat )
{
DataFlavor aFlavor;
String aRet;
@@ -495,7 +495,7 @@ String SotExchange::GetFormatName( ULONG nFormat )
return aRet;
}
-BOOL SotExchange::IsInternal( const SvGlobalName& rName )
+sal_Bool SotExchange::IsInternal( const SvGlobalName& rName )
{
if ( rName == SvGlobalName(SO3_SW_CLASSID_60) ||
rName == SvGlobalName(SO3_SC_CLASSID_60) ||
@@ -505,8 +505,8 @@ BOOL SotExchange::IsInternal( const SvGlobalName& rName )
rName == SvGlobalName(SO3_SM_CLASSID_60) ||
rName == SvGlobalName(SO3_SWWEB_CLASSID_60) ||
rName == SvGlobalName(SO3_SWGLOB_CLASSID_60) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index b510a0618137..904c6a7f90f8 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -37,7 +37,7 @@
#include <tools/string.hxx>
#include <sot/object.hxx>
#include <sot/sotdata.hxx>
-#include <clsids.hxx>
+#include <sot/clsids.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
@@ -104,7 +104,7 @@ void SotFactory::DeInit()
if( pSotData->pDataFlavorList )
{
- for( ULONG i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ )
+ for( sal_uLong i = 0, nMax = pSotData->pDataFlavorList->Count(); i < nMax; i++ )
delete (::com::sun::star::datatransfer::DataFlavor*) pSotData->pDataFlavorList->GetObject( i );
delete pSotData->pDataFlavorList;
pSotData->pDataFlavorList = NULL;
@@ -160,7 +160,7 @@ SotFactory::~SotFactory()
|*
|* Beschreibung Zugriffsmethoden auf SotData_Impl-Daten
*************************************************************************/
-UINT32 SotFactory::GetSvObjectCount()
+sal_uInt32 SotFactory::GetSvObjectCount()
{
return SOTDATA()->nSvObjCount;
}
@@ -259,10 +259,10 @@ void SotFactory::TestInvariant()
SotData_Impl * pSotData = SOTDATA();
if( pSotData->pObjectList )
{
- ULONG nCount = pSotData->pObjectList->Count();
- for( ULONG i = 0; i < nCount ; i++ )
+ sal_uLong nCount = pSotData->pObjectList->Count();
+ for( sal_uLong i = 0; i < nCount ; i++ )
{
- pSotData->pObjectList->GetObject( i )->TestInvariant( FALSE );
+ pSotData->pObjectList->GetObject( i )->TestInvariant( sal_False );
}
}
#endif
@@ -308,61 +308,22 @@ void * SotFactory::CastAndAddRef
return pObj ? pObj->CastAndAddRef( this ) : NULL;
}
-//=========================================================================
-void * SotFactory::AggCastAndAddRef
-(
- SotObject * pObj /* Das Objekt von dem der Typ gepr"uft wird. */
-) const
-/* [Beschreibung]
-
- Ist eine Optimierung, damit die Ref-Klassen k"urzer implementiert
- werden k"onnen. pObj wird auf den Typ der Factory gecastet.
- In c++ (wenn es immer erlaubt w"are) w"urde der void * wie im
- Beispiel gebildet.
- Factory der Klasse SvPersist.
- void * p = (void *)(SvPersist *)pObj;
- Hinzu kommt noch, dass ein Objekt aus meheren c++ Objekten
- zusammengesetzt sein kann. Diese Methode sucht nach einem
- passenden Objekt.
-
- [R"uckgabewert]
-
- void *, NULL, pObj war NULL oder das Objekt war nicht vom Typ
- der Factory.
- Ansonsten wird pObj zuerst auf den Typ der Factory
- gecastet und dann auf void *.
-
- [Querverweise]
-
- <SvObject::AggCast>
-*/
-{
- void * pRet = NULL;
- if( pObj )
- {
- pRet = pObj->AggCast( this );
- if( pRet )
- pObj->AddRef();
- }
- return pRet;
-}
-
/*************************************************************************
|* SotFactory::Is()
|*
|* Beschreibung
*************************************************************************/
-BOOL SotFactory::Is( const SotFactory * pSuperCl ) const
+sal_Bool SotFactory::Is( const SotFactory * pSuperCl ) const
{
if( this == pSuperCl )
- return TRUE;
+ return sal_True;
- for( USHORT i = 0; i < nSuperCount; i++ )
+ for( sal_uInt16 i = 0; i < nSuperCount; i++ )
{
if( pSuperClasses[ i ]->Is( pSuperCl ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index 771f88b3980e..8ee2a30765c7 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -33,7 +33,7 @@
#include <tools/string.hxx>
#include <tools/rtti.hxx>
#include <sot/exchange.hxx>
-#include <filelist.hxx>
+#include<sot/filelist.hxx>
#include <osl/thread.h>
TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream );
@@ -75,7 +75,7 @@ FileList& FileList::operator=( const FileList& rFileList )
|*
\*************************************************************************/
-ULONG FileList::GetFormat()
+sal_uLong FileList::GetFormat()
{
return FORMAT_FILE_LIST;
}
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index b310bf103647..4bb8800f10e0 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -35,8 +35,8 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
-#include "filelist.hxx"
-#include "clsids.hxx"
+#include "sot/filelist.hxx"
+#include "sot/clsids.hxx"
#include <tools/globname.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
@@ -47,9 +47,9 @@ using namespace::com::sun::star::datatransfer;
struct SotAction_Impl
{
- ULONG nFormatId; // Clipboard Id
- USHORT nAction; // Action Id
- BYTE nContextCheckId; // additional check of content in clipboard
+ sal_uLong nFormatId; // Clipboard Id
+ sal_uInt16 nAction; // Action Id
+ sal_uInt8 nContextCheckId; // additional check of content in clipboard
};
@@ -69,7 +69,7 @@ struct SotAction_Impl
struct SotDestinationEntry_Impl
{
- USHORT nDestination;
+ sal_uInt16 nDestination;
const SotAction_Impl* aDefaultActions;
const SotAction_Impl* aMoveActions;
const SotAction_Impl* aCopyActions;
@@ -1284,7 +1284,7 @@ static SotDestinationEntry_Impl const aDestinationArray[] = \
// - new style GetExchange methods -
// ---------------------------------
-sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG nId )
+sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_uLong nId )
{
DataFlavorExVector::iterator aIter( ( (DataFlavorExVector&) rDataFlavorExVector ).begin() );
DataFlavorExVector::iterator aEnd( ( (DataFlavorExVector&) rDataFlavorExVector ).end() );
@@ -1304,14 +1304,14 @@ sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, ULONG
// -----------------------------------------------------------------------------
-static BOOL CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl&
+static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl&
#ifdef WNT
rEntry
#endif
)
{
DataFlavor aFlavor;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
try
{
@@ -1324,7 +1324,7 @@ rEntry
{
case FILEGRPDSC_ONLY_URL:
{
- bRet = FALSE;
+ bRet = sal_False;
if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFlavor ) &&
(*pxTransferable)->isDataFlavorSupported( aFlavor ) &&
@@ -1368,11 +1368,11 @@ rEntry
// -----------------------------------------------------------------------------
-static USHORT GetTransferableAction_Impl(
+static sal_uInt16 GetTransferableAction_Impl(
const DataFlavorExVector& rDataFlavorExVector,
const SotAction_Impl* pArray,
- ULONG& rFormat,
- ULONG nOnlyTestFormat,
+ sal_uLong& rFormat,
+ sal_uLong nOnlyTestFormat,
const Reference< XTransferable >* pxTransferable )
{
try
@@ -1381,11 +1381,11 @@ static USHORT GetTransferableAction_Impl(
{
DataFlavor aFlavor;
const SotAction_Impl* pArrayStart = pArray;
- ULONG nId = pArray->nFormatId;
+ sal_uLong nId = pArray->nFormatId;
#if OSL_DEBUG_LEVEL > 1
// used for testing a specific format - change in the debugger the value
- static ULONG nChkFormat = 0;
+ static sal_uLong nChkFormat = 0;
if( nChkFormat )
{
for( ; 0xffff != pArray->nFormatId &&
@@ -1455,13 +1455,13 @@ static USHORT GetTransferableAction_Impl(
// -----------------------------------------------------------------------------
-USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector,
- USHORT nDestination,
- USHORT nSourceOptions,
- USHORT nUserAction,
- ULONG& rFormat,
- USHORT& rDefaultAction,
- ULONG nOnlyTestFormat,
+sal_uInt16 SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVector,
+ sal_uInt16 nDestination,
+ sal_uInt16 nSourceOptions,
+ sal_uInt16 nUserAction,
+ sal_uLong& rFormat,
+ sal_uInt16& rDefaultAction,
+ sal_uLong nOnlyTestFormat,
const Reference< XTransferable >* pxTransferable )
{
// hier wird jetzt die oben definierte Tabelle "implementiert"
@@ -1569,11 +1569,11 @@ USHORT SotExchange::GetExchangeAction( const DataFlavorExVector& rDataFlavorExVe
// -----------------------------------------------------------------------------
-USHORT SotExchange::GetExchangeAction(
+sal_uInt16 SotExchange::GetExchangeAction(
const Reference< XTransferable >& rxTransferable,
- USHORT nDestination, USHORT nSourceOptions,
- USHORT nUserAction, ULONG& rFormat,
- USHORT& rDefaultAction, ULONG nOnlyTestFormat )
+ sal_uInt16 nDestination, sal_uInt16 nSourceOptions,
+ sal_uInt16 nUserAction, sal_uLong& rFormat,
+ sal_uInt16& rDefaultAction, sal_uLong nOnlyTestFormat )
{
DataFlavorExVector aVector;
@@ -1626,9 +1626,9 @@ USHORT SotExchange::GetExchangeAction(
nOnlyTestFormat, &rxTransferable ) );
}
-USHORT SotExchange::IsChart( const SvGlobalName& rName )
+sal_uInt16 SotExchange::IsChart( const SvGlobalName& rName )
{
- USHORT nRet=0;
+ sal_uInt16 nRet=0;
// if ( rName == SvGlobalName( SO3_SCH_CLASSID_8 ) )
// nRet = SOFFICE_FILEFORMAT_8;
// else
@@ -1644,9 +1644,9 @@ USHORT SotExchange::IsChart( const SvGlobalName& rName )
return nRet;
}
-USHORT SotExchange::IsMath( const SvGlobalName& rName )
+sal_uInt16 SotExchange::IsMath( const SvGlobalName& rName )
{
- USHORT nRet=0;
+ sal_uInt16 nRet=0;
// if ( rName == SvGlobalName( SO3_SM_CLASSID_8 ) )
// nRet = SOFFICE_FILEFORMAT_8;
// else
diff --git a/sot/source/base/makefile.mk b/sot/source/base/makefile.mk
deleted file mode 100644
index 861b7cc5969b..000000000000
--- a/sot/source/base/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sot
-TARGET=base
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(COM)"=="GCC"
-NOOPTFILES= \
- $(SLO)$/exchange.obj
-.ENDIF # GCC
-
-SLOFILES= \
- $(SLO)$/factory.obj \
- $(SLO)$/object.obj \
- $(SLO)$/exchange.obj \
- $(SLO)$/filelist.obj \
- $(SLO)$/formats.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/formats.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 5bd4af29a45b..d1f4e6331397 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -34,11 +34,7 @@
#include <tools/debug.hxx>
#include <sot/object.hxx>
#include <sot/factory.hxx>
-#include <agg.hxx>
-
-/************** class SvAggregateMemberList *****************************/
-/************************************************************************/
-PRV_SV_IMPL_OWNER_LIST(SvAggregateMemberList,SvAggregate);
+#include <sot/agg.hxx>
/************** class SotObject ******************************************/
class SotObjectFactory : public SotFactory
@@ -64,7 +60,7 @@ SO2_IMPL_INVARIANT(SotObject)
|*
|* Beschreibung:
*************************************************************************/
-void SotObject::TestMemberObjRef( BOOL /*bFree*/ )
+void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ )
{
}
@@ -74,7 +70,7 @@ void SotObject::TestMemberObjRef( BOOL /*bFree*/ )
|* Beschreibung:
*************************************************************************/
#ifdef TEST_INVARIANT
-void SotObject::TestMemberInvariant( BOOL /*bPrint*/ )
+void SotObject::TestMemberInvariant( sal_Bool /*bPrint*/ )
{
}
#endif
@@ -85,12 +81,11 @@ void SotObject::TestMemberInvariant( BOOL /*bPrint*/ )
|* Beschreibung
*************************************************************************/
SotObject::SotObject()
- : pAggList ( NULL )
- , nStrongLockCount( 0 )
+ : nStrongLockCount( 0 )
, nOwnerLockCount( 0 )
- , bOwner ( TRUE )
- , bSVObject ( FALSE )
- , bInClose ( FALSE )
+ , bOwner ( sal_True )
+ , bSVObject ( sal_False )
+ , bInClose ( sal_False )
{
SotFactory::IncSvObjectCount( this );
}
@@ -116,246 +111,11 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & )
}
/*************************************************************************
-|* SotObject::IsSvClass()
-|*
-|* Beschreibung
-*************************************************************************/
-BOOL SotObject::IsSvObject() const
-{
- return Owner() || bSVObject;
-}
-
-/*************************************************************************
-|* SotObject::QueryDelete()
-|*
-|* Beschreibung: Bei allen aggregierten Objekte muss der RefCount auf
-|* 0 gehen, damit das Gesammt-Objekt zerstoert wird. Das
-|* zerst�ren von Teilen ist verboten. Da der Aggregator
-|* (oder Cast-Verwalter) den Zaehler der aggregierten
-|* Objekte um 1 erhoeht, muss dies bei der Berechnung
-|* des 0-RefCounts beruecksichtigt werden.
-*************************************************************************/
-BOOL SotObject::ShouldDelete()
-{
- if( !pAggList )
- return TRUE;
-
- SvAggregate & rMO = pAggList->GetObject( 0 );
- if( rMO.bMainObj )
- {
- AddRef();
- pAggList->GetObject( 0 ).pObj->ReleaseRef();
- return FALSE;
- }
-
- ULONG i;
- for( i = 1; i < pAggList->Count(); i++ )
- {
- SvAggregate & rAgg = pAggList->GetObject( i );
- // Groesser 1, wegen AddRef() bei AddInterface
- if( !rAgg.bFactory && rAgg.pObj->GetRefCount() > 1 )
- {
- // den eigenen hochzaehelen
- AddRef();
- // einen Aggregierten runterzaehlen
- rAgg.pObj->ReleaseRef();
- return FALSE;
- }
- }
- AddNextRef(); // rekursion stoppen
- for( i = pAggList->Count() -1; i > 0; i-- )
- {
- // Referenzen aufloesen
- DBG_ASSERT( !pAggList->GetObject( i ).bMainObj, "main object reference is opened" );
- RemoveInterface( i );
- }
- delete pAggList;
- pAggList = NULL;
- // und zerstoeren, dies ist unabhaengig vom RefCount
- return TRUE;
-}
-
-/*************************************************************************
-|* SotObject::QueryDelete()
-|*
-|* Beschreibung
-*************************************************************************/
-void SotObject::QueryDelete()
-{
- if( ShouldDelete() )
- SvRefBase::QueryDelete();
-}
-
-
-
-/*************************************************************************
-|* SotObject::GetAggList()
-|*
-|* Beschreibung
-*************************************************************************/
-SvAggregateMemberList & SotObject::GetAggList()
-{
- if( !pAggList )
- {
- pAggList = new SvAggregateMemberList( 2, 1 );
- pAggList->Append( SvAggregate() );
- }
- return *pAggList;
-}
-
-
-/*************************************************************************
-|* SotObject::RemoveInterface()
-|*
-|* Beschreibung
-*************************************************************************/
-void SotObject::RemoveInterface( ULONG nPos )
-{
- SvAggregate & rAgg = pAggList->GetObject( nPos );
- if( !rAgg.bFactory )
- {
- DBG_ASSERT( rAgg.pObj->pAggList, "no aggregation list" );
- DBG_ASSERT( rAgg.pObj->pAggList->GetObject( 0 ).pObj == this,
- "not owner of aggregated object" );
- // sich selbst als Cast-Verwalter austragen
- rAgg.pObj->pAggList->GetObject( 0 ) = SvAggregate();
- // Referenz aufloesen
- rAgg.pObj->ReleaseRef();
- // Aus der eigenen List austragen
- pAggList->Remove( nPos );
- }
-}
-
-/*************************************************************************
-|* SotObject::RemoveInterface()
-|*
-|* Beschreibung
-*************************************************************************/
-void SotObject::RemoveInterface( SotObject * pObjP )
-{
- DBG_ASSERT( pObjP, "null pointer" );
- DBG_ASSERT( pAggList, "no aggregation list" );
- ULONG i;
- for( i = 0; i < pAggList->Count(); i++ )
- {
- SvAggregate & rAgg = pAggList->GetObject( i );
- if( !rAgg.bFactory && pObjP == rAgg.pObj )
- RemoveInterface( i );
- }
- DBG_ASSERT( i < pAggList->Count(), "object not found" );
-}
-
-/*************************************************************************
-|* SotObject::AddInterface()
-|*
-|* Beschreibung
-*************************************************************************/
-void SotObject::AddInterface( SotObject * pObjP )
-{
- pObjP->AddRef(); // Objekt festhalten
- GetAggList();
- pAggList->Append( SvAggregate( pObjP, FALSE ) );
-
- // sich selbst als Typecast-Verwalter eintragen
- SvAggregateMemberList & rAList = pObjP->GetAggList();
- DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" );
- rAList[ 0 ] = SvAggregate( this, TRUE );
-}
-
-/*************************************************************************
-|* SotObject::AddInterface()
-|*
-|* Beschreibung
-*************************************************************************/
-void SotObject::AddInterface( SotFactory * pFactP )
-{
- GetAggList();
- pAggList->Append( SvAggregate( pFactP ) );
-}
-
-/*************************************************************************
-|* SotObject::CreateAggObj()
-|*
-|* Beschreibung
-*************************************************************************/
-SotObjectRef SotObject::CreateAggObj( const SotFactory * )
-{
- return SotObjectRef();
-}
-
-
-/*************************************************************************
-|* SotObject::DownAggCast()
-|*
-|* Beschreibung
-*************************************************************************/
-void * SotObject::DownAggCast( const SotFactory * pFact )
-{
- void * pCast = NULL;
- // geht den Pfad nur Richtung aggregierte Objekte
- if( pAggList )
- {
- for( ULONG i = 1; !pCast || i < pAggList->Count(); i++ )
- {
- SvAggregate & rAgg = pAggList->GetObject( i );
- if( rAgg.bFactory )
- {
- if( rAgg.pFact->Is( pFact ) )
- {
- // On-Demand erzeugen, wenn Typ gebraucht
- SotObjectRef aObj( CreateAggObj( rAgg.pFact ) );
- rAgg.bFactory = FALSE;
- rAgg.pObj = aObj;
- rAgg.pObj->AddRef();
-
- // sich selbst als Typecast-Verwalter eintragen
- SvAggregateMemberList & rAList = rAgg.pObj->GetAggList();
- DBG_ASSERT( !rAList.GetObject( 0 ).bMainObj, "try to aggregate twice" );
- rAList[ 0 ] = SvAggregate( this, TRUE );
- }
- }
- if( !rAgg.bFactory )
- {
- // muss der (void *) auf Klasse pFact sein
- pCast = rAgg.pObj->Cast( pFact );
- if( !pCast )
- pCast = rAgg.pObj->DownAggCast( pFact );
- if( pCast )
- break;
- }
- }
- }
- return pCast;
-}
-
-/*************************************************************************
-|* SotObject::AggCast()
-|*
-|* Beschreibung
-*************************************************************************/
-void * SotObject::AggCast( const SotFactory * pFact )
-{
- void * pCast = NULL;
- if( pAggList )
- {
- SvAggregate & rAgg = pAggList->GetObject( 0 );
- if( rAgg.bMainObj )
- return rAgg.pObj->AggCast( pFact );
- pCast = Cast( pFact );
- if( !pCast )
- pCast = DownAggCast( pFact );
- }
- else
- pCast = Cast( pFact );
- return pCast;
-}
-
-/*************************************************************************
|* SotObject::CastAndAddRef()
|*
|* Beschreibung
*************************************************************************/
-void * SotObject::CastAndAddRef( const SotFactory * pFact )
+void* SotObject::CastAndAddRef( const SotFactory * pFact )
{
void * pCast = Cast( pFact );
if( pCast )
@@ -363,52 +123,11 @@ void * SotObject::CastAndAddRef( const SotFactory * pFact )
return pCast;
}
-/*************************************************************************
-|* SotObject::GetMainObj()
-|*
-|* Beschreibung
-*************************************************************************/
-SotObject * SotObject::GetMainObj() const
-{
- if( pAggList )
- {
- if( pAggList->GetObject( 0 ).bMainObj )
- return pAggList->GetObject( 0 ).pObj->GetMainObj();
- }
- return (SotObject *)this;
-}
-
//=========================================================================
-USHORT SotObject::FuzzyLock
-(
- BOOL bLock, /* TRUE, lock. FALSE, unlock. */
- BOOL /*bIntern*/, /* TRUE, es handelt sich um einen internen Lock.
- FALSE, der Lock kam von aussen (Ole2, Ipc2) */
- BOOL bClose /* TRUE, Close aufrufen wenn letzte Lock */
-)
-/* [Beschreibung]
-
- Erlaubte Parameterkombinationen:
- ( TRUE, TRUE, * ) -> interner Lock.
- ( FALSE, TRUE, TRUE ) -> interner Unlock mit Close,
- wenn LockCount() == 0
- ( TRUE, FALSE, * ) -> externer Lock.
- ( FALSE, FALSE, TRUE ) -> externer Unlock mit Close,
- wenn LockCount() == 0
- ( FALSE, FALSE, FALSE ) -> externer Unlock
-
- F"ur !Owner() wird der Aufruf an das externe Objekt weitergeleitet.
- F"ur diese muss das <IOleItemContainer>-Interface zur Vef"ugung stehen.
- bIntern und bClose werden dann ignoriert.
- Wenn der LockCount auf 0 wechselt, wird <SotObject::DoClose>
- gerufen, wenn kein OwnerLock besteht.
-
- [Anmerkung]
-
-*/
+sal_uInt16 SotObject::Lock( sal_Bool bLock )
{
SotObjectRef xHoldAlive( this );
- USHORT nRet;
+ sal_uInt16 nRet;
if( bLock )
{
AddRef();
@@ -420,15 +139,16 @@ USHORT SotObject::FuzzyLock
ReleaseRef();
}
- if( !nRet && bClose && !nOwnerLockCount )
+ if( !nRet && !nOwnerLockCount )
DoClose();
+
return nRet;
}
//=========================================================================
void SotObject::OwnerLock
(
- BOOL bLock /* TRUE, lock. FALSE, unlock. */
+ sal_Bool bLock /* sal_True, lock. sal_False, unlock. */
)
/* [Beschreibung]
@@ -464,23 +184,23 @@ void SotObject::RemoveOwnerLock()
}
//=========================================================================
-BOOL SotObject::DoClose()
+sal_Bool SotObject::DoClose()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !bInClose )
{
SotObjectRef xHoldAlive( this );
- bInClose = TRUE;
+ bInClose = sal_True;
bRet = Close();
- bInClose = FALSE;
+ bInClose = sal_False;
}
return bRet;
}
//=========================================================================
-BOOL SotObject::Close()
+sal_Bool SotObject::Close()
{
- return TRUE;
+ return sal_True;
}
diff --git a/sot/source/sdstor/makefile.mk b/sot/source/sdstor/makefile.mk
deleted file mode 100644
index f5c6d81548c9..000000000000
--- a/sot/source/sdstor/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sot
-TARGET=sdstor
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=true
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/unostorageholder.obj \
- $(SLO)$/ucbstorage.obj \
- $(SLO)$/stg.obj \
- $(SLO)$/stgcache.obj \
- $(SLO)$/stgstrms.obj \
- $(SLO)$/stgelem.obj \
- $(SLO)$/stgio.obj \
- $(SLO)$/stgole.obj \
- $(SLO)$/stgdir.obj \
- $(SLO)$/stgavl.obj \
- $(SLO)$/storinfo.obj \
- $(SLO)$/storage.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/unostorageholder.obj\
- $(SLO)$/ucbstorage.obj\
- $(SLO)$/storage.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index ef2384e77ea8..1edbd5dee4cb 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sot.hxx"
-#include <storinfo.hxx>
+#include <sot/storinfo.hxx>
#include <osl/file.hxx>
#include <tools/tempfile.hxx>
#include <tools/ownlist.hxx>
@@ -39,7 +39,7 @@
#include <tools/pstm.hxx>
#include <tools/debug.hxx>
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
@@ -63,7 +63,7 @@ TYPEINIT1( BaseStorageStream, StorageBase );
TYPEINIT1( BaseStorage, StorageBase );
StorageBase::StorageBase()
- : m_bAutoCommit( FALSE )
+ : m_bAutoCommit( sal_False )
{
m_nMode = STREAM_READ;
m_nError = SVSTREAM_OK;
@@ -76,14 +76,14 @@ StorageBase::~StorageBase()
// The following three methods are declared as const, since they
// may be called from within a const method.
-ULONG StorageBase::GetError() const
+sal_uLong StorageBase::GetError() const
{
- ULONG n = m_nError;
+ sal_uLong n = m_nError;
((StorageBase*) this)->m_nError = SVSTREAM_OK;
return n;
}
-void StorageBase::SetError( ULONG n ) const
+void StorageBase::SetError( sal_uLong n ) const
{
if( !m_nError )
((StorageBase*) this)->m_nError = n;
@@ -130,20 +130,20 @@ OLEStorageBase::~OLEStorageBase()
// Validate the instance for I/O
-BOOL OLEStorageBase::Validate_Impl( BOOL bWrite ) const
+sal_Bool OLEStorageBase::Validate_Impl( sal_Bool bWrite ) const
{
if( pEntry
&& !pEntry->bInvalid
&& ( !bWrite || !pEntry->bDirect || ( nStreamMode & STREAM_WRITE ) ) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
-BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const
+sal_Bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const
{
if( m == INTERNAL_MODE )
- return TRUE;
- USHORT nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF;
+ return sal_True;
+ sal_uInt16 nCurMode = ( p && p->nRefCnt ) ? p->nMode : 0xFFFF;
if( ( m & 3 ) == STREAM_READ )
{
// only SHARE_DENYWRITE or SHARE_DENYALL allowed
@@ -151,7 +151,7 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const
&& ( nCurMode & STREAM_SHARE_DENYWRITE ) )
|| ( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) ) )
- return TRUE;
+ return sal_True;
}
else
{
@@ -160,9 +160,9 @@ BOOL OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const
// the commit may fail
if( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -196,18 +196,18 @@ StorageStream::~StorageStream()
pEntry->Commit();
}
-BOOL StorageStream::Equals( const BaseStorageStream& rStream ) const
+sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const
{
const StorageStream* pOther = PTR_CAST( StorageStream, &rStream );
return pOther && ( pOther->pEntry == pEntry );
}
-ULONG StorageStream::Read( void* pData, ULONG nSize )
+sal_uLong StorageStream::Read( void* pData, sal_uLong nSize )
{
if( Validate() )
{
pEntry->Seek( nPos );
- nSize = pEntry->Read( pData, (INT32) nSize );
+ nSize = pEntry->Read( pData, (sal_Int32) nSize );
pIo->MoveError( *this );
nPos += nSize;
}
@@ -216,12 +216,12 @@ ULONG StorageStream::Read( void* pData, ULONG nSize )
return nSize;
}
-ULONG StorageStream::Write( const void* pData, ULONG nSize )
+sal_uLong StorageStream::Write( const void* pData, sal_uLong nSize )
{
- if( Validate( TRUE ) )
+ if( Validate( sal_True ) )
{
pEntry->Seek( nPos );
- nSize = pEntry->Write( pData, (INT32) nSize );
+ nSize = pEntry->Write( pData, (sal_Int32) nSize );
pIo->MoveError( *this );
nPos += nSize;
}
@@ -230,7 +230,7 @@ ULONG StorageStream::Write( const void* pData, ULONG nSize )
return nSize;
}
-ULONG StorageStream::Seek( ULONG n )
+sal_uLong StorageStream::Seek( sal_uLong n )
{
if( Validate() )
return nPos = pEntry->Seek( n );
@@ -244,26 +244,26 @@ void StorageStream::Flush()
Commit();
}
-BOOL StorageStream::SetSize( ULONG nNewSize )
+sal_Bool StorageStream::SetSize( sal_uLong nNewSize )
{
- if( Validate( TRUE ) )
+ if( Validate( sal_True ) )
{
- BOOL b = pEntry->SetSize( (INT32) nNewSize );
+ sal_Bool b = pEntry->SetSize( (sal_Int32) nNewSize );
pIo->MoveError( *this );
return b;
}
else
- return FALSE;
+ return sal_False;
}
-BOOL StorageStream::Commit()
+sal_Bool StorageStream::Commit()
{
if( !Validate() )
- return FALSE;
+ return sal_False;
if( !( m_nMode & STREAM_WRITE ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
else
{
@@ -273,22 +273,22 @@ BOOL StorageStream::Commit()
}
}
-BOOL StorageStream::Revert()
+sal_Bool StorageStream::Revert()
{
pEntry->Revert();
pIo->MoveError( *this );
return Good();
}
-BOOL StorageStream::CopyTo( BaseStorageStream* pDest )
+sal_Bool StorageStream::CopyTo( BaseStorageStream* pDest )
{
- if( !Validate() || !pDest->Validate( TRUE ) || Equals( *pDest ) )
- return FALSE;
+ if( !Validate() || !pDest->Validate( sal_True ) || Equals( *pDest ) )
+ return sal_False;
pEntry->Copy( *pDest );
pDest->Commit();
pIo->MoveError( *this );
SetError( pDest->GetError() );
- return BOOL( Good() && pDest->Good() );
+ return sal_Bool( Good() && pDest->Good() );
}
const SvStream* StorageStream::GetSvStream() const
@@ -296,25 +296,25 @@ const SvStream* StorageStream::GetSvStream() const
return GetSvStream_Impl();
}
-BOOL StorageStream::Validate( BOOL bValidate ) const
+sal_Bool StorageStream::Validate( sal_Bool bValidate ) const
{
- BOOL bRet = Validate_Impl( bValidate );
+ sal_Bool bRet = Validate_Impl( bValidate );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
}
-BOOL StorageStream::ValidateMode( StreamMode nMode ) const
+sal_Bool StorageStream::ValidateMode( StreamMode nMode ) const
{
- BOOL bRet = ValidateMode_Impl( nMode, NULL );
+ sal_Bool bRet = ValidateMode_Impl( nMode, NULL );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
}
-BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
+sal_Bool StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
{
- BOOL bRet = ValidateMode_Impl( nMode, p );
+ sal_Bool bRet = ValidateMode_Impl( nMode, p );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
@@ -325,26 +325,26 @@ BOOL StorageStream::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
SvStorageInfo::SvStorageInfo( const StgDirEntry& rE )
{
rE.aEntry.GetName( aName );
- bStorage = BOOL( rE.aEntry.GetType() == STG_STORAGE );
- bStream = BOOL( rE.aEntry.GetType() == STG_STREAM );
+ bStorage = sal_Bool( rE.aEntry.GetType() == STG_STORAGE );
+ bStream = sal_Bool( rE.aEntry.GetType() == STG_STREAM );
nSize = bStorage ? 0 : rE.aEntry.GetSize();
}
/////////////////////////// class Storage ////////////////////////////////
-BOOL Storage::IsStorageFile( const String & rFileName )
+sal_Bool Storage::IsStorageFile( const String & rFileName )
{
StgIo aIo;
if( aIo.Open( rFileName, STREAM_STD_READ ) )
return aIo.Load();
- return FALSE;
+ return sal_False;
}
-BOOL Storage::IsStorageFile( SvStream* pStream )
+sal_Bool Storage::IsStorageFile( SvStream* pStream )
{
StgHeader aHdr;
- ULONG nPos = pStream->Tell();
- BOOL bRet = ( aHdr.Load( *pStream ) && aHdr.Check() );
+ sal_uLong nPos = pStream->Tell();
+ sal_Bool bRet = ( aHdr.Load( *pStream ) && aHdr.Check() );
// It's not a stream error if it is too small for a OLE storage header
if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK )
@@ -358,21 +358,21 @@ BOOL Storage::IsStorageFile( SvStream* pStream )
TYPEINIT1( Storage, BaseStorage );
-Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect )
- : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( FALSE )
+Storage::Storage( const String& rFile, StreamMode m, sal_Bool bDirect )
+ : OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( sal_False )
{
- BOOL bTemp = FALSE;
+ sal_Bool bTemp = sal_False;
if( !aName.Len() )
{
// no name = temporary name!
aName = TempFile::CreateTempName();
- bTemp = TRUE;
+ bTemp = sal_True;
}
// the root storage creates the I/O system
m_nMode = m;
if( pIo->Open( aName, m ) )
{
- Init( BOOL( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) );
+ Init( sal_Bool( ( m & ( STREAM_TRUNC | STREAM_NOCREATE ) ) == STREAM_TRUNC ) );
if( pEntry )
{
pEntry->bDirect = bDirect;
@@ -389,19 +389,19 @@ Storage::Storage( const String& rFile, StreamMode m, BOOL bDirect )
// Create a storage on a given stream.
-Storage::Storage( SvStream& r, BOOL bDirect )
- : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE )
+Storage::Storage( SvStream& r, sal_Bool bDirect )
+ : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False )
{
m_nMode = STREAM_READ;
if( r.IsWritable() )
m_nMode = STREAM_READ | STREAM_WRITE;
if( r.GetError() == SVSTREAM_OK )
{
- pIo->SetStrm( &r, FALSE );
- ULONG nSize = r.Seek( STREAM_SEEK_TO_END );
+ pIo->SetStrm( &r, sal_False );
+ sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END );
r.Seek( 0L );
// Initializing is OK if the stream is empty
- Init( BOOL( nSize == 0 ) );
+ Init( sal_Bool( nSize == 0 ) );
if( pEntry )
{
pEntry->bDirect = bDirect;
@@ -417,8 +417,8 @@ Storage::Storage( SvStream& r, BOOL bDirect )
}
-Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect )
- : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( FALSE )
+Storage::Storage( UCBStorageStream& rStrm, sal_Bool bDirect )
+ : OLEStorageBase( new StgIo, NULL, m_nMode ), bIsRoot( sal_False )
{
m_nMode = STREAM_READ;
@@ -432,7 +432,7 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect )
SvStream* pStream = rStrm.GetModifySvStream();
if ( !pStream )
{
- OSL_ENSURE( FALSE, "UCBStorageStream can not provide SvStream implementation!\n" );
+ OSL_ENSURE( sal_False, "UCBStorageStream can not provide SvStream implementation!\n" );
SetError( SVSTREAM_GENERALERROR );
pEntry = NULL;
return;
@@ -443,10 +443,10 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect )
pIo->SetStrm( &rStrm );
- ULONG nSize = pStream->Seek( STREAM_SEEK_TO_END );
+ sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END );
pStream->Seek( 0L );
// Initializing is OK if the stream is empty
- Init( BOOL( nSize == 0 ) );
+ Init( sal_Bool( nSize == 0 ) );
if( pEntry )
{
pEntry->bDirect = bDirect;
@@ -459,14 +459,14 @@ Storage::Storage( UCBStorageStream& rStrm, BOOL bDirect )
// Perform common code for both ctors above.
-void Storage::Init( BOOL bCreate )
+void Storage::Init( sal_Bool bCreate )
{
pEntry = NULL;
- BOOL bHdrLoaded = FALSE;
- bIsRoot = TRUE;
+ sal_Bool bHdrLoaded = sal_False;
+ bIsRoot = sal_True;
if( pIo->Good() )
{
- ULONG nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
+ sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
pIo->GetStrm()->Seek( 0L );
if( nSize )
{
@@ -495,7 +495,7 @@ void Storage::Init( BOOL bCreate )
// Internal ctor
Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m )
- : OLEStorageBase( p, q, m_nMode ), bIsRoot( FALSE )
+ : OLEStorageBase( p, q, m_nMode ), bIsRoot( sal_False )
{
if( q )
q->aEntry.GetName( aName );
@@ -558,7 +558,7 @@ void Storage::FillInfoList( SvStorageInfoList* pList ) const
// Open or create a substorage
-BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bDirect )
+BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, sal_Bool bDirect )
{
OSL_FAIL("Not supported!");
/*
@@ -569,31 +569,31 @@ BaseStorage* Storage::OpenUCBStorage( const String& rName, StreamMode m, BOOL bD
return OpenStorage( rName, m, bDirect );
}
-BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, BOOL bDirect )
+BaseStorage* Storage::OpenOLEStorage( const String& rName, StreamMode m, sal_Bool bDirect )
{
return OpenStorage( rName, m, bDirect );
}
-BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDirect )
+BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, sal_Bool bDirect )
{
if( !Validate() || !ValidateMode( m ) )
return new Storage( pIo, NULL, m );
if( bDirect && !pEntry->bDirect )
- bDirect = FALSE;
+ bDirect = sal_False;
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( !p )
{
if( !( m & STREAM_NOCREATE ) )
{
- BOOL bTemp = FALSE;
+ sal_Bool bTemp = sal_False;
// create a new storage
String aNewName = rName;
if( !aNewName.Len() )
{
aNewName.AssignAscii( "Temp Stg " );
aNewName.Append( String::CreateFromInt32( ++nTmpCount ) );
- bTemp = TRUE;
+ bTemp = sal_True;
}
p = pIo->pTOC->Create( *pEntry, aNewName, STG_STORAGE );
if( p )
@@ -623,13 +623,13 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, BOOL bDire
}
Storage* pStg = new Storage( pIo, p, m );
pIo->MoveError( *pStg );
- if( m & STREAM_WRITE ) pStg->m_bAutoCommit = TRUE;
+ if( m & STREAM_WRITE ) pStg->m_bAutoCommit = sal_True;
return pStg;
}
// Open a stream
-BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, BOOL,
+BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, sal_Bool,
const ByteString*
#ifdef DBG_UTIL
pB
@@ -641,7 +641,7 @@ pB
if( !Validate() || !ValidateMode( m ) )
return new StorageStream( pIo, NULL, m );
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
- BOOL bTemp = FALSE;
+ sal_Bool bTemp = sal_False;
if( !p )
{
if( !( m & STREAM_NOCREATE ) )
@@ -653,7 +653,7 @@ pB
{
aNewName.AssignAscii( "Temp Strm " );
aNewName.Append( String::CreateFromInt32( ++nTmpCount ) );
- bTemp = TRUE;
+ bTemp = sal_True;
}
p = pIo->pTOC->Create( *pEntry, aNewName, STG_STREAM );
}
@@ -675,50 +675,50 @@ pB
}
StorageStream* pStm = new StorageStream( pIo, p, m );
if( p && !p->bDirect )
- pStm->SetAutoCommit( TRUE );
+ pStm->SetAutoCommit( sal_True );
pIo->MoveError( *pStm );
return pStm;
}
// Delete a stream or substorage by setting the temp bit.
-BOOL Storage::Remove( const String& rName )
+sal_Bool Storage::Remove( const String& rName )
{
- if( !Validate( TRUE ) )
- return FALSE;
+ if( !Validate( sal_True ) )
+ return sal_False;
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( p )
{
- p->Invalidate( TRUE );
- return TRUE;
+ p->Invalidate( sal_True );
+ return sal_True;
}
else
{
SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
}
// Rename a storage element
-BOOL Storage::Rename( const String& rOld, const String& rNew )
+sal_Bool Storage::Rename( const String& rOld, const String& rNew )
{
- if( Validate( TRUE ) )
+ if( Validate( sal_True ) )
{
- BOOL b = pIo->pTOC->Rename( *pEntry, rOld, rNew );
+ sal_Bool b = pIo->pTOC->Rename( *pEntry, rOld, rNew );
pIo->MoveError( *this );
return b;
}
else
- return FALSE;
+ return sal_False;
}
// Copy one element
-BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew )
+sal_Bool Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNew )
{
- if( !Validate() || !pDest || !pDest->Validate( TRUE ) )
- return FALSE;
+ if( !Validate() || !pDest || !pDest->Validate( sal_True ) )
+ return sal_False;
StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem );
if( pElem )
{
@@ -727,7 +727,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe
if( !pElem->IsContained( pDest->pEntry ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
*/
if( pElem->aEntry.GetType() == STG_STORAGE )
@@ -736,7 +736,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe
BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE );
BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect );
- ULONG nTmpErr = p2->GetError();
+ sal_uLong nTmpErr = p2->GetError();
if( !nTmpErr )
{
p2->SetClassId( p1->GetClassId() );
@@ -754,7 +754,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe
delete p1;
delete p2;
- return BOOL( Good() && pDest->Good() );
+ return sal_Bool( Good() && pDest->Good() );
}
else
{
@@ -762,7 +762,7 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe
BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE );
BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect );
- ULONG nTmpErr = p2->GetError();
+ sal_uLong nTmpErr = p2->GetError();
if( !nTmpErr )
{
p1->CopyTo( p2 );
@@ -779,58 +779,58 @@ BOOL Storage::CopyTo( const String& rElem, BaseStorage* pDest, const String& rNe
delete p1;
delete p2;
- return BOOL( Good() && pDest->Good() );
+ return sal_Bool( Good() && pDest->Good() );
}
}
SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
-BOOL Storage::CopyTo( BaseStorage* pDest ) const
+sal_Bool Storage::CopyTo( BaseStorage* pDest ) const
{
- if( !Validate() || !pDest || !pDest->Validate( TRUE ) || Equals( *pDest ) )
+ if( !Validate() || !pDest || !pDest->Validate( sal_True ) || Equals( *pDest ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
Storage* pThis = (Storage*) this;
/*
if( !pThis->pEntry->IsContained( pDest->pEntry ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
*/
pDest->SetClassId( GetClassId() );
pDest->SetDirty();
SvStorageInfoList aList;
FillInfoList( &aList );
- BOOL bRes = TRUE;
- for( USHORT i = 0; i < aList.Count() && bRes; i++ )
+ sal_Bool bRes = sal_True;
+ for( sal_uInt16 i = 0; i < aList.Count() && bRes; i++ )
{
SvStorageInfo& rInfo = aList.GetObject( i );
bRes = pThis->CopyTo( rInfo.GetName(), pDest, rInfo.GetName() );
}
if( !bRes )
SetError( pDest->GetError() );
- return BOOL( Good() && pDest->Good() );
+ return sal_Bool( Good() && pDest->Good() );
}
// Move one element
-BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew )
+sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rNew )
{
- if( !Validate() || !pODest || !pODest->Validate( TRUE ) || Equals( *pODest ) )
+ if( !Validate() || !pODest || !pODest->Validate( sal_True ) || Equals( *pODest ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem );
if( pElem )
{
// Simplest case: both storages share the same file
- BOOL bRes;
+ sal_Bool bRes;
Storage *pOther = PTR_CAST( Storage, pODest );
if( pOther && pIo == pOther->pIo && rElem == rNew )
{
@@ -841,14 +841,14 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN
{
// cyclic move
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
bRes = pIo->pTOC->Move( *pEntry, *pDest->pEntry, rNew );
if( !bRes )
{
pIo->MoveError( *this );
pDest->pIo->MoveError( *pDest );
- ULONG nErr = GetError();
+ sal_uLong nErr = GetError();
if( !nErr )
nErr = pDest->GetError();
SetError( nErr );
@@ -866,51 +866,51 @@ BOOL Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String& rN
return bRes;
}
SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
-BOOL Storage::IsStorage( const String& rName ) const
+sal_Bool Storage::IsStorage( const String& rName ) const
{
if( Validate() )
{
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( p )
- return BOOL( p->aEntry.GetType() == STG_STORAGE );
+ return sal_Bool( p->aEntry.GetType() == STG_STORAGE );
}
- return FALSE;
+ return sal_False;
}
-BOOL Storage::IsStream( const String& rName ) const
+sal_Bool Storage::IsStream( const String& rName ) const
{
if( Validate() )
{
StgDirEntry* p = pIo->pTOC->Find( *pEntry, rName );
if( p )
- return BOOL( p->aEntry.GetType() == STG_STREAM );
+ return sal_Bool( p->aEntry.GetType() == STG_STREAM );
}
- return FALSE;
+ return sal_False;
}
-BOOL Storage::IsContained( const String& rName ) const
+sal_Bool Storage::IsContained( const String& rName ) const
{
if( Validate() )
- return BOOL( pIo->pTOC->Find( *pEntry, rName ) != NULL );
+ return sal_Bool( pIo->pTOC->Find( *pEntry, rName ) != NULL );
else
- return FALSE;
+ return sal_False;
}
// Commit all sub-elements within this storage. If this is
// the root, commit the FAT, the TOC and the header as well.
-BOOL Storage::Commit()
+sal_Bool Storage::Commit()
{
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
if( !Validate() )
- return FALSE;
+ return sal_False;
if( !( m_nMode & STREAM_WRITE ) )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE;
+ return sal_False;
}
else
{
@@ -929,9 +929,9 @@ BOOL Storage::Commit()
return bRes;
}
-BOOL Storage::Revert()
+sal_Bool Storage::Revert()
{
- return TRUE;
+ return sal_True;
}
///////////////////////////// OLE Support ////////////////////////////////
@@ -939,16 +939,16 @@ BOOL Storage::Revert()
// Set the storage type
void Storage::SetClass( const SvGlobalName & rClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName )
{
- if( Validate( TRUE ) )
+ if( Validate( sal_True ) )
{
// set the class name in the root entry
pEntry->aEntry.SetClassId( (const ClsId&) rClass.GetCLSID() );
pEntry->SetDirty();
// then create the streams
- StgCompObjStream aCompObj( *this, TRUE );
+ StgCompObjStream aCompObj( *this, sal_True );
aCompObj.GetClsId() = (const ClsId&) rClass.GetCLSID();
aCompObj.GetCbFormat() = nOriginalClipFormat;
aCompObj.GetUserName() = rUserTypeName;
@@ -966,14 +966,14 @@ void Storage::SetClass( const SvGlobalName & rClass,
}
void Storage::SetConvertClass( const SvGlobalName & rConvertClass,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName )
{
- if( Validate( TRUE ) )
+ if( Validate( sal_True ) )
{
SetClass( rConvertClass, nOriginalClipFormat, rUserTypeName );
// plus the convert flag:
- StgOleStream aOle( *this, TRUE );
+ StgOleStream aOle( *this, sal_True );
aOle.GetFlags() |= 4;
if( !aOle.Store() )
SetError( aOle.GetError() );
@@ -982,7 +982,7 @@ void Storage::SetConvertClass( const SvGlobalName & rConvertClass,
SvGlobalName Storage::GetClassName()
{
- StgCompObjStream aCompObj( *this, FALSE );
+ StgCompObjStream aCompObj( *this, sal_False );
if( aCompObj.Load() )
return SvGlobalName( (const CLSID&) aCompObj.GetClsId() );
pIo->ResetError();
@@ -993,9 +993,9 @@ SvGlobalName Storage::GetClassName()
return SvGlobalName();
}
-ULONG Storage::GetFormat()
+sal_uLong Storage::GetFormat()
{
- StgCompObjStream aCompObj( *this, FALSE );
+ StgCompObjStream aCompObj( *this, sal_False );
if( aCompObj.Load() )
return aCompObj.GetCbFormat();
pIo->ResetError();
@@ -1004,26 +1004,26 @@ ULONG Storage::GetFormat()
String Storage::GetUserName()
{
- StgCompObjStream aCompObj( *this, FALSE );
+ StgCompObjStream aCompObj( *this, sal_False );
if( aCompObj.Load() )
return aCompObj.GetUserName();
pIo->ResetError();
return String();
}
-BOOL Storage::ShouldConvert()
+sal_Bool Storage::ShouldConvert()
{
- StgOleStream aOle( *this, FALSE );
+ StgOleStream aOle( *this, sal_False );
if( aOle.Load() )
- return BOOL( ( aOle.GetFlags() & 4 ) != 0 );
+ return sal_Bool( ( aOle.GetFlags() & 4 ) != 0 );
else
{
pIo->ResetError();
- return FALSE;
+ return sal_False;
}
}
-BOOL Storage::ValidateFAT()
+sal_Bool Storage::ValidateFAT()
{
Link aLink = StgIo::GetErrorLink();
ErrCode nErr = pIo->ValidateFATs();
@@ -1051,31 +1051,31 @@ const SvStream* Storage::GetSvStream() const
return GetSvStream_Impl();
}
-BOOL Storage::Validate( BOOL bValidate ) const
+sal_Bool Storage::Validate( sal_Bool bValidate ) const
{
- BOOL bRet = Validate_Impl( bValidate );
+ sal_Bool bRet = Validate_Impl( bValidate );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
}
-BOOL Storage::ValidateMode( StreamMode nMode ) const
+sal_Bool Storage::ValidateMode( StreamMode nMode ) const
{
- BOOL bRet = ValidateMode_Impl( nMode );
+ sal_Bool bRet = ValidateMode_Impl( nMode );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
}
-BOOL Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
+sal_Bool Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
{
- BOOL bRet = ValidateMode_Impl( nMode, p );
+ sal_Bool bRet = ValidateMode_Impl( nMode, p );
if ( !bRet )
SetError( SVSTREAM_ACCESS_DENIED );
return bRet;
}
-BOOL Storage::Equals( const BaseStorage& rStorage ) const
+sal_Bool Storage::Equals( const BaseStorage& rStorage ) const
{
const Storage* pOther = PTR_CAST( Storage, &rStorage );
return pOther && ( pOther->pEntry == pEntry );
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index a2e4a9162e02..c411b845e0a2 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -213,7 +213,7 @@ StgAvlNode* StgAvlNode::RotRL()
// Remove a tree element. Return the removed element or NULL.
-StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, BOOL bPtrs )
+StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, sal_Bool bPtrs )
{
if( *p )
{
@@ -280,21 +280,21 @@ void StgAvlNode::StgEnum( short& n )
}
// Add node to AVL tree.
-// Return FALSE if the element already exists.
+// Return sal_False if the element already exists.
-BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
+sal_Bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
{
StgAvlNode* pPivot, *pHeavy, *pNewRoot, *pParent, *pPrev;
// special case - empty tree
if( *pRoot == NULL )
{
*pRoot = pIns;
- return TRUE;
+ return sal_True;
}
// find insertion point and return if already present
short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev );
if( !nRes )
- return FALSE;
+ return sal_False;
// add new node
if( nRes < 0 )
pPrev->pLeft = pIns;
@@ -324,19 +324,19 @@ BOOL StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
else if( pPivot == pParent->pRight )
pParent->pRight = pNewRoot;
}
- return TRUE;
+ return sal_True;
}
-// Remove node from tree. Returns TRUE is found and removed.
+// Remove node from tree. Returns sal_True is found and removed.
// Actually delete if bDel
-BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel )
+sal_Bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, sal_Bool bDel )
{
// special case - empty tree
if( *pRoot == NULL )
- return FALSE;
+ return sal_False;
// delete the element
- pDel = Rem( pRoot, pDel, FALSE );
+ pDel = Rem( pRoot, pDel, sal_False );
if( pDel )
{
if( bDel )
@@ -346,30 +346,30 @@ BOOL StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, BOOL bDel )
/* StgAvlNode* pNew = NULL;
while( *pRoot )
{
- StgAvlNode* p = Rem( pRoot, *pRoot, FALSE );
+ StgAvlNode* p = Rem( pRoot, *pRoot, sal_False );
Insert( &pNew, p );
}
*pRoot = pNew;*/
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-// Move node to a different tree. Returns TRUE is found and moved. This routine
+// Move node to a different tree. Returns sal_True is found and moved. This routine
// may be called when the key has changed.
-BOOL StgAvlNode::Move
+sal_Bool StgAvlNode::Move
( StgAvlNode** pRoot1, StgAvlNode** pRoot2, StgAvlNode* pMove )
{
// special case - empty tree
if( *pRoot1 == NULL )
- return FALSE;
- pMove = Rem( pRoot1, pMove, FALSE );
+ return sal_False;
+ pMove = Rem( pRoot1, pMove, sal_False );
if( pMove )
return Insert( pRoot2, pMove );
else
- return FALSE;
+ return sal_False;
}
////////////////////////// class AvlIterator /////////////////////////
diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx
index 0c2f75d3d2be..8bd48ef8b62e 100644
--- a/sot/source/sdstor/stgavl.hxx
+++ b/sot/source/sdstor/stgavl.hxx
@@ -45,7 +45,7 @@ private:
StgAvlNode* RotRR();
StgAvlNode* RotRL();
void StgEnum( short& );
- static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, BOOL );
+ static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, sal_Bool );
protected:
short nId; // iterator ID
short nBalance; // indicates tree balance
@@ -54,9 +54,9 @@ protected:
public:
virtual ~StgAvlNode();
StgAvlNode* Find( StgAvlNode* );
- static BOOL Insert( StgAvlNode**, StgAvlNode* );
- static BOOL Remove( StgAvlNode**, StgAvlNode*, BOOL bDel = TRUE );
- static BOOL Move( StgAvlNode**, StgAvlNode**, StgAvlNode* );
+ static sal_Bool Insert( StgAvlNode**, StgAvlNode* );
+ static sal_Bool Remove( StgAvlNode**, StgAvlNode*, sal_Bool bDel = sal_True );
+ static sal_Bool Move( StgAvlNode**, StgAvlNode**, StgAvlNode* );
virtual short Compare( const StgAvlNode* ) const = 0;
};
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index ffee054f7257..d9b5884473b0 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -41,7 +41,7 @@
#include <osl/endian.h>
#include <tools/string.hxx>
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
@@ -52,10 +52,10 @@
//-----------------------------------------------------------------------------
typedef boost::unordered_map
<
- INT32,
+ sal_Int32,
StgPage *,
- boost::hash< INT32 >,
- std::equal_to< INT32 >
+ boost::hash< sal_Int32 >,
+ std::equal_to< sal_Int32 >
> UsrStgPagePtr_Impl;
#ifdef _MSC_VER
#pragma warning( disable: 4786 )
@@ -73,9 +73,9 @@ StgPage::StgPage( StgCache* p, short n )
{
pCache = p;
nData = n;
- bDirty = FALSE;
+ bDirty = sal_False;
nPage = 0;
- pData = new BYTE[ nData ];
+ pData = new sal_uInt8[ nData ];
pNext1 =
pNext2 =
pLast1 =
@@ -88,15 +88,15 @@ StgPage::~StgPage()
delete [] pData;
}
-void StgPage::SetPage( short nOff, INT32 nVal )
+void StgPage::SetPage( short nOff, sal_Int32 nVal )
{
- if( ( nOff < (short) ( nData / sizeof( INT32 ) ) ) && nOff >= 0 )
+ if( ( nOff < (short) ( nData / sizeof( sal_Int32 ) ) ) && nOff >= 0 )
{
#ifdef OSL_BIGENDIAN
nVal = SWAPLONG(nVal);
#endif
- ((INT32*) pData )[ nOff ] = nVal;
- bDirty = TRUE;
+ ((sal_Int32*) pData )[ nOff ] = nVal;
+ bDirty = sal_True;
}
}
@@ -105,7 +105,7 @@ void StgPage::SetPage( short nOff, INT32 nVal )
// The disk cache holds the cached sectors. The sector type differ according
// to their purpose.
-INT32 lcl_GetPageCount( ULONG nFileSize, short nPageSize )
+sal_Int32 lcl_GetPageCount( sal_uLong nFileSize, short nPageSize )
{
// return (nFileSize >= 512) ? (nFileSize - 512) / nPageSize : 0;
// #i61980# reallife: last page may be incomplete, return number of *started* pages
@@ -119,8 +119,8 @@ StgCache::StgCache()
pCur = pElem1 = NULL;
nPageSize = 512;
nError = SVSTREAM_OK;
- bMyStream = FALSE;
- bFile = FALSE;
+ bMyStream = sal_False;
+ bFile = sal_False;
pLRUCache = NULL;
pStorageStream = NULL;
}
@@ -128,15 +128,15 @@ StgCache::StgCache()
StgCache::~StgCache()
{
Clear();
- SetStrm( NULL, FALSE );
+ SetStrm( NULL, sal_False );
delete (UsrStgPagePtr_Impl*)pLRUCache;
}
void StgCache::SetPhysPageSize( short n )
{
nPageSize = n;
- ULONG nPos = pStrm->Tell();
- ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
+ sal_uLong nPos = pStrm->Tell();
+ sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
nPages = lcl_GetPageCount( nFileSize, nPageSize );
pStrm->Seek( nPos );
}
@@ -144,7 +144,7 @@ void StgCache::SetPhysPageSize( short n )
// Create a new cache element
// pCur points to this element
-StgPage* StgCache::Create( INT32 nPg )
+StgPage* StgCache::Create( sal_Int32 nPg )
{
StgPage* pElem = new StgPage( this, nPageSize );
pElem->nPage = nPg;
@@ -227,7 +227,7 @@ void StgCache::Clear()
// Look for a cached page
-StgPage* StgCache::Find( INT32 nPage )
+StgPage* StgCache::Find( sal_Int32 nPage )
{
if( !pLRUCache )
return NULL;
@@ -255,7 +255,7 @@ StgPage* StgCache::Find( INT32 nPage )
// Load a page into the cache
-StgPage* StgCache::Get( INT32 nPage, BOOL bForce )
+StgPage* StgCache::Get( sal_Int32 nPage, sal_Bool bForce )
{
StgPage* p = Find( nPage );
if( !p )
@@ -275,7 +275,7 @@ StgPage* StgCache::Get( INT32 nPage, BOOL bForce )
// to duplicate an existing stream or to create new entries.
// The new page is initially marked dirty. No owner is copied.
-StgPage* StgCache::Copy( INT32 nNew, INT32 nOld )
+StgPage* StgCache::Copy( sal_Int32 nNew, sal_Int32 nOld )
{
StgPage* p = Find( nNew );
if( !p )
@@ -283,7 +283,7 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld )
if( nOld >= 0 )
{
// old page: we must have this data!
- StgPage* q = Get( nOld, TRUE );
+ StgPage* q = Get( nOld, sal_True );
if( q )
memcpy( p->pData, q->pData, p->nData );
}
@@ -293,17 +293,17 @@ StgPage* StgCache::Copy( INT32 nNew, INT32 nOld )
// Flush the cache whose owner is given. NULL flushes all.
-BOOL StgCache::Commit( StgDirEntry* )
+sal_Bool StgCache::Commit( StgDirEntry* )
{
StgPage* p = pElem1;
if( p ) do
{
if( p->bDirty )
{
- BOOL b = Write( p->nPage, p->pData, 1 );
+ sal_Bool b = Write( p->nPage, p->pData, 1 );
if( !b )
- return FALSE;
- p->bDirty = FALSE;
+ return sal_False;
+ p->bDirty = sal_False;
}
p = p->pNext2;
} while( p != pElem1 );
@@ -316,10 +316,10 @@ BOOL StgCache::Commit( StgDirEntry* )
if( p->bDirty )
{
ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in Ordered List") ).Execute();
- BOOL b = Write( p->nPage, p->pData, 1 );
+ sal_Bool b = Write( p->nPage, p->pData, 1 );
if( !b )
- return FALSE;
- p->bDirty = FALSE;
+ return sal_False;
+ p->bDirty = sal_False;
}
p = p->pNext2;
} while( p != pElem1 );
@@ -329,15 +329,15 @@ BOOL StgCache::Commit( StgDirEntry* )
if( p->bDirty )
{
ErrorBox( NULL, WB_OK, String("SO2: Dirty Block in LRU List") ).Execute();
- BOOL b = Write( p->nPage, p->pData, 1 );
+ sal_Bool b = Write( p->nPage, p->pData, 1 );
if( !b )
- return FALSE;
- p->bDirty = FALSE;
+ return sal_False;
+ p->bDirty = sal_False;
}
p = p->pNext1;
} while( p != pElem1 );
#endif
- return TRUE;
+ return sal_True;
}
void StgCache::Revert( StgDirEntry* )
@@ -345,7 +345,7 @@ void StgCache::Revert( StgDirEntry* )
// Set a stream
-void StgCache::SetStrm( SvStream* p, BOOL bMy )
+void StgCache::SetStrm( SvStream* p, sal_Bool bMy )
{
if( pStorageStream )
{
@@ -376,34 +376,34 @@ void StgCache::SetStrm( UCBStorageStream* pStgStream )
pStrm = pStorageStream->GetModifySvStream();
}
- bMyStream = FALSE;
+ bMyStream = sal_False;
}
// Open/close the disk file
-BOOL StgCache::Open( const String& rName, StreamMode nMode )
+sal_Bool StgCache::Open( const String& rName, StreamMode nMode )
{
// do not open in exclusive mode!
if( nMode & STREAM_SHARE_DENYALL )
nMode = ( ( nMode & ~STREAM_SHARE_DENYALL ) | STREAM_SHARE_DENYWRITE );
SvFileStream* pFileStrm = new SvFileStream( rName, nMode );
// SvStream "Feature" Write Open auch erfolgreich, wenns nicht klappt
- BOOL bAccessDenied = FALSE;
+ sal_Bool bAccessDenied = sal_False;
if( ( nMode & STREAM_WRITE ) && !pFileStrm->IsWritable() )
{
pFileStrm->Close();
- bAccessDenied = TRUE;
+ bAccessDenied = sal_True;
}
- SetStrm( pFileStrm, TRUE );
+ SetStrm( pFileStrm, sal_True );
if( pFileStrm->IsOpen() )
{
- ULONG nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
+ sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
nPages = lcl_GetPageCount( nFileSize, nPageSize );
pStrm->Seek( 0L );
}
else
nPages = 0;
- bFile = TRUE;
+ bFile = sal_True;
SetError( bAccessDenied ? ERRCODE_IO_ACCESSDENIED : pStrm->GetError() );
return Good();
}
@@ -419,7 +419,7 @@ void StgCache::Close()
// low level I/O
-BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg )
+sal_Bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
{
if( Good() )
{
@@ -431,9 +431,9 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg )
SetError( SVSTREAM_READ_ERROR );
else if ( nPage < nPages )
{
- ULONG nPos = Page2Pos( nPage );
- INT32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg;
- ULONG nBytes = nPg2 * nPageSize;
+ sal_uLong nPos = Page2Pos( nPage );
+ sal_Int32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg;
+ sal_uLong nBytes = nPg2 * nPageSize;
// fixed address and size for the header
if( nPage == -1 )
{
@@ -458,12 +458,12 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg )
return Good();
}
-BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg )
+sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
{
if( Good() )
{
- ULONG nPos = Page2Pos( nPage );
- ULONG nBytes = nPg * nPageSize;
+ sal_uLong nPos = Page2Pos( nPage );
+ sal_uLong nBytes = nPg * nPageSize;
// fixed address and size for the header
if( nPage == -1 )
nPos = 0L, nBytes = 512;
@@ -475,16 +475,16 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg )
#endif
}
}
- ULONG nRes = pStrm->Write( pBuf, nBytes );
+ sal_uLong nRes = pStrm->Write( pBuf, nBytes );
if( nRes != nBytes )
SetError( SVSTREAM_WRITE_ERROR );
else
SetError( pStrm->GetError() );
#ifdef READ_AFTER_WRITE
- BYTE cBuf[ 512 ];
+ sal_uInt8 cBuf[ 512 ];
pStrm->Flush();
pStrm->Seek( nPos );
- BOOL bRes = ( pStrm->Read( cBuf, 512 ) == 512 );
+ sal_Bool bRes = ( pStrm->Read( cBuf, 512 ) == 512 );
if( bRes )
bRes = !memcmp( cBuf, pBuf, 512 );
if( !bRes )
@@ -499,10 +499,10 @@ BOOL StgCache::Write( INT32 nPage, void* pBuf, INT32 nPg )
// set the file size in pages
-BOOL StgCache::SetSize( INT32 n )
+sal_Bool StgCache::SetSize( sal_Int32 n )
{
// Add the file header
- INT32 nSize = n * nPageSize + 512;
+ sal_Int32 nSize = n * nPageSize + 512;
pStrm->SetStreamSize( nSize );
SetError( pStrm->GetError() );
if( !nError )
@@ -510,7 +510,7 @@ BOOL StgCache::SetSize( INT32 n )
return Good();
}
-void StgCache::SetError( ULONG n )
+void StgCache::SetError( sal_uLong n )
{
if( n && !nError )
nError = n;
@@ -533,13 +533,13 @@ void StgCache::MoveError( StorageBase& r )
// Utility functions
-INT32 StgCache::Page2Pos( INT32 nPage )
+sal_Int32 StgCache::Page2Pos( sal_Int32 nPage )
{
if( nPage < 0 ) nPage = 0;
return( nPage * nPageSize ) + nPageSize;
}
-INT32 StgCache::Pos2Page( INT32 nPos )
+sal_Int32 StgCache::Pos2Page( sal_Int32 nPos )
{
return ( ( nPos + nPageSize - 1 ) / nPageSize ) * nPageSize - 1;
}
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 38e8e3428331..9b47cffed6c8 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -44,9 +44,9 @@ class StorageBase;
class StgCache {
StgPage* pCur; // top of LRU list
StgPage* pElem1; // top of ordered list
- ULONG nError; // error code
- INT32 nPages; // size of data area in pages
- USHORT nRef; // reference count
+ sal_uLong nError; // error code
+ sal_Int32 nPages; // size of data area in pages
+ sal_uInt16 nRef; // reference count
void * pLRUCache; // hash table of cached objects
short nPageSize; // page size of the file
UCBStorageStream* pStorageStream; // holds reference to UCB storage stream
@@ -54,40 +54,40 @@ class StgCache {
void Erase( StgPage* ); // delete a cache element
void InsertToLRU( StgPage* ); // insert into LRU list
void InsertToOrdered( StgPage* ); // insert into ordered list
- StgPage* Create( INT32 ); // create a cached page
+ StgPage* Create( sal_Int32 ); // create a cached page
protected:
SvStream* pStrm; // physical stream
- BOOL bMyStream; // TRUE: delete stream in dtor
- BOOL bFile; // TRUE: file stream
- INT32 Page2Pos( INT32 ); // page address --> file position
- INT32 Pos2Page( INT32 ); // file position --> page address
+ sal_Bool bMyStream; // sal_True: delete stream in dtor
+ sal_Bool bFile; // sal_True: file stream
+ sal_Int32 Page2Pos( sal_Int32 ); // page address --> file position
+ sal_Int32 Pos2Page( sal_Int32 ); // file position --> page address
public:
StgCache();
~StgCache();
void IncRef() { nRef++; }
- USHORT DecRef() { return --nRef; }
+ sal_uInt16 DecRef() { return --nRef; }
void SetPhysPageSize( short );
- INT32 GetPhysPages() { return nPages; }
+ sal_Int32 GetPhysPages() { return nPages; }
short GetPhysPageSize() { return nPageSize; }
SvStream* GetStrm() { return pStrm; }
- void SetStrm( SvStream*, BOOL );
+ void SetStrm( SvStream*, sal_Bool );
void SetStrm( UCBStorageStream* );
- BOOL IsWritable() { return pStrm->IsWritable(); }
- BOOL Good() { return BOOL( nError == SVSTREAM_OK ); }
- BOOL Bad() { return BOOL( nError != SVSTREAM_OK ); }
- ULONG GetError() { return nError; }
+ sal_Bool IsWritable() { return pStrm->IsWritable(); }
+ sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); }
+ sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); }
+ sal_uLong GetError() { return nError; }
void MoveError( StorageBase& );
- void SetError( ULONG );
+ void SetError( sal_uLong );
void ResetError();
- BOOL Open( const String& rName, StreamMode );
+ sal_Bool Open( const String& rName, StreamMode );
void Close();
- BOOL Read( INT32 nPage, void* pBuf, INT32 nPages );
- BOOL Write( INT32 nPage, void* pBuf, INT32 nPages );
- BOOL SetSize( INT32 nPages );
- StgPage* Find( INT32 ); // find a cached page
- StgPage* Get( INT32, BOOL ); // get a cached page
- StgPage* Copy( INT32, INT32=STG_FREE ); // copy a page
- BOOL Commit( StgDirEntry* = NULL ); // flush all pages
+ sal_Bool Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPages );
+ sal_Bool Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPages );
+ sal_Bool SetSize( sal_Int32 nPages );
+ StgPage* Find( sal_Int32 ); // find a cached page
+ StgPage* Get( sal_Int32, sal_Bool ); // get a cached page
+ StgPage* Copy( sal_Int32, sal_Int32=STG_FREE ); // copy a page
+ sal_Bool Commit( StgDirEntry* = NULL ); // flush all pages
void Revert( StgDirEntry* = NULL ); // revert dirty pages
void Clear(); // clear the cache
};
@@ -98,32 +98,32 @@ class StgPage {
StgPage *pNext1, *pLast1; // LRU chain
StgPage *pNext2, *pLast2; // ordered chain
StgDirEntry* pOwner; // owner
- INT32 nPage; // page #
- BYTE* pData; // nPageSize characters
+ sal_Int32 nPage; // page #
+ sal_uInt8* pData; // nPageSize characters
short nData; // size of this page
- BOOL bDirty; // dirty flag
+ sal_Bool bDirty; // dirty flag
StgPage( StgCache*, short );
~StgPage();
public:
- void SetDirty() { bDirty = TRUE; }
- INT32 GetPage() { return nPage; }
+ void SetDirty() { bDirty = sal_True; }
+ sal_Int32 GetPage() { return nPage; }
void* GetData() { return pData; }
short GetSize() { return nData; }
void SetOwner( StgDirEntry* p ) { pOwner = p; }
// routines for accessing FAT pages
// Assume that the data is a FAT page and get/put FAT data.
- INT32 GetPage( short nOff )
+ sal_Int32 GetPage( short nOff )
{
- if( ( nOff >= (short) ( nData / sizeof( INT32 ) ) ) || nOff < 0 )
+ if( ( nOff >= (short) ( nData / sizeof( sal_Int32 ) ) ) || nOff < 0 )
return -1;
- INT32 n = ((INT32*) pData )[ nOff ];
+ sal_Int32 n = ((sal_Int32*) pData )[ nOff ];
#ifdef OSL_BIGENDIAN
return SWAPLONG(n);
#else
return n;
#endif
}
- void SetPage( short, INT32 ); // put an element
+ void SetPage( short, sal_Int32 ); // put an element
};
#endif
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index f1c33338429b..4951daa70a6c 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -31,7 +31,7 @@
#include <string.h> // memcpy()
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
@@ -55,7 +55,7 @@
// Problem der Implementation: Keine Hierarchischen commits. Daher nur
// insgesamt transaktionsorientert oder direkt.
-StgDirEntry::StgDirEntry( const void* pFrom, BOOL * pbOk ) : StgAvlNode()
+StgDirEntry::StgDirEntry( const void* pFrom, sal_Bool * pbOk ) : StgAvlNode()
{
*pbOk = aEntry.Load( pFrom );
@@ -82,14 +82,14 @@ void StgDirEntry::InitMembers()
nEntry =
nRefCnt = 0;
nMode = STREAM_READ;
- bDirect = TRUE;
+ bDirect = sal_True;
bInvalid =
bCreated =
bRenamed =
bRemoved =
bTemp =
bDirty =
- bZombie = FALSE;
+ bZombie = sal_False;
}
StgDirEntry::~StgDirEntry()
@@ -114,9 +114,9 @@ short StgDirEntry::Compare( const StgAvlNode* p ) const
// the TOC tree into the TOC stream. Remember that aSave is
// stored, not aEntry.
-void StgDirEntry::Enum( INT32& n )
+void StgDirEntry::Enum( sal_Int32& n )
{
- INT32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE;
+ sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE;
nEntry = n++;
if( pLeft )
{
@@ -138,17 +138,17 @@ void StgDirEntry::Enum( INT32& n )
// Delete all temporary entries before writing the TOC stream.
// Until now Deltem is never called with bForce True
-void StgDirEntry::DelTemp( BOOL bForce )
+void StgDirEntry::DelTemp( sal_Bool bForce )
{
if( pLeft )
- ((StgDirEntry*) pLeft)->DelTemp( FALSE );
+ ((StgDirEntry*) pLeft)->DelTemp( sal_False );
if( pRight )
- ((StgDirEntry*) pRight)->DelTemp( FALSE );
+ ((StgDirEntry*) pRight)->DelTemp( sal_False );
if( pDown )
{
// If the storage is dead, of course all elements are dead, too
if( bInvalid && aEntry.GetType() == STG_STORAGE )
- bForce = TRUE;
+ bForce = sal_True;
pDown->DelTemp( bForce );
}
if( ( bForce || bInvalid )
@@ -158,12 +158,12 @@ void StgDirEntry::DelTemp( BOOL bForce )
if( pUp )
{
// this deletes the element if refcnt == 0!
- BOOL bDel = nRefCnt == 0;
+ sal_Bool bDel = nRefCnt == 0;
StgAvlNode::Remove( (StgAvlNode**) &pUp->pDown, this, bDel );
if( !bDel )
{
pLeft = pRight = pDown = 0;
- bInvalid = bZombie = TRUE;
+ bInvalid = bZombie = sal_True;
}
}
}
@@ -171,26 +171,26 @@ void StgDirEntry::DelTemp( BOOL bForce )
// Save the tree into the given dir stream
-BOOL StgDirEntry::Store( StgDirStrm& rStrm )
+sal_Bool StgDirEntry::Store( StgDirStrm& rStrm )
{
- void* pEntry = rStrm.GetEntry( nEntry, TRUE );
+ void* pEntry = rStrm.GetEntry( nEntry, sal_True );
if( !pEntry )
- return FALSE;
+ return sal_False;
// Do not store the current (maybe not commited) entry
aSave.Store( pEntry );
if( pLeft )
if( !((StgDirEntry*) pLeft)->Store( rStrm ) )
- return FALSE;
+ return sal_False;
if( pRight )
if( !((StgDirEntry*) pRight)->Store( rStrm ) )
- return FALSE;
+ return sal_False;
if( pDown )
if( !pDown->Store( rStrm ) )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
-BOOL StgDirEntry::StoreStream( StgIo& rIo )
+sal_Bool StgDirEntry::StoreStream( StgIo& rIo )
{
if( aEntry.GetType() == STG_STREAM || aEntry.GetType() == STG_ROOT )
{
@@ -207,27 +207,27 @@ BOOL StgDirEntry::StoreStream( StgIo& rIo )
}
// or write the data stream
else if( !Tmp2Strm() )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// Save all dirty streams
-BOOL StgDirEntry::StoreStreams( StgIo& rIo )
+sal_Bool StgDirEntry::StoreStreams( StgIo& rIo )
{
if( !StoreStream( rIo ) )
- return FALSE;
+ return sal_False;
if( pLeft )
if( !((StgDirEntry*) pLeft)->StoreStreams( rIo ) )
- return FALSE;
+ return sal_False;
if( pRight )
if( !((StgDirEntry*) pRight)->StoreStreams( rIo ) )
- return FALSE;
+ return sal_False;
if( pDown )
if( !pDown->StoreStreams( rIo ) )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// Revert all directory entries after failure to write the TOC stream
@@ -245,24 +245,24 @@ void StgDirEntry::RevertAll()
// Look if any element of the tree is dirty
-BOOL StgDirEntry::IsDirty()
+sal_Bool StgDirEntry::IsDirty()
{
if( bDirty || bInvalid )
- return TRUE;
+ return sal_True;
if( pLeft && ((StgDirEntry*) pLeft)->IsDirty() )
- return TRUE;
+ return sal_True;
if( pRight && ((StgDirEntry*) pRight)->IsDirty() )
- return TRUE;
+ return sal_True;
if( pDown && pDown->IsDirty() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// Set up a stream.
-void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig )
+void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig )
{
- INT32 nThreshold = (USHORT) rIo.aHdr.GetThreshold();
+ sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
delete pStgStrm;
if( !bForceBig && aEntry.GetSize() < nThreshold )
pStgStrm = new StgSmallStrm( rIo, this );
@@ -272,7 +272,7 @@ void StgDirEntry::OpenStream( StgIo& rIo, BOOL bForceBig )
{
// This entry has invalid data, so delete that data
SetSize( 0L );
-// bRemoved = bInvalid = FALSE;
+// bRemoved = bInvalid = sal_False;
}
nPos = 0;
}
@@ -292,9 +292,9 @@ void StgDirEntry::Close()
// Get the current stream size
-INT32 StgDirEntry::GetSize()
+sal_Int32 StgDirEntry::GetSize()
{
- INT32 n;
+ sal_Int32 n;
if( pTmpStrm )
n = pTmpStrm->GetSize();
else if( pCurStrm )
@@ -305,14 +305,14 @@ INT32 StgDirEntry::GetSize()
// Set the stream size. This means also creating a temp stream.
-BOOL StgDirEntry::SetSize( INT32 nNewSize )
+sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize )
{
if (
!( nMode & STREAM_WRITE ) ||
(!bDirect && !pTmpStrm && !Strm2Tmp())
)
{
- return FALSE;
+ return sal_False;
}
if( nNewSize < nPos )
@@ -321,26 +321,26 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize )
{
pTmpStrm->SetSize( nNewSize );
pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
- return BOOL( pTmpStrm->GetError() == SVSTREAM_OK );
+ return sal_Bool( pTmpStrm->GetError() == SVSTREAM_OK );
}
else
{
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
StgIo& rIo = pStgStrm->GetIo();
- INT32 nThreshold = rIo.aHdr.GetThreshold();
+ sal_Int32 nThreshold = rIo.aHdr.GetThreshold();
// ensure the correct storage stream!
StgStrm* pOld = NULL;
- USHORT nOldSize = 0;
+ sal_uInt16 nOldSize = 0;
if( nNewSize >= nThreshold && pStgStrm->IsSmallStrm() )
{
pOld = pStgStrm;
- nOldSize = (USHORT) pOld->GetSize();
+ nOldSize = (sal_uInt16) pOld->GetSize();
pStgStrm = new StgDataStrm( rIo, STG_EOF, 0 );
}
else if( nNewSize < nThreshold && !pStgStrm->IsSmallStrm() )
{
pOld = pStgStrm;
- nOldSize = (USHORT) nNewSize;
+ nOldSize = (sal_uInt16) nNewSize;
pStgStrm = new StgSmallStrm( rIo, STG_EOF, 0 );
}
// now set the new size
@@ -352,16 +352,16 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize )
// if so, we probably need to copy the old data
if( nOldSize )
{
- void* pBuf = new BYTE[ nOldSize ];
+ void* pBuf = new sal_uInt8[ nOldSize ];
pOld->Pos2Page( 0L );
pStgStrm->Pos2Page( 0L );
if( pOld->Read( pBuf, nOldSize )
&& pStgStrm->Write( pBuf, nOldSize ) )
- bRes = TRUE;
- delete[] static_cast<BYTE*>(pBuf);
+ bRes = sal_True;
+ delete[] static_cast<sal_uInt8*>(pBuf);
}
else
- bRes = TRUE;
+ bRes = sal_True;
if( bRes )
{
pOld->SetSize( 0 );
@@ -379,7 +379,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize )
else
{
pStgStrm->Pos2Page( nPos );
- bRes = TRUE;
+ bRes = sal_True;
}
}
return bRes;
@@ -388,7 +388,7 @@ BOOL StgDirEntry::SetSize( INT32 nNewSize )
// Seek. On negative values, seek to EOF.
-INT32 StgDirEntry::Seek( INT32 nNew )
+sal_Int32 StgDirEntry::Seek( sal_Int32 nNew )
{
if( pTmpStrm )
{
@@ -404,7 +404,7 @@ INT32 StgDirEntry::Seek( INT32 nNew )
}
else
{
- INT32 nSize = aEntry.GetSize();
+ sal_Int32 nSize = aEntry.GetSize();
if( nNew < 0 )
nNew = nSize;
@@ -428,7 +428,7 @@ INT32 StgDirEntry::Seek( INT32 nNew )
// Read
-INT32 StgDirEntry::Read( void* p, INT32 nLen )
+sal_Int32 StgDirEntry::Read( void* p, sal_Int32 nLen )
{
if( nLen <= 0 )
return 0;
@@ -444,7 +444,7 @@ INT32 StgDirEntry::Read( void* p, INT32 nLen )
// Write
-INT32 StgDirEntry::Write( const void* p, INT32 nLen )
+sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen )
{
if( nLen <= 0 || !( nMode & STREAM_WRITE ) )
return 0;
@@ -462,7 +462,7 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen )
}
else
{
- INT32 nNew = nPos + nLen;
+ sal_Int32 nNew = nPos + nLen;
if( nNew > pStgStrm->GetSize() )
{
if( !SetSize( nNew ) )
@@ -479,16 +479,16 @@ INT32 StgDirEntry::Write( const void* p, INT32 nLen )
void StgDirEntry::Copy( StgDirEntry& rDest )
{
- INT32 n = GetSize();
+ sal_Int32 n = GetSize();
if( rDest.SetSize( n ) && n )
{
- BYTE aTempBytes[ 4096 ];
+ sal_uInt8 aTempBytes[ 4096 ];
void* p = static_cast<void*>( aTempBytes );
Seek( 0L );
rDest.Seek( 0L );
while( n )
{
- INT32 nn = n;
+ sal_Int32 nn = n;
if( nn > 4096 )
nn = 4096;
if( Read( p, nn ) != nn )
@@ -502,22 +502,22 @@ void StgDirEntry::Copy( StgDirEntry& rDest )
void StgDirEntry::Copy( BaseStorageStream& rDest )
{
- INT32 n = GetSize();
+ sal_Int32 n = GetSize();
if( rDest.SetSize( n ) && n )
{
- ULONG Pos = rDest.Tell();
- BYTE aTempBytes[ 4096 ];
+ sal_uLong Pos = rDest.Tell();
+ sal_uInt8 aTempBytes[ 4096 ];
void* p = static_cast<void*>( aTempBytes );
Seek( 0L );
rDest.Seek( 0L );
while( n )
{
- INT32 nn = n;
+ sal_Int32 nn = n;
if( nn > 4096 )
nn = 4096;
if( Read( p, nn ) != nn )
break;
- if( sal::static_int_cast<INT32>(rDest.Write( p, nn )) != nn )
+ if( sal::static_int_cast<sal_Int32>(rDest.Write( p, nn )) != nn )
break;
n -= nn;
}
@@ -527,12 +527,12 @@ void StgDirEntry::Copy( BaseStorageStream& rDest )
// Commit this entry
-BOOL StgDirEntry::Commit()
+sal_Bool StgDirEntry::Commit()
{
// OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" );
aSave = aEntry;
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
if( aEntry.GetType() == STG_STREAM )
{
if( pTmpStrm )
@@ -553,7 +553,7 @@ BOOL StgDirEntry::Commit()
// Revert the entry
-BOOL StgDirEntry::Revert()
+sal_Bool StgDirEntry::Revert()
{
aEntry = aSave;
switch( aEntry.GetType() )
@@ -564,24 +564,24 @@ BOOL StgDirEntry::Revert()
break;
case STG_STORAGE:
{
- BOOL bSomeRenamed = FALSE;
+ sal_Bool bSomeRenamed = sal_False;
StgIterator aOIter( *this );
StgDirEntry* op = aOIter.First();
while( op )
{
op->aEntry = op->aSave;
- op->bDirty = FALSE;
- bSomeRenamed = BOOL( bSomeRenamed | op->bRenamed );
+ op->bDirty = sal_False;
+ bSomeRenamed = sal_Bool( bSomeRenamed | op->bRenamed );
// Remove any new entries
if( op->bCreated )
{
- op->bCreated = FALSE;
+ op->bCreated = sal_False;
op->Close();
- op->bInvalid = TRUE;
+ op->bInvalid = sal_True;
}
// Reactivate any removed entries
else if( op->bRemoved )
- op->bRemoved = op->bInvalid = op->bTemp = FALSE;
+ op->bRemoved = op->bInvalid = op->bTemp = sal_False;
op = aOIter.Next();
}
// Resort all renamed entries
@@ -596,12 +596,12 @@ BOOL StgDirEntry::Revert()
StgAvlNode::Move
( (StgAvlNode**) &p->pUp->pDown,
(StgAvlNode**) &p->pUp->pDown, p );
- p->bRenamed = FALSE;
+ p->bRenamed = sal_False;
}
p = aIter.Next();
}
}
- DelTemp( FALSE );
+ DelTemp( sal_False );
break;
}
case STG_EMPTY:
@@ -610,22 +610,22 @@ BOOL StgDirEntry::Revert()
case STG_ROOT:
break;
}
- return TRUE;
+ return sal_True;
}
// Copy the stg stream to the temp stream
-BOOL StgDirEntry::Strm2Tmp()
+sal_Bool StgDirEntry::Strm2Tmp()
{
if( !pTmpStrm )
{
- ULONG n = 0;
+ sal_uLong n = 0;
if( pCurStrm )
{
// It was already commited once
pTmpStrm = new StgTmpStrm;
if( pTmpStrm->GetError() == SVSTREAM_OK && pTmpStrm->Copy( *pCurStrm ) )
- return TRUE;
+ return sal_True;
n = 1; // indicates error
}
else
@@ -636,15 +636,15 @@ BOOL StgDirEntry::Strm2Tmp()
{
if( n )
{
- BYTE aTempBytes[ 4096 ];
+ sal_uInt8 aTempBytes[ 4096 ];
void* p = static_cast<void*>( aTempBytes );
pStgStrm->Pos2Page( 0L );
while( n )
{
- ULONG nn = n;
+ sal_uLong nn = n;
if( nn > 4096 )
nn = 4096;
- if( (ULONG) pStgStrm->Read( p, nn ) != nn )
+ if( (sal_uLong) pStgStrm->Read( p, nn ) != nn )
break;
if( pTmpStrm->Write( p, nn ) != nn )
break;
@@ -662,41 +662,41 @@ BOOL StgDirEntry::Strm2Tmp()
pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
delete pTmpStrm;
pTmpStrm = NULL;
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
// Copy the temp stream to the stg stream during the final commit
-BOOL StgDirEntry::Tmp2Strm()
+sal_Bool StgDirEntry::Tmp2Strm()
{
// We did commit once, but have not written since then
if( !pTmpStrm )
pTmpStrm = pCurStrm, pCurStrm = NULL;
if( pTmpStrm )
{
- ULONG n = pTmpStrm->GetSize();
+ sal_uLong n = pTmpStrm->GetSize();
StgStrm* pNewStrm;
StgIo& rIo = pStgStrm->GetIo();
- ULONG nThreshold = (ULONG) rIo.aHdr.GetThreshold();
+ sal_uLong nThreshold = (sal_uLong) rIo.aHdr.GetThreshold();
if( n < nThreshold )
pNewStrm = new StgSmallStrm( rIo, STG_EOF, 0 );
else
pNewStrm = new StgDataStrm( rIo, STG_EOF, 0 );
if( pNewStrm->SetSize( n ) )
{
- BYTE p[ 4096 ];
+ sal_uInt8 p[ 4096 ];
pTmpStrm->Seek( 0L );
while( n )
{
- ULONG nn = n;
+ sal_uLong nn = n;
if( nn > 4096 )
nn = 4096;
if( pTmpStrm->Read( p, nn ) != nn )
break;
- if( (ULONG) pNewStrm->Write( p, nn ) != nn )
+ if( (sal_uLong) pNewStrm->Write( p, nn ) != nn )
break;
n -= nn;
}
@@ -705,7 +705,7 @@ BOOL StgDirEntry::Tmp2Strm()
pTmpStrm->Seek( nPos );
pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
delete pNewStrm;
- return FALSE;
+ return sal_False;
}
else
{
@@ -721,12 +721,12 @@ BOOL StgDirEntry::Tmp2Strm()
}
}
}
- return TRUE;
+ return sal_True;
}
// Check if the given entry is contained in this entry
-BOOL StgDirEntry::IsContained( StgDirEntry* pStg )
+sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg )
{
if( aEntry.GetType() == STG_STORAGE )
{
@@ -735,25 +735,25 @@ BOOL StgDirEntry::IsContained( StgDirEntry* pStg )
while( p )
{
if( !p->aEntry.Compare( pStg->aEntry ) )
- return FALSE;
+ return sal_False;
if( p->aEntry.GetType() == STG_STORAGE )
if( !p->IsContained( pStg ) )
- return FALSE;
+ return sal_False;
p = aIter.Next();
}
}
- return TRUE;
+ return sal_True;
}
// Invalidate all open entries by setting the RefCount to 0. If the bDel
// flag is set, also set the invalid flag to indicate deletion during the
// next dir stream flush.
-void StgDirEntry::Invalidate( BOOL bDel )
+void StgDirEntry::Invalidate( sal_Bool bDel )
{
// nRefCnt = 0;
if( bDel )
- bRemoved = bInvalid = TRUE;
+ bRemoved = bInvalid = sal_True;
switch( aEntry.GetType() )
{
case STG_STORAGE:
@@ -808,12 +808,12 @@ StgDirStrm::~StgDirStrm()
// Recursively parse the directory tree during reading the TOC stream
-void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper )
+void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
{
void* p = ( n == STG_FREE ) ? NULL : GetEntry( n );
if( p )
{
- BOOL bOk(FALSE);
+ sal_Bool bOk(sal_False);
StgDirEntry* pCur = new StgDirEntry( p, &bOk );
if( !bOk )
@@ -828,10 +828,10 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper )
if( !pUpper )
pCur->aEntry.SetType( STG_ROOT );
- INT32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT );
- INT32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT );
+ sal_Int32 nLeft = pCur->aEntry.GetLeaf( STG_LEFT );
+ sal_Int32 nRight = pCur->aEntry.GetLeaf( STG_RIGHT );
// substorage?
- INT32 nLeaf = STG_FREE;
+ sal_Int32 nLeaf = STG_FREE;
if( pCur->aEntry.GetType() == STG_STORAGE || pCur->aEntry.GetType() == STG_ROOT )
{
nLeaf = pCur->aEntry.GetLeaf( STG_CHILD );
@@ -866,7 +866,7 @@ void StgDirStrm::SetupEntry( INT32 n, StgDirEntry* pUpper )
// Extend or shrink the directory stream.
-BOOL StgDirStrm::SetSize( INT32 nBytes )
+sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes )
{
// Always allocate full pages
nBytes = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize;
@@ -875,72 +875,75 @@ BOOL StgDirStrm::SetSize( INT32 nBytes )
// Save the TOC stream into a new substream after saving all data streams
-BOOL StgDirStrm::Store()
+sal_Bool StgDirStrm::Store()
{
if( !pRoot->IsDirty() )
- return TRUE;
+ return sal_True;
if( !pRoot->StoreStreams( rIo ) )
- return FALSE;
+ return sal_False;
// After writing all streams, the data FAT stream has changed,
// so we have to commit the root again
pRoot->Commit();
// We want a completely new stream, so fake an empty stream
- INT32 nOldStart = nStart; // save for later deletion
- INT32 nOldSize = nSize;
+ sal_Int32 nOldStart = nStart; // save for later deletion
+ sal_Int32 nOldSize = nSize;
nStart = nPage = STG_EOF;
nSize = nPos = 0;
nOffset = 0;
// Delete all temporary entries
- pRoot->DelTemp( FALSE );
+ pRoot->DelTemp( sal_False );
// set the entry numbers
- INT32 n = 0;
+ sal_Int32 n = 0;
pRoot->Enum( n );
if( !SetSize( n * STGENTRY_SIZE ) )
{
nStart = nOldStart; nSize = nOldSize;
pRoot->RevertAll();
- return FALSE;
+ return sal_False;
}
// set up the cache elements for the new stream
if( !Copy( STG_FREE, nSize ) )
{
pRoot->RevertAll();
- return FALSE;
+ return sal_False;
}
// Write the data to the new stream
if( !pRoot->Store( *this ) )
{
pRoot->RevertAll();
- return FALSE;
+ return sal_False;
}
// fill any remaining entries with empty data
- INT32 ne = nSize / STGENTRY_SIZE;
+ sal_Int32 ne = nSize / STGENTRY_SIZE;
StgEntry aEmpty;
aEmpty.Init();
while( n < ne )
{
- void* p = GetEntry( n++, TRUE );
+ void* p = GetEntry( n++, sal_True );
if( !p )
{
pRoot->RevertAll();
- return FALSE;
+ return sal_False;
}
aEmpty.Store( p );
}
// Now we can release the old stream
- pFat->FreePages( nOldStart, TRUE );
+ pFat->FreePages( nOldStart, sal_True );
rIo.aHdr.SetTOCStart( nStart );
- return TRUE;
+ return sal_True;
}
// Get a dir entry.
-void* StgDirStrm::GetEntry( INT32 n, BOOL bDirty )
+void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty )
{
+ if( n < 0 )
+ return NULL;
+
n *= STGENTRY_SIZE;
- if( n >= nSize )
+ if( n < 0 && n >= nSize )
return NULL;
- return GetPtr( n, TRUE, bDirty );
+ return GetPtr( n, sal_True, bDirty );
}
// Find a dir entry.
@@ -987,9 +990,9 @@ StgDirEntry* StgDirStrm::Create
}
pRes->bInvalid =
pRes->bRemoved =
- pRes->bTemp = FALSE;
+ pRes->bTemp = sal_False;
pRes->bCreated =
- pRes->bDirty = TRUE;
+ pRes->bDirty = sal_True;
}
else
{
@@ -999,7 +1002,7 @@ StgDirEntry* StgDirStrm::Create
pRes->pUp = &rStg;
pRes->ppRoot = &pRoot;
pRes->bCreated =
- pRes->bDirty = TRUE;
+ pRes->bDirty = sal_True;
}
else
{
@@ -1012,44 +1015,44 @@ StgDirEntry* StgDirStrm::Create
// Rename the given entry.
-BOOL StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew )
+sal_Bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew )
{
StgDirEntry* p = Find( rStg, rOld );
if( p )
{
- if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, FALSE ) )
- return FALSE;
+ if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, sal_False ) )
+ return sal_False;
p->aEntry.SetName( rNew );
if( !StgAvlNode::Insert( (StgAvlNode**) &rStg.pDown, p ) )
- return FALSE;
- p->bRenamed = p->bDirty = TRUE;
- return TRUE;
+ return sal_False;
+ p->bRenamed = p->bDirty = sal_True;
+ return sal_True;
}
else
{
rIo.SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
}
// Move the given entry to a different storage.
-BOOL StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName )
+sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName )
{
StgDirEntry* p = Find( rStg1, rName );
if( p )
{
if( !StgAvlNode::Move
( (StgAvlNode**) &rStg1.pDown, (StgAvlNode**) &rStg2.pDown, p ) )
- return FALSE;
- p->bDirty = TRUE;
- return TRUE;
+ return sal_False;
+ p->bDirty = sal_True;
+ return sal_True;
}
else
{
rIo.SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
}
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index d0ed802be683..ccb12c4762d7 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -50,52 +50,52 @@ class StgDirEntry : public StgAvlNode
StgStrm* pStgStrm; // storage stream
StgTmpStrm* pTmpStrm; // temporary stream
StgTmpStrm* pCurStrm; // temp stream after commit
- INT32 nEntry; // entry # in TOC stream (temp)
- INT32 nPos; // current position
- BOOL bDirty; // dirty directory entry
- BOOL bCreated; // newly created entry
- BOOL bRemoved; // removed per Invalidate()
- BOOL bRenamed; // renamed
+ sal_Int32 nEntry; // entry # in TOC stream (temp)
+ sal_Int32 nPos; // current position
+ sal_Bool bDirty; // dirty directory entry
+ sal_Bool bCreated; // newly created entry
+ sal_Bool bRemoved; // removed per Invalidate()
+ sal_Bool bRenamed; // renamed
void InitMembers(); // ctor helper
virtual short Compare( const StgAvlNode* ) const;
- BOOL StoreStream( StgIo& ); // store the stream
- BOOL StoreStreams( StgIo& ); // store all streams
+ sal_Bool StoreStream( StgIo& ); // store the stream
+ sal_Bool StoreStreams( StgIo& ); // store all streams
void RevertAll(); // revert the whole tree
- BOOL Strm2Tmp(); // copy stgstream to temp file
- BOOL Tmp2Strm(); // copy temp file to stgstream
+ sal_Bool Strm2Tmp(); // copy stgstream to temp file
+ sal_Bool Tmp2Strm(); // copy temp file to stgstream
public:
StgEntry aEntry; // entry data
- INT32 nRefCnt; // reference count
+ sal_Int32 nRefCnt; // reference count
StreamMode nMode; // open mode
- BOOL bTemp; // TRUE: delete on dir flush
- BOOL bDirect; // TRUE: direct mode
- BOOL bZombie; // TRUE: Removed From StgIo
- BOOL bInvalid; // TRUE: invalid entry
- StgDirEntry( const void*, BOOL * pbOk );
+ sal_Bool bTemp; // sal_True: delete on dir flush
+ sal_Bool bDirect; // sal_True: direct mode
+ sal_Bool bZombie; // sal_True: Removed From StgIo
+ sal_Bool bInvalid; // sal_True: invalid entry
+ StgDirEntry( const void*, sal_Bool * pbOk );
StgDirEntry( const StgEntry& );
~StgDirEntry();
- void Invalidate( BOOL=FALSE ); // invalidate all open entries
- void Enum( INT32& ); // enumerate entries for iteration
- void DelTemp( BOOL ); // delete temporary entries
- BOOL Store( StgDirStrm& ); // save entry into dir strm
- BOOL IsContained( StgDirEntry* ); // check if subentry
+ void Invalidate( sal_Bool=sal_False ); // invalidate all open entries
+ void Enum( sal_Int32& ); // enumerate entries for iteration
+ void DelTemp( sal_Bool ); // delete temporary entries
+ sal_Bool Store( StgDirStrm& ); // save entry into dir strm
+ sal_Bool IsContained( StgDirEntry* ); // check if subentry
- void SetDirty() { bDirty = TRUE; }
- BOOL IsDirty();
+ void SetDirty() { bDirty = sal_True; }
+ sal_Bool IsDirty();
void ClearDirty();
- BOOL Commit();
- BOOL Revert();
+ sal_Bool Commit();
+ sal_Bool Revert();
- void OpenStream( StgIo&, BOOL=FALSE ); // set up an approbiate stream
+ void OpenStream( StgIo&, sal_Bool=sal_False ); // set up an approbiate stream
void Close();
- INT32 GetSize();
- BOOL SetSize( INT32 );
- INT32 Seek( INT32 );
- INT32 Tell() { return nPos; }
- INT32 Read( void*, INT32 );
- INT32 Write( const void*, INT32 );
+ sal_Int32 GetSize();
+ sal_Bool SetSize( sal_Int32 );
+ sal_Int32 Seek( sal_Int32 );
+ sal_Int32 Tell() { return nPos; }
+ sal_Int32 Read( void*, sal_Int32 );
+ sal_Int32 Write( const void*, sal_Int32 );
void Copy( StgDirEntry& );
void Copy( BaseStorageStream& );
};
@@ -105,19 +105,19 @@ class StgDirStrm : public StgDataStrm
friend class StgIterator;
StgDirEntry* pRoot; // root of dir tree
short nEntries; // entries per page
- void SetupEntry( INT32, StgDirEntry* );
+ void SetupEntry( sal_Int32, StgDirEntry* );
public:
StgDirStrm( StgIo& );
~StgDirStrm();
- virtual BOOL SetSize( INT32 ); // change the size
- BOOL Store();
- void* GetEntry( INT32 n, BOOL=FALSE );// get an entry
+ virtual sal_Bool SetSize( sal_Int32 ); // change the size
+ sal_Bool Store();
+ void* GetEntry( sal_Int32 n, sal_Bool=sal_False );// get an entry
StgDirEntry* GetRoot() { return pRoot; }
StgDirEntry* Find( StgDirEntry&, const String& );
StgDirEntry* Create( StgDirEntry&, const String&, StgEntryType );
- BOOL Remove( StgDirEntry&, const String& );
- BOOL Rename( StgDirEntry&, const String&, const String& );
- BOOL Move( StgDirEntry&, StgDirEntry&, const String& );
+ sal_Bool Remove( StgDirEntry&, const String& );
+ sal_Bool Rename( StgDirEntry&, const String&, const String& );
+ sal_Bool Move( StgDirEntry&, StgDirEntry&, const String& );
};
class StgIterator : public StgAvlIterator
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index e6b318da7148..bfde32ade4c0 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -33,14 +33,14 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <unotools/charclass.hxx>
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
#include "stgdir.hxx"
#include "stgio.hxx"
-static BYTE cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 };
+static sal_uInt8 cStgSignature[ 8 ] = { 0xD0,0xCF,0x11,0xE0,0xA1,0xB1,0x1A,0xE1 };
////////////////////////////// struct ClsId /////////////////////////////
@@ -63,17 +63,17 @@ SvStream& operator >>( SvStream& r, ClsId& rId )
SvStream& operator <<( SvStream& r, const ClsId& rId )
{
return
- r << (INT32) rId.n1
- << (INT16) rId.n2
- << (INT16) rId.n3
- << (UINT8) rId.n4
- << (UINT8) rId.n5
- << (UINT8) rId.n6
- << (UINT8) rId.n7
- << (UINT8) rId.n8
- << (UINT8) rId.n9
- << (UINT8) rId.n10
- << (UINT8) rId.n11;
+ r << (sal_Int32) rId.n1
+ << (sal_Int16) rId.n2
+ << (sal_Int16) rId.n3
+ << (sal_uInt8) rId.n4
+ << (sal_uInt8) rId.n5
+ << (sal_uInt8) rId.n6
+ << (sal_uInt8) rId.n7
+ << (sal_uInt8) rId.n8
+ << (sal_uInt8) rId.n9
+ << (sal_uInt8) rId.n10
+ << (sal_uInt8) rId.n11;
}
///////////////////////////// class StgHeader ////////////////////////////
@@ -100,14 +100,14 @@ void StgHeader::Init()
SetFATPage( i, STG_FREE );
}
-BOOL StgHeader::Load( StgIo& rIo )
+sal_Bool StgHeader::Load( StgIo& rIo )
{
SvStream& r = *rIo.GetStrm();
Load( r );
return rIo.Good();
}
-BOOL StgHeader::Load( SvStream& r )
+sal_Bool StgHeader::Load( SvStream& r )
{
r.Seek( 0L );
r.Read( cSignature, 8 );
@@ -130,10 +130,10 @@ BOOL StgHeader::Load( SvStream& r )
return r.GetErrorCode() == ERRCODE_NONE;
}
-BOOL StgHeader::Store( StgIo& rIo )
+sal_Bool StgHeader::Store( StgIo& rIo )
{
if( !bDirty )
- return TRUE;
+ return sal_True;
SvStream& r = *rIo.GetStrm();
r.Seek( 0L );
r.Write( cSignature, 8 + 16 );
@@ -141,7 +141,7 @@ BOOL StgHeader::Store( StgIo& rIo )
<< nByteOrder // 1C Unicode byte order indicator
<< nPageSize // 1E 1 << nPageSize = block size
<< nDataPageSize // 20 1 << this size == data block size
- << (INT32) 0 << (INT32) 0 << (INT16) 0
+ << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int16) 0
<< nFATSize // 2C total number of FAT pages
<< nTOCstrm // 30 starting page for the TOC stream
<< nReserved // 34
@@ -153,7 +153,7 @@ BOOL StgHeader::Store( StgIo& rIo )
for( short i = 0; i < 109; i++ )
r << nMasterFAT[ i ];
bDirty = !rIo.Good();
- return BOOL( !bDirty );
+ return sal_Bool( !bDirty );
}
static bool lcl_wontoverflow(short shift)
@@ -162,15 +162,15 @@ static bool lcl_wontoverflow(short shift)
}
// Perform thorough checks also on unknown variables
-BOOL StgHeader::Check()
+sal_Bool StgHeader::Check()
{
- return BOOL( memcmp( cSignature, cStgSignature, 8 ) == 0
+ return sal_Bool( memcmp( cSignature, cStgSignature, 8 ) == 0
&& (short) ( nVersion >> 16 ) == 3 )
&& lcl_wontoverflow(nPageSize)
&& lcl_wontoverflow(nDataPageSize);
}
-INT32 StgHeader::GetFATPage( short n ) const
+sal_Int32 StgHeader::GetFATPage( short n ) const
{
if( n >= 0 && n < 109 )
return nMasterFAT[ n ];
@@ -178,50 +178,50 @@ INT32 StgHeader::GetFATPage( short n ) const
return STG_EOF;
}
-void StgHeader::SetFATPage( short n, INT32 nb )
+void StgHeader::SetFATPage( short n, sal_Int32 nb )
{
if( n >= 0 && n < 109 )
{
if( nMasterFAT[ n ] != nb )
- bDirty = TRUE, nMasterFAT[ n ] = nb;
+ bDirty = sal_True, nMasterFAT[ n ] = nb;
}
}
void StgHeader::SetClassId( const ClsId& r )
{
if( memcmp( &aClsId, &r, sizeof( ClsId ) ) )
- bDirty = TRUE, memcpy( &aClsId, &r, sizeof( ClsId ) );
+ bDirty = sal_True, memcpy( &aClsId, &r, sizeof( ClsId ) );
}
-void StgHeader::SetTOCStart( INT32 n )
+void StgHeader::SetTOCStart( sal_Int32 n )
{
- if( n != nTOCstrm ) bDirty = TRUE, nTOCstrm = n;
+ if( n != nTOCstrm ) bDirty = sal_True, nTOCstrm = n;
}
-void StgHeader::SetDataFATStart( INT32 n )
+void StgHeader::SetDataFATStart( sal_Int32 n )
{
- if( n != nDataFAT ) bDirty = TRUE, nDataFAT = n;
+ if( n != nDataFAT ) bDirty = sal_True, nDataFAT = n;
}
-void StgHeader::SetDataFATSize( INT32 n )
+void StgHeader::SetDataFATSize( sal_Int32 n )
{
- if( n != nDataFATSize ) bDirty = TRUE, nDataFATSize = n;
+ if( n != nDataFATSize ) bDirty = sal_True, nDataFATSize = n;
}
-void StgHeader::SetFATSize( INT32 n )
+void StgHeader::SetFATSize( sal_Int32 n )
{
- if( n != nFATSize ) bDirty = TRUE, nFATSize = n;
+ if( n != nFATSize ) bDirty = sal_True, nFATSize = n;
}
-void StgHeader::SetFATChain( INT32 n )
+void StgHeader::SetFATChain( sal_Int32 n )
{
if( n != nMasterChain )
- bDirty = TRUE, nMasterChain = n;
+ bDirty = sal_True, nMasterChain = n;
}
-void StgHeader::SetMasters( INT32 n )
+void StgHeader::SetMasters( sal_Int32 n )
{
- if( n != nMaster ) bDirty = TRUE, nMaster = n;
+ if( n != nMaster ) bDirty = sal_True, nMaster = n;
}
///////////////////////////// class StgEntry /////////////////////////////
@@ -238,11 +238,11 @@ void ToUnicode_Impl( String& rName )
rName.Erase( 32 );
rName.Convert( ::GetSystemCharSet(), CHARSET_ANSI );
// brute force is OK
- BYTE* p = (BYTE*) rName.GetCharStr();
- for( USHORT i = 0; i < rName.Len(); i++, p++ )
+ sal_uInt8* p = (sal_uInt8*) rName.GetCharStr();
+ for( sal_uInt16 i = 0; i < rName.Len(); i++, p++ )
{
// check each character and substitute blanks for illegal ones
- BYTE cChar = *p;
+ sal_uInt8 cChar = *p;
if( cChar == '!' || cChar == ':' || cChar == '\\' || cChar == '/' )
*p = ' ';
}
@@ -254,14 +254,14 @@ static void FromUnicode( String& rName )
rName.Convert( CHARSET_ANSI, ::GetSystemCharSet() );
}
*/
-BOOL StgEntry::Init()
+sal_Bool StgEntry::Init()
{
memset( this, 0, sizeof (StgEntry) - sizeof( String ) );
SetLeaf( STG_LEFT, STG_FREE );
SetLeaf( STG_RIGHT, STG_FREE );
SetLeaf( STG_CHILD, STG_FREE );
SetLeaf( STG_DATA, STG_EOF );
- return TRUE;
+ return sal_True;
}
static String ToUpperUnicode( const String & rStr )
@@ -279,7 +279,7 @@ static String ToUpperUnicode( const String & rStr )
}
-BOOL StgEntry::SetName( const String& rName )
+sal_Bool StgEntry::SetName( const String& rName )
{
// I don't know the locale, so en_US is hopefully fine
aName = ToUpperUnicode( rName );
@@ -291,12 +291,12 @@ BOOL StgEntry::SetName( const String& rName )
while( i < 32 )
nName[ i++ ] = 0;
nNameLen = ( aName.Len() + 1 ) << 1;
- return TRUE;
+ return sal_True;
}
-INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const
+sal_Int32 StgEntry::GetLeaf( StgEntryRef eRef ) const
{
- INT32 n = -1;
+ sal_Int32 n = -1;
switch( eRef )
{
case STG_LEFT: n = nLeft; break;
@@ -307,7 +307,7 @@ INT32 StgEntry::GetLeaf( StgEntryRef eRef ) const
return n;
}
-void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage )
+void StgEntry::SetLeaf( StgEntryRef eRef, sal_Int32 nPage )
{
switch( eRef )
{
@@ -318,12 +318,12 @@ void StgEntry::SetLeaf( StgEntryRef eRef, INT32 nPage )
}
}
-const INT32* StgEntry::GetTime( StgEntryTime eTime ) const
+const sal_Int32* StgEntry::GetTime( StgEntryTime eTime ) const
{
return( eTime == STG_MODIFIED ) ? nMtime : nAtime;
}
-void StgEntry::SetTime( StgEntryTime eTime, INT32* pTime )
+void StgEntry::SetTime( StgEntryTime eTime, sal_Int32* pTime )
{
if( eTime == STG_MODIFIED )
nMtime[ 0 ] = *pTime++, nMtime[ 1 ] = *pTime;
@@ -338,7 +338,7 @@ void StgEntry::SetClassId( const ClsId& r )
void StgEntry::GetName( String& rName ) const
{
- UINT16 n = nNameLen;
+ sal_uInt16 n = nNameLen;
if( n )
n = ( n >> 1 ) - 1;
rName = String( nName, n );
@@ -363,7 +363,7 @@ short StgEntry::Compare( const StgEntry& r ) const
// These load/store operations are a bit more complicated,
// since they have to copy their contents into a packed structure.
-BOOL StgEntry::Load( const void* pFrom )
+sal_Bool StgEntry::Load( const void* pFrom )
{
SvMemoryStream r( (sal_Char*) pFrom, 128, STREAM_READ );
for( short i = 0; i < 32; i++ )
@@ -384,14 +384,14 @@ BOOL StgEntry::Load( const void* pFrom )
>> nSize // 78 file size
>> nUnknown; // 7C unknown
- UINT16 n = nNameLen;
+ sal_uInt16 n = nNameLen;
if( n )
n = ( n >> 1 ) - 1;
if( n > 31 || (nSize < 0 && cType != STG_STORAGE) )
{
// the size makes no sence for the substorage
// TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
- return FALSE;
+ return sal_False;
}
aName = String( nName, n );
@@ -399,7 +399,7 @@ BOOL StgEntry::Load( const void* pFrom )
aName = ToUpperUnicode( aName );
aName.Erase( 31 );
- return TRUE;
+ return sal_True;
}
void StgEntry::Store( void* pTo )
diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx
index 314852e3dd06..7ef8c4772f36 100644
--- a/sot/source/sdstor/stgelem.hxx
+++ b/sot/source/sdstor/stgelem.hxx
@@ -34,7 +34,7 @@
#include <tools/solar.h>
-#include <stg.hxx>
+#include <sot/stg.hxx>
class StgIo;
class SvStream;
@@ -45,51 +45,51 @@ SvStream& operator<<( SvStream&, const ClsId& );
class StgHeader
{
- BYTE cSignature[ 8 ]; // 00 signature (see below)
+ sal_uInt8 cSignature[ 8 ]; // 00 signature (see below)
ClsId aClsId; // 08 Class ID
- INT32 nVersion; // 18 version number
- UINT16 nByteOrder; // 1C Unicode byte order indicator
- INT16 nPageSize; // 1E 1 << nPageSize = block size
- INT16 nDataPageSize; // 20 1 << this size == data block size
- BYTE bDirty; // 22 internal dirty flag
- BYTE cReserved[ 9 ]; // 23
- INT32 nFATSize; // 2C total number of FAT pages
- INT32 nTOCstrm; // 30 starting page for the TOC stream
- INT32 nReserved; // 34
- INT32 nThreshold; // 38 minimum file size for big data
- INT32 nDataFAT; // 3C page # of 1st data FAT block
- INT32 nDataFATSize; // 40 # of data fat blocks
- INT32 nMasterChain; // 44 chain to the next master block
- INT32 nMaster; // 48 # of additional master blocks
- INT32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages
+ sal_Int32 nVersion; // 18 version number
+ sal_uInt16 nByteOrder; // 1C Unicode byte order indicator
+ sal_Int16 nPageSize; // 1E 1 << nPageSize = block size
+ sal_Int16 nDataPageSize; // 20 1 << this size == data block size
+ sal_uInt8 bDirty; // 22 internal dirty flag
+ sal_uInt8 cReserved[ 9 ]; // 23
+ sal_Int32 nFATSize; // 2C total number of FAT pages
+ sal_Int32 nTOCstrm; // 30 starting page for the TOC stream
+ sal_Int32 nReserved; // 34
+ sal_Int32 nThreshold; // 38 minimum file size for big data
+ sal_Int32 nDataFAT; // 3C page # of 1st data FAT block
+ sal_Int32 nDataFATSize; // 40 # of data fat blocks
+ sal_Int32 nMasterChain; // 44 chain to the next master block
+ sal_Int32 nMaster; // 48 # of additional master blocks
+ sal_Int32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages
public:
StgHeader();
void Init(); // initialize the header
- BOOL Load( StgIo& );
- BOOL Load( SvStream& );
- BOOL Store( StgIo& );
- BOOL Check(); // check the signature and version
+ sal_Bool Load( StgIo& );
+ sal_Bool Load( SvStream& );
+ sal_Bool Store( StgIo& );
+ sal_Bool Check(); // check the signature and version
short GetByteOrder() const { return nByteOrder; }
- INT32 GetTOCStart() const { return nTOCstrm; }
- void SetTOCStart( INT32 n );
- INT32 GetDataFATStart() const { return nDataFAT; }
- void SetDataFATStart( INT32 n );
- INT32 GetDataFATSize() const { return nDataFATSize; }
- void SetDataFATSize( INT32 n );
- INT32 GetThreshold() const { return nThreshold; }
+ sal_Int32 GetTOCStart() const { return nTOCstrm; }
+ void SetTOCStart( sal_Int32 n );
+ sal_Int32 GetDataFATStart() const { return nDataFAT; }
+ void SetDataFATStart( sal_Int32 n );
+ sal_Int32 GetDataFATSize() const { return nDataFATSize; }
+ void SetDataFATSize( sal_Int32 n );
+ sal_Int32 GetThreshold() const { return nThreshold; }
short GetPageSize() const { return nPageSize; }
short GetDataPageSize() const { return nDataPageSize; }
- INT32 GetFATSize() const { return nFATSize; }
- void SetFATSize( INT32 n );
- INT32 GetFATChain() const { return nMasterChain; }
- void SetFATChain( INT32 n );
- INT32 GetMasters() const { return nMaster; }
- void SetMasters( INT32 n );
+ sal_Int32 GetFATSize() const { return nFATSize; }
+ void SetFATSize( sal_Int32 n );
+ sal_Int32 GetFATChain() const { return nMasterChain; }
+ void SetFATChain( sal_Int32 n );
+ sal_Int32 GetMasters() const { return nMaster; }
+ void SetMasters( sal_Int32 n );
short GetFAT1Size() const { return 109; }
const ClsId& GetClassId() const { return aClsId; }
void SetClassId( const ClsId& );
- INT32 GetFATPage( short ) const;
- void SetFATPage( short, INT32 );
+ sal_Int32 GetFATPage( short ) const;
+ void SetFATPage( short, sal_Int32 );
};
enum StgEntryType { // dir entry types:
@@ -118,42 +118,42 @@ class StgStream;
#define STGENTRY_SIZE 128
class StgEntry { // directory enty
- UINT16 nName[ 32 ]; // 00 name as WCHAR
- INT16 nNameLen; // 40 size of name in bytes including 00H
- BYTE cType; // 42 entry type
- BYTE cFlags; // 43 0 or 1 (tree balance?)
- INT32 nLeft; // 44 left node entry
- INT32 nRight; // 48 right node entry
- INT32 nChild; // 4C 1st child entry if storage
+ sal_uInt16 nName[ 32 ]; // 00 name as WCHAR
+ sal_Int16 nNameLen; // 40 size of name in bytes including 00H
+ sal_uInt8 cType; // 42 entry type
+ sal_uInt8 cFlags; // 43 0 or 1 (tree balance?)
+ sal_Int32 nLeft; // 44 left node entry
+ sal_Int32 nRight; // 48 right node entry
+ sal_Int32 nChild; // 4C 1st child entry if storage
ClsId aClsId; // 50 class ID (optional)
- INT32 nFlags; // 60 state flags(?)
- INT32 nMtime[ 2 ]; // 64 modification time
- INT32 nAtime[ 2 ]; // 6C creation and access time
- INT32 nPage1; // 74 starting block (either direct or translated)
- INT32 nSize; // 78 file size
- INT32 nUnknown; // 7C unknown
+ sal_Int32 nFlags; // 60 state flags(?)
+ sal_Int32 nMtime[ 2 ]; // 64 modification time
+ sal_Int32 nAtime[ 2 ]; // 6C creation and access time
+ sal_Int32 nPage1; // 74 starting block (either direct or translated)
+ sal_Int32 nSize; // 78 file size
+ sal_Int32 nUnknown; // 7C unknown
String aName; // Name as Compare String (ascii, upper)
public:
- BOOL Init(); // initialize the data
- BOOL SetName( const String& ); // store a name (ASCII, up to 32 chars)
+ sal_Bool Init(); // initialize the data
+ sal_Bool SetName( const String& ); // store a name (ASCII, up to 32 chars)
void GetName( String& rName ) const;
// fill in the name
short Compare( const StgEntry& ) const; // compare two entries
- BOOL Load( const void* );
+ sal_Bool Load( const void* );
void Store( void* );
StgEntryType GetType() const { return (StgEntryType) cType; }
- INT32 GetStartPage() const { return nPage1; }
- void SetType( StgEntryType t ) { cType = (BYTE) t; }
- BYTE GetFlags() const { return cFlags; }
- void SetFlags( BYTE c ) { cFlags = c; }
- INT32 GetSize() const { return nSize; }
- void SetSize( INT32 n ) { nSize = n; }
+ sal_Int32 GetStartPage() const { return nPage1; }
+ void SetType( StgEntryType t ) { cType = (sal_uInt8) t; }
+ sal_uInt8 GetFlags() const { return cFlags; }
+ void SetFlags( sal_uInt8 c ) { cFlags = c; }
+ sal_Int32 GetSize() const { return nSize; }
+ void SetSize( sal_Int32 n ) { nSize = n; }
const ClsId& GetClassId() const { return aClsId; }
void SetClassId( const ClsId& );
- INT32 GetLeaf( StgEntryRef ) const;
- void SetLeaf( StgEntryRef, INT32 );
- const INT32* GetTime( StgEntryTime ) const;
- void SetTime( StgEntryTime, INT32* );
+ sal_Int32 GetLeaf( StgEntryRef ) const;
+ void SetLeaf( StgEntryRef, sal_Int32 );
+ const sal_Int32* GetTime( StgEntryTime ) const;
+ void SetTime( StgEntryTime, sal_Int32* );
};
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 6b5972e4ef98..654f456c5e10 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sot.hxx"
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
@@ -47,7 +47,7 @@ StgIo::StgIo() : StgCache()
pDataFAT = NULL;
pDataStrm = NULL;
pFAT = NULL;
- bCopied = FALSE;
+ bCopied = sal_False;
}
StgIo::~StgIo()
@@ -60,7 +60,7 @@ StgIo::~StgIo()
// Load the header. Do not set an error code if the header is invalid.
-BOOL StgIo::Load()
+sal_Bool StgIo::Load()
{
if( pStrm )
{
@@ -69,7 +69,7 @@ BOOL StgIo::Load()
if( aHdr.Check() )
SetupStreams();
else
- return FALSE;
+ return sal_False;
}
}
return Good();
@@ -77,7 +77,7 @@ BOOL StgIo::Load()
// Set up an initial, empty storage
-BOOL StgIo::Init()
+sal_Bool StgIo::Init()
{
aHdr.Init();
SetupStreams();
@@ -123,7 +123,7 @@ short StgIo::GetDataPageSize()
// Commit everything
-BOOL StgIo::CommitAll()
+sal_Bool StgIo::CommitAll()
{
// Store the data (all streams and the TOC)
if( pTOC->Store() )
@@ -136,81 +136,81 @@ BOOL StgIo::CommitAll()
if( aHdr.Store( *this ) )
{
pStrm->Flush();
- ULONG n = pStrm->GetError();
+ sal_uLong n = pStrm->GetError();
SetError( n );
#ifdef DBG_UTIL
if( n==0 ) ValidateFATs();
#endif
- return BOOL( n == 0 );
+ return sal_Bool( n == 0 );
}
}
}
SetError( SVSTREAM_WRITE_ERROR );
- return FALSE;
+ return sal_False;
}
class EasyFat
{
- INT32 *pFat;
- BOOL *pFree;
- INT32 nPages;
- INT32 nPageSize;
+ sal_Int32 *pFat;
+ sal_Bool *pFree;
+ sal_Int32 nPages;
+ sal_Int32 nPageSize;
public:
- EasyFat( StgIo & rIo, StgStrm *pFatStream, INT32 nPSize );
+ EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize );
~EasyFat() { delete[] pFat; delete[] pFree; }
- INT32 GetPageSize() { return nPageSize; }
- INT32 Count() { return nPages; }
- INT32 operator[]( INT32 nOffset ) { return pFat[ nOffset ]; }
+ sal_Int32 GetPageSize() { return nPageSize; }
+ sal_Int32 Count() { return nPages; }
+ sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; }
- ULONG Mark( INT32 nPage, INT32 nCount, INT32 nExpect );
- BOOL HasUnrefChains();
+ sal_uLong Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect );
+ sal_Bool HasUnrefChains();
};
-EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, INT32 nPSize )
+EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize )
{
nPages = pFatStream->GetSize() >> 2;
nPageSize = nPSize;
- pFat = new INT32[ nPages ];
- pFree = new BOOL[ nPages ];
+ pFat = new sal_Int32[ nPages ];
+ pFree = new sal_Bool[ nPages ];
StgPage *pPage = NULL;
- INT32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2;
+ sal_Int32 nFatPageSize = (1 << rIo.aHdr.GetPageSize()) - 2;
- for( INT32 nPage = 0; nPage < nPages; nPage++ )
+ for( sal_Int32 nPage = 0; nPage < nPages; nPage++ )
{
if( ! (nPage % nFatPageSize) )
{
pFatStream->Pos2Page( nPage << 2 );
- INT32 nPhysPage = pFatStream->GetPage();
- pPage = rIo.Get( nPhysPage, TRUE );
+ sal_Int32 nPhysPage = pFatStream->GetPage();
+ pPage = rIo.Get( nPhysPage, sal_True );
}
pFat[ nPage ] = pPage->GetPage( short( nPage % nFatPageSize ) );
- pFree[ nPage ] = TRUE;
+ pFree[ nPage ] = sal_True;
}
}
-BOOL EasyFat::HasUnrefChains()
+sal_Bool EasyFat::HasUnrefChains()
{
- for( INT32 nPage = 0; nPage < nPages; nPage++ )
+ for( sal_Int32 nPage = 0; nPage < nPages; nPage++ )
{
if( pFree[ nPage ] && pFat[ nPage ] != -1 )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect )
+sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect )
{
if( nCount > 0 )
--nCount /= GetPageSize(), nCount++;
- INT32 nCurPage = nPage;
+ sal_Int32 nCurPage = nPage;
while( nCount != 0 )
{
- pFree[ nCurPage ] = FALSE;
+ pFree[ nCurPage ] = sal_False;
nCurPage = pFat[ nCurPage ];
//Stream zu lang
if( nCurPage != nExpect && nCount == 1 )
@@ -232,22 +232,22 @@ ULONG EasyFat::Mark( INT32 nPage, INT32 nCount, INT32 nExpect )
class Validator
{
- ULONG nError;
+ sal_uLong nError;
EasyFat aSmallFat;
EasyFat aFat;
StgIo &rIo;
- ULONG ValidateMasterFATs();
- ULONG ValidateDirectoryEntries();
- ULONG FindUnrefedChains();
- ULONG MarkAll( StgDirEntry *pEntry );
+ sal_uLong ValidateMasterFATs();
+ sal_uLong ValidateDirectoryEntries();
+ sal_uLong FindUnrefedChains();
+ sal_uLong MarkAll( StgDirEntry *pEntry );
public:
Validator( StgIo &rIo );
- BOOL IsError() { return nError != 0; }
+ sal_Bool IsError() { return nError != 0; }
};
Validator::Validator( StgIo &rIoP )
@@ -255,7 +255,7 @@ Validator::Validator( StgIo &rIoP )
aFat( rIoP, rIoP.pFAT, 1 << rIoP.aHdr.GetPageSize() ),
rIo( rIoP )
{
- ULONG nErr = nError = FAT_OK;
+ sal_uLong nErr = nError = FAT_OK;
if( ( nErr = ValidateMasterFATs() ) != FAT_OK )
nError = nErr;
@@ -265,13 +265,13 @@ Validator::Validator( StgIo &rIoP )
nError = nErr;
}
-ULONG Validator::ValidateMasterFATs()
+sal_uLong Validator::ValidateMasterFATs()
{
- INT32 nCount = rIo.aHdr.GetFATSize();
- ULONG nErr;
- for( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = rIo.aHdr.GetFATSize();
+ sal_uLong nErr;
+ for( sal_Int32 i = 0; i < nCount; i++ )
{
- if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), FALSE ), aFat.GetPageSize(), -3 )) != FAT_OK )
+ if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK )
return nErr;
}
if( rIo.aHdr.GetMasters() )
@@ -280,10 +280,10 @@ ULONG Validator::ValidateMasterFATs()
return FAT_OK;
}
-ULONG Validator::MarkAll( StgDirEntry *pEntry )
+sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
{
StgIterator aIter( *pEntry );
- ULONG nErr = FAT_OK;
+ sal_uLong nErr = FAT_OK;
for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() )
{
if( p->aEntry.GetType() == STG_STORAGE )
@@ -294,7 +294,7 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry )
}
else
{
- INT32 nSize = p->aEntry.GetSize();
+ sal_Int32 nSize = p->aEntry.GetSize();
if( nSize < rIo.aHdr.GetThreshold() )
nErr = aSmallFat.Mark( p->aEntry.GetStartPage(),nSize, -2 );
else
@@ -306,10 +306,10 @@ ULONG Validator::MarkAll( StgDirEntry *pEntry )
return FAT_OK;
}
-ULONG Validator::ValidateDirectoryEntries()
+sal_uLong Validator::ValidateDirectoryEntries()
{
// Normale DirEntries
- ULONG nErr = MarkAll( rIo.pTOC->GetRoot() );
+ sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() );
if( nErr != FAT_OK )
return nErr;
// Small Data
@@ -329,7 +329,7 @@ ULONG Validator::ValidateDirectoryEntries()
return nErr;
}
-ULONG Validator::FindUnrefedChains()
+sal_uLong Validator::FindUnrefedChains()
{
if( aSmallFat.HasUnrefChains() ||
aFat.HasUnrefChains() )
@@ -350,12 +350,12 @@ const Link& StgIo::GetErrorLink()
return ErrorLink::get();
}
-ULONG StgIo::ValidateFATs()
+sal_uLong StgIo::ValidateFATs()
{
if( bFile )
{
Validator *pV = new Validator( *this );
- BOOL bRet1 = !pV->IsError(), bRet2 = TRUE ;
+ sal_Bool bRet1 = !pV->IsError(), bRet2 = sal_True ;
delete pV;
SvFileStream *pFileStrm = ( SvFileStream *) GetStrm();
StgIo aIo;
@@ -368,7 +368,7 @@ ULONG StgIo::ValidateFATs()
delete pV;
}
- ULONG nErr;
+ sal_uLong nErr;
if( bRet1 != bRet2 )
nErr = bRet1 ? FAT_ONFILEERROR : FAT_INMEMORYERROR;
else nErr = bRet1 ? FAT_OK : FAT_BOTHERROR;
@@ -378,7 +378,7 @@ ULONG StgIo::ValidateFATs()
aArg.aFile = pFileStrm->GetFileName();
aArg.nErr = nErr;
ErrorLink::get().Call( &aArg );
- bCopied = TRUE;
+ bCopied = sal_True;
}
// DBG_ASSERT( nErr == FAT_OK ,"Storage kaputt");
return nErr;
diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx
index d307eb6454af..91c32c7f0e1b 100644
--- a/sot/source/sdstor/stgio.hxx
+++ b/sot/source/sdstor/stgio.hxx
@@ -54,12 +54,12 @@ enum FAT_ERROR
struct StgLinkArg
{
String aFile;
- ULONG nErr;
+ sal_uLong nErr;
};
class StgIo : public StgCache {
void SetupStreams(); // load all internal streams
- BOOL bCopied;
+ sal_Bool bCopied;
public:
StgIo();
~StgIo();
@@ -69,13 +69,13 @@ public:
StgDataStrm* pDataFAT; // small data FAT stream
StgDataStrm* pDataStrm; // small data stream
short GetDataPageSize(); // get the logical data page size
- BOOL Load(); // load a storage file
- BOOL Init(); // set up an empty file
- BOOL CommitAll(); // commit everything (root commit)
+ sal_Bool Load(); // load a storage file
+ sal_Bool Init(); // set up an empty file
+ sal_Bool CommitAll(); // commit everything (root commit)
static void SetErrorLink( const Link& );
static const Link& GetErrorLink();
- ULONG ValidateFATs( );
+ sal_uLong ValidateFATs( );
};
#endif
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index c6604376f1fd..8ae6af18f7b7 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -32,7 +32,7 @@
#include "rtl/string.h"
#include "rtl/string.h"
#include "stgole.hxx"
-#include "storinfo.hxx" // Read/WriteClipboardFormat()
+#include "sot/storinfo.hxx" // Read/WriteClipboardFormat()
#include <tools/debug.hxx>
#if defined(_MSC_VER) && (_MSC_VER>=1400)
@@ -41,10 +41,10 @@
///////////////////////// class StgInternalStream ////////////////////////
StgInternalStream::StgInternalStream
- ( BaseStorage& rStg, const String& rName, BOOL bWr )
+ ( BaseStorage& rStg, const String& rName, sal_Bool bWr )
{
- bIsWritable = TRUE;
- USHORT nMode = bWr
+ bIsWritable = sal_True;
+ sal_uInt16 nMode = bWr
? STREAM_WRITE | STREAM_SHARE_DENYALL
: STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE;
pStrm = rStg.OpenStream( rName, nMode );
@@ -59,7 +59,7 @@ StgInternalStream::~StgInternalStream()
delete pStrm;
}
-ULONG StgInternalStream::GetData( void* pData, ULONG nSize )
+sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize )
{
if( pStrm )
{
@@ -71,7 +71,7 @@ ULONG StgInternalStream::GetData( void* pData, ULONG nSize )
return 0;
}
-ULONG StgInternalStream::PutData( const void* pData, ULONG nSize )
+sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize )
{
if( pStrm )
{
@@ -83,7 +83,7 @@ ULONG StgInternalStream::PutData( const void* pData, ULONG nSize )
return 0;
}
-ULONG StgInternalStream::SeekPos( ULONG nPos )
+sal_uLong StgInternalStream::SeekPos( sal_uLong nPos )
{
return pStrm ? pStrm->Seek( nPos ) : 0;
}
@@ -105,32 +105,32 @@ void StgInternalStream::Commit()
///////////////////////// class StgCompObjStream /////////////////////////
-StgCompObjStream::StgCompObjStream( BaseStorage& rStg, BOOL bWr )
+StgCompObjStream::StgCompObjStream( BaseStorage& rStg, sal_Bool bWr )
: StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1CompObj" ) ), bWr )
{
memset( &aClsId, 0, sizeof( ClsId ) );
nCbFormat = 0;
}
-BOOL StgCompObjStream::Load()
+sal_Bool StgCompObjStream::Load()
{
memset( &aClsId, 0, sizeof( ClsId ) );
nCbFormat = 0;
aUserName.Erase();
if( GetError() != SVSTREAM_OK )
- return FALSE;
+ return sal_False;
Seek( 8L ); // skip the first part
- INT32 nMarker = 0;
+ sal_Int32 nMarker = 0;
*this >> nMarker;
if( nMarker == -1L )
{
*this >> aClsId;
- INT32 nLen1 = 0;
+ sal_Int32 nLen1 = 0;
*this >> nLen1;
// higher bits are ignored
nLen1 &= 0xFFFF;
- sal_Char* p = new sal_Char[ (USHORT) nLen1 ];
- if( Read( p, nLen1 ) == (ULONG) nLen1 )
+ sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ];
+ if( Read( p, nLen1 ) == (sal_uLong) nLen1 )
{
//The encoding here is "ANSI", which is pretty useless seeing as
//the actual codepage used doesn't seem to be specified/stored
@@ -145,60 +145,60 @@ BOOL StgCompObjStream::Load()
SetError( SVSTREAM_GENERALERROR );
delete [] p;
}
- return BOOL( GetError() == SVSTREAM_OK );
+ return sal_Bool( GetError() == SVSTREAM_OK );
}
-BOOL StgCompObjStream::Store()
+sal_Bool StgCompObjStream::Store()
{
if( GetError() != SVSTREAM_OK )
- return FALSE;
+ return sal_False;
Seek( 0L );
ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_MS_1252 );
- *this << (INT16) 1 // Version?
- << (INT16) -2 // 0xFFFE = Byte Order Indicator
- << (INT32) 0x0A03 // Windows 3.10
- << (INT32) -1L
+ *this << (sal_Int16) 1 // Version?
+ << (sal_Int16) -2 // 0xFFFE = Byte Order Indicator
+ << (sal_Int32) 0x0A03 // Windows 3.10
+ << (sal_Int32) -1L
<< aClsId // Class ID
- << (INT32) (aAsciiUserName.Len() + 1)
+ << (sal_Int32) (aAsciiUserName.Len() + 1)
<< (const char *)aAsciiUserName.GetBuffer()
- << (UINT8) 0; // string terminator
+ << (sal_uInt8) 0; // string terminator
WriteClipboardFormat( *this, nCbFormat );
- *this << (INT32) 0; // terminator
+ *this << (sal_Int32) 0; // terminator
Commit();
- return BOOL( GetError() == SVSTREAM_OK );
+ return sal_Bool( GetError() == SVSTREAM_OK );
}
/////////////////////////// class StgOleStream ///////////////////////////
-StgOleStream::StgOleStream( BaseStorage& rStg, BOOL bWr )
+StgOleStream::StgOleStream( BaseStorage& rStg, sal_Bool bWr )
: StgInternalStream( rStg, String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole" ) ), bWr )
{
nFlags = 0;
}
-BOOL StgOleStream::Load()
+sal_Bool StgOleStream::Load()
{
nFlags = 0;
if( GetError() != SVSTREAM_OK )
- return FALSE;
- INT32 version = 0;
+ return sal_False;
+ sal_Int32 version = 0;
Seek( 0L );
*this >> version >> nFlags;
- return BOOL( GetError() == SVSTREAM_OK );
+ return sal_Bool( GetError() == SVSTREAM_OK );
}
-BOOL StgOleStream::Store()
+sal_Bool StgOleStream::Store()
{
if( GetError() != SVSTREAM_OK )
- return FALSE;
+ return sal_False;
Seek( 0L );
- *this << (INT32) 0x02000001 // OLE version, format
- << (INT32) nFlags // Object flags
- << (INT32) 0 // Update Options
- << (INT32) 0 // reserved
- << (INT32) 0; // Moniker 1
+ *this << (sal_Int32) 0x02000001 // OLE version, format
+ << (sal_Int32) nFlags // Object flags
+ << (sal_Int32) 0 // Update Options
+ << (sal_Int32) 0 // reserved
+ << (sal_Int32) 0; // Moniker 1
Commit();
- return BOOL( GetError() == SVSTREAM_OK );
+ return sal_Bool( GetError() == SVSTREAM_OK );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx
index 7883ac7fa1c9..bf936b6ad734 100644
--- a/sot/source/sdstor/stgole.hxx
+++ b/sot/source/sdstor/stgole.hxx
@@ -31,18 +31,18 @@
#include <string.h> // memset()
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
class StgInternalStream : public SvStream
{
BaseStorageStream* pStrm;
- virtual ULONG GetData( void* pData, ULONG nSize );
- virtual ULONG PutData( const void* pData, ULONG nSize );
- virtual ULONG SeekPos( ULONG nPos );
+ virtual sal_uLong GetData( void* pData, sal_uLong nSize );
+ virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
+ virtual sal_uLong SeekPos( sal_uLong nPos );
virtual void FlushData();
public:
- StgInternalStream( BaseStorage&, const String&, BOOL );
+ StgInternalStream( BaseStorage&, const String&, sal_Bool );
~StgInternalStream();
void Commit();
};
@@ -53,14 +53,14 @@ class StgCompObjStream : public StgInternalStream
{
ClsId aClsId;
String aUserName;
- ULONG nCbFormat;
+ sal_uLong nCbFormat;
public:
- StgCompObjStream( BaseStorage&, BOOL );
+ StgCompObjStream( BaseStorage&, sal_Bool );
ClsId& GetClsId() { return aClsId; }
String& GetUserName() { return aUserName; }
- ULONG& GetCbFormat() { return nCbFormat; }
- BOOL Load();
- BOOL Store();
+ sal_uLong& GetCbFormat() { return nCbFormat; }
+ sal_Bool Load();
+ sal_Bool Store();
};
// standard stream "\1Ole"
@@ -69,10 +69,10 @@ class StgOleStream : public StgInternalStream
{
sal_uInt32 nFlags;
public:
- StgOleStream( BaseStorage&, BOOL );
+ StgOleStream( BaseStorage&, sal_Bool );
sal_uInt32& GetFlags() { return nFlags; }
- BOOL Load();
- BOOL Store();
+ sal_Bool Load();
+ sal_Bool Store();
};
#endif
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index a9275e307fc6..fe40be155b9e 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -35,28 +35,22 @@
#include <tools/tempfile.hxx>
#include <tools/debug.hxx>
-#include "stg.hxx"
+#include "sot/stg.hxx"
#include "stgelem.hxx"
#include "stgcache.hxx"
#include "stgstrms.hxx"
#include "stgdir.hxx"
#include "stgio.hxx"
-#if defined(W31)
- #include <tools/svwin.h>
- #define memcpy hmemcpy
- #define __HUGE _huge
-#else
- #define __HUGE
-#endif
+#define __HUGE
///////////////////////////// class StgFAT ///////////////////////////////
// The FAT class performs FAT operations on an underlying storage stream.
-// This stream is either the master FAT stream (m == TRUE ) or a normal
+// This stream is either the master FAT stream (m == sal_True ) or a normal
// storage stream, which then holds the FAT for small data allocations.
-StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r )
+StgFAT::StgFAT( StgStrm& r, sal_Bool m ) : rStrm( r )
{
bPhys = m;
nPageSize = rStrm.GetIo().GetPhysPageSize();
@@ -68,7 +62,7 @@ StgFAT::StgFAT( StgStrm& r, BOOL m ) : rStrm( r )
// Retrieve the physical page for a given byte offset.
-StgPage* StgFAT::GetPhysPage( INT32 nByteOff )
+StgPage* StgFAT::GetPhysPage( sal_Int32 nByteOff )
{
StgPage* pPg = NULL;
// Position within the underlying stream
@@ -76,16 +70,16 @@ StgPage* StgFAT::GetPhysPage( INT32 nByteOff )
if( rStrm.Pos2Page( nByteOff ) )
{
nOffset = rStrm.GetOffset();
- INT32 nPhysPage = rStrm.GetPage();
+ sal_Int32 nPhysPage = rStrm.GetPage();
// get the physical page (must be present)
- pPg = rStrm.GetIo().Get( nPhysPage, TRUE );
+ pPg = rStrm.GetIo().Get( nPhysPage, sal_True );
}
return pPg;
}
// Get the follow page for a certain FAT page.
-INT32 StgFAT::GetNextPage( INT32 nPg )
+sal_Int32 StgFAT::GetNextPage( sal_Int32 nPg )
{
if( nPg >= 0 )
{
@@ -101,16 +95,16 @@ INT32 StgFAT::GetNextPage( INT32 nPg )
// underlying stream size. It is treated as a recommendation
// to abort the search to inhibit excessive file growth.
-INT32 StgFAT::FindBlock( INT32& nPgs )
+sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
{
- INT32 nMinStart = STG_EOF, nMinLen = 0;
- INT32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL;
- INT32 nTmpStart = STG_EOF, nTmpLen = 0;
- INT32 nPages = rStrm.GetSize() >> 2;
- BOOL bFound = FALSE;
+ sal_Int32 nMinStart = STG_EOF, nMinLen = 0;
+ sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL;
+ sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0;
+ sal_Int32 nPages = rStrm.GetSize() >> 2;
+ sal_Bool bFound = sal_False;
StgPage* pPg = NULL;
short nEntry = 0;
- for( INT32 i = 0; i < nPages; i++, nEntry++ )
+ for( sal_Int32 i = 0; i < nPages; i++, nEntry++ )
{
if( !( nEntry % nEntries ) )
{
@@ -120,7 +114,7 @@ INT32 StgFAT::FindBlock( INT32& nPgs )
if( !pPg )
return STG_EOF;
}
- INT32 nCur = pPg->GetPage( nEntry );
+ sal_Int32 nCur = pPg->GetPage( nEntry );
if( nCur == STG_FREE )
{
// count the size of this area
@@ -138,12 +132,12 @@ INT32 StgFAT::FindBlock( INT32& nPgs )
{
if( nTmpLen > nPgs && nTmpLen < nMaxLen )
// block > requested size
- nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = TRUE;
+ nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = sal_True;
else if( nTmpLen >= nMinLen )
{
// block < requested size
nMinLen = nTmpLen, nMinStart = nTmpStart;
- bFound = TRUE;
+ bFound = sal_True;
if( nTmpLen == nPgs )
break;
}
@@ -164,8 +158,8 @@ INT32 StgFAT::FindBlock( INT32& nPgs )
if( nMinStart != STG_EOF && nMaxStart != STG_EOF )
{
// two areas found; return the best fit area
- INT32 nMinDiff = nPgs - nMinLen;
- INT32 nMaxDiff = nMaxLen - nPgs;
+ sal_Int32 nMinDiff = nPgs - nMinLen;
+ sal_Int32 nMaxDiff = nMaxLen - nPgs;
if( nMinDiff > nMaxDiff )
nMinStart = STG_EOF;
}
@@ -181,19 +175,19 @@ INT32 StgFAT::FindBlock( INT32& nPgs )
// Set up the consecutive chain for a given block.
-BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs )
+sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs )
{
- INT32 nPos = nStart << 2;
+ sal_Int32 nPos = nStart << 2;
StgPage* pPg = GetPhysPage( nPos );
if( !pPg || !nPgs )
- return FALSE;
+ return sal_False;
while( --nPgs )
{
if( nOffset >= nPageSize )
{
pPg = GetPhysPage( nPos );
if( !pPg )
- return FALSE;
+ return sal_False;
}
pPg->SetPage( nOffset >> 2, ++nStart );
nOffset += 4;
@@ -203,22 +197,22 @@ BOOL StgFAT::MakeChain( INT32 nStart, INT32 nPgs )
{
pPg = GetPhysPage( nPos );
if( !pPg )
- return FALSE;
+ return sal_False;
}
pPg->SetPage( nOffset >> 2, STG_EOF );
- return TRUE;
+ return sal_True;
}
// Allocate a block of data from the given page number on.
// It the page number is != STG_EOF, chain the block.
-INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs )
+sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
{
- INT32 nOrig = nBgn;
- INT32 nLast = nBgn;
- INT32 nBegin = STG_EOF;
- INT32 nAlloc;
- INT32 nPages = rStrm.GetSize() >> 2;
+ sal_Int32 nOrig = nBgn;
+ sal_Int32 nLast = nBgn;
+ sal_Int32 nBegin = STG_EOF;
+ sal_Int32 nAlloc;
+ sal_Int32 nPages = rStrm.GetSize() >> 2;
short nPasses = 0;
// allow for two passes
while( nPasses < 2 )
@@ -254,7 +248,7 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs )
if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) )
return STG_EOF;
if( !bPhys && !InitNew( nPages ) )
- return FALSE;
+ return sal_False;
nPages = rStrm.GetSize() >> 2;
nPasses++;
}
@@ -274,9 +268,9 @@ INT32 StgFAT::AllocPages( INT32 nBgn, INT32 nPgs )
// It can be assumed that the stream size is always on
// a page boundary
-BOOL StgFAT::InitNew( INT32 nPage1 )
+sal_Bool StgFAT::InitNew( sal_Int32 nPage1 )
{
- INT32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries;
+ sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries;
while( n-- )
{
StgPage* pPg = NULL;
@@ -286,29 +280,29 @@ BOOL StgFAT::InitNew( INT32 nPage1 )
// Initialize the page
pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE );
if ( !pPg )
- return FALSE;
+ return sal_False;
for( short i = 0; i < nEntries; i++ )
pPg->SetPage( i, STG_FREE );
nPage1++;
}
- return TRUE;
+ return sal_True;
}
// Release a chain
-BOOL StgFAT::FreePages( INT32 nStart, BOOL bAll )
+sal_Bool StgFAT::FreePages( sal_Int32 nStart, sal_Bool bAll )
{
while( nStart >= 0 )
{
StgPage* pPg = GetPhysPage( nStart << 2 );
if( !pPg )
- return FALSE;
+ return sal_False;
nStart = pPg->GetPage( nOffset >> 2 );
// The first released page is either set to EOF or FREE
pPg->SetPage( nOffset >> 2, bAll ? STG_FREE : STG_EOF );
- bAll = TRUE;
+ bAll = sal_True;
}
- return TRUE;
+ return sal_True;
}
///////////////////////////// class StgStrm ////////////////////////////////
@@ -346,21 +340,21 @@ void StgStrm::SetEntry( StgDirEntry& r )
// If the position is behind the size, set the stream right
// behind the EOF.
-BOOL StgStrm::Pos2Page( INT32 nBytePos )
+sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
{
- INT32 nRel, nBgn;
+ sal_Int32 nRel, nBgn;
// Values < 0 seek to the end
if( nBytePos < 0 || nBytePos >= nSize )
nBytePos = nSize;
// Adjust the position back to offset 0
nPos -= nOffset;
- INT32 nMask = ~( nPageSize - 1 );
- INT32 nOld = nPos & nMask;
- INT32 nNew = nBytePos & nMask;
+ sal_Int32 nMask = ~( nPageSize - 1 );
+ sal_Int32 nOld = nPos & nMask;
+ sal_Int32 nNew = nBytePos & nMask;
nOffset = (short) ( nBytePos & ~nMask );
nPos = nBytePos;
if( nOld == nNew )
- return TRUE;
+ return sal_True;
if( nNew > nOld )
{
// the new position is behind the current, so an incremental
@@ -377,7 +371,7 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos )
}
// now, traverse the FAT chain.
nRel /= nPageSize;
- INT32 nLast = STG_EOF;
+ sal_Int32 nLast = STG_EOF;
while( nRel && nBgn >= 0 )
{
nLast = nBgn;
@@ -395,12 +389,12 @@ BOOL StgStrm::Pos2Page( INT32 nBytePos )
nOffset = nPageSize;
}
nPage = nBgn;
- return BOOL( nRel == 0 && nPage >= 0 );
+ return sal_Bool( nRel == 0 && nPage >= 0 );
}
// Retrieve the physical page for a given byte offset.
-StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce )
+StgPage* StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce )
{
if( !Pos2Page( nBytePos ) )
return NULL;
@@ -410,16 +404,16 @@ StgPage* StgStrm::GetPhysPage( INT32 nBytePos, BOOL bForce )
// Copy an entire stream. Both streams are allocated in the FAT.
// The target stream is this stream.
-BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes )
+sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
{
- INT32 nTo = nStart;
- INT32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize;
+ sal_Int32 nTo = nStart;
+ sal_Int32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize;
while( nPgs-- )
{
if( nTo < 0 )
{
rIo.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return FALSE;
+ return sal_False;
}
rIo.Copy( nTo, nFrom );
if( nFrom >= 0 )
@@ -428,34 +422,34 @@ BOOL StgStrm::Copy( INT32 nFrom, INT32 nBytes )
if( nFrom < 0 )
{
rIo.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return FALSE;
+ return sal_False;
}
}
nTo = pFat->GetNextPage( nTo );
}
- return TRUE;
+ return sal_True;
}
-BOOL StgStrm::SetSize( INT32 nBytes )
+sal_Bool StgStrm::SetSize( sal_Int32 nBytes )
{
// round up to page size
- INT32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize;
- INT32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize;
+ sal_Int32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize;
+ sal_Int32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize;
if( nNew > nOld )
{
if( !Pos2Page( nSize ) )
- return FALSE;
- INT32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize );
+ return sal_False;
+ sal_Int32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize );
if( nBgn == STG_EOF )
- return FALSE;
+ return sal_False;
if( nStart == STG_EOF )
nStart = nPage = nBgn;
}
else if( nNew < nOld )
{
- BOOL bAll = BOOL( nBytes == 0 );
+ sal_Bool bAll = sal_Bool( nBytes == 0 );
if( !Pos2Page( nBytes ) || !pFat->FreePages( nPage, bAll ) )
- return FALSE;
+ return sal_False;
if( bAll )
nStart = nPage = STG_EOF;
}
@@ -469,12 +463,12 @@ BOOL StgStrm::SetSize( INT32 nBytes )
}
nSize = nBytes;
pFat->SetLimit( GetPages() );
- return TRUE;
+ return sal_True;
}
// Return the # of allocated pages
-INT32 StgStrm::GetPages()
+sal_Int32 StgStrm::GetPages()
{
return ( nSize + nPageSize - 1 ) / nPageSize;
}
@@ -487,11 +481,11 @@ INT32 StgStrm::GetPages()
StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r )
{
- pFat = new StgFAT( *this, TRUE );
+ pFat = new StgFAT( *this, sal_True );
nSize = rIo.aHdr.GetFATSize() * nPageSize;
}
-BOOL StgFATStrm::Pos2Page( INT32 nBytePos )
+sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos )
{
// Values < 0 seek to the end
if( nBytePos < 0 || nBytePos >= nSize )
@@ -499,38 +493,38 @@ BOOL StgFATStrm::Pos2Page( INT32 nBytePos )
nPage = nBytePos / nPageSize;
nOffset = (short) ( nBytePos % nPageSize );
nPos = nBytePos;
- nPage = GetPage( (short) nPage, FALSE );
- return BOOL( nPage >= 0 );
+ nPage = GetPage( (short) nPage, sal_False );
+ return sal_Bool( nPage >= 0 );
}
// Retrieve the physical page for a given byte offset.
// Since Pos2Page() already has computed the physical offset,
// use the byte offset directly.
-StgPage* StgFATStrm::GetPhysPage( INT32 nBytePos, BOOL bForce )
+StgPage* StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce )
{
return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce );
}
// Get the page number entry for the given page offset.
-INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc )
+sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc )
{
if( pnMasterAlloc ) *pnMasterAlloc = 0;
if( nOff < rIo.aHdr.GetFAT1Size() )
return rIo.aHdr.GetFATPage( nOff );
- INT32 nMaxPage = nSize >> 2;
+ sal_Int32 nMaxPage = nSize >> 2;
nOff = nOff - rIo.aHdr.GetFAT1Size();
// Anzahl der Masterpages, durch die wir iterieren muessen
- USHORT nMasterCount = ( nPageSize >> 2 ) - 1;
- USHORT nBlocks = nOff / nMasterCount;
+ sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1;
+ sal_uInt16 nBlocks = nOff / nMasterCount;
// Offset in letzter Masterpage
nOff = nOff % nMasterCount;
StgPage* pOldPage = 0;
StgPage* pMaster = 0;
- INT32 nFAT = rIo.aHdr.GetFATChain();
- for( USHORT nCount = 0; nCount <= nBlocks; nCount++ )
+ sal_Int32 nFAT = rIo.aHdr.GetFATChain();
+ for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ )
{
if( nFAT == STG_EOF || nFAT == STG_FREE )
{
@@ -557,7 +551,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc )
{
if( !Pos2Page( nFAT << 2 ) )
return STG_EOF;
- StgPage* pPg = rIo.Get( nPage, TRUE );
+ StgPage* pPg = rIo.Get( nPage, sal_True );
if( !pPg )
return STG_EOF;
pPg->SetPage( nOffset >> 2, STG_MASTER );
@@ -571,7 +565,7 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc )
}
else
{
- pMaster = rIo.Get( nFAT, TRUE );
+ pMaster = rIo.Get( nFAT, sal_True );
if ( pMaster )
{
nFAT = pMaster->GetPage( nMasterCount );
@@ -588,30 +582,30 @@ INT32 StgFATStrm::GetPage( short nOff, BOOL bMake, USHORT *pnMasterAlloc )
// Set the page number entry for the given page offset.
-BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage )
+sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
{
- BOOL bRes = TRUE;
+ sal_Bool bRes = sal_True;
if( nOff < rIo.aHdr.GetFAT1Size() )
rIo.aHdr.SetFATPage( nOff, nNewPage );
else
{
nOff = nOff - rIo.aHdr.GetFAT1Size();
// Anzahl der Masterpages, durch die wir iterieren muessen
- USHORT nMasterCount = ( nPageSize >> 2 ) - 1;
- USHORT nBlocks = nOff / nMasterCount;
+ sal_uInt16 nMasterCount = ( nPageSize >> 2 ) - 1;
+ sal_uInt16 nBlocks = nOff / nMasterCount;
// Offset in letzter Masterpage
nOff = nOff % nMasterCount;
StgPage* pMaster = 0;
- INT32 nFAT = rIo.aHdr.GetFATChain();
- for( USHORT nCount = 0; nCount <= nBlocks; nCount++ )
+ sal_Int32 nFAT = rIo.aHdr.GetFATChain();
+ for( sal_uInt16 nCount = 0; nCount <= nBlocks; nCount++ )
{
if( nFAT == STG_EOF || nFAT == STG_FREE )
{
pMaster = 0;
break;
}
- pMaster = rIo.Get( nFAT, TRUE );
+ pMaster = rIo.Get( nFAT, sal_True );
if ( pMaster )
nFAT = pMaster->GetPage( nMasterCount );
}
@@ -620,7 +614,7 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage )
else
{
rIo.SetError( SVSTREAM_GENERALERROR );
- bRes = FALSE;
+ bRes = sal_False;
}
}
@@ -628,16 +622,16 @@ BOOL StgFATStrm::SetPage( short nOff, INT32 nNewPage )
if( bRes )
{
Pos2Page( nNewPage << 2 );
- StgPage* pPg = rIo.Get( nPage, TRUE );
+ StgPage* pPg = rIo.Get( nPage, sal_True );
if( pPg )
pPg->SetPage( nOffset >> 2, STG_FAT );
else
- bRes = FALSE;
+ bRes = sal_False;
}
return bRes;
}
-BOOL StgFATStrm::SetSize( INT32 nBytes )
+sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
{
// Set the number of entries to a multiple of the page size
short nOld = (short) ( ( nSize + ( nPageSize - 1 ) ) / nPageSize );
@@ -655,17 +649,17 @@ BOOL StgFATStrm::SetSize( INT32 nBytes )
{
// allocate master pages
// find a free master page slot
- INT32 nPg = 0;
- USHORT nMasterAlloc = 0;
- nPg = GetPage( nOld, TRUE, &nMasterAlloc );
+ sal_Int32 nPg = 0;
+ sal_uInt16 nMasterAlloc = 0;
+ nPg = GetPage( nOld, sal_True, &nMasterAlloc );
if( nPg == STG_EOF )
- return FALSE;
+ return sal_False;
// 4 Bytes have been used for Allocation of each MegaMasterPage
nBytes += nMasterAlloc << 2;
// find a free page using the FAT allocator
- INT32 n = 1;
- INT32 nNewPage = pFat->FindBlock( n );
+ sal_Int32 n = 1;
+ sal_Int32 nNewPage = pFat->FindBlock( n );
if( nNewPage == STG_EOF )
{
// no free pages found; create a new page
@@ -678,12 +672,12 @@ BOOL StgFATStrm::SetSize( INT32 nBytes )
// adjust the file size if necessary
if( nNewPage >= rIo.GetPhysPages() )
if( !rIo.SetSize( nNewPage + 1 ) )
- return FALSE;
+ return sal_False;
}
// Set up the page with empty entries
StgPage* pPg = rIo.Copy( nNewPage, STG_FREE );
if ( !pPg )
- return FALSE;
+ return sal_False;
for( short j = 0; j < ( nPageSize >> 2 ); j++ )
pPg->SetPage( j, STG_FREE );
@@ -694,22 +688,22 @@ BOOL StgFATStrm::SetSize( INT32 nBytes )
// MegaMasterPages were created, mark it them as used
- UINT32 nMax = rIo.aHdr.GetMasters( );
- UINT32 nFAT = rIo.aHdr.GetFATChain();
+ sal_uInt32 nMax = rIo.aHdr.GetMasters( );
+ sal_uInt32 nFAT = rIo.aHdr.GetFATChain();
if( nMasterAlloc )
- for( USHORT nCount = 0; nCount < nMax; nCount++ )
+ for( sal_uInt16 nCount = 0; nCount < nMax; nCount++ )
{
if( !Pos2Page( nFAT << 2 ) )
- return FALSE;
+ return sal_False;
if( nMax - nCount <= nMasterAlloc )
{
- StgPage* piPg = rIo.Get( nPage, TRUE );
+ StgPage* piPg = rIo.Get( nPage, sal_True );
if( !piPg )
- return FALSE;
+ return sal_False;
piPg->SetPage( nOffset >> 2, STG_MASTER );
}
- StgPage* pPage = rIo.Get( nFAT, TRUE );
- if( !pPage ) return FALSE;
+ StgPage* pPage = rIo.Get( nFAT, sal_True );
+ if( !pPage ) return sal_False;
nFAT = pPage->GetPage( (nPageSize >> 2 ) - 1 );
}
@@ -722,7 +716,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes )
}
nSize = nNew * nPageSize;
rIo.aHdr.SetFATSize( nNew );
- return TRUE;
+ return sal_True;
}
/////////////////////////// class StgDataStrm //////////////////////////////
@@ -732,7 +726,7 @@ BOOL StgFATStrm::SetSize( INT32 nBytes )
// The stream has a size increment which normally is 1, but which can be
// set to any value is you want the size to be incremented by certain values.
-StgDataStrm::StgDataStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r )
+StgDataStrm::StgDataStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r )
{
Init( nBgn, nLen );
}
@@ -744,9 +738,9 @@ StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r )
p->aEntry.GetSize() );
}
-void StgDataStrm::Init( INT32 nBgn, INT32 nLen )
+void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
- pFat = new StgFAT( *rIo.pFAT, TRUE );
+ pFat = new StgFAT( *rIo.pFAT, sal_True );
nStart = nPage = nBgn;
nSize = nLen;
nIncr = 1;
@@ -756,7 +750,7 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen )
// determine the actual size of the stream by scanning
// the FAT chain and counting the # of pages allocated
nSize = 0;
- INT32 nOldBgn = -1;
+ sal_Int32 nOldBgn = -1;
while( nBgn >= 0 && nBgn != nOldBgn )
{
nOldBgn = nBgn;
@@ -770,18 +764,18 @@ void StgDataStrm::Init( INT32 nBgn, INT32 nLen )
// Set the size of a physical stream.
-BOOL StgDataStrm::SetSize( INT32 nBytes )
+sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes )
{
nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr;
- INT32 nOldSz = nSize;
+ sal_Int32 nOldSz = nSize;
if( ( nOldSz != nBytes ) )
{
if( !StgStrm::SetSize( nBytes ) )
- return FALSE;
- INT32 nMaxPage = pFat->GetMaxPage();
+ return sal_False;
+ sal_Int32 nMaxPage = pFat->GetMaxPage();
if( nMaxPage > rIo.GetPhysPages() )
if( !rIo.SetSize( nMaxPage ) )
- return FALSE;
+ return sal_False;
// If we only allocated one page or less, create this
// page in the cache for faster throughput. The current
// position is the former EOF point.
@@ -792,14 +786,14 @@ BOOL StgDataStrm::SetSize( INT32 nBytes )
rIo.Copy( nPage, STG_FREE );
}
}
- return TRUE;
+ return sal_True;
}
// Get the address of the data byte at a specified offset.
-// If bForce = TRUE, a read of non-existent data causes
+// If bForce = sal_True, a read of non-existent data causes
// a read fault.
-void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty )
+void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty )
{
if( Pos2Page( Pos ) )
{
@@ -809,7 +803,7 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty )
pPg->SetOwner( pEntry );
if( bDirty )
pPg->SetDirty();
- return ((BYTE *)pPg->GetData()) + nOffset;
+ return ((sal_uInt8 *)pPg->GetData()) + nOffset;
}
}
return NULL;
@@ -819,24 +813,24 @@ void* StgDataStrm::GetPtr( INT32 Pos, BOOL bForce, BOOL bDirty )
// the amount of consecutable blocks before doing a read. The result
// is the number of bytes read. No error is generated on EOF.
-INT32 StgDataStrm::Read( void* pBuf, INT32 n )
+sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n )
{
if ( n < 0 )
return 0;
if( ( nPos + n ) > nSize )
n = nSize - nPos;
- INT32 nDone = 0;
+ sal_Int32 nDone = 0;
while( n )
{
short nBytes = nPageSize - nOffset;
StgPage* pPg;
- if( (INT32) nBytes > n )
+ if( (sal_Int32) nBytes > n )
nBytes = (short) n;
if( nBytes )
{
short nRes;
- void *p = (BYTE *) pBuf + nDone;
+ void *p = (sal_uInt8 *) pBuf + nDone;
if( nBytes == nPageSize )
{
pPg = rIo.Find( nPage );
@@ -854,11 +848,11 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n )
else
{
// partial block read thru the cache.
- pPg = rIo.Get( nPage, FALSE );
+ pPg = rIo.Get( nPage, sal_False );
if( !pPg )
break;
pPg->SetOwner( pEntry );
- memcpy( p, (BYTE*)pPg->GetData() + nOffset, nBytes );
+ memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes );
nRes = nBytes;
}
nDone += nRes;
@@ -875,26 +869,26 @@ INT32 StgDataStrm::Read( void* pBuf, INT32 n )
return nDone;
}
-INT32 StgDataStrm::Write( const void* pBuf, INT32 n )
+sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n )
{
- INT32 nDone = 0;
+ sal_Int32 nDone = 0;
if( ( nPos + n ) > nSize )
{
- INT32 nOld = nPos;
+ sal_Int32 nOld = nPos;
if( !SetSize( nPos + n ) )
- return FALSE;
+ return sal_False;
Pos2Page( nOld );
}
while( n )
{
short nBytes = nPageSize - nOffset;
StgPage* pPg;
- if( (INT32) nBytes > n )
+ if( (sal_Int32) nBytes > n )
nBytes = (short) n;
if( nBytes )
{
short nRes;
- const void *p = (const BYTE *) pBuf + nDone;
+ const void *p = (const sal_uInt8 *) pBuf + nDone;
if( nBytes == nPageSize )
{
pPg = rIo.Find( nPage );
@@ -913,11 +907,11 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n )
else
{
// partial block read thru the cache.
- pPg = rIo.Get( nPage, FALSE );
+ pPg = rIo.Get( nPage, sal_False );
if( !pPg )
break;
pPg->SetOwner( pEntry );
- memcpy( (BYTE*)pPg->GetData() + nOffset, p, nBytes );
+ memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes );
pPg->SetDirty();
nRes = nBytes;
}
@@ -942,7 +936,7 @@ INT32 StgDataStrm::Write( const void* pBuf, INT32 n )
// is also a StgStream. The start of the FAT is in the header at DataRootPage,
// the stream itself is pointed to by the root entry (it holds start & size).
-StgSmallStrm::StgSmallStrm( StgIo& r, INT32 nBgn, INT32 nLen ) : StgStrm( r )
+StgSmallStrm::StgSmallStrm( StgIo& r, sal_Int32 nBgn, sal_Int32 nLen ) : StgStrm( r )
{
Init( nBgn, nLen );
}
@@ -954,9 +948,9 @@ StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r )
p->aEntry.GetSize() );
}
-void StgSmallStrm::Init( INT32 nBgn, INT32 nLen )
+void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
- pFat = new StgFAT( *rIo.pDataFAT, FALSE );
+ pFat = new StgFAT( *rIo.pDataFAT, sal_False );
pData = rIo.pDataStrm;
nPageSize = rIo.GetDataPageSize();
nStart =
@@ -968,7 +962,7 @@ void StgSmallStrm::Init( INT32 nBgn, INT32 nLen )
// the amount of consecutable blocks before doing a read. The result
// is the number of bytes read. No error is generated on EOF.
-INT32 StgSmallStrm::Read( void* pBuf, INT32 n )
+sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
{
// We can safely assume that reads are not huge, since the
// small stream is likely to be < 64 KBytes.
@@ -978,14 +972,14 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n )
while( n )
{
short nBytes = nPageSize - nOffset;
- if( (INT32) nBytes > n )
+ if( (sal_Int32) nBytes > n )
nBytes = (short) n;
if( nBytes )
{
if( !pData->Pos2Page( nPage * nPageSize + nOffset ) )
break;
// all reading thru the stream
- short nRes = (short) pData->Read( (BYTE*)pBuf + nDone, nBytes );
+ short nRes = (short) pData->Read( (sal_uInt8*)pBuf + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
@@ -1001,33 +995,33 @@ INT32 StgSmallStrm::Read( void* pBuf, INT32 n )
return nDone;
}
-INT32 StgSmallStrm::Write( const void* pBuf, INT32 n )
+sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
{
// you can safely assume that reads are not huge, since the
// small stream is likely to be < 64 KBytes.
short nDone = 0;
if( ( nPos + n ) > nSize )
{
- INT32 nOld = nPos;
+ sal_Int32 nOld = nPos;
if( !SetSize( nPos + n ) )
- return FALSE;
+ return sal_False;
Pos2Page( nOld );
}
while( n )
{
short nBytes = nPageSize - nOffset;
- if( (INT32) nBytes > n )
+ if( (sal_Int32) nBytes > n )
nBytes = (short) n;
if( nBytes )
{
// all writing goes thru the stream
- INT32 nDataPos = nPage * nPageSize + nOffset;
+ sal_Int32 nDataPos = nPage * nPageSize + nOffset;
if( pData->GetSize() < ( nDataPos + nBytes ) )
if( !pData->SetSize( nDataPos + nBytes ) )
break;
if( !pData->Pos2Page( nDataPos ) )
break;
- short nRes = (short) pData->Write( (BYTE*)pBuf + nDone, nBytes );
+ short nRes = (short) pData->Write( (sal_uInt8*)pBuf + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
@@ -1050,7 +1044,7 @@ INT32 StgSmallStrm::Write( const void* pBuf, INT32 n )
#define THRESHOLD 32768L
-StgTmpStrm::StgTmpStrm( ULONG nInitSize )
+StgTmpStrm::StgTmpStrm( sal_uLong nInitSize )
: SvMemoryStream( nInitSize > THRESHOLD
? 16
: ( nInitSize ? nInitSize : 16 ), 4096 )
@@ -1062,19 +1056,19 @@ StgTmpStrm::StgTmpStrm( ULONG nInitSize )
SetSize( nInitSize );
}
-BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc )
+sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
{
- ULONG n = rSrc.GetSize();
- ULONG nCur = rSrc.Tell();
+ sal_uLong n = rSrc.GetSize();
+ sal_uLong nCur = rSrc.Tell();
SetSize( n );
if( GetError() == SVSTREAM_OK )
{
- BYTE* p = new BYTE[ 4096 ];
+ sal_uInt8* p = new sal_uInt8[ 4096 ];
rSrc.Seek( 0L );
Seek( 0L );
while( n )
{
- ULONG nn = n;
+ sal_uLong nn = n;
if( nn > 4096 )
nn = 4096;
if( rSrc.Read( p, nn ) != nn )
@@ -1086,10 +1080,10 @@ BOOL StgTmpStrm::Copy( StgTmpStrm& rSrc )
delete [] p;
rSrc.Seek( nCur );
Seek( nCur );
- return BOOL( n == 0 );
+ return sal_Bool( n == 0 );
}
else
- return FALSE;
+ return sal_False;
}
StgTmpStrm::~StgTmpStrm()
@@ -1102,12 +1096,12 @@ StgTmpStrm::~StgTmpStrm()
}
}
-ULONG StgTmpStrm::GetSize() const
+sal_uLong StgTmpStrm::GetSize() const
{
- ULONG n;
+ sal_uLong n;
if( pStrm )
{
- ULONG old = pStrm->Tell();
+ sal_uLong old = pStrm->Tell();
n = pStrm->Seek( STREAM_SEEK_TO_END );
pStrm->Seek( old );
}
@@ -1116,7 +1110,7 @@ ULONG StgTmpStrm::GetSize() const
return n;
}
-void StgTmpStrm::SetSize( ULONG n )
+void StgTmpStrm::SetSize( sal_uLong n )
{
if( pStrm )
pStrm->SetStreamSize( n );
@@ -1126,15 +1120,15 @@ void StgTmpStrm::SetSize( ULONG n )
{
aName = TempFile::CreateTempName();
SvFileStream* s = new SvFileStream( aName, STREAM_READWRITE );
- ULONG nCur = Tell();
- ULONG i = nEndOfData;
+ sal_uLong nCur = Tell();
+ sal_uLong i = nEndOfData;
if( i )
{
- BYTE* p = new BYTE[ 4096 ];
+ sal_uInt8* p = new sal_uInt8[ 4096 ];
Seek( 0L );
while( i )
{
- ULONG nb = ( i > 4096 ) ? 4096 : i;
+ sal_uLong nb = ( i > 4096 ) ? 4096 : i;
if( Read( p, nb ) == nb
&& s->Write( p, nb ) == nb )
i -= nb;
@@ -1170,9 +1164,9 @@ void StgTmpStrm::SetSize( ULONG n )
{
if( n > nEndOfData )
{
- ULONG nCur = Tell();
+ sal_uLong nCur = Tell();
Seek( nEndOfData - 1 );
- *this << (BYTE) 0;
+ *this << (sal_uInt8) 0;
Seek( nCur );
}
else
@@ -1181,7 +1175,7 @@ void StgTmpStrm::SetSize( ULONG n )
}
}
-ULONG StgTmpStrm::GetData( void* pData, ULONG n )
+sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n )
{
if( pStrm )
{
@@ -1193,10 +1187,10 @@ ULONG StgTmpStrm::GetData( void* pData, ULONG n )
return SvMemoryStream::GetData( (sal_Char *)pData, n );
}
-ULONG StgTmpStrm::PutData( const void* pData, ULONG n )
+sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
{
- UINT32 nCur = Tell();
- UINT32 nNew = nCur + n;
+ sal_uInt32 nCur = Tell();
+ sal_uInt32 nNew = nCur + n;
if( nNew > THRESHOLD && !pStrm )
{
SetSize( nNew );
@@ -1213,7 +1207,7 @@ ULONG StgTmpStrm::PutData( const void* pData, ULONG n )
return nNew;
}
-ULONG StgTmpStrm::SeekPos( ULONG n )
+sal_uLong StgTmpStrm::SeekPos( sal_uLong n )
{
if( n == STREAM_SEEK_TO_END )
n = GetSize();
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 47301a90f9f6..a6a0ad108da9 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -37,29 +37,29 @@ class StgPage;
class StgDirEntry;
// The FAT class performs FAT operations on an underlying storage stream.
-// This stream is either the physical FAT stream (bPhys == TRUE ) or a normal
+// This stream is either the physical FAT stream (bPhys == sal_True ) or a normal
// storage stream, which then holds the FAT for small data allocations.
class StgFAT
{ // FAT allocator
StgStrm& rStrm; // underlying stream
- INT32 nMaxPage; // highest page allocated so far
+ sal_Int32 nMaxPage; // highest page allocated so far
short nPageSize; // physical page size
short nEntries; // FAT entries per page
short nOffset; // current offset within page
- INT32 nLimit; // search limit recommendation
- BOOL bPhys; // TRUE: physical FAT
- StgPage* GetPhysPage( INT32 nPage );
- BOOL MakeChain( INT32 nStart, INT32 nPages );
- BOOL InitNew( INT32 nPage1 );
+ sal_Int32 nLimit; // search limit recommendation
+ sal_Bool bPhys; // sal_True: physical FAT
+ StgPage* GetPhysPage( sal_Int32 nPage );
+ sal_Bool MakeChain( sal_Int32 nStart, sal_Int32 nPages );
+ sal_Bool InitNew( sal_Int32 nPage1 );
public:
- StgFAT( StgStrm& rStrm, BOOL bMark );
- INT32 FindBlock( INT32& nPages );
- INT32 GetNextPage( INT32 nPg );
- INT32 AllocPages( INT32 nStart, INT32 nPages );
- BOOL FreePages( INT32 nStart, BOOL bAll );
- INT32 GetMaxPage() { return nMaxPage; }
- void SetLimit( INT32 n ) { nLimit = n; }
+ StgFAT( StgStrm& rStrm, sal_Bool bMark );
+ sal_Int32 FindBlock( sal_Int32& nPages );
+ sal_Int32 GetNextPage( sal_Int32 nPg );
+ sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages );
+ sal_Bool FreePages( sal_Int32 nStart, sal_Bool bAll );
+ sal_Int32 GetMaxPage() { return nMaxPage; }
+ void SetLimit( sal_Int32 n ) { nLimit = n; }
};
// The base stream class provides basic functionality for seeking
@@ -71,31 +71,31 @@ protected:
StgIo& rIo; // I/O system
StgFAT* pFat; // FAT stream for allocations
StgDirEntry* pEntry; // dir entry (for ownership)
- INT32 nStart; // 1st data page
- INT32 nSize; // stream size in bytes
- INT32 nPos; // current byte position
- INT32 nPage; // current logical page
+ sal_Int32 nStart; // 1st data page
+ sal_Int32 nSize; // stream size in bytes
+ sal_Int32 nPos; // current byte position
+ sal_Int32 nPage; // current logical page
short nOffset; // offset into current page
short nPageSize; // logical page size
- BOOL Copy( INT32 nFrom, INT32 nBytes );
+ sal_Bool Copy( sal_Int32 nFrom, sal_Int32 nBytes );
StgStrm( StgIo& );
public:
virtual ~StgStrm();
StgIo& GetIo() { return rIo; }
- INT32 GetPos() { return nPos; }
- INT32 GetStart() { return nStart; }
- INT32 GetSize() { return nSize; }
- INT32 GetPage() { return nPage; }
+ sal_Int32 GetPos() { return nPos; }
+ sal_Int32 GetStart() { return nStart; }
+ sal_Int32 GetSize() { return nSize; }
+ sal_Int32 GetPage() { return nPage; }
short GetPageSize() { return nPageSize; }
- INT32 GetPages();
+ sal_Int32 GetPages();
short GetOffset() { return nOffset;}
void SetEntry( StgDirEntry& );
- virtual BOOL SetSize( INT32 );
- virtual BOOL Pos2Page( INT32 nBytePos );
- virtual INT32 Read( void*, INT32 ) { return 0; }
- virtual INT32 Write( const void*, INT32 ) { return 0; }
- virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE );
- virtual BOOL IsSmallStrm() { return FALSE; }
+ virtual sal_Bool SetSize( sal_Int32 );
+ virtual sal_Bool Pos2Page( sal_Int32 nBytePos );
+ virtual sal_Int32 Read( void*, sal_Int32 ) { return 0; }
+ virtual sal_Int32 Write( const void*, sal_Int32 ) { return 0; }
+ virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False );
+ virtual sal_Bool IsSmallStrm() { return sal_False; }
};
// The FAT stream class provides physical access to the master FAT.
@@ -103,15 +103,15 @@ public:
// FAT allocator.
class StgFATStrm : public StgStrm { // the master FAT stream
- virtual BOOL Pos2Page( INT32 nBytePos );
- BOOL SetPage( short, INT32 );
+ virtual sal_Bool Pos2Page( sal_Int32 nBytePos );
+ sal_Bool SetPage( short, sal_Int32 );
public:
StgFATStrm( StgIo& );
virtual ~StgFATStrm() {}
using StgStrm::GetPage;
- INT32 GetPage( short, BOOL, USHORT *pnMasterAlloc = 0);
- virtual BOOL SetSize( INT32 );
- virtual StgPage* GetPhysPage( INT32 nBytePos, BOOL bForce = FALSE );
+ sal_Int32 GetPage( short, sal_Bool, sal_uInt16 *pnMasterAlloc = 0);
+ virtual sal_Bool SetSize( sal_Int32 );
+ virtual StgPage* GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False );
};
// The stream has a size increment which normally is 1, but which can be
@@ -120,15 +120,15 @@ public:
class StgDataStrm : public StgStrm // a physical data stream
{
short nIncr; // size adjust increment
- void Init( INT32 nBgn, INT32 nLen );
+ void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
- StgDataStrm( StgIo&, INT32 nBgn, INT32 nLen=-1 );
+ StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
StgDataStrm( StgIo&, StgDirEntry* );
- void* GetPtr( INT32 nPos, BOOL bForce, BOOL bDirty );
+ void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty );
void SetIncrement( short n ) { nIncr = n ; }
- virtual BOOL SetSize( INT32 );
- virtual INT32 Read( void*, INT32 );
- virtual INT32 Write( const void*, INT32 );
+ virtual sal_Bool SetSize( sal_Int32 );
+ virtual sal_Int32 Read( void*, sal_Int32 );
+ virtual sal_Int32 Write( const void*, sal_Int32 );
};
// The small stream class provides access to streams with a size < 4096 bytes.
@@ -139,13 +139,13 @@ public:
class StgSmallStrm : public StgStrm // a logical data stream
{
StgStrm* pData; // the data stream
- void Init( INT32 nBgn, INT32 nLen );
+ void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
- StgSmallStrm( StgIo&, INT32 nBgn, INT32 nLen );
+ StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen );
StgSmallStrm( StgIo&, StgDirEntry* );
- virtual INT32 Read( void*, INT32 );
- virtual INT32 Write( const void*, INT32 );
- virtual BOOL IsSmallStrm() { return TRUE; }
+ virtual sal_Int32 Read( void*, sal_Int32 );
+ virtual sal_Int32 Write( const void*, sal_Int32 );
+ virtual sal_Bool IsSmallStrm() { return sal_True; }
};
class StgTmpStrm : public SvMemoryStream
@@ -153,17 +153,17 @@ class StgTmpStrm : public SvMemoryStream
String aName;
SvFileStream* pStrm;
using SvMemoryStream::GetData;
- virtual ULONG GetData( void* pData, ULONG nSize );
- virtual ULONG PutData( const void* pData, ULONG nSize );
- virtual ULONG SeekPos( ULONG nPos );
+ virtual sal_uLong GetData( void* pData, sal_uLong nSize );
+ virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
+ virtual sal_uLong SeekPos( sal_uLong nPos );
virtual void FlushData();
public:
- StgTmpStrm( ULONG=16 );
+ StgTmpStrm( sal_uLong=16 );
~StgTmpStrm();
- BOOL Copy( StgTmpStrm& );
- void SetSize( ULONG );
- ULONG GetSize() const;
+ sal_Bool Copy( StgTmpStrm& );
+ void SetSize( sal_uLong );
+ sal_uLong GetSize() const;
};
#endif
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 1764d3c7bdec..c88a2d2c969e 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -36,8 +36,8 @@
#include <rtl/digest.h>
#include <osl/file.hxx>
-#include <stg.hxx>
-#include <storinfo.hxx>
+#include <sot/stg.hxx>
+#include <sot/storinfo.hxx>
#include <sot/storage.hxx>
#include <sot/formats.hxx>
#include <sot/exchange.hxx>
@@ -74,12 +74,12 @@ SO2_IMPL_BASIC_CLASS1_DLL(SotStorageStream,SotStorageStreamFactory,SotObject,
SO2_IMPL_INVARIANT(SotStorageStream)
-void SotStorageStream::TestMemberObjRef( BOOL /*bFree*/ )
+void SotStorageStream::TestMemberObjRef( sal_Bool /*bFree*/ )
{
}
#ifdef TEST_INVARIANT
-void SotStorageStream::TestMemberInvariant( BOOL /*bPrint*/ )
+void SotStorageStream::TestMemberInvariant( sal_Bool /*bPrint*/ )
{
}
#endif
@@ -95,12 +95,12 @@ SvLockBytesRef MakeLockBytes_Impl( const String & rName, StreamMode nMode )
if( rName.Len() )
{
SvStream * pFileStm = new SvFileStream( rName, nMode );
- xLB = new SvLockBytes( pFileStm, TRUE );
+ xLB = new SvLockBytes( pFileStm, sal_True );
}
else
{
SvStream * pCacheStm = new SvCacheStream();
- xLB = new SvLockBytes( pCacheStm, TRUE );
+ xLB = new SvLockBytes( pCacheStm, sal_True );
}
return xLB;
}
@@ -115,9 +115,9 @@ SotStorageStream::SotStorageStream( const String & rName, StreamMode nMode,
, pOwnStm( NULL )
{
if( nMode & STREAM_WRITE )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
else
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
DBG_ASSERT( !nStorageMode,"StorageModes ignored" );
}
@@ -127,9 +127,9 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm )
if( pStm )
{
if( STREAM_WRITE & pStm->GetMode() )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
else
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pOwnStm = pStm;
SetError( pStm->GetError() );
@@ -138,7 +138,7 @@ SotStorageStream::SotStorageStream( BaseStorageStream * pStm )
else
{
pOwnStm = NULL;
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
SetError( SVSTREAM_INVALID_PARAMETER );
}
}
@@ -147,7 +147,7 @@ SotStorageStream::SotStorageStream()
: pOwnStm( NULL )
{
// ??? wenn Init virtuell ist, entsprechen setzen
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
}
/************************************************************************
@@ -172,7 +172,7 @@ void SotStorageStream::SyncSvStream()
if( pOwnStm )
{
pOwnStm->Flush();
- ULONG nPos = pOwnStm->Tell();
+ sal_uLong nPos = pOwnStm->Tell();
SetError( pOwnStm->GetError() );
SvStream::SyncSvStream( nPos );
}
@@ -195,9 +195,9 @@ void SotStorageStream::ResetError()
|*
|* Beschreibung
*************************************************************************/
-ULONG SotStorageStream::GetData( void* pData, ULONG nSize )
+sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize )
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( pOwnStm )
{
@@ -214,9 +214,9 @@ ULONG SotStorageStream::GetData( void* pData, ULONG nSize )
|*
|* Beschreibung
*************************************************************************/
-ULONG SotStorageStream::PutData( const void* pData, ULONG nSize )
+sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize )
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( pOwnStm )
{
@@ -233,9 +233,9 @@ ULONG SotStorageStream::PutData( const void* pData, ULONG nSize )
|*
|* Beschreibung
*************************************************************************/
-ULONG SotStorageStream::SeekPos( ULONG nPos )
+sal_uLong SotStorageStream::SeekPos( sal_uLong nPos )
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( pOwnStm )
{
@@ -268,9 +268,9 @@ void SotStorageStream::FlushData()
|*
|* Beschreibung
*************************************************************************/
-void SotStorageStream::SetSize( ULONG nNewSize )
+void SotStorageStream::SetSize( sal_uLong nNewSize )
{
- ULONG nPos = Tell();
+ sal_uLong nPos = Tell();
if( pOwnStm )
{
pOwnStm->SetSize( nNewSize );
@@ -293,11 +293,11 @@ void SotStorageStream::SetSize( ULONG nNewSize )
|* Beschreibung
|*
*************************************************************************/
-UINT32 SotStorageStream::GetSize() const
+sal_uInt32 SotStorageStream::GetSize() const
{
- ULONG nPos = Tell();
+ sal_uLong nPos = Tell();
((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END );
- ULONG nSize = Tell();
+ sal_uLong nSize = Tell();
((SotStorageStream *)this)->Seek( nPos );
return nSize;
}
@@ -307,19 +307,19 @@ UINT32 SotStorageStream::GetSize() const
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm )
+sal_Bool SotStorageStream::CopyTo( SotStorageStream * pDestStm )
{
Flush(); // alle Daten schreiben
pDestStm->ClearBuffer();
if( !pOwnStm || !pDestStm->pOwnStm )
{ // Wenn Ole2 oder nicht nur eigene StorageStreams
- ULONG nPos = Tell(); // Position merken
+ sal_uLong nPos = Tell(); // Position merken
Seek( 0L );
pDestStm->SetSize( 0 ); // Ziel-Stream leeren
- void * pMem = new BYTE[ 8192 ];
- ULONG nRead;
+ void * pMem = new sal_uInt8[ 8192 ];
+ sal_uLong nRead;
while( 0 != (nRead = Read( pMem, 8192 )) )
{
if( nRead != pDestStm->Write( pMem, nRead ) )
@@ -328,7 +328,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm )
break;
}
}
- delete [] static_cast<BYTE*>(pMem);
+ delete [] static_cast<sal_uInt8*>(pMem);
// Position setzen
pDestStm->Seek( nPos );
Seek( nPos );
@@ -359,7 +359,7 @@ BOOL SotStorageStream::CopyTo( SotStorageStream * pDestStm )
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorageStream::Commit()
+sal_Bool SotStorageStream::Commit()
{
if( pOwnStm )
{
@@ -371,7 +371,7 @@ BOOL SotStorageStream::Commit()
return GetError() == SVSTREAM_OK;
}
-BOOL SotStorageStream::Revert()
+sal_Bool SotStorageStream::Revert()
{
if( !pOwnStm )
{
@@ -381,7 +381,7 @@ BOOL SotStorageStream::Revert()
return GetError() == SVSTREAM_OK;
}
-BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
if ( pStg )
@@ -391,11 +391,11 @@ BOOL SotStorageStream::SetProperty( const String& rName, const ::com::sun::star:
else
{
OSL_FAIL("Not implemented!");
- return FALSE;
+ return sal_False;
}
}
-BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
if ( pStg )
@@ -405,7 +405,7 @@ BOOL SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::
else
{
OSL_FAIL("Not implemented!");
- return FALSE;
+ return sal_False;
}
}
@@ -452,12 +452,12 @@ SO2_IMPL_INVARIANT(SotStorage)
|*
|* Beschreibung
*************************************************************************/
-void SotStorage::TestMemberObjRef( BOOL /*bFree*/ )
+void SotStorage::TestMemberObjRef( sal_Bool /*bFree*/ )
{
}
#ifdef TEST_INVARIANT
-void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ )
+void SotStorage::TestMemberInvariant( sal_Bool /*bPrint*/ )
{
}
#endif
@@ -469,7 +469,7 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ )
|* Beschreibung Es muss ein I... Objekt an SvObject uebergeben
|* werden, da es sonst selbst ein IUnknown anlegt und
|* festlegt, dass alle weiteren I... Objekte mit
-|* delete zerstoert werden (Owner() == TRUE).
+|* delete zerstoert werden (Owner() == sal_True).
|* Es werden aber nur IStorage Objekte benutzt und nicht
|* selbst implementiert, deshalb wird so getan, als ob
|* das IStorage Objekt von aussen kam und es wird mit
@@ -487,8 +487,8 @@ void SotStorage::TestMemberInvariant( BOOL /*bPrint*/ )
: m_pOwnStg( NULL ) \
, m_pStorStm( NULL ) \
, m_nError( SVSTREAM_OK ) \
- , m_bIsRoot( FALSE ) \
- , m_bDelStm( FALSE ) \
+ , m_bIsRoot( sal_False ) \
+ , m_bDelStm( sal_False ) \
, m_nVersion( SOFFICE_FILEFORMAT_CURRENT )
SotStorage::SotStorage()
@@ -506,7 +506,7 @@ SotStorage::SotStorage( const ::ucbhelper::Content& rContent, const String & rNa
INIT_SotStorage()
{
m_aName = rName; // Namen merken
- m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new UCBStorage( rContent, m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
SetError( m_pOwnStg->GetError() );
@@ -520,12 +520,12 @@ SotStorage::SotStorage( const String & rName, StreamMode nMode, StorageMode nSto
INIT_SotStorage()
{
m_aName = rName; // Namen merken
- CreateStorage( TRUE, nMode, nStorageMode );
+ CreateStorage( sal_True, nMode, nStorageMode );
if ( IsOLEStorage() )
m_nVersion = SOFFICE_FILEFORMAT_50;
}
-void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode )
+void SotStorage::CreateStorage( sal_Bool bForceUCBStorage, StreamMode nMode, StorageMode nStorageMode )
{
DBG_ASSERT( !m_pStorStm && !m_pOwnStg, "Use only in ctor!" );
if( m_aName.Len() )
@@ -551,11 +551,11 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
if ( aURL.Len() )
{
::ucbhelper::Content aContent( aURL, ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XCommandEnvironment >() );
- m_pOwnStg = new UCBStorage( aContent, aURL, nMode, FALSE );
+ m_pOwnStg = new UCBStorage( aContent, aURL, nMode, sal_False );
}
else
{
- m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
SetError( ERRCODE_IO_NOTSUPPORTED );
}
}
@@ -569,7 +569,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
if ( m_pStorStm )
{
// try as UCBStorage, next try as OLEStorage
- BOOL bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm );
+ sal_Bool bIsUCBStorage = UCBStorage::IsStorageFile( m_pStorStm );
if ( !bIsUCBStorage && bForceUCBStorage )
// if UCBStorage has priority, it should not be used only if it is really an OLEStorage
bIsUCBStorage = !Storage::IsStorageFile( m_pStorStm );
@@ -579,8 +579,8 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
if ( UCBStorage::GetLinkedFile( *m_pStorStm ).Len() )
{
// detect special unpacked storages
- m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
- m_bDelStm = TRUE;
+ m_pOwnStg = new UCBStorage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
+ m_bDelStm = sal_True;
}
else
{
@@ -590,24 +590,24 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
// UCBStorage always works directly on the UCB content, so discard the stream first
DELETEZ( m_pStorStm );
- m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
}
}
else
{
// OLEStorage can be opened with a stream
- m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
- m_bDelStm = TRUE;
+ m_pOwnStg = new Storage( *m_pStorStm, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
+ m_bDelStm = sal_True;
}
}
else if ( bForceUCBStorage )
{
- m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
SetError( ERRCODE_IO_NOTSUPPORTED );
}
else
{
- m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
SetError( ERRCODE_IO_NOTSUPPORTED );
}
}
@@ -616,9 +616,9 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
{
// temporary storage
if ( bForceUCBStorage )
- m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new UCBStorage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
else
- m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
m_aName = m_pOwnStg->GetName();
}
@@ -627,7 +627,7 @@ void SotStorage::CreateStorage( BOOL bForceUCBStorage, StreamMode nMode, Storage
SignAsRoot( m_pOwnStg->IsRoot() );
}
-SotStorage::SotStorage( BOOL bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode )
+SotStorage::SotStorage( sal_Bool bUCBStorage, const String & rName, StreamMode nMode, StorageMode nStorageMode )
INIT_SotStorage()
{
m_aName = rName;
@@ -647,22 +647,22 @@ SotStorage::SotStorage( BaseStorage * pStor )
}
m_pOwnStg = pStor;
- ULONG nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE;
+ sal_uLong nErr = m_pOwnStg ? m_pOwnStg->GetError() : SVSTREAM_CANNOT_MAKE;
SetError( nErr );
if ( IsOLEStorage() )
m_nVersion = SOFFICE_FILEFORMAT_50;
}
-SotStorage::SotStorage( BOOL bUCBStorage, SvStream & rStm )
+SotStorage::SotStorage( sal_Bool bUCBStorage, SvStream & rStm )
INIT_SotStorage()
{
SetError( rStm.GetError() );
// try as UCBStorage, next try as OLEStorage
if ( UCBStorage::IsStorageFile( &rStm ) || bUCBStorage )
- m_pOwnStg = new UCBStorage( rStm, FALSE );
+ m_pOwnStg = new UCBStorage( rStm, sal_False );
else
- m_pOwnStg = new Storage( rStm, FALSE );
+ m_pOwnStg = new Storage( rStm, sal_False );
SetError( m_pOwnStg->GetError() );
@@ -679,9 +679,9 @@ SotStorage::SotStorage( SvStream & rStm )
// try as UCBStorage, next try as OLEStorage
if ( UCBStorage::IsStorageFile( &rStm ) )
- m_pOwnStg = new UCBStorage( rStm, FALSE );
+ m_pOwnStg = new UCBStorage( rStm, sal_False );
else
- m_pOwnStg = new Storage( rStm, FALSE );
+ m_pOwnStg = new Storage( rStm, sal_False );
SetError( m_pOwnStg->GetError() );
@@ -691,16 +691,16 @@ SotStorage::SotStorage( SvStream & rStm )
SignAsRoot( m_pOwnStg->IsRoot() );
}
-SotStorage::SotStorage( SvStream * pStm, BOOL bDelete )
+SotStorage::SotStorage( SvStream * pStm, sal_Bool bDelete )
INIT_SotStorage()
{
SetError( pStm->GetError() );
// try as UCBStorage, next try as OLEStorage
if ( UCBStorage::IsStorageFile( pStm ) )
- m_pOwnStg = new UCBStorage( *pStm, FALSE );
+ m_pOwnStg = new UCBStorage( *pStm, sal_False );
else
- m_pOwnStg = new Storage( *pStm, FALSE );
+ m_pOwnStg = new Storage( *pStm, sal_False );
SetError( m_pOwnStg->GetError() );
@@ -794,7 +794,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String&
UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg );
if ( pChildUCBStg )
{
- UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, FALSE, TRUE );
+ UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True );
if ( pTempStorage )
{
pChildUCBStg->CopyTo( pTempStorage );
@@ -892,7 +892,7 @@ SvMemoryStream * SotStorage::CreateMemoryStream()
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::IsStorageFile( const String & rFileName )
+sal_Bool SotStorage::IsStorageFile( const String & rFileName )
{
String aName( rFileName );
INetURLObject aObj( aName );
@@ -905,25 +905,25 @@ BOOL SotStorage::IsStorageFile( const String & rFileName )
}
SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ );
- BOOL bRet = SotStorage::IsStorageFile( pStm );
+ sal_Bool bRet = SotStorage::IsStorageFile( pStm );
delete pStm;
return bRet;
}
-BOOL SotStorage::IsStorageFile( SvStream* pStream )
+sal_Bool SotStorage::IsStorageFile( SvStream* pStream )
{
/** code for new storages must come first! **/
if ( pStream )
{
long nPos = pStream->Tell();
- BOOL bRet = UCBStorage::IsStorageFile( pStream );
+ sal_Bool bRet = UCBStorage::IsStorageFile( pStream );
if ( !bRet )
bRet = Storage::IsStorageFile( pStream );
pStream->Seek( nPos );
return bRet;
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|* SotStorage::GetStorage()
@@ -969,7 +969,7 @@ void SotStorage::ResetError()
|* Beschreibung
*************************************************************************/
void SotStorage::SetClass( const SvGlobalName & rName,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName )
{
DBG_ASSERT( Owner(), "must be owner" );
@@ -980,7 +980,7 @@ void SotStorage::SetClass( const SvGlobalName & rName,
}
void SotStorage::SetConvertClass( const SvGlobalName & rName,
- ULONG nOriginalClipFormat,
+ sal_uLong nOriginalClipFormat,
const String & rUserTypeName )
{
DBG_ASSERT( Owner(), "must be owner" );
@@ -1009,9 +1009,9 @@ SvGlobalName SotStorage::GetClassName()
return aGN;
}
-ULONG SotStorage::GetFormat()
+sal_uLong SotStorage::GetFormat()
{
- ULONG nFormat = 0;
+ sal_uLong nFormat = 0;
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
nFormat = m_pOwnStg->GetFormat();
@@ -1031,14 +1031,14 @@ String SotStorage::GetUserName()
return aName;
}
-BOOL SotStorage::ShouldConvert()
+sal_Bool SotStorage::ShouldConvert()
{
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
return m_pOwnStg->ShouldConvert();
else
SetError( SVSTREAM_GENERALERROR );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1058,7 +1058,7 @@ void SotStorage::FillInfoList( SvStorageInfoList * pFillList ) const
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::CopyTo( SotStorage * pDestStg )
+sal_Bool SotStorage::CopyTo( SotStorage * pDestStg )
{
DBG_ASSERT( Owner(), "must be owner" );
DBG_ASSERT( pDestStg->Owner(), "must be owner" );
@@ -1079,7 +1079,7 @@ BOOL SotStorage::CopyTo( SotStorage * pDestStg )
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::Commit()
+sal_Bool SotStorage::Commit()
{
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
@@ -1097,7 +1097,7 @@ BOOL SotStorage::Commit()
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::Revert()
+sal_Bool SotStorage::Revert()
{
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
@@ -1129,7 +1129,7 @@ SotStorageStream * SotStorage::OpenEncryptedSotStream( const String & rEleName,
nMode |= STREAM_SHARE_DENYALL;
ErrCode nE = m_pOwnStg->GetError();
BaseStorageStream* p = m_pOwnStg->OpenStream( rEleName, nMode,
- (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE, &rKey );
+ (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True, &rKey );
pStm = new SotStorageStream( p );
if( !nE )
@@ -1156,7 +1156,7 @@ SotStorageStream * SotStorage::OpenSotStream( const String & rEleName,
nMode |= STREAM_SHARE_DENYALL;
ErrCode nE = m_pOwnStg->GetError();
BaseStorageStream * p = m_pOwnStg->OpenStream( rEleName, nMode,
- (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
pStm = new SotStorageStream( p );
if( !nE )
@@ -1185,7 +1185,7 @@ SotStorage * SotStorage::OpenSotStorage( const String & rEleName,
nMode |= STREAM_SHARE_DENYALL;
ErrCode nE = m_pOwnStg->GetError();
BaseStorage * p = m_pOwnStg->OpenStorage( rEleName, nMode,
- (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
if( p )
{
pStor = new SotStorage( p );
@@ -1212,7 +1212,7 @@ SotStorage * SotStorage::OpenUCBStorage( const String & rEleName,
nMode |= STREAM_SHARE_DENYALL;
ErrCode nE = m_pOwnStg->GetError();
BaseStorage * p = m_pOwnStg->OpenUCBStorage( rEleName, nMode,
- (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
pStor = new SotStorage( p );
if( !nE )
m_pOwnStg->ResetError(); // kein Fehler setzen
@@ -1233,7 +1233,7 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName,
nMode |= STREAM_SHARE_DENYALL;
ErrCode nE = m_pOwnStg->GetError();
BaseStorage * p = m_pOwnStg->OpenOLEStorage( rEleName, nMode,
- (nStorageMode & STORAGE_TRANSACTED) ? FALSE : TRUE );
+ (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True );
pStor = new SotStorage( p );
if( !nE )
m_pOwnStg->ResetError(); // kein Fehler setzen
@@ -1250,31 +1250,31 @@ SotStorage * SotStorage::OpenOLEStorage( const String & rEleName,
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::IsStorage( const String & rEleName ) const
+sal_Bool SotStorage::IsStorage( const String & rEleName ) const
{
DBG_ASSERT( Owner(), "must be owner" );
// ein bisschen schneller
if( m_pOwnStg )
return m_pOwnStg->IsStorage( rEleName );
- return FALSE;
+ return sal_False;
}
-BOOL SotStorage::IsStream( const String & rEleName ) const
+sal_Bool SotStorage::IsStream( const String & rEleName ) const
{
DBG_ASSERT( Owner(), "must be owner" );
// ein bisschen schneller
if( m_pOwnStg )
return m_pOwnStg->IsStream( rEleName );
- return FALSE;
+ return sal_False;
}
-BOOL SotStorage::IsContained( const String & rEleName ) const
+sal_Bool SotStorage::IsContained( const String & rEleName ) const
{
DBG_ASSERT( Owner(), "must be owner" );
// ein bisschen schneller
if( m_pOwnStg )
return m_pOwnStg->IsContained( rEleName );
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1282,7 +1282,7 @@ BOOL SotStorage::IsContained( const String & rEleName ) const
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::Remove( const String & rEleName )
+sal_Bool SotStorage::Remove( const String & rEleName )
{
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
@@ -1300,7 +1300,7 @@ BOOL SotStorage::Remove( const String & rEleName )
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::Rename( const String & rEleName, const String & rNewName )
+sal_Bool SotStorage::Rename( const String & rEleName, const String & rNewName )
{
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
@@ -1318,7 +1318,7 @@ BOOL SotStorage::Rename( const String & rEleName, const String & rNewName )
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::CopyTo( const String & rEleName,
+sal_Bool SotStorage::CopyTo( const String & rEleName,
SotStorage * pNewSt, const String & rNewName )
{
DBG_ASSERT( Owner(), "must be owner" );
@@ -1339,7 +1339,7 @@ BOOL SotStorage::CopyTo( const String & rEleName,
|*
|* Beschreibung
*************************************************************************/
-BOOL SotStorage::MoveTo( const String & rEleName,
+sal_Bool SotStorage::MoveTo( const String & rEleName,
SotStorage * pNewSt, const String & rNewName )
{
DBG_ASSERT( Owner(), "must be owner" );
@@ -1374,16 +1374,16 @@ SvStream* SotStorage::GetTargetSvStream() const
}
-BOOL SotStorage::Validate()
+sal_Bool SotStorage::Validate()
{
DBG_ASSERT( m_bIsRoot, "Validate nur an Rootstorage" );
if( m_pOwnStg )
return m_pOwnStg->ValidateFAT();
else
- return TRUE;
+ return sal_True;
}
-BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
if ( pStg )
@@ -1393,11 +1393,11 @@ BOOL SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::
else
{
DBG_WARNING("W1:Not implemented!");
- return FALSE;
+ return sal_False;
}
}
-BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
if ( pStg )
@@ -1407,20 +1407,20 @@ BOOL SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& r
else if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL )
{
String aStr = SotExchange::GetFormatMimeType( GetFormat() );
- USHORT nPos = aStr.Search(';');
+ sal_uInt16 nPos = aStr.Search(';');
if ( nPos != STRING_NOTFOUND )
aStr = aStr.Copy( 0, nPos );
rValue <<= (::rtl::OUString) aStr;
- return TRUE;
+ return sal_True;
}
else
{
DBG_WARNING("W1:Not implemented!");
- return FALSE;
+ return sal_False;
}
}
-BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue )
{
UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
if ( pStg )
@@ -1430,22 +1430,22 @@ BOOL SotStorage::GetProperty( const String& rEleName, const String& rName, ::com
else
{
DBG_WARNING("W1:Not implemented!");
- return FALSE;
+ return sal_False;
}
}
-BOOL SotStorage::IsOLEStorage() const
+sal_Bool SotStorage::IsOLEStorage() const
{
UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
return !pStg;
}
-BOOL SotStorage::IsOLEStorage( const String & rFileName )
+sal_Bool SotStorage::IsOLEStorage( const String & rFileName )
{
return Storage::IsStorageFile( rFileName );
}
-BOOL SotStorage::IsOLEStorage( SvStream* pStream )
+sal_Bool SotStorage::IsOLEStorage( SvStream* pStream )
{
return Storage::IsStorageFile( pStream );
}
@@ -1502,7 +1502,7 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c
pStream->SetError( ERRCODE_IO_GENERAL );
}
- return new SotStorage( pStream, TRUE );
+ return new SotStorage( pStream, sal_True );
}
sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx
index 3859bcd5ee6c..1cdde1a45104 100644
--- a/sot/source/sdstor/storinfo.cxx
+++ b/sot/source/sdstor/storinfo.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sot.hxx"
-#include <stg.hxx>
-#include <storinfo.hxx>
+#include <sot/stg.hxx>
+#include <sot/storinfo.hxx>
#include <sot/exchange.hxx>
@@ -40,7 +40,7 @@ PRV_SV_IMPL_OWNER_LIST(SvStorageInfoList,SvStorageInfo)
const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName )
{
- for( ULONG i = 0; i < Count(); i++ )
+ for( sal_uLong i = 0; i < Count(); i++ )
{
const SvStorageInfo & rType = GetObject( i );
if( rType.GetName() == rEleName )
@@ -51,10 +51,10 @@ const SvStorageInfo * SvStorageInfoList::Get( const String & rEleName )
/************** class SvStorageInfo **************************************
*************************************************************************/
-ULONG ReadClipboardFormat( SvStream & rStm )
+sal_uLong ReadClipboardFormat( SvStream & rStm )
{
sal_uInt32 nFormat = 0;
- INT32 nLen = 0;
+ sal_Int32 nLen = 0;
rStm >> nLen;
if( rStm.IsEof() )
rStm.SetError( SVSTREAM_GENERALERROR );
@@ -62,7 +62,7 @@ ULONG ReadClipboardFormat( SvStream & rStm )
{
// get a string name
sal_Char * p = new sal_Char[ nLen ];
- if( rStm.Read( p, nLen ) == (ULONG) nLen )
+ if( rStm.Read( p, nLen ) == (sal_uLong) nLen )
{
nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) );
}
@@ -89,7 +89,7 @@ ULONG ReadClipboardFormat( SvStream & rStm )
return nFormat;
}
-void WriteClipboardFormat( SvStream & rStm, ULONG nFormat )
+void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat )
{
// determine the clipboard format string
String aCbFmt;
@@ -98,15 +98,15 @@ void WriteClipboardFormat( SvStream & rStm, ULONG nFormat )
if( aCbFmt.Len() )
{
ByteString aAsciiCbFmt( aCbFmt, RTL_TEXTENCODING_ASCII_US );
- rStm << (INT32) (aAsciiCbFmt.Len() + 1);
+ rStm << (sal_Int32) (aAsciiCbFmt.Len() + 1);
rStm << (const char *)aAsciiCbFmt.GetBuffer();
- rStm << (UINT8) 0;
+ rStm << (sal_uInt8) 0;
}
else if( nFormat )
- rStm << (INT32) -1 // for Windows
- << (INT32) nFormat;
+ rStm << (sal_Int32) -1 // for Windows
+ << (sal_Int32) nFormat;
else
- rStm << (INT32) 0; // no clipboard format
+ rStm << (sal_Int32) 0; // no clipboard format
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 0d0163f20252..d234ec236415 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -66,12 +66,12 @@
#include <cppuhelper/implbase2.hxx>
#include <ucbhelper/commandenvironment.hxx>
-#include "stg.hxx"
-#include "storinfo.hxx"
+#include "sot/stg.hxx"
+#include "sot/storinfo.hxx"
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
-#include "clsids.hxx"
+#include "sot/clsids.hxx"
#include "unostorageholder.hxx"
@@ -426,10 +426,10 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream
~UCBStorageStream_Impl();
public:
- virtual ULONG GetData( void* pData, ULONG nSize );
- virtual ULONG PutData( const void* pData, ULONG nSize );
- virtual ULONG SeekPos( ULONG nPos );
- virtual void SetSize( ULONG nSize );
+ virtual sal_uLong GetData( void* pData, sal_uLong nSize );
+ virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
+ virtual sal_uLong SeekPos( sal_uLong nPos );
+ virtual void SetSize( sal_uLong nSize );
virtual void FlushData();
virtual void ResetError();
@@ -449,29 +449,29 @@ public:
RepresentModes m_nRepresentMode; // should it be used as XInputStream or as SvStream
long m_nError;
StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing )
- BOOL m_bSourceRead; // Source still contains useful information
- BOOL m_bModified; // only modified streams will be sent to the original content
- BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package
- BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages
+ sal_Bool m_bSourceRead; // Source still contains useful information
+ sal_Bool m_bModified; // only modified streams will be sent to the original content
+ sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package
+ sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages
// this means that the root storage does an autocommit when its external
// reference is destroyed
- BOOL m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream
+ sal_Bool m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream
- UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, BOOL, const ByteString* pKey=0, BOOL bRepair = FALSE, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() );
+ UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, sal_Bool, const ByteString* pKey=0, sal_Bool bRepair = sal_False, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() );
void Free();
- BOOL Init();
- BOOL Clear();
+ sal_Bool Init();
+ sal_Bool Clear();
sal_Int16 Commit(); // if modified and commited: transfer an XInputStream to the content
- BOOL Revert(); // discard all changes
+ sal_Bool Revert(); // discard all changes
BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream
- ULONG GetSize();
+ sal_uLong GetSize();
- ULONG ReadSourceWriteTemporary( ULONG aLength ); // read aLength from source and copy to temporary,
+ sal_uLong ReadSourceWriteTemporary( sal_uLong aLength ); // read aLength from source and copy to temporary,
// no seeking is produced
- ULONG ReadSourceWriteTemporary(); // read source till the end and copy to temporary,
+ sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary,
- ULONG CopySourceToTemporary(); // same as ReadSourceWriteToTemporary()
+ sal_uLong CopySourceToTemporary(); // same as ReadSourceWriteToTemporary()
// but the writing is done at the end of temporary
// pointer position is not changed
Reference<XInputStream> GetXInputStream(); // return XInputStream, after that
@@ -503,34 +503,34 @@ public:
SvStream* m_pSource; // original stream, only for storages on a stream
long m_nError;
StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing )
- BOOL m_bModified; // only modified elements will be sent to the original content
- BOOL m_bCommited; // sending the streams is coordinated by the root storage of the package
- BOOL m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages
+ sal_Bool m_bModified; // only modified elements will be sent to the original content
+ sal_Bool m_bCommited; // sending the streams is coordinated by the root storage of the package
+ sal_Bool m_bDirect; // the storage and its streams are opened in direct mode; for UCBStorages
// this means that the root storage does an autocommit when its external
// reference is destroyed
- BOOL m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts
- BOOL m_bDirty; // ???
- BOOL m_bIsLinked;
- BOOL m_bListCreated;
- ULONG m_nFormat;
+ sal_Bool m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts
+ sal_Bool m_bDirty; // ???
+ sal_Bool m_bIsLinked;
+ sal_Bool m_bListCreated;
+ sal_uLong m_nFormat;
String m_aUserTypeName;
SvGlobalName m_aClassId;
UCBStorageElementList_Impl m_aChildrenList;
- BOOL m_bRepairPackage;
+ sal_Bool m_bRepairPackage;
Reference< XProgressHandler > m_xProgressHandler;
UNOStorageHolderList* m_pUNOStorageHolderList;
- UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() );
- UCBStorage_Impl( const String&, StreamMode, UCBStorage*, BOOL, BOOL, BOOL = FALSE, Reference< XProgressHandler > = Reference< XProgressHandler >() );
- UCBStorage_Impl( SvStream&, UCBStorage*, BOOL );
+ UCBStorage_Impl( const ::ucbhelper::Content&, const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() );
+ UCBStorage_Impl( const String&, StreamMode, UCBStorage*, sal_Bool, sal_Bool, sal_Bool = sal_False, Reference< XProgressHandler > = Reference< XProgressHandler >() );
+ UCBStorage_Impl( SvStream&, UCBStorage*, sal_Bool );
void Init();
sal_Int16 Commit();
- BOOL Revert();
- BOOL Insert( ::ucbhelper::Content *pContent );
- UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect );
- UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, BOOL, const ByteString* pKey=0 );
+ sal_Bool Revert();
+ sal_Bool Insert( ::ucbhelper::Content *pContent );
+ UCBStorage_Impl* OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect );
+ UCBStorageStream_Impl* OpenStream( UCBStorageElement_Impl*, StreamMode, sal_Bool, const ByteString* pKey=0 );
void SetProps( const Sequence < Sequence < PropertyValue > >& rSequence, const String& );
void GetProps( sal_Int32&, Sequence < Sequence < PropertyValue > >& rSequence, const String& );
sal_Int32 GetObjectCount();
@@ -565,32 +565,32 @@ struct UCBStorageElement_Impl
{
String m_aName; // the actual URL relative to the root "folder"
String m_aOriginalName;// the original name in the content
- ULONG m_nSize;
- BOOL m_bIsFolder; // Only TRUE when it is a UCBStorage !
- BOOL m_bIsStorage; // Also TRUE when it is an OLEStorage !
- BOOL m_bIsRemoved; // element will be removed on commit
- BOOL m_bIsInserted; // element will be removed on revert
+ sal_uLong m_nSize;
+ sal_Bool m_bIsFolder; // Only sal_True when it is a UCBStorage !
+ sal_Bool m_bIsStorage; // Also sal_True when it is an OLEStorage !
+ sal_Bool m_bIsRemoved; // element will be removed on commit
+ sal_Bool m_bIsInserted; // element will be removed on revert
UCBStorage_ImplRef m_xStorage; // reference to the "real" storage
UCBStorageStream_ImplRef m_xStream; // reference to the "real" stream
UCBStorageElement_Impl( const ::rtl::OUString& rName,
- BOOL bIsFolder = FALSE, ULONG nSize = 0 )
+ sal_Bool bIsFolder = sal_False, sal_uLong nSize = 0 )
: m_aName( rName )
, m_aOriginalName( rName )
, m_nSize( nSize )
, m_bIsFolder( bIsFolder )
, m_bIsStorage( bIsFolder )
- , m_bIsRemoved( FALSE )
- , m_bIsInserted( FALSE )
+ , m_bIsRemoved( sal_False )
+ , m_bIsInserted( sal_False )
{
}
::ucbhelper::Content* GetContent();
- BOOL IsModified();
+ sal_Bool IsModified();
String GetContentType();
void SetContentType( const String& );
String GetOriginalContentType();
- BOOL IsLoaded()
+ sal_Bool IsLoaded()
{ return m_xStream.Is() || m_xStorage.Is(); }
};
@@ -640,9 +640,9 @@ String UCBStorageElement_Impl::GetOriginalContentType()
return String();
}
-BOOL UCBStorageElement_Impl::IsModified()
+sal_Bool UCBStorageElement_Impl::IsModified()
{
- BOOL bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName;
+ sal_Bool bModified = m_bIsRemoved || m_bIsInserted || m_aName != m_aOriginalName;
if ( bModified )
{
if ( m_xStream.Is() )
@@ -654,7 +654,7 @@ BOOL UCBStorageElement_Impl::IsModified()
return bModified;
}
-UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress )
+UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress )
: m_pAntiImpl( pStream )
, m_aURL( rName )
, m_pContent( NULL )
@@ -663,10 +663,10 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM
, m_nError( 0 )
, m_nMode( nMode )
, m_bSourceRead( !( nMode & STREAM_TRUNC ) )
- , m_bModified( FALSE )
- , m_bCommited( FALSE )
+ , m_bModified( sal_False )
+ , m_bCommited( sal_False )
, m_bDirect( bDirect )
- , m_bIsOLEStorage( FALSE )
+ , m_bIsOLEStorage( sal_False )
{
// name is last segment in URL
INetURLObject aObj( rName );
@@ -751,7 +751,7 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream()
CopySourceToTemporary();
// owner transfer of stream to wrapper
- aResult = new ::utl::OInputStreamWrapper( m_pStream, TRUE );
+ aResult = new ::utl::OInputStreamWrapper( m_pStream, sal_True );
m_pStream->Seek(0);
if( aResult.is() )
@@ -788,13 +788,13 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream()
return aResult;
}
-BOOL UCBStorageStream_Impl::Init()
+sal_Bool UCBStorageStream_Impl::Init()
{
if( m_nRepresentMode == xinputstream )
{
OSL_FAIL( "XInputStream misuse!" );
SetError( ERRCODE_IO_ACCESSDENIED );
- return FALSE;
+ return sal_False;
}
if( !m_pStream )
@@ -816,7 +816,7 @@ BOOL UCBStorageStream_Impl::Init()
{
OSL_FAIL( "Suspicious temporary stream creation!" );
SetError( SVSTREAM_CANNOT_MAKE );
- return FALSE;
+ return sal_False;
}
SetError( m_pStream->GetError() );
@@ -847,12 +847,12 @@ BOOL UCBStorageStream_Impl::Init()
catch( BufferSizeExceededException& )
{
// the temporary stream already contain all the data
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
}
catch( Exception& )
{
// something is really wrong
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
OSL_FAIL( "Can not operate original stream!" );
SetError( SVSTREAM_CANNOT_MAKE );
}
@@ -862,7 +862,7 @@ BOOL UCBStorageStream_Impl::Init()
else
{
// if the new file is edited than no source exist
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
//SetError( SVSTREAM_CANNOT_MAKE );
}
}
@@ -872,12 +872,12 @@ BOOL UCBStorageStream_Impl::Init()
return sal_True;
}
-ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary()
+sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary()
{
// read source stream till the end and copy all the data to
// the current position of the temporary stream
- ULONG aResult = 0;
+ sal_uLong aResult = 0;
if( m_bSourceRead )
{
@@ -885,7 +885,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary()
try
{
- ULONG aReaded;
+ sal_uLong aReaded;
do
{
aReaded = m_rSource->readBytes( aData, 32000 );
@@ -895,7 +895,7 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary()
#if OSL_DEBUG_LEVEL > 1
catch( Exception & e )
{
- OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
catch( Exception & )
{
@@ -903,18 +903,18 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary()
}
}
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
return aResult;
}
-ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength )
+sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength )
{
// read aLength bite from the source stream and copy them to the current
// position of the temporary stream
- ULONG aResult = 0;
+ sal_uLong aResult = 0;
if( m_bSourceRead )
{
@@ -923,22 +923,22 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength )
try
{
- ULONG aReaded = 32000;
+ sal_uLong aReaded = 32000;
- for( ULONG pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 )
+ for( sal_uLong pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 )
{
- ULONG aToCopy = min( aLength - pInd, 32000 );
+ sal_uLong aToCopy = min( aLength - pInd, 32000 );
aReaded = m_rSource->readBytes( aData, aToCopy );
aResult += m_pStream->Write( aData.getArray(), aReaded );
}
if( aResult < aLength )
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
}
#if OSL_DEBUG_LEVEL > 1
catch( Exception & e )
{
- OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
catch( Exception & )
{
@@ -949,14 +949,14 @@ ULONG UCBStorageStream_Impl::ReadSourceWriteTemporary( ULONG aLength )
return aResult;
}
-ULONG UCBStorageStream_Impl::CopySourceToTemporary()
+sal_uLong UCBStorageStream_Impl::CopySourceToTemporary()
{
// current position of the temporary stream is not changed
- ULONG aResult = 0;
+ sal_uLong aResult = 0;
if( m_bSourceRead )
{
- ULONG aPos = m_pStream->Tell();
+ sal_uLong aPos = m_pStream->Tell();
m_pStream->Seek( STREAM_SEEK_TO_END );
aResult = ReadSourceWriteTemporary();
m_pStream->Seek( aPos );
@@ -968,9 +968,9 @@ ULONG UCBStorageStream_Impl::CopySourceToTemporary()
// UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream
// of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified
-ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize )
+sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
{
- ULONG aResult = 0;
+ sal_uLong aResult = 0;
if( !Init() )
return 0;
@@ -983,20 +983,20 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize )
// read the tail of the data from original stream
// copy this tail to the temporary stream
- ULONG aToRead = nSize - aResult;
+ sal_uLong aToRead = nSize - aResult;
pData = (void*)( (char*)pData + aResult );
try
{
Sequence<sal_Int8> aData( aToRead );
- ULONG aReaded = m_rSource->readBytes( aData, aToRead );
+ sal_uLong aReaded = m_rSource->readBytes( aData, aToRead );
aResult += m_pStream->Write( (void*)aData.getArray(), aReaded );
memcpy( pData, aData.getArray(), aReaded );
}
#if OSL_DEBUG_LEVEL > 1
catch( Exception & e )
{
- OSL_ENSURE( FALSE, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ OSL_ENSURE( sal_False, ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
#else
catch( Exception & )
{
@@ -1004,13 +1004,13 @@ ULONG UCBStorageStream_Impl::GetData( void* pData, ULONG nSize )
}
if( aResult < nSize )
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
}
return aResult;
}
-ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize )
+sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize )
{
if ( !(m_nMode & STREAM_WRITE) )
{
@@ -1021,7 +1021,7 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize )
if( !nSize || !Init() )
return 0;
- ULONG aResult = m_pStream->Write( pData, nSize );
+ sal_uLong aResult = m_pStream->Write( pData, nSize );
m_bModified = aResult > 0;
@@ -1029,12 +1029,12 @@ ULONG UCBStorageStream_Impl::PutData( const void* pData, ULONG nSize )
}
-ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos )
+sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos )
{
if( !Init() )
return 0;
- ULONG aResult;
+ sal_uLong aResult;
if( nPos == STREAM_SEEK_TO_END )
{
@@ -1065,7 +1065,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos )
{
aResult += ReadSourceWriteTemporary( nPos - aResult );
if( aResult < nPos )
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
DBG_ASSERT( aResult == m_pStream->Tell(), "Error in stream arithmetic!\n" );
}
@@ -1086,7 +1086,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos )
return aResult;
}
-void UCBStorageStream_Impl::SetSize( ULONG nSize )
+void UCBStorageStream_Impl::SetSize( sal_uLong nSize )
{
if ( !(m_nMode & STREAM_WRITE) )
{
@@ -1097,11 +1097,11 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize )
if( !Init() )
return;
- m_bModified = TRUE;
+ m_bModified = sal_True;
if( m_bSourceRead )
{
- ULONG aPos = m_pStream->Tell();
+ sal_uLong aPos = m_pStream->Tell();
m_pStream->Seek( STREAM_SEEK_TO_END );
if( m_pStream->Tell() < nSize )
ReadSourceWriteTemporary( nSize - m_pStream->Tell() );
@@ -1109,7 +1109,7 @@ void UCBStorageStream_Impl::SetSize( ULONG nSize )
}
m_pStream->SetStreamSize( nSize );
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
}
void UCBStorageStream_Impl::FlushData()
@@ -1120,7 +1120,7 @@ void UCBStorageStream_Impl::FlushData()
m_pStream->Flush();
}
- m_bCommited = TRUE;
+ m_bCommited = sal_True;
}
void UCBStorageStream_Impl::SetError( sal_uInt32 nErr )
@@ -1141,15 +1141,15 @@ void UCBStorageStream_Impl::ResetError()
m_pAntiImpl->ResetError();
}
-ULONG UCBStorageStream_Impl::GetSize()
+sal_uLong UCBStorageStream_Impl::GetSize()
{
if( !Init() )
return 0;
- ULONG nPos = m_pStream->Tell();
+ sal_uLong nPos = m_pStream->Tell();
m_pStream->Seek( STREAM_SEEK_TO_END );
ReadSourceWriteTemporary();
- ULONG nRet = m_pStream->Tell();
+ sal_uLong nRet = m_pStream->Tell();
m_pStream->Seek( nPos );
return nRet;
@@ -1209,8 +1209,8 @@ sal_Int16 UCBStorageStream_Impl::Commit()
INetURLObject aObj( m_aURL );
aObj.SetName( m_aName );
m_aURL = aObj.GetMainURL( INetURLObject::NO_DECODE );
- m_bModified = FALSE;
- m_bSourceRead = TRUE;
+ m_bModified = sal_False;
+ m_bSourceRead = sal_True;
}
catch ( CommandAbortedException& )
{
@@ -1231,7 +1231,7 @@ sal_Int16 UCBStorageStream_Impl::Commit()
return COMMIT_RESULT_FAILURE;
}
- m_bCommited = FALSE;
+ m_bCommited = sal_False;
return COMMIT_RESULT_SUCCESS;
}
}
@@ -1239,13 +1239,13 @@ sal_Int16 UCBStorageStream_Impl::Commit()
return COMMIT_RESULT_NOTHING_TO_DO;
}
-BOOL UCBStorageStream_Impl::Revert()
+sal_Bool UCBStorageStream_Impl::Revert()
{
// if an OLEStorage is created on this stream, no "revert" is neccessary because OLEStorages do nothing on "Revert" !
if ( m_bCommited )
{
OSL_FAIL("Revert while commit is in progress!" );
- return FALSE; // ???
+ return sal_False; // ???
}
Free();
@@ -1255,7 +1255,7 @@ BOOL UCBStorageStream_Impl::Revert()
m_aTempURL.Erase();
}
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
try
{
m_rSource = m_pContent->openStream();
@@ -1263,11 +1263,11 @@ BOOL UCBStorageStream_Impl::Revert()
{
if ( m_pAntiImpl && ( m_nMode & STREAM_TRUNC ) )
// stream is in use and should be truncated
- m_bSourceRead = FALSE;
+ m_bSourceRead = sal_False;
else
{
m_nMode &= ~STREAM_TRUNC;
- m_bSourceRead = TRUE;
+ m_bSourceRead = sal_True;
}
}
else
@@ -1285,15 +1285,15 @@ BOOL UCBStorageStream_Impl::Revert()
{
}
- m_bModified = FALSE;
+ m_bModified = sal_False;
m_aName = m_aOriginalName;
m_aContentType = m_aOriginalContentType;
return ( GetError() == ERRCODE_NONE );
}
-BOOL UCBStorageStream_Impl::Clear()
+sal_Bool UCBStorageStream_Impl::Clear()
{
- BOOL bRet = ( m_pAntiImpl == NULL );
+ sal_Bool bRet = ( m_pAntiImpl == NULL );
DBG_ASSERT( bRet, "Removing used stream!" );
if( bRet )
{
@@ -1344,7 +1344,7 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode )
}
}
-UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey )
+UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
// to class UCBStorageStream !
@@ -1353,7 +1353,7 @@ UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL
StorageBase::m_nMode = pImp->m_nMode;
}
-UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, BOOL bDirect, const ByteString* pKey, BOOL bRepair, Reference< XProgressHandler > xProgress )
+UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
// to class UCBStorageStream !
@@ -1380,13 +1380,13 @@ UCBStorageStream::~UCBStorageStream()
pImp->ReleaseRef();
}
-ULONG UCBStorageStream::Read( void * pData, ULONG nSize )
+sal_uLong UCBStorageStream::Read( void * pData, sal_uLong nSize )
{
//return pImp->m_pStream->Read( pData, nSize );
return pImp->GetData( pData, nSize );
}
-ULONG UCBStorageStream::Write( const void* pData, ULONG nSize )
+sal_uLong UCBStorageStream::Write( const void* pData, sal_uLong nSize )
{
/*
// mba: does occur in writer !
@@ -1396,18 +1396,18 @@ ULONG UCBStorageStream::Write( const void* pData, ULONG nSize )
return 0;
}
*/
- // pImp->m_bModified = TRUE;
+ // pImp->m_bModified = sal_True;
//return pImp->m_pStream->Write( pData, nSize );
return pImp->PutData( pData, nSize );
}
-ULONG UCBStorageStream::Seek( ULONG nPos )
+sal_uLong UCBStorageStream::Seek( sal_uLong nPos )
{
//return pImp->m_pStream->Seek( nPos );
return pImp->Seek( nPos );
}
-ULONG UCBStorageStream::Tell()
+sal_uLong UCBStorageStream::Tell()
{
if( !pImp->Init() )
return 0;
@@ -1420,32 +1420,32 @@ void UCBStorageStream::Flush()
Commit();
}
-BOOL UCBStorageStream::SetSize( ULONG nNewSize )
+sal_Bool UCBStorageStream::SetSize( sal_uLong nNewSize )
{
/*
if ( pImp->m_bCommited )
{
OSL_FAIL("Changing stream size while commit is in progress!" );
- return FALSE;
+ return sal_False;
}
*/
- // pImp->m_bModified = TRUE;
+ // pImp->m_bModified = sal_True;
//return pImp->m_pStream->SetStreamSize( nNewSize );
pImp->SetSize( nNewSize );
return !pImp->GetError();
}
-BOOL UCBStorageStream::Validate( BOOL bWrite ) const
+sal_Bool UCBStorageStream::Validate( sal_Bool bWrite ) const
{
return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) );
}
-BOOL UCBStorageStream::ValidateMode( StreamMode m ) const
+sal_Bool UCBStorageStream::ValidateMode( StreamMode m ) const
{
// ???
if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx
- return TRUE;
- USHORT nCurMode = 0xFFFF;
+ return sal_True;
+ sal_uInt16 nCurMode = 0xFFFF;
if( ( m & 3 ) == STREAM_READ )
{
// only SHARE_DENYWRITE or SHARE_DENYALL allowed
@@ -1453,7 +1453,7 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const
&& ( nCurMode & STREAM_SHARE_DENYWRITE ) )
|| ( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) ) )
- return TRUE;
+ return sal_True;
}
else
{
@@ -1462,10 +1462,10 @@ BOOL UCBStorageStream::ValidateMode( StreamMode m ) const
// the commit may fail
if( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) )
- return TRUE;
+ return sal_True;
}
- return TRUE;
+ return sal_True;
}
const SvStream* UCBStorageStream::GetSvStream() const
@@ -1487,28 +1487,28 @@ Reference< XInputStream > UCBStorageStream::GetXInputStream() const
return pImp->GetXInputStream();
}
-BOOL UCBStorageStream::Equals( const BaseStorageStream& rStream ) const
+sal_Bool UCBStorageStream::Equals( const BaseStorageStream& rStream ) const
{
// ???
return ((BaseStorageStream*) this ) == &rStream;
}
-BOOL UCBStorageStream::Commit()
+sal_Bool UCBStorageStream::Commit()
{
// mark this stream for sending it on root commit
pImp->FlushData();
- return TRUE;
+ return sal_True;
}
-BOOL UCBStorageStream::Revert()
+sal_Bool UCBStorageStream::Revert()
{
return pImp->Revert();
}
-BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
+sal_Bool UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
{
if( !pImp->Init() )
- return FALSE;
+ return sal_False;
UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pDestStm );
if ( pStg )
@@ -1516,18 +1516,18 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
pDestStm->SetSize( 0 );
Seek( STREAM_SEEK_TO_END );
- INT32 n = Tell();
+ sal_Int32 n = Tell();
if( n < 0 )
- return FALSE;
+ return sal_False;
if( pDestStm->SetSize( n ) && n )
{
- BYTE* p = new BYTE[ 4096 ];
+ sal_uInt8* p = new sal_uInt8[ 4096 ];
Seek( 0L );
pDestStm->Seek( 0L );
while( n )
{
- UINT32 nn = n;
+ sal_uInt32 nn = n;
if( nn > 4096 )
nn = 4096;
if( Read( p, nn ) != nn )
@@ -1540,13 +1540,13 @@ BOOL UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
delete[] p;
}
- return TRUE;
+ return sal_True;
}
-BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+sal_Bool UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
if ( rName.CompareToAscii("Title") == COMPARE_EQUAL )
- return FALSE;
+ return sal_False;
if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL )
{
@@ -1560,34 +1560,34 @@ BOOL UCBStorageStream::SetProperty( const String& rName, const ::com::sun::star:
if ( pImp->m_pContent )
{
pImp->m_pContent->setPropertyValue( rName, rValue );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
{
}
- return FALSE;
+ return sal_False;
}
-BOOL UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
try
{
if ( pImp->m_pContent )
{
rValue = pImp->m_pContent->getPropertyValue( rName );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
{
}
- return FALSE;
+ return sal_False;
}
-UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect )
+UCBStorage::UCBStorage( SvStream& rStrm, sal_Bool bDirect )
{
String aURL = GetLinkedFile( rStrm );
if ( aURL.Len() )
@@ -1597,7 +1597,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect )
nMode = STREAM_READ | STREAM_WRITE;
::ucbhelper::Content aContent( aURL, Reference < XCommandEnvironment >() );
- pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, TRUE );
+ pImp = new UCBStorage_Impl( aContent, aURL, nMode, this, bDirect, sal_True );
}
else
{
@@ -1611,7 +1611,7 @@ UCBStorage::UCBStorage( SvStream& rStrm, BOOL bDirect )
StorageBase::m_nMode = pImp->m_nMode;
}
-UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot )
+UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
// to class UCBStorage !
@@ -1621,7 +1621,7 @@ UCBStorage::UCBStorage( const ::ucbhelper::Content& rContent, const String& rNam
StorageBase::m_nMode = pImp->m_nMode;
}
-UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler )
+UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
// to class UCBStorage !
@@ -1631,7 +1631,7 @@ UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOO
StorageBase::m_nMode = pImp->m_nMode;
}
-UCBStorage::UCBStorage( const String& rName, StreamMode nMode, BOOL bDirect, BOOL bIsRoot )
+UCBStorage::UCBStorage( const String& rName, StreamMode nMode, sal_Bool bDirect, sal_Bool bIsRoot )
{
// pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
// to class UCBStorage !
@@ -1660,7 +1660,7 @@ UCBStorage::~UCBStorage()
pImp->ReleaseRef();
}
-UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler )
+UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler )
: m_pAntiImpl( pStorage )
, m_pContent( new ::ucbhelper::Content( rContent ) )
, m_pTempFile( NULL )
@@ -1668,13 +1668,13 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St
//, m_pStream( NULL )
, m_nError( 0 )
, m_nMode( nMode )
- , m_bModified( FALSE )
- , m_bCommited( FALSE )
+ , m_bModified( sal_False )
+ , m_bCommited( sal_False )
, m_bDirect( bDirect )
, m_bIsRoot( bIsRoot )
- , m_bDirty( FALSE )
- , m_bIsLinked( TRUE )
- , m_bListCreated( FALSE )
+ , m_bDirty( sal_False )
+ , m_bIsLinked( sal_True )
+ , m_bListCreated( sal_False )
, m_nFormat( 0 )
, m_aClassId( SvGlobalName() )
, m_bRepairPackage( bIsRepair )
@@ -1688,14 +1688,14 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const St
// no name given = use temporary name!
DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" );
m_pTempFile = new ::utl::TempFile;
- m_pTempFile->EnableKillingFile( TRUE );
+ m_pTempFile->EnableKillingFile( sal_True );
m_aName = m_aOriginalName = aName = m_pTempFile->GetURL();
}
m_aURL = rName;
}
-UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, BOOL bDirect, BOOL bIsRoot, BOOL bIsRepair, Reference< XProgressHandler > xProgressHandler )
+UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStorage* pStorage, sal_Bool bDirect, sal_Bool bIsRoot, sal_Bool bIsRepair, Reference< XProgressHandler > xProgressHandler )
: m_pAntiImpl( pStorage )
, m_pContent( NULL )
, m_pTempFile( NULL )
@@ -1703,13 +1703,13 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor
//, m_pStream( NULL )
, m_nError( 0 )
, m_nMode( nMode )
- , m_bModified( FALSE )
- , m_bCommited( FALSE )
+ , m_bModified( sal_False )
+ , m_bCommited( sal_False )
, m_bDirect( bDirect )
, m_bIsRoot( bIsRoot )
- , m_bDirty( FALSE )
- , m_bIsLinked( FALSE )
- , m_bListCreated( FALSE )
+ , m_bDirty( sal_False )
+ , m_bIsLinked( sal_False )
+ , m_bListCreated( sal_False )
, m_nFormat( 0 )
, m_aClassId( SvGlobalName() )
, m_bRepairPackage( bIsRepair )
@@ -1722,7 +1722,7 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor
// no name given = use temporary name!
DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" );
m_pTempFile = new ::utl::TempFile;
- m_pTempFile->EnableKillingFile( TRUE );
+ m_pTempFile->EnableKillingFile( sal_True );
m_aName = m_aOriginalName = aName = m_pTempFile->GetURL();
}
@@ -1745,31 +1745,31 @@ UCBStorage_Impl::UCBStorage_Impl( const String& rName, StreamMode nMode, UCBStor
// substorages are opened like streams: the URL is a "child URL" of the root package URL
m_aURL = rName;
if ( m_aURL.CompareToAscii( "vnd.sun.star.pkg://", 19 ) != 0 )
- m_bIsLinked = TRUE;
+ m_bIsLinked = sal_True;
}
}
-UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, BOOL bDirect )
+UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, sal_Bool bDirect )
: m_pAntiImpl( pStorage )
, m_pContent( NULL )
, m_pTempFile( new ::utl::TempFile )
, m_pSource( &rStream )
, m_nError( 0 )
- , m_bModified( FALSE )
- , m_bCommited( FALSE )
+ , m_bModified( sal_False )
+ , m_bCommited( sal_False )
, m_bDirect( bDirect )
- , m_bIsRoot( TRUE )
- , m_bDirty( FALSE )
- , m_bIsLinked( FALSE )
- , m_bListCreated( FALSE )
+ , m_bIsRoot( sal_True )
+ , m_bDirty( sal_False )
+ , m_bIsLinked( sal_False )
+ , m_bListCreated( sal_False )
, m_nFormat( 0 )
, m_aClassId( SvGlobalName() )
- , m_bRepairPackage( FALSE )
+ , m_bRepairPackage( sal_False )
, m_pUNOStorageHolderList( NULL )
{
// opening in direct mode is too fuzzy because the data is transferred to the stream in the Commit() call,
// which will be called in the storages' dtor
- m_pTempFile->EnableKillingFile( TRUE );
+ m_pTempFile->EnableKillingFile( sal_True );
DBG_ASSERT( !bDirect, "Storage on a stream must not be opened in direct mode!" );
// UCBStorages work on a content, so a temporary file for a content must be created, even if the stream is only
@@ -1930,7 +1930,7 @@ void UCBStorage_Impl::ReadContent()
if ( m_bListCreated )
return;
- m_bListCreated = TRUE;
+ m_bListCreated = sal_True;
// create cursor for access to children
Sequence< ::rtl::OUString > aProps(4);
@@ -1968,9 +1968,9 @@ void UCBStorage_Impl::ReadContent()
aContentType = xRow->getString(3);
}
- BOOL bIsFolder( xRow->getBoolean(2) );
+ sal_Bool bIsFolder( xRow->getBoolean(2) );
sal_Int64 nSize = xRow->getLong(4);
- UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (ULONG) nSize );
+ UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( aTitle, bIsFolder, (sal_uLong) nSize );
m_aChildrenList.push_back( pElement );
sal_Bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != SvGlobalName() );
@@ -2001,13 +2001,13 @@ void UCBStorage_Impl::ReadContent()
::rtl::OUString aMediaType;
Any aAny = aContent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) );
if ( ( aAny >>= aMediaType ) && ( aMediaType.compareToAscii("application/vnd.sun.star.oleobject") == 0 ) )
- pElement->m_bIsStorage = TRUE;
+ pElement->m_bIsStorage = sal_True;
else if ( !aMediaType.getLength() )
{
// older files didn't have that special content type, so they must be detected
OpenStream( pElement, STREAM_STD_READ, m_bDirect );
if ( Storage::IsStorageFile( pElement->m_xStream ) )
- pElement->m_bIsStorage = TRUE;
+ pElement->m_bIsStorage = sal_True;
else
pElement->m_xStream->Free();
}
@@ -2074,7 +2074,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount()
::rtl::OUString Find_Impl( const Sequence < Sequence < PropertyValue > >& rSequence, const ::rtl::OUString& rPath )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for ( sal_Int32 nSeqs=0; nSeqs<rSequence.getLength(); nSeqs++ )
{
const Sequence < PropertyValue >& rMyProps = rSequence[nSeqs];
@@ -2087,7 +2087,7 @@ sal_Int32 UCBStorage_Impl::GetObjectCount()
{
rtl::OUString aTmp;
if ( ( rAny.Value >>= aTmp ) && aTmp == rPath )
- bFound = TRUE;
+ bFound = sal_True;
if ( aType.getLength() )
break;
}
@@ -2217,11 +2217,11 @@ UCBStorage_Impl::~UCBStorage_Impl()
delete m_pTempFile;
}
-BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
+sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
{
// a new substorage is inserted into a UCBStorage ( given by the parameter pContent )
// it must be inserted with a title and a type
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
try
{
@@ -2258,7 +2258,7 @@ BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
// remove old content, create an "empty" new one and initialize it with the new inserted
DELETEZ( m_pContent );
m_pContent = new ::ucbhelper::Content( aNewFolder );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -2297,11 +2297,11 @@ sal_Int16 UCBStorage_Impl::Commit()
{
UCBStorageElement_Impl* pElement = m_aChildrenList[ i ];
::ucbhelper::Content* pContent = pElement->GetContent();
- BOOL bDeleteContent = FALSE;
+ sal_Bool bDeleteContent = sal_False;
if ( !pContent && pElement->IsModified() )
{
// if the element has never been opened, no content has been created until now
- bDeleteContent = TRUE; // remember to delete it later
+ bDeleteContent = sal_True; // remember to delete it later
String aName( m_aURL );
aName += '/';
aName += pElement->m_aOriginalName;
@@ -2349,7 +2349,7 @@ sal_Int16 UCBStorage_Impl::Commit()
// OLE storage should be stored encrytped, if the storage uses encryption
pElement->m_xStream->m_aContentType = String::CreateFromAscii("application/vnd.sun.star.oleobject");
Any aValue;
- aValue <<= (BOOL) TRUE;
+ aValue <<= (sal_Bool) sal_True;
pElement->m_xStream->m_pContent->setPropertyValue(String::CreateFromAscii("Encrypted"), aValue );
}
@@ -2429,7 +2429,7 @@ sal_Int16 UCBStorage_Impl::Commit()
// write a manifest file
// first create a subfolder "META-inf"
Content aNewSubFolder;
- BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder );
+ sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, String::CreateFromAscii("META-INF"), aNewSubFolder );
if ( bRet )
{
// create a stream to write the manifest file - use a temp file
@@ -2542,24 +2542,24 @@ sal_Int16 UCBStorage_Impl::Commit()
else
{
pInnerElement->m_aOriginalName = pInnerElement->m_aName;
- pInnerElement->m_bIsInserted = FALSE;
+ pInnerElement->m_bIsInserted = sal_False;
++i;
}
}
}
- m_bCommited = FALSE;
+ m_bCommited = sal_False;
}
return nRet;
}
-BOOL UCBStorage_Impl::Revert()
+sal_Bool UCBStorage_Impl::Revert()
{
for ( size_t i = 0; i < m_aChildrenList.size(); )
{
UCBStorageElement_Impl* pElement = m_aChildrenList[ i ];
- pElement->m_bIsRemoved = FALSE;
+ pElement->m_bIsRemoved = sal_False;
if ( pElement->m_bIsInserted )
{
UCBStorageElementList_Impl::iterator it = m_aChildrenList.begin();
@@ -2581,11 +2581,11 @@ BOOL UCBStorage_Impl::Revert()
}
pElement->m_aName = pElement->m_aOriginalName;
- pElement->m_bIsRemoved = FALSE;
+ pElement->m_bIsRemoved = sal_False;
++i;
}
}
- return TRUE;
+ return sal_True;
}
const String& UCBStorage::GetName() const
@@ -2593,17 +2593,17 @@ const String& UCBStorage::GetName() const
return pImp->m_aName; // pImp->m_aURL ?!
}
-BOOL UCBStorage::IsRoot() const
+sal_Bool UCBStorage::IsRoot() const
{
return pImp->m_bIsRoot;
}
void UCBStorage::SetDirty()
{
- pImp->m_bDirty = TRUE;
+ pImp->m_bDirty = sal_True;
}
-void UCBStorage::SetClass( const SvGlobalName & rClass, ULONG nOriginalClipFormat, const String & rUserTypeName )
+void UCBStorage::SetClass( const SvGlobalName & rClass, sal_uLong nOriginalClipFormat, const String & rUserTypeName )
{
pImp->m_aClassId = rClass;
pImp->m_nFormat = nOriginalClipFormat;
@@ -2642,15 +2642,15 @@ const ClsId& UCBStorage::GetClassId() const
return ( const ClsId& ) pImp->m_aClassId.GetCLSID();
}
-void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, ULONG /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ )
+void UCBStorage::SetConvertClass( const SvGlobalName & /*rConvertClass*/, sal_uLong /*nOriginalClipFormat*/, const String & /*rUserTypeName*/ )
{
// ???
}
-BOOL UCBStorage::ShouldConvert()
+sal_Bool UCBStorage::ShouldConvert()
{
// ???
- return FALSE;
+ return sal_False;
}
SvGlobalName UCBStorage::GetClassName()
@@ -2658,7 +2658,7 @@ SvGlobalName UCBStorage::GetClassName()
return pImp->m_aClassId;
}
-ULONG UCBStorage::GetFormat()
+sal_uLong UCBStorage::GetFormat()
{
return pImp->m_nFormat;
}
@@ -2678,7 +2678,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const
if ( !pElement->m_bIsRemoved )
{
// problem: what about the size of a substorage ?!
- ULONG nSize = pElement->m_nSize;
+ sal_uLong nSize = pElement->m_nSize;
if ( pElement->m_xStream.Is() )
nSize = pElement->m_xStream->GetSize();
SvStorageInfo aInfo( pElement->m_aName, nSize, pElement->m_bIsStorage );
@@ -2687,7 +2687,7 @@ void UCBStorage::FillInfoList( SvStorageInfoList* pList ) const
}
}
-BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const
+sal_Bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, BaseStorage* pDest, const String& rNew ) const
{
// insert stream or storage into the list or stream of the destination storage
// not into the content, this will be done on commit !
@@ -2698,7 +2698,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base
// the destination stream must not be open
BaseStorageStream* pOtherStream = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect );
BaseStorageStream* pStream = NULL;
- BOOL bDeleteStream = FALSE;
+ sal_Bool bDeleteStream = sal_False;
// if stream is already open, it is allowed to copy it, so be aware of this
if ( rElement.m_xStream.Is() )
@@ -2706,7 +2706,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base
if ( !pStream )
{
pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, STREAM_STD_READ, pImp->m_bDirect );
- bDeleteStream = TRUE;
+ bDeleteStream = sal_True;
}
pStream->CopyTo( pOtherStream );
@@ -2727,19 +2727,19 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base
BaseStorage* pStorage = NULL;
// if stream is already open, it is allowed to copy it, so be aware of this
- BOOL bDeleteStorage = FALSE;
+ sal_Bool bDeleteStorage = sal_False;
if ( rElement.m_xStorage.Is() )
pStorage = rElement.m_xStorage->m_pAntiImpl;
if ( !pStorage )
{
pStorage = ( const_cast < UCBStorage* > (this) )->OpenStorage( rElement.m_aName, pImp->m_nMode, pImp->m_bDirect );
- bDeleteStorage = TRUE;
+ bDeleteStorage = sal_True;
}
UCBStorage* pUCBDest = PTR_CAST( UCBStorage, pDest );
UCBStorage* pUCBCopy = PTR_CAST( UCBStorage, pStorage );
- BOOL bOpenUCBStorage = pUCBDest && pUCBCopy;
+ sal_Bool bOpenUCBStorage = pUCBDest && pUCBCopy;
BaseStorage* pOtherStorage = bOpenUCBStorage ?
pDest->OpenUCBStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect ) :
pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pImp->m_bDirect );
@@ -2764,7 +2764,7 @@ BOOL UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base
delete pOtherStorage;
}
- return BOOL( Good() && pDest->Good() );
+ return sal_Bool( Good() && pDest->Good() );
}
UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) const
@@ -2779,11 +2779,11 @@ UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const String& rName ) cons
return NULL;
}
-BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const
+sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const
{
DBG_ASSERT( pDestStg != ((BaseStorage*)this), "Self-Copying is not possible!" );
if ( pDestStg == ((BaseStorage*)this) )
- return FALSE;
+ return sal_False;
// perhaps it's also a problem if one storage is a parent of the other ?!
// or if not: could be optimized ?!
@@ -2797,7 +2797,7 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const
pDestStg->SetClassId( GetClassId() );
pDestStg->SetDirty();
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
for ( size_t i = 0; i < pImp->GetChildrenList().size() && bRet; ++i )
{
UCBStorageElement_Impl* pElement = pImp->GetChildrenList()[ i ];
@@ -2807,18 +2807,18 @@ BOOL UCBStorage::CopyTo( BaseStorage* pDestStg ) const
if( !bRet )
SetError( pDestStg->GetError() );
- return BOOL( Good() && pDestStg->Good() );
+ return sal_Bool( Good() && pDestStg->Good() );
}
-BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew )
+sal_Bool UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const String& rNew )
{
if( !rElemName.Len() )
- return FALSE;
+ return sal_False;
if ( pDest == ((BaseStorage*) this) )
{
// can't double an element
- return FALSE;
+ return sal_False;
}
else
{
@@ -2829,28 +2829,28 @@ BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const Stri
else
{
SetError( SVSTREAM_FILE_NOT_FOUND );
- return FALSE;
+ return sal_False;
}
}
}
-BOOL UCBStorage::Commit()
+sal_Bool UCBStorage::Commit()
{
// mark this storage for sending it on root commit
- pImp->m_bCommited = TRUE;
+ pImp->m_bCommited = sal_True;
if ( pImp->m_bIsRoot )
// the root storage coordinates commiting by sending a Commit command to its content
return ( pImp->Commit() != COMMIT_RESULT_FAILURE );
else
- return TRUE;
+ return sal_True;
}
-BOOL UCBStorage::Revert()
+sal_Bool UCBStorage::Revert()
{
return pImp->Revert();
}
-BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, BOOL bDirect, const ByteString* pKey )
+BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey )
{
if( !rEleName.Len() )
return NULL;
@@ -2875,7 +2875,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM
{
// create a new UCBStorageElement and insert it into the list
pElement = new UCBStorageElement_Impl( rEleName );
- pElement->m_bIsInserted = TRUE;
+ pElement->m_bIsInserted = sal_True;
pImp->m_aChildrenList.push_back( pElement );
}
}
@@ -2919,7 +2919,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM
return NULL;
}
-UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect, const ByteString* pKey )
+UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey )
{
String aName( m_aURL );
aName += '/';
@@ -2928,31 +2928,31 @@ UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pEle
return pElement->m_xStream;
}
-BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, BOOL bDirect )
+BaseStorage* UCBStorage::OpenUCBStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect )
{
if( !rEleName.Len() )
return NULL;
- return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE );
+ return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True );
}
-BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, BOOL bDirect )
+BaseStorage* UCBStorage::OpenOLEStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect )
{
if( !rEleName.Len() )
return NULL;
- return OpenStorage_Impl( rEleName, nMode, bDirect, FALSE );
+ return OpenStorage_Impl( rEleName, nMode, bDirect, sal_False );
}
-BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, BOOL bDirect )
+BaseStorage* UCBStorage::OpenStorage( const String& rEleName, StreamMode nMode, sal_Bool bDirect )
{
if( !rEleName.Len() )
return NULL;
- return OpenStorage_Impl( rEleName, nMode, bDirect, TRUE );
+ return OpenStorage_Impl( rEleName, nMode, bDirect, sal_True );
}
-BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, BOOL bDirect, BOOL bForceUCBStorage )
+BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nMode, sal_Bool bDirect, sal_Bool bForceUCBStorage )
{
// try to find the storage element
UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
@@ -2965,8 +2965,8 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
String aName( pImp->m_aURL );
aName += '/';
aName += rEleName; // ???
- UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler );
- pStorage->pImp->m_bIsRoot = FALSE;
+ UCBStorage *pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler );
+ pStorage->pImp->m_bIsRoot = sal_False;
pStorage->pImp->m_bListCreated = sal_True; // the storage is pretty new, nothing to read
pStorage->SetError( GetError() );
return pStorage;
@@ -2976,7 +2976,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
// problem: perhaps an OLEStorage should be created ?!
// Because nothing is known about the element that should be created, an external parameter is needed !
pElement = new UCBStorageElement_Impl( rEleName );
- pElement->m_bIsInserted = TRUE;
+ pElement->m_bIsInserted = sal_True;
pImp->m_aChildrenList.push_back( pElement );
}
@@ -3003,7 +3003,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
pElement->m_xStream->PrepareCachedForReopen( nMode );
pElement->m_xStream->Init();
- pElement->m_bIsStorage = TRUE;
+ pElement->m_bIsStorage = sal_True;
return pElement->m_xStream->CreateStorage(); // can only be created in transacted mode
}
else if ( pElement->m_xStorage.Is() )
@@ -3016,13 +3016,13 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
}
else
{
- BOOL bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0);
+ sal_Bool bIsWritable = (( pElement->m_xStorage->m_nMode & STREAM_WRITE ) != 0);
if ( !bIsWritable && (( nMode & STREAM_WRITE ) != 0 ))
{
String aName( pImp->m_aURL );
aName += '/';
aName += pElement->m_aOriginalName;
- UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, FALSE, pImp->m_bRepairPackage, pImp->m_xProgressHandler );
+ UCBStorage* pStorage = new UCBStorage( aName, nMode, bDirect, sal_False, pImp->m_bRepairPackage, pImp->m_xProgressHandler );
pElement->m_xStorage = pStorage->pImp;
return pStorage;
}
@@ -3035,7 +3035,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
else if ( !pElement->m_xStream.Is() )
{
// storage is opened the first time
- BOOL bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 );
+ sal_Bool bIsWritable = (( pImp->m_nMode & STREAM_WRITE ) != 0 );
if ( pImp->m_bIsLinked && pImp->m_bIsRoot && bIsWritable )
{
// make sure that the root storage object has been created before substorages will be created
@@ -3045,7 +3045,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
Content aFolder( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >() );
pImp->m_pContent = new Content;
- BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent );
+ sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, pImp->m_aName, *pImp->m_pContent );
if ( !bRet )
{
SetError( SVSTREAM_CANNOT_MAKE );
@@ -3066,31 +3066,31 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
return NULL;
}
-UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, BOOL bDirect )
+UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect )
{
UCBStorage_Impl* pRet = NULL;
String aName( m_aURL );
aName += '/';
aName += pElement->m_aOriginalName; // ???
- pElement->m_bIsStorage = pElement->m_bIsFolder = TRUE;
+ pElement->m_bIsStorage = pElement->m_bIsFolder = sal_True;
if ( m_bIsLinked && !::utl::UCBContentHelper::Exists( aName ) )
{
Content aNewFolder;
- BOOL bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder );
+ sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( *m_pContent, pElement->m_aOriginalName, aNewFolder );
if ( bRet )
- pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler );
+ pRet = new UCBStorage_Impl( aNewFolder, aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler );
}
else
{
- pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, FALSE, m_bRepairPackage, m_xProgressHandler );
+ pRet = new UCBStorage_Impl( aName, nMode, NULL, bDirect, sal_False, m_bRepairPackage, m_xProgressHandler );
}
if ( pRet )
{
pRet->m_bIsLinked = m_bIsLinked;
- pRet->m_bIsRoot = FALSE;
+ pRet->m_bIsRoot = sal_False;
// if name has been changed before creating the stream: set name!
pRet->m_aName = pElement->m_aOriginalName;
@@ -3103,41 +3103,41 @@ UCBStorage_Impl* UCBStorage_Impl::OpenStorage( UCBStorageElement_Impl* pElement,
return pRet;
}
-BOOL UCBStorage::IsStorage( const String& rEleName ) const
+sal_Bool UCBStorage::IsStorage( const String& rEleName ) const
{
if( !rEleName.Len() )
- return FALSE;
+ return sal_False;
const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
return ( pElement && pElement->m_bIsStorage );
}
-BOOL UCBStorage::IsStream( const String& rEleName ) const
+sal_Bool UCBStorage::IsStream( const String& rEleName ) const
{
if( !rEleName.Len() )
- return FALSE;
+ return sal_False;
const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
return ( pElement && !pElement->m_bIsStorage );
}
-BOOL UCBStorage::IsContained( const String & rEleName ) const
+sal_Bool UCBStorage::IsContained( const String & rEleName ) const
{
if( !rEleName.Len() )
- return FALSE;
+ return sal_False;
const UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
return ( pElement != NULL );
}
-BOOL UCBStorage::Remove( const String& rEleName )
+sal_Bool UCBStorage::Remove( const String& rEleName )
{
if( !rEleName.Len() )
- return FALSE;
+ return sal_False;
UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
if ( pElement )
{
- pElement->m_bIsRemoved = TRUE;
+ pElement->m_bIsRemoved = sal_True;
}
else
SetError( SVSTREAM_FILE_NOT_FOUND );
@@ -3145,16 +3145,16 @@ BOOL UCBStorage::Remove( const String& rEleName )
return ( pElement != NULL );
}
-BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName )
+sal_Bool UCBStorage::Rename( const String& rEleName, const String& rNewName )
{
if( !rEleName.Len()|| !rNewName.Len() )
- return FALSE;
+ return sal_False;
UCBStorageElement_Impl *pAlreadyExisting = FindElement_Impl( rNewName );
if ( pAlreadyExisting )
{
SetError( SVSTREAM_ACCESS_DENIED );
- return FALSE; // can't change to a name that is already used
+ return sal_False; // can't change to a name that is already used
}
UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName );
@@ -3168,10 +3168,10 @@ BOOL UCBStorage::Rename( const String& rEleName, const String& rNewName )
return pElement != NULL;
}
-BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName )
+sal_Bool UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const String& rNewName )
{
if( !rEleName.Len() || !rNewName.Len() )
- return FALSE;
+ return sal_False;
if ( pNewSt == ((BaseStorage*) this) && !FindElement_Impl( rNewName ) )
{
@@ -3195,31 +3195,31 @@ BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const Stri
}
*/
// MoveTo is done by first copying to the new destination and then removing the old element
- BOOL bRet = CopyTo( rEleName, pNewSt, rNewName );
+ sal_Bool bRet = CopyTo( rEleName, pNewSt, rNewName );
if ( bRet )
bRet = Remove( rEleName );
return bRet;
}
}
-BOOL UCBStorage::ValidateFAT()
+sal_Bool UCBStorage::ValidateFAT()
{
// ???
- return TRUE;
+ return sal_True;
}
-BOOL UCBStorage::Validate( BOOL bWrite ) const
+sal_Bool UCBStorage::Validate( sal_Bool bWrite ) const
{
// ???
return ( !bWrite || ( pImp->m_nMode & STREAM_WRITE ) );
}
-BOOL UCBStorage::ValidateMode( StreamMode m ) const
+sal_Bool UCBStorage::ValidateMode( StreamMode m ) const
{
// ???
if( m == ( STREAM_READ | STREAM_TRUNC ) ) // from stg.cxx
- return TRUE;
- USHORT nCurMode = 0xFFFF;
+ return sal_True;
+ sal_uInt16 nCurMode = 0xFFFF;
if( ( m & 3 ) == STREAM_READ )
{
// only SHARE_DENYWRITE or SHARE_DENYALL allowed
@@ -3227,7 +3227,7 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const
&& ( nCurMode & STREAM_SHARE_DENYWRITE ) )
|| ( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) ) )
- return TRUE;
+ return sal_True;
}
else
{
@@ -3236,10 +3236,10 @@ BOOL UCBStorage::ValidateMode( StreamMode m ) const
// the commit may fail
if( ( m & STREAM_SHARE_DENYALL )
&& ( nCurMode & STREAM_SHARE_DENYALL ) )
- return TRUE;
+ return sal_True;
}
- return TRUE;
+ return sal_True;
}
const SvStream* UCBStorage::GetSvStream() const
@@ -3249,13 +3249,13 @@ const SvStream* UCBStorage::GetSvStream() const
return pImp->m_pSource;
}
-BOOL UCBStorage::Equals( const BaseStorage& rStorage ) const
+sal_Bool UCBStorage::Equals( const BaseStorage& rStorage ) const
{
// ???
return ((BaseStorage*)this) == &rStorage;
}
-BOOL UCBStorage::IsStorageFile( const String& rFileName )
+sal_Bool UCBStorage::IsStorageFile( const String& rFileName )
{
String aFileURL = rFileName;
INetURLObject aObj( aFileURL );
@@ -3267,27 +3267,27 @@ BOOL UCBStorage::IsStorageFile( const String& rFileName )
}
SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_STD_READ );
- BOOL bRet = UCBStorage::IsStorageFile( pStm );
+ sal_Bool bRet = UCBStorage::IsStorageFile( pStm );
delete pStm;
return bRet;
}
-BOOL UCBStorage::IsStorageFile( SvStream* pFile )
+sal_Bool UCBStorage::IsStorageFile( SvStream* pFile )
{
if ( !pFile )
- return FALSE;
+ return sal_False;
- ULONG nPos = pFile->Tell();
+ sal_uLong nPos = pFile->Tell();
pFile->Seek( STREAM_SEEK_TO_END );
if ( pFile->Tell() < 4 )
- return FALSE;
+ return sal_False;
pFile->Seek(0);
- UINT32 nBytes;
+ sal_uInt32 nBytes;
*pFile >> nBytes;
// search for the magic bytes
- BOOL bRet = ( nBytes == 0x04034b50 );
+ sal_Bool bRet = ( nBytes == 0x04034b50 );
if ( !bRet )
{
// disk spanned file have an additional header in front of the usual one
@@ -3303,22 +3303,22 @@ BOOL UCBStorage::IsStorageFile( SvStream* pFile )
return bRet;
}
-BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile )
+sal_Bool UCBStorage::IsDiskSpannedFile( SvStream* pFile )
{
if ( !pFile )
- return FALSE;
+ return sal_False;
- ULONG nPos = pFile->Tell();
+ sal_uLong nPos = pFile->Tell();
pFile->Seek( STREAM_SEEK_TO_END );
if ( !pFile->Tell() )
- return FALSE;
+ return sal_False;
pFile->Seek(0);
- UINT32 nBytes;
+ sal_uInt32 nBytes;
*pFile >> nBytes;
// disk spanned file have an additional header in front of the usual one
- BOOL bRet = ( nBytes == 0x08074b50 );
+ sal_Bool bRet = ( nBytes == 0x08074b50 );
if ( bRet )
{
*pFile >> nBytes;
@@ -3332,13 +3332,13 @@ BOOL UCBStorage::IsDiskSpannedFile( SvStream* pFile )
String UCBStorage::GetLinkedFile( SvStream &rStream )
{
String aString;
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
rStream.Seek( STREAM_SEEK_TO_END );
if ( !rStream.Tell() )
return aString;
rStream.Seek(0);
- UINT32 nBytes;
+ sal_uInt32 nBytes;
rStream >> nBytes;
if( nBytes == 0x04034b50 )
{
@@ -3368,7 +3368,7 @@ String UCBStorage::CreateLinkFile( const String& rName )
SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE | STREAM_TRUNC );
// write header
- *pStream << ( UINT32 ) 0x04034b50;
+ *pStream << ( sal_uInt32 ) 0x04034b50;
// assemble a new folder name in the destination folder
INetURLObject aObj( rName );
@@ -3379,7 +3379,7 @@ String UCBStorage::CreateLinkFile( const String& rName )
// create a folder and store its URL
Content aFolder( aFolderURL, Reference < XCommandEnvironment >() );
Content aNewFolder;
- BOOL bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder );
+ sal_Bool bRet = ::utl::UCBContentHelper::MakeFolder( aFolder, aTitle, aNewFolder );
if ( !bRet )
{
aFolderObj.insertName( aTitle );
@@ -3425,15 +3425,15 @@ String UCBStorage::CreateLinkFile( const String& rName )
return aURL;
}
- pTempFile->EnableKillingFile( TRUE );
+ pTempFile->EnableKillingFile( sal_True );
delete pTempFile;
return String();
}
-BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
+sal_Bool UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
if ( rName.CompareToAscii("Title") == COMPARE_EQUAL )
- return FALSE;
+ return sal_False;
if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL )
{
@@ -3447,38 +3447,38 @@ BOOL UCBStorage::SetProperty( const String& rName, const ::com::sun::star::uno::
if ( pImp->GetContent() )
{
pImp->m_pContent->setPropertyValue( rName, rValue );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
{
}
- return FALSE;
+ return sal_False;
}
-BOOL UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
try
{
if ( pImp->GetContent() )
{
rValue = pImp->m_pContent->getPropertyValue( rName );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
{
}
- return FALSE;
+ return sal_False;
}
-BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue )
+sal_Bool UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue )
{
UCBStorageElement_Impl *pEle = FindElement_Impl( rEleName );
if ( !pEle )
- return FALSE;
+ return sal_False;
if ( !pEle->m_bIsFolder )
{
@@ -3487,7 +3487,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com
if ( pEle->m_xStream->m_nError )
{
pEle->m_xStream.Clear();
- return FALSE;
+ return sal_False;
}
try
@@ -3495,7 +3495,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com
if ( pEle->m_xStream->m_pContent )
{
rValue = pEle->m_xStream->m_pContent->getPropertyValue( rName );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
@@ -3509,7 +3509,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com
if ( pEle->m_xStorage->m_nError )
{
pEle->m_xStorage.Clear();
- return FALSE;
+ return sal_False;
}
try
@@ -3517,7 +3517,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com
if ( pEle->m_xStorage->GetContent() )
{
rValue = pEle->m_xStorage->m_pContent->getPropertyValue( rName );
- return TRUE;
+ return sal_True;
}
}
catch ( Exception& )
@@ -3525,7 +3525,7 @@ BOOL UCBStorage::GetProperty( const String& rEleName, const String& rName, ::com
}
}
- return FALSE;
+ return sal_False;
}
UNOStorageHolderList* UCBStorage::GetUNOStorageHolderList()
diff --git a/sot/source/sdstor/unostorageholder.cxx b/sot/source/sdstor/unostorageholder.cxx
index 4e593a066d83..dcfdfa134480 100644
--- a/sot/source/sdstor/unostorageholder.cxx
+++ b/sot/source/sdstor/unostorageholder.cxx
@@ -37,7 +37,7 @@
#include <comphelper/processfactory.hxx>
#include "unostorageholder.hxx"
-#include <storinfo.hxx>
+#include <sot/storinfo.hxx>
using namespace ::com::sun::star;
@@ -134,7 +134,7 @@ void SAL_CALL UNOStorageHolder::commited( const lang::EventObject& /*aEvent*/ )
xComp->dispose();
- SotStorageRef rTempStorage = new SotStorage( TRUE, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED );
+ SotStorageRef rTempStorage = new SotStorage( sal_True, aTmpStorFile.GetURL(), STREAM_WRITE, STORAGE_TRANSACTED );
if ( !rTempStorage.Is() || rTempStorage->GetError() != ERRCODE_NONE )
throw uno::RuntimeException();
diff --git a/sot/source/unoolestorage/makefile.mk b/sot/source/unoolestorage/makefile.mk
deleted file mode 100644
index d88f72f14e51..000000000000
--- a/sot/source/unoolestorage/makefile.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sot
-TARGET=unoolestorage
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xolesimplestorage.obj \
- $(SLO)$/register.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/xolesimplestorage.obj \
- $(SLO)$/register.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx
index a3676da700d3..696e0cefed93 100644
--- a/sot/source/unoolestorage/register.cxx
+++ b/sot/source/unoolestorage/register.cxx
@@ -70,34 +70,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImp
return pRet;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
-
- uno::Reference< registry::XRegistryKey > xNewKey;
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OLESimpleStorage::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- const uno::Sequence< ::rtl::OUString > &rServices = OLESimpleStorage::impl_staticGetSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- return sal_True;
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index 059857be6e5d..a50bfb9ae227 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -40,7 +40,7 @@
#include <cppuhelper/exc_hlp.hxx>
-#include <storinfo.hxx>
+#include <sot/storinfo.hxx>
#include "xolesimplestorage.hxx"
diff --git a/sot/source/unoolestorage/xolesimplestorage.hxx b/sot/source/unoolestorage/xolesimplestorage.hxx
index 816119f844ad..3761807acca3 100644
--- a/sot/source/unoolestorage/xolesimplestorage.hxx
+++ b/sot/source/unoolestorage/xolesimplestorage.hxx
@@ -44,7 +44,7 @@
#include <osl/mutex.hxx>
-#include <stg.hxx>
+#include <sot/stg.hxx>
class OLESimpleStorage : public ::cppu::WeakImplHelper3
diff --git a/sot/util/makefile.mk b/sot/util/makefile.mk
deleted file mode 100644
index 60b34c356217..000000000000
--- a/sot/util/makefile.mk
+++ /dev/null
@@ -1,81 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=sot
-TARGET=sot
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-LIB1TARGET= $(SLB)$/$(TARGET).lib
-.IF "$(GUI)$(COM)"=="WNTGCC"
-LIB1ARCHIV= $(LB)$/lib$(TARGET)$(DLLPOSTFIX)_static.a
-.ELSE
-LIB1ARCHIV= $(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-LIB1FILES= $(SLB)$/base.lib \
- $(SLB)$/sdstor.lib \
- $(SLB)$/unoolestorage.lib
-
-SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
-SHL1IMPLIB= $(TARGET)
-SHL1USE_EXPORTS=name
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-
-SHL1STDLIBS=$(TOOLSLIB) $(SALLIB) $(UNOTOOLSLIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(UCBHELPERLIB) $(CPPULIB)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME =$(SHL1TARGET)
-DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt \
- $(PRJ)$/inc$/absdev.hxx \
- $(PRJ)$/inc$/agg.hxx \
- $(PRJ)$/inc$/sot$/exchange.hxx \
- $(PRJ)$/inc$/sot$/factory.hxx \
- $(PRJ)$/inc$/sot$/object.hxx \
- $(PRJ)$/inc$/sot$/sotdata.hxx \
- $(PRJ)$/inc$/sot$/sotref.hxx \
- $(PRJ)$/inc$/stg.hxx \
- $(PRJ)$/inc$/sot$/storage.hxx \
- $(PRJ)$/inc$/storinfo.hxx
-DEFLIB1NAME =$(TARGET)
-DEF1DES =StarObjectsTools
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- $(TYPE) sot.flt > $@
-
diff --git a/sot/util/sot.component b/sot/util/sot.component
new file mode 100644
index 000000000000..7d17c7d54475
--- /dev/null
+++ b/sot/util/sot.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.OLESimpleStorage">
+ <service name="com.sun.star.embed.OLESimpleStorage"/>
+ </implementation>
+</component>
diff --git a/svl/source/memtools/makefile.mk b/svl/AllLangResTarget_svl.mk
index e19667214d13..d004cb1b24fb 100644
--- a/svl/source/memtools/makefile.mk
+++ b/svl/AllLangResTarget_svl.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,22 +25,22 @@
#
#*************************************************************************
-PRJ=..$/..
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,svl))
-PRJNAME=svl
-TARGET=svarray
+$(eval $(call gb_AllLangResTarget_add_srs,svl,\
+ svl/res \
+))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_SrsTarget_SrsTarget,svl/res))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
+$(eval $(call gb_SrsTarget_set_include,svl/res,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc \
+))
-# --- Files --------------------------------------------------------
+$(eval $(call gb_SrsTarget_add_files,svl/res,\
+ svl/source/misc/mediatyp.src \
+ svl/source/items/cstitem.src \
+))
-SLOFILES=\
- $(SLO)$/svarray.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svl/JunitTest_svl_complex.mk b/svl/JunitTest_svl_complex.mk
new file mode 100755
index 000000000000..f141dadc342b
--- /dev/null
+++ b/svl/JunitTest_svl_complex.mk
@@ -0,0 +1,59 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,svl_complex))
+
+$(eval $(call gb_JunitTest_set_defs,svl_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/svl/qa/complex/broken_document/test_documents \
+))
+
+$(eval $(call gb_JunitTest_add_jars,svl_complex,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+ $(OUTDIR)/bin/ConnectivityTools.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,svl_complex,\
+ svl/qa/complex/ConfigItems/CheckConfigItems \
+ svl/qa/complex/passwordcontainer/PasswordContainerUnitTest \
+ svl/qa/complex/passwordcontainer/TestHelper \
+ svl/qa/complex/passwordcontainer/Test03 \
+ svl/qa/complex/passwordcontainer/Test02 \
+ svl/qa/complex/passwordcontainer/Test01 \
+ svl/qa/complex/passwordcontainer/PasswordContainerTest \
+ svl/qa/complex/passwordcontainer/MasterPasswdHandler \
+))
+
+$(eval $(call gb_JunitTest_add_classes,svl_complex,\
+ complex.passwordcontainer.PasswordContainerUnitTest \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svl/Library_fsstorage.mk b/svl/Library_fsstorage.mk
new file mode 100644
index 000000000000..3e27ae8f4357
--- /dev/null
+++ b/svl/Library_fsstorage.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,fsstorage))
+
+$(eval $(call gb_Library_set_componentfile,fsstorage,svl/source/fsstor/fsstorage))
+
+$(eval $(call gb_Library_set_include,fsstorage,\
+ $$(SOLARINC) \
+ -I$(WORKDIR)/inc/svl \
+ -I$(WORKDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svl/inc) \
+ -I$(realpath $(SRCDIR)/svl/inc/svl) \
+ -I$(realpath $(SRCDIR)/svl/source/inc) \
+ -I$(realpath $(SRCDIR)/svl/inc/pch) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_add_linked_libs,fsstorage,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ tl \
+ ucbhelper \
+ utl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,fsstorage,\
+ svl/source/fsstor/fsfactory \
+ svl/source/fsstor/fsstorage \
+ svl/source/fsstor/oinputstreamcontainer \
+ svl/source/fsstor/ostreamcontainer \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svl/Library_passwordcontainer.mk b/svl/Library_passwordcontainer.mk
new file mode 100644
index 000000000000..58b4b6edb6a7
--- /dev/null
+++ b/svl/Library_passwordcontainer.mk
@@ -0,0 +1,58 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,passwordcontainer))
+
+$(eval $(call gb_Library_set_componentfile,passwordcontainer,svl/source/passwordcontainer/passwordcontainer))
+
+$(eval $(call gb_Library_set_include,passwordcontainer,\
+ $$(SOLARINC) \
+ -I$(WORKDIR)/inc/svl \
+ -I$(WORKDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svl/inc) \
+ -I$(realpath $(SRCDIR)/svl/inc/svl) \
+ -I$(realpath $(SRCDIR)/svl/source/inc) \
+ -I$(realpath $(SRCDIR)/svl/inc/pch) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_add_linked_libs,passwordcontainer,\
+ cppu \
+ cppuhelper \
+ sal \
+ ucbhelper \
+ utl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,passwordcontainer,\
+ svl/source/passwordcontainer/passwordcontainer \
+ svl/source/passwordcontainer/syscreds \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
new file mode 100644
index 000000000000..246530a22bb3
--- /dev/null
+++ b/svl/Library_svl.mk
@@ -0,0 +1,168 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,svl))
+
+$(eval $(call gb_Library_add_package_headers,svl,svl_inc))
+
+$(eval $(call gb_Library_add_precompiled_header,svl,$(SRCDIR)/svl/inc/pch/precompiled_svl))
+
+$(eval $(call gb_Library_set_componentfile,svl,svl/util/svl))
+
+$(eval $(call gb_Library_set_include,svl,\
+ $$(SOLARINC) \
+ -I$(realpath $(SRCDIR)/svl/source/inc) \
+ -I$(realpath $(SRCDIR)/svl/inc/pch) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,svl,\
+ $$(DEFS) \
+ -DSVL_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,svl,\
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nisolang1 \
+ i18nutil \
+ jvmfwk \
+ sal \
+ sot \
+ tl \
+ ucbhelper \
+ utl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,svl,\
+ svl/inc/pch/precompiled_svl \
+ svl/source/config/asiancfg \
+ svl/source/config/cjkoptions \
+ svl/source/config/ctloptions \
+ svl/source/config/itemholder2 \
+ svl/source/config/languageoptions \
+ svl/source/config/srchcfg \
+ svl/source/filepicker/pickerhistory \
+ svl/source/filerec/filerec \
+ svl/source/items/aeitem \
+ svl/source/items/cenumitm \
+ svl/source/items/cintitem \
+ svl/source/items/cntwall \
+ svl/source/items/ctypeitm \
+ svl/source/items/custritm \
+ svl/source/items/dateitem \
+ svl/source/items/eitem \
+ svl/source/items/flagitem \
+ svl/source/items/globalnameitem \
+ svl/source/items/ilstitem \
+ svl/source/items/imageitm \
+ svl/source/items/intitem \
+ svl/source/items/itemiter \
+ svl/source/items/itempool \
+ svl/source/items/itemprop \
+ svl/source/items/itemset \
+ svl/source/items/lckbitem \
+ svl/source/items/macitem \
+ svl/source/items/poolcach \
+ svl/source/items/poolio \
+ svl/source/items/poolitem \
+ svl/source/items/ptitem \
+ svl/source/items/rectitem \
+ svl/source/items/rngitem \
+ svl/source/items/sfontitm \
+ svl/source/items/sitem \
+ svl/source/items/slstitm \
+ svl/source/items/srchitem \
+ svl/source/items/stritem \
+ svl/source/items/style \
+ svl/source/items/stylepool \
+ svl/source/items/szitem \
+ svl/source/items/visitem \
+ svl/source/items/whiter \
+ svl/source/memtools/svarray \
+ svl/source/misc/PasswordHelper \
+ svl/source/misc/adrparse \
+ svl/source/misc/documentlockfile \
+ svl/source/misc/filenotation \
+ svl/source/misc/folderrestriction \
+ svl/source/misc/fstathelper \
+ svl/source/misc/inethist \
+ svl/source/misc/inettype \
+ svl/source/misc/lngmisc \
+ svl/source/misc/lockfilecommon \
+ svl/source/misc/ownlist \
+ svl/source/misc/restrictedpaths \
+ svl/source/misc/sharecontrolfile \
+ svl/source/misc/strmadpt \
+ svl/source/misc/svldata \
+ svl/source/misc/urihelper \
+ svl/source/notify/brdcst \
+ svl/source/notify/broadcast \
+ svl/source/notify/hint \
+ svl/source/notify/isethint \
+ svl/source/notify/listener \
+ svl/source/notify/listenerbase \
+ svl/source/notify/listeneriter \
+ svl/source/notify/lstner \
+ svl/source/notify/smplhint \
+ svl/source/numbers/numfmuno \
+ svl/source/numbers/numhead \
+ svl/source/numbers/numuno \
+ svl/source/numbers/supservs \
+ svl/source/numbers/zforfind \
+ svl/source/numbers/zforlist \
+ svl/source/numbers/zformat \
+ svl/source/numbers/zforscan \
+ svl/source/svsql/converter \
+ svl/source/undo/undo \
+ svl/source/uno/pathservice \
+ svl/source/uno/registerservices \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_exception_objects,svl,\
+ svl/source/svdde/ddecli \
+ svl/source/svdde/ddedata \
+ svl/source/svdde/ddeinf \
+ svl/source/svdde/ddestrg \
+ svl/source/svdde/ddesvr \
+ svl/source/svdde/ddewrap \
+))
+
+$(eval $(call gb_Library_add_linked_libs,svl,\
+ user32 \
+))
+
+else
+$(eval $(call gb_Library_add_exception_objects,svl,\
+ svl/unx/source/svdde/ddedummy \
+))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/svl/Makefile b/svl/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/svl/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svl/source/filerec/makefile.mk b/svl/Module_svl.mk
index ea2b88d8d493..108d487c8e0d 100644
--- a/svl/source/filerec/makefile.mk
+++ b/svl/Module_svl.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,22 +25,22 @@
#
#*************************************************************************
-PRJ=..$/..
+$(eval $(call gb_Module_Module,svl))
-PRJNAME=svl
-TARGET=filerec
+$(eval $(call gb_Module_add_targets,svl,\
+ AllLangResTarget_svl \
+ Library_fsstorage \
+ Library_passwordcontainer \
+ Library_svl \
+ Package_inc \
+))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_Module_add_subsequentcheck_targets,svl,\
+ JunitTest_svl_complex \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/filerec.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
+#todo: dde platform dependent
+#todo: package_inc
+#todo: map file
+# vim: set noet ts=4 sw=4:
diff --git a/svl/Package_inc.mk b/svl/Package_inc.mk
new file mode 100644
index 000000000000..c070c9ee5a6f
--- /dev/null
+++ b/svl/Package_inc.mk
@@ -0,0 +1,129 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,svl_inc,$(SRCDIR)/svl/inc))
+
+
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/PasswordHelper.hxx,svl/PasswordHelper.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/adrparse.hxx,svl/adrparse.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/aeitem.hxx,svl/aeitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/asiancfg.hxx,svl/asiancfg.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/brdcst.hxx,svl/brdcst.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/broadcast.hxx,svl/broadcast.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/broadcast.hxx,svl/broadcast.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cenumitm.hxx,svl/cenumitm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cintitem.hxx,svl/cintitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cjkoptions.hxx,svl/cjkoptions.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntnrsrt.hxx,svl/cntnrsrt.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntwall.hxx,svl/cntwall.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/cntwids.hrc,svl/cntwids.hrc))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/converter.hxx,svl/converter.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ctloptions.hxx,svl/ctloptions.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ctypeitm.hxx,svl/ctypeitm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/custritm.hxx,svl/custritm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/dateitem.hxx,svl/dateitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/documentlockfile.hxx,svl/documentlockfile.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/eitem.hxx,svl/eitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/filenotation.hxx,svl/filenotation.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/filerec.hxx,svl/filerec.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/flagitem.hxx,svl/flagitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/folderrestriction.hxx,svl/folderrestriction.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/fstathelper.hxx,svl/fstathelper.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/globalnameitem.hxx,svl/globalnameitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/hint.hxx,svl/hint.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/httpcook.hxx,svl/httpcook.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ilstitem.hxx,svl/ilstitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/imageitm.hxx,svl/imageitm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetdef.hxx,svl/inetdef.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inethist.hxx,svl/inethist.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetmsg.hxx,svl/inetmsg.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inetstrm.hxx,svl/inetstrm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/inettype.hxx,svl/inettype.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/instrm.hxx,svl/instrm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/intitem.hxx,svl/intitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/isethint.hxx,svl/isethint.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemiter.hxx,svl/itemiter.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itempool.hxx,svl/itempool.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemprop.hxx,svl/itemprop.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/itemset.hxx,svl/itemset.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/languageoptions.hxx,svl/languageoptions.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lckbitem.hxx,svl/lckbitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/listener.hxx,svl/listener.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/listeneriter.hxx,svl/listeneriter.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lngmisc.hxx,svl/lngmisc.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lockfilecommon.hxx,svl/lockfilecommon.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/lstner.hxx,svl/lstner.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/macitem.hxx,svl/macitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/mailenum.hxx,svl/mailenum.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/memberid.hrc,svl/memberid.hrc))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/metitem.hxx,svl/metitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfkeytab.hxx,svl/nfkeytab.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfsymbol.hxx,svl/nfsymbol.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfversi.hxx,svl/nfversi.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nranges.hxx,svl/nranges.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/numuno.hxx,svl/numuno.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ondemand.hxx,svl/ondemand.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/outstrm.hxx,svl/outstrm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ownlist.hxx,svl/ownlist.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhelper.hxx,svl/pickerhelper.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhistory.hxx,svl/pickerhistory.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/pickerhistoryaccess.hxx,svl/pickerhistoryaccess.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/poolcach.hxx,svl/poolcach.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/poolitem.hxx,svl/poolitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ptitem.hxx,svl/ptitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/rectitem.hxx,svl/rectitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/restrictedpaths.hxx,svl/restrictedpaths.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/rngitem.hxx,svl/rngitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/sfontitm.hxx,svl/sfontitm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/sharecontrolfile.hxx,svl/sharecontrolfile.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/slstitm.hxx,svl/slstitm.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/smplhint.hxx,svl/smplhint.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/solar.hrc,svl/solar.hrc))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchcfg.hxx,svl/srchcfg.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchdefs.hxx,svl/srchdefs.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/srchitem.hxx,svl/srchitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/stritem.hxx,svl/stritem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/strmadpt.hxx,svl/strmadpt.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/style.hrc,svl/style.hrc))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/style.hxx,svl/style.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/stylepool.hxx,svl/stylepool.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svarray.hxx,svl/svarray.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svdde.hxx,svl/svdde.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svl.hrc,svl/svl.hrc))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svldata.hxx,svl/svldata.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svldllapi.h,svl/svldllapi.h))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/svstdarr.hxx,svl/svstdarr.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/szitem.hxx,svl/szitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/undo.hxx,svl/undo.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urihelper.hxx,svl/urihelper.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urlbmk.hxx,svl/urlbmk.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/urlfilter.hxx,svl/urlfilter.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/visitem.hxx,svl/visitem.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/whiter.hxx,svl/whiter.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/xmlement.hxx,svl/xmlement.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/zforlist.hxx,svl/zforlist.hxx))
+$(eval $(call gb_Package_add_file,svl_inc,inc/svl/zformat.hxx,svl/zformat.hxx))
diff --git a/svl/inc/makefile.mk b/svl/inc/makefile.mk
deleted file mode 100644
index a99cf8acc0d2..000000000000
--- a/svl/inc/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=svl
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/svl/inc/PasswordHelper.hxx b/svl/inc/svl/PasswordHelper.hxx
index 29f092f5fc9d..29f092f5fc9d 100644
--- a/svl/inc/PasswordHelper.hxx
+++ b/svl/inc/svl/PasswordHelper.hxx
diff --git a/svl/inc/adrparse.hxx b/svl/inc/svl/adrparse.hxx
index dbb671889ec3..dbb671889ec3 100644
--- a/svl/inc/adrparse.hxx
+++ b/svl/inc/svl/adrparse.hxx
diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx
index 373316882829..47c437f8a177 100644
--- a/svl/inc/svl/aeitem.hxx
+++ b/svl/inc/svl/aeitem.hxx
@@ -41,32 +41,32 @@ class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem
SvUShorts* pDisabledValues;
protected:
- USHORT _GetPosByValue( USHORT nValue ) const;
+ sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const;
public:
TYPEINFO();
SfxAllEnumItem();
- SfxAllEnumItem( USHORT nWhich);
- SfxAllEnumItem( USHORT nWhich, USHORT nVal );
- SfxAllEnumItem( USHORT nWhich, USHORT nVal, const XubString &rText );
- SfxAllEnumItem( USHORT nWhich, SvStream &rStream );
+ SfxAllEnumItem( sal_uInt16 nWhich);
+ SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal );
+ SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal, const XubString &rText );
+ SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream );
SfxAllEnumItem( const SfxAllEnumItem & );
~SfxAllEnumItem();
- void InsertValue( USHORT nValue );
- void InsertValue( USHORT nValue, const XubString &rText );
- void RemoveValue( USHORT nValue );
+ void InsertValue( sal_uInt16 nValue );
+ void InsertValue( sal_uInt16 nValue, const XubString &rText );
+ void RemoveValue( sal_uInt16 nValue );
void RemoveAllValues();
- USHORT GetPosByValue( USHORT nValue ) const;
+ sal_uInt16 GetPosByValue( sal_uInt16 nValue ) const;
- virtual USHORT GetValueCount() const;
- virtual USHORT GetValueByPos( USHORT nPos ) const;
- virtual XubString GetValueTextByPos( USHORT nPos ) const;
+ virtual sal_uInt16 GetValueCount() const;
+ virtual sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const;
+ virtual XubString GetValueTextByPos( sal_uInt16 nPos ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const;
- virtual BOOL IsEnabled( USHORT ) const;
- void DisableValue( USHORT );
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const;
+ virtual sal_Bool IsEnabled( sal_uInt16 ) const;
+ void DisableValue( sal_uInt16 );
};
#endif
diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx
index 03c5a8316ee1..d8ad823ed6d8 100644
--- a/svl/inc/svl/brdcst.hxx
+++ b/svl/inc/svl/brdcst.hxx
@@ -48,7 +48,7 @@ friend class SfxListener;
SfxListenerArr_Impl aListeners;
private:
- BOOL AddListener( SfxListener& rListener );
+ sal_Bool AddListener( SfxListener& rListener );
void RemoveListener( SfxListener& rListener );
const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten
@@ -67,9 +67,9 @@ public:
void BroadcastDelayed( const SfxHint& rHint );
void BroadcastInIdle( const SfxHint& rHint );
- BOOL HasListeners() const;
- USHORT GetListenerCount() const { return aListeners.Count(); }
- SfxListener* GetListener( USHORT nNo ) const
+ sal_Bool HasListeners() const;
+ sal_uInt16 GetListenerCount() const { return aListeners.Count(); }
+ SfxListener* GetListener( sal_uInt16 nNo ) const
{ return (SfxListener*) aListeners[nNo]; }
};
diff --git a/svl/inc/broadcast.hxx b/svl/inc/svl/broadcast.hxx
index a1cde13a2483..1e4be881d271 100644
--- a/svl/inc/broadcast.hxx
+++ b/svl/inc/svl/broadcast.hxx
@@ -60,7 +60,7 @@ public:
void Broadcast( const SfxHint &rHint );
- BOOL HasListeners() const { return 0 != pRoot; }
+ sal_Bool HasListeners() const { return 0 != pRoot; }
};
diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx
index 785adccfb8e2..b74de9373f6a 100644
--- a/svl/inc/svl/cenumitm.hxx
+++ b/svl/inc/svl/cenumitm.hxx
@@ -39,7 +39,7 @@ DBG_NAMEEX(SfxEnumItemInterface)
class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem
{
protected:
- SfxEnumItemInterface(USHORT which): SfxPoolItem(which) {}
+ SfxEnumItemInterface(sal_uInt16 which): SfxPoolItem(which) {}
SfxEnumItemInterface(const SfxEnumItemInterface & rItem):
SfxPoolItem(rItem) {}
@@ -55,15 +55,15 @@ public:
const IntlWrapper * = 0)
const;
- virtual bool QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const;
+ virtual bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const;
- virtual bool PutValue(const com::sun::star::uno::Any & rVal, BYTE = 0);
+ virtual bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0);
- virtual USHORT GetValueCount() const = 0;
+ virtual sal_uInt16 GetValueCount() const = 0;
- virtual XubString GetValueTextByPos(USHORT nPos) const;
+ virtual XubString GetValueTextByPos(sal_uInt16 nPos) const;
- virtual USHORT GetValueByPos(USHORT nPos) const;
+ virtual sal_uInt16 GetValueByPos(sal_uInt16 nPos) const;
/// Return the position of some value within this enumeration.
///
@@ -75,19 +75,19 @@ public:
///
/// @return The position of nValue within this enumeration, or USHRT_MAX
/// if not included.
- virtual USHORT GetPosByValue(USHORT nValue) const;
+ virtual sal_uInt16 GetPosByValue(sal_uInt16 nValue) const;
- virtual BOOL IsEnabled(USHORT nValue) const;
+ virtual sal_Bool IsEnabled(sal_uInt16 nValue) const;
- virtual USHORT GetEnumValue() const = 0;
+ virtual sal_uInt16 GetEnumValue() const = 0;
- virtual void SetEnumValue(USHORT nValue) = 0;
+ virtual void SetEnumValue(sal_uInt16 nValue) = 0;
virtual int HasBoolValue() const;
- virtual BOOL GetBoolValue() const;
+ virtual sal_Bool GetBoolValue() const;
- virtual void SetBoolValue(BOOL bValue);
+ virtual void SetBoolValue(sal_Bool bValue);
};
//============================================================================
@@ -95,13 +95,13 @@ DBG_NAMEEX(CntEnumItem)
class SVL_DLLPUBLIC CntEnumItem: public SfxEnumItemInterface
{
- USHORT m_nValue;
+ sal_uInt16 m_nValue;
protected:
- CntEnumItem(USHORT which = 0, USHORT nTheValue = 0):
+ CntEnumItem(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
SfxEnumItemInterface(which), m_nValue(nTheValue) {}
- CntEnumItem(USHORT which, SvStream & rStream);
+ CntEnumItem(sal_uInt16 which, SvStream & rStream);
CntEnumItem(const CntEnumItem & rItem):
SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {}
@@ -109,18 +109,18 @@ protected:
public:
TYPEINFO();
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
- virtual USHORT GetEnumValue() const;
+ virtual sal_uInt16 GetEnumValue() const;
- virtual void SetEnumValue(USHORT nTheValue);
+ virtual void SetEnumValue(sal_uInt16 nTheValue);
- USHORT GetValue() const { return m_nValue; }
+ sal_uInt16 GetValue() const { return m_nValue; }
- inline void SetValue(USHORT nTheValue);
+ inline void SetValue(sal_uInt16 nTheValue);
};
-inline void CntEnumItem::SetValue(USHORT nTheValue)
+inline void CntEnumItem::SetValue(sal_uInt16 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "CntEnumItem::SetValue(): Pooled item");
m_nValue = nTheValue;
@@ -131,15 +131,15 @@ DBG_NAMEEX(CntBoolItem)
class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem
{
- BOOL m_bValue;
+ sal_Bool m_bValue;
public:
TYPEINFO();
- CntBoolItem(USHORT which = 0, BOOL bTheValue = FALSE):
+ CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False):
SfxPoolItem(which), m_bValue(bTheValue) {}
- CntBoolItem(USHORT nWhich, SvStream & rStream);
+ CntBoolItem(sal_uInt16 nWhich, SvStream & rStream);
CntBoolItem(const CntBoolItem & rItem):
SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {}
@@ -155,23 +155,23 @@ public:
const IntlWrapper * = 0)
const;
- virtual bool QueryValue(com::sun::star::uno::Any& rVal, BYTE = 0) const;
+ virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const;
- virtual bool PutValue(const com::sun::star::uno::Any& rVal, BYTE = 0);
+ virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual USHORT GetValueCount() const;
+ virtual sal_uInt16 GetValueCount() const;
- virtual UniString GetValueTextByVal(BOOL bTheValue) const;
+ virtual UniString GetValueTextByVal(sal_Bool bTheValue) const;
- BOOL GetValue() const { return m_bValue; }
+ sal_Bool GetValue() const { return m_bValue; }
- void SetValue(BOOL bTheValue) { m_bValue = bTheValue; }
+ void SetValue(sal_Bool bTheValue) { m_bValue = bTheValue; }
};
#endif // _SVTOOLS_CENUMITM_HXX
diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx
index 91cb08344b22..a6725b2fcf0b 100644
--- a/svl/inc/svl/cintitem.hxx
+++ b/svl/inc/svl/cintitem.hxx
@@ -38,15 +38,15 @@ DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
{
- BYTE m_nValue;
+ sal_uInt8 m_nValue;
public:
TYPEINFO();
- CntByteItem(USHORT which = 0, BYTE nTheValue = 0):
+ CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); }
- CntByteItem(USHORT which, SvStream & rStream);
+ CntByteItem(sal_uInt16 which, SvStream & rStream);
CntByteItem(const CntByteItem & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -66,29 +66,29 @@ public:
const;
virtual bool QueryValue(com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0) const;
+ sal_uInt8 nMemberId = 0) const;
virtual bool PutValue(const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual BYTE GetMin() const;
+ virtual sal_uInt8 GetMin() const;
- virtual BYTE GetMax() const;
+ virtual sal_uInt8 GetMax() const;
virtual SfxFieldUnit GetUnit() const;
- BYTE GetValue() const { return m_nValue; }
+ sal_uInt8 GetValue() const { return m_nValue; }
- inline void SetValue(BYTE nTheValue);
+ inline void SetValue(sal_uInt8 nTheValue);
};
-inline void CntByteItem::SetValue(BYTE nTheValue)
+inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
m_nValue = nTheValue;
@@ -99,16 +99,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
{
- UINT16 m_nValue;
+ sal_uInt16 m_nValue;
public:
TYPEINFO();
- CntUInt16Item(USHORT which = 0, UINT16 nTheValue = 0):
+ CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntUInt16Item, 0); }
- CntUInt16Item(USHORT which, SvStream & rStream);
+ CntUInt16Item(sal_uInt16 which, SvStream & rStream);
CntUInt16Item(const CntUInt16Item & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -128,29 +128,29 @@ public:
const;
virtual bool QueryValue(com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0) const;
+ sal_uInt8 nMemberId = 0) const;
virtual bool PutValue(const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual UINT16 GetMin() const;
+ virtual sal_uInt16 GetMin() const;
- virtual UINT16 GetMax() const;
+ virtual sal_uInt16 GetMax() const;
virtual SfxFieldUnit GetUnit() const;
- INT16 GetValue() const { return m_nValue; }
+ sal_Int16 GetValue() const { return m_nValue; }
- inline void SetValue(UINT16 nTheValue);
+ inline void SetValue(sal_uInt16 nTheValue);
};
-inline void CntUInt16Item::SetValue(UINT16 nTheValue)
+inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
m_nValue = nTheValue;
@@ -161,16 +161,16 @@ DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
{
- INT32 m_nValue;
+ sal_Int32 m_nValue;
public:
TYPEINFO();
- CntInt32Item(USHORT which = 0, INT32 nTheValue = 0):
+ CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntInt32Item, 0); }
- CntInt32Item(USHORT which, SvStream & rStream);
+ CntInt32Item(sal_uInt16 which, SvStream & rStream);
CntInt32Item(const CntInt32Item & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -190,29 +190,29 @@ public:
const;
virtual bool QueryValue(com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0) const;
+ sal_uInt8 nMemberId = 0) const;
virtual bool PutValue(const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream &, USHORT) const;
+ virtual SvStream & Store(SvStream &, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual INT32 GetMin() const;
+ virtual sal_Int32 GetMin() const;
- virtual INT32 GetMax() const;
+ virtual sal_Int32 GetMax() const;
virtual SfxFieldUnit GetUnit() const;
- INT32 GetValue() const { return m_nValue; }
+ sal_Int32 GetValue() const { return m_nValue; }
- inline void SetValue(INT32 nTheValue);
+ inline void SetValue(sal_Int32 nTheValue);
};
-inline void CntInt32Item::SetValue(INT32 nTheValue)
+inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
m_nValue = nTheValue;
@@ -223,16 +223,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
{
- UINT32 m_nValue;
+ sal_uInt32 m_nValue;
public:
TYPEINFO();
- CntUInt32Item(USHORT which = 0, UINT32 nTheValue = 0):
+ CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntUInt32Item, 0); }
- CntUInt32Item(USHORT nWhich, SvStream & rStream);
+ CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
CntUInt32Item(const CntUInt32Item & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -252,29 +252,29 @@ public:
const;
virtual bool QueryValue(com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0) const;
+ sal_uInt8 nMemberId = 0) const;
virtual bool PutValue(const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual UINT32 GetMin() const;
+ virtual sal_uInt32 GetMin() const;
- virtual UINT32 GetMax() const;
+ virtual sal_uInt32 GetMax() const;
virtual SfxFieldUnit GetUnit() const;
- UINT32 GetValue() const { return m_nValue; }
+ sal_uInt32 GetValue() const { return m_nValue; }
- inline void SetValue(UINT32 nTheValue);
+ inline void SetValue(sal_uInt32 nTheValue);
};
-inline void CntUInt32Item::SetValue(UINT32 nTheValue)
+inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
m_nValue = nTheValue;
diff --git a/svl/inc/cntnrsrt.hxx b/svl/inc/svl/cntnrsrt.hxx
index fd31ded8456c..7d2c119e9fd1 100644
--- a/svl/inc/cntnrsrt.hxx
+++ b/svl/inc/svl/cntnrsrt.hxx
@@ -62,17 +62,17 @@
public: \
using Container::Count; \
\
- ClassName( USHORT InitSize, USHORT ReSize ) : \
+ ClassName( sal_uInt16 InitSize, sal_uInt16 ReSize ) : \
Container( CONTAINER_MAXBLOCKSIZE, InitSize, ReSize ) {} \
\
- BOOL Insert( Type* pObj ); \
+ sal_Bool Insert( Type* pObj ); \
\
- Type *Remove( ULONG nPos ) \
+ Type *Remove( sal_uLong nPos ) \
{ return (Type *)Container::Remove( nPos ); } \
\
Type *Remove( Type* pObj ); \
\
- void DeleteAndDestroy( ULONG nPos ) \
+ void DeleteAndDestroy( sal_uLong nPos ) \
{ \
Type *pObj = Remove( nPos ); \
if( pObj ) \
@@ -82,15 +82,15 @@ public: \
void DeleteAndDestroy() \
{ while( Count() ) DeleteAndDestroy( 0 ); } \
\
- Type* GetObject( ULONG nPos ) const \
+ Type* GetObject( sal_uLong nPos ) const \
{ return (Type *)Container::GetObject( nPos ); } \
\
- Type* operator[]( ULONG nPos ) const \
+ Type* operator[]( sal_uLong nPos ) const \
{ return GetObject(nPos); } \
\
- BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \
+ sal_Bool Seek_Entry( const Type *pObj, sal_uLong* pPos ) const; \
\
- ULONG GetPos( const Type* pObj ) const; \
+ sal_uLong GetPos( const Type* pObj ) const; \
#define DECLARE_CONTAINER_SORT( ClassName, Type ) \
@@ -110,10 +110,10 @@ class ClassName : private Container \
#define IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) \
-BOOL ClassName::Insert( Type *pObj ) \
+sal_Bool ClassName::Insert( Type *pObj ) \
{ \
- ULONG nPos; \
- BOOL bExist = Seek_Entry( pObj, &nPos ); \
+ sal_uLong nPos; \
+ sal_Bool bExist = Seek_Entry( pObj, &nPos ); \
if( !bExist ) \
Container::Insert( pObj, nPos ); \
return !bExist; \
@@ -121,25 +121,25 @@ BOOL ClassName::Insert( Type *pObj ) \
\
Type *ClassName::Remove( Type* pObj ) \
{ \
- ULONG nPos; \
+ sal_uLong nPos; \
if( Seek_Entry( pObj, &nPos ) ) \
return Remove( nPos ); \
else \
return 0; \
} \
\
-ULONG ClassName::GetPos( const Type* pObj ) const \
+sal_uLong ClassName::GetPos( const Type* pObj ) const \
{ \
- ULONG nPos; \
+ sal_uLong nPos; \
if( Seek_Entry( pObj, &nPos ) ) \
return nPos; \
else \
return CONTAINER_ENTRY_NOTFOUND; \
} \
\
-BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \
+sal_Bool ClassName::Seek_Entry( const Type* pObj, sal_uLong* pPos ) const \
{ \
- register ULONG nO = Count(), \
+ register sal_uLong nO = Count(), \
nM, \
nU = 0; \
if( nO > 0 ) \
@@ -153,21 +153,21 @@ BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \
if( 0 == nCmp ) \
{ \
if( pPos ) *pPos = nM; \
- return TRUE; \
+ return sal_True; \
} \
else if( nCmp < 0 ) \
nU = nM + 1; \
else if( nM == 0 ) \
{ \
if( pPos ) *pPos = nU; \
- return FALSE; \
+ return sal_False; \
} \
else \
nO = nM - 1; \
} \
} \
if( pPos ) *pPos = nU; \
- return FALSE; \
+ return sal_False; \
} \
#endif
diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx
index dc36880daa1b..5e7828641c8f 100644
--- a/svl/inc/svl/cntwall.hxx
+++ b/svl/inc/svl/cntwall.hxx
@@ -42,35 +42,35 @@ class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem
private:
UniString _aURL;
Color _nColor;
- USHORT _nStyle;
+ sal_uInt16 _nStyle;
public:
TYPEINFO();
- CntWallpaperItem( USHORT nWhich );
- CntWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion );
+ CntWallpaperItem( sal_uInt16 nWhich );
+ CntWallpaperItem( sal_uInt16 nWhich, SvStream& rStream, sal_uInt16 nVersion );
CntWallpaperItem( const CntWallpaperItem& rCpy );
~CntWallpaperItem();
- virtual USHORT GetVersion(USHORT) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16) const;
virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const;
- virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; }
void SetColor( Color nColor ) { _nColor = nColor; }
- void SetStyle( USHORT nStyle ) { _nStyle = nStyle; }
+ void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; }
const UniString& GetBitmapURL() const { return _aURL; }
Color GetColor() const { return _nColor; }
- USHORT GetStyle() const { return _nStyle; }
+ sal_uInt16 GetStyle() const { return _nStyle; }
};
////////////////////////////////////////////////////////////////////////////////
diff --git a/svl/inc/cntwids.hrc b/svl/inc/svl/cntwids.hrc
index d14cf590d740..d14cf590d740 100644
--- a/svl/inc/cntwids.hrc
+++ b/svl/inc/svl/cntwids.hrc
diff --git a/svl/inc/converter.hxx b/svl/inc/svl/converter.hxx
index 1a9411656839..fc2513c3b61f 100644
--- a/svl/inc/converter.hxx
+++ b/svl/inc/svl/converter.hxx
@@ -34,8 +34,8 @@
class SvDbaseConverter
{
public:
- SVL_DLLPUBLIC static INT32 ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale);
- SVL_DLLPUBLIC static INT32 ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale);
+ SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale);
+ SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale);
};
#endif //_CONVERTER_HXX_
diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx
index 03a10d99d951..82f0bd1179c4 100644
--- a/svl/inc/svl/ctypeitm.hxx
+++ b/svl/inc/svl/ctypeitm.hxx
@@ -43,17 +43,17 @@ public:
TYPEINFO();
CntContentTypeItem();
- CntContentTypeItem( USHORT nWhich, const XubString& rType );
- CntContentTypeItem( USHORT nWhich, const INetContentType eType );
+ CntContentTypeItem( sal_uInt16 nWhich, const XubString& rType );
+ CntContentTypeItem( sal_uInt16 nWhich, const INetContentType eType );
CntContentTypeItem( const CntContentTypeItem& rOrig );
virtual SfxPoolItem* Create( SvStream& rStream,
- USHORT nItemVersion ) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ sal_uInt16 nItemVersion ) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual int operator==( const SfxPoolItem& rOrig ) const;
- virtual USHORT GetVersion(USHORT) const;
+ virtual sal_uInt16 GetVersion(sal_uInt16) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const;
@@ -70,9 +70,9 @@ public:
const IntlWrapper* pIntlWrapper = 0 ) const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
INetContentType GetEnumValue() const;
diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx
index b84d8a8ee29b..d0346ef5d461 100644
--- a/svl/inc/svl/custritm.hxx
+++ b/svl/inc/svl/custritm.hxx
@@ -43,10 +43,10 @@ class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem
public:
TYPEINFO();
- CntUnencodedStringItem(USHORT which = 0): SfxPoolItem(which)
+ CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which)
{ DBG_CTOR(CntUnencodedStringItem, 0); }
- CntUnencodedStringItem(USHORT which, const XubString & rTheValue):
+ CntUnencodedStringItem(sal_uInt16 which, const XubString & rTheValue):
SfxPoolItem(which), m_aValue(rTheValue)
{ DBG_CTOR(CntUnencodedStringItem, 0); }
@@ -70,10 +70,10 @@ public:
const;
virtual bool QueryValue(com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0) const;
+ sal_uInt8 nMemberId = 0) const;
virtual bool PutValue(const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0);
+ sal_uInt8 nMemberId = 0);
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx
index 51770ab651a4..e9bae366b018 100644
--- a/svl/inc/svl/dateitem.hxx
+++ b/svl/inc/svl/dateitem.hxx
@@ -47,8 +47,8 @@ private:
public:
TYPEINFO();
- SfxDateTimeItem( USHORT nWhich );
- SfxDateTimeItem( USHORT nWhich,
+ SfxDateTimeItem( sal_uInt16 nWhich );
+ SfxDateTimeItem( sal_uInt16 nWhich,
const DateTime& rDT );
SfxDateTimeItem( const SfxDateTimeItem& rCpy );
@@ -58,8 +58,8 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
using SfxPoolItem::Compare;
virtual int Compare( const SfxPoolItem &rWith ) const;
- virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const;
- virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
@@ -76,9 +76,9 @@ public:
aDateTime = rDT; }
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
};
class SfxColumnDateTimeItem : public SfxDateTimeItem
@@ -86,8 +86,8 @@ class SfxColumnDateTimeItem : public SfxDateTimeItem
public:
TYPEINFO();
- SfxColumnDateTimeItem( USHORT nWhich );
- SfxColumnDateTimeItem( USHORT nWhich,
+ SfxColumnDateTimeItem( sal_uInt16 nWhich );
+ SfxColumnDateTimeItem( sal_uInt16 nWhich,
const DateTime& rDT );
SfxColumnDateTimeItem( const SfxDateTimeItem& rCpy );
diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx
index c678ec9ab30a..ea715c349922 100644
--- a/svl/inc/svl/eitem.hxx
+++ b/svl/inc/svl/eitem.hxx
@@ -36,10 +36,10 @@
class SVL_DLLPUBLIC SfxEnumItem: public CntEnumItem
{
protected:
- SfxEnumItem(USHORT which = 0, USHORT nValue = 0):
+ SfxEnumItem(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
CntEnumItem(which, nValue) {}
- SfxEnumItem(USHORT which, SvStream & rStream):
+ SfxEnumItem(sal_uInt16 which, SvStream & rStream):
CntEnumItem(which, rStream) {}
public:
@@ -53,13 +53,13 @@ class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem
public:
TYPEINFO();
- SfxBoolItem(USHORT which = 0, BOOL bValue = FALSE):
+ SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False):
CntBoolItem(which, bValue) {}
- SfxBoolItem(USHORT which, SvStream & rStream):
+ SfxBoolItem(sal_uInt16 which, SvStream & rStream):
CntBoolItem(which, rStream) {}
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
{ return new SfxBoolItem(Which(), rStream); }
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
diff --git a/svl/inc/filenotation.hxx b/svl/inc/svl/filenotation.hxx
index b339282fc96a..65f28659e056 100644
--- a/svl/inc/filenotation.hxx
+++ b/svl/inc/svl/filenotation.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,4 +69,3 @@ namespace svt
#endif // SVTOOLS_FILENOTATION_HXX
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx
index ca17a939fc60..6b7ff27ba506 100644
--- a/svl/inc/svl/filerec.hxx
+++ b/svl/inc/svl/filerec.hxx
@@ -36,22 +36,22 @@
#include <tools/stream.hxx>
#include <svl/svarray.hxx>
-SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 )
+SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 )
//------------------------------------------------------------------------
-#define SFX_REC_PRETAG_EXT BYTE(0x00) // Pre-Tag f"ur Extended-Records
-#define SFX_REC_PRETAG_EOR BYTE(0xFF) // Pre-Tag f"ur End-Of-Records
-
-#define SFX_REC_TYPE_NONE BYTE(0x00) // unbekannter Record-Typ
-#define SFX_REC_TYPE_FIRST BYTE(0x01)
-#define SFX_REC_TYPE_SINGLE BYTE(0x01) // Single-Content-Record
-#define SFX_REC_TYPE_FIXSIZE BYTE(0x02) // Fix-Size-Multi-Content-Record
-#define SFX_REC_TYPE_VARSIZE_RELOC BYTE(0x03) // variable Rec-Size
-#define SFX_REC_TYPE_VARSIZE BYTE(0x04) // alt (nicht verschiebbar)
-#define SFX_REC_TYPE_MIXTAGS_RELOC BYTE(0x07) // Mixed Tag Content-Record
-#define SFX_REC_TYPE_MIXTAGS BYTE(0x08) // alt (nicht verschiebbar)
-#define SFX_REC_TYPE_LAST BYTE(0x08)
+#define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records
+#define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records
+
+#define SFX_REC_TYPE_NONE sal_uInt8(0x00) // unbekannter Record-Typ
+#define SFX_REC_TYPE_FIRST sal_uInt8(0x01)
+#define SFX_REC_TYPE_SINGLE sal_uInt8(0x01) // Single-Content-Record
+#define SFX_REC_TYPE_FIXSIZE sal_uInt8(0x02) // Fix-Size-Multi-Content-Record
+#define SFX_REC_TYPE_VARSIZE_RELOC sal_uInt8(0x03) // variable Rec-Size
+#define SFX_REC_TYPE_VARSIZE sal_uInt8(0x04) // alt (nicht verschiebbar)
+#define SFX_REC_TYPE_MIXTAGS_RELOC sal_uInt8(0x07) // Mixed Tag Content-Record
+#define SFX_REC_TYPE_MIXTAGS sal_uInt8(0x08) // alt (nicht verschiebbar)
+#define SFX_REC_TYPE_LAST sal_uInt8(0x08)
#define SFX_REC_TYPE_MINI 0x100 // Mini-Record
#define SFX_REC_TYPE_DRAWENG 0x400 // Drawing-Engine-Record
#define SFX_REC_TYPE_EOR 0xF00 // End-Of-Records
@@ -123,9 +123,9 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 )
Struktur des Mini-Records:
- 1 BYTE Pre-Tag
- 3 BYTE OffsetToEndOfRec
- OffsetToEndOfRec* 1 BYTE Content
+ 1 sal_uInt8 Pre-Tag
+ 3 sal_uInt8 OffsetToEndOfRec
+ OffsetToEndOfRec* 1 sal_uInt8 Content
Bei den Extended-Reords folgt auf diesen 4-Byte-Header ein erweiterter
Header, der zun"achst den o.g. Record-Typ, dann eine Versions-Kennung
@@ -133,13 +133,13 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 )
Struktur des Extended-Records:
- 1 BYTE Pre-Tag (==0x00)
- 3 BYTE OffsetToEndOfRec
- OffsetToEndOfRec* 1 BYTE Content
- 1 BYTE Record-Type
- 1 BYTE Version
- 2 BYTE Tag
- ContentSize* 1 BYTE Content
+ 1 sal_uInt8 Pre-Tag (==0x00)
+ 3 sal_uInt8 OffsetToEndOfRec
+ OffsetToEndOfRec* 1 sal_uInt8 Content
+ 1 sal_uInt8 Record-Type
+ 1 sal_uInt8 Version
+ 2 sal_uInt8 Tag
+ ContentSize* 1 sal_uInt8 Content
(ContentSize = OffsetToEndOfRec - 8)
@@ -159,7 +159,7 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 )
m"ussen.
=> die Bytes 2-4 werden bei allen Records als Offset zum Ende des
Records interpretiert, so da\s die Gesamt-Recors-Size sich wie
- folgt berechnet: sizeof(UINT32) + OffsetToEndOfRec
+ folgt berechnet: sizeof(sal_uInt32) + OffsetToEndOfRec
Die Records sollten einfach zu parsen un einheitlich aufgebaut sein.
=> Sie bauen aufeinander auf, so ist z.B. der SfxMiniRecord in jedem
@@ -190,7 +190,7 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter
/* [Beschreibung]
Mit Instanzen dieser Klasse kann ein einfacher Record in einen Stream
- geschrieben werden, der sich durch ein BYTE-Tag identifiziert, sowie
+ geschrieben werden, der sich durch ein sal_uInt8-Tag identifiziert, sowie
seine eigene L"ange speichert und somit auch von "alteren Versionen
bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen
werden kann. Es wird keine Version-Nummer gespeichert.
@@ -205,9 +205,9 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter
[Fileformat]
- 1* BYTE Content-Tag (!= 0)
- 1* 3-BYTE OffsetToEndOfRec in Bytes
- SizeOfContent* BYTE Content
+ 1* sal_uInt8 Content-Tag (!= 0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ SizeOfContent* sal_uInt8 Content
[Beispiel]
@@ -221,15 +221,15 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter
{
protected:
SvStream* _pStream; // <SvStream>, in dem der Record liegt
- UINT32 _nStartPos; // Start-Position des Gesamt-Records im Stream
+ sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream
bool _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; */
- BYTE _nPreTag; // in den Header zu schreibendes 'Pre-Tag'
+ sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag'
public:
inline SfxMiniRecordWriter( SvStream *pStream,
- BYTE nTag );
- inline SfxMiniRecordWriter( SvStream *pStream, BYTE nTag,
- UINT32 nSize );
+ sal_uInt8 nTag );
+ inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag,
+ sal_uInt32 nSize );
inline ~SfxMiniRecordWriter();
@@ -237,7 +237,7 @@ public:
inline void Reset();
- UINT32 Close( bool bSeekToEndOfRec = true );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
private:
// not implementend, not allowed
@@ -276,35 +276,35 @@ class SVL_DLLPUBLIC SfxMiniRecordReader
{
protected:
SvStream* _pStream; // <SvStream>, aus dem gelesen wird
- UINT32 _nEofRec; // Position direkt hinter dem Record
+ sal_uInt32 _nEofRec; // Position direkt hinter dem Record
bool _bSkipped; // TRUE: der Record wurde explizit geskippt
- BYTE _nPreTag; // aus dem Header gelesenes Pre-Tag
+ sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag
// Drei-Phasen-Ctor f"ur Subklassen
SfxMiniRecordReader() {}
- void Construct_Impl( SvStream *pStream, BYTE nTag )
+ void Construct_Impl( SvStream *pStream, sal_uInt8 nTag )
{
_pStream = pStream;
- _bSkipped = FALSE;
+ _bSkipped = sal_False;
_nPreTag = nTag;
}
- inline bool SetHeader_Impl( UINT32 nHeader );
+ inline bool SetHeader_Impl( sal_uInt32 nHeader );
// als ung"ultig markieren und zur"uck-seeken
- void SetInvalid_Impl( UINT32 nRecordStartPos )
+ void SetInvalid_Impl( sal_uInt32 nRecordStartPos )
{
_nPreTag = SFX_REC_PRETAG_EOR;
_pStream->Seek( nRecordStartPos );
}
public:
- static USHORT ScanRecordType( SvStream *pStream );
+ static sal_uInt16 ScanRecordType( SvStream *pStream );
SfxMiniRecordReader( SvStream *pStream );
- SfxMiniRecordReader( SvStream *pStream, BYTE nTag );
+ SfxMiniRecordReader( SvStream *pStream, sal_uInt8 nTag );
inline ~SfxMiniRecordReader();
- inline BYTE GetTag() const;
+ inline sal_uInt8 GetTag() const;
inline bool IsValid() const;
inline SvStream& operator*() const;
@@ -324,8 +324,8 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter
/* [Beschreibung]
Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben
- werden, dessen einziger Inhalt sich durch ein UINT16-Tag und eine
- BYTE-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert
+ werden, dessen einziger Inhalt sich durch ein sal_uInt16-Tag und eine
+ sal_uInt8-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert
und somit auch von "alteren Versionen bzw. Readern, die diesen
Record-Type (Tag) nicht kennen, "ubersprungen werden kann.
@@ -339,12 +339,12 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter
[Fileformat]
- 1* BYTE Pre-Tag (!= 0)
- 1* 3-BYTE OffsetToEndOfRec in Bytes
- 1* BYTE Record-Type (==SFX_REC_TYPE_SINGLE)
- 1* BYTE Content-Version
- 1* USHORT Content-Tag
- SizeOfContent* BYTE Content
+ 1* sal_uInt8 Pre-Tag (!= 0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_SINGLE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ SizeOfContent* sal_uInt8 Content
[Beispiel]
@@ -357,20 +357,20 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter
{
protected:
- SfxSingleRecordWriter( BYTE nRecordType,
+ SfxSingleRecordWriter( sal_uInt8 nRecordType,
SvStream *pStream,
- UINT16 nTag, BYTE nCurVer );
+ sal_uInt16 nTag, sal_uInt8 nCurVer );
public:
SfxSingleRecordWriter( SvStream *pStream,
- UINT16 nTag, BYTE nCurVer );
+ sal_uInt16 nTag, sal_uInt8 nCurVer );
SfxSingleRecordWriter( SvStream *pStream,
- UINT16 nTag, BYTE nCurVer,
- UINT32 nSize );
+ sal_uInt16 nTag, sal_uInt8 nCurVer,
+ sal_uInt32 nSize );
inline void Reset();
- UINT32 Close( bool bSeekToEndOfRec = true );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -405,9 +405,9 @@ class SVL_DLLPUBLIC SfxSingleRecordReader: public SfxMiniRecordReader
{
protected:
- UINT16 _nRecordTag; // Art des Gesamt-Inhalts
- BYTE _nRecordVer; // Version des Gesamt-Inhalts
- BYTE _nRecordType; // Record Type aus dem Header
+ sal_uInt16 _nRecordTag; // Art des Gesamt-Inhalts
+ sal_uInt8 _nRecordVer; // Version des Gesamt-Inhalts
+ sal_uInt8 _nRecordType; // Record Type aus dem Header
// Drei-Phasen-Ctor f"ur Subklassen
SfxSingleRecordReader() {}
@@ -416,17 +416,17 @@ protected:
SfxMiniRecordReader::Construct_Impl(
pStream, SFX_REC_PRETAG_EXT );
}
- bool FindHeader_Impl( UINT16 nTypes, UINT16 nTag );
- bool ReadHeader_Impl( USHORT nTypes );
+ bool FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag );
+ bool ReadHeader_Impl( sal_uInt16 nTypes );
public:
SfxSingleRecordReader( SvStream *pStream );
- SfxSingleRecordReader( SvStream *pStream, USHORT nTag );
+ SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag );
- inline UINT16 GetTag() const;
+ inline sal_uInt16 GetTag() const;
- inline BYTE GetVersion() const;
- inline bool HasVersion( USHORT nVersion ) const;
+ inline sal_uInt8 GetVersion() const;
+ inline bool HasVersion( sal_uInt16 nVersion ) const;
};
//------------------------------------------------------------------------
@@ -454,22 +454,22 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter
[Fileformat]
- 1* BYTE Pre-Tag (==0)
- 1* 3-BYTE OffsetToEndOfRec in Bytes
- 1* BYTE Record-Type (==SFX_REC_TYPE_FIXSIZE)
- 1* BYTE Content-Version
- 1* UINT16 Content-Tag
- 1* UINT16 NumberOfContents
- 1* UINT32 SizeOfEachContent
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_FIXSIZE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 SizeOfEachContent
NumberOfContents* (
- SizeOfEachContent BYTE Content
+ SizeOfEachContent sal_uInt8 Content
)
[Beispiel]
{
SfxMultiFixRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION );
- for ( USHORT n = 0; n < Count(); ++n )
+ for ( sal_uInt16 n = 0; n < Count(); ++n )
{
aRecord.NewContent();
*aRecord << aMember1[n];
@@ -480,28 +480,28 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter
{
protected:
- UINT32 _nContentStartPos; /* Startposition des jeweiligen
+ sal_uInt32 _nContentStartPos; /* Startposition des jeweiligen
Contents - nur bei DBG_UTIL
und f"ur Subklassen */
- UINT32 _nContentSize; // Gr"o\se jedes Contents
- UINT16 _nContentCount; // jeweilige Anzahl der Contents
+ sal_uInt32 _nContentSize; // Gr"o\se jedes Contents
+ sal_uInt16 _nContentCount; // jeweilige Anzahl der Contents
- SfxMultiFixRecordWriter( BYTE nRecordType,
+ SfxMultiFixRecordWriter( sal_uInt8 nRecordType,
SvStream *pStream,
- UINT16 nTag, BYTE nCurVer,
- UINT32 nContentSize );
+ sal_uInt16 nTag, sal_uInt8 nCurVer,
+ sal_uInt32 nContentSize );
public:
SfxMultiFixRecordWriter( SvStream *pStream,
- UINT16 nTag, BYTE nCurVer,
- UINT32 nContentSize );
+ sal_uInt16 nTag, sal_uInt8 nCurVer,
+ sal_uInt32 nContentSize );
inline ~SfxMultiFixRecordWriter();
inline void NewContent();
inline void Reset();
- UINT32 Close( bool bSeekToEndOfRec = true );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -527,23 +527,23 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter
[Fileformat]
- 1* BYTE Pre-Tag (==0)
- 1* 3-BYTE OffsetToEndOfRec in Bytes
- 1* BYTE Record-Type (==SFX_FILETYPE_TYPE_VARSIZE)
- 1* BYTE Content-Version
- 1* USHORT Content-Tag
- 1* UINT16 NumberOfContents
- 1* UINT32 OffsetToOfsTable
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_FILETYPE_TYPE_VARSIZE)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Content-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 OffsetToOfsTable
NumberOfContents* (
- ContentSize* BYTE Content
+ ContentSize* sal_uInt8 Content
)
- NumberOfContents* UINT32 ContentOfs (je per <<8 verschoben)
+ NumberOfContents* sal_uInt32 ContentOfs (je per <<8 verschoben)
[Beispiel]
{
SfxMultiVarRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION );
- for ( USHORT n = 0; n < Count(); ++n )
+ for ( sal_uInt16 n = 0; n < Count(); ++n )
{
aRecord.NewContent();
*aRecord << aMember1[n];
@@ -555,24 +555,24 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter
{
protected:
SfxUINT32s _aContentOfs;
- USHORT _nContentVer; // nur f"ur SfxMultiMixRecordWriter
+ sal_uInt16 _nContentVer; // nur f"ur SfxMultiMixRecordWriter
- SfxMultiVarRecordWriter( BYTE nRecordType,
+ SfxMultiVarRecordWriter( sal_uInt8 nRecordType,
SvStream *pStream,
- USHORT nRecordTag,
- BYTE nRecordVer );
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
void FlushContent_Impl();
public:
SfxMultiVarRecordWriter( SvStream *pStream,
- USHORT nRecordTag,
- BYTE nRecordVer );
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
virtual ~SfxMultiVarRecordWriter();
void NewContent();
- virtual UINT32 Close( bool bSeekToEndOfRec = true );
+ virtual sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -597,27 +597,27 @@ class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public SfxMultiVarRecordWriter
[Fileformat]
- 1* BYTE Pre-Tag (==0)
- 1* 3-BYTE OffsetToEndOfRec in Bytes
- 1* BYTE Record-Type (==SFX_REC_TYPE_MIXTAGS)
- 1* BYTE Content-Version
- 1* USHORT Record-Tag
- 1* UINT16 NumberOfContents
- 1* UINT32 OffsetToOfsTable
+ 1* sal_uInt8 Pre-Tag (==0)
+ 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes
+ 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_MIXTAGS)
+ 1* sal_uInt8 Content-Version
+ 1* sal_uInt16 Record-Tag
+ 1* sal_uInt16 NumberOfContents
+ 1* sal_uInt32 OffsetToOfsTable
NumberOfContents* (
- 1* USHORT Content-Tag
- ContentSize* BYTE Content
+ 1* sal_uInt16 Content-Tag
+ ContentSize* sal_uInt8 Content
)
- NumberOfContents* UINT32 ( ContentOfs << 8 + Version )
+ NumberOfContents* sal_uInt32 ( ContentOfs << 8 + Version )
*/
{
public:
inline SfxMultiMixRecordWriter( SvStream *pStream,
- USHORT nRecordTag,
- BYTE nRecordVer );
+ sal_uInt16 nRecordTag,
+ sal_uInt8 nRecordVer );
- void NewContent( USHORT nTag, BYTE nVersion );
+ void NewContent( sal_uInt16 nTag, sal_uInt8 nVersion );
// private: geht nicht, da einige Compiler dann auch vorherige privat machen
void NewContent()
@@ -642,7 +642,7 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader
{
SfxMultiRecordReader aRecord( pStream );
- for ( USHORT nRecNo = 0; aRecord.GetContent(); ++nRecNo )
+ for ( sal_uInt16 nRecNo = 0; aRecord.GetContent(); ++nRecNo )
{
switch ( aRecord.GetTag() )
{
@@ -661,30 +661,30 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader
*/
{
- UINT32 _nStartPos; // Start-Position des Records
- UINT32* _pContentOfs; // Offsets der Startpositionen
- UINT32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos
- UINT16 _nContentCount; // Anzahl der Contents im Record
- UINT16 _nContentNo; /* der Index des aktuellen Contents
+ sal_uInt32 _nStartPos; // Start-Position des Records
+ sal_uInt32* _pContentOfs; // Offsets der Startpositionen
+ sal_uInt32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos
+ sal_uInt16 _nContentCount; // Anzahl der Contents im Record
+ sal_uInt16 _nContentNo; /* der Index des aktuellen Contents
enth"alt jeweils den Index des
Contents, der beim n"achsten
GetContent() geholt wird */
- UINT16 _nContentTag; // Art-Kennung des aktuellen Contents
- BYTE _nContentVer; // Versions-Kennung des akt. Contents
+ sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents
+ sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents
bool ReadHeader_Impl();
public:
SfxMultiRecordReader( SvStream *pStream );
- SfxMultiRecordReader( SvStream *pStream, UINT16 nTag );
+ SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag );
~SfxMultiRecordReader();
bool GetContent();
- inline UINT16 GetContentTag();
- inline BYTE GetContentVersion() const;
- inline bool HasContentVersion( USHORT nVersion ) const;
+ inline sal_uInt16 GetContentTag();
+ inline sal_uInt8 GetContentVersion() const;
+ inline bool HasContentVersion( sal_uInt16 nVersion ) const;
- inline UINT32 ContentCount() const;
+ inline sal_uInt32 ContentCount() const;
};
//=========================================================================
@@ -692,7 +692,7 @@ public:
inline SfxMiniRecordWriter::SfxMiniRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- BYTE nTag // Record-Tag zwischen 0x01 und 0xFE
+ sal_uInt8 nTag // Record-Tag zwischen 0x01 und 0xFE
)
/* [Beschreibung]
@@ -718,8 +718,8 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter
inline SfxMiniRecordWriter::SfxMiniRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- BYTE nTag, // Record-Tag zwischen 0x01 und 0xFE
- UINT32 nSize // Gr"o\se der Daten in Bytes
+ sal_uInt8 nTag, // Record-Tag zwischen 0x01 und 0xFE
+ sal_uInt32 nSize // Gr"o\se der Daten in Bytes
)
/* [Beschreibung]
@@ -809,12 +809,12 @@ inline void SfxMiniRecordReader::Skip()
{
_pStream->Seek(_nEofRec);
- _bSkipped = TRUE;
+ _bSkipped = sal_True;
}
//-------------------------------------------------------------------------
-inline BYTE SfxMiniRecordReader::GetTag() const
+inline sal_uInt8 SfxMiniRecordReader::GetTag() const
/* [Beschreibung]
@@ -861,18 +861,18 @@ inline SvStream& SfxMiniRecordReader::operator*() const
//=========================================================================
-inline UINT32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
+inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
// siehe <SfxMiniRecordWriter::Close(bool)>
{
- UINT32 nRet = 0;
+ sal_uInt32 nRet = 0;
// wurde der Header noch nicht geschrieben?
if ( !_bHeaderOk )
{
// Basisklassen-Header schreiben
- UINT32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec );
+ sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec );
// ggf. ans Ende des eigenen Headers seeken oder hinter Rec bleiben
if ( !bSeekToEndOfRec )
@@ -901,7 +901,7 @@ inline void SfxSingleRecordWriter::Reset()
//=========================================================================
-inline UINT16 SfxSingleRecordReader::GetTag() const
+inline sal_uInt16 SfxSingleRecordReader::GetTag() const
/* [Beschreibung]
@@ -914,7 +914,7 @@ inline UINT16 SfxSingleRecordReader::GetTag() const
//-------------------------------------------------------------------------
-inline BYTE SfxSingleRecordReader::GetVersion() const
+inline sal_uInt8 SfxSingleRecordReader::GetVersion() const
/* [Beschreibung]
@@ -927,7 +927,7 @@ inline BYTE SfxSingleRecordReader::GetVersion() const
//-------------------------------------------------------------------------
-inline bool SfxSingleRecordReader::HasVersion( USHORT nVersion ) const
+inline bool SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const
/* [Beschreibung]
@@ -969,7 +969,7 @@ inline void SfxMultiFixRecordWriter::NewContent()
{
#ifdef DBG_UTIL
- ULONG nOldStartPos;
+ sal_uLong nOldStartPos;
// Startposition des aktuellen Contents merken - Achtung Subklassen!
nOldStartPos = _nContentStartPos;
#endif
@@ -994,8 +994,8 @@ inline void SfxMultiFixRecordWriter::NewContent()
inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- USHORT nRecordTag, // Gesamt-Record-Art-Kennung
- BYTE nRecordVer // Gesamt-Record-Versions-Kennung
+ sal_uInt16 nRecordTag, // Gesamt-Record-Art-Kennung
+ sal_uInt8 nRecordVer // Gesamt-Record-Versions-Kennung
)
/* [Beschreibung]
@@ -1022,7 +1022,7 @@ inline void SfxMultiFixRecordWriter::Reset()
//=========================================================================
-inline UINT16 SfxMultiRecordReader::GetContentTag()
+inline sal_uInt16 SfxMultiRecordReader::GetContentTag()
/* [Beschreibung]
@@ -1036,7 +1036,7 @@ inline UINT16 SfxMultiRecordReader::GetContentTag()
//-------------------------------------------------------------------------
-inline BYTE SfxMultiRecordReader::GetContentVersion() const
+inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const
/* [Beschreibung]
@@ -1050,7 +1050,7 @@ inline BYTE SfxMultiRecordReader::GetContentVersion() const
//-------------------------------------------------------------------------
-inline bool SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const
+inline bool SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const
/* [Beschreibung]
@@ -1065,7 +1065,7 @@ inline bool SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const
//-------------------------------------------------------------------------
-inline UINT32 SfxMultiRecordReader::ContentCount() const
+inline sal_uInt32 SfxMultiRecordReader::ContentCount() const
/* [Beschreibung]
diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx
index e424372d52c9..f64efc455867 100644
--- a/svl/inc/svl/flagitem.hxx
+++ b/svl/inc/svl/flagitem.hxx
@@ -35,7 +35,7 @@
class SvStream;
-extern USHORT nSfxFlagVal[16];
+extern sal_uInt16 nSfxFlagVal[16];
// -----------------------------------------------------------------------
@@ -43,24 +43,24 @@ DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem
{
- USHORT nVal;
+ sal_uInt16 nVal;
public:
TYPEINFO();
- SfxFlagItem( USHORT nWhich = 0, USHORT nValue = 0 );
- SfxFlagItem( USHORT nWhich, SvStream & );
+ SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 );
+ SfxFlagItem( sal_uInt16 nWhich, SvStream & );
SfxFlagItem( const SfxFlagItem& );
~SfxFlagItem() {
DBG_DTOR(SfxFlagItem, 0); }
- virtual BYTE GetFlagCount() const;
- virtual XubString GetFlagText( BYTE nFlag ) const;
+ virtual sal_uInt8 GetFlagCount() const;
+ virtual XubString GetFlagText( sal_uInt8 nFlag ) const;
virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
@@ -68,14 +68,14 @@ public:
SfxMapUnit ePresMetric,
XubString &rText,
const IntlWrapper * = 0 ) const;
- USHORT GetValue() const { return nVal; }
- void SetValue( USHORT nNewVal ) {
+ sal_uInt16 GetValue() const { return nVal; }
+ void SetValue( sal_uInt16 nNewVal ) {
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
nVal = nNewVal;
}
- int GetFlag( BYTE nFlag ) const {
+ int GetFlag( sal_uInt8 nFlag ) const {
return ( (nVal & nSfxFlagVal[nFlag]) != 0 ); }
- void SetFlag( BYTE nFlag, int bVal );
+ void SetFlag( sal_uInt8 nFlag, int bVal );
};
#endif
diff --git a/svl/inc/folderrestriction.hxx b/svl/inc/svl/folderrestriction.hxx
index e39c5aeb84d3..e39c5aeb84d3 100644
--- a/svl/inc/folderrestriction.hxx
+++ b/svl/inc/svl/folderrestriction.hxx
diff --git a/svl/inc/fstathelper.hxx b/svl/inc/svl/fstathelper.hxx
index fcc71502e639..fcc71502e639 100644
--- a/svl/inc/fstathelper.hxx
+++ b/svl/inc/svl/fstathelper.hxx
diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx
index 2db51b22999e..478b530f3510 100644
--- a/svl/inc/svl/globalnameitem.hxx
+++ b/svl/inc/svl/globalnameitem.hxx
@@ -43,7 +43,7 @@ class SVL_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem
public:
TYPEINFO();
SfxGlobalNameItem();
- SfxGlobalNameItem( USHORT nWhich, const SvGlobalName& );
+ SfxGlobalNameItem( sal_uInt16 nWhich, const SvGlobalName& );
~SfxGlobalNameItem();
virtual int operator==( const SfxPoolItem& ) const;
@@ -51,9 +51,9 @@ public:
SvGlobalName GetValue() const { return m_aName; }
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
};
#endif
diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx
index 49ab106e45e3..ce840500b4ab 100644
--- a/svl/inc/svl/hint.hxx
+++ b/svl/inc/svl/hint.hxx
@@ -45,26 +45,26 @@ public:
class Visibility Name: public SfxHint \
{ \
Type* pObj; \
- BOOL bIsOwner; \
+ sal_Bool bIsOwner; \
\
public: \
TYPEINFO(); \
- Name( Type* Object, BOOL bOwnedByHint = FALSE ); \
+ Name( Type* Object, sal_Bool bOwnedByHint = sal_False ); \
~Name(); \
\
Type* GetObject() const { return pObj; } \
- BOOL IsOwner() const { return bIsOwner; } \
+ sal_Bool IsOwner() const { return bIsOwner; } \
}
#define IMPL_PTRHINT_AUTODELETE(Name, Type) \
TYPEINIT1(Name, SfxHint); \
- Name::Name( Type* pObject, BOOL bOwnedByHint ) \
+ Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \
{ pObj = pObject; bIsOwner = bOwnedByHint; } \
Name::~Name() { if ( bIsOwner ) delete pObj; }
#define IMPL_PTRHINT(Name, Type) \
TYPEINIT1(Name, SfxHint); \
- Name::Name( Type* pObject, BOOL bOwnedByHint ) \
+ Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \
{ pObj = pObject; bIsOwner = bOwnedByHint; } \
Name::~Name() {}
diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx
index ab5dc857ef7f..2d5d434592af 100644
--- a/svl/inc/svl/httpcook.hxx
+++ b/svl/inc/svl/httpcook.hxx
@@ -62,8 +62,8 @@ struct CntHTTPCookie
String m_aDomain;
String m_aPath;
DateTime m_aExpires;
- USHORT m_nFlags;
- USHORT m_nPolicy;
+ sal_uInt16 m_nFlags;
+ sal_uInt16 m_nPolicy;
CntHTTPCookie (void)
: m_aExpires (Date(0), Time(0)),
@@ -71,14 +71,14 @@ struct CntHTTPCookie
m_nPolicy (CNTHTTP_COOKIE_POLICY_INTERACTIVE)
{}
- BOOL replaces (const CntHTTPCookie& rOther) const
+ sal_Bool replaces (const CntHTTPCookie& rOther) const
{
return ((m_aDomain == rOther.m_aDomain) &&
(m_aPath == rOther.m_aPath ) &&
(m_aName == rOther.m_aName ) );
}
- BOOL operator== (const CntHTTPCookie& rOther) const
+ sal_Bool operator== (const CntHTTPCookie& rOther) const
{
return ((m_aName == rOther.m_aName ) &&
(m_aValue == rOther.m_aValue ) &&
@@ -137,7 +137,7 @@ struct CntHTTPCookieRequest
const String& m_rURL;
List& m_rCookieList;
CntHTTPCookieRequestType m_eType;
- USHORT m_nRet;
+ sal_uInt16 m_nRet;
CntHTTPCookieRequest (
const String& rURL,
diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx
index abe4100407ce..a0527cec556c 100644
--- a/svl/inc/svl/ilstitem.hxx
+++ b/svl/inc/svl/ilstitem.hxx
@@ -43,7 +43,7 @@ public:
TYPEINFO();
SfxIntegerListItem();
- SfxIntegerListItem( USHORT nWhich, const SvULongs& rList );
+ SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList );
SfxIntegerListItem( const SfxIntegerListItem& rItem );
~SfxIntegerListItem();
@@ -56,8 +56,8 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual bool PutValue ( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
};
#endif // _SFXINTITEM_HXX
diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx
index 7e6bbf3d0a1e..e6cd1d552fd1 100644
--- a/svl/inc/svl/imageitm.hxx
+++ b/svl/inc/svl/imageitm.hxx
@@ -40,20 +40,20 @@ class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item
SfxImageItem_Impl* pImp;
public:
TYPEINFO();
- SfxImageItem( USHORT nWhich = 0, UINT16 nImage = 0 );
- SfxImageItem( USHORT nWhich, const String& rURL );
+ SfxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 );
+ SfxImageItem( sal_uInt16 nWhich, const String& rURL );
SfxImageItem( const SfxImageItem& );
virtual ~SfxImageItem();
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
virtual int operator==( const SfxPoolItem& ) const;
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
void SetRotation( long nValue );
long GetRotation() const;
- void SetMirrored( BOOL bSet );
- BOOL IsMirrored() const;
+ void SetMirrored( sal_Bool bSet );
+ sal_Bool IsMirrored() const;
String GetURL() const;
};
diff --git a/svl/inc/inetdef.hxx b/svl/inc/svl/inetdef.hxx
index 3984dcced8f6..3984dcced8f6 100644
--- a/svl/inc/inetdef.hxx
+++ b/svl/inc/svl/inetdef.hxx
diff --git a/svl/inc/svl/inethist.hxx b/svl/inc/svl/inethist.hxx
index 8dbc20c51324..982ad1d25f43 100644
--- a/svl/inc/svl/inethist.hxx
+++ b/svl/inc/svl/inethist.hxx
@@ -63,7 +63,7 @@ class INetURLHistory : public SfxBroadcaster
static void NormalizeUrl_Impl (INetURLObject &rUrl);
SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl);
- SVL_DLLPUBLIC BOOL QueryUrl_Impl (const INetURLObject &rUrl);
+ SVL_DLLPUBLIC sal_Bool QueryUrl_Impl (const INetURLObject &rUrl);
/** Not implemented.
*/
@@ -77,7 +77,7 @@ public:
/** QueryProtocol.
*/
- BOOL QueryProtocol (INetProtocol eProto) const
+ sal_Bool QueryProtocol (INetProtocol eProto) const
{
return ((eProto == INET_PROT_FILE ) ||
(eProto == INET_PROT_FTP ) ||
@@ -87,22 +87,22 @@ public:
/** QueryUrl.
*/
- BOOL QueryUrl (const INetURLObject &rUrl)
+ sal_Bool QueryUrl (const INetURLObject &rUrl)
{
if (QueryProtocol (rUrl.GetProtocol()))
return QueryUrl_Impl (rUrl);
else
- return FALSE;
+ return sal_False;
}
- BOOL QueryUrl (const String &rUrl)
+ sal_Bool QueryUrl (const String &rUrl)
{
INetProtocol eProto =
INetURLObject::CompareProtocolScheme (rUrl);
if (QueryProtocol (eProto))
return QueryUrl_Impl (INetURLObject (rUrl));
else
- return FALSE;
+ return sal_False;
}
/** PutUrl.
diff --git a/svl/inc/inetmsg.hxx b/svl/inc/svl/inetmsg.hxx
index 049c54219bb1..049c54219bb1 100644
--- a/svl/inc/inetmsg.hxx
+++ b/svl/inc/svl/inetmsg.hxx
diff --git a/svl/inc/inetstrm.hxx b/svl/inc/svl/inetstrm.hxx
index f1d7812f623f..f1d7812f623f 100644
--- a/svl/inc/inetstrm.hxx
+++ b/svl/inc/svl/inetstrm.hxx
diff --git a/svl/inc/instrm.hxx b/svl/inc/svl/instrm.hxx
index 566ef4fb02e7..8e97babaf372 100644
--- a/svl/inc/instrm.hxx
+++ b/svl/inc/svl/instrm.hxx
@@ -48,19 +48,19 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream
com::sun::star::uno::Reference< com::sun::star::io::XSeekable >
m_xSeekable;
SvDataPipe_Impl * m_pPipe;
- ULONG m_nSeekedFrom;
+ sal_uLong m_nSeekedFrom;
SVL_DLLPRIVATE bool open();
- SVL_DLLPRIVATE virtual ULONG GetData(void * pData, ULONG nSize);
+ SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize);
- SVL_DLLPRIVATE virtual ULONG PutData(void const *, ULONG);
+ SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong);
- SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG nPos);
+ SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos);
SVL_DLLPRIVATE virtual void FlushData();
- SVL_DLLPRIVATE virtual void SetSize(ULONG);
+ SVL_DLLPRIVATE virtual void SetSize(sal_uLong);
public:
SvInputStream(
@@ -70,11 +70,11 @@ public:
virtual ~SvInputStream();
- virtual USHORT IsA() const;
+ virtual sal_uInt16 IsA() const;
- virtual void AddMark(ULONG nPos);
+ virtual void AddMark(sal_uLong nPos);
- virtual void RemoveMark(ULONG nPos);
+ virtual void RemoveMark(sal_uLong nPos);
};
#endif // SVTOOLS_INSTRM_HXX
diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx
index d6f7239df0ce..9ecb9a904dc5 100644
--- a/svl/inc/svl/intitem.hxx
+++ b/svl/inc/svl/intitem.hxx
@@ -38,13 +38,13 @@ class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
public:
TYPEINFO();
- SfxByteItem(USHORT which = 0, BYTE nValue = 0):
+ SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
CntByteItem(which, nValue) {}
- SfxByteItem(USHORT which, SvStream & rStream):
+ SfxByteItem(sal_uInt16 which, SvStream & rStream):
CntByteItem(which, rStream) {}
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
{ return new SfxByteItem(*this); }
@@ -55,16 +55,16 @@ DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
{
- INT16 m_nValue;
+ sal_Int16 m_nValue;
public:
TYPEINFO();
- SfxInt16Item(USHORT which = 0, INT16 nTheValue = 0):
+ SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(SfxInt16Item, 0); }
- SfxInt16Item(USHORT nWhich, SvStream & rStream);
+ SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
SfxInt16Item(const SfxInt16Item & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -84,29 +84,29 @@ public:
const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual INT16 GetMin() const;
+ virtual sal_Int16 GetMin() const;
- virtual INT16 GetMax() const;
+ virtual sal_Int16 GetMax() const;
virtual SfxFieldUnit GetUnit() const;
- INT16 GetValue() const { return m_nValue; }
+ sal_Int16 GetValue() const { return m_nValue; }
- inline void SetValue(INT16 nTheValue);
+ inline void SetValue(sal_Int16 nTheValue);
};
-inline void SfxInt16Item::SetValue(INT16 nTheValue)
+inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
{
DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
m_nValue = nTheValue;
@@ -118,13 +118,13 @@ class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
public:
TYPEINFO();
- SfxUInt16Item(USHORT which = 0, UINT16 nValue = 0):
+ SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
CntUInt16Item(which, nValue) {}
- SfxUInt16Item(USHORT which, SvStream & rStream):
+ SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
CntUInt16Item(which, rStream) {}
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
{ return new SfxUInt16Item(Which(), rStream); }
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
@@ -137,13 +137,13 @@ class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
public:
TYPEINFO();
- SfxInt32Item(USHORT which = 0, INT32 nValue = 0):
+ SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
CntInt32Item(which, nValue) {}
- SfxInt32Item(USHORT which, SvStream & rStream):
+ SfxInt32Item(sal_uInt16 which, SvStream & rStream):
CntInt32Item(which, rStream) {}
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
{ return new SfxInt32Item(Which(), rStream); }
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
@@ -157,13 +157,13 @@ class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
public:
TYPEINFO();
- SfxUInt32Item(USHORT which = 0, UINT32 nValue = 0):
+ SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
CntUInt32Item(which, nValue) {}
- SfxUInt32Item(USHORT which, SvStream & rStream):
+ SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
CntUInt32Item(which, rStream) {}
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
{ return new SfxUInt32Item(Which(), rStream); }
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx
index a98f2da24d55..55ad0e7b02a5 100644
--- a/svl/inc/svl/itemiter.hxx
+++ b/svl/inc/svl/itemiter.hxx
@@ -40,7 +40,7 @@ class SVL_DLLPUBLIC SfxItemIter
{
// Item-Feld - Start & Ende
const SfxItemSet& _rSet;
- USHORT _nStt, _nEnd, _nAkt;
+ sal_uInt16 _nStt, _nEnd, _nAkt;
public:
SfxItemIter( const SfxItemSet& rSet );
@@ -58,12 +58,12 @@ public:
const SfxPoolItem* NextItem();
const SfxPoolItem* PrevItem();
- BOOL IsAtStart() const { return _nAkt == _nStt; }
- BOOL IsAtEnd() const { return _nAkt == _nEnd; }
+ sal_Bool IsAtStart() const { return _nAkt == _nStt; }
+ sal_Bool IsAtEnd() const { return _nAkt == _nEnd; }
- USHORT GetCurPos() const { return _nAkt; }
- USHORT GetFirstPos() const { return _nStt; }
- USHORT GetLastPos() const { return _nEnd; }
+ sal_uInt16 GetCurPos() const { return _nAkt; }
+ sal_uInt16 GetFirstPos() const { return _nStt; }
+ sal_uInt16 GetLastPos() const { return _nEnd; }
};
#endif
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx
index 04ae4f07d29b..3cec7f75dee2 100644
--- a/svl/inc/svl/itempool.hxx
+++ b/svl/inc/svl/itempool.hxx
@@ -71,8 +71,8 @@ DBG_NAMEEX(SfxItemPool)
struct SfxItemInfo
{
- USHORT _nSID;
- USHORT _nFlags;
+ sal_uInt16 _nSID;
+ sal_uInt16 _nFlags;
};
//====================================================================
@@ -105,23 +105,23 @@ class SVL_DLLPUBLIC SfxItemPool
*/
{
- SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion,
+ SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr);
UniString aName;
- USHORT nStart, nEnd;
- USHORT _nFileFormatVersion;
+ sal_uInt16 nStart, nEnd;
+ sal_uInt16 _nFileFormatVersion;
#ifdef TF_POOLABLE
const SfxItemInfo* pItemInfos;
#else
- USHORT* pSlotIds;
+ sal_uInt16* pSlotIds;
#endif
SfxItemPool_Impl* pImp;
SfxPoolItem** ppStaticDefaults;
SfxPoolItem** ppPoolDefaults;
SfxItemPool* pSecondary;
SfxItemPool* pMaster;
- USHORT* _pPoolRanges;
+ sal_uInt16* _pPoolRanges;
bool bPersistentRefCounts;
private:
@@ -138,16 +138,16 @@ public:
friend class SfxPoolWhichMap;
private:
- inline USHORT GetIndex_Impl(USHORT nWhich) const;
- inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; }
+ inline sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const;
+ inline sal_uInt16 GetSize_Impl() const { return nEnd - nStart + 1; }
SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream );
- SVL_DLLPRIVATE bool IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const;
+ SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
public:
// fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges
- void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const;
- const USHORT* GetFrozenIdRanges() const
+ void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const;
+ const sal_uInt16* GetFrozenIdRanges() const
{ return _pPoolRanges; }
bool IsVer2_Impl() const;
@@ -155,21 +155,21 @@ public:
//---------------------------------------------------------------------
protected:
- static inline void SetRefCount( SfxPoolItem& rItem, ULONG n );
- static inline ULONG AddRef( const SfxPoolItem& rItem, ULONG n = 1 );
- static inline ULONG ReleaseRef( const SfxPoolItem& rItem, ULONG n = 1);
+ static inline void SetRefCount( SfxPoolItem& rItem, sal_uLong n );
+ static inline sal_uLong AddRef( const SfxPoolItem& rItem, sal_uLong n = 1 );
+ static inline sal_uLong ReleaseRef( const SfxPoolItem& rItem, sal_uLong n = 1);
public:
SfxItemPool( const SfxItemPool &rPool,
- BOOL bCloneStaticDefaults = FALSE );
+ sal_Bool bCloneStaticDefaults = sal_False );
SfxItemPool( const UniString &rName,
- USHORT nStart, USHORT nEnd,
+ sal_uInt16 nStart, sal_uInt16 nEnd,
#ifdef TF_POOLABLE
const SfxItemInfo *pItemInfos,
#endif
SfxPoolItem **pDefaults = 0,
#ifndef TF_POOLABLE
- USHORT *pSlotIds = 0,
+ sal_uInt16 *pSlotIds = 0,
#endif
bool bLoadRefCounts = true );
protected:
@@ -180,14 +180,14 @@ public:
SfxBroadcaster& BC();
void SetPoolDefaultItem( const SfxPoolItem& );
- const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const;
- void ResetPoolDefaultItem( USHORT nWhich );
+ const SfxPoolItem* GetPoolDefaultItem( sal_uInt16 nWhich ) const;
+ void ResetPoolDefaultItem( sal_uInt16 nWhich );
void SetDefaults( SfxPoolItem **pDefaults );
- void ReleaseDefaults( BOOL bDelete = FALSE );
- static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE );
+ void ReleaseDefaults( sal_Bool bDelete = sal_False );
+ static void ReleaseDefaults( SfxPoolItem **pDefaults, sal_uInt16 nCount, sal_Bool bDelete = sal_False );
- virtual SfxMapUnit GetMetric( USHORT nWhich ) const;
+ virtual SfxMapUnit GetMetric( sal_uInt16 nWhich ) const;
void SetDefaultMetric( SfxMapUnit eNewMetric );
virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem,
SfxItemPresentation ePresentation,
@@ -198,9 +198,9 @@ public:
virtual SfxItemPool* Clone() const;
UniString const & GetName() const { return aName; }
- virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 );
+ virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 );
virtual void Remove( const SfxPoolItem& );
- virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const;
+ virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const;
const SfxPoolItem* LoadItem( SvStream &rStream,
bool bDirect = false,
@@ -209,11 +209,11 @@ public:
const SfxPoolItem &rItem,
bool bDirect = false ) const;
- USHORT GetSurrogate(const SfxPoolItem *) const;
- const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const;
- USHORT GetItemCount(USHORT nWhich) const;
+ sal_uInt32 GetSurrogate(const SfxPoolItem *) const;
+ const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const;
+ sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const;
const SfxPoolItem* LoadSurrogate(SvStream& rStream,
- USHORT &rWhich, USHORT nSlotId,
+ sal_uInt16 &rWhich, sal_uInt16 nSlotId,
const SfxItemPool* pRefPool = 0 );
bool StoreSurrogate(SvStream& rStream,
const SfxPoolItem *pItem ) const;
@@ -224,14 +224,14 @@ public:
return bPersistentRefCounts; }
void LoadCompleted();
- USHORT GetFirstWhich() const { return nStart; }
- USHORT GetLastWhich() const { return nEnd; }
- bool IsInRange( USHORT nWhich ) const {
+ sal_uInt16 GetFirstWhich() const { return nStart; }
+ sal_uInt16 GetLastWhich() const { return nEnd; }
+ bool IsInRange( sal_uInt16 nWhich ) const {
return nWhich >= nStart &&
nWhich <= nEnd; }
- bool IsInVersionsRange( USHORT nWhich ) const;
- bool IsInStoringRange( USHORT nWhich ) const;
- void SetStoringRange( USHORT nFrom, USHORT nTo );
+ bool IsInVersionsRange( sal_uInt16 nWhich ) const;
+ bool IsInStoringRange( sal_uInt16 nWhich ) const;
+ void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo );
void SetSecondaryPool( SfxItemPool *pPool );
SfxItemPool* GetSecondaryPool() const {
return pSecondary; }
@@ -243,35 +243,35 @@ public:
void Delete();
#ifdef TF_POOLABLE
- bool IsItemFlag( USHORT nWhich, USHORT nFlag ) const;
- bool IsItemFlag( const SfxPoolItem &rItem, USHORT nFlag ) const
+ bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
+ bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const
{ return IsItemFlag( rItem.Which(), nFlag ); }
void SetItemInfos( const SfxItemInfo *pInfos )
{ pItemInfos = pInfos; }
#else
int HasMap() const { return 0 != pSlotIds; }
- void SetMap( USHORT *pNewSlotIds )
+ void SetMap( sal_uInt16 *pNewSlotIds )
{ pSlotIds = pNewSlotIds; }
#endif
- USHORT GetWhich( USHORT nSlot, BOOL bDeep = TRUE ) const;
- USHORT GetSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const;
- USHORT GetTrueWhich( USHORT nSlot, BOOL bDeep = TRUE ) const;
- USHORT GetTrueSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const;
-
- void SetVersionMap( USHORT nVer,
- USHORT nOldStart, USHORT nOldEnd,
- USHORT *pWhichIdTab );
- USHORT GetNewWhich( USHORT nOldWhich ) const;
- USHORT GetVersion() const;
- USHORT GetFileFormatVersion() const
+ sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
+ sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
+
+ void SetVersionMap( sal_uInt16 nVer,
+ sal_uInt16 nOldStart, sal_uInt16 nOldEnd,
+ sal_uInt16 *pWhichIdTab );
+ sal_uInt16 GetNewWhich( sal_uInt16 nOldWhich ) const;
+ sal_uInt16 GetVersion() const;
+ sal_uInt16 GetFileFormatVersion() const
{ return _nFileFormatVersion; }
- void SetFileFormatVersion( USHORT nFileFormatVersion );
- USHORT GetLoadingVersion() const;
+ void SetFileFormatVersion( sal_uInt16 nFileFormatVersion );
+ sal_uInt16 GetLoadingVersion() const;
bool IsCurrentVersionLoading() const;
- static int IsWhich(USHORT nId) {
+ static int IsWhich(sal_uInt16 nId) {
return nId && nId <= SFX_WHICH_MAX; }
- static int IsSlot(USHORT nId) {
+ static int IsSlot(sal_uInt16 nId) {
return nId && nId > SFX_WHICH_MAX; }
static const SfxItemPool* GetStoringPool();
@@ -284,19 +284,19 @@ private:
// --------------- Inline Implementierungen ------------------------------
// nur der Pool darf den Referenz-Zaehler manipulieren !!!
-inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, ULONG n )
+inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, sal_uLong n )
{
rItem.SetRefCount(n);
}
// nur der Pool darf den Referenz-Zaehler manipulieren !!!
-inline ULONG SfxItemPool::AddRef( const SfxPoolItem& rItem, ULONG n )
+inline sal_uLong SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uLong n )
{
return rItem.AddRef(n);
}
// nur der Pool darf den Referenz-Zaehler manipulieren !!!
-inline ULONG SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, ULONG n )
+inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n )
{
return rItem.ReleaseRef(n);
}
diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx
index 46dce586bb94..aeaa9e26c2d9 100644
--- a/svl/inc/svl/itemprop.hxx
+++ b/svl/inc/svl/itemprop.hxx
@@ -44,20 +44,20 @@
struct SfxItemPropertyMapEntry
{
const char* pName;
- USHORT nNameLen;
- USHORT nWID;
+ sal_uInt16 nNameLen;
+ sal_uInt16 nWID;
const com::sun::star::uno::Type* pType;
long nFlags;
- BYTE nMemberId;
+ sal_uInt8 nMemberId;
};
struct SfxItemPropertySimpleEntry
{
- USHORT nWID;
+ sal_uInt16 nWID;
const com::sun::star::uno::Type* pType;
long nFlags;
- BYTE nMemberId;
+ sal_uInt8 nMemberId;
SfxItemPropertySimpleEntry() :
nWID( 0 ),
@@ -65,8 +65,8 @@ struct SfxItemPropertySimpleEntry
nFlags( 0 ),
nMemberId( 0 ){}
- SfxItemPropertySimpleEntry(USHORT _nWID, const com::sun::star::uno::Type* _pType,
- long _nFlags, BYTE _nMemberId) :
+ SfxItemPropertySimpleEntry(sal_uInt16 _nWID, const com::sun::star::uno::Type* _pType,
+ long _nFlags, sal_uInt8 _nMemberId) :
nWID( _nWID ),
pType( _pType ),
nFlags( _nFlags ),
@@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPropertySet
SfxItemPropertyMap m_aMap;
mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
protected:
- virtual BOOL FillItem(SfxItemSet& rSet, USHORT nWhich, BOOL bGetProperty) const;
+ virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const;
public:
SfxItemPropertySet( const SfxItemPropertyMapEntry *pMap ) :
diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx
index 8a4f3248a06c..b3dea2cfa08b 100644
--- a/svl/inc/svl/itemset.hxx
+++ b/svl/inc/svl/itemset.hxx
@@ -47,8 +47,8 @@ typedef SfxPoolItem const** SfxItemArray;
#ifndef DBG
#ifdef DBG_UTILx
#define DBG(s) s
-#define _pChildCount(THIS) ( *(USHORT**)SfxPointerServer::GetServer()->GetPointer(THIS) )
-#define _pChildCountCtor ( (*(USHORT**)SfxPointerServer::GetServer()->CreatePointer(this)) = new USHORT )
+#define _pChildCount(THIS) ( *(sal_uInt16**)SfxPointerServer::GetServer()->GetPointer(THIS) )
+#define _pChildCountCtor ( (*(sal_uInt16**)SfxPointerServer::GetServer()->CreatePointer(this)) = new sal_uInt16 )
#define _pChildCountDtor ( SfxPointerServer::GetServer()->ReleasePointer(this) )
#else
#define DBG(s)
@@ -76,8 +76,8 @@ class SVL_DLLPUBLIC SfxItemSet
SfxItemPool* _pPool; // der verwendete Pool
const SfxItemSet* _pParent; // Ableitung
SfxItemArray _aItems; // Item-Feld
- USHORT* _pWhichRanges; // Array von Which-Bereichen
- USHORT _nCount; // Anzahl Items
+ sal_uInt16* _pWhichRanges; // Array von Which-Bereichen
+ sal_uInt16 _nCount; // Anzahl Items
//---------------------------------------------------------------------
#ifndef _SFXITEMS_HXX
@@ -87,9 +87,9 @@ friend class SfxAllItemSet;
friend const char *DbgCheckItemSet( const void* );
private:
- SVL_DLLPRIVATE void InitRanges_Impl(const USHORT *nWhichPairTable);
- SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, USHORT n1, USHORT n2, USHORT n3);
- SVL_DLLPRIVATE void InitRanges_Impl(USHORT nWh1, USHORT nWh2);
+ SVL_DLLPRIVATE void InitRanges_Impl(const sal_uInt16 *nWhichPairTable);
+ SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3);
+ SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
public:
SfxItemArray GetItems_Impl() const { return _aItems; }
@@ -110,59 +110,59 @@ protected:
public:
SfxItemSet( const SfxItemSet& );
- SfxItemSet( SfxItemPool&, BOOL bTotalPoolRanges = FALSE );
- SfxItemSet( SfxItemPool&, USHORT nWhich1, USHORT nWhich2 );
+ SfxItemSet( SfxItemPool&, sal_Bool bTotalPoolRanges = sal_False );
+ SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... );
- SfxItemSet( SfxItemPool&, const USHORT* nWhichPairTable );
+ SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
virtual ~SfxItemSet();
- virtual SfxItemSet * Clone(BOOL bItems = TRUE, SfxItemPool *pToPool = 0) const;
+ virtual SfxItemSet * Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const;
// Items erfragen
- USHORT Count() const { return _nCount; }
- USHORT TotalCount() const;
+ sal_uInt16 Count() const { return _nCount; }
+ sal_uInt16 TotalCount() const;
- virtual const SfxPoolItem& Get( USHORT nWhich, BOOL bSrchInParent = TRUE ) const;
- const SfxPoolItem* GetItem( USHORT nWhich, BOOL bSrchInParent = TRUE,
+ virtual const SfxPoolItem& Get( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True ) const;
+ const SfxPoolItem* GetItem( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True,
TypeId aItemType = 0 ) const;
// Which-Wert des Items an der Position nPos erfragen
- USHORT GetWhichByPos(USHORT nPos) const;
+ sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const;
// Item-Status erfragen
- SfxItemState GetItemState( USHORT nWhich,
- BOOL bSrchInParent = TRUE,
+ SfxItemState GetItemState( sal_uInt16 nWhich,
+ sal_Bool bSrchInParent = sal_True,
const SfxPoolItem **ppItem = 0 ) const;
- virtual void DisableItem(USHORT nWhich);
- virtual void InvalidateItem( USHORT nWhich );
- virtual USHORT ClearItem( USHORT nWhich = 0);
- virtual void ClearInvalidItems( BOOL bHardDefault = FALSE );
+ virtual void DisableItem(sal_uInt16 nWhich);
+ virtual void InvalidateItem( sal_uInt16 nWhich );
+ virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0);
+ virtual void ClearInvalidItems( sal_Bool bHardDefault = sal_False );
void InvalidateAllItems(); HACK(via nWhich = 0)
inline void SetParent( const SfxItemSet* pNew );
// Items hinzufuegen, loeschen etc.
- virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich );
+ virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
const SfxPoolItem* Put( const SfxPoolItem& rItem )
{ return Put(rItem, rItem.Which()); }
virtual int Put( const SfxItemSet&,
- BOOL bInvalidAsDefault = TRUE );
+ sal_Bool bInvalidAsDefault = sal_True );
void PutExtended( const SfxItemSet&,
SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN,
SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN );
- virtual int Set( const SfxItemSet&, BOOL bDeep = TRUE );
+ virtual int Set( const SfxItemSet&, sal_Bool bDeep = sal_True );
virtual void Intersect( const SfxItemSet& rSet );
- virtual void MergeValues( const SfxItemSet& rSet, BOOL bOverwriteDefaults = FALSE );
+ virtual void MergeValues( const SfxItemSet& rSet, sal_Bool bOverwriteDefaults = sal_False );
virtual void Differentiate( const SfxItemSet& rSet );
- virtual void MergeValue( const SfxPoolItem& rItem, BOOL bOverwriteDefaults = FALSE );
+ virtual void MergeValue( const SfxPoolItem& rItem, sal_Bool bOverwriteDefaults = sal_False );
SfxItemPool* GetPool() const { return _pPool; }
- const USHORT* GetRanges() const { return _pWhichRanges; }
- void SetRanges( const USHORT *pRanges );
- void MergeRange( USHORT nFrom, USHORT nTo );
+ const sal_uInt16* GetRanges() const { return _pWhichRanges; }
+ void SetRanges( const sal_uInt16 *pRanges );
+ void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo );
const SfxItemSet* GetParent() const { return _pParent; }
virtual SvStream & Load( SvStream &, bool bDirect = false,
@@ -191,19 +191,19 @@ class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet
{
SfxVoidItem aDefault;
- USHORT nFree;
+ sal_uInt16 nFree;
public:
SfxAllItemSet( SfxItemPool &rPool );
SfxAllItemSet( const SfxItemSet & );
SfxAllItemSet( const SfxAllItemSet & );
- virtual SfxItemSet * Clone( BOOL bItems = TRUE, SfxItemPool *pToPool = 0 ) const;
- virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich );
+ virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const;
+ virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
const SfxPoolItem* Put( const SfxPoolItem& rItem )
{ return Put(rItem, rItem.Which()); }
virtual int Put( const SfxItemSet&,
- BOOL bInvalidAsDefault = TRUE );
+ sal_Bool bInvalidAsDefault = sal_True );
};
#endif // #ifndef _SFXITEMSET_HXX
diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx
index 015b72264da2..3b41c834010f 100644
--- a/svl/inc/svl/lckbitem.hxx
+++ b/svl/inc/svl/lckbitem.hxx
@@ -43,23 +43,23 @@ class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem
public:
TYPEINFO();
SfxLockBytesItem();
- SfxLockBytesItem( USHORT nWhich,
+ SfxLockBytesItem( sal_uInt16 nWhich,
SvLockBytes *pLockBytes );
- SfxLockBytesItem( USHORT nWhich, SvStream & );
+ SfxLockBytesItem( sal_uInt16 nWhich, SvStream & );
SfxLockBytesItem( const SfxLockBytesItem& );
~SfxLockBytesItem();
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
SvLockBytes* GetValue() const { return _xVal; }
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
};
#endif
diff --git a/svl/inc/listener.hxx b/svl/inc/svl/listener.hxx
index bb35150c8afd..87bf85426747 100644
--- a/svl/inc/listener.hxx
+++ b/svl/inc/svl/listener.hxx
@@ -51,12 +51,12 @@ public:
SvtListener( const SvtListener &rCopy );
virtual ~SvtListener();
- BOOL StartListening( SvtBroadcaster& rBroadcaster );
- BOOL EndListening( SvtBroadcaster& rBroadcaster );
+ sal_Bool StartListening( SvtBroadcaster& rBroadcaster );
+ sal_Bool EndListening( SvtBroadcaster& rBroadcaster );
void EndListeningAll();
- BOOL IsListening( SvtBroadcaster& rBroadcaster ) const;
+ sal_Bool IsListening( SvtBroadcaster& rBroadcaster ) const;
- BOOL HasBroadcaster() const { return 0 != pBrdCastLst; }
+ sal_Bool HasBroadcaster() const { return 0 != pBrdCastLst; }
virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
};
diff --git a/svl/inc/listeneriter.hxx b/svl/inc/svl/listeneriter.hxx
index 0dcdec811250..0dcdec811250 100644
--- a/svl/inc/listeneriter.hxx
+++ b/svl/inc/svl/listeneriter.hxx
diff --git a/svl/inc/lngmisc.hxx b/svl/inc/svl/lngmisc.hxx
index b4da28604721..9e6c5c242451 100644
--- a/svl/inc/lngmisc.hxx
+++ b/svl/inc/svl/lngmisc.hxx
@@ -33,6 +33,7 @@
#include <tools/solar.h>
#include <sal/types.h>
#include <rtl/ustring.hxx>
+#include <tools/string.hxx>
///////////////////////////////////////////////////////////////////////////
@@ -45,29 +46,31 @@
namespace linguistic
{
-inline BOOL IsHyphen( sal_Unicode cChar )
+inline sal_Bool IsHyphen( sal_Unicode cChar )
{
return cChar == SVT_SOFT_HYPHEN || cChar == SVT_HARD_HYPHEN;
}
-inline BOOL IsControlChar( sal_Unicode cChar )
+inline sal_Bool IsControlChar( sal_Unicode cChar )
{
return cChar < (sal_Unicode) ' ';
}
-inline BOOL HasHyphens( const rtl::OUString &rTxt )
+inline sal_Bool HasHyphens( const rtl::OUString &rTxt )
{
return rTxt.indexOf( SVT_SOFT_HYPHEN ) != -1 ||
rTxt.indexOf( SVT_HARD_HYPHEN ) != -1;
}
-SVL_DLLPUBLIC INT32 GetNumControlChars( const rtl::OUString &rTxt );
-SVL_DLLPUBLIC BOOL RemoveHyphens( rtl::OUString &rTxt );
-SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt );
+SVL_DLLPUBLIC sal_Int32 GetNumControlChars( const rtl::OUString &rTxt );
+SVL_DLLPUBLIC sal_Bool RemoveHyphens( rtl::OUString &rTxt );
+SVL_DLLPUBLIC sal_Bool RemoveControlChars( rtl::OUString &rTxt );
-SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' );
+SVL_DLLPUBLIC sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' );
+
+SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText );
} // namespace linguistic
diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx
index a129cf588b91..c87d88ac890c 100644
--- a/svl/inc/svl/lstner.hxx
+++ b/svl/inc/svl/lstner.hxx
@@ -58,15 +58,15 @@ public:
SfxListener( const SfxListener &rCopy );
virtual ~SfxListener();
- BOOL StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups = FALSE );
- BOOL EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups = FALSE );
- void EndListening( USHORT nNo );
+ sal_Bool StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups = sal_False );
+ sal_Bool EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups = sal_False );
+ void EndListening( sal_uInt16 nNo );
void EndListeningAll();
- BOOL IsListening( SfxBroadcaster& rBroadcaster ) const;
+ sal_Bool IsListening( SfxBroadcaster& rBroadcaster ) const;
- USHORT GetBroadcasterCount() const
+ sal_uInt16 GetBroadcasterCount() const
{ return aBCs.Count(); }
- SfxBroadcaster* GetBroadcasterJOE( USHORT nNo ) const
+ SfxBroadcaster* GetBroadcasterJOE( sal_uInt16 nNo ) const
{ return (SfxBroadcaster*) aBCs.GetObject(nNo); }
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx
index 35290e6558e4..2bc93a177539 100644
--- a/svl/inc/svl/macitem.hxx
+++ b/svl/inc/svl/macitem.hxx
@@ -92,7 +92,7 @@ public:
ScriptType GetScriptType() const { return eType; }
- BOOL HasMacro() const { return aMacName.Len() ? TRUE : FALSE; }
+ sal_Bool HasMacro() const { return aMacName.Len() ? sal_True : sal_False; }
#ifdef SOLAR_JAVA
// JavaScript-Function-Objekt holen
@@ -124,7 +124,7 @@ DECLARE_TABLE( _SvxMacroTableDtor, SvxMacro* )
class SVL_DLLPUBLIC SvxMacroTableDtor : public _SvxMacroTableDtor
{
public:
- inline SvxMacroTableDtor( const USHORT nInitSz = 0, const USHORT nReSz = 1 );
+ inline SvxMacroTableDtor( const sal_uInt16 nInitSz = 0, const sal_uInt16 nReSz = 1 );
inline SvxMacroTableDtor( const SvxMacroTableDtor &rCpy ) : _SvxMacroTableDtor() { *this = rCpy; }
inline ~SvxMacroTableDtor() { DelDtor(); }
SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy );
@@ -132,14 +132,14 @@ public:
// loescht alle Eintraege
void DelDtor();
- SvStream& Read( SvStream &, USHORT nVersion = SVX_MACROTBL_AKTVERSION );
+ SvStream& Read( SvStream &, sal_uInt16 nVersion = SVX_MACROTBL_AKTVERSION );
SvStream& Write( SvStream & ) const;
- USHORT GetVersion() const { return SVX_MACROTBL_AKTVERSION; }
+ sal_uInt16 GetVersion() const { return SVX_MACROTBL_AKTVERSION; }
};
-inline SvxMacroTableDtor::SvxMacroTableDtor( const USHORT nInitSz,
- const USHORT nReSz)
+inline SvxMacroTableDtor::SvxMacroTableDtor( const sal_uInt16 nInitSz,
+ const sal_uInt16 nReSz)
: _SvxMacroTableDtor( nInitSz, nReSz )
{}
@@ -153,7 +153,7 @@ class SVL_DLLPUBLIC SvxMacroItem: public SfxPoolItem
public:
TYPEINFO();
- inline SvxMacroItem ( const USHORT nId /*= ITEMID_MACRO*/ );
+ inline SvxMacroItem ( const sal_uInt16 nId /*= ITEMID_MACRO*/ );
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
@@ -163,17 +163,17 @@ public:
XubString &rText,
const IntlWrapper * = 0 ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
- virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
inline const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;}
inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; }
- inline const SvxMacro& GetMacro( USHORT nEvent ) const;
- inline BOOL HasMacro( USHORT nEvent ) const;
- void SetMacro( USHORT nEvent, const SvxMacro& );
- inline BOOL DelMacro( USHORT nEvent );
+ inline const SvxMacro& GetMacro( sal_uInt16 nEvent ) const;
+ inline sal_Bool HasMacro( sal_uInt16 nEvent ) const;
+ void SetMacro( sal_uInt16 nEvent, const SvxMacro& );
+ inline sal_Bool DelMacro( sal_uInt16 nEvent );
private:
SvxMacroTableDtor aMacroTable;
@@ -182,7 +182,7 @@ private:
SvxMacroItem &operator=( const SvxMacroItem & );
};
-inline SvxMacroItem::SvxMacroItem( const USHORT nId )
+inline SvxMacroItem::SvxMacroItem( const sal_uInt16 nId )
: SfxPoolItem( nId )
{}
inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy )
@@ -190,15 +190,15 @@ inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy )
aMacroTable( rCpy.GetMacroTable() )
{}
-inline BOOL SvxMacroItem::HasMacro( USHORT nEvent ) const
+inline sal_Bool SvxMacroItem::HasMacro( sal_uInt16 nEvent ) const
{
return aMacroTable.IsKeyValid( nEvent );
}
-inline const SvxMacro& SvxMacroItem::GetMacro( USHORT nEvent ) const
+inline const SvxMacro& SvxMacroItem::GetMacro( sal_uInt16 nEvent ) const
{
return *(aMacroTable.Get(nEvent));
}
-inline BOOL SvxMacroItem::DelMacro( USHORT nEvent )
+inline sal_Bool SvxMacroItem::DelMacro( sal_uInt16 nEvent )
{
SvxMacro *pMacro = aMacroTable.Remove( nEvent );
delete pMacro;
diff --git a/svl/inc/svl/mailenum.hxx b/svl/inc/svl/mailenum.hxx
index 1302499f6777..87f66299bd33 100644
--- a/svl/inc/svl/mailenum.hxx
+++ b/svl/inc/svl/mailenum.hxx
@@ -86,10 +86,10 @@ enum MailAction
// Textformat zum Versenden von Nachrichten ------------------------------
-#define TXTFORMAT_ASCII ((BYTE)0x01)
-#define TXTFORMAT_HTML ((BYTE)0x02)
-#define TXTFORMAT_RTF ((BYTE)0x04)
-#define TXTFORMAT_OFFICE ((BYTE)0x08)
+#define TXTFORMAT_ASCII ((sal_uInt8)0x01)
+#define TXTFORMAT_HTML ((sal_uInt8)0x02)
+#define TXTFORMAT_RTF ((sal_uInt8)0x04)
+#define TXTFORMAT_OFFICE ((sal_uInt8)0x08)
#endif
diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx
index e53008c12f35..92f46002d5ee 100644
--- a/svl/inc/svl/metitem.hxx
+++ b/svl/inc/svl/metitem.hxx
@@ -39,8 +39,8 @@ class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item
{
public:
TYPEINFO();
- SfxMetricItem( USHORT nWhich = 0, UINT32 nValue = 0 );
- SfxMetricItem( USHORT nWhich, SvStream & );
+ SfxMetricItem( sal_uInt16 nWhich = 0, sal_uInt32 nValue = 0 );
+ SfxMetricItem( sal_uInt16 nWhich, SvStream & );
SfxMetricItem( const SfxMetricItem& );
~SfxMetricItem() {
DBG_DTOR(SfxMetricItem, 0); }
diff --git a/svl/inc/nfsymbol.hxx b/svl/inc/svl/nfsymbol.hxx
index 57b2ddde339e..57b2ddde339e 100644
--- a/svl/inc/nfsymbol.hxx
+++ b/svl/inc/svl/nfsymbol.hxx
diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx
index f9548bc78cbb..2654a2125f99 100644
--- a/svl/inc/svl/nranges.hxx
+++ b/svl/inc/svl/nranges.hxx
@@ -36,12 +36,12 @@
#ifndef NUMTYPE
-#define NUMTYPE USHORT
+#define NUMTYPE sal_uInt16
#define SfxNumRanges SfxUShortRanges
#include <svl/nranges.hxx>
#undef NUMTYPE
-#define NUMTYPE ULONG
+#define NUMTYPE sal_uLong
#define SfxNumRanges SfxULongRanges
#include <svl/nranges.hxx>
@@ -67,8 +67,8 @@ public:
~SfxNumRanges()
{ delete [] _pRanges; }
- BOOL operator == ( const SfxNumRanges & ) const;
- BOOL operator != ( const SfxNumRanges & rRanges ) const
+ sal_Bool operator == ( const SfxNumRanges & ) const;
+ sal_Bool operator != ( const SfxNumRanges & rRanges ) const
{ return !( *this == rRanges ); }
SfxNumRanges& operator = ( const SfxNumRanges & );
@@ -78,10 +78,10 @@ public:
SfxNumRanges& operator /= ( const SfxNumRanges & );
NUMTYPE Count() const;
- BOOL IsEmpty() const
+ sal_Bool IsEmpty() const
{ return !_pRanges || 0 == *_pRanges; }
- BOOL Contains( NUMTYPE n ) const;
- BOOL Intersects( const SfxNumRanges & ) const;
+ sal_Bool Contains( NUMTYPE n ) const;
+ sal_Bool Intersects( const SfxNumRanges & ) const;
operator const NUMTYPE* () const
{ return _pRanges; }
diff --git a/svl/inc/numuno.hxx b/svl/inc/svl/numuno.hxx
index 85db8c5906b9..85db8c5906b9 100644
--- a/svl/inc/numuno.hxx
+++ b/svl/inc/svl/numuno.hxx
diff --git a/svl/inc/outstrm.hxx b/svl/inc/svl/outstrm.hxx
index d147d2741700..dba7c2847c5e 100644
--- a/svl/inc/outstrm.hxx
+++ b/svl/inc/svl/outstrm.hxx
@@ -43,15 +43,15 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream
com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >
m_xStream;
- SVL_DLLPRIVATE virtual ULONG GetData(void *, ULONG);
+ SVL_DLLPRIVATE virtual sal_uLong GetData(void *, sal_uLong);
- SVL_DLLPRIVATE virtual ULONG PutData(void const * pData, ULONG nSize);
+ SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize);
- SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG);
+ SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong);
SVL_DLLPRIVATE virtual void FlushData();
- SVL_DLLPRIVATE virtual void SetSize(ULONG);
+ SVL_DLLPRIVATE virtual void SetSize(sal_uLong);
public:
SvOutputStream(com::sun::star::uno::Reference<
@@ -60,7 +60,7 @@ public:
virtual ~SvOutputStream();
- virtual USHORT IsA() const;
+ virtual sal_uInt16 IsA() const;
};
#endif // SVTOOLS_OUTSTRM_HXX
diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx
index 051cf18bf9e4..9dc31764c53c 100644
--- a/svl/inc/svl/ownlist.hxx
+++ b/svl/inc/svl/ownlist.hxx
@@ -87,10 +87,10 @@ class SVL_DLLPUBLIC SvCommandList
{
PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand);
SvCommand & Append( const String & rCommand, const String & rArg );
- BOOL AppendCommands( const String & rCmd, USHORT * pEaten );
+ sal_Bool AppendCommands( const String & rCmd, sal_uInt16 * pEaten );
String GetCommands() const;
- BOOL FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
+ sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & );
diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/svl/pickerhelper.hxx
index bf877722f541..bf877722f541 100644
--- a/svl/inc/pickerhelper.hxx
+++ b/svl/inc/svl/pickerhelper.hxx
diff --git a/svl/inc/pickerhistory.hxx b/svl/inc/svl/pickerhistory.hxx
index 45f9ab15c33b..45f9ab15c33b 100644
--- a/svl/inc/pickerhistory.hxx
+++ b/svl/inc/svl/pickerhistory.hxx
diff --git a/svl/inc/pickerhistoryaccess.hxx b/svl/inc/svl/pickerhistoryaccess.hxx
index 392933a431a4..392933a431a4 100644
--- a/svl/inc/pickerhistoryaccess.hxx
+++ b/svl/inc/svl/pickerhistoryaccess.hxx
diff --git a/svl/inc/poolcach.hxx b/svl/inc/svl/poolcach.hxx
index 7552d697f5ad..c8b1b87ee3ef 100644
--- a/svl/inc/poolcach.hxx
+++ b/svl/inc/svl/poolcach.hxx
@@ -30,13 +30,24 @@
#include "svl/svldllapi.h"
#include <tools/solar.h>
+#include <vector>
+
+//------------------------------------------------------------------------
-class SfxItemModifyArr_Impl;
class SfxItemPool;
class SfxItemSet;
class SfxPoolItem;
class SfxSetItem;
+struct SfxItemModifyImpl
+{
+ const SfxSetItem *pOrigItem;
+ SfxSetItem *pPoolItem;
+};
+
+typedef std::vector<SfxItemModifyImpl> SfxItemModifyArr_Impl;
+
+
class SVL_DLLPUBLIC SfxItemPoolCache
{
SfxItemPool *pPool;
@@ -51,7 +62,7 @@ public:
const SfxItemSet *pPutSet );
~SfxItemPoolCache();
- const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, BOOL bNew = FALSE );
+ const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, sal_Bool bNew = sal_False );
};
diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx
index eb922a99fe25..0101720da14d 100644
--- a/svl/inc/svl/poolitem.hxx
+++ b/svl/inc/svl/poolitem.hxx
@@ -51,8 +51,9 @@ class IntlWrapper;
namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
-#define SFX_ITEMS_DIRECT 0xffff
-#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate
+static const sal_uInt32 SFX_ITEMS_DIRECT= 0xffffffff;
+static const sal_uInt32 SFX_ITEMS_NULL= 0xfffffff0; // instead StoreSurrogate
+static const sal_uInt32 SFX_ITEMS_DEFAULT= 0xfffffffe;
#define SFX_ITEMS_POOLDEFAULT 0xffff
#define SFX_ITEMS_STATICDEFAULT 0xfffe
@@ -143,7 +144,7 @@ enum SfxItemPresentation
// -----------------------------------------------------------------------
-typedef USHORT SfxItemState;
+typedef sal_uInt16 SfxItemState;
#define SFX_ITEM_UNKNOWN 0x0000
@@ -183,31 +184,31 @@ friend class SfxItemPoolCache;
friend class SfxItemSet;
friend class SfxVoidItem;
- ULONG nRefCount; // Referenzzaehler
- USHORT nWhich;
- USHORT nKind;
+ sal_uLong nRefCount; // Referenzzaehler
+ sal_uInt16 nWhich;
+ sal_uInt16 nKind;
private:
- inline void SetRefCount( ULONG n );
- inline void SetKind( USHORT n );
+ inline void SetRefCount( sal_uLong n );
+ inline void SetKind( sal_uInt16 n );
public:
- inline ULONG AddRef( ULONG n = 1 ) const;
+ inline sal_uLong AddRef( sal_uLong n = 1 ) const;
private:
- inline ULONG ReleaseRef( ULONG n = 1 ) const;
+ inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const;
SVL_DLLPRIVATE long Delete_Impl(void*);
protected:
- SfxPoolItem( USHORT nWhich = 0 );
+ SfxPoolItem( sal_uInt16 nWhich = 0 );
SfxPoolItem( const SfxPoolItem& );
public:
TYPEINFO();
virtual ~SfxPoolItem();
- void SetWhich( USHORT nId ) {
+ void SetWhich( sal_uInt16 nId ) {
DBG_CHKTHIS(SfxPoolItem, 0);
nWhich = nId; }
- USHORT Which() const {
+ sal_uInt16 Which() const {
DBG_CHKTHIS(SfxPoolItem, 0);
return nWhich; }
virtual int operator==( const SfxPoolItem& ) const = 0;
@@ -222,19 +223,19 @@ public:
XubString &rText,
const IntlWrapper * pIntlWrapper = 0 ) const;
- virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
virtual bool ScaleMetrics( long lMult, long lDiv );
virtual bool HasMetrics() const;
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
- virtual SfxPoolItem* Create( SvStream &, USHORT nItemVersion ) const;
- virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
- ULONG GetRefCount() const { return nRefCount; }
- inline USHORT GetKind() const { return nKind; }
+ sal_uLong GetRefCount() const { return nRefCount; }
+ inline sal_uInt16 GetKind() const { return nKind; }
/** Read in a Unicode string from a streamed byte string representation.
@@ -289,21 +290,21 @@ private:
// -----------------------------------------------------------------------
-inline void SfxPoolItem::SetRefCount( ULONG n )
+inline void SfxPoolItem::SetRefCount( sal_uLong n )
{
DBG_CHKTHIS( SfxPoolItem, 0 );
nRefCount = n;
nKind = 0;
}
-inline void SfxPoolItem::SetKind( USHORT n )
+inline void SfxPoolItem::SetKind( sal_uInt16 n )
{
DBG_CHKTHIS( SfxPoolItem, 0 );
nRefCount = SFX_ITEMS_SPECIAL;
nKind = n;
}
-inline ULONG SfxPoolItem::AddRef( ULONG n ) const
+inline sal_uLong SfxPoolItem::AddRef( sal_uLong n ) const
{
DBG_CHKTHIS( SfxPoolItem, 0 );
DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" );
@@ -311,7 +312,7 @@ inline ULONG SfxPoolItem::AddRef( ULONG n ) const
return ( ((SfxPoolItem *)this)->nRefCount += n );
}
-inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const
+inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const
{
DBG_CHKTHIS( SfxPoolItem, 0 );
DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" );
@@ -354,8 +355,8 @@ class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem
SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented.
public:
TYPEINFO();
- SfxVoidItem( USHORT nWhich );
- SfxVoidItem( USHORT nWhich, SvStream & );
+ SfxVoidItem( sal_uInt16 nWhich );
+ SfxVoidItem( sal_uInt16 nWhich, SvStream & );
SfxVoidItem( const SfxVoidItem& );
~SfxVoidItem();
@@ -369,7 +370,7 @@ public:
// von sich selbst eine Kopie erzeugen
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- void SetWhich(USHORT nWh) { nWhich = nWh; }
+ void SetWhich(sal_uInt16 nWh) { nWhich = nWh; }
};
// -----------------------------------------------------------------------
@@ -382,8 +383,8 @@ class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem
public:
TYPEINFO();
- SfxSetItem( USHORT nWhich, SfxItemSet *pSet );
- SfxSetItem( USHORT nWhich, const SfxItemSet &rSet );
+ SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet );
+ SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet );
SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 );
~SfxSetItem();
@@ -397,8 +398,8 @@ public:
// von sich selbst eine Kopie erzeugen
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
- virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const = 0;
- virtual SvStream& Store(SvStream &, USHORT nVer) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const = 0;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nVer) const;
const SfxItemSet& GetItemSet() const
{ return *pSet; }
@@ -411,7 +412,7 @@ public:
class SVL_DLLPUBLIC SfxItemHandle
{
- USHORT *pRef;
+ sal_uInt16 *pRef;
SfxPoolItem *pItem;
public:
SfxItemHandle( SfxPoolItem& );
diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx
index ce613d582909..46963d8b7ade 100644
--- a/svl/inc/svl/ptitem.hxx
+++ b/svl/inc/svl/ptitem.hxx
@@ -45,8 +45,8 @@ class SVL_DLLPUBLIC SfxPointItem: public SfxPoolItem
public:
TYPEINFO();
SfxPointItem();
- SfxPointItem( USHORT nWhich, const Point& rVal );
- SfxPointItem( USHORT nWhich, SvStream & );
+ SfxPointItem( sal_uInt16 nWhich, const Point& rVal );
+ SfxPointItem( sal_uInt16 nWhich, SvStream & );
SfxPointItem( const SfxPointItem& );
~SfxPointItem() {
DBG_DTOR(SfxPointItem, 0); }
@@ -60,8 +60,8 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
const Point& GetValue() const { return aVal; }
void SetValue( const Point& rNewVal ) {
@@ -70,9 +70,9 @@ public:
}
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
};
#endif
diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx
index 6e4f1132ebf6..31f5717ee1f1 100644
--- a/svl/inc/svl/rectitem.hxx
+++ b/svl/inc/svl/rectitem.hxx
@@ -46,8 +46,8 @@ class SVL_DLLPUBLIC SfxRectangleItem: public SfxPoolItem
public:
TYPEINFO();
SfxRectangleItem();
- SfxRectangleItem( USHORT nWhich, const Rectangle& rVal );
- SfxRectangleItem( USHORT nWhich, SvStream & );
+ SfxRectangleItem( sal_uInt16 nWhich, const Rectangle& rVal );
+ SfxRectangleItem( sal_uInt16 nWhich, SvStream & );
SfxRectangleItem( const SfxRectangleItem& );
~SfxRectangleItem() {
DBG_DTOR(SfxRectangleItem, 0); }
@@ -60,8 +60,8 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
const Rectangle& GetValue() const { return aVal; }
void SetValue( const Rectangle& rNewVal ) {
@@ -69,9 +69,9 @@ public:
aVal = rNewVal;
}
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
};
#endif
diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx
index 0962f3bc8370..0a90af8c16d5 100644
--- a/svl/inc/svl/rngitem.hxx
+++ b/svl/inc/svl/rngitem.hxx
@@ -30,7 +30,7 @@
#ifndef NUMTYPE
-#define NUMTYPE USHORT
+#define NUMTYPE sal_uInt16
#define SfxXRangeItem SfxRangeItem
#define SfxXRangesItem SfxUShortRangesItem
#include <svl/rngitem.hxx>
@@ -39,7 +39,7 @@
#undef SfxXRangesItem
#ifndef _SFXITEMS_HXX
-#define NUMTYPE ULONG
+#define NUMTYPE sal_uLong
#define SfxXRangeItem SfxULongRangeItem
#define SfxXRangesItem SfxULongRangesItem
#include <svl/rngitem.hxx>
@@ -66,8 +66,8 @@ private:
public:
TYPEINFO();
SfxXRangeItem();
- SfxXRangeItem( USHORT nWID, NUMTYPE nFrom, NUMTYPE nTo );
- SfxXRangeItem( USHORT nWID, SvStream &rStream );
+ SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo );
+ SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream );
SfxXRangeItem( const SfxXRangeItem& rItem );
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
@@ -80,9 +80,9 @@ public:
inline NUMTYPE From() const { return nFrom; }
inline NUMTYPE& To() { return nTo; }
inline NUMTYPE To() const { return nTo; }
- inline BOOL HasRange() const { return nTo>nFrom; }
- virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
- virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+ inline sal_Bool HasRange() const { return nTo>nFrom; }
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
};
// -----------------------------------------------------------------------
@@ -95,8 +95,8 @@ private:
public:
TYPEINFO();
SfxXRangesItem();
- SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges );
- SfxXRangesItem( USHORT nWID, SvStream &rStream );
+ SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges );
+ SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream );
SfxXRangesItem( const SfxXRangesItem& rItem );
virtual ~SfxXRangesItem();
virtual int operator==( const SfxPoolItem& ) const;
@@ -107,8 +107,8 @@ public:
const IntlWrapper * = 0 ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
inline const NUMTYPE* GetRanges() const { return _pRanges; }
- virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
- virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
};
#endif
diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx
index 01be43ffb76f..ac1e30061c05 100644
--- a/svl/inc/svl/sfontitm.hxx
+++ b/svl/inc/svl/sfontitm.hxx
@@ -63,12 +63,12 @@ class SfxFontItem: public SfxPoolItem
public:
TYPEINFO();
- inline SfxFontItem(USHORT nWhich);
+ inline SfxFontItem(sal_uInt16 nWhich);
virtual int operator ==(const SfxPoolItem & rItem) const;
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
{ return new SfxFontItem(*this); }
@@ -116,7 +116,7 @@ public:
inline void setLanguage(LanguageType nTheLanguage);
};
-inline SfxFontItem::SfxFontItem(USHORT which):
+inline SfxFontItem::SfxFontItem(sal_uInt16 which):
SfxPoolItem(which),
m_nCharSet(RTL_TEXTENCODING_DONTKNOW),
m_nLanguage(LANGUAGE_DONTKNOW),
diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx
index f946d29faf88..e72a5ffde911 100644
--- a/svl/inc/svl/slstitm.hxx
+++ b/svl/inc/svl/slstitm.hxx
@@ -45,8 +45,8 @@ public:
TYPEINFO();
SfxStringListItem();
- SfxStringListItem( USHORT nWhich, const List* pList=NULL );
- SfxStringListItem( USHORT nWhich, SvStream& rStream );
+ SfxStringListItem( sal_uInt16 nWhich, const List* pList=NULL );
+ SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream );
SfxStringListItem( const SfxStringListItem& rItem );
~SfxStringListItem();
@@ -73,14 +73,14 @@ public:
XubString &rText,
const IntlWrapper * = 0 ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
- virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
- void Sort( BOOL bAscending = TRUE, List* pParallelList = 0 );
+ virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
+ virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
+ void Sort( sal_Bool bAscending = sal_True, List* pParallelList = 0 );
virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
};
#endif
diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx
index 0d3cc374a02e..1ce98191a059 100644
--- a/svl/inc/svl/smplhint.hxx
+++ b/svl/inc/svl/smplhint.hxx
@@ -69,11 +69,11 @@
class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint
{
private:
- ULONG nId;
+ sal_uLong nId;
public:
TYPEINFO();
- SfxSimpleHint( ULONG nId );
- ULONG GetId() const { return nId; }
+ SfxSimpleHint( sal_uLong nId );
+ sal_uLong GetId() const { return nId; }
};
//--------------------------------------------------------------------
@@ -85,14 +85,14 @@ public:
\
public: \
TYPEINFO(); \
- Name( USHORT nId, const Type& rObject ); \
+ Name( sal_uInt16 nId, const Type& rObject ); \
~Name(); \
const Type& GetObject() const { return aObj; } \
}
#define IMPL_OBJHINT(Name, Type) \
TYPEINIT1(Name, SfxSimpleHint); \
- Name::Name( USHORT nID, const Type& rObject ): \
+ Name::Name( sal_uInt16 nID, const Type& rObject ): \
SfxSimpleHint( nID ), aObj(rObject) \
{ } \
Name::~Name() {}
diff --git a/svl/inc/svl/srchitem.hxx b/svl/inc/svl/srchitem.hxx
index 01e7250c9f6d..7a0be711147b 100644
--- a/svl/inc/svl/srchitem.hxx
+++ b/svl/inc/svl/srchitem.hxx
@@ -91,8 +91,8 @@ public:
SvxSearchItem( const SvxSearchItem& rItem );
virtual ~SvxSearchItem();
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+ virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
virtual int operator == ( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
@@ -239,7 +239,7 @@ sal_Bool SvxSearchItem::IsLEVRelaxed() const
sal_uInt16 SvxSearchItem::GetLEVOther() const
{
- return (INT16) aSearchOpt.changedChars;
+ return (sal_Int16) aSearchOpt.changedChars;
}
void SvxSearchItem::SetLEVOther( sal_uInt16 nVal )
@@ -249,7 +249,7 @@ void SvxSearchItem::SetLEVOther( sal_uInt16 nVal )
sal_uInt16 SvxSearchItem::GetLEVShorter() const
{
- return (INT16) aSearchOpt.insertedChars;
+ return (sal_Int16) aSearchOpt.insertedChars;
}
void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal )
@@ -259,7 +259,7 @@ void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal )
sal_uInt16 SvxSearchItem::GetLEVLonger() const
{
- return (INT16) aSearchOpt.deletedChars;
+ return (sal_Int16) aSearchOpt.deletedChars;
}
void SvxSearchItem::SetLEVLonger( sal_uInt16 nVal )
diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx
index fd20b9719a9e..ddcb4dfa8b63 100644
--- a/svl/inc/svl/stritem.hxx
+++ b/svl/inc/svl/stritem.hxx
@@ -40,14 +40,14 @@ public:
SfxStringItem() {}
- SfxStringItem(USHORT which, const XubString & rValue):
+ SfxStringItem(sal_uInt16 which, const XubString & rValue):
CntUnencodedStringItem(which, rValue) {}
- SfxStringItem(USHORT nWhich, SvStream & rStream);
+ SfxStringItem(sal_uInt16 nWhich, SvStream & rStream);
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
};
diff --git a/svl/inc/strmadpt.hxx b/svl/inc/svl/strmadpt.hxx
index 8505bd0f786d..eceb68a3b1aa 100644
--- a/svl/inc/strmadpt.hxx
+++ b/svl/inc/svl/strmadpt.hxx
@@ -52,23 +52,23 @@ public:
rTheOutputStream):
m_xOutputStream(rTheOutputStream), m_nPosition(0) {}
- virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const;
+ virtual ErrCode ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *) const;
- virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount,
- ULONG * pWritten);
+ virtual ErrCode WriteAt(sal_uLong nPos, const void * pBuffer, sal_uLong nCount,
+ sal_uLong * pWritten);
virtual ErrCode Flush() const;
- virtual ErrCode SetSize(ULONG);
+ virtual ErrCode SetSize(sal_uLong);
virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
- virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount,
- ULONG * pWritten);
+ virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount,
+ sal_uLong * pWritten);
- virtual ULONG Tell() const;
+ virtual sal_uLong Tell() const;
- virtual ULONG Seek(ULONG);
+ virtual sal_uLong Seek(sal_uLong);
virtual void Terminate();
};
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index 7950915fb38d..615d5d690aba 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -75,7 +75,7 @@ SfxSimpleHint(SFX_HINT_DYING) from:
SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from:
SfxStyleSheetBasePool::Make( const String& rName,
- SfxStyleFamily eFam, USHORT mask, USHORT nPos)
+ SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos)
SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from:
SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet )
@@ -99,17 +99,17 @@ protected:
rtl::OUString maDisplayName;
String aHelpFile; // Name der Hilfedatei
SfxItemSet* pSet; // ItemSet
- USHORT nMask; // Flags
+ sal_uInt16 nMask; // Flags
- ULONG nHelpId; // Hilfe-ID
+ sal_uLong nHelpId; // Hilfe-ID
- BOOL bMySet; // TRUE: Set loeschen im dtor
+ sal_Bool bMySet; // sal_True: Set loeschen im dtor
SfxStyleSheetBase(); // do not use!
- SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, USHORT mask );
+ SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, sal_uInt16 mask );
SfxStyleSheetBase( const SfxStyleSheetBase& );
virtual ~SfxStyleSheetBase();
- virtual void Load( SvStream&, USHORT );
+ virtual void Load( SvStream&, sal_uInt16 );
virtual void Store( SvStream& );
public:
@@ -119,7 +119,7 @@ public:
virtual const UniString& GetName() const;
// sets the internal name of this style
- virtual BOOL SetName( const UniString& );
+ virtual sal_Bool SetName( const UniString& );
/** returns the display name of this style, it is used at the user interface.
If the display name is empty, this method returns the internal name. */
@@ -129,13 +129,13 @@ public:
virtual void SetDisplayName( const rtl::OUString& );
virtual const UniString& GetParent() const;
- virtual BOOL SetParent( const UniString& );
+ virtual sal_Bool SetParent( const UniString& );
virtual const UniString& GetFollow() const;
- virtual BOOL SetFollow( const UniString& );
- virtual BOOL HasFollowSupport() const; // Default TRUE
- virtual BOOL HasParentSupport() const; // Default TRUE
- virtual BOOL HasClearParentSupport() const; // Default FALSE
- virtual BOOL IsUsed() const; // Default TRUE
+ virtual sal_Bool SetFollow( const UniString& );
+ virtual sal_Bool HasFollowSupport() const; // Default sal_True
+ virtual sal_Bool HasParentSupport() const; // Default sal_True
+ virtual sal_Bool HasClearParentSupport() const; // Default sal_False
+ virtual sal_Bool IsUsed() const; // Default sal_True
// Default aus dem Itemset; entweder dem uebergebenen
// oder aus dem per GetItemSet() zurueckgelieferten Set
virtual UniString GetDescription();
@@ -143,16 +143,16 @@ public:
SfxStyleSheetBasePool& GetPool() { return rPool; }
SfxStyleFamily GetFamily() const { return nFamily; }
- USHORT GetMask() const { return nMask; }
- void SetMask( USHORT mask) { nMask = mask; }
- BOOL IsUserDefined() const
- { return BOOL( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); }
+ sal_uInt16 GetMask() const { return nMask; }
+ void SetMask( sal_uInt16 mask) { nMask = mask; }
+ sal_Bool IsUserDefined() const
+ { return sal_Bool( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); }
- virtual ULONG GetHelpId( String& rFile );
- virtual void SetHelpId( const String& r, ULONG nId );
+ virtual sal_uLong GetHelpId( String& rFile );
+ virtual void SetHelpId( const String& r, sal_uLong nId );
virtual SfxItemSet& GetItemSet();
- virtual USHORT GetVersion() const;
+ virtual sal_uInt16 GetVersion() const;
};
//=========================================================================
@@ -172,11 +172,11 @@ class SVL_DLLPUBLIC SfxStyleSheetIterator
{
public:
SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
- SfxStyleFamily eFam, USHORT n=0xFFFF );
- virtual USHORT GetSearchMask() const;
+ SfxStyleFamily eFam, sal_uInt16 n=0xFFFF );
+ virtual sal_uInt16 GetSearchMask() const;
virtual SfxStyleFamily GetSearchFamily() const;
- virtual USHORT Count();
- virtual SfxStyleSheetBase *operator[](USHORT nIdx);
+ virtual sal_uInt16 Count();
+ virtual SfxStyleSheetBase *operator[](sal_uInt16 nIdx);
virtual SfxStyleSheetBase* First();
virtual SfxStyleSheetBase* Next();
virtual SfxStyleSheetBase* Find(const UniString& rStr);
@@ -186,18 +186,18 @@ protected:
SfxStyleSheetBasePool* pBasePool;
SfxStyleFamily nSearchFamily;
- USHORT nMask;
- BOOL SearchUsed() const { return bSearchUsed; }
+ sal_uInt16 nMask;
+ sal_Bool SearchUsed() const { return bSearchUsed; }
private:
- USHORT GetPos(){return nAktPosition;}
- SVL_DLLPRIVATE BOOL IsTrivialSearch();
- SVL_DLLPRIVATE BOOL DoesStyleMatch(SfxStyleSheetBase *pStyle);
+ sal_uInt16 GetPos(){return nAktPosition;}
+ SVL_DLLPRIVATE sal_Bool IsTrivialSearch();
+ SVL_DLLPRIVATE sal_Bool DoesStyleMatch(SfxStyleSheetBase *pStyle);
void* pImp;
SfxStyleSheetBase* pAktStyle;
- USHORT nAktPosition;
- BOOL bSearchUsed;
+ sal_uInt16 nAktPosition;
+ sal_Bool bSearchUsed;
friend class SfxStyleSheetBasePool;
};
@@ -214,18 +214,18 @@ friend class SfxStyleSheetBase;
SfxStyleSheetBasePool_Impl *pImp;
private:
- SVL_DLLPRIVATE BOOL Load1_Impl( SvStream& );
+ SVL_DLLPRIVATE sal_Bool Load1_Impl( SvStream& );
SVL_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl();
protected:
String aAppName;
SfxItemPool& rPool;
SfxStyles aStyles;
SfxStyleFamily nSearchFamily;
- USHORT nMask;
+ sal_uInt16 nMask;
SfxStyleSheetBase& Add( SfxStyleSheetBase& );
- void ChangeParent( const UniString&, const UniString&, BOOL bVirtual = TRUE );
- virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, USHORT );
+ void ChangeParent( const UniString&, const UniString&, sal_Bool bVirtual = sal_True );
+ virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 );
virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& );
~SfxStyleSheetBasePool();
@@ -241,14 +241,14 @@ public:
SfxItemPool& GetPool();
const SfxItemPool& GetPool() const;
- virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, USHORT nMask);
- virtual USHORT Count();
- virtual SfxStyleSheetBase* operator[](USHORT nIdx);
+ virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
+ virtual sal_uInt16 Count();
+ virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx);
virtual SfxStyleSheetBase& Make(const UniString&,
SfxStyleFamily eFam,
- USHORT nMask = 0xffff ,
- USHORT nPos = 0xffff);
+ sal_uInt16 nMask = 0xffff ,
+ sal_uInt16 nPos = 0xffff);
virtual void Replace(
SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget );
@@ -264,21 +264,21 @@ public:
const SfxStyles& GetStyles();
virtual SfxStyleSheetBase* First();
virtual SfxStyleSheetBase* Next();
- virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, USHORT n=0xFFFF );
+ virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=0xFFFF );
- virtual BOOL SetParent(SfxStyleFamily eFam,
+ virtual sal_Bool SetParent(SfxStyleFamily eFam,
const UniString &rStyle,
const UniString &rParent);
SfxStyleSheetBase* Find(const UniString& rStr)
{ return Find(rStr, nSearchFamily, nMask); }
- void SetSearchMask(SfxStyleFamily eFam, USHORT n=0xFFFF );
- USHORT GetSearchMask() const;
+ void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=0xFFFF );
+ sal_uInt16 GetSearchMask() const;
SfxStyleFamily GetSearchFamily() const { return nSearchFamily; }
- BOOL Load( SvStream& );
- BOOL Store( SvStream&, BOOL bUsed = TRUE );
+ sal_Bool Load( SvStream& );
+ sal_Bool Store( SvStream&, sal_Bool bUsed = sal_True );
};
//=========================================================================
@@ -289,11 +289,11 @@ class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase,
public:
TYPEINFO();
- SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, USHORT );
+ SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 );
SfxStyleSheet( const SfxStyleSheet& );
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- virtual BOOL SetParent( const UniString& );
+ virtual sal_Bool SetParent( const UniString& );
protected:
SfxStyleSheet(); // do not use!
@@ -306,13 +306,13 @@ class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool
{
protected:
using SfxStyleSheetBasePool::Create;
- virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, USHORT mask);
+ virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, sal_uInt16 mask);
virtual SfxStyleSheetBase* Create(const SfxStyleSheet &);
public:
SfxStyleSheetPool( SfxItemPool const& );
-// virtual BOOL CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName);
+// virtual sal_Bool CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName);
};
//=========================================================================
@@ -332,13 +332,13 @@ public:
class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint
{
- USHORT nHint;
+ sal_uInt16 nHint;
public:
TYPEINFO();
- SfxStyleSheetPoolHint(USHORT nArgHint) : nHint(nArgHint){}
- USHORT GetHint() const
+ SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){}
+ sal_uInt16 GetHint() const
{ return nHint; }
};
@@ -347,16 +347,16 @@ public:
class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint
{
SfxStyleSheetBase* pStyleSh;
- USHORT nHint;
+ sal_uInt16 nHint;
public:
TYPEINFO();
- SfxStyleSheetHint( USHORT );
- SfxStyleSheetHint( USHORT, SfxStyleSheetBase& );
+ SfxStyleSheetHint( sal_uInt16 );
+ SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& );
SfxStyleSheetBase* GetStyleSheet() const
{ return pStyleSh; }
- USHORT GetHint() const
+ sal_uInt16 GetHint() const
{ return nHint; }
};
@@ -368,9 +368,9 @@ public:
TYPEINFO();
SfxStyleSheetHintExtended(
- USHORT, const String& rOld );
+ sal_uInt16, const String& rOld );
SfxStyleSheetHintExtended(
- USHORT, const String& rOld,
+ sal_uInt16, const String& rOld,
SfxStyleSheetBase& );
const String& GetOldName() { return aName; }
};
@@ -378,7 +378,7 @@ public:
class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >
{
public:
- SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske );
+ SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske );
SfxUnoStyleSheet( const SfxStyleSheet& _rSheet );
static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle );
diff --git a/svl/inc/stylepool.hxx b/svl/inc/svl/stylepool.hxx
index c6db7d42c707..c6db7d42c707 100644
--- a/svl/inc/stylepool.hxx
+++ b/svl/inc/svl/stylepool.hxx
diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx
index 239fbe2b96c8..7e5e8868f58a 100644
--- a/svl/inc/svl/svarray.hxx
+++ b/svl/inc/svl/svarray.hxx
@@ -39,12 +39,6 @@
* enthaelt. (Sie werden im Speicher verschoben, koennen also
* z.B. keine String sein)
*
-* SV_DECL_OBJARR(nm, AE, IS, GS)
-* SV_IMPL_OBJARR( nm, AE )
-* definiere/implementiere ein Array das Objecte enthaelt.
-* (Hier koennen es auch Strings sein)
-*
-*
* SV_DECL_PTRARR(nm, AE, IS, GS)
* SV_IMPL_PTRARR(nm, AE)
* definiere/implementiere ein Array das Pointer haelt. Diese
@@ -86,10 +80,6 @@
* Basiert auf einem VARARR.
* Sortierung mit Hilfe der Object-operatoren "<" und "=="
*
-* JP 23.12.94 neu:
-* SV_DECL_PTRARR_STACK(nm, AE, IS, GS)
-* ein Stack mit einem PtrArray als Grundlage.
-*
* JP 09.10.96: vordefinierte Arrays:
* VarArr: SvULongs, SvUShorts
* PtrArr: SvStrings, SvStringsDtor
@@ -127,15 +117,15 @@ inline void operator delete( void*, DummyType* ) {}
#if defined(PRODUCT)
#define _SVVARARR_DEF_GET_OP_INLINE( nm, ArrElem ) \
-ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\
+ArrElem& operator[](sal_uInt16 nP) const { return *(pData+nP); }\
\
-void Insert( const nm * pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX )\
+void Insert( const nm * pI, sal_uInt16 nP,\
+ sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX )\
{\
if( USHRT_MAX == nE ) \
nE = pI->nA; \
if( nS < nE ) \
- Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\
+ Insert( (const ArrElem*)pI->pData+nS, (sal_uInt16)nE-nS, nP );\
}
#define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )
@@ -143,71 +133,69 @@ void Insert( const nm * pI, USHORT nP,\
#else
#define _SVVARARR_DEF_GET_OP_INLINE( nm,ArrElem )\
-ArrElem& operator[](USHORT nP) const;\
-void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX );
+ArrElem& operator[](sal_uInt16 nP) const;\
+void Insert( const nm *pI, sal_uInt16 nP,\
+ sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX );
#define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\
-ArrElem& nm::operator[](USHORT nP) const\
+ArrElem& nm::operator[](sal_uInt16 nP) const\
{\
DBG_ASSERT( pData && nP < nA,"Op[]");\
return *(pData+nP);\
}\
-void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE)\
+void nm::Insert( const nm *pI, sal_uInt16 nP, sal_uInt16 nStt, sal_uInt16 nE)\
{\
DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\
if( USHRT_MAX == nE ) \
nE = pI->nA; \
if( nStt < nE ) \
- Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\
+ Insert( (const ArrElem*)pI->pData+nStt, (sal_uInt16)nE-nStt, nP );\
}
#endif
#define _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\
-typedef BOOL (*FnForEach_##nm)( const AERef, void* );\
+typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\
class vis nm\
{\
protected:\
AE *pData;\
- USHORT nFree;\
- USHORT nA;\
+ sal_uInt16 nFree;\
+ sal_uInt16 nA;\
\
void _resize(size_t n);\
\
public:\
- nm( USHORT= IS, BYTE= GS );\
+ nm( sal_uInt16= IS, sal_uInt8= GS );\
~nm() { rtl_freeMemory( pData ); }\
\
_SVVARARR_DEF_GET_OP_INLINE(nm, AE )\
- AERef GetObject(USHORT nP) const { return (*this)[nP]; } \
-\
- void Insert( const AERef aE, USHORT nP );\
- void Insert( const AE *pE, USHORT nL, USHORT nP );\
- void Remove( USHORT nP, USHORT nL = 1 );\
- void Replace( const AERef aE, USHORT nP );\
- void Replace( const AE *pE, USHORT nL, USHORT nP );\
- USHORT Count() const { return nA; }\
+ AERef GetObject(sal_uInt16 nP) const { return (*this)[nP]; } \
+\
+ void Insert( const AERef aE, sal_uInt16 nP );\
+ void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\
+ void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\
+ void Replace( const AERef aE, sal_uInt16 nP );\
+ void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\
+ sal_uInt16 Count() const { return nA; }\
const AE* GetData() const { return (const AE*)pData; }\
\
void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( 0, nA, fnForEach, pArgs );\
}\
- void ForEach( USHORT nS, USHORT nE, \
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( nS, nE, fnForEach, pArgs );\
}\
\
- void _ForEach( USHORT nStt, USHORT nE, \
+ void _ForEach( sal_uInt16 nStt, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\
\
#define _SV_DECL_VARARR(nm, AE, IS, GS ) \
_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE & )
-#define _SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \
-_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE )
#define SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\
_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\
@@ -218,17 +206,12 @@ nm& operator=( const nm& );\
#define SV_DECL_VARARR(nm, AE, IS, GS ) \
SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, )
-#define SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \
-SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, )
#define SV_DECL_VARARR_VISIBILITY(nm, AE, IS, GS, vis ) \
SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis )
-#define SV_DECL_VARARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis ) \
-SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, vis )
-
#define SV_IMPL_VARARR_GEN( nm, AE, AERef )\
-nm::nm( USHORT nInit, BYTE )\
+nm::nm( sal_uInt16 nInit, sal_uInt8 )\
: pData (0),\
nFree (nInit),\
nA (0)\
@@ -242,7 +225,7 @@ nm::nm( USHORT nInit, BYTE )\
\
void nm::_resize (size_t n)\
{\
- USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\
+ sal_uInt16 nL = ((n < USHRT_MAX) ? sal_uInt16(n) : USHRT_MAX);\
AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\
if ((pE != 0) || (nL == 0))\
{\
@@ -251,7 +234,7 @@ void nm::_resize (size_t n)\
}\
}\
\
-void nm::Insert( const AERef aE, USHORT nP )\
+void nm::Insert( const AERef aE, sal_uInt16 nP )\
{\
DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\
if (nFree < 1)\
@@ -262,7 +245,7 @@ void nm::Insert( const AERef aE, USHORT nP )\
++nA; --nFree;\
}\
\
-void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\
+void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\
{\
DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\
if (nFree < nL)\
@@ -274,13 +257,13 @@ void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\
nA = nA + nL; nFree = nFree - nL;\
}\
\
-void nm::Replace( const AERef aE, USHORT nP )\
+void nm::Replace( const AERef aE, sal_uInt16 nP )\
{\
if( nP < nA )\
*(pData+nP) = (AE&)aE;\
}\
\
-void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\
+void nm::Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP )\
{\
if( pE && nP < nA )\
{\
@@ -294,7 +277,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\
}\
else \
{\
- USHORT nTmpLen = nA + nFree - nP; \
+ sal_uInt16 nTmpLen = nA + nFree - nP; \
memcpy( pData + nP, pE, nTmpLen * sizeof( AE ));\
nA = nA + nFree; \
nFree = 0; \
@@ -303,7 +286,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\
}\
}\
\
-void nm::Remove( USHORT nP, USHORT nL )\
+void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\
{\
if( !nL )\
return;\
@@ -315,7 +298,7 @@ void nm::Remove( USHORT nP, USHORT nL )\
_resize (nA);\
}\
\
-void nm::_ForEach( USHORT nStt, USHORT nE, \
+void nm::_ForEach( sal_uInt16 nStt, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\
{\
if( nStt >= nE || nE > nA )\
@@ -328,227 +311,39 @@ _SVVARARR_IMPL_GET_OP_INLINE(nm, AE )\
#define SV_IMPL_VARARR( nm, AE ) \
SV_IMPL_VARARR_GEN( nm, AE, AE & )
-#define SV_IMPL_VARARR_PLAIN( nm, AE ) \
-SV_IMPL_VARARR_GEN( nm, AE, AE )
-
-#if defined(PRODUCT)
-
-#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem )\
-ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\
-\
-void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX )\
-{\
- if( USHRT_MAX == nE ) \
- nE = pI->nA; \
- if( nS < nE ) \
- Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\
-}
-
-#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )
-
-#else
-
-#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem ) \
-ArrElem& operator[](USHORT nP) const;\
-void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX );
-
-#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )\
-ArrElem& nm::operator[](USHORT nP) const\
-{\
- DBG_ASSERT( pData && nP < nA,"Op[]");\
- return *(pData+nP);\
-}\
-void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE )\
-{\
- DBG_ASSERT( nP <= nA,"Ins,Ar[Start.End]");\
- if( USHRT_MAX == nE ) \
- nE = pI->nA; \
- if( nStt < nE ) \
- Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\
-}
-
-#endif
-
-#define _SV_DECL_OBJARR(nm, AE, IS, GS)\
-typedef BOOL (*FnForEach_##nm)( const AE&, void* );\
-class nm\
-{\
-protected:\
- AE *pData;\
- USHORT nFree;\
- USHORT nA;\
-\
- void _resize(size_t n);\
- void _destroy();\
-\
-public:\
- nm( USHORT= IS, BYTE= GS );\
- ~nm() { _destroy(); }\
-\
- _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\
- AE& GetObject(USHORT nP) const { return (*this)[nP]; } \
-\
- void Insert( const AE &aE, USHORT nP );\
- void Insert( const AE *pE, USHORT nL, USHORT nP );\
- void Remove( USHORT nP, USHORT nL = 1 );\
- USHORT Count() const { return nA; }\
- const AE* GetData() const { return (const AE*)pData; }\
-\
- void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
- {\
- _ForEach( 0, nA, fnForEach, pArgs );\
- }\
- void ForEach( USHORT nS, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
- {\
- _ForEach( nS, nE, fnForEach, pArgs );\
- }\
-\
- void _ForEach( USHORT nStt, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\
-\
-
-#define SV_DECL_OBJARR(nm, AE, IS, GS)\
-_SV_DECL_OBJARR(nm, AE, IS, GS)\
-private:\
-nm( const nm& );\
-nm& operator=( const nm& );\
-};
-
-#define SV_IMPL_OBJARR( nm, AE )\
-nm::nm( USHORT nInit, BYTE )\
- : pData (0),\
- nFree (nInit),\
- nA (0)\
-{\
- if( nInit )\
- {\
- pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\
- DBG_ASSERT( pData, "CTOR, allocate");\
- }\
-}\
-\
-void nm::_destroy()\
-{\
- if(pData)\
- {\
- AE* pTmp=pData;\
- for(USHORT n=0; n < nA; n++,pTmp++ )\
- {\
- pTmp->~AE();\
- }\
- rtl_freeMemory(pData);\
- pData = 0;\
- }\
-}\
-\
-void nm::_resize (size_t n)\
-{\
- USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\
- AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\
- if ((pE != 0) || (nL == 0))\
- {\
- pData = pE;\
- nFree = nL - nA;\
- }\
-}\
-\
-void nm::Insert( const AE &aE, USHORT nP )\
-{\
- DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\
- if (nFree < 1)\
- _resize (nA + ((nA > 1) ? nA : 1));\
- if( pData && nP < nA )\
- memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\
- AE* pTmp = pData+nP;\
- new( (DummyType*) pTmp ) AE( (AE&)aE );\
- ++nA; --nFree;\
-}\
-\
-void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\
-{\
- DBG_ASSERT(nP<=nA && ((long)nA+nL) < USHRT_MAX, "Ins n");\
- if (nFree < nL)\
- _resize (nA + ((nA > nL) ? nA : nL));\
- if( pData && nP < nA )\
- memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\
- if( pE )\
- {\
- AE* pTmp = pData+nP;\
- for( USHORT n = 0; n < nL; n++, pTmp++, pE++)\
- {\
- new( (DummyType*) pTmp ) AE( (AE&)*pE );\
- }\
- }\
- nA = nA + nL; nFree = nFree - nL;\
-}\
-\
-void nm::Remove( USHORT nP, USHORT nL )\
-{\
- if( !nL )\
- return;\
- DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\
- AE* pTmp=pData+nP;\
- USHORT nCtr = nP;\
- for(USHORT n=0; n < nL; n++,pTmp++,nCtr++)\
- {\
- if( nCtr < nA )\
- pTmp->~AE();\
- }\
- if( pData && nP+1 < nA )\
- memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\
- nA = nA - nL; nFree = nFree + nL;\
- if (nFree > nA) \
- _resize (nA);\
-}\
-\
-void nm::_ForEach( USHORT nStt, USHORT nE, \
- CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\
-{\
- if( nStt >= nE || nE > nA )\
- return;\
- for( ; nStt < nE && (*fnCall)( *(pData+nStt), pArgs ); nStt++)\
- ;\
-}\
-\
-_SVOBJARR_IMPL_GET_OP_INLINE(nm, AE)\
#define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\
_SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\
-USHORT GetPos( const AERef aE ) const;\
+sal_uInt16 GetPos( const AERef aE ) const;\
};
#define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\
_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis )
-#define _SV_DECL_PTRARR_DEF_PLAIN( nm, AE, IS, GS, vis )\
-_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE, vis )
#define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\
-typedef BOOL (*FnForEach_##nm)( const AERef, void* );\
+typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\
class vis nm: public Base \
{\
public:\
- nm( USHORT nIni=IS, BYTE nG=GS )\
+ nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\
: Base(nIni,nG) {}\
- void Insert( const nm *pI, USHORT nP, \
- USHORT nS = 0, USHORT nE = USHRT_MAX ) {\
+ void Insert( const nm *pI, sal_uInt16 nP, \
+ sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\
Base::Insert((const Base*)pI, nP, nS, nE);\
}\
- void Insert( const AERef aE, USHORT nP ) {\
+ void Insert( const AERef aE, sal_uInt16 nP ) {\
Base::Insert( (const VPRef )aE, nP );\
}\
- void Insert( const AE *pE, USHORT nL, USHORT nP ) {\
+ void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\
Base::Insert( (const VoidPtr*)pE, nL, nP );\
}\
- void Replace( const AERef aE, USHORT nP ) {\
+ void Replace( const AERef aE, sal_uInt16 nP ) {\
Base::Replace( (const VPRef)aE, nP );\
}\
- void Replace( const AE *pE, USHORT nL, USHORT nP ) {\
+ void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\
Base::Replace( (const VoidPtr*)pE, nL, nP );\
}\
- void Remove( USHORT nP, USHORT nL = 1) {\
+ void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\
Base::Remove(nP,nL);\
}\
const AE* GetData() const {\
@@ -558,20 +353,20 @@ public:\
{\
_ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\
}\
- void ForEach( USHORT nS, USHORT nE, \
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\
}\
- AE operator[]( USHORT nP )const { \
+ AE operator[]( sal_uInt16 nP )const { \
return (AE)Base::operator[](nP); }\
- AE GetObject(USHORT nP) const { \
+ AE GetObject(sal_uInt16 nP) const { \
return (AE)Base::GetObject(nP); }\
\
- USHORT GetPos( const AERef aE ) const { \
+ sal_uInt16 GetPos( const AERef aE ) const { \
return Base::GetPos((const VPRef)aE);\
}\
- void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\
+ void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\
private:\
nm( const nm& );\
nm& operator=( const nm& );\
@@ -579,39 +374,35 @@ private:\
#define SV_DECL_PTRARR(nm, AE, IS, GS )\
SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, )
-#define SV_DECL_PTRARR_PLAIN(nm, AE, IS, GS )\
-SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, )
#define SV_DECL_PTRARR_VISIBILITY(nm, AE, IS, GS, vis )\
SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis )
-#define SV_DECL_PTRARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\
-SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis )
#define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\
-typedef BOOL (*FnForEach_##nm)( const AERef, void* );\
+typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\
class vis nm: public Base \
{\
public:\
- nm( USHORT nIni=IS, BYTE nG=GS )\
+ nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\
: Base(nIni,nG) {}\
~nm() { DeleteAndDestroy( 0, Count() ); }\
- void Insert( const nm *pI, USHORT nP, \
- USHORT nS = 0, USHORT nE = USHRT_MAX ) {\
+ void Insert( const nm *pI, sal_uInt16 nP, \
+ sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\
Base::Insert((const Base*)pI, nP, nS, nE);\
}\
- void Insert( const AERef aE, USHORT nP ) {\
+ void Insert( const AERef aE, sal_uInt16 nP ) {\
Base::Insert((const VPRef)aE, nP );\
}\
- void Insert( const AE *pE, USHORT nL, USHORT nP ) {\
+ void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\
Base::Insert( (const VoidPtr *)pE, nL, nP );\
}\
- void Replace( const AERef aE, USHORT nP ) {\
+ void Replace( const AERef aE, sal_uInt16 nP ) {\
Base::Replace( (const VPRef)aE, nP );\
}\
- void Replace( const AE *pE, USHORT nL, USHORT nP ) {\
+ void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\
Base::Replace( (const VoidPtr*)pE, nL, nP );\
}\
- void Remove( USHORT nP, USHORT nL = 1) {\
+ void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\
Base::Remove(nP,nL);\
}\
const AE* GetData() const {\
@@ -621,20 +412,20 @@ public:\
{\
_ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\
}\
- void ForEach( USHORT nS, USHORT nE, \
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\
}\
- AE operator[]( USHORT nP )const { \
+ AE operator[]( sal_uInt16 nP )const { \
return (AE)Base::operator[](nP); }\
- AE GetObject( USHORT nP )const { \
+ AE GetObject( sal_uInt16 nP )const { \
return (AE)Base::GetObject(nP); }\
\
- USHORT GetPos( const AERef aE ) const { \
+ sal_uInt16 GetPos( const AERef aE ) const { \
return Base::GetPos((const VPRef)aE);\
} \
- void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\
+ void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\
private:\
nm( const nm& );\
nm& operator=( const nm& );\
@@ -642,20 +433,16 @@ private:\
#define SV_DECL_PTRARR_DEL(nm, AE, IS, GS )\
SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, )
-#define SV_DECL_PTRARR_DEL_PLAIN(nm, AE, IS, GS )\
-SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, )
#define SV_DECL_PTRARR_DEL_VISIBILITY(nm, AE, IS, GS, vis )\
SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis)
-#define SV_DECL_PTRARR_DEL_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\
-SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis)
#define SV_IMPL_PTRARR_GEN(nm, AE, Base)\
-void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\
+void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\
{ \
if( nL ) {\
DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\
- for( USHORT n=nP; n < nP + nL; n++ ) \
+ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \
delete *((AE*)pData+n); \
Base::Remove( nP, nL ); \
} \
@@ -663,37 +450,34 @@ void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\
#define SV_IMPL_PTRARR(nm, AE )\
SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarr )
-#define SV_IMPL_PTRARR_PLAIN(nm, AE )\
-SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarrPlain )
typedef void* VoidPtr;
_SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC )
-_SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC )
// SORTARR - Begin
#define _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\
-typedef BOOL (*FnForEach_##nm)( const AE&, void* );\
+typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\
class vis nm : private nm##_SAR \
{\
public:\
- nm(USHORT nSize = IS, BYTE nG = GS)\
+ nm(sal_uInt16 nSize = IS, sal_uInt8 nG = GS)\
: nm##_SAR(nSize,nG) {}\
- void Insert( const nm *pI, USHORT nS=0, USHORT nE=USHRT_MAX );\
- BOOL Insert( const AE& aE );\
- BOOL Insert( const AE& aE, USHORT& rP );\
- void Insert( const AE *pE, USHORT nL );\
- void Remove( USHORT nP, USHORT nL = 1 );\
- void Remove( const AE& aE, USHORT nL = 1 );\
- USHORT Count() const { return nm##_SAR::Count(); }\
+ void Insert( const nm *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX );\
+ sal_Bool Insert( const AE& aE );\
+ sal_Bool Insert( const AE& aE, sal_uInt16& rP );\
+ void Insert( const AE *pE, sal_uInt16 nL );\
+ void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\
+ void Remove( const AE& aE, sal_uInt16 nL = 1 );\
+ sal_uInt16 Count() const { return nm##_SAR::Count(); }\
const AE* GetData() const { return (const AE*)pData; }\
\
/* Das Ende stehe im DECL-Makro !!! */
#define _SV_SEEK_PTR(nm,AE)\
-BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\
+sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\
{\
- register USHORT nO = nm##_SAR::Count(),\
+ register sal_uInt16 nO = nm##_SAR::Count(),\
nM, \
nU = 0;\
if( nO > 0 )\
@@ -706,27 +490,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\
if( (long)*(pData + nM) == rCmp )\
{\
if( pP ) *pP = nM;\
- return TRUE;\
+ return sal_True;\
}\
else if( (long)*(pData+ nM) < (long)aE )\
nU = nM + 1;\
else if( nM == 0 )\
{\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}\
else\
nO = nM - 1;\
}\
}\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}
#define _SV_SEEK_PTR_TO_OBJECT( nm,AE )\
-BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\
+sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\
{\
- register USHORT nO = nm##_SAR::Count(),\
+ register sal_uInt16 nO = nm##_SAR::Count(),\
nM, \
nU = 0;\
if( nO > 0 )\
@@ -738,27 +522,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\
if( *(*((AE*)pData + nM)) == *(aE) )\
{\
if( pP ) *pP = nM;\
- return TRUE;\
+ return sal_True;\
}\
else if( *(*((AE*)pData + nM)) < *(aE) )\
nU = nM + 1;\
else if( nM == 0 )\
{\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}\
else\
nO = nM - 1;\
}\
}\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}
#define _SV_SEEK_OBJECT( nm,AE )\
-BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\
+sal_Bool nm::Seek_Entry( const AE & aE, sal_uInt16* pP ) const\
{\
- register USHORT nO = nm##_SAR::Count(),\
+ register sal_uInt16 nO = nm##_SAR::Count(),\
nM, \
nU = 0;\
if( nO > 0 )\
@@ -770,29 +554,29 @@ BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\
if( *(pData + nM) == aE )\
{\
if( pP ) *pP = nM;\
- return TRUE;\
+ return sal_True;\
}\
else if( *(pData + nM) < aE )\
nU = nM + 1;\
else if( nM == 0 )\
{\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}\
else\
nO = nM - 1;\
}\
}\
if( pP ) *pP = nU;\
- return FALSE;\
+ return sal_False;\
}
#define _SV_IMPL_SORTAR_ALG(nm, AE)\
-void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\
+void nm::Insert( const nm * pI, sal_uInt16 nS, sal_uInt16 nE )\
{\
if( USHRT_MAX == nE )\
nE = pI->Count();\
- USHORT nP;\
+ sal_uInt16 nP;\
const AE * pIArr = pI->GetData();\
for( ; nS < nE; ++nS )\
{\
@@ -806,68 +590,68 @@ void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\
}\
}\
\
-BOOL nm::Insert( const AE & aE )\
+sal_Bool nm::Insert( const AE & aE )\
{\
- USHORT nP;\
- BOOL bExist;\
+ sal_uInt16 nP;\
+ sal_Bool bExist;\
bExist = Seek_Entry( aE, &nP );\
if( ! bExist )\
nm##_SAR::Insert( aE, nP );\
return !bExist;\
}\
-BOOL nm::Insert( const AE & aE, USHORT& rP )\
+sal_Bool nm::Insert( const AE & aE, sal_uInt16& rP )\
{\
- BOOL bExist;\
+ sal_Bool bExist;\
bExist = Seek_Entry( aE, &rP );\
if( ! bExist )\
nm##_SAR::Insert( aE, rP );\
return !bExist;\
}\
-void nm::Insert( const AE* pE, USHORT nL)\
+void nm::Insert( const AE* pE, sal_uInt16 nL)\
{\
- USHORT nP;\
- for( USHORT n = 0; n < nL; ++n )\
+ sal_uInt16 nP;\
+ for( sal_uInt16 n = 0; n < nL; ++n )\
if( ! Seek_Entry( *(pE+n), &nP ))\
nm##_SAR::Insert( *(pE+n), nP );\
}\
-void nm::Remove( USHORT nP, USHORT nL )\
+void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\
{\
if( nL )\
nm##_SAR::Remove( nP, nL);\
}\
\
-void nm::Remove( const AE &aE, USHORT nL )\
+void nm::Remove( const AE &aE, sal_uInt16 nL )\
{\
- USHORT nP;\
+ sal_uInt16 nP;\
if( nL && Seek_Entry( aE, &nP ) ) \
nm##_SAR::Remove( nP, nL);\
}\
#define _SORTARR_BLC_CASTS(nm, AE )\
- USHORT GetPos( const AE& aE ) const { \
+ sal_uInt16 GetPos( const AE& aE ) const { \
return SvPtrarr::GetPos((const VoidPtr&)aE);\
}
#define _SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\
SV_DECL_PTRARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\
_SORT_CLASS_DEF(nm, AE, IS, GS, vis)\
- AE operator[](USHORT nP) const {\
+ AE operator[](sal_uInt16 nP) const {\
return nm##_SAR::operator[]( nP );\
}\
- AE GetObject(USHORT nP) const {\
+ AE GetObject(sal_uInt16 nP) const {\
return nm##_SAR::GetObject( nP );\
}\
- BOOL Seek_Entry( const AE aE, USHORT* pP = 0 ) const;\
+ sal_Bool Seek_Entry( const AE aE, sal_uInt16* pP = 0 ) const;\
void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( 0, nA, (FnForEach_SvPtrarr)fnForEach, pArgs );\
}\
- void ForEach( USHORT nS, USHORT nE, \
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( nS, nE, (FnForEach_SvPtrarr)fnForEach, pArgs );\
}\
- void DeleteAndDestroy( USHORT nP, USHORT nL=1 ); \
+ void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 ); \
_SORTARR_BLC_CASTS(nm, AE )\
\
/* Das Ende stehe im DECL-Makro !!! */
@@ -903,18 +687,18 @@ _SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, vis)
#define _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis)\
SV_DECL_VARARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\
_SORT_CLASS_DEF(nm, AE, IS, GS, vis) \
- const AE& operator[](USHORT nP) const {\
+ const AE& operator[](sal_uInt16 nP) const {\
return nm##_SAR::operator[]( nP );\
}\
- const AE& GetObject(USHORT nP) const {\
+ const AE& GetObject(sal_uInt16 nP) const {\
return nm##_SAR::GetObject( nP );\
}\
- BOOL Seek_Entry( const AE & aE, USHORT* pP = 0 ) const;\
+ sal_Bool Seek_Entry( const AE & aE, sal_uInt16* pP = 0 ) const;\
void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( 0, nA, (FnForEach_##nm##_SAR)fnForEach, pArgs );\
}\
- void ForEach( USHORT nS, USHORT nE, \
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE, \
CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\
{\
_ForEach( nS, nE, (FnForEach_##nm##_SAR)fnForEach, pArgs );\
@@ -932,10 +716,10 @@ _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis)
#define SV_IMPL_PTRARR_SORT( nm,AE )\
_SV_IMPL_SORTAR_ALG( nm,AE )\
- void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \
+ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \
if( nL ) {\
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\
- for( USHORT n=nP; n < nP + nL; n++ ) \
+ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \
delete *((AE*)pData+n); \
SvPtrarr::Remove( nP, nL ); \
} \
@@ -944,10 +728,10 @@ _SV_SEEK_PTR( nm, AE )
#define SV_IMPL_OP_PTRARR_SORT( nm,AE )\
_SV_IMPL_SORTAR_ALG( nm,AE )\
- void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \
+ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \
if( nL ) {\
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\
- for( USHORT n=nP; n < nP + nL; n++ ) \
+ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \
delete *((AE*)pData+n); \
SvPtrarr::Remove( nP, nL ); \
} \
@@ -959,69 +743,21 @@ SV_IMPL_VARARR(nm##_SAR, AE)\
_SV_IMPL_SORTAR_ALG( nm,AE )\
_SV_SEEK_OBJECT( nm,AE )
-#define SV_DECL_PTRARR_STACK(nm, AE, IS, GS)\
-class nm: private SvPtrarr \
-{\
-public:\
- nm( USHORT nIni=IS, BYTE nG=GS )\
- : SvPtrarr(nIni,nG) {}\
- void Insert( const nm *pI, USHORT nP,\
- USHORT nS = 0, USHORT nE = USHRT_MAX ) {\
- SvPtrarr::Insert( pI, nP, nS, nE ); \
- }\
- void Remove( USHORT nP, USHORT nL = 1 ) {\
- SvPtrarr::Remove( nP, nL ); \
- }\
- void Push( const AE &aE ) {\
- SvPtrarr::Insert( (const VoidPtr &)aE, SvPtrarr::Count() );\
- }\
- USHORT Count() const { return SvPtrarr::Count(); }\
- AE operator[](USHORT nP) const {\
- return (AE)SvPtrarr::operator[]( nP );\
- }\
- AE GetObject(USHORT nP) const {\
- return (AE)SvPtrarr::GetObject( nP );\
- }\
- AE Pop(){\
- AE pRet = 0;\
- if( SvPtrarr::Count() ){\
- pRet = GetObject( SvPtrarr::Count()-1 );\
- SvPtrarr::Remove(Count()-1);\
- }\
- return pRet;\
- }\
- AE Top() const {\
- AE pRet = 0;\
- if( SvPtrarr::Count() )\
- pRet = GetObject( SvPtrarr::Count()-1 ); \
- return pRet;\
- }\
-};
-
#if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52)
#define C40_INSERT( c, p, n) Insert( (c const *) p, n )
-#define C40_PUSH( c, p) Push( (c const *) p )
#define C40_PTR_INSERT( c, p) Insert( (c const *) p )
-#define C40_REMOVE( c, p ) Remove( (c const *) p )
#define C40_REPLACE( c, p, n) Replace( (c const *) p, n )
-#define C40_PTR_REPLACE( c, p) Replace( (c const *) p )
#define C40_GETPOS( c, r) GetPos( (c const *)r )
#else
#if defined ICC || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400)
#define C40_INSERT( c, p, n ) Insert( (c const *&) p, n )
-#define C40_PUSH( c, p) Push( (c const *&) p )
#define C40_PTR_INSERT( c, p ) Insert( (c const *&) p )
-#define C40_REMOVE( c, p ) Remove( (c const *&) p )
#define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n )
-#define C40_PTR_REPLACE( c, p ) Replace( (c const *&) p )
#define C40_GETPOS( c, r) GetPos( (c const *&) r )
#else
#define C40_INSERT( c, p, n ) Insert( p, n )
-#define C40_PUSH( c, p) Push( p )
#define C40_PTR_INSERT( c, p ) Insert( p )
-#define C40_REMOVE( c, p) Remove( p )
#define C40_REPLACE( c, p, n ) Replace( p, n )
-#define C40_PTR_REPLACE( c, p ) Replace( p )
#define C40_GETPOS( c, r) GetPos( r )
#endif
#endif
diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index de8601c979d4..d60ef0094723 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -84,11 +84,11 @@ class SVL_DLLPUBLIC DdeData
SVL_DLLPRIVATE void Lock();
- void SetFormat( ULONG nFmt );
+ void SetFormat( sal_uLong nFmt );
public:
DdeData();
- DdeData( const void*, long, ULONG = FORMAT_STRING );
+ DdeData( const void*, long, sal_uLong = FORMAT_STRING );
DdeData( const String& );
DdeData( const DdeData& );
~DdeData();
@@ -96,12 +96,12 @@ public:
operator const void*() const;
operator long() const;
- ULONG GetFormat() const;
+ sal_uLong GetFormat() const;
DdeData& operator = ( const DdeData& );
- static ULONG GetExternalFormat( ULONG nFmt );
- static ULONG GetInternalFormat( ULONG nFmt );
+ static sal_uLong GetExternalFormat( sal_uLong nFmt );
+ static sal_uLong GetInternalFormat( sal_uLong nFmt );
};
// ------------------
@@ -112,7 +112,7 @@ class SVL_DLLPUBLIC DdeTransaction
{
public:
virtual void Data( const DdeData* );
- virtual void Done( BOOL bDataValid );
+ virtual void Done( sal_Bool bDataValid );
protected:
DdeConnection& rDde;
DdeData aDdeData;
@@ -122,14 +122,14 @@ protected:
long nTime;
Link aData;
Link aDone;
- BOOL bBusy;
+ sal_Bool bBusy;
DdeTransaction( DdeConnection&, const String&, long = 0 );
public:
virtual ~DdeTransaction();
- BOOL IsBusy() { return bBusy; }
+ sal_Bool IsBusy() { return bBusy; }
const String& GetName() const;
void Execute();
@@ -140,8 +140,8 @@ public:
void SetDoneHdl( const Link& rLink ) { aDone = rLink; }
const Link& GetDoneHdl() const { return aDone; }
- void SetFormat( ULONG nFmt ) { aDdeData.SetFormat( nFmt ); }
- ULONG GetFormat() const { return aDdeData.GetFormat(); }
+ void SetFormat( sal_uLong nFmt ) { aDdeData.SetFormat( nFmt ); }
+ sal_uLong GetFormat() const { return aDdeData.GetFormat(); }
long GetError();
@@ -209,7 +209,7 @@ class SVL_DLLPUBLIC DdePoke : public DdeTransaction
{
public:
DdePoke( DdeConnection&, const String&, const char*, long,
- ULONG = FORMAT_STRING, long = 0 );
+ sal_uLong = FORMAT_STRING, long = 0 );
DdePoke( DdeConnection&, const String&, const DdeData&, long = 0 );
DdePoke( DdeConnection&, const String&, const String&, long = 0 );
};
@@ -246,7 +246,7 @@ public:
static const DdeConnections& GetConnections();
- BOOL IsConnected();
+ sal_Bool IsConnected();
const String& GetServiceName();
const String& GetTopicName();
@@ -268,11 +268,11 @@ class SVL_DLLPUBLIC DdeItem
DdeTopic* pMyTopic;
DdeItemImp* pImpData;
- void IncMonitor( ULONG );
- void DecMonitor( ULONG );
+ void IncMonitor( sal_uLong );
+ void DecMonitor( sal_uLong );
protected:
- BYTE nType;
+ sal_uInt8 nType;
public:
DdeItem( const sal_Unicode* );
@@ -296,9 +296,9 @@ public:
DdeGetPutItem( const String& rStr );
DdeGetPutItem( const DdeItem& rItem );
- virtual DdeData* Get( ULONG );
- virtual BOOL Put( const DdeData* );
- virtual void AdviseLoop( BOOL ); // AdviseLoop starten/stoppen
+ virtual DdeData* Get( sal_uLong );
+ virtual sal_Bool Put( const DdeData* );
+ virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen
};
// ------------
@@ -312,16 +312,16 @@ class SVL_DLLPUBLIC DdeTopic
public:
virtual void Connect( long );
virtual void Disconnect( long );
- virtual DdeData* Get( ULONG );
- virtual BOOL Put( const DdeData* );
- virtual BOOL Execute( const String* );
+ virtual DdeData* Get( sal_uLong );
+ virtual sal_Bool Put( const DdeData* );
+ virtual sal_Bool Execute( const String* );
// evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
- virtual BOOL MakeItem( const String& rItem );
+ virtual sal_Bool MakeItem( const String& rItem );
// es wird ein Warm-/Hot-Link eingerichtet. Return-Wert
// besagt ob es geklappt hat
- virtual BOOL StartAdviseLoop();
- virtual BOOL StopAdviseLoop();
+ virtual sal_Bool StartAdviseLoop();
+ virtual sal_Bool StopAdviseLoop();
private:
friend class DdeInternal;
@@ -357,7 +357,7 @@ public:
const Link& GetExecuteHdl() const { return aExecLink; }
void NotifyClient( const String& );
- BOOL IsSystemTopic();
+ sal_Bool IsSystemTopic();
void InsertItem( DdeItem* ); // fuer eigene Ableitungen!
DdeItem* AddItem( const DdeItem& ); // werden kopiert !
@@ -379,10 +379,10 @@ class SVL_DLLPUBLIC DdeService
friend class DdeInternal;
public:
- virtual BOOL IsBusy();
+ virtual sal_Bool IsBusy();
virtual String GetHelp();
// evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
- virtual BOOL MakeTopic( const String& rItem );
+ virtual sal_Bool MakeTopic( const String& rItem );
protected:
virtual String Topics();
@@ -390,7 +390,7 @@ protected:
virtual String SysItems();
virtual String Status();
virtual String SysTopicGet( const String& );
- virtual BOOL SysTopicExecute( const String* );
+ virtual sal_Bool SysTopicExecute( const String* );
const DdeTopic* GetSysTopic() const { return pSysTopic; }
private:
@@ -401,7 +401,7 @@ private:
ConvList* pConv;
short nStatus;
- SVL_DLLPRIVATE BOOL HasCbFormat( USHORT );
+ SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 );
public:
DdeService( const String& );
@@ -416,9 +416,9 @@ public:
void AddTopic( const DdeTopic& );
void RemoveTopic( const DdeTopic& );
- void AddFormat( ULONG );
- void RemoveFormat( ULONG );
- BOOL HasFormat( ULONG );
+ void AddFormat( sal_uLong );
+ void RemoveFormat( sal_uLong );
+ sal_Bool HasFormat( sal_uLong );
private:
// DdeService( const DdeService& );
diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx
index 952f09db75e0..1a869b5a5a1f 100644
--- a/svl/inc/svl/svldata.hxx
+++ b/svl/inc/svl/svldata.hxx
@@ -62,7 +62,7 @@ class SvtSimpleResId
String m_sValue;
public:
- SvtSimpleResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { };
+ SvtSimpleResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { };
operator String () const { return m_sValue; }
};
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index 4629cb4a1b8e..b831362e72da 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -41,55 +41,56 @@
#include "svl/svldllapi.h"
#include <svl/svarray.hxx>
+#include <deque>
#ifndef _SVSTDARR_ULONGS_DECL
-SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, SVL_DLLPUBLIC )
+SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_ULONGS_DECL
#endif
#ifndef _SVSTDARR_ULONGSSORT_DECL
-SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, ULONG, 1, 1, SVL_DLLPUBLIC )
+SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uLong, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_ULONGSSORT_DECL
#endif
#ifndef _SVSTDARR_USHORTS_DECL
-SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC )
+SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_USHORTS_DECL
#endif
#ifndef _SVSTDARR_USHORTSSORT_DECL
-typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* );
+typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* );
class SVL_DLLPUBLIC SvUShortsSort : private SvUShorts
{
public:
- SvUShortsSort(BYTE nSize = 1, BYTE nG = 1)
+ SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1)
: SvUShorts(nSize,nG) {}
- void Insert( const SvUShortsSort *pI, USHORT nS=0, USHORT nE=USHRT_MAX );
- BOOL Insert( const USHORT aE );
- BOOL Insert( const USHORT aE, USHORT& rP );
- void Insert( const USHORT *pE, USHORT nL );
+ void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX );
+ sal_Bool Insert( const sal_uInt16 aE );
+ sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP );
+ void Insert( const sal_uInt16 *pE, sal_uInt16 nL );
// remove ab Pos
- void RemoveAt( const USHORT nP, USHORT nL = 1 );
+ void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 );
// remove ab dem Eintrag
- void Remove( const USHORT nP, USHORT nL = 1 );
- BOOL Seek_Entry( const USHORT aE, USHORT* pP = 0 ) const;
+ void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 );
+ sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const;
- USHORT Count() const { return SvUShorts::Count(); }
- const USHORT* GetData() const { return (const USHORT*)pData; }
+ sal_uInt16 Count() const { return SvUShorts::Count(); }
+ const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; }
- const USHORT& operator[](USHORT nP) const {
+ const sal_uInt16& operator[](sal_uInt16 nP) const {
return SvUShorts::operator[]( nP );
}
- const USHORT& GetObject(USHORT nP) const {
+ const sal_uInt16& GetObject(sal_uInt16 nP) const {
return SvUShorts::GetObject( nP );
}
void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 )
{
_ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs );
}
- void ForEach( USHORT nS, USHORT nE,
+ void ForEach( sal_uInt16 nS, sal_uInt16 nE,
FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 )
{
_ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs );
@@ -173,14 +174,6 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1,
#define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL
#endif
-#ifndef _SVSTDARR_XUB_STRLEN_DECL
-SV_DECL_VARARR_VISIBILITY( SvXub_StrLens, xub_StrLen, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_XUB_STRLEN_DECL
-#endif
-
-#ifndef _SVSTDARR_XUB_STRLENSORT_DECL
-SV_DECL_VARARR_SORT_VISIBILITY( SvXub_StrLensSort, xub_StrLen, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_XUB_STRLENSORT_DECL
-#endif
+typedef std::deque< xub_StrLen > SvXub_StrLens;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx
index cd8a40d33e55..b3b78d9e8891 100644
--- a/svl/inc/svl/szitem.hxx
+++ b/svl/inc/svl/szitem.hxx
@@ -47,8 +47,8 @@ private:
public:
TYPEINFO();
SfxSizeItem();
- SfxSizeItem( USHORT nWhich, const Size& rVal );
- SfxSizeItem( USHORT nWhich, SvStream & );
+ SfxSizeItem( sal_uInt16 nWhich, const Size& rVal );
+ SfxSizeItem( sal_uInt16 nWhich, SvStream & );
SfxSizeItem( const SfxSizeItem& );
~SfxSizeItem() { DBG_DTOR(SfxSizeItem, 0); }
@@ -60,13 +60,13 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const;
- virtual SvStream& Store(SvStream &, USHORT nItemVersion) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
const Size& GetValue() const { return aVal; }
void SetValue( const Size& rNewVal ) {
diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx
index aaf3fa3ce60c..e3f964864eb8 100644
--- a/svl/inc/svl/undo.hxx
+++ b/svl/inc/svl/undo.hxx
@@ -33,6 +33,10 @@
#include <tools/string.hxx>
#include <svl/svarray.hxx>
+#include <boost/scoped_ptr.hpp>
+
+#include <vector>
+
//====================================================================
class SVL_DLLPUBLIC SfxRepeatTarget
@@ -44,26 +48,36 @@ public:
//====================================================================
+class SVL_DLLPUBLIC SfxUndoContext
+{
+public:
+ virtual ~SfxUndoContext() = 0;
+};
+
+//====================================================================
+
class SVL_DLLPUBLIC SfxUndoAction
{
- BOOL bLinked;
+ sal_Bool bLinked;
public:
TYPEINFO();
SfxUndoAction();
virtual ~SfxUndoAction();
- virtual BOOL IsLinked();
- virtual void SetLinked( BOOL bIsLinked = TRUE );
+ virtual sal_Bool IsLinked();
+ virtual void SetLinked( sal_Bool bIsLinked = sal_True );
virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
virtual void Repeat(SfxRepeatTarget&);
- virtual BOOL CanRepeat(SfxRepeatTarget&) const;
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
- virtual BOOL Merge( SfxUndoAction *pNextAction );
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
- virtual USHORT GetId() const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual sal_uInt16 GetId() const;
private:
SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!!
@@ -71,19 +85,67 @@ private:
//========================================================================
-SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 )
+/// is a mark on the Undo stack
+typedef sal_Int32 UndoStackMark;
+#define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max()
+
+//========================================================================
+
+struct MarkedUndoAction
+{
+ SfxUndoAction* pAction;
+ ::std::vector< UndoStackMark > aMarks;
+
+ MarkedUndoAction( SfxUndoAction* i_action )
+ :pAction( i_action )
+ ,aMarks()
+ {
+ }
+};
+
+class SfxUndoActions
+{
+private:
+ ::std::vector< MarkedUndoAction > m_aActions;
+
+public:
+ SfxUndoActions()
+ {
+ }
+
+ bool empty() const { return m_aActions.empty(); }
+ size_t size() const { return m_aActions.size(); }
+
+ const MarkedUndoAction& operator[]( size_t i ) const { return m_aActions[i]; }
+ MarkedUndoAction& operator[]( size_t i ) { return m_aActions[i]; }
+
+ void Remove( size_t i_pos )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos );
+ }
+
+ void Remove( size_t i_pos, size_t i_count )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos, m_aActions.begin() + i_pos + i_count );
+ }
+
+ void Insert( SfxUndoAction* i_action, size_t i_pos )
+ {
+ m_aActions.insert( m_aActions.begin() + i_pos, MarkedUndoAction( i_action ) );
+ }
+};
//====================================================================
-/** do not make use of this implementation details, unless you
+/** do not make use of these implementation details, unless you
really really have to! */
struct SVL_DLLPUBLIC SfxUndoArray
{
SfxUndoActions aUndoActions;
- USHORT nMaxUndoActions;
- USHORT nCurUndoAction;
+ size_t nMaxUndoActions;
+ size_t nCurUndoAction;
SfxUndoArray *pFatherUndoArray;
- SfxUndoArray(USHORT nMax=0):
+ SfxUndoArray(size_t nMax=0):
nMaxUndoActions(nMax), nCurUndoAction(0),
pFatherUndoArray(0) {}
~SfxUndoArray();
@@ -91,7 +153,7 @@ struct SVL_DLLPUBLIC SfxUndoArray
//=========================================================================
-/** do not make use of this implementation details, unless you
+/** do not make use of these implementation details, unless you
really really have to! */
class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray
@@ -110,87 +172,260 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
TYPEINFO();
SfxListUndoAction( const UniString &rComment,
- const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather);
+ const UniString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
virtual void Repeat(SfxRepeatTarget&);
- virtual BOOL CanRepeat(SfxRepeatTarget&) const;
+ virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
- virtual BOOL Merge( SfxUndoAction *pNextAction );
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
- virtual USHORT GetId() const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual sal_uInt16 GetId() const;
void SetComment( const UniString& rComment );
private:
- USHORT nId;
- UniString aComment, aRepeatComment;
+ sal_uInt16 nId;
+ UniString aComment;
+ UniString aRepeatComment;
};
//=========================================================================
-class SVL_DLLPUBLIC SfxUndoManager
+/** is a callback interface for notifications about state changes of an SfxUndoManager
+*/
+class SAL_NO_VTABLE SfxUndoListener
{
- friend class SfxLinkUndoAction;
+public:
+ virtual void actionUndone( const String& i_actionComment ) = 0;
+ virtual void actionRedone( const String& i_actionComment ) = 0;
+ virtual void undoActionAdded( const String& i_actionComment ) = 0;
+ virtual void cleared() = 0;
+ virtual void clearedRedo() = 0;
+ virtual void resetAll() = 0;
+ virtual void listActionEntered( const String& i_comment ) = 0;
+ virtual void listActionLeft( const String& i_comment ) = 0;
+ virtual void listActionLeftAndMerged() = 0;
+ virtual void listActionCancelled() = 0;
+ virtual void undoManagerDying() = 0;
+};
- SfxUndoArray *pUndoArray;
- SfxUndoArray *pActUndoArray;
- SfxUndoArray *pFatherUndoArray;
+//=========================================================================
- bool mbUndoEnabled;
-public:
- SfxUndoManager( USHORT nMaxUndoActionCount = 20 );
- virtual ~SfxUndoManager();
+namespace svl
+{
+ class SAL_NO_VTABLE IUndoManager
+ {
+ public:
+ enum
+ {
+ CurrentLevel = true,
+ TopLevel = false
+ };
- virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount );
- virtual USHORT GetMaxUndoActionCount() const;
- virtual void Clear();
+ virtual ~IUndoManager() { };
+
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0;
+ virtual size_t GetMaxUndoActionCount() const = 0;
+
+ virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ) = 0;
+
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual sal_uInt16 GetUndoActionId() const = 0;
+ virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0;
- virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
- virtual USHORT GetUndoActionCount() const;
- virtual USHORT GetUndoActionId(USHORT nNo=0) const;
- virtual UniString GetUndoActionComment( USHORT nNo=0 ) const;
- /** returns the nNo'th undo action from the top */
- SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const;
+ virtual sal_Bool Undo() = 0;
+ virtual sal_Bool Redo() = 0;
- virtual BOOL Undo( USHORT nCount=1 );
- virtual void Undo( SfxUndoAction &rAction );
+ /** clears both the Redo and the Undo stack.
- virtual USHORT GetRedoActionCount() const;
- virtual USHORT GetRedoActionId(USHORT nNo=0) const;
- virtual UniString GetRedoActionComment( USHORT nNo=0 ) const;
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void Clear() = 0;
- virtual BOOL Redo( USHORT nCount=1 );
- virtual void Redo( SfxUndoAction &rAction );
+ /** clears the Redo stack.
+
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void ClearRedo() = 0;
+
+ /** leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and the
+ Redo stack.
+
+ Effectively, calling this method is equivalent to <code>while ( IsInListAction() ) LeaveListAction();</code>,
+ followed by <code>Clear()</code>. The only difference to this calling sequence is that Reset is an
+ atomar operation, also resulting in only one notification.
+ */
+ virtual void Reset() = 0;
+
+ /** determines whether an Undo or Redo is currently running
+ */
+ virtual bool IsDoing() const = 0;
+
+ virtual size_t GetRepeatActionCount() const = 0;
+ virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0;
+ virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ) = 0;
+ virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0;
+
+ virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0) = 0;
+
+ /** leaves the list action entered with EnterListAction
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveListAction() = 0;
+
+ /** leaves the list action entered with EnterListAction, and forcefully merges the previous
+ action on the stack into the newly created list action.
+
+ Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to
+ AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo
+ stack will now still contain one undo action: the newly created list action, whose first child is the
+ original A, whose other children are those you added via AddUndoAction, and whose comment is the same as
+ the comment of A.
+
+ Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are
+ hidden from the user.
+
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveAndMergeListAction() = 0;
+
+ /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending
+ virtual bool IsInListAction() const = 0;
+
+ /// determines how many nested list actions are currently open
+ virtual size_t GetListActionDepth() const = 0;
+
+ /** clears the redo stack and removes the top undo action */
+ virtual void RemoveLastUndoAction() = 0;
+
+ // enables (true) or disables (false) recording of undo actions
+ // If undo actions are added while undo is disabled, they are deleted.
+ // Disabling undo does not clear the current undo buffer!
+ virtual void EnableUndo( bool bEnable ) = 0;
+
+ // returns true if undo is currently enabled
+ // This returns false if undo was disabled using EnableUndo( false ) and
+ // also during the runtime of the Undo() and Redo() methods.
+ virtual bool IsUndoEnabled() const = 0;
+
+ /// adds a new listener to be notified about changes in the UndoManager's state
+ virtual void AddUndoListener( SfxUndoListener& i_listener ) = 0;
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener ) = 0;
+ };
+}
+
+//=========================================================================
+
+namespace svl { namespace undo { namespace impl
+{
+ class UndoManagerGuard;
+ class LockGuard;
+} } }
+
+struct SfxUndoManager_Data;
+class SVL_DLLPUBLIC SfxUndoManager : public ::svl::IUndoManager
+{
+ friend class SfxLinkUndoAction;
+
+ ::boost::scoped_ptr< SfxUndoManager_Data >
+ m_pData;
+public:
+ SfxUndoManager( size_t nMaxUndoActionCount = 20 );
+ virtual ~SfxUndoManager();
+
+ // IUndoManager overridables
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount );
+ virtual size_t GetMaxUndoActionCount() const;
+ virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False );
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual sal_uInt16 GetUndoActionId() const;
+ virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const;
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual sal_Bool Undo();
+ virtual sal_Bool Redo();
+ virtual void Clear();
virtual void ClearRedo();
+ virtual void Reset();
+ virtual bool IsDoing() const;
+ virtual size_t GetRepeatActionCount() const;
+ virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const;
+ virtual sal_Bool Repeat( SfxRepeatTarget &rTarget );
+ virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const;
+ virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0);
+ virtual size_t LeaveListAction();
+ virtual size_t LeaveAndMergeListAction();
+ virtual bool IsInListAction() const;
+ virtual size_t GetListActionDepth() const;
+ virtual void RemoveLastUndoAction();
+ virtual void EnableUndo( bool bEnable );
+ virtual bool IsUndoEnabled() const;
+ virtual void AddUndoListener( SfxUndoListener& i_listener );
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener );
+
+ /** marks the current top-level element of the Undo stack, and returns a unique ID for it
+ */
+ UndoStackMark MarkTopUndoAction();
+
+ /** removes a mark given by its ID.
+ After the call, the mark ID is invalid.
+ */
+ void RemoveMark( UndoStackMark const i_mark );
+
+ /** determines whether the top action on the Undo stack has a given mark
+ */
+ bool HasTopUndoActionMark( UndoStackMark const i_mark );
+
+ /** removes the oldest Undo actions from the stack
+ */
+ void RemoveOldestUndoActions( size_t const i_count );
+
+protected:
+ sal_Bool UndoWithContext( SfxUndoContext& i_context );
+ sal_Bool RedoWithContext( SfxUndoContext& i_context );
- virtual USHORT GetRepeatActionCount() const;
- virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo = 0) const;
- virtual BOOL Repeat( SfxRepeatTarget &rTarget, USHORT nFrom=0, USHORT nCount=1 );
- virtual void Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction );
- virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo = 0 ) const;
- virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const;
+ void ImplClearRedo_NoLock( bool const i_currentLevel );
- virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0);
- virtual void LeaveListAction();
+ /** clears all undo actions on the current level, plus all undo actions on superordinate levels,
+ as soon as those levels are reached.
- /** clears the redo stack and removes the top undo action */
- void RemoveLastUndoAction();
+ If no list action is active currently, i.e. we're on the top level already, this method is equivalent to
+ ->Clear.
- // enables (true) or disables (false) recording of undo actions
- // If undo actions are added while undo is disabled, they are deleted.
- // Disabling undo does not clear the current undo buffer!
- void EnableUndo( bool bEnable );
+ Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all
+ undo actions on the then-current level are removed, too. This is continued until the top level is reached.
+ */
+ void ClearAllLevels();
- // returns true if undo is currently enabled
- // This returns false if undo was disabled using EnableUndo( false ) and
- // also during the runtime of the Undo() and Redo() methods.
- bool IsUndoEnabled() const { return mbUndoEnabled; }
+private:
+ size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel );
+ void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const;
+ bool ImplIsUndoEnabled_Lock() const;
+ bool ImplIsInListAction_Lock() const;
+ void ImplEnableUndo_Lock( bool const i_enable );
+
+ sal_Bool ImplUndo( SfxUndoContext* i_contextOrNull );
+ sal_Bool ImplRedo( SfxUndoContext* i_contextOrNull );
+
+ friend class ::svl::undo::impl::LockGuard;
};
//=========================================================================
@@ -214,23 +449,23 @@ class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction
{
public:
TYPEINFO();
- SfxLinkUndoAction(SfxUndoManager *pManager);
+ SfxLinkUndoAction(::svl::IUndoManager *pManager);
~SfxLinkUndoAction();
virtual void Undo();
virtual void Redo();
- virtual BOOL CanRepeat(SfxRepeatTarget& r) const;
+ virtual sal_Bool CanRepeat(SfxRepeatTarget& r) const;
virtual void Repeat(SfxRepeatTarget&r);
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&r) const;
- virtual USHORT GetId() const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&r) const;
+ virtual sal_uInt16 GetId() const;
SfxUndoAction* GetAction() const { return pAction; }
protected:
- SfxUndoManager *pUndoManager;
+ ::svl::IUndoManager *pUndoManager;
SfxUndoAction *pAction;
};
diff --git a/svl/inc/urihelper.hxx b/svl/inc/svl/urihelper.hxx
index 3baab37f7896..3baab37f7896 100644
--- a/svl/inc/urihelper.hxx
+++ b/svl/inc/svl/urihelper.hxx
diff --git a/svl/inc/urlbmk.hxx b/svl/inc/svl/urlbmk.hxx
index 8922dbb4feb9..8922dbb4feb9 100644
--- a/svl/inc/urlbmk.hxx
+++ b/svl/inc/svl/urlbmk.hxx
diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx
index b818376a45db..70f3ce994754 100644
--- a/svl/inc/svl/visitem.hxx
+++ b/svl/inc/svl/visitem.hxx
@@ -44,14 +44,14 @@ class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem
public:
TYPEINFO();
- SfxVisibilityItem(USHORT which = 0, sal_Bool bVisible = sal_True):
+ SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True):
SfxPoolItem(which)
{
m_nValue.bVisible = bVisible;
DBG_CTOR(SfxVisibilityItem, 0);
}
- SfxVisibilityItem(USHORT which, SvStream & rStream);
+ SfxVisibilityItem(sal_uInt16 which, SvStream & rStream);
SfxVisibilityItem(const SfxVisibilityItem & rItem):
SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
@@ -71,24 +71,24 @@ public:
const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 ) const;
+ sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId = 0 );
+ sal_uInt8 nMemberId = 0 );
- virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const;
+ virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
- virtual SvStream & Store(SvStream & rStream, USHORT) const;
+ virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
- virtual USHORT GetValueCount() const;
+ virtual sal_uInt16 GetValueCount() const;
- virtual UniString GetValueTextByVal(BOOL bTheValue) const;
+ virtual UniString GetValueTextByVal(sal_Bool bTheValue) const;
- BOOL GetValue() const { return m_nValue.bVisible; }
+ sal_Bool GetValue() const { return m_nValue.bVisible; }
- void SetValue(BOOL bVisible) { m_nValue.bVisible = bVisible; }
+ void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; }
};
#endif // _SFXVISIBILITYITEM_HXX
diff --git a/svl/inc/whiter.hxx b/svl/inc/svl/whiter.hxx
index 9e68d24d4e62..bb3936eb6961 100644
--- a/svl/inc/whiter.hxx
+++ b/svl/inc/svl/whiter.hxx
@@ -43,19 +43,19 @@ class SfxItemSet;
class SVL_DLLPUBLIC SfxWhichIter
{
- const USHORT *pRanges, *pStart;
- USHORT nOfst, nFrom, nTo;
+ const sal_uInt16 *pRanges, *pStart;
+ sal_uInt16 nOfst, nFrom, nTo;
public:
- SfxWhichIter( const SfxItemSet& rSet, USHORT nFrom = 0, USHORT nTo = USHRT_MAX );
+ SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFrom = 0, sal_uInt16 nTo = USHRT_MAX );
~SfxWhichIter();
- USHORT GetCurWhich() const { return *pRanges + nOfst; }
- USHORT NextWhich();
- USHORT PrevWhich();
+ sal_uInt16 GetCurWhich() const { return *pRanges + nOfst; }
+ sal_uInt16 NextWhich();
+ sal_uInt16 PrevWhich();
- USHORT FirstWhich();
- USHORT LastWhich();
+ sal_uInt16 FirstWhich();
+ sal_uInt16 LastWhich();
};
#endif
diff --git a/svl/inc/xmlement.hxx b/svl/inc/svl/xmlement.hxx
index 779bad3f3c55..779bad3f3c55 100644
--- a/svl/inc/xmlement.hxx
+++ b/svl/inc/svl/xmlement.hxx
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index f3f7fdfef1e0..80e9b8eeffb0 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -235,9 +235,9 @@ class SVL_DLLPUBLIC NfCurrencyEntry
String aSymbol; /// currency symbol
String aBankSymbol; /// currency abbreviation
LanguageType eLanguage; /// language/country value
- USHORT nPositiveFormat; /// position of symbol
- USHORT nNegativeFormat; /// position of symbol and type and position of negative sign
- USHORT nDigits; /// count of decimal digits
+ sal_uInt16 nPositiveFormat; /// position of symbol
+ sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign
+ sal_uInt16 nDigits; /// count of decimal digits
sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits
/// not implemented, prevent usage
@@ -250,7 +250,7 @@ private:
// nDecimalFormat := 0, 1, 2
// #,##0 or #,##0.00 or #,##0.-- are assigned
SVL_DLLPRIVATE void Impl_BuildFormatStringNumChars( String&,
- const LocaleDataWrapper&, USHORT nDecimalFormat ) const;
+ const LocaleDataWrapper&, sal_uInt16 nDecimalFormat ) const;
public:
@@ -264,11 +264,11 @@ public:
~NfCurrencyEntry() {}
/// Symbols and language identical
- BOOL operator==( const NfCurrencyEntry& r ) const;
+ sal_Bool operator==( const NfCurrencyEntry& r ) const;
/// Set this format to be the EURo entry, overwrite other settings
void SetEuro();
- BOOL IsEuro() const;
+ sal_Bool IsEuro() const;
/** Apply format information (nPositiveFormat,
nNegativeFormat, nDigits, cZeroChar) of another format. */
@@ -277,43 +277,43 @@ public:
const String& GetSymbol() const { return aSymbol; }
const String& GetBankSymbol() const { return aBankSymbol; }
LanguageType GetLanguage() const { return eLanguage; }
- USHORT GetPositiveFormat() const { return nPositiveFormat; }
- USHORT GetNegativeFormat() const { return nNegativeFormat; }
- USHORT GetDigits() const { return nDigits; }
+ sal_uInt16 GetPositiveFormat() const { return nPositiveFormat; }
+ sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; }
+ sal_uInt16 GetDigits() const { return nDigits; }
sal_Unicode GetZeroChar() const { return cZeroChar; }
- /** [$DM-407] (bBank==FALSE) or [$DEM] (bBank==TRUE)
- is assigned to rStr, if bBank==FALSE and
- bWithoutExtension==TRUE only [$DM] */
- void BuildSymbolString( String& rStr, BOOL bBank,
- BOOL bWithoutExtension = FALSE ) const;
+ /** [$DM-407] (bBank==sal_False) or [$DEM] (bBank==sal_True)
+ is assigned to rStr, if bBank==sal_False and
+ bWithoutExtension==sal_True only [$DM] */
+ void BuildSymbolString( String& rStr, sal_Bool bBank,
+ sal_Bool bWithoutExtension = sal_False ) const;
/** #,##0.00 [$DM-407] is assigned to rStr, separators
from rLoc, incl. minus sign but without [RED] */
- void BuildPositiveFormatString( String& rStr, BOOL bBank,
- const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const;
- void BuildNegativeFormatString( String& rStr, BOOL bBank,
- const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const;
+ void BuildPositiveFormatString( String& rStr, sal_Bool bBank,
+ const LocaleDataWrapper&, sal_uInt16 nDecimalFormat = 1 ) const;
+ void BuildNegativeFormatString( String& rStr, sal_Bool bBank,
+ const LocaleDataWrapper&, sal_uInt16 nDecimalFormat = 1 ) const;
- /** [$DM-407] (or [$DEM] if bBank==TRUE)
+ /** [$DM-407] (or [$DEM] if bBank==sal_True)
is appended/prepended to rStr, incl. minus sign */
- void CompletePositiveFormatString( String& rStr, BOOL bBank,
- USHORT nPosiFormat ) const;
- void CompleteNegativeFormatString( String& rStr, BOOL bBank,
- USHORT nNegaFormat ) const;
+ void CompletePositiveFormatString( String& rStr, sal_Bool bBank,
+ sal_uInt16 nPosiFormat ) const;
+ void CompleteNegativeFormatString( String& rStr, sal_Bool bBank,
+ sal_uInt16 nNegaFormat ) const;
/// rSymStr is appended/prepended to rStr, incl. minus sign
static void CompletePositiveFormatString( String& rStr,
- const String& rSymStr, USHORT nPosiFormat );
+ const String& rSymStr, sal_uInt16 nPosiFormat );
static void CompleteNegativeFormatString( String& rStr,
- const String& rSymStr, USHORT nNegaFormat );
+ const String& rSymStr, sal_uInt16 nNegaFormat );
/** Representation of a currency (symbol position and
negative sign) in other language settings */
- static USHORT GetEffectivePositiveFormat( USHORT nIntlFormat,
- USHORT nCurrFormat, BOOL bBank );
- static USHORT GetEffectiveNegativeFormat( USHORT nIntlFormat,
- USHORT nCurrFormat, BOOL bBank );
+ static sal_uInt16 GetEffectivePositiveFormat( sal_uInt16 nIntlFormat,
+ sal_uInt16 nCurrFormat, sal_Bool bBank );
+ static sal_uInt16 GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat,
+ sal_uInt16 nCurrFormat, sal_Bool bBank );
/// General Unicode Euro symbol
static inline sal_Unicode GetEuroSymbol() { return sal_Unicode(0x20AC); }
@@ -359,23 +359,23 @@ public:
/// Set CallBack to ColorTable
void SetColorLink( const Link& rColorTableCallBack ) { aColorLink = rColorTableCallBack; }
/// Do the CallBack to ColorTable
- Color* GetUserDefColor(USHORT nIndex);
+ Color* GetUserDefColor(sal_uInt16 nIndex);
/// Change language/country, also input and format scanner
void ChangeIntl( LanguageType eLnge );
/// Change the reference null date
- void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear);
+ void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear);
/// Change standard precision
void ChangeStandardPrec(short nPrec);
/// Set zero value suppression
- void SetNoZero(BOOL bNZ) { bNoZero = bNZ; }
+ void SetNoZero(sal_Bool bNZ) { bNoZero = bNZ; }
/** The language with which the formatter was initialized (system setting),
NOT the current language after a ChangeIntl() */
LanguageType GetLanguage() const { return IniLnge; }
// Determine whether two format types are input compatible or not
- BOOL IsCompatible(short eOldType, short eNewType);
+ sal_Bool IsCompatible(short eOldType, short eNewType);
/** Get table of formats of a specific type of a locale. A format FIndex is
tested whether it has the type and locale requested, if it doesn't
@@ -414,7 +414,7 @@ public:
nType contains the type of the format.
nKey contains the index key of the format.
*/
- BOOL PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
+ sal_Bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
LanguageType eLnge = LANGUAGE_DONTKNOW );
bool PutEntry( rtl::OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
@@ -423,7 +423,7 @@ public:
/** Same as <method>PutEntry</method> but the format code string is
considered to be of language/country eLnge and is converted to
language/country eNewLnge */
- BOOL PutandConvertEntry( String& rString, xub_StrLen& nCheckPos,
+ bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos,
short& nType, sal_uInt32& nKey,
LanguageType eLnge, LanguageType eNewLnge );
@@ -431,7 +431,7 @@ public:
is considered to be of the System language/country eLnge and is
converted to another System language/country eNewLnge. In this case
the automatic currency is converted too. */
- BOOL PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos,
+ bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos,
short& nType, sal_uInt32& nKey,
LanguageType eLnge, LanguageType eNewLnge );
@@ -469,20 +469,20 @@ public:
was empty, could not be converted or has errors, the eLnge locale's
standard number format is chosen instead. The index key is
guaranteed to represent some valid number format. If
- rNewInserted==FALSE and rCheckPos>0 the format code has errors
+ rNewInserted==sal_False and rCheckPos>0 the format code has errors
and/or could not be converted.
*/
sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge,
LanguageType eSysLnge, short & rType,
- BOOL & rNewInserted,
+ sal_Bool & rNewInserted,
xub_StrLen & rCheckPos );
/** Create a format code string using format nIndex as a template and
applying other settings (passed from the dialog) */
void GenerateFormat( String& sString, sal_uInt32 nIndex,
LanguageType eLnge = LANGUAGE_DONTKNOW,
- BOOL bThousand = FALSE, BOOL IsRed = FALSE,
- USHORT nPrecision = 0, USHORT nAnzLeading = 1 );
+ sal_Bool bThousand = sal_False, sal_Bool IsRed = sal_False,
+ sal_uInt16 nPrecision = 0, sal_uInt16 nAnzLeading = 1 );
/** Analyze an input string
@return
@@ -491,7 +491,7 @@ public:
returned in fOutNumber
<FALSE/> if input is not a number
*/
- BOOL IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber );
+ sal_Bool IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber );
/// Format a number according to a format index, return string and color
void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
@@ -513,13 +513,13 @@ public:
<FALSE/> if format code contains an error
<TRUE/> else, in which case the string and color are returned.
*/
- BOOL GetPreviewString( const String& sFormatString, double fPreviewNumber,
+ sal_Bool GetPreviewString( const String& sFormatString, double fPreviewNumber,
String& sOutString, Color** ppColor,
LanguageType eLnge = LANGUAGE_DONTKNOW );
/** Same as <method>GetPreviewString</method> but the format code string
may be either language/country eLnge or en_US english US */
- BOOL GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber,
+ sal_Bool GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber,
String& sOutString, Color** ppColor,
LanguageType eLnge = LANGUAGE_DONTKNOW );
@@ -528,7 +528,7 @@ public:
<FALSE/> if format code contains an error
<TRUE/> else, in which case the string and color are returned.
*/
- BOOL GetPreviewString( const String& sFormatString, const String& sPreviewString,
+ sal_Bool GetPreviewString( const String& sFormatString, const String& sPreviewString,
String& sOutString, Color** ppColor,
LanguageType eLnge = LANGUAGE_DONTKNOW );
@@ -540,14 +540,14 @@ public:
LanguageType eLnge = LANGUAGE_DONTKNOW );
/// Whether format index nFIndex is of type text or not
- BOOL IsTextFormat(sal_uInt32 nFIndex) const;
+ sal_Bool IsTextFormat(sal_uInt32 nFIndex) const;
/// Whether the 4th string subcode of format index nFIndex is present
- BOOL HasTextFormat(sal_uInt32 nFIndex) const;
+ sal_Bool HasTextFormat(sal_uInt32 nFIndex) const;
/// Load all formats from a stream
- BOOL Load( SvStream& rStream );
+ sal_Bool Load( SvStream& rStream );
/// Save all formats to a stream
- BOOL Save( SvStream& rStream ) const;
+ sal_Bool Save( SvStream& rStream ) const;
/// Reset of "Used" flags
void PrepareSave();
@@ -555,11 +555,11 @@ public:
void SetFormatUsed(sal_uInt32 nFIndex);
/// Get additional info of a format index, e.g. for dialog box
- void GetFormatSpecialInfo(sal_uInt32 nFormat, BOOL& bThousand, BOOL& IsRed,
- USHORT& nPrecision, USHORT& nAnzLeading);
+ void GetFormatSpecialInfo(sal_uInt32 nFormat, sal_Bool& bThousand, sal_Bool& IsRed,
+ sal_uInt16& nPrecision, sal_uInt16& nAnzLeading);
/// Count of decimals
- USHORT GetFormatPrecision( sal_uInt32 nFormat ) const;
+ sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const;
/** Get additional info of a format code string, e.g. for dialog box.
Uses a temporary parse, if possible use only if format code is not
@@ -568,12 +568,12 @@ public:
0 if format code string parsed without errors, otherwise error
position (like nCheckPos on <method>PutEntry</method>)
*/
- sal_uInt32 GetFormatSpecialInfo( const String&, BOOL& bThousand, BOOL& IsRed,
- USHORT& nPrecision, USHORT& nAnzLeading,
+ sal_uInt32 GetFormatSpecialInfo( const String&, sal_Bool& bThousand, sal_Bool& IsRed,
+ sal_uInt16& nPrecision, sal_uInt16& nAnzLeading,
LanguageType eLnge = LANGUAGE_DONTKNOW );
/// Check if format code string may be deleted by user
- BOOL IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
+ sal_Bool IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
/** Return the format index of the format code string for language/country,
or NUMBERFORMAT_ENTRY_NOT_FOUND */
@@ -601,14 +601,14 @@ public:
LanguageType eLnge );
/// Whether nFIndex is a special builtin format
- BOOL IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
+ sal_Bool IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge );
/// Return the reference date
Date* GetNullDate();
/// Return the standard decimal precision
sal_uInt16 GetStandardPrec();
/// Return whether zero suppression is switched on
- BOOL GetNoZero() { return bNoZero; }
+ sal_Bool GetNoZero() { return bNoZero; }
/** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry),
but with NUMBERFORMAT_DEFINED masked out */
short GetType(sal_uInt32 nFIndex);
@@ -619,7 +619,7 @@ public:
SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable);
/// Whether a merge table is present or not
- inline BOOL HasMergeFmtTbl() const;
+ inline sal_Bool HasMergeFmtTbl() const;
/// Return the new format index for an old format index, if a merge table exists
inline sal_uInt32 GetMergeFmtIndex( sal_uInt32 nOldFmt ) const;
@@ -629,7 +629,7 @@ public:
SvNumberFormatterMergeMap ConvertMergeTableToMap();
/// Return the last used position ever of a language/country combination
- USHORT GetLastInsertKey(sal_uInt32 CLOffset);
+ sal_uInt16 GetLastInsertKey(sal_uInt32 CLOffset);
/** Return the format index of a builtin format for a specific language/country.
If nFormat is not a builtin format nFormat is returned. */
@@ -662,12 +662,12 @@ public:
The name Year2000 is kept although the actual functionality is now a
TwoDigitYearStart which might be in any century.
*/
- void SetYear2000( USHORT nVal );
- USHORT GetYear2000() const;
- static USHORT GetYear2000Default();
+ void SetYear2000( sal_uInt16 nVal );
+ sal_uInt16 GetYear2000() const;
+ static sal_uInt16 GetYear2000Default();
- USHORT ExpandTwoDigitYear( USHORT nYear ) const;
- inline static USHORT ExpandTwoDigitYear( USHORT nYear, USHORT nTwoDigitYearStart );
+ sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear ) const;
+ inline static sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart );
/// DEPRICATED: Return first character of the decimal separator of the current language/country
sal_Unicode GetDecSep() const { return GetNumDecimalSep().GetChar(0); }
@@ -732,16 +732,16 @@ public:
@return
position of default format
*/
- USHORT GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
- BOOL bBank ) const;
+ sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
+ sal_Bool bBank ) const;
/** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code
contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].
If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is
returned, even if the format code only contains [$xxx] !
*/
- BOOL GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol,
- const NfCurrencyEntry** ppEntry = NULL, BOOL* pBank = NULL ) const;
+ sal_Bool GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol,
+ const NfCurrencyEntry** ppEntry = NULL, sal_Bool* pBank = NULL ) const;
/** Look up the corresponding <type>NfCurrencyEntry</type> matching
rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly
@@ -779,9 +779,9 @@ public:
The matching entry if unique (in which case bFoundBank is set),
else <NULL/>.
*/
- static const NfCurrencyEntry* GetCurrencyEntry( BOOL & bFoundBank,
+ static const NfCurrencyEntry* GetCurrencyEntry( sal_Bool & bFoundBank,
const String& rSymbol, const String& rExtension,
- LanguageType eFormatLanguage, BOOL bOnlyStringLanguage = FALSE );
+ LanguageType eFormatLanguage, sal_Bool bOnlyStringLanguage = sal_False );
/// Get compatibility ("automatic" old style) currency from I18N locale data
void GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const;
@@ -794,7 +794,7 @@ public:
/** Return a keyword for a language/country and <type>NfKeywordIndex</type>
for XML import, to generate number format strings. */
- String GetKeyword( LanguageType eLnge, USHORT nIndex );
+ String GetKeyword( LanguageType eLnge, sal_uInt16 nIndex );
/** Return the GENERAL keyword in proper case ("General") for a
language/country, used in XML import */
@@ -824,7 +824,7 @@ private:
LanguageType IniLnge; // Initialized setting language/country
LanguageType ActLnge; // Current setting language/country
NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation
- BOOL bNoZero; // Zero value suppression
+ sal_Bool bNoZero; // Zero value suppression
// cached locale data items needed almost any time
String aDecimalSep;
@@ -833,8 +833,8 @@ private:
#ifdef _ZFORLIST_CXX // ----- private Methoden -----
- SVL_DLLPRIVATE static BOOL bCurrencyTableInitialized;
- SVL_DLLPRIVATE static USHORT nSystemCurrencyPosition;
+ SVL_DLLPRIVATE static sal_Bool bCurrencyTableInitialized;
+ SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition;
SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry;
// get the registry, create one if none exists
@@ -845,29 +845,29 @@ private:
// Changes initialized language/country, clears the entries and generates
// new ones, may ONLY be called by the binary file format load
- SVL_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 );
+ SVL_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, sal_Bool bLoadingSO5 );
// Generate builtin formats provided by i18n behind CLOffset,
- // if bLoadingSO5==FALSE also generate additional i18n formats.
- SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO5 );
+ // if bLoadingSO5==sal_False also generate additional i18n formats.
+ SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadingSO5 );
// Generate additional formats provided by i18n
SVL_DLLPRIVATE void ImpGenerateAdditionalFormats(
sal_uInt32 CLOffset,
NumberFormatCodeWrapper& rNumberFormatCode,
- BOOL bAfterLoadingSO5 );
+ sal_Bool bAfterLoadingSO5 );
SVL_DLLPRIVATE SvNumberformat* ImpInsertFormat(
const ::com::sun::star::i18n::NumberFormatCode& rCode,
sal_uInt32 nPos,
- BOOL bAfterLoadingSO5 = FALSE,
+ sal_Bool bAfterLoadingSO5 = sal_False,
sal_Int16 nOrgIndex = 0 );
// ImpInsertNewStandardFormat for new (since version ...) builtin formats
SVL_DLLPRIVATE SvNumberformat* ImpInsertNewStandardFormat(
const ::com::sun::star::i18n::NumberFormatCode& rCode,
sal_uInt32 nPos,
- USHORT nVersion,
- BOOL bAfterLoadingSO5 = FALSE,
+ sal_uInt16 nVersion,
+ sal_Bool bAfterLoadingSO5 = sal_False,
sal_Int16 nOrgIndex = 0 );
// Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country
@@ -880,7 +880,7 @@ private:
LanguageType eLnge );
// Create builtin formats for language/country if necessary, return CLOffset
- SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, BOOL bLoadingSO5 = FALSE );
+ SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, sal_Bool bLoadingSO5 = sal_False );
// Build negative currency format, old compatibility style
SVL_DLLPRIVATE void ImpGetNegCurrFormat( String& sNegStr, const String& rCurrSymbol );
@@ -917,16 +917,16 @@ private:
// FormatElement group.
SVL_DLLPRIVATE sal_Int32 ImpAdjustFormatCodeDefault(
::com::sun::star::i18n::NumberFormatCode * pFormatArr,
- sal_Int32 nCount, BOOL bCheckCorrectness = TRUE
+ sal_Int32 nCount, sal_Bool bCheckCorrectness = sal_True
);
// used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry()
#ifndef DBG_UTIL
inline
#endif
- static BOOL ImpLookupCurrencyEntryLoopBody(
- const NfCurrencyEntry*& pFoundEntry, BOOL& bFoundBank,
- const NfCurrencyEntry* pData, USHORT nPos, const String& rSymbol );
+ static sal_Bool ImpLookupCurrencyEntryLoopBody(
+ const NfCurrencyEntry*& pFoundEntry, sal_Bool& bFoundBank,
+ const NfCurrencyEntry* pData, sal_uInt16 nPos, const String& rSymbol );
// link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method>
DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* );
@@ -1009,15 +1009,15 @@ inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) cons
return pU ? *pU : nOldFmt;
}
-inline BOOL SvNumberFormatter::HasMergeFmtTbl() const
+inline sal_Bool SvNumberFormatter::HasMergeFmtTbl() const
{
return pMergeTable && (0 != pMergeTable->Count());
}
// static
-inline USHORT SvNumberFormatter::ExpandTwoDigitYear(
- USHORT nYear, USHORT nTwoDigitYearStart )
+inline sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear(
+ sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart )
{
if ( nYear < 100 )
{
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index a4222a4757c9..aa84528b96d5 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -79,16 +79,16 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo
{
String* sStrArray; // Array of symbols
short* nTypeArray; // Array of infos
- USHORT nThousand; // Count of group separator sequences
- USHORT nCntPre; // Count of digits before decimal point
- USHORT nCntPost; // Count of digits after decimal point
- USHORT nCntExp; // Count of exponent digits, or AM/PM
+ sal_uInt16 nThousand; // Count of group separator sequences
+ sal_uInt16 nCntPre; // Count of digits before decimal point
+ sal_uInt16 nCntPost; // Count of digits after decimal point
+ sal_uInt16 nCntExp; // Count of exponent digits, or AM/PM
short eScannedType; // Type determined by scan
- BOOL bThousand; // Has group (AKA thousand) separator
+ sal_Bool bThousand; // Has group (AKA thousand) separator
- void Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz );
- void Load(SvStream& rStream, USHORT nAnz);
- void Save(SvStream& rStream, USHORT nAnz) const;
+ void Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz );
+ void Load(SvStream& rStream, sal_uInt16 nAnz);
+ void Save(SvStream& rStream, sal_uInt16 nAnz) const;
};
// NativeNumber, represent numbers using CJK or other digits if nNum>0,
@@ -96,32 +96,32 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo
class SvNumberNatNum
{
LanguageType eLang;
- BYTE nNum;
- BOOL bDBNum :1; // DBNum, to be converted to NatNum
- BOOL bDate :1; // Used in date? (needed for DBNum/NatNum mapping)
- BOOL bSet :1; // If set, since NatNum0 is possible
+ sal_uInt8 nNum;
+ sal_Bool bDBNum :1; // DBNum, to be converted to NatNum
+ sal_Bool bDate :1; // Used in date? (needed for DBNum/NatNum mapping)
+ sal_Bool bSet :1; // If set, since NatNum0 is possible
public:
- static BYTE MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate );
- static BYTE MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate );
+ static sal_uInt8 MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate );
+ static sal_uInt8 MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate );
SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0),
bDBNum(0), bDate(0), bSet(0) {}
- BOOL IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; }
- BYTE GetRawNum() const { return nNum; }
- BYTE GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; }
- BYTE GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); }
+ sal_Bool IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; }
+ sal_uInt8 GetRawNum() const { return nNum; }
+ sal_uInt8 GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; }
+ sal_uInt8 GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); }
LanguageType GetLang() const { return eLang; }
void SetLang( LanguageType e ) { eLang = e; }
- void SetNum( BYTE nNumber, BOOL bDBNumber )
+ void SetNum( sal_uInt8 nNumber, sal_Bool bDBNumber )
{
nNum = nNumber;
bDBNum = bDBNumber;
- bSet = TRUE;
+ bSet = sal_True;
}
- BOOL IsSet() const { return bSet; }
- void SetDate( BOOL bDateP ) { bDate = (bDateP != 0); }
+ sal_Bool IsSet() const { return bSet; }
+ void SetDate( sal_Bool bDateP ) { bDate = (bDateP != 0); }
};
class CharClass;
@@ -132,7 +132,7 @@ public:
ImpSvNumFor(); // Ctor without filling the Info
~ImpSvNumFor();
- void Enlarge(USHORT nAnz); // Init of arrays to the right size
+ void Enlarge(sal_uInt16 nAnz); // Init of arrays to the right size
void Load( SvStream& rStream, ImpSvNumberformatScan& rSc,
String& rLoadedColorName);
void Save( SvStream& rStream ) const;
@@ -145,7 +145,7 @@ public:
const ImpSvNumberformatInfo& Info() const { return aI; }
// Get count of substrings (symbols)
- USHORT GetCount() const { return nAnzStrings;}
+ sal_uInt16 GetCount() const { return nAnzStrings;}
Color* GetColor() const { return pColor; }
void SetColor( Color* pCol, String& rName )
@@ -153,22 +153,22 @@ public:
const String& GetColorName() const { return sColorName; }
// new SYMBOLTYPE_CURRENCY in subformat?
- BOOL HasNewCurrency() const;
- BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
+ sal_Bool HasNewCurrency() const;
+ sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
void SaveNewCurrencyMap( SvStream& rStream ) const;
void LoadNewCurrencyMap( SvStream& rStream );
// [NatNum1], [NatNum2], ...
- void SetNatNumNum( BYTE nNum, BOOL bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); }
+ void SetNatNumNum( sal_uInt8 nNum, sal_Bool bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); }
void SetNatNumLang( LanguageType eLang ) { aNatNum.SetLang( eLang ); }
- void SetNatNumDate( BOOL bDate ) { aNatNum.SetDate( bDate ); }
+ void SetNatNumDate( sal_Bool bDate ) { aNatNum.SetDate( bDate ); }
const SvNumberNatNum& GetNatNum() const { return aNatNum; }
private:
ImpSvNumberformatInfo aI; // Hilfsstruct fuer die restlichen Infos
String sColorName; // color name
Color* pColor; // pointer to color of subformat
- USHORT nAnzStrings; // count of symbols
+ sal_uInt16 nAnzStrings; // count of symbols
SvNumberNatNum aNatNum; // DoubleByteNumber
};
@@ -197,7 +197,7 @@ public:
ImpSvNumberInputScan* pISc,
xub_StrLen& nCheckPos,
LanguageType& eLan,
- BOOL bStand = FALSE );
+ sal_Bool bStand = sal_False );
// Copy ctor
SvNumberformat( SvNumberformat& rFormat );
@@ -215,16 +215,16 @@ public:
void SetType(const short eSetType) { eType = eSetType; }
// Standard means the I18N defined standard format of this type
- void SetStandard() { bStandard = TRUE; }
- BOOL IsStandard() const { return bStandard; }
+ void SetStandard() { bStandard = sal_True; }
+ sal_Bool IsStandard() const { return bStandard; }
// For versions before version nVer it is UserDefined, for newer versions
// it is builtin. nVer of SV_NUMBERFORMATTER_VERSION_...
- void SetNewStandardDefined( USHORT nVer )
+ void SetNewStandardDefined( sal_uInt16 nVer )
{ nNewStandardDefined = nVer; eType |= NUMBERFORMAT_DEFINED; }
- USHORT GetNewStandardDefined() const { return nNewStandardDefined; }
- BOOL IsAdditionalStandardDefined() const
+ sal_uInt16 GetNewStandardDefined() const { return nNewStandardDefined; }
+ sal_Bool IsAdditionalStandardDefined() const
{ return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; }
LanguageType GetLanguage() const { return maLocale.meLanguage;}
@@ -234,12 +234,12 @@ public:
// Build a format string of application defined keywords
String GetMappedFormatstring( const NfKeywordTable& rKeywords,
const LocaleDataWrapper& rLoc,
- BOOL bDontQuote = FALSE ) const;
+ sal_Bool bDontQuote = sal_False ) const;
- void SetUsed(const BOOL b) { bIsUsed = b; }
- BOOL GetUsed() const { return bIsUsed; }
- BOOL IsStarFormatSupported() const { return bStarFlag; }
- void SetStarFormatSupport( BOOL b ) { bStarFlag = b; }
+ void SetUsed(const sal_Bool b) { bIsUsed = b; }
+ sal_Bool GetUsed() const { return bIsUsed; }
+ sal_Bool IsStarFormatSupported() const { return bStarFlag; }
+ void SetStarFormatSupport( sal_Bool b ) { bStarFlag = b; }
NfHackConversion Load( SvStream& rStream, ImpSvNumMultipleReadHeader& rHdr,
SvNumberFormatter* pConverter, ImpSvNumberInputScan& rISc );
@@ -255,54 +255,54 @@ public:
*/
bool GetOutputString( double fNumber, sal_uInt16 nCharCount, String& rOutString ) const;
- BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor );
- BOOL GetOutputString( String& sString, String& OutString, Color** ppColor );
+ sal_Bool GetOutputString( double fNumber, String& OutString, Color** ppColor );
+ sal_Bool GetOutputString( String& sString, String& OutString, Color** ppColor );
// True if type text
- BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
+ sal_Bool IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
// True if 4th subformat present
- BOOL HasTextFormat() const
+ sal_Bool HasTextFormat() const
{
return (NumFor[3].GetCount() > 0) ||
(NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT);
}
- void GetFormatSpecialInfo(BOOL& bThousand,
- BOOL& IsRed,
- USHORT& nPrecision,
- USHORT& nAnzLeading) const;
+ void GetFormatSpecialInfo(sal_Bool& bThousand,
+ sal_Bool& IsRed,
+ sal_uInt16& nPrecision,
+ sal_uInt16& nAnzLeading) const;
/// Count of decimal precision
- USHORT GetFormatPrecision() const { return NumFor[0].Info().nCntPost; }
+ sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; }
- //! Read/write access on a special USHORT component, may only be used on the
+ //! Read/write access on a special sal_uInt16 component, may only be used on the
//! standard format 0, 5000, ... and only by the number formatter!
- USHORT GetLastInsertKey() const
+ sal_uInt16 GetLastInsertKey() const
{ return NumFor[0].Info().nThousand; }
- void SetLastInsertKey(USHORT nKey)
+ void SetLastInsertKey(sal_uInt16 nKey)
{ NumFor[0].Info().nThousand = nKey; }
//! Only onLoad: convert from stored to current system language/country
void ConvertLanguage( SvNumberFormatter& rConverter,
- LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem = FALSE );
+ LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem = sal_False );
// Substring of a subformat code nNumFor (0..3)
// nPos == 0xFFFF => last substring
- // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
- const String* GetNumForString( USHORT nNumFor, USHORT nPos,
- BOOL bString = FALSE ) const;
+ // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
+ const String* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos,
+ sal_Bool bString = sal_False ) const;
// Subtype of a subformat code nNumFor (0..3)
// nPos == 0xFFFF => last substring
- // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
- short GetNumForType( USHORT nNumFor, USHORT nPos, BOOL bString = FALSE ) const;
+ // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
+ short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, sal_Bool bString = sal_False ) const;
/** If the count of string elements (substrings, ignoring [modifiers] and
so on) in a subformat code nNumFor (0..3) is equal to the given number.
Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched
format. */
- BOOL IsNumForStringElementCountEqual( USHORT nNumFor, USHORT nAllCount,
- USHORT nNumCount ) const
+ sal_Bool IsNumForStringElementCountEqual( sal_uInt16 nNumFor, sal_uInt16 nAllCount,
+ sal_uInt16 nNumCount ) const
{
if ( nNumFor < 4 )
{
@@ -311,19 +311,19 @@ public:
// strings of the format were matched and not just the starting
// sequence, so we don't have to check if GetnAnz() includes
// [modifiers] or anything else if both counts are equal.
- USHORT nCnt = NumFor[nNumFor].GetCount();
+ sal_uInt16 nCnt = NumFor[nNumFor].GetCount();
if ( nAllCount == nCnt )
- return TRUE;
+ return sal_True;
if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on
return ImpGetNumForStringElementCount( nNumFor ) ==
(nAllCount - nNumCount);
}
- return FALSE;
+ return sal_False;
}
// Whether the second subformat code is really for negative numbers
// or another limit set.
- BOOL IsNegativeRealNegative() const
+ sal_Bool IsNegativeRealNegative() const
{
return fLimit1 == 0.0 && fLimit2 == 0.0 &&
( (eOp1 == NUMBERFORMAT_OP_GE && eOp2 == NUMBERFORMAT_OP_NO) ||
@@ -332,41 +332,41 @@ public:
}
// Whether the negative format is without a sign or not
- BOOL IsNegativeWithoutSign() const;
+ sal_Bool IsNegativeWithoutSign() const;
- BOOL IsNegativeInBracket() const;
+ sal_Bool IsNegativeInBracket() const;
- BOOL HasPositiveBracketPlaceholder() const;
+ sal_Bool HasPositiveBracketPlaceholder() const;
// Whether a new SYMBOLTYPE_CURRENCY is contained in the format
- BOOL HasNewCurrency() const;
+ sal_Bool HasNewCurrency() const;
// Build string from NewCurrency for saving it SO50 compatible
void Build50Formatstring( String& rStr ) const;
// strip [$-yyy] from all [$xxx-yyy] leaving only xxx's,
- // if bQuoteSymbol==TRUE the xxx will become "xxx"
+ // if bQuoteSymbol==sal_True the xxx will become "xxx"
static String StripNewCurrencyDelimiters( const String& rStr,
- BOOL bQuoteSymbol );
+ sal_Bool bQuoteSymbol );
// If a new SYMBOLTYPE_CURRENCY is contained if the format is of type
// NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn
// of [$xxx-nnn] are returned
- BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
+ sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
- static BOOL HasStringNegativeSign( const String& rStr );
+ static sal_Bool HasStringNegativeSign( const String& rStr );
/**
Whether a character at position nPos is somewhere between two matching
cQuote or not.
- If nPos points to a cQuote, a TRUE is returned on an opening cQuote,
- a FALSE is returned on a closing cQuote.
+ If nPos points to a cQuote, a sal_True is returned on an opening cQuote,
+ a sal_False is returned on a closing cQuote.
A cQuote between quotes may be escaped by a cEscIn, a cQuote outside of
quotes may be escaped by a cEscOut.
The default '\0' results in no escapement possible.
Defaults are set right according to the "unlogic" of the Numberformatter
*/
- static BOOL IsInQuote( const String& rString, xub_StrLen nPos,
+ static sal_Bool IsInQuote( const String& rString, xub_StrLen nPos,
sal_Unicode cQuote = '"',
sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' );
@@ -418,23 +418,23 @@ public:
// used in XML export
void GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1,
SvNumberformatLimitOps& rOper2, double& rVal2 ) const;
- Color* GetColor( USHORT nNumFor ) const;
- void GetNumForInfo( USHORT nNumFor, short& rScannedType,
- BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const;
+ Color* GetColor( sal_uInt16 nNumFor ) const;
+ void GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType,
+ sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const;
// rAttr.Number not empty if NatNum attributes are to be stored
void GetNatNumXml(
::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr,
- USHORT nNumFor ) const;
+ sal_uInt16 nNumFor ) const;
/** @returns <TRUE/> if E,EE,R,RR,AAA,AAAA in format code of subformat
nNumFor (0..3) and <b>no</b> preceding calendar was specified and the
currently loaded calendar is "gregorian". */
- BOOL IsOtherCalendar( USHORT nNumFor ) const
+ sal_Bool IsOtherCalendar( sal_uInt16 nNumFor ) const
{
if ( nNumFor < 4 )
return ImpIsOtherCalendar( NumFor[nNumFor] );
- return FALSE;
+ return sal_False;
}
/** Switches to the first non-"gregorian" calendar, but only if the current
@@ -456,13 +456,13 @@ public:
<TRUE/> if a calendar was specified and switched to,
<FALSE/> else.
*/
- BOOL SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime,
- USHORT nNumFor ) const
+ sal_Bool SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime,
+ sal_uInt16 nNumFor ) const
{
if ( nNumFor < 4 )
return ImpSwitchToSpecifiedCalendar( rOrgCalendar,
fOrgDateTime, NumFor[nNumFor] );
- return FALSE;
+ return sal_False;
}
private:
@@ -475,17 +475,17 @@ private:
LocaleType maLocale; // Language/country of the format, numeral shape and calendar type from Excel.
SvNumberformatLimitOps eOp1; // Operator for first condition
SvNumberformatLimitOps eOp2; // Operator for second condition
- USHORT nNewStandardDefined; // new builtin formats as of version 6
+ sal_uInt16 nNewStandardDefined; // new builtin formats as of version 6
short eType; // Type of format
- BOOL bStarFlag; // Take *n format as ESC n
- BOOL bStandard; // If this is a default standard format
- BOOL bIsUsed; // Flag as used for storing
+ sal_Bool bStarFlag; // Take *n format as ESC n
+ sal_Bool bStandard; // If this is a default standard format
+ sal_Bool bIsUsed; // Flag as used for storing
- SVL_DLLPRIVATE USHORT ImpGetNumForStringElementCount( USHORT nNumFor ) const;
+ SVL_DLLPRIVATE sal_uInt16 ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const;
- SVL_DLLPRIVATE BOOL ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const;
+ SVL_DLLPRIVATE sal_Bool ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const;
- SVL_DLLPRIVATE BOOL ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
+ SVL_DLLPRIVATE sal_Bool ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const;
#ifdef _ZFORMAT_CXX // ----- private implementation methods -----
@@ -542,25 +542,25 @@ private:
double& fLimit,
SvNumberformatLimitOps eOp);
- SVL_DLLPRIVATE ULONG ImpGGT(ULONG x, ULONG y);
- SVL_DLLPRIVATE ULONG ImpGGTRound(ULONG x, ULONG y);
+ SVL_DLLPRIVATE sal_uLong ImpGGT(sal_uLong x, sal_uLong y);
+ SVL_DLLPRIVATE sal_uLong ImpGGTRound(sal_uLong x, sal_uLong y);
// Helper function for number strings
// append string symbols, insert leading 0 or ' ', or ...
- SVL_DLLPRIVATE BOOL ImpNumberFill( String& sStr,
+ SVL_DLLPRIVATE sal_Bool ImpNumberFill( String& sStr,
double& rNumber,
xub_StrLen& k,
- USHORT& j,
- USHORT nIx,
+ sal_uInt16& j,
+ sal_uInt16 nIx,
short eSymbolType );
// Helper function to fill in the integer part and the group (AKA thousand) separators
- SVL_DLLPRIVATE BOOL ImpNumberFillWithThousands( String& sStr,
+ SVL_DLLPRIVATE sal_Bool ImpNumberFillWithThousands( String& sStr,
double& rNumber,
xub_StrLen k,
- USHORT j,
- USHORT nIx,
- USHORT nDigCnt );
+ sal_uInt16 j,
+ sal_uInt16 nIx,
+ sal_uInt16 nDigCnt );
// Hilfsfunktion zum Auffuellen der Vor-
// kommazahl auch mit Tausenderpunkt
@@ -569,18 +569,18 @@ private:
SVL_DLLPRIVATE void ImpDigitFill( String& sStr,
xub_StrLen nStart,
xub_StrLen& k,
- USHORT nIx,
+ sal_uInt16 nIx,
xub_StrLen & nDigitCount,
utl::DigitGroupingIterator & );
- SVL_DLLPRIVATE BOOL ImpGetDateOutput( double fNumber,
- USHORT nIx,
+ SVL_DLLPRIVATE sal_Bool ImpGetDateOutput( double fNumber,
+ sal_uInt16 nIx,
String& OutString );
- SVL_DLLPRIVATE BOOL ImpGetTimeOutput( double fNumber,
- USHORT nIx,
+ SVL_DLLPRIVATE sal_Bool ImpGetTimeOutput( double fNumber,
+ sal_uInt16 nIx,
String& OutString );
- SVL_DLLPRIVATE BOOL ImpGetDateTimeOutput( double fNumber,
- USHORT nIx,
+ SVL_DLLPRIVATE sal_Bool ImpGetDateTimeOutput( double fNumber,
+ sal_uInt16 nIx,
String& OutString );
// Switches to the "gregorian" calendar if the current calendar is
@@ -588,7 +588,7 @@ private:
// know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and
// rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was
// empty the previous calendar name and date/time are returned.
- SVL_DLLPRIVATE BOOL ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime );
+ SVL_DLLPRIVATE sal_Bool ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime );
// Append a "G" short era string of the given calendar. In the case of a
// Gengou calendar this is a one character abbreviation, for other
@@ -596,8 +596,8 @@ private:
SVL_DLLPRIVATE static void ImpAppendEraG( String& OutString, const CalendarWrapper& rCal,
sal_Int16 nNatNum );
- SVL_DLLPRIVATE BOOL ImpGetNumberOutput( double fNumber,
- USHORT nIx,
+ SVL_DLLPRIVATE sal_Bool ImpGetNumberOutput( double fNumber,
+ sal_uInt16 nIx,
String& OutString );
SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat );
@@ -605,9 +605,9 @@ private:
// normal digits or other digits, depending on ImpSvNumFor.aNatNum,
// [NatNum1], [NatNum2], ...
SVL_DLLPRIVATE String ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal,
- USHORT nMinDigits = 0 ) const;
+ sal_uInt16 nMinDigits = 0 ) const;
- String ImpIntToString( USHORT nIx, sal_Int32 nVal, USHORT nMinDigits = 0 ) const
+ String ImpIntToString( sal_uInt16 nIx, sal_Int32 nVal, sal_uInt16 nMinDigits = 0 ) const
{
const SvNumberNatNum& rNum = NumFor[nIx].GetNatNum();
if ( nMinDigits || rNum.IsComplete() )
diff --git a/svl/prj/build.lst b/svl/prj/build.lst
index 8d121c7a0cf1..1b88fab32810 100644
--- a/svl/prj/build.lst
+++ b/svl/prj/build.lst
@@ -1,23 +1,3 @@
-sl svl : l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot NULL
-sl svl usr1 - all svl_mkout NULL
-sl svl\inc nmake - all svl_inc NULL
-sl svl\unx\source\svdde nmake - u svl_usdde svl_inc NULL
-sl svl\unx\source\svdde nmake - p svl_psdde svl_inc NULL
-sl svl\source\config nmake - all svl_conf svl_inc NULL
-sl svl\source\filepicker nmake - all svl_filepick svl_inc NULL
-sl svl\source\filerec nmake - all svl_file svl_inc NULL
-sl svl\source\items nmake - all svl__item svl_inc NULL
-sl svl\source\memtools nmake - all svl_mem svl_inc NULL
-sl svl\source\misc nmake - all svl__misc svl_inc NULL
-sl svl\source\notify nmake - all svl_not svl_inc NULL
-sl svl\source\numbers nmake - all svl_num svl_inc NULL
-sl svl\source\svdde nmake - all svl__dde svl_inc NULL
-sl svl\source\svsql nmake - all svl_sql svl_inc NULL
-sl svl\source\undo nmake - all svl_undo svl_inc NULL
-sl svl\source\uno nmake - all svl_uno svl_inc NULL
-sl svl\util nmake - all svl_util svl_usdde.u svl_psdde.p svl_conf svl_filepick svl_file svl__item svl_mem svl__misc svl_not svl_num svl__dde svl_sql svl_undo svl_uno NULL
-sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL
-sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL
-sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL
-
-
+sl svl : L10N:l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL
+sl svl\prj nmake - all svl_prj NULL
+# sl svl\qa\unit nmake - all svl_qa_cppunit svl_util NULL
diff --git a/svl/prj/d.lst b/svl/prj/d.lst
index a5c2564e81cd..e69de29bb2d1 100644
--- a/svl/prj/d.lst
+++ b/svl/prj/d.lst
@@ -1,22 +0,0 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-mkdir: %COMMON_DEST%\res%_EXT%
-mkdir: %_DEST%\inc%_EXT%\svl
-
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\lib\isvl.lib %_DEST%\lib%_EXT%\isvl.lib
-..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*
-..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*
-..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*
-
-..\inc\svl\*.hrc %_DEST%\inc%_EXT%\svl\*.hrc
-..\inc\svl\*.hxx %_DEST%\inc%_EXT%\svl\*.hxx
-..\inc\svl\*.h %_DEST%\inc%_EXT%\svl\*.h
-..\inc\*.hrc %_DEST%\inc%_EXT%\svl\*.hrc
-..\inc\*.hxx %_DEST%\inc%_EXT%\svl\*.hxx
-..\inc\*.h %_DEST%\inc%_EXT%\svl\*.h
-
-dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\bmp=%__PRJROOT%\%__SRC%\bin%_EXT%; fi"
-
-*.xml %_DEST%\xml%_EXT%\*.xml
-
diff --git a/sot/util/makefile.pmk b/svl/prj/makefile.mk
index 2d79b8068815..e312a7ccab65 100644
--- a/sot/util/makefile.pmk
+++ b/svl/prj/makefile.mk
@@ -25,7 +25,16 @@
#
#*************************************************************************
-# define SOT_DLLIMPLEMENTATION (see @ = sotdllapi.h)
-CDEFS += -DSOT_DLLIMPLEMENTATION
+PRJ=..
+TARGET=prj
-VISIBILITY_HIDDEN=TRUE
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/svl/qa/complex/ConfigItems/CheckConfigItems.java b/svl/qa/complex/ConfigItems/CheckConfigItems.java
index 4afa2bf33f55..78141b6b20d4 100644
--- a/svl/qa/complex/ConfigItems/CheckConfigItems.java
+++ b/svl/qa/complex/ConfigItems/CheckConfigItems.java
@@ -27,20 +27,25 @@
package complex.ConfigItems;
-import com.sun.star.beans.*;
-import com.sun.star.lang.*;
-import com.sun.star.uno.*;
-import com.sun.star.task.*;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.task.XJob;
+import com.sun.star.uno.UnoRuntime;
-import complexlib.*;
-import java.lang.*;
-import java.util.*;
+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.*;
//-----------------------------------------------
/** @short todo document me
+ * @deprecated this tests seems no longer work as expected.
*/
-public class CheckConfigItems extends ComplexTestCase
+public class CheckConfigItems
{
//-------------------------------------------
// some const
@@ -64,43 +69,44 @@ public class CheckConfigItems extends ComplexTestCase
@return All test methods.
@todo Think about selection of tests from outside ...
*/
- public String[] getTestMethodNames()
- {
- return new String[]
- {
- "checkPicklist",
- "checkURLHistory",
- "checkHelpBookmarks",
- "checkPrintOptions",
- "checkAccessibilityOptions",
- "checkUserOptions"
- };
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]
+// {
+// "checkPicklist",
+// "checkURLHistory",
+// "checkHelpBookmarks",
+// "checkPrintOptions",
+// "checkAccessibilityOptions",
+// "checkUserOptions"
+// };
+// }
//-------------------------------------------
/** @short Create the environment for following tests.
- @descr Use either a component loader from desktop or
+ * @throws java.lang.Exception
+ * @descr Use either a component loader from desktop or
from frame
*/
- public void before()
+ @Before public void before()
throws java.lang.Exception
{
// get uno service manager from global test environment
- m_xSmgr = (XMultiServiceFactory)param.getMSF();
+ m_xSmgr = getMSF();
// TODO register helper service
// create module manager
- m_xTest = (XJob)UnoRuntime.queryInterface(
- XJob.class,
- m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
+ m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest"));
}
//-------------------------------------------
- /** @short close the environment.
+ /**
+ * @throws java.lang.Exception
+ * @short close the environment.
*/
- public void after()
+ @After public void after()
throws java.lang.Exception
{
// TODO deregister helper service
@@ -110,54 +116,66 @@ public class CheckConfigItems extends ComplexTestCase
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkPicklist()
+ @Test public void checkPicklist()
throws java.lang.Exception
{
impl_triggerTest("checkPicklist");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkURLHistory()
+ @Test public void checkURLHistory()
throws java.lang.Exception
{
impl_triggerTest("checkURLHistory");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkHelpBookmarks()
+ @Test public void checkHelpBookmarks()
throws java.lang.Exception
{
impl_triggerTest("checkHelpBookmarks");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkPrintOptions()
- throws java.lang.Exception
- {
- impl_triggerTest("checkPrintOptions");
- }
+// @Test public void checkPrintOptions()
+// throws java.lang.Exception
+// {
+// impl_triggerTest("checkPrintOptions");
+// }
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkAccessibilityOptions()
+ @Test public void checkAccessibilityOptions()
throws java.lang.Exception
{
impl_triggerTest("checkAccessibilityOptions");
}
//-------------------------------------------
- /** @todo document me
+ /**
+ * @throws java.lang.Exception
+ * @todo document me
*/
- public void checkUserOptions()
+ @Test public void checkUserOptions()
throws java.lang.Exception
{
impl_triggerTest("checkUserOptions");
@@ -175,4 +193,27 @@ public class CheckConfigItems extends ComplexTestCase
lArgs[0].Value = sTest;
m_xTest.execute(lArgs);
}
+
+
+ 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/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
index 3f44d5a8dd9c..e1883cc69f0d 100644
--- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
+++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx
@@ -27,8 +27,8 @@
************************************************************************/
#include "HistoryOptTest.hxx"
-#include "AccessibilityOptTest.hxx"
-#include "PrintOptTest.hxx"
+// #include "AccessibilityOptTest.hxx"
+// #include "PrintOptTest.hxx"
#include "UserOptTest.hxx"
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -51,8 +51,6 @@ static const ::rtl::OUString PROP_TEST (RTL_CONSTASCII_USTRINGP
static const ::rtl::OUString TEST_PICKLIST (RTL_CONSTASCII_USTRINGPARAM("checkPicklist"));
static const ::rtl::OUString TEST_URLHISTORY (RTL_CONSTASCII_USTRINGPARAM("checkURLHistory"));
static const ::rtl::OUString TEST_HELPBOOKMARKS (RTL_CONSTASCII_USTRINGPARAM("checkHelpBookmarks"));
-static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkAccessibilityOptions"));
-static const ::rtl::OUString TEST_PRINTOPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkPrintOptions"));
static const ::rtl::OUString TEST_USEROPTIONS (RTL_CONSTASCII_USTRINGPARAM("checkUserOptions"));
//=============================================================================
@@ -137,16 +135,16 @@ css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::be
HistoryOptTest aOptTest;
aOptTest.checkHelpBookmarks();
}
- else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS))
- {
- AccessibilityOptTest aOptTest;
- aOptTest.impl_checkAccessibilityOptions();
- }
- else if (sTest.equals(TEST_PRINTOPTIONS))
- {
- PrintOptTest aOptTest;
- aOptTest.impl_checkPrint();
- }
+// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS))
+// {
+// AccessibilityOptTest aOptTest;
+// aOptTest.impl_checkAccessibilityOptions();
+// }
+// else if (sTest.equals(TEST_PRINTOPTIONS))
+// {
+// PrintOptTest aOptTest;
+// aOptTest.impl_checkPrint();
+// }
else if (sTest.equals(TEST_USEROPTIONS))
{
UserOptTest aOptTest;
diff --git a/svl/qa/complex/ConfigItems/helper/makefile.mk b/svl/qa/complex/ConfigItems/helper/makefile.mk
deleted file mode 100644
index 17c7b81ae9c7..000000000000
--- a/svl/qa/complex/ConfigItems/helper/makefile.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..$/..$/..
-
-PRJNAME= svl
-TARGET= ConfigItemTest
-USE_DEFFILE= TRUE
-ENABLE_EXCEPTIONS= TRUE
-NO_BSYMBOLIC= TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Generate -----------------------------------------------------
-
-INCPOST += $(PRJ)$/source$/inc
-
-# --- light services library ----------------------------------------------------
-
-SHL1TARGET= svt_$(TARGET)
-
-SHL1OBJS= \
- $(SLO)$/UserOptTest.obj \
- $(SLO)$/PrintOptTest.obj \
- $(SLO)$/AccessibilityOptTest.obj \
- $(SLO)$/HistoryOptTest.obj \
- $(SLO)$/ConfigItemTest.obj
-
-SHL1STDLIBS= \
- $(SVLIB) \
- $(SVLLIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-SHL1VERSIONMAP= $(SOLARENV)/src/component.map
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk
deleted file mode 100644
index 6838cc79a660..000000000000
--- a/svl/qa/complex/ConfigItems/makefile.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = CheckConfigItems
-PRJNAME = svl
-PACKAGE = complex$/ConfigItems
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \
- OOoRunner.jar
-
-JAVAFILES = CheckConfigItems.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-SUBDIRS = helper
-
-#----- 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
-
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
-
-# start the runner application
-CT_APP = org.openoffice.Runner
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-RUN: run
-
-run:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
-
-
diff --git a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
index bf6159ee38c5..8e886f0b8269 100644
--- a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
+++ b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java
@@ -36,12 +36,16 @@ public class MasterPasswdHandler extends WeakBase
XInteractionSupplyAuthentication xAuthentication = null;
for( int i = 0; i < xContinuations.length; ++i ) {
- xAuthentication = (XInteractionSupplyAuthentication)UnoRuntime.queryInterface( XInteractionSupplyAuthentication.class, xContinuations[i]);
+ xAuthentication = UnoRuntime.queryInterface(XInteractionSupplyAuthentication.class, xContinuations[i]);
if( xAuthentication != null )
+ {
break;
+ }
}
if( xAuthentication.canSetPassword() )
- xAuthentication.setPassword( "abcdefghijklmnopqrstuvwxyz123456" );
+ {
+ xAuthentication.setPassword("abcdefghijklmnopqrstuvwxyz123456");
+ }
xAuthentication.select();
}
} else {
diff --git a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
index 2e3bada4d1bc..ac5c79d134dc 100644
--- a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
+++ b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java
@@ -27,47 +27,78 @@
package complex.passwordcontainer;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
-public class PasswordContainerUnitTest extends ComplexTestCase {
+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.*;
+
+public class PasswordContainerUnitTest {
private XMultiServiceFactory m_xMSF = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01",
- "ExecuteTest02",
- "ExecuteTest03"};
- }
- public String getTestObjectName() {
- return "PasswordContainerUnitTest";
- }
+//// public String[] getTestMethodNames() {
+//// return new String[] {
+//// "ExecuteTest01",
+//// "ExecuteTest02",
+//// "ExecuteTest03"};
+//// }
+// public String getTestObjectName() {
+// return "PasswordContainerUnitTest";
+// }
- public void before() {
+ @Before public void before() {
try {
- m_xMSF = (XMultiServiceFactory) param.getMSF();
+ m_xMSF = getMSF();
} catch (Exception e) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
if (m_xMSF == null) {
- failed ("Cannot create service factory!");
+ fail ("Cannot create service factory!");
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
}
- public void ExecuteTest01() {
- PasswordContainerTest aTest = new Test01(m_xMSF, log);
- assure("Test01 failed!", aTest.test());
+ @Test public void ExecuteTest01()
+ {
+ PasswordContainerTest aTest = new Test01(m_xMSF);
+ assertTrue("Test01 failed!", aTest.test());
}
- public void ExecuteTest02() {
- PasswordContainerTest aTest = new Test02(m_xMSF, log);
- assure("Test02 failed!", aTest.test());
+ @Test public void ExecuteTest02() {
+ PasswordContainerTest aTest = new Test02(m_xMSF);
+ assertTrue("Test02 failed!", aTest.test());
}
- public void ExecuteTest03() {
- PasswordContainerTest aTest = new Test03(m_xMSF, log);
- assure("Test03 failed!", aTest.test());
+ @Test public void ExecuteTest03() {
+ PasswordContainerTest aTest = new Test03(m_xMSF);
+ assertTrue("Test03 failed!", aTest.test());
}
+
+ 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/svl/qa/complex/passwordcontainer/Test01.java b/svl/qa/complex/passwordcontainer/Test01.java
index 1ca17c922669..9367fea4eb7b 100644
--- a/svl/qa/complex/passwordcontainer/Test01.java
+++ b/svl/qa/complex/passwordcontainer/Test01.java
@@ -36,17 +36,17 @@ import com.sun.star.task.XMasterPasswordHandling;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
public class Test01 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test01 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper ( "Test01: ");
}
public boolean test() {
@@ -68,9 +68,9 @@ public class Test01 implements PasswordContainerTest {
}
try {
Object oPasswordContainer = m_xMSF.createInstance( "com.sun.star.task.PasswordContainer" );
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance( "com.sun.star.task.InteractionHandler" );
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler( xHandler );
// add a set of users and passwords for the same URL for runtime
diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java
index b77b0fe9bf48..3d0123de3179 100644
--- a/svl/qa/complex/passwordcontainer/Test02.java
+++ b/svl/qa/complex/passwordcontainer/Test02.java
@@ -36,17 +36,16 @@ import com.sun.star.task.UserRecord;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
public class Test02 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test02 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test02: ");
+ m_aTestHelper = new TestHelper ( "Test02: ");
}
public boolean test() {
@@ -69,11 +68,11 @@ public class Test02 implements PasswordContainerTest {
try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
- XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
+ XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
// allow the storing of the passwords
xMHandling.allowPersistentStoring(true);
diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java
index 9e38a55893e0..cf2b3d45cbb0 100644
--- a/svl/qa/complex/passwordcontainer/Test03.java
+++ b/svl/qa/complex/passwordcontainer/Test03.java
@@ -36,17 +36,17 @@ import com.sun.star.task.XInteractionHandler;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+
public class Test03 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
- public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
+ public Test03 ( XMultiServiceFactory xMSF )
{
m_xMSF = xMSF;
- m_aTestHelper = new TestHelper (aLogWriter, "Test03: ");
+ m_aTestHelper = new TestHelper ( "Test03: ");
}
public boolean test() {
@@ -68,11 +68,11 @@ public class Test03 implements PasswordContainerTest {
try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
- XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
+ XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler");
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
- XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
+ XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
// allow the storing of the passwords
xMHandling.allowPersistentStoring(true);
diff --git a/svl/qa/complex/passwordcontainer/TestHelper.java b/svl/qa/complex/passwordcontainer/TestHelper.java
index 1971b61098f5..c91401e74c91 100644
--- a/svl/qa/complex/passwordcontainer/TestHelper.java
+++ b/svl/qa/complex/passwordcontainer/TestHelper.java
@@ -29,23 +29,23 @@ package complex.passwordcontainer;
import com.sun.star.task.UserRecord;
-import share.LogWriter;
+// import share.LogWriter;
public class TestHelper {
- LogWriter m_aLogWriter;
+ // LogWriter m_aLogWriter;
String m_sTestPrefix;
- public TestHelper( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
+ public TestHelper( String sTestPrefix ) {
+ // m_aLogWriter = aLogWriter;
m_sTestPrefix = sTestPrefix;
}
public void Error( String sError ) {
- m_aLogWriter.println( m_sTestPrefix + "Error: " + sError );
+ System.out.println( m_sTestPrefix + "Error: " + sError );
}
public void Message( String sMessage ) {
- m_aLogWriter.println( m_sTestPrefix + sMessage );
+ System.out.println( m_sTestPrefix + sMessage );
}
public boolean sameLists(UserRecord aUserList1[], UserRecord aUserList2[]) {
@@ -60,7 +60,9 @@ public class TestHelper {
int j;
for(j = 0; j < aUserList2.length; j++) {
if(!aUserList1[i].UserName.equals(aUserList2[j].UserName))
+ {
continue;
+ }
if(aUserList1[i].Passwords[0].equals(aUserList2[j].Passwords[0])) {
break;
}
diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk
deleted file mode 100644
index 57fd4d560f8d..000000000000
--- a/svl/qa/complex/passwordcontainer/makefile.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..$/..
-TARGET = PasswordContainerUnitTest
-PRJNAME=svl
-PACKAGE = complex$/passwordcontainer
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- PasswordContainerUnitTest.java\
- PasswordContainerTest.java\
- TestHelper.java\
- Test01.java\
- Test02.java\
- Test03.java\
- MasterPasswdHandler.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- 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
-
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
-
-# start the runner application
-CT_APP = org.openoffice.Runner
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE: target.mk
-
-RUN: run
-
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
-
diff --git a/svl/qa/makefile.mk b/svl/qa/makefile.mk
deleted file mode 100644
index ac79b7362f93..000000000000
--- a/svl/qa/makefile.mk
+++ /dev/null
@@ -1,91 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..
-PRJNAME=svl
-TARGET = qa
-
-ENABLE_EXCEPTIONS = true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-SHL1OBJS= \
- $(SLO)$/test_URIHelper.obj
-
-SHL1TARGET= URIHelper
-SHL1STDLIBS=\
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(SVLLIB) \
- $(TOOLSLIB) \
- $(UNOTOOLSLIB) \
- $(CPPUNITLIB)
-
-SHL1IMPLIB=i$(SHL1TARGET)
-DEF1NAME=$(SHL1TARGET)
-SHL1VERSIONMAP=export.map
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(OS)" == "WNT"
-my_file = file:///
-.ELSE
-my_file = file://
-.END
-
-ALLTAR: test
-
-$(MISC)$/$(TARGET)$/types.rdb .ERRREMOVE : $(SOLARBINDIR)$/types.rdb
- $(MKDIRHIER) $(@:d)
- $(GNUCOPY) $? $@
-
-$(MISC)/$(TARGET)/udkapi.rdb .ERRREMOVE : $(SOLARBINDIR)$/udkapi.rdb
- $(MKDIRHIER) $(@:d)
- $(GNUCOPY) $? $@
-
-#Make a services.rdb with the services we know we need to get up and running
-$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb makefile.mk
- $(MKDIRHIER) $(@:d)
- $(REGCOMP) -register -br $(MISC)/$(TARGET)/udkapi.rdb -r $@ -wop \
- -c $(DLLPRE)ucb1$(DLLPOST) \
- -c stocservices.uno$(DLLPOST)
-
-test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb $(MISC)$/$(TARGET)$/types.rdb $(MISC)/$(TARGET)/udkapi.rdb
- @echo ----------------------------------------------------------
- @echo - start unit test \#1 on library $(SHL1TARGETN)
- @echo ----------------------------------------------------------
- $(CPPUNITTESTER) $(SHL1TARGETN) -headless -invisible \
- -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \
- -env:UNO_TYPES="$(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/udkapi.rdb" \
- -env:OOO_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \
- -env:BRAND_BASE_DIR="$(my_file)$(PWD)/$(MISC)/$(TARGET)" \
- -env:UNO_USER_PACKAGES_CACHE="$(my_file)$(PWD)/$(MISC)/$(TARGET)"
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index 9a84199e366e..8ba0593b6c7f 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -203,7 +203,7 @@ sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang )
nLang = SvtSysLocale().GetLanguage();
sal_Int16 nScriptType = MsLangId::getScriptType( nLang );
- USHORT nScript;
+ sal_uInt16 nScript;
switch (nScriptType)
{
case ::com::sun::star::i18n::ScriptType::ASIAN:
diff --git a/svl/source/config/makefile.mk b/svl/source/config/makefile.mk
deleted file mode 100644
index beb696c0feaf..000000000000
--- a/svl/source/config/makefile.mk
+++ /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.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=config
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/asiancfg.obj \
- $(SLO)$/cjkoptions.obj \
- $(SLO)$/ctloptions.obj \
- $(SLO)$/srchcfg.obj \
- $(SLO)$/itemholder2.obj \
- $(SLO)$/languageoptions.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk
deleted file mode 100644
index a4c97ea41aa1..000000000000
--- a/svl/source/filepicker/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=filepicker
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------------
-
-SLOFILES =\
- $(SLO)$/pickerhelper.obj \
- $(SLO)$/pickerhistory.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx
deleted file mode 100644
index b241ea95492e..000000000000
--- a/svl/source/filepicker/pickerhelper.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-#include "pickerhelper.hxx"
-#include "rtl/ustring.hxx"
-#include "com/sun/star/ui/dialogs/XFilePicker.hpp"
-#include "com/sun/star/ui/dialogs/XFolderPicker.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertySetInfo.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "tools/debug.hxx"
-
-namespace css = com::sun::star;
-
-using css::uno::Reference;
-using rtl::OUString;
-
-namespace svt
-{
- void SetDialogHelpId(
- Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- OSL_FAIL( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-
- void SetDialogHelpId(
- Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId )
- {
- try
- {
- // does the dialog haver a help URL property?
- Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY );
- Reference< css::beans::XPropertySetInfo > xInfo;
- if( xDialogProps.is() )
- xInfo = xDialogProps->getPropertySetInfo( );
-
- const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) );
-
- if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) )
- { // yep
- OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- sId += OUString::valueOf( _nHelpId );
- xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) );
- }
- }
- catch( const css::uno::Exception& )
- {
- OSL_FAIL( "svt::SetDialogHelpId(): caught an exception while setting the help id!" );
- }
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/filepicker/pickerhistory.cxx b/svl/source/filepicker/pickerhistory.cxx
index 0ccbaa94d6bc..75cd4bc9b48d 100644
--- a/svl/source/filepicker/pickerhistory.cxx
+++ b/svl/source/filepicker/pickerhistory.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "pickerhistory.hxx"
-#include "pickerhistoryaccess.hxx"
+#include <svl/pickerhistory.hxx>
+#include <svl/pickerhistoryaccess.hxx>
#include <cppuhelper/weakref.hxx>
#include <vector>
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index e8f4b05603ad..def16ac62d8b 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -33,12 +33,12 @@
//========================================================================
-SV_IMPL_VARARR( SfxUINT32s, UINT32 );
+SV_IMPL_VARARR( SfxUINT32s, sal_uInt32 );
//========================================================================
-/* Die folgenden Makros extrahieren Teilbereiche aus einem UINT32 Wert.
- Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt,
+/* Die folgenden Makros extrahieren Teilbereiche aus einem sal_uInt32 Wert.
+ Diese sal_uInt32-Werte werden anstelle der einzelnen Werte gestreamt,
um Calls zu sparen.
*/
@@ -53,33 +53,33 @@ SV_IMPL_VARARR( SfxUINT32s, UINT32 );
//-------------------------------------------------------------------------
-/* Die folgenden Makros setzen Teilbereiche zu einem UINT32 Wert zusammen.
- Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt,
+/* Die folgenden Makros setzen Teilbereiche zu einem sal_uInt32 Wert zusammen.
+ Diese sal_uInt32-Werte werden anstelle der einzelnen Werte gestreamt,
um Calls zu sparen.
*/
#define SFX_REC_MINI_HEADER(nPreTag,nStartPos,nEndPos) \
- ( UINT32(nPreTag) | \
- UINT32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 )
+ ( sal_uInt32(nPreTag) | \
+ sal_uInt32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 )
#define SFX_REC_HEADER(nRecType,nContentTag,nContentVer) \
- ( UINT32(nRecType) | \
- ( UINT32(nContentVer) << 8 ) | \
- ( UINT32(nContentTag) << 16 ) )
+ ( sal_uInt32(nRecType) | \
+ ( sal_uInt32(nContentVer) << 8 ) | \
+ ( sal_uInt32(nContentTag) << 16 ) )
#define SFX_REC_CONTENT_HEADER(nContentVer,n1StStartPos,nCurStartPos) \
- ( UINT32(nContentVer) | \
- UINT32( nCurStartPos - n1StStartPos ) << 8 )
+ ( sal_uInt32(nContentVer) | \
+ sal_uInt32( nCurStartPos - n1StStartPos ) << 8 )
//=========================================================================
-UINT32 SfxMiniRecordWriter::Close
+sal_uInt32 SfxMiniRecordWriter::Close
(
- bool bSeekToEndOfRec /* TRUE (default)
+ bool bSeekToEndOfRec /* true (default)
Der Stream wird an das Ende des Records
positioniert.
- FALSE
+ false
Der Stream wird an den Anfang des
Contents (also hinter den Header)
positioniert.
@@ -96,9 +96,9 @@ UINT32 SfxMiniRecordWriter::Close
[R"uckgabewert]
- UINT32 != 0
+ sal_uInt32 != 0
Position im Stream, die direkt hinter dem Record liegt.
- 'bSeekToEndOfRecord==TRUE'
+ 'bSeekToEndOfRecord==sal_True'
=> R"uckgabewert == aktuelle Stream-Position nach Aufruf
== 0
@@ -110,7 +110,7 @@ UINT32 SfxMiniRecordWriter::Close
if ( !_bHeaderOk )
{
// Header an den Anfang des Records schreiben
- UINT32 nEndPos = _pStream->Tell();
+ sal_uInt32 nEndPos = _pStream->Tell();
_pStream->Seek( _nStartPos );
*_pStream << SFX_REC_MINI_HEADER( _nPreTag, _nStartPos, nEndPos );
@@ -129,7 +129,7 @@ UINT32 SfxMiniRecordWriter::Close
//=========================================================================
-USHORT SfxMiniRecordReader::ScanRecordType
+sal_uInt16 SfxMiniRecordReader::ScanRecordType
(
SvStream* pStream /* <SvStream> an dessen aktueller Position
ein Record liegt, dessen Typ erkannt werden
@@ -159,7 +159,7 @@ USHORT SfxMiniRecordReader::ScanRecordType
[R"uckgabewert]
- USHORT SFX_REC_TYPE_EOR
+ sal_uInt16 SFX_REC_TYPE_EOR
An der aktuellen Position des Streams
steht eine End-Of-Records-Kennung.
@@ -208,7 +208,7 @@ USHORT SfxMiniRecordReader::ScanRecordType
*pStream >> nHeader;
// k"onnte es sich um einen extended-Record handeln?
- USHORT nPreTag = sal::static_int_cast< USHORT >(SFX_REC_PRE(nHeader));
+ sal_uInt16 nPreTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_PRE(nHeader));
if ( SFX_REC_PRETAG_EXT == nPreTag )
{
// die n"achsten 4 Bytes als extended-Header lesen
@@ -218,7 +218,7 @@ USHORT SfxMiniRecordReader::ScanRecordType
pStream->SeekRel(-8);
// liegt eine g"ultige Record-Kennung vor?
- USHORT nType = sal::static_int_cast< USHORT >(SFX_REC_TYP(nHeader));
+ sal_uInt16 nType = sal::static_int_cast< sal_uInt16 >(SFX_REC_TYP(nHeader));
if ( nType >= SFX_REC_TYPE_FIRST && nType <= SFX_REC_TYPE_LAST )
// entsprechenden extended-Record-Typ zur"uckliefern
return nType;
@@ -235,7 +235,7 @@ USHORT SfxMiniRecordReader::ScanRecordType
return nPreTag;
// liegt ein Drawin-Engine-Record vor?
- if ( nHeader == UINT32(*"DRMD") || nHeader == UINT32(*"DRVW") )
+ if ( nHeader == sal_uInt32(*"DRMD") || nHeader == sal_uInt32(*"DRVW") )
return SFX_REC_TYPE_DRAWENG;
// alle anderen sind grunds"atzlich g"ultige Mini-Records
@@ -244,13 +244,13 @@ USHORT SfxMiniRecordReader::ScanRecordType
//-------------------------------------------------------------------------
-bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader )
+bool SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader )
/* [Beschreibung]
Interne Methode zum nachtr"aglichen Verarbeiten eines extern gelesenen
Headers. Falls der Header eine End-Of-Records-Kennung darstellt,
- wird am Stream ein Errorcode gesetzt und FALSE zur"uckgeliefert. Im
+ wird am Stream ein Errorcode gesetzt und sal_False zur"uckgeliefert. Im
Fehlerfall wird der Stream jedoch nicht auf den Record-Anfang zur"uck-
gesetzt.
*/
@@ -260,7 +260,7 @@ bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader )
// Record-Ende und Pre-Tag aus dem Header ermitteln
_nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader);
- _nPreTag = sal::static_int_cast< BYTE >(SFX_REC_PRE(nHeader));
+ _nPreTag = sal::static_int_cast< sal_uInt8 >(SFX_REC_PRE(nHeader));
// wenn End-Of-Record-Kennung, dann Fehler
if ( _nPreTag == SFX_REC_PRETAG_EOR )
@@ -293,12 +293,12 @@ SfxMiniRecordReader::SfxMiniRecordReader
*/
: _pStream( pStream ),
- _bSkipped( FALSE )
+ _bSkipped( sal_False )
{
// Header einlesen
- UINT32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken
+ sal_uInt32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken
DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) );
- UINT32 nHeader;
+ sal_uInt32 nHeader;
*pStream >> nHeader;
// Headerdaten extrahieren
@@ -321,7 +321,7 @@ SfxMiniRecordReader::SfxMiniRecordReader
Position sich ein <SfxMiniRecord>
befindet.
*/
- BYTE nTag // Pre-Tag des gew"unschten Records
+ sal_uInt8 nTag // Pre-Tag des gew"unschten Records
)
/* [Beschreibung]
@@ -334,13 +334,13 @@ SfxMiniRecordReader::SfxMiniRecordReader
Wird das Ende des Streams oder die Kennung SFX_REC_PRETAG_EOR
erreicht, bevor ein Record mit dem ge"unschten Pre-Tag gefunden wird,
- ist die erzeugte Instanz ung"ultig ('IsValid() == FALSE'). Ein ent-
+ ist die erzeugte Instanz ung"ultig ('IsValid() == sal_False'). Ein ent-
sprechender Error-Code (ERRCODE_IO_EOF bzw. ERRCODE_IO_WRONGFORMAT)
ist dann am Stream gesetzt, dessen Position ist dann au\serdem unver-
"andert.
Bei 'nTag==SFX_FILEREC_PRETAG_EOR' wird nicht versucht, einen Record
- zu lesen, es wird sofort 'IsValid()' auf FALSE gesetzt und kein Error-Code
+ zu lesen, es wird sofort 'IsValid()' auf sal_False gesetzt und kein Error-Code
am Stream gesetzt. Dies ist dauzu gedacht, ohne 'new' und 'delete'
abw"rtskompatibel SfxMiniRecords einbauen zu k"onnen. Siehe dazu
<SfxItemSet::Load()>.
@@ -368,14 +368,14 @@ SfxMiniRecordReader::SfxMiniRecordReader
}
// StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
- UINT32 nStartPos = pStream->Tell();
+ sal_uInt32 nStartPos = pStream->Tell();
// passenden Record suchen
- while(TRUE)
+ while(sal_True)
{
// Header lesen
DBG( DbgOutf( "SfxFileRec: searching record at %ul", pStream->Tell() ) );
- UINT32 nHeader;
+ sal_uInt32 nHeader;
*pStream >> nHeader;
// Headerdaten von Basisklasse extrahieren lassen
@@ -407,10 +407,10 @@ SfxMiniRecordReader::SfxMiniRecordReader
SfxSingleRecordWriter::SfxSingleRecordWriter
(
- BYTE nRecordType, // f"ur Subklassen
+ sal_uInt8 nRecordType, // f"ur Subklassen
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nContentTag, // Inhalts-Art-Kennung
- BYTE nContentVer // Inhalts-Versions-Kennung
+ sal_uInt16 nContentTag, // Inhalts-Art-Kennung
+ sal_uInt8 nContentVer // Inhalts-Versions-Kennung
)
/* [Beschreibung]
@@ -429,8 +429,8 @@ SfxSingleRecordWriter::SfxSingleRecordWriter
SfxSingleRecordWriter::SfxSingleRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nContentTag, // Inhalts-Art-Kennung
- BYTE nContentVer // Inhalts-Versions-Kennung
+ sal_uInt16 nContentTag, // Inhalts-Art-Kennung
+ sal_uInt8 nContentVer // Inhalts-Versions-Kennung
)
/* [Beschreibung]
@@ -451,9 +451,9 @@ SfxSingleRecordWriter::SfxSingleRecordWriter
SfxSingleRecordWriter::SfxSingleRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nContentTag, // Inhalts-Art-Kennung
- BYTE nContentVer, // Inhalts-Versions-Kennung
- UINT32 nContentSize // Gr"o\se des Inhalts in Bytes
+ sal_uInt16 nContentTag, // Inhalts-Art-Kennung
+ sal_uInt8 nContentVer, // Inhalts-Versions-Kennung
+ sal_uInt32 nContentSize // Gr"o\se des Inhalts in Bytes
)
/* [Beschreibung]
@@ -471,7 +471,7 @@ SfxSingleRecordWriter::SfxSingleRecordWriter
//=========================================================================
-inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes )
+inline bool SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes )
/* [Beschreibung]
@@ -485,7 +485,7 @@ inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes )
bool bRet;
// Basisklassen-Header einlesen
- UINT32 nHeader=0;
+ sal_uInt32 nHeader=0;
*_pStream >> nHeader;
if ( !SetHeader_Impl( nHeader ) )
bRet = false;
@@ -493,11 +493,11 @@ inline bool SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes )
{
// eigenen Header einlesen
*_pStream >> nHeader;
- _nRecordVer = sal::static_int_cast< BYTE >(SFX_REC_VER(nHeader));
- _nRecordTag = sal::static_int_cast< UINT16 >(SFX_REC_TAG(nHeader));
+ _nRecordVer = sal::static_int_cast< sal_uInt8 >(SFX_REC_VER(nHeader));
+ _nRecordTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_TAG(nHeader));
// falscher Record-Typ?
- _nRecordType = sal::static_int_cast< BYTE >(SFX_REC_TYP(nHeader));
+ _nRecordType = sal::static_int_cast< sal_uInt8 >(SFX_REC_TYP(nHeader));
bRet = 0 != ( nTypes & _nRecordType);
}
return bRet;
@@ -510,7 +510,7 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream )
{
// Startposition merken, um im Fehlerfall zur"uck-seeken zu k"onnen
#ifdef DBG_UTIL
- UINT32 nStartPos = pStream->Tell();
+ sal_uInt32 nStartPos = pStream->Tell();
DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) );
#endif
@@ -528,10 +528,10 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream )
//-------------------------------------------------------------------------
-SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag )
+SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag )
{
// StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
- UINT32 nStartPos = pStream->Tell();
+ sal_uInt32 nStartPos = pStream->Tell();
// richtigen Record suchen, ggf. Error-Code setzen und zur"uck-seeken
Construct_Impl( pStream );
@@ -547,8 +547,8 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag )
bool SfxSingleRecordReader::FindHeader_Impl
(
- UINT16 nTypes, // arithm. Veroderung erlaubter Record-Typen
- UINT16 nTag // zu findende Record-Art-Kennung
+ sal_uInt16 nTypes, // arithm. Veroderung erlaubter Record-Typen
+ sal_uInt16 nTag // zu findende Record-Art-Kennung
)
/* [Beschreibung]
@@ -558,18 +558,18 @@ bool SfxSingleRecordReader::FindHeader_Impl
gekennzeichnet ist.
Kann ein solcher Record nicht gefunden werden, wird am Stream ein
- Errorcode gesetzt, zur"uck-geseekt und FALSE zur"uckgeliefert.
+ Errorcode gesetzt, zur"uck-geseekt und sal_False zur"uckgeliefert.
*/
{
// StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
- UINT32 nStartPos = _pStream->Tell();
+ sal_uInt32 nStartPos = _pStream->Tell();
// richtigen Record suchen
while ( !_pStream->IsEof() )
{
// Header lesen
- UINT32 nHeader;
+ sal_uInt32 nHeader;
DBG( DbgOutf( "SfxFileRec: searching record at %ul", _pStream->Tell() ) );
*_pStream >> nHeader;
if ( !SetHeader_Impl( nHeader ) )
@@ -581,17 +581,17 @@ bool SfxSingleRecordReader::FindHeader_Impl
{
// Extended Header lesen
*_pStream >> nHeader;
- _nRecordTag = sal::static_int_cast< UINT16 >(SFX_REC_TAG(nHeader));
+ _nRecordTag = sal::static_int_cast< sal_uInt16 >(SFX_REC_TAG(nHeader));
// richtigen Record gefunden?
if ( _nRecordTag == nTag )
{
// gefundener Record-Typ passend?
- _nRecordType = sal::static_int_cast< BYTE >(
+ _nRecordType = sal::static_int_cast< sal_uInt8 >(
SFX_REC_TYP(nHeader));
if ( nTypes & _nRecordType )
// ==> gefunden
- return TRUE;
+ return sal_True;
// error => Such-Schleife abbrechen
break;
@@ -606,18 +606,18 @@ bool SfxSingleRecordReader::FindHeader_Impl
// Fehler setzen und zur"uck-seeken
_pStream->SetError( ERRCODE_IO_WRONGFORMAT );
_pStream->Seek( nStartPos );
- return FALSE;
+ return sal_False;
}
//=========================================================================
SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
(
- BYTE nRecordType, // Subklassen Record-Kennung
+ sal_uInt8 nRecordType, // Subklassen Record-Kennung
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nContentTag, // Content-Art-Kennung
- BYTE nContentVer, // Content-Versions-Kennung
- UINT32 // Gr"o\se jedes einzelnen Contents in Bytes
+ sal_uInt16 nContentTag, // Content-Art-Kennung
+ sal_uInt8 nContentVer, // Content-Versions-Kennung
+ sal_uInt32 // Gr"o\se jedes einzelnen Contents in Bytes
)
/* [Beschreibung]
@@ -637,9 +637,9 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nContentTag, // Content-Art-Kennung
- BYTE nContentVer, // Content-Versions-Kennung
- UINT32 // Gr"o\se jedes einzelnen Contents in Bytes
+ sal_uInt16 nContentTag, // Content-Art-Kennung
+ sal_uInt8 nContentVer, // Content-Versions-Kennung
+ sal_uInt32 // Gr"o\se jedes einzelnen Contents in Bytes
)
/* [Beschreibung]
@@ -658,7 +658,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
//------------------------------------------------------------------------
-UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec )
+sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec )
// siehe <SfxMiniRecordWriter>
@@ -667,7 +667,7 @@ UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec )
if ( !_bHeaderOk )
{
// Position hinter Record merken, um sie restaurieren zu k"onnen
- UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE );
+ sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( sal_False );
// gegen"uber SfxSingleRecord erweiterten Header schreiben
*_pStream << _nContentCount;
@@ -687,10 +687,10 @@ UINT32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec )
SfxMultiVarRecordWriter::SfxMultiVarRecordWriter
(
- BYTE nRecordType, // Record-Kennung der Subklasse
+ sal_uInt8 nRecordType, // Record-Kennung der Subklasse
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nRecordTag, // Gesamt-Art-Kennung
- BYTE nRecordVer // Gesamt-Versions-Kennung
+ sal_uInt16 nRecordTag, // Gesamt-Art-Kennung
+ sal_uInt8 nRecordVer // Gesamt-Versions-Kennung
)
/* [Beschreibung]
@@ -708,8 +708,8 @@ SfxMultiVarRecordWriter::SfxMultiVarRecordWriter
SfxMultiVarRecordWriter::SfxMultiVarRecordWriter
(
SvStream* pStream, // Stream, in dem der Record angelegt wird
- UINT16 nRecordTag, // Gesamt-Art-Kennung
- BYTE nRecordVer // Gesamt-Versions-Kennung
+ sal_uInt16 nRecordTag, // Gesamt-Art-Kennung
+ sal_uInt8 nRecordVer // Gesamt-Versions-Kennung
)
/* [Beschreibung]
@@ -783,7 +783,7 @@ void SfxMultiVarRecordWriter::NewContent()
//-------------------------------------------------------------------------
-UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec )
+sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec )
// siehe <SfxMiniRecordWriter>
@@ -796,24 +796,24 @@ UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec )
FlushContent_Impl();
// Content-Offset-Tabelle schreiben
- UINT32 nContentOfsPos = _pStream->Tell();
+ sal_uInt32 nContentOfsPos = _pStream->Tell();
//! darf man das so einr"ucken?
#if defined(OSL_LITENDIAN)
_pStream->Write( _aContentOfs.GetData(),
- sizeof(UINT32)*_nContentCount );
+ sizeof(sal_uInt32)*_nContentCount );
#else
- for ( USHORT n = 0; n < _nContentCount; ++n )
- *_pStream << UINT32(_aContentOfs[n]);
+ for ( sal_uInt16 n = 0; n < _nContentCount; ++n )
+ *_pStream << sal_uInt32(_aContentOfs[n]);
#endif
// SfxMultiFixRecordWriter::Close() "uberspringen!
- UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE );
+ sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( sal_False );
// eigenen Header schreiben
*_pStream << _nContentCount;
if ( SFX_REC_TYPE_VARSIZE_RELOC == _nPreTag ||
SFX_REC_TYPE_MIXTAGS_RELOC == _nPreTag )
- *_pStream << static_cast<UINT32>(nContentOfsPos - ( _pStream->Tell() + sizeof(UINT32) ));
+ *_pStream << static_cast<sal_uInt32>(nContentOfsPos - ( _pStream->Tell() + sizeof(sal_uInt32) ));
else
*_pStream << nContentOfsPos;
@@ -831,8 +831,8 @@ UINT32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec )
void SfxMultiMixRecordWriter::NewContent
(
- UINT16 nContentTag, // Kennung f"ur die Art des Contents
- BYTE nContentVer // Kennung f"ur die Version des Contents
+ sal_uInt16 nContentTag, // Kennung f"ur die Art des Contents
+ sal_uInt8 nContentVer // Kennung f"ur die Version des Contents
)
/* [Beschreibung]
@@ -875,18 +875,18 @@ bool SfxMultiRecordReader::ReadHeader_Impl()
if ( _nRecordType != SFX_REC_TYPE_FIXSIZE )
{
// Tabelle aus dem Stream einlesen
- UINT32 nContentPos = _pStream->Tell();
+ sal_uInt32 nContentPos = _pStream->Tell();
if ( _nRecordType == SFX_REC_TYPE_VARSIZE_RELOC ||
_nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC )
_pStream->SeekRel( + _nContentSize );
else
_pStream->Seek( _nContentSize );
- _pContentOfs = new UINT32[_nContentCount];
+ _pContentOfs = new sal_uInt32[_nContentCount];
//! darf man jetzt so einr"ucken
#if defined(OSL_LITENDIAN)
- _pStream->Read( _pContentOfs, sizeof(UINT32)*_nContentCount );
+ _pStream->Read( _pContentOfs, sizeof(sal_uInt32)*_nContentCount );
#else
- for ( USHORT n = 0; n < _nContentCount; ++n )
+ for ( sal_uInt16 n = 0; n < _nContentCount; ++n )
*_pStream >> _pContentOfs[n];
#endif
_pStream->Seek( nContentPos );
@@ -918,7 +918,7 @@ SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream )
//-------------------------------------------------------------------------
-SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, UINT16 nTag )
+SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag )
: _nContentNo(0)
{
// Position im Stream merken, um im Fehlerfall zur"uck-seeken zu k"onnen
@@ -955,8 +955,8 @@ bool SfxMultiRecordReader::GetContent()
auf den Anfang des ersten Contents im Record und liest ggf. dessen
Header ein.
- Liegt laut Record-Header kein Content mehr vor, wird FALSE zur"uck-
- gegeben. Trotz einem TRUE-Returnwert kann am Stream ein Fehlercode
+ Liegt laut Record-Header kein Content mehr vor, wird sal_False zur"uck-
+ gegeben. Trotz einem sal_True-Returnwert kann am Stream ein Fehlercode
gesetzt sein, z.B. falls er unvorhergesehenerweise (kaputtes File)
zuende ist.
*/
@@ -966,10 +966,10 @@ bool SfxMultiRecordReader::GetContent()
if ( _nContentNo < _nContentCount )
{
// den Stream an den Anfang des Contents positionieren
- UINT32 nOffset = _nRecordType == SFX_REC_TYPE_FIXSIZE
+ sal_uInt32 nOffset = _nRecordType == SFX_REC_TYPE_FIXSIZE
? _nContentNo * _nContentSize
: SFX_REC_CONTENT_OFS(_pContentOfs[_nContentNo]);
- UINT32 nNewPos = _nStartPos + nOffset;
+ sal_uInt32 nNewPos = _nStartPos + nOffset;
DBG_ASSERT( nNewPos >= _pStream->Tell(), "SfxMultiRecordReader::GetContent() - New position before current, to much data red!" );
// #99366#: correct stream pos in every case;
@@ -984,17 +984,17 @@ bool SfxMultiRecordReader::GetContent()
if ( _nRecordType == SFX_REC_TYPE_MIXTAGS ||
_nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC )
{
- _nContentVer = sal::static_int_cast< BYTE >(
+ _nContentVer = sal::static_int_cast< sal_uInt8 >(
SFX_REC_CONTENT_VER(_pContentOfs[_nContentNo]));
*_pStream >> _nContentTag;
}
// ContentNo weiterz"ahlen
++_nContentNo;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index c596113f1658..fe5ecebf79e6 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -241,30 +241,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- uno::Reference< registry::XRegistryKey > xRegistryKey (
- reinterpret_cast< registry::XRegistryKey*>(pRegistryKey));
-
- uno::Reference< registry::XRegistryKey > xNewKey;
- xNewKey = xRegistryKey->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- FSStorageFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES")));
-
- const uno::Sequence< ::rtl::OUString > aServices (
- FSStorageFactory::impl_staticGetSupportedServiceNames());
- for( sal_Int32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component
new file mode 100644
index 000000000000..3ef0be825972
--- /dev/null
+++ b/svl/source/fsstor/fsstorage.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory">
+ <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/>
+ <service name="com.sun.star.embed.FileSystemStorageFactory"/>
+ </implementation>
+</component>
diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk
deleted file mode 100644
index dc91814772f9..000000000000
--- a/svl/source/fsstor/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svl
-TARGET=fsstorage.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/fsfactory.obj \
- $(SLO)$/fsstorage.obj \
- $(SLO)$/oinputstreamcontainer.obj \
- $(SLO)$/ostreamcontainer.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-SHL1OBJS= $(SLOFILES)
-SHL1STDLIBS=\
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(UCBHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/inc/passwordcontainer.hxx b/svl/source/inc/passwordcontainer.hxx
index 90a367814202..bcbd51b1360e 100644
--- a/svl/source/inc/passwordcontainer.hxx
+++ b/svl/source/inc/passwordcontainer.hxx
@@ -412,13 +412,13 @@ public:
class RW_SvMemoryStream : public SvMemoryStream {
public:
- RW_SvMemoryStream( void* Buf, ULONG Size, StreamMode eMode ):
+ RW_SvMemoryStream( void* Buf, sal_uLong Size, StreamMode eMode ):
SvMemoryStream( Buf, Size, eMode){}
- RW_SvMemoryStream( ULONG InitSize=512, ULONG Resize=64 ):
+ RW_SvMemoryStream( sal_uLong InitSize=512, sal_uLong Resize=64 ):
SvMemoryStream( InitSize, Resize ){}
- ULONG getActualSize(){ return nEndOfData; }
+ sal_uLong getActualSize(){ return nEndOfData; }
};
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 655371242f80..1702604b7fe9 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -26,7 +26,8 @@
*
************************************************************************/
#include <svl/brdcst.hxx>
-
+#include <boost/shared_ptr.hpp>
+#include <deque>
#ifndef DELETEZ
#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; }
@@ -35,12 +36,12 @@
struct SfxPoolVersion_Impl
{
- USHORT _nVer;
- USHORT _nStart, _nEnd;
- USHORT* _pMap;
+ sal_uInt16 _nVer;
+ sal_uInt16 _nStart, _nEnd;
+ sal_uInt16* _pMap;
- SfxPoolVersion_Impl( USHORT nVer, USHORT nStart, USHORT nEnd,
- USHORT *pMap )
+ SfxPoolVersion_Impl( sal_uInt16 nVer, sal_uInt16 nStart, sal_uInt16 nEnd,
+ sal_uInt16 *pMap )
: _nVer( nVer ),
_nStart( nStart ),
_nEnd( nEnd ),
@@ -54,16 +55,17 @@ struct SfxPoolVersion_Impl
{}
};
-SV_DECL_PTRARR( SfxPoolItemArrayBase_Impl, SfxPoolItem*, 0, 5 )
-SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 )
+typedef std::deque<SfxPoolItem*> SfxPoolItemArrayBase_Impl;
+
+typedef boost::shared_ptr< SfxPoolVersion_Impl > SfxPoolVersion_ImplPtr;
+typedef std::deque< SfxPoolVersion_ImplPtr > SfxPoolVersionArr_Impl;
struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl
{
- USHORT nFirstFree;
+ size_t nFirstFree;
- SfxPoolItemArray_Impl (USHORT nInitSize = 0)
- : SfxPoolItemArrayBase_Impl( nInitSize ),
- nFirstFree( 0 )
+ SfxPoolItemArray_Impl ()
+ : nFirstFree( 0 )
{}
};
@@ -74,17 +76,17 @@ struct SfxItemPool_Impl
SfxBroadcaster aBC;
SfxPoolItemArray_Impl** ppPoolItems;
SfxPoolVersionArr_Impl aVersions;
- USHORT nVersion;
- USHORT nLoadingVersion;
- USHORT nInitRefCount; // 1, beim Laden ggf. 2
- USHORT nVerStart, nVerEnd; // WhichRange in Versions
- USHORT nStoringStart, nStoringEnd; // zu speichernder Range
- BYTE nMajorVer, nMinorVer; // Pool selbst
+ sal_uInt16 nVersion;
+ sal_uInt16 nLoadingVersion;
+ sal_uInt16 nInitRefCount; // 1, beim Laden ggf. 2
+ sal_uInt16 nVerStart, nVerEnd; // WhichRange in Versions
+ sal_uInt16 nStoringStart, nStoringEnd; // zu speichernder Range
+ sal_uInt8 nMajorVer, nMinorVer; // Pool selbst
SfxMapUnit eDefMetric;
bool bInSetItem;
bool bStreaming; // in Load() bzw. Store()
- SfxItemPool_Impl( USHORT nStart, USHORT nEnd )
+ SfxItemPool_Impl( sal_uInt16 nStart, sal_uInt16 nEnd )
: ppPoolItems (new SfxPoolItemArray_Impl*[ nEnd - nStart + 1])
{
memset( ppPoolItems, 0, sizeof( SfxPoolItemArray_Impl* ) * ( nEnd - nStart + 1) );
@@ -97,7 +99,8 @@ struct SfxItemPool_Impl
void DeleteItems()
{
- delete[] ppPoolItems; ppPoolItems = 0;
+ delete[] ppPoolItems;
+ ppPoolItems = 0;
}
};
@@ -124,76 +127,76 @@ struct SfxItemPool_Impl
#endif
#define CHECK_FILEFORMAT( rStream, nTag ) \
- { USHORT nFileTag; \
+ { sal_uInt16 nFileTag; \
rStream >> nFileTag; \
if ( nTag != nFileTag ) \
{ \
OSL_FAIL( #nTag ); /*! s.u. */ \
/*! error-code setzen und auswerten! */ \
(rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \
- pImp->bStreaming = FALSE; \
+ pImp->bStreaming = sal_False; \
return rStream; \
} \
}
#define CHECK_FILEFORMAT_RELEASE( rStream, nTag, pPointer ) \
- { USHORT nFileTag; \
+ { sal_uInt16 nFileTag; \
rStream >> nFileTag; \
if ( nTag != nFileTag ) \
{ \
OSL_FAIL( #nTag ); /*! s.u. */ \
/*! error-code setzen und auswerten! */ \
(rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \
- pImp->bStreaming = FALSE; \
+ pImp->bStreaming = sal_False; \
delete pPointer; \
return rStream; \
} \
}
#define CHECK_FILEFORMAT2( rStream, nTag1, nTag2 ) \
- { USHORT nFileTag; \
+ { sal_uInt16 nFileTag; \
rStream >> nFileTag; \
if ( nTag1 != nFileTag && nTag2 != nFileTag ) \
{ \
OSL_FAIL( #nTag1 ); /*! s.u. */ \
/*! error-code setzen und auswerten! */ \
(rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \
- pImp->bStreaming = FALSE; \
+ pImp->bStreaming = sal_False; \
return rStream; \
} \
}
-#define SFX_ITEMPOOL_VER_MAJOR BYTE(2)
-#define SFX_ITEMPOOL_VER_MINOR BYTE(0)
-
-#define SFX_ITEMPOOL_TAG_STARTPOOL_4 USHORT(0x1111)
-#define SFX_ITEMPOOL_TAG_STARTPOOL_5 USHORT(0xBBBB)
-#define SFX_ITEMPOOL_TAG_ITEMPOOL USHORT(0xAAAA)
-#define SFX_ITEMPOOL_TAG_ITEMS USHORT(0x2222)
-#define SFX_ITEMPOOL_TAG_ITEM USHORT(0x7777)
-#define SFX_ITEMPOOL_TAG_SIZES USHORT(0x3333)
-#define SFX_ITEMPOOL_TAG_DEFAULTS USHORT(0x4444)
-#define SFX_ITEMPOOL_TAG_VERSIONMAP USHORT(0x5555)
-#define SFX_ITEMPOOL_TAG_HEADER USHORT(0x6666)
-#define SFX_ITEMPOOL_TAG_ENDPOOL USHORT(0xEEEE)
-#define SFX_ITEMPOOL_TAG_TRICK4OLD USHORT(0xFFFF)
-
-#define SFX_ITEMPOOL_REC BYTE(0x01)
-#define SFX_ITEMPOOL_REC_HEADER BYTE(0x10)
-#define SFX_ITEMPOOL_REC_VERSIONMAP USHORT(0x0020)
-#define SFX_ITEMPOOL_REC_WHICHIDS USHORT(0x0030)
-#define SFX_ITEMPOOL_REC_ITEMS USHORT(0x0040)
-#define SFX_ITEMPOOL_REC_DEFAULTS USHORT(0x0050)
-
-#define SFX_ITEMSET_REC BYTE(0x02)
-
-#define SFX_STYLES_REC BYTE(0x03)
-#define SFX_STYLES_REC_HEADER USHORT(0x0010)
-#define SFX_STYLES_REC_STYLES USHORT(0x0020)
+#define SFX_ITEMPOOL_VER_MAJOR sal_uInt8(2)
+#define SFX_ITEMPOOL_VER_MINOR sal_uInt8(0)
+
+#define SFX_ITEMPOOL_TAG_STARTPOOL_4 sal_uInt16(0x1111)
+#define SFX_ITEMPOOL_TAG_STARTPOOL_5 sal_uInt16(0xBBBB)
+#define SFX_ITEMPOOL_TAG_ITEMPOOL sal_uInt16(0xAAAA)
+#define SFX_ITEMPOOL_TAG_ITEMS sal_uInt16(0x2222)
+#define SFX_ITEMPOOL_TAG_ITEM sal_uInt16(0x7777)
+#define SFX_ITEMPOOL_TAG_SIZES sal_uInt16(0x3333)
+#define SFX_ITEMPOOL_TAG_DEFAULTS sal_uInt16(0x4444)
+#define SFX_ITEMPOOL_TAG_VERSIONMAP sal_uInt16(0x5555)
+#define SFX_ITEMPOOL_TAG_HEADER sal_uInt16(0x6666)
+#define SFX_ITEMPOOL_TAG_ENDPOOL sal_uInt16(0xEEEE)
+#define SFX_ITEMPOOL_TAG_TRICK4OLD sal_uInt16(0xFFFF)
+
+#define SFX_ITEMPOOL_REC sal_uInt8(0x01)
+#define SFX_ITEMPOOL_REC_HEADER sal_uInt8(0x10)
+#define SFX_ITEMPOOL_REC_VERSIONMAP sal_uInt16(0x0020)
+#define SFX_ITEMPOOL_REC_WHICHIDS sal_uInt16(0x0030)
+#define SFX_ITEMPOOL_REC_ITEMS sal_uInt16(0x0040)
+#define SFX_ITEMPOOL_REC_DEFAULTS sal_uInt16(0x0050)
+
+#define SFX_ITEMSET_REC sal_uInt8(0x02)
+
+#define SFX_STYLES_REC sal_uInt8(0x03)
+#define SFX_STYLES_REC_HEADER sal_uInt16(0x0010)
+#define SFX_STYLES_REC_STYLES sal_uInt16(0x0020)
//========================================================================
-inline USHORT SfxItemPool::GetIndex_Impl(USHORT nWhich) const
+inline sal_uInt16 SfxItemPool::GetIndex_Impl(sal_uInt16 nWhich) const
{
DBG_CHKTHIS(SfxItemPool, 0);
DBG_ASSERT(nWhich >= nStart && nWhich <= nEnd, "Which-Id nicht im Pool-Bereich");
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx
index 2b541c9c68dc..e45c6acbaa26 100644
--- a/svl/source/items/aeitem.cxx
+++ b/svl/source/items/aeitem.cxx
@@ -46,7 +46,7 @@ TYPEINIT1_AUTOFACTORY(SfxAllEnumItem, SfxEnumItem)
struct SfxAllEnumValue_Impl
{
- USHORT nValue;
+ sal_uInt16 nValue;
XubString aText;
};
@@ -62,7 +62,7 @@ SfxAllEnumItem::SfxAllEnumItem() :
{
}
-SfxAllEnumItem::SfxAllEnumItem( USHORT which, USHORT nVal, const XubString &rText ):
+SfxAllEnumItem::SfxAllEnumItem( sal_uInt16 which, sal_uInt16 nVal, const XubString &rText ):
SfxEnumItem(which, nVal),
pValues( 0 ),
pDisabledValues( 0 )
@@ -73,7 +73,7 @@ SfxAllEnumItem::SfxAllEnumItem( USHORT which, USHORT nVal, const XubString &rTex
// -----------------------------------------------------------------------
-SfxAllEnumItem::SfxAllEnumItem(USHORT which, USHORT nVal):
+SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which, sal_uInt16 nVal):
SfxEnumItem(which, nVal),
pValues( 0 ),
pDisabledValues( 0 )
@@ -84,7 +84,7 @@ SfxAllEnumItem::SfxAllEnumItem(USHORT which, USHORT nVal):
// -----------------------------------------------------------------------
-SfxAllEnumItem::SfxAllEnumItem( USHORT which, SvStream &rStream ):
+SfxAllEnumItem::SfxAllEnumItem( sal_uInt16 which, SvStream &rStream ):
SfxEnumItem(which, rStream),
pValues( 0 ),
pDisabledValues( 0 )
@@ -96,7 +96,7 @@ SfxAllEnumItem::SfxAllEnumItem( USHORT which, SvStream &rStream ):
// -----------------------------------------------------------------------
-SfxAllEnumItem::SfxAllEnumItem(USHORT which):
+SfxAllEnumItem::SfxAllEnumItem(sal_uInt16 which):
SfxEnumItem(which, 0),
pValues( 0 ),
pDisabledValues( 0 )
@@ -118,7 +118,7 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
pValues = new SfxAllEnumValueArr;
- for ( USHORT nPos = 0; nPos < rCopy.pValues->Count(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < rCopy.pValues->Count(); ++nPos )
{
SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
pVal->nValue = rCopy.pValues->GetObject(nPos)->nValue;
@@ -130,7 +130,7 @@ SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
if( rCopy.pDisabledValues )
{
pDisabledValues = new SvUShorts;
- for ( USHORT nPos = 0; nPos < rCopy.pDisabledValues->Count(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < rCopy.pDisabledValues->Count(); ++nPos )
{
pDisabledValues->Insert( rCopy.pDisabledValues->GetObject(nPos),
nPos );
@@ -149,7 +149,7 @@ SfxAllEnumItem::~SfxAllEnumItem()
// -----------------------------------------------------------------------
-USHORT SfxAllEnumItem::GetValueCount() const
+sal_uInt16 SfxAllEnumItem::GetValueCount() const
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
return pValues ? pValues->Count() : 0;
@@ -157,7 +157,7 @@ USHORT SfxAllEnumItem::GetValueCount() const
// -----------------------------------------------------------------------
-XubString SfxAllEnumItem::GetValueTextByPos( USHORT nPos ) const
+XubString SfxAllEnumItem::GetValueTextByPos( sal_uInt16 nPos ) const
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" );
@@ -166,7 +166,7 @@ XubString SfxAllEnumItem::GetValueTextByPos( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT SfxAllEnumItem::GetValueByPos( USHORT nPos ) const
+sal_uInt16 SfxAllEnumItem::GetValueByPos( sal_uInt16 nPos ) const
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" );
@@ -183,7 +183,7 @@ SfxPoolItem* SfxAllEnumItem::Clone( SfxItemPool * ) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, USHORT ) const
+SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
return new SfxAllEnumItem( Which(), rStream );
@@ -192,11 +192,11 @@ SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, USHORT ) const
// -----------------------------------------------------------------------
-USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const
+sal_uInt16 SfxAllEnumItem::_GetPosByValue( sal_uInt16 nVal ) const
/* [Beschreibung]
- Im Ggs. zu <SfxEnumItemInterface::GetPosByValue(USHORT)const> liefert
+ Im Ggs. zu <SfxEnumItemInterface::GetPosByValue(sal_uInt16)const> liefert
diese interne Methode bei nicht vorhandenen Values die Position,
an der der Wert liegen w"urde.
*/
@@ -208,7 +208,7 @@ USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const
return 0;
//!O: binaere Suche oder SortArray verwenden
- USHORT nPos;
+ sal_uInt16 nPos;
for ( nPos = 0; nPos < pValues->Count(); ++nPos )
if ( pValues->GetObject(nPos)->nValue >= nVal )
return nPos;
@@ -217,11 +217,11 @@ USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const
// -----------------------------------------------------------------------
-USHORT SfxAllEnumItem::GetPosByValue( USHORT nValue ) const
+sal_uInt16 SfxAllEnumItem::GetPosByValue( sal_uInt16 nValue ) const
/* [Beschreibung]
- Liefert im Gegensatz zu <SfxEnumItemInterface::GetPosByValue(USHORT)const>
+ Liefert im Gegensatz zu <SfxEnumItemInterface::GetPosByValue(sal_uInt16)const>
immer nValue zur"uck, solange nicht mindestens ein Wert mit einer der
Methoden <SfxAllEnumItem::InsertValue()> eingef"ugt wurde.
*/
@@ -237,7 +237,7 @@ USHORT SfxAllEnumItem::GetPosByValue( USHORT nValue ) const
// -----------------------------------------------------------------------
-void SfxAllEnumItem::InsertValue( USHORT nValue, const XubString &rValue )
+void SfxAllEnumItem::InsertValue( sal_uInt16 nValue, const XubString &rValue )
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
@@ -255,7 +255,7 @@ void SfxAllEnumItem::InsertValue( USHORT nValue, const XubString &rValue )
// -----------------------------------------------------------------------
-void SfxAllEnumItem::InsertValue( USHORT nValue )
+void SfxAllEnumItem::InsertValue( sal_uInt16 nValue )
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
@@ -268,7 +268,7 @@ void SfxAllEnumItem::InsertValue( USHORT nValue )
pValues->Insert( pTemp, _GetPosByValue(nValue) ); //! doppelte?!
}
-void SfxAllEnumItem::DisableValue( USHORT nValue )
+void SfxAllEnumItem::DisableValue( sal_uInt16 nValue )
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
if ( !pDisabledValues )
@@ -277,24 +277,24 @@ void SfxAllEnumItem::DisableValue( USHORT nValue )
pDisabledValues->Insert( nValue, pDisabledValues->Count() );
}
-BOOL SfxAllEnumItem::IsEnabled( USHORT nValue ) const
+sal_Bool SfxAllEnumItem::IsEnabled( sal_uInt16 nValue ) const
{
if ( pDisabledValues )
{
- for ( USHORT i=0; i<pDisabledValues->Count(); i++ )
+ for ( sal_uInt16 i=0; i<pDisabledValues->Count(); i++ )
if ( (*pDisabledValues)[i] == nValue )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void SfxAllEnumItem::RemoveValue( USHORT nValue )
+void SfxAllEnumItem::RemoveValue( sal_uInt16 nValue )
{
DBG_CHKTHIS(SfxAllEnumItem, 0);
- USHORT nPos = GetPosByValue(nValue);
+ sal_uInt16 nPos = GetPosByValue(nValue);
DBG_ASSERT( nPos != USHRT_MAX, "removing value not in enum" );
pValues->Remove( nPos );
}
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx
index 61128f3bce55..1c302f962431 100644
--- a/svl/source/items/cenumitm.cxx
+++ b/svl/source/items/cenumitm.cxx
@@ -33,7 +33,7 @@
#include <svl/cenumitm.hxx>
#include <whassert.hxx>
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
//============================================================================
//
@@ -69,7 +69,7 @@ SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit,
//============================================================================
// virtual
-bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE)
+bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8)
const
{
rVal <<= sal_Int32(GetEnumValue());
@@ -79,13 +79,13 @@ bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, BYTE)
//============================================================================
// virtual
bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal,
- BYTE)
+ sal_uInt8)
{
sal_Int32 nTheValue = 0;
if ( ::cppu::enum2int( nTheValue, rVal ) )
{
- SetEnumValue(USHORT(nTheValue));
+ SetEnumValue(sal_uInt16(nTheValue));
return true;
}
OSL_FAIL("SfxEnumItemInterface::PutValue(): Wrong type");
@@ -93,7 +93,7 @@ bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal,
}
//============================================================================
-XubString SfxEnumItemInterface::GetValueTextByPos(USHORT) const
+XubString SfxEnumItemInterface::GetValueTextByPos(sal_uInt16) const
{
DBG_WARNING("SfxEnumItemInterface::GetValueTextByPos(): Pure virtual");
return XubString();
@@ -101,25 +101,25 @@ XubString SfxEnumItemInterface::GetValueTextByPos(USHORT) const
//============================================================================
// virtual
-USHORT SfxEnumItemInterface::GetValueByPos(USHORT nPos) const
+sal_uInt16 SfxEnumItemInterface::GetValueByPos(sal_uInt16 nPos) const
{
return nPos;
}
//============================================================================
// virtual
-USHORT SfxEnumItemInterface::GetPosByValue(USHORT nValue) const
+sal_uInt16 SfxEnumItemInterface::GetPosByValue(sal_uInt16 nValue) const
{
- USHORT nCount = GetValueCount();
- for (USHORT i = 0; i < nCount; ++i)
+ sal_uInt16 nCount = GetValueCount();
+ for (sal_uInt16 i = 0; i < nCount; ++i)
if (GetValueByPos(i) == nValue)
return i;
return USHRT_MAX;
}
-BOOL SfxEnumItemInterface::IsEnabled(USHORT) const
+sal_Bool SfxEnumItemInterface::IsEnabled(sal_uInt16) const
{
- return TRUE;
+ return sal_True;
}
//============================================================================
@@ -131,14 +131,14 @@ int SfxEnumItemInterface::HasBoolValue() const
//============================================================================
// virtual
-BOOL SfxEnumItemInterface::GetBoolValue() const
+sal_Bool SfxEnumItemInterface::GetBoolValue() const
{
return false;
}
//============================================================================
// virtual
-void SfxEnumItemInterface::SetBoolValue(BOOL)
+void SfxEnumItemInterface::SetBoolValue(sal_Bool)
{}
//============================================================================
@@ -150,7 +150,7 @@ void SfxEnumItemInterface::SetBoolValue(BOOL)
DBG_NAME(CntEnumItem)
//============================================================================
-CntEnumItem::CntEnumItem(USHORT which, SvStream & rStream):
+CntEnumItem::CntEnumItem(sal_uInt16 which, SvStream & rStream):
SfxEnumItemInterface(which)
{
m_nValue = 0;
@@ -162,7 +162,7 @@ TYPEINIT1(CntEnumItem, SfxEnumItemInterface)
//============================================================================
// virtual
-SvStream & CntEnumItem::Store(SvStream & rStream, USHORT) const
+SvStream & CntEnumItem::Store(SvStream & rStream, sal_uInt16) const
{
rStream << m_nValue;
return rStream;
@@ -170,14 +170,14 @@ SvStream & CntEnumItem::Store(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-USHORT CntEnumItem::GetEnumValue() const
+sal_uInt16 CntEnumItem::GetEnumValue() const
{
return GetValue();
}
//============================================================================
// virtual
-void CntEnumItem::SetEnumValue(USHORT nTheValue)
+void CntEnumItem::SetEnumValue(sal_uInt16 nTheValue)
{
SetValue(nTheValue);
}
@@ -194,7 +194,7 @@ DBG_NAME(CntBoolItem)
TYPEINIT1_AUTOFACTORY(CntBoolItem, SfxPoolItem)
//============================================================================
-CntBoolItem::CntBoolItem(USHORT which, SvStream & rStream):
+CntBoolItem::CntBoolItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
m_bValue = false;
@@ -232,7 +232,7 @@ SfxItemPresentation CntBoolItem::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const
+bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
rVal <<= sal_Bool(m_bValue);
return true;
@@ -240,7 +240,7 @@ bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const
//============================================================================
// virtual
-bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, BYTE)
+bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
sal_Bool bTheValue = sal_Bool();
if (rVal >>= bTheValue)
@@ -254,14 +254,14 @@ bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, BYTE)
//============================================================================
// virtual
-SfxPoolItem * CntBoolItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * CntBoolItem::Create(SvStream & rStream, sal_uInt16) const
{
return new CntBoolItem(Which(), rStream);
}
//============================================================================
// virtual
-SvStream & CntBoolItem::Store(SvStream & rStream, USHORT) const
+SvStream & CntBoolItem::Store(SvStream & rStream, sal_uInt16) const
{
rStream << m_bValue;
return rStream;
@@ -276,19 +276,19 @@ SfxPoolItem * CntBoolItem::Clone(SfxItemPool *) const
//============================================================================
// virtual
-USHORT CntBoolItem::GetValueCount() const
+sal_uInt16 CntBoolItem::GetValueCount() const
{
return 2;
}
//============================================================================
// virtual
-UniString CntBoolItem::GetValueTextByVal(BOOL bTheValue) const
+UniString CntBoolItem::GetValueTextByVal(sal_Bool bTheValue) const
{
return
bTheValue ?
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) :
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE"));
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) :
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx
index f74463a32a12..1f949babf9dc 100644
--- a/svl/source/items/cintitem.cxx
+++ b/svl/source/items/cintitem.cxx
@@ -44,7 +44,7 @@ DBG_NAME(CntByteItem)
TYPEINIT1_AUTOFACTORY(CntByteItem, SfxPoolItem);
//============================================================================
-CntByteItem::CntByteItem(USHORT which, SvStream & rStream):
+CntByteItem::CntByteItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
DBG_CTOR(CntByteItem, 0);
@@ -88,7 +88,7 @@ SfxItemPresentation CntByteItem::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
+bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
sal_Int8 nValue = m_nValue;
rVal <<= nValue;
@@ -97,7 +97,7 @@ bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
//============================================================================
// virtual
-bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
+bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
sal_Int8 nValue = sal_Int8();
if (rVal >>= nValue)
@@ -112,17 +112,17 @@ bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
//============================================================================
// virtual
-SfxPoolItem * CntByteItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * CntByteItem::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntByteItem, 0);
short nTheValue = 0;
rStream >> nTheValue;
- return new CntByteItem(Which(), BYTE(nTheValue));
+ return new CntByteItem(Which(), sal_uInt8(nTheValue));
}
//============================================================================
// virtual
-SvStream & CntByteItem::Store(SvStream & rStream, USHORT) const
+SvStream & CntByteItem::Store(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntByteItem, 0);
rStream << short(m_nValue);
@@ -139,7 +139,7 @@ SfxPoolItem * CntByteItem::Clone(SfxItemPool *) const
//============================================================================
// virtual
-BYTE CntByteItem::GetMin() const
+sal_uInt8 CntByteItem::GetMin() const
{
DBG_CHKTHIS(CntByteItem, 0);
return 0;
@@ -147,7 +147,7 @@ BYTE CntByteItem::GetMin() const
//============================================================================
// virtual
-BYTE CntByteItem::GetMax() const
+sal_uInt8 CntByteItem::GetMax() const
{
DBG_CHKTHIS(CntByteItem, 0);
return 255;
@@ -173,11 +173,11 @@ DBG_NAME(CntUInt16Item);
TYPEINIT1_AUTOFACTORY(CntUInt16Item, SfxPoolItem);
//============================================================================
-CntUInt16Item::CntUInt16Item(USHORT which, SvStream & rStream) :
+CntUInt16Item::CntUInt16Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
DBG_CTOR(CntUInt16Item, 0);
- USHORT nTheValue = 0;
+ sal_uInt16 nTheValue = 0;
rStream >> nTheValue;
m_nValue = nTheValue;
}
@@ -223,7 +223,7 @@ SfxItemPresentation CntUInt16Item::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
+bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
sal_Int32 nValue = m_nValue;
rVal <<= nValue;
@@ -232,7 +232,7 @@ bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
//============================================================================
// virtual
-bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
+bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
sal_Int32 nValue = 0;
if (rVal >>= nValue)
@@ -248,7 +248,7 @@ bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
//============================================================================
// virtual
-SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntUInt16Item, 0);
return new CntUInt16Item(Which(), rStream);
@@ -256,10 +256,10 @@ SfxPoolItem * CntUInt16Item::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & CntUInt16Item::Store(SvStream &rStream, USHORT) const
+SvStream & CntUInt16Item::Store(SvStream &rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntUInt16Item, 0);
- rStream << USHORT(m_nValue);
+ rStream << sal_uInt16(m_nValue);
return rStream;
}
@@ -273,7 +273,7 @@ SfxPoolItem * CntUInt16Item::Clone(SfxItemPool *) const
//============================================================================
// virtual
-UINT16 CntUInt16Item::GetMin() const
+sal_uInt16 CntUInt16Item::GetMin() const
{
DBG_CHKTHIS(CntUInt16Item, 0);
return 0;
@@ -281,7 +281,7 @@ UINT16 CntUInt16Item::GetMin() const
//============================================================================
// virtual
-UINT16 CntUInt16Item::GetMax() const
+sal_uInt16 CntUInt16Item::GetMax() const
{
DBG_CHKTHIS(CntUInt16Item, 0);
return 65535;
@@ -307,7 +307,7 @@ DBG_NAME(CntInt32Item);
TYPEINIT1_AUTOFACTORY(CntInt32Item, SfxPoolItem);
//============================================================================
-CntInt32Item::CntInt32Item(USHORT which, SvStream & rStream) :
+CntInt32Item::CntInt32Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
DBG_CTOR(CntInt32Item, 0);
@@ -355,7 +355,7 @@ SfxItemPresentation CntInt32Item::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
+bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
sal_Int32 nValue = m_nValue;
rVal <<= nValue;
@@ -364,7 +364,7 @@ bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
//============================================================================
// virtual
-bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
+bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
sal_Int32 nValue = 0;
if (rVal >>= nValue)
@@ -379,7 +379,7 @@ bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
//============================================================================
// virtual
-SfxPoolItem * CntInt32Item::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * CntInt32Item::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntInt32Item, 0);
return new CntInt32Item(Which(), rStream);
@@ -387,7 +387,7 @@ SfxPoolItem * CntInt32Item::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & CntInt32Item::Store(SvStream &rStream, USHORT) const
+SvStream & CntInt32Item::Store(SvStream &rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntInt32Item, 0);
rStream << long(m_nValue);
@@ -404,15 +404,15 @@ SfxPoolItem * CntInt32Item::Clone(SfxItemPool *) const
//============================================================================
// virtual
-INT32 CntInt32Item::GetMin() const
+sal_Int32 CntInt32Item::GetMin() const
{
DBG_CHKTHIS(CntInt32Item, 0);
- return INT32(0x80000000);
+ return sal_Int32(0x80000000);
}
//============================================================================
// virtual
-INT32 CntInt32Item::GetMax() const
+sal_Int32 CntInt32Item::GetMax() const
{
DBG_CHKTHIS(CntInt32Item, 0);
return 0x7FFFFFFF;
@@ -438,7 +438,7 @@ DBG_NAME(CntUInt32Item);
TYPEINIT1_AUTOFACTORY(CntUInt32Item, SfxPoolItem);
//============================================================================
-CntUInt32Item::CntUInt32Item(USHORT which, SvStream & rStream) :
+CntUInt32Item::CntUInt32Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
DBG_CTOR(CntUInt32Item, 0);
@@ -488,7 +488,7 @@ SfxItemPresentation CntUInt32Item::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
+bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
sal_Int32 nValue = m_nValue;
DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!");
@@ -498,7 +498,7 @@ bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
//============================================================================
// virtual
-bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
+bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
sal_Int32 nValue = 0;
if (rVal >>= nValue)
@@ -514,7 +514,7 @@ bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
//============================================================================
// virtual
-SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntUInt32Item, 0);
return new CntUInt32Item(Which(), rStream);
@@ -522,7 +522,7 @@ SfxPoolItem * CntUInt32Item::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & CntUInt32Item::Store(SvStream &rStream, USHORT) const
+SvStream & CntUInt32Item::Store(SvStream &rStream, sal_uInt16) const
{
DBG_CHKTHIS(CntUInt32Item, 0);
rStream << static_cast<sal_uInt32>(m_nValue);
@@ -539,7 +539,7 @@ SfxPoolItem * CntUInt32Item::Clone(SfxItemPool *) const
//============================================================================
// virtual
-UINT32 CntUInt32Item::GetMin() const
+sal_uInt32 CntUInt32Item::GetMin() const
{
DBG_CHKTHIS(CntUInt32Item, 0);
return 0;
@@ -547,7 +547,7 @@ UINT32 CntUInt32Item::GetMin() const
//============================================================================
// virtual
-UINT32 CntUInt32Item::GetMax() const
+sal_uInt32 CntUInt32Item::GetMax() const
{
DBG_CHKTHIS(CntUInt32Item, 0);
return 0xFFFFFFFF;
diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx
index 06269f945315..22cd8a77904c 100644
--- a/svl/source/items/cntwall.cxx
+++ b/svl/source/items/cntwall.cxx
@@ -36,22 +36,22 @@
#include <svl/cntwall.hxx>
-#define CNTWALLPAPERITEM_STREAM_MAGIC ( (UINT32)0xfefefefe )
-#define CNTWALLPAPERITEM_STREAM_SEEKREL (-( (long)( sizeof( UINT32 ) ) ) )
+#define CNTWALLPAPERITEM_STREAM_MAGIC ( (sal_uInt32)0xfefefefe )
+#define CNTWALLPAPERITEM_STREAM_SEEKREL (-( (long)( sizeof( sal_uInt32 ) ) ) )
TYPEINIT1( CntWallpaperItem, SfxPoolItem );
// -----------------------------------------------------------------------
-CntWallpaperItem::CntWallpaperItem( USHORT which )
+CntWallpaperItem::CntWallpaperItem( sal_uInt16 which )
: SfxPoolItem( which ), _nColor( COL_TRANSPARENT ), _nStyle( 0 )
{
}
// -----------------------------------------------------------------------
-CntWallpaperItem::CntWallpaperItem( USHORT which, SvStream& rStream, USHORT nVersion )
+CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uInt16 nVersion )
: SfxPoolItem( which ), _nColor( COL_TRANSPARENT ), _nStyle( 0 )
{
- UINT32 nMagic = 0;
+ sal_uInt32 nMagic = 0;
rStream >> nMagic;
if ( nMagic == CNTWALLPAPERITEM_STREAM_MAGIC )
{
@@ -60,7 +60,7 @@ CntWallpaperItem::CntWallpaperItem( USHORT which, SvStream& rStream, USHORT nVer
readUnicodeString(rStream, _aURL, nVersion >= 1);
// !!! Color stream operators do not work - they discard any
// transparency info !!!
- _nColor.Read( rStream, TRUE );
+ _nColor.Read( rStream, sal_True );
rStream >> _nStyle;
}
else
@@ -111,33 +111,33 @@ int CntWallpaperItem::operator==( const SfxPoolItem& rItem ) const
if( ( rWallItem._nStyle == _nStyle ) &&
( rWallItem._nColor == _nColor ) &&
( rWallItem._aURL == _aURL ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
//============================================================================
// virtual
-USHORT CntWallpaperItem::GetVersion(USHORT) const
+sal_uInt16 CntWallpaperItem::GetVersion(sal_uInt16) const
{
return 1; // because it uses SfxPoolItem::read/writeUnicodeString()
}
// -----------------------------------------------------------------------
-SfxPoolItem* CntWallpaperItem::Create( SvStream& rStream, USHORT nVersion) const
+SfxPoolItem* CntWallpaperItem::Create( SvStream& rStream, sal_uInt16 nVersion) const
{
return new CntWallpaperItem( Which(), rStream, nVersion );
}
// -----------------------------------------------------------------------
-SvStream& CntWallpaperItem::Store( SvStream& rStream, USHORT ) const
+SvStream& CntWallpaperItem::Store( SvStream& rStream, sal_uInt16 ) const
{
rStream << CNTWALLPAPERITEM_STREAM_MAGIC;
writeUnicodeString(rStream, _aURL);
// !!! Color stream operators do not work - they discard any
// transparency info !!!
// ??? Why the hell Color::Write(...) isn't const ???
- SAL_CONST_CAST( CntWallpaperItem*, this )->_nColor.Write( rStream, TRUE );
+ SAL_CONST_CAST( CntWallpaperItem*, this )->_nColor.Write( rStream, sal_True );
rStream << _nStyle;
return rStream;
@@ -151,7 +151,7 @@ SfxPoolItem* CntWallpaperItem::Clone( SfxItemPool* ) const
//----------------------------------------------------------------------------
// virtual
-bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,BYTE ) const
+bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8) const
{
OSL_FAIL("Not implemented!");
return false;
@@ -159,7 +159,7 @@ bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,BYTE ) const
//----------------------------------------------------------------------------
// virtual
-bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,BYTE )
+bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8)
{
OSL_FAIL("Not implemented!");
return false;
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index bd1b04a6e1dd..d1fe8b9461f9 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -36,8 +36,8 @@
//============================================================================
// The following defines are copied from chaos/source/items/cstritem.cxx:
-#define CNTSTRINGITEM_STREAM_MAGIC ( (UINT32)0xfefefefe )
-#define CNTSTRINGITEM_STREAM_SEEKREL (-( (long)( sizeof( UINT32 ) ) ) )
+#define CNTSTRINGITEM_STREAM_MAGIC ( (sal_uInt32)0xfefefefe )
+#define CNTSTRINGITEM_STREAM_SEEKREL (-( (long)( sizeof( sal_uInt32 ) ) ) )
//============================================================================
//
@@ -57,14 +57,14 @@ CntContentTypeItem::CntContentTypeItem()
}
//----------------------------------------------------------------------------
-CntContentTypeItem::CntContentTypeItem( USHORT which, const XubString& rType )
+CntContentTypeItem::CntContentTypeItem( sal_uInt16 which, const XubString& rType )
: CntUnencodedStringItem( which, rType ),
_eType( CONTENT_TYPE_NOT_INIT )
{
}
//----------------------------------------------------------------------------
-CntContentTypeItem::CntContentTypeItem( USHORT which,
+CntContentTypeItem::CntContentTypeItem( sal_uInt16 which,
const INetContentType eType )
: CntUnencodedStringItem( which, INetContentTypes::GetContentType( eType ) ),
_eType( eType )
@@ -81,7 +81,7 @@ CntContentTypeItem::CntContentTypeItem( const CntContentTypeItem& rOrig )
//============================================================================
// virtual
-USHORT CntContentTypeItem::GetVersion(USHORT) const
+sal_uInt16 CntContentTypeItem::GetVersion(sal_uInt16) const
{
return 1; // because it uses SfxPoolItem::read/writeUnicodeString()
}
@@ -89,17 +89,17 @@ USHORT CntContentTypeItem::GetVersion(USHORT) const
//----------------------------------------------------------------------------
// virtual
SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream,
- USHORT nItemVersion ) const
+ sal_uInt16 nItemVersion ) const
{
// CntContentTypeItem used to be derived from CntStringItem, so take that
// into account:
UniString aValue;
readUnicodeString(rStream, aValue, nItemVersion >= 1);
- UINT32 nMagic = 0;
+ sal_uInt32 nMagic = 0;
rStream >> nMagic;
if (nMagic == CNTSTRINGITEM_STREAM_MAGIC)
{
- BOOL bEncrypted = FALSE;
+ sal_Bool bEncrypted = sal_False;
rStream >> bEncrypted;
DBG_ASSERT(!bEncrypted,
"CntContentTypeItem::Create() reads encrypted data");
@@ -112,12 +112,12 @@ SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream,
//----------------------------------------------------------------------------
// virtual
-SvStream & CntContentTypeItem::Store(SvStream & rStream, USHORT) const
+SvStream & CntContentTypeItem::Store(SvStream & rStream, sal_uInt16) const
{
// CntContentTypeItem used to be derived from CntStringItem, so take that
// into account:
writeUnicodeString(rStream, GetValue());
- rStream << CNTSTRINGITEM_STREAM_MAGIC << BOOL(FALSE);
+ rStream << CNTSTRINGITEM_STREAM_MAGIC << sal_Bool(sal_False);
return rStream;
}
@@ -224,7 +224,7 @@ void CntContentTypeItem::SetValue( const INetContentType eType )
//----------------------------------------------------------------------------
// virtual
-bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const
+bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8) const
{
rVal <<= rtl::OUString(GetValue());
return true;
@@ -232,7 +232,7 @@ bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const
//----------------------------------------------------------------------------
// virtual
-bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE )
+bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8)
{
rtl::OUString aValue;
if ( rVal >>= aValue )
diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx
index 4d03130e03d3..e64f47ec2a3e 100644
--- a/svl/source/items/custritm.cxx
+++ b/svl/source/items/custritm.cxx
@@ -107,7 +107,7 @@ CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit,
//============================================================================
// virtual
-bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE)
+bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8)
const
{
rVal <<= rtl::OUString(m_aValue);
@@ -117,7 +117,7 @@ bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, BYTE)
//============================================================================
// virtual
bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal,
- BYTE)
+ sal_uInt8)
{
rtl::OUString aTheValue;
if (rVal >>= aTheValue)
diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx
index 83b86418545a..e4c05f0abce0 100644
--- a/svl/source/items/dateitem.cxx
+++ b/svl/source/items/dateitem.cxx
@@ -57,7 +57,7 @@ TYPEINIT1(SfxDateTimeItem, SfxPoolItem);
// -----------------------------------------------------------------------
-SfxDateTimeItem::SfxDateTimeItem( USHORT which ) :
+SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which ) :
SfxPoolItem( which )
{
DBG_CTOR(SfxDateTimeItem, 0);
@@ -65,7 +65,7 @@ SfxDateTimeItem::SfxDateTimeItem( USHORT which ) :
// -----------------------------------------------------------------------
-SfxDateTimeItem::SfxDateTimeItem( USHORT which, const DateTime& rDT ) :
+SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which, const DateTime& rDT ) :
SfxPoolItem( which ),
aDateTime( rDT )
@@ -110,7 +110,7 @@ int SfxDateTimeItem::Compare( const SfxPoolItem& rItem ) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, USHORT ) const
+SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxDateTimeItem, 0);
sal_uInt32 nDate = 0;
@@ -123,7 +123,7 @@ SfxPoolItem* SfxDateTimeItem::Create( SvStream& rStream, USHORT ) const
// -----------------------------------------------------------------------
-SvStream& SfxDateTimeItem::Store( SvStream& rStream, USHORT ) const
+SvStream& SfxDateTimeItem::Store( SvStream& rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxDateTimeItem, 0);
rStream << aDateTime.GetDate();
@@ -176,7 +176,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation
//----------------------------------------------------------------------------
// virtual
bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId )
+ sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
com::sun::star::util::DateTime aValue;
@@ -199,7 +199,7 @@ bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal,
//----------------------------------------------------------------------------
// virtual
bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId ) const
+ sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
com::sun::star::util::DateTime aValue( aDateTime.Get100Sec(),
@@ -220,11 +220,11 @@ bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal,
TYPEINIT1(SfxColumnDateTimeItem, SfxDateTimeItem);
-SfxColumnDateTimeItem::SfxColumnDateTimeItem( USHORT which ) :
+SfxColumnDateTimeItem::SfxColumnDateTimeItem( sal_uInt16 which ) :
SfxDateTimeItem( which )
{}
-SfxColumnDateTimeItem::SfxColumnDateTimeItem( USHORT which, const DateTime& rDT ) :
+SfxColumnDateTimeItem::SfxColumnDateTimeItem( sal_uInt16 which, const DateTime& rDT ) :
SfxDateTimeItem( which, rDT )
{}
diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx
index 4bf226a4d6b4..a151d430cd0d 100644
--- a/svl/source/items/flagitem.cxx
+++ b/svl/source/items/flagitem.cxx
@@ -37,7 +37,7 @@
DBG_NAME(SfxFlagItem)
-USHORT nSfxFlagVal[16] =
+sal_uInt16 nSfxFlagVal[16] =
{
0x0001, 0x0002, 0x0004, 0x0008,
0x0010, 0x0020, 0x0040, 0x0080,
@@ -52,7 +52,7 @@ TYPEINIT1(SfxFlagItem, SfxPoolItem);
// -----------------------------------------------------------------------
-SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) :
+SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV ) :
SfxPoolItem( nW ),
nVal(nV)
{
@@ -61,7 +61,7 @@ SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) :
// -----------------------------------------------------------------------
-SfxFlagItem::SfxFlagItem( USHORT nW, SvStream &rStream) :
+SfxFlagItem::SfxFlagItem( sal_uInt16 nW, SvStream &rStream) :
SfxPoolItem( nW )
{
DBG_CTOR(SfxFlagItem, 0);
@@ -79,7 +79,7 @@ SfxFlagItem::SfxFlagItem( const SfxFlagItem& rItem ) :
// -----------------------------------------------------------------------
-SvStream& SfxFlagItem::Store(SvStream &rStream, USHORT) const
+SvStream& SfxFlagItem::Store(SvStream &rStream, sal_uInt16) const
{
DBG_CHKTHIS(SfxFlagItem, 0);
rStream << nVal;
@@ -99,32 +99,32 @@ SfxItemPresentation SfxFlagItem::GetPresentation
{
DBG_CHKTHIS(SfxFlagItem, 0);
rText.Erase();
- for ( BYTE nFlag = 0; nFlag < GetFlagCount(); ++nFlag )
+ for ( sal_uInt8 nFlag = 0; nFlag < GetFlagCount(); ++nFlag )
rText += XubString::CreateFromInt32( GetFlag(nFlag) );
return SFX_ITEM_PRESENTATION_NAMELESS;
}
// -----------------------------------------------------------------------
-XubString SfxFlagItem::GetFlagText( BYTE ) const
+XubString SfxFlagItem::GetFlagText( sal_uInt8 ) const
{
DBG_CHKTHIS(SfxFlagItem, 0);
- DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" );
+ DBG_WARNING( "calling GetValueText(sal_uInt16) on SfxFlagItem -- overload!" );
return XubString();
}
// -----------------------------------------------------------------------
-BYTE SfxFlagItem::GetFlagCount() const
+sal_uInt8 SfxFlagItem::GetFlagCount() const
{
DBG_CHKTHIS(SfxFlagItem, 0);
- DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" );
+ DBG_WARNING( "calling GetValueText(sal_uInt16) on SfxFlagItem -- overload!" );
return 0;
}
// -----------------------------------------------------------------------
-SfxPoolItem* SfxFlagItem::Create(SvStream &, USHORT) const
+SfxPoolItem* SfxFlagItem::Create(SvStream &, sal_uInt16) const
{
DBG_CHKTHIS(SfxFlagItem, 0);
DBG_WARNING( "calling Create() on SfxFlagItem -- overload!" );
@@ -142,7 +142,7 @@ int SfxFlagItem::operator==( const SfxPoolItem& rItem ) const
// -----------------------------------------------------------------------
-void SfxFlagItem::SetFlag( BYTE nFlag, int bVal )
+void SfxFlagItem::SetFlag( sal_uInt8 nFlag, int bVal )
{
if ( bVal )
nVal |= nSfxFlagVal[nFlag];
diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx
index 2e4c53a9d3c3..aa36b0afa30c 100644
--- a/svl/source/items/globalnameitem.cxx
+++ b/svl/source/items/globalnameitem.cxx
@@ -53,7 +53,7 @@ SfxGlobalNameItem::SfxGlobalNameItem()
// -----------------------------------------------------------------------
-SfxGlobalNameItem::SfxGlobalNameItem( USHORT nW, const SvGlobalName& rName )
+SfxGlobalNameItem::SfxGlobalNameItem( sal_uInt16 nW, const SvGlobalName& rName )
: SfxPoolItem( nW ),
m_aName( rName )
{
@@ -81,7 +81,7 @@ SfxPoolItem* SfxGlobalNameItem::Clone(SfxItemPool *) const
//----------------------------------------------------------------------------
// virtual
-bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
+bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
com::sun::star::uno::Reference < com::sun::star::script::XTypeConverter > xConverter
( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))),
@@ -104,7 +104,7 @@ bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
//----------------------------------------------------------------------------
// virtual
-bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const
+bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
{
com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
void* pData = ( void* ) &m_aName.GetCLSID();
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx
index 61917ffa63b5..f8d575b52175 100644
--- a/svl/source/items/ilstitem.cxx
+++ b/svl/source/items/ilstitem.cxx
@@ -44,11 +44,11 @@ SfxIntegerListItem::SfxIntegerListItem()
{
}
-SfxIntegerListItem::SfxIntegerListItem( USHORT which, const SvULongs& rList )
+SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const SvULongs& rList )
: SfxPoolItem( which )
{
m_aList.realloc( rList.Count() );
- for ( USHORT n=0; n<rList.Count(); n++ )
+ for ( sal_uInt16 n=0; n<rList.Count(); n++ )
m_aList[n] = rList[n];
}
@@ -65,7 +65,7 @@ SfxIntegerListItem::~SfxIntegerListItem()
int SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const
{
if ( !rPoolItem.ISA( SfxIntegerListItem ) )
- return FALSE;
+ return sal_False;
const SfxIntegerListItem rItem = (const SfxIntegerListItem&) rPoolItem;
return rItem.m_aList == m_aList;
@@ -76,7 +76,7 @@ SfxPoolItem* SfxIntegerListItem::Clone( SfxItemPool * ) const
return new SfxIntegerListItem( *this );
}
-bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, BYTE )
+bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
::com::sun::star::uno::Reference < ::com::sun::star::script::XTypeConverter > xConverter
( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))),
@@ -91,7 +91,7 @@ bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, BYTE
return ( aNew >>= m_aList );
}
-bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const
+bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
{
rVal <<= m_aList;
return true;
@@ -100,7 +100,7 @@ bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) cons
void SfxIntegerListItem::GetList( SvULongs& rList ) const
{
for ( sal_Int32 n=0; n<m_aList.getLength(); n++ )
- rList.Insert( m_aList[n], sal::static_int_cast< USHORT >(n) );
+ rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx
index f689415f52e4..4daa24f2a442 100644
--- a/svl/source/items/imageitm.cxx
+++ b/svl/source/items/imageitm.cxx
@@ -38,27 +38,27 @@ struct SfxImageItem_Impl
{
String aURL;
long nAngle;
- BOOL bMirrored;
+ sal_Bool bMirrored;
int operator == ( const SfxImageItem_Impl& rOther ) const
{ return nAngle == rOther.nAngle && bMirrored == rOther.bMirrored; }
};
//---------------------------------------------------------
-SfxImageItem::SfxImageItem( USHORT which, UINT16 nImage )
+SfxImageItem::SfxImageItem( sal_uInt16 which, sal_uInt16 nImage )
: SfxInt16Item( which, nImage )
{
pImp = new SfxImageItem_Impl;
pImp->nAngle = 0;
- pImp->bMirrored = FALSE;
+ pImp->bMirrored = sal_False;
}
-SfxImageItem::SfxImageItem( USHORT which, const String& rURL )
+SfxImageItem::SfxImageItem( sal_uInt16 which, const String& rURL )
: SfxInt16Item( which, 0 )
{
pImp = new SfxImageItem_Impl;
pImp->nAngle = 0;
- pImp->bMirrored = FALSE;
+ pImp->bMirrored = sal_False;
pImp->aURL = rURL;
}
@@ -88,7 +88,7 @@ int SfxImageItem::operator==( const SfxPoolItem& rItem ) const
return( ((SfxImageItem&) rItem).GetValue() == GetValue() && (*pImp == *(((SfxImageItem&)rItem).pImp) ) );
}
-bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const
+bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
{
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq( 4 );
aSeq[0] = ::com::sun::star::uno::makeAny( GetValue() );
@@ -100,7 +100,7 @@ bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE ) const
return true;
}
-bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
+bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq;
if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 ))
@@ -129,12 +129,12 @@ long SfxImageItem::GetRotation() const
return pImp->nAngle;
}
-void SfxImageItem::SetMirrored( BOOL bSet )
+void SfxImageItem::SetMirrored( sal_Bool bSet )
{
pImp->bMirrored = bSet;
}
-BOOL SfxImageItem::IsMirrored() const
+sal_Bool SfxImageItem::IsMirrored() const
{
return pImp->bMirrored;
}
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index 3c6f63abb638..85f9d309f435 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -45,11 +45,11 @@ TYPEINIT1_AUTOFACTORY(SfxByteItem, CntByteItem);
//============================================================================
// virtual
-SfxPoolItem * SfxByteItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * SfxByteItem::Create(SvStream & rStream, sal_uInt16) const
{
short nValue = 0;
rStream >> nValue;
- return new SfxByteItem(Which(), BYTE(nValue));
+ return new SfxByteItem(Which(), sal_uInt8(nValue));
}
//============================================================================
@@ -64,7 +64,7 @@ DBG_NAME(SfxInt16Item);
TYPEINIT1_AUTOFACTORY(SfxInt16Item, SfxPoolItem);
//============================================================================
-SfxInt16Item::SfxInt16Item(USHORT which, SvStream & rStream):
+SfxInt16Item::SfxInt16Item(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
DBG_CTOR(SfxInt16Item, 0);
@@ -112,7 +112,7 @@ SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const
+bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
sal_Int16 nValue = m_nValue;
rVal <<= nValue;
@@ -121,7 +121,7 @@ bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, BYTE) const
//============================================================================
// virtual
-bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, BYTE )
+bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
sal_Int16 nValue = sal_Int16();
if (rVal >>= nValue)
@@ -136,7 +136,7 @@ bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, BYTE )
//============================================================================
// virtual
-SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(SfxInt16Item, 0);
return new SfxInt16Item(Which(), rStream);
@@ -144,7 +144,7 @@ SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & SfxInt16Item::Store(SvStream & rStream, USHORT) const
+SvStream & SfxInt16Item::Store(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(SfxInt16Item, 0);
rStream << short(m_nValue);
@@ -159,14 +159,14 @@ SfxPoolItem * SfxInt16Item::Clone(SfxItemPool *) const
}
//============================================================================
-INT16 SfxInt16Item::GetMin() const
+sal_Int16 SfxInt16Item::GetMin() const
{
DBG_CHKTHIS(SfxInt16Item, 0);
return -32768;
}
//============================================================================
-INT16 SfxInt16Item::GetMax() const
+sal_Int16 SfxInt16Item::GetMax() const
{
DBG_CHKTHIS(SfxInt16Item, 0);
return 32767;
@@ -218,14 +218,14 @@ DBG_NAME(SfxMetricItem);
TYPEINIT1_AUTOFACTORY(SfxMetricItem, SfxInt32Item);
//============================================================================
-SfxMetricItem::SfxMetricItem(USHORT which, UINT32 nValue):
+SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue):
SfxInt32Item(which, nValue)
{
DBG_CTOR(SfxMetricItem, 0);
}
//============================================================================
-SfxMetricItem::SfxMetricItem(USHORT which, SvStream & rStream):
+SfxMetricItem::SfxMetricItem(sal_uInt16 which, SvStream & rStream):
SfxInt32Item(which, rStream)
{
DBG_CTOR(SfxMetricItem, 0);
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 942c4385776c..6d9346a3ac5c 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -37,14 +37,6 @@
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
#include "poolio.hxx"
-#include <algorithm>
-
-// STATIC DATA -----------------------------------------------------------
-
-
-//========================================================================
-
-SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* );
//========================================================================
@@ -63,7 +55,7 @@ void SfxItemPool::RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser)
}
}
-const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const
+const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const
{
DBG_CHKTHIS(SfxItemPool, 0);
const SfxPoolItem* pRet;
@@ -81,15 +73,15 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const
// -----------------------------------------------------------------------
-inline bool SfxItemPool::IsItemFlag_Impl( USHORT nPos, USHORT nFlag ) const
+inline bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const
{
- USHORT nItemFlag = pItemInfos[nPos]._nFlags;
+ sal_uInt16 nItemFlag = pItemInfos[nPos]._nFlags;
return nFlag == (nItemFlag & nFlag);
}
// -----------------------------------------------------------------------
-bool SfxItemPool::IsItemFlag( USHORT nWhich, USHORT nFlag ) const
+bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const
{
for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary )
{
@@ -97,7 +89,7 @@ bool SfxItemPool::IsItemFlag( USHORT nWhich, USHORT nFlag ) const
return pPool->IsItemFlag_Impl( pPool->GetIndex_Impl(nWhich), nFlag);
}
DBG_ASSERT( !IsWhich(nWhich), "unknown which-id" );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -114,8 +106,8 @@ SfxItemPool::SfxItemPool
(
UniString const & rName, /* Name des Pools zur Idetifikation
im File-Format */
- USHORT nStartWhich, /* erste Which-Id des Pools */
- USHORT nEndWhich, /* letzte Which-Id des Pools */
+ sal_uInt16 nStartWhich, /* erste Which-Id des Pools */
+ sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */
#ifdef TF_POOLABLE
const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */
#endif
@@ -123,7 +115,7 @@ SfxItemPool::SfxItemPool
wird direkt vom Pool referenziert,
jedoch kein Eigent"umer"ubergang */
#ifndef TF_POOLABLE
- USHORT* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */
+ sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */
#endif
bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
)
@@ -155,8 +147,8 @@ SfxItemPool::SfxItemPool
[Querverweise]
<SfxItemPool::SetDefaults(SfxItemPool**)>
- <SfxItemPool::ReleaseDefaults(SfxPoolItem**,USHORT,BOOL)>
- <SfxItemPool::ReldaseDefaults(BOOL)>
+ <SfxItemPool::ReleaseDefaults(SfxPoolItem**,sal_uInt16,sal_Bool)>
+ <SfxItemPool::ReldaseDefaults(sal_Bool)>
*/
: aName(rName),
@@ -181,7 +173,7 @@ SfxItemPool::SfxItemPool
pImp->eDefMetric = SFX_MAPUNIT_TWIP;
pImp->nVersion = 0;
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
pImp->nLoadingVersion = 0;
pImp->nInitRefCount = 1;
pImp->nVerStart = nStart;
@@ -202,10 +194,10 @@ SfxItemPool::SfxItemPool
SfxItemPool::SfxItemPool
(
const SfxItemPool& rPool, // von dieser Instanz kopieren
- BOOL bCloneStaticDefaults /* TRUE
+ sal_Bool bCloneStaticDefaults /* sal_True
statische Defaults kopieren
- FALSE
+ sal_False
statische Defaults
"ubernehehmen */
)
@@ -240,7 +232,7 @@ SfxItemPool::SfxItemPool
DBG_CTOR(SfxItemPool, 0);
pImp->eDefMetric = rPool.pImp->eDefMetric;
pImp->nVersion = rPool.pImp->nVersion;
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
pImp->nLoadingVersion = 0;
pImp->nInitRefCount = 1;
pImp->nVerStart = rPool.pImp->nVerStart;
@@ -255,7 +247,7 @@ SfxItemPool::SfxItemPool
if ( bCloneStaticDefaults )
{
SfxPoolItem **ppDefaults = new SfxPoolItem*[nEnd-nStart+1];
- for ( USHORT n = 0; n <= nEnd - nStart; ++n )
+ for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n )
{
(*( ppDefaults + n )) = (*( rPool.ppStaticDefaults + n ))->Clone(this);
(*( ppDefaults + n ))->SetKind( SFX_ITEMS_STATICDEFAULT );
@@ -267,20 +259,19 @@ SfxItemPool::SfxItemPool
SetDefaults( rPool.ppStaticDefaults );
// Pool Defaults kopieren
- for ( USHORT n = 0; n <= nEnd - nStart; ++n )
+ for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n )
if ( (*( rPool.ppPoolDefaults + n )) )
{
(*( ppPoolDefaults + n )) = (*( rPool.ppPoolDefaults + n ))->Clone(this);
(*( ppPoolDefaults + n ))->SetKind( SFX_ITEMS_POOLDEFAULT );
}
- // Version-Map kopieren
- USHORT nVerCount = rPool.pImp->aVersions.Count();
- for ( USHORT nVer = 0; nVer < nVerCount; ++nVer )
+ // Copy Version-Map
+ for ( size_t nVer = 0; nVer < rPool.pImp->aVersions.size(); ++nVer )
{
- const SfxPoolVersion_Impl *pOld = rPool.pImp->aVersions.GetObject(nVer);
- const SfxPoolVersion_Impl *pNew = new SfxPoolVersion_Impl( *pOld );
- pImp->aVersions.Insert( pNew, nVer );
+ const SfxPoolVersion_ImplPtr pOld = rPool.pImp->aVersions[nVer];
+ SfxPoolVersion_ImplPtr pNew = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl( *pOld ) );
+ pImp->aVersions.push_back( pNew );
}
// Verkettung wiederherstellen
@@ -303,7 +294,7 @@ void SfxItemPool::SetDefaults( SfxPoolItem **pDefaults )
DBG_ASSERT( (*ppStaticDefaults)->GetRefCount() == 0 ||
IsDefaultItem( (*ppStaticDefaults) ),
"das sind keine statics" );
- for ( USHORT n = 0; n <= nEnd - nStart; ++n )
+ for ( sal_uInt16 n = 0; n <= nEnd - nStart; ++n )
{
SFX_ASSERT( (*( ppStaticDefaults + n ))->Which() == n + nStart,
n + nStart, "static defaults not sorted" );
@@ -317,11 +308,11 @@ void SfxItemPool::SetDefaults( SfxPoolItem **pDefaults )
void SfxItemPool::ReleaseDefaults
(
- BOOL bDelete /* TRUE
+ sal_Bool bDelete /* sal_True
l"oscht sowohl das Array als auch die einzelnen
statischen Defaults
- FALSE
+ sal_False
l"oscht weder das Array noch die einzelnen
statischen Defaults */
)
@@ -340,7 +331,7 @@ void SfxItemPool::ReleaseDefaults
ReleaseDefaults( ppStaticDefaults, nEnd - nStart + 1, bDelete );
// KSO (22.10.98): ppStaticDefaults zeigt auf geloeschten Speicher,
- // wenn bDelete == TRUE.
+ // wenn bDelete == sal_True.
if ( bDelete )
ppStaticDefaults = 0;
}
@@ -351,13 +342,13 @@ void SfxItemPool::ReleaseDefaults
(
SfxPoolItem** pDefaults, /* freizugebende statische Defaults */
- USHORT nCount, /* Anzahl der statischen Defaults */
+ sal_uInt16 nCount, /* Anzahl der statischen Defaults */
- BOOL bDelete /* TRUE
+ sal_Bool bDelete /* sal_True
l"oscht sowohl das Array als auch die
einzelnen statischen Defaults
- FALSE
+ sal_False
l"oscht weder das Array noch die
einzelnen statischen Defaults */
)
@@ -375,7 +366,7 @@ void SfxItemPool::ReleaseDefaults
{
DBG_ASSERT( pDefaults, "erst wollen, dann nichts geben..." );
- for ( USHORT n = 0; n < nCount; ++n )
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
SFX_ASSERT( IsStaticDefaultItem( *(pDefaults+n) ),
n, "das ist kein static-default" );
@@ -439,13 +430,13 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
if ( pImp->ppPoolItems && pSecondary->pImp->ppPoolItems )
{
// hat der master SetItems?
- BOOL bHasSetItems = FALSE;
- for ( USHORT i = 0; !bHasSetItems && i < nEnd-nStart; ++i )
+ sal_Bool bHasSetItems = sal_False;
+ for ( sal_uInt16 i = 0; !bHasSetItems && i < nEnd-nStart; ++i )
bHasSetItems = ppStaticDefaults[i]->ISA(SfxSetItem);
// abgehaengte Pools muessen leer sein
- BOOL bOK = bHasSetItems;
- for ( USHORT n = 0;
+ sal_Bool bOK = bHasSetItems;
+ for ( sal_uInt16 n = 0;
bOK && n <= pSecondary->nEnd - pSecondary->nStart;
++n )
{
@@ -453,13 +444,12 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
pSecondary->pImp->ppPoolItems + n;
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr =
- (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT i = (*ppItemArr)->Count(); i; ++ppHtArr, --i )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i )
if ( !(*ppHtArr) )
{
OSL_FAIL( "old secondary pool must be empty" );
- bOK = FALSE;
+ bOK = sal_False;
break;
}
}
@@ -485,7 +475,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
// -----------------------------------------------------------------------
-SfxMapUnit SfxItemPool::GetMetric( USHORT ) const
+SfxMapUnit SfxItemPool::GetMetric( sal_uInt16 ) const
{
DBG_CHKTHIS(SfxItemPool, 0);
@@ -564,7 +554,7 @@ void SfxItemPool::Delete()
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
SfxPoolItem** ppDefaultItem = ppPoolDefaults;
SfxPoolItem** ppStaticDefaultItem = ppStaticDefaults;
- USHORT nArrCnt;
+ sal_uInt16 nArrCnt;
//Erst die SetItems abraeumen
HACK( "fuer Image, dort gibt es derzeit keine Statics - Bug" )
@@ -581,8 +571,8 @@ void SfxItemPool::Delete()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -613,8 +603,8 @@ void SfxItemPool::Delete()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -648,7 +638,7 @@ void SfxItemPool::Cleanup()
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
SfxPoolItem** ppDefaultItem = ppPoolDefaults;
SfxPoolItem** ppStaticDefaultItem = ppStaticDefaults;
- USHORT nArrCnt;
+ sal_uInt16 nArrCnt;
HACK( "fuer Image, dort gibt es derzeit keine Statics - Bug" )
if ( ppStaticDefaults ) //HACK fuer Image, dort gibt es keine Statics!!
@@ -662,8 +652,8 @@ void SfxItemPool::Cleanup()
((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) ||
(*ppStaticDefaultItem)->ISA(SfxSetItem)) )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if ( *ppHtArr && !(*ppHtArr)->GetRefCount() )
{
DELETEZ(*ppHtArr);
@@ -680,8 +670,8 @@ void SfxItemPool::Cleanup()
{
if ( *ppItemArr )
{
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for ( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if ( *ppHtArr && !(*ppHtArr)->GetRefCount() )
DELETEZ( *ppHtArr );
}
@@ -718,7 +708,7 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem)
* Resets the default of the given <Which-Id> back to the static default.
* If a pool default exists it is removed.
*/
-void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId )
+void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId )
{
DBG_CHKTHIS(SfxItemPool, 0);
if ( IsInRange(nWhichId) )
@@ -741,7 +731,7 @@ void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId )
// -----------------------------------------------------------------------
-const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
+const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
@@ -752,7 +742,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
nWhich = rItem.Which();
// richtigen Secondary-Pool finden
- BOOL bSID = nWhich > SFX_WHICH_MAX;
+ sal_Bool bSID = nWhich > SFX_WHICH_MAX;
if ( !bSID && !IsInRange(nWhich) )
{
if ( pSecondary )
@@ -761,7 +751,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
}
// SID oder nicht poolable (neue Definition)?
- USHORT nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich);
if ( USHRT_MAX == nIndex ||
IsItemFlag_Impl( nIndex, SFX_ITEM_NOT_POOLABLE ) )
{
@@ -781,15 +771,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
if( !*ppItemArr )
*ppItemArr = new SfxPoolItemArray_Impl;
- SfxPoolItem **ppFree = 0;
- SfxPoolItem** ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData();
+ SfxPoolItemArrayBase_Impl::iterator ppFree;
+ sal_Bool ppFreeIsSet = sal_False;
+ SfxPoolItemArrayBase_Impl::iterator ppHtArray = (*ppItemArr)->begin();
if ( IsItemFlag_Impl( nIndex, SFX_ITEM_POOLABLE ) )
{
// wenn es ueberhaupt gepoolt ist, koennte es schon drin sein
if ( IsPooledItem(&rItem) )
{
// 1. Schleife: teste ob der Pointer vorhanden ist.
- for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArray, --n )
+ for( size_t n = (*ppItemArr)->size(); n; ++ppHtArray, --n )
if( &rItem == (*ppHtArray) )
{
AddRef( **ppHtArray );
@@ -798,8 +789,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
}
// 2. Schleife: dann muessen eben die Attribute verglichen werden
- USHORT n;
- for ( n = (*ppItemArr)->Count(), ppHtArray = (SfxPoolItem**)(*ppItemArr)->GetData();
+ size_t n;
+ for ( n = (*ppItemArr)->size(), ppHtArray = (*ppItemArr)->begin();
n; ++ppHtArray, --n )
{
if ( *ppHtArray )
@@ -811,22 +802,26 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
}
}
else
- if ( !ppFree )
+ if ( ppFreeIsSet == sal_False )
+ {
ppFree = ppHtArray;
+ ppFreeIsSet = sal_True;
+ }
}
}
else
{
// freien Platz suchen
- SfxPoolItem** ppHtArr;
- USHORT n, nCount = (*ppItemArr)->Count();
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr;
+ size_t n, nCount = (*ppItemArr)->size();
for ( n = (*ppItemArr)->nFirstFree,
- ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData() + n;
+ ppHtArr = (*ppItemArr)->begin() + n;
n < nCount;
++ppHtArr, ++n )
if ( !*ppHtArr )
{
ppFree = ppHtArr;
+ ppFreeIsSet = sal_True;
break;
}
@@ -852,9 +847,9 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, USHORT nWhich )
#endif
#endif
AddRef( *pNewItem, pImp->nInitRefCount );
- const SfxPoolItem* pTemp = pNewItem;
- if ( !ppFree )
- (*ppItemArr)->Insert( pTemp, (*ppItemArr)->Count() );
+ SfxPoolItem* pTemp = pNewItem;
+ if ( ppFreeIsSet == sal_False )
+ (*ppItemArr)->push_back( pTemp );
else
{
DBG_ASSERT( *ppFree == 0, "using surrogate in use" );
@@ -877,8 +872,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
"wo kommt denn hier ein Pool-Default her" );
// richtigen Secondary-Pool finden
- const USHORT nWhich = rItem.Which();
- BOOL bSID = nWhich > SFX_WHICH_MAX;
+ const sal_uInt16 nWhich = rItem.Which();
+ sal_Bool bSID = nWhich > SFX_WHICH_MAX;
if ( !bSID && !IsInRange(nWhich) )
{
if ( pSecondary )
@@ -890,7 +885,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
}
// SID oder nicht poolable (neue Definition)?
- USHORT nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = bSID ? USHRT_MAX : GetIndex_Impl(nWhich);
if ( bSID || IsItemFlag_Impl( nIndex, SFX_ITEM_NOT_POOLABLE ) )
{
SFX_ASSERT( USHRT_MAX != nIndex ||
@@ -914,8 +909,8 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
// Item im eigenen Pool suchen
SfxPoolItemArray_Impl** ppItemArr = (pImp->ppPoolItems + nIndex);
SFX_ASSERT( *ppItemArr, rItem.Which(), "removing Item not in Pool" );
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; ++ppHtArr, --n )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; ++ppHtArr, --n )
if( *ppHtArr == &rItem )
{
if ( (*ppHtArr)->GetRefCount() ) //!
@@ -927,7 +922,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
}
// ggf. kleinstmoegliche freie Position merken
- USHORT nPos = (*ppItemArr)->Count() - n;
+ size_t nPos = (*ppItemArr)->size() - n;
if ( (*ppItemArr)->nFirstFree > nPos )
(*ppItemArr)->nFirstFree = nPos;
@@ -945,7 +940,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
// -----------------------------------------------------------------------
-const SfxPoolItem& SfxItemPool::GetDefaultItem( USHORT nWhich ) const
+const SfxPoolItem& SfxItemPool::GetDefaultItem( sal_uInt16 nWhich ) const
{
DBG_CHKTHIS(SfxItemPool, 0);
@@ -957,7 +952,7 @@ const SfxPoolItem& SfxItemPool::GetDefaultItem( USHORT nWhich ) const
}
DBG_ASSERT( ppStaticDefaults, "no defaults known - dont ask me for defaults" );
- USHORT nPos = GetIndex_Impl(nWhich);
+ sal_uInt16 nPos = GetIndex_Impl(nWhich);
SfxPoolItem *pDefault = *(ppPoolDefaults + nPos);
if ( pDefault )
return *pDefault;
@@ -985,17 +980,17 @@ void SfxItemPool::FreezeIdRanges()
// -----------------------------------------------------------------------
-void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const
+void SfxItemPool::FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const
{
DBG_CHKTHIS(SfxItemPool, 0);
DBG_ASSERT( !_pPoolRanges, "GetFrozenRanges() would be faster!" );
const SfxItemPool *pPool;
- USHORT nLevel = 0;
+ sal_uInt16 nLevel = 0;
for( pPool = this; pPool; pPool = pPool->pSecondary )
++nLevel;
- pWhichRanges = new USHORT[ 2*nLevel + 1 ];
+ pWhichRanges = new sal_uInt16[ 2*nLevel + 1 ];
nLevel = 0;
for( pPool = this; pPool; pPool = pPool->pSecondary )
@@ -1008,24 +1003,24 @@ void SfxItemPool::FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const
// -----------------------------------------------------------------------
-const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const
+const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) const
{
DBG_CHKTHIS(SfxItemPool, 0);
if ( !IsInRange(nWhich) )
{
if ( pSecondary )
- return pSecondary->GetItem( nWhich, nOfst );
+ return pSecondary->GetItem2( nWhich, nOfst );
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" );
return 0;
}
// dflt-Attribut?
- if ( nOfst == SFX_ITEMS_STATICDEFAULT )
+ if ( nOfst == SFX_ITEMS_DEFAULT )
return *(ppStaticDefaults + GetIndex_Impl(nWhich));
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich));
- if( pItemArr && nOfst < pItemArr->Count() )
+ if( pItemArr && nOfst < pItemArr->size() )
return (*pItemArr)[nOfst];
return 0;
@@ -1033,41 +1028,41 @@ const SfxPoolItem *SfxItemPool::GetItem(USHORT nWhich, USHORT nOfst) const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetItemCount(USHORT nWhich) const
+sal_uInt32 SfxItemPool::GetItemCount2(sal_uInt16 nWhich) const
{
DBG_CHKTHIS(SfxItemPool, 0);
if ( !IsInRange(nWhich) )
{
if ( pSecondary )
- return pSecondary->GetItemCount( nWhich );
+ return pSecondary->GetItemCount2( nWhich );
SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" );
return 0;
}
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(nWhich));
if ( pItemArr )
- return pItemArr->Count();
+ return pItemArr->size();
return 0;
}
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetWhich( USHORT nSlotId, BOOL bDeep ) const
+sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
{
if ( !IsSlot(nSlotId) )
return nSlotId;
#ifdef TF_POOLABLE
- USHORT nCount = nEnd - nStart + 1;
- for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs )
+ sal_uInt16 nCount = nEnd - nStart + 1;
+ for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart;
#else
if ( pSlotIds )
{
- USHORT nCount = nEnd - nStart + 1;
- for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs )
+ sal_uInt16 nCount = nEnd - nStart + 1;
+ for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pSlotIds[nOfs] == nSlotId )
return nOfs + nStart;
}
@@ -1079,7 +1074,7 @@ USHORT SfxItemPool::GetWhich( USHORT nSlotId, BOOL bDeep ) const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const
+sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
{
if ( !IsWhich(nWhich) )
return nWhich;
@@ -1093,7 +1088,7 @@ USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const
}
#ifdef TF_POOLABLE
- USHORT nSID = pItemInfos[nWhich - nStart]._nSID;
+ sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID;
return nSID ? nSID : nWhich;
#else
else if ( pSlotIds )
@@ -1104,21 +1099,21 @@ USHORT SfxItemPool::GetSlotId( USHORT nWhich, BOOL bDeep ) const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetTrueWhich( USHORT nSlotId, BOOL bDeep ) const
+sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
{
if ( !IsSlot(nSlotId) )
return 0;
#ifdef TF_POOLABLE
- USHORT nCount = nEnd - nStart + 1;
- for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs )
+ sal_uInt16 nCount = nEnd - nStart + 1;
+ for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pItemInfos[nOfs]._nSID == nSlotId )
return nOfs + nStart;
#else
if ( pSlotIds )
{
- USHORT nCount = nEnd - nStart + 1;
- for ( USHORT nOfs = 0; nOfs < nCount; ++nOfs )
+ sal_uInt16 nCount = nEnd - nStart + 1;
+ for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
if ( pSlotIds[nOfs] == nSlotId )
return nOfs + nStart;
}
@@ -1130,7 +1125,7 @@ USHORT SfxItemPool::GetTrueWhich( USHORT nSlotId, BOOL bDeep ) const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetTrueSlotId( USHORT nWhich, BOOL bDeep ) const
+sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
{
if ( !IsWhich(nWhich) )
return 0;
@@ -1152,7 +1147,7 @@ USHORT SfxItemPool::GetTrueSlotId( USHORT nWhich, BOOL bDeep ) const
#endif
}
// -----------------------------------------------------------------------
-void SfxItemPool::SetFileFormatVersion( USHORT nFileFormatVersion )
+void SfxItemPool::SetFileFormatVersion( sal_uInt16 nFileFormatVersion )
/* [Description]
diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx
index ac2e2d4ef322..95ae5f4e71ec 100644
--- a/svl/source/items/itemprop.cxx
+++ b/svl/source/items/itemprop.cxx
@@ -185,9 +185,9 @@ SfxItemPropertySet::~SfxItemPropertySet()
{
}
-BOOL SfxItemPropertySet::FillItem(SfxItemSet&, USHORT, BOOL) const
+sal_Bool SfxItemPropertySet::FillItem(SfxItemSet&, sal_uInt16, sal_Bool) const
{
- return FALSE;
+ return sal_False;
}
void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEntry,
@@ -196,7 +196,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn
{
// get the SfxPoolItem
const SfxPoolItem* pItem = 0;
- SfxItemState eState = rSet.GetItemState( rEntry.nWID, TRUE, &pItem );
+ SfxItemState eState = rSet.GetItemState( rEntry.nWID, sal_True, &pItem );
if(SFX_ITEM_SET != eState && SFX_WHICH_MAX > rEntry.nWID )
pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID);
// return item values as uno::Any
@@ -207,7 +207,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn
else
{
SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID);
- if(FillItem(aSet, rEntry.nWID, TRUE))
+ if(FillItem(aSet, rEntry.nWID, sal_True))
{
const SfxPoolItem& rItem = aSet.Get(rEntry.nWID);
rItem.QueryValue( rAny, rEntry.nMemberId );
@@ -221,7 +221,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn
if( rEntry.pType && TypeClass_ENUM == rEntry.pType->getTypeClass() &&
rAny.getValueTypeClass() == TypeClass_LONG )
{
- INT32 nTmp = *(INT32*)rAny.getValue();
+ sal_Int32 nTmp = *(sal_Int32*)rAny.getValue();
rAny.setValue( &nTmp, *rEntry.pType );
}
}
@@ -255,14 +255,14 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn
// get the SfxPoolItem
const SfxPoolItem* pItem = 0;
SfxPoolItem *pNewItem = 0;
- SfxItemState eState = rSet.GetItemState( rEntry.nWID, TRUE, &pItem );
+ SfxItemState eState = rSet.GetItemState( rEntry.nWID, sal_True, &pItem );
if(SFX_ITEM_SET != eState && SFX_WHICH_MAX > rEntry.nWID )
pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID);
//maybe there's another way to find an Item
if(eState < SFX_ITEM_DEFAULT)
{
SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID);
- if(FillItem(aSet, rEntry.nWID, FALSE))
+ if(FillItem(aSet, rEntry.nWID, sal_False))
{
const SfxPoolItem &rItem = aSet.Get(rEntry.nWID);
pNewItem = rItem.Clone();
@@ -304,10 +304,10 @@ PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEn
throw()
{
PropertyState eRet = PropertyState_DIRECT_VALUE;
- USHORT nWhich = rEntry.nWID;
+ sal_uInt16 nWhich = rEntry.nWID;
// item state holen
- SfxItemState eState = rSet.GetItemState( nWhich, FALSE );
+ SfxItemState eState = rSet.GetItemState( nWhich, sal_False );
// item-Wert als UnoAny zurueckgeben
if(eState == SFX_ITEM_DEFAULT)
eRet = PropertyState_DEFAULT_VALUE;
@@ -327,11 +327,11 @@ PropertyState SfxItemPropertySet::getPropertyState(
{
throw UnknownPropertyException();
}
- USHORT nWhich = pEntry->nWID;
+ sal_uInt16 nWhich = pEntry->nWID;
// item holen
const SfxPoolItem* pItem = 0;
- SfxItemState eState = rSet.GetItemState( nWhich, FALSE, &pItem );
+ SfxItemState eState = rSet.GetItemState( nWhich, sal_False, &pItem );
if(!pItem && nWhich != rSet.GetPool()->GetSlotId(nWhich))
pItem = &rSet.GetPool()->GetDefaultItem(nWhich);
// item-Wert als UnoAny zurueckgeben
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 20ba062cc590..78fbd27e8bdb 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -32,7 +32,6 @@
#include <string.h>
#include <cstdarg>
-
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
@@ -40,7 +39,7 @@
#include <svl/itemset.hxx>
#include <svl/itempool.hxx>
#include <svl/itemiter.hxx>
-#include "whiter.hxx"
+#include <svl/whiter.hxx>
#include <svl/nranges.hxx>
#include "whassert.hxx"
@@ -49,16 +48,16 @@
// STATIC DATA -----------------------------------------------------------
-static const USHORT nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0'
+static const sal_uInt16 nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0'
#if OSL_DEBUG_LEVEL > 1
-static ULONG nRangesCopyCount = 0; // wie oft wurden Ranges kopiert
+static sal_uLong nRangesCopyCount = 0; // wie oft wurden Ranges kopiert
#endif
DBG_NAME(SfxItemSet)
//========================================================================
-#define NUMTYPE USHORT
+#define NUMTYPE sal_uInt16
#define SvNums SvUShorts
#define SfxNumRanges SfxUShortRanges
#include "nranges.cxx"
@@ -66,7 +65,7 @@ DBG_NAME(SfxItemSet)
#undef SvNums
#undef SfxNumRanges
-#define NUMTYPE ULONG
+#define NUMTYPE sal_uLong
#define SvNums SvULongs
#define SfxNumRanges SfxULongRanges
#include "nranges.cxx"
@@ -83,8 +82,8 @@ const sal_Char *DbgCheckItemSet( const void* pVoid )
{
const SfxItemSet *pSet = (const SfxItemSet*) pVoid;
SfxWhichIter aIter( *pSet );
- USHORT nCount = 0, n = 0;
- for ( USHORT nWh = aIter.FirstWhich(); nWh; nWh = aIter.NextWhich(), ++n )
+ sal_uInt16 nCount = 0, n = 0;
+ for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh; nWh = aIter.NextWhich(), ++n )
{
const SfxPoolItem *pItem = pSet->_aItems[n];
if ( pItem )
@@ -114,12 +113,12 @@ SfxItemSet::SfxItemSet
SfxItemPool& rPool, /* der Pool, in dem die SfxPoolItems,
welche in dieses SfxItemSet gelangen,
aufgenommen werden sollen */
- BOOL
+ sal_Bool
#ifdef DBG_UTIL
#ifdef SFX_ITEMSET_NO_DEFAULT_CTOR
bTotalRanges /* komplette Pool-Ranges uebernehmen,
- muss auf TRUE gesetzt werden */
+ muss auf sal_True gesetzt werden */
#endif
#endif
)
@@ -151,19 +150,19 @@ SfxItemSet::SfxItemSet
#endif
#endif
- _pWhichRanges = (USHORT*) _pPool->GetFrozenIdRanges();
+ _pWhichRanges = (sal_uInt16*) _pPool->GetFrozenIdRanges();
DBG_ASSERT( _pWhichRanges, "don't create ItemSets with full range before FreezeIdRanges()" );
if ( !_pWhichRanges )
_pPool->FillItemIdRanges_Impl( _pWhichRanges );
- const USHORT nSize = TotalCount();
+ const sal_uInt16 nSize = TotalCount();
_aItems = new const SfxPoolItem* [ nSize ];
memset( (void*) _aItems, 0, nSize * sizeof( SfxPoolItem* ) );
}
// -----------------------------------------------------------------------
-SfxItemSet::SfxItemSet( SfxItemPool& rPool, USHORT nWhich1, USHORT nWhich2 ):
+SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ):
_pPool( &rPool ),
_pParent( 0 ),
_nCount( 0 )
@@ -178,25 +177,25 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, USHORT nWhich1, USHORT nWhich2 ):
// -----------------------------------------------------------------------
-void SfxItemSet::InitRanges_Impl(USHORT nWh1, USHORT nWh2)
+void SfxItemSet::InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2)
{
DBG_CHKTHIS(SfxItemSet, 0);
- _pWhichRanges = new USHORT[ 3 ];
+ _pWhichRanges = new sal_uInt16[ 3 ];
*(_pWhichRanges+0) = nWh1;
*(_pWhichRanges+1) = nWh2;
*(_pWhichRanges+2) = 0;
- const USHORT nRg = nWh2 - nWh1 + 1;
+ const sal_uInt16 nRg = nWh2 - nWh1 + 1;
_aItems = new const SfxPoolItem* [ nRg ];
memset( (void*) _aItems, 0, nRg * sizeof( SfxPoolItem* ) );
}
// -----------------------------------------------------------------------
-void SfxItemSet::InitRanges_Impl(va_list pArgs, USHORT nWh1, USHORT nWh2, USHORT nNull)
+void SfxItemSet::InitRanges_Impl(va_list pArgs, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull)
{
DBG_CHKTHIS(SfxItemSet, 0);
- USHORT nSize = InitializeRanges_Impl( _pWhichRanges, pArgs, nWh1, nWh2, nNull );
+ sal_uInt16 nSize = InitializeRanges_Impl( _pWhichRanges, pArgs, nWh1, nWh2, nNull );
_aItems = new const SfxPoolItem* [ nSize ];
memset( (void*) _aItems, 0, sizeof( SfxPoolItem* ) * nSize );
}
@@ -217,29 +216,29 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool,
if(!nNull)
InitRanges_Impl(
- sal::static_int_cast< USHORT >(nWh1),
- sal::static_int_cast< USHORT >(nWh2));
+ sal::static_int_cast< sal_uInt16 >(nWh1),
+ sal::static_int_cast< sal_uInt16 >(nWh2));
else {
va_list pArgs;
va_start( pArgs, nNull );
InitRanges_Impl(
- pArgs, sal::static_int_cast< USHORT >(nWh1),
- sal::static_int_cast< USHORT >(nWh2),
- sal::static_int_cast< USHORT >(nNull));
+ pArgs, sal::static_int_cast< sal_uInt16 >(nWh1),
+ sal::static_int_cast< sal_uInt16 >(nWh2),
+ sal::static_int_cast< sal_uInt16 >(nNull));
}
}
// -----------------------------------------------------------------------
-void SfxItemSet::InitRanges_Impl(const USHORT *pWhichPairTable)
+void SfxItemSet::InitRanges_Impl(const sal_uInt16 *pWhichPairTable)
{
DBG_CHKTHIS(SfxItemSet, 0);
#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount);
#endif
- USHORT nCnt = 0;
- const USHORT* pPtr = pWhichPairTable;
+ sal_uInt16 nCnt = 0;
+ const sal_uInt16* pPtr = pWhichPairTable;
while( *pPtr )
{
nCnt += ( *(pPtr+1) - *pPtr ) + 1;
@@ -250,14 +249,14 @@ void SfxItemSet::InitRanges_Impl(const USHORT *pWhichPairTable)
memset( (void*) _aItems, 0, sizeof( SfxPoolItem* ) * nCnt );
std::ptrdiff_t cnt = pPtr - pWhichPairTable +1;
- _pWhichRanges = new USHORT[ cnt ];
- memcpy( _pWhichRanges, pWhichPairTable, sizeof( USHORT ) * cnt );
+ _pWhichRanges = new sal_uInt16[ cnt ];
+ memcpy( _pWhichRanges, pWhichPairTable, sizeof( sal_uInt16 ) * cnt );
}
// -----------------------------------------------------------------------
-SfxItemSet::SfxItemSet( SfxItemPool& rPool, const USHORT* pWhichPairTable ):
+SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable ):
_pPool( &rPool ),
_pParent( 0 ),
_pWhichRanges(0),
@@ -285,8 +284,8 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
DBG( ++*_pChildCount(_pParent) );
// errechne die Anzahl von Attributen
- USHORT nCnt = 0;
- USHORT* pPtr = rASet._pWhichRanges;
+ sal_uInt16 nCnt = 0;
+ sal_uInt16* pPtr = rASet._pWhichRanges;
while( *pPtr )
{
nCnt += ( *(pPtr+1) - *pPtr ) + 1;
@@ -297,7 +296,7 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
// Attribute kopieren
SfxItemArray ppDst = _aItems, ppSrc = rASet._aItems;
- for( USHORT n = nCnt; n; --n, ++ppDst, ++ppSrc )
+ for( sal_uInt16 n = nCnt; n; --n, ++ppDst, ++ppSrc )
if ( 0 == *ppSrc || // aktueller Default?
IsInvalidItem(*ppSrc) || // Dont Care?
IsStaticDefaultItem(*ppSrc) ) // nicht zu poolende Defaults
@@ -320,8 +319,8 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount);
#endif
std::ptrdiff_t cnt = pPtr - rASet._pWhichRanges+1;
- _pWhichRanges = new USHORT[ cnt ];
- memcpy( _pWhichRanges, rASet._pWhichRanges, sizeof( USHORT ) * cnt);
+ _pWhichRanges = new sal_uInt16[ cnt ];
+ memcpy( _pWhichRanges, rASet._pWhichRanges, sizeof( sal_uInt16 ) * cnt);
}
// -----------------------------------------------------------------------
@@ -333,11 +332,11 @@ SfxItemSet::~SfxItemSet()
DBG( DBG_ASSERT( 0 == *_pChildCount(this), "SfxItemSet: deleting parent-itemset" ) )
#endif
- USHORT nCount = TotalCount();
+ sal_uInt16 nCount = TotalCount();
if( Count() )
{
SfxItemArray ppFnd = _aItems;
- for( USHORT nCnt = nCount; nCnt; --nCnt, ++ppFnd )
+ for( sal_uInt16 nCnt = nCount; nCnt; --nCnt, ++ppFnd )
if( *ppFnd && !IsInvalidItem(*ppFnd) )
{
if( !(*ppFnd)->Which() )
@@ -367,7 +366,7 @@ SfxItemSet::~SfxItemSet()
// -----------------------------------------------------------------------
-USHORT SfxItemSet::ClearItem( USHORT nWhich )
+sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
// einzelnes Item oder alle Items (nWhich==0) l"oschen
@@ -376,12 +375,12 @@ USHORT SfxItemSet::ClearItem( USHORT nWhich )
if( !Count() )
return 0;
- USHORT nDel = 0;
+ sal_uInt16 nDel = 0;
SfxItemArray ppFnd = _aItems;
if( nWhich )
{
- const USHORT* pPtr = _pWhichRanges;
+ const sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
// in diesem Bereich?
@@ -401,7 +400,7 @@ USHORT SfxItemSet::ClearItem( USHORT nWhich )
if ( nWhich <= SFX_WHICH_MAX )
{
const SfxPoolItem& rNew = _pParent
- ? _pParent->Get( nWhich, TRUE )
+ ? _pParent->Get( nWhich, sal_True )
: _pPool->GetDefaultItem( nWhich );
Changed( *pItemToClear, rNew );
@@ -423,7 +422,7 @@ USHORT SfxItemSet::ClearItem( USHORT nWhich )
{
nDel = _nCount;
- USHORT* pPtr = _pWhichRanges;
+ sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
for( nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
@@ -439,7 +438,7 @@ USHORT SfxItemSet::ClearItem( USHORT nWhich )
if ( nWhich <= SFX_WHICH_MAX )
{
const SfxPoolItem& rNew = _pParent
- ? _pParent->Get( nWhich, TRUE )
+ ? _pParent->Get( nWhich, sal_True )
: _pPool->GetDefaultItem( nWhich );
Changed( *pItemToClear, rNew );
@@ -467,15 +466,15 @@ USHORT SfxItemSet::ClearItem( USHORT nWhich )
// -----------------------------------------------------------------------
-void SfxItemSet::ClearInvalidItems( BOOL bHardDefault )
+void SfxItemSet::ClearInvalidItems( sal_Bool bHardDefault )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- USHORT* pPtr = _pWhichRanges;
+ sal_uInt16* pPtr = _pWhichRanges;
SfxItemArray ppFnd = _aItems;
if ( bHardDefault )
while( *pPtr )
{
- for ( USHORT nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
+ for ( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
if ( IsInvalidItem(*ppFnd) )
*ppFnd = &_pPool->Put( _pPool->GetDefaultItem(nWhich) );
pPtr += 2;
@@ -483,7 +482,7 @@ void SfxItemSet::ClearInvalidItems( BOOL bHardDefault )
else
while( *pPtr )
{
- for( USHORT nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
+ for( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
if( IsInvalidItem(*ppFnd) )
{
*ppFnd = 0;
@@ -506,8 +505,8 @@ void SfxItemSet::InvalidateAllItems()
// -----------------------------------------------------------------------
-SfxItemState SfxItemSet::GetItemState( USHORT nWhich,
- BOOL bSrchInParent,
+SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
+ sal_Bool bSrchInParent,
const SfxPoolItem **ppItem ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
@@ -517,7 +516,7 @@ SfxItemState SfxItemSet::GetItemState( USHORT nWhich,
do
{
SfxItemArray ppFnd = pAktSet->_aItems;
- const USHORT* pPtr = pAktSet->_pWhichRanges;
+ const sal_uInt16* pPtr = pAktSet->_pWhichRanges;
if (pPtr)
{
while ( *pPtr )
@@ -563,7 +562,7 @@ SfxItemState SfxItemSet::GetItemState( USHORT nWhich,
// -----------------------------------------------------------------------
-const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
+const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
@@ -572,7 +571,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
if ( !nWhich )
return 0; //! nur wegen Outliner-Bug
SfxItemArray ppFnd = _aItems;
- const USHORT* pPtr = _pWhichRanges;
+ const sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
if( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
@@ -624,7 +623,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
if (nWhich <= SFX_WHICH_MAX )
{
const SfxPoolItem& rOld = _pParent
- ? _pParent->Get( nWhich, TRUE )
+ ? _pParent->Get( nWhich, sal_True )
: _pPool->GetDefaultItem( nWhich );
Changed( rOld, rNew );
}
@@ -643,17 +642,17 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
// -----------------------------------------------------------------------
-int SfxItemSet::Put( const SfxItemSet& rSet, BOOL bInvalidAsDefault )
+int SfxItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rSet.Count() )
{
SfxItemArray ppFnd = rSet._aItems;
- const USHORT* pPtr = rSet._pWhichRanges;
+ const sal_uInt16* pPtr = rSet._pWhichRanges;
while ( *pPtr )
{
- for ( USHORT nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
+ for ( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
if( *ppFnd )
{
if ( IsInvalidItem( *ppFnd ) )
@@ -705,10 +704,10 @@ void SfxItemSet::PutExtended
// don't "optimize" with "if( rSet.Count()" because of dont-care + defaults
SfxItemArray ppFnd = rSet._aItems;
- const USHORT* pPtr = rSet._pWhichRanges;
+ const sal_uInt16* pPtr = rSet._pWhichRanges;
while ( *pPtr )
{
- for ( USHORT nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
+ for ( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd )
if( *ppFnd )
{
if ( IsInvalidItem( *ppFnd ) )
@@ -763,7 +762,7 @@ void SfxItemSet::PutExtended
// -----------------------------------------------------------------------
-void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo )
+void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
/** <H3>Description</H3>
Expands the ranges of settable items by 'nFrom' to 'nTo'. Keeps state of
@@ -771,8 +770,8 @@ void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo )
*/
{
- // special case: exactly one USHORT which is already included?
- if ( nFrom == nTo && SFX_ITEM_AVAILABLE <= GetItemState(nFrom, FALSE) )
+ // special case: exactly one sal_uInt16 which is already included?
+ if ( nFrom == nTo && SFX_ITEM_AVAILABLE <= GetItemState(nFrom, sal_False) )
return;
// merge new range
@@ -783,7 +782,7 @@ void SfxItemSet::MergeRange( USHORT nFrom, USHORT nTo )
// -----------------------------------------------------------------------
-void SfxItemSet::SetRanges( const USHORT *pNewRanges )
+void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges )
/** <H3>Description</H3>
@@ -795,8 +794,8 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges )
// identische Ranges?
if ( _pWhichRanges == pNewRanges )
return;
- const USHORT* pOld = _pWhichRanges;
- const USHORT* pNew = pNewRanges;
+ const sal_uInt16* pOld = _pWhichRanges;
+ const sal_uInt16* pNew = pNewRanges;
while ( *pOld == *pNew )
{
if ( !*pOld && !*pNew )
@@ -805,20 +804,20 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges )
}
// create new item-array (by iterating through all new ranges)
- ULONG nSize = Capacity_Impl(pNewRanges);
+ sal_uLong nSize = Capacity_Impl(pNewRanges);
SfxItemArray aNewItems = new const SfxPoolItem* [ nSize ];
- USHORT n = 0, nNewCount = 0;
+ sal_uInt16 n = 0, nNewCount = 0;
if ( _nCount == 0 )
memset( aNewItems, 0, nSize * sizeof( SfxPoolItem* ) );
else
{
- for ( const USHORT *pRange = pNewRanges; *pRange; pRange += 2 )
+ for ( const sal_uInt16 *pRange = pNewRanges; *pRange; pRange += 2 )
{
// iterate through all ids in the range
- for ( USHORT nWID = *pRange; nWID <= pRange[1]; ++nWID, ++n )
+ for ( sal_uInt16 nWID = *pRange; nWID <= pRange[1]; ++nWID, ++n )
{
// direct move of pointer (not via pool)
- SfxItemState eState = GetItemState( nWID, FALSE, aNewItems+n );
+ SfxItemState eState = GetItemState( nWID, sal_False, aNewItems+n );
if ( SFX_ITEM_SET == eState )
{
// increment new item count and possibly increment ref count
@@ -844,8 +843,8 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges )
}
}
// free old items
- USHORT nOldTotalCount = TotalCount();
- for ( USHORT nItem = 0; nItem < nOldTotalCount; ++nItem )
+ sal_uInt16 nOldTotalCount = TotalCount();
+ for ( sal_uInt16 nItem = 0; nItem < nOldTotalCount; ++nItem )
{
const SfxPoolItem *pItem = _aItems[nItem];
if ( pItem && !IsInvalidItem(pItem) && pItem->Which() )
@@ -861,15 +860,15 @@ void SfxItemSet::SetRanges( const USHORT *pNewRanges )
if( pNewRanges == GetPool()->GetFrozenIdRanges() )
{
delete[] _pWhichRanges;
- _pWhichRanges = ( USHORT* ) pNewRanges;
+ _pWhichRanges = ( sal_uInt16* ) pNewRanges;
}
else
{
- USHORT nCount = Count_Impl(pNewRanges) + 1;
+ sal_uInt16 nCount = Count_Impl(pNewRanges) + 1;
if ( _pWhichRanges != _pPool->GetFrozenIdRanges() )
delete[] _pWhichRanges;
- _pWhichRanges = new USHORT[ nCount ];
- memcpy( _pWhichRanges, pNewRanges, sizeof( USHORT ) * nCount );
+ _pWhichRanges = new sal_uInt16[ nCount ];
+ memcpy( _pWhichRanges, pNewRanges, sizeof( sal_uInt16 ) * nCount );
}
}
@@ -880,12 +879,12 @@ int SfxItemSet::Set
const SfxItemSet& rSet, /* das SfxItemSet, dessen SfxPoolItems
"ubernommen werden sollen */
- BOOL bDeep /* TRUE (default)
+ sal_Bool bDeep /* sal_True (default)
auch die SfxPoolItems aus den ggf. an
rSet vorhandenen Parents werden direkt
in das SfxItemSet "ubernommen
- FALSE
+ sal_False
die SfxPoolItems aus den Parents von
rSet werden nicht ber"ucksichtigt */
)
@@ -898,16 +897,16 @@ int SfxItemSet::Set
so da"s die "ubernommenen SfxPoolItems dabei ggf. vom SfxItemPool
von rSet in den SfxItemPool von *this "ubernommen werden.
- SfxPoolItems, f"ur die in rSet IsInvalidItem() == TRUE gilt,
+ SfxPoolItems, f"ur die in rSet IsInvalidItem() == sal_True gilt,
werden als Invalid-Item "ubernommen.
[R"uckgabewert]
- int TRUE
+ int sal_True
es wurden SfxPoolItems "ubernommen
- FALSE
+ sal_False
es wurden keine SfxPoolItems "ubernommen,
da z.B. die Which-Bereiche der SfxItemSets
keine Schnittmenge haben oder in der
@@ -918,23 +917,23 @@ int SfxItemSet::Set
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- int bRet = FALSE;
+ int bRet = sal_False;
if ( _nCount )
ClearItem();
if ( bDeep )
{
SfxWhichIter aIter(*this);
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( nWhich, TRUE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_True, &pItem ) )
bRet |= 0 != Put( *pItem, pItem->Which() );
nWhich = aIter.NextWhich();
}
}
else
- bRet = Put(rSet, FALSE);
+ bRet = Put(rSet, sal_False);
return bRet;
}
@@ -943,8 +942,8 @@ int SfxItemSet::Set
const SfxPoolItem* SfxItemSet::GetItem
(
- USHORT nId, // Slot-Id oder Which-Id des Items
- BOOL bSrchInParent, // TRUE: auch in Parent-ItemSets suchen
+ sal_uInt16 nId, // Slot-Id oder Which-Id des Items
+ sal_Bool bSrchInParent, // sal_True: auch in Parent-ItemSets suchen
TypeId aItemType // != 0 => RTTI Pruefung mit Assertion
) const
@@ -961,9 +960,9 @@ const SfxPoolItem* SfxItemSet::GetItem
{
// ggf. in Which-Id umrechnen
- USHORT nWhich = GetPool()->GetWhich(nId);
+ sal_uInt16 nWhich = GetPool()->GetWhich(nId);
- // ist das Item gesetzt oder bei bDeep==TRUE verf"ugbar?
+ // ist das Item gesetzt oder bei bDeep==sal_True verf"ugbar?
const SfxPoolItem *pItem = 0;
SfxItemState eState = GetItemState( nWhich, bSrchInParent, &pItem );
if ( bSrchInParent && SFX_ITEM_AVAILABLE == eState &&
@@ -987,7 +986,7 @@ const SfxPoolItem* SfxItemSet::GetItem
//------------------------------------------------------------------------
-const SfxPoolItem& SfxItemSet::Get( USHORT nWhich, BOOL bSrchInParent) const
+const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, sal_Bool bSrchInParent) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
// suche den Bereich in dem das Which steht:
@@ -997,7 +996,7 @@ const SfxPoolItem& SfxItemSet::Get( USHORT nWhich, BOOL bSrchInParent) const
if( pAktSet->Count() )
{
SfxItemArray ppFnd = pAktSet->_aItems;
- const USHORT* pPtr = pAktSet->_pWhichRanges;
+ const sal_uInt16* pPtr = pAktSet->_pWhichRanges;
while( *pPtr )
{
if( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
@@ -1053,11 +1052,11 @@ void SfxItemSet::Changed( const SfxPoolItem&, const SfxPoolItem& )
// -----------------------------------------------------------------------
-USHORT SfxItemSet::TotalCount() const
+sal_uInt16 SfxItemSet::TotalCount() const
{
DBG_CHKTHIS(SfxItemSet, 0); // wird im Ctor benutzt bevor vollst. init.
- USHORT nRet = 0;
- USHORT* pPtr = _pWhichRanges;
+ sal_uInt16 nRet = 0;
+ sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
nRet += ( *(pPtr+1) - *pPtr ) + 1;
@@ -1084,16 +1083,16 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
}
// teste mal, ob sich die Which-Bereiche unterscheiden.
- BOOL bEqual = TRUE;
- USHORT* pWh1 = _pWhichRanges;
- USHORT* pWh2 = rSet._pWhichRanges;
- USHORT nSize = 0;
+ sal_Bool bEqual = sal_True;
+ sal_uInt16* pWh1 = _pWhichRanges;
+ sal_uInt16* pWh2 = rSet._pWhichRanges;
+ sal_uInt16 nSize = 0;
- for( USHORT n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
+ for( sal_uInt16 n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
{
if( *pWh1 != *pWh2 )
{
- bEqual = FALSE;
+ bEqual = sal_False;
break;
}
if( n & 1 )
@@ -1113,11 +1112,11 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
// aus dem Pool loeschen
if( !IsInvalidItem( *ppFnd1 ) )
{
- USHORT nWhich = (*ppFnd1)->Which();
+ sal_uInt16 nWhich = (*ppFnd1)->Which();
if(nWhich <= SFX_WHICH_MAX)
{
const SfxPoolItem& rNew = _pParent
- ? _pParent->Get( nWhich, TRUE )
+ ? _pParent->Get( nWhich, sal_True )
: _pPool->GetDefaultItem( nWhich );
Changed( **ppFnd1, rNew );
@@ -1132,12 +1131,12 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
{
SfxItemIter aIter( *this );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
- USHORT nWhich = IsInvalidItem( pItem )
+ sal_uInt16 nWhich = IsInvalidItem( pItem )
? GetWhichByPos( aIter.GetCurPos() )
: pItem->Which();
- if( 0 == rSet.GetItemState( nWhich, FALSE ) )
+ if( 0 == rSet.GetItemState( nWhich, sal_False ) )
ClearItem( nWhich ); // loeschen
if( aIter.IsAtEnd() )
break;
@@ -1155,16 +1154,16 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
return;
// teste mal, ob sich die Which-Bereiche unterscheiden.
- BOOL bEqual = TRUE;
- USHORT* pWh1 = _pWhichRanges;
- USHORT* pWh2 = rSet._pWhichRanges;
- USHORT nSize = 0;
+ sal_Bool bEqual = sal_True;
+ sal_uInt16* pWh1 = _pWhichRanges;
+ sal_uInt16* pWh2 = rSet._pWhichRanges;
+ sal_uInt16 nSize = 0;
- for( USHORT n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
+ for( sal_uInt16 n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
{
if( *pWh1 != *pWh2 )
{
- bEqual = FALSE;
+ bEqual = sal_False;
break;
}
if( n & 1 )
@@ -1184,11 +1183,11 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
// aus dem Pool loeschen
if( !IsInvalidItem( *ppFnd1 ) )
{
- USHORT nWhich = (*ppFnd1)->Which();
+ sal_uInt16 nWhich = (*ppFnd1)->Which();
if(nWhich <= SFX_WHICH_MAX)
{
const SfxPoolItem& rNew = _pParent
- ? _pParent->Get( nWhich, TRUE )
+ ? _pParent->Get( nWhich, sal_True )
: _pPool->GetDefaultItem( nWhich );
Changed( **ppFnd1, rNew );
@@ -1203,12 +1202,12 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
{
SfxItemIter aIter( *this );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
- USHORT nWhich = IsInvalidItem( pItem )
+ sal_uInt16 nWhich = IsInvalidItem( pItem )
? GetWhichByPos( aIter.GetCurPos() )
: pItem->Which();
- if( SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_False ) )
ClearItem( nWhich ); // loeschen
if( aIter.IsAtEnd() )
break;
@@ -1228,79 +1227,79 @@ Grundsaetze:
1.-Item 2.-Item Values bIgnoreDefs Remove Assign Add
-set set == FALSE - - -
-default set == FALSE - - -
-dontcare set == FALSE - - -
-unknown set == FALSE - - -
-set default == FALSE - - -
-default default == FALSE - - -
-dontcare default == FALSE - - -
-unknown default == FALSE - - -
-set dontcare == FALSE 1.-Item -1 -
-default dontcare == FALSE - -1 -
-dontcare dontcare == FALSE - - -
-unknown dontcare == FALSE - - -
-set unknown == FALSE 1.-Item -1 -
-default unknown == FALSE - - -
-dontcare unknown == FALSE - - -
-unknown unknown == FALSE - - -
-
-set set != FALSE 1.-Item -1 -
-default set != FALSE - -1 -
-dontcare set != FALSE - - -
-unknown set != FALSE - - -
-set default != FALSE 1.-Item -1 -
-default default != FALSE - - -
-dontcare default != FALSE - - -
-unknown default != FALSE - - -
-set dontcare != FALSE 1.-Item -1 -
-default dontcare != FALSE - -1 -
-dontcare dontcare != FALSE - - -
-unknown dontcare != FALSE - - -
-set unknown != FALSE 1.-Item -1 -
-default unknown != FALSE - - -
-dontcare unknown != FALSE - - -
-unknown unknown != FALSE - - -
-
-set set == TRUE - - -
-default set == TRUE - 2.-Item 2.-Item
-dontcare set == TRUE - - -
-unknown set == TRUE - - -
-set default == TRUE - - -
-default default == TRUE - - -
-dontcare default == TRUE - - -
-unknown default == TRUE - - -
-set dontcare == TRUE - - -
-default dontcare == TRUE - -1 -
-dontcare dontcare == TRUE - - -
-unknown dontcare == TRUE - - -
-set unknown == TRUE - - -
-default unknown == TRUE - - -
-dontcare unknown == TRUE - - -
-unknown unknown == TRUE - - -
-
-set set != TRUE 1.-Item -1 -
-default set != TRUE - 2.-Item 2.-Item
-dontcare set != TRUE - - -
-unknown set != TRUE - - -
-set default != TRUE - - -
-default default != TRUE - - -
-dontcare default != TRUE - - -
-unknown default != TRUE - - -
-set dontcare != TRUE 1.-Item -1 -
-default dontcare != TRUE - -1 -
-dontcare dontcare != TRUE - - -
-unknown dontcare != TRUE - - -
-set unknown != TRUE - - -
-default unknown != TRUE - - -
-dontcare unknown != TRUE - - -
-unknown unknown != TRUE - - -
+set set == sal_False - - -
+default set == sal_False - - -
+dontcare set == sal_False - - -
+unknown set == sal_False - - -
+set default == sal_False - - -
+default default == sal_False - - -
+dontcare default == sal_False - - -
+unknown default == sal_False - - -
+set dontcare == sal_False 1.-Item -1 -
+default dontcare == sal_False - -1 -
+dontcare dontcare == sal_False - - -
+unknown dontcare == sal_False - - -
+set unknown == sal_False 1.-Item -1 -
+default unknown == sal_False - - -
+dontcare unknown == sal_False - - -
+unknown unknown == sal_False - - -
+
+set set != sal_False 1.-Item -1 -
+default set != sal_False - -1 -
+dontcare set != sal_False - - -
+unknown set != sal_False - - -
+set default != sal_False 1.-Item -1 -
+default default != sal_False - - -
+dontcare default != sal_False - - -
+unknown default != sal_False - - -
+set dontcare != sal_False 1.-Item -1 -
+default dontcare != sal_False - -1 -
+dontcare dontcare != sal_False - - -
+unknown dontcare != sal_False - - -
+set unknown != sal_False 1.-Item -1 -
+default unknown != sal_False - - -
+dontcare unknown != sal_False - - -
+unknown unknown != sal_False - - -
+
+set set == sal_True - - -
+default set == sal_True - 2.-Item 2.-Item
+dontcare set == sal_True - - -
+unknown set == sal_True - - -
+set default == sal_True - - -
+default default == sal_True - - -
+dontcare default == sal_True - - -
+unknown default == sal_True - - -
+set dontcare == sal_True - - -
+default dontcare == sal_True - -1 -
+dontcare dontcare == sal_True - - -
+unknown dontcare == sal_True - - -
+set unknown == sal_True - - -
+default unknown == sal_True - - -
+dontcare unknown == sal_True - - -
+unknown unknown == sal_True - - -
+
+set set != sal_True 1.-Item -1 -
+default set != sal_True - 2.-Item 2.-Item
+dontcare set != sal_True - - -
+unknown set != sal_True - - -
+set default != sal_True - - -
+default default != sal_True - - -
+dontcare default != sal_True - - -
+unknown default != sal_True - - -
+set dontcare != sal_True 1.-Item -1 -
+default dontcare != sal_True - -1 -
+dontcare dontcare != sal_True - - -
+unknown dontcare != sal_True - - -
+set unknown != sal_True - - -
+default unknown != sal_True - - -
+dontcare unknown != sal_True - - -
+unknown unknown != sal_True - - -
*/
-static void MergeItem_Impl( SfxItemPool *_pPool, USHORT &rCount,
+static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount,
const SfxPoolItem **ppFnd1, const SfxPoolItem *pFnd2,
- BOOL bIgnoreDefaults )
+ sal_Bool bIgnoreDefaults )
{
DBG_ASSERT( ppFnd1 != 0, "Merging to 0-Item" );
@@ -1313,11 +1312,11 @@ static void MergeItem_Impl( SfxItemPool *_pPool, USHORT &rCount,
else if ( pFnd2 && !bIgnoreDefaults &&
_pPool->GetDefaultItem(pFnd2->Which()) != *pFnd2 )
- // Entscheidungstabelle: default, set, !=, FALSE
+ // Entscheidungstabelle: default, set, !=, sal_False
*ppFnd1 = (SfxPoolItem*) -1;
else if ( pFnd2 && bIgnoreDefaults )
- // Entscheidungstabelle: default, set, egal, TRUE
+ // Entscheidungstabelle: default, set, egal, sal_True
*ppFnd1 = &_pPool->Put( *pFnd2 );
if ( *ppFnd1 )
@@ -1333,7 +1332,7 @@ static void MergeItem_Impl( SfxItemPool *_pPool, USHORT &rCount,
if ( !bIgnoreDefaults &&
**ppFnd1 != _pPool->GetDefaultItem((*ppFnd1)->Which()) )
{
- // Entscheidungstabelle: set, default, !=, FALSE
+ // Entscheidungstabelle: set, default, !=, sal_False
_pPool->Remove( **ppFnd1 );
*ppFnd1 = (SfxPoolItem*) -1;
}
@@ -1344,8 +1343,8 @@ static void MergeItem_Impl( SfxItemPool *_pPool, USHORT &rCount,
if ( !bIgnoreDefaults ||
**ppFnd1 != _pPool->GetDefaultItem( (*ppFnd1)->Which()) )
{
- // Entscheidungstabelle: set, dontcare, egal, FALSE
- // oder: set, dontcare, !=, TRUE
+ // Entscheidungstabelle: set, dontcare, egal, sal_False
+ // oder: set, dontcare, !=, sal_True
_pPool->Remove( **ppFnd1 );
*ppFnd1 = (SfxPoolItem*) -1;
}
@@ -1365,23 +1364,23 @@ static void MergeItem_Impl( SfxItemPool *_pPool, USHORT &rCount,
// -----------------------------------------------------------------------
-void SfxItemSet::MergeValues( const SfxItemSet& rSet, BOOL bIgnoreDefaults )
+void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
{
// Achtung!!! Bei Aenderungen/Bugfixes immer obenstehende Tabelle pflegen!
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
DBG_ASSERT( GetPool() == rSet.GetPool(), "MergeValues mit verschiedenen Pools" );
// teste mal, ob sich die Which-Bereiche unterscheiden.
- BOOL bEqual = TRUE;
- USHORT* pWh1 = _pWhichRanges;
- USHORT* pWh2 = rSet._pWhichRanges;
- USHORT nSize = 0;
+ sal_Bool bEqual = sal_True;
+ sal_uInt16* pWh1 = _pWhichRanges;
+ sal_uInt16* pWh2 = rSet._pWhichRanges;
+ sal_uInt16 nSize = 0;
- for( USHORT n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
+ for( sal_uInt16 n = 0; *pWh1 && *pWh2; ++pWh1, ++pWh2, ++n )
{
if( *pWh1 != *pWh2 )
{
- bEqual = FALSE;
+ bEqual = sal_False;
break;
}
if( n & 1 )
@@ -1401,11 +1400,11 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, BOOL bIgnoreDefaults )
else
{
SfxWhichIter aIter( rSet );
- register USHORT nWhich;
+ register sal_uInt16 nWhich;
while( 0 != ( nWhich = aIter.NextWhich() ) )
{
const SfxPoolItem* pItem = 0;
- rSet.GetItemState( nWhich, TRUE, &pItem );
+ rSet.GetItemState( nWhich, sal_True, &pItem );
if( !pItem )
{
// nicht gesetzt, also default
@@ -1423,12 +1422,12 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, BOOL bIgnoreDefaults )
// -----------------------------------------------------------------------
-void SfxItemSet::MergeValue( const SfxPoolItem& rAttr, BOOL bIgnoreDefaults )
+void SfxItemSet::MergeValue( const SfxPoolItem& rAttr, sal_Bool bIgnoreDefaults )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
SfxItemArray ppFnd = _aItems;
- const USHORT* pPtr = _pWhichRanges;
- const USHORT nWhich = rAttr.Which();
+ const sal_uInt16* pPtr = _pWhichRanges;
+ const sal_uInt16 nWhich = rAttr.Which();
while( *pPtr )
{
// in diesem Bereich?
@@ -1445,11 +1444,11 @@ void SfxItemSet::MergeValue( const SfxPoolItem& rAttr, BOOL bIgnoreDefaults )
// -----------------------------------------------------------------------
-void SfxItemSet::InvalidateItem( USHORT nWhich )
+void SfxItemSet::InvalidateItem( sal_uInt16 nWhich )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
SfxItemArray ppFnd = _aItems;
- const USHORT* pPtr = _pWhichRanges;
+ const sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
if( *pPtr <= nWhich && nWhich <= *(pPtr+1) )
@@ -1479,11 +1478,11 @@ void SfxItemSet::InvalidateItem( USHORT nWhich )
// -----------------------------------------------------------------------
-USHORT SfxItemSet::GetWhichByPos( USHORT nPos ) const
+sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- USHORT n = 0;
- USHORT* pPtr = _pWhichRanges;
+ sal_uInt16 n = 0;
+ sal_uInt16* pPtr = _pWhichRanges;
while( *pPtr )
{
n = ( *(pPtr+1) - *pPtr ) + 1;
@@ -1492,7 +1491,7 @@ USHORT SfxItemSet::GetWhichByPos( USHORT nPos ) const
nPos = nPos - n;
pPtr += 2;
}
- DBG_ASSERT( FALSE, "Hier sind wir falsch" );
+ DBG_ASSERT( sal_False, "Hier sind wir falsch" );
return 0;
}
@@ -1507,16 +1506,16 @@ SvStream &SfxItemSet::Store
/* [Beschreibung]
Speichert die <SfxItemSet>-Instanz in den angegebenen Stream. Dabei
- werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==TRUE')
+ werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==sal_True')
die gesetzten Items selbst wie folgt im Stream abgelegt:
- USHORT (Count) Anzahl der gesetzten Items
+ sal_uInt16 (Count) Anzahl der gesetzten Items
Count* _pPool->StoreItem() siehe <SfxItemPool::StoreItem()const>
[Querverweise]
- <SfxItemSet::Load(SvStream&,BOOL,const SfxItemPool*)>
+ <SfxItemSet::Load(SvStream&,sal_Bool,const SfxItemPool*)>
*/
{
@@ -1525,14 +1524,14 @@ SvStream &SfxItemSet::Store
DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "kein Master-Pool" );
// Position des Counts merken, um ggf. zu korrigieren
- ULONG nCountPos = rStream.Tell();
+ sal_uLong nCountPos = rStream.Tell();
rStream << _nCount;
// wenn nichts zu speichern ist, auch keinen ItemIter aufsetzen!
if ( _nCount )
{
// mitz"ahlen wieviel Items tats"achlich gespeichert werden
- USHORT nWrittenCount = 0; // Anzahl in 'rStream' gestreamter Items
+ sal_uInt16 nWrittenCount = 0; // Anzahl in 'rStream' gestreamter Items
// "uber alle gesetzten Items iterieren
SfxItemIter aIter(*this);
@@ -1552,7 +1551,7 @@ SvStream &SfxItemSet::Store
if ( nWrittenCount != _nCount )
{
// tats"achlichen Count im Stream ablegen
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
rStream.Seek( nCountPos );
rStream << nWrittenCount;
rStream.Seek( nPos );
@@ -1572,7 +1571,7 @@ SvStream &SfxItemSet::Load
Items werden direkt aus dem Stream
gelesen, nicht "uber Surrogate
- FALSE (default)
+ sal_False (default)
Items werden "uber Surrogate gelesen */
const SfxItemPool* pRefPool /* Pool, der die Surrogate aufl"osen kann
@@ -1588,7 +1587,7 @@ SvStream &SfxItemSet::Load
[Querverweise]
- <SfxItemSet::Store(Stream&,BOOL)const>
+ <SfxItemSet::Store(Stream&,sal_Bool)const>
*/
{
@@ -1601,9 +1600,9 @@ SvStream &SfxItemSet::Load
pRefPool = _pPool;
// Anzahl der zu ladenden Items laden und dann ebensoviele Items
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
rStream >> nCount;
- for ( USHORT i = 0; i < nCount; ++i )
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
// Surrogat/Item laden und (Surrogat) aufl"osen lassen
const SfxPoolItem *pItem =
@@ -1613,9 +1612,9 @@ SvStream &SfxItemSet::Load
if ( pItem )
{
// Position f"ur Item-Pointer im Set suchen
- USHORT nWhich = pItem->Which();
+ sal_uInt16 nWhich = pItem->Which();
SfxItemArray ppFnd = _aItems;
- const USHORT* pPtr = _pWhichRanges;
+ const sal_uInt16* pPtr = _pWhichRanges;
while ( *pPtr )
{
// in diesem Bereich?
@@ -1650,48 +1649,48 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const
if ( _pParent != rCmp._pParent ||
_pPool != rCmp._pPool ||
Count() != rCmp.Count() )
- return FALSE;
+ return sal_False;
// Ranges durchzaehlen lassen dauert laenger, muss aber auch gleich sein
- USHORT nCount1 = TotalCount();
- USHORT nCount2 = rCmp.TotalCount();
+ sal_uInt16 nCount1 = TotalCount();
+ sal_uInt16 nCount2 = rCmp.TotalCount();
if ( nCount1 != nCount2 )
- return FALSE;
+ return sal_False;
// sind die Ranges selbst ungleich?
- for ( USHORT nRange = 0; _pWhichRanges[nRange]; nRange += 2 )
+ for ( sal_uInt16 nRange = 0; _pWhichRanges[nRange]; nRange += 2 )
if ( _pWhichRanges[nRange] != rCmp._pWhichRanges[nRange] ||
_pWhichRanges[nRange+1] != rCmp._pWhichRanges[nRange+1] )
{
// dann m"ussen wir die langsame Methode verwenden
SfxWhichIter aIter( *this );
- for ( USHORT nWh = aIter.FirstWhich();
+ for ( sal_uInt16 nWh = aIter.FirstWhich();
nWh;
nWh = aIter.NextWhich() )
{
// wenn die Pointer von poolable Items ungleich sind,
// muessen die Items gleich sein
const SfxPoolItem *pItem1 = 0, *pItem2 = 0;
- if ( GetItemState( nWh, FALSE, &pItem1 ) !=
- rCmp.GetItemState( nWh, FALSE, &pItem2 ) ||
+ if ( GetItemState( nWh, sal_False, &pItem1 ) !=
+ rCmp.GetItemState( nWh, sal_False, &pItem2 ) ||
( pItem1 != pItem2 &&
( !pItem1 || IsInvalidItem(pItem1) ||
( _pPool->IsItemFlag(*pItem1, SFX_ITEM_POOLABLE) &&
*pItem1 != *pItem2 ) ) ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// Pointer alle gleich?
if ( 0 == memcmp( _aItems, rCmp._aItems, nCount1 * sizeof(_aItems[0]) ) )
- return TRUE;
+ return sal_True;
// dann werden wir wohl alle einzeln vergleichen muessen
const SfxPoolItem **ppItem1 = (const SfxPoolItem**) _aItems;
const SfxPoolItem **ppItem2 = (const SfxPoolItem**) rCmp._aItems;
- for ( USHORT nPos = 0; nPos < nCount1; ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < nCount1; ++nPos )
{
// wenn die Pointer von poolable Items ungleich sind,
// muessen die Items gleich sein
@@ -1700,18 +1699,18 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const
( IsInvalidItem(*ppItem1) || IsInvalidItem(*ppItem2) ) ||
( _pPool->IsItemFlag(**ppItem1, SFX_ITEM_POOLABLE) ) ||
**ppItem1 != **ppItem2 ) )
- return FALSE;
+ return sal_False;
++ppItem1;
++ppItem2;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-SfxItemSet *SfxItemSet::Clone(BOOL bItems, SfxItemPool *pToPool ) const
+SfxItemSet *SfxItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
if ( pToPool && pToPool != _pPool )
@@ -1720,11 +1719,11 @@ SfxItemSet *SfxItemSet::Clone(BOOL bItems, SfxItemPool *pToPool ) const
if ( bItems )
{
SfxWhichIter aIter(*pNewSet);
- USHORT nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == GetItemState( nWhich, FALSE, &pItem ) )
+ if ( SFX_ITEM_SET == GetItemState( nWhich, sal_False, &pItem ) )
pNewSet->Put( *pItem, pItem->Which() );
nWhich = aIter.NextWhich();
}
@@ -1743,8 +1742,8 @@ int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
SfxItemArray ppFnd = _aItems;
- const USHORT* pPtr = _pWhichRanges;
- const USHORT nWhich = rItem.Which();
+ const sal_uInt16* pPtr = _pWhichRanges;
+ const sal_uInt16 nWhich = rItem.Which();
#ifdef DBG_UTIL
IsPoolDefaultItem(&rItem) || _pPool->GetSurrogate(&rItem);
// nur Assertion in den callees provozieren
@@ -1759,7 +1758,7 @@ int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
if( pOld ) // schon einer vorhanden
{
if( rItem == **ppFnd )
- return FALSE; // schon vorhanden !
+ return sal_False; // schon vorhanden !
_pPool->Remove( *pOld );
}
else
@@ -1775,18 +1774,18 @@ int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
rItem.AddRef();
}
- return TRUE;
+ return sal_True;
}
ppFnd += *(pPtr+1) - *pPtr + 1;
pPtr += 2;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
SfxAllItemSet::SfxAllItemSet( SfxItemPool &rPool )
-: SfxItemSet(rPool, (const USHORT*) 0),
+: SfxItemSet(rPool, (const sal_uInt16*) 0),
aDefault(0),
nFree(nInitCount)
{
@@ -1794,8 +1793,8 @@ SfxAllItemSet::SfxAllItemSet( SfxItemPool &rPool )
_aItems = 0;
// nInitCount Paare an USHORTs fuer Ranges allozieren
- _pWhichRanges = new USHORT[ nInitCount + 1 ];
- memset( _pWhichRanges, 0, ( nInitCount + 1 ) * sizeof(USHORT) );
+ _pWhichRanges = new sal_uInt16[ nInitCount + 1 ];
+ memset( _pWhichRanges, 0, ( nInitCount + 1 ) * sizeof(sal_uInt16) );
}
@@ -1827,12 +1826,12 @@ SfxAllItemSet::SfxAllItemSet(const SfxAllItemSet &rCopy)
// -----------------------------------------------------------------------
-static USHORT *AddRanges_Impl(
- USHORT *pUS, std::ptrdiff_t nOldSize, USHORT nIncr)
+static sal_uInt16 *AddRanges_Impl(
+ sal_uInt16 *pUS, std::ptrdiff_t nOldSize, sal_uInt16 nIncr)
/* Diese interne Funktion erzeugt ein neues Which-Range-Array, welches von
dem 'nOldSize'-USHORTs langen 'pUS' kopiert wird und hinten an Platz
- f"ur 'nIncr' neue USHORTs hat. Das terminierende USHORT mit der '0'
+ f"ur 'nIncr' neue USHORTs hat. Das terminierende sal_uInt16 mit der '0'
wird weder in 'nOldSize' noch in 'nIncr' mitgez"ahlt, sondern implizit
hinzugerechnet.
@@ -1842,13 +1841,13 @@ static USHORT *AddRanges_Impl(
{
// neues Which-Range-Array anlegen
- USHORT *pNew = new USHORT[ nOldSize + nIncr + 1 ];
+ sal_uInt16 *pNew = new sal_uInt16[ nOldSize + nIncr + 1 ];
// die alten Ranges "ubernehmen
- memcpy( pNew, pUS, nOldSize * sizeof(USHORT) );
+ memcpy( pNew, pUS, nOldSize * sizeof(sal_uInt16) );
// die neuen auf 0 initialisieren
- memset( pNew + nOldSize, 0, ( nIncr + 1 ) * sizeof(USHORT) );
+ memset( pNew + nOldSize, 0, ( nIncr + 1 ) * sizeof(sal_uInt16) );
// das alte Array freigeben
delete[] pUS;
@@ -1858,7 +1857,7 @@ static USHORT *AddRanges_Impl(
// -----------------------------------------------------------------------
-static SfxItemArray AddItem_Impl(SfxItemArray pItems, USHORT nOldSize, USHORT nPos)
+static SfxItemArray AddItem_Impl(SfxItemArray pItems, sal_uInt16 nOldSize, sal_uInt16 nPos)
/* Diese interne Funktion erzeugt ein neues ItemArray, welches von 'pItems'
kopiert wird, an der Position 'nPos' jedoch Platz f"ur einen neuen
@@ -1896,17 +1895,17 @@ static SfxItemArray AddItem_Impl(SfxItemArray pItems, USHORT nOldSize, USHORT nP
// -----------------------------------------------------------------------
-const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
+const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
// Putten mit automatischer Erweiterung der Whichs-Ids um die ID
// des Items.
{
- USHORT nPos = 0; // Position f"ur 'rItem' in '_aItems'
- const USHORT nItemCount = TotalCount();
+ sal_uInt16 nPos = 0; // Position f"ur 'rItem' in '_aItems'
+ const sal_uInt16 nItemCount = TotalCount();
// erstmal sehen, ob es schon einen passenden Bereich gibt
- USHORT *pPtr = _pWhichRanges;
+ sal_uInt16 *pPtr = _pWhichRanges;
while ( *pPtr )
{
// Which-Id liegt in diesem Bereich?
@@ -1989,15 +1988,15 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
const SfxPoolItem& rNew = _pPool->Put( rItem, nWhich );
// altes Item merken
- BOOL bIncrementCount = FALSE;
+ sal_Bool bIncrementCount = sal_False;
const SfxPoolItem* pOld = *( _aItems + nPos );
if ( reinterpret_cast< SfxPoolItem* >( -1 ) == pOld ) // state "dontcare"
pOld = NULL;
if ( !pOld )
{
- bIncrementCount = TRUE;
+ bIncrementCount = sal_True;
pOld = _pParent ?
- &_pParent->Get( nWhich, TRUE )
+ &_pParent->Get( nWhich, sal_True )
: nWhich <= SFX_WHICH_MAX ? &_pPool->GetDefaultItem( nWhich ) : 0;
}
@@ -2025,7 +2024,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, USHORT nWhich )
Put-Methoden dieser SubClass gehided wird.
*/
-int SfxAllItemSet::Put( const SfxItemSet& rSet, BOOL bInvalidAsDefault )
+int SfxAllItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
{
//? pruefen, ob Which-Ranges erweitert werden
return SfxItemSet::Put( rSet, bInvalidAsDefault );
@@ -2034,7 +2033,7 @@ int SfxAllItemSet::Put( const SfxItemSet& rSet, BOOL bInvalidAsDefault )
// -----------------------------------------------------------------------
// Item disablen, wenn durch ein VoidItem mit dem Which-Wert 0 ausgedrueckt
-void SfxItemSet::DisableItem(USHORT nWhich)
+void SfxItemSet::DisableItem(sal_uInt16 nWhich)
{
DBG_CHKTHIS(SfxItemSet, 0);
Put( SfxVoidItem(0), nWhich );
@@ -2042,7 +2041,7 @@ void SfxItemSet::DisableItem(USHORT nWhich)
// -----------------------------------------------------------------------
-SfxItemSet *SfxAllItemSet::Clone(BOOL bItems, SfxItemPool *pToPool ) const
+SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
if ( pToPool && pToPool != _pPool )
diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx
index 93aa8fe7a2aa..872420a35322 100644
--- a/svl/source/items/lckbitem.cxx
+++ b/svl/source/items/lckbitem.cxx
@@ -51,7 +51,7 @@ SfxLockBytesItem::SfxLockBytesItem()
// -----------------------------------------------------------------------
-SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvLockBytes *pLockBytes )
+SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvLockBytes *pLockBytes )
: SfxPoolItem( nW ),
_xVal( pLockBytes )
{
@@ -59,11 +59,11 @@ SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvLockBytes *pLockBytes )
// -----------------------------------------------------------------------
-SfxLockBytesItem::SfxLockBytesItem( USHORT nW, SvStream &rStream )
+SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvStream &rStream )
: SfxPoolItem( nW )
{
rStream.Seek( 0L );
- _xVal = new SvLockBytes( new SvCacheStream(), TRUE );
+ _xVal = new SvLockBytes( new SvCacheStream(), sal_True );
SvStream aLockBytesStream( _xVal );
rStream >> aLockBytesStream;
@@ -101,16 +101,16 @@ SfxPoolItem* SfxLockBytesItem::Clone(SfxItemPool *) const
#define MAX_BUF 32000
-SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, USHORT ) const
+SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, sal_uInt16 ) const
{
sal_uInt32 nSize = 0;
- ULONG nActRead = 0;
+ sal_uLong nActRead = 0;
sal_Char cTmpBuf[MAX_BUF];
SvMemoryStream aNewStream;
rStream >> nSize;
do {
- ULONG nToRead;
+ sal_uLong nToRead;
if( (nSize - nActRead) > MAX_BUF )
nToRead = MAX_BUF;
else
@@ -124,7 +124,7 @@ SfxPoolItem* SfxLockBytesItem::Create( SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
-SvStream& SfxLockBytesItem::Store(SvStream &rStream, USHORT ) const
+SvStream& SfxLockBytesItem::Store(SvStream &rStream, sal_uInt16 ) const
{
SvStream aLockBytesStream( _xVal );
sal_uInt32 nSize = aLockBytesStream.Seek( STREAM_SEEK_TO_END );
@@ -138,7 +138,7 @@ SvStream& SfxLockBytesItem::Store(SvStream &rStream, USHORT ) const
//----------------------------------------------------------------------------
// virtual
-bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
+bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
com::sun::star::uno::Sequence< sal_Int8 > aSeq;
if ( rVal >>= aSeq )
@@ -149,7 +149,7 @@ bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
pStream->Write( (void*)aSeq.getConstArray(), aSeq.getLength() );
pStream->Seek(0);
- _xVal = new SvLockBytes( pStream, TRUE );
+ _xVal = new SvLockBytes( pStream, sal_True );
}
else
_xVal = NULL;
@@ -163,7 +163,7 @@ bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE )
//----------------------------------------------------------------------------
// virtual
-bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const
+bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
{
if ( _xVal.Is() )
{
@@ -175,7 +175,7 @@ bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const
else
return false;
- ULONG nRead = 0;
+ sal_uLong nRead = 0;
com::sun::star::uno::Sequence< sal_Int8 > aSeq( nLen );
_xVal->ReadAt( 0, aSeq.getArray(), nLen, &nRead );
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx
index bd0cfd77125d..b9c6ddc79cec 100644
--- a/svl/source/items/macitem.cxx
+++ b/svl/source/items/macitem.cxx
@@ -119,7 +119,7 @@ SvxMacroTableDtor& SvxMacroTableDtor::operator=( const SvxMacroTableDtor& rTbl )
}
-SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion )
+SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion )
{
if( SVX_MACROTBL_VERSION40 <= nVersion )
rStrm >> nVersion;
@@ -128,7 +128,7 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion )
for( short i = 0; i < nMacro; ++i )
{
- USHORT nCurKey, eType = STARBASIC;
+ sal_uInt16 nCurKey, eType = STARBASIC;
String aLibName, aMacName;
rStrm >> nCurKey;
SfxPoolItem::readByteString(rStrm, aLibName);
@@ -154,14 +154,14 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion )
SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const
{
- USHORT nVersion = SOFFICE_FILEFORMAT_31 == rStream.GetVersion()
+ sal_uInt16 nVersion = SOFFICE_FILEFORMAT_31 == rStream.GetVersion()
? SVX_MACROTBL_VERSION31
: SVX_MACROTBL_AKTVERSION;
if( SVX_MACROTBL_VERSION40 <= nVersion )
rStream << nVersion;
- rStream << (USHORT)Count();
+ rStream << (sal_uInt16)Count();
SvxMacro* pMac = ((SvxMacroTableDtor*)this)->First();
while( pMac && rStream.GetError() == SVSTREAM_OK )
@@ -171,7 +171,7 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const
SfxPoolItem::writeByteString(rStream, pMac->GetMacName());
if( SVX_MACROTBL_VERSION40 <= nVersion )
- rStream << (USHORT)pMac->GetScriptType();
+ rStream << (sal_uInt16)pMac->GetScriptType();
pMac = ((SvxMacroTableDtor*)this)->Next();
}
return rStream;
@@ -201,20 +201,20 @@ int SvxMacroItem::operator==( const SfxPoolItem& rAttr ) const
// Anzahl unterschiedlich => auf jeden Fall ungleich
if ( rOwn.Count() != rOther.Count() )
- return FALSE;
+ return sal_False;
// einzeln verleichen; wegen Performance ist die Reihenfolge wichtig
- for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo )
+ for ( sal_uInt16 nNo = 0; nNo < rOwn.Count(); ++nNo )
{
const SvxMacro *pOwnMac = rOwn.GetObject(nNo);
const SvxMacro *pOtherMac = rOther.GetObject(nNo);
if ( rOwn.GetKey(pOwnMac) != rOther.GetKey(pOtherMac) ||
pOwnMac->GetLibName() != pOtherMac->GetLibName() ||
pOwnMac->GetMacName() != pOtherMac->GetMacName() )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -255,14 +255,14 @@ SfxItemPresentation SvxMacroItem::GetPresentation
// -----------------------------------------------------------------------
-SvStream& SvxMacroItem::Store( SvStream& rStrm , USHORT ) const
+SvStream& SvxMacroItem::Store( SvStream& rStrm , sal_uInt16 ) const
{
return aMacroTable.Write( rStrm );
}
// -----------------------------------------------------------------------
-SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, USHORT nVersion ) const
+SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) const
{
SvxMacroItem* pAttr = new SvxMacroItem( Which() );
pAttr->aMacroTable.Read( rStrm, nVersion );
@@ -271,7 +271,7 @@ SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, USHORT nVersion ) const
// -----------------------------------------------------------------------
-void SvxMacroItem::SetMacro( USHORT nEvent, const SvxMacro& rMacro )
+void SvxMacroItem::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro )
{
SvxMacro *pMacro;
if ( 0 != (pMacro=aMacroTable.Get(nEvent)) )
@@ -285,7 +285,7 @@ void SvxMacroItem::SetMacro( USHORT nEvent, const SvxMacro& rMacro )
// -----------------------------------------------------------------------
-USHORT SvxMacroItem::GetVersion( USHORT nFileFormatVersion ) const
+sal_uInt16 SvxMacroItem::GetVersion( sal_uInt16 nFileFormatVersion ) const
{
return SOFFICE_FILEFORMAT_31 == nFileFormatVersion
? 0 : aMacroTable.GetVersion();
diff --git a/svl/source/items/makefile.mk b/svl/source/items/makefile.mk
deleted file mode 100644
index da602391239a..000000000000
--- a/svl/source/items/makefile.mk
+++ /dev/null
@@ -1,84 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svl
-TARGET=items
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES=\
- $(SLO)$/aeitem.obj \
- $(SLO)$/cenumitm.obj \
- $(SLO)$/cintitem.obj \
- $(SLO)$/cntwall.obj \
- $(SLO)$/ctypeitm.obj \
- $(SLO)$/custritm.obj \
- $(SLO)$/dateitem.obj \
- $(SLO)$/eitem.obj \
- $(SLO)$/flagitem.obj \
- $(SLO)$/globalnameitem.obj \
- $(SLO)$/ilstitem.obj \
- $(SLO)$/imageitm.obj \
- $(SLO)$/intitem.obj \
- $(SLO)$/itemiter.obj \
- $(SLO)$/itempool.obj \
- $(SLO)$/itemprop.obj \
- $(SLO)$/itemset.obj \
- $(SLO)$/lckbitem.obj \
- $(SLO)$/macitem.obj \
- $(SLO)$/poolcach.obj \
- $(SLO)$/poolio.obj \
- $(SLO)$/poolitem.obj \
- $(SLO)$/ptitem.obj \
- $(SLO)$/rectitem.obj \
- $(SLO)$/rngitem.obj \
- $(SLO)$/sfontitm.obj \
- $(SLO)$/sitem.obj \
- $(SLO)$/slstitm.obj \
- $(SLO)$/srchitem.obj \
- $(SLO)$/stritem.obj \
- $(SLO)$/style.obj \
- $(SLO)$/stylepool.obj \
- $(SLO)$/szitem.obj \
- $(SLO)$/visitem.obj \
- $(SLO)$/whiter.obj
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- cstitem.src
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index c4cbd4fdb865..db0dc169c9dc 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -64,7 +64,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs,
/** <H3>Description</H3>
- Creates an USHORT-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as
+ Creates an sal_uInt16-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as
first range, 'nNull' as terminator or start of 2nd range and 'pArgs' as
remaider.
@@ -74,7 +74,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *&rpRanges, va_list pArgs,
{
NUMTYPE nSize = 0, nIns = 0;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
SvNums aNumArr( 11, 8 );
aNumArr.Insert( nWh1, nCnt++ );
aNumArr.Insert( nWh2, nCnt++ );
@@ -233,20 +233,20 @@ SfxNumRanges::SfxNumRanges( const NUMTYPE* pArr )
//------------------------------------------------------------------------
-BOOL SfxNumRanges::operator==( const SfxNumRanges &rOther ) const
+sal_Bool SfxNumRanges::operator==( const SfxNumRanges &rOther ) const
{
// Object pointers equal?
if ( this == &rOther )
- return TRUE;
+ return sal_True;
// Ranges pointers equal?
if ( _pRanges == rOther._pRanges )
- return TRUE;
+ return sal_True;
// Counts equal?
NUMTYPE nCount = Count();
if ( nCount != rOther.Count() )
- return FALSE;
+ return sal_False;
// Check arrays.
NUMTYPE n = 0;
@@ -254,12 +254,12 @@ BOOL SfxNumRanges::operator==( const SfxNumRanges &rOther ) const
{
// Elements at current position equal?
if ( _pRanges[ n ] != rOther._pRanges[ n ] )
- return FALSE;
+ return sal_False;
++n;
}
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------
@@ -719,21 +719,21 @@ SfxNumRanges& SfxNumRanges::operator /=
//------------------------------------------------------------------------
-BOOL SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const
+sal_Bool SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const
/** <H3>Description</H3>
Determines if at least one range in 'rRanges' intersects with one
range in '*this'.
- TRUE, if there is at least one with:
+ sal_True, if there is at least one with:
this->Contains( n ) && rRanges.Contains( n )
*/
{
// special cases: one is empty
if ( rRanges.IsEmpty() || IsEmpty() )
- return FALSE;
+ return sal_False;
// find at least one intersecting range
const NUMTYPE *pRange1 = _pRanges;
@@ -753,12 +753,12 @@ BOOL SfxNumRanges::Intersects( const SfxNumRanges &rRanges ) const
// the ranges are overlappung
else
- return TRUE;
+ return sal_True;
}
while ( *pRange2 );
// no intersection found
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------------
@@ -777,7 +777,7 @@ NUMTYPE SfxNumRanges::Count() const
//------------------------------------------------------------------------
-BOOL SfxNumRanges::Contains( NUMTYPE n ) const
+sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const
/** <H3>Description</H3>
@@ -787,8 +787,8 @@ BOOL SfxNumRanges::Contains( NUMTYPE n ) const
{
for ( NUMTYPE *pRange = _pRanges; *pRange && *pRange <= n; pRange += 2 )
if ( pRange[0] <= n && n <= pRange[1] )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx
index 07b0f1a6ddac..9a2b109682b5 100644
--- a/svl/source/items/poolcach.cxx
+++ b/svl/source/items/poolcach.cxx
@@ -33,24 +33,12 @@
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
-#include "poolcach.hxx"
+#include <svl/poolcach.hxx>
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxItemPoolCache)
-
-//------------------------------------------------------------------------
-
-struct SfxItemModifyImpl
-{
- const SfxSetItem *pOrigItem;
- SfxSetItem *pPoolItem;
-};
-
-SV_DECL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl, 8, 8 )
-SV_IMPL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl);
-
//------------------------------------------------------------------------
SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
@@ -82,7 +70,7 @@ SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
SfxItemPoolCache::~SfxItemPoolCache()
{
DBG_DTOR(SfxItemPoolCache, 0);
- for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) {
+ for ( size_t nPos = 0; nPos < pCache->size(); ++nPos ) {
pPool->Remove( *(*pCache)[nPos].pPoolItem );
pPool->Remove( *(*pCache)[nPos].pOrigItem );
}
@@ -94,15 +82,15 @@ SfxItemPoolCache::~SfxItemPoolCache()
//------------------------------------------------------------------------
-const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL bNew )
+const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bool bNew )
{
DBG_CHKTHIS(SfxItemPoolCache, 0);
DBG_ASSERT( pPool == rOrigItem.GetItemSet().GetPool(), "invalid Pool" );
DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ),
"original not in pool" );
- // Suchen, ob diese Transformations schon einmal vorkam
- for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos )
+ // Find whether this Transformations ever occurred
+ for ( size_t nPos = 0; nPos < pCache->size(); ++nPos )
{
SfxItemModifyImpl &rMapEntry = (*pCache)[nPos];
if ( rMapEntry.pOrigItem == &rOrigItem )
@@ -141,7 +129,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL b
SfxItemModifyImpl aModify;
aModify.pOrigItem = &rOrigItem;
aModify.pPoolItem = (SfxSetItem*) pNewPoolItem;
- pCache->Insert( aModify, pCache->Count() );
+ pCache->push_back( aModify );
DBG_ASSERT( !pItemToPut ||
&pNewPoolItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut,
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 81b1045ec970..f9ddc18a2318 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -97,43 +97,43 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
;zun"achst ein Kompatiblit"ats-Header-Block
Start: 0x1111 SFX_ITEMPOOL_TAG_STARTPOOLS(_4/_5)
- BYTE MAJOR_VER ;SfxItemPool-Version
- BYTE MINOR_VER ;"
+ sal_uInt8 MAJOR_VER ;SfxItemPool-Version
+ sal_uInt8 MINOR_VER ;"
0xFFFF SFX_ITEMPOOL_TAG_TRICK4OLD ;ex. GetVersion()
- USHORT 0x0000 ;Pseudo-StyleSheetPool
- USHORT 0x0000 ;Pseudo-StyleSheetPool
+ sal_uInt16 0x0000 ;Pseudo-StyleSheetPool
+ sal_uInt16 0x0000 ;Pseudo-StyleSheetPool
;den ganzen Pool in einen Record
record SfxMiniRecod(SFX_ITEMPOOL_REC)
;je ein Header vorweg
Header: record SfxMiniRecord(SFX_ITEMPOOL_REC_HEADER)
- USHORT GetVersion() ;Which-Ranges etc.
+ sal_uInt16 GetVersion() ;Which-Ranges etc.
String GetName() ;Pool-Name
;die Versions-Map, um WhichIds neuer File-Versionen mappen zu k"onnen
Versions: record SfxMultiRecord(SFX_ITEMPOOL_REC_VERSIONS, 0)
- USHORT OldVersion
- USHORT OldStartWhich
- USHORT OldEndWhich
- USHORT[] NewWhich (OldEndWhich-OldStartWhich+1)
+ sal_uInt16 OldVersion
+ sal_uInt16 OldStartWhich
+ sal_uInt16 OldEndWhich
+ sal_uInt16[] NewWhich (OldEndWhich-OldStartWhich+1)
;jetzt die gepoolten Items (zuerst nicht-SfxSetItems)
Items: record SfxMultiRecord(SFX_ITEMPOOL_REC_WHICHIDS, 0)
content SlotId, 0
- USHORT WhichId
- USHORT pItem->GetVersion()
- USHORT Array-Size
+ sal_uInt16 WhichId
+ sal_uInt16 pItem->GetVersion()
+ sal_uInt16 Array-Size
record SfxMultiRecord(SFX_, 0)
content Surrogate
- USHORT RefCount
+ sal_uInt16 RefCount
unknown pItem->Store()
;jetzt die gesetzten Pool-Defaults
Defaults: record SfxMultiRecord(SFX_ITEMPOOL_REC_DEFAULTS, 0)
content SlotId, 0
- USHORT WhichId
- USHORT pPoolDef->GetVersion()
+ sal_uInt16 WhichId
+ sal_uInt16 pPoolDef->GetVersion()
unknown pPoolDef->Store();
;dahinter folgt ggf. der Secondary ohne Kompatiblit"ats-Header-Block
@@ -148,7 +148,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
pStoreMaster = pStoreMaster->pSecondary;
// Alter-Header (Version des Pools an sich und Inhalts-Version 0xffff)
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
if ( !pStoreMaster )
{
rStream << ( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50
@@ -158,8 +158,8 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
rStream << SFX_ITEMPOOL_TAG_TRICK4OLD;
// SfxStyleSheet-Bug umgehen
- rStream << UINT16(0); // Version
- rStream << UINT16(0); // Count (2. Schleife f"allt sonst auf die Fresse)
+ rStream << sal_uInt16(0); // Version
+ rStream << sal_uInt16(0); // Count (2. Schleife f"allt sonst auf die Fresse)
}
// jeder Pool ist als ganzes ein Record
@@ -176,14 +176,14 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// Version-Maps
{
SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP, 0 );
- for ( USHORT nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo )
+ for ( size_t nVerNo = 0; nVerNo < pImp->aVersions.size(); ++nVerNo )
{
aVerRec.NewContent();
- SfxPoolVersion_Impl *pVer = pImp->aVersions[nVerNo];
+ SfxPoolVersion_ImplPtr pVer = pImp->aVersions[nVerNo];
rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd;
- USHORT nCount = pVer->_nEnd - pVer->_nStart + 1;
- USHORT nNewWhich = 0;
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 nCount = pVer->_nEnd - pVer->_nStart + 1;
+ sal_uInt16 nNewWhich = 0;
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
nNewWhich = pVer->_pMap[n];
rStream << nNewWhich;
@@ -191,7 +191,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// Workaround gegen Bug in SetVersionMap der 312
if ( SOFFICE_FILEFORMAT_31 == _nFileFormatVersion )
- rStream << USHORT(nNewWhich+1);
+ rStream << sal_uInt16(nNewWhich+1);
}
}
@@ -206,11 +206,11 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems;
SfxPoolItem **ppDefItem = ppStaticDefaults;
- const USHORT nSize = GetSize_Impl();
- for ( USHORT i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
+ const sal_uInt16 nSize = GetSize_Impl();
+ for ( size_t i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
{
// Version des Items feststellen
- USHORT nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion );
+ sal_uInt16 nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion );
if ( USHRT_MAX == nItemVersion )
// => kam in zu exportierender Version gar nicht vor
continue;
@@ -225,29 +225,29 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
{
// eigene Kennung, globale Which-Id und Item-Version
- USHORT nSlotId = GetSlotId( (*ppDefItem)->Which(), FALSE );
+ sal_uInt16 nSlotId = GetSlotId( (*ppDefItem)->Which(), sal_False );
aWhichIdsRec.NewContent(nSlotId, 0);
rStream << (*ppDefItem)->Which();
rStream << nItemVersion;
- const USHORT nCount = (*pArr)->Count();
- DBG_ASSERT(nCount, "ItemArr ist leer");
+ const sal_uInt32 nCount = ::std::min<size_t>( (*pArr)->size(), SAL_MAX_UINT32 );
+ DBG_ASSERT(nCount, "ItemArr is empty");
rStream << nCount;
// Items an sich schreiben
SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 );
- for ( USHORT j = 0; j < nCount; ++j )
+ for ( size_t j = 0; j < nCount; ++j )
{
// Item selbst besorgen
- const SfxPoolItem *pItem = (*pArr)->GetObject(j);
+ const SfxPoolItem *pItem = (*pArr)->operator[](j);
if ( pItem && pItem->GetRefCount() ) //! siehe anderes MI-REF
{
- aItemsRec.NewContent(j, 'X' );
+ aItemsRec.NewContent((sal_uInt16)j, 'X' );
if ( pItem->GetRefCount() == SFX_ITEMS_SPECIAL )
- rStream << (USHORT) pItem->GetKind();
+ rStream << (sal_uInt16) pItem->GetKind();
else
{
- rStream << (USHORT) pItem->GetRefCount();
+ rStream << (sal_uInt16) pItem->GetRefCount();
if( pItem->GetRefCount() > SFX_ITEMS_OLD_MAXREF )
rStream.SetError( ERRCODE_IO_NOTSTORABLEINBINARYFORMAT );
}
@@ -259,10 +259,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
#ifdef DBG_UTIL_MI
if ( !pItem->ISA(SfxSetItem) )
{
- ULONG nMark = rStream.Tell();
- rStream.Seek( nItemStartPos + sizeof(USHORT) );
+ sal_uLong nMark = rStream.Tell();
+ rStream.Seek( nItemStartPos + sizeof(sal_uInt16) );
SfxPoolItem *pClone = pItem->Create(rStream, nItemVersion );
- USHORT nWh = pItem->Which();
+ sal_uInt16 nWh = pItem->Which();
SFX_ASSERT( rStream.Tell() == nMark, nWh,"asymmetric store/create" );
SFX_ASSERT( *pClone == *pItem, nWh, "unequal after store/create" );
delete pClone;
@@ -281,20 +281,20 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
if ( !rStream.GetError() )
{
SfxMultiMixRecordWriter aDefsRec( &rStream, SFX_ITEMPOOL_REC_DEFAULTS, 0 );
- USHORT nCount = GetSize_Impl();
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 nCount = GetSize_Impl();
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
const SfxPoolItem* pDefaultItem = ppPoolDefaults[n];
if ( pDefaultItem )
{
// Version ermitteln
- USHORT nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion );
+ sal_uInt16 nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion );
if ( USHRT_MAX == nItemVersion )
// => gab es in der Version noch nicht
continue;
// eigene Kennung, globale Kennung, Version
- USHORT nSlotId = GetSlotId( pDefaultItem->Which(), FALSE );
+ sal_uInt16 nSlotId = GetSlotId( pDefaultItem->Which(), sal_False );
aDefsRec.NewContent( nSlotId, 0 );
rStream << pDefaultItem->Which();
rStream << nItemVersion;
@@ -311,7 +311,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
if ( !rStream.GetError() && pSecondary )
pSecondary->Store( rStream );
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -321,7 +321,7 @@ void SfxItemPool::LoadCompleted()
/* [Beschreibung]
- Wurde der SfxItemPool mit 'bRefCounts' == FALSE geladen, mu\s das
+ Wurde der SfxItemPool mit 'bRefCounts' == sal_False geladen, mu\s das
Laden der Dokumentinhalte mit einem Aufruf dieser Methode beendet
werden. Ansonsten hat der Aufruf dieser Methode keine Funktion.
@@ -347,14 +347,14 @@ void SfxItemPool::LoadCompleted()
// "uber alle Which-Werte iterieren
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
- for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
+ for( sal_uInt16 nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
{
// ist "uberhaupt ein Item mit dem Which-Wert da?
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -382,33 +382,33 @@ void SfxItemPool::LoadCompleted()
//============================================================================
// This had to be moved to a method of its own to keep Solaris GCC happy:
void SfxItemPool::readTheItems (
- SvStream & rStream, USHORT nItemCount, USHORT nVersion,
+ SvStream & rStream, sal_uInt32 nItemCount, sal_uInt16 nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr)
{
SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS );
- SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount );
+ SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl();
SfxPoolItem *pItem = 0;
- USHORT n, nLastSurrogate = USHORT(-1);
+ sal_uLong n, nLastSurrogate = sal_uLong(-1);
while (aItemsRec.GetContent())
{
// n"achstes Surrogat holen
- USHORT nSurrogate = aItemsRec.GetContentTag();
+ sal_uInt16 nSurrogate = aItemsRec.GetContentTag();
DBG_ASSERT( aItemsRec.GetContentVersion() == 'X',
"not an item content" );
// fehlende auff"ullen
for ( pItem = 0, n = nLastSurrogate+1; n < nSurrogate; ++n )
- pNewArr->C40_INSERT(SfxPoolItem, pItem, n);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
nLastSurrogate = nSurrogate;
// Ref-Count und Item laden
- USHORT nRef;
+ sal_uInt16 nRef;
rStream >> nRef;
pItem = pDefItem->Create(rStream, nVersion);
- pNewArr->C40_INSERT(SfxPoolItem, pItem, nSurrogate);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
if ( !bPersistentRefCounts )
// bis <SfxItemPool::LoadCompleted()> festhalten
@@ -424,33 +424,32 @@ void SfxItemPool::readTheItems (
// fehlende auff"ullen
for ( pItem = 0, n = nLastSurrogate+1; n < nItemCount; ++n )
- pNewArr->C40_INSERT(SfxPoolItem, pItem, n);
+ pNewArr->push_back( (SfxPoolItem*) pItem );
SfxPoolItemArray_Impl *pOldArr = *ppArr;
*ppArr = pNewArr;
// die Items merken, die schon im Pool sind
- int bEmpty = TRUE;
+ bool bEmpty = true;
if ( 0 != pOldArr )
- for ( n = 0; bEmpty && n < pOldArr->Count(); ++n )
- bEmpty = pOldArr->GetObject(n) == 0;
+ for ( n = 0; bEmpty && n < pOldArr->size(); ++n )
+ bEmpty = pOldArr->operator[](n) == 0;
DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" );
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- USHORT nFree = USHRT_MAX;
- int bFound = FALSE;
- USHORT nCount = (*ppArr)->Count();
- for ( USHORT nNew = nCount; !bFound && nNew--; )
+ sal_uInt32 nFree = SAL_MAX_UINT32;
+ bool bFound = false;
+ for ( size_t nNew = (*ppArr)->size(); nNew--; )
{
// geladenes Item
SfxPoolItem *&rpNewItem =
- (SfxPoolItem*&)(*ppArr)->GetData()[nNew];
+ (SfxPoolItem*&)(*ppArr)->operator[](nNew);
// surrogat unbenutzt?
if ( !rpNewItem )
@@ -464,17 +463,18 @@ void SfxItemPool::readTheItems (
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = true;
+ break;
}
}
// vorhervorhandene, nicht geladene uebernehmen
if ( !bFound )
{
- if ( nFree != USHRT_MAX )
- (SfxPoolItem*&)(*ppArr)->GetData()[nFree] = pOldItem;
+ if ( nFree != SAL_MAX_UINT32 )
+ (SfxPoolItem*&)(*ppArr)->operator[](nFree) = pOldItem;
else
- (*ppArr)->C40_INSERT( SfxPoolItem, pOldItem, nCount );
+ (*ppArr)->push_back( (SfxPoolItem*) pOldItem );
}
}
}
@@ -495,14 +495,14 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// "uber alle Which-Werte iterieren
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
- for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
+ for( size_t nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
{
// ist "uberhaupt ein Item mit dem Which-Wert da?
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
- SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
+ for( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -528,7 +528,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
pLoadMaster = pLoadMaster->pSecondary;
// Gesamt Header einlesen
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
if ( !pLoadMaster )
{
// Format-Version laden
@@ -549,7 +549,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( pImp->nMajorVer > SFX_ITEMPOOL_VER_MAJOR )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -562,19 +562,19 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMiniRecordReader aPoolRec( &rStream, SFX_ITEMPOOL_REC );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
// Einzel-Header
- int bOwnPool = TRUE;
+ int bOwnPool = sal_True;
UniString aExternName;
{
// Header-Record suchen
SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -588,7 +588,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
aPoolRec.Skip();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
}
@@ -598,25 +598,25 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMultiRecordReader aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
// Versions-Maps einlesen
- USHORT nOwnVersion = pImp->nVersion;
- for ( USHORT nVerNo = 0; aVerRec.GetContent(); ++nVerNo )
+ sal_uInt16 nOwnVersion = pImp->nVersion;
+ for ( sal_uInt16 nVerNo = 0; aVerRec.GetContent(); ++nVerNo )
{
// Header f"ur einzelne Version einlesen
- USHORT nVersion, nHStart, nHEnd;
+ sal_uInt16 nVersion, nHStart, nHEnd;
rStream >> nVersion >> nHStart >> nHEnd;
- USHORT nCount = nHEnd - nHStart + 1;
+ sal_uInt16 nCount = nHEnd - nHStart + 1;
- // Version neuer als bekannt?
- if ( nVerNo >= pImp->aVersions.Count() )
+ // Is new version is known?
+ if ( nVerNo >= pImp->aVersions.size() )
{
- // neue Version hinzufuegen
- USHORT *pMap = new USHORT[nCount];
- for ( USHORT n = 0; n < nCount; ++n )
+ // Add new Version
+ sal_uInt16 *pMap = new sal_uInt16[nCount];
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
rStream >> pMap[n];
SetVersionMap( nVersion, nHStart, nHEnd, pMap );
}
@@ -632,8 +632,9 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
while ( aWhichIdsRec.GetContent() )
{
// SlotId, Which-Id und Item-Version besorgen
- USHORT nCount, nVersion, nWhich;
- //!USHORT nSlotId = aWhichIdsRec.GetContentTag();
+ sal_uInt32 nCount;
+ sal_uInt16 nVersion, nWhich;
+ //!sal_uInt16 nSlotId = aWhichIdsRec.GetContentTag();
rStream >> nWhich;
if ( pImp->nLoadingVersion != pImp->nVersion )
// Which-Id aus File-Version in Pool-Version verschieben
@@ -646,11 +647,11 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
rStream >> nVersion;
rStream >> nCount;
//!SFX_ASSERTWARNING( !nSlotId || !HasMap() ||
- //! ( nSlotId == GetSlotId( nWhich, FALSE ) ) ||
- //! !GetSlotId( nWhich, FALSE ),
+ //! ( nSlotId == GetSlotId( nWhich, sal_False ) ) ||
+ //! !GetSlotId( nWhich, sal_False ),
//! nWhich, "Slot/Which mismatch" );
- USHORT nIndex = GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = GetIndex_Impl(nWhich);
SfxPoolItemArray_Impl **ppArr = pImp->ppPoolItems + nIndex;
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
@@ -659,7 +660,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( !bSecondaryLoaded && pSecondary && pImp->bInSetItem )
{
// an das Ende des eigenen Pools seeken
- ULONG nLastPos = rStream.Tell();
+ sal_uLong nLastPos = rStream.Tell();
aPoolRec.Skip();
// Sekund"arpool einlesen
@@ -674,7 +675,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Items an sich lesen
readTheItems(rStream, nCount, nVersion, pDefItem, ppArr);
- pImp->bInSetItem = FALSE;
+ pImp->bInSetItem = sal_False;
}
}
@@ -685,8 +686,8 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
while ( aDefsRec.GetContent() )
{
// SlotId, Which-Id und Item-Version besorgen
- USHORT nVersion, nWhich;
- //!USHORT nSlotId = aDefsRec.GetContentTag();
+ sal_uInt16 nVersion, nWhich;
+ //!sal_uInt16 nSlotId = aDefsRec.GetContentTag();
rStream >> nWhich;
if ( pImp->nLoadingVersion != pImp->nVersion )
// Which-Id aus File-Version in Pool-Version verschieben
@@ -697,7 +698,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
continue;
rStream >> nVersion;
- //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, FALSE ) ),
+ //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, sal_False ) ),
//! nWhich, "Slot/Which mismatch" );
// Pool-Default-Item selbst laden
@@ -723,7 +724,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
};
@@ -739,19 +740,19 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
rStream >> pImp->nMajorVer >> pImp->nMinorVer;
}
sal_uInt32 nAttribSize;
- int bOwnPool = TRUE;
+ int bOwnPool = sal_True;
UniString aExternName;
if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 )
rStream >> pImp->nLoadingVersion;
SfxPoolItem::readByteString(rStream, aExternName);
bOwnPool = aExternName == aName;
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
//! solange wir keine fremden laden k"onnen
if ( !bOwnPool )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -760,7 +761,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
pImp->nVersion < pImp->nLoadingVersion )
{
rStream.SetError(ERRCODE_IO_WRONGVERSION);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -768,20 +769,20 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
rStream >> nAttribSize;
// Size-Table einlesen
- ULONG nStartPos = rStream.Tell();
+ sal_uLong nStartPos = rStream.Tell();
rStream.SeekRel( nAttribSize );
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_SIZES );
sal_uInt32 nSizeTableLen;
rStream >> nSizeTableLen;
sal_Char *pBuf = new sal_Char[nSizeTableLen];
rStream.Read( pBuf, nSizeTableLen );
- ULONG nEndOfSizes = rStream.Tell();
+ sal_uLong nEndOfSizes = rStream.Tell();
SvMemoryStream aSizeTable( pBuf, nSizeTableLen, STREAM_READ );
// ab Version 1.3 steht in der Size-Table eine Versions-Map
if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 3 )
{
- // Version-Map finden (letztes ULONG der Size-Table gibt Pos an)
+ // Version-Map finden (letztes sal_uLong der Size-Table gibt Pos an)
rStream.Seek( nEndOfSizes - sizeof(sal_uInt32) );
sal_uInt32 nVersionMapPos;
rStream >> nVersionMapPos;
@@ -789,22 +790,22 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Versions-Maps einlesen
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_VERSIONMAP );
- USHORT nVerCount;
+ sal_uInt16 nVerCount;
rStream >> nVerCount;
- for ( USHORT nVerNo = 0; nVerNo < nVerCount; ++nVerNo )
+ for ( sal_uInt16 nVerNo = 0; nVerNo < nVerCount; ++nVerNo )
{
// Header f"ur einzelne Version einlesen
- USHORT nVersion, nHStart, nHEnd;
+ sal_uInt16 nVersion, nHStart, nHEnd;
rStream >> nVersion >> nHStart >> nHEnd;
- USHORT nCount = nHEnd - nHStart + 1;
- USHORT nBytes = (nCount)*sizeof(USHORT);
+ sal_uInt16 nCount = nHEnd - nHStart + 1;
+ sal_uInt16 nBytes = (nCount)*sizeof(sal_uInt16);
- // Version neuer als bekannt?
- if ( nVerNo >= pImp->aVersions.Count() )
+ // Is new version is known?
+ if ( nVerNo >= pImp->aVersions.size() )
{
- // neue Version hinzufuegen
- USHORT *pMap = new USHORT[nCount];
- for ( USHORT n = 0; n < nCount; ++n )
+ // Add new Version
+ sal_uInt16 *pMap = new sal_uInt16[nCount];
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
rStream >> pMap[n];
SetVersionMap( nVersion, nHStart, nHEnd, pMap );
}
@@ -819,7 +820,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS );
bool bSecondaryLoaded = false;
long nSecondaryEnd = 0;
- USHORT nWhich, nSlot;
+ sal_uInt16 nWhich, nSlot;
while ( rStream >> nWhich, nWhich )
{
// ggf. Which-Id aus alter Version verschieben?
@@ -827,10 +828,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = GetNewWhich( nWhich );
rStream >> nSlot;
- USHORT nMappedWhich = GetWhich(nSlot, FALSE);
+ sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False);
int bKnownItem = bOwnPool || IsWhich(nMappedWhich);
- USHORT nRef, nCount, nVersion;
+ sal_uInt16 nRef, nCount, nVersion;
sal_uInt32 nAttrSize;
rStream >> nVersion >> nCount;
@@ -843,18 +844,18 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = nMappedWhich;
//!SFX_ASSERTWARNING( !nSlot || !HasMap() ||
- //! ( nSlot == GetSlotId( nWhich, FALSE ) ) ||
- //! !GetSlotId( nWhich, FALSE ),
+ //! ( nSlot == GetSlotId( nWhich, sal_False ) ) ||
+ //! !GetSlotId( nWhich, sal_False ),
//! nWhich, "Slot/Which mismatch" );
- USHORT nIndex = GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = GetIndex_Impl(nWhich);
ppArr = pImp->ppPoolItems + nIndex;
- pNewArr = new SfxPoolItemArray_Impl( nCount );
+ pNewArr = new SfxPoolItemArray_Impl();
pDefItem = *(ppStaticDefaults + nIndex);
}
// Position vor ersten Item merken
- ULONG nLastPos = rStream.Tell();
+ sal_uLong nLastPos = rStream.Tell();
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
if ( !bSecondaryLoaded && pSecondary && pDefItem->ISA(SfxSetItem) )
@@ -874,9 +875,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
}
// Items an sich lesen
- for ( USHORT j = 0; j < nCount; ++j )
+ for ( sal_uInt16 j = 0; j < nCount; ++j )
{
- ULONG nPos = nLastPos;
+ sal_uLong nPos = nLastPos;
rStream >> nRef;
if ( bKnownItem )
@@ -897,8 +898,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
AddRef(*pItem, nRef);
}
}
-
- pNewArr->C40_INSERT( SfxPoolItem, pItem, j);
+ //pNewArr->insert( pItem, j );
+ pNewArr->push_back( (SfxPoolItem*) pItem );
// restliche gespeicherte Laenge skippen (neueres Format)
nLastPos = rStream.Tell();
@@ -922,26 +923,25 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
*ppArr = pNewArr;
// die Items merken, die schon im Pool sind
- int bEmpty = TRUE;
+ int bEmpty = sal_True;
if ( 0 != pOldArr )
- for ( USHORT n = 0; bEmpty && n < pOldArr->Count(); ++n )
- bEmpty = pOldArr->GetObject(n) == 0;
+ for ( size_t n = 0; bEmpty && n < pOldArr->size(); ++n )
+ bEmpty = pOldArr->operator[](n) == 0;
DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" );
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( size_t nOld = 0; nOld < pOldArr->size(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- int bFound = FALSE;
- for ( USHORT nNew = 0;
- !bFound && nNew < (*ppArr)->Count();
- ++nNew )
+ bool bFound = false;
+ for ( size_t nNew = 0;
+ nNew < (*ppArr)->size(); ++nNew )
{
SfxPoolItem *&rpNewItem =
- (SfxPoolItem*&)(*ppArr)->GetData()[nNew];
+ (SfxPoolItem*&)(*ppArr)->operator[](nNew);
if ( rpNewItem && *rpNewItem == *pOldItem )
{
@@ -949,11 +949,11 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = true;
SFX_TRACE( "reusing item", pOldItem );
+ break;
}
}
- //! DBG_ASSERT( bFound, "old-item not found in file" );
if ( !bFound )
{
SFX_TRACE( "item not found: ", pOldItem );
@@ -969,7 +969,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
if ( pImp->nMajorVer > 1 || pImp->nMinorVer > 0 )
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_DEFAULTS );
- ULONG nLastPos = rStream.Tell();
+ sal_uLong nLastPos = rStream.Tell();
while ( rStream >> nWhich, nWhich )
{
// ggf. Which-Id aus alter Version verschieben?
@@ -977,12 +977,12 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = GetNewWhich( nWhich );
rStream >> nSlot;
- USHORT nMappedWhich = GetWhich(nSlot, FALSE);
+ sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False);
int bKnownItem = bOwnPool || IsWhich(nMappedWhich);
- ULONG nPos = nLastPos;
+ sal_uLong nPos = nLastPos;
sal_uInt32 nSize;
- USHORT nVersion;
+ sal_uInt16 nVersion;
rStream >> nVersion;
if ( bKnownItem )
@@ -1020,7 +1020,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -1029,8 +1029,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
const SfxPoolItem* SfxItemPool::LoadSurrogate
(
SvStream& rStream, // vor einem Surrogat positionierter Stream
- USHORT& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s
- USHORT nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s
+ sal_uInt16& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s
+ sal_uInt16 nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s
const SfxItemPool* pRefPool // <SfxItemPool> in dem das Surrogat gilt
)
@@ -1039,7 +1039,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
L"adt Surrogat aus 'rStream' und liefert das dadurch in 'rRefPool'
repr"asentierte SfxPoolItem zu"ruck. Ist das im Stream befindliche
Surrogat == SFX_ITEMS_DIRECT (!SFX_ITEM_POOLABLE) wird 0 zur"uckgegeben,
- das Item ist direkt aus dem Stream zu laden. Bei 0xfff0 (SFX_ITEMS_NULL)
+ das Item ist direkt aus dem Stream zu laden. Bei 0xfffffff0 (SFX_ITEMS_NULL)
wird auch 0 zurueckgegeben und rWhich auf 0 gesetzt, das Item ist nicht
verfuegbar.
@@ -1071,15 +1071,15 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
*/
{
- // erstmal das Surrogat lesen
- USHORT nSurrogat;
+ // Read the first surrogate
+ sal_uInt32 nSurrogat;
rStream >> nSurrogat;
- // direkt gespeichertes Item?
+ // Is item stored directly?
if ( SFX_ITEMS_DIRECT == nSurrogat )
return 0;
- // nicht vorhandenes Item?
+ // Item does not exist?
if ( SFX_ITEMS_NULL == nSurrogat )
{
rWhich = 0;
@@ -1095,12 +1095,12 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
{
// Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId
// aus dem Stream in eine Which-Id gemappt werden k"onnen.
- USHORT nMappedWhich = nSlotId ? GetWhich(nSlotId, TRUE) : 0;
+ sal_uInt16 nMappedWhich = nSlotId ? GetWhich(nSlotId, sal_True) : 0;
if ( IsWhich(nMappedWhich) )
{
// gemappte SlotId kann "ubernommen werden
rWhich = nMappedWhich;
- bResolvable = TRUE;
+ bResolvable = sal_True;
}
}
@@ -1114,13 +1114,13 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
if ( pTarget->IsInRange(rWhich) )
{
// dflt-Attribut?
- if ( SFX_ITEMS_STATICDEFAULT == nSurrogat )
+ if ( SFX_ITEMS_DEFAULT == nSurrogat )
return *(pTarget->ppStaticDefaults +
pTarget->GetIndex_Impl(rWhich));
SfxPoolItemArray_Impl* pItemArr = *(pTarget->pImp->ppPoolItems +
pTarget->GetIndex_Impl(rWhich));
- pItem = pItemArr && nSurrogat < pItemArr->Count()
+ pItem = pItemArr && nSurrogat < pItemArr->size()
? (*pItemArr)[nSurrogat]
: 0;
if ( !pItem )
@@ -1144,7 +1144,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
}
}
- SFX_ASSERT( FALSE, rWhich, "can't resolve Which-Id in LoadSurrogate" );
+ SFX_ASSERT( sal_False, rWhich, "can't resolve Which-Id in LoadSurrogate" );
}
return 0;
@@ -1172,7 +1172,7 @@ bool SfxItemPool::StoreSurrogate
SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT
gelten als 'echte' Surrogate
- FALSE
+ sal_False
es wurde ein Dummy-Surrogat (SFX_ITEMS_DIRECT)
gespeichert, das eigentliche Item mu\s direkt
hinterher selbst gespeichert werden
@@ -1184,17 +1184,17 @@ bool SfxItemPool::StoreSurrogate
bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
rStream << ( bRealSurrogate
? GetSurrogate( pItem )
- : (UINT16) SFX_ITEMS_DIRECT );
+ : SFX_ITEMS_DIRECT );
return bRealSurrogate;
}
- rStream << (UINT16) SFX_ITEMS_NULL;
- return TRUE;
+ rStream << SFX_ITEMS_NULL;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
+sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
{
DBG_CHKTHIS(SfxItemPool, 0);
DBG_ASSERT( pItem, "no 0-Pointer Surrogate" );
@@ -1210,24 +1210,24 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
// Pointer auf static- oder pool-dflt-Attribut?
if( IsStaticDefaultItem(pItem) || IsPoolDefaultItem(pItem) )
- return SFX_ITEMS_STATICDEFAULT;
+ return SFX_ITEMS_DEFAULT;
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(pItem->Which()));
- DBG_ASSERT(pItemArr, "ItemArr nicht vorhanden");
- const USHORT nCount = pItemArr->Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ DBG_ASSERT(pItemArr, "ItemArr is not available");
+
+ for ( size_t i = 0; i < pItemArr->size(); ++i )
{
const SfxPoolItem *p = (*pItemArr)[i];
if ( p == pItem )
return i;
}
- SFX_ASSERT( 0, pItem->Which(), "Item nicht im Pool");
+ SFX_ASSERT( 0, pItem->Which(), "Item not in the pool");
return SFX_ITEMS_NULL;
}
// -----------------------------------------------------------------------
-bool SfxItemPool::IsInStoringRange( USHORT nWhich ) const
+bool SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nStoringStart &&
nWhich <= pImp->nStoringEnd;
@@ -1235,7 +1235,7 @@ bool SfxItemPool::IsInStoringRange( USHORT nWhich ) const
//------------------------------------------------------------------------
-void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo )
+void SfxItemPool::SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo )
/* [Beschreibung]
@@ -1262,10 +1262,10 @@ void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo )
void SfxItemPool::SetVersionMap
(
- USHORT nVer, /* neue Versionsnummer */
- USHORT nOldStart, /* alte erste Which-Id */
- USHORT nOldEnd, /* alte letzte Which-Id */
- USHORT* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids
+ sal_uInt16 nVer, /* neue Versionsnummer */
+ sal_uInt16 nOldStart, /* alte erste Which-Id */
+ sal_uInt16 nOldEnd, /* alte letzte Which-Id */
+ sal_uInt16* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids
der vorhergehenden Version, in denen
die jeweils neue Which-Id steht. */
)
@@ -1313,31 +1313,31 @@ void SfxItemPool::SetVersionMap
Dabei haben sich also die Ids 3 und 4 ge"andert. F"ur die neue Version
m"u\ste am Pool folgendes gesetzt werden:
- static USHORT nVersion1Map = { 1, 2, 5, 6 };
+ static sal_uInt16 nVersion1Map = { 1, 2, 5, 6 };
pPool->SetVersionMap( 1, 1, 4, &nVersion1Map );
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::GetNewWhich(USHORT)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
{
- // neuen Map-Eintrag erzeugen und einf"ugen
- const SfxPoolVersion_Impl *pVerMap = new SfxPoolVersion_Impl(
- nVer, nOldStart, nOldEnd, pOldWhichIdTab );
- pImp->aVersions.Insert( pVerMap, pImp->aVersions.Count() );
+ // create new map entry to insert
+ const SfxPoolVersion_ImplPtr pVerMap = SfxPoolVersion_ImplPtr( new SfxPoolVersion_Impl(
+ nVer, nOldStart, nOldEnd, pOldWhichIdTab ) );
+ pImp->aVersions.push_back( pVerMap );
DBG_ASSERT( nVer > pImp->nVersion, "Versions not sorted" );
pImp->nVersion = nVer;
// Versions-Range anpassen
- for ( USHORT n = 0; n < nOldEnd-nOldStart+1; ++n )
+ for ( sal_uInt16 n = 0; n < nOldEnd-nOldStart+1; ++n )
{
- USHORT nWhich = pOldWhichIdTab[n];
+ sal_uInt16 nWhich = pOldWhichIdTab[n];
if ( nWhich < pImp->nVerStart )
{
if ( !nWhich )
@@ -1351,9 +1351,9 @@ void SfxItemPool::SetVersionMap
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetNewWhich
+sal_uInt16 SfxItemPool::GetNewWhich
(
- USHORT nFileWhich // die aus dem Stream geladene Which-Id
+ sal_uInt16 nFileWhich // die aus dem Stream geladene Which-Id
) const
/* [Beschreibung]
@@ -1377,7 +1377,7 @@ USHORT SfxItemPool::GetNewWhich
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1398,12 +1398,12 @@ USHORT SfxItemPool::GetNewWhich
if ( nDiff > 0 )
{
// von der Top-Version bis runter zur File-Version stufenweise mappen
- for ( USHORT nMap = pImp->aVersions.Count(); nMap > 0; --nMap )
+ for ( size_t nMap = pImp->aVersions.size(); nMap > 0; --nMap )
{
- SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap-1];
+ SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap-1];
if ( pVerInfo->_nVer > pImp->nVersion )
- { USHORT nOfs;
- USHORT nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1;
+ { sal_uInt16 nOfs;
+ sal_uInt16 nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1;
for ( nOfs = 0;
nOfs <= nCount &&
pVerInfo->_pMap[nOfs] != nFileWhich;
@@ -1424,9 +1424,9 @@ USHORT SfxItemPool::GetNewWhich
else if ( nDiff < 0 )
{
// von der File-Version bis zur aktuellen Version stufenweise mappen
- for ( USHORT nMap = 0; nMap < pImp->aVersions.Count(); ++nMap )
+ for ( size_t nMap = 0; nMap < pImp->aVersions.size(); ++nMap )
{
- SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap];
+ SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap];
if ( pVerInfo->_nVer > pImp->nLoadingVersion )
{
DBG_ASSERT( nFileWhich >= pVerInfo->_nStart &&
@@ -1444,7 +1444,7 @@ USHORT SfxItemPool::GetNewWhich
// -----------------------------------------------------------------------
-bool SfxItemPool::IsInVersionsRange( USHORT nWhich ) const
+bool SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd;
}
@@ -1465,8 +1465,8 @@ bool SfxItemPool::IsCurrentVersionLoading() const
[Querverweise]
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1478,7 +1478,7 @@ bool SfxItemPool::IsCurrentVersionLoading() const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetVersion() const
+sal_uInt16 SfxItemPool::GetVersion() const
/* [Beschreibung]
@@ -1499,8 +1499,8 @@ USHORT SfxItemPool::GetVersion() const
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1510,7 +1510,7 @@ USHORT SfxItemPool::GetVersion() const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetLoadingVersion() const
+sal_uInt16 SfxItemPool::GetLoadingVersion() const
/* [Beschreibung]
@@ -1531,8 +1531,8 @@ USHORT SfxItemPool::GetLoadingVersion() const
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetVersion()const>
*/
@@ -1556,21 +1556,21 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
/* [Beschreibung]
Speichert das <SfxPoolItem> 'rItem' in den <SvStream> 'rStream'
- entweder als Surrogat ('bDirect == FALSE') oder direkt mit 'rItem.Store()'.
+ entweder als Surrogat ('bDirect == sal_False') oder direkt mit 'rItem.Store()'.
Nicht poolable Items werden immer direkt gespeichert. Items ohne Which-Id,
also SID-Items, werden nicht gespeichert, ebenso wenn Items, die in der
- File-Format-Version noch nicht vorhanden waren (return FALSE).
+ File-Format-Version noch nicht vorhanden waren (return sal_False).
Das Item wird im Stream wie folgt abgelegt:
- USHORT rItem.Which()
- USHORT GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar
- USHORT GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE'
+ sal_uInt16 rItem.Which()
+ sal_uInt16 GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar
+ sal_uInt16 GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE'
- optional (falls 'bDirect == TRUE' oder '!rItem.IsPoolable()':
+ optional (falls 'bDirect == sal_True' oder '!rItem.IsPoolable()':
- USHORT rItem.GetVersion()
- ULONG Size
+ sal_uInt16 rItem.GetVersion()
+ sal_uLong Size
Size rItem.Store()
@@ -1583,34 +1583,34 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
DBG_ASSERT( !IsInvalidItem(&rItem), "cannot store invalid items" );
if ( IsSlot( rItem.Which() ) )
- return FALSE;
+ return sal_False;
const SfxItemPool *pPool = this;
while ( !pPool->IsInStoringRange(rItem.Which()) )
if ( 0 == ( pPool = pPool->pSecondary ) )
- return FALSE;
+ return sal_False;
DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem),
"SetItem contains ItemSet with SetItem" );
- USHORT nSlotId = pPool->GetSlotId( rItem.Which(), TRUE );
- USHORT nItemVersion = rItem.GetVersion(_nFileFormatVersion);
+ sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), sal_True );
+ sal_uInt16 nItemVersion = rItem.GetVersion(_nFileFormatVersion);
if ( USHRT_MAX == nItemVersion )
- return FALSE;
+ return sal_False;
rStream << rItem.Which() << nSlotId;
if ( bDirect || !pPool->StoreSurrogate( rStream, &rItem ) )
{
rStream << nItemVersion;
- rStream << (UINT32) 0L; // Platz fuer Laenge in Bytes
- ULONG nIStart = rStream.Tell();
+ rStream << (sal_uInt32) 0L; // Platz fuer Laenge in Bytes
+ sal_uLong nIStart = rStream.Tell();
rItem.Store(rStream, nItemVersion);
- ULONG nIEnd = rStream.Tell();
+ sal_uLong nIEnd = rStream.Tell();
rStream.Seek( nIStart-4 );
- rStream << (INT32) ( nIEnd-nIStart );
+ rStream << (sal_Int32) ( nIEnd-nIStart );
rStream.Seek( nIEnd );
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------------
@@ -1622,10 +1622,10 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
// pRefPool==-1 => nicht putten!
{
- USHORT nWhich, nSlot; // nSurrogate;
+ sal_uInt16 nWhich, nSlot; // nSurrogate;
rStream >> nWhich >> nSlot;
- BOOL bDontPut = (SfxItemPool*)-1 == pRefPool;
+ sal_Bool bDontPut = (SfxItemPool*)-1 == pRefPool;
if ( bDontPut || !pRefPool )
pRefPool = this;
@@ -1637,7 +1637,8 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
else
{
// WID in der Version nicht vorhanden => ueberspringen
- USHORT nSurro, nVersion, nLen;
+ sal_uInt32 nSurro;
+ sal_uInt16 nVersion, nLen;
rStream >> nSurro;
if ( SFX_ITEMS_DIRECT == nSurro )
{
@@ -1668,17 +1669,17 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
pItem = LoadSurrogate( rStream, nWhich, nSlot, pRefPool );
else
// sonst "uberspringen
- rStream.SeekRel( sizeof(USHORT) );
+ rStream.SeekRel( sizeof(sal_uInt16) );
}
// wird direkt, also nicht "uber Surrogat geladen?
if ( bDirect || ( nWhich && !pItem ) )
{
// bDirekt bzw. nicht IsPoolable() => Item direkt laden
- USHORT nVersion;
+ sal_uInt16 nVersion;
sal_uInt32 nLen;
rStream >> nVersion >> nLen;
- ULONG nIStart = rStream.Tell();
+ sal_uLong nIStart = rStream.Tell();
// Which-Id in dieser Version bekannt?
if ( nWhich )
@@ -1696,7 +1697,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
}
else
pItem = 0;
- ULONG nIEnd = rStream.Tell();
+ sal_uLong nIEnd = rStream.Tell();
DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" );
if ( (nIStart+nLen) != nIEnd )
rStream.Seek( nIStart+nLen );
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index c09e419781f0..ec2909fbd9ad 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -39,18 +39,18 @@ DBG_NAME(SfxVoidItem)
// @@@ DBG_NAME(SfxInvalidItem);
DBG_NAME(SfxItemHandle)
-BYTE nSfxFlag8Val[8] =
+sal_uInt8 nSfxFlag8Val[8] =
{
1, 2, 4, 8, 16, 32, 64, 128
};
-USHORT nSfxFlag16Val[16] =
+sal_uInt16 nSfxFlag16Val[16] =
{
1, 2, 4, 8, 16, 32, 64, 128, 256, 512,
1024, 2048, 4096, 8192, 16384, 32768
};
-ULONG nSfxFlag32Val[32] =
+sal_uLong nSfxFlag32Val[32] =
{
0x1L, 0x2L, 0x4L, 0x8L,
0x10L, 0x20L, 0x40L, 0x80L,
@@ -72,7 +72,7 @@ TYPEINIT1(SfxSetItem, SfxPoolItem);
// ------------------------------------------------------------------------
#if OSL_DEBUG_LEVEL > 1
-static ULONG nItemCount = 0;
+static sal_uLong nItemCount = 0;
const char* pw1 = "Wow! 10.000 items!";
const char* pw2 = "Wow! 100.000 items!";
@@ -84,7 +84,7 @@ const char* pw5 = "Wow! 10.000.000 items!";
IMPL_PTRHINT(SfxPoolItemHint,SfxPoolItem)
// SfxPoolItem -----------------------------------------------------------
-SfxPoolItem::SfxPoolItem( USHORT nW )
+SfxPoolItem::SfxPoolItem( sal_uInt16 nW )
: nRefCount( 0 ),
nWhich( nW )
, nKind( 0 )
@@ -193,26 +193,26 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
int SfxPoolItem::IsPoolable() const
{
DBG_CHKTHIS(SfxPoolItem, 0);
- return TRUE;
+ return sal_True;
}
#endif
// -----------------------------------------------------------------------
-SfxPoolItem* SfxPoolItem::Create(SvStream &, USHORT) const
+SfxPoolItem* SfxPoolItem::Create(SvStream &, sal_uInt16) const
{
DBG_CHKTHIS(SfxPoolItem, 0);
return Clone(0);
}
// -----------------------------------------------------------------------
-USHORT SfxPoolItem::GetVersion( USHORT ) const
+sal_uInt16 SfxPoolItem::GetVersion( sal_uInt16 ) const
{
DBG_CHKTHIS(SfxPoolItem, 0);
return 0;
}
// -----------------------------------------------------------------------
-SvStream& SfxPoolItem::Store(SvStream &rStream, USHORT ) const
+SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxPoolItem, 0);
return rStream;
@@ -270,7 +270,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation
von allen UI-relevanten SfxPoolItem-Subklassen "uberladen werden.
Da die Ma\seinheit des Wertes im SfxItemPool nur "uber
- <SfxItemPool::GetMetric(USHORT)const> erfragbar ist, und nicht etwa
+ <SfxItemPool::GetMetric(sal_uInt16)const> erfragbar ist, und nicht etwa
in der SfxPoolItem-Instanz oder -Subklasse verf"ugbar ist, wird die
eigene Ma\seinheit als 'eCoreMetric' "ubergeben.
@@ -313,7 +313,7 @@ SfxItemPresentation SfxPoolItem::GetPresentation
}
// SfxVoidItem ------------------------------------------------------------
-SfxVoidItem::SfxVoidItem( USHORT which ):
+SfxVoidItem::SfxVoidItem( sal_uInt16 which ):
SfxPoolItem(which)
{
DBG_CTOR(SfxVoidItem, 0);
@@ -335,7 +335,7 @@ rCmp
{
DBG_CHKTHIS(SfxVoidItem, 0);
DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -364,7 +364,7 @@ SfxPoolItem* SfxVoidItem::Clone(SfxItemPool *) const
// SfxItemHandle ----------------------------------------------------------
SfxItemHandle::SfxItemHandle(SfxPoolItem &rItem):
- pRef(new USHORT(1)),
+ pRef(new sal_uInt16(1)),
pItem(rItem.Clone(0))
{
DBG_CTOR(SfxItemHandle, 0);
@@ -422,7 +422,7 @@ bool SfxPoolItem::HasMetrics() const
// -----------------------------------------------------------------------
-bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, BYTE ) const
+bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const
{
OSL_FAIL("There is no implementation for QueryValue for this item!");
return false;
@@ -430,7 +430,7 @@ bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, BYTE ) const
// -----------------------------------------------------------------------
-bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, BYTE )
+bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 )
{
OSL_FAIL("There is no implementation for PutValue for this item!");
return false;
diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx
index 3471f6eee0cf..e3d3ad5fdc1a 100644
--- a/svl/source/items/ptitem.cxx
+++ b/svl/source/items/ptitem.cxx
@@ -58,7 +58,7 @@ SfxPointItem::SfxPointItem()
// -----------------------------------------------------------------------
-SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) :
+SfxPointItem::SfxPointItem( sal_uInt16 nW, const Point& rVal ) :
SfxPoolItem( nW ),
aVal( rVal )
{
@@ -67,7 +67,7 @@ SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) :
// -----------------------------------------------------------------------
-SfxPointItem::SfxPointItem( USHORT nW, SvStream &rStream ) :
+SfxPointItem::SfxPointItem( sal_uInt16 nW, SvStream &rStream ) :
SfxPoolItem( nW )
{
DBG_CTOR(SfxPointItem, 0);
@@ -121,7 +121,7 @@ SfxPoolItem* SfxPointItem::Clone(SfxItemPool *) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxPointItem::Create(SvStream &rStream, USHORT ) const
+SfxPoolItem* SfxPointItem::Create(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxPointItem, 0);
Point aStr;
@@ -131,7 +131,7 @@ SfxPoolItem* SfxPointItem::Create(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
-SvStream& SfxPointItem::Store(SvStream &rStream, USHORT ) const
+SvStream& SfxPointItem::Store(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxPointItem, 0);
rStream << aVal;
@@ -141,7 +141,7 @@ SvStream& SfxPointItem::Store(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
bool SfxPointItem::QueryValue( uno::Any& rVal,
- BYTE nMemberId ) const
+ sal_uInt8 nMemberId ) const
{
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
awt::Point aTmp(aVal.X(), aVal.Y());
@@ -165,11 +165,11 @@ bool SfxPointItem::QueryValue( uno::Any& rVal,
// -----------------------------------------------------------------------
bool SfxPointItem::PutValue( const uno::Any& rVal,
- BYTE nMemberId )
+ sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
- bool bRet = FALSE;
+ bool bRet = false;
awt::Point aValue;
sal_Int32 nVal = 0;
if ( !nMemberId )
@@ -195,7 +195,7 @@ bool SfxPointItem::PutValue( const uno::Any& rVal,
case 0: aVal.setX( aValue.X ); aVal.setY( aValue.Y ); break;
case MID_X: aVal.setX( nVal ); break;
case MID_Y: aVal.setY( nVal ); break;
- default: OSL_FAIL("Wrong MemberId!"); return FALSE;
+ default: OSL_FAIL("Wrong MemberId!"); return false;
}
}
diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx
index bf3b865ef6d9..ddf19201e63b 100644
--- a/svl/source/items/rectitem.cxx
+++ b/svl/source/items/rectitem.cxx
@@ -55,7 +55,7 @@ SfxRectangleItem::SfxRectangleItem()
// -----------------------------------------------------------------------
-SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) :
+SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, const Rectangle& rVal ) :
SfxPoolItem( nW ),
aVal( rVal )
{
@@ -64,7 +64,7 @@ SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) :
// -----------------------------------------------------------------------
-SfxRectangleItem::SfxRectangleItem( USHORT nW, SvStream &rStream ) :
+SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, SvStream &rStream ) :
SfxPoolItem( nW )
{
DBG_CTOR(SfxRectangleItem, 0);
@@ -121,7 +121,7 @@ SfxPoolItem* SfxRectangleItem::Clone(SfxItemPool *) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, USHORT ) const
+SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxRectangleItem, 0);
Rectangle aStr;
@@ -131,7 +131,7 @@ SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
-SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT ) const
+SvStream& SfxRectangleItem::Store(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxRectangleItem, 0);
rStream << aVal;
@@ -141,7 +141,7 @@ SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId) const
+ sal_uInt8 nMemberId) const
{
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
@@ -166,7 +166,7 @@ bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal,
// -----------------------------------------------------------------------
bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId )
+ sal_uInt8 nMemberId )
{
bool bRet = false;
nMemberId &= ~CONVERT_TWIPS;
diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx
index a08329360d2a..6be0975f8535 100644
--- a/svl/source/items/rngitem.cxx
+++ b/svl/source/items/rngitem.cxx
@@ -32,7 +32,7 @@
#ifndef NUMTYPE
-#define NUMTYPE USHORT
+#define NUMTYPE sal_uInt16
#define SfxXRangeItem SfxRangeItem
#define SfxXRangesItem SfxUShortRangesItem
#include <svl/rngitem.hxx>
diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx
index 97a641131b3e..5be6228f147f 100644..100755
--- a/svl/source/items/rngitem_inc.cxx
+++ b/svl/source/items/rngitem_inc.cxx
@@ -53,7 +53,7 @@ SfxXRangeItem::SfxXRangeItem()
// -----------------------------------------------------------------------
-SfxXRangeItem::SfxXRangeItem( USHORT which, NUMTYPE from, NUMTYPE to ):
+SfxXRangeItem::SfxXRangeItem( sal_uInt16 which, NUMTYPE from, NUMTYPE to ):
SfxPoolItem( which ),
nFrom( from ),
nTo( to )
@@ -63,7 +63,7 @@ SfxXRangeItem::SfxXRangeItem( USHORT which, NUMTYPE from, NUMTYPE to ):
// -----------------------------------------------------------------------
-SfxXRangeItem::SfxXRangeItem( USHORT nW, SvStream &rStream ) :
+SfxXRangeItem::SfxXRangeItem( sal_uInt16 nW, SvStream &rStream ) :
SfxPoolItem( nW )
{
rStream >> nFrom;
@@ -116,7 +116,7 @@ SfxPoolItem* SfxXRangeItem::Clone(SfxItemPool *) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, USHORT) const
+SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, sal_uInt16) const
{
NUMTYPE nVon, nBis;
rStream >> nVon;
@@ -126,7 +126,7 @@ SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, USHORT) const
// -----------------------------------------------------------------------
-SvStream& SfxXRangeItem::Store(SvStream &rStream, USHORT) const
+SvStream& SfxXRangeItem::Store(SvStream &rStream, sal_uInt16) const
{
rStream << nFrom;
rStream << nTo;
@@ -142,7 +142,7 @@ SfxXRangesItem::SfxXRangesItem()
//-------------------------------------------------------------------------
-SfxXRangesItem::SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges )
+SfxXRangesItem::SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges )
: SfxPoolItem( nWID )
{
NUMTYPE nCount = Count_Impl(pRanges) + 1;
@@ -152,7 +152,7 @@ SfxXRangesItem::SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges )
//-------------------------------------------------------------------------
-SfxXRangesItem::SfxXRangesItem( USHORT nWID, SvStream &rStream )
+SfxXRangesItem::SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream )
: SfxPoolItem( nWID )
{
NUMTYPE nCount;
@@ -186,9 +186,9 @@ int SfxXRangesItem::operator==( const SfxPoolItem &rItem ) const
{
const SfxXRangesItem &rOther = (const SfxXRangesItem&) rItem;
if ( !_pRanges && !rOther._pRanges )
- return TRUE;
+ return sal_True;
if ( _pRanges || rOther._pRanges )
- return FALSE;
+ return sal_False;
NUMTYPE n;
for ( n = 0; _pRanges[n] && rOther._pRanges[n]; ++n )
@@ -219,14 +219,14 @@ SfxPoolItem* SfxXRangesItem::Clone( SfxItemPool * ) const
//-------------------------------------------------------------------------
-SfxPoolItem* SfxXRangesItem::Create( SvStream &rStream, USHORT ) const
+SfxPoolItem* SfxXRangesItem::Create( SvStream &rStream, sal_uInt16 ) const
{
return new SfxXRangesItem( Which(), rStream );
}
//-------------------------------------------------------------------------
-SvStream& SfxXRangesItem::Store( SvStream &rStream, USHORT ) const
+SvStream& SfxXRangesItem::Store( SvStream &rStream, sal_uInt16 ) const
{
NUMTYPE nCount = Count_Impl( _pRanges );
rStream >> nCount;
diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx
index 4f41dfe63b39..61afc8a2004a 100644
--- a/svl/source/items/sfontitm.cxx
+++ b/svl/source/items/sfontitm.cxx
@@ -73,7 +73,7 @@ int SfxFontItem::operator ==(const SfxPoolItem & rItem) const
//============================================================================
// virtual
-SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * SfxFontItem::Create(SvStream & rStream, sal_uInt16) const
{
VersionCompat aItemCompat(rStream, STREAM_READ);
SfxFontItem * pItem = new SfxFontItem(Which());
@@ -105,8 +105,8 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const
rStream >> nKerning;
pItem->m_bKerning = nKerning != 0;
}
- pItem->m_aColor.Read(rStream, TRUE);
- pItem->m_aFillColor.Read(rStream, TRUE);
+ pItem->m_aColor.Read(rStream, sal_True);
+ pItem->m_aFillColor.Read(rStream, sal_True);
sal_Int16 nFlags = 0;
rStream >> nFlags;
pItem->m_bHasFont = (nFlags & 4) != 0;
@@ -117,7 +117,7 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & SfxFontItem::Store(SvStream & rStream, USHORT) const
+SvStream & SfxFontItem::Store(SvStream & rStream, sal_uInt16) const
{
VersionCompat aItemCompat(rStream, STREAM_WRITE, 1);
{
@@ -131,8 +131,8 @@ SvStream & SfxFontItem::Store(SvStream & rStream, USHORT) const
<< sal_Int8(m_bOutline) << sal_Int8(m_bShadow)
<< sal_Int8(m_bKerning);
}
- SAL_CONST_CAST(Color &, m_aColor).Write(rStream, TRUE);
- SAL_CONST_CAST(Color &, m_aFillColor).Write(rStream, TRUE);
+ SAL_CONST_CAST(Color &, m_aColor).Write(rStream, sal_True);
+ SAL_CONST_CAST(Color &, m_aFillColor).Write(rStream, sal_True);
rStream << sal_Int16(m_bHasFont << 2 | m_bHasColor
| m_bHasFillColor << 1);
return rStream;
diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx
index 48953164d4d3..a077a6f5380f 100644
--- a/svl/source/items/sitem.cxx
+++ b/svl/source/items/sitem.cxx
@@ -42,16 +42,16 @@ DBG_NAME(SfxSetItem)
// --------------------------------------------------------------------------
-SfxSetItem::SfxSetItem( USHORT which, const SfxItemSet &rSet) :
+SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
SfxPoolItem(which),
- pSet(rSet.Clone(TRUE))
+ pSet(rSet.Clone(sal_True))
{
DBG_CTOR(SfxSetItem, 0);
}
// --------------------------------------------------------------------------
-SfxSetItem::SfxSetItem( USHORT which, SfxItemSet *pS) :
+SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet *pS) :
SfxPoolItem(which),
pSet(pS)
{
@@ -63,7 +63,7 @@ SfxSetItem::SfxSetItem( USHORT which, SfxItemSet *pS) :
SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
SfxPoolItem(rCopy.Which()),
- pSet(rCopy.pSet->Clone(TRUE, pPool))
+ pSet(rCopy.pSet->Clone(sal_True, pPool))
{
DBG_CTOR(SfxSetItem, 0);
}
@@ -102,7 +102,7 @@ SfxItemPresentation SfxSetItem::GetPresentation
// --------------------------------------------------------------------------
-SvStream& SfxSetItem::Store(SvStream& rStream, USHORT) const
+SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const
{
GetItemSet().Store(rStream);
return rStream;
diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index 392f986f942f..e001bf1e23f2 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -46,12 +46,12 @@ TYPEINIT1_AUTOFACTORY(SfxStringListItem, SfxPoolItem);
class SfxImpStringList
{
public:
- USHORT nRefCount;
+ sal_uInt16 nRefCount;
List aList;
SfxImpStringList() { nRefCount = 1; }
~SfxImpStringList();
- void Sort( BOOL bAscending, List* );
+ void Sort( sal_Bool bAscending, List* );
};
//------------------------------------------------------------------------
@@ -70,36 +70,36 @@ SfxImpStringList::~SfxImpStringList()
//------------------------------------------------------------------------
-void SfxImpStringList::Sort( BOOL bAscending, List* pParallelList )
+void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList )
{
DBG_ASSERT(!pParallelList || pParallelList->Count() >= aList.Count(),"Sort:ParallelList too small");
- ULONG nCount = aList.Count();
+ sal_uLong nCount = aList.Count();
if( nCount > 1 )
{
nCount -= 2;
// Bubble Dir Einen
- BOOL bSwapped = TRUE;
+ sal_Bool bSwapped = sal_True;
while( bSwapped )
{
- bSwapped = FALSE;
- for( ULONG nCur = 0; nCur <= nCount; nCur++ )
+ bSwapped = sal_False;
+ for( sal_uLong nCur = 0; nCur <= nCount; nCur++ )
{
String* pStr1 = (String*)aList.GetObject( nCur );
String* pStr2 = (String*)aList.GetObject( nCur+1 );
// COMPARE_GREATER => pStr2 ist groesser als pStr1
StringCompare eCompare = pStr1->CompareIgnoreCaseToAscii( *pStr2 ); //@@@
- BOOL bSwap = FALSE;
+ sal_Bool bSwap = sal_False;
if( bAscending )
{
if( eCompare == COMPARE_LESS )
- bSwap = TRUE;
+ bSwap = sal_True;
}
else if( eCompare == COMPARE_GREATER )
- bSwap = TRUE;
+ bSwap = sal_True;
if( bSwap )
{
- bSwapped = TRUE;
+ bSwapped = sal_True;
aList.Replace( pStr1, nCur + 1 );
aList.Replace( pStr2, nCur );
if( pParallelList )
@@ -124,7 +124,7 @@ SfxStringListItem::SfxStringListItem() :
//------------------------------------------------------------------------
-SfxStringListItem::SfxStringListItem( USHORT which, const List* pList ) :
+SfxStringListItem::SfxStringListItem( sal_uInt16 which, const List* pList ) :
SfxPoolItem( which ),
pImp(NULL)
{
@@ -147,7 +147,7 @@ SfxStringListItem::SfxStringListItem( USHORT which, const List* pList ) :
//------------------------------------------------------------------------
-SfxStringListItem::SfxStringListItem( USHORT which, SvStream& rStream ) :
+SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) :
SfxPoolItem( which ),
pImp(NULL)
{
@@ -215,9 +215,9 @@ int SfxStringListItem::operator==( const SfxPoolItem& rItem ) const
SfxStringListItem* pItem = (SfxStringListItem*)&rItem;
if( pImp == pItem->pImp )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------------
@@ -251,14 +251,14 @@ SfxPoolItem* SfxStringListItem::Clone( SfxItemPool *) const
//------------------------------------------------------------------------
-SfxPoolItem* SfxStringListItem::Create( SvStream & rStream, USHORT ) const
+SfxPoolItem* SfxStringListItem::Create( SvStream & rStream, sal_uInt16 ) const
{
return new SfxStringListItem( Which(), rStream );
}
//------------------------------------------------------------------------
-SvStream& SfxStringListItem::Store( SvStream & rStream, USHORT ) const
+SvStream& SfxStringListItem::Store( SvStream & rStream, sal_uInt16 ) const
{
if( !pImp )
{
@@ -348,14 +348,14 @@ XubString SfxStringListItem::GetString()
int SfxStringListItem::IsPoolable() const
{
- return FALSE;
+ return sal_False;
}
#endif
//------------------------------------------------------------------------
-void SfxStringListItem::Sort( BOOL bAscending, List* pParallelList )
+void SfxStringListItem::Sort( sal_Bool bAscending, List* pParallelList )
{
DBG_ASSERT(GetRefCount()==0,"Sort:RefCount!=0");
if( pImp )
@@ -394,7 +394,7 @@ void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< rtl::OUStr
//----------------------------------------------------------------------------
// virtual
-bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE )
+bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 )
{
com::sun::star::uno::Sequence< rtl::OUString > aValue;
if ( rVal >>= aValue )
@@ -409,7 +409,7 @@ bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,BYTE )
//----------------------------------------------------------------------------
// virtual
-bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,BYTE ) const
+bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const
{
// GetString() is not const!!!
SfxStringListItem* pThis = const_cast< SfxStringListItem * >( this );
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index b7e162511fb9..d1d0bf7483f5 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -102,7 +102,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames()
const int nCount = SAL_N_ELEMENTS( aTranslitNames );
Sequence< ::rtl::OUString > aNames( nCount );
::rtl::OUString* pNames = aNames.getArray();
- for (INT32 i = 0; i < nCount; ++i)
+ for (sal_Int32 i = 0; i < nCount; ++i)
pNames[i] = ::rtl::OUString::createFromAscii( aTranslitNames[i] );
return aNames;
@@ -132,7 +132,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
bBackward ( sal_False ),
bPattern ( sal_False ),
bContent ( sal_False ),
- bAsianOptions ( FALSE )
+ bAsianOptions ( sal_False )
{
EnableNotification( lcl_GetNotifyNames() );
@@ -149,7 +149,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
if (aOpt.IsWholeWordsOnly())
aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
- INT32 &rFlags = aSearchOpt.transliterateFlags;
+ sal_Int32 &rFlags = aSearchOpt.transliterateFlags;
if (!aOpt.IsMatchCase())
rFlags |= TransliterationModules_IGNORE_CASE;
@@ -234,7 +234,7 @@ SfxPoolItem* SvxSearchItem::Clone( SfxItemPool *) const
// -----------------------------------------------------------------------
//! used below
-static BOOL operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 )
+static sal_Bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 )
{
return rItem1.algorithmType == rItem2.algorithmType &&
rItem1.searchFlag == rItem2.searchFlag &&
@@ -431,7 +431,7 @@ void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags )
aSearchOpt.transliterateFlags = nFlags;
}
-bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const
+bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
@@ -523,7 +523,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId )
// -----------------------------------------------------------------------
-bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId )
+bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
bool bRet = false;
diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx
index cc1cd2d4e1e6..2dc013bdf5d4 100644
--- a/svl/source/items/stritem.cxx
+++ b/svl/source/items/stritem.cxx
@@ -40,7 +40,7 @@ TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem)
//============================================================================
// virtual
-SfxStringItem::SfxStringItem(USHORT which, SvStream & rStream):
+SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream):
CntUnencodedStringItem(which)
{
UniString aValue;
@@ -51,14 +51,14 @@ SfxStringItem::SfxStringItem(USHORT which, SvStream & rStream):
//============================================================================
// virtual
-SfxPoolItem * SfxStringItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * SfxStringItem::Create(SvStream & rStream, sal_uInt16) const
{
return new SfxStringItem(Which(), rStream);
}
//============================================================================
// virtual
-SvStream & SfxStringItem::Store(SvStream & rStream, USHORT) const
+SvStream & SfxStringItem::Store(SvStream & rStream, sal_uInt16) const
{
writeByteString(rStream, GetValue());
return rStream;
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 243ab85019a0..adb7efa7b260 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -53,7 +53,7 @@
#include <algorithm>
#define STYLESTREAM "SfxStyleSheets"
-#define STYLESTREAM_VERSION USHORT(50)
+#define STYLESTREAM_VERSION sal_uInt16(50)
#ifdef DBG_UTIL
class DbgStyleSheetReferences
@@ -85,7 +85,7 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint);
SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
(
- USHORT nAction, // SFX_STYLESHEET_... (s.o.)
+ sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
const String& rOldName
)
: SfxStyleSheetHint( nAction ),
@@ -93,7 +93,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
{}
SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
(
- USHORT nAction, // SFX_STYLESHEET_... (s.o.)
+ sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
const String& rOldName,
SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
)
@@ -105,7 +105,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
SfxStyleSheetHint::SfxStyleSheetHint
(
- USHORT nAction, // SFX_STYLESHEET_... (s.o.)
+ sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
)
: pStyleSh( &rStyleSheet ),
@@ -114,7 +114,7 @@ SfxStyleSheetHint::SfxStyleSheetHint
SfxStyleSheetHint::SfxStyleSheetHint
(
- USHORT nAction // SFX_STYLESHEET_... (s.o.)
+ sal_uInt16 nAction // SFX_STYLESHEET_... (s.o.)
)
: pStyleSh( NULL ),
nHint( nAction )
@@ -136,7 +136,7 @@ class SfxStyleSheetBasePool_Impl
// Konstruktoren
-SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, USHORT mask )
+SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, sal_uInt16 mask )
: rPool( r )
, nFamily( eFam )
, aName( rName )
@@ -145,7 +145,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBaseP
, pSet( NULL )
, nMask(mask)
, nHelpId( 0 )
- , bMySet( FALSE )
+ , bMySet( sal_False )
{
#ifdef DBG_UTIL
aDbgStyleSheetReferences.mnStyles++;
@@ -205,7 +205,7 @@ SfxStyleSheetBase::~SfxStyleSheetBase()
}
}
-USHORT SfxStyleSheetBase::GetVersion() const
+sal_uInt16 SfxStyleSheetBase::GetVersion() const
{
return 0x0000;
}
@@ -217,24 +217,24 @@ const XubString& SfxStyleSheetBase::GetName() const
return aName;
}
-BOOL SfxStyleSheetBase::SetName( const XubString& rName )
+sal_Bool SfxStyleSheetBase::SetName( const XubString& rName )
{
if(rName.Len() == 0)
- return FALSE;
+ return sal_False;
if( aName != rName )
{
String aOldName = aName;
SfxStyleSheetBase *pOther = rPool.Find( rName, nFamily ) ;
if ( pOther && pOther != this )
- return FALSE;
+ return sal_False;
SfxStyleFamily eTmpFam=rPool.GetSearchFamily();
- USHORT nTmpMask=rPool.GetSearchMask();
+ sal_uInt16 nTmpMask=rPool.GetSearchMask();
rPool.SetSearchMask(nFamily);
if ( aName.Len() )
- rPool.ChangeParent( aName, rName, FALSE );
+ rPool.ChangeParent( aName, rName, sal_False );
if ( aFollow.Equals( aName ) )
aFollow = rName;
aName = rName;
@@ -242,7 +242,7 @@ BOOL SfxStyleSheetBase::SetName( const XubString& rName )
rPool.Broadcast( SfxStyleSheetHintExtended(
SFX_STYLESHEET_MODIFIED, aOldName, *this ) );
}
- return TRUE;
+ return sal_True;
}
rtl::OUString SfxStyleSheetBase::GetDisplayName() const
@@ -269,10 +269,10 @@ const XubString& SfxStyleSheetBase::GetParent() const
return aParent;
}
-BOOL SfxStyleSheetBase::SetParent( const XubString& rName )
+sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName )
{
if ( rName == aName )
- return FALSE;
+ return sal_False;
if( aParent != rName )
{
@@ -280,20 +280,20 @@ BOOL SfxStyleSheetBase::SetParent( const XubString& rName )
if( rName.Len() && !pIter )
{
OSL_FAIL( "StyleSheet-Parent nicht gefunden" );
- return FALSE;
+ return sal_False;
}
// rekursive Verknuepfungen verhindern
if( aName.Len() )
while(pIter)
{
if(pIter->GetName() == aName && aName != rName)
- return FALSE;
+ return sal_False;
pIter = rPool.Find(pIter->GetParent(), nFamily);
}
aParent = rName;
}
rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
- return TRUE;
+ return sal_True;
}
// Follow aendern
@@ -303,19 +303,19 @@ const XubString& SfxStyleSheetBase::GetFollow() const
return aFollow;
}
-BOOL SfxStyleSheetBase::SetFollow( const XubString& rName )
+sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName )
{
if( aFollow != rName )
{
if( !rPool.Find( rName, nFamily ) )
{
OSL_FAIL( "StyleSheet-Follow nicht gefunden" );
- return FALSE;
+ return sal_False;
}
aFollow = rName;
}
rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
- return TRUE;
+ return sal_True;
}
// Itemset setzen. Die Dflt-Implementation legt ein neues Set an.
@@ -325,20 +325,20 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet()
if( !pSet )
{
pSet = new SfxItemSet( rPool.GetPool() );
- bMySet = TRUE;
+ bMySet = sal_True;
}
return *pSet;
}
// Hilfe-Datei und -ID setzen und abfragen
-ULONG SfxStyleSheetBase::GetHelpId( String& rFile )
+sal_uLong SfxStyleSheetBase::GetHelpId( String& rFile )
{
rFile = aHelpFile;
return nHelpId;
}
-void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId )
+void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uLong nId )
{
aHelpFile = rFile;
nHelpId = nId;
@@ -346,30 +346,30 @@ void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId )
// Folgevorlage m"oglich? Default: Ja
-BOOL SfxStyleSheetBase::HasFollowSupport() const
+sal_Bool SfxStyleSheetBase::HasFollowSupport() const
{
- return TRUE;
+ return sal_True;
}
// Basisvorlage m"oglich? Default: Ja
-BOOL SfxStyleSheetBase::HasParentSupport() const
+sal_Bool SfxStyleSheetBase::HasParentSupport() const
{
- return TRUE;
+ return sal_True;
}
// Basisvorlage uf NULL setzen m"oglich? Default: Nein
-BOOL SfxStyleSheetBase::HasClearParentSupport() const
+sal_Bool SfxStyleSheetBase::HasClearParentSupport() const
{
- return FALSE;
+ return sal_False;
}
// Defaultmaessig sind alle StyleSheets Used
-BOOL SfxStyleSheetBase::IsUsed() const
+sal_Bool SfxStyleSheetBase::IsUsed() const
{
- return TRUE;
+ return sal_True;
}
// eingestellte Attribute ausgeben
@@ -416,30 +416,30 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const
return nSearchFamily;
}
-inline BOOL SfxStyleSheetIterator::IsTrivialSearch()
+inline sal_Bool SfxStyleSheetIterator::IsTrivialSearch()
{
return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL;
}
-BOOL SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
+sal_Bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
{
return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) ||
( pStyle->GetFamily() == GetSearchFamily() ))
&& (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) ||
- ( bSearchUsed ? pStyle->IsUsed() : FALSE ) ||
+ ( bSearchUsed ? pStyle->IsUsed() : sal_False ) ||
GetSearchMask() == SFXSTYLEBIT_ALL );
}
SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
- SfxStyleFamily eFam, USHORT n)
+ SfxStyleFamily eFam, sal_uInt16 n)
{
pBasePool=pBase;
nSearchFamily=eFam;
- bSearchUsed=FALSE;
+ bSearchUsed=sal_False;
if((n != SFXSTYLEBIT_ALL ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED))
{
- bSearchUsed = TRUE;
+ bSearchUsed = sal_True;
n &= ~SFXSTYLEBIT_USED;
}
nMask=n;
@@ -450,13 +450,13 @@ SfxStyleSheetIterator::~SfxStyleSheetIterator()
}
-USHORT SfxStyleSheetIterator::Count()
+sal_uInt16 SfxStyleSheetIterator::Count()
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
if( IsTrivialSearch())
- n = (USHORT) pBasePool->aStyles.size();
+ n = (sal_uInt16) pBasePool->aStyles.size();
else
- for(USHORT i=0; i<pBasePool->aStyles.size(); i++)
+ for(sal_uInt16 i=0; i<pBasePool->aStyles.size(); i++)
{
SfxStyleSheetBase* pStyle = pBasePool->aStyles[i].get();
if(DoesStyleMatch(pStyle))
@@ -465,13 +465,13 @@ USHORT SfxStyleSheetIterator::Count()
return n;
}
-SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx)
+SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
{
if( IsTrivialSearch())
return pBasePool->aStyles[nIdx].get();
- USHORT z = 0;
- for(USHORT n=0; n<pBasePool->aStyles.size(); n++)
+ sal_uInt16 z = 0;
+ for(sal_uInt16 n=0; n<pBasePool->aStyles.size(); n++)
{
SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get();
if( DoesStyleMatch(pStyle))
@@ -490,12 +490,12 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx)
SfxStyleSheetBase* SfxStyleSheetIterator::First()
{
- INT32 nIdx = -1;
+ sal_Int32 nIdx = -1;
if ( IsTrivialSearch() && pBasePool->aStyles.size() )
nIdx = 0;
else
- for( USHORT n = 0; n < pBasePool->aStyles.size(); n++ )
+ for( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ )
{
SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get();
@@ -508,7 +508,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First()
if ( nIdx != -1 )
{
- nAktPosition = (USHORT)nIdx;
+ nAktPosition = (sal_uInt16)nIdx;
return pAktStyle = pBasePool->aStyles[nIdx].get();
}
return 0;
@@ -517,13 +517,13 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First()
SfxStyleSheetBase* SfxStyleSheetIterator::Next()
{
- INT32 nIdx = -1;
+ sal_Int32 nIdx = -1;
if ( IsTrivialSearch() &&
- (USHORT)pBasePool->aStyles.size() > nAktPosition + 1 )
+ (sal_uInt16)pBasePool->aStyles.size() > nAktPosition + 1 )
nIdx = nAktPosition + 1;
else
- for( USHORT n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ )
+ for( sal_uInt16 n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ )
{
SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get();
@@ -536,7 +536,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
if ( nIdx != -1 )
{
- nAktPosition = (USHORT)nIdx;
+ nAktPosition = (sal_uInt16)nIdx;
return pAktStyle = pBasePool->aStyles[nIdx].get();
}
return 0;
@@ -545,11 +545,11 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr)
{
- for ( USHORT n = 0; n < pBasePool->aStyles.size(); n++ )
+ for ( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ )
{
SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get();
- // #98454# performance: in case of bSearchUsed==TRUE it may be
+ // #98454# performance: in case of bSearchUsed==sal_True it may be
// significant to first compare the name and only if it matches to call
// the style sheet IsUsed() method in DoesStyleMatch().
if ( pStyle->GetName().Equals( rStr ) && DoesStyleMatch( pStyle ) )
@@ -562,9 +562,9 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr)
}
-USHORT SfxStyleSheetIterator::GetSearchMask() const
+sal_uInt16 SfxStyleSheetIterator::GetSearchMask() const
{
- USHORT mask = nMask;
+ sal_uInt16 mask = nMask;
if ( bSearchUsed )
mask |= SFXSTYLEBIT_USED;
@@ -636,7 +636,7 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool()
delete pImp;
}
-BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent)
+sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent)
{
SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL);
SfxStyleSheetBase *pStyle =
@@ -645,16 +645,16 @@ BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rSty
if(pStyle)
return pStyle->SetParent(rParent);
else
- return FALSE;
+ return sal_False;
}
-void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, USHORT n)
+void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n)
{
nSearchFamily = eFam; nMask = n;
}
-USHORT SfxStyleSheetBasePool::GetSearchMask() const
+sal_uInt16 SfxStyleSheetBasePool::GetSearchMask() const
{
return nMask;
}
@@ -674,7 +674,7 @@ String SfxStyleSheetBasePool::GetStreamName()
SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator
(
SfxStyleFamily eFam,
- USHORT mask
+ sal_uInt16 mask
)
{
return new SfxStyleSheetIterator(this,eFam,mask);
@@ -685,7 +685,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create
(
const XubString& rName,
SfxStyleFamily eFam,
- USHORT mask
+ sal_uInt16 mask
)
{
return new SfxStyleSheetBase( rName, *this, eFam, mask );
@@ -696,7 +696,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r )
return new SfxStyleSheetBase( r );
}
-SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, USHORT mask, USHORT nPos)
+SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos)
{
OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" );
@@ -764,19 +764,19 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas
//////////////////////////////// Suchen ////////////////////////////////////
-USHORT SfxStyleSheetBasePool::Count()
+sal_uInt16 SfxStyleSheetBasePool::Count()
{
return GetIterator_Impl().Count();
}
-SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](USHORT nIdx)
+SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](sal_uInt16 nIdx)
{
return GetIterator_Impl()[nIdx];
}
SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const XubString& rName,
SfxStyleFamily eFam,
- USHORT mask)
+ sal_uInt16 mask)
{
SfxStyleSheetIterator aIter(this,eFam,mask);
return aIter.Find(rName);
@@ -867,9 +867,9 @@ void SfxStyleSheetBasePool::Clear()
void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld,
const XubString& rNew,
- BOOL bVirtual)
+ sal_Bool bVirtual)
{
- const USHORT nTmpMask = GetSearchMask();
+ const sal_uInt16 nTmpMask = GetSearchMask();
SetSearchMask(GetSearchFamily(), 0xffff);
for( SfxStyleSheetBase* p = First(); p; p = Next() )
{
@@ -886,7 +886,7 @@ void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld,
/////////////////////////// Laden/Speichern /////////////////////////////////
-void SfxStyleSheetBase::Load( SvStream&, USHORT )
+void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 )
{
}
@@ -895,7 +895,7 @@ void SfxStyleSheetBase::Store( SvStream& )
}
-BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
+sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream )
{
// alte Version?
if ( !rPool.IsVer2_Impl() )
@@ -910,7 +910,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
{
SfxSingleRecordReader aHeaderRec( &rStream, SFX_STYLES_REC_HEADER );
if ( !aHeaderRec.IsValid() )
- return FALSE;
+ return sal_False;
aAppName = rPool.GetName();
rStream >> nCharSet;
@@ -921,15 +921,15 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
{
SfxMultiRecordReader aStylesRec( &rStream, SFX_STYLES_REC_STYLES );
if ( !aStylesRec.IsValid() )
- return FALSE;
+ return sal_False;
rtl_TextEncoding eEnc = GetSOLoadTextEncoding(
(rtl_TextEncoding)nCharSet,
- sal::static_int_cast< USHORT >(rStream.GetVersion()) );
+ sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) );
rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet();
rStream.SetStreamCharSet( eEnc );
- USHORT nStyles;
+ sal_uInt16 nStyles;
for ( nStyles = 0; aStylesRec.GetContent(); nStyles++ )
{
// kann nicht mehr weiterlesen?
@@ -939,7 +939,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
// Globale Teile
XubString aName, aParent, aFollow;
String aHelpFile;
- USHORT nFamily, nStyleMask,nCount;
+ sal_uInt16 nFamily, nStyleMask,nCount;
sal_uInt32 nHelpId;
rStream.ReadByteString(aName, eEnc );
rStream.ReadByteString(aParent, eEnc );
@@ -953,7 +953,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
// Hier erst einmal Parent und Follow zwischenspeichern
rSheet.aParent = aParent;
rSheet.aFollow = aFollow;
- UINT32 nPos = rStream.Tell();
+ sal_uInt32 nPos = rStream.Tell();
rStream >> nCount;
if(nCount)
{
@@ -967,8 +967,8 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
//! rSet.Put( aTmpSet );
}
// Lokale Teile
- UINT32 nSize;
- USHORT nVer;
+ sal_uInt32 nSize;
+ sal_uInt16 nVer;
rStream >> nVer >> nSize;
nPos = rStream.Tell() + nSize;
rSheet.Load( rStream, nVer );
@@ -976,13 +976,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
}
// #72939# only loop through the styles that were really inserted
- ULONG n = aStyles.size();
+ sal_uLong n = aStyles.size();
//! delete pTmpPool;
// Jetzt Parent und Follow setzen. Alle Sheets sind geladen.
// Mit Setxxx() noch einmal den String eintragen, da diese
// virtuellen Methoden evtl. ueberlagert sind.
- for ( ULONG i = 0; i < n; i++ )
+ for ( sal_uLong i = 0; i < n; i++ )
{
SfxStyleSheetBase* p = aStyles[ i ].get();
XubString aText = p->aParent;
@@ -997,13 +997,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
}
// alles klar?
- return BOOL( rStream.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStream.GetError() == SVSTREAM_OK );
}
-BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
+sal_Bool SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
{
aAppName = rPool.GetName();
- USHORT nVersion;
+ sal_uInt16 nVersion;
short nCharSet;
rStream >> nVersion;
@@ -1014,13 +1014,13 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
rtl_TextEncoding eEnc = GetSOLoadTextEncoding(
(rtl_TextEncoding)nCharSet,
- sal::static_int_cast< USHORT >(rStream.GetVersion()) );
+ sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) );
rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet();
rStream.SetStreamCharSet( eEnc );
- USHORT nStyles;
+ sal_uInt16 nStyles;
rStream >> nStyles;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < nStyles; i++ )
{
// kann nicht mehr weiterlesen?
@@ -1033,7 +1033,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
// Globale Teile
XubString aName, aParent, aFollow;
String aHelpFile;
- USHORT nFamily, nStyleMask,nCount;
+ sal_uInt16 nFamily, nStyleMask,nCount;
sal_uInt32 nHelpId;
rStream.ReadByteString(aName, eEnc );
rStream.ReadByteString(aParent, eEnc );
@@ -1042,7 +1042,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
SfxPoolItem::readByteString(rStream, aHelpFile);
if(nVersion!=STYLESTREAM_VERSION)
{
- USHORT nTmpHelpId;
+ sal_uInt16 nTmpHelpId;
rStream >> nTmpHelpId;
nHelpId=nTmpHelpId;
}
@@ -1054,7 +1054,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
// Hier erst einmal Parent und Follow zwischenspeichern
rSheet.aParent = aParent;
rSheet.aFollow = aFollow;
- UINT32 nPos = rStream.Tell();
+ sal_uInt32 nPos = rStream.Tell();
rStream >> nCount;
if(nCount) {
rStream.Seek( nPos );
@@ -1067,8 +1067,8 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
//! rSet.Put( aTmpSet );
}
// Lokale Teile
- UINT32 nSize;
- USHORT nVer;
+ sal_uInt32 nSize;
+ sal_uInt16 nVer;
rStream >> nVer >> nSize;
nPos = rStream.Tell() + nSize;
rSheet.Load( rStream, nVer );
@@ -1092,16 +1092,16 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
rStream.SetStreamCharSet( eOldEnc );
- return BOOL( rStream.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStream.GetError() == SVSTREAM_OK );
}
-BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
+sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed )
{
// den ganzen StyleSheet-Pool in einen Mini-Record
SfxMiniRecordWriter aPoolRec( &rStream, SFX_STYLES_REC );
// Erst einmal die Dummies rauszaehlen; die werden nicht gespeichert
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
for( SfxStyleSheetBase* p = First(); p; p = Next() )
{
if(!bUsed || p->IsUsed())
@@ -1112,7 +1112,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
rtl_TextEncoding eEnc
= ::GetSOStoreTextEncoding(
rStream.GetStreamCharSet(),
- sal::static_int_cast< USHORT >(rStream.GetVersion()) );
+ sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) );
rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet();
rStream.SetStreamCharSet( eEnc );
@@ -1139,7 +1139,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
{
if(!bUsed || p->IsUsed())
{
- USHORT nFamily = (USHORT)p->GetFamily();
+ sal_uInt16 nFamily = (sal_uInt16)p->GetFamily();
String* pName = new String( p->GetName() );
ByteString* pConvName = new ByteString( *pName, eEnc );
@@ -1151,7 +1151,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
pConvName->SetChar(
1, sal::static_int_cast< char >(0xff & nFamily) );
- USHORT nInsPos, nAdd = aSortConvNames.Count();
+ sal_uInt16 nInsPos, nAdd = aSortConvNames.Count();
while( !aSortConvNames.Insert( pConvName, nInsPos ) )
(pConvName->Append( '_' )).Append(
ByteString::CreateFromInt32( nAdd++ ));
@@ -1162,9 +1162,9 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
// now we have the list of the names, sorted by convertede names
// But now we need the sorted list of orignames.
{
- USHORT nInsPos, nEnd = aOrigNames.Count();
+ sal_uInt16 nInsPos, nEnd = aOrigNames.Count();
const ByteStringPtr* ppB = aSortConvNames.GetData();
- for( USHORT n = 0; n < nEnd; ++n, ++ppB )
+ for( sal_uInt16 n = 0; n < nEnd; ++n, ++ppB )
{
String* p = aOrigNames.GetObject( n );
aSortOrigNames.Insert( p, nInsPos );
@@ -1176,7 +1176,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
ByteString sEmpty;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
String sNm;
SfxMultiVarRecordWriter aStylesRec( &rStream, SFX_STYLES_REC_STYLES, 0 );
for( SfxStyleSheetBase* p = First(); p; p = Next() )
@@ -1188,7 +1188,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
// Globale Teile speichern
String aHelpFile;
sal_uInt32 nHelpId = p->GetHelpId( aHelpFile );
- USHORT nFamily = sal::static_int_cast< USHORT >(p->GetFamily());
+ sal_uInt16 nFamily = sal::static_int_cast< sal_uInt16 >(p->GetFamily());
String sFamily( (sal_Unicode)nFamily );
(sNm = sFamily) += p->GetName();
@@ -1215,18 +1215,18 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
if(p->pSet)
p->pSet->Store( rStream );
else
- rStream << (USHORT)0;
+ rStream << (sal_uInt16)0;
// Lokale Teile speichern
// Vor dem lokalen Teil wird die Laenge der lokalen Daten
- // als UINT32 sowie die Versionsnummer gespeichert.
- rStream << (USHORT) p->GetVersion();
- ULONG nPos1 = rStream.Tell();
- rStream << (UINT32) 0;
+ // als sal_uInt32 sowie die Versionsnummer gespeichert.
+ rStream << (sal_uInt16) p->GetVersion();
+ sal_uLong nPos1 = rStream.Tell();
+ rStream << (sal_uInt32) 0;
p->Store( rStream );
- ULONG nPos2 = rStream.Tell();
+ sal_uLong nPos2 = rStream.Tell();
rStream.Seek( nPos1 );
- rStream << (UINT32) ( nPos2 - nPos1 - sizeof( UINT32 ) );
+ rStream << (sal_uInt32) ( nPos2 - nPos1 - sizeof( sal_uInt32 ) );
rStream.Seek( nPos2 );
if( rStream.GetError() != SVSTREAM_OK )
break;
@@ -1236,7 +1236,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
rStream.SetStreamCharSet( eOldEnc );
- return BOOL( rStream.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStream.GetError() == SVSTREAM_OK );
}
SfxItemPool& SfxStyleSheetBasePool::GetPool()
@@ -1254,7 +1254,7 @@ const SfxItemPool& SfxStyleSheetBasePool::GetPool() const
SfxStyleSheet::SfxStyleSheet(const XubString &rName,
const SfxStyleSheetBasePool& r_Pool,
SfxStyleFamily eFam,
- USHORT mask ):
+ sal_uInt16 mask ):
SfxStyleSheetBase(rName, const_cast< SfxStyleSheetBasePool& >( r_Pool ), eFam, mask)
{}
@@ -1274,10 +1274,10 @@ SfxStyleSheet::~SfxStyleSheet()
}
-BOOL SfxStyleSheet::SetParent( const XubString& rName )
+sal_Bool SfxStyleSheet::SetParent( const XubString& rName )
{
if(aParent == rName)
- return TRUE;
+ return sal_True;
const XubString aOldParent(aParent);
if(SfxStyleSheetBase::SetParent(rName)) {
// aus der Benachrichtigungskette des alten
@@ -1294,9 +1294,9 @@ BOOL SfxStyleSheet::SetParent( const XubString& rName )
if(pParent)
StartListening(*pParent);
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// alle Zuhoerer benachtichtigen
@@ -1316,7 +1316,7 @@ SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool const& rSet)
/////////////////////////////////// Factory ////////////////////////////////
SfxStyleSheetBase* SfxStyleSheetPool::Create( const XubString& rName,
- SfxStyleFamily eFam, USHORT mask )
+ SfxStyleFamily eFam, sal_uInt16 mask )
{
return new SfxStyleSheet( rName, *this, eFam, mask );
}
@@ -1326,9 +1326,9 @@ SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r )
return new SfxStyleSheet( r );
}
/*
-BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &)
+sal_Bool SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &)
{
- return FALSE;
+ return sal_False;
}
*/
@@ -1336,7 +1336,7 @@ BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &)
// class SfxUnoStyleSheet
// --------------------------------------------------------------------
-SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske )
+SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske )
: ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >( _rName, _rPool, _eFamily, _nMaske )
{
}
diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx
index af8ebe3db269..1873ffda3a3b 100644
--- a/svl/source/items/stylepool.cxx
+++ b/svl/source/items/stylepool.cxx
@@ -35,7 +35,7 @@
#include <vector>
#include <map>
-#include "stylepool.hxx"
+#include <svl/stylepool.hxx>
#include <svl/itemiter.hxx>
#include <svl/itempool.hxx>
@@ -380,13 +380,13 @@ public:
: maRoot(),
mnCount(0),
mpIgnorableItems( pIgnorableItems != 0
- ? pIgnorableItems->Clone( FALSE )
+ ? pIgnorableItems->Clone( sal_False )
: 0 )
{
DBG_ASSERT( !pIgnorableItems || !pIgnorableItems->Count(),
"<StylePoolImpl::StylePoolImpl(..)> - misusage: item set for ignorable item should be empty. Please correct usage." );
DBG_ASSERT( !mpIgnorableItems || !mpIgnorableItems->Count(),
- "<StylePoolImpl::StylePoolImpl(..)> - <SfxItemSet::Clone( FALSE )> does not work as excepted - <mpIgnorableItems> is not empty. Please inform OD." );
+ "<StylePoolImpl::StylePoolImpl(..)> - <SfxItemSet::Clone( sal_False )> does not work as excepted - <mpIgnorableItems> is not empty. Please inform OD." );
}
~StylePoolImpl()
diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx
index 6ed1a30941ae..4bb7238c9b76 100644
--- a/svl/source/items/szitem.cxx
+++ b/svl/source/items/szitem.cxx
@@ -55,7 +55,7 @@ SfxSizeItem::SfxSizeItem()
// -----------------------------------------------------------------------
-SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) :
+SfxSizeItem::SfxSizeItem( sal_uInt16 nW, const Size& rVal ) :
SfxPoolItem( nW ),
aVal( rVal )
{
@@ -64,7 +64,7 @@ SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) :
// -----------------------------------------------------------------------
-SfxSizeItem::SfxSizeItem( USHORT nW, SvStream &rStream ) :
+SfxSizeItem::SfxSizeItem( sal_uInt16 nW, SvStream &rStream ) :
SfxPoolItem( nW )
{
DBG_CTOR(SfxSizeItem, 0);
@@ -118,7 +118,7 @@ SfxPoolItem* SfxSizeItem::Clone(SfxItemPool *) const
// -----------------------------------------------------------------------
-SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, USHORT ) const
+SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxSizeItem, 0);
Size aStr;
@@ -128,7 +128,7 @@ SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
-SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT ) const
+SvStream& SfxSizeItem::Store(SvStream &rStream, sal_uInt16 ) const
{
DBG_CHKTHIS(SfxSizeItem, 0);
rStream << aVal;
@@ -137,7 +137,7 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT ) const
// -----------------------------------------------------------------------
bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal,
- BYTE nMemberId ) const
+ sal_uInt8 nMemberId ) const
{
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
@@ -168,7 +168,7 @@ bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal,
// -----------------------------------------------------------------------
bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal,
- BYTE nMemberId )
+ sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx
index 67df8fc78d63..13f19a48800e 100644
--- a/svl/source/items/visitem.cxx
+++ b/svl/source/items/visitem.cxx
@@ -44,7 +44,7 @@ DBG_NAME(SfxVisibilityItem)
TYPEINIT1_AUTOFACTORY(SfxVisibilityItem, SfxPoolItem);
//============================================================================
-SfxVisibilityItem::SfxVisibilityItem(USHORT which, SvStream & rStream):
+SfxVisibilityItem::SfxVisibilityItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
DBG_CTOR(SfxVisibilityItem, 0);
@@ -86,7 +86,7 @@ SfxItemPresentation SfxVisibilityItem::GetPresentation(SfxItemPresentation,
//============================================================================
// virtual
-bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
+bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const
{
rVal <<= m_nValue;
return true;
@@ -94,7 +94,7 @@ bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,BYTE) const
//============================================================================
// virtual
-bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
+bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8)
{
if (rVal >>= m_nValue)
return true;
@@ -105,7 +105,7 @@ bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,BYTE)
//============================================================================
// virtual
-SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, USHORT) const
+SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(SfxVisibilityItem, 0);
return new SfxVisibilityItem(Which(), rStream);
@@ -113,7 +113,7 @@ SfxPoolItem * SfxVisibilityItem::Create(SvStream & rStream, USHORT) const
//============================================================================
// virtual
-SvStream & SfxVisibilityItem::Store(SvStream & rStream, USHORT) const
+SvStream & SfxVisibilityItem::Store(SvStream & rStream, sal_uInt16) const
{
DBG_CHKTHIS(SfxVisibilityItem, 0);
rStream << m_nValue.bVisible;
@@ -130,19 +130,19 @@ SfxPoolItem * SfxVisibilityItem::Clone(SfxItemPool *) const
//============================================================================
// virtual
-USHORT SfxVisibilityItem::GetValueCount() const
+sal_uInt16 SfxVisibilityItem::GetValueCount() const
{
return 2;
}
//============================================================================
// virtual
-UniString SfxVisibilityItem::GetValueTextByVal(BOOL bTheValue) const
+UniString SfxVisibilityItem::GetValueTextByVal(sal_Bool bTheValue) const
{
return
bTheValue ?
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) :
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE"));
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) :
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx
index d5019a485915..0fa492b19443 100644
--- a/svl/source/items/whassert.hxx
+++ b/svl/source/items/whassert.hxx
@@ -43,7 +43,7 @@
ByteString aMsg( sMessage ); \
aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \
aMsg += ByteString::CreateFromInt32( nId ); \
- DbgOut( aMsg.GetBuffer(), DBG_OUT_ERROR, __FILE__, __LINE__); \
+ DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \
} \
} \
}
diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx
index ba8ddba9559e..b9fb9ca46330 100644
--- a/svl/source/items/whiter.cxx
+++ b/svl/source/items/whiter.cxx
@@ -29,14 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "whiter.hxx"
+#include <svl/whiter.hxx>
#include <svl/itemset.hxx>
DBG_NAME(SfxWhichIter)
// -----------------------------------------------------------------------
-SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, USHORT nFromWh, USHORT nToWh ):
+SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFromWh, sal_uInt16 nToWh ):
pRanges(rSet.GetRanges()),
pStart(rSet.GetRanges()),
nOfst(0), nFrom(nFromWh), nTo(nToWh)
@@ -55,19 +55,19 @@ SfxWhichIter::~SfxWhichIter()
// -----------------------------------------------------------------------
-USHORT SfxWhichIter::NextWhich()
+sal_uInt16 SfxWhichIter::NextWhich()
{
DBG_CHKTHIS(SfxWhichIter, 0);
while ( 0 != *pRanges )
{
- const USHORT nLastWhich = *pRanges + nOfst;
+ const sal_uInt16 nLastWhich = *pRanges + nOfst;
++nOfst;
if (*(pRanges+1) == nLastWhich)
{
pRanges += 2;
nOfst = 0;
}
- USHORT nWhich = *pRanges + nOfst;
+ sal_uInt16 nWhich = *pRanges + nOfst;
if ( 0 == nWhich || ( nWhich >= nFrom && nWhich <= nTo ) )
return nWhich;
}
@@ -76,7 +76,7 @@ USHORT SfxWhichIter::NextWhich()
// -----------------------------------------------------------------------
-USHORT SfxWhichIter::PrevWhich()
+sal_uInt16 SfxWhichIter::PrevWhich()
{
DBG_CHKTHIS(SfxWhichIter, 0);
while ( pRanges != pStart || 0 != nOfst )
@@ -87,7 +87,7 @@ USHORT SfxWhichIter::PrevWhich()
pRanges -= 2;
nOfst = *(pRanges+1) - (*pRanges);
}
- USHORT nWhich = *pRanges + nOfst;
+ sal_uInt16 nWhich = *pRanges + nOfst;
if ( nWhich >= nFrom && nWhich <= nTo )
return nWhich;
}
@@ -96,7 +96,7 @@ USHORT SfxWhichIter::PrevWhich()
// -----------------------------------------------------------------------
-USHORT SfxWhichIter::FirstWhich()
+sal_uInt16 SfxWhichIter::FirstWhich()
{
DBG_CHKTHIS(SfxWhichIter, 0);
pRanges = pStart;
@@ -108,13 +108,13 @@ USHORT SfxWhichIter::FirstWhich()
// -----------------------------------------------------------------------
-USHORT SfxWhichIter::LastWhich()
+sal_uInt16 SfxWhichIter::LastWhich()
{
DBG_CHKTHIS(SfxWhichIter, 0);
while(*pRanges)
++pRanges;
nOfst = 0;
- USHORT nWhich = *(pRanges-1);
+ sal_uInt16 nWhich = *(pRanges-1);
if ( nWhich >= nFrom && nWhich <= nTo )
return nWhich;
return PrevWhich();
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 7049920aa45c..6f3cc966995b 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -33,7 +33,7 @@
#define _SVSTDARR_ULONGS
#define _SVSTDARR_ULONGSSORT
-#define _SVSTDARR_USHORTS
+#define _SVSTDARR_sal_uInt16S
#define _SVSTDARR_LONGSSORT
#define _SVSTDARR_STRINGS
#define _SVSTDARR_STRINGSDTOR
@@ -41,7 +41,7 @@
#define _SVSTDARR_STRINGSSORTDTOR
#define _SVSTDARR_STRINGSISORT
#define _SVSTDARR_STRINGSISORTDTOR
-#define _SVSTDARR_USHORTSSORT
+#define _SVSTDARR_sal_uInt16SSORT
#define _SVSTDARR_BYTESTRINGS
#define _SVSTDARR_BYTESTRINGSDTOR
@@ -58,29 +58,18 @@
#include <tools/debug.hxx>
SV_IMPL_VARARR(SvPtrarr,VoidPtr)
-SV_IMPL_VARARR_PLAIN(SvPtrarrPlain,VoidPtr)
-USHORT SvPtrarr::GetPos( const VoidPtr& aElement ) const
-{ USHORT n;
+sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const
+{ sal_uInt16 n;
for( n=0; n < nA && *(GetData()+n) != aElement; ) n++;
return ( n >= nA ? USHRT_MAX : n );
}
-USHORT SvPtrarrPlain::GetPos( const VoidPtr aElement ) const
-{ USHORT n;
- for( n=0; n < nA && *(GetData()+n) != aElement; ) n++;
- return ( n >= nA ? USHRT_MAX : n );
-}
+SV_IMPL_VARARR( SvULongs, sal_uLong )
+SV_IMPL_VARARR( SvUShorts, sal_uInt16 )
-
-SV_IMPL_VARARR( SvULongs, ULONG )
-SV_IMPL_VARARR( SvUShorts, USHORT )
-
-SV_IMPL_VARARR_SORT( SvULongsSort, ULONG )
+SV_IMPL_VARARR_SORT( SvULongsSort, sal_uLong )
SV_IMPL_VARARR_SORT( SvLongsSort, long )
-SV_IMPL_VARARR_SORT( SvXub_StrLensSort, xub_StrLen )
-
-SV_IMPL_VARARR( SvXub_StrLens, xub_StrLen )
SV_IMPL_PTRARR( SvStrings, StringPtr )
SV_IMPL_PTRARR( SvStringsDtor, StringPtr )
@@ -98,19 +87,19 @@ SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr )
// Array mit anderer Seek-Methode!
_SV_IMPL_SORTAR_ALG( SvStringsISort, StringPtr )
-void SvStringsISort::DeleteAndDestroy( USHORT nP, USHORT nL )
+void SvStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
{
if( nL )
{
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( USHORT n=nP; n < nP + nL; n++ )
+ for( sal_uInt16 n=nP; n < nP + nL; n++ )
delete *((StringPtr*)pData+n);
SvPtrarr::Remove( nP, nL );
}
}
-BOOL SvStringsISort::Seek_Entry( const StringPtr aE, USHORT* pP ) const
+sal_Bool SvStringsISort::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) const
{
- register USHORT nO = SvStringsISort_SAR::Count(),
+ register sal_uInt16 nO = SvStringsISort_SAR::Count(),
nM,
nU = 0;
if( nO > 0 )
@@ -124,40 +113,40 @@ BOOL SvStringsISort::Seek_Entry( const StringPtr aE, USHORT* pP ) const
if( COMPARE_EQUAL == eCmp )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( COMPARE_LESS == eCmp )
nU = nM + 1;
else if( nM == 0 )
{
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
// ---------------- strings -------------------------------------
// Array mit anderer Seek-Methode!
_SV_IMPL_SORTAR_ALG( SvStringsISortDtor, StringPtr )
-void SvStringsISortDtor::DeleteAndDestroy( USHORT nP, USHORT nL )
+void SvStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
{
if( nL )
{
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( USHORT n=nP; n < nP + nL; n++ )
+ for( sal_uInt16 n=nP; n < nP + nL; n++ )
delete *((StringPtr*)pData+n);
SvPtrarr::Remove( nP, nL );
}
}
-BOOL SvStringsISortDtor::Seek_Entry( const StringPtr aE, USHORT* pP ) const
+sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) const
{
- register USHORT nO = SvStringsISortDtor_SAR::Count(),
+ register sal_uInt16 nO = SvStringsISortDtor_SAR::Count(),
nM,
nU = 0;
if( nO > 0 )
@@ -171,29 +160,29 @@ BOOL SvStringsISortDtor::Seek_Entry( const StringPtr aE, USHORT* pP ) const
if( COMPARE_EQUAL == eCmp )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( COMPARE_LESS == eCmp )
nU = nM + 1;
else if( nM == 0 )
{
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
// ---------------- Ushorts -------------------------------------
/* SortArray fuer UShorts */
-BOOL SvUShortsSort::Seek_Entry( const USHORT aE, USHORT* pP ) const
+sal_Bool SvUShortsSort::Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP ) const
{
- register USHORT nO = SvUShorts::Count(),
+ register sal_uInt16 nO = SvUShorts::Count(),
nM,
nU = 0;
if( nO > 0 )
@@ -205,29 +194,29 @@ BOOL SvUShortsSort::Seek_Entry( const USHORT aE, USHORT* pP ) const
if( *(pData + nM) == aE )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( *(pData + nM) < aE )
nU = nM + 1;
else if( nM == 0 )
{
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
-void SvUShortsSort::Insert( const SvUShortsSort * pI, USHORT nS, USHORT nE )
+void SvUShortsSort::Insert( const SvUShortsSort * pI, sal_uInt16 nS, sal_uInt16 nE )
{
if( USHRT_MAX == nE )
nE = pI->Count();
- USHORT nP;
- const USHORT * pIArr = pI->GetData();
+ sal_uInt16 nP;
+ const sal_uInt16 * pIArr = pI->GetData();
for( ; nS < nE; ++nS )
{
if( ! Seek_Entry( *(pIArr+nS), &nP) )
@@ -240,42 +229,42 @@ void SvUShortsSort::Insert( const SvUShortsSort * pI, USHORT nS, USHORT nE )
}
}
-BOOL SvUShortsSort::Insert( const USHORT aE )
+sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE )
{
- USHORT nP;
- BOOL bExist = Seek_Entry( aE, &nP );
+ sal_uInt16 nP;
+ sal_Bool bExist = Seek_Entry( aE, &nP );
if( !bExist )
SvUShorts::Insert( aE, nP );
return !bExist;
}
-BOOL SvUShortsSort::Insert( const USHORT aE, USHORT& rP )
+sal_Bool SvUShortsSort::Insert( const sal_uInt16 aE, sal_uInt16& rP )
{
- BOOL bExist = Seek_Entry( aE, &rP );
+ sal_Bool bExist = Seek_Entry( aE, &rP );
if( !bExist )
SvUShorts::Insert( aE, rP );
return !bExist;
}
-void SvUShortsSort::Insert( const USHORT* pE, USHORT nL)
+void SvUShortsSort::Insert( const sal_uInt16* pE, sal_uInt16 nL)
{
- USHORT nP;
- for( USHORT n = 0; n < nL; ++n )
+ sal_uInt16 nP;
+ for( sal_uInt16 n = 0; n < nL; ++n )
if( ! Seek_Entry( *(pE+n), &nP ))
SvUShorts::Insert( *(pE+n), nP );
}
// remove ab Pos
-void SvUShortsSort::RemoveAt( const USHORT nP, USHORT nL )
+void SvUShortsSort::RemoveAt( const sal_uInt16 nP, sal_uInt16 nL )
{
if( nL )
SvUShorts::Remove( nP, nL);
}
// remove ab dem Eintrag
-void SvUShortsSort::Remove( const USHORT aE, USHORT nL )
+void SvUShortsSort::Remove( const sal_uInt16 aE, sal_uInt16 nL )
{
- USHORT nP;
+ sal_uInt16 nP;
if( nL && Seek_Entry( aE, &nP ) )
SvUShorts::Remove( nP, nL);
}
@@ -284,19 +273,19 @@ void SvUShortsSort::Remove( const USHORT aE, USHORT nL )
// Array mit anderer Seek-Methode!
_SV_IMPL_SORTAR_ALG( SvByteStringsISort, ByteStringPtr )
-void SvByteStringsISort::DeleteAndDestroy( USHORT nP, USHORT nL )
+void SvByteStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
{
if( nL )
{
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( USHORT n=nP; n < nP + nL; n++ )
+ for( sal_uInt16 n=nP; n < nP + nL; n++ )
delete *((ByteStringPtr*)pData+n);
SvPtrarr::Remove( nP, nL );
}
}
-BOOL SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) const
+sal_Bool SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
{
- register USHORT nO = SvByteStringsISort_SAR::Count(),
+ register sal_uInt16 nO = SvByteStringsISort_SAR::Count(),
nM,
nU = 0;
if( nO > 0 )
@@ -310,39 +299,39 @@ BOOL SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) const
if( COMPARE_EQUAL == eCmp )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( COMPARE_LESS == eCmp )
nU = nM + 1;
else if( nM == 0 )
{
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
// Array mit anderer Seek-Methode!
_SV_IMPL_SORTAR_ALG( SvByteStringsISortDtor, ByteStringPtr )
-void SvByteStringsISortDtor::DeleteAndDestroy( USHORT nP, USHORT nL )
+void SvByteStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
{
if( nL )
{
DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( USHORT n=nP; n < nP + nL; n++ )
+ for( sal_uInt16 n=nP; n < nP + nL; n++ )
delete *((ByteStringPtr*)pData+n);
SvPtrarr::Remove( nP, nL );
}
}
-BOOL SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) const
+sal_Bool SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
{
- register USHORT nO = SvByteStringsISortDtor_SAR::Count(),
+ register sal_uInt16 nO = SvByteStringsISortDtor_SAR::Count(),
nM,
nU = 0;
if( nO > 0 )
@@ -356,21 +345,21 @@ BOOL SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) co
if( COMPARE_EQUAL == eCmp )
{
if( pP ) *pP = nM;
- return TRUE;
+ return sal_True;
}
else if( COMPARE_LESS == eCmp )
nU = nM + 1;
else if( nM == 0 )
{
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
else
nO = nM - 1;
}
}
if( pP ) *pP = nU;
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx
index b07cbcf19233..50649dc4d1c5 100644
--- a/svl/source/misc/PasswordHelper.cxx
+++ b/svl/source/misc/PasswordHelper.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "PasswordHelper.hxx"
+#include <svl/PasswordHelper.hxx>
#include <rtl/digest.h>
#include <tools/string.hxx>
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx
index 1c99aee9fc71..e0087aa5220d 100644
--- a/svl/source/misc/adrparse.cxx
+++ b/svl/source/misc/adrparse.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
#include <tools/inetmime.hxx>
-#include <adrparse.hxx>
+#include <svl/adrparse.hxx>
namespace unnamed_svl_adrparse {}
using namespace unnamed_svl_adrparse;
diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx
index 14e0c36bc0b5..06ddc663d762 100644
--- a/svl/source/misc/filenotation.cxx
+++ b/svl/source/misc/filenotation.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "filenotation.hxx"
+#include <svl/filenotation.hxx>
#include <osl/file.h>
#include <osl/diagnose.h>
#include <tools/urlobj.hxx>
diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx
index 687dd443330e..28ff69d61f24 100644
--- a/svl/source/misc/folderrestriction.cxx
+++ b/svl/source/misc/folderrestriction.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "folderrestriction.hxx"
+#include <svl/folderrestriction.hxx>
#include "osl/process.h"
#include "tools/urlobj.hxx"
#include "unotools/localfilehelper.hxx"
diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx
index 46d6eae274f7..15494cdedc85 100644
--- a/svl/source/misc/fstathelper.cxx
+++ b/svl/source/misc/fstathelper.cxx
@@ -33,8 +33,7 @@
#include <tools/string.hxx>
#include <ucbhelper/content.hxx>
#include <com/sun/star/util/DateTime.hpp>
-
-#include <fstathelper.hxx>
+#include <svl/fstathelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -44,7 +43,7 @@ using namespace ::rtl;
sal_Bool FStatHelper::GetModifiedDateTimeOfFile( const UniString& rURL,
Date* pDate, Time* pTime )
{
- sal_Bool bRet = FALSE;
+ sal_Bool bRet = sal_False;
try
{
::ucbhelper::Content aTestContent( rURL,
@@ -71,7 +70,7 @@ sal_Bool FStatHelper::GetModifiedDateTimeOfFile( const UniString& rURL,
sal_Bool FStatHelper::IsDocument( const UniString& rURL )
{
- BOOL bExist = FALSE;
+ sal_Bool bExist = sal_False;
try
{
::ucbhelper::Content aTestContent( rURL,
@@ -86,7 +85,7 @@ sal_Bool FStatHelper::IsDocument( const UniString& rURL )
sal_Bool FStatHelper::IsFolder( const UniString& rURL )
{
- BOOL bExist = FALSE;
+ sal_Bool bExist = sal_False;
try
{
::ucbhelper::Content aTestContent( rURL,
diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx
index 511873a6adb7..eba1e4083d38 100644
--- a/svl/source/misc/inethist.cxx
+++ b/svl/source/misc/inethist.cxx
@@ -72,9 +72,9 @@ class INetURLHistory_Impl
{
/** Representation.
*/
- UINT32 m_nMagic;
- UINT16 m_nNext;
- UINT16 m_nMBZ;
+ sal_uInt32 m_nMagic;
+ sal_uInt16 m_nNext;
+ sal_uInt16 m_nMBZ;
/** Initialization.
*/
@@ -92,13 +92,13 @@ class INetURLHistory_Impl
{
/** Representation.
*/
- UINT32 m_nHash;
- UINT16 m_nLru;
- UINT16 m_nMBZ;
+ sal_uInt32 m_nHash;
+ sal_uInt16 m_nLru;
+ sal_uInt16 m_nMBZ;
/** Initialization.
*/
- void initialize (UINT16 nLru, UINT32 nHash = 0)
+ void initialize (sal_uInt16 nLru, sal_uInt32 nHash = 0)
{
m_nHash = nHash;
m_nLru = nLru;
@@ -107,20 +107,20 @@ class INetURLHistory_Impl
/** Comparison.
*/
- BOOL operator== (const hash_entry &rOther) const
+ sal_Bool operator== (const hash_entry &rOther) const
{
return (m_nHash == rOther.m_nHash);
}
- BOOL operator< (const hash_entry &rOther) const
+ sal_Bool operator< (const hash_entry &rOther) const
{
return (m_nHash < rOther.m_nHash);
}
- BOOL operator== (UINT32 nHash) const
+ sal_Bool operator== (sal_uInt32 nHash) const
{
return (m_nHash == nHash);
}
- BOOL operator< (UINT32 nHash) const
+ sal_Bool operator< (sal_uInt32 nHash) const
{
return (m_nHash < nHash);
}
@@ -132,13 +132,13 @@ class INetURLHistory_Impl
{
/** Representation.
*/
- UINT32 m_nHash;
- UINT16 m_nNext;
- UINT16 m_nPrev;
+ sal_uInt32 m_nHash;
+ sal_uInt16 m_nNext;
+ sal_uInt16 m_nPrev;
/** Initialization.
*/
- void initialize (UINT16 nThis, UINT32 nHash = 0)
+ void initialize (sal_uInt16 nThis, sal_uInt32 nHash = 0)
{
m_nHash = nHash;
m_nNext = nThis;
@@ -156,34 +156,34 @@ class INetURLHistory_Impl
*/
void initialize (void);
- void downheap (hash_entry a[], UINT16 n, UINT16 k);
- void heapsort (hash_entry a[], UINT16 n);
+ void downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k);
+ void heapsort (hash_entry a[], sal_uInt16 n);
/** capacity.
*/
- UINT16 capacity (void) const
+ sal_uInt16 capacity (void) const
{
- return (UINT16)(INETHIST_SIZE_LIMIT);
+ return (sal_uInt16)(INETHIST_SIZE_LIMIT);
}
/** crc32.
*/
- UINT32 crc32 (UniString const & rData) const
+ sal_uInt32 crc32 (UniString const & rData) const
{
return rtl_crc32 (0, rData.GetBuffer(), rData.Len() * sizeof(sal_Unicode));
}
/** find.
*/
- UINT16 find (UINT32 nHash) const;
+ sal_uInt16 find (sal_uInt32 nHash) const;
/** move.
*/
- void move (UINT16 nSI, UINT16 nDI);
+ void move (sal_uInt16 nSI, sal_uInt16 nDI);
/** backlink.
*/
- void backlink (UINT16 nThis, UINT16 nTail)
+ void backlink (sal_uInt16 nThis, sal_uInt16 nTail)
{
register lru_entry &rThis = m_pList[nThis];
register lru_entry &rTail = m_pList[nTail];
@@ -196,7 +196,7 @@ class INetURLHistory_Impl
/** unlink.
*/
- void unlink (UINT16 nThis)
+ void unlink (sal_uInt16 nThis)
{
register lru_entry &rThis = m_pList[nThis];
@@ -218,7 +218,7 @@ public:
/** putUrl/queryUrl.
*/
void putUrl (const String &rUrl);
- BOOL queryUrl (const String &rUrl);
+ sal_Bool queryUrl (const String &rUrl);
};
/*========================================================================
@@ -248,7 +248,7 @@ void INetURLHistory_Impl::initialize (void)
{
m_aHead.initialize();
- USHORT i, n = capacity();
+ sal_uInt16 i, n = capacity();
for (i = 0; i < n; i++)
m_pHash[i].initialize(i);
for (i = 0; i < n; i++)
@@ -260,12 +260,12 @@ void INetURLHistory_Impl::initialize (void)
/*
* downheap.
*/
-void INetURLHistory_Impl::downheap (hash_entry a[], UINT16 n, UINT16 k)
+void INetURLHistory_Impl::downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k)
{
hash_entry h = a[k];
while (k < n / 2)
{
- UINT16 i = k + k + 1;
+ sal_uInt16 i = k + k + 1;
if (((i + 1) < n) && (a[i] < a[i + 1])) i++;
if (!(h < a[i])) break;
a[k] = a[i];
@@ -277,11 +277,11 @@ void INetURLHistory_Impl::downheap (hash_entry a[], UINT16 n, UINT16 k)
/*
* heapsort.
*/
-void INetURLHistory_Impl::heapsort (hash_entry a[], UINT16 n)
+void INetURLHistory_Impl::heapsort (hash_entry a[], sal_uInt16 n)
{
hash_entry h;
- for (UINT16 k = (n - 1) / 2 + 1; k > 0; k--)
+ for (sal_uInt16 k = (n - 1) / 2 + 1; k > 0; k--)
downheap (a, n, k - 1);
while (n > 0)
@@ -296,15 +296,15 @@ void INetURLHistory_Impl::heapsort (hash_entry a[], UINT16 n)
/*
* find.
*/
-UINT16 INetURLHistory_Impl::find (UINT32 nHash) const
+sal_uInt16 INetURLHistory_Impl::find (sal_uInt32 nHash) const
{
- UINT16 l = 0;
- UINT16 r = capacity() - 1;
- UINT16 c = capacity();
+ sal_uInt16 l = 0;
+ sal_uInt16 r = capacity() - 1;
+ sal_uInt16 c = capacity();
while ((l < r) && (r < c))
{
- UINT16 m = (l + r) / 2;
+ sal_uInt16 m = (l + r) / 2;
if (m_pHash[m] == nHash)
return m;
@@ -319,7 +319,7 @@ UINT16 INetURLHistory_Impl::find (UINT32 nHash) const
/*
* move.
*/
-void INetURLHistory_Impl::move (UINT16 nSI, UINT16 nDI)
+void INetURLHistory_Impl::move (sal_uInt16 nSI, sal_uInt16 nDI)
{
hash_entry e = m_pHash[nSI];
if (nSI < nDI)
@@ -346,12 +346,12 @@ void INetURLHistory_Impl::move (UINT16 nSI, UINT16 nDI)
*/
void INetURLHistory_Impl::putUrl (const String &rUrl)
{
- UINT32 h = crc32 (rUrl);
- UINT16 k = find (h);
+ sal_uInt32 h = crc32 (rUrl);
+ sal_uInt16 k = find (h);
if ((k < capacity()) && (m_pHash[k] == h))
{
// Cache hit.
- UINT16 nMRU = m_pHash[k].m_nLru;
+ sal_uInt16 nMRU = m_pHash[k].m_nLru;
if (nMRU != m_aHead.m_nNext)
{
// Update LRU chain.
@@ -365,9 +365,9 @@ void INetURLHistory_Impl::putUrl (const String &rUrl)
else
{
// Cache miss. Obtain least recently used.
- UINT16 nLRU = m_pList[m_aHead.m_nNext].m_nPrev;
+ sal_uInt16 nLRU = m_pList[m_aHead.m_nNext].m_nPrev;
- UINT16 nSI = find (m_pList[nLRU].m_nHash);
+ sal_uInt16 nSI = find (m_pList[nLRU].m_nHash);
if (!(nLRU == m_pHash[nSI].m_nLru))
{
// Update LRU chain.
@@ -380,7 +380,7 @@ void INetURLHistory_Impl::putUrl (const String &rUrl)
m_aHead.m_nNext = m_pList[m_aHead.m_nNext].m_nPrev;
// Check source and destination.
- UINT16 nDI = std::min (k, UINT16(capacity() - 1));
+ sal_uInt16 nDI = std::min (k, sal_uInt16(capacity() - 1));
if (nSI < nDI)
{
if (!(m_pHash[nDI] < h))
@@ -401,19 +401,19 @@ void INetURLHistory_Impl::putUrl (const String &rUrl)
/*
* queryUrl.
*/
-BOOL INetURLHistory_Impl::queryUrl (const String &rUrl)
+sal_Bool INetURLHistory_Impl::queryUrl (const String &rUrl)
{
- UINT32 h = crc32 (rUrl);
- UINT16 k = find (h);
+ sal_uInt32 h = crc32 (rUrl);
+ sal_uInt16 k = find (h);
if ((k < capacity()) && (m_pHash[k] == h))
{
// Cache hit.
- return TRUE;
+ return sal_True;
}
else
{
// Cache miss.
- return FALSE;
+ return sal_False;
}
}
@@ -527,7 +527,7 @@ void INetURLHistory::PutUrl_Impl (const INetURLObject &rUrl)
/*
* QueryUrl_Impl.
*/
-BOOL INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl)
+sal_Bool INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl)
{
DBG_ASSERT (m_pImpl, "QueryUrl_Impl(): no Implementation");
if (m_pImpl)
@@ -537,7 +537,7 @@ BOOL INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl)
return m_pImpl->queryUrl (aHistUrl.GetMainURL(INetURLObject::NO_DECODE));
}
- return FALSE;
+ return sal_False;
}
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 744a26a55eff..8bc44fdc2dd8 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -340,7 +340,7 @@ MediaTypeEntry const aStaticTypeNameMap[CONTENT_TYPE_LAST + 1]
//============================================================================
/** A mapping from type IDs to presentation resource IDs. Sorted by type ID.
*/
-USHORT const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1]
+sal_uInt16 const aStaticResourceIDMap[CONTENT_TYPE_LAST + 1]
= { STR_SVT_MIMETYPE_APP_OCTSTREAM, // CONTENT_TYPE_UNKNOWN
STR_SVT_MIMETYPE_APP_OCTSTREAM, // CONTENT_TYPE_APP_OCTSTREAM
STR_SVT_MIMETYPE_APP_PDF, // CONTENT_TYPE_APP_PDF
@@ -639,19 +639,19 @@ Registration * Registration::m_pRegistration = 0;
//============================================================================
Registration::~Registration()
{
- {for (ULONG i = 0; i < m_aTypeIDMap.Count(); ++i)
+ {for (sal_uLong i = 0; i < m_aTypeIDMap.Count(); ++i)
delete static_cast< TypeIDMapEntry * >(m_aTypeIDMap.GetObject(i));
}
m_aTypeIDMap.Clear();
- {for (USHORT i = 0; i < m_aTypeNameMap.Count(); ++i)
+ {for (sal_uInt16 i = 0; i < m_aTypeNameMap.Count(); ++i)
delete static_cast< TypeNameMapEntry * >(m_aTypeNameMap.GetObject(i));
}
- m_aTypeNameMap.Remove(USHORT(0), m_aTypeNameMap.Count());
- {for (USHORT i = 0; i < m_aExtensionMap.Count(); ++i)
+ m_aTypeNameMap.Remove(sal_uInt16(0), m_aTypeNameMap.Count());
+ {for (sal_uInt16 i = 0; i < m_aExtensionMap.Count(); ++i)
delete
static_cast< ExtensionMapEntry * >(m_aExtensionMap.GetObject(i));
}
- m_aExtensionMap.Remove(USHORT(0), m_aExtensionMap.Count());
+ m_aExtensionMap.Remove(sal_uInt16(0), m_aExtensionMap.Count());
}
//============================================================================
@@ -663,7 +663,7 @@ TypeNameMapEntry * Registration::getExtensionEntry(UniString const &
{
UniString aTheTypeName = rTypeName;
aTheTypeName.ToLowerAscii();
- USHORT nPos;
+ sal_uInt16 nPos;
if (m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos))
return static_cast< TypeNameMapEntry * >(m_pRegistration->
m_aTypeNameMap.
@@ -726,7 +726,7 @@ INetContentType Registration::GetContentType(UniString const & rTypeName)
UniString aTheTypeName = rTypeName;
aTheTypeName.ToLowerAscii();
- USHORT nPos;
+ sal_uInt16 nPos;
return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ?
static_cast< TypeNameMapEntry * >(m_pRegistration->
m_aTypeNameMap.
@@ -770,7 +770,7 @@ UniString Registration::GetExtension(UniString const & rTypeName)
UniString aTheTypeName = rTypeName;
aTheTypeName.ToLowerAscii();
- USHORT nPos;
+ sal_uInt16 nPos;
return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ?
static_cast< TypeNameMapEntry * >(m_pRegistration->
m_aTypeNameMap.
@@ -787,7 +787,7 @@ INetContentType Registration::GetContentType4Extension(UniString const &
if (!m_pRegistration)
m_pRegistration = new Registration;
- USHORT nPos;
+ sal_uInt16 nPos;
return m_pRegistration->
m_aExtensionMap.
Seek_Entry(const_cast< UniString * >(&rExtension),
@@ -949,7 +949,7 @@ UniString INetContentTypes::GetContentType(INetContentType eTypeID)
UniString INetContentTypes::GetPresentation(INetContentType eTypeID,
const ::com::sun::star::lang::Locale& aLocale)
{
- USHORT nResID = USHORT();
+ sal_uInt16 nResID = sal_uInt16();
if (eTypeID <= CONTENT_TYPE_LAST)
nResID = aStaticResourceIDMap[eTypeID];
else
diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx
index c655a8dd86a3..2eba00efd565 100644
--- a/svl/source/misc/lngmisc.cxx
+++ b/svl/source/misc/lngmisc.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include <lngmisc.hxx>
+#include <svl/lngmisc.hxx>
#include <tools/solar.h>
#include <tools/string.hxx>
#include <tools/debug.hxx>
@@ -43,11 +43,11 @@ namespace linguistic
///////////////////////////////////////////////////////////////////////////
-INT32 GetNumControlChars( const OUString &rTxt )
+sal_Int32 GetNumControlChars( const OUString &rTxt )
{
- INT32 nCnt = 0;
- INT32 nLen = rTxt.getLength();
- for (INT32 i = 0; i < nLen; ++i)
+ sal_Int32 nCnt = 0;
+ sal_Int32 nLen = rTxt.getLength();
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
if (IsControlChar( rTxt[i] ))
++nCnt;
@@ -56,33 +56,33 @@ INT32 GetNumControlChars( const OUString &rTxt )
}
-BOOL RemoveHyphens( OUString &rTxt )
+sal_Bool RemoveHyphens( OUString &rTxt )
{
- BOOL bModified = FALSE;
+ sal_Bool bModified = sal_False;
if (HasHyphens( rTxt ))
{
String aTmp( rTxt );
aTmp.EraseAllChars( SVT_SOFT_HYPHEN );
aTmp.EraseAllChars( SVT_HARD_HYPHEN );
rTxt = aTmp;
- bModified = TRUE;
+ bModified = sal_True;
}
return bModified;
}
-BOOL RemoveControlChars( OUString &rTxt )
+sal_Bool RemoveControlChars( OUString &rTxt )
{
- BOOL bModified = FALSE;
- INT32 nCtrlChars = GetNumControlChars( rTxt );
+ sal_Bool bModified = sal_False;
+ sal_Int32 nCtrlChars = GetNumControlChars( rTxt );
if (nCtrlChars)
{
- INT32 nLen = rTxt.getLength();
- INT32 nSize = nLen - nCtrlChars;
+ sal_Int32 nLen = rTxt.getLength();
+ sal_Int32 nSize = nLen - nCtrlChars;
OUStringBuffer aBuf( nSize );
aBuf.setLength( nSize );
- INT32 nCnt = 0;
- for (INT32 i = 0; i < nLen; ++i)
+ sal_Int32 nCnt = 0;
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
sal_Unicode cChar = rTxt[i];
if (!IsControlChar( cChar ))
@@ -93,7 +93,7 @@ BOOL RemoveControlChars( OUString &rTxt )
}
DBG_ASSERT( nCnt == nSize, "wrong size" );
rTxt = aBuf.makeStringAndClear();
- bModified = TRUE;
+ bModified = sal_True;
}
return bModified;
}
@@ -102,20 +102,20 @@ BOOL RemoveControlChars( OUString &rTxt )
// non breaking field character
#define CH_TXTATR_INWORD ((sal_Char) 0x02)
-BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ )
+sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ )
{
// the resulting string looks like this:
// 1. non breaking field characters get removed
// 2. remaining control characters will be replaced by ' '
- BOOL bModified = FALSE;
- INT32 nCtrlChars = GetNumControlChars( rTxt );
+ sal_Bool bModified = sal_False;
+ sal_Int32 nCtrlChars = GetNumControlChars( rTxt );
if (nCtrlChars)
{
- INT32 nLen = rTxt.getLength();
+ sal_Int32 nLen = rTxt.getLength();
OUStringBuffer aBuf( nLen );
- INT32 nCnt = 0;
- for (INT32 i = 0; i < nLen; ++i)
+ sal_Int32 nCnt = 0;
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
sal_Unicode cChar = rTxt[i];
if (CH_TXTATR_INWORD != cChar)
@@ -128,11 +128,43 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ )
}
aBuf.setLength( nCnt );
rTxt = aBuf.makeStringAndClear();
- bModified = TRUE;
+ bModified = sal_True;
}
return bModified;
}
+
+String GetThesaurusReplaceText( const String &rText )
+{
+ // The strings for synonyms returned by the thesaurus sometimes have some
+ // explanation text put in between '(' and ')' or a trailing '*'.
+ // These parts should not be put in the ReplaceEdit Text that may get
+ // inserted into the document. Thus we strip them from the text.
+
+ String aText( rText );
+
+ xub_StrLen nPos = aText.Search( sal_Unicode('(') );
+ while (STRING_NOTFOUND != nPos)
+ {
+ xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos );
+ if (STRING_NOTFOUND != nEnd)
+ aText.Erase( nPos, nEnd-nPos+1 );
+ else
+ break;
+ nPos = aText.Search( sal_Unicode('(') );
+ }
+
+ nPos = aText.Search( sal_Unicode('*') );
+ if (STRING_NOTFOUND != nPos)
+ aText.Erase( nPos );
+
+ // remove any possible remaining ' ' that may confuse the thesaurus
+ // when it gets called with the text
+ aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
+
+ return aText;
+}
+
///////////////////////////////////////////////////////////////////////////
} // namespace linguistic
diff --git a/svl/source/misc/makefile.mk b/svl/source/misc/makefile.mk
deleted file mode 100644
index a68cb396f22c..000000000000
--- a/svl/source/misc/makefile.mk
+++ /dev/null
@@ -1,70 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svl
-TARGET=misc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES=\
- $(SLO)$/documentlockfile.obj \
- $(SLO)$/folderrestriction.obj \
- $(SLO)$/fstathelper.obj \
- $(SLO)$/lockfilecommon.obj \
- $(SLO)$/ownlist.obj \
- $(SLO)$/restrictedpaths.obj \
- $(SLO)$/sharecontrolfile.obj \
- $(SLO)$/strmadpt.obj \
- $(SLO)$/svldata.obj \
- $(SLO)$/urihelper.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/adrparse.obj \
- $(SLO)$/filenotation.obj \
- $(SLO)$/inethist.obj \
- $(SLO)$/inettype.obj \
- $(SLO)$/lngmisc.obj \
- $(SLO)$/PasswordHelper.obj
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- mediatyp.src
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-
-
diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx
index 83663a17bc5e..c1edd6761839 100644
--- a/svl/source/misc/ownlist.cxx
+++ b/svl/source/misc/ownlist.cxx
@@ -42,14 +42,14 @@ using namespace com::sun::star;
PRV_SV_IMPL_OWNER_LIST(SvCommandList,SvCommand)
-static String parseString(const String & rCmd, USHORT * pIndex)
+static String parseString(const String & rCmd, sal_uInt16 * pIndex)
{
String result;
if(rCmd.GetChar( *pIndex ) == '\"') {
(*pIndex) ++;
- USHORT begin = *pIndex;
+ sal_uInt16 begin = *pIndex;
while(*pIndex < rCmd.Len() && rCmd.GetChar((*pIndex) ++) != '\"') ;
@@ -59,9 +59,9 @@ static String parseString(const String & rCmd, USHORT * pIndex)
return result;
}
-static String parseWord(const String & rCmd, USHORT * pIndex)
+static String parseWord(const String & rCmd, sal_uInt16 * pIndex)
{
- USHORT begin = *pIndex;
+ sal_uInt16 begin = *pIndex;
while(*pIndex < rCmd.Len() && !isspace(rCmd.GetChar(*pIndex)) && rCmd.GetChar(*pIndex) != '=')
(*pIndex) ++;
@@ -69,7 +69,7 @@ static String parseWord(const String & rCmd, USHORT * pIndex)
return String(rCmd.Copy(begin, *pIndex - begin));
}
-static void eatSpace(const String & rCmd, USHORT * pIndex)
+static void eatSpace(const String & rCmd, sal_uInt16 * pIndex)
{
while(*pIndex < rCmd.Len() && isspace(rCmd.GetChar(*pIndex)))
(*pIndex) ++;
@@ -77,10 +77,10 @@ static void eatSpace(const String & rCmd, USHORT * pIndex)
//=========================================================================
-BOOL SvCommandList::AppendCommands
+sal_Bool SvCommandList::AppendCommands
(
const String & rCmd, /* Dieser Text wird in Kommandos umgesetzt */
- USHORT * pEaten /* Anzahl der Zeichen, die gelesen wurden */
+ sal_uInt16 * pEaten /* Anzahl der Zeichen, die gelesen wurden */
)
/* [Beschreibung]
@@ -89,11 +89,11 @@ BOOL SvCommandList::AppendCommands
[R"uckgabewert]
- BOOL TRUE, der Text wurde korrekt geparsed.
- FALSE, der Text wurde nicht korrekt geparsed.
+ sal_Bool sal_True, der Text wurde korrekt geparsed.
+ sal_False, der Text wurde nicht korrekt geparsed.
*/
{
- USHORT index = 0;
+ sal_uInt16 index = 0;
while(index < rCmd.Len())
{
@@ -116,14 +116,14 @@ BOOL SvCommandList::AppendCommands
*pEaten = index;
-// USHORT nPos = 0;
+// sal_uInt16 nPos = 0;
// while( nPos < rCmd.Len() )
// {
// // ein Zeichen ? Dann faengt hier eine Option an
// if( isalpha( rCmd[nPos] ) )
// {
// String aValue;
-// USHORT nStt = nPos;
+// sal_uInt16 nStt = nPos;
// register char c;
// while( nPos < rCmd.Len() &&
@@ -149,7 +149,7 @@ BOOL SvCommandList::AppendCommands
// if( nPos != rCmd.Len() )
// {
-// USHORT nLen = 0;
+// sal_uInt16 nLen = 0;
// nStt = nPos;
// if( '"' == c )
// {
@@ -182,7 +182,7 @@ BOOL SvCommandList::AppendCommands
// nPos++;
// }
// *pEaten = nPos;
- return TRUE;
+ return sal_True;
}
//=========================================================================
@@ -199,7 +199,7 @@ String SvCommandList::GetCommands() const
*/
{
String aRet;
- for( ULONG i = 0; i < aTypes.Count(); i++ )
+ for( sal_uLong i = 0; i < aTypes.Count(); i++ )
{
if( i != 0 )
aRet += ' ';
@@ -253,7 +253,7 @@ SvStream & operator >>
SvStream & Der "ubergebene Stream.
*/
{
- UINT32 nCount = 0;
+ sal_uInt32 nCount = 0;
rStm >> nCount;
if( !rStm.GetError() )
{
@@ -284,10 +284,10 @@ SvStream & operator <<
SvStream & Der "ubergebene Stream.
*/
{
- UINT32 nCount = rThis.aTypes.Count();
+ sal_uInt32 nCount = rThis.aTypes.Count();
rStm << nCount;
- for( UINT32 i = 0; i < nCount; i++ )
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
SvCommand * pCmd = (SvCommand *)rThis.aTypes.GetObject( i );
rStm << *pCmd;
@@ -295,7 +295,7 @@ SvStream & operator <<
return rStm;
}
-BOOL SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
+sal_Bool SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
{
const sal_Int32 nCount = aCommandSequence.getLength();
String aCommand, aArg;
@@ -309,7 +309,7 @@ BOOL SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com:
Append( aCommand, aArg );
}
- return TRUE;
+ return sal_True;
}
void SvCommandList::FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index b0e434bc5d2e..d7905f470290 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -36,9 +36,9 @@
#include <set>
#include <rtl/alloc.h>
#include <rtl/memory.h>
-#include <instrm.hxx>
-#include <outstrm.hxx>
-#include <strmadpt.hxx>
+#include <svl/instrm.hxx>
+#include <svl/outstrm.hxx>
+#include <svl/strmadpt.hxx>
using namespace com::sun::star;
@@ -152,7 +152,7 @@ TYPEINIT1(SvOutputStreamOpenLockBytes, SvOpenLockBytes)
//============================================================================
// virtual
-ErrCode SvOutputStreamOpenLockBytes::ReadAt(ULONG, void *, ULONG, ULONG *)
+ErrCode SvOutputStreamOpenLockBytes::ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *)
const
{
return ERRCODE_IO_CANTREAD;
@@ -160,8 +160,8 @@ ErrCode SvOutputStreamOpenLockBytes::ReadAt(ULONG, void *, ULONG, ULONG *)
//============================================================================
// virtual
-ErrCode SvOutputStreamOpenLockBytes::WriteAt(ULONG nPos, void const * pBuffer,
- ULONG nCount, ULONG * pWritten)
+ErrCode SvOutputStreamOpenLockBytes::WriteAt(sal_uLong nPos, void const * pBuffer,
+ sal_uLong nCount, sal_uLong * pWritten)
{
if (nPos != m_nPosition)
return ERRCODE_IO_CANTWRITE;
@@ -187,7 +187,7 @@ ErrCode SvOutputStreamOpenLockBytes::Flush() const
//============================================================================
// virtual
-ErrCode SvOutputStreamOpenLockBytes::SetSize(ULONG)
+ErrCode SvOutputStreamOpenLockBytes::SetSize(sal_uLong)
{
return ERRCODE_IO_NOTSUPPORTED;
}
@@ -205,15 +205,15 @@ ErrCode SvOutputStreamOpenLockBytes::Stat(SvLockBytesStat * pStat,
//============================================================================
// virtual
ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer,
- ULONG nCount,
- ULONG * pWritten)
+ sal_uLong nCount,
+ sal_uLong * pWritten)
{
if (!m_xOutputStream.is())
return ERRCODE_IO_CANTWRITE;
if (nCount > 0
- && nCount > std::numeric_limits< ULONG >::max() - m_nPosition)
+ && nCount > std::numeric_limits< sal_uLong >::max() - m_nPosition)
{
- nCount = std::numeric_limits< ULONG >::max() - m_nPosition;
+ nCount = std::numeric_limits< sal_uLong >::max() - m_nPosition;
if (nCount == 0)
return ERRCODE_IO_CANTWRITE;
}
@@ -235,14 +235,14 @@ ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer,
//============================================================================
// virtual
-ULONG SvOutputStreamOpenLockBytes::Tell() const
+sal_uLong SvOutputStreamOpenLockBytes::Tell() const
{
return m_nPosition;
}
//============================================================================
// virtual
-ULONG SvOutputStreamOpenLockBytes::Seek(ULONG)
+sal_uLong SvOutputStreamOpenLockBytes::Seek(sal_uLong)
{
return m_nPosition;
}
@@ -476,7 +476,7 @@ bool SvInputStream::open()
//============================================================================
// virtual
-ULONG SvInputStream::GetData(void * pData, ULONG nSize)
+sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize)
{
if (!open())
{
@@ -503,8 +503,8 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize)
{
sal_Int32 nRemain
= sal_Int32(
- std::min(ULONG(nSize - nRead),
- ULONG(std::numeric_limits< sal_Int32 >::max())));
+ std::min(sal_uLong(nSize - nRead),
+ sal_uLong(std::numeric_limits< sal_Int32 >::max())));
if (nRemain == 0)
break;
uno::Sequence< sal_Int8 > aBuffer;
@@ -540,8 +540,8 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize)
sal_Int32 nRemain
= sal_Int32(
std::min(
- ULONG(nSize - nRead),
- ULONG(std::numeric_limits< sal_Int32 >::max())));
+ sal_uLong(nSize - nRead),
+ sal_uLong(std::numeric_limits< sal_Int32 >::max())));
if (nRemain == 0)
break;
uno::Sequence< sal_Int8 > aBuffer;
@@ -571,7 +571,7 @@ ULONG SvInputStream::GetData(void * pData, ULONG nSize)
//============================================================================
// virtual
-ULONG SvInputStream::PutData(void const *, ULONG)
+sal_uLong SvInputStream::PutData(void const *, sal_uLong)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
return 0;
@@ -584,7 +584,7 @@ void SvInputStream::FlushData()
//============================================================================
// virtual
-ULONG SvInputStream::SeekPos(ULONG nPos)
+sal_uLong SvInputStream::SeekPos(sal_uLong nPos)
{
if (open())
{
@@ -601,7 +601,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos)
< STREAM_SEEK_TO_END)
{
m_nSeekedFrom = Tell();
- return ULONG(nLength);
+ return sal_uLong(nLength);
}
}
catch (io::IOException) {}
@@ -636,7 +636,7 @@ ULONG SvInputStream::SeekPos(ULONG nPos)
//============================================================================
// virtual
-void SvInputStream::SetSize(ULONG)
+void SvInputStream::SetSize(sal_uLong)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
}
@@ -668,14 +668,14 @@ SvInputStream::~SvInputStream()
//============================================================================
// virtual
-USHORT SvInputStream::IsA() const
+sal_uInt16 SvInputStream::IsA() const
{
return 0;
}
//============================================================================
// virtual
-void SvInputStream::AddMark(ULONG nPos)
+void SvInputStream::AddMark(sal_uLong nPos)
{
if (open() && m_pPipe)
m_pPipe->addMark(nPos);
@@ -683,7 +683,7 @@ void SvInputStream::AddMark(ULONG nPos)
//============================================================================
// virtual
-void SvInputStream::RemoveMark(ULONG nPos)
+void SvInputStream::RemoveMark(sal_uLong nPos)
{
if (open() && m_pPipe)
m_pPipe->removeMark(nPos);
@@ -696,7 +696,7 @@ void SvInputStream::RemoveMark(ULONG nPos)
//============================================================================
// virtual
-ULONG SvOutputStream::GetData(void *, ULONG)
+sal_uLong SvOutputStream::GetData(void *, sal_uLong)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
return 0;
@@ -704,20 +704,20 @@ ULONG SvOutputStream::GetData(void *, ULONG)
//============================================================================
// virtual
-ULONG SvOutputStream::PutData(void const * pData, ULONG nSize)
+sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize)
{
if (!m_xStream.is())
{
SetError(ERRCODE_IO_CANTWRITE);
return 0;
}
- ULONG nWritten = 0;
+ sal_uLong nWritten = 0;
for (;;)
{
sal_Int32 nRemain
= sal_Int32(
- std::min(ULONG(nSize - nWritten),
- ULONG(std::numeric_limits< sal_Int32 >::max())));
+ std::min(sal_uLong(nSize - nWritten),
+ sal_uLong(std::numeric_limits< sal_Int32 >::max())));
if (nRemain == 0)
break;
try
@@ -739,7 +739,7 @@ ULONG SvOutputStream::PutData(void const * pData, ULONG nSize)
//============================================================================
// virtual
-ULONG SvOutputStream::SeekPos(ULONG)
+sal_uLong SvOutputStream::SeekPos(sal_uLong)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
return 0;
@@ -763,7 +763,7 @@ void SvOutputStream::FlushData()
//============================================================================
// virtual
-void SvOutputStream::SetSize(ULONG)
+void SvOutputStream::SetSize(sal_uLong)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
}
@@ -790,7 +790,7 @@ SvOutputStream::~SvOutputStream()
//============================================================================
// virtual
-USHORT SvOutputStream::IsA() const
+sal_uInt16 SvOutputStream::IsA() const
{
return 0;
}
diff --git a/svl/source/misc/svldata.cxx b/svl/source/misc/svldata.cxx
index eb36f0fc8f64..b76c1c002ce8 100644
--- a/svl/source/misc/svldata.cxx
+++ b/svl/source/misc/svldata.cxx
@@ -75,7 +75,7 @@ SimpleResMgr* ImpSvlData::GetSimpleRM(const ::com::sun::star::lang::Locale& rLoc
= (*static_cast< SimpleResMgrMap * >(m_pThreadsafeRMs))[aISOcode];
if (!rResMgr)
{
- rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svs), rLocale );
+ rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svl), rLocale );
}
return rResMgr;
}
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 4923eb1a64cb..ac70f8a6e467 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include <urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/lang/XMultiComponentFactory.hpp"
diff --git a/svl/source/notify/brdcst.cxx b/svl/source/notify/brdcst.cxx
index 12e22f97d262..7722814216a5 100644
--- a/svl/source/notify/brdcst.cxx
+++ b/svl/source/notify/brdcst.cxx
@@ -59,7 +59,7 @@ void SfxBroadcaster::Broadcast( const SfxHint &rHint )
if ( aListeners.Count() /*! || aGlobListeners.Count() */ )
{
// notify all registered listeners exactly once
- for ( USHORT n = 0; n < aListeners.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aListeners.Count(); ++n )
{
SfxListener* pListener = aListeners[n];
if ( pListener )
@@ -98,7 +98,7 @@ SfxBroadcaster::~SfxBroadcaster()
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
// remove all still registered listeners
- for ( USHORT nPos = 0; nPos < aListeners.Count(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < aListeners.Count(); ++nPos )
{
SfxListener *pListener = aListeners[nPos];
if ( pListener )
@@ -124,7 +124,7 @@ SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC )
{
DBG_CTOR(SfxBroadcaster, 0);
- for ( USHORT n = 0; n < rBC.aListeners.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < rBC.aListeners.Count(); ++n )
{
SfxListener *pListener = rBC.aListeners[n];
if ( pListener )
@@ -136,12 +136,12 @@ SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC )
// add a new SfxListener to the list
-BOOL SfxBroadcaster::AddListener( SfxListener& rListener )
+sal_Bool SfxBroadcaster::AddListener( SfxListener& rListener )
{
DBG_CHKTHIS(SfxBroadcaster, 0);
const SfxListener *pListener = &rListener;
const SfxListener *pNull = 0;
- USHORT nFreePos = aListeners.GetPos( pNull );
+ sal_uInt16 nFreePos = aListeners.GetPos( pNull );
if ( nFreePos < aListeners.Count() )
aListeners.GetData()[nFreePos] = pListener;
else if ( aListeners.Count() < (USHRT_MAX-1) )
@@ -149,12 +149,12 @@ BOOL SfxBroadcaster::AddListener( SfxListener& rListener )
else
{
OSL_FAIL( "array overflow" );
- return FALSE;
+ return sal_False;
}
DBG_ASSERT( USHRT_MAX != aListeners.GetPos(pListener),
"AddListener failed" );
- return TRUE;
+ return sal_True;
}
//--------------------------------------------------------------------
@@ -172,8 +172,8 @@ void SfxBroadcaster::ListenersGone()
void SfxBroadcaster::Forward(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- const USHORT nCount = aListeners.Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ const sal_uInt16 nCount = aListeners.Count();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SfxListener *pListener = aListeners[i];
if ( pListener )
@@ -189,7 +189,7 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener )
{
{DBG_CHKTHIS(SfxBroadcaster, 0);}
const SfxListener *pListener = &rListener;
- USHORT nPos = aListeners.GetPos(pListener);
+ sal_uInt16 nPos = aListeners.GetPos(pListener);
DBG_ASSERT( nPos != USHRT_MAX, "RemoveListener: Listener unknown" );
aListeners.GetData()[nPos] = 0;
if ( !HasListeners() )
@@ -198,12 +198,12 @@ void SfxBroadcaster::RemoveListener( SfxListener& rListener )
//--------------------------------------------------------------------
-BOOL SfxBroadcaster::HasListeners() const
+sal_Bool SfxBroadcaster::HasListeners() const
{
- for ( USHORT n = 0; n < aListeners.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < aListeners.Count(); ++n )
if ( aListeners.GetObject(n) != 0 )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
//--------------------------------------------------------------------
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 16220033dbf8..a11a0b87aa9c 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -31,9 +31,9 @@
#include <tools/debug.hxx>
-#include "listener.hxx"
-#include "listeneriter.hxx"
-#include "broadcast.hxx"
+#include <svl/listener.hxx>
+#include <svl/listeneriter.hxx>
+#include <svl/broadcast.hxx>
#include <svl/smplhint.hxx>
@@ -92,7 +92,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint )
if( HasListeners() /* && !IsModifyLocked()*/ )
{
// LockModify();
-// bInModify = TRUE;
+// bInModify = sal_True;
SvtListenerIter aIter( *this );
SvtListener* pLast = aIter.GoStart();
@@ -103,7 +103,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint )
break;
} while( 0 != ( pLast = aIter.GoNext() ));
-// bInModify = FALSE;
+// bInModify = sal_False;
// UnlockModify();
}
}
@@ -127,7 +127,7 @@ void SvtBroadcaster::Forward( SvtBroadcaster& rBC, const SfxHint& rHint )
if( rBC.HasListeners() /* && !IsModifyLocked()*/ )
{
// LockModify();
-// bInModify = TRUE;
+// bInModify = sal_True;
SvtListenerIter aIter( rBC );
SvtListener* pLast = aIter.GoStart();
@@ -138,7 +138,7 @@ void SvtBroadcaster::Forward( SvtBroadcaster& rBC, const SfxHint& rHint )
break;
} while( 0 != ( pLast = aIter.GoNext() ));
-// bInModify = FALSE;
+// bInModify = sal_False;
// UnlockModify();
}
}
diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx
index 70a4b2d23cd5..20fbc2993fbb 100644
--- a/svl/source/notify/listener.cxx
+++ b/svl/source/notify/listener.cxx
@@ -30,11 +30,10 @@
#include "precompiled_svl.hxx"
#include <tools/debug.hxx>
-
-#include "broadcast.hxx"
-#include "listener.hxx"
+#include <svl/broadcast.hxx>
+#include <svl/listener.hxx>
#include "listenerbase.hxx"
-#include "listeneriter.hxx"
+#include <svl/listeneriter.hxx>
//====================================================================
@@ -74,7 +73,7 @@ SvtListener::~SvtListener()
// registeres at a specific SvtBroadcaster
-BOOL SvtListener::StartListening( SvtBroadcaster& rBroadcaster )
+sal_Bool SvtListener::StartListening( SvtBroadcaster& rBroadcaster )
{
const SvtListenerBase* pLst = pBrdCastLst;
while( pLst )
@@ -82,19 +81,19 @@ BOOL SvtListener::StartListening( SvtBroadcaster& rBroadcaster )
if( &rBroadcaster == pLst->GetBroadcaster() )
{
// double, than return
- return FALSE;
+ return sal_False;
}
pLst = pLst->GetNext();
}
new SvtListenerBase( *this, rBroadcaster );
- return TRUE;
+ return sal_True;
}
//--------------------------------------------------------------------
// unregisteres at a specific SvtBroadcaster
-BOOL SvtListener::EndListening( SvtBroadcaster& rBroadcaster )
+sal_Bool SvtListener::EndListening( SvtBroadcaster& rBroadcaster )
{
SvtListenerBase *pLst = pBrdCastLst, *pPrev = pLst;
while( pLst )
@@ -107,12 +106,12 @@ BOOL SvtListener::EndListening( SvtBroadcaster& rBroadcaster )
pPrev->SetNext( pLst->GetNext() );
delete pLst;
- return TRUE;
+ return sal_True;
}
pPrev = pLst;
pLst = pLst->GetNext();
}
- return FALSE;
+ return sal_False;
}
//--------------------------------------------------------------------
@@ -134,7 +133,7 @@ void SvtListener::EndListeningAll()
//--------------------------------------------------------------------
-BOOL SvtListener::IsListening( SvtBroadcaster& rBroadcaster ) const
+sal_Bool SvtListener::IsListening( SvtBroadcaster& rBroadcaster ) const
{
const SvtListenerBase *pLst = pBrdCastLst;
while( pLst )
diff --git a/svl/source/notify/listenerbase.cxx b/svl/source/notify/listenerbase.cxx
index ffc2b1819ea6..505d7f6e75c4 100644
--- a/svl/source/notify/listenerbase.cxx
+++ b/svl/source/notify/listenerbase.cxx
@@ -30,11 +30,10 @@
#include "precompiled_svl.hxx"
#include <tools/debug.hxx>
-
#include "listenerbase.hxx"
-#include "listeneriter.hxx"
-#include "listener.hxx"
-#include "broadcast.hxx"
+#include <svl/listeneriter.hxx>
+#include <svl/listener.hxx>
+#include <svl/broadcast.hxx>
SvtListenerBase::SvtListenerBase( SvtListener& rLst,
diff --git a/svl/source/notify/listeneriter.cxx b/svl/source/notify/listeneriter.cxx
index 46646f441fe6..9b3e16d8c120 100644
--- a/svl/source/notify/listeneriter.cxx
+++ b/svl/source/notify/listeneriter.cxx
@@ -31,9 +31,9 @@
#include <tools/debug.hxx>
#include "listenerbase.hxx"
-#include "listeneriter.hxx"
-#include "broadcast.hxx"
-#include "listener.hxx"
+#include <svl/listeneriter.hxx>
+#include <svl/broadcast.hxx>
+#include <svl/listener.hxx>
SvtListenerIter* SvtListenerIter::pListenerIters = 0;
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index 498862e67638..2bdcb8852d15 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -58,7 +58,7 @@ SfxListener::SfxListener( const SfxListener &rListener )
{
DBG_CTOR(SfxListener, 0);
- for ( USHORT n = 0; n < rListener.aBCs.Count(); ++n )
+ for ( sal_uInt16 n = 0; n < rListener.aBCs.Count(); ++n )
StartListening( *rListener.aBCs[n] );
}
//--------------------------------------------------------------------
@@ -70,7 +70,7 @@ SfxListener::~SfxListener()
DBG_DTOR(SfxListener, 0);
// unregister at all remainding broadcasters
- for ( USHORT nPos = 0; nPos < aBCs.Count(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < aBCs.Count(); ++nPos )
{
SfxBroadcaster *pBC = aBCs[nPos];
pBC->RemoveListener(*this);
@@ -93,7 +93,7 @@ void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBC )
// registeres at a specific SfxBroadcaster
-BOOL SfxListener::StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups )
+sal_Bool SfxListener::StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups )
{
DBG_CHKTHIS(SfxListener, 0);
@@ -105,23 +105,23 @@ BOOL SfxListener::StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDup
aBCs.Insert( pBC, aBCs.Count() );
DBG_ASSERT( IsListening(rBroadcaster), "StartListening failed" );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
//--------------------------------------------------------------------
// unregisteres at a specific SfxBroadcaster
-BOOL SfxListener::EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups )
+sal_Bool SfxListener::EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups )
{
DBG_CHKTHIS(SfxListener, 0);
if ( !IsListening( rBroadcaster ) )
- return FALSE;
+ return sal_False;
do
{
@@ -130,14 +130,14 @@ BOOL SfxListener::EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups )
aBCs.Remove( aBCs.GetPos(pBC), 1 );
}
while ( bAllDups && IsListening( rBroadcaster ) );
- return TRUE;
+ return sal_True;
}
//--------------------------------------------------------------------
// unregisteres at a specific SfxBroadcaster by index
-void SfxListener::EndListening( USHORT nNo )
+void SfxListener::EndListening( sal_uInt16 nNo )
{
DBG_CHKTHIS(SfxListener, 0);
@@ -165,7 +165,7 @@ void SfxListener::EndListeningAll()
//--------------------------------------------------------------------
-BOOL SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const
+sal_Bool SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const
{
const SfxBroadcaster *pBC = &rBroadcaster;
return USHRT_MAX != aBCs.GetPos( pBC );
diff --git a/svl/source/notify/makefile.mk b/svl/source/notify/makefile.mk
deleted file mode 100644
index c2e6648907e5..000000000000
--- a/svl/source/notify/makefile.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=notify
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/smplhint.obj \
- $(SLO)$/hint.obj \
- $(SLO)$/lstner.obj \
- $(SLO)$/isethint.obj \
- $(SLO)$/brdcst.obj \
- $(SLO)$/listener.obj \
- $(SLO)$/listenerbase.obj \
- $(SLO)$/listeneriter.obj \
- $(SLO)$/broadcast.obj
-
-HXX1TARGET= notify
-HXX1EXT= hxx
-HXX1FILES= $(INC)$/hint.hxx \
- $(INC)$/smplhint.hxx \
- $(INC)$/lstner.hxx \
- $(INC)$/brdcst.hxx
-HXX1EXCL= -E:*include*
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/notify/smplhint.cxx b/svl/source/notify/smplhint.cxx
index 784bfb1df170..7aef9a7042bf 100644
--- a/svl/source/notify/smplhint.cxx
+++ b/svl/source/notify/smplhint.cxx
@@ -38,7 +38,7 @@ TYPEINIT1(SfxSimpleHint, SfxHint);
//====================================================================
// creates a SimpleHint with the type nId
-SfxSimpleHint::SfxSimpleHint( ULONG nIdP )
+SfxSimpleHint::SfxSimpleHint( sal_uLong nIdP )
{
nId = nIdP;
}
diff --git a/svl/source/numbers/makefile.mk b/svl/source/numbers/makefile.mk
deleted file mode 100644
index c38faa63b6a5..000000000000
--- a/svl/source/numbers/makefile.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=numbers
-LIBTARGET=NO
-
-PROJECTPCH=
-PROJECTPCHSOURCE=
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES= \
- $(SLO)$/numuno.obj \
- $(SLO)$/numfmuno.obj \
- $(SLO)$/supservs.obj \
- $(SLO)$/zforlist.obj \
- $(SLO)$/zforfind.obj \
- $(SLO)$/zformat.obj \
- $(SLO)$/zforscan.obj
-
-SLOFILES = \
- $(EXCEPTIONSFILES) \
- $(SLO)$/numhead.obj
-
-LIB1TARGET= $(SLB)$/$(TARGET).uno.lib
-LIB1OBJFILES= \
- $(SLO)$/numfmuno.obj \
- $(SLO)$/supservs.obj
-
-LIB2TARGET= $(SLB)$/$(TARGET).lib
-LIB2OBJFILES= \
- $(SLO)$/zforfind.obj \
- $(SLO)$/zforlist.obj \
- $(SLO)$/zformat.obj \
- $(SLO)$/zforscan.obj \
- $(SLO)$/numuno.obj \
- $(SLO)$/numhead.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx
deleted file mode 100644
index 285ae8dda567..000000000000
--- a/svl/source/numbers/nbdll.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index fa7d47267ba7..35f58e4ebee5 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include "numfmuno.hxx"
-#include "numuno.hxx"
+#include <svl/numuno.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/itemprop.hxx>
@@ -182,7 +182,7 @@ sal_Int32 SAL_CALL SvNumberFormatterServiceObj::detectNumberFormat(
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL;
if (pFormatter)
{
@@ -248,7 +248,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForNumber( sal_Int32
{
::osl::MutexGuard aGuard( m_aMutex );
- util::Color nRet = aDefaultColor; // color = INT32
+ util::Color nRet = aDefaultColor; // color = sal_Int32
SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL;
if (pFormatter)
{
@@ -290,7 +290,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForString( sal_Int32
{
::osl::MutexGuard aGuard( m_aMutex );
- util::Color nRet = aDefaultColor; // color = INT32
+ util::Color nRet = aDefaultColor; // color = sal_Int32
SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL;
if (pFormatter)
{
@@ -341,7 +341,7 @@ rtl::OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToPreviewString
LanguageType eLang = lcl_GetLanguage( nLocale );
Color* pColor = NULL;
- BOOL bOk;
+ sal_Bool bOk;
if ( bAllowEnglish )
bOk = pFormatter->GetPreviewStringGuess(
aFormString, fValue, aOutString, &pColor, eLang );
@@ -368,7 +368,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber(
{
::osl::MutexGuard aGuard( m_aMutex );
- util::Color nRet = aDefaultColor; // color = INT32
+ util::Color nRet = aDefaultColor; // color = sal_Int32
SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL;
if (pFormatter)
{
@@ -377,7 +377,7 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber(
LanguageType eLang = lcl_GetLanguage( nLocale );
Color* pColor = NULL;
- BOOL bOk;
+ sal_Bool bOk;
if ( bAllowEnglish )
bOk = pFormatter->GetPreviewStringGuess(
aFormString, fValue, aOutString, &pColor, eLang );
@@ -484,7 +484,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::queryKey( const rtl::OUString& aFormat,
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -508,7 +508,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat,
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -517,7 +517,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat,
sal_uInt32 nKey = 0;
xub_StrLen nCheckPos = 0;
short nType = 0;
- BOOL bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang );
+ sal_Bool bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang );
if (bOk)
nRet = nKey;
else if (nCheckPos)
@@ -539,7 +539,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFo
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -549,7 +549,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFo
sal_uInt32 nKey = 0;
xub_StrLen nCheckPos = 0;
short nType = 0;
- BOOL bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang );
+ sal_Bool bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang );
if (bOk || nKey > 0)
nRet = nKey;
else if (nCheckPos)
@@ -604,7 +604,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardIndex( const lang::Locale& nLo
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -622,7 +622,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardFormat( sal_Int16 nType, const
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -643,7 +643,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatIndex( sal_Int16 nIndex, const l
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -661,7 +661,7 @@ sal_Bool SAL_CALL SvNumberFormatsObj::isTypeCompatible( sal_Int16 nOldType, sal_
{
::osl::MutexGuard aGuard( m_aMutex );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
bRet = pFormatter->IsCompatible( nOldType, nNewType );
@@ -676,7 +676,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const
{
::osl::MutexGuard aGuard( m_aMutex );
- INT32 nRet = 0;
+ sal_Int32 nRet = 0;
SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter();
if (pFormatter)
{
@@ -714,7 +714,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNam
//------------------------------------------------------------------------
-SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex )
+SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex )
:rSupplier( rParent )
,nKey( nK )
,m_aMutex( _rMutex )
@@ -758,8 +758,8 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro
const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL;
if (pFormat)
{
- BOOL bThousand, bRed;
- USHORT nDecimals, nLeading;
+ sal_Bool bThousand, bRed;
+ sal_uInt16 nDecimals, nLeading;
String aString = aPropertyName;
if (aString.EqualsAscii( PROPERTYNAME_FMTSTR ))
@@ -783,12 +783,12 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro
else if (aString.EqualsAscii( PROPERTYNAME_STDFORM ))
{
//! SvNumberformat Member bStandard rausreichen?
- BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
+ sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
aRet.setValue( &bStandard, getBooleanCppuType() );
}
else if (aString.EqualsAscii( PROPERTYNAME_USERDEF ))
{
- BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
+ sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
aRet.setValue( &bUserDef, getBooleanCppuType() );
}
else if (aString.EqualsAscii( PROPERTYNAME_DECIMALS ))
@@ -826,7 +826,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro
else if (aString.EqualsAscii( PROPERTYNAME_CURRABB ))
{
String aSymbol, aExt;
- BOOL bBank = FALSE;
+ sal_Bool bBank = sal_False;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank,
aSymbol, aExt, pFormat->GetLanguage() );
@@ -888,7 +888,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue
if (pFormat)
{
String aSymbol, aExt, aAbb;
- BOOL bBank = FALSE;
+ sal_Bool bBank = sal_False;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank,
aSymbol, aExt, pFormat->GetLanguage() );
@@ -897,11 +897,11 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue
String aFmtStr = pFormat->GetFormatstring();
String aComment = pFormat->GetComment();
- BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
+ sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
//! SvNumberformat Member bStandard rausreichen?
- BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
- BOOL bThousand, bRed;
- USHORT nDecimals, nLeading;
+ sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
+ sal_Bool bThousand, bRed;
+ sal_uInt16 nDecimals, nLeading;
pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading );
lang::Locale aLocale( MsLangId::convertLanguageToLocale(
pFormat->GetLanguage()));
@@ -1056,7 +1056,7 @@ uno::Any SAL_CALL SvNumberFormatSettingsObj::getPropertyValue( const rtl::OUStri
String aString = aPropertyName;
if (aString.EqualsAscii( PROPERTYNAME_NOZERO ))
{
- BOOL bNoZero = pFormatter->GetNoZero();
+ sal_Bool bNoZero = pFormatter->GetNoZero();
aRet.setValue( &bNoZero, getBooleanCppuType() );
}
else if (aString.EqualsAscii( PROPERTYNAME_NULLDATE ))
diff --git a/svl/source/numbers/numfmuno.hxx b/svl/source/numbers/numfmuno.hxx
index 4e793be42adc..1fdc30b4601c 100644
--- a/svl/source/numbers/numfmuno.hxx
+++ b/svl/source/numbers/numfmuno.hxx
@@ -184,11 +184,11 @@ class SvNumberFormatObj : public cppu::WeakImplHelper3<
{
private:
SvNumberFormatsSupplierObj& rSupplier;
- ULONG nKey;
+ sal_uLong nKey;
mutable ::comphelper::SharedMutex m_aMutex;
public:
- SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, ULONG nK, const ::comphelper::SharedMutex& _rMutex );
+ SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex );
virtual ~SvNumberFormatObj();
// XPropertySet
diff --git a/svl/source/numbers/numhead.cxx b/svl/source/numbers/numhead.cxx
index d2274f8d5051..dcb16ef94f77 100644
--- a/svl/source/numbers/numhead.cxx
+++ b/svl/source/numbers/numhead.cxx
@@ -46,7 +46,7 @@
SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) :
rStream( rNewStream )
{
- ULONG nDataSize;
+ sal_uLong nDataSize;
rStream >> nDataSize;
nDataEnd = rStream.Tell() + nDataSize;
}
@@ -55,7 +55,7 @@ SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) :
SvNumReadHeader::~SvNumReadHeader()
{
- ULONG nReadEnd = rStream.Tell();
+ sal_uLong nReadEnd = rStream.Tell();
DBG_ASSERT( nReadEnd <= nDataEnd, "zuviele Bytes gelesen" );
if ( nReadEnd != nDataEnd )
rStream.Seek(nDataEnd); // Rest ueberspringen
@@ -63,9 +63,9 @@ SvNumReadHeader::~SvNumReadHeader()
//#pragma SEG_FUNCDEF(numhead_03)
-ULONG SvNumReadHeader::BytesLeft() const
+sal_uLong SvNumReadHeader::BytesLeft() const
{
- ULONG nReadEnd = rStream.Tell();
+ sal_uLong nReadEnd = rStream.Tell();
if (nReadEnd <= nDataEnd)
return nDataEnd-nReadEnd;
@@ -77,7 +77,7 @@ ULONG SvNumReadHeader::BytesLeft() const
//#pragma SEG_FUNCDEF(numhead_04)
-SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) :
+SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, sal_uLong nDefault) :
rStream( rNewStream )
{
nDataSize = nDefault;
@@ -89,7 +89,7 @@ SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) :
SvNumWriteHeader::~SvNumWriteHeader()
{
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
if ( nPos - nDataPos != nDataSize ) // Default getroffen?
{
@@ -111,11 +111,11 @@ ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) :
{
sal_uInt32 nDataSize;
rStream >> nDataSize;
- ULONG nDataPos = rStream.Tell();
+ sal_uLong nDataPos = rStream.Tell();
nEntryEnd = nDataPos;
rStream.SeekRel(nDataSize);
- USHORT nID;
+ sal_uInt16 nID;
rStream >> nID;
if (nID != SV_NUMID_SIZES)
{
@@ -150,7 +150,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream )
sal_uInt32 nDataSize;
rStream >> nDataSize;
rStream.SeekRel( nDataSize );
- USHORT nID;
+ sal_uInt16 nID;
rStream >> nID;
if ( nID != SV_NUMID_SIZES )
{
@@ -165,7 +165,7 @@ void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream )
void ImpSvNumMultipleReadHeader::EndEntry()
{
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" );
if ( nPos != nEntryEnd )
rStream.Seek( nEntryEnd ); // Rest ueberspringen
@@ -175,7 +175,7 @@ void ImpSvNumMultipleReadHeader::EndEntry()
void ImpSvNumMultipleReadHeader::StartEntry()
{
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
sal_uInt32 nEntrySize;
(*pMemStream) >> nEntrySize;
@@ -184,9 +184,9 @@ void ImpSvNumMultipleReadHeader::StartEntry()
//#pragma SEG_FUNCDEF(numhead_09)
-ULONG ImpSvNumMultipleReadHeader::BytesLeft() const
+sal_uLong ImpSvNumMultipleReadHeader::BytesLeft() const
{
- ULONG nReadEnd = rStream.Tell();
+ sal_uLong nReadEnd = rStream.Tell();
if (nReadEnd <= nEntryEnd)
return nEntryEnd-nReadEnd;
@@ -199,7 +199,7 @@ ULONG ImpSvNumMultipleReadHeader::BytesLeft() const
//#pragma SEG_FUNCDEF(numhead_0a)
ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream,
- ULONG nDefault) :
+ sal_uLong nDefault) :
rStream( rNewStream ),
aMemStream( 4096, 4096 )
{
@@ -214,16 +214,16 @@ ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream,
ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader()
{
- ULONG nDataEnd = rStream.Tell();
+ sal_uLong nDataEnd = rStream.Tell();
- rStream << (USHORT) SV_NUMID_SIZES;
+ rStream << (sal_uInt16) SV_NUMID_SIZES;
rStream << static_cast<sal_uInt32>(aMemStream.Tell());
rStream.Write( aMemStream.GetData(), aMemStream.Tell() );
if ( nDataEnd - nDataPos != nDataSize ) // Default getroffen?
{
nDataSize = nDataEnd - nDataPos;
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
rStream.Seek(nDataPos-sizeof(sal_uInt32));
rStream << nDataSize; // Groesse am Anfang eintragen
rStream.Seek(nPos);
@@ -234,7 +234,7 @@ ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader()
void ImpSvNumMultipleWriteHeader::EndEntry()
{
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
aMemStream << static_cast<sal_uInt32>(nPos - nEntryStart);
}
@@ -242,7 +242,7 @@ void ImpSvNumMultipleWriteHeader::EndEntry()
void ImpSvNumMultipleWriteHeader::StartEntry()
{
- ULONG nPos = rStream.Tell();
+ sal_uLong nPos = rStream.Tell();
nEntryStart = nPos;
}
diff --git a/svl/source/numbers/numhead.hxx b/svl/source/numbers/numhead.hxx
index c43f1a92f337..8ccd91489a4c 100644
--- a/svl/source/numbers/numhead.hxx
+++ b/svl/source/numbers/numhead.hxx
@@ -40,24 +40,24 @@ class SvNumReadHeader
{
private:
SvStream& rStream;
- ULONG nDataEnd;
+ sal_uLong nDataEnd;
public:
SvNumReadHeader(SvStream& rNewStream);
~SvNumReadHeader();
- ULONG BytesLeft() const;
+ sal_uLong BytesLeft() const;
};
class SvNumWriteHeader
{
private:
SvStream& rStream;
- ULONG nDataPos;
- ULONG nDataSize;
+ sal_uLong nDataPos;
+ sal_uLong nDataSize;
public:
- SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault = 0);
+ SvNumWriteHeader(SvStream& rNewStream, sal_uLong nDefault = 0);
~SvNumWriteHeader();
};
@@ -71,8 +71,8 @@ private:
SvStream& rStream;
char* pBuf;
SvMemoryStream* pMemStream;
- ULONG nEndPos;
- ULONG nEntryEnd;
+ sal_uLong nEndPos;
+ sal_uLong nEntryEnd;
public:
ImpSvNumMultipleReadHeader(SvStream& rNewStream);
@@ -80,7 +80,7 @@ public:
void StartEntry();
void EndEntry();
- ULONG BytesLeft() const;
+ sal_uLong BytesLeft() const;
static void Skip( SvStream& ); // komplett ueberspringen
};
@@ -90,12 +90,12 @@ class ImpSvNumMultipleWriteHeader
private:
SvStream& rStream;
SvMemoryStream aMemStream;
- ULONG nDataPos;
+ sal_uLong nDataPos;
sal_uInt32 nDataSize;
- ULONG nEntryStart;
+ sal_uLong nEntryStart;
public:
- ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ULONG nDefault = 0);
+ ImpSvNumMultipleWriteHeader(SvStream& rNewStream, sal_uLong nDefault = 0);
~ImpSvNumMultipleWriteHeader();
void StartEntry();
diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx
index da0ec77ed7cc..8ef8615997e9 100644
--- a/svl/source/numbers/numuno.cxx
+++ b/svl/source/numbers/numuno.cxx
@@ -37,7 +37,7 @@
#include <osl/mutex.hxx>
#include <rtl/uuid.h>
-#include "numuno.hxx"
+#include <svl/numuno.hxx>
#include "numfmuno.hxx"
#include <svl/zforlist.hxx>
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index e3236c309bf4..1b5883553b32 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -35,8 +35,8 @@
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
#include <tools/stream.hxx>
-#include <strmadpt.hxx>
-#include "instrm.hxx"
+#include <svl/strmadpt.hxx>
+#include <svl/instrm.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
diff --git a/svl/source/numbers/supservs.hxx b/svl/source/numbers/supservs.hxx
index 0b115630c832..1402f11d993e 100644
--- a/svl/source/numbers/supservs.hxx
+++ b/svl/source/numbers/supservs.hxx
@@ -29,7 +29,7 @@
#ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
#define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
-#include "numuno.hxx"
+#include <svl/numuno.hxx>
#include <svl/zforlist.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 12c92538d2be..d18ea9de19e9 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -62,11 +62,11 @@
#endif
-const BYTE ImpSvNumberInputScan::nMatchedEndString = 0x01;
-const BYTE ImpSvNumberInputScan::nMatchedMidString = 0x02;
-const BYTE ImpSvNumberInputScan::nMatchedStartString = 0x04;
-const BYTE ImpSvNumberInputScan::nMatchedVirgin = 0x08;
-const BYTE ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10;
+const sal_uInt8 ImpSvNumberInputScan::nMatchedEndString = 0x01;
+const sal_uInt8 ImpSvNumberInputScan::nMatchedMidString = 0x02;
+const sal_uInt8 ImpSvNumberInputScan::nMatchedStartString = 0x04;
+const sal_uInt8 ImpSvNumberInputScan::nMatchedVirgin = 0x08;
+const sal_uInt8 ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10;
/* It is not clear how we want timezones to be handled. Convert them to local
* time isn't wanted, as it isn't done in any other place and timezone
@@ -141,7 +141,7 @@ void ImpSvNumberInputScan::Reset()
//---------------------------------------------------------------------------
//
// static
-inline BOOL ImpSvNumberInputScan::MyIsdigit( sal_Unicode c )
+inline sal_Bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c )
{
return c < 128 && isdigit( (unsigned char) c );
}
@@ -170,19 +170,19 @@ void ImpSvNumberInputScan::TransformInput( String& rStr )
// Only simple unsigned floating point values without any error detection,
// decimal separator has to be '.'
-double ImpSvNumberInputScan::StringToDouble( const String& rStr, BOOL bForceFraction )
+double ImpSvNumberInputScan::StringToDouble( const String& rStr, sal_Bool bForceFraction )
{
double fNum = 0.0;
double fFrac = 0.0;
int nExp = 0;
xub_StrLen nPos = 0;
xub_StrLen nLen = rStr.Len();
- BOOL bPreSep = !bForceFraction;
+ sal_Bool bPreSep = !bForceFraction;
while (nPos < nLen)
{
if (rStr.GetChar(nPos) == '.')
- bPreSep = FALSE;
+ bPreSep = sal_False;
else if (bPreSep)
fNum = fNum * 10.0 + (double) (rStr.GetChar(nPos) - '0');
else
@@ -226,11 +226,11 @@ enum ScanState // States der Turing-Maschine
SsGetString = 3
};
-BOOL ImpSvNumberInputScan::NextNumberStringSymbol(
+sal_Bool ImpSvNumberInputScan::NextNumberStringSymbol(
const sal_Unicode*& pStr,
String& rSymbol )
{
- BOOL isNumber = FALSE;
+ sal_Bool isNumber = sal_False;
sal_Unicode cToken;
ScanState eState = SsStart;
register const sal_Unicode* pHere = pStr;
@@ -245,7 +245,7 @@ BOOL ImpSvNumberInputScan::NextNumberStringSymbol(
if ( MyIsdigit( cToken ) )
{
eState = SsGetValue;
- isNumber = TRUE;
+ isNumber = sal_True;
}
else
eState = SsGetString;
@@ -291,11 +291,11 @@ BOOL ImpSvNumberInputScan::NextNumberStringSymbol(
// FIXME: should be grouping; it is only used though in case nAnzStrings is
// near SV_MAX_ANZ_INPUT_STRINGS, in NumberStringDivision().
-BOOL ImpSvNumberInputScan::SkipThousands(
+sal_Bool ImpSvNumberInputScan::SkipThousands(
const sal_Unicode*& pStr,
String& rSymbol )
{
- BOOL res = FALSE;
+ sal_Bool res = sal_False;
sal_Unicode cToken;
const String& rThSep = pFormatter->GetNumThousandSep();
register const sal_Unicode* pHere = pStr;
@@ -328,7 +328,7 @@ BOOL ImpSvNumberInputScan::SkipThousands(
if (nCounter == 3)
{
eState = SsStart;
- res = TRUE; // .000 combination found
+ res = sal_True; // .000 combination found
}
}
else
@@ -365,7 +365,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString )
{
if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) )
{ // Zahl
- IsNum[nAnzStrings] = TRUE;
+ IsNum[nAnzStrings] = sal_True;
nNums[nAnzNums] = nAnzStrings;
nAnzNums++;
if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 &&
@@ -375,7 +375,7 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString )
}
else
{
- IsNum[nAnzStrings] = FALSE;
+ IsNum[nAnzStrings] = sal_False;
}
nAnzStrings++;
}
@@ -385,34 +385,34 @@ void ImpSvNumberInputScan::NumberStringDivision( const String& rString )
//---------------------------------------------------------------------------
// Whether rString contains rWhat at nPos
-BOOL ImpSvNumberInputScan::StringContainsImpl( const String& rWhat,
+sal_Bool ImpSvNumberInputScan::StringContainsImpl( const String& rWhat,
const String& rString, xub_StrLen nPos )
{
if ( nPos + rWhat.Len() <= rString.Len() )
return StringPtrContainsImpl( rWhat, rString.GetBuffer(), nPos );
- return FALSE;
+ return sal_False;
}
//---------------------------------------------------------------------------
// Whether pString contains rWhat at nPos
-BOOL ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat,
+sal_Bool ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat,
const sal_Unicode* pString, xub_StrLen nPos )
{
if ( rWhat.Len() == 0 )
- return FALSE;
+ return sal_False;
register const sal_Unicode* pWhat = rWhat.GetBuffer();
register const sal_Unicode* const pEnd = pWhat + rWhat.Len();
register const sal_Unicode* pStr = pString + nPos;
while ( pWhat < pEnd )
{
if ( *pWhat != *pStr )
- return FALSE;
+ return sal_False;
pWhat++;
pStr++;
}
- return TRUE;
+ return sal_True;
}
@@ -421,15 +421,15 @@ BOOL ImpSvNumberInputScan::StringPtrContainsImpl( const String& rWhat,
//
// ueberspringt genau das angegebene Zeichen
-inline BOOL ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString,
+inline sal_Bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const String& rString,
xub_StrLen& nPos )
{
if ((nPos < rString.Len()) && (rString.GetChar(nPos) == c))
{
nPos++;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -458,15 +458,15 @@ inline void ImpSvNumberInputScan::SkipBlanks( const String& rString,
//
// jump over rWhat in rString at nPos
-inline BOOL ImpSvNumberInputScan::SkipString( const String& rWhat,
+inline sal_Bool ImpSvNumberInputScan::SkipString( const String& rWhat,
const String& rString, xub_StrLen& nPos )
{
if ( StringContains( rWhat, rString, nPos ) )
{
nPos = nPos + rWhat.Len();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -475,10 +475,10 @@ inline BOOL ImpSvNumberInputScan::SkipString( const String& rWhat,
//
// recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping
-inline BOOL ImpSvNumberInputScan::GetThousandSep(
+inline sal_Bool ImpSvNumberInputScan::GetThousandSep(
const String& rString,
xub_StrLen& nPos,
- USHORT nStringPos )
+ sal_uInt16 nStringPos )
{
const String& rSep = pFormatter->GetNumThousandSep();
// Is it an ordinary space instead of a non-breaking space?
@@ -487,7 +487,7 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep(
if (!( (rString == rSep || bSpaceBreak) // nothing else
&& nStringPos < nAnzStrings - 1 // safety first!
&& IsNum[nStringPos+1] )) // number follows
- return FALSE; // no? => out
+ return sal_False; // no? => out
utl::DigitGroupingIterator aGrouping(
pFormatter->GetLocaleData()->getDigitGrouping());
@@ -504,9 +504,9 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep(
)
{
nPos = nPos + rSep.Len();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -514,8 +514,8 @@ inline BOOL ImpSvNumberInputScan::GetThousandSep(
// GetLogical
//
// Conversion of text to logial value
-// "TRUE" => 1:
-// "FALSE"=> -1:
+// "sal_True" => 1:
+// "sal_False"=> -1:
// else => 0:
short ImpSvNumberInputScan::GetLogical( const String& rString )
@@ -622,10 +622,10 @@ int ImpSvNumberInputScan::GetDayOfWeek( const String& rString, xub_StrLen& nPos
// GetCurrency
//
// Lesen eines Waehrungssysmbols
-// '$' => TRUE
-// sonst => FALSE
+// '$' => sal_True
+// sonst => sal_False
-BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
+sal_Bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
const SvNumberformat* pFormat )
{
if ( rString.Len() > nPos )
@@ -640,7 +640,7 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
if ( StringContains( aUpperCurrSymbol, rString, nPos ) )
{
nPos = nPos + aUpperCurrSymbol.Len();
- return TRUE;
+ return sal_True;
}
if ( pFormat )
{
@@ -653,14 +653,14 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
if ( StringContains( aSymbol, rString, nPos ) )
{
nPos = nPos + aSymbol.Len();
- return TRUE;
+ return sal_True;
}
}
}
}
}
- return FALSE;
+ return sal_False;
}
@@ -670,15 +670,15 @@ BOOL ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
// Lesen des Zeitsymbols (AM od. PM) f. kurze Zeitangabe
//
// Rueckgabe:
-// "AM" od. "PM" => TRUE
-// sonst => FALSE
+// "AM" od. "PM" => sal_True
+// sonst => sal_False
//
// nAmPos:
// "AM" => 1
// "PM" => -1
// sonst => 0
-BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos )
+sal_Bool ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos )
{
if ( rString.Len() > nPos )
@@ -689,17 +689,17 @@ BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos
{
nAmPm = 1;
nPos = nPos + pLoc->getTimeAM().Len();
- return TRUE;
+ return sal_True;
}
else if ( StringContains( pChr->upper( pLoc->getTimePM() ), rString, nPos ) )
{
nAmPm = -1;
nPos = nPos + pLoc->getTimePM().Len();
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
@@ -707,10 +707,10 @@ BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos
// GetDecSep
//
// Lesen eines Dezimaltrenners (',')
-// ',' => TRUE
-// sonst => FALSE
+// ',' => sal_True
+// sonst => sal_False
-inline BOOL ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos )
+inline sal_Bool ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen& nPos )
{
if ( rString.Len() > nPos )
{
@@ -718,17 +718,17 @@ inline BOOL ImpSvNumberInputScan::GetDecSep( const String& rString, xub_StrLen&
if ( rString.Equals( rSep, nPos, rSep.Len() ) )
{
nPos = nPos + rSep.Len();
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
//---------------------------------------------------------------------------
// read a hundredth seconds separator
-inline BOOL ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos )
+inline sal_Bool ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_StrLen& nPos )
{
if ( rString.Len() > nPos )
{
@@ -736,10 +736,10 @@ inline BOOL ImpSvNumberInputScan::GetTime100SecSep( const String& rString, xub_S
if ( rString.Equals( rSep, nPos, rSep.Len() ) )
{
nPos = nPos + rSep.Len();
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
@@ -807,15 +807,15 @@ short ImpSvNumberInputScan::GetESign( const String& rString, xub_StrLen& nPos )
// i counts string portions, j counts numbers thereof.
// It should had been called SkipNumber instead.
-inline BOOL ImpSvNumberInputScan::GetNextNumber( USHORT& i, USHORT& j )
+inline sal_Bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j )
{
if ( i < nAnzStrings && IsNum[i] )
{
j++;
i++;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -824,19 +824,19 @@ inline BOOL ImpSvNumberInputScan::GetNextNumber( USHORT& i, USHORT& j )
void ImpSvNumberInputScan::GetTimeRef(
double& fOutNumber,
- USHORT nIndex, // j-value of the first numeric time part of input, default 0
- USHORT nAnz ) // count of numeric time parts
+ sal_uInt16 nIndex, // j-value of the first numeric time part of input, default 0
+ sal_uInt16 nAnz ) // count of numeric time parts
{
- USHORT nHour;
- USHORT nMinute = 0;
- USHORT nSecond = 0;
+ sal_uInt16 nHour;
+ sal_uInt16 nMinute = 0;
+ sal_uInt16 nSecond = 0;
double fSecond100 = 0.0;
- USHORT nStartIndex = nIndex;
+ sal_uInt16 nStartIndex = nIndex;
if (nTimezonePos)
{
// find first timezone number index and adjust count
- for (USHORT j=0; j<nAnzNums; ++j)
+ for (sal_uInt16 j=0; j<nAnzNums; ++j)
{
if (nNums[j] == nTimezonePos)
{
@@ -851,7 +851,7 @@ void ImpSvNumberInputScan::GetTimeRef(
if (nDecPos == 2 && (nAnz == 3 || nAnz == 2)) // 20:45.5 or 45.5
nHour = 0;
else if (nIndex - nStartIndex < nAnz)
- nHour = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ nHour = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32();
else
{
nHour = 0;
@@ -860,11 +860,11 @@ void ImpSvNumberInputScan::GetTimeRef(
if (nDecPos == 2 && nAnz == 2) // 45.5
nMinute = 0;
else if (nIndex - nStartIndex < nAnz)
- nMinute = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ nMinute = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32();
if (nIndex - nStartIndex < nAnz)
- nSecond = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ nSecond = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32();
if (nIndex - nStartIndex < nAnz)
- fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], TRUE );
+ fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], sal_True );
if (nAmPm == -1 && nHour != 12) // PM
nHour += 12;
else if (nAmPm == 1 && nHour == 12) // 12 AM
@@ -880,13 +880,13 @@ void ImpSvNumberInputScan::GetTimeRef(
//---------------------------------------------------------------------------
// ImplGetDay
-USHORT ImpSvNumberInputScan::ImplGetDay( USHORT nIndex )
+sal_uInt16 ImpSvNumberInputScan::ImplGetDay( sal_uInt16 nIndex )
{
- USHORT nRes = 0;
+ sal_uInt16 nRes = 0;
if (sStrArray[nNums[nIndex]].Len() <= 2)
{
- USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ sal_uInt16 nNum = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32();
if (nNum <= 31)
nRes = nNum;
}
@@ -898,14 +898,14 @@ USHORT ImpSvNumberInputScan::ImplGetDay( USHORT nIndex )
//---------------------------------------------------------------------------
// ImplGetMonth
-USHORT ImpSvNumberInputScan::ImplGetMonth( USHORT nIndex )
+sal_uInt16 ImpSvNumberInputScan::ImplGetMonth( sal_uInt16 nIndex )
{
// preset invalid month number
- USHORT nRes = pFormatter->GetCalendar()->getNumberOfMonthsInYear();
+ sal_uInt16 nRes = pFormatter->GetCalendar()->getNumberOfMonthsInYear();
if (sStrArray[nNums[nIndex]].Len() <= 2)
{
- USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ sal_uInt16 nNum = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32();
if ( 0 < nNum && nNum <= nRes )
nRes = nNum - 1; // zero based for CalendarFieldIndex::MONTH
}
@@ -919,13 +919,13 @@ USHORT ImpSvNumberInputScan::ImplGetMonth( USHORT nIndex )
//
// 30 -> 1930, 29 -> 2029, oder 56 -> 1756, 55 -> 1855, ...
-USHORT ImpSvNumberInputScan::ImplGetYear( USHORT nIndex )
+sal_uInt16 ImpSvNumberInputScan::ImplGetYear( sal_uInt16 nIndex )
{
- USHORT nYear = 0;
+ sal_uInt16 nYear = 0;
if (sStrArray[nNums[nIndex]].Len() <= 4)
{
- nYear = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ nYear = (sal_uInt16) sStrArray[nNums[nIndex]].ToInt32();
nYear = SvNumberFormatter::ExpandTwoDigitYear( nYear, nYear2000 );
}
@@ -950,7 +950,7 @@ bool ImpSvNumberInputScan::MayBeIso8601()
//---------------------------------------------------------------------------
// GetDateRef
-BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter,
+sal_Bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter,
const SvNumberformat* pFormat )
{
using namespace ::com::sun::star::i18n;
@@ -977,7 +977,7 @@ BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter,
eEDF = NF_EVALDATEFORMAT_INTL;
nFormatOrder = 1;
}
- BOOL res = TRUE;
+ sal_Bool res = sal_True;
const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData();
CalendarWrapper* pCal = pFormatter->GetCalendar();
@@ -986,45 +986,45 @@ BOOL ImpSvNumberInputScan::GetDateRef( double& fDays, USHORT& nCounter,
pCal->setGregorianDateTime( Date() ); // today
String aOrgCalendar; // empty => not changed yet
DateFormat DateFmt;
- BOOL bFormatTurn;
+ sal_Bool bFormatTurn;
switch ( eEDF )
{
case NF_EVALDATEFORMAT_INTL :
- bFormatTurn = FALSE;
+ bFormatTurn = sal_False;
DateFmt = pLoc->getDateFormat();
break;
case NF_EVALDATEFORMAT_FORMAT :
- bFormatTurn = TRUE;
+ bFormatTurn = sal_True;
DateFmt = pFormat->GetDateOrder();
break;
case NF_EVALDATEFORMAT_INTL_FORMAT :
if ( nTryOrder == 1 )
{
- bFormatTurn = FALSE;
+ bFormatTurn = sal_False;
DateFmt = pLoc->getDateFormat();
}
else
{
- bFormatTurn = TRUE;
+ bFormatTurn = sal_True;
DateFmt = pFormat->GetDateOrder();
}
break;
case NF_EVALDATEFORMAT_FORMAT_INTL :
if ( nTryOrder == 2 )
{
- bFormatTurn = FALSE;
+ bFormatTurn = sal_False;
DateFmt = pLoc->getDateFormat();
}
else
{
- bFormatTurn = TRUE;
+ bFormatTurn = sal_True;
DateFmt = pFormat->GetDateOrder();
}
break;
default:
OSL_FAIL( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" );
DateFmt = YMD;
- bFormatTurn = FALSE;
+ bFormatTurn = sal_False;
}
if ( bFormatTurn )
{
@@ -1063,7 +1063,7 @@ input for the following reasons:
#endif
}
- res = TRUE;
+ res = sal_True;
nCounter = 0;
// For incomplete dates, always assume first day of month if not specified.
pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, 1 );
@@ -1074,7 +1074,7 @@ input for the following reasons:
if (nMonthPos) // only month (Jan)
pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 );
else
- res = FALSE;
+ res = sal_False;
break;
case 1: // only one number
@@ -1090,8 +1090,8 @@ input for the following reasons:
{
case MDY:
case YMD: {
- USHORT nDay = ImplGetDay(0);
- USHORT nYear = ImplGetYear(0);
+ sal_uInt16 nDay = ImplGetDay(0);
+ sal_uInt16 nYear = ImplGetYear(0);
if (nDay == 0 || nDay > 32) {
pCal->setValue( CalendarFieldIndex::YEAR, nYear);
}
@@ -1103,7 +1103,7 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
break;
@@ -1118,12 +1118,12 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
break;
default:
- res = FALSE;
+ res = sal_False;
break;
} // switch (nMonthPos)
break;
@@ -1210,7 +1210,7 @@ input for the following reasons:
}
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
}
@@ -1249,12 +1249,12 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
break;
default: // else, e.g. month at the end (94 10 Jan)
- res = FALSE;
+ res = sal_False;
break;
} // switch (nMonthPos)
break;
@@ -1267,7 +1267,7 @@ input for the following reasons:
nCounter = 3;
if ( nTimePos > 1 )
{ // find first time number index (should only be 3 or 2 anyway)
- for ( USHORT j = 0; j < nAnzNums; j++ )
+ for ( sal_uInt16 j = 0; j < nAnzNums; j++ )
{
if ( nNums[j] == nTimePos - 2 )
{
@@ -1299,7 +1299,7 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
}
@@ -1314,7 +1314,7 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(1) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
break;
@@ -1332,13 +1332,13 @@ input for the following reasons:
pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(0) );
break;
default:
- res = FALSE;
+ res = sal_False;
break;
}
break;
default: // else, e.g. month at the end (94 10 Jan 8:23)
nCounter = 2;
- res = FALSE;
+ res = sal_False;
break;
} // switch (nMonthPos)
break;
@@ -1352,7 +1352,7 @@ input for the following reasons:
nTryOrder = nFormatOrder; // break for
}
else
- res = FALSE;
+ res = sal_False;
if ( aOrgCalendar.Len() )
pCal->loadCalendar( aOrgCalendar, pLoc->getLocale() ); // restore calendar
@@ -1450,10 +1450,10 @@ input for the following reasons:
// ScanStartString
//
// ersten String analysieren
-// Alles weg => TRUE
-// sonst => FALSE
+// Alles weg => sal_True
+// sonst => sal_False
-BOOL ImpSvNumberInputScan::ScanStartString( const String& rString,
+sal_Bool ImpSvNumberInputScan::ScanStartString( const String& rString,
const SvNumberformat* pFormat )
{
xub_StrLen nPos = 0;
@@ -1471,7 +1471,7 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString,
{ // Match against format in any case, so later on for a "x1-2-3" input
// we may distinguish between a xy-m-d (or similar) date and a x0-0-0
// format. No sign detection here!
- if ( ScanStringNumFor( rString, nPos, pFormat, 0, TRUE ) )
+ if ( ScanStringNumFor( rString, nPos, pFormat, 0, sal_True ) )
nMatchedAllStrings |= nMatchedStartString;
else
nMatchedAllStrings = 0;
@@ -1551,7 +1551,7 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString,
return MatchedReturn();
}
- return TRUE;
+ return sal_True;
}
@@ -1559,11 +1559,11 @@ BOOL ImpSvNumberInputScan::ScanStartString( const String& rString,
// ScanMidString
//
// String in der Mitte analysieren
-// Alles weg => TRUE
-// sonst => FALSE
+// Alles weg => sal_True
+// sonst => sal_False
-BOOL ImpSvNumberInputScan::ScanMidString( const String& rString,
- USHORT nStringPos, const SvNumberformat* pFormat )
+sal_Bool ImpSvNumberInputScan::ScanMidString( const String& rString,
+ sal_uInt16 nStringPos, const SvNumberformat* pFormat )
{
xub_StrLen nPos = 0;
short eOldScannedType = eScannedType;
@@ -1793,10 +1793,10 @@ BOOL ImpSvNumberInputScan::ScanMidString( const String& rString,
if ( nMatchedAllStrings & ~nMatchedVirgin )
eScannedType = eOldScannedType;
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
@@ -1804,10 +1804,10 @@ BOOL ImpSvNumberInputScan::ScanMidString( const String& rString,
// ScanEndString
//
// Schlussteil analysieren
-// Alles weg => TRUE
-// sonst => FALSE
+// Alles weg => sal_True
+// sonst => sal_False
-BOOL ImpSvNumberInputScan::ScanEndString( const String& rString,
+sal_Bool ImpSvNumberInputScan::ScanEndString( const String& rString,
const SvNumberformat* pFormat )
{
xub_StrLen nPos = 0;
@@ -2038,30 +2038,30 @@ BOOL ImpSvNumberInputScan::ScanEndString( const String& rString,
{
// does input EndString equal EndString in Format?
if ( !ScanStringNumFor( rString, nPos, pFormat, 0xFFFF ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL ImpSvNumberInputScan::ScanStringNumFor(
+sal_Bool ImpSvNumberInputScan::ScanStringNumFor(
const String& rString, // String to scan
xub_StrLen nPos, // Position until which was consumed
const SvNumberformat* pFormat, // The format to match
- USHORT nString, // Substring of format, 0xFFFF => last
- BOOL bDontDetectNegation // Suppress sign detection
+ sal_uInt16 nString, // Substring of format, 0xFFFF => last
+ sal_Bool bDontDetectNegation // Suppress sign detection
)
{
if ( !pFormat )
- return FALSE;
+ return sal_False;
const ::utl::TransliterationWrapper* pTransliteration = pFormatter->GetTransliteration();
const String* pStr;
String aString( rString );
- BOOL bFound = FALSE;
- BOOL bFirst = TRUE;
- BOOL bContinue = TRUE;
- USHORT nSub;
+ sal_Bool bFound = sal_False;
+ sal_Bool bFirst = sal_True;
+ sal_Bool bContinue = sal_True;
+ sal_uInt16 nSub;
do
{
// Don't try "lower" subformats ff the very first match was the second
@@ -2070,22 +2070,22 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor(
do
{ // Step through subformats, first positive, then negative, then
// other, but not the last (text) subformat.
- pStr = pFormat->GetNumForString( nSub, nString, TRUE );
+ pStr = pFormat->GetNumForString( nSub, nString, sal_True );
if ( pStr && pTransliteration->isEqual( aString, *pStr ) )
{
- bFound = TRUE;
- bContinue = FALSE;
+ bFound = sal_True;
+ bContinue = sal_False;
}
else if ( nSub < 2 )
++nSub;
else
- bContinue = FALSE;
+ bContinue = sal_False;
} while ( bContinue );
if ( !bFound && bFirst && nPos )
{ // try remaining substring
- bFirst = FALSE;
+ bFirst = sal_False;
aString.Erase( 0, nPos );
- bContinue = TRUE;
+ bContinue = sal_True;
}
} while ( bContinue );
@@ -2097,13 +2097,13 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor(
aString.EraseAllChars( ' ' );
if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') )
{
- bFound = TRUE;
+ bFound = sal_True;
nStringScanSign = -1;
nSub = 0; //! not 1
}
}
if ( !bFound )
- return FALSE;
+ return sal_False;
}
else if ( !bDontDetectNegation && (nSub == 1) &&
pFormat->IsNegativeRealNegative() )
@@ -2131,7 +2131,7 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor(
nStringScanSign = -1;
}
nStringScanNumFor = nSub;
- return TRUE;
+ return sal_True;
}
@@ -2139,9 +2139,9 @@ BOOL ImpSvNumberInputScan::ScanStringNumFor(
// IsNumberFormatMain
//
// Recognizes types of number, exponential, fraction, percent, currency, date, time.
-// Else text => return FALSE
+// Else text => return sal_False
-BOOL ImpSvNumberInputScan::IsNumberFormatMain(
+sal_Bool ImpSvNumberInputScan::IsNumberFormatMain(
const String& rString, // string to be analyzed
double& , // OUT: result as number, if possible
const SvNumberformat* pFormat ) // maybe number format set to match against
@@ -2149,7 +2149,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
Reset();
NumberStringDivision( rString ); // breakdown into strings and numbers
if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS) // too many elements
- return FALSE; // Njet, Nope, ...
+ return sal_False; // Njet, Nope, ...
if (nAnzNums == 0) // no number in input
{
@@ -2165,17 +2165,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_LOGICAL; // !!! it's a BOOLEAN
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
else
- return FALSE; // simple text
+ return sal_False; // simple text
}
else
- return FALSE; // simple text
+ return sal_False; // simple text
}
- USHORT i = 0; // mark any symbol
- USHORT j = 0; // mark only numbers
+ sal_uInt16 i = 0; // mark any symbol
+ sal_uInt16 j = 0; // mark only numbers
switch ( nAnzNums )
{
@@ -2190,14 +2190,14 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_FRACTION;
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
}
}
else
{ // Analyze start string
if (!ScanStartString( sStrArray[i], pFormat )) // i=0
- return FALSE; // already an error
+ return sal_False; // already an error
i++; // next symbol, i=1
}
GetNextNumber(i,j); // i=1,2
@@ -2212,11 +2212,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_FRACTION;
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
}
if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
- return FALSE;
+ return sal_False;
}
break;
case 2 : // Exactly 2 numbers in input
@@ -2224,16 +2224,16 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
if (!GetNextNumber(i,j)) // i=1,0
{ // Analyze start string
if (!ScanStartString( sStrArray[i], pFormat ))
- return FALSE; // already an error
+ return sal_False; // already an error
i++; // i=1
}
GetNextNumber(i,j); // i=1,2
if ( !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++; // next symbol, i=2,3
GetNextNumber(i,j); // i=3,4
if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
- return FALSE;
+ return sal_False;
if (eSetType == NUMBERFORMAT_FRACTION) // -1,200. as fraction
{
if (!nNegCheck && // no sign '('
@@ -2243,7 +2243,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_FRACTION;
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
}
}
@@ -2253,24 +2253,24 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
if (!GetNextNumber(i,j)) // i=1,0
{ // Analyze start string
if (!ScanStartString( sStrArray[i], pFormat ))
- return FALSE; // already an error
+ return sal_False; // already an error
i++; // i=1
if (nDecPos == 1) // decimal separator at start => error
- return FALSE;
+ return sal_False;
}
GetNextNumber(i,j); // i=1,2
if ( !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++; // i=2,3
if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end
- return FALSE;
+ return sal_False;
GetNextNumber(i,j); // i=3,4
if ( !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++; // i=4,5
GetNextNumber(i,j); // i=5,6
if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
- return FALSE;
+ return sal_False;
if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction
{
if (!nNegCheck && // no sign '('
@@ -2280,11 +2280,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_FRACTION;
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
}
if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos )
- return FALSE; // #36857# not a real fraction
+ return sal_False; // #36857# not a real fraction
}
break;
default: // More than 3 numbers in input
@@ -2292,45 +2292,45 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
if (!GetNextNumber(i,j)) // i=1,0
{ // Analyze startstring
if (!ScanStartString( sStrArray[i], pFormat ))
- return FALSE; // already an error
+ return sal_False; // already an error
i++; // i=1
if (nDecPos == 1) // decimal separator at start => error
- return FALSE;
+ return sal_False;
}
GetNextNumber(i,j); // i=1,2
if ( !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++; // i=2,3
- USHORT nThOld = 10; // just not 0 or 1
+ sal_uInt16 nThOld = 10; // just not 0 or 1
while (nThOld != nThousand && j < nAnzNums-1)
// Execute at least one time
// but leave one number.
{ // Loop over group separators
nThOld = nThousand;
if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end
- return FALSE;
+ return sal_False;
GetNextNumber(i,j);
if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++;
}
if (eScannedType == NUMBERFORMAT_DATE || // long date or
eScannedType == NUMBERFORMAT_TIME || // long time or
eScannedType == NUMBERFORMAT_UNDEFINED) // long number
{
- for (USHORT k = j; k < nAnzNums-1; k++)
+ for (sal_uInt16 k = j; k < nAnzNums-1; k++)
{
if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at endd
- return FALSE;
+ return sal_False;
GetNextNumber(i,j);
if ( i < nAnzStrings && !ScanMidString( sStrArray[i], i, pFormat ) )
- return FALSE;
+ return sal_False;
i++;
}
}
GetNextNumber(i,j);
if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
- return FALSE;
+ return sal_False;
if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction
{
if (!nNegCheck && // no sign '('
@@ -2340,11 +2340,11 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
eScannedType = NUMBERFORMAT_FRACTION;
nMatchedAllStrings &= ~nMatchedVirgin;
- return TRUE;
+ return sal_True;
}
}
if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos )
- return FALSE; // #36857# not a real fraction
+ return sal_False; // #36857# not a real fraction
}
}
@@ -2352,18 +2352,18 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
{
nMatchedAllStrings &= ~nMatchedVirgin;
// did match including nMatchedUsedAsReturn
- BOOL bDidMatch = (nMatchedAllStrings != 0);
+ sal_Bool bDidMatch = (nMatchedAllStrings != 0);
if ( nMatchedAllStrings )
{
- BOOL bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual(
- nStringScanNumFor, nAnzStrings, nAnzNums ) : FALSE);
+ sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual(
+ nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False);
if ( !bMatch )
nMatchedAllStrings = 0;
}
if ( nMatchedAllStrings )
eScannedType = eSetType;
else if ( bDidMatch )
- return FALSE;
+ return sal_False;
else
eScannedType = NUMBERFORMAT_NUMBER;
// everything else should have been recognized by now
@@ -2371,36 +2371,36 @@ BOOL ImpSvNumberInputScan::IsNumberFormatMain(
else if ( eScannedType == NUMBERFORMAT_DATE )
{ // the very relaxed date input checks may interfere with a preset format
nMatchedAllStrings &= ~nMatchedVirgin;
- BOOL bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0);
+ sal_Bool bWasReturn = ((nMatchedAllStrings & nMatchedUsedAsReturn) != 0);
if ( nMatchedAllStrings )
{
- BOOL bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual(
- nStringScanNumFor, nAnzStrings, nAnzNums ) : FALSE);
+ sal_Bool bMatch = (pFormat ? pFormat->IsNumForStringElementCountEqual(
+ nStringScanNumFor, nAnzStrings, nAnzNums ) : sal_False);
if ( !bMatch )
nMatchedAllStrings = 0;
}
if ( nMatchedAllStrings )
eScannedType = eSetType;
else if ( bWasReturn )
- return FALSE;
+ return sal_False;
}
else
nMatchedAllStrings = 0; // reset flag to no substrings matched
- return TRUE;
+ return sal_True;
}
//---------------------------------------------------------------------------
-// return TRUE or FALSE depending on the nMatched... state and remember usage
-BOOL ImpSvNumberInputScan::MatchedReturn()
+// return sal_True or sal_False depending on the nMatched... state and remember usage
+sal_Bool ImpSvNumberInputScan::MatchedReturn()
{
if ( nMatchedAllStrings & ~nMatchedVirgin )
{
nMatchedAllStrings |= nMatchedUsedAsReturn;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -2435,7 +2435,7 @@ void ImpSvNumberInputScan::InitText()
pUpperDayText[j] = pChrCls->upper( xElems[j].FullName );
pUpperAbbrevDayText[j] = pChrCls->upper( xElems[j].AbbrevName );
}
- bTextInitialized = TRUE;
+ bTextInitialized = sal_True;
}
@@ -2454,7 +2454,7 @@ void ImpSvNumberInputScan::ChangeIntl()
cDecSep == '/' ||
cDecSep == '.' ||
cDecSep == pFormatter->GetDateSep().GetChar(0) );
- bTextInitialized = FALSE;
+ bTextInitialized = sal_False;
aUpperCurrSymbol.Erase();
}
@@ -2463,9 +2463,9 @@ void ImpSvNumberInputScan::ChangeIntl()
// ChangeNullDate
void ImpSvNumberInputScan::ChangeNullDate(
- const USHORT Day,
- const USHORT Month,
- const USHORT Year )
+ const sal_uInt16 Day,
+ const sal_uInt16 Month,
+ const sal_uInt16 Year )
{
if ( pNullDate )
*pNullDate = Date(Day, Month, Year);
@@ -2479,7 +2479,7 @@ void ImpSvNumberInputScan::ChangeNullDate(
//
// => does rString represent a number (also date, time et al)
-BOOL ImpSvNumberInputScan::IsNumberFormat(
+sal_Bool ImpSvNumberInputScan::IsNumberFormat(
const String& rString, // string to be analyzed
short& F_Type, // IN: old type, OUT: new type
double& fOutNumber, // OUT: number if convertable
@@ -2487,13 +2487,13 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
{
String sResString;
String aString;
- BOOL res; // return value
+ sal_Bool res; // return value
eSetType = F_Type; // old type set
if ( !rString.Len() )
- res = FALSE;
+ res = sal_False;
else if (rString.Len() > 308) // arbitrary
- res = FALSE;
+ res = sal_False;
else
{
// NoMoreUpperNeeded, all comparisons on UpperCase
@@ -2509,7 +2509,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
|| (nSign && (eScannedType == NUMBERFORMAT_DATE
|| eScannedType == NUMBERFORMAT_DATETIME))
) // signed date/datetime
- res = FALSE;
+ res = sal_False;
else
{ // check count of partial number strings
switch (eScannedType)
@@ -2523,7 +2523,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if ( nMatchedAllStrings )
nThousand = nAnzNums - 1;
else if ( nAnzNums != 1 )
- res = FALSE;
+ res = sal_False;
}
else if (nDecPos == 2) // 1.05
{
@@ -2531,7 +2531,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if ( nMatchedAllStrings )
nThousand = nAnzNums - 1;
else if ( nAnzNums != nThousand+2 )
- res = FALSE;
+ res = sal_False;
}
else // 1,100 or 1,100.
{
@@ -2539,7 +2539,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if ( nMatchedAllStrings )
nThousand = nAnzNums - 1;
else if ( nAnzNums != nThousand+1 )
- res = FALSE;
+ res = sal_False;
}
break;
@@ -2547,17 +2547,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (nDecPos == 1) // .05
{
if (nAnzNums != 2)
- res = FALSE;
+ res = sal_False;
}
else if (nDecPos == 2) // 1.05
{
if (nAnzNums != nThousand+3)
- res = FALSE;
+ res = sal_False;
}
else // 1,100 or 1,100.
{
if (nAnzNums != nThousand+2)
- res = FALSE;
+ res = sal_False;
}
break;
@@ -2565,12 +2565,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (nMonth)
{ // month name and numbers
if (nAnzNums > 2)
- res = FALSE;
+ res = sal_False;
}
else
{
if (nAnzNums > 3)
- res = FALSE;
+ res = sal_False;
}
break;
@@ -2578,12 +2578,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (nDecPos)
{ // hundredth seconds included
if (nAnzNums > 4)
- res = FALSE;
+ res = sal_False;
}
else
{
if (nAnzNums > 3)
- res = FALSE;
+ res = sal_False;
}
break;
@@ -2593,12 +2593,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (nDecPos)
{ // hundredth seconds included
if (nAnzNums > 6)
- res = FALSE;
+ res = sal_False;
}
else
{
if (nAnzNums > 5)
- res = FALSE;
+ res = sal_False;
}
}
else
@@ -2606,12 +2606,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (nDecPos)
{ // hundredth seconds included
if (nAnzNums > 7)
- res = FALSE;
+ res = sal_False;
}
else
{
if (nAnzNums > 6)
- res = FALSE;
+ res = sal_False;
}
}
break;
@@ -2632,7 +2632,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
else if (nLogical == -1)
fOutNumber = 0.0; // False
else
- res = FALSE; // Oops
+ res = sal_False; // Oops
break;
case NUMBERFORMAT_PERCENT:
@@ -2645,13 +2645,13 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
sResString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "0." ) );
else
sResString.Erase();
- USHORT k;
+ sal_uInt16 k;
for ( k = 0; k <= nThousand; k++)
sResString += sStrArray[nNums[k]]; // integer part
if ( nDecPos == 2 && k < nAnzNums ) // . somewhere
{
sResString += '.';
- USHORT nStop = (eScannedType == NUMBERFORMAT_SCIENTIFIC ?
+ sal_uInt16 nStop = (eScannedType == NUMBERFORMAT_SCIENTIFIC ?
nAnzNums-1 : nAnzNums);
for ( ; k < nStop; k++)
sResString += sStrArray[nNums[k]]; // fractional part
@@ -2675,7 +2675,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
fOutNumber = 0.0;
else
fOutNumber = DBL_MAX;
-/*!*/ return TRUE;
+/*!*/ return sal_True;
}
}
@@ -2712,12 +2712,12 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (fNenner != 0.0)
fOutNumber = fZaehler/fNenner;
else
- res = FALSE;
+ res = sal_False;
}
}
else // nAnzNums > 2
{
- USHORT k = 1;
+ sal_uInt16 k = 1;
sResString = sStrArray[nNums[0]];
if (nThousand > 0)
for (k = 1; k <= nThousand; k++)
@@ -2731,7 +2731,7 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
if (fNenner != 0.0)
fOutNumber += fZaehler/fNenner;
else
- res = FALSE;
+ res = sal_False;
}
}
@@ -2754,14 +2754,14 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
case NUMBERFORMAT_DATE:
{
- USHORT nCounter = 0; // dummy here
+ sal_uInt16 nCounter = 0; // dummy here
res = GetDateRef( fOutNumber, nCounter, pFormat );
}
break;
case NUMBERFORMAT_DATETIME:
{
- USHORT nCounter = 0; // needed here
+ sal_uInt16 nCounter = 0; // needed here
res = GetDateRef( fOutNumber, nCounter, pFormat );
if ( res )
{
@@ -2785,17 +2785,17 @@ BOOL ImpSvNumberInputScan::IsNumberFormat(
{
F_Type = NUMBERFORMAT_TEXT;
fOutNumber = -DBL_MAX;
- return TRUE;
+ return sal_True;
}
else if (fOutNumber > DBL_MAX) // 1.7E308
{
F_Type = NUMBERFORMAT_TEXT;
fOutNumber = DBL_MAX;
- return TRUE;
+ return sal_True;
}
}
- if (res == FALSE)
+ if (res == sal_False)
{
eScannedType = NUMBERFORMAT_TEXT;
fOutNumber = 0.0;
diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index ced58e84c2f6..4af1ca91ae8a 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.hxx
@@ -47,12 +47,12 @@ public:
/// set reference date for offset calculation
void ChangeNullDate(
- const USHORT nDay,
- const USHORT nMonth,
- const USHORT nYear );
+ const sal_uInt16 nDay,
+ const sal_uInt16 nMonth,
+ const sal_uInt16 nYear );
/// convert input string to number
- BOOL IsNumberFormat(
+ sal_Bool IsNumberFormat(
const String& rString, /// input string
short& F_Type, /// format type (in + out)
double& fOutNumber, /// value determined (out)
@@ -62,12 +62,12 @@ public:
/// after IsNumberFormat: get decimal position
short GetDecPos() const { return nDecPos; }
/// after IsNumberFormat: get count of numeric substrings in input string
- USHORT GetAnzNums() const { return nAnzNums; }
+ sal_uInt16 GetAnzNums() const { return nAnzNums; }
/// set threshold of two-digit year input
- void SetYear2000( USHORT nVal ) { nYear2000 = nVal; }
+ void SetYear2000( sal_uInt16 nVal ) { nYear2000 = nVal; }
/// get threshold of two-digit year input
- USHORT GetYear2000() const { return nYear2000; }
+ sal_uInt16 GetYear2000() const { return nYear2000; }
private:
SvNumberFormatter* pFormatter;
@@ -76,50 +76,50 @@ private:
String* pUpperDayText; // Array of day of week names, uppercase
String* pUpperAbbrevDayText; // Array of day of week names, abbreviated, uppercase
String aUpperCurrSymbol; // Currency symbol, uppercase
- BOOL bTextInitialized; // Whether days and months are initialized
+ sal_Bool bTextInitialized; // Whether days and months are initialized
Date* pNullDate; // 30Dec1899
// Variables for provisional results:
String sStrArray[SV_MAX_ANZ_INPUT_STRINGS]; // Array of scanned substrings
- BOOL IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric
- USHORT nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings
- USHORT nAnzStrings; // Total count of scanned substrings
- USHORT nAnzNums; // Count of numeric substrings
- BOOL bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep}
- BYTE nMatchedAllStrings; // Scan...String() matched all substrings,
+ sal_Bool IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Whether a substring is numeric
+ sal_uInt16 nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Sequence of offsets to numeric strings
+ sal_uInt16 nAnzStrings; // Total count of scanned substrings
+ sal_uInt16 nAnzNums; // Count of numeric substrings
+ sal_Bool bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep}
+ sal_uInt8 nMatchedAllStrings; // Scan...String() matched all substrings,
// bit mask of nMatched... constants
- static const BYTE nMatchedEndString; // 0x01
- static const BYTE nMatchedMidString; // 0x02
- static const BYTE nMatchedStartString; // 0x04
- static const BYTE nMatchedVirgin; // 0x08
- static const BYTE nMatchedUsedAsReturn; // 0x10
+ static const sal_uInt8 nMatchedEndString; // 0x01
+ static const sal_uInt8 nMatchedMidString; // 0x02
+ static const sal_uInt8 nMatchedStartString; // 0x04
+ static const sal_uInt8 nMatchedVirgin; // 0x08
+ static const sal_uInt8 nMatchedUsedAsReturn; // 0x10
int nSign; // Sign of number
short nMonth; // Month (1..x) if date
// negative => short format
short nMonthPos; // 1 = front, 2 = middle
// 3 = end
- USHORT nTimePos; // Index of first time separator (+1)
+ sal_uInt16 nTimePos; // Index of first time separator (+1)
short nDecPos; // Index of substring containing "," (+1)
short nNegCheck; // '( )' for negative
short nESign; // Sign of exponent
short nAmPm; // +1 AM, -1 PM, 0 if none
short nLogical; // -1 => False, 1 => True
- USHORT nThousand; // Count of group (AKA thousand) separators
- USHORT nPosThousandString; // Position of concatenaded 000,000,000 string
+ sal_uInt16 nThousand; // Count of group (AKA thousand) separators
+ sal_uInt16 nPosThousandString; // Position of concatenaded 000,000,000 string
short eScannedType; // Scanned type
short eSetType; // Preset Type
- USHORT nStringScanNumFor; // Fixed strings recognized in
+ sal_uInt16 nStringScanNumFor; // Fixed strings recognized in
// pFormat->NumFor[nNumForStringScan]
short nStringScanSign; // Sign resulting of FixString
- USHORT nYear2000; // Two-digit threshold
+ sal_uInt16 nYear2000; // Two-digit threshold
// Year as 20xx
// default 18
// number <= nYear2000 => 20xx
// number > nYear2000 => 19xx
- USHORT nTimezonePos; // Index of timezone separator (+1)
- BYTE nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no
+ sal_uInt16 nTimezonePos; // Index of timezone separator (+1)
+ sal_uInt8 nMayBeIso8601; // 0:=dontknowyet, 1:=yes, 2:=no
#ifdef _ZFORFIND_CXX // methods private to implementation
void Reset(); // Reset all variables before start of analysis
@@ -129,17 +129,17 @@ private:
// Convert string to double.
// Only simple unsigned floating point values without any error detection,
// decimal separator has to be '.'
- // If bForceFraction==TRUE the string is taken to be the fractional part
+ // If bForceFraction==sal_True the string is taken to be the fractional part
// of 0.1234 without the leading 0. (thus being just "1234").
double StringToDouble(
const String& rStr,
- BOOL bForceFraction = FALSE );
+ sal_Bool bForceFraction = sal_False );
- BOOL NextNumberStringSymbol( // Next number/string symbol
+ sal_Bool NextNumberStringSymbol( // Next number/string symbol
const sal_Unicode*& pStr,
String& rSymbol );
- BOOL SkipThousands( // Concatenate ,000,23 blocks
+ sal_Bool SkipThousands( // Concatenate ,000,23 blocks
const sal_Unicode*& pStr, // in input to 000123
String& rSymbol );
@@ -151,50 +151,50 @@ private:
// optimized substring versions
- static inline BOOL StringContains( // Whether rString contains rWhat at nPos
+ static inline sal_Bool StringContains( // Whether rString contains rWhat at nPos
const String& rWhat,
const String& rString,
xub_StrLen nPos )
{ // mostly used with one character
if ( rWhat.GetChar(0) != rString.GetChar(nPos) )
- return FALSE;
+ return sal_False;
return StringContainsImpl( rWhat, rString, nPos );
}
- static inline BOOL StringPtrContains( // Whether pString contains rWhat at nPos
+ static inline sal_Bool StringPtrContains( // Whether pString contains rWhat at nPos
const String& rWhat,
const sal_Unicode* pString,
xub_StrLen nPos ) // nPos MUST be a valid offset from pString
{ // mostly used with one character
if ( rWhat.GetChar(0) != *(pString+nPos) )
- return FALSE;
+ return sal_False;
return StringPtrContainsImpl( rWhat, pString, nPos );
}
- static BOOL StringContainsImpl( //! DO NOT use directly
+ static sal_Bool StringContainsImpl( //! DO NOT use directly
const String& rWhat,
const String& rString,
xub_StrLen nPos );
- static BOOL StringPtrContainsImpl( //! DO NOT use directly
+ static sal_Bool StringPtrContainsImpl( //! DO NOT use directly
const String& rWhat,
const sal_Unicode* pString,
xub_StrLen nPos );
- static inline BOOL SkipChar( // Skip a special character
+ static inline sal_Bool SkipChar( // Skip a special character
sal_Unicode c,
const String& rString,
xub_StrLen& nPos );
static inline void SkipBlanks( // Skip blank
const String& rString,
xub_StrLen& nPos );
- static inline BOOL SkipString( // Jump over rWhat in rString at nPos
+ static inline sal_Bool SkipString( // Jump over rWhat in rString at nPos
const String& rWhat,
const String& rString,
xub_StrLen& nPos );
- inline BOOL GetThousandSep( // Recognizes exactly ,111 as group separator
+ inline sal_Bool GetThousandSep( // Recognizes exactly ,111 as group separator
const String& rString,
xub_StrLen& nPos,
- USHORT nStringPos );
+ sal_uInt16 nStringPos );
short GetLogical( // Get boolean value
const String& rString );
short GetMonth( // Get month and advance string position
@@ -203,17 +203,17 @@ private:
int GetDayOfWeek( // Get day of week and advance string position
const String& rString,
xub_StrLen& nPos );
- BOOL GetCurrency( // Get currency symbol and advance string position
+ sal_Bool GetCurrency( // Get currency symbol and advance string position
const String& rString,
xub_StrLen& nPos,
const SvNumberformat* pFormat = NULL ); // optional number format to match against
- BOOL GetTimeAmPm( // Get symbol AM or PM and advance string position
+ sal_Bool GetTimeAmPm( // Get symbol AM or PM and advance string position
const String& rString,
xub_StrLen& nPos );
- inline BOOL GetDecSep( // Get decimal separator and advance string position
+ inline sal_Bool GetDecSep( // Get decimal separator and advance string position
const String& rString,
xub_StrLen& nPos );
- inline BOOL GetTime100SecSep( // Get hundredth seconds separator and advance string position
+ inline sal_Bool GetTime100SecSep( // Get hundredth seconds separator and advance string position
const String& rString,
xub_StrLen& nPos );
int GetSign( // Get sign and advance string position
@@ -223,30 +223,30 @@ private:
const String& rString,
xub_StrLen& nPos );
- inline BOOL GetNextNumber( // Get next number as array offset
- USHORT& i,
- USHORT& j );
+ inline sal_Bool GetNextNumber( // Get next number as array offset
+ sal_uInt16& i,
+ sal_uInt16& j );
void GetTimeRef( // Converts time -> double (only decimals)
double& fOutNumber, // result as double
- USHORT nIndex, // Index of hour in input
- USHORT nAnz ); // Count of time substrings in input
- USHORT ImplGetDay ( USHORT nIndex ); // Day input, 0 if no match
- USHORT ImplGetMonth( USHORT nIndex ); // Month input, zero based return, NumberOfMonths if no match
- USHORT ImplGetYear ( USHORT nIndex ); // Year input, 0 if no match
- BOOL GetDateRef( // Conversion of date to number
+ sal_uInt16 nIndex, // Index of hour in input
+ sal_uInt16 nAnz ); // Count of time substrings in input
+ sal_uInt16 ImplGetDay ( sal_uInt16 nIndex ); // Day input, 0 if no match
+ sal_uInt16 ImplGetMonth( sal_uInt16 nIndex ); // Month input, zero based return, NumberOfMonths if no match
+ sal_uInt16 ImplGetYear ( sal_uInt16 nIndex ); // Year input, 0 if no match
+ sal_Bool GetDateRef( // Conversion of date to number
double& fDays, // OUT: days diff to null date
- USHORT& nCounter, // Count of date substrings
+ sal_uInt16& nCounter, // Count of date substrings
const SvNumberformat* pFormat = NULL ); // optional number format to match against
- BOOL ScanStartString( // Analyze start of string
+ sal_Bool ScanStartString( // Analyze start of string
const String& rString,
const SvNumberformat* pFormat = NULL );
- BOOL ScanMidString( // Analyze middle substring
+ sal_Bool ScanMidString( // Analyze middle substring
const String& rString,
- USHORT nStringPos,
+ sal_uInt16 nStringPos,
const SvNumberformat* pFormat = NULL );
- BOOL ScanEndString( // Analyze end of string
+ sal_Bool ScanEndString( // Analyze end of string
const String& rString,
const SvNumberformat* pFormat = NULL );
@@ -256,27 +256,27 @@ private:
// Compare rString to substring of array indexed by nString
// nString == 0xFFFF => last substring
- BOOL ScanStringNumFor(
+ sal_Bool ScanStringNumFor(
const String& rString,
xub_StrLen nPos,
const SvNumberformat* pFormat,
- USHORT nString,
- BOOL bDontDetectNegation = FALSE );
+ sal_uInt16 nString,
+ sal_Bool bDontDetectNegation = sal_False );
- // if nMatchedAllStrings set nMatchedUsedAsReturn and return TRUE,
- // else do nothing and return FALSE
- BOOL MatchedReturn();
+ // if nMatchedAllStrings set nMatchedUsedAsReturn and return sal_True,
+ // else do nothing and return sal_False
+ sal_Bool MatchedReturn();
//! Be sure that the string to be analyzed is already converted to upper
//! case and if it contained native humber digits that they are already
//! converted to ASCII.
- BOOL IsNumberFormatMain( // Main anlyzing function
+ sal_Bool IsNumberFormatMain( // Main anlyzing function
const String& rString,
double& fOutNumber, // return value if string is numeric
const SvNumberformat* pFormat = NULL // optional number format to match against
);
- static inline BOOL MyIsdigit( sal_Unicode c );
+ static inline sal_Bool MyIsdigit( sal_Unicode c );
// native number transliteration if necessary
void TransformInput( String& rString );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 1198b11697be..f3403327b4b5 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -88,7 +88,7 @@ using ::rtl::OUString;
* (old currency) is recognized as a date (#53155#). */
#define UNKNOWN_SUBSTITUTE LANGUAGE_ENGLISH_US
-static BOOL bIndexTableInitialized = FALSE;
+static sal_Bool bIndexTableInitialized = sal_False;
static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES];
@@ -160,7 +160,7 @@ void SvNumberFormatterRegistry_Impl::ConfigurationChanged( utl::ConfigurationBro
// ====================================================================
SvNumberFormatterRegistry_Impl* SvNumberFormatter::pFormatterRegistry = NULL;
-BOOL SvNumberFormatter::bCurrencyTableInitialized = FALSE;
+sal_Bool SvNumberFormatter::bCurrencyTableInitialized = sal_False;
namespace
{
struct theCurrencyTable :
@@ -169,7 +169,7 @@ namespace
struct theLegacyOnlyCurrencyTable :
public rtl::Static< NfCurrencyTable, theLegacyOnlyCurrencyTable > {};
}
-USHORT SvNumberFormatter::nSystemCurrencyPosition = 0;
+sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0;
SV_IMPL_PTRARR( NfCurrencyTable, NfCurrencyEntry* );
SV_IMPL_PTRARR( NfWSStringsDtor, String* );
@@ -254,9 +254,9 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
pFormatScanner = new ImpSvNumberformatScan( this );
pFormatTable = NULL;
MaxCLOffset = 0;
- ImpGenerateFormats( 0, FALSE ); // 0 .. 999 for initialized language formats
+ ImpGenerateFormats( 0, sal_False ); // 0 .. 999 for initialized language formats
pMergeTable = NULL;
- bNoZero = FALSE;
+ bNoZero = sal_False;
::osl::MutexGuard aGuard( GetMutex() );
GetFormatterRegistry().Insert( this );
@@ -316,7 +316,7 @@ SvNumberFormatterRegistry_Impl& SvNumberFormatter::GetFormatterRegistry()
}
-Color* SvNumberFormatter::GetUserDefColor(USHORT nIndex)
+Color* SvNumberFormatter::GetUserDefColor(sal_uInt16 nIndex)
{
if( aColorLink.IsSet() )
return (Color*) ( aColorLink.Call( (void*) &nIndex ));
@@ -324,9 +324,9 @@ Color* SvNumberFormatter::GetUserDefColor(USHORT nIndex)
return NULL;
}
-void SvNumberFormatter::ChangeNullDate(USHORT nDay,
- USHORT nMonth,
- USHORT nYear)
+void SvNumberFormatter::ChangeNullDate(sal_uInt16 nDay,
+ sal_uInt16 nMonth,
+ sal_uInt16 nYear)
{
pFormatScanner->ChangeNullDate(nDay, nMonth, nYear);
pStringScanner->ChangeNullDate(nDay, nMonth, nYear);
@@ -347,7 +347,7 @@ sal_uInt16 SvNumberFormatter::GetStandardPrec()
return pFormatScanner->GetStandardPrec();
}
-void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 )
+void SvNumberFormatter::ImpChangeSysCL( LanguageType eLnge, sal_Bool bLoadingSO5 )
{
if (eLnge == LANGUAGE_DONTKNOW)
eLnge = UNKNOWN_SUBSTITUTE;
@@ -408,12 +408,12 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage )
// reset ActLnge otherwise ChangeIntl() wouldn't switch if already LANGUAGE_SYSTEM
ActLnge = LANGUAGE_DONTKNOW;
ChangeIntl( LANGUAGE_SYSTEM );
- ImpGenerateFormats( nCLOffset, TRUE );
+ ImpGenerateFormats( nCLOffset, sal_True );
// convert additional and user defined from old system to new system
SvNumberformat* pStdFormat = (SvNumberformat*) aFTable.Get( nCLOffset + ZF_STANDARD );
sal_uInt32 nLastKey = nMaxBuiltin;
- pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, TRUE );
+ pFormatScanner->SetConvertMode( eOldLanguage, LANGUAGE_SYSTEM, sal_True );
aOldTable.First();
while ( aOldTable.Count() )
{
@@ -451,34 +451,34 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage )
delete pOldEntry;
}
- pFormatScanner->SetConvertMode(FALSE);
- pStdFormat->SetLastInsertKey( USHORT(nLastKey - nCLOffset) );
+ pFormatScanner->SetConvertMode(sal_False);
+ pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) );
// append new system additional formats
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
- ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, TRUE );
+ ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, sal_True );
}
-BOOL SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const
+sal_Bool SvNumberFormatter::IsTextFormat(sal_uInt32 F_Index) const
{
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index);
if (!pFormat)
- return FALSE;
+ return sal_False;
else
return pFormat->IsTextFormat();
}
-BOOL SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const
+sal_Bool SvNumberFormatter::HasTextFormat(sal_uInt32 F_Index) const
{
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index);
if (!pFormat)
- return FALSE;
+ return sal_False;
else
return pFormat->HasTextFormat();
}
-BOOL SvNumberFormatter::PutEntry(String& rString,
+sal_Bool SvNumberFormatter::PutEntry(String& rString,
xub_StrLen& nCheckPos,
short& nType,
sal_uInt32& nKey, // Formatnummer
@@ -488,14 +488,14 @@ BOOL SvNumberFormatter::PutEntry(String& rString,
if (rString.Len() == 0) // keinen Leerstring
{
nCheckPos = 1; // -> Fehler
- return FALSE;
+ return sal_False;
}
if (eLnge == LANGUAGE_DONTKNOW)
eLnge = IniLnge;
ChangeIntl(eLnge); // ggfs. austauschen
LanguageType eLge = eLnge; // Umgehung const fuer ConvertMode
- BOOL bCheck = FALSE;
+ sal_Bool bCheck = sal_False;
SvNumberformat* p_Entry = new SvNumberformat(rString,
pFormatScanner,
pStringScanner,
@@ -533,9 +533,9 @@ BOOL SvNumberFormatter::PutEntry(String& rString,
delete p_Entry;
else
{
- bCheck = TRUE;
+ bCheck = sal_True;
nKey = nPos+1;
- pStdFormat->SetLastInsertKey((USHORT) (nKey-CLOffset));
+ pStdFormat->SetLastInsertKey((sal_uInt16) (nKey-CLOffset));
}
}
}
@@ -555,48 +555,48 @@ bool SvNumberFormatter::PutEntry(
return bRet;
}
-BOOL SvNumberFormatter::PutandConvertEntry(String& rString,
+bool SvNumberFormatter::PutandConvertEntry(String& rString,
xub_StrLen& nCheckPos,
short& nType,
sal_uInt32& nKey,
LanguageType eLnge,
LanguageType eNewLnge)
{
- BOOL bRes;
+ bool bRes;
if (eNewLnge == LANGUAGE_DONTKNOW)
eNewLnge = IniLnge;
pFormatScanner->SetConvertMode(eLnge, eNewLnge);
bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
- pFormatScanner->SetConvertMode(FALSE);
+ pFormatScanner->SetConvertMode(false);
return bRes;
}
-BOOL SvNumberFormatter::PutandConvertEntrySystem(String& rString,
+bool SvNumberFormatter::PutandConvertEntrySystem(String& rString,
xub_StrLen& nCheckPos,
short& nType,
sal_uInt32& nKey,
LanguageType eLnge,
LanguageType eNewLnge)
{
- BOOL bRes;
+ sal_Bool bRes;
if (eNewLnge == LANGUAGE_DONTKNOW)
eNewLnge = IniLnge;
- pFormatScanner->SetConvertMode(eLnge, eNewLnge, TRUE);
+ pFormatScanner->SetConvertMode(eLnge, eNewLnge, sal_True);
bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
- pFormatScanner->SetConvertMode(FALSE);
+ pFormatScanner->SetConvertMode(sal_False);
return bRes;
}
sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString,
LanguageType eLnge, LanguageType eSysLnge, short & rType,
- BOOL & rNewInserted, xub_StrLen & rCheckPos )
+ sal_Bool & rNewInserted, xub_StrLen & rCheckPos )
{
sal_uInt32 nKey = NUMBERFORMAT_ENTRY_NOT_FOUND;
- rNewInserted = FALSE;
+ rNewInserted = sal_False;
rCheckPos = 0;
// #62389# empty format string (of Writer) => General standard format
@@ -651,7 +651,7 @@ sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString,
if (rNewInserted)
{
DeleteEntry( nKey); // don't leave trails of rubbish
- rNewInserted = FALSE;
+ rNewInserted = sal_False;
}
nKey = GetStandardFormat( NUMBERFORMAT_CURRENCY, eLnge);
}
@@ -671,7 +671,7 @@ void SvNumberFormatter::PrepareSave()
SvNumberformat* pFormat = aFTable.First();
while (pFormat)
{
- pFormat->SetUsed(FALSE);
+ pFormat->SetUsed(sal_False);
pFormat = aFTable.Next();
}
}
@@ -680,41 +680,41 @@ void SvNumberFormatter::SetFormatUsed(sal_uInt32 nFIndex)
{
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
if (pFormat)
- pFormat->SetUsed(TRUE);
+ pFormat->SetUsed(sal_True);
}
-BOOL SvNumberFormatter::Load( SvStream& rStream )
+sal_Bool SvNumberFormatter::Load( SvStream& rStream )
{
LanguageType eSysLang = SvtSysLocale().GetLanguage();
SvNumberFormatter* pConverter = NULL;
ImpSvNumMultipleReadHeader aHdr( rStream );
- USHORT nVersion;
+ sal_uInt16 nVersion;
rStream >> nVersion;
SvNumberformat* pEntry;
sal_uInt32 nPos;
LanguageType eSaveSysLang, eLoadSysLang;
- USHORT nSysOnStore, eLge, eDummy; // Dummy fuer kompatibles Format
+ sal_uInt16 nSysOnStore, eLge, eDummy; // Dummy fuer kompatibles Format
rStream >> nSysOnStore >> eLge; // Systemeinstellung aus
// Dokument
eSaveSysLang = (nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ?
LANGUAGE_SYSTEM : (LanguageType) nSysOnStore);
LanguageType eLnge = (LanguageType) eLge;
- ImpChangeSysCL( eLnge, TRUE );
+ ImpChangeSysCL( eLnge, sal_True );
rStream >> nPos;
while (nPos != NUMBERFORMAT_ENTRY_NOT_FOUND)
{
rStream >> eDummy >> eLge;
eLnge = (LanguageType) eLge;
- ImpGenerateCL( eLnge, TRUE ); // ggfs. neue Standardformate anlegen
+ ImpGenerateCL( eLnge, sal_True ); // ggfs. neue Standardformate anlegen
sal_uInt32 nOffset = nPos % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
- BOOL bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE);
+ sal_Bool bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE);
//! HACK! ER 29.07.97 15:15
// SaveLang wurde bei SYSTEM nicht gespeichert sondern war auch SYSTEM,
// erst ab 364i Unterscheidung moeglich
- BOOL bConversionHack;
+ sal_Bool bConversionHack;
if ( eLnge == LANGUAGE_SYSTEM )
{
if ( nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE )
@@ -724,13 +724,13 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
}
else
{
- bConversionHack = FALSE;
+ bConversionHack = sal_False;
eLoadSysLang = eSysLang;
}
}
else
{
- bConversionHack = FALSE;
+ bConversionHack = sal_False;
eLoadSysLang = eSaveSysLang;
}
@@ -747,7 +747,7 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
{
case NF_CONVERT_GERMAN_ENGLISH :
pEntry->ConvertLanguage( *pConverter,
- LANGUAGE_ENGLISH_US, eSysLang, TRUE );
+ LANGUAGE_ENGLISH_US, eSysLang, sal_True );
break;
case NF_CONVERT_ENGLISH_GERMAN :
switch ( eSysLang )
@@ -761,7 +761,7 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
break;
default:
pEntry->ConvertLanguage( *pConverter,
- LANGUAGE_GERMAN, eSysLang, TRUE );
+ LANGUAGE_GERMAN, eSysLang, sal_True );
}
break;
case NF_CONVERT_NONE :
@@ -791,33 +791,33 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
case LANGUAGE_GERMAN_LIECHTENSTEIN:
// alles beim alten
pEntry->ConvertLanguage( *pConverter,
- eSaveSysLang, eLoadSysLang, TRUE );
+ eSaveSysLang, eLoadSysLang, sal_True );
break;
default:
// alte english nach neuem anderen
pEntry->ConvertLanguage( *pConverter,
- LANGUAGE_ENGLISH_US, eLoadSysLang, TRUE );
+ LANGUAGE_ENGLISH_US, eLoadSysLang, sal_True );
}
}
else
pEntry->ConvertLanguage( *pConverter,
- eSaveSysLang, eLoadSysLang, TRUE );
+ eSaveSysLang, eLoadSysLang, sal_True );
}
else
{ // nicht SYSTEM oder gleiches SYSTEM
if ( nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS )
{
LanguageType eLoadLang;
- BOOL bSystem;
+ sal_Bool bSystem;
if ( eLnge == LANGUAGE_SYSTEM )
{
eLoadLang = eSysLang;
- bSystem = TRUE;
+ bSystem = sal_True;
}
else
{
eLoadLang = eLnge;
- bSystem = FALSE;
+ bSystem = sal_False;
}
switch ( eLoadLang )
{
@@ -854,9 +854,9 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
if ( nVersion >= SV_NUMBERFORMATTER_VERSION_YEAR2000 )
{
aHdr.StartEntry();
- if ( aHdr.BytesLeft() >= sizeof(UINT16) )
+ if ( aHdr.BytesLeft() >= sizeof(sal_uInt16) )
{
- UINT16 nY2k;
+ sal_uInt16 nY2k;
rStream >> nY2k;
if ( nVersion < SV_NUMBERFORMATTER_VERSION_TWODIGITYEAR && nY2k < 100 )
nY2k += 1901; // war vor src513e: 29, jetzt: 1930
@@ -873,28 +873,28 @@ BOOL SvNumberFormatter::Load( SvStream& rStream )
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
SvUShorts aList;
GetUsedLanguages( aList );
- USHORT nCount = aList.Count();
- for ( USHORT j=0; j<nCount; j++ )
+ sal_uInt16 nCount = aList.Count();
+ for ( sal_uInt16 j=0; j<nCount; j++ )
{
LanguageType eLang = aList[j];
ChangeIntl( eLang );
sal_uInt32 CLOffset = ImpGetCLOffset( eLang );
- ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, TRUE );
+ ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_True );
}
ChangeIntl( eOldLanguage );
if (rStream.GetError())
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
-BOOL SvNumberFormatter::Save( SvStream& rStream ) const
+sal_Bool SvNumberFormatter::Save( SvStream& rStream ) const
{
ImpSvNumMultipleWriteHeader aHdr( rStream );
// ab 364i wird gespeichert was SYSTEM wirklich war, vorher hart LANGUAGE_SYSTEM
- rStream << (USHORT) SV_NUMBERFORMATTER_VERSION;
- rStream << (USHORT) SvtSysLocale().GetLanguage() << (USHORT) IniLnge;
+ rStream << (sal_uInt16) SV_NUMBERFORMATTER_VERSION;
+ rStream << (sal_uInt16) SvtSysLocale().GetLanguage() << (sal_uInt16) IniLnge;
SvNumberFormatTable* pTable = (SvNumberFormatTable*) &aFTable;
SvNumberformat* pEntry = (SvNumberformat*) pTable->First();
while (pEntry)
@@ -907,8 +907,8 @@ BOOL SvNumberFormatter::Save( SvStream& rStream ) const
(pTable->GetCurKey() % SV_COUNTRY_LANGUAGE_OFFSET == 0) )
{
rStream << static_cast<sal_uInt32>(pTable->GetCurKey())
- << (USHORT) LANGUAGE_SYSTEM
- << (USHORT) pEntry->GetLanguage();
+ << (sal_uInt16) LANGUAGE_SYSTEM
+ << (sal_uInt16) pEntry->GetLanguage();
pEntry->Save(rStream, aHdr);
}
pEntry = (SvNumberformat*) pTable->Next();
@@ -917,13 +917,13 @@ BOOL SvNumberFormatter::Save( SvStream& rStream ) const
// ab SV_NUMBERFORMATTER_VERSION_YEAR2000
aHdr.StartEntry();
- rStream << (UINT16) GetYear2000();
+ rStream << (sal_uInt16) GetYear2000();
aHdr.EndEntry();
if (rStream.GetError())
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
// static
@@ -952,14 +952,14 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords,
{
ChangeIntl( eLang );
const String* pTable = pFormatScanner->GetKeywords();
- for ( USHORT i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i )
+ for ( sal_uInt16 i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i )
{
rKeywords[i] = pTable[i];
}
}
-String SvNumberFormatter::GetKeyword( LanguageType eLnge, USHORT nIndex )
+String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex )
{
ChangeIntl(eLnge);
const String* pTable = pFormatScanner->GetKeywords();
@@ -1077,7 +1077,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable(
return GetEntryTable(eTypetmp, FIndex, rLnge);
}
-sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, BOOL bLoadingSO5 )
+sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, sal_Bool bLoadingSO5 )
{
ChangeIntl(eLnge);
sal_uInt32 CLOffset = ImpGetCLOffset(ActLnge);
@@ -1199,7 +1199,7 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable(
return *pFormatTable;
}
-BOOL SvNumberFormatter::IsNumberFormat(const String& sString,
+sal_Bool SvNumberFormatter::IsNumberFormat(const String& sString,
sal_uInt32& F_Index,
double& fOutNumber)
{
@@ -1218,12 +1218,12 @@ BOOL SvNumberFormatter::IsNumberFormat(const String& sString,
FType = NUMBERFORMAT_DEFINED;
ChangeIntl(pFormat->GetLanguage());
}
- BOOL res;
+ sal_Bool res;
short RType = FType;
// Ergebnistyp
// ohne def-Kennung
if (RType == NUMBERFORMAT_TEXT) // Zahlzelle ->Stringz.
- res = FALSE;
+ res = sal_False;
else
res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat);
@@ -1253,13 +1253,13 @@ BOOL SvNumberFormatter::IsNumberFormat(const String& sString,
return res;
}
-BOOL SvNumberFormatter::IsCompatible(short eOldType,
+sal_Bool SvNumberFormatter::IsCompatible(short eOldType,
short eNewType)
{
if (eOldType == eNewType)
- return TRUE;
+ return sal_True;
else if (eOldType == NUMBERFORMAT_DEFINED)
- return TRUE;
+ return sal_True;
else
{
switch (eNewType)
@@ -1274,9 +1274,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType,
case NUMBERFORMAT_FRACTION:
// case NUMBERFORMAT_LOGICAL:
case NUMBERFORMAT_DEFINED:
- return TRUE;
+ return sal_True;
default:
- return FALSE;
+ return sal_False;
}
}
break;
@@ -1285,9 +1285,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType,
switch (eOldType)
{
case NUMBERFORMAT_DATETIME:
- return TRUE;
+ return sal_True;
default:
- return FALSE;
+ return sal_False;
}
}
break;
@@ -1296,9 +1296,9 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType,
switch (eOldType)
{
case NUMBERFORMAT_DATETIME:
- return TRUE;
+ return sal_True;
default:
- return FALSE;
+ return sal_False;
}
}
break;
@@ -1308,16 +1308,16 @@ BOOL SvNumberFormatter::IsCompatible(short eOldType,
{
case NUMBERFORMAT_TIME:
case NUMBERFORMAT_DATE:
- return TRUE;
+ return sal_True;
default:
- return FALSE;
+ return sal_False;
}
}
break;
default:
- return FALSE;
+ return sal_False;
}
- return FALSE;
+ return sal_False;
}
}
@@ -1346,7 +1346,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType )
default:
nSearch = CLOffset + ZF_STANDARD;
}
- sal_uInt32 nDefaultFormat = (sal_uInt32)(sal_uIntPtr) aDefaultFormatKeys.Get( nSearch );
+ sal_uInt32 nDefaultFormat = (sal_uInt32)(sal_uLong) aDefaultFormatKeys.Get( nSearch );
if ( !nDefaultFormat )
nDefaultFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
if ( nDefaultFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
@@ -1430,7 +1430,7 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge
}
}
-BOOL SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex,
+sal_Bool SvNumberFormatter::IsSpecialStandardFormat( sal_uInt32 nFIndex,
LanguageType eLnge )
{
return
@@ -1459,14 +1459,14 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( double fNumber, sal_uInt32 nFIn
{
case NUMBERFORMAT_TIME :
{
- BOOL bSign;
+ sal_Bool bSign;
if ( fNumber < 0.0 )
{
- bSign = TRUE;
+ bSign = sal_True;
fNumber = -fNumber;
}
else
- bSign = FALSE;
+ bSign = sal_False;
double fSeconds = fNumber * 86400;
if ( floor( fSeconds + 0.5 ) * 100 != floor( fSeconds * 100 + 0.5 ) )
{ // mit 100stel Sekunden
@@ -1578,14 +1578,14 @@ void SvNumberFormatter::GetOutputString(String& sString,
}
}
-BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString,
+sal_Bool SvNumberFormatter::GetPreviewString(const String& sFormatString,
double fPreviewNumber,
String& sOutString,
Color** ppColor,
LanguageType eLnge)
{
if (sFormatString.Len() == 0) // keinen Leerstring
- return FALSE;
+ return sal_False;
xub_StrLen nCheckPos = STRING_NOTFOUND;
sal_uInt32 nKey;
@@ -1609,30 +1609,30 @@ BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString,
else
p_Entry->GetOutputString(fPreviewNumber,sOutString, ppColor);
delete p_Entry;
- return TRUE;
+ return sal_True;
}
else
{
delete p_Entry;
- return FALSE;
+ return sal_False;
}
}
-BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
+sal_Bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
double fPreviewNumber,
String& sOutString,
Color** ppColor,
LanguageType eLnge )
{
if (sFormatString.Len() == 0) // keinen Leerstring
- return FALSE;
+ return sal_False;
if (eLnge == LANGUAGE_DONTKNOW)
eLnge = IniLnge;
ChangeIntl( eLnge );
eLnge = ActLnge;
- BOOL bEnglish = (eLnge == LANGUAGE_ENGLISH_US);
+ sal_Bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US);
String aFormatStringUpper( pCharClass->upper( sFormatString ) );
sal_uInt32 nCLOffset = ImpGenerateCL( eLnge );
@@ -1640,7 +1640,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND )
{ // Zielformat vorhanden
GetOutputString( fPreviewNumber, nKey, sOutString, ppColor );
- return TRUE;
+ return sal_True;
}
SvNumberformat *pEntry = NULL;
@@ -1657,7 +1657,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
{
nCLOffset = ImpGenerateCL( LANGUAGE_ENGLISH_US );
nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, LANGUAGE_ENGLISH_US );
- BOOL bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND);
+ sal_Bool bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND);
// try english --> other bzw. english nach other konvertieren
LanguageType eFormatLang = LANGUAGE_ENGLISH_US;
@@ -1665,7 +1665,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
sTmpString = sFormatString;
pEntry = new SvNumberformat( sTmpString, pFormatScanner,
pStringScanner, nCheckPos, eFormatLang );
- pFormatScanner->SetConvertMode( FALSE );
+ pFormatScanner->SetConvertMode( sal_False );
ChangeIntl( eLnge );
if ( !bEnglishFormat )
@@ -1687,7 +1687,7 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
sTmpString = sFormatString;
SvNumberformat* pEntry2 = new SvNumberformat( sTmpString, pFormatScanner,
pStringScanner, nCheckPos2, eFormatLang );
- pFormatScanner->SetConvertMode( FALSE );
+ pFormatScanner->SetConvertMode( sal_False );
ChangeIntl( eLnge );
if ( nCheckPos2 == 0 && !xTransliteration->isEqual( sFormatString,
pEntry2->GetFormatstring() ) )
@@ -1707,20 +1707,20 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString,
ImpGenerateCL( eLnge ); // ggfs. neu Standardformate anlegen
pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor );
delete pEntry;
- return TRUE;
+ return sal_True;
}
delete pEntry;
- return FALSE;
+ return sal_False;
}
-BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString,
+sal_Bool SvNumberFormatter::GetPreviewString( const String& sFormatString,
const String& sPreviewString,
String& sOutString,
Color** ppColor,
LanguageType eLnge )
{
if (sFormatString.Len() == 0) // no empty string
- return FALSE;
+ return sal_False;
xub_StrLen nCheckPos = STRING_NOTFOUND;
sal_uInt32 nKey;
@@ -1756,12 +1756,12 @@ BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString,
}
}
delete p_Entry;
- return TRUE;
+ return sal_True;
}
else
{
delete p_Entry;
- return FALSE;
+ return sal_False;
}
}
@@ -1798,7 +1798,7 @@ sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString,
SvNumberformat* SvNumberFormatter::ImpInsertFormat(
const ::com::sun::star::i18n::NumberFormatCode& rCode,
- sal_uInt32 nPos, BOOL bAfterLoadingSO5, sal_Int16 nOrgIndex )
+ sal_uInt32 nPos, sal_Bool bAfterLoadingSO5, sal_Int16 nOrgIndex )
{
String aCodeStr( rCode.Code );
if ( rCode.Index < NF_INDEX_TABLE_ENTRIES &&
@@ -1806,7 +1806,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
rCode.Index != NF_CURRENCY_1000DEC2_CCC )
{ // strip surrounding [$...] on automatic currency
if ( aCodeStr.SearchAscii( "[$" ) != STRING_NOTFOUND )
- aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, FALSE );
+ aCodeStr = SvNumberformat::StripNewCurrencyDelimiters( aCodeStr, sal_False );
else
{
if (LocaleDataWrapper::areChecksEnabled() &&
@@ -1919,7 +1919,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat(
const ::com::sun::star::i18n::NumberFormatCode& rCode,
- sal_uInt32 nPos, USHORT nVersion, BOOL bAfterLoadingSO5,
+ sal_uInt32 nPos, sal_uInt16 nVersion, sal_Bool bAfterLoadingSO5,
sal_Int16 nOrgIndex )
{
SvNumberformat* pNewFormat = ImpInsertFormat( rCode, nPos,
@@ -1931,10 +1931,10 @@ SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat(
}
void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat,
- BOOL& bThousand,
- BOOL& IsRed,
- USHORT& nPrecision,
- USHORT& nAnzLeading)
+ sal_Bool& bThousand,
+ sal_Bool& IsRed,
+ sal_uInt16& nPrecision,
+ sal_uInt16& nAnzLeading)
{
const SvNumberformat* pFormat = aFTable.Get(nFormat);
@@ -1943,14 +1943,14 @@ void SvNumberFormatter::GetFormatSpecialInfo(sal_uInt32 nFormat,
nPrecision, nAnzLeading);
else
{
- bThousand = FALSE;
- IsRed = FALSE;
+ bThousand = sal_False;
+ IsRed = sal_False;
nPrecision = pFormatScanner->GetStandardPrec();
nAnzLeading = 0;
}
}
-USHORT SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const
+sal_uInt16 SvNumberFormatter::GetFormatPrecision( sal_uInt32 nFormat ) const
{
const SvNumberformat* pFormat = aFTable.Get( nFormat );
if ( pFormat )
@@ -1983,8 +1983,8 @@ String SvNumberFormatter::GetFormatDecimalSep( sal_uInt32 nFormat ) const
sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString,
- BOOL& bThousand, BOOL& IsRed, USHORT& nPrecision,
- USHORT& nAnzLeading, LanguageType eLnge )
+ sal_Bool& bThousand, sal_Bool& IsRed, sal_uInt16& nPrecision,
+ sal_uInt16& nAnzLeading, LanguageType eLnge )
{
xub_StrLen nCheckPos = 0;
@@ -1999,8 +1999,8 @@ sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo( const String& rFormatString,
pFormat->GetFormatSpecialInfo( bThousand, IsRed, nPrecision, nAnzLeading );
else
{
- bThousand = FALSE;
- IsRed = FALSE;
+ bThousand = sal_False;
+ IsRed = sal_False;
nPrecision = pFormatScanner->GetStandardPrec();
nAnzLeading = 0;
}
@@ -2084,7 +2084,7 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex(
sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault(
::com::sun::star::i18n::NumberFormatCode * pFormatArr,
- sal_Int32 nCnt, BOOL bCheckCorrectness )
+ sal_Int32 nCnt, sal_Bool bCheckCorrectness )
{
using namespace ::com::sun::star;
@@ -2190,20 +2190,20 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault(
}
-void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO5 )
+void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadingSO5 )
{
using namespace ::com::sun::star;
if ( !bIndexTableInitialized )
{
- for ( USHORT j=0; j<NF_INDEX_TABLE_ENTRIES; j++ )
+ for ( sal_uInt16 j=0; j<NF_INDEX_TABLE_ENTRIES; j++ )
{
theIndexTable[j] = NUMBERFORMAT_ENTRY_NOT_FOUND;
}
}
- BOOL bOldConvertMode = pFormatScanner->GetConvertMode();
+ sal_Bool bOldConvertMode = pFormatScanner->GetConvertMode();
if (bOldConvertMode)
- pFormatScanner->SetConvertMode(FALSE); // switch off for this function
+ pFormatScanner->SetConvertMode(sal_False); // switch off for this function
NumberFormatCodeWrapper aNumberFormatCode( xServiceManager, GetLocale() );
@@ -2217,7 +2217,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO
// of a category (TLOT:=The Legacy Of Templin), altogether about 20 formats.
// Has to be incremented on each ImpInsertNewStandardformat, new formats
// must be appended, not inserted!
- USHORT nNewExtended = ZF_STANDARD_NEWEXTENDED;
+ sal_uInt16 nNewExtended = ZF_STANDARD_NEWEXTENDED;
// Number
uno::Sequence< i18n::NumberFormatCode > aFormatSeq
@@ -2369,7 +2369,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO
pNewFormat = ImpInsertFormat( aFormatSeq[nIdx],
CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_CCC, ZF_STANDARD_CURRENCY+4 ));
if ( pNewFormat )
- pNewFormat->SetUsed(TRUE); // must be saved for older versions
+ pNewFormat->SetUsed(sal_True); // must be saved for older versions
aFormatSeq[nIdx].Default = bDefault;
// #.##0,-- since number formatter version 6
@@ -2422,7 +2422,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO
pNewFormat = ImpInsertFormat( aFormatSeq[nIdx],
CLOffset + SetIndexTable( NF_DATE_SYS_DDMMYYYY, ZF_STANDARD_DATE+6 ));
if ( pNewFormat )
- pNewFormat->SetUsed(TRUE); // must be saved for older versions
+ pNewFormat->SetUsed(sal_True); // must be saved for older versions
// DD.MM.YY def/System, since number formatter version 6
nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_DATE_SYS_DDMMYY );
@@ -2621,22 +2621,22 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO
- bIndexTableInitialized = TRUE;
+ bIndexTableInitialized = sal_True;
DBG_ASSERT( nNewExtended <= ZF_STANDARD_NEWEXTENDEDMAX,
"ImpGenerateFormats: overflow of nNewExtended standard formats" );
// Now all additional format codes provided by I18N, but only if not
// loading from old SO5 file format, then they are appended last.
if ( !bLoadingSO5 )
- ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, FALSE );
+ ImpGenerateAdditionalFormats( CLOffset, aNumberFormatCode, sal_False );
if (bOldConvertMode)
- pFormatScanner->SetConvertMode(TRUE);
+ pFormatScanner->SetConvertMode(sal_True);
}
void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
- NumberFormatCodeWrapper& rNumberFormatCode, BOOL bAfterLoadingSO5 )
+ NumberFormatCodeWrapper& rNumberFormatCode, sal_Bool bAfterLoadingSO5 )
{
using namespace ::com::sun::star;
@@ -2691,7 +2691,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
{
pFormatArr = aFormatSeq.getArray();
// don't check ALL
- sal_Int32 nDef = ImpAdjustFormatCodeDefault( pFormatArr, nCodes, FALSE);
+ sal_Int32 nDef = ImpAdjustFormatCodeDefault( pFormatArr, nCodes, sal_False);
// don't have any defaults here
pFormatArr[nDef].Default = sal_False;
for ( j = 0; j < nCodes; j++ )
@@ -2709,7 +2709,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
}
}
- pStdFormat->SetLastInsertKey( (USHORT)(nPos - CLOffset) );
+ pStdFormat->SetLastInsertKey( (sal_uInt16)(nPos - CLOffset) );
}
@@ -2728,15 +2728,15 @@ void SvNumberFormatter::ImpGetNegCurrFormat( String& sNegStr, const String& rCur
void SvNumberFormatter::GenerateFormat(String& sString,
sal_uInt32 nIndex,
LanguageType eLnge,
- BOOL bThousand,
- BOOL IsRed,
- USHORT nPrecision,
- USHORT nAnzLeading)
+ sal_Bool bThousand,
+ sal_Bool IsRed,
+ sal_uInt16 nPrecision,
+ sal_uInt16 nAnzLeading)
{
if (eLnge == LANGUAGE_DONTKNOW)
eLnge = IniLnge;
short eType = GetType(nIndex);
- USHORT i;
+ sal_uInt16 i;
ImpGenerateCL(eLnge); // ggfs. neu Standard-
// formate anlegen
sString.Erase();
@@ -2746,7 +2746,7 @@ void SvNumberFormatter::GenerateFormat(String& sString,
const String& rThSep = GetNumThousandSep();
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex);
- BOOL insertBrackets = pFormat->IsNegativeInBracket();
+ sal_Bool insertBrackets = pFormat->IsNegativeInBracket();
if (nAnzLeading == 0)
{
@@ -2792,15 +2792,15 @@ void SvNumberFormatter::GenerateFormat(String& sString,
String sNegStr = sString;
String aCurr;
const NfCurrencyEntry* pEntry;
- BOOL bBank;
+ sal_Bool bBank;
if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
{
if ( pEntry )
{
- USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ sal_uInt16 nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
xLocaleData->getCurrPositiveFormat(),
pEntry->GetPositiveFormat(), bBank );
- USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ sal_uInt16 nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
xLocaleData->getCurrNegativeFormat(),
pEntry->GetNegativeFormat(), bBank );
pEntry->CompletePositiveFormatString( sString, bBank,
@@ -2810,12 +2810,12 @@ void SvNumberFormatter::GenerateFormat(String& sString,
}
else
{ // assume currency abbreviation (AKA banking symbol), not symbol
- USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ sal_uInt16 nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
xLocaleData->getCurrPositiveFormat(),
- xLocaleData->getCurrPositiveFormat(), TRUE );
- USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ xLocaleData->getCurrPositiveFormat(), sal_True );
+ sal_uInt16 nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
xLocaleData->getCurrNegativeFormat(),
- xLocaleData->getCurrNegativeFormat(), TRUE );
+ xLocaleData->getCurrNegativeFormat(), sal_True );
NfCurrencyEntry::CompletePositiveFormatString( sString, aCurr,
nPosiForm );
NfCurrencyEntry::CompleteNegativeFormatString( sNegStr, aCurr,
@@ -2873,7 +2873,7 @@ void SvNumberFormatter::GenerateFormat(String& sString,
}
}
-BOOL SvNumberFormatter::IsUserDefined(const String& sStr,
+sal_Bool SvNumberFormatter::IsUserDefined(const String& sStr,
LanguageType eLnge)
{
if (eLnge == LANGUAGE_DONTKNOW)
@@ -2883,11 +2883,11 @@ BOOL SvNumberFormatter::IsUserDefined(const String& sStr,
eLnge = ActLnge;
sal_uInt32 nKey = ImpIsEntry(sStr, CLOffset, eLnge);
if (nKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
- return TRUE;
+ return sal_True;
SvNumberformat* pEntry = aFTable.Get(nKey);
if ( pEntry && ((pEntry->GetType() & NUMBERFORMAT_DEFINED) != 0) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
sal_uInt32 SvNumberFormatter::GetEntryKey(const String& sStr,
@@ -2995,7 +2995,7 @@ SvNumberFormatterIndexTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter
else if (!aFTable.Insert(nNewKey, pNewEntry))
delete pNewEntry;
else
- pStdFormat->SetLastInsertKey((USHORT) (nNewKey - nCLOffset));
+ pStdFormat->SetLastInsertKey((sal_uInt16) (nNewKey - nCLOffset));
}
if (nNewKey != nOldKey) // neuer Index
{
@@ -3059,7 +3059,7 @@ NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset( sal_uInt32 nFormat )
sal_uInt32 nOffset = nFormat % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
if ( nOffset > SV_MAX_ANZ_STANDARD_FORMATE )
return NF_INDEX_TABLE_ENTRIES; // kein eingebautes Format
- for ( USHORT j = 0; j < NF_INDEX_TABLE_ENTRIES; j++ )
+ for ( sal_uInt16 j = 0; j < NF_INDEX_TABLE_ENTRIES; j++ )
{
if ( theIndexTable[j] == nOffset )
return (NfIndexTableOffset) j;
@@ -3068,19 +3068,19 @@ NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset( sal_uInt32 nFormat )
}
-void SvNumberFormatter::SetYear2000( USHORT nVal )
+void SvNumberFormatter::SetYear2000( sal_uInt16 nVal )
{
pStringScanner->SetYear2000( nVal );
}
-USHORT SvNumberFormatter::GetYear2000() const
+sal_uInt16 SvNumberFormatter::GetYear2000() const
{
return pStringScanner->GetYear2000();
}
-USHORT SvNumberFormatter::ExpandTwoDigitYear( USHORT nYear ) const
+sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( sal_uInt16 nYear ) const
{
if ( nYear < 100 )
return SvNumberFormatter::ExpandTwoDigitYear( nYear,
@@ -3090,9 +3090,9 @@ USHORT SvNumberFormatter::ExpandTwoDigitYear( USHORT nYear ) const
// static
-USHORT SvNumberFormatter::GetYear2000Default()
+sal_uInt16 SvNumberFormatter::GetYear2000Default()
{
- return (USHORT) ::utl::MiscCfg().GetYear2000();
+ return (sal_uInt16) ::utl::MiscCfg().GetYear2000();
}
@@ -3127,9 +3127,9 @@ const NfCurrencyEntry& SvNumberFormatter::GetCurrencyEntry( LanguageType eLang )
{
eLang = MsLangId::getRealLanguage( eLang );
const NfCurrencyTable& rTable = GetTheCurrencyTable();
- USHORT nCount = rTable.Count();
+ sal_uInt16 nCount = rTable.Count();
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount; j++, ppData++ )
{
if ( (*ppData)->GetLanguage() == eLang )
return **ppData;
@@ -3145,9 +3145,9 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry(
{
eLang = MsLangId::getRealLanguage( eLang );
const NfCurrencyTable& rTable = GetTheCurrencyTable();
- USHORT nCount = rTable.Count();
+ sal_uInt16 nCount = rTable.Count();
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount; j++, ppData++ )
{
if ( (*ppData)->GetLanguage() == eLang &&
(*ppData)->GetBankSymbol() == rAbbrev )
@@ -3164,9 +3164,9 @@ const NfCurrencyEntry* SvNumberFormatter::GetLegacyOnlyCurrencyEntry(
if (!bCurrencyTableInitialized)
GetTheCurrencyTable(); // just for initialization
const NfCurrencyTable& rTable = theLegacyOnlyCurrencyTable::get();
- USHORT nCount = rTable.Count();
+ sal_uInt16 nCount = rTable.Count();
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount; j++, ppData++ )
{
if ( (*ppData)->GetSymbol() == rSymbol &&
(*ppData)->GetBankSymbol() == rAbbrev )
@@ -3195,11 +3195,11 @@ void SvNumberFormatter::SetDefaultSystemCurrency( const String& rAbbrev, Languag
if ( eLang == LANGUAGE_SYSTEM )
eLang = SvtSysLocale().GetLanguage();
const NfCurrencyTable& rTable = GetTheCurrencyTable();
- USHORT nCount = rTable.Count();
+ sal_uInt16 nCount = rTable.Count();
const NfCurrencyEntryPtr* ppData = rTable.GetData();
if ( rAbbrev.Len() )
{
- for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount; j++, ppData++ )
{
if ( (*ppData)->GetLanguage() == eLang && (*ppData)->GetBankSymbol() == rAbbrev )
{
@@ -3210,7 +3210,7 @@ void SvNumberFormatter::SetDefaultSystemCurrency( const String& rAbbrev, Languag
}
else
{
- for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount; j++, ppData++ )
{
if ( (*ppData)->GetLanguage() == eLang )
{
@@ -3236,8 +3236,8 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultSystemCurrencyFormat()
xub_StrLen nCheck;
short nType;
NfWSStringsDtor aCurrList;
- USHORT nDefault = GetCurrencyFormatStrings( aCurrList,
- GetCurrencyEntry( LANGUAGE_SYSTEM ), FALSE );
+ sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList,
+ GetCurrencyEntry( LANGUAGE_SYSTEM ), sal_False );
DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency System standard format?!?" );
// if already loaded or user defined nDefaultSystemCurrencyFormat
// will be set to the right value
@@ -3255,7 +3255,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat()
{
sal_uInt32 CLOffset = ImpGetCLOffset( ActLnge );
sal_uInt32 nDefaultCurrencyFormat =
- (sal_uInt32)(sal_uIntPtr) aDefaultFormatKeys.Get( CLOffset + ZF_STANDARD_CURRENCY );
+ (sal_uInt32)(sal_uLong) aDefaultFormatKeys.Get( CLOffset + ZF_STANDARD_CURRENCY );
if ( !nDefaultCurrencyFormat )
nDefaultCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
if ( nDefaultCurrencyFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
@@ -3281,8 +3281,8 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat()
xub_StrLen nCheck;
short nType;
NfWSStringsDtor aCurrList;
- USHORT nDefault = GetCurrencyFormatStrings( aCurrList,
- GetCurrencyEntry( ActLnge ), FALSE );
+ sal_uInt16 nDefault = GetCurrencyFormatStrings( aCurrList,
+ GetCurrencyEntry( ActLnge ), sal_False );
DBG_ASSERT( aCurrList.Count(), "where is the NewCurrency standard format?" );
if ( aCurrList.Count() )
{
@@ -3314,39 +3314,39 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat()
// static
// try to make it inline if possible since this a loop body
-// TRUE: continue; FALSE: break loop, if pFoundEntry==NULL dupe found
+// sal_True: continue; sal_False: break loop, if pFoundEntry==NULL dupe found
#ifndef DBG_UTIL
inline
#endif
- BOOL SvNumberFormatter::ImpLookupCurrencyEntryLoopBody(
- const NfCurrencyEntry*& pFoundEntry, BOOL& bFoundBank,
- const NfCurrencyEntry* pData, USHORT nPos, const String& rSymbol )
+ sal_Bool SvNumberFormatter::ImpLookupCurrencyEntryLoopBody(
+ const NfCurrencyEntry*& pFoundEntry, sal_Bool& bFoundBank,
+ const NfCurrencyEntry* pData, sal_uInt16 nPos, const String& rSymbol )
{
- BOOL bFound;
+ sal_Bool bFound;
if ( pData->GetSymbol() == rSymbol )
{
- bFound = TRUE;
- bFoundBank = FALSE;
+ bFound = sal_True;
+ bFoundBank = sal_False;
}
else if ( pData->GetBankSymbol() == rSymbol )
{
- bFound = TRUE;
- bFoundBank = TRUE;
+ bFound = sal_True;
+ bFoundBank = sal_True;
}
else
- bFound = FALSE;
+ bFound = sal_False;
if ( bFound )
{
if ( pFoundEntry && pFoundEntry != pData )
{
pFoundEntry = NULL;
- return FALSE; // break loop, not unique
+ return sal_False; // break loop, not unique
}
if ( nPos == 0 )
{ // first entry is SYSTEM
pFoundEntry = MatchSystemCurrency();
if ( pFoundEntry )
- return FALSE; // break loop
+ return sal_False; // break loop
// even if there are more matching entries
// this one is propably the one we are looking for
else
@@ -3355,19 +3355,19 @@ inline
else
pFoundEntry = pData;
}
- return TRUE;
+ return sal_True;
}
-BOOL SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
+sal_Bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
String& rStr, const NfCurrencyEntry** ppEntry /* = NULL */,
- BOOL* pBank /* = NULL */ ) const
+ sal_Bool* pBank /* = NULL */ ) const
{
rStr.Erase();
if ( ppEntry )
*ppEntry = NULL;
if ( pBank )
- *pBank = FALSE;
+ *pBank = sal_False;
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get( nFormat );
if ( pFormat )
{
@@ -3376,11 +3376,11 @@ BOOL SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
{
if ( ppEntry )
{
- BOOL bFoundBank = FALSE;
+ sal_Bool bFoundBank = sal_False;
// we definiteley need an entry matching the format code string
const NfCurrencyEntry* pFoundEntry = GetCurrencyEntry(
bFoundBank, aSymbol, aExtension, pFormat->GetLanguage(),
- TRUE );
+ sal_True );
if ( pFoundEntry )
{
*ppEntry = pFoundEntry;
@@ -3406,17 +3406,17 @@ BOOL SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
rStr += aExtension;
rStr += ']';
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// static
-const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( BOOL & bFoundBank,
+const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( sal_Bool & bFoundBank,
const String& rSymbol, const String& rExtension,
- LanguageType eFormatLanguage, BOOL bOnlyStringLanguage )
+ LanguageType eFormatLanguage, sal_Bool bOnlyStringLanguage )
{
xub_StrLen nExtLen = rExtension.Len();
LanguageType eExtLang;
@@ -3433,14 +3433,14 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( BOOL & bFoundBank,
eExtLang = LANGUAGE_DONTKNOW;
const NfCurrencyEntry* pFoundEntry = NULL;
const NfCurrencyTable& rTable = GetTheCurrencyTable();
- USHORT nCount = rTable.Count();
- BOOL bCont = TRUE;
+ sal_uInt16 nCount = rTable.Count();
+ sal_Bool bCont = sal_True;
// first try with given extension language/country
if ( nExtLen )
{
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount && bCont; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount && bCont; j++, ppData++ )
{
LanguageType eLang = (*ppData)->GetLanguage();
if ( eLang == eExtLang ||
@@ -3462,7 +3462,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( BOOL & bFoundBank,
{
// now try the language/country of the number format
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount && bCont; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount && bCont; j++, ppData++ )
{
LanguageType eLang = (*ppData)->GetLanguage();
if ( eLang == eFormatLanguage ||
@@ -3484,7 +3484,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetCurrencyEntry( BOOL & bFoundBank,
if ( !nExtLen )
{
const NfCurrencyEntryPtr* ppData = rTable.GetData();
- for ( USHORT j = 0; j < nCount && bCont; j++, ppData++ )
+ for ( sal_uInt16 j = 0; j < nCount && bCont; j++, ppData++ )
{
bCont = ImpLookupCurrencyEntryLoopBody( pFoundEntry, bFoundBank,
*ppData, j, rSymbol );
@@ -3633,10 +3633,10 @@ void SvNumberFormatter::ImpInitCurrencyTable()
// ::osl::MutexGuard aGuard( GetMutex() );
// while ( !bCurrencyTableInitialized )
// ImpInitCurrencyTable();
- static BOOL bInitializing = FALSE;
+ static sal_Bool bInitializing = sal_False;
if ( bCurrencyTableInitialized || bInitializing )
return ;
- bInitializing = TRUE;
+ bInitializing = sal_True;
RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svl", "er93726", "SvNumberFormatter::ImpInitCurrencyTable" );
@@ -3649,14 +3649,14 @@ void SvNumberFormatter::ImpInitCurrencyTable()
LanguageType eConfiguredCurrencyLanguage = LANGUAGE_SYSTEM;
SvtSysLocaleOptions().GetCurrencyAbbrevAndLanguage(
aConfiguredCurrencyAbbrev, eConfiguredCurrencyLanguage );
- USHORT nSecondarySystemCurrencyPosition = 0;
- USHORT nMatchingSystemCurrencyPosition = 0;
+ sal_uInt16 nSecondarySystemCurrencyPosition = 0;
+ sal_uInt16 nMatchingSystemCurrencyPosition = 0;
NfCurrencyEntryPtr pEntry;
// first entry is SYSTEM
pEntry = new NfCurrencyEntry( *pLocaleData, LANGUAGE_SYSTEM );
theCurrencyTable::get().Insert( pEntry, 0 );
- USHORT nCurrencyPos = 1;
+ sal_uInt16 nCurrencyPos = 1;
::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > xLoc =
LocaleDataWrapper::getInstalledLocaleNames();
@@ -3665,7 +3665,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
Locale const * const pLocales = xLoc.getConstArray();
NfCurrencyTable &rCurrencyTable = theCurrencyTable::get();
NfCurrencyTable &rLegacyOnlyCurrencyTable = theLegacyOnlyCurrencyTable::get();
- USHORT nLegacyOnlyCurrencyPos = 0;
+ sal_uInt16 nLegacyOnlyCurrencyPos = 0;
for ( sal_Int32 nLocale = 0; nLocale < nLocaleCount; nLocale++ )
{
LanguageType eLang = MsLangId::convertLocaleToLanguage(
@@ -3673,8 +3673,8 @@ void SvNumberFormatter::ImpInitCurrencyTable()
#if OSL_DEBUG_LEVEL > 1
LanguageType eReal = MsLangId::getRealLanguage( eLang );
if ( eReal != eLang ) {
- BOOL bBreak;
- bBreak = TRUE;
+ sal_Bool bBreak;
+ bBreak = sal_True;
}
#endif
pLocaleData->setLocale( pLocales[nLocale] );
@@ -3700,7 +3700,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
rCurrencyTable.Insert( pEntry, nCurrencyPos++ );
if ( !nSystemCurrencyPosition && (aConfiguredCurrencyAbbrev.Len() ?
pEntry->GetBankSymbol() == aConfiguredCurrencyAbbrev &&
- pEntry->GetLanguage() == eConfiguredCurrencyLanguage : FALSE) )
+ pEntry->GetLanguage() == eConfiguredCurrencyLanguage : sal_False) )
nSystemCurrencyPosition = nCurrencyPos-1;
if ( !nMatchingSystemCurrencyPosition &&
pEntry->GetLanguage() == eSysLang )
@@ -3721,15 +3721,15 @@ void SvNumberFormatter::ImpInitCurrencyTable()
{
pEntry = new NfCurrencyEntry( pCurrencies[nCurrency], *pLocaleData, eLang );
// no dupes
- BOOL bInsert = TRUE;
+ sal_Bool bInsert = sal_True;
NfCurrencyEntry const * const * pData = rCurrencyTable.GetData();
- USHORT n = rCurrencyTable.Count();
+ sal_uInt16 n = rCurrencyTable.Count();
pData++; // skip first SYSTEM entry
- for ( USHORT j=1; j<n; j++ )
+ for ( sal_uInt16 j=1; j<n; j++ )
{
if ( *(*pData++) == *pEntry )
{
- bInsert = FALSE;
+ bInsert = sal_False;
break; // for
}
}
@@ -3767,20 +3767,20 @@ void SvNumberFormatter::ImpInitCurrencyTable()
delete pLocaleData;
SvtSysLocaleOptions::SetCurrencyChangeLink(
STATIC_LINK( NULL, SvNumberFormatter, CurrencyChangeLink ) );
- bInitializing = FALSE;
- bCurrencyTableInitialized = TRUE;
+ bInitializing = sal_False;
+ bCurrencyTableInitialized = sal_True;
}
-USHORT SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr,
- const NfCurrencyEntry& rCurr, BOOL bBank ) const
+sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr,
+ const NfCurrencyEntry& rCurr, sal_Bool bBank ) const
{
- USHORT nDefault = 0;
+ sal_uInt16 nDefault = 0;
if ( bBank )
{ // nur Bankensymbole
String aPositiveBank, aNegativeBank;
- rCurr.BuildPositiveFormatString( aPositiveBank, TRUE, *xLocaleData, 1 );
- rCurr.BuildNegativeFormatString( aNegativeBank, TRUE, *xLocaleData, 1 );
+ rCurr.BuildPositiveFormatString( aPositiveBank, sal_True, *xLocaleData, 1 );
+ rCurr.BuildNegativeFormatString( aNegativeBank, sal_True, *xLocaleData, 1 );
WSStringPtr pFormat1 = new String( aPositiveBank );
*pFormat1 += ';';
@@ -3810,14 +3810,14 @@ USHORT SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr,
aRed += pFormatScanner->GetRedString();
aRed += ']';
- rCurr.BuildPositiveFormatString( aPositive, FALSE, *xLocaleData, 1 );
- rCurr.BuildNegativeFormatString( aNegative, FALSE, *xLocaleData, 1 );
+ rCurr.BuildPositiveFormatString( aPositive, sal_False, *xLocaleData, 1 );
+ rCurr.BuildNegativeFormatString( aNegative, sal_False, *xLocaleData, 1 );
if ( rCurr.GetDigits() )
{
- rCurr.BuildPositiveFormatString( aPositiveNoDec, FALSE, *xLocaleData, 0 );
- rCurr.BuildNegativeFormatString( aNegativeNoDec, FALSE, *xLocaleData, 0 );
- rCurr.BuildPositiveFormatString( aPositiveDashed, FALSE, *xLocaleData, 2 );
- rCurr.BuildNegativeFormatString( aNegativeDashed, FALSE, *xLocaleData, 2 );
+ rCurr.BuildPositiveFormatString( aPositiveNoDec, sal_False, *xLocaleData, 0 );
+ rCurr.BuildNegativeFormatString( aNegativeNoDec, sal_False, *xLocaleData, 0 );
+ rCurr.BuildPositiveFormatString( aPositiveDashed, sal_False, *xLocaleData, 2 );
+ rCurr.BuildNegativeFormatString( aNegativeDashed, sal_False, *xLocaleData, 2 );
pFormat1 = new String( aPositiveNoDec );
*pFormat1 += ';';
@@ -3900,7 +3900,7 @@ NfCurrencyEntry::NfCurrencyEntry( const ::com::sun::star::i18n::Currency & rCurr
}
-BOOL NfCurrencyEntry::operator==( const NfCurrencyEntry& r ) const
+sal_Bool NfCurrencyEntry::operator==( const NfCurrencyEntry& r ) const
{
return aSymbol == r.aSymbol
&& aBankSymbol == r.aBankSymbol
@@ -3921,10 +3921,10 @@ void NfCurrencyEntry::SetEuro()
}
-BOOL NfCurrencyEntry::IsEuro() const
+sal_Bool NfCurrencyEntry::IsEuro() const
{
if ( aBankSymbol.EqualsAscii( "EUR" ) )
- return TRUE;
+ return sal_True;
String aEuro( NfCurrencyEntry::GetEuroSymbol() );
return aSymbol == aEuro;
}
@@ -3938,8 +3938,8 @@ void NfCurrencyEntry::ApplyVariableInformation( const NfCurrencyEntry& r )
}
-void NfCurrencyEntry::BuildSymbolString( String& rStr, BOOL bBank,
- BOOL bWithoutExtension ) const
+void NfCurrencyEntry::BuildSymbolString( String& rStr, sal_Bool bBank,
+ sal_Bool bWithoutExtension ) const
{
rStr = '[';
rStr += '$';
@@ -3966,7 +3966,7 @@ void NfCurrencyEntry::BuildSymbolString( String& rStr, BOOL bBank,
void NfCurrencyEntry::Impl_BuildFormatStringNumChars( String& rStr,
- const LocaleDataWrapper& rLoc, USHORT nDecimalFormat ) const
+ const LocaleDataWrapper& rLoc, sal_uInt16 nDecimalFormat ) const
{
rStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "###0" ) );
rStr.Insert( rLoc.getNumThousandSep(), 1 );
@@ -3978,28 +3978,28 @@ void NfCurrencyEntry::Impl_BuildFormatStringNumChars( String& rStr,
}
-void NfCurrencyEntry::BuildPositiveFormatString( String& rStr, BOOL bBank,
- const LocaleDataWrapper& rLoc, USHORT nDecimalFormat ) const
+void NfCurrencyEntry::BuildPositiveFormatString( String& rStr, sal_Bool bBank,
+ const LocaleDataWrapper& rLoc, sal_uInt16 nDecimalFormat ) const
{
Impl_BuildFormatStringNumChars( rStr, rLoc, nDecimalFormat );
- USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ sal_uInt16 nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
rLoc.getCurrPositiveFormat(), nPositiveFormat, bBank );
CompletePositiveFormatString( rStr, bBank, nPosiForm );
}
-void NfCurrencyEntry::BuildNegativeFormatString( String& rStr, BOOL bBank,
- const LocaleDataWrapper& rLoc, USHORT nDecimalFormat ) const
+void NfCurrencyEntry::BuildNegativeFormatString( String& rStr, sal_Bool bBank,
+ const LocaleDataWrapper& rLoc, sal_uInt16 nDecimalFormat ) const
{
Impl_BuildFormatStringNumChars( rStr, rLoc, nDecimalFormat );
- USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ sal_uInt16 nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
rLoc.getCurrNegativeFormat(), nNegativeFormat, bBank );
CompleteNegativeFormatString( rStr, bBank, nNegaForm );
}
-void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, BOOL bBank,
- USHORT nPosiForm ) const
+void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, sal_Bool bBank,
+ sal_uInt16 nPosiForm ) const
{
String aSymStr;
BuildSymbolString( aSymStr, bBank );
@@ -4007,8 +4007,8 @@ void NfCurrencyEntry::CompletePositiveFormatString( String& rStr, BOOL bBank,
}
-void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, BOOL bBank,
- USHORT nNegaForm ) const
+void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, sal_Bool bBank,
+ sal_uInt16 nNegaForm ) const
{
String aSymStr;
BuildSymbolString( aSymStr, bBank );
@@ -4018,7 +4018,7 @@ void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr, BOOL bBank,
// static
void NfCurrencyEntry::CompletePositiveFormatString( String& rStr,
- const String& rSymStr, USHORT nPositiveFormat )
+ const String& rSymStr, sal_uInt16 nPositiveFormat )
{
switch( nPositiveFormat )
{
@@ -4049,7 +4049,7 @@ void NfCurrencyEntry::CompletePositiveFormatString( String& rStr,
// static
void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr,
- const String& rSymStr, USHORT nNegativeFormat )
+ const String& rSymStr, sal_uInt16 nNegativeFormat )
{
switch( nNegativeFormat )
{
@@ -4170,11 +4170,11 @@ void NfCurrencyEntry::CompleteNegativeFormatString( String& rStr,
// static
-USHORT NfCurrencyEntry::GetEffectivePositiveFormat( USHORT
+sal_uInt16 NfCurrencyEntry::GetEffectivePositiveFormat( sal_uInt16
#if ! NF_BANKSYMBOL_FIX_POSITION
nIntlFormat
#endif
- , USHORT nCurrFormat, BOOL bBank )
+ , sal_uInt16 nCurrFormat, sal_Bool bBank )
{
if ( bBank )
{
@@ -4206,7 +4206,7 @@ USHORT NfCurrencyEntry::GetEffectivePositiveFormat( USHORT
// nur aufrufen, wenn nCurrFormat wirklich mit Klammern ist
-USHORT lcl_MergeNegativeParenthesisFormat( USHORT nIntlFormat, USHORT nCurrFormat )
+sal_uInt16 lcl_MergeNegativeParenthesisFormat( sal_uInt16 nIntlFormat, sal_uInt16 nCurrFormat )
{
short nSign = 0; // -1:=Klammer 0:=links, 1:=mitte, 2:=rechts
switch ( nIntlFormat )
@@ -4291,8 +4291,8 @@ USHORT lcl_MergeNegativeParenthesisFormat( USHORT nIntlFormat, USHORT nCurrForma
// static
-USHORT NfCurrencyEntry::GetEffectiveNegativeFormat( USHORT nIntlFormat,
- USHORT nCurrFormat, BOOL bBank )
+sal_uInt16 NfCurrencyEntry::GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat,
+ sal_uInt16 nCurrFormat, sal_Bool bBank )
{
if ( bBank )
{
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index be6077fe3a70..579c494424b8 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -48,13 +48,13 @@
#define _ZFORMAT_CXX
#include <svl/zformat.hxx>
-#include "zforscan.hxx"
+#include <zforscan.hxx>
#include "zforfind.hxx"
#include <svl/zforlist.hxx>
#include "numhead.hxx"
#include <unotools/digitgroupingiterator.hxx>
-#include "nfsymbol.hxx"
+#include <svl/nfsymbol.hxx>
#include <cmath>
@@ -77,13 +77,13 @@ const double EXP_LOWER_BOUND = 1.0E-4; // prefer scientific notation below this
const double _D_MAX_U_LONG_ = (double) 0xffffffff; // 4294967295.0
const double _D_MAX_LONG_ = (double) 0x7fffffff; // 2147483647.0
-const USHORT _MAX_FRACTION_PREC = 3;
+const sal_uInt16 _MAX_FRACTION_PREC = 3;
const double D_EPS = 1.0E-2;
const double _D_MAX_D_BY_100 = 1.7E306;
const double _D_MIN_M_BY_1000 = 2.3E-305;
-static BYTE cCharWidths[ 128-32 ] = {
+static sal_uInt8 cCharWidths[ 128-32 ] = {
1,1,1,2,2,3,2,1,1,1,1,2,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,
3,2,2,2,2,2,2,3,2,1,2,2,2,3,3,3,
@@ -97,7 +97,7 @@ xub_StrLen SvNumberformat::InsertBlanks( String& r, xub_StrLen nPos, sal_Unicode
{
if( c >= 32 )
{
- USHORT n = 2; // Default fuer Zeichen > 128 (HACK!)
+ sal_uInt16 n = 2; // Default fuer Zeichen > 128 (HACK!)
if( c <= 127 )
n = cCharWidths[ c - 32 ];
while( n-- )
@@ -130,15 +130,15 @@ static long GetPrecExp( double fAbsVal )
}
}
-const USHORT nNewCurrencyVersionId = 0x434E; // "NC"
+const sal_uInt16 nNewCurrencyVersionId = 0x434E; // "NC"
const sal_Unicode cNewCurrencyMagic = 0x01; // Magic for format code in comment
-const USHORT nNewStandardFlagVersionId = 0x4653; // "SF"
+const sal_uInt16 nNewStandardFlagVersionId = 0x4653; // "SF"
/***********************Funktion SvNumberformatInfo******************************/
-void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz )
+void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz )
{
- for (USHORT i = 0; i < nAnz; i++)
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
sStrArray[i] = rNumFor.sStrArray[i];
nTypeArray[i] = rNumFor.nTypeArray[i];
@@ -151,9 +151,9 @@ void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, USHORT n
nCntExp = rNumFor.nCntExp;
}
-void ImpSvNumberformatInfo::Save(SvStream& rStream, USHORT nAnz) const
+void ImpSvNumberformatInfo::Save(SvStream& rStream, sal_uInt16 nAnz) const
{
- for (USHORT i = 0; i < nAnz; i++)
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
rStream.WriteByteString( sStrArray[i], rStream.GetStreamCharSet() );
short nType = nTypeArray[i];
@@ -178,9 +178,9 @@ void ImpSvNumberformatInfo::Save(SvStream& rStream, USHORT nAnz) const
<< nCntPre << nCntPost << nCntExp;
}
-void ImpSvNumberformatInfo::Load(SvStream& rStream, USHORT nAnz)
+void ImpSvNumberformatInfo::Load(SvStream& rStream, sal_uInt16 nAnz)
{
- for (USHORT i = 0; i < nAnz; i++)
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
SvNumberformat::LoadString( rStream, sStrArray[i] );
rStream >> nTypeArray[i];
@@ -192,9 +192,9 @@ void ImpSvNumberformatInfo::Load(SvStream& rStream, USHORT nAnz)
//============================================================================
// static
-BYTE SvNumberNatNum::MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate )
+sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate )
{
- BYTE nNatNum = 0;
+ sal_uInt8 nNatNum = 0;
eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc.
eLang &= 0x03FF; // 10 bit primary language
if ( bDate )
@@ -245,9 +245,9 @@ BYTE SvNumberNatNum::MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDa
}
// static
-BYTE SvNumberNatNum::MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate )
+sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate )
{
- BYTE nDBNum = 0;
+ sal_uInt8 nDBNum = 0;
eLang = MsLangId::getRealLanguage( eLang ); // resolve SYSTEM etc.
eLang &= 0x03FF; // 10 bit primary language
if ( bDate )
@@ -331,7 +331,7 @@ ImpSvNumFor::ImpSvNumFor()
aI.nTypeArray = NULL;
aI.sStrArray = NULL;
aI.eScannedType = NUMBERFORMAT_UNDEFINED;
- aI.bThousand = FALSE;
+ aI.bThousand = sal_False;
aI.nThousand = 0;
aI.nCntPre = 0;
aI.nCntPost = 0;
@@ -341,13 +341,13 @@ ImpSvNumFor::ImpSvNumFor()
ImpSvNumFor::~ImpSvNumFor()
{
- for (USHORT i = 0; i < nAnzStrings; i++)
+ for (sal_uInt16 i = 0; i < nAnzStrings; i++)
aI.sStrArray[i].Erase();
delete [] aI.sStrArray;
delete [] aI.nTypeArray;
}
-void ImpSvNumFor::Enlarge(USHORT nAnz)
+void ImpSvNumFor::Enlarge(sal_uInt16 nAnz)
{
if ( nAnzStrings != nAnz )
{
@@ -391,7 +391,7 @@ void ImpSvNumFor::Save(SvStream& rStream) const
void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
String& rLoadedColorName )
{
- USHORT nAnz;
+ sal_uInt16 nAnz;
rStream >> nAnz; //! noch nicht direkt nAnzStrings wg. Enlarge
Enlarge( nAnz );
aI.Load( rStream, nAnz );
@@ -400,20 +400,20 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
pColor = rSc.GetColor(sColorName);
}
-BOOL ImpSvNumFor::HasNewCurrency() const
+sal_Bool ImpSvNumFor::HasNewCurrency() const
{
- for ( USHORT j=0; j<nAnzStrings; j++ )
+ for ( sal_uInt16 j=0; j<nAnzStrings; j++ )
{
if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol,
+sal_Bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol,
String& rExtension ) const
{
- for ( USHORT j=0; j<nAnzStrings; j++ )
+ for ( sal_uInt16 j=0; j<nAnzStrings; j++ )
{
if ( aI.nTypeArray[j] == NF_SYMBOLTYPE_CURRENCY )
{
@@ -422,17 +422,17 @@ BOOL ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol,
rExtension = aI.sStrArray[j+1];
else
rExtension.Erase();
- return TRUE;
+ return sal_True;
}
}
//! kein Erase an rSymbol, rExtension
- return FALSE;
+ return sal_False;
}
void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const
{
- USHORT j;
- USHORT nCnt = 0;
+ sal_uInt16 j;
+ sal_uInt16 nCnt = 0;
for ( j=0; j<nAnzStrings; j++ )
{
switch ( aI.nTypeArray[j] )
@@ -460,11 +460,11 @@ void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const
void ImpSvNumFor::LoadNewCurrencyMap( SvStream& rStream )
{
- USHORT nCnt;
+ sal_uInt16 nCnt;
rStream >> nCnt;
- for ( USHORT j=0; j<nCnt; j++ )
+ for ( sal_uInt16 j=0; j<nCnt; j++ )
{
- USHORT nPos;
+ sal_uInt16 nPos;
short nType;
rStream >> nPos >> nType;
if ( nPos < nAnzStrings )
@@ -515,7 +515,7 @@ SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge )
:
rScan(rSc),
nNewStandardDefined(0),
- bStarFlag( FALSE )
+ bStarFlag( sal_False )
{
maLocale.meLanguage = eLge;
}
@@ -537,7 +537,7 @@ void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat )
// #121103# when copying between documents, get color pointers from own scanner
ImpSvNumberformatScan* pColorSc = ( &rScan != &rFormat.rScan ) ? &rScan : NULL;
- for (USHORT i = 0; i < 4; i++)
+ for (sal_uInt16 i = 0; i < 4; i++)
NumFor[i].Copy(rFormat.NumFor[i], pColorSc);
}
@@ -553,10 +553,10 @@ SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan&
ImpCopyNumberformat( rFormat );
}
-BOOL lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType )
+sal_Bool lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType )
{
if ( nSymbolType > 0 )
- return TRUE; // conditions
+ return sal_True; // conditions
switch ( nSymbolType )
{
case BRACKET_SYMBOLTYPE_COLOR :
@@ -590,9 +590,9 @@ BOOL lcl_SvNumberformat_IsBracketedPrefix( short nSymbolType )
case BRACKET_SYMBOLTYPE_NATNUM17 :
case BRACKET_SYMBOLTYPE_NATNUM18 :
case BRACKET_SYMBOLTYPE_NATNUM19 :
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
SvNumberformat::SvNumberformat(String& rString,
@@ -600,11 +600,11 @@ SvNumberformat::SvNumberformat(String& rString,
ImpSvNumberInputScan* pISc,
xub_StrLen& nCheckPos,
LanguageType& eLan,
- BOOL bStan)
+ sal_Bool bStan)
:
rScan(*pSc),
nNewStandardDefined(0),
- bStarFlag( FALSE )
+ bStarFlag( sal_False )
{
// If the group (AKA thousand) separator is a Non-Breaking Space (French)
// replace all occurrences by a simple space.
@@ -627,15 +627,15 @@ SvNumberformat::SvNumberformat(String& rString,
else
maLocale.meLanguage = eLan;
bStandard = bStan;
- bIsUsed = FALSE;
+ bIsUsed = sal_False;
fLimit1 = 0.0;
fLimit2 = 0.0;
eOp1 = NUMBERFORMAT_OP_NO;
eOp2 = NUMBERFORMAT_OP_NO;
eType = NUMBERFORMAT_DEFINED;
- BOOL bCancel = FALSE;
- BOOL bCondition = FALSE;
+ sal_Bool bCancel = sal_False;
+ sal_Bool bCondition = sal_False;
short eSymbolType;
xub_StrLen nPos = 0;
xub_StrLen nPosOld;
@@ -643,7 +643,7 @@ SvNumberformat::SvNumberformat(String& rString,
String aComment;
// Split into 4 sub formats
- USHORT nIndex;
+ sal_uInt16 nIndex;
for ( nIndex = 0; nIndex < 4 && !bCancel; nIndex++ )
{
// Original language/country may have to be reestablished
@@ -660,14 +660,14 @@ SvNumberformat::SvNumberformat(String& rString,
{
if ( nIndex == 0 && !bCondition )
{
- bCondition = TRUE;
+ bCondition = sal_True;
eOp1 = (SvNumberformatLimitOps) eSymbolType;
}
else if ( nIndex == 1 && bCondition )
eOp2 = (SvNumberformatLimitOps) eSymbolType;
else // error
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
if (!bCancel)
@@ -701,7 +701,7 @@ SvNumberformat::SvNumberformat(String& rString,
nPos++;
else
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPos;
}
}
@@ -715,7 +715,7 @@ SvNumberformat::SvNumberformat(String& rString,
{
if ( NumFor[nIndex].GetColor() != NULL )
{ // error, more than one color
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
else
@@ -724,7 +724,7 @@ SvNumberformat::SvNumberformat(String& rString,
NumFor[nIndex].SetColor( pColor, sStr);
if (pColor == NULL)
{ // error
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
}
@@ -753,16 +753,16 @@ SvNumberformat::SvNumberformat(String& rString,
{
if ( NumFor[nIndex].GetNatNum().IsSet() )
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
else
{
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NatNum" ) );
//! eSymbolType is negative
- BYTE nNum = sal::static_int_cast< BYTE >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0));
+ sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0));
sStr += String::CreateFromInt32( nNum );
- NumFor[nIndex].SetNatNumNum( nNum, FALSE );
+ NumFor[nIndex].SetNatNumNum( nNum, sal_False );
}
}
break;
@@ -778,16 +778,16 @@ SvNumberformat::SvNumberformat(String& rString,
{
if ( NumFor[nIndex].GetNatNum().IsSet() )
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
else
{
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DBNum" ) );
//! eSymbolType is negative
- BYTE nNum = sal::static_int_cast< BYTE >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1));
+ sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1));
sStr += static_cast< sal_Unicode >('0' + nNum);
- NumFor[nIndex].SetNatNumNum( nNum, TRUE );
+ NumFor[nIndex].SetNatNumNum( nNum, sal_True );
}
}
break;
@@ -795,7 +795,7 @@ SvNumberformat::SvNumberformat(String& rString,
{
if ( NumFor[nIndex].GetNatNum().GetLang() != LANGUAGE_DONTKNOW )
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
else
@@ -804,7 +804,7 @@ SvNumberformat::SvNumberformat(String& rString,
maLocale = ImpGetLocaleType( sStr, nTmp );
if (maLocale.meLanguage == LANGUAGE_DONTKNOW)
{
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
else
@@ -845,7 +845,7 @@ SvNumberformat::SvNumberformat(String& rString,
else
{
xub_StrLen nStrPos = pSc->ScanFormat( sStr, aComment );
- USHORT nAnz = pSc->GetAnzResStrings();
+ sal_uInt16 nAnz = pSc->GetAnzResStrings();
if (nAnz == 0) // error
nStrPos = 1;
if (nStrPos == 0) // ok
@@ -857,7 +857,7 @@ SvNumberformat::SvNumberformat(String& rString,
aNat += String::CreateFromInt32( pSc->GetNatNumModifier());
aNat += ']';
sStr.Insert( aNat, 0);
- NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), FALSE );
+ NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), sal_False );
}
// #i53826# #i42727# For the Thai T speciality we need
// to freeze the locale and immunize it against
@@ -910,19 +910,19 @@ SvNumberformat::SvNumberformat(String& rString,
else
{
nCheckPos = nPosOld + nStrPos; // error in string
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
}
}
}
else if (eSymbolType == BRACKET_SYMBOLTYPE_ERROR) // error
{
nCheckPos = nPosOld;
- bCancel = TRUE;
+ bCancel = sal_True;
}
else if ( lcl_SvNumberformat_IsBracketedPrefix( eSymbolType ) )
{
nCheckPos = nPosOld+1; // error, prefix in string
- bCancel = TRUE; // break for
+ bCancel = sal_True; // break for
}
}
if ( bCancel && !nCheckPos )
@@ -941,7 +941,7 @@ SvNumberformat::SvNumberformat(String& rString,
// hides any text. Need the type here for HasTextFormat()
NumFor[3].Info().eScannedType = NUMBERFORMAT_TEXT;
}
- bCancel = TRUE;
+ bCancel = sal_True;
}
if ( NumFor[nIndex].GetNatNum().IsSet() )
NumFor[nIndex].SetNatNumDate(
@@ -957,7 +957,7 @@ SvNumberformat::SvNumberformat(String& rString,
String aTmp;
if ( !pSc->ScanFormat( aAdd, aTmp ) )
{
- USHORT nAnz = pSc->GetAnzResStrings();
+ sal_uInt16 nAnz = pSc->GetAnzResStrings();
if ( nAnz )
{
NumFor[0].Enlarge(nAnz);
@@ -976,7 +976,7 @@ SvNumberformat::SvNumberformat(String& rString,
String aTmp;
if ( !pSc->ScanFormat( aAdd, aTmp ) )
{
- USHORT nAnz = pSc->GetAnzResStrings();
+ sal_uInt16 nAnz = pSc->GetAnzResStrings();
if ( nAnz )
{
NumFor[nIndex].Enlarge(nAnz);
@@ -994,7 +994,7 @@ SvNumberformat::SvNumberformat(String& rString,
String aTmp;
if ( !pSc->ScanFormat( aAdd, aTmp ) )
{
- USHORT nAnz = pSc->GetAnzResStrings();
+ sal_uInt16 nAnz = pSc->GetAnzResStrings();
if ( nAnz )
{
NumFor[nIndex].Enlarge(nAnz);
@@ -1479,12 +1479,12 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
ImpSvNumberInputScan& rISc )
{
rHdr.StartEntry();
- USHORT nOp1, nOp2;
+ sal_uInt16 nOp1, nOp2;
SvNumberformat::LoadString( rStream, sFormatstring );
rStream >> eType >> fLimit1 >> fLimit2
>> nOp1 >> nOp2 >> bStandard >> bIsUsed;
NfHackConversion eHackConversion = NF_CONVERT_NONE;
- BOOL bOldConvert = FALSE;
+ sal_Bool bOldConvert = sal_False;
LanguageType eOldTmpLang = 0;
LanguageType eOldNewLang = 0;
if ( pHackConverter )
@@ -1494,7 +1494,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
eOldNewLang = rScan.GetNewLnge();
}
String aLoadedColorName;
- for (USHORT i = 0; i < 4; i++)
+ for (sal_uInt16 i = 0; i < 4; i++)
{
NumFor[i].Load( rStream, rScan, aLoadedColorName );
if ( pHackConverter && eHackConversion == NF_CONVERT_NONE )
@@ -1540,25 +1540,25 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
}
xub_StrLen nNewCurrencyEnd = STRING_NOTFOUND;
- BOOL bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic &&
+ sal_Bool bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic &&
(nNewCurrencyEnd = aComment.Search( cNewCurrencyMagic, 1 )) != STRING_NOTFOUND );
- BOOL bNewCurrencyLoaded = FALSE;
- BOOL bNewCurrency = FALSE;
+ sal_Bool bNewCurrencyLoaded = sal_False;
+ sal_Bool bNewCurrency = sal_False;
- BOOL bGoOn = TRUE;
+ sal_Bool bGoOn = sal_True;
while ( rHdr.BytesLeft() && bGoOn )
{ // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR
- USHORT nId;
+ sal_uInt16 nId;
rStream >> nId;
switch ( nId )
{
case nNewCurrencyVersionId :
{
- bNewCurrencyLoaded = TRUE;
+ bNewCurrencyLoaded = sal_True;
rStream >> bNewCurrency;
if ( bNewCurrency )
{
- for ( USHORT j=0; j<4; j++ )
+ for ( sal_uInt16 j=0; j<4; j++ )
{
NumFor[j].LoadNewCurrencyMap( rStream );
}
@@ -1570,7 +1570,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
break;
default:
DBG_ERRORFILE( "SvNumberformat::Load: unknown header bytes left nId" );
- bGoOn = FALSE; // stop reading unknown stream left over of newer versions
+ bGoOn = sal_False; // stop reading unknown stream left over of newer versions
// Would be nice to have multiple read/write headers instead
// but old versions wouldn't know it, TLOT.
}
@@ -1592,7 +1592,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
aComment.Erase( 0, nNewCurrencyEnd+1 );
// Zustaende merken
short nDefined = ( eType & NUMBERFORMAT_DEFINED );
- USHORT nNewStandard = nNewStandardDefined;
+ sal_uInt16 nNewStandard = nNewStandardDefined;
// neu parsen etc.
String aStr( sFormatstring );
xub_StrLen nCheckPos = 0;
@@ -1614,11 +1614,11 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
{
case NF_CONVERT_ENGLISH_GERMAN :
ConvertLanguage( *pHackConverter,
- LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, TRUE );
+ LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, sal_True );
break;
case NF_CONVERT_GERMAN_ENGLISH :
ConvertLanguage( *pHackConverter,
- LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, TRUE );
+ LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, sal_True );
break;
default:
DBG_ERRORFILE( "SvNumberformat::Load: eHackConversion unknown" );
@@ -1628,7 +1628,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
}
void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
- LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem )
+ LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem )
{
xub_StrLen nCheckPos;
sal_uInt32 nKey;
@@ -1649,7 +1649,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
if ( bSystem )
maLocale.meLanguage = LANGUAGE_SYSTEM;
// pColor zeigt noch auf Tabelle in temporaerem Formatter/Scanner
- for ( USHORT i = 0; i < 4; i++ )
+ for ( sal_uInt16 i = 0; i < 4; i++ )
{
String aColorName = NumFor[i].GetColorName();
Color* pColor = rScan.GetColor( aColorName );
@@ -1699,7 +1699,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
SetComment( "", aFormatstring, aComment );
#endif
- BOOL bNewCurrency = HasNewCurrency();
+ sal_Bool bNewCurrency = HasNewCurrency();
if ( bNewCurrency )
{ // SV_NUMBERFORMATTER_VERSION_NEW_CURR im Kommentar speichern
aComment.Insert( cNewCurrencyMagic, 0 );
@@ -1710,7 +1710,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
// old SO5 versions do behave strange (no output) if standard flag is set
// on formats not prepared for it (not having the following exact types)
- BOOL bOldStandard = bStandard;
+ sal_Bool bOldStandard = bStandard;
if ( bOldStandard )
{
switch ( eType )
@@ -1724,15 +1724,15 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
// ok to save
break;
default:
- bOldStandard = FALSE;
+ bOldStandard = sal_False;
}
}
rHdr.StartEntry();
rStream.WriteByteString( aFormatstring, rStream.GetStreamCharSet() );
- rStream << eType << fLimit1 << fLimit2 << (USHORT) eOp1 << (USHORT) eOp2
+ rStream << eType << fLimit1 << fLimit2 << (sal_uInt16) eOp1 << (sal_uInt16) eOp2
<< bOldStandard << bIsUsed;
- for (USHORT i = 0; i < 4; i++)
+ for (sal_uInt16 i = 0; i < 4; i++)
NumFor[i].Save(rStream);
// ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD
rStream.WriteByteString( aComment, rStream.GetStreamCharSet() );
@@ -1742,7 +1742,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
rStream << bNewCurrency;
if ( bNewCurrency )
{
- for ( USHORT j=0; j<4; j++ )
+ for ( sal_uInt16 j=0; j<4; j++ )
{
NumFor[j].SaveNewCurrencyMap( rStream );
}
@@ -1758,32 +1758,32 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
rHdr.EndEntry();
}
-BOOL SvNumberformat::HasNewCurrency() const
+sal_Bool SvNumberformat::HasNewCurrency() const
{
- for ( USHORT j=0; j<4; j++ )
+ for ( sal_uInt16 j=0; j<4; j++ )
{
if ( NumFor[j].HasNewCurrency() )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvNumberformat::GetNewCurrencySymbol( String& rSymbol,
+sal_Bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol,
String& rExtension ) const
{
- for ( USHORT j=0; j<4; j++ )
+ for ( sal_uInt16 j=0; j<4; j++ )
{
if ( NumFor[j].GetNewCurrencySymbol( rSymbol, rExtension ) )
- return TRUE;
+ return sal_True;
}
rSymbol.Erase();
rExtension.Erase();
- return FALSE;
+ return sal_False;
}
// static
String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr,
- BOOL bQuoteSymbol )
+ sal_Bool bQuoteSymbol )
{
String aTmp;
xub_StrLen nStartPos, nPos, nLen;
@@ -1832,7 +1832,7 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr,
void SvNumberformat::Build50Formatstring( String& rStr ) const
{
- rStr = StripNewCurrencyDelimiters( sFormatstring, TRUE );
+ rStr = StripNewCurrencyDelimiters( sFormatstring, sal_True );
}
void SvNumberformat::ImpGetOutputStandard(double& fNumber, String& OutString)
@@ -1897,7 +1897,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr
void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString)
{
- BOOL bModified = FALSE;
+ sal_Bool bModified = sal_False;
if ( (eType & NUMBERFORMAT_PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100))
{
if (fNumber == 0.0)
@@ -1906,7 +1906,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString)
return;
}
fNumber *= 100;
- bModified = TRUE;
+ bModified = sal_True;
}
if (fNumber == 0.0)
@@ -1941,12 +1941,12 @@ short SvNumberformat::ImpCheckCondition(double& fNumber,
}
}
-BOOL SvNumberformat::GetOutputString(String& sString,
+sal_Bool SvNumberformat::GetOutputString(String& sString,
String& OutString,
Color** ppColor)
{
OutString.Erase();
- USHORT nIx;
+ sal_uInt16 nIx;
if (eType & NUMBERFORMAT_TEXT)
nIx = 0;
else if (NumFor[3].GetCount() > 0)
@@ -1954,15 +1954,15 @@ BOOL SvNumberformat::GetOutputString(String& sString,
else
{
*ppColor = NULL; // no change of color
- return FALSE;
+ return sal_False;
}
*ppColor = NumFor[nIx].GetColor();
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
if (rInfo.eScannedType == NUMBERFORMAT_TEXT)
{
- BOOL bRes = FALSE;
- const USHORT nAnz = NumFor[nIx].GetCount();
- for (USHORT i = 0; i < nAnz; i++)
+ sal_Bool bRes = sal_False;
+ const sal_uInt16 nAnz = NumFor[nIx].GetCount();
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
switch (rInfo.nTypeArray[i])
{
@@ -1971,7 +1971,7 @@ BOOL SvNumberformat::GetOutputString(String& sString,
{
OutString += (sal_Unicode) 0x1B;
OutString += rInfo.sStrArray[i].GetChar(1);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -1988,24 +1988,24 @@ BOOL SvNumberformat::GetOutputString(String& sString,
}
return bRes;
}
- return FALSE;
+ return sal_False;
}
/*
-void SvNumberformat::GetNextFareyNumber(ULONG nPrec, ULONG x0, ULONG x1,
- ULONG y0, ULONG y1,
- ULONG& x2,ULONG& y2)
+void SvNumberformat::GetNextFareyNumber(sal_uLong nPrec, sal_uLong x0, sal_uLong x1,
+ sal_uLong y0, sal_uLong y1,
+ sal_uLong& x2,sal_uLong& y2)
{
x2 = ((y0+nPrec)/y1)*x1 - x0;
y2 = ((y0+nPrec)/y1)*y1 - y0;
}
*/
-ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y)
+sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y)
{
if (y == 0)
return x;
else
{
- ULONG z = x%y;
+ sal_uLong z = x%y;
while (z)
{
x = y;
@@ -2016,13 +2016,13 @@ ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y)
}
}
-ULONG SvNumberformat::ImpGGTRound(ULONG x, ULONG y)
+sal_uLong SvNumberformat::ImpGGTRound(sal_uLong x, sal_uLong y)
{
if (y == 0)
return x;
else
{
- ULONG z = x%y;
+ sal_uLong z = x%y;
while ((double)z/(double)y > D_EPS)
{
x = y;
@@ -2052,9 +2052,9 @@ void lcl_GetOutputStringScientific(
fNumber, rtl_math_StringFormat_E, nPrec, rFormatter.GetNumDecimalSep().GetChar(0));
}
-sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, USHORT nAnz)
+sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz)
{
- USHORT i;
+ sal_uInt16 i;
rtl::OUString aDiv;
for( i = 0; i < nAnz; i++ )
{
@@ -2065,11 +2065,11 @@ sal_Int32 lcl_GetForcedDenominator(ImpSvNumberformatInfo &rInfo, USHORT nAnz)
}
// TODO: More optimizations?
-void lcl_ForcedDenominator(ULONG &nFrac, ULONG &nDiv, ULONG nForcedDiv)
+void lcl_ForcedDenominator(sal_uLong &nFrac, sal_uLong &nDiv, sal_uLong nForcedDiv)
{
double fFrac = (double)nFrac / (double)nDiv;
double fMultiplier = (double)nForcedDiv / (double)nDiv;
- nFrac = (ULONG)( (double)nFrac * fMultiplier );
+ nFrac = (sal_uLong)( (double)nFrac * fMultiplier );
double fFracNew = (double)nFrac / (double)nForcedDiv;
double fFracNew1 = (double)(nFrac + 1) / (double)nForcedDiv;
@@ -2125,11 +2125,11 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, Stri
return true;
}
-BOOL SvNumberformat::GetOutputString(double fNumber,
+sal_Bool SvNumberformat::GetOutputString(double fNumber,
String& OutString,
Color** ppColor)
{
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
OutString.Erase(); // alles loeschen
*ppColor = NULL; // keine Farbaenderung
if (eType & NUMBERFORMAT_LOGICAL)
@@ -2138,14 +2138,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
OutString = rScan.GetTrueString();
else
OutString = rScan.GetFalseString();
- return FALSE;
+ return sal_False;
}
if (eType & NUMBERFORMAT_TEXT)
{
ImpGetOutputStandard(fNumber, OutString);
- return FALSE;
+ return sal_False;
}
- BOOL bHadStandard = FALSE;
+ sal_Bool bHadStandard = sal_False;
if (bStandard) // einzelne Standardformate
{
if (rScan.GetStandardPrec() == SvNumberFormatter::INPUTSTRING_PRECISION) // alle Zahlformate InputLine
@@ -2185,26 +2185,26 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
return false;
}
ImpGetOutputStandard(fNumber, OutString);
- bHadStandard = TRUE;
+ bHadStandard = sal_True;
}
break;
case NUMBERFORMAT_DATE:
bRes |= ImpGetDateOutput(fNumber, 0, OutString);
- bHadStandard = TRUE;
+ bHadStandard = sal_True;
break;
case NUMBERFORMAT_TIME:
bRes |= ImpGetTimeOutput(fNumber, 0, OutString);
- bHadStandard = TRUE;
+ bHadStandard = sal_True;
break;
case NUMBERFORMAT_DATETIME:
bRes |= ImpGetDateTimeOutput(fNumber, 0, OutString);
- bHadStandard = TRUE;
+ bHadStandard = sal_True;
break;
}
}
if ( !bHadStandard )
{
- USHORT nIx; // Index des Teilformats
+ sal_uInt16 nIx; // Index des Teilformats
short nCheck = ImpCheckCondition(fNumber, fLimit1, eOp1);
if (nCheck == -1 || nCheck == 1) // nur 1 String oder True
nIx = 0;
@@ -2221,20 +2221,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
fNumber = -fNumber; // Vorzeichen eliminieren
*ppColor = NumFor[nIx].GetColor();
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
- const USHORT nAnz = NumFor[nIx].GetCount();
+ const sal_uInt16 nAnz = NumFor[nIx].GetCount();
if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED)
- return FALSE; // leer => nichts
+ return sal_False; // leer => nichts
else if (nAnz == 0) // sonst Standard-Format
{
ImpGetOutputStandard(fNumber, OutString);
- return FALSE;
+ return sal_False;
}
switch (rInfo.eScannedType)
{
case NUMBERFORMAT_TEXT:
case NUMBERFORMAT_DEFINED:
{
- for (USHORT i = 0; i < nAnz; i++)
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
switch (rInfo.nTypeArray[i])
{
@@ -2243,7 +2243,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
{
OutString += (sal_Unicode) 0x1B;
OutString += rInfo.sStrArray[i].GetChar(1);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -2281,13 +2281,13 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
case NUMBERFORMAT_FRACTION:
{
String sStr, sFrac, sDiv; // Strings, Wert fuer
- ULONG nFrac, nDiv; // Vorkommaanteil
+ sal_uLong nFrac, nDiv; // Vorkommaanteil
// Zaehler und Nenner
- BOOL bSign = FALSE;
+ sal_Bool bSign = sal_False;
if (fNumber < 0)
{
if (nIx == 0) // nicht in hinteren
- bSign = TRUE; // Formaten
+ bSign = sal_True; // Formaten
fNumber = -fNumber;
}
double fNum = floor(fNumber); // Vorkommateil
@@ -2296,30 +2296,30 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
// zu gross
{
OutString = rScan.GetErrorString();
- return FALSE;
+ return sal_False;
}
if (rInfo.nCntExp == 0)
{
OSL_FAIL("SvNumberformat:: Bruch, nCntExp == 0");
- return FALSE;
+ return sal_False;
}
- ULONG nBasis = ((ULONG)floor( // 9, 99, 999 ,...
+ sal_uLong nBasis = ((sal_uLong)floor( // 9, 99, 999 ,...
pow(10.0,rInfo.nCntExp))) - 1;
- ULONG x0, y0, x1, y1;
+ sal_uLong x0, y0, x1, y1;
if (rInfo.nCntExp <= _MAX_FRACTION_PREC)
{
- BOOL bUpperHalf;
+ sal_Bool bUpperHalf;
if (fNumber > 0.5)
{
- bUpperHalf = TRUE;
+ bUpperHalf = sal_True;
fNumber -= (fNumber - 0.5) * 2.0;
}
else
- bUpperHalf = FALSE;
+ bUpperHalf = sal_False;
// Einstieg in Farey-Serie
// finden:
- x0 = (ULONG) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9
+ x0 = (sal_uLong) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9
if (x0 == 0) // => x0 = 2
{
y0 = 1;
@@ -2345,12 +2345,12 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
y1 = nBasis - 1;
double fUg = (double) x0 / (double) y0;
double fOg = (double) x1 / (double) y1;
- ULONG nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen
+ sal_uLong nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen
x0 /= nGgt;
y0 /= nGgt; // Einschachteln:
- ULONG x2 = 0;
- ULONG y2 = 0;
- BOOL bStop = FALSE;
+ sal_uLong x2 = 0;
+ sal_uLong y2 = 0;
+ sal_Bool bStop = sal_False;
while (!bStop)
{
#ifdef GCC
@@ -2374,20 +2374,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if (fTest <= fOg)
{
fOg = fTest;
- bStop = TRUE;
+ bStop = sal_True;
}
else if (y1 == 1)
- bStop = TRUE;
+ bStop = sal_True;
} // of while
nGgt = ImpGGT(y1, x1); // x1/y1 kuerzen
x2 = x1 / nGgt;
y2 = y1 / nGgt;
if (x2*y0 - x0*y2 == 1 || y1 <= 1) // Test, ob x2/y2
- bStop = TRUE; // naechste Farey-Zahl
+ bStop = sal_True; // naechste Farey-Zahl
else
{
y1--;
- bStop = FALSE;
+ bStop = sal_False;
}
} // of while
x1 = x2;
@@ -2398,8 +2398,8 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
fup = (double)x1/(double)y1;
while (fNumber > fup)
{
- ULONG x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl
- ULONG y2 = ((y0+nBasis)/y1)*y1 - y0;
+ sal_uLong x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl
+ sal_uLong y2 = ((y0+nBasis)/y1)*y1 - y0;
// GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2);
x0 = x1;
y0 = y1;
@@ -2428,14 +2428,14 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
}
else // grosse Nenner
{ // 0,1234->123/1000
- ULONG nGgt;
+ sal_uLong nGgt;
/*
nDiv = nBasis+1;
- nFrac = ((ULONG)floor(0.5 + fNumber *
+ nFrac = ((sal_uLong)floor(0.5 + fNumber *
pow(10.0,rInfo.nCntExp)));
*/
nDiv = 10000000;
- nFrac = ((ULONG)floor(0.5 + fNumber * 10000000.0));
+ nFrac = ((sal_uLong)floor(0.5 + fNumber * 10000000.0));
nGgt = ImpGGT(nDiv, nFrac);
if (nGgt > 1)
{
@@ -2454,7 +2454,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if (nDiv > nBasis)
{
nDiv = nBasis;
- nFrac = ((ULONG)floor(0.5 + fNumber *
+ nFrac = ((sal_uLong)floor(0.5 + fNumber *
pow(10.0,rInfo.nCntExp)));
nGgt = ImpGGTRound(nDiv, nFrac);
if (nGgt > 1)
@@ -2481,9 +2481,9 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if (fNum1 > _D_MAX_U_LONG_)
{
OutString = rScan.GetErrorString();
- return FALSE;
+ return sal_False;
}
- nFrac = (ULONG) floor(fNum1);
+ nFrac = (sal_uLong) floor(fNum1);
sStr.Erase();
}
else if (fNum == 0.0 && nFrac != 0)
@@ -2506,10 +2506,10 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
sDiv = ImpIntToString( nIx, nDiv );
}
- USHORT j = nAnz-1; // letztes Symbol->rueckw.
+ sal_uInt16 j = nAnz-1; // letztes Symbol->rueckw.
xub_StrLen k; // Nenner:
bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRAC);
- BOOL bCont = TRUE;
+ sal_Bool bCont = sal_True;
if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRAC)
{
if (rInfo.nCntPre > 0 && nFrac == 0)
@@ -2519,7 +2519,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if ( j )
j--;
else
- bCont = FALSE;
+ bCont = sal_False;
}
// weiter Zaehler:
if ( !bCont )
@@ -2533,7 +2533,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if ( j )
j--;
else
- bCont = FALSE;
+ bCont = sal_False;
}
}
// weiter Hauptzahl
@@ -2554,11 +2554,11 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
break;
case NUMBERFORMAT_SCIENTIFIC:
{
- BOOL bSign = FALSE;
+ sal_Bool bSign = sal_False;
if (fNumber < 0)
{
if (nIx == 0) // nicht in hinteren
- bSign = TRUE; // Formaten
+ bSign = sal_True; // Formaten
fNumber = -fNumber;
}
String sStr( ::rtl::math::doubleToUString( fNumber,
@@ -2598,7 +2598,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
ExpStr = String::CreateFromInt32( nExp );
}
}
- USHORT j = nAnz-1; // last symbol
+ sal_uInt16 j = nAnz-1; // last symbol
xub_StrLen k; // position in ExpStr
bRes |= ImpNumberFill(ExpStr, fNumber, k, j, nIx, NF_SYMBOLTYPE_EXP);
@@ -2608,7 +2608,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if (nZeros)
ExpStr.Erase( 0, nZeros);
- BOOL bCont = TRUE;
+ sal_Bool bCont = sal_True;
if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_EXP)
{
const String& rStr = rInfo.sStrArray[j];
@@ -2620,7 +2620,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
if ( j )
j--;
else
- bCont = FALSE;
+ bCont = sal_False;
}
// weiter Hauptzahl:
if ( !bCont )
@@ -2643,20 +2643,20 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
return bRes;
}
-BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
- USHORT nIx,
+sal_Bool SvNumberformat::ImpGetTimeOutput(double fNumber,
+ sal_uInt16 nIx,
String& OutString)
{
using namespace ::com::sun::star::i18n;
- BOOL bCalendarSet = FALSE;
+ sal_Bool bCalendarSet = sal_False;
double fNumberOrig = fNumber;
- BOOL bRes = FALSE;
- BOOL bSign = FALSE;
+ sal_Bool bRes = sal_False;
+ sal_Bool bSign = sal_False;
if (fNumber < 0.0)
{
fNumber = -fNumber;
if (nIx == 0)
- bSign = TRUE;
+ bSign = sal_True;
}
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
if (rInfo.bThousand) // []-Format
@@ -2664,22 +2664,22 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
if (fNumber > 1.0E10) // zu gross
{
OutString = rScan.GetErrorString();
- return FALSE;
+ return sal_False;
}
}
else
fNumber -= floor(fNumber); // sonst Datum abtrennen
- BOOL bInputLine;
+ sal_Bool bInputLine;
xub_StrLen nCntPost;
if ( rScan.GetStandardPrec() == 300 &&
0 < rInfo.nCntPost && rInfo.nCntPost < 7 )
{ // round at 7 decimals (+5 of 86400 == 12 significant digits)
- bInputLine = TRUE;
+ bInputLine = sal_True;
nCntPost = 7;
}
else
{
- bInputLine = FALSE;
+ bInputLine = sal_False;
nCntPost = xub_StrLen(rInfo.nCntPost);
}
if (bSign && !rInfo.bThousand) // kein []-Format
@@ -2687,14 +2687,14 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
double fTime = fNumber * 86400.0;
fTime = ::rtl::math::round( fTime, int(nCntPost) );
if (bSign && fTime == 0.0)
- bSign = FALSE; // nicht -00:00:00
+ bSign = sal_False; // nicht -00:00:00
if( floor( fTime ) > _D_MAX_U_LONG_ )
{
OutString = rScan.GetErrorString();
- return FALSE;
+ return sal_False;
}
- ULONG nSeconds = (ULONG)floor( fTime );
+ sal_uLong nSeconds = (sal_uLong)floor( fTime );
String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds,
rtl_math_StringFormat_F, int(nCntPost), '.'));
@@ -2713,7 +2713,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
xub_StrLen nSecPos = 0; // Zum Ziffernweisen
// abarbeiten
- ULONG nHour, nMin, nSec;
+ sal_uLong nHour, nMin, nSec;
if (!rInfo.bThousand) // kein [] Format
{
nHour = (nSeconds/3600) % 24;
@@ -2762,8 +2762,8 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
nHour -= 12;
}
}
- const USHORT nAnz = NumFor[nIx].GetCount();
- for (USHORT i = 0; i < nAnz; i++)
+ const sal_uInt16 nAnz = NumFor[nIx].GetCount();
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
switch (rInfo.nTypeArray[i])
{
@@ -2772,7 +2772,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
{
OutString += (sal_Unicode) 0x1B;
OutString += rInfo.sStrArray[i].GetChar(1);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -2806,7 +2806,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
double fDiff = DateTime(*(rScan.GetNullDate())) - GetCal().getEpochStart();
fDiff += fNumberOrig;
GetCal().setLocalDateTime( fDiff );
- bCalendarSet = TRUE;
+ bCalendarSet = sal_True;
}
if (cAmPm == 'a')
OutString += GetCal().getDisplayName(
@@ -2851,29 +2851,29 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
return bRes;
}
-BOOL SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const
+sal_Bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const
{
if ( GetCal().getUniqueID() != Gregorian::get() )
- return FALSE;
+ return sal_False;
const ImpSvNumberformatInfo& rInfo = rNumFor.Info();
- const USHORT nAnz = rNumFor.GetCount();
- USHORT i;
+ const sal_uInt16 nAnz = rNumFor.GetCount();
+ sal_uInt16 i;
for ( i = 0; i < nAnz; i++ )
{
switch ( rInfo.nTypeArray[i] )
{
case NF_SYMBOLTYPE_CALENDAR :
- return FALSE;
+ return sal_False;
case NF_KEY_EC :
case NF_KEY_EEC :
case NF_KEY_R :
case NF_KEY_RR :
case NF_KEY_AAA :
case NF_KEY_AAAA :
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar,
@@ -2919,7 +2919,7 @@ void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar,
}
}
-BOOL SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime )
+sal_Bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime )
{
using namespace ::com::sun::star::i18n;
CalendarWrapper& rCal = GetCal();
@@ -2939,18 +2939,18 @@ BOOL SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, doubl
rOrgCalendar.Erase();
rCal.loadCalendar( rGregorian, rLoc().getLocale() );
rCal.setDateTime( fOrgDateTime );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
-BOOL SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
+sal_Bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const
{
const ImpSvNumberformatInfo& rInfo = rNumFor.Info();
- const USHORT nAnz = rNumFor.GetCount();
- for ( USHORT i = 0; i < nAnz; i++ )
+ const sal_uInt16 nAnz = rNumFor.GetCount();
+ for ( sal_uInt16 i = 0; i < nAnz; i++ )
{
if ( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_CALENDAR )
{
@@ -2962,10 +2962,10 @@ BOOL SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
}
rCal.loadCalendar( rInfo.sStrArray[i], rLoc().getLocale() );
rCal.setDateTime( fOrgDateTime );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// static
@@ -2992,27 +2992,27 @@ void SvNumberformat::ImpAppendEraG( String& OutString,
OutString += rCal.getDisplayString( CalendarDisplayCode::SHORT_ERA, nNatNum );
}
-BOOL SvNumberformat::ImpGetDateOutput(double fNumber,
- USHORT nIx,
+sal_Bool SvNumberformat::ImpGetDateOutput(double fNumber,
+ sal_uInt16 nIx,
String& OutString)
{
using namespace ::com::sun::star::i18n;
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
CalendarWrapper& rCal = GetCal();
double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart();
fNumber += fDiff;
rCal.setLocalDateTime( fNumber );
String aOrgCalendar; // empty => not changed yet
double fOrgDateTime;
- BOOL bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
+ sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
if ( bOtherCalendar )
SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime );
if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) )
- bOtherCalendar = FALSE;
+ bOtherCalendar = sal_False;
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
- const USHORT nAnz = NumFor[nIx].GetCount();
+ const sal_uInt16 nAnz = NumFor[nIx].GetCount();
sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum();
- for (USHORT i = 0; i < nAnz; i++)
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
switch (rInfo.nTypeArray[i])
{
@@ -3031,7 +3031,7 @@ BOOL SvNumberformat::ImpGetDateOutput(double fNumber,
{
OutString += (sal_Unicode) 0x1B;
OutString += rInfo.sStrArray[i].GetChar(1);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -3175,29 +3175,29 @@ BOOL SvNumberformat::ImpGetDateOutput(double fNumber,
return bRes;
}
-BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
- USHORT nIx,
+sal_Bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
+ sal_uInt16 nIx,
String& OutString)
{
using namespace ::com::sun::star::i18n;
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
CalendarWrapper& rCal = GetCal();
double fDiff = DateTime(*(rScan.GetNullDate())) - rCal.getEpochStart();
fNumber += fDiff;
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
- BOOL bInputLine;
+ sal_Bool bInputLine;
xub_StrLen nCntPost;
if ( rScan.GetStandardPrec() == 300 &&
0 < rInfo.nCntPost && rInfo.nCntPost < 7 )
{ // round at 7 decimals (+5 of 86400 == 12 significant digits)
- bInputLine = TRUE;
+ bInputLine = sal_True;
nCntPost = 7;
}
else
{
- bInputLine = FALSE;
+ bInputLine = sal_False;
nCntPost = xub_StrLen(rInfo.nCntPost);
}
double fTime = (fNumber - floor( fNumber )) * 86400.0;
@@ -3212,14 +3212,14 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
String aOrgCalendar; // empty => not changed yet
double fOrgDateTime;
- BOOL bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
+ sal_Bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
if ( bOtherCalendar )
SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime );
if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) )
- bOtherCalendar = FALSE;
+ bOtherCalendar = sal_False;
sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum();
- ULONG nSeconds = (ULONG)floor( fTime );
+ sal_uLong nSeconds = (sal_uLong)floor( fTime );
String sSecStr( ::rtl::math::doubleToUString( fTime-nSeconds,
rtl_math_StringFormat_F, int(nCntPost), '.'));
sSecStr.EraseLeadingChars('0');
@@ -3237,7 +3237,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
xub_StrLen nSecPos = 0; // Zum Ziffernweisen
// abarbeiten
- ULONG nHour, nMin, nSec;
+ sal_uLong nHour, nMin, nSec;
if (!rInfo.bThousand) // [] Format
{
nHour = (nSeconds/3600) % 24;
@@ -3284,8 +3284,8 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
nHour -= 12;
}
}
- const USHORT nAnz = NumFor[nIx].GetCount();
- for (USHORT i = 0; i < nAnz; i++)
+ const sal_uInt16 nAnz = NumFor[nIx].GetCount();
+ for (sal_uInt16 i = 0; i < nAnz; i++)
{
switch (rInfo.nTypeArray[i])
{
@@ -3304,7 +3304,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
{
OutString += (sal_Unicode) 0x1B;
OutString += rInfo.sStrArray[i].GetChar(1);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -3497,23 +3497,23 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
return bRes;
}
-BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
- USHORT nIx,
+sal_Bool SvNumberformat::ImpGetNumberOutput(double fNumber,
+ sal_uInt16 nIx,
String& OutString)
{
- BOOL bRes = FALSE;
- BOOL bSign;
+ sal_Bool bRes = sal_False;
+ sal_Bool bSign;
if (fNumber < 0.0)
{
if (nIx == 0) // nicht in hinteren
- bSign = TRUE; // Formaten
+ bSign = sal_True; // Formaten
else
- bSign = FALSE;
+ bSign = sal_False;
fNumber = -fNumber;
}
else
{
- bSign = FALSE;
+ bSign = sal_False;
if ( ::rtl::math::isSignBitSet( fNumber ) )
fNumber = -fNumber; // yes, -0.0 is possible, eliminate '-'
}
@@ -3525,17 +3525,17 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
else
{
OutString = rScan.GetErrorString();
- return FALSE;
+ return sal_False;
}
}
- USHORT i, j;
+ sal_uInt16 i, j;
xub_StrLen k;
String sStr;
long nPrecExp;
- BOOL bInteger = FALSE;
+ sal_Bool bInteger = sal_False;
if ( rInfo.nThousand != FLAG_STANDARD_IN_FORMAT )
{ // special formatting only if no GENERAL keyword in format code
- const USHORT nThousand = rInfo.nThousand;
+ const sal_uInt16 nThousand = rInfo.nThousand;
for (i = 0; i < nThousand; i++)
{
if (fNumber > _D_MIN_M_BY_1000)
@@ -3579,12 +3579,12 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
while ( *++p == '0' )
;
if ( !*p )
- bInteger = TRUE;
+ bInteger = sal_True;
sStr.Erase( nPoint, 1 ); // . herausnehmen
}
if (bSign &&
(sStr.Len() == 0 || sStr.GetTokenCount('0') == sStr.Len()+1)) // nur 00000
- bSign = FALSE; // nicht -0.00
+ bSign = sal_False; // nicht -0.00
} // End of != FLAG_STANDARD_IN_FORMAT
// von hinten nach vorn
@@ -3594,8 +3594,8 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
// Nachkommastellen:
if (rInfo.nCntPost > 0)
{
- BOOL bTrailing = TRUE; // ob Endnullen?
- BOOL bFilled = FALSE; // ob aufgefuellt wurde ?
+ sal_Bool bTrailing = sal_True; // ob Endnullen?
+ sal_Bool bFilled = sal_False; // ob aufgefuellt wurde ?
short nType;
while (j > 0 && // rueckwaerts
(nType = rInfo.nTypeArray[j]) != NF_SYMBOLTYPE_DECSEP)
@@ -3607,7 +3607,7 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
{
sStr.Insert( (sal_Unicode) 0x1B, k /*++*/ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -3632,21 +3632,21 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
const sal_Unicode c = *p;
k--;
if ( sStr.GetChar(k) != '0' )
- bTrailing = FALSE;
+ bTrailing = sal_False;
if (bTrailing)
{
if ( c == '0' )
- bFilled = TRUE;
+ bFilled = sal_True;
else if ( c == '-' )
{
if ( bInteger )
sStr.SetChar( k, '-' );
- bFilled = TRUE;
+ bFilled = sal_True;
}
else if ( c == '?' )
{
sStr.SetChar( k, ' ' );
- bFilled = TRUE;
+ bFilled = sal_True;
}
else if ( !bFilled ) // #
sStr.Erase(k,1);
@@ -3688,27 +3688,27 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
return bRes;
}
-BOOL SvNumberformat::ImpNumberFillWithThousands(
+sal_Bool SvNumberformat::ImpNumberFillWithThousands(
String& sStr, // number string
double& rNumber, // number
xub_StrLen k, // position within string
- USHORT j, // symbol index within format code
- USHORT nIx, // subformat index
- USHORT nDigCnt) // count of integer digits in format
+ sal_uInt16 j, // symbol index within format code
+ sal_uInt16 nIx, // subformat index
+ sal_uInt16 nDigCnt) // count of integer digits in format
{
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
xub_StrLen nLeadingStringChars = 0; // inserted StringChars before number
xub_StrLen nDigitCount = 0; // count of integer digits from the right
- BOOL bStop = FALSE;
+ sal_Bool bStop = sal_False;
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
// no normal thousands separators if number divided by thousands
- BOOL bDoThousands = (rInfo.nThousand == 0);
+ sal_Bool bDoThousands = (rInfo.nThousand == 0);
utl::DigitGroupingIterator aGrouping(
GetFormatter().GetLocaleData()->getDigitGrouping());
while (!bStop) // backwards
{
if (j == 0)
- bStop = TRUE;
+ bStop = sal_True;
switch (rInfo.nTypeArray[j])
{
case NF_SYMBOLTYPE_DECSEP:
@@ -3727,7 +3727,7 @@ BOOL SvNumberformat::ImpNumberFillWithThousands(
{
sStr.Insert( (sal_Unicode) 0x1B, k/*++*/ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -3847,7 +3847,7 @@ void SvNumberformat::ImpDigitFill(
String& sStr, // number string
xub_StrLen nStart, // start of digits
xub_StrLen& k, // position within string
- USHORT nIx, // subformat index
+ sal_uInt16 nIx, // subformat index
xub_StrLen & nDigitCount, // count of integer digits from the right so far
utl::DigitGroupingIterator & rGrouping ) // current grouping
{
@@ -3869,18 +3869,18 @@ void SvNumberformat::ImpDigitFill(
k = nStart;
}
-BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string
+sal_Bool SvNumberformat::ImpNumberFill( String& sStr, // number string
double& rNumber, // number for "General" format
xub_StrLen& k, // position within string
- USHORT& j, // symbol index within format code
- USHORT nIx, // subformat index
+ sal_uInt16& j, // symbol index within format code
+ sal_uInt16 nIx, // subformat index
short eSymbolType ) // type of stop condition
{
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
k = sStr.Len(); // behind last digit
const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
// no normal thousands separators if number divided by thousands
- BOOL bDoThousands = (rInfo.nThousand == 0);
+ sal_Bool bDoThousands = (rInfo.nThousand == 0);
short nType;
while (j > 0 && (nType = rInfo.nTypeArray[j]) != eSymbolType )
{ // rueckwaerts:
@@ -3891,7 +3891,7 @@ BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string
{
sStr.Insert( sal_Unicode(0x1B), k++ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
- bRes = TRUE;
+ bRes = sal_True;
}
break;
case NF_SYMBOLTYPE_BLANK:
@@ -3961,10 +3961,10 @@ BOOL SvNumberformat::ImpNumberFill( String& sStr, // number string
return bRes;
}
-void SvNumberformat::GetFormatSpecialInfo(BOOL& bThousand,
- BOOL& IsRed,
- USHORT& nPrecision,
- USHORT& nAnzLeading) const
+void SvNumberformat::GetFormatSpecialInfo(sal_Bool& bThousand,
+ sal_Bool& IsRed,
+ sal_uInt16& nPrecision,
+ sal_uInt16& nAnzLeading) const
{
// as before: take info from nNumFor=0 for whole format (for dialog etc.)
@@ -3976,13 +3976,13 @@ void SvNumberformat::GetFormatSpecialInfo(BOOL& bThousand,
const Color* pColor = NumFor[1].GetColor();
if (fLimit1 == 0.0 && fLimit2 == 0.0 && pColor
&& (*pColor == rScan.GetRedColor()))
- IsRed = TRUE;
+ IsRed = sal_True;
else
- IsRed = FALSE;
+ IsRed = sal_False;
}
-void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType,
- BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const
+void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType,
+ sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const
{
// take info from a specified sub-format (for XML export)
@@ -3999,9 +3999,9 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType,
else
{
nAnzLeading = 0;
- BOOL bStop = FALSE;
- USHORT i = 0;
- const USHORT nAnz = NumFor[nNumFor].GetCount();
+ sal_Bool bStop = sal_False;
+ sal_uInt16 i = 0;
+ const sal_uInt16 nAnz = NumFor[nNumFor].GetCount();
while (!bStop && i < nAnz)
{
short nType = rInfo.nTypeArray[i];
@@ -4014,18 +4014,18 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType,
nAnzLeading++;
}
else if (nType == NF_SYMBOLTYPE_DECSEP || nType == NF_SYMBOLTYPE_EXP)
- bStop = TRUE;
+ bStop = sal_True;
i++;
}
}
}
-const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos,
- BOOL bString /* = FALSE */ ) const
+const String* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos,
+ sal_Bool bString /* = sal_False */ ) const
{
if ( nNumFor > 3 )
return NULL;
- USHORT nAnz = NumFor[nNumFor].GetCount();
+ sal_uInt16 nAnz = NumFor[nNumFor].GetCount();
if ( !nAnz )
return NULL;
if ( nPos == 0xFFFF )
@@ -4062,12 +4062,12 @@ const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos,
return &NumFor[nNumFor].Info().sStrArray[nPos];
}
-short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos,
- BOOL bString /* = FALSE */ ) const
+short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos,
+ sal_Bool bString /* = sal_False */ ) const
{
if ( nNumFor > 3 )
return 0;
- USHORT nAnz = NumFor[nNumFor].GetCount();
+ sal_uInt16 nAnz = NumFor[nNumFor].GetCount();
if ( !nAnz )
return 0;
if ( nPos == 0xFFFF )
@@ -4103,30 +4103,30 @@ short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos,
return NumFor[nNumFor].Info().nTypeArray[nPos];
}
-BOOL SvNumberformat::IsNegativeWithoutSign() const
+sal_Bool SvNumberformat::IsNegativeWithoutSign() const
{
if ( IsNegativeRealNegative() )
{
- const String* pStr = GetNumForString( 1, 0, TRUE );
+ const String* pStr = GetNumForString( 1, 0, sal_True );
if ( pStr )
return !HasStringNegativeSign( *pStr );
}
- return FALSE;
+ return sal_False;
}
-BOOL SvNumberformat::IsNegativeInBracket() const
+sal_Bool SvNumberformat::IsNegativeInBracket() const
{
- USHORT nAnz = NumFor[1].GetCount();
+ sal_uInt16 nAnz = NumFor[1].GetCount();
if (!nAnz)
- return FALSE;
+ return sal_False;
String *tmpStr = NumFor[1].Info().sStrArray;
return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' );
}
-BOOL SvNumberformat::HasPositiveBracketPlaceholder() const
+sal_Bool SvNumberformat::HasPositiveBracketPlaceholder() const
{
- USHORT nAnz = NumFor[0].GetCount();
+ sal_uInt16 nAnz = NumFor[0].GetCount();
String *tmpStr = NumFor[0].Info().sStrArray;
return (tmpStr[nAnz-1].EqualsAscii( "_)" ));
}
@@ -4136,8 +4136,8 @@ DateFormat SvNumberformat::GetDateOrder() const
if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE )
{
short const * const pType = NumFor[0].Info().nTypeArray;
- USHORT nAnz = NumFor[0].GetCount();
- for ( USHORT j=0; j<nAnz; j++ )
+ sal_uInt16 nAnz = NumFor[0].GetCount();
+ for ( sal_uInt16 j=0; j<nAnz; j++ )
{
switch ( pType[j] )
{
@@ -4176,9 +4176,9 @@ sal_uInt32 SvNumberformat::GetExactDateOrder() const
return nRet;
}
short const * const pType = NumFor[0].Info().nTypeArray;
- USHORT nAnz = NumFor[0].GetCount();
+ sal_uInt16 nAnz = NumFor[0].GetCount();
int nShift = 0;
- for ( USHORT j=0; j<nAnz && nShift < 3; j++ )
+ for ( sal_uInt16 j=0; j<nAnz && nShift < 3; j++ )
{
switch ( pType[j] )
{
@@ -4218,7 +4218,7 @@ void SvNumberformat::GetConditions( SvNumberformatLimitOps& rOper1, double& rVal
rVal2 = fLimit2;
}
-Color* SvNumberformat::GetColor( USHORT nNumFor ) const
+Color* SvNumberformat::GetColor( sal_uInt16 nNumFor ) const
{
if ( nNumFor > 3 )
return NULL;
@@ -4264,10 +4264,10 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr,
String SvNumberformat::GetMappedFormatstring(
const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLocWrp,
- BOOL bDontQuote ) const
+ sal_Bool bDontQuote ) const
{
String aStr;
- BOOL bDefault[4];
+ sal_Bool bDefault[4];
// 1 subformat matches all if no condition specified,
bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO );
// with 2 subformats [>=0];[<0] is implied if no condition specified
@@ -4279,26 +4279,26 @@ String SvNumberformat::GetMappedFormatstring(
bDefault[2] = ( !bDefault[0] && !bDefault[1] &&
eOp1 == NUMBERFORMAT_OP_GT && fLimit1 == 0.0 &&
eOp2 == NUMBERFORMAT_OP_LT && fLimit2 == 0.0 );
- BOOL bDefaults = bDefault[0] || bDefault[1] || bDefault[2];
+ sal_Bool bDefaults = bDefault[0] || bDefault[1] || bDefault[2];
// from now on bDefault[] values are used to append empty subformats at the end
- bDefault[3] = FALSE;
+ bDefault[3] = sal_False;
if ( !bDefaults )
{ // conditions specified
if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO )
- bDefault[0] = bDefault[1] = TRUE; // [];x
+ bDefault[0] = bDefault[1] = sal_True; // [];x
else if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 != NUMBERFORMAT_OP_NO &&
NumFor[2].GetCount() == 0 )
- bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = TRUE; // [];[];;
+ bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = sal_True; // [];[];;
// nothing to do if conditions specified for every subformat
}
else if ( bDefault[0] )
- bDefault[0] = FALSE; // a single unconditional subformat is never delimited
+ bDefault[0] = sal_False; // a single unconditional subformat is never delimited
else
{
if ( bDefault[2] && NumFor[2].GetCount() == 0 && NumFor[1].GetCount() > 0 )
- bDefault[3] = TRUE; // special cases x;x;; and ;x;;
+ bDefault[3] = sal_True; // special cases x;x;; and ;x;;
for ( int i=0; i<3 && !bDefault[i]; ++i )
- bDefault[i] = TRUE;
+ bDefault[i] = sal_True;
}
int nSem = 0; // needed ';' delimiters
int nSub = 0; // subformats delimited so far
@@ -4350,13 +4350,13 @@ String SvNumberformat::GetMappedFormatstring(
aPrefix += 't'; // must be lowercase, otherwise taken as literal
}
- USHORT nAnz = NumFor[n].GetCount();
+ sal_uInt16 nAnz = NumFor[n].GetCount();
if ( nSem && (nAnz || aPrefix.Len()) )
{
for ( ; nSem; --nSem )
aStr += ';';
for ( ; nSub <= n; ++nSub )
- bDefault[nSub] = FALSE;
+ bDefault[nSub] = sal_False;
}
if ( aPrefix.Len() )
@@ -4366,7 +4366,7 @@ String SvNumberformat::GetMappedFormatstring(
{
const short* pType = NumFor[n].Info().nTypeArray;
const String* pStr = NumFor[n].Info().sStrArray;
- for ( USHORT j=0; j<nAnz; j++ )
+ for ( sal_uInt16 j=0; j<nAnz; j++ )
{
if ( 0 <= pType[j] && pType[j] < NF_KEYWORD_ENTRIES_COUNT )
{
@@ -4424,7 +4424,7 @@ String SvNumberformat::GetMappedFormatstring(
}
String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum,
- sal_Int32 nVal, USHORT nMinDigits ) const
+ sal_Int32 nVal, sal_uInt16 nMinDigits ) const
{
String aStr;
if ( nMinDigits )
@@ -4469,7 +4469,7 @@ void SvNumberformat::ImpTransliterateImpl( String& rStr,
void SvNumberformat::GetNatNumXml(
com::sun::star::i18n::NativeNumberXmlAttributes& rAttr,
- USHORT nNumFor ) const
+ sal_uInt16 nNumFor ) const
{
if ( nNumFor <= 3 )
{
@@ -4489,27 +4489,27 @@ void SvNumberformat::GetNatNumXml(
}
// static
-BOOL SvNumberformat::HasStringNegativeSign( const String& rStr )
+sal_Bool SvNumberformat::HasStringNegativeSign( const String& rStr )
{
// fuer Sign muss '-' am Anfang oder am Ende des TeilStrings sein (Blanks ignored)
xub_StrLen nLen = rStr.Len();
if ( !nLen )
- return FALSE;
+ return sal_False;
const sal_Unicode* const pBeg = rStr.GetBuffer();
const sal_Unicode* const pEnd = pBeg + nLen;
register const sal_Unicode* p = pBeg;
do
{ // Anfang
if ( *p == '-' )
- return TRUE;
+ return sal_True;
} while ( *p == ' ' && ++p < pEnd );
p = pEnd - 1;
do
{ // Ende
if ( *p == '-' )
- return TRUE;
+ return sal_True;
} while ( *p == ' ' && pBeg < --p );
- return FALSE;
+ return sal_False;
}
// static
@@ -4567,9 +4567,9 @@ void SvNumberformat::EraseCommentBraces( String& rStr )
void SvNumberformat::EraseComment( String& rStr )
{
register const sal_Unicode* p = rStr.GetBuffer();
- BOOL bInString = FALSE;
- BOOL bEscaped = FALSE;
- BOOL bFound = FALSE;
+ sal_Bool bInString = sal_False;
+ sal_Bool bEscaped = sal_False;
+ sal_Bool bFound = sal_False;
xub_StrLen nPos = 0;
while ( !bFound && *p )
{
@@ -4585,14 +4585,14 @@ void SvNumberformat::EraseComment( String& rStr )
case '{' :
if ( !bEscaped && !bInString )
{
- bFound = TRUE;
+ bFound = sal_True;
nPos = sal::static_int_cast< xub_StrLen >(
p - rStr.GetBuffer());
}
break;
}
if ( bEscaped && *p != '\\' )
- bEscaped = FALSE;
+ bEscaped = sal_False;
++p;
}
if ( bFound )
@@ -4600,31 +4600,31 @@ void SvNumberformat::EraseComment( String& rStr )
}
// static
-BOOL SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos,
+sal_Bool SvNumberformat::IsInQuote( const String& rStr, xub_StrLen nPos,
sal_Unicode cQuote, sal_Unicode cEscIn, sal_Unicode cEscOut )
{
xub_StrLen nLen = rStr.Len();
if ( nPos >= nLen )
- return FALSE;
+ return sal_False;
register const sal_Unicode* p0 = rStr.GetBuffer();
register const sal_Unicode* p = p0;
register const sal_Unicode* p1 = p0 + nPos;
- BOOL bQuoted = FALSE;
+ sal_Bool bQuoted = sal_False;
while ( p <= p1 )
{
if ( *p == cQuote )
{
if ( p == p0 )
- bQuoted = TRUE;
+ bQuoted = sal_True;
else if ( bQuoted )
{
if ( *(p-1) != cEscIn )
- bQuoted = FALSE;
+ bQuoted = sal_False;
}
else
{
if ( *(p-1) != cEscOut )
- bQuoted = TRUE;
+ bQuoted = sal_True;
}
}
p++;
@@ -4657,12 +4657,12 @@ xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos,
return nLen; // String Ende
}
-USHORT SvNumberformat::ImpGetNumForStringElementCount( USHORT nNumFor ) const
+sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const
{
- USHORT nCnt = 0;
- USHORT nAnz = NumFor[nNumFor].GetCount();
+ sal_uInt16 nCnt = 0;
+ sal_uInt16 nAnz = NumFor[nNumFor].GetCount();
short const * const pType = NumFor[nNumFor].Info().nTypeArray;
- for ( USHORT j=0; j<nAnz; ++j )
+ for ( sal_uInt16 j=0; j<nAnz; ++j )
{
switch ( pType[j] )
{
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index b6e6bee7553d..b7077b00e134 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -44,7 +44,7 @@
#define _ZFORSCAN_CXX
#include "zforscan.hxx"
#undef _ZFORSCAN_CXX
-#include "nfsymbol.hxx"
+#include <svl/nfsymbol.hxx>
using namespace svt;
const sal_Unicode cNonBreakingSpace = 0xA0;
@@ -80,7 +80,7 @@ namespace
ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
{
pFormatter = pFormatterP;
- bConvertMode = FALSE;
+ bConvertMode = sal_False;
//! All keywords MUST be UPPERCASE!
sKeyword[NF_KEY_E].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "E" ) ); // Exponent
sKeyword[NF_KEY_AMPM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AM/PM" ) ); // AM/PM
@@ -96,8 +96,8 @@ ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
sKeyword[NF_KEY_NNNN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NNNN" ) ); // Day of week long incl. separator
sKeyword[NF_KEY_WW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WW" ) ); // Week of year
sKeyword[NF_KEY_CCC].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CCC" ) ); // Currency abbreviation
- bKeywordsNeedInit = TRUE; // locale dependent keywords
- bCompatCurNeedInit = TRUE; // locale dependent compatibility currency strings
+ bKeywordsNeedInit = sal_True; // locale dependent keywords
+ bCompatCurNeedInit = sal_True; // locale dependent compatibility currency strings
StandardColor[0] = Color(COL_BLACK);
StandardColor[1] = Color(COL_LIGHTBLUE);
@@ -125,8 +125,8 @@ ImpSvNumberformatScan::~ImpSvNumberformatScan()
void ImpSvNumberformatScan::ChangeIntl()
{
- bKeywordsNeedInit = TRUE;
- bCompatCurNeedInit = TRUE;
+ bKeywordsNeedInit = sal_True;
+ bCompatCurNeedInit = sal_True;
// may be initialized by InitSpecialKeyword()
sKeyword[NF_KEY_TRUE].Erase();
sKeyword[NF_KEY_FALSE].Erase();
@@ -143,7 +143,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const
if ( !sKeyword[NF_KEY_TRUE].Len() )
{
DBG_ERRORFILE( "InitSpecialKeyword: TRUE_WORD?" );
- ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TRUE" ) );
+ ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_True" ) );
}
break;
case NF_KEY_FALSE :
@@ -153,7 +153,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const
if ( !sKeyword[NF_KEY_FALSE].Len() )
{
DBG_ERRORFILE( "InitSpecialKeyword: FALSE_WORD?" );
- ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FALSE" ) );
+ ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_False" ) );
}
break;
default:
@@ -168,7 +168,7 @@ void ImpSvNumberformatScan::InitCompatCur() const
pFormatter->GetCompatibilityCurrency( pThis->sCurSymbol, pThis->sCurAbbrev );
// currency symbol upper case
pThis->sCurString = pFormatter->GetCharClass()->upper( sCurSymbol );
- bCompatCurNeedInit = FALSE;
+ bCompatCurNeedInit = sal_False;
}
void ImpSvNumberformatScan::InitKeywords() const
@@ -176,7 +176,7 @@ void ImpSvNumberformatScan::InitKeywords() const
if ( !bKeywordsNeedInit )
return ;
((ImpSvNumberformatScan*)this)->SetDependentKeywords();
- bKeywordsNeedInit = FALSE;
+ bKeywordsNeedInit = sal_False;
}
/** Extract the name of General, Standard, Whatever, ignoring leading modifiers
@@ -449,7 +449,7 @@ void ImpSvNumberformatScan::SetDependentKeywords()
InitCompatCur();
}
-void ImpSvNumberformatScan::ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear)
+void ImpSvNumberformatScan::ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear)
{
if ( pNullDate )
*pNullDate = Date(nDay, nMonth, nYear);
@@ -507,7 +507,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr)
{
long nIndex = sString.ToInt32();
if (nIndex > 0 && nIndex <= 64)
- pResult = pFormatter->GetUserDefColor((USHORT)nIndex-1);
+ pResult = pFormatter->GetUserDefColor((sal_uInt16)nIndex-1);
}
}
}
@@ -537,7 +537,7 @@ short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos
return NF_KEY_GENERAL;
//! MUST be a reverse search to find longer strings first
short i = NF_KEYWORD_ENTRIES_COUNT-1;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for ( ; i > NF_KEY_LASTKEYWORD_SO5; --i )
{
bFound = sString.Search(pKeyword[i]) == 0;
@@ -741,7 +741,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr,
short nTmpType = GetKeyWord( rStr, nPos-1 );
if ( nTmpType )
{
- BOOL bCurrency = FALSE;
+ sal_Bool bCurrency = sal_False;
// "Automatic" currency may start with keyword,
// like "R" (Rand) and 'R' (era)
if ( nCurrPos != STRING_NOTFOUND &&
@@ -751,7 +751,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr,
String aTest( rStr.Copy( nPos-1, sCurString.Len() ) );
pChrCls->toUpper( aTest );
if ( aTest == sCurString )
- bCurrency = TRUE;
+ bCurrency = sal_True;
}
if ( bCurrency )
{
@@ -831,7 +831,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr,
}
else
{
- BOOL bDontStop = FALSE;
+ sal_Bool bDontStop = sal_False;
switch (cToken)
{
case '/': // AM/PM, A/P
@@ -847,7 +847,7 @@ short ImpSvNumberformatScan::Next_Symbol( const String& rStr,
&& (rStr.GetChar(nPos+1) == 'M' || rStr.GetChar(nPos+1) == 'm'))) )
{
sSymbol += cToken;
- bDontStop = TRUE;
+ bDontStop = sal_True;
}
}
}
@@ -916,7 +916,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString)
}
}
nAnzStrings = 0;
- BOOL bStar = FALSE; // wird bei '*'Detektion gesetzt
+ sal_Bool bStar = sal_False; // wird bei '*'Detektion gesetzt
Reset();
xub_StrLen nPos = 0;
@@ -929,7 +929,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString)
if (bStar)
return nPos; // Fehler: doppelter '*'
else
- bStar = TRUE;
+ bStar = sal_True;
}
nAnzStrings++;
}
@@ -937,7 +937,7 @@ xub_StrLen ImpSvNumberformatScan::Symbol_Division(const String& rString)
return 0; // 0 => ok
}
-void ImpSvNumberformatScan::SkipStrings(USHORT& i, xub_StrLen& nPos)
+void ImpSvNumberformatScan::SkipStrings(sal_uInt16& i, xub_StrLen& nPos)
{
while (i < nAnzStrings && ( nTypeArray[i] == NF_SYMBOLTYPE_STRING
|| nTypeArray[i] == NF_SYMBOLTYPE_BLANK
@@ -948,7 +948,7 @@ void ImpSvNumberformatScan::SkipStrings(USHORT& i, xub_StrLen& nPos)
}
}
-USHORT ImpSvNumberformatScan::PreviousKeyword(USHORT i)
+sal_uInt16 ImpSvNumberformatScan::PreviousKeyword(sal_uInt16 i)
{
short res = 0;
if (i > 0 && i < nAnzStrings)
@@ -962,7 +962,7 @@ USHORT ImpSvNumberformatScan::PreviousKeyword(USHORT i)
return res;
}
-USHORT ImpSvNumberformatScan::NextKeyword(USHORT i)
+sal_uInt16 ImpSvNumberformatScan::NextKeyword(sal_uInt16 i)
{
short res = 0;
if (i < nAnzStrings-1)
@@ -976,7 +976,7 @@ USHORT ImpSvNumberformatScan::NextKeyword(USHORT i)
return res;
}
-short ImpSvNumberformatScan::PreviousType( USHORT i )
+short ImpSvNumberformatScan::PreviousType( sal_uInt16 i )
{
if ( i > 0 && i < nAnzStrings )
{
@@ -989,7 +989,7 @@ short ImpSvNumberformatScan::PreviousType( USHORT i )
return 0;
}
-sal_Unicode ImpSvNumberformatScan::PreviousChar(USHORT i)
+sal_Unicode ImpSvNumberformatScan::PreviousChar(sal_uInt16 i)
{
sal_Unicode res = ' ';
if (i > 0 && i < nAnzStrings)
@@ -1006,7 +1006,7 @@ sal_Unicode ImpSvNumberformatScan::PreviousChar(USHORT i)
return res;
}
-sal_Unicode ImpSvNumberformatScan::NextChar(USHORT i)
+sal_Unicode ImpSvNumberformatScan::NextChar(sal_uInt16 i)
{
sal_Unicode res = ' ';
if (i < nAnzStrings-1)
@@ -1024,28 +1024,28 @@ sal_Unicode ImpSvNumberformatScan::NextChar(USHORT i)
return res;
}
-BOOL ImpSvNumberformatScan::IsLastBlankBeforeFrac(USHORT i)
+sal_Bool ImpSvNumberformatScan::IsLastBlankBeforeFrac(sal_uInt16 i)
{
- BOOL res = TRUE;
+ sal_Bool res = sal_True;
if (i < nAnzStrings-1)
{
- BOOL bStop = FALSE;
+ sal_Bool bStop = sal_False;
i++;
while (i < nAnzStrings-1 && !bStop)
{
i++;
if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL &&
sStrArray[i].GetChar(0) == '/')
- bStop = TRUE;
+ bStop = sal_True;
else if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL &&
sStrArray[i].GetChar(0) == ' ')
- res = FALSE;
+ res = sal_False;
}
if (!bStop) // kein '/'
- res = FALSE;
+ res = sal_False;
}
else
- res = FALSE; // kein '/' mehr
+ res = sal_False; // kein '/' mehr
return res;
}
@@ -1064,24 +1064,24 @@ void ImpSvNumberformatScan::Reset()
#endif
eScannedType = NUMBERFORMAT_UNDEFINED;
nRepPos = 0;
- bExp = FALSE;
- bThousand = FALSE;
+ bExp = sal_False;
+ bThousand = sal_False;
nThousand = 0;
- bDecSep = FALSE;
+ bDecSep = sal_False;
nDecPos = -1;
- nExpPos = (USHORT) -1;
- nBlankPos = (USHORT) -1;
+ nExpPos = (sal_uInt16) -1;
+ nBlankPos = (sal_uInt16) -1;
nCntPre = 0;
nCntPost = 0;
nCntExp = 0;
- bFrac = FALSE;
- bBlank = FALSE;
+ bFrac = sal_False;
+ bBlank = sal_False;
nNatNumModifier = 0;
}
-BOOL ImpSvNumberformatScan::Is100SecZero( USHORT i, BOOL bHadDecSep )
+sal_Bool ImpSvNumberformatScan::Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep )
{
- USHORT nIndexPre = PreviousKeyword( i );
+ sal_uInt16 nIndexPre = PreviousKeyword( i );
return (nIndexPre == NF_KEY_S || nIndexPre == NF_KEY_SS)
&& (bHadDecSep // S, SS ','
|| (i>0 && nTypeArray[i-1] == NF_SYMBOLTYPE_STRING));
@@ -1093,9 +1093,9 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData();
xub_StrLen nPos = 0;
- USHORT i = 0;
+ sal_uInt16 i = 0;
short eNewType;
- BOOL bMatchBracket = FALSE;
+ sal_Bool bMatchBracket = sal_False;
bool bHaveGeneral = false; // if General/Standard encountered
SkipStrings(i, nPos);
@@ -1119,8 +1119,8 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
case NF_KEY_M: // M
case NF_KEY_MM: // MM
{ // minute or month
- USHORT nIndexPre = PreviousKeyword(i);
- USHORT nIndexNex = NextKeyword(i);
+ sal_uInt16 nIndexPre = PreviousKeyword(i);
+ sal_uInt16 nIndexNex = NextKeyword(i);
sal_Unicode cChar = PreviousChar(i);
if (nIndexPre == NF_KEY_H || // H
nIndexPre == NF_KEY_HH || // HH
@@ -1187,7 +1187,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
{
if ( Is100SecZero( i, bDecSep ) )
{
- bDecSep = TRUE; // subsequent 0's
+ bDecSep = sal_True; // subsequent 0's
eNewType = NUMBERFORMAT_TIME;
}
else
@@ -1210,18 +1210,18 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
sStrArray[i+1].GetChar(0) == '$' )
{ // as of SV_NUMBERFORMATTER_VERSION_NEW_CURR
eNewType = NUMBERFORMAT_CURRENCY;
- bMatchBracket = TRUE;
+ bMatchBracket = sal_True;
}
else if ( i < nAnzStrings-1 &&
nTypeArray[i+1] == NF_SYMBOLTYPE_STRING &&
sStrArray[i+1].GetChar(0) == '~' )
{ // as of SV_NUMBERFORMATTER_VERSION_CALENDAR
eNewType = NUMBERFORMAT_DATE;
- bMatchBracket = TRUE;
+ bMatchBracket = sal_True;
}
else
{
- USHORT nIndexNex = NextKeyword(i);
+ sal_uInt16 nIndexNex = NextKeyword(i);
if (nIndexNex == NF_KEY_H || // H
nIndexNex == NF_KEY_HH || // HH
nIndexNex == NF_KEY_M || // M
@@ -1239,7 +1239,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
break;
default:
if ( sStrArray[i] == pLoc->getTime100SecSep() )
- bDecSep = TRUE; // for SS,0
+ bDecSep = sal_True; // for SS,0
eNewType = NUMBERFORMAT_UNDEFINED;
break;
}
@@ -1376,7 +1376,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
{
if ( nTypeArray[i] == NF_SYMBOLTYPE_DEL
&& sStrArray[i].GetChar(0) == ']' )
- bMatchBracket = FALSE;
+ bMatchBracket = sal_False;
else
nTypeArray[i] = NF_SYMBOLTYPE_STRING;
nPos = nPos + sStrArray[i].Len();
@@ -1396,7 +1396,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
return 0; // Alles ok
}
-bool ImpSvNumberformatScan::InsertSymbol( USHORT & nPos, svt::NfSymbolType eType, const String& rStr )
+bool ImpSvNumberformatScan::InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr )
{
if (nAnzStrings >= NF_MAX_FORMAT_SYMBOLS || nPos > nAnzStrings)
return false;
@@ -1417,8 +1417,8 @@ bool ImpSvNumberformatScan::InsertSymbol( USHORT & nPos, svt::NfSymbolType eType
return true;
}
-int ImpSvNumberformatScan::FinalScanGetCalendar( xub_StrLen& nPos, USHORT& i,
- USHORT& rAnzResStrings )
+int ImpSvNumberformatScan::FinalScanGetCalendar( xub_StrLen& nPos, sal_uInt16& i,
+ sal_uInt16& rAnzResStrings )
{
if ( sStrArray[i].GetChar(0) == '[' &&
i < nAnzStrings-1 &&
@@ -1496,10 +1496,10 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
const CharClass* pChrCls = pFormatter->GetCharClass();
xub_StrLen nPos = 0; // error correction position
- USHORT i = 0; // symbol loop counter
- USHORT nCounter = 0; // counts digits
+ sal_uInt16 i = 0; // symbol loop counter
+ sal_uInt16 nCounter = 0; // counts digits
nAnzResStrings = nAnzStrings; // counts remaining symbols
- bDecSep = FALSE; // reset in case already used in TypeCheck
+ bDecSep = sal_False; // reset in case already used in TypeCheck
bool bThaiT = false; // Thai T NatNum modifier present
switch (eScannedType)
@@ -1581,7 +1581,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if (bExp) // doppelt
return nPos;
- bExp = TRUE;
+ bExp = sal_True;
nExpPos = i;
if (bDecSep)
nCntPost = nCounter;
@@ -1597,7 +1597,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if (bDecSep && nCounter > 0) // Nachkommastellen
return nPos; // Fehler
- bBlank = TRUE;
+ bBlank = sal_True;
nBlankPos = i;
nCntPre = nCounter;
nCounter = 0;
@@ -1613,7 +1613,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
sStrArray[i].GetChar(0) <= '9')
{
rtl::OUString sDiv;
- USHORT j = i;
+ sal_uInt16 j = i;
while(j < nAnzStrings)
sDiv += sStrArray[j++];
if (rtl::OUString::valueOf(sDiv.toInt32()) == sDiv)
@@ -1742,7 +1742,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
nPos = nPos + sStrArray[i].Len();
if (!bThousand) // only once
- bThousand = TRUE;
+ bThousand = sal_True;
// Eat it, will be reinserted at proper
// grouping positions further down.
nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
@@ -1755,7 +1755,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{ // #,,,,
if ( StringEqualsChar( sOldThousandSep, ' ' ) )
{ // strange, those French..
- BOOL bFirst = TRUE;
+ sal_Bool bFirst = sal_True;
String& rStr = sStrArray[i];
// set a hard Non-Breaking Space or ConvertMode
const String& rSepF = pFormatter->GetNumThousandSep();
@@ -1767,7 +1767,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
nPos = nPos + sStrArray[i].Len();
if ( bFirst )
{
- bFirst = FALSE;
+ bFirst = sal_False;
rStr = rSepF;
nTypeArray[i] = NF_SYMBOLTYPE_THSEP;
}
@@ -1799,7 +1799,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if ( bFirst )
{
- bFirst = FALSE;
+ bFirst = sal_False;
rStr = rSepF;
nTypeArray[i] = NF_SYMBOLTYPE_THSEP;
}
@@ -1876,7 +1876,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
nPos = nPos + sStrArray[i].Len();
nTypeArray[i] = NF_SYMBOLTYPE_DECSEP;
sStrArray[i] = pFormatter->GetNumDecimalSep();
- bDecSep = TRUE;
+ bDecSep = sal_True;
nDecPos = i;
nCntPre = nCounter;
nCounter = 0;
@@ -1894,7 +1894,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{ // or behind /
if (bDecSep && nCounter > 0)// dec.
return nPos; // error
- bBlank = TRUE;
+ bBlank = sal_True;
nBlankPos = i;
nCntPre = nCounter;
nCounter = 0;
@@ -1931,7 +1931,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
return nPos ? nPos : 1; // /? not allowed
else if (!bFrac || (bDecSep && nCounter > 0))
{
- bFrac = TRUE;
+ bFrac = sal_True;
nCntPost = nCounter;
nCounter = 0;
nTypeArray[i] = NF_SYMBOLTYPE_FRAC;
@@ -1969,7 +1969,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
String& rStr = sStrArray[i];
String* pStr = &sStrArray[i];
nTypeArray[i] = NF_SYMBOLTYPE_CURRENCY; // wandeln
- BOOL bHadDash = FALSE;
+ sal_Bool bHadDash = sal_False;
i++;
while ( i < nAnzStrings &&
sStrArray[i].GetChar(0) != ']' )
@@ -1985,7 +1985,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if ( sStrArray[i].GetChar(0) == '-' )
{
- bHadDash = TRUE;
+ bHadDash = sal_True;
pStr = &sStrArray[i];
nTypeArray[i] = NF_SYMBOLTYPE_CURREXT;
}
@@ -2066,7 +2066,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
}
if (bThousand) // Expansion of grouping separators
{
- USHORT nMaxPos;
+ sal_uInt16 nMaxPos;
if (bFrac)
{
if (bBlank)
@@ -2243,7 +2243,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if ( Is100SecZero( i, bDecSep ) )
{
- bDecSep = TRUE;
+ bDecSep = sal_True;
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
String& rStr = sStrArray[i];
i++;
@@ -2271,7 +2271,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if (bThousand) // doppelt
return nPos;
- bThousand = TRUE; // bei Time frei
+ bThousand = sal_True; // bei Time frei
sal_Unicode cChar = pChrCls->upper( NextChar(i) ).GetChar(0);
if ( cChar == cOldKeyH )
nThousand = 1; // H
@@ -2304,7 +2304,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
}
else if ( sStrArray[i] == sOldTime100SecSep )
{
- bDecSep = TRUE;
+ bDecSep = sal_True;
nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP;
if ( bConvertMode )
sStrArray[i] = pLoc->getTime100SecSep();
@@ -2337,7 +2337,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
case NF_KEY_AMPM: // AM/PM
case NF_KEY_AP: // A/P
{
- bExp = TRUE; // missbraucht fuer A/P
+ bExp = sal_True; // missbraucht fuer A/P
sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
nPos = nPos + sStrArray[i].Len();
i++;
@@ -2374,7 +2374,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
break; // of NUMBERFORMAT_TIME
case NUMBERFORMAT_DATETIME:
{
- BOOL bTimePart = FALSE;
+ sal_Bool bTimePart = sal_False;
while (i < nAnzStrings)
{
switch (nTypeArray[i])
@@ -2412,7 +2412,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
if ( bTimePart && Is100SecZero( i, bDecSep ) )
{
- bDecSep = TRUE;
+ bDecSep = sal_True;
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
String& rStr = sStrArray[i];
i++;
@@ -2449,7 +2449,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
}
else if ( sStrArray[i] == sOldTime100SecSep )
{
- bDecSep = TRUE;
+ bDecSep = sal_True;
nTypeArray[i] = NF_SYMBOLTYPE_TIME100SECSEP;
if ( bConvertMode )
sStrArray[i] = pLoc->getTime100SecSep();
@@ -2477,8 +2477,8 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
case NF_KEY_AMPM: // AM/PM
case NF_KEY_AP: // A/P
{
- bTimePart = TRUE;
- bExp = TRUE; // missbraucht fuer A/P
+ bTimePart = sal_True;
+ bExp = sal_True; // missbraucht fuer A/P
sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
nPos = nPos + sStrArray[i].Len();
i++;
@@ -2490,7 +2490,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
case NF_KEY_HH: // HH
case NF_KEY_S: // S
case NF_KEY_SS: // SS
- bTimePart = TRUE;
+ bTimePart = sal_True;
sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
nPos = nPos + sStrArray[i].Len();
i++;
@@ -2521,7 +2521,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
case NF_KEY_GGG : // GGG
case NF_KEY_R : // R
case NF_KEY_RR : // RR
- bTimePart = FALSE;
+ bTimePart = sal_False;
sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
nPos = nPos + sStrArray[i].Len();
i++;
@@ -2574,7 +2574,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
sOldCurString.GetChar(0) )
{
String aTmp( sStrArray[i] );
- USHORT j = i + 1;
+ sal_uInt16 j = i + 1;
while ( aTmp.Len() < sOldCurSymbol.Len() &&
j < nAnzStrings &&
nTypeArray[j] == NF_SYMBOLTYPE_STRING )
@@ -2619,7 +2619,7 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString, String& rComment )
{
xub_StrLen nStringPos = rString.Len();
xub_StrLen nArrPos = 0;
- USHORT iPos = i;
+ sal_uInt16 iPos = i;
do
{
if (sStrArray[i].Len() == 2 &&
@@ -2785,7 +2785,7 @@ xub_StrLen ImpSvNumberformatScan::ScanFormat( String& rString, String& rComment
// res = 0 => Format ok
}
-void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, USHORT nAnz)
+void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, sal_uInt16 nAnz)
{
size_t i,j;
j = 0;
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 1a46b06d697d..6ea2055efe59 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -33,7 +33,7 @@
#include <i18npool/lang.h>
#include <tools/color.hxx>
#include <svl/nfkeytab.hxx>
-#include "nfsymbol.hxx"
+#include <svl/nfsymbol.hxx>
class SvNumberFormatter;
struct ImpSvNumberformatInfo;
@@ -43,7 +43,7 @@ const size_t NF_MAX_FORMAT_SYMBOLS = 100;
const size_t NF_MAX_DEFAULT_COLORS = 10;
// Hack: nThousand==1000 => "Default" occurs in format string
-const USHORT FLAG_STANDARD_IN_FORMAT = 1000;
+const sal_uInt16 FLAG_STANDARD_IN_FORMAT = 1000;
class ImpSvNumberformatScan
{
@@ -53,15 +53,15 @@ public:
~ImpSvNumberformatScan();
void ChangeIntl(); // tauscht Keywords aus
- void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear);
+ void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear);
// tauscht Referenzdatum aus
void ChangeStandardPrec(sal_uInt16 nPrec); // tauscht Standardprecision aus
xub_StrLen ScanFormat( String& rString, String& rComment ); // Aufruf der Scan-Analyse
void CopyInfo(ImpSvNumberformatInfo* pInfo,
- USHORT nAnz); // Kopiert die FormatInfo
- USHORT GetAnzResStrings() const { return nAnzResStrings; }
+ sal_uInt16 nAnz); // Kopiert die FormatInfo
+ sal_uInt16 GetAnzResStrings() const { return nAnzResStrings; }
const CharClass& GetChrCls() const { return *pFormatter->GetCharClass(); }
const LocaleDataWrapper& GetLoc() const { return *pFormatter->GetLocaleData(); }
@@ -73,7 +73,7 @@ public:
InitKeywords();
return sKeyword;
}
- // Keywords used in output like TRUE and FALSE
+ // Keywords used in output like sal_True and sal_False
const String& GetSpecialKeyword( NfKeywordIndex eIdx ) const
{
if ( !sKeyword[eIdx].Len() )
@@ -124,18 +124,18 @@ public:
}
void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge,
- BOOL bSystemToSystem = FALSE )
+ sal_Bool bSystemToSystem = sal_False )
{
- bConvertMode = TRUE;
+ bConvertMode = sal_True;
eNewLnge = eNewLge;
eTmpLnge = eTmpLge;
bConvertSystemToSystem = bSystemToSystem;
}
- void SetConvertMode(BOOL bMode) { bConvertMode = bMode; }
+ void SetConvertMode(sal_Bool bMode) { bConvertMode = bMode; }
// Veraendert nur die Bool-Variable
// (zum temporaeren Unterbrechen des
// Convert-Modus)
- BOOL GetConvertMode() const { return bConvertMode; }
+ sal_Bool GetConvertMode() const { return bConvertMode; }
LanguageType GetNewLnge() const { return eNewLnge; }
// Lesezugriff auf ConvertMode
// und Konvertierungsland/Spr.
@@ -144,9 +144,9 @@ public:
// und Ausgangsland/Spr.
/// get Thai T speciality
- BYTE GetNatNumModifier() const { return nNatNumModifier; }
+ sal_uInt8 GetNatNumModifier() const { return nNatNumModifier; }
/// set Thai T speciality
- void SetNatNumModifier( BYTE n ) { nNatNumModifier = n; }
+ void SetNatNumModifier( sal_uInt8 n ) { nNatNumModifier = n; }
SvNumberFormatter* GetNumberformatter() { return pFormatter; }
// Zugriff auf Formatierer
@@ -165,42 +165,42 @@ private: // ---- privater Teil
String sStrArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Symbole
short nTypeArray[NF_MAX_FORMAT_SYMBOLS]; // Array der Infos
// externe Infos:
- USHORT nAnzResStrings; // Anzahl der Ergebnissymbole
+ sal_uInt16 nAnzResStrings; // Anzahl der Ergebnissymbole
#if !(defined SOLARIS && defined X86)
short eScannedType; // Typ gemaess Scan
#else
int eScannedType; // wg. Optimierung
#endif
- BOOL bThousand; // Mit Tausenderpunkt
- USHORT nThousand; // Zaehlt ....-Folgen
- USHORT nCntPre; // Zaehlt Vorkommastellen
- USHORT nCntPost; // Zaehlt Nachkommastellen
- USHORT nCntExp; // Zaehlt Exp.Stellen, AM/PM
+ sal_Bool bThousand; // Mit Tausenderpunkt
+ sal_uInt16 nThousand; // Zaehlt ....-Folgen
+ sal_uInt16 nCntPre; // Zaehlt Vorkommastellen
+ sal_uInt16 nCntPost; // Zaehlt Nachkommastellen
+ sal_uInt16 nCntExp; // Zaehlt Exp.Stellen, AM/PM
// interne Infos:
- USHORT nAnzStrings; // Anzahl der Symbole
- USHORT nRepPos; // Position eines '*'
- USHORT nExpPos; // interne Position des E
- USHORT nBlankPos; // interne Position des Blank
+ sal_uInt16 nAnzStrings; // Anzahl der Symbole
+ sal_uInt16 nRepPos; // Position eines '*'
+ sal_uInt16 nExpPos; // interne Position des E
+ sal_uInt16 nBlankPos; // interne Position des Blank
short nDecPos; // interne Pos. des ,
- BOOL bExp; // wird bei Lesen des E gesetzt
- BOOL bFrac; // wird bei Lesen des / gesetzt
- BOOL bBlank; // wird bei ' '(Fraction) ges.
- BOOL bDecSep; // Wird beim ersten , gesetzt
- mutable BOOL bKeywordsNeedInit; // Locale dependent keywords need to be initialized
- mutable BOOL bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized
+ sal_Bool bExp; // wird bei Lesen des E gesetzt
+ sal_Bool bFrac; // wird bei Lesen des / gesetzt
+ sal_Bool bBlank; // wird bei ' '(Fraction) ges.
+ sal_Bool bDecSep; // Wird beim ersten , gesetzt
+ mutable sal_Bool bKeywordsNeedInit; // Locale dependent keywords need to be initialized
+ mutable sal_Bool bCompatCurNeedInit; // Locale dependent compatibility currency need to be initialized
String sCurSymbol; // Currency symbol for compatibility format codes
String sCurString; // Currency symbol in upper case
String sCurAbbrev; // Currency abbreviation
String sErrStr; // String fuer Fehlerausgaben
- BOOL bConvertMode; // Wird im Convert-Mode gesetzt
+ sal_Bool bConvertMode; // Wird im Convert-Mode gesetzt
// Land/Sprache, in die der
LanguageType eNewLnge; // gescannte String konvertiert
// wird (fuer Excel Filter)
// Land/Sprache, aus der der
LanguageType eTmpLnge; // gescannte String konvertiert
// wird (fuer Excel Filter)
- BOOL bConvertSystemToSystem; // Whether the conversion is
+ sal_Bool bConvertSystemToSystem; // Whether the conversion is
// from one system locale to
// another system locale (in
// this case the automatic
@@ -209,7 +209,7 @@ private: // ---- privater Teil
xub_StrLen nCurrPos; // Position des Waehrungssymbols
- BYTE nNatNumModifier; // Thai T speciality
+ sal_uInt8 nNatNumModifier; // Thai T speciality
void InitKeywords() const;
void InitSpecialKeyword( NfKeywordIndex eIdx ) const;
@@ -218,32 +218,32 @@ private: // ---- privater Teil
#ifdef _ZFORSCAN_CXX // ----- private Methoden -----
void SetDependentKeywords();
// Setzt die Sprachabh. Keyw.
- void SkipStrings(USHORT& i,xub_StrLen& nPos);// Ueberspringt StringSymbole
- USHORT PreviousKeyword(USHORT i); // Gibt Index des vorangeh.
+ void SkipStrings(sal_uInt16& i,xub_StrLen& nPos);// Ueberspringt StringSymbole
+ sal_uInt16 PreviousKeyword(sal_uInt16 i); // Gibt Index des vorangeh.
// Schluesselworts oder 0
- USHORT NextKeyword(USHORT i); // Gibt Index des naechsten
+ sal_uInt16 NextKeyword(sal_uInt16 i); // Gibt Index des naechsten
// Schluesselworts oder 0
- sal_Unicode PreviousChar(USHORT i); // Gibt letzten Buchstaben
+ sal_Unicode PreviousChar(sal_uInt16 i); // Gibt letzten Buchstaben
// vor der Position,
// skipt EMPTY, STRING, STAR, BLANK
- sal_Unicode NextChar(USHORT i); // Gibt ersten Buchst. danach
- short PreviousType( USHORT i ); // Gibt Typ vor Position,
+ sal_Unicode NextChar(sal_uInt16 i); // Gibt ersten Buchst. danach
+ short PreviousType( sal_uInt16 i ); // Gibt Typ vor Position,
// skipt EMPTY
- BOOL IsLastBlankBeforeFrac(USHORT i); // True <=> es kommt kein ' '
+ sal_Bool IsLastBlankBeforeFrac(sal_uInt16 i); // True <=> es kommt kein ' '
// mehr bis zum '/'
void Reset(); // Reset aller Variablen
// vor Analysestart
short GetKeyWord( const String& sSymbol, // determine keyword at nPos
xub_StrLen nPos ); // return 0 <=> not found
- inline BOOL IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC
+ inline sal_Bool IsAmbiguousE( short nKey ) // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC
{
return (nKey == NF_KEY_EC || nKey == NF_KEY_E) &&
(GetKeywords()[NF_KEY_EC] == GetKeywords()[NF_KEY_E]);
}
// if 0 at strArray[i] is of S,00 or SS,00 or SS"any"00 in ScanType() or FinalScan()
- BOOL Is100SecZero( USHORT i, BOOL bHadDecSep );
+ sal_Bool Is100SecZero( sal_uInt16 i, sal_Bool bHadDecSep );
short Next_Symbol(const String& rStr,
xub_StrLen& nPos,
@@ -253,14 +253,14 @@ private: // ---- privater Teil
xub_StrLen FinalScan( String& rString, String& rComment ); // Endanalyse mit Vorgabe
// des Typs
// -1:= error, return nPos in FinalScan; 0:= no calendar, 1:= calendar found
- int FinalScanGetCalendar( xub_StrLen& nPos, USHORT& i, USHORT& nAnzResStrings );
+ int FinalScanGetCalendar( xub_StrLen& nPos, sal_uInt16& i, sal_uInt16& nAnzResStrings );
/** Insert symbol into nTypeArray and sStrArray, e.g. grouping separator.
If at nPos-1 a symbol type NF_SYMBOLTYPE_EMPTY is present, that is
reused instead of shifting all one up and nPos is decremented! */
- bool InsertSymbol( USHORT & nPos, svt::NfSymbolType eType, const String& rStr );
+ bool InsertSymbol( sal_uInt16 & nPos, svt::NfSymbolType eType, const String& rStr );
- static inline BOOL StringEqualsChar( const String& rStr, sal_Unicode ch )
+ static inline sal_Bool StringEqualsChar( const String& rStr, sal_Unicode ch )
{ return rStr.GetChar(0) == ch && rStr.Len() == 1; }
// Yes, for efficiency get the character first and then compare length
// because in most places where this is used the string is one char.
diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk
deleted file mode 100644
index d9eb9615cf80..000000000000
--- a/svl/source/passwordcontainer/makefile.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svl
-TARGET=passwordcontainer.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/passwordcontainer.obj\
- $(SLO)$/syscreds.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-SHL1OBJS= $(SLOFILES)
-SHL1STDLIBS=\
- $(UNOTOOLSLIB) \
- $(UCBHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component
new file mode 100644
index 000000000000..42eb47cf14dd
--- /dev/null
+++ b/svl/source/passwordcontainer/passwordcontainer.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="stardiv.svl.PasswordContainer">
+ <service name="com.sun.star.task.PasswordContainer"/>
+ </implementation>
+</component>
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 7884ba5e6bb4..1865c0ac9bc8 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1544,24 +1544,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/stardiv.svl.PasswordContainer/UNO/SERVICES")));
- xNewKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.PasswordContainer")));
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index da8b6998f2b2..6e8fe7662e05 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -87,7 +87,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
if( self )
{
DdeTransaction* t;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for( t = self->aTransactions.First(); t; t = self->aTransactions.Next() )
{
switch( nCode )
@@ -96,9 +96,9 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
if( (DWORD)t->nId == nInfo1 )
{
nCode = t->nType & (XCLASS_MASK | XTYP_MASK);
- t->bBusy = FALSE;
+ t->bBusy = sal_False;
t->Done( 0 != hData );
- bFound = TRUE;
+ bFound = sal_True;
}
break;
@@ -109,11 +109,11 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
: DdeGetLastError( pInst->hDdeInstCli );
t = 0;
nRet = 0;
- bFound = TRUE;
+ bFound = sal_True;
break;
case XTYP_ADVDATA:
- bFound = BOOL( *t->pName == hText2 );
+ bFound = sal_Bool( *t->pName == hText2 );
break;
}
if( bFound )
@@ -223,7 +223,7 @@ DdeConnection::~DdeConnection()
// --- DdeConnection::IsConnected() --------------------------------
-BOOL DdeConnection::IsConnected()
+sal_Bool DdeConnection::IsConnected()
{
CONVINFO c;
#ifdef OS2
@@ -232,13 +232,13 @@ BOOL DdeConnection::IsConnected()
c.cb = sizeof( c );
#endif
if ( DdeQueryConvInfo( pImp->hConv, QID_SYNC, &c ) )
- return TRUE;
+ return sal_True;
else
{
DdeInstData* pInst = ImpGetInstData();
pImp->hConv = DdeReconnect( pImp->hConv );
pImp->nStatus = pImp->hConv ? DMLERR_NO_ERROR : DdeGetLastError( pInst->hDdeInstCli );
- return BOOL( pImp->nStatus == DMLERR_NO_ERROR );
+ return sal_Bool( pImp->nStatus == DMLERR_NO_ERROR );
}
}
@@ -281,7 +281,7 @@ DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName,
nTime = n;
nId = 0;
nType = 0;
- bBusy = FALSE;
+ bBusy = sal_False;
rDde.aTransactions.Insert( this );
}
@@ -307,7 +307,7 @@ void DdeTransaction::Execute()
HSZ hItem = *pName;
void* pData = (void*)(const void *)aDdeData;
DWORD nData = (DWORD)(long)aDdeData;
- ULONG nIntFmt = aDdeData.pImp->nFmt;
+ sal_uLong nIntFmt = aDdeData.pImp->nFmt;
UINT nExtFmt = DdeData::GetExternalFormat( nIntFmt );
DdeInstData* pInst = ImpGetInstData();
@@ -343,7 +343,7 @@ void DdeTransaction::Execute()
if ( nId && rDde.pImp->hConv )
DdeAbandonTransaction( pInst->hDdeInstCli, rDde.pImp->hConv, nId);
nId = 0;
- bBusy = TRUE;
+ bBusy = sal_True;
HDDEDATA hRet = DdeClientTransaction( (unsigned char*)pData, nData,
rDde.pImp->hConv, hItem, nExtFmt,
(UINT)nType, TIMEOUT_ASYNC,
@@ -374,7 +374,7 @@ void DdeTransaction::Data( const DdeData* p )
// --- DdeTransaction::Done() --------------------------------------
-void DdeTransaction::Done( BOOL bDataValid )
+void DdeTransaction::Done( sal_Bool bDataValid )
{
aDone.Call( (void*)bDataValid );
}
@@ -390,7 +390,7 @@ DdeLink::DdeLink( DdeConnection& d, const String& aItemName, long n ) :
DdeLink::~DdeLink()
{
- nType = (USHORT)XTYP_ADVSTOP;
+ nType = (sal_uInt16)XTYP_ADVSTOP;
nTime = 0;
}
@@ -428,7 +428,7 @@ DdeHotLink::DdeHotLink( DdeConnection& d, const String& i, long n ) :
// --- DdePoke::DdePoke() ------------------------------------------
DdePoke::DdePoke( DdeConnection& d, const String& i, const char* p,
- long l, ULONG f, long n ) :
+ long l, sal_uLong f, long n ) :
DdeTransaction( d, i, n )
{
aDdeData = DdeData( p, l, f );
diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx
index 6754c2324adb..6afb6c20de87 100644
--- a/svl/source/svdde/ddedata.cxx
+++ b/svl/source/svdde/ddedata.cxx
@@ -42,10 +42,6 @@
#include <osl/thread.h>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVDDE_MISC_CODE" )
-#endif
-
// --- DdeData::DdeData() ------------------------------------------
DdeData::DdeData()
@@ -59,7 +55,7 @@ DdeData::DdeData()
// --- DdeData::DdeData() ------------------------------------------
-DdeData::DdeData( const void* p, long n, ULONG f )
+DdeData::DdeData( const void* p, long n, sal_uLong f )
{
pImp = new DdeDataImp;
pImp->hData = NULL;
@@ -110,12 +106,12 @@ void DdeData::Lock()
// --- DdeData::GetFormat() ----------------------------------------
-ULONG DdeData::GetFormat() const
+sal_uLong DdeData::GetFormat() const
{
return pImp->nFmt;
}
-void DdeData::SetFormat( ULONG nFmt )
+void DdeData::SetFormat( sal_uLong nFmt )
{
pImp->nFmt = nFmt;
}
@@ -149,7 +145,7 @@ DdeData& DdeData::operator = ( const DdeData& rData )
return *this;
}
-ULONG DdeData::GetExternalFormat( ULONG nFmt )
+sal_uLong DdeData::GetExternalFormat( sal_uLong nFmt )
{
switch( nFmt )
{
@@ -165,10 +161,10 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt )
default:
{
-#if defined(WNT) || defined(WIN) || defined( PM2 )
+#if defined(WNT) || defined( PM2 )
String aName( SotExchange::GetFormatName( nFmt ) );
-#if defined(WNT) || defined(WIN)
+#if defined(WNT)
if( aName.Len() )
nFmt = RegisterClipboardFormat( reinterpret_cast<LPCWSTR>(aName.GetBuffer()) );
@@ -178,7 +174,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt )
if( aName.Len() )
{
HATOMTBL hSysTable = WinQuerySystemAtomTable();
- nFmt = (ULONG)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() );
+ nFmt = (sal_uLong)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() );
}
#endif
#endif
@@ -187,7 +183,7 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt )
return nFmt;
}
-ULONG DdeData::GetInternalFormat( ULONG nFmt )
+sal_uLong DdeData::GetInternalFormat( sal_uLong nFmt )
{
switch( nFmt )
{
@@ -204,7 +200,7 @@ ULONG DdeData::GetInternalFormat( ULONG nFmt )
break;
default:
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nFmt >= CF_MAX )
{
TCHAR szName[ 256 ];
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index 39ca8c5b6892..e80470c446c1 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -33,11 +33,11 @@
#include "ddemlos2.h"
-#define WORD USHORT
-#define DWORD ULONG
-#define LPBYTE BYTE*
-#define LPWORD USHORT*
-#define LPDWORD ULONG*
+#define WORD sal_uInt16
+#define DWORD sal_uLong
+#define LPBYTE sal_uInt8*
+#define LPWORD sal_uInt16*
+#define LPDWORD sal_uLong*
#define LPCTSTR PCSZ
#else
@@ -136,7 +136,7 @@ struct DdeDataImp
HDDEDATA hData;
LPBYTE pData;
long nData;
- ULONG nFmt;
+ sal_uLong nFmt;
};
class DdeConnections;
@@ -144,7 +144,7 @@ class DdeServices;
struct DdeInstData
{
- USHORT nRefCount;
+ sal_uInt16 nRefCount;
DdeConnections* pConnections;
// Server
long hCurConvSvr;
diff --git a/svl/source/svdde/ddemlos2.h b/svl/source/svdde/ddemlos2.h
deleted file mode 100644
index a31c14994353..000000000000
--- a/svl/source/svdde/ddemlos2.h
+++ /dev/null
@@ -1,377 +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 _DDEML_H
-#define _DDEML_H
-
-#define INCL_OS2
-#define INCL_WIN
-
-#include <tools/svpm.h>
-#include <tools/solar.h>
-#include <tools/debug.hxx>
-#include <tools/stream.hxx>
-
-typedef LHANDLE HSTR;
-
-#ifndef CALLBACK
-#define CALLBACK
-#endif
-
-
-typedef ULONG HCONVLIST;
-typedef ULONG HCONV;
-typedef ATOM HSZ;
-typedef DDESTRUCT* HDDEDATA;
-
-struct CONVINFO
-{
- USHORT nSize; // sizeof(CONVINFO)
- ULONG nUser; // Userhandle
- HCONV hConvPartner; //
- HSZ hszPartner; // Name der Partnerapp
- HSZ hszServiceReq; // Name des angeforderten Services
- HSZ hszTopic; // -- " -- Topics
- HSZ hszItem; // -- " -- Items
- USHORT nFormat; // Datenformat der akt. Transaktion
- USHORT nType; // Typ der akt. Transaktion (XTYP_*)
- USHORT nStatus; // ST_* der Konversation
- USHORT nConvst; // XST_* der akt. Transaktion
- USHORT nLastError; // letzter Fehler der Transaktion
- HCONVLIST hConvList; // ConvListId , wenn in ConvList
- CONVCONTEXT aConvCtxt; // conversation context
-};
-
-/* the following structure is for use with XTYP_WILDCONNECT processing. */
-
-struct HSZPAIR
-{
- HSZ hszSvc;
- HSZ hszTopic;
-};
-typedef HSZPAIR *PHSZPAIR;
-
-/***** conversation states (usState) *****/
-
-#define XST_NULL 0 /* quiescent states */
-#define XST_INCOMPLETE 1
-#define XST_CONNECTED 2
-#define XST_INIT1 3 /* mid-initiation states */
-#define XST_INIT2 4
-#define XST_REQSENT 5 /* active conversation states */
-#define XST_DATARCVD 6
-#define XST_POKESENT 7
-#define XST_POKEACKRCVD 8
-#define XST_EXECSENT 9
-#define XST_EXECACKRCVD 10
-#define XST_ADVSENT 11
-#define XST_UNADVSENT 12
-#define XST_ADVACKRCVD 13
-#define XST_UNADVACKRCVD 14
-#define XST_ADVDATASENT 15
-#define XST_ADVDATAACKRCVD 16
-
-/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
-#define CADV_LATEACK 0xFFFF
-
-/***** conversation status bits (fsStatus) *****/
-
-#define ST_CONNECTED 0x0001
-#define ST_ADVISE 0x0002
-#define ST_ISLOCAL 0x0004
-#define ST_BLOCKED 0x0008
-#define ST_CLIENT 0x0010
-#define ST_TERMINATED 0x0020
-#define ST_INLIST 0x0040
-#define ST_BLOCKNEXT 0x0080
-#define ST_ISSELF 0x0100
-
-
-/* DDE constants for wStatus field */
-
-//#define DDE_FACK 0x8000
-//#define DDE_FBUSY 0x4000
-//#define DDE_FDEFERUPD 0x4000
-//#define DDE_FACKREQ 0x8000
-//#define DDE_FRELEASE 0x2000
-//#define DDE_FREQUESTED 0x1000
-//#define DDE_FACKRESERVED 0x3ff0
-//#define DDE_FADVRESERVED 0x3fff
-//#define DDE_FDATRESERVED 0x4fff
-//#define DDE_FPOKRESERVED 0xdfff
-//#define DDE_FAPPSTATUS 0x00ff
-#define DDE_FNOTPROCESSED 0x0000
-
-/***** message filter hook types *****/
-
-#define MSGF_DDEMGR 0x8001
-
-/***** codepage constants ****/
-
-#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */
-
-/***** transaction types *****/
-
-#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */
-#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
-#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
-
-#define XCLASS_MASK 0xFC00
-#define XCLASS_BOOL 0x1000
-#define XCLASS_DATA 0x2000
-#define XCLASS_FLAGS 0x4000
-#define XCLASS_NOTIFICATION 0x8000
-
-#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
-#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS )
-#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
-#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL )
-#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
-#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS )
-#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
-#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
-#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
-#define XTYP_POKE (0x0090 | XCLASS_FLAGS )
-#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
-#define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
-#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
-#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
-#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
-
-#define XTYP_MASK 0x00F0
-#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */
-
-/***** Timeout constants *****/
-
-#define TIMEOUT_ASYNC -1L
-
-/***** Transaction ID constants *****/
-
-#define QID_SYNC -1L
-
-/****** public strings used in DDE ******/
-
-#define SZDDESYS_TOPIC "System"
-#define SZDDESYS_ITEM_TOPICS "Topics"
-#define SZDDESYS_ITEM_SYSITEMS "SysItems"
-#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
-#define SZDDESYS_ITEM_STATUS "Status"
-#define SZDDESYS_ITEM_FORMATS "Formats"
-#define SZDDESYS_ITEM_HELP "Help"
-#define SZDDE_ITEM_ITEMLIST "TopicItemList"
-
-
-/****** API entry points ******/
-
-typedef HDDEDATA CALLBACK FNCALLBACK(USHORT wType, USHORT wFmt, HCONV hConv,
- HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG dwData1, ULONG dwData2);
-typedef FNCALLBACK* PFNCALLBACK;
-
-#define CBR_BLOCK 0xffffffffL
-
-/* DLL registration functions */
-
-USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback,
- ULONG afCmd, ULONG ulRes);
-
-/*
- * Callback filter flags for use with standard apps.
- */
-
-#define CBF_FAIL_SELFCONNECTIONS 0x00001000
-#define CBF_FAIL_CONNECTIONS 0x00002000
-#define CBF_FAIL_ADVISES 0x00004000
-#define CBF_FAIL_EXECUTES 0x00008000
-#define CBF_FAIL_POKES 0x00010000
-#define CBF_FAIL_REQUESTS 0x00020000
-#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
-
-#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
-#define CBF_SKIP_REGISTRATIONS 0x00080000
-#define CBF_SKIP_UNREGISTRATIONS 0x00100000
-#define CBF_SKIP_DISCONNECTS 0x00200000
-#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
-
-/*
- * Application command flags
- */
-#define APPCMD_CLIENTONLY 0x00000010L
-#define APPCMD_FILTERINITS 0x00000020L
-#define APPCMD_MASK 0x00000FF0L
-
-/*
- * Application classification flags
- */
-#define APPCLASS_STANDARD 0x00000000L
-#define APPCLASS_MASK 0x0000000FL
-
-
-BOOL DdeUninitialize(ULONG idInst);
-
-/* conversation enumeration functions */
-
-HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic,
- HCONVLIST hConvList, CONVCONTEXT* pCC);
-HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
-BOOL DdeDisconnectList(HCONVLIST hConvList);
-
-/* conversation control functions */
-
-HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic,
- CONVCONTEXT* pCC);
-BOOL DdeDisconnect(HCONV hConv);
-HCONV DdeReconnect(HCONV hConv);
-
-USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransaction, CONVINFO* pConvInfo);
-BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser);
-
-BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction);
-
-
-/* app server interface functions */
-
-BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem);
-BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd);
-
-#define EC_ENABLEALL 0
-#define EC_ENABLEONE ST_BLOCKNEXT
-#define EC_DISABLE ST_BLOCKED
-#define EC_QUERYWAITING 2
-
-HDDEDATA DdeNameService(ULONG idInst, HSZ hsz1, HSZ hsz2, USHORT afCmd);
-
-#define DNS_REGISTER 0x0001
-#define DNS_UNREGISTER 0x0002
-#define DNS_FILTERON 0x0004
-#define DNS_FILTEROFF 0x0008
-
-/* app client interface functions */
-
-HDDEDATA DdeClientTransaction(void* pData, ULONG cbData,
- HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType,
- ULONG dwTimeout, ULONG* pdwResult);
-
-/* data transfer functions */
-
-HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb,
- ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd);
-// HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, ULONG cb, ULONG cbOff);
-ULONG DdeGetData(HDDEDATA hData, void* pDst, ULONG cbMax, ULONG cbOff);
-BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize);
-BOOL DdeUnaccessData(HDDEDATA hData);
-BOOL DdeFreeDataHandle(HDDEDATA hData);
-
-#define HDATA_APPOWNED 0x0001
-
-USHORT DdeGetLastError(ULONG idInst);
-
-#define DMLERR_NO_ERROR 0 /* must be 0 */
-
-#define DMLERR_FIRST 0x4000
-
-#define DMLERR_ADVACKTIMEOUT 0x4000
-#define DMLERR_BUSY 0x4001
-#define DMLERR_DATAACKTIMEOUT 0x4002
-#define DMLERR_DLL_NOT_INITIALIZED 0x4003
-#define DMLERR_DLL_USAGE 0x4004
-#define DMLERR_EXECACKTIMEOUT 0x4005
-#define DMLERR_INVALIDPARAMETER 0x4006
-#define DMLERR_LOW_MEMORY 0x4007
-#define DMLERR_MEMORY_ERROR 0x4008
-#define DMLERR_NOTPROCESSED 0x4009
-#define DMLERR_NO_CONV_ESTABLISHED 0x400a
-#define DMLERR_POKEACKTIMEOUT 0x400b
-#define DMLERR_POSTMSG_FAILED 0x400c
-#define DMLERR_REENTRANCY 0x400d
-#define DMLERR_SERVER_DIED 0x400e
-#define DMLERR_SYS_ERROR 0x400f
-#define DMLERR_UNADVACKTIMEOUT 0x4010
-#define DMLERR_UNFOUND_QUEUE_ID 0x4011
-
-#define DMLERR_LAST 0x4011
-
-HSZ DdeCreateStringHandle(ULONG idInst, PSZ pStr, int iCodePage);
-ULONG DdeQueryString(ULONG idInst, HSZ hsz, PSZ pStr, ULONG cchMax,
- int iCodePage);
-BOOL DdeFreeStringHandle(ULONG idInst, HSZ hsz);
-BOOL DdeKeepStringHandle(ULONG idInst, HSZ hsz);
-int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
-
-
-
-/* von OS/2 nicht unterstuetzte Win3.1 Clipboard-Formate */
-
-#define CF_NOTSUPPORTED_BASE 0xff00
-
-#ifndef CF_DIB
-#define CF_DIB CF_NOTSUPPORTED_BASE+1
-#endif
-
-#ifndef CF_DIF
-#define CF_DIF CF_NOTSUPPORTED_BASE+2
-#endif
-
-#ifndef CF_DSPMETAFILEPICT
-#define CF_DSPMETAFILEPICT CF_NOTSUPPORTED_BASE+3
-#endif
-
-#ifndef CF_METAFILEPICT
-#define CF_METAFILEPICT CF_NOTSUPPORTED_BASE+4
-#endif
-
-#ifndef CF_OEMTEXT
-#define CF_OEMTEXT CF_NOTSUPPORTED_BASE+5
-#endif
-
-#ifndef CF_OWNERDISPLAY
-#define CF_OWNERDISPLAY CF_NOTSUPPORTED_BASE+6
-#endif
-
-#ifndef CF_PENDATA
-#define CF_PENDATA CF_NOTSUPPORTED_BASE+7
-#endif
-
-#ifndef CF_RIFF
-#define CF_RIFF CF_NOTSUPPORTED_BASE+8
-#endif
-
-#ifndef CF_SYLK
-#define CF_SYLK CF_NOTSUPPORTED_BASE+9
-#endif
-
-#ifndef CF_TIFF
-#define CF_TIFF CF_NOTSUPPORTED_BASE+10
-#endif
-
-#ifndef CF_WAVE
-#define CF_WAVE CF_NOTSUPPORTED_BASE+11
-#endif
-
-
-#endif /* _DDEML_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx
index 98aac8369d68..0b6186f4ef5c 100644
--- a/svl/source/svdde/ddestrg.cxx
+++ b/svl/source/svdde/ddestrg.cxx
@@ -34,10 +34,6 @@
#include "ddeimp.hxx"
#include <svl/svdde.hxx>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVDDE_MISC_CODE" )
-#endif
-
// --- DdeString::DdeString() --------------------------------------
DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index ca1f161fada8..a2ff3fda485b 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -44,10 +44,10 @@ enum DdeItemType
struct DdeItemImpData
{
- ULONG nHCnv;
- USHORT nCnt;
+ sal_uLong nHCnv;
+ sal_uInt16 nCnt;
- DdeItemImpData( ULONG nH ) : nHCnv( nH ), nCnt( 1 ) {}
+ DdeItemImpData( sal_uLong nH ) : nHCnv( nH ), nCnt( 1 ) {}
};
SV_DECL_VARARR( DdeItemImp, DdeItemImpData, 1, 1 )
@@ -102,7 +102,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
{
if( hText1 )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( STRING_NOTFOUND != n )
{
String s( sTopics.GetToken( 0, '\t', n ));
@@ -155,7 +155,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
}
#else
String sTopics( pService->Topics() );
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( STRING_NOTFOUND != n )
{
String s( sTopics.GetToken( 0, '\t', n ));
@@ -245,7 +245,7 @@ found:
return (HDDEDATA)NULL;
}
- BOOL bExec = BOOL(nCode == XTYP_EXECUTE);
+ sal_Bool bExec = sal_Bool(nCode == XTYP_EXECUTE);
pTopic = pC->pTopic;
if ( pTopic && !bExec )
pItem = FindItem( *pTopic, hText2 );
@@ -261,7 +261,7 @@ found:
else
pTopic->aItem.Erase();
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
pInst->hCurConvSvr = (long)hConv;
switch( nCode )
{
@@ -350,14 +350,14 @@ found:
pItem->IncMonitor( (long)hConv );
pInst->hCurConvSvr = NULL;
}
- return (HDDEDATA)TRUE;
+ return (HDDEDATA)sal_True;
case XTYP_ADVSTOP:
pItem->DecMonitor( (long)hConv );
if( !pItem->pImpData )
pTopic->StopAdviseLoop();
pInst->hCurConvSvr = NULL;
- return (HDDEDATA)TRUE;
+ return (HDDEDATA)sal_True;
case XTYP_EXECUTE:
{
@@ -405,7 +405,7 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic )
{
DdeTopic* s;
DdeTopics& rTopics = rService.aTopics;
- int bWeiter = FALSE;
+ int bWeiter = sal_False;
DdeInstData* pInst = ImpGetInstData();
DBG_ASSERT(pInst,"SVDDE:No instance data");
@@ -438,7 +438,7 @@ DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem )
DdeItems& rItems = rTopic.aItems;
DdeInstData* pInst = ImpGetInstData();
DBG_ASSERT(pInst,"SVDDE:No instance data");
- int bWeiter = FALSE;
+ int bWeiter = sal_False;
do { // middle check loop
@@ -592,7 +592,7 @@ void DdeService::RemoveTopic( const DdeTopic& rTopic )
// --- DdeService::HasCbFormat() -----------------------------------
-BOOL DdeService::HasCbFormat( USHORT nFmt )
+sal_Bool DdeService::HasCbFormat( sal_uInt16 nFmt )
{
for ( size_t i = 0, n = aFormats.size(); i < n; ++i )
if ( aFormats[ i ] == nFmt )
@@ -602,14 +602,14 @@ BOOL DdeService::HasCbFormat( USHORT nFmt )
// --- DdeService::HasFormat() -------------------------------------
-BOOL DdeService::HasFormat( ULONG nFmt )
+sal_Bool DdeService::HasFormat( sal_uLong nFmt )
{
- return HasCbFormat( (USHORT)DdeData::GetExternalFormat( nFmt ));
+ return HasCbFormat( (sal_uInt16)DdeData::GetExternalFormat( nFmt ));
}
// --- DdeService::AddFormat() -------------------------------------
-void DdeService::AddFormat( ULONG nFmt )
+void DdeService::AddFormat( sal_uLong nFmt )
{
nFmt = DdeData::GetExternalFormat( nFmt );
for ( size_t i = 0, n = aFormats.size(); i < n; ++i )
@@ -620,7 +620,7 @@ void DdeService::AddFormat( ULONG nFmt )
// --- DdeService::RemoveFormat() ----------------------------------
-void DdeService::RemoveFormat( ULONG nFmt )
+void DdeService::RemoveFormat( sal_uLong nFmt )
{
nFmt = DdeData::GetExternalFormat( nFmt );
for ( DdeFormats::iterator it = aFormats.begin(); it < aFormats.end(); ++it ) {
@@ -663,9 +663,9 @@ const String& DdeTopic::GetName() const
// --- DdeTopic::IsSystemTopic() -----------------------------------
-BOOL DdeTopic::IsSystemTopic()
+sal_Bool DdeTopic::IsSystemTopic()
{
- return BOOL (GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC));
+ return sal_Bool (GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC));
}
// --- DdeTopic::AddItem() -----------------------------------------
@@ -759,7 +759,7 @@ void DdeTopic::_Disconnect( long nId )
// --- DdeTopic::Get() ---------------------------------------------
-DdeData* DdeTopic::Get( ULONG nFmt )
+DdeData* DdeTopic::Get( sal_uLong nFmt )
{
if ( aGetLink.IsSet() )
return (DdeData*)aGetLink.Call( (void*)nFmt );
@@ -769,22 +769,22 @@ DdeData* DdeTopic::Get( ULONG nFmt )
// --- DdeTopic::Put() ---------------------------------------------
-BOOL DdeTopic::Put( const DdeData* r )
+sal_Bool DdeTopic::Put( const DdeData* r )
{
if ( aPutLink.IsSet() )
- return (BOOL)aPutLink.Call( (void*) r );
+ return (sal_Bool)aPutLink.Call( (void*) r );
else
- return FALSE;
+ return sal_False;
}
// --- DdeTopic::Execute() -----------------------------------------
-BOOL DdeTopic::Execute( const String* r )
+sal_Bool DdeTopic::Execute( const String* r )
{
if ( aExecLink.IsSet() )
- return (BOOL)aExecLink.Call( (void*)r );
+ return (sal_Bool)aExecLink.Call( (void*)r );
else
- return FALSE;
+ return sal_False;
}
// --- DdeTopic::GetConvId() ---------------------------------------
@@ -798,16 +798,16 @@ long DdeTopic::GetConvId()
// --- DdeTopic::StartAdviseLoop() ---------------------------------
-BOOL DdeTopic::StartAdviseLoop()
+sal_Bool DdeTopic::StartAdviseLoop()
{
- return FALSE;
+ return sal_False;
}
// --- DdeTopic::StopAdviseLoop() ----------------------------------
-BOOL DdeTopic::StopAdviseLoop()
+sal_Bool DdeTopic::StopAdviseLoop()
{
- return FALSE;
+ return sal_False;
}
// --- DdeItem::DdeItem() ------------------------------------------
@@ -877,17 +877,17 @@ void DdeItem::NotifyClient()
// --- DdeItem::IncMonitor() ------------------------------------------
-void DdeItem::IncMonitor( ULONG nHCnv )
+void DdeItem::IncMonitor( sal_uLong nHCnv )
{
if( !pImpData )
{
pImpData = new DdeItemImp;
if( DDEGETPUTITEM == nType )
- ((DdeGetPutItem*)this)->AdviseLoop( TRUE );
+ ((DdeGetPutItem*)this)->AdviseLoop( sal_True );
}
else
{
- for( USHORT n = pImpData->Count(); n; )
+ for( sal_uInt16 n = pImpData->Count(); n; )
if( (*pImpData)[ --n ].nHCnv == nHCnv )
{
++(*pImpData)[ n ].nHCnv;
@@ -900,12 +900,12 @@ void DdeItem::IncMonitor( ULONG nHCnv )
// --- DdeItem::DecMonitor() ------------------------------------------
-void DdeItem::DecMonitor( ULONG nHCnv )
+void DdeItem::DecMonitor( sal_uLong nHCnv )
{
if( pImpData )
{
DdeItemImpData* pData = (DdeItemImpData*)pImpData->GetData();
- for( USHORT n = pImpData->Count(); n; --n, ++pData )
+ for( sal_uInt16 n = pImpData->Count(); n; --n, ++pData )
if( pData->nHCnv == nHCnv )
{
if( !pData->nCnt || !--pData->nCnt )
@@ -916,7 +916,7 @@ void DdeItem::DecMonitor( ULONG nHCnv )
{
delete pImpData, pImpData = 0;
if( DDEGETPUTITEM == nType )
- ((DdeGetPutItem*)this)->AdviseLoop( FALSE );
+ ((DdeGetPutItem*)this)->AdviseLoop( sal_False );
}
}
return ;
@@ -930,7 +930,7 @@ short DdeItem::GetLinks()
{
short nCnt = 0;
if( pImpData )
- for( USHORT n = pImpData->Count(); n; )
+ for( sal_uInt16 n = pImpData->Count(); n; )
nCnt = nCnt + (*pImpData)[ --n ].nCnt;
return nCnt;
}
@@ -962,21 +962,21 @@ DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem )
// --- DdeGetPutData::Get() ----------------------------------------
-DdeData* DdeGetPutItem::Get( ULONG )
+DdeData* DdeGetPutItem::Get( sal_uLong )
{
return 0;
}
// --- DdeGetPutData::Put() ----------------------------------------
-BOOL DdeGetPutItem::Put( const DdeData* )
+sal_Bool DdeGetPutItem::Put( const DdeData* )
{
- return FALSE;
+ return sal_False;
}
// --- DdeGetPutData::AdviseLoop() ---------------------------------
-void DdeGetPutItem::AdviseLoop( BOOL )
+void DdeGetPutItem::AdviseLoop( sal_Bool )
{
}
@@ -1042,7 +1042,7 @@ String DdeService::Formats()
s += '\t';
p = buf;
- switch( (USHORT)f )
+ switch( (sal_uInt16)f )
{
case CF_TEXT:
p = reinterpret_cast<LPCTSTR>(String::CreateFromAscii("TEXT").GetBuffer());
@@ -1089,9 +1089,9 @@ String DdeService::Status()
// --- DdeService::IsBusy() ----------------------------------------
-BOOL DdeService::IsBusy()
+sal_Bool DdeService::IsBusy()
{
- return FALSE;
+ return sal_False;
}
// --- DdeService::GetHelp() ----------------------------------------
@@ -1101,14 +1101,14 @@ String DdeService::GetHelp()
return String();
}
-BOOL DdeTopic::MakeItem( const String& )
+sal_Bool DdeTopic::MakeItem( const String& )
{
- return FALSE;
+ return sal_False;
}
-BOOL DdeService::MakeTopic( const String& )
+sal_Bool DdeService::MakeTopic( const String& )
{
- return FALSE;
+ return sal_False;
}
String DdeService::SysTopicGet( const String& )
@@ -1116,9 +1116,9 @@ String DdeService::SysTopicGet( const String& )
return String();
}
-BOOL DdeService::SysTopicExecute( const String* )
+sal_Bool DdeService::SysTopicExecute( const String* )
{
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/svdde/makefile.mk b/svl/source/svdde/makefile.mk
deleted file mode 100644
index d7f0a790486b..000000000000
--- a/svl/source/svdde/makefile.mk
+++ /dev/null
@@ -1,60 +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.
-#
-#*************************************************************************
-
-
-.IF "$(GUIBASE)"=="WIN"
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=svdde
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-
-SLOFILES= $(SLO)$/ddecli.obj \
- $(SLO)$/ddesvr.obj \
- $(SLO)$/ddedata.obj \
- $(SLO)$/ddestrg.obj \
- $(SLO)$/ddewrap.obj \
- $(SLO)$/ddeinf.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.ELSE
-dummy:
- @echo GUI == "$(GUI)" - nothing to do
-
-.ENDIF
-
diff --git a/svl/source/svsql/converter.cxx b/svl/source/svsql/converter.cxx
index a68d617d8918..6be7854137bb 100644
--- a/svl/source/svsql/converter.cxx
+++ b/svl/source/svsql/converter.cxx
@@ -28,14 +28,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svl.hxx"
-#include "converter.hxx"
+#include <svl/converter.hxx>
-INT32 SvDbaseConverter::ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale)
+sal_Int32 SvDbaseConverter::ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale)
{
return _nScale ? _nLen +2 : _nLen +1;
}
//------------------------------------------------------------------------
-INT32 SvDbaseConverter::ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale)
+sal_Int32 SvDbaseConverter::ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale)
{
return _nScale ? _nLen -2 : _nLen -1;
}
diff --git a/svl/source/svsql/makefile.mk b/svl/source/svsql/makefile.mk
deleted file mode 100644
index e837d022fb1e..000000000000
--- a/svl/source/svsql/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=svsql
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/converter.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/undo/makefile.mk b/svl/source/undo/makefile.mk
deleted file mode 100644
index 8a615d97a03b..000000000000
--- a/svl/source/undo/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=undo
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/undo.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 7176dd894d0e..2124c33bf411 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -31,10 +31,16 @@
#include <com/sun/star/uno/Exception.hpp>
+#include <comphelper/flagguard.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <svl/undo.hxx>
+#include <vector>
+#include <list>
+#include <limits>
+
using ::com::sun::star::uno::Exception;
// STATIC DATA -----------------------------------------------------------
@@ -56,14 +62,20 @@ SfxRepeatTarget::~SfxRepeatTarget()
//------------------------------------------------------------------------
-BOOL SfxUndoAction::IsLinked()
+SfxUndoContext::~SfxUndoContext()
+{
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SfxUndoAction::IsLinked()
{
return bLinked;
}
//------------------------------------------------------------------------
-void SfxUndoAction::SetLinked( BOOL bIsLinked )
+void SfxUndoAction::SetLinked( sal_Bool bIsLinked )
{
bLinked = bIsLinked;
}
@@ -80,15 +92,15 @@ SfxUndoAction::~SfxUndoAction()
SfxUndoAction::SfxUndoAction()
{
DBG_CTOR(SfxUndoAction, 0);
- SetLinked( FALSE );
+ SetLinked( sal_False );
}
//------------------------------------------------------------------------
-BOOL SfxUndoAction::Merge( SfxUndoAction * )
+sal_Bool SfxUndoAction::Merge( SfxUndoAction * )
{
DBG_CHKTHIS(SfxUndoAction, 0);
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------------
@@ -102,7 +114,7 @@ XubString SfxUndoAction::GetComment() const
//------------------------------------------------------------------------
-USHORT SfxUndoAction::GetId() const
+sal_uInt16 SfxUndoAction::GetId() const
{
DBG_CHKTHIS(SfxUndoAction, 0);
return 0;
@@ -118,7 +130,6 @@ XubString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const
//------------------------------------------------------------------------
-
void SfxUndoAction::Undo()
{
// die sind nur konzeptuell pure virtual
@@ -127,6 +138,14 @@ void SfxUndoAction::Undo()
//------------------------------------------------------------------------
+void SfxUndoAction::UndoWithContext( SfxUndoContext& i_context )
+{
+ (void)i_context;
+ Undo();
+}
+
+//------------------------------------------------------------------------
+
void SfxUndoAction::Redo()
{
// die sind nur konzeptuell pure virtual
@@ -135,6 +154,14 @@ void SfxUndoAction::Redo()
//------------------------------------------------------------------------
+void SfxUndoAction::RedoWithContext( SfxUndoContext& i_context )
+{
+ (void)i_context;
+ Redo();
+}
+
+//------------------------------------------------------------------------
+
void SfxUndoAction::Repeat(SfxRepeatTarget&)
{
// die sind nur konzeptuell pure virtual
@@ -144,213 +171,561 @@ void SfxUndoAction::Repeat(SfxRepeatTarget&)
//------------------------------------------------------------------------
-BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const
+sal_Bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const
{
- return TRUE;
+ return sal_True;
}
//========================================================================
+typedef ::std::vector< SfxUndoListener* > UndoListeners;
+
+struct SVL_DLLPRIVATE SfxUndoManager_Data
+{
+ ::osl::Mutex aMutex;
+ SfxUndoArray* pUndoArray;
+ SfxUndoArray* pActUndoArray;
+ SfxUndoArray* pFatherUndoArray;
+
+ sal_Int32 mnLockCount;
+ sal_Int32 mnMarks;
+ sal_Int32 mnEmptyMark;
+ bool mbDoing;
+ bool mbClearUntilTopLevel;
+
+ UndoListeners aListeners;
+
+ SfxUndoManager_Data( size_t i_nMaxUndoActionCount )
+ :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) )
+ ,pActUndoArray( NULL )
+ ,pFatherUndoArray( NULL )
+ ,mnLockCount( 0 )
+ ,mnMarks( 0 )
+ ,mnEmptyMark(MARK_INVALID)
+ ,mbDoing( false )
+ ,mbClearUntilTopLevel( false )
+ {
+ pActUndoArray = pUndoArray;
+ }
+
+ ~SfxUndoManager_Data()
+ {
+ delete pUndoArray;
+ }
+};
+
+//========================================================================
+
+namespace svl { namespace undo { namespace impl
+{
+ //--------------------------------------------------------------------
+ class SVL_DLLPRIVATE LockGuard
+ {
+ public:
+ LockGuard( SfxUndoManager& i_manager )
+ :m_manager( i_manager )
+ {
+ m_manager.ImplEnableUndo_Lock( false );
+ }
+
+ ~LockGuard()
+ {
+ m_manager.ImplEnableUndo_Lock( true );
+ }
+
+ private:
+ SfxUndoManager& m_manager;
+ };
+
+ //--------------------------------------------------------------------
+ typedef void ( SfxUndoListener::*UndoListenerVoidMethod )();
+ typedef void ( SfxUndoListener::*UndoListenerStringMethod )( const String& );
+
+ //--------------------------------------------------------------------
+ struct SVL_DLLPRIVATE NotifyUndoListener : public ::std::unary_function< SfxUndoListener*, void >
+ {
+ NotifyUndoListener()
+ :m_notificationMethod( NULL )
+ ,m_altNotificationMethod( NULL )
+ ,m_sActionComment()
+ {
+ }
+
+ NotifyUndoListener( UndoListenerVoidMethod i_notificationMethod )
+ :m_notificationMethod( i_notificationMethod )
+ ,m_altNotificationMethod( NULL )
+ ,m_sActionComment()
+ {
+ }
+
+ NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment )
+ :m_notificationMethod( NULL )
+ ,m_altNotificationMethod( i_notificationMethod )
+ ,m_sActionComment( i_actionComment )
+ {
+ }
+
+ bool is() const
+ {
+ return ( m_notificationMethod != NULL ) || ( m_altNotificationMethod != NULL );
+ }
+
+ void operator()( SfxUndoListener* i_listener ) const
+ {
+ OSL_PRECOND( is(), "NotifyUndoListener: this will crash!" );
+ if ( m_altNotificationMethod != NULL )
+ {
+ ( i_listener->*m_altNotificationMethod )( m_sActionComment );
+ }
+ else
+ {
+ ( i_listener->*m_notificationMethod )();
+ }
+ }
+
+ private:
+ UndoListenerVoidMethod m_notificationMethod;
+ UndoListenerStringMethod m_altNotificationMethod;
+ String m_sActionComment;
+ };
+
+ //--------------------------------------------------------------------
+ class SVL_DLLPRIVATE UndoManagerGuard
+ {
+ public:
+ UndoManagerGuard( SfxUndoManager_Data& i_managerData )
+ :m_rManagerData( i_managerData )
+ ,m_aGuard( i_managerData.aMutex )
+ ,m_notifiers()
+ {
+ }
+
+ ~UndoManagerGuard();
+
+ void clear()
+ {
+ m_aGuard.clear();
+ }
+
+ void reset()
+ {
+ m_aGuard.reset();
+ }
+
+ void cancelNotifications()
+ {
+ m_notifiers.clear();
+ }
+
+ /** marks the given Undo action for deletion
+
+ The Undo action will be put into a list, whose members will be deleted from within the destructor of the
+ UndoManagerGuard. This deletion will happen without the UndoManager's mutex locked.
+ */
+ void markForDeletion( SfxUndoAction* i_action )
+ {
+ // remember
+ if ( i_action )
+ m_aUndoActionsCleanup.push_back( i_action );
+ }
+
+ /** schedules the given SfxUndoListener method to be called for all registered listeners.
+
+ The notification will happen after the Undo manager's mutex has been released, and after all pending
+ deletions of Undo actions are done.
+ */
+ void scheduleNotification( UndoListenerVoidMethod i_notificationMethod )
+ {
+ m_notifiers.push_back( NotifyUndoListener( i_notificationMethod ) );
+ }
+
+ void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment )
+ {
+ m_notifiers.push_back( NotifyUndoListener( i_notificationMethod, i_actionComment ) );
+ }
+
+ private:
+ SfxUndoManager_Data& m_rManagerData;
+ ::osl::ResettableMutexGuard m_aGuard;
+ ::std::list< SfxUndoAction* > m_aUndoActionsCleanup;
+ ::std::list< NotifyUndoListener > m_notifiers;
+ };
+
+ UndoManagerGuard::~UndoManagerGuard()
+ {
+ // copy members
+ UndoListeners aListenersCopy( m_rManagerData.aListeners );
+
+ // release mutex
+ m_aGuard.clear();
+
+ // delete all actions
+ while ( !m_aUndoActionsCleanup.empty() )
+ {
+ SfxUndoAction* pAction = m_aUndoActionsCleanup.front();
+ m_aUndoActionsCleanup.pop_front();
+ try
+ {
+ delete pAction;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ // handle scheduled notification
+ for ( ::std::list< NotifyUndoListener >::const_iterator notifier = m_notifiers.begin();
+ notifier != m_notifiers.end();
+ ++notifier
+ )
+ {
+ if ( notifier->is() )
+ ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), *notifier );
+ }
+ }
+} } }
+
+using namespace ::svl::undo::impl;
+
+//========================================================================
+
+SfxUndoManager::SfxUndoManager( size_t nMaxUndoActionCount )
+ :m_pData( new SfxUndoManager_Data( nMaxUndoActionCount ) )
+{
+}
-SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount )
- : pFatherUndoArray(0)
- , mbUndoEnabled( true )
+//------------------------------------------------------------------------
+
+SfxUndoManager::~SfxUndoManager()
{
- pUndoArray=new SfxUndoArray(nMaxUndoActionCount);
- pActUndoArray=pUndoArray;
+ UndoListeners aListenersCopy;
+ {
+ UndoManagerGuard aGuard( *m_pData );
+ aListenersCopy = m_pData->aListeners;
+ }
+ ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(),
+ NotifyUndoListener( &SfxUndoListener::undoManagerDying ) );
}
//------------------------------------------------------------------------
+void SfxUndoManager::EnableUndo( bool i_enable )
+{
+ UndoManagerGuard aGuard( *m_pData );
+ ImplEnableUndo_Lock( i_enable );
-SfxUndoManager::~SfxUndoManager()
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable )
{
- delete pUndoArray;
+ if ( !i_enable )
+ ++m_pData->mnLockCount;
+ else
+ {
+ OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" );
+ if ( m_pData->mnLockCount > 0 )
+ --m_pData->mnLockCount;
+ }
}
//------------------------------------------------------------------------
-void SfxUndoManager::EnableUndo( bool bEnable )
+bool SfxUndoManager::IsUndoEnabled() const
{
- mbUndoEnabled = bEnable;
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplIsUndoEnabled_Lock();
}
//------------------------------------------------------------------------
+bool SfxUndoManager::ImplIsUndoEnabled_Lock() const
+{
+ return m_pData->mnLockCount == 0;
+}
+
+//------------------------------------------------------------------------
-void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount )
+void SfxUndoManager::SetMaxUndoActionCount( size_t nMaxUndoActionCount )
{
+ UndoManagerGuard aGuard( *m_pData );
+
// Remove entries from the pActUndoArray when we have to reduce
// the number of entries due to a lower nMaxUndoActionCount.
// Both redo and undo action entries will be removed until we reached the
// new nMaxUndoActionCount.
- long nNumToDelete = pActUndoArray->aUndoActions.Count() - nMaxUndoActionCount;
- if ( nNumToDelete > 0 )
+ long nNumToDelete = m_pData->pActUndoArray->aUndoActions.size() - nMaxUndoActionCount;
+ while ( nNumToDelete > 0 )
{
- while ( nNumToDelete > 0 )
+ size_t nPos = m_pData->pActUndoArray->aUndoActions.size();
+ if ( nPos > m_pData->pActUndoArray->nCurUndoAction )
{
- USHORT nPos = pActUndoArray->aUndoActions.Count();
- if ( nPos > pActUndoArray->nCurUndoAction )
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[nPos-1].pAction;
+ if ( !pAction->IsLinked() )
{
- if ( !pActUndoArray->aUndoActions[nPos-1]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[nPos-1];
- pActUndoArray->aUndoActions.Remove( nPos-1 );
- --nNumToDelete;
- }
+ aGuard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove( nPos-1 );
+ --nNumToDelete;
}
+ }
- if ( nNumToDelete > 0 && pActUndoArray->nCurUndoAction > 0 )
+ if ( nNumToDelete > 0 && m_pData->pActUndoArray->nCurUndoAction > 0 )
+ {
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[0].pAction;
+ if ( !pAction->IsLinked() )
{
- if ( !pActUndoArray->aUndoActions[0]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[0];
- pActUndoArray->aUndoActions.Remove(0);
- --pActUndoArray->nCurUndoAction;
- --nNumToDelete;
- }
+ aGuard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove(0);
+ --m_pData->pActUndoArray->nCurUndoAction;
+ --nNumToDelete;
}
-
- if ( nPos == pActUndoArray->aUndoActions.Count() )
- break; // Cannot delete more entries
}
+
+ if ( nPos == m_pData->pActUndoArray->aUndoActions.size() )
+ break; // Cannot delete more entries
}
- pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
+ m_pData->pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetMaxUndoActionCount() const
+size_t SfxUndoManager::GetMaxUndoActionCount() const
{
- return pActUndoArray->nMaxUndoActions;
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->nMaxUndoActions;
}
//------------------------------------------------------------------------
-void SfxUndoManager::Clear()
+void SfxUndoManager::ImplClearCurrentLevel_NoNotify( UndoManagerGuard& i_guard )
{
- while ( pActUndoArray->aUndoActions.Count() )
+ // clear array
+ while ( !m_pData->pActUndoArray->aUndoActions.empty() )
{
- SfxUndoAction *pAction=
- pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
- pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
- delete pAction;
+ size_t deletePos = m_pData->pActUndoArray->aUndoActions.size() - 1;
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ deletePos ].pAction;
+ i_guard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove( deletePos );
}
- pActUndoArray->nCurUndoAction = 0;
+ m_pData->pActUndoArray->nCurUndoAction = 0;
+
+ m_pData->mnMarks = 0;
+ m_pData->mnEmptyMark = MARK_INVALID;
}
//------------------------------------------------------------------------
-void SfxUndoManager::ClearRedo()
+void SfxUndoManager::Clear()
{
- while ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
- {
- SfxUndoAction *pAction=
- pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
- pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
- delete pAction;
- }
+ UndoManagerGuard aGuard( *m_pData );
+
+ OSL_ENSURE( !ImplIsInListAction_Lock(), "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" );
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ // notify listeners
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
}
//------------------------------------------------------------------------
-void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge )
+void SfxUndoManager::ClearAllLevels()
{
- if( mbUndoEnabled )
+ UndoManagerGuard aGuard( *m_pData );
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ m_pData->mbClearUntilTopLevel = true;
+ }
+ else
{
- // Redo-Actions loeschen
- for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
- nPos > pActUndoArray->nCurUndoAction; --nPos )
- delete pActUndoArray->aUndoActions[nPos-1];
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
+ }
+}
- pActUndoArray->aUndoActions.Remove(
- pActUndoArray->nCurUndoAction,
- pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
+//------------------------------------------------------------------------
- if ( pActUndoArray->nMaxUndoActions )
- {
- SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ?
- pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0;
+void SfxUndoManager::ImplClearRedo_NoLock( bool const i_currentLevel )
+{
+ UndoManagerGuard aGuard( *m_pData );
+ ImplClearRedo( aGuard, i_currentLevel );
+}
- if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) )
- {
- // auf Max-Anzahl anpassen
- if( pActUndoArray == pUndoArray )
- while( pActUndoArray->aUndoActions.Count() >=
- pActUndoArray->nMaxUndoActions &&
- !pActUndoArray->aUndoActions[0]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[0];
- pActUndoArray->aUndoActions.Remove(0);
- --pActUndoArray->nCurUndoAction;
- }
-
- // neue Action anh"angen
- const SfxUndoAction* pTemp = pAction;
- pActUndoArray->aUndoActions.Insert(
- pTemp, pActUndoArray->nCurUndoAction++ );
- return;
- }
- }
- }
- delete pAction;
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ClearRedo()
+{
+ OSL_ENSURE( !IsInListAction(), "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" );
+ ImplClearRedo_NoLock( CurrentLevel );
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetUndoActionCount() const
+void SfxUndoManager::Reset()
{
- return pActUndoArray->nCurUndoAction;
+ UndoManagerGuard aGuard( *m_pData );
+
+ // clear all locks
+ while ( !ImplIsUndoEnabled_Lock() )
+ ImplEnableUndo_Lock( true );
+
+ // cancel all list actions
+ while ( IsInListAction() )
+ ImplLeaveListAction( false, aGuard );
+
+ // clear both stacks
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ // cancel the notifications scheduled by ImplLeaveListAction,
+ // as we want to do an own, dedicated notification
+ aGuard.cancelNotifications();
+
+ // schedule notification
+ aGuard.scheduleNotification( &SfxUndoListener::resetAll );
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const
+void SfxUndoManager::ImplClearUndo( UndoManagerGuard& i_guard )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ while ( m_pData->pActUndoArray->nCurUndoAction > 0 )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetComment(); //!
+ SfxUndoAction* pUndoAction = m_pData->pActUndoArray->aUndoActions[0].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( 0 );
+ i_guard.markForDeletion( pUndoAction );
+ --m_pData->pActUndoArray->nCurUndoAction;
}
- else
+ // TODO: notifications? We don't have clearedUndo, only cleared and clearedRedo at the SfxUndoListener
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ImplClearRedo( UndoManagerGuard& i_guard, bool const i_currentLevel )
+{
+ SfxUndoArray* pUndoArray = ( i_currentLevel == IUndoManager::CurrentLevel ) ? m_pData->pActUndoArray : m_pData->pUndoArray;
+
+ // clearance
+ while ( pUndoArray->aUndoActions.size() > pUndoArray->nCurUndoAction )
{
- XubString aEmpty;
- return aEmpty;
+ size_t deletePos = pUndoArray->aUndoActions.size() - 1;
+ SfxUndoAction* pAction = pUndoArray->aUndoActions[ deletePos ].pAction;
+ pUndoArray->aUndoActions.Remove( deletePos );
+ i_guard.markForDeletion( pAction );
}
+
+ // notification - only if the top level's stack was cleared
+ if ( i_currentLevel == IUndoManager::TopLevel )
+ i_guard.scheduleNotification( &SfxUndoListener::clearedRedo );
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const
+bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bTryMerge, bool bClearRedo, UndoManagerGuard& i_guard )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ if ( !ImplIsUndoEnabled_Lock() || ( m_pData->pActUndoArray->nMaxUndoActions == 0 ) )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetId(); //!
+ i_guard.markForDeletion( pAction );
+ return false;
}
- else
+
+ // merge, if required
+ SfxUndoAction* pMergeWithAction = m_pData->pActUndoArray->nCurUndoAction ?
+ m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction : NULL;
+ if ( bTryMerge && ( !pMergeWithAction || !pMergeWithAction->Merge( pAction ) ) )
{
- return 0;
+ i_guard.markForDeletion( pAction );
+ return false;
+ }
+
+ // clear redo stack, if requested
+ if ( bClearRedo && ( ImplGetRedoActionCount_Lock( CurrentLevel ) > 0 ) )
+ ImplClearRedo( i_guard, IUndoManager::CurrentLevel );
+
+ // respect max number
+ if( m_pData->pActUndoArray == m_pData->pUndoArray )
+ {
+ while( m_pData->pActUndoArray->aUndoActions.size() >=
+ m_pData->pActUndoArray->nMaxUndoActions &&
+ !m_pData->pActUndoArray->aUndoActions[0].pAction->IsLinked() )
+ {
+ i_guard.markForDeletion( m_pData->pActUndoArray->aUndoActions[0].pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove(0);
+ --m_pData->pActUndoArray->nCurUndoAction;
+ }
}
+
+ // append new action
+ m_pData->pActUndoArray->aUndoActions.Insert( pAction, m_pData->pActUndoArray->nCurUndoAction++ );
+ return true;
}
//------------------------------------------------------------------------
-SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const
+void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerge )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ UndoManagerGuard aGuard( *m_pData );
+
+ // add
+ if ( ImplAddUndoAction_NoNotify( pAction, bTryMerge, true, aGuard ) )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]; //!
+ // notify listeners
+ aGuard.scheduleNotification( &SfxUndoListener::undoActionAdded, pAction->GetComment() );
}
- else
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::GetUndoActionCount( bool const i_currentLevel ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->nCurUndoAction;
+}
+
+//------------------------------------------------------------------------
+
+XubString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentLevel ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ String sComment;
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ DBG_ASSERT( nNo < pUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment: illegal index!" );
+ if( nNo < pUndoArray->nCurUndoAction )
{
- return 0;
+ sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction - 1 - nNo ].pAction->GetComment();
}
+ return sComment;
+}
+
+//------------------------------------------------------------------------
+
+sal_uInt16 SfxUndoManager::GetUndoActionId() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" );
+ if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
+ return NULL;
+ return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId();
+}
+
+//------------------------------------------------------------------------
+
+SfxUndoAction* SfxUndoManager::GetUndoAction( size_t nNo ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ DBG_ASSERT( nNo < m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" );
+ if( nNo >= m_pData->pActUndoArray->nCurUndoAction )
+ return NULL;
+ return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1-nNo].pAction;
}
//------------------------------------------------------------------------
@@ -358,196 +733,284 @@ SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const
/** clears the redo stack and removes the top undo action */
void SfxUndoManager::RemoveLastUndoAction()
{
- DBG_ASSERT( pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" );
- if( pActUndoArray->nCurUndoAction )
- {
- pActUndoArray->nCurUndoAction--;
+ UndoManagerGuard aGuard( *m_pData );
+
+ ENSURE_OR_RETURN_VOID( m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" );
- // delete redo-actions and top action
- USHORT nPos;
- for ( nPos = pActUndoArray->aUndoActions.Count(); nPos > pActUndoArray->nCurUndoAction; --nPos )
- delete pActUndoArray->aUndoActions[nPos-1];
+ m_pData->pActUndoArray->nCurUndoAction--;
- pActUndoArray->aUndoActions.Remove(
- pActUndoArray->nCurUndoAction,
- pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
+ // delete redo-actions and top action
+ for ( size_t nPos = m_pData->pActUndoArray->aUndoActions.size(); nPos > m_pData->pActUndoArray->nCurUndoAction; --nPos )
+ {
+ aGuard.markForDeletion( m_pData->pActUndoArray->aUndoActions[nPos-1].pAction );
}
+
+ m_pData->pActUndoArray->aUndoActions.Remove(
+ m_pData->pActUndoArray->nCurUndoAction,
+ m_pData->pActUndoArray->aUndoActions.size() - m_pData->pActUndoArray->nCurUndoAction );
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Undo( USHORT )
+bool SfxUndoManager::IsDoing() const
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->mbDoing;
+}
- BOOL bRet = FALSE;
+//------------------------------------------------------------------------
- try
- {
- DBG_ASSERT( pActUndoArray == pUndoArray, "svl::SfxUndoManager::Undo(), LeaveListAction() not yet called!" );
- if ( pActUndoArray->nCurUndoAction )
- {
- Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] );
- bRet = TRUE;
- }
- }
- catch( Exception& e )
- {
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
- }
- mbUndoEnabled = bUndoWasEnabled;
- return bRet;
+sal_Bool SfxUndoManager::Undo()
+{
+ return ImplUndo( NULL );
}
//------------------------------------------------------------------------
-void SfxUndoManager::Undo( SfxUndoAction &rAction )
+sal_Bool SfxUndoManager::UndoWithContext( SfxUndoContext& i_context )
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ return ImplUndo( &i_context );
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull )
+{
+ UndoManagerGuard aGuard( *m_pData );
+ OSL_ENSURE( !IsDoing(), "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" );
+
+ ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
+ LockGuard aLockGuard( *this );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Undo: not possible when within a list action!" );
+ return sal_False;
+ }
+
+ if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Undo: undo stack is empty!" );
+ return sal_False;
+ }
+
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ --m_pData->pActUndoArray->nCurUndoAction ].pAction;
+ const String sActionComment = pAction->GetComment();
try
{
- rAction.Undo();
+ // clear the guard/mutex before calling into the SfxUndoAction - this can be an extension-implemented UNO component
+ // nowadays ...
+ aGuard.clear();
+ if ( i_contextOrNull != NULL )
+ pAction->UndoWithContext( *i_contextOrNull );
+ else
+ pAction->Undo();
+ aGuard.reset();
}
- catch( Exception& e )
+ catch( ... )
{
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
+ aGuard.reset();
+
+ // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if
+ // we still find pAction in our current Undo array
+ size_t nCurAction = 0;
+ while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ if ( m_pData->pActUndoArray->aUndoActions[ nCurAction++ ].pAction == pAction )
+ {
+ // the Undo action is still there ...
+ // assume the error is a permanent failure, and clear the Undo stack
+ ImplClearUndo( aGuard );
+ throw;
+ }
+ }
+ OSL_ENSURE( false, "SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ throw;
}
- mbUndoEnabled = bUndoWasEnabled;
+ aGuard.scheduleNotification( &SfxUndoListener::actionUndone, sActionComment );
+
+ return sal_True;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRedoActionCount() const
+size_t SfxUndoManager::GetRedoActionCount( bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction; //!
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplGetRedoActionCount_Lock( i_currentLevel );
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetRedoActionComment( USHORT nNo ) const
+size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetComment(); //!
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->aUndoActions.size() - pUndoArray->nCurUndoAction;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const
+XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetId(); //!
+ UndoManagerGuard aGuard( *m_pData );
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Redo( USHORT )
+sal_Bool SfxUndoManager::Redo()
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
-
- BOOL bRet = FALSE;
+ return ImplRedo( NULL );
+}
- try
- {
- if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
- {
- Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] );
- bRet = TRUE;
- }
- }
- catch( Exception& e )
- {
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
- }
+//------------------------------------------------------------------------
- mbUndoEnabled = bUndoWasEnabled;
- return bRet;
+sal_Bool SfxUndoManager::RedoWithContext( SfxUndoContext& i_context )
+{
+ return ImplRedo( &i_context );
}
//------------------------------------------------------------------------
-void SfxUndoManager::Redo( SfxUndoAction &rAction )
+sal_Bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull )
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ UndoManagerGuard aGuard( *m_pData );
+ OSL_ENSURE( !IsDoing(), "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" );
+
+ ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
+ LockGuard aLockGuard( *this );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Redo: not possible when within a list action!" );
+ return sal_False;
+ }
+
+ if ( m_pData->pActUndoArray->nCurUndoAction >= m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Redo: redo stack is empty!" );
+ return sal_False;
+ }
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction++ ].pAction;
+ const String sActionComment = pAction->GetComment();
try
{
- rAction.Redo();
+ // clear the guard/mutex before calling into the SfxUndoAction - this can be a extension-implemented UNO component
+ // nowadays ...
+ aGuard.clear();
+ if ( i_contextOrNull != NULL )
+ pAction->RedoWithContext( *i_contextOrNull );
+ else
+ pAction->Redo();
+ aGuard.reset();
}
- catch( Exception& e )
+ catch( ... )
{
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
+ aGuard.reset();
+
+ // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if
+ // we still find pAction in our current Undo array
+ size_t nCurAction = 0;
+ while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ if ( m_pData->pActUndoArray->aUndoActions[ nCurAction ].pAction == pAction )
+ {
+ // the Undo action is still there ...
+ // assume the error is a permanent failure, and clear the Undo stack
+ ImplClearRedo( aGuard, IUndoManager::CurrentLevel );
+ throw;
+ }
+ ++nCurAction;
+ }
+ OSL_ENSURE( false, "SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ throw;
}
- mbUndoEnabled = bUndoWasEnabled;
+ aGuard.scheduleNotification( &SfxUndoListener::actionRedone, sActionComment );
+
+ return sal_True;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRepeatActionCount() const
+size_t SfxUndoManager::GetRepeatActionCount() const
{
- return pActUndoArray->aUndoActions.Count();
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->aUndoActions.size();
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo ) const
+XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget) const
{
- return pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 - nNo ]
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction
->GetRepeatComment(rTarget);
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT /*nFrom*/, USHORT /*nCount*/ )
+sal_Bool SfxUndoManager::Repeat( SfxRepeatTarget &rTarget )
{
- if ( pActUndoArray->aUndoActions.Count() )
+ UndoManagerGuard aGuard( *m_pData );
+ if ( !m_pData->pActUndoArray->aUndoActions.empty() )
{
- Repeat( rTarget, *pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 ] );
- return TRUE;
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction;
+ aGuard.clear();
+ if ( pAction->CanRepeat( rTarget ) )
+ pAction->Repeat( rTarget );
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------------
-void SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction )
+sal_Bool SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const
{
- if ( rAction.CanRepeat(rTarget) )
- rAction.Repeat(rTarget);
+ UndoManagerGuard aGuard( *m_pData );
+ if ( !m_pData->pActUndoArray->aUndoActions.empty() )
+ {
+ size_t nActionNo = m_pData->pActUndoArray->aUndoActions.size() - 1;
+ return m_pData->pActUndoArray->aUndoActions[nActionNo].pAction->CanRepeat(rTarget);
+ }
+ return sal_False;
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const
+void SfxUndoManager::AddUndoListener( SfxUndoListener& i_listener )
{
- return rAction.CanRepeat(rTarget);
+ UndoManagerGuard aGuard( *m_pData );
+ m_pData->aListeners.push_back( &i_listener );
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo ) const
+void SfxUndoManager::RemoveUndoListener( SfxUndoListener& i_listener )
{
- if ( pActUndoArray->aUndoActions.Count() > nNo )
+ UndoManagerGuard aGuard( *m_pData );
+ for ( UndoListeners::iterator lookup = m_pData->aListeners.begin();
+ lookup != m_pData->aListeners.end();
+ ++lookup
+ )
{
- USHORT nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo;
- return pActUndoArray->aUndoActions[nActionNo]->CanRepeat(rTarget);
+ if ( (*lookup) == &i_listener )
+ {
+ m_pData->aListeners.erase( lookup );
+ break;
+ }
}
-
- return FALSE;
}
//------------------------------------------------------------------------
void SfxUndoManager::EnterListAction(
- const XubString& rComment, const XubString &rRepeatComment, USHORT nId )
+ const XubString& rComment, const XubString &rRepeatComment, sal_uInt16 nId )
/* [Beschreibung]
@@ -555,74 +1018,275 @@ void SfxUndoManager::EnterListAction(
*/
{
- if( !mbUndoEnabled )
+ UndoManagerGuard aGuard( *m_pData );
+
+ if( !ImplIsUndoEnabled_Lock() )
return;
- if ( !pUndoArray->nMaxUndoActions )
+ if ( !m_pData->pUndoArray->nMaxUndoActions )
return;
- pFatherUndoArray=pActUndoArray;
- SfxListUndoAction *pAction=new SfxListUndoAction(
- rComment, rRepeatComment, nId, pActUndoArray);
- AddUndoAction( pAction );
- pActUndoArray=pAction;
+ m_pData->pFatherUndoArray = m_pData->pActUndoArray;
+ SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, m_pData->pActUndoArray );
+ OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) );
+ // expected to succeed: all conditions under which it could fail should have been checked already
+ m_pData->pActUndoArray = pAction;
+
+ // notification
+ aGuard.scheduleNotification( &SfxUndoListener::listActionEntered, rComment );
}
//------------------------------------------------------------------------
-void SfxUndoManager::LeaveListAction()
+bool SfxUndoManager::IsInListAction() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplIsInListAction_Lock();
+}
-/* [Beschreibung]
+//------------------------------------------------------------------------
- Verlaesst die aktuelle ListAction und geht eine Ebene nach oben.
-*/
+bool SfxUndoManager::ImplIsInListAction_Lock() const
{
- if ( !mbUndoEnabled )
- return;
+ return ( m_pData->pActUndoArray != m_pData->pUndoArray );
+}
- if ( !pUndoArray->nMaxUndoActions )
- return;
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::GetListActionDepth() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ size_t nDepth(0);
- if( pActUndoArray == pUndoArray )
+ SfxUndoArray* pLookup( m_pData->pActUndoArray );
+ while ( pLookup != m_pData->pUndoArray )
{
- OSL_FAIL( "svl::SfxUndoManager::LeaveListAction(), called without calling EnterListAction()!" );
- return;
+ pLookup = pLookup->pFatherUndoArray;
+ ++nDepth;
}
- DBG_ASSERT(pActUndoArray->pFatherUndoArray,"svl::SfxUndoManager::LeaveListAction(), no father undo array!?");
+ return nDepth;
+}
+
+//------------------------------------------------------------------------
- SfxUndoArray* pTmp=pActUndoArray;
- pActUndoArray=pActUndoArray->pFatherUndoArray;
+size_t SfxUndoManager::LeaveListAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+ size_t nCount = ImplLeaveListAction( false, aGuard );
- // If no undo action where added, delete the undo list action
- SfxUndoAction *pTmpAction= pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1];
- if(!pTmp->nCurUndoAction)
+ if ( m_pData->mbClearUntilTopLevel )
{
- pActUndoArray->aUndoActions.Remove( --pActUndoArray->nCurUndoAction);
- delete pTmpAction;
+ ImplClearCurrentLevel_NoNotify( aGuard );
+ if ( !ImplIsInListAction_Lock() )
+ {
+ m_pData->mbClearUntilTopLevel = false;
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
+ }
+ nCount = 0;
}
- else
+
+ return nCount;
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::LeaveAndMergeListAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplLeaveListAction( true, aGuard );
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard& i_guard )
+{
+ if ( !ImplIsUndoEnabled_Lock() )
+ return 0;
+
+ if ( !m_pData->pUndoArray->nMaxUndoActions )
+ return 0;
+
+ if( !ImplIsInListAction_Lock() )
+ {
+ OSL_TRACE( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" );
+ return 0;
+ }
+
+ DBG_ASSERT( m_pData->pActUndoArray->pFatherUndoArray, "SfxUndoManager::ImplLeaveListAction, no father undo array!?" );
+
+ // the array/level which we're about to leave
+ SfxUndoArray* pArrayToLeave = m_pData->pActUndoArray;
+ // one step up
+ m_pData->pActUndoArray = m_pData->pActUndoArray->pFatherUndoArray;
+
+ // If no undo actions were added to the list, delete the list action
+ const size_t nListActionElements = pArrayToLeave->nCurUndoAction;
+ if ( nListActionElements == 0 )
+ {
+ SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( --m_pData->pActUndoArray->nCurUndoAction );
+ i_guard.markForDeletion( pCurrentAction );
+
+ i_guard.scheduleNotification( &SfxUndoListener::listActionCancelled );
+ return 0;
+ }
+
+ // now that it is finally clear the list action is non-trivial, and does participate in the Undo stack, clear
+ // the redo stack
+ ImplClearRedo( i_guard, IUndoManager::CurrentLevel );
+
+ SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction;
+ SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction * >( pCurrentAction );
+ ENSURE_OR_RETURN( pListAction, "SfxUndoManager::ImplLeaveListAction: list action expected at this position!", nListActionElements );
+
+ if ( i_merge )
+ {
+ // merge the list action with its predecessor on the same level
+ OSL_ENSURE( m_pData->pActUndoArray->nCurUndoAction > 1,
+ "SfxUndoManager::ImplLeaveListAction: cannot merge the list action if there's no other action on the same level - check this beforehand!" );
+ if ( m_pData->pActUndoArray->nCurUndoAction > 1 )
+ {
+ SfxUndoAction* pPreviousAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction - 2 ].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( m_pData->pActUndoArray->nCurUndoAction - 2 );
+ --m_pData->pActUndoArray->nCurUndoAction;
+ pListAction->aUndoActions.Insert( pPreviousAction, 0 );
+ ++pListAction->nCurUndoAction;
+
+ pListAction->SetComment( pPreviousAction->GetComment() );
+ }
+ }
+
+ // if the undo array has no comment, try to get it from its children
+ if ( pListAction->GetComment().Len() == 0 )
+ {
+ for( size_t n = 0; n < pListAction->aUndoActions.size(); n++ )
+ {
+ if( pListAction->aUndoActions[n].pAction->GetComment().Len() )
+ {
+ pListAction->SetComment( pListAction->aUndoActions[n].pAction->GetComment() );
+ break;
+ }
+ }
+ }
+
+ // notify listeners
+ i_guard.scheduleNotification( &SfxUndoListener::listActionLeft, pListAction->GetComment() );
+
+ // outta here
+ return nListActionElements;
+}
+
+//------------------------------------------------------------------------
+UndoStackMark SfxUndoManager::MarkTopUndoAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ OSL_ENSURE( !IsInListAction(),
+ "SfxUndoManager::MarkTopUndoAction(): suspicious call!" );
+ OSL_ENSURE((m_pData->mnMarks + 1) < (m_pData->mnEmptyMark - 1),
+ "SfxUndoManager::MarkTopUndoAction(): mark overflow!");
+
+ size_t const nActionPos = m_pData->pUndoArray->nCurUndoAction;
+ if (0 == nActionPos)
+ {
+ --m_pData->mnEmptyMark;
+ return m_pData->mnEmptyMark;
+ }
+
+ m_pData->pUndoArray->aUndoActions[ nActionPos-1 ].aMarks.push_back(
+ ++m_pData->mnMarks );
+ return m_pData->mnMarks;
+}
+
+//------------------------------------------------------------------------
+void SfxUndoManager::RemoveMark( UndoStackMark const i_mark )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ if ((m_pData->mnEmptyMark < i_mark) || (MARK_INVALID == i_mark))
+ {
+ return; // nothing to remove
+ }
+ else if (i_mark == m_pData->mnEmptyMark)
{
- // if the undo array has no comment, try to get it from its children
- SfxListUndoAction* pList = dynamic_cast< SfxListUndoAction * >( pTmpAction );
- if( pList && pList->GetComment().Len() == 0 )
+ --m_pData->mnEmptyMark; // never returned from MarkTop => invalid
+ return;
+ }
+
+ for ( size_t i=0; i<m_pData->pUndoArray->aUndoActions.size(); ++i )
+ {
+ MarkedUndoAction& rAction = m_pData->pUndoArray->aUndoActions[i];
+ for ( ::std::vector< UndoStackMark >::iterator markPos = rAction.aMarks.begin();
+ markPos != rAction.aMarks.end();
+ ++markPos
+ )
{
- USHORT n;
- for( n = 0; n < pList->aUndoActions.Count(); n++ )
+ if ( *markPos == i_mark )
{
- if( pList->aUndoActions[n]->GetComment().Len() )
- {
- pList->SetComment( pList->aUndoActions[n]->GetComment() );
- break;
- }
+ rAction.aMarks.erase( markPos );
+ return;
}
}
}
+ OSL_ENSURE( false, "SfxUndoManager::RemoveMark: mark not found!" );
+ // TODO: this might be too offensive. There are situations where we implicitly remove marks
+ // without our clients, in particular the client which created the mark, having a chance to know
+ // about this.
+}
+
+//------------------------------------------------------------------------
+bool SfxUndoManager::HasTopUndoActionMark( UndoStackMark const i_mark )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ size_t nActionPos = m_pData->pUndoArray->nCurUndoAction;
+ if ( nActionPos == 0 )
+ {
+ return (i_mark == m_pData->mnEmptyMark);
+ }
+
+ const MarkedUndoAction& rAction =
+ m_pData->pUndoArray->aUndoActions[ nActionPos-1 ];
+ for ( ::std::vector< UndoStackMark >::const_iterator markPos = rAction.aMarks.begin();
+ markPos != rAction.aMarks.end();
+ ++markPos
+ )
+ {
+ if ( *markPos == i_mark )
+ return true;
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ size_t nActionsToRemove = i_count;
+ while ( nActionsToRemove )
+ {
+ SfxUndoAction* pActionToRemove = m_pData->pUndoArray->aUndoActions[0].pAction;
+
+ if ( IsInListAction() && ( m_pData->pUndoArray->nCurUndoAction == 1 ) )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!" );
+ return;
+ }
+
+ aGuard.markForDeletion( pActionToRemove );
+ m_pData->pUndoArray->aUndoActions.Remove( 0 );
+ --m_pData->pUndoArray->nCurUndoAction;
+ --nActionsToRemove;
+ }
}
//------------------------------------------------------------------------
-USHORT SfxListUndoAction::GetId() const
+sal_uInt16 SfxListUndoAction::GetId() const
{
return nId;
}
@@ -655,7 +1319,7 @@ SfxListUndoAction::SfxListUndoAction
(
const XubString &rComment,
const XubString rRepeatComment,
- USHORT Id,
+ sal_uInt16 Id,
SfxUndoArray *pFather
)
: nId(Id), aComment(rComment), aRepeatComment(rRepeatComment)
@@ -668,8 +1332,17 @@ SfxListUndoAction::SfxListUndoAction
void SfxListUndoAction::Undo()
{
- for(INT16 i=nCurUndoAction-1;i>=0;i--)
- aUndoActions[i]->Undo();
+ for(size_t i=nCurUndoAction;i>0;)
+ aUndoActions[--i].pAction->Undo();
+ nCurUndoAction=0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxListUndoAction::UndoWithContext( SfxUndoContext& i_context )
+{
+ for(size_t i=nCurUndoAction;i>0;)
+ aUndoActions[--i].pAction->UndoWithContext( i_context );
nCurUndoAction=0;
}
@@ -677,39 +1350,48 @@ void SfxListUndoAction::Undo()
void SfxListUndoAction::Redo()
{
- for(USHORT i=nCurUndoAction;i<aUndoActions.Count();i++)
- aUndoActions[i]->Redo();
- nCurUndoAction = aUndoActions.Count();
+ for(size_t i=nCurUndoAction;i<aUndoActions.size();i++)
+ aUndoActions[i].pAction->Redo();
+ nCurUndoAction = aUndoActions.size();
+}
+
+//------------------------------------------------------------------------
+
+void SfxListUndoAction::RedoWithContext( SfxUndoContext& i_context )
+{
+ for(size_t i=nCurUndoAction;i<aUndoActions.size();i++)
+ aUndoActions[i].pAction->RedoWithContext( i_context );
+ nCurUndoAction = aUndoActions.size();
}
//------------------------------------------------------------------------
void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget)
{
- for(USHORT i=0;i<nCurUndoAction;i++)
- aUndoActions[i]->Repeat(rTarget);
+ for(size_t i=0;i<nCurUndoAction;i++)
+ aUndoActions[i].pAction->Repeat(rTarget);
}
//------------------------------------------------------------------------
-BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const
+sal_Bool SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const
{
- for(USHORT i=0;i<nCurUndoAction;i++)
- if(!aUndoActions[i]->CanRepeat(r))
- return FALSE;
- return TRUE;
+ for(size_t i=0;i<nCurUndoAction;i++)
+ if(!aUndoActions[i].pAction->CanRepeat(r))
+ return sal_False;
+ return sal_True;
}
//------------------------------------------------------------------------
-BOOL SfxListUndoAction::Merge( SfxUndoAction *pNextAction )
+sal_Bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction )
{
- return aUndoActions.Count() && aUndoActions[aUndoActions.Count()-1]->Merge( pNextAction );
+ return !aUndoActions.empty() && aUndoActions[aUndoActions.size()-1].pAction->Merge( pNextAction );
}
//------------------------------------------------------------------------
-SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
+SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager)
/* [Beschreibung]
Richtet eine LinkAction ein, die auf einen weiteren UndoManager zeigt.
@@ -719,10 +1401,15 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
{
pUndoManager = pManager;
+ SfxUndoManager* pUndoManagerImplementation = dynamic_cast< SfxUndoManager* >( pManager );
+ ENSURE_OR_THROW( pUndoManagerImplementation != NULL, "unsupported undo manager implementation!" );
+ // yes, this cast is dirty. But reaching into the the SfxUndoManager's implementation,
+ // directly accessing its internal stack, and tampering with an action on that stack
+ // is dirty, too.
if ( pManager->GetMaxUndoActionCount() )
{
- USHORT nPos = pManager->GetUndoActionCount()-1;
- pAction = pManager->pActUndoArray->aUndoActions[nPos];
+ size_t nPos = pManager->GetUndoActionCount()-1;
+ pAction = pUndoManagerImplementation->m_pData->pActUndoArray->aUndoActions[nPos].pAction;
pAction->SetLinked();
}
else
@@ -734,7 +1421,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
void SfxLinkUndoAction::Undo()
{
if ( pAction )
- pUndoManager->Undo(1);
+ pUndoManager->Undo();
}
//------------------------------------------------------------------------
@@ -742,15 +1429,15 @@ void SfxLinkUndoAction::Undo()
void SfxLinkUndoAction::Redo()
{
if ( pAction )
- pUndoManager->Redo(1);
+ pUndoManager->Redo();
}
//------------------------------------------------------------------------
-BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
+sal_Bool SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
{
- return pAction && pUndoManager->CanRepeat(r,*pAction);
+ return pAction && pAction->CanRepeat(r);
}
@@ -759,8 +1446,8 @@ BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
void SfxLinkUndoAction::Repeat(SfxRepeatTarget&r)
{
- if ( pAction )
- pUndoManager->Repeat(r,*pAction);
+ if ( pAction && pAction->CanRepeat( r ) )
+ pAction->Repeat( r );
}
@@ -790,7 +1477,7 @@ XubString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const
SfxLinkUndoAction::~SfxLinkUndoAction()
{
if( pAction )
- pAction->SetLinked( FALSE );
+ pAction->SetLinked( sal_False );
}
@@ -798,21 +1485,18 @@ SfxLinkUndoAction::~SfxLinkUndoAction()
SfxUndoArray::~SfxUndoArray()
{
- while ( aUndoActions.Count() )
+ while ( !aUndoActions.empty() )
{
- SfxUndoAction *pAction =
- aUndoActions[ aUndoActions.Count() - 1 ];
- aUndoActions.Remove( aUndoActions.Count() - 1 );
+ SfxUndoAction *pAction = aUndoActions[ aUndoActions.size() - 1 ].pAction;
+ aUndoActions.Remove( aUndoActions.size() - 1 );
delete pAction;
}
}
-USHORT SfxLinkUndoAction::GetId() const
+sal_uInt16 SfxLinkUndoAction::GetId() const
{
return pAction ? pAction->GetId() : 0;
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/uno/makefile.mk b/svl/source/uno/makefile.mk
deleted file mode 100644
index 3414871305d5..000000000000
--- a/svl/source/uno/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svl
-TARGET=unoiface
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/registerservices.obj\
- $(SLO)$/pathservice.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx
index 49f00d6a7845..5caca580694f 100644
--- a/svl/source/uno/registerservices.cxx
+++ b/svl/source/uno/registerservices.cxx
@@ -61,37 +61,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo (
- void * /* _pServiceManager */, void * _pRegistryKey)
-{
- if (_pRegistryKey)
- {
- Reference< css::registry::XRegistryKey > xRegistryKey (
- reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey));
- Reference< css::registry::XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey (
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" )) );
- xNewKey->createKey (
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier")) );
-
- xNewKey = xRegistryKey->createKey (
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" )) );
- xNewKey->createKey (
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter")) );
-
- xNewKey = xRegistryKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM("/com.sun.star.comp.svl.PathService/UNO/SERVICES")) );
- xNewKey->createKey (
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.config.SpecialConfigManager")) );
-
- return sal_True;
- }
- return sal_False;
-}
-
SVL_DLLPUBLIC void* SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/)
{
diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx
index aa5b75e2f350..7ec1a3b929ac 100644
--- a/svl/unx/source/svdde/ddedummy.cxx
+++ b/svl/unx/source/svdde/ddedummy.cxx
@@ -43,7 +43,7 @@ DdeData::DdeData( const DdeData& )
{
}
-DdeData::DdeData( const void*, long, ULONG)
+DdeData::DdeData( const void*, long, sal_uLong)
{
}
@@ -51,11 +51,11 @@ DdeData::~DdeData( void )
{
}
-void DdeData::SetFormat( ULONG )
+void DdeData::SetFormat( sal_uLong )
{
}
-ULONG DdeData::GetFormat() const
+sal_uLong DdeData::GetFormat() const
{
return 0L;
}
@@ -112,7 +112,7 @@ void DdeTransaction::Execute(void)
{
}
-void DdeTransaction::Done( BOOL )
+void DdeTransaction::Done( sal_Bool )
{
}
@@ -169,34 +169,34 @@ void DdeTopic::RemoveItem( const DdeItem& )
{
}
-DdeData* DdeTopic::Get( ULONG )
+DdeData* DdeTopic::Get( sal_uLong )
{
return NULL;
}
-BOOL DdeTopic::MakeItem( const String& )
+sal_Bool DdeTopic::MakeItem( const String& )
{
- return FALSE;
+ return sal_False;
}
-BOOL DdeTopic::StartAdviseLoop()
+sal_Bool DdeTopic::StartAdviseLoop()
{
- return FALSE;
+ return sal_False;
}
-BOOL DdeTopic::StopAdviseLoop()
+sal_Bool DdeTopic::StopAdviseLoop()
{
- return FALSE;
+ return sal_False;
}
-BOOL DdeTopic::Execute( const String* )
+sal_Bool DdeTopic::Execute( const String* )
{
- return FALSE;
+ return sal_False;
}
-BOOL DdeTopic::Put( const DdeData* )
+sal_Bool DdeTopic::Put( const DdeData* )
{
- return FALSE;
+ return sal_False;
}
const String& DdeTopic::GetName() const
@@ -229,17 +229,17 @@ String DdeService::SysTopicGet(const String& rString) {
return rString;
}
-BOOL DdeService::SysTopicExecute(const String*) {
- return FALSE;
+sal_Bool DdeService::SysTopicExecute(const String*) {
+ return sal_False;
}
DdeService::~DdeService()
{
}
-BOOL DdeService::IsBusy()
+sal_Bool DdeService::IsBusy()
{
- return FALSE;
+ return sal_False;
}
String DdeService::GetHelp()
@@ -247,7 +247,7 @@ String DdeService::GetHelp()
return String::EmptyString();
}
-void DdeService::AddFormat( ULONG )
+void DdeService::AddFormat( sal_uLong )
{
}
@@ -259,9 +259,9 @@ void DdeService::RemoveTopic( const DdeTopic& )
{
}
-BOOL DdeService::MakeTopic( const String& )
+sal_Bool DdeService::MakeTopic( const String& )
{
- return FALSE;
+ return sal_False;
}
const String& DdeService::GetName() const
@@ -306,17 +306,17 @@ DdeItem( rItem )
{
}
-DdeData* DdeGetPutItem::Get( ULONG )
+DdeData* DdeGetPutItem::Get( sal_uLong )
{
return NULL;
}
-BOOL DdeGetPutItem::Put( const DdeData* )
+sal_Bool DdeGetPutItem::Put( const DdeData* )
{
- return FALSE;
+ return sal_False;
}
-void DdeGetPutItem::AdviseLoop( BOOL )
+void DdeGetPutItem::AdviseLoop( sal_Bool )
{
}
diff --git a/svl/unx/source/svdde/makefile.mk b/svl/unx/source/svdde/makefile.mk
deleted file mode 100644
index 3d2ae4308821..000000000000
--- a/svl/unx/source/svdde/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svl
-TARGET=svdde
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svl.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/ddedummy.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk
deleted file mode 100644
index c19dc58914a1..000000000000
--- a/svl/util/makefile.mk
+++ /dev/null
@@ -1,120 +0,0 @@
-#*************************************************************************
-#*
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=svl
-TARGET=svl
-RESTARGETSIMPLE=svs
-GEN_HID=TRUE
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- general section ----------------------------------------------------
-
-.IF "$(GUI)"!="UNX"
-LIB2TARGET= $(LB)$/isvl.lib
-LIB2FILES= $(LB)$/_isvl.lib
-.ENDIF
-
-LIB1TARGET= $(SLB)$/svl.lib
-LIB1FILES= \
- $(SLB)$/config.lib \
- $(SLB)$/svdde.lib \
- $(SLB)$/undo.lib \
- $(SLB)$/numbers.lib \
- $(SLB)$/numbers.uno.lib \
- $(SLB)$/filerec.lib \
- $(SLB)$/filepicker.lib \
- $(SLB)$/items.lib \
- $(SLB)$/misc.lib \
- $(SLB)$/notify.lib \
- $(SLB)$/unoiface.lib \
- $(SLB)$/svarray.lib \
- $(SLB)$/svsql.lib
-
-# generation of resourcen-lib ----------------------------------------
-
-RESLIB1NAME= $(RESTARGETSIMPLE)
-RESLIB1SRSFILES=\
- $(SRS)$/items.srs \
- $(SRS)$/misc.srs
-
-# build the shared library --------------------------------------------------
-
-SHL1TARGET= svl$(DLLPOSTFIX)
-SHL1IMPLIB= _isvl
-SHL1USE_EXPORTS=name
-#Do not link with VCL or any other library that links with VCL
-SHL1STDLIBS= \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(I18NISOLANGLIB) \
- $(UCBHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SOTLIB) \
- $(SALLIB)
-
-.IF "$(GUI)"=="WNT"
-SHL1STDLIBS+= \
- $(UWINAPILIB) \
- $(ADVAPI32LIB) \
- $(GDI32LIB)
-.ENDIF # WNT
-
-SHL1LIBS= $(SLB)$/svl.lib
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1DEPN= $(SLB)$/svl.lib
-DEFLIB1NAME=svl
-DEF1DES =SvTools lite
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(GUI)"=="UNX"
-SVTTARGETS= $(LB)$/lib$(SHL1TARGET)$(DLLPOST)
-.ELSE
-SVTTARGETS= $(LB)$/isvl.lib
-.ENDIF
-
-# just a quick fix - has to be cleaned up some day...
-.IF "$(L10N-framework)"==""
-ALL: $(SLB)$/svl.lib \
- $(MISC)$/$(SHL1TARGET).def \
- $(SVTTARGETS) \
- ALLTAR
-.ENDIF # "$(L10N-framework)"==""
-
-.INCLUDE : target.mk
-
diff --git a/svl/util/svl.component b/svl/util/svl.component
new file mode 100644
index 000000000000..4af1a31f5782
--- /dev/null
+++ b/svl/util/svl.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.svl.PathService">
+ <service name="com.sun.star.config.SpecialConfigManager"/>
+ </implementation>
+ <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject">
+ <service name="com.sun.star.util.NumberFormatsSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject">
+ <service name="com.sun.star.util.NumberFormatter"/>
+ </implementation>
+</component>
diff --git a/comphelper/source/processfactory/makefile.mk b/svtools/AllLangResTarget_productregistration.mk
index 531291bb3a15..888e342fad64 100644
--- a/comphelper/source/processfactory/makefile.mk
+++ b/svtools/AllLangResTarget_productregistration.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,28 +25,23 @@
#
#*************************************************************************
-PRJ=..$/..
-PRJNAME=comphelper
-TARGET=processfactory
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,productregistration))
-ENABLE_EXCEPTIONS=TRUE
+$(eval $(call gb_AllLangResTarget_set_reslocation,productregistration,svtools))
-# --- Settings common for the whole project -----
+$(eval $(call gb_AllLangResTarget_add_srs,productregistration,\
+ svt/productregistration \
+))
+$(eval $(call gb_SrsTarget_SrsTarget,svt/productregistration))
-# --- Settings ----------------------------------
+$(eval $(call gb_SrsTarget_set_include,svt/productregistration,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_SrsTarget_add_files,svt/productregistration,\
+ svtools/source/productregistration/registrationdlg.src \
+))
-# --- Types -------------------------------------
-
-# --- Files -------------------------------------
-
-SLOFILES= $(SLO)$/processfactory.obj \
- $(SLO)$/componentfactory.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/AllLangResTarget_svt.mk b/svtools/AllLangResTarget_svt.mk
new file mode 100644
index 000000000000..0311c80d1316
--- /dev/null
+++ b/svtools/AllLangResTarget_svt.mk
@@ -0,0 +1,71 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,svt))
+
+$(eval $(call gb_AllLangResTarget_set_reslocation,svt,svtools))
+
+$(eval $(call gb_AllLangResTarget_add_srs,svt,\
+ svt/res \
+))
+
+$(eval $(call gb_SrsTarget_SrsTarget,svt/res))
+
+$(eval $(call gb_SrsTarget_set_include,svt/res,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc \
+ -I$(realpath $(SRCDIR)/svtools/source/inc) \
+))
+
+$(eval $(call gb_SrsTarget_add_files,svt/res,\
+ svtools/source/brwbox/editbrowsebox.src \
+ svtools/source/contnr/fileview.src \
+ svtools/source/contnr/svcontnr.src \
+ svtools/source/contnr/templwin.src \
+ svtools/source/control/calendar.src \
+ svtools/source/control/ctrlbox.src \
+ svtools/source/control/ctrltool.src \
+ svtools/source/control/filectrl.src \
+ svtools/source/dialogs/addresstemplate.src \
+ svtools/source/dialogs/colrdlg.src \
+ svtools/source/dialogs/filedlg2.src \
+ svtools/source/dialogs/formats.src \
+ svtools/source/dialogs/prnsetup.src \
+ svtools/source/dialogs/so3res.src \
+ svtools/source/dialogs/wizardmachine.src \
+ svtools/source/filter.vcl/filter/exportdialog.src \
+ svtools/source/java/javaerror.src \
+ svtools/source/misc/ehdl.src \
+ svtools/source/misc/helpagent.src \
+ svtools/source/misc/imagemgr.src \
+ svtools/source/misc/langtab.src \
+ svtools/source/misc/undo.src \
+ svtools/source/plugapp/testtool.src \
+ svtools/source/toolpanel/toolpanel.src \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Executable_bmp.mk b/svtools/Executable_bmp.mk
new file mode 100644
index 000000000000..3b2fd2a1203c
--- /dev/null
+++ b/svtools/Executable_bmp.mk
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,bmp))
+
+$(eval $(call gb_Executable_set_include,bmp,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc/svtools \
+ -I$(WORKDIR)/inc/ \
+ -I$(OUTDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \
+ -I$(realpath $(SRCDIR)/svtools/source/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,bmp,\
+ sal \
+ tl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,bmp,\
+ svtools/bmpmaker/bmp \
+ svtools/bmpmaker/bmpcore \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/source/officeinstdir/makefile.mk b/svtools/Executable_bmpsum.mk
index dfe195da662a..492dabeb58f8 100644
--- a/comphelper/source/officeinstdir/makefile.mk
+++ b/svtools/Executable_bmpsum.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,26 +25,26 @@
#
#*************************************************************************
-PRJ=..$/..
-PRJINC=..$/..$/inc
-PRJNAME=comphelper
-TARGET=officeinstdir
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings common for the whole project -----
-
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= $(SLO)$/officeinstallationdirectories.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
+$(eval $(call gb_Executable_Executable,bmpsum))
+
+$(eval $(call gb_Executable_set_include,bmpsum,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/ \
+ -I$(OUTDIR)/inc/offuh/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,bmpsum,\
+ sal \
+ tl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,bmpsum,\
+ svtools/bmpmaker/bmpsum \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/source/eventattachermgr/makefile.mk b/svtools/Executable_g2g.mk
index 26aca0467d7d..c817cff43ccd 100644
--- a/comphelper/source/eventattachermgr/makefile.mk
+++ b/svtools/Executable_g2g.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,26 +25,28 @@
#
#*************************************************************************
-PRJ=..$/..
-PRJINC=..$/..$/inc
-PRJNAME=comphelper
-TARGET=evtattmgr
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings common for the whole project -----
-
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= $(SLO)$/eventattachermgr.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
+$(eval $(call gb_Executable_Executable,g2g))
+
+$(eval $(call gb_Executable_set_include,g2g,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/ \
+ -I$(OUTDIR)/inc/offuh/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,g2g,\
+ jvmfwk \
+ sal \
+ svt \
+ tl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,g2g,\
+ svtools/bmpmaker/g2g \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/source/container/makefile.mk b/svtools/JunitTest_svtools_unoapi.mk
index 97a066f9802a..baaefc84c5be 100644
--- a/comphelper/source/container/makefile.mk
+++ b/svtools/JunitTest_svtools_unoapi.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,31 +25,29 @@
#
#*************************************************************************
-PRJ=..$/..
-PRJINC=..$/..$/inc
-PRJNAME=comphelper
-TARGET=container
+$(eval $(call gb_JunitTest_JunitTest,svtools_unoapi))
-ENABLE_EXCEPTIONS=TRUE
+$(eval $(call gb_JunitTest_set_defs,svtools_unoapi,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.sce=$(SRCDIR)/svtools/qa/unoapi/svtools.sce \
+ -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/svtools/qa/unoapi/knownissues.xcl \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/svtools/qa/unoapi/testdocuments \
+))
-# --- Settings ----------------------------------
+$(eval $(call gb_JunitTest_add_jars,svtools_unoapi,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_JunitTest_add_sourcefiles,svtools_unoapi,\
+ svtools/qa/unoapi/Test \
+))
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/namecontainer.obj \
- $(SLO)$/enumhelper.obj \
- $(SLO)$/container.obj \
- $(SLO)$/containermultiplexer.obj \
- $(SLO)$/IndexedPropertyValuesContainer.obj \
- $(SLO)$/embeddedobjectcontainer.obj \
- $(SLO)$/NamedPropertyValuesContainer.obj \
- $(SLO)$/enumerablemap.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
+$(eval $(call gb_JunitTest_add_classes,svtools_unoapi,\
+ org.openoffice.svtools.qa.unoapi.Test \
+))
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Library_hatchwindowfactory.mk b/svtools/Library_hatchwindowfactory.mk
new file mode 100644
index 000000000000..96e8f10c3306
--- /dev/null
+++ b/svtools/Library_hatchwindowfactory.mk
@@ -0,0 +1,60 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,hatchwindowfactory))
+
+$(eval $(call gb_Library_set_componentfile,hatchwindowfactory,svtools/source/hatchwindow/hatchwindowfactory))
+
+$(eval $(call gb_Library_set_include,hatchwindowfactory,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc/svtools \
+ -I$(WORKDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(OUTDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\
+ cppu \
+ cppuhelper \
+ sal \
+ tk \
+ tl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,hatchwindowfactory,\
+ svtools/source/hatchwindow/documentcloser \
+ svtools/source/hatchwindow/hatchwindow \
+ svtools/source/hatchwindow/hatchwindowfactory \
+ svtools/source/hatchwindow/ipwin \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Library_productregistration.mk b/svtools/Library_productregistration.mk
new file mode 100644
index 000000000000..726e5a3b664b
--- /dev/null
+++ b/svtools/Library_productregistration.mk
@@ -0,0 +1,60 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,productregistration))
+
+$(eval $(call gb_Library_set_componentfile,productregistration,svtools/source/productregistration/productregistration.uno))
+
+$(eval $(call gb_Library_set_include,productregistration,\
+ $$(SOLARINC) \
+ -I$(WORKDIR)/inc/svtools \
+ -I$(WORKDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(OUTDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_add_linked_libs,productregistration,\
+ cppu \
+ cppuhelper \
+ sal \
+ svl \
+ tk \
+ tl \
+ utl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,productregistration,\
+ svtools/source/productregistration/productregistration \
+ svtools/source/productregistration/registrationdlg \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
new file mode 100644
index 000000000000..da2721476c70
--- /dev/null
+++ b/svtools/Library_svt.mk
@@ -0,0 +1,309 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,svt))
+
+$(eval $(call gb_Library_add_package_headers,svt,svtools_inc))
+
+$(eval $(call gb_Library_add_precompiled_header,svt,$(SRCDIR)/svtools/inc/pch/precompiled_svtools))
+
+$(eval $(call gb_Library_set_componentfile,svt,svtools/util/svt))
+
+$(eval $(call gb_Library_set_include,svt,\
+ $$(INCLUDE) \
+ -I$(WORKDIR)/inc/svtools \
+ -I$(WORKDIR)/inc/ \
+ -I$(OUTDIR)/inc/ \
+ -I$(realpath $(SRCDIR)/svtools/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \
+ -I$(realpath $(SRCDIR)/svtools/source/inc) \
+ -I$(realpath $(SRCDIR)/svtools/inc/pch) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_Library_set_defs,svt,\
+ $$(DEFS) \
+ -DSVT_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,svt,\
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nisolang1 \
+ i18nutil \
+ icuuc \
+ jvmfwk \
+ salhelper \
+ sal \
+ sot \
+ svl \
+ tk \
+ tl \
+ ucbhelper \
+ utl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+ifeq ($(SYSTEM_JPEG),YES)
+$(eval $(call gb_Library_add_linked_libs,svt,\
+ jpeg \
+))
+$(eval $(call gb_Library_set_ldflags,svt,\
+ $$(filter-out -L/usr/lib/jvm%,$$(LDFLAGS)) \
+))
+else
+$(eval $(call gb_Library_add_linked_static_libs,svt,\
+ jpeglib \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,svt,\
+ svtools/source/brwbox/brwbox1 \
+ svtools/source/brwbox/brwbox2 \
+ svtools/source/brwbox/brwbox3 \
+ svtools/source/brwbox/brwhead \
+ svtools/source/brwbox/datwin \
+ svtools/source/brwbox/ebbcontrols \
+ svtools/source/brwbox/editbrowsebox \
+ svtools/source/brwbox/editbrowsebox2 \
+ svtools/source/config/accessibilityoptions \
+ svtools/source/config/apearcfg \
+ svtools/source/config/colorcfg \
+ svtools/source/config/extcolorcfg \
+ svtools/source/config/fontsubstconfig \
+ svtools/source/config/helpopt \
+ svtools/source/config/htmlcfg \
+ svtools/source/config/itemholder2 \
+ svtools/source/config/menuoptions \
+ svtools/source/config/miscopt \
+ svtools/source/config/optionsdrawinglayer \
+ svtools/source/config/printoptions \
+ svtools/source/contnr/contentenumeration \
+ svtools/source/contnr/fileview \
+ svtools/source/contnr/imivctl1 \
+ svtools/source/contnr/imivctl2 \
+ svtools/source/contnr/ivctrl \
+ svtools/source/contnr/svicnvw \
+ svtools/source/contnr/svimpbox \
+ svtools/source/contnr/svimpicn \
+ svtools/source/contnr/svlbitm \
+ svtools/source/contnr/svlbox \
+ svtools/source/contnr/svtabbx \
+ svtools/source/contnr/svtreebx \
+ svtools/source/contnr/templwin \
+ svtools/source/contnr/tooltiplbox \
+ svtools/source/contnr/treelist \
+ svtools/source/control/asynclink \
+ svtools/source/control/calendar \
+ svtools/source/control/collatorres \
+ svtools/source/control/ctrlbox \
+ svtools/source/control/ctrltool \
+ svtools/source/control/filectrl \
+ svtools/source/control/filectrl2 \
+ svtools/source/control/fileurlbox \
+ svtools/source/control/fixedhyper \
+ svtools/source/control/fmtfield \
+ svtools/source/control/headbar \
+ svtools/source/control/hyperlabel \
+ svtools/source/control/indexentryres \
+ svtools/source/control/inettbc \
+ svtools/source/control/prgsbar \
+ svtools/source/control/roadmap \
+ svtools/source/control/ruler \
+ svtools/source/control/scriptedtext \
+ svtools/source/control/scrwin \
+ svtools/source/control/stdctrl \
+ svtools/source/control/stdmenu \
+ svtools/source/control/tabbar \
+ svtools/source/control/taskbar \
+ svtools/source/control/taskbox \
+ svtools/source/control/taskmisc \
+ svtools/source/control/taskstat \
+ svtools/source/control/toolbarmenu \
+ svtools/source/control/toolbarmenuacc \
+ svtools/source/control/urlcontrol \
+ svtools/source/control/valueacc \
+ svtools/source/control/valueset \
+ svtools/source/dialogs/addresstemplate \
+ svtools/source/dialogs/colctrl \
+ svtools/source/dialogs/colrdlg \
+ svtools/source/dialogs/filedlg \
+ svtools/source/dialogs/filedlg2 \
+ svtools/source/dialogs/insdlg \
+ svtools/source/dialogs/mcvmath \
+ svtools/source/dialogs/prnsetup \
+ svtools/source/dialogs/property \
+ svtools/source/dialogs/roadmapwizard \
+ svtools/source/dialogs/wizardmachine \
+ svtools/source/dialogs/wizdlg \
+ svtools/source/edit/editsyntaxhighlighter \
+ svtools/source/edit/svmedit \
+ svtools/source/edit/svmedit2 \
+ svtools/source/edit/sychconv \
+ svtools/source/edit/syntaxhighlight \
+ svtools/source/edit/textdata \
+ svtools/source/edit/textdoc \
+ svtools/source/edit/texteng \
+ svtools/source/edit/textundo \
+ svtools/source/edit/textview \
+ svtools/source/edit/textwindowpeer \
+ svtools/source/edit/txtattr \
+ svtools/source/edit/xtextedt \
+ svtools/source/filter.vcl/filter/FilterConfigCache \
+ svtools/source/filter.vcl/filter/FilterConfigItem \
+ svtools/source/filter.vcl/filter/SvFilterOptionsDialog \
+ svtools/source/filter.vcl/filter/exportdialog \
+ svtools/source/filter.vcl/filter/filter \
+ svtools/source/filter.vcl/filter/filter2 \
+ svtools/source/filter.vcl/filter/sgfbram \
+ svtools/source/filter.vcl/filter/sgvmain \
+ svtools/source/filter.vcl/filter/sgvspln \
+ svtools/source/filter.vcl/filter/sgvtext \
+ svtools/source/filter.vcl/igif/decode \
+ svtools/source/filter.vcl/igif/gifread \
+ svtools/source/filter.vcl/ixbm/xbmread \
+ svtools/source/filter.vcl/ixpm/xpmread \
+ svtools/source/filter.vcl/jpeg/jpeg \
+ svtools/source/filter.vcl/wmf/emfwr \
+ svtools/source/filter.vcl/wmf/enhwmf \
+ svtools/source/filter.vcl/wmf/winmtf \
+ svtools/source/filter.vcl/wmf/winwmf \
+ svtools/source/filter.vcl/wmf/wmf \
+ svtools/source/filter.vcl/wmf/wmfwr \
+ svtools/source/graphic/descriptor \
+ svtools/source/graphic/graphic \
+ svtools/source/graphic/graphicunofactory \
+ svtools/source/graphic/grfattr \
+ svtools/source/graphic/grfcache \
+ svtools/source/graphic/grfmgr \
+ svtools/source/graphic/grfmgr2 \
+ svtools/source/graphic/provider \
+ svtools/source/graphic/renderer \
+ svtools/source/graphic/transformer \
+ svtools/source/java/javacontext \
+ svtools/source/java/javainteractionhandler \
+ svtools/source/misc/acceleratorexecute \
+ svtools/source/misc/chartprettypainter \
+ svtools/source/misc/cliplistener \
+ svtools/source/misc/dialogclosedlistener \
+ svtools/source/misc/dialogcontrolling \
+ svtools/source/misc/ehdl \
+ svtools/source/misc/embedhlp \
+ svtools/source/misc/embedtransfer \
+ svtools/source/misc/filterutils \
+ svtools/source/misc/filechangedchecker \
+ svtools/source/misc/helpagentwindow \
+ svtools/source/misc/imagemgr \
+ svtools/source/misc/imageresourceaccess \
+ svtools/source/misc/imap \
+ svtools/source/misc/imap2 \
+ svtools/source/misc/imap3 \
+ svtools/source/misc/itemdel \
+ svtools/source/misc/langtab \
+ svtools/source/misc/langhelp \
+ svtools/source/misc/stringtransfer \
+ svtools/source/misc/svtaccessiblefactory \
+ svtools/source/misc/svtdata \
+ svtools/source/misc/templatefoldercache \
+ svtools/source/misc/transfer \
+ svtools/source/misc/transfer2 \
+ svtools/source/misc/unitconv \
+ svtools/source/misc/wallitem \
+ svtools/source/misc/xwindowitem \
+ svtools/source/plugapp/ttprops \
+ svtools/source/svhtml/htmlkywd \
+ svtools/source/svhtml/htmlout \
+ svtools/source/svhtml/htmlsupp \
+ svtools/source/svhtml/parhtml \
+ svtools/source/svrtf/parrtf \
+ svtools/source/svrtf/rtfkeywd \
+ svtools/source/svrtf/rtfout \
+ svtools/source/svrtf/svparser \
+ svtools/source/table/defaultinputhandler \
+ svtools/source/table/gridtablerenderer \
+ svtools/source/table/tablecontrol \
+ svtools/source/table/tablecontrol_impl \
+ svtools/source/table/tabledatawindow \
+ svtools/source/table/mousefunction \
+ svtools/source/table/cellvalueconversion \
+ svtools/source/table/tablegeometry \
+ svtools/source/toolpanel/drawerlayouter \
+ svtools/source/toolpanel/dummypanel \
+ svtools/source/toolpanel/paneldecklisteners \
+ svtools/source/toolpanel/paneltabbar \
+ svtools/source/toolpanel/paneltabbarpeer \
+ svtools/source/toolpanel/refbase \
+ svtools/source/toolpanel/tabbargeometry \
+ svtools/source/toolpanel/tablayouter \
+ svtools/source/toolpanel/toolpanel \
+ svtools/source/toolpanel/toolpanelcollection \
+ svtools/source/toolpanel/toolpaneldeck \
+ svtools/source/toolpanel/toolpaneldeckpeer \
+ svtools/source/toolpanel/toolpaneldrawer \
+ svtools/source/toolpanel/toolpaneldrawerpeer \
+ svtools/source/uno/addrtempuno \
+ svtools/source/uno/contextmenuhelper \
+ svtools/source/uno/framestatuslistener \
+ svtools/source/uno/generictoolboxcontroller \
+ svtools/source/uno/genericunodialog \
+ svtools/source/uno/miscservices \
+ svtools/source/uno/popupmenucontrollerbase \
+ svtools/source/uno/popupwindowcontroller \
+ svtools/source/uno/statusbarcontroller \
+ svtools/source/uno/svtxgridcontrol \
+ svtools/source/uno/toolboxcontroller \
+ svtools/source/uno/treecontrolpeer \
+ svtools/source/uno/unocontroltablemodel \
+ svtools/source/uno/unogridcolumnfacade \
+ svtools/source/uno/unoevent \
+ svtools/source/uno/unoiface \
+ svtools/source/uno/unoimap \
+ svtools/source/uno/wizard/unowizard \
+ svtools/source/uno/wizard/wizardpagecontroller \
+ svtools/source/uno/wizard/wizardshell \
+ svtools/source/urlobj/inetimg \
+))
+
+$(eval $(call gb_Library_add_cobjects,svt,\
+ svtools/source/filter.vcl/jpeg/jpegc \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_linked_libs,svt,\
+ advapi32 \
+ gdi32 \
+ ole32 \
+ oleaut32 \
+ user32 \
+ uuid \
+))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Makefile b/svtools/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/svtools/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Module_svtools.mk b/svtools/Module_svtools.mk
new file mode 100644
index 000000000000..0b669d9dee1b
--- /dev/null
+++ b/svtools/Module_svtools.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Module_Module,svtools))
+
+$(eval $(call gb_Module_add_targets,svtools,\
+ AllLangResTarget_productregistration \
+ AllLangResTarget_svt \
+ Executable_bmp \
+ Executable_bmpsum \
+ Executable_g2g \
+ Library_hatchwindowfactory \
+ Library_productregistration \
+ Library_svt \
+ Package_inc \
+))
+
+$(eval $(call gb_Module_add_subsequentcheck_targets,svtools,\
+ JunitTest_svtools_unoapi \
+))
+
+#todo: javapatchres
+#todo: jpeg on mac in svtools/util/makefile.mk
+#todo: deliver errtxt.src as ehdl.srs
+#todo: nooptfiles filter, filterconfigitem, FilterConfigCache, SvFilterOptionsDialog
+#todo: map file
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk
new file mode 100644
index 000000000000..b5a32a27b865
--- /dev/null
+++ b/svtools/Package_inc.mk
@@ -0,0 +1,196 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,svtools_inc,$(SRCDIR)/svtools/inc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/AccessibleBrowseBoxObjType.hxx,svtools/AccessibleBrowseBoxObjType.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/DocumentInfoPreview.hxx,svtools/DocumentInfoPreview.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/FilterConfigItem.hxx,svtools/FilterConfigItem.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/QueryFolderName.hxx,svtools/QueryFolderName.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/acceleratorexecute.hxx,svtools/acceleratorexecute.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/accessibilityoptions.hxx,svtools/accessibilityoptions.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/accessiblefactory.hxx,svtools/accessiblefactory.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/accessibletable.hxx,svtools/accessibletable.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/accessibletableprovider.hxx,svtools/accessibletableprovider.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/addresstemplate.hxx,svtools/addresstemplate.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/apearcfg.hxx,svtools/apearcfg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/asynclink.hxx,svtools/asynclink.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/borderhelper.hxx,svtools/borderhelper.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/brwbox.hxx,svtools/brwbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/brwhead.hxx,svtools/brwhead.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/calendar.hxx,svtools/calendar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/chartprettypainter.hxx,svtools/chartprettypainter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/cliplistener.hxx,svtools/cliplistener.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/colctrl.hxx,svtools/colctrl.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/collatorres.hxx,svtools/collatorres.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/colorcfg.hxx,svtools/colorcfg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/colrdlg.hxx,svtools/colrdlg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/contextmenuhelper.hxx,svtools/contextmenuhelper.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/controldims.hrc,svtools/controldims.hrc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ctrlbox.hxx,svtools/ctrlbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ctrltool.hxx,svtools/ctrltool.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/dialogclosedlistener.hxx,svtools/dialogclosedlistener.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/dialogcontrolling.hxx,svtools/dialogcontrolling.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/editbrowsebox.hxx,svtools/editbrowsebox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/editimplementation.hxx,svtools/editimplementation.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/editsyntaxhighlighter.hxx,svtools/editsyntaxhighlighter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ehdl.hxx,svtools/ehdl.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/embedhlp.hxx,svtools/embedhlp.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/embedtransfer.hxx,svtools/embedtransfer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/expander.hxx,svtools/expander.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/extcolorcfg.hxx,svtools/extcolorcfg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/extensionlistbox.hxx,svtools/extensionlistbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filectrl.hxx,svtools/filectrl.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filedlg.hxx,svtools/filedlg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filedlg2.hrc,svtools/filedlg2.hrc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fileurlbox.hxx,svtools/fileurlbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fileview.hxx,svtools/fileview.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filter.hxx,svtools/filter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filterutils.hxx,svtools/filterutils.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/filechangedchecker.hxx,svtools/filechangedchecker.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fixedhyper.hxx,svtools/fixedhyper.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fltcall.hxx,svtools/fltcall.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fltdefs.hxx,svtools/fltdefs.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fmtfield.hxx,svtools/fmtfield.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/fontsubstconfig.hxx,svtools/fontsubstconfig.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/framestatuslistener.hxx,svtools/framestatuslistener.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/generictoolboxcontroller.hxx,svtools/generictoolboxcontroller.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/genericunodialog.hxx,svtools/genericunodialog.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/grfmgr.hxx,svtools/grfmgr.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/headbar.hxx,svtools/headbar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/helpagentwindow.hxx,svtools/helpagentwindow.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/helpid.hrc,svtools/helpid.hrc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/helpopt.hxx,svtools/helpopt.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/htmlcfg.hxx,svtools/htmlcfg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/htmlkywd.hxx,svtools/htmlkywd.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/htmlout.hxx,svtools/htmlout.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/htmltokn.h,svtools/htmltokn.h))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/hyperlabel.hxx,svtools/hyperlabel.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imagemgr.hrc,svtools/imagemgr.hrc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imagemgr.hxx,svtools/imagemgr.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imageresourceaccess.hxx,svtools/imageresourceaccess.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imap.hxx,svtools/imap.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imapcirc.hxx,svtools/imapcirc.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imapobj.hxx,svtools/imapobj.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imappoly.hxx,svtools/imappoly.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imaprect.hxx,svtools/imaprect.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/imgdef.hxx,svtools/imgdef.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/indexentryres.hxx,svtools/indexentryres.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/inetimg.hxx,svtools/inetimg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/inettbc.hxx,svtools/inettbc.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/insdlg.hxx,svtools/insdlg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/itemdel.hxx,svtools/itemdel.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ivctrl.hxx,svtools/ivctrl.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/javacontext.hxx,svtools/javacontext.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/javainteractionhandler.hxx,svtools/javainteractionhandler.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/langhelp.hxx,svtools/langhelp.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/langtab.hxx,svtools/langtab.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/localresaccess.hxx,svtools/localresaccess.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/menuoptions.hxx,svtools/menuoptions.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/miscopt.hxx,svtools/miscopt.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/optionsdrawinglayer.hxx,svtools/optionsdrawinglayer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/parhtml.hxx,svtools/parhtml.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/parrtf.hxx,svtools/parrtf.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupmenucontrollerbase.hxx,svtools/popupmenucontrollerbase.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/popupwindowcontroller.hxx,svtools/popupwindowcontroller.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prgsbar.hxx,svtools/prgsbar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/printoptions.hxx,svtools/printoptions.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/prnsetup.hxx,svtools/prnsetup.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/roadmap.hxx,svtools/roadmap.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/roadmapwizard.hxx,svtools/roadmapwizard.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/rtfkeywd.hxx,svtools/rtfkeywd.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/rtfout.hxx,svtools/rtfout.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/rtftoken.h,svtools/rtftoken.h))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ruler.hxx,svtools/ruler.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/scriptedtext.hxx,svtools/scriptedtext.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/scrwin.hxx,svtools/scrwin.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/sfxecode.hxx,svtools/sfxecode.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/soerr.hxx,svtools/soerr.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/sores.hxx,svtools/sores.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/statusbarcontroller.hxx,svtools/statusbarcontroller.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdctrl.hxx,svtools/stdctrl.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdmenu.hxx,svtools/stdmenu.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stringtransfer.hxx,svtools/stringtransfer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svicnvw.hxx,svtools/svicnvw.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbitm.hxx,svtools/svlbitm.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbox.hxx,svtools/svlbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svmedit.hxx,svtools/svmedit.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svmedit2.hxx,svtools/svmedit2.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svparser.hxx,svtools/svparser.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtabbx.hxx,svtools/svtabbx.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtdata.hxx,svtools/svtdata.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtdllapi.h,svtools/svtdllapi.h))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtools.hrc,svtools/svtools.hrc))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svtreebx.hxx,svtools/svtreebx.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svxbox.hxx,svtools/svxbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/sychconv.hxx,svtools/sychconv.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/syntaxhighlight.hxx,svtools/syntaxhighlight.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/tabbar.hxx,svtools/tabbar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablecontrolinterface.hxx,svtools/table/tablecontrolinterface.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/defaultinputhandler.hxx,svtools/table/defaultinputhandler.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/gridtablerenderer.hxx,svtools/table/gridtablerenderer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablecontrol.hxx,svtools/table/tablecontrol.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tableinputhandler.hxx,svtools/table/tableinputhandler.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablemodel.hxx,svtools/table/tablemodel.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablerenderer.hxx,svtools/table/tablerenderer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tabletypes.hxx,svtools/table/tabletypes.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablesort.hxx,svtools/table/tablesort.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/taskbar.hxx,svtools/taskbar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/templatefoldercache.hxx,svtools/templatefoldercache.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/templdlg.hxx,svtools/templdlg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/testtool.hxx,svtools/testtool.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/textdata.hxx,svtools/textdata.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/texteng.hxx,svtools/texteng.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/textview.hxx,svtools/textview.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/textwindowpeer.hxx,svtools/textwindowpeer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolbarmenu.hxx,svtools/toolbarmenu.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolboxcontroller.hxx,svtools/toolboxcontroller.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/decklayouter.hxx,svtools/toolpanel/decklayouter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/drawerlayouter.hxx,svtools/toolpanel/drawerlayouter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/paneltabbar.hxx,svtools/toolpanel/paneltabbar.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/refbase.hxx,svtools/toolpanel/refbase.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/tabalignment.hxx,svtools/toolpanel/tabalignment.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/tabitemcontent.hxx,svtools/toolpanel/tabitemcontent.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/tablayouter.hxx,svtools/toolpanel/tablayouter.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/toolpanel.hxx,svtools/toolpanel/toolpanel.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/toolpanel/toolpaneldeck.hxx,svtools/toolpanel/toolpaneldeck.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/tooltiplbox.hxx,svtools/tooltiplbox.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/transfer.hxx,svtools/transfer.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/treelist.hxx,svtools/treelist.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/ttprops.hxx,svtools/ttprops.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/txtattr.hxx,svtools/txtattr.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/txtcmp.hxx,svtools/txtcmp.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/unitconv.hxx,svtools/unitconv.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/unoevent.hxx,svtools/unoevent.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/unoimap.hxx,svtools/unoimap.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/urlcontrol.hxx,svtools/urlcontrol.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/valueset.hxx,svtools/valueset.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/wallitem.hxx,svtools/wallitem.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/wizardmachine.hxx,svtools/wizardmachine.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/wizdlg.hxx,svtools/wizdlg.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/wmf.hxx,svtools/wmf.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/xtextedt.hxx,svtools/xtextedt.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/xwindowitem.hxx,svtools/xwindowitem.hxx))
diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx
index fd2c92daf52b..dce36f039730 100644
--- a/svtools/bmpmaker/bmp.cxx
+++ b/svtools/bmpmaker/bmp.cxx
@@ -40,7 +40,7 @@ using namespace std;
#include <vcl/svapp.hxx>
#include "svl/solar.hrc"
-#include "filedlg.hxx"
+#include <svtools/filedlg.hxx>
#include "bmpcore.hxx"
#include "bmp.hrc"
@@ -53,19 +53,19 @@ class BmpApp : public BmpCreator
private:
String aOutputFileName;
- BYTE cExitCode;
+ sal_uInt8 cExitCode;
- BOOL GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rSwitchParam );
- BOOL GetCommandOptions( const ::std::vector< String >& rArgs, const String& rSwitch, ::std::vector< String >& rSwitchParams );
+ sal_Bool GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rSwitchParam );
+ sal_Bool GetCommandOptions( const ::std::vector< String >& rArgs, const String& rSwitch, ::std::vector< String >& rSwitchParams );
- void SetExitCode( BYTE cExit )
+ void SetExitCode( sal_uInt8 cExit )
{
if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) )
cExitCode = cExit;
}
void ShowUsage();
- virtual void Message( const String& rText, BYTE cExitCode );
+ virtual void Message( const String& rText, sal_uInt8 cExitCode );
public:
@@ -89,9 +89,9 @@ BmpApp::~BmpApp()
// -----------------------------------------------------------------------
-BOOL BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
+sal_Bool BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ )
{
@@ -103,7 +103,7 @@ BOOL BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL )
{
- bRet = TRUE;
+ bRet = sal_True;
if( i < ( nCount - 1 ) )
rParam = rArgs[ i + 1 ];
@@ -121,9 +121,9 @@ BOOL BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
// -----------------------------------------------------------------------
-BOOL BmpApp::GetCommandOptions( const ::std::vector< String >& rArgs, const String& rSwitch, ::std::vector< String >& rParams )
+sal_Bool BmpApp::GetCommandOptions( const ::std::vector< String >& rArgs, const String& rSwitch, ::std::vector< String >& rParams )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( int i = 0, nCount = rArgs.size(); ( i < nCount ); i++ )
{
@@ -153,7 +153,7 @@ BOOL BmpApp::GetCommandOptions( const ::std::vector< String >& rArgs, const Stri
// -----------------------------------------------------------------------
-void BmpApp::Message( const String& rText, BYTE cExit )
+void BmpApp::Message( const String& rText, sal_uInt8 cExit )
{
if( EXIT_NOERROR != cExit )
SetExitCode( cExit );
@@ -187,7 +187,7 @@ int BmpApp::Start( const ::std::vector< String >& rArgs )
if( rArgs.size() >= 6 )
{
LangInfo aLangInfo;
- USHORT nCurCmd = 0;
+ sal_uInt16 nCurCmd = 0;
const String aSrsName( rArgs[ nCurCmd++ ] );
::std::vector< String > aInDirVector;
ByteString aLangDir;
diff --git a/svtools/bmpmaker/bmp.src b/svtools/bmpmaker/bmp.src
index 7431d2e335a4..30ff9488a805 100644
--- a/svtools/bmpmaker/bmp.src
+++ b/svtools/bmpmaker/bmp.src
@@ -27,6 +27,7 @@
#include "bmp.hrc"
ModalDialog DLG_PATH {
+ HelpID = "svtools:ModalDialog:DLG_PATH";
OutputSize = TRUE;
SVLook = TRUE;
Size = MAP_APPFONT( 301, 104 );
@@ -54,36 +55,42 @@ ModalDialog DLG_PATH {
Text = "Bitmap-Pfad:";
};
Edit EDT_SRS {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_SRS";
Border = TRUE;
Pos = MAP_APPFONT( 65, 14 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_RES {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_RES";
Border = TRUE;
Pos = MAP_APPFONT( 65, 29 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
Edit EDT_OUT {
+ HelpID = "svtools:Edit:DLG_PATH:EDT_OUT";
Border = TRUE;
Pos = MAP_APPFONT( 65, 44 );
Size = MAP_APPFONT( 160, 12 );
TabStop = TRUE;
};
PushButton BTN_SRS {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_SRS";
Pos = MAP_APPFONT( 228, 14 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_RES {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_RES";
Pos = MAP_APPFONT( 228, 29 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
TabStop = TRUE;
};
PushButton BTN_OUT {
+ HelpID = "svtools:PushButton:DLG_PATH:BTN_OUT";
Pos = MAP_APPFONT( 228, 44 );
Size = MAP_APPFONT( 15, 12 );
Text = "...";
@@ -106,6 +113,7 @@ ModalDialog DLG_PATH {
Text = "Sprache";
};
ListBox LB_LANG {
+ HelpID = "svtools:ListBox:DLG_PATH:LB_LANG";
Border = TRUE;
Pos = MAP_APPFONT( 12, 76 );
Size = MAP_APPFONT( 231, 70 );
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index a352ae4f7dc1..622cce494a71 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -73,7 +73,7 @@ BmpCreator::~BmpCreator()
// -----------------------------------------------------------------------------
-void BmpCreator::Message( const String&, BYTE )
+void BmpCreator::Message( const String&, sal_uInt8 )
{
}
@@ -330,7 +330,7 @@ void BmpCreator::Create( const String& rSRSName,
{
DirEntry aFileName( ImplGetSystemFileName( rSRSName ) ), aOutDir( ImplGetSystemFileName( rOutName ) );
::std::vector< DirEntry > aInDirs;
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
aFileName.ToAbs();
aOutDir.ToAbs();
@@ -362,7 +362,7 @@ void BmpCreator::Create( const String& rSRSName,
{
String aText;
ByteString aByteText;
- BOOL bLangDep = FALSE;
+ sal_Bool bLangDep = sal_False;
do
{
@@ -390,7 +390,7 @@ void BmpCreator::Create( const String& rSRSName,
aByteText.Search( '[' ) != STRING_NOTFOUND &&
aByteText.Search( ']' ) != STRING_NOTFOUND )
{
- bLangDep = TRUE;
+ bLangDep = sal_True;
}
if (!pSRS->ReadLine(aByteText))
@@ -402,13 +402,13 @@ void BmpCreator::Create( const String& rSRSName,
// if image list is not language dependent, don't do anything for languages except german
if( aText.Len() )
{
- bDone = TRUE;
+ bDone = sal_True;
ImplCreate( aInDirs, aOutDir, aName, rLang );
}
/* else if( ( rLang.mnLangNum != 49 ) && !bLangDep )
{
Message( String( RTL_CONSTASCII_USTRINGPARAM( "INFO: ImageList is not language dependent! Nothing to do for this language." ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}*/
}
while ( aText.Len() );
diff --git a/svtools/bmpmaker/bmpcore.hxx b/svtools/bmpmaker/bmpcore.hxx
index b5d0c2919c75..4e0d08da7db6 100644
--- a/svtools/bmpmaker/bmpcore.hxx
+++ b/svtools/bmpmaker/bmpcore.hxx
@@ -56,7 +56,7 @@
struct LangInfo
{
char maLangDir[ 257 ];
- USHORT mnLangNum;
+ sal_uInt16 mnLangNum;
};
// --------------
@@ -72,8 +72,8 @@ private:
Size aTotSize;
Point aPos;
SvFileStream* pSRS;
- ULONG nTotCount;
- USHORT nPos;
+ sal_uLong nTotCount;
+ sal_uInt16 nPos;
void ImplCreate( const ::std::vector< DirEntry >& rInDirs,
const DirEntry& rOut,
@@ -82,7 +82,7 @@ private:
protected:
- virtual void Message( const String& rText, BYTE cExitCode = EXIT_NOERROR );
+ virtual void Message( const String& rText, sal_uInt8 cExitCode = EXIT_NOERROR );
public:
diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx
index d23599252ffe..8d7d34240d94 100644
--- a/svtools/bmpmaker/bmpsum.cxx
+++ b/svtools/bmpmaker/bmpsum.cxx
@@ -59,15 +59,15 @@ private:
sal_uInt32 cExitCode;
- BOOL GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rSwitchParam );
+ sal_Bool GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rSwitchParam );
- void SetExitCode( BYTE cExit )
+ void SetExitCode( sal_uInt8 cExit )
{
if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) )
cExitCode = cExit;
}
void ShowUsage();
- void Message( const String& rText, BYTE cExitCode );
+ void Message( const String& rText, sal_uInt8 cExitCode );
sal_uInt64 GetCRC( const BitmapEx& rBmpEx );
@@ -96,9 +96,9 @@ BmpSum::~BmpSum()
// -----------------------------------------------------------------------
-BOOL BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
+sal_Bool BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ )
{
@@ -110,7 +110,7 @@ BOOL BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL )
{
- bRet = TRUE;
+ bRet = sal_True;
if( i < ( nCount - 1 ) )
rParam = rArgs[ i + 1 ];
@@ -128,7 +128,7 @@ BOOL BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
// -----------------------------------------------------------------------
-void BmpSum::Message( const String& rText, BYTE nExitCode )
+void BmpSum::Message( const String& rText, sal_uInt8 nExitCode )
{
if( EXIT_NOERROR != nExitCode )
SetExitCode( nExitCode );
diff --git a/svtools/bmpmaker/g2g.cxx b/svtools/bmpmaker/g2g.cxx
index 6413606bd6b7..024700dc7cc7 100644
--- a/svtools/bmpmaker/g2g.cxx
+++ b/svtools/bmpmaker/g2g.cxx
@@ -57,13 +57,13 @@ class G2GApp
{
private:
- BYTE cExitCode;
+ sal_uInt8 cExitCode;
void ShowUsage();
- BOOL GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam );
- void SetExitCode( BYTE cExit ) { if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) ) cExitCode = cExit; }
+ sal_Bool GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam );
+ void SetExitCode( sal_uInt8 cExit ) { if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) ) cExitCode = cExit; }
- virtual void Message( const String& rText, BYTE cExitCode = EXIT_NOERROR );
+ virtual void Message( const String& rText, sal_uInt8 cExitCode = EXIT_NOERROR );
public:
@@ -87,9 +87,9 @@ G2GApp::~G2GApp()
// -----------------------------------------------------------------------
-BOOL G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
+sal_Bool G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rParam )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ )
{
@@ -101,7 +101,7 @@ BOOL G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL )
{
- bRet = TRUE;
+ bRet = sal_True;
if( i < ( nCount - 1 ) )
rParam = rArgs[ i + 1 ];
@@ -119,7 +119,7 @@ BOOL G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const Strin
// -----------------------------------------------------------------------
-void G2GApp::Message( const String& rText, BYTE nExitCode )
+void G2GApp::Message( const String& rText, sal_uInt8 nExitCode )
{
if( EXIT_NOERROR != nExitCode )
SetExitCode( nExitCode );
@@ -168,7 +168,7 @@ int G2GApp::Start( const ::std::vector< String >& rArgs )
if( aInFile.Len() && aOutFile.Len() && aFilterStr.Len() )
{
- const USHORT nExportFilter = aFilter.GetExportFormatNumberForShortName( aFilterStr );
+ const sal_uInt16 nExportFilter = aFilter.GetExportFormatNumberForShortName( aFilterStr );
if( GRFILTER_FORMAT_NOTFOUND == nExportFilter )
Message( String( RTL_CONSTASCII_USTRINGPARAM( "invalid graphic filter" ) ), EXIT_INVALID_GRAPHICFILTER );
@@ -199,9 +199,9 @@ int G2GApp::Start( const ::std::vector< String >& rArgs )
if( bHex )
{
- const BYTE cTransR = ( LOWERHEXTONUM( aHexStr.GetChar( 0 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 1 ) );
- const BYTE cTransG = ( LOWERHEXTONUM( aHexStr.GetChar( 2 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 3 ) );
- const BYTE cTransB = ( LOWERHEXTONUM( aHexStr.GetChar( 4 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 5 ) );
+ const sal_uInt8 cTransR = ( LOWERHEXTONUM( aHexStr.GetChar( 0 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 1 ) );
+ const sal_uInt8 cTransG = ( LOWERHEXTONUM( aHexStr.GetChar( 2 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 3 ) );
+ const sal_uInt8 cTransB = ( LOWERHEXTONUM( aHexStr.GetChar( 4 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 5 ) );
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
Bitmap aOldBmp( aBmpEx.GetBitmap() );
diff --git a/svtools/bmpmaker/makefile.mk b/svtools/bmpmaker/makefile.mk
deleted file mode 100644
index e96724c668d9..000000000000
--- a/svtools/bmpmaker/makefile.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-PRJNAME=svtools
-TARGET=bmp
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=true
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= $(OBJ)$/bmp.obj \
- $(OBJ)$/bmpcore.obj \
- $(OBJ)$/g2g.obj \
- $(OBJ)$/bmpsum.obj
-
-# --- APP1TARGET ---------------------------------------------------
-
-APP1TARGET= $(TARGET)
-
-APP1STDLIBS = \
- $(VCLLIB) \
- $(TOOLSLIB) \
- $(SALLIB)
-
-APP1OBJS= $(OBJ)$/bmp.obj \
- $(OBJ)$/bmpcore.obj
-
-APP1BASE=0x10000000
-
-# --- APP2TARGET --------------------------------------------------
-
-APP2TARGET = bmpsum
-APP2BASE = 0x10000000
-APP2OBJS = $(OBJ)$/bmpsum.obj
-
-APP2STDLIBS = $(VCLLIB) \
- $(TOOLSLIB) \
- $(SALLIB)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/inc/makefile.mk b/svtools/inc/makefile.mk
deleted file mode 100644
index cde85ffe82ca..000000000000
--- a/svtools/inc/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=svtools
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx
index e19756675637..6ce70e0c5d0b 100644
--- a/svtools/inc/pch/precompiled_svtools.hxx
+++ b/svtools/inc/pch/precompiled_svtools.hxx
@@ -421,8 +421,8 @@
#include <unotools/processfactory.hxx>
#include <vcl/dndhelp.hxx>
-#include <vcl/fldunit.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/fldunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/unohelp.hxx>
#include <osl/mutex.hxx>
diff --git a/svtools/inc/DocumentInfoPreview.hxx b/svtools/inc/svtools/DocumentInfoPreview.hxx
index b42cbfcf9756..0e4e9bf86230 100644
--- a/svtools/inc/DocumentInfoPreview.hxx
+++ b/svtools/inc/svtools/DocumentInfoPreview.hxx
@@ -54,7 +54,7 @@ namespace svtools
::com::sun::star::document::XDocumentProperties>& i_xDocProps
,const String& i_rURL);
void InsertEntry( const String& rTitle, const String& rValue );
- void SetAutoScroll(BOOL _bAutoScroll);
+ void SetAutoScroll(sal_Bool _bAutoScroll);
};
}
diff --git a/svtools/inc/QueryFolderName.hxx b/svtools/inc/svtools/QueryFolderName.hxx
index b9762717d3cd..b9762717d3cd 100644
--- a/svtools/inc/QueryFolderName.hxx
+++ b/svtools/inc/svtools/QueryFolderName.hxx
diff --git a/svtools/inc/acceleratorexecute.hxx b/svtools/inc/svtools/acceleratorexecute.hxx
index 6bea581e5d78..ec2a69e1edfd 100644
--- a/svtools/inc/acceleratorexecute.hxx
+++ b/svtools/inc/svtools/acceleratorexecute.hxx
@@ -211,7 +211,7 @@ class SVT_DLLPUBLIC AcceleratorExecute : private TMutexInit
specify the accelerator for execute.
@return [sal_Bool]
- TRUE if this key is configured and match to a command.
+ sal_True if this key is configured and match to a command.
Attention: This state does not mean the success state
of the corresponding execute. Because its done asynchronous!
*/
diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx
index d95a99560549..6fefb18a17a1 100644
--- a/svtools/inc/svtools/accessiblefactory.hxx
+++ b/svtools/inc/svtools/accessiblefactory.hxx
@@ -29,12 +29,12 @@
#ifndef SVTOOLS_ACCESSIBLE_FACTORY_HXX
#define SVTOOLS_ACCESSIBLE_FACTORY_HXX
+#include "AccessibleBrowseBoxObjType.hxx"
+#include "accessibletableprovider.hxx"
+
#include <com/sun/star/uno/Reference.hxx>
#include <rtl/ref.hxx>
-#include "AccessibleBrowseBoxObjType.hxx"
-#include "accessibletableprovider.hxx"
-#include "accessibletable.hxx"
namespace com { namespace sun { namespace star {
namespace accessibility {
@@ -61,6 +61,11 @@ namespace svt
class ToolPanelDeck;
class IToolPanelDeck;
class PanelTabBar;
+ namespace table
+ {
+ class IAccessibleTable;
+ class IAccessibleTableControl;
+ }
/** a function which is able to create a factory for the standard Accessible/Context
components needed for standard toolkit controls
diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx
index f29e83365b95..5afd1ff2d68e 100644
--- a/svtools/inc/svtools/accessibletable.hxx
+++ b/svtools/inc/svtools/accessibletable.hxx
@@ -102,7 +102,7 @@ public:
// Window
virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
virtual void GrabFocus()= 0;
- virtual XACC GetAccessible( BOOL bCreate = TRUE )= 0;
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True )= 0;
virtual Window* GetAccessibleParentWindow() const= 0;
virtual Window* GetWindowInstance()= 0;
virtual sal_Int32 GetAccessibleControlCount() const = 0;
@@ -110,11 +110,9 @@ public:
virtual long GetRowCount() const= 0;
virtual long GetColumnCount() const= 0;
virtual sal_Bool HasRowHeader() const= 0;
- virtual sal_Int32 GetSelectedRowCount() const= 0;
- virtual bool IsRowSelected( long _nRow ) const= 0;
virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
- virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE ) = 0;
- virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0;
virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0;
virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0;
@@ -123,9 +121,13 @@ public:
virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
- virtual std::vector<sal_Int32>& GetSelectedRows() = 0;
- virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0;
virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0;
+ virtual void SelectAllRows( bool const i_select ) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/svtools/inc/svtools/accessibletableprovider.hxx b/svtools/inc/svtools/accessibletableprovider.hxx
index 1e06a36a5f86..3f16370a4bad 100644
--- a/svtools/inc/svtools/accessibletableprovider.hxx
+++ b/svtools/inc/svtools/accessibletableprovider.hxx
@@ -88,11 +88,11 @@ public:
virtual sal_Bool HasRowHeader() const = 0; //GetColumnId
/** @return <TRUE/>, if the object can focus a cell. */
virtual sal_Bool IsCellFocusable() const = 0;
- virtual BOOL GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
virtual void SetNoSelection() = 0;
virtual void SelectAll() = 0;
- virtual void SelectRow( long _nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE ) = 0;
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True ) = 0;
virtual void SelectColumn( sal_uInt16 _nColumnPos, sal_Bool _bSelect = sal_True ) = 0;
virtual sal_Int32 GetSelectedRowCount() const = 0;
virtual sal_Int32 GetSelectedColumnCount() const = 0;
@@ -104,11 +104,11 @@ public:
/** @return <TRUE/>, if the cell is visible. */
virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const = 0;
- virtual String GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const = 0;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const = 0;
- virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE ) = 0;
- virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE ) = 0;
- virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, BOOL _bIsHeader, BOOL _bOnScreen = TRUE ) = 0;
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumnPos, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True ) = 0;
virtual XACC CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) = 0;
virtual XACC CreateAccessibleRowHeader( sal_Int32 _nRow ) = 0;
@@ -130,12 +130,12 @@ public:
virtual void GrabTableFocus() = 0;
// OutputDevice
- virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) = 0;
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector ) = 0;
// Window
virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const = 0;
virtual void GrabFocus() = 0;
- virtual XACC GetAccessible( BOOL bCreate = TRUE ) = 0;
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True ) = 0;
virtual Window* GetAccessibleParentWindow() const = 0;
virtual Window* GetWindowInstance() = 0;
diff --git a/svtools/inc/addresstemplate.hxx b/svtools/inc/svtools/addresstemplate.hxx
index 5fe7aaa57681..d69a7652affd 100644
--- a/svtools/inc/addresstemplate.hxx
+++ b/svtools/inc/svtools/addresstemplate.hxx
@@ -34,7 +34,7 @@
#include <vcl/group.hxx>
#include <vcl/fixed.hxx>
#include <vcl/combobox.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/scrbar.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
diff --git a/svtools/inc/apearcfg.hxx b/svtools/inc/svtools/apearcfg.hxx
index ca8e71dfc6bb..c423f24c6c79 100644
--- a/svtools/inc/apearcfg.hxx
+++ b/svtools/inc/svtools/apearcfg.hxx
@@ -35,14 +35,6 @@
class Application;
typedef enum {
- LookStardivision = 0,
- LookMotif,
- LookWindows,
- LookOSTwo,
- LookMacintosh
-} SystemLook;
-
-typedef enum {
SnapToButton = 0,
SnapToMiddle,
NoSnap
@@ -57,7 +49,6 @@ typedef enum { // MUST match the order chosen in ListBox LB_DRAG_MODE in optgdlg
class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
{
- short nLookNFeel ;
short nDragMode ;
short nScaleFactor ;
short nSnapMode ;
@@ -66,11 +57,9 @@ class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
short nAAMinPixelHeight ;
#endif
- BOOL bMenuMouseFollow ;
- BOOL bSingleLineTabCtrl ;
- BOOL bColoredTabCtrl ;
+ sal_Bool bMenuMouseFollow ;
#if defined( UNX )
- BOOL bFontAntialiasing ;
+ sal_Bool bFontAntialiasing ;
#endif
static sal_Bool bInitialized ;
@@ -84,40 +73,31 @@ public:
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
- USHORT GetLookNFeel () const { return nLookNFeel; }
- void SetLookNFeel ( USHORT nSet );
-
- USHORT GetDragMode () const { return nDragMode; }
- void SetDragMode ( USHORT nSet );
+ sal_uInt16 GetDragMode () const { return nDragMode; }
+ void SetDragMode ( sal_uInt16 nSet );
- USHORT GetScaleFactor () const { return nScaleFactor; }
- void SetScaleFactor ( USHORT nSet );
+ sal_uInt16 GetScaleFactor () const { return nScaleFactor; }
+ void SetScaleFactor ( sal_uInt16 nSet );
- USHORT GetSnapMode () const { return nSnapMode; }
- void SetSnapMode ( USHORT nSet );
+ sal_uInt16 GetSnapMode () const { return nSnapMode; }
+ void SetSnapMode ( sal_uInt16 nSet );
- USHORT GetMiddleMouseButton () const { return nMiddleMouse; }
- void SetMiddleMouseButton ( USHORT nSet );
+ sal_uInt16 GetMiddleMouseButton () const { return nMiddleMouse; }
+ void SetMiddleMouseButton ( sal_uInt16 nSet );
void SetApplicationDefaults ( Application* pApp );
- void SetMenuMouseFollow(BOOL bSet) {bMenuMouseFollow = bSet; SetModified();}
- BOOL IsMenuMouseFollow() const{return bMenuMouseFollow;}
-
- void SetSingleLineTabCtrl(BOOL bSet) {bSingleLineTabCtrl = bSet; SetModified();}
- BOOL IsSingleLineTabCtrl()const {return bSingleLineTabCtrl;}
+ void SetMenuMouseFollow(sal_Bool bSet) {bMenuMouseFollow = bSet; SetModified();}
+ sal_Bool IsMenuMouseFollow() const{return bMenuMouseFollow;}
#if defined( UNX )
- void SetFontAntiAliasing( BOOL bSet ) { bFontAntialiasing = bSet; SetModified(); }
- BOOL IsFontAntiAliasing() const { return bFontAntialiasing; }
+ void SetFontAntiAliasing( sal_Bool bSet ) { bFontAntialiasing = bSet; SetModified(); }
+ sal_Bool IsFontAntiAliasing() const { return bFontAntialiasing; }
- USHORT GetFontAntialiasingMinPixelHeight( ) const { return nAAMinPixelHeight; }
- void SetFontAntialiasingMinPixelHeight( USHORT _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); }
+ sal_uInt16 GetFontAntialiasingMinPixelHeight( ) const { return nAAMinPixelHeight; }
+ void SetFontAntialiasingMinPixelHeight( sal_uInt16 _nMinHeight ) { nAAMinPixelHeight = _nMinHeight; SetModified(); }
#endif
- void SetColoredTabCtrl(BOOL bSet) {bColoredTabCtrl = bSet; SetModified();};
- BOOL IsColoredTabCtrl()const {return bColoredTabCtrl;}
-
static sal_Bool IsInitialized() { return bInitialized; }
static void SetInitialized() { bInitialized = sal_True; }
};
diff --git a/svtools/inc/asynclink.hxx b/svtools/inc/svtools/asynclink.hxx
index 6758222fe552..6a2b07b9c9b6 100644
--- a/svtools/inc/asynclink.hxx
+++ b/svtools/inc/svtools/asynclink.hxx
@@ -41,10 +41,10 @@ namespace svtools {
class SVT_DLLPUBLIC AsynchronLink
{
Link _aLink;
- ULONG _nEventId;
+ sal_uLong _nEventId;
Timer* _pTimer;
- BOOL _bInCall;
- BOOL* _pDeleted;
+ sal_Bool _bInCall;
+ sal_Bool* _pDeleted;
void* _pArg;
::osl::Mutex* _pMutex;
@@ -53,19 +53,19 @@ class SVT_DLLPUBLIC AsynchronLink
public:
AsynchronLink( const Link& rLink ) :
- _aLink( rLink ), _nEventId( 0 ), _pTimer( 0 ), _bInCall( FALSE ),
+ _aLink( rLink ), _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
_pDeleted( 0 ), _pMutex( 0 ){}
- AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( FALSE ),
+ AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
_pDeleted( 0 ), _pMutex( 0 ){}
~AsynchronLink();
void CreateMutex();
void operator=( const Link& rLink ) { _aLink = rLink; }
- void Call( void* pObj, BOOL bAllowDoubles = FALSE,
- BOOL bUseTimer = FALSE );
+ void Call( void* pObj, sal_Bool bAllowDoubles = sal_False,
+ sal_Bool bUseTimer = sal_False );
void ForcePendingCall( );
void ClearPendingCall( );
- BOOL IsSet() const { return _aLink.IsSet(); }
+ sal_Bool IsSet() const { return _aLink.IsSet(); }
Link GetLink() const { return _aLink; }
};
diff --git a/svtools/inc/borderhelper.hxx b/svtools/inc/svtools/borderhelper.hxx
index 62b8d153b02d..18bad8929f0c 100644
--- a/svtools/inc/borderhelper.hxx
+++ b/svtools/inc/svtools/borderhelper.hxx
@@ -38,10 +38,10 @@
namespace svtools
{
SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon,
- USHORT nDashing, MapUnit eUnit );
+ sal_uInt16 nDashing, MapUnit eUnit );
SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg,
- const Point& rEnd, sal_uInt32 nWidth, USHORT nDashing );
+ const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing );
}
#endif
diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
index 3bddaa765ed1..edfacfa77e00 100644
--- a/svtools/inc/svtools/brwbox.hxx
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -70,7 +70,7 @@ namespace utl {
#define BROWSER_INVALIDID USHRT_MAX
#define BROWSER_ENDOFSELECTION (long)(SFX_ENDOFSELECTION)
-typedef ULONG BrowserMode;
+typedef sal_uLong BrowserMode;
#define BROWSER_COLUMNSELECTION 0x0001
#define BROWSER_MULTISELECTION 0x0002
@@ -156,20 +156,20 @@ class BrowseEvent
Window* pWin;
long nRow;
Rectangle aRect;
- USHORT nCol;
- USHORT nColId;
+ sal_uInt16 nCol;
+ sal_uInt16 nColId;
public:
BrowseEvent();
BrowseEvent( Window* pWindow,
long nAbsRow,
- USHORT nColumn, USHORT nColumnId,
+ sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect );
Window* GetWindow() const { return pWin; }
long GetRow() const { return nRow; }
- USHORT GetColumn() const { return nCol; }
- USHORT GetColumnId() const { return nColId; }
+ sal_uInt16 GetColumn() const { return nCol; }
+ sal_uInt16 GetColumnId() const { return nColId; }
const Rectangle& GetRect() const { return aRect; }
};
@@ -183,7 +183,7 @@ public:
BrowserMouseEvent();
BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt );
BrowserMouseEvent( Window* pWin, const MouseEvent& rEvt,
- long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect );
};
@@ -251,45 +251,45 @@ class SVT_DLLPUBLIC BrowseBox
ScrollBar aHScroll; // horizontal scrollbar
long nDataRowHeight; // height of a single data-row
- USHORT nTitleLines; // number of lines in title row
- ULONG nControlAreaWidth; // width of fixed area beneeth hscroll
- BOOL bThumbDragging; // handle thumb dragging
- BOOL bColumnCursor; // single columns and fields selectable
- BOOL bMultiSelection;// allow multiple selected rows
- BOOL bKeepHighlight; // don't hide selection on LoseFocus
-
- BOOL bHLines; // draw lines between rows
- BOOL bVLines; // draw lines between columns
- BOOL bHDots; // draw lines between rows dotted
- BOOL bVDots; // draw lines between columns dotted
+ sal_uInt16 nTitleLines; // number of lines in title row
+ sal_uLong nControlAreaWidth; // width of fixed area beneeth hscroll
+ sal_Bool bThumbDragging; // handle thumb dragging
+ sal_Bool bColumnCursor; // single columns and fields selectable
+ sal_Bool bMultiSelection;// allow multiple selected rows
+ sal_Bool bKeepHighlight; // don't hide selection on LoseFocus
+
+ sal_Bool bHLines; // draw lines between rows
+ sal_Bool bVLines; // draw lines between columns
+ sal_Bool bHDots; // draw lines between rows dotted
+ sal_Bool bVDots; // draw lines between columns dotted
Color aGridLineColor; // color for lines, default dark grey
- BOOL bBootstrapped; // child windows resized etc.
+ sal_Bool bBootstrapped; // child windows resized etc.
long nTopRow; // no. of first visible row (0...)
long nCurRow; // no. of row with cursor
long nRowCount; // total number of rows in model
- USHORT nFirstCol; // no. of first visible scrollable column
- USHORT nCurColId; // column id of cursor
+ sal_uInt16 nFirstCol; // no. of first visible scrollable column
+ sal_uInt16 nCurColId; // column id of cursor
- BOOL bSelecting;
- BOOL bRowDividerDrag;
- BOOL bHit;
- BOOL mbInteractiveRowHeight;
+ sal_Bool bSelecting;
+ sal_Bool bRowDividerDrag;
+ sal_Bool bHit;
+ sal_Bool mbInteractiveRowHeight;
Point a1stPoint;
Point a2ndPoint;
long nResizeX; // mouse position at start of resizing
long nMinResizeX; // never drag more left
long nDragX; // last dragged column (MouseMove)
- USHORT nResizeCol; // resize this column in MouseMove
- BOOL bResizing; // mouse captured for column resizing
-
- BOOL bSelect; // select or deselect
- BOOL bSelectionIsVisible; // depending on focus
- BOOL bScrolling; // hidden cursor while scrolling
- BOOL bNotToggleSel; // set while in ToggleSelection() etc.
- BOOL bHasFocus; // set/unset in Get/LoseFocus
- BOOL bHideSelect; // hide selection (highlight)
- BOOL bHideCursor; // hide cursor (frame)
+ sal_uInt16 nResizeCol; // resize this column in MouseMove
+ sal_Bool bResizing; // mouse captured for column resizing
+
+ sal_Bool bSelect; // select or deselect
+ sal_Bool bSelectionIsVisible; // depending on focus
+ sal_Bool bScrolling; // hidden cursor while scrolling
+ sal_Bool bNotToggleSel; // set while in ToggleSelection() etc.
+ sal_Bool bHasFocus; // set/unset in Get/LoseFocus
+ sal_Bool bHideSelect; // hide selection (highlight)
+ sal_Bool bHideCursor; // hide cursor (frame)
Range aSelRange; // for selection expansion
BrowserColumns* pCols; // array of column-descriptions
@@ -302,23 +302,23 @@ class SVT_DLLPUBLIC BrowseBox
::std::auto_ptr< ::svt::BrowseBoxImpl > m_pImpl; // impl structure of the BrowseBox object
- BOOL m_bFocusOnlyCursor; // hide cursor if we don't have the focus
+ sal_Bool m_bFocusOnlyCursor; // hide cursor if we don't have the focus
Color m_aCursorColor; // special color for cursor, COL_TRANSPARENT for usual (VCL-painted) "inverted" cursor
BrowserMode m_nCurrentMode; // last argument of SetMode (redundant, as our other members represent the current settings, too)
private:
SVT_DLLPRIVATE void ConstructImpl(BrowserMode nMode);
SVT_DLLPRIVATE void ExpandRowSelection( const BrowserMouseEvent& rEvt );
- SVT_DLLPRIVATE void ToggleSelection( BOOL bForce = FALSE );
+ SVT_DLLPRIVATE void ToggleSelection( sal_Bool bForce = sal_False );
SVT_DLLPRIVATE void UpdateScrollbars();
SVT_DLLPRIVATE void AutoSizeLastColumn();
SVT_DLLPRIVATE long ImpGetDataRowHeight() const;
- SVT_DLLPRIVATE Rectangle ImplFieldRectPixel( long nRow, USHORT nColId ) const;
- SVT_DLLPRIVATE USHORT FrozenColCount() const;
+ SVT_DLLPRIVATE Rectangle ImplFieldRectPixel( long nRow, sal_uInt16 nColId ) const;
+ SVT_DLLPRIVATE sal_uInt16 FrozenColCount() const;
- SVT_DLLPRIVATE void ColumnInserted( USHORT nPos );
+ SVT_DLLPRIVATE void ColumnInserted( sal_uInt16 nPos );
DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar * );
DECL_DLLPRIVATE_LINK( EndScrollHdl, ScrollBar * );
@@ -327,26 +327,26 @@ private:
SVT_DLLPRIVATE long GetFrozenWidth() const;
//#endif
- BOOL GoToRow(long nRow, BOOL bRowColMove, BOOL bDoNotModifySelection = FALSE );
+ sal_Bool GoToRow(long nRow, sal_Bool bRowColMove, sal_Bool bDoNotModifySelection = sal_False );
- BOOL GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove = FALSE);
- void SelectColumnPos( USHORT nCol, BOOL _bSelect, BOOL bMakeVisible);
- void SelectColumnId( USHORT nColId, BOOL _bSelect, BOOL bMakeVisible)
+ sal_Bool GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove = sal_False);
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect, sal_Bool bMakeVisible);
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect, sal_Bool bMakeVisible)
{ SelectColumnPos( GetColumnPos(nColId), _bSelect, bMakeVisible); }
- void ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections);
+ void ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections);
- BOOL PaintCursorIfHiddenOnce() const { return !m_bFocusOnlyCursor && !HasFocus(); }
+ sal_Bool PaintCursorIfHiddenOnce() const { return !m_bFocusOnlyCursor && !HasFocus(); }
- USHORT ToggleSelectedColumn();
- void SetToggledSelectedColumn(USHORT _nSelectedColumnId);
+ sal_uInt16 ToggleSelectedColumn();
+ void SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId);
protected:
/// retrieves the XAccessible implementation associated with the BrowseBox instance
::svt::IAccessibleFactory& getAccessibleFactory();
protected:
- USHORT ColCount() const;
+ sal_uInt16 ColCount() const;
// software plug for database access
// Der RowCount wird jetzt intern automatisch gezaehlt
@@ -359,7 +359,7 @@ protected:
// fuer Anzeige im VScrollBar z.B. auf "?" oder setzen
void SetRealRowCount( const String &rRealRowCount );
- // Return Value muss immer TRUE sein - SeekRow *muss* klappen!
+ // Return Value muss immer sal_True sein - SeekRow *muss* klappen!
// (sonst ASSERT) MI: wer hat das eingebaut? Das darf nicht so sein!
/** seeks for the given row position
@@ -371,7 +371,7 @@ protected:
virtual void PaintRow( OutputDevice &rDev, const Rectangle &rRect );
virtual void PaintData( Window& rWin, const Rectangle& rRect );
virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect,
- USHORT nColumnId ) const = 0;
+ sal_uInt16 nColumnId ) const = 0;
// Benachrichtigung an die abgeleitete Klasse, dass sich der sichtbare
// Bereich von Rows geaendert hat. Aus dieser Methode heraus darf
// die abgeleitete Klasse Aenderungen des Model mit Hilfe der Methoden
@@ -389,13 +389,13 @@ protected:
// dadurch aendert sich nur die Numerierung der sichtbaren Rows
// - Scrollen (und daraus resultierend eine andere erste sichtbare Row)
// - Resize des Fensters
- virtual void VisibleRowsChanged( long nNewTopRow, USHORT nNumRows);
+ virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
// Anzahl sichtbarer Rows in dem Fenster (inkl. "angeschnittener" Rows)
- USHORT GetVisibleRows()
- { return (USHORT)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1); }
+ sal_uInt16 GetVisibleRows()
+ { return (sal_uInt16)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() + 1); }
long GetTopRow() { return nTopRow; }
- USHORT GetFirstVisibleColNumber() const { return nFirstCol; }
+ sal_uInt16 GetFirstVisibleColNumber() const { return nFirstCol; }
// Focus-Rect ein-/ausschalten
void DoShowCursor( const char *pWhoLog );
@@ -449,7 +449,7 @@ public:
virtual void GetFocus();
virtual void Resize();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Command( const CommandEvent& rEvt );
virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
@@ -467,18 +467,18 @@ public:
virtual void EndScroll();
virtual void Select();
virtual void DoubleClick( const BrowserMouseEvent& rEvt );
- virtual sal_Bool IsCursorMoveAllowed( long nNewRow, USHORT nNewColId ) const;
+ virtual sal_Bool IsCursorMoveAllowed( long nNewRow, sal_uInt16 nNewColId ) const;
virtual void CursorMoved();
- virtual void ColumnMoved( USHORT nColId );
- virtual void ColumnResized( USHORT nColId );
- virtual long QueryColumnResize( USHORT nColId, long nWidth );
+ virtual void ColumnMoved( sal_uInt16 nColId );
+ virtual void ColumnResized( sal_uInt16 nColId );
+ virtual long QueryColumnResize( sal_uInt16 nColId, long nWidth );
/// called when the row height has been changed interactively
virtual void RowHeightChanged();
virtual long QueryMinimumRowHeight();
// Window-Control (pass to DataWindow)
- void SetUpdateMode( BOOL bUpdate );
- BOOL GetUpdateMode() const;
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const;
// map-mode and font control
void SetFont( const Font& rNewFont );
@@ -492,73 +492,73 @@ public:
const Color& GetGridLineColor() const {return aGridLineColor;}
// inserting, changing, removing and freezing of columns
- void InsertHandleColumn( ULONG nWidth );
- void InsertDataColumn( USHORT nItemId, const Image& rImage,
+ void InsertHandleColumn( sal_uLong nWidth );
+ void InsertDataColumn( sal_uInt16 nItemId, const Image& rImage,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND );
- void InsertDataColumn( USHORT nItemId, const XubString& rText,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void InsertDataColumn( sal_uInt16 nItemId, const XubString& rText,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND );
- void InsertDataColumn( USHORT nItemId,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void InsertDataColumn( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND,
+ sal_uInt16 nPos = HEADERBAR_APPEND,
// Hilfstext bei leerem rText
const String* pHelpText = 0 );
- void SetColumnTitle( USHORT nColumnId, const String &rTitle );
- void SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags );
- void SetColumnWidth( USHORT nColumnId, ULONG nWidth );
- void SetColumnPos( USHORT nColumnId, USHORT nPos );
- void FreezeColumn( USHORT nColumnId, BOOL bFreeze = TRUE );
+ void SetColumnTitle( sal_uInt16 nColumnId, const String &rTitle );
+ void SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags );
+ void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth );
+ void SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos );
+ void FreezeColumn( sal_uInt16 nColumnId, sal_Bool bFreeze = sal_True );
void UnfreezeColumns();
- void RemoveColumn( USHORT nColumnId );
+ void RemoveColumn( sal_uInt16 nColumnId );
void RemoveColumns();
// control of title and data row height
void SetDataRowHeight( long nPixel );
long GetDataRowHeight() const;
- void SetTitleLines( USHORT nLines );
- USHORT GetTitleLines() const { return nTitleLines; }
+ void SetTitleLines( sal_uInt16 nLines );
+ sal_uInt16 GetTitleLines() const { return nTitleLines; }
virtual long GetTitleHeight() const;
// access to dynamic values of cursor row
- String GetColumnTitle( USHORT nColumnId ) const;
- BrowserColumnMode GetColumnMode( USHORT nColumnId ) const;
- Rectangle GetFieldRect( USHORT nColumnId ) const;
- ULONG GetColumnWidth( USHORT nColumnId ) const;
- USHORT GetColumnId( USHORT nPos ) const;
- USHORT GetColumnPos( USHORT nColumnId ) const;
- BOOL IsFrozen( USHORT nColumnId ) const;
+ String GetColumnTitle( sal_uInt16 nColumnId ) const;
+ BrowserColumnMode GetColumnMode( sal_uInt16 nColumnId ) const;
+ Rectangle GetFieldRect( sal_uInt16 nColumnId ) const;
+ sal_uLong GetColumnWidth( sal_uInt16 nColumnId ) const;
+ sal_uInt16 GetColumnId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetColumnPos( sal_uInt16 nColumnId ) const;
+ sal_Bool IsFrozen( sal_uInt16 nColumnId ) const;
// movement of visible area
void ResetScroll();
long ScrollColumns( long nColumns );
long ScrollRows( long nRows );
long ScrollPages( long nPagesY );
- BOOL MakeFieldVisible( long nRow, USHORT nColId, BOOL bComplete = FALSE );
+ sal_Bool MakeFieldVisible( long nRow, sal_uInt16 nColId, sal_Bool bComplete = sal_False );
// access and movement of cursor
long GetCurRow() const { return nCurRow; }
- USHORT GetCurColumnId() const { return nCurColId; }
- BOOL GoToRow( long nRow );
- BOOL GoToRowAndDoNotModifySelection( long nRow );
- BOOL GoToColumnId( USHORT nColId );
- BOOL GoToRowColumnId( long nRow, USHORT nColId );
+ sal_uInt16 GetCurColumnId() const { return nCurColId; }
+ sal_Bool GoToRow( long nRow );
+ sal_Bool GoToRowAndDoNotModifySelection( long nRow );
+ sal_Bool GoToColumnId( sal_uInt16 nColId );
+ sal_Bool GoToRowColumnId( long nRow, sal_uInt16 nColId );
// selections
virtual void SetNoSelection();
virtual void SelectAll();
- virtual void SelectRow( long nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE );
- void SelectColumnPos( USHORT nCol, BOOL _bSelect = TRUE )
- { SelectColumnPos( nCol, _bSelect, TRUE); }
- void SelectColumnId( USHORT nColId, BOOL _bSelect = TRUE )
- { SelectColumnPos( GetColumnPos(nColId), _bSelect, TRUE); }
+ virtual void SelectRow( long nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
+ void SelectColumnPos( sal_uInt16 nCol, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( nCol, _bSelect, sal_True); }
+ void SelectColumnId( sal_uInt16 nColId, sal_Bool _bSelect = sal_True )
+ { SelectColumnPos( GetColumnPos(nColId), _bSelect, sal_True); }
long GetSelectRowCount() const;
- USHORT GetSelectColumnCount() const;
+ sal_uInt16 GetSelectColumnCount() const;
virtual bool IsRowSelected( long nRow ) const;
- bool IsColumnSelected( USHORT nColumnId ) const;
+ bool IsColumnSelected( sal_uInt16 nColumnId ) const;
sal_Bool IsAllSelected() const;
- long FirstSelectedRow( BOOL bInverse = FALSE );
+ long FirstSelectedRow( sal_Bool bInverse = sal_False );
long LastSelectedRow();
long PrevSelectedRow();
long NextSelectedRow();
@@ -570,40 +570,40 @@ public:
long FirstSelectedColumn( ) const;
long NextSelectedColumn( ) const;
- BOOL IsResizing() const { return bResizing; }
+ sal_Bool IsResizing() const { return bResizing; }
// access to positions of fields, column and rows
Window& GetEventWindow() const;
Window& GetDataWindow() const { return *pDataWin; }
Rectangle GetRowRectPixel( long nRow,
- BOOL bRelToBrowser = TRUE ) const;
- Rectangle GetFieldRectPixel( long nRow, USHORT nColId,
- BOOL bRelToBrowser = TRUE) const;
- BOOL IsFieldVisible( long nRow, USHORT nColId,
- BOOL bComplete = FALSE ) const;
+ sal_Bool bRelToBrowser = sal_True ) const;
+ Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId,
+ sal_Bool bRelToBrowser = sal_True) const;
+ sal_Bool IsFieldVisible( long nRow, sal_uInt16 nColId,
+ sal_Bool bComplete = sal_False ) const;
long GetRowAtYPosPixel( long nY,
- BOOL bRelToBrowser = TRUE ) const;
- USHORT GetColumnAtXPosPixel( long nX,
- BOOL bRelToBrowser = TRUE ) const;
+ sal_Bool bRelToBrowser = sal_True ) const;
+ sal_uInt16 GetColumnAtXPosPixel( long nX,
+ sal_Bool bRelToBrowser = sal_True ) const;
// invalidations
void Clear();
- void RowRemoved( long nRow, long nNumRows = 1, BOOL bDoPaint = TRUE );
- void RowModified( long nRow, USHORT nColId = USHRT_MAX );
- void RowInserted( long nRow, long nNumRows = 1, BOOL bDoPaint = TRUE, BOOL bKeepSelection = FALSE );
+ void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
+ void RowModified( long nRow, sal_uInt16 nColId = USHRT_MAX );
+ void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False );
// miscellanous
- void ReserveControlArea( USHORT nWidth = USHRT_MAX );
+ void ReserveControlArea( sal_uInt16 nWidth = USHRT_MAX );
Rectangle GetControlArea() const;
- BOOL ProcessKey( const KeyEvent& rEvt );
- void Dispatch( USHORT nId );
+ sal_Bool ProcessKey( const KeyEvent& rEvt );
+ void Dispatch( sal_uInt16 nId );
void SetMode( BrowserMode nMode = 0 );
BrowserMode GetMode( ) const { return m_nCurrentMode; }
bool IsInCommandEvent() const;
void SetCursorColor(const Color& _rCol);
Color GetCursorColor() const { return m_aCursorColor; }
- void ResetSelecting() { bSelecting = FALSE; }
+ void ResetSelecting() { bSelecting = sal_False; }
/** specifies that the user is allowed to interactively change the height of a row,
by simply dragging an arbitrary row separator.
@@ -611,21 +611,21 @@ public:
Note that this works only if there's a handle column, since only in this case,
there *is* something for the user to click onto
*/
- void EnableInteractiveRowHeight( BOOL _bEnable = TRUE ) { mbInteractiveRowHeight = _bEnable; }
- BOOL IsInteractiveRowHeightEnabled( ) const { return mbInteractiveRowHeight; }
+ void EnableInteractiveRowHeight( sal_Bool _bEnable = sal_True ) { mbInteractiveRowHeight = _bEnable; }
+ sal_Bool IsInteractiveRowHeightEnabled( ) const { return mbInteractiveRowHeight; }
/// access to selected methods, to be granted to the BrowserColumn
struct BrowserColumnAccess { friend class BrowserColumn; private: BrowserColumnAccess() { } };
/** public version of PaintField, with selected access rights for the BrowserColumn
*/
- void DoPaintField( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId, BrowserColumnAccess ) const
+ void DoPaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId, BrowserColumnAccess ) const
{ PaintField( rDev, rRect, nColumnId ); }
/** suggests a default width for a column containing a given text
The width is calculated so that the text fits completely, plus som margin.
*/
- ULONG GetDefaultColumnWidth( const String& _rText ) const;
+ sal_uLong GetDefaultColumnWidth( const String& _rText ) const;
/** GetCellText returns the text at the given position
@param _nRow
@@ -635,12 +635,12 @@ public:
@return
the text out of the cell
*/
- virtual String GetCellText(long _nRow, USHORT _nColId) const;
+ virtual String GetCellText(long _nRow, sal_uInt16 _nColId) const;
/** @return
the current column count
*/
- USHORT GetColumnCount() const { return ColCount(); }
+ sal_uInt16 GetColumnCount() const { return ColCount(); }
/** commitBrowseBoxEvent commit the event at all listeners of the browsebox
@param nEventId
@@ -689,7 +689,7 @@ public:
@return
the Rectangle
*/
- virtual Rectangle calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen = TRUE);
+ virtual Rectangle calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen = sal_True);
/** calculates the Rectangle of the table
@param _bOnScreen
@@ -697,7 +697,7 @@ public:
@return
the Rectangle
*/
- virtual Rectangle calcTableRect(BOOL _bOnScreen = TRUE);
+ virtual Rectangle calcTableRect(sal_Bool _bOnScreen = sal_True);
/**
@param _nRowId
@@ -709,7 +709,7 @@ public:
@return
the Rectangle
*/
- virtual Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId,sal_uInt16 _nColId, BOOL _bIsHeader, BOOL _bOnScreen = TRUE);
+ virtual Rectangle GetFieldRectPixelAbs(sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True);
/// return <TRUE/> if and only if the accessible object for this instance has been created and is alive
sal_Bool isAccessibleAlive( ) const;
@@ -833,7 +833,7 @@ public:
virtual sal_uInt16 GetCurrColumn() const;
virtual sal_Bool HasRowHeader() const;
virtual sal_Bool IsCellFocusable() const;
- virtual BOOL GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
virtual sal_Bool IsColumnSelected( long _nColumn ) const;
virtual sal_Int32 GetSelectedRowCount() const;
@@ -841,11 +841,11 @@ public:
virtual void GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& _rRows ) const;
virtual void GetAllSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& _rColumns ) const;
virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
- virtual String GetAccessibleCellText(long _nRow, USHORT _nColPos) const;
- virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+ virtual String GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const;
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
virtual void GrabFocus();
- virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True );
virtual Window* GetAccessibleParentWindow() const;
virtual Window* GetWindowInstance();
diff --git a/svtools/inc/calendar.hxx b/svtools/inc/svtools/calendar.hxx
index feb4a3df58b1..f07b100e5c03 100644
--- a/svtools/inc/calendar.hxx
+++ b/svtools/inc/svtools/calendar.hxx
@@ -133,16 +133,16 @@ wenn man beispielsweise den Bereich eingrenzen oder erweitern will. Der
Bereich wird mit SelectDate()/SelectDateRange() umgesetzt und mit
GetSelectDateCount()/GetSelectDate() abgefragt. Wenn man wissen moechte,
in welche Richtung selektiert wird, kann dies ueber IsSelectLeft()
-abgefragt werden. TRUE bedeutet eine Selektion nach links oder oben,
-FALSE eine Selektion nach rechts oder unten.
+abgefragt werden. sal_True bedeutet eine Selektion nach links oder oben,
+sal_False eine Selektion nach rechts oder unten.
--------------------------------------------------------------------------
Wenn sich der Date-Range-Bereich anpasst und man dort die Selektion
uebernehmen will, sollte dies nur gemacht werden, wenn
-IsScrollDateRangeChanged() TRUE zurueckliefert. Denn diese Methode liefert
-TRUE zurueck, wenn der Bereich durch Betaetigung von den Scroll-Buttons
-ausgeloest wurde. Bei FALSE wurde dies durch Resize(), Methoden-Aufrufen
+IsScrollDateRangeChanged() sal_True zurueckliefert. Denn diese Methode liefert
+sal_True zurueck, wenn der Bereich durch Betaetigung von den Scroll-Buttons
+ausgeloest wurde. Bei sal_False wurde dies durch Resize(), Methoden-Aufrufen
oder durch Beendigung einer Selektion ausgeloest.
*************************************************************************/
@@ -164,7 +164,7 @@ oder durch Beendigung einer Selektion ausgeloest.
#define WB_MULTISELECT ((WinBits)0x00400000)
#endif
-#define DIB_BOLD ((USHORT)0x0001)
+#define DIB_BOLD ((sal_uInt16)0x0001)
// ------------
// - Calendar -
@@ -198,7 +198,7 @@ private:
Color* mpStandardColor;
Color* mpSaturdayColor;
Color* mpSundayColor;
- ULONG mnDayCount;
+ sal_uLong mnDayCount;
long mnDaysOffX;
long mnWeekDayOffY;
long mnDaysOffY;
@@ -213,10 +213,10 @@ private:
long mnDummy3;
long mnDummy4;
WinBits mnWinStyle;
- USHORT mnFirstYear;
- USHORT mnLastYear;
- USHORT mnRequestYear;
- BOOL mbCalc:1,
+ sal_uInt16 mnFirstYear;
+ sal_uInt16 mnLastYear;
+ sal_uInt16 mnRequestYear;
+ sal_Bool mbCalc:1,
mbFormat:1,
mbDrag:1,
mbSelection:1,
@@ -240,7 +240,7 @@ private:
Link maDoubleClickHdl;
Link maSelectHdl;
Timer maDragScrollTimer;
- USHORT mnDragScrollHitTest;
+ sal_uInt16 mnDragScrollHitTest;
#ifdef _SV_CALENDAR_CXX
using Control::ImplInitSettings;
@@ -250,30 +250,30 @@ private:
SVT_DLLPRIVATE void ImplGetWeekFont( Font& rFont ) const;
SVT_DLLPRIVATE void ImplFormat();
using Window::ImplHitTest;
- SVT_DLLPRIVATE USHORT ImplHitTest( const Point& rPos, Date& rDate ) const;
- SVT_DLLPRIVATE void ImplDrawSpin( BOOL bDrawPrev = TRUE, BOOL bDrawNext = TRUE );
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, Date& rDate ) const;
+ SVT_DLLPRIVATE void ImplDrawSpin( sal_Bool bDrawPrev = sal_True, sal_Bool bDrawNext = sal_True );
SVT_DLLPRIVATE void ImplDrawDate( long nX, long nY,
- USHORT nDay, USHORT nMonth, USHORT nYear,
+ sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear,
DayOfWeek eDayOfWeek,
- BOOL bBack = TRUE, BOOL bOther = FALSE,
- ULONG nToday = 0 );
- SVT_DLLPRIVATE void ImplDraw( BOOL bPaint = FALSE );
+ sal_Bool bBack = sal_True, sal_Bool bOther = sal_False,
+ sal_uLong nToday = 0 );
+ SVT_DLLPRIVATE void ImplDraw( sal_Bool bPaint = sal_False );
SVT_DLLPRIVATE void ImplUpdateDate( const Date& rDate );
SVT_DLLPRIVATE void ImplUpdateSelection( Table* pOld );
- SVT_DLLPRIVATE void ImplMouseSelect( const Date& rDate, USHORT nHitTest,
- BOOL bMove, BOOL bExpand, BOOL bExtended );
- SVT_DLLPRIVATE void ImplUpdate( BOOL bCalcNew = FALSE );
+ SVT_DLLPRIVATE void ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
+ sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bCalcNew = sal_False );
using Window::ImplScroll;
- SVT_DLLPRIVATE void ImplScroll( BOOL bPrev );
+ SVT_DLLPRIVATE void ImplScroll( sal_Bool bPrev );
SVT_DLLPRIVATE void ImplInvertDropPos();
SVT_DLLPRIVATE void ImplShowMenu( const Point& rPos, const Date& rDate );
- SVT_DLLPRIVATE void ImplTracking( const Point& rPos, BOOL bRepeat );
- SVT_DLLPRIVATE void ImplEndTracking( BOOL bCancel );
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, sal_Bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( sal_Bool bCancel );
SVT_DLLPRIVATE DayOfWeek ImplGetWeekStart() const;
#endif
protected:
- BOOL ShowDropPos( const Point& rPos, Date& rDate );
+ sal_Bool ShowDropPos( const Point& rPos, Date& rDate );
void HideDropPos();
DECL_STATIC_LINK( Calendar, ScrollHdl, Timer *);
@@ -311,29 +311,29 @@ public:
/// Set how many days of a week must reside in the first week of a year.
void SetMinimumNumberOfDaysInWeek( sal_Int16 nDays );
- void SelectDate( const Date& rDate, BOOL bSelect = TRUE );
+ void SelectDate( const Date& rDate, sal_Bool bSelect = sal_True );
void SelectDateRange( const Date& rStartDate, const Date& rEndDate,
- BOOL bSelect = TRUE );
+ sal_Bool bSelect = sal_True );
void SetNoSelection();
- BOOL IsDateSelected( const Date& rDate ) const;
- ULONG GetSelectDateCount() const;
- Date GetSelectDate( ULONG nIndex = 0 ) const;
- void EnableCallEverySelect( BOOL bEvery = TRUE ) { mbAllSel = bEvery; }
- BOOL IsCallEverySelectEnabled() const { return mbAllSel; }
+ sal_Bool IsDateSelected( const Date& rDate ) const;
+ sal_uLong GetSelectDateCount() const;
+ Date GetSelectDate( sal_uLong nIndex = 0 ) const;
+ void EnableCallEverySelect( sal_Bool bEvery = sal_True ) { mbAllSel = bEvery; }
+ sal_Bool IsCallEverySelectEnabled() const { return mbAllSel; }
- USHORT GetRequestYear() const { return mnRequestYear; }
+ sal_uInt16 GetRequestYear() const { return mnRequestYear; }
void SetCurDate( const Date& rNewDate );
Date GetCurDate() const { return maCurDate; }
void SetFirstDate( const Date& rNewFirstDate );
Date GetFirstDate() const { return maFirstDate; }
Date GetLastDate() const { return GetFirstDate() + mnDayCount; }
- ULONG GetDayCount() const { return mnDayCount; }
+ sal_uLong GetDayCount() const { return mnDayCount; }
Date GetFirstMonth() const;
Date GetLastMonth() const;
- USHORT GetMonthCount() const;
- BOOL GetDate( const Point& rPos, Date& rDate ) const;
+ sal_uInt16 GetMonthCount() const;
+ sal_Bool GetDate( const Point& rPos, Date& rDate ) const;
Rectangle GetDateRect( const Date& rDate ) const;
- BOOL GetDropDate( Date& rDate ) const;
+ sal_Bool GetDropDate( Date& rDate ) const;
long GetCurMonthPerLine() const { return mnMonthPerLine; }
long GetCurLines() const { return mnLines; }
@@ -348,7 +348,7 @@ public:
void AddDateInfo( const Date& rDate, const XubString& rText,
const Color* pTextColor = NULL,
const Color* pFrameColor = NULL,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
void RemoveDateInfo( const Date& rDate );
void ClearDateInfo();
XubString GetDateInfoText( const Date& rDate );
@@ -356,9 +356,9 @@ public:
void StartSelection();
void EndSelection();
- BOOL IsTravelSelect() const { return mbTravelSelect; }
- BOOL IsScrollDateRangeChanged() const { return mbScrollDateRange; }
- BOOL IsSelectLeft() const { return mbSelLeft; }
+ sal_Bool IsTravelSelect() const { return mbTravelSelect; }
+ sal_Bool IsScrollDateRangeChanged() const { return mbScrollDateRange; }
+ sal_Bool IsSelectLeft() const { return mbSelLeft; }
Size CalcWindowSizePixel( long nCalcMonthPerLine = 1,
long nCalcLines = 1 ) const;
@@ -454,8 +454,8 @@ private:
PushButton* mpTodayBtn;
PushButton* mpNoneBtn;
Date maDefaultDate;
- BOOL mbToday;
- BOOL mbNone;
+ sal_Bool mbToday;
+ sal_Bool mbNone;
Link maSelectHdl;
#ifdef _SV_CALENDAR_CXX
@@ -471,17 +471,17 @@ public:
virtual void Select();
- virtual BOOL ShowDropDown( BOOL bShow );
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
virtual Calendar* CreateCalendar( Window* pParent );
Calendar* GetCalendar();
void SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
Date GetDefaultDate() const { return maDefaultDate; }
- void EnableToday( BOOL bToday = TRUE ) { mbToday = bToday; }
- BOOL IsTodayEnabled() const { return mbToday; }
- void EnableNone( BOOL bNone = TRUE ) { mbNone = bNone; }
- BOOL IsNoneEnabled() const { return mbNone; }
+ void EnableToday( sal_Bool bToday = sal_True ) { mbToday = bToday; }
+ sal_Bool IsTodayEnabled() const { return mbToday; }
+ void EnableNone( sal_Bool bNone = sal_True ) { mbNone = bNone; }
+ sal_Bool IsNoneEnabled() const { return mbNone; }
void SetCalendarStyle( WinBits nStyle ) { mnCalendarStyle = nStyle; }
WinBits GetCalendarStyle() const { return mnCalendarStyle; }
diff --git a/svtools/inc/cliplistener.hxx b/svtools/inc/svtools/cliplistener.hxx
index 40d44a4cdcab..6f9aee42c268 100644
--- a/svtools/inc/cliplistener.hxx
+++ b/svtools/inc/svtools/cliplistener.hxx
@@ -47,7 +47,7 @@ public:
TransferableClipboardListener( const Link& rCallback );
~TransferableClipboardListener();
- void AddRemoveListener( Window* pWin, BOOL bAdd );
+ void AddRemoveListener( Window* pWin, sal_Bool bAdd );
void ClearCallbackLink();
// XEventListener
diff --git a/svtools/inc/svtools/colctrl.hxx b/svtools/inc/svtools/colctrl.hxx
index 69a372e07bb3..5ad4681b26bb 100644
--- a/svtools/inc/svtools/colctrl.hxx
+++ b/svtools/inc/svtools/colctrl.hxx
@@ -73,7 +73,7 @@ public:
Color GetColor() const { return maColor; };
void SetColor( const Color& rCol );
- void SetColor( const ColorHSB& rCol, BOOL bSetColor = TRUE );
+ void SetColor( const ColorHSB& rCol, sal_Bool bSetColor = sal_True );
short GetLuminance() const { return mnLuminance; };
void SetLuminance( short nLum );
@@ -112,27 +112,27 @@ enum CMCPosition { CMC_TOPLEFT, CMC_TOPRIGHT, CMC_BOTTOMLEFT, CMC_BOTTOMRIGHT, C
class ColorMixingControl : public ValueSet
{
private:
- USHORT mnRows;
- USHORT mnColumns;
+ sal_uInt16 mnRows;
+ sal_uInt16 mnColumns;
Color maColor[4];
void Initialize();
- Color CalcDifferenceColor( USHORT nCol1, USHORT nCol2, USHORT nSteps );
- void FillRow( USHORT nRow );
- void FillColumn( USHORT nColumn );
+ Color CalcDifferenceColor( sal_uInt16 nCol1, sal_uInt16 nCol2, sal_uInt16 nSteps );
+ void FillRow( sal_uInt16 nRow );
+ void FillColumn( sal_uInt16 nColumn );
public:
ColorMixingControl( Window* pParent, WinBits nStyle = 0,
- USHORT nRows = 4, USHORT nColumns = 4 );
+ sal_uInt16 nRows = 4, sal_uInt16 nColumns = 4 );
ColorMixingControl( Window* pParent, const ResId& rResId,
- USHORT nRows = 4, USHORT nColumns = 4 );
+ sal_uInt16 nRows = 4, sal_uInt16 nColumns = 4 );
~ColorMixingControl();
- USHORT GetRows() const { return mnRows; };
- void SetRows( USHORT nRows );
- USHORT GetColumns() const { return mnColumns; };
- void SetColumns( USHORT nColumns );
+ sal_uInt16 GetRows() const { return mnRows; };
+ void SetRows( sal_uInt16 nRows );
+ sal_uInt16 GetColumns() const { return mnColumns; };
+ void SetColumns( sal_uInt16 nColumns );
using ValueSet::GetColor;
Color GetColor( CMCPosition ePos ) const { return maColor[ ePos ]; };
@@ -150,23 +150,23 @@ public:
class ColorHSB
{
private:
- USHORT mnHue; // Farbwinkel, 360 Grad
- USHORT mnSat; // Saturation, 100 %
- USHORT mnBri; // Brightness, 100 %
+ sal_uInt16 mnHue; // Farbwinkel, 360 Grad
+ sal_uInt16 mnSat; // Saturation, 100 %
+ sal_uInt16 mnBri; // Brightness, 100 %
public:
ColorHSB()
{ mnHue=0; mnSat=0; mnBri=0; }
- ColorHSB( USHORT nH, USHORT nS, USHORT nB )
+ ColorHSB( sal_uInt16 nH, sal_uInt16 nS, sal_uInt16 nB )
{ mnHue=nH; mnSat=nS; mnBri=nB; }
ColorHSB( const Color& rColor );
- void SetHue( USHORT nH ) { mnHue=nH; }
- void SetSat( USHORT nS ) { mnSat=nS; }
- void SetBri( USHORT nB ) { mnBri=nB; }
- USHORT GetHue() const { return mnHue; }
- USHORT GetSat() const { return mnSat; }
- USHORT GetBri() const { return mnBri; }
+ void SetHue( sal_uInt16 nH ) { mnHue=nH; }
+ void SetSat( sal_uInt16 nS ) { mnSat=nS; }
+ void SetBri( sal_uInt16 nB ) { mnBri=nB; }
+ sal_uInt16 GetHue() const { return mnHue; }
+ sal_uInt16 GetSat() const { return mnSat; }
+ sal_uInt16 GetBri() const { return mnBri; }
Color GetRGB() const;
};
@@ -177,26 +177,26 @@ public:
class ColorCMYK
{
private:
- USHORT mnCyan;
- USHORT mnMagenta;
- USHORT mnYellow;
- USHORT mnKey;
+ sal_uInt16 mnCyan;
+ sal_uInt16 mnMagenta;
+ sal_uInt16 mnYellow;
+ sal_uInt16 mnKey;
public:
ColorCMYK()
{ mnCyan=0; mnMagenta=0; mnYellow=0; mnKey=100; }
- ColorCMYK( USHORT nC, USHORT nM, USHORT nY, USHORT nK )
+ ColorCMYK( sal_uInt16 nC, sal_uInt16 nM, sal_uInt16 nY, sal_uInt16 nK )
{ mnCyan=nC; mnMagenta=nM; mnYellow=nY; mnKey=nK; }
ColorCMYK( const Color& rColor );
- void SetCyan( USHORT nC ) { mnCyan=nC; }
- void SetMagenta( USHORT nM ) { mnMagenta=nM; }
- void SetYellow( USHORT nY ) { mnYellow=nY; }
- void SetKey( USHORT nK ) { mnKey=nK; }
- USHORT GetCyan() const { return mnCyan; }
- USHORT GetMagenta() const { return mnMagenta; }
- USHORT GetYellow() const { return mnYellow; }
- USHORT GetKey() const { return mnKey; }
+ void SetCyan( sal_uInt16 nC ) { mnCyan=nC; }
+ void SetMagenta( sal_uInt16 nM ) { mnMagenta=nM; }
+ void SetYellow( sal_uInt16 nY ) { mnYellow=nY; }
+ void SetKey( sal_uInt16 nK ) { mnKey=nK; }
+ sal_uInt16 GetCyan() const { return mnCyan; }
+ sal_uInt16 GetMagenta() const { return mnMagenta; }
+ sal_uInt16 GetYellow() const { return mnYellow; }
+ sal_uInt16 GetKey() const { return mnKey; }
Color GetRGB() const;
};
diff --git a/svtools/inc/collatorres.hxx b/svtools/inc/svtools/collatorres.hxx
index 467e8b7103f1..467e8b7103f1 100644
--- a/svtools/inc/collatorres.hxx
+++ b/svtools/inc/svtools/collatorres.hxx
diff --git a/svtools/inc/contextmenuhelper.hxx b/svtools/inc/svtools/contextmenuhelper.hxx
index c6f30e2a3d4b..c6f30e2a3d4b 100644
--- a/svtools/inc/contextmenuhelper.hxx
+++ b/svtools/inc/svtools/contextmenuhelper.hxx
diff --git a/svtools/inc/controldims.hrc b/svtools/inc/svtools/controldims.hrc
index 5e26f132897d..5e26f132897d 100644
--- a/svtools/inc/controldims.hrc
+++ b/svtools/inc/svtools/controldims.hrc
diff --git a/svtools/inc/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index 6804b7192503..981a89885e60 100644
--- a/svtools/inc/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -47,9 +47,9 @@ typedef ::std::vector< ImplColorListData* > ImpColorList;
typedef ::std::vector< ImpLineListData* > ImpLineList;
typedef ::std::vector< ImplFontNameListData* > ImplFontList;
-#define STYLE_SOLID ( ( USHORT ) 0 )
-#define STYLE_DOTTED ( ( USHORT ) 1 )
-#define STYLE_DASHED ( ( USHORT ) 2 )
+#define STYLE_SOLID ( ( sal_uInt16 ) 0 )
+#define STYLE_DOTTED ( ( sal_uInt16 ) 1 )
+#define STYLE_DASHED ( ( sal_uInt16 ) 2 )
/*************************************************************************
@@ -178,60 +178,60 @@ public:
virtual void UserDraw( const UserDrawEvent& rUDEvt );
using ListBox::InsertEntry;
- virtual USHORT InsertEntry( const XubString& rStr,
- USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( const Color& rColor, const XubString& rStr,
- USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Color& rColor, const XubString& rStr,
+ sal_uInt16 nPos = LISTBOX_APPEND );
void InsertAutomaticEntry();
using ListBox::RemoveEntry;
- virtual void RemoveEntry( USHORT nPos );
+ virtual void RemoveEntry( sal_uInt16 nPos );
virtual void Clear();
void CopyEntries( const ColorListBox& rBox );
using ListBox::GetEntryPos;
- virtual USHORT GetEntryPos( const Color& rColor ) const;
- virtual Color GetEntryColor( USHORT nPos ) const;
+ virtual sal_uInt16 GetEntryPos( const Color& rColor ) const;
+ virtual Color GetEntryColor( sal_uInt16 nPos ) const;
Size GetImageSize() const { return aImageSize; }
- void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE )
+ void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True )
{ ListBox::SelectEntry( rStr, bSelect ); }
- void SelectEntry( const Color& rColor, BOOL bSelect = TRUE );
- XubString GetSelectEntry( USHORT nSelIndex = 0 ) const
+ void SelectEntry( const Color& rColor, sal_Bool bSelect = sal_True );
+ XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const
{ return ListBox::GetSelectEntry( nSelIndex ); }
- Color GetSelectEntryColor( USHORT nSelIndex = 0 ) const;
- BOOL IsEntrySelected( const XubString& rStr ) const
+ Color GetSelectEntryColor( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntrySelected( const XubString& rStr ) const
{ return ListBox::IsEntrySelected( rStr ); }
- BOOL IsEntrySelected( const Color& rColor ) const;
+ sal_Bool IsEntrySelected( const Color& rColor ) const;
private:
// declared as private because some compilers would generate the default functions
ColorListBox( const ColorListBox& );
ColorListBox& operator =( const ColorListBox& );
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
};
-inline void ColorListBox::SelectEntry( const Color& rColor, BOOL bSelect )
+inline void ColorListBox::SelectEntry( const Color& rColor, sal_Bool bSelect )
{
- USHORT nPos = GetEntryPos( rColor );
+ sal_uInt16 nPos = GetEntryPos( rColor );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
ListBox::SelectEntryPos( nPos, bSelect );
}
-inline BOOL ColorListBox::IsEntrySelected( const Color& rColor ) const
+inline sal_Bool ColorListBox::IsEntrySelected( const Color& rColor ) const
{
- USHORT nPos = GetEntryPos( rColor );
+ sal_uInt16 nPos = GetEntryPos( rColor );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
return IsEntryPosSelected( nPos );
else
- return FALSE;
+ return sal_False;
}
-inline Color ColorListBox::GetSelectEntryColor( USHORT nSelIndex ) const
+inline Color ColorListBox::GetSelectEntryColor( sal_uInt16 nSelIndex ) const
{
- USHORT nPos = GetSelectEntryPos( nSelIndex );
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
Color aColor;
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
aColor = GetEntryColor( nPos );
@@ -253,11 +253,11 @@ class SVT_DLLPUBLIC LineListBox : public ListBox
FieldUnit eSourceUnit;
SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance,
- USHORT nStyle, Bitmap& rBmp, XubString& rStr );
+ sal_uInt16 nStyle, Bitmap& rBmp, XubString& rStr );
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
void UpdateLineColors( void );
- BOOL UpdatePaintLineColor( void ); // returns TRUE if maPaintCol has changed
+ sal_Bool UpdatePaintLineColor( void ); // returns sal_True if maPaintCol has changed
inline const Color& GetPaintColor( void ) const;
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -267,31 +267,31 @@ public:
virtual ~LineListBox();
using ListBox::InsertEntry;
- virtual USHORT InsertEntry( const XubString& rStr, USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( long nLine1, long nLine2 = 0, long nDistance = 0,
- USHORT nStyle = STYLE_SOLID, USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( long nLine1, long nLine2 = 0, long nDistance = 0,
+ sal_uInt16 nStyle = STYLE_SOLID, sal_uInt16 nPos = LISTBOX_APPEND );
using ListBox::RemoveEntry;
- virtual void RemoveEntry( USHORT nPos );
+ virtual void RemoveEntry( sal_uInt16 nPos );
virtual void Clear();
using ListBox::GetEntryPos;
- USHORT GetEntryPos( long nLine1, long nLine2 = 0, long nDistance = 0,
- USHORT nStyle = STYLE_SOLID ) const;
- long GetEntryLine1( USHORT nPos ) const;
- long GetEntryLine2( USHORT nPos ) const;
- long GetEntryDistance( USHORT nPos ) const;
- USHORT GetEntryStyle( USHORT nPos ) const;
-
- inline void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE ) { ListBox::SelectEntry( rStr, bSelect ); }
+ sal_uInt16 GetEntryPos( long nLine1, long nLine2 = 0, long nDistance = 0,
+ sal_uInt16 nStyle = STYLE_SOLID ) const;
+ long GetEntryLine1( sal_uInt16 nPos ) const;
+ long GetEntryLine2( sal_uInt16 nPos ) const;
+ long GetEntryDistance( sal_uInt16 nPos ) const;
+ sal_uInt16 GetEntryStyle( sal_uInt16 nPos ) const;
+
+ inline void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True ) { ListBox::SelectEntry( rStr, bSelect ); }
void SelectEntry( long nLine1, long nLine2 = 0, long nDistance = 0,
- USHORT nStyle = STYLE_SOLID, BOOL bSelect = TRUE );
- long GetSelectEntryLine1( USHORT nSelIndex = 0 ) const;
- long GetSelectEntryLine2( USHORT nSelIndex = 0 ) const;
- long GetSelectEntryDistance( USHORT nSelIndex = 0 ) const;
- USHORT GetSelectEntryStyle( USHORT nSelIndex = 0 ) const;
- inline BOOL IsEntrySelected( const XubString& rStr ) const { return ListBox::IsEntrySelected( rStr ); }
- BOOL IsEntrySelected( long nLine1, long nLine2 = 0, long nDistance = 0,
- USHORT nStyle1 = STYLE_SOLID ) const;
+ sal_uInt16 nStyle = STYLE_SOLID, sal_Bool bSelect = sal_True );
+ long GetSelectEntryLine1( sal_uInt16 nSelIndex = 0 ) const;
+ long GetSelectEntryLine2( sal_uInt16 nSelIndex = 0 ) const;
+ long GetSelectEntryDistance( sal_uInt16 nSelIndex = 0 ) const;
+ sal_uInt16 GetSelectEntryStyle( sal_uInt16 nSelIndex = 0 ) const;
+ inline sal_Bool IsEntrySelected( const XubString& rStr ) const { return ListBox::IsEntrySelected( rStr ); }
+ sal_Bool IsEntrySelected( long nLine1, long nLine2 = 0, long nDistance = 0,
+ sal_uInt16 nStyle1 = STYLE_SOLID ) const;
inline void SetUnit( FieldUnit eNewUnit ) { eUnit = eNewUnit; }
inline FieldUnit GetUnit() const { return eUnit; }
@@ -305,61 +305,61 @@ private:
// declared as private because some compilers would generate the default methods
LineListBox( const LineListBox& );
LineListBox& operator =( const LineListBox& );
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
};
-inline void LineListBox::SelectEntry( long nLine1, long nLine2, long nDistance, USHORT nStyle, BOOL bSelect )
+inline void LineListBox::SelectEntry( long nLine1, long nLine2, long nDistance, sal_uInt16 nStyle, sal_Bool bSelect )
{
- USHORT nPos = GetEntryPos( nLine1, nLine2, nDistance, nStyle );
+ sal_uInt16 nPos = GetEntryPos( nLine1, nLine2, nDistance, nStyle );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
ListBox::SelectEntryPos( nPos, bSelect );
}
-inline long LineListBox::GetSelectEntryLine1( USHORT nSelIndex ) const
+inline long LineListBox::GetSelectEntryLine1( sal_uInt16 nSelIndex ) const
{
- USHORT nPos = GetSelectEntryPos( nSelIndex );
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
return GetEntryLine1( nPos );
else
return 0;
}
-inline long LineListBox::GetSelectEntryLine2( USHORT nSelIndex ) const
+inline long LineListBox::GetSelectEntryLine2( sal_uInt16 nSelIndex ) const
{
- USHORT nPos = GetSelectEntryPos( nSelIndex );
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
return GetEntryLine2( nPos );
else
return 0;
}
-inline long LineListBox::GetSelectEntryDistance( USHORT nSelIndex ) const
+inline long LineListBox::GetSelectEntryDistance( sal_uInt16 nSelIndex ) const
{
- USHORT nPos = GetSelectEntryPos( nSelIndex );
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
return GetEntryDistance( nPos );
else
return 0;
}
-inline USHORT LineListBox::GetSelectEntryStyle( USHORT nSelIndex ) const
+inline sal_uInt16 LineListBox::GetSelectEntryStyle( sal_uInt16 nSelIndex ) const
{
- USHORT nStyle = STYLE_SOLID;
- USHORT nPos = GetSelectEntryPos( nSelIndex );
+ sal_uInt16 nStyle = STYLE_SOLID;
+ sal_uInt16 nPos = GetSelectEntryPos( nSelIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
nStyle = GetEntryStyle( nPos );
return nStyle;
}
-inline BOOL LineListBox::IsEntrySelected( long nLine1, long nLine2, long nDistance, USHORT nStyle ) const
+inline sal_Bool LineListBox::IsEntrySelected( long nLine1, long nLine2, long nDistance, sal_uInt16 nStyle ) const
{
- USHORT nPos = GetEntryPos( nLine1, nLine2, nDistance, nStyle );
+ sal_uInt16 nPos = GetEntryPos( nLine1, nLine2, nDistance, nStyle );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
return IsEntryPosSelected( nPos );
else
- return FALSE;
+ return sal_False;
}
inline void LineListBox::SetColor( const Color& rColor )
@@ -386,8 +386,8 @@ private:
Image maImagePrinterFont;
Image maImageBitmapFont;
Image maImageScalableFont;
- BOOL mbWYSIWYG;
- BOOL mbSymbols;
+ sal_Bool mbWYSIWYG;
+ sal_Bool mbSymbols;
#ifdef _CTRLBOX_CXX
SVT_DLLPRIVATE void ImplCalcUserItemSize();
@@ -407,11 +407,11 @@ public:
void Fill( const FontList* pList );
- void EnableWYSIWYG( BOOL bEnable = TRUE );
- BOOL IsWYSIWYGEnabled() const { return mbWYSIWYG; }
+ void EnableWYSIWYG( sal_Bool bEnable = sal_True );
+ sal_Bool IsWYSIWYGEnabled() const { return mbWYSIWYG; }
- void EnableSymbols( BOOL bEnable = TRUE );
- BOOL IsSymbolsEnabled() const { return mbSymbols; }
+ void EnableSymbols( sal_Bool bEnable = sal_True );
+ sal_Bool IsSymbolsEnabled() const { return mbSymbols; }
private:
// declared as private because some compilers would generate the default functions
@@ -461,13 +461,13 @@ class SVT_DLLPUBLIC FontSizeBox : public MetricBox
{
FontInfo aFontInfo;
const FontList* pFontList;
- USHORT nRelMin;
- USHORT nRelMax;
- USHORT nRelStep;
+ sal_uInt16 nRelMin;
+ sal_uInt16 nRelMax;
+ sal_uInt16 nRelStep;
short nPtRelMin;
short nPtRelMax;
short nPtRelStep;
- BOOL bRelativeMode:1,
+ sal_Bool bRelativeMode:1,
bRelative:1,
bPtRelative:1,
bStdSize:1;
@@ -490,22 +490,22 @@ public:
void Fill( const FontInfo* pInfo, const FontList* pList );
- void EnableRelativeMode( USHORT nMin = 50, USHORT nMax = 150,
- USHORT nStep = 5 );
+ void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
+ sal_uInt16 nStep = 5 );
void EnablePtRelativeMode( short nMin = -200, short nMax = 200,
short nStep = 10 );
- BOOL IsRelativeMode() const { return bRelativeMode; }
- void SetRelative( BOOL bRelative = FALSE );
- BOOL IsRelative() const { return bRelative; }
- void SetPtRelative( BOOL bPtRel = TRUE )
- { bPtRelative = bPtRel; SetRelative( TRUE ); }
- BOOL IsPtRelative() const { return bPtRelative; }
+ sal_Bool IsRelativeMode() const { return bRelativeMode; }
+ void SetRelative( sal_Bool bRelative = sal_False );
+ sal_Bool IsRelative() const { return bRelative; }
+ void SetPtRelative( sal_Bool bPtRel = sal_True )
+ { bPtRelative = bPtRel; SetRelative( sal_True ); }
+ sal_Bool IsPtRelative() const { return bPtRelative; }
virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const;
virtual sal_Int64 GetValue() const;
- sal_Int64 GetValue( USHORT nPos, FieldUnit eOutUnit ) const;
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const;
void SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit );
void SetUserValue( sal_Int64 nNewValue ) { SetUserValue( nNewValue, FUNIT_NONE ); }
diff --git a/svtools/inc/ctrltool.hxx b/svtools/inc/svtools/ctrltool.hxx
index dd35d06ec893..e0352c4eb585 100644
--- a/svtools/inc/ctrltool.hxx
+++ b/svtools/inc/svtools/ctrltool.hxx
@@ -60,7 +60,7 @@ class FontNameMenu, class FontStyleMenu, class FontSizeMenu
--------------------------------------------------------------------------
FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2 = NULL,
- BOOL bAll = TRUE );
+ sal_Bool bAll = sal_True );
Konstruktor der Klasse FontList. Vom uebergebenen OutputDevice werden die
entsprechenden Fonts abgefragt. Das OutputDevice muss solange existieren,
@@ -77,8 +77,8 @@ Device-Schriften (eine fuer Drucker und eine fuer den Bildschirm) vorhanden
sind, wird die vom uebergebenen Device "pDevice" bevorzugt.
Mit dem dritten Parameter kann man angeben, ob nur skalierbare Schriften
-abgefragt werden sollen oder alle. Wenn TRUE uebergeben wird, werden auch
-Bitmap-Schriften mit abgefragt. Bei FALSE werden Vector-Schriften und
+abgefragt werden sollen oder alle. Wenn sal_True uebergeben wird, werden auch
+Bitmap-Schriften mit abgefragt. Bei sal_False werden Vector-Schriften und
scalierbare Schriften abgefragt.
--------------------------------------------------------------------------
@@ -144,11 +144,11 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
// - FontList -
// ------------
-#define FONTLIST_FONTINFO_NOTFOUND ((USHORT)0xFFFF)
+#define FONTLIST_FONTINFO_NOTFOUND ((sal_uInt16)0xFFFF)
-#define FONTLIST_FONTNAMETYPE_PRINTER ((USHORT)0x0001)
-#define FONTLIST_FONTNAMETYPE_SCREEN ((USHORT)0x0002)
-#define FONTLIST_FONTNAMETYPE_SCALABLE ((USHORT)0x0004)
+#define FONTLIST_FONTNAMETYPE_PRINTER ((sal_uInt16)0x0001)
+#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
+#define FONTLIST_FONTNAMETYPE_SCALABLE ((sal_uInt16)0x0004)
class SVT_DLLPUBLIC FontList : private List
{
@@ -172,16 +172,16 @@ private:
OutputDevice* mpDev2;
#ifdef CTRLTOOL_CXX
- SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const XubString& rSearchName, ULONG* pIndex ) const;
+ SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const;
SVT_DLLPRIVATE ImplFontListNameInfo* ImplFindByName( const XubString& rStr ) const;
- SVT_DLLPRIVATE void ImplInsertFonts( OutputDevice* pDev, BOOL bAll,
- BOOL bInsertData );
+ SVT_DLLPRIVATE void ImplInsertFonts( OutputDevice* pDev, sal_Bool bAll,
+ sal_Bool bInsertData );
#endif
public:
FontList( OutputDevice* pDevice,
OutputDevice* pDevice2 = NULL,
- BOOL bAll = TRUE );
+ sal_Bool bAll = sal_True );
~FontList();
FontList* Clone() const;
@@ -189,7 +189,7 @@ public:
OutputDevice* GetDevice() const { return mpDev; }
OutputDevice* GetDevice2() const { return mpDev2; }
XubString GetFontMapText( const FontInfo& rInfo ) const;
- USHORT GetFontNameType( const XubString& rFontName ) const;
+ sal_uInt16 GetFontNameType( const XubString& rFontName ) const;
const XubString& GetNormalStr() const { return maNormal; }
const XubString& GetItalicStr() const { return maNormalItalic; }
@@ -204,11 +204,11 @@ public:
FontWeight eWeight,
FontItalic eItalic ) const;
- BOOL IsAvailable( const XubString& rName ) const;
- USHORT GetFontNameCount() const
- { return (USHORT)List::Count(); }
- const FontInfo& GetFontName( USHORT nFont ) const;
- USHORT GetFontNameType( USHORT nFont ) const;
+ sal_Bool IsAvailable( const XubString& rName ) const;
+ sal_uInt16 GetFontNameCount() const
+ { return (sal_uInt16)List::Count(); }
+ const FontInfo& GetFontName( sal_uInt16 nFont ) const;
+ sal_uInt16 GetFontNameType( sal_uInt16 nFont ) const;
sal_Handle GetFirstFontInfo( const XubString& rName ) const;
sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const;
const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const;
@@ -230,19 +230,19 @@ class SVT_DLLPUBLIC FontSizeNames
{
private:
const struct ImplFSNameItem* mpArray;
- ULONG mnElem;
+ sal_uLong mnElem;
public:
FontSizeNames( LanguageType eLanguage /* = LANGUAGE_DONTKNOW */ );
- ULONG Count() const { return mnElem; }
- BOOL IsEmpty() const { return !mnElem; }
+ sal_uLong Count() const { return mnElem; }
+ sal_Bool IsEmpty() const { return !mnElem; }
long Name2Size( const String& ) const;
String Size2Name( long ) const;
- String GetIndexName( ULONG nIndex ) const;
- long GetIndexSize( ULONG nIndex ) const;
+ String GetIndexName( sal_uLong nIndex ) const;
+ long GetIndexSize( sal_uLong nIndex ) const;
};
#endif // _CTRLTOOL_HXX
diff --git a/svtools/inc/dialogclosedlistener.hxx b/svtools/inc/svtools/dialogclosedlistener.hxx
index 7b80ed6b449d..7b80ed6b449d 100644
--- a/svtools/inc/dialogclosedlistener.hxx
+++ b/svtools/inc/svtools/dialogclosedlistener.hxx
diff --git a/svtools/inc/dialogcontrolling.hxx b/svtools/inc/svtools/dialogcontrolling.hxx
index d0bb6646ba85..d0bb6646ba85 100644
--- a/svtools/inc/dialogcontrolling.hxx
+++ b/svtools/inc/svtools/dialogcontrolling.hxx
diff --git a/svtools/inc/svtools/editbrowsebox.hxx b/svtools/inc/svtools/editbrowsebox.hxx
index ecb3fe3bda89..d8c389215613 100644
--- a/svtools/inc/svtools/editbrowsebox.hxx
+++ b/svtools/inc/svtools/editbrowsebox.hxx
@@ -37,7 +37,7 @@
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
-#include <vcl/imagebtn.hxx>
+#include <vcl/button.hxx>
#include <svtools/brwbox.hxx>
#include <vcl/timer.hxx>
#include <svtools/brwhead.hxx>
@@ -98,7 +98,7 @@ namespace svt
protected:
Control* pWindow;
- sal_Bool bSuspended; // <TRUE> if the window is hidden and disabled
+ sal_Bool bSuspended; // <sal_True> if the window is hidden and disabled
public:
TYPEINFO();
@@ -140,8 +140,8 @@ namespace svt
virtual String GetText( LineEnd aSeparator ) const = 0;
virtual void SetText( const String& _rStr ) = 0;
- virtual BOOL IsReadOnly() const = 0;
- virtual void SetReadOnly( BOOL bReadOnly ) = 0;
+ virtual sal_Bool IsReadOnly() const = 0;
+ virtual void SetReadOnly( sal_Bool bReadOnly ) = 0;
virtual xub_StrLen GetMaxTextLen() const = 0;
virtual void SetMaxTextLen( xub_StrLen _nMaxLen ) = 0;
@@ -176,8 +176,8 @@ namespace svt
virtual String GetText( LineEnd aSeparator ) const;
virtual void SetText( const String& _rStr );
- virtual BOOL IsReadOnly() const;
- virtual void SetReadOnly( BOOL bReadOnly );
+ virtual sal_Bool IsReadOnly() const;
+ virtual void SetReadOnly( sal_Bool bReadOnly );
virtual xub_StrLen GetMaxTextLen() const;
virtual void SetMaxTextLen( xub_StrLen _nMaxLen );
@@ -218,7 +218,7 @@ namespace svt
virtual void Modify();
private:
- BOOL dispatchKeyEvent( const KeyEvent& _rEvent );
+ sal_Bool dispatchKeyEvent( const KeyEvent& _rEvent );
};
//==================================================================
@@ -244,7 +244,7 @@ namespace svt
class SVT_DLLPUBLIC EditCellController : public CellController
{
IEditImplementation* m_pEditImplementation;
- BOOL m_bOwnImplementation; // did we create m_pEditImplementation?
+ sal_Bool m_bOwnImplementation; // did we create m_pEditImplementation?
public:
TYPEINFO();
@@ -300,7 +300,7 @@ namespace svt
virtual void GetFocus();
virtual long PreNotify(NotifyEvent& rEvt);
virtual void Paint(const Rectangle& rClientRect);
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& _rEvent );
virtual void Resize();
@@ -485,7 +485,7 @@ namespace svt
CellControllerRef aController,
aOldController;
- ULONG nStartEvent, nEndEvent, nCellModifiedEvent; // event ids
+ sal_uLong nStartEvent, nEndEvent, nCellModifiedEvent; // event ids
Window* m_pFocusWhileRequest;
// In ActivateCell, we grab the focus asynchronously, but if between requesting activation
// and the asynchornous event the focus has changed, we won't grab it for ourself.
@@ -662,7 +662,7 @@ namespace svt
virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, USHORT _nColumnPos,const TriState& eState,sal_Bool _bEnabled=sal_True);
+ ::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState,sal_Bool _bEnabled=sal_True);
protected:
// creates the accessible which wraps the active cell
void implCreateActiveAccessible( );
diff --git a/svtools/inc/svtools/editimplementation.hxx b/svtools/inc/svtools/editimplementation.hxx
index b2515bb6d067..e93ec6721e68 100644
--- a/svtools/inc/svtools/editimplementation.hxx
+++ b/svtools/inc/svtools/editimplementation.hxx
@@ -75,14 +75,14 @@ void GenericEditImplementation< EDIT >::SetSelection( const Selection& _rSelecti
//----------------------------------------------------------------------
template <class EDIT>
-void GenericEditImplementation< EDIT >::SetReadOnly( BOOL bReadOnly )
+void GenericEditImplementation< EDIT >::SetReadOnly( sal_Bool bReadOnly )
{
m_rEdit.SetReadOnly( bReadOnly );
}
//----------------------------------------------------------------------
template <class EDIT>
-BOOL GenericEditImplementation< EDIT >::IsReadOnly() const
+sal_Bool GenericEditImplementation< EDIT >::IsReadOnly() const
{
return m_rEdit.IsReadOnly();
}
diff --git a/svtools/inc/svtools/editsyntaxhighlighter.hxx b/svtools/inc/svtools/editsyntaxhighlighter.hxx
index 265e0bc4110c..caba30f37e1f 100644
--- a/svtools/inc/svtools/editsyntaxhighlighter.hxx
+++ b/svtools/inc/svtools/editsyntaxhighlighter.hxx
@@ -42,7 +42,7 @@ class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public MultiLineEdit
svtools::ColorConfig m_aColorConfig;
private:
- virtual void DoBracketHilight(USHORT aKey);
+ virtual void DoBracketHilight(sal_uInt16 aKey);
protected:
virtual long PreNotify( NotifyEvent& rNEvt );
diff --git a/svtools/inc/svtools/ehdl.hxx b/svtools/inc/svtools/ehdl.hxx
index 835854b2f030..3a572aa29d8f 100644
--- a/svtools/inc/svtools/ehdl.hxx
+++ b/svtools/inc/svtools/ehdl.hxx
@@ -42,16 +42,16 @@ class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
{
public:
SfxErrorContext(
- USHORT nCtxIdP, Window *pWin=0,
- USHORT nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ sal_uInt16 nCtxIdP, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
SfxErrorContext(
- USHORT nCtxIdP, const String &aArg1, Window *pWin=0,
- USHORT nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
- virtual BOOL GetString(ULONG nErrId, String &rStr);
+ sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
+ sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
+ virtual sal_Bool GetString(sal_uLong nErrId, String &rStr);
private:
- USHORT nCtxId;
- USHORT nResId;
+ sal_uInt16 nCtxId;
+ sal_uInt16 nResId;
ResMgr *pMgr;
String aArg1;
};
@@ -59,24 +59,24 @@ private:
class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
{
public:
- SfxErrorHandler(USHORT nId, ULONG lStart, ULONG lEnd, ResMgr *pMgr=0);
+ SfxErrorHandler(sal_uInt16 nId, sal_uLong lStart, sal_uLong lEnd, ResMgr *pMgr=0);
~SfxErrorHandler();
protected:
- virtual BOOL GetErrorString(ULONG lErrId, String &, USHORT&) const;
- virtual BOOL GetMessageString(ULONG lErrId, String &, USHORT&) const;
+ virtual sal_Bool GetErrorString(sal_uLong lErrId, String &, sal_uInt16&) const;
+ virtual sal_Bool GetMessageString(sal_uLong lErrId, String &, sal_uInt16&) const;
private:
- ULONG lStart;
- ULONG lEnd;
- USHORT nId;
+ sal_uLong lStart;
+ sal_uLong lEnd;
+ sal_uInt16 nId;
ResMgr *pMgr;
ResMgr *pFreeMgr;
- SVT_DLLPRIVATE BOOL GetClassString(ULONG lErrId, String &) const;
- virtual BOOL CreateString(
- const ErrorInfo *, String &, USHORT &) const;
+ SVT_DLLPRIVATE sal_Bool GetClassString(sal_uLong lErrId, String &) const;
+ virtual sal_Bool CreateString(
+ const ErrorInfo *, String &, sal_uInt16 &) const;
};
#endif
diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index bbc839d12c8a..abae6318de69 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -35,7 +35,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <vcl/graph.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <rtl/ustring.hxx>
#define NS_UNO ::com::sun::star::uno
@@ -58,8 +58,8 @@ namespace svt
EmbeddedObjectRef_Impl* mpImp;
NS_UNO::Reference < NS_EMBED::XEmbeddedObject > mxObj;
- SVT_DLLPRIVATE SvStream* GetGraphicStream( BOOL bUpdate ) const;
- /* SVT_DLLPRIVATE */ void GetReplacement( BOOL bUpdate );
+ SVT_DLLPRIVATE SvStream* GetGraphicStream( sal_Bool bUpdate ) const;
+ /* SVT_DLLPRIVATE */ void GetReplacement( sal_Bool bUpdate );
SVT_DLLPRIVATE void Construct_Impl();
EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
@@ -70,7 +70,7 @@ namespace svt
static void DrawPaintReplacement( const Rectangle &rRect, const String &rText, OutputDevice *pOut );
static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
- static BOOL TryRunningState( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& );
+ static sal_Bool TryRunningState( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& );
static void SetGraphicToContainer( const Graphic& rGraphic,
comphelper::EmbeddedObjectContainer& aContainer,
const ::rtl::OUString& aName,
@@ -95,7 +95,7 @@ namespace svt
~EmbeddedObjectRef();
EmbeddedObjectRef( const EmbeddedObjectRef& );
- BOOL TryRunningState();
+ sal_Bool TryRunningState();
// assigning to a container enables the object to exchange graphical representations with a storage
void AssignToContainer( comphelper::EmbeddedObjectContainer* pContainer, const ::rtl::OUString& rPersistName );
@@ -115,15 +115,15 @@ namespace svt
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInGrStream,
const ::rtl::OUString& rMediaType );
- void UpdateReplacement() { GetReplacement( TRUE ); }
+ void UpdateReplacement() { GetReplacement( sal_True ); }
void UpdateReplacementOnDemand();
MapUnit GetMapUnit() const;
- void Lock( BOOL bLock = TRUE );
- BOOL IsLocked() const;
+ void Lock( sal_Bool bLock = sal_True );
+ sal_Bool IsLocked() const;
void Clear();
- BOOL is() const { return mxObj.is(); }
+ sal_Bool is() const { return mxObj.is(); }
- BOOL IsChart() const;
+ sal_Bool IsChart() const;
// #i104867#
// Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
diff --git a/svtools/inc/expander.hxx b/svtools/inc/svtools/expander.hxx
index 55b339ba9dfc..da998d50d332 100644
--- a/svtools/inc/expander.hxx
+++ b/svtools/inc/svtools/expander.hxx
@@ -53,9 +53,9 @@ private:
Image aActiveImage;
Rectangle maFocusRect;
ImageList maExpanderImages;
- BOOL mbIsExpanded;
- BOOL mbHasFocusRect;
- BOOL mbIsInMouseDown;
+ sal_Bool mbIsExpanded;
+ sal_Bool mbHasFocusRect;
+ sal_Bool mbIsInMouseDown;
Link maToggleHdl;
SvExpanderStateType eType;
@@ -76,9 +76,9 @@ public:
SvExpander( Window* pParent, WinBits nStyle = 0 );
SvExpander( Window* pParent, const ResId& rResId );
- BOOL IsExpanded() {return mbIsExpanded;}
+ sal_Bool IsExpanded() {return mbIsExpanded;}
- void SetToExpanded(BOOL bFlag=TRUE);
+ void SetToExpanded(sal_Bool bFlag=sal_True);
void SetExpanderImage( SvExpanderStateType eType);
Image GetExpanderImage(SvExpanderStateType eType);
diff --git a/svtools/inc/extcolorcfg.hxx b/svtools/inc/svtools/extcolorcfg.hxx
index 11d551cd88e6..11d551cd88e6 100644
--- a/svtools/inc/extcolorcfg.hxx
+++ b/svtools/inc/svtools/extcolorcfg.hxx
diff --git a/svtools/inc/filectrl.hxx b/svtools/inc/svtools/filectrl.hxx
index 87d05eb20bb2..40eace698501 100644
--- a/svtools/inc/filectrl.hxx
+++ b/svtools/inc/svtools/filectrl.hxx
@@ -38,14 +38,14 @@
#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
// Flags for FileControl
-typedef USHORT FileControlMode;
-#define FILECTRL_RESIZEBUTTONBYPATHLEN ((USHORT)0x0001)//if this is set, the button will become small as soon as the Text in the Edit Field is to long to be shown completely
+typedef sal_uInt16 FileControlMode;
+#define FILECTRL_RESIZEBUTTONBYPATHLEN ((sal_uInt16)0x0001)//if this is set, the button will become small as soon as the Text in the Edit Field is to long to be shown completely
// Flags for internal use of FileControl
-typedef USHORT FileControlMode_Internal;
-#define FILECTRL_INRESIZE ((USHORT)0x0001)
-#define FILECTRL_ORIGINALBUTTONTEXT ((USHORT)0x0002)
+typedef sal_uInt16 FileControlMode_Internal;
+#define FILECTRL_INRESIZE ((sal_uInt16)0x0001)
+#define FILECTRL_ORIGINALBUTTONTEXT ((sal_uInt16)0x0002)
class SVT_DLLPUBLIC FileControl : public Window
@@ -55,7 +55,7 @@ private:
PushButton maButton;
String maButtonText;
- BOOL mbOpenDlg;
+ sal_Bool mbOpenDlg;
Link maDialogCreatedHdl;
@@ -79,10 +79,10 @@ public:
Edit& GetEdit() { return maEdit; }
PushButton& GetButton() { return maButton; }
- void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
- void SetOpenDialog( BOOL bOpen ) { mbOpenDlg = bOpen; }
- BOOL IsOpenDialog() const { return mbOpenDlg; }
+ void SetOpenDialog( sal_Bool bOpen ) { mbOpenDlg = bOpen; }
+ sal_Bool IsOpenDialog() const { return mbOpenDlg; }
void SetText( const XubString& rStr );
XubString GetText() const;
@@ -91,8 +91,8 @@ public:
void SetSelection( const Selection& rSelection ) { maEdit.SetSelection( rSelection ); }
Selection GetSelection() const { return maEdit.GetSelection(); }
- void SetReadOnly( BOOL bReadOnly = TRUE ) { maEdit.SetReadOnly( bReadOnly ); }
- BOOL IsReadOnly() const { return maEdit.IsReadOnly(); }
+ void SetReadOnly( sal_Bool bReadOnly = sal_True ) { maEdit.SetReadOnly( bReadOnly ); }
+ sal_Bool IsReadOnly() const { return maEdit.IsReadOnly(); }
//------
//manipulate the Button-Text:
diff --git a/svtools/inc/filedlg.hxx b/svtools/inc/svtools/filedlg.hxx
index 7f9452573fe1..1e31ddc7a6a6 100644
--- a/svtools/inc/filedlg.hxx
+++ b/svtools/inc/svtools/filedlg.hxx
@@ -52,7 +52,7 @@ protected:
UniString aDfltExt; // Default - Extension
public:
- PathDialog( Window* pParent, WinBits nWinStyle = 0, BOOL bCreateDir = TRUE );
+ PathDialog( Window* pParent, WinBits nWinStyle = 0, sal_Bool bCreateDir = sal_True );
~PathDialog();
virtual long OK();
@@ -91,9 +91,9 @@ public:
void RemoveAllFilter();
void SetCurFilter( const UniString& rFilter );
UniString GetCurFilter() const;
- USHORT GetFilterCount() const;
- UniString GetFilterName( USHORT nPos ) const;
- UniString GetFilterType( USHORT nPos ) const;
+ sal_uInt16 GetFilterCount() const;
+ UniString GetFilterName( sal_uInt16 nPos ) const;
+ UniString GetFilterType( sal_uInt16 nPos ) const;
void SetFileSelectHdl( const Link& rLink ) { aFileHdlLink = rLink; }
const Link& GetFileSelectHdl() const { return aFileHdlLink; }
diff --git a/svtools/inc/filedlg2.hrc b/svtools/inc/svtools/filedlg2.hrc
index a87bd6ebcad0..a87bd6ebcad0 100644
--- a/svtools/inc/filedlg2.hrc
+++ b/svtools/inc/svtools/filedlg2.hrc
diff --git a/svtools/inc/fileview.hxx b/svtools/inc/svtools/fileview.hxx
index 31137017389e..3c78e1d48706 100644
--- a/svtools/inc/fileview.hxx
+++ b/svtools/inc/svtools/fileview.hxx
@@ -103,8 +103,8 @@ public:
sal_Bool GetParentURL( String& _rParentURL ) const;
sal_Bool CreateNewFolder( const String& rNewFolder );
- void SetHelpId( sal_uInt32 nHelpId );
- sal_uInt32 GetHelpId( ) const;
+ void SetHelpId( const rtl::OString& rHelpId );
+ const rtl::OString& GetHelpId( ) const;
void SetSizePixel( const Size& rNewSize );
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
@@ -188,7 +188,7 @@ public:
void SetDoubleClickHdl( const Link& rHdl );
void SetOpenDoneHdl( const Link& rHdl );
- ULONG GetSelectionCount() const;
+ sal_uLong GetSelectionCount() const;
SvLBoxEntry* FirstSelected() const;
SvLBoxEntry* NextSelected( SvLBoxEntry* pEntry ) const;
void EnableAutoResize();
@@ -198,7 +198,7 @@ public:
void EnableDelete( sal_Bool bEnable );
void EnableNameReplacing( sal_Bool bEnable = sal_True );
// translate folder names or display doc-title instead of file name
- // EnableContextMenu( TRUE )/EnableDelete(TRUE) disable name replacing!
+ // EnableContextMenu( sal_True )/EnableDelete(sal_True) disable name replacing!
// save and load column size and sort order
String GetConfigString() const;
diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx
index ceb966ac90ff..105783013bdc 100644
--- a/svtools/inc/svtools/filter.hxx
+++ b/svtools/inc/svtools/filter.hxx
@@ -45,7 +45,7 @@
struct ImplDirEntryHelper
{
- static BOOL Exists( const INetURLObject& rObj );
+ static sal_Bool Exists( const INetURLObject& rObj );
static void Kill( const String& rStr );
};
@@ -65,8 +65,8 @@ class Graphic;
#define GRFILTER_OUTHINT_GREY 1
-#define GRFILTER_FORMAT_NOTFOUND ((USHORT)0xFFFF)
-#define GRFILTER_FORMAT_DONTKNOW ((USHORT)0xFFFF)
+#define GRFILTER_FORMAT_NOTFOUND ((sal_uInt16)0xFFFF)
+#define GRFILTER_FORMAT_DONTKNOW ((sal_uInt16)0xFFFF)
#define GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG 00000001
#define GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG 00000002
@@ -108,42 +108,32 @@ class Graphic;
// unterstuetzten Grafik-Fileformate
// ------------------------------------
-#define GFF_NOT ( (USHORT)0x0000 )
-#define GFF_BMP ( (USHORT)0x0001 )
-#define GFF_GIF ( (USHORT)0x0002 )
-#define GFF_JPG ( (USHORT)0x0003 )
-#define GFF_PCD ( (USHORT)0x0004 )
-#define GFF_PCX ( (USHORT)0x0005 )
-#define GFF_PNG ( (USHORT)0x0006 )
-#define GFF_TIF ( (USHORT)0x0007 )
-#define GFF_XBM ( (USHORT)0x0008 )
-#define GFF_XPM ( (USHORT)0x0009 )
-#define GFF_PBM ( (USHORT)0x000a )
-#define GFF_PGM ( (USHORT)0x000b )
-#define GFF_PPM ( (USHORT)0x000c )
-#define GFF_RAS ( (USHORT)0x000d )
-#define GFF_TGA ( (USHORT)0x000e )
-#define GFF_PSD ( (USHORT)0x000f )
-#define GFF_EPS ( (USHORT)0x0010 )
-#define GFF_DXF ( (USHORT)0x00f1 )
-#define GFF_MET ( (USHORT)0x00f2 )
-#define GFF_PCT ( (USHORT)0x00f3 )
-#define GFF_SGF ( (USHORT)0x00f4 )
-#define GFF_SVM ( (USHORT)0x00f5 )
-#define GFF_WMF ( (USHORT)0x00f6 )
-#define GFF_SGV ( (USHORT)0x00f7 )
-#define GFF_EMF ( (USHORT)0x00f8 )
-#define GFF_XXX ( (USHORT)0xffff )
-
-// ---------------
-// - RequestInfo -
-// ---------------
-
-struct RequestInfo
-{
- BYTE* pBuffer;
- ULONG nRealBufferSize;
-};
+#define GFF_NOT ( (sal_uInt16)0x0000 )
+#define GFF_BMP ( (sal_uInt16)0x0001 )
+#define GFF_GIF ( (sal_uInt16)0x0002 )
+#define GFF_JPG ( (sal_uInt16)0x0003 )
+#define GFF_PCD ( (sal_uInt16)0x0004 )
+#define GFF_PCX ( (sal_uInt16)0x0005 )
+#define GFF_PNG ( (sal_uInt16)0x0006 )
+#define GFF_TIF ( (sal_uInt16)0x0007 )
+#define GFF_XBM ( (sal_uInt16)0x0008 )
+#define GFF_XPM ( (sal_uInt16)0x0009 )
+#define GFF_PBM ( (sal_uInt16)0x000a )
+#define GFF_PGM ( (sal_uInt16)0x000b )
+#define GFF_PPM ( (sal_uInt16)0x000c )
+#define GFF_RAS ( (sal_uInt16)0x000d )
+#define GFF_TGA ( (sal_uInt16)0x000e )
+#define GFF_PSD ( (sal_uInt16)0x000f )
+#define GFF_EPS ( (sal_uInt16)0x0010 )
+#define GFF_DXF ( (sal_uInt16)0x00f1 )
+#define GFF_MET ( (sal_uInt16)0x00f2 )
+#define GFF_PCT ( (sal_uInt16)0x00f3 )
+#define GFF_SGF ( (sal_uInt16)0x00f4 )
+#define GFF_SVM ( (sal_uInt16)0x00f5 )
+#define GFF_WMF ( (sal_uInt16)0x00f6 )
+#define GFF_SGV ( (sal_uInt16)0x00f7 )
+#define GFF_EMF ( (sal_uInt16)0x00f8 )
+#define GFF_XXX ( (sal_uInt16)0xffff )
// ---------------------
// - GraphicDescriptor -
@@ -152,71 +142,47 @@ struct RequestInfo
class SVT_DLLPUBLIC GraphicDescriptor
{
SvStream* pFileStm;
- Link aReqLink;
+
String aPathExt;
Size aPixSize;
Size aLogSize;
- SvStream* pMemStm;
- SvStream* pBaseStm;
- ULONG nStmPos;
- USHORT nBitsPerPixel;
- USHORT nPlanes;
- USHORT nFormat;
- BOOL bCompressed;
- BOOL bDataReady;
- BOOL bLinked;
- BOOL bLinkChanged;
- BOOL bWideSearch;
- BOOL bBaseStm;
- long nExtra1;
- long nExtra2;
+ sal_uInt16 nBitsPerPixel;
+ sal_uInt16 nPlanes;
+ sal_uInt16 nFormat;
+ sal_Bool bCompressed;
+ sal_Bool bOwnStream;
void ImpConstruct();
- BOOL ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPCD( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectXBM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectXPM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPBM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPGM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPPM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectRAS( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectTGA( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectEPS( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectDXF( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectMET( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectPCT( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectSGF( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectWMF( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo );
- BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo );
-
+ sal_Bool ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCD( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectXBM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectXPM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPBM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPGM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPPM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectRAS( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectTGA( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectEPS( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectDXF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectMET( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectPCT( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSGF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectWMF( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectSGV( SvStream& rStm, sal_Bool bExtendedInfo );
+ sal_Bool ImpDetectEMF( SvStream& rStm, sal_Bool bExtendedInfo );
GraphicDescriptor( const GraphicDescriptor& );
GraphicDescriptor& operator=( const GraphicDescriptor& );
-protected:
-
- BOOL IsDataReady() const;
- BOOL IsWideSearch() const;
- SvStream& GetSearchStream() const;
- const String& GetPathExtension() const;
-
public:
- // Default-Ctor, um anschliessend einen Link zu setzen, mit dem
- // die Daten vom Aufrufer im ::Detect() angefordert werden.
- // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen,
- // ist es sinnvoll den vollen Filenamen (inkl. Ext. ) mitanzugeben,
- // da so das Format ueber die Extension ermittelt werden kann
- GraphicDescriptor( const String* pPath = NULL );
-
// Ctor, um einen Filenamen zu setzen. Es muss ::Detect() gerufen werden,
// um das File zu identifizieren;
// wenn das File keinen eindeutigen Header besitzt ( Mtf's ) wird das
@@ -234,14 +200,14 @@ public:
virtual ~GraphicDescriptor();
// Startet die Detektion;
- // bei bExtendedInfo == TRUE werden soweit wie moeglich
+ // bei bExtendedInfo == sal_True werden soweit wie moeglich
// Daten aus dem jeweiligen FileHeader ermittelt
// ( Groesse, Farbtiefe usw. )
- virtual BOOL Detect( BOOL bExtendedInfo = FALSE );
+ virtual sal_Bool Detect( sal_Bool bExtendedInfo = sal_False );
// liefert das Fileformat nach erfolgreicher Detektion zurueck;
// wenn kein Format erkannt wurde, ist das Formart GFF_NOT
- USHORT GetFileFormat() const { return nFormat; }
+ sal_uInt16 GetFileFormat() const { return nFormat; }
// liefert die Pixel-Bildgroesse oder 0-Size zurueck
const Size& GetSizePixel() const { return (Size&) aPixSize; }
@@ -250,28 +216,13 @@ public:
const Size& GetSize_100TH_MM() const { return (Size&) aLogSize; }
// liefert die Bits/Pixel oder 0 zurueck
- USHORT GetBitsPerPixel() const { return nBitsPerPixel; }
+ sal_uInt16 GetBitsPerPixel() const { return nBitsPerPixel; }
// liefert die Anzahl der Planes oder 0 zurueck
- USHORT GetPlanes() const { return nPlanes; }
+ sal_uInt16 GetPlanes() const { return nPlanes; }
// zeigt an, ob das Bild evtl. komprimiert (wie auch immer) ist
- BOOL IsCompressed() const { return bCompressed; }
-
- // setzt den LinkHdl zum Setzen der Bytes;
- // der Handler muss einen Pointer auf die RequestInfo-Struktur
- // zurueckgeben; die Anzahl der minimal zur Verfuegung zu stellenden
- // Daten muss im Handler ueber ::GetRequestedByteCount() erfragt werden;
- // die tatsaechlich zur Verfuegung gestellte BYTE-Anzahl
- // wird in der RequestInfo-Struktur gesetzt
- void SetRequestHdl( const Link& rRequestHdl );
-
- // gibt den LinkHdl zum Setzen der Bytes zurueck
- const Link& GetRequestHdl() const { return aReqLink; }
-
- // muss im ReqHdl gerufen werden, um zu erfahren, wieviele
- // Bytes _mindestens_ bereitgestellt werden muessen
- ULONG GetRequestedByteCount() const;
+ sal_Bool IsCompressed() const { return bCompressed; }
// gibt die Filternummer des Filters zurueck,
// der im GraphicFilter zum Lesen dieses Formats
@@ -285,8 +236,8 @@ public:
struct FilterErrorEx
{
- ULONG nFilterError;
- ULONG nStreamError;
+ sal_uLong nFilterError;
+ sal_uLong nStreamError;
long nDummy1;
long nDummy2;
long nDummy3;
@@ -306,7 +257,7 @@ class SVT_DLLPUBLIC GraphicFilter
private:
void ImplInit();
- ULONG ImplSetError( ULONG nError, const SvStream* pStm = NULL );
+ sal_uLong ImplSetError( sal_uLong nError, const SvStream* pStm = NULL );
sal_uInt16 ImpTestOrFindFormat( const String& rPath, SvStream& rStream, sal_uInt16& rFormat );
DECL_LINK( FilterCallback, ConvertData* pData );
@@ -334,73 +285,73 @@ public:
void SetFilterPath( const String& rFilterPath ) { aFilterPath = rFilterPath; };
- USHORT GetImportFormatCount();
- USHORT GetImportFormatNumber( const String& rFormatName );
- USHORT GetImportFormatNumberForMediaType( const String& rMediaType );
- USHORT GetImportFormatNumberForShortName( const String& rShortName );
+ sal_uInt16 GetImportFormatCount();
+ sal_uInt16 GetImportFormatNumber( const String& rFormatName );
+ sal_uInt16 GetImportFormatNumberForMediaType( const String& rMediaType );
+ sal_uInt16 GetImportFormatNumberForShortName( const String& rShortName );
sal_uInt16 GetImportFormatNumberForTypeName( const String& rType );
- String GetImportFormatName( USHORT nFormat );
- String GetImportFormatTypeName( USHORT nFormat );
- String GetImportFormatMediaType( USHORT nFormat );
- String GetImportFormatShortName( USHORT nFormat );
- String GetImportOSFileType( USHORT nFormat );
- String GetImportWildcard( USHORT nFormat, sal_Int32 nEntry = 0 );
- BOOL IsImportPixelFormat( USHORT nFormat );
-
- USHORT GetExportFormatCount();
- USHORT GetExportFormatNumber( const String& rFormatName );
- USHORT GetExportFormatNumberForMediaType( const String& rShortName );
- USHORT GetExportFormatNumberForShortName( const String& rShortName );
+ String GetImportFormatName( sal_uInt16 nFormat );
+ String GetImportFormatTypeName( sal_uInt16 nFormat );
+ String GetImportFormatMediaType( sal_uInt16 nFormat );
+ String GetImportFormatShortName( sal_uInt16 nFormat );
+ String GetImportOSFileType( sal_uInt16 nFormat );
+ String GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
+ sal_Bool IsImportPixelFormat( sal_uInt16 nFormat );
+
+ sal_uInt16 GetExportFormatCount();
+ sal_uInt16 GetExportFormatNumber( const String& rFormatName );
+ sal_uInt16 GetExportFormatNumberForMediaType( const String& rShortName );
+ sal_uInt16 GetExportFormatNumberForShortName( const String& rShortName );
sal_uInt16 GetExportFormatNumberForTypeName( const String& rType );
- String GetExportFormatName( USHORT nFormat );
- String GetExportFormatTypeName( USHORT nFormat );
- String GetExportFormatMediaType( USHORT nFormat );
- String GetExportFormatShortName( USHORT nFormat );
- String GetExportOSFileType( USHORT nFormat );
- String GetExportWildcard( USHORT nFormat, sal_Int32 nEntry = 0 );
- BOOL IsExportPixelFormat( USHORT nFormat );
-
- BOOL HasImportDialog( USHORT nFormat );
- BOOL DoImportDialog( Window* pWindow, USHORT nFormat );
-
- BOOL HasExportDialog( USHORT nFormat );
- BOOL DoExportDialog( Window* pWindow, USHORT nFormat );
- BOOL DoExportDialog( Window* pWindow, USHORT nFormat, FieldUnit eFieldUnit );
-
- USHORT ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ String GetExportFormatName( sal_uInt16 nFormat );
+ String GetExportFormatTypeName( sal_uInt16 nFormat );
+ String GetExportFormatMediaType( sal_uInt16 nFormat );
+ String GetExportFormatShortName( sal_uInt16 nFormat );
+ String GetExportOSFileType( sal_uInt16 nFormat );
+ String GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 );
+ sal_Bool IsExportPixelFormat( sal_uInt16 nFormat );
+
+ sal_Bool HasImportDialog( sal_uInt16 nFormat );
+ sal_Bool DoImportDialog( Window* pWindow, sal_uInt16 nFormat );
+
+ sal_Bool HasExportDialog( sal_uInt16 nFormat );
+ sal_Bool DoExportDialog( Window* pWindow, sal_uInt16 nFormat );
+ sal_Bool DoExportDialog( Window* pWindow, sal_uInt16 nFormat, FieldUnit eFieldUnit );
+
+ sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
- USHORT ExportGraphic( const Graphic& rGraphic, const String& rPath,
- SvStream& rOStm, USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 ExportGraphic( const Graphic& rGraphic, const String& rPath,
+ SvStream& rOStm, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );
long GetExportGraphicHint() const { return nExpGraphHint; }
- USHORT CanImportGraphic( const INetURLObject& rPath,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
- USHORT * pDeterminedFormat = NULL);
+ sal_uInt16 CanImportGraphic( const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL);
- USHORT ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
- USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
- USHORT CanImportGraphic( const String& rPath, SvStream& rStream,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
- USHORT * pDeterminedFormat = NULL);
+ sal_uInt16 CanImportGraphic( const String& rPath, SvStream& rStream,
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL);
- USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const String& rPath,
SvStream& rStream,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
- USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW,
+ sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
- USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
+ sal_uInt16 ImportGraphic( Graphic& rGraphic, const String& rPath,
SvStream& rStream,
- USHORT nFormat,
- USHORT * pDeterminedFormat, sal_uInt32 nImportFlags,
+ sal_uInt16 nFormat,
+ sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags,
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData );
- BOOL Setup( USHORT nFormat );
+ sal_Bool Setup( sal_uInt16 nFormat );
- void Abort() { bAbort = TRUE; }
+ void Abort() { bAbort = sal_True; }
const FilterErrorEx& GetLastError() const;
void ResetLastError();
@@ -410,16 +361,16 @@ public:
static int LoadGraphic( const String& rPath, const String& rFilter,
Graphic& rGraphic,
GraphicFilter* pFilter = NULL,
- USHORT* pDeterminedFormat = NULL );
+ sal_uInt16* pDeterminedFormat = NULL );
};
// ------------------------------------
// - Windows Metafile Lesen/Schreiben -
// ------------------------------------
-SVT_DLLPUBLIC BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
-SVT_DLLPUBLIC BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
-SVT_DLLPUBLIC BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
+SVT_DLLPUBLIC sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
+SVT_DLLPUBLIC sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
+SVT_DLLPUBLIC sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
#endif //_FILTER_HXX
diff --git a/svtools/inc/filterutils.hxx b/svtools/inc/svtools/filterutils.hxx
index ac14f9237958..ac14f9237958 100644
--- a/svtools/inc/filterutils.hxx
+++ b/svtools/inc/svtools/filterutils.hxx
diff --git a/svtools/inc/svtools/fltcall.hxx b/svtools/inc/svtools/fltcall.hxx
index aa973d629e79..a3bc298cc106 100644
--- a/svtools/inc/svtools/fltcall.hxx
+++ b/svtools/inc/svtools/fltcall.hxx
@@ -56,19 +56,19 @@ struct FltCallDialogParameter
eFieldUnit ( eFiUni ) {};
};
-typedef BOOL (*PFilterCall)(SvStream & rStream, Graphic & rGraphic,
+typedef sal_Bool (*PFilterCall)(SvStream & rStream, Graphic & rGraphic,
FilterConfigItem* pConfigItem, sal_Bool bPrefDialog);
// Von diesem Typ sind sowohl Export-Filter-Funktionen als auch Import-Filter-Funktionen.
// rFileName ist der komplette Pfadname der zu importierenden bzw. zu exportierenden Datei.
// pCallBack darf auch NULL sein. pCallerData wird der Callback-Funktion uebergeben.
// pOptionsConfig darf NULL sein. Anderenfalls ist die Gruppe des Config schon gesetzt
// und darf von dem Filter nicht geaendert werden!
- // Wenn bPrefDialog==TRUE gilt, wird ggf. ein Preferences-Dialog durchgefuehrt.
+ // Wenn bPrefDialog==sal_True gilt, wird ggf. ein Preferences-Dialog durchgefuehrt.
-typedef BOOL ( *PFilterDlgCall )( FltCallDialogParameter& );
+typedef sal_Bool ( *PFilterDlgCall )( FltCallDialogParameter& );
// Von diesem Typ sind sowohl Export-Filter-Funktionen als auch Import-Filter-Funktionen.
// Uebergeben wird ein Pointer auf ein Parent-Fenster und auf die Options-Config.
- // pOptions und pWindow duerfen NULL sein, in diesem Fall wird FALSE zurueckgeliefert.
+ // pOptions und pWindow duerfen NULL sein, in diesem Fall wird sal_False zurueckgeliefert.
// Anderenfalls ist die Gruppe der Config schon gesetzt
// und darf von dem Filter nicht geaendert werden!
diff --git a/svtools/inc/fltdefs.hxx b/svtools/inc/svtools/fltdefs.hxx
index 665945d6d3b2..fbdfb573edae 100644
--- a/svtools/inc/fltdefs.hxx
+++ b/svtools/inc/svtools/fltdefs.hxx
@@ -35,18 +35,18 @@
#define _FLTDEFS_HXX
-#if defined ( WIN ) || defined ( WNT )
+#if defined ( WNT )
#define RGBQUAD RGBQUADWIN
typedef struct RGBQUAD
{
- BYTE rgbBlue;
- BYTE rgbGreen;
- BYTE rgbRed;
- BYTE rgbReserved;
+ sal_uInt8 rgbBlue;
+ sal_uInt8 rgbGreen;
+ sal_uInt8 rgbRed;
+ sal_uInt8 rgbReserved;
- RGBQUAD( const BYTE cRed = 0, const BYTE cGreen = 0, const BYTE cBlue = 0 ) :
+ RGBQUAD( const sal_uInt8 cRed = 0, const sal_uInt8 cGreen = 0, const sal_uInt8 cBlue = 0 ) :
rgbBlue ( cBlue ),
rgbGreen ( cGreen ),
rgbRed ( cRed ),
@@ -54,43 +54,27 @@ typedef struct RGBQUAD
} RGBQUAD;
-#ifdef WIN
-typedef BYTE huge* PDIBBYTE;
-#define MEMCPY hmemcpy
-#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize))))
-#define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1))))
-#define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer))))
-#define MEMSET( pDst, cByte, nCount ) \
-{ \
- PDIBBYTE pTmp = (PDIBBYTE) pDst; \
- for ( ULONG i = 0; i < nCount; i++ )\
- *pTmp++ = cByte; \
-}
-
-#else
-
-typedef BYTE* PDIBBYTE;
+typedef sal_uInt8* PDIBBYTE;
#define MEMCPY memcpy
#define MEMSET memset
#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalAlloc(GMEM_FIXED,(nSize)))
#define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer))
#define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer))
-#endif
#else
-typedef BYTE* PDIBBYTE;
+typedef sal_uInt8* PDIBBYTE;
#define MEMCPY memcpy
#define MEMSET memset
-#define GLOBALALLOC(nSize) ((PDIBBYTE)new BYTE[(nSize)])
+#define GLOBALALLOC(nSize) ((PDIBBYTE)new sal_uInt8[(nSize)])
#define GLOBALFREE(pPointer) (delete[] (pPointer))
#endif
#if defined ( OS2 ) || defined ( UNX )
-void ReadBitmap( SvStream& rIStream, Bitmap& rBmp, USHORT nDefaultHeight = 0, ULONG nOffBits = 0 );
-void ReplaceInfoHeader( SvStream& rStm, BYTE* pBuffer );
+void ReadBitmap( SvStream& rIStream, Bitmap& rBmp, sal_uInt16 nDefaultHeight = 0, sal_uLong nOffBits = 0 );
+void ReplaceInfoHeader( SvStream& rStm, sal_uInt8* pBuffer );
#ifdef OS2
#define RGBQUAD RGBQUADOS2
@@ -104,12 +88,12 @@ void ReplaceInfoHeader( SvStream& rStm, BYTE* pBuffer );
typedef struct RGBQUAD
{
- BYTE rgbBlue;
- BYTE rgbGreen;
- BYTE rgbRed;
- BYTE rgbReserved;
+ sal_uInt8 rgbBlue;
+ sal_uInt8 rgbGreen;
+ sal_uInt8 rgbRed;
+ sal_uInt8 rgbReserved;
- RGBQUAD( const BYTE cRed = 0, const BYTE cGreen = 0, const BYTE cBlue = 0 ) :
+ RGBQUAD( const sal_uInt8 cRed = 0, const sal_uInt8 cGreen = 0, const sal_uInt8 cBlue = 0 ) :
rgbBlue ( cBlue ),
rgbGreen ( cGreen ),
rgbRed ( cRed ),
@@ -118,27 +102,27 @@ typedef struct RGBQUAD
typedef struct BITMAPFILEHEADER
{
- UINT16 bfType;
- UINT32 bfSize;
- UINT16 bfReserved1;
- UINT16 bfReserved2;
- UINT32 bfOffBits;
+ sal_uInt16 bfType;
+ sal_uInt32 bfSize;
+ sal_uInt16 bfReserved1;
+ sal_uInt16 bfReserved2;
+ sal_uInt32 bfOffBits;
} BITMAPFILEHEADER;
typedef BITMAPFILEHEADER* PBITMAPFILEHEADER;
typedef struct BITMAPINFOHEADER
{
- UINT32 biSize;
- UINT32 biWidth;
- UINT32 biHeight;
- UINT16 biPlanes;
- UINT16 biBitCount;
- UINT32 biCompression;
- UINT32 biSizeImage;
- UINT32 biXPelsPerMeter;
- UINT32 biYPelsPerMeter;
- UINT32 biClrUsed;
- UINT32 biClrImportant;
+ sal_uInt32 biSize;
+ sal_uInt32 biWidth;
+ sal_uInt32 biHeight;
+ sal_uInt16 biPlanes;
+ sal_uInt16 biBitCount;
+ sal_uInt32 biCompression;
+ sal_uInt32 biSizeImage;
+ sal_uInt32 biXPelsPerMeter;
+ sal_uInt32 biYPelsPerMeter;
+ sal_uInt32 biClrUsed;
+ sal_uInt32 biClrImportant;
} BITMAPINFOHEADER;
typedef BITMAPINFOHEADER* PBITMAPINFOHEADER;
diff --git a/svtools/inc/svtools/fmtfield.hxx b/svtools/inc/svtools/fmtfield.hxx
index 406c827a7636..c7192392811d 100644
--- a/svtools/inc/svtools/fmtfield.hxx
+++ b/svtools/inc/svtools/fmtfield.hxx
@@ -45,7 +45,7 @@
namespace validation { class NumberValidator; }
#endif
-typedef USHORT FORMAT_CHANGE_TYPE;
+typedef sal_uInt16 FORMAT_CHANGE_TYPE;
#define FCT_KEYONLY 0x00 // only a new key was set
#define FCT_FORMATTER 0x01 // a new formatter weas set, usually implies a change of the key, too
#define FCT_PRECISION 0x02 // a new precision was set
@@ -61,7 +61,7 @@ private:
class StaticFormatter
{
static SvNumberFormatter* s_cFormatter;
- static ULONG s_nReferences;
+ static sal_uLong s_nReferences;
public:
StaticFormatter();
~StaticFormatter();
@@ -78,19 +78,19 @@ protected:
double m_dMinValue;
double m_dMaxValue;
- BOOL m_bHasMin : 1;
- BOOL m_bHasMax : 1;
+ sal_Bool m_bHasMin : 1;
+ sal_Bool m_bHasMax : 1;
- BOOL m_bStrictFormat : 1;
+ sal_Bool m_bStrictFormat : 1;
- BOOL m_bValueDirty : 1;
- BOOL m_bEnableEmptyField : 1;
- BOOL m_bAutoColor : 1;
- BOOL m_bEnableNaN : 1;
+ sal_Bool m_bValueDirty : 1;
+ sal_Bool m_bEnableEmptyField : 1;
+ sal_Bool m_bAutoColor : 1;
+ sal_Bool m_bEnableNaN : 1;
double m_dCurrentValue;
double m_dDefaultValue;
- ULONG m_nFormatKey;
+ sal_uLong m_nFormatKey;
SvNumberFormatter* m_pFormatter;
StaticFormatter m_aStaticFormatter;
@@ -101,7 +101,7 @@ protected:
// es macht einen Unterschied, ob man bei eingestellter Textformatierung beim LostFocus den aktuellen String durch
// den Formatter jagt und das Ergebnis anzeigt oder erst aus dem String ein double macht, das formatiert und dann
// ausgibt
- BOOL m_bTreatAsNumber;
+ sal_Bool m_bTreatAsNumber;
// und mit den folgenden Members koennen wir das Ganze hier auch zur formatierten Text-Ausgabe benutzen ...
String m_sCurrentTextValue;
String m_sDefaultText;
@@ -113,18 +113,18 @@ protected:
bool m_bUseInputStringForFormatting;
public:
- FormattedField(Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, INT32 nFormatKey = 0);
- FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter = NULL, INT32 nFormatKey = 0);
+ FormattedField(Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
+ FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
virtual ~FormattedField();
// Min-/Max-Verwaltung
- BOOL HasMinValue() const { return m_bHasMin; }
- void ClearMinValue() { m_bHasMin = FALSE; }
+ sal_Bool HasMinValue() const { return m_bHasMin; }
+ void ClearMinValue() { m_bHasMin = sal_False; }
void SetMinValue(double dMin);
double GetMinValue() const { return m_dMinValue; }
- BOOL HasMaxValue() const { return m_bHasMax; }
- void ClearMaxValue() { m_bHasMax = FALSE; }
+ sal_Bool HasMaxValue() const { return m_bHasMax; }
+ void ClearMaxValue() { m_bHasMax = sal_False; }
void SetMaxValue(double dMax);
double GetMaxValue() const { return m_dMaxValue; }
@@ -138,30 +138,30 @@ public:
void SetTextValue(const XubString& rText);
// der String wird in ein double umgewandelt (durch den Formatter) und anschliessen in SetValue gesteckt
- BOOL IsEmptyFieldEnabled() const { return m_bEnableEmptyField; }
- void EnableEmptyField(BOOL bEnable);
+ sal_Bool IsEmptyFieldEnabled() const { return m_bEnableEmptyField; }
+ void EnableEmptyField(sal_Bool bEnable);
// wenn nicht enabled, wird beim Verlassen des Feldes der Text auf den letzten gueltigen zurueckgesetzt
- void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = TRUE; }
+ void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = sal_True; }
// wenn der aktuelle String ungueltig ist, liefert GetValue() diesen Default-Wert
double GetDefaultValue() const { return m_dDefaultValue; }
// Einstellungen fuer das Format
- ULONG GetFormatKey() const { return m_nFormatKey; }
- void SetFormatKey(ULONG nFormatKey);
+ sal_uLong GetFormatKey() const { return m_nFormatKey; }
+ void SetFormatKey(sal_uLong nFormatKey);
SvNumberFormatter* GetFormatter() const { return m_pFormatter; }
- void SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat = TRUE);
- // wenn bResetFormat FALSE ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
+ void SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat = sal_True);
+ // wenn bResetFormat sal_False ist, wird versucht, das alte eingestellte Format mit 'hinueberzuretten' (teuer, wenn es sich nicht
// um eines der Standard-Formate handelt, die in allen Formattern gleich sind)
- // wenn TRUE, wird als neuer FormatKey 0 gesetzt
+ // wenn sal_True, wird als neuer FormatKey 0 gesetzt
- BOOL GetThousandsSep() const;
- void SetThousandsSep(BOOL _bUseSeparator);
+ sal_Bool GetThousandsSep() const;
+ void SetThousandsSep(sal_Bool _bUseSeparator);
// the is no check if the current format is numeric, so be cautious when calling these functions
- USHORT GetDecimalDigits() const;
- void SetDecimalDigits(USHORT _nPrecision);
+ sal_uInt16 GetDecimalDigits() const;
+ void SetDecimalDigits(sal_uInt16 _nPrecision);
// the is no check if the current format is numeric, so be cautious when calling these functions
SvNumberFormatter* StandardFormatter() { return m_aStaticFormatter; }
@@ -170,11 +170,11 @@ public:
// also ist etwas Vorsicht angebracht ...
void GetFormat(XubString& rFormatString, LanguageType& eLang) const;
- BOOL SetFormat(const XubString& rFormatString, LanguageType eLang);
- // FALSE, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
+ sal_Bool SetFormat(const XubString& rFormatString, LanguageType eLang);
+ // sal_False, wenn der FormatString nicht gesetzt werden konnte (also wahrscheinlich ungueltig ist)
- BOOL IsStrictFormat() const { return m_bStrictFormat; }
- void SetStrictFormat(BOOL bEnable) { m_bStrictFormat = bEnable; }
+ sal_Bool IsStrictFormat() const { return m_bStrictFormat; }
+ void SetStrictFormat(sal_Bool bEnable) { m_bStrictFormat = bEnable; }
// Formatueberpruefung waehrend der Eingabe ?
// Spin-Handling
@@ -194,15 +194,15 @@ public:
void SetSpinLast(double dLast) { m_dSpinLast = dLast; }
double GetSpinLast() const { return m_dSpinLast; }
- BOOL TreatingAsNumber() const { return m_bTreatAsNumber; }
- void TreatAsNumber(BOOL bDoSo) { m_bTreatAsNumber = bDoSo; }
+ sal_Bool TreatingAsNumber() const { return m_bTreatAsNumber; }
+ void TreatAsNumber(sal_Bool bDoSo) { m_bTreatAsNumber = bDoSo; }
public:
virtual void SetText( const XubString& rStr );
virtual void SetText( const XubString& rStr, const Selection& rNewSelection );
void SetValidateText(const XubString& rText, const String* pErrorText = NULL);
- // die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf FALSE sitzt
+ // die folgenden Methoden sind interesant, wenn m_bTreatAsNumber auf sal_False sitzt
/** nehmen wir mal an, irgendjemand will das ganze schoene double-Handling gar nicht haben, sondern
einfach den Text formatiert ausgeben ...
(der Text wird einfach nur durch den Formatter gejagt und dann gesetzt)
@@ -223,12 +223,12 @@ public:
*/
void Commit();
- // enable automatic coloring. if set to TRUE, and the format the field is working with for any current value
+ // enable automatic coloring. if set to sal_True, and the format the field is working with for any current value
// says that it has to be painted in a special color (e.g. a format where negative numbers should be printed
// red), the text is painted with that color automatically.
// The color used is the same as returned by GetLastOutputColor()
- void SetAutoColor(BOOL _bAutomatic);
- BOOL GetAutoColor() const { return m_bAutoColor; }
+ void SetAutoColor(sal_Bool _bAutomatic);
+ sal_Bool GetAutoColor() const { return m_bAutoColor; }
/** enables handling of not-a-number value.
@@ -244,8 +244,8 @@ public:
control, and then tabs out of it, the text "foo" will persist, and GetValue will
return NaN in subsequent calls.
*/
- void EnableNotANumber( BOOL _bEnable );
- BOOL IsNotANumberEnabled( ) const { return m_bEnableNaN; }
+ void EnableNotANumber( sal_Bool _bEnable );
+ sal_Bool IsNotANumberEnabled( ) const { return m_bEnableNaN; }
/** When being set to true, the strings in the field are formatted using the
InputLine format. That's also what you get in Calc when you edit a cell
@@ -259,16 +259,16 @@ protected:
virtual void Modify();
// CheckText ueberschreiben fuer Ueberpruefung zur Eingabezeit
- virtual BOOL CheckText(const XubString&) const { return TRUE; }
+ virtual sal_Bool CheckText(const XubString&) const { return sal_True; }
// any aspect of the current format has changed
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
void ImplSetTextImpl(const XubString& rNew, Selection* pNewSel);
- void ImplSetValue(double dValue, BOOL bForce);
- BOOL ImplGetValue(double& dNewVal);
+ void ImplSetValue(double dValue, sal_Bool bForce);
+ sal_Bool ImplGetValue(double& dNewVal);
- void ImplSetFormatKey(ULONG nFormatKey);
+ void ImplSetFormatKey(sal_uLong nFormatKey);
// SetFormatKey without FormatChanged notification
virtual SvNumberFormatter* CreateFormatter() { SetFormatter(StandardFormatter()); return m_pFormatter; }
@@ -314,7 +314,7 @@ public:
virtual ~DoubleNumericField();
protected:
- virtual BOOL CheckText(const XubString& sText) const;
+ virtual sal_Bool CheckText(const XubString& sText) const;
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
void ResetConformanceTester();
@@ -328,8 +328,8 @@ protected:
class DoubleCurrencyField : public FormattedField
{
XubString m_sCurrencySymbol;
- BOOL m_bPrependCurrSym;
- BOOL m_bChangingFormat;
+ sal_Bool m_bPrependCurrSym;
+ sal_Bool m_bChangingFormat;
public:
DoubleCurrencyField(Window* pParent, WinBits nStyle = 0);
@@ -338,8 +338,8 @@ public:
XubString getCurrencySymbol() const { return m_sCurrencySymbol; }
void setCurrencySymbol(const XubString& _sSymbol);
- BOOL getPrependCurrSym() const { return m_bPrependCurrSym; }
- void setPrependCurrSym(BOOL _bPrepend);
+ sal_Bool getPrependCurrSym() const { return m_bPrependCurrSym; }
+ void setPrependCurrSym(sal_Bool _bPrepend);
protected:
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat);
diff --git a/svtools/inc/fontsubstconfig.hxx b/svtools/inc/svtools/fontsubstconfig.hxx
index f7bce249e2a3..f7bce249e2a3 100644
--- a/svtools/inc/fontsubstconfig.hxx
+++ b/svtools/inc/svtools/fontsubstconfig.hxx
diff --git a/svtools/inc/framestatuslistener.hxx b/svtools/inc/svtools/framestatuslistener.hxx
index 4a41d93d5334..4a41d93d5334 100644
--- a/svtools/inc/framestatuslistener.hxx
+++ b/svtools/inc/svtools/framestatuslistener.hxx
diff --git a/svtools/inc/svtools/generictoolboxcontroller.hxx b/svtools/inc/svtools/generictoolboxcontroller.hxx
index 2e1aaa1a0cf1..ffe229c58fa9 100644
--- a/svtools/inc/svtools/generictoolboxcontroller.hxx
+++ b/svtools/inc/svtools/generictoolboxcontroller.hxx
@@ -47,7 +47,7 @@ class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController
GenericToolboxController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
ToolBox* pToolBox,
- USHORT nID,
+ sal_uInt16 nID,
const rtl::OUString& aCommand );
virtual ~GenericToolboxController();
diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx
index 3eee508e5d70..d3fcc9800c88 100644
--- a/svtools/inc/svtools/grfmgr.hxx
+++ b/svtools/inc/svtools/grfmgr.hxx
@@ -105,14 +105,14 @@ private:
long mnTopCrop;
long mnRightCrop;
long mnBottomCrop;
- USHORT mnRotate10;
+ sal_uInt16 mnRotate10;
short mnContPercent;
short mnLumPercent;
short mnRPercent;
short mnGPercent;
short mnBPercent;
- BOOL mbInvert;
- BYTE mcTransparency;
+ sal_Bool mbInvert;
+ sal_uInt8 mcTransparency;
GraphicDrawMode meDrawMode;
void* mpDummy;
@@ -122,14 +122,14 @@ public:
GraphicAttr();
~GraphicAttr();
- BOOL operator==( const GraphicAttr& rAttr ) const;
- BOOL operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
+ sal_Bool operator==( const GraphicAttr& rAttr ) const;
+ sal_Bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
GraphicDrawMode GetDrawMode() const { return meDrawMode; }
- void SetMirrorFlags( ULONG nMirrFlags ) { mnMirrFlags = nMirrFlags; }
- ULONG GetMirrorFlags() const { return mnMirrFlags; }
+ void SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; }
+ sal_uLong GetMirrorFlags() const { return mnMirrFlags; }
void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
{
@@ -141,8 +141,8 @@ public:
long GetRightCrop() const { return mnRightCrop; }
long GetBottomCrop() const { return mnBottomCrop; }
- void SetRotation( USHORT nRotate10 ) { mnRotate10 = nRotate10; }
- USHORT GetRotation() const { return mnRotate10; }
+ void SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; }
+ sal_uInt16 GetRotation() const { return mnRotate10; }
void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
short GetLuminance() const { return mnLumPercent; }
@@ -162,22 +162,22 @@ public:
void SetGamma( double fGamma ) { mfGamma = fGamma; }
double GetGamma() const { return mfGamma; }
- void SetInvert( BOOL bInvert ) { mbInvert = bInvert; }
- BOOL IsInvert() const { return mbInvert; }
+ void SetInvert( sal_Bool bInvert ) { mbInvert = bInvert; }
+ sal_Bool IsInvert() const { return mbInvert; }
- void SetTransparency( BYTE cTransparency ) { mcTransparency = cTransparency; }
- BYTE GetTransparency() const { return mcTransparency; }
+ void SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; }
+ sal_uInt8 GetTransparency() const { return mcTransparency; }
- BOOL IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
- BOOL IsMirrored() const { return( mnMirrFlags != 0UL ); }
- BOOL IsCropped() const
+ sal_Bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); }
+ sal_Bool IsMirrored() const { return( mnMirrFlags != 0UL ); }
+ sal_Bool IsCropped() const
{
return( mnLeftCrop != 0 || mnTopCrop != 0 ||
mnRightCrop != 0 || mnBottomCrop != 0 );
}
- BOOL IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
- BOOL IsTransparent() const { return( mcTransparency > 0 ); }
- BOOL IsAdjusted() const
+ sal_Bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
+ sal_Bool IsTransparent() const { return( mcTransparency > 0 ); }
+ sal_Bool IsAdjusted() const
{
return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
@@ -203,7 +203,7 @@ private:
GraphicAttr maAttr;
Size maPrefSize;
MapMode maPrefMapMode;
- ULONG mnSizeBytes;
+ sal_uLong mnSizeBytes;
GraphicType meType;
GraphicManager* mpMgr;
String* mpLink;
@@ -211,17 +211,17 @@ private:
String* mpUserData;
Timer* mpSwapOutTimer;
GrfSimpleCacheObj* mpSimpleCache;
- ULONG mnAnimationLoopCount;
+ sal_uLong mnAnimationLoopCount;
void* mpDummy1;
void* mpDummy2;
- BOOL mbAutoSwapped : 1;
- BOOL mbTransparent : 1;
- BOOL mbAnimated : 1;
- BOOL mbEPS : 1;
- BOOL mbIsInSwapIn : 1;
- BOOL mbIsInSwapOut : 1;
- BOOL mbAlpha : 1;
- BOOL mbDummyFlag8 : 1;
+ sal_Bool mbAutoSwapped : 1;
+ sal_Bool mbTransparent : 1;
+ sal_Bool mbAnimated : 1;
+ sal_Bool mbEPS : 1;
+ sal_Bool mbIsInSwapIn : 1;
+ sal_Bool mbIsInSwapOut : 1;
+ sal_Bool mbAlpha : 1;
+ sal_Bool mbDummyFlag8 : 1;
void SVT_DLLPRIVATE ImplConstruct();
void SVT_DLLPRIVATE ImplAssignGraphicData();
@@ -229,9 +229,9 @@ private:
const ByteString* pID = NULL,
const GraphicObject* pCopyObj = NULL );
void SVT_DLLPRIVATE ImplAutoSwapIn();
- BOOL SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
- BOOL SVT_DLLPRIVATE ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
- PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const;
+ sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; }
+ sal_Bool SVT_DLLPRIVATE ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const;
/** Render a given number of tiles in an optimized way
@@ -277,22 +277,22 @@ private:
bool SVT_DLLPRIVATE ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
int nNumTilesX, int nNumTilesY,
const Size& rTileSizePixel,
- const GraphicAttr* pAttr, ULONG nFlags );
+ const GraphicAttr* pAttr, sal_uLong nFlags );
/// internally called by ImplRenderTempTile()
bool SVT_DLLPRIVATE ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent, int nMSBFactor,
int nNumOrigTilesX, int nNumOrigTilesY,
int nRemainderTilesX, int nRemainderTilesY,
const Size& rTileSizePixel, const GraphicAttr* pAttr,
- ULONG nFlags, ImplTileInfo& rTileInfo );
+ sal_uLong nFlags, ImplTileInfo& rTileInfo );
bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel,
- const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D );
+ const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D );
bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice& rOut, const Point& rPos,
int nNumTilesX, int nNumTilesY,
const Size& rTileSize,
- const GraphicAttr* pAttr, ULONG nFlags );
+ const GraphicAttr* pAttr, sal_uLong nFlags );
void SVT_DLLPRIVATE ImplTransformBitmap( BitmapEx& rBmpEx,
const GraphicAttr& rAttr,
@@ -300,7 +300,7 @@ private:
const Size& rCropRightBottom,
const Rectangle& rCropRect,
const Size& rDstSize,
- BOOL bEnlarge ) const;
+ sal_Bool bEnlarge ) const;
DECL_LINK( ImplAutoSwapOutHdl, void* );
@@ -310,7 +310,7 @@ protected:
virtual SvStream* GetSwapStream() const;
// !!! to be removed
- virtual ULONG GetReleaseFromCache() const;
+ virtual sal_uLong GetReleaseFromCache() const;
virtual void Load( SvStream& );
virtual void Save( SvStream& );
@@ -328,14 +328,14 @@ public:
~GraphicObject();
GraphicObject& operator=( const GraphicObject& rCacheObj );
- BOOL operator==( const GraphicObject& rCacheObj ) const;
- BOOL operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
+ sal_Bool operator==( const GraphicObject& rCacheObj ) const;
+ sal_Bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
- BOOL HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
+ sal_Bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); }
void SetSwapStreamHdl();
- void SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout = 0UL );
+ void SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout = 0UL );
Link GetSwapStreamHdl() const;
- ULONG GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
+ sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); }
void FireSwapInRequest();
void FireSwapOutRequest();
@@ -343,8 +343,8 @@ public:
void SetGraphicManager( const GraphicManager& rMgr );
GraphicManager& GetGraphicManager() const { return *mpMgr; }
- BOOL IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD) const;
+ sal_Bool IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD) const;
void ReleaseFromCache();
const Graphic& GetGraphic() const;
@@ -382,12 +382,12 @@ public:
void SetAttr( const GraphicAttr& rAttr );
const GraphicAttr& GetAttr() const { return maAttr; }
- BOOL HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); }
+ sal_Bool HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); }
void SetLink();
void SetLink( const String& rLink );
String GetLink() const;
- BOOL HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); }
+ sal_Bool HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); }
void SetUserData();
void SetUserData( const String& rUserData );
String GetUserData() const;
@@ -397,36 +397,36 @@ public:
GraphicType GetType() const { return meType; }
const Size& GetPrefSize() const { return maPrefSize; }
const MapMode& GetPrefMapMode() const { return maPrefMapMode; }
- ULONG GetSizeBytes() const { return mnSizeBytes; }
- ULONG GetChecksum() const;
- BOOL IsTransparent() const { return mbTransparent; }
- BOOL IsAlpha() const { return mbAlpha; }
- BOOL IsAnimated() const { return mbAnimated; }
- BOOL IsEPS() const { return mbEPS; }
+ sal_uLong GetSizeBytes() const { return mnSizeBytes; }
+ sal_uLong GetChecksum() const;
+ sal_Bool IsTransparent() const { return mbTransparent; }
+ sal_Bool IsAlpha() const { return mbAlpha; }
+ sal_Bool IsAnimated() const { return mbAnimated; }
+ sal_Bool IsEPS() const { return mbEPS; }
void ResetAnimationLoopCount();
List* GetAnimationInfoList() const;
Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); }
void SetAnimationNotifyHdl( const Link& rLink );
- BOOL SwapOut();
- BOOL SwapOut( SvStream* pOStm );
- BOOL SwapIn();
- BOOL SwapIn( SvStream* pIStm );
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+ sal_Bool SwapIn( SvStream* pIStm );
- BOOL IsInSwapIn() const { return mbIsInSwapIn; }
- BOOL IsInSwapOut() const { return mbIsInSwapOut; }
- BOOL IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); }
- BOOL IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
+ sal_Bool IsInSwapIn() const { return mbIsInSwapIn; }
+ sal_Bool IsInSwapOut() const { return mbIsInSwapOut; }
+ sal_Bool IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); }
+ sal_Bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); }
void SetSwapState();
- BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD );
+ sal_Bool Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD );
- BOOL DrawWithPDFHandling( OutputDevice& rOutDev,
+ sal_Bool DrawWithPDFHandling( OutputDevice& rOutDev,
const Point& rPt, const Size& rSz,
const GraphicAttr* pGrfAttr = NULL,
- const ULONG nFlags = GRFMGR_DRAW_STANDARD );
+ const sal_uLong nFlags = GRFMGR_DRAW_STANDARD );
/** Draw the graphic repeatedly into the given output rectangle
@@ -459,14 +459,14 @@ public:
is. This is useful if e.g. you want only a few, very large
bitmap drawings appear on the outdev.
- @return TRUE, if drawing completed successfully
+ @return sal_True, if drawing completed successfully
*/
- BOOL DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
+ sal_Bool DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
const Size& rOffset, const GraphicAttr* pAttr = NULL,
- ULONG nFlags = GRFMGR_DRAW_STANDARD, int nTileCacheSize1D=128 );
+ sal_uLong nFlags = GRFMGR_DRAW_STANDARD, int nTileCacheSize1D=128 );
- BOOL StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0L,
- const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD,
+ sal_Bool StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0L,
+ const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD,
OutputDevice* pFirstFrameOutDev = NULL );
void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
@@ -494,33 +494,33 @@ private:
GraphicManager( const GraphicManager& ) {}
GraphicManager& operator=( const GraphicManager& ) { return *this; }
- BOOL SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt,
+ sal_Bool SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt,
const Size& rSz, GraphicObject& rObj,
const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached );
+ const sal_uLong nFlags, sal_Bool& rCached );
- BOOL SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const BitmapEx& rBmpEx, const GraphicAttr& rAttr,
- const ULONG nFlags, BitmapEx* pBmpEx = NULL );
- BOOL SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut,
+ const sal_uLong nFlags, BitmapEx* pBmpEx = NULL );
+ sal_Bool SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut,
const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr,
- const ULONG nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx );
+ const sal_uLong nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx );
- BOOL SVT_DLLPRIVATE ImplCreateScaled( const BitmapEx& rBmpEx,
+ sal_Bool SVT_DLLPRIVATE ImplCreateScaled( const BitmapEx& rBmpEx,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx );
- BOOL SVT_DLLPRIVATE ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
- USHORT nRot10, const Size& rOutSzPix, const Size& rUntSzPix,
+ sal_Bool SVT_DLLPRIVATE ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
+ sal_uInt16 nRot10, const Size& rOutSzPix, const Size& rUntSzPix,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx );
- static void SVT_DLLPRIVATE ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
- static void SVT_DLLPRIVATE ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
- static void SVT_DLLPRIVATE ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags );
+ static void SVT_DLLPRIVATE ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags );
+ static void SVT_DLLPRIVATE ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags );
+ static void SVT_DLLPRIVATE ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags );
static void SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr );
@@ -530,42 +530,42 @@ private:
const ByteString* pID = NULL,
const GraphicObject* pCopyObj = NULL );
void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj );
- inline BOOL SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); }
+ inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); }
// Only used in swap case by GraphicObject
void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj );
- BOOL SVT_DLLPRIVATE ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ sal_Bool SVT_DLLPRIVATE ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj );
ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const;
public:
- GraphicManager( ULONG nCacheSize = 10000000UL, ULONG nMaxObjCacheSize = 2400000UL );
+ GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL );
~GraphicManager();
- void SetMaxCacheSize( ULONG nNewCacheSize );
- ULONG GetMaxCacheSize() const;
+ void SetMaxCacheSize( sal_uLong nNewCacheSize );
+ sal_uLong GetMaxCacheSize() const;
- void SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE );
- ULONG GetMaxObjCacheSize() const;
+ void SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False );
+ sal_uLong GetMaxObjCacheSize() const;
- ULONG GetUsedCacheSize() const;
- ULONG GetFreeCacheSize() const;
+ sal_uLong GetUsedCacheSize() const;
+ sal_uLong GetFreeCacheSize() const;
- void SetCacheTimeout( ULONG nTimeoutSeconds );
- ULONG GetCacheTimeout() const;
+ void SetCacheTimeout( sal_uLong nTimeoutSeconds );
+ sal_uLong GetCacheTimeout() const;
void ClearCache();
void ReleaseFromCache( const GraphicObject& rObj );
- BOOL IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
- BOOL DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
GraphicObject& rObj, const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached );
+ const sal_uLong nFlags, sal_Bool& rCached );
};
#endif // _GRFMGR_HXX
diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx
index eb3bd66e7a30..1cba24f2e212 100644
--- a/svtools/inc/svtools/headbar.hxx
+++ b/svtools/inc/svtools/headbar.hxx
@@ -106,7 +106,7 @@ StartDrag() Dieser Handler wird gerufen, wenn Draggen gestartet
wird, bzw. wenn ein Item angeklickt wurde.
In diesem Handler sollte spaetestens mit SetDragSize()
die Groesse der Size-Linie gesetzt werden, wenn
- IsItemMode() FALSE zurueckliefert.
+ IsItemMode() sal_False zurueckliefert.
Drag() Dieser Handler wird gerufen, wenn gedraggt wird. Wenn
mit SetDragSize() keine Groesse gesetzt wird, kann
dieser Handler dafuer benutzt werden, um die
@@ -117,12 +117,12 @@ Drag() Dieser Handler wird gerufen, wenn gedraggt wird. Wenn
EndDrag() Dieser Handler wird gerufen, wenn ein Drag-Vorgang
beendet wurde. Wenn im EndDrag-Handler GetCurItemId()
0 zurueckliefert, wurde der Drag-Vorgang abgebrochen.
- Wenn dies nicht der Fall ist und IsItemMode() FALSE
+ Wenn dies nicht der Fall ist und IsItemMode() sal_False
zurueckliefert, sollte von dem gedraggten Item
die neue Groesse mit GetItemSize() abgefragt werden
und entsprechend im dazugehoerigem Control uebernommen
- werden. Wenn IsItemMode() TRUE, GetCurItemId() eine Id
- und IsItemDrag() TRUE zurueckliefert, wurde dieses
+ werden. Wenn IsItemMode() sal_True, GetCurItemId() eine Id
+ und IsItemDrag() sal_True zurueckliefert, wurde dieses
Item verschoben. Es sollte dann mit GetItemPos() die
neue Position abgefragt werden und auch die Daten
im dazugehoerigem Control angepasst werden. Ansonsten
@@ -144,12 +144,12 @@ GetItemDragPos() Liefert die Position zurueck, an der ein Item verschoben
oder wenn kein ItemDrag aktiv ist.
IsItemMode() Mit dieser Methode kann abgefragt werden, ob fuer ein
Item oder einen Trenner der Handler gerufen wurde.
- TRUE - Handler wurde fuer das Item gerufen
- FALSE - Handler wurde fuer den Trenner gerufen
+ sal_True - Handler wurde fuer das Item gerufen
+ sal_False - Handler wurde fuer den Trenner gerufen
IsItemDrag() Mit dieser Methode kann abgefragt werden, ob ein
Item gedragt oder selektiert wurde.
- TRUE - Item wird verschoben
- FALSE - Item wird selektiert
+ sal_True - Item wird verschoben
+ sal_False - Item wird selektiert
SetDragSize() Mit dieser Methode wird gesetzt, wir gross der
Trennstrich sein soll, der vom Control gemalt wird.
Dies sollte so gross sein, wie das angrenzende Fenster
@@ -203,7 +203,7 @@ typedef ::std::vector< ImplHeadItem* > ImplHeadItemList;
// - HeaderBarItemBits -
// ---------------------
-typedef USHORT HeaderBarItemBits;
+typedef sal_uInt16 HeaderBarItemBits;
// ----------------------------
// - Bits fuer HeaderBarItems -
@@ -230,8 +230,8 @@ typedef USHORT HeaderBarItemBits;
// - HeaderBar-Types -
// -------------------
-#define HEADERBAR_APPEND ((USHORT)0xFFFF)
-#define HEADERBAR_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define HEADERBAR_APPEND ((sal_uInt16)0xFFFF)
+#define HEADERBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
#define HEADERBAR_FULLSIZE ((long)1000000000)
#define HEADERBAR_TEXTOFF 2
@@ -253,14 +253,14 @@ private:
long mnStartPos;
long mnDragPos;
long mnMouseOff;
- USHORT mnCurItemId;
- USHORT mnItemDragPos;
- BOOL mbDragable;
- BOOL mbDrag;
- BOOL mbItemDrag;
- BOOL mbOutDrag;
- BOOL mbButtonStyle;
- BOOL mbItemMode;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnItemDragPos;
+ sal_Bool mbDragable;
+ sal_Bool mbDrag;
+ sal_Bool mbItemDrag;
+ sal_Bool mbOutDrag;
+ sal_Bool mbButtonStyle;
+ sal_Bool mbItemMode;
Link maStartDragHdl;
Link maDragHdl;
Link maEndDragHdl;
@@ -275,25 +275,25 @@ private:
#ifdef _SV_HEADBAR_CXX
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
- SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SVT_DLLPRIVATE long ImplGetItemPos( USHORT nPos ) const;
- SVT_DLLPRIVATE Rectangle ImplGetItemRect( USHORT nPos ) const;
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE long ImplGetItemPos( sal_uInt16 nPos ) const;
+ SVT_DLLPRIVATE Rectangle ImplGetItemRect( sal_uInt16 nPos ) const;
using Window::ImplHitTest;
- SVT_DLLPRIVATE USHORT ImplHitTest( const Point& rPos, long& nMouseOff, USHORT& nPos ) const;
- SVT_DLLPRIVATE void ImplInvertDrag( USHORT nStartPos, USHORT nEndPos );
+ SVT_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rPos, long& nMouseOff, sal_uInt16& nPos ) const;
+ SVT_DLLPRIVATE void ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos );
SVT_DLLPRIVATE void ImplDrawItem( OutputDevice* pDev,
- USHORT nPos, BOOL bHigh, BOOL bDrag,
+ sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
const Rectangle& rItemRect,
const Rectangle* pRect,
- ULONG nFlags );
- SVT_DLLPRIVATE void ImplDrawItem( USHORT nPos, BOOL bHigh = FALSE,
- BOOL bDrag = FALSE,
+ sal_uLong nFlags );
+ SVT_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh = sal_False,
+ sal_Bool bDrag = sal_False,
const Rectangle* pRect = NULL );
- SVT_DLLPRIVATE void ImplUpdate( USHORT nPos,
- BOOL bEnd = FALSE, BOOL bDirect = FALSE );
- SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, BOOL bCommand );
+ SVT_DLLPRIVATE void ImplUpdate( sal_uInt16 nPos,
+ sal_Bool bEnd = sal_False, sal_Bool bDirect = sal_False );
+ SVT_DLLPRIVATE void ImplStartDrag( const Point& rPos, sal_Bool bCommand );
SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
- SVT_DLLPRIVATE void ImplEndDrag( BOOL bCancel );
+ SVT_DLLPRIVATE void ImplEndDrag( sal_Bool bCancel );
#endif
public:
@@ -305,7 +305,7 @@ public:
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void Tracking( const TrackingEvent& rTEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void Command( const CommandEvent& rCEvt );
virtual void RequestHelp( const HelpEvent& rHEvt );
@@ -319,18 +319,18 @@ public:
virtual void Select();
virtual void DoubleClick();
- void InsertItem( USHORT nItemId, const Image& rImage,
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND );
- void InsertItem( USHORT nItemId, const XubString& rText,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND );
- void InsertItem( USHORT nItemId,
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE,
- USHORT nPos = HEADERBAR_APPEND );
- void RemoveItem( USHORT nItemId );
- void MoveItem( USHORT nItemId, USHORT nNewPos );
+ sal_uInt16 nPos = HEADERBAR_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
+ void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos );
void Clear();
void SetOffset( long nNewOffset = 0 );
@@ -338,40 +338,40 @@ public:
inline void SetDragSize( long nNewSize = 0 ) { mnDragSize = nNewSize; }
long GetDragSize() const { return mnDragSize; }
- USHORT GetItemCount() const;
- USHORT GetItemPos( USHORT nItemId ) const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
- USHORT GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
long GetDragPos() const { return mnDragPos; }
- USHORT GetItemDragPos() const { return mnItemDragPos; }
- BOOL IsItemMode() const { return mbItemMode; }
- BOOL IsItemDrag() const { return mbItemDrag; }
-
- void SetItemSize( USHORT nItemId, long nNewSize );
- long GetItemSize( USHORT nItemId ) const;
- void SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits );
- HeaderBarItemBits 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 SetItemText( USHORT nItemId, const XubString& rText );
- XubString GetItemText( USHORT nItemId ) const;
-
- void SetHelpText( USHORT nItemId, const XubString& rText );
- XubString GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ sal_uInt16 GetItemDragPos() const { return mnItemDragPos; }
+ sal_Bool IsItemMode() const { return mbItemMode; }
+ sal_Bool IsItemDrag() const { return mbItemDrag; }
+
+ void SetItemSize( sal_uInt16 nItemId, long nNewSize );
+ long GetItemSize( sal_uInt16 nItemId ) const;
+ void SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits );
+ HeaderBarItemBits 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 SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
+
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ XubString GetHelpText( sal_uInt16 nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
Size CalcWindowSizePixel() const;
inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); }
inline const String& GetHelpText() const { return Window::GetHelpText(); }
- inline void SetHelpId( ULONG nId ) { Window::SetHelpId( nId ); }
- inline ULONG GetHelpId() const { return Window::GetHelpId(); }
+ inline void SetHelpId( const rtl::OString& rId ) { Window::SetHelpId( rId ); }
+ inline const rtl::OString& GetHelpId() const { return Window::GetHelpId(); }
inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
inline const Link& GetStartDragHdl() const { return maStartDragHdl; }
@@ -386,7 +386,7 @@ public:
inline void SetCreateAccessibleHdl( const Link& rLink ) { maCreateAccessibleHdl = rLink; }
inline const Link& GetCreateAccessibleHdl() const { return maCreateAccessibleHdl; }
- inline BOOL IsDragable() const { return mbDragable; }
+ inline sal_Bool IsDragable() const { return mbDragable; }
/** Creates and returns the accessible object of the header bar. */
virtual ::com::sun::star::uno::Reference<
diff --git a/svtools/inc/helpagentwindow.hxx b/svtools/inc/svtools/helpagentwindow.hxx
index 7d2987eb6f96..7d2987eb6f96 100644
--- a/svtools/inc/helpagentwindow.hxx
+++ b/svtools/inc/svtools/helpagentwindow.hxx
diff --git a/svtools/inc/svtools/helpid.hrc b/svtools/inc/svtools/helpid.hrc
index 1ffb7a99fb32..ecf8ba4b1bf7 100644
--- a/svtools/inc/svtools/helpid.hrc
+++ b/svtools/inc/svtools/helpid.hrc
@@ -28,90 +28,103 @@
#ifndef _SVT_HELPID_HRC
#define _SVT_HELPID_HRC
-// include ---------------------------------------------------------------
-
-#include <svl/solar.hrc>
-
-// Help-Ids --------------------------------------------------------------
-
-#define HID_FILEDLG_OPENDLG (HID_SVTOOLS_START + 0)
-#define HID_FILEDLG_PATHDLG (HID_SVTOOLS_START + 1)
-#define HID_FILEDLG_DIR (HID_SVTOOLS_START + 2)
-#define HID_FILEDLG_EDIT (HID_SVTOOLS_START + 3)
-#define HID_FILEDLG_DIRS (HID_SVTOOLS_START + 4)
-#define HID_FILEDLG_DRIVE (HID_SVTOOLS_START + 5)
-#define HID_FILEDLG_DRIVES (HID_SVTOOLS_START + 6)
-#define HID_FILEDLG_NEWDIR (HID_SVTOOLS_START + 7)
-#define HID_FILEDLG_HOME (HID_SVTOOLS_START + 8)
-#define HID_FILEDLG_FILE (HID_SVTOOLS_START + 9)
-#define HID_FILEDLG_FILES (HID_SVTOOLS_START + 10)
-#define HID_FILEDLG_PATH (HID_SVTOOLS_START + 11)
-#define HID_FILEDLG_TYPE (HID_SVTOOLS_START + 12)
-#define HID_FILEDLG_TYPES (HID_SVTOOLS_START + 13)
+#define HID_FILEDLG_OPENDLG "SVT_HID_FILEDLG_OPENDLG"
+#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG"
+#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR"
+#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT"
+#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS"
+#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE"
+#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES"
+#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR"
+#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME"
+#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE"
+#define HID_FILEDLG_FILES "SVT_HID_FILEDLG_FILES"
+#define HID_FILEDLG_PATH "SVT_HID_FILEDLG_PATH"
+#define HID_FILEDLG_TYPE "SVT_HID_FILEDLG_TYPE"
+#define HID_FILEDLG_TYPES "SVT_HID_FILEDLG_TYPES"
+#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB"
+#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB"
+#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD"
+#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER"
+#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL"
+#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD"
+#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY"
+#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX"
+#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN"
+#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME"
+#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE"
+#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN"
+#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN"
+#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME"
+#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN"
+#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME"
+#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN"
+#define HID_FILEDLG_EDIT_FAVORITES "SVT_HID_FILEDLG_EDIT_FAVORITES"
+#define HID_FILEDLG_NEW_FAVORITE "SVT_HID_FILEDLG_NEW_FAVORITE"
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX"
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR"
+#define HID_FILEDLG_EXPORTASPDF "SVT_HID_FILEDLG_EXPORTASPDF"
// HelpID's fuer die Textkomponente
-#define HID_TEXTCPNT_OPEN_LINK (HID_SVTOOLS_START + 14)
-#define HID_TEXTCPNT_OPEN_LINK_NEW (HID_SVTOOLS_START + 15)
-#define HID_TEXTCPNT_DOWNLOAD (HID_SVTOOLS_START + 16)
-#define HID_TEXTCPNT_ADD_BOOKMARK (HID_SVTOOLS_START + 17)
-#define HID_TEXTCPNT_COPY_LINK (HID_SVTOOLS_START + 18)
+#define HID_TEXTCPNT_OPEN_LINK "SVT_HID_TEXTCPNT_OPEN_LINK"
+#define HID_TEXTCPNT_OPEN_LINK_NEW "SVT_HID_TEXTCPNT_OPEN_LINK_NEW"
+#define HID_TEXTCPNT_DOWNLOAD "SVT_HID_TEXTCPNT_DOWNLOAD"
+#define HID_TEXTCPNT_ADD_BOOKMARK "SVT_HID_TEXTCPNT_ADD_BOOKMARK"
+#define HID_TEXTCPNT_COPY_LINK "SVT_HID_TEXTCPNT_COPY_LINK"
// HelpID's fuer RegisterDialog
-#define HID_LIMITED_DIALOG (HID_SVTOOLS_START + 20)
+#define HID_LIMITED_DIALOG "SVT_HID_LIMITED_DIALOG"
// Help ids of template dialog
-#define HID_TEMPLATEDLG_DIALOG (HID_SVTOOLS_START + 21)
-#define HID_TEMPLATEDLG_ICONCTRL (HID_SVTOOLS_START + 22)
-#define HID_TEMPLATEDLG_FILEVIEW (HID_SVTOOLS_START + 23)
-#define HID_TEMPLATEDLG_TB_BACK (HID_SVTOOLS_START + 24)
-#define HID_TEMPLATEDLG_TB_PREV (HID_SVTOOLS_START + 25)
-#define HID_TEMPLATEDLG_TB_PRINT (HID_SVTOOLS_START + 26)
-#define HID_TEMPLATEDLG_TB_DOCINFO (HID_SVTOOLS_START + 27)
-#define HID_TEMPLATEDLG_TB_PREVIEW (HID_SVTOOLS_START + 28)
+#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG"
+#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL"
+#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW"
+#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK"
+#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV"
+#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT"
+#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO"
+#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW"
-#define HID_ADDRTEMPL_FIELD_ASSIGNMENT (HID_SVTOOLS_START + 29)
+#define HID_ADDRTEMPL_FIELD_ASSIGNMENT "SVT_HID_ADDRTEMPL_FIELD_ASSIGNMENT"
// Help ids for the filepicker dialogs
-#define HID_EXPLORERDLG_FILE (HID_SVTOOLS_START + 30)
+#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE"
// help ids for fileview contextmenu
-#define HID_FILEVIEW_MENU_DELETE (HID_SVTOOLS_START + 31)
-#define HID_FILEVIEW_MENU_RENAME (HID_SVTOOLS_START + 32)
+#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE"
+#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME"
// help ids for the different modi of the file picker dialog
// FREE
-#define HID_FILESAVE_LEVELUP (HID_SVTOOLS_START + 34)
-#define HID_FILESAVE_CREATEDIRECTORY (HID_SVTOOLS_START + 35)
-#define HID_FILESAVE_DEFAULTDIRECTORY (HID_SVTOOLS_START + 36)
-#define HID_FILESAVE_FILEVIEW (HID_SVTOOLS_START + 37)
-#define HID_FILESAVE_TEMPLATE (HID_SVTOOLS_START + 38)
-#define HID_FILESAVE_FILEURL (HID_SVTOOLS_START + 39)
-#define HID_FILESAVE_FILETYPE (HID_SVTOOLS_START + 40)
-#define HID_FILESAVE_DOSAVE (HID_SVTOOLS_START + 41)
-#define HID_FILESAVE_AUTOEXTENSION (HID_SVTOOLS_START + 42)
-#define HID_FILESAVE_SAVEWITHPASSWORD (HID_SVTOOLS_START + 43)
-#define HID_FILESAVE_CUSTOMIZEFILTER (HID_SVTOOLS_START + 44)
-#define HID_FILESAVE_SELECTION (HID_SVTOOLS_START + 45)
-#define HID_FILESAVE_DIALOG (HID_SVTOOLS_START + 46)
-#define HID_FILESAVE_DOPLAY (HID_SVTOOLS_START + 47)
-
-#define HID_FILEOPEN_READONLY (HID_SVTOOLS_START + 48)
-#define HID_FILEOPEN_VERSION (HID_SVTOOLS_START + 49)
-#define HID_FILEOPEN_IMAGE_TEMPLATE (HID_SVTOOLS_START + 50)
-
-#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276)
-#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277)
+#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP"
+#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY"
+#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY"
+#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW"
+#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE"
+#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL"
+#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE"
+#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE"
+#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION"
+#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD"
+#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER"
+#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION"
+#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG"
+#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY"
+
+#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY"
+#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION"
+#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE"
// uniqueid for the helpagent window (testtool)
-#define HID_HELPAGENT_WINDOW (HID_SVTOOLS_START + 51)
+#define HID_HELPAGENT_WINDOW "SVT_HID_HELPAGENT_WINDOW"
// registration dialog
-#define HID_REGISTRATION_DIALOG (HID_SVTOOLS_START + 52)
+#define HID_REGISTRATION_DIALOG "SVT_HID_REGISTRATION_DIALOG"
-#define HID_PRINTDIALOG_TOFILE (HID_SVTOOLS_START + 53)
+#define HID_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE"
-#define HID_WIZARD_NEXT (HID_SVTOOLS_START + 54)
-#define HID_WIZARD_PREVIOUS (HID_SVTOOLS_START + 55)
+#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT"
+#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS"
#endif
diff --git a/svtools/inc/svtools/htmlcfg.hxx b/svtools/inc/svtools/htmlcfg.hxx
index 3f57d275a705..33c87839db8a 100644
--- a/svtools/inc/svtools/htmlcfg.hxx
+++ b/svtools/inc/svtools/htmlcfg.hxx
@@ -65,37 +65,37 @@ public:
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
- USHORT GetFontSize(USHORT nPos) const;
- void SetFontSize(USHORT nPos, USHORT nSize);
+ sal_uInt16 GetFontSize(sal_uInt16 nPos) const;
+ void SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize);
- BOOL IsImportUnknown() const;
- void SetImportUnknown(BOOL bSet);
+ sal_Bool IsImportUnknown() const;
+ void SetImportUnknown(sal_Bool bSet);
- USHORT GetExportMode() const;
- void SetExportMode(USHORT nSet);
+ sal_uInt16 GetExportMode() const;
+ void SetExportMode(sal_uInt16 nSet);
- BOOL IsStarBasic() const;
- void SetStarBasic(BOOL bSet);
+ sal_Bool IsStarBasic() const;
+ void SetStarBasic(sal_Bool bSet);
- BOOL IsStarBasicWarning() const;
- void SetStarBasicWarning(BOOL bSet);
+ sal_Bool IsStarBasicWarning() const;
+ void SetStarBasicWarning(sal_Bool bSet);
- BOOL IsSaveGraphicsLocal() const;
- void SetSaveGraphicsLocal(BOOL bSet);
+ sal_Bool IsSaveGraphicsLocal() const;
+ void SetSaveGraphicsLocal(sal_Bool bSet);
- BOOL IsPrintLayoutExtension() const;
- void SetPrintLayoutExtension(BOOL bSet);
+ sal_Bool IsPrintLayoutExtension() const;
+ void SetPrintLayoutExtension(sal_Bool bSet);
- BOOL IsIgnoreFontFamily() const;
- void SetIgnoreFontFamily(BOOL bSet);
+ sal_Bool IsIgnoreFontFamily() const;
+ void SetIgnoreFontFamily(sal_Bool bSet);
sal_Bool IsDefaultTextEncoding() const;
rtl_TextEncoding GetTextEncoding() const;
void SetTextEncoding( rtl_TextEncoding );
static SvxHtmlOptions* Get();
- BOOL IsNumbersEnglishUS() const;
- void SetNumbersEnglishUS(BOOL bSet);
+ sal_Bool IsNumbersEnglishUS() const;
+ void SetNumbersEnglishUS(sal_Bool bSet);
void AddListenerLink( const Link& rLink );
void RemoveListenerLink( const Link& rLink );
diff --git a/svtools/inc/htmlkywd.hxx b/svtools/inc/svtools/htmlkywd.hxx
index 999ee21d236c..999ee21d236c 100644
--- a/svtools/inc/htmlkywd.hxx
+++ b/svtools/inc/svtools/htmlkywd.hxx
diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx
index 665b0dfd1cd2..06caae765b6a 100644
--- a/svtools/inc/svtools/htmlout.hxx
+++ b/svtools/inc/svtools/htmlout.hxx
@@ -46,7 +46,7 @@ struct HTMLOutEvent
{
const sal_Char *pBasicName;
const sal_Char *pJavaName;
- USHORT nEvent;
+ sal_uInt16 nEvent;
};
struct SVT_DLLPUBLIC HTMLOutContext
@@ -61,7 +61,7 @@ struct SVT_DLLPUBLIC HTMLOutContext
struct HTMLOutFuncs
{
-#if defined(MAC) || defined(UNX)
+#if defined(UNX)
static const sal_Char sNewLine; // nur \012 oder \015
#else
static const sal_Char sNewLine[]; // \015\012
@@ -72,7 +72,7 @@ struct HTMLOutFuncs
String *pNonConvertableChars = 0);
SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr,
- BOOL bOn = TRUE,
+ sal_Bool bOn = sal_True,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
HTMLOutContext& rContext,
@@ -80,13 +80,13 @@ struct HTMLOutFuncs
SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
String *pNonConvertableChars = 0 );
- SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, ULONG nHex, BYTE nLen,
+ SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const String&,
const HTMLOutEvent *pEventTable,
- BOOL bOutStarBasic,
+ sal_Bool bOutStarBasic,
const sal_Char *pDelim = 0,
const sal_Char *pIndentArea = 0,
const sal_Char *pIndentMap = 0,
@@ -108,18 +108,18 @@ struct HTMLOutFuncs
// der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem
// nur aus 0 bestehen Eintrag terminiert ist.
SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&,
- const HTMLOutEvent*, BOOL bOutStarBasic,
+ const HTMLOutEvent*, sal_Bool bOutStarBasic,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
String *pNonConvertableChars = 0 );
// <TD SDVAL="..." SDNUM="...">
SVT_DLLPUBLIC static ByteString& CreateTableDataOptionsValNum( ByteString& aStrTD,
- BOOL bValue, double fVal, ULONG nFormat,
+ sal_Bool bValue, double fVal, sal_uLong nFormat,
SvNumberFormatter& rFormatter,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
String *pNonConvertableChars = 0 );
- SVT_DLLPUBLIC static BOOL PrivateURLToInternalImg( String& rURL );
+ SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL );
};
#endif
diff --git a/svtools/inc/htmltokn.h b/svtools/inc/svtools/htmltokn.h
index 29169d6959fe..bd4fe7ba6c25 100644
--- a/svtools/inc/htmltokn.h
+++ b/svtools/inc/svtools/htmltokn.h
@@ -47,7 +47,7 @@ SVT_DLLPUBLIC int GetHTMLToken( const String& rName );
int GetHTMLOption( const String& rName );
// suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
-SVT_DLLPUBLIC ULONG GetHTMLColor( const String& rName );
+SVT_DLLPUBLIC sal_uIntPtr GetHTMLColor( const String& rName );
// beginnen immer ab 256, groesser als ein char
const int HTML_TOKEN_START = 0x100;
diff --git a/svtools/inc/imagemgr.hrc b/svtools/inc/svtools/imagemgr.hrc
index 021cbe4c9ac8..021cbe4c9ac8 100644
--- a/svtools/inc/imagemgr.hrc
+++ b/svtools/inc/svtools/imagemgr.hrc
diff --git a/svtools/inc/imagemgr.hxx b/svtools/inc/svtools/imagemgr.hxx
index eca8b658e5cb..eca8b658e5cb 100644
--- a/svtools/inc/imagemgr.hxx
+++ b/svtools/inc/svtools/imagemgr.hxx
diff --git a/svtools/inc/imageresourceaccess.hxx b/svtools/inc/svtools/imageresourceaccess.hxx
index 3999ce908be5..3999ce908be5 100644
--- a/svtools/inc/imageresourceaccess.hxx
+++ b/svtools/inc/svtools/imageresourceaccess.hxx
diff --git a/svtools/inc/svtools/imap.hxx b/svtools/inc/svtools/imap.hxx
index 043900e4c377..7e0124f70d0c 100644
--- a/svtools/inc/svtools/imap.hxx
+++ b/svtools/inc/svtools/imap.hxx
@@ -54,13 +54,13 @@ protected:
// Binaer laden/speichern
void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
- void ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& );
+ void ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& );
// Im-/Export
void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
- ULONG ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
- ULONG ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
+ sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
+ sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
void ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL );
Point ImpReadCERNCoords( const char** ppStr );
@@ -71,7 +71,7 @@ protected:
String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
Point ImpReadNCSACoords( const char** ppStr );
- ULONG ImpDetectFormat( SvStream& rIStm );
+ sal_uLong ImpDetectFormat( SvStream& rIStm );
public:
@@ -90,8 +90,8 @@ public:
ImageMap& operator=( const ImageMap& rImageMap );
// Vergleichsoperator (es wird alles auf Gleichheit geprueft)
- BOOL operator==( const ImageMap& rImageMap );
- BOOL operator!=( const ImageMap& rImageMap );
+ sal_Bool operator==( const ImageMap& rImageMap );
+ sal_Bool operator!=( const ImageMap& rImageMap );
// In die Map wird ein neues IMap-Obkekt ans Ende eingefuegt
void InsertIMapObject( const IMapObject& rIMapObject );
@@ -102,7 +102,7 @@ public:
IMapObject* GetNextIMapObject() { return (IMapObject*) maList.Next(); }
IMapObject* GetLastIMapObject() { return (IMapObject*) maList.Last(); }
IMapObject* GetPrevIMapObject() { return (IMapObject*) maList.Prev(); }
- IMapObject* GetIMapObject( USHORT nPos ) const { return (IMapObject*) maList.GetObject( nPos ); }
+ IMapObject* GetIMapObject( sal_uInt16 nPos ) const { return (IMapObject*) maList.GetObject( nPos ); }
// Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL;
// Groessen- und Positionsangaben sind in 1/100mm;
@@ -113,16 +113,16 @@ public:
IMapObject* GetHitIMapObject( const Size& rOriginalSize,
const Size& rDisplaySize,
const Point& rRelHitPoint,
- ULONG nFlags = 0 );
+ sal_uLong nFlags = 0 );
// Gibt die Gesamtanzahl der IMap-Objekte zurueck
- UINT16 GetIMapObjectCount() const { return (UINT16) maList.Count(); }
+ sal_uInt16 GetIMapObjectCount() const { return (sal_uInt16) maList.Count(); }
// Loescht alle internen Objekte
void ClearImageMap();
// liefert die aktuelle Versionsnummer
- UINT16 GetVersion() const;
+ sal_uInt16 GetVersion() const;
// liefert / setzt den Namen der ImageMap
const String& GetName() const { return aName; }
@@ -138,8 +138,8 @@ public:
void Write ( SvStream& rOStm, const String& rBaseURL ) const;
void Read( SvStream& rIStm, const String& rBaseURL );
- void Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const;
- ULONG Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL );
+ void Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const;
+ sal_uLong Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL );
};
/******************************************************************************
@@ -151,18 +151,18 @@ public:
class IMapCompat
{
SvStream* pRWStm;
- ULONG nCompatPos;
- ULONG nTotalSize;
- USHORT nStmMode;
+ sal_uLong nCompatPos;
+ sal_uLong nTotalSize;
+ sal_uInt16 nStmMode;
IMapCompat() {}
IMapCompat( const IMapCompat& ) {}
IMapCompat& operator=( const IMapCompat& ) { return *this; }
- BOOL operator==( const IMapCompat& ) { return FALSE; }
+ sal_Bool operator==( const IMapCompat& ) { return sal_False; }
public:
- IMapCompat( SvStream& rStm, const USHORT nStreamMode );
+ IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode );
~IMapCompat();
};
diff --git a/svtools/inc/svtools/imapcirc.hxx b/svtools/inc/svtools/imapcirc.hxx
index 4181d8a4f7c5..1ae929374b4f 100644
--- a/svtools/inc/svtools/imapcirc.hxx
+++ b/svtools/inc/svtools/imapcirc.hxx
@@ -43,9 +43,9 @@ class Fraction;
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
{
Point aCenter;
- ULONG nRadius;
+ sal_uLong nRadius;
- void ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel );
+ void ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel );
protected:
@@ -56,21 +56,21 @@ protected:
public:
IMapCircleObject() {};
- IMapCircleObject( const Point& rCenter, ULONG nRad,
+ IMapCircleObject( const Point& rCenter, sal_uLong nRad,
const String& rURL,
const String& rAltText,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bActive = TRUE,
- BOOL bPixelCoords = TRUE );
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
virtual ~IMapCircleObject() {};
- virtual UINT16 GetType() const;
- virtual BOOL IsHit( const Point& rPoint ) const;
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
- Point GetCenter( BOOL bPixelCoords = TRUE ) const;
- ULONG GetRadius( BOOL bPixelCoords = TRUE ) const;
+ Point GetCenter( sal_Bool bPixelCoords = sal_True ) const;
+ sal_uLong GetRadius( sal_Bool bPixelCoords = sal_True ) const;
// liefert das BoundRect des Kreis-Objektes in 1/100mm
virtual Rectangle GetBoundRect() const;
@@ -78,7 +78,7 @@ public:
void Scale( const Fraction& rFractX, const Fraction& rFracY );
using IMapObject::IsEqual;
- BOOL IsEqual( const IMapCircleObject& rEqObj );
+ sal_Bool IsEqual( const IMapCircleObject& rEqObj );
// Im-/Export
void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx
index 6929e4d21291..fc907135fdaa 100644
--- a/svtools/inc/svtools/imapobj.hxx
+++ b/svtools/inc/svtools/imapobj.hxx
@@ -37,13 +37,13 @@ class Point;
class Rectangle;
class SvStream;
-#define IMAP_OBJ_NONE ((UINT16)0x0000)
-#define IMAP_OBJ_RECTANGLE ((UINT16)0x0001)
-#define IMAP_OBJ_CIRCLE ((UINT16)0x0002)
-#define IMAP_OBJ_POLYGON ((UINT16)0x0003)
-#define IMAP_OBJ_VERSION ((UINT16)0x0005)
+#define IMAP_OBJ_NONE ((sal_uInt16)0x0000)
+#define IMAP_OBJ_RECTANGLE ((sal_uInt16)0x0001)
+#define IMAP_OBJ_CIRCLE ((sal_uInt16)0x0002)
+#define IMAP_OBJ_POLYGON ((sal_uInt16)0x0003)
+#define IMAP_OBJ_VERSION ((sal_uInt16)0x0005)
-#define IMAGE_MAP_VERSION ((UINT16)0x0001)
+#define IMAGE_MAP_VERSION ((sal_uInt16)0x0001)
#define IMAPMAGIC "SDIMAP"
@@ -74,11 +74,11 @@ class SVT_DLLPUBLIC IMapObject
String aTarget;
String aName;
SvxMacroTableDtor aEventList;
- BOOL bActive;
+ sal_Bool bActive;
protected:
- UINT16 nReadVersion;
+ sal_uInt16 nReadVersion;
// Binaer-Im-/Export
virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
@@ -100,12 +100,12 @@ public:
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bActive );
+ sal_Bool bActive );
virtual ~IMapObject() {};
- virtual UINT16 GetVersion() const;
- virtual UINT16 GetType() const = 0;
- virtual BOOL IsHit( const Point& rPoint ) const = 0;
+ virtual sal_uInt16 GetVersion() const;
+ virtual sal_uInt16 GetType() const = 0;
+ virtual sal_Bool IsHit( const Point& rPoint ) const = 0;
void Write ( SvStream& rOStm, const String& rBaseURL ) const;
void Read( SvStream& rIStm, const String& rBaseURL );
@@ -127,33 +127,33 @@ public:
const String& GetName() const { return aName; }
void SetName( const String& rName ) { aName = rName; }
- BOOL IsActive() const { return bActive; }
- void SetActive( BOOL bSetActive = TRUE ) { bActive = bSetActive; }
+ sal_Bool IsActive() const { return bActive; }
+ void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; }
static Point GetPixelPoint( const Point& rLogPoint );
static Point GetLogPoint( const Point& rPixelPoint );
- BOOL IsEqual( const IMapObject& rEqObj );
+ sal_Bool IsEqual( const IMapObject& rEqObj );
// IMap-Events
inline const SvxMacroTableDtor& GetMacroTable() const { return aEventList;}
inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aEventList = rTbl; }
- inline const SvxMacro& GetEvent( USHORT nEvent ) const;
- inline BOOL HasEvent( USHORT nEvent ) const;
- void SetEvent( USHORT nEvent, const SvxMacro& );
- inline BOOL DelEvent( USHORT nEvent );
+ inline const SvxMacro& GetEvent( sal_uInt16 nEvent ) const;
+ inline sal_Bool HasEvent( sal_uInt16 nEvent ) const;
+ void SetEvent( sal_uInt16 nEvent, const SvxMacro& );
+ inline sal_Bool DelEvent( sal_uInt16 nEvent );
};
-inline BOOL IMapObject::HasEvent( USHORT nEvent ) const
+inline sal_Bool IMapObject::HasEvent( sal_uInt16 nEvent ) const
{
return aEventList.IsKeyValid( nEvent );
}
-inline const SvxMacro& IMapObject::GetEvent( USHORT nEvent ) const
+inline const SvxMacro& IMapObject::GetEvent( sal_uInt16 nEvent ) const
{
return *(aEventList.Get( nEvent ));
}
-inline BOOL IMapObject::DelEvent( USHORT nEvent )
+inline sal_Bool IMapObject::DelEvent( sal_uInt16 nEvent )
{
SvxMacro *pMacro = aEventList.Remove( nEvent );
delete pMacro;
diff --git a/svtools/inc/svtools/imappoly.hxx b/svtools/inc/svtools/imappoly.hxx
index 655d180f6613..605a43c36c44 100644
--- a/svtools/inc/svtools/imappoly.hxx
+++ b/svtools/inc/svtools/imappoly.hxx
@@ -45,9 +45,9 @@ class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
{
Polygon aPoly;
Rectangle aEllipse;
- BOOL bEllipse;
+ sal_Bool bEllipse;
- SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, BOOL bPixel );
+ SVT_DLLPRIVATE void ImpConstruct( const Polygon& rPoly, sal_Bool bPixel );
protected:
@@ -55,7 +55,7 @@ protected:
virtual void WriteIMapObject( SvStream& rOStm ) const;
virtual void ReadIMapObject( SvStream& rIStm );
- BOOL ReadPreProLine( SvStream& rIStm, String& rStr );
+ sal_Bool ReadPreProLine( SvStream& rIStm, String& rStr );
public:
IMapPolygonObject() {};
@@ -65,26 +65,26 @@ public:
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bActive = TRUE,
- BOOL bPixelCoords = TRUE );
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
virtual ~IMapPolygonObject() {};
- virtual UINT16 GetType() const;
- virtual BOOL IsHit( const Point& rPoint ) const;
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
- Polygon GetPolygon( BOOL bPixelCoords = TRUE ) const;
+ Polygon GetPolygon( sal_Bool bPixelCoords = sal_True ) const;
// liefert das BoundRect des Polygon-Objektes in 1/100mm
virtual Rectangle GetBoundRect() const { return aPoly.GetBoundRect(); }
- BOOL HasExtraEllipse() const { return bEllipse; }
+ sal_Bool HasExtraEllipse() const { return bEllipse; }
const Rectangle& GetExtraEllipse() const { return aEllipse; }
void SetExtraEllipse( const Rectangle& rEllipse );
void Scale( const Fraction& rFractX, const Fraction& rFracY );
using IMapObject::IsEqual;
- BOOL IsEqual( const IMapPolygonObject& rEqObj );
+ sal_Bool IsEqual( const IMapPolygonObject& rEqObj );
// Im-/Export
void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
diff --git a/svtools/inc/svtools/imaprect.hxx b/svtools/inc/svtools/imaprect.hxx
index f10000de3e92..e5dc8ebaf18b 100644
--- a/svtools/inc/svtools/imaprect.hxx
+++ b/svtools/inc/svtools/imaprect.hxx
@@ -44,7 +44,7 @@ class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
{
Rectangle aRect;
- SVT_DLLPRIVATE void ImpConstruct( const Rectangle& rRect, BOOL bPixel );
+ SVT_DLLPRIVATE void ImpConstruct( const Rectangle& rRect, sal_Bool bPixel );
protected:
@@ -61,14 +61,14 @@ public:
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bActive = TRUE,
- BOOL bPixelCoords = TRUE );
+ sal_Bool bActive = sal_True,
+ sal_Bool bPixelCoords = sal_True );
virtual ~IMapRectangleObject() {};
- virtual UINT16 GetType() const;
- virtual BOOL IsHit( const Point& rPoint ) const;
+ virtual sal_uInt16 GetType() const;
+ virtual sal_Bool IsHit( const Point& rPoint ) const;
- Rectangle GetRectangle( BOOL bPixelCoords = TRUE ) const;
+ Rectangle GetRectangle( sal_Bool bPixelCoords = sal_True ) const;
// liefert das BoundRect des Rechteck-Objektes in 1/100mm
virtual Rectangle GetBoundRect() const { return aRect; }
@@ -76,7 +76,7 @@ public:
void Scale( const Fraction& rFractX, const Fraction& rFracY );
using IMapObject::IsEqual;
- BOOL IsEqual( const IMapRectangleObject& rEqObj );
+ sal_Bool IsEqual( const IMapRectangleObject& rEqObj );
// Im-/Export
void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
diff --git a/svtools/inc/imgdef.hxx b/svtools/inc/svtools/imgdef.hxx
index d10585a73caa..d10585a73caa 100644
--- a/svtools/inc/imgdef.hxx
+++ b/svtools/inc/svtools/imgdef.hxx
diff --git a/svtools/inc/indexentryres.hxx b/svtools/inc/svtools/indexentryres.hxx
index 56424cc00c7e..56424cc00c7e 100644
--- a/svtools/inc/indexentryres.hxx
+++ b/svtools/inc/svtools/indexentryres.hxx
diff --git a/svtools/inc/inetimg.hxx b/svtools/inc/svtools/inetimg.hxx
index 22a4af175ca9..12f3df2a4289 100644
--- a/svtools/inc/inetimg.hxx
+++ b/svtools/inc/svtools/inetimg.hxx
@@ -78,8 +78,8 @@ public:
const Size& GetSizePixel() const { return aSizePixel; }
// Im-/Export
- sal_Bool Write( SvStream& rOStm, ULONG nFormat ) const;
- sal_Bool Read( SvStream& rIStm, ULONG nFormat );
+ sal_Bool Write( SvStream& rOStm, sal_uLong nFormat ) const;
+ sal_Bool Read( SvStream& rIStm, sal_uLong nFormat );
};
#endif // #ifndef _INETIMG_HXX
diff --git a/svtools/inc/svtools/inettbc.hxx b/svtools/inc/svtools/inettbc.hxx
index ccf1848a0094..f352dd2fae83 100644
--- a/svtools/inc/svtools/inettbc.hxx
+++ b/svtools/inc/svtools/inettbc.hxx
@@ -50,17 +50,17 @@ friend class SvtURLBox_Impl;
SvtMatchContext_Impl* pCtx;
SvtURLBox_Impl* pImp;
INetProtocol eSmartProtocol;
- BOOL bAutoCompleteMode : 1;
- BOOL bOnlyDirectories : 1;
- BOOL bModified : 1;
- BOOL bTryAutoComplete : 1;
- BOOL bCtrlClick : 1;
- BOOL bHistoryDisabled : 1;
- BOOL bNoSelection : 1;
- BOOL bIsAutoCompleteEnabled : 1;
+ sal_Bool bAutoCompleteMode : 1;
+ sal_Bool bOnlyDirectories : 1;
+ sal_Bool bModified : 1;
+ sal_Bool bTryAutoComplete : 1;
+ sal_Bool bCtrlClick : 1;
+ sal_Bool bHistoryDisabled : 1;
+ sal_Bool bNoSelection : 1;
+ sal_Bool bIsAutoCompleteEnabled : 1;
- SVT_DLLPRIVATE BOOL ProcessKey( const KeyCode& rCode );
- SVT_DLLPRIVATE void TryAutoComplete( BOOL bForce );
+ SVT_DLLPRIVATE sal_Bool ProcessKey( const KeyCode& rCode );
+ SVT_DLLPRIVATE void TryAutoComplete( sal_Bool bForce );
SVT_DLLPRIVATE void UpdatePicklistForSmartProtocol_Impl();
DECL_DLLPRIVATE_LINK( AutoCompleteHdl_Impl, void* );
using Window::ImplInit;
@@ -82,11 +82,11 @@ public:
const String& GetBaseURL() const { return aBaseURL; }
void SetOpenHdl( const Link& rLink ) { aOpenHdl = rLink; }
const Link& GetOpenHdl() const { return aOpenHdl; }
- void SetOnlyDirectories( BOOL bDir = TRUE );
- void SetNoURLSelection( BOOL bSet = TRUE );
+ void SetOnlyDirectories( sal_Bool bDir = sal_True );
+ void SetNoURLSelection( sal_Bool bSet = sal_True );
INetProtocol GetSmartProtocol() const { return eSmartProtocol; }
void SetSmartProtocol( INetProtocol eProt );
- BOOL IsCtrlOpen()
+ sal_Bool IsCtrlOpen()
{ return bCtrlClick; }
String GetURL();
void DisableHistory();
@@ -99,7 +99,7 @@ public:
void SetUrlFilter( const IUrlFilter* _pFilter );
const IUrlFilter* GetUrlFilter( ) const;
- inline void EnableAutocompletion( BOOL _bEnable = TRUE )
+ inline void EnableAutocompletion( sal_Bool _bEnable = sal_True )
{ bIsAutoCompleteEnabled = _bEnable; }
void SetPlaceHolder( const String& sPlaceHolder ) { aPlaceHolder = sPlaceHolder; }
String GetPlaceHolder() { return aPlaceHolder; }
diff --git a/svtools/inc/itemdel.hxx b/svtools/inc/svtools/itemdel.hxx
index 2ceb73a781b9..2ceb73a781b9 100644
--- a/svtools/inc/itemdel.hxx
+++ b/svtools/inc/svtools/itemdel.hxx
diff --git a/svtools/inc/ivctrl.hxx b/svtools/inc/svtools/ivctrl.hxx
index ccba40e43442..13bf8bcdd24a 100644
--- a/svtools/inc/ivctrl.hxx
+++ b/svtools/inc/svtools/ivctrl.hxx
@@ -85,7 +85,7 @@ class SvxIconChoiceCtrlEntry
Rectangle aRect; // Bounding-Rect des Entries
Rectangle aGridRect; // nur gesetzt im Grid-Modus
- ULONG nPos;
+ sal_uLong nPos;
// die Eintragsposition in der Eintragsliste entspricht der beim Insert vorgegebenen
// [Sortier-]Reihenfolge (->Reihenfolge der Anker in der Ankerliste!). Im AutoArrange-Modus
@@ -95,12 +95,12 @@ class SvxIconChoiceCtrlEntry
SvxIconChoiceCtrlEntry* pflink; // forward (rechter Nachbar)
SvxIconChoiceCtrlTextMode eTextMode;
- USHORT nX,nY; // fuer Tastatursteuerung
- USHORT nFlags;
+ sal_uInt16 nX,nY; // fuer Tastatursteuerung
+ sal_uInt16 nFlags;
- void ClearFlags( USHORT nMask ) { nFlags &= (~nMask); }
- void SetFlags( USHORT nMask ) { nFlags |= nMask; }
- void AssignFlags( USHORT _nFlags ) { nFlags = _nFlags; }
+ void ClearFlags( sal_uInt16 nMask ) { nFlags &= (~nMask); }
+ void SetFlags( sal_uInt16 nMask ) { nFlags |= nMask; }
+ void AssignFlags( sal_uInt16 _nFlags ) { nFlags = _nFlags; }
// setzt den linken Nachbarn (A <-> B ==> A <-> this <-> B)
void SetBacklink( SvxIconChoiceCtrlEntry* pA )
@@ -120,8 +120,8 @@ class SvxIconChoiceCtrlEntry
}
public:
- SvxIconChoiceCtrlEntry( USHORT nFlags = 0 );
- SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, USHORT nFlags = 0 );
+ SvxIconChoiceCtrlEntry( sal_uInt16 nFlags = 0 );
+ SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 nFlags = 0 );
~SvxIconChoiceCtrlEntry () {}
void SetImage ( const Image& rImage ) { aImage = rImage; }
@@ -136,21 +136,21 @@ public:
const Rectangle & GetBoundRect() const { return aRect; }
- void SetFocus ( BOOL bSet )
+ void SetFocus ( sal_Bool bSet )
{ nFlags = ( bSet ? nFlags | ICNVIEW_FLAG_FOCUSED : nFlags & ~ICNVIEW_FLAG_FOCUSED ); }
SvxIconChoiceCtrlTextMode GetTextMode() const { return eTextMode; }
- USHORT GetFlags() const { return nFlags; }
- BOOL IsSelected() const { return (BOOL)((nFlags & ICNVIEW_FLAG_SELECTED) !=0); }
- BOOL IsFocused() const { return (BOOL)((nFlags & ICNVIEW_FLAG_FOCUSED) !=0); }
- BOOL IsInUse() const { return (BOOL)((nFlags & ICNVIEW_FLAG_IN_USE) !=0); }
- BOOL IsCursored() const { return (BOOL)((nFlags & ICNVIEW_FLAG_CURSORED) !=0); }
- BOOL IsDropTarget() const { return (BOOL)((nFlags & ICNVIEW_FLAG_DROP_TARGET) !=0); }
- BOOL IsBlockingEmphasis() const { return (BOOL)((nFlags & ICNVIEW_FLAG_BLOCK_EMPHASIS) !=0); }
- BOOL WasMoved() const { return (BOOL)((nFlags & ICNVIEW_FLAG_POS_MOVED) !=0); }
- void SetMoved( BOOL bMoved );
- BOOL IsPosLocked() const { return (BOOL)((nFlags & ICNVIEW_FLAG_POS_LOCKED) !=0); }
- void LockPos( BOOL bLock );
+ sal_uInt16 GetFlags() const { return nFlags; }
+ sal_Bool IsSelected() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_SELECTED) !=0); }
+ sal_Bool IsFocused() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_FOCUSED) !=0); }
+ sal_Bool IsInUse() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_IN_USE) !=0); }
+ sal_Bool IsCursored() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_CURSORED) !=0); }
+ sal_Bool IsDropTarget() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_DROP_TARGET) !=0); }
+ sal_Bool IsBlockingEmphasis() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_BLOCK_EMPHASIS) !=0); }
+ sal_Bool WasMoved() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_POS_MOVED) !=0); }
+ void SetMoved( sal_Bool bMoved );
+ sal_Bool IsPosLocked() const { return (sal_Bool)((nFlags & ICNVIEW_FLAG_POS_LOCKED) !=0); }
+ void LockPos( sal_Bool bLock );
// Nur bei AutoArrange gesetzt. Den Kopf der Liste gibts per SvxIconChoiceCtrl::GetPredecessorHead
SvxIconChoiceCtrlEntry* GetSuccessor() const { return pflink; }
SvxIconChoiceCtrlEntry* GetPredecessor() const { return pblink; }
@@ -171,10 +171,10 @@ class SvxIconChoiceCtrlColumnInfo
Image aColImage;
long nWidth;
SvxIconChoiceCtrlColumnAlign eAlignment;
- USHORT nSubItem;
+ sal_uInt16 nSubItem;
public:
- SvxIconChoiceCtrlColumnInfo( USHORT nSub, long nWd,
+ SvxIconChoiceCtrlColumnInfo( sal_uInt16 nSub, long nWd,
SvxIconChoiceCtrlColumnAlign eAlign ) :
nWidth( nWd ), eAlignment( eAlign ), nSubItem( nSub ) {}
SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& );
@@ -183,13 +183,13 @@ public:
void SetImage( const Image& rImg ) { aColImage = rImg; }
void SetWidth( long nWd ) { nWidth = nWd; }
void SetAlignment( SvxIconChoiceCtrlColumnAlign eAlign ) { eAlignment = eAlign; }
- void SetSubItem( USHORT nSub) { nSubItem = nSub; }
+ void SetSubItem( sal_uInt16 nSub) { nSubItem = nSub; }
const String& GetText() const { return aColText; }
const Image& GetImage() const { return aColImage; }
long GetWidth() const { return nWidth; }
SvxIconChoiceCtrlColumnAlign GetAlignment() const { return eAlignment; }
- USHORT GetSubItem() const { return nSubItem; }
+ sal_uInt16 GetSubItem() const { return nSubItem; }
};
//###################################################################################################################################
@@ -238,15 +238,15 @@ class SVT_DLLPUBLIC SvtIconChoiceCtrl : public Control
Link _aVisRectChangedHdl;
KeyEvent* _pCurKeyEvent;
SvxIconChoiceCtrl_Impl* _pImp;
- BOOL _bAutoFontColor;
+ sal_Bool _bAutoFontColor;
protected:
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual BOOL EditedEntry( SvxIconChoiceCtrlEntry*, const XubString& rNewText, BOOL bCancelled );
+ virtual sal_Bool EditedEntry( SvxIconChoiceCtrlEntry*, const XubString& rNewText, sal_Bool bCancelled );
virtual void DocumentRectChanged();
virtual void VisibleRectChanged();
- virtual BOOL EditingEntry( SvxIconChoiceCtrlEntry* pEntry );
+ virtual sal_Bool EditingEntry( SvxIconChoiceCtrlEntry* pEntry );
virtual void Command( const CommandEvent& rCEvt );
virtual void Paint( const Rectangle& rRect );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -266,11 +266,11 @@ protected:
virtual String GetEntryText(
SvxIconChoiceCtrlEntry* pEntry,
- BOOL bInplaceEdit );
+ sal_Bool bInplaceEdit );
virtual void FillLayoutData() const;
- void CallImplEventListeners(ULONG nEvent, void* pData);
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
public:
@@ -281,9 +281,9 @@ public:
void SetStyle( WinBits nWinStyle );
WinBits GetStyle() const;
- BOOL SetChoiceWithCursor ( BOOL bDo = TRUE );
+ sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True );
- void SetUpdateMode( BOOL bUpdateMode );
+ void SetUpdateMode( sal_Bool bUpdateMode );
void SetFont( const Font& rFont );
void SetPointFont( const Font& rFont );
@@ -296,14 +296,14 @@ public:
void ArrangeIcons();
- SvxIconChoiceCtrlEntry* InsertEntry( ULONG nPos = LIST_APPEND,
+ SvxIconChoiceCtrlEntry* InsertEntry( sal_uLong nPos = LIST_APPEND,
const Point* pPos = 0,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
SvxIconChoiceCtrlEntry* InsertEntry( const String& rText,
const Image& rImage,
- ULONG nPos = LIST_APPEND,
+ sal_uLong nPos = LIST_APPEND,
const Point* pPos = 0,
- USHORT nFlags = 0
+ sal_uInt16 nFlags = 0
);
/** creates automatic mnemonics for all icon texts in the control
@@ -321,14 +321,14 @@ public:
void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry );
- BOOL DoKeyInput( const KeyEvent& rKEvt );
+ sal_Bool DoKeyInput( const KeyEvent& rKEvt );
- BOOL IsEntryEditing() const;
+ sal_Bool IsEntryEditing() const;
void Clear();
- ULONG GetEntryCount() const;
- SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const;
- ULONG GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const;
+ sal_uLong GetEntryCount() const;
+ SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const;
+ sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const;
using Window::SetCursor;
void SetCursor( SvxIconChoiceCtrlEntry* pEntry );
SvxIconChoiceCtrlEntry* GetCursor() const;
@@ -336,16 +336,16 @@ public:
// Neu-Berechnung gecachter View-Daten und Invalidierung im Fenster
void InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry );
- // bHit==FALSE: Eintrag gilt als getroffen, wenn Position im BoundRect liegt
- // ==TRUE : Bitmap oder Text muss getroffen sein
- SvxIconChoiceCtrlEntry* GetEntry( const Point& rPosPixel, BOOL bHit = FALSE ) const;
+ // bHit==sal_False: Eintrag gilt als getroffen, wenn Position im BoundRect liegt
+ // ==sal_True : Bitmap oder Text muss getroffen sein
+ SvxIconChoiceCtrlEntry* GetEntry( const Point& rPosPixel, sal_Bool bHit = sal_False ) const;
// Gibt den naechsten ueber pCurEntry liegenden Eintrag (ZOrder)
- SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const;
+ SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const;
// Gibt den naechsten unter pCurEntry liegenden Eintrag (ZOrder)
- SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const;
+ SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const;
- // in dem ULONG wird die Position in der Liste des gefunden Eintrags zurueckgegeben
- SvxIconChoiceCtrlEntry* GetSelectedEntry( ULONG& rPos ) const;
+ // in dem sal_uLong wird die Position in der Liste des gefunden Eintrags zurueckgegeben
+ SvxIconChoiceCtrlEntry* GetSelectedEntry( sal_uLong& rPos ) const;
void SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
SvxIconChoiceCtrlTextMode GetEntryTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const;
@@ -355,19 +355,19 @@ public:
void Flush();
- virtual BOOL HasBackground() const;
- virtual BOOL HasFont() const;
- virtual BOOL HasFontTextColor() const;
- virtual BOOL HasFontFillColor() const;
+ virtual sal_Bool HasBackground() const;
+ virtual sal_Bool HasFont() const;
+ virtual sal_Bool HasFontTextColor() const;
+ virtual sal_Bool HasFontFillColor() const;
- void SetFontColorToBackground ( BOOL bDo = TRUE ) { _bAutoFontColor = bDo; }
- BOOL AutoFontColor () { return _bAutoFontColor; }
+ void SetFontColorToBackground ( sal_Bool bDo = sal_True ) { _bAutoFontColor = bDo; }
+ sal_Bool AutoFontColor () { return _bAutoFontColor; }
Point GetLogicPos( const Point& rPosPixel ) const;
Point GetPixelPos( const Point& rPosLogic ) const;
void SetSelectionMode( SelectionMode eMode );
- BOOL HandleShortCutKey( const KeyEvent& rKeyEvent );
+ sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent );
Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const;
Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const;
diff --git a/svtools/inc/svtools/javainteractionhandler.hxx b/svtools/inc/svtools/javainteractionhandler.hxx
index e3137f7bed2b..608861ad898e 100644
--- a/svtools/inc/svtools/javainteractionhandler.hxx
+++ b/svtools/inc/svtools/javainteractionhandler.hxx
@@ -75,7 +75,7 @@ private:
bool m_bJavaNotFound_Handled;
bool m_bVMCreationFailure_Handled;
bool m_bRestartRequired_Handled;
- USHORT m_nResult_JavaDisabled;
+ sal_uInt16 m_nResult_JavaDisabled;
};
}
diff --git a/svtools/inc/localresaccess.hxx b/svtools/inc/svtools/localresaccess.hxx
index 30f986d2e002..c006f034e5fd 100644
--- a/svtools/inc/localresaccess.hxx
+++ b/svtools/inc/svtools/localresaccess.hxx
@@ -69,7 +69,7 @@ namespace svt
FreeResource();
}
- inline BOOL IsAvailableRes( const ResId& _rId ) const
+ inline sal_Bool IsAvailableRes( const ResId& _rId ) const
{
return Resource::IsAvailableRes( _rId );
}
diff --git a/svtools/inc/svtools/parhtml.hxx b/svtools/inc/svtools/parhtml.hxx
index ddf0352c558a..20e15990e538 100644
--- a/svtools/inc/svtools/parhtml.hxx
+++ b/svtools/inc/svtools/parhtml.hxx
@@ -121,7 +121,7 @@ public:
// ... als Enum pOptEnums ist ein HTMLOptionEnum-Array
sal_uInt16 GetEnum( const HTMLOptionEnum *pOptEnums,
sal_uInt16 nDflt=0 ) const;
- BOOL GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const;
+ sal_Bool GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const;
// ... und als ein par spezielle Enums
HTMLInputType GetInputType() const; // <INPUT TYPE=...>
@@ -135,20 +135,20 @@ SV_DECL_PTRARR(HTMLOptions,HTMLOptionPtr,16,16)
class SVT_DLLPUBLIC HTMLParser : public SvParser
{
- BOOL bNewDoc : 1; // neues Doc lesen ?
- BOOL bIsInHeader : 1; // scanne Header-Bereich
- BOOL bIsInBody : 1; // scanne Body-Bereich
- BOOL bReadListing : 1; // Lese Listings
- BOOL bReadXMP : 1; // Lese XMP
- BOOL bReadPRE : 1; // Lese preformatted Text
- BOOL bReadTextArea : 1; // Lese TEXTAREA
- BOOL bReadScript : 1; // Lesen von <SCRIPT>
- BOOL bReadStyle : 1; // Lesen von <STYLE>
- BOOL bEndTokenFound : 1; // </SCRIPT> oder </STYLE> gefunden
-
- BOOL bPre_IgnoreNewPara : 1; // Flags fuers lesen von PRE-Absaetzen
- BOOL bReadNextChar : 1; // TRUE: NextChar nochmals lesen (JavaScript!)
- BOOL bReadComment : 1; // TRUE: NextChar nochmals lesen (JavaScript!)
+ sal_Bool bNewDoc : 1; // neues Doc lesen ?
+ sal_Bool bIsInHeader : 1; // scanne Header-Bereich
+ sal_Bool bIsInBody : 1; // scanne Body-Bereich
+ sal_Bool bReadListing : 1; // Lese Listings
+ sal_Bool bReadXMP : 1; // Lese XMP
+ sal_Bool bReadPRE : 1; // Lese preformatted Text
+ sal_Bool bReadTextArea : 1; // Lese TEXTAREA
+ sal_Bool bReadScript : 1; // Lesen von <SCRIPT>
+ sal_Bool bReadStyle : 1; // Lesen von <STYLE>
+ sal_Bool bEndTokenFound : 1; // </SCRIPT> oder </STYLE> gefunden
+
+ sal_Bool bPre_IgnoreNewPara : 1; // Flags fuers lesen von PRE-Absaetzen
+ sal_Bool bReadNextChar : 1; // sal_True: NextChar nochmals lesen (JavaScript!)
+ sal_Bool bReadComment : 1; // sal_True: NextChar nochmals lesen (JavaScript!)
sal_uInt32 nPre_LinePos; // Pos in der Line im PRE-Tag
@@ -167,43 +167,43 @@ protected:
virtual ~HTMLParser();
- void FinishHeader( BOOL bBody ) { bIsInHeader = FALSE; bIsInBody = bBody; }
+ void FinishHeader( sal_Bool bBody ) { bIsInHeader = sal_False; bIsInBody = bBody; }
public:
- HTMLParser( SvStream& rIn, int bReadNewDoc = TRUE );
+ HTMLParser( SvStream& rIn, int bReadNewDoc = sal_True );
virtual SvParserState CallParser(); // Aufruf des Parsers
- BOOL IsNewDoc() const { return bNewDoc; }
- BOOL IsInHeader() const { return bIsInHeader; }
- BOOL IsInBody() const { return bIsInBody; }
- BOOL IsValidSyntax() const { return TRUE; }
- BOOL IsReadListing() const { return bReadListing; }
- BOOL IsReadXMP() const { return bReadXMP; }
- BOOL IsReadPRE() const { return bReadPRE; }
- BOOL IsReadScript() const { return bReadScript; }
- BOOL IsReadStyle() const { return bReadStyle; }
+ sal_Bool IsNewDoc() const { return bNewDoc; }
+ sal_Bool IsInHeader() const { return bIsInHeader; }
+ sal_Bool IsInBody() const { return bIsInBody; }
+ sal_Bool IsValidSyntax() const { return sal_True; }
+ sal_Bool IsReadListing() const { return bReadListing; }
+ sal_Bool IsReadXMP() const { return bReadXMP; }
+ sal_Bool IsReadPRE() const { return bReadPRE; }
+ sal_Bool IsReadScript() const { return bReadScript; }
+ sal_Bool IsReadStyle() const { return bReadStyle; }
- void SetReadNextChar() { bReadNextChar = TRUE; }
+ void SetReadNextChar() { bReadNextChar = sal_True; }
// PRE-/LISTING oder XMP-Modus starten/beenden oder Tags entsprechend
// filtern
- inline void StartPRE( BOOL bRestart=FALSE );
- void FinishPRE() { bReadPRE = FALSE; }
+ inline void StartPRE( sal_Bool bRestart=sal_False );
+ void FinishPRE() { bReadPRE = sal_False; }
int FilterPRE( int nToken );
- inline void StartListing( BOOL bRestart=FALSE );
- void FinishListing() { bReadListing = FALSE; }
+ inline void StartListing( sal_Bool bRestart=sal_False );
+ void FinishListing() { bReadListing = sal_False; }
int FilterListing( int nToken );
- inline void StartXMP( BOOL bRestart=FALSE );
- void FinishXMP() { bReadXMP = FALSE; }
+ inline void StartXMP( sal_Bool bRestart=sal_False );
+ void FinishXMP() { bReadXMP = sal_False; }
int FilterXMP( int nToken );
- void FinishTextArea() { bReadTextArea = FALSE; }
+ void FinishTextArea() { bReadTextArea = sal_False; }
// PRE-/LSITING- und XMP-Modus beenden
- void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = FALSE; }
+ void FinishPREListingXMP() { bReadPRE = bReadListing = bReadXMP = sal_False; }
// Das aktuelle Token dem aktuellen Modus (PRE, XMP, ...) entsprechend
// Filtern und die Flags setzen. Wird von Continue aufgerufen, bevor
@@ -213,7 +213,7 @@ public:
// Scannen eines Scripts beenden (sollte nur unmittelbar nach dem
// Lesen eines <SCRIPT> aufgerufen werden
- void EndScanScript() { bReadScript = FALSE; }
+ void EndScanScript() { bReadScript = sal_False; }
void ReadRawData( const sal_Char *pEndToken ) { aEndToken.AssignAscii(pEndToken); }
@@ -254,43 +254,43 @@ public:
// Ist der uebergebene 0-terminierte String (vermutlich) der Anfang
// eines HTML-Files? Er sollte mind. 80 Zeichen lang sein.
- // Mit Ausnahme des Falls, dass SwitchToUCS2==FALSE und
+ // Mit Ausnahme des Falls, dass SwitchToUCS2==sal_False und
// SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
// 0-Bytes an einer geraden(!) Position terminiert sein.
static bool IsHTMLFormat( const sal_Char* pHeader,
- BOOL bSwitchToUCS2 = FALSE,
+ sal_Bool bSwitchToUCS2 = sal_False,
rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
- BOOL ParseScriptOptions( String& rLangString, const String&, HTMLScriptLanguage& rLang,
+ sal_Bool ParseScriptOptions( String& rLangString, const String&, HTMLScriptLanguage& rLang,
String& rSrc, String& rLibrary, String& rModule );
// Einen Kommentar um den Inhalt von <SCRIPT> oder <STYLE> entfernen
// Bei 'bFull' wird ggf. die gesammte Zeile hinter einem "<!--"
// entfernt (fuer JavaSript)
- static void RemoveSGMLComment( String &rString, BOOL bFull );
+ static void RemoveSGMLComment( String &rString, sal_Bool bFull );
- static BOOL InternalImgToPrivateURL( String& rURL );
+ static sal_Bool InternalImgToPrivateURL( String& rURL );
static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
- BOOL SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
+ sal_Bool SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
};
-inline void HTMLParser::StartPRE( BOOL bRestart )
+inline void HTMLParser::StartPRE( sal_Bool bRestart )
{
- bReadPRE = TRUE;
+ bReadPRE = sal_True;
bPre_IgnoreNewPara = !bRestart;
nPre_LinePos = 0UL;
}
-inline void HTMLParser::StartListing( BOOL bRestart )
+inline void HTMLParser::StartListing( sal_Bool bRestart )
{
- bReadListing = TRUE;
+ bReadListing = sal_True;
bPre_IgnoreNewPara = !bRestart;
nPre_LinePos = 0UL;
}
-inline void HTMLParser::StartXMP( BOOL bRestart )
+inline void HTMLParser::StartXMP( sal_Bool bRestart )
{
- bReadXMP = TRUE;
+ bReadXMP = sal_True;
bPre_IgnoreNewPara = !bRestart;
nPre_LinePos = 0UL;
}
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx
index 7bab3233f454..e47428ba3ac9 100644
--- a/svtools/inc/svtools/parrtf.hxx
+++ b/svtools/inc/svtools/parrtf.hxx
@@ -31,19 +31,19 @@
#include "svtools/svtdllapi.h"
#include <svtools/svparser.hxx>
-#include <svl/svarray.hxx>
+#include <stack>
struct RtfParserState_Impl
{
rtl_TextEncoding eCodeSet;
- BYTE nUCharOverread;
+ sal_uInt8 nUCharOverread;
- RtfParserState_Impl( BYTE nUOverread, rtl_TextEncoding eCdSt )
+ RtfParserState_Impl( sal_uInt8 nUOverread, rtl_TextEncoding eCdSt )
: eCodeSet( eCdSt ), nUCharOverread( nUOverread )
{}
};
-SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 )
+typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl;
class SVT_DLLPUBLIC SvRTFParser : public SvParser
{
@@ -51,7 +51,7 @@ class SVT_DLLPUBLIC SvRTFParser : public SvParser
int nOpenBrakets;
rtl_TextEncoding eCodeSet, eUNICodeSet;
- BYTE nUCharOverread;
+ sal_uInt8 nUCharOverread;
private:
static short _inSkipGroup;
@@ -77,7 +77,7 @@ protected:
void SetUNICodeSet( rtl_TextEncoding eSet ) { eUNICodeSet = eSet; }
public:
- SvRTFParser( SvStream& rIn, BYTE nStackSize = 3 );
+ SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
virtual SvParserState CallParser(); // Aufruf des Parsers
diff --git a/svtools/inc/prgsbar.hxx b/svtools/inc/svtools/prgsbar.hxx
index 88ce944174b7..b55955cf0462 100644
--- a/svtools/inc/prgsbar.hxx
+++ b/svtools/inc/svtools/prgsbar.hxx
@@ -73,15 +73,15 @@ private:
Point maPos;
long mnPrgsWidth;
long mnPrgsHeight;
- USHORT mnPercent;
- USHORT mnPercentCount;
- BOOL mbCalcNew;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbCalcNew;
#ifdef _SV_PRGSBAR_CXX
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
- SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SVT_DLLPRIVATE void ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
#endif
public:
@@ -94,8 +94,8 @@ public:
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void SetValue( USHORT nNewPercent );
- USHORT GetValue() const { return mnPercent; }
+ void SetValue( sal_uInt16 nNewPercent );
+ sal_uInt16 GetValue() const { return mnPercent; }
};
#endif // _PRGSBAR_HXX
diff --git a/svtools/inc/svtools/printdlg.hxx b/svtools/inc/svtools/printdlg.hxx
deleted file mode 100644
index 575dc2830134..000000000000
--- a/svtools/inc/svtools/printdlg.hxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_PRINTDLG_HXX_
-#define _SV_PRINTDLG_HXX_
-
-#include "svtools/svtdllapi.h"
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-#include <svtools/stdctrl.hxx>
-
-class Printer;
-class QueueInfo;
-struct SvtPrinterImpl;
-
-// ---------------------
-// - PrintDialog-Types -
-// ---------------------
-
-enum PrintDialogRange{
- PRINTDIALOG_ALL, PRINTDIALOG_SELECTION, PRINTDIALOG_FROMTO, PRINTDIALOG_RANGE };
-
-enum PrintSheetRange
-{
- PRINTSHEETS_ALL,
- PRINTSHEETS_SELECTED_SHEETS,
- PRINTSHEETS_SELECTED_CELLS
-};
-
-
-// ---------------
-// - PrintDialog -
-// ---------------
-
-class SVT_DLLPUBLIC PrintDialog : public ModalDialog
-{
-private:
- FixedLine maFlPrinter;
- FixedText maFtName;
- ListBox maLbName;
- PushButton maBtnProperties;
- FixedText maFtStatus;
- FixedInfo maFiStatus;
- FixedText maFtType;
- FixedInfo maFiType;
- FixedText maFtLocation;
- FixedInfo maFiLocation;
- FixedText maFtComment;
- FixedInfo maFiComment;
-
- // "Print to file" or "Fax number"
- CheckBox maCbxFilePrint;
- FixedInfo maFiPrintFile;
- FixedText maFiFaxNo;
- Edit maEdtFaxNo;
- //PushButton maBtnBrowse_nomore;
-
- // "Print"
- FixedLine maFlPrint;
- RadioButton maRbtAllSheets;
- RadioButton maRbtSelectedSheets;
- RadioButton maRbtSelectedCells;
-
- // "Print range"
- FixedLine maFlPrintRange;
- RadioButton maRbtAll;
- RadioButton maRbtPages;
- RadioButton maRbtSelection;
- Edit maEdtPages;
-
- FixedLine maFlSepCopiesRange;
-
- // "Copies"
- FixedLine maFlCopies;
- FixedText maFtCopies;
- NumericField maNumCopies;
- FixedImage maImgCollate;
- FixedImage maImgNotCollate;
- CheckBox maCbxCollate;
-
- FixedLine maFlSepButtonLine;
- PushButton maBtnOptions;
- OKButton maBtnOK;
- CancelButton maBtnCancel;
- HelpButton maBtnHelp;
-
- AutoTimer maStatusTimer;
- Printer* mpPrinter;
- SvtPrinterImpl* mpPrinterImpl;
-
- XubString maRangeText;
- USHORT mnCopyCount;
- USHORT mnFirstPage;
- USHORT mnLastPage;
- USHORT mnMinPage;
- USHORT mnMaxPage;
- PrintDialogRange meCheckRange;
- BOOL mbAll;
- BOOL mbSelection;
- BOOL mbFromTo;
- BOOL mbRange;
- BOOL mbCollate;
- BOOL mbCollateCheck;
- BOOL mbOptions;
- bool mbWithSheetsAndCells;
- Link maOptionsHdlLink; // Link zum Options-Handler
- Link maOKHdlLink; // Link zum OK-Handler
-
- String maAllFilterStr;
-
- SVT_DLLPRIVATE void ImplCheckOK();
- SVT_DLLPRIVATE void ImplInitControls();
- SVT_DLLPRIVATE void ImplFillDialogData();
- SVT_DLLPRIVATE void ImplSetInfo();
- SVT_DLLPRIVATE void ImplSetImages();
- SVT_DLLPRIVATE bool ImplGetFilename();
-
- DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplModifyControlHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* );
-
-public:
- PrintDialog( Window* pWindow, bool bWithSheetsAndCells );
- ~PrintDialog();
-
- virtual long OK();
- virtual long ClickOptionsHdl();
-
- void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
- Printer* GetPrinter() const { return mpPrinter; }
-
- inline bool IsSheetRangeAvailable() const { return mbWithSheetsAndCells; }
- void EnableSheetRange( bool bEnable, PrintSheetRange eRange );
- bool IsSheetRangeEnabled( PrintSheetRange eRange ) const;
- void CheckSheetRange( PrintSheetRange eRange );
- PrintSheetRange GetCheckedSheetRange() const;
- bool IsSheetRangeChecked( PrintSheetRange eRange ) const;
-
- void EnableRange( PrintDialogRange eRange );
- void DisableRange( PrintDialogRange eRange );
- BOOL IsRangeEnabled( PrintDialogRange eRange ) const;
-
- void CheckRange( PrintDialogRange eRange = PRINTDIALOG_ALL )
- { meCheckRange = eRange; }
- PrintDialogRange GetCheckedRange() const { return meCheckRange; }
- BOOL IsRangeChecked( PrintDialogRange eRange ) const;
-
- void SetRangeText( const XubString& rRange ) { maRangeText = rRange; }
- const XubString& GetRangeText() const { return maRangeText; }
-
- void SetFirstPage( USHORT nPage = 0 );
- USHORT GetFirstPage() const { return mnFirstPage; }
- void SetLastPage( USHORT nPage = 0 );
- USHORT GetLastPage() const { return mnLastPage; }
-
- void SetMinPage( USHORT nPage = 1 ) { mnMinPage = nPage; }
- USHORT GetMinPage() const { return mnMinPage; }
- void SetMaxPage( USHORT nPage = 65535 ) { mnMaxPage = nPage; }
- USHORT GetMaxPage() const { return mnMaxPage; }
-
- void SetCopyCount( USHORT nCopies = 1 ) { mnCopyCount = nCopies; }
- USHORT GetCopyCount() const { return mnCopyCount; }
-
- void EnableCollate( BOOL bEnable = TRUE )
- { mbCollate = bEnable; }
- BOOL IsCollateEnabled() const { return mbCollate; }
- void CheckCollate( BOOL bCheck = TRUE )
- { mbCollateCheck = bCheck; }
- BOOL IsCollateChecked() const { return mbCollateCheck; }
-
- void ShowOptionsButton( BOOL bShow = TRUE )
- { mbOptions = bShow; }
- BOOL IsOptionsButtonVisible() const { return mbOptions; }
-
- void SetOptionsHdl( const Link& rLink ) { maOptionsHdlLink = rLink; }
- const Link& GetOptionsHdl() const { return maOptionsHdlLink; }
-
- void SetOKHdl( const Link& rLink ) { maOKHdlLink = rLink; }
- const Link& GetOKHdl() const { return maOKHdlLink; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual long Notify( NotifyEvent& rNEvt );
-
- virtual short Execute();
-
- void DisableHelp();
-};
-
-inline void PrintDialog::EnableRange( PrintDialogRange eRange )
-{
- if ( eRange == PRINTDIALOG_ALL )
- mbAll = TRUE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- mbSelection = TRUE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- mbFromTo = TRUE;
- else
- mbRange = TRUE;
-}
-
-inline void PrintDialog::DisableRange( PrintDialogRange eRange )
-{
- if ( eRange == PRINTDIALOG_ALL )
- mbAll = FALSE;
- else if ( eRange == PRINTDIALOG_SELECTION )
- mbSelection = FALSE;
- else if ( eRange == PRINTDIALOG_FROMTO )
- mbFromTo = FALSE;
- else
- mbRange = FALSE;
-}
-
-inline BOOL PrintDialog::IsRangeEnabled( PrintDialogRange eRange ) const
-{
- BOOL bRet;
-
- if ( eRange == PRINTDIALOG_ALL )
- bRet = mbAll;
- else if ( eRange == PRINTDIALOG_SELECTION )
- bRet = mbSelection;
- else if ( eRange == PRINTDIALOG_FROMTO )
- bRet = mbFromTo;
- else
- bRet = mbRange;
-
- return bRet;
-}
-
-inline BOOL PrintDialog::IsRangeChecked( PrintDialogRange eRange ) const
-{
- if ( eRange == meCheckRange )
- return TRUE;
- else
- return FALSE;
-}
-
-inline void PrintDialog::SetFirstPage( USHORT nPage )
-{
- mnFirstPage = nPage;
- if ( nPage && (nPage < mnMinPage) )
- mnMinPage = nPage;
-}
-
-inline void PrintDialog::SetLastPage( USHORT nPage )
-{
- mnLastPage = nPage;
- if ( nPage && (nPage > mnMaxPage) )
- mnMaxPage = nPage;
-}
-
-#endif // _SV_PRINTDLG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/inc/svtools/prnsetup.hxx b/svtools/inc/svtools/prnsetup.hxx
index 46542b9081e9..a7155032a238 100644
--- a/svtools/inc/svtools/prnsetup.hxx
+++ b/svtools/inc/svtools/prnsetup.hxx
@@ -101,7 +101,7 @@ public:
void ImplFillPrnDlgListBox( const Printer* pPrinter,
ListBox* pBox, PushButton* pPropBtn );
-void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear = TRUE );
+void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear = sal_True );
Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
Printer* pPrinter, Printer* pTempPrinter );
Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter );
diff --git a/svtools/inc/roadmap.hxx b/svtools/inc/svtools/roadmap.hxx
index 988af84294c0..988af84294c0 100644
--- a/svtools/inc/roadmap.hxx
+++ b/svtools/inc/svtools/roadmap.hxx
diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx
index 6dd2b5302987..76a8587beedd 100644
--- a/svtools/inc/svtools/roadmapwizard.hxx
+++ b/svtools/inc/svtools/roadmapwizard.hxx
@@ -91,8 +91,8 @@ namespace svt
void SetRoadmapBitmap( const BitmapEx& _rBitmap );
const BitmapEx& GetRoadmapBitmap( ) const;
- void SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode = SMART_SET_SMART );
- SmartId GetRoadmapSmartHelpId() const;
+ void SetRoadmapHelpId( const rtl::OString& _rId );
+ const rtl::OString& GetRoadmapHelpId() const;
void SetRoadmapInteractive( sal_Bool _bInteractive );
sal_Bool IsRoadmapInteractive();
diff --git a/svtools/inc/rtfkeywd.hxx b/svtools/inc/svtools/rtfkeywd.hxx
index b9ad75ae8e32..b9ad75ae8e32 100644
--- a/svtools/inc/rtfkeywd.hxx
+++ b/svtools/inc/svtools/rtfkeywd.hxx
diff --git a/svtools/inc/rtfout.hxx b/svtools/inc/svtools/rtfout.hxx
index 71a0475a91b1..b8b3c400103a 100644
--- a/svtools/inc/rtfout.hxx
+++ b/svtools/inc/svtools/rtfout.hxx
@@ -40,7 +40,7 @@ class SvStream;
class SVT_DLLPUBLIC RTFOutFuncs
{
public:
-#if defined(MAC) || defined(UNX)
+#if defined(UNX)
static const sal_Char sNewLine; // nur \012 oder \015
#else
static const sal_Char sNewLine[]; // \015\012
@@ -49,15 +49,15 @@ public:
static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
int *pUCMode,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
- BOOL bWriteHelpFile = FALSE );
+ sal_Bool bWriteHelpFile = sal_False );
static SvStream& Out_String( SvStream&, const String&,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
- BOOL bWriteHelpFile = FALSE );
+ sal_Bool bWriteHelpFile = sal_False );
static SvStream& Out_Fontname( SvStream&, const String&,
rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
- BOOL bWriteHelpFile = FALSE );
+ sal_Bool bWriteHelpFile = sal_False );
- static SvStream& Out_Hex( SvStream&, ULONG nHex, BYTE nLen );
+ static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen );
};
diff --git a/svtools/inc/rtftoken.h b/svtools/inc/svtools/rtftoken.h
index d7dda804a8d7..d7dda804a8d7 100644
--- a/svtools/inc/rtftoken.h
+++ b/svtools/inc/svtools/rtftoken.h
diff --git a/svtools/inc/ruler.hxx b/svtools/inc/svtools/ruler.hxx
index 2e8a4f6a53b6..ba04f9342525 100644
--- a/svtools/inc/ruler.hxx
+++ b/svtools/inc/svtools/ruler.hxx
@@ -129,7 +129,7 @@ bottom/right margin. If these methods are called whithout arguments,
no margins are displayed. Otherwise, the following arguments can be passed:
long nPos - offset in pixels relative to the origin
- USHORT nStyle - bit style:
+ sal_uInt16 nStyle - bit style:
RULER_MARGIN_SIZEABLE
margin size can be changed
@@ -144,7 +144,7 @@ has to be passed. In the array, the following values have to be initialized:
long nPos - offset in pixels relative to the origin
long nWidth - column spacing in pixels (can also be 0, for example,
for table columns)
- USHORT nStyle - bit style:
+ sal_uInt16 nStyle - bit style:
RULER_BORDER_SIZEABLE
Column spacing can be changed. This flag should
only be set if the size of the spacing is changed,
@@ -176,7 +176,7 @@ rulers. A Ruler Indent must be passed as an argument, with the following values
initialized:
long nPos - offset relative to the origin in pixels
- USHORT nStyle - bit style:
+ sal_uInt16 nStyle - bit style:
RULER_INDENT_TOP (indent of the first line)
RULER_INDENT_BOTTOM (left/right indent)
RULER_INDENT_BORDER (Vertical line that shows the border distance)
@@ -191,7 +191,7 @@ An array of type RulerTab must be passed as an argument, with the following valu
initialized:
long nPos - offset relative to the origin in pixels
- USHORT nStyle - bit style:
+ sal_uInt16 nStyle - bit style:
RULER_TAB_DEFAULT (can't be selected)
RULER_TAB_LEFT
RULER_TAB_CENTER
@@ -207,7 +207,7 @@ SetLines() displays position lines in the ruler. An array of type RulerLine must
the following values initialized:
long nPos - offset relative to the origin in pixels
- USHORT nStyle - bit style (has to be 0 currently)
+ sal_uInt16 nStyle - bit style (has to be 0 currently)
SetArrows() displays dimension arrows in the ruler. With dimension arrows set
no subdivisions will be shown any more in the ruler. Therefore, dimension
@@ -217,7 +217,7 @@ must be passed with the following values initialized:
long nPos - offset relative to the origin in pixels
long nWidth - the arrow's width
long nLogWidth - the arrow's width in logical unit
- USHORT nStyle - bit style (has to be 0 currently)
+ sal_uInt16 nStyle - bit style (has to be 0 currently)
SetSourceUnit() sets the unit in which the logical values are given that are
passed to SetArrows(). The only units accepted are MAP_TWIP and MAP_100TH_MM.
@@ -303,7 +303,7 @@ it has been dragged. There are the following query methods:
gezogen, werden automatisch die alten Werte dargestellt, ohne das
der Drag-Handler gerufen wird.
Falls der Benutzer jedoch den Wert auf die alte Position
- zurueckgeschoben hat, liefert die Methode trotzdem FALSE. Falls
+ zurueckgeschoben hat, liefert die Methode trotzdem sal_False. Falls
dies vermieden werden soll, muss sich die Applikation im StartDrag-
Handler den alten Wert merken und im EndDrag-Handler den Wert
vergleichen.
@@ -350,7 +350,7 @@ it has been dragged. There are the following query methods:
gegebenenfalls ueber das Abfangen des MouseButtonDown-Handlers
auch ueber die rechte Maustaste etwas auf ein Item anzuwenden. Als
Paramter ueber gibt man die Fensterposition und gegebenenfalls
- einen Pointer auf einen USHORT, um die Array-Position eines
+ einen Pointer auf einen sal_uInt16, um die Array-Position eines
Tabs, Indent oder Borders mitzubekommen. Als Type werden folgende
Werte zurueckgegeben:
RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
@@ -366,7 +366,7 @@ mit CancelDrag() abgebrochen werden. Folgende Methoden gibt es fuer die
Drag-Steuerung:
- IsDrag()
- Liefert TRUE zurueck, wenn sich das Lineal im Drag-Vorgang befindet.
+ Liefert sal_True zurueck, wenn sich das Lineal im Drag-Vorgang befindet.
- CancelDrag()
Bricht den Drag-Vorgang ab, falls einer durchgefuehrt wird. Dabei
@@ -421,7 +421,7 @@ womit man bestimmte Aktionen abfangen kann.
RULER_EXTRA_DONTKNOW (Nichts)
RULER_EXTRA_NULLOFFSET (Koordinaaten-Kreuz)
RULER_EXTRA_TAB (Tab)
- - USHORT nStyle Bitfeld als Style:
+ - sal_uInt16 nStyle Bitfeld als Style:
RULER_STYLE_HIGHLIGHT (selektiert)
RULER_TAB_... (ein Tab-Style)
@@ -531,9 +531,9 @@ enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
enum RulerExtra { RULER_EXTRA_DONTKNOW,
RULER_EXTRA_NULLOFFSET, RULER_EXTRA_TAB };
-#define RULER_STYLE_HIGHLIGHT ((USHORT)0x8000)
-#define RULER_STYLE_DONTKNOW ((USHORT)0x4000)
-#define RULER_STYLE_INVISIBLE ((USHORT)0x2000)
+#define RULER_STYLE_HIGHLIGHT ((sal_uInt16)0x8000)
+#define RULER_STYLE_DONTKNOW ((sal_uInt16)0x4000)
+#define RULER_STYLE_INVISIBLE ((sal_uInt16)0x2000)
#define RULER_DRAGSIZE_MOVE 0
#define RULER_DRAGSIZE_1 1
@@ -552,24 +552,24 @@ enum RulerExtra { RULER_EXTRA_DONTKNOW,
// - RulerMargin -
// ---------------
-#define RULER_MARGIN_SIZEABLE ((USHORT)0x0001)
+#define RULER_MARGIN_SIZEABLE ((sal_uInt16)0x0001)
// ---------------
// - RulerBorder -
// ---------------
-#define RULER_BORDER_SIZEABLE ((USHORT)0x0001)
-#define RULER_BORDER_MOVEABLE ((USHORT)0x0002)
-#define RULER_BORDER_VARIABLE ((USHORT)0x0004)
-#define RULER_BORDER_TABLE ((USHORT)0x0008)
-#define RULER_BORDER_SNAP ((USHORT)0x0010)
-#define RULER_BORDER_MARGIN ((USHORT)0x0020)
+#define RULER_BORDER_SIZEABLE ((sal_uInt16)0x0001)
+#define RULER_BORDER_MOVEABLE ((sal_uInt16)0x0002)
+#define RULER_BORDER_VARIABLE ((sal_uInt16)0x0004)
+#define RULER_BORDER_TABLE ((sal_uInt16)0x0008)
+#define RULER_BORDER_SNAP ((sal_uInt16)0x0010)
+#define RULER_BORDER_MARGIN ((sal_uInt16)0x0020)
struct RulerBorder
{
long nPos;
long nWidth;
- USHORT nStyle;
+ sal_uInt16 nStyle;
//minimum/maximum position, supported for table borders/rows
long nMinPos;
long nMaxPos;
@@ -579,33 +579,33 @@ struct RulerBorder
// - RulerIndent -
// ---------------
-#define RULER_INDENT_TOP ((USHORT)0x0000)
-#define RULER_INDENT_BOTTOM ((USHORT)0x0001)
-#define RULER_INDENT_BORDER ((USHORT)0x0002)
-#define RULER_INDENT_STYLE ((USHORT)0x000F)
+#define RULER_INDENT_TOP ((sal_uInt16)0x0000)
+#define RULER_INDENT_BOTTOM ((sal_uInt16)0x0001)
+#define RULER_INDENT_BORDER ((sal_uInt16)0x0002)
+#define RULER_INDENT_STYLE ((sal_uInt16)0x000F)
struct RulerIndent
{
long nPos;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
// ------------
// - RulerTab -
// ------------
-#define RULER_TAB_LEFT ((USHORT)0x0000)
-#define RULER_TAB_RIGHT ((USHORT)0x0001)
-#define RULER_TAB_DECIMAL ((USHORT)0x0002)
-#define RULER_TAB_CENTER ((USHORT)0x0003)
-#define RULER_TAB_DEFAULT ((USHORT)0x0004)
-#define RULER_TAB_STYLE ((USHORT)0x000F)
-#define RULER_TAB_RTL ((USHORT)0x0010)
+#define RULER_TAB_LEFT ((sal_uInt16)0x0000)
+#define RULER_TAB_RIGHT ((sal_uInt16)0x0001)
+#define RULER_TAB_DECIMAL ((sal_uInt16)0x0002)
+#define RULER_TAB_CENTER ((sal_uInt16)0x0003)
+#define RULER_TAB_DEFAULT ((sal_uInt16)0x0004)
+#define RULER_TAB_STYLE ((sal_uInt16)0x000F)
+#define RULER_TAB_RTL ((sal_uInt16)0x0010)
struct RulerTab
{
long nPos;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
#define RULER_TAB_WIDTH 7
@@ -618,7 +618,7 @@ struct RulerTab
struct RulerLine
{
long nPos;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
// --------------
@@ -630,7 +630,7 @@ struct RulerArrow
long nPos;
long nWidth;
long nLogWidth;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
class ImplRulerData;
@@ -654,20 +654,20 @@ private:
long mnBorderWidth;
long mnStartDragPos;
long mnDragPos;
- ULONG mnUpdateEvtId;
+ sal_uLong mnUpdateEvtId;
ImplRulerData* mpSaveData;
ImplRulerData* mpData;
ImplRulerData* mpDragData;
Rectangle maExtraRect;
WinBits mnWinStyle;
- USHORT mnUnitIndex;
- USHORT mnDragAryPos;
- USHORT mnDragSize;
- USHORT mnDragScroll;
- USHORT mnDragModifier;
- USHORT mnExtraStyle;
- USHORT mnExtraClicks;
- USHORT mnExtraModifier;
+ sal_uInt16 mnUnitIndex;
+ sal_uInt16 mnDragAryPos;
+ sal_uInt16 mnDragSize;
+ sal_uInt16 mnDragScroll;
+ sal_uInt16 mnDragModifier;
+ sal_uInt16 mnExtraStyle;
+ sal_uInt16 mnExtraClicks;
+ sal_uInt16 mnExtraModifier;
// Amelia
long mnCharWidth;
long mnLineHeight;
@@ -677,14 +677,14 @@ private:
MapUnit meSourceUnit;
FieldUnit meUnit;
Fraction maZoom;
- BOOL mbCalc;
- BOOL mbFormat;
- BOOL mbDrag;
- BOOL mbDragDelete;
- BOOL mbDragCanceled;
- BOOL mbAutoWinWidth;
- BOOL mbActive;
- BYTE mnUpdateFlags;
+ sal_Bool mbCalc;
+ sal_Bool mbFormat;
+ sal_Bool mbDrag;
+ sal_Bool mbDragDelete;
+ sal_Bool mbDragCanceled;
+ sal_Bool mbAutoWinWidth;
+ sal_Bool mbActive;
+ sal_uInt8 mnUpdateFlags;
Link maStartDragHdl;
Link maDragHdl;
Link maEndDragHdl;
@@ -700,27 +700,27 @@ private:
SVT_DLLPRIVATE void ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter );
SVT_DLLPRIVATE void ImplDrawArrows( long nCenter );
SVT_DLLPRIVATE void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom );
- SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, USHORT nStyle );
+ SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle );
SVT_DLLPRIVATE void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom );
- SVT_DLLPRIVATE void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle );
+ SVT_DLLPRIVATE void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle );
SVT_DLLPRIVATE void ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom );
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinBits );
- SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SVT_DLLPRIVATE void ImplCalc();
SVT_DLLPRIVATE void ImplFormat();
- SVT_DLLPRIVATE void ImplInitExtraField( BOOL bUpdate );
- SVT_DLLPRIVATE void ImplInvertLines( BOOL bErase = FALSE );
+ SVT_DLLPRIVATE void ImplInitExtraField( sal_Bool bUpdate );
+ SVT_DLLPRIVATE void ImplInvertLines( sal_Bool bErase = sal_False );
SVT_DLLPRIVATE void ImplDraw();
- SVT_DLLPRIVATE void ImplDrawExtra( BOOL bPaint = FALSE );
- SVT_DLLPRIVATE void ImplUpdate( BOOL bMustCalc = FALSE );
+ SVT_DLLPRIVATE void ImplDrawExtra( sal_Bool bPaint = sal_False );
+ SVT_DLLPRIVATE void ImplUpdate( sal_Bool bMustCalc = sal_False );
using Window::ImplHitTest;
- SVT_DLLPRIVATE BOOL ImplHitTest( const Point& rPos,
+ SVT_DLLPRIVATE sal_Bool ImplHitTest( const Point& rPos,
ImplRulerHitTest* pHitTest,
- BOOL bRequiredStyle = FALSE,
- USHORT nRequiredStyle = 0 ) const;
- SVT_DLLPRIVATE BOOL ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const;
- SVT_DLLPRIVATE BOOL ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier );
+ sal_Bool bRequiredStyle = sal_False,
+ sal_uInt16 nRequiredStyle = 0 ) const;
+ SVT_DLLPRIVATE sal_Bool ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const;
+ SVT_DLLPRIVATE sal_Bool ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier );
SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
SVT_DLLPRIVATE void ImplEndDrag();
DECL_DLLPRIVATE_LINK( ImplUpdateHdl, void* );
@@ -751,7 +751,7 @@ public:
void Activate();
void Deactivate();
- BOOL IsActive() const { return mbActive; }
+ sal_Bool IsActive() const { return mbActive; }
void SetWinPos( long nOff = 0, long nWidth = 0 );
long GetWinOffset() const { return mnWinOff; }
@@ -771,67 +771,67 @@ public:
void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
MapUnit GetSourceUnit() const { return meSourceUnit; }
- void SetExtraType( RulerExtra eNewExtraType, USHORT nStyle = 0 );
+ void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 );
RulerExtra GetExtraType() const { return meExtraType; }
- USHORT GetExtraStyle() const { return mnExtraStyle; }
- USHORT GetExtraClicks() const { return mnExtraClicks; }
- USHORT GetExtraModifier() const { return mnExtraModifier; }
+ sal_uInt16 GetExtraStyle() const { return mnExtraStyle; }
+ sal_uInt16 GetExtraClicks() const { return mnExtraClicks; }
+ sal_uInt16 GetExtraModifier() const { return mnExtraModifier; }
- BOOL StartDocDrag( const MouseEvent& rMEvt,
+ sal_Bool StartDocDrag( const MouseEvent& rMEvt,
RulerType eDragType = RULER_TYPE_DONTKNOW );
RulerType GetDocType( const Point& rPos,
RulerType eDragType = RULER_TYPE_DONTKNOW,
- USHORT* pAryPos = NULL ) const;
+ sal_uInt16* pAryPos = NULL ) const;
RulerType GetDragType() const { return meDragType; }
long GetDragPos() const { return mnDragPos; }
- USHORT GetDragAryPos() const { return mnDragAryPos; }
- USHORT GetDragSize() const { return mnDragSize; }
- BOOL IsDragDelete() const { return mbDragDelete; }
- BOOL IsDragCanceled() const { return mbDragCanceled; }
- USHORT GetDragScroll() const { return mnDragScroll; }
- USHORT GetDragModifier() const { return mnDragModifier; }
- BOOL IsDrag() const { return mbDrag; }
+ sal_uInt16 GetDragAryPos() const { return mnDragAryPos; }
+ sal_uInt16 GetDragSize() const { return mnDragSize; }
+ sal_Bool IsDragDelete() const { return mbDragDelete; }
+ sal_Bool IsDragCanceled() const { return mbDragCanceled; }
+ sal_uInt16 GetDragScroll() const { return mnDragScroll; }
+ sal_uInt16 GetDragModifier() const { return mnDragModifier; }
+ sal_Bool IsDrag() const { return mbDrag; }
void CancelDrag();
long GetClickPos() const { return mnDragPos; }
RulerType GetClickType() const { return meDragType; }
- USHORT GetClickAryPos() const { return mnDragAryPos; }
+ sal_uInt16 GetClickAryPos() const { return mnDragAryPos; }
using Window::GetType;
RulerType GetType( const Point& rPos,
- USHORT* pAryPos = NULL ) const;
+ sal_uInt16* pAryPos = NULL ) const;
void SetNullOffset( long nPos );
long GetNullOffset() const;
void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); }
- void SetMargin1( long nPos, USHORT nMarginStyle = RULER_MARGIN_SIZEABLE );
+ void SetMargin1( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
long GetMargin1() const;
- USHORT GetMargin1Style() const;
+ sal_uInt16 GetMargin1Style() const;
void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); }
- void SetMargin2( long nPos, USHORT nMarginStyle = RULER_MARGIN_SIZEABLE );
+ void SetMargin2( long nPos, sal_uInt16 nMarginStyle = RULER_MARGIN_SIZEABLE );
long GetMargin2() const;
- USHORT GetMargin2Style() const;
+ sal_uInt16 GetMargin2Style() const;
- void SetLines( USHORT n = 0, const RulerLine* pLineAry = NULL );
- USHORT GetLineCount() const;
+ void SetLines( sal_uInt16 n = 0, const RulerLine* pLineAry = NULL );
+ sal_uInt16 GetLineCount() const;
const RulerLine* GetLines() const;
- void SetArrows( USHORT n = 0, const RulerArrow* pArrowAry = NULL );
- USHORT GetArrowCount() const;
+ void SetArrows( sal_uInt16 n = 0, const RulerArrow* pArrowAry = NULL );
+ sal_uInt16 GetArrowCount() const;
const RulerArrow* GetArrows() const;
- void SetBorders( USHORT n = 0, const RulerBorder* pBrdAry = NULL );
- USHORT GetBorderCount() const;
+ void SetBorders( sal_uInt16 n = 0, const RulerBorder* pBrdAry = NULL );
+ sal_uInt16 GetBorderCount() const;
const RulerBorder* GetBorders() const;
- void SetIndents( USHORT n = 0, const RulerIndent* pIndentAry = NULL );
- USHORT GetIndentCount() const;
+ void SetIndents( sal_uInt16 n = 0, const RulerIndent* pIndentAry = NULL );
+ sal_uInt16 GetIndentCount() const;
const RulerIndent* GetIndents() const;
- void SetTabs( USHORT n = 0, const RulerTab* pTabAry = NULL );
- USHORT GetTabCount() const;
+ void SetTabs( sal_uInt16 n = 0, const RulerTab* pTabAry = NULL );
+ sal_uInt16 GetTabCount() const;
const RulerTab* GetTabs() const;
static void DrawTab( OutputDevice* pDevice,
- const Point& rPos, USHORT nStyle );
+ const Point& rPos, sal_uInt16 nStyle );
void SetStyle( WinBits nStyle );
WinBits GetStyle() const { return mnWinStyle; }
@@ -850,7 +850,7 @@ public:
const Link& GetExtraDownHdl() const { return maExtraDownHdl; }
//set text direction right-to-left
- void SetTextRTL(BOOL bRTL);
+ void SetTextRTL(sal_Bool bRTL);
void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
diff --git a/svtools/inc/scriptedtext.hxx b/svtools/inc/svtools/scriptedtext.hxx
index bbca120ef017..bbca120ef017 100644
--- a/svtools/inc/scriptedtext.hxx
+++ b/svtools/inc/svtools/scriptedtext.hxx
diff --git a/svtools/inc/scrwin.hxx b/svtools/inc/svtools/scrwin.hxx
index ba5291c7f8c7..f81b60d446de 100644
--- a/svtools/inc/scrwin.hxx
+++ b/svtools/inc/svtools/scrwin.hxx
@@ -39,7 +39,7 @@ class DataChangedEvent;
// - ScrollableWindow-Type -
// -------------------------
-typedef USHORT ScrollableWindowFlags;
+typedef sal_uInt16 ScrollableWindowFlags;
#define SCRWIN_THUMBDRAGGING 1
#define SCRWIN_VCENTER 2
@@ -61,7 +61,7 @@ private:
ScrollBar aVScroll; // the scrollbars
ScrollBar aHScroll;
ScrollBarBox aCornerWin; // window in the bottom right corner
- BOOL bScrolling:1, // user controlled scrolling
+ sal_Bool bScrolling:1, // user controlled scrolling
bHandleDragging:1, // scroll window while dragging
bHCenter:1,
bVCenter:1;
@@ -93,15 +93,15 @@ public:
Size GetTotalSize() { return PixelToLogic( aTotPixSz ); }
void SetVisibleSize( const Size& rNewSize );
- BOOL MakeVisible( const Rectangle& rTarget, BOOL bSloppy = FALSE );
+ sal_Bool MakeVisible( const Rectangle& rTarget, sal_Bool bSloppy = sal_False );
Rectangle GetVisibleArea() const;
- void SetLineSize( ULONG nHorz, ULONG nVert );
+ void SetLineSize( sal_uLong nHorz, sal_uLong nVert );
using Window::Scroll;
- virtual void Scroll( long nDeltaX, long nDeltaY, USHORT nFlags = 0 );
+ virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 );
void ScrollLines( long nLinesX, long nLinesY );
- void ScrollPages( long nPagesX, ULONG nOverlapX,
- long nPagesY, ULONG nOverlapY );
+ void ScrollPages( long nPagesX, sal_uLong nOverlapX,
+ long nPagesY, sal_uLong nOverlapY );
private:
SVT_DLLPRIVATE Size GetOutputSizePixel() const;
diff --git a/svtools/inc/sfxecode.hxx b/svtools/inc/svtools/sfxecode.hxx
index 1ac67e909b69..1ac67e909b69 100644
--- a/svtools/inc/sfxecode.hxx
+++ b/svtools/inc/svtools/sfxecode.hxx
diff --git a/svtools/inc/soerr.hxx b/svtools/inc/svtools/soerr.hxx
index 05d3100f8f4e..05d3100f8f4e 100644
--- a/svtools/inc/soerr.hxx
+++ b/svtools/inc/svtools/soerr.hxx
diff --git a/svtools/inc/sores.hxx b/svtools/inc/svtools/sores.hxx
index 1b19a2c8144c..1b19a2c8144c 100644
--- a/svtools/inc/sores.hxx
+++ b/svtools/inc/svtools/sores.hxx
diff --git a/svtools/inc/statusbarcontroller.hxx b/svtools/inc/svtools/statusbarcontroller.hxx
index 0703a87f4d06..0703a87f4d06 100644
--- a/svtools/inc/statusbarcontroller.hxx
+++ b/svtools/inc/svtools/statusbarcontroller.hxx
diff --git a/svtools/inc/stdmenu.hxx b/svtools/inc/svtools/stdmenu.hxx
index 2ccb6cd59605..d14a42e6a7b5 100644
--- a/svtools/inc/stdmenu.hxx
+++ b/svtools/inc/svtools/stdmenu.hxx
@@ -188,7 +188,7 @@ private:
Link maSelectHdl;
Link maHighlightHdl;
- SVT_DLLPRIVATE BOOL ImplIsAlreadyInserted( const XubString& rStyleName, USHORT nCount );
+ SVT_DLLPRIVATE sal_Bool ImplIsAlreadyInserted( const XubString& rStyleName, sal_uInt16 nCount );
public:
FontStyleMenu();
diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx
index 1153b125c9e9..30773b101547 100644
--- a/svtools/inc/svtools/svicnvw.hxx
+++ b/svtools/inc/svtools/svicnvw.hxx
@@ -61,20 +61,20 @@ enum SvIconViewTextMode
class SvIcnVwDataEntry : public SvViewDataEntry
{
friend class SvImpIconView;
- USHORT nIcnVwFlags;
+ sal_uInt16 nIcnVwFlags;
SvIconViewTextMode eTextMode;
public:
Rectangle aRect; // Bounding-Rect of the Entry
Rectangle aGridRect; // set in grid mode
Size aTextSize; // set in grid mode only
- USHORT nX,nY; // for keyboard control
+ sal_uInt16 nX,nY; // for keyboard control
SvIcnVwDataEntry();
virtual ~SvIcnVwDataEntry();
- BOOL IsEntryPosLocked() const { return (BOOL)((nIcnVwFlags & ICNVW_FLAG_POS_LOCKED) !=0); }
- void ClearVwFlags( USHORT nMask ) { nIcnVwFlags &= (~nMask); }
- void SetVwFlags( USHORT nMask ) { nIcnVwFlags |= nMask; }
- USHORT GetVwFlags() const { return nIcnVwFlags; }
+ sal_Bool IsEntryPosLocked() const { return (sal_Bool)((nIcnVwFlags & ICNVW_FLAG_POS_LOCKED) !=0); }
+ void ClearVwFlags( sal_uInt16 nMask ) { nIcnVwFlags &= (~nMask); }
+ void SetVwFlags( sal_uInt16 nMask ) { nIcnVwFlags |= nMask; }
+ sal_uInt16 GetVwFlags() const { return nIcnVwFlags; }
SvIconViewTextMode GetTextMode() const { return eTextMode; }
};
@@ -87,8 +87,7 @@ class SvIconView : public SvLBox
SvImpIconView* pImp;
Image aCollapsedEntryBmp;
Image aExpandedEntryBmp;
- WinBits nWinBits;
- USHORT nIcnVwFlags;
+ sal_uInt16 nIcnVwFlags;
void SetModel( SvLBoxTreeList* );
protected:
@@ -109,6 +108,7 @@ protected:
virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
virtual void Command( const CommandEvent& rCEvt );
virtual void PreparePaint( SvLBoxEntry* );
+ virtual void StateChanged( StateChangedType nStateChange );
public:
@@ -119,15 +119,15 @@ public:
void DisconnectFromModel();
SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos=LIST_APPEND );
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND );
SvLBoxEntry* InsertEntry( const XubString& rText,
const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp,
SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos = LIST_APPEND );
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND );
const Image& GetDefaultExpandedEntryBmp() const { return aExpandedEntryBmp;}
const Image& GetDefaultCollapsedEntryBmp() const { return aCollapsedEntryBmp;}
@@ -144,7 +144,7 @@ public:
virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
virtual void RequestingChilds( SvLBoxEntry* pParent );
@@ -156,7 +156,7 @@ public:
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
- void SetUpdateMode( BOOL );
+ void SetUpdateMode( sal_Bool );
using SvListView::SetModel;
virtual void SetModel( SvLBoxTreeList*, SvLBoxEntry* pParent );
@@ -164,44 +164,43 @@ public:
virtual void ModelHasInserted( SvListEntry* pEntry );
virtual void ModelHasInsertedTree( SvListEntry* pEntry );
virtual void ModelIsMoving(SvListEntry* pSource,
- SvListEntry* pTargetParent, ULONG nChildPos );
+ SvListEntry* pTargetParent, sal_uLong nChildPos );
virtual void ModelHasMoved(SvListEntry* pSource );
virtual void ModelIsRemoving( SvListEntry* pEntry );
virtual void ModelHasRemoved( SvListEntry* pEntry );
virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
- virtual void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ virtual void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
using Window::GetDropTarget;
virtual SvLBoxEntry* GetDropTarget( const Point& );
virtual Region GetDragRegion() const;
// NotifyMoving/Copying is overloaded, since GetDropTarget
// returns a "magic pointer" if the drop happens in/on an empty
// area(?) of the IconView
- virtual BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos);
- virtual BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos);
+ virtual sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos);
+ virtual sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos);
// returns TopLeft of the BoundingRect. Add MapMode.Origin to get the
// position relative to the window
Point GetEntryPosition( SvLBoxEntry* ) const;
void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos);
void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos,
- BOOL bAdjustAtGrid );
+ sal_Bool bAdjustAtGrid );
void SetFont( const Font& rFont );
void SetDefaultFont();
using SvLBox::GetEntry;
- SvLBoxEntry* GetEntry( const Point& rPixPos, BOOL ) const;
+ SvLBoxEntry* GetEntry( const Point& rPixPos, sal_Bool ) const;
// returns the entry just above pCurEntry (z-wise)
- SvLBoxEntry* GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const;
+ SvLBoxEntry* GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const;
// returns the entry just below pCurEntry (z-wise)
- SvLBoxEntry* GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const;
+ SvLBoxEntry* GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const;
SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const;
- void SetWindowBits( WinBits nWinStyle );
virtual void PaintEntry( SvLBoxEntry* );
virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos );
Rectangle GetFocusRect( SvLBoxEntry* );
@@ -212,8 +211,8 @@ public:
void SetSelectionMode( SelectionMode );
using SvListView::Select;
- BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
- void SelectAll( BOOL bSelect, BOOL bPaint=TRUE );
+ sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
+ void SelectAll( sal_Bool bSelect, sal_Bool bPaint=sal_True );
virtual void SetCurEntry( SvLBoxEntry* _pEntry );
virtual SvLBoxEntry*
GetCurEntry() const;
@@ -221,28 +220,28 @@ public:
// locigal coordinates
void SelectRect(
const Rectangle& rRect,
- BOOL bAdd = FALSE,
+ sal_Bool bAdd = sal_False,
// inverts the intersection with rRect
- // (ignored if bAdd == FALSE)
+ // (ignored if bAdd == sal_False)
SvPtrarr* pOtherRects = 0,
short nBorderOffs = -5 );
- ULONG GetSelectionCount() const;
+ sal_uLong GetSelectionCount() const;
virtual void Arrange();
void SetSpaceBetweenEntries( long nHor, long Ver );
long GetHorSpaceBetweenEntries();
long GetVerSpaceBetweenEntries();
- void EnableInplaceEditing( BOOL bEnable );
+ void EnableInplaceEditing( sal_Bool bEnable );
void EditEntry( SvLBoxEntry* pEntry = 0 );
- virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
- virtual BOOL EditedEntry( SvLBoxEntry*, const XubString& rNewText );
+ virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvLBoxEntry*, const XubString& rNewText );
void SetCurParent( SvLBoxEntry* pNewParent );
SvLBoxEntry* GetCurParent() const;
- virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos );
// pass (0, 0) to switch off grid mode
void SetGrid( long nDX, long nDY );
@@ -252,7 +251,7 @@ public:
// nDeltaX < 0 : View moves left relative to Doc
// nDeltaX > 0 : View moves right relative to Doc
using Window::Scroll;
- virtual void Scroll( long nDeltaX, long nDeltaY, USHORT nFlags = 0 );
+ virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 );
virtual void PrepareCommandEvent( const CommandEvent& );
virtual void StartDrag( sal_Int8 nAction, const Point& );
@@ -270,14 +269,14 @@ public:
const Point& rRefPosPixel,
long& rScrollX,
long& rScrollY,
- BOOL bInDragDrop = FALSE,
- USHORT nBorderWidth = 10 );
+ sal_Bool bInDragDrop = sal_False,
+ sal_uInt16 nBorderWidth = 10 );
using Window::EndTracking;
void EndTracking();
void AdjustAtGrid( SvLBoxEntry* pEntry = 0 );
- void LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock = TRUE );
- BOOL IsEntryPosLocked( const SvLBoxEntry* pEntry ) const;
+ void LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock = sal_True );
+ sal_Bool IsEntryPosLocked( const SvLBoxEntry* pEntry ) const;
void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 );
SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0 ) const;
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index 1f23481ff783..6ef90e9e7b97 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -63,11 +63,11 @@ private:
long nWidth;
long nHeight;
SvLBoxButtonData_Impl* pImpl;
- BOOL bDataOk;
+ sal_Bool bDataOk;
SvButtonState eState;
SVT_DLLPRIVATE void SetWidthAndHeight();
- SVT_DLLPRIVATE void InitData( BOOL bImagesFromDefault,
+ SVT_DLLPRIVATE void InitData( sal_Bool bImagesFromDefault,
bool _bRadioBtn, const Control* pControlForSettings = NULL );
public:
// include creating default images (CheckBox or RadioButton)
@@ -77,17 +77,17 @@ public:
SvLBoxButtonData();
~SvLBoxButtonData();
- USHORT GetIndex( USHORT nItemState );
+ sal_uInt16 GetIndex( sal_uInt16 nItemState );
inline long Width();
inline long Height();
void SetLink( const Link& rLink) { aLink=rLink; }
const Link& GetLink() const { return aLink; }
- BOOL IsRadio();
+ sal_Bool IsRadio();
// weil Buttons nicht von LinkHdl abgeleitet sind
void CallLink();
- void StoreButtonState( SvLBoxEntry* pEntry, USHORT nItemFlags );
- SvButtonState ConvertToButtonState( USHORT nItemFlags ) const;
+ void StoreButtonState( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags );
+ SvButtonState ConvertToButtonState( sal_uInt16 nItemFlags ) const;
inline SvButtonState GetActButtonState() const;
SvLBoxEntry* GetActEntry() const;
@@ -97,7 +97,7 @@ public:
void SetDefaultImages( const Control* pControlForSettings = NULL );
// set images acording to the color scheeme of the Control
// pControlForSettings == NULL: settings are taken from Application
- BOOL HasDefaultImages( void ) const;
+ sal_Bool HasDefaultImages( void ) const;
};
inline long SvLBoxButtonData::Width()
@@ -125,14 +125,14 @@ class SVT_DLLPUBLIC SvLBoxString : public SvLBoxItem
{
XubString aStr;
public:
- SvLBoxString( SvLBoxEntry*,USHORT nFlags,const XubString& rStr);
+ SvLBoxString( SvLBoxEntry*,sal_uInt16 nFlags,const XubString& rStr);
SvLBoxString();
virtual ~SvLBoxString();
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
XubString GetText() const { return aStr; }
void SetText( SvLBoxEntry*, const XubString& rStr );
- void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
};
@@ -141,13 +141,13 @@ class SvLBoxBmp : public SvLBoxItem
{
Image aBmp;
public:
- SvLBoxBmp( SvLBoxEntry*, USHORT nFlags, Image );
+ SvLBoxBmp( SvLBoxEntry*, sal_uInt16 nFlags, Image );
SvLBoxBmp();
virtual ~SvLBoxBmp();
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
void SetBitmap( SvLBoxEntry*, Image );
- void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
};
@@ -170,9 +170,11 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
{
SvLBoxButtonData* pData;
SvLBoxButtonKind eKind;
- USHORT nItemFlags;
- USHORT nImgArrOffs;
- USHORT nBaseOffs;
+ sal_uInt16 nItemFlags;
+ sal_uInt16 nImgArrOffs;
+ sal_uInt16 nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
public:
// An SvLBoxButton can be of three different kinds: an
// enabled checkbox (the normal kind), a disabled checkbox
@@ -180,31 +182,31 @@ public:
// (see SV_BMP_STATICIMAGE; nFlags are effectively ignored
// for that kind).
SvLBoxButton( SvLBoxEntry* pEntry,
- SvLBoxButtonKind eTheKind, USHORT nFlags,
+ SvLBoxButtonKind eTheKind, sal_uInt16 nFlags,
SvLBoxButtonData* pBData );
SvLBoxButton();
virtual ~SvLBoxButton();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- virtual USHORT IsA();
- void Check( SvLBox* pView, SvLBoxEntry*, BOOL bCheck );
- virtual BOOL ClickHdl(SvLBox* pView, SvLBoxEntry* );
- void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ virtual sal_uInt16 IsA();
+ void Check( SvLBox* pView, SvLBoxEntry*, sal_Bool bCheck );
+ virtual sal_Bool ClickHdl(SvLBox* pView, SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
- USHORT GetButtonFlags() const { return nItemFlags; }
- BOOL IsStateChecked() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_CHECKED)!=0; }
- BOOL IsStateUnchecked() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_UNCHECKED)!=0; }
- BOOL IsStateTristate() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_TRISTATE)!=0; }
- BOOL IsStateHilighted() const { return (BOOL)(nItemFlags & SV_ITEMSTATE_HILIGHTED)!=0; }
+ sal_uInt16 GetButtonFlags() const { return nItemFlags; }
+ sal_Bool IsStateChecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_CHECKED)!=0; }
+ sal_Bool IsStateUnchecked() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_UNCHECKED)!=0; }
+ sal_Bool IsStateTristate() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_TRISTATE)!=0; }
+ sal_Bool IsStateHilighted() const { return (sal_Bool)(nItemFlags & SV_ITEMSTATE_HILIGHTED)!=0; }
void SetStateChecked();
void SetStateUnchecked();
void SetStateTristate();
- void SetStateHilighted( BOOL bHilight );
+ void SetStateHilighted( sal_Bool bHilight );
SvLBoxButtonKind GetKind() const { return eKind; }
- void SetBaseOffs( USHORT nOffs ) { nBaseOffs = nOffs; }
- USHORT GetBaseOffs() const { return nBaseOffs; }
+ void SetBaseOffs( sal_uInt16 nOffs ) { nBaseOffs = nOffs; }
+ sal_uInt16 GetBaseOffs() const { return nBaseOffs; }
// Check whether this button can be modified via UI, sounding a beep if it
// cannot be modified:
@@ -226,7 +228,7 @@ inline void SvLBoxButton::SetStateTristate()
nItemFlags &= SV_STATE_MASK;
nItemFlags |= SV_ITEMSTATE_TRISTATE;
}
-inline void SvLBoxButton::SetStateHilighted( BOOL bHilight )
+inline void SvLBoxButton::SetStateHilighted( sal_Bool bHilight )
{
if ( bHilight )
nItemFlags |= SV_ITEMSTATE_HILIGHTED;
@@ -240,18 +242,18 @@ class SVT_DLLPUBLIC SvLBoxContextBmp : public SvLBoxItem
{
SvLBoxContextBmp_Impl* m_pImpl;
public:
- SvLBoxContextBmp( SvLBoxEntry*,USHORT nFlags,Image,Image,
- USHORT nEntryFlagsBmp1);
+ SvLBoxContextBmp( SvLBoxEntry*,sal_uInt16 nFlags,Image,Image,
+ sal_uInt16 nEntryFlagsBmp1);
SvLBoxContextBmp();
virtual ~SvLBoxContextBmp();
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
- void Paint( const Point&, SvLBox& rView, USHORT nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rView, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
- BOOL SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 );
+ sal_Bool SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 );
void GetModeImages( Image& _rBitmap1, Image& _rBitmap2 ) const;
inline void SetBitmap1( const Image& _rImage );
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx
index bd58c3e0735d..7b801d2288fd 100644
--- a/svtools/inc/svtools/svlbox.hxx
+++ b/svtools/inc/svtools/svlbox.hxx
@@ -42,6 +42,7 @@
#include <vcl/timer.hxx>
#include <vcl/accel.hxx>
#include <vcl/mnemonicengine.hxx>
+#include <vcl/quickselectionengine.hxx>
#include <tools/gen.hxx>
#include <svtools/treelist.hxx>
#include <svl/svarray.hxx>
@@ -96,21 +97,21 @@ class SvLBoxTab
void* pUserData;
public:
SvLBoxTab();
- SvLBoxTab( long nPos, USHORT nFlags=SV_LBOXTAB_ADJUST_LEFT );
+ SvLBoxTab( long nPos, sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT );
SvLBoxTab( const SvLBoxTab& );
~SvLBoxTab();
- USHORT nFlags;
+ sal_uInt16 nFlags;
void SetUserData( void* pPtr ) { pUserData = pPtr; }
void* GetUserData() const { return pUserData; }
- BOOL IsDynamic() const { return (BOOL)((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
+ sal_Bool IsDynamic() const { return (sal_Bool)((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
void SetPos( long nNewPos) { nPos = nNewPos; }
long GetPos() const { return nPos; }
long CalcOffset( long nItemLength, long nTabWidth );
// long CalcOffset( const String&, const OutputDevice& );
- BOOL IsEditable() const { return (BOOL)((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
- BOOL IsPushable() const { return (BOOL)((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
+ sal_Bool IsEditable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
+ sal_Bool IsPushable() const { return (sal_Bool)((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
};
// *********************************************************************
@@ -132,7 +133,7 @@ class SvViewDataEntry : public SvViewData
{
public:
SvViewDataItem* pItemData; // ein Array von SvViewDataItems
- USHORT nItmCnt; // Anzahl Items fuer delete-operator
+ sal_uInt16 nItmCnt; // Anzahl Items fuer delete-operator
SvViewDataEntry();
virtual ~SvViewDataEntry();
@@ -145,20 +146,20 @@ public:
class SVT_DLLPUBLIC SvLBoxItem
{
public:
- SvLBoxItem( SvLBoxEntry*, USHORT nFlags );
+ SvLBoxItem( SvLBoxEntry*, sal_uInt16 nFlags );
SvLBoxItem();
virtual ~SvLBoxItem();
- virtual USHORT IsA() = 0;
+ virtual sal_uInt16 IsA() = 0;
const Size& GetSize( SvLBox* pView, SvLBoxEntry* pEntry );
const Size& GetSize( SvLBoxEntry*, SvViewDataEntry* );
- const Size& GetSize( SvViewDataEntry* pData, USHORT nItemPos )
+ const Size& GetSize( SvViewDataEntry* pData, sal_uInt16 nItemPos )
{
SvViewDataItem* pIData=pData->pItemData+nItemPos;
return pIData->aSize;
}
virtual void Paint( const Point& rPos, SvLBox& rOutDev,
- USHORT nViewDataEntryFlags,
+ sal_uInt16 nViewDataEntryFlags,
SvLBoxEntry* pEntry ) = 0;
virtual void InitViewData( SvLBox* pView, SvLBoxEntry* pEntry,
@@ -188,31 +189,31 @@ class SVT_DLLPUBLIC SvLBoxEntry : public SvListEntry
SvPtrarr aItems;
void* pUserData;
- USHORT nEntryFlags;
+ sal_uInt16 nEntryFlags;
SVT_DLLPRIVATE void DeleteItems_Impl();
public:
SvLBoxEntry();
virtual ~SvLBoxEntry();
- USHORT ItemCount() const { return (USHORT)aItems.Count(); }
+ sal_uInt16 ItemCount() const { return (sal_uInt16)aItems.Count(); }
// DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL
// EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN
// DATEN ALLOZIERT WERDEN!
void AddItem( SvLBoxItem* pItem );
- void ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos );
- SvLBoxItem* GetItem( USHORT nPos ) const { return (SvLBoxItem*)aItems.GetObject(nPos ); }
- SvLBoxItem* GetFirstItem( USHORT nId );
- USHORT GetPos( SvLBoxItem* pItem ) const { return aItems.GetPos( pItem ); }
+ void ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos );
+ SvLBoxItem* GetItem( sal_uInt16 nPos ) const { return (SvLBoxItem*)aItems.GetObject(nPos ); }
+ SvLBoxItem* GetFirstItem( sal_uInt16 nId );
+ sal_uInt16 GetPos( SvLBoxItem* pItem ) const { return aItems.GetPos( pItem ); }
void* GetUserData() const { return pUserData; }
void SetUserData( void* pPtr ) { pUserData = pPtr; }
virtual void Clone( SvListEntry* pSource );
- void EnableChildsOnDemand( BOOL bEnable=TRUE );
- BOOL HasChildsOnDemand() const { return (BOOL)((nEntryFlags & SV_ENTRYFLAG_CHILDS_ON_DEMAND)!=0); }
- BOOL HasInUseEmphasis() const { return (BOOL)((nEntryFlags & SV_ENTRYFLAG_IN_USE)!=0); }
+ void EnableChildsOnDemand( sal_Bool bEnable=sal_True );
+ sal_Bool HasChildsOnDemand() const { return (sal_Bool)((nEntryFlags & SV_ENTRYFLAG_CHILDS_ON_DEMAND)!=0); }
+ sal_Bool HasInUseEmphasis() const { return (sal_Bool)((nEntryFlags & SV_ENTRYFLAG_IN_USE)!=0); }
- USHORT GetFlags() const { return nEntryFlags; }
- void SetFlags( USHORT nFlags ) { nEntryFlags = nFlags; }
+ sal_uInt16 GetFlags() const { return nEntryFlags; }
+ void SetFlags( sal_uInt16 nFlags ) { nEntryFlags = nFlags; }
};
// *********************************************************************
@@ -221,7 +222,7 @@ public:
#define WB_FORCE_SELECTION ((WinBits)0x8000)
-#define DragDropMode USHORT
+#define DragDropMode sal_uInt16
#define SV_DRAGDROP_NONE (DragDropMode)0x0000
#define SV_DRAGDROP_CTRL_MOVE (DragDropMode)0x0001
#define SV_DRAGDROP_CTRL_COPY (DragDropMode)0x0002
@@ -246,10 +247,12 @@ DECLARE_SVTREELIST(SvLBoxTreeList, SvLBoxEntry*)
class SvLBox;
struct SvLBox_Impl
{
- bool m_bIsEmptyTextAllowed;
- bool m_bEntryMnemonicsEnabled;
- Link* m_pLink;
- ::vcl::MnemonicEngine m_aMnemonicEngine;
+ bool m_bIsEmptyTextAllowed;
+ bool m_bEntryMnemonicsEnabled;
+ bool m_bDoingQuickSelection;
+ Link* m_pLink;
+ ::vcl::MnemonicEngine m_aMnemonicEngine;
+ ::vcl::QuickSelectionEngine m_aQuickSelectionEngine;
SvLBox_Impl( SvLBox& _rBox );
};
@@ -260,6 +263,7 @@ class SVT_DLLPUBLIC SvLBox
,public DropTargetHelper
,public DragSourceHelper
,public ::vcl::IMnemonicEntryList
+ ,public ::vcl::ISearchableStringList
{
friend class SvLBoxEntry;
@@ -281,7 +285,6 @@ class SVT_DLLPUBLIC SvLBox
protected:
- WinBits nWindowStyle;
Link aExpandedHdl;
Link aExpandingHdl;
Link aSelectHdl;
@@ -293,18 +296,18 @@ protected:
SvLBox_Impl* pLBoxImpl;
- USHORT nImpFlags;
+ sal_uInt16 nImpFlags;
// Move/CopySelection: Position des aktuellen Eintrags in Selektionsliste
- USHORT nCurEntrySelPos;
+ sal_uInt16 nCurEntrySelPos;
DragDropMode nDragDropMode;
SelectionMode eSelMode;
sal_Int8 nDragOptions;
- BOOL CheckDragAndDropMode( SvLBox* pSource, sal_Int8 );
- void ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow);
- void EnableSelectionAsDropTarget( BOOL bEnable = TRUE,
- BOOL bWithChilds = TRUE );
+ sal_Bool CheckDragAndDropMode( SvLBox* pSource, sal_Int8 );
+ void ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow);
+ void EnableSelectionAsDropTarget( sal_Bool bEnable = sal_True,
+ sal_Bool bWithChilds = sal_True );
// standard impl gibt 0 zurueck; muss von abgeleiteten Klassen, die
// D&D unterstuetzen, ueberladen werden
using Window::GetDropTarget;
@@ -319,23 +322,23 @@ protected:
// invalidate children on enable/disable
virtual void StateChanged( StateChangedType );
- virtual ULONG Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,ULONG nPos=LIST_APPEND);
- virtual ULONG Insert( SvLBoxEntry* pEntry,ULONG nRootPos = LIST_APPEND );
+ virtual sal_uLong Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos = LIST_APPEND );
void InsertTree( SvLBoxEntry* pTree, SvLBoxEntry* pTarget) {pModel->InsertTree( pTree, pTarget ); }
// Inplace-Editing
SvInplaceEdit2* pEdCtrl;
- void EnableInplaceEditing( BOOL bEnable){if(bEnable)nImpFlags|=SVLBOX_EDT_ENABLED; else nImpFlags&=~SVLBOX_EDT_ENABLED;}
- BOOL IsInplaceEditingEnabled() const { return (BOOL)((nImpFlags&SVLBOX_EDT_ENABLED)!=0); }
+ void EnableInplaceEditing( sal_Bool bEnable){if(bEnable)nImpFlags|=SVLBOX_EDT_ENABLED; else nImpFlags&=~SVLBOX_EDT_ENABLED;}
+ sal_Bool IsInplaceEditingEnabled() const { return (sal_Bool)((nImpFlags&SVLBOX_EDT_ENABLED)!=0); }
virtual void EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
const Point& rMousePos );
void EditText( const String&, const Rectangle&,const Selection&);
- void EditText( const String&, const Rectangle&,const Selection&, BOOL bMulti);
+ void EditText( const String&, const Rectangle&,const Selection&, sal_Bool bMulti);
void EditTextMultiLine( const String&, const Rectangle&,const Selection&);
void CancelTextEditing();
- BOOL IsEditingActive() const { return (BOOL)((nImpFlags & SVLBOX_IN_EDT)!=0); }
- BOOL EditingCanceled() const;
- void EndEditing( BOOL bCancel = FALSE );
+ sal_Bool IsEditingActive() const { return (sal_Bool)((nImpFlags & SVLBOX_IN_EDT)!=0); }
+ sal_Bool EditingCanceled() const;
+ void EndEditing( sal_Bool bCancel = sal_False );
bool IsEmptyTextAllowed() const;
void ForbidEmptyText();
// Callback EditText
@@ -353,7 +356,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt );
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual SvLBoxEntry* GetEntry( const Point& rPos, BOOL bHit=FALSE ) const;
+ virtual SvLBoxEntry* GetEntry( const Point& rPos, sal_Bool bHit=sal_False ) const;
virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
// handler and methods for Drag - finished handler. This link can be set
@@ -367,11 +370,18 @@ protected:
// for asynchronous D&D
sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView );
- // IMnemonicEntryList
- virtual const void* FirstSearchEntry( String& _rEntryText );
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText );
- virtual void SelectSearchEntry( const void* _pEntry );
- virtual void ExecuteSearchEntry( const void* _pEntry );
+ void OnCurrentEntryChanged();
+
+ // IMnemonicEntryList
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const;
+ virtual void SelectSearchEntry( const void* _pEntry );
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const;
+
+ // 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 );
public:
@@ -384,12 +394,12 @@ public:
void SetModel( SvLBoxTreeList* );
void DisconnectFromModel();
- virtual USHORT IsA();
- ULONG GetEntryCount() const {return pModel->GetEntryCount();}
+ virtual sal_uInt16 IsA();
+ sal_uLong GetEntryCount() const {return pModel->GetEntryCount();}
SvLBoxEntry* First() const { return (SvLBoxEntry*)(pModel->First()); }
- SvLBoxEntry* Next( SvLBoxEntry* pEntry, USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Next(pEntry,pDepth));}
- SvLBoxEntry* Prev( SvLBoxEntry* pEntry, USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Prev(pEntry,pDepth));}
- SvLBoxEntry* Last( USHORT* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Last(pDepth));}
+ SvLBoxEntry* Next( SvLBoxEntry* pEntry, sal_uInt16* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Next(pEntry,pDepth));}
+ SvLBoxEntry* Prev( SvLBoxEntry* pEntry, sal_uInt16* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Prev(pEntry,pDepth));}
+ SvLBoxEntry* Last( sal_uInt16* pDepth=0 ) const { return (SvLBoxEntry*)(pModel->Last(pDepth));}
SvLBoxEntry* FirstChild(SvLBoxEntry* pParent ) const { return (SvLBoxEntry*)(pModel->FirstChild(pParent)); }
SvLBoxEntry* NextSibling(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->NextSibling( pEntry )); }
@@ -402,9 +412,9 @@ public:
SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); }
SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); }
- BOOL CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget );
- BOOL MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget );
- BOOL MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback );
+ sal_Bool CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget );
+ sal_Bool MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget );
+ sal_Bool MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback );
void RemoveSelection();
DragDropMode GetDragDropMode() const { return nDragDropMode; }
@@ -413,8 +423,8 @@ public:
virtual void SetSelectionMode( SelectionMode );
// pParent==0 -> Root-Ebene
- SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); }
- SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); }
+ SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uLong nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); }
+ SvLBoxEntry* GetEntry( sal_uLong nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); }
SvLBoxEntry* GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const;
void FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPath ) const;
@@ -425,8 +435,8 @@ public:
SvLBoxEntry* GetRootLevelParent(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetRootLevelParent( pEntry ));}
using Window::GetChildCount;
- ULONG GetChildCount( SvLBoxEntry* pParent ) const { return pModel->GetChildCount(pParent); }
- ULONG GetLevelChildCount( SvLBoxEntry* pParent ) const;
+ sal_uLong GetChildCount( SvLBoxEntry* pParent ) const { return pModel->GetChildCount(pParent); }
+ sal_uLong GetLevelChildCount( SvLBoxEntry* pParent ) const;
SvViewDataEntry* GetViewDataEntry( SvListEntry* pEntry ) const { return (SvViewDataEntry*)SvListView::GetViewData(pEntry); }
SvViewDataItem* GetViewDataItem( SvListEntry*, SvLBoxItem* ) const;
@@ -469,21 +479,21 @@ public:
*/
bool HandleKeyInput( const KeyEvent& rKEvt );
- virtual BOOL Expand( SvLBoxEntry* pParent );
- virtual BOOL Collapse( SvLBoxEntry* pParent );
- virtual BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
- virtual ULONG SelectChilds( SvLBoxEntry* pParent, BOOL bSelect );
- virtual void SelectAll( BOOL bSelect, BOOL bPaint=TRUE );
+ virtual sal_Bool Expand( SvLBoxEntry* pParent );
+ virtual sal_Bool Collapse( SvLBoxEntry* pParent );
+ virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
+ virtual sal_uLong SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint=sal_True );
virtual void SetCurEntry( SvLBoxEntry* _pEntry ) = 0;
virtual SvLBoxEntry*
GetCurEntry() const = 0;
// Model
- void SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse=TRUE);
+ void SetInUseEmphasis( SvLBoxEntry* pEntry, sal_Bool bInUse=sal_True);
// View
- void SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored=TRUE);
- BOOL HasCursorEmphasis( SvLBoxEntry* pEntry ) const;
+ void SetCursorEmphasis( SvLBoxEntry* pEntry, sal_Bool bCursored=sal_True);
+ sal_Bool HasCursorEmphasis( SvLBoxEntry* pEntry ) const;
void SetSelectHdl( const Link& rNewHdl ) {aSelectHdl=rNewHdl; }
void SetDeselectHdl( const Link& rNewHdl ) {aDeselectHdl=rNewHdl; }
@@ -499,8 +509,8 @@ public:
virtual long ExpandingHdl();
virtual void SelectHdl();
virtual void DeselectHdl();
- virtual BOOL DoubleClickHdl();
- BOOL IsTravelSelect() const { return (BOOL)((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
+ virtual sal_Bool DoubleClickHdl();
+ sal_Bool IsTravelSelect() const { return (sal_Bool)((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
SvLBoxEntry* GetHdlEntry() const { return pHdlEntry; }
SvLBoxItem* GetHdlItem() const;
@@ -517,7 +527,7 @@ public:
virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData,
SvLBoxEntry* );
virtual void DragFinished( sal_Int8 nDropAction );
- virtual BOOL NotifyAcceptDrop( SvLBoxEntry* );
+ virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* );
void SetDragOptions( sal_Int8 nOptions ) { nDragOptions = nOptions; }
sal_Int8 GetDragOptions() const { return nDragOptions; }
@@ -526,25 +536,25 @@ public:
SvLBox* GetTargetView() const;
virtual void NotifyRemoving( SvLBoxEntry* );
- virtual void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ virtual void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
virtual SvLBoxEntry* CreateEntry() const; // zum 'new'en von Entries
- // Rueckgabe: TRUE==Ok, FALSE==Abbrechen
- virtual BOOL NotifyMoving(
+ // Rueckgabe: sal_True==Ok, sal_False==Abbrechen
+ virtual sal_Bool NotifyMoving(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu verschiebender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos); // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos); // Position in Childlist des Target-Parents
- // Rueckgabe: TRUE==Ok, FALSE==Abbrechen
- virtual BOOL NotifyCopying(
+ // Rueckgabe: sal_True==Ok, sal_False==Abbrechen
+ virtual sal_Bool NotifyCopying(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu kopierender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos); // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos); // Position in Childlist des Target-Parents
// ACCESSIBILITY ==========================================================
@@ -577,7 +587,7 @@ struct SvLBoxDDInfo
SvLBoxEntry* pDDStartEntry;
// relative Position im Eintrag bei Drag-Beginn (IconView)
long nMouseRelX,nMouseRelY;
- ULONG nRes1,nRes2,nRes3,nRes4;
+ sal_uLong nRes1,nRes2,nRes3,nRes4;
};
class SvInplaceEdit : public Edit
@@ -586,8 +596,8 @@ class SvInplaceEdit : public Edit
Accelerator aAccReturn;
Accelerator aAccEscape;
Timer aTimer;
- BOOL bCanceled;
- BOOL bAlreadyInCallBack;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallBack;
void CallCallBackHdl_Impl();
DECL_LINK( Timeout_Impl, Timer * );
@@ -602,9 +612,9 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void LoseFocus();
- BOOL EditingCanceled() const { return bCanceled; }
+ sal_Bool EditingCanceled() const { return bCanceled; }
String GetText() const { return Edit::GetText(); }
- void StopEditing( BOOL bCancel = FALSE );
+ void StopEditing( sal_Bool bCancel = sal_False );
};
class SvInplaceEdit2
@@ -614,9 +624,9 @@ class SvInplaceEdit2
Accelerator aAccEscape;
Timer aTimer;
Edit* pEdit;
- BOOL bCanceled;
- BOOL bAlreadyInCallBack;
- BOOL bMultiLine;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallBack;
+ sal_Bool bMultiLine;
void CallCallBackHdl_Impl();
DECL_LINK( Timeout_Impl, Timer * );
@@ -626,14 +636,14 @@ class SvInplaceEdit2
public:
SvInplaceEdit2( Window* pParent, const Point& rPos, const Size& rSize,
const String& rData, const Link& rNotifyEditEnd,
- const Selection&, BOOL bMultiLine = FALSE );
+ const Selection&, sal_Bool bMultiLine = sal_False );
~SvInplaceEdit2();
- BOOL KeyInput( const KeyEvent& rKEvt );
+ sal_Bool KeyInput( const KeyEvent& rKEvt );
void LoseFocus();
- BOOL EditingCanceled() const { return bCanceled; }
+ sal_Bool EditingCanceled() const { return bCanceled; }
String GetText() const;
String GetSavedValue() const;
- void StopEditing( BOOL bCancel = FALSE );
+ void StopEditing( sal_Bool bCancel = sal_False );
void Hide();
};
@@ -644,7 +654,7 @@ inline SvViewDataItem* SvLBox::GetViewDataItem( SvListEntry* pEntry,
(SvViewDataEntry*)SvListView::GetViewData(pEntry);
DBG_ASSERT(pEntryData,"Entry not in View");
DBG_ASSERT(pEntryData->pItemData,"No ItemData");
- USHORT nItemPos = ((SvLBoxEntry*)pEntry)->GetPos( pItem );
+ sal_uInt16 nItemPos = ((SvLBoxEntry*)pEntry)->GetPos( pItem );
return (pEntryData->pItemData+nItemPos);
}
diff --git a/svtools/inc/svtools/svmedit.hxx b/svtools/inc/svtools/svmedit.hxx
index 7deaa8e1a93a..5ff8ab4de8a3 100644
--- a/svtools/inc/svtools/svmedit.hxx
+++ b/svtools/inc/svtools/svmedit.hxx
@@ -29,7 +29,7 @@
#ifndef _SVEDIT_HXX
#define _SVEDIT_HXX
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/edit.hxx>
#include <svtools/syntaxhighlight.hxx>
@@ -60,7 +60,7 @@ protected:
virtual long PreNotify( NotifyEvent& rNEvt );
long Notify( NotifyEvent& rNEvt );
using Control::ImplInitSettings;
- void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
WinBits ImplInitStyle( WinBits nStyle );
ExtTextEngine* GetTextEngine() const;
@@ -79,17 +79,17 @@ public:
virtual void SetModifyFlag();
virtual void ClearModifyFlag();
- virtual BOOL IsModified() const;
+ virtual sal_Bool IsModified() const;
- virtual void EnableUpdateData( ULONG nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
virtual void DisableUpdateData() { delete pUpdateDataTimer; pUpdateDataTimer = NULL; }
- virtual ULONG IsUpdateDataEnabled() const;
+ virtual sal_uLong IsUpdateDataEnabled() const;
- virtual void SetReadOnly( BOOL bReadOnly = TRUE );
- virtual BOOL IsReadOnly() const;
+ virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ virtual sal_Bool IsReadOnly() const;
- void EnableFocusSelectionHide( BOOL bHide );
- BOOL IsFocusSelectionHideEnabled() const;
+ void EnableFocusSelectionHide( sal_Bool bHide );
+ sal_Bool IsFocusSelectionHideEnabled() const;
virtual void SetMaxTextLen( xub_StrLen nMaxLen = 0 );
virtual xub_StrLen GetMaxTextLen() const;
@@ -114,8 +114,8 @@ public:
String GetTextLines() const;
String GetTextLines( LineEnd aSeparator ) const;
- void SetRightToLeft( BOOL bRightToLeft );
- BOOL IsRightToLeft() const;
+ void SetRightToLeft( sal_Bool bRightToLeft );
+ sal_Bool IsRightToLeft() const;
void SaveValue() { aSaveValue = GetText(); }
const XubString& GetSavedValue() const { return aSaveValue; }
@@ -132,22 +132,22 @@ public:
Size CalcMinimumSize() const;
Size CalcAdjustedSize( const Size& rPrefSize ) const;
using Edit::CalcSize;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
- void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
- void SetLeftMargin( USHORT n );
- USHORT GetLeftMargin() const;
+ void SetLeftMargin( sal_uInt16 n );
+ sal_uInt16 GetLeftMargin() const;
virtual
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface(BOOL bCreate = TRUE);
+ GetComponentInterface(sal_Bool bCreate = sal_True);
void DisableSelectionOnFocus();
};
-inline ULONG MultiLineEdit::IsUpdateDataEnabled() const
+inline sal_uLong MultiLineEdit::IsUpdateDataEnabled() const
{
return pUpdateDataTimer ? pUpdateDataTimer->GetTimeout() : 0;
}
diff --git a/svtools/inc/svtools/svmedit2.hxx b/svtools/inc/svtools/svmedit2.hxx
index 5df3669c5656..9710f1e5bf6d 100644
--- a/svtools/inc/svtools/svmedit2.hxx
+++ b/svtools/inc/svtools/svmedit2.hxx
@@ -41,14 +41,14 @@ public:
~ExtMultiLineEdit();
// methods of TextView
- void InsertText( const String& rNew, BOOL bSelect = FALSE );
- void SetAutoScroll( BOOL bAutoScroll );
- void EnableCursor( BOOL bEnable );
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
+ void SetAutoScroll( sal_Bool bAutoScroll );
+ void EnableCursor( sal_Bool bEnable );
// methods of TextEngine
- void SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd );
- void SetLeftMargin( USHORT nLeftMargin );
- ULONG GetParagraphCount() const;
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd );
+ void SetLeftMargin( sal_uInt16 nLeftMargin );
+ sal_uLong GetParagraphCount() const;
};
#endif
diff --git a/svtools/inc/svtools/svparser.hxx b/svtools/inc/svtools/svparser.hxx
index 182c77878490..b82a5a85e36e 100644
--- a/svtools/inc/svtools/svparser.hxx
+++ b/svtools/inc/svtools/svparser.hxx
@@ -57,21 +57,21 @@ class SVT_DLLPUBLIC SvParser : public SvRefBase
protected:
SvStream& rInput;
String aToken; // gescanntes Token
- ULONG nlLineNr; // akt. Zeilen Nummer
- ULONG nlLinePos; // akt. Spalten Nummer
+ sal_uLong nlLineNr; // akt. Zeilen Nummer
+ sal_uLong nlLinePos; // akt. Spalten Nummer
SvParser_Impl *pImplData; // interne Daten
long nTokenValue; // zusaetzlicher Wert (RTF)
- BOOL bTokenHasValue; // indicates whether nTokenValue is valid
+ sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid
SvParserState eState; // Status auch in abgl. Klassen
rtl_TextEncoding eSrcEnc; // Source encoding
- ULONG nNextChPos;
+ sal_uLong nNextChPos;
sal_Unicode nNextCh; // Akt. Zeichen fuer die "lex"
- BOOL bDownloadingFile : 1;// TRUE: Es wird gerade ein externes
+ sal_Bool bDownloadingFile : 1;// sal_True: Es wird gerade ein externes
// File geladen. d.h. alle
// DataAvailable Links muessen
// ignoriert werden.
@@ -80,16 +80,16 @@ protected:
// Stream als ANSI gelesen,
// aber als CharSet DONTKNOW
// zurueckgegeben.
- BOOL bUCS2BSrcEnc : 1; // oder als big-endian UCS2
- BOOL bSwitchToUCS2 : 1; // Umschalten des ist erlaubt
+ sal_Bool bUCS2BSrcEnc : 1; // oder als big-endian UCS2
+ sal_Bool bSwitchToUCS2 : 1; // Umschalten des ist erlaubt
- BOOL bRTF_InTextRead : 1; // only for RTF-Parser!!!
+ sal_Bool bRTF_InTextRead : 1; // only for RTF-Parser!!!
struct TokenStackType
{
String sToken;
long nTokenValue;
- BOOL bTokenHasValue;
+ sal_Bool bTokenHasValue;
int nTokenId;
inline TokenStackType() { nTokenId = 0; }
@@ -99,7 +99,7 @@ protected:
// Methoden fuer Token-Stack
int SkipToken( short nCnt = -1 ); // n Tokens zurueck "skippen"
TokenStackType* GetStackPtr( short nCnt );
- inline BYTE GetStackPos() const;
+ inline sal_uInt8 GetStackPos() const;
// scanne das naechste Token:
// Tokenstack abarbeiten und ggfs. _GetNextToken() rufen. Diese
@@ -118,22 +118,22 @@ protected:
private:
TokenStackType* pTokenStack;
TokenStackType *pTokenStackPos;
- BYTE nTokenStackSize, nTokenStackPos;
+ sal_uInt8 nTokenStackSize, nTokenStackPos;
public:
// Konstruktor
- SvParser( SvStream& rIn, BYTE nStackSize = 3 );
+ SvParser( SvStream& rIn, sal_uInt8 nStackSize = 3 );
virtual SvParserState CallParser() = 0; // Aufruf des Parsers
inline SvParserState GetStatus() const { return eState; } // StatusInfo
- inline ULONG GetLineNr() const { return nlLineNr; }
- inline ULONG GetLinePos() const { return nlLinePos; }
- inline ULONG IncLineNr() { return ++nlLineNr; }
- inline ULONG IncLinePos() { return ++nlLinePos; }
- inline ULONG SetLineNr( ULONG nlNum ); // inline unten
- inline ULONG SetLinePos( ULONG nlPos ); // inline unten
+ inline sal_uLong GetLineNr() const { return nlLineNr; }
+ inline sal_uLong GetLinePos() const { return nlLinePos; }
+ inline sal_uLong IncLineNr() { return ++nlLineNr; }
+ inline sal_uLong IncLinePos() { return ++nlLinePos; }
+ inline sal_uLong SetLineNr( sal_uLong nlNum ); // inline unten
+ inline sal_uLong SetLinePos( sal_uLong nlPos ); // inline unten
sal_Unicode GetNextChar();
void RereadLookahead();
@@ -150,24 +150,24 @@ public:
/*virtual*/ void RestoreState();
virtual void Continue( int nToken );
- inline void SetDownloadingFile( BOOL bSet ) { bDownloadingFile = bSet; }
- inline BOOL IsDownloadingFile() const { return bDownloadingFile; }
+ inline void SetDownloadingFile( sal_Bool bSet ) { bDownloadingFile = bSet; }
+ inline sal_Bool IsDownloadingFile() const { return bDownloadingFile; }
// Set/get source encoding. The UCS2BEncoding flag is valid if source
// encoding is UCS2. It specifies a big endian encoding.
void SetSrcEncoding( rtl_TextEncoding eSrcEnc );
rtl_TextEncoding GetSrcEncoding() const { return eSrcEnc; }
- void SetSrcUCS2BEncoding( BOOL bSet ) { bUCS2BSrcEnc = bSet; }
- BOOL IsSrcUCS2BEncoding() const { return bUCS2BSrcEnc; }
+ void SetSrcUCS2BEncoding( sal_Bool bSet ) { bUCS2BSrcEnc = bSet; }
+ sal_Bool IsSrcUCS2BEncoding() const { return bUCS2BSrcEnc; }
// Darf der Zeichensatz auf UCS/2 umgeschaltet werden, wenn
// in den ersten beiden Zeichen im Stream eine BOM steht?
- void SetSwitchToUCS2( BOOL bSet ) { bSwitchToUCS2 = bSet; }
- BOOL IsSwitchToUCS2() const { return bSwitchToUCS2; }
+ void SetSwitchToUCS2( sal_Bool bSet ) { bSwitchToUCS2 = bSet; }
+ sal_Bool IsSwitchToUCS2() const { return bSwitchToUCS2; }
// Aus wie vielen Bytes betseht ein Zeichen
- inline USHORT GetCharSize() const;
+ inline sal_uInt16 GetCharSize() const;
int GetSaveToken() const;
@@ -175,8 +175,8 @@ public:
// 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'.
// Die Which-Map wird nicht geloescht.
static void BuildWhichTbl( SvUShorts &rWhichMap,
- USHORT *pWhichIds,
- USHORT nWhichIds );
+ sal_uInt16 *pWhichIds,
+ sal_uInt16 nWhichIds );
};
@@ -188,16 +188,16 @@ SV_IMPL_REF(SvParser)
-inline ULONG SvParser::SetLineNr( ULONG nlNum )
-{ ULONG nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
+inline sal_uLong SvParser::SetLineNr( sal_uLong nlNum )
+{ sal_uLong nlOld = nlLineNr; nlLineNr = nlNum; return nlOld; }
-inline ULONG SvParser::SetLinePos( ULONG nlPos )
-{ ULONG nlOld = nlLinePos; nlLinePos = nlPos; return nlOld; }
+inline sal_uLong SvParser::SetLinePos( sal_uLong nlPos )
+{ sal_uLong nlOld = nlLinePos; nlLinePos = nlPos; return nlOld; }
-inline BYTE SvParser::GetStackPos() const
+inline sal_uInt8 SvParser::GetStackPos() const
{ return nTokenStackPos; }
-inline USHORT SvParser::GetCharSize() const
+inline sal_uInt16 SvParser::GetCharSize() const
{
return (RTL_TEXTENCODING_UCS2 == eSrcEnc) ? 2 : 1;
}
@@ -262,7 +262,7 @@ class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase,
/** Representation.
*/
SvKeyValueList_Impl* m_pList;
- USHORT m_nPos;
+ sal_uInt16 m_nPos;
public:
/** Construction/Destruction.
@@ -272,8 +272,8 @@ public:
/** Operation.
*/
- virtual BOOL GetFirst (SvKeyValue &rKeyVal);
- virtual BOOL GetNext (SvKeyValue &rKeyVal);
+ virtual sal_Bool GetFirst (SvKeyValue &rKeyVal);
+ virtual sal_Bool GetNext (SvKeyValue &rKeyVal);
virtual void Append (const SvKeyValue &rKeyVal);
};
diff --git a/svtools/inc/svtools/svtabbx.hxx b/svtools/inc/svtools/svtabbx.hxx
index e47d64f8ceed..aa32ebe019da 100644
--- a/svtools/inc/svtools/svtabbx.hxx
+++ b/svtools/inc/svtools/svtabbx.hxx
@@ -48,10 +48,10 @@ enum SvTabJustify
struct TabListBoxEventData
{
SvLBoxEntry* m_pEntry;
- USHORT m_nColumn;
+ sal_uInt16 m_nColumn;
String m_sOldText;
- TabListBoxEventData( SvLBoxEntry* pEntry, USHORT nColumn, const String& rOldText ) :
+ TabListBoxEventData( SvLBoxEntry* pEntry, sal_uInt16 nColumn, const String& rOldText ) :
m_pEntry( pEntry ), m_nColumn( nColumn ), m_sOldText( rOldText ) {}
};
@@ -59,71 +59,71 @@ class SVT_DLLPUBLIC SvTabListBox : public SvTreeListBox
{
private:
SvLBoxTab* pTabList;
- USHORT nTabCount;
+ sal_uInt16 nTabCount;
XubString aCurEntry;
- ULONG nDummy1;
- ULONG nDummy2;
+ sal_uLong nDummy1;
+ sal_uLong nDummy2;
protected:
SvLBoxEntry* pViewParent;
- static const xub_Unicode* GetToken( const xub_Unicode* pPtr, USHORT& rLen );
+ static const xub_Unicode* GetToken( const xub_Unicode* pPtr, sal_uInt16& rLen );
virtual void SetTabs();
virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind );
- String GetTabEntryText( ULONG nPos, USHORT nCol ) const;
- SvLBoxEntry* GetEntryOnPos( ULONG _nEntryPos ) const;
- SvLBoxEntry* GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const;
+ String GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ SvLBoxEntry* GetEntryOnPos( sal_uLong _nEntryPos ) const;
+ SvLBoxEntry* GetChildOnPos( SvLBoxEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const;
public:
SvTabListBox( Window* pParent, WinBits = WB_BORDER );
SvTabListBox( Window* pParent, const ResId& );
~SvTabListBox();
void SetTabs( long* pTabs, MapUnit = MAP_APPFONT );
- USHORT TabCount() const { return (USHORT)nTabCount; }
+ sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
using SvTreeListBox::GetTab;
- long GetTab( USHORT nTab ) const;
- void SetTab( USHORT nTab, long nValue, MapUnit = MAP_APPFONT );
- long GetLogicTab( USHORT nTab );
+ long GetTab( sal_uInt16 nTab ) const;
+ void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
+ long GetLogicTab( sal_uInt16 nTab );
virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos=LIST_APPEND, void* pUserData = 0,
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
virtual SvLBoxEntry* InsertEntry( const XubString& rText,
const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp,
SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos = LIST_APPEND, void* pUserData = 0,
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
- virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, ULONG nPos = LIST_APPEND,
- USHORT nCol = 0xffff, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, SvLBoxEntry* pParent,
- ULONG nPos, USHORT nCol, void* pUserData = NULL );
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent = NULL,
- ULONG nPos = LIST_APPEND, USHORT nCol = 0xffff, void* pUserData = NULL );
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
virtual String GetEntryText( SvLBoxEntry* pEntry ) const;
- String GetEntryText( SvLBoxEntry*, USHORT nCol ) const;
- String GetEntryText( ULONG nPos, USHORT nCol = 0xffff ) const;
+ String GetEntryText( SvLBoxEntry*, sal_uInt16 nCol ) const;
+ String GetEntryText( sal_uLong nPos, sal_uInt16 nCol = 0xffff ) const;
using SvTreeListBox::SetEntryText;
- void SetEntryText( const XubString&, ULONG, USHORT nCol=0xffff );
- void SetEntryText(const XubString&,SvLBoxEntry*,USHORT nCol=0xffff);
- String GetCellText( ULONG nPos, USHORT nCol ) const;
- ULONG GetEntryPos( const XubString&, USHORT nCol = 0xffff );
- ULONG GetEntryPos( const SvLBoxEntry* pEntry ) const;
+ void SetEntryText( const XubString&, sal_uLong, sal_uInt16 nCol=0xffff );
+ void SetEntryText(const XubString&,SvLBoxEntry*,sal_uInt16 nCol=0xffff);
+ String GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const;
+ sal_uLong GetEntryPos( const XubString&, sal_uInt16 nCol = 0xffff );
+ sal_uLong GetEntryPos( const SvLBoxEntry* pEntry ) const;
virtual void Resize();
- void SetTabJustify( USHORT nTab, SvTabJustify );
- SvTabJustify GetTabJustify( USHORT nTab ) const;
+ void SetTabJustify( sal_uInt16 nTab, SvTabJustify );
+ SvTabJustify GetTabJustify( sal_uInt16 nTab ) const;
};
-inline long SvTabListBox::GetTab( USHORT nTab ) const
+inline long SvTabListBox::GetTab( sal_uInt16 nTab ) const
{
DBG_ASSERT( nTab < nTabCount, "GetTabPos:Invalid Tab" );
return pTabList[nTab].GetPos();
@@ -161,17 +161,17 @@ public:
virtual void Paint( const Rectangle& );
void InitHeaderBar( HeaderBar* pHeaderBar );
- sal_Bool IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const;
+ sal_Bool IsItemChecked( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const;
- virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, ULONG nPos = LIST_APPEND,
- USHORT nCol = 0xffff, void* pUserData = NULL );
+ virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, sal_uLong nPos = LIST_APPEND,
+ sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, SvLBoxEntry* pParent,
- ULONG nPos, USHORT nCol, void* pUserData = NULL );
+ sal_uLong nPos, sal_uInt16 nCol, void* pUserData = NULL );
virtual SvLBoxEntry* InsertEntryToColumn( const XubString&, const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp, SvLBoxEntry* pParent = NULL,
- ULONG nPos = LIST_APPEND, USHORT nCol = 0xffff, void* pUserData = NULL );
- virtual ULONG Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,ULONG nPos=LIST_APPEND);
- virtual ULONG Insert( SvLBoxEntry* pEntry, ULONG nRootPos = LIST_APPEND );
+ sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol = 0xffff, void* pUserData = NULL );
+ virtual sal_uLong Insert( SvLBoxEntry* pEnt,SvLBoxEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ virtual sal_uLong Insert( SvLBoxEntry* pEntry, sal_uLong nRootPos = LIST_APPEND );
void RemoveEntry( SvLBoxEntry* _pEntry );
void Clear();
@@ -203,13 +203,13 @@ public:
virtual sal_Bool HasRowHeader() const; //GetColumnId
/** @return <TRUE/>, if the object can focus a cell. */
virtual sal_Bool IsCellFocusable() const;
- virtual BOOL GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
+ virtual sal_Bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
virtual void SetNoSelection();
using SvListView::SelectAll;
virtual void SelectAll();
- virtual void SelectAll( BOOL bSelect, BOOL bPaint = TRUE );
- virtual void SelectRow( long _nRow, BOOL _bSelect = TRUE, BOOL bExpand = TRUE );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
+ virtual void SelectRow( long _nRow, sal_Bool _bSelect = sal_True, sal_Bool bExpand = sal_True );
virtual void SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect = sal_True );
virtual sal_Int32 GetSelectedRowCount() const;
virtual sal_Int32 GetSelectedColumnCount() const;
@@ -221,11 +221,11 @@ public:
/** @return <TRUE/>, if the cell is visible. */
virtual sal_Bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const;
- virtual String GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const;
+ virtual String GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const;
- virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE );
- virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE );
- virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen = TRUE );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen = sal_True );
virtual XACC CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumn );
virtual XACC CreateAccessibleRowHeader( sal_Int32 _nRow );
@@ -249,12 +249,12 @@ public:
virtual void GrabTableFocus();
// OutputDevice
- virtual BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
+ virtual sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector );
// Window
virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
virtual void GrabFocus();
- virtual XACC GetAccessible( BOOL bCreate = TRUE );
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True );
virtual Window* GetAccessibleParentWindow() const;
/** Creates and returns the accessible object of the whole BrowseBox. */
diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx
index 5c1900b2493a..f647c6ee32e2 100644
--- a/svtools/inc/svtools/svtdata.hxx
+++ b/svtools/inc/svtools/svtdata.hxx
@@ -29,6 +29,7 @@
#ifndef _SVTOOLS_SVTDATA_HXX
#define _SVTOOLS_SVTDATA_HXX
+#include "svtools/svtdllapi.h"
#include <tools/resid.hxx>
#include <com/sun/star/lang/Locale.hpp>
@@ -41,11 +42,10 @@ class ImpSvtData
public:
SfxItemDesruptorList_Impl * pItemDesruptList;
ResMgr * pResMgr;
- ResMgr * pPatchResMgr;
private:
ImpSvtData():
- pItemDesruptList(0), pResMgr(0), pPatchResMgr(0)
+ pItemDesruptList(0), pResMgr(0)
{}
~ImpSvtData();
@@ -53,32 +53,16 @@ private:
public:
ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale);
ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL!
- ResMgr * GetPatchResMgr();
- ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale);
static ImpSvtData & GetSvtData();
};
//============================================================================
-
-class SvpResId: public ResId
+class SVT_DLLPUBLIC SvtResId: public ResId
{
public:
- SvpResId( USHORT nId, const ::com::sun::star::lang::Locale aLocale ):
- ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {}
-
- // VCL dependant, only available in SVT, not in SVL!
- SvpResId( USHORT nId );
-};
-
-
-class SvtResId: public ResId
-{
-public:
- SvtResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale):
- ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {}
-
- SvtResId(USHORT nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {}
+ SvtResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale);
+ SvtResId(sal_uInt16 nId);
// VCL dependant, only available in SVT, not in SVL!
};
diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
index 5323dad47d6f..bb34410a4bfb 100644
--- a/svtools/inc/svtools/svtools.hrc
+++ b/svtools/inc/svtools/svtools.hrc
@@ -32,25 +32,18 @@
#define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0)
#define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0)
+//#define ABOUT_STR_COPYRIGHT (RID_SVTOOLS_START + 1)
+//#define ABOUT_STR_DEVELOPER_ARY (RID_SVTOOLS_START + 2)
+
//.............................................................................
// various unsorted stuff
-#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1)
-#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2)
#define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3)
#define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4)
#define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5)
#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
-#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4)
-#define KEY_MODE (RID_SVTOOLS_START+5)
-#define KEY_RES (RID_SVTOOLS_START+6)
-#define KEY_SIZE (RID_SVTOOLS_START+7)
-
-#define KEY_COLORS (RID_SVTOOLS_START+9)
-#define KEY_RLE_CODING (RID_SVTOOLS_START+10)
-
#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20)
@@ -97,6 +90,10 @@
#define STR_BASICKEY_FORMAT_TRUE (RID_SVTOOLS_START+107)
#define STR_BASICKEY_FORMAT_FALSE (RID_SVTOOLS_START+108)
#define CONFIG_BASIC_FORMAT_END (RID_SVTOOLS_START+109)
+#define STR_UNDO (RID_SVTOOLS_START+110)
+#define STR_REDO (RID_SVTOOLS_START+111)
+#define STR_REPEAT (RID_SVTOOLS_START+112)
+
#define STR_INVALIDTRYBUY (RID_SVTOOLS_START+120)
#define STR_OLDTRYBUY (RID_SVTOOLS_START+121)
@@ -253,6 +250,10 @@
#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4)
#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5)
#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6)
+//IAccessible2 implementation
+#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE (STR_SVT_ACC_BEGIN+7)
+#define STR_SVT_ACC_RULER_VERT_NAME (STR_SVT_ACC_BEGIN+8)
+#define STR_SVT_ACC_RULER_HORZ_NAME (STR_SVT_ACC_BEGIN+9)
#define STR_SVT_ACC_END (STR_SVT_ACC_EMPTY_FIELD)
#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1)
@@ -287,17 +288,16 @@
//.............................................................................
// dialogs
-
-#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110)
-#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111)
-#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112)
+#define DLG_EXPORT_START (STR_ARR_SVT_LANGUAGE_TABLE_END + 1)
+#define DLG_EXPORT (DLG_EXPORT_START)
+#define DLG_EXPORT_TITLE (DLG_EXPORT_START+1)
+#define DLG_EXPORT_END (DLG_EXPORT_TITLE)
#define DLG_LOGIN (RID_SVTOOLS_START+113)
#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114)
#define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115)
-#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116)
//.............................................................................
// bitmaps
@@ -364,5 +364,10 @@
#define RID_IMG_PRNDLG_COLLATE (STR_SVT_PRNDLG_START + 29)
#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30)
+// IAccessible2 implementation in 2009
+#define STR_PARAGRAPH_START (STR_SVT_PRNDLG_START + 50)
+#define STR_PARAGRAPH (STR_PARAGRAPH_START + 0)
+#define STR_PARAGRAPH_END (STR_PARAGRAPH)
+
#endif // #ifndef _SVTOOLS_HRC
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
index 18fdde318eec..6edd32110317 100644
--- a/svtools/inc/svtools/svtreebx.hxx
+++ b/svtools/inc/svtools/svtreebx.hxx
@@ -41,11 +41,6 @@ class TabBar;
#define SV_TAB_BORDER 8
-#define WB_HASBUTTONSATROOT ((WinBits)0x0800)
-#define WB_NOINITIALSELECTION WB_DROPDOWN
-#define WB_HIDESELECTION WB_NOHIDESELECTION
-#define WB_FORCE_MAKEVISIBLE WB_SPIN
-
#define SV_LISTBOX_ID_TREEBOX 1 // fuer SvLBox::IsA()
#define SV_ENTRYHEIGHTOFFS_PIXEL 2
@@ -77,12 +72,12 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
Image aCurInsertedColBmp;
short nContextBmpWidthMax;
- USHORT nFirstSelTab, nLastSelTab;
+ sal_uInt16 nFirstSelTab, nLastSelTab;
short nEntryHeight;
short nEntryHeightOffs;
short nIndent;
short nFocusWidth;
- USHORT aContextBmpMode;
+ sal_uInt16 aContextBmpMode;
#ifdef _SVTREEBX_CXX
DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
@@ -96,17 +91,19 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
SVT_DLLPRIVATE void ImpEntryInserted( SvLBoxEntry* pEntry );
SVT_DLLPRIVATE long PaintEntry1( SvLBoxEntry*, long nLine,
- USHORT nTabFlagMask=0xffff,
- BOOL bHasClipRegion=FALSE );
+ sal_uInt16 nTabFlagMask=0xffff,
+ sal_Bool bHasClipRegion=sal_False );
- SVT_DLLPRIVATE void InitTreeView( WinBits nWinStyle );
+ SVT_DLLPRIVATE void InitTreeView();
SVT_DLLPRIVATE SvLBoxItem* GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
- USHORT nEmptyWidth );
+ sal_uInt16 nEmptyWidth );
+ SVT_DLLPRIVATE void ImplInitStyle();
+
#endif
protected:
SvLBoxButtonData* pCheckButtonData;
- USHORT nTreeFlags;
+ sal_uInt16 nTreeFlags;
SvLBoxEntry* pEdEntry;
SvLBoxItem* pEdItem;
@@ -124,13 +121,13 @@ protected:
// Bitmaps, beim Wechsel des Models usw. automatisch gerufen
virtual void SetTabs();
void SetTabs_Impl();
- void AddTab( long nPos,USHORT nFlags=SV_LBOXTAB_ADJUST_LEFT,
+ void AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
void* pUserData = 0 );
- USHORT TabCount() const { return aTabs.Count(); }
+ sal_uInt16 TabCount() const { return aTabs.Count(); }
SvLBoxTab* GetFirstDynamicTab() const;
- SvLBoxTab* GetFirstDynamicTab( USHORT& rTabPos ) const;
- SvLBoxTab* GetFirstTab( USHORT nFlagMask, USHORT& rTabPos );
- SvLBoxTab* GetLastTab( USHORT nFlagMask, USHORT& rTabPos );
+ SvLBoxTab* GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
+ SvLBoxTab* GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+ SvLBoxTab* GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
SvLBoxTab* GetTab( SvLBoxEntry*, SvLBoxItem* ) const;
void ClearTabList();
@@ -150,8 +147,8 @@ protected:
// in das Control hineingezeichnet werden
virtual void NotifyInvalidating();
- virtual ULONG GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
- virtual ULONG GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual sal_uLong GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
+ virtual sal_uLong GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
virtual void Command( const CommandEvent& rCEvt );
virtual void RequestHelp( const HelpEvent& rHEvt );
@@ -160,11 +157,11 @@ protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual void StateChanged( StateChangedType nStateChange );
- void InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground);
- BOOL IsCellFocusEnabled() const;
- bool SetCurrentTabPos( USHORT _nNewPos );
- USHORT GetCurrentTabPos() const;
- void CallImplEventListeners(ULONG nEvent, void* pData);
+ void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
+ sal_Bool IsCellFocusEnabled() const;
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ sal_uInt16 GetCurrentTabPos() const;
+ void CallImplEventListeners(sal_uLong nEvent, void* pData);
void ImplEditEntry( SvLBoxEntry* pEntry );
@@ -206,16 +203,16 @@ public:
}
virtual SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos=LIST_APPEND, void* pUserData = 0,
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
virtual SvLBoxEntry* InsertEntry( const XubString& rText,
const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp,
SvLBoxEntry* pParent = 0,
- BOOL bChildsOnDemand = FALSE,
- ULONG nPos = LIST_APPEND, void* pUserData = 0,
+ sal_Bool bChildsOnDemand = sal_False,
+ sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
const Image& GetDefaultExpandedEntryBmp( ) const;
@@ -227,8 +224,8 @@ public:
void SetCheckButtonState( SvLBoxEntry*, SvButtonState );
SvButtonState GetCheckButtonState( SvLBoxEntry* ) const;
- void ShowExpandBitmapOnCursor( BOOL );
- BOOL IsExpandBitmapOnCursor() const { return (BOOL)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
+ void ShowExpandBitmapOnCursor( sal_Bool );
+ sal_Bool IsExpandBitmapOnCursor() const { return (sal_Bool)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
void SetEntryText(SvLBoxEntry*, const XubString& );
void SetExpandedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage );
@@ -245,24 +242,24 @@ public:
virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource );
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
- void SetSublistOpenWithReturn( BOOL bMode = TRUE ); // open/close sublist with return/enter
- BOOL IsSublistOpenWithReturn() const;
- void SetSublistOpenWithLeftRight( BOOL bMode = TRUE ); // open/close sublist with cursor left/right
- BOOL IsSublistOpenWithLeftRight() const;
+ void SetSublistOpenWithReturn( sal_Bool bMode = sal_True ); // open/close sublist with return/enter
+ sal_Bool IsSublistOpenWithReturn() const;
+ void SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True ); // open/close sublist with cursor left/right
+ sal_Bool IsSublistOpenWithLeftRight() const;
- void EnableInplaceEditing( BOOL bEnable );
- BOOL IsInplaceEditingEnabled() const { return SvLBox::IsInplaceEditingEnabled(); }
+ void EnableInplaceEditing( sal_Bool bEnable );
+ sal_Bool IsInplaceEditingEnabled() const { return SvLBox::IsInplaceEditingEnabled(); }
inline void ForbidEmptyText() { SvLBox::ForbidEmptyText(); }
// Editiert das erste StringItem des Entries, 0==Cursor
void EditEntry( SvLBoxEntry* pEntry = NULL );
void CancelEditing();
- virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
- virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
- BOOL IsEditingActive() const { return SvLBox::IsEditingActive(); }
- void EndEditing( BOOL bCancel = FALSE ) { SvLBox::EndEditing( bCancel ); }
- BOOL EditingCanceled() const { return SvLBox::EditingCanceled(); }
+ virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ sal_Bool IsEditingActive() const { return SvLBox::IsEditingActive(); }
+ void EndEditing( sal_Bool bCancel = sal_False ) { SvLBox::EndEditing( bCancel ); }
+ sal_Bool EditingCanceled() const { return SvLBox::EditingCanceled(); }
virtual void RequestingChilds( SvLBoxEntry* pParent );
@@ -274,9 +271,9 @@ public:
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
- void SetUpdateMode( BOOL );
+ void SetUpdateMode( sal_Bool );
// aktualisiert nicht die vertikale ScrollBar
- void SetUpdateModeFast( BOOL );
+ void SetUpdateModeFast( sal_Bool );
using SvListView::SetModel;
void SetModel( SvLBoxTreeList* );
@@ -284,19 +281,19 @@ public:
virtual void ModelHasInserted( SvListEntry* pEntry );
virtual void ModelHasInsertedTree( SvListEntry* pEntry );
virtual void ModelIsMoving(SvListEntry* pSource,
- SvListEntry* pTargetParent, ULONG nChildPos );
+ SvListEntry* pTargetParent, sal_uLong nChildPos );
virtual void ModelHasMoved(SvListEntry* pSource );
virtual void ModelIsRemoving( SvListEntry* pEntry );
virtual void ModelHasRemoved( SvListEntry* pEntry );
virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
- void ShowTargetEmphasis( SvLBoxEntry*, BOOL bShow );
+ void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
using Window::GetDropTarget;
SvLBoxEntry* GetDropTarget( const Point& );
void ScrollOutputArea( short nDeltaEntries );
short GetEntryHeight() const { return nEntryHeight; }
- void SetEntryHeight( short nHeight, BOOL bAlways = FALSE );
+ void SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
Size GetOutputSizePixel() const;
short GetIndent() const { return nIndent; }
void SetIndent( short nIndent );
@@ -305,7 +302,7 @@ public:
Point GetEntryPosition( SvLBoxEntry* ) const;
void ShowEntry( SvLBoxEntry* ); // !!!OBSOLETE, use MakeVisible
virtual void MakeVisible( SvLBoxEntry* );
- void MakeVisible( SvLBoxEntry*, BOOL bMoveToTop );
+ void MakeVisible( SvLBoxEntry*, sal_Bool bMoveToTop );
void SetCollapsedNodeBmp( const Image& );
void SetExpandedNodeBmp( const Image& );
@@ -315,18 +312,15 @@ public:
void SetFont( const Font& rFont );
using Window::SetCursor;
- void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE );
-
- SvLBoxEntry* GetEntry( const Point& rPos, BOOL bHit = FALSE ) const;
- SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
- SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
+ void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
- void SetWindowBits( WinBits nWinStyle );
- WinBits GetWindowBits() const { return nWindowStyle; }
+ SvLBoxEntry* GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
+ SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uLong nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
+ SvLBoxEntry* GetEntry( sal_uLong nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
void PaintEntry( SvLBoxEntry* );
long PaintEntry( SvLBoxEntry*, long nLine,
- USHORT nTabFlagMask=0xffff );
+ sal_uInt16 nTabFlagMask=0xffff );
virtual Rectangle GetFocusRect( SvLBoxEntry*, long nLine );
// Beruecksichtigt Einrueckung
virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* );
@@ -337,23 +331,23 @@ public:
void SetDragDropMode( DragDropMode );
void SetSelectionMode( SelectionMode );
- void SetAddMode( BOOL bAdd );
- BOOL IsAddMode() const;
-
- virtual BOOL Expand( SvLBoxEntry* pParent );
- virtual BOOL Collapse( SvLBoxEntry* pParent );
- virtual BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
- virtual ULONG SelectChilds( SvLBoxEntry* pParent, BOOL bSelect );
- virtual void SelectAll( BOOL bSelect, BOOL bPaint = TRUE );
+ void SetAddMode( sal_Bool bAdd );
+ sal_Bool IsAddMode() const;
+
+ virtual sal_Bool Expand( SvLBoxEntry* pParent );
+ virtual sal_Bool Collapse( SvLBoxEntry* pParent );
+ virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
+ virtual sal_uLong SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect );
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
virtual void SetCurEntry( SvLBoxEntry* _pEntry );
virtual SvLBoxEntry*
GetCurEntry() const;
using Window::Invalidate;
- virtual void Invalidate( USHORT nFlags = 0);
- virtual void Invalidate( const Rectangle&, USHORT nFlags = 0 );
+ virtual void Invalidate( sal_uInt16 nFlags = 0);
+ virtual void Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
- void SetHighlightRange(USHORT nFirstTab=0,USHORT nLastTab=0xffff);
+ void SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
void RemoveHighlightRange();
virtual Region GetDragRegion() const;
@@ -362,16 +356,16 @@ public:
void RemoveParentKeepChilds( SvLBoxEntry* pParent );
DECL_LINK( DefaultCompare, SvSortData* );
- virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos );
long GetTextOffset() const;
void EndSelection();
- BOOL IsNodeButton( const Point& rPos ) const;
+ sal_Bool IsNodeButton( const Point& rPos ) const;
void RepaintScrollBars() const;
ScrollBar* GetVScroll();
ScrollBar* GetHScroll();
- void EnableAsyncDrag( BOOL b );
+ void EnableAsyncDrag( sal_Bool b );
SvLBoxEntry* GetFirstEntryInView() const;
SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const;
@@ -384,11 +378,11 @@ public:
void CancelPendingEdit();
virtual PopupMenu* CreateContextMenu( void );
- virtual void ExcecuteContextMenuAction( USHORT nSelectedPopupEntry );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
void EnableContextMenuHandling( void );
- void EnableContextMenuHandling( BOOL bEnable );
- BOOL IsContextMenuHandlingEnabled( void ) const;
+ void EnableContextMenuHandling( sal_Bool bEnable );
+ sal_Bool IsContextMenuHandlingEnabled( void ) const;
void EnableList( bool _bEnable );
diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx
index 271213bda9fc..0759e212bb9f 100644
--- a/svtools/inc/svtools/svxbox.hxx
+++ b/svtools/inc/svtools/svxbox.hxx
@@ -51,16 +51,16 @@ class SVT_DLLPUBLIC SvxBoxEntry
friend class SvxComboBox;
public:
- SvxBoxEntry( const String& aName, USHORT nId=0 );
+ SvxBoxEntry( const String& aName, sal_uInt16 nId=0 );
SvxBoxEntry( const SvxBoxEntry& rOrg );
SvxBoxEntry();
String aName;
- USHORT nId;
+ sal_uInt16 nId;
private:
- BOOL bModified;
- BOOL bNew;
+ sal_Bool bModified;
+ sal_Bool bNew;
};
// class SvxListBox ------------------------------------------------------
@@ -80,30 +80,30 @@ public:
void InsertNewEntry( const SvxBoxEntry& rEntry );
void InsertEntry( const SvxBoxEntry& rEntry,
- USHORT nId = LISTBOX_ENTRY_NOTFOUND );
+ sal_uInt16 nId = LISTBOX_ENTRY_NOTFOUND );
- void RemoveEntry( USHORT nPos );
+ void RemoveEntry( sal_uInt16 nPos );
void RemoveEntry( const SvxBoxEntry& rEntry );
void Clear();
- USHORT GetEntryPos( const SvxBoxEntry& rEntry ) const;
- const SvxBoxEntry& GetSvxBoxEntry( USHORT nIdx ) const;
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSvxBoxEntry( sal_uInt16 nIdx ) const;
- inline BOOL IsEntrySelected( const SvxBoxEntry& rEntry ) const;
- const SvxBoxEntry& GetSelectSvxBoxEntry( USHORT nIdx = 0 ) const;
+ inline sal_Bool IsEntrySelected( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetSelectSvxBoxEntry( sal_uInt16 nIdx = 0 ) const;
inline void SelectEntry( const SvxBoxEntry& rEntry,
- BOOL bSelect = TRUE );
+ sal_Bool bSelect = sal_True );
- void ModifyEntry( USHORT nPos, const String& aName );
- USHORT GetModifiedCount() const;
- const SvxBoxEntry& GetModifiedEntry( USHORT nPos ) const;
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
- USHORT GetRemovedCount() const;
- const SvxBoxEntry& GetRemovedEntry( USHORT nPos ) const;
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
- USHORT GetNewCount() const;
- const SvxBoxEntry& GetNewEntry( USHORT nPos ) const;
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
private:
SvxEntryLst aEntryLst;
@@ -116,10 +116,10 @@ private:
// inlines ---------------------------------------------------------------
-inline BOOL SvxListBox::IsEntrySelected( const SvxBoxEntry& aEntry ) const
+inline sal_Bool SvxListBox::IsEntrySelected( const SvxBoxEntry& aEntry ) const
{ return ListBox::IsEntrySelected( aEntry.aName ); }
-inline void SvxListBox::SelectEntry( const SvxBoxEntry& aEntry, BOOL bSelect )
+inline void SvxListBox::SelectEntry( const SvxBoxEntry& aEntry, sal_Bool bSelect )
{ ListBox::SelectEntry( aEntry.aName, bSelect ); }
// enum SvxComboBoxStyle -------------------------------------------------
@@ -130,11 +130,7 @@ enum SvxComboBoxStyle
SVX_CBS_LOWER = 0x02,
SVX_CBS_ALL = 0x04,
SVX_CBS_FILENAME = 0x08,
-#ifdef WIN
- SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME | SVX_CBS_LOWER
-#else
SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME
-#endif
};
// class SvxComboBox -----------------------------------------------------
@@ -148,33 +144,33 @@ class SVT_DLLPUBLIC SvxComboBox : public ComboBox
public:
SvxComboBox( Window* pParent,
- WinBits nBits = WB_BORDER, USHORT nStyleBits = SVX_CBS_ALL );
- SvxComboBox( Window* pParent, const ResId& rId, USHORT nStyleBits = SVX_CBS_ALL );
+ WinBits nBits = WB_BORDER, sal_uInt16 nStyleBits = SVX_CBS_ALL );
+ SvxComboBox( Window* pParent, const ResId& rId, sal_uInt16 nStyleBits = SVX_CBS_ALL );
~SvxComboBox();
void InsertNewEntry( const SvxBoxEntry& );
void InsertEntry( const SvxBoxEntry& );
- void RemoveEntry( USHORT nPos );
+ void RemoveEntry( sal_uInt16 nPos );
void RemoveEntry( const SvxBoxEntry& rEntry );
void Clear();
- USHORT GetEntryPos( const SvxBoxEntry& rEntry ) const;
- const SvxBoxEntry& GetEntry( USHORT nIdx ) const;
+ sal_uInt16 GetEntryPos( const SvxBoxEntry& rEntry ) const;
+ const SvxBoxEntry& GetEntry( sal_uInt16 nIdx ) const;
- void ModifyEntry( USHORT nPos, const String& aName );
- USHORT GetModifiedCount() const;
- const SvxBoxEntry& GetModifiedEntry( USHORT nPos ) const;
+ void ModifyEntry( sal_uInt16 nPos, const String& aName );
+ sal_uInt16 GetModifiedCount() const;
+ const SvxBoxEntry& GetModifiedEntry( sal_uInt16 nPos ) const;
- USHORT GetRemovedCount() const;
- const SvxBoxEntry& GetRemovedEntry( USHORT nPos ) const;
+ sal_uInt16 GetRemovedCount() const;
+ const SvxBoxEntry& GetRemovedEntry( sal_uInt16 nPos ) const;
- USHORT GetNewCount() const;
- const SvxBoxEntry& GetNewEntry( USHORT nPos ) const;
+ sal_uInt16 GetNewCount() const;
+ const SvxBoxEntry& GetNewEntry( sal_uInt16 nPos ) const;
- USHORT GetStyle() const { return nStyle; }
- void SetStyle( const USHORT nSt ) { nStyle = nSt; }
+ sal_uInt16 GetStyle() const { return nStyle; }
+ void SetStyle( const sal_uInt16 nSt ) { nStyle = nSt; }
String GetText() const;
@@ -182,7 +178,7 @@ private:
SvxEntryLst aEntryLst;
SvxEntryLst aDelEntryLst;
SvxBoxEntry aDefault;
- USHORT nStyle;
+ sal_uInt16 nStyle;
virtual void KeyInput( const KeyEvent& rKEvt );
diff --git a/svtools/inc/sychconv.hxx b/svtools/inc/svtools/sychconv.hxx
index a7fbcf560e7c..73936870157a 100644
--- a/svtools/inc/sychconv.hxx
+++ b/svtools/inc/svtools/sychconv.hxx
@@ -42,7 +42,7 @@ class SymCharConverter
{
public:
- static BOOL Convert( Font& rFont, UniString& rString, OutputDevice* pDev = NULL );
+ static sal_Bool Convert( Font& rFont, UniString& rString, OutputDevice* pDev = NULL );
};
#endif // _CHARCONV_HXX
diff --git a/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx
index 75af1ccd5bdd..b9e9e11fe608 100644
--- a/svtools/inc/svtools/syntaxhighlight.hxx
+++ b/svtools/inc/svtools/syntaxhighlight.hxx
@@ -57,8 +57,6 @@
#include <tools/string.hxx>
#include <tools/gen.hxx>
-#include <svl/svarray.hxx>
-
// Token-Typen TT_...
enum TokenTypes
@@ -76,11 +74,10 @@ enum TokenTypes
TT_PARAMETER
};
-struct HighlightPortion { UINT16 nBegin; UINT16 nEnd; TokenTypes tokenType; };
-
+struct HighlightPortion { sal_uInt16 nBegin; sal_uInt16 nEnd; TokenTypes tokenType; };
-SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16)
+typedef std::vector<HighlightPortion> HighlightPortions;
/////////////////////////////////////////////////////////////////////////
// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum
@@ -113,23 +110,23 @@ class SimpleTokenizer_Impl
{
HighlighterLanguage aLanguage;
// Zeichen-Info-Tabelle
- USHORT aCharTypeTab[256];
+ sal_uInt16 aCharTypeTab[256];
const sal_Unicode* mpStringBegin;
const sal_Unicode* mpActualPos;
// Zeile und Spalte
- UINT32 nLine;
- UINT32 nCol;
+ sal_uInt32 nLine;
+ sal_uInt32 nCol;
sal_Unicode peekChar( void ) { return *mpActualPos; }
sal_Unicode getChar( void ) { nCol++; return *mpActualPos++; }
// Hilfsfunktion: Zeichen-Flag Testen
- BOOL testCharFlags( sal_Unicode c, USHORT nTestFlags );
+ sal_Bool testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags );
// Neues Token holen, Leerstring == nix mehr da
- BOOL getNextToken( /*out*/TokenTypes& reType,
+ sal_Bool getNextToken( /*out*/TokenTypes& reType,
/*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos );
String getTokStr( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos );
@@ -141,16 +138,16 @@ class SimpleTokenizer_Impl
#endif
const char** ppListKeyWords;
- UINT16 nKeyWordCount;
+ sal_uInt16 nKeyWordCount;
public:
SimpleTokenizer_Impl( HighlighterLanguage aLang = HIGHLIGHT_BASIC );
~SimpleTokenizer_Impl( void );
- UINT16 parseLine( UINT32 nLine, const String* aSource );
- void getHighlightPortions( UINT32 nParseLine, const String& rLine,
+ sal_uInt16 parseLine( sal_uInt32 nLine, const String* aSource );
+ void getHighlightPortions( sal_uInt32 nParseLine, const String& rLine,
/*out*/HighlightPortions& portions );
- void setKeyWords( const char** ppKeyWords, UINT16 nCount );
+ void setKeyWords( const char** ppKeyWords, sal_uInt16 nCount );
};
@@ -166,7 +163,7 @@ class SVT_DLLPUBLIC SyntaxHighlighter
HighlighterLanguage eLanguage;
SimpleTokenizer_Impl* m_pSimpleTokenizer;
char* m_pKeyWords;
- UINT16 m_nKeyWordCount;
+ sal_uInt16 m_nKeyWordCount;
// void initializeKeyWords( HighlighterLanguage eLanguage );
@@ -180,10 +177,10 @@ public:
// nur Zeile 0 angegeben werden.
void initialize( HighlighterLanguage eLanguage_ );
- const Range notifyChange( UINT32 nLine, INT32 nLineCountDifference,
- const String* pChangedLines, UINT32 nArrayLength);
+ const Range notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference,
+ const String* pChangedLines, sal_uInt32 nArrayLength);
- void getHighlightPortions( UINT32 nLine, const String& rLine,
+ void getHighlightPortions( sal_uInt32 nLine, const String& rLine,
HighlightPortions& pPortions );
HighlighterLanguage GetLanguage() { return eLanguage;}
diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/svtools/tabbar.hxx
index 30787b284466..a8bdabdb6432 100644
--- a/svtools/inc/tabbar.hxx
+++ b/svtools/inc/svtools/tabbar.hxx
@@ -90,10 +90,10 @@ DoubleClick - Wird gerufen, wenn ein DoubleClick im TabBar ausgeloest
ActivatePage - Wird gerufen, wenn eine andere Seite aktiviert wird.
GetCurPageId() gibt die aktivierte Seite zurueck.
DeactivatePage - Wird gerufen, wenn eine Seite deaktiviert wird. Wenn
- eine andere Seite aktiviert werden darf, muss TRUE
+ eine andere Seite aktiviert werden darf, muss sal_True
zurueckgegeben werden, wenn eine andere Seite von
der Aktivierung ausgeschlossen werden soll, muss
- FALSE zurueckgegeben werden. GetCurPageId() gibt die
+ sal_False zurueckgegeben werden. GetCurPageId() gibt die
zu deaktivierende Seite zurueck.
@@ -108,7 +108,7 @@ werden. Dabei muss in den Handlern folgendes implementiert werden:
Command - Wenn in diesem Handler das Dragging gestartet werden
soll, muss StartDrag() gerufen werden. Diese Methode
selektiert dann den entsprechenden Eintrag oder gibt
- FALSE zurueck, wenn das Dragging nicht durchgefuhert
+ sal_False zurueck, wenn das Dragging nicht durchgefuhert
werden kann.
QueryDrop - Dieser Handler wird von StarView immer dann gerufen, wenn
@@ -166,7 +166,7 @@ SwitchPage - Diese Methode muss vom QueryDrop-Handler gerufen werden,
Das umschalten der Seite passiert zeitverzoegert (500 ms)
und wird automatisch von dieser Methode verwaltet.
In der Methode muss die Position vom Event uebergeben
- werden. Diese Methode gibt TRUE zurueck, wenn die Page
+ werden. Diese Methode gibt sal_True zurueck, wenn die Page
umgeschaltet wurde.
EndSwitchPage - Diese Methode setzt die Daten fuer das umschalten der
@@ -227,7 +227,7 @@ EnableEditMode - Damit kann eingestellt werden, das bei Alt+LeftClick
Im StartRenaming()-Handler kann dann das Umbenennen
noch abgelehnt werden.
StartEditMode - Mit dieser Methode wird der EditModus auf einem
- Tab gestartet. FALSE wird zurueckgegeben, wenn
+ Tab gestartet. sal_False wird zurueckgegeben, wenn
der Editmodus schon aktiv ist, mit StartRenaming()
der Modus abgelehnt wurde oder kein Platz zum
Editieren vorhanden ist.
@@ -248,7 +248,7 @@ GetEditPageId - Mit dieser Methode wird in den Renaming-Handlern
StartRenaming() - Dieser Handler wird gerufen, wenn ueber StartEditMode()
der Editmodus gestartet wurde. Mit GetEditPageId()
kann abgefragt werden, welcher Tab umbenannt werden
- soll. FALSE sollte zurueckgegeben werden, wenn
+ soll. sal_False sollte zurueckgegeben werden, wenn
der Editmodus nicht gestartet werden soll.
AllowRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
beendet wird (nicht bei Cancel). In diesem Handler
@@ -313,7 +313,7 @@ ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
// - TabBarPageBits -
// ------------------
-typedef USHORT TabBarPageBits;
+typedef sal_uInt16 TabBarPageBits;
// -------------------------
// - Bits fuer TabBarPages -
@@ -325,8 +325,8 @@ typedef USHORT TabBarPageBits;
// - TabBar-Types -
// ----------------
-#define TABBAR_RENAMING_YES ((long)TRUE)
-#define TABBAR_RENAMING_NO ((long)FALSE)
+#define TABBAR_RENAMING_YES ((long)sal_True)
+#define TABBAR_RENAMING_NO ((long)sal_False)
#define TABBAR_RENAMING_CANCEL ((long)2)
// ----------
@@ -358,25 +358,25 @@ private:
long mnOffY;
long mnLastOffX;
long mnSplitSize;
- ULONG mnSwitchTime;
+ sal_uLong mnSwitchTime;
WinBits mnWinStyle;
- USHORT mnCurPageId;
- USHORT mnFirstPos;
- USHORT mnDropPos;
- USHORT mnSwitchId;
- USHORT mnEditId;
- BOOL mbFormat;
- BOOL mbFirstFormat;
- BOOL mbSizeFormat;
- BOOL mbAutoMaxWidth;
- BOOL mbInSwitching;
- BOOL mbAutoEditMode;
- BOOL mbEditCanceled;
- BOOL mbDropPos;
- BOOL mbInSelect;
- BOOL mbSelColor;
- BOOL mbSelTextColor;
- BOOL mbMirrored;
+ sal_uInt16 mnCurPageId;
+ sal_uInt16 mnFirstPos;
+ sal_uInt16 mnDropPos;
+ sal_uInt16 mnSwitchId;
+ sal_uInt16 mnEditId;
+ sal_Bool mbFormat;
+ sal_Bool mbFirstFormat;
+ sal_Bool mbSizeFormat;
+ sal_Bool mbAutoMaxWidth;
+ sal_Bool mbInSwitching;
+ sal_Bool mbAutoEditMode;
+ sal_Bool mbEditCanceled;
+ sal_Bool mbDropPos;
+ sal_Bool mbInSelect;
+ sal_Bool mbSelColor;
+ sal_Bool mbSelTextColor;
+ sal_Bool mbMirrored;
bool mbHasInsertTab; // if true, the tab bar has an extra tab at the end.
Link maSelectHdl;
Link maDoubleClickHdl;
@@ -390,20 +390,20 @@ private:
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
- SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bBackground );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bBackground );
SVT_DLLPRIVATE void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
Color& rSelectColor, Color& rSelectTextColor );
- SVT_DLLPRIVATE void ImplShowPage( USHORT nPos );
- SVT_DLLPRIVATE BOOL ImplCalcWidth();
+ SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos );
+ SVT_DLLPRIVATE sal_Bool ImplCalcWidth();
SVT_DLLPRIVATE void ImplFormat();
- SVT_DLLPRIVATE USHORT ImplGetLastFirstPos();
+ SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos();
SVT_DLLPRIVATE void ImplInitControls();
SVT_DLLPRIVATE void ImplEnableControls();
SVT_DLLPRIVATE void ImplSelect();
SVT_DLLPRIVATE void ImplActivatePage();
SVT_DLLPRIVATE long ImplDeactivatePage();
SVT_DLLPRIVATE void ImplPrePaint();
- SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( USHORT nItemCount );
+ SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount );
SVT_DLLPRIVATE Rectangle ImplGetInsertTabRect(ImplTabBarItem* pItem) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* );
@@ -438,102 +438,102 @@ public:
virtual void EndRenaming();
virtual void Mirror();
- void InsertPage( USHORT nPageId, const XubString& rText,
+ void InsertPage( sal_uInt16 nPageId, const XubString& rText,
TabBarPageBits nBits = 0,
- USHORT nPos = TabBar::APPEND );
- void RemovePage( USHORT nPageId );
- void MovePage( USHORT nPageId, USHORT nNewPos );
+ sal_uInt16 nPos = TabBar::APPEND );
+ void RemovePage( sal_uInt16 nPageId );
+ void MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos );
- Color GetTabBgColor( USHORT nPageId ) const;
- void SetTabBgColor( USHORT nPageId, const Color& aTabBgColor );
- BOOL IsDefaultTabBgColor( USHORT nPageId );
+ Color GetTabBgColor( sal_uInt16 nPageId ) const;
+ void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor );
+ sal_Bool IsDefaultTabBgColor( sal_uInt16 nPageId );
void Clear();
- void EnablePage( USHORT nPageId, BOOL bEnable = TRUE );
- BOOL IsPageEnabled( USHORT nPageId ) const;
+ void EnablePage( sal_uInt16 nPageId, sal_Bool bEnable = sal_True );
+ sal_Bool IsPageEnabled( sal_uInt16 nPageId ) const;
- void SetPageBits( USHORT nPageId, TabBarPageBits nBits = 0 );
- TabBarPageBits GetPageBits( USHORT nPageId ) const;
+ void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 );
+ TabBarPageBits GetPageBits( sal_uInt16 nPageId ) const;
- USHORT GetPageCount() const;
- USHORT GetPageId( USHORT nPos ) const;
- USHORT GetPagePos( USHORT nPageId ) const;
- USHORT GetPageId( const Point& rPos, bool bCheckInsTab = false ) const;
- Rectangle GetPageRect( USHORT nPageId ) const;
+ sal_uInt16 GetPageCount() const;
+ sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetPageId( const Point& rPos, bool bCheckInsTab = false ) const;
+ Rectangle GetPageRect( sal_uInt16 nPageId ) const;
// returns the rectangle in which page tabs are drawn
Rectangle GetPageArea() const;
- void SetCurPageId( USHORT nPageId );
- USHORT GetCurPageId() const { return mnCurPageId; }
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const { return mnCurPageId; }
- void SetFirstPageId( USHORT nPageId );
- USHORT GetFirstPageId() const { return GetPageId( mnFirstPos ); }
- void MakeVisible( USHORT nPageId );
+ void SetFirstPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetFirstPageId() const { return GetPageId( mnFirstPos ); }
+ void MakeVisible( sal_uInt16 nPageId );
- void SelectPage( USHORT nPageId, BOOL bSelect = TRUE );
- void SelectPageRange( BOOL bSelect = FALSE,
- USHORT nStartPos = 0,
- USHORT nEndPos = TabBar::APPEND );
- USHORT GetSelectPage( USHORT nSelIndex = 0 ) const;
- USHORT GetSelectPageCount() const;
- BOOL IsPageSelected( USHORT nPageId ) const;
+ void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True );
+ void SelectPageRange( sal_Bool bSelect = sal_False,
+ sal_uInt16 nStartPos = 0,
+ sal_uInt16 nEndPos = TabBar::APPEND );
+ sal_uInt16 GetSelectPage( sal_uInt16 nSelIndex = 0 ) const;
+ sal_uInt16 GetSelectPageCount() const;
+ sal_Bool IsPageSelected( sal_uInt16 nPageId ) const;
- void EnableAutoMaxPageWidth( BOOL bEnable = TRUE ) { mbAutoMaxWidth = bEnable; }
- BOOL IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
+ void EnableAutoMaxPageWidth( sal_Bool bEnable = sal_True ) { mbAutoMaxWidth = bEnable; }
+ sal_Bool IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
void SetMaxPageWidth( long nMaxWidth );
long GetMaxPageWidth() const { return mnMaxPageWidth; }
void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
- BOOL IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
- void EnableEditMode( BOOL bEnable = TRUE ) { mbAutoEditMode = bEnable; }
- BOOL IsEditModeEnabled() const { return mbAutoEditMode; }
- BOOL StartEditMode( USHORT nPageId );
- void EndEditMode( BOOL bCancel = FALSE );
+ void EnableEditMode( sal_Bool bEnable = sal_True ) { mbAutoEditMode = bEnable; }
+ sal_Bool IsEditModeEnabled() const { return mbAutoEditMode; }
+ sal_Bool StartEditMode( sal_uInt16 nPageId );
+ void EndEditMode( sal_Bool bCancel = sal_False );
void SetEditText( const XubString& rText ) { maEditText = rText; }
const XubString& GetEditText() const { return maEditText; }
- BOOL IsInEditMode() const { return (mpEdit != NULL); }
- BOOL IsEditModeCanceled() const { return mbEditCanceled; }
- USHORT GetEditPageId() const { return mnEditId; }
+ sal_Bool IsInEditMode() const { return (mpEdit != NULL); }
+ sal_Bool IsEditModeCanceled() const { return mbEditCanceled; }
+ sal_uInt16 GetEditPageId() const { return mnEditId; }
/** Mirrors the entire control including position of buttons and splitter.
Mirroring is done relative to the current direction of the GUI.
- @param bMirrored TRUE = the control will draw itself RTL in LTR GUI,
- and vice versa; FALSE = the control behaves according to the
+ @param bMirrored sal_True = the control will draw itself RTL in LTR GUI,
+ and vice versa; sal_False = the control behaves according to the
current direction of the GUI. */
- void SetMirrored( BOOL bMirrored = TRUE );
- /** Returns TRUE, if the control is set to mirrored mode (see SetMirrored()). */
- BOOL IsMirrored() const { return mbMirrored; }
+ void SetMirrored( sal_Bool bMirrored = sal_True );
+ /** Returns sal_True, if the control is set to mirrored mode (see SetMirrored()). */
+ sal_Bool IsMirrored() const { return mbMirrored; }
/** Sets the control to LTR or RTL mode regardless of the GUI direction.
- @param bRTL FALSE = the control will draw from left to right;
- TRUE = the control will draw from right to left. */
- void SetEffectiveRTL( BOOL bRTL );
- /** Returns TRUE, if the control draws from right to left (see SetEffectiveRTL()). */
- BOOL IsEffectiveRTL() const;
-
- BOOL StartDrag( const CommandEvent& rCEvt, Region& rRegion );
- USHORT ShowDropPos( const Point& rPos );
+ @param bRTL sal_False = the control will draw from left to right;
+ sal_True = the control will draw from right to left. */
+ void SetEffectiveRTL( sal_Bool bRTL );
+ /** Returns sal_True, if the control draws from right to left (see SetEffectiveRTL()). */
+ sal_Bool IsEffectiveRTL() const;
+
+ sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ sal_uInt16 ShowDropPos( const Point& rPos );
void HideDropPos();
- BOOL SwitchPage( const Point& rPos );
+ sal_Bool SwitchPage( const Point& rPos );
void EndSwitchPage();
- BOOL IsInSwitching() { return mbInSwitching; }
+ sal_Bool IsInSwitching() { return mbInSwitching; }
void SetSelectColor();
void SetSelectColor( const Color& rColor );
const Color& GetSelectColor() const { return maSelColor; }
- BOOL IsSelectColor() const { return mbSelColor; }
+ sal_Bool IsSelectColor() const { return mbSelColor; }
void SetSelectTextColor();
void SetSelectTextColor( const Color& rColor );
const Color& GetSelectTextColor() const { return maSelTextColor; }
- BOOL IsSelectTextColor() const { return mbSelTextColor; }
+ sal_Bool IsSelectTextColor() const { return mbSelTextColor; }
- void SetPageText( USHORT nPageId, const XubString& rText );
- XubString GetPageText( USHORT nPageId ) const;
- void SetHelpText( USHORT nPageId, const XubString& rText );
- XubString GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetPageText( sal_uInt16 nPageId, const XubString& rText );
+ XubString GetPageText( sal_uInt16 nPageId ) const;
+ void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
+ XubString GetHelpText( sal_uInt16 nPageId ) const;
+ void SetHelpId( sal_uInt16 nPageId, const rtl::OString& nHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
long GetSplitSize() const { return mnSplitSize; }
long GetMinSize() const;
@@ -542,9 +542,9 @@ public:
{ Window::SetHelpText( rText ); }
XubString GetHelpText() const
{ return Window::GetHelpText(); };
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
void SetStyle( WinBits nStyle );
diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx
deleted file mode 100644
index dbe9e0a86346..000000000000
--- a/svtools/inc/svtools/table/abstracttablecontrol.hxx
+++ /dev/null
@@ -1,137 +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 SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-
-#include <sal/types.h>
-#include <vcl/event.hxx>
-#include <vcl/seleng.hxx>
-#include "tabletypes.hxx"
-//........................................................................
-namespace svt { namespace table
-{
-//........................................................................
-
- enum TableControlAction
- {
- /// moves the cursor in the table control one row up, if possible, by keeping the current column
- cursorUp,
- /// moves the cursor in the table control one row down, if possible, by keeping the current column
- cursorDown,
- /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
- cursorLeft,
- /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
- cursorRight,
- /// moves the cursor to the beginning of the current line
- cursorToLineStart,
- /// moves the cursor to the end of the current line
- cursorToLineEnd,
- /// moves the cursor to the first row, keeping the current column
- cursorToFirstLine,
- /// moves the cursor to the last row, keeping the current column
- cursorToLastLine,
- /// moves the cursor one page up, keeping the current column
- cursorPageUp,
- /// moves the cursor one page down, keeping the current column
- cursorPageDown,
- /// moves the cursor to the top-most, left-most cell
- cursorTopLeft,
- /// moves the cursor to the bottom-most, right-most cell
- cursorBottomRight,
- /// selects the row, where the actual cursor is
- cursorSelectRow,
- /// selects the rows, above the actual cursor is
- cursorSelectRowUp,
- /// selects the row, beneath the actual cursor is
- cursorSelectRowDown,
- /// selects the row, from the actual cursor till top
- cursorSelectRowAreaTop,
- /// selects the row, from the actual cursor till bottom
- cursorSelectRowAreaBottom,
-
-
- /// invalid and final enumeration value, not to be actually used
- invalidTableControlAction
- };
-
- //====================================================================
- //= IAbstractTableControl
- //====================================================================
- /** defines a callback interface to be implemented by a concrete table control
- */
- class SAL_NO_VTABLE IAbstractTableControl
- {
- public:
- /** hides the cell cursor
-
- The method cares for successive calls, that is, for every call to
- ->hideCursor(), you need one call to ->showCursor. Only if the number
- of both calls matches, the cursor is really shown.
-
- @see showCursor
- */
- virtual void hideCursor() = 0;
-
- /** shows the cell cursor
-
- @see hideCursor
- */
- virtual void showCursor() = 0;
-
- /** dispatches an action to the table control
-
- @return
- <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
- failure conditions include some other instance vetoing the action, or impossibility
- to execute the action at all (for instance moving up one row when already positioned
- on the very first row).
-
- @see TableControlAction
- */
- virtual bool dispatchAction( TableControlAction _eAction ) = 0;
- /** returns selection engine*/
- virtual SelectionEngine* getSelEngine() = 0;
- virtual void setCursorAtCurrentCell(const Point& rPoint) = 0;
- virtual bool isTooltipActive() = 0;
- virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0;
- virtual RowPos getCurrentRow(const Point& rPoint ) = 0;
- virtual void resizeColumn(const Point& rPoint ) = 0;
- virtual bool startResizeColumn(const Point& rPoint) = 0;
- virtual bool endResizeColumn(const Point& rPoint) = 0;
- virtual bool isRowSelected(RowPos _nRow) = 0;
-
- virtual ~IAbstractTableControl() {};
- };
-
-//........................................................................
-} } // namespace svt::table
-//........................................................................
-
-#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/inc/svtools/table/defaultinputhandler.hxx b/svtools/inc/svtools/table/defaultinputhandler.hxx
index 5b035b041a8d..3b05fe15d996 100644
--- a/svtools/inc/svtools/table/defaultinputhandler.hxx
+++ b/svtools/inc/svtools/table/defaultinputhandler.hxx
@@ -28,44 +28,45 @@
#ifndef SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
-#include <svtools/table/tableinputhandler.hxx>
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tabletypes.hxx"
-//........................................................................
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
struct DefaultInputHandler_Impl;
- //====================================================================
+ //==================================================================================================================
//= DefaultInputHandler
- //====================================================================
+ //==================================================================================================================
class DefaultInputHandler : public ITableInputHandler
{
- friend class TableDataWindow;
private:
- DefaultInputHandler_Impl* m_pImpl;
- bool m_bResize;
+ ::boost::scoped_ptr< DefaultInputHandler_Impl > m_pImpl;
public:
DefaultInputHandler();
~DefaultInputHandler();
- virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt );
- virtual bool GetFocus ( IAbstractTableControl& _rControl );
- virtual bool LoseFocus ( IAbstractTableControl& _rControl );
- virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt );
- virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt );
- virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
- virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( ITableControl& _rControl );
+ virtual bool LoseFocus ( ITableControl& _rControl );
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt );
};
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx
index 5430e6859c60..9e3322695439 100644
--- a/svtools/inc/svtools/table/gridtablerenderer.hxx
+++ b/svtools/inc/svtools/table/gridtablerenderer.hxx
@@ -30,6 +30,8 @@
#include <svtools/table/tablemodel.hxx>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace svt { namespace table
{
@@ -44,14 +46,11 @@ namespace svt { namespace table
This class is able to paint a table grid, table headers, and cell
backgrounds according to the selected/active state of cells.
-
- TODO update the documentation when it's decided whether this renderer
- also does value handling
*/
class GridTableRenderer : public ITableRenderer
{
private:
- GridTableRenderer_Impl* m_pImpl;
+ ::boost::scoped_ptr< GridTableRenderer_Impl > m_pImpl;
public:
/** creates a table renderer associated with the given model
@@ -73,9 +72,17 @@ namespace svt { namespace table
This method returns the index of the last row which has been prepared
*/
- RowPos getCurrentRow();
+ RowPos getCurrentRow() const;
+
+ /** determines whether or not to paint grid lines
+ */
+ bool useGridLines() const;
- protected:
+ /** controls whether or not to paint grid lines
+ */
+ void useGridLines( bool const i_use );
+
+ public:
// ITableRenderer overridables
virtual void PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea,
@@ -90,17 +97,34 @@ namespace svt { namespace table
virtual void PaintRowHeader(
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText );
- virtual void PaintCellImage( ColPos _nColumn,
- bool _bActive, bool _bSelected,
- OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, Image* _pCellData );
- virtual void PaintCellString( ColPos _nColumn,
+ const StyleSettings& _rStyle );
+ virtual void PaintCell( ColPos const i_col,
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText );
+ const StyleSettings& _rStyle );
virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ );
+
+ private:
+ struct CellRenderContext;
+
+ void impl_paintCellContent(
+ CellRenderContext const & i_context
+ );
+ void impl_paintCellImage(
+ CellRenderContext const & i_context,
+ Image const & i_image
+ );
+ void impl_paintCellText(
+ CellRenderContext const & i_context,
+ ::rtl::OUString const & i_text
+ );
};
//........................................................................
} } // namespace svt::table
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
index 9ef8d583f273..726490a0710b 100644
--- a/svtools/inc/svtools/table/tablecontrol.hxx
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -29,13 +29,16 @@
#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/table/tablemodel.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/accessibletable.hxx"
+#include "svtools/accessiblefactory.hxx"
+
#include <vcl/ctrl.hxx>
#include <vcl/seleng.hxx>
-#include <svtools/table/tabledatawindow.hxx>
-#include <svtools/accessibletable.hxx>
-#include <com/sun/star/util/Color.hpp>
-#include <svtools/accessiblefactory.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace svt { namespace table
@@ -43,8 +46,6 @@ namespace svt { namespace table
//........................................................................
class TableControl_Impl;
- class TableDataWindow;
- class AccessibleTableControl_Impl;
//====================================================================
//= TableControl
@@ -64,31 +65,19 @@ namespace svt { namespace table
The control supports the concept of a <em>current</em> (or <em>active</em>
cell).
The control supports accessibility, this is encapsulated in IAccessibleTable
-
- // TODO: scrolling?
*/
class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
{
private:
- DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
- DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+ ::boost::shared_ptr< TableControl_Impl > m_pImpl;
- DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
- TableControl_Impl* m_pImpl;
- ::com::sun::star::uno::Sequence< sal_Int32 > m_nCols;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText;
- Link m_aSelectHdl;
- bool m_bSelectionChanged;
- bool m_bTooltip;
public:
- ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
-
TableControl( Window* _pParent, WinBits _nStyle );
~TableControl();
/// sets a new table model
- SVT_DLLPRIVATE void SetModel( PTableModel _pModel );
+ void SetModel( PTableModel _pModel );
/// retrieves the current table model
PTableModel GetModel() const;
@@ -108,9 +97,8 @@ namespace svt { namespace table
*/
sal_Int32 GetCurrentRow() const;
- /** returns the row, which contains the input point*/
-
- ColPos GetCurrentRow (const Point& rPoint);
+ ITableControl&
+ getTableControlInterface();
/** retrieves the current column
@@ -126,7 +114,7 @@ namespace svt { namespace table
/** activates the cell at the given position
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -136,7 +124,7 @@ namespace svt { namespace table
/** moves the active cell to the given column, by keeping the active row
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -149,7 +137,7 @@ namespace svt { namespace table
/** moves the active cell to the given row, by keeping the active column
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -158,22 +146,17 @@ namespace svt { namespace table
{
return GoTo( GetCurrentColumn(), _nRow );
}
- SVT_DLLPRIVATE virtual void Resize();
- virtual void Select();
- SVT_DLLPRIVATE void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return m_aSelectHdl; }
- /**invalidates the table if table has been changed e.g. new row added
- */
- void InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved);
- /**gets the vector, which contains the selected rows
- */
- std::vector<sal_Int32>& GetSelectedRows();
- /**after removing a row, updates the vector which contains the selected rows
- if the row, which should be removed, is selected, it will be erased from the vector
- */
- SelectionEngine* getSelEngine();
- TableDataWindow* getDataWindow();
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+ void SetSelectHdl( const Link& rLink );
+ const Link& GetSelectHdl() const;
+
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ Window& getDataWindow();
// Window overridables
virtual void GetFocus();
@@ -181,55 +164,55 @@ namespace svt { namespace table
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void StateChanged( StateChangedType i_nStateChange );
- /** Creates and returns the accessible object of the whole GridControl. */
- SVT_DLLPRIVATE virtual XACC CreateAccessible();
- SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
- SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
- SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
- SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
- virtual void FillAccessibleStateSet(
- ::utl::AccessibleStateSetHelper& rStateSet,
- AccessibleTableControlObjType eObjType ) const;
- //// Window
- virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
- virtual void GrabFocus();
- virtual XACC GetAccessible( BOOL bCreate = TRUE );
- virtual Window* GetAccessibleParentWindow() const;
- virtual Window* GetWindowInstance();
- virtual sal_Int32 GetAccessibleControlCount() const;
- virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
- virtual long GetRowCount() const;
- virtual long GetColumnCount() const;
- virtual sal_Bool HasRowHeader() const;
- virtual sal_Int32 GetSelectedRowCount() const;
- virtual bool IsRowSelected( long _nRow ) const;
- virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
- virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen = TRUE );
- virtual Rectangle calcTableRect( BOOL _bOnScreen = TRUE );
- virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
- virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
- virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
- virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
- virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
- virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
- virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
- virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
- virtual sal_Bool HasRowHeader();
- virtual sal_Bool HasColHeader();
- virtual sal_Bool isAccessibleAlive( ) const;
- virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue );
- virtual void RemoveSelectedRow(RowPos _nRowPos);
- virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
- ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip();
- ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip();
- void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols);
- void clearSelection();
- void selectionChanged(bool _bChanged);
- bool isTooltip();
-
- protected:
- /// retrieves the XAccessible implementation associated with the GridControl instance
- ::svt::IAccessibleFactory& getAccessibleFactory();
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual XACC CreateAccessible();
+ SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const;
+
+ // .............................................................................................................
+ // IAccessibleTable
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select );
+ virtual void SelectAllRows( bool const i_select );
+ // .............................................................................................................
+
+ private:
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
private:
TableControl(); // never implemented
diff --git a/svtools/inc/svtools/table/tablecontrolinterface.hxx b/svtools/inc/svtools/table/tablecontrolinterface.hxx
new file mode 100644
index 000000000000..74e9688d01db
--- /dev/null
+++ b/svtools/inc/svtools/table/tablecontrolinterface.hxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablemodel.hxx"
+
+class Pointer;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TableControlAction
+ //==================================================================================================================
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //==================================================================================================================
+ //= TableCellArea
+ //==================================================================================================================
+ enum TableCellArea
+ {
+ CellContent,
+ ColumnDivider
+ };
+
+ //==================================================================================================================
+ //= TableCell
+ //==================================================================================================================
+ struct TableCell
+ {
+ ColPos nColumn;
+ RowPos nRow;
+ TableCellArea eArea;
+
+ TableCell()
+ :nColumn( COL_INVALID )
+ ,nRow( ROW_INVALID )
+ ,eArea( CellContent )
+ {
+ }
+
+ TableCell( ColPos const i_column, RowPos const i_row )
+ :nColumn( i_column )
+ ,nRow( i_row )
+ ,eArea( CellContent )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ColumnMetrics
+ //==================================================================================================================
+ struct ColumnMetrics
+ {
+ /** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
+ area.
+ */
+ long nStartPixel;
+
+ /** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of a all columns
+ up to the current one.
+ */
+ long nEndPixel;
+
+ ColumnMetrics()
+ :nStartPixel(0)
+ ,nEndPixel(0)
+ {
+ }
+
+ ColumnMetrics( long const i_start, long const i_end )
+ :nStartPixel( i_start )
+ ,nEndPixel( i_end )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= TableArea
+ //==================================================================================================================
+ enum TableArea
+ {
+ TableAreaColumnHeaders,
+ TableAreaRowHeaders,
+ TableAreaDataArea,
+ TableAreaAll
+ };
+
+ //==================================================================================================================
+ //= ITableControl
+ //==================================================================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE ITableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+
+ /** returns the table model
+
+ The returned model is guaranteed to not be <NULL/>.
+ */
+ virtual PTableModel getModel() const = 0;
+
+ /// returns the index of the currently active column
+ virtual ColPos getCurrentColumn() const = 0;
+
+ /// returns the index of the currently active row
+ virtual RowPos getCurrentRow() const = 0;
+
+ /// activates the given cell
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row ) = 0;
+
+ /// retrieves the size of the table window, in pixels
+ virtual ::Size getTableSizePixel() const = 0;
+
+ /// sets a new mouse pointer for the table window
+ virtual void setPointer( Pointer const & i_pointer ) = 0;
+
+ /// captures the mouse to the table window
+ virtual void captureMouse() = 0;
+
+ /// releases the mouse, after it had previously been captured
+ virtual void releaseMouse() = 0;
+
+ /// invalidates the table window
+ virtual void invalidate( TableArea const i_what ) = 0;
+
+ /// calculates a width, given in pixels, into a AppFont-based width
+ virtual long pixelWidthToAppFont( long const i_pixels ) const = 0;
+
+ /// shows a trackign rectangle
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags ) = 0;
+
+ /// hides a prviously shown tracking rectangle
+ virtual void hideTracking() = 0;
+
+ /// does a hit test for the given pixel coordinates
+ virtual TableCell hitTest( const Point& rPoint ) const = 0;
+
+ /// retrieves the metrics for a given column
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const = 0;
+
+ /// determines whether a given row is selected
+ virtual bool isRowSelected( RowPos _nRow ) const = 0;
+
+ virtual ~ITableControl() {};
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/tableinputhandler.hxx b/svtools/inc/svtools/table/tableinputhandler.hxx
index 32d7f06b6482..a3153d96e8ac 100644
--- a/svtools/inc/svtools/table/tableinputhandler.hxx
+++ b/svtools/inc/svtools/table/tableinputhandler.hxx
@@ -41,7 +41,7 @@ namespace svt { namespace table
{
//........................................................................
- class IAbstractTableControl;
+ class ITableControl;
//====================================================================
//= ITableInputHandler
@@ -57,16 +57,16 @@ namespace svt { namespace table
// or whether it has been sufficiently handled by the ->ITableInputHandler instance
// (<FALSE/>).
- virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt ) = 0;
- virtual bool GetFocus ( IAbstractTableControl& _rControl ) = 0;
- virtual bool LoseFocus ( IAbstractTableControl& _rControl ) = 0;
- virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt ) = 0;
- virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt ) = 0;
- virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
- virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( ITableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
virtual ~ITableInputHandler() { }
};
diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
index c463b8da91ab..6e962befefc8 100644..100755
--- a/svtools/inc/svtools/table/tablemodel.hxx
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -29,16 +29,22 @@
#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/table/tabletypes.hxx>
-#include <svtools/table/tablerenderer.hxx>
-#include <svtools/table/tableinputhandler.hxx>
-#include <rtl/ref.hxx>
-#include <sal/types.h>
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablerenderer.hxx"
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tablesort.hxx"
+
#include <com/sun/star/util/Color.hpp>
-#include <boost/shared_ptr.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/style/HorizontalAlignment.hpp>
+#include <rtl/ref.hxx>
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
//........................................................................
namespace svt { namespace table
{
@@ -46,19 +52,6 @@ namespace svt { namespace table
//====================================================================
- //= cell data
- //====================================================================
- struct TableContentType
- {
- ::rtl::OUString sContent;
- Image* pImage;
- TableContentType() :
- sContent(),
- pImage( )
- {
- }
- };
- //====================================================================
//= ScrollbarVisibility
//====================================================================
enum ScrollbarVisibility
@@ -79,13 +72,24 @@ namespace svt { namespace table
//====================================================================
//= ITableModelListener
//====================================================================
+ typedef sal_Int32 ColumnAttributeGroup;
+ #define COL_ATTRS_NONE (0x00000000)
+ /// denotes column attributes related to the width of the column
+ #define COL_ATTRS_WIDTH (0x00000001)
+ /// denotes column attributes related to the appearance of the column, i.e. those relevant for rendering
+ #define COL_ATTRS_APPEARANCE (0x00000002)
+ /// denotes the entirety of column attributes
+ #define COL_ATTRS_ALL (0x7FFFFFFF)
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
/** declares an interface to be implemented by components interested in
changes in an ->ITableModel
*/
- class SAL_NO_VTABLE ITableModelListener
+ class SAL_NO_VTABLE ITableModelListener : public ::boost::enable_shared_from_this< ITableModelListener >
{
public:
- //virtual void onTableModelChanged(PTableModel pTableModel) = 0;
/** notifies the listener that one or more rows have been inserted into
the table
@@ -101,7 +105,8 @@ namespace svt { namespace table
the table
@param first
- the old index of the first removed row
+ the old index of the first removed row. If this is <code>-1</code>, then all
+ rows have been removed from the model.
@param last
the old index of the last removed row. Must not be smaller
than ->first
@@ -117,27 +122,19 @@ namespace svt { namespace table
the index of the last newly inserted row. Must not be smaller
than ->first
*/
- virtual void columnsInserted( ColPos first, ColPos last ) = 0;
+ virtual void columnInserted( ColPos const i_colIndex ) = 0;
/** notifies the listener that one or more columns have been removed from
the table
- @param first
- the old index of the first removed row
- @param last
- the old index of the last removed row. Must not be smaller
- than ->first
+ @param i_colIndex
+ the old index of the removed column
*/
- virtual void columnsRemoved( ColPos first, ColPos last ) = 0;
-
- /** notifies the listener that a column in the table has moved
+ virtual void columnRemoved( ColPos const i_colIndex ) = 0;
- @param oldIndex
- the old index of the column within the model
- @param newIndex
- the new index of the column within the model
+ /** notifies the listener that all columns have been removed form the model
*/
- virtual void columnMoved( ColPos oldIndex, ColPos newIndex ) = 0;
+ virtual void allColumnsRemoved() = 0;
/** notifies the listener that a rectangular cell range in the table
has been updated
@@ -146,7 +143,24 @@ namespace svt { namespace table
they have about the cells in question, in particular any possibly
cached cell values.
*/
- virtual void cellsUpdated( ColPos firstCol, ColPos lastCol, RowPos firstRow, RowPos lastRow ) = 0;
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
+
+ /** notifies the listener that attributes of a given column changed
+
+ @param i_column
+ the position of the column whose attributes changed
+ @param i_attributeGroup
+ a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
+ in which changes occurred.
+ */
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
+
+ /** notifies the listener that the metrics of the table changed.
+
+ Metrics here include the column header height, the row header width, the row height, and the presence
+ of both the row and column header.
+ */
+ virtual void tableMetricsChanged() = 0;
/// deletes the listener instance
virtual ~ITableModelListener(){};
@@ -173,7 +187,8 @@ namespace svt { namespace table
@see setID
*/
- virtual ColumnID getID() const = 0;
+ virtual ::com::sun::star::uno::Any
+ getID() const = 0;
/** sets a new column ID
@@ -184,7 +199,7 @@ namespace svt { namespace table
@see getID
*/
- virtual bool setID( const ColumnID _nID ) = 0;
+ virtual void setID( const ::com::sun::star::uno::Any& _nID ) = 0;
/** returns the name of the column
@@ -201,7 +216,15 @@ namespace svt { namespace table
*/
virtual void setName( const String& _rName ) = 0;
- /** determines whether the column can be resized
+ /** retrieves the help text to be displayed for the column.
+ */
+ virtual String getHelpText() const = 0;
+
+ /** sets a new the help text to be displayed for the column.
+ */
+ virtual void setHelpText( const String& i_helpText ) = 0;
+
+ /** determines whether the column can be interactively resized
@see getMinWidth
@see getMaxWidth
@@ -217,40 +240,41 @@ namespace svt { namespace table
*/
virtual void setResizable( bool _bResizable ) = 0;
- /** returns the width of the column, in 1/100 millimeters
+ /** denotes the relative flexibility of the column
- The returned value must be a positive ->TableMetrics value.
+ This flexibility is taken into account when a table control auto-resizes its columns, because the available
+ space changed. In this case, the columns grow or shrink according to their flexibility.
- It can also be COLWIDTH_FIT_TO_VIEW, to indicate that the width of the column
- should automatically be adjusted to completely fit the view. For instance, a
- model's last column could return this value, to indicate that it is to occupy
- all horizontal space remaining in the view, after all other columns have been
- layouted.
+ A value of 0 means the column is not auto-resized at all.
+ */
+ virtual sal_Int32 getFlexibility() const = 0;
- If there is more than one column with width COLWIDTH_FIT_TO_VIEW in a model,
- they're all layouted equal-width.
+ /** sets a new flexibility value for the column
- If the columns with a read width (i.e. other than COLWIDTH_FIT_TO_VIEW) are,
- in sum, wider than the view, then the view is free to choose a real width for any
- columns which return COLWIDTH_FIT_TO_VIEW here.
+ @see getFlexibility
+ */
+ virtual void setFlexibility( sal_Int32 const i_flexibility ) = 0;
+
+ /** returns the width of the column, in app-font unitss
+
+ The returned value must be a positive ->TableMetrics value.
@see setWidth
@see getMinWidth
@see getMaxWidth
- @see COLWIDTH_FIT_TO_VIEW
*/
virtual TableMetrics getWidth() const = 0;
/** sets a new width for the column
@param _nWidth
- the new width, in 1/100 millimeters
+ the new width, app-font units
@see getWidth
*/
virtual void setWidth( TableMetrics _nWidth ) = 0;
- /** returns the minimum width of the column, in 1/100 millimeters, or 0 if the column
+ /** returns the minimum width of the column, in app-font units, or 0 if the column
does not have a minimal width
@see setMinWidth
@@ -259,7 +283,7 @@ namespace svt { namespace table
*/
virtual TableMetrics getMinWidth() const = 0;
- /** sets the minimum width of the column, in 1/100 millimeters
+ /** sets the minimum width of the column, in app-font units
@see getMinWidth
@see setMaxWidth
@@ -267,7 +291,7 @@ namespace svt { namespace table
*/
virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
- /** returns the maximum width of the column, in 1/100 millimeters, or 0 if the column
+ /** returns the maximum width of the column, in app-font units, or 0 if the column
does not have a minimal width
@see setMaxWidth
@@ -276,7 +300,7 @@ namespace svt { namespace table
*/
virtual TableMetrics getMaxWidth() const = 0;
- /** sets the maximum width of the column, in 1/100 millimeters
+ /** sets the maximum width of the column, in app-font units
@see getMaxWidth
@see setMinWidth
@@ -284,24 +308,14 @@ namespace svt { namespace table
*/
virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
- /** returns the preferred width of the column, or 0 if the column
- does not have a preferred width.
-
- @see setMaxWidth
- @see getMinWidth
- @see getWidth
+ /** retrieves the horizontal alignment to be used for content in this cell
*/
- virtual TableMetrics getPreferredWidth() const = 0;
- /** sets the preferred width of the column, to be used when user resizes column
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
- @see getMaxWidth
- @see setMinWidth
- @see setWidth
+ /** sets a new the horizontal alignment to be used for content in this cell
*/
- virtual void setPreferredWidth( TableMetrics _nPrefWidth ) = 0;
-
- virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0;
+
/// deletes the column model instance
virtual ~IColumnModel() { }
};
@@ -323,9 +337,6 @@ namespace svt { namespace table
*/
virtual TableSize getRowCount() const = 0;
- SVT_DLLPRIVATE virtual void setColumnCount(TableSize _nColCount) = 0;
- SVT_DLLPRIVATE virtual void setRowCount(TableSize _nRowCount) = 0;
-
/** determines whether the table has column headers
If this method returns <TRUE/>, the renderer returned by
@@ -334,15 +345,6 @@ namespace svt { namespace table
@see IColumnRenderer
*/
virtual bool hasColumnHeaders() const = 0;
- /** sets whether the table should have row headers
- @see IColumnRenderer
- */
- SVT_DLLPRIVATE virtual void setRowHeaders( bool rowHeaders) = 0;
-
- /** sets whether the table should have column headers
- @see IColumnRenderer
- */
- SVT_DLLPRIVATE virtual void setColumnHeaders( bool columnHeaders) = 0;
/** determines whether the table has row headers
@@ -360,14 +362,6 @@ namespace svt { namespace table
*/
virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
- /** adds the given listener to the list of ->ITableModelListener's
- */
- SVT_DLLPRIVATE virtual void addTableModelListener( const PTableModelListener& listener ) = 0;
-
- /** revokes the given listener from the list of ->ITableModelListener's
- */
- SVT_DLLPRIVATE virtual void removeTableModelListener( const PTableModelListener& listener ) = 0;
-
/** returns a model for a certain column
@param column
@@ -376,27 +370,15 @@ namespace svt { namespace table
@return
the model of the column in question. Must not be <NULL/>
-
- @see getColumnModelByID
*/
virtual PColumnModel getColumnModel( ColPos column ) = 0;
- /** finds a column model by ID
-
- @param id
- the id of the column which is to be looked up
- @return
- the column model with the given ID, or <NULL/> if there is
- no such column
- */
- virtual PColumnModel getColumnModelByID( ColumnID id ) = 0;
-
/** returns a renderer which is able to paint the table represented
by this table model
@return the renderer to use. Must not be <NULL/>
*/
- SVT_DLLPRIVATE virtual PTableRenderer getRenderer() const = 0;
+ virtual PTableRenderer getRenderer() const = 0;
/** returns the component handling input in a view associated with the model
*/
@@ -405,12 +387,10 @@ namespace svt { namespace table
/** determines the height of rows in the table.
@return
- the logical height of rows in the table, in 1/100 millimeters. The height must be
+ the logical height of rows in the table, in app-font units. The height must be
greater 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getRowHeight() const = 0;
-
- SVT_DLLPRIVATE virtual void setRowHeight(TableMetrics _nRowHeight) = 0;
+ virtual TableMetrics getRowHeight() const = 0;
/** determines the height of the column header row
@@ -418,10 +398,10 @@ namespace svt { namespace table
returned <FALSE/>.
@return
- the logical height of the column header row, in 1/100 millimeters.
+ the logical height of the column header row, in app-font units.
Must be greater than 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getColumnHeaderHeight() const = 0;
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
/** determines the width of the row header column
@@ -429,48 +409,105 @@ namespace svt { namespace table
returned <FALSE/>.
@return
- the logical width of the row header column, in 1/100 millimeters.
+ the logical width of the row header column, in app-font units.
Must be greater than 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getRowHeaderWidth() const = 0;
+ virtual TableMetrics getRowHeaderWidth() const = 0;
- /** determines the visibility of the vertical scrollbar of the table control
- @param overAllHeight the height of the table with all rows
- @param actHeight the given height of the table
+ /** returns the visibilit mode of the vertical scrollbar
*/
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight,int actHeight) const = 0;
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const = 0;
- /** determines the visibility of the horizontal scrollbar of the table control
- @param overAllWidth the width of the table with all columns
- @param actWidth the given width of the table
+ /** returns the visibilit mode of the horizontal scrollbar
*/
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const = 0;
- virtual bool hasVerticalScrollbar() =0;
- virtual bool hasHorizontalScrollbar() = 0;
- /** fills cells with content
- */
- virtual void setCellContent(const std::vector< std::vector< ::com::sun::star::uno::Any > >& cellContent)=0;
- /** gets the content of the cells
- */
- virtual std::vector< std::vector< ::com::sun::star::uno::Any > >& getCellContent() = 0;
- /**sets title of header rows
- */
- SVT_DLLPRIVATE virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0;
- /** gets title of header rows
- */
- virtual std::vector<rtl::OUString>& getRowHeaderName() = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getLineColor() = 0;
- SVT_DLLPRIVATE virtual void setLineColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getHeaderBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getTextColor() = 0;
- SVT_DLLPRIVATE virtual void setTextColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getOddRowBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getEvenRowBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() = 0;
- SVT_DLLPRIVATE virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _xAlign) = 0;
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const = 0;
+
+ /** adds a listener to be notified of changes in the table model
+ */
+ virtual void addTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** remove a listener to be notified of changes in the table model
+ */
+ virtual void removeTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** retrieves the content of the given cell
+ */
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent ) = 0;
+
+ /** returns an object which should be displayed as tooltip for the given cell
+
+ At the moment, only string-convertible values are supported here. In the future, one might imagine displaying
+ scaled-down versions of a graphic in a cell, and a larger version of that very graphic as tooltip.
+
+ If no tooltip object is provided, then the cell content is used, and displayed as tooltip for the cell
+ if and only if it doesn't fit into the cell's space itself.
+
+ @param i_col
+ The column index of the cell in question. COL_ROW_HEADERS is a valid argument here.
+ @param i_row
+ The row index of the cell in question.
+ @param o_cellToolTip
+ takes the tooltip object upon return.
+ */
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip ) = 0;
+
+ /** retrieves title of a given row
+ */
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
+
+ /** returns the color to be used for rendering the grid lines.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getLineColor() const = 0;
+
+ /** returns the color to be used for rendering the header background.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const = 0;
+
+ /** returns the color to be used for rendering the header text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const = 0;
+
+ /** returns the color to be used for rendering cell texts.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextColor() const = 0;
+
+ /** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextLineColor() const = 0;
+
+ /** returns the colors to be used for the row backgrounds.
+
+ If this value is not set, every second row will have a background color derived from the style settings's
+ selection color, the other rows will not have a special background at all.
+
+ If this value is an empty sequence, the rows will not have a special background at all, instead the
+ normal background of the complete control will be used.
+
+ If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
+ in alternating order.
+ */
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const = 0;
+
+ /** determines the vertical alignment of content within a cell
+ */
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const = 0;
+
+ /** returns an adapter to the sorting functionality of the model
+
+ It is legitimate to return <NULL/> here, in this case, the table model does not support sorting.
+ */
+ virtual ITableDataSort* getSortAdapter() = 0;
/// destroys the table model instance
virtual ~ITableModel() { }
diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx
index a875f435d9eb..a0fc93b665c3 100644
--- a/svtools/inc/svtools/table/tablerenderer.hxx
+++ b/svtools/inc/svtools/table/tablerenderer.hxx
@@ -47,6 +47,7 @@ namespace svt { namespace table
class SAL_NO_VTABLE ITableRenderer
{
public:
+
/** paints a (part of) header area
There are two header areas in a table control:
@@ -176,12 +177,10 @@ namespace svt { namespace table
the are into which the row header should be painted
@param _rStyle
the style to be used for drawing
- @param _rText
- the title of the header row
*/
virtual void PaintRowHeader( bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+ const StyleSettings& _rStyle ) = 0;
/** paints a certain cell
@@ -208,46 +207,11 @@ namespace svt { namespace table
the are into which the cell should be painted
@param _rStyle
the style to be used for drawing
- @param _pCellData
- the content of the cell
*/
- virtual void PaintCellImage( ColPos _nColumn,
+ virtual void PaintCell( ColPos const i_col,
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, Image* _pCellData ) = 0;
-
- /** paints a certain cell
-
- The row to be painted is denoted by the most recent call to
- ->PrepareRow.
-
- @param _bSelected
- <TRUE/> if and only if the cell to be painted is
- selected currently. This is the case if either
- the row or the column of the cell is currently selected.
- <br/>
- Note that this flag is equal to the respective flag in the
- previous ->PrepareRow call, it's passed here for convinience
- only.
- @param _bActive
- <TRUE/> if the cell is currently active.
- <br/>
- Note that this flag is equal to the respective flag in the
- previous ->PrepareRow call, it's passed here for convinience
- only.
- @param _rDevice
- denotes the device to paint onto
- @param _rArea
- the are into which the cell should be painted
- @param _rStyle
- the style to be used for drawing
- @param _rText
- the content of the cell
- */
- virtual void PaintCellString( ColPos _nColumn,
- bool _bActive, bool _bSelected,
- OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+ const StyleSettings& _rStyle ) = 0;
/** draws a cell cursor in the given rectangle
@@ -263,6 +227,41 @@ namespace svt { namespace table
*/
virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+ /** checks whether a given cell content fits into a given target area on a given device.
+
+ @param i_colPos
+ denotes the column which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different columns.
+
+ @param i_rowPos
+ denotes the row which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different rows.
+
+ @param i_active
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for the active
+ cell.
+
+ @param i_selected
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for a selected
+ cell.
+
+ @param i_targetDevice
+ denotes the target device for the assumed rendering operation
+
+ @param i_targetArea
+ denotes the area within the target device for the assumed rendering operation.
+
+ @return
+ <TRUE/> if and only if the given cell content could be rendered into the given device and the
+ given area.
+ */
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) = 0;
+
/// deletes the renderer instance
virtual ~ITableRenderer() { }
};
diff --git a/svtools/inc/svtools/table/tablesort.hxx b/svtools/inc/svtools/table/tablesort.hxx
new file mode 100755
index 000000000000..1690b4d51344
--- /dev/null
+++ b/svtools/inc/svtools/table/tablesort.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_TABLESORT_HXX
+#define SVTOOLS_TABLESORT_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ColumnSortDirection
+ //==================================================================================================================
+ enum ColumnSortDirection
+ {
+ ColumnSortAscending,
+ ColumnSortDescending
+ };
+
+ //==================================================================================================================
+ //= ColumnSort
+ //==================================================================================================================
+ struct ColumnSort
+ {
+ ColPos nColumnPos;
+ ColumnSortDirection eSortDirection;
+
+ ColumnSort()
+ :nColumnPos( COL_INVALID )
+ ,eSortDirection( ColumnSortAscending )
+ {
+ }
+
+ ColumnSort( ColPos const i_columnPos, ColumnSortDirection const i_sortDirection )
+ :nColumnPos( i_columnPos )
+ ,eSortDirection( i_sortDirection )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ITableDataSort
+ //==================================================================================================================
+ /** provides sorting functionality for the datta underlying an ITableModel
+ */
+ class SAL_NO_VTABLE ITableDataSort
+ {
+ public:
+ /** sorts the rows in the model by the given column's data, in the given direction.
+ */
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
+
+ /** retrieves the current sort order of the data
+
+ If the <code>nColumnIndex</code> member of the returned srtructure is <code>COL_INVALID</code>, then
+ the data is currently not sorted.
+ */
+ virtual ColumnSort getCurrentSortOrder() const = 0;
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_TABLESORT_HXX
diff --git a/svtools/inc/svtools/table/tabletypes.hxx b/svtools/inc/svtools/table/tabletypes.hxx
index d8ef737b388c..2fd5a550b782 100644
--- a/svtools/inc/svtools/table/tabletypes.hxx
+++ b/svtools/inc/svtools/table/tabletypes.hxx
@@ -50,14 +50,7 @@ namespace svt { namespace table
*/
typedef sal_Int32 AnyPos;
- /// the ID of a column in a table
- typedef sal_Int32 ColumnID;
-
typedef sal_Int32 TableMetrics;
-/** special column width value which indicates that the column should be
- automatically resized to fit the view
-*/
-#define COLWIDTH_FIT_TO_VIEW ((::svt::table::TableMetrics)-1)
/// denotes the column containing the row headers
#define COL_ROW_HEADERS ((::svt::table::ColPos)-1)
diff --git a/svtools/inc/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx
index 129ccf76803f..4fb126e5eefe 100644
--- a/svtools/inc/taskbar.hxx
+++ b/svtools/inc/svtools/taskbar.hxx
@@ -147,11 +147,11 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
- void InsertButton( USHORT nItemId,
+ void InsertButton( sal_uInt16 nItemId,
const Image& rImage, const String& rText,
- USHORT nPos = TOOLBOX_APPEND )
+ sal_uInt16 nPos = TOOLBOX_APPEND )
{ InsertItem( nItemId, rImage, rText, TIB_LEFT | TIB_AUTOSIZE, nPos ); }
- void RemoveButton( USHORT nItemId )
+ void RemoveButton( sal_uInt16 nItemId )
{ RemoveItem( nItemId ); }
};
@@ -174,10 +174,10 @@ private:
size_t mnUpdateNewPos;
size_t mnActiveItemId;
size_t mnNewActivePos;
- USHORT mnSmallItem;
- USHORT mnDummy2;
- BOOL mbMinActivate;
- BOOL mbDummy1;
+ sal_uInt16 mnSmallItem;
+ sal_uInt16 mnDummy2;
+ sal_Bool mbMinActivate;
+ sal_Bool mbDummy1;
Link maActivateTaskHdl;
Link maContextMenuHdl;
@@ -193,8 +193,8 @@ public:
TaskToolBox( Window* pParent, WinBits nWinStyle = 0 );
~TaskToolBox();
- void ActivateTaskItem( USHORT nItemId,
- BOOL bMinActivate = FALSE );
+ void ActivateTaskItem( sal_uInt16 nItemId,
+ sal_Bool bMinActivate = sal_False );
virtual void ActivateTask();
virtual void ContextMenu();
@@ -208,11 +208,11 @@ public:
void StartUpdateTask();
void UpdateTask( const Image& rImage, const String& rText,
- BOOL bActive = FALSE );
+ sal_Bool bActive = sal_False );
void EndUpdateTask();
const Point& GetContextMenuPos() const { return maContextMenuPos; }
- BOOL IsMinActivate() const { return mbMinActivate; }
+ sal_Bool IsMinActivate() const { return mbMinActivate; }
void SetActivateTaskHdl( const Link& rLink ) { maActivateTaskHdl = rLink; }
const Link& GetActivateTaskHdl() const { return maActivateTaskHdl; }
@@ -227,18 +227,18 @@ public:
class ITaskStatusNotify
{
public:
- virtual BOOL MouseButtonDown( USHORT nItemd, const MouseEvent& rMEvt );
- virtual BOOL MouseButtonUp( USHORT nItemd, const MouseEvent& rMEvt );
- virtual BOOL MouseMove( USHORT nItemd, const MouseEvent& rMEvt );
- virtual BOOL Command( USHORT nItemd, const CommandEvent& rCEvt );
- virtual BOOL UpdateHelp( USHORT nItemd );
+ virtual sal_Bool MouseButtonDown( sal_uInt16 nItemd, const MouseEvent& rMEvt );
+ virtual sal_Bool MouseButtonUp( sal_uInt16 nItemd, const MouseEvent& rMEvt );
+ virtual sal_Bool MouseMove( sal_uInt16 nItemd, const MouseEvent& rMEvt );
+ virtual sal_Bool Command( sal_uInt16 nItemd, const CommandEvent& rCEvt );
+ virtual sal_Bool UpdateHelp( sal_uInt16 nItemd );
};
// -----------------------
// - TaskStatusFieldItem -
// -----------------------
-#define TASKSTATUSFIELDITEM_FLASH ((USHORT)0x0001)
+#define TASKSTATUSFIELDITEM_FLASH ((sal_uInt16)0x0001)
class TaskStatusFieldItem
{
@@ -247,8 +247,8 @@ private:
Image maImage;
XubString maQuickHelpText;
XubString maHelpText;
- ULONG mnHelpId;
- USHORT mnFlags;
+ rtl::OString maHelpId;
+ sal_uInt16 mnFlags;
public:
TaskStatusFieldItem();
@@ -257,7 +257,7 @@ public:
const Image& rImage,
const XubString& rQuickHelpText,
const XubString& rHelpText,
- USHORT nFlags );
+ sal_uInt16 nFlags );
~TaskStatusFieldItem();
void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; }
@@ -268,10 +268,10 @@ public:
const XubString& GetQuickHelpText() const { return maQuickHelpText; }
void SetHelpText( const XubString& rStr ) { maHelpText = rStr; }
const XubString& GetHelpText() const { return maHelpText; }
- void SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; }
- ULONG GetHelpId() const { return mnHelpId; }
- void SetFlags( USHORT nFlags ) { mnFlags = nFlags; }
- USHORT GetFlags() const { return mnFlags; }
+ void SetHelpId( const rtl::OString& rHelpId ) { maHelpId = rHelpId; }
+ const rtl::OString& GetHelpId() const { return maHelpId; }
+ void SetFlags( sal_uInt16 nFlags ) { mnFlags = nFlags; }
+ sal_uInt16 GetFlags() const { return mnFlags; }
const TaskStatusFieldItem& operator=( const TaskStatusFieldItem& rItem );
};
@@ -280,10 +280,10 @@ public:
// - TaskStatusBar -
// -----------------
-#define TASKSTATUSBAR_STATUSFIELDID ((USHORT)61000)
+#define TASKSTATUSBAR_STATUSFIELDID ((sal_uInt16)61000)
-#define TASKSTATUSBAR_CLOCKID ((USHORT)61000)
-#define TASKSTATUSFIELD_CLOCK ((USHORT)0x0001)
+#define TASKSTATUSBAR_CLOCKID ((sal_uInt16)61000)
+#define TASKSTATUSFIELD_CLOCK ((sal_uInt16)0x0001)
class SVT_DLLPUBLIC TaskStatusBar : public StatusBar
{
@@ -299,19 +299,19 @@ private:
long mnClockWidth;
long mnItemWidth;
long mnFieldWidth;
- USHORT mnFieldFlags;
- USHORT mnDummy1;
- BOOL mbFlashItems;
- BOOL mbOutInterval;
- BOOL mbDummy1;
- BOOL mbDummy2;
+ sal_uInt16 mnFieldFlags;
+ sal_uInt16 mnDummy1;
+ sal_Bool mbFlashItems;
+ sal_Bool mbOutInterval;
+ sal_Bool mbDummy1;
+ sal_Bool mbDummy2;
#ifdef _TASKBAR_CXX
- SVT_DLLPRIVATE ImplTaskSBFldItem* ImplGetFieldItem( USHORT nItemId ) const;
- SVT_DLLPRIVATE ImplTaskSBFldItem* ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const;
- SVT_DLLPRIVATE BOOL ImplUpdateClock();
- SVT_DLLPRIVATE BOOL ImplUpdateFlashItems();
- SVT_DLLPRIVATE void ImplUpdateField( BOOL bItems );
+ SVT_DLLPRIVATE ImplTaskSBFldItem* ImplGetFieldItem( sal_uInt16 nItemId ) const;
+ SVT_DLLPRIVATE ImplTaskSBFldItem* ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const;
+ SVT_DLLPRIVATE sal_Bool ImplUpdateClock();
+ SVT_DLLPRIVATE sal_Bool ImplUpdateFlashItems();
+ SVT_DLLPRIVATE void ImplUpdateField( sal_Bool bItems );
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
#endif
@@ -327,20 +327,20 @@ public:
virtual void UserDraw( const UserDrawEvent& rUDEvt );
void InsertStatusField( long nOffset = STATUSBAR_OFFSET,
- USHORT nPos = STATUSBAR_APPEND,
- USHORT nFlags = TASKSTATUSFIELD_CLOCK );
+ sal_uInt16 nPos = STATUSBAR_APPEND,
+ sal_uInt16 nFlags = TASKSTATUSFIELD_CLOCK );
void RemoveStatusField()
{ maTimer.Stop(); RemoveItem( TASKSTATUSBAR_STATUSFIELDID ); }
- void SetFieldFlags( USHORT nFlags );
- USHORT GetFieldFlags() const { return mnFieldFlags; }
+ void SetFieldFlags( sal_uInt16 nFlags );
+ sal_uInt16 GetFieldFlags() const { return mnFieldFlags; }
void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; }
ITaskStatusNotify* GetNotifyObject() const { return mpNotify; }
- void AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem,
- USHORT nPos = 0xFFFF );
- void ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem );
- void RemoveStatusFieldItem( USHORT nItemId );
- BOOL GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const;
+ void AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem,
+ sal_uInt16 nPos = 0xFFFF );
+ void ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem );
+ void RemoveStatusFieldItem( sal_uInt16 nItemId );
+ sal_Bool GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const;
};
// -----------
@@ -367,15 +367,15 @@ private:
long mnDummy3;
long mnDummy4;
WinBits mnWinBits;
- USHORT mnLines;
- BOOL mbStatusText;
- BOOL mbShowItems;
- BOOL mbAutoHide;
- BOOL mbAlignDummy1;
- BOOL mbDummy1;
- BOOL mbDummy2;
- BOOL mbDummy3;
- BOOL mbDummy4;
+ sal_uInt16 mnLines;
+ sal_Bool mbStatusText;
+ sal_Bool mbShowItems;
+ sal_Bool mbAutoHide;
+ sal_Bool mbAlignDummy1;
+ sal_Bool mbDummy1;
+ sal_Bool mbDummy2;
+ sal_Bool mbDummy3;
+ sal_Bool mbDummy4;
Link maTaskResizeHdl;
#ifdef _TASKBAR_CXX
@@ -403,10 +403,10 @@ public:
void Format();
- void SetLines( USHORT nLines );
- USHORT GetLines() const { return mnLines; }
- void EnableAutoHide( BOOL bAutoHide = TRUE );
- BOOL IsAutoHideEnabled() const { return mbAutoHide; }
+ void SetLines( sal_uInt16 nLines );
+ sal_uInt16 GetLines() const { return mnLines; }
+ void EnableAutoHide( sal_Bool bAutoHide = sal_True );
+ sal_Bool IsAutoHideEnabled() const { return mbAutoHide; }
void ShowStatusText( const String& rText );
void HideStatusText();
@@ -445,7 +445,7 @@ class SVT_DLLPUBLIC WindowArrange
private:
List* mpWinList;
void* mpDummy;
- ULONG mnDummy;
+ sal_uLong mnDummy;
#ifdef _TASKBAR_CXX
SVT_DLLPRIVATE void ImplTile( const Rectangle& rRect );
@@ -458,12 +458,12 @@ public:
WindowArrange();
~WindowArrange();
- void AddWindow( Window* pWindow, ULONG nPos = LIST_APPEND )
+ void AddWindow( Window* pWindow, sal_uLong nPos = LIST_APPEND )
{ mpWinList->Insert( (void*)pWindow, nPos ); }
void RemoveAllWindows()
{ mpWinList->Clear(); }
- void Arrange( USHORT nType, const Rectangle& rRect );
+ void Arrange( sal_uInt16 nType, const Rectangle& rRect );
};
#endif // _TASKBAR_HXX
diff --git a/svtools/inc/templatefoldercache.hxx b/svtools/inc/svtools/templatefoldercache.hxx
index 9be90a0eaad6..9be90a0eaad6 100644
--- a/svtools/inc/templatefoldercache.hxx
+++ b/svtools/inc/svtools/templatefoldercache.hxx
diff --git a/svtools/inc/templdlg.hxx b/svtools/inc/svtools/templdlg.hxx
index ba62c3ec5a89..ba62c3ec5a89 100644
--- a/svtools/inc/templdlg.hxx
+++ b/svtools/inc/svtools/templdlg.hxx
diff --git a/svtools/inc/testtool.hxx b/svtools/inc/svtools/testtool.hxx
index 5837bfaaa232..0129a326f001 100644
--- a/svtools/inc/testtool.hxx
+++ b/svtools/inc/svtools/testtool.hxx
@@ -47,7 +47,7 @@ class RemoteControl
{
friend class StatementFlow;
- BOOL m_bIdleInserted;
+ sal_Bool m_bIdleInserted;
#if OSL_DEBUG_LEVEL > 1
EditWindow *m_pDbgWin;
#endif
@@ -56,14 +56,14 @@ class RemoteControl
public:
RemoteControl();
~RemoteControl();
- BOOL QueCommands( ULONG nServiceId, SvStream *pIn );
+ sal_Bool QueCommands( sal_uLong nServiceId, SvStream *pIn );
SvStream* GetReturnStream();
DECL_LINK( IdleHdl, Application* );
DECL_LINK( CommandHdl, Application* );
DECL_LINK( QueCommandsEvent, CommunicationLink* );
- ULONG nStoredServiceId;
+ sal_uLong nStoredServiceId;
SvStream *pStoredStream;
void ExecuteURL( String &aURL );
diff --git a/svtools/inc/svtools/textdata.hxx b/svtools/inc/svtools/textdata.hxx
index 7b0a81cd2da1..97869f2489cd 100644
--- a/svtools/inc/svtools/textdata.hxx
+++ b/svtools/inc/svtools/textdata.hxx
@@ -34,71 +34,51 @@
#include <svl/smplhint.hxx>
#include <tools/string.hxx>
-#define TEXTUNDO_START 100
-#define TEXTUNDO_REMOVECHARS 100
-#define TEXTUNDO_CONNECTPARAS 101
-#define TEXTUNDO_SPLITPARA 102
-#define TEXTUNDO_INSERTCHARS 103
-#define TEXTUNDO_DELCONTENT 104
-#define TEXTUNDO_DELETE 105
-#define TEXTUNDO_CUT 106
-#define TEXTUNDO_PASTE 107
-#define TEXTUNDO_INSERT 108
-#define TEXTUNDO_ATTRIBS 109
-#define TEXTUNDO_DRAGANDDROP 110
-#define TEXTUNDO_READ 111
-#define TEXTUNDO_END 149
-
-#define XTEXTUNDO_START 150
-#define XTEXTUNDO_END 199
-
-#define TEXTUNDO_USER 200
-
// Fuer Notify, wenn alle Absaetze geloescht wurden...
#define TEXT_PARA_ALL 0xFFFFFFFF
class TextPaM
{
private:
- ULONG mnPara;
- USHORT mnIndex;
+ sal_uLong mnPara;
+ sal_uInt16 mnIndex;
public:
TextPaM() { mnPara = 0, mnIndex = 0; }
- TextPaM( ULONG nPara, USHORT nIndex ) { mnPara = nPara, mnIndex = nIndex; }
+ TextPaM( sal_uLong nPara, sal_uInt16 nIndex ) { mnPara = nPara, mnIndex = nIndex; }
- ULONG GetPara() const { return mnPara; }
- ULONG& GetPara() { return mnPara; }
+ sal_uLong GetPara() const { return mnPara; }
+ sal_uLong& GetPara() { return mnPara; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT& GetIndex() { return mnIndex; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16& GetIndex() { return mnIndex; }
- inline BOOL operator == ( const TextPaM& rPaM ) const;
- inline BOOL operator != ( const TextPaM& rPaM ) const;
- inline BOOL operator < ( const TextPaM& rPaM ) const;
- inline BOOL operator > ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator == ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator != ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator < ( const TextPaM& rPaM ) const;
+ inline sal_Bool operator > ( const TextPaM& rPaM ) const;
};
-inline BOOL TextPaM::operator == ( const TextPaM& rPaM ) const
+inline sal_Bool TextPaM::operator == ( const TextPaM& rPaM ) const
{
- return ( ( mnPara == rPaM.mnPara ) && ( mnIndex == rPaM.mnIndex ) ) ? TRUE : FALSE;
+ return ( ( mnPara == rPaM.mnPara ) && ( mnIndex == rPaM.mnIndex ) ) ? sal_True : sal_False;
}
-inline BOOL TextPaM::operator != ( const TextPaM& rPaM ) const
+inline sal_Bool TextPaM::operator != ( const TextPaM& rPaM ) const
{
return !( *this == rPaM );
}
-inline BOOL TextPaM::operator < ( const TextPaM& rPaM ) const
+inline sal_Bool TextPaM::operator < ( const TextPaM& rPaM ) const
{
return ( ( mnPara < rPaM.mnPara ) ||
- ( ( mnPara == rPaM.mnPara ) && mnIndex < rPaM.mnIndex ) ) ? TRUE : FALSE;
+ ( ( mnPara == rPaM.mnPara ) && mnIndex < rPaM.mnIndex ) ) ? sal_True : sal_False;
}
-inline BOOL TextPaM::operator > ( const TextPaM& rPaM ) const
+inline sal_Bool TextPaM::operator > ( const TextPaM& rPaM ) const
{
return ( ( mnPara > rPaM.mnPara ) ||
- ( ( mnPara == rPaM.mnPara ) && mnIndex > rPaM.mnIndex ) ) ? TRUE : FALSE;
+ ( ( mnPara == rPaM.mnPara ) && mnIndex > rPaM.mnIndex ) ) ? sal_True : sal_False;
}
class SVT_DLLPUBLIC TextSelection
@@ -120,18 +100,18 @@ public:
void Justify();
- BOOL HasRange() const { return maStartPaM != maEndPaM; }
+ sal_Bool HasRange() const { return maStartPaM != maEndPaM; }
- inline BOOL operator == ( const TextSelection& rSel ) const;
- inline BOOL operator != ( const TextSelection& rSel ) const;
+ inline sal_Bool operator == ( const TextSelection& rSel ) const;
+ inline sal_Bool operator != ( const TextSelection& rSel ) const;
};
-inline BOOL TextSelection::operator == ( const TextSelection& rSel ) const
+inline sal_Bool TextSelection::operator == ( const TextSelection& rSel ) const
{
return ( ( maStartPaM == rSel.maStartPaM ) && ( maEndPaM == rSel.maEndPaM ) );
}
-inline BOOL TextSelection::operator != ( const TextSelection& rSel ) const
+inline sal_Bool TextSelection::operator != ( const TextSelection& rSel ) const
{
return !( *this == rSel );
}
@@ -154,30 +134,30 @@ inline BOOL TextSelection::operator != ( const TextSelection& rSel ) const
class SVT_DLLPUBLIC TextHint : public SfxSimpleHint
{
private:
- ULONG mnValue;
+ sal_uLong mnValue;
public:
TYPEINFO();
- TextHint( ULONG nId );
- TextHint( ULONG nId, ULONG nValue );
+ TextHint( sal_uLong nId );
+ TextHint( sal_uLong nId, sal_uLong nValue );
- ULONG GetValue() const { return mnValue; }
- void SetValue( ULONG n ) { mnValue = n; }
+ sal_uLong GetValue() const { return mnValue; }
+ void SetValue( sal_uLong n ) { mnValue = n; }
};
struct TEIMEInfos
{
String aOldTextAfterStartPos;
- USHORT* pAttribs;
+ sal_uInt16* pAttribs;
TextPaM aPos;
- USHORT nLen;
- BOOL bCursor;
- BOOL bWasCursorOverwrite;
+ sal_uInt16 nLen;
+ sal_Bool bCursor;
+ sal_Bool bWasCursorOverwrite;
TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos );
~TEIMEInfos();
- void CopyAttribs( const USHORT* pA, USHORT nL );
+ void CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL );
void DestroyAttribs();
};
@@ -196,11 +176,11 @@ struct TEIMEInfos
template <class T> class ToolsList : public ::std::vector< T >
{
public:
- ULONG Count() const { return static_cast<ULONG>(::std::vector< T >::size()); }
- ULONG GetPos( T pObject ) const { return ( ::std::find( this->begin(), this->end(), pObject ) ) - this->begin(); }
- T GetObject( ULONG nIndex ) const { return (*this)[nIndex]; }
- void Insert( T pObject, ULONG nPos ) { ::std::vector< T >::insert( this->begin()+nPos, pObject ); }
- void Remove( ULONG nPos ) { ::std::vector< T >::erase( this->begin()+nPos ); }
+ sal_uLong Count() const { return static_cast<sal_uLong>(::std::vector< T >::size()); }
+ sal_uLong GetPos( T pObject ) const { return ( ::std::find( this->begin(), this->end(), pObject ) ) - this->begin(); }
+ T GetObject( sal_uLong nIndex ) const { return (*this)[nIndex]; }
+ void Insert( T pObject, sal_uLong nPos ) { ::std::vector< T >::insert( this->begin()+nPos, pObject ); }
+ void Remove( sal_uLong nPos ) { ::std::vector< T >::erase( this->begin()+nPos ); }
};
#endif // _TEXTDATA_HXX
diff --git a/svtools/inc/svtools/texteng.hxx b/svtools/inc/svtools/texteng.hxx
index 09c7b042bde3..ba2c440f6d98 100644
--- a/svtools/inc/svtools/texteng.hxx
+++ b/svtools/inc/svtools/texteng.hxx
@@ -40,7 +40,6 @@ class TextAttrib;
class TextCharAttrib;
class TextUndo;
class TextUndoManager;
-class SfxUndoManager;
class EditSelFunctionSet;
class EditSelEngine;
class IdleFormatter;
@@ -50,6 +49,11 @@ class SfxUndoAction;
class KeyEvent;
class Timer;
+namespace svl
+{
+ class IUndoManager;
+}
+
class TextLine;
class TETextPortion;
#include <svl/brdcst.hxx>
@@ -116,110 +120,110 @@ private:
Font maFont;
Color maTextColor;
- USHORT mnCharHeight;
- USHORT mnFixCharWidth100;
+ sal_uInt16 mnCharHeight;
+ sal_uInt16 mnFixCharWidth100;
- ULONG mnMaxTextLen;
- ULONG mnMaxTextWidth;
- ULONG mnCurTextWidth;
- ULONG mnCurTextHeight;
- ULONG mnDefTab;
+ sal_uLong mnMaxTextLen;
+ sal_uLong mnMaxTextWidth;
+ sal_uLong mnCurTextWidth;
+ sal_uLong mnCurTextHeight;
+ sal_uLong mnDefTab;
TxtAlign meAlign;
- BOOL mbIsFormatting : 1; // Semaphore wegen der Hook's
- BOOL mbFormatted : 1;
- BOOL mbUpdate : 1;
- BOOL mbModified : 1;
- BOOL mbUndoEnabled : 1;
- BOOL mbIsInUndo : 1;
- BOOL mbDowning : 1;
- BOOL mbRightToLeft : 1;
- BOOL mbHasMultiLineParas : 1;
+ sal_Bool mbIsFormatting : 1; // Semaphore wegen der Hook's
+ sal_Bool mbFormatted : 1;
+ sal_Bool mbUpdate : 1;
+ sal_Bool mbModified : 1;
+ sal_Bool mbUndoEnabled : 1;
+ sal_Bool mbIsInUndo : 1;
+ sal_Bool mbDowning : 1;
+ sal_Bool mbRightToLeft : 1;
+ sal_Bool mbHasMultiLineParas : 1;
TextEngine( const TextEngine& ) : SfxBroadcaster() {}
TextEngine& operator=( const TextEngine& ) { return *this; }
protected:
- void CursorMoved( ULONG nNode );
+ void CursorMoved( sal_uLong nNode );
void TextModified();
void ImpInitDoc();
void ImpRemoveText();
TextPaM ImpDeleteText( const TextSelection& rSel );
- TextPaM ImpInsertText( const TextSelection& rSel, sal_Unicode c, BOOL bOverwrite = FALSE );
+ TextPaM ImpInsertText( const TextSelection& rSel, sal_Unicode c, sal_Bool bOverwrite = sal_False );
TextPaM ImpInsertText( const TextSelection& rSel, const String& rText );
- TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection, BOOL bKeepEndingAttribs = TRUE );
- TextPaM ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs = TRUE );
- void ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* pCurUndo = 0 );
- TextPaM ImpConnectParagraphs( ULONG nLeft, ULONG nRight );
- void ImpRemoveParagraph( ULONG nPara );
- void ImpInitWritingDirections( ULONG nPara );
+ TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection, sal_Bool bKeepEndingAttribs = sal_True );
+ TextPaM ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs = sal_True );
+ void ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* pCurUndo = 0 );
+ TextPaM ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight );
+ void ImpRemoveParagraph( sal_uLong nPara );
+ void ImpInitWritingDirections( sal_uLong nPara );
LocaleDataWrapper* ImpGetLocaleDataWrapper();
// to remain compatible in the minor release we copy the above ImpInsertText
// function and add the extra parameter we need but make sure this function
// gets not exported. First and seconf parameter swapped to have a different signatur.
- SAL_DLLPRIVATE TextPaM ImpInsertText( sal_Unicode c, const TextSelection& rSel, BOOL bOverwrite = FALSE, BOOL bIsUserInput = sal_False );
+ SAL_DLLPRIVATE TextPaM ImpInsertText( sal_Unicode c, const TextSelection& rSel, sal_Bool bOverwrite = sal_False, sal_Bool bIsUserInput = sal_False );
// some other new functions needed that must not be exported to remain compatible
SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > GetInputSequenceChecker() const;
- SAL_DLLPRIVATE BOOL IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const;
+ SAL_DLLPRIVATE sal_Bool IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const;
// Broadcasten bzw. Selektionen anpassen:
- void ImpParagraphInserted( ULONG nPara );
- void ImpParagraphRemoved( ULONG nPara );
- void ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars );
- void ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars );
- void ImpFormattingParagraph( ULONG nPara );
+ void ImpParagraphInserted( sal_uLong nPara );
+ void ImpParagraphRemoved( sal_uLong nPara );
+ void ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
+ void ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
+ void ImpFormattingParagraph( sal_uLong nPara );
void ImpTextHeightChanged();
void ImpTextFormatted();
DECL_LINK( IdleFormatHdl, Timer * );
void CheckIdleFormatter();
- void IdleFormatAndUpdate( TextView* pCurView = 0, USHORT nMaxTimerRestarts = 5 );
+ void IdleFormatAndUpdate( TextView* pCurView = 0, sal_uInt16 nMaxTimerRestarts = 5 );
- BOOL CreateLines( ULONG nPara );
- void CreateAndInsertEmptyLine( ULONG nPara );
- void ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion* pPortion, USHORT nPortionStart, long nRemainingWidth );
- USHORT SplitTextPortion( ULONG nPara, USHORT nPos );
- void CreateTextPortions( ULONG nPara, USHORT nStartPos );
- void RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars );
- void SeekCursor( ULONG nNode, USHORT nPos, Font& rFont, OutputDevice* pOutDev );
+ sal_Bool CreateLines( sal_uLong nPara );
+ void CreateAndInsertEmptyLine( sal_uLong nPara );
+ void ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth );
+ sal_uInt16 SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos );
+ void CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos );
+ void RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars );
+ void SeekCursor( sal_uLong nNode, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev );
void FormatDoc();
void FormatFullDoc();
void FormatAndUpdate( TextView* pCurView = 0 );
- BOOL IsFormatting() const { return mbIsFormatting; }
+ sal_Bool IsFormatting() const { return mbIsFormatting; }
void UpdateViews( TextView* pCurView = 0 );
- void SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate );
+ void SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate );
void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
void UpdateSelections();
- BOOL IsFormatted() const { return mbFormatted; }
+ sal_Bool IsFormatted() const { return mbFormatted; }
- USHORT GetCharPos( ULONG nPara, USHORT nLine, long nDocPosX, BOOL bSmart = FALSE );
- Rectangle GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart = FALSE );
- USHORT ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart );
- long ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion );
- long ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE );
- long ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 );
- BYTE ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart = NULL, USHORT* pEnd = NULL );
- void ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion = FALSE );
+ sal_uInt16 GetCharPos( sal_uLong nPara, sal_uInt16 nLine, long nDocPosX, sal_Bool bSmart = sal_False );
+ Rectangle GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart = sal_False );
+ sal_uInt16 ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart );
+ long ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion );
+ long ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart = sal_False );
+ long ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 );
+ sal_uInt8 ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL );
+ void ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion = sal_False );
TxtAlign ImpGetAlign() const;
- ULONG CalcTextHeight();
- ULONG CalcParaHeight( ULONG nParagraph ) const;
- ULONG CalcTextWidth( ULONG nPara );
- ULONG CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nPortionLen, const Font* pFont = 0 );
- Range GetInvalidYOffsets( ULONG nPortion );
+ sal_uLong CalcTextHeight();
+ sal_uLong CalcParaHeight( sal_uLong nParagraph ) const;
+ sal_uLong CalcTextWidth( sal_uLong nPara );
+ sal_uLong CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nPortionLen, const Font* pFont = 0 );
+ Range GetInvalidYOffsets( sal_uLong nPortion );
// Fuer Undo/Redo
- void InsertContent( TextNode* pNode, ULONG nPara );
- TextPaM SplitContent( ULONG nNode, USHORT nSepPos );
- TextPaM ConnectContents( ULONG nLeftNode );
+ void InsertContent( TextNode* pNode, sal_uLong nPara );
+ TextPaM SplitContent( sal_uLong nNode, sal_uInt16 nSepPos );
+ TextPaM ConnectContents( sal_uLong nLeftNode );
// Ans API uebergebene PaM's und Selektionen auf einen gueltigen Bereich einstellen
void ValidateSelection( TextSelection& rSel ) const;
@@ -235,80 +239,81 @@ public:
String GetTextLines( LineEnd aSeparator = LINEEND_LF ) const;
void ReplaceText(const TextSelection& rSel, const String& rText);
- ULONG GetTextLen( LineEnd aSeparator = LINEEND_LF ) const;
- ULONG GetTextLen( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
+ sal_uLong GetTextLen( LineEnd aSeparator = LINEEND_LF ) const;
+ sal_uLong GetTextLen( const TextSelection& rSel, LineEnd aSeparator = LINEEND_LF ) const;
void SetFont( const Font& rFont );
const Font& GetFont() const { return maFont; }
- void SetDefTab( USHORT nDefTab );
- USHORT GetDefTab() const;
+ void SetDefTab( sal_uInt16 nDefTab );
+ sal_uInt16 GetDefTab() const;
- void SetLeftMargin( USHORT n );
- USHORT GetLeftMargin() const;
+ void SetLeftMargin( sal_uInt16 n );
+ sal_uInt16 GetLeftMargin() const;
- void SetUpdateMode( BOOL bUpdate );
- BOOL GetUpdateMode() const { return mbUpdate; }
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const { return mbUpdate; }
- USHORT GetViewCount() const;
- TextView* GetView( USHORT nView ) const;
+ sal_uInt16 GetViewCount() const;
+ TextView* GetView( sal_uInt16 nView ) const;
void InsertView( TextView* pTextView );
void RemoveView( TextView* pTextView );
TextView* GetActiveView() const;
void SetActiveView( TextView* pView );
- void SetMaxTextLen( ULONG nLen );
- ULONG GetMaxTextLen() const { return mnMaxTextLen; }
+ void SetMaxTextLen( sal_uLong nLen );
+ sal_uLong GetMaxTextLen() const { return mnMaxTextLen; }
- void SetMaxTextWidth( ULONG nWidth );
- ULONG GetMaxTextWidth() const { return mnMaxTextWidth; }
+ void SetMaxTextWidth( sal_uLong nWidth );
+ sal_uLong GetMaxTextWidth() const { return mnMaxTextWidth; }
- ULONG GetTextHeight() const;
- ULONG CalcTextWidth();
- USHORT GetCharHeight() const { return mnCharHeight; }
+ sal_uLong GetTextHeight() const;
+ sal_uLong CalcTextWidth();
+ sal_uInt16 GetCharHeight() const { return mnCharHeight; }
- ULONG GetParagraphCount() const;
- String GetText( ULONG nParagraph ) const;
- USHORT GetTextLen( ULONG nParagraph ) const;
- ULONG GetTextHeight( ULONG nParagraph ) const;
+ sal_uLong GetParagraphCount() const;
+ String GetText( sal_uLong nParagraph ) const;
+ sal_uInt16 GetTextLen( sal_uLong nParagraph ) const;
+ sal_uLong GetTextHeight( sal_uLong nParagraph ) const;
- USHORT GetLineCount( ULONG nParagraph ) const;
- USHORT GetLineLen( ULONG nParagraph, USHORT nLine ) const;
+ sal_uInt16 GetLineCount( sal_uLong nParagraph ) const;
+ sal_uInt16 GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const;
- void SetRightToLeft( BOOL bR2L );
- BOOL IsRightToLeft() const { return mbRightToLeft; }
+ void SetRightToLeft( sal_Bool bR2L );
+ sal_Bool IsRightToLeft() const { return mbRightToLeft; }
- BOOL HasUndoManager() const { return mpUndoManager ? TRUE : FALSE; }
- SfxUndoManager& GetUndoManager();
- void UndoActionStart( USHORT nId );
- void UndoActionEnd( USHORT nId );
- void InsertUndo( TextUndo* pUndo, BOOL bTryMerge = FALSE );
- BOOL IsInUndo() { return mbIsInUndo; }
- void SetIsInUndo( BOOL bInUndo ) { mbIsInUndo = bInUndo; }
+ sal_Bool HasUndoManager() const { return mpUndoManager ? sal_True : sal_False; }
+ ::svl::IUndoManager&
+ GetUndoManager();
+ void UndoActionStart( sal_uInt16 nId = 0 );
+ void UndoActionEnd();
+ void InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge = sal_False );
+ sal_Bool IsInUndo() { return mbIsInUndo; }
+ void SetIsInUndo( sal_Bool bInUndo ) { mbIsInUndo = bInUndo; }
void ResetUndo();
- void EnableUndo( BOOL bEnable );
- BOOL IsUndoEnabled() { return mbUndoEnabled; }
+ void EnableUndo( sal_Bool bEnable );
+ sal_Bool IsUndoEnabled() { return mbUndoEnabled; }
- void SetModified( BOOL bModified ) { mbModified = bModified; }
- BOOL IsModified() const { return mbModified; }
+ void SetModified( sal_Bool bModified ) { mbModified = bModified; }
+ sal_Bool IsModified() const { return mbModified; }
- BOOL Read( SvStream& rInput, const TextSelection* pSel = NULL );
+ sal_Bool Read( SvStream& rInput, const TextSelection* pSel = NULL );
- BOOL Write( SvStream& rOutput, const TextSelection* pSel = NULL, BOOL bHTML = FALSE );
+ sal_Bool Write( SvStream& rOutput, const TextSelection* pSel = NULL, sal_Bool bHTML = sal_False );
- TextPaM GetPaM( const Point& rDocPos, BOOL bSmart = TRUE );
- Rectangle PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial = FALSE );
+ TextPaM GetPaM( const Point& rDocPos, sal_Bool bSmart = sal_True );
+ Rectangle PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial = sal_False );
String GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord = 0 );
- BOOL HasAttrib( USHORT nWhich ) const;
- const TextAttrib* FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const;
- const TextCharAttrib* FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const;
+ sal_Bool HasAttrib( sal_uInt16 nWhich ) const;
+ const TextAttrib* FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const;
+ const TextCharAttrib* FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const;
- void RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate );
- void RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib );
- void RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate = TRUE );
- void SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate = TRUE );
+ void RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate );
+ void RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib );
+ void RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate = sal_True );
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate = sal_True );
TxtAlign GetTextAlign() const { return meAlign; }
void SetTextAlign( TxtAlign eAlign );
@@ -319,9 +324,9 @@ public:
::com::sun::star::lang::Locale GetLocale();
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > GetBreakIterator();
- static BOOL DoesKeyChangeText( const KeyEvent& rKeyEvent );
- static BOOL DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
- static BOOL IsSimpleCharInput( const KeyEvent& rKeyEvent );
+ static sal_Bool DoesKeyChangeText( const KeyEvent& rKeyEvent );
+ static sal_Bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent );
+ static sal_Bool IsSimpleCharInput( const KeyEvent& rKeyEvent );
};
#endif // _TEXTENG_HXX
diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx
index 8348c584ba58..de8da807a3dd 100644
--- a/svtools/inc/svtools/textview.hxx
+++ b/svtools/inc/svtools/textview.hxx
@@ -74,16 +74,16 @@ protected:
void ShowSelection();
void HideSelection();
void ShowSelection( const TextSelection& rSel );
- void ImpShowHideSelection( BOOL bShow, const TextSelection* pRange = NULL );
+ void ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange = NULL );
TextSelection ImpMoveCursor( const KeyEvent& rKeyEvent );
- TextPaM ImpDelete( BYTE nMode, BYTE nDelMode );
- void ImpSetSelection( const TextSelection& rNewSel, BOOL bUI );
- BOOL IsInSelection( const TextPaM& rPaM );
+ TextPaM ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode );
+ void ImpSetSelection( const TextSelection& rNewSel, sal_Bool bUI );
+ sal_Bool IsInSelection( const TextPaM& rPaM );
void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
- void ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev );
- void ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bEndKey );
+ void ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev );
+ void ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bEndKey );
void ImpHighlight( const TextSelection& rSel );
void ImpSetSelection( const TextSelection& rSelection );
Point ImpGetOutputStartPos( const Point& rStartDocPos ) const;
@@ -92,7 +92,7 @@ protected:
void ImpShowDDCursor();
bool ImplTruncateNewText( rtl::OUString& rNewText ) const;
- BOOL ImplCheckTextLen( const String& rNewText );
+ sal_Bool ImplCheckTextLen( const String& rNewText );
VirtualDevice* GetVirtualDevice();
@@ -118,27 +118,27 @@ public:
void Invalidate();
void Scroll( long nHorzScroll, long nVertScroll );
- void ShowCursor( BOOL bGotoCursor = TRUE, BOOL bForceVisCursor = TRUE );
+ void ShowCursor( sal_Bool bGotoCursor = sal_True, sal_Bool bForceVisCursor = sal_True );
void HideCursor();
- void EnableCursor( BOOL bEnable );
- BOOL IsCursorEnabled() const;
+ void EnableCursor( sal_Bool bEnable );
+ sal_Bool IsCursorEnabled() const;
const TextSelection& GetSelection() const;
TextSelection& GetSelection();
void SetSelection( const TextSelection& rNewSel );
- void SetSelection( const TextSelection& rNewSel, BOOL bGotoCursor );
- BOOL HasSelection() const;
+ void SetSelection( const TextSelection& rNewSel, sal_Bool bGotoCursor );
+ sal_Bool HasSelection() const;
String GetSelected();
String GetSelected( LineEnd aSeparator );
void DeleteSelected();
- void InsertNewText( const rtl::OUString& rNew, BOOL bSelect = FALSE );
+ void InsertNewText( const rtl::OUString& rNew, sal_Bool bSelect = sal_False );
// deprecated: use InsertNewText instead
- void InsertText( const String& rNew, BOOL bSelect = FALSE );
+ void InsertText( const String& rNew, sal_Bool bSelect = sal_False );
- BOOL KeyInput( const KeyEvent& rKeyEvent );
+ sal_Bool KeyInput( const KeyEvent& rKeyEvent );
void Paint( const Rectangle& rRect );
void MouseButtonUp( const MouseEvent& rMouseEvent );
void MouseButtonDown( const MouseEvent& rMouseEvent );
@@ -155,8 +155,8 @@ public:
void Undo();
void Redo();
- BOOL Read( SvStream& rInput );
- BOOL Write( SvStream& rOutput );
+ sal_Bool Read( SvStream& rInput );
+ sal_Bool Write( SvStream& rOutput );
void SetStartDocPos( const Point& rPos );
const Point& GetStartDocPos() const;
@@ -164,26 +164,26 @@ public:
Point GetDocPos( const Point& rWindowPos ) const;
Point GetWindowPos( const Point& rDocPos ) const;
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
- void SetAutoIndentMode( BOOL bAutoIndent );
- BOOL IsAutoIndentMode() const;
+ void SetAutoIndentMode( sal_Bool bAutoIndent );
+ sal_Bool IsAutoIndentMode() const;
- void SetReadOnly( BOOL bReadOnly );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bReadOnly );
+ sal_Bool IsReadOnly() const;
- void SetAutoScroll( BOOL bAutoScroll );
- BOOL IsAutoScroll() const;
+ void SetAutoScroll( sal_Bool bAutoScroll );
+ sal_Bool IsAutoScroll() const;
- BOOL SetCursorAtPoint( const Point& rPointPixel );
- BOOL IsSelectionAtPoint( const Point& rPointPixel );
+ sal_Bool SetCursorAtPoint( const Point& rPointPixel );
+ sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
- void SetPaintSelection( BOOL bPaint);
- BOOL IsPaintSelection() const;
+ void SetPaintSelection( sal_Bool bPaint);
+ sal_Bool IsPaintSelection() const;
- void SetHighlightSelection( BOOL bSelectByHighlight );
- BOOL IsHighlightSelection() const;
+ void SetHighlightSelection( sal_Bool bSelectByHighlight );
+ sal_Bool IsHighlightSelection() const;
void EraseVirtualDevice();
@@ -193,8 +193,8 @@ public:
TextPaM PageDown( const TextPaM& rPaM );
TextPaM CursorUp( const TextPaM& rPaM );
TextPaM CursorDown( const TextPaM& rPaM );
- TextPaM CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode );
- TextPaM CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode );
+ TextPaM CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
+ TextPaM CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
TextPaM CursorWordLeft( const TextPaM& rPaM );
TextPaM CursorWordRight( const TextPaM& rPaM );
TextPaM CursorStartOfLine( const TextPaM& rPaM );
@@ -205,8 +205,8 @@ public:
TextPaM CursorEndOfDoc();
// Old, remove!
- TextPaM CursorLeft( const TextPaM& rPaM, BOOL bWordMode = FALSE );
- TextPaM CursorRight( const TextPaM& rPaM, BOOL bWordMode = FALSE );
+ TextPaM CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode = sal_False );
+ TextPaM CursorRight( const TextPaM& rPaM, sal_Bool bWordMode = sal_False );
/**
Drag and Drop, deleting and selection regards all text that has an attribute
diff --git a/svtools/inc/svtools/toolpanel/paneltabbar.hxx b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
index 555ecb45ed8f..80e1a7e82d36 100644
--- a/svtools/inc/svtools/toolpanel/paneltabbar.hxx
+++ b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
@@ -89,7 +89,7 @@ namespace svt
virtual void DataChanged( const DataChangedEvent& i_rDataChanedEvent );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface( BOOL i_bCreate );
+ GetComponentInterface( sal_Bool i_bCreate );
private:
::std::auto_ptr< PanelTabBar_Impl > m_pImpl;
diff --git a/svtools/inc/svtools/toolpanel/toolpanel.hxx b/svtools/inc/svtools/toolpanel/toolpanel.hxx
index 6d1b6d2fed46..9a6f29784040 100644
--- a/svtools/inc/svtools/toolpanel/toolpanel.hxx
+++ b/svtools/inc/svtools/toolpanel/toolpanel.hxx
@@ -33,7 +33,6 @@
#include <rtl/ustring.hxx>
#include <vcl/image.hxx>
-#include <vcl/smartid.hxx>
#include <boost/noncopyable.hpp>
@@ -63,7 +62,7 @@ namespace svt
virtual Image GetImage() const = 0;
/// retrieves the help ID associated with the panel, if any.
- virtual SmartId GetHelpID() const = 0;
+ virtual rtl::OString GetHelpID() const = 0;
/** activates the panel
diff --git a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx
index 9be60324b5b8..8c277c80c9df 100644
--- a/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx
+++ b/svtools/inc/svtools/toolpanel/toolpaneldeck.hxx
@@ -178,7 +178,7 @@ namespace svt
virtual void GetFocus();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface( BOOL i_bCreate );
+ GetComponentInterface( sal_Bool i_bCreate );
private:
::std::auto_ptr< ToolPanelDeck_Impl > m_pImpl;
diff --git a/svtools/inc/tooltiplbox.hxx b/svtools/inc/svtools/tooltiplbox.hxx
index af01de65c316..af01de65c316 100644
--- a/svtools/inc/tooltiplbox.hxx
+++ b/svtools/inc/svtools/tooltiplbox.hxx
diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx
index 262b9a12a2f5..397dccfc0fe6 100644
--- a/svtools/inc/svtools/transfer.hxx
+++ b/svtools/inc/svtools/transfer.hxx
@@ -572,11 +572,11 @@ public:
void CopyImageMap( const ImageMap& rImgMap );
void CopyGraphic( const Graphic& rGrf );
void CopyString( const String& rStr );
- void CopyString( USHORT nFmt, const String& rStr );
- void CopyAny( USHORT nFmt, const ::com::sun::star::uno::Any& rAny );
+ void CopyString( sal_uInt16 nFmt, const String& rStr );
+ void CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny );
- void CopyByteString( ULONG nFormatId, const ByteString& rStr );
- void CopyAnyData( ULONG nFormatId, const sal_Char* pData, ULONG nLen );
+ void CopyByteString( sal_uLong nFormatId, const ByteString& rStr );
+ void CopyAnyData( sal_uLong nFormatId, const sal_Char* pData, sal_uLong nLen );
sal_Bool HasAnyData() const;
diff --git a/svtools/inc/svtools/treelist.hxx b/svtools/inc/svtools/treelist.hxx
index e8c0c075121b..6d9ca1bb379d 100644
--- a/svtools/inc/svtools/treelist.hxx
+++ b/svtools/inc/svtools/treelist.hxx
@@ -65,10 +65,10 @@ class SvListEntry;
class SvTreeEntryList : public List // SvEntryListStd
{
public:
- SvTreeEntryList(USHORT nInitPos=16, USHORT nResize=16 )
+ SvTreeEntryList(sal_uInt16 nInitPos=16, sal_uInt16 nResize=16 )
: List( nInitPos, nResize )
{}
- SvTreeEntryList(USHORT BlockSize, USHORT InitSize, USHORT Resize )
+ SvTreeEntryList(sal_uInt16 BlockSize, sal_uInt16 InitSize, sal_uInt16 Resize )
: List(BlockSize, InitSize, Resize )
{}
@@ -83,8 +83,8 @@ friend class SvListView;
private:
SvListEntry* pParent;
SvTreeEntryList* pChilds;
- ULONG nAbsPos;
- ULONG nListPos;
+ sal_uLong nAbsPos;
+ sal_uLong nListPos;
void SetListPositions();
void InvalidateChildrensListPositions()
@@ -95,14 +95,14 @@ public:
SvListEntry();
SvListEntry( const SvListEntry& );
virtual ~SvListEntry();
- BOOL HasChilds() { return (BOOL)(pChilds!=0); }
- BOOL HasChildListPos() const
+ sal_Bool HasChilds() { return (sal_Bool)(pChilds!=0); }
+ sal_Bool HasChildListPos() const
{
if( pParent && !(pParent->nListPos & 0x80000000) )
- return TRUE;
- else return FALSE;
+ return sal_True;
+ else return sal_False;
}
- ULONG GetChildListPos() const
+ sal_uLong GetChildListPos() const
{
if( pParent && (pParent->nListPos & 0x80000000) )
pParent->SetListPositions();
@@ -118,26 +118,26 @@ class SvViewData
friend class SvTreeList;
friend class SvListView;
- ULONG nVisPos;
+ sal_uLong nVisPos;
protected:
- USHORT nFlags;
+ sal_uInt16 nFlags;
public:
SvViewData();
SvViewData( const SvViewData& );
virtual ~SvViewData();
- BOOL IsSelected() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_SELECTED)!=0; }
- BOOL IsExpanded() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_EXPANDED)!=0; }
- BOOL HasFocus() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_FOCUSED)!=0; }
- void SetFocus( BOOL bFocus)
+ sal_Bool IsSelected() const { return (sal_Bool)(nFlags&SVLISTENTRYFLAG_SELECTED)!=0; }
+ sal_Bool IsExpanded() const { return (sal_Bool)(nFlags&SVLISTENTRYFLAG_EXPANDED)!=0; }
+ sal_Bool HasFocus() const { return (sal_Bool)(nFlags&SVLISTENTRYFLAG_FOCUSED)!=0; }
+ void SetFocus( sal_Bool bFocus)
{
if ( !bFocus )
nFlags &= (~SVLISTENTRYFLAG_FOCUSED);
else
nFlags |= SVLISTENTRYFLAG_FOCUSED;
}
- BOOL IsCursored() const { return (BOOL)(nFlags&SVLISTENTRYFLAG_CURSORED)!=0; }
- void SetCursored( BOOL bCursored )
+ sal_Bool IsCursored() const { return (sal_Bool)(nFlags&SVLISTENTRYFLAG_CURSORED)!=0; }
+ void SetCursored( sal_Bool bCursored )
{
if ( !bCursored )
nFlags &= (~SVLISTENTRYFLAG_CURSORED);
@@ -145,7 +145,7 @@ public:
nFlags |= SVLISTENTRYFLAG_CURSORED;
}
- USHORT GetFlags() const { return nFlags; }
+ sal_uInt16 GetFlags() const { return nFlags; }
void SetSelectable( bool bSelectable )
{
@@ -173,38 +173,38 @@ class SVT_DLLPUBLIC SvTreeList
friend class SvListView;
List aViewList;
- ULONG nEntryCount;
+ sal_uLong nEntryCount;
Link aCloneLink;
Link aCompareLink;
SvSortMode eSortMode;
- USHORT nRefCount;
+ sal_uInt16 nRefCount;
- BOOL bAbsPositionsValid;
+ sal_Bool bAbsPositionsValid;
SvListEntry* FirstVisible() const { return First(); }
- SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, USHORT* pDepth=0 ) const;
- SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, USHORT* pDepth=0 ) const;
- SvListEntry* LastVisible( const SvListView*,USHORT* pDepth=0 ) const;
- SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, USHORT& rDelta ) const;
- SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, USHORT& rDelta ) const;
-
- BOOL IsEntryVisible( const SvListView*,SvListEntry* pEntry ) const;
- SvListEntry* GetEntryAtVisPos( const SvListView*,ULONG nVisPos ) const;
- ULONG GetVisiblePos( const SvListView*,SvListEntry* pEntry ) const;
- ULONG GetVisibleCount( const SvListView* ) const;
- ULONG GetVisibleChildCount( const SvListView*,SvListEntry* pParent ) const;
+ SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvListEntry* LastVisible( const SvListView*,sal_uInt16* pDepth=0 ) const;
+ SvListEntry* NextVisible( const SvListView*,SvListEntry* pEntry, sal_uInt16& rDelta ) const;
+ SvListEntry* PrevVisible( const SvListView*,SvListEntry* pEntry, sal_uInt16& rDelta ) const;
+
+ sal_Bool IsEntryVisible( const SvListView*,SvListEntry* pEntry ) const;
+ SvListEntry* GetEntryAtVisPos( const SvListView*,sal_uLong nVisPos ) const;
+ sal_uLong GetVisiblePos( const SvListView*,SvListEntry* pEntry ) const;
+ sal_uLong GetVisibleCount( const SvListView* ) const;
+ sal_uLong GetVisibleChildCount( const SvListView*,SvListEntry* pParent ) const;
SvListEntry* FirstSelected( const SvListView*) const;
SvListEntry* NextSelected( const SvListView*,SvListEntry* pEntry ) const;
SvListEntry* PrevSelected( const SvListView*,SvListEntry* pEntry ) const;
SvListEntry* LastSelected( const SvListView*) const;
- BOOL Select( SvListView*,SvListEntry* pEntry, BOOL bSelect=TRUE );
- ULONG SelectChilds( SvListView*,SvListEntry* pParent, BOOL bSelect );
- void SelectAll( SvListView*,BOOL bSelect ); // ruft nicht Select-Hdl
- ULONG GetChildSelectionCount( const SvListView*,SvListEntry* pParent ) const;
+ sal_Bool Select( SvListView*,SvListEntry* pEntry, sal_Bool bSelect=sal_True );
+ sal_uLong SelectChilds( SvListView*,SvListEntry* pParent, sal_Bool bSelect );
+ void SelectAll( SvListView*,sal_Bool bSelect ); // ruft nicht Select-Hdl
+ sal_uLong GetChildSelectionCount( const SvListView*,SvListEntry* pParent ) const;
void Expand( SvListView*,SvListEntry* pParent );
void Collapse( SvListView*,SvListEntry* pParent );
@@ -212,12 +212,12 @@ class SVT_DLLPUBLIC SvTreeList
SVT_DLLPRIVATE void SetAbsolutePositions();
SVT_DLLPRIVATE SvTreeEntryList*CloneChilds( SvTreeEntryList* pChilds,
SvListEntry* pNewParent,
- ULONG& nCloneCount ) const;
+ sal_uLong& nCloneCount ) const;
SVT_DLLPRIVATE void SetListPositions( SvTreeEntryList* );
// rPos wird bei SortModeNone nicht geaendert
SVT_DLLPRIVATE void GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent,
- ULONG& rPos );
+ sal_uLong& rPos );
SVT_DLLPRIVATE void ResortChilds( SvListEntry* pParent );
protected:
@@ -231,57 +231,57 @@ public:
void InsertView( SvListView* );
void RemoveView( SvListView* );
- ULONG GetViewCount() const { return aViewList.Count(); }
- SvListView* GetView(ULONG nPos) const {return (SvListView*)aViewList.GetObject(nPos);}
- void Broadcast( USHORT nActionId, SvListEntry* pEntry1=0,
- SvListEntry* pEntry2=0, ULONG nPos=0 );
+ sal_uLong GetViewCount() const { return aViewList.Count(); }
+ SvListView* GetView(sal_uLong nPos) const {return (SvListView*)aViewList.GetObject(nPos);}
+ void Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1=0,
+ SvListEntry* pEntry2=0, sal_uLong nPos=0 );
// informiert alle Listener
void InvalidateEntry( SvListEntry* );
- ULONG GetEntryCount() const { return nEntryCount; }
+ sal_uLong GetEntryCount() const { return nEntryCount; }
SvListEntry* First() const;
- SvListEntry* Next( SvListEntry* pEntry, USHORT* pDepth=0 ) const;
- SvListEntry* Prev( SvListEntry* pEntry, USHORT* pDepth=0 ) const;
- SvListEntry* Last( USHORT* pDepth=0 ) const;
+ SvListEntry* Next( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvListEntry* Prev( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const;
+ SvListEntry* Last( sal_uInt16* pDepth=0 ) const;
SvListEntry* FirstChild( SvListEntry* pParent ) const;
SvListEntry* NextSibling( SvListEntry* pEntry ) const;
SvListEntry* PrevSibling( SvListEntry* pEntry ) const;
SvListEntry* LastSibling( SvListEntry* pEntry ) const;
- ULONG Insert( SvListEntry* pEntry,SvListEntry* pPar,ULONG nPos=LIST_APPEND);
- ULONG Insert( SvListEntry* pEntry,ULONG nRootPos = LIST_APPEND ) { return Insert(pEntry, pRootItem, nRootPos ); }
+ sal_uLong Insert( SvListEntry* pEntry,SvListEntry* pPar,sal_uLong nPos=LIST_APPEND);
+ sal_uLong Insert( SvListEntry* pEntry,sal_uLong nRootPos = LIST_APPEND ) { return Insert(pEntry, pRootItem, nRootPos ); }
void InsertTree( SvListEntry* pTree, SvListEntry* pTarget );
void InsertTree( SvListEntry* pTree, SvListEntry* pTargetParent,
- ULONG nListPos );
+ sal_uLong nListPos );
// Entries muessen im gleichen Model stehen!
void Move( SvListEntry* pSource, SvListEntry* pTarget );
// erzeugt ggf. Child-List
- ULONG Move( SvListEntry* pSource, SvListEntry* pTargetParent,
- ULONG nListPos);
+ sal_uLong Move( SvListEntry* pSource, SvListEntry* pTargetParent,
+ sal_uLong nListPos);
void Copy( SvListEntry* pSource, SvListEntry* pTarget );
- ULONG Copy( SvListEntry* pSource, SvListEntry* pTargetParent,
- ULONG nListPos);
+ sal_uLong Copy( SvListEntry* pSource, SvListEntry* pTargetParent,
+ sal_uLong nListPos);
- BOOL Remove( SvListEntry* pEntry );
+ sal_Bool Remove( SvListEntry* pEntry );
void Clear();
- BOOL HasChilds( SvListEntry* pEntry ) const;
- BOOL HasParent( SvListEntry* pEntry ) const { return (BOOL)(pEntry->pParent!=pRootItem); }
- BOOL IsChild( SvListEntry* pParent, SvListEntry* pChild ) const;
- BOOL IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const;
- SvListEntry* GetEntry( SvListEntry* pParent, ULONG nPos ) const;
- SvListEntry* GetEntry( ULONG nRootPos ) const;
- SvListEntry* GetEntryAtAbsPos( ULONG nAbsPos ) const;
+ sal_Bool HasChilds( SvListEntry* pEntry ) const;
+ sal_Bool HasParent( SvListEntry* pEntry ) const { return (sal_Bool)(pEntry->pParent!=pRootItem); }
+ sal_Bool IsChild( SvListEntry* pParent, SvListEntry* pChild ) const;
+ sal_Bool IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const;
+ SvListEntry* GetEntry( SvListEntry* pParent, sal_uLong nPos ) const;
+ SvListEntry* GetEntry( sal_uLong nRootPos ) const;
+ SvListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const;
SvListEntry* GetParent( SvListEntry* pEntry ) const;
SvListEntry* GetRootLevelParent( SvListEntry* pEntry ) const;
SvTreeEntryList* GetChildList( SvListEntry* pParent ) const;
- ULONG GetAbsPos( SvListEntry* pEntry ) const;
- ULONG GetRelPos( SvListEntry* pChild ) const { return pChild->GetChildListPos(); }
- ULONG GetChildCount( SvListEntry* pParent ) const;
- USHORT GetDepth( SvListEntry* pEntry ) const;
- BOOL IsAtRootDepth( SvListEntry* pEntry ) const { return (BOOL)(pEntry->pParent==pRootItem); }
+ sal_uLong GetAbsPos( SvListEntry* pEntry ) const;
+ sal_uLong GetRelPos( SvListEntry* pChild ) const { return pChild->GetChildListPos(); }
+ sal_uLong GetChildCount( SvListEntry* pParent ) const;
+ sal_uInt16 GetDepth( SvListEntry* pEntry ) const;
+ sal_Bool IsAtRootDepth( SvListEntry* pEntry ) const { return (sal_Bool)(pEntry->pParent==pRootItem); }
// das Model ruft zum Clonen von Entries den Clone-Link auf,
// damit man sich nicht vom Model ableiten muss, wenn man
@@ -289,14 +289,14 @@ public:
// Deklaration des Clone-Handlers:
// DECL_LINK(CloneHdl,SvListEntry*);
// der Handler muss einen SvListEntry* zurueckgeben
- SvListEntry* Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const;
+ SvListEntry* Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const;
void SetCloneLink( const Link& rLink ) { aCloneLink=rLink; }
const Link& GetCloneLink() const { return aCloneLink; }
virtual SvListEntry* CloneEntry( SvListEntry* ) const; // ruft den Clone-Link
virtual SvListEntry* CreateEntry() const; // zum 'new'en von Entries
- USHORT GetRefCount() const { return nRefCount; }
- void SetRefCount( USHORT nRef ) { nRefCount = nRef; }
+ sal_uInt16 GetRefCount() const { return nRefCount; }
+ void SetRefCount( sal_uInt16 nRef ) { nRefCount = nRef; }
void SetSortMode( SvSortMode eMode ) { eSortMode = eMode; }
SvSortMode GetSortMode() const { return eSortMode; }
@@ -312,9 +312,9 @@ class SVT_DLLPUBLIC SvListView
{
friend class SvTreeList;
- ULONG nVisibleCount;
- ULONG nSelectionCount;
- BOOL bVisPositionsValid;
+ sal_uLong nVisibleCount;
+ sal_uLong nSelectionCount;
+ sal_Bool bVisPositionsValid;
SVT_DLLPRIVATE void InitTable();
SVT_DLLPRIVATE void ClearTable();
@@ -324,8 +324,8 @@ protected:
Table aDataTable; // Mapping SvListEntry -> ViewData
SvTreeList* pModel;
- void ActionMoving( SvListEntry* pEntry,SvListEntry* pTargetPrnt,ULONG nChildPos);
- void ActionMoved( SvListEntry* pEntry,SvListEntry* pTargetPrnt,ULONG nChildPos);
+ void ActionMoving( SvListEntry* pEntry,SvListEntry* pTargetPrnt,sal_uLong nChildPos);
+ void ActionMoved( SvListEntry* pEntry,SvListEntry* pTargetPrnt,sal_uLong nChildPos);
void ActionInserted( SvListEntry* pEntry );
void ActionInsertedTree( SvListEntry* pEntry );
void ActionRemoving( SvListEntry* pEntry );
@@ -340,40 +340,40 @@ public:
void Clear();
SvTreeList* GetModel() const { return pModel; }
virtual void SetModel( SvTreeList* );
- virtual void ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos );
+ virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos );
- ULONG GetVisibleCount() const { return pModel->GetVisibleCount( (SvListView*)this );}
+ sal_uLong GetVisibleCount() const { return pModel->GetVisibleCount( (SvListView*)this );}
SvListEntry* FirstVisible() const { return pModel->FirstVisible(); }
- SvListEntry* NextVisible( SvListEntry* pEntry, USHORT* pDepth=0 ) const {return pModel->NextVisible(this,pEntry,pDepth); }
- SvListEntry* PrevVisible( SvListEntry* pEntry, USHORT* pDepth=0 ) const {return pModel->PrevVisible(this,pEntry,pDepth); }
- SvListEntry* LastVisible( USHORT* pDepth=0 ) const { return pModel->LastVisible(this,pDepth);}
- SvListEntry* NextVisible( SvListEntry* pEntry, USHORT& rDelta ) const { return pModel->NextVisible(this,pEntry,rDelta); }
- SvListEntry* PrevVisible( SvListEntry* pEntry, USHORT& rDelta ) const { return pModel->PrevVisible(this,pEntry,rDelta); }
+ SvListEntry* NextVisible( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const {return pModel->NextVisible(this,pEntry,pDepth); }
+ SvListEntry* PrevVisible( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const {return pModel->PrevVisible(this,pEntry,pDepth); }
+ SvListEntry* LastVisible( sal_uInt16* pDepth=0 ) const { return pModel->LastVisible(this,pDepth);}
+ SvListEntry* NextVisible( SvListEntry* pEntry, sal_uInt16& rDelta ) const { return pModel->NextVisible(this,pEntry,rDelta); }
+ SvListEntry* PrevVisible( SvListEntry* pEntry, sal_uInt16& rDelta ) const { return pModel->PrevVisible(this,pEntry,rDelta); }
- ULONG GetSelectionCount() const { return nSelectionCount; }
+ sal_uLong GetSelectionCount() const { return nSelectionCount; }
SvListEntry* FirstSelected() const { return pModel->FirstSelected(this);}
SvListEntry* NextSelected( SvListEntry* pEntry ) const { return pModel->NextSelected(this,pEntry); }
SvListEntry* PrevSelected( SvListEntry* pEntry ) const { return pModel->PrevSelected(this,pEntry); }
SvListEntry* LastSelected() const { return pModel->LastSelected(this); }
- SvListEntry* GetEntryAtVisPos( ULONG nVisPos ) const { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); }
- ULONG GetVisiblePos( SvListEntry* pEntry ) const { return pModel->GetVisiblePos((SvListView*)this,pEntry); }
+ SvListEntry* GetEntryAtVisPos( sal_uLong nVisPos ) const { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); }
+ sal_uLong GetVisiblePos( SvListEntry* pEntry ) const { return pModel->GetVisiblePos((SvListView*)this,pEntry); }
- ULONG GetVisibleChildCount(SvListEntry* pParent ) const { return pModel->GetVisibleChildCount((SvListView*)this,pParent); }
- ULONG GetChildSelectionCount( SvListEntry* pParent ) const { return pModel->GetChildSelectionCount((SvListView*)this,pParent); }
+ sal_uLong GetVisibleChildCount(SvListEntry* pParent ) const { return pModel->GetVisibleChildCount((SvListView*)this,pParent); }
+ sal_uLong GetChildSelectionCount( SvListEntry* pParent ) const { return pModel->GetChildSelectionCount((SvListView*)this,pParent); }
void Expand( SvListEntry* pParent ) { pModel->Expand((SvListView*)this,pParent); }
void Collapse( SvListEntry* pParent ) { pModel->Collapse((SvListView*)this,pParent); }
- BOOL Select( SvListEntry* pEntry, BOOL bSelect=TRUE ) { return pModel->Select((SvListView*)this,pEntry,bSelect); }
- ULONG SelectChilds( SvListEntry* pParent, BOOL bSelect ) { return pModel->SelectChilds((SvListView*)this,pParent, bSelect); }
+ sal_Bool Select( SvListEntry* pEntry, sal_Bool bSelect=sal_True ) { return pModel->Select((SvListView*)this,pEntry,bSelect); }
+ sal_uLong SelectChilds( SvListEntry* pParent, sal_Bool bSelect ) { return pModel->SelectChilds((SvListView*)this,pParent, bSelect); }
// ruft nicht Select-Hdl
- virtual void SelectAll( BOOL bSelect, BOOL ) { pModel->SelectAll((SvListView*)this, bSelect); }
- BOOL IsEntryVisible( SvListEntry* pEntry ) const { return pModel->IsEntryVisible((SvListView*)this,pEntry); }
- BOOL IsExpanded( SvListEntry* pEntry ) const;
- BOOL IsSelected( SvListEntry* pEntry ) const;
- BOOL HasEntryFocus( SvListEntry* pEntry ) const;
- void SetEntryFocus( SvListEntry* pEntry, BOOL bFocus ) const;
+ virtual void SelectAll( sal_Bool bSelect, sal_Bool ) { pModel->SelectAll((SvListView*)this, bSelect); }
+ sal_Bool IsEntryVisible( SvListEntry* pEntry ) const { return pModel->IsEntryVisible((SvListView*)this,pEntry); }
+ sal_Bool IsExpanded( SvListEntry* pEntry ) const;
+ sal_Bool IsSelected( SvListEntry* pEntry ) const;
+ sal_Bool HasEntryFocus( SvListEntry* pEntry ) const;
+ void SetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus ) const;
SvViewData* GetViewData( SvListEntry* pEntry ) const;
- BOOL HasViewData() const { return aDataTable.Count() > 1;} // eine ROOT gibts immer
+ sal_Bool HasViewData() const { return aDataTable.Count() > 1;} // eine ROOT gibts immer
virtual SvViewData* CreateViewData( SvListEntry* pEntry );
virtual void InitViewData( SvViewData*, SvListEntry* pEntry );
@@ -381,38 +381,38 @@ public:
virtual void ModelHasInserted( SvListEntry* pEntry );
virtual void ModelHasInsertedTree( SvListEntry* pEntry );
virtual void ModelIsMoving( SvListEntry* pSource, SvListEntry* pTargetParent,
- ULONG nPos );
+ sal_uLong nPos );
virtual void ModelHasMoved( SvListEntry* pSource );
virtual void ModelIsRemoving( SvListEntry* pEntry );
virtual void ModelHasRemoved( SvListEntry* pEntry );
virtual void ModelHasEntryInvalidated( SvListEntry* pEntry );
};
-inline BOOL SvListView::IsExpanded( SvListEntry* pEntry ) const
+inline sal_Bool SvListView::IsExpanded( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry,"IsExpanded:No Entry");
- SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
return pData->IsExpanded();
}
-inline BOOL SvListView::IsSelected( SvListEntry* pEntry ) const
+inline sal_Bool SvListView::IsSelected( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry,"IsExpanded:No Entry");
- SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
return pData->IsSelected();
}
-inline BOOL SvListView::HasEntryFocus( SvListEntry* pEntry ) const
+inline sal_Bool SvListView::HasEntryFocus( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry,"IsExpanded:No Entry");
- SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
return pData->HasFocus();
}
-inline void SvListView::SetEntryFocus( SvListEntry* pEntry, BOOL bFocus ) const
+inline void SvListView::SetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus ) const
{
DBG_ASSERT(pEntry,"SetEntryFocus:No Entry");
- SvViewData* pData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pData,"Entry not in Table");
pData->SetFocus(bFocus);
}
@@ -420,22 +420,22 @@ inline void SvListView::SetEntryFocus( SvListEntry* pEntry, BOOL bFocus ) const
inline SvViewData* SvListView::GetViewData( SvListEntry* pEntry ) const
{
#ifndef DBG_UTIL
- return (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ return (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
#else
- SvViewData* pResult = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ SvViewData* pResult = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
DBG_ASSERT(pResult,"Entry not in model or wrong view");
return pResult;
#endif
}
-inline BOOL SvTreeList::HasChilds( SvListEntry* pEntry ) const
+inline sal_Bool SvTreeList::HasChilds( SvListEntry* pEntry ) const
{
if ( !pEntry )
pEntry = pRootItem;
- return (BOOL)(pEntry->pChilds != 0);
+ return (sal_Bool)(pEntry->pChilds != 0);
}
-inline SvListEntry* SvTreeList::GetEntry( SvListEntry* pParent, ULONG nPos ) const
+inline SvListEntry* SvTreeList::GetEntry( SvListEntry* pParent, sal_uLong nPos ) const
{ if ( !pParent )
pParent = pRootItem;
SvListEntry* pRet = 0;
@@ -444,7 +444,7 @@ inline SvListEntry* SvTreeList::GetEntry( SvListEntry* pParent, ULONG nPos ) con
return pRet;
}
-inline SvListEntry* SvTreeList::GetEntry( ULONG nRootPos ) const
+inline SvListEntry* SvTreeList::GetEntry( sal_uLong nRootPos ) const
{
SvListEntry* pRet;
if ( nEntryCount )
@@ -475,18 +475,18 @@ class ClassName : public SvTreeList \
public: \
Type First() const \
{ return (Type)SvTreeList::First(); } \
- Type Next( SvListEntry* pEntry, USHORT* pDepth=0 ) const \
+ Type Next( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const \
{ return (Type)SvTreeList::Next(pEntry,pDepth); } \
- Type Prev( SvListEntry* pEntry, USHORT* pDepth=0 ) const \
+ Type Prev( SvListEntry* pEntry, sal_uInt16* pDepth=0 ) const \
{ return (Type)SvTreeList::Prev(pEntry,pDepth); } \
- Type Last( USHORT* pDepth=0 ) const \
+ Type Last( sal_uInt16* pDepth=0 ) const \
{ return (Type)SvTreeList::Last(pDepth); } \
\
- Type Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const \
+ Type Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const \
{ return (Type)SvTreeList::Clone(pEntry,nCloneCount); } \
- Type GetEntry( SvListEntry* pParent, ULONG nPos ) const \
+ Type GetEntry( SvListEntry* pParent, sal_uLong nPos ) const \
{ return (Type)SvTreeList::GetEntry(pParent,nPos); } \
- Type GetEntry( ULONG nRootPos ) const \
+ Type GetEntry( sal_uLong nRootPos ) const \
{ return (Type)SvTreeList::GetEntry(nRootPos); } \
Type GetParent( SvListEntry* pEntry ) const \
{ return (Type)SvTreeList::GetParent(pEntry); } \
@@ -502,7 +502,7 @@ public: \
using SvTreeList::LastSibling; \
Type LastSibling( Type pEntry ) const \
{ return (Type)SvTreeList::LastSibling(pEntry); } \
- Type GetEntryAtAbsPos( ULONG nAbsPos ) const \
+ Type GetEntryAtAbsPos( sal_uLong nAbsPos ) const \
{ return (Type)SvTreeList::GetEntryAtAbsPos( nAbsPos); } \
};
diff --git a/svtools/inc/svtools/ttprops.hxx b/svtools/inc/svtools/ttprops.hxx
index 5c417e887aee..561fd8eae086 100644
--- a/svtools/inc/svtools/ttprops.hxx
+++ b/svtools/inc/svtools/ttprops.hxx
@@ -37,7 +37,7 @@
class SfxPoolItem;
class Bitmap;
-// Defines zur Steuerung der Ausfhrung von Slots
+// Defines zur Steuerung der Ausf�hrung von Slots
#define EXECUTE_NO 0
#define EXECUTE_POSSIBLE 1
#define EXECUTE_YES 2
@@ -61,10 +61,10 @@ class Bitmap;
class SVT_DLLPUBLIC TTProperties : public ApplicationProperty
{
- USHORT nDonePRs; // Verwaltung fr die Properties, die nur einmal gerufen werden mussen.
- SVT_DLLPRIVATE BOOL RequestProperty( USHORT nRequest );
+ sal_uInt16 nDonePRs; // Verwaltung f�r die Properties, die nur einmal gerufen werden mussen.
+ SVT_DLLPRIVATE sal_Bool RequestProperty( sal_uInt16 nRequest );
- BOOL HasSlots(){ return nPropertyVersion == TT_PROPERTIES_VERSION; }
+ sal_Bool HasSlots(){ return nPropertyVersion == TT_PROPERTIES_VERSION; }
public:
TYPEINFO();
@@ -76,31 +76,31 @@ public:
, nPropertyVersion( 0 )
{}
- BOOL GetSlots();
+ sal_Bool GetSlots();
/// ExecuteFunction
- USHORT mnSID;
+ sal_uInt16 mnSID;
SfxPoolItem** mppArgs;
- USHORT mnMode;
- USHORT ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs = NULL, USHORT nMode = 0 );
+ sal_uInt16 mnMode;
+ sal_uInt16 ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs = NULL, sal_uInt16 nMode = 0 );
/// Img
Bitmap *mpBmp;
- BOOL Img( Bitmap *pBmp );
+ sal_Bool Img( Bitmap *pBmp );
- static SvtResId GetSvtResId( USHORT nId );
+ static SvtResId GetSvtResId( sal_uInt16 nId );
- ULONG nSidOpenUrl;
- ULONG nSidFileName;
- ULONG nSidNewDocDirect;
- ULONG nSidCopy;
- ULONG nSidPaste;
- ULONG nSidSourceView;
- ULONG nSidSelectAll;
- ULONG nSidReferer;
+ sal_uLong nSidOpenUrl;
+ sal_uLong nSidFileName;
+ sal_uLong nSidNewDocDirect;
+ sal_uLong nSidCopy;
+ sal_uLong nSidPaste;
+ sal_uLong nSidSourceView;
+ sal_uLong nSidSelectAll;
+ sal_uLong nSidReferer;
- USHORT nActualPR;
- USHORT nPropertyVersion; // Wird bei jedem call gesetzt.
+ sal_uInt16 nActualPR;
+ sal_uInt16 nPropertyVersion; // Wird bei jedem call gesetzt.
};
#endif // _SVTOOLS_TTPROPS_HXX
diff --git a/svtools/inc/txtattr.hxx b/svtools/inc/svtools/txtattr.hxx
index 4a1d4ea3f42e..982e9c20be5a 100644
--- a/svtools/inc/txtattr.hxx
+++ b/svtools/inc/svtools/txtattr.hxx
@@ -49,17 +49,17 @@ class Font;
class SVT_DLLPUBLIC TextAttrib
{
private:
- USHORT mnWhich;
+ sal_uInt16 mnWhich;
protected:
- TextAttrib( USHORT nWhich ) { mnWhich = nWhich; }
+ TextAttrib( sal_uInt16 nWhich ) { mnWhich = nWhich; }
TextAttrib( const TextAttrib& rAttr ) { mnWhich = rAttr.mnWhich; }
public:
virtual ~TextAttrib();
- USHORT Which() const { return mnWhich; }
+ sal_uInt16 Which() const { return mnWhich; }
virtual void SetFont( Font& rFont ) const = 0;
virtual TextAttrib* Clone() const = 0;
@@ -151,84 +151,84 @@ class TextCharAttrib
{
private:
TextAttrib* mpAttr;
- USHORT mnStart;
- USHORT mnEnd;
+ sal_uInt16 mnStart;
+ sal_uInt16 mnEnd;
protected:
public:
- TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd );
+ TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd );
TextCharAttrib( const TextCharAttrib& rTextCharAttrib );
~TextCharAttrib();
const TextAttrib& GetAttr() const { return *mpAttr; }
- USHORT Which() const { return mpAttr->Which(); }
+ sal_uInt16 Which() const { return mpAttr->Which(); }
- USHORT GetStart() const { return mnStart; }
- USHORT& GetStart() { return mnStart; }
+ sal_uInt16 GetStart() const { return mnStart; }
+ sal_uInt16& GetStart() { return mnStart; }
- USHORT GetEnd() const { return mnEnd; }
- USHORT& GetEnd() { return mnEnd; }
+ sal_uInt16 GetEnd() const { return mnEnd; }
+ sal_uInt16& GetEnd() { return mnEnd; }
- inline USHORT GetLen() const;
+ inline sal_uInt16 GetLen() const;
- inline void MoveForward( USHORT nDiff );
- inline void MoveBackward( USHORT nDiff );
+ inline void MoveForward( sal_uInt16 nDiff );
+ inline void MoveBackward( sal_uInt16 nDiff );
- inline void Expand( USHORT nDiff );
- inline void Collaps( USHORT nDiff );
+ inline void Expand( sal_uInt16 nDiff );
+ inline void Collaps( sal_uInt16 nDiff );
- inline BOOL IsIn( USHORT nIndex );
- inline BOOL IsInside( USHORT nIndex );
- inline BOOL IsEmpty();
+ inline sal_Bool IsIn( sal_uInt16 nIndex );
+ inline sal_Bool IsInside( sal_uInt16 nIndex );
+ inline sal_Bool IsEmpty();
};
-inline USHORT TextCharAttrib::GetLen() const
+inline sal_uInt16 TextCharAttrib::GetLen() const
{
DBG_ASSERT( mnEnd >= mnStart, "TextCharAttrib: nEnd < nStart!" );
return mnEnd-mnStart;
}
-inline void TextCharAttrib::MoveForward( USHORT nDiff )
+inline void TextCharAttrib::MoveForward( sal_uInt16 nDiff )
{
DBG_ASSERT( ((long)mnEnd + nDiff) <= 0xFFFF, "TextCharAttrib: MoveForward?!" );
mnStart = mnStart + nDiff;
mnEnd = mnEnd + nDiff;
}
-inline void TextCharAttrib::MoveBackward( USHORT nDiff )
+inline void TextCharAttrib::MoveBackward( sal_uInt16 nDiff )
{
DBG_ASSERT( ((long)mnStart - nDiff) >= 0, "TextCharAttrib: MoveBackward?!" );
mnStart = mnStart - nDiff;
mnEnd = mnEnd - nDiff;
}
-inline void TextCharAttrib::Expand( USHORT nDiff )
+inline void TextCharAttrib::Expand( sal_uInt16 nDiff )
{
DBG_ASSERT( ( ((long)mnEnd + nDiff) <= (long)0xFFFF ), "TextCharAttrib: Expand?!" );
mnEnd = mnEnd + nDiff;
}
-inline void TextCharAttrib::Collaps( USHORT nDiff )
+inline void TextCharAttrib::Collaps( sal_uInt16 nDiff )
{
DBG_ASSERT( (long)mnEnd - nDiff >= (long)mnStart, "TextCharAttrib: Collaps?!" );
mnEnd = mnEnd - nDiff;
}
-inline BOOL TextCharAttrib::IsIn( USHORT nIndex )
+inline sal_Bool TextCharAttrib::IsIn( sal_uInt16 nIndex )
{
return ( ( mnStart <= nIndex ) && ( mnEnd >= nIndex ) );
}
-inline BOOL TextCharAttrib::IsInside( USHORT nIndex )
+inline sal_Bool TextCharAttrib::IsInside( sal_uInt16 nIndex )
{
return ( ( mnStart < nIndex ) && ( mnEnd > nIndex ) );
}
-inline BOOL TextCharAttrib::IsEmpty()
+inline sal_Bool TextCharAttrib::IsEmpty()
{
return mnStart == mnEnd;
}
diff --git a/svtools/inc/txtcmp.hxx b/svtools/inc/svtools/txtcmp.hxx
index e53a40dca7e7..e53a40dca7e7 100644
--- a/svtools/inc/txtcmp.hxx
+++ b/svtools/inc/svtools/txtcmp.hxx
diff --git a/svtools/inc/svtools/unitconv.hxx b/svtools/inc/svtools/unitconv.hxx
index a75e89e5d02a..51aa3aa61f30 100644
--- a/svtools/inc/svtools/unitconv.hxx
+++ b/svtools/inc/svtools/unitconv.hxx
@@ -41,11 +41,11 @@ typedef long (*FUNC_CONVERT)(long);
// Functions -------------------------------------------------------------
-SVT_DLLPUBLIC void SetFieldUnit( MetricField& rCtrl, FieldUnit eUnit, BOOL bAll = FALSE );
-SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, BOOL bAll = FALSE );
+SVT_DLLPUBLIC void SetFieldUnit( MetricField& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
+SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, sal_Bool bAll = sal_False );
SVT_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
-SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor );
+SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor );
SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl );
SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem );
diff --git a/svtools/inc/unoevent.hxx b/svtools/inc/svtools/unoevent.hxx
index 8bf8898d6b2a..8bf8898d6b2a 100644
--- a/svtools/inc/unoevent.hxx
+++ b/svtools/inc/svtools/unoevent.hxx
diff --git a/svtools/inc/unoimap.hxx b/svtools/inc/svtools/unoimap.hxx
index adf8b7d0c9b9..adf8b7d0c9b9 100644
--- a/svtools/inc/unoimap.hxx
+++ b/svtools/inc/svtools/unoimap.hxx
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index a13563843906..8c61d8517210 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -149,7 +149,7 @@ Mit CalcWindowSizePixel() kann die genaue Fenstergroesse fuer eine bestimmte
Itemgroesse berechnet werden. Dazu muessen vorher aber alle relevanten
Daten (Spaltenanzahl/...) gesetzt werden und falls keine Zeilenanzahl
eingestellt wird, muessen auch alle Items eingefuegt werden. Falls das
-Window mit WB_BORDER/Border=TRUE erzeugt wurde, muss die Groesse mit
+Window mit WB_BORDER/Border=sal_True erzeugt wurde, muss die Groesse mit
SetOutputSizePixel() gesetzt werden, im anderen Fall koennen auch die
anderen Groessen-Methoden benutzt werden. Mit CalcItemSize() laesst sich
die innere und aeussere Groesse eines Items berechnen (dabei wird der
@@ -169,7 +169,7 @@ Da die Ausgabeflaeche vorberechnet wird, sollten erst alle Items eingefuegt
werden und dann erst Show() aufgerufen werden. Wenn dies nicht gemacht wird,
erscheint das erste Paint etwas langsamer. Deshalb sollte, wenn dieses
Control aus der Resource geladen wird und das Control erst im Programm
-mit Items versorgt wird, mit Hide = TRUE geladen werden und im Programm
+mit Items versorgt wird, mit Hide = sal_True geladen werden und im Programm
dann mit Show() angezeigt werden.
Bei einem sichbaren Control kann die Erzeugung der neuen Ausgabeflaeche
@@ -179,7 +179,7 @@ vor dem Paint aktiviert werden, indem Format() aufgerufen wird.
Wenn man ein Drag and Drop aus dem ValueSet heraus starten will, muss
der Command-Handler ueberlagert werden. Aus diesem muss dann StartDrag
-aufgerufen werden. Wenn diese Methode TRUE zurueckliefert, kann mit
+aufgerufen werden. Wenn diese Methode sal_True zurueckliefert, kann mit
ExecuteDrag() der Drag-Vorgang gestartet werden, ansonsten sollte keine
Verarbeitung stattfinden. Diese Methode sorgt dafuer, das das ValueSet
seine Verarbeitung abbricht und gegebenenfalls den Eintrag selektiert. Es
@@ -218,7 +218,7 @@ gewuenschten WinBits (vor Show) mit SetStyle() gesetzt werden.
// - ValueSet-Item-Typen -
// -----------------------
-#define VIB_NODOUBLECLICK ((USHORT)0x0080)
+#define VIB_NODOUBLECLICK ((sal_uInt16)0x0080)
// ------------------
// - ValueSet-Typen -
@@ -237,8 +237,8 @@ gewuenschten WinBits (vor Show) mit SetStyle() gesetzt werden.
// - ValueSet -
// ------------
-#define VALUESET_APPEND ((USHORT)-1)
-#define VALUESET_ITEM_NOTFOUND ((USHORT)-1)
+#define VALUESET_APPEND ((sal_uInt16)-1)
+#define VALUESET_ITEM_NOTFOUND ((sal_uInt16)-1)
class SVT_DLLPUBLIC ValueSet : public Control
{
@@ -254,27 +254,27 @@ private:
long mnLines;
long mnUserItemWidth;
long mnUserItemHeight;
- USHORT mnOldItemId;
- USHORT mnSelItemId;
- USHORT mnHighItemId;
+ sal_uInt16 mnOldItemId;
+ sal_uInt16 mnSelItemId;
+ sal_uInt16 mnHighItemId;
size_t mnDropPos;
- USHORT mnCols;
- USHORT mnCurCol;
- USHORT mnUserCols;
- USHORT mnUserVisLines;
- USHORT mnFirstLine;
- USHORT mnSpacing;
- USHORT mnFrameStyle;
- BOOL mbFormat;
- BOOL mbHighlight;
- BOOL mbSelection;
- BOOL mbNoSelection;
- BOOL mbDrawSelection;
- BOOL mbBlackSel;
- BOOL mbDoubleSel;
- BOOL mbScroll;
- BOOL mbDropPos;
- BOOL mbFullMode;
+ sal_uInt16 mnCols;
+ sal_uInt16 mnCurCol;
+ sal_uInt16 mnUserCols;
+ sal_uInt16 mnUserVisLines;
+ sal_uInt16 mnFirstLine;
+ sal_uInt16 mnSpacing;
+ sal_uInt16 mnFrameStyle;
+ sal_Bool mbFormat;
+ sal_Bool mbHighlight;
+ sal_Bool mbSelection;
+ sal_Bool mbNoSelection;
+ sal_Bool mbDrawSelection;
+ sal_Bool mbBlackSel;
+ sal_Bool mbDoubleSel;
+ sal_Bool mbScroll;
+ sal_Bool mbDropPos;
+ sal_Bool mbFullMode;
Color maColor;
Link maDoubleClickHdl;
Link maSelectHdl;
@@ -285,27 +285,27 @@ private:
using Control::ImplInitSettings;
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
- SVT_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SVT_DLLPRIVATE void ImplInitScrollBar();
SVT_DLLPRIVATE void ImplDeleteItems();
SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem );
SVT_DLLPRIVATE void ImplDrawItemText( const XubString& rStr );
SVT_DLLPRIVATE void ImplDrawSelect();
- SVT_DLLPRIVATE void ImplHideSelect( USHORT nItemId );
- SVT_DLLPRIVATE void ImplHighlightItem( USHORT nItemId, BOOL bIsSelection = TRUE );
- SVT_DLLPRIVATE void ImplDrawDropPos( BOOL bShow );
+ SVT_DLLPRIVATE void ImplHideSelect( sal_uInt16 nItemId );
+ SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection = sal_True );
+ SVT_DLLPRIVATE void ImplDrawDropPos( sal_Bool bShow );
SVT_DLLPRIVATE void ImplDraw();
using Window::ImplScroll;
- SVT_DLLPRIVATE BOOL ImplScroll( const Point& rPos );
- SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, BOOL bMove = FALSE ) const;
+ SVT_DLLPRIVATE sal_Bool ImplScroll( const Point& rPos );
+ SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, sal_Bool bMove = sal_False ) const;
SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos );
SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
- SVT_DLLPRIVATE USHORT ImplGetVisibleItemCount() const;
- SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( USHORT nVisiblePos );
+ SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- SVT_DLLPRIVATE BOOL ImplHasAccessibleListeners();
- SVT_DLLPRIVATE void ImplTracking( const Point& rPos, BOOL bRepeat );
- SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, BOOL bCancel );
+ SVT_DLLPRIVATE sal_Bool ImplHasAccessibleListeners();
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, sal_Bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, sal_Bool bCancel );
DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
#endif
@@ -316,8 +316,8 @@ private:
protected:
- BOOL StartDrag( const CommandEvent& rCEvt, Region& rRegion );
- USHORT ShowDropPos( const Point& rPos );
+ sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ sal_uInt16 ShowDropPos( const Point& rPos );
void HideDropPos();
protected:
@@ -347,68 +347,68 @@ public:
virtual void DoubleClick();
virtual void UserDraw( const UserDrawEvent& rUDEvt );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
size_t nPos = VALUESET_APPEND );
- void InsertItem( USHORT nItemId, const Color& rColor,
+ void InsertItem( sal_uInt16 nItemId, const Color& rColor,
size_t nPos = VALUESET_APPEND );
- void InsertItem( USHORT nItemId,
+ void InsertItem( sal_uInt16 nItemId,
const Image& rImage, const XubString& rStr,
size_t nPos = VALUESET_APPEND );
- void InsertItem( USHORT nItemId,
+ void InsertItem( sal_uInt16 nItemId,
const Color& rColor, const XubString& rStr,
size_t nPos = VALUESET_APPEND );
- void InsertItem( USHORT nItemId,
+ void InsertItem( sal_uInt16 nItemId,
size_t nPos = VALUESET_APPEND );
- void InsertSpace( USHORT nItemId,
+ void InsertSpace( sal_uInt16 nItemId,
size_t nPos = VALUESET_APPEND );
- void RemoveItem( USHORT nItemId );
+ void RemoveItem( sal_uInt16 nItemId );
void CopyItems( const ValueSet& rValueSet );
void Clear();
size_t GetItemCount() const;
- size_t GetItemPos( USHORT nItemId ) const;
- USHORT GetItemId( size_t nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
-
- void EnableFullItemMode( BOOL bFullMode = TRUE );
- BOOL IsFullItemModeEnabled() const { return mbFullMode; }
- void SetColCount( USHORT nNewCols = 1 );
- USHORT GetColCount() const { return mnUserCols; }
- void SetLineCount( USHORT nNewLines = 0 );
- USHORT GetLineCount() const { return mnUserVisLines; }
+ size_t GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemId( size_t nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+
+ void EnableFullItemMode( sal_Bool bFullMode = sal_True );
+ sal_Bool IsFullItemModeEnabled() const { return mbFullMode; }
+ void SetColCount( sal_uInt16 nNewCols = 1 );
+ sal_uInt16 GetColCount() const { return mnUserCols; }
+ void SetLineCount( sal_uInt16 nNewLines = 0 );
+ sal_uInt16 GetLineCount() const { return mnUserVisLines; }
void SetItemWidth( long nItemWidth = 0 );
long GetItemWidth() const { return mnUserItemWidth; }
void SetItemHeight( long nLineHeight = 0 );
long GetItemHeight() const { return mnUserItemHeight; }
- void SetFirstLine( USHORT nNewLine = 0 );
- USHORT GetFirstLine() const { return mnFirstLine; }
+ void SetFirstLine( sal_uInt16 nNewLine = 0 );
+ sal_uInt16 GetFirstLine() const { return mnFirstLine; }
- void SelectItem( USHORT nItemId );
- USHORT GetSelectItemId() const { return mnSelItemId; }
- BOOL IsItemSelected( USHORT nItemId ) const
- { return ((!mbNoSelection && (nItemId == mnSelItemId)) ? TRUE : FALSE); }
+ void SelectItem( sal_uInt16 nItemId );
+ sal_uInt16 GetSelectItemId() const { return mnSelItemId; }
+ sal_Bool IsItemSelected( sal_uInt16 nItemId ) const
+ { return ((!mbNoSelection && (nItemId == mnSelItemId)) ? sal_True : sal_False); }
void SetNoSelection();
- BOOL IsNoSelection() const { return mbNoSelection; }
-
- void SetItemBits( USHORT nItemId, USHORT nBits );
- USHORT GetItemBits( USHORT nItemId ) const;
- void SetItemImage( USHORT nItemId, const Image& rImage );
- Image GetItemImage( USHORT nItemId ) const;
- void SetItemColor( USHORT nItemId, const Color& rColor );
- Color GetItemColor( USHORT nItemId ) const;
- void SetItemData( USHORT nItemId, void* pData );
- void* GetItemData( USHORT nItemId ) const;
- void SetItemText( USHORT nItemId, const XubString& rStr );
- XubString GetItemText( USHORT nItemId ) const;
+ sal_Bool IsNoSelection() const { return mbNoSelection; }
+
+ void SetItemBits( sal_uInt16 nItemId, sal_uInt16 nBits );
+ sal_uInt16 GetItemBits( sal_uInt16 nItemId ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemColor( sal_uInt16 nItemId, const Color& rColor );
+ Color GetItemColor( sal_uInt16 nItemId ) const;
+ void SetItemData( sal_uInt16 nItemId, void* pData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
void SetColor( const Color& rColor );
void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
Color GetColor() const { return maColor; }
- BOOL IsColor() const { return maColor.GetTransparency() == 0; }
+ sal_Bool IsColor() const { return maColor.GetTransparency() == 0; }
- void SetExtraSpacing( USHORT nNewSpacing );
- USHORT GetExtraSpacing() { return mnSpacing; }
+ void SetExtraSpacing( sal_uInt16 nNewSpacing );
+ sal_uInt16 GetExtraSpacing() { return mnSpacing; }
void Format();
@@ -416,9 +416,9 @@ public:
void EndSelection();
Size CalcWindowSizePixel( const Size& rItemSize,
- USHORT nCalcCols = 0,
- USHORT nCalcLines = 0 );
- Size CalcItemSizePixel( const Size& rSize, BOOL bOut = TRUE ) const;
+ sal_uInt16 nCalcCols = 0,
+ sal_uInt16 nCalcLines = 0 );
+ Size CalcItemSizePixel( const Size& rSize, sal_Bool bOut = sal_True ) const;
long GetScrollWidth() const;
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
diff --git a/svtools/inc/wallitem.hxx b/svtools/inc/svtools/wallitem.hxx
index 99d1ec4461a8..5fd4ddca4c02 100644
--- a/svtools/inc/wallitem.hxx
+++ b/svtools/inc/svtools/wallitem.hxx
@@ -45,7 +45,7 @@ class Window;
class SfxItemSet;
typedef void* (*CreateSvxBrushTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
-typedef USHORT* (*GetSvxBrushTabPageRanges)();
+typedef sal_uInt16* (*GetSvxBrushTabPageRanges)();
class Graphic;
class String;
diff --git a/svtools/inc/svtools/wizardmachine.hxx b/svtools/inc/svtools/wizardmachine.hxx
index ce5275d3c252..76535089b51b 100644
--- a/svtools/inc/svtools/wizardmachine.hxx
+++ b/svtools/inc/svtools/wizardmachine.hxx
@@ -152,8 +152,8 @@ namespace svt
// restrict access to some aspects of our base class
SVT_DLLPRIVATE void AddPage( TabPage* pPage ) { WizardDialog::AddPage(pPage); }
SVT_DLLPRIVATE void RemovePage( TabPage* pPage ) { WizardDialog::RemovePage(pPage); }
- SVT_DLLPRIVATE void SetPage( USHORT nLevel, TabPage* pPage ) { WizardDialog::SetPage(nLevel, pPage); }
- // TabPage* GetPage( USHORT nLevel ) const { return WizardDialog::GetPage(nLevel); }
+ SVT_DLLPRIVATE void SetPage( sal_uInt16 nLevel, TabPage* pPage ) { WizardDialog::SetPage(nLevel, pPage); }
+ // TabPage* GetPage( sal_uInt16 nLevel ) const { return WizardDialog::GetPage(nLevel); }
// TODO: probably the complete page handling (next, previous etc.) should be prohibited ...
// IMPORTANT:
diff --git a/svtools/inc/svtools/wizdlg.hxx b/svtools/inc/svtools/wizdlg.hxx
index bbd050b39ea2..5e5721551d1c 100644
--- a/svtools/inc/svtools/wizdlg.hxx
+++ b/svtools/inc/svtools/wizdlg.hxx
@@ -65,7 +65,7 @@ berechnet und genommen.
ShowPrevPage()/ShowNextPage() zeigt die vorherige/naechste TabPage
an. Dazu wird zuerst der Deactivate-Handler vom Dialog gerufen und
-wenn dieser TRUE zurueckgegeben hat, wird der Acivate-Handler
+wenn dieser sal_True zurueckgegeben hat, wird der Acivate-Handler
vom Dialog gerufen und die entsprechende TabPage angezeigt.
Finnsh() kann gerufen werden, wenn der Finnish-Button betaetigt
wird. Dort wird dann auch noch der Deactivate-Page-Handler vom
@@ -116,10 +116,10 @@ Level 0 die erste Seite ist.
Der DeactivatePage()-Handler wird gerufen, wenn eine neue TabPage
angezeigt werden soll. In diesem Handler kann noch eine Fehler-
ueberprufung stattfinden und das Umschalten gegebenenfalls verhindert
-werden, indem FALSE zurueckgegeben wird. Der Handler kann auch als
+werden, indem sal_False zurueckgegeben wird. Der Handler kann auch als
Link gesetzt werden. Die Defaultimplementierung ruft den Link und
gibt den Rueckgabewert des Links zurueck und wenn kein Link gesetzt
-ist, wird TRUE zurueckgegeben.
+ist, wird sal_True zurueckgegeben.
--------------------------------------------------------------------------
@@ -145,7 +145,7 @@ maNextBtn.SetClickHdl( LINK( this, MyWizardDlg, ImplNextHdl ) );
SetViewWindow( &maPreview );
// Show line between Buttons and Page
-ShowButtonFixedLine( TRUE );
+ShowButtonFixedLine( sal_True );
// Call ActivatePage, because the first page should be created an activated
ActivatePage();
@@ -228,7 +228,7 @@ private:
PushButton* mpPrevBtn;
PushButton* mpNextBtn;
Window* mpViewWindow;
- USHORT mnCurLevel;
+ sal_uInt16 mnCurLevel;
WindowAlign meViewAlign;
Link maActivateHdl;
Link maDeactivateHdl;
@@ -256,7 +256,7 @@ private:
SVT_DLLPRIVATE void ImplPosCtrls();
SVT_DLLPRIVATE void ImplPosTabPage();
SVT_DLLPRIVATE void ImplShowTabPage( TabPage* pPage );
- SVT_DLLPRIVATE TabPage* ImplGetPage( USHORT nLevel ) const;
+ SVT_DLLPRIVATE TabPage* ImplGetPage( sal_uInt16 nLevel ) const;
#endif
public:
@@ -271,16 +271,16 @@ public:
virtual void ActivatePage();
virtual long DeactivatePage();
- BOOL ShowPrevPage();
- BOOL ShowNextPage();
- BOOL ShowPage( USHORT nLevel );
- BOOL Finnish( long nResult = 0 );
- USHORT GetCurLevel() const { return mnCurLevel; }
+ sal_Bool ShowPrevPage();
+ sal_Bool ShowNextPage();
+ sal_Bool ShowPage( sal_uInt16 nLevel );
+ sal_Bool Finnish( long nResult = 0 );
+ sal_uInt16 GetCurLevel() const { return mnCurLevel; }
void AddPage( TabPage* pPage );
void RemovePage( TabPage* pPage );
- void SetPage( USHORT nLevel, TabPage* pPage );
- TabPage* GetPage( USHORT nLevel ) const;
+ void SetPage( sal_uInt16 nLevel, TabPage* pPage );
+ TabPage* GetPage( sal_uInt16 nLevel ) const;
void AddButton( Button* pButton, long nOffset = 0 );
void RemoveButton( Button* pButton );
@@ -290,8 +290,8 @@ public:
void SetNextButton( PushButton* pButton ) { mpNextBtn = pButton; }
PushButton* GetNextButton() const { return mpNextBtn; }
- void ShowButtonFixedLine( BOOL bVisible );
- BOOL IsButtonFixedLineVisible();
+ void ShowButtonFixedLine( sal_Bool bVisible );
+ sal_Bool IsButtonFixedLineVisible();
void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
Window* GetViewWindow() const { return mpViewWindow; }
diff --git a/svtools/inc/svtools/wmf.hxx b/svtools/inc/svtools/wmf.hxx
index 05461cc84ffb..be1852701f33 100644
--- a/svtools/inc/svtools/wmf.hxx
+++ b/svtools/inc/svtools/wmf.hxx
@@ -32,17 +32,17 @@
#include "svtools/svtdllapi.h"
#include <svtools/fltcall.hxx>
-BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL );
+sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL );
-SVT_DLLPUBLIC BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
+SVT_DLLPUBLIC sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
-SVT_DLLPUBLIC BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL, BOOL bPlaceable = TRUE );
+SVT_DLLPUBLIC sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL, sal_Bool bPlaceable = sal_True );
-BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL );
+sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL );
-SVT_DLLPUBLIC BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
+SVT_DLLPUBLIC sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF );
-SVT_DLLPUBLIC BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
+SVT_DLLPUBLIC sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF );
#endif
diff --git a/svtools/inc/svtools/xtextedt.hxx b/svtools/inc/svtools/xtextedt.hxx
index cd2b5117150a..915541824b5c 100644
--- a/svtools/inc/svtools/xtextedt.hxx
+++ b/svtools/inc/svtools/xtextedt.hxx
@@ -32,10 +32,6 @@
#include <svtools/texteng.hxx>
#include <svtools/textview.hxx>
-#define XTEXTUNDO_REPLACEALL (XTEXTUNDO_START+1)
-#define XTEXTUNDO_INDENTBLOCK 122
-#define XTEXTUNDO_UNINDENTBLOCK 123
-
namespace com {
namespace sun {
namespace star {
@@ -56,25 +52,25 @@ public:
void SetGroupChars( const String& r ) { maGroupChars = r; }
TextSelection MatchGroup( const TextPaM& rCursor ) const;
- BOOL Search( TextSelection& rSel, const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bForward = TRUE );
+ sal_Bool Search( TextSelection& rSel, const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bForward = sal_True );
};
class SVT_DLLPUBLIC ExtTextView : public TextView
{
protected:
- BOOL ImpIndentBlock( BOOL bRight );
+ sal_Bool ImpIndentBlock( sal_Bool bRight );
public:
ExtTextView( ExtTextEngine* pEng, Window* pWindow );
~ExtTextView();
- BOOL MatchGroup();
+ sal_Bool MatchGroup();
- BOOL Search( const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bForward );
- USHORT Replace( const ::com::sun::star::util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward );
+ sal_Bool Search( const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bForward );
+ sal_uInt16 Replace( const ::com::sun::star::util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward );
- BOOL IndentBlock();
- BOOL UnindentBlock();
+ sal_Bool IndentBlock();
+ sal_Bool UnindentBlock();
};
#endif // _XTEXTEDT_HXX
diff --git a/svtools/inc/svtools/xwindowitem.hxx b/svtools/inc/svtools/xwindowitem.hxx
index 9c3d1b6429ee..ed4a4c6760b4 100644
--- a/svtools/inc/svtools/xwindowitem.hxx
+++ b/svtools/inc/svtools/xwindowitem.hxx
@@ -50,8 +50,8 @@ class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
public:
TYPEINFO();
XWindowItem();
- explicit XWindowItem( USHORT nWhich, Window * pWin );
- XWindowItem( USHORT nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin );
+ explicit XWindowItem( sal_uInt16 nWhich, Window * pWin );
+ XWindowItem( sal_uInt16 nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin );
XWindowItem( const XWindowItem &rItem );
~XWindowItem();
diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst
index a7d8569de301..33ac3d4a506d 100644
--- a/svtools/prj/build.lst
+++ b/svtools/prj/build.lst
@@ -1,33 +1,2 @@
-st svtools : l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk NULL
-st svtools usr1 - all st_mkout NULL
-st svtools\inc nmake - all st_inc NULL
-st svtools\bmpmaker nmake - all st_bmp st_inc NULL
-st svtools\source\brwbox nmake - all st__brw st_bmp st_inc NULL
-st svtools\source\config nmake - all st_conf st_inc NULL
-st svtools\source\contnr nmake - all st__ctr st_inc NULL
-st svtools\source\control nmake - all st_ctl st_inc NULL
-st svtools\source\dialogs nmake - all st_dial st_inc NULL
-st svtools\source\edit nmake - all st_edit st_inc NULL
-st svtools\source\filter.vcl\filter nmake - all st_vfilt st_inc NULL
-st svtools\source\filter.vcl\wmf nmake - all st_vwmf st_inc NULL
-st svtools\source\filter.vcl\igif nmake - all st_vigif st_inc NULL
-st svtools\source\filter.vcl\jpeg nmake - all st_vjpeg st_inc NULL
-st svtools\source\filter.vcl\ixbm nmake - all st_vixbm st_inc NULL
-st svtools\source\filter.vcl\ixpm nmake - all st_vixpm st_inc NULL
-st svtools\source\graphic nmake - all st_svtgraphic st_inc NULL
-st svtools\source\java nmake - all st_svtjava st_inc NULL
-st svtools\source\misc nmake - all st__misc st_bmp st_inc NULL
-st svtools\source\plugapp nmake - all st_papp st_inc NULL
-st svtools\source\svhtml nmake - all st_html st_inc NULL
-st svtools\source\svrtf nmake - all st_rtf st_inc NULL
-st svtools\source\table nmake - all st_table st_inc NULL
-st svtools\source\toolpanel nmake - all st_toolpanel st_inc NULL
-st svtools\source\uno nmake - all st_uno st_inc NULL
-st svtools\source\uno\wizard nmake - all st_uno_wiz st_inc NULL
-st svtools\source\urlobj nmake - all st__url st_inc NULL
-st svtools\util nmake - all st_util st_svtgraphic st__brw st__ctr st_conf st_ctl st_dial st_edit st__misc st__url st_html st_papp st_rtf st_table st_toolpanel st_uno st_uno_wiz st_vfilt st_vigif st_vixbm st_vixpm st_vjpeg st_vwmf st_svtjava NULL
-st svtools\source\hatchwindow nmake - all st_hatchwin st_inc NULL
-st svtools\source\productregistration nmake - all st_prodreg st_util st_inc NULL
-st svtools\workben\unodialog nmake - all st_workben_udlg st_util NULL
-st svtools\workben\toolpanel nmake - all st_workben_toolpanel st_util st_toolpanel NULL
-st svtools\qa\unoapi nmake - all st_qa_unoapi NULL
+st svtools : L10N:l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL
+st svtools\prj nmake - all st_prj NULL
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
index b46ddef72311..e69de29bb2d1 100644
--- a/svtools/prj/d.lst
+++ b/svtools/prj/d.lst
@@ -1,40 +0,0 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-mkdir: %COMMON_DEST%\res%_EXT%
-mkdir: %_DEST%\inc%_EXT%\svtools
-mkdir: %_DEST%\inc%_EXT%\svtools\toolpanel
-mkdir: %_DEST%\inc%_EXT%\svtools\table
-
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\srs\ehdl.srs %_DEST%\res%_EXT%\svtools.srs
-..\%COMMON_OUTDIR%\srs\ehdl_srs.hid %COMMON_DEST%\res%_EXT%\svtools_srs.hid
-..\%__SRC%\lib\svtool.lib %_DEST%\lib%_EXT%\svtool.lib
-..\%__SRC%\slb\svt.lib %_DEST%\lib%_EXT%\xsvtool.lib
-..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*
-..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*
-..\%__SRC%\bin\bmp.* %_DEST%\bin%_EXT%\bmp.*
-..\%__SRC%\bin\bmpsum.* %_DEST%\bin%_EXT%\bmpsum.*
-..\%__SRC%\bin\bmpgui.* %_DEST%\bin%_EXT%\bmpgui.*
-..\%__SRC%\bin\g2g.* %_DEST%\bin%_EXT%\g2g.*
-..\%__SRC%\bin\bmp %_DEST%\bin%_EXT%\bmp
-..\%__SRC%\bin\bmpsum %_DEST%\bin%_EXT%\bmpsum
-..\%__SRC%\bin\bmpgui %_DEST%\bin%_EXT%\bmpgui
-..\%__SRC%\bin\g2g %_DEST%\bin%_EXT%\g2g
-..\%__SRC%\res\bmp.* %_DEST%\bin%_EXT%\bmp.*
-..\%__SRC%\res\bmpgui.* %_DEST%\bin%_EXT%\bmpgui.*
-..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*
-
-..\inc\svtools\*.hxx %_DEST%\inc%_EXT%\svtools\*.hxx
-..\inc\svtools\*.h %_DEST%\inc%_EXT%\svtools\*.h
-..\inc\svtools\*.hrc %_DEST%\inc%_EXT%\svtools\*.hrc
-..\inc\svtools\table\*.hxx %_DEST%\inc%_EXT%\svtools\table\*.hxx
-..\inc\*.hxx %_DEST%\inc%_EXT%\svtools\*.hxx
-..\inc\*.h %_DEST%\inc%_EXT%\svtools\*.h
-..\inc\*.hrc %_DEST%\inc%_EXT%\svtools\*.hrc
-
-..\inc\svtools\toolpanel\*.* %_DEST%\inc%_EXT%\svtools\toolpanel\*.hrc
-
-dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\bmp=%__PRJROOT%\%__SRC%\bin%_EXT%; fi"
-
-*.xml %_DEST%\xml%_EXT%\*.xml
-
diff --git a/svtools/prj/makefile.mk b/svtools/prj/makefile.mk
new file mode 100644
index 000000000000..e312a7ccab65
--- /dev/null
+++ b/svtools/prj/makefile.mk
@@ -0,0 +1,40 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..
+TARGET=prj
+
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/svtools/qa/unoapi/Test.java b/svtools/qa/unoapi/Test.java
index 8ae4af55ed61..b17f870d0b99 100644
--- a/svtools/qa/unoapi/Test.java
+++ b/svtools/qa/unoapi/Test.java
@@ -27,6 +27,7 @@ package org.openoffice.svtools.qa.unoapi;
import org.openoffice.Runner;
import org.openoffice.test.OfficeConnection;
+import org.openoffice.test.Argument;
import static org.junit.Assert.*;
public final class Test {
@@ -43,8 +44,8 @@ public final class Test {
@org.junit.Test public void test() {
assertTrue(
Runner.run(
- "-sce", "svtools.sce", "-xcl", "knownissues.xcl", "-cs",
- connection.getDescription()));
+ "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"), "-tdoc",
+ Argument.get("tdoc"), "-cs", connection.getDescription()));
}
private final OfficeConnection connection = new OfficeConnection();
diff --git a/svtools/qa/unoapi/makefile.mk b/svtools/qa/unoapi/makefile.mk
deleted file mode 100644
index e3afb77e637a..000000000000
--- a/svtools/qa/unoapi/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#***********************************************************************/
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
-PRJ = ../..
-PRJNAME = svtools
-TARGET = qa_unoapi
-
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = org/openoffice/svtools/qa/unoapi
-JAVATESTFILES = Test.java
-JAVAFILES = $(JAVATESTFILES)
-JARFILES = OOoRunner.jar ridl.jar test.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.END
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
-
-ALLTAR : javatest
-
-.END
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 2f05507a61b5..31e4a187574f 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -77,7 +77,7 @@ namespace
void BrowseBox::ConstructImpl( BrowserMode nMode )
{
OSL_TRACE( "BrowseBox: %p->ConstructImpl", this );
- bMultiSelection = FALSE;
+ bMultiSelection = sal_False;
pColSel = 0;
pDataWin = 0;
pVScroll = 0;
@@ -90,26 +90,26 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
InitSettings_Impl( this );
InitSettings_Impl( pDataWin );
- bBootstrapped = FALSE;
+ bBootstrapped = sal_False;
nDataRowHeight = 0;
nTitleLines = 1;
nFirstCol = 0;
nTopRow = 0;
nCurRow = BROWSER_ENDOFSELECTION;
nCurColId = 0;
- bResizing = FALSE;
- bSelect = FALSE;
- bSelecting = FALSE;
- bScrolling = FALSE;
- bSelectionIsVisible = FALSE;
- bNotToggleSel = FALSE;
- bRowDividerDrag = FALSE;
- bHit = FALSE;
- mbInteractiveRowHeight = FALSE;
- bHideSelect = FALSE;
+ bResizing = sal_False;
+ bSelect = sal_False;
+ bSelecting = sal_False;
+ bScrolling = sal_False;
+ bSelectionIsVisible = sal_False;
+ bNotToggleSel = sal_False;
+ bRowDividerDrag = sal_False;
+ bHit = sal_False;
+ mbInteractiveRowHeight = sal_False;
+ bHideSelect = sal_False;
bHideCursor = NO_CURSOR_HIDE;
nRowCount = 0;
- m_bFocusOnlyCursor = TRUE;
+ m_bFocusOnlyCursor = sal_True;
m_aCursorColor = COL_TRANSPARENT;
m_nCurrentMode = 0;
nControlAreaWidth = USHRT_MAX;
@@ -239,14 +239,14 @@ void BrowseBox::SetFont( const Font& rNewFont )
//-------------------------------------------------------------------
-ULONG BrowseBox::GetDefaultColumnWidth( const String& _rText ) const
+sal_uLong BrowseBox::GetDefaultColumnWidth( const String& _rText ) const
{
return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth( '0' ) * 4;
}
//-------------------------------------------------------------------
-void BrowseBox::InsertHandleColumn( ULONG nWidth )
+void BrowseBox::InsertHandleColumn( sal_uLong nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -266,8 +266,8 @@ void BrowseBox::InsertHandleColumn( ULONG nWidth )
}
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const Image& rImage,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -286,7 +286,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
getDataWindow()->pHeaderBar->InsertItem(
@@ -297,8 +297,8 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const XubString& rText,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -318,7 +318,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
getDataWindow()->pHeaderBar->InsertItem(
@@ -329,9 +329,9 @@ void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
//-------------------------------------------------------------------
-void BrowseBox::InsertDataColumn( USHORT nItemId,
+void BrowseBox::InsertDataColumn( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
- long nWidth, HeaderBarItemBits nBits, USHORT nPos,
+ long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos,
const String* pHelpText )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -352,7 +352,7 @@ void BrowseBox::InsertDataColumn( USHORT nItemId,
if ( getDataWindow()->pHeaderBar )
{
// Handlecolumn nicht in der Headerbar
- USHORT nHeaderPos = nPos;
+ sal_uInt16 nHeaderPos = nPos;
if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
nHeaderPos--;
@@ -367,20 +367,20 @@ void BrowseBox::InsertDataColumn( USHORT nItemId,
ColumnInserted( nPos );
}
//-------------------------------------------------------------------
-USHORT BrowseBox::ToggleSelectedColumn()
+sal_uInt16 BrowseBox::ToggleSelectedColumn()
{
- USHORT nSelectedColId = USHRT_MAX;
+ sal_uInt16 nSelectedColId = USHRT_MAX;
if ( pColSel && pColSel->GetSelectCount() )
{
DoHideCursor( "ToggleSelectedColumn" );
ToggleSelection();
nSelectedColId = (*pCols)[ pColSel->FirstSelected() ]->GetId();
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
}
return nSelectedColId;
}
// -----------------------------------------------------------------------------
-void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId)
+void BrowseBox::SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId)
{
if ( pColSel && _nSelectedColumnId != USHRT_MAX )
{
@@ -391,7 +391,7 @@ void BrowseBox::SetToggledSelectedColumn(USHORT _nSelectedColumnId)
}
}
// -----------------------------------------------------------------------------
-void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
+void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool bFreeze )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -410,7 +410,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
return;
// remark the column selection
- USHORT nSelectedColId = ToggleSelectedColumn();
+ sal_uInt16 nSelectedColId = ToggleSelectedColumn();
// freeze or unfreeze?
if ( bFreeze )
@@ -419,7 +419,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
if ( nItemPos != 0 && !(*pCols)[ nItemPos-1 ]->IsFrozen() )
{
// move to the right of the last frozen column
- USHORT nFirstScrollable = FrozenColCount();
+ sal_uInt16 nFirstScrollable = FrozenColCount();
BrowserColumn *pColumn = (*pCols)[ nItemPos ];
BrowserColumns::iterator it = pCols->begin();
::std::advance( it, nItemPos );
@@ -440,7 +440,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
if ( (sal_Int32)nItemPos != FrozenColCount()-1 )
{
// move to the leftmost scrollable colum
- USHORT nFirstScrollable = FrozenColCount();
+ sal_uInt16 nFirstScrollable = FrozenColCount();
BrowserColumn *pColumn = (*pCols)[ nItemPos ];
BrowserColumns::iterator it = pCols->begin();
::std::advance( it, nItemPos );
@@ -471,7 +471,7 @@ void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
+void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
{
// never set pos of the handle-column
if ( nColumnId == 0 )
@@ -482,7 +482,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
return;
// get the position in the current array
- USHORT nOldPos = GetColumnPos( nColumnId );
+ sal_uInt16 nOldPos = GetColumnPos( nColumnId );
if ( nOldPos >= pCols->size() )
// not available!
return;
@@ -491,7 +491,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
if (nOldPos != nPos)
{
// remark the column selection
- USHORT nSelectedColId = ToggleSelectedColumn();
+ sal_uInt16 nSelectedColId = ToggleSelectedColumn();
// determine old column area
Size aDataWinSize( pDataWin->GetSizePixel() );
@@ -501,7 +501,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
Rectangle aFromRect( GetFieldRect( nColumnId) );
aFromRect.Right() += 2*MIN_COLUMNWIDTH;
- USHORT nNextPos = nOldPos + 1;
+ sal_uInt16 nNextPos = nOldPos + 1;
if ( nOldPos > nPos )
nNextPos = nOldPos - 1;
@@ -552,7 +552,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
// adjust header bar positions
if ( getDataWindow()->pHeaderBar )
{
- USHORT nNewPos = nPos;
+ sal_uInt16 nNewPos = nPos;
if ( !GetColumnId(0) )
--nNewPos;
getDataWindow()->pHeaderBar->MoveItem(nColumnId,nNewPos);
@@ -594,7 +594,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags )
+void BrowseBox::SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -623,7 +623,7 @@ void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
+void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const String& rTitle )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -632,7 +632,7 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
return;
// get the position in the current array
- USHORT nItemPos = GetColumnPos( nItemId );
+ sal_uInt16 nItemPos = GetColumnPos( nItemId );
if ( nItemPos >= pCols->size() )
// not available!
return;
@@ -670,7 +670,7 @@ void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
//-------------------------------------------------------------------
-void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
+void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -692,7 +692,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
nMaxWidth -= getDataWindow()->bAutoSizeLastCol
? GetFieldRect(nItemId).Left()
: GetFrozenWidth();
- if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (ULONG)nMaxWidth )
+ if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth )
{
nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth;
nWidth = QueryColumnResize( nItemId, nWidth );
@@ -703,11 +703,11 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
// In AutoSizeLastColumn() wird SetColumnWidth mit nWidth==0xffff
// gerufen. Deshalb muss hier nochmal geprueft werden, ob sich die
// Breite tatsaechlich geaendert hat.
- if( (ULONG)nOldWidth == nWidth )
+ if( (sal_uLong)nOldWidth == nWidth )
return;
// soll die Aenderung sofort dargestellt werden?
- BOOL bUpdate = GetUpdateMode() &&
+ sal_Bool bUpdate = GetUpdateMode() &&
( (*pCols)[ nItemPos ]->IsFrozen() || nItemPos >= nFirstCol );
if ( bUpdate )
@@ -727,7 +727,7 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
{
// X-Pos der veraenderten Spalte ermitteln
long nX = 0;
- for ( USHORT nCol = 0; nCol < nItemPos; ++nCol )
+ for ( sal_uInt16 nCol = 0; nCol < nItemPos; ++nCol )
{
BrowserColumn *pCol = (*pCols)[ nCol ];
if ( pCol->IsFrozen() || nCol >= nFirstCol )
@@ -736,18 +736,18 @@ void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
// eigentliches scroll+invalidate
pDataWin->SetClipRegion();
- BOOL bSelVis = bSelectionIsVisible;
- bSelectionIsVisible = FALSE;
+ sal_Bool bSelVis = bSelectionIsVisible;
+ bSelectionIsVisible = sal_False;
if( GetBackground().IsScrollable() )
{
- Rectangle aScrRect( nX + std::min( (ULONG)nOldWidth, nWidth ), 0,
+ Rectangle aScrRect( nX + std::min( (sal_uLong)nOldWidth, nWidth ), 0,
GetSizePixel().Width() , // the header is longer than the datawin
pDataWin->GetPosPixel().Y() - 1 );
Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
aScrRect.Bottom() = pDataWin->GetSizePixel().Height();
getDataWindow()->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
- Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (ULONG)nOldWidth ), USHRT_MAX );
+ Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX );
Control::Invalidate( aInvRect, INVALIDATE_NOCHILDREN );
( (BrowserDataWin*)pDataWin )->Invalidate( aInvRect );
}
@@ -785,7 +785,7 @@ void BrowseBox::AutoSizeLastColumn()
if ( getDataWindow()->bAutoSizeLastCol &&
getDataWindow()->GetUpdateMode() )
{
- USHORT nId = GetColumnId( (USHORT)pCols->size() - 1 );
+ sal_uInt16 nId = GetColumnId( (sal_uInt16)pCols->size() - 1 );
SetColumnWidth( nId, LONG_MAX );
ColumnResized( nId );
}
@@ -793,12 +793,12 @@ void BrowseBox::AutoSizeLastColumn()
//-------------------------------------------------------------------
-void BrowseBox::RemoveColumn( USHORT nItemId )
+void BrowseBox::RemoveColumn( sal_uInt16 nItemId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// Spaltenposition ermitteln
- USHORT nPos = GetColumnPos(nItemId);
+ sal_uInt16 nPos = GetColumnPos(nItemId);
if ( nPos >= ColCount() )
// nicht vorhanden
return;
@@ -892,7 +892,7 @@ void BrowseBox::RemoveColumns()
// Spaltenselektion korrigieren
if ( pColSel )
{
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
pColSel->SetTotalRange( Range( 0, 0 ) );
}
@@ -950,11 +950,11 @@ void BrowseBox::RemoveColumns()
//-------------------------------------------------------------------
-String BrowseBox::GetColumnTitle( USHORT nId ) const
+String BrowseBox::GetColumnTitle( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nItemPos = GetColumnPos( nId );
+ sal_uInt16 nItemPos = GetColumnPos( nId );
if ( nItemPos >= pCols->size() )
return String();
return (*pCols)[ nItemPos ]->Title();
@@ -969,11 +969,11 @@ long BrowseBox::GetRowCount() const
//-------------------------------------------------------------------
-USHORT BrowseBox::ColCount() const
+sal_uInt16 BrowseBox::ColCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- return (USHORT) pCols->size();
+ return (sal_uInt16) pCols->size();
}
//-------------------------------------------------------------------
@@ -1002,7 +1002,7 @@ void BrowseBox::SetDataRowHeight( long nPixel )
//-------------------------------------------------------------------
-void BrowseBox::SetTitleLines( USHORT nLines )
+void BrowseBox::SetTitleLines( sal_uInt16 nLines )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1021,9 +1021,9 @@ long BrowseBox::ScrollColumns( long nCols )
// implicitly hides cursor while scrolling
StartScroll();
- bScrolling = TRUE;
- BOOL bScrollable = pDataWin->GetBackground().IsScrollable();
- BOOL bInvalidateView = FALSE;
+ bScrolling = sal_True;
+ sal_Bool bScrollable = pDataWin->GetBackground().IsScrollable();
+ sal_Bool bInvalidateView = sal_False;
// scrolling one column to the right?
if ( nCols == 1 )
@@ -1034,7 +1034,7 @@ long BrowseBox::ScrollColumns( long nCols )
if ( !bScrollable )
{
- bInvalidateView = TRUE;
+ bInvalidateView = sal_True;
}
else
{
@@ -1080,7 +1080,7 @@ long BrowseBox::ScrollColumns( long nCols )
if ( !bScrollable )
{
- bInvalidateView = TRUE;
+ bInvalidateView = sal_True;
}
else
{
@@ -1115,7 +1115,7 @@ long BrowseBox::ScrollColumns( long nCols )
pDataWin->GetSizePixel() ) );
}
- nFirstCol = nFirstCol + (USHORT)nCols;
+ nFirstCol = nFirstCol + (sal_uInt16)nCols;
aHScroll.SetThumbPos( nFirstCol - FrozenColCount() );
}
@@ -1147,7 +1147,7 @@ long BrowseBox::ScrollColumns( long nCols )
getDataWindow()->Update();
Update();
}
- bScrolling = FALSE;
+ bScrolling = sal_False;
EndScroll();
return nCols;
@@ -1171,8 +1171,8 @@ long BrowseBox::ScrollRows( long nRows )
if ( nNewTopRow == nTopRow )
return 0;
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
VisibleRowsChanged(nNewTopRow, nVisibleRows);
@@ -1222,7 +1222,7 @@ long BrowseBox::ScrollPages( long )
//-------------------------------------------------------------------
-void BrowseBox::RowModified( long nRow, USHORT nColId )
+void BrowseBox::RowModified( long nRow, sal_uInt16 nColId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1237,7 +1237,7 @@ void BrowseBox::RowModified( long nRow, USHORT nColId )
else
{
// invalidate the specific field
- aRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ aRect = GetFieldRectPixel( nRow, nColId, sal_False );
}
getDataWindow()->Invalidate( aRect );
}
@@ -1303,7 +1303,7 @@ void BrowseBox::Clear()
}
}
// -----------------------------------------------------------------------------
-void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeepSelection )
+void BrowseBox::RowInserted( long nRow, long nNumRows, sal_Bool bDoPaint, sal_Bool bKeepSelection )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1316,7 +1316,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
return;
// adjust total row count
- BOOL bLastRow = nRow >= nRowCount;
+ sal_Bool bLastRow = nRow >= nRowCount;
nRowCount += nNumRows;
DoHideCursor( "RowInserted" );
@@ -1360,9 +1360,9 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
// adjust the cursor
if ( nCurRow == BROWSER_ENDOFSELECTION )
- GoToRow( 0, FALSE, bKeepSelection );
+ GoToRow( 0, sal_False, bKeepSelection );
else if ( nRow <= nCurRow )
- GoToRow( nCurRow += nNumRows, FALSE, bKeepSelection );
+ GoToRow( nCurRow += nNumRows, sal_False, bKeepSelection );
// adjust the vertical scrollbar
if ( bDoPaint )
@@ -1409,7 +1409,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeep
//-------------------------------------------------------------------
-void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint )
+void BrowseBox::RowRemoved( long nRow, long nNumRows, sal_Bool bDoPaint )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1582,20 +1582,20 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint )
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRow( long nRow)
+sal_Bool BrowseBox::GoToRow( long nRow)
{
- return GoToRow(nRow, FALSE, FALSE);
+ return GoToRow(nRow, sal_False, sal_False);
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRowAndDoNotModifySelection( long nRow )
+sal_Bool BrowseBox::GoToRowAndDoNotModifySelection( long nRow )
{
- return GoToRow( nRow, FALSE, TRUE );
+ return GoToRow( nRow, sal_False, sal_True );
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
+sal_Bool BrowseBox::GoToRow( long nRow, sal_Bool bRowColMove, sal_Bool bKeepSelection )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1603,22 +1603,22 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
// nothing to do?
if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) )
- return TRUE;
+ return sal_True;
// out of range?
if ( nRow < 0 || nRow >= nRowCount )
- return FALSE;
+ return sal_False;
// nicht erlaubt?
if ( ( !bRowColMove && !IsCursorMoveAllowed( nRow, nCurColId ) ) )
- return FALSE;
+ return sal_False;
if ( getDataWindow()->bNoScrollBack && nRow < nTopRow )
nRow = nTopRow;
// compute the last visible row
Size aSz( pDataWin->GetSizePixel() );
- USHORT nVisibleRows = USHORT( aSz.Height() / GetDataRowHeight() - 1 );
+ sal_uInt16 nVisibleRows = sal_uInt16( aSz.Height() / GetDataRowHeight() - 1 );
long nLastRow = nTopRow + nVisibleRows;
// suspend Updates
@@ -1630,11 +1630,11 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
DoHideCursor( "GoToRow" );
// must we scroll?
- BOOL bWasVisible = bSelectionIsVisible;
+ sal_Bool bWasVisible = bSelectionIsVisible;
if (! bMultiSelection)
{
if( !bKeepSelection )
- bSelectionIsVisible = FALSE;
+ bSelectionIsVisible = sal_False;
}
if ( nRow < nTopRow )
ScrollRows( nRow - nTopRow );
@@ -1676,46 +1676,46 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToColumnId( USHORT nColId)
+sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId)
{
- return GoToColumnId(nColId,TRUE,FALSE);
+ return GoToColumnId(nColId,sal_True,sal_False);
}
-BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove)
+sal_Bool BrowseBox::GoToColumnId( sal_uInt16 nColId, sal_Bool bMakeVisible, sal_Bool bRowColMove)
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
if (!bColumnCursor)
- return FALSE;
+ return sal_False;
// erlaubt?
if (!bRowColMove && !IsCursorMoveAllowed( nCurRow, nColId ) )
- return FALSE;
+ return sal_False;
- if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, TRUE)))
+ if ( nColId != nCurColId || (bMakeVisible && !IsFieldVisible(nCurRow, nColId, sal_True)))
{
- USHORT nNewPos = GetColumnPos(nColId);
+ sal_uInt16 nNewPos = GetColumnPos(nColId);
BrowserColumn* pColumn = (nNewPos < pCols->size()) ? (*pCols)[ nNewPos ] : NULL;
DBG_ASSERT( pColumn, "no column object - invalid id?" );
if ( !pColumn )
- return FALSE;
+ return sal_False;
DoHideCursor( "GoToColumnId" );
nCurColId = nColId;
- USHORT nFirstPos = nFirstCol;
- USHORT nWidth = (USHORT)pColumn->Width();
- USHORT nLastPos = GetColumnAtXPosPixel(
- pDataWin->GetSizePixel().Width()-nWidth, FALSE );
- USHORT nFrozen = FrozenColCount();
+ sal_uInt16 nFirstPos = nFirstCol;
+ sal_uInt16 nWidth = (sal_uInt16)pColumn->Width();
+ sal_uInt16 nLastPos = GetColumnAtXPosPixel(
+ pDataWin->GetSizePixel().Width()-nWidth, sal_False );
+ sal_uInt16 nFrozen = FrozenColCount();
if ( bMakeVisible && nLastPos &&
nNewPos >= nFrozen && ( nNewPos < nFirstPos || nNewPos > nLastPos ) )
{
@@ -1728,35 +1728,35 @@ BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove
DoShowCursor( "GoToColumnId" );
if (!bRowColMove)
CursorMoved();
- return TRUE;
+ return sal_True;
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
-BOOL BrowseBox::GoToRowColumnId( long nRow, USHORT nColId )
+sal_Bool BrowseBox::GoToRowColumnId( long nRow, sal_uInt16 nColId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// out of range?
if ( nRow < 0 || nRow >= nRowCount )
- return FALSE;
+ return sal_False;
if (!bColumnCursor)
- return FALSE;
+ return sal_False;
// nothing to do ?
if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) &&
- nColId == nCurColId && IsFieldVisible(nCurRow, nColId, TRUE))
- return TRUE;
+ nColId == nCurColId && IsFieldVisible(nCurRow, nColId, sal_True))
+ return sal_True;
// erlaubt?
if (!IsCursorMoveAllowed(nRow, nColId))
- return FALSE;
+ return sal_False;
DoHideCursor( "GoToRowColumnId" );
- BOOL bMoved = GoToRow(nRow, TRUE) && GoToColumnId(nColId, TRUE, TRUE);
+ sal_Bool bMoved = GoToRow(nRow, sal_True) && GoToColumnId(nColId, sal_True, sal_True);
DoShowCursor( "GoToRowColumnId" );
if (bMoved)
@@ -1783,15 +1783,15 @@ void BrowseBox::SetNoSelection()
// unselect all
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1827,7 +1827,7 @@ void BrowseBox::SetSelection( const MultiSelection &rSel )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
ToggleSelection();
@@ -1857,8 +1857,8 @@ void BrowseBox::SelectAll()
// select all rows
if ( pColSel )
- pColSel->SelectAll(FALSE);
- uRow.pSel->SelectAll(TRUE);
+ pColSel->SelectAll(sal_False);
+ uRow.pSel->SelectAll(sal_True);
// Handle-Column nicht highlighten
BrowserColumn *pFirstCol = (*pCols)[ 0 ];
@@ -1868,8 +1868,8 @@ void BrowseBox::SelectAll()
if ( !bHideSelect )
{
Rectangle aHighlightRect;
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() );
nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows;
nRow = uRow.pSel->NextSelected() )
@@ -1882,7 +1882,7 @@ void BrowseBox::SelectAll()
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1912,7 +1912,7 @@ void BrowseBox::SelectAll()
//-------------------------------------------------------------------
-void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
+void BrowseBox::SelectRow( long nRow, sal_Bool _bSelect, sal_Bool bExpand )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1920,7 +1920,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
{
// deselecting is impossible, selecting via cursor
if ( _bSelect )
- GoToRow(nRow, FALSE);
+ GoToRow(nRow, sal_False);
return;
}
@@ -1931,11 +1931,11 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
{
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
}
// set new selection
@@ -1963,7 +1963,7 @@ void BrowseBox::SelectRow( long nRow, BOOL _bSelect, BOOL bExpand )
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
// restore screen
OSL_TRACE( "BrowseBox: %p->ShowCursor", this );
@@ -1996,7 +1996,7 @@ long BrowseBox::GetSelectRowCount() const
//-------------------------------------------------------------------
-void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVisible )
+void BrowseBox::SelectColumnPos( sal_uInt16 nNewColPos, sal_Bool _bSelect, sal_Bool bMakeVisible )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2018,10 +2018,10 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
OSL_TRACE( "BrowseBox: %p->HideCursor", this );
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
- pColSel->SelectAll(FALSE);
+ pColSel->SelectAll(sal_False);
if ( pColSel->Select( nNewColPos, _bSelect ) )
{
@@ -2029,7 +2029,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
// only highlight painted areas
pDataWin->Update();
- Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, FALSE ) );
+ Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, sal_False ) );
Rectangle aRect(
Point( aFieldRectPix.Left() - MIN_COLUMNWIDTH, 0 ),
Size( (*pCols)[ nNewColPos ]->Width(),
@@ -2038,7 +2038,7 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
if ( !bSelecting )
Select();
else
- bSelect = TRUE;
+ bSelect = sal_True;
if ( isAccessibleAlive() )
{
@@ -2062,12 +2062,12 @@ void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL _bSelect, BOOL bMakeVis
//-------------------------------------------------------------------
-USHORT BrowseBox::GetSelectColumnCount() const
+sal_uInt16 BrowseBox::GetSelectColumnCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// while bAutoSelect (==!pColSel), 1 if any rows (yes rows!) else none
- return pColSel ? (USHORT) pColSel->GetSelectCount() :
+ return pColSel ? (sal_uInt16) pColSel->GetSelectCount() :
nCurRow >= 0 ? 1 : 0;
}
@@ -2085,7 +2085,7 @@ long BrowseBox::NextSelectedColumn( ) const
//-------------------------------------------------------------------
-long BrowseBox::FirstSelectedRow( BOOL bInverse )
+long BrowseBox::FirstSelectedRow( sal_Bool bInverse )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2130,7 +2130,7 @@ bool BrowseBox::IsRowSelected( long nRow ) const
//-------------------------------------------------------------------
-bool BrowseBox::IsColumnSelected( USHORT nColumnId ) const
+bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2149,11 +2149,11 @@ sal_Bool BrowseBox::IsAllSelected() const
//-------------------------------------------------------------------
-BOOL BrowseBox::MakeFieldVisible
+sal_Bool BrowseBox::MakeFieldVisible
(
long nRow, // Zeilen-Nr des Feldes (beginnend mit 0)
- USHORT nColId, // Spalten-Id des Feldes
- BOOL bComplete // (== FALSE), TRUE => vollst"andig sichtbar machen
+ sal_uInt16 nColId, // Spalten-Id des Feldes
+ sal_Bool bComplete // (== sal_False), sal_True => vollst"andig sichtbar machen
)
/* [Beschreibung]
@@ -2164,11 +2164,11 @@ BOOL BrowseBox::MakeFieldVisible
[R"uckgabewert]
- BOOL TRUE
+ sal_Bool sal_True
Das angegebene Feld wurde sichtbar gemacht, bzw. war
bereits sichtbar.
- FALSE
+ sal_False
Das angegebene Feld konnte nicht sichtbar bzw. bei
'bComplete' nicht vollst"andig sichtbar gemacht werden.
*/
@@ -2178,16 +2178,16 @@ BOOL BrowseBox::MakeFieldVisible
if ( !bBootstrapped ||
( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) )
- return FALSE;
+ return sal_False;
// ist es schon sichtbar?
- BOOL bVisible = IsFieldVisible( nRow, nColId, bComplete );
+ sal_Bool bVisible = IsFieldVisible( nRow, nColId, bComplete );
if ( bVisible )
- return TRUE;
+ return sal_True;
// Spaltenposition und Feld-Rechteck und Ausgabebereich berechnen
- USHORT nColPos = GetColumnPos( nColId );
- Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ sal_uInt16 nColPos = GetColumnPos( nColId );
+ Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False );
Rectangle aDataRect = Rectangle( Point(0, 0), pDataWin->GetSizePixel() );
// links au\serhalb?
@@ -2204,7 +2204,7 @@ BOOL BrowseBox::MakeFieldVisible
if ( ScrollColumns( 1 ) != 1 )
// nichts mehr zu scrollen
break;
- aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ aFieldRect = GetFieldRectPixel( nRow, nColId, sal_False );
}
// oben au\serhalb?
@@ -2230,19 +2230,19 @@ BOOL BrowseBox::MakeFieldVisible
//-------------------------------------------------------------------
-BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId,
- BOOL bCompletely ) const
+sal_Bool BrowseBox::IsFieldVisible( long nRow, sal_uInt16 nColumnId,
+ sal_Bool bCompletely ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// durch frozen-Column verdeckt?
- USHORT nColPos = GetColumnPos( nColumnId );
+ sal_uInt16 nColPos = GetColumnPos( nColumnId );
if ( nColPos >= FrozenColCount() && nColPos < nFirstCol )
- return FALSE;
+ return sal_False;
Rectangle aRect( ImplFieldRectPixel( nRow, nColumnId ) );
if ( aRect.IsEmpty() )
- return FALSE;
+ return sal_False;
// get the visible area
Rectangle aOutRect( Point(0, 0), pDataWin->GetOutputSizePixel() );
@@ -2257,8 +2257,8 @@ BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId,
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId,
- BOOL bRelToBrowser) const
+Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId,
+ sal_Bool bRelToBrowser) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2280,7 +2280,7 @@ Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId,
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const
+Rectangle BrowseBox::GetRowRectPixel( long nRow, sal_Bool bRelToBrowser ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2309,13 +2309,13 @@ Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const
//-------------------------------------------------------------------
-Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const
+Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// compute the X-coordinte realtiv to DataWin by accumulation
long nColX = 0;
- USHORT nFrozenCols = FrozenColCount();
+ sal_uInt16 nFrozenCols = FrozenColCount();
size_t nCol;
for ( nCol = 0;
nCol < pCols->size() && (*pCols)[ nCol ]->GetId() != nColumnId;
@@ -2340,7 +2340,7 @@ Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const
//-------------------------------------------------------------------
-long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const
+long BrowseBox::GetRowAtYPosPixel( long nY, sal_Bool bRelToBrowser ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2361,7 +2361,7 @@ long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const
//-------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const
+Rectangle BrowseBox::GetFieldRect( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2370,7 +2370,7 @@ Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const
+sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX, sal_Bool ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2391,7 +2391,7 @@ USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const
//-------------------------------------------------------------------
-void BrowseBox::ReserveControlArea( USHORT nWidth )
+void BrowseBox::ReserveControlArea( sal_uInt16 nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -2431,9 +2431,9 @@ void BrowseBox::SetMode( BrowserMode nMode )
DBG_ASSERT( !( getDataWindow()->bAutoVScroll && getDataWindow()->bNoVScroll ),
"BrowseBox::SetMode: AutoVScroll *and* NoVScroll?" );
if ( getDataWindow()->bAutoHScroll )
- getDataWindow()->bNoHScroll = FALSE;
+ getDataWindow()->bNoHScroll = sal_False;
if ( getDataWindow()->bAutoVScroll )
- getDataWindow()->bNoVScroll = FALSE;
+ getDataWindow()->bNoVScroll = sal_False;
if ( getDataWindow()->bNoHScroll )
aHScroll.Hide();
@@ -2547,40 +2547,40 @@ void BrowseBox::SetMode( BrowserMode nMode )
//-------------------------------------------------------------------
-void BrowseBox::VisibleRowsChanged( long, USHORT )
+void BrowseBox::VisibleRowsChanged( long, sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
// Das alte Verhalten: NumRows automatisch korrigieren:
if ( nRowCount < GetRowCount() )
{
- RowInserted(nRowCount,GetRowCount() - nRowCount,FALSE);
+ RowInserted(nRowCount,GetRowCount() - nRowCount,sal_False);
}
else if ( nRowCount > GetRowCount() )
{
- RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),FALSE);
+ RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),sal_False);
}
}
//-------------------------------------------------------------------
-sal_Bool BrowseBox::IsCursorMoveAllowed( long, USHORT ) const
+sal_Bool BrowseBox::IsCursorMoveAllowed( long, sal_uInt16 ) const
/* [Beschreibung]
Diese virtuelle Methode wird immer gerufen bevor der Cursor direkt
- bewegt werden soll. Durch 'return FALSE' kann verhindert werden, da\s
+ bewegt werden soll. Durch 'return sal_False' kann verhindert werden, da\s
dies geschieht, wenn z.B. ein Datensatz irgendwelchen Rules widerspricht.
Diese Methode wird nicht gerufen, wenn die Cursorbewegung durch
ein L"oschen oder Einf"ugen (einer Zeile/Spalte) ausgel"ost wird, also
genaugenommen nur eine Cursor-Korrektur vorliegt.
- Die Basisimplementierung liefert derzeit immer TRUE.
+ Die Basisimplementierung liefert derzeit immer sal_True.
*/
{
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------
@@ -2698,10 +2698,10 @@ void BrowseBox::LoseFocus()
if ( !bKeepHighlight )
{
ToggleSelection();
- bSelectionIsVisible = FALSE;
+ bSelectionIsVisible = sal_False;
}
- bHasFocus = FALSE;
+ bHasFocus = sal_False;
}
Control::LoseFocus();
}
@@ -2717,12 +2717,12 @@ void BrowseBox::GetFocus()
{
if ( !bSelectionIsVisible )
{
- bSelectionIsVisible = TRUE;
+ bSelectionIsVisible = sal_True;
if ( bBootstrapped )
ToggleSelection();
}
- bHasFocus = TRUE;
+ bHasFocus = sal_True;
DoShowCursor( "GetFocus" );
}
Control::GetFocus();
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index c4dcc4d9d74b..9c9796baa90b 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -174,7 +174,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
}
else if ( STATE_CHANGE_INITSHOW == nStateChange )
{
- bBootstrapped = TRUE; // muss zuerst gesetzt werden!
+ bBootstrapped = sal_True; // muss zuerst gesetzt werden!
Resize();
if ( bMultiSelection )
@@ -187,8 +187,8 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
if ( HasFocus() )
{
- bSelectionIsVisible = TRUE;
- bHasFocus = TRUE;
+ bSelectionIsVisible = sal_True;
+ bHasFocus = sal_True;
}
UpdateScrollbars();
AutoSizeLastColumn();
@@ -282,7 +282,7 @@ void BrowseBox::RowHeightChanged()
//-------------------------------------------------------------------
-long BrowseBox::QueryColumnResize( USHORT, long nWidth )
+long BrowseBox::QueryColumnResize( sal_uInt16, long nWidth )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
return nWidth;
@@ -290,14 +290,14 @@ long BrowseBox::QueryColumnResize( USHORT, long nWidth )
//-------------------------------------------------------------------
-void BrowseBox::ColumnResized( USHORT )
+void BrowseBox::ColumnResized( sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
}
//-------------------------------------------------------------------
-void BrowseBox::ColumnMoved( USHORT )
+void BrowseBox::ColumnMoved( sal_uInt16 )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
}
@@ -326,7 +326,7 @@ void BrowseBox::EndScroll()
#pragma optimize( "", off )
#endif
-void BrowseBox::ToggleSelection( BOOL bForce )
+void BrowseBox::ToggleSelection( sal_Bool bForce )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -338,8 +338,8 @@ void BrowseBox::ToggleSelection( BOOL bForce )
return;
// only highlight painted areas!
- bNotToggleSel = TRUE;
- if ( FALSE && !getDataWindow()->bInPaint )
+ bNotToggleSel = sal_True;
+ if ( sal_False && !getDataWindow()->bInPaint )
pDataWin->Update();
// accumulate areas of rows to highlight
@@ -388,7 +388,7 @@ void BrowseBox::ToggleSelection( BOOL bForce )
{
Rectangle aRect( GetFieldRectPixel(nCurRow,
(*pCols)[ nColId ]->GetId(),
- FALSE ) );
+ sal_False ) );
aRect.Left() -= MIN_COLUMNWIDTH;
aRect.Right() += MIN_COLUMNWIDTH;
aRect.Top() = 0;
@@ -396,7 +396,7 @@ void BrowseBox::ToggleSelection( BOOL bForce )
pDataWin->Invalidate( aRect );
}
- bNotToggleSel = FALSE;
+ bNotToggleSel = sal_False;
}
#ifdef _MSC_VER
@@ -407,15 +407,15 @@ void BrowseBox::ToggleSelection( BOOL bForce )
void BrowseBox::DrawCursor()
{
- BOOL bReallyHide = FALSE;
+ sal_Bool bReallyHide = sal_False;
if ( SMART_CURSOR_HIDE == bHideCursor )
{
if ( !GetSelectRowCount() && !GetSelectColumnCount() )
- bReallyHide = TRUE;
+ bReallyHide = sal_True;
}
else if ( HARD_CURSOR_HIDE == bHideCursor )
{
- bReallyHide = TRUE;
+ bReallyHide = sal_True;
}
bReallyHide |= !bSelectionIsVisible || !IsUpdateMode() || bScrolling || nCurRow < 0;
@@ -433,7 +433,7 @@ void BrowseBox::DrawCursor()
Rectangle aCursor;
if ( bColumnCursor )
{
- aCursor = GetFieldRectPixel( nCurRow, nCurColId, FALSE );
+ aCursor = GetFieldRectPixel( nCurRow, nCurColId, sal_False );
aCursor.Left() -= MIN_COLUMNWIDTH;
aCursor.Right() += 1;
aCursor.Bottom() += 1;
@@ -475,11 +475,11 @@ void BrowseBox::DrawCursor()
//-------------------------------------------------------------------
-ULONG BrowseBox::GetColumnWidth( USHORT nId ) const
+sal_uLong BrowseBox::GetColumnWidth( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nItemPos = GetColumnPos( nId );
+ sal_uInt16 nItemPos = GetColumnPos( nId );
if ( nItemPos >= pCols->size() )
return 0;
return (*pCols)[ nItemPos ]->Width();
@@ -487,7 +487,7 @@ ULONG BrowseBox::GetColumnWidth( USHORT nId ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnId( USHORT nPos ) const
+sal_uInt16 BrowseBox::GetColumnId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -498,11 +498,11 @@ USHORT BrowseBox::GetColumnId( USHORT nPos ) const
//-------------------------------------------------------------------
-USHORT BrowseBox::GetColumnPos( USHORT nId ) const
+sal_uInt16 BrowseBox::GetColumnPos( sal_uInt16 nId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- for ( USHORT nPos = 0; nPos < pCols->size(); ++nPos )
+ for ( sal_uInt16 nPos = 0; nPos < pCols->size(); ++nPos )
if ( (*pCols)[ nPos ]->GetId() == nId )
return nPos;
return BROWSER_INVALIDID;
@@ -510,14 +510,14 @@ USHORT BrowseBox::GetColumnPos( USHORT nId ) const
//-------------------------------------------------------------------
-BOOL BrowseBox::IsFrozen( USHORT nColumnId ) const
+sal_Bool BrowseBox::IsFrozen( sal_uInt16 nColumnId ) const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
for ( size_t nPos = 0; nPos < pCols->size(); ++nPos )
if ( (*pCols)[ nPos ]->GetId() == nColumnId )
return (*pCols)[ nPos ]->IsFrozen();
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------
@@ -534,34 +534,34 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
Range aJustifiedRange( aSelRange );
aJustifiedRange.Justify();
- BOOL bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) );
+ sal_Bool bSelectThis = ( bSelect != aJustifiedRange.IsInside( rEvt.GetRow() ) );
if ( aJustifiedRange.IsInside( rEvt.GetRow() ) )
{
// down and up
while ( rEvt.GetRow() < aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
--aSelRange.Max();
}
while ( rEvt.GetRow() > aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
++aSelRange.Max();
}
}
else
{
// up and down
- BOOL bOldSelecting = bSelecting;
- bSelecting = TRUE;
+ sal_Bool bOldSelecting = bSelecting;
+ bSelecting = sal_True;
while ( rEvt.GetRow() < aSelRange.Max() )
{ // ZTC/Mac bug - dont put these statemants together!
--aSelRange.Max();
if ( !IsRowSelected( aSelRange.Max() ) )
{
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
- bSelect = TRUE;
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
+ bSelect = sal_True;
}
}
while ( rEvt.GetRow() > aSelRange.Max() )
@@ -569,8 +569,8 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
++aSelRange.Max();
if ( !IsRowSelected( aSelRange.Max() ) )
{
- SelectRow( aSelRange.Max(), bSelectThis, TRUE );
- bSelect = TRUE;
+ SelectRow( aSelRange.Max(), bSelectThis, sal_True );
+ bSelect = sal_True;
}
}
bSelecting = bOldSelecting;
@@ -580,9 +580,9 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
}
else
if ( !bMultiSelection || !IsRowSelected( rEvt.GetRow() ) )
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
- GoToRow( rEvt.GetRow(), FALSE );
+ GoToRow( rEvt.GetRow(), sal_False );
DoShowCursor( "ExpandRowSelection" );
}
@@ -595,21 +595,21 @@ void BrowseBox::Resize()
BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
if ( pCols->empty() )
{
- getDataWindow()->bResizeOnPaint = TRUE;
+ getDataWindow()->bResizeOnPaint = sal_True;
return;
}
- getDataWindow()->bResizeOnPaint = FALSE;
+ getDataWindow()->bResizeOnPaint = sal_False;
// calc the size of the scrollbars
// (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be
// resized - which is done in UpdateScrollbars)
- ULONG nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ sal_uLong nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if (IsZoom())
- nSBSize = (ULONG)(nSBSize * (double)GetZoom());
+ nSBSize = (sal_uLong)(nSBSize * (double)GetZoom());
DoHideCursor( "Resize" );
- USHORT nOldVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nOldVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// did we need a horiz. scroll bar oder gibt es eine Control Area?
if ( !getDataWindow()->bNoHScroll &&
@@ -632,8 +632,8 @@ void BrowseBox::Resize()
Point( 0, GetTitleHeight() ),
Size( nDataWidth, nDataHeight ) );
- USHORT nVisibleRows =
- (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ sal_uInt16 nVisibleRows =
+ (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
// TopRow ist unveraendert, aber die Anzahl sichtbarer Zeilen hat sich
// geaendert
@@ -675,8 +675,8 @@ void BrowseBox::Paint( const Rectangle& rRect )
return;
BrowserColumn *pFirstCol = (*pCols)[ 0 ];
- BOOL bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
- BOOL bHeaderBar = getDataWindow()->pHeaderBar != NULL;
+ sal_Bool bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
+ sal_Bool bHeaderBar = getDataWindow()->pHeaderBar != NULL;
// draw delimitational lines
if ( !getDataWindow()->bNoHScroll )
@@ -723,7 +723,7 @@ void BrowseBox::Paint( const Rectangle& rRect )
{
ButtonFrame aButtonFrame( Point( nX, 0 ),
Size( pCol->Width()-1, GetTitleHeight()-1 ),
- pCol->Title(), FALSE, FALSE,
+ pCol->Title(), sal_False, sal_False,
0 != (BROWSER_COLUMN_TITLEABBREVATION&pCol->Flags()),
!IsEnabled());
aButtonFrame.Draw( *this );
@@ -768,9 +768,9 @@ void BrowseBox::PaintRow( OutputDevice&, const Rectangle& )
//-------------------------------------------------------------------
-void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- BOOL bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0;
+ sal_Bool bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0;
// we need pixel coordinates
Size aRealSize = pDev->LogicToPixel(rSize);
@@ -859,7 +859,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
{
ButtonFrame aButtonFrame( aRealPos,
Size( pFirstCol->Width()-1, nTitleHeight-1 ),
- pFirstCol->Title(), FALSE, FALSE, FALSE, !IsEnabled());
+ pFirstCol->Title(), sal_False, sal_False, sal_False, !IsEnabled());
aButtonFrame.Draw( *pDev );
pDev->Push( PUSH_LINECOLOR );
@@ -882,7 +882,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetClipRegion( pDev->PixelToLogic( aRegion ) );
// do we have to paint the background
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground();
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground();
if ( bBackground )
{
Rectangle aRect( aRealPos, aRealSize );
@@ -890,7 +890,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->DrawRect( aRect );
}
- ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), TRUE, bDrawSelection );
+ ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), sal_True, bDrawSelection );
// restore the column widths/data row height
nDataRowHeight = nOriginalHeight;
@@ -911,7 +911,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
//-------------------------------------------------------------------
-void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections)
+void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, sal_Bool _bForeignDevice, sal_Bool _bDrawSelections)
{
Point aOverallAreaPos = _bForeignDevice ? _rRect.TopLeft() : Point(0,0);
Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : GetDataWindow().GetOutputSizePixel();
@@ -920,8 +920,8 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
long nDataRowHeigt = GetDataRowHeight();
// compute relative rows to redraw
- ULONG nRelTopRow = _bForeignDevice ? 0 : ((ULONG)_rRect.Top() / nDataRowHeigt);
- ULONG nRelBottomRow = (ULONG)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
+ sal_uLong nRelTopRow = _bForeignDevice ? 0 : ((sal_uLong)_rRect.Top() / nDataRowHeigt);
+ sal_uLong nRelBottomRow = (sal_uLong)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
// cache frequently used values
Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() );
@@ -939,18 +939,18 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor );
// redraw the invalid fields
- for ( ULONG nRelRow = nRelTopRow;
- nRelRow <= nRelBottomRow && (ULONG)nTopRow+nRelRow < (ULONG)nRowCount;
+ for ( sal_uLong nRelRow = nRelTopRow;
+ nRelRow <= nRelBottomRow && (sal_uLong)nTopRow+nRelRow < (sal_uLong)nRowCount;
++nRelRow, aPos.Y() += nDataRowHeigt )
{
// get row
// Zur Sicherheit auf zul"assigen Bereich abfragen:
- DBG_ASSERT( (USHORT)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" );
- if ( (nTopRow+long(nRelRow)) < 0 || (USHORT)(nTopRow+nRelRow) >= nRowCount )
+ DBG_ASSERT( (sal_uInt16)(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" );
+ if ( (nTopRow+long(nRelRow)) < 0 || (sal_uInt16)(nTopRow+nRelRow) >= nRowCount )
continue;
// prepare row
- ULONG nRow = nTopRow+nRelRow;
+ sal_uLong nRow = nTopRow+nRelRow;
if ( !SeekRow( nRow) ) {
OSL_FAIL("BrowseBox::ImplPaintData: SeekRow gescheitert");
}
@@ -964,7 +964,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Size( _rRect.GetSize().Width(), nDataRowHeigt ) );
PaintRow( _rOut, aRowRect );
- BOOL bRowSelected = _bDrawSelections
+ sal_Bool bRowSelected = _bDrawSelections
&& !bHideSelect
&& IsRowSelected( nRow );
if ( bRowSelected )
@@ -1000,7 +1000,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
}
// prepare Column-AutoHighlight
- BOOL bColAutoHighlight = _bDrawSelections
+ sal_Bool bColAutoHighlight = _bDrawSelections
&& bColumnCursor
&& IsColumnSelected( pCol->GetId() );
if ( bColAutoHighlight )
@@ -1014,7 +1014,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
_rOut.DrawRect( aFieldRect );
}
- if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (ULONG)GetCurRow()))
+ if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nRow == (sal_uLong)GetCurRow()))
DrawCursor();
// draw a single field
@@ -1040,7 +1040,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL
Region aClipToField(Rectangle(aPos, aFieldSize));
_rOut.SetClipRegion(aClipToField);
}
- pCol->Draw( *this, _rOut, aPos, FALSE );
+ pCol->Draw( *this, _rOut, aPos, sal_False );
if (_bForeignDevice)
_rOut.SetClipRegion();
}
@@ -1165,7 +1165,7 @@ void BrowseBox::PaintData( Window& rWin, const Rectangle& rRect )
Resize();
// MI: wer war das denn? Window::Update();
- ImplPaintData(rWin, rRect, FALSE, TRUE);
+ ImplPaintData(rWin, rRect, sal_False, sal_True);
}
//-------------------------------------------------------------------
@@ -1181,19 +1181,19 @@ void BrowseBox::UpdateScrollbars()
BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin;
if ( pBDW->bInUpdateScrollbars )
{
- pBDW->bHadRecursion = TRUE;
+ pBDW->bHadRecursion = sal_True;
return;
}
- pBDW->bInUpdateScrollbars = TRUE;
+ pBDW->bInUpdateScrollbars = sal_True;
// the size of the corner window (and the width of the VSB/height of the HSB)
- ULONG nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ sal_uLong nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if (IsZoom())
- nCornerSize = (ULONG)(nCornerSize * (double)GetZoom());
+ nCornerSize = (sal_uLong)(nCornerSize * (double)GetZoom());
// needs VScroll?
long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
- BOOL bNeedsVScroll = getDataWindow()->bAutoVScroll
+ sal_Bool bNeedsVScroll = getDataWindow()->bAutoVScroll
? nTopRow || ( nRowCount > nMaxRows )
: !getDataWindow()->bNoVScroll;
Size aDataWinSize = pDataWin->GetSizePixel();
@@ -1215,10 +1215,10 @@ void BrowseBox::UpdateScrollbars()
}
// needs HScroll?
- ULONG nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
+ sal_uLong nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
- USHORT nFrozenCols = FrozenColCount();
- BOOL bNeedsHScroll = getDataWindow()->bAutoHScroll
+ sal_uInt16 nFrozenCols = FrozenColCount();
+ sal_Bool bNeedsHScroll = getDataWindow()->bAutoHScroll
? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->size() )
: !getDataWindow()->bNoHScroll;
if ( !bNeedsHScroll )
@@ -1239,7 +1239,7 @@ void BrowseBox::UpdateScrollbars()
}
// adjust position and Width of horizontal scrollbar
- ULONG nHScrX = nControlAreaWidth == USHRT_MAX
+ sal_uLong nHScrX = nControlAreaWidth == USHRT_MAX
? 0
: nControlAreaWidth;
@@ -1290,7 +1290,7 @@ void BrowseBox::UpdateScrollbars()
// needs corner-window?
// (do that AFTER positioning BOTH scrollbars)
- ULONG nActualCorderWidth = 0;
+ sal_uLong nActualCorderWidth = 0;
if (aHScroll.IsVisible() && pVScroll && pVScroll->IsVisible() )
{
// if we have both scrollbars, the corner window fills the point of intersection of these two
@@ -1330,21 +1330,21 @@ void BrowseBox::UpdateScrollbars()
getDataWindow()->pHeaderBar->SetOffset( nWidth );
}
- pBDW->bInUpdateScrollbars = FALSE;
+ pBDW->bInUpdateScrollbars = sal_False;
if ( pBDW->bHadRecursion )
{
- pBDW->bHadRecursion = FALSE;
+ pBDW->bHadRecursion = sal_False;
UpdateScrollbars();
}
}
//-------------------------------------------------------------------
-void BrowseBox::SetUpdateMode( BOOL bUpdate )
+void BrowseBox::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- BOOL bWasUpdate = IsUpdateMode();
+ sal_Bool bWasUpdate = IsUpdateMode();
if ( bWasUpdate == bUpdate )
return;
@@ -1372,7 +1372,7 @@ void BrowseBox::SetUpdateMode( BOOL bUpdate )
//-------------------------------------------------------------------
-BOOL BrowseBox::GetUpdateMode() const
+sal_Bool BrowseBox::GetUpdateMode() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1395,7 +1395,7 @@ long BrowseBox::GetFrozenWidth() const
//-------------------------------------------------------------------
-void BrowseBox::ColumnInserted( USHORT nPos )
+void BrowseBox::ColumnInserted( sal_uInt16 nPos )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
@@ -1406,10 +1406,10 @@ void BrowseBox::ColumnInserted( USHORT nPos )
//-------------------------------------------------------------------
-USHORT BrowseBox::FrozenColCount() const
+sal_uInt16 BrowseBox::FrozenColCount() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nCol;
+ sal_uInt16 nCol;
for ( nCol = 0;
nCol < pCols->size() && (*pCols)[ nCol ]->IsFrozen();
++nCol )
@@ -1498,7 +1498,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 )
{
// start resizing the column
- bResizing = TRUE;
+ bResizing = sal_True;
nResizeCol = nCol;
nDragX = nResizeX = rEvtPos.X();
SetPointer( Pointer( POINTER_HSPLIT ) );
@@ -1521,7 +1521,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
// event occurred out of data area
if ( rEvt.IsRight() )
pDataWin->Command(
- CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, TRUE ) );
+ CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, sal_True ) );
else
SetNoSelection();
}
@@ -1539,17 +1539,17 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
Pointer aNewPointer;
- USHORT nX = 0;
+ sal_uInt16 nX = 0;
for ( size_t nCol = 0;
nCol < pCols->size() &&
- ( nX + (*pCols)[ nCol ]->Width() ) < USHORT(GetOutputSizePixel().Width());
+ ( nX + (*pCols)[ nCol ]->Width() ) < sal_uInt16(GetOutputSizePixel().Width());
++nCol )
// is this column visible?
if ( (*pCols)[ nCol ]->IsFrozen() || nCol >= nFirstCol )
{
// compute right end of column
BrowserColumn *pCol = (*pCols)[ nCol ];
- USHORT nR = (USHORT)(nX + pCol->Width() - 1);
+ sal_uInt16 nR = (sal_uInt16)(nX + pCol->Width() - 1);
// show resize-pointer?
if ( bResizing || ( pCol->GetId() &&
@@ -1564,8 +1564,8 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
// erlaubte breite abholen und neues Delta
nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
long nDeltaX = nDragX - nResizeX;
- USHORT nId = GetColumnId(nResizeCol);
- ULONG nOldWidth = GetColumnWidth(nId);
+ sal_uInt16 nId = GetColumnId(nResizeCol);
+ sal_uLong nOldWidth = GetColumnWidth(nId);
nDragX = QueryColumnResize( GetColumnId(nResizeCol),
nOldWidth + nDeltaX )
+ nResizeX - nOldWidth;
@@ -1603,7 +1603,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
long nMaxX = pDataWin->GetSizePixel().Width();
nDragX = Min( nDragX, nMaxX );
long nDeltaX = nDragX - nResizeX;
- USHORT nId = GetColumnId(nResizeCol);
+ sal_uInt16 nId = GetColumnId(nResizeCol);
SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX );
ColumnResized( nId );
}
@@ -1611,7 +1611,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
// end action
SetPointer( Pointer() );
ReleaseMouse();
- bResizing = FALSE;
+ bResizing = sal_False;
}
else
MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin,
@@ -1623,8 +1623,8 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
//-------------------------------------------------------------------
-BOOL bExtendedMode = FALSE;
-BOOL bFieldMode = FALSE;
+sal_Bool bExtendedMode = sal_False;
+sal_Bool bFieldMode = sal_False;
void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
{
@@ -1639,14 +1639,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( rEvt.GetRow() >= 0 )
{
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE, FALSE );
+ SelectRow( rEvt.GetRow(), sal_True, sal_False );
}
else
{
if ( bColumnCursor && rEvt.GetColumn() != 0 )
{
if ( rEvt.GetColumn() < pCols->size() )
- SelectColumnPos( rEvt.GetColumn(), TRUE, FALSE);
+ SelectColumnPos( rEvt.GetColumn(), sal_True, sal_False);
}
}
DoubleClick( rEvt );
@@ -1658,7 +1658,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( rEvt.GetClicks() == 1 )
{
// initialise flags
- bHit = FALSE;
+ bHit = sal_False;
a1stPoint =
a2ndPoint = PixelToLogic( rEvt.GetPosPixel() );
@@ -1671,7 +1671,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
}
// while selecting, no cursor
- bSelecting = TRUE;
+ bSelecting = sal_True;
DoHideCursor( "MouseButtonDown" );
// DataRow?
@@ -1687,19 +1687,19 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
{
ToggleSelection();
if ( bMultiSelection )
- uRow.pSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(sal_False);
else
uRow.nSel = BROWSER_ENDOFSELECTION;
if ( pColSel )
- pColSel->SelectAll(FALSE);
- bSelect = TRUE;
+ pColSel->SelectAll(sal_False);
+ bSelect = sal_True;
}
// expanding mode?
if ( rEvt.GetMode() & MOUSE_RANGESELECT )
{
// select the further touched rows too
- bSelect = TRUE;
+ bSelect = sal_True;
ExpandRowSelection( rEvt );
return;
}
@@ -1708,7 +1708,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
else if ( IsRowSelected( rEvt.GetRow() ) )
{
// auf Drag&Drop warten
- bHit = TRUE;
+ bHit = sal_True;
bExtendedMode = MOUSE_MULTISELECT ==
( rEvt.GetMode() & MOUSE_MULTISELECT );
return;
@@ -1722,7 +1722,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
SelectRow( rEvt.GetRow(),
!uRow.pSel->IsSelected( rEvt.GetRow() ) );
- bSelect = TRUE;
+ bSelect = sal_True;
return;
}
}
@@ -1730,9 +1730,9 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
// select directly
SetNoSelection();
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
- bSelect = TRUE;
+ bSelect = sal_True;
}
else // Column/Field-Selection
{
@@ -1740,14 +1740,14 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
if ( IsColumnSelected( rEvt.GetColumn() ) ||
IsRowSelected( rEvt.GetRow() ) )
{
- bHit = TRUE;
- bFieldMode = TRUE;
+ bHit = sal_True;
+ bFieldMode = sal_True;
return;
}
SetNoSelection();
GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() );
- bSelect = TRUE;
+ bSelect = sal_True;
}
}
else
@@ -1761,11 +1761,11 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
SelectAll();
}
else
- SelectColumnId( rEvt.GetColumnId(), TRUE, FALSE );
+ SelectColumnId( rEvt.GetColumnId(), sal_True, sal_False );
}
// ggf. Cursor wieder an
- bSelecting = FALSE;
+ bSelecting = sal_False;
DoShowCursor( "MouseButtonDown" );
if ( bSelect )
Select();
@@ -1791,7 +1791,7 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt )
{
aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
if ( bExtendedMode )
- SelectRow( rEvt.GetRow(), FALSE );
+ SelectRow( rEvt.GetRow(), sal_False );
else
{
SetNoSelection();
@@ -1800,19 +1800,19 @@ void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt )
else
{
GoToRow( rEvt.GetRow() );
- SelectRow( rEvt.GetRow(), TRUE );
+ SelectRow( rEvt.GetRow(), sal_True );
}
}
- bSelect = TRUE;
- bExtendedMode = FALSE;
- bFieldMode = FALSE;
- bHit = FALSE;
+ bSelect = sal_True;
+ bExtendedMode = sal_False;
+ bFieldMode = sal_False;
+ bHit = sal_False;
}
// activate cursor
if ( bSelecting )
{
- bSelecting = FALSE;
+ bSelecting = sal_False;
DoShowCursor( "MouseButtonUp" );
if ( bSelect )
Select();
@@ -1829,16 +1829,16 @@ void BrowseBox::KeyInput( const KeyEvent& rEvt )
//-------------------------------------------------------------------
-BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt )
+sal_Bool BrowseBox::ProcessKey( const KeyEvent& rEvt )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
- USHORT nCode = rEvt.GetKeyCode().GetCode();
- BOOL bShift = rEvt.GetKeyCode().IsShift();
- BOOL bCtrl = rEvt.GetKeyCode().IsMod1();
- BOOL bAlt = rEvt.GetKeyCode().IsMod2();
+ sal_uInt16 nCode = rEvt.GetKeyCode().GetCode();
+ sal_Bool bShift = rEvt.GetKeyCode().IsShift();
+ sal_Bool bCtrl = rEvt.GetKeyCode().IsMod1();
+ sal_Bool bAlt = rEvt.GetKeyCode().IsMod2();
- USHORT nId = BROWSER_NONE;
+ sal_uInt16 nId = BROWSER_NONE;
if ( !bAlt && !bCtrl && !bShift )
{
@@ -1900,12 +1900,12 @@ BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt )
//-------------------------------------------------------------------
-void BrowseBox::Dispatch( USHORT nId )
+void BrowseBox::Dispatch( sal_uInt16 nId )
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
switch ( nId )
{
@@ -1916,11 +1916,11 @@ void BrowseBox::Dispatch( USHORT nId )
case BROWSER_CURSORDOWN:
if ( ( GetCurRow() + 1 ) < nRowCount )
- bDone = GoToRow( GetCurRow() + 1, FALSE );
+ bDone = GoToRow( GetCurRow() + 1, sal_False );
break;
case BROWSER_CURSORUP:
if ( GetCurRow() > 0 )
- bDone = GoToRow( GetCurRow() - 1, FALSE );
+ bDone = GoToRow( GetCurRow() - 1, sal_False );
break;
case BROWSER_SELECTHOME:
if ( GetRowCount() )
@@ -1928,7 +1928,7 @@ void BrowseBox::Dispatch( USHORT nId )
DoHideCursor( "BROWSER_SELECTHOME" );
for ( long nRow = GetCurRow(); nRow >= 0; --nRow )
SelectRow( nRow );
- GoToRow( 0, TRUE );
+ GoToRow( 0, sal_True );
DoShowCursor( "BROWSER_SELECTHOME" );
}
break;
@@ -1939,7 +1939,7 @@ void BrowseBox::Dispatch( USHORT nId )
long nRows = GetRowCount();
for ( long nRow = GetCurRow(); nRow < nRows; ++nRow )
SelectRow( nRow );
- GoToRow( GetRowCount() - 1, TRUE );
+ GoToRow( GetRowCount() - 1, sal_True );
DoShowCursor( "BROWSER_SELECTEND" );
}
break;
@@ -1950,12 +1950,12 @@ void BrowseBox::Dispatch( USHORT nId )
// deselect the current row, if it isn't the first
// and there is no other selected row above
long nRow = GetCurRow();
- BOOL bLocalSelect = ( !IsRowSelected( nRow ) ||
+ sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow - 1 ) );
- SelectRow( nRow, bLocalSelect, TRUE );
- bDone = GoToRow( GetCurRow() + 1 , FALSE );
+ SelectRow( nRow, bLocalSelect, sal_True );
+ bDone = GoToRow( GetCurRow() + 1 , sal_False );
if ( bDone )
- SelectRow( GetCurRow(), TRUE, TRUE );
+ SelectRow( GetCurRow(), sal_True, sal_True );
}
else
bDone = ScrollRows( 1 ) != 0;
@@ -1967,40 +1967,40 @@ void BrowseBox::Dispatch( USHORT nId )
// deselect the current row, if it isn't the first
// and there is no other selected row under
long nRow = GetCurRow();
- BOOL bLocalSelect = ( !IsRowSelected( nRow ) ||
+ sal_Bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow + 1 ) );
- SelectRow( nCurRow, bLocalSelect, TRUE );
- bDone = GoToRow( nRow - 1 , FALSE );
+ SelectRow( nCurRow, bLocalSelect, sal_True );
+ bDone = GoToRow( nRow - 1 , sal_False );
if ( bDone )
- SelectRow( GetCurRow(), TRUE, TRUE );
+ SelectRow( GetCurRow(), sal_True, sal_True );
}
break;
case BROWSER_CURSORPAGEDOWN:
- bDone = (BOOL)ScrollRows( nRowsOnPage );
+ bDone = (sal_Bool)ScrollRows( nRowsOnPage );
break;
case BROWSER_CURSORPAGEUP:
- bDone = (BOOL)ScrollRows( -nRowsOnPage );
+ bDone = (sal_Bool)ScrollRows( -nRowsOnPage );
break;
case BROWSER_CURSOREND:
if ( bColumnCursor )
{
- USHORT nNewId = GetColumnId(ColCount() -1);
+ sal_uInt16 nNewId = GetColumnId(ColCount() -1);
bDone = (nNewId != 0) && GoToColumnId( nNewId );
break;
}
case BROWSER_CURSORENDOFFILE:
- bDone = GoToRow( nRowCount - 1, FALSE );
+ bDone = GoToRow( nRowCount - 1, sal_False );
break;
case BROWSER_CURSORRIGHT:
if ( bColumnCursor )
{
- USHORT nNewPos = GetColumnPos( GetCurColumnId() ) + 1;
- USHORT nNewId = GetColumnId( nNewPos );
+ sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) + 1;
+ sal_uInt16 nNewId = GetColumnId( nNewPos );
if (nNewId != 0) // Am Zeilenende ?
bDone = GoToColumnId( nNewId );
else
{
- USHORT nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0);
+ sal_uInt16 nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0);
if ( GetRowCount() )
bDone = ( nCurRow < GetRowCount() - 1 ) && GoToRowColumnId( nCurRow + 1, nColId );
else if ( ColCount() )
@@ -2013,18 +2013,18 @@ void BrowseBox::Dispatch( USHORT nId )
case BROWSER_CURSORHOME:
if ( bColumnCursor )
{
- USHORT nNewId = GetColumnId(1);
+ sal_uInt16 nNewId = GetColumnId(1);
bDone = (nNewId != 0) && GoToColumnId( nNewId );
break;
}
case BROWSER_CURSORTOPOFFILE:
- bDone = GoToRow( 0, FALSE );
+ bDone = GoToRow( 0, sal_False );
break;
case BROWSER_CURSORLEFT:
if ( bColumnCursor )
{
- USHORT nNewPos = GetColumnPos( GetCurColumnId() ) - 1;
- USHORT nNewId = GetColumnId( nNewPos );
+ sal_uInt16 nNewPos = GetColumnPos( GetCurColumnId() ) - 1;
+ sal_uInt16 nNewId = GetColumnId( nNewPos );
if (nNewId != 0)
bDone = GoToColumnId( nNewId );
else
@@ -2040,13 +2040,13 @@ void BrowseBox::Dispatch( USHORT nId )
break;
case BROWSER_ENHANCESELECTION:
if ( GetRowCount() )
- SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), TRUE );
- bDone = TRUE;
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_True );
+ bDone = sal_True;
break;
case BROWSER_SELECT:
if ( GetRowCount() )
- SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), FALSE );
- bDone = TRUE;
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), sal_False );
+ bDone = sal_True;
break;
case BROWSER_MOVECOLUMNLEFT:
case BROWSER_MOVECOLUMNRIGHT:
@@ -2054,20 +2054,20 @@ void BrowseBox::Dispatch( USHORT nId )
BrowserHeader* pHeaderBar = getDataWindow()->pHeaderBar;
if ( pHeaderBar && pHeaderBar->IsDragable() )
{
- USHORT nColId = GetCurColumnId();
- BOOL bColumnSelected = IsColumnSelected(nColId);
- USHORT nNewPos = GetColumnPos(nColId);
- BOOL bMoveAllowed = FALSE;
+ sal_uInt16 nColId = GetCurColumnId();
+ sal_Bool bColumnSelected = IsColumnSelected(nColId);
+ sal_uInt16 nNewPos = GetColumnPos(nColId);
+ sal_Bool bMoveAllowed = sal_False;
if ( BROWSER_MOVECOLUMNLEFT == nId && nNewPos > 1 )
- --nNewPos,bMoveAllowed = TRUE;
+ --nNewPos,bMoveAllowed = sal_True;
else if ( BROWSER_MOVECOLUMNRIGHT == nId && nNewPos < (ColCount()-1) )
- ++nNewPos,bMoveAllowed = TRUE;
+ ++nNewPos,bMoveAllowed = sal_True;
if ( bMoveAllowed )
{
SetColumnPos( nColId, nNewPos );
ColumnMoved( nColId );
- MakeFieldVisible(GetCurRow(),nColId,TRUE);
+ MakeFieldVisible(GetCurRow(),nColId,sal_True);
if ( bColumnSelected )
SelectColumnId(nColId);
}
@@ -2098,7 +2098,7 @@ void BrowseBox::SetCursorColor(const Color& _rCol)
DoShowCursor("SetCursorColor");
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
+Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
{
Window* pParent = NULL;
if ( !_bOnScreen )
@@ -2122,14 +2122,14 @@ Rectangle BrowseBox::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
return Rectangle(aTopLeft,Size(nWidth,nHeight));
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen)
+Rectangle BrowseBox::calcTableRect(sal_Bool _bOnScreen)
{
Window* pParent = NULL;
if ( !_bOnScreen )
pParent = GetAccessibleParentWindow();
Rectangle aRect( GetWindowExtentsRelative( pParent ) );
- Rectangle aRowBar = calcHeaderRect(FALSE,pParent == NULL);
+ Rectangle aRowBar = calcHeaderRect(sal_False,pParent == NULL);
long nX = aRowBar.Right() - aRect.Left();
long nY = aRowBar.Top() - aRect.Top();
@@ -2138,7 +2138,7 @@ Rectangle BrowseBox::calcTableRect(BOOL _bOnScreen)
return Rectangle(aRowBar.TopRight(), Size(aSize.A() - nX, aSize.B() - nY - aHScroll.GetSizePixel().Height()) );
}
// -----------------------------------------------------------------------------
-Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, BOOL /*_bIsHeader*/, BOOL _bOnScreen )
+Rectangle BrowseBox::GetFieldRectPixelAbs( sal_Int32 _nRowId,sal_uInt16 _nColId, sal_Bool /*_bIsHeader*/, sal_Bool _bOnScreen )
{
Window* pParent = NULL;
if ( !_bOnScreen )
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index 50634845a55f..929aa3303a77 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -173,7 +173,7 @@ sal_Int32 BrowseBox::GetAccessibleControlCount() const
Reference< XAccessible > BrowseBox::CreateAccessibleControl( sal_Int32 )
{
- DBG_ASSERT( FALSE, "BrowseBox::CreateAccessibleControl: to be overwritten!" );
+ DBG_ASSERT( sal_False, "BrowseBox::CreateAccessibleControl: to be overwritten!" );
return NULL;
}
// -----------------------------------------------------------------------------
@@ -193,7 +193,7 @@ sal_Bool BrowseBox::ConvertPointToCellAddress(
sal_Bool BrowseBox::ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint )
{
rnRow = GetRowAtYPosPixel(rPoint.Y());
- // USHORT nColumnId = GetColumnAtXPosPixel(rPoint.X());
+ // sal_uInt16 nColumnId = GetColumnAtXPosPixel(rPoint.X());
return rnRow != BROWSER_INVALIDID;// && nColumnId == 0;
}
// -----------------------------------------------------------------------------
@@ -398,7 +398,7 @@ void BrowseBox::GrabTableFocus()
GrabFocus();
}
// -----------------------------------------------------------------------------
-String BrowseBox::GetCellText(long, USHORT ) const
+String BrowseBox::GetCellText(long, sal_uInt16 ) const
{
DBG_ASSERT(0,"This method has to be implemented by the derived classes! BUG!!");
return String();
@@ -460,7 +460,7 @@ sal_Bool BrowseBox::IsCellFocusable() const
return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+sal_Bool BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
{
return GoToRowColumnId( _nRow, GetColumnId( _nColumn ) );
}
@@ -532,13 +532,13 @@ sal_Bool BrowseBox::IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) con
return IsFieldVisible( _nRow, GetColumnId( _nColumnPos ) );
}
// -----------------------------------------------------------------------------
-String BrowseBox::GetAccessibleCellText(long _nRow, USHORT _nColPos) const
+String BrowseBox::GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const
{
return GetCellText( _nRow, GetColumnId( _nColPos ) );
}
// -----------------------------------------------------------------------------
-BOOL BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
+sal_Bool BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
{
return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector );
}
@@ -553,7 +553,7 @@ void BrowseBox::GrabFocus()
Control::GrabFocus();
}
// -----------------------------------------------------------------------------
-Reference< XAccessible > BrowseBox::GetAccessible( BOOL bCreate )
+Reference< XAccessible > BrowseBox::GetAccessible( sal_Bool bCreate )
{
return Control::GetAccessible( bCreate );
}
diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx
index d1fcaec5e9be..a0a0f01f8251 100644
--- a/svtools/source/brwbox/brwhead.cxx
+++ b/svtools/source/brwbox/brwhead.cxx
@@ -77,7 +77,7 @@ void BrowserHeader::EndDrag()
Update();
// not aborted?
- USHORT nId = GetCurItemId();
+ sal_uInt16 nId = GetCurItemId();
if ( nId )
{
// Handle-Column?
@@ -96,7 +96,7 @@ void BrowserHeader::EndDrag()
// column drag
// Hat sich die Position eigentlich veraendert
// Handlecolumn beruecksichtigen
- USHORT nOldPos = _pBrowseBox->GetColumnPos(nId),
+ sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId),
nNewPos = GetItemPos( nId );
if (!_pBrowseBox->GetColumnId(0)) // Handle
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index be3ae263d34f..f944908c269d 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -57,7 +57,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
{
Window *pWin = (Window*) &rDev;
if( bPressed )
- pWin->DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE );
+ pWin->DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False );
}
else
{
@@ -74,10 +74,10 @@ void ButtonFrame::Draw( OutputDevice& rDev )
String aVal = rDev.GetEllipsisString(aText,aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH);
Font aFont( rDev.GetFont() );
- BOOL bOldTransp = aFont.IsTransparent();
+ sal_Bool bOldTransp = aFont.IsTransparent();
if ( !bOldTransp )
{
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
rDev.SetFont( aFont );
}
@@ -92,7 +92,7 @@ void ButtonFrame::Draw( OutputDevice& rDev )
// restore settings
if ( !bOldTransp )
{
- aFont.SetTransparent(FALSE);
+ aFont.SetTransparent(sal_False);
rDev.SetFont( aFont );
}
if (m_bDrawDisabled)
@@ -113,14 +113,14 @@ void ButtonFrame::Draw( OutputDevice& rDev )
//-------------------------------------------------------------------
-BrowserColumn::BrowserColumn( USHORT nItemId, const class Image &rImage,
- const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+BrowserColumn::BrowserColumn( sal_uInt16 nItemId, const class Image &rImage,
+ const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom,
HeaderBarItemBits nFlags )
: _nId( nItemId ),
_nWidth( nWidthPixel ),
_aImage( rImage ),
_aTitle( rTitle ),
- _bFrozen( FALSE ),
+ _bFrozen( sal_False ),
_nFlags( nFlags )
{
double n = (double)_nWidth;
@@ -135,7 +135,7 @@ BrowserColumn::~BrowserColumn()
//-------------------------------------------------------------------
-void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom)
+void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom)
{
_nWidth = nNewWidthPixel;
double n = (double)_nWidth;
@@ -146,13 +146,13 @@ void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom)
//-------------------------------------------------------------------
-void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, BOOL bCurs )
+void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, sal_Bool bCurs )
{
if ( _nId == 0 )
{
// paint handle column
ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ),
- String(), FALSE, bCurs,
+ String(), sal_False, bCurs,
0 != (BROWSER_COLUMN_TITLEABBREVATION&_nFlags) ).Draw( rDev );
Color aOldLineColor = rDev.GetLineColor();
rDev.SetLineColor( Color( COL_BLACK ) );
@@ -206,18 +206,18 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
,pEventWin( pParent )
,pCornerWin( 0 )
,pDtorNotify( 0 )
- ,bInPaint( FALSE )
- ,bInCommand( FALSE )
- ,bNoScrollBack( FALSE )
- ,bNoHScroll( FALSE )
- ,bNoVScroll( FALSE )
- ,bUpdateMode( TRUE )
- ,bResizeOnPaint( FALSE )
- ,bUpdateOnUnlock( FALSE )
- ,bInUpdateScrollbars( FALSE )
- ,bHadRecursion( FALSE )
- ,bOwnDataChangedHdl( FALSE )
- ,bCallingDropCallback( FALSE )
+ ,bInPaint( sal_False )
+ ,bInCommand( sal_False )
+ ,bNoScrollBack( sal_False )
+ ,bNoHScroll( sal_False )
+ ,bNoVScroll( sal_False )
+ ,bUpdateMode( sal_True )
+ ,bResizeOnPaint( sal_False )
+ ,bUpdateOnUnlock( sal_False )
+ ,bInUpdateScrollbars( sal_False )
+ ,bHadRecursion( sal_False )
+ ,bOwnDataChangedHdl( sal_False )
+ ,bCallingDropCallback( sal_False )
,nUpdateLock( 0 )
,nCursorHidden( 0 )
,m_nDragRowDividerLimit( 0 )
@@ -231,7 +231,7 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
BrowserDataWin::~BrowserDataWin()
{
if( pDtorNotify )
- *pDtorNotify = TRUE;
+ *pDtorNotify = sal_True;
for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i )
delete aInvalidRegion[ i ];
@@ -247,14 +247,14 @@ void BrowserDataWin::LeaveUpdateLock()
if (bUpdateOnUnlock )
{
Control::Update();
- bUpdateOnUnlock = FALSE;
+ bUpdateOnUnlock = sal_False;
}
}
}
//-------------------------------------------------------------------
void InitSettings_Impl( Window *pWin,
- BOOL bFont, BOOL bForeground, BOOL bBackground )
+ sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings =
pWin->GetSettings().GetStyleSettings();
@@ -290,7 +290,7 @@ void BrowserDataWin::Update()
if ( !nUpdateLock )
Control::Update();
else
- bUpdateOnUnlock = TRUE;
+ bUpdateOnUnlock = sal_True;
}
//-------------------------------------------------------------------
@@ -301,9 +301,9 @@ void BrowserDataWin::DataChanged( const DataChangedEvent& rDCEvt )
{
if( !bOwnDataChangedHdl )
{
- InitSettings_Impl( this, TRUE, TRUE, TRUE );
+ InitSettings_Impl( this, sal_True, sal_True, sal_True );
Invalidate();
- InitSettings_Impl( GetParent(), TRUE, TRUE, TRUE );
+ InitSettings_Impl( GetParent(), sal_True, sal_True, sal_True );
GetParent()->Invalidate();
GetParent()->Resize();
}
@@ -322,9 +322,9 @@ void BrowserDataWin::Paint( const Rectangle& rRect )
aInvalidRegion.push_back( new Rectangle( rRect ) );
return;
}
- bInPaint = TRUE;
+ bInPaint = sal_True;
( (BrowseBox*) GetParent() )->PaintData( *this, rRect );
- bInPaint = FALSE;
+ bInPaint = sal_False;
DoOutstandingInvalidations();
}
else
@@ -356,7 +356,7 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
if ( nMouseX < nColX )
break;
}
- USHORT nColId = BROWSER_INVALIDID;
+ sal_uInt16 nColId = BROWSER_INVALIDID;
if ( nCol < pBox->pCols->size() )
nColId = (*pBox->pCols)[ nCol ]->GetId();
@@ -418,14 +418,14 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
return;
Point aEventPos( rEvt.GetMousePosPixel() );
- long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), FALSE);
+ long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), sal_False);
MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
{
- BOOL bDeleted = FALSE;
+ sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
- bInCommand = TRUE;
+ bInCommand = sal_True;
MouseButtonDown( aMouseEvt );
if( bDeleted )
return;
@@ -433,20 +433,20 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = FALSE;
+ bInCommand = sal_False;
}
aEventPos.Y() += GetParent()->GetTitleHeight();
CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
rEvt.IsMouseEvent(), rEvt.GetData() );
- bInCommand = TRUE;
- BOOL bDeleted = FALSE;
+ bInCommand = sal_True;
+ sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
GetParent()->Command( aEvt );
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = FALSE;
+ bInCommand = sal_False;
if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
MouseButtonUp( aMouseEvt );
@@ -456,7 +456,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
//-------------------------------------------------------------------
-BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
+sal_Bool BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
{
if ( ! ( GetParent()->IsInteractiveRowHeightEnabled()
&& ( _rEvent.GetRow() >= 0 )
@@ -464,7 +464,7 @@ BOOL BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
&& ( _rEvent.GetColumnId() == 0 )
)
)
- return FALSE;
+ return sal_False;
long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
return ( nDividerDistance <= 4 );
@@ -564,7 +564,7 @@ void BrowserDataWin::StartRowDividerDrag( const Point& _rStartPos )
m_nDragRowDividerLimit = nDragRowDividerCurrentPos - nDataRowHeight;
- GetParent()->bRowDividerDrag = TRUE;
+ GetParent()->bRowDividerDrag = sal_True;
GetParent()->ImplStartTracking();
Rectangle aDragSplitRect( 0, m_nDragRowDividerLimit, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos );
@@ -588,7 +588,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
HideTracking();
- GetParent()->bRowDividerDrag = FALSE;
+ GetParent()->bRowDividerDrag = sal_False;
GetParent()->ImplEndTracking();
if ( !rTEvt.IsTrackingCanceled() )
@@ -639,7 +639,7 @@ void BrowserDataWin::RequestHelp( const HelpEvent& rHEvt )
//===================================================================
BrowseEvent::BrowseEvent( Window* pWindow,
- long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect ):
pWin(pWindow),
nRow(nAbsRow),
@@ -660,7 +660,7 @@ BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin *pWindow,
//-------------------------------------------------------------------
BrowserMouseEvent::BrowserMouseEvent( Window *pWindow, const MouseEvent& rEvt,
- long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect ):
MouseEvent(rEvt),
BrowseEvent( pWindow, nAbsRow, nColumn, nColumnId, rRect )
@@ -687,7 +687,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const
//-------------------------------------------------------------------
-void BrowserDataWin::SetUpdateMode( BOOL bMode )
+void BrowserDataWin::SetUpdateMode( sal_Bool bMode )
{
DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" );
if ( bMode == bUpdateMode )
@@ -710,7 +710,7 @@ void BrowserDataWin::DoOutstandingInvalidations()
//-------------------------------------------------------------------
-void BrowserDataWin::Invalidate( USHORT nFlags )
+void BrowserDataWin::Invalidate( sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
{
@@ -725,7 +725,7 @@ void BrowserDataWin::Invalidate( USHORT nFlags )
//-------------------------------------------------------------------
-void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags )
+void BrowserDataWin::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
if ( !GetUpdateMode() )
aInvalidRegion.push_back( new Rectangle( rRect ) );
@@ -737,20 +737,21 @@ void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags )
void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt )
{
- ULONG nPos = GetThumbPos();
+ sal_uLong nPos = GetThumbPos();
if ( nPos != _nLastPos )
{
- if ( _nTip )
- Help::HideTip( _nTip );
-
String aTip( String::CreateFromInt32(nPos) );
aTip += '/';
if ( _pDataWin->GetRealRowCount().Len() )
aTip += _pDataWin->GetRealRowCount();
else
aTip += String::CreateFromInt32(GetRangeMax());
+
Rectangle aRect( GetPointerPosPixel(), Size( GetTextHeight(), GetTextWidth( aTip ) ) );
- _nTip = Help::ShowTip( this, aRect, aTip );
+ if ( _nTip )
+ Help::UpdateTip( _nTip, this, aRect, aTip );
+ else
+ _nTip = Help::ShowTip( this, aRect, aTip );
_nLastPos = nPos;
}
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index d32dbd69a4bf..1aeb06b6a085 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -50,18 +50,18 @@ class ButtonFrame
Rectangle aRect;
Rectangle aInnerRect;
String aText;
- BOOL bPressed;
- BOOL bCurs;
- BOOL bAbbr;
- BOOL m_bDrawDisabled;
+ sal_Bool bPressed;
+ sal_Bool bCurs;
+ sal_Bool bAbbr;
+ sal_Bool m_bDrawDisabled;
public:
ButtonFrame( const Point& rPt, const Size& rSz,
const String &rText,
- BOOL bPress = FALSE,
- BOOL bCursor = FALSE,
- BOOL bAbbreviate = TRUE,
- BOOL _bDrawDisabled = FALSE)
+ sal_Bool bPress = sal_False,
+ sal_Bool bCursor = sal_False,
+ sal_Bool bAbbreviate = sal_True,
+ sal_Bool _bDrawDisabled = sal_False)
:aRect( rPt, rSz )
,aInnerRect( Point( aRect.Left()+1, aRect.Top()+1 ),
Size( aRect.GetWidth()-2, aRect.GetHeight()-2 ) )
@@ -80,34 +80,34 @@ public:
class BrowserColumn
{
- USHORT _nId;
- ULONG _nOriginalWidth;
- ULONG _nWidth;
+ sal_uInt16 _nId;
+ sal_uLong _nOriginalWidth;
+ sal_uLong _nWidth;
Image _aImage;
String _aTitle;
- BOOL _bFrozen;
+ sal_Bool _bFrozen;
HeaderBarItemBits _nFlags;
public:
- BrowserColumn( USHORT nItemId, const Image &rImage,
- const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+ BrowserColumn( sal_uInt16 nItemId, const Image &rImage,
+ const String& rTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom,
HeaderBarItemBits nFlags );
virtual ~BrowserColumn();
- USHORT GetId() const { return _nId; }
+ sal_uInt16 GetId() const { return _nId; }
- ULONG Width() { return _nWidth; }
+ sal_uLong Width() { return _nWidth; }
Image& GetImage() { return _aImage; }
String& Title() { return _aTitle; }
HeaderBarItemBits& Flags() { return _nFlags; }
- BOOL IsFrozen() const { return _bFrozen; }
- void Freeze( BOOL bFreeze = TRUE ) { _bFrozen = bFreeze; }
+ sal_Bool IsFrozen() const { return _bFrozen; }
+ void Freeze( sal_Bool bFreeze = sal_True ) { _bFrozen = bFreeze; }
virtual void Draw( BrowseBox& rBox, OutputDevice& rDev,
- const Point& rPos, BOOL bCurs );
+ const Point& rPos, sal_Bool bCurs );
- void SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom);
+ void SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom);
void ZoomChanged(const Fraction& rNewZoom);
};
@@ -122,7 +122,7 @@ public:
BrowserHeader* pHeaderBar; // only for BROWSER_HEADERBAR_NEW
Window* pEventWin; // Window of forwarded events
ScrollBarBox* pCornerWin; // Window in the corner btw the ScrollBars
- BOOL* pDtorNotify;
+ sal_Bool* pDtorNotify;
AutoTimer aMouseTimer; // recalls MouseMove on dragging out
MouseEvent aRepeatEvt; // a MouseEvent to repeat
Point aLastMousePos; // verhindert pseudo-MouseMoves
@@ -145,7 +145,7 @@ public:
bool bHadRecursion; // Rekursion war aufgetreten
bool bOwnDataChangedHdl; // dont change colors in DataChanged
bool bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently
- USHORT nUpdateLock; // lock count, dont call Control::Update()!
+ sal_uInt16 nUpdateLock; // lock count, dont call Control::Update()!
short nCursorHidden; // new conuter for DoHide/ShowCursor
long m_nDragRowDividerLimit;
@@ -181,20 +181,20 @@ public:
{ return (BrowseBox*) Window::GetParent(); }
const String& GetRealRowCount() const { return aRealRowCount; }
- void SetUpdateMode( BOOL bMode );
+ void SetUpdateMode( sal_Bool bMode );
bool GetUpdateMode() const { return bUpdateMode; }
void EnterUpdateLock() { ++nUpdateLock; }
void LeaveUpdateLock();
void Update();
void DoOutstandingInvalidations();
- void Invalidate( USHORT nFlags = 0 );
- void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 );
- void Invalidate( const Region& rRegion, USHORT nFlags = 0 )
+ void Invalidate( sal_uInt16 nFlags = 0 );
+ void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 )
{ Control::Invalidate( rRegion, nFlags ); }
protected:
void StartRowDividerDrag( const Point& _rStartPos );
- BOOL ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
+ sal_Bool ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent );
};
//-------------------------------------------------------------------
@@ -210,8 +210,8 @@ inline void BrowserDataWin::Repaint()
class BrowserScrollBar: public ScrollBar
{
- ULONG _nTip;
- ULONG _nLastPos;
+ sal_uLong _nTip;
+ sal_uLong _nLastPos;
BrowserDataWin* _pDataWin;
public:
@@ -231,7 +231,7 @@ public:
//===================================================================
void InitSettings_Impl( Window *pWin,
- BOOL bFont = TRUE, BOOL bForeground = TRUE, BOOL bBackground = TRUE );
+ sal_Bool bFont = sal_True, sal_Bool bForeground = sal_True, sal_Bool bBackground = sal_True );
//===================================================================
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 4dbf729de3ae..7b679aed53b2 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -81,7 +81,7 @@ namespace svt
nPos = 0;
if (nPos >= GetEntryCount())
nPos = GetEntryCount() - 1;
- SetText(GetEntry(sal::static_int_cast< USHORT >(nPos)));
+ SetText(GetEntry(sal::static_int_cast< sal_uInt16 >(nPos)));
return 1;
}
}
@@ -188,7 +188,7 @@ namespace svt
nPos = 0;
if (nPos >= GetEntryCount())
nPos = GetEntryCount() - 1;
- SelectEntryPos(sal::static_int_cast< USHORT >(nPos));
+ SelectEntryPos(sal::static_int_cast< sal_uInt16 >(nPos));
Select(); // for calling Modify
return 1;
}
@@ -312,7 +312,7 @@ namespace svt
}
//------------------------------------------------------------------
- void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+ void CheckBoxControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
pBox->Draw(pDev,rPos,rSize,nFlags);
}
@@ -400,7 +400,7 @@ namespace svt
EditCellController::EditCellController( Edit* _pEdit )
:CellController( _pEdit )
,m_pEditImplementation( new EditImplementation( *_pEdit ) )
- ,m_bOwnImplementation( TRUE )
+ ,m_bOwnImplementation( sal_True )
{
}
@@ -408,7 +408,7 @@ namespace svt
EditCellController::EditCellController( MultiLineTextCell* _pEdit )
:CellController( _pEdit )
,m_pEditImplementation( new MultiLineEditImplementation( *_pEdit ) )
- ,m_bOwnImplementation( TRUE )
+ ,m_bOwnImplementation( sal_True )
{
}
@@ -416,7 +416,7 @@ namespace svt
EditCellController::EditCellController( IEditImplementation* _pImplementation )
:CellController( &_pImplementation->GetControl() )
,m_pEditImplementation( _pImplementation )
- ,m_bOwnImplementation( FALSE )
+ ,m_bOwnImplementation( sal_False )
{
}
@@ -553,21 +553,21 @@ namespace svt
//------------------------------------------------------------------
void MultiLineTextCell::Modify()
{
- GetTextEngine()->SetModified( TRUE );
+ GetTextEngine()->SetModified( sal_True );
MultiLineEdit::Modify();
}
//------------------------------------------------------------------
- BOOL MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent )
+ sal_Bool MultiLineTextCell::dispatchKeyEvent( const KeyEvent& _rEvent )
{
Selection aOldSelection( GetSelection() );
- BOOL bWasModified = IsModified();
+ sal_Bool bWasModified = IsModified();
ClearModifyFlag( );
- BOOL bHandled = GetTextView()->KeyInput( _rEvent );
+ sal_Bool bHandled = GetTextView()->KeyInput( _rEvent );
- BOOL bIsModified = IsModified();
+ sal_Bool bIsModified = IsModified();
if ( bWasModified && !bIsModified )
// not sure whether this can really happen
SetModifyFlag();
@@ -580,9 +580,9 @@ namespace svt
if ( aNewSelection != aOldSelection // selection changed
|| bIsModified // or some other modification
)
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//------------------------------------------------------------------
@@ -600,7 +600,7 @@ namespace svt
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
- USHORT nCode = rKeyCode.GetCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
if ( ( nCode == KEY_RETURN ) && ( rKeyCode.GetModifier() == KEY_MOD1 ) )
{
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index ab426a421e6a..dc568cfec7e9 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -610,7 +610,7 @@ namespace svt
{
while ( GetSelectColumnCount( ) )
SelectColumnPos(
- sal::static_int_cast< USHORT >(FirstSelectedColumn()),
+ sal::static_int_cast< sal_uInt16 >(FirstSelectedColumn()),
sal_False );
Select();
}
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx
index 4add5d5a9094..1e30cf6fa9fa 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -43,7 +43,7 @@ namespace svt
using namespace ::com::sun::star::accessibility::AccessibleEventId;
// -----------------------------------------------------------------------------
-Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, USHORT _nColumnPos,const TriState& eState,sal_Bool _bEnabled)
+Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState,sal_Bool _bEnabled)
{
Reference< XAccessible > xAccessible( GetAccessible() );
Reference< XAccessibleContext > xAccContext;
@@ -164,7 +164,7 @@ void EditBrowseBox::DetermineFocus( const sal_uInt16 _nGetFocusFlags )
)
{
long nRows = GetRowCount();
- USHORT nCols = ColCount();
+ sal_uInt16 nCols = ColCount();
if ( ( nRows > 0 ) && ( nCols > 0 ) )
{
@@ -196,7 +196,7 @@ Rectangle EditBrowseBox::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nCol
if ( SeekRow(_nRow) )
{
CellController* pController = GetController(
- _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) );
+ _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) );
if ( pController )
aRect = pController->GetWindow().GetCharacterBounds(_nIndex);
}
@@ -209,7 +209,7 @@ sal_Int32 EditBrowseBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumn
if ( SeekRow(_nRow) )
{
CellController* pController = GetController(
- _nRow, GetColumnId( sal::static_int_cast< USHORT >(_nColumnPos) ) );
+ _nRow, GetColumnId( sal::static_int_cast< sal_uInt16 >(_nColumnPos) ) );
if ( pController )
nRet = pController->GetWindow().GetIndexForPoint(_rPoint);
}
diff --git a/svtools/source/brwbox/makefile.mk b/svtools/source/brwbox/makefile.mk
deleted file mode 100644
index 724a2b530b1f..000000000000
--- a/svtools/source/brwbox/makefile.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=browse
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= editbrowsebox.src
-
-EXCEPTIONSFILES =\
- $(SLO)$/brwbox1.obj \
- $(SLO)$/brwbox2.obj \
- $(SLO)$/brwbox3.obj \
- $(SLO)$/brwhead.obj \
- $(SLO)$/datwin.obj \
- $(SLO)$/ebbcontrols.obj \
- $(SLO)$/editbrowsebox.obj \
- $(SLO)$/editbrowsebox2.obj
-
-SLOFILES= \
- $(EXCEPTIONSFILES)
-
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index cad6edab0ba4..94cfd764a4d4 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -506,14 +506,14 @@ SvtAccessibilityOptions::SvtAccessibilityOptions()
}
++sm_nAccessibilityRefCount;
}
- //StartListening( *sm_pSingleImplConfig, TRUE );
+ //StartListening( *sm_pSingleImplConfig, sal_True );
}
// -----------------------------------------------------------------------
SvtAccessibilityOptions::~SvtAccessibilityOptions()
{
- //EndListening( *sm_pSingleImplConfig, TRUE );
+ //EndListening( *sm_pSingleImplConfig, sal_True );
::osl::MutexGuard aGuard( SingletonMutex::get() );
if( !--sm_nAccessibilityRefCount )
{
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index c4bc11a48fb8..7dc3ef20cfc8 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "apearcfg.hxx"
+#include <svtools/apearcfg.hxx>
#include "com/sun/star/uno/Any.hxx"
#include "tools/debug.hxx"
@@ -51,7 +51,6 @@ sal_Bool SvtTabAppearanceCfg::bInitialized = sal_False;
SvtTabAppearanceCfg::SvtTabAppearanceCfg()
:ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/View")))
- ,nLookNFeel ( DEFAULT_LOOKNFEEL )
,nDragMode ( DEFAULT_DRAGMODE )
,nScaleFactor ( DEFAULT_SCALEFACTOR )
,nSnapMode ( DEFAULT_SNAPMODE )
@@ -59,11 +58,9 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
#if defined( UNX )
,nAAMinPixelHeight ( DEFAULT_AAMINHEIGHT )
#endif
- ,bMenuMouseFollow(FALSE)
- ,bSingleLineTabCtrl(FALSE)
- ,bColoredTabCtrl(FALSE)
+ ,bMenuMouseFollow(sal_False)
#if defined( UNX )
- ,bFontAntialiasing ( TRUE )
+ ,bFontAntialiasing ( sal_True )
#endif
{
RTL_LOGFILE_CONTEXT(aLog, "svtools SvtTabAppearanceCfg::SvtTabAppearanceCfg()");
@@ -82,16 +79,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
switch(nProp)
{
case 0: *pValues >>= nScaleFactor; break; //"FontScaling",
- case 1: *pValues >>= nLookNFeel; break; //"LookAndFeel",
- case 2: *pValues >>= nDragMode; break; //"Window/Drag",
- case 3: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
- case 4: bSingleLineTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/SingleLineTab",
- case 5: bColoredTabCtrl = *(sal_Bool*)pValues->getValue(); break; //"Dialog/ColoredTab",
- case 6: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: *pValues >>= nDragMode; break; //"Window/Drag",
+ case 2: bMenuMouseFollow = *(sal_Bool*)pValues->getValue(); break; //"Menu/FollowMouse",
+ case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: *pValues >>= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX )
- case 8: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
- case 9: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: bFontAntialiasing = *(sal_Bool*)pValues->getValue(); break; // "FontAntialising/Enabled",
+ case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -111,16 +105,13 @@ const Sequence<OUString>& SvtTabAppearanceCfg::GetPropertyNames()
static const sal_Char* aPropNames[] =
{
"FontScaling" // 0
- ,"LookAndFeel" // 1
- ,"Window/Drag" // 2
- ,"Menu/FollowMouse" // 3
- ,"Dialog/SingleLineTab" // 4
- ,"Dialog/ColoredTab" // 5
- ,"Dialog/MousePositioning" // 6
- ,"Dialog/MiddleMouseButton" // 7
+ ,"Window/Drag" // 1
+ ,"Menu/FollowMouse" // 2
+ ,"Dialog/MousePositioning" // 3
+ ,"Dialog/MiddleMouseButton" // 4
#if defined( UNX )
- ,"FontAntiAliasing/Enabled" // 8
- ,"FontAntiAliasing/MinPixelHeight" // 9
+ ,"FontAntiAliasing/Enabled" // 5
+ ,"FontAntiAliasing/MinPixelHeight" // 6
#endif
};
const int nCount = SAL_N_ELEMENTS( aPropNames );
@@ -146,16 +137,13 @@ void SvtTabAppearanceCfg::Commit()
switch(nProp)
{
case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling",
- case 1: pValues[nProp] <<= nLookNFeel; break; //"LookAndFeel",
- case 2: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
- case 3: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
- case 4: pValues[nProp].setValue(&bSingleLineTabCtrl, rType); break; //"Dialog/SingleLineTab",
- case 5: pValues[nProp].setValue(&bColoredTabCtrl, rType); break; //"Dialog/ColoredTab",
- case 6: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
- case 7: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
+ case 1: pValues[nProp] <<= nDragMode; break; //"Window/Drag",
+ case 2: pValues[nProp].setValue(&bMenuMouseFollow, rType); break; //"Menu/FollowMouse",
+ case 3: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning",
+ case 4: pValues[nProp] <<= nMiddleMouse; break; //"Dialog/MiddleMouseButton",
#if defined( UNX )
- case 8: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
- case 9: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
+ case 5: pValues[nProp].setValue(&bFontAntialiasing, rType); break; // "FontAntialising/Enabled",
+ case 6: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif
}
}
@@ -166,31 +154,25 @@ void SvtTabAppearanceCfg::Notify( const com::sun::star::uno::Sequence< rtl::OUSt
{
}
-void SvtTabAppearanceCfg::SetLookNFeel ( USHORT nSet )
-{
- nLookNFeel = nSet;
- SetModified();
-}
-
-void SvtTabAppearanceCfg::SetDragMode ( USHORT nSet )
+void SvtTabAppearanceCfg::SetDragMode ( sal_uInt16 nSet )
{
nDragMode = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetScaleFactor ( USHORT nSet )
+void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet )
{
nScaleFactor = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetSnapMode ( USHORT nSet )
+void SvtTabAppearanceCfg::SetSnapMode ( sal_uInt16 nSet )
{
nSnapMode = nSet;
SetModified();
}
-void SvtTabAppearanceCfg::SetMiddleMouseButton ( USHORT nSet )
+void SvtTabAppearanceCfg::SetMiddleMouseButton ( sal_uInt16 nSet )
{
nMiddleMouse = nSet;
SetModified();
@@ -205,27 +187,8 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// SetStandard...Styles() resets the UseSystemUIFonts flag,
// but we don't want to change it now, so save the flag before ...
- BOOL bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts();
-
- switch ( nLookNFeel )
- {
- case LookMotif:
- hAppStyle.SetStandardUnixStyles(); break;
-
- case LookOSTwo:
- hAppStyle.SetStandardOS2Styles(); break;
-
- case LookMacintosh:
- hAppStyle.SetStandardMacStyles(); break;
-
- case LookWindows:
- hAppStyle.SetStandardWinStyles(); break;
-
- case LookStardivision:
- default:
- hAppStyle.SetStandardStyles(); break;
- }
-
+ sal_Bool bUseSystemUIFonts = hAppStyle.GetUseSystemUIFonts();
+ hAppStyle.SetStandardStyles();
// and set it here
hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts );
@@ -243,7 +206,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// Mouse Snap
MouseSettings hMouseSettings = hAppSettings.GetMouseSettings();
- ULONG nMouseOptions = hMouseSettings.GetOptions();
+ sal_uLong nMouseOptions = hMouseSettings.GetOptions();
nMouseOptions &= ! (MOUSE_OPTION_AUTOCENTERPOS | MOUSE_OPTION_AUTODEFBTNPOS);
@@ -264,20 +227,12 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// Merge and Publish Settings
- ULONG nFollow = hMouseSettings.GetFollow();
+ sal_uLong nFollow = hMouseSettings.GetFollow();
if(bMenuMouseFollow)
nFollow |= MOUSE_FOLLOW_MENU;
else
nFollow &= ~MOUSE_FOLLOW_MENU;
hMouseSettings.SetFollow( nFollow );
- sal_uInt16 nTabStyle = 0;
- if(bSingleLineTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_SINGLELINE;
-
- if(bColoredTabCtrl)
- nTabStyle |= STYLE_TABCONTROL_COLOR;
- hAppStyle.SetTabControlStyle(nTabStyle);
-
hAppSettings.SetMouseSettings( hMouseSettings );
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index def2f621a56e..ebefe664dd18 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -514,7 +514,7 @@ ColorConfigValue ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS
if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor))
aRet.nColor = ColorConfig::GetDefaultColor(eEntry).GetColor();
//#103495# don't allow grey between 40% and 60% as application background
- const UINT8 nRed = COLORDATA_RED( aRet.nColor);
+ const sal_uInt8 nRed = COLORDATA_RED( aRet.nColor);
if(eEntry == APPBACKGROUND &&
(nRed == COLORDATA_GREEN( aRet.nColor)) &&
(nRed == COLORDATA_BLUE( aRet.nColor)) &&
@@ -531,12 +531,12 @@ EditableColorConfig::EditableColorConfig() :
m_pImpl(new ColorConfig_Impl),
m_bModified(sal_False)
{
- m_pImpl->BlockBroadcasts(TRUE);
+ m_pImpl->BlockBroadcasts(sal_True);
}
EditableColorConfig::~EditableColorConfig()
{
- m_pImpl->BlockBroadcasts(FALSE);
+ m_pImpl->BlockBroadcasts(sal_False);
if(m_bModified)
m_pImpl->SetModified();
if(m_pImpl->IsModified())
@@ -614,12 +614,12 @@ void EditableColorConfig::Commit()
// -----------------------------------------------------------------------------
void EditableColorConfig::DisableBroadcast()
{
- m_pImpl->BlockBroadcasts(TRUE);
+ m_pImpl->BlockBroadcasts(sal_True);
}
// -----------------------------------------------------------------------------
void EditableColorConfig::EnableBroadcast()
{
- m_pImpl->BlockBroadcasts(FALSE);
+ m_pImpl->BlockBroadcasts(sal_False);
}
// -----------------------------------------------------------------------------
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 42554b327448..59bb82aa2c56 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "extcolorcfg.hxx"
+#include <svtools/extcolorcfg.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/Locale.hpp>
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index 0412049e5dea..95dce21ddd45 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "fontsubstconfig.hxx"
+#include <svtools/fontsubstconfig.hxx>
#include <svl/svarray.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Any.hxx>
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 8647d7e5ad54..c3d5526a41fa 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -291,14 +291,14 @@ void SvxHtmlOptions::Notify( const com::sun::star::uno::Sequence< rtl::OUString
}
// -----------------------------------------------------------------------
-USHORT SvxHtmlOptions::GetFontSize(USHORT nPos) const
+sal_uInt16 SvxHtmlOptions::GetFontSize(sal_uInt16 nPos) const
{
if(nPos < HTML_FONT_COUNT)
- return (USHORT)pImp->aFontSizeArr[nPos];
+ return (sal_uInt16)pImp->aFontSizeArr[nPos];
return 0;
}
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize)
+void SvxHtmlOptions::SetFontSize(sal_uInt16 nPos, sal_uInt16 nSize)
{
if(nPos < HTML_FONT_COUNT)
{
@@ -312,7 +312,7 @@ void SvxHtmlOptions::SetFontSize(USHORT nPos, USHORT nSize)
// -----------------------------------------------------------------------
-BOOL SvxHtmlOptions::IsImportUnknown() const
+sal_Bool SvxHtmlOptions::IsImportUnknown() const
{
return 0 != (pImp->nFlags & HTMLCFG_UNKNOWN_TAGS) ;
}
@@ -320,7 +320,7 @@ BOOL SvxHtmlOptions::IsImportUnknown() const
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetImportUnknown(BOOL bSet)
+void SvxHtmlOptions::SetImportUnknown(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS;
@@ -332,15 +332,15 @@ void SvxHtmlOptions::SetImportUnknown(BOOL bSet)
// -----------------------------------------------------------------------
-USHORT SvxHtmlOptions::GetExportMode() const
+sal_uInt16 SvxHtmlOptions::GetExportMode() const
{
- return (USHORT)pImp->nExportMode;
+ return (sal_uInt16)pImp->nExportMode;
}
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetExportMode(USHORT nSet)
+void SvxHtmlOptions::SetExportMode(sal_uInt16 nSet)
{
if(nSet <= HTML_CFG_MAX )
{
@@ -353,7 +353,7 @@ void SvxHtmlOptions::SetExportMode(USHORT nSet)
// -----------------------------------------------------------------------
-BOOL SvxHtmlOptions::IsStarBasic() const
+sal_Bool SvxHtmlOptions::IsStarBasic() const
{
return 0 != (pImp->nFlags & HTMLCFG_STAR_BASIC) ;
}
@@ -361,7 +361,7 @@ BOOL SvxHtmlOptions::IsStarBasic() const
// -----------------------------------------------------------------------
-void SvxHtmlOptions::SetStarBasic(BOOL bSet)
+void SvxHtmlOptions::SetStarBasic(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_STAR_BASIC;
@@ -370,12 +370,12 @@ void SvxHtmlOptions::SetStarBasic(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsSaveGraphicsLocal() const
+sal_Bool SvxHtmlOptions::IsSaveGraphicsLocal() const
{
return 0 != (pImp->nFlags & HTMLCFG_LOCAL_GRF) ;
}
-void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet)
+void SvxHtmlOptions::SetSaveGraphicsLocal(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_LOCAL_GRF;
@@ -384,9 +384,9 @@ void SvxHtmlOptions::SetSaveGraphicsLocal(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsPrintLayoutExtension() const
+sal_Bool SvxHtmlOptions::IsPrintLayoutExtension() const
{
- BOOL bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION);
+ sal_Bool bRet = 0 != (pImp->nFlags & HTMLCFG_PRINT_LAYOUT_EXTENSION);
switch( pImp->nExportMode )
{
case HTML_CFG_MSIE_40:
@@ -394,12 +394,12 @@ BOOL SvxHtmlOptions::IsPrintLayoutExtension() const
case HTML_CFG_WRITER :
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
-void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet)
+void SvxHtmlOptions::SetPrintLayoutExtension(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_PRINT_LAYOUT_EXTENSION;
@@ -408,12 +408,12 @@ void SvxHtmlOptions::SetPrintLayoutExtension(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsIgnoreFontFamily() const
+sal_Bool SvxHtmlOptions::IsIgnoreFontFamily() const
{
return 0 != (pImp->nFlags & HTMLCFG_IGNORE_FONT_FAMILY) ;
}
-void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet)
+void SvxHtmlOptions::SetIgnoreFontFamily(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY;
@@ -422,12 +422,12 @@ void SvxHtmlOptions::SetIgnoreFontFamily(BOOL bSet)
SetModified();
}
-BOOL SvxHtmlOptions::IsStarBasicWarning() const
+sal_Bool SvxHtmlOptions::IsStarBasicWarning() const
{
return 0 != (pImp->nFlags & HTMLCFG_IS_BASIC_WARNING) ;
}
-void SvxHtmlOptions::SetStarBasicWarning(BOOL bSet)
+void SvxHtmlOptions::SetStarBasicWarning(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_IS_BASIC_WARNING;
@@ -465,12 +465,12 @@ SvxHtmlOptions* SvxHtmlOptions::Get()
return pOptions;
}
-BOOL SvxHtmlOptions::IsNumbersEnglishUS() const
+sal_Bool SvxHtmlOptions::IsNumbersEnglishUS() const
{
return 0 != (pImp->nFlags & HTMLCFG_NUMBERS_ENGLISH_US) ;
}
-void SvxHtmlOptions::SetNumbersEnglishUS(BOOL bSet)
+void SvxHtmlOptions::SetNumbersEnglishUS(sal_Bool bSet)
{
if(bSet)
pImp->nFlags |= HTMLCFG_NUMBERS_ENGLISH_US;
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 227c50b2bc10..7f57664af5f1 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -37,10 +37,10 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <svtools/accessibilityoptions.hxx>
-#include <apearcfg.hxx>
+#include <svtools/apearcfg.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/colorcfg.hxx>
-#include <fontsubstconfig.hxx>
+#include <svtools/fontsubstconfig.hxx>
#include <svtools/helpopt.hxx>
#include <svtools/printoptions.hxx>
#include <unotools/options.hxx>
diff --git a/svtools/source/config/makefile.mk b/svtools/source/config/makefile.mk
deleted file mode 100644
index d3ba43de68ef..000000000000
--- a/svtools/source/config/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=config
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/accessibilityoptions.obj \
- $(SLO)$/apearcfg.obj \
- $(SLO)$/colorcfg.obj \
- $(SLO)$/extcolorcfg.obj \
- $(SLO)$/fontsubstconfig.obj \
- $(SLO)$/helpopt.obj \
- $(SLO)$/htmlcfg.obj \
- $(SLO)$/itemholder2.obj \
- $(SLO)$/menuoptions.obj \
- $(SLO)$/miscopt.obj \
- $(SLO)$/optionsdrawinglayer.obj \
- $(SLO)$/printoptions.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index 27ae8a346f3d..4abb7ba102df 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -313,9 +313,16 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
// We need values from ALL notified configuration keys.
DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
- sal_Bool bMenuIcons = true;
- sal_Bool bSystemMenuIcons = true;
- sal_Bool bMenuSettingsChanged = false;
+ sal_Bool bMenuSettingsChanged = sal_False;
+ sal_Bool bMenuIcons = sal_True;
+ sal_Bool bSystemMenuIcons = sal_True;
+ if (m_nMenuIcons == 2)
+ bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ else
+ {
+ bSystemMenuIcons = sal_False;
+ bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
+ }
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
sal_Int32 nCount = seqPropertyNames.getLength();
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 2fdb136e91b4..b16d383ad277 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -45,7 +45,7 @@
#include <rtl/logfile.hxx>
#include "itemholder2.hxx"
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <vcl/svapp.hxx>
#include <list>
@@ -93,7 +93,7 @@ using namespace ::com::sun::star;
#define PROPERTYCOUNT 11
-#define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx>
+#define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx>
//_________________________________________________________________________________________________________________
// private declarations!
@@ -889,7 +889,7 @@ sal_Int16 SvtMiscOptions::GetCurrentSymbolsSize() const
{
// Use system settings, we have to retrieve the toolbar icon size from the
// Application class
- ULONG nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize();
+ sal_uLong nStyleIconSize = Application::GetSettings().GetStyleSettings().GetToolbarIconSize();
if ( nStyleIconSize == STYLE_TOOLBAR_ICONSIZE_LARGE )
eOptSymbolsSize = SFX_SYMBOLS_SIZE_LARGE;
else
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index f76104c132c8..7f86d995f278 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -62,7 +62,7 @@
// - statics -
// -----------
-static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
+static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
#define DPI_COUNT (SAL_N_ELEMENTS(aDPIArray))
@@ -735,7 +735,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const
rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() );
rOptions.SetReduceBitmaps( IsReduceBitmaps() );
rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() );
- rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) GetReducedBitmapResolution(), (USHORT)( DPI_COUNT - 1 ) ) ] );
+ rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] );
rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() );
rOptions.SetConvertToGreyscales( IsConvertToGreyscales() );
}
@@ -758,7 +758,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions )
SetReducedBitmapIncludesTransparency( rOptions.IsReducedBitmapIncludesTransparency() );
SetConvertToGreyscales( rOptions.IsConvertToGreyscales() );
- const USHORT nDPI = rOptions.GetReducedBitmapResolution();
+ const sal_uInt16 nDPI = rOptions.GetReducedBitmapResolution();
if( nDPI < aDPIArray[ 0 ] )
SetReducedBitmapResolution( 0 );
diff --git a/svtools/source/contnr/cont_pch.cxx b/svtools/source/contnr/cont_pch.cxx
deleted file mode 100644
index 3abdd131677a..000000000000
--- a/svtools/source/contnr/cont_pch.cxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include <sv.hxx>
-#include <svtools/treelist.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
-#include <svtools/svicnvw.hxx>
-#include "svimpbox.hxx"
-#include "svimpicn.hxx"
-#include <svtools/svlbox.hxx>
-#include <svtools/svlbitm.hxx>
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index f17958fa8722..6e4f6441140c 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -31,7 +31,7 @@
#include "contentenumeration.hxx"
#include <svl/urlfilter.hxx>
#include <svtools/inettbc.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx
deleted file mode 100644
index 4560d5ea64a5..000000000000
--- a/svtools/source/contnr/ctrdll.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 3a9efa5f9905..b95c889827b9 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -29,12 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "fileview.hxx"
+#include <svtools/fileview.hxx>
#include <svtools/svtdata.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <svtools/headbar.hxx>
#include <svtools/svtabbx.hxx>
-
#include <svtools/svtools.hrc>
#include "fileview.hrc"
#include "contentenumeration.hxx"
@@ -190,7 +189,7 @@ private:
sal_Bool Kill( const OUString& rURL );
protected:
- virtual BOOL DoubleClickHdl();
+ virtual sal_Bool DoubleClickHdl();
virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos ) const;
public:
@@ -199,7 +198,7 @@ public:
virtual void Resize();
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
void ClearAll();
HeaderBar* GetHeaderBar() const { return mpHeaderBar; }
@@ -214,7 +213,7 @@ public:
DECL_LINK( ResetQuickSearch_Impl, Timer * );
virtual PopupMenu* CreateContextMenu( void );
- virtual void ExcecuteContextMenuAction( USHORT nSelectedPopentry );
+ virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopentry );
};
// class HashedEntry --------------------------------------------------
@@ -444,9 +443,9 @@ void NameTranslationList::Init()
aConfig.SetGroup( ByteString( pSection ) );
- USHORT nKeyCnt = aConfig.GetKeyCount();
+ sal_uInt16 nKeyCnt = aConfig.GetKeyCount();
- for( USHORT nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt )
+ for( sal_uInt16 nCnt = 0 ; nCnt < nKeyCnt ; ++nCnt )
Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) );
}
}
@@ -586,7 +585,7 @@ public:
String FolderInserted( const OUString& rURL,
const OUString& rTitle );
- ULONG GetEntryPos( const OUString& rURL );
+ sal_uLong GetEntryPos( const OUString& rURL );
inline void EnableContextMenu( sal_Bool bEnable );
inline void EnableDelete( sal_Bool bEnable );
@@ -935,7 +934,7 @@ PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void )
// -----------------------------------------------------------------------
-void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry )
+void ViewTabListBox_Impl::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
{
switch ( nSelectedPopupEntry )
{
@@ -953,7 +952,7 @@ void ViewTabListBox_Impl::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry
void ViewTabListBox_Impl::ClearAll()
{
- for ( USHORT i = 0; i < GetEntryCount(); ++i )
+ for ( sal_uInt16 i = 0; i < GetEntryCount(); ++i )
delete (SvtContentEntry*)GetEntry(i)->GetUserData();
Clear();
}
@@ -1029,10 +1028,10 @@ void ViewTabListBox_Impl::DeleteEntries()
}
// -----------------------------------------------------------------------
-BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
+sal_Bool ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
const XubString& rNewText )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
OUString aURL;
SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData();
@@ -1077,7 +1076,7 @@ BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry,
pData->maURL = aURL;
pEntry->SetUserData( pData );
- bRet = TRUE;
+ bRet = sal_True;
}
}
catch( Exception const & )
@@ -1115,7 +1114,7 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar )
SvLBoxEntry* pEntry = GetEntry( mnSearchIndex );
if ( pEntry )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
Select( pEntry );
SetCurEntry( pEntry );
MakeVisible( pEntry );
@@ -1131,10 +1130,10 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar )
}
// -----------------------------------------------------------------------
-BOOL ViewTabListBox_Impl::DoubleClickHdl()
+sal_Bool ViewTabListBox_Impl::DoubleClickHdl()
{
SvHeaderTabListBox::DoubleClickHdl();
- return FALSE;
+ return sal_False;
// this means "do no additional handling". Especially this means that the SvImpLBox does not
// recognize that the entry at the double click position change after the handler call (which is
// the case if in the handler, our content was replaced)
@@ -1280,7 +1279,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents )
{
mpImp->mpView->ClearAll();
const OUString* pFileProperties = aContents.getConstArray();
- UINT32 i, nCount = aContents.getLength();
+ sal_uInt32 i, nCount = aContents.getLength();
for ( i = 0; i < nCount; ++i )
{
String aRow( pFileProperties[i] );
@@ -1312,7 +1311,7 @@ void SvtFileView::OpenFolder( const Sequence< OUString >& aContents )
// detect image
sal_Bool bDoInsert = sal_True;
INetURLObject aObj( aImageURL.Len() > 0 ? aImageURL : aURL );
- Image aImage = SvFileInformationManager::GetImage( aObj, FALSE );
+ Image aImage = SvFileInformationManager::GetImage( aObj, sal_False );
if ( bDoInsert )
{
@@ -1360,7 +1359,7 @@ sal_Bool SvtFileView::CreateNewFolder( const String& rNewFolder )
String sTitle = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
String sEntry = mpImp->FolderInserted( sURL, sTitle );
SvLBoxEntry* pEntry = mpImp->mpView->InsertEntry( sEntry, mpImp->maFolderImage, mpImp->maFolderImage );
- SvtContentEntry* pUserData = new SvtContentEntry( sURL, TRUE );
+ SvtContentEntry* pUserData = new SvtContentEntry( sURL, sal_True );
pEntry->SetUserData( pUserData );
mpImp->mpView->MakeVisible( pEntry );
bRet = sal_True;
@@ -1411,16 +1410,16 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const
// -----------------------------------------------------------------------
-sal_uInt32 SvtFileView::GetHelpId( ) const
+const rtl::OString& SvtFileView::GetHelpId( ) const
{
return mpImp->mpView->GetHelpId( );
}
// -----------------------------------------------------------------------
-void SvtFileView::SetHelpId( sal_uInt32 nHelpId )
+void SvtFileView::SetHelpId( const rtl::OString& rHelpId )
{
- mpImp->mpView->SetHelpId( nHelpId );
+ mpImp->mpView->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
@@ -1546,7 +1545,7 @@ void SvtFileView::CancelRunningAsyncAction()
void SvtFileView::SetNoSelection()
{
- mpImp->mpView->SelectAll( FALSE );
+ mpImp->mpView->SelectAll( sal_False );
}
// -----------------------------------------------------------------------
@@ -1581,7 +1580,7 @@ void SvtFileView::SetDoubleClickHdl( const Link& rHdl )
// -----------------------------------------------------------------------
-ULONG SvtFileView::GetSelectionCount() const
+sal_uLong SvtFileView::GetSelectionCount() const
{
return mpImp->mpView->GetSelectionCount();
}
@@ -1653,7 +1652,7 @@ void SvtFileView::EndInplaceEditing( bool _bCancel )
IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar )
{
DBG_ASSERT( pBar, "no headerbar" );
- USHORT nItemID = pBar->GetCurItemId();
+ sal_uInt16 nItemID = pBar->GetCurItemId();
HeaderBarItemBits nBits;
@@ -1674,7 +1673,7 @@ IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar )
nBits = pBar->GetItemBits( nItemID );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
if ( bUp )
{
@@ -1698,10 +1697,10 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( !pBar->IsItemMode() )
{
Size aSize;
- USHORT nTabs = pBar->GetItemCount();
+ sal_uInt16 nTabs = pBar->GetItemCount();
long nTmpSize = 0;
- for ( USHORT i = 1; i <= nTabs; ++i )
+ for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
long nWidth = pBar->GetItemSize(i);
aSize.Width() = nWidth + nTmpSize;
@@ -1724,14 +1723,14 @@ String SvtFileView::GetConfigString() const
sRet += String::CreateFromInt32( mpImp->mnSortColumn );
sRet += ';';
HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
sRet += bUp ? '1' : '0';
sRet += ';';
- USHORT nCount = pBar->GetItemCount();
- for ( USHORT i = 0; i < nCount; ++i )
+ sal_uInt16 nCount = pBar->GetItemCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
- USHORT nId = pBar->GetItemId(i);
+ sal_uInt16 nId = pBar->GetItemId(i);
sRet += String::CreateFromInt32( nId );
sRet += ';';
sRet += String::CreateFromInt32( pBar->GetItemSize( nId ) );
@@ -1748,9 +1747,9 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
HeaderBar* pBar = mpImp->mpView->GetHeaderBar();
DBG_ASSERT( pBar, "invalid headerbar" );
- USHORT nIdx = 0;
- mpImp->mnSortColumn = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
- BOOL bUp = (BOOL)(USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_uInt16 nIdx = 0;
+ mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn );
if ( bUp )
@@ -1767,7 +1766,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
while ( nIdx != STRING_NOTFOUND )
{
- USHORT nItemId = (USHORT)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
+ sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() );
}
@@ -2161,7 +2160,7 @@ void SvtFileView_Impl::OpenFolder_Impl()
{
::osl::MutexGuard aGuard( maMutex );
- mpView->SetUpdateMode( FALSE );
+ mpView->SetUpdateMode( sal_False );
mpView->ClearAll();
std::vector< SortingData_Impl* >::iterator aIt;
@@ -2184,7 +2183,7 @@ void SvtFileView_Impl::OpenFolder_Impl()
InitSelection();
++mnSuspendSelectCallback;
- mpView->SetUpdateMode( TRUE );
+ mpView->SetUpdateMode( sal_True );
--mnSuspendSelectCallback;
ResetCursor();
@@ -2196,9 +2195,9 @@ void SvtFileView_Impl::ResetCursor()
// deselect
SvLBoxEntry* pEntry = mpView->FirstSelected();
if ( pEntry )
- mpView->Select( pEntry, FALSE );
+ mpView->Select( pEntry, sal_False );
// set cursor to the first entry
- mpView->SetCursor( mpView->First(), TRUE );
+ mpView->SetCursor( mpView->First(), sal_True );
mpView->Update();
}
@@ -2330,10 +2329,10 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
::svtools::VolumeInfo aVolInfo( (*aIt)->mbIsVolume, (*aIt)->mbIsRemote,
(*aIt)->mbIsRemoveable, (*aIt)->mbIsFloppy,
(*aIt)->mbIsCompactDisc );
- (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE );
+ (*aIt)->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False );
}
else
- (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), FALSE );
+ (*aIt)->maImage = SvFileInformationManager::GetFileImage( INetURLObject( (*aIt)->maTargetURL ), sal_False );
}
}
@@ -2418,7 +2417,7 @@ void SvtFileView_Impl::CreateVector_Impl( const Sequence < OUString > &rList )
// detect the image
INetURLObject aObj( pEntry->maImageURL.getLength() ? pEntry->maImageURL : pEntry->maTargetURL );
- pEntry->maImage = SvFileInformationManager::GetImage( aObj, FALSE );
+ pEntry->maImage = SvFileInformationManager::GetImage( aObj, sal_False );
maContent.push_back( pEntry );
}
@@ -2449,7 +2448,7 @@ void SvtFileView_Impl::Resort_Impl( sal_Int16 nColumn, sal_Bool bAscending )
if ( !mbIsFirstResort )
{
- ULONG nPos = GetEntryPos( aEntryURL );
+ sal_uLong nPos = GetEntryPos( aEntryURL );
if ( nPos < mpView->GetEntryCount() )
{
pEntry = mpView->GetEntry( nPos );
@@ -2538,7 +2537,7 @@ sal_Bool CompareSortingData_Impl( SortingData_Impl* const aOne, SortingData_Impl
}
}
- // when the two elements are equal, we must not return TRUE (which would
+ // when the two elements are equal, we must not return sal_True (which would
// happen if we just return ! ( a < b ) when not sorting ascending )
if ( bEqual )
return sal_False;
@@ -2628,7 +2627,7 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r
::svtools::VolumeInfo aVolInfo;
pData->maType = SvFileInformationManager::GetFolderDescription( aVolInfo );
- pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, FALSE );
+ pData->maImage = SvFileInformationManager::GetFolderImage( aVolInfo, sal_False );
OUString aValue;
OUString aTab( RTL_CONSTASCII_USTRINGPARAM( "\t" ));
@@ -2657,12 +2656,12 @@ String SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString& r
}
// -----------------------------------------------------------------------
-ULONG SvtFileView_Impl::GetEntryPos( const OUString& rURL )
+sal_uLong SvtFileView_Impl::GetEntryPos( const OUString& rURL )
{
::osl::MutexGuard aGuard( maMutex );
std::vector< SortingData_Impl* >::iterator aIt;
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
for ( aIt = maContent.begin(); aIt != maContent.end(); ++aIt )
{
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c8f5e6aa1911..a7e82cf15881 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -110,6 +110,7 @@ Menu RID_FILEVIEW_CONTEXTMENU
ModalDialog DLG_SVT_QUERYDELETE
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_QUERYDELETE";
SVLook = TRUE ;
OutputSize = TRUE ;
Moveable = TRUE ;
@@ -142,6 +143,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_YES
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_YES";
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -151,6 +153,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_ALL
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_ALL";
Pos = MAP_APPFONT ( 59 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
@@ -160,6 +163,7 @@ ModalDialog DLG_SVT_QUERYDELETE
PushButton BTN_NO
{
+ HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_NO";
Pos = MAP_APPFONT ( 112 , 47 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 4a7b54c6fed3..517f0f6b66f1 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -38,7 +38,7 @@
#include <limits.h>
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include <svl/svarray.hxx>
class IcnCursor_Impl;
@@ -56,7 +56,7 @@ class IcnGridMap_Impl;
#define F_VER_SBARSIZE_WITH_HBAR 0x0001
#define F_HOR_SBARSIZE_WITH_VBAR 0x0002
-#define F_PAINTED 0x0004 // TRUE nach erstem Paint
+#define F_PAINTED 0x0004 // sal_True nach erstem Paint
#define F_ADD_MODE 0x0008
#define F_SELECTING_RECT 0x0020
#define F_DOWN_CTRL 0x0080
@@ -105,11 +105,11 @@ enum IcnViewFieldType
//
struct LocalFocus
{
- BOOL bOn;
+ sal_Bool bOn;
Rectangle aRect;
Color aPenColor;
- LocalFocus() { bOn = FALSE; }
+ LocalFocus() { bOn = sal_False; }
};
///////////////////////////////////////////////////////////////////////////////
@@ -129,18 +129,18 @@ private:
public:
EntryList_Impl(
SvxIconChoiceCtrl_Impl*,
- USHORT _nInitSize = 1024,
- USHORT _nReSize = 1024 );
+ sal_uInt16 _nInitSize = 1024,
+ sal_uInt16 _nReSize = 1024 );
EntryList_Impl(
SvxIconChoiceCtrl_Impl*,
- USHORT _nBlockSize,
- USHORT _nInitSize,
- USHORT _nReSize );
+ sal_uInt16 _nBlockSize,
+ sal_uInt16 _nInitSize,
+ sal_uInt16 _nReSize );
~EntryList_Impl();
void Clear();
- void Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos );
- SvxIconChoiceCtrlEntry* Remove( ULONG nPos );
+ void Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos );
+ SvxIconChoiceCtrlEntry* Remove( sal_uLong nPos );
void Remove( SvxIconChoiceCtrlEntry* pEntry );
};
@@ -155,7 +155,7 @@ class SvxIconChoiceCtrl_Impl
friend class EntryList_Impl;
friend class IcnGridMap_Impl;
- BOOL bChooseWithCursor;
+ sal_Bool bChooseWithCursor;
EntryList_Impl aEntries;
ScrollBar aVerSBar;
ScrollBar aHorSBar;
@@ -185,12 +185,12 @@ class SvxIconChoiceCtrl_Impl
IcnViewEdit_Impl* pEdit;
WinBits nWinBits;
long nMaxBoundHeight; // Hoehe des hoechsten BoundRects
- USHORT nFlags;
- USHORT nCurTextDrawFlags;
- ULONG nUserEventAdjustScrBars;
- ULONG nUserEventShowCursor;
+ sal_uInt16 nFlags;
+ sal_uInt16 nCurTextDrawFlags;
+ sal_uLong nUserEventAdjustScrBars;
+ sal_uLong nUserEventShowCursor;
SvxIconChoiceCtrlEntry* pCurHighlightFrame;
- BOOL bHighlightFramePressed;
+ sal_Bool bHighlightFramePressed;
SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links
SvxIconChoiceCtrlEntry* pCursor;
SvxIconChoiceCtrlEntry* pPrevDropTarget;
@@ -208,16 +208,16 @@ class SvxIconChoiceCtrl_Impl
SvxIconChoiceCtrlEntry* pCurEditedEntry;
SvxIconChoiceCtrlTextMode eTextMode;
SelectionMode eSelectionMode;
- ULONG nSelectionCount;
+ sal_uLong nSelectionCount;
SvxIconChoiceCtrlPositionMode ePositionMode;
- BOOL bBoundRectsDirty;
- BOOL bUpdateMode;
- BOOL bEntryEditingEnabled;
- BOOL bInDragDrop;
+ sal_Bool bBoundRectsDirty;
+ sal_Bool bUpdateMode;
+ sal_Bool bEntryEditingEnabled;
+ sal_Bool bInDragDrop;
- void ShowCursor( BOOL bShow );
+ void ShowCursor( sal_Bool bShow );
- void ImpArrange( BOOL bKeepPredecessors = FALSE );
+ void ImpArrange( sal_Bool bKeepPredecessors = sal_False );
void AdjustVirtSize( const Rectangle& );
void ResetVirtSize();
void CheckScrollBars();
@@ -232,16 +232,16 @@ class SvxIconChoiceCtrl_Impl
DECL_LINK( VisRectChangedHdl, void* );
DECL_LINK( CallSelectHdlHdl, void* );
- void AdjustScrollBars( BOOL bVirtSizeGrowedOnly = FALSE);
+ void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False);
void PositionScrollBars( long nRealWidth, long nRealHeight );
long GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); }
long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; }
- BOOL HandleScrollCommand( const CommandEvent& rCmd );
+ sal_Bool HandleScrollCommand( const CommandEvent& rCmd );
void ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); }
void InitScrollBarBox();
SvxIconChoiceCtrlEntry* FindNewCursor();
void ToggleSelection( SvxIconChoiceCtrlEntry* );
- void DeselectAllBut( SvxIconChoiceCtrlEntry*, BOOL bPaintSync=FALSE );
+ void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False );
void Center( SvxIconChoiceCtrlEntry* pEntry ) const;
void StopEditTimer() { aEditTimer.Stop(); }
void StartEditTimer() { aEditTimer.Start(); }
@@ -250,13 +250,13 @@ class SvxIconChoiceCtrl_Impl
void SelectRect(
SvxIconChoiceCtrlEntry* pEntry1,
SvxIconChoiceCtrlEntry* pEntry2,
- BOOL bAdd = TRUE,
+ sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0 );
void SelectRange(
SvxIconChoiceCtrlEntry* pStart,
SvxIconChoiceCtrlEntry* pEnd,
- BOOL bAdd = TRUE );
+ sal_Bool bAdd = sal_True );
void AddSelectedRect( const Rectangle& );
void AddSelectedRect(
@@ -272,27 +272,27 @@ class SvxIconChoiceCtrl_Impl
Point AdjustAtGrid(
const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect)
const Rectangle& rBoundRect ) const;
- ULONG GetPredecessorGrid( const Point& rDocPos) const;
+ sal_uLong GetPredecessorGrid( const Point& rDocPos) const;
void InitPredecessors();
void ClearPredecessors();
- BOOL CheckVerScrollBar();
- BOOL CheckHorScrollBar();
+ sal_Bool CheckVerScrollBar();
+ sal_Bool CheckHorScrollBar();
void CancelUserEvents();
- void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bSyncPaint );
+ void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bSyncPaint );
void SaveSelection( List** );
- void RepaintEntries( USHORT nEntryFlagsMask );
+ void RepaintEntries( sal_uInt16 nEntryFlagsMask );
void SetListPositions();
void SetDefaultTextSize();
- BOOL IsAutoArrange() const {
- return (BOOL)(ePositionMode == IcnViewPositionModeAutoArrange); }
- BOOL IsAutoAdjust() const {
- return (BOOL)(ePositionMode == IcnViewPositionModeAutoAdjust); }
+ sal_Bool IsAutoArrange() const {
+ return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); }
+ sal_Bool IsAutoAdjust() const {
+ return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); }
void DocRectChanged() { aDocRectChangedTimer.Start(); }
void VisRectChanged() { aVisRectChangedTimer.Start(); }
- void SetOrigin( const Point&, BOOL bDoNotUpdateWallpaper = FALSE );
+ void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False );
DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* );
@@ -300,7 +300,7 @@ class SvxIconChoiceCtrl_Impl
void HideFocus ();
void DrawFocusRect ( OutputDevice* pOut );
- BOOL IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const;
+ sal_Bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const;
public:
@@ -312,52 +312,52 @@ public:
SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle );
~SvxIconChoiceCtrl_Impl();
- BOOL SetChoiceWithCursor ( BOOL bDo = TRUE ) { BOOL bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; }
- void Clear( BOOL bInCtor = FALSE );
+ sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; }
+ void Clear( sal_Bool bInCtor = sal_False );
void SetStyle( WinBits nWinStyle );
WinBits GetStyle() const { return nWinBits; }
- void InsertEntry( SvxIconChoiceCtrlEntry*, ULONG nPos, const Point* pPos=0 );
+ void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 );
void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL );
void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry );
void FontModified();
- void SelectAll( BOOL bSelect = TRUE, BOOL bPaint = TRUE );
+ void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True );
void SelectEntry(
SvxIconChoiceCtrlEntry*,
- BOOL bSelect,
- BOOL bCallHdl = TRUE,
- BOOL bAddToSelection = FALSE,
- BOOL bSyncPaint = FALSE );
+ sal_Bool bSelect,
+ sal_Bool bCallHdl = sal_True,
+ sal_Bool bAddToSelection = sal_False,
+ sal_Bool bSyncPaint = sal_False );
void Paint( const Rectangle& rRect );
- BOOL MouseButtonDown( const MouseEvent& );
- BOOL MouseButtonUp( const MouseEvent& );
- BOOL MouseMove( const MouseEvent&);
- BOOL RequestHelp( const HelpEvent& rHEvt );
+ sal_Bool MouseButtonDown( const MouseEvent& );
+ sal_Bool MouseButtonUp( const MouseEvent& );
+ sal_Bool MouseMove( const MouseEvent&);
+ sal_Bool RequestHelp( const HelpEvent& rHEvt );
void SetCursor_Impl(
SvxIconChoiceCtrlEntry* pOldCursor,
SvxIconChoiceCtrlEntry* pNewCursor,
- BOOL bMod1,
- BOOL bShift,
- BOOL bPaintSync = FALSE);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool bMod1,
+ sal_Bool bShift,
+ sal_Bool bPaintSync = sal_False);
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
- void SetUpdateMode( BOOL bUpdate );
- BOOL GetUpdateMode() const { return bUpdateMode; }
- void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted=FALSE );
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool GetUpdateMode() const { return bUpdateMode; }
+ void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False );
void PaintEntry(
SvxIconChoiceCtrlEntry*,
const Point&,
OutputDevice* pOut = 0,
- BOOL bIsBackgroundPainted = FALSE);
+ sal_Bool bIsBackgroundPainted = sal_False);
void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* );
void SetEntryPos(
SvxIconChoiceCtrlEntry* pEntry,
const Point& rPos,
- BOOL bAdjustRow = FALSE,
- BOOL bCheckScrollBars = FALSE,
- BOOL bKeepGridMap = FALSE );
+ sal_Bool bAdjustRow = sal_False,
+ sal_Bool bCheckScrollBars = sal_False,
+ sal_Bool bKeepGridMap = sal_False );
void InvalidateEntry( SvxIconChoiceCtrlEntry* );
IcnViewFieldType GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos );
@@ -367,25 +367,25 @@ public:
SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; }
void SetCursor(
SvxIconChoiceCtrlEntry*,
- // TRUE == bei Single-Selection die Sel. mitfuehren
- BOOL bSyncSingleSelection = TRUE,
- BOOL bShowFocusAsync = FALSE );
+ // sal_True == bei Single-Selection die Sel. mitfuehren
+ sal_Bool bSyncSingleSelection = sal_True,
+ sal_Bool bShowFocusAsync = sal_False );
- SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, BOOL bHit = FALSE );
+ SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False );
SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry );
SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry );
Point GetEntryPos( SvxIconChoiceCtrlEntry* );
- void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound = TRUE );
+ void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True );
- void Arrange(BOOL bKeepPredecessors = FALSE, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 );
+ void Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 );
Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* );
Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 );
Rectangle CalcTextRect(
SvxIconChoiceCtrlEntry*,
const Point* pPos = 0,
- BOOL bForInplaceEdit = FALSE,
+ sal_Bool bForInplaceEdit = sal_False,
const String* pStr = 0 );
long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const;
@@ -402,44 +402,44 @@ public:
void RecalcAllBoundingRectsSmart();
const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* );
- void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = TRUE; }
- BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); }
+ void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; }
+ sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); }
void PaintEmphasis(
const Rectangle& rRect1,
const Rectangle& rRect2,
- BOOL bSelected,
- BOOL bDropTarget,
- BOOL bCursored,
+ sal_Bool bSelected,
+ sal_Bool bDropTarget,
+ sal_Bool bCursored,
OutputDevice* pOut,
- BOOL bIsBackgroundPainted = FALSE);
+ sal_Bool bIsBackgroundPainted = sal_False);
void PaintItem(
const Rectangle& rRect,
IcnViewFieldType eItem,
SvxIconChoiceCtrlEntry* pEntry,
- USHORT nPaintFlags,
+ sal_uInt16 nPaintFlags,
OutputDevice* pOut,
const String* pStr = 0,
::vcl::ControlLayoutData* _pLayoutData = NULL );
- // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
+ // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True
void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); }
// berechnet alle invalidierten BoundingRects neu
void UpdateBoundingRects();
- void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, BOOL bShow );
+ void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow );
void PrepareCommandEvent( const CommandEvent& );
void Command( const CommandEvent& rCEvt );
void ToTop( SvxIconChoiceCtrlEntry* );
- ULONG GetSelectionCount() const;
+ sal_uLong GetSelectionCount() const;
void SetGrid( const Size& );
Size GetMinGrid() const;
- ULONG GetGridCount(
+ sal_uLong GetGridCount(
const Size& rSize,
- BOOL bCheckScrBars,
- BOOL bSmartScrBar ) const;
- void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE );
+ sal_Bool bCheckScrBars,
+ sal_Bool bSmartScrBar ) const;
+ void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False );
const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const;
void HideDDIcon();
@@ -448,67 +448,67 @@ public:
SvxIconChoiceCtrlEntry* pRefEntry,
const Point& rPos );
- BOOL IsOver(
+ sal_Bool IsOver(
SvPtrarr* pSelectedRectList,
const Rectangle& rEntryBoundRect ) const;
void SelectRect(
const Rectangle&,
- BOOL bAdd = TRUE,
+ sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0 );
void CalcScrollOffsets(
const Point& rRefPosPixel,
long& rX,
long& rY,
- BOOL bDragDrop = FALSE,
- USHORT nBorderWidth = 10 );
+ sal_Bool bDragDrop = sal_False,
+ sal_uInt16 nBorderWidth = 10 );
- BOOL IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
+ sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
void MakeVisible(
const Rectangle& rDocPos,
- BOOL bInScrollBarEvent=FALSE,
- BOOL bCallRectChangedHdl = TRUE );
+ sal_Bool bInScrollBarEvent=sal_False,
+ sal_Bool bCallRectChangedHdl = sal_True );
void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 );
void SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const;
void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry );
- void EnableEntryEditing( BOOL bEnable ) { bEntryEditingEnabled = bEnable; }
- BOOL IsEntryEditingEnabled() const { return bEntryEditingEnabled; }
- BOOL IsEntryEditing() const { return (BOOL)(pCurEditedEntry!=0); }
+ void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; }
+ sal_Bool IsEntryEditingEnabled() const { return bEntryEditingEnabled; }
+ sal_Bool IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); }
void EditEntry( SvxIconChoiceCtrlEntry* pEntry );
- void StopEntryEditing( BOOL bCancel );
- void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock );
- ULONG GetEntryCount() const { return aEntries.Count(); }
- SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); }
- SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( ULONG& ) const;
- SvxIconChoiceCtrlEntry* GetNextSelectedEntry( ULONG& ) const;
+ void StopEntryEditing( sal_Bool bCancel );
+ void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock );
+ sal_uLong GetEntryCount() const { return aEntries.Count(); }
+ SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); }
+ SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uLong& ) const;
+ SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uLong& ) const;
SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; }
void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; }
SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const;
void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; }
SelectionMode GetSelectionMode() const { return eSelectionMode; }
- BOOL AreEntriesMoved() const { return (BOOL)((nFlags & F_MOVED_ENTRIES)!=0); }
- void SetEntriesMoved( BOOL bMoved )
+ sal_Bool AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); }
+ void SetEntriesMoved( sal_Bool bMoved )
{
if( bMoved ) nFlags |= F_MOVED_ENTRIES;
else nFlags &= ~(F_MOVED_ENTRIES);
}
- ULONG GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
- void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, ULONG nNewPos );
+ sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
+ void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos );
void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; }
- void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nFlags );
- SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight );
- SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
+ void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags );
+ SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
+ SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
void InitSettings();
Rectangle GetOutputRect() const;
- BOOL ArePredecessorsSet() const { return (BOOL)(pHead != 0); }
+ sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); }
SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; }
void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor);
- BOOL GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor);
+ sal_Bool GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor);
// liefert gueltige Ergebnisse nur im AutoArrange-Modus!
SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& );
@@ -516,24 +516,24 @@ public:
SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;}
void Flush();
- void SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& );
- const SvxIconChoiceCtrlColumnInfo* GetColumn( USHORT nIndex ) const;
- const SvxIconChoiceCtrlColumnInfo* GetItemColumn( USHORT nSubItem, long& rLeft ) const;
+ void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& );
+ const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const;
+ const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const;
Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); }
Rectangle GetVisibleRect() const { return GetOutputRect(); }
- void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,BOOL bKeepHighlightFlags=FALSE );
+ void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False );
void HideEntryHighlightFrame();
void DrawHighlightFrame( OutputDevice* pOut,
- const Rectangle& rBmpRect, BOOL bHide );
+ const Rectangle& rBmpRect, sal_Bool bHide );
void StopSelectTimer() { aCallSelectHdlTimer.Stop(); }
void Tracking( const TrackingEvent& rTEvt );
Point GetPopupMenuPosPixel() const;
- BOOL HandleShortCutKey( const KeyEvent& rKeyEvent );
+ sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent );
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
inline ::svt::IAccessibleFactory&
GetAccessibleFactory() { return aAccFactory.getFactory(); }
@@ -555,12 +555,12 @@ class IcnCursor_Impl
void ImplCreate();
void Create() { if( !pColumns ) ImplCreate(); }
- USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
- SvxIconChoiceCtrlEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref,
- BOOL bDown, BOOL bSimple );
+ sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
+ SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref,
+ sal_Bool bDown, sal_Bool bSimple );
- SvxIconChoiceCtrlEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref,
- BOOL bRight, BOOL bSimple );
+ SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref,
+ sal_Bool bRight, sal_Bool bSimple );
public:
IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner );
@@ -568,9 +568,9 @@ public:
void Clear();
// fuer Cursortravelling usw.
- SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, BOOL bRight );
- SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
- SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, BOOL bDown );
+ SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
+ SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
+ SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
// Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
// sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
@@ -582,7 +582,7 @@ public:
// ----------------------------------------------------------------------------------------------
-typedef ULONG GridId;
+typedef sal_uLong GridId;
#define GRID_NOT_FOUND ((GridId)ULONG_MAX)
@@ -590,14 +590,14 @@ class IcnGridMap_Impl
{
Rectangle _aLastOccupiedGrid;
SvxIconChoiceCtrl_Impl* _pView;
- BOOL* _pGridMap;
- USHORT _nGridCols, _nGridRows;
+ sal_Bool* _pGridMap;
+ sal_uInt16 _nGridCols, _nGridRows;
void Expand();
void Create_Impl();
void Create() { if(!_pGridMap) Create_Impl(); }
- void GetMinMapSize( USHORT& rDX, USHORT& rDY ) const;
+ void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const;
public:
IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView);
@@ -605,22 +605,22 @@ public:
void Clear();
- GridId GetGrid( const Point& rDocPos, BOOL* pbClipped = 0 );
- GridId GetGrid( USHORT nGridX, USHORT nGridY );
- GridId GetUnoccupiedGrid( BOOL bOccupyFound=TRUE );
+ GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 );
+ GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY );
+ GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True );
- void OccupyGrids( const Rectangle&, BOOL bOccupy = TRUE );
- void OccupyGrids( const SvxIconChoiceCtrlEntry*, BOOL bOccupy = TRUE );
- void OccupyGrid( GridId nId, BOOL bOccupy = TRUE )
+ void OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True );
+ void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True );
+ void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True )
{
- DBG_ASSERT(!_pGridMap || nId<(ULONG)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId");
- if(_pGridMap && nId < (ULONG)(_nGridCols *_nGridRows) )
+ DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId");
+ if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) )
_pGridMap[ nId ] = bOccupy;
}
Rectangle GetGridRect( GridId );
- void GetGridCoord( GridId, USHORT& rGridX, USHORT& rGridY );
- static ULONG GetGridCount( const Size& rSizePixel, USHORT nGridWidth, USHORT nGridHeight );
+ void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY );
+ static sal_uLong GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight );
void OutputSizeChanged();
};
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index fb3f11060adf..640f6c5ae923 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -41,7 +41,7 @@
#include <vcl/mnemonic.hxx>
#include <vcl/controllayout.hxx>
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include "imivctl.hxx"
#include <svtools/svmedit.hxx>
@@ -69,7 +69,7 @@ struct SvxIconChoiceCtrlEntry_Impl
: _pEntry( pEntry), _aPos( rBoundRect.TopLeft()) {}
};
-static BOOL bEndScrollInvalidate = TRUE;
+static sal_Bool bEndScrollInvalidate = sal_True;
class IcnViewEdit_Impl : public MultiLineEdit
{
@@ -77,9 +77,9 @@ class IcnViewEdit_Impl : public MultiLineEdit
Accelerator aAccReturn;
Accelerator aAccEscape;
Timer aTimer;
- BOOL bCanceled;
- BOOL bAlreadyInCallback;
- BOOL bGrabFocus;
+ sal_Bool bCanceled;
+ sal_Bool bAlreadyInCallback;
+ sal_Bool bGrabFocus;
void CallCallBackHdl_Impl();
DECL_LINK( Timeout_Impl, Timer * );
@@ -98,9 +98,9 @@ public:
~IcnViewEdit_Impl();
virtual void KeyInput( const KeyEvent& rKEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- BOOL EditingCanceled() const { return bCanceled; }
- void StopEditing( BOOL bCancel = FALSE );
- BOOL IsGrabFocus() const { return bGrabFocus; }
+ sal_Bool EditingCanceled() const { return bCanceled; }
+ void StopEditing( sal_Bool bCancel = sal_False );
+ sal_Bool IsGrabFocus() const { return bGrabFocus; }
};
SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
@@ -112,7 +112,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
aImageSize( 32, 32 ),
pColumns( 0 )
{
- bChooseWithCursor=FALSE;
+ bChooseWithCursor=sal_False;
pEntryPaintDev = 0;
pCurEditedEntry = 0;
pCurHighlightFrame = 0;
@@ -123,10 +123,10 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
pHdlEntry = 0;
pHead = NULL;
pCursor = NULL;
- bUpdateMode = TRUE;
- bEntryEditingEnabled = FALSE;
- bInDragDrop = FALSE;
- bHighlightFramePressed = FALSE;
+ bUpdateMode = sal_True;
+ bEntryEditingEnabled = sal_False;
+ bInDragDrop = sal_False;
+ bHighlightFramePressed = sal_False;
eSelectionMode = MULTIPLE_SELECTION;
pView = pCurView;
pZOrderList = new List; //SvPtrarr;
@@ -166,7 +166,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView,
aVisRectChangedTimer.SetTimeout( 50 );
aVisRectChangedTimer.SetTimeoutHdl(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl));
- Clear( TRUE );
+ Clear( sal_True );
SetGrid( Size(100, 70) );
}
@@ -190,17 +190,17 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl()
ClearColumnList();
}
-void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor )
+void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
nSelectionCount = 0;
DELETEZ(pDraggedSelection);
- bInDragDrop = FALSE;
+ bInDragDrop = sal_False;
pCurHighlightFrame = 0;
StopEditTimer();
CancelUserEvents();
- ShowCursor( FALSE );
- bBoundRectsDirty = FALSE;
+ ShowCursor( sal_False );
+ bBoundRectsDirty = sal_False;
nMaxBoundHeight = 0;
nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES);
@@ -224,8 +224,8 @@ void SvxIconChoiceCtrl_Impl::Clear( BOOL bInCtor )
pView->Invalidate(INVALIDATE_NOCHILDREN);
}
AdjustScrollBars();
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
delete pCur;
@@ -254,19 +254,19 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle )
IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
// Pfeil hoch: delta=-1; Pfeil runter: delta=+1
- Scroll( 0, pScrollBar->GetDelta(), TRUE );
- bEndScrollInvalidate = TRUE;
+ Scroll( 0, pScrollBar->GetDelta(), sal_True );
+ bEndScrollInvalidate = sal_True;
return 0;
}
IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar )
{
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
// Pfeil links: delta=-1; Pfeil rechts: delta=+1
- Scroll( pScrollBar->GetDelta(), 0, TRUE );
- bEndScrollInvalidate = TRUE;
+ Scroll( pScrollBar->GetDelta(), 0, sal_True );
+ bEndScrollInvalidate = sal_True;
return 0;
}
@@ -288,11 +288,11 @@ void SvxIconChoiceCtrl_Impl::FontModified()
DELETEZ(pDDTempDev);
DELETEZ(pEntryPaintDev);
SetDefaultTextSize();
- ShowCursor( FALSE );
- ShowCursor( TRUE );
+ ShowCursor( sal_False );
+ ShowCursor( sal_True );
}
-void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos,
+void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos,
const Point* pPos )
{
StopEditTimer();
@@ -309,13 +309,13 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, ULONG
{
Size aSize( CalcBoundingSize( pEntry ) );
SetBoundingRect_Impl( pEntry, *pPos, aSize );
- SetEntryPos( pEntry, *pPos, FALSE, TRUE, TRUE /*keep grid map*/ );
+ SetEntryPos( pEntry, *pPos, sal_False, sal_True, sal_True /*keep grid map*/ );
pEntry->nFlags |= ICNVIEW_FLAG_POS_MOVED;
- SetEntriesMoved( TRUE );
+ SetEntriesMoved( sal_True );
}
else
{
- // wenn der UpdateMode TRUE ist, wollen wir nicht pauschal alle
+ // wenn der UpdateMode sal_True ist, wollen wir nicht pauschal alle
// BoundRects auf 'zu ueberpruefen' setzen, sondern nur das des
// neuen Eintrags. Deshalb kein InvalidateBoundingRect aufrufen!
pEntry->aRect.Right() = LONG_MAX;
@@ -342,8 +342,8 @@ void SvxIconChoiceCtrl_Impl::CreateAutoMnemonics( MnemonicGenerator* _pGenerator
pAutoDeleteOwnGenerator.reset( _pGenerator );
}
- ULONG nEntryCount = GetEntryCount();
- ULONG i;
+ sal_uLong nEntryCount = GetEntryCount();
+ sal_uLong i;
// insert texts in generator
for( i = 0; i < nEntryCount; ++i )
@@ -376,8 +376,8 @@ void SvxIconChoiceCtrl_Impl::SetListPositions()
if( nFlags & F_ENTRYLISTPOS_VALID )
return;
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pEntry->nPos = nCur;
@@ -387,14 +387,14 @@ void SvxIconChoiceCtrl_Impl::SetListPositions()
void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
{
- BOOL bSyncSingleSelection;
+ sal_Bool bSyncSingleSelection;
// bei Single-Selection wird die Selektion beim Umsetzen des Cursors
// mitgefuehrt. Das soll aber nur erfolgen, wenn ueberhaupt ein
// Eintrag selektiert ist.
if( GetSelectionCount() )
- bSyncSingleSelection = TRUE;
+ bSyncSingleSelection = sal_True;
else
- bSyncSingleSelection = FALSE;
+ bSyncSingleSelection = sal_False;
if( pEntry == pCurHighlightFrame )
pCurHighlightFrame = 0;
@@ -402,7 +402,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
if( bInDragDrop )
{
DELETEZ(pDraggedSelection);
- bInDragDrop = FALSE;
+ bInDragDrop = sal_False;
}
if( pEntry->IsSelected() )
@@ -419,25 +419,25 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
pAnchor = 0;
if( pEntry->IsSelected() )
nSelectionCount--;
- BOOL bEntryBoundValid = IsBoundingRectValid( pEntry->aRect );
+ sal_Bool bEntryBoundValid = IsBoundingRectValid( pEntry->aRect );
if( bEntryBoundValid )
pView->Invalidate( pEntry->aRect );
- BOOL bSetNewCursor = FALSE;
+ sal_Bool bSetNewCursor = sal_False;
SvxIconChoiceCtrlEntry* pNewCursor = NULL;
if( pEntry == pCursor )
{
- bSetNewCursor = TRUE;
+ bSetNewCursor = sal_True;
pNewCursor = FindNewCursor();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pCursor = 0;
}
- BOOL bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? TRUE : FALSE;
+ sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False;
if( bCurEntryPosValid && aEntries.GetObject(aEntries.Count()-1) != pEntry )
nFlags &= ~F_ENTRYLISTPOS_VALID;
- ULONG nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos );
if( bCurEntryPosValid )
{
@@ -455,12 +455,12 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
{
// Fokusrechteck asynchron einblenden, um das Loeschen einer
// Multiselektion zu beschleunigen.
- SetCursor( pNewCursor, bSyncSingleSelection, TRUE );
+ SetCursor( pNewCursor, bSyncSingleSelection, sal_True );
}
}
-void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bCallHdl, BOOL bAdd, BOOL bSyncPaint )
+void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bCallHdl, sal_Bool bAdd, sal_Bool bSyncPaint )
{
if( eSelectionMode == NO_SELECTION )
return;
@@ -477,7 +477,7 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b
if( pEntry->IsSelected() != bSelect )
{
pHdlEntry = pEntry;
- USHORT nEntryFlags = pEntry->GetFlags();
+ sal_uInt16 nEntryFlags = pEntry->GetFlags();
if( bSelect )
{
nEntryFlags |= ICNVIEW_FLAG_SELECTED;
@@ -498,8 +498,8 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL b
}
}
-void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL bSelect,
- BOOL bSyncPaint )
+void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
+ sal_Bool bSyncPaint )
{
// bei SingleSelection dafuer sorgen, dass der Cursor immer
// auf dem (einzigen) selektierten Eintrag steht. Aber nur,
@@ -519,7 +519,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL
if( bUpdateMode )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( pView->IsTracking() && (bSelect || !pView->HasBackground()) ) // beim Tracken immer synchron
PaintEntry( pEntry );
else if( bSyncPaint ) // synchron & mit virtuellem OutDev!
@@ -529,7 +529,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected( SvxIconChoiceCtrlEntry* pEntry, BOOL
pView->Invalidate( CalcFocusRect( pEntry ) );
}
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
// #i101012# emit vcl event LISTBOX_SELECT only in case that the given entry is selected.
@@ -544,8 +544,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize()
StopEditTimer();
aVirtOutputSize.Width() = 0;
aVirtOutputSize.Height() = 0;
- const ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED );
@@ -567,8 +567,8 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize()
if( aVirtOutputSize.Width() < aRealOutputSize.Width() ||
aVirtOutputSize.Height() < aRealOutputSize.Height() )
{
- ULONG nGridCount = IcnGridMap_Impl::GetGridCount(
- aRealOutputSize, (USHORT)nGridDX, (USHORT)nGridDY );
+ sal_uLong nGridCount = IcnGridMap_Impl::GetGridCount(
+ aRealOutputSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY );
if( nGridCount < nCount )
{
if( nWinBits & WB_ALIGN_TOP )
@@ -616,11 +616,11 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const Rectangle& rRect )
void SvxIconChoiceCtrl_Impl::InitPredecessors()
{
DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized");
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( nCount )
{
SvxIconChoiceCtrlEntry* pPrev = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 );
- for( ULONG nCur = 1; nCur <= nCount; nCur++ )
+ for( sal_uLong nCur = 1; nCur <= nCount; nCur++ )
{
pPrev->ClearFlags( ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED |
ICNVIEW_FLAG_PRED_SET);
@@ -645,8 +645,8 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors()
{
if( pHead )
{
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
pCur->pflink = 0;
@@ -657,7 +657,7 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors()
}
}
-void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight )
+void SvxIconChoiceCtrl_Impl::Arrange( sal_Bool bKeepPredecessors, long nSetMaxVirtWidth, long nSetMaxVirtHeight )
{
if ( nSetMaxVirtWidth != 0 )
nMaxVirtWidth = nSetMaxVirtWidth;
@@ -672,23 +672,23 @@ void SvxIconChoiceCtrl_Impl::Arrange( BOOL bKeepPredecessors, long nSetMaxVirtWi
ImpArrange( bKeepPredecessors );
}
-void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors )
+void SvxIconChoiceCtrl_Impl::ImpArrange( sal_Bool bKeepPredecessors )
{
static Point aEmptyPoint;
- BOOL bOldUpdate = bUpdateMode;
+ sal_Bool bOldUpdate = bUpdateMode;
Rectangle aCurOutputArea( GetOutputRect() );
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
- bUpdateMode = FALSE;
+ bUpdateMode = sal_False;
aAutoArrangeTimer.Stop();
nFlags &= ~F_MOVED_ENTRIES;
nFlags |= F_ARRANGING;
StopEditTimer();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
ResetVirtSize();
if( !bKeepPredecessors )
ClearPredecessors();
- bBoundRectsDirty = FALSE;
+ bBoundRectsDirty = sal_False;
SetOrigin( Point() );
VisRectChanged();
RecalcAllBoundingRectsSmart();
@@ -701,12 +701,12 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( BOOL bKeepPredecessors )
MakeVisible( aCurOutputArea );
SetUpdateMode( bOldUpdate );
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
{
- bEndScrollInvalidate = FALSE;
+ bEndScrollInvalidate = sal_False;
#if defined(OV_DRAWGRID)
Color aOldColor ( pView->GetLineColor() );
@@ -755,14 +755,14 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
if( !pCursor )
{
// set cursor to item with focus-flag
- BOOL bfound = FALSE;
- for ( ULONG i = 0; i < pView->GetEntryCount() && !bfound; i++)
+ sal_Bool bfound = sal_False;
+ for ( sal_uLong i = 0; i < pView->GetEntryCount() && !bfound; i++)
{
SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry ( i );
if( pEntry->IsFocused() )
{
pCursor = pEntry;
- bfound=TRUE;
+ bfound=sal_True;
}
}
@@ -774,31 +774,31 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
if ( pView->HasFocus() )
GetFocus();
- ULONG nCount = pZOrderList->Count();
+ sal_uLong nCount = pZOrderList->Count();
if( !nCount )
return;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() )
{
Rectangle aOutputArea( GetOutputRect() );
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( aOutputArea );
}
- const USHORT nListInitSize = aEntries.Count() > USHRT_MAX ?
- USHRT_MAX : (USHORT)aEntries.Count();
+ const sal_uInt16 nListInitSize = aEntries.Count() > USHRT_MAX ?
+ USHRT_MAX : (sal_uInt16)aEntries.Count();
List* pNewZOrderList = new List( nListInitSize );
List* pPaintedEntries = new List( nListInitSize );
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
while( nCount )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos ));
const Rectangle& rBoundRect = GetEntryBoundRect( pEntry );
if( rRect.IsOver( rBoundRect ) )
{
- PaintEntry( pEntry, rBoundRect.TopLeft(), pView, TRUE );
+ PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True );
// Eintraege, die neu gezeichnet werden, auf Top setzen
pPaintedEntries->Insert( pEntry, LIST_APPEND );
}
@@ -813,7 +813,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
nCount = pPaintedEntries->Count();
if( nCount )
{
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
pZOrderList->Insert( pPaintedEntries->GetObject(nCur), LIST_APPEND);
}
delete pPaintedEntries;
@@ -822,20 +822,20 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
pView->SetClipRegion();
}
-void SvxIconChoiceCtrl_Impl::RepaintEntries( USHORT nEntryFlagsMask )
+void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask )
{
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
if( !nCount )
return;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
Rectangle aOutRect( GetOutputRect() );
if( !pView->IsClipRegion() )
{
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( aOutRect );
}
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur));
if( pEntry->GetFlags() & nEntryFlagsMask )
@@ -871,28 +871,28 @@ IcnViewFieldType SvxIconChoiceCtrl_Impl::GetItem( SvxIconChoiceCtrlEntry* pEntry
return IcnViewFieldTypeDontknow;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
+sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
{
- BOOL bHandled = TRUE;
- bHighlightFramePressed = FALSE;
+ sal_Bool bHandled = sal_True;
+ bHighlightFramePressed = sal_False;
StopEditTimer();
- BOOL bGotFocus = (BOOL)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS));
+ sal_Bool bGotFocus = (sal_Bool)(!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS));
if( !(nWinBits & WB_NOPOINTERFOCUS) )
pView->GrabFocus();
Point aDocPos( rMEvt.GetPosPixel() );
if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height())
- return FALSE;
+ return sal_False;
ToDocPos( aDocPos );
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True );
if( pEntry )
- MakeEntryVisible( pEntry, FALSE );
+ MakeEntryVisible( pEntry, sal_False );
if( rMEvt.IsShift() && eSelectionMode != SINGLE_SELECTION )
{
if( pEntry )
- SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), TRUE);
- return TRUE;
+ SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), sal_True);
+ return sal_True;
}
if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // Tastaturselektion?
@@ -923,7 +923,7 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
if( !pEntry && !(nWinBits & WB_NODRAGSELECTION))
pView->StartTracking( STARTTRACK_SCROLLREPEAT );
- return TRUE;
+ return sal_True;
}
else
{
@@ -945,17 +945,17 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
pView->StartTracking( STARTTRACK_SCROLLREPEAT );
}
else
- bHandled = FALSE;
+ bHandled = sal_False;
return bHandled;
}
}
- BOOL bSelected = pEntry->IsSelected();
- BOOL bEditingEnabled = IsEntryEditingEnabled();
+ sal_Bool bSelected = pEntry->IsSelected();
+ sal_Bool bEditingEnabled = IsEntryEditingEnabled();
if( rMEvt.GetClicks() == 2 )
{
DeselectAllBut( pEntry );
- SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True );
pHdlEntry = pEntry;
pView->ClickIcon();
}
@@ -986,8 +986,8 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) )
{
pCurHighlightFrame = 0; // Neues painten des Frames erzwingen
- bHighlightFramePressed = TRUE;
- SetEntryHighlightFrame( pEntry, TRUE );
+ bHighlightFramePressed = sal_True;
+ SetEntryHighlightFrame( pEntry, sal_True );
}
}
else
@@ -996,9 +996,9 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
{
if( !bSelected )
{
- DeselectAllBut( pEntry, TRUE /* Synchron painten */ );
+ DeselectAllBut( pEntry, sal_True /* Synchron painten */ );
SetCursor( pEntry );
- SelectEntry( pEntry, TRUE, TRUE, FALSE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_False, sal_True );
}
else
{
@@ -1018,13 +1018,13 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
return bHandled;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
{
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) ))
{
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
- bHandled = TRUE;
+ bHandled = sal_True;
}
Point aDocPos( rMEvt.GetPosPixel() );
@@ -1037,59 +1037,59 @@ BOOL SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
// Ctrl & MultiSelection
ToggleSelection( pDocEntry );
SetCursor( pDocEntry );
- bHandled = TRUE;
+ bHandled = sal_True;
}
else if( nFlags & F_DOWN_DESELECT )
{
DeselectAllBut( pDocEntry );
SetCursor( pDocEntry );
- SelectEntry( pDocEntry, TRUE, TRUE, FALSE, TRUE );
- bHandled = TRUE;
+ SelectEntry( pDocEntry, sal_True, sal_True, sal_False, sal_True );
+ bHandled = sal_True;
}
}
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
if( nFlags & F_START_EDITTIMER_IN_MOUSEUP )
{
- bHandled = TRUE;
+ bHandled = sal_True;
StartEditTimer();
nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP;
}
if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame)
{
- bHandled = TRUE;
+ bHandled = sal_True;
SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame;
pCurHighlightFrame = 0; // Neues painten des Frames erzwingen
- bHighlightFramePressed = FALSE;
- SetEntryHighlightFrame( pEntry, TRUE );
+ bHighlightFramePressed = sal_False;
+ SetEntryHighlightFrame( pEntry, sal_True );
pHdlEntry = pCurHighlightFrame;
pView->ClickIcon();
// set focus on Icon
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
- SetCursor_Impl( pOldCursor, pHdlEntry, FALSE, FALSE, TRUE );
+ SetCursor_Impl( pOldCursor, pHdlEntry, sal_False, sal_False, sal_True );
pHdlEntry = 0;
}
return bHandled;
}
-BOOL SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt )
{
const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) );
if( pView->IsTracking() )
- return FALSE;
+ return sal_False;
else if( nWinBits & WB_HIGHLIGHTFRAME )
{
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos, sal_True );
SetEntryHighlightFrame( pEntry );
}
else
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
@@ -1113,7 +1113,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
long nScrollDX, nScrollDY;
- CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, FALSE );
+ CalcScrollOffsets( aPosPixel, nScrollDX, nScrollDY, sal_False );
if( nScrollDX || nScrollDY )
{
pView->HideTracking();
@@ -1123,7 +1123,7 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
if( aRect != aCurSelectionRect )
{
pView->HideTracking();
- BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE;
+ sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False;
SelectRect( aRect, bAdd, &aSelectedRectList );
}
pView->ShowTracking( aRect, SHOWTRACK_SMALL | SHOWTRACK_CLIP );
@@ -1131,25 +1131,25 @@ void SvxIconChoiceCtrl_Impl::Tracking( const TrackingEvent& rTEvt )
}
void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
- SvxIconChoiceCtrlEntry* pNewCursor, BOOL bMod1, BOOL bShift, BOOL bPaintSync )
+ SvxIconChoiceCtrlEntry* pNewCursor, sal_Bool bMod1, sal_Bool bShift, sal_Bool bPaintSync )
{
if( pNewCursor )
{
SvxIconChoiceCtrlEntry* pFilterEntry = 0;
- BOOL bDeselectAll = FALSE;
+ sal_Bool bDeselectAll = sal_False;
if( eSelectionMode != SINGLE_SELECTION )
{
if( !bMod1 && !bShift )
- bDeselectAll = TRUE;
+ bDeselectAll = sal_True;
else if( bShift && !bMod1 && !pAnchor )
{
- bDeselectAll = TRUE;
+ bDeselectAll = sal_True;
pFilterEntry = pOldCursor;
}
}
if( bDeselectAll )
DeselectAllBut( pFilterEntry, bPaintSync );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
MakeEntryVisible( pNewCursor );
SetCursor( pNewCursor );
if( bMod1 && !bShift )
@@ -1171,41 +1171,41 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
}
else
{
- SelectEntry( pCursor, TRUE, TRUE, FALSE, bPaintSync );
+ SelectEntry( pCursor, sal_True, sal_True, sal_False, bPaintSync );
aCurSelectionRect = GetEntryBoundRect( pCursor );
}
}
}
-BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bMod2 = rKEvt.GetKeyCode().IsMod2();
+ sal_Bool bMod2 = rKEvt.GetKeyCode().IsMod2();
sal_Unicode cChar = rKEvt.GetCharCode();
- ULONG nPos = (ULONG)-1;
+ sal_uLong nPos = (sal_uLong)-1;
if ( bMod2 && cChar && IsMnemonicChar( cChar, nPos ) )
{
// shortcut is clicked
SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos );
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
if ( pNewCursor != pOldCursor )
- SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE );
- return TRUE;
+ SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False );
+ return sal_True;
}
if ( bMod2 )
// no actions with <ALT>
- return FALSE;
+ return sal_False;
- BOOL bKeyUsed = TRUE;
- BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
- BOOL bShift = rKEvt.GetKeyCode().IsShift();
+ sal_Bool bKeyUsed = sal_True;
+ sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bShift = rKEvt.GetKeyCode().IsShift();
if( eSelectionMode == SINGLE_SELECTION || eSelectionMode == NO_SELECTION)
{
- bShift = FALSE;
- bMod1 = FALSE;
+ bShift = sal_False;
+ bMod1 = sal_False;
}
if( bMod1 )
@@ -1214,7 +1214,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
SvxIconChoiceCtrlEntry* pNewCursor;
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch( nCode )
{
case KEY_UP:
@@ -1223,10 +1223,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
MakeEntryVisible( pCursor );
if( nCode == KEY_UP )
- pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE);
+ pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False);
else
- pNewCursor = pImpCursor->GoPageUpDown(pCursor,FALSE);
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor = pImpCursor->GoPageUpDown(pCursor,sal_False);
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if( !pNewCursor )
{
Rectangle aRect( GetEntryBoundRect( pCursor ) );
@@ -1253,10 +1253,10 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
if( nCode == KEY_DOWN )
- pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE );
+ pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True );
else
- pNewCursor=pImpCursor->GoPageUpDown( pCursor,TRUE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor=pImpCursor->GoPageUpDown( pCursor,sal_True );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if ( bChooseWithCursor && pNewCursor != NULL)
{
@@ -1271,8 +1271,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
case KEY_RIGHT:
if( pCursor )
{
- pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
@@ -1280,8 +1280,8 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
MakeEntryVisible( pCursor );
- pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
if( !pNewCursor )
{
Rectangle aRect( GetEntryBoundRect(pCursor));
@@ -1299,7 +1299,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( !bMod1 && !bShift )
EditTimeoutHdl( 0 );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F8:
@@ -1311,7 +1311,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
nFlags |= F_ADD_MODE;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SPACE:
@@ -1319,12 +1319,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
{
if( !bMod1 )
{
- //SelectAll( FALSE );
+ //SelectAll( sal_False );
SetNoSelection();
ClearSelectedRectList();
// click Icon with spacebar
- SetEntryHighlightFrame( GetCurEntry(), TRUE );
+ SetEntryHighlightFrame( GetCurEntry(), sal_True );
pView->ClickIcon();
pHdlEntry = pCurHighlightFrame;
pCurHighlightFrame=0;
@@ -1353,9 +1353,9 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
case KEY_DIVIDE :
case KEY_A:
if( bMod1 && (eSelectionMode != SINGLE_SELECTION))
- SelectAll( TRUE );
+ SelectAll( sal_True );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SUBTRACT:
@@ -1363,7 +1363,7 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( bMod1 )
SetNoSelection();
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_RETURN:
@@ -1373,14 +1373,14 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
/*pView->*/EditEntry( pCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_END:
if( pCursor )
{
pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( aEntries.Count() - 1 );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
@@ -1388,12 +1388,12 @@ BOOL SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 );
- SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, TRUE );
+ SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True );
}
break;
default:
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
return bKeyUsed;
@@ -1419,7 +1419,7 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig
aVerSBar.SetPosPixel( aPos );
}
-void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL )
+void SvxIconChoiceCtrl_Impl::AdjustScrollBars( sal_Bool )
{
Rectangle aOldOutRect( GetOutputRect() );
long nVirtHeight = aVirtOutputSize.Height();
@@ -1451,7 +1451,7 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars( BOOL )
sal_Bool bNoVerSBar = ( nWinBits & WB_NOVSCROLL ) != 0;
sal_Bool bNoHorSBar = ( nWinBits & WB_NOHSCROLL ) != 0;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
if( nVirtHeight )
{
// activate ver scrollbar ?
@@ -1589,23 +1589,23 @@ void SvxIconChoiceCtrl_Impl::Resize()
VisRectChanged();
}
-BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
+sal_Bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
{
if( !pZOrderList || !aHorSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
long nMostRight = 0;
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur);
long nRight = GetEntryBoundRect(pEntry).Right();
if( nRight > nWidth )
- return FALSE;
+ return sal_False;
if( nRight > nMostRight )
nMostRight = nRight;
}
@@ -1622,28 +1622,28 @@ BOOL SvxIconChoiceCtrl_Impl::CheckHorScrollBar()
aSize.Height() += nHorSBarHeight;
aVerSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
+sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
{
if( !pZOrderList || !aVerSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
if(!( nWinBits & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
- const ULONG nCount = pZOrderList->Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pZOrderList->Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur);
long nBottom = GetEntryBoundRect(pEntry).Bottom();
if( nBottom > nHeight )
- return FALSE;
+ return sal_False;
if( nBottom > nDeepest )
nDeepest = nBottom;
}
@@ -1660,9 +1660,9 @@ BOOL SvxIconChoiceCtrl_Impl::CheckVerScrollBar()
aSize.Width() += nVerSBarWidth;
aHorSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1685,7 +1685,7 @@ void SvxIconChoiceCtrl_Impl::GetFocus()
if( pCursor )
{
pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1694,7 +1694,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
StopEditTimer();
if( pCursor )
pCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// HideFocus ();
// pView->Invalidate ( aFocus.aRect );
@@ -1702,7 +1702,7 @@ void SvxIconChoiceCtrl_Impl::LoseFocus()
RepaintEntries( ICNVIEW_FLAG_SELECTED );
}
-void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate )
+void SvxIconChoiceCtrl_Impl::SetUpdateMode( sal_Bool bUpdate )
{
if( bUpdate != bUpdateMode )
{
@@ -1717,7 +1717,7 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( BOOL bUpdate )
}
}
-void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bIsBackgroundPainted )
+void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted )
{
Point aPos( GetEntryPos( pEntry ) );
PaintEntry( pEntry, aPos, 0, bIsBackgroundPainted );
@@ -1726,8 +1726,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, BOOL bI
// Prios der Emphasis: bDropTarget => bCursored => bSelected
void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const Rectangle& rTextRect, const Rectangle& rImageRect,
- BOOL bSelected, BOOL bDropTarget, BOOL bCursored, OutputDevice* pOut,
- BOOL bIsBackgroundPainted )
+ sal_Bool bSelected, sal_Bool bDropTarget, sal_Bool bCursored, OutputDevice* pOut,
+ sal_Bool bIsBackgroundPainted )
{
static Color aTransparent( COL_TRANSPARENT );
@@ -1747,14 +1747,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const StyleSettings& rSettings = pOut->GetSettings().GetStyleSettings();
Color aOldFillColor( pOut->GetFillColor() );
- BOOL bSolidTextRect = FALSE;
- BOOL bSolidImageRect = FALSE;
+ sal_Bool bSolidTextRect = sal_False;
+ sal_Bool bSolidImageRect = sal_False;
if( bDropTarget && ( eSelectionMode != NO_SELECTION ) )
{
pOut->SetFillColor( rSettings.GetHighlightColor() );
- bSolidTextRect = TRUE;
- bSolidImageRect = TRUE;
+ bSolidTextRect = sal_True;
+ bSolidImageRect = sal_True;
}
else
{
@@ -1767,7 +1767,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
const Color& rFillColor = pView->GetFont().GetFillColor();
pOut->SetFillColor( rFillColor );
if( rFillColor != aTransparent )
- bSolidTextRect = TRUE;
+ bSolidTextRect = sal_True;
}
}
}
@@ -1807,14 +1807,14 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(
void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect,
- IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags,
+ IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags,
OutputDevice* pOut, const String* pStr, ::vcl::ControlLayoutData* _pLayoutData )
{
if( eItem == IcnViewFieldTypeText )
{
String aText;
if( !pStr )
- aText = pView->GetEntryText( pEntry, FALSE );
+ aText = pView->GetEntryText( pEntry, sal_False );
else
aText = *pStr;
@@ -1830,7 +1830,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect,
{
Color aBkgColor( pOut->GetBackground().GetColor() );
Color aFontColor;
- USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
+ sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
if ( nColor > 127 )
aFontColor.SetColor ( COL_BLACK );
else
@@ -1908,19 +1908,19 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr
void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos,
- OutputDevice* pOut, BOOL bIsBackgroundPainted )
+ OutputDevice* pOut, sal_Bool bIsBackgroundPainted )
{
if( !pOut )
pOut = pView;
- BOOL bSelected = FALSE;
+ sal_Bool bSelected = sal_False;
if( eSelectionMode != NO_SELECTION )
bSelected = pEntry->IsSelected();
- BOOL bCursored = pEntry->IsCursored();
- BOOL bDropTarget = pEntry->IsDropTarget();
- BOOL bNoEmphasis = pEntry->IsBlockingEmphasis();
+ sal_Bool bCursored = pEntry->IsCursored();
+ sal_Bool bDropTarget = pEntry->IsDropTarget();
+ sal_Bool bNoEmphasis = pEntry->IsBlockingEmphasis();
Font aTempFont( pOut->GetFont() );
@@ -1932,8 +1932,8 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
}
*/
- String aEntryText( pView->GetEntryText( pEntry, FALSE ) );
- Rectangle aTextRect( CalcTextRect(pEntry,&rPos,FALSE,&aEntryText));
+ String aEntryText( pView->GetEntryText( pEntry, sal_False ) );
+ Rectangle aTextRect( CalcTextRect(pEntry,&rPos,sal_False,&aEntryText));
Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos ) );
sal_Bool bShowSelection =
@@ -1973,14 +1973,14 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
pOut->SetFillColor( );
}
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() && (aVerSBar.IsVisible() || aHorSBar.IsVisible()) )
{
Rectangle aOutputArea( GetOutputRect() );
if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) )
{
pView->SetClipRegion( aOutputArea );
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
}
}
@@ -1996,10 +1996,10 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
#endif
sal_Bool bLargeIconMode = WB_ICON == ( nWinBits & (VIEWMODE_MASK) );
- USHORT nBmpPaintFlags = PAINTFLAG_VER_CENTERED;
+ sal_uInt16 nBmpPaintFlags = PAINTFLAG_VER_CENTERED;
if ( bLargeIconMode )
nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED;
- USHORT nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
+ sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED;
if( !bNoEmphasis )
PaintEmphasis(aTextRect,aBmpRect,bSelected,bDropTarget,bCursored,pOut,bIsBackgroundPainted);
@@ -2015,7 +2015,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
// Highlight-Frame zeichnen
if( pEntry == pCurHighlightFrame && !bNoEmphasis )
- DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), FALSE );
+ DrawHighlightFrame( pOut, CalcFocusRect( pEntry ), sal_False );
pOut->SetFont( aTempFont );
if( bResetClipRegion )
@@ -2023,15 +2023,15 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
}
void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos,
- BOOL bAdjustAtGrid, BOOL bCheckScrollBars, BOOL bKeepGridMap )
+ sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars, sal_Bool bKeepGridMap )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
Rectangle aBoundRect( GetEntryBoundRect( pEntry ));
pView->Invalidate( aBoundRect );
ToTop( pEntry );
if( !IsAutoArrange() )
{
- BOOL bAdjustVirtSize = FALSE;
+ sal_Bool bAdjustVirtSize = sal_False;
if( rPos != aBoundRect.TopLeft() )
{
Point aGridOffs(
@@ -2042,7 +2042,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
aBoundRect.SetPos( rPos );
pEntry->aRect = aBoundRect;
pEntry->aGridRect.SetPos( rPos + aGridOffs );
- bAdjustVirtSize = TRUE;
+ bAdjustVirtSize = sal_True;
}
if( bAdjustAtGrid )
{
@@ -2061,7 +2061,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) );
Rectangle aNewBoundRect( aNewPos, pEntry->aRect.GetSize());
AdjustVirtSize( aNewBoundRect );
- bAdjustVirtSize = FALSE;
+ bAdjustVirtSize = sal_False;
}
AdjustEntryAtGrid( pEntry );
ToTop( pEntry );
@@ -2081,7 +2081,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
SetEntryPredecessor( pEntry, pPrev );
aAutoArrangeTimer.Start();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::SetNoSelection()
@@ -2090,16 +2090,16 @@ void SvxIconChoiceCtrl_Impl::SetNoSelection()
if( !(nFlags & F_CLEARING_SELECTION ))
{
nFlags |= F_CLEARING_SELECTION;
- DeselectAllBut( 0, TRUE );
+ DeselectAllBut( 0, sal_True );
nFlags &= ~F_CLEARING_SELECTION;
}
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, BOOL bHit )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, sal_Bool bHit )
{
CheckBoundingRects();
// Z-Order-Liste vom Ende her absuchen
- ULONG nCount = pZOrderList->Count();
+ sal_uLong nCount = pZOrderList->Count();
while( nCount )
{
nCount--;
@@ -2130,11 +2130,11 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( const Point& rDocP
{
CheckBoundingRects();
SvxIconChoiceCtrlEntry* pTarget = 0;
- const ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ const sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != LIST_ENTRY_NOTFOUND )
{
- const ULONG nCount = pZOrderList->Count();
- for( ULONG nCur = nStartPos+1; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pZOrderList->Count();
+ for( sal_uLong nCur = nStartPos+1; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur));
if( pEntry->aRect.IsInside( rDocPos ) )
@@ -2151,7 +2151,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetPrevEntry( const Point& rDocP
{
CheckBoundingRects();
SvxIconChoiceCtrlEntry* pTarget = 0;
- ULONG nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != LIST_ENTRY_NOTFOUND && nStartPos != 0 )
{
nStartPos--;
@@ -2173,7 +2173,7 @@ Point SvxIconChoiceCtrl_Impl::GetEntryPos( SvxIconChoiceCtrlEntry* pEntry )
return pEntry->aRect.TopLeft();
}
-void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, BOOL bBound )
+void SvxIconChoiceCtrl_Impl::MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound )
{
if ( bBound )
{
@@ -2227,7 +2227,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pEntry, c
}
Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry,
- const Point* pEntryPos, BOOL bEdit, const String* pStr )
+ const Point* pEntryPos, sal_Bool bEdit, const String* pStr )
{
String aEntryText;
if( !pStr )
@@ -2345,8 +2345,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects()
{
nMaxBoundHeight = 0;
pZOrderList->Clear();
- ULONG nCount = aEntries.Count();
- ULONG nCur;
+ sal_uLong nCount = aEntries.Count();
+ sal_uLong nCur;
SvxIconChoiceCtrlEntry* pEntry;
if( !IsAutoArrange() || !pHead )
@@ -2371,7 +2371,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects()
nCur++;
}
}
- bBoundRectsDirty = FALSE;
+ bBoundRectsDirty = sal_False;
AdjustScrollBars();
}
@@ -2379,9 +2379,9 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart()
{
nMaxBoundHeight = 0;
pZOrderList->Clear();
- ULONG nCur;
+ sal_uLong nCur;
SvxIconChoiceCtrlEntry* pEntry;
- const ULONG nCount = aEntries.Count();
+ const sal_uLong nCount = aEntries.Count();
if( !IsAutoArrange() || !pHead )
{
@@ -2424,8 +2424,8 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart()
void SvxIconChoiceCtrl_Impl::UpdateBoundingRects()
{
- const ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
GetEntryBoundRect( pEntry );
@@ -2441,7 +2441,7 @@ void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry )
return;
}
Size aSize( CalcBoundingSize( pEntry ) );
- Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(TRUE)).TopLeft());
+ Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid(sal_True)).TopLeft());
SetBoundingRect_Impl( pEntry, aPos, aSize );
}
@@ -2456,33 +2456,33 @@ void SvxIconChoiceCtrl_Impl::SetBoundingRect_Impl( SvxIconChoiceCtrlEntry* pEntr
}
-void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSyncSingleSelection,
- BOOL bShowFocusAsync )
+void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSyncSingleSelection,
+ sal_Bool bShowFocusAsync )
{
if( pEntry == pCursor )
{
if( pCursor && eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection &&
!pCursor->IsSelected() )
- SelectEntry( pCursor, TRUE, TRUE );
+ SelectEntry( pCursor, sal_True, sal_True );
return;
}
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
pCursor = pEntry;
if( pOldCursor )
{
pOldCursor->ClearFlags( ICNVIEW_FLAG_FOCUSED );
if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection )
- SelectEntry( pOldCursor, FALSE, TRUE ); // alten Cursor deselektieren
+ SelectEntry( pOldCursor, sal_False, sal_True ); // alten Cursor deselektieren
}
if( pCursor )
{
ToTop( pCursor );
pCursor->SetFlags( ICNVIEW_FLAG_FOCUSED );
if( eSelectionMode == SINGLE_SELECTION && bSyncSingleSelection )
- SelectEntry( pCursor, TRUE, TRUE );
+ SelectEntry( pCursor, sal_True, sal_True );
if( !bShowFocusAsync )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
else
{
if( !nUserEventShowCursor )
@@ -2494,7 +2494,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry, BOOL bSy
}
-void SvxIconChoiceCtrl_Impl::ShowCursor( BOOL bShow )
+void SvxIconChoiceCtrl_Impl::ShowCursor( sal_Bool bShow )
{
if( !pCursor || !bShow || !pView->HasFocus() )
{
@@ -2533,7 +2533,7 @@ void SvxIconChoiceCtrl_Impl::ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, cons
DELETEZ(pDDDev);
DELETEZ(pDDBufDev);
}
- BOOL bSelected = pRefEntry->IsSelected();
+ sal_Bool bSelected = pRefEntry->IsSelected();
pRefEntry->ClearFlags( ICNVIEW_FLAG_SELECTED );
if( !pDDDev )
{
@@ -2670,16 +2670,16 @@ void SvxIconChoiceCtrl_Impl::InvalidateBoundingRect( SvxIconChoiceCtrlEntry* pEn
}
-BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
+sal_Bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
{
Rectangle aDocRect( GetDocumentRect() );
Rectangle aVisRect( GetVisibleRect() );
if( aVisRect.IsInside( aDocRect ))
- return FALSE;
+ return sal_False;
Size aDocSize( aDocRect.GetSize() );
Size aVisSize( aVisRect.GetSize() );
- BOOL bHor = aDocSize.Width() > aVisSize.Width();
- BOOL bVer = aDocSize.Height() > aVisSize.Height();
+ sal_Bool bHor = aDocSize.Width() > aVisSize.Width();
+ sal_Bool bVer = aDocSize.Height() > aVisSize.Height();
long nScrollDX = 0, nScrollDY = 0;
@@ -2688,7 +2688,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
case COMMAND_STARTAUTOSCROLL:
{
pView->EndTracking();
- USHORT nScrollFlags = 0;
+ sal_uInt16 nScrollFlags = 0;
if( bHor )
nScrollFlags |= AUTOSCROLL_HORZ;
if( bVer )
@@ -2696,7 +2696,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
if( nScrollFlags )
{
pView->StartAutoScroll( nScrollFlags );
- return TRUE;
+ return sal_True;
}
}
break;
@@ -2706,7 +2706,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
const CommandWheelData* pData = rCmd.GetWheelData();
if( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) && !pData->IsHorz() )
{
- ULONG nScrollLines = pData->GetScrollLines();
+ sal_uLong nScrollLines = pData->GetScrollLines();
if( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
nScrollDY = GetScrollBarPageSize( aVisSize.Width() );
@@ -2741,9 +2741,9 @@ BOOL SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
aVisRect.Left() -= nScrollDX;
aVisRect.Right() -= nScrollDX;
MakeVisible( aVisRect );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -2770,7 +2770,7 @@ void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry )
{
if( pZOrderList->GetObject( pZOrderList->Count() - 1 ) != pEntry )
{
- ULONG nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos );
pZOrderList->Insert( pEntry, LIST_APPEND );
}
@@ -2790,10 +2790,10 @@ void SvxIconChoiceCtrl_Impl::ClipAtVirtOutRect( Rectangle& rRect ) const
// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der
// sichtbar gemacht werden soll.
-// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
+// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
-void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
- BOOL bCallRectChangedHdl )
+void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar,
+ sal_Bool bCallRectChangedHdl )
{
Rectangle aVirtRect( rRect );
ClipAtVirtOutRect( aVirtRect );
@@ -2839,7 +2839,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
{
HideDDIcon();
pView->Update();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
}
// Origin fuer SV invertieren (damit wir in
@@ -2847,7 +2847,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
aOrigin *= -1;
SetOrigin( aOrigin );
- BOOL bScrollable = pView->GetBackground().IsScrollable();
+ sal_Bool bScrollable = pView->GetBackground().IsScrollable();
if( pView->HasBackground() && !bScrollable )
{
Rectangle aRect( GetOutputRect());
@@ -2879,7 +2879,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const Rectangle& rRect, BOOL bScrBar,
}
if( GetUpdateMode() )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
// pruefen, ob ScrollBars noch benoetigt werden
CheckScrollBars();
@@ -2900,15 +2900,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor()
SvxIconChoiceCtrlEntry* pNewCursor;
if( pCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False );
if( !pNewCursor )
- pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True );
}
}
}
@@ -2918,7 +2918,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor()
return pNewCursor;
}
-ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const
+sal_uLong SvxIconChoiceCtrl_Impl::GetSelectionCount() const
{
if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame )
return 1;
@@ -2927,27 +2927,27 @@ ULONG SvxIconChoiceCtrl_Impl::GetSelectionCount() const
void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry )
{
- BOOL bSel;
+ sal_Bool bSel;
if( pEntry->IsSelected() )
- bSel = FALSE;
+ bSel = sal_False;
else
- bSel = TRUE;
- SelectEntry( pEntry, bSel, TRUE, TRUE );
+ bSel = sal_True;
+ SelectEntry( pEntry, bSel, sal_True, sal_True );
}
void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryNot,
- BOOL bPaintSync )
+ sal_Bool bPaintSync )
{
ClearSelectedRectList();
//
// !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!!
//
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry != pThisEntryNot && pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, bPaintSync );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, bPaintSync );
}
pAnchor = 0;
nFlags &= (~F_ADD_MODE);
@@ -3083,7 +3083,7 @@ void SvxIconChoiceCtrl_Impl::Center( SvxIconChoiceCtrlEntry* pEntry ) const
// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird
// links, hoch: Offsets < 0
// rechts, runter: Offsets > 0
-void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar )
+void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar )
{
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
@@ -3136,7 +3136,7 @@ static Rectangle GetHotSpot( const Rectangle& rRect )
}
void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2,
- BOOL bAdd, SvPtrarr* pOtherRects )
+ sal_Bool bAdd, SvPtrarr* pOtherRects )
{
DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr");
Rectangle aRect( GetEntryBoundRect( pEntry1 ) );
@@ -3144,7 +3144,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIco
SelectRect( aRect, bAdd, pOtherRects );
}
-void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pOtherRects )
{
aCurSelectionRect = rRect;
@@ -3152,53 +3152,53 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
return;
// Flag setzen, damit im Select kein ToTop gerufen wird
- BOOL bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? TRUE : FALSE;
+ sal_Bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? sal_True : sal_False;
nFlags |= F_SELECTING_RECT;
CheckBoundingRects();
pView->Update();
- const ULONG nCount = pZOrderList->Count();
+ const sal_uLong nCount = pZOrderList->Count();
Rectangle aRect( rRect );
aRect.Justify();
- BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE;
+ sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False;
- BOOL bResetClipRegion = FALSE;
+ sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() )
{
- bResetClipRegion = TRUE;
+ bResetClipRegion = sal_True;
pView->SetClipRegion( GetOutputRect() );
}
- for( ULONG nPos = 0; nPos < nCount; nPos++ )
+ for( sal_uLong nPos = 0; nPos < nCount; nPos++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos ));
if( !IsBoundingRectValid( pEntry->aRect ))
FindBoundingRect( pEntry );
Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) );
- BOOL bSelected = pEntry->IsSelected();
+ sal_Bool bSelected = pEntry->IsSelected();
- BOOL bOverlaps;
+ sal_Bool bOverlaps;
if( bCalcOverlap )
bOverlaps = IsOver( pOtherRects, aBoundRect );
else
- bOverlaps = FALSE;
- BOOL bOver = aRect.IsOver( aBoundRect );
+ bOverlaps = sal_False;
+ sal_Bool bOver = aRect.IsOver( aBoundRect );
if( bOver && !bOverlaps )
{
// Ist im neuen Selektionsrechteck und in keinem alten
// => selektieren
if( !bSelected )
- SelectEntry( pEntry, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True );
}
else if( !bAdd )
{
// ist ausserhalb des Selektionsrechtecks
// => Selektion entfernen
if( bSelected )
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
else if( bAdd && bOverlaps )
{
@@ -3218,19 +3218,19 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
{
// Schnittmenge zwischen alten Rects & aktuellem Rect desel.
if( bSelected )
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
else
{
// Eintrag eines alten Rects selektieren
if( !bSelected )
- SelectEntry( pEntry, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True );
}
}
else if( !bOver && bSelected )
{
// Der Eintrag liegt voellig ausserhalb und wird deshalb desel.
- SelectEntry( pEntry, FALSE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True );
}
}
@@ -3245,13 +3245,13 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, BOOL bAdd,
void SvxIconChoiceCtrl_Impl::SelectRange(
SvxIconChoiceCtrlEntry* pStart,
SvxIconChoiceCtrlEntry* pEnd,
- BOOL bAdd )
+ sal_Bool bAdd )
{
- ULONG nFront = GetEntryListPos( pStart );
- ULONG nBack = GetEntryListPos( pEnd );
- ULONG nFirst = std::min( nFront, nBack );
- ULONG nLast = std::max( nFront, nBack );
- ULONG i;
+ sal_uLong nFront = GetEntryListPos( pStart );
+ sal_uLong nBack = GetEntryListPos( pEnd );
+ sal_uLong nFirst = std::min( nFront, nBack );
+ sal_uLong nLast = std::max( nFront, nBack );
+ sal_uLong i;
SvxIconChoiceCtrlEntry* pEntry;
if ( ! bAdd )
@@ -3262,7 +3262,7 @@ void SvxIconChoiceCtrl_Impl::SelectRange(
{
pEntry = GetEntry( i );
if( pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True );
}
}
@@ -3271,33 +3271,33 @@ void SvxIconChoiceCtrl_Impl::SelectRange(
{
pEntry = GetEntry( i );
if( ! pEntry->IsSelected() )
- SelectEntry( pEntry, TRUE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True, sal_True, sal_True );
}
if ( ! bAdd )
{
// deselect everything behind the last entry if not in
// adding mode
- ULONG nEnd = GetEntryCount();
+ sal_uLong nEnd = GetEntryCount();
for ( ; i<nEnd; i++ )
{
pEntry = GetEntry( i );
if( pEntry->IsSelected() )
- SelectEntry( pEntry, FALSE, TRUE, TRUE, TRUE );
+ SelectEntry( pEntry, sal_False, sal_True, sal_True, sal_True );
}
}
}
-BOOL SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+sal_Bool SvxIconChoiceCtrl_Impl::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
{
- const USHORT nCount = pRectList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = pRectList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
if( rBoundRect.IsOver( *pRect ))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1,
@@ -3318,8 +3318,8 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( const Rectangle& rRect )
void SvxIconChoiceCtrl_Impl::ClearSelectedRectList()
{
- const USHORT nCount = aSelectedRectList.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = aSelectedRectList.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
delete pRect;
@@ -3328,7 +3328,7 @@ void SvxIconChoiceCtrl_Impl::ClearSelectedRectList()
}
void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel,
- long& rX, long& rY, BOOL isInDragDrop, USHORT nBorderWidth)
+ long& rX, long& rY, sal_Bool isInDragDrop, sal_uInt16 nBorderWidth)
{
// Scrolling der View, falls sich der Mauszeiger im Grenzbereich des
// Fensters befindet
@@ -3336,8 +3336,8 @@ void SvxIconChoiceCtrl_Impl::CalcScrollOffsets( const Point& rPosPixel,
long nPixelToScrollY = 0;
Size aWndSize = aOutputSize;
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
if ( rPosPixel.X() < nBorderWidth )
{
@@ -3398,16 +3398,16 @@ void SvxIconChoiceCtrl_Impl::PrepareCommandEvent( const CommandEvent& rCEvt )
StopEditTimer();
SvxIconChoiceCtrlEntry* pEntry = pView->GetEntry( rCEvt.GetMousePosPixel() );
if( (nFlags & F_DOWN_CTRL) && pEntry && !pEntry->IsSelected() )
- SelectEntry( pEntry, TRUE, TRUE );
+ SelectEntry( pEntry, sal_True, sal_True );
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
}
-BOOL SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos )
+sal_Bool SvxIconChoiceCtrl_Impl::IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos )
{
Rectangle aRect( CalcTextRect( pEntry ));
if( aRect.IsInside( rDocPos ) )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
IMPL_LINK(SvxIconChoiceCtrl_Impl, EditTimeoutHdl, Timer*, EMPTYARG )
@@ -3433,8 +3433,8 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart )
{
SvPtrarr aLists;
pImpCursor->CreateGridAjustData( aLists, pStart );
- const USHORT nCount = aLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = aLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart );
IcnCursor_Impl::DestroyGridAdjustData( aLists );
CheckScrollBars();
@@ -3446,18 +3446,18 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCt
if( !rRow.Count() )
return;
- BOOL bGo;
+ sal_Bool bGo;
if( !pStart )
- bGo = TRUE;
+ bGo = sal_True;
else
- bGo = FALSE;
+ bGo = sal_False;
long nCurRight = 0;
- for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ )
{
SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)rRow[ nCur ];
if( !bGo && pCur == pStart )
- bGo = TRUE;
+ bGo = sal_True;
//SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
// Massgebend (fuer unser Auge) ist die Bitmap, da sonst
@@ -3521,7 +3521,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode,
if( eTextMode == IcnShowTextDontKnow )
eTextMode = IcnShowTextShort;
eTextMode = eMode;
- Arrange( TRUE );
+ Arrange( sal_True );
}
}
else
@@ -3575,20 +3575,20 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( Rectangle& rRect )
{
Color aBkgColor ( pView->GetBackground().GetColor() );
Color aPenColor;
- USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
+ sal_uInt16 nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3;
if ( nColor > 128 )
aPenColor.SetColor ( COL_BLACK );
else
aPenColor.SetColor( COL_WHITE );
- aFocus.bOn = TRUE;
+ aFocus.bOn = sal_True;
aFocus.aPenColor = aPenColor;
aFocus.aRect = rRect;
}
void SvxIconChoiceCtrl_Impl::HideFocus ()
{
- aFocus.bOn = FALSE;
+ aFocus.bOn = sal_False;
}
void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut )
@@ -3608,12 +3608,12 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect ( OutputDevice* pOut )
pOut->DrawPolyLine ( aPolygon, aLineInfo );
}
-BOOL SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, ULONG& rPos ) const
+sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const
{
sal_Bool bRet = sal_False;
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- ULONG nEntryCount = GetEntryCount();
- for ( ULONG i = 0; i < nEntryCount; ++i )
+ sal_uLong nEntryCount = GetEntryCount();
+ for ( sal_uLong i = 0; i < nEntryCount; ++i )
{
if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) )
{
@@ -3639,7 +3639,7 @@ IMPL_LINK(SvxIconChoiceCtrl_Impl, UserEventHdl, void*, nId )
else if( nId == EVENTID_SHOW_CURSOR )
{
nUserEventShowCursor = 0;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
return 0;
}
@@ -3661,12 +3661,12 @@ void SvxIconChoiceCtrl_Impl::CancelUserEvents()
void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Invalidate( pEntry->aRect );
Center( pEntry );
pView->Invalidate( pEntry->aRect );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry )
@@ -3675,13 +3675,13 @@ void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry )
if( !pEntry )
return;
- StopEntryEditing( TRUE );
+ StopEntryEditing( sal_True );
DELETEZ(pEdit);
SetNoSelection();
pCurEditedEntry = pEntry;
- String aEntryText( pView->GetEntryText( pEntry, TRUE ) );
- Rectangle aRect( CalcTextRect( pEntry, 0, TRUE, &aEntryText ) );
+ String aEntryText( pView->GetEntryText( pEntry, sal_True ) );
+ Rectangle aRect( CalcTextRect( pEntry, 0, sal_True, &aEntryText ) );
MakeVisible( aRect );
Point aPos( aRect.TopLeft() );
aPos = pView->GetPixelPos( aPos );
@@ -3722,7 +3722,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG
if( pView->EditedEntry( pCurEditedEntry, aText, pEdit->EditingCanceled() ) )
InvalidateEntry( pCurEditedEntry );
if( !GetSelectionCount() )
- SelectEntry( pCurEditedEntry, TRUE );
+ SelectEntry( pCurEditedEntry, sal_True );
pEdit->Hide();
if( pEdit->IsGrabFocus() )
@@ -3733,13 +3733,13 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, TextEditEndedHdl, IcnViewEdit_Impl*, EMPTYARG
return 0;
}
-void SvxIconChoiceCtrl_Impl::StopEntryEditing( BOOL bCancel )
+void SvxIconChoiceCtrl_Impl::StopEntryEditing( sal_Bool bCancel )
{
if( pEdit )
pEdit->StopEditing( bCancel );
}
-void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL bLock )
+void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock )
{
if( bLock )
pEntry->SetFlags( ICNVIEW_FLAG_POS_LOCKED );
@@ -3747,7 +3747,7 @@ void SvxIconChoiceCtrl_Impl::LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, BOOL
pEntry->ClearFlags( ICNVIEW_FLAG_POS_LOCKED );
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rPos ) const
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong& rPos ) const
{
if( !GetSelectionCount() )
return 0;
@@ -3758,10 +3758,10 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP
return pCurHighlightFrame;
}
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( !pHead )
{
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry->IsSelected() )
@@ -3793,14 +3793,14 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( ULONG& rP
}
// kein Round Robin!
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rStartPos ) const
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uLong& rStartPos ) const
{
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( rStartPos > nCount || !GetSelectionCount() )
return 0;
if( !pHead )
{
- for( ULONG nCur = rStartPos+1; nCur < nCount; nCur++ )
+ for( sal_uLong nCur = rStartPos+1; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
if( pEntry->IsSelected() )
@@ -3829,15 +3829,15 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( ULONG& rSt
return 0;
}
-void SvxIconChoiceCtrl_Impl::SelectAll( BOOL bSelect, BOOL bPaint )
+void SvxIconChoiceCtrl_Impl::SelectAll( sal_Bool bSelect, sal_Bool bPaint )
{
- bPaint = TRUE;
+ bPaint = sal_True;
- ULONG nCount = aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ )
+ sal_uLong nCount = aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur );
- SelectEntry( pEntry, bSelect, TRUE, TRUE, bPaint );
+ SelectEntry( pEntry, bSelect, sal_True, sal_True, bPaint );
}
nFlags &= (~F_ADD_MODE);
pAnchor = 0;
@@ -3847,7 +3847,7 @@ void SvxIconChoiceCtrl_Impl::SaveSelection( List** ppList )
{
if( !*ppList )
*ppList = new List;
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pEntry = GetFirstSelectedEntry( nPos );
while( pEntry && GetSelectionCount() != (*ppList)->Count() )
{
@@ -3860,12 +3860,12 @@ IcnViewEdit_Impl::IcnViewEdit_Impl( SvtIconChoiceCtrl* pParent, const Point& rPo
const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd ) :
MultiLineEdit( pParent, (pParent->GetStyle() & WB_ICON) ? WB_CENTER : WB_LEFT),
aCallBackHdl( rNotifyEditEnd ),
- bCanceled( FALSE ),
- bAlreadyInCallback( FALSE ),
- bGrabFocus( FALSE )
+ bCanceled( sal_False ),
+ bAlreadyInCallback( sal_False ),
+ bGrabFocus( sal_False )
{
Font aFont( pParent->GetPointFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
SetControlFont( aFont );
if( !pParent->HasFontFillColor() )
{
@@ -3905,7 +3905,7 @@ void IcnViewEdit_Impl::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallback )
{
- bAlreadyInCallback = TRUE;
+ bAlreadyInCallback = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
Hide();
@@ -3921,16 +3921,16 @@ IMPL_LINK( IcnViewEdit_Impl, Timeout_Impl, Timer*, EMPTYARG )
IMPL_LINK( IcnViewEdit_Impl, ReturnHdl_Impl, Accelerator*, EMPTYARG )
{
- bCanceled = FALSE;
- bGrabFocus = TRUE;
+ bCanceled = sal_False;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
return 1;
}
IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG )
{
- bCanceled = TRUE;
- bGrabFocus = TRUE;
+ bCanceled = sal_True;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
return 1;
}
@@ -3938,19 +3938,19 @@ IMPL_LINK( IcnViewEdit_Impl, EscapeHdl_Impl, Accelerator*, EMPTYARG )
void IcnViewEdit_Impl::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aCode = rKEvt.GetKeyCode();
- USHORT nCode = aCode.GetCode();
+ sal_uInt16 nCode = aCode.GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
- bGrabFocus = TRUE;
+ bCanceled = sal_True;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
break;
case KEY_RETURN:
- bCanceled = FALSE;
- bGrabFocus = TRUE;
+ bCanceled = sal_False;
+ bGrabFocus = sal_True;
CallCallBackHdl_Impl();
break;
@@ -3966,7 +3966,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt )
if ( !bAlreadyInCallback &&
((!Application::GetFocusWindow()) || !IsChild(Application::GetFocusWindow())))
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,IcnViewEdit_Impl,Timeout_Impl));
aTimer.Start();
@@ -3975,7 +3975,7 @@ long IcnViewEdit_Impl::PreNotify( NotifyEvent& rNEvt )
return 0;
}
-void IcnViewEdit_Impl::StopEditing( BOOL bCancel )
+void IcnViewEdit_Impl::StopEditing( sal_Bool bCancel )
{
if ( !bAlreadyInCallback )
{
@@ -3984,22 +3984,22 @@ void IcnViewEdit_Impl::StopEditing( BOOL bCancel )
}
}
-ULONG SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
{
if( !(nFlags & F_ENTRYLISTPOS_VALID ))
((SvxIconChoiceCtrl_Impl*)this)->SetListPositions();
return pEntry->nPos;
}
-void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, ULONG nNewPos )
+void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, sal_uLong nNewPos )
{
- ULONG nCurPos = GetEntryListPos( pListEntry );
+ sal_uLong nCurPos = GetEntryListPos( pListEntry );
if( nCurPos == nNewPos )
return;
aEntries.List::Remove( nCurPos );
aEntries.List::Insert( (void*)pListEntry, nNewPos );
// Eintragspositionen anpassen
- ULONG nStart, nEnd;
+ sal_uLong nStart, nEnd;
if( nNewPos < nCurPos )
{
nStart = nNewPos;
@@ -4017,19 +4017,19 @@ void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry
}
}
-void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, USHORT nEntryFlags )
+void SvxIconChoiceCtrl_Impl::SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nEntryFlags )
{
pEntry->nFlags = nEntryFlags;
if( nEntryFlags & ICNVIEW_FLAG_POS_MOVED )
nFlags |= F_MOVED_ENTRIES;
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, BOOL bRight )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pStart, sal_Bool bRight )
{
return pImpCursor->GoLeftRight( pStart, bRight );
}
-SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown )
+SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown )
{
return pImpCursor->GoUpDown( pStart, bDown );
}
@@ -4080,14 +4080,14 @@ void SvxIconChoiceCtrl_Impl::InitSettings()
}
}
-EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nInitSize , USHORT _nReSize ) :
+EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nInitSize , sal_uInt16 _nReSize ) :
List( _nInitSize, _nReSize ),
_pOwner( pOwner )
{
_pOwner->pHead = 0;
}
-EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) :
+EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
List( _nBlockSize, _nInitSize, _nReSize ),
_pOwner( pOwner )
{
@@ -4105,14 +4105,14 @@ void EntryList_Impl::Clear()
List::Clear();
}
-void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, ULONG nPos )
+void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos )
{
List::Insert( pEntry, nPos );
if( _pOwner->pHead )
pEntry->SetBacklink( _pOwner->pHead->pblink );
}
-SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( ULONG nPos )
+SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( sal_uLong nPos )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)List::Remove( nPos );
DBG_ASSERT(pEntry,"EntryList_Impl::Remove > Entry not found");
@@ -4146,14 +4146,14 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry )
void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMode )
{
- ULONG nCur;
+ sal_uLong nCur;
if( eMode == ePositionMode )
return;
SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode;
ePositionMode = eMode;
- ULONG nCount = aEntries.Count();
+ sal_uLong nCount = aEntries.Count();
if( eOldMode == IcnViewPositionModeAutoArrange )
{
@@ -4222,12 +4222,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
if( pEntry == pPredecessor )
return;
- ULONG nPos1 = GetEntryListPos( pEntry );
+ sal_uLong nPos1 = GetEntryListPos( pEntry );
if( !pHead )
{
if( pPredecessor )
{
- ULONG nPos2 = GetEntryListPos( pPredecessor );
+ sal_uLong nPos2 = GetEntryListPos( pPredecessor );
if( nPos1 == (nPos2 + 1) )
return; // ist schon Vorgaenger
}
@@ -4241,16 +4241,16 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
if( !pPredecessor && pHead == pEntry )
return; // ist schon der Erste
- BOOL bSetHead = FALSE;
+ sal_Bool bSetHead = sal_False;
if( !pPredecessor )
{
- bSetHead = TRUE;
+ bSetHead = sal_True;
pPredecessor = pHead->pblink;
}
if( pEntry == pHead )
{
pHead = pHead->pflink;
- bSetHead = FALSE;
+ bSetHead = sal_False;
}
if( pEntry != pPredecessor )
{
@@ -4263,12 +4263,12 @@ void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
aAutoArrangeTimer.Start();
}
-BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
+sal_Bool SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
SvxIconChoiceCtrlEntry** ppPredecessor )
{
*ppPredecessor = 0;
if( !pHead )
- return FALSE;
+ return sal_False;
DBG_ASSERT(pEntry->pblink,"GetEntryPredecessor: Backward link not set");
DBG_ASSERT(pEntry->pflink,"GetEntryPredecessor: Forward link not set");
@@ -4276,14 +4276,14 @@ BOOL SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry
{
SvxIconChoiceCtrlEntry* pFirst = (SvxIconChoiceCtrlEntry*)aEntries.GetObject(0);
if( pFirst != pEntry )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
*ppPredecessor = pEntry->pblink;
if( !(pEntry->nFlags & ICNVIEW_FLAG_PRED_SET) &&
(GetEntryListPos( *ppPredecessor ) + 1) == GetEntryListPos( pEntry ))
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry,
@@ -4292,8 +4292,8 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho
Point aPos( rPosTopLeft ); //TopLeft
Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos ));
Point aNewPos( aCenterRect.Center() );
- ULONG nGrid = GetPredecessorGrid( aNewPos );
- ULONG nCount = aEntries.Count();
+ sal_uLong nGrid = GetPredecessorGrid( aNewPos );
+ sal_uLong nCount = aEntries.Count();
if( nGrid == ULONG_MAX )
return 0;
if( nGrid >= nCount )
@@ -4303,26 +4303,26 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho
SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0
// todo: Liste von hinten aufrollen wenn nGrid > nCount/2
- for( ULONG nCur = 0; nCur < nGrid; nCur++ )
+ for( sal_uLong nCur = 0; nCur < nGrid; nCur++ )
pCur = pCur->pflink;
return pCur;
}
-ULONG SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const
{
Point aPos( rPos );
aPos.X() -= LROFFS_WINBORDER;
aPos.Y() -= TBOFFS_WINBORDER;
- USHORT nMaxCol = (USHORT)(aVirtOutputSize.Width() / nGridDX);
+ sal_uInt16 nMaxCol = (sal_uInt16)(aVirtOutputSize.Width() / nGridDX);
if( nMaxCol )
nMaxCol--;
- USHORT nGridX = (USHORT)(aPos.X() / nGridDX);
+ sal_uInt16 nGridX = (sal_uInt16)(aPos.X() / nGridDX);
if( nGridX > nMaxCol )
nGridX = nMaxCol;
- USHORT nGridY = (USHORT)(aPos.Y() / nGridDY);
- USHORT nGridsX = (USHORT)(aOutputSize.Width() / nGridDX);
- ULONG nGrid = (nGridY * nGridsX) + nGridX;
+ sal_uInt16 nGridY = (sal_uInt16)(aPos.Y() / nGridDY);
+ sal_uInt16 nGridsX = (sal_uInt16)(aOutputSize.Width() / nGridDX);
+ sal_uLong nGrid = (nGridY * nGridsX) + nGridX;
long nMiddle = (nGridX * nGridDX) + (nGridDX / 2);
if( rPos.X() < nMiddle )
{
@@ -4342,27 +4342,27 @@ void SvxIconChoiceCtrl_Impl::Flush()
}
}
-BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
{
if ( !(rHEvt.GetMode() & HELPMODE_QUICK ) )
- return FALSE;
+ return sal_False;
Point aPos( pView->ScreenToOutputPixel(rHEvt.GetMousePosPixel() ) );
aPos -= pView->GetMapMode().GetOrigin();
- SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, TRUE );
+ SvxIconChoiceCtrlEntry* pEntry = GetEntry( aPos, sal_True );
if ( !pEntry )
- return FALSE;
+ return sal_False;
String sQuickHelpText = pEntry->GetQuickHelpText();
- String aEntryText( pView->GetEntryText( pEntry, FALSE ) );
- Rectangle aTextRect( CalcTextRect( pEntry, 0, FALSE, &aEntryText ) );
+ String aEntryText( pView->GetEntryText( pEntry, sal_False ) );
+ Rectangle aTextRect( CalcTextRect( pEntry, 0, sal_False, &aEntryText ) );
if ( ( !aTextRect.IsInside( aPos ) || !aEntryText.Len() ) && !sQuickHelpText.Len() )
- return FALSE;
+ return sal_False;
Rectangle aOptTextRect( aTextRect );
aOptTextRect.Bottom() = LONG_MAX;
- USHORT nNewFlags = nCurTextDrawFlags;
+ sal_uInt16 nNewFlags = nCurTextDrawFlags;
nNewFlags &= ~( TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS );
aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
if ( aOptTextRect != aTextRect || sQuickHelpText.Len() > 0 )
@@ -4383,7 +4383,7 @@ BOOL SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
Help::ShowQuickHelp( (Window*)pView, aOptTextRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER );
}
- return TRUE;
+ return sal_True;
}
void SvxIconChoiceCtrl_Impl::ClearColumnList()
@@ -4391,8 +4391,8 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList()
if( !pColumns )
return;
- const USHORT nCount = pColumns->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = pColumns->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlColumnInfo* pInfo = (SvxIconChoiceCtrlColumnInfo*)
pColumns->GetObject( nCur );
@@ -4401,7 +4401,7 @@ void SvxIconChoiceCtrl_Impl::ClearColumnList()
DELETEZ(pColumns);
}
-void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo)
+void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo)
{
if( !pColumns )
pColumns = new SvPtrarr;
@@ -4431,22 +4431,22 @@ void SvxIconChoiceCtrl_Impl::SetColumn( USHORT nIndex, const SvxIconChoiceCtrlCo
Arrange( IsAutoArrange() );
}
-const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( USHORT nIndex ) const
+const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const
{
if( !pColumns || nIndex >= pColumns->Count() )
return 0;
return (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nIndex );
}
-const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT nSubItem,
+const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( sal_uInt16 nSubItem,
long& rLeft ) const
{
rLeft = 0;
if( !pColumns )
return 0;
- const USHORT nCount = pColumns->Count();
+ const sal_uInt16 nCount = pColumns->Count();
const SvxIconChoiceCtrlColumnInfo* pCol = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
pCol = (const SvxIconChoiceCtrlColumnInfo*)pColumns->GetObject( nCur );
if( !pCol || pCol->GetSubItem() == nSubItem )
@@ -4457,7 +4457,7 @@ const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetItemColumn( USHORT
}
void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
- OutputDevice* pOut, const Rectangle& rBmpRect, BOOL bHide )
+ OutputDevice* pOut, const Rectangle& rBmpRect, sal_Bool bHide )
{
Rectangle aBmpRect( rBmpRect );
long nBorder = 2;
@@ -4473,7 +4473,7 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
else
{
DecorationView aDecoView( pOut );
- USHORT nDecoFlags;
+ sal_uInt16 nDecoFlags;
if ( bHighlightFramePressed )
nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_IN;
else
@@ -4483,20 +4483,20 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(
}
void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,
- BOOL bKeepHighlightFlags )
+ sal_Bool bKeepHighlightFlags )
{
if( pEntry == pCurHighlightFrame )
return;
if( !bKeepHighlightFlags )
- bHighlightFramePressed = FALSE;
+ bHighlightFramePressed = sal_False;
HideEntryHighlightFrame();
pCurHighlightFrame = pEntry;
if( pEntry )
{
Rectangle aBmpRect( CalcFocusRect(pEntry) );
- DrawHighlightFrame( pView, aBmpRect, FALSE );
+ DrawHighlightFrame( pView, aBmpRect, sal_False );
}
}
@@ -4508,7 +4508,7 @@ void SvxIconChoiceCtrl_Impl::HideEntryHighlightFrame()
SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame;
pCurHighlightFrame = 0;
Rectangle aBmpRect( CalcFocusRect(pEntry) );
- DrawHighlightFrame( pView, aBmpRect, TRUE );
+ DrawHighlightFrame( pView, aBmpRect, sal_True );
}
void SvxIconChoiceCtrl_Impl::CallSelectHandler( SvxIconChoiceCtrlEntry* )
@@ -4549,7 +4549,7 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const
SvxIconChoiceCtrlEntry* pEntry = GetCurEntry();
if( !pEntry || !pEntry->IsSelected() )
{
- ULONG nNext;
+ sal_uLong nNext;
pEntry = GetFirstSelectedEntry( nNext );
}
if( pEntry )
@@ -4561,14 +4561,14 @@ Point SvxIconChoiceCtrl_Impl::GetPopupMenuPosPixel() const
return aResult;
}
-void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWallpaper )
+void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, sal_Bool bDoNotUpdateWallpaper )
{
MapMode aMapMode( pView->GetMapMode() );
aMapMode.SetOrigin( rPos );
pView->SetMapMode( aMapMode );
if( !bDoNotUpdateWallpaper )
{
- BOOL bScrollable = pView->GetBackground().IsScrollable();
+ sal_Bool bScrollable = pView->GetBackground().IsScrollable();
if( pView->HasBackground() && !bScrollable )
{
Rectangle aRect( GetOutputRect());
@@ -4579,8 +4579,8 @@ void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos, BOOL bDoNotUpdateWall
}
}
-ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBars,
- BOOL bSmartScrBar ) const
+sal_uLong SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, sal_Bool bCheckScrBars,
+ sal_Bool bSmartScrBar ) const
{
Size aSize( rSize );
if( bCheckScrBars && aHorSBar.IsVisible() )
@@ -4598,19 +4598,19 @@ ULONG SvxIconChoiceCtrl_Impl::GetGridCount( const Size& rSize, BOOL bCheckScrBar
if( aSize.Height() < 0 )
aSize.Height() = 0;
- return IcnGridMap_Impl::GetGridCount( aSize, (USHORT)nGridDX, (USHORT)nGridDY );
+ return IcnGridMap_Impl::GetGridCount( aSize, (sal_uInt16)nGridDX, (sal_uInt16)nGridDY );
}
-BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
+sal_Bool SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( rKEvt.GetKeyCode().IsMod2(), "*SvxIconChoiceCtrl_Impl::HandleShortCutKey(): no <ALT> pressed!?" );
sal_Unicode cChar = rKEvt.GetCharCode();
- ULONG nPos = (ULONG)-1;
+ sal_uLong nPos = (sal_uLong)-1;
if( cChar && IsMnemonicChar( cChar, nPos ) )
{
@@ -4619,7 +4619,7 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
if( pNewCursor != pOldCursor )
{
- SetCursor_Impl( pOldCursor, pNewCursor, FALSE, FALSE, FALSE );
+ SetCursor_Impl( pOldCursor, pNewCursor, sal_False, sal_False, sal_False );
if( pNewCursor != NULL )
{
@@ -4629,13 +4629,13 @@ BOOL SvxIconChoiceCtrl_Impl::HandleShortCutKey( const KeyEvent& rKEvt )
pCurHighlightFrame = NULL;
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-void SvxIconChoiceCtrl_Impl::CallEventListeners( ULONG nEvent, void* pData )
+void SvxIconChoiceCtrl_Impl::CallEventListeners( sal_uLong nEvent, void* pData )
{
pView->CallImplEventListeners( nEvent, pData );
}
diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx
index 43b03f569d5d..93e2990d6658 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -48,14 +48,14 @@ IcnCursor_Impl::~IcnCursor_Impl()
delete[] pRows;
}
-USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
+sal_uInt16 IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
int bVertical )
{
- USHORT nCount = (USHORT)pList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pList->Count();
if( !nCount )
return 0;
- USHORT nCurPos = 0;
+ sal_uInt16 nCurPos = 0;
long nPrevValue = LONG_MIN;
while( nCount )
{
@@ -67,7 +67,7 @@ USHORT IcnCursor_Impl::GetSortListPos( SvPtrarr* pList, long nValue,
else
nCurValue = rRect.Left();
if( nValue >= nPrevValue && nValue <= nCurValue )
- return (USHORT)nCurPos;
+ return (sal_uInt16)nCurPos;
nPrevValue = nCurValue;
nCount--;
nCurPos++;
@@ -85,8 +85,8 @@ void IcnCursor_Impl::ImplCreate()
pColumns = new SvPtrarr[ nCols ];
pRows = new SvPtrarr[ nRows ];
- ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
// const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -100,10 +100,10 @@ void IcnCursor_Impl::ImplCreate()
if( nX >= nCols )
nX = sal::static_int_cast< short >(nCols - 1);
- USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE );
+ sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True );
pColumns[ nX ].Insert( pEntry, nIns );
- nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE );
+ nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False );
pRows[ nY ].Insert( pEntry, nIns );
pEntry->nX = nX;
@@ -128,12 +128,12 @@ void IcnCursor_Impl::Clear()
}
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
- USHORT, BOOL bDown, BOOL bSimple )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,
+ sal_uInt16, sal_Bool bDown, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchCol: No reference entry");
SvPtrarr* pList = &(pColumns[ nCol ]);
- const USHORT nCount = pList->Count();
+ const sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -141,7 +141,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List");
if( bDown )
{
@@ -174,18 +174,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
if( nTop > nBottom )
{
- USHORT nTemp = nTop;
+ sal_uInt16 nTemp = nTop;
nTop = nBottom;
nBottom = nTemp;
}
long nMinDistance = LONG_MAX;
SvxIconChoiceCtrlEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
- USHORT nY = pEntry->nY;
+ sal_uInt16 nY = pEntry->nY;
if( nY >= nTop && nY <= nBottom )
{
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -203,12 +203,12 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchCol(USHORT nCol,USHORT nTop,USHORT
return pResult;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
- USHORT, BOOL bRight, BOOL bSimple )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight,
+ sal_uInt16, sal_Bool bRight, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
SvPtrarr* pList = &(pRows[ nRow ]);
- const USHORT nCount = pList->Count();
+ const sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -216,7 +216,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List");
if( bRight )
{
@@ -249,18 +249,18 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
}
if( nRight < nLeft )
{
- USHORT nTemp = nRight;
+ sal_uInt16 nTemp = nRight;
nRight = nLeft;
nLeft = nTemp;
}
long nMinDistance = LONG_MAX;
SvxIconChoiceCtrlEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
- USHORT nX = pEntry->nX;
+ sal_uInt16 nX = pEntry->nX;
if( nX >= nLeft && nX <= nRight )
{
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
@@ -282,7 +282,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
/*
Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw.
- linksstehenden. Suchverfahren am Beispiel bRight = TRUE:
+ linksstehenden. Suchverfahren am Beispiel bRight = sal_True:
c
b c
@@ -297,21 +297,21 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::SearchRow(USHORT nRow,USHORT nLeft,USHOR
a,b,c : 2., 3., 4. Suchrechteck
*/
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bRight )
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bRight )
{
SvxIconChoiceCtrlEntry* pResult;
pCurEntry = pCtrlEntry;
Create();
- USHORT nY = pCtrlEntry->nY;
- USHORT nX = pCtrlEntry->nX;
+ sal_uInt16 nY = pCtrlEntry->nY;
+ sal_uInt16 nX = pCtrlEntry->nX;
DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
// Nachbar auf gleicher Zeile ?
if( bRight )
pResult = SearchRow(
- nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE );
+ nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True );
else
- pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE );
+ pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True );
if( pResult )
return pResult;
@@ -329,11 +329,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt
nLastCol = -1; // 0-1
}
- USHORT nRowMin = nY;
- USHORT nRowMax = nY;
+ sal_uInt16 nRowMin = nY;
+ sal_uInt16 nRowMax = nY;
do
{
- SvxIconChoiceCtrlEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE);
+ SvxIconChoiceCtrlEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nRowMin )
@@ -345,7 +345,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt
return 0;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, BOOL bDown)
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, sal_Bool bDown)
{
if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
{
@@ -367,7 +367,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS
nNewPos = 0;
}
if( nPos != nNewPos )
- return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (ULONG)nNewPos );
+ return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (sal_uLong)nNewPos );
return 0;
}
long nOpt = pView->GetEntryBoundRect( pStart ).Top();
@@ -405,11 +405,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS
return 0;
}
-SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, BOOL bDown)
+SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, sal_Bool bDown)
{
if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
{
- ULONG nPos = pView->GetEntryListPos( pCtrlEntry );
+ sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry );
if( bDown && nPos < (pView->aEntries.Count() - 1) )
return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos + 1 );
else if( !bDown && nPos > 0 )
@@ -420,17 +420,17 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE
SvxIconChoiceCtrlEntry* pResult;
pCurEntry = pCtrlEntry;
Create();
- USHORT nY = pCtrlEntry->nY;
- USHORT nX = pCtrlEntry->nX;
+ sal_uInt16 nY = pCtrlEntry->nY;
+ sal_uInt16 nX = pCtrlEntry->nX;
DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
// Nachbar in gleicher Spalte ?
if( bDown )
pResult = SearchCol(
- nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE );
+ nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True );
else
- pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE );
+ pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True );
if( pResult )
return pResult;
@@ -448,11 +448,11 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE
nLastRow = -1; // 0-1
}
- USHORT nColMin = nX;
- USHORT nColMax = nX;
+ sal_uInt16 nColMin = nX;
+ sal_uInt16 nColMax = nX;
do
{
- SvxIconChoiceCtrlEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE);
+ SvxIconChoiceCtrlEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nColMin )
@@ -494,23 +494,23 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
{
if( !pRefEntry )
{
- USHORT nGridRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY);
+ sal_uInt16 nGridRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY);
nGridRows++; // wg. Abrundung!
if( !nGridRows )
return;
- for( USHORT nCurList = 0; nCurList < nGridRows; nCurList++ )
+ for( sal_uInt16 nCurList = 0; nCurList < nGridRows; nCurList++ )
{
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, nCurList );
}
- const ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
const Rectangle& rRect = pView->GetEntryBoundRect( pEntry );
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
- USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE);
+ sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False);
((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns );
}
}
@@ -523,8 +523,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY );
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, 0 );
- ULONG nCount = pView->aEntries.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pView->aEntries.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur );
Rectangle rRect( pView->CalcBmpRect(pEntry) );
@@ -532,7 +532,7 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
if( nY == nRefRow )
{
- USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE );
+ sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False );
pRow->Insert( pEntry, nIns );
}
}
@@ -542,8 +542,8 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt
//static
void IcnCursor_Impl::DestroyGridAdjustData( SvPtrarr& rLists )
{
- const USHORT nCount = rLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ const sal_uInt16 nCount = rLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ];
delete pArr;
@@ -570,16 +570,16 @@ void IcnGridMap_Impl::Expand()
Create_Impl();
else
{
- USHORT nNewGridRows = _nGridRows;
- USHORT nNewGridCols = _nGridCols;
+ sal_uInt16 nNewGridRows = _nGridRows;
+ sal_uInt16 nNewGridCols = _nGridCols;
if( _pView->nWinBits & WB_ALIGN_TOP )
nNewGridRows += 50;
else
nNewGridCols += 50;
- BOOL* pNewGridMap = new BOOL[nNewGridRows*nNewGridCols];
- memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(BOOL) );
- memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(BOOL) );
+ sal_Bool* pNewGridMap = new sal_Bool[nNewGridRows*nNewGridCols];
+ memset( pNewGridMap, 0, nNewGridRows * nNewGridCols * sizeof(sal_Bool) );
+ memcpy( pNewGridMap, _pGridMap, _nGridRows * _nGridCols * sizeof(sal_Bool) );
delete[] _pGridMap;
_pGridMap = pNewGridMap;
_nGridRows = nNewGridRows;
@@ -598,15 +598,15 @@ void IcnGridMap_Impl::Create_Impl()
else
_nGridCols += 50;
- _pGridMap = new BOOL[ _nGridRows * _nGridCols];
+ _pGridMap = new sal_Bool[ _nGridRows * _nGridCols];
memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols );
- const ULONG nCount = _pView->aEntries.Count();
- for( ULONG nCur=0; nCur < nCount; nCur++ )
+ const sal_uLong nCount = _pView->aEntries.Count();
+ for( sal_uLong nCur=0; nCur < nCount; nCur++ )
OccupyGrids( (SvxIconChoiceCtrlEntry*)_pView->aEntries.GetObject( nCur ));
}
-void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const
+void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
{
long nX, nY;
if( _pView->nWinBits & WB_ALIGN_TOP )
@@ -644,11 +644,11 @@ void IcnGridMap_Impl::GetMinMapSize( USHORT& rDX, USHORT& rDY ) const
if( !nDY )
nDY++;
- rDX = (USHORT)nDX;
- rDY = (USHORT)nDY;
+ rDX = (sal_uInt16)nDX;
+ rDY = (sal_uInt16)nDY;
}
-GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY )
+GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY )
{
Create();
if( _pView->nWinBits & WB_ALIGN_TOP )
@@ -657,7 +657,7 @@ GridId IcnGridMap_Impl::GetGrid( USHORT nGridX, USHORT nGridY )
return nGridY + ( nGridX * _nGridRows );
}
-GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped )
+GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, sal_Bool* pbClipped )
{
Create();
@@ -667,28 +667,28 @@ GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos, BOOL* pbClipped )
nY -= TBOFFS_WINBORDER;
nX /= _pView->nGridDX;
nY /= _pView->nGridDY;
- BOOL bClipped = FALSE;
+ sal_Bool bClipped = sal_False;
if( nX >= _nGridCols )
{
nX = _nGridCols - 1;
- bClipped = TRUE;
+ bClipped = sal_True;
}
if( nY >= _nGridRows )
{
nY = _nGridRows - 1;
- bClipped = TRUE;
+ bClipped = sal_True;
}
- GridId nId = GetGrid( (USHORT)nX, (USHORT)nY );
+ GridId nId = GetGrid( (sal_uInt16)nX, (sal_uInt16)nY );
if( pbClipped )
*pbClipped = bClipped;
- DBG_ASSERT(nId <(ULONG)(_nGridCols*_nGridRows),"GetGrid failed");
+ DBG_ASSERT(nId <(sal_uLong)(_nGridCols*_nGridRows),"GetGrid failed");
return nId;
}
Rectangle IcnGridMap_Impl::GetGridRect( GridId nId )
{
Create();
- USHORT nGridX, nGridY;
+ sal_uInt16 nGridX, nGridY;
GetGridCoord( nId, nGridX, nGridY );
const long nLeft = nGridX * _pView->nGridDX+ LROFFS_WINBORDER;
const long nTop = nGridY * _pView->nGridDY + TBOFFS_WINBORDER;
@@ -698,28 +698,28 @@ Rectangle IcnGridMap_Impl::GetGridRect( GridId nId )
nTop + _pView->nGridDY );
}
-GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound )
+GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound )
{
Create();
- ULONG nStart = 0;
- BOOL bExpanded = FALSE;
+ sal_uLong nStart = 0;
+ sal_Bool bExpanded = sal_False;
while( 1 )
{
- const ULONG nCount = (USHORT)(_nGridCols * _nGridRows);
- for( ULONG nCur = nStart; nCur < nCount; nCur++ )
+ const sal_uLong nCount = (sal_uInt16)(_nGridCols * _nGridRows);
+ for( sal_uLong nCur = nStart; nCur < nCount; nCur++ )
{
if( !_pGridMap[ nCur ] )
{
if( bOccupyFound )
- _pGridMap[ nCur ] = TRUE;
+ _pGridMap[ nCur ] = sal_True;
return (GridId)nCur;
}
}
DBG_ASSERT(!bExpanded,"ExpandGrid failed");
if( bExpanded )
return 0; // prevent never ending loop
- bExpanded = TRUE;
+ bExpanded = sal_True;
Expand();
nStart = nCount;
}
@@ -730,7 +730,7 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( BOOL bOccupyFound )
// Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren
#define OCCUPY_CENTER
-void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bOccupy )
+void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy )
{
if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect ))
return;
@@ -742,7 +742,7 @@ void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, BOOL bO
}
-void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed )
+void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, sal_Bool bUsed )
{
if( !_pGridMap )
return;
@@ -756,17 +756,17 @@ void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, BOOL bUsed )
else
_aLastOccupiedGrid.SetEmpty();
- BOOL bTopLeftClipped, bBottomRightClipped;
+ sal_Bool bTopLeftClipped, bBottomRightClipped;
GridId nIdTL = GetGrid( rRect.TopLeft(), &bTopLeftClipped );
GridId nIdBR = GetGrid( rRect.BottomRight(), &bBottomRightClipped );
if( bTopLeftClipped && bBottomRightClipped )
return;
- USHORT nX1,nX2,nY1,nY2;
+ sal_uInt16 nX1,nX2,nY1,nY2;
GetGridCoord( nIdTL, nX1, nY1 );
GetGridCoord( nIdBR, nX2, nY2 );
- USHORT nTemp;
+ sal_uInt16 nTemp;
if( nX1 > nX2 )
{
nTemp = nX1;
@@ -795,20 +795,20 @@ void IcnGridMap_Impl::Clear()
}
}
-ULONG IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, USHORT nDX, USHORT nDY)
+sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, sal_uInt16 nDY)
{
long ndx = (rSizePixel.Width() - LROFFS_WINBORDER) / nDX;
if( ndx < 0 ) ndx *= -1;
long ndy = (rSizePixel.Height() - TBOFFS_WINBORDER) / nDY;
if( ndy < 0 ) ndy *= -1;
- return (ULONG)(ndx * ndy);
+ return (sal_uLong)(ndx * ndy);
}
void IcnGridMap_Impl::OutputSizeChanged()
{
if( _pGridMap )
{
- USHORT nCols, nRows;
+ sal_uInt16 nCols, nRows;
GetMinMapSize( nCols, nRows );
if( _pView->nWinBits & WB_ALIGN_TOP )
{
@@ -830,18 +830,18 @@ void IcnGridMap_Impl::OutputSizeChanged()
// Independendly of the views alignment (TOP or LEFT) the gridmap
// should contain the data in a continues region, to make it possible
// to copy the whole block if the gridmap needs to be expanded.
-void IcnGridMap_Impl::GetGridCoord( GridId nId, USHORT& rGridX, USHORT& rGridY )
+void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY )
{
Create();
if( _pView->nWinBits & WB_ALIGN_TOP )
{
- rGridX = (USHORT)(nId % _nGridCols);
- rGridY = (USHORT)(nId / _nGridCols);
+ rGridX = (sal_uInt16)(nId % _nGridCols);
+ rGridY = (sal_uInt16)(nId / _nGridCols);
}
else
{
- rGridX = (USHORT)(nId / _nGridRows);
- rGridY = (USHORT)(nId % _nGridRows);
+ rGridX = (sal_uInt16)(nId / _nGridRows);
+ rGridY = (sal_uInt16)(nId % _nGridRows);
}
}
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 1bd17f9d584c..f26de38cc1ab 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "ivctrl.hxx"
+#include <svtools/ivctrl.hxx>
#include "imivctl.hxx"
#include <vcl/bitmapex.hxx>
#include <vcl/controllayout.hxx>
@@ -42,7 +42,7 @@ using namespace ::com::sun::star::accessibility;
|
\*****************************************************************************/
-SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, USHORT _nFlags )
+SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 _nFlags )
{
aText = rText;
aImage = rImage;
@@ -54,7 +54,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image
pflink = 0;
}
-SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags )
+SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( sal_uInt16 _nFlags )
{
pUserData = NULL;
@@ -64,7 +64,7 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( USHORT _nFlags )
pflink = 0;
}
-void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved )
+void SvxIconChoiceCtrlEntry::SetMoved( sal_Bool bMoved )
{
if( bMoved )
nFlags |= ICNVIEW_FLAG_POS_MOVED;
@@ -72,7 +72,7 @@ void SvxIconChoiceCtrlEntry::SetMoved( BOOL bMoved )
nFlags &= ~ICNVIEW_FLAG_POS_MOVED;
}
-void SvxIconChoiceCtrlEntry::LockPos( BOOL bLock )
+void SvxIconChoiceCtrlEntry::LockPos( sal_Bool bLock )
{
if( bLock )
nFlags |= ICNVIEW_FLAG_POS_LOCKED;
@@ -108,7 +108,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) :
_pCurKeyEvent ( NULL ),
_pImp ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ),
- _bAutoFontColor ( FALSE )
+ _bAutoFontColor ( sal_False )
{
SetLineColor();
@@ -123,7 +123,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, const ResId& rResId ) :
_pCurKeyEvent ( NULL ),
_pImp ( new SvxIconChoiceCtrl_Impl( this, WB_BORDER ) ),
- _bAutoFontColor ( FALSE )
+ _bAutoFontColor ( sal_False )
{
SetLineColor();
@@ -138,14 +138,14 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl()
delete _pImp;
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( ULONG nPos, const Point* pPos, USHORT nFlags )
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags )
{
SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( nFlags );
_pImp->InsertEntry( pEntry, nPos, pPos );
return pEntry;
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, ULONG nPos, const Point* pPos, USHORT nFlags )
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags )
{
SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags);
@@ -154,14 +154,14 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, con
return pEntry;
}
-BOOL SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, BOOL )
+sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool )
{
- return TRUE;
+ return sal_True;
}
-BOOL SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* )
+sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* )
{
- return TRUE;
+ return sal_True;
}
void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, OutputDevice& rDev )
@@ -169,29 +169,29 @@ void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Po
rDev.DrawImage( rPos, pEntry->GetImage() );
}
-String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, BOOL )
+String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, sal_Bool )
{
return pEntry->GetText();
}
-BOOL SvtIconChoiceCtrl::HasBackground() const
+sal_Bool SvtIconChoiceCtrl::HasBackground() const
{
- return FALSE;
+ return sal_False;
}
-BOOL SvtIconChoiceCtrl::HasFont() const
+sal_Bool SvtIconChoiceCtrl::HasFont() const
{
- return FALSE;
+ return sal_False;
}
-BOOL SvtIconChoiceCtrl::HasFontTextColor() const
+sal_Bool SvtIconChoiceCtrl::HasFontTextColor() const
{
- return TRUE;
+ return sal_True;
}
-BOOL SvtIconChoiceCtrl::HasFontFillColor() const
+sal_Bool SvtIconChoiceCtrl::HasFontFillColor() const
{
- return TRUE;
+ return sal_True;
}
void SvtIconChoiceCtrl::Paint( const Rectangle& rRect )
@@ -223,7 +223,7 @@ void SvtIconChoiceCtrl::ArrangeIcons()
Size aFullSize;
Rectangle aEntryRect;
- for ( ULONG i = 0; i < GetEntryCount(); i++ )
+ for ( sal_uLong i = 0; i < GetEntryCount(); i++ )
{
SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
@@ -231,14 +231,14 @@ void SvtIconChoiceCtrl::ArrangeIcons()
aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() );
}
- _pImp->Arrange ( FALSE, aFullSize.getWidth() );
+ _pImp->Arrange ( sal_False, aFullSize.getWidth() );
}
else if ( GetStyle() & WB_ALIGN_LEFT )
{
Size aFullSize;
Rectangle aEntryRect;
- for ( ULONG i = 0; i < GetEntryCount(); i++ )
+ for ( sal_uLong i = 0; i < GetEntryCount(); i++ )
{
SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
@@ -246,13 +246,13 @@ void SvtIconChoiceCtrl::ArrangeIcons()
aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() );
}
- _pImp->Arrange ( FALSE, 0, aFullSize.getHeight() );
+ _pImp->Arrange ( sal_False, 0, aFullSize.getHeight() );
}
else
{
_pImp->Arrange();
}
- _pImp->Arrange( FALSE, 0, 1000 );
+ _pImp->Arrange( sal_False, 0, 1000 );
}
void SvtIconChoiceCtrl::Resize()
{
@@ -288,7 +288,7 @@ void SvtIconChoiceCtrl::GetFocus()
{
_pImp->GetFocus();
Control::GetFocus();
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pSelectedEntry = GetSelectedEntry ( nPos );
if ( pSelectedEntry )
_pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pSelectedEntry );
@@ -300,7 +300,7 @@ void SvtIconChoiceCtrl::LoseFocus()
Control::LoseFocus();
}
-void SvtIconChoiceCtrl::SetUpdateMode( BOOL bUpdate )
+void SvtIconChoiceCtrl::SetUpdateMode( sal_Bool bUpdate )
{
Control::SetUpdateMode( bUpdate );
_pImp->SetUpdateMode( bUpdate );
@@ -322,7 +322,7 @@ void SvtIconChoiceCtrl::SetPointFont( const Font& rFont )
_pImp->FontModified();
}
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, BOOL bHit ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, sal_Bool bHit ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
@@ -353,25 +353,25 @@ SvxIconChoiceCtrlTextMode SvtIconChoiceCtrl::GetEntryTextMode( const SvxIconChoi
return _pImp->GetEntryTextModeSmart( pEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, BOOL ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry );
}
-ULONG SvtIconChoiceCtrl::GetEntryCount() const
+sal_uLong SvtIconChoiceCtrl::GetEntryCount() const
{
return _pImp->GetEntryCount();
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( ULONG nPos ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const
{
return _pImp->GetEntry( nPos );
}
@@ -391,30 +391,30 @@ void SvtIconChoiceCtrl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry )
_pImp->RemoveEntry( pEntry );
}
-SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( ULONG& rPos ) const
+SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const
{
return _pImp->GetFirstSelectedEntry( rPos );
}
void SvtIconChoiceCtrl::ClickIcon()
{
- ULONG nPos;
+ sal_uLong nPos;
GetSelectedEntry ( nPos );
_aClickIconHdl.Call( this );
}
-BOOL SvtIconChoiceCtrl::IsEntryEditing() const
+sal_Bool SvtIconChoiceCtrl::IsEntryEditing() const
{
return _pImp->IsEntryEditing();
}
-BOOL SvtIconChoiceCtrl::SetChoiceWithCursor ( BOOL bDo )
+sal_Bool SvtIconChoiceCtrl::SetChoiceWithCursor ( sal_Bool bDo )
{
return _pImp->SetChoiceWithCursor (bDo);
}
void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt )
{
- BOOL bKeyUsed = DoKeyInput( rKEvt );
+ sal_Bool bKeyUsed = DoKeyInput( rKEvt );
if ( !bKeyUsed )
{
_pCurKeyEvent = (KeyEvent*)&rKEvt;
@@ -422,17 +422,17 @@ void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt )
_pCurKeyEvent = NULL;
}
}
-BOOL SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt )
+sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt )
{
// unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
if( IsEntryEditing() )
- return TRUE;
+ return sal_True;
_pCurKeyEvent = (KeyEvent*)&rKEvt;
- BOOL bHandled = _pImp->KeyInput( rKEvt );
+ sal_Bool bHandled = _pImp->KeyInput( rKEvt );
_pCurKeyEvent = NULL;
return bHandled;
}
-ULONG SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
+sal_uLong SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
{
return _pImp->GetEntryListPos( pEntry );
}
@@ -537,7 +537,7 @@ void SvtIconChoiceCtrl::SetSelectionMode( SelectionMode eMode )
_pImp->SetSelectionMode( eMode );
}
-BOOL SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r )
+sal_Bool SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r )
{
return _pImp->HandleShortCutKey( r );
}
@@ -591,7 +591,7 @@ void SvtIconChoiceCtrl::SetNoSelection()
_pImp->SetNoSelection();
}
-void SvtIconChoiceCtrl::CallImplEventListeners(ULONG nEvent, void* pData)
+void SvtIconChoiceCtrl::CallImplEventListeners(sal_uLong nEvent, void* pData)
{
CallEventListeners(nEvent, pData);
}
diff --git a/svtools/source/contnr/makefile.mk b/svtools/source/contnr/makefile.mk
deleted file mode 100644
index 777297b33e9c..000000000000
--- a/svtools/source/contnr/makefile.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=svcontnr
-
-PROJECTPCH4DLL=TRUE
-PROJECTPCH=cont_pch
-PROJECTPCHSOURCE=cont_pch
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES=\
- $(SLO)$/contentenumeration.obj \
- $(SLO)$/fileview.obj \
- $(SLO)$/imivctl1.obj \
- $(SLO)$/imivctl2.obj \
- $(SLO)$/ivctrl.obj \
- $(SLO)$/svicnvw.obj \
- $(SLO)$/svimpbox.obj \
- $(SLO)$/svimpicn.obj \
- $(SLO)$/svlbitm.obj \
- $(SLO)$/svlbox.obj \
- $(SLO)$/svtabbx.obj \
- $(SLO)$/svtreebx.obj \
- $(SLO)$/templwin.obj \
- $(SLO)$/tooltiplbox.obj
-
-SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/treelist.obj
-
-SRS1NAME=$(TARGET)
-SRC1FILES =\
- fileview.src \
- templwin.src \
- svcontnr.src
-
-HXX1TARGET= svcontnr
-HXX1EXT= hxx
-HXX1FILES= $(PRJ)$/inc$/svlbox.hxx \
- $(PRJ)$/inc$/svlbitm.hxx \
- $(PRJ)$/inc$/svtreebx.hxx \
- $(PRJ)$/inc$/svicnvw.hxx \
- $(PRJ)$/inc$/svtabbx.hxx \
- $(PRJ)$/inc$/treelist.hxx
-HXX1EXCL= -E:*include*
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx
index 03a1a13b0b6d..6fd401533267 100644
--- a/svtools/source/contnr/svicnvw.cxx
+++ b/svtools/source/contnr/svicnvw.cxx
@@ -48,7 +48,6 @@ SvIcnVwDataEntry::~SvIcnVwDataEntry()
SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
SvLBox( pParent, nWinStyle | WB_BORDER )
{
- nWinBits = nWinStyle;
nIcnVwFlags = 0;
pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
pImp->mpViewData = 0;
@@ -70,8 +69,6 @@ SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
SetDefaultFont();
pImp->SetSelectionMode( GetSelectionMode() );
- pImp->SetWindowBits( nWindowStyle );
- nWinBits = nWindowStyle;
}
SvIconView::~SvIconView()
@@ -107,7 +104,7 @@ void SvIconView::DisconnectFromModel()
SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos )
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos )
{
SvLBoxEntry* pEntry = CreateEntry(
rText, aCollapsedEntryBmp, aExpandedEntryBmp );
@@ -123,7 +120,7 @@ SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
const Image& rExpEntryBmp,
const Image& rCollEntryBmp,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos)
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos)
{
SvLBoxEntry* pEntry = CreateEntry(
rText, rCollEntryBmp, rExpEntryBmp );
@@ -219,7 +216,7 @@ SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource )
}
-USHORT SvIconView::IsA()
+sal_uInt16 SvIconView::IsA()
{
return SV_LISTBOX_ID_ICONVIEW;
}
@@ -227,7 +224,7 @@ USHORT SvIconView::IsA()
void SvIconView::RequestingChilds( SvLBoxEntry* pParent )
{
if ( !pParent->HasChilds() )
- InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND );
}
void SvIconView::Paint( const Rectangle& rRect )
@@ -257,7 +254,7 @@ void SvIconView::KeyInput( const KeyEvent& rKEvt )
return;
nImpFlags |= SVLBOX_IS_TRAVELSELECT;
- BOOL bKeyUsed = pImp->KeyInput( rKEvt );
+ sal_Bool bKeyUsed = pImp->KeyInput( rKEvt );
if ( !bKeyUsed )
SvLBox::KeyInput( rKEvt );
nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
@@ -281,7 +278,7 @@ void SvIconView::LoseFocus()
SvLBox::LoseFocus();
}
-void SvIconView::SetUpdateMode( BOOL bUpdate )
+void SvIconView::SetUpdateMode( sal_Bool bUpdate )
{
Control::SetUpdateMode( bUpdate );
if ( bUpdate )
@@ -320,7 +317,7 @@ void SvIconView::ModelHasInsertedTree( SvListEntry* pEntry )
}
void SvIconView::ModelIsMoving(SvListEntry* pSource,
- SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ )
+ SvListEntry* /* pTargetParent */ , sal_uLong /* nChildPos */ )
{
pImp->MovingEntry( (SvLBoxEntry*)pSource );
}
@@ -349,7 +346,7 @@ void SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
pImp->ModelHasEntryInvalidated( pEntry );
}
-void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow )
+void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow )
{
pImp->ShowTargetEmphasis( pEntry, bShow );
}
@@ -361,10 +358,10 @@ Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const
void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos)
{
- pImp->SetEntryPosition( pEntry, rPos, FALSE, TRUE );
+ pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True );
}
-void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid )
+void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid )
{
pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid );
}
@@ -372,7 +369,7 @@ void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL
void SvIconView::SetFont( const Font& rFont )
{
Font aTempFont( rFont );
- aTempFont.SetTransparent( TRUE );
+ aTempFont.SetTransparent( sal_True );
SvLBox::SetFont( aTempFont );
RecalcViewData();
pImp->ChangedFont();
@@ -388,7 +385,7 @@ SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos )
return pImp->GetDropTarget( rPos );
}
-SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const
+SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
@@ -401,10 +398,11 @@ SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
}
-void SvIconView::SetWindowBits( WinBits nWinStyle )
+void SvIconView::StateChanged( StateChangedType i_nStateChange )
{
- nWinBits = nWinStyle;
- pImp->SetWindowBits( nWinStyle );
+ SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ pImp->SetStyle( GetStyle() );
}
void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
@@ -440,10 +438,10 @@ void SvIconView::SetSelectionMode( SelectionMode eSelectMode )
pImp->SetSelectionMode( eSelectMode );
}
-BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
EndEditing();
- BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ sal_Bool bRetVal = SvListView::Select( pEntry, bSelect );
if( bRetVal )
{
pImp->EntrySelected( pEntry, bSelect );
@@ -453,7 +451,7 @@ BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return bRetVal;
}
-void SvIconView::SelectAll( BOOL bSelect, BOOL )
+void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool )
{
SvLBoxEntry* pEntry = pImp->GetCurParent();
pEntry = FirstChild( pEntry );
@@ -467,6 +465,7 @@ void SvIconView::SelectAll( BOOL bSelect, BOOL )
void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
{
pImp->SetCursor( _pEntry );
+ OnCurrentEntryChanged();
}
SvLBoxEntry* SvIconView::GetCurEntry() const
@@ -477,7 +476,7 @@ SvLBoxEntry* SvIconView::GetCurEntry() const
void SvIconView::Arrange()
{
#ifdef DBG_UTIL
- USHORT n=1;
+ sal_uInt16 n=1;
if( n == 1 && n-1 == 0 )
{
pImp->Arrange();
@@ -497,20 +496,20 @@ void SvIconView::SetSpaceBetweenEntries( long nX, long nY )
pImp->SetSpaceBetweenEntries( nX, nY );
}
-BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
}
-BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
}
-void SvIconView::EnableInplaceEditing( BOOL bEnable )
+void SvIconView::EnableInplaceEditing( sal_Bool bEnable )
{
SvLBox::EnableInplaceEditing( bEnable );
}
@@ -523,7 +522,7 @@ void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if ( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
}
}
@@ -536,7 +535,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?");
pCurEdEntry = pEntry;
pCurEdItem = pItem;
- Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE ));
+ Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True ));
aRect.Bottom() += 4;
pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen!
@@ -548,9 +547,6 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
aRect.Bottom() += 2; // sieht huebscher aus
-#ifdef WIN
- aRect.Bottom() += 4;
-#endif
#ifdef OS2
#if OS2_SINGLE_LINE_EDIT
@@ -566,7 +562,7 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
#endif
#endif // OS2
- EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE );
+ EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True );
}
void SvIconView::EditEntry( SvLBoxEntry* pEntry )
@@ -581,7 +577,7 @@ void SvIconView::EditEntry( SvLBoxEntry* pEntry )
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, pItem, aSel );
}
}
@@ -601,14 +597,14 @@ void SvIconView::EditedText( const XubString& rStr )
}
-BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
+sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
{
- return TRUE;
+ return sal_True;
}
-BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
+sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
{
- return TRUE;
+ return sal_True;
}
@@ -661,9 +657,9 @@ Region SvIconView::GetDragRegion() const
return aRegion;
}
-ULONG SvIconView::GetSelectionCount() const
+sal_uLong SvIconView::GetSelectionCount() const
{
- return (ULONG)(pImp->GetSelectionCount());
+ return (sal_uLong)(pImp->GetSelectionCount());
}
void SvIconView::SetGrid( long nDX, long nDY )
@@ -671,18 +667,18 @@ void SvIconView::SetGrid( long nDX, long nDY )
pImp->SetGrid( nDX, nDY );
}
-void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
switch( nActionId )
{
case LISTACTION_RESORTING:
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
break;
case LISTACTION_RESORTED:
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
Arrange();
break;
@@ -694,9 +690,9 @@ void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
}
-void SvIconView::Scroll( long nDeltaX, long nDeltaY, USHORT )
+void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
{
- pImp->Scroll( nDeltaX, nDeltaY, FALSE );
+ pImp->Scroll( nDeltaX, nDeltaY, sal_False );
}
void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
@@ -707,7 +703,7 @@ void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos )
{
pImp->SttDrag( rPos );
- SvLBoxEntry* pEntry = GetEntry( rPos, TRUE );
+ SvLBoxEntry* pEntry = GetEntry( rPos, sal_True );
pImp->mpViewData = pEntry;
SvLBox::StartDrag( nAction, rPos );
}
@@ -753,14 +749,14 @@ void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
pImp->HideShowDDIcon( pRefEntry, rPos );
}
-void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pRects, short nOffs )
{
pImp->SelectRect( rRect, bAdd, pRects, nOffs );
}
void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY,
- BOOL b, USHORT nBorderWidth )
+ sal_Bool b, sal_uInt16 nBorderWidth )
{
pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth );
}
@@ -784,7 +780,7 @@ void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry )
pImp->AdjustAtGrid( pEntry );
}
-void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
+void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock )
{
SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry );
if( bLock )
@@ -793,7 +789,7 @@ void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED );
}
-BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
+sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
{
const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry );
return pViewData->IsEntryPosLocked();
@@ -809,14 +805,14 @@ SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const
return pImp->GetTextMode( pEntry );
}
-SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry );
}
-SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const
{
Point aPos( rPixPos );
aPos -= GetMapMode().GetOrigin();
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 9c5b4a56df30..69e9d12ace50 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -30,13 +30,10 @@
#include "precompiled_svtools.hxx"
#include <vcl/svapp.hxx>
#include <vcl/salnativewidgets.hxx>
-
#include <vcl/help.hxx>
-#include <tabbar.hxx>
+#include <svtools/tabbar.hxx>
-#ifndef _STACK_
#include <stack>
-#endif
#define _SVTREEBX_CXX
#include <svtools/svtreebx.hxx>
@@ -44,10 +41,8 @@
#include <svimpbox.hxx>
#include <rtl/instance.hxx>
#include <svtools/svtdata.hxx>
-
+#include <tools/wintypes.hxx>
#include <svtools/svtools.hrc>
-
-// #102891# --------------------
#include <comphelper/processfactory.hxx>
#define NODE_BMP_TABDIST_NOTVALID -2000000
@@ -75,8 +70,8 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pView = pLBView;
pTree = pLBTree;
aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
- aSelEng.ExpandSelectionOnMouseMove( FALSE );
- SetWindowBits( nWinStyle );
+ aSelEng.ExpandSelectionOnMouseMove( sal_False );
+ SetStyle( nWinStyle );
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( 0 );
@@ -101,7 +96,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
nYoffsNodeBmp = 0;
nNodeBmpWidth = 0;
- bAsyncBeginDrag = FALSE;
+ bAsyncBeginDrag = sal_False;
aAsyncBeginDragTimer.SetTimeout( 0 );
aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
// Button-Animation in Listbox
@@ -119,11 +114,11 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits n
pMostRightEntry = 0;
nCurUserEvent = 0xffffffff;
- bUpdateMode = TRUE;
- bInVScrollHdl = FALSE;
+ bUpdateMode = sal_True;
+ bInVScrollHdl = sal_False;
nFlags |= F_FILLING;
- bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = FALSE;
+ bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = sal_False;
}
SvImpLBox::~SvImpLBox()
@@ -165,7 +160,7 @@ short SvImpLBox::UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth
{
DBG_ASSERT( pView->pModel, "View and Model aren't valid!" );
- USHORT nDepth = pView->pModel->GetDepth( pEntry );
+ sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry );
// initialize vector if necessary
std::vector< short >::size_type nSize = aContextBmpWidthVector.size();
while ( nDepth > nSize )
@@ -213,7 +208,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry )
void SvImpLBox::UpdateContextBmpWidthMax( SvLBoxEntry* pEntry )
{
- USHORT nDepth = pView->pModel->GetDepth( pEntry );
+ sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry );
if( aContextBmpWidthVector.size() < 1 )
return;
short nWidth = aContextBmpWidthVector[ nDepth ];
@@ -244,11 +239,11 @@ void SvImpLBox::CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect )
}
}
-void SvImpLBox::SetWindowBits( WinBits nWinStyle )
+void SvImpLBox::SetStyle( WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
- if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION)
- aSelEng.AddAlways( TRUE );
+ m_nStyle = i_nWinStyle;
+ if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) )
+ aSelEng.AddAlways( sal_True );
}
void SvImpLBox::SetExtendedWindowBits( ExtendedWinBits _nBits )
@@ -335,11 +330,11 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
nFlags &= (~F_FILLING);
- bInVScrollHdl = TRUE;
+ bInVScrollHdl = sal_True;
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
BeginScroll();
@@ -349,7 +344,7 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
if( nDelta == 1 )
CursorDown();
else
- PageDown( (USHORT) nDelta );
+ PageDown( (sal_uInt16) nDelta );
}
else
{
@@ -357,9 +352,9 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
if( nDelta == 1 )
CursorUp();
else
- PageUp( (USHORT) nDelta );
+ PageUp( (sal_uInt16) nDelta );
}
- bInVScrollHdl = FALSE;
+ bInVScrollHdl = sal_False;
return 0;
}
@@ -371,13 +366,13 @@ void SvImpLBox::CursorDown()
{
nFlags &= (~F_FILLING);
pView->NotifyScrolling( -1 );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pNextFirstToDraw;
Rectangle aArea( GetVisibleArea() );
pView->Scroll( 0, -(pView->GetEntryHeight()), aArea, SCROLL_NOCHILDREN );
pView->Update();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
}
@@ -390,31 +385,31 @@ void SvImpLBox::CursorUp()
nFlags &= (~F_FILLING);
long nEntryHeight = pView->GetEntryHeight();
pView->NotifyScrolling( 1 );
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pPrevFirstToDraw;
Rectangle aArea( GetVisibleArea() );
aArea.Bottom() -= nEntryHeight;
pView->Scroll( 0, nEntryHeight, aArea, SCROLL_NOCHILDREN );
pView->Update();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
}
-void SvImpLBox::PageDown( USHORT nDelta )
+void SvImpLBox::PageDown( sal_uInt16 nDelta )
{
- USHORT nRealDelta = nDelta;
+ sal_uInt16 nRealDelta = nDelta;
if( !nDelta )
return;
SvLBoxEntry* pNext;
pNext = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nRealDelta ));
- if( (ULONG)pNext == (ULONG)pStartEntry )
+ if( (sal_uLong)pNext == (sal_uLong)pStartEntry )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
nFlags &= (~F_FILLING);
pView->Update();
@@ -438,21 +433,21 @@ void SvImpLBox::PageDown( USHORT nDelta )
pView->NotifyScrolled();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
-void SvImpLBox::PageUp( USHORT nDelta )
+void SvImpLBox::PageUp( sal_uInt16 nDelta )
{
- USHORT nRealDelta = nDelta;
+ sal_uInt16 nRealDelta = nDelta;
if( !nDelta )
return;
SvLBoxEntry* pPrev = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry, nRealDelta ));
- if( (ULONG)pPrev == (ULONG)pStartEntry )
+ if( (sal_uLong)pPrev == (sal_uLong)pStartEntry )
return;
nFlags &= (~F_FILLING);
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->Update();
pStartEntry = pPrev;
@@ -472,10 +467,10 @@ void SvImpLBox::PageUp( USHORT nDelta )
pView->NotifyScrolled();
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
-void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll )
+void SvImpLBox::KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll )
{
if( !aVerSBar.IsVisible() )
return;
@@ -509,7 +504,7 @@ void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll )
}
-void SvImpLBox::KeyDown( BOOL bPageDown, BOOL bNotifyScroll )
+void SvImpLBox::KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll )
{
if( !aVerSBar.IsVisible() )
return;
@@ -584,15 +579,15 @@ void SvImpLBox::InvalidateEntry( SvLBoxEntry* pEntry )
}
if( !(nFlags & F_IN_PAINT ))
{
- BOOL bHasFocusRect = FALSE;
+ sal_Bool bHasFocusRect = sal_False;
if( pEntry==pCursor && pView->HasFocus() )
{
- bHasFocusRect = TRUE;
- ShowCursor( FALSE );
+ bHasFocusRect = sal_True;
+ ShowCursor( sal_False );
}
InvalidateEntry( GetEntryLine( pEntry ) );
if( bHasFocusRect )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -617,7 +612,7 @@ void SvImpLBox::RecalcFocusRect()
// Setzt Cursor. Passt bei SingleSelection die Selektion an
//
-void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
{
SvViewDataEntry* pViewDataNewCur = 0;
if( pEntry )
@@ -640,18 +635,18 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
SvLBoxEntry* pOldCursor = pCursor;
if( pCursor && pEntry != pCursor )
{
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( bSimpleTravel )
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
pView->HideFocus();
}
pCursor = pEntry;
if( pCursor )
{
- pViewDataNewCur->SetFocus( TRUE );
+ pViewDataNewCur->SetFocus( sal_True );
if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode())
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
// Mehrfachselektion: Im Cursor-Move selektieren, wenn
// nicht im Add-Mode (Ctrl-F8)
@@ -660,11 +655,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
!(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() &&
!bForceNoSelect )
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
if( pAnchor )
@@ -674,9 +669,11 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
}
}
nFlags &= (~F_DESEL_ALL);
+
+ pView->OnCurrentEntryChanged();
}
-void SvImpLBox::ShowCursor( BOOL bShow )
+void SvImpLBox::ShowCursor( sal_Bool bShow )
{
if( !bShow || !pCursor || !pView->HasFocus() )
{
@@ -701,8 +698,8 @@ void SvImpLBox::ShowCursor( BOOL bShow )
-void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView,
- BOOL bUpdateVerScrollBar )
+void SvImpLBox::UpdateAll( sal_Bool bInvalidateCompleteView,
+ sal_Bool bUpdateVerScrollBar )
{
if( bUpdateVerScrollBar )
FindMostRight(0);
@@ -711,8 +708,8 @@ void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView,
FillView();
ShowVerSBar();
if( bSimpleTravel && pCursor && pView->HasFocus() )
- pView->Select( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->Select( pCursor, sal_True );
+ ShowCursor( sal_True );
if( bInvalidateCompleteView )
pView->Invalidate();
else
@@ -726,7 +723,7 @@ IMPL_LINK_INLINE_START( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
{
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
pView->nFocusWidth = -1;
@@ -743,7 +740,7 @@ void SvImpLBox::KeyLeftRight( long nDelta )
BeginScroll();
nFlags &= (~F_FILLING);
pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// neuen Origin berechnen
long nPos = aHorSBar.GetThumbPos();
@@ -761,7 +758,7 @@ void SvImpLBox::KeyLeftRight( long nDelta )
else
pView->Invalidate();
RecalcFocusRect();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->NotifyScrolled();
}
@@ -780,8 +777,8 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
if( pView->GetEntryCount() == 0 || !pStartEntry || !pView->GetEntryHeight())
return 0;
- USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
- USHORT nTemp = nClickedEntry;
+ sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
+ sal_uInt16 nTemp = nClickedEntry;
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
return pEntry;
}
@@ -790,13 +787,13 @@ SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
// prueft, ob der Eintrag "richtig" getroffen wurde
// (Focusrect+ ContextBitmap bei TreeListBox)
//
-BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
+sal_Bool SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
{
- BOOL bRet;
+ sal_Bool bRet;
// bei "besonderen" Entries (mit CheckButtons usw.) sind wir
// nicht so pingelig
if( pEntry->ItemCount() >= 3 )
- return TRUE;
+ return sal_True;
Rectangle aRect( pView->GetFocusRect( pEntry, nLine ));
aRect.Right() = GetOutputSize().Width() - pView->GetMapMode().GetOrigin().X();
@@ -809,9 +806,9 @@ BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long n
Point aPos( rPosPixel );
aPos -= pView->GetMapMode().GetOrigin();
if( aRect.IsInside( aPos ) )
- bRet = TRUE;
+ bRet = sal_True;
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -824,8 +821,8 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
|| !pView->GetEntryHeight())
return 0;
- USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
- USHORT nTemp = nClickedEntry;
+ sal_uInt16 nClickedEntry = (sal_uInt16)(rPoint.Y() / pView->GetEntryHeight() );
+ sal_uInt16 nTemp = nClickedEntry;
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
if( nTemp != nClickedEntry )
pEntry = 0;
@@ -833,7 +830,7 @@ SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
}
-SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
+SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,sal_Bool bNotifyScroll)
{
if( !pCursor )
return 0;
@@ -848,19 +845,19 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
pEntry = (SvLBoxEntry*)(pView->NextVisible( pCursor ));
if( pEntry && pEntry != pCursor )
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( nY < 0 )
- KeyUp( FALSE, bNotifyScroll );
+ KeyUp( sal_False, bNotifyScroll );
else
- KeyDown( FALSE, bNotifyScroll );
+ KeyDown( sal_False, bNotifyScroll );
}
else
{
pEntry = GetClickedEntry( rPoint );
if( !pEntry )
{
- USHORT nSteps = 0xFFFF;
+ sal_uInt16 nSteps = 0xFFFF;
// LastVisible ist noch nicht implementiert!
pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps ));
}
@@ -869,7 +866,7 @@ SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
if( pEntry != pCursor &&
aSelEng.GetSelectionMode() == SINGLE_SELECTION
)
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
}
}
return pEntry;
@@ -897,11 +894,11 @@ void SvImpLBox::Paint( const Rectangle& rRect )
SvLBoxEntry* pFirst = pView->First();
if( pFirst != pStartEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pStartEntry = pView->First();
aVerSBar.SetThumbPos( 0 );
StopUserEvent();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1);
return;
}
@@ -919,8 +916,8 @@ void SvImpLBox::Paint( const Rectangle& rRect )
long nEntryHeight = pView->GetEntryHeight();
// Bereich der zu zeichnenden Entries berechnen
- USHORT nStartLine = (USHORT)( rRect.Top() / nEntryHeight );
- USHORT nCount = (USHORT)( nRectHeight / nEntryHeight );
+ sal_uInt16 nStartLine = (sal_uInt16)( rRect.Top() / nEntryHeight );
+ sal_uInt16 nCount = (sal_uInt16)( nRectHeight / nEntryHeight );
nCount += 2; // keine Zeile vergessen
long nY = nStartLine * nEntryHeight;
@@ -935,15 +932,15 @@ void SvImpLBox::Paint( const Rectangle& rRect )
// erst die Linien Zeichnen, dann clippen!
pView->SetClipRegion();
- if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) )
+ if( m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT ) )
DrawNet();
pView->SetClipRegion( aClipRegion );
- for( USHORT n=0; n< nCount && pEntry; n++ )
+ for( sal_uInt16 n=0; n< nCount && pEntry; n++ )
{
/*long nMaxRight=*/
- pView->PaintEntry1( pEntry, nY, 0xffff, TRUE );
+ pView->PaintEntry1( pEntry, nY, 0xffff, sal_True );
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
@@ -951,8 +948,8 @@ void SvImpLBox::Paint( const Rectangle& rRect )
if ( !pCursor && ( ( nExtendedWinBits & EWB_NO_AUTO_CURENTRY ) == 0 ) )
{
// do not select if multiselection or explicit set
- BOOL bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
- || ( ( nWinBits & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
+ sal_Bool bNotSelect = ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION )
+ || ( ( m_nStyle & WB_NOINITIALSELECTION ) == WB_NOINITIALSELECTION );
SetCursor( pStartEntry, bNotSelect );
}
@@ -967,17 +964,17 @@ void SvImpLBox::Paint( const Rectangle& rRect )
nFlags &= (~F_IN_PAINT);
}
-void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
{
if( !pEntry )
return;
- BOOL bInView = IsEntryInView( pEntry );
+ sal_Bool bInView = IsEntryInView( pEntry );
if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
return; // ist schon sichtbar
- if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) )
+ if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) )
nFlags &= (~F_FILLING);
if( !bInView )
{
@@ -989,7 +986,7 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
if( !pView->IsExpanded( pParent ) )
{
#ifdef DBG_UTIL
- BOOL bRet =
+ sal_Bool bRet =
#endif
pView->Expand( pParent );
DBG_ASSERT(bRet,"Not expanded!");
@@ -1003,10 +1000,10 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
}
pStartEntry = pEntry;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
FillView();
aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pView->Invalidate();
}
@@ -1022,21 +1019,21 @@ void SvImpLBox::RepaintSelectionItems()
if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID )
SetNodeBmpTabDistance();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
long nEntryHeight = pView->GetEntryHeight();
- ULONG nCount = nVisibleCount;
+ sal_uLong nCount = nVisibleCount;
long nY = 0;
SvLBoxEntry* pEntry = pStartEntry;
- for( ULONG n=0; n< nCount && pEntry; n++ )
+ for( sal_uLong n=0; n< nCount && pEntry; n++ )
{
pView->PaintEntry1( pEntry, nY, 0xffff ); //wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
@@ -1072,7 +1069,7 @@ void SvImpLBox::DrawNet()
SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
while( pTree->GetDepth( pEntry ) > 0 )
pEntry = pView->GetParent( pEntry );
- USHORT nOffs = (USHORT)(pView->GetVisiblePos( pStartEntry ) -
+ sal_uInt16 nOffs = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ) -
pView->GetVisiblePos( pEntry ));
long nY = 0;
nY -= ( nOffs * nEntryHeight );
@@ -1087,12 +1084,12 @@ void SvImpLBox::DrawNet()
aCol = rStyleSettings.GetShadowColor();
pView->SetLineColor( aCol );
Point aPos1, aPos2;
- USHORT nDistance;
- ULONG nMax = nVisibleCount + nOffs + 1;
+ sal_uInt16 nDistance;
+ sal_uLong nMax = nVisibleCount + nOffs + 1;
const Image& rExpandedNodeBitmap = GetExpandedNodeBmp();
- for( ULONG n=0; n< nMax && pEntry; n++ )
+ for( sal_uLong n=0; n< nMax && pEntry; n++ )
{
if( pView->IsExpanded(pEntry) )
{
@@ -1108,14 +1105,14 @@ void SvImpLBox::DrawNet()
pChild = pView->FirstChild( pEntry );
DBG_ASSERT(pChild,"Child?");
pChild = pTree->LastSibling( pChild );
- nDistance = (USHORT)(pView->GetVisiblePos(pChild) -
+ nDistance = (sal_uInt16)(pView->GetVisiblePos(pChild) -
pView->GetVisiblePos(pEntry));
aPos2 = aPos1;
aPos2.Y() += nDistance * nEntryHeight;
pView->DrawLine( aPos1, aPos2 );
}
// Sichtbar im Control ?
- if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
+ if( n>= nOffs && ((m_nStyle & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
{
// kann aPos1 recyclet werden ?
if( !pView->IsExpanded(pEntry) )
@@ -1137,7 +1134,7 @@ void SvImpLBox::DrawNet()
nY += nEntryHeight;
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
- if( nWinBits & WB_HASLINESATROOT )
+ if( m_nStyle & WB_HASLINESATROOT )
{
pEntry = pView->First();
aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
@@ -1163,7 +1160,7 @@ static long GetOptSize( TabBar* pTabBar )
return pTabBar->CalcWindowSizePixel().Width();
}
-void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask )
+void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
{
long nOverlap = 0;
@@ -1221,30 +1218,31 @@ void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask )
}
// nResult: Bit0 == VerSBar Bit1 == HorSBar
-USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
+sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize )
{
long nEntryHeight = pView->GetEntryHeight();
if( !nEntryHeight )
return 0;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
Size aOSize( pView->Control::GetOutputSizePixel() );
- BOOL bVerSBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
- BOOL bHorBar = FALSE;
+ const WinBits nWindowStyle = pView->GetStyle();
+ sal_Bool bVerSBar = ( nWindowStyle & WB_VSCROLL ) != 0;
+ sal_Bool bHorBar = sal_False;
long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
Point aOrigin( pView->GetMapMode().GetOrigin() );
aOrigin.X() *= -1;
nMaxRight += aOrigin.X() - 1;
long nVis = nMostRight - aOrigin.X();
if( pTabBar || (
- (pView->nWindowStyle & WB_HSCROLL) &&
+ (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) ))
- bHorBar = TRUE;
+ bHorBar = sal_True;
// Anzahl aller nicht eingeklappten Eintraege
- ULONG nTotalCount = pView->GetVisibleCount();
+ sal_uLong nTotalCount = pView->GetVisibleCount();
// Anzahl in der View sichtbarer Eintraege
nVisibleCount = aOSize.Height() / nEntryHeight;
@@ -1257,9 +1255,9 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nMaxRight -= nVerSBarWidth;
if( !bHorBar )
{
- if( (pView->nWindowStyle & WB_HSCROLL) &&
+ if( (nWindowStyle & WB_HSCROLL) &&
(nVis < nMostRight || nMaxRight < nMostRight) )
- bHorBar = TRUE;
+ bHorBar = sal_True;
}
}
@@ -1322,7 +1320,7 @@ USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
nTemp = nNewThumbPos - nTemp;
if( pView->IsEditingActive() )
{
- pView->EndEditing( TRUE ); // Cancel
+ pView->EndEditing( sal_True ); // Cancel
pView->Update();
}
pView->nFocusWidth = -1;
@@ -1378,23 +1376,23 @@ void SvImpLBox::FillView()
{
if( !pStartEntry )
{
- USHORT nVisibleViewCount = (USHORT)(pView->GetVisibleCount());
- USHORT nTempThumb = (USHORT)aVerSBar.GetThumbPos();
+ sal_uInt16 nVisibleViewCount = (sal_uInt16)(pView->GetVisibleCount());
+ sal_uInt16 nTempThumb = (sal_uInt16)aVerSBar.GetThumbPos();
if( nTempThumb >= nVisibleViewCount )
nTempThumb = nVisibleViewCount - 1;
pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb));
}
if( pStartEntry )
{
- USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
- USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
- USHORT nCurDispEntries = nLast-nThumb+1;
+ sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
+ sal_uInt16 nCurDispEntries = nLast-nThumb+1;
if( nCurDispEntries < nVisibleCount )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
// Fenster fuellen, indem der Thumb schrittweise
// nach oben bewegt wird
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
SvLBoxEntry* pTemp = pStartEntry;
while( nCurDispEntries < nVisibleCount && pTemp )
{
@@ -1404,13 +1402,13 @@ void SvImpLBox::FillView()
nThumb--;
pStartEntry = pTemp;
nCurDispEntries++;
- bFound = TRUE;
+ bFound = sal_True;
}
}
if( bFound )
{
aVerSBar.SetThumbPos( nThumb );
- ShowCursor( TRUE ); // Focusrect neu berechnen
+ ShowCursor( sal_True ); // Focusrect neu berechnen
pView->Invalidate();
}
}
@@ -1422,11 +1420,11 @@ void SvImpLBox::FillView()
void SvImpLBox::ShowVerSBar()
{
- BOOL bVerBar = ( pView->nWindowStyle & WB_VSCROLL ) != 0;
- ULONG nVis = 0;
+ sal_Bool bVerBar = ( pView->GetStyle() & WB_VSCROLL ) != 0;
+ sal_uLong nVis = 0;
if( !bVerBar )
nVis = pView->GetVisibleCount();
- if( bVerBar || (nVisibleCount && nVis > (ULONG)(nVisibleCount-1)) )
+ if( bVerBar || (nVisibleCount && nVis > (sal_uLong)(nVisibleCount-1)) )
{
if( !aVerSBar.IsVisible() )
{
@@ -1495,18 +1493,18 @@ void SvImpLBox::SyncVerThumb()
aVerSBar.SetThumbPos( 0 );
}
-BOOL SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const
+sal_Bool SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const
{
// Parent eingeklappt
if( !pView->IsEntryVisible(pEntry) )
- return FALSE;
+ return sal_False;
long nY = GetEntryLine( pEntry );
if( nY < 0 )
- return FALSE;
+ return sal_False;
long nMax = nVisibleCount * pView->GetEntryHeight();
if( nY >= nMax )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
@@ -1549,10 +1547,10 @@ void SvImpLBox::IndentChanged( short /* nIndentPixel */ ) {}
void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry )
{
- // SelAllDestrAnch( FALSE, TRUE ); //DeselectAll();
+ // SelAllDestrAnch( sal_False, sal_True ); //DeselectAll();
if( GetUpdateMode() )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
long nY = GetEntryLine( pEntry );
if( IsLineVisible(nY) )
{
@@ -1564,7 +1562,7 @@ void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry )
// die Thumb-Position korrigiert werden.
SyncVerThumb();
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1573,7 +1571,7 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
if( !pView->IsEntryVisible( pEntry ) )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) )
{
@@ -1583,13 +1581,13 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
if( pStartEntry )
{
long nOldThumbPos = aVerSBar.GetThumbPos();
- ULONG nVisList = pView->GetVisibleCount();
+ sal_uLong nVisList = pView->GetVisibleCount();
aVerSBar.SetRange( Range(0, nVisList-1) );
long nNewThumbPos = aVerSBar.GetThumbPos();
if( nNewThumbPos != nOldThumbPos )
{
pStartEntry = pView->First();
- USHORT nDistance = (USHORT)nNewThumbPos;
+ sal_uInt16 nDistance = (sal_uInt16)nNewThumbPos;
if( nDistance )
pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry,
nDistance));
@@ -1605,9 +1603,9 @@ void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
SetCursor( pEntry );
if( GetUpdateMode() )
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
if( GetUpdateMode() && pCursor )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry )
@@ -1615,7 +1613,7 @@ void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry )
if( !pView->IsEntryVisible( pEntry ) || !pStartEntry )
return;
- SelAllDestrAnch( FALSE, TRUE ); // deselectall
+ SelAllDestrAnch( sal_False, sal_True ); // deselectall
// ist der eingeklappte Parent sichtbar ?
long nY = GetEntryLine( pEntry );
@@ -1658,13 +1656,13 @@ void SvImpLBox::SetNodeBmpTabDistance()
//
// korrigiert bei SingleSelection den Cursor
//
-void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if( nFlags & F_IGNORE_SELECT )
return;
/*
- if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
+ if( (m_nStyle & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
{
SvViewData* pViewData = pView->GetViewData( pEntry );
pViewData->SetCursored( bSelect );
@@ -1685,9 +1683,9 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
long nY = GetEntryLine( pEntry );
if( IsLineVisible( nY ) )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
}
@@ -1731,14 +1729,14 @@ void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry )
if( pCursor && pCursor == pEntry )
{
if( bSimpleTravel )
- pView->Select( pCursor, FALSE );
- ShowCursor( FALSE ); // Focus-Rect weg
+ pView->Select( pCursor, sal_False );
+ ShowCursor( sal_False ); // Focus-Rect weg
// NextSibling, weil auch Childs des Cursors geloescht werden
pTemp = pView->NextSibling( pCursor );
if( !pTemp )
pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor ));
- SetCursor( pTemp, TRUE );
+ SetCursor( pTemp, sal_True );
}
if( pStartEntry && pStartEntry == pEntry )
{
@@ -1771,10 +1769,10 @@ void SvImpLBox::EntryRemoved()
if( !pStartEntry )
pStartEntry = pTree->First();
if( !pCursor )
- SetCursor( pStartEntry, TRUE );
+ SetCursor( pStartEntry, sal_True );
if( pCursor && (bSimpleTravel || !pView->GetSelectionCount() ))
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
if( GetUpdateMode())
{
@@ -1802,9 +1800,9 @@ void SvImpLBox::EntryRemoved()
MakeVisible( pCursor );
}
else
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT);
}
@@ -1813,12 +1811,12 @@ void SvImpLBox::EntryRemoved()
void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry )
{
int bDeselAll = nFlags & F_DESEL_ALL;
- SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
if( !bDeselAll )
nFlags &= (~F_DESEL_ALL);
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( IsEntryInView( pEntry ) )
pView->Invalidate();
if( pEntry == pStartEntry )
@@ -1851,8 +1849,8 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
pStartEntry = pView->First();
aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
- USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry );
- USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry );
+ sal_uInt16 nFirstPos = (sal_uInt16)pTree->GetAbsPos( pStartEntry );
+ sal_uInt16 nNewPos = (sal_uInt16)pTree->GetAbsPos( pEntry );
FindMostRight(0);
if( nNewPos < nFirstPos ) //!!!Notloesung
pStartEntry = pEntry;
@@ -1861,7 +1859,7 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
{
if( pView->IsEntryVisible( pCursor ) )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
else
{
SvLBoxEntry* pParent = pEntry;
@@ -1891,16 +1889,16 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
return;
int bDeselAll = nFlags & F_DESEL_ALL;
if( bDeselAll )
- SelAllDestrAnch( FALSE, TRUE );
+ SelAllDestrAnch( sal_False, sal_True );
else
DestroyAnchor();
// nFlags &= (~F_DESEL_ALL);
-// ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+// ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt
long nY = GetEntryLine( pEntry );
- BOOL bEntryVisible = IsLineVisible( nY );
+ sal_Bool bEntryVisible = IsLineVisible( nY );
if( bEntryVisible )
{
- ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+ ShowCursor( sal_False ); // falls sich Cursor nach unten verschiebt
nY -= pView->GetEntryHeight(); // wg. Linien
InvalidateEntriesFrom( nY );
}
@@ -1909,9 +1907,9 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// pruefen, ob die View komplett gefuellt ist. Wenn
// nicht, dann pStartEntry und den Cursor anpassen
// (automatisches scrollen)
- USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
- USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
- USHORT nCurDispEntries = nLast-nThumb+1;
+ sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
+ sal_uInt16 nCurDispEntries = nLast-nThumb+1;
if( nCurDispEntries < nVisibleCount )
{
// beim naechsten Paint-Event setzen
@@ -1926,7 +1924,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// die Linien invalidieren
/*
if( (bEntryVisible || bPrevEntryVisible) &&
- (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) )
+ (m_nStyle & ( WB_HASLINES | WB_HASLINESATROOT )) )
{
SvLBoxTab* pTab = pView->GetFirstDynamicTab();
if( pTab )
@@ -1944,7 +1942,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
SyncVerThumb(); // falls vor Thumb eingefuegt wurde
ShowVerSBar();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
if( pStartEntry != pView->First() && (nFlags & F_FILLING) )
pView->Update();
}
@@ -1959,7 +1957,7 @@ void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
// ****** Steuerung der Controlanimation
-BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry,
+sal_Bool SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry,
long nY )
{
SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab);
@@ -1970,18 +1968,18 @@ BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry
if( pCursor == pActiveEntry )
pView->HideFocus();
pView->CaptureMouse();
- pActiveButton->SetStateHilighted( TRUE );
+ pActiveButton->SetStateHilighted( sal_True );
pView->PaintEntry1( pActiveEntry, nY,
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
SV_LBOXTAB_ADJUST_RIGHT );
- return TRUE;
+ return sal_True;
}
else
pActiveButton = 0;
- return FALSE;
+ return sal_False;
}
-BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry)
+sal_Bool SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry)
{
if( pActiveButton )
{
@@ -1992,7 +1990,7 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry
{
if( !pActiveButton->IsStateHilighted() )
{
- pActiveButton->SetStateHilighted(TRUE );
+ pActiveButton->SetStateHilighted(sal_True );
nY = GetEntryLine( pActiveEntry );
pView->PaintEntry1( pActiveEntry, nY,
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
@@ -2003,24 +2001,24 @@ BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry
{
if( pActiveButton->IsStateHilighted() )
{
- pActiveButton->SetStateHilighted(FALSE );
+ pActiveButton->SetStateHilighted(sal_False );
nY = GetEntryLine( pActiveEntry );
pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE );
}
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
+sal_Bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
{
if( pActiveButton )
{
pView->ReleaseMouse();
SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
long nY = GetEntryLine( pActiveEntry );
- pActiveButton->SetStateHilighted( FALSE );
+ pActiveButton->SetStateHilighted( sal_False );
long nMouseX = rMEvt.GetPosPixel().X();
if( pEntry == pActiveEntry &&
pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton )
@@ -2029,26 +2027,26 @@ BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
SV_LBOXTAB_ADJUST_RIGHT );
if( pCursor == pActiveEntry )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
pActiveButton = 0;
pActiveEntry = 0;
pActiveTab = 0;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren
-// FALSE == kein Expand/Collapse-Button getroffen
-BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const
+// sal_False == kein Expand/Collapse-Button getroffen
+sal_Bool SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const
{
if( !pEntry->HasChilds() && !pEntry->HasChildsOnDemand() )
- return FALSE;
+ return sal_False;
SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
if( !pFirstDynamicTab )
- return FALSE;
+ return sal_False;
long nMouseX = rPosPixel.X();
// in Doc-Koords umrechnen
@@ -2058,26 +2056,26 @@ BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) cons
long nX = pView->GetTabPos( pEntry, pFirstDynamicTab);
nX += nNodeBmpTabDistance;
if( nMouseX < nX )
- return FALSE;
+ return sal_False;
nX += nNodeBmpWidth;
if( nMouseX > nX )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
-// FALSE == hit no node button
-BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ )
+// sal_False == hit no node button
+sal_Bool SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEntry, long /* nY */ )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( pView->IsEditingActive() && pEntry == pView->pEdEntry )
// inplace editing -> nothing to do
- bRet = TRUE;
+ bRet = sal_True;
else if ( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
{
if ( pView->IsExpanded( pEntry ) )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
pView->Collapse( pEntry );
}
else
@@ -2085,7 +2083,7 @@ BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt, SvLBoxEntry* pEn
// you can expand an entry, which is in editing
pView->Expand( pEntry );
}
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -2152,7 +2150,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// neu selektieren & tschuess
if( !bSimpleTravel && !aSelEng.IsAlwaysAdding())
- SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ SelAllDestrAnch( sal_False, sal_True ); // DeselectAll();
SetCursor( pEntry );
return;
@@ -2165,7 +2163,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
pView->Expand( pEntry );
if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde
// (Nodebutton ist kein Entryitem!)
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
return;
}
}
@@ -2173,7 +2171,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
else
{
// CheckButton? (TreeListBox: Check + Info)
- if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == TRUE)
+ if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == sal_True)
return;
// Inplace-Editing?
}
@@ -2214,31 +2212,32 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
return;
}
-BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
+sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
{
aEditTimer.Stop();
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
if( rKeyCode.IsMod2() )
- return FALSE; // Alt-Taste nicht auswerten
+ return sal_False; // Alt-Taste nicht auswerten
nFlags &= (~F_FILLING);
if( !pCursor )
pCursor = pStartEntry;
if( !pCursor )
- return FALSE;
+ return sal_False;
- BOOL bKeyUsed = TRUE;
+ sal_Bool bKeyUsed = sal_True;
- USHORT nDelta = (USHORT)aVerSBar.GetPageSize();
- USHORT aCode = rKeyCode.GetCode();
+ sal_uInt16 nDelta = (sal_uInt16)aVerSBar.GetPageSize();
+ sal_uInt16 aCode = rKeyCode.GetCode();
- BOOL bShift = rKeyCode.IsShift();
- BOOL bMod1 = rKeyCode.IsMod1();
+ sal_Bool bShift = rKeyCode.IsShift();
+ sal_Bool bMod1 = rKeyCode.IsMod1();
SvLBoxEntry* pNewCursor;
+ const WinBits nWindowStyle = pView->GetStyle();
switch( aCode )
{
case KEY_UP:
@@ -2265,7 +2264,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
if( !IsEntryInView( pNewCursor ) )
- KeyUp( FALSE );
+ KeyUp( sal_False );
}
break;
@@ -2298,13 +2297,13 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else
{
if( pCursor )
- pView->Select( pCursor, FALSE );
- KeyDown( FALSE );
+ pView->Select( pCursor, sal_False );
+ KeyDown( sal_False );
SetCursor( pNewCursor, bMod1 ); // no selection, when Ctrl is on
}
}
else
- KeyDown( FALSE ); // weil ScrollBar-Range evtl. noch
+ KeyDown( sal_False ); // weil ScrollBar-Range evtl. noch
// scrollen erlaubt
break;
@@ -2317,11 +2316,11 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) )
{
++nCurTabPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if( pView->nWindowStyle & WB_HSCROLL )
+ else if( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb += aHorSBar.GetLineSize();
@@ -2337,7 +2336,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
}
@@ -2348,11 +2347,11 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if ( nCurTabPos > FIRST_ENTRY_TAB )
{
--nCurTabPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor );
}
}
- else if ( pView->nWindowStyle & WB_HSCROLL )
+ else if ( nWindowStyle & WB_HSCROLL )
{
long nThumb = aHorSBar.GetThumbPos();
nThumb -= aHorSBar.GetLineSize();
@@ -2380,7 +2379,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if( bSubLstOpLR && IsExpandable() )
pView->Collapse( pCursor );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
}
@@ -2397,19 +2396,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta )
{
- DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
else
{
SetCursor( pNewCursor );
- KeyUp( TRUE );
+ KeyUp( sal_True );
}
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_PAGEDOWN:
@@ -2425,21 +2424,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( nDelta )
{
- DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?");
+ DBG_ASSERT(pNewCursor&&(sal_uLong)pNewCursor!=(sal_uLong)pCursor,"Cursor?");
aSelEng.CursorPosChanging( bShift, bMod1 );
if( IsEntryInView( pNewCursor ) )
SetCursor( pNewCursor );
else
{
SetCursor( pNewCursor );
- KeyDown( TRUE );
+ KeyDown( sal_True );
}
}
else
- KeyDown( FALSE ); // siehe KEY_DOWN
+ KeyDown( sal_False ); // siehe KEY_DOWN
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_SPACE:
@@ -2454,19 +2453,23 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
else if ( !bShift /*&& !bMod1*/ )
{
if ( aSelEng.IsAddMode() )
+ {
// toggle selection
pView->Select( pCursor, !pView->IsSelected( pCursor ) );
- else
+ }
+ else if ( !pView->IsSelected( pCursor ) )
{
- SelAllDestrAnch( FALSE );
- pView->Select( pCursor, TRUE );
+ SelAllDestrAnch( sal_False );
+ pView->Select( pCursor, sal_True );
}
+ else
+ bKeyUsed = sal_False;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_RETURN:
@@ -2478,7 +2481,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
pView->Expand( pCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F2:
@@ -2488,20 +2491,20 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
EditTimerCall( 0 );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_F8:
if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION &&
- !(nWinBits & WB_SIMPLEMODE))
+ !(m_nStyle & WB_SIMPLEMODE))
{
if( aSelEng.IsAlwaysAdding() )
- aSelEng.AddAlways( FALSE );
+ aSelEng.AddAlways( sal_False );
else
- aSelEng.AddAlways( TRUE );
+ aSelEng.AddAlways( sal_True );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_ADD:
@@ -2511,7 +2514,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
pView->Expand( pCursor );
if( bMod1 )
{
- USHORT nRefDepth = pTree->GetDepth( pCursor );
+ sal_uInt16 nRefDepth = pTree->GetDepth( pCursor );
SvLBoxEntry* pCur = pTree->Next( pCursor );
while( pCur && pTree->GetDepth(pCur) > nRefDepth )
{
@@ -2522,14 +2525,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_A:
if( bMod1 )
- SelAllDestrAnch( TRUE );
-// else
-// bKeyUsed = FALSE; #105907# assume user wants to use quicksearch with key "a", so key is handled!
+ SelAllDestrAnch( sal_True );
+ else
+ bKeyUsed = sal_False;
break;
case KEY_SUBTRACT:
@@ -2543,7 +2546,7 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor);
if( pParentToCollapse )
{
- USHORT nRefDepth;
+ sal_uInt16 nRefDepth;
// Sonderbehandlung Explorer: Befindet sich auf der
// Root nur ein Eintrag,dann den Root-Entry nicht
// einklappen
@@ -2573,21 +2576,21 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_DIVIDE :
if( bMod1 )
- SelAllDestrAnch( TRUE );
+ SelAllDestrAnch( sal_True );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_COMMA :
if( bMod1 )
- SelAllDestrAnch( FALSE );
+ SelAllDestrAnch( sal_False );
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_HOME :
@@ -2600,14 +2603,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( pNewCursor && pNewCursor != pCursor )
{
-// SelAllDestrAnch( FALSE );
+// SelAllDestrAnch( sal_False );
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor );
if( !IsEntryInView( pNewCursor ) )
MakeVisible( pNewCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_END :
@@ -2620,14 +2623,14 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
if( pNewCursor && pNewCursor != pCursor)
{
-// SelAllDestrAnch( FALSE );
+// SelAllDestrAnch( sal_False );
aSelEng.CursorPosChanging( bShift, bMod1 );
SetCursor( pNewCursor );
if( !IsEntryInView( pNewCursor ) )
MakeVisible( pNewCursor );
}
else
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
case KEY_ESCAPE:
@@ -2636,14 +2639,19 @@ BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_BACKSPACE:
// #105907# must not be handled because this quits dialogs and does other magic things...
// if there are other single keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
break;
default:
- if( bMod1 || rKeyCode.GetGroup() == KEYGROUP_FKEYS )
- // #105907# CTRL or Function key is pressed, assume user don't want to use quicksearch...
- // if there are groups of keys which should not be handled, they can be added here
- bKeyUsed = FALSE;
+ // is there any reason why we should eat the events here? The only place where this is called
+ // is from SvTreeListBox::KeyInput. If we set bKeyUsed to sal_True here, then the key input
+ // is just silenced. However, we want SvLBox::KeyInput to get a chance, to do the QuickSelection
+ // handling.
+ // (The old code here which intentionally set bKeyUsed to TRUE said this was because of "quick search"
+ // handling, but actually there was no quick search handling anymore. We just re-implemented it.)
+ // #i31275# / 2009-06-16 / frank.schoenheit@sun.com
+ bKeyUsed = sal_False;
+ break;
}
return bKeyUsed;
}
@@ -2652,13 +2660,13 @@ void SvImpLBox::GetFocus()
{
if( pCursor )
{
- pView->SetEntryFocus( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->SetEntryFocus( pCursor, sal_True );
+ ShowCursor( sal_True );
// auskommentiert wg. deselectall
// if( bSimpleTravel && !pView->IsSelected(pCursor) )
-// pView->Select( pCursor, TRUE );
+// pView->Select( pCursor, sal_True );
}
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
@@ -2673,7 +2681,7 @@ void SvImpLBox::GetFocus()
SvViewData* pViewData = pView->GetViewData( pEntry );
if( pViewData->IsCursored() )
{
- pViewData->SetCursored( FALSE );
+ pViewData->SetCursored( sal_False );
InvalidateEntry( pEntry );
}
pEntry = pView->GetModel()->Next( pEntry );
@@ -2688,16 +2696,16 @@ void SvImpLBox::LoseFocus()
{
aEditTimer.Stop();
if( pCursor )
- pView->SetEntryFocus( pCursor,FALSE );
- ShowCursor( FALSE );
+ pView->SetEntryFocus( pCursor,sal_False );
+ ShowCursor( sal_False );
- if( nWinBits & WB_HIDESELECTION )
+ if( m_nStyle & WB_HIDESELECTION )
{
SvLBoxEntry* pEntry = pView->FirstSelected();
while( pEntry )
{
//SvViewData* pViewData = pView->GetViewData( pEntry );
- //pViewData->SetCursored( TRUE );
+ //pViewData->SetCursored( sal_True );
InvalidateEntry( pEntry );
pEntry = pView->NextSelected( pEntry );
}
@@ -2709,7 +2717,7 @@ void SvImpLBox::LoseFocus()
// SelectionEngine
// ********************************************************************
-inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect )
+inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
pView->Select( pEntry, bSelect );
}
@@ -2755,7 +2763,7 @@ void ImpLBSelEng::CreateCursor()
*/
-BOOL ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor)
+sal_Bool ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
{
SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint );
if( pNewCursor != pImp->pCursor )
@@ -2766,19 +2774,19 @@ BOOL ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor
// bei SimpleTravel wird in SetCursor selektiert und
// der Select-Handler gerufen
//if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
- // pImp->SelectEntry( pNewCursor, TRUE );
+ // pImp->SelectEntry( pNewCursor, sal_True );
pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
+sal_Bool ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
{
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( pEntry )
return pView->IsSelected(pEntry);
- return FALSE;
+ return sal_False;
}
void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
@@ -2786,7 +2794,7 @@ void ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( !pEntry )
return;
- pImp->SelectEntry( pEntry, FALSE );
+ pImp->SelectEntry( pEntry, sal_False );
}
/*
@@ -2795,13 +2803,13 @@ void ImpLBSelEng::SelectAtPoint( const Point& rPoint )
SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
if( !pEntry )
return;
- pImp->SelectEntry( pEntry, TRUE );
+ pImp->SelectEntry( pEntry, sal_True );
}
*/
void ImpLBSelEng::DeselectAll()
{
- pImp->SelAllDestrAnch( FALSE, FALSE ); // SelectionEngine nicht resetten!
+ pImp->SelAllDestrAnch( sal_False, sal_False ); // SelectionEngine nicht resetten!
pImp->nFlags &= (~F_DESEL_ALL);
}
@@ -2812,9 +2820,9 @@ void ImpLBSelEng::DeselectAll()
void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor)
{
SvLBoxEntry* pEntry;
- ULONG nAnchorVisPos = pView->GetVisiblePos( pAnchor );
- ULONG nOldVisPos = pView->GetVisiblePos( pOldCursor );
- ULONG nNewVisPos = pView->GetVisiblePos( pNewCursor );
+ sal_uLong nAnchorVisPos = pView->GetVisiblePos( pAnchor );
+ sal_uLong nOldVisPos = pView->GetVisiblePos( pOldCursor );
+ sal_uLong nNewVisPos = pView->GetVisiblePos( pNewCursor );
if( nOldVisPos > nAnchorVisPos ||
( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
@@ -2824,11 +2832,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2837,20 +2845,20 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pAnchor;
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pNewCursor;
while( pEntry && pEntry != pAnchor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2860,11 +2868,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
return;
}
}
@@ -2875,11 +2883,11 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pNewCursor;
while( pEntry && pEntry != pOldCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2888,19 +2896,19 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pAnchor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pAnchor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
if( pEntry )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
return;
}
@@ -2909,7 +2917,7 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
pEntry = pOldCursor;
while( pEntry && pEntry != pNewCursor )
{
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
}
return;
@@ -2917,8 +2925,8 @@ void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCurs
}
}
-void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
- BOOL bSingleSelToo )
+void SvImpLBox::SelAllDestrAnch( sal_Bool bSelect, sal_Bool bDestroyAnchor,
+ sal_Bool bSingleSelToo )
{
SvLBoxEntry* pEntry;
nFlags &= (~F_DESEL_ALL);
@@ -2926,7 +2934,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
{
if( pCursor && !pView->IsSelected( pCursor ))
{
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
return;
}
@@ -2944,7 +2952,7 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
if( !bSelect && pView->GetSelectionCount()==1 && pCursor &&
pView->IsSelected( pCursor ))
{
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
if( bDestroyAnchor )
DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
else
@@ -2955,8 +2963,8 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
if( bSimpleTravel && !pCursor && !GetUpdateMode() )
nFlags |= F_DESEL_ALL;
- ShowCursor( FALSE );
- BOOL bUpdate = GetUpdateMode();
+ ShowCursor( sal_False );
+ sal_Bool bUpdate = GetUpdateMode();
nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun
pEntry = pTree->First();
@@ -2979,18 +2987,18 @@ void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
else
pAnchor = 0; // internen Anker immer loeschen
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
{
aSelEng.SetSelectionMode( eSelMode);
if( eSelMode == SINGLE_SELECTION )
- bSimpleTravel = TRUE;
+ bSimpleTravel = sal_True;
else
- bSimpleTravel = FALSE;
- if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
- aSelEng.AddAlways( TRUE );
+ bSimpleTravel = sal_False;
+ if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
+ aSelEng.AddAlways( sal_True );
}
// ***********************************************************************
@@ -3001,13 +3009,13 @@ void SvImpLBox::SetDragDropMode( DragDropMode eDDMode )
{
if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP )
{
- aSelEng.ExpandSelectionOnMouseMove( FALSE );
- aSelEng.EnableDrag( TRUE );
+ aSelEng.ExpandSelectionOnMouseMove( sal_False );
+ aSelEng.EnableDrag( sal_True );
}
else
{
- aSelEng.ExpandSelectionOnMouseMove( TRUE );
- aSelEng.EnableDrag( FALSE );
+ aSelEng.ExpandSelectionOnMouseMove( sal_True );
+ aSelEng.EnableDrag( sal_False );
}
}
@@ -3055,7 +3063,7 @@ void SvImpLBox::PaintDDCursor( SvLBoxEntry* pInsertionPos )
// Delete all submenus of a PopupMenu, recursively
void lcl_DeleteSubPopups(PopupMenu* pPopup)
{
- for(USHORT i = 0; i < pPopup->GetItemCount(); i++)
+ for(sal_uInt16 i = 0; i < pPopup->GetItemCount(); i++)
{
PopupMenu* pSubPopup = pPopup->GetPopupMenu( pPopup->GetItemId( i ));
if(pSubPopup)
@@ -3066,35 +3074,22 @@ void lcl_DeleteSubPopups(PopupMenu* pPopup)
}
}
-bool SvImpLBox::Command( const CommandEvent& rCEvt )
+void SvImpLBox::Command( const CommandEvent& rCEvt )
{
- USHORT nCommand = rCEvt.GetCommand();
+ sal_uInt16 nCommand = rCEvt.GetCommand();
if( nCommand == COMMAND_CONTEXTMENU )
aEditTimer.Stop();
// Rollmaus-Event?
- if ( ( ( nCommand == COMMAND_WHEEL )
- || ( nCommand == COMMAND_STARTAUTOSCROLL )
- || ( nCommand == COMMAND_AUTOSCROLL )
- )
- && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar )
- )
- {
- return true;
- }
-
- if ( ( nCommand == COMMAND_CONTEXTMENU )
- && !bContextMenuHandling
- )
- {
- return false;
- }
+ if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
+ && pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) )
+ return;
if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU )
{
Point aPopupPos;
- BOOL bClickedIsFreePlace = FALSE;
+ sal_Bool bClickedIsFreePlace = sal_False;
std::stack<SvLBoxEntry*> aSelRestore;
if( rCEvt.IsMouseEvent() )
@@ -3105,7 +3100,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
SvLBoxEntry* pClickedEntry = GetEntry( aPopupPos );
if( pClickedEntry )
{ // mouse in non empty area
- BOOL bClickedIsSelected = FALSE;
+ sal_Bool bClickedIsSelected = sal_False;
// collect the currently selected entries
SvLBoxEntry* pSelected = pView->FirstSelected();
@@ -3118,30 +3113,32 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
// if the entry which the user clicked at is not selected
if( !bClickedIsSelected )
{ // deselect all other and select the clicked one
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
pView->SetCursor( pClickedEntry );
}
}
else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION )
{//modified by BerryJia for fixing Bug102739 2002-9-9 17:00(Beijing Time)
- bClickedIsFreePlace = TRUE;
- INT32 nSelectedEntries = pView->GetSelectionCount();
+ bClickedIsFreePlace = sal_True;
+ sal_Int32 nSelectedEntries = pView->GetSelectionCount();
SvLBoxEntry* pSelected = pView->FirstSelected();
- for(USHORT nSel = 0; nSel < nSelectedEntries; nSel++ )
+ for(sal_uInt16 nSel = 0; nSel < nSelectedEntries; nSel++ )
{
aSelRestore.push(pSelected);
pSelected = pView->NextSelected( pSelected );
}
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
}
else
{ // deselect all
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
}
+
+
}
else
{ // key event (or at least no mouse event)
- INT32 nSelectionCount = pView->GetSelectionCount();
+ sal_Int32 nSelectionCount = pView->GetSelectionCount();
if( nSelectionCount )
{ // now allways take first visible as base for positioning the menu
@@ -3172,7 +3169,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
if( pPopup )
{
// do action for selected entry in popup menu
- USHORT nMenuAction = pPopup->Execute( pView, aPopupPos );
+ sal_uInt16 nMenuAction = pPopup->Execute( pView, aPopupPos );
if ( nMenuAction )
pView->ExcecuteContextMenuAction( nMenuAction );
lcl_DeleteSubPopups(pPopup);
@@ -3186,7 +3183,7 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
SvLBoxEntry* pEntry = aSelRestore.top();
//#i19717# the entry is maybe already deleted
bool bFound = false;
- for(ULONG nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++)
+ for(sal_uLong nEntry = 0; nEntry < pView->GetEntryCount(); nEntry++)
if(pEntry == pView->GetEntry(nEntry))
{
bFound = true;
@@ -3197,18 +3194,15 @@ bool SvImpLBox::Command( const CommandEvent& rCEvt )
aSelRestore.pop();
}
}
- return true;
}
-
- const Point& rPos = rCEvt.GetMousePosPixel();
- if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() )
- aSelEng.Command( rCEvt );
-
- // strictly, this is not correct. However, it leads to a behavior compatible to the one at the time
- // when this method did have a void return value ...
- // A proper solution would be to give the EditEngine::Command also a boolean return value, and forward
- // this (or false) to our caller
- return true;
+#ifndef NOCOMMAND
+ else
+ {
+ const Point& rPos = rCEvt.GetMousePosPixel();
+ if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() )
+ aSelEng.Command( rCEvt );
+ }
+#endif
}
void SvImpLBox::BeginScroll()
@@ -3248,12 +3242,12 @@ void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry )
if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION )
&& ( aSelEng.GetSelectionMode() != NO_SELECTION )
)
- SelAllDestrAnch( FALSE, TRUE, FALSE );
+ SelAllDestrAnch( sal_False, sal_True, sal_False );
if ( pEntry )
MakeVisible( pEntry );
SetCursor( pEntry );
if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
@@ -3275,21 +3269,21 @@ IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, EMPTYARG )
SvLBoxEntry* pEntry = GetCurEntry();
if( pEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pView->ImplEditEntry( pEntry );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
return 0;
}
-BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
+sal_Bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
{
if( rHEvt.GetMode() & HELPMODE_QUICK )
{
Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
if( !GetVisibleArea().IsInside( aPos ))
- return FALSE;
+ return sal_False;
SvLBoxEntry* pEntry = GetEntry( aPos );
if( pEntry )
@@ -3298,18 +3292,18 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
SvLBoxTab* pTab;
SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab ));
if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING )
- return FALSE;
+ return sal_False;
aPos = GetEntryPosition( pEntry );
aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos();
Size aSize( pItem->GetSize( pView, pEntry ) );
SvLBoxTab* pNextTab = NextTab( pTab );
- BOOL bItemClipped = FALSE;
+ sal_Bool bItemClipped = sal_False;
// wurde das Item von seinem rechten Nachbarn abgeschnitten?
if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
{
aSize.Width() = pNextTab->GetPos() - pTab->GetPos();
- bItemClipped = TRUE;
+ bItemClipped = sal_True;
}
Rectangle aItemRect( aPos, aSize );
@@ -3330,19 +3324,19 @@ BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
Help::ShowQuickHelp( pView, aItemRect,
pItem->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER );
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab )
{
- USHORT nTabCount = pView->TabCount();
+ sal_uInt16 nTabCount = pView->TabCount();
if( nTabCount <= 1 )
return 0;
- for( USHORT nTab=0; nTab < (nTabCount-1); nTab++)
+ for( sal_uInt16 nTab=0; nTab < (nTabCount-1); nTab++)
{
if( pView->aTabs[nTab]==pTab )
return (SvLBoxTab*)(pView->aTabs[nTab+1]);
@@ -3360,28 +3354,28 @@ void SvImpLBox::RepaintScrollBars()
{
}
-void SvImpLBox::SetUpdateMode( BOOL bMode )
+void SvImpLBox::SetUpdateMode( sal_Bool bMode )
{
if( bUpdateMode != bMode )
{
bUpdateMode = bMode;
if( bUpdateMode )
- UpdateAll( FALSE );
+ UpdateAll( sal_False );
}
}
-void SvImpLBox::SetUpdateModeFast( BOOL bMode )
+void SvImpLBox::SetUpdateModeFast( sal_Bool bMode )
{
if( bUpdateMode != bMode )
{
bUpdateMode = bMode;
if( bUpdateMode )
- UpdateAll( FALSE, FALSE );
+ UpdateAll( sal_False, sal_False );
}
}
-BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
+sal_Bool SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
{
if( pView->nTreeFlags & TREEFLAG_RECALCTABS )
{
@@ -3390,8 +3384,8 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
nFlags &= ~F_IGNORE_CHANGED_TABS;
}
- USHORT nLastTab = pView->aTabs.Count() - 1;
- USHORT nLastItem = pEntry->ItemCount() - 1;
+ sal_uInt16 nLastTab = pView->aTabs.Count() - 1;
+ sal_uInt16 nLastItem = pEntry->ItemCount() - 1;
if( nLastTab != USHRT_MAX && nLastItem != USHRT_MAX )
{
if( nLastItem < nLastTab )
@@ -3417,10 +3411,10 @@ BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
{
nMostRight = nRight;
pMostRightEntry = pEntry;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void SvImpLBox::FindMostRight( SvLBoxEntry* pEntryToIgnore )
@@ -3454,8 +3448,8 @@ void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToI
if( !pList )
return;
- ULONG nCount = pList->Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = pList->Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pChild = (SvLBoxEntry*)pList->GetObject( nCur );
if( pChild != pEntryToIgnore )
@@ -3560,7 +3554,7 @@ const Image& SvImpLBox::GetDefaultCollapsedNodeImage( )
}
// -----------------------------------------------------------------------
-void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData )
+void SvImpLBox::CallEventListeners( sal_uLong nEvent, void* pData )
{
if ( pView )
pView->CallImplEventListeners( nEvent, pData);
@@ -3568,14 +3562,14 @@ void SvImpLBox::CallEventListeners( ULONG nEvent, void* pData )
// -----------------------------------------------------------------------
-bool SvImpLBox::SetCurrentTabPos( USHORT _nNewPos )
+bool SvImpLBox::SetCurrentTabPos( sal_uInt16 _nNewPos )
{
bool bRet = false;
if ( pView && _nNewPos < ( pView->TabCount() - 2 ) )
{
nCurTabPos = _nNewPos;
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
bRet = true;
}
diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx
index 3ad775fd071f..eab15f65647c 100644
--- a/svtools/source/contnr/svimpicn.cxx
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -97,30 +97,30 @@
#undef TEXT_DRAW_WORDBREAK
#endif
-// #define TEXT_DRAW_DISABLE ((USHORT)0x0001)
-// #define TEXT_DRAW_3DLOOK ((USHORT)0x0002)
-// #define TEXT_DRAW_MNEMONIC ((USHORT)0x0004)
-#define TEXT_DRAW_LEFT ((USHORT)0x0010)
-#define TEXT_DRAW_CENTER ((USHORT)0x0020)
-#define TEXT_DRAW_RIGHT ((USHORT)0x0040)
-#define TEXT_DRAW_TOP ((USHORT)0x0080)
-#define TEXT_DRAW_VCENTER ((USHORT)0x0100)
-#define TEXT_DRAW_BOTTOM ((USHORT)0x0200)
-#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400)
-#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800)
-#define TEXT_DRAW_CLIP ((USHORT)0x1000)
-#define TEXT_DRAW_MULTILINE ((USHORT)0x2000)
-#define TEXT_DRAW_WORDBREAK ((USHORT)0x4000)
+// #define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
+// #define TEXT_DRAW_3DLOOK ((sal_uInt16)0x0002)
+// #define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0004)
+#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010)
+#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020)
+#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040)
+#define TEXT_DRAW_TOP ((sal_uInt16)0x0080)
+#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100)
+#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200)
+#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400)
+#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800)
+#define TEXT_DRAW_CLIP ((sal_uInt16)0x1000)
+#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x2000)
+#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x4000)
XubString GetEllipsisString( OutputDevice* pDev,
const XubString& rStr, long nMaxWidth,
- USHORT nStyle = TEXT_DRAW_ENDELLIPSIS )
+ sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS )
{
XubString aStr = rStr;
if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
- USHORT nIndex = pDev->GetTextBreak( rStr, nMaxWidth );
+ sal_uInt16 nIndex = pDev->GetTextBreak( rStr, nMaxWidth );
if ( nIndex != STRING_LEN )
{
aStr.Erase( nIndex );
@@ -148,11 +148,11 @@ class TextLineInfo
{
private:
long mnWidth;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
public:
- TextLineInfo( long nWidth, USHORT nIndex, USHORT nLen )
+ TextLineInfo( long nWidth, sal_uInt16 nIndex, sal_uInt16 nLen )
{
mnWidth = nWidth;
mnIndex = nIndex;
@@ -160,8 +160,8 @@ public:
}
long GetWidth() const { return mnWidth; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
};
#define MULTITEXTLINEINFO_RESIZE 16
@@ -171,8 +171,8 @@ class MultiTextLineInfo
{
private:
PTextLineInfo* mpLines;
- USHORT mnLines;
- USHORT mnSize;
+ sal_uInt16 mnLines;
+ sal_uInt16 mnSize;
public:
MultiTextLineInfo();
@@ -181,9 +181,9 @@ public:
void AddLine( TextLineInfo* pLine );
void Clear();
- TextLineInfo* GetLine( USHORT nLine ) const
+ TextLineInfo* GetLine( sal_uInt16 nLine ) const
{ return mpLines[nLine]; }
- USHORT Count() const { return mnLines; }
+ sal_uInt16 Count() const { return mnLines; }
private:
MultiTextLineInfo( const MultiTextLineInfo& );
@@ -199,7 +199,7 @@ MultiTextLineInfo::MultiTextLineInfo()
MultiTextLineInfo::~MultiTextLineInfo()
{
- for ( USHORT i = 0; i < mnLines; i++ )
+ for ( sal_uInt16 i = 0; i < mnLines; i++ )
delete mpLines[i];
delete [] mpLines;
}
@@ -220,7 +220,7 @@ void MultiTextLineInfo::AddLine( TextLineInfo* pLine )
void MultiTextLineInfo::Clear()
{
- for ( USHORT i = 0; i < mnLines; i++ )
+ for ( sal_uInt16 i = 0; i < mnLines; i++ )
delete mpLines[i];
mnLines = 0;
}
@@ -229,7 +229,7 @@ void MultiTextLineInfo::Clear()
long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK )
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK )
{
rLineInfo.Clear();
if ( !rStr.Len() )
@@ -237,20 +237,20 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
if ( nWidth <= 0 )
nWidth = 1;
- USHORT nStartPos = 0; // Start-Position der Zeile
- USHORT nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort
- USHORT nLastWordPos = 0; // Position des letzten Wortanfangs
- USHORT i = 0;
- USHORT nPos; // StartPositon der Zeile (nur Temp)
- USHORT nLen; // Laenge der Zeile (nur Temp)
- USHORT nStrLen = rStr.Len();
+ sal_uInt16 nStartPos = 0; // Start-Position der Zeile
+ sal_uInt16 nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort
+ sal_uInt16 nLastWordPos = 0; // Position des letzten Wortanfangs
+ sal_uInt16 i = 0;
+ sal_uInt16 nPos; // StartPositon der Zeile (nur Temp)
+ sal_uInt16 nLen; // Laenge der Zeile (nur Temp)
+ sal_uInt16 nStrLen = rStr.Len();
long nMaxLineWidth = 0; // Maximale Zeilenlaenge
long nLineWidth; // Aktuelle Zeilenlaenge
long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile
xub_Unicode c;
xub_Unicode c2;
const xub_Unicode* pStr = rStr.GetBuffer();
- BOOL bHardBreak = FALSE;
+ sal_Bool bHardBreak = sal_False;
do
{
@@ -258,9 +258,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
// Auf Zeilenende ermitteln
if ( (c == _CR) || (c == _LF) )
- bHardBreak = TRUE;
+ bHardBreak = sal_True;
else
- bHardBreak = FALSE;
+ bHardBreak = sal_False;
// Testen, ob ein Wortende erreicht ist
if ( bHardBreak || (i == nStrLen) ||
@@ -375,9 +375,9 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
// -----------------------------------------------------------------------
-USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
+sal_uInt16 GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK,
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
long* pMaxWidth = NULL )
{
MultiTextLineInfo aMultiLineInfo;
@@ -392,10 +392,10 @@ USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle = TEXT_DRAW_WORDBREAK )
+ sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK )
{
Rectangle aRect = rRect;
- USHORT nLines;
+ sal_uInt16 nLines;
long nWidth = rRect.GetWidth();
long nMaxWidth;
long nTextHeight;
@@ -404,13 +404,13 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
{
MultiTextLineInfo aMultiLineInfo;
TextLineInfo* pLineInfo;
- USHORT nFormatLines;
+ sal_uInt16 nFormatLines;
nMaxWidth = 0;
GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
nFormatLines = aMultiLineInfo.Count();
nTextHeight = pDev->GetTextHeight();
- nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
+ nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight);
if ( nFormatLines <= nLines )
nLines = nFormatLines;
else
@@ -420,7 +420,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
else
nMaxWidth = nWidth;
}
- for ( USHORT i = 0; i < nLines; i++ )
+ for ( sal_uInt16 i = 0; i < nLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
if ( pLineInfo->GetWidth() > nMaxWidth )
@@ -462,7 +462,7 @@ Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
// -----------------------------------------------------------------------
void DrawText( OutputDevice* pDev, const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0 )
+ const XubString& rStr, sal_uInt16 nStyle = 0 )
{
if ( !rStr.Len() || rRect.IsEmpty() )
return;
@@ -484,10 +484,10 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect,
TextLineInfo* pLineInfo;
long nTextHeight = pDev->GetTextHeight();
long nMaxTextWidth;
- USHORT i;
- USHORT nLines = (USHORT)(nHeight/nTextHeight);
- USHORT nFormatLines;
- BOOL bIsClipRegion = FALSE;
+ sal_uInt16 i;
+ sal_uInt16 nLines = (sal_uInt16)(nHeight/nTextHeight);
+ sal_uInt16 nFormatLines;
+ sal_Bool bIsClipRegion = sal_False;
nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
nFormatLines = aMultiLineInfo.Count();
@@ -608,7 +608,7 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect,
if ( nStyle & TEXT_DRAW_CLIP )
{
- BOOL bIsClipRegion = pDev->IsClipRegion();
+ sal_Bool bIsClipRegion = pDev->IsClipRegion();
if ( bIsClipRegion )
{
Region aOldRegion = pDev->GetClipRegion();
@@ -646,7 +646,7 @@ class ImpIcnCursor
SvImpIconView* pView;
SvPtrarr* pColumns;
SvPtrarr* pRows;
- BOOL* pGridMap;
+ sal_Bool* pGridMap;
long nGridDX, nGridDY;
long nGridCols, nGridRows;
long nCols;
@@ -658,34 +658,34 @@ class ImpIcnCursor
void ImplCreate();
void Create() { if( !pColumns ) ImplCreate(); }
- USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
- SvLBoxEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref,
- BOOL bDown, BOOL bSimple );
- SvLBoxEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref,
- BOOL bRight, BOOL bSimple );
+ sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
+ SvLBoxEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref,
+ sal_Bool bDown, sal_Bool bSimple );
+ SvLBoxEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref,
+ sal_Bool bRight, sal_Bool bSimple );
void CreateGridMap();
- // Rueckgabe FALSE: Eintrag liegt nicht in der GridMap. rGridx,y werden
+ // Rueckgabe sal_False: Eintrag liegt nicht in der GridMap. rGridx,y werden
// dann an nGridCols, nGridRows geclippt
- BOOL GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const;
- void SetGridUsed( USHORT nDX, USHORT nDY, BOOL bUsed )
+ sal_Bool GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const;
+ void SetGridUsed( sal_uInt16 nDX, sal_uInt16 nDY, sal_Bool bUsed )
{
pGridMap[ (nDY * nGridCols) + nDX ] = bUsed;
}
public:
ImpIcnCursor( SvImpIconView* pOwner );
~ImpIcnCursor();
- void Clear( BOOL bGridToo = TRUE );
+ void Clear( sal_Bool bGridToo = sal_True );
// fuer Cursortravelling usw.
- SvLBoxEntry* GoLeftRight( SvLBoxEntry*, BOOL bRight );
- SvLBoxEntry* GoUpDown( SvLBoxEntry*, BOOL bDown );
+ SvLBoxEntry* GoLeftRight( SvLBoxEntry*, sal_Bool bRight );
+ SvLBoxEntry* GoUpDown( SvLBoxEntry*, sal_Bool bDown );
- // Rueckgaebe: FALSE == Das leere Rect steht hinter dem letzten
+ // Rueckgaebe: sal_False == Das leere Rect steht hinter dem letzten
// Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste
// leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann
// ausserhalb des View-Space liegen
- BOOL FindEmptyGridRect( Rectangle& rRect );
+ sal_Bool FindEmptyGridRect( Rectangle& rRect );
// Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
// sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
@@ -693,14 +693,14 @@ public:
// muessen mit DestroyGridAdjustData geloescht werden
void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0);
static void DestroyGridAdjustData( SvPtrarr& rLists );
- void SetGridUsed( const Rectangle&, BOOL bUsed = TRUE );
+ void SetGridUsed( const Rectangle&, sal_Bool bUsed = sal_True );
};
SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
- WinBits nWinStyle ) :
+ WinBits i_nWinStyle ) :
aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ),
aHorSBar( pCurView, WB_DRAG | WB_HSCROLL )
{
@@ -708,7 +708,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
pModel = pTree;
pCurParent = 0;
pZOrderList = new SvPtrarr;
- SetWindowBits( nWinStyle );
+ SetStyle( i_nWinStyle );
nHorDist = 0;
nVerDist = 0;
nFlags = 0;
@@ -732,7 +732,7 @@ SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
aEditTimer.SetTimeout( 800 );
aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl));
- Clear( TRUE );
+ Clear( sal_True );
}
SvImpIconView::~SvImpIconView()
@@ -747,14 +747,14 @@ SvImpIconView::~SvImpIconView()
ClearSelectedRectList();
}
-void SvImpIconView::Clear( BOOL bInCtor )
+void SvImpIconView::Clear( sal_Bool bInCtor )
{
StopEditTimer();
CancelUserEvent();
nMaxBmpWidth = 0;
nMaxBmpHeight = 0;
nMaxTextWidth = 0;
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
nMaxBoundHeight = 0;
//XXX
@@ -777,30 +777,29 @@ void SvImpIconView::Clear( BOOL bInCtor )
AdjustScrollBars();
}
-void SvImpIconView::SetWindowBits( WinBits nWinStyle )
+void SvImpIconView::SetStyle( const WinBits i_nWinStyle )
{
- nWinBits = nWinStyle;
nViewMode = VIEWMODE_TEXT;
- if( nWinStyle & WB_NAME )
+ if( i_nWinStyle & WB_NAME )
nViewMode = VIEWMODE_NAME;
- if( nWinStyle & WB_ICON )
+ if( i_nWinStyle & WB_ICON )
nViewMode = VIEWMODE_ICON;
}
IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
// Pfeil hoch: delta=-1; Pfeil runter: delta=+1
- Scroll( 0, pScrollBar->GetDelta(), TRUE );
+ Scroll( 0, pScrollBar->GetDelta(), sal_True );
return 0;
}
IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
{
- pView->EndEditing( TRUE );
+ pView->EndEditing( sal_True );
// Pfeil links: delta=-1; Pfeil rechts: delta=+1
- Scroll( pScrollBar->GetDelta(), 0, TRUE );
+ Scroll( pScrollBar->GetDelta(), 0, sal_True );
return 0;
}
@@ -840,7 +839,7 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry,
{
nMaxTextWidth = aSize.Width();
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
}
SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
@@ -852,14 +851,14 @@ void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry,
nMaxBmpWidth = aSize.Width();
nMaxBmpWidth += (2*LROFFS_ICON);
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
if( aSize.Height() > nMaxBmpHeight )
{
nMaxBmpHeight = aSize.Height();
nMaxBmpHeight += (2*TBOFFS_ICON);;
if( !(nFlags & F_GRIDMODE ) )
- bMustRecalcBoundingRects = TRUE;
+ bMustRecalcBoundingRects = sal_True;
}
}
}
@@ -872,9 +871,9 @@ void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry )
DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?");
pZOrderList->Insert( pEntry, pZOrderList->Count() );
if( nFlags & F_GRIDMODE )
- pImpCursor->Clear( FALSE );
+ pImpCursor->Clear( sal_False );
else
- pImpCursor->Clear( TRUE );
+ pImpCursor->Clear( sal_True );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
CheckSizes( pEntry, pViewData );
if( pView->IsUpdateMode() )
@@ -904,11 +903,11 @@ void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
{
SvLBoxEntry* pNewCursor = GetNewCursor();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
pCursor = 0; // damit er nicht deselektiert wird
SetCursor( pNewCursor );
}
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
pImpCursor->Clear();
}
@@ -951,7 +950,7 @@ void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry )
void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
if( pModel->GetParent(pEntry)==pCurParent )
{
@@ -979,9 +978,9 @@ void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry )
SetCursor( pNextCursor );
}
pImpCursor->Clear();
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
// wenn er nochmal in dieser View auftaucht, muss sein
// Bounding-Rect neu berechnet werden
InvalidateBoundingRect( pViewData->aRect );
@@ -1006,7 +1005,7 @@ void SvImpIconView::CollapsingEntry( SvLBoxEntry* )
{
}
-void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if( pModel->GetParent(pEntry) != pCurParent )
return;
@@ -1026,13 +1025,13 @@ void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
if( pView->IsUpdateMode() )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( nFlags & F_RUBBERING )
PaintEntry( pEntry );
else
pView->Invalidate( GetBoundingRect( pEntry ) );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -1124,7 +1123,7 @@ void SvImpIconView::ResetVirtSize()
StopEditTimer();
aVirtOutputSize.Width() = 0;
aVirtOutputSize.Height() = 0;
- BOOL bLockedEntryFound = FALSE;
+ sal_Bool bLockedEntryFound = sal_False;
nFlags &= (~F_GRID_INSERT);
SvLBoxEntry* pCur = pModel->FirstChild( pCurParent );
while( pCur )
@@ -1137,7 +1136,7 @@ void SvImpIconView::ResetVirtSize()
FindBoundingRect( pCur, pViewData );
else
AdjustVirtSize( pViewData->aRect );
- bLockedEntryFound = TRUE;
+ bLockedEntryFound = sal_True;
}
else
InvalidateBoundingRect( pViewData->aRect );
@@ -1191,16 +1190,16 @@ void SvImpIconView::Arrange()
void SvImpIconView::ImpArrange()
{
StopEditTimer();
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
ResetVirtSize();
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
MapMode aMapMode( pView->GetMapMode());
aMapMode.SetOrigin( Point() );
pView->SetMapMode( aMapMode );
CheckAllSizes();
RecalcAllBoundingRectsSmart();
pView->Invalidate();
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
void SvImpIconView::Paint( const Rectangle& rRect )
@@ -1242,14 +1241,14 @@ void SvImpIconView::Paint( const Rectangle& rRect )
if( !pCursor )
pCursor = pModel->FirstChild( pCurParent );
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
if( !nCount )
return;
SvPtrarr* pNewZOrderList = new SvPtrarr;
SvPtrarr* pPaintedEntries = new SvPtrarr;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
while( nCount )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
@@ -1272,7 +1271,7 @@ void SvImpIconView::Paint( const Rectangle& rRect )
nCount = pPaintedEntries->Count();
if( nCount )
{
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count());
}
delete pPaintedEntries;
@@ -1282,7 +1281,7 @@ void SvImpIconView::Paint( const Rectangle& rRect )
PaintResizeRect( aRect );
}
-BOOL SvImpIconView::GetResizeRect( Rectangle& rRect )
+sal_Bool SvImpIconView::GetResizeRect( Rectangle& rRect )
{
if( aHorSBar.IsVisible() && aVerSBar.IsVisible() )
{
@@ -1293,9 +1292,9 @@ BOOL SvImpIconView::GetResizeRect( Rectangle& rRect )
aOrigin.Y() += aOutputSize.Height();
rRect.SetPos( aOrigin );
rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight));
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvImpIconView::PaintResizeRect( const Rectangle& rRect )
@@ -1355,7 +1354,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
if( !rMEvt.IsMod1() ) // Ctrl
{
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
ClearSelectedRectList();
}
else
@@ -1367,8 +1366,8 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
return;
}
- BOOL bSelected = pView->IsSelected( pEntry );
- BOOL bEditingEnabled = pView->IsInplaceEditingEnabled();
+ sal_Bool bSelected = pView->IsSelected( pEntry );
+ sal_Bool bEditingEnabled = pView->IsInplaceEditingEnabled();
if( rMEvt.GetClicks() == 2 )
{
@@ -1392,7 +1391,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
if( bEditingEnabled && bSelected && !rMEvt.GetModifier() &&
rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) )
{
@@ -1407,7 +1406,7 @@ void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
else
{
@@ -1442,7 +1441,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt )
nFlags &= ~(F_RUBBERING | F_ADD_MODE);
}
- SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), TRUE );
+ SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), sal_True );
if( pEntry )
{
if( nFlags & F_DOWN_CTRL )
@@ -1455,7 +1454,7 @@ void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt )
{
DeselectAllBut( pEntry );
SetCursor( pEntry );
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
}
@@ -1491,12 +1490,12 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
long nScrollDX, nScrollDY;
- CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,FALSE );
- BOOL bSelRectHidden = FALSE;
+ CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,sal_False );
+ sal_Bool bSelRectHidden = sal_False;
if( nScrollDX || nScrollDY )
{
HideSelectionRect();
- bSelRectHidden = TRUE;
+ bSelRectHidden = sal_True;
pView->Scroll( nScrollDX, nScrollDY );
}
Point aDocPos( rMEvt.GetPosPixel() );
@@ -1505,8 +1504,8 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
if( aRect != aCurSelectionRect )
{
HideSelectionRect();
- bSelRectHidden = TRUE;
- BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE;
+ bSelRectHidden = sal_True;
+ sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False;
SelectRect( aRect, bAdd, &aSelectedRectList );
}
if( bSelRectHidden )
@@ -1514,32 +1513,32 @@ void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
}
}
-BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvImpIconView::KeyInput( const KeyEvent& rKEvt )
{
StopEditTimer();
- BOOL bKeyUsed = TRUE;
- BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
- BOOL bInAddMode = (BOOL)((nFlags & F_ADD_MODE) != 0);
+ sal_Bool bKeyUsed = sal_True;
+ sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bInAddMode = (sal_Bool)((nFlags & F_ADD_MODE) != 0);
int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) &&
!bInAddMode;
SvLBoxEntry* pNewCursor;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch( nCode )
{
case KEY_UP:
if( pCursor )
{
MakeVisible( pCursor );
- pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE);
+ pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False);
if( pNewCursor )
{
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
@@ -1557,17 +1556,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_DOWN:
if( pCursor )
{
- pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE );
+ pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True );
if( pNewCursor )
{
MakeVisible( pCursor );
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
}
break;
@@ -1575,17 +1574,17 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_RIGHT:
if( pCursor )
{
- pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE );
+ pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True );
if( pNewCursor )
{
MakeVisible( pCursor );
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
}
break;
@@ -1594,16 +1593,16 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
if( pCursor )
{
MakeVisible( pCursor );
- pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE );
+ pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False );
if( pNewCursor )
{
if( bDeselAll )
- pView->SelectAll( FALSE );
- ShowCursor( FALSE );
+ pView->SelectAll( sal_False );
+ ShowCursor( sal_False );
MakeVisible( pNewCursor );
SetCursor( pNewCursor );
if( !bInAddMode )
- pView->Select( pCursor, TRUE );
+ pView->Select( pCursor, sal_True );
}
else
{
@@ -1622,7 +1621,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
if( nFlags & F_RUBBERING )
{
HideSelectionRect();
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
nFlags &= ~F_RUBBERING;
}
break;
@@ -1663,13 +1662,13 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
case KEY_ADD:
case KEY_DIVIDE :
if( bMod1 )
- pView->SelectAll( TRUE );
+ pView->SelectAll( sal_True );
break;
case KEY_SUBTRACT:
case KEY_COMMA :
if( bMod1 )
- pView->SelectAll( FALSE );
+ pView->SelectAll( sal_False );
break;
case KEY_RETURN:
@@ -1681,7 +1680,7 @@ BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
break;
default:
- bKeyUsed = FALSE;
+ bKeyUsed = sal_False;
}
return bKeyUsed;
@@ -1694,11 +1693,6 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
Point aPos( 0, nRealHeight );
aPos.Y() -= nHorSBarHeight;
-#ifdef WIN
- // vom linken und unteren Rand ein Pixel abschneiden
- aPos.Y()++;
- aPos.X()--;
-#endif
#ifdef OS2
aPos.Y()++;
#endif
@@ -1709,7 +1703,7 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
aPos.X() = nRealWidth; aPos.Y() = 0;
aPos.X() -= nVerSBarWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aPos.X()++;
aPos.Y()--;
#endif
@@ -1751,10 +1745,10 @@ void SvImpIconView::AdjustScrollBars()
else
nVisibleHeight = nRealHeight;
- bool bVerSBar = (pView->nWindowStyle & WB_VSCROLL) ? true : false;
- bool bHorSBar = (pView->nWindowStyle & WB_HSCROLL) ? true : false;
+ bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false;
+ bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false;
- USHORT nResult = 0;
+ sal_uInt16 nResult = 0;
if( nVirtHeight )
{
// activate ver scrollbar ?
@@ -1801,7 +1795,7 @@ void SvImpIconView::AdjustScrollBars()
// size ver scrollbar
long nThumb = aVerSBar.GetThumbPos();
Size aSize( nVerSBarWidth, nRealHeight );
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Height() += 2;
#endif
#ifdef OS2
@@ -1826,7 +1820,7 @@ void SvImpIconView::AdjustScrollBars()
nThumb = aHorSBar.GetThumbPos();
aSize.Width() = nRealWidth;
aSize.Height() = nHorSBarHeight;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
aSize.Width()++;
#endif
#ifdef OS2
@@ -1834,7 +1828,7 @@ void SvImpIconView::AdjustScrollBars()
if( nResult & 0x0001 ) // vertikale Scrollbar ?
aSize.Width()--;
#endif
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0001 ) // vertikale Scrollbar ?
{
aSize.Width()++;
@@ -1860,7 +1854,7 @@ void SvImpIconView::AdjustScrollBars()
nRealWidth++;
#endif
aOutputSize.Width() = nRealWidth;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nResult & 0x0002 ) // hor scrollbar ?
nRealHeight++; // weil unterer Rand geclippt wird
#endif
@@ -1894,23 +1888,23 @@ void SvImpIconView::Resize()
#endif
}
-BOOL SvImpIconView::CheckHorScrollBar()
+sal_Bool SvImpIconView::CheckHorScrollBar()
{
if( !pZOrderList || !aHorSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() )
+ if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() )
{
long nWidth = aOutputSize.Width();
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
long nMostRight = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
long nRight = GetBoundingRect(pEntry).Right();
if( nRight > nWidth )
- return FALSE;
+ return sal_False;
if( nRight > nMostRight )
nMostRight = nRight;
}
@@ -1927,28 +1921,28 @@ BOOL SvImpIconView::CheckHorScrollBar()
aSize.Height() += nHorSBarHeight;
aVerSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SvImpIconView::CheckVerScrollBar()
+sal_Bool SvImpIconView::CheckVerScrollBar()
{
if( !pZOrderList || !aVerSBar.IsVisible() )
- return FALSE;
+ return sal_False;
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
- if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() )
+ if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() )
{
long nDeepest = 0;
long nHeight = aOutputSize.Height();
- USHORT nCount = pZOrderList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pZOrderList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
long nBottom = GetBoundingRect(pEntry).Bottom();
if( nBottom > nHeight )
- return FALSE;
+ return sal_False;
if( nBottom > nDeepest )
nDeepest = nBottom;
}
@@ -1965,9 +1959,9 @@ BOOL SvImpIconView::CheckVerScrollBar()
aSize.Width() += nVerSBarWidth;
aHorSBar.SetSizePixel( aSize );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1984,8 +1978,8 @@ void SvImpIconView::GetFocus()
{
if( pCursor )
{
- pView->SetEntryFocus( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->SetEntryFocus( pCursor, sal_True );
+ ShowCursor( sal_True );
}
}
@@ -1993,8 +1987,8 @@ void SvImpIconView::LoseFocus()
{
StopEditTimer();
if( pCursor )
- pView->SetEntryFocus( pCursor,FALSE );
- ShowCursor( FALSE );
+ pView->SetEntryFocus( pCursor,sal_False );
+ ShowCursor( sal_False );
}
void SvImpIconView::UpdateAll()
@@ -2010,8 +2004,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData
PaintEntry( pEntry, aPos, pViewData );
}
-void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected,
- BOOL bCursored, OutputDevice* pOut )
+void SvImpIconView::PaintEmphasis( const Rectangle& rRect, sal_Bool bSelected,
+ sal_Bool bCursored, OutputDevice* pOut )
{
// HACK fuer D&D
if( nFlags & F_NO_EMPHASIS )
@@ -2049,7 +2043,7 @@ void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected,
}
void SvImpIconView::PaintItem( const Rectangle& rRect,
- SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags,
+ SvLBoxItem* pItem, SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags,
OutputDevice* pOut )
{
if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
@@ -2087,8 +2081,8 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
- BOOL bSelected = pViewData->IsSelected();
- BOOL bCursored = pViewData->IsCursored();
+ sal_Bool bSelected = pViewData->IsSelected();
+ sal_Bool bCursored = pViewData->IsCursored();
Font aTempFont( pOut->GetFont() );
// waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die
@@ -2100,7 +2094,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() );
pOut->SetFont( aNewFont );
}
- Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,FALSE,pViewData));
+ Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,sal_False,pViewData));
Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) );
switch( nViewMode )
@@ -2110,7 +2104,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
PaintEmphasis( aBmpRect, bSelected, bCursored, pOut );
PaintItem( aBmpRect, pBmpItem, pEntry,
PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut );
- PaintEmphasis( aTextRect, bSelected, FALSE, pOut );
+ PaintEmphasis( aTextRect, bSelected, sal_False, pOut );
PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut );
break;
@@ -2118,7 +2112,7 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
PaintEmphasis( aBmpRect, bSelected, bCursored, pOut );
PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut );
- PaintEmphasis( aTextRect, bSelected, FALSE, pOut );
+ PaintEmphasis( aTextRect, bSelected, sal_False, pOut );
PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut );
break;
@@ -2131,11 +2125,11 @@ void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
}
void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
- BOOL bAdjustAtGrid, BOOL bCheckScrollBars )
+ sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars )
{
if( pModel->GetParent(pEntry) == pCurParent )
{
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData ));
pView->Invalidate( aBoundRect );
@@ -2161,7 +2155,7 @@ void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
CheckScrollBars();
PaintEntry( pEntry, pViewData );
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
}
@@ -2172,7 +2166,7 @@ void SvImpIconView::ViewDataInitialized( SvLBoxEntry*)
void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
{
if( pEntry == pCursor )
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
pView->Invalidate( pViewData->aRect );
@@ -2185,7 +2179,7 @@ void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
ViewDataInitialized( (SvLBoxEntry*)pEntry );
pView->Invalidate( pViewData->aRect );
if( pEntry == pCursor )
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
}
@@ -2207,9 +2201,9 @@ void SvImpIconView::SetSelectionMode( SelectionMode )
{
}
-BOOL SvImpIconView::IsEntryInView( SvLBoxEntry* )
+sal_Bool SvImpIconView::IsEntryInView( SvLBoxEntry* )
{
- return FALSE;
+ return sal_False;
}
SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos )
@@ -2227,7 +2221,7 @@ SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos )
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
// Z-Order-Liste vom Ende her absuchen
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
while( nCount )
{
nCount--;
@@ -2246,11 +2240,11 @@ SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCu
{
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
- USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != USHRT_MAX )
{
- USHORT nCount = pZOrderList->Count();
- for( USHORT nCur = nStartPos+1; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pZOrderList->Count();
+ for( sal_uInt16 nCur = nStartPos+1; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur));
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
@@ -2268,7 +2262,7 @@ SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCu
{
CheckBoundingRects();
SvLBoxEntry* pTarget = 0;
- USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
if( nStartPos != USHRT_MAX && nStartPos != 0 )
{
nStartPos--;
@@ -2348,7 +2342,7 @@ Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos,
}
Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry,
- SvLBoxString* pItem, const Point* pPos, BOOL bForInplaceEdit,
+ SvLBoxString* pItem, const Point* pPos, sal_Bool bForInplaceEdit,
SvIcnVwDataEntry* pViewData )
{
long nBmpHeight, nBmpWidth;
@@ -2501,7 +2495,7 @@ void SvImpIconView::RecalcAllBoundingRects()
pZOrderList->Insert( pEntry, pZOrderList->Count() );
pEntry = pModel->NextSibling( pEntry );
}
- bMustRecalcBoundingRects = FALSE;
+ bMustRecalcBoundingRects = sal_False;
AdjustScrollBars();
}
@@ -2580,26 +2574,26 @@ void SvImpIconView::SetCursor( SvLBoxEntry* pEntry )
if( pEntry == pCursor )
return;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
if( pCursor )
{
- pView->SetEntryFocus( pCursor, FALSE );
+ pView->SetEntryFocus( pCursor, sal_False );
if( pView->GetSelectionMode() == SINGLE_SELECTION )
- pView->Select( pCursor, FALSE );
+ pView->Select( pCursor, sal_False );
}
pCursor = pEntry;
ToTop( pCursor );
if( pCursor )
{
- pView->SetEntryFocus(pCursor, TRUE );
+ pView->SetEntryFocus(pCursor, sal_True );
if( pView->GetSelectionMode() == SINGLE_SELECTION )
- pView->Select( pCursor, TRUE );
- ShowCursor( TRUE );
+ pView->Select( pCursor, sal_True );
+ ShowCursor( sal_True );
}
}
-void SvImpIconView::ShowCursor( BOOL bShow )
+void SvImpIconView::ShowCursor( sal_Bool bShow )
{
if( !pCursor || !bShow || !pView->HasFocus() )
{
@@ -2638,7 +2632,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
DELETEZ(pDDDev);
DELETEZ(pDDBufDev);
}
- BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False );
if( !pDDDev )
{
if( pDDBufDev )
@@ -2676,7 +2670,7 @@ void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
PaintEntry( pRefEntry, aPos );
nFlags &= ~F_NO_EMPHASIS;
if( bSelected )
- pView->SvListView::Select( pRefEntry, TRUE );
+ pView->SvListView::Select( pRefEntry, sal_True );
}
void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
@@ -2767,12 +2761,12 @@ void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix
pDDDev->GetOutputSizePixel(),
*pDDTempDev );
- BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False );
if( bSelected )
- pView->SvListView::Select( pRefEntry, TRUE );
+ pView->SvListView::Select( pRefEntry, sal_True );
}
-void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL )
+void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool )
{
CheckBoundingRects();
Rectangle aRect;
@@ -2792,8 +2786,8 @@ void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL )
ImpDrawXORRect( aRect );
}
-BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewPar, ULONG& rNewChildPos )
+sal_Bool SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewPar, sal_uLong& rNewChildPos )
{
if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent )
{
@@ -2803,14 +2797,14 @@ BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
Size aSize( pViewData->aRect.GetSize() );
Point aNewPos = FindNextEntryPos( aSize );
AdjustVirtSize( Rectangle( aNewPos, aSize ) );
- SetEntryPosition( pEntry, aNewPos, FALSE, TRUE );
- return FALSE;
+ SetEntryPosition( pEntry, aNewPos, sal_False, sal_True );
+ return sal_False;
}
return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos);
}
-BOOL SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+sal_Bool SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
{
return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
}
@@ -2847,9 +2841,9 @@ void SvImpIconView::PrepareCommandEvent( const Point& rPt )
aMouseMoveTimer.Stop();
StopEditTimer();
nFlags |= F_CMD_ARRIVED;
- SvLBoxEntry* pEntry = pView->GetEntry( rPt, TRUE );
+ SvLBoxEntry* pEntry = pView->GetEntry( rPt, sal_True );
if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
}
@@ -2858,12 +2852,12 @@ void SvImpIconView::SttDrag( const Point& rPos )
PrepareCommandEvent( rPos );
nFlags |= F_DRAG_SOURCE;
- ShowCursor( FALSE );
+ ShowCursor( sal_False );
}
void SvImpIconView::EndDrag()
{
- ShowCursor( TRUE );
+ ShowCursor( sal_True );
nFlags &= (~F_DRAG_SOURCE);
}
@@ -2872,7 +2866,7 @@ void SvImpIconView::ToTop( SvLBoxEntry* pEntry )
DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?");
if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry )
{
- USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry );
pZOrderList->Remove( nPos, 1 );
pZOrderList->Insert( pEntry, pZOrderList->Count() );
}
@@ -2899,9 +2893,9 @@ void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const
// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der
// sichtbar gemacht werden soll.
-// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
+// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
-void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar )
+void SvImpIconView::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar )
{
Rectangle aRect( rRect );
ClipAtVirtOutRect( aRect );
@@ -2955,7 +2949,7 @@ void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar )
pView->SetMapMode( aMapMode );
// in umgekehrte Richtung scrollen!
- pView->Control::Scroll( -nDx, -nDy, aOutputArea, TRUE );
+ pView->Control::Scroll( -nDx, -nDy, aOutputArea, sal_True );
if( aHorSBar.IsVisible() || aVerSBar.IsVisible() )
{
if( !bScrBar )
@@ -2979,15 +2973,15 @@ SvLBoxEntry* SvImpIconView::GetNewCursor()
SvLBoxEntry* pNewCursor;
if( pCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True );
if( !pNewCursor )
{
- pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False );
if( !pNewCursor )
- pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE );
+ pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True );
}
}
}
@@ -2998,9 +2992,9 @@ SvLBoxEntry* SvImpIconView::GetNewCursor()
}
-USHORT SvImpIconView:: GetSelectionCount() const
+sal_uInt16 SvImpIconView:: GetSelectionCount() const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent);
while( pEntry )
{
@@ -3014,11 +3008,11 @@ USHORT SvImpIconView:: GetSelectionCount() const
void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry )
{
- BOOL bSel;
+ sal_Bool bSel;
if( pView->IsSelected( pEntry ) )
- bSel = FALSE;
+ bSel = sal_False;
else
- bSel = TRUE;
+ bSel = sal_True;
pView->Select( pEntry, bSel );
}
@@ -3029,7 +3023,7 @@ void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot )
while( pEntry )
{
if( pEntry != pThisEntryNot && pView->IsSelected( pEntry ))
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
pEntry = pModel->NextSibling( pEntry );
}
}
@@ -3059,14 +3053,14 @@ ImpIcnCursor::~ImpIcnCursor()
delete pGridMap;
}
-USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
+sal_uInt16 ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
int bVertical )
{
- USHORT nCount = (USHORT)pList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pList->Count();
if( !nCount )
return 0;
- USHORT nCurPos = 0;
+ sal_uInt16 nCurPos = 0;
long nPrevValue = LONG_MIN;
while( nCount )
{
@@ -3078,7 +3072,7 @@ USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
else
nCurValue = rRect.Left();
if( nValue >= nPrevValue && nValue <= nCurValue )
- return (USHORT)nCurPos;
+ return (sal_uInt16)nCurPos;
nPrevValue = nCurValue;
nCount--;
nCurPos++;
@@ -3114,10 +3108,10 @@ void ImpIcnCursor::ImplCreate()
if( nX >= nCols )
nX = sal::static_int_cast< short >(nCols - 1);
- USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE );
+ sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True );
pColumns[ nX ].Insert( pEntry, nIns );
- nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE );
+ nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False );
pRows[ nY ].Insert( pEntry, nIns );
pViewData->nX = nX;
@@ -3161,7 +3155,7 @@ void ImpIcnCursor::CreateGridMap()
//XXX
//nGridRows += 50; // in fuenfziger-Schritten
- pGridMap = new BOOL[ nGridRows*nGridCols];
+ pGridMap = new sal_Bool[ nGridRows*nGridCols];
memset( (void*)pGridMap, 0, nGridRows*nGridCols );
SvLBoxTreeList* pModel = pView->pModel;
@@ -3180,49 +3174,49 @@ void ImpIcnCursor::CreateGridMap()
}
}
-BOOL ImpIcnCursor::GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const
+sal_Bool ImpIcnCursor::GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const
{
Point aPos( rDocPos );
aPos.X() -= LROFFS_WINBORDER;
aPos.Y() -= TBOFFS_WINBORDER;
- rGridX = (USHORT)(aPos.X() / nGridDX);
- rGridY = (USHORT)(aPos.Y() / nGridDY);
- BOOL bInGrid = TRUE;
+ rGridX = (sal_uInt16)(aPos.X() / nGridDX);
+ rGridY = (sal_uInt16)(aPos.Y() / nGridDY);
+ sal_Bool bInGrid = sal_True;
if( rGridX >= nGridCols )
{
- rGridX = sal::static_int_cast< USHORT >(nGridCols - 1);
- bInGrid = FALSE;
+ rGridX = sal::static_int_cast< sal_uInt16 >(nGridCols - 1);
+ bInGrid = sal_False;
}
if( rGridY >= nGridRows )
{
- rGridY = sal::static_int_cast< USHORT >(nGridRows - 1);
+ rGridY = sal::static_int_cast< sal_uInt16 >(nGridRows - 1);
if( !bInGrid )
- return FALSE; // beide Koordinaten nicht im Grid
+ return sal_False; // beide Koordinaten nicht im Grid
}
- return TRUE;
+ return sal_True;
}
-void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, BOOL bUsed )
+void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, sal_Bool bUsed )
{
CreateGridMap();
- USHORT nTLX, nTLY, nBRX, nBRY;
+ sal_uInt16 nTLX, nTLY, nBRX, nBRY;
- BOOL bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY );
- BOOL bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY );
+ sal_Bool bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY );
+ sal_Bool bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY );
if( !bTLInGrid && !bBRInGrid )
return;
- for( USHORT nCurY = nTLY; nCurY <= nBRY; nCurY++ )
+ for( sal_uInt16 nCurY = nTLY; nCurY <= nBRY; nCurY++ )
{
- for( USHORT nCurX = nTLX; nCurX <= nBRX; nCurX++ )
+ for( sal_uInt16 nCurX = nTLX; nCurX <= nBRX; nCurX++ )
{
SetGridUsed( nCurX, nCurY, bUsed );
}
}
}
-void ImpIcnCursor::Clear( BOOL bGridToo )
+void ImpIcnCursor::Clear( sal_Bool bGridToo )
{
if( pColumns )
{
@@ -3242,12 +3236,12 @@ void ImpIcnCursor::Clear( BOOL bGridToo )
}
}
-SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
- USHORT, BOOL bDown, BOOL bSimple )
+SvLBoxEntry* ImpIcnCursor::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,
+ sal_uInt16, sal_Bool bDown, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchCol: No reference entry");
SvPtrarr* pList = &(pColumns[ nCol ]);
- USHORT nCount = pList->Count();
+ sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -3255,7 +3249,7 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List");
if( bDown )
{
@@ -3288,19 +3282,19 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
if( nTop > nBottom )
{
- USHORT nTemp = nTop;
+ sal_uInt16 nTemp = nTop;
nTop = nBottom;
nBottom = nTemp;
}
long nMinDistance = LONG_MAX;
SvLBoxEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
- USHORT nY = pViewData->nY;
+ sal_uInt16 nY = pViewData->nY;
if( nY >= nTop && nY <= nBottom )
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
@@ -3318,12 +3312,12 @@ SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
return pResult;
}
-SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
- USHORT, BOOL bRight, BOOL bSimple )
+SvLBoxEntry* ImpIcnCursor::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight,
+ sal_uInt16, sal_Bool bRight, sal_Bool bSimple )
{
DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
SvPtrarr* pList = &(pRows[ nRow ]);
- USHORT nCount = pList->Count();
+ sal_uInt16 nCount = pList->Count();
if( !nCount )
return 0;
@@ -3331,7 +3325,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
if( bSimple )
{
- USHORT nListPos = pList->GetPos( pCurEntry );
+ sal_uInt16 nListPos = pList->GetPos( pCurEntry );
DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List");
if( bRight )
{
@@ -3364,19 +3358,19 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
}
if( nRight < nLeft )
{
- USHORT nTemp = nRight;
+ sal_uInt16 nTemp = nRight;
nRight = nLeft;
nLeft = nTemp;
}
long nMinDistance = LONG_MAX;
SvLBoxEntry* pResult = 0;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
if( pEntry != pCurEntry )
{
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
- USHORT nX = pViewData->nX;
+ sal_uInt16 nX = pViewData->nX;
if( nX >= nLeft && nX <= nRight )
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
@@ -3398,7 +3392,7 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
/*
Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw.
- linksstehenden. Suchverfahren am Beispiel bRight = TRUE:
+ linksstehenden. Suchverfahren am Beispiel bRight = sal_True:
c
b c
@@ -3413,22 +3407,22 @@ SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
a,b,c : 2., 3., 4. Suchrechteck
*/
-SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
+SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, sal_Bool bRight )
{
SvLBoxEntry* pResult;
pCurEntry = pIcnEntry;
Create();
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry);
- USHORT nY = pViewData->nY;
- USHORT nX = pViewData->nX;
+ sal_uInt16 nY = pViewData->nY;
+ sal_uInt16 nX = pViewData->nX;
DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
// Nachbar auf gleicher Zeile ?
if( bRight )
pResult = SearchRow(
- nY, nX, sal::static_int_cast< USHORT >(nCols-1), nX, TRUE, TRUE );
+ nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True );
else
- pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE );
+ pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True );
if( pResult )
return pResult;
@@ -3446,11 +3440,11 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
nLastCol = -1; // 0-1
}
- USHORT nRowMin = nY;
- USHORT nRowMax = nY;
+ sal_uInt16 nRowMin = nY;
+ sal_uInt16 nRowMax = nY;
do
{
- SvLBoxEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE);
+ SvLBoxEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nRowMin )
@@ -3462,23 +3456,23 @@ SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, BOOL bRight )
return 0;
}
-SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown)
+SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, sal_Bool bDown)
{
SvLBoxEntry* pResult;
pCurEntry = pIcnEntry;
Create();
SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry);
- USHORT nY = pViewData->nY;
- USHORT nX = pViewData->nX;
+ sal_uInt16 nY = pViewData->nY;
+ sal_uInt16 nX = pViewData->nX;
DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
// Nachbar in gleicher Spalte ?
if( bDown )
pResult = SearchCol(
- nX, nY, sal::static_int_cast< USHORT >(nRows-1), nY, TRUE, TRUE );
+ nX, nY, sal::static_int_cast< sal_uInt16 >(nRows-1), nY, sal_True, sal_True );
else
- pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE );
+ pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True );
if( pResult )
return pResult;
@@ -3496,11 +3490,11 @@ SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, BOOL bDown)
nLastRow = -1; // 0-1
}
- USHORT nColMin = nX;
- USHORT nColMax = nX;
+ sal_uInt16 nColMin = nX;
+ sal_uInt16 nColMax = nX;
do
{
- SvLBoxEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE);
+ SvLBoxEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False);
if( pEntry )
return pEntry;
if( nColMin )
@@ -3548,26 +3542,26 @@ void ImpIcnCursor::SetDeltas()
}
}
-BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
+sal_Bool ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
{
CreateGridMap();
- USHORT nCount = (USHORT)(nGridCols * nGridRows);
+ sal_uInt16 nCount = (sal_uInt16)(nGridCols * nGridRows);
if( !nCount )
- return FALSE;
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ return sal_False;
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
if( !pGridMap[ nCur ] )
{
- USHORT nCol = (USHORT)(nCur % nGridCols);
- USHORT nRow = (USHORT)(nCur / nGridCols);
+ sal_uInt16 nCol = (sal_uInt16)(nCur % nGridCols);
+ sal_uInt16 nRow = (sal_uInt16)(nCur / nGridCols);
rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER;
rRect.Bottom() = rRect.Top() + nGridDY;
rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER;
rRect.Right() = rRect.Left() + nGridDX;
- SetGridUsed( nCol, nRow, TRUE );
+ SetGridUsed( nCol, nRow, sal_True );
DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed");
- return TRUE;
+ return sal_True;
}
}
// Gridmap ist voll: Um eine Zeile erweitern
@@ -3575,19 +3569,19 @@ BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
rRect.Bottom() = rRect.Top() + nGridDY;
rRect.Left() = LROFFS_WINBORDER;
rRect.Right() = rRect.Left() + nGridDX;
- return FALSE;
+ return sal_False;
}
void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry)
{
if( !pRefEntry )
{
- USHORT nAdjustRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY);
+ sal_uInt16 nAdjustRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY);
nAdjustRows++; // wg. Abrundung!
if( !nAdjustRows )
return;
- for( USHORT nCurList = 0; nCurList < nAdjustRows; nCurList++ )
+ for( sal_uInt16 nCurList = 0; nCurList < nAdjustRows; nCurList++ )
{
SvPtrarr* pRow = new SvPtrarr;
rLists.Insert( (void*)pRow, nCurList );
@@ -3597,7 +3591,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
{
const Rectangle& rRect = pView->GetBoundingRect( pEntry );
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
- USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE);
+ sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False);
((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns );
pEntry = pView->pModel->NextSibling( pEntry );
}
@@ -3621,7 +3615,7 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
if( nY == nRefRow )
{
- USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE );
+ sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False );
pRow->Insert( pEntry, nIns );
}
pEntry = pView->pModel->NextSibling( pEntry );
@@ -3632,8 +3626,8 @@ void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry
//static
void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists )
{
- USHORT nCount = rLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = rLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ];
delete pArr;
@@ -3690,7 +3684,7 @@ void SvImpIconView::Center( SvLBoxEntry* pEntry,
// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird
// links, hoch: Offsets < 0
// rechts, runter: Offsets > 0
-void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar )
+void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar )
{
const MapMode& rMapMode = pView->GetMapMode();
Point aOrigin( rMapMode.GetOrigin() );
@@ -3728,7 +3722,7 @@ Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry )
}
-void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+void SvImpIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
SvPtrarr* pOtherRects, short nBorderOffs )
{
if( !pZOrderList || !pZOrderList->Count() )
@@ -3736,7 +3730,7 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
CheckBoundingRects();
pView->Update();
- USHORT nCount = pZOrderList->Count();
+ sal_uInt16 nCount = pZOrderList->Count();
Rectangle aRect( rRect );
aRect.Justify();
@@ -3747,9 +3741,9 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
aRect.Top() -= nBorderOffs;
aRect.Bottom() += nBorderOffs;
}
- BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE;
+ sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False;
- for( USHORT nPos = 0; nPos < nCount; nPos++ )
+ for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ )
{
SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
@@ -3758,28 +3752,28 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
if( !IsBoundingRectValid( pViewData->aRect ))
FindBoundingRect( pEntry, pViewData );
const Rectangle& rBoundRect = pViewData->aRect;
- BOOL bSelected = pViewData->IsSelected();
+ sal_Bool bSelected = pViewData->IsSelected();
- BOOL bOverlaps;
+ sal_Bool bOverlaps;
if( bCalcOverlap )
bOverlaps = IsOver( pOtherRects, rBoundRect );
else
- bOverlaps = FALSE;
- BOOL bOver = aRect.IsOver( rBoundRect );
+ bOverlaps = sal_False;
+ sal_Bool bOver = aRect.IsOver( rBoundRect );
if( bOver && !bOverlaps )
{
// Ist im neuen Selektionsrechteck und in keinem alten
// => selektieren
if( !bSelected )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
else if( !bAdd )
{
// ist ausserhalb des Selektionsrechtecks
// => Selektion entfernen
if( bSelected )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
else if( bAdd && bOverlaps )
{
@@ -3799,34 +3793,34 @@ void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
{
// Schnittmenge zwischen alten Rects & aktuellem Rect desel.
if( bSelected )
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
else
{
// Eintrag eines alten Rects selektieren
if( !bSelected )
- pView->Select( pEntry, TRUE );
+ pView->Select( pEntry, sal_True );
}
}
else if( !bOver && bSelected )
{
// Der Eintrag liegt voellig ausserhalb und wird deshalb desel.
- pView->Select( pEntry, FALSE );
+ pView->Select( pEntry, sal_False );
}
}
pView->Update();
}
-BOOL SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+sal_Bool SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
{
- USHORT nCount = pRectList->Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = pRectList->Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
if( rBoundRect.IsOver( *pRect ))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs )
@@ -3845,8 +3839,8 @@ void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs )
void SvImpIconView::ClearSelectedRectList()
{
- USHORT nCount = aSelectedRectList.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = aSelectedRectList.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
delete pRect;
@@ -3884,7 +3878,7 @@ void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect )
}
void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel,
- long& rX, long& rY, BOOL bInDragDrop, USHORT nBorderWidth)
+ long& rX, long& rY, sal_Bool bInDragDrop, sal_uInt16 nBorderWidth)
{
// Scrolling der View, falls sich der Mauszeiger im Grenzbereich des
// Fensters befindet
@@ -3892,8 +3886,8 @@ void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel,
long nPixelToScrollY = 0;
Size aWndSize = aOutputSize;
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
- nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
+ nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
if ( rPosPixel.X() < nBorderWidth )
{
@@ -3945,16 +3939,16 @@ void SvImpIconView::EndTracking()
}
}
-BOOL SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos )
+sal_Bool SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos )
{
SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
if( pItem )
{
Rectangle aRect( CalcTextRect( pEntry, pItem ));
if( aRect.IsInside( rDocPos ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, EMPTYARG )
@@ -3979,8 +3973,8 @@ void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart )
{
SvPtrarr aLists;
pImpCursor->CreateGridAjustData( aLists, pStart );
- USHORT nCount = aLists.Count();
- for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ sal_uInt16 nCount = aLists.Count();
+ for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ )
{
AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart );
}
@@ -3994,18 +3988,18 @@ void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart )
if( !rRow.Count() )
return;
- BOOL bGo;
+ sal_Bool bGo;
if( !pStart )
- bGo = TRUE;
+ bGo = sal_True;
else
- bGo = FALSE;
+ bGo = sal_False;
long nCurRight = 0;
- for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ )
+ for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ )
{
SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ];
if( !bGo && pCur == pStart )
- bGo = TRUE;
+ bGo = sal_True;
SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
// Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 3fa940603aa4..a8b1a62bb4e6 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -43,20 +43,20 @@
struct SvLBoxButtonData_Impl
{
SvLBoxEntry* pEntry;
- BOOL bDefaultImages;
- BOOL bShowRadioButton;
+ sal_Bool bDefaultImages;
+ sal_Bool bShowRadioButton;
- SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( FALSE ), bShowRadioButton( FALSE ) {}
+ SvLBoxButtonData_Impl() : pEntry( NULL ), bDefaultImages( sal_False ), bShowRadioButton( sal_False ) {}
};
DBG_NAME(SvLBoxButtonData)
-void SvLBoxButtonData::InitData( BOOL bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl )
+void SvLBoxButtonData::InitData( sal_Bool bImagesFromDefault, bool _bRadioBtn, const Control* pCtrl )
{
pImpl = new SvLBoxButtonData_Impl;
- bDataOk = FALSE;
+ bDataOk = sal_False;
eState = SV_BUTTON_UNCHECKED;
pImpl->bDefaultImages = bImagesFromDefault;
pImpl->bShowRadioButton = ( _bRadioBtn != false );
@@ -69,21 +69,21 @@ SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings )
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( TRUE, false, pControlForSettings );
+ InitData( sal_True, false, pControlForSettings );
}
SvLBoxButtonData::SvLBoxButtonData( const Control* pControlForSettings, bool _bRadioBtn )
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( TRUE, _bRadioBtn, pControlForSettings );
+ InitData( sal_True, _bRadioBtn, pControlForSettings );
}
SvLBoxButtonData::SvLBoxButtonData()
{
DBG_CTOR(SvLBoxButtonData,0);
- InitData( FALSE, false );
+ InitData( sal_False, false );
}
SvLBoxButtonData::~SvLBoxButtonData()
@@ -102,11 +102,11 @@ void SvLBoxButtonData::CallLink()
aLink.Call( this );
}
-USHORT SvLBoxButtonData::GetIndex( USHORT nItemState )
+sal_uInt16 SvLBoxButtonData::GetIndex( sal_uInt16 nItemState )
{
DBG_CHKTHIS(SvLBoxButtonData,0);
nItemState &= 0x000F;
- USHORT nIdx;
+ sal_uInt16 nIdx;
switch( nItemState )
{
case SV_ITEMSTATE_UNCHECKED:
@@ -133,18 +133,18 @@ void SvLBoxButtonData::SetWidthAndHeight()
Size aSize = aBmps[0].GetSizePixel();
nWidth = aSize.Width();
nHeight = aSize.Height();
- bDataOk = TRUE;
+ bDataOk = sal_True;
}
-void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, USHORT nItemFlags )
+void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, sal_uInt16 nItemFlags )
{
DBG_CHKTHIS(SvLBoxButtonData,0);
pImpl->pEntry = pActEntry;
eState = ConvertToButtonState( nItemFlags );
}
-SvButtonState SvLBoxButtonData::ConvertToButtonState( USHORT nItemFlags ) const
+SvButtonState SvLBoxButtonData::ConvertToButtonState( sal_uInt16 nItemFlags ) const
{
DBG_CHKTHIS(SvLBoxButtonData,0);
nItemFlags &= (SV_ITEMSTATE_UNCHECKED |
@@ -195,12 +195,12 @@ void SvLBoxButtonData::SetDefaultImages( const Control* pCtrl )
}
}
-BOOL SvLBoxButtonData::HasDefaultImages( void ) const
+sal_Bool SvLBoxButtonData::HasDefaultImages( void ) const
{
return pImpl->bDefaultImages;
}
-BOOL SvLBoxButtonData::IsRadio() {
+sal_Bool SvLBoxButtonData::IsRadio() {
return pImpl->bShowRadioButton;
}
@@ -210,7 +210,7 @@ BOOL SvLBoxButtonData::IsRadio() {
DBG_NAME(SvLBoxString);
-SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,USHORT nFlags,const XubString& rStr) :
+SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,sal_uInt16 nFlags,const XubString& rStr) :
SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxString,0);
@@ -227,19 +227,19 @@ SvLBoxString::~SvLBoxString()
DBG_DTOR(SvLBoxString,0);
}
-USHORT SvLBoxString::IsA()
+sal_uInt16 SvLBoxString::IsA()
{
DBG_CHKTHIS(SvLBoxString,0);
return SV_ITEM_ID_LBOXSTRING;
}
-void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* _pEntry)
{
DBG_CHKTHIS(SvLBoxString,0);
if ( _pEntry )
{
- USHORT nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
+ sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
if ( rDev.IsEntryMnemonicsEnabled() )
nStyle |= TEXT_DRAW_MNEMONIC;
rDev.DrawText( Rectangle(rPos,GetSize(&rDev,_pEntry)),aStr,nStyle);
@@ -282,7 +282,7 @@ void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
DBG_NAME(SvLBoxBmp);
-SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, USHORT nFlags, Image aBitmap ) :
+SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image aBitmap ) :
SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxBmp,0);
@@ -299,7 +299,7 @@ SvLBoxBmp::~SvLBoxBmp()
DBG_DTOR(SvLBoxBmp,0);
}
-USHORT SvLBoxBmp::IsA()
+sal_uInt16 SvLBoxBmp::IsA()
{
DBG_CHKTHIS(SvLBoxBmp,0);
return SV_ITEM_ID_LBOXBMP;
@@ -320,11 +320,11 @@ void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
pViewData->aSize = aBmp.GetSizePixel();
}
-void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBoxBmp,0);
- USHORT nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+ sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
rDev.DrawImage( rPos, aBmp ,nStyle);
}
@@ -347,7 +347,7 @@ void SvLBoxBmp::Clone( SvLBoxItem* pSource )
DBG_NAME(SvLBoxButton);
SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry, SvLBoxButtonKind eTheKind,
- USHORT nFlags, SvLBoxButtonData* pBData )
+ sal_uInt16 nFlags, SvLBoxButtonData* pBData )
: SvLBoxItem( pEntry, nFlags )
{
DBG_CTOR(SvLBoxButton,0);
@@ -371,13 +371,13 @@ SvLBoxButton::~SvLBoxButton()
DBG_DTOR(SvLBoxButton,0);
}
-USHORT SvLBoxButton::IsA()
+sal_uInt16 SvLBoxButton::IsA()
{
DBG_CHKTHIS(SvLBoxButton,0);
return SV_ITEM_ID_LBOXBUTTON;
}
-void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
+void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, sal_Bool bOn)
{
DBG_CHKTHIS(SvLBoxButton,0);
if ( bOn != IsStateChecked() )
@@ -389,7 +389,7 @@ void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
}
}
-BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
+sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvLBoxButton,0);
if ( CheckModification() )
@@ -401,30 +401,30 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
pData->StoreButtonState( pEntry, nItemFlags );
pData->CallLink();
}
- return FALSE;
+ return sal_False;
}
-void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
- SvLBoxEntry* )
+void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */,
+ SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
- USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
+ sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage
? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags );
- USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
+ sal_uInt16 nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
///
//Native drawing
///
- BOOL bNativeOK = FALSE;
- Window *pWin = NULL;
- if( rDev.GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) &rDev;
+ sal_Bool bNativeOK = sal_False;
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
- if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
{
+ Size aSize(pData->Width(), pData->Height());
+ ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
ImplControlValue aControlValue;
- Rectangle aCtrlRegion( rPos, Size(pData->Width(), pData->Height()) );
+ Rectangle aCtrlRegion( rPos, aSize );
ControlState nState = 0;
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
@@ -438,8 +438,8 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
if( !bNativeOK)
@@ -458,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
pData = ((SvLBoxButton*)pSource)->pData;
}
+void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
+{
+ if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ {
+ ImplControlValue aControlValue;
+ Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
+ ControlState nState = CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ Rectangle aNativeBounds, aNativeContent;
+ bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
+ PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+ nState,
+ aControlValue,
+ rtl::OUString(),
+ aNativeBounds,
+ aNativeContent );
+ if( bNativeOK )
+ {
+ Size aContentSize( aNativeContent.GetSize() );
+ // leave a little space around the box image (looks better
+ if( aContentSize.Height() + 2 > io_rSize.Height() )
+ io_rSize.Height() = aContentSize.Height() + 2;
+ }
+ }
+}
+
void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- pViewData->aSize = Size( pData->Width(), pData->Height() );
+ Size aSize( pData->Width(), pData->Height() );
+
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( eKind != SvLBoxButtonKind_staticImage && pView )
+ ImplAdjustBoxSize( aSize, eCtrlType, pView );
+ pViewData->aSize = aSize;
}
bool SvLBoxButton::CheckModification() const
@@ -483,14 +517,14 @@ struct SvLBoxContextBmp_Impl
Image m_aImage1;
Image m_aImage2;
- USHORT m_nB2IndicatorFlags;
+ sal_uInt16 m_nB2IndicatorFlags;
};
// ***************************************************************
DBG_NAME(SvLBoxContextBmp)
-SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, USHORT nItemFlags,
- Image aBmp1, Image aBmp2, USHORT nEntryFlags )
+SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, sal_uInt16 nItemFlags,
+ Image aBmp1, Image aBmp2, sal_uInt16 nEntryFlags )
:SvLBoxItem( pEntry, nItemFlags )
,m_pImpl( new SvLBoxContextBmp_Impl )
{
@@ -514,13 +548,13 @@ SvLBoxContextBmp::~SvLBoxContextBmp()
DBG_DTOR(SvLBoxContextBmp,0);
}
-USHORT SvLBoxContextBmp::IsA()
+sal_uInt16 SvLBoxContextBmp::IsA()
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
return SV_ITEM_ID_LBOXCONTEXTBMP;
}
-BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
+sal_Bool SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
@@ -548,7 +582,7 @@ void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
}
void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
- USHORT _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
+ sal_uInt16 _nViewDataEntryFlags, SvLBoxEntry* _pEntry )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
@@ -557,7 +591,7 @@ void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT & _pEntry->GetFlags( ) ) );
// draw
- USHORT nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
+ sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
if ( _bSemiTransparent )
nStyle |= IMAGE_DRAW_SEMITRANSPARENT;
_rDev.DrawImage( _rPos, rImage, nStyle);
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index 67b20b3108c5..94e26128bb22 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -32,7 +32,7 @@
/*
Todo:
- Anker loeschen in SelectionEngine bei manuellem Selektieren
- - SelectAll( FALSE ), nur die deselektierten Entries repainten
+ - SelectAll( sal_False ), nur die deselektierten Entries repainten
*/
#include <string.h>
@@ -76,14 +76,14 @@ SvInplaceEdit::SvInplaceEdit
Edit( pParent, WB_LEFT ),
aCallBackHdl ( rNotifyEditEnd ),
- bCanceled ( FALSE ),
- bAlreadyInCallBack ( FALSE )
+ bCanceled ( sal_False ),
+ bAlreadyInCallBack ( sal_False )
{
DBG_CTOR(SvInplaceEdit,0);
Font aFont( pParent->GetFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aColor( pParent->GetBackground().GetColor() );
aFont.SetFillColor(aColor );
SetFont( aFont );
@@ -119,7 +119,7 @@ SvInplaceEdit::~SvInplaceEdit()
IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
return 1;
}
@@ -128,7 +128,7 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, EMPTYARG )
IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
return 1;
}
@@ -137,16 +137,16 @@ IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, EMPTYARG )
void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt )
{
DBG_CHKTHIS(SvInplaceEdit,0);
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
break;
case KEY_RETURN:
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
break;
@@ -155,7 +155,7 @@ void SvInplaceEdit::KeyInput( const KeyEvent& rKEvt )
}
}
-void SvInplaceEdit::StopEditing( BOOL bCancel )
+void SvInplaceEdit::StopEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvInplaceEdit,0);
if ( !bAlreadyInCallBack )
@@ -170,7 +170,7 @@ void SvInplaceEdit::LoseFocus()
DBG_CHKTHIS(SvInplaceEdit,0);
if ( !bAlreadyInCallBack )
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl));
aTimer.Start();
@@ -191,12 +191,12 @@ void SvInplaceEdit::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallBack )
{
- bAlreadyInCallBack = TRUE;
+ bAlreadyInCallBack = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
Hide();
aCallBackHdl.Call( this );
- // bAlreadyInCallBack = FALSE;
+ // bAlreadyInCallBack = sal_False;
}
}
@@ -267,12 +267,12 @@ SvInplaceEdit2::SvInplaceEdit2
const String& rData,
const Link& rNotifyEditEnd,
const Selection& rSelection,
- BOOL bMulti
+ sal_Bool bMulti
) :
aCallBackHdl ( rNotifyEditEnd ),
- bCanceled ( FALSE ),
- bAlreadyInCallBack ( FALSE ),
+ bCanceled ( sal_False ),
+ bAlreadyInCallBack ( sal_False ),
bMultiLine ( bMulti )
{
@@ -284,7 +284,7 @@ SvInplaceEdit2::SvInplaceEdit2
pEdit = new MyEdit_Impl( pParent, this );
Font aFont( pParent->GetFont() );
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aColor( pParent->GetBackground().GetColor() );
aFont.SetFillColor(aColor );
pEdit->SetFont( aFont );
@@ -332,7 +332,7 @@ void SvInplaceEdit2::Hide()
IMPL_LINK_INLINE_START( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
return 1;
}
@@ -341,35 +341,35 @@ IMPL_LINK_INLINE_END( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, EMPTYARG )
IMPL_LINK_INLINE_START( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
return 1;
}
IMPL_LINK_INLINE_END( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, EMPTYARG )
-BOOL SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
+sal_Bool SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
KeyCode aCode = rKEvt.GetKeyCode();
- USHORT nCode = aCode.GetCode();
+ sal_uInt16 nCode = aCode.GetCode();
switch ( nCode )
{
case KEY_ESCAPE:
- bCanceled = TRUE;
+ bCanceled = sal_True;
CallCallBackHdl_Impl();
- return TRUE;
+ return sal_True;
case KEY_RETURN:
- bCanceled = FALSE;
+ bCanceled = sal_False;
CallCallBackHdl_Impl();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-void SvInplaceEdit2::StopEditing( BOOL bCancel )
+void SvInplaceEdit2::StopEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvInplaceEdit2,0);
if ( !bAlreadyInCallBack )
@@ -386,7 +386,7 @@ void SvInplaceEdit2::LoseFocus()
&& ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
)
{
- bCanceled = FALSE;
+ bCanceled = sal_False;
aTimer.SetTimeout(10);
aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl));
aTimer.Start();
@@ -407,7 +407,7 @@ void SvInplaceEdit2::CallCallBackHdl_Impl()
aTimer.Stop();
if ( !bAlreadyInCallBack )
{
- bAlreadyInCallBack = TRUE;
+ bAlreadyInCallBack = sal_True;
GetpApp()->RemoveAccel( &aAccReturn );
GetpApp()->RemoveAccel( &aAccEscape );
pEdit->Hide();
@@ -434,7 +434,7 @@ SvLBoxTab::SvLBoxTab()
nFlags = 0;
}
-SvLBoxTab::SvLBoxTab( long nPosition, USHORT nTabFlags )
+SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags )
{
DBG_CTOR(SvLBoxTab,0);
nPos = nPosition;
@@ -493,7 +493,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev )
long nWidth;
if ( nFlags & SV_LBOXTAB_ADJUST_NUMERIC )
{
- USHORT nPos = rStr.Search( '.' );
+ sal_uInt16 nPos = rStr.Search( '.' );
if ( nPos == STRING_NOTFOUND )
nPos = rStr.Search( ',' );
if ( nPos == STRING_NOTFOUND )
@@ -517,7 +517,7 @@ long SvLBoxTab::CalcOffset( const String& rStr, const OutputDevice& rOutDev )
DBG_NAME(SvLBoxItem);
-SvLBoxItem::SvLBoxItem( SvLBoxEntry*, USHORT )
+SvLBoxItem::SvLBoxItem( SvLBoxEntry*, sal_uInt16 )
{
DBG_CTOR(SvLBoxItem,0);
}
@@ -542,7 +542,7 @@ const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry )
const Size& SvLBoxItem::GetSize( SvLBoxEntry* pEntry, SvViewDataEntry* pViewData)
{
DBG_CHKTHIS(SvLBoxItem,0);
- USHORT nItemPos = pEntry->GetPos( this );
+ sal_uInt16 nItemPos = pEntry->GetPos( this );
SvViewDataItem* pItemData = pViewData->pItemData+nItemPos;
return pItemData->aSize;
}
@@ -583,7 +583,7 @@ SvLBoxEntry::~SvLBoxEntry()
void SvLBoxEntry::DeleteItems_Impl()
{
DBG_CHKTHIS(SvLBoxEntry,0);
- USHORT nCount = aItems.Count();
+ sal_uInt16 nCount = aItems.Count();
while( nCount )
{
nCount--;
@@ -606,8 +606,8 @@ void SvLBoxEntry::Clone( SvListEntry* pSource )
SvListEntry::Clone( pSource );
SvLBoxItem* pNewItem;
DeleteItems_Impl();
- USHORT nCount = ((SvLBoxEntry*)pSource)->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = ((SvLBoxEntry*)pSource)->ItemCount();
+ sal_uInt16 nCurPos = 0;
while( nCurPos < nCount )
{
SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos );
@@ -620,7 +620,7 @@ void SvLBoxEntry::Clone( SvListEntry* pSource )
nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags;
}
-void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable )
+void SvLBoxEntry::EnableChildsOnDemand( sal_Bool bEnable )
{
DBG_CHKTHIS(SvLBoxEntry,0);
if ( bEnable )
@@ -629,7 +629,7 @@ void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable )
nEntryFlags &= (~SV_ENTRYFLAG_CHILDS_ON_DEMAND);
}
-void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos )
+void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos )
{
DBG_CHKTHIS(SvLBoxEntry,0);
DBG_ASSERT(pNewItem,"ReplaceItem:No Item");
@@ -642,10 +642,10 @@ void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos )
}
}
-SvLBoxItem* SvLBoxEntry::GetFirstItem( USHORT nId )
+SvLBoxItem* SvLBoxEntry::GetFirstItem( sal_uInt16 nId )
{
- USHORT nCount = aItems.Count();
- USHORT nCur = 0;
+ sal_uInt16 nCount = aItems.Count();
+ sal_uInt16 nCur = 0;
SvLBoxItem* pItem;
while( nCur < nCount )
{
@@ -684,6 +684,7 @@ SvLBox_Impl::SvLBox_Impl( SvLBox& _rBox )
,m_bEntryMnemonicsEnabled( false )
,m_pLink( NULL )
,m_aMnemonicEngine( _rBox )
+ ,m_aQuickSelectionEngine( _rBox )
{
}
@@ -698,7 +699,6 @@ SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
DropTargetHelper( this ), DragSourceHelper( this ), eSelMode( NO_SELECTION )
{
DBG_CTOR(SvLBox,0);
- nWindowStyle = nWinStyle;
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nImpFlags = 0;
pTargetEntry = 0;
@@ -723,7 +723,6 @@ SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
DBG_CTOR(SvLBox,0);
pTargetEntry = 0;
nImpFlags = 0;
- nWindowStyle = 0;
pLBoxImpl = new SvLBox_Impl( *this );
nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
nDragDropMode = 0;
@@ -801,7 +800,7 @@ bool SvLBox::IsEntryMnemonicsEnabled() const
return pLBoxImpl->m_bEntryMnemonicsEnabled;
}
-USHORT SvLBox::IsA()
+sal_uInt16 SvLBox::IsA()
{
DBG_CHKTHIS(SvLBox,0);
return SVLISTBOX_ID_LBOX;
@@ -814,17 +813,17 @@ IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
}
IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
-ULONG SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, ULONG nPos )
+sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, sal_uLong nPos )
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nInsPos = pModel->Insert( pEntry, pParent, nPos );
+ sal_uLong nInsPos = pModel->Insert( pEntry, pParent, nPos );
return nInsPos;
}
-ULONG SvLBox::Insert( SvLBoxEntry* pEntry,ULONG nRootPos )
+sal_uLong SvLBox::Insert( SvLBoxEntry* pEntry,sal_uLong nRootPos )
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nInsPos = pModel->Insert( pEntry, nRootPos );
+ sal_uLong nInsPos = pModel->Insert( pEntry, nRootPos );
return nInsPos;
}
@@ -852,48 +851,48 @@ void SvLBox::DeselectHdl()
aDeselectHdl.Call( this );
}
-BOOL SvLBox::DoubleClickHdl()
+sal_Bool SvLBox::DoubleClickHdl()
{
DBG_CHKTHIS(SvLBox,0);
aDoubleClickHdl.Call( this );
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction )
+sal_Bool SvLBox::CheckDragAndDropMode( SvLBox* pSource, sal_Int8 nAction )
{
DBG_CHKTHIS(SvLBox,0);
if ( pSource == this )
{
if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
- return FALSE; // D&D innerhalb der Liste gesperrt
+ return sal_False; // D&D innerhalb der Liste gesperrt
if( DND_ACTION_MOVE == nAction )
{
if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
- return FALSE; // kein lokales Move
+ return sal_False; // kein lokales Move
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
- return FALSE; // kein lokales Copy
+ return sal_False; // kein lokales Copy
}
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
- return FALSE; // kein Drop
+ return sal_False; // kein Drop
if ( DND_ACTION_MOVE == nAction )
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
- return FALSE; // kein globales Move
+ return sal_False; // kein globales Move
}
else
{
if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
- return FALSE; // kein globales Copy
+ return sal_False; // kein globales Copy
}
}
- return TRUE;
+ return sal_True;
}
@@ -919,19 +918,19 @@ void SvLBox::NotifyRemoving( SvLBoxEntry* )
- Entry wird an das Ende der Target-Childlist gehaengt
*/
#ifdef DBG_UTIL
-BOOL SvLBox::NotifyMoving(
+sal_Bool SvLBox::NotifyMoving(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu verschiebender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
#else
-BOOL SvLBox::NotifyMoving(
+sal_Bool SvLBox::NotifyMoving(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry*, // Zu verschiebender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
#endif
{
DBG_CHKTHIS(SvLBox,0);
@@ -940,7 +939,7 @@ BOOL SvLBox::NotifyMoving(
{
rpNewParent = 0;
rNewChildPos = 0;
- return TRUE;
+ return sal_True;
}
if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
{
@@ -959,15 +958,15 @@ BOOL SvLBox::NotifyMoving(
else
rNewChildPos = LIST_APPEND;
}
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::NotifyCopying(
+sal_Bool SvLBox::NotifyCopying(
SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
SvLBoxEntry* pEntry, // Zu kopierender Entry aus
// GetSourceListBox()->GetModel()
SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
- ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+ sal_uLong& rNewChildPos) // Position in Childlist des Target-Parents
{
DBG_CHKTHIS(SvLBox,0);
return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
@@ -977,7 +976,7 @@ BOOL SvLBox::NotifyCopying(
{
rpNewParent = 0;
rNewChildPos = 0;
- return TRUE;
+ return sal_True;
}
if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
{
@@ -994,7 +993,7 @@ BOOL SvLBox::NotifyCopying(
else
rNewChildPos = LIST_APPEND;
}
- return TRUE;
+ return sal_True;
*/
}
@@ -1008,13 +1007,13 @@ SvLBoxEntry* SvLBox::CloneEntry( SvLBoxEntry* pSource )
// Rueckgabe: Alle Entries wurden kopiert
-BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+sal_Bool SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
{
DBG_CHKTHIS(SvLBox,0);
nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
SvTreeEntryList aList;
- BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
@@ -1025,7 +1024,7 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
while ( pSourceEntry )
{
// Childs werden automatisch mitkopiert
- pSource->SelectChilds( pSourceEntry, FALSE );
+ pSource->SelectChilds( pSourceEntry, sal_False );
aList.Insert( pSourceEntry, LIST_APPEND );
pSourceEntry = pSource->NextSelected( pSourceEntry );
}
@@ -1034,13 +1033,13 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
while ( pSourceEntry )
{
SvLBoxEntry* pNewParent = 0;
- ULONG nInsertionPos = LIST_APPEND;
- BOOL bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ sal_uLong nInsertionPos = LIST_APPEND;
+ sal_Bool bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
if ( bOk )
{
if ( bClone )
{
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
pSourceEntry = (SvLBoxEntry*)
pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
pModel->InsertTree( (SvListEntry*)pSourceEntry,
@@ -1048,15 +1047,15 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
}
else
{
- ULONG nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
+ sal_uLong nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
(SvListEntry*)pNewParent, nInsertionPos );
pSourceEntry = GetEntry( pNewParent, nListPos );
}
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
- if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen?
MakeVisible( pSourceEntry );
pSourceEntry = (SvLBoxEntry*)aList.Next();
@@ -1066,18 +1065,18 @@ BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
}
// Rueckgabe: Alle Entries wurden verschoben
-BOOL SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+sal_Bool SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
{
return MoveSelectionCopyFallbackPossible( pSource, pTarget, sal_False );
}
-BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
+sal_Bool SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pTarget, sal_Bool bAllowCopyFallback )
{
DBG_CHKTHIS(SvLBox,0);
nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
SvTreeEntryList aList;
- BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ sal_Bool bClone = (sal_Bool)( (sal_uLong)(pSource->GetModel()) != (sal_uLong)GetModel() );
Link aCloneLink( pModel->GetCloneLink() );
if ( bClone )
pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
@@ -1086,7 +1085,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
while ( pSourceEntry )
{
// Childs werden automatisch mitbewegt
- pSource->SelectChilds( pSourceEntry, FALSE );
+ pSource->SelectChilds( pSourceEntry, sal_False );
aList.Insert( pSourceEntry, LIST_APPEND );
pSourceEntry = pSource->NextSelected( pSourceEntry );
}
@@ -1095,7 +1094,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
while ( pSourceEntry )
{
SvLBoxEntry* pNewParent = 0;
- ULONG nInsertionPos = LIST_APPEND;
+ sal_uLong nInsertionPos = LIST_APPEND;
sal_Bool bOk = NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
sal_Bool bCopyOk = bOk;
if ( !bOk && bAllowCopyFallback )
@@ -1108,7 +1107,7 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
{
if ( bClone )
{
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
pSourceEntry = (SvLBoxEntry*)
pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
pModel->InsertTree( (SvListEntry*)pSourceEntry,
@@ -1125,9 +1124,9 @@ BOOL SvLBox::MoveSelectionCopyFallbackPossible( SvLBox* pSource, SvLBoxEntry* pT
}
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
- if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ if( bOk == (sal_Bool)2 ) // !!!HACK verschobenen Entry sichtbar machen?
MakeVisible( pSourceEntry );
pSourceEntry = (SvLBoxEntry*)aList.Next();
@@ -1148,7 +1147,7 @@ void SvLBox::RemoveSelection()
aList.Insert( pEntry );
if ( pEntry->HasChilds() )
// Remove loescht Childs automatisch
- SelectChilds( pEntry, FALSE );
+ SelectChilds( pEntry, sal_False );
pEntry = NextSelected( pEntry );
}
pEntry = (SvLBoxEntry*)aList.First();
@@ -1181,8 +1180,8 @@ void SvLBox::RecalcViewData()
SvLBoxEntry* pEntry = First();
while( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
while ( nCurPos < nCount )
{
SvLBoxItem* pItem = pEntry->GetItem( nCurPos );
@@ -1206,7 +1205,7 @@ void SvLBox::StateChanged( StateChangedType eType )
Control::StateChanged( eType );
}
-void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow)
+void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow)
{
DBG_CHKTHIS(SvLBox,0);
if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
@@ -1220,37 +1219,43 @@ void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow)
nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
}
-void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, BOOL /* bShow */ )
+void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, sal_Bool /* bShow */ )
{
DBG_CHKTHIS(SvLBox,0);
}
-BOOL SvLBox::Expand( SvLBoxEntry* )
+sal_Bool SvLBox::Expand( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::Collapse( SvLBoxEntry* )
+sal_Bool SvLBox::Collapse( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvLBox::Select( SvLBoxEntry*, BOOL )
+sal_Bool SvLBox::Select( SvLBoxEntry*, sal_Bool )
{
DBG_CHKTHIS(SvLBox,0);
- return FALSE;
+ return sal_False;
}
-ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL )
+sal_uLong SvLBox::SelectChilds( SvLBoxEntry* , sal_Bool )
{
DBG_CHKTHIS(SvLBox,0);
return 0;
}
-void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ )
+void SvLBox::OnCurrentEntryChanged()
+{
+ if ( !pLBoxImpl->m_bDoingQuickSelection )
+ pLBoxImpl->m_aQuickSelectionEngine.Reset();
+}
+
+void SvLBox::SelectAll( sal_Bool /* bSelect */ , sal_Bool /* bPaint */ )
{
DBG_CHKTHIS(SvLBox,0);
}
@@ -1279,9 +1284,9 @@ void SvLBox::FillEntryPath( SvLBoxEntry* pEntry, ::std::deque< sal_Int32 >& _rPa
if ( pEntry )
{
SvLBoxEntry* pParentEntry = GetParent( pEntry );
- while ( TRUE )
+ while ( sal_True )
{
- ULONG i, nCount = GetLevelChildCount( pParentEntry );
+ sal_uLong i, nCount = GetLevelChildCount( pParentEntry );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pTemp = GetEntry( pParentEntry, i );
@@ -1311,11 +1316,11 @@ String SvLBox::GetEntryText( SvLBoxEntry* ) const
return String();
}
-ULONG SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
+sal_uLong SvLBox::GetLevelChildCount( SvLBoxEntry* _pParent ) const
{
DBG_CHKTHIS(SvLBox,0);
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
SvLBoxEntry* pEntry = FirstChild( _pParent );
while ( pEntry )
{
@@ -1354,8 +1359,8 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ];
SvViewDataItem* pItemData = pEntryData->pItemData;
pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete
- USHORT nCount = pInhEntry->ItemCount();
- USHORT nCurPos = 0;
+ sal_uInt16 nCount = pInhEntry->ItemCount();
+ sal_uInt16 nCurPos = 0;
while( nCurPos < nCount )
{
SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos );
@@ -1367,10 +1372,10 @@ void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
-void SvLBox::EnableSelectionAsDropTarget( BOOL bEnable, BOOL bWithChilds )
+void SvLBox::EnableSelectionAsDropTarget( sal_Bool bEnable, sal_Bool bWithChilds )
{
DBG_CHKTHIS(SvLBox,0);
- USHORT nRefDepth;
+ sal_uInt16 nRefDepth;
SvLBoxEntry* pTemp;
SvLBoxEntry* pSelEntry = FirstSelected();
@@ -1421,11 +1426,11 @@ SvLBoxEntry* SvLBox::GetDropTarget( const Point& )
void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
const Selection& rSel )
{
- EditText( rStr, rRect, rSel, FALSE );
+ EditText( rStr, rRect, rSel, sal_False );
}
void SvLBox::EditText( const String& rStr, const Rectangle& rRect,
- const Selection& rSel, BOOL bMulti )
+ const Selection& rSel, sal_Bool bMulti )
{
DBG_CHKTHIS(SvLBox,0);
if( pEdCtrl )
@@ -1467,11 +1472,11 @@ void SvLBox::CancelTextEditing()
{
DBG_CHKTHIS(SvLBox,0);
if ( pEdCtrl )
- pEdCtrl->StopEditing( TRUE );
+ pEdCtrl->StopEditing( sal_True );
nImpFlags &= (~SVLBOX_IN_EDT);
}
-void SvLBox::EndEditing( BOOL bCancel )
+void SvLBox::EndEditing( sal_Bool bCancel )
{
DBG_CHKTHIS(SvLBox,0);
if( pEdCtrl )
@@ -1534,15 +1539,14 @@ void SvLBox::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt );
}
-const void* SvLBox::FirstSearchEntry( String& _rEntryText )
+const void* SvLBox::FirstSearchEntry( String& _rEntryText ) const
{
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) );
else
{
- if ( !pEntry )
- pEntry = FirstSelected();
+ pEntry = FirstSelected();
if ( !pEntry )
pEntry = First();
}
@@ -1553,11 +1557,23 @@ const void* SvLBox::FirstSearchEntry( String& _rEntryText )
return pEntry;
}
-const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText )
+const void* SvLBox::NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pCurrentSearchEntry ) );
- pEntry = Next( pEntry );
+ if ( ( ( GetChildCount( pEntry ) > 0 )
+ || ( pEntry->HasChildsOnDemand() )
+ )
+ && !IsExpanded( pEntry )
+ )
+ {
+ pEntry = NextSibling( pEntry );
+ }
+ else
+ {
+ pEntry = Next( pEntry );
+ }
+
if ( !pEntry )
pEntry = First();
@@ -1571,28 +1587,61 @@ void SvLBox::SelectSearchEntry( const void* _pEntry )
{
SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
DBG_ASSERT( pEntry, "SvLBox::SelectSearchEntry: invalid entry!" );
- if ( pEntry )
+ if ( !pEntry )
return;
- SelectAll( FALSE );
+ SelectAll( sal_False );
SetCurEntry( pEntry );
Select( pEntry );
}
-void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ )
+void SvLBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const
{
// nothing to do here, we have no "execution"
}
+::vcl::StringEntryIdentifier SvLBox::CurrentEntry( String& _out_entryText ) const
+{
+ // always accept the current entry if there is one
+ SvLBoxEntry* pCurrentEntry( GetCurEntry() );
+ if ( pCurrentEntry )
+ {
+ _out_entryText = GetEntryText( pCurrentEntry );
+ return pCurrentEntry;
+ }
+ return FirstSearchEntry( _out_entryText );
+}
+
+::vcl::StringEntryIdentifier SvLBox::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ return NextSearchEntry( _currentEntry, _out_entryText );
+}
+
+void SvLBox::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ SelectSearchEntry( _entry );
+}
+
bool SvLBox::HandleKeyInput( const KeyEvent& _rKEvt )
{
- if ( !IsEntryMnemonicsEnabled() )
- return false;
+ if ( IsEntryMnemonicsEnabled()
+ && pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt )
+ )
+ return true;
+
+ if ( ( GetStyle() & WB_QUICK_SEARCH ) != 0 )
+ {
+ pLBoxImpl->m_bDoingQuickSelection = true;
+ const bool bHandled = pLBoxImpl->m_aQuickSelectionEngine.HandleKeyEvent( _rKEvt );
+ pLBoxImpl->m_bDoingQuickSelection = false;
+ if ( bHandled )
+ return true;
+ }
- return pLBoxImpl->m_aMnemonicEngine.HandleKeyEvent( _rKEvt );
+ return false;
}
-SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
+SvLBoxEntry* SvLBox::GetEntry( const Point&, sal_Bool ) const
{
DBG_CHKTHIS(SvLBox,0);
return 0;
@@ -1601,15 +1650,15 @@ SvLBoxEntry* SvLBox::GetEntry( const Point&, BOOL ) const
void SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvLBox,0);
- USHORT nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
- for( USHORT nIdx = 0; nIdx < nCount; nIdx++ )
+ sal_uInt16 nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
+ for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ )
{
SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx );
pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 );
}
}
-void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse )
+void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, sal_Bool bInUse )
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1631,7 +1680,7 @@ void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse )
}
}
-void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored )
+void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, sal_Bool bCursored )
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1646,7 +1695,7 @@ void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored )
}
}
-BOOL SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const
+sal_Bool SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const
{
DBG_CHKTHIS(SvLBox,0);
DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
@@ -1665,11 +1714,11 @@ void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* )
DBG_CHKTHIS(SvLBox,0);
}
-BOOL SvLBox::EditingCanceled() const
+sal_Bool SvLBox::EditingCanceled() const
{
if( pEdCtrl && pEdCtrl->EditingCanceled() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
@@ -1681,7 +1730,7 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt )
if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) )
{
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
}
else if( !nDragDropMode )
{
@@ -1708,12 +1757,12 @@ sal_Int8 SvLBox::AcceptDrop( const AcceptDropEvent& rEvt )
// **** Emphasis zeichnen ****
if( DND_ACTION_NONE == nRet )
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
{
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, TRUE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_True );
}
}
return nRet;
@@ -1725,9 +1774,9 @@ sal_Int8 SvLBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvLBox* pSourceView
sal_Int8 nRet = DND_ACTION_NONE;
DBG_ASSERT( pSourceView, "SvLBox::ExecuteDrop(): no source view" );
- pSourceView->EnableSelectionAsDropTarget( TRUE, TRUE );
+ pSourceView->EnableSelectionAsDropTarget( sal_True, sal_True );
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pDDTarget = this;
SvLBoxDDInfo aDDInfo;
@@ -1823,8 +1872,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
pDDSource = this;
pDDTarget = 0;
- BOOL bOldUpdateMode = Control::IsUpdateMode();
- Control::SetUpdateMode( TRUE );
+ sal_Bool bOldUpdateMode = Control::IsUpdateMode();
+ Control::SetUpdateMode( sal_True );
Update();
Control::SetUpdateMode( bOldUpdateMode );
@@ -1832,8 +1881,8 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
// Wichtig: Wenn im DropHandler die Selektion der
// SourceListBox veraendert wird, muessen vorher die Eintraege
// als DropTargets wieder freigeschaltet werden:
- // (GetSourceListBox()->EnableSelectionAsDropTarget( TRUE, TRUE );)
- EnableSelectionAsDropTarget( FALSE, TRUE /* with Childs */ );
+ // (GetSourceListBox()->EnableSelectionAsDropTarget( sal_True, sal_True );)
+ EnableSelectionAsDropTarget( sal_False, sal_True /* with Childs */ );
pContainer->StartDrag( this, nDragOptions, GetDragFinishedHdl() );
}
@@ -1844,18 +1893,18 @@ nAction
#endif
)
{
- EnableSelectionAsDropTarget( TRUE, TRUE );
+ EnableSelectionAsDropTarget( sal_True, sal_True );
#ifndef UNX
if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget &&
- ((ULONG)(pDDTarget->GetModel())!=(ULONG)(this->GetModel()))) ||
+ ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
!pDDTarget ))
{
RemoveSelection();
}
#endif
- ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
pDDSource = 0;
pDDTarget = 0;
pTargetEntry = 0;
@@ -1868,10 +1917,10 @@ DragDropMode SvLBox::NotifyStartDrag( TransferDataContainer&, SvLBoxEntry* )
return (DragDropMode)0xffff;
}
-BOOL SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
+sal_Bool SvLBox::NotifyAcceptDrop( SvLBoxEntry* )
{
DBG_CHKTHIS(SvLBox,0);
- return TRUE;
+ return sal_True;
}
// handler and methods for Drag - finished handler.
@@ -1888,20 +1937,20 @@ namespace
void SvLBox::AddBoxToDDList_Impl( const SvLBox& rB )
{
- ULONG nVal = (ULONG)&rB;
+ sal_uLong nVal = (sal_uLong)&rB;
SortLBoxes::get().Insert( nVal );
}
void SvLBox::RemoveBoxFromDDList_Impl( const SvLBox& rB )
{
- ULONG nVal = (ULONG)&rB;
+ sal_uLong nVal = (sal_uLong)&rB;
SortLBoxes::get().Remove( nVal );
}
IMPL_STATIC_LINK( SvLBox, DragFinishHdl_Impl, sal_Int8*, pAction )
{
- ULONG nVal = (ULONG)pThis;
- USHORT nFnd;
+ sal_uLong nVal = (sal_uLong)pThis;
+ sal_uInt16 nFnd;
SvULongsSort &rSortLBoxes = SortLBoxes::get();
if( rSortLBoxes.Seek_Entry( nVal, &nFnd ) )
{
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index db6a3dd0d3c5..4b1c00e4c873 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -72,7 +72,7 @@ void SvTabListBox::SetTabs()
*/
// alle anderen Tabs an Liste haengen
- for( USHORT nCurTab = 1; nCurTab < nTabCount; nCurTab++ )
+ for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ )
{
SvLBoxTab* pTab = pTabList+nCurTab;
AddTab( pTab->GetPos(), pTab->nFlags );
@@ -87,10 +87,10 @@ void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
XubString aToken;
const xub_Unicode* pCurToken = aCurEntry.GetBuffer();
- USHORT nCurTokenLen;
+ sal_uInt16 nCurTokenLen;
const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
- USHORT nCount = nTabCount; nCount--;
- for( USHORT nToken = 0; nToken < nCount; nToken++ )
+ sal_uInt16 nCount = nTabCount; nCount--;
+ for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
{
if( pCurToken && nCurTokenLen )
// aToken.Assign( pCurToken, nCurTokenLen );
@@ -144,7 +144,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
return;
delete [] pTabList;
- USHORT nCount = (USHORT)(*pTabs);
+ sal_uInt16 nCount = (sal_uInt16)(*pTabs);
pTabList = new SvLBoxTab[ nCount ];
nTabCount = nCount;
@@ -152,7 +152,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
MapMode aMMDest( MAP_PIXEL );
pTabs++;
- for( USHORT nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
+ for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
{
Size aSize( *pTabs, 0 );
aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
@@ -165,7 +165,7 @@ void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
Invalidate();
}
-void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit )
+void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit )
{
DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos");
if( nTab < nTabCount )
@@ -184,8 +184,8 @@ void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit )
}
SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText, SvLBoxEntry* pParent,
- BOOL /*bChildsOnDemand*/,
- ULONG nPos, void* pUserData,
+ sal_Bool /*bChildsOnDemand*/,
+ sal_uLong nPos, void* pUserData,
SvLBoxButtonKind )
{
return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData );
@@ -195,15 +195,15 @@ SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rText,
const Image& rExpandedEntryBmp,
const Image& rCollapsedEntryBmp,
SvLBoxEntry* pParent,
- BOOL /*bChildsOnDemand*/,
- ULONG nPos, void* pUserData,
+ sal_Bool /*bChildsOnDemand*/,
+ sal_uLong nPos, void* pUserData,
SvLBoxButtonKind )
{
return InsertEntryToColumn( rText, rExpandedEntryBmp, rCollapsedEntryBmp,
pParent, nPos, 0xffff, pUserData );
}
-SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol,
+SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol,
void* pUser )
{
XubString aStr;
@@ -217,7 +217,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry
}
aStr += rStr;
XubString aFirstStr( aStr );
- USHORT nEnd = aFirstStr.Search( '\t' );
+ sal_uInt16 nEnd = aFirstStr.Search( '\t' );
if( nEnd != STRING_NOTFOUND )
{
aFirstStr.Erase( nEnd );
@@ -226,12 +226,12 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn(const XubString& rStr,SvLBoxEntry
}
else
aCurEntry.Erase();
- return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser );
+ return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUser );
}
SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
- SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser )
+ SvLBoxEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser )
{
XubString aStr;
if( nCol != 0xffff )
@@ -244,7 +244,7 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
}
aStr += rStr;
XubString aFirstStr( aStr );
- USHORT nEnd = aFirstStr.Search( '\t' );
+ sal_uInt16 nEnd = aFirstStr.Search( '\t' );
if( nEnd != STRING_NOTFOUND )
{
aFirstStr.Erase( nEnd );
@@ -257,11 +257,11 @@ SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr,
return SvTreeListBox::InsertEntry(
aFirstStr,
rExpandedEntryBmp, rCollapsedEntryBmp,
- pParent, FALSE, nPos, pUser );
+ pParent, sal_False, nPos, pUser );
}
-SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, ULONG nPos,
- USHORT nCol, void* pUser )
+SvLBoxEntry* SvTabListBox::InsertEntryToColumn( const XubString& rStr, sal_uLong nPos,
+ sal_uInt16 nCol, void* pUser )
{
return InsertEntryToColumn( rStr,0,nPos, nCol, pUser );
}
@@ -271,14 +271,14 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry ) const
return GetEntryText( pEntry, 0xffff );
}
-String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const
+String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const
{
DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry");
XubString aResult;
if( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -303,19 +303,19 @@ String SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const
return aResult;
}
-String SvTabListBox::GetEntryText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = GetEntryOnPos( nPos );
return GetEntryText( pEntry, nCol );
}
-void SvTabListBox::SetEntryText( const XubString& rStr, ULONG nPos, USHORT nCol )
+void SvTabListBox::SetEntryText( const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol )
{
SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
SetEntryText( rStr, pEntry, nCol );
}
-void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USHORT nCol )
+void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal_uInt16 nCol )
{
DBG_ASSERT(pEntry,"SetEntryText:Invalid Entry");
if( !pEntry )
@@ -325,14 +325,14 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH
if ( sOldText == rStr )
return;
- USHORT nTextColumn = nCol;
+ sal_uInt16 nTextColumn = nCol;
const xub_Unicode* pCurToken = rStr.GetBuffer();
- USHORT nCurTokenLen;
+ sal_uInt16 nCurTokenLen;
const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
XubString aTemp;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -372,7 +372,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, USH
delete pData;
}
-String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = GetEntryOnPos( nPos );
DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" );
@@ -386,9 +386,9 @@ String SvTabListBox::GetCellText( ULONG nPos, USHORT nCol ) const
return aResult;
}
-ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol )
+sal_uLong SvTabListBox::GetEntryPos( const XubString& rStr, sal_uInt16 nCol )
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvLBoxEntry* pEntry = First();
while( pEntry )
{
@@ -401,9 +401,9 @@ ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol )
return 0xffffffff;
}
-ULONG SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const
+sal_uLong SvTabListBox::GetEntryPos( const SvLBoxEntry* pEntry ) const
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvLBoxEntry* pTmpEntry = First();
while( pTmpEntry )
{
@@ -421,7 +421,7 @@ void SvTabListBox::Resize()
}
// static
-const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen )
+const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, sal_uInt16& rLen )
{
if( !pPtr || *pPtr == 0 )
{
@@ -429,7 +429,7 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen
return 0;
}
xub_Unicode c = *pPtr;
- USHORT nLen = 0;
+ sal_uInt16 nLen = 0;
while( c != '\t' && c != 0 )
{
pPtr++;
@@ -444,15 +444,15 @@ const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen
return pPtr;
}
-String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const
+String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const
{
SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " );
XubString aResult;
if ( pEntry )
{
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0;
while( nCur < nCount )
{
SvLBoxItem* pStr = pEntry->GetItem( nCur );
@@ -482,10 +482,10 @@ String SvTabListBox::GetTabEntryText( ULONG nPos, USHORT nCol ) const
return aResult;
}
-SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const
+SvLBoxEntry* SvTabListBox::GetEntryOnPos( sal_uLong _nEntryPos ) const
{
SvLBoxEntry* pEntry = NULL;
- ULONG i, nPos = 0, nCount = GetLevelChildCount( NULL );
+ sal_uLong i, nPos = 0, nCount = GetLevelChildCount( NULL );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pParent = GetEntry(i);
@@ -506,9 +506,9 @@ SvLBoxEntry* SvTabListBox::GetEntryOnPos( ULONG _nEntryPos ) const
return pEntry;
}
-SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPos, ULONG& _rPos ) const
+SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, sal_uLong _nEntryPos, sal_uLong& _rPos ) const
{
- ULONG i, nCount = GetLevelChildCount( _pParent );
+ sal_uLong i, nCount = GetLevelChildCount( _pParent );
for ( i = 0; i < nCount; ++i )
{
SvLBoxEntry* pParent = GetEntry( _pParent, i );
@@ -526,33 +526,33 @@ SvLBoxEntry* SvTabListBox::GetChildOnPos( SvLBoxEntry* _pParent, ULONG _nEntryPo
return NULL;
}
-void SvTabListBox::SetTabJustify( USHORT nTab, SvTabJustify eJustify)
+void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
{
if( nTab >= nTabCount )
return;
SvLBoxTab* pTab = &(pTabList[ nTab ]);
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
nFlags &= (~MYTABMASK);
- nFlags |= (USHORT)eJustify;
+ nFlags |= (sal_uInt16)eJustify;
pTab->nFlags = nFlags;
SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
if( IsUpdateMode() )
Invalidate();
}
-SvTabJustify SvTabListBox::GetTabJustify( USHORT nTab ) const
+SvTabJustify SvTabListBox::GetTabJustify( sal_uInt16 nTab ) const
{
SvTabJustify eResult = AdjustLeft;
if( nTab >= nTabCount )
return eResult;
SvLBoxTab* pTab = &(pTabList[ nTab ]);
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
nFlags &= MYTABMASK;
eResult = (SvTabJustify)nFlags;
return eResult;
}
-long SvTabListBox::GetLogicTab( USHORT nTab )
+long SvTabListBox::GetLogicTab( sal_uInt16 nTab )
{
if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS )
((SvTabListBox*)this)->SetTabs();
@@ -580,7 +580,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, WinBits nWinStyle ) :
SvTabListBox( pParent, nWinStyle ),
- m_bFirstPaint ( TRUE ),
+ m_bFirstPaint ( sal_True ),
m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ),
m_pAccessible ( NULL )
{
@@ -592,7 +592,7 @@ SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, const ResId& rResId ) :
SvTabListBox( pParent, rResId ),
- m_bFirstPaint ( TRUE ),
+ m_bFirstPaint ( sal_True ),
m_pImpl ( new ::svt::SvHeaderTabListBoxImpl ),
m_pAccessible ( NULL )
{
@@ -611,7 +611,7 @@ void SvHeaderTabListBox::Paint( const Rectangle& rRect )
{
if ( m_bFirstPaint )
{
- m_bFirstPaint = FALSE;
+ m_bFirstPaint = sal_False;
RepaintScrollBars();
}
SvTabListBox::Paint( rRect );
@@ -630,14 +630,14 @@ void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar )
// -----------------------------------------------------------------------
-sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) const
+sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const
{
SvButtonState eState = SV_BUTTON_UNCHECKED;
SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( nCol + 1 ) );
if ( pItem && ( (SvLBoxItem*)pItem )->IsA() == SV_ITEM_ID_LBOXBUTTON )
{
- USHORT nButtonFlags = pItem->GetButtonFlags();
+ sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
}
@@ -647,7 +647,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( SvLBoxEntry* pEntry, USHORT nCol ) c
// -----------------------------------------------------------------------
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
- const XubString& rStr, ULONG nPos, USHORT nCol, void* pUserData )
+ const XubString& rStr, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, nPos, nCol, pUserData );
RecalculateAccessibleChildren();
@@ -657,7 +657,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
// -----------------------------------------------------------------------
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
- const XubString& rStr, SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData )
+ const XubString& rStr, SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn( rStr, pParent, nPos, nCol, pUserData );
RecalculateAccessibleChildren();
@@ -668,7 +668,7 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
const XubString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
- SvLBoxEntry* pParent, ULONG nPos, USHORT nCol, void* pUserData )
+ SvLBoxEntry* pParent, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
{
SvLBoxEntry* pEntry = SvTabListBox::InsertEntryToColumn(
rStr, rExpandedEntryBmp, rCollapsedEntryBmp, pParent, nPos, nCol, pUserData );
@@ -678,19 +678,19 @@ SvLBoxEntry* SvHeaderTabListBox::InsertEntryToColumn(
// -----------------------------------------------------------------------
-ULONG SvHeaderTabListBox::Insert(
- SvLBoxEntry* pEnt, SvLBoxEntry* pPar, ULONG nPos )
+sal_uLong SvHeaderTabListBox::Insert(
+ SvLBoxEntry* pEnt, SvLBoxEntry* pPar, sal_uLong nPos )
{
- ULONG n = SvTabListBox::Insert( pEnt, pPar, nPos );
+ sal_uLong n = SvTabListBox::Insert( pEnt, pPar, nPos );
RecalculateAccessibleChildren();
return n;
}
// -----------------------------------------------------------------------
-ULONG SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, ULONG nRootPos )
+sal_uLong SvHeaderTabListBox::Insert( SvLBoxEntry* pEntry, sal_uLong nRootPos )
{
- ULONG nPos = SvTabListBox::Insert( pEntry, nRootPos );
+ sal_uLong nPos = SvTabListBox::Insert( pEntry, nRootPos );
RecalculateAccessibleChildren();
return nPos;
}
@@ -762,7 +762,7 @@ sal_Bool SvHeaderTabListBox::IsCellCheckBox( long _nRow, sal_uInt16 _nColumn, Tr
SvLBoxEntry* pEntry = GetEntry( _nRow );
if ( pEntry )
{
- USHORT nItemCount = pEntry->ItemCount();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
if ( nItemCount > ( _nColumn + 1 ) )
{
SvLBoxButton* pItem = (SvLBoxButton*)( pEntry->GetItem( _nColumn + 1 ) );
@@ -798,8 +798,8 @@ sal_Int32 SvHeaderTabListBox::GetCurrRow() const
SvLBoxEntry* pEntry = GetCurEntry();
if ( pEntry )
{
- ULONG nCount = GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
+ sal_uLong nCount = GetEntryCount();
+ for ( sal_uLong i = 0; i < nCount; ++i )
{
if ( pEntry == GetEntry(i) )
{
@@ -838,13 +838,13 @@ sal_Bool SvHeaderTabListBox::IsCellFocusable() const
return IsCellFocusEnabled();
}
// -----------------------------------------------------------------------
-BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
+sal_Bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
{
- sal_Bool bRet = ( IsCellFocusEnabled() == TRUE );
+ sal_Bool bRet = ( IsCellFocusEnabled() == sal_True );
if ( bRet )
{
// first set cursor to _nRow
- SetCursor( GetEntry( _nRow ), TRUE );
+ SetCursor( GetEntry( _nRow ), sal_True );
// then set the focus into _nColumn
bRet = ( SetCurrentTabPos( _nColumn ) == true );
}
@@ -853,22 +853,22 @@ BOOL SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SetNoSelection()
{
- SvLBox::SelectAll( FALSE );
+ SvLBox::SelectAll( sal_False );
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::SelectAll()
{
- SvLBox::SelectAll( TRUE );
+ SvLBox::SelectAll( sal_True );
}
// -----------------------------------------------------------------------
-void SvHeaderTabListBox::SelectAll( BOOL bSelect, BOOL bPaint )
+void SvHeaderTabListBox::SelectAll( sal_Bool bSelect, sal_Bool bPaint )
{
- // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, BOOL )
+ // overwritten just to disambiguate the SelectAll() from the base' class SelectAll( BOOl, sal_Bool )
SvTabListBox::SelectAll( bSelect, bPaint );
}
// -----------------------------------------------------------------------
-void SvHeaderTabListBox::SelectRow( long _nRow, BOOL _bSelect, BOOL )
+void SvHeaderTabListBox::SelectRow( long _nRow, sal_Bool _bSelect, sal_Bool )
{
Select( GetEntry( _nRow ), _bSelect );
}
@@ -895,7 +895,7 @@ bool SvHeaderTabListBox::IsRowSelected( long _nRow ) const
// -----------------------------------------------------------------------
sal_Bool SvHeaderTabListBox::IsColumnSelected( long ) const
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void SvHeaderTabListBox::GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& ) const
@@ -911,12 +911,12 @@ sal_Bool SvHeaderTabListBox::IsCellVisible( sal_Int32, sal_uInt16 ) const
return sal_True;
}
// -----------------------------------------------------------------------
-String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, USHORT _nColumnPos ) const
+String SvHeaderTabListBox::GetAccessibleCellText( long _nRow, sal_uInt16 _nColumnPos ) const
{
return ::rtl::OUString( GetTabEntryText( _nRow, _nColumnPos ) );
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen )
{
Rectangle aRect;
if ( _bIsColumnBar )
@@ -930,7 +930,7 @@ Rectangle SvHeaderTabListBox::calcHeaderRect( sal_Bool _bIsColumnBar, BOOL _bOnS
return aRect;
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::calcTableRect( sal_Bool _bOnScreen )
{
Window* pParent = NULL;
if ( !_bOnScreen )
@@ -940,14 +940,14 @@ Rectangle SvHeaderTabListBox::calcTableRect( BOOL _bOnScreen )
return aRect;
}
// -----------------------------------------------------------------------
-Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, BOOL _bIsHeader, BOOL _bOnScreen )
+Rectangle SvHeaderTabListBox::GetFieldRectPixelAbs( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_Bool _bIsHeader, sal_Bool _bOnScreen )
{
DBG_ASSERT( !_bIsHeader || 0 == _nRow, "invalid parameters" );
Rectangle aRect;
SvLBoxEntry* pEntry = GetEntry( _nRow );
if ( pEntry )
{
- aRect = _bIsHeader ? calcHeaderRect( sal_True, FALSE ) : GetBoundingRect( pEntry );
+ aRect = _bIsHeader ? calcHeaderRect( sal_True, sal_False ) : GetBoundingRect( pEntry );
Point aTopLeft = aRect.TopLeft();
DBG_ASSERT( m_pImpl->m_pHeaderBar->GetItemCount() > _nColumn, "invalid column" );
Rectangle aItemRect = m_pImpl->m_pHeaderBar->GetItemRect( m_pImpl->m_pHeaderBar->GetItemId( _nColumn ) );
@@ -1105,7 +1105,7 @@ sal_Bool SvHeaderTabListBox::ConvertPointToColumnHeader( sal_uInt16&, const Poin
}
case ::svt::BBTYPE_COLUMNHEADERCELL:
{
- aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (USHORT)_nPos ) );
+ aRetText = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( (sal_uInt16)_nPos ) );
break;
}
@@ -1224,7 +1224,7 @@ void SvHeaderTabListBox::GrabTableFocus()
GrabFocus();
}
// -----------------------------------------------------------------------
-BOOL SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
+sal_Bool SvHeaderTabListBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
{
return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector );
}
@@ -1239,7 +1239,7 @@ void SvHeaderTabListBox::GrabFocus()
Control::GrabFocus();
}
// -----------------------------------------------------------------------
-Reference< XAccessible > SvHeaderTabListBox::GetAccessible( BOOL bCreate )
+Reference< XAccessible > SvHeaderTabListBox::GetAccessible( sal_Bool bCreate )
{
return Control::GetAccessible( bCreate );
}
@@ -1283,7 +1283,7 @@ Rectangle SvHeaderTabListBox::GetFieldCharacterBounds(sal_Int32,sal_Int32,sal_In
// -----------------------------------------------------------------------------
sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
{
- String sText = GetAccessibleCellText( _nRow, static_cast< USHORT >( _nColumnPos ) );
+ String sText = GetAccessibleCellText( _nRow, static_cast< sal_uInt16 >( _nColumnPos ) );
MetricVector aRects;
if ( GetGlyphBoundRects(Point(0,0),sText,0,STRING_LEN,0,aRects) )
{
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index 96c91a3b8992..12ac258dd31c 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -61,10 +61,10 @@ DBG_NAME(SvTreeListBox)
#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox(pParent,nWinStyle )
+ : SvLBox( pParent, nWinStyle )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( nWinStyle );
+ InitTreeView();
SetSublistOpenWithLeftRight();
}
@@ -74,13 +74,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( 0 );
+ InitTreeView();
Resize();
SetSublistOpenWithLeftRight();
}
-void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
pCheckButtonData = NULL;
@@ -98,15 +98,15 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
nTreeFlags = TREEFLAG_RECALCTABS;
nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
- pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+ pImp = new SvImpLBox( this, GetModel(), GetStyle() );
aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
nContextBmpWidthMax = 0;
SetFont( GetFont() );
SetSpaceBetweenEntries( 0 );
SetLineColor();
- InitSettings( TRUE, TRUE, TRUE );
- SetWindowBits( nWinStyle );
+ InitSettings( sal_True, sal_True, sal_True );
+ ImplInitStyle();
SetTabs();
}
@@ -145,28 +145,28 @@ void SvTreeListBox::DisconnectFromModel()
}
-USHORT SvTreeListBox::IsA()
+sal_uInt16 SvTreeListBox::IsA()
{
DBG_CHKTHIS(SvTreeListBox,0);
return SV_LISTBOX_ID_TREEBOX;
}
-void SvTreeListBox::SetSublistOpenWithReturn( BOOL b )
+void SvTreeListBox::SetSublistOpenWithReturn( sal_Bool b )
{
pImp->bSubLstOpRet = b;
}
-BOOL SvTreeListBox::IsSublistOpenWithReturn() const
+sal_Bool SvTreeListBox::IsSublistOpenWithReturn() const
{
return pImp->bSubLstOpRet;
}
-void SvTreeListBox::SetSublistOpenWithLeftRight( BOOL b )
+void SvTreeListBox::SetSublistOpenWithLeftRight( sal_Bool b )
{
pImp->bSubLstOpLR = b;
}
-BOOL SvTreeListBox::IsSublistOpenWithLeftRight() const
+sal_Bool SvTreeListBox::IsSublistOpenWithLeftRight() const
{
return pImp->bSubLstOpLR;
}
@@ -175,12 +175,12 @@ void SvTreeListBox::Resize()
{
DBG_CHKTHIS(SvTreeListBox,0);
if( IsEditingActive() )
- EndEditing( TRUE );
+ EndEditing( sal_True );
SvLBox::Resize();
pImp->Resize();
nFocusWidth = -1;
- pImp->ShowCursor( FALSE );
- pImp->ShowCursor( TRUE );
+ pImp->ShowCursor( sal_False );
+ pImp->ShowCursor( sal_True );
}
/* Faelle:
@@ -220,11 +220,12 @@ void SvTreeListBox::SetTabs()
{
DBG_CHKTHIS(SvTreeListBox,0);
if( IsEditingActive() )
- EndEditing( TRUE );
+ EndEditing( sal_True );
nTreeFlags &= (~TREEFLAG_RECALCTABS);
nFocusWidth = -1;
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nStyle( GetStyle() );
+ sal_Bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
+ sal_Bool bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -349,8 +350,8 @@ String SvTreeListBox::SearchEntryText( SvLBoxEntry* pEntry ) const
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" );
String sRet;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
SvLBoxItem* pItem;
while( nCur < nCount )
{
@@ -396,7 +397,7 @@ IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData
SvLBoxEntry* SvTreeListBox::InsertEntry(
const XubString& aText,
SvLBoxEntry* pParent,
- BOOL bChildsOnDemand, ULONG nPos,
+ sal_Bool bChildsOnDemand, sal_uLong nPos,
void* pUser,
SvLBoxButtonKind eButtonKind
)
@@ -430,7 +431,7 @@ SvLBoxEntry* SvTreeListBox::InsertEntry(
SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,
const Image& aExpEntryBmp, const Image& aCollEntryBmp,
- SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUser,
+ SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos, void* pUser,
SvLBoxButtonKind eButtonKind )
{
DBG_CHKTHIS(SvTreeListBox,0);
@@ -513,7 +514,7 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry )
SvLBoxEntry* pParent = (SvLBoxEntry*)pModel->GetParent( pEntry );
if( pParent )
{
- USHORT nFlags = pParent->GetFlags();
+ sal_uInt16 nFlags = pParent->GetFlags();
nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
pParent->SetFlags( nFlags );
}
@@ -575,7 +576,7 @@ SvButtonState SvTreeListBox::GetCheckButtonState( SvLBoxEntry* pEntry ) const
SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if(!pItem)
return SV_BUTTON_TRISTATE;
- USHORT nButtonFlags = pItem->GetButtonFlags();
+ sal_uInt16 nButtonFlags = pItem->GetButtonFlags();
eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
}
return eState;
@@ -626,7 +627,7 @@ SvLBoxEntry* SvTreeListBox::CloneEntry( SvLBoxEntry* pSource )
return pClone;
}
-void SvTreeListBox::ShowExpandBitmapOnCursor( BOOL bYes )
+void SvTreeListBox::ShowExpandBitmapOnCursor( sal_Bool bYes )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( bYes )
@@ -719,19 +720,19 @@ void SvTreeListBox::SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image&
SetTabs();
}
-BOOL SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& )
+sal_Bool SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& )
{
DBG_CHKTHIS(SvTreeListBox,0);
- return TRUE;
+ return sal_True;
}
-BOOL SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/)
+sal_Bool SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/)
{
DBG_CHKTHIS(SvTreeListBox,0);
- return TRUE;
+ return sal_True;
}
-void SvTreeListBox::EnableInplaceEditing( BOOL bOn )
+void SvTreeListBox::EnableInplaceEditing( sal_Bool bOn )
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBox::EnableInplaceEditing( bOn );
@@ -747,7 +748,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
nImpFlags |= SVLBOX_IS_TRAVELSELECT;
#ifdef OVDEBUG
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_F1:
@@ -771,7 +772,7 @@ void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( !pParent->HasChilds() )
- InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND );
}
void SvTreeListBox::GetFocus()
@@ -815,7 +816,7 @@ void SvTreeListBox::ModelHasCleared()
SvLBox::ModelHasCleared();
}
-void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL /* bShow */ )
+void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool /* bShow */ )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->PaintDDCursor( pEntry );
@@ -839,13 +840,13 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries )
long nTemp = nThumb + nVis;
if( nDeltaEntries > (nMax - nTemp) )
nDeltaEntries = (short)(nMax - nTemp);
- pImp->PageDown( (USHORT)nDeltaEntries );
+ pImp->PageDown( (sal_uInt16)nDeltaEntries );
}
else
{
if( nDeltaEntries > nThumb )
nDeltaEntries = (short)nThumb;
- pImp->PageUp( (USHORT)nDeltaEntries );
+ pImp->PageUp( (sal_uInt16)nDeltaEntries );
}
pImp->SyncVerThumb();
NotifyEndScroll();
@@ -889,8 +890,8 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
short nHeight, nHeightMax=0;
- USHORT nCount = pEntry->ItemCount();
- USHORT nCur = 0;
+ sal_uInt16 nCount = pEntry->ItemCount();
+ sal_uInt16 nCur = 0;
SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
while( nCur < nCount )
{
@@ -909,7 +910,7 @@ void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
}
}
-void SvTreeListBox::SetEntryHeight( short nHeight, BOOL bAlways )
+void SvTreeListBox::SetEntryHeight( short nHeight, sal_Bool bAlways )
{
DBG_CHKTHIS(SvTreeListBox,0);
@@ -950,12 +951,12 @@ void SvTreeListBox::AdjustEntryHeight( const Font& rFont )
}
}
-BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
+sal_Bool SvTreeListBox::Expand( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
pHdlEntry = pParent;
- BOOL bExpanded = FALSE;
- USHORT nFlags;
+ sal_Bool bExpanded = sal_False;
+ sal_uInt16 nFlags;
if( pParent->HasChildsOnDemand() )
RequestingChilds( pParent );
@@ -964,7 +965,7 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
nImpFlags |= SVLBOX_IS_EXPANDING;
if( ExpandingHdl() )
{
- bExpanded = TRUE;
+ bExpanded = sal_True;
SvListView::Expand( pParent );
pImp->EntryExpanded( pParent );
pHdlEntry = pParent;
@@ -992,16 +993,16 @@ BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
return bExpanded;
}
-BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent )
+sal_Bool SvTreeListBox::Collapse( SvLBoxEntry* pParent )
{
DBG_CHKTHIS(SvTreeListBox,0);
nImpFlags &= ~SVLBOX_IS_EXPANDING;
pHdlEntry = pParent;
- BOOL bCollapsed = FALSE;
+ sal_Bool bCollapsed = sal_False;
if( ExpandingHdl() )
{
- bCollapsed = TRUE;
+ bCollapsed = sal_True;
pImp->CollapsingEntry( pParent );
SvListView::Collapse( pParent );
pImp->EntryCollapsed( pParent );
@@ -1018,11 +1019,11 @@ BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent )
return bCollapsed;
}
-BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+sal_Bool SvTreeListBox::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
DBG_ASSERT(pEntry,"Select: Null-Ptr");
- BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ sal_Bool bRetVal = SvListView::Select( pEntry, bSelect );
DBG_ASSERT(IsSelected(pEntry)==bSelect,"Select failed");
if( bRetVal )
{
@@ -1039,14 +1040,14 @@ BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return bRetVal;
}
-ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect )
+sal_uLong SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->DestroyAnchor();
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( !pParent->HasChilds() )
return 0;
- USHORT nRefDepth = pModel->GetDepth( pParent );
+ sal_uInt16 nRefDepth = pModel->GetDepth( pParent );
SvLBoxEntry* pChild = FirstChild( pParent );
do {
nRet++;
@@ -1056,19 +1057,19 @@ ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect )
return nRet;
}
-void SvTreeListBox::SelectAll( BOOL bSelect, BOOL )
+void SvTreeListBox::SelectAll( sal_Bool bSelect, sal_Bool )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SelAllDestrAnch(
bSelect,
- TRUE, // Anker loeschen,
- TRUE ); // auch bei SINGLE_SELECTION den Cursor deselektieren
+ sal_True, // Anker loeschen,
+ sal_True ); // auch bei SINGLE_SELECTION den Cursor deselektieren
}
void SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry );
+ sal_uInt16 nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry );
SvLBoxEntry* pTmp = (SvLBoxEntry*)pEntry;
do
{
@@ -1087,7 +1088,7 @@ void SvTreeListBox::ModelHasInserted( SvListEntry* pEntry )
void SvTreeListBox::ModelIsMoving(SvListEntry* pSource,
SvListEntry* /* pTargetParent */,
- ULONG /* nChildPos */ )
+ sal_uLong /* nChildPos */ )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->MovingEntry( (SvLBoxEntry*)pSource );
@@ -1109,9 +1110,11 @@ void SvTreeListBox::ModelIsRemoving( SvListEntry* pEntry )
NotifyRemoving( (SvLBoxEntry*)pEntry );
}
-void SvTreeListBox::ModelHasRemoved( SvListEntry* /* pEntry */ )
+void SvTreeListBox::ModelHasRemoved( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
+ if ( pEntry == pHdlEntry)
+ pHdlEntry = NULL;
pImp->EntryRemoved();
}
@@ -1134,7 +1137,7 @@ void SvTreeListBox::SetFont( const Font& rFont )
{
DBG_CHKTHIS(SvTreeListBox,0);
Font aTempFont( rFont );
- aTempFont.SetTransparent( TRUE );
+ aTempFont.SetTransparent( sal_True );
Control::SetFont( aTempFont );
AdjustEntryHeight( aTempFont );
// immer Invalidieren, sonst fallen wir
@@ -1171,13 +1174,13 @@ void SvTreeListBox::MouseMove( const MouseEvent& rMEvt )
}
-void SvTreeListBox::SetUpdateMode( BOOL bUpdate )
+void SvTreeListBox::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetUpdateMode( bUpdate );
}
-void SvTreeListBox::SetUpdateModeFast( BOOL bUpdate )
+void SvTreeListBox::SetUpdateModeFast( sal_Bool bUpdate )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetUpdateModeFast( bUpdate );
@@ -1197,7 +1200,7 @@ void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic )
}
}
-void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect )
{
DBG_CHKTHIS(SvTreeListBox,0);
pImp->SetCursor(pEntry, bForceNoSelect);
@@ -1234,7 +1237,7 @@ void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry )
pImp->MakeVisible(pEntry);
}
-void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop )
{
pImp->MakeVisible( pEntry, bMoveToTop );
}
@@ -1255,11 +1258,11 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
DBG_ASSERT(pEntry&&pItem,"EditItemText: Bad params");
if( IsSelected( pEntry ))
{
- pImp->ShowCursor( FALSE );
- SvListView::Select( pEntry, FALSE );
+ pImp->ShowCursor( sal_False );
+ SvListView::Select( pEntry, sal_False );
PaintEntry( pEntry );
- SvListView::Select( pEntry, TRUE );
- pImp->ShowCursor( TRUE );
+ SvListView::Select( pEntry, sal_True );
+ pImp->ShowCursor( sal_True );
}
pEdEntry = pEntry;
pEdItem = pItem;
@@ -1272,7 +1275,7 @@ void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
aPos.X() = GetTabPos( pEntry, pTab );
long nOutputWidth = pImp->GetOutputSize().Width();
Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() );
- USHORT nPos = aTabs.GetPos( pTab );
+ sal_uInt16 nPos = aTabs.GetPos( pTab );
if( nPos+1 < aTabs.Count() )
{
SvLBoxTab* pRightTab = (SvLBoxTab*)aTabs.GetObject( nPos + 1 );
@@ -1318,8 +1321,8 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry )
bool bIsMouseTriggered = nClickX >= 0;
SvLBoxString* pItem = NULL;
- USHORT nCount = pEntry->ItemCount();
- for( USHORT i = 0 ; i < nCount ; i++ )
+ sal_uInt16 nCount = pEntry->ItemCount();
+ for( sal_uInt16 i = 0 ; i < nCount ; i++ )
{
SvLBoxItem* pTmpItem = pEntry->GetItem( i );
if( pTmpItem->IsA() != SV_ITEM_ID_LBOXSTRING )
@@ -1348,7 +1351,7 @@ void SvTreeListBox::ImplEditEntry( SvLBoxEntry* pEntry )
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( pItem && EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
MakeVisible( pEntry );
EditItemText( pEntry, pItem, aSel );
}
@@ -1394,7 +1397,7 @@ void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
Selection aSel( SELECTION_MIN, SELECTION_MAX );
if( EditingEntry( pEntry, aSel ) )
{
- SelectAll( FALSE );
+ SelectAll( sal_False );
EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
}
}
@@ -1408,7 +1411,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
// Scrollen
if( rPos.Y() < 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
ScrollOutputArea( +1 );
}
else
@@ -1416,7 +1419,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
Size aSize( pImp->GetOutputSize() );
if( rPos.Y() > aSize.Height() - 12 )
{
- SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, sal_False );
ScrollOutputArea( -1 );
}
}
@@ -1433,7 +1436,7 @@ SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
}
-SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, BOOL bHit ) const
+SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, sal_Bool bHit ) const
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBoxEntry* pEntry = pImp->GetEntry( rPos );
@@ -1452,12 +1455,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const
return pImp->GetCurEntry();
}
-void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+void SvTreeListBox::ImplInitStyle()
{
DBG_CHKTHIS(SvTreeListBox,0);
- nWindowStyle = nWinStyle;
+
+ const WinBits nWindowStyle = GetStyle();
+
nTreeFlags |= TREEFLAG_RECALCTABS;
- if( nWinStyle & WB_SORT )
+ if( nWindowStyle & WB_SORT )
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
@@ -1468,9 +1473,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
GetModel()->SetCompareHdl( Link() );
}
#ifdef OS2
- nWinStyle |= WB_VSCROLL;
+ nWindowStyle |= WB_VSCROLL;
#endif
- pImp->SetWindowBits( nWinStyle );
+ pImp->SetStyle( nWindowStyle );
pImp->Resize();
Invalidate();
}
@@ -1494,21 +1499,21 @@ void SvTreeListBox::InvalidateEntry( SvLBoxEntry* pEntry )
}
-long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags)
+long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags)
{
return PaintEntry1(pEntry,nLine,nTabFlags);
}
#define SV_TAB_BORDER 8
-long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
- BOOL bHasClipRegion )
+long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFlags,
+ sal_Bool bHasClipRegion )
{
DBG_CHKTHIS(SvTreeListBox,0);
Rectangle aRect; // multi purpose
- BOOL bHorSBar = pImp->HasHorScrollBar();
+ sal_Bool bHorSBar = pImp->HasHorScrollBar();
PreparePaint( pEntry );
pImp->UpdateContextBmpWidthMax( pEntry );
@@ -1533,11 +1538,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
Color aBackupColor = GetFillColor();
bool bCurFontIsSel = false;
- BOOL bInUse = pEntry->HasInUseEmphasis();
+ sal_Bool bInUse = pEntry->HasInUseEmphasis();
// wenn eine ClipRegion von aussen gesetzt wird, dann
// diese nicht zuruecksetzen
- BOOL bResetClipRegion = !bHasClipRegion;
- BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const WinBits nWindowStyle = GetStyle();
+ const sal_Bool bResetClipRegion = !bHasClipRegion;
+ const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Font aHighlightFont( GetFont() );
@@ -1549,24 +1555,24 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if( !bHasClipRegion && nWindowStyle & WB_HSCROLL )
{
SetClipRegion( Region(pImp->GetClipRegionRect()) );
- bHasClipRegion = TRUE;
+ bHasClipRegion = sal_True;
}
SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry );
- USHORT nTabCount = aTabs.Count();
- USHORT nItemCount = pEntry->ItemCount();
- USHORT nCurTab = 0;
- USHORT nCurItem = 0;
+ sal_uInt16 nTabCount = aTabs.Count();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
+ sal_uInt16 nCurTab = 0;
+ sal_uInt16 nCurItem = 0;
while( nCurTab < nTabCount && nCurItem < nItemCount )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nCurTab );
- USHORT nNextTab = nCurTab + 1;
+ sal_uInt16 nNextTab = nCurTab + 1;
SvLBoxTab* pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0;
SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0;
- USHORT nFlags = pTab->nFlags;
+ sal_uInt16 nFlags = pTab->nFlags;
Size aSize( pItem->GetSize( pViewDataEntry, nCurItem ));
long nTabPos = GetTabPos( pEntry, pTab );
@@ -1592,7 +1598,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if( !bHasClipRegion && nX + aSize.Width() >= nMaxRight )
{
SetClipRegion( Region(pImp->GetClipRegionRect()) );
- bHasClipRegion = TRUE;
+ bHasClipRegion = sal_True;
}
aEntryPos.X() = nX;
aEntryPos.Y() = nLine;
@@ -1602,7 +1608,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
Wallpaper aWallpaper = GetBackground();
int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION;
- USHORT nItemType = pItem->IsA();
+ sal_uInt16 nItemType = pItem->IsA();
if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() )
{
@@ -1716,7 +1722,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
SetFont( aBackupFont );
}
- USHORT nFirstDynTabPos;
+ sal_uInt16 nFirstDynTabPos;
SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab( nFirstDynTabPos );
long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab );
nDynTabPos += pImp->nNodeBmpTabDistance;
@@ -1730,7 +1736,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
{
// ersten festen Tab suchen, und pruefen ob die Node-Bitmap
// in ihn hineinragt
- USHORT nNextTab = nFirstDynTabPos;
+ sal_uInt16 nNextTab = nFirstDynTabPos;
SvLBoxTab* pNextTab;
do
{
@@ -1760,12 +1766,12 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
}
aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
//native
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) )
{
ImplControlValue aControlValue;
@@ -1820,7 +1826,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
long nRealWidth = pImp->GetOutputSize().Width();
nRealWidth -= GetMapMode().GetOrigin().X();
- USHORT nCurTab;
+ sal_uInt16 nCurTab;
SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab );
long nTabPos = 0;
if( pTab )
@@ -1838,7 +1844,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
nNextTabPos += 50;
}
- BOOL bUserSelection = (BOOL)( nTreeFlags & TREEFLAG_USESEL ) != 0;
+ sal_Bool bUserSelection = (sal_Bool)( nTreeFlags & TREEFLAG_USESEL ) != 0;
if( !bUserSelection )
{
if( pTab && nCurTab < pEntry->ItemCount() )
@@ -1863,7 +1869,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
// wenn erster SelTab != 0, dann muessen wir auch rechnen
if( nFocusWidth == -1 || nFirstSelTab )
{
- USHORT nLastTab;
+ sal_uInt16 nLastTab;
SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab);
nLastTab++;
if( nLastTab < aTabs.Count() ) // gibts noch einen ?
@@ -1911,23 +1917,23 @@ long SvTreeListBox::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
long nPos = pTab->GetPos();
if( pTab->IsDynamic() )
{
- USHORT nDepth = pModel->GetDepth( pEntry );
- nDepth = nDepth * (USHORT)nIndent;
+ sal_uInt16 nDepth = pModel->GetDepth( pEntry );
+ nDepth = nDepth * (sal_uInt16)nIndent;
nPos += (long)nDepth;
}
return nPos;
}
SvLBoxItem* SvTreeListBox::GetItem_Impl( SvLBoxEntry* pEntry, long nX,
- SvLBoxTab** ppTab, USHORT nEmptyWidth )
+ SvLBoxTab** ppTab, sal_uInt16 nEmptyWidth )
{
DBG_CHKTHIS(SvTreeListBox,0);
SvLBoxItem* pItemClicked = 0;
- USHORT nTabCount = aTabs.Count();
- USHORT nItemCount = pEntry->ItemCount();
+ sal_uInt16 nTabCount = aTabs.Count();
+ sal_uInt16 nItemCount = pEntry->ItemCount();
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
SvLBoxItem* pItem = pEntry->GetItem(0);
- USHORT nNextItem = 1;
+ sal_uInt16 nNextItem = 1;
nX -= GetMapMode().GetOrigin().X();
long nRealWidth = pImp->GetOutputSize().Width();
nRealWidth -= GetMapMode().GetOrigin().X();
@@ -1996,9 +2002,9 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry )
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
SvLBoxItem* pItem = pEntry->GetItem(0);
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nTabCount = aTabs.Count();
- USHORT nNext = 1;
+ sal_uInt16 nNext = 1;
while ( !pTab->IsDynamic() && nNext < nTabCount )
{
pItem = pEntry->GetItem( nNext );
@@ -2008,7 +2014,7 @@ SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry )
return pItem;
}
-void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
+void SvTreeListBox::AddTab(long nTabPos,sal_uInt16 nFlags,void* pUserData )
{
DBG_CHKTHIS(SvTreeListBox,0);
nFocusWidth = -1;
@@ -2017,7 +2023,7 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
aTabs.Insert( pTab, aTabs.Count() );
if( nTreeFlags & TREEFLAG_USESEL )
{
- USHORT nPos = aTabs.Count() - 1;
+ sal_uInt16 nPos = aTabs.Count() - 1;
if( nPos >= nFirstSelTab && nPos <= nLastSelTab )
pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION;
else
@@ -2029,11 +2035,11 @@ void SvTreeListBox::AddTab(long nTabPos,USHORT nFlags,void* pUserData )
-SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const
+SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( sal_uInt16& rPos ) const
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nCurTab = 0;
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nCurTab = 0;
+ sal_uInt16 nTabCount = aTabs.Count();
while( nCurTab < nTabCount )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(nCurTab);
@@ -2049,21 +2055,21 @@ SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const
SvLBoxTab* SvTreeListBox::GetFirstDynamicTab() const
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
return GetFirstDynamicTab( nDummy );
}
SvLBoxTab* SvTreeListBox::GetTab( SvLBoxEntry* pEntry, SvLBoxItem* pItem) const
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nPos = pEntry->GetPos( pItem );
+ sal_uInt16 nPos = pEntry->GetPos( pItem );
return (SvLBoxTab*)aTabs.GetObject( nPos );
}
void SvTreeListBox::ClearTabList()
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nTabCount = aTabs.Count();
+ sal_uInt16 nTabCount = aTabs.Count();
while( nTabCount )
{
nTabCount--;
@@ -2107,7 +2113,7 @@ void SvTreeListBox::NotifyInvalidating()
DBG_CHKTHIS(SvTreeListBox,0);
}
-void SvTreeListBox::Invalidate( USHORT nInvalidateFlags )
+void SvTreeListBox::Invalidate( sal_uInt16 nInvalidateFlags )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( nFocusWidth == -1 )
@@ -2118,7 +2124,7 @@ void SvTreeListBox::Invalidate( USHORT nInvalidateFlags )
pImp->Invalidate();
}
-void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags )
+void SvTreeListBox::Invalidate( const Rectangle& rRect, sal_uInt16 nInvalidateFlags )
{
DBG_CHKTHIS(SvTreeListBox,0);
if( nFocusWidth == -1 )
@@ -2129,11 +2135,11 @@ void SvTreeListBox::Invalidate( const Rectangle& rRect, USHORT nInvalidateFlags
}
-void SvTreeListBox::SetHighlightRange( USHORT nStart, USHORT nEnd)
+void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd)
{
DBG_CHKTHIS(SvTreeListBox,0);
- USHORT nTemp;
+ sal_uInt16 nTemp;
nTreeFlags |= TREEFLAG_USESEL;
if( nStart > nEnd )
{
@@ -2156,12 +2162,12 @@ void SvTreeListBox::RemoveHighlightRange()
Invalidate();
}
-ULONG SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
+sal_uLong SvTreeListBox::GetAscInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
{
return LIST_APPEND;
}
-ULONG SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
+sal_uLong SvTreeListBox::GetDescInsertionPos(SvLBoxEntry*,SvLBoxEntry*)
{
DBG_CHKTHIS(SvTreeListBox,0);
return LIST_APPEND;
@@ -2185,8 +2191,8 @@ Region SvTreeListBox::GetDragRegion() const
void SvTreeListBox::Command( const CommandEvent& rCEvt )
{
DBG_CHKTHIS(SvTreeListBox,0);
- if ( !pImp->Command( rCEvt ) )
- SvLBox::Command( rCEvt );
+ // FIXME gnumake2 resync to DEV300_m84
+ pImp->Command( rCEvt );
}
@@ -2207,10 +2213,10 @@ void SvTreeListBox::RemoveParentKeepChilds( SvLBoxEntry* pParent )
pModel->Remove( pParent );
}
-SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos )
+SvLBoxTab* SvTreeListBox::GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rPos )
{
- USHORT nTabCount = aTabs.Count();
- for( USHORT nPos = 0; nPos < nTabCount; nPos++ )
+ sal_uInt16 nTabCount = aTabs.Count();
+ for( sal_uInt16 nPos = 0; nPos < nTabCount; nPos++ )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nPos );
if( (pTab->nFlags & nFlagMask) )
@@ -2223,17 +2229,17 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos )
return 0;
}
-SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos )
+SvLBoxTab* SvTreeListBox::GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos )
{
short nTabCount = (short)aTabs.Count();
if( nTabCount )
{
for( short nPos = nTabCount-1; nPos >= 0; nPos-- )
{
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (USHORT)nPos );
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (sal_uInt16)nPos );
if( (pTab->nFlags & nFlagMask) )
{
- rTabPos = (USHORT)nPos;
+ rTabPos = (sal_uInt16)nPos;
return pTab;
}
}
@@ -2242,12 +2248,12 @@ SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos )
return 0;
}
-void SvTreeListBox::SetAddMode( BOOL bAdd )
+void SvTreeListBox::SetAddMode( sal_Bool bAdd )
{
pImp->SetAddMode( bAdd );
}
-BOOL SvTreeListBox::IsAddMode() const
+sal_Bool SvTreeListBox::IsAddMode() const
{
return pImp->IsAddMode();
}
@@ -2272,8 +2278,8 @@ IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData )
return pImp->pIntlWrapper->getCaseCollator()->compareString( aLeft, aRight );
}
-void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
if( nActionId == LISTACTION_CLEARING )
CancelTextEditing();
@@ -2301,14 +2307,14 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
break;
case LISTACTION_RESORTING:
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
break;
case LISTACTION_RESORTED:
// nach Sortierung den ersten Eintrag anzeigen, dabei die
// Selektion erhalten.
- MakeVisible( (SvLBoxEntry*)pModel->First(), TRUE );
- SetUpdateMode( TRUE );
+ MakeVisible( (SvLBoxEntry*)pModel->First(), sal_True );
+ SetUpdateMode( sal_True );
break;
case LISTACTION_CLEARED:
@@ -2322,8 +2328,9 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
long SvTreeListBox::GetTextOffset() const
{
DBG_CHKTHIS(SvTreeListBox,0);
- BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nWindowStyle = GetStyle();
+ sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
+ sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -2401,12 +2408,12 @@ void SvTreeListBox::EndSelection()
pImp->EndSelection();
}
-BOOL SvTreeListBox::IsNodeButton( const Point& rPos ) const
+sal_Bool SvTreeListBox::IsNodeButton( const Point& rPos ) const
{
SvLBoxEntry* pEntry = GetEntry( rPos );
if( pEntry )
return pImp->IsNodeButton( rPos, pEntry );
- return FALSE;
+ return sal_False;
}
void SvTreeListBox::RepaintScrollBars() const
@@ -2424,7 +2431,7 @@ ScrollBar *SvTreeListBox::GetHScroll()
return &((SvTreeListBox*)this)->pImp->aHorSBar;
}
-void SvTreeListBox::EnableAsyncDrag( BOOL b )
+void SvTreeListBox::EnableAsyncDrag( sal_Bool b )
{
pImp->EnableAsyncDrag( b );
}
@@ -2462,9 +2469,9 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
{
if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- nEntryHeight = 0; // _together_ with TRUE of 1. par (bFont) of InitSettings() a zero-height
+ nEntryHeight = 0; // _together_ with sal_True of 1. par (bFont) of InitSettings() a zero-height
// forces complete recalc of heights!
- InitSettings( TRUE, TRUE, TRUE );
+ InitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
else
@@ -2474,9 +2481,11 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
{
SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ ImplInitStyle();
}
-void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
+void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
@@ -2503,17 +2512,17 @@ void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
pCheckButtonData->SetDefaultImages( this );
}
-BOOL SvTreeListBox::IsCellFocusEnabled() const
+sal_Bool SvTreeListBox::IsCellFocusEnabled() const
{
return pImp->IsCellFocusEnabled();
}
-bool SvTreeListBox::SetCurrentTabPos( USHORT _nNewPos )
+bool SvTreeListBox::SetCurrentTabPos( sal_uInt16 _nNewPos )
{
return pImp->SetCurrentTabPos( _nNewPos );
}
-USHORT SvTreeListBox::GetCurrentTabPos() const
+sal_uInt16 SvTreeListBox::GetCurrentTabPos() const
{
return pImp->GetCurrentTabPos();
}
@@ -2535,7 +2544,7 @@ PopupMenu* SvTreeListBox::CreateContextMenu( void )
return NULL;
}
-void SvTreeListBox::ExcecuteContextMenuAction( USHORT )
+void SvTreeListBox::ExcecuteContextMenuAction( sal_uInt16 )
{
DBG_WARNING( "SvTreeListBox::ExcecuteContextMenuAction(): now there's happening nothing!" );
}
@@ -2544,17 +2553,17 @@ void SvTreeListBox::EnableContextMenuHandling( void )
{
DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" );
- pImp->bContextMenuHandling = TRUE;
+ pImp->bContextMenuHandling = sal_True;
}
-void SvTreeListBox::EnableContextMenuHandling( BOOL b )
+void SvTreeListBox::EnableContextMenuHandling( sal_Bool b )
{
DBG_ASSERT( pImp, "-SvTreeListBox::EnableContextMenuHandling(): No implementation!" );
pImp->bContextMenuHandling = b;
}
-BOOL SvTreeListBox::IsContextMenuHandlingEnabled( void ) const
+sal_Bool SvTreeListBox::IsContextMenuHandlingEnabled( void ) const
{
DBG_ASSERT( pImp, "-SvTreeListBox::IsContextMenuHandlingEnabled(): No implementation!" );
@@ -2619,7 +2628,7 @@ void SvTreeListBox::EnableCellFocus()
pImp->EnableCellFocus();
}
-void SvTreeListBox::CallImplEventListeners(ULONG nEvent, void* pData)
+void SvTreeListBox::CallImplEventListeners(sal_uLong nEvent, void* pData)
{
CallEventListeners(nEvent, pData);
}
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index 9cd0add24eda..ea768918e460 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include "templwin.hxx"
-#include "templdlg.hxx"
+#include <svtools/templdlg.hxx>
#include <svtools/svtdata.hxx>
#include <svtools/langhelp.hxx>
#include <unotools/pathoptions.hxx>
@@ -37,18 +37,17 @@
#include <unotools/extendedsecurityoptions.hxx>
#include <svtools/xtextedt.hxx>
#include <svl/inettype.hxx>
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <svtools/miscopt.hxx>
-#include "templatefoldercache.hxx"
-#include "imgdef.hxx"
-#include "txtattr.hxx"
+#include <svtools/templatefoldercache.hxx>
+#include <svtools/imgdef.hxx>
+#include <svtools/txtattr.hxx>
#include <svtools/svtools.hrc>
#include "templwin.hrc"
#include <svtools/helpid.hrc>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <unotools/ucbhelper.hxx>
-
#include "unotools/configmgr.hxx"
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -83,7 +82,7 @@
#include <vcl/svapp.hxx>
#include <vcl/split.hxx>
#include <vcl/msgbox.hxx>
-#include "DocumentInfoPreview.hxx"
+#include <svtools/DocumentInfoPreview.hxx>
#include <vcl/mnemonic.hxx>
#include <ucbhelper/content.hxx>
@@ -123,7 +122,7 @@ extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview.
struct FolderHistory
{
String m_sURL;
- ULONG m_nGroup;
+ sal_uLong m_nGroup;
FolderHistory( const String& _rURL, sal_Int32 _nGroup ) :
m_sURL( _rURL ), m_nGroup( _nGroup ) {}
@@ -135,7 +134,7 @@ ODocumentInfoPreview::ODocumentInfoPreview( Window* pParent ,WinBits _nBits) : W
{
m_pEditWin = new SvtExtendedMultiLineEdit_Impl(this,_nBits);
m_pEditWin->Show();
- m_pEditWin->EnableCursor( FALSE );
+ m_pEditWin->EnableCursor( sal_False );
m_pInfoTable = new SvtDocInfoTable_Impl();
// detect application language
m_aLocale = SvtPathOptions().GetLocale();
@@ -184,7 +183,7 @@ void ODocumentInfoPreview::fill(
if (!i_xDocProps.is()) throw RuntimeException();
::rtl::OUString aStr;
- m_pEditWin->SetAutoScroll( FALSE );
+ m_pEditWin->SetAutoScroll( sal_False );
aStr = i_xDocProps->getTitle();
if (aStr.getLength()) {
@@ -238,7 +237,7 @@ void ODocumentInfoPreview::fill(
// size
if ( i_rURL.Len() > 0 )
{
- ULONG nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL );
+ sal_uLong nDocSize = ::utl::UCBContentHelper::GetSize( i_rURL );
m_pEditWin->InsertEntry(
m_pInfoTable->GetString( DI_SIZE ),
CreateExactSizeText_Impl( nDocSize ) );
@@ -286,7 +285,7 @@ void ODocumentInfoPreview::fill(
}
m_pEditWin->SetSelection( Selection( 0, 0 ) );
- m_pEditWin->SetAutoScroll( TRUE );
+ m_pEditWin->SetAutoScroll( sal_True );
}
// -----------------------------------------------------------------------------
@@ -341,7 +340,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) :
aIconCtrl.SetAccessibleName( String( RTL_CONSTASCII_USTRINGPARAM("Groups") ) );
aIconCtrl.SetHelpId( HID_TEMPLATEDLG_ICONCTRL );
- aIconCtrl.SetChoiceWithCursor( TRUE );
+ aIconCtrl.SetChoiceWithCursor( sal_True );
aIconCtrl.SetSelectionMode( SINGLE_SELECTION );
aIconCtrl.Show();
@@ -413,7 +412,7 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) :
SvtIconWindow_Impl::~SvtIconWindow_Impl()
{
- for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i )
+ for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i )
{
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( i );
delete (String*)pEntry->GetUserData();
@@ -423,7 +422,7 @@ SvtIconWindow_Impl::~SvtIconWindow_Impl()
SvxIconChoiceCtrlEntry* SvtIconWindow_Impl::GetEntry( const String& rURL ) const
{
SvxIconChoiceCtrlEntry* pEntry = NULL;
- for ( ULONG i = 0; i < aIconCtrl.GetEntryCount(); ++i )
+ for ( sal_uLong i = 0; i < aIconCtrl.GetEntryCount(); ++i )
{
SvxIconChoiceCtrlEntry* pTemp = aIconCtrl.GetEntry( i );
String aURL( *( (String*)pTemp->GetUserData() ) );
@@ -461,7 +460,7 @@ String SvtIconWindow_Impl::GetCursorPosIconURL() const
String SvtIconWindow_Impl::GetSelectedIconURL() const
{
- ULONG nPos;
+ sal_uLong nPos;
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetSelectedEntry( nPos );
String aURL;
if ( pEntry )
@@ -471,7 +470,7 @@ String SvtIconWindow_Impl::GetSelectedIconURL() const
String SvtIconWindow_Impl::GetSelectedIconText() const
{
- ULONG nPos;
+ sal_uLong nPos;
return MnemonicGenerator::EraseAllMnemonicChars( aIconCtrl.GetSelectedEntry( nPos )->GetText() );
}
@@ -489,9 +488,9 @@ void SvtIconWindow_Impl::InvalidateIconControl()
aIconCtrl.Invalidate();
}
-ULONG SvtIconWindow_Impl::GetCursorPos() const
+sal_uLong SvtIconWindow_Impl::GetCursorPos() const
{
- ULONG nPos = ~ULONG(0);
+ sal_uLong nPos = ~sal_uLong(0);
SvxIconChoiceCtrlEntry* pCursorEntry = aIconCtrl.GetCursor( );
if ( pCursorEntry )
@@ -500,15 +499,15 @@ ULONG SvtIconWindow_Impl::GetCursorPos() const
return nPos;
}
-ULONG SvtIconWindow_Impl::GetSelectEntryPos() const
+sal_uLong SvtIconWindow_Impl::GetSelectEntryPos() const
{
- ULONG nPos;
+ sal_uLong nPos;
if ( !aIconCtrl.GetSelectedEntry( nPos ) )
- nPos = ~ULONG(0);
+ nPos = ~sal_uLong(0);
return nPos;
}
-void SvtIconWindow_Impl::SetCursorPos( ULONG nPos )
+void SvtIconWindow_Impl::SetCursorPos( sal_uLong nPos )
{
SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( nPos );
aIconCtrl.SetCursor( pEntry );
@@ -525,7 +524,7 @@ long SvtIconWindow_Impl::CalcHeight() const
{
// calculate the required height of the IconControl
long nHeight = 0;
- ULONG nCount = aIconCtrl.GetEntryCount();
+ sal_uLong nCount = aIconCtrl.GetEntryCount();
if ( nCount > 0 )
// bottom of the last icon
nHeight = aIconCtrl.GetEntry(nCount-1)->GetBoundRect().Bottom();
@@ -544,9 +543,9 @@ sal_Bool SvtIconWindow_Impl::IsRootURL( const String& rURL ) const
rURL == aSamplesFolderRootURL;
}
-ULONG SvtIconWindow_Impl::GetRootPos( const String& rURL ) const
+sal_uLong SvtIconWindow_Impl::GetRootPos( const String& rURL ) const
{
- ULONG nPos = ~ULONG(0);
+ sal_uLong nPos = ~sal_uLong(0);
if ( aNewDocumentRootURL.Match( rURL ) == STRING_MATCH )
nPos = 0;
else if ( aTemplateRootURL.Match( rURL ) == STRING_MATCH )
@@ -645,7 +644,7 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const
::rtl::OUString aImageURL;
::rtl::OUString aTargetFrame;
- UINT32 i, nCount = aDynamicMenuEntries.getLength();
+ sal_uInt32 i, nCount = aDynamicMenuEntries.getLength();
::rtl::OUString sSeparator( ASCII_STR("private:separator") );
::rtl::OUString sSlotURL( ASCII_STR("slot:5500") );
@@ -787,7 +786,7 @@ void SvtExtendedMultiLineEdit_Impl::InsertEntry( const String& rTitle, const Str
aText += rTitle;
aText += ':';
InsertText( aText );
- ULONG nPara = GetParagraphCount() - 1;
+ sal_uLong nPara = GetParagraphCount() - 1;
SetAttrib( TextAttribFontWeight( WEIGHT_BOLD ), nPara, 0, aText.Len() );
aText = '\n';
@@ -967,7 +966,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B
// disabling must be done here, does not work in ctor because
// execute of the dialog will overwrite it
// ( own execute method would help )
- pTextWin->EnableInput( FALSE, TRUE );
+ pTextWin->EnableInput( sal_False, sal_True );
if ( pTextWin->IsReallyVisible() )
{
sal_Bool b = sal_True;
@@ -1123,7 +1122,7 @@ IMPL_LINK ( SvtTemplateWindow , IconClickHdl_Impl, SvtIconChoiceCtrl *, EMPTYARG
{
pFileWin->OpenRoot( aURL );
pIconWin->InvalidateIconControl();
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
}
return 0;
}
@@ -1160,10 +1159,10 @@ IMPL_LINK ( SvtTemplateWindow , FileDblClickHdl_Impl, SvtFileView *, EMPTYARG )
IMPL_LINK ( SvtTemplateWindow , NewFolderHdl_Impl, SvtFileView *, EMPTYARG )
{
pFrameWin->OpenFile( String(), sal_True, sal_False, sal_False );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
String sURL = pFileWin->GetFolderURL();
- ULONG nPos = pIconWin->GetRootPos( sURL );
+ sal_uLong nPos = pIconWin->GetRootPos( sURL );
AppendHistoryURL( sURL, nPos );
aNewFolderHdl.Call( this );
@@ -1234,7 +1233,7 @@ void SvtTemplateWindow::PrintFile( const String& rURL )
// ------------------------------------------------------------------------
-void SvtTemplateWindow::AppendHistoryURL( const String& rURL, ULONG nGroup )
+void SvtTemplateWindow::AppendHistoryURL( const String& rURL, sal_uLong nGroup )
{
sal_Bool bInsert = sal_True;
if ( !pHistoryList )
@@ -1269,7 +1268,7 @@ void SvtTemplateWindow::OpenHistory()
// ------------------------------------------------------------------------
-void SvtTemplateWindow::DoAction( USHORT nAction )
+void SvtTemplateWindow::DoAction( sal_uInt16 nAction )
{
switch( nAction )
{
@@ -1318,16 +1317,16 @@ void SvtTemplateWindow::InitToolBoxes()
aSize.Height() += 4;
aFrameWinTB.SetPosSizePixel( Point( pFrameWin->GetPosPixel().X() + 2, 2 ), aSize );
- BOOL bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT );
+ sal_Bool bFlat = ( SvtMiscOptions().GetToolboxStyle() == TOOLBOX_STYLE_FLAT );
if ( bFlat )
{
aFileViewTB.SetOutStyle( TOOLBOX_STYLE_FLAT );
aFrameWinTB.SetOutStyle( TOOLBOX_STYLE_FLAT );
}
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, FALSE );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, FALSE );
- aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, FALSE );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_BACK, sal_False );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PREV, sal_False );
+ aFileViewTB.EnableItem( TI_DOCTEMPLATE_PRINT, sal_False );
Link aLink = LINK( this, SvtTemplateWindow, ClickHdl_Impl );
aFileViewTB.SetClickHdl( aLink );
@@ -1339,7 +1338,7 @@ void SvtTemplateWindow::InitToolBoxes()
void SvtTemplateWindow::InitToolBoxImages()
{
SvtMiscOptions aMiscOpt;
- BOOL bLarge = aMiscOpt.AreCurrentSymbolsLarge();
+ sal_Bool bLarge = aMiscOpt.AreCurrentSymbolsLarge();
aFileViewTB.SetItemImage( TI_DOCTEMPLATE_BACK, Image( SvtResId(
bLarge ? IMG_SVT_DOCTEMPLATE_BACK_LARGE
@@ -1370,13 +1369,13 @@ void SvtTemplateWindow::UpdateIcons()
long SvtTemplateWindow::PreNotify( NotifyEvent& rNEvt )
{
- USHORT nType = rNEvt.GetType();
+ sal_uInt16 nType = rNEvt.GetType();
long nRet = 0;
if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() )
{
const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode();
- USHORT nCode = rKeyCode.GetCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
if ( KEY_BACKSPACE == nCode && !rKeyCode.GetModifier() && pFileWin->HasChildPathFocus() )
{
@@ -1579,7 +1578,7 @@ void SvtTemplateWindow::ReadViewSettings()
// the selected view (details or preview)
pFrameWin->ToggleView( TI_DOCTEMPLATE_DOCINFO == nSelectedView );
- aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, TRUE );
+ aFrameWinTB.CheckItem( (sal_uInt16)nSelectedView, sal_True );
// the split ratio
sal_Int32 nSplitFileAndFrameSize = aSplitWin.GetItemSize( FILEWIN_ID ) + aSplitWin.GetItemSize( FRAMEWIN_ID );
diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx
index b74dfb9a2366..161df3184de3 100644
--- a/svtools/source/contnr/templwin.hxx
+++ b/svtools/source/contnr/templwin.hxx
@@ -33,8 +33,8 @@
#include <vcl/toolbox.hxx>
#include <vcl/window.hxx>
#include <svtools/headbar.hxx>
-#include "fileview.hxx"
-#include "ivctrl.hxx"
+#include <svtools/fileview.hxx>
+#include <svtools/ivctrl.hxx>
#include <svtools/svmedit2.hxx>
#include <svl/restrictedpaths.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -95,13 +95,13 @@ public:
String GetCursorPosIconURL() const;
String GetIconText( const String& rURL ) const;
void InvalidateIconControl();
- void SetCursorPos( ULONG nPos );
- ULONG GetCursorPos() const;
- ULONG GetSelectEntryPos() const;
+ void SetCursorPos( sal_uLong nPos );
+ sal_uLong GetCursorPos() const;
+ sal_uLong GetSelectEntryPos() const;
void SetFocus();
long CalcHeight() const;
sal_Bool IsRootURL( const String& rURL ) const;
- ULONG GetRootPos( const String& rURL ) const;
+ sal_uLong GetRootPos( const String& rURL ) const;
void UpdateIcons();
inline sal_Bool ProcessKeyEvent( const KeyEvent& rKEvt );
@@ -269,9 +269,9 @@ private:
DECL_LINK( ResizeHdl_Impl, SplitWindow* ); // used for split and initial setting of toolbar pos
void PrintFile( const String& rURL );
- void AppendHistoryURL( const String& rURL, ULONG nGroup );
+ void AppendHistoryURL( const String& rURL, sal_uLong nGroup );
void OpenHistory();
- void DoAction( USHORT nAction );
+ void DoAction( sal_uInt16 nAction );
void InitToolBoxes();
void InitToolBoxImages();
void UpdateIcons();
diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src
index 162202408437..076963d2e7c3 100644
--- a/svtools/source/contnr/templwin.src
+++ b/svtools/source/contnr/templwin.src
@@ -28,7 +28,7 @@
// includes ------------------------------------------------------------------
#include "templwin.hrc"
-#include "controldims.hrc"
+#include <svtools/controldims.hrc>
#include <svtools/helpid.hrc>
#include <svtools/svtools.hrc>
@@ -215,12 +215,14 @@ ModalDialog DLG_DOCTEMPLATE
};
PushButton BTN_DOCTEMPLATE_MANAGE
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_MANAGE";
Pos = MAP_APPFONT( 6, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "Organi~ze...";
};
PushButton BTN_DOCTEMPLATE_EDIT
{
+ HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_EDIT";
Pos = MAP_APPFONT( 59, 230 );
Size = MAP_APPFONT( 50, 14 );
Text [ en-US ] = "~Edit";
diff --git a/svtools/source/contnr/tooltiplbox.cxx b/svtools/source/contnr/tooltiplbox.cxx
index 9a148336adbe..fb610e826f3a 100644
--- a/svtools/source/contnr/tooltiplbox.cxx
+++ b/svtools/source/contnr/tooltiplbox.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "tooltiplbox.hxx"
+#include <svtools/tooltiplbox.hxx>
#include <vcl/help.hxx>
// ============================================================================
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 7bb25e9c065e..f78b13fb04ad 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -82,7 +82,7 @@ void SvListEntry::SetListPositions()
if( pChilds )
{
SvListEntry *pEntry = (SvListEntry*)pChilds->First();
- ULONG nCur = 0;
+ sal_uLong nCur = 0;
while ( pEntry )
{
pEntry->nListPos &= 0x80000000;
@@ -132,16 +132,6 @@ void SvTreeEntryList::DestroyAll()
}
-
-
-#if defined (WIN) && defined (MSC)
-// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible
-// (andere?) funktionieren nicht mit Optimierung.
-#pragma optimize ("", off)
-#endif
-
-
-
/*************************************************************************
|*
|* SvTreeList::
@@ -151,7 +141,7 @@ void SvTreeEntryList::DestroyAll()
SvTreeList::SvTreeList()
{
nEntryCount = 0;
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
nRefCount = 1;
pRootItem = new SvListEntry;
eSortMode = SortNone;
@@ -179,11 +169,11 @@ SvTreeList::~SvTreeList()
|*
*************************************************************************/
-void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvTreeList::Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
- ULONG nViewCount = aViewList.Count();
- for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ )
+ sal_uLong nViewCount = aViewList.Count();
+ for( sal_uLong nCurView = 0; nCurView < nViewCount; nCurView++ )
{
SvListView* pView = (SvListView*)aViewList.GetObject( nCurView );
if( pView )
@@ -193,7 +183,7 @@ void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1,
void SvTreeList::InsertView( SvListView* pView)
{
- ULONG nPos = aViewList.GetPos( pView );
+ sal_uLong nPos = aViewList.GetPos( pView );
if ( nPos == LIST_ENTRY_NOTFOUND )
{
aViewList.Insert( pView, LIST_APPEND );
@@ -203,7 +193,7 @@ void SvTreeList::InsertView( SvListView* pView)
void SvTreeList::RemoveView( SvListView* pView )
{
- ULONG nPos = aViewList.GetPos( pView );
+ sal_uLong nPos = aViewList.GetPos( pView );
if ( nPos != LIST_ENTRY_NOTFOUND )
{
aViewList.Remove( pView );
@@ -213,15 +203,15 @@ void SvTreeList::RemoveView( SvListView* pView )
// Ein Entry ist sichtbar, wenn alle Parents expandiert sind
-BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const
+sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const
{
DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params");
- BOOL bRetVal=FALSE;
+ sal_Bool bRetVal=sal_False;
do
{
if ( pEntry == pRootItem )
{
- bRetVal=TRUE;
+ bRetVal=sal_True;
break;
}
pEntry = pEntry->pParent;
@@ -229,10 +219,10 @@ BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry )
return bRetVal;
}
-USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const
+sal_uInt16 SvTreeList::GetDepth( SvListEntry* pEntry ) const
{
DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry");
- USHORT nDepth = 0;
+ sal_uInt16 nDepth = 0;
while( pEntry->pParent != pRootItem )
{
nDepth++;
@@ -273,20 +263,20 @@ void SvTreeList::Clear()
|*
*************************************************************************/
-BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
+sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
{
if ( !pParent )
pParent = pRootItem;
- BOOL bIsChild = FALSE;
+ sal_Bool bIsChild = sal_False;
SvTreeEntryList* pList = pParent->pChilds;
if ( !pList )
- return FALSE;
+ return sal_False;
SvListEntry* pActualChild = (SvListEntry*)(pList->First());
while( !bIsChild && pActualChild )
{
if ( pActualChild == pChild )
- bIsChild = TRUE;
+ bIsChild = sal_True;
else
{
if ( pActualChild->pChilds )
@@ -297,7 +287,7 @@ BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
return bIsChild;
}
-ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos)
{
// pDest darf Null sein!
DBG_ASSERT(pSrcEntry,"Entry?");
@@ -312,7 +302,7 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
if ( pSrcEntry == pTargetParent )
return pSrcEntry->GetChildListPos();
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
SvTreeEntryList* pDstList = pTargetParent->pChilds;
SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds;
@@ -341,20 +331,20 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
// Listenpositionen in Zielliste korrigieren
SetListPositions( pDstList );
- if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList )
+ if ( pSrcList && (sal_uLong)pSrcList != (sal_uLong)pDstList )
SetListPositions( pSrcList );
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
- ULONG nRetVal = pDstList->GetPos( pSrcEntry );
+ sal_uLong nRetVal = pDstList->GetPos( pSrcEntry );
DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid");
Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal);
return nRetVal;
}
-ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos)
{
// pDest darf Null sein!
DBG_ASSERT(pSrcEntry,"Entry?");
@@ -363,9 +353,9 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
if ( !pTargetParent->pChilds )
pTargetParent->pChilds = new SvTreeEntryList;
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
- ULONG nCloneCount = 0;
+ sal_uLong nCloneCount = 0;
SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount );
nEntryCount += nCloneCount;
@@ -378,7 +368,7 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n
CheckIntegrity();
#endif
Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry );
- ULONG nRetVal = pDstList->GetPos( pClonedEntry );
+ sal_uLong nRetVal = pDstList->GetPos( pClonedEntry );
return nRetVal;
}
@@ -393,7 +383,7 @@ CheckIntegrity();
void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -418,7 +408,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -441,7 +431,7 @@ void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry)
{
SvListEntry* pParent;
- ULONG nPos;
+ sal_uLong nPos;
if ( !pDstEntry )
{
@@ -458,7 +448,7 @@ void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry)
void SvTreeList::InsertTree(SvListEntry* pSrcEntry,
- SvListEntry* pTargetParent,ULONG nListPos)
+ SvListEntry* pTargetParent,sal_uLong nListPos)
{
DBG_ASSERT(pSrcEntry,"InsertTree:Entry?");
if ( !pSrcEntry )
@@ -472,7 +462,7 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry,
// Sortierung beruecksichtigen
GetInsertionPos( pSrcEntry, pTargetParent, nListPos );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
pSrcEntry->pParent = pTargetParent; // Parent umsetzen
SvTreeEntryList* pDstList = pTargetParent->pChilds;
@@ -507,7 +497,7 @@ SvListEntry* SvTreeList::CreateEntry() const
|*
*************************************************************************/
-SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const
+SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const
{
SvListEntry* pClonedEntry = CloneEntry( pEntry );
nCloneCount = 1;
@@ -525,7 +515,7 @@ SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const
SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds,
SvListEntry* pNewParent,
- ULONG& nCloneCount ) const
+ sal_uLong& nCloneCount ) const
{
DBG_ASSERT(pChilds->Count(),"Childs?");
SvTreeEntryList* pClonedChilds = new SvTreeEntryList;
@@ -555,16 +545,16 @@ SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds,
|*
*************************************************************************/
-ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const
+sal_uLong SvTreeList::GetChildCount( SvListEntry* pParent ) const
{
if ( !pParent )
return GetEntryCount();
if ( !pParent || !pParent->pChilds)
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = Next( pParent, &nActDepth );
@@ -580,16 +570,16 @@ ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const
|*
*************************************************************************/
-ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const
+sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const
{
DBG_ASSERT(pView,"GetVisChildCount:No View");
if ( !pParent )
pParent = pRootItem;
if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds )
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = NextVisible( pView, pParent, &nActDepth );
@@ -599,16 +589,16 @@ ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pPa
return nCount;
}
-ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const
+sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const
{
DBG_ASSERT(pView,"GetChildSelCount:No View");
if ( !pParent )
pParent = pRootItem;
if ( !pParent || !pParent->pChilds)
return 0;
- ULONG nCount = 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nActDepth = nRefDepth;
+ sal_uLong nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nActDepth = nRefDepth;
do
{
pParent = Next( pParent, &nActDepth );
@@ -639,22 +629,22 @@ SvListEntry* SvTreeList::First() const
|* SvTreeList::Next
|*
*************************************************************************/
-SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const
+SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, sal_uInt16* pDepth ) const
{
DBG_ASSERT( pActEntry && pActEntry->pParent, "SvTreeList::Next: invalid entry/parent!" );
if ( !pActEntry || !pActEntry->pParent )
return NULL;
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pDepth )
{
nDepth = *pDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ )
{
@@ -699,20 +689,20 @@ SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const
|* SvTreeList::Prev
|*
*************************************************************************/
-SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const
+SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, sal_uInt16* pDepth ) const
{
DBG_ASSERT(pActEntry!=0,"Entry?");
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pDepth )
{
nDepth = *pDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( nActualPos > 0 )
{
@@ -748,7 +738,7 @@ SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const
|*
*************************************************************************/
-SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const
+SvListEntry* SvTreeList::Last( sal_uInt16* /* nDepth */ ) const
{
SvTreeEntryList* pActList = pRootItem->pChilds;
// if ( pActList->Count() == 0 )
@@ -770,7 +760,7 @@ SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const
|*
*************************************************************************/
-ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const
+sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const
{
DBG_ASSERT(pView&&pEntry,"View/Entry?");
@@ -790,7 +780,7 @@ ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry )
|*
*************************************************************************/
-ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
+sal_uLong SvTreeList::GetVisibleCount( const SvListView* pView ) const
{
DBG_ASSERT(pView,"GetVisCount:No View");
if( !pView->HasViewData() )
@@ -798,7 +788,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
if ( pView->nVisibleCount )
return pView->nVisibleCount;
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar
while ( pEntry )
{
@@ -814,7 +804,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
}
#endif
((SvListView*)pView)->nVisibleCount = nPos;
- ((SvListView*)pView)->bVisPositionsValid = TRUE;
+ ((SvListView*)pView)->bVisPositionsValid = sal_True;
return nPos;
}
@@ -828,22 +818,22 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
// Funktion geht aus Geschwindigkeitsgruenden davon aus,
// das der uebergebene Eintrag bereits sichtbar ist
-SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const
{
DBG_ASSERT(pView,"NextVisible:No View");
if ( !pActEntry )
return 0;
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pActDepth )
{
nDepth = *pActDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( pView->IsExpanded(pActEntry) )
{
@@ -894,20 +884,20 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn
// Funktion geht aus Geschwindigkeitsgruenden davon aus,
// das der uebergebene Eintrag bereits sichtbar ist
-SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const
+SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const
{
DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?");
- USHORT nDepth = 0;
- int bWithDepth = FALSE;
+ sal_uInt16 nDepth = 0;
+ int bWithDepth = sal_False;
if ( pActDepth )
{
nDepth = *pActDepth;
- bWithDepth = TRUE;
+ bWithDepth = sal_True;
}
SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
- ULONG nActualPos = pActEntry->GetChildListPos();
+ sal_uLong nActualPos = pActEntry->GetChildListPos();
if ( nActualPos > 0 )
{
@@ -943,7 +933,7 @@ SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActE
|*
*************************************************************************/
-SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const
+SvListEntry* SvTreeList::LastVisible( const SvListView* pView, sal_uInt16* pDepth) const
{
DBG_ASSERT(pView,"LastVis:No View");
SvListEntry* pEntry = Last();
@@ -960,20 +950,20 @@ SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) c
|*
*************************************************************************/
-SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,sal_uInt16& nDelta) const
{
DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis");
- ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
// nDelta Eintraege vorhanden ?
// Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7
// nNewDelta = 10-nVisPos-1 == 4
if ( nVisPos+nDelta >= pView->nVisibleCount )
{
- nDelta = (USHORT)(pView->nVisibleCount-nVisPos);
+ nDelta = (sal_uInt16)(pView->nVisibleCount-nVisPos);
nDelta--;
}
- USHORT nDeltaTmp = nDelta;
+ sal_uInt16 nDeltaTmp = nDelta;
while( nDeltaTmp )
{
pEntry = NextVisible( pView, pEntry );
@@ -989,17 +979,17 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry
|*
*************************************************************************/
-SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const
+SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, sal_uInt16& nDelta ) const
{
DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis");
- ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ sal_uLong nVisPos = GetVisiblePos( pView, pEntry );
// nDelta Eintraege vorhanden ?
// Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20
// nNewDelta = nNewVisPos
if ( nDelta > nVisPos )
- nDelta = (USHORT)nVisPos;
- USHORT nDeltaTmp = nDelta;
+ nDelta = (sal_uInt16)nVisPos;
+ sal_uInt16 nDeltaTmp = nDelta;
while( nDeltaTmp )
{
pEntry = PrevVisible( pView, pEntry );
@@ -1045,8 +1035,8 @@ SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const
if( !pEntry )
return 0;
SvTreeEntryList* pList = pEntry->pParent->pChilds;
-// ULONG nPos = pList->GetPos( pEntry );
- ULONG nPos = pEntry->GetChildListPos();
+// sal_uLong nPos = pList->GetPos( pEntry );
+ sal_uLong nPos = pEntry->GetChildListPos();
nPos++;
pEntry = (SvListEntry*)(pList->GetObject( nPos ));
return pEntry;
@@ -1059,8 +1049,8 @@ SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const
return 0;
SvTreeEntryList* pList = pEntry->pParent->pChilds;
- // ULONG nPos = pList->GetPos( pEntry );
- ULONG nPos = pEntry->GetChildListPos();
+ // sal_uLong nPos = pList->GetPos( pEntry );
+ sal_uLong nPos = pEntry->GetChildListPos();
if ( nPos == 0 )
return 0;
nPos--;
@@ -1134,7 +1124,7 @@ SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const
|* SvTreeList::Insert
|*
*************************************************************************/
-ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos )
+sal_uLong SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uLong nPos )
{
DBG_ASSERT( pEntry,"Entry?");
@@ -1153,7 +1143,7 @@ ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos )
// Sortierung beruecksichtigen
GetInsertionPos( pEntry, pParent, nPos );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
pEntry->pParent = pParent;
pList->Insert( pEntry, nPos );
@@ -1176,7 +1166,7 @@ CheckIntegrity();
|*
*************************************************************************/
-ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const
+sal_uLong SvTreeList::GetAbsPos( SvListEntry* pEntry) const
{
if ( !bAbsPositionsValid )
((SvTreeList*)this)->SetAbsolutePositions();
@@ -1191,7 +1181,7 @@ ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const
void SvTreeList::SetAbsolutePositions()
{
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
SvListEntry* pEntry = First();
while ( pEntry )
{
@@ -1199,7 +1189,7 @@ void SvTreeList::SetAbsolutePositions()
nPos++;
pEntry = Next( pEntry );
}
- bAbsPositionsValid = TRUE;
+ bAbsPositionsValid = sal_True;
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
@@ -1226,7 +1216,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry )
// wenn Parent sichtbar dann Statusdaten invalidieren
if ( pView->IsExpanded( pParent ) )
{
- pView->bVisPositionsValid = FALSE;
+ pView->bVisPositionsValid = sal_False;
pView->nVisibleCount = 0;
}
#ifdef CHECK_INTEGRITY
@@ -1255,7 +1245,7 @@ void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry )
if ( pView->IsExpanded(pParent) )
{
pView->nVisibleCount = 0;
- pView->bVisPositionsValid = FALSE;
+ pView->bVisPositionsValid = sal_False;
}
#ifdef CHECK_INTEGRITY
CheckIntegrity();
@@ -1269,14 +1259,14 @@ CheckIntegrity();
|*
*************************************************************************/
-BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
+sal_Bool SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, sal_Bool bSelect )
{
DBG_ASSERT(pView&&pEntry,"Select:View/Entry?");
SvViewData* pViewData = pView->GetViewData( pEntry );
if ( bSelect )
{
if ( pViewData->IsSelected() || !pViewData->IsSelectable() )
- return FALSE;
+ return sal_False;
else
{
pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED;
@@ -1286,7 +1276,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
else
{
if ( !pViewData->IsSelected() )
- return FALSE;
+ return sal_False;
else
{
pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED );
@@ -1296,7 +1286,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1304,7 +1294,7 @@ CheckIntegrity();
|* SvTreeList::Remove
|*
*************************************************************************/
-BOOL SvTreeList::Remove( SvListEntry* pEntry )
+sal_Bool SvTreeList::Remove( SvListEntry* pEntry )
{
DBG_ASSERT(pEntry,"Cannot remove root, use clear");
@@ -1315,22 +1305,22 @@ BOOL SvTreeList::Remove( SvListEntry* pEntry )
// Explorer aus der View Eintraege, die er nicht in die View
// eingefuegt hat. Da sich der Kunde fuer ein platzendes
// Office nichts kaufen kann, fange ich diesen Fall ab.
- return FALSE;
+ return sal_False;
}
Broadcast( LISTACTION_REMOVING, pEntry );
- ULONG nRemoved = 1 + GetChildCount(pEntry);
- bAbsPositionsValid = FALSE;
+ sal_uLong nRemoved = 1 + GetChildCount(pEntry);
+ bAbsPositionsValid = sal_False;
SvListEntry* pParent = pEntry->pParent;
SvTreeEntryList* pList = pParent->pChilds;
DBG_ASSERT(pList,"Remove:No Childlist");
- BOOL bLastEntry = FALSE;
+ sal_Bool bLastEntry = sal_False;
if ( pEntry->HasChildListPos() )
{
- ULONG nListPos = pEntry->GetChildListPos();
- bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE;
+ sal_uLong nListPos = pEntry->GetChildListPos();
+ bLastEntry = (nListPos == (pList->Count()-1) ) ? sal_True : sal_False;
pList->Remove( nListPos );
}
else
@@ -1360,7 +1350,7 @@ CheckIntegrity();
Broadcast( LISTACTION_REMOVED, pEntry );
delete pEntry; // loescht auch alle Childs
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1369,7 +1359,7 @@ CheckIntegrity();
|*
*************************************************************************/
-ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect )
+sal_uLong SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,sal_Bool bSelect )
{
DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?");
if ( !pParent->pChilds )
@@ -1377,9 +1367,9 @@ ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSel
if ( pParent->pChilds->Count() == 0 )
return 0;
- USHORT nRefDepth = GetDepth( pParent );
- USHORT nDepth = nRefDepth;
- ULONG nCount = 0;
+ sal_uInt16 nRefDepth = GetDepth( pParent );
+ sal_uInt16 nDepth = nRefDepth;
+ sal_uLong nCount = 0;
pParent = Next( pParent );
do
{
@@ -1394,7 +1384,7 @@ CheckIntegrity();
return nCount;
}
-void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect )
+void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect )
{
DBG_ASSERT(pView,"SelectAll:NoView");
SvListEntry* pEntry = First();
@@ -1418,7 +1408,7 @@ CheckIntegrity();
}
-SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const
+SvListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const
{
SvListEntry* pEntry = First();
while ( nAbsPos && pEntry )
@@ -1429,7 +1419,7 @@ SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const
return pEntry;
}
-SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const
+SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uLong nVisPos ) const
{
DBG_ASSERT(pView,"GetEntryAtVisPos:No View");
SvListEntry* pEntry = First();
@@ -1450,7 +1440,7 @@ void SvTreeList::SetListPositions( SvTreeEntryList* pList )
pEntry->pParent->InvalidateChildrensListPositions();
}
/*
- ULONG nListPos = 0;
+ sal_uLong nListPos = 0;
SvListEntry* pEntry = (SvListEntry*)(pList->First());
while( pEntry )
{
@@ -1467,13 +1457,13 @@ void SvTreeList::InvalidateEntry( SvListEntry* pEntry )
Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry );
}
-BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
+sal_Bool SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
{
if ( !pParent )
pParent = pRootItem;
- BOOL bIsChild = FALSE;
+ sal_Bool bIsChild = sal_False;
if ( pParent->pChilds )
- bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND);
+ bIsChild = (sal_Bool)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND);
return bIsChild;
}
@@ -1481,7 +1471,7 @@ BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
void lcl_CheckList( SvTreeEntryList* pList )
{
SvListEntry* pEntry = (SvListEntry*)(pList->First());
- ULONG nPos = 0;
+ sal_uLong nPos = 0;
while ( pEntry )
{
DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos");
@@ -1492,7 +1482,7 @@ void lcl_CheckList( SvTreeEntryList* pList )
void SvTreeList::CheckIntegrity() const
{
- ULONG nMyEntryCount = 0;
+ sal_uLong nMyEntryCount = 0;
if ( pRootItem->pChilds )
{
lcl_CheckList( pRootItem->pChilds );
@@ -1543,7 +1533,7 @@ SvListView::SvListView( SvTreeList* pModell )
pModel = 0;
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
SetModel( pModell );
}
@@ -1553,7 +1543,7 @@ SvListView::SvListView()
pModel = 0;
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
@@ -1587,7 +1577,7 @@ void SvListView::InitTable()
pEntry = pModel->pRootItem;
pViewData = new SvViewData;
pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
// Jetzt alle anderen Entries
pEntry = pModel->First();
while( pEntry )
@@ -1595,7 +1585,7 @@ void SvListView::InitTable()
pViewData = CreateViewData( pEntry );
DBG_ASSERT(pViewData,"InitTable:No ViewData");
InitViewData( pViewData, pEntry );
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
pEntry = pModel->Next( pEntry );
}
}
@@ -1623,25 +1613,25 @@ void SvListView::Clear()
ClearTable();
nSelectionCount = 0;
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
if( pModel )
{
// RootEntry einfuegen
SvListEntry* pEntry = pModel->pRootItem;
SvViewData* pViewData = new SvViewData;
pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
- aDataTable.Insert( (ULONG)pEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pEntry, pViewData );
}
}
void SvListView::SetModel( SvTreeList* pNewModel )
{
DBG_CHKTHIS(SvListView,0);
- BOOL bBroadcastCleared = FALSE;
+ sal_Bool bBroadcastCleared = sal_False;
if ( pModel )
{
pModel->RemoveView( this );
- bBroadcastCleared = TRUE;
+ bBroadcastCleared = sal_True;
ModelNotification( LISTACTION_CLEARING,0,0,0 );
if ( pModel->GetRefCount() == 0 )
delete pModel;
@@ -1670,7 +1660,7 @@ void SvListView::ModelHasInsertedTree( SvListEntry* )
}
void SvListView::ModelIsMoving( SvListEntry* /* pSource */ ,
- SvListEntry* /* pTargetParent */ , ULONG /* nPos */ )
+ SvListEntry* /* pTargetParent */ , sal_uLong /* nPos */ )
{
DBG_CHKTHIS(SvListView,0);
}
@@ -1696,28 +1686,28 @@ void SvListView::ModelHasEntryInvalidated( SvListEntry*)
DBG_CHKTHIS(SvListView,0);
}
-void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,ULONG)
+void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,sal_uLong)
{
DBG_CHKTHIS(SvListView,0);
SvListEntry* pParent = pEntry->pParent;
DBG_ASSERT(pParent,"Model not consistent");
if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 )
{
- SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent );
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pParent );
pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
}
// vorlaeufig
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
void SvListView::ActionMoved( SvListEntry* /* pEntry */ ,
SvListEntry* /* pTargetPrnt */ ,
- ULONG /* nChildPos */ )
+ sal_uLong /* nChildPos */ )
{
DBG_CHKTHIS(SvListView,0);
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
void SvListView::ActionInserted( SvListEntry* pEntry )
@@ -1727,14 +1717,14 @@ void SvListView::ActionInserted( SvListEntry* pEntry )
SvViewData* pData = CreateViewData( pEntry );
InitViewData( pData, pEntry );
#ifdef DBG_UTIL
- BOOL bSuccess =
+ sal_Bool bSuccess =
#endif
- aDataTable.Insert( (ULONG)pEntry, pData );
+ aDataTable.Insert( (sal_uLong)pEntry, pData );
DBG_ASSERT(bSuccess,"Entry already in View");
if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry ))
{
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
}
@@ -1744,18 +1734,18 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry )
if ( pModel->IsEntryVisible( this, pEntry ))
{
nVisibleCount = 0;
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
}
// ueber Entry und seine Childs iterieren
SvListEntry* pCurEntry = pEntry;
- USHORT nRefDepth = pModel->GetDepth( pCurEntry );
+ sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry );
while( pCurEntry )
{
- DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table");
+ DBG_ASSERT(aDataTable.Get((sal_uLong)pCurEntry)==0,"Entry already in Table");
SvViewData* pViewData = CreateViewData( pCurEntry );
DBG_ASSERT(pViewData,"No ViewData");
InitViewData( pViewData, pEntry );
- aDataTable.Insert( (ULONG)pCurEntry, pViewData );
+ aDataTable.Insert( (sal_uLong)pCurEntry, pViewData );
pCurEntry = pModel->Next( pCurEntry );
if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth)
pCurEntry = 0;
@@ -1770,9 +1760,9 @@ void SvListView::RemoveViewData( SvListEntry* pParent )
SvListEntry* pCur = (SvListEntry*)pChilds->First();
while( pCur )
{
- SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur);
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCur);
delete pViewData;
- aDataTable.Remove( (ULONG)pCur );
+ aDataTable.Remove( (sal_uLong)pCur );
if( pCur->HasChilds())
RemoveViewData( pCur );
pCur = (SvListEntry*)pChilds->Next();
@@ -1787,12 +1777,12 @@ void SvListView::ActionRemoving( SvListEntry* pEntry )
DBG_CHKTHIS(SvListView,0);
DBG_ASSERT(pEntry,"Remove:No Entry");
- SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
- ULONG nSelRemoved = 0;
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
+ sal_uLong nSelRemoved = 0;
if ( pViewData->IsSelected() )
nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry );
nSelectionCount -= nSelRemoved;
- ULONG nVisibleRemoved = 0;
+ sal_uLong nVisibleRemoved = 0;
if ( pModel->IsEntryVisible( this, pEntry ) )
nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry );
if( nVisibleCount )
@@ -1805,18 +1795,18 @@ void SvListView::ActionRemoving( SvListEntry* pEntry )
#endif
nVisibleCount -= nVisibleRemoved;
}
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
- pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry);
+ pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pEntry);
delete pViewData;
- aDataTable.Remove( (ULONG)pEntry );
+ aDataTable.Remove( (sal_uLong)pEntry );
RemoveViewData( pEntry );
SvListEntry* pCurEntry = pEntry->pParent;
if ( pCurEntry && pCurEntry != pModel->pRootItem &&
pCurEntry->pChilds->Count() == 1 )
{
- pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry);
+ pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCurEntry);
pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
}
}
@@ -1832,8 +1822,8 @@ void SvListView::ActionClear()
Clear();
}
-void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
- SvListEntry* pEntry2, ULONG nPos )
+void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, sal_uLong nPos )
{
DBG_CHKTHIS(SvListView,0);
switch( nActionId )
@@ -1873,7 +1863,7 @@ void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
ModelHasEntryInvalidated( pEntry1 );
break;
case LISTACTION_RESORTED:
- bVisPositionsValid = FALSE;
+ bVisPositionsValid = sal_False;
break;
case LISTACTION_RESORTING:
break;
@@ -1901,7 +1891,7 @@ StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) cons
void SvTreeList::Resort()
{
Broadcast( LISTACTION_RESORTING );
- bAbsPositionsValid = FALSE;
+ bAbsPositionsValid = sal_False;
ResortChilds( pRootItem );
Broadcast( LISTACTION_RESORTED );
}
@@ -1915,11 +1905,11 @@ void SvTreeList::ResortChilds( SvListEntry* pParent )
List aList( *pChildList );
pChildList->Clear();
- ULONG nCount = aList.Count();
- for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ sal_uLong nCount = aList.Count();
+ for( sal_uLong nCur = 0; nCur < nCount; nCur++ )
{
SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur );
- ULONG nListPos = LIST_APPEND;
+ sal_uLong nListPos = LIST_APPEND;
GetInsertionPos( pCurEntry, pParent, nListPos );
pChildList->Insert( pCurEntry, nListPos );
if( pCurEntry->pChilds )
@@ -1929,7 +1919,7 @@ void SvTreeList::ResortChilds( SvListEntry* pParent )
}
void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent,
- ULONG& rPos )
+ sal_uLong& rPos )
{
DBG_ASSERT(pEntry,"No Entry");
diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx
index 758999d61dcd..9a48cf0c73a1 100644..100755
--- a/svtools/source/control/asynclink.cxx
+++ b/svtools/source/control/asynclink.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <asynclink.hxx>
+#include <svtools/asynclink.hxx>
#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <vcl/timer.hxx>
@@ -43,11 +43,11 @@ void AsynchronLink::CreateMutex()
if( !_pMutex ) _pMutex = new osl::Mutex;
}
-void AsynchronLink::Call( void* pObj, BOOL
+void AsynchronLink::Call( void* pObj, sal_Bool
#ifdef DBG_UTIL
bAllowDoubles
#endif
-, BOOL bUseTimer )
+, sal_Bool bUseTimer )
{
#ifdef DBG_UTIL
if ( bUseTimer || !_bInCall )
@@ -93,7 +93,7 @@ AsynchronLink::~AsynchronLink()
Application::RemoveUserEvent( _nEventId );
}
delete _pTimer;
- if( _pDeleted ) *_pDeleted = TRUE;
+ if( _pDeleted ) *_pDeleted = sal_True;
delete _pMutex;
}
@@ -126,13 +126,13 @@ void AsynchronLink::ClearPendingCall()
void AsynchronLink::Call_Impl( void* pArg )
{
- _bInCall = TRUE;
- BOOL bDeleted = FALSE;
+ _bInCall = sal_True;
+ sal_Bool bDeleted = sal_False;
_pDeleted = &bDeleted;
_aLink.Call( pArg );
if( !bDeleted )
{
- _bInCall = FALSE;
+ _bInCall = sal_False;
_pDeleted = 0;
}
}
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 0fba66e132a8..4a0bc4112264 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -46,7 +46,7 @@
#define _SV_CALENDAR_CXX
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include <calendar.hxx>
+#include <svtools/calendar.hxx>
// =======================================================================
@@ -63,12 +63,12 @@
#define WEEKNUMBER_HEIGHT 85
-#define CALENDAR_HITTEST_DAY ((USHORT)0x0001)
-#define CALENDAR_HITTEST_WEEK ((USHORT)0x0002)
-#define CALENDAR_HITTEST_MONTHTITLE ((USHORT)0x0004)
-#define CALENDAR_HITTEST_PREV ((USHORT)0x0008)
-#define CALENDAR_HITTEST_NEXT ((USHORT)0x0010)
-#define CALENDAR_HITTEST_OUTSIDE ((USHORT)0x1000)
+#define CALENDAR_HITTEST_DAY ((sal_uInt16)0x0001)
+#define CALENDAR_HITTEST_WEEK ((sal_uInt16)0x0002)
+#define CALENDAR_HITTEST_MONTHTITLE ((sal_uInt16)0x0004)
+#define CALENDAR_HITTEST_PREV ((sal_uInt16)0x0008)
+#define CALENDAR_HITTEST_NEXT ((sal_uInt16)0x0010)
+#define CALENDAR_HITTEST_OUTSIDE ((sal_uInt16)0x1000)
#define MENU_YEAR_COUNT 3
@@ -83,7 +83,7 @@ struct ImplDateInfo
XubString maText;
Color* mpTextColor;
Color* mpFrameColor;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
ImplDateInfo( const XubString& rText ) :
maText( rText )
@@ -95,7 +95,7 @@ DECLARE_TABLE( ImplDateTable, ImplDateInfo* )
// =======================================================================
-static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSelect )
+static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect )
{
if ( bSelect )
pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED );
@@ -108,7 +108,7 @@ static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSele
static void ImplCalendarSelectDateRange( Table* pTable,
const Date& rStartDate,
const Date& rEndDate,
- BOOL bSelect )
+ sal_Bool bSelect )
{
Date aStartDate = rStartDate;
Date aEndDate = rEndDate;
@@ -209,24 +209,24 @@ void Calendar::ImplInit( WinBits nWinStyle )
mnFirstYear = 0;
mnLastYear = 0;
mnRequestYear = 0;
- mbCalc = TRUE;
- mbFormat = TRUE;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbWeekSel = FALSE;
- mbUnSel = FALSE;
- mbMenuDown = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
- mbDirect = FALSE;
- mbInSelChange = FALSE;
- mbTravelSelect = FALSE;
- mbScrollDateRange = FALSE;
- mbSelLeft = FALSE;
- mbAllSel = FALSE;
- mbDropPos = FALSE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbWeekSel = sal_False;
+ mbUnSel = sal_False;
+ mbMenuDown = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
+ mbDirect = sal_False;
+ mbInSelChange = sal_False;
+ mbTravelSelect = sal_False;
+ mbScrollDateRange = sal_False;
+ mbSelLeft = sal_False;
+ mbAllSel = sal_False;
+ mbDropPos = sal_False;
::rtl::OUString aGregorian( RTL_CONSTASCII_USTRINGPARAM( "gregorian"));
maCalendarWrapper.loadCalendar( aGregorian,
@@ -253,14 +253,14 @@ void Calendar::ImplInit( WinBits nWinStyle )
}
SetFirstDate( maCurDate );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
// Sonstige Strings erzeugen
maDayText = XubString( SvtResId( STR_SVT_CALENDAR_DAY ) );
maWeekText = XubString( SvtResId( STR_SVT_CALENDAR_WEEK ) );
// Tagestexte anlegen
- for ( USHORT i = 0; i < 31; i++ )
+ for ( sal_uInt16 i = 0; i < 31; i++ )
mpDayText[i] = new UniString( UniString::CreateFromInt32( i+1 ) );
maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) );
@@ -339,7 +339,7 @@ Calendar::~Calendar()
if ( mpRestoreSelectTable )
delete mpRestoreSelectTable;
- for ( USHORT i = 0; i < 31; i++ )
+ for ( sal_uInt16 i = 0; i < 31; i++ )
delete mpDayText[i];
}
@@ -347,7 +347,7 @@ Calendar::~Calendar()
void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays )
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
maCalendarWrapper.setMinimumNumberOfDaysForFirstWeek( nDays);
}
@@ -355,7 +355,7 @@ void Calendar::SetMinimumNumberOfDaysInWeek( sal_Int16 nDays )
void Calendar::SetWeekStart( sal_Int16 nDay )
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
switch (nDay)
{
case i18n::Weekdays::SUNDAY :
@@ -530,23 +530,23 @@ void Calendar::ImplFormat()
nDay %= 7;
}
- mbCalc = FALSE;
+ mbCalc = sal_False;
}
// Anzahl Tage berechnen
DayOfWeek eStartDay = ImplGetWeekStart();
- USHORT nWeekDay;
+ sal_uInt16 nWeekDay;
Date aTempDate = GetFirstMonth();
maFirstDate = aTempDate;
- nWeekDay = (USHORT)aTempDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- maFirstDate -= (ULONG)nWeekDay;
+ nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ maFirstDate -= (sal_uLong)nWeekDay;
mnDayCount = nWeekDay;
- USHORT nDaysInMonth;
- USHORT nMonthCount = (USHORT)(mnMonthPerLine*mnLines);
- for ( USHORT i = 0; i < nMonthCount; i++ )
+ sal_uInt16 nDaysInMonth;
+ sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines);
+ for ( sal_uInt16 i = 0; i < nMonthCount; i++ )
{
nDaysInMonth = aTempDate.GetDaysInMonth();
mnDayCount += nDaysInMonth;
@@ -556,8 +556,8 @@ void Calendar::ImplFormat()
aTempDate2--;
nDaysInMonth = aTempDate2.GetDaysInMonth();
aTempDate2 -= nDaysInMonth-1;
- nWeekDay = (USHORT)aTempDate2.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ nWeekDay = (sal_uInt16)aTempDate2.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
mnDayCount += 42-nDaysInMonth-nWeekDay;
// Farben festlegen
@@ -575,8 +575,8 @@ void Calendar::ImplFormat()
}
// DateInfo besorgen
- USHORT nNewFirstYear = maFirstDate.GetYear();
- USHORT nNewLastYear = GetLastDate().GetYear();
+ sal_uInt16 nNewFirstYear = maFirstDate.GetYear();
+ sal_uInt16 nNewLastYear = GetLastDate().GetYear();
if ( mnFirstYear )
{
if ( nNewFirstYear < mnFirstYear )
@@ -601,12 +601,12 @@ void Calendar::ImplFormat()
}
mnRequestYear = 0;
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
+sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
{
if ( mbFormat )
return 0;
@@ -620,7 +620,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
long nY;
long nOffX;
long nYMonth;
- USHORT nDay;
+ sal_uInt16 nDay;
DayOfWeek eStartDay = ImplGetWeekStart();
rDate = GetFirstMonth();
@@ -637,7 +637,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) )
return 0;
- USHORT nDaysInMonth = rDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
// Entsprechender Monat gefunden
if ( (rPos.X() > nX) && (rPos.Y() < nYMonth) &&
@@ -651,8 +651,8 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
long nDayY = nY+mnDaysOffY;
if ( rPos.Y() < nDayY )
return 0;
- USHORT nDayIndex = (USHORT)rDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ sal_uInt16 nDayIndex = (sal_uInt16)rDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7;
if ( (i == 0) && (j == 0) )
{
Date aTempDate = rDate;
@@ -693,9 +693,9 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
}
if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
{
- USHORT nWeekDay = (USHORT)rDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ sal_uInt16 nWeekDay = (sal_uInt16)rDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay;
Date aTempDate = rDate;
aTempDate += nDaysInMonth;
for ( nDay = 1; nDay <= nDayCount; nDay++ )
@@ -738,7 +738,7 @@ USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
// -----------------------------------------------------------------------
static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect,
- BOOL bPrev )
+ sal_Bool bPrev )
{
long i;
long n;
@@ -783,7 +783,7 @@ static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect,
// -----------------------------------------------------------------------
-void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
+void Calendar::ImplDrawSpin( sal_Bool bDrawPrev, sal_Bool bDrawNext )
{
if ( !bDrawPrev && !bDrawNext )
return;
@@ -797,7 +797,7 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
aOutRect.Top() += 3;
aOutRect.Right() -= 3;
aOutRect.Bottom() -= 3;
- ImplDrawSpinArrow( this, aOutRect, TRUE );
+ ImplDrawSpinArrow( this, aOutRect, sal_True );
}
if ( bDrawNext )
{
@@ -806,33 +806,33 @@ void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
aOutRect.Top() += 3;
aOutRect.Right() -= 3;
aOutRect.Bottom() -= 3;
- ImplDrawSpinArrow( this, aOutRect, FALSE );
+ ImplDrawSpinArrow( this, aOutRect, sal_False );
}
}
// -----------------------------------------------------------------------
void Calendar::ImplDrawDate( long nX, long nY,
- USHORT nDay, USHORT nMonth, USHORT nYear,
+ sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear,
DayOfWeek eDayOfWeek,
- BOOL bBack, BOOL bOther, ULONG nToday )
+ sal_Bool bBack, sal_Bool bOther, sal_uLong nToday )
{
ImplDateInfo* pDateInfo;
Color* pTextColor = NULL;
const String& rDay = *(mpDayText[nDay-1]);
Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 );
- BOOL bSel = FALSE;
- BOOL bFocus = FALSE;
+ sal_Bool bSel = sal_False;
+ sal_Bool bFocus = sal_False;
// Aktueller Tag
if ( (nDay == maCurDate.GetDay()) &&
(nMonth == maCurDate.GetMonth()) &&
(nYear == maCurDate.GetYear()) )
- bFocus = TRUE;
+ bFocus = sal_True;
if ( mpSelectTable )
{
if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) )
- bSel = TRUE;
+ bSel = sal_True;
}
// Dateinfo ermitteln
@@ -870,11 +870,11 @@ void Calendar::ImplDrawDate( long nX, long nY,
// Font ermitteln
Font aOldFont = GetFont();
- BOOL bBoldFont = FALSE;
+ sal_Bool bBoldFont = sal_False;
if ( (mnWinStyle & WB_BOLDTEXT) &&
pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) )
{
- bBoldFont = TRUE;
+ bBoldFont = sal_True;
Font aFont = aOldFont;
if ( aFont.GetWeight() < WEIGHT_BOLD )
aFont.SetWeight( WEIGHT_BOLD );
@@ -966,7 +966,7 @@ void Calendar::ImplDrawDate( long nX, long nY,
// -----------------------------------------------------------------------
-void Calendar::ImplDraw( BOOL bPaint )
+void Calendar::ImplDraw( sal_Bool bPaint )
{
ImplFormat();
@@ -980,10 +980,10 @@ void Calendar::ImplDraw( BOOL bPaint )
long nDeltaY;
long nDayX;
long nDayY;
- ULONG nToday = Date().GetDate();
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uLong nToday = Date().GetDate();
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
Date aDate = GetFirstMonth();
DayOfWeek eStartDay = ImplGetWeekStart();
@@ -1120,7 +1120,7 @@ void Calendar::ImplDraw( BOOL bPaint )
nDayX -= mnWeekWidth;
nDayY = nY+mnDaysOffY;
maCalendarWrapper.setGregorianDateTime( aDate);
- for ( USHORT nWeekCount = 0; nWeekCount < 6; nWeekCount++ )
+ for ( sal_uInt16 nWeekCount = 0; nWeekCount < 6; nWeekCount++ )
{
sal_Int16 nWeek = maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
String aWeekText( String::CreateFromInt32( nWeek));
@@ -1134,7 +1134,7 @@ void Calendar::ImplDraw( BOOL bPaint )
}
// Tage ausgeben
- USHORT nDaysInMonth = aDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
nDayX = nX+mnDaysOffX;
nDayY = nY+mnDaysOffY;
if ( !bPaint )
@@ -1143,8 +1143,8 @@ void Calendar::ImplDraw( BOOL bPaint )
nDayX+(7*mnDayWidth)-1, nDayY+(6*mnDayHeight)-1 );
Erase( aClearRect );
}
- USHORT nDayIndex = (USHORT)aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ sal_uInt16 nDayIndex = (sal_uInt16)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)eStartDay)) % 7;
if ( (i == 0) && (j == 0) )
{
Date aTempDate = aDate;
@@ -1154,15 +1154,15 @@ void Calendar::ImplDraw( BOOL bPaint )
nDeltaX = nDayX + (nDay*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay+aTempDate.GetDay(),
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDay+(USHORT)eStartDay)%7), FALSE, TRUE, nToday );
+ (DayOfWeek)((nDay+(sal_uInt16)eStartDay)%7), sal_False, sal_True, nToday );
}
}
for ( nDay = 1; nDay <= nDaysInMonth; nDay++ )
{
nDeltaX = nDayX + (nDayIndex*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay, nMonth, nYear,
- (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
- FALSE, FALSE, nToday );
+ (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7),
+ sal_False, sal_False, nToday );
if ( nDayIndex == 6 )
{
nDayIndex = 0;
@@ -1173,9 +1173,9 @@ void Calendar::ImplDraw( BOOL bPaint )
}
if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
{
- USHORT nWeekDay = (USHORT)aDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
- USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ sal_uInt16 nWeekDay = (sal_uInt16)aDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nDayCount = 42-nDaysInMonth-nWeekDay;
Date aTempDate = aDate;
aTempDate += nDaysInMonth;
for ( nDay = 1; nDay <= nDayCount; nDay++ )
@@ -1183,8 +1183,8 @@ void Calendar::ImplDraw( BOOL bPaint )
nDeltaX = nDayX + (nDayIndex*mnDayWidth);
ImplDrawDate( nDeltaX, nDayY, nDay,
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
- FALSE, TRUE, nToday );
+ (DayOfWeek)((nDayIndex+(sal_uInt16)eStartDay)%7),
+ sal_False, sal_True, nToday );
if ( nDayIndex == 6 )
{
nDayIndex = 0;
@@ -1216,10 +1216,10 @@ void Calendar::ImplUpdateDate( const Date& rDate )
Rectangle aDateRect( GetDateRect( rDate ) );
if ( !aDateRect.IsEmpty() )
{
- BOOL bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth());
+ sal_Bool bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth());
ImplDrawDate( aDateRect.Left(), aDateRect.Top(),
rDate.GetDay(), rDate.GetMonth(), rDate.GetYear(),
- rDate.GetDayOfWeek(), TRUE, bOther );
+ rDate.GetDayOfWeek(), sal_True, bOther );
}
}
}
@@ -1230,7 +1230,7 @@ void Calendar::ImplUpdateSelection( Table* pOld )
{
Table* pNew = mpSelectTable;
void* p;
- ULONG nKey;
+ sal_uLong nKey;
p = pOld->First();
while ( p )
@@ -1261,8 +1261,8 @@ void Calendar::ImplUpdateSelection( Table* pOld )
// -----------------------------------------------------------------------
-void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
- BOOL bMove, BOOL bExpand, BOOL bExtended )
+void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
+ sal_Bool bMove, sal_Bool bExpand, sal_Bool bExtended )
{
Table* pOldSel = new Table( *mpSelectTable );
Date aOldDate = maCurDate;
@@ -1298,35 +1298,35 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
{
if ( mbSelLeft )
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False );
}
else
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), sal_False );
}
}
- ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, TRUE );
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, sal_True );
}
else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) )
{
maAnchorDate = aTempDate;
if ( IsDateSelected( aTempDate ) )
{
- mbUnSel = TRUE;
- ImplCalendarSelectDate( mpSelectTable, aTempDate, FALSE );
+ mbUnSel = sal_True;
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_False );
}
else
{
- ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True );
}
}
else
{
maAnchorDate = aTempDate;
ImplCalendarClearSelectDate( mpSelectTable );
- ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, sal_True );
}
mpRestoreSelectTable = new Table( *mpSelectTable );
@@ -1335,9 +1335,9 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
else
{
if ( aTempDate < maCurDate )
- mbSelLeft = TRUE;
+ mbSelLeft = sal_True;
else
- mbSelLeft = FALSE;
+ mbSelLeft = sal_False;
if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
aTempDate = maOldCurDate;
if ( !bMove )
@@ -1345,19 +1345,19 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
if ( aTempDate != maCurDate )
{
maCurDate = aTempDate;
- ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
}
}
- BOOL bNewSel = *pOldSel != *mpSelectTable;
+ sal_Bool bNewSel = *pOldSel != *mpSelectTable;
if ( (maCurDate != aOldDate) || bNewSel )
{
if ( bNewSel )
{
- mbInSelChange = TRUE;
+ mbInSelChange = sal_True;
SelectionChanging();
- mbInSelChange = FALSE;
+ mbInSelChange = sal_False;
}
HideFocus();
if ( bNewSel )
@@ -1373,7 +1373,7 @@ void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
// -----------------------------------------------------------------------
-void Calendar::ImplUpdate( BOOL bCalcNew )
+void Calendar::ImplUpdate( sal_Bool bCalcNew )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
@@ -1383,8 +1383,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew )
{
if ( mbDirect )
{
- mbFormat = TRUE;
- ImplDraw( FALSE );
+ mbFormat = sal_True;
+ ImplDraw( sal_False );
return;
}
else
@@ -1393,8 +1393,8 @@ void Calendar::ImplUpdate( BOOL bCalcNew )
}
if ( bCalcNew )
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
@@ -1409,7 +1409,7 @@ void Calendar::ImplInvertDropPos()
// -----------------------------------------------------------------------
-void Calendar::ImplScroll( BOOL bPrev )
+void Calendar::ImplScroll( sal_Bool bPrev )
{
Date aNewFirstMonth = GetFirstMonth();
if ( bPrev )
@@ -1419,9 +1419,9 @@ void Calendar::ImplScroll( BOOL bPrev )
}
else
aNewFirstMonth += aNewFirstMonth.GetDaysInMonth();
- mbDirect = TRUE;
+ mbDirect = sal_True;
SetFirstDate( aNewFirstMonth );
- mbDirect = FALSE;
+ mbDirect = sal_False;
}
// -----------------------------------------------------------------------
@@ -1433,12 +1433,12 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
Date aOldFirstDate = GetFirstMonth();
PopupMenu aPopupMenu;
PopupMenu* pYearPopupMenus[MENU_YEAR_COUNT];
- USHORT nMonthOff;
- USHORT nCurItemId;
- USHORT nYear = rDate.GetYear()-1;
- USHORT i;
- USHORT j;
- USHORT nYearIdCount = 1000;
+ sal_uInt16 nMonthOff;
+ sal_uInt16 nCurItemId;
+ sal_uInt16 nYear = rDate.GetYear()-1;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nYearIdCount = 1000;
nMonthOff = (rDate.GetYear()-aOldFirstDate.GetYear())*12;
if ( aOldFirstDate.GetMonth() < rDate.GetMonth() )
@@ -1459,9 +1459,9 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
nYearIdCount += 1000;
}
- mbMenuDown = TRUE;
+ mbMenuDown = sal_True;
nCurItemId = aPopupMenu.Execute( this, rPos );
- mbMenuDown = FALSE;
+ mbMenuDown = sal_False;
// Menu zerstoeren
aPopupMenu.SetPopupMenu( 2, NULL );
@@ -1473,10 +1473,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
if ( nCurItemId )
{
- USHORT nTempMonthOff = nMonthOff % 12;
- USHORT nTempYearOff = nMonthOff / 12;
- USHORT nNewMonth = nCurItemId % 1000;
- USHORT nNewYear = nYear+((nCurItemId-1000)/1000);
+ sal_uInt16 nTempMonthOff = nMonthOff % 12;
+ sal_uInt16 nTempYearOff = nMonthOff / 12;
+ sal_uInt16 nNewMonth = nCurItemId % 1000;
+ sal_uInt16 nNewYear = nYear+((nCurItemId-1000)/1000);
if ( nTempMonthOff < nNewMonth )
nNewMonth = nNewMonth - nTempMonthOff;
else
@@ -1491,10 +1491,10 @@ void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
// -----------------------------------------------------------------------
-void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat )
+void Calendar::ImplTracking( const Point& rPos, sal_Bool bRepeat )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rPos, aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rPos, aTempDate );
if ( mbSpinDown )
{
@@ -1503,29 +1503,29 @@ void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat )
if ( bRepeat && (mbPrevIn || mbNextIn) )
{
- mbScrollDateRange = TRUE;
+ mbScrollDateRange = sal_True;
ImplScroll( mbPrevIn );
- mbScrollDateRange = FALSE;
+ mbScrollDateRange = sal_False;
}
}
else
- ImplMouseSelect( aTempDate, nHitTest, TRUE, FALSE, FALSE );
+ ImplMouseSelect( aTempDate, nHitTest, sal_True, sal_False, sal_False );
}
// -----------------------------------------------------------------------
-void Calendar::ImplEndTracking( BOOL bCancel )
+void Calendar::ImplEndTracking( sal_Bool bCancel )
{
- BOOL bSelection = mbSelection;
- BOOL bSpinDown = mbSpinDown;
+ sal_Bool bSelection = mbSelection;
+ sal_Bool bSpinDown = mbSpinDown;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbUnSel = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbUnSel = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
if ( bCancel )
{
@@ -1554,15 +1554,15 @@ void Calendar::ImplEndTracking( BOOL bCancel )
if ( !bCancel )
{
// Feststellen, ob wir sichtbaren Bereich scrollen sollen
- ULONG nSelCount = mpSelectTable->Count();
+ sal_uLong nSelCount = mpSelectTable->Count();
if ( nSelCount )
{
Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) );
Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) );
if ( aLastSelDate < GetFirstMonth() )
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
else if ( GetLastMonth() < aFirstSelDate )
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
}
}
@@ -1584,13 +1584,13 @@ void Calendar::ImplEndTracking( BOOL bCancel )
IMPL_STATIC_LINK( Calendar, ScrollHdl, Timer*, EMPTYARG )
{
- BOOL bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0;
- BOOL bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0;
+ sal_Bool bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0;
+ sal_Bool bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0;
if( bNextIn || bPrevIn )
{
- pThis->mbScrollDateRange = TRUE;
+ pThis->mbScrollDateRange = sal_True;
pThis->ImplScroll( bPrevIn );
- pThis->mbScrollDateRange = FALSE;
+ pThis->mbScrollDateRange = sal_False;
}
return 0;
}
@@ -1602,7 +1602,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && !mbMenuDown )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate );
if ( nHitTest )
{
if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
@@ -1615,10 +1615,10 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0;
if ( mbPrevIn || mbNextIn )
{
- mbSpinDown = TRUE;
- mbScrollDateRange = TRUE;
+ mbSpinDown = sal_True;
+ mbScrollDateRange = sal_True;
ImplScroll( mbPrevIn );
- mbScrollDateRange = FALSE;
+ mbScrollDateRange = sal_False;
// Hier muss BUTTONREPEAT stehen, also nicht wieder
// auf SCROLLREPEAT aendern, sondern mit TH abklaeren,
// warum es evtl. anders sein sollte (71775)
@@ -1637,16 +1637,16 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
if ( !mbSelection )
{
- mbDrag = TRUE;
+ mbDrag = sal_True;
StartTracking();
}
mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0;
if ( (nHitTest & CALENDAR_HITTEST_DAY) && mbMultiSelection )
- mbWeekSel = TRUE;
+ mbWeekSel = sal_True;
else
- mbWeekSel = FALSE;
- ImplMouseSelect( aTempDate, nHitTest, FALSE, rMEvt.IsShift(), rMEvt.IsMod1() );
+ mbWeekSel = sal_False;
+ ImplMouseSelect( aTempDate, nHitTest, sal_False, rMEvt.IsShift(), rMEvt.IsMod1() );
}
}
}
@@ -1663,7 +1663,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
void Calendar::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() && mbSelection )
- ImplEndTracking( FALSE );
+ ImplEndTracking( sal_False );
else
Control::MouseButtonUp( rMEvt );
}
@@ -1673,7 +1673,7 @@ void Calendar::MouseButtonUp( const MouseEvent& rMEvt )
void Calendar::MouseMove( const MouseEvent& rMEvt )
{
if ( mbSelection && rMEvt.GetButtons() )
- ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplTracking( rMEvt.GetPosPixel(), sal_False );
else
Control::MouseMove( rMEvt );
}
@@ -1695,9 +1695,9 @@ void Calendar::Tracking( const TrackingEvent& rTEvt )
void Calendar::KeyInput( const KeyEvent& rKEvt )
{
Date aNewDate = maCurDate;
- BOOL bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
- BOOL bExpand = rKEvt.GetKeyCode().IsShift();
- BOOL bExtended = rKEvt.GetKeyCode().IsMod1();
+ sal_Bool bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
+ sal_Bool bExpand = rKEvt.GetKeyCode().IsShift();
+ sal_Bool bExtended = rKEvt.GetKeyCode().IsMod1();
switch ( rKEvt.GetKeyCode().GetCode() )
{
@@ -1742,13 +1742,13 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
{
if ( !bExpand )
{
- BOOL bDateSel = IsDateSelected( maCurDate );
+ sal_Bool bDateSel = IsDateSelected( maCurDate );
SelectDate( maCurDate, !bDateSel );
- mbSelLeft = FALSE;
+ mbSelLeft = sal_False;
SelectionChanging();
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
Select();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
else
@@ -1771,23 +1771,23 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
{
if ( mbSelLeft )
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), sal_False );
}
else
{
- ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
- ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, sal_False );
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), sal_False );
}
}
- ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, TRUE );
- mbDirect = TRUE;
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, sal_True );
+ mbDirect = sal_True;
SetCurDate( aNewDate );
- mbDirect = FALSE;
+ mbDirect = sal_False;
maAnchorDate = aOldAnchorDate;
- mbInSelChange = TRUE;
+ mbInSelChange = sal_True;
SelectionChanging();
- mbInSelChange = FALSE;
+ mbInSelChange = sal_False;
ImplUpdateSelection( pOldSel );
delete pOldSel;
}
@@ -1796,15 +1796,15 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
if ( mnWinStyle & WB_RANGESELECT )
{
SetNoSelection();
- SelectDate( aNewDate, TRUE );
+ SelectDate( aNewDate, sal_True );
}
- mbDirect = TRUE;
+ mbDirect = sal_True;
SetCurDate( aNewDate );
- mbDirect = FALSE;
+ mbDirect = sal_False;
}
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
Select();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -1812,7 +1812,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
void Calendar::Paint( const Rectangle& )
{
- ImplDraw( TRUE );
+ ImplDraw( sal_True );
}
// -----------------------------------------------------------------------
@@ -1835,7 +1835,7 @@ void Calendar::LoseFocus()
void Calendar::Resize()
{
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
Control::Resize();
}
@@ -1881,8 +1881,8 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
maCalendarWrapper.setGregorianDateTime( aDate);
- USHORT nWeek = (USHORT) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
- USHORT nMonth = aDate.GetMonth();
+ sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
+ sal_uInt16 nMonth = aDate.GetMonth();
XubString aStr( maDayText );
aStr.AppendAscii( ": " );
aStr.Append( XubString::CreateFromInt32( aDate.GetDayOfYear() ) );
@@ -1919,7 +1919,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
if ( !mbSelection && rCEvt.IsMouseEvent() )
{
Date aTempDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate );
+ sal_uInt16 nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate );
if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
{
ImplShowMenu( rCEvt.GetMousePosPixel(), aTempDate );
@@ -1937,7 +1937,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
{
while ( nNotchDelta < 0 )
{
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
nNotchDelta++;
}
}
@@ -1945,7 +1945,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
{
while ( nNotchDelta > 0 )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
nNotchDelta--;
}
}
@@ -2020,7 +2020,7 @@ void Calendar::Select()
// -----------------------------------------------------------------------
-void Calendar::SelectDate( const Date& rDate, BOOL bSelect )
+void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect )
{
if ( !rDate.IsValid() )
return;
@@ -2044,7 +2044,7 @@ void Calendar::SelectDate( const Date& rDate, BOOL bSelect )
// -----------------------------------------------------------------------
void Calendar::SelectDateRange( const Date& rStartDate, const Date& rEndDate,
- BOOL bSelect )
+ sal_Bool bSelect )
{
if ( !rStartDate.IsValid() || !rEndDate.IsValid() )
return;
@@ -2087,21 +2087,21 @@ void Calendar::SetNoSelection()
// -----------------------------------------------------------------------
-BOOL Calendar::IsDateSelected( const Date& rDate ) const
+sal_Bool Calendar::IsDateSelected( const Date& rDate ) const
{
return mpSelectTable->IsKeyValid( rDate.GetDate() );
}
// -----------------------------------------------------------------------
-ULONG Calendar::GetSelectDateCount() const
+sal_uLong Calendar::GetSelectDateCount() const
{
return mpSelectTable->Count();
}
// -----------------------------------------------------------------------
-Date Calendar::GetSelectDate( ULONG nIndex ) const
+Date Calendar::GetSelectDate( sal_uLong nIndex ) const
{
if ( nIndex < mpSelectTable->Count() )
return Date( mpSelectTable->GetObjectKey( nIndex ) );
@@ -2121,18 +2121,18 @@ void Calendar::SetCurDate( const Date& rNewDate )
if ( maCurDate != rNewDate )
{
- BOOL bUpdate = IsVisible() && IsUpdateMode();
+ sal_Bool bUpdate = IsVisible() && IsUpdateMode();
Date aOldDate = maCurDate;
maCurDate = rNewDate;
maAnchorDate = maCurDate;
if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) )
{
- ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
- ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, sal_False );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, sal_True );
}
else if ( !HasFocus() )
- bUpdate = FALSE;
+ bUpdate = sal_False;
// Aktuelles Datum noch in den sichtbaren Bereich verschieben
if ( mbFormat || (maCurDate < GetFirstMonth()) )
@@ -2177,7 +2177,7 @@ void Calendar::SetFirstDate( const Date& rNewFirstDate )
if ( maFirstDate != rNewFirstDate )
{
maFirstDate = Date( 1, rNewFirstDate.GetMonth(), rNewFirstDate.GetYear() );
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
ImplUpdate();
}
}
@@ -2202,8 +2202,8 @@ Date Calendar::GetFirstMonth() const
Date Calendar::GetLastMonth() const
{
Date aDate = GetFirstMonth();
- USHORT nMonthCount = GetMonthCount();
- for ( USHORT i = 0; i < nMonthCount; i++ )
+ sal_uInt16 nMonthCount = GetMonthCount();
+ for ( sal_uInt16 i = 0; i < nMonthCount; i++ )
aDate += aDate.GetDaysInMonth();
aDate--;
return aDate;
@@ -2211,39 +2211,39 @@ Date Calendar::GetLastMonth() const
// -----------------------------------------------------------------------
-USHORT Calendar::GetMonthCount() const
+sal_uInt16 Calendar::GetMonthCount() const
{
if ( mbFormat )
return 1;
else
- return (USHORT)(mnMonthPerLine*mnLines);
+ return (sal_uInt16)(mnMonthPerLine*mnLines);
}
// -----------------------------------------------------------------------
-BOOL Calendar::GetDropDate( Date& rDate ) const
+sal_Bool Calendar::GetDropDate( Date& rDate ) const
{
if( mbDropPos )
{
rDate = maDropDate;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Calendar::GetDate( const Point& rPos, Date& rDate ) const
+sal_Bool Calendar::GetDate( const Point& rPos, Date& rDate ) const
{
Date aDate = maCurDate;
- USHORT nHitTest = ImplHitTest( rPos, aDate );
+ sal_uInt16 nHitTest = ImplHitTest( rPos, aDate );
if ( nHitTest & CALENDAR_HITTEST_DAY )
{
rDate = aDate;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2257,8 +2257,8 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
long nX;
long nY;
- ULONG nDaysOff;
- USHORT nDayIndex;
+ sal_uLong nDaysOff;
+ sal_uInt16 nDayIndex;
Date aDate = GetFirstMonth();
if ( rDate < aDate )
@@ -2275,13 +2275,13 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
Date aLastDate = GetLastMonth();
if ( rDate > aLastDate )
{
- USHORT nWeekDay = (USHORT)aLastDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(USHORT)ImplGetWeekStart())) % 7;
+ sal_uInt16 nWeekDay = (sal_uInt16)aLastDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(sal_uInt16)ImplGetWeekStart())) % 7;
aLastDate -= nWeekDay;
aRect = GetDateRect( aLastDate );
nDaysOff = rDate-aLastDate;
nDayIndex = 0;
- for ( USHORT i = 0; i <= nDaysOff; i++ )
+ for ( sal_uInt16 i = 0; i <= nDaysOff; i++ )
{
if ( aLastDate == rDate )
{
@@ -2308,7 +2308,7 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
nX = 0;
for ( long j = 0; j < mnMonthPerLine; j++ )
{
- USHORT nDaysInMonth = aDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
// Monat gerufen
if ( (aDate.GetMonth() == rDate.GetMonth()) &&
@@ -2316,9 +2316,9 @@ Rectangle Calendar::GetDateRect( const Date& rDate ) const
{
long nDayX = nX+mnDaysOffX;
long nDayY = nY+mnDaysOffY;
- nDayIndex = (USHORT)aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(USHORT)ImplGetWeekStart())) % 7;
- for ( USHORT nDay = 1; nDay <= nDaysInMonth; nDay++ )
+ nDayIndex = (sal_uInt16)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(sal_uInt16)ImplGetWeekStart())) % 7;
+ for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ )
{
if ( nDay == rDate.GetDay() )
{
@@ -2385,13 +2385,13 @@ void Calendar::SetSundayColor( const Color& rColor )
void Calendar::AddDateInfo( const Date& rDate, const String& rText,
const Color* pTextColor, const Color* pFrameColor,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if ( !mpDateTable )
mpDateTable = new ImplDateTable( 256, 256 );
- BOOL bChanged = FALSE;
- ULONG nKey = rDate.GetDate();
+ sal_Bool bChanged = sal_False;
+ sal_uLong nKey = rDate.GetDate();
ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
if ( pDateInfo )
pDateInfo->maText = rText;
@@ -2407,13 +2407,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
if ( *(pDateInfo->mpTextColor) != *pTextColor )
{
*(pDateInfo->mpTextColor) = *pTextColor;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
{
pDateInfo->mpTextColor = new Color( *pTextColor );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
@@ -2422,7 +2422,7 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
{
delete pDateInfo->mpTextColor;
pDateInfo->mpTextColor = NULL;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
if ( pFrameColor )
@@ -2432,13 +2432,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
if ( *(pDateInfo->mpFrameColor) != *pFrameColor )
{
*(pDateInfo->mpFrameColor) = *pFrameColor;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
{
pDateInfo->mpFrameColor = new Color( *pFrameColor );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
else
@@ -2447,13 +2447,13 @@ void Calendar::AddDateInfo( const Date& rDate, const String& rText,
{
delete pDateInfo->mpFrameColor;
pDateInfo->mpFrameColor = NULL;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
if ( pDateInfo->mnFlags != nFlags )
{
pDateInfo->mnFlags = nFlags;
- bChanged = TRUE;
+ bChanged = sal_True;
}
if ( bChanged )
@@ -2484,7 +2484,7 @@ void Calendar::ClearDateInfo()
ImplDateInfo* pDateInfo = mpDateTable->First();
while ( pDateInfo )
{
- ULONG nKey = mpDateTable->GetCurKey();
+ sal_uLong nKey = mpDateTable->GetCurKey();
mpDateTable->Remove( nKey );
Date aDate( nKey );
ImplUpdateDate( aDate );
@@ -2503,7 +2503,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate )
XubString aRet;
if ( mpDateTable )
{
- ULONG nKey = rDate.GetDate();
+ sal_uLong nKey = rDate.GetDate();
ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
if ( pDateInfo )
aRet = pDateInfo->maText;
@@ -2513,7 +2513,7 @@ XubString Calendar::GetDateInfoText( const Date& rDate )
// -----------------------------------------------------------------------
-BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
+sal_Bool Calendar::ShowDropPos( const Point& rPos, Date& rDate )
{
Date aTempDate = maCurDate;
mnDragScrollHitTest = ImplHitTest( rPos, aTempDate );
@@ -2535,12 +2535,12 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
if( mbDropPos )
ImplInvertDropPos();
maDropDate = aTempDate;
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
ImplInvertDropPos();
}
rDate = maDropDate;
- return TRUE;
+ return sal_True;
}
}
}
@@ -2548,7 +2548,7 @@ BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
maDragScrollTimer.Stop();
HideDropPos();
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2558,7 +2558,7 @@ void Calendar::HideDropPos()
if ( mbDropPos )
{
ImplInvertDropPos();
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
}
}
@@ -2571,7 +2571,7 @@ void Calendar::StartSelection()
maOldCurDate = maCurDate;
mpOldSelectTable = new Table( *mpSelectTable );
- mbSelection = TRUE;
+ mbSelection = sal_True;
}
// -----------------------------------------------------------------------
@@ -2583,12 +2583,12 @@ void Calendar::EndSelection()
if ( !mbSelection )
ReleaseMouse();
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbMultiSelection = FALSE;
- mbSpinDown = FALSE;
- mbPrevIn = FALSE;
- mbNextIn = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbMultiSelection = sal_False;
+ mbSpinDown = sal_False;
+ mbPrevIn = sal_False;
+ mbNextIn = sal_False;
}
}
@@ -2669,8 +2669,8 @@ public:
void SetCalendar( Calendar* pCalendar )
{ mpCalendar = pCalendar; }
- PushButton* EnableTodayBtn( BOOL bEnable );
- PushButton* EnableNoneBtn( BOOL bEnable );
+ PushButton* EnableTodayBtn( sal_Bool bEnable );
+ PushButton* EnableNoneBtn( sal_Bool bEnable );
void ArrangeButtons();
long Notify( NotifyEvent& rNEvt );
@@ -2698,7 +2698,7 @@ ImplCFieldFloatWin::~ImplCFieldFloatWin()
// -----------------------------------------------------------------------
-PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable )
+PushButton* ImplCFieldFloatWin::EnableTodayBtn( sal_Bool bEnable )
{
if ( bEnable )
{
@@ -2730,7 +2730,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable )
// -----------------------------------------------------------------------
-PushButton* ImplCFieldFloatWin::EnableNoneBtn( BOOL bEnable )
+PushButton* ImplCFieldFloatWin::EnableNoneBtn( sal_Bool bEnable )
{
if ( bEnable )
{
@@ -2849,8 +2849,8 @@ CalendarField::CalendarField( Window* pParent, WinBits nWinStyle ) :
mpFloatWin = NULL;
mpCalendar = NULL;
mnCalendarStyle = 0;
- mbToday = FALSE;
- mbNone = FALSE;
+ mbToday = sal_False;
+ mbNone = sal_False;
}
// -----------------------------------------------------------------------
@@ -2862,8 +2862,8 @@ CalendarField::CalendarField( Window* pParent, const ResId& rResId ) :
mpFloatWin = NULL;
mpCalendar = NULL;
mnCalendarStyle = 0;
- mbToday = FALSE;
- mbNone = FALSE;
+ mbToday = sal_False;
+ mbNone = sal_False;
}
// -----------------------------------------------------------------------
@@ -2949,7 +2949,7 @@ void CalendarField::Select()
// -----------------------------------------------------------------------
-BOOL CalendarField::ShowDropDown( BOOL bShow )
+sal_Bool CalendarField::ShowDropDown( sal_Bool bShow )
{
if ( bShow )
{
@@ -2994,7 +2994,7 @@ BOOL CalendarField::ShowDropDown( BOOL bShow )
mpCalendar->EndSelection();
EndDropDown();
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx
index 20b7865db569..7be2700b45c1 100644
--- a/svtools/source/control/collatorres.cxx
+++ b/svtools/source/control/collatorres.cxx
@@ -31,9 +31,7 @@
#include "precompiled_svtools.hxx"
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-
-
-#include <collatorres.hxx>
+#include <svtools/collatorres.hxx>
// -------------------------------------------------------------------------
//
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 2699af857710..431b9c0122ab 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -39,9 +39,9 @@
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-#include <ctrlbox.hxx>
-#include <ctrltool.hxx>
-#include <borderhelper.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svtools/borderhelper.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/fontcapabilities.hxx>
@@ -66,10 +66,10 @@ using namespace ::com::sun::star;
struct ImplColorListData
{
Color aColor;
- BOOL bColor;
+ sal_Bool bColor;
- ImplColorListData() : aColor( COL_BLACK ) { bColor = FALSE; }
- ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = TRUE; }
+ ImplColorListData() : aColor( COL_BLACK ) { bColor = sal_False; }
+ ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = sal_True; }
};
// -----------------------------------------------------------------------
@@ -81,7 +81,7 @@ void ColorListBox::ImplInit()
aImageSize.Height() = GetTextHeight();
aImageSize.Height() -= 2;
- EnableUserDraw( TRUE );
+ EnableUserDraw( sal_True );
SetUserItemSize( aImageSize );
}
@@ -120,7 +120,7 @@ ColorListBox::~ColorListBox()
// -----------------------------------------------------------------------
-USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ColorListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR )
@@ -143,8 +143,8 @@ USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos )
// -----------------------------------------------------------------------
-USHORT ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr,
- USHORT nPos )
+sal_uInt16 ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr,
+ sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR )
@@ -175,7 +175,7 @@ void ColorListBox::InsertAutomaticEntry()
// -----------------------------------------------------------------------
-void ColorListBox::RemoveEntry( USHORT nPos )
+void ColorListBox::RemoveEntry( sal_uInt16 nPos )
{
ListBox::RemoveEntry( nPos );
if ( nPos < pColorList->size() )
@@ -207,7 +207,7 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox )
for ( size_t n = 0; n < nCount; n++ )
{
ImplColorListData* pData = (*rBox.pColorList)[ n ];
- USHORT nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND );
+ sal_uInt16 nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND );
if ( nPos != LISTBOX_ERROR )
{
if ( nPos < pColorList->size() )
@@ -226,9 +226,9 @@ void ColorListBox::CopyEntries( const ColorListBox& rBox )
// -----------------------------------------------------------------------
-USHORT ColorListBox::GetEntryPos( const Color& rColor ) const
+sal_uInt16 ColorListBox::GetEntryPos( const Color& rColor ) const
{
- for( USHORT n = (USHORT) pColorList->size(); n; )
+ for( sal_uInt16 n = (sal_uInt16) pColorList->size(); n; )
{
ImplColorListData* pData = (*pColorList)[ --n ];
if ( pData->bColor && ( pData->aColor == rColor ) )
@@ -239,7 +239,7 @@ USHORT ColorListBox::GetEntryPos( const Color& rColor ) const
// -----------------------------------------------------------------------
-Color ColorListBox::GetEntryColor( USHORT nPos ) const
+Color ColorListBox::GetEntryColor( sal_uInt16 nPos ) const
{
Color aColor;
ImplColorListData* pData = ( nPos < pColorList->size() ) ? (*pColorList)[ nPos ] : NULL;
@@ -266,13 +266,13 @@ void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt )
rUDEvt.GetDevice()->SetLineColor( rUDEvt.GetDevice()->GetTextColor() );
rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) );
rUDEvt.GetDevice()->Pop();
- ListBox::DrawEntry( rUDEvt, FALSE, TRUE, FALSE );
+ ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_False );
}
else
- ListBox::DrawEntry( rUDEvt, FALSE, TRUE, TRUE );
+ ListBox::DrawEntry( rUDEvt, sal_False, sal_True, sal_True );
}
else
- ListBox::DrawEntry( rUDEvt, TRUE, TRUE, FALSE );
+ ListBox::DrawEntry( rUDEvt, sal_True, sal_True, sal_False );
}
// =======================================================================
@@ -288,7 +288,7 @@ struct ImpLineListData
long nLine1;
long nLine2;
long nDistance;
- USHORT nStyle;
+ sal_uInt16 nStyle;
};
// -----------------------------------------------------------------------
@@ -301,9 +301,9 @@ inline const Color& LineListBox::GetPaintColor( void ) const
// -----------------------------------------------------------------------
-inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, USHORT nDashing )
+inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, long nWidth, sal_uInt16 nDashing )
{
- USHORT nOldAA = rDev.GetAntialiasing();
+ sal_uInt16 nOldAA = rDev.GetAntialiasing();
rDev.SetAntialiasing( nOldAA & !ANTIALIASING_ENABLE_B2DDRAW );
Color aOldColor = rDev.GetFillColor( );
@@ -337,7 +337,7 @@ inline void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPoly
namespace svtools
{
- basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, USHORT nDashing, MapUnit eUnit )
+ basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, MapUnit eUnit )
{
::std::vector < double >aPattern;
switch ( nDashing )
@@ -390,7 +390,7 @@ namespace svtools
}
void DrawLine( OutputDevice& rDev, const Point& rP1, const Point& rP2,
- sal_uInt32 nWidth, USHORT nDashing )
+ sal_uInt32 nWidth, sal_uInt16 nDashing )
{
basegfx::B2DPolygon aPolygon;
aPolygon.append( basegfx::B2DPoint( rP1.X(), rP1.Y() ) );
@@ -400,7 +400,7 @@ namespace svtools
}
void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
- USHORT nStyle, Bitmap& rBmp, XubString& rStr )
+ sal_uInt16 nStyle, Bitmap& rBmp, XubString& rStr )
{
Size aSize = GetOutputSizePixel();
aSize.Width() -= 20;
@@ -539,7 +539,7 @@ LineListBox::~LineListBox()
// -----------------------------------------------------------------------
-USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 LineListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
nPos = ListBox::InsertEntry( rStr, nPos );
if ( nPos != LISTBOX_ERROR ) {
@@ -556,8 +556,8 @@ USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos )
// -----------------------------------------------------------------------
-USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
- USHORT nStyle, USHORT nPos )
+sal_uInt16 LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
+ sal_uInt16 nStyle, sal_uInt16 nPos )
{
XubString aStr;
Bitmap aBmp;
@@ -584,7 +584,7 @@ USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
// -----------------------------------------------------------------------
-void LineListBox::RemoveEntry( USHORT nPos )
+void LineListBox::RemoveEntry( sal_uInt16 nPos )
{
ListBox::RemoveEntry( nPos );
@@ -612,8 +612,8 @@ void LineListBox::Clear()
// -----------------------------------------------------------------------
-USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
- long nDistance, USHORT nStyle ) const
+sal_uInt16 LineListBox::GetEntryPos( long nLine1, long nLine2,
+ long nDistance, sal_uInt16 nStyle ) const
{
for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) {
ImpLineListData* pData = (*pLineList)[ i ];
@@ -624,7 +624,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
&& (pData->nDistance == nDistance)
&& (pData->nStyle == nStyle)
) {
- return (USHORT)i;
+ return (sal_uInt16)i;
}
}
}
@@ -633,7 +633,7 @@ USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
// -----------------------------------------------------------------------
-long LineListBox::GetEntryLine1( USHORT nPos ) const
+long LineListBox::GetEntryLine1( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nLine1 : 0;
@@ -641,7 +641,7 @@ long LineListBox::GetEntryLine1( USHORT nPos ) const
// -----------------------------------------------------------------------
-long LineListBox::GetEntryLine2( USHORT nPos ) const
+long LineListBox::GetEntryLine2( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nLine2 : 0;
@@ -649,7 +649,7 @@ long LineListBox::GetEntryLine2( USHORT nPos ) const
// -----------------------------------------------------------------------
-long LineListBox::GetEntryDistance( USHORT nPos ) const
+long LineListBox::GetEntryDistance( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nDistance : 0;
@@ -657,7 +657,7 @@ long LineListBox::GetEntryDistance( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT LineListBox::GetEntryStyle( USHORT nPos ) const
+sal_uInt16 LineListBox::GetEntryStyle( sal_uInt16 nPos ) const
{
ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
return ( pData ) ? pData->nStyle : STYLE_SOLID;
@@ -677,35 +677,34 @@ void LineListBox::UpdateLineColors( void )
Bitmap aBmp;
// exchange entries which containing lines
- SetUpdateMode( FALSE );
+ SetUpdateMode( sal_False );
- USHORT nSelEntry = GetSelectEntryPos();
+ sal_uInt16 nSelEntry = GetSelectEntryPos();
for( size_t n = 0 ; n < nCount ; ++n )
{
ImpLineListData* pData = (*pLineList)[ n ];
if( pData )
{
// exchange listbox data
- ListBox::RemoveEntry( USHORT( n ) );
+ ListBox::RemoveEntry( sal_uInt16( n ) );
ImpGetLine( pData->nLine1, pData->nLine2, pData->nDistance,
pData->nStyle, aBmp, aStr );
- ListBox::InsertEntry( aStr, aBmp, USHORT( n ) );
}
}
if( nSelEntry != LISTBOX_ENTRY_NOTFOUND )
SelectEntryPos( nSelEntry );
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
Invalidate();
}
}
// -----------------------------------------------------------------------
-BOOL LineListBox::UpdatePaintLineColor( void )
+sal_Bool LineListBox::UpdatePaintLineColor( void )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Color aNewCol( rSettings.GetWindowColor().IsDark()? rSettings.GetLabelTextColor() : aColor );
@@ -734,10 +733,10 @@ void LineListBox::DataChanged( const DataChangedEvent& rDCEvt )
struct ImplFontNameListData
{
FontInfo maInfo;
- USHORT mnType;
+ sal_uInt16 mnType;
ImplFontNameListData( const FontInfo& rInfo,
- USHORT nType ) :
+ sal_uInt16 nType ) :
maInfo( rInfo ),
mnType( nType )
{}
@@ -750,8 +749,8 @@ FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = FALSE;
- mbSymbols = FALSE;
+ mbWYSIWYG = sal_False;
+ mbSymbols = sal_False;
}
// -------------------------------------------------------------------
@@ -761,8 +760,8 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
{
InitBitmaps();
mpFontList = NULL;
- mbWYSIWYG = FALSE;
- mbSymbols = FALSE;
+ mbWYSIWYG = sal_False;
+ mbSymbols = sal_False;
}
// -------------------------------------------------------------------
@@ -817,14 +816,14 @@ void FontNameBox::Fill( const FontList* pList )
mpFontList = new ImplFontList;
// insert fonts
- USHORT nFontCount = pList->GetFontNameCount();
- for ( USHORT i = 0; i < nFontCount; i++ )
+ sal_uInt16 nFontCount = pList->GetFontNameCount();
+ for ( sal_uInt16 i = 0; i < nFontCount; i++ )
{
const FontInfo& rFontInfo = pList->GetFontName( i );
- ULONG nIndex = InsertEntry( rFontInfo.GetName() );
+ sal_uLong nIndex = InsertEntry( rFontInfo.GetName() );
if ( nIndex != LISTBOX_ERROR )
{
- USHORT nType = pList->GetFontNameType( i );
+ sal_uInt16 nType = pList->GetFontNameType( i );
ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType );
if ( nIndex < mpFontList->size() ) {
ImplFontList::iterator it = mpFontList->begin();
@@ -845,7 +844,7 @@ void FontNameBox::Fill( const FontList* pList )
// -------------------------------------------------------------------
-void FontNameBox::EnableWYSIWYG( BOOL bEnable )
+void FontNameBox::EnableWYSIWYG( sal_Bool bEnable )
{
if ( bEnable != mbWYSIWYG )
{
@@ -857,7 +856,7 @@ void FontNameBox::EnableWYSIWYG( BOOL bEnable )
// -------------------------------------------------------------------
-void FontNameBox::EnableSymbols( BOOL bEnable )
+void FontNameBox::EnableSymbols( sal_Bool bEnable )
{
if ( bEnable != mbSymbols )
{
@@ -1738,7 +1737,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
{
ImplFontNameListData* pData = (*mpFontList)[ rUDEvt.GetItemId() ];
const FontInfo& rInfo = pData->maInfo;
- USHORT nType = pData->mnType;
+ sal_uInt16 nType = pData->mnType;
Point aTopLeft = rUDEvt.GetRect().TopLeft();
long nX = aTopLeft.X();
long nH = rUDEvt.GetRect().GetHeight();
@@ -1976,11 +1975,11 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
}
rUDEvt.GetDevice()->SetFont( aOldFont );
- DrawEntry( rUDEvt, FALSE, FALSE); // draw seperator
+ DrawEntry( rUDEvt, sal_False, sal_False); // draw seperator
}
else
{
- DrawEntry( rUDEvt, TRUE, TRUE );
+ DrawEntry( rUDEvt, sal_True, sal_True );
}
}
@@ -2032,12 +2031,12 @@ void FontStyleBox::Modify()
CharClass aChrCls( ::comphelper::getProcessServiceFactory(),
GetSettings().GetLocale() );
XubString aStr = GetText();
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nEntryCount = GetEntryCount();
if ( GetEntryPos( aStr ) == COMBOBOX_ENTRY_NOTFOUND )
{
aChrCls.toUpper( aStr );
- for ( USHORT i = 0; i < nEntryCount; i++ )
+ for ( sal_uInt16 i = 0; i < nEntryCount; i++ )
{
XubString aEntryText = GetEntry( i );
aChrCls.toUpper( aEntryText );
@@ -2061,7 +2060,7 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
// else aLastStyle will overwritten
// store prior selection position and clear box
XubString aOldText = GetText();
- USHORT nPos = GetEntryPos( aOldText );
+ sal_uInt16 nPos = GetEntryPos( aOldText );
Clear();
// does a font with this name already exist?
@@ -2072,11 +2071,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
FontWeight eLastWeight = WEIGHT_DONTKNOW;
FontItalic eLastItalic = ITALIC_NONE;
FontWidth eLastWidth = WIDTH_DONTKNOW;
- BOOL bNormal = FALSE;
- BOOL bItalic = FALSE;
- BOOL bBold = FALSE;
- BOOL bBoldItalic = FALSE;
- BOOL bInsert = FALSE;
+ sal_Bool bNormal = sal_False;
+ sal_Bool bItalic = sal_False;
+ sal_Bool bBold = sal_False;
+ sal_Bool bBoldItalic = sal_False;
+ sal_Bool bInsert = sal_False;
FontInfo aInfo;
while ( hFontInfo )
{
@@ -2096,16 +2095,16 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
if ( eWeight <= WEIGHT_NORMAL )
{
if ( eItalic != ITALIC_NONE )
- bItalic = TRUE;
+ bItalic = sal_True;
else
- bNormal = TRUE;
+ bNormal = sal_True;
}
else
{
if ( eItalic != ITALIC_NONE )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
else
- bBold = TRUE;
+ bBold = sal_True;
}
// For wrong StyleNames we replace this with the correct once
@@ -2139,11 +2138,11 @@ void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
}
if ( !bItalic && (aStyleText == pList->GetItalicStr()) )
- bItalic = TRUE;
+ bItalic = sal_True;
else if ( !bBold && (aStyleText == pList->GetBoldStr()) )
- bBold = TRUE;
+ bBold = sal_True;
else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
hFontInfo = pList->GetNextFontInfo( hFontInfo );
}
@@ -2222,15 +2221,15 @@ FontSizeBox::~FontSizeBox()
void FontSizeBox::ImplInit()
{
- EnableAutocomplete( FALSE );
+ EnableAutocomplete( sal_False );
- bRelativeMode = FALSE;
- bPtRelative = FALSE;
- bRelative = FALSE;
- bStdSize = FALSE;
+ bRelativeMode = sal_False;
+ bPtRelative = sal_False;
+ bRelative = sal_False;
+ bStdSize = sal_False;
pFontList = NULL;
- SetShowTrailingZeros( FALSE );
+ SetShowTrailingZeros( sal_False );
SetDecimalDigits( 1 );
SetMin( 20 );
SetMax( 9999 );
@@ -2266,24 +2265,24 @@ void FontSizeBox::Modify()
XubString aStr = GetText();
aStr.EraseLeadingChars();
- BOOL bNewMode = bRelative;
- BOOL bOldPtRelMode = bPtRelative;
+ sal_Bool bNewMode = bRelative;
+ sal_Bool bOldPtRelMode = bPtRelative;
if ( bRelative )
{
- bPtRelative = FALSE;
+ bPtRelative = sal_False;
const xub_Unicode* pStr = aStr.GetBuffer();
while ( *pStr )
{
if ( ((*pStr < '0') || (*pStr > '9')) && (*pStr != '%') )
{
if ( ('-' == *pStr || '+' == *pStr) && !bPtRelative )
- bPtRelative = TRUE;
+ bPtRelative = sal_True;
else if ( bPtRelative && 'p' == *pStr && 't' == *++pStr )
;
else
{
- bNewMode = FALSE;
+ bNewMode = sal_False;
break;
}
}
@@ -2294,14 +2293,14 @@ void FontSizeBox::Modify()
{
if ( STRING_NOTFOUND != aStr.Search( '%' ) )
{
- bNewMode = TRUE;
- bPtRelative = FALSE;
+ bNewMode = sal_True;
+ bPtRelative = sal_False;
}
if ( '-' == aStr.GetChar( 0 ) || '+' == aStr.GetChar( 0 ) )
{
- bNewMode = TRUE;
- bPtRelative = TRUE;
+ bNewMode = sal_True;
+ bPtRelative = sal_True;
}
}
@@ -2342,24 +2341,24 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
// for standard sizes we don't need to bother
if ( bStdSize && GetEntryCount() && aFontSizeNames.IsEmpty() )
return;
- bStdSize = TRUE;
+ bStdSize = sal_True;
}
else
- bStdSize = FALSE;
+ bStdSize = sal_False;
Selection aSelection = GetSelection();
XubString aStr = GetText();
Clear();
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if ( !aFontSizeNames.IsEmpty() )
{
if ( pAry == pList->GetStdSizeAry() )
{
// for scalable fonts all font size names
- ULONG nCount = aFontSizeNames.Count();
- for( ULONG i = 0; i < nCount; i++ )
+ sal_uLong nCount = aFontSizeNames.Count();
+ for( sal_uLong i = 0; i < nCount; i++ )
{
String aSizeName = aFontSizeNames.GetIndexName( i );
long nSize = aFontSizeNames.GetIndexSize( i );
@@ -2402,9 +2401,9 @@ void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList )
// -----------------------------------------------------------------------
-void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep )
+void FontSizeBox::EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax, sal_uInt16 nStep )
{
- bRelativeMode = TRUE;
+ bRelativeMode = sal_True;
nRelMin = nMin;
nRelMax = nMax;
nRelStep = nStep;
@@ -2415,7 +2414,7 @@ void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep )
void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep )
{
- bRelativeMode = TRUE;
+ bRelativeMode = sal_True;
nPtRelMin = nMin;
nPtRelMax = nMax;
nPtRelStep = nStep;
@@ -2424,7 +2423,7 @@ void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep )
// -----------------------------------------------------------------------
-void FontSizeBox::SetRelative( BOOL bNewRelative )
+void FontSizeBox::SetRelative( sal_Bool bNewRelative )
{
if ( bRelativeMode )
{
@@ -2434,8 +2433,8 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
if ( bNewRelative )
{
- bRelative = TRUE;
- bStdSize = FALSE;
+ bRelative = sal_True;
+ bStdSize = sal_False;
if ( bPtRelative )
{
@@ -2463,7 +2462,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
SetUnit( FUNIT_CUSTOM );
Clear();
- USHORT i = nRelMin;
+ sal_uInt16 i = nRelMin;
while ( i <= nRelMax )
{
InsertValue( i );
@@ -2473,7 +2472,7 @@ void FontSizeBox::SetRelative( BOOL bNewRelative )
}
else
{
- bRelative = bPtRelative = FALSE;
+ bRelative = bPtRelative = sal_False;
SetDecimalDigits( 1 );
SetMin( 20 );
SetMax( 9999 );
@@ -2513,7 +2512,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit )
mnLastValue = nTempValue;
SetText( aName );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
return;
}
}
@@ -2530,7 +2529,7 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue )
// -----------------------------------------------------------------------
-sal_Int64 FontSizeBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
+sal_Int64 FontSizeBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
{
if ( !bRelative )
{
diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx
deleted file mode 100644
index 8d6f236ab86b..000000000000
--- a/svtools/source/control/ctrldll.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-
-#include <sysdep.hxx>
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 23f26d8bdaee..e65614a2c26f 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -39,10 +39,9 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <sal/macros.h>
-
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include <ctrltool.hxx>
+#include <svtools/ctrltool.hxx>
// =======================================================================
@@ -118,7 +117,7 @@ class ImplFontListNameInfo
private:
XubString maSearchName;
ImplFontListFontInfo* mpFirst;
- USHORT mnType;
+ sal_uInt16 mnType;
ImplFontListNameInfo( const XubString& rSearchName ) :
maSearchName( rSearchName )
@@ -164,7 +163,7 @@ static void ImplMakeSearchStringFromName( XubString& rStr )
// -----------------------------------------------------------------------
-ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* pIndex ) const
+ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const
{
// Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als
// der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem
@@ -172,7 +171,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p
// und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
// sehr gross ist.
StringCompare eComp;
- ULONG nCnt = Count();
+ sal_uLong nCnt = Count();
if ( !nCnt )
{
if ( pIndex )
@@ -196,9 +195,9 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* p
// Fonts in der Liste suchen
ImplFontListNameInfo* pCompareData;
ImplFontListNameInfo* pFoundData = NULL;
- ULONG nLow = 0;
- ULONG nHigh = nCnt-1;
- ULONG nMid;
+ sal_uLong nLow = 0;
+ sal_uLong nHigh = nCnt-1;
+ sal_uLong nMid;
do
{
@@ -247,12 +246,12 @@ ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const
// -----------------------------------------------------------------------
-void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
- BOOL bInsertData )
+void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
+ sal_Bool bInsertData )
{
rtl_TextEncoding eSystemEncoding = gsl_getSystemTextEncoding();
- USHORT nType;
+ sal_uInt16 nType;
if ( pDevice->GetOutDevType() != OUTDEV_PRINTER )
nType = FONTLIST_FONTNAMETYPE_SCREEN;
else
@@ -260,7 +259,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
// Alle Fonts vom Device abfragen
int n = pDevice->GetDevFontCount();
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < n; i++ )
{
FontInfo aFontInfo = pDevice->GetDevFont( i );
@@ -272,7 +271,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
XubString aSearchName = aFontInfo.GetName();
ImplFontListNameInfo* pData;
- ULONG nIndex;
+ sal_uLong nIndex;
ImplMakeSearchString( aSearchName );
pData = ImplFind( aSearchName, &nIndex );
@@ -292,7 +291,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
{
if ( bInsertData )
{
- BOOL bInsert = TRUE;
+ sal_Bool bInsert = sal_True;
ImplFontListFontInfo* pPrev = NULL;
ImplFontListFontInfo* pTemp = pData->mpFirst;
ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice );
@@ -313,7 +312,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
pTemp->mpNext = pTemp2;
}
delete pNewInfo;
- bInsert = FALSE;
+ bInsert = sal_False;
}
break;
@@ -345,8 +344,8 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
// =======================================================================
-FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) :
- List( 4096, sal::static_int_cast< USHORT >(pDevice->GetDevFontCount()), 32 )
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll ) :
+ List( 4096, sal::static_int_cast< sal_uInt16 >(pDevice->GetDevFontCount()), 32 )
{
// Variablen initialisieren
mpDev = pDevice;
@@ -363,14 +362,14 @@ FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) :
maBlack = XubString( SvtResId( STR_SVT_STYLE_BLACK ) );
maBlackItalic = XubString( SvtResId( STR_SVT_STYLE_BLACK_ITALIC ) );
- ImplInsertFonts( pDevice, bAll, TRUE );
+ ImplInsertFonts( pDevice, bAll, sal_True );
// Gegebenenfalls muessen wir mit den Bildschirmfonts vergleichen,
// damit dort die eigentlich doppelten auf Equal mappen koennen
- BOOL bCompareWindow = FALSE;
+ sal_Bool bCompareWindow = sal_False;
if ( !pDevice2 && (pDevice->GetOutDevType() == OUTDEV_PRINTER) )
{
- bCompareWindow = TRUE;
+ bCompareWindow = sal_True;
pDevice2 = Application::GetDefaultDevice();
}
@@ -528,12 +527,12 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
}
// search for synthetic style
- USHORT nType = pData->mnType;
+ sal_uInt16 nType = pData->mnType;
const XubString& rStyleName = rInfo.GetStyleName();
if ( rStyleName.Len() )
{
- BOOL bNotSynthetic = FALSE;
- BOOL bNoneAvailable = FALSE;
+ sal_Bool bNotSynthetic = sal_False;
+ sal_Bool bNoneAvailable = sal_False;
FontWeight eWeight = rInfo.GetWeight();
FontItalic eItalic = rInfo.GetItalic();
ImplFontListFontInfo* pFontInfo = pData->mpFirst;
@@ -542,7 +541,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
if ( (eWeight == pFontInfo->GetWeight()) &&
(eItalic == pFontInfo->GetItalic()) )
{
- bNotSynthetic = TRUE;
+ bNotSynthetic = sal_True;
break;
}
@@ -599,7 +598,7 @@ XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
// -----------------------------------------------------------------------
-USHORT FontList::GetFontNameType( const XubString& rFontName ) const
+sal_uInt16 FontList::GetFontNameType( const XubString& rFontName ) const
{
ImplFontListNameInfo* pData = ImplFindByName( rFontName );
if ( pData )
@@ -747,14 +746,14 @@ FontInfo FontList::Get( const XubString& rName,
// -----------------------------------------------------------------------
-BOOL FontList::IsAvailable( const XubString& rName ) const
+sal_Bool FontList::IsAvailable( const XubString& rName ) const
{
return (ImplFindByName( rName ) != 0);
}
// -----------------------------------------------------------------------
-const FontInfo& FontList::GetFontName( USHORT nFont ) const
+const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
{
DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" );
@@ -764,7 +763,7 @@ const FontInfo& FontList::GetFontName( USHORT nFont ) const
// -----------------------------------------------------------------------
-USHORT FontList::GetFontNameType( USHORT nFont ) const
+sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
{
DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" );
@@ -830,8 +829,8 @@ const long* FontList::GetSizeAry( const FontInfo& rInfo ) const
MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
pDevice->SetMapMode( aMap );
- USHORT i;
- USHORT nRealCount = 0;
+ sal_uInt16 i;
+ sal_uInt16 nRealCount = 0;
long nOldHeight = 0;
((FontList*)this)->mpSizeAry = new long[nDevSizeCount+1];
for ( i = 0; i < nDevSizeCount; i++ )
@@ -968,7 +967,7 @@ String FontSizeNames::Size2Name( long nValue ) const
//------------------------------------------------------------------------
-String FontSizeNames::GetIndexName( ULONG nIndex ) const
+String FontSizeNames::GetIndexName( sal_uLong nIndex ) const
{
String aStr;
@@ -980,7 +979,7 @@ String FontSizeNames::GetIndexName( ULONG nIndex ) const
//------------------------------------------------------------------------
-long FontSizeNames::GetIndexSize( ULONG nIndex ) const
+long FontSizeNames::GetIndexSize( sal_uLong nIndex ) const
{
if ( nIndex >= mnElem )
return 0;
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 1a1d539d0120..c8d506ad2a9a 100644..100755
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -32,7 +32,7 @@
#define _SV_FIELCTRL_CXX
#include <tools/urlobj.hxx>
#include <svtools/svtdata.hxx>
-#include <filectrl.hxx>
+#include <svtools/filectrl.hxx>
#include <filectrl.hrc>
// =======================================================================
@@ -46,12 +46,12 @@ FileControl::FileControl( Window* pParent, WinBits nStyle, FileControlMode nFlag
mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT )
{
maButton.SetClickHdl( LINK( this, FileControl, ButtonHdl ) );
- mbOpenDlg = TRUE;
+ mbOpenDlg = sal_True;
maButton.Show();
maEdit.Show();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( GetStyle() ) );
}
@@ -155,7 +155,7 @@ void FileControl::Resize()
if( mnInternalFlags & FILECTRL_INRESIZE )
return;
- mnInternalFlags |= FILECTRL_INRESIZE;//InResize = TRUE
+ mnInternalFlags |= FILECTRL_INRESIZE;//InResize = sal_True
Size aOutSz = GetOutputSizePixel();
long nButtonTextWidth = maButton.GetTextWidth( maButtonText );
@@ -164,7 +164,7 @@ void FileControl::Resize()
( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN
? ( maEdit.GetTextWidth( maEdit.GetText() )
<= aOutSz.Width() - nButtonTextWidth - ButtonBorder )
- : TRUE ) )
+ : sal_True ) )
)
{
maButton.SetText( maButtonText );
@@ -180,7 +180,7 @@ void FileControl::Resize()
maEdit.SetPosSizePixel( 0, 0, aOutSz.Width()-nButtonWidth, aOutSz.Height() );
maButton.SetPosSizePixel( aOutSz.Width()-nButtonWidth, 0, nButtonWidth, aOutSz.Height() );
- mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = FALSE
+ mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = sal_False
}
// -----------------------------------------------------------------------
@@ -201,7 +201,7 @@ void FileControl::GetFocus()
// -----------------------------------------------------------------------
-void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
WinBits nOldEditStyle = GetEdit().GetStyle();
if ( GetStyle() & WB_BORDER )
diff --git a/svtools/source/control/filectrl.src b/svtools/source/control/filectrl.src
index de6cb8409ff4..5703004dd946 100644..100755
--- a/svtools/source/control/filectrl.src
+++ b/svtools/source/control/filectrl.src
@@ -30,3 +30,20 @@ String STR_FILECTRL_BUTTONTEXT
{
Text [ en-US ] = "Browse..." ;
};
+
+String STR_TABBAR_PUSHBUTTON_MOVET0HOME
+{
+ Text [ en-US ] = "Move To Home" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVELEFT
+{
+ Text [ en-US ] = "Move Left" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVERIGHT
+{
+ Text [ en-US ] = "Move Right" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVETOEND
+{
+ Text [ en-US ] = "Move To End" ;
+}; \ No newline at end of file
diff --git a/svtools/source/control/filectrl2.cxx b/svtools/source/control/filectrl2.cxx
index 8cfe2c97f5ac..805b400599c8 100644..100755
--- a/svtools/source/control/filectrl2.cxx
+++ b/svtools/source/control/filectrl2.cxx
@@ -30,7 +30,7 @@
#include "precompiled_svtools.hxx"
// this file contains code from filectrl.cxx which needs to be compiled with enabled exception hanling
-#include <filectrl.hxx>
+#include <svtools/filectrl.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <vcl/unohelp.hxx>
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 68072ce2d388..9c1ba517367c 100644..100755
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -306,7 +306,7 @@ namespace validation
//==============================================================================
SvNumberFormatter* FormattedField::StaticFormatter::s_cFormatter = NULL;
-ULONG FormattedField::StaticFormatter::s_nReferences = 0;
+sal_uLong FormattedField::StaticFormatter::s_nReferences = 0;
//------------------------------------------------------------------------------
SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
@@ -346,13 +346,13 @@ DBG_NAME(FormattedField);
m_aLastSelection(0,0) \
,m_dMinValue(0) \
,m_dMaxValue(0) \
- ,m_bHasMin(FALSE) \
- ,m_bHasMax(FALSE) \
- ,m_bStrictFormat(TRUE) \
- ,m_bValueDirty(TRUE) \
- ,m_bEnableEmptyField(TRUE) \
- ,m_bAutoColor(FALSE) \
- ,m_bEnableNaN(FALSE) \
+ ,m_bHasMin(sal_False) \
+ ,m_bHasMax(sal_False) \
+ ,m_bStrictFormat(sal_True) \
+ ,m_bValueDirty(sal_True) \
+ ,m_bEnableEmptyField(sal_True) \
+ ,m_bAutoColor(sal_False) \
+ ,m_bEnableNaN(sal_False) \
,m_dCurrentValue(0) \
,m_dDefaultValue(0) \
,m_nFormatKey(0) \
@@ -360,12 +360,12 @@ DBG_NAME(FormattedField);
,m_dSpinSize(1) \
,m_dSpinFirst(-1000000) \
,m_dSpinLast(1000000) \
- ,m_bTreatAsNumber(TRUE) \
+ ,m_bTreatAsNumber(sal_True) \
,m_pLastOutputColor(NULL) \
,m_bUseInputStringForFormatting(false)
//------------------------------------------------------------------------------
-FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey)
:SpinField(pParent, nStyle)
,INIT_MEMBERS()
{
@@ -379,7 +379,7 @@ FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatte
}
//------------------------------------------------------------------------------
-FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey)
:SpinField(pParent, rResId)
,INIT_MEMBERS()
{
@@ -409,7 +409,7 @@ void FormattedField::SetValidateText(const XubString& rText, const String* pErro
if (pErrorText)
ImplSetTextImpl(*pErrorText, NULL);
else
- ImplSetValue(m_dDefaultValue, TRUE);
+ ImplSetValue(m_dDefaultValue, sal_True);
}
//------------------------------------------------------------------------------
@@ -418,7 +418,7 @@ void FormattedField::SetText(const XubString& rStr)
DBG_CHKTHIS(FormattedField, NULL);
SpinField::SetText(rStr);
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
//------------------------------------------------------------------------------
@@ -427,7 +427,7 @@ void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelect
DBG_CHKTHIS(FormattedField, NULL);
SpinField::SetText( rStr, rNewSelection );
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
//------------------------------------------------------------------------------
@@ -456,8 +456,8 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
Selection aSel(GetSelection());
Selection aNewSel(aSel);
aNewSel.Justify();
- USHORT nNewLen = sFormatted.Len();
- USHORT nCurrentLen = GetText().Len();
+ sal_uInt16 nNewLen = sFormatted.Len();
+ sal_uInt16 nCurrentLen = GetText().Len();
if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen))
{ // the new text is longer and the cursor was behind the last char (of the old text)
if (aNewSel.Min() == 0)
@@ -465,7 +465,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
aNewSel.Max() = nNewLen;
if (!nCurrentLen)
{ // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
{ // selection should be from right to left -> swap min and max
aNewSel.Min() = aNewSel.Max();
@@ -484,7 +484,7 @@ void FormattedField::SetTextFormatted(const XubString& rStr)
else
aNewSel = aSel; // don't use the justified version
SpinField::SetText(sFormatted, aNewSel);
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
//------------------------------------------------------------------------------
@@ -493,13 +493,13 @@ String FormattedField::GetTextValue() const
if (m_bValueDirty)
{
((FormattedField*)this)->m_sCurrentTextValue = GetText();
- ((FormattedField*)this)->m_bValueDirty = FALSE;
+ ((FormattedField*)this)->m_bValueDirty = sal_False;
}
return m_sCurrentTextValue;
}
//------------------------------------------------------------------------------
-void FormattedField::EnableNotANumber( BOOL _bEnable )
+void FormattedField::EnableNotANumber( sal_Bool _bEnable )
{
if ( m_bEnableNaN == _bEnable )
return;
@@ -508,7 +508,7 @@ void FormattedField::EnableNotANumber( BOOL _bEnable )
}
//------------------------------------------------------------------------------
-void FormattedField::SetAutoColor(BOOL _bAutomatic)
+void FormattedField::SetAutoColor(sal_Bool _bAutomatic)
{
if (_bAutomatic == m_bAutoColor)
return;
@@ -530,7 +530,7 @@ void FormattedField::Modify()
if (!IsStrictFormat())
{
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
SpinField::Modify();
return;
}
@@ -540,7 +540,7 @@ void FormattedField::Modify()
{
m_sLastValidText = sCheck;
m_aLastSelection = GetSelection();
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
}
else
{
@@ -570,8 +570,8 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
Selection aSel(GetSelection());
aSel.Justify();
- USHORT nNewLen = rNew.Len();
- USHORT nCurrentLen = GetText().Len();
+ sal_uInt16 nNewLen = rNew.Len();
+ sal_uInt16 nCurrentLen = GetText().Len();
if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen))
{ // new new text is longer and the cursor is behind the last char
@@ -580,7 +580,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
aSel.Max() = nNewLen;
if (!nCurrentLen)
{ // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
{ // selection should be from right to left -> swap min and max
aSel.Min() = aSel.Max();
@@ -599,7 +599,7 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
SpinField::SetText(rNew, aSel);
}
- m_bValueDirty = TRUE;
+ m_bValueDirty = sal_True;
// muss nicht stimmen, aber sicherheitshalber ...
}
@@ -613,12 +613,12 @@ long FormattedField::PreNotify(NotifyEvent& rNEvt)
}
//------------------------------------------------------------------------------
-void FormattedField::ImplSetFormatKey(ULONG nFormatKey)
+void FormattedField::ImplSetFormatKey(sal_uLong nFormatKey)
{
DBG_CHKTHIS(FormattedField, NULL);
m_nFormatKey = nFormatKey;
- BOOL bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
+ sal_Bool bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
if (bNeedFormatter)
{
ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt
@@ -633,16 +633,16 @@ void FormattedField::ImplSetFormatKey(ULONG nFormatKey)
}
//------------------------------------------------------------------------------
-void FormattedField::SetFormatKey(ULONG nFormatKey)
+void FormattedField::SetFormatKey(sal_uLong nFormatKey)
{
DBG_CHKTHIS(FormattedField, NULL);
- BOOL bNoFormatter = (m_pFormatter == NULL);
+ sal_Bool bNoFormatter = (m_pFormatter == NULL);
ImplSetFormatKey(nFormatKey);
FormatChanged((bNoFormatter && (m_pFormatter != NULL)) ? FCT_FORMATTER : FCT_KEYONLY);
}
//------------------------------------------------------------------------------
-void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat)
+void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bResetFormat)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -676,7 +676,7 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetForm
LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW;
// den alten Format-String in die neue Sprache konvertieren
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
short nType;
pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang);
m_nFormatKey = nDestKey;
@@ -698,47 +698,47 @@ void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) co
}
//------------------------------------------------------------------------------
-BOOL FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
+sal_Bool FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
{
DBG_CHKTHIS(FormattedField, NULL);
sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang);
if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
{
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
short nType;
XubString rFormat(rFormatString);
if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang))
- return FALSE;
+ return sal_False;
DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !");
}
if (nNewKey != m_nFormatKey)
SetFormatKey(nNewKey);
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------------
-BOOL FormattedField::GetThousandsSep() const
+sal_Bool FormattedField::GetThousandsSep() const
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::GetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
return bThousand;
}
//------------------------------------------------------------------------------
-void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
+void FormattedField::SetThousandsSep(sal_Bool _bUseSeparator)
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::SetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
// get the current settings
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
if (bThousand == _bUseSeparator)
return;
@@ -751,7 +751,7 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading);
// ... and introduce it to the formatter
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
sal_uInt32 nNewKey;
short nType;
ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
@@ -762,27 +762,27 @@ void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
}
//------------------------------------------------------------------------------
-USHORT FormattedField::GetDecimalDigits() const
+sal_uInt16 FormattedField::GetDecimalDigits() const
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::GetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
return nPrecision;
}
//------------------------------------------------------------------------------
-void FormattedField::SetDecimalDigits(USHORT _nPrecision)
+void FormattedField::SetDecimalDigits(sal_uInt16 _nPrecision)
{
DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
"FormattedField::SetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
// get the current settings
- BOOL bThousand, IsRed;
- USHORT nPrecision, nAnzLeading;
+ sal_Bool bThousand, IsRed;
+ sal_uInt16 nPrecision, nAnzLeading;
ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
if (nPrecision == _nPrecision)
return;
@@ -795,7 +795,7 @@ void FormattedField::SetDecimalDigits(USHORT _nPrecision)
// generate a new format ...
ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading);
// ... and introduce it to the formatter
- USHORT nCheckPos;
+ sal_uInt16 nCheckPos;
sal_uInt32 nNewKey;
short nType;
ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
@@ -831,7 +831,7 @@ void FormattedField::Commit()
{ // consider the field as modified
Modify();
// but we have the most recent value now
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
}
@@ -845,7 +845,7 @@ void FormattedField::ReFormat()
double dValue = GetValue();
if ( m_bEnableNaN && ::rtl::math::isNan( dValue ) )
return;
- ImplSetValue( dValue, TRUE );
+ ImplSetValue( dValue, sal_True );
}
else
SetTextFormatted(GetTextValue());
@@ -860,7 +860,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
if ((rNEvt.GetType() == EVENT_KEYINPUT) && !IsReadOnly())
{
const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
- USHORT nMod = rKEvt.GetKeyCode().GetModifier();
+ sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier();
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_UP:
@@ -901,7 +901,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
{
if (TreatingAsNumber())
{
- ImplSetValue(m_dCurrentValue, TRUE);
+ ImplSetValue(m_dCurrentValue, sal_True);
Modify();
}
else
@@ -912,7 +912,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
else
SetTextFormatted(m_sDefaultText);
}
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
}
}
else
@@ -931,7 +931,7 @@ void FormattedField::SetMinValue(double dMin)
DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMinValue : only to be used in numeric mode !");
m_dMinValue = dMin;
- m_bHasMin = TRUE;
+ m_bHasMin = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
ReFormat();
}
@@ -943,7 +943,7 @@ void FormattedField::SetMaxValue(double dMax)
DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMaxValue : only to be used in numeric mode !");
m_dMaxValue = dMax;
- m_bHasMax = TRUE;
+ m_bHasMax = sal_True;
// fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
ReFormat();
}
@@ -957,7 +957,7 @@ void FormattedField::SetTextValue(const XubString& rText)
}
//------------------------------------------------------------------------------
-void FormattedField::EnableEmptyField(BOOL bEnable)
+void FormattedField::EnableEmptyField(sal_Bool bEnable)
{
DBG_CHKTHIS(FormattedField, NULL);
if (bEnable == m_bEnableEmptyField)
@@ -965,11 +965,11 @@ void FormattedField::EnableEmptyField(BOOL bEnable)
m_bEnableEmptyField = bEnable;
if (!m_bEnableEmptyField && GetText().Len()==0)
- ImplSetValue(m_dCurrentValue, TRUE);
+ ImplSetValue(m_dCurrentValue, sal_True);
}
//------------------------------------------------------------------------------
-void FormattedField::ImplSetValue(double dVal, BOOL bForce)
+void FormattedField::ImplSetValue(double dVal, sal_Bool bForce)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -982,7 +982,7 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce)
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplSetValue : can't set a value without a formatter !");
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
m_dCurrentValue = dVal;
String sNewText;
@@ -1003,23 +1003,23 @@ void FormattedField::ImplSetValue(double dVal, BOOL bForce)
}
ImplSetTextImpl(sNewText, NULL);
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !");
}
//------------------------------------------------------------------------------
-BOOL FormattedField::ImplGetValue(double& dNewVal)
+sal_Bool FormattedField::ImplGetValue(double& dNewVal)
{
DBG_CHKTHIS(FormattedField, NULL);
dNewVal = m_dCurrentValue;
if (!m_bValueDirty)
- return TRUE;
+ return sal_True;
dNewVal = m_dDefaultValue;
String sText(GetText());
if (!sText.Len())
- return TRUE;
+ return sal_True;
DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
@@ -1035,7 +1035,7 @@ BOOL FormattedField::ImplGetValue(double& dNewVal)
// the language of our format
LanguageType eLanguage = m_pFormatter->GetEntry(m_nFormatKey)->GetLanguage();
// the default number format for this language
- ULONG nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage);
+ sal_uLong nStandardNumericFormat = m_pFormatter->GetStandardFormat(NUMBERFORMAT_NUMBER, eLanguage);
sal_uInt32 nTempFormat = nStandardNumericFormat;
double dTemp;
@@ -1049,14 +1049,14 @@ BOOL FormattedField::ImplGetValue(double& dNewVal)
// which equals 300 percent.
}
if (!ImplGetFormatter()->IsNumberFormat(sText, nFormatKey, dNewVal))
- return FALSE;
+ return sal_False;
if (m_bHasMin && (dNewVal<m_dMinValue))
dNewVal = m_dMinValue;
if (m_bHasMax && (dNewVal>m_dMaxValue))
dNewVal = m_dMaxValue;
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------------------
@@ -1079,7 +1079,7 @@ double FormattedField::GetValue()
m_dCurrentValue = m_dDefaultValue;
}
- m_bValueDirty = FALSE;
+ m_bValueDirty = sal_False;
return m_dCurrentValue;
}
@@ -1166,7 +1166,7 @@ void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
}
//------------------------------------------------------------------------------
-BOOL DoubleNumericField::CheckText(const XubString& sText) const
+sal_Bool DoubleNumericField::CheckText(const XubString& sText) const
{
// We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't
// recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10")
@@ -1174,19 +1174,19 @@ BOOL DoubleNumericField::CheckText(const XubString& sText) const
#ifdef REGEXP_SUPPORT
if (!sText.Len())
- return TRUE;
+ return sal_True;
String sForceComplete = '_';
sForceComplete += sText;
sForceComplete += '_';
- USHORT nStart = 0, nEnd = sForceComplete.Len();
- BOOL bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd);
+ sal_uInt16 nStart = 0, nEnd = sForceComplete.Len();
+ sal_Bool bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd);
if (bFound && (nStart == 0) && (nEnd == sForceComplete.Len()))
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
#else
return m_pNumberValidator->isValidNumericFragment( sText );
#endif
@@ -1252,9 +1252,9 @@ void DoubleNumericField::ResetConformanceTester()
//------------------------------------------------------------------------------
DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle)
:FormattedField(pParent, nStyle)
- ,m_bChangingFormat(FALSE)
+ ,m_bChangingFormat(sal_False)
{
- m_bPrependCurrSym = FALSE;
+ m_bPrependCurrSym = sal_False;
// initialize with a system currency format
m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol();
@@ -1264,9 +1264,9 @@ DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle)
//------------------------------------------------------------------------------
DoubleCurrencyField::DoubleCurrencyField(Window* pParent, const ResId& rResId)
:FormattedField(pParent, rResId)
- ,m_bChangingFormat(FALSE)
+ ,m_bChangingFormat(sal_False)
{
- m_bPrependCurrSym = FALSE;
+ m_bPrependCurrSym = sal_False;
// initialize with a system currency format
m_sCurrencySymbol = SvtSysLocale().GetLocaleData().getCurrSymbol();
@@ -1313,7 +1313,7 @@ void DoubleCurrencyField::setCurrencySymbol(const String& _sSymbol)
}
//------------------------------------------------------------------------------
-void DoubleCurrencyField::setPrependCurrSym(BOOL _bPrepend)
+void DoubleCurrencyField::setPrependCurrSym(sal_Bool _bPrepend)
{
if (m_bPrependCurrSym == _bPrepend)
return;
@@ -1330,8 +1330,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
XubString sOldFormat;
LanguageType eLanguage;
GetFormat(sOldFormat, eLanguage);
- BOOL bThSep = GetThousandsSep();
- USHORT nDigits = GetDecimalDigits();
+ sal_Bool bThSep = GetThousandsSep();
+ sal_uInt16 nDigits = GetDecimalDigits();
// build a new format string with the base class' and my own settings
Locale aLocale;
@@ -1391,9 +1391,9 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
}
// set this new basic format
- m_bChangingFormat = TRUE;
+ m_bChangingFormat = sal_True;
SetFormat(sNewFormat, eLanguage);
- m_bChangingFormat = FALSE;
+ m_bChangingFormat = sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 38c233b27699..2b22996c0486 100644..100755
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -42,10 +42,10 @@
struct ImplHeadItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
HeaderBarItemBits mnBits;
long mnSize;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Image maImage;
XubString maOutText;
XubString maText;
@@ -65,8 +65,8 @@ struct ImplHeadItem
#define HEADERBAR_DRAGOFF 4
#define HEADERBAR_DRAGOUTOFF 15
-#define HEAD_HITTEST_ITEM ((USHORT)0x0001)
-#define HEAD_HITTEST_DIVIDER ((USHORT)0x0002)
+#define HEAD_HITTEST_ITEM ((sal_uInt16)0x0001)
+#define HEAD_HITTEST_DIVIDER ((sal_uInt16)0x0002)
// =======================================================================
@@ -84,20 +84,20 @@ void HeaderBar::ImplInit( WinBits nWinStyle )
mnMouseOff = 0;
mnCurItemId = 0;
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
- mbDrag = FALSE;
- mbItemDrag = FALSE;
- mbOutDrag = FALSE;
- mbItemMode = FALSE;
+ mbDrag = sal_False;
+ mbItemDrag = sal_False;
+ mbOutDrag = sal_False;
+ mbItemMode = sal_False;
// StyleBits auswerten
if ( nWinStyle & WB_DRAG )
- mbDragable = TRUE;
+ mbDragable = sal_True;
else
- mbDragable = FALSE;
+ mbDragable = sal_False;
if ( nWinStyle & WB_BUTTONSTYLE )
- mbButtonStyle = TRUE;
+ mbButtonStyle = sal_True;
else
- mbButtonStyle = FALSE;
+ mbButtonStyle = sal_False;
if ( nWinStyle & WB_BORDER )
{
mnBorderOff1 = 1;
@@ -109,7 +109,7 @@ void HeaderBar::ImplInit( WinBits nWinStyle )
mnBorderOff2 = 1;
}
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -143,8 +143,8 @@ HeaderBar::~HeaderBar()
// -----------------------------------------------------------------------
-void HeaderBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void HeaderBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -181,7 +181,7 @@ void HeaderBar::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
-long HeaderBar::ImplGetItemPos( USHORT nPos ) const
+long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const
{
long nX = -mnOffset;
for ( size_t i = 0; i < nPos; i++ )
@@ -191,7 +191,7 @@ long HeaderBar::ImplGetItemPos( USHORT nPos ) const
// -----------------------------------------------------------------------
-Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const
+Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const
{
Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 );
aRect.Right() = aRect.Left() + (*mpItemList)[ nPos ]->mnSize - 1;
@@ -203,12 +203,12 @@ Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT HeaderBar::ImplHitTest( const Point& rPos,
- long& nMouseOff, USHORT& nPos ) const
+sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
+ long& nMouseOff, sal_uInt16& nPos ) const
{
ImplHeadItem* pItem;
- size_t nCount = (USHORT)mpItemList->size();
- BOOL bLastFixed = TRUE;
+ size_t nCount = (sal_uInt16)mpItemList->size();
+ sal_Bool bLastFixed = sal_True;
long nX = -mnOffset;
for ( size_t i = 0; i < nCount; i++ )
@@ -217,7 +217,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
if ( rPos.X() < (nX+pItem->mnSize) )
{
- USHORT nMode;
+ sal_uInt16 nMode;
if ( !bLastFixed && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
{
@@ -245,9 +245,9 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
}
if ( pItem->mnBits & HIB_FIXED )
- bLastFixed = TRUE;
+ bLastFixed = sal_True;
else
- bLastFixed = FALSE;
+ bLastFixed = sal_False;
nX += pItem->mnSize;
}
@@ -268,7 +268,7 @@ USHORT HeaderBar::ImplHitTest( const Point& rPos,
// -----------------------------------------------------------------------
-void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos )
+void HeaderBar::ImplInvertDrag( sal_uInt16 nStartPos, sal_uInt16 nEndPos )
{
Rectangle aRect1 = ImplGetItemRect( nStartPos );
Rectangle aRect2 = ImplGetItemRect( nEndPos );
@@ -317,10 +317,10 @@ void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos )
// -----------------------------------------------------------------------
void HeaderBar::ImplDrawItem( OutputDevice* pDev,
- USHORT nPos, BOOL bHigh, BOOL bDrag,
+ sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
const Rectangle& rItemRect,
const Rectangle* pRect,
- ULONG )
+ sal_uLong )
{
Rectangle aRect = rItemRect;
@@ -374,9 +374,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
// avoid 3D borders
Color aSelectionTextColor( COL_TRANSPARENT );
if( bHigh )
- DrawSelectionBackground( aRect, 1, TRUE, FALSE, FALSE, &aSelectionTextColor );
+ DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor );
else if ( !mbButtonStyle || (nBits & HIB_FLAT) )
- DrawSelectionBackground( aRect, 0, TRUE, FALSE, FALSE, &aSelectionTextColor );
+ DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor );
// Wenn kein Platz, dann brauchen wir auch nichts ausgeben
if ( aRect.GetWidth() < 1 )
@@ -403,14 +403,14 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
// Text auf entsprechende Laenge kuerzen
- BOOL bLeftText = FALSE;
+ sal_Bool bLeftText = sal_False;
long nMaxTxtWidth = aRect.GetWidth()-(HEADERBAR_TEXTOFF*2)-nArrowWidth;
if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) )
nMaxTxtWidth -= aImageSize.Width();
long nTxtWidth = aTxtSize.Width();
if ( nTxtWidth > nMaxTxtWidth )
{
- bLeftText = TRUE;
+ bLeftText = sal_True;
// 3 == Len of "..."
pItem->maOutText.AppendAscii( "..." );
do
@@ -544,7 +544,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
if ( nImagePos+aImageSize.Width() <= aRect.Right() )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
pDev->DrawImage( Point( nImagePos, nImagePosY ), pItem->maImage, nStyle );
@@ -567,11 +567,11 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
}
// Feststellen, ob Platz genug ist, das Item zu malen
- BOOL bDraw = TRUE;
+ sal_Bool bDraw = sal_True;
if ( nArrowX < aRect.Left()+HEADERBAR_TEXTOFF )
- bDraw = FALSE;
+ bDraw = sal_False;
else if ( nArrowX+HEAD_ARROWSIZE2 > aRect.Right() )
- bDraw = FALSE;
+ bDraw = sal_False;
if ( bDraw )
{
@@ -630,7 +630,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
// -----------------------------------------------------------------------
-void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag,
+void HeaderBar::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHigh, sal_Bool bDrag,
const Rectangle* pRect )
{
Rectangle aRect = ImplGetItemRect( nPos );
@@ -639,7 +639,7 @@ void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag,
// -----------------------------------------------------------------------
-void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
+void HeaderBar::ImplUpdate( sal_uInt16 nPos, sal_Bool bEnd, sal_Bool bDirect )
{
if ( IsVisible() && IsUpdateMode() )
{
@@ -667,7 +667,7 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
ImplDrawItem( i );
if ( bEnd )
{
- Rectangle aRect = ImplGetItemRect( (USHORT)mpItemList->size() );
+ Rectangle aRect = ImplGetItemRect( (sal_uInt16)mpItemList->size() );
aRect.Left() = aRect.Right();
aRect.Right() = mnDX-1;
if ( aRect.Left() < aRect.Right() )
@@ -683,31 +683,31 @@ void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
// -----------------------------------------------------------------------
-void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
+void HeaderBar::ImplStartDrag( const Point& rMousePos, sal_Bool bCommand )
{
- USHORT nPos;
- USHORT nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos );
+ sal_uInt16 nPos;
+ sal_uInt16 nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos );
if ( nHitTest )
{
- mbDrag = FALSE;
+ mbDrag = sal_False;
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( nHitTest & HEAD_HITTEST_DIVIDER )
- mbDrag = TRUE;
+ mbDrag = sal_True;
else
{
if ( ((pItem->mnBits & HIB_CLICKABLE) && !(pItem->mnBits & HIB_FLAT)) ||
(mbDragable && !(pItem->mnBits & HIB_FIXEDPOS)) )
{
- mbItemMode = TRUE;
- mbDrag = TRUE;
+ mbItemMode = sal_True;
+ mbDrag = sal_True;
if ( bCommand )
{
if ( mbDragable )
- mbItemDrag = TRUE;
+ mbItemDrag = sal_True;
else
{
- mbItemMode = FALSE;
- mbDrag = FALSE;
+ mbItemMode = sal_False;
+ mbDrag = sal_False;
}
}
}
@@ -724,7 +724,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
if ( mbDrag )
{
- mbOutDrag = FALSE;
+ mbOutDrag = sal_False;
mnCurItemId = pItem->mnId;
mnItemDragPos = nPos;
StartTracking();
@@ -732,7 +732,7 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
mnDragPos = mnStartPos;
StartDrag();
if ( mbItemMode )
- ImplDrawItem( nPos, TRUE, mbItemDrag );
+ ImplDrawItem( nPos, sal_True, mbItemDrag );
else
{
Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY );
@@ -748,17 +748,17 @@ void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
void HeaderBar::ImplDrag( const Point& rMousePos )
{
- BOOL bNewOutDrag;
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_Bool bNewOutDrag;
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
mnDragPos = rMousePos.X()-mnMouseOff;
if ( mbItemMode )
{
Rectangle aItemRect = ImplGetItemRect( nPos );
if ( aItemRect.IsInside( rMousePos ) )
- bNewOutDrag = FALSE;
+ bNewOutDrag = sal_False;
else
- bNewOutDrag = TRUE;
+ bNewOutDrag = sal_True;
// Evt. ItemDrag anschalten
if ( bNewOutDrag && mbDragable && !mbItemDrag &&
@@ -766,24 +766,24 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
{
if ( (rMousePos.Y() >= aItemRect.Top()) && (rMousePos.Y() <= aItemRect.Bottom()) )
{
- mbItemDrag = TRUE;
- ImplDrawItem( nPos, TRUE, mbItemDrag );
+ mbItemDrag = sal_True;
+ ImplDrawItem( nPos, sal_True, mbItemDrag );
}
}
- USHORT nOldItemDragPos = mnItemDragPos;
+ sal_uInt16 nOldItemDragPos = mnItemDragPos;
if ( mbItemDrag )
{
if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) )
- bNewOutDrag = TRUE;
+ bNewOutDrag = sal_True;
else
- bNewOutDrag = FALSE;
+ bNewOutDrag = sal_False;
if ( bNewOutDrag )
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
else
{
- USHORT nTempId = GetItemId( Point( rMousePos.X(), 2 ) );
+ sal_uInt16 nTempId = GetItemId( Point( rMousePos.X(), 2 ) );
if ( nTempId )
mnItemDragPos = GetItemPos( nTempId );
else
@@ -827,7 +827,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
(mnItemDragPos != nPos) &&
(mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) )
{
- ImplDrawItem( mnItemDragPos, FALSE, TRUE );
+ ImplDrawItem( mnItemDragPos, sal_False, sal_True );
ImplInvertDrag( nPos, mnItemDragPos );
}
}
@@ -853,7 +853,7 @@ void HeaderBar::ImplDrag( const Point& rMousePos )
// -----------------------------------------------------------------------
-void HeaderBar::ImplEndDrag( BOOL bCancel )
+void HeaderBar::ImplEndDrag( sal_Bool bCancel )
{
HideTracking();
@@ -861,7 +861,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
{
if ( mbItemMode && (!mbOutDrag || mbItemDrag) )
{
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
ImplDrawItem( nPos );
}
@@ -869,7 +869,7 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
}
else
{
- USHORT nPos = GetItemPos( mnCurItemId );
+ sal_uInt16 nPos = GetItemPos( mnCurItemId );
if ( mbItemMode )
{
if ( mbItemDrag )
@@ -898,18 +898,18 @@ void HeaderBar::ImplEndDrag( BOOL bCancel )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
pItem->mnSize += nDelta;
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
}
}
- mbDrag = FALSE;
+ mbDrag = sal_False;
EndDrag();
mnCurItemId = 0;
mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
- mbOutDrag = FALSE;
- mbItemMode = FALSE;
- mbItemDrag = FALSE;
+ mbOutDrag = sal_False;
+ mbItemMode = sal_False;
+ mbItemDrag = sal_False;
}
// -----------------------------------------------------------------------
@@ -921,23 +921,23 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() == 2 )
{
long nTemp;
- USHORT nPos;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos );
+ sal_uInt16 nPos;
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos );
if ( nHitTest )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( nHitTest & HEAD_HITTEST_DIVIDER )
- mbItemMode = FALSE;
+ mbItemMode = sal_False;
else
- mbItemMode = TRUE;
+ mbItemMode = sal_True;
mnCurItemId = pItem->mnId;
DoubleClick();
- mbItemMode = FALSE;
+ mbItemMode = sal_False;
mnCurItemId = 0;
}
}
else
- ImplStartDrag( rMEvt.GetPosPixel(), FALSE );
+ ImplStartDrag( rMEvt.GetPosPixel(), sal_False );
}
}
@@ -946,9 +946,9 @@ void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt )
void HeaderBar::MouseMove( const MouseEvent& rMEvt )
{
long nTemp1;
- USHORT nTemp2;
+ sal_uInt16 nTemp2;
PointerStyle eStyle = POINTER_ARROW;
- USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 );
+ sal_uInt16 nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 );
if ( nHitTest & HEAD_HITTEST_DIVIDER )
eStyle = POINTER_HSIZEBAR;
@@ -987,20 +987,20 @@ void HeaderBar::Paint( const Rectangle& rRect )
}
}
- USHORT nCurItemPos;
+ sal_uInt16 nCurItemPos;
if ( mbDrag )
nCurItemPos = GetItemPos( mnCurItemId );
else
nCurItemPos = HEADERBAR_ITEM_NOTFOUND;
- USHORT nItemCount = (USHORT)mpItemList->size();
- for ( USHORT i = 0; i < nItemCount; i++ )
- ImplDrawItem( i, (i == nCurItemPos) ? TRUE : FALSE, FALSE, &rRect );
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
+ for ( sal_uInt16 i = 0; i < nItemCount; i++ )
+ ImplDrawItem( i, (i == nCurItemPos) ? sal_True : sal_False, sal_False, &rRect );
}
// -----------------------------------------------------------------------
void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1046,7 +1046,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aItemRect.Right() = 16000;
Region aRegion( aRect );
pDev->SetClipRegion( aRegion );
- ImplDrawItem( pDev, i, FALSE, FALSE, aItemRect, &aRect, nFlags );
+ ImplDrawItem( pDev, i, sal_False, sal_False, aItemRect, &aRect, nFlags );
pDev->SetClipRegion();
}
@@ -1070,7 +1070,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt )
{
if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && !mbDrag )
{
- ImplStartDrag( rCEvt.GetMousePosPixel(), TRUE );
+ ImplStartDrag( rCEvt.GetMousePosPixel(), sal_True );
return;
}
@@ -1081,7 +1081,7 @@ void HeaderBar::Command( const CommandEvent& rCEvt )
void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
@@ -1118,13 +1118,13 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1144,17 +1144,17 @@ void HeaderBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -1170,7 +1170,7 @@ void HeaderBar::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1218,8 +1218,8 @@ void HeaderBar::DoubleClick()
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage,
- long nSize, HeaderBarItemBits nBits, USHORT nPos )
+void HeaderBar::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1241,13 +1241,13 @@ void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
- long nSize, HeaderBarItemBits nBits, USHORT nPos )
+void HeaderBar::InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1258,7 +1258,6 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mpUserData = 0;
if ( nPos < mpItemList->size() ) {
@@ -1270,15 +1269,15 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::InsertItem( USHORT nItemId,
+void HeaderBar::InsertItem( sal_uInt16 nItemId,
const Image& rImage, const XubString& rText,
long nSize, HeaderBarItemBits nBits,
- USHORT nPos )
+ sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
@@ -1289,7 +1288,6 @@ void HeaderBar::InsertItem( USHORT nItemId,
pItem->mnId = nItemId;
pItem->mnBits = nBits;
pItem->mnSize = nSize;
- pItem->mnHelpId = 0;
pItem->maImage = rImage;
pItem->maText = rText;
pItem->mpUserData = 0;
@@ -1302,14 +1300,14 @@ void HeaderBar::InsertItem( USHORT nItemId,
}
// Ausgabe updaten
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
// -----------------------------------------------------------------------
-void HeaderBar::RemoveItem( USHORT nItemId )
+void HeaderBar::RemoveItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
if ( nPos < mpItemList->size() ) {
@@ -1318,15 +1316,14 @@ void HeaderBar::RemoveItem( USHORT nItemId )
delete *it;
mpItemList->erase( it );
}
- ImplUpdate( nPos, TRUE );
}
}
// -----------------------------------------------------------------------
-void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos )
+void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
if ( nPos != nNewPos )
@@ -1340,7 +1337,6 @@ void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos )
it = mpItemList->begin();
::std::advance( it, nPos );
mpItemList->insert( it, pItem );
- ImplUpdate( nPos, TRUE );
}
}
}
@@ -1355,7 +1351,7 @@ void HeaderBar::Clear()
}
mpItemList->clear();
- ImplUpdate( 0, TRUE );
+ ImplUpdate( 0, sal_True );
}
// -----------------------------------------------------------------------
@@ -1371,26 +1367,26 @@ void HeaderBar::SetOffset( long nNewOffset )
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemCount() const
+sal_uInt16 HeaderBar::GetItemCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemPos( USHORT nItemId ) const
+sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
ImplHeadItem* pItem = (*mpItemList)[ i ];
if ( pItem->mnId == nItemId )
- return (USHORT)i;
+ return (sal_uInt16)i;
}
return HEADERBAR_ITEM_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemId( USHORT nPos ) const
+sal_uInt16 HeaderBar::GetItemId( sal_uInt16 nPos ) const
{
ImplHeadItem* pItem = (nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL;
if ( pItem )
@@ -1401,7 +1397,7 @@ USHORT HeaderBar::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT HeaderBar::GetItemId( const Point& rPos ) const
+sal_uInt16 HeaderBar::GetItemId( const Point& rPos ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( ImplGetItemRect( i ).IsInside( rPos ) ) {
@@ -1413,10 +1409,10 @@ USHORT HeaderBar::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const
+Rectangle HeaderBar::GetItemRect( sal_uInt16 nItemId ) const
{
Rectangle aRect;
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
aRect = ImplGetItemRect( nPos );
return aRect;
@@ -1424,25 +1420,25 @@ Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemSize( USHORT nItemId, long nNewSize )
+void HeaderBar::SetItemSize( sal_uInt16 nItemId, long nNewSize )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mnSize != nNewSize )
{
pItem->mnSize = nNewSize;
- ImplUpdate( nPos, TRUE );
+ ImplUpdate( nPos, sal_True );
}
}
}
// -----------------------------------------------------------------------
-long HeaderBar::GetItemSize( USHORT nItemId ) const
+long HeaderBar::GetItemSize( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnSize;
else
@@ -1451,9 +1447,9 @@ long HeaderBar::GetItemSize( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits )
+void HeaderBar::SetItemBits( sal_uInt16 nItemId, HeaderBarItemBits nNewBits )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
@@ -1467,9 +1463,9 @@ void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits )
// -----------------------------------------------------------------------
-HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const
+HeaderBarItemBits HeaderBar::GetItemBits( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnBits;
else
@@ -1478,9 +1474,9 @@ HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemData( USHORT nItemId, void* pNewData )
+void HeaderBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->mpUserData = pNewData;
@@ -1490,9 +1486,9 @@ void HeaderBar::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* HeaderBar::GetItemData( USHORT nItemId ) const
+void* HeaderBar::GetItemData( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mpUserData;
else
@@ -1501,9 +1497,9 @@ void* HeaderBar::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage )
+void HeaderBar::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->maImage = rImage;
@@ -1513,9 +1509,9 @@ void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage )
// -----------------------------------------------------------------------
-Image HeaderBar::GetItemImage( USHORT nItemId ) const
+Image HeaderBar::GetItemImage( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maImage;
else
@@ -1524,9 +1520,9 @@ Image HeaderBar::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText )
+void HeaderBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
(*mpItemList)[ nPos ]->maText = rText;
@@ -1536,9 +1532,9 @@ void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString HeaderBar::GetItemText( USHORT nItemId ) const
+XubString HeaderBar::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maText;
else
@@ -1547,26 +1543,26 @@ XubString HeaderBar::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpText( USHORT nItemId, const XubString& rText )
+void HeaderBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
}
// -----------------------------------------------------------------------
-XubString HeaderBar::GetHelpText( USHORT nItemId ) const
+XubString HeaderBar::GetHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
{
ImplHeadItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -1577,22 +1573,22 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void HeaderBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG HeaderBar::GetHelpId( USHORT nItemId ) const
+rtl::OString HeaderBar::GetHelpId( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != HEADERBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx
index 4bc40eb8edeb..a62320ce99ac 100644
--- a/svtools/source/control/indexentryres.cxx
+++ b/svtools/source/control/indexentryres.cxx
@@ -31,9 +31,7 @@
#include "precompiled_svtools.hxx"
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-
-
-#include <indexentryres.hxx>
+#include <svtools/indexentryres.hxx>
// -------------------------------------------------------------------------
//
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 6d1cd75c4f74..0dcb4fb4ce23 100644..100755
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -34,7 +34,6 @@
#include <sys/types.h>
#endif
-
#include <svtools/inettbc.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
@@ -42,16 +41,13 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-
-#include <com/sun/star/task/XInteractionHandler.hdl>
+#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
-
#include <comphelper/processfactory.hxx>
-
#include <vcl/toolbox.hxx>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
@@ -69,9 +65,8 @@
#include <ucbhelper/content.hxx>
#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
-
#include "iodlg.hrc"
-#include <asynclink.hxx>
+#include <svtools/asynclink.hxx>
#include <svl/urlfilter.hxx>
#include <vector>
@@ -122,17 +117,17 @@ class SvtMatchContext_Impl : public ::osl::Thread
String aBaseURL;
String aText;
SvtURLBox* pBox;
- BOOL bStop;
- BOOL bOnlyDirectories;
- BOOL bNoSelection;
+ sal_Bool bStop;
+ sal_Bool bOnlyDirectories;
+ sal_Bool bNoSelection;
DECL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void* );
virtual void SAL_CALL onTerminated( );
virtual void SAL_CALL run();
virtual void SAL_CALL Cancel();
- void Insert( const String& rCompletion, const String& rURL, BOOL bForce = FALSE);
- void ReadFolder( const String& rURL, const String& rMatch, BOOL bSmart );
+ void Insert( const String& rCompletion, const String& rURL, sal_Bool bForce = sal_False);
+ void ReadFolder( const String& rURL, const String& rMatch, sal_Bool bSmart );
void FillPicklist( SvStringsDtor& rPickList );
public:
@@ -158,9 +153,9 @@ SvtMatchContext_Impl::SvtMatchContext_Impl(
SvtURLBox* pBoxP, const String& rText )
: aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) )
, aBaseURL( pBoxP->aBaseURL )
- , aText( rText )
+ , aText( rText )
, pBox( pBoxP )
- , bStop( FALSE )
+ , bStop( sal_False )
, bOnlyDirectories( pBoxP->bOnlyDirectories )
, bNoSelection( pBoxP->bNoSelection )
{
@@ -205,7 +200,7 @@ void SvtMatchContext_Impl::FillPicklist( SvStringsDtor& rPickList )
seqPropertySet[nProperty].Value >>= sTitle;
aURL.SetURL( sTitle );
const StringPtr pStr = new String( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
- rPickList.Insert( pStr, (USHORT) nItem );
+ rPickList.Insert( pStr, (sal_uInt16) nItem );
break;
}
}
@@ -222,7 +217,7 @@ void SAL_CALL SvtMatchContext_Impl::Cancel()
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::Stop()
{
- bStop = TRUE;
+ bStop = sal_True;
if( isRunning() )
terminate();
@@ -252,7 +247,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
}
SvtURLBox* pBox = pThis->pBox;
- pBox->bAutoCompleteMode = TRUE;
+ pBox->bAutoCompleteMode = sal_True;
// did we filter completions which otherwise would have been valid?
// (to be filled below)
@@ -261,7 +256,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
// insert all completed strings into the listbox
pBox->Clear();
- for( USHORT nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ )
+ for( sal_uInt16 nPos = 0; nPos<pThis->pCompletions->Count(); nPos++ )
{
String sCompletion( *(*pThis->pCompletions)[nPos] );
@@ -331,12 +326,12 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, )
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::Insert( const String& rCompletion,
const String& rURL,
- BOOL bForce )
+ sal_Bool bForce )
{
if( !bForce )
{
// avoid doubles
- for( USHORT nPos = pCompletions->Count(); nPos--; )
+ for( sal_uInt16 nPos = pCompletions->Count(); nPos--; )
if( *(*pCompletions)[ nPos ] == rCompletion )
return;
}
@@ -350,7 +345,7 @@ void SvtMatchContext_Impl::Insert( const String& rCompletion,
//-------------------------------------------------------------------------
void SvtMatchContext_Impl::ReadFolder( const String& rURL,
const String& rMatch,
- BOOL bSmart )
+ sal_Bool bSmart )
{
// check folder to scan
if( !UCBContentHelper::IsFolder( rURL ) )
@@ -375,7 +370,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
String aNewText( aText );
aNewText += '/';
- Insert( aNewText, rURL, TRUE );
+ Insert( aNewText, rURL, sal_True );
return;
}
@@ -419,7 +414,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
uno::Reference< XDynamicResultSet > xDynResultSet;
ResultSetInclude eInclude = INCLUDE_FOLDERS_AND_DOCUMENTS;
if ( bOnlyDirectories )
- eInclude = INCLUDE_FOLDERS_ONLY;
+ eInclude = INCLUDE_FOLDERS_ONLY;
xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude );
@@ -501,7 +496,7 @@ void SvtMatchContext_Impl::ReadFolder( const String& rURL,
if ( bIsFolder )
aInput += aDelimiter;
- Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), TRUE );
+ Insert( aInput, aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True );
}
}
}
@@ -570,7 +565,7 @@ String SvtURLBox::ParseSmart( String aText, String aBaseURL, String aWorkDir )
aObj.setFinalSlash();
// take base URL and append current input
- bool bWasAbsolute = FALSE;
+ bool bWasAbsolute = sal_False;
#ifdef UNX
// don't support FSYS_MAC under Unix, because here ':' is a valid character for a filename
INetURLObject::FSysStyle eStyle = static_cast< INetURLObject::FSysStyle >( INetURLObject::FSYS_VOS | INetURLObject::FSYS_UNX | INetURLObject::FSYS_DOS );
@@ -611,7 +606,7 @@ void SvtMatchContext_Impl::run()
pURLs->Remove( 0, pURLs->Count() );
// check for input
- USHORT nTextLen = aText.Len();
+ sal_uInt16 nTextLen = aText.Len();
if ( !nTextLen )
return;
@@ -647,7 +642,7 @@ void SvtMatchContext_Impl::run()
{
// if text input is a directory, it must be part of the match list! Until then it is scanned
if ( UCBContentHelper::IsFolder( aMainURL ) && aURLObject.hasFinalSlash() )
- Insert( aText, aMatch );
+ Insert( aText, aMatch );
else
// otherwise the parent folder will be taken
aURLObject.removeSegment();
@@ -663,7 +658,7 @@ void SvtMatchContext_Impl::run()
// don't scan history picklist if only directories are allowed, picklist contains only files
return;
- BOOL bFull = FALSE;
+ sal_Bool bFull = sal_False;
int nCount = aPickList.Count();
INetURLObject aCurObj;
@@ -672,11 +667,12 @@ void SvtMatchContext_Impl::run()
aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt );
for( ;; )
{
- for( USHORT nPos = 0; schedule() && nPos < nCount; nPos++ )
+ for( sal_uInt16 nPos = 0; schedule() && nPos < nCount; nPos++ )
{
aCurObj.SetURL( *aPickList.GetObject( nPos ) );
aCurObj.SetSmartURL( aCurObj.GetURLNoPass());
aCurMainURL = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
+
if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt )
continue;
@@ -701,7 +697,7 @@ void SvtMatchContext_Impl::run()
{
// try if text matches the scheme
String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
- if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
+ if ( aText.CompareIgnoreCaseToAscii( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -720,7 +716,7 @@ void SvtMatchContext_Impl::run()
aCurString.Erase( 0, aScheme.Len() );
}
- if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL )
+ if( aText.CompareIgnoreCaseToAscii( aCurString, aText.Len() )== COMPARE_EQUAL )
{
if( bFull )
aMatch = aCurObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -761,7 +757,7 @@ void SvtMatchContext_Impl::run()
}
if( !bFull )
- bFull = TRUE;
+ bFull = sal_True;
else
break;
}
@@ -772,7 +768,7 @@ void SvtMatchContext_Impl::run()
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
-void SvtURLBox::TryAutoComplete( BOOL bForce )
+void SvtURLBox::TryAutoComplete( sal_Bool bForce )
{
if( Application::AnyInput( INPUT_KEYBOARD ) ) return;
@@ -781,7 +777,7 @@ void SvtURLBox::TryAutoComplete( BOOL bForce )
Selection aSelection( GetSelection() );
if( aSelection.Max() != aCurText.Len() && !bForce )
return;
- USHORT nLen = (USHORT)aSelection.Min();
+ sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
aCurText.Erase( nLen );
if( aCurText.Len() && bIsAutoCompleteEnabled )
{
@@ -799,13 +795,13 @@ SvtURLBox::SvtURLBox( Window* pParent, INetProtocol eSmart )
: ComboBox( pParent , WB_DROPDOWN | WB_AUTOSIZE | WB_AUTOHSCROLL ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
@@ -820,13 +816,13 @@ SvtURLBox::SvtURLBox( Window* pParent, WinBits _nStyle, INetProtocol eSmart )
: ComboBox( pParent, _nStyle ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
}
@@ -836,13 +832,13 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
: ComboBox( pParent , _rResId ),
pCtx( 0 ),
eSmartProtocol( eSmart ),
- bAutoCompleteMode( FALSE ),
- bOnlyDirectories( FALSE ),
- bTryAutoComplete( FALSE ),
- bCtrlClick( FALSE ),
- bHistoryDisabled( FALSE ),
- bNoSelection( FALSE ),
- bIsAutoCompleteEnabled( TRUE )
+ bAutoCompleteMode( sal_False ),
+ bOnlyDirectories( sal_False ),
+ bTryAutoComplete( sal_False ),
+ bCtrlClick( sal_False ),
+ bHistoryDisabled( sal_False ),
+ bNoSelection( sal_False ),
+ bIsAutoCompleteEnabled( sal_True )
{
ImplInit();
}
@@ -851,8 +847,10 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart
void SvtURLBox::ImplInit()
{
pImp = new SvtURLBox_Impl();
- SetHelpId( SID_OPENURL );
- EnableAutocomplete( FALSE );
+
+ if ( GetHelpId().getLength() == 0 )
+ SetHelpId( ".uno:OpenURL" );
+ EnableAutocomplete( sal_False );
SetText( String() );
@@ -934,7 +932,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
if ( aURL.Len() && ( !pImp->pUrlFilter || pImp->pUrlFilter->isUrlAllowed( aURL ) ) )
{
- BOOL bFound = (aURL.GetChar(aURL.Len()-1) == '/' );
+ sal_Bool bFound = (aURL.GetChar(aURL.Len()-1) == '/' );
if ( !bFound )
{
String aUpperURL( aURL );
@@ -964,7 +962,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
}
//-------------------------------------------------------------------------
-BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
+sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey )
{
// every key input stops the current matching thread
if( pCtx )
@@ -982,7 +980,7 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
if ( bAutoCompleteMode )
{
// reset picklist
- bAutoCompleteMode = FALSE;
+ bAutoCompleteMode = sal_False;
Selection aSelection( GetSelection() );
SetSelection( Selection( aSelection.Min(), aSelection.Min() ) );
if ( bOnlyDirectories )
@@ -993,19 +991,19 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
}
bCtrlClick = rKey.IsMod1();
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if ( GetOpenHdl().IsSet() )
{
- bHandled = TRUE;
+ bHandled = sal_True;
GetOpenHdl().Call(this);
}
else if ( GetSelectHdl().IsSet() )
{
- bHandled = TRUE;
+ bHandled = sal_True;
GetSelectHdl().Call(this);
}
- bCtrlClick = FALSE;
+ bCtrlClick = sal_False;
ClearModifyFlag();
return bHandled;
@@ -1013,9 +1011,9 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() )
{
// for file dialog
- bAutoCompleteMode = FALSE;
+ bAutoCompleteMode = sal_False;
GetOpenHdl().Call(this);
- return TRUE;
+ return sal_True;
}
else if( aCode == KEY_ESCAPE )
{
@@ -1031,15 +1029,15 @@ BOOL SvtURLBox::ProcessKey( const KeyCode& rKey )
}
else
{
- return FALSE;
+ return sal_False;
}
- bAutoCompleteMode = FALSE;
- return TRUE;
+ bAutoCompleteMode = sal_False;
+ return sal_True;
}
else
{
- return FALSE;
+ return sal_False;
}
}
@@ -1060,15 +1058,15 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt )
KeyCode aCode( rKey.GetCode() );
if( ProcessKey( rKey ) )
{
- return TRUE;
+ return sal_True;
}
else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
{
Selection aSelection( GetSelection() );
- USHORT nLen = (USHORT)aSelection.Min();
+ sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
GetSubEdit()->KeyInput( rEvent );
SetSelection( Selection( nLen, GetText().Len() ) );
- return TRUE;
+ return sal_True;
}
if ( MatchesPlaceHolder( GetText() ) )
@@ -1087,7 +1085,7 @@ IMPL_LINK( SvtURLBox, AutoCompleteHdl_Impl, void*, EMPTYARG )
{
if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT )
{
- TryAutoComplete( FALSE );
+ TryAutoComplete( sal_False );
return 1L;
}
@@ -1126,7 +1124,7 @@ void SvtURLBox::Select()
}
//-------------------------------------------------------------------------
-void SvtURLBox::SetOnlyDirectories( BOOL bDir )
+void SvtURLBox::SetOnlyDirectories( sal_Bool bDir )
{
bOnlyDirectories = bDir;
if ( bOnlyDirectories )
@@ -1134,7 +1132,7 @@ void SvtURLBox::SetOnlyDirectories( BOOL bDir )
}
//-------------------------------------------------------------------------
-void SvtURLBox::SetNoURLSelection( BOOL bSet )
+void SvtURLBox::SetNoURLSelection( sal_Bool bSet )
{
bNoSelection = bSet;
}
@@ -1151,7 +1149,7 @@ String SvtURLBox::GetURL()
// try to get the right case preserving URL from the list of URLs
if ( pImp->pCompletions && pImp->pURLs )
{
- for( USHORT nPos=0; nPos<pImp->pCompletions->Count(); nPos++ )
+ for( sal_uInt16 nPos=0; nPos<pImp->pCompletions->Count(); nPos++ )
{
#ifdef DBG_UTIL
String aTmp( *(*pImp->pCompletions)[ nPos ] );
@@ -1232,7 +1230,7 @@ String SvtURLBox::GetURL()
//-------------------------------------------------------------------------
void SvtURLBox::DisableHistory()
{
- bHistoryDisabled = TRUE;
+ bHistoryDisabled = sal_True;
UpdatePicklistForSmartProtocol_Impl();
}
@@ -1307,7 +1305,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
return sal_False; // no such user
#else
pPasswd = getpwnam( OUStringToOString( OUString( aUserName ), RTL_TEXTENCODING_ASCII_US ).getStr() );
- if( pPasswd )
+ if( pPasswd )
aParseTilde = String::CreateFromAscii( pPasswd->pw_dir );
else
return sal_False; // no such user
diff --git a/svtools/source/control/makefile.mk b/svtools/source/control/makefile.mk
deleted file mode 100755
index b855501e1133..000000000000
--- a/svtools/source/control/makefile.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=ctrl
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- ctrltool.src \
- ctrlbox.src \
- calendar.src \
- filectrl.src
-
-EXCEPTIONSFILES=\
- $(SLO)$/asynclink.obj \
- $(SLO)$/calendar.obj \
- $(SLO)$/ctrlbox.obj \
- $(SLO)$/ctrltool.obj \
- $(SLO)$/filectrl.obj \
- $(SLO)$/filectrl2.obj \
- $(SLO)$/fileurlbox.obj \
- $(SLO)$/fixedhyper.obj \
- $(SLO)$/fmtfield.obj \
- $(SLO)$/headbar.obj \
- $(SLO)$/hyperlabel.obj \
- $(SLO)$/inettbc.obj \
- $(SLO)$/prgsbar.obj \
- $(SLO)$/roadmap.obj \
- $(SLO)$/ruler.obj \
- $(SLO)$/scriptedtext.obj \
- $(SLO)$/scrwin.obj \
- $(SLO)$/stdctrl.obj \
- $(SLO)$/stdmenu.obj \
- $(SLO)$/svxbox.obj \
- $(SLO)$/tabbar.obj \
- $(SLO)$/taskbar.obj \
- $(SLO)$/taskbox.obj \
- $(SLO)$/taskmisc.obj \
- $(SLO)$/taskstat.obj \
- $(SLO)$/toolbarmenu.obj \
- $(SLO)$/toolbarmenuacc.obj \
- $(SLO)$/urlcontrol.obj \
- $(SLO)$/valueacc.obj \
- $(SLO)$/valueset.obj
-
-SLOFILES=\
- $(EXCEPTIONSFILES) \
- $(SLO)$/collatorres.obj \
- $(SLO)$/indexentryres.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx
index 500a3a5c4227..b8df51152bbe 100644..100755
--- a/svtools/source/control/prgsbar.cxx
+++ b/svtools/source/control/prgsbar.cxx
@@ -33,7 +33,7 @@
#include <tools/debug.hxx>
#include <vcl/status.hxx>
-#include <prgsbar.hxx>
+#include <svtools/prgsbar.hxx>
// =======================================================================
@@ -45,9 +45,9 @@
void ProgressBar::ImplInit()
{
mnPercent = 0;
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
static WinBits clearProgressBarBorder( Window* pParent, WinBits nOrgStyle )
@@ -86,8 +86,8 @@ ProgressBar::~ProgressBar()
// -----------------------------------------------------------------------
-void ProgressBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ProgressBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -109,8 +109,8 @@ void ProgressBar::ImplInitSettings( BOOL bFont,
{
if( (GetStyle() & WB_BORDER) )
SetBorderStyle( WINDOW_BORDER_REMOVEBORDER );
- EnableChildTransparentMode( TRUE );
- SetPaintTransparent( TRUE );
+ EnableChildTransparentMode( sal_True );
+ SetPaintTransparent( sal_True );
SetBackground();
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
}
@@ -148,18 +148,18 @@ void ProgressBar::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
-void ProgressBar::ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc )
+void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
{
if ( mbCalcNew )
{
- mbCalcNew = FALSE;
+ mbCalcNew = sal_False;
Size aSize = GetOutputSizePixel();
mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2);
mnPrgsWidth = (mnPrgsHeight*2)/3;
maPos.Y() = PROGRESSBAR_WIN_OFFSET;
long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET);
- USHORT nMaxCount = (USHORT)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
+ sal_uInt16 nMaxCount = (sal_uInt16)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
if ( nMaxCount <= 1 )
nMaxCount = 1;
else
@@ -188,20 +188,20 @@ void ProgressBar::Paint( const Rectangle& )
void ProgressBar::Resize()
{
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
if ( IsReallyVisible() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ProgressBar::SetValue( USHORT nNewPercent )
+void ProgressBar::SetValue( sal_uInt16 nNewPercent )
{
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
if ( nNewPercent < mnPercent )
{
- mbCalcNew = TRUE;
+ mbCalcNew = sal_True;
mnPercent = nNewPercent;
if ( IsReallyVisible() )
{
@@ -224,19 +224,19 @@ void ProgressBar::StateChanged( StateChangedType nType )
if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else
*/
if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
@@ -250,7 +250,7 @@ void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index 90952d7c0ce4..14f8446e2ecb 100644..100755
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -28,14 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <roadmap.hxx>
+#include <svtools/roadmap.hxx>
#ifndef _STRING_HXX
#define _STRING_HXX
#endif
#include <vector>
-
#include <algorithm>
#include <vcl/bitmap.hxx>
#include <tools/color.hxx>
@@ -123,9 +122,9 @@ namespace svt
void SetClickHdl( const Link& rLink );
const Link& GetClickHdl() const;
- void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags );
- void Enable( BOOL bEnable = TRUE);
- BOOL IsEnabled() const;
+ void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags );
+ void Enable( sal_Bool bEnable = sal_True);
+ sal_Bool IsEnabled() const;
void GrabFocus();
bool Contains( const Window* _pWindow ) const;
@@ -887,7 +886,7 @@ namespace svt
}
//---------------------------------------------------------------------
- void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags )
+ void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, sal_uInt16 nFlags )
{
if (pRefRoadmapHyperLabel == NULL)
mpDescription->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST );
@@ -896,14 +895,14 @@ namespace svt
}
//---------------------------------------------------------------------
- void RoadmapItem::Enable( BOOL _bEnable)
+ void RoadmapItem::Enable( sal_Bool _bEnable)
{
mpID->Enable(_bEnable);
mpDescription->Enable(_bEnable);
}
//---------------------------------------------------------------------
- BOOL RoadmapItem::IsEnabled() const
+ sal_Bool RoadmapItem::IsEnabled() const
{
return mpID->IsEnabled();
}
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 73e59373ea19..51e4fed41eb1 100644..100755
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -33,11 +33,10 @@
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <tools/poly.hxx>
-
#include <vcl/i18nhelp.hxx>
#define _SV_RULER_CXX
-#include <ruler.hxx>
+#include <svtools/ruler.hxx>
// =======================================================================
@@ -107,15 +106,15 @@ private:
long nNullOff;
long nMargin1;
long nMargin2;
- USHORT nLines;
- USHORT nArrows;
- USHORT nBorders;
- USHORT nIndents;
- USHORT nTabs;
- USHORT nMargin1Style;
- USHORT nMargin2Style;
- BOOL bAutoPageWidth;
- BOOL bTextRTL;
+ sal_uInt16 nLines;
+ sal_uInt16 nArrows;
+ sal_uInt16 nBorders;
+ sal_uInt16 nIndents;
+ sal_uInt16 nTabs;
+ sal_uInt16 nMargin1Style;
+ sal_uInt16 nMargin2Style;
+ sal_Bool bAutoPageWidth;
+ sal_Bool bTextRTL;
#ifdef _SV_RULER_CXX
public:
@@ -134,7 +133,7 @@ struct ImplRulerUnitData
long nTick2; // Tick fuer halbe Werte
long nTick3; // Tick fuer Zahlenausgabe
long n100THMM; // Teiler fuer Einheit
- USHORT nUnitDigits; // Anzahl Nachkommastellen
+ sal_uInt16 nUnitDigits; // Anzahl Nachkommastellen
sal_Char aUnitStr[8]; // Einheiten-String
};
@@ -159,13 +158,13 @@ struct ImplRulerHitTest
{
long nPos;
RulerType eType;
- USHORT nAryPos;
- USHORT mnDragSize;
- BOOL bSize;
- BOOL bSizeBar;
- BOOL bExpandTest;
+ sal_uInt16 nAryPos;
+ sal_uInt16 mnDragSize;
+ sal_Bool bSize;
+ sal_Bool bSizeBar;
+ sal_Bool bExpandTest;
ImplRulerHitTest() :
- bExpandTest( FALSE ) {}
+ bExpandTest( sal_False ) {}
};
// =======================================================================
@@ -175,7 +174,7 @@ ImplRulerData::ImplRulerData()
memset( this, 0, sizeof( ImplRulerData ) );
// PageBreite == EditWinBreite
- bAutoPageWidth = TRUE;
+ bAutoPageWidth = sal_True;
}
// -----------------------------------------------------------------------
@@ -250,7 +249,7 @@ void Ruler::ImplInit( WinBits nWinBits )
// --- RTL --- no UI mirroring for horizontal rulers, because
// the document is also not mirrored
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
}
// Variablen initialisieren
@@ -274,13 +273,13 @@ void Ruler::ImplInit( WinBits nWinBits )
mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld
mnCharWidth = 371;
mnLineHeight = 551;
- mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden
- mbFormat = TRUE; // Muss neu ausgegeben werden
- mbDrag = FALSE; // Sind wir im Drag-Modus
- mbDragDelete = FALSE; // Wird Maus beim Draggen unten rausgezogen
- mbDragCanceled = FALSE; // Wurde Dragging abgebrochen
- mbAutoWinWidth = TRUE; // EditWinBreite == RulerBreite
- mbActive = TRUE; // Ist Lineal aktiv
+ mbCalc = sal_True; // Muessen Pagebreiten neu berechnet werden
+ mbFormat = sal_True; // Muss neu ausgegeben werden
+ mbDrag = sal_False; // Sind wir im Drag-Modus
+ mbDragDelete = sal_False; // Wird Maus beim Draggen unten rausgezogen
+ mbDragCanceled = sal_False; // Wurde Dragging abgebrochen
+ mbAutoWinWidth = sal_True; // EditWinBreite == RulerBreite
+ mbActive = sal_True; // Ist Lineal aktiv
mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden
mpData = mpSaveData; // Wir zeigen auf die normalen Daten
meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird
@@ -304,7 +303,7 @@ void Ruler::ImplInit( WinBits nWinBits )
mnBorderWidth = 0;
// Einstellungen setzen
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
// Default-Groesse setzen
long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth;
@@ -314,6 +313,7 @@ void Ruler::ImplInit( WinBits nWinBits )
else
aDefSize.Width() = nDefHeight;
SetOutputSizePixel( aDefSize );
+ SetType(WINDOW_RULER);
}
// -----------------------------------------------------------------------
@@ -402,7 +402,7 @@ void Ruler::ImplVDrawText( long nX, long nY, const String& rText )
// -----------------------------------------------------------------------
-void Ruler::ImplInvertLines( BOOL bErase )
+void Ruler::ImplInvertLines( sal_Bool bErase )
{
// Positionslinien
if ( mpData->nLines && mbActive && !mbDrag && !mbFormat &&
@@ -422,7 +422,7 @@ void Ruler::ImplInvertLines( BOOL bErase )
aRect.Right() = nY;
// Linien ausgeben
- for ( USHORT i = 0; i < mpData->nLines; i++ )
+ for ( sal_uInt16 i = 0; i < mpData->nLines; i++ )
{
n = mpData->pLines[i].nPos+nNullWinOff;
if ( (n >= nRulX1) && (n < nRulX2) )
@@ -474,7 +474,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
long nTickWidth;
long nX;
long nY;
- BOOL bNoTicks = FALSE;
+ sal_Bool bNoTicks = sal_False;
//Amelia
long nTickUnit = 0;
@@ -500,7 +500,8 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
// Groessenvorberechnung
- BOOL bVertRight = FALSE;
+ // Sizes calculation
+ sal_Bool bVertRight = sal_False;
if ( mnWinStyle & WB_HORZ )
nTickWidth = aPixSize.Width();
else
@@ -509,7 +510,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
if ( mnWinStyle & WB_RIGHT_ALIGNED )
{
aFont.SetOrientation( 2700 );
- bVertRight = TRUE;
+ bVertRight = sal_True;
}
else
aFont.SetOrientation( 900 );
@@ -518,7 +519,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
if ( nMaxWidth < 0 )
- nMaxWidth *= -1;
+ nMaxWidth = -nMaxWidth;
// Amelia
if (( mnUnitIndex == RULER_UNIT_CHAR ) || ( mnUnitIndex == RULER_UNIT_LINE ))
nMaxWidth /= nTickUnit;
@@ -535,7 +536,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
while ( nTickWidth < nTxtWidth+nTextOff )
{
long nOldMulti = nMulti;
- if ( !nTickWidth )
+ if ( !nTickWidth ) //If nTickWidth equals 0
nMulti *= 10;
else if ( nMulti < 10 )
nMulti++;
@@ -550,7 +551,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
// koennen
if ( nMulti < nOldMulti )
{
- bNoTicks = TRUE;
+ bNoTicks = sal_True;
break;
}
@@ -657,7 +658,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
}
}
// #i49017# with some zoom factors the value nTick can overflow
- if( ((ULONG)nTick + (ULONG)nTickCount) > (ULONG)LONG_MAX)
+ if( ((sal_uLong)nTick + (sal_uLong)nTickCount) > (sal_uLong)LONG_MAX)
break;
nTick += nTickCount;
}
@@ -668,7 +669,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
void Ruler::ImplDrawArrows( long nCenter )
{
- USHORT i;
+ sal_uInt16 i;
long n1;
long n2;
long n3;
@@ -676,7 +677,7 @@ void Ruler::ImplDrawArrows( long nCenter )
long nLogWidth;
String aStr;
String aStr2;
- BOOL bDrawUnit;
+ sal_Bool bDrawUnit;
long nTxtWidth;
long nTxtHeight2 = GetTextHeight()/2;
@@ -701,14 +702,14 @@ void Ruler::ImplDrawArrows( long nCenter )
nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000;
else
nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM;
- aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, TRUE, FALSE );
+ aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False );
// Einheit an den String haengen
aStr2 = aStr;
aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr );
// Textbreite ermitteln
- bDrawUnit = TRUE;
+ bDrawUnit = sal_True;
nTxtWidth = GetTextWidth( aStr2 );
if ( nTxtWidth < mpData->pArrows[i].nWidth-10 )
aStr = aStr2;
@@ -716,7 +717,7 @@ void Ruler::ImplDrawArrows( long nCenter )
{
nTxtWidth = GetTextWidth( aStr );
if ( nTxtWidth > mpData->pArrows[i].nWidth-10 )
- bDrawUnit = FALSE;
+ bDrawUnit = sal_False;
}
// Ist genuegen Platz fuer Einheiten-String vorhanden
@@ -760,7 +761,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
long n2;
long nTemp1;
long nTemp2;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpData->nBorders; i++ )
{
@@ -878,12 +879,12 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom
// -----------------------------------------------------------------------
-void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle )
+void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Point aPos1;
Point aPos2;
- USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+ sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE;
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
@@ -967,7 +968,7 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle )
void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom )
{
- USHORT j;
+ sal_uInt16 j;
long n;
long nIndentHeight = (mnVirHeight/2) - 1;
long nIndentWidth2 = nIndentHeight-3;
@@ -978,8 +979,8 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
if ( mpData->pIndents[j].nStyle & RULER_STYLE_INVISIBLE )
continue;
- USHORT nStyle = mpData->pIndents[j].nStyle;
- USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+ sal_uInt16 nStyle = mpData->pIndents[j].nStyle;
+ sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE;
n = mpData->pIndents[j].nPos+mpData->nNullVirOff;
@@ -1011,7 +1012,7 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
if(0 == (mnWinStyle & WB_HORZ))
{
Point aTmp;
- for(USHORT i = 0; i < 5; i++)
+ for(sal_uInt16 i = 0; i < 5; i++)
{
aTmp = aPoly[i];
Point aSet(nVirBottom - aTmp.Y(), aTmp.X());
@@ -1026,9 +1027,9 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom
// -----------------------------------------------------------------------
-static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle )
+static void ImplCenterTabPos( Point& rPos, sal_uInt16 nTabStyle )
{
- BOOL bRTL = 0 != (nTabStyle & RULER_TAB_RTL);
+ sal_Bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL);
nTabStyle &= RULER_TAB_STYLE;
rPos.Y() += RULER_TAB_HEIGHT/2;
if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT))
@@ -1038,7 +1039,7 @@ static void ImplCenterTabPos( Point& rPos, USHORT nTabStyle )
}
// -----------------------------------------------------------------------
-void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAligned)
+void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, sal_Bool bRightAligned)
{
if(!rRect.IsEmpty())
{
@@ -1058,13 +1059,13 @@ void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, BOOL bRightAli
// -----------------------------------------------------------------------
static void ImplDrawRulerTab( OutputDevice* pDevice,
- const Point& rPos, USHORT nStyle, WinBits nWinBits )
+ const Point& rPos, sal_uInt16 nStyle, WinBits nWinBits )
{
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
- USHORT nTabStyle = nStyle & RULER_TAB_STYLE;
- BOOL bRTL = 0 != (nStyle & RULER_TAB_RTL);
+ sal_uInt16 nTabStyle = nStyle & RULER_TAB_STYLE;
+ sal_Bool bRTL = 0 != (nStyle & RULER_TAB_RTL);
Rectangle aRect1, aRect2, aRect3;
aRect3.SetEmpty();
if ( nTabStyle == RULER_TAB_DEFAULT )
@@ -1122,7 +1123,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice,
}
if( 0 == (nWinBits&WB_HORZ) )
{
- BOOL bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED);
+ sal_Bool bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED);
lcl_RotateRect_Impl(aRect1, rPos.Y(), bRightAligned);
lcl_RotateRect_Impl(aRect2, rPos.Y(), bRightAligned);
lcl_RotateRect_Impl(aRect3, rPos.Y(), bRightAligned);
@@ -1136,7 +1137,7 @@ static void ImplDrawRulerTab( OutputDevice* pDevice,
// -----------------------------------------------------------------------
-void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle )
{
if ( nStyle & RULER_STYLE_INVISIBLE )
return;
@@ -1156,7 +1157,7 @@ void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle
void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom )
{
- for ( USHORT i = 0; i < mpData->nTabs; i++ )
+ for ( sal_uInt16 i = 0; i < mpData->nTabs; i++ )
{
if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE )
continue;
@@ -1172,8 +1173,8 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom )
// -----------------------------------------------------------------------
-void Ruler::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void Ruler::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1262,7 +1263,7 @@ void Ruler::ImplCalc()
mpData->nRulWidth = mnHeight-nRulWinOff;
}
- mbCalc = FALSE;
+ mbCalc = sal_False;
}
// -----------------------------------------------------------------------
@@ -1302,7 +1303,7 @@ void Ruler::ImplFormat()
return;
Size aVirDevSize;
- BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
+ sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
// initialize VirtualDevice
if ( mnWinStyle & WB_HORZ )
@@ -1316,7 +1317,7 @@ void Ruler::ImplFormat()
aVirDevSize.Width() = mnVirHeight;
}
if ( aVirDevSize != maVirDev.GetOutputSizePixel() )
- maVirDev.SetOutputSizePixel( aVirDevSize, TRUE );
+ maVirDev.SetOutputSizePixel( aVirDevSize, sal_True );
else
maVirDev.Erase();
@@ -1456,12 +1457,12 @@ void Ruler::ImplFormat()
ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) );
// Wir haben formatiert
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-void Ruler::ImplInitExtraField( BOOL bUpdate )
+void Ruler::ImplInitExtraField( sal_Bool bUpdate )
{
// Extra-Field beruecksichtigen
if ( mnWinStyle & WB_EXTRAFIELD )
@@ -1491,8 +1492,8 @@ void Ruler::ImplInitExtraField( BOOL bUpdate )
if ( bUpdate )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
Invalidate();
}
}
@@ -1530,17 +1531,17 @@ void Ruler::ImplDraw()
DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev );
// Positionslinien neu malen
- ImplInvertLines( TRUE );
+ ImplInvertLines( sal_True );
}
}
// -----------------------------------------------------------------------
-void Ruler::ImplDrawExtra( BOOL bPaint )
+void Ruler::ImplDrawExtra( sal_Bool bPaint )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aRect = maExtraRect;
- BOOL bEraseRect = FALSE;
+ sal_Bool bEraseRect = sal_False;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
@@ -1563,14 +1564,14 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
SetFillColor( rStyleSettings.GetFaceColor() );
else
SetFillColor( rStyleSettings.GetWindowColor() );
- bEraseRect = TRUE;
+ bEraseRect = sal_True;
}
else
{
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
{
SetFillColor( rStyleSettings.GetCheckedColor() );
- bEraseRect = TRUE;
+ bEraseRect = sal_True;
}
}
@@ -1594,7 +1595,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
}
else if ( meExtraType == RULER_EXTRA_TAB )
{
- USHORT nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
+ sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
if(mpData->bTextRTL)
nTabStyle |= RULER_TAB_RTL;
Point aCenter = aRect.Center();
@@ -1621,7 +1622,7 @@ void Ruler::ImplDrawExtra( BOOL bPaint )
// -----------------------------------------------------------------------
-void Ruler::ImplUpdate( BOOL bMustCalc )
+void Ruler::ImplUpdate( sal_Bool bMustCalc )
{
// Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon
// geloscht sind, da danach die alten Positionen nicht mehr bestimmt
@@ -1631,8 +1632,8 @@ void Ruler::ImplUpdate( BOOL bMustCalc )
// Flags setzen
if ( bMustCalc )
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
// Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch
// das Lineal neu upgedatet
@@ -1650,11 +1651,11 @@ void Ruler::ImplUpdate( BOOL bMustCalc )
// -----------------------------------------------------------------------
-BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
- BOOL bRequireStyle, USHORT nRequiredStyle ) const
+sal_Bool Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
+ sal_Bool bRequireStyle, sal_uInt16 nRequiredStyle ) const
{
- USHORT i;
- USHORT nStyle;
+ sal_uInt16 i;
+ sal_uInt16 nStyle;
long nHitBottom;
long nX;
long nY;
@@ -1662,10 +1663,10 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
long n2;
if ( !mbActive )
- return FALSE;
+ return sal_False;
// Position ermitteln
- BOOL bIsHori = 0 != (mnWinStyle & WB_HORZ);
+ sal_Bool bIsHori = 0 != (mnWinStyle & WB_HORZ);
if ( bIsHori )
{
nX = rPos.X();
@@ -1681,8 +1682,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
// --> FME 2004-08-05 #i32608#
pHitTest->nAryPos = 0;
pHitTest->mnDragSize = 0;
- pHitTest->bSize = FALSE;
- pHitTest->bSizeBar = FALSE;
+ pHitTest->bSize = sal_False;
+ pHitTest->bSizeBar = sal_False;
// <--
// Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden
@@ -1700,7 +1701,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->nPos = 0;
pHitTest->eType = RULER_TYPE_OUTSIDE;
- return FALSE;
+ return sal_False;
}
nX -= mpData->nNullVirOff;
@@ -1746,7 +1747,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_TAB;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
@@ -1787,7 +1788,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_INDENT;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
@@ -1798,7 +1799,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->nPos = 0;
pHitTest->eType = RULER_TYPE_OUTSIDE;
- return FALSE;
+ return sal_False;
}
// Danach die Spalten testen
@@ -1833,7 +1834,7 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
if ( nStyle & RULER_BORDER_MOVEABLE )
{
- pHitTest->bSizeBar = TRUE;
+ pHitTest->bSizeBar = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
}
}
@@ -1853,25 +1854,25 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( nX <= n1+nMOff )
{
- pHitTest->bSize = TRUE;
+ pHitTest->bSize = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_1;
}
else if ( nX >= n2-nMOff )
{
- pHitTest->bSize = TRUE;
+ pHitTest->bSize = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_2;
}
else
{
if ( nStyle & RULER_BORDER_MOVEABLE )
{
- pHitTest->bSizeBar = TRUE;
+ pHitTest->bSizeBar = sal_True;
pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
}
}
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -1885,8 +1886,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) )
{
pHitTest->eType = RULER_TYPE_MARGIN1;
- pHitTest->bSize = TRUE;
- return TRUE;
+ pHitTest->bSize = sal_True;
+ return sal_True;
}
}
if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE )
@@ -1895,8 +1896,8 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) )
{
pHitTest->eType = RULER_TYPE_MARGIN2;
- pHitTest->bSize = TRUE;
- return TRUE;
+ pHitTest->bSize = sal_True;
+ return sal_True;
}
}
@@ -1941,28 +1942,28 @@ BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest,
{
pHitTest->eType = RULER_TYPE_TAB;
pHitTest->nAryPos = i-1;
- return TRUE;
+ return sal_True;
}
}
}
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
+sal_Bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
ImplRulerHitTest* pHitTest ) const
{
Point aPos = rPos;
- BOOL bRequiredStyle = FALSE;
- USHORT nRequiredStyle = 0;
+ sal_Bool bRequiredStyle = sal_False;
+ sal_uInt16 nRequiredStyle = 0;
if (eDragType == RULER_TYPE_INDENT)
{
- bRequiredStyle = TRUE;
+ bRequiredStyle = sal_True;
nRequiredStyle = RULER_INDENT_BOTTOM;
}
@@ -1982,7 +1983,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
@@ -1998,7 +1999,7 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
@@ -2014,25 +2015,25 @@ BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
if ( ImplHitTest( aPos, pHitTest ) )
{
if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
- return TRUE;
+ return sal_True;
}
}
// Auf DontKnow setzen
pHitTest->eType = RULER_TYPE_DONTKNOW;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
+sal_Bool Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier )
{
// Wenn eine Spalte angeklick wurde, die weder verschiebar noch
// in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen
if ( (pHitTest->eType == RULER_TYPE_BORDER) &&
!pHitTest->bSize && !pHitTest->bSizeBar )
- return FALSE;
+ return sal_False;
// Dragdaten setzen
meDragType = pHitTest->eType;
@@ -2049,10 +2050,10 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
// Wenn der Handler das Draggen erlaubt, dann das Draggen
// initialisieren
ImplInvertLines();
- mbDrag = TRUE;
+ mbDrag = sal_True;
mnStartDragPos = mnDragPos;
StartTracking();
- return TRUE;
+ return sal_True;
}
else
{
@@ -2065,7 +2066,7 @@ BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
mpData = mpSaveData;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2104,18 +2105,18 @@ void Ruler::ImplDrag( const Point& rPos )
nX -= mpData->nNullVirOff;
// Wenn oberhalb oder links vom Lineal, dann alte Werte
- mbDragDelete = FALSE;
+ mbDragDelete = sal_False;
if ( nY < 0 )
{
if ( !mbDragCanceled )
{
// Daten wiederherstellen
- mbDragCanceled = TRUE;
+ mbDragCanceled = sal_True;
ImplRulerData aTempData;
aTempData = *mpDragData;
*mpDragData = *mpSaveData;
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
// Handler rufen
mnDragPos = mnStartDragPos;
@@ -2136,11 +2137,11 @@ void Ruler::ImplDrag( const Point& rPos )
}
else
{
- mbDragCanceled = FALSE;
+ mbDragCanceled = sal_False;
// +2, damit nicht so schnell die Tabs geloescht werden
if ( nY > nOutHeight+2 )
- mbDragDelete = TRUE;
+ mbDragDelete = sal_True;
mnDragPos = nX;
@@ -2165,7 +2166,7 @@ void Ruler::ImplEndDrag()
else
*mpSaveData = *mpDragData;
mpData = mpSaveData;
- mbDrag = FALSE;
+ mbDrag = sal_False;
// Handler rufen
EndDrag();
@@ -2175,8 +2176,8 @@ void Ruler::ImplEndDrag()
mnDragPos = 0;
mnDragAryPos = 0;
mnDragSize = 0;
- mbDragCanceled = FALSE;
- mbDragDelete = FALSE;
+ mbDragCanceled = sal_False;
+ mbDragDelete = sal_False;
mnDragModifier = 0;
mnDragScroll = 0;
mnStartDragPos = 0;
@@ -2213,8 +2214,8 @@ void Ruler::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && !IsTracking() )
{
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nMouseClicks = rMEvt.GetClicks();
- USHORT nMouseModifier = rMEvt.GetModifier();
+ sal_uInt16 nMouseClicks = rMEvt.GetClicks();
+ sal_uInt16 nMouseModifier = rMEvt.GetModifier();
// Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
// gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
@@ -2320,8 +2321,8 @@ void Ruler::Tracking( const TrackingEvent& rTEvt )
// Bei Abbruch, den alten Status wieder herstellen
if ( rTEvt.IsTrackingCanceled() )
{
- mbDragCanceled = TRUE;
- mbFormat = TRUE;
+ mbDragCanceled = sal_True;
+ mbFormat = sal_True;
}
ImplEndDrag();
@@ -2370,7 +2371,7 @@ void Ruler::Paint( const Rectangle& )
}
// Imhalt vom Extrafeld ausgeben
- ImplDrawExtra( TRUE );
+ ImplDrawExtra( sal_True );
}
if ( mnWinStyle & WB_BORDER )
@@ -2435,7 +2436,7 @@ void Ruler::Resize()
}
// Hier schon Linien loeschen
- BOOL bVisible = IsReallyVisible();
+ sal_Bool bVisible = IsReallyVisible();
if ( bVisible && mpData->nLines )
{
ImplInvertLines();
@@ -2443,7 +2444,7 @@ void Ruler::Resize()
if ( !mnUpdateEvtId )
mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte
// neu berechnet werden
@@ -2451,15 +2452,15 @@ void Ruler::Resize()
ImplInitExtraField( mpData->bTextRTL );
if ( nNewHeight )
{
- mbCalc = TRUE;
+ mbCalc = sal_True;
mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2);
}
else
{
if ( mpData->bAutoPageWidth )
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
else if ( mbAutoWinWidth )
- mbCalc = TRUE;
+ mbCalc = sal_True;
}
// Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen
@@ -2533,17 +2534,17 @@ void Ruler::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -2560,8 +2561,8 @@ void Ruler::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -2573,7 +2574,7 @@ long Ruler::StartDrag()
if ( maStartDragHdl.IsSet() )
return maStartDragHdl.Call( this );
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2615,9 +2616,9 @@ void Ruler::ExtraDown()
void Ruler::Activate()
{
- mbActive = TRUE;
+ mbActive = sal_True;
- // Positionslinien wieder anzeigen (erst hinter mbActive=TRUE rufen, da
+ // Positionslinien wieder anzeigen (erst hinter mbActive=sal_True rufen, da
// von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien
// wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand
// Linien gezeichnet werden.
@@ -2630,25 +2631,25 @@ void Ruler::Activate()
void Ruler::Deactivate()
{
- // Positionslinien loeschen (schon vor mbActive=FALSE rufen, da
+ // Positionslinien loeschen (schon vor mbActive=sal_False rufen, da
// von ImplInvertLines() ausgewertet wird)
ImplInvertLines();
- mbActive = FALSE;
+ mbActive = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
+sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
{
if ( !mbDrag )
{
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nMouseClicks = rMEvt.GetClicks();
- USHORT nMouseModifier = rMEvt.GetModifier();
+ sal_uInt16 nMouseClicks = rMEvt.GetClicks();
+ sal_uInt16 nMouseModifier = rMEvt.GetModifier();
ImplRulerHitTest aHitTest;
if(eDragType != RULER_TYPE_DONTKNOW)
- aHitTest.bExpandTest = TRUE;
+ aHitTest.bExpandTest = sal_True;
// Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
// gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
@@ -2697,17 +2698,17 @@ BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
mnDragPos = 0;
mnDragAryPos = 0;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType,
- USHORT* pAryPos ) const
+ sal_uInt16* pAryPos ) const
{
ImplRulerHitTest aHitTest;
@@ -2741,7 +2742,7 @@ void Ruler::CancelDrag()
// -----------------------------------------------------------------------
-RulerType Ruler::GetType( const Point& rPos, USHORT* pAryPos ) const
+RulerType Ruler::GetType( const Point& rPos, sal_uInt16* pAryPos ) const
{
ImplRulerHitTest aHitTest;
@@ -2768,14 +2769,14 @@ void Ruler::SetWinPos( long nNewOff, long nNewWidth )
{
// Gegebenenfalls werden die Breiten automatisch berechnet
if ( !nNewWidth )
- mbAutoWinWidth = TRUE;
+ mbAutoWinWidth = sal_True;
else
- mbAutoWinWidth = FALSE;
+ mbAutoWinWidth = sal_False;
// Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
mnWinOff = nNewOff;
mnWinWidth = nNewWidth;
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
}
// -----------------------------------------------------------------------
@@ -2788,14 +2789,14 @@ void Ruler::SetPagePos( long nNewOff, long nNewWidth )
// Gegebenenfalls werden die Breiten automatisch berechnet
if ( !nNewWidth )
- mpData->bAutoPageWidth = TRUE;
+ mpData->bAutoPageWidth = sal_True;
else
- mpData->bAutoPageWidth = FALSE;
+ mpData->bAutoPageWidth = sal_False;
// Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
mpData->nPageOff = nNewOff;
mpData->nPageWidth = nNewWidth;
- ImplUpdate( TRUE );
+ ImplUpdate( sal_True );
}
// -----------------------------------------------------------------------
@@ -2885,14 +2886,14 @@ void Ruler::SetZoom( const Fraction& rNewZoom )
// -----------------------------------------------------------------------
-void Ruler::SetExtraType( RulerExtra eNewExtraType, USHORT nStyle )
+void Ruler::SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle )
{
if ( mnWinStyle & WB_EXTRAFIELD )
{
meExtraType = eNewExtraType;
mnExtraStyle = nStyle;
if ( IsReallyVisible() && IsUpdateMode() )
- ImplDrawExtra( FALSE );
+ ImplDrawExtra( sal_False );
}
}
@@ -2909,7 +2910,7 @@ void Ruler::SetNullOffset( long nPos )
// -----------------------------------------------------------------------
-void Ruler::SetMargin1( long nPos, USHORT nMarginStyle )
+void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle )
{
if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) )
{
@@ -2921,7 +2922,7 @@ void Ruler::SetMargin1( long nPos, USHORT nMarginStyle )
// -----------------------------------------------------------------------
-void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
+void Ruler::SetMargin2( long nPos, sal_uInt16 nMarginStyle )
{
DBG_ASSERT( (nPos >= mpData->nMargin1) ||
(mpData->nMargin1Style & RULER_STYLE_INVISIBLE) ||
@@ -2938,12 +2939,12 @@ void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
// -----------------------------------------------------------------------
-void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
+void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry )
{
// To determine if what has changed
if ( mpData->nLines == n )
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerLine* pAry1 = mpData->pLines;
const RulerLine* pAry2 = pLineAry;
while ( i )
@@ -2960,11 +2961,11 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
}
// New values and new share issue
- BOOL bMustUpdate;
+ sal_Bool bMustUpdate;
if ( IsReallyVisible() && IsUpdateMode() )
- bMustUpdate = TRUE;
+ bMustUpdate = sal_True;
else
- bMustUpdate = FALSE;
+ bMustUpdate = sal_False;
// Delete old lines
if ( bMustUpdate )
@@ -2998,7 +2999,7 @@ void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
// -----------------------------------------------------------------------
-void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
+void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry )
{
if ( !n || !pArrowAry )
{
@@ -3018,7 +3019,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerArrow* pAry1 = mpData->pArrows;
const RulerArrow* pAry2 = pArrowAry;
while ( i )
@@ -3044,7 +3045,7 @@ void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
// -----------------------------------------------------------------------
-void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
+void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry )
{
if ( !n || !pBrdAry )
{
@@ -3064,7 +3065,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerBorder* pAry1 = mpData->pBorders;
const RulerBorder* pAry2 = pBrdAry;
while ( i )
@@ -3089,7 +3090,7 @@ void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
// -----------------------------------------------------------------------
-void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
+void Ruler::SetIndents( sal_uInt16 n, const RulerIndent* pIndentAry )
{
if ( !n || !pIndentAry )
@@ -3110,7 +3111,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerIndent* pAry1 = mpData->pIndents;
const RulerIndent* pAry2 = pIndentAry;
while ( i )
@@ -3134,7 +3135,7 @@ void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
// -----------------------------------------------------------------------
-void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry )
+void Ruler::SetTabs( sal_uInt16 n, const RulerTab* pTabAry )
{
if ( !n || !pTabAry )
{
@@ -3154,7 +3155,7 @@ void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry )
}
else
{
- USHORT i = n;
+ sal_uInt16 i = n;
const RulerTab* pAry1 = mpData->pTabs;
const RulerTab* pAry2 = pTabAry;
while ( i )
@@ -3183,17 +3184,17 @@ void Ruler::SetStyle( WinBits nStyle )
if ( mnWinStyle != nStyle )
{
mnWinStyle = nStyle;
- ImplInitExtraField( TRUE );
+ ImplInitExtraField( sal_True );
}
}
// -----------------------------------------------------------------------
-void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle )
{
/*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings();
Point aPos( rPos );
- USHORT nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
+ sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pDevice->SetLineColor();
@@ -3203,13 +3204,13 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
pDevice->Pop();
}
-void Ruler::SetTextRTL(BOOL bRTL)
+void Ruler::SetTextRTL(sal_Bool bRTL)
{
if(mpData->bTextRTL != bRTL)
{
mpData->bTextRTL = bRTL;
if ( IsReallyVisible() && IsUpdateMode() )
- ImplInitExtraField( TRUE );
+ ImplInitExtraField( sal_True );
}
}
@@ -3217,22 +3218,22 @@ long Ruler::GetPageOffset() const { return mpData->nPageOff; }
long Ruler::GetPageWidth() const { return mpData->nPageWidth; }
long Ruler::GetNullOffset() const { return mpData->nNullOff; }
long Ruler::GetMargin1() const { return mpData->nMargin1; }
-USHORT Ruler::GetMargin1Style() const { return mpData->nMargin1Style; }
+sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; }
long Ruler::GetMargin2() const { return mpData->nMargin2; }
-USHORT Ruler::GetMargin2Style() const { return mpData->nMargin2Style; }
-USHORT Ruler::GetLineCount() const { return mpData->nLines; }
+sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; }
+sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; }
const RulerLine* Ruler::GetLines() const { return mpData->pLines; }
-USHORT Ruler::GetArrowCount() const { return mpData->nArrows; }
+sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; }
const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; }
-USHORT Ruler::GetBorderCount() const { return mpData->nBorders; }
+sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; }
const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; }
-USHORT Ruler::GetIndentCount() const { return mpData->nIndents; }
+sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; }
const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; }
void Ruler::DrawTicks()
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index f311ddf67612..98f6c05ac0d7 100644..100755
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -28,8 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "scriptedtext.hxx"
-
+#include <svtools/scriptedtext.hxx>
#include <vector>
#include <rtl/ustring.hxx>
#include <vcl/outdev.hxx>
@@ -235,7 +234,7 @@ void SvtScriptedTextHelper_Impl::CalculateBreaks( const uno::Reference< i18n::XB
nScript = i18n::ScriptType::LATIN;
while( (nScript != i18n::ScriptType::WEAK) && (nCharIx == nNextCharIx) )
{
- nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< USHORT >(nCharIx), sal::static_int_cast< USHORT >(nNextPos - nCharIx) );
+ nNextCharIx = mrOutDevice.HasGlyphs( GetFont( nScript ), maText, sal::static_int_cast< sal_uInt16 >(nCharIx), sal::static_int_cast< sal_uInt16 >(nNextPos - nCharIx) );
if( nCharIx == nNextCharIx )
++nScript;
}
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index dc007438583b..4d937981bea9 100644..100755
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -30,16 +30,16 @@
#include "precompiled_svtools.hxx"
#define _SVT_SCRWIN_CXX
-#include <scrwin.hxx>
+#include <svtools/scrwin.hxx>
//===================================================================
void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags )
{
- bHandleDragging = (BOOL) ( nFlags & SCRWIN_THUMBDRAGGING );
+ bHandleDragging = (sal_Bool) ( nFlags & SCRWIN_THUMBDRAGGING );
bVCenter = (nFlags & SCRWIN_VCENTER) == SCRWIN_VCENTER;
bHCenter = (nFlags & SCRWIN_HCENTER) == SCRWIN_HCENTER;
- bScrolling = FALSE;
+ bScrolling = sal_False;
// set the handlers for the scrollbars
aVScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) );
@@ -140,7 +140,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll )
{
// notify the start of scrolling, if not already scrolling
if ( !bScrolling )
- StartScroll(), bScrolling = TRUE;
+ StartScroll(), bScrolling = sal_True;
// get the delta in logic coordinates
Size aDelta( PixelToLogic( Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) );
@@ -155,7 +155,7 @@ IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll )
}
// notify the end of scrolling
- bScrolling = FALSE;
+ bScrolling = sal_False;
EndScroll( aDelta.Width(), aDelta.Height() );
return 0;
}
@@ -166,7 +166,7 @@ IMPL_LINK( ScrollableWindow, ScrollHdl, ScrollBar *, pScroll )
{
// notify the start of scrolling, if not already scrolling
if ( !bScrolling )
- StartScroll(), bScrolling = TRUE;
+ StartScroll(), bScrolling = sal_True;
if ( bHandleDragging )
{
@@ -190,25 +190,25 @@ void ScrollableWindow::Resize()
// determine the size of the output-area and if we need scrollbars
const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
- BOOL bVVisible = FALSE; // by default no vertical-ScrollBar
- BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar
- BOOL bChanged; // determines if a visiblility was changed
+ sal_Bool bVVisible = sal_False; // by default no vertical-ScrollBar
+ sal_Bool bHVisible = sal_False; // by default no horizontal-ScrollBar
+ sal_Bool bChanged; // determines if a visiblility was changed
do
{
- bChanged = FALSE;
+ bChanged = sal_False;
// does we need a vertical ScrollBar
if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible )
- { bHVisible = TRUE;
+ { bHVisible = sal_True;
aOutPixSz.Height() -= nScrSize;
- bChanged = TRUE;
+ bChanged = sal_True;
}
// does we need a horizontal ScrollBar
if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible )
- { bVVisible = TRUE;
+ { bVVisible = sal_True;
aOutPixSz.Width() -= nScrSize;
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
@@ -356,10 +356,10 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize )
Window::GetOutputSizePixel().Height());
Size aWill( aWish.GetIntersection(aMax).GetSize() );
- BOOL bHScroll = FALSE;
+ sal_Bool bHScroll = sal_False;
const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
if ( aWill.Width() < aWish.GetSize().Width() )
- { bHScroll = TRUE;
+ { bHScroll = sal_True;
aWill.Height() =
Min( aWill.Height()+nScrSize, aMax.GetSize().Height() );
}
@@ -374,7 +374,7 @@ void ScrollableWindow::SetVisibleSize( const Size& rNewSize )
//-------------------------------------------------------------------
-BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy )
+sal_Bool ScrollableWindow::MakeVisible( const Rectangle& rTarget, sal_Bool bSloppy )
{
Rectangle aTarget;
Rectangle aTotRect( Point(0, 0), PixelToLogic( aTotPixSz ) );
@@ -437,7 +437,7 @@ BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy )
// is the area already visible?
Rectangle aVisArea( GetVisibleArea() );
if ( aVisArea.IsInside(rTarget) )
- return TRUE;
+ return sal_True;
// is there somewhat to scroll?
if ( aVisArea.TopLeft() != aTarget.TopLeft() )
@@ -466,7 +466,7 @@ Rectangle ScrollableWindow::GetVisibleArea() const
//-------------------------------------------------------------------
-void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert )
+void ScrollableWindow::SetLineSize( sal_uLong nHorz, sal_uLong nVert )
{
Size aPixSz( LogicToPixel( Size(nHorz, nVert) ) );
nColumnPixW = aPixSz.Width();
@@ -477,7 +477,7 @@ void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert )
//-------------------------------------------------------------------
-void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, USHORT )
+void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
{
if ( !bScrolling )
StartScroll();
@@ -562,8 +562,8 @@ void ScrollableWindow::ScrollLines( long nLinesX, long nLinesY )
//-------------------------------------------------------------------
-void ScrollableWindow::ScrollPages( long nPagesX, ULONG nOverlapX,
- long nPagesY, ULONG nOverlapY )
+void ScrollableWindow::ScrollPages( long nPagesX, sal_uLong nOverlapX,
+ long nPagesY, sal_uLong nOverlapY )
{
Size aOutSz( GetVisibleArea().GetSize() );
Scroll( nPagesX * aOutSz.Width() + (nPagesX>0 ? 1 : -1) * nOverlapX,
diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx
index 55aa20209699..d2cd0aa75099 100644..100755
--- a/svtools/source/control/stdctrl.cxx
+++ b/svtools/source/control/stdctrl.cxx
@@ -81,7 +81,7 @@ namespace svt
// make it transparent
SetControlBackground();
SetBackground();
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
index 13a9cdacfc5e..539ce156bbb7 100644..100755
--- a/svtools/source/control/stdmenu.cxx
+++ b/svtools/source/control/stdmenu.cxx
@@ -30,13 +30,10 @@
#include "precompiled_svtools.hxx"
#include <string.h>
-
#include <vcl/svapp.hxx>
-
#include <vcl/i18nhelp.hxx>
-
-#include <ctrltool.hxx>
-#include <stdmenu.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svtools/stdmenu.hxx>
// ========================================================================
@@ -80,13 +77,13 @@ void FontNameMenu::Fill( const FontList* pList )
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
// more than 100 fonts reduces the speed of opening the menu.
// So only the first 100 fonts will be displayed.
- USHORT nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< USHORT >(100) );
- for ( USHORT i = 0; i < nFontCount; i++ )
+ sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) );
+ for ( sal_uInt16 i = 0; i < nFontCount; i++ )
{
const XubString& rName = pList->GetFontName( i ).GetName();
// sort with the I18nHelper
- USHORT j = GetItemCount();
+ sal_uInt16 j = GetItemCount();
while ( j )
{
XubString aText = GetItemText( GetItemId( j-1 ) );
@@ -107,11 +104,11 @@ void FontNameMenu::SetCurName( const XubString& rName )
maCurName = rName;
// Menueintrag checken
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( IsItemChecked( nItemId ) )
nChecked = nItemId;
@@ -119,13 +116,13 @@ void FontNameMenu::SetCurName( const XubString& rName )
XubString aText = GetItemText( nItemId );
if ( aText == maCurName )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
// ========================================================================
@@ -145,7 +142,7 @@ FontStyleMenu::~FontStyleMenu()
void FontStyleMenu::Select()
{
- USHORT nCurId = GetCurItemId();
+ sal_uInt16 nCurId = GetCurItemId();
if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
{
@@ -160,7 +157,7 @@ void FontStyleMenu::Select()
void FontStyleMenu::Highlight()
{
- USHORT nCurId = GetCurItemId();
+ sal_uInt16 nCurId = GetCurItemId();
if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
{
@@ -175,22 +172,22 @@ void FontStyleMenu::Highlight()
// -----------------------------------------------------------------------
-BOOL FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, USHORT nCount )
+sal_Bool FontStyleMenu::ImplIsAlreadyInserted( const XubString& rStyleName, sal_uInt16 nCount )
{
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
if ( GetItemText( i+FONTSTYLEMENU_FIRSTID ) == rStyleName )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
{
- USHORT nItemId = GetItemId( 0 );
+ sal_uInt16 nItemId = GetItemId( 0 );
while ( (nItemId >= FONTSTYLEMENU_FIRSTID) &&
(nItemId <= FONTSTYLEMENU_LASTID) )
{
@@ -203,16 +200,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
if ( hFontInfo )
{
XubString aStyleText;
- USHORT nPos = 0;
- USHORT nId = FONTSTYLEMENU_FIRSTID;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nId = FONTSTYLEMENU_FIRSTID;
FontWeight eLastWeight = WEIGHT_DONTKNOW;
FontItalic eLastItalic = ITALIC_NONE;
FontWidth eLastWidth = WIDTH_DONTKNOW;
- BOOL bNormal = FALSE;
- BOOL bItalic = FALSE;
- BOOL bBold = FALSE;
- BOOL bBoldItalic = FALSE;
- BOOL bInsert = FALSE;
+ sal_Bool bNormal = sal_False;
+ sal_Bool bItalic = sal_False;
+ sal_Bool bBold = sal_False;
+ sal_Bool bBoldItalic = sal_False;
+ sal_Bool bInsert = sal_False;
FontInfo aInfo;
while ( hFontInfo )
{
@@ -237,16 +234,16 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
if ( eWeight <= WEIGHT_NORMAL )
{
if ( eItalic != ITALIC_NONE )
- bItalic = TRUE;
+ bItalic = sal_True;
else
- bNormal = TRUE;
+ bNormal = sal_True;
}
else
{
if ( eItalic != ITALIC_NONE )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
else
- bBold = TRUE;
+ bBold = sal_True;
}
// For wrong StyleNames we replace this with the correct once
@@ -280,11 +277,11 @@ void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
}
if ( !bItalic && (aStyleText == pList->GetItalicStr()) )
- bItalic = TRUE;
+ bItalic = sal_True;
else if ( !bBold && (aStyleText == pList->GetBoldStr()) )
- bBold = TRUE;
+ bBold = sal_True;
else if ( !bBoldItalic && (aStyleText == pList->GetBoldItalicStr()) )
- bBoldItalic = TRUE;
+ bBoldItalic = sal_True;
hFontInfo = pList->GetNextFontInfo( hFontInfo );
}
@@ -349,11 +346,11 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle )
maCurStyle = rStyle;
// Menueintrag checken
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( (nItemId < FONTSTYLEMENU_FIRSTID) ||
(nItemId > FONTSTYLEMENU_LASTID) )
@@ -365,13 +362,13 @@ void FontStyleMenu::SetCurStyle( const XubString& rStyle )
XubString aText = GetItemText( nItemId );
if ( aText == maCurStyle )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
// ========================================================================
@@ -395,7 +392,7 @@ FontSizeMenu::~FontSizeMenu()
void FontSizeMenu::Select()
{
- const USHORT nCurItemId = GetCurItemId();
+ const sal_uInt16 nCurItemId = GetCurItemId();
mnCurHeight = mpHeightAry[ nCurItemId - 1 ];
maSelectHdl.Call( this );
}
@@ -405,7 +402,7 @@ void FontSizeMenu::Select()
void FontSizeMenu::Highlight()
{
const long nTempHeight = mnCurHeight;
- const USHORT nCurItemId = GetCurItemId();
+ const sal_uInt16 nCurItemId = GetCurItemId();
if ( !nCurItemId )
mnCurHeight = 0;
else
@@ -429,11 +426,11 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
const long* pTempAry;
const long* pAry = pList->GetSizeAry( rInfo );
- USHORT nSizeCount = 0;
+ sal_uInt16 nSizeCount = 0;
while ( pAry[nSizeCount] )
nSizeCount++;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
// first insert font size names (for simplified/traditional chinese)
FontSizeNames aFontSizeNames( Application::GetSettings().GetUILanguage() );
@@ -443,8 +440,8 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
if ( pAry == pList->GetStdSizeAry() )
{
// for scalable fonts all font size names
- ULONG nCount = aFontSizeNames.Count();
- for( ULONG i = 0; i < nCount; i++ )
+ sal_uLong nCount = aFontSizeNames.Count();
+ for( sal_uLong i = 0; i < nCount; i++ )
{
String aSizeName = aFontSizeNames.GetIndexName( i );
long nSize = aFontSizeNames.GetIndexSize( i );
@@ -478,7 +475,7 @@ void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
{
mpHeightAry[nPos] = *pTempAry;
nPos++; // Id is nPos+1
- InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, TRUE, FALSE ), MIB_RADIOCHECK | MIB_AUTOCHECK );
+ InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, sal_True, sal_False ), MIB_RADIOCHECK | MIB_AUTOCHECK );
pTempAry++;
}
@@ -492,16 +489,16 @@ void FontSizeMenu::SetCurHeight( long nHeight )
mnCurHeight = nHeight;
// check menue item
- XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, TRUE, FALSE );
- USHORT nChecked = 0;
- USHORT nItemCount = GetItemCount();
- for( USHORT i = 0; i < nItemCount; i++ )
+ XubString aHeight = Application::GetSettings().GetUILocaleI18nHelper().GetNum( nHeight, 1, sal_True, sal_False );
+ sal_uInt16 nChecked = 0;
+ sal_uInt16 nItemCount = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItemCount; i++ )
{
- USHORT nItemId = GetItemId( i );
+ sal_uInt16 nItemId = GetItemId( i );
if ( mpHeightAry[i] == nHeight )
{
- CheckItem( nItemId, TRUE );
+ CheckItem( nItemId, sal_True );
return;
}
@@ -510,7 +507,7 @@ void FontSizeMenu::SetCurHeight( long nHeight )
}
if ( nChecked )
- CheckItem( nChecked, FALSE );
+ CheckItem( nChecked, sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/svxbox.cxx b/svtools/source/control/svxbox.cxx
index 7bb17b83ea9e..23c738df7dac 100644..100755
--- a/svtools/source/control/svxbox.cxx
+++ b/svtools/source/control/svxbox.cxx
@@ -43,17 +43,17 @@ SV_IMPL_PTRARR(SvxEntryLst, SvxBoxEntry*)
SvxBoxEntry::SvxBoxEntry() :
nId(LISTBOX_ENTRY_NOTFOUND),
- bModified(FALSE),
- bNew(FALSE)
+ bModified(sal_False),
+ bNew(sal_False)
{
}
-SvxBoxEntry::SvxBoxEntry(const String& aNam, USHORT nIdx) :
+SvxBoxEntry::SvxBoxEntry(const String& aNam, sal_uInt16 nIdx) :
aName(aNam),
nId(nIdx),
- bModified(FALSE),
- bNew(FALSE)
+ bModified(sal_False),
+ bNew(sal_False)
{
}
@@ -96,8 +96,8 @@ SvxListBox::~SvxListBox()
void SvxListBox::InitListBox()
{
// Verwaltung fuer die Stringlist aus der Resource aufbauen
- USHORT nSize = GetEntryCount();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = GetEntryCount();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ const SvxBoxEntry* pTmp = new SvxBoxEntry(ListBox::GetEntry(i), i);
const SvxBoxEntry* &rpTmp = pTmp;
aEntryLst.Insert(rpTmp, aEntryLst.Count());
@@ -111,7 +111,7 @@ void SvxListBox::InitListBox()
void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry)
{
SvxBoxEntry* pNew = new SvxBoxEntry(rEntry);
- pNew->bNew = TRUE;
+ pNew->bNew = sal_True;
InsertSorted(pNew);
}
@@ -119,7 +119,7 @@ void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry)
Beschreibung: Eintrag in die ListBox aufnehmen
--------------------------------------------------------------------*/
-void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos)
+void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, sal_uInt16 nPos)
{
if(nPos != LISTBOX_ENTRY_NOTFOUND)
{
@@ -136,7 +136,7 @@ void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos)
Beschreibung: Eintrag aus der Liste loeschen
--------------------------------------------------------------------*/
-void SvxListBox::RemoveEntry(USHORT nPos)
+void SvxListBox::RemoveEntry(sal_uInt16 nPos)
{
if(nPos >= aEntryLst.Count())
return;
@@ -160,7 +160,7 @@ void SvxListBox::RemoveEntry(USHORT nPos)
void SvxListBox::RemoveEntry(const SvxBoxEntry& rEntry)
{
- USHORT nPos = ListBox::GetEntryPos(rEntry.aName);
+ sal_uInt16 nPos = ListBox::GetEntryPos(rEntry.aName);
RemoveEntry(nPos);
}
@@ -179,7 +179,7 @@ void SvxListBox::Clear()
Beschreibung: Position by Name
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
+sal_uInt16 SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
{
return ListBox::GetEntryPos(rEntry.aName);
}
@@ -188,7 +188,7 @@ USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const
Beschreibung: Rund um die Entries
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(sal_uInt16 nPos) const
{
if(nPos < aEntryLst.Count())
return *aEntryLst[nPos];
@@ -200,13 +200,13 @@ const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const
Beschreibung: aktullen Eintrag zurueckgeben
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const
+const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(sal_uInt16 nSelId) const
{
String aName(ListBox::GetSelectEntry(nSelId));
if(aName.Len() > 0)
{
- for (USHORT i=0; i < aEntryLst.Count(); i++)
+ for (sal_uInt16 i=0; i < aEntryLst.Count(); i++)
{
if(aEntryLst[i]->aName == aName )
return *aEntryLst[i];
@@ -219,11 +219,11 @@ const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const
Beschreibung: modifizierte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetModifiedCount() const
+sal_uInt16 SvxListBox::GetModifiedCount() const
{
- USHORT nMod = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nMod = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
nMod++;
}
@@ -234,7 +234,7 @@ USHORT SvxListBox::GetModifiedCount() const
Beschreibung: Modifizierte Eintraege behandeln
--------------------------------------------------------------------*/
-void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
+void SvxListBox::ModifyEntry(sal_uInt16 nPos, const String& rName)
{
if(nPos >= aEntryLst.Count())
return;
@@ -242,7 +242,7 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
SvxBoxEntry* pEntry = aEntryLst[nPos];
aEntryLst.Remove(nPos, 1);
aEntryLst[nPos]->aName = rName;
- aEntryLst[nPos]->bModified = TRUE;
+ aEntryLst[nPos]->bModified = sal_True;
ListBox::RemoveEntry(nPos);
InsertSorted(pEntry);
@@ -252,11 +252,11 @@ void SvxListBox::ModifyEntry(USHORT nPos, const String& rName)
Beschreibung: alle modifizierten Eintraege bahandeln
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetModifiedEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nMod = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nMod = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
{ if(nMod == nPos)
return *aEntryLst[i];
@@ -270,13 +270,13 @@ const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const
Beschreibung: geloeschte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetRemovedCount() const
+sal_uInt16 SvxListBox::GetRemovedCount() const
{
return aDelEntryLst.Count();
}
-const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetRemovedEntry(sal_uInt16 nPos) const
{
if(nPos < aDelEntryLst.Count())
return *aDelEntryLst[nPos];
@@ -288,11 +288,11 @@ const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const
Beschreibung: Neue Entries begutachten
--------------------------------------------------------------------*/
-USHORT SvxListBox::GetNewCount() const
+sal_uInt16 SvxListBox::GetNewCount() const
{
- USHORT nNew = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nNew = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
nNew++;
}
@@ -303,11 +303,11 @@ USHORT SvxListBox::GetNewCount() const
Beschreibung: Alle neuen Eintraege ueberpruefen
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const
+const SvxBoxEntry& SvxListBox::GetNewEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nNew = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nNew = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
{ if(nNew == nPos)
return *aEntryLst[i];
@@ -324,7 +324,7 @@ const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const
void SvxListBox::InsertSorted(SvxBoxEntry* pEntry)
{
ListBox::InsertEntry(pEntry->aName);
- USHORT nPos = ListBox::GetEntryPos(pEntry->aName);
+ sal_uInt16 nPos = ListBox::GetEntryPos(pEntry->aName);
aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos);
}
@@ -332,7 +332,7 @@ void SvxListBox::InsertSorted(SvxBoxEntry* pEntry)
Beschreibung: ComboBoxen mit Verwaltungseinheit
--------------------------------------------------------------------*/
-SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) :
+SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, sal_uInt16 nStyleBits) :
ComboBox(pParent, nBits),
nStyle(nStyleBits)
{
@@ -340,7 +340,7 @@ SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) :
}
-SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, USHORT nStyleBits ):
+SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ):
ComboBox(pParent, rId),
nStyle(nStyleBits)
{
@@ -364,8 +364,8 @@ SvxComboBox::~SvxComboBox()
void SvxComboBox::InitComboBox()
{
// Verwaltung fuer die Stringlist aus der Resource aufbauen
- USHORT nSize = GetEntryCount();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = GetEntryCount();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ const SvxBoxEntry* pTmp = new SvxBoxEntry(ComboBox::GetEntry(i), i);
const SvxBoxEntry* &rpTmp = pTmp;
aEntryLst.Insert(rpTmp, aEntryLst.Count());
@@ -379,7 +379,7 @@ void SvxComboBox::InitComboBox()
void SvxComboBox::InsertNewEntry(const SvxBoxEntry& rEntry)
{
SvxBoxEntry* pNew = new SvxBoxEntry(rEntry);
- pNew->bNew = TRUE;
+ pNew->bNew = sal_True;
InsertSorted(pNew);
}
@@ -396,7 +396,7 @@ void SvxComboBox::InsertEntry(const SvxBoxEntry& rEntry)
Beschreibung: Eintrag aus der Liste loeschen
--------------------------------------------------------------------*/
-void SvxComboBox::RemoveEntry(USHORT nPos)
+void SvxComboBox::RemoveEntry(sal_uInt16 nPos)
{
if(nPos >= aEntryLst.Count())
return;
@@ -420,7 +420,7 @@ void SvxComboBox::RemoveEntry(USHORT nPos)
void SvxComboBox::RemoveEntry(const SvxBoxEntry& rEntry)
{
- USHORT nPos = ComboBox::GetEntryPos(rEntry.aName);
+ sal_uInt16 nPos = ComboBox::GetEntryPos(rEntry.aName);
RemoveEntry(nPos);
}
@@ -440,7 +440,7 @@ void SvxComboBox::Clear()
Beschreibung: Position by Name
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
+sal_uInt16 SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
{
return ComboBox::GetEntryPos(rEntry.aName);
}
@@ -449,7 +449,7 @@ USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const
Beschreibung: Rund um die Entries
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetEntry(sal_uInt16 nPos) const
{
if(nPos < aEntryLst.Count())
return *aEntryLst[nPos];
@@ -461,11 +461,11 @@ const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const
Beschreibung: modifizierte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetModifiedCount() const
+sal_uInt16 SvxComboBox::GetModifiedCount() const
{
- USHORT nMod = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nMod = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
nMod++;
}
@@ -476,7 +476,7 @@ USHORT SvxComboBox::GetModifiedCount() const
Beschreibung: Modifizierte Eintraege behandeln
--------------------------------------------------------------------*/
-void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
+void SvxComboBox::ModifyEntry(sal_uInt16 nPos, const String& rName)
{
if(nPos >= aEntryLst.Count())
return;
@@ -484,7 +484,7 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
SvxBoxEntry* pEntry = aEntryLst[nPos];
aEntryLst.Remove(nPos, 1);
aEntryLst[nPos]->aName = rName;
- aEntryLst[nPos]->bModified = TRUE;
+ aEntryLst[nPos]->bModified = sal_True;
ComboBox::RemoveEntry(nPos);
InsertSorted(pEntry);
@@ -494,11 +494,11 @@ void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName)
Beschreibung: alle modifizierten Eintraege bahandeln
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetModifiedEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nMod = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nMod = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bModified)
{ if(nMod == nPos)
return *aEntryLst[i];
@@ -512,13 +512,13 @@ const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const
Beschreibung: geloeschte Eintraege
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetRemovedCount() const
+sal_uInt16 SvxComboBox::GetRemovedCount() const
{
return aDelEntryLst.Count();
}
-const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetRemovedEntry(sal_uInt16 nPos) const
{
if(nPos < aDelEntryLst.Count())
return *aDelEntryLst[nPos];
@@ -530,11 +530,11 @@ const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const
Beschreibung: Neue Entries begutachten
--------------------------------------------------------------------*/
-USHORT SvxComboBox::GetNewCount() const
+sal_uInt16 SvxComboBox::GetNewCount() const
{
- USHORT nNew = 0;
- USHORT nSize = aEntryLst.Count();
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nNew = 0;
+ sal_uInt16 nSize = aEntryLst.Count();
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
nNew++;
}
@@ -545,11 +545,11 @@ USHORT SvxComboBox::GetNewCount() const
Beschreibung: Alle neuen Eintraege ueberpruefen
--------------------------------------------------------------------*/
-const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const
+const SvxBoxEntry& SvxComboBox::GetNewEntry(sal_uInt16 nPos) const
{
- USHORT nSize = aEntryLst.Count();
- USHORT nNew = 0;
- for(USHORT i=0; i < nSize; ++i)
+ sal_uInt16 nSize = aEntryLst.Count();
+ sal_uInt16 nNew = 0;
+ for(sal_uInt16 i=0; i < nSize; ++i)
{ if(aEntryLst[i]->bNew)
{ if(nNew == nPos)
return *aEntryLst[i];
@@ -566,7 +566,7 @@ const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const
void SvxComboBox::InsertSorted(SvxBoxEntry* pEntry)
{
ComboBox::InsertEntry(pEntry->aName);
- USHORT nPos = ComboBox::GetEntryPos(pEntry->aName);
+ sal_uInt16 nPos = ComboBox::GetEntryPos(pEntry->aName);
aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos);
}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 75c02afda571..9b61f88562da 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "tabbar.hxx"
+#include <svtools/tabbar.hxx>
#include <tools/time.hxx>
#include <tools/debug.hxx>
#include <tools/poly.hxx>
@@ -38,11 +38,11 @@
#include <vcl/decoview.hxx>
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
+#include <vcl/image.hxx>
#include "svtaccessiblefactory.hxx"
-
-#include "svtools/svtools.hrc"
-#include "svtools/svtdata.hxx"
-
+#include <filectrl.hrc>
+#include <svtools/svtdata.hxx>
+#include <svtools/svtools.hrc>
#include <limits>
// =======================================================================
@@ -52,36 +52,35 @@
#define TABBAR_DRAG_SCROLLOFF 5
#define TABBAR_MINSIZE 5
-const USHORT ADDNEWPAGE_AREAWIDTH = 10;
+const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
// =======================================================================
struct ImplTabBarItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
TabBarPageBits mnBits;
XubString maText;
XubString maHelpText;
Rectangle maRect;
long mnWidth;
- ULONG mnHelpId;
- BOOL mbShort;
- BOOL mbSelect;
- BOOL mbEnable;
+ rtl::OString maHelpId;
+ sal_Bool mbShort;
+ sal_Bool mbSelect;
+ sal_Bool mbEnable;
Color maTabBgColor;
Color maTabTextColor;
- ImplTabBarItem( USHORT nItemId, const XubString& rText,
+ ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText,
TabBarPageBits nPageBits ) :
maText( rText )
{
mnId = nItemId;
mnBits = nPageBits;
mnWidth = 0;
- mnHelpId = 0;
- mbShort = FALSE;
- mbSelect = FALSE;
- mbEnable = TRUE;
+ mbShort = sal_False;
+ mbSelect = sal_False;
+ mbEnable = sal_True;
maTabBgColor = Color( COL_AUTO );
maTabTextColor = Color( COL_AUTO );
}
@@ -128,7 +127,7 @@ long ImplTabButton::PreNotify( NotifyEvent& rNEvt )
if ( GetParent()->IsInEditMode() )
{
GetParent()->EndEditMode();
- return TRUE;
+ return sal_True;
}
}
@@ -245,7 +244,7 @@ class TabBarEdit : public Edit
{
private:
Timer maLoseFocusTimer;
- BOOL mbPostEvt;
+ sal_Bool mbPostEvt;
DECL_LINK( ImplEndEditHdl, void* );
DECL_LINK( ImplEndTimerHdl, void* );
@@ -255,8 +254,8 @@ public:
TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
- void SetPostEvent() { mbPostEvt = TRUE; }
- void ResetPostEvent() { mbPostEvt = FALSE; }
+ void SetPostEvent() { mbPostEvt = sal_True; }
+ void ResetPostEvent() { mbPostEvt = sal_False; }
virtual long PreNotify( NotifyEvent& rNEvt );
virtual void LoseFocus();
@@ -267,7 +266,7 @@ public:
TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) :
Edit( pParent, nWinStyle )
{
- mbPostEvt = FALSE;
+ mbPostEvt = sal_False;
}
// -----------------------------------------------------------------------
@@ -283,19 +282,19 @@ long TabBarEdit::PreNotify( NotifyEvent& rNEvt )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ mbPostEvt = sal_True;
}
- return TRUE;
+ return sal_True;
}
else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE )
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)TRUE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_True ) )
+ mbPostEvt = sal_True;
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -309,8 +308,8 @@ void TabBarEdit::LoseFocus()
{
if ( !mbPostEvt )
{
- if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
- mbPostEvt = TRUE;
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)sal_False ) )
+ mbPostEvt = sal_True;
}
Edit::LoseFocus();
@@ -325,7 +324,7 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel )
// We need this query, because the edit get a losefous event,
// when it shows the context menu or the insert symbol dialog
- if ( !HasFocus() && HasChildPathFocus( TRUE ) )
+ if ( !HasFocus() && HasChildPathFocus( sal_True ) )
{
maLoseFocusTimer.SetTimeout( 30 );
maLoseFocusTimer.SetTimeoutHdl( LINK( this, TabBarEdit, ImplEndTimerHdl ) );
@@ -346,10 +345,10 @@ IMPL_LINK( TabBarEdit, ImplEndTimerHdl, void*, EMPTYARG )
// We need this query, because the edit get a losefous event,
// when it shows the context menu or the insert symbol dialog
- if ( HasChildPathFocus( TRUE ) )
+ if ( HasChildPathFocus( sal_True ) )
maLoseFocusTimer.Start();
else
- GetParent()->EndEditMode( TRUE );
+ GetParent()->EndEditMode( sal_True );
return 0;
}
@@ -374,7 +373,7 @@ struct TabBar_Impl
const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
-const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<USHORT>::max() - 1;
+const sal_uInt16 TabBar::INSERT_TAB_POS = ::std::numeric_limits<sal_uInt16>::max() - 1;
void TabBar::ImplInit( WinBits nWinStyle )
{
@@ -398,25 +397,35 @@ void TabBar::ImplInit( WinBits nWinStyle )
mnDropPos = 0;
mnSwitchId = 0;
mnEditId = 0;
- mbFormat = TRUE;
- mbFirstFormat = TRUE;
- mbSizeFormat = TRUE;
- mbAutoMaxWidth = TRUE;
- mbInSwitching = FALSE;
- mbAutoEditMode = FALSE;
- mbEditCanceled = FALSE;
- mbDropPos = FALSE;
- mbInSelect = FALSE;
- mbSelColor = FALSE;
- mbSelTextColor = FALSE;
- mbMirrored = FALSE;
+ mbFormat = sal_True;
+ mbFirstFormat = sal_True;
+ mbSizeFormat = sal_True;
+ mbAutoMaxWidth = sal_True;
+ mbInSwitching = sal_False;
+ mbAutoEditMode = sal_False;
+ mbEditCanceled = sal_False;
+ mbDropPos = sal_False;
+ mbInSelect = sal_False;
+ mbSelColor = sal_False;
+ mbSelTextColor = sal_False;
+ mbMirrored = sal_False;
if ( nWinStyle & WB_3DTAB )
mnOffY++;
ImplInitControls();
+
+ if(mpFirstBtn)
+ mpFirstBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVET0HOME)));
+ if(mpPrevBtn)
+ mpPrevBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVELEFT)));
+ if(mpNextBtn)
+ mpNextBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT)));
+ if(mpLastBtn)
+ mpLastBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND)));
+
SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) );
- ImplInitSettings( TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -432,7 +441,7 @@ TabBar::TabBar( Window* pParent, WinBits nWinStyle ) :
TabBar::~TabBar()
{
- EndEditMode( TRUE );
+ EndEditMode( sal_True );
// Controls loeschen
if ( mpPrevBtn )
@@ -480,7 +489,7 @@ ImplTabBarItem* TabBar::next()
// -----------------------------------------------------------------------
-void TabBar::ImplInitSettings( BOOL bFont, BOOL bBackground )
+void TabBar::ImplInitSettings( sal_Bool bFont, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -554,12 +563,12 @@ void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
// -----------------------------------------------------------------------
-BOOL TabBar::ImplCalcWidth()
+sal_Bool TabBar::ImplCalcWidth()
{
// Groessen muessen nur ermittelt werden, wenn sich Text aendert oder
// wenn der Font geaendert wurde
if ( !mbSizeFormat )
- return FALSE;
+ return sal_False;
// Breiten der Tabs mit dem fetten Font ermitteln
Font aFont = GetFont();
@@ -582,28 +591,28 @@ BOOL TabBar::ImplCalcWidth()
else
mnCurMaxWidth = 0;
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
long nNewWidth = GetTextWidth( pItem->maText );
if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) )
{
- pItem->mbShort = TRUE;
+ pItem->mbShort = sal_True;
nNewWidth = mnCurMaxWidth;
}
else
- pItem->mbShort = FALSE;
+ pItem->mbShort = sal_False;
nNewWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2;
if ( pItem->mnWidth != nNewWidth )
{
pItem->mnWidth = nNewWidth;
if ( !pItem->maRect.IsEmpty() )
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
- mbSizeFormat = FALSE;
- mbFormat = TRUE;
+ mbSizeFormat = sal_False;
+ mbFormat = sal_True;
return bChanged;
}
@@ -616,7 +625,7 @@ void TabBar::ImplFormat()
if ( !mbFormat )
return;
- USHORT n = 0;
+ sal_uInt16 n = 0;
long x = mnOffX;
for ( size_t i = 0, nL = mpItemList->size(); i < nL; ++i )
{
@@ -650,7 +659,7 @@ void TabBar::ImplFormat()
n++;
}
- mbFormat = FALSE;
+ mbFormat = sal_False;
// Button enablen/disablen
ImplEnableControls();
@@ -658,13 +667,13 @@ void TabBar::ImplFormat()
// -----------------------------------------------------------------------
-USHORT TabBar::ImplGetLastFirstPos()
+sal_uInt16 TabBar::ImplGetLastFirstPos()
{
- USHORT nCount = (USHORT)(mpItemList->size());
+ sal_uInt16 nCount = (sal_uInt16)(mpItemList->size());
if ( !nCount || mbSizeFormat || mbFormat )
return 0;
- USHORT nLastFirstPos = nCount-1;
+ sal_uInt16 nLastFirstPos = nCount-1;
long nWinWidth = mnLastOffX-mnOffX-TABBAR_OFFSET_X-ADDNEWPAGE_AREAWIDTH;
long nWidth = (*mpItemList)[ nLastFirstPos ]->mnWidth;
while ( nLastFirstPos && (nWidth < nWinWidth) )
@@ -672,7 +681,7 @@ USHORT TabBar::ImplGetLastFirstPos()
nLastFirstPos--;
nWidth += (*mpItemList)[ nLastFirstPos ]->mnWidth;
}
- if ( (nLastFirstPos != (USHORT)(mpItemList->size()-1)) &&
+ if ( (nLastFirstPos != (sal_uInt16)(mpItemList->size()-1)) &&
(nWidth > nWinWidth) )
nLastFirstPos++;
return nLastFirstPos;
@@ -754,7 +763,7 @@ void TabBar::ImplEnableControls()
return;
// Buttons enablen/disblen
- BOOL bEnableBtn = mnFirstPos > 0;
+ sal_Bool bEnableBtn = mnFirstPos > 0;
if ( mpFirstBtn )
mpFirstBtn->Enable( bEnableBtn );
if ( mpPrevBtn )
@@ -769,7 +778,7 @@ void TabBar::ImplEnableControls()
// -----------------------------------------------------------------------
-void TabBar::ImplShowPage( USHORT nPos )
+void TabBar::ImplShowPage( sal_uInt16 nPos )
{
// Breite berechnen
long nWidth = GetOutputSizePixel().Width();
@@ -782,7 +791,7 @@ void TabBar::ImplShowPage( USHORT nPos )
{
while ( pItem->maRect.Right() > nWidth )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
SetFirstPageId( GetPageId( nNewPos ) );
ImplFormat();
if ( nNewPos != mnFirstPos )
@@ -797,7 +806,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
{
EndEditMode();
- USHORT nNewPos = mnFirstPos;
+ sal_uInt16 nNewPos = mnFirstPos;
if ( pBtn == mpFirstBtn )
nNewPos = 0;
@@ -808,13 +817,13 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
}
else if ( pBtn == mpNextBtn )
{
- USHORT nCount = GetPageCount();
+ sal_uInt16 nCount = GetPageCount();
if ( mnFirstPos < nCount )
nNewPos = mnFirstPos+1;
}
else
{
- USHORT nCount = GetPageCount();
+ sal_uInt16 nCount = GetPageCount();
if ( nCount )
nNewPos = nCount-1;
}
@@ -829,7 +838,7 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
void TabBar::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeaveWindow() )
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Window::MouseMove( rMEvt );
}
@@ -847,14 +856,14 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
ImplTabBarItem* pItem;
- USHORT nSelId = GetPageId( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelId = GetPageId( rMEvt.GetPosPixel() );
if ( !rMEvt.IsLeft() )
{
Window::MouseButtonDown( rMEvt );
if ( (nSelId > 0) && (nSelId != mnCurPageId) )
{
- USHORT nPos = GetPagePos( nSelId );
+ sal_uInt16 nPos = GetPagePos( nSelId );
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -866,7 +875,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
ImplActivatePage();
ImplSelect();
}
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
}
}
return;
@@ -882,8 +891,8 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( nSelId )
{
- USHORT nPos = GetPagePos( nSelId );
- BOOL bSelectTab = FALSE;
+ sal_uInt16 nPos = GetPagePos( nSelId );
+ sal_Bool bSelectTab = sal_False;
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -893,15 +902,15 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( nSelId != mnCurPageId )
{
SelectPage( nSelId, !IsPageSelected( nSelId ) );
- bSelectTab = TRUE;
+ bSelectTab = sal_True;
}
}
else if ( mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT) )
{
- bSelectTab = TRUE;
- USHORT n;
- BOOL bSelect;
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ bSelectTab = sal_True;
+ sal_uInt16 n;
+ sal_Bool bSelect;
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
if ( nPos <= nCurPos )
{
// Alle Tabs bis zur angeklickten Tab deselektieren
@@ -912,9 +921,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
pItem = (*mpItemList)[ n ];
if ( n < nPos )
- bSelect = FALSE;
+ bSelect = sal_False;
else
- bSelect = TRUE;
+ bSelect = sal_True;
if ( pItem->mbSelect != bSelect )
{
@@ -932,16 +941,16 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Alle Tabs von der aktuellen bis zur angeklickten
// Tab selektieren und alle Tabs von der angeklickten
// Tab bis zur letzten Tab deselektieren
- USHORT nCount = (USHORT)mpItemList->size();
+ sal_uInt16 nCount = (sal_uInt16)mpItemList->size();
n = nCurPos;
while ( n < nCount )
{
pItem = (*mpItemList)[ n ];
if ( n <= nPos )
- bSelect = TRUE;
+ bSelect = sal_True;
else
- bSelect = FALSE;
+ bSelect = sal_False;
if ( pItem->mbSelect != bSelect )
{
@@ -965,7 +974,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else
ImplShowPage( nPos );
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
return;
}
@@ -975,7 +984,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Gegebenenfalls den Double-Click-Handler rufen
if ( !rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)) )
{
- USHORT nOldCurId = mnCurPageId;
+ sal_uInt16 nOldCurId = mnCurPageId;
mnCurPageId = nSelId;
DoubleClick();
// Abfrage, da im DoubleClick-Handler die aktuelle Seite
@@ -993,7 +1002,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
// Nur Select ausfuehren, wenn noch nicht aktuelle Page
if ( nSelId != mnCurPageId )
{
- USHORT nPos = GetPagePos( nSelId );
+ sal_uInt16 nPos = GetPagePos( nSelId );
pItem = (*mpItemList)[ nPos ];
if ( pItem->mbEnable )
@@ -1001,9 +1010,9 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( !pItem->mbSelect )
{
// Muss invalidiert werden
- BOOL bUpdate = FALSE;
+ sal_Bool bUpdate = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
// Alle selektierten Items deselektieren
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
@@ -1011,7 +1020,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
pItem = (*mpItemList)[ i ];
if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) )
{
- pItem->mbSelect = FALSE;
+ pItem->mbSelect = sal_False;
if ( bUpdate )
Invalidate( pItem->maRect );
}
@@ -1028,7 +1037,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else
ImplShowPage( nPos );
- mbInSelect = TRUE;
+ mbInSelect = sal_True;
}
return;
@@ -1042,7 +1051,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
void TabBar::MouseButtonUp( const MouseEvent& rMEvt )
{
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Window::MouseButtonUp( rMEvt );
}
@@ -1242,7 +1251,8 @@ public:
void drawPlusImage()
{
- Image aPlusImg( SvtResId(BMP_LIST_ADD) );
+ SvtResId id( BMP_LIST_ADD );
+ Image aPlusImg( id );
// Center the image within the bounding rectangle.
Size aSize = aPlusImg.GetSizePixel();
Point pt = maRect.TopLeft();
@@ -1323,7 +1333,7 @@ private:
void TabBar::Paint( const Rectangle& )
{
// Items berechnen und ausgeben
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if (!nItemCount)
return;
@@ -1456,7 +1466,7 @@ void TabBar::Resize()
// Scroll-Buttons anordnen
long nHeight = aNewSize.Height();
// Font in der groesse Anpassen?
- ImplInitSettings( TRUE, FALSE );
+ ImplInitSettings( sal_True, sal_False );
long nX = mbMirrored ? (aNewSize.Width()-nHeight) : 0;
long nXDiff = mbMirrored ? -nHeight : nHeight;
@@ -1502,7 +1512,7 @@ void TabBar::Resize()
}
// Neu formatieren
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
if ( IsReallyVisible() )
{
if ( ImplCalcWidth() )
@@ -1518,7 +1528,7 @@ void TabBar::Resize()
void TabBar::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
@@ -1539,13 +1549,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1554,7 +1564,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
// wenn dieser abgeschnitten oder nicht voll sichtbar ist
if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
{
- USHORT nPos = GetPagePos( nItemId );
+ sal_uInt16 nPos = GetPagePos( nItemId );
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mbShort ||
(pItem->maRect.Right()-TABBAR_OFFSET_X-5 > mnLastOffX) )
@@ -1596,14 +1606,14 @@ void TabBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE );
+ ImplInitSettings( sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
Invalidate();
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_MIRRORING )
@@ -1629,7 +1639,7 @@ void TabBar::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True );
Invalidate();
}
}
@@ -1693,7 +1703,7 @@ long TabBar::ImplDeactivatePage()
void TabBar::ImplPrePaint()
{
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if (!nItemCount)
return;
@@ -1706,7 +1716,7 @@ void TabBar::ImplPrePaint()
// sichtbar wird
if ( mbFirstFormat )
{
- mbFirstFormat = FALSE;
+ mbFirstFormat = sal_False;
if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos )
{
@@ -1715,9 +1725,9 @@ void TabBar::ImplPrePaint()
{
// mbDropPos setzen (bzw. misbrauchen) um Invalidate()
// zu unterbinden
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
SetFirstPageId( mnCurPageId );
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
if ( mnFirstPos != 0 )
ImplFormat();
}
@@ -1725,10 +1735,10 @@ void TabBar::ImplPrePaint()
}
}
-ImplTabBarItem* TabBar::ImplGetLastTabBarItem( USHORT nItemCount )
+ImplTabBarItem* TabBar::ImplGetLastTabBarItem( sal_uInt16 nItemCount )
{
// letzten sichtbaren Eintrag suchen
- USHORT n = mnFirstPos+1;
+ sal_uInt16 n = mnFirstPos+1;
if ( n >= nItemCount )
n = nItemCount-1;
ImplTabBarItem* pItem = seek( n );
@@ -1772,7 +1782,7 @@ long TabBar::DeactivatePage()
if ( maDeactivatePageHdl.IsSet() )
return maDeactivatePageHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1782,7 +1792,7 @@ long TabBar::StartRenaming()
if ( maStartRenamingHdl.IsSet() )
return maStartRenamingHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1792,7 +1802,7 @@ long TabBar::AllowRenaming()
if ( maAllowRenamingHdl.IsSet() )
return maAllowRenamingHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1811,8 +1821,8 @@ void TabBar::Mirror()
// -----------------------------------------------------------------------
-void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
- TabBarPageBits nBits, USHORT nPos )
+void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ TabBarPageBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND,
@@ -1828,7 +1838,6 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
} else {
mpItemList->push_back( pItem );
}
- mbSizeFormat = TRUE;
// CurPageId gegebenenfalls setzen
if ( !mnCurPageId )
@@ -1843,9 +1852,9 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
// -----------------------------------------------------------------------
-Color TabBar::GetTabBgColor( USHORT nPageId ) const
+Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maTabBgColor;
@@ -1853,9 +1862,9 @@ Color TabBar::GetTabBgColor( USHORT nPageId ) const
return Color( COL_AUTO );
}
-void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
+void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
ImplTabBarItem* pItem;
if ( nPos != PAGE_NOT_FOUND )
{
@@ -1878,9 +1887,9 @@ void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
// -----------------------------------------------------------------------
-void TabBar::RemovePage( USHORT nPageId )
+void TabBar::RemovePage( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Existiert Item
if ( nPos != PAGE_NOT_FOUND )
@@ -1897,7 +1906,6 @@ void TabBar::RemovePage( USHORT nPageId )
::std::advance( it, nPos );
delete *it;
mpItemList->erase( it );
- mbFormat = TRUE;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1909,9 +1917,9 @@ void TabBar::RemovePage( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
+void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
Pair aPair( nPos, nNewPos );
if ( nPos < nNewPos )
@@ -1935,7 +1943,6 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
} else {
mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1956,7 +1963,7 @@ void TabBar::Clear()
mpItemList->clear();
// Items aus der Liste loeschen
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
mnCurPageId = 0;
mnFirstPos = 0;
maCurrentItemList = 0;
@@ -1970,9 +1977,9 @@ void TabBar::Clear()
// -----------------------------------------------------------------------
-void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
+void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -1993,21 +2000,21 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL TabBar::IsPageEnabled( USHORT nPageId ) const
+sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mbEnable;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
+void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -2026,37 +2033,37 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
// -----------------------------------------------------------------------
-TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const
+TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mnBits;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPageCount() const
+sal_uInt16 TabBar::GetPageCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPageId( USHORT nPos ) const
+sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const
{
return ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ]->mnId : 0;
}
// -----------------------------------------------------------------------
-USHORT TabBar::GetPagePos( USHORT nPageId ) const
+sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( (*mpItemList)[ i ]->mnId == nPageId ) {
- return USHORT( i );
+ return sal_uInt16( i );
}
}
return PAGE_NOT_FOUND;
@@ -2085,9 +2092,9 @@ sal_uInt16 TabBar::GetPageId( const Point& rPos, bool bCheckInsTab ) const
// -----------------------------------------------------------------------
-Rectangle TabBar::GetPageRect( USHORT nPageId ) const
+Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maRect;
@@ -2097,9 +2104,9 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetCurPageId( USHORT nPageId )
+void TabBar::SetCurPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
if ( nPos != PAGE_NOT_FOUND )
@@ -2110,9 +2117,9 @@ void TabBar::SetCurPageId( USHORT nPageId )
return;
// Muss invalidiert werden
- BOOL bUpdate = FALSE;
+ sal_Bool bUpdate = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
ImplTabBarItem* pOldItem;
@@ -2126,14 +2133,14 @@ void TabBar::SetCurPageId( USHORT nPageId )
// deselktieren, wenn dies die einzige selektierte Seite ist
if ( !pItem->mbSelect && pOldItem )
{
- USHORT nSelPageCount = GetSelectPageCount();
+ sal_uInt16 nSelPageCount = GetSelectPageCount();
if ( nSelPageCount == 1 )
- pOldItem->mbSelect = FALSE;
- pItem->mbSelect = TRUE;
+ pOldItem->mbSelect = sal_False;
+ pItem->mbSelect = sal_True;
}
mnCurPageId = nPageId;
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Dafuer sorgen, das aktuelle Page sichtbar wird
if ( IsReallyVisible() )
@@ -2155,7 +2162,7 @@ void TabBar::SetCurPageId( USHORT nPageId )
while ( (mbMirrored ? (pItem->maRect.Left() < mnOffX) : (pItem->maRect.Right() > nWidth)) ||
pItem->maRect.IsEmpty() )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
// Dafuer sorgen, das min. die aktuelle TabPages als
// erste TabPage sichtbar ist
if ( nNewPos >= nPos )
@@ -2186,12 +2193,12 @@ void TabBar::SetCurPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::MakeVisible( USHORT nPageId )
+void TabBar::MakeVisible( sal_uInt16 nPageId )
{
if ( !IsReallyVisible() )
return;
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// Wenn Item nicht existiert, dann nichts machen
if ( nPos != PAGE_NOT_FOUND )
@@ -2209,14 +2216,14 @@ void TabBar::MakeVisible( USHORT nPageId )
if ( mbFormat || pItem->maRect.IsEmpty() )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
}
while ( (pItem->maRect.Right() > nWidth) ||
pItem->maRect.IsEmpty() )
{
- USHORT nNewPos = mnFirstPos+1;
+ sal_uInt16 nNewPos = mnFirstPos+1;
// Dafuer sorgen, das min. die aktuelle TabPages als
// erste TabPage sichtbar ist
if ( nNewPos >= nPos )
@@ -2238,11 +2245,11 @@ void TabBar::MakeVisible( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::SetFirstPageId( USHORT nPageId )
+void TabBar::SetFirstPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
- // Wenn Item nicht existiert, dann FALSE zurueckgeben
+ // Wenn Item nicht existiert, dann sal_False zurueckgeben
if ( nPos != PAGE_NOT_FOUND )
{
if ( nPos != mnFirstPos )
@@ -2250,8 +2257,8 @@ void TabBar::SetFirstPageId( USHORT nPageId )
// Dafuer sorgen, das nach Moeglichkteit soviele Pages wie
// moeglich sichtbar sind
ImplFormat();
- USHORT nLastFirstPos = ImplGetLastFirstPos();
- USHORT nNewPos;
+ sal_uInt16 nLastFirstPos = ImplGetLastFirstPos();
+ sal_uInt16 nNewPos;
if ( nPos > nLastFirstPos )
nNewPos = nLastFirstPos;
else
@@ -2260,7 +2267,7 @@ void TabBar::SetFirstPageId( USHORT nPageId )
if ( nNewPos != mnFirstPos )
{
mnFirstPos = nNewPos;
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Leiste neu ausgeben (Achtung: mbDropPos beachten, da wenn
// dieses Flag gesetzt ist, wird direkt gepaintet)
@@ -2273,9 +2280,9 @@ void TabBar::SetFirstPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
+void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
@@ -2294,10 +2301,10 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
// -----------------------------------------------------------------------
-void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos )
+void TabBar::SelectPageRange( sal_Bool bSelect, sal_uInt16 nStartPos, sal_uInt16 nEndPos )
{
Rectangle aPaintRect;
- USHORT nPos = nStartPos;
+ sal_uInt16 nPos = nStartPos;
ImplTabBarItem* pItem = seek( nPos );
while ( pItem && (nPos <= nEndPos) )
{
@@ -2318,9 +2325,9 @@ void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos )
// -----------------------------------------------------------------------
-USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const
+sal_uInt16 TabBar::GetSelectPage( sal_uInt16 nSelIndex ) const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
@@ -2336,9 +2343,9 @@ USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const
// -----------------------------------------------------------------------
-USHORT TabBar::GetSelectPageCount() const
+sal_uInt16 TabBar::GetSelectPageCount() const
{
- USHORT nSelected = 0;
+ sal_uInt16 nSelected = 0;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
ImplTabBarItem* pItem = (*mpItemList)[ i ];
@@ -2351,22 +2358,22 @@ USHORT TabBar::GetSelectPageCount() const
// -----------------------------------------------------------------------
-BOOL TabBar::IsPageSelected( USHORT nPageId ) const
+sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->mbSelect;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL TabBar::StartEditMode( USHORT nPageId )
+sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) )
- return FALSE;
+ return sal_False;
mnEditId = nPageId;
if ( StartRenaming() )
@@ -2418,23 +2425,23 @@ BOOL TabBar::StartEditMode( USHORT nPageId )
mpEdit->GrabFocus();
mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) );
mpEdit->Show();
- return TRUE;
+ return sal_True;
}
else
{
mnEditId = 0;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void TabBar::EndEditMode( BOOL bCancel )
+void TabBar::EndEditMode( sal_Bool bCancel )
{
if ( mpEdit )
{
// call hdl
- BOOL bEnd = TRUE;
+ sal_Bool bEnd = sal_True;
mbEditCanceled = bCancel;
maEditText = mpEdit->GetText();
mpEdit->SetPostEvent();
@@ -2444,9 +2451,9 @@ void TabBar::EndEditMode( BOOL bCancel )
if ( nAllowRenaming == TABBAR_RENAMING_YES )
SetPageText( mnEditId, maEditText );
else if ( nAllowRenaming == TABBAR_RENAMING_NO )
- bEnd = FALSE;
+ bEnd = sal_False;
else // nAllowRenaming == TABBAR_RENAMING_CANCEL
- mbEditCanceled = TRUE;
+ mbEditCanceled = sal_True;
}
// renaming not allowed, than reset edit data
@@ -2466,30 +2473,30 @@ void TabBar::EndEditMode( BOOL bCancel )
// reset
maEditText.Erase();
- mbEditCanceled = FALSE;
+ mbEditCanceled = sal_False;
}
}
// -----------------------------------------------------------------------
-void TabBar::SetMirrored( BOOL bMirrored )
+void TabBar::SetMirrored( sal_Bool bMirrored )
{
if( mbMirrored != bMirrored )
{
mbMirrored = bMirrored;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
ImplInitControls(); // for button images
Resize(); // recalculates control positions
Mirror();
}
}
-void TabBar::SetEffectiveRTL( BOOL bRTL )
+void TabBar::SetEffectiveRTL( sal_Bool bRTL )
{
SetMirrored( bRTL != Application::GetSettings().GetLayoutRTL() );
}
-BOOL TabBar::IsEffectiveRTL() const
+sal_Bool TabBar::IsEffectiveRTL() const
{
return IsMirrored() != Application::GetSettings().GetLayoutRTL();
}
@@ -2501,7 +2508,7 @@ void TabBar::SetMaxPageWidth( long nMaxWidth )
if ( mnMaxPageWidth != nMaxWidth )
{
mnMaxPageWidth = nMaxWidth;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -2516,7 +2523,7 @@ void TabBar::SetSelectColor()
if ( mbSelColor )
{
maSelColor = Color( COL_TRANSPARENT );
- mbSelColor = FALSE;
+ mbSelColor = sal_False;
Invalidate();
}
}
@@ -2530,7 +2537,7 @@ void TabBar::SetSelectColor( const Color& rColor )
if ( mbSelColor )
{
maSelColor = Color( COL_TRANSPARENT );
- mbSelColor = FALSE;
+ mbSelColor = sal_False;
Invalidate();
}
}
@@ -2539,7 +2546,7 @@ void TabBar::SetSelectColor( const Color& rColor )
if ( maSelColor != rColor )
{
maSelColor = rColor;
- mbSelColor = TRUE;
+ mbSelColor = sal_True;
Invalidate();
}
}
@@ -2552,7 +2559,7 @@ void TabBar::SetSelectTextColor()
if ( mbSelTextColor )
{
maSelTextColor = Color( COL_TRANSPARENT );
- mbSelTextColor = FALSE;
+ mbSelTextColor = sal_False;
Invalidate();
}
}
@@ -2566,7 +2573,7 @@ void TabBar::SetSelectTextColor( const Color& rColor )
if ( mbSelTextColor )
{
maSelTextColor = Color( COL_TRANSPARENT );
- mbSelTextColor = FALSE;
+ mbSelTextColor = sal_False;
Invalidate();
}
}
@@ -2575,7 +2582,7 @@ void TabBar::SetSelectTextColor( const Color& rColor )
if ( maSelTextColor != rColor )
{
maSelTextColor = rColor;
- mbSelTextColor = TRUE;
+ mbSelTextColor = sal_True;
Invalidate();
}
}
@@ -2583,13 +2590,13 @@ void TabBar::SetSelectTextColor( const Color& rColor )
// -----------------------------------------------------------------------
-void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
+void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
(*mpItemList)[ nPos ]->maText = rText;
- mbSizeFormat = TRUE;
+ mbSizeFormat = sal_True;
// Leiste neu ausgeben
if ( IsReallyVisible() && IsUpdateMode() )
@@ -2601,9 +2608,9 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString TabBar::GetPageText( USHORT nPageId ) const
+XubString TabBar::GetPageText( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
return (*mpItemList)[ nPos ]->maText;
else
@@ -2612,26 +2619,26 @@ XubString TabBar::GetPageText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpText( USHORT nPageId, const XubString& rText )
+void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
}
// -----------------------------------------------------------------------
-XubString TabBar::GetHelpText( USHORT nPageId ) const
+XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
{
ImplTabBarItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2642,22 +2649,22 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabBar::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
if ( nPos != PAGE_NOT_FOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabBar::GetHelpId( USHORT nPageId ) const
+rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
+ rtl::OString aRet;
if ( nPos != PAGE_NOT_FOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->maHelpId;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -2674,10 +2681,10 @@ long TabBar::GetMinSize() const
// -----------------------------------------------------------------------
-BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+sal_Bool TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
{
if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) )
- return FALSE;
+ return sal_False;
// Testen, ob angeklickte Seite selektiert ist. Falls dies nicht
// der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
@@ -2687,11 +2694,11 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// da der Select schon den Bereich gescrollt haben kann
if ( rCEvt.IsMouseEvent() && !mbInSelect )
{
- USHORT nSelId = GetPageId( rCEvt.GetMousePosPixel() );
+ sal_uInt16 nSelId = GetPageId( rCEvt.GetMousePosPixel() );
// Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
if ( !nSelId )
- return FALSE;
+ return sal_False;
// Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
// Seite setzen und Select rufen.
@@ -2705,34 +2712,34 @@ BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
ImplSelect();
}
else
- return FALSE;
+ return sal_False;
}
}
- mbInSelect = FALSE;
+ mbInSelect = sal_False;
Region aRegion;
// Region zuweisen
rRegion = aRegion;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT TabBar::ShowDropPos( const Point& rPos )
+sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
{
ImplTabBarItem* pItem;
- USHORT nDropId;
- USHORT nNewDropPos;
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nDropId;
+ sal_uInt16 nNewDropPos;
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
short nScroll = 0;
if ( rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF )
{
pItem = (*mpItemList)[ mpItemList->size()-1 ];
if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) )
- nNewDropPos = (USHORT)mpItemList->size();
+ nNewDropPos = (sal_uInt16)mpItemList->size();
else
{
nNewDropPos = mnFirstPos+1;
@@ -2768,12 +2775,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
if ( mbDropPos )
HideDropPos();
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
mnDropPos = nNewDropPos;
if ( nScroll )
{
- USHORT nOldFirstPos = mnFirstPos;
+ sal_uInt16 nOldFirstPos = mnFirstPos;
SetFirstPageId( GetPageId( mnFirstPos+nScroll ) );
// Direkt ausgeben, da kein Paint bei Drag and Drop moeglich
@@ -2790,7 +2797,7 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
Color aBlackColor( COL_BLACK );
long nX;
long nY = (maWinSize.Height()/2)-1;
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
SetLineColor( aBlackColor );
if ( mnDropPos < nItemCount )
@@ -2834,7 +2841,7 @@ void TabBar::HideDropPos()
long nX;
long nY1 = (maWinSize.Height()/2)-3;
long nY2 = nY1 + 5;
- USHORT nItemCount = (USHORT)mpItemList->size();
+ sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size();
if ( mnDropPos < nItemCount )
{
@@ -2861,17 +2868,17 @@ void TabBar::HideDropPos()
SetClipRegion();
}
- mbDropPos = FALSE;
+ mbDropPos = sal_False;
mnDropPos = 0;
}
}
// -----------------------------------------------------------------------
-BOOL TabBar::SwitchPage( const Point& rPos )
+sal_Bool TabBar::SwitchPage( const Point& rPos )
{
- BOOL bSwitch = FALSE;
- USHORT nSwitchId = GetPageId( rPos );
+ sal_Bool bSwitch = sal_False;
+ sal_uInt16 nSwitchId = GetPageId( rPos );
if ( !nSwitchId )
EndSwitchPage();
else
@@ -2888,16 +2895,16 @@ BOOL TabBar::SwitchPage( const Point& rPos )
{
if ( Time::GetSystemTicks() > mnSwitchTime+500 )
{
- mbInSwitching = TRUE;
+ mbInSwitching = sal_True;
if ( ImplDeactivatePage() )
{
SetCurPageId( mnSwitchId );
Update();
ImplActivatePage();
ImplSelect();
- bSwitch = TRUE;
+ bSwitch = sal_True;
}
- mbInSwitching = FALSE;
+ mbInSwitching = sal_False;
}
}
}
diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx
index 8298374fb40b..8d3a6abce18f 100644..100755
--- a/svtools/source/control/taskbar.cxx
+++ b/svtools/source/control/taskbar.cxx
@@ -32,10 +32,9 @@
#define _TASKBAR_CXX
#include <tools/debug.hxx>
-
#include <vcl/floatwin.hxx>
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -77,9 +76,9 @@ TaskBar::TaskBar( Window* pParent, WinBits nWinStyle ) :
mnOldStatusWidth = 0;
mnLines = 1;
mnWinBits = nWinStyle;
- mbStatusText = FALSE;
- mbShowItems = FALSE;
- mbAutoHide = FALSE;
+ mbStatusText = sal_False;
+ mbShowItems = sal_False;
+ mbAutoHide = sal_False;
ImplInitSettings();
}
@@ -310,13 +309,13 @@ void TaskBar::Resize()
if ( pTempButtonBar )
{
- USHORT i = 0;
- BOOL bVisibleItems = FALSE;
+ sal_uInt16 i = 0;
+ sal_Bool bVisibleItems = sal_False;
while ( i < pTempButtonBar->GetItemCount() )
{
if ( pTempButtonBar->IsItemVisible( pTempButtonBar->GetItemId( i ) ) )
{
- bVisibleItems = TRUE;
+ bVisibleItems = sal_True;
break;
}
i++;
@@ -465,14 +464,14 @@ void TaskBar::Format()
// -----------------------------------------------------------------------
-void TaskBar::SetLines( USHORT nLines )
+void TaskBar::SetLines( sal_uInt16 nLines )
{
mnLines = nLines;
}
// -----------------------------------------------------------------------
-void TaskBar::EnableAutoHide( BOOL bAutoHide )
+void TaskBar::EnableAutoHide( sal_Bool bAutoHide )
{
mbAutoHide = bAutoHide;
@@ -494,14 +493,14 @@ void TaskBar::ShowStatusText( const String& rText )
{
if ( !mbStatusText )
{
- mbStatusText = TRUE;
+ mbStatusText = sal_True;
if ( mpStatusBar->AreItemsVisible() )
{
- mbShowItems = TRUE;
+ mbShowItems = sal_True;
mpStatusBar->HideItems();
}
else
- mbShowItems = TRUE;
+ mbShowItems = sal_True;
maOldText = mpStatusBar->GetText();
Resize();
mpStatusBar->SetText( rText );
@@ -519,7 +518,7 @@ void TaskBar::HideStatusText()
{
if ( mbStatusText && mpStatusBar )
{
- mbStatusText = FALSE;
+ mbStatusText = sal_False;
mpStatusBar->SetText( maOldText );
Resize();
if ( mbShowItems )
diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx
index 21cf187b6cea..0215c1835f1d 100644..100755
--- a/svtools/source/control/taskbox.cxx
+++ b/svtools/source/control/taskbox.cxx
@@ -34,8 +34,7 @@
#include <tools/debug.hxx>
#include <vcl/image.hxx>
#include <vcl/help.hxx>
-
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -58,7 +57,7 @@ TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) :
mnMaxTextWidth = 0;
mnActiveItemId = 0;
mnSmallItem = TOOLBOX_ITEM_NOTFOUND;
- mbMinActivate = FALSE;
+ mbMinActivate = sal_False;
SetAlign( WINDOWALIGN_BOTTOM );
SetButtonType( BUTTON_SYMBOLTEXT );
@@ -77,14 +76,14 @@ TaskToolBox::~TaskToolBox()
// -----------------------------------------------------------------------
-void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate )
+void TaskToolBox::ActivateTaskItem( sal_uInt16 nItemId, sal_Bool bMinActivate )
{
if ( nItemId )
{
if ( nItemId != mnActiveItemId )
{
if ( mnActiveItemId )
- CheckItem( mnActiveItemId, FALSE );
+ CheckItem( mnActiveItemId, sal_False );
CheckItem( nItemId );
mnActiveItemId = nItemId;
}
@@ -93,11 +92,11 @@ void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate )
if ( !bMinActivate )
return;
- mbMinActivate = TRUE;
+ mbMinActivate = sal_True;
}
ActivateTask();
- mbMinActivate = FALSE;
+ mbMinActivate = sal_False;
}
}
@@ -183,8 +182,8 @@ void TaskToolBox::RequestHelp( const HelpEvent& rHEvt )
void TaskToolBox::Select()
{
- USHORT nItemId = GetCurItemId();
- ActivateTaskItem( nItemId, TRUE );
+ sal_uInt16 nItemId = GetCurItemId();
+ ActivateTaskItem( nItemId, sal_True );
}
// -----------------------------------------------------------------------
@@ -225,7 +224,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
}
// Eintraege aus der ToolBox entfernen, die ersetzt werden
- USHORT nBtnPos = (mnUpdateNewPos*2);
+ sal_uInt16 nBtnPos = (mnUpdateNewPos*2);
while ( nBtnPos < GetItemCount() )
RemoveItem( nBtnPos );
if ( mnUpdateNewPos <= (mnActiveItemId-1) )
@@ -256,7 +255,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) );
}
- USHORT nItemId = i+1;
+ sal_uInt16 nItemId = i+1;
if ( aText.EqualsAscii( "..." ) )
InsertItem( nItemId, pItem->maImage, TIB_LEFT );
else
@@ -271,7 +270,7 @@ void TaskToolBox::ImplFormatTaskToolBox()
if ( mnNewActivePos+1 != mnActiveItemId )
{
if ( mnActiveItemId )
- CheckItem( mnActiveItemId, FALSE );
+ CheckItem( mnActiveItemId, sal_False );
mnActiveItemId = mnNewActivePos+1;
CheckItem( mnActiveItemId );
}
@@ -290,7 +289,7 @@ void TaskToolBox::StartUpdateTask()
// -----------------------------------------------------------------------
void TaskToolBox::UpdateTask( const Image& rImage, const String& rText,
- BOOL bActive )
+ sal_Bool bActive )
{
ImplTaskItem* pItem = ( mnUpdatePos < mpItemList->size() ) ? (*mpItemList)[ mnUpdatePos ] : NULL;
if ( pItem )
diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx
index 8c367a7d135a..1476cacb76fb 100644..100755
--- a/svtools/source/control/taskmisc.cxx
+++ b/svtools/source/control/taskmisc.cxx
@@ -33,8 +33,7 @@
#include <tools/debug.hxx>
#include <vcl/help.hxx>
-
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -74,9 +73,9 @@ WindowArrange::~WindowArrange()
// -----------------------------------------------------------------------
-static USHORT ImplCeilSqareRoot( USHORT nVal )
+static sal_uInt16 ImplCeilSqareRoot( sal_uInt16 nVal )
{
- USHORT i;
+ sal_uInt16 i;
// Ueberlauf verhindern
if ( nVal > 0xFE * 0xFE )
@@ -104,19 +103,19 @@ static void ImplPosSizeWindow( Window* pWindow,
void WindowArrange::ImplTile( const Rectangle& rRect )
{
- USHORT nCount = (USHORT)mpWinList->Count();
+ sal_uInt16 nCount = (sal_uInt16)mpWinList->Count();
if ( nCount < 3 )
{
ImplVert( rRect );
return;
}
- USHORT i;
- USHORT j;
- USHORT nCols;
- USHORT nRows;
- USHORT nActRows;
- USHORT nOffset;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nCols;
+ sal_uInt16 nRows;
+ sal_uInt16 nActRows;
+ sal_uInt16 nOffset;
long nOverWidth;
long nOverHeight;
Window* pWindow;
@@ -354,7 +353,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void WindowArrange::Arrange( USHORT nType, const Rectangle& rRect )
+void WindowArrange::Arrange( sal_uInt16 nType, const Rectangle& rRect )
{
if ( !mpWinList->Count() )
return;
diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx
index 03c5199391a4..b94aae25a88f 100644..100755
--- a/svtools/source/control/taskstat.cxx
+++ b/svtools/source/control/taskstat.cxx
@@ -37,9 +37,8 @@
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
#include <unotools/calendarwrapper.hxx>
-
#include <unotools/syslocale.hxx>
-#include <taskbar.hxx>
+#include <svtools/taskbar.hxx>
// =======================================================================
@@ -51,43 +50,43 @@
struct ImplTaskSBFldItem
{
TaskStatusFieldItem maItem;
- USHORT mnId;
+ sal_uInt16 mnId;
long mnOffX;
};
// =======================================================================
-BOOL ITaskStatusNotify::MouseButtonDown( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseButtonDown( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::MouseButtonUp( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseButtonUp( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::MouseMove( USHORT, const MouseEvent& )
+sal_Bool ITaskStatusNotify::MouseMove( sal_uInt16, const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::Command( USHORT, const CommandEvent& )
+sal_Bool ITaskStatusNotify::Command( sal_uInt16, const CommandEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ITaskStatusNotify::UpdateHelp( USHORT )
+sal_Bool ITaskStatusNotify::UpdateHelp( sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -115,7 +114,7 @@ TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify,
const Image& rImage,
const XubString& rQuickHelpText,
const XubString& rHelpText,
- USHORT nFlags ) :
+ sal_uInt16 nFlags ) :
mpNotify( pNotify ),
maImage( rImage ),
maQuickHelpText( rQuickHelpText ),
@@ -155,8 +154,8 @@ TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) :
mnItemWidth = 0;
mnFieldWidth = 0;
mnFieldFlags = 0;
- mbFlashItems = FALSE;
- mbOutInterval = FALSE;
+ mbFlashItems = sal_False;
+ mbOutInterval = sal_False;
maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) );
}
@@ -179,9 +178,9 @@ TaskStatusBar::~TaskStatusBar()
IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG )
{
- BOOL bUpdate = ImplUpdateClock();
+ sal_Bool bUpdate = ImplUpdateClock();
if ( ImplUpdateFlashItems() )
- bUpdate = TRUE;
+ bUpdate = sal_True;
if ( bUpdate )
SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL );
@@ -190,7 +189,7 @@ IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( sal_uInt16 nItemId ) const
{
if ( !mpFieldItemList )
return NULL;
@@ -205,11 +204,11 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const
// -----------------------------------------------------------------------
-ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, sal_Bool& rFieldRect ) const
{
if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID )
{
- rFieldRect = TRUE;
+ rFieldRect = sal_True;
if ( mpFieldItemList )
{
@@ -223,14 +222,14 @@ ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFi
}
}
else
- rFieldRect = FALSE;
+ rFieldRect = sal_False;
return NULL;
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::ImplUpdateClock()
+sal_Bool TaskStatusBar::ImplUpdateClock()
{
if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
{
@@ -240,55 +239,55 @@ BOOL TaskStatusBar::ImplUpdateClock()
(aTime.GetHour() != maTime.GetHour()) )
{
maTime = aTime;
- maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, FALSE, FALSE );
- return TRUE;
+ maTimeText = SvtSysLocale().GetLocaleData().getTime( aTime, sal_False, sal_False );
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::ImplUpdateFlashItems()
+sal_Bool TaskStatusBar::ImplUpdateFlashItems()
{
if ( mbFlashItems )
{
if ( mbOutInterval )
{
maTimer.SetTimeout( 900 );
- mbOutInterval = FALSE;
+ mbOutInterval = sal_False;
}
else
{
maTimer.SetTimeout( 700 );
- mbOutInterval = TRUE;
+ mbOutInterval = sal_True;
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TaskStatusBar::ImplUpdateField( BOOL bItems )
+void TaskStatusBar::ImplUpdateField( sal_Bool bItems )
{
maTimer.Stop();
if ( bItems )
{
mnItemWidth = 0;
- mbFlashItems = FALSE;
- mbOutInterval = FALSE;
+ mbFlashItems = sal_False;
+ mbOutInterval = sal_False;
for ( size_t i = 0, n = mpFieldItemList->size(); i < n; ++i ) {
ImplTaskSBFldItem* pItem = (*mpFieldItemList)[ i ];
mnItemWidth += TASKSTATUSBAR_IMAGEOFFX;
pItem->mnOffX = mnItemWidth;
mnItemWidth += pItem->maItem.GetImage().GetSizePixel().Width();
if ( pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH ) {
- mbFlashItems = TRUE;
+ mbFlashItems = sal_True;
}
}
}
@@ -296,7 +295,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
{
if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
{
- XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), FALSE, FALSE );
+ XubString aStr = SvtSysLocale().GetLocaleData().getTime( Time( 23, 59, 59 ), sal_False, sal_False );
mnClockWidth = GetTextWidth( aStr )+(TASKSTATUSBAR_CLOCXOFFX*2);
}
else
@@ -314,7 +313,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
{
mnFieldWidth = nNewWidth;
long nOffset = GetItemOffset( TASKSTATUSBAR_STATUSFIELDID );
- USHORT nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID );
+ sal_uInt16 nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID );
InsertItem( TASKSTATUSBAR_STATUSFIELDID, nNewWidth, SIB_RIGHT | SIB_IN | SIB_USERDRAW, nOffset, nItemPos );
}
else
@@ -329,7 +328,7 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
if ( mbFlashItems || (mnFieldFlags & TASKSTATUSFIELD_CLOCK) )
{
ImplUpdateClock();
- mbOutInterval = TRUE;
+ mbOutInterval = sal_True;
ImplUpdateFlashItems();
maTimer.Start();
}
@@ -339,12 +338,12 @@ void TaskStatusBar::ImplUpdateField( BOOL bItems )
void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -366,12 +365,12 @@ void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -393,12 +392,12 @@ void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
void TaskStatusBar::MouseMove( const MouseEvent& rMEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -420,12 +419,12 @@ void TaskStatusBar::MouseMove( const MouseEvent& rMEvt )
void TaskStatusBar::Command( const CommandEvent& rCEvt )
{
- BOOL bFieldRect;
- BOOL bBaseClass = FALSE;
+ sal_Bool bFieldRect;
+ sal_Bool bBaseClass = sal_False;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect );
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( bFieldRect )
nItemId = TASKSTATUSBAR_CLOCKID;
@@ -447,12 +446,12 @@ void TaskStatusBar::Command( const CommandEvent& rCEvt )
void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
- BOOL bFieldRect;
+ sal_Bool bFieldRect;
ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect );
if ( bFieldRect )
{
ITaskStatusNotify* pNotify = mpNotify;
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if ( pItem )
{
@@ -502,13 +501,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( pItem )
{
- ULONG nHelpId = pItem->maItem.GetHelpId();
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -557,28 +556,28 @@ void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt )
// -----------------------------------------------------------------------
-void TaskStatusBar::InsertStatusField( long, USHORT,
- USHORT nFlags )
+void TaskStatusBar::InsertStatusField( long, sal_uInt16,
+ sal_uInt16 nFlags )
{
mnFieldFlags = nFlags;
- ImplUpdateField( FALSE );
+ ImplUpdateField( sal_False );
}
// -----------------------------------------------------------------------
-void TaskStatusBar::SetFieldFlags( USHORT nFlags )
+void TaskStatusBar::SetFieldFlags( sal_uInt16 nFlags )
{
if ( mnFieldFlags != nFlags )
{
mnFieldFlags = nFlags;
- ImplUpdateField( FALSE );
+ ImplUpdateField( sal_False );
}
}
// -----------------------------------------------------------------------
-void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem,
- USHORT nPos )
+void TaskStatusBar::AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem,
+ sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" );
DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" );
@@ -598,27 +597,27 @@ void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldIte
mpFieldItemList->push_back( pItem );
}
- ImplUpdateField( TRUE );
+ ImplUpdateField( sal_True );
}
// -----------------------------------------------------------------------
-void TaskStatusBar::ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem )
+void TaskStatusBar::ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem )
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
{
- BOOL bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) ||
+ sal_Bool bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) ||
(pItem->maItem.GetFlags() != rItem.GetFlags());
pItem->maItem = rItem;
if ( bUpdate )
- ImplUpdateField( TRUE );
+ ImplUpdateField( sal_True );
}
}
// -----------------------------------------------------------------------
-void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId )
+void TaskStatusBar::RemoveStatusFieldItem( sal_uInt16 nItemId )
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
@@ -633,22 +632,21 @@ void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId )
break;
}
}
- ImplUpdateField( TRUE );
}
}
// -----------------------------------------------------------------------
-BOOL TaskStatusBar::GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const
+sal_Bool TaskStatusBar::GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const
{
ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
if ( pItem )
{
rItem = pItem->maItem;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index a24673fe4bb5..fcb749cdc0d8 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -164,7 +164,7 @@ const Reference< XAccessibleContext >& ToolbarMenuEntry::GetAccessible( bool bCr
{
if( mpControl )
{
- mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( TRUE ), UNO_QUERY );
+ mxAccContext = Reference< XAccessibleContext >( mpControl->GetAccessible( sal_True ), UNO_QUERY );
}
else
{
@@ -912,7 +912,7 @@ void ToolbarMenu::appendSeparator()
ValueSet* ToolbarMenu::createEmptyValueSetControl()
{
ValueSet* pSet = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
- pSet->EnableFullItemMode( FALSE );
+ pSet->EnableFullItemMode( sal_False );
pSet->SetColor( GetControlBackground() );
pSet->SetHighlightHdl( LINK( this, ToolbarMenu, HighlightHdl ) );
return pSet;
@@ -996,7 +996,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
{
bDrawItemRect = false;
- if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
+ if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ),
ImplControlValue(),
@@ -1086,7 +1086,7 @@ void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool bMBDown )
Size aOutSz = GetOutputSizePixel();
if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) )
{
- bool bHighlighted = FALSE;
+ bool bHighlighted = sal_False;
const int nEntryCount = mpImpl->maEntryVector.size();
int nEntry;
@@ -1161,11 +1161,11 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa
ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl );
if( pValueSet )
{
- USHORT nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() );
+ sal_uInt16 nItemPos = pValueSet->GetItemPos( pValueSet->GetSelectItemId() );
if( nItemPos != VALUESET_ITEM_NOTFOUND )
{
- const USHORT nColCount = pValueSet->GetColCount();
- const USHORT nLine = nItemPos / nColCount;
+ const sal_uInt16 nColCount = pValueSet->GetColCount();
+ const sal_uInt16 nLine = nItemPos / nColCount;
nLastColumn = nItemPos - (nLine * nColCount);
@@ -1175,7 +1175,7 @@ static bool implCheckSubControlCursorMove( Control* pControl, bool bUp, int& nLa
}
else
{
- const USHORT nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount;
+ const sal_uInt16 nLineCount = (pValueSet->GetItemCount() + nColCount - 1) / nColCount;
return (nLine+1) < nLineCount;
}
}
@@ -1264,19 +1264,19 @@ ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd )
// --------------------------------------------------------------------
-void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl )
+void ToolbarMenu_Impl::implHighlightControl( sal_uInt16 nCode, Control* pControl )
{
ValueSet* pValueSet = dynamic_cast< ValueSet* >( pControl );
if( pValueSet )
{
- const USHORT nItemCount = pValueSet->GetItemCount();
- USHORT nItemPos = VALUESET_ITEM_NOTFOUND;
+ const sal_uInt16 nItemCount = pValueSet->GetItemCount();
+ sal_uInt16 nItemPos = VALUESET_ITEM_NOTFOUND;
switch( nCode )
{
case KEY_UP:
{
- const USHORT nColCount = pValueSet->GetColCount();
- const USHORT nLastLine = nItemCount / nColCount;
+ const sal_uInt16 nColCount = pValueSet->GetColCount();
+ const sal_uInt16 nLastLine = nItemCount / nColCount;
nItemPos = std::min( ((nLastLine-1) * nColCount) + mnLastColumn, nItemCount-1 );
break;
}
@@ -1300,7 +1300,7 @@ void ToolbarMenu_Impl::implHighlightControl( USHORT nCode, Control* pControl )
void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
{
Control* pForwardControl = 0;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
switch ( nCode )
{
case KEY_UP:
@@ -1377,7 +1377,7 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
// --------------------------------------------------------------------
static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
@@ -1394,13 +1394,13 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
{
const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() );
- i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor );
+ i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor );
}
}
void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
{
- USHORT nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu
+ sal_uInt16 nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu
long nFontHeight = GetTextHeight();
// long nExtra = nFontHeight/4;
@@ -1450,9 +1450,9 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
{
long nTextOffsetY = ((pEntry->maSize.Height()-nFontHeight)/2);
- USHORT nTextStyle = 0;
- USHORT nSymbolStyle = 0;
- USHORT nImageStyle = 0;
+ sal_uInt16 nTextStyle = 0;
+ sal_uInt16 nSymbolStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if( !pEntry->mbEnabled )
{
@@ -1565,7 +1565,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos);
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
DrawCtrlText( aTmpPos, pEntry->maText, 0, pEntry->maText.Len(), nStyle, NULL, NULL ); // pVector, pDisplayText );
}
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 1650c99e7d52..340fbeacb008 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -214,7 +214,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getAccessibleIndexInParent() throw (RuntimeEx
Window* pParent = mpParent->mrMenu.GetParent();
if( pParent )
{
- for( USHORT i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ )
+ for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); i < nCount ; i++ )
{
if( pParent->GetChild( i ) == &mpParent->mrMenu )
return i;
@@ -253,7 +253,7 @@ OUString SAL_CALL ToolbarMenuAcc::getAccessibleName() throw (RuntimeException)
if( !aRet.getLength() )
{
- Window* pLabel = mpParent->mrMenu.GetLabeledBy();
+ Window* pLabel = mpParent->mrMenu.GetAccessibleRelationLabeledBy();
if( pLabel && pLabel != &mpParent->mrMenu )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
@@ -474,7 +474,7 @@ Any SAL_CALL ToolbarMenuAcc::getAccessibleKeyBinding() throw (RuntimeException)
sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -483,7 +483,7 @@ sal_Int32 SAL_CALL ToolbarMenuAcc::getForeground() throw (RuntimeException)
sal_Int32 SAL_CALL ToolbarMenuAcc::getBackground() throw (RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx
index 0df8c8e78045..f6c60d3d2193 100644
--- a/svtools/source/control/toolbarmenuimp.hxx
+++ b/svtools/source/control/toolbarmenuimp.hxx
@@ -309,7 +309,7 @@ struct ToolbarMenu_Impl
ToolbarMenuEntry* implGetEntry( int nEntry ) const;
void notifyHighlightedEntry();
- void implHighlightControl( USHORT nCode, Control* pControl );
+ void implHighlightControl( sal_uInt16 nCode, Control* pControl );
};
}
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 7b77bb1e0933..e558a72ae33a 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -227,7 +227,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
uno::Reference< accessibility::XAccessible > xRet;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(i));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i));
if( pItem )
xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
@@ -267,7 +267,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getAccessibleIndexInParent()
{
sal_Bool bFound = sal_False;
- for( USHORT i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ )
+ for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ )
{
if( pParent->GetChild( i ) == mpParent )
{
@@ -319,7 +319,7 @@ sal_Int16 SAL_CALL ValueSetAcc::getAccessibleRole()
if ( !aRet.Len() )
{
- Window* pLabel = mpParent->GetLabeledBy();
+ Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != mpParent )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
@@ -452,10 +452,10 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- const USHORT nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
+ const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
uno::Reference< accessibility::XAccessible > xRet;
- if( ((USHORT)-1) != nItemId )
+ if( ((sal_uInt16)-1) != nItemId )
{
const size_t nItemPos = mpParent->GetItemPos( nItemId );
@@ -561,7 +561,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getForeground( )
throw (uno::RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -571,7 +571,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getBackground( )
throw (uno::RuntimeException)
{
ThrowIfDisposed();
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -582,7 +582,7 @@ void SAL_CALL ValueSetAcc::selectAccessibleChild( sal_Int32 nChildIndex )
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
if(pItem != NULL)
{
@@ -600,7 +600,7 @@ sal_Bool SAL_CALL ValueSetAcc::isAccessibleChildSelected( sal_Int32 nChildIndex
{
ThrowIfDisposed();
const SolarMutexGuard aSolarGuard;
- ValueSetItem* pItem = getItem (sal::static_int_cast< USHORT >(nChildIndex));
+ ValueSetItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
sal_Bool bRet = sal_False;
if (pItem != NULL)
@@ -639,7 +639,7 @@ sal_Int32 SAL_CALL ValueSetAcc::getSelectedAccessibleChildCount()
const SolarMutexGuard aSolarGuard;
sal_Int32 nRet = 0;
- for( USHORT i = 0, nCount = getItemCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ )
{
ValueSetItem* pItem = getItem (i);
@@ -659,7 +659,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getSelectedAc
const SolarMutexGuard aSolarGuard;
uno::Reference< accessibility::XAccessible > xRet;
- for( USHORT i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
+ for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
{
ValueSetItem* pItem = getItem(i);
@@ -736,9 +736,9 @@ void SAL_CALL ValueSetAcc::disposing (void)
}
-USHORT ValueSetAcc::getItemCount (void) const
+sal_uInt16 ValueSetAcc::getItemCount (void) const
{
- USHORT nCount = mpParent->ImplGetVisibleItemCount();
+ sal_uInt16 nCount = mpParent->ImplGetVisibleItemCount();
// When the None-Item is visible then increase the number of items by
// one.
if (HasNoneField())
@@ -747,7 +747,7 @@ USHORT ValueSetAcc::getItemCount (void) const
}
-ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const
+ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const
{
ValueSetItem* pItem = NULL;
@@ -761,7 +761,7 @@ ValueSetItem* ValueSetAcc::getItem (USHORT nIndex) const
nIndex -= 1;
}
if (pItem == NULL)
- pItem = mpParent->ImplGetVisibleItem (static_cast<USHORT>(nIndex));
+ pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex));
return pItem;
}
@@ -937,9 +937,9 @@ sal_Int32 SAL_CALL ValueItemAcc::getAccessibleIndexInParent()
{
bool bDone = false;
- USHORT nCount = mpParent->mrParent.ImplGetVisibleItemCount();
+ sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount();
ValueSetItem* pItem;
- for (USHORT i=0; i<nCount && !bDone; i++)
+ for (sal_uInt16 i=0; i<nCount && !bDone; i++)
{
// Guard the retrieval of the i-th child with a try/catch block
// just in case the number of children changes in the mean time.
@@ -1228,7 +1228,7 @@ uno::Any SAL_CALL ValueItemAcc::getAccessibleKeyBinding()
sal_Int32 SAL_CALL ValueItemAcc::getForeground( )
throw (uno::RuntimeException)
{
- UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+ sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
return static_cast<sal_Int32>(nColor);
}
@@ -1237,7 +1237,7 @@ sal_Int32 SAL_CALL ValueItemAcc::getForeground( )
sal_Int32 SAL_CALL ValueItemAcc::getBackground( )
throw (uno::RuntimeException)
{
- UINT32 nColor;
+ sal_uInt32 nColor;
if (mpParent && mpParent->meType == VALUESETITEM_COLOR)
nColor = mpParent->maColor.GetColor();
else
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index 3df14947481f..7e5ccc196a55 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -81,8 +81,8 @@ class ValueSet;
struct ValueSetItem
{
ValueSet& mrParent;
- USHORT mnId;
- USHORT mnBits;
+ sal_uInt16 mnId;
+ sal_uInt16 mnBits;
ValueSetItemType meType;
Image maImage;
Color maColor;
@@ -138,7 +138,7 @@ public:
~ValueSetAcc();
void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
+ sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
static ValueSetAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
@@ -217,7 +217,7 @@ private:
/** Return the number of items. This takes the None-Item into account.
*/
- USHORT getItemCount (void) const;
+ sal_uInt16 getItemCount (void) const;
/** Return the item associated with the given index. The None-Item is
taken into account which, when present, is taken to be the first
@@ -228,7 +228,7 @@ private:
@return
Returns NULL when the given index is out of range.
*/
- ValueSetItem* getItem (USHORT nIndex) const;
+ ValueSetItem* getItem (sal_uInt16 nIndex) const;
/** Check whether or not the object has been disposed (or is in the
state of beeing disposed). If that is the case then
@@ -283,7 +283,7 @@ public:
void ParentDestroyed();
void FireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- BOOL HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
+ sal_Bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); }
static ValueItemAcc* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 87888d148f53..c3be233cb917 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -70,21 +70,21 @@ void ValueSet::ImplInit()
mnUserVisLines = 0;
mnSpacing = 0;
mnFrameStyle = 0;
- mbFormat = TRUE;
- mbHighlight = FALSE ;
- mbSelection = FALSE;
- mbNoSelection = TRUE;
- mbDrawSelection = TRUE;
- mbBlackSel = FALSE;
- mbDoubleSel = FALSE;
- mbScroll = FALSE;
- mbDropPos = FALSE;
- mbFullMode = TRUE;
+ mbFormat = sal_True;
+ mbHighlight = sal_False ;
+ mbSelection = sal_False;
+ mbNoSelection = sal_True;
+ mbDrawSelection = sal_True;
+ mbBlackSel = sal_False;
+ mbDoubleSel = sal_False;
+ mbScroll = sal_False;
+ mbDropPos = sal_False;
+ mbFullMode = sal_True;
// #106446#, #106601# force mirroring of virtual device
maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -116,7 +116,7 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient
ValueSet::~ValueSet()
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
- xComponent (GetAccessible(FALSE), ::com::sun::star::uno::UNO_QUERY);
+ xComponent (GetAccessible(sal_False), ::com::sun::star::uno::UNO_QUERY);
if (xComponent.is())
xComponent->dispose ();
@@ -153,8 +153,8 @@ void ValueSet::ImplDeleteItems()
// -----------------------------------------------------------------------
-void ValueSet::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ValueSet::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -312,7 +312,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
aPos.X() += (aRectSize.Width()-aImageSize.Width())/2;
aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2;
- USHORT nImageStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if( !IsEnabled() )
nImageStyle |= IMAGE_DRAW_DISABLE;
@@ -422,7 +422,7 @@ void ValueSet::Format()
{
if ( mnUserItemWidth )
{
- mnCols = (USHORT)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace));
+ mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace));
if ( !mnCols )
mnCols = 1;
}
@@ -433,7 +433,7 @@ void ValueSet::Format()
mnCols = mnUserCols;
// Zeilenanzahl berechnen
- mbScroll = FALSE;
+ mbScroll = sal_False;
mnLines = (long)mpImpl->mpItemList->size() / mnCols;
if ( mpImpl->mpItemList->size() % mnCols )
mnLines++;
@@ -452,13 +452,13 @@ void ValueSet::Format()
else
mnVisLines = mnLines;
if ( mnLines > mnVisLines )
- mbScroll = TRUE;
+ mbScroll = sal_True;
if ( mnLines <= mnVisLines )
mnFirstLine = 0;
else
{
- if ( mnFirstLine > (USHORT)(mnLines-mnVisLines) )
- mnFirstLine = (USHORT)(mnLines-mnVisLines);
+ if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) )
+ mnFirstLine = (sal_uInt16)(mnLines-mnVisLines);
}
// Itemgroessen berechnen
@@ -489,7 +489,7 @@ void ValueSet::Format()
// Init VirDev
maVirDev.SetSettings( GetSettings() );
maVirDev.SetBackground( GetBackground() );
- maVirDev.SetOutputSizePixel( aWinSize, TRUE );
+ maVirDev.SetOutputSizePixel( aWinSize, sal_True );
// Bei zu kleinen Items machen wir nichts
long nMinHeight = 2;
@@ -532,17 +532,17 @@ void ValueSet::Format()
(aHighColor.GetBlue() > 0x80)) ||
((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
(aHighColor.GetBlue() == 0x80)) )
- mbBlackSel = TRUE;
+ mbBlackSel = sal_True;
else
- mbBlackSel = FALSE;
+ mbBlackSel = sal_False;
// Wenn die Items groesser sind, dann die Selektion doppelt so breit
// zeichnen
if ( (nStyle & WB_DOUBLEBORDER) &&
((nItemWidth >= 25) && (nItemHeight >= 20)) )
- mbDoubleSel = TRUE;
+ mbDoubleSel = sal_True;
else
- mbDoubleSel = FALSE;
+ mbDoubleSel = sal_False;
// Calculate offsets
long nStartX;
@@ -584,8 +584,8 @@ void ValueSet::Format()
}
// draw items
- ULONG nFirstItem = mnFirstLine * mnCols;
- ULONG nLastItem = nFirstItem + (mnVisLines * mnCols);
+ sal_uLong nFirstItem = mnFirstLine * mnCols;
+ sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols);
if ( !mbFullMode )
{
@@ -601,7 +601,7 @@ void ValueSet::Format()
if ( (i >= nFirstItem) && (i < nLastItem) )
{
- const BOOL bWasEmpty = pItem->maRect.IsEmpty();
+ const sal_Bool bWasEmpty = pItem->maRect.IsEmpty();
pItem->maRect.Left() = x;
pItem->maRect.Top() = y;
@@ -664,7 +664,7 @@ void ValueSet::Format()
}
// Jetzt haben wir formatiert und warten auf das naechste
- mbFormat = FALSE;
+ mbFormat = sal_False;
// ScrollBar loeschen
if ( pDelScrBar )
@@ -706,13 +706,13 @@ void ValueSet::ImplDrawSelect()
if ( !IsReallyVisible() )
return;
- BOOL bFocus = HasFocus();
- BOOL bDrawSel;
+ sal_Bool bFocus = HasFocus();
+ sal_Bool bDrawSel;
if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) )
- bDrawSel = FALSE;
+ bDrawSel = sal_False;
else
- bDrawSel = TRUE;
+ bDrawSel = sal_True;
if ( !bFocus &&
((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) )
@@ -722,7 +722,7 @@ void ValueSet::ImplDrawSelect()
return;
}
- USHORT nItemId = mnSelItemId;
+ sal_uInt16 nItemId = mnSelItemId;
for( int stage = 0; stage < 2; stage++ )
{
@@ -895,12 +895,12 @@ void ValueSet::ImplDrawSelect()
// -----------------------------------------------------------------------
-void ValueSet::ImplHideSelect( USHORT nItemId )
+void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
{
Rectangle aRect;
- USHORT nItemPos = GetItemPos( nItemId );
- if ( nItemPos != sal::static_int_cast<USHORT>(LIST_ENTRY_NOTFOUND) )
+ sal_uInt16 nItemPos = GetItemPos( nItemId );
+ if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) )
aRect = (*mpImpl->mpItemList)[ nItemPos ]->maRect;
else
{
@@ -919,42 +919,42 @@ void ValueSet::ImplHideSelect( USHORT nItemId )
// -----------------------------------------------------------------------
-void ValueSet::ImplHighlightItem( USHORT nItemId, BOOL bIsSelection )
+void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection )
{
if ( mnHighItemId != nItemId )
{
// Alten merken, um vorherige Selektion zu entfernen
- USHORT nOldItem = mnHighItemId;
+ sal_uInt16 nOldItem = mnHighItemId;
mnHighItemId = nItemId;
// Wenn keiner selektiert ist, dann Selektion nicht malen
if ( !bIsSelection && mbNoSelection )
- mbDrawSelection = FALSE;
+ mbDrawSelection = sal_False;
// Neu ausgeben und alte Selection wegnehmen
ImplHideSelect( nOldItem );
ImplDrawSelect();
- mbDrawSelection = TRUE;
+ mbDrawSelection = sal_True;
}
}
// -----------------------------------------------------------------------
-void ValueSet::ImplDrawDropPos( BOOL bShow )
+void ValueSet::ImplDrawDropPos( sal_Bool bShow )
{
if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && !mpImpl->mpItemList->empty() )
{
size_t nItemPos = mnDropPos;
- USHORT nItemId1;
- USHORT nItemId2 = 0;
- BOOL bRight;
+ sal_uInt16 nItemId1;
+ sal_uInt16 nItemId2 = 0;
+ sal_Bool bRight;
if ( nItemPos >= mpImpl->mpItemList->size() )
{
nItemPos = mpImpl->mpItemList->size() - 1;
- bRight = TRUE;
+ bRight = sal_True;
}
else
- bRight = FALSE;
+ bRight = sal_False;
nItemId1 = GetItemId( nItemPos );
if ( (nItemId1 != mnSelItemId) && (nItemId1 != mnHighItemId) )
@@ -993,7 +993,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow )
Point aPos = aRect1.RightCenter();
nX = aPos.X()-2;
nY = aPos.Y();
- for ( USHORT i = 0; i < 4; i++ )
+ for ( sal_uInt16 i = 0; i < 4; i++ )
DrawLine( Point( nX-i, nY-i ), Point( nX-i, nY+i ) );
}
if ( !aRect2.IsEmpty() )
@@ -1001,7 +1001,7 @@ void ValueSet::ImplDrawDropPos( BOOL bShow )
Point aPos = aRect2.LeftCenter();
nX = aPos.X()+2;
nY = aPos.Y();
- for ( USHORT i = 0; i < 4; i++ )
+ for ( sal_uInt16 i = 0; i < 4; i++ )
DrawLine( Point( nX+i, nY-i ), Point( nX+i, nY+i ) );
}
}
@@ -1086,7 +1086,7 @@ void ValueSet::ImplDraw()
// -----------------------------------------------------------------------
-BOOL ValueSet::ImplScroll( const Point& rPos )
+sal_Bool ValueSet::ImplScroll( const Point& rPos )
{
Size aOutSize = GetOutputSizePixel();
long nScrBarWidth;
@@ -1097,10 +1097,10 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
nScrBarWidth = 0;
if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) )
- return FALSE;
+ return sal_False;
long nScrollOffset;
- USHORT nOldLine = mnFirstLine;
+ sal_uInt16 nOldLine = mnFirstLine;
const Rectangle& rTopRect = (*mpImpl->mpItemList)[ mnFirstLine * mnCols ]->maRect;
if ( rTopRect.GetHeight() <= 16 )
nScrollOffset = VALUESET_SCROLL_OFFSET/2;
@@ -1113,7 +1113,7 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
mnFirstLine--;
}
if ( (mnFirstLine == nOldLine) &&
- (mnFirstLine < (USHORT)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
+ (mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
{
long nBottomPos = (*mpImpl->mpItemList)[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
@@ -1122,17 +1122,17 @@ BOOL ValueSet::ImplScroll( const Point& rPos )
if ( mnFirstLine != nOldLine )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-size_t ValueSet::ImplGetItem( const Point& rPos, BOOL bMove ) const
+size_t ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const
{
if ( mpNoneItem )
{
@@ -1194,9 +1194,9 @@ ValueSetItem* ValueSet::ImplGetFirstItem()
// -----------------------------------------------------------------------
-USHORT ValueSet::ImplGetVisibleItemCount() const
+sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
for( size_t n = 0, nItemCount = mpImpl->mpItemList->size(); n < nItemCount; n++ )
{
@@ -1211,10 +1211,10 @@ USHORT ValueSet::ImplGetVisibleItemCount() const
// -----------------------------------------------------------------------
-ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos )
+ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos )
{
ValueSetItem* pRet = NULL;
- USHORT nFoundPos = 0;
+ sal_uInt16 nFoundPos = 0;
for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->size(); ( n < nItemCount ) && !pRet; n++ )
{
@@ -1231,7 +1231,7 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( USHORT nVisiblePos )
void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue )
{
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue );
@@ -1239,9 +1239,9 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::
// -----------------------------------------------------------------------
-BOOL ValueSet::ImplHasAccessibleListeners()
+sal_Bool ValueSet::ImplHasAccessibleListeners()
{
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
return( pAcc && pAcc->HasAccessibleListeners() );
}
@@ -1249,11 +1249,11 @@ BOOL ValueSet::ImplHasAccessibleListeners()
IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
{
- USHORT nNewFirstLine = (USHORT)pScrollBar->GetThumbPos();
+ sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
if ( nNewFirstLine != mnFirstLine )
{
mnFirstLine = nNewFirstLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
return 0;
@@ -1263,13 +1263,13 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG )
{
- ImplTracking( GetPointerPosPixel(), TRUE );
+ ImplTracking( GetPointerPosPixel(), sal_True );
return 0;
}
// -----------------------------------------------------------------------
-void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat )
+void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat )
{
if ( bRepeat || mbSelection )
{
@@ -1288,22 +1288,22 @@ void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat )
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
ImplHighlightItem( pItem->mnId );
}
else
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
- ImplHighlightItem( mnSelItemId, FALSE );
+ ImplHighlightItem( mnSelItemId, sal_False );
}
}
// -----------------------------------------------------------------------
-void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel )
+void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )
{
ValueSetItem* pItem;
@@ -1318,15 +1318,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel )
SelectItem( pItem->mnId );
if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
GrabFocus();
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
Select();
}
else
{
- ImplHighlightItem( mnSelItemId, FALSE );
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ ImplHighlightItem( mnSelItemId, sal_False );
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
}
}
@@ -1339,7 +1339,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
if ( mbSelection )
{
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
{
mnOldItemId = mnSelItemId;
@@ -1356,7 +1356,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
{
mnOldItemId = mnSelItemId;
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
StartTracking( STARTTRACK_SCROLLREPEAT );
@@ -1378,7 +1378,7 @@ void ValueSet::MouseButtonUp( const MouseEvent& rMEvt )
{
// Wegen SelectionMode
if ( rMEvt.IsLeft() && mbSelection )
- ImplEndTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplEndTracking( rMEvt.GetPosPixel(), sal_False );
else
Control::MouseButtonUp( rMEvt );
}
@@ -1389,7 +1389,7 @@ void ValueSet::MouseMove( const MouseEvent& rMEvt )
{
// Wegen SelectionMode
if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) )
- ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ ImplTracking( rMEvt.GetPosPixel(), sal_False );
Control::MouseMove( rMEvt );
}
@@ -1427,7 +1427,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nCalcPos = nCurPos;
//switch off selection mode if key travelling is used
- BOOL bDefault = FALSE;
+ sal_Bool bDefault = sal_False;
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_HOME:
@@ -1515,7 +1515,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
}
}
else if ( nCalcPos >= ( nLineCount * mnCols ) )
- nItemPos = sal::static_int_cast< USHORT >(
+ nItemPos = sal::static_int_cast< sal_uInt16 >(
nCalcPos - ( nLineCount * mnCols ));
else
{
@@ -1557,7 +1557,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
if ( nCalcPos == VALUESET_ITEM_NONEITEM )
nItemPos = mnCurCol;
else if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem )
- nItemPos = sal::static_int_cast< USHORT >(
+ nItemPos = sal::static_int_cast< sal_uInt16 >(
nCalcPos + ( nLineCount * mnCols ));
else
{
@@ -1590,14 +1590,14 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
//no break;
default:
Control::KeyInput( rKEvt );
- bDefault = TRUE;
+ bDefault = sal_True;
break;
}
if(!bDefault)
EndSelection();
if ( nItemPos != VALUESET_ITEM_NOTFOUND )
{
- USHORT nItemId;
+ sal_uInt16 nItemId;
if ( nItemPos != VALUESET_ITEM_NONEITEM )
nItemId = GetItemId( nItemPos );
else
@@ -1654,7 +1654,7 @@ void ValueSet::GetFocus()
Control::GetFocus();
// Tell the accessible object that we got the focus.
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->GetFocus();
}
@@ -1671,7 +1671,7 @@ void ValueSet::LoseFocus()
Control::LoseFocus();
// Tell the accessible object that we lost the focus.
- ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( FALSE ) );
+ ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
if( pAcc )
pAcc->LoseFocus();
}
@@ -1680,7 +1680,7 @@ void ValueSet::LoseFocus()
void ValueSet::Resize()
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
Control::Resize();
@@ -1739,23 +1739,23 @@ void ValueSet::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
{
- mbFormat = TRUE;
- ImplInitSettings( FALSE, FALSE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -1772,8 +1772,8 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1800,7 +1800,7 @@ void ValueSet::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1818,14 +1818,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1843,14 +1843,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Image& rImage,
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
@@ -1870,14 +1870,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Image& rImage,
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, const Color& rColor,
+void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
const XubString& rText, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
@@ -1897,14 +1897,14 @@ void ValueSet::InsertItem( USHORT nItemId, const Color& rColor,
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertItem( USHORT nItemId, size_t nPos )
+void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1921,14 +1921,14 @@ void ValueSet::InsertItem( USHORT nItemId, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::InsertSpace( USHORT nItemId, size_t nPos )
+void ValueSet::InsertSpace( sal_uInt16 nItemId, size_t nPos )
{
DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
@@ -1945,14 +1945,14 @@ void ValueSet::InsertSpace( USHORT nItemId, size_t nPos )
mpImpl->mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
// -----------------------------------------------------------------------
-void ValueSet::RemoveItem( USHORT nItemId )
+void ValueSet::RemoveItem( sal_uInt16 nItemId )
{
size_t nPos = GetItemPos( nItemId );
@@ -1973,10 +1973,10 @@ void ValueSet::RemoveItem( USHORT nItemId )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2010,9 +2010,9 @@ void ValueSet::CopyItems( const ValueSet& rValueSet )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2029,9 +2029,9 @@ void ValueSet::Clear()
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = TRUE;
+ mbNoSelection = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2045,7 +2045,7 @@ size_t ValueSet::GetItemCount() const
// -----------------------------------------------------------------------
-size_t ValueSet::GetItemPos( USHORT nItemId ) const
+size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i ) {
ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
@@ -2058,14 +2058,14 @@ size_t ValueSet::GetItemPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemId( size_t nPos ) const
+sal_uInt16 ValueSet::GetItemId( size_t nPos ) const
{
return ( nPos < mpImpl->mpItemList->size() ) ? (*mpImpl->mpItemList)[ nPos ]->mnId : 0 ;
}
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemId( const Point& rPos ) const
+sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const
{
size_t nItemPos = ImplGetItem( rPos );
if ( nItemPos != VALUESET_ITEM_NOTFOUND )
@@ -2076,7 +2076,7 @@ USHORT ValueSet::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle ValueSet::GetItemRect( USHORT nItemId ) const
+Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2088,19 +2088,19 @@ Rectangle ValueSet::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::EnableFullItemMode( BOOL bFullMode )
+void ValueSet::EnableFullItemMode( sal_Bool bFullMode )
{
mbFullMode = bFullMode;
}
// -----------------------------------------------------------------------
-void ValueSet::SetColCount( USHORT nNewCols )
+void ValueSet::SetColCount( sal_uInt16 nNewCols )
{
if ( mnUserCols != nNewCols )
{
mnUserCols = nNewCols;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2108,12 +2108,12 @@ void ValueSet::SetColCount( USHORT nNewCols )
// -----------------------------------------------------------------------
-void ValueSet::SetLineCount( USHORT nNewLines )
+void ValueSet::SetLineCount( sal_uInt16 nNewLines )
{
if ( mnUserVisLines != nNewLines )
{
mnUserVisLines = nNewLines;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2126,7 +2126,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
if ( mnUserItemWidth != nNewItemWidth )
{
mnUserItemWidth = nNewItemWidth;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2139,7 +2139,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
if ( mnUserItemHeight != nNewItemHeight )
{
mnUserItemHeight = nNewItemHeight;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2147,12 +2147,12 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
// -----------------------------------------------------------------------
-void ValueSet::SetFirstLine( USHORT nNewLine )
+void ValueSet::SetFirstLine( sal_uInt16 nNewLine )
{
if ( mnFirstLine != nNewLine )
{
mnFirstLine = nNewLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2160,7 +2160,7 @@ void ValueSet::SetFirstLine( USHORT nNewLine )
// -----------------------------------------------------------------------
-void ValueSet::SelectItem( USHORT nItemId )
+void ValueSet::SelectItem( sal_uInt16 nItemId )
{
size_t nItemPos = 0;
@@ -2175,31 +2175,31 @@ void ValueSet::SelectItem( USHORT nItemId )
if ( (mnSelItemId != nItemId) || mbNoSelection )
{
- USHORT nOldItem = mnSelItemId ? mnSelItemId : 1;
+ sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
mnSelItemId = nItemId;
- mbNoSelection = FALSE;
+ mbNoSelection = sal_False;
- BOOL bNewOut;
- BOOL bNewLine;
+ sal_Bool bNewOut;
+ sal_Bool bNewLine;
if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
- bNewOut = TRUE;
+ bNewOut = sal_True;
else
- bNewOut = FALSE;
- bNewLine = FALSE;
+ bNewOut = sal_False;
+ bNewLine = sal_False;
// Gegebenenfalls in den sichtbaren Bereich scrollen
if ( mbScroll && nItemId )
{
- USHORT nNewLine = (USHORT)(nItemPos / mnCols);
+ sal_uInt16 nNewLine = (sal_uInt16)(nItemPos / mnCols);
if ( nNewLine < mnFirstLine )
{
mnFirstLine = nNewLine;
- bNewLine = TRUE;
+ bNewLine = sal_True;
}
- else if ( nNewLine > (USHORT)(mnFirstLine+mnVisLines-1) )
+ else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) )
{
- mnFirstLine = (USHORT)(nNewLine-mnVisLines+1);
- bNewLine = TRUE;
+ mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1);
+ bNewLine = sal_True;
}
}
@@ -2209,7 +2209,7 @@ void ValueSet::SelectItem( USHORT nItemId )
{
// Falls sich der sichtbare Bereich geaendert hat,
// alles neu ausgeben
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplDraw();
}
else
@@ -2291,9 +2291,9 @@ void ValueSet::SelectItem( USHORT nItemId )
void ValueSet::SetNoSelection()
{
- mbNoSelection = TRUE;
- mbHighlight = FALSE;
- mbSelection = FALSE;
+ mbNoSelection = sal_True;
+ mbHighlight = sal_False;
+ mbSelection = sal_False;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
@@ -2301,7 +2301,7 @@ void ValueSet::SetNoSelection()
// -----------------------------------------------------------------------
-void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits )
+void ValueSet::SetItemBits( sal_uInt16 nItemId, sal_uInt16 nItemBits )
{
size_t nPos = GetItemPos( nItemId );
@@ -2311,7 +2311,7 @@ void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits )
// -----------------------------------------------------------------------
-USHORT ValueSet::GetItemBits( USHORT nItemId ) const
+sal_uInt16 ValueSet::GetItemBits( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2323,7 +2323,7 @@ USHORT ValueSet::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage )
+void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
size_t nPos = GetItemPos( nItemId );
@@ -2340,12 +2340,12 @@ void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
-Image ValueSet::GetItemImage( USHORT nItemId ) const
+Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2357,7 +2357,7 @@ Image ValueSet::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor )
+void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
{
size_t nPos = GetItemPos( nItemId );
@@ -2374,12 +2374,12 @@ void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
// -----------------------------------------------------------------------
-Color ValueSet::GetItemColor( USHORT nItemId ) const
+Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2391,7 +2391,7 @@ Color ValueSet::GetItemColor( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemData( USHORT nItemId, void* pData )
+void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
{
size_t nPos = GetItemPos( nItemId );
@@ -2409,13 +2409,13 @@ void ValueSet::SetItemData( USHORT nItemId, void* pData )
Invalidate( pItem->maRect );
}
else
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
}
// -----------------------------------------------------------------------
-void* ValueSet::GetItemData( USHORT nItemId ) const
+void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2427,7 +2427,7 @@ void* ValueSet::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
+void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
size_t nPos = GetItemPos( nItemId );
@@ -2448,7 +2448,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
{
- USHORT nTempId = mnSelItemId;
+ sal_uInt16 nTempId = mnSelItemId;
if ( mbHighlight )
nTempId = mnHighItemId;
@@ -2470,7 +2470,7 @@ void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-XubString ValueSet::GetItemText( USHORT nItemId ) const
+XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
{
size_t nPos = GetItemPos( nItemId );
@@ -2485,20 +2485,20 @@ XubString ValueSet::GetItemText( USHORT nItemId ) const
void ValueSet::SetColor( const Color& rColor )
{
maColor = rColor;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
}
// -----------------------------------------------------------------------
-void ValueSet::SetExtraSpacing( USHORT nNewSpacing )
+void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
{
if ( GetStyle() & WB_ITEMBORDER )
{
mnSpacing = nNewSpacing;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2509,8 +2509,8 @@ void ValueSet::SetExtraSpacing( USHORT nNewSpacing )
void ValueSet::StartSelection()
{
mnOldItemId = mnSelItemId;
- mbHighlight = TRUE;
- mbSelection = TRUE;
+ mbHighlight = sal_True;
+ mbSelection = sal_True;
mnHighItemId = mnSelItemId;
}
@@ -2524,17 +2524,17 @@ void ValueSet::EndSelection()
EndTracking( ENDTRACK_CANCEL );
ImplHighlightItem( mnSelItemId );
- mbHighlight = FALSE;
+ mbHighlight = sal_False;
}
- mbSelection = FALSE;
+ mbSelection = sal_False;
}
// -----------------------------------------------------------------------
-BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
{
if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
- return FALSE;
+ return sal_False;
// Gegebenenfalls eine vorhandene Aktion abbrechen
EndSelection();
@@ -2543,7 +2543,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
// Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir
// dies nur bei einer Mausaktion.
- USHORT nSelId;
+ sal_uInt16 nSelId;
if ( rCEvt.IsMouseEvent() )
nSelId = GetItemId( rCEvt.GetMousePosPixel() );
else
@@ -2551,7 +2551,7 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
if ( !nSelId )
- return FALSE;
+ return sal_False;
// Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
// Seite setzen und Select rufen.
@@ -2567,13 +2567,13 @@ BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// Region zuweisen
rRegion = aRegion;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols,
- USHORT nDesireLines )
+Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols,
+ sal_uInt16 nDesireLines )
{
size_t nCalcCols = nDesireCols;
size_t nCalcLines = nDesireLines;
@@ -2655,7 +2655,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols,
// -----------------------------------------------------------------------
-Size ValueSet::CalcItemSizePixel( const Size& rItemSize, BOOL bOut ) const
+Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const
{
Size aSize = rItemSize;
@@ -2699,15 +2699,15 @@ long ValueSet::GetScrollWidth() const
// -----------------------------------------------------------------------
-USHORT ValueSet::ShowDropPos( const Point& rPos )
+sal_uInt16 ValueSet::ShowDropPos( const Point& rPos )
{
- mbDropPos = TRUE;
+ mbDropPos = sal_True;
// Gegebenenfalls scrollen
ImplScroll( rPos );
// DropPosition ermitteln
- size_t nPos = ImplGetItem( rPos, TRUE );
+ size_t nPos = ImplGetItem( rPos, sal_True );
if ( nPos == VALUESET_ITEM_NONEITEM )
nPos = 0;
else if ( nPos == VALUESET_ITEM_NOTFOUND )
@@ -2729,9 +2729,9 @@ USHORT ValueSet::ShowDropPos( const Point& rPos )
if ( nPos != mnDropPos )
{
- ImplDrawDropPos( FALSE );
+ ImplDrawDropPos( sal_False );
mnDropPos = nPos;
- ImplDrawDropPos( TRUE );
+ ImplDrawDropPos( sal_True );
}
return mnDropPos;
@@ -2743,8 +2743,8 @@ void ValueSet::HideDropPos()
{
if ( mbDropPos )
{
- ImplDrawDropPos( FALSE );
- mbDropPos = FALSE;
+ ImplDrawDropPos( sal_False );
+ mbDropPos = sal_False;
}
}
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 2bfba531453d..5f3f46aa669d 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -30,9 +30,7 @@
#include "precompiled_svtools.hxx"
#include <stdio.h>
-
-
-#include "addresstemplate.hxx"
+#include <svtools/addresstemplate.hxx>
#include "addresstemplate.hrc"
#include <svtools/svtools.hrc>
#include <svtools/helpid.hrc>
@@ -44,7 +42,7 @@
#include <vcl/waitobj.hxx>
#include <vcl/msgbox.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
#include <comphelper/interaction.hxx>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/awt/XWindow.hpp>
@@ -58,10 +56,9 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
-#include "localresaccess.hxx"
+#include <svtools/localresaccess.hxx>
#include "svl/filenotation.hxx"
#include <tools/urlobj.hxx>
-
#include <algorithm>
// .......................................................................
@@ -594,9 +591,9 @@ void AssignmentPersistentData::Commit()
for (sal_Int32 column=0; column<2; ++column)
{
// the label
- m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((USHORT)(FT_FIELD_BASE + row * 2 + column)));
+ m_pImpl->pFieldLabels[row * 2 + column] = new FixedText(&m_aFieldsFrame, SvtResId((sal_uInt16)(FT_FIELD_BASE + row * 2 + column)));
// the listbox
- m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((USHORT)(LB_FIELD_BASE + row * 2 + column)));
+ m_pImpl->pFields[row * 2 + column] = new ListBox(&m_aFieldsFrame, SvtResId((sal_uInt16)(LB_FIELD_BASE + row * 2 + column)));
m_pImpl->pFields[row * 2 + column]->SetDropDownLineCount(15);
m_pImpl->pFields[row * 2 + column]->SetSelectHdl(LINK(this, AddressBookSourceDialog, OnFieldSelect));
diff --git a/svtools/source/dialogs/addresstemplate.src b/svtools/source/dialogs/addresstemplate.src
index 52a663f5b3ae..0e4845949dca 100644
--- a/svtools/source/dialogs/addresstemplate.src
+++ b/svtools/source/dialogs/addresstemplate.src
@@ -27,12 +27,13 @@
#include <svtools/svtools.hrc>
#include "addresstemplate.hrc"
-#include "controldims.hrc"
+#include <svtools/controldims.hrc>
#define FIELD_ROW_HEIGHT 17
ModalDialog DLG_ADDRESSBOOKSOURCE
{
+ HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE";
SVLook = TRUE ;
OutputSize = TRUE ;
Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ;
@@ -58,6 +59,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_DATASOURCE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_DATASOURCE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 13 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
@@ -67,6 +69,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
PushButton PB_ADMINISTATE_DATASOURCES
{
+ HelpID = "svtools:PushButton:DLG_ADDRESSBOOKSOURCE:PB_ADMINISTATE_DATASOURCES";
Text [ en-US ] = "~Address Data Source...";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 204, 13 ) ;
@@ -84,6 +87,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE
};
ComboBox CB_TABLE
{
+ HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_TABLE";
SVLook = TRUE ;
Pos = MAP_APPFONT ( 105, 30 ) ;
Size = MAP_APPFONT ( 96, 55 ) ;
diff --git a/svtools/source/dialogs/colctrl.cxx b/svtools/source/dialogs/colctrl.cxx
index 65e9a207d76f..d98e0bd780b9 100644
--- a/svtools/source/dialogs/colctrl.cxx
+++ b/svtools/source/dialogs/colctrl.cxx
@@ -86,19 +86,19 @@ void SvColorControl::CreateBitmap()
if( pWriteAccess )
{
- USHORT nX = (USHORT) aSize.Width();
- USHORT nY = (USHORT) aSize.Height();
+ sal_uInt16 nX = (sal_uInt16) aSize.Width();
+ sal_uInt16 nY = (sal_uInt16) aSize.Height();
- UINT16 nHue, nSat;
+ sal_uInt16 nHue, nSat;
ColorHSB aColHSB( 0, 0, mnLuminance );
- for( USHORT i = 0; i < nY; i++ )
+ for( sal_uInt16 i = 0; i < nY; i++ )
{
- nSat = (UINT16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY );
+ nSat = (sal_uInt16) FRound( 100 - ( 100.0 * i + 0.5 ) / nY );
- for( USHORT j = 0; j < nX; j++ )
+ for( sal_uInt16 j = 0; j < nX; j++ )
{
- nHue = (UINT16) FRound( ( 360.0 * j + 0.5 ) / nX );
+ nHue = (sal_uInt16) FRound( ( 360.0 * j + 0.5 ) / nX );
aColHSB.SetHue( nHue );
aColHSB.SetSat( nSat );
@@ -162,7 +162,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt )
{
if( rMEvt.IsLeft() && !rMEvt.IsShift() )
{
- //ShowPointer( FALSE );
+ //ShowPointer( sal_False );
CaptureMouse();
ShowPosition( rMEvt.GetPosPixel() );
Modify();
@@ -172,7 +172,7 @@ void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt )
// -----------------------------------------------------------------------
void SvColorControl::MouseButtonUp( const MouseEvent& )
{
- //ShowPointer( TRUE );
+ //ShowPointer( sal_True );
if( IsMouseCaptured() )
ReleaseMouse();
}
@@ -220,16 +220,16 @@ void SvColorControl::Modify()
}
// -----------------------------------------------------------------------
-void SvColorControl::SetColor( const ColorHSB& rCol, BOOL bSetColor )
+void SvColorControl::SetColor( const ColorHSB& rCol, sal_Bool bSetColor )
{
if( bSetColor )
maColor = rCol.GetRGB();
if( mpBitmap )
{
- USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width();
- USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height();
- INT16 nZ = rCol.GetBri();
+ sal_uInt16 nX = (sal_uInt16) mpBitmap->GetSizePixel().Width();
+ sal_uInt16 nY = (sal_uInt16) mpBitmap->GetSizePixel().Height();
+ sal_Int16 nZ = rCol.GetBri();
SetLuminance( nZ );
nX = rCol.GetHue() * nX / 360; // Farbe
@@ -246,7 +246,7 @@ void SvColorControl::SetColor( const Color& rCol )
if( mpBitmap )
{
ColorHSB aColHsb( rCol );
- SetColor( aColHsb, FALSE );
+ SetColor( aColHsb, sal_False );
}
}
@@ -333,7 +333,7 @@ void ColorPreviewControl::SetColor( const Color& rCol )
// -----------------------------------------------------------------------
ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle,
- USHORT nRows, USHORT nColumns ) :
+ sal_uInt16 nRows, sal_uInt16 nColumns ) :
ValueSet ( pParent, nStyle ),
mnRows ( nRows ),
mnColumns ( nColumns )
@@ -343,7 +343,7 @@ ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle,
// -----------------------------------------------------------------------
ColorMixingControl::ColorMixingControl( Window* pParent, const ResId& rResId,
- USHORT nRows, USHORT nColumns ) :
+ sal_uInt16 nRows, sal_uInt16 nColumns ) :
ValueSet ( pParent, rResId ),
mnRows ( nRows ),
mnColumns ( nColumns )
@@ -364,7 +364,7 @@ void ColorMixingControl::Initialize()
Color aColor;
String aStr;
- for( USHORT i = 1; i <= mnRows * mnColumns; i++ )
+ for( sal_uInt16 i = 1; i <= mnRows * mnColumns; i++ )
{
InsertItem( i, aColor, aStr );
}
@@ -377,30 +377,30 @@ void ColorMixingControl::Initialize()
}
// -----------------------------------------------------------------------
-Color ColorMixingControl::CalcDifferenceColor( USHORT nCol1, USHORT nCol2,
- USHORT nSteps )
+Color ColorMixingControl::CalcDifferenceColor( sal_uInt16 nCol1, sal_uInt16 nCol2,
+ sal_uInt16 nSteps )
{
// Die Berechnung ist noch etwas ungenau, daher sollte besser mit floats
// gearbeitet werden... (muss !!!)
Color aColor( GetItemColor( nCol1 ) );
Color aColor2( GetItemColor( nCol2 ) );
- aColor.SetRed( (UINT8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) );
- aColor.SetGreen( (UINT8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) );
- aColor.SetBlue( (UINT8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) );
+ aColor.SetRed( (sal_uInt8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) );
+ aColor.SetGreen( (sal_uInt8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) );
+ aColor.SetBlue( (sal_uInt8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) );
return( aColor );
}
// -----------------------------------------------------------------------
-void ColorMixingControl::FillRow( USHORT nRow )
+void ColorMixingControl::FillRow( sal_uInt16 nRow )
{
- USHORT nCol1 = nRow * mnColumns + 1;
- USHORT nCol2 = ( nRow + 1 ) * mnColumns;
+ sal_uInt16 nCol1 = nRow * mnColumns + 1;
+ sal_uInt16 nCol2 = ( nRow + 1 ) * mnColumns;
Color aColor( GetItemColor( nCol1 ) );
Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnColumns - 1 ) );
- for( USHORT i = nCol1 + 1; i < nCol2; i++ )
+ for( sal_uInt16 i = nCol1 + 1; i < nCol2; i++ )
{
aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
@@ -412,14 +412,14 @@ void ColorMixingControl::FillRow( USHORT nRow )
}
// -----------------------------------------------------------------------
-void ColorMixingControl::FillColumn( USHORT nColumn )
+void ColorMixingControl::FillColumn( sal_uInt16 nColumn )
{
- USHORT nCol1 = nColumn + 1;
- USHORT nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1;
+ sal_uInt16 nCol1 = nColumn + 1;
+ sal_uInt16 nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1;
Color aColor( GetItemColor( nCol1 ) );
Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnRows - 1 ) );
- for( USHORT i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns )
+ for( sal_uInt16 i = nCol1 + mnColumns; i < nCol2; i = i + mnColumns )
{
aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
@@ -431,13 +431,13 @@ void ColorMixingControl::FillColumn( USHORT nColumn )
}
// -----------------------------------------------------------------------
-void ColorMixingControl::SetRows( USHORT nRows )
+void ColorMixingControl::SetRows( sal_uInt16 nRows )
{
mnRows = nRows;
}
// -----------------------------------------------------------------------
-void ColorMixingControl::SetColumns( USHORT nColumns )
+void ColorMixingControl::SetColumns( sal_uInt16 nColumns )
{
mnColumns = nColumns;
}
@@ -448,8 +448,8 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol )
if( rCol != maColor[ ePos ] )
{
maColor[ ePos ] = rCol;
- USHORT nPos = 0;
- USHORT nColumn = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nColumn = 0;
String aStr( GetRGBString( rCol ) );
switch( ePos )
@@ -480,7 +480,7 @@ void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol )
SetItemText( nPos, aStr );
FillColumn( nColumn );
- for( USHORT i = 0; i < mnRows; i++ )
+ for( sal_uInt16 i = 0; i < mnRows; i++ )
FillRow( i );
}
}
@@ -500,7 +500,7 @@ String ColorMixingControl::GetRGBString( const Color& rColor )
CMCPosition ColorMixingControl::GetCMCPosition() const
{
CMCPosition ePos = CMC_OTHER;
- USHORT nPos = GetSelectItemId();
+ sal_uInt16 nPos = GetSelectItemId();
if( nPos == 1 )
ePos = CMC_TOPLEFT;
@@ -531,8 +531,8 @@ CMCPosition ColorMixingControl::GetCMCPosition() const
ColorHSB::ColorHSB( const Color& rColor )
{
- UINT8 c[3];
- UINT8 cMax, cMin;
+ sal_uInt8 c[3];
+ sal_uInt8 cMax, cMin;
c[0] = rColor.GetRed();
c[1] = rColor.GetGreen();
@@ -553,7 +553,7 @@ ColorHSB::ColorHSB( const Color& rColor )
if( c[2] < cMin )
cMin = c[2];
- UINT8 cDelta = cMax - cMin;
+ sal_uInt8 cDelta = cMax - cMin;
// Saturation = max - min / max
if( mnBri > 0 )
@@ -585,7 +585,7 @@ ColorHSB::ColorHSB( const Color& rColor )
if( dHue < 0.0 )
dHue += 360.0;
- mnHue = (UINT16) dHue;
+ mnHue = (sal_uInt16) dHue;
}
}
@@ -597,8 +597,8 @@ ColorHSB::ColorHSB( const Color& rColor )
Color ColorHSB::GetRGB() const
{
- UINT8 cR,cG,cB;
- UINT8 nB = (UINT8) ( mnBri * 255 / 100 );
+ sal_uInt8 cR,cG,cB;
+ sal_uInt8 nB = (sal_uInt8) ( mnBri * 255 / 100 );
if( mnSat == 0 )
{
@@ -610,20 +610,20 @@ Color ColorHSB::GetRGB() const
{
double dH = mnHue;
double f;
- UINT16 n;
+ sal_uInt16 n;
if( dH == 360.0 )
dH = 0.0;
dH /= 60.0;
- n = (UINT16) dH;
+ n = (sal_uInt16) dH;
f = dH - n;
// #107375# Doing the calculation completely in floating
// point, the former optimization gave sometimes negative
// results for c and was pointless anyway
- UINT8 a = static_cast<UINT8>( nB * ( 100.0 - mnSat ) / 100.0 );
- UINT8 b = static_cast<UINT8>( nB * ( 100.0 - mnSat * f ) / 100.0 );
- UINT8 c = static_cast<UINT8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 );
+ sal_uInt8 a = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat ) / 100.0 );
+ sal_uInt8 b = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * f ) / 100.0 );
+ sal_uInt8 c = static_cast<sal_uInt8>( nB * ( 100.0 - mnSat * ( 1.0 - f ) ) / 100.0 );
switch( n )
{
@@ -663,11 +663,11 @@ ColorCMYK::ColorCMYK( const Color& rColor )
Color ColorCMYK::GetRGB() const
{
int nTmp = Max( 0, 255 - ( mnCyan + mnKey ) );
- UINT8 cR = (UINT8) nTmp;
+ sal_uInt8 cR = (sal_uInt8) nTmp;
nTmp = Max( 0, 255 - ( mnMagenta + mnKey ) );
- UINT8 cG = (UINT8) nTmp;
+ sal_uInt8 cG = (sal_uInt8) nTmp;
nTmp = Max( 0, 255 - ( mnYellow + mnKey ) );
- UINT8 cB = (UINT8) nTmp;
+ sal_uInt8 cB = (sal_uInt8) nTmp;
return( Color( cR, cG, cB ) );
}
diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx
index de973dcbcd4a..5e94c0529760 100644
--- a/svtools/source/dialogs/colrdlg.cxx
+++ b/svtools/source/dialogs/colrdlg.cxx
@@ -159,7 +159,7 @@ const Color& SvColorDialog::GetColor() const
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
{
- UINT16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB
+ sal_uInt16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB
if( p == &maCtlColor )
{
@@ -172,19 +172,19 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
}
else if( p == &maNumRed )
{
- maColor.SetRed( (UINT8)maNumRed.GetValue() );
+ maColor.SetRed( (sal_uInt8)maNumRed.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
else if( p == &maNumGreen )
{
- maColor.SetGreen( (UINT8)maNumGreen.GetValue() );
+ maColor.SetGreen( (sal_uInt8)maNumGreen.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
else if( p == &maNumBlue )
{
- maColor.SetBlue( (UINT8)maNumBlue.GetValue() );
+ maColor.SetBlue( (sal_uInt8)maNumBlue.GetValue() );
maCtlColor.SetColor( maColor );
n = 6;
}
@@ -193,9 +193,9 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
p == &maNumLuminance )
{
- ColorHSB aColorHSB( (UINT16) maNumHue.GetValue(),
- (UINT16) maNumSaturation.GetValue(),
- (UINT16) maNumLuminance.GetValue() );
+ ColorHSB aColorHSB( (sal_uInt16) maNumHue.GetValue(),
+ (sal_uInt16) maNumSaturation.GetValue(),
+ (sal_uInt16) maNumLuminance.GetValue() );
maCtlColor.SetColor( aColorHSB );
maColor = maCtlColor.GetColor();
n = 3;
@@ -210,10 +210,10 @@ IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
long aYellow = (long) ( (double)maNumYellow.GetValue() * 255.0 / 100.0 + 0.5 );
long aKey = (long) ( (double)maNumKey.GetValue() * 255.0 / 100.0 + 0.5 );
- ColorCMYK aColorCMYK( (UINT16) aCyan,
- (UINT16) aMagenta,
- (UINT16) aYellow,
- (UINT16) aKey );
+ ColorCMYK aColorCMYK( (sal_uInt16) aCyan,
+ (sal_uInt16) aMagenta,
+ (sal_uInt16) aYellow,
+ (sal_uInt16) aKey );
maColor = aColorCMYK.GetRGB();
maCtlColor.SetColor( maColor );
n = 5;
@@ -273,7 +273,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p )
}
else if( p == &maBtn2 )
{
- USHORT nPos = maColMixCtrl.GetSelectItemId();
+ sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
maColor = maColMixCtrl.GetItemColor( nPos );
maCtlColor.SetColor( maColor );
ColorModifyHdl( &maCtlColor );
@@ -285,7 +285,7 @@ IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p )
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG )
{
- USHORT nPos = maColMixCtrl.GetSelectItemId();
+ sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
CMCPosition ePos = maColMixCtrl.GetCMCPosition();
if( ePos != CMC_OTHER )
@@ -303,12 +303,12 @@ IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, EMPTYARG )
// -----------------------------------------------------------------------
IMPL_LINK( SvColorDialog, SelectMixCtrlHdl, void *, EMPTYARG )
{
- //USHORT nPos = maColMixCtrl.GetSelectItemId();
+ //sal_uInt16 nPos = maColMixCtrl.GetSelectItemId();
//maFtRGB.SetText( maColMixCtrl.GetItemText( nPos ) );
CMCPosition ePos = maColMixCtrl.GetCMCPosition();
if( ePos == CMC_OTHER )
- maBtn1.Enable( FALSE );
+ maBtn1.Enable( sal_False );
else
maBtn1.Enable();
diff --git a/svtools/source/dialogs/colrdlg.hrc b/svtools/source/dialogs/colrdlg.hrc
index 41329df6e366..b1e785bd2f17 100644
--- a/svtools/source/dialogs/colrdlg.hrc
+++ b/svtools/source/dialogs/colrdlg.hrc
@@ -65,3 +65,5 @@
#define BTN_CANCEL 1
#define BTN_HELP 1
+//IAccessibility2 Implementation 2009-----
+#define STR_COLORDES 3001
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
index 34df3c11eeaa..c0b4f33db69a 100644
--- a/svtools/source/dialogs/colrdlg.src
+++ b/svtools/source/dialogs/colrdlg.src
@@ -29,6 +29,7 @@
#define DIFF 3
ModalDialog DLG_COLOR
{
+ HelpID = "svtools:ModalDialog:DLG_COLOR";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 165 + DIFF ) ;
@@ -93,6 +94,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_CYAN
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_CYAN";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 109 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -106,6 +108,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_MAGENTA
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_MAGENTA";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -119,6 +122,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_YELLOW
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_YELLOW";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -132,6 +136,7 @@ ModalDialog DLG_COLOR
};
MetricField NUM_KEY
{
+ HelpID = "svtools:MetricField:DLG_COLOR:NUM_KEY";
Border = TRUE ;
Pos = MAP_APPFONT ( 42 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -163,6 +168,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_RED
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_RED";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -174,6 +180,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_GREEN
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_GREEN";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -185,6 +192,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_BLUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_BLUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 106 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -202,6 +210,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_HUE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_HUE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 122 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -219,6 +228,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_SATURATION
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_SATURATION";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 135 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -236,6 +246,7 @@ ModalDialog DLG_COLOR
};
NumericField NUM_LUMINANCE
{
+ HelpID = "svtools:NumericField:DLG_COLOR:NUM_LUMINANCE";
Border = TRUE ;
Pos = MAP_APPFONT ( 171 , 148 + DIFF ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
@@ -247,6 +258,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_1
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_1";
Pos = MAP_APPFONT ( 80 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "~<--" ;
@@ -254,6 +266,7 @@ ModalDialog DLG_COLOR
};
PushButton BTN_2
{
+ HelpID = "svtools:PushButton:DLG_COLOR:BTN_2";
Pos = MAP_APPFONT ( 100 , 109 ) ;
Size = MAP_APPFONT ( 17 , 12 ) ;
Text = "--~>" ;
@@ -264,13 +277,18 @@ ModalDialog DLG_COLOR
Border = TRUE ;
Pos = MAP_APPFONT ( 200 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
Control CTL_PREVIEW
{
Border = TRUE ;
Pos = MAP_APPFONT ( 229 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
};
+
+String STR_COLORDES
+{
+ Text [ en-US ] = "RGB(%1, %2, %3) Hue:%4 Saturation:%5 Brightness:%6";
+}; \ No newline at end of file
diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx
index bbcd2964773d..e1a7548ba170 100644
--- a/svtools/source/dialogs/filedlg.cxx
+++ b/svtools/source/dialogs/filedlg.cxx
@@ -29,10 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <filedlg.hxx>
+#include <svtools/filedlg.hxx>
#include <filedlg2.hxx>
-PathDialog::PathDialog( Window* _pParent, WinBits nStyle, BOOL bCreateDir ) :
+PathDialog::PathDialog( Window* _pParent, WinBits nStyle, sal_Bool bCreateDir ) :
ModalDialog( _pParent, WB_STDMODAL | nStyle )
{
pImpFileDlg = new ImpSvFileDlg;
@@ -71,7 +71,7 @@ long PathDialog::OK()
if( aOKHdlLink.IsSet() )
return aOKHdlLink.Call( this );
else
- return TRUE;
+ return sal_True;
}
@@ -81,7 +81,7 @@ FileDialog::FileDialog( Window* _pParent, WinBits nStyle ) :
// Dadurch dass hier bei VCL nicht der CTOR mit ResType verwendet wird,
// wurde im PathDialog-CTOR leider ein ImpPathDialog angelegt...
// So zwar scheisse, aber der Dialog ist eh' nur ein Hack:
- pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, FALSE );
+ pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, sal_False );
}
FileDialog::~FileDialog()
@@ -123,17 +123,17 @@ void FileDialog::FilterSelect()
aFilterHdlLink.Call( this );
}
-USHORT FileDialog::GetFilterCount() const
+sal_uInt16 FileDialog::GetFilterCount() const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterCount();
}
-UniString FileDialog::GetFilterName( USHORT nPos ) const
+UniString FileDialog::GetFilterName( sal_uInt16 nPos ) const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterName( nPos );
}
-UniString FileDialog::GetFilterType( USHORT nPos ) const
+UniString FileDialog::GetFilterType( sal_uInt16 nPos ) const
{
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos );
}
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index 3b96dd8649a6..a6ccff12a506 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -34,10 +34,9 @@
#include <vcl/edit.hxx>
#include <vcl/lstbox.hxx>
#include <svtools/svtdata.hxx>
-
#include <filedlg2.hxx>
-#include <filedlg.hxx>
-#include <filedlg2.hrc>
+#include <svtools/filedlg.hxx>
+#include <svtools/filedlg2.hrc>
#include <vcl/msgbox.hxx>
#include <osl/security.hxx>
#include <comphelper/string.hxx>
@@ -66,17 +65,17 @@ typedef ::std::vector< UniString* > UniStringList;
// #define STD_BTN_WIDTH 90
// #define STD_BTN_HEIGHT 35
-#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \
+#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, rHelpId ) \
p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \
- p->SetHelpId( nHelpId ); \
+ p->SetHelpId( rHelpId ); \
p->SetPosSizePixel( aPos, aSize ); \
p->SetText( aTitel ); \
p->Show();
-inline BOOL IsPrintable( sal_Unicode c )
+inline sal_Bool IsPrintable( sal_Unicode c )
{
- return c >= 32 && c != 127 ? TRUE : FALSE;
+ return c >= 32 && c != 127 ? sal_True : sal_False;
}
long
@@ -89,10 +88,10 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt )
if ( IsPrintable ( cCharCode ) )
{
- USHORT nCurrentPos = GetSelectEntryPos();
- USHORT nEntries = GetEntryCount();
+ sal_uInt16 nCurrentPos = GetSelectEntryPos();
+ sal_uInt16 nEntries = GetEntryCount();
- for ( USHORT i = 1; i < nEntries; i++ )
+ for ( sal_uInt16 i = 1; i < nEntries; i++ )
{
UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries );
aEntry.EraseLeadingChars( ' ' );
@@ -117,7 +116,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt )
return ListBox::PreNotify ( rNEvt );
}
-ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir )
+ImpPathDialog::ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir )
{
pSvPathDialog = pDlg;
nDirCount = 0;
@@ -218,10 +217,10 @@ void ImpPathDialog::InitControls()
aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
aPnt.Y() = a6Siz.Height();
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, aOkStr, 0 );
+ aPnt, aBtnSiz, aOkStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pCancelBtn, CancelButton, 0,
- aPnt, aBtnSiz, aCancelStr, 0 );
+ aPnt, aBtnSiz, aCancelStr, "" );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR );
@@ -282,14 +281,14 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p )
UniString aEntry( pDirList->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
DirEntry aNewPath;
aNewPath.ToAbs();
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wird nach oben gewechselt
if( nCurPos < nDirCount )
@@ -316,7 +315,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
// Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aFile;
aPath.ToAbs();
- GetPathDialog()->EndDialog( TRUE );
+ GetPathDialog()->EndDialog( sal_True );
}
else
{
@@ -333,7 +332,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
else
if ( pBtn == pCancelBtn )
{
- GetPathDialog()->EndDialog( FALSE );
+ GetPathDialog()->EndDialog( sal_False );
}
else
if ( pBtn == pHomeBtn )
@@ -375,7 +374,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
UniString aEntry( pBox->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
@@ -383,7 +382,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
aNewPath.ToAbs();
if( pBox == pDirList )
{
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wenn es schon das aktuelle ist, dann mache nichts
if( nCurPos == nDirCount-1 )
@@ -404,22 +403,22 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
{
// Neuen Pfad setzen und Listboxen updaten
aPath = aNewPath;
- if( !aPath.SetCWD( TRUE ) )
+ if( !aPath.SetCWD( sal_True ) )
{
ErrorBox aBox( GetPathDialog(),
WB_OK_CANCEL | WB_DEF_OK,
UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) );
if( aBox.Execute() == RET_CANCEL )
- GetPathDialog()->EndDialog( FALSE );
+ GetPathDialog()->EndDialog( sal_False );
}
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
}
pSvPathDialog->LeaveWait();
return 0;
}
-void ImpPathDialog::UpdateEntries( const BOOL )
+void ImpPathDialog::UpdateEntries( const sal_Bool )
{
UniString aTabString;
DirEntry aTmpPath;
@@ -427,10 +426,10 @@ void ImpPathDialog::UpdateEntries( const BOOL )
nDirCount = aTmpPath.Level();
- pDirList->SetUpdateMode( FALSE );
+ pDirList->SetUpdateMode( sal_False );
pDirList->Clear();
- for( USHORT i = nDirCount; i > 0; i-- )
+ for( sal_uInt16 i = nDirCount; i > 0; i-- )
{
UniString aName( aTabString );
aName += aTmpPath[i-1].GetName();
@@ -444,13 +443,13 @@ void ImpPathDialog::UpdateEntries( const BOOL )
Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
- USHORT nEntries = aDir.Count();
+ sal_uInt16 nEntries = aDir.Count();
if( nEntries )
{
UniStringList aSortDirList;
const comphelper::string::NaturalStringSorter& rSorter =
::vcl::unohelper::getNaturalStringSorterForAppLocale();
- for ( USHORT n = 0; n < nEntries; n++ )
+ for ( sal_uInt16 n = 0; n < nEntries; n++ )
{
DirEntry& rEntry = aDir[n];
UniString aName( rEntry.GetName() );
@@ -491,7 +490,7 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath )
pDirList->SetTopEntry( nDirCount > 1
? nDirCount - 2
: nDirCount - 1 );
- pDirList->SetUpdateMode( TRUE );
+ pDirList->SetUpdateMode( sal_True );
pDirList->Invalidate();
pDirList->Update();
@@ -502,10 +501,10 @@ void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath )
pEdit->SetText( aDirName );
}
-BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
+sal_Bool ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
{
if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
- return FALSE;
+ return sal_False;
else
{
// Datei vorhanden ?
@@ -519,7 +518,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
if( aQuery.Execute() == RET_YES )
rDirEntry.MakeDir();
else
- return FALSE;
+ return sal_False;
}
if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) )
{
@@ -529,7 +528,7 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
aBoxText.AppendAscii( "]" );
InfoBox aBox( GetPathDialog(), aBoxText );
aBox.Execute();
- return FALSE;
+ return sal_False;
}
}
return GetPathDialog()->OK() != 0;
@@ -539,8 +538,8 @@ BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
void ImpPathDialog::PreExecute()
{
// Neues Verzeichnis setzen und Listboxen updaten
- aPath.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aPath.SetCWD( sal_True );
+ UpdateEntries( sal_True );
// Zusaetzliche Buttons anordnen
Point aPos;
@@ -563,8 +562,8 @@ void ImpPathDialog::PreExecute()
long nMaxWidth = 0;
// Maximale Breite ermitteln
- USHORT nChilds = GetPathDialog()->GetChildCount();
- USHORT n;
+ sal_uInt16 nChilds = GetPathDialog()->GetChildCount();
+ sal_uInt16 n;
for ( n = nOwnChilds; n < nChilds; n++ )
{
Window* pChild = GetPathDialog()->GetChild( n );
@@ -624,11 +623,11 @@ void ImpPathDialog::PreExecute()
DirEntry aTmpDirEntry;
Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK );
- USHORT nCount = aDir.Count(), i;
+ sal_uInt16 nCount = aDir.Count(), i;
for( i = 0; i < nCount; ++i )
{
DirEntry& rEntry = aDir[i];
- UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE );
+ UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, sal_False );
UniString aVolume = rEntry.GetVolume() ;
aStr.ToUpperAscii();
@@ -674,8 +673,8 @@ void ImpPathDialog::SetPath( UniString const & rPath )
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
pEdit->SetText( rPath );
- aFile.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aFile.SetCWD( sal_True );
+ UpdateEntries( sal_True );
pSvPathDialog->LeaveWait();
}
@@ -697,7 +696,7 @@ UniString ImpPathDialog::GetPath() const
ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) :
- ImpPathDialog( pDlg, nType, FALSE )
+ ImpPathDialog( pDlg, nType, sal_False )
{
bOpen = (nWinBits & WB_SAVEAS) == 0;
@@ -777,10 +776,10 @@ void ImpFileDialog::InitControls()
const long nButtonStartX = 2*nW+20+15;
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_OK ), 0 );
+ Button::GetStandardText( BUTTON_OK ), "" );
INITCONTROL( pCancelBtn, CancelButton, 0,
Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
- Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ Button::GetStandardText( BUTTON_CANCEL ), "" );
pLoadBtn = 0;
@@ -836,7 +835,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
UniString aEntry( pBox->GetSelectEntry() );
aEntry.EraseLeadingChars( ' ' );
- USHORT nPos = aEntry.Search( '/' );
+ sal_uInt16 nPos = aEntry.Search( '/' );
aEntry.Erase( nPos );
// build the absolute path to the selected item
@@ -846,7 +845,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
if( ( pDirList != pFileList ) && ( pBox == pDirList ) )
{
// SVLOOK
- USHORT nCurPos = pDirList->GetSelectEntryPos();
+ sal_uInt16 nCurPos = pDirList->GetSelectEntryPos();
// Wenn es schon das aktuelle ist, dann mache nichts
if( nCurPos == nDirCount-1 )
@@ -875,7 +874,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
{
// dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aNewPath;
- GetFileDialog()->EndDialog( TRUE );
+ GetFileDialog()->EndDialog( sal_True );
}
}
@@ -888,15 +887,15 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
{
// Neuen Pfad setzen und Listboxen updaten
aPath = aNewPath;
- if( !aPath.SetCWD( TRUE ) )
+ if( !aPath.SetCWD( sal_True ) )
{
if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK,
UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL )
{
- GetFileDialog()->EndDialog( FALSE );
+ GetFileDialog()->EndDialog( sal_False );
}
}
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
GetFileDialog()->FileSelect();
}
@@ -913,7 +912,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
}
pEdit->SetText( aMask() );
- UpdateEntries( FALSE );
+ UpdateEntries( sal_False );
GetFileDialog()->FilterSelect();
}
@@ -934,7 +933,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
// Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
aPath = aFile;
aPath.ToAbs();
- GetFileDialog()->EndDialog( TRUE );
+ GetFileDialog()->EndDialog( sal_True );
}
else
{
@@ -949,19 +948,19 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
pEdit->SetText( aMask() );
- aFile.SetCWD( TRUE );
- UpdateEntries( TRUE );
+ aFile.SetCWD( sal_True );
+ UpdateEntries( sal_True );
GetFileDialog()->LeaveWait();
}
}
else if( pBtn == pCancelBtn )
- GetFileDialog()->EndDialog( FALSE );
+ GetFileDialog()->EndDialog( sal_False );
return 0;
}
-void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
+void ImpFileDialog::UpdateEntries( const sal_Bool bWithDirs )
{
GetFileDialog()->EnterWait();
@@ -972,16 +971,16 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
if( pFileList )
{
- pFileList->SetUpdateMode( FALSE );
+ pFileList->SetUpdateMode( sal_False );
pFileList->Clear();
}
if( bWithDirs && (pDirList != pFileList) )
{
- pDirList->SetUpdateMode( FALSE );
+ pDirList->SetUpdateMode( sal_False );
pDirList->Clear();
- for( USHORT i = nDirCount; i > 0; i-- )
+ for( sal_uInt16 i = nDirCount; i > 0; i-- )
{
UniString aEntryStr( aTabString );
aEntryStr += aTmpPath[i-1].GetName();
@@ -1000,10 +999,10 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
DirEntry aCurrent;
aCurrent.ToAbs();
Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
- USHORT nEntries = aDir.Count();
+ sal_uInt16 nEntries = aDir.Count();
// TempMask, weil Vergleich case-sensitiv
- BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive();
+ sal_Bool bMatchCase = sal_False; //aCurrent.IsCaseSensitive();
UniString aWildCard( aMask.GetWildCard() );
if ( !bMatchCase )
aWildCard.ToLowerAscii();
@@ -1013,7 +1012,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
UniStringList aSortDirList;
const comphelper::string::NaturalStringSorter& rSorter =
::vcl::unohelper::getNaturalStringSorterForAppLocale();
- for ( USHORT n = 0; n < nEntries; n++ )
+ for ( sal_uInt16 n = 0; n < nEntries; n++ )
{
DirEntry& rEntry = aDir[n];
UniString aName( rEntry.GetName() );
@@ -1075,7 +1074,7 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
pFileList->SelectEntryPos( 1 );
else
pFileList->SetNoSelection();
- pFileList->SetUpdateMode( TRUE );
+ pFileList->SetUpdateMode( sal_True );
pFileList->Invalidate();
pFileList->Update();
}
@@ -1094,14 +1093,14 @@ void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
GetFileDialog()->LeaveWait();
}
-BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
+sal_Bool ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
{
if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
- return FALSE;
+ return sal_False;
if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR )
{
if( pFileList )
- return FALSE;
+ return sal_False;
}
else if( bOpen )
{
@@ -1115,7 +1114,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
InfoBox aBox( GetFileDialog(),
aErrorString );
aBox.Execute();
- return FALSE;
+ return sal_False;
}
}
else
@@ -1131,7 +1130,7 @@ BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
WinBits( WB_YES_NO | WB_DEF_NO ),
aQueryString );
if( aBox.Execute() != RET_YES )
- return FALSE;
+ return sal_False;
}
}
return GetFileDialog()->OK() != 0;
@@ -1160,9 +1159,9 @@ void ImpFileDialog::SetPath( UniString const & rPath )
pEdit->SetText( rPath );
}
- aFile.SetCWD( TRUE );
+ aFile.SetCWD( sal_True );
- UpdateEntries( TRUE );
+ UpdateEntries( sal_True );
GetFileDialog()->LeaveWait();
}
@@ -1217,7 +1216,7 @@ void ImpFileDialog::SetCurFilter( const UniString& rFilter )
for ( size_t i = 0, n = aFilterList.size(); i < n; ++i ) {
if ( aFilterList[ i ]->aName == rFilter ) {
- pTypeList->SelectEntryPos( USHORT( i ) );
+ pTypeList->SelectEntryPos( sal_uInt16( i ) );
return;
}
}
@@ -1251,7 +1250,7 @@ void ImpFileDialog::PreExecute()
if( pTypeList )
{
- USHORT nCurType = pTypeList->GetSelectEntryPos();
+ sal_uInt16 nCurType = pTypeList->GetSelectEntryPos();
if( nCurType < aFilterList.size() )
{
UniString aFilterListMask = aFilterList[ nCurType ]->aMask;
@@ -1291,7 +1290,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const
UniString aPostfix; // hier kommt die ausgesuchte Extension herein
// ist ein Filter mit Extension gesetzt?
- USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos();
+ sal_uInt16 nChosenFilterPos = pTypeList->GetSelectEntryPos();
if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND )
{
UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos );
@@ -1344,7 +1343,7 @@ UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const
}
-void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate )
+void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate )
{
delete pDlg;
if ( nType == WINDOW_PATHDIALOG )
diff --git a/svtools/source/dialogs/filedlg2.hxx b/svtools/source/dialogs/filedlg2.hxx
index 99a002440e1c..e65bebe6f155 100644
--- a/svtools/source/dialogs/filedlg2.hxx
+++ b/svtools/source/dialogs/filedlg2.hxx
@@ -91,17 +91,17 @@ private:
PushButton* pHomeBtn;
PushButton* pNewDirBtn;
- USHORT nOwnChilds;
+ sal_uInt16 nOwnChilds;
DirEntry aPath; // aktuell angewaehlter Pfad
- USHORT nDirCount; // Anzahl der Verzeichnis-
+ sal_uInt16 nDirCount; // Anzahl der Verzeichnis-
// Verschachtelungen
protected:
- virtual void UpdateEntries( const BOOL bWithDirs );
+ virtual void UpdateEntries( const sal_Bool bWithDirs );
void UpdateDirs( const DirEntry& rTmpPath );
- BOOL IsFileOk( const DirEntry& rDirEntry );
+ sal_Bool IsFileOk( const DirEntry& rDirEntry );
void InitControls();
DECL_LINK( SelectHdl, ListBox * );
@@ -109,7 +109,7 @@ protected:
DECL_LINK( ClickHdl, Button * );
public:
- ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, BOOL bCreateDir );
+ ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir );
virtual ~ImpPathDialog();
virtual void SetPath( const String& rPath );
@@ -138,9 +138,9 @@ private:
WildCard aMask; // aktuelle Maske
ImpFilterList aFilterList; // Filterliste
- USHORT nCurFilter; // aktueller Filter
+ sal_uInt16 nCurFilter; // aktueller Filter
- BOOL bOpen; // TRUE = Open; FALSE = SAVEAS
+ sal_Bool bOpen; // sal_True = Open; sal_False = SAVEAS
protected:
void InitControls();
@@ -151,8 +151,8 @@ protected:
DECL_LINK( DblClickHdl, ListBox * );
DECL_LINK( ClickHdl, Button * );
- virtual void UpdateEntries( const BOOL bWithDirs );
- BOOL IsFileOk( const DirEntry& rDirEntry );
+ virtual void UpdateEntries( const sal_Bool bWithDirs );
+ sal_Bool IsFileOk( const DirEntry& rDirEntry );
public:
ImpFileDialog( PathDialog* pDlg, WinBits nStyle, RESOURCE_TYPE nType );
@@ -205,7 +205,7 @@ public:
~ImpSvFileDlg() { delete pDlg; }
ImpPathDialog* GetDialog() const { return pDlg; }
- void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate );
+ void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, sal_Bool bCreate );
void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt
void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); }
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
index 47277de88a52..629d4699b309 100644
--- a/svtools/source/dialogs/filedlg2.src
+++ b/svtools/source/dialogs/filedlg2.src
@@ -25,7 +25,8 @@
*
************************************************************************/
-#include <filedlg2.hrc>
+#include <svtools/filedlg2.hrc>
+
String STR_FILEDLG_SELECT
{
Text [ en-US ] = "Select Directory" ;
diff --git a/svtools/source/dialogs/formats.src b/svtools/source/dialogs/formats.src
index 7587eedd6b86..0477cd1bc4ca 100644
--- a/svtools/source/dialogs/formats.src
+++ b/svtools/source/dialogs/formats.src
@@ -25,7 +25,7 @@
*
************************************************************************/
-#include "sores.hxx"
+#include <svtools/sores.hxx>
String STR_FORMAT_STRING
{
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index f2002ed27179..9d060f4e8a01 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -34,7 +34,7 @@
// include ---------------------------------------------------------------
#include <svtools/insdlg.hxx>
-#include "sores.hxx"
+#include <svtools/sores.hxx>
#include <svtools/svtdata.hxx>
#include <tools/rc.hxx>
@@ -79,7 +79,7 @@ PRV_SV_IMPL_OWNER_LIST( SvObjectServerList, SvObjectServer )
*************************************************************************/
const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) const
{
- for( ULONG i = 0; i < Count(); i++ )
+ for( sal_uLong i = 0; i < Count(); i++ )
{
if( rHumanName == GetObject( i ).GetHumanName() )
return &GetObject( i );
@@ -94,7 +94,7 @@ const SvObjectServer * SvObjectServerList::Get( const String & rHumanName ) cons
*************************************************************************/
const SvObjectServer * SvObjectServerList::Get( const SvGlobalName & rName ) const
{
- for( ULONG i = 0; i < Count(); i++ )
+ for( sal_uLong i = 0; i < Count(); i++ )
{
if( rName == GetObject( i ).GetClassName() )
return &GetObject( i );
@@ -238,7 +238,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
struct SotResourcePair
{
SotFormatStringId mnSotId;
- USHORT mnResId;
+ sal_uInt16 mnResId;
};
static const SotResourcePair aSotResourcePairs[] =
@@ -312,7 +312,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
};
String aUIName;
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
for( sal_uInt32 i = 0, nCount = SAL_N_ELEMENTS( aSotResourcePairs ); ( i < nCount ) && !nResId; i++ )
{
diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk
deleted file mode 100755
index ede452cb29c8..000000000000
--- a/svtools/source/dialogs/makefile.mk
+++ /dev/null
@@ -1,81 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=dialogs
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= filedlg2.src \
- so3res.src \
- formats.src \
- prnsetup.src \
- printdlg.src \
- colrdlg.src \
- addresstemplate.src \
- wizardmachine.src
-
-
-EXCEPTIONSFILES= $(SLO)$/addresstemplate.obj \
- $(SLO)$/colctrl.obj \
- $(SLO)$/colrdlg.obj \
- $(SLO)$/filedlg.obj \
- $(SLO)$/filedlg2.obj \
- $(SLO)$/insdlg.obj \
- $(SLO)$/printdlg.obj \
- $(SLO)$/prnsetup.obj \
- $(SLO)$/property.obj \
- $(SLO)$/roadmapwizard.obj \
- $(SLO)$/wizardmachine.obj \
- $(SLO)$/wizdlg.obj
-
-SLOFILES= \
- $(SLO)$/addresstemplate.obj \
- $(SLO)$/colctrl.obj \
- $(SLO)$/colrdlg.obj \
- $(SLO)$/filedlg.obj \
- $(SLO)$/filedlg2.obj \
- $(SLO)$/insdlg.obj \
- $(SLO)$/mcvmath.obj \
- $(SLO)$/printdlg.obj \
- $(SLO)$/prnsetup.obj \
- $(SLO)$/property.obj \
- $(SLO)$/roadmapwizard.obj \
- $(SLO)$/wizardmachine.obj \
- $(SLO)$/wizdlg.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx
index 66a61ee7d232..5d5ad14c82c2 100644
--- a/svtools/source/dialogs/mcvmath.cxx
+++ b/svtools/source/dialogs/mcvmath.cxx
@@ -94,11 +94,11 @@ FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb )
|*
**************************************************************************/
-USHORT ImpSqrt( ULONG nRadi )
+sal_uInt16 ImpSqrt( sal_uLong nRadi )
{
- register ULONG inf = 1;
- register ULONG sup = nRadi;
- register ULONG sqr;
+ register sal_uLong inf = 1;
+ register sal_uLong sup = nRadi;
+ register sal_uLong sqr;
if ( !nRadi )
return 0;
@@ -113,7 +113,7 @@ USHORT ImpSqrt( ULONG nRadi )
sqr = (nRadi/sqr + sqr) >> 1; // 2 Newton-Iterationen reichen fuer
sqr = (nRadi/sqr + sqr) >> 1; // +- 1 Digit
- return sal::static_int_cast< USHORT >(sqr);
+ return sal::static_int_cast< sal_uInt16 >(sqr);
}
/**************************************************************************
@@ -126,7 +126,7 @@ USHORT ImpSqrt( ULONG nRadi )
// e**(i*nPhi), Einheit nPhi: 2**16 == 360 Grad
-FixCpx ImpExPI( USHORT nPhi )
+FixCpx ImpExPI( sal_uInt16 nPhi )
{
short i;
FixCpx aIter(1L); // e**(0*i)
@@ -156,10 +156,10 @@ FixCpx ImpExPI( USHORT nPhi )
// use for x*x+y*y==1 only
-static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
+static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY )
{
- USHORT phi0 = 0; // result angel higher part
- USHORT phi = 0; // dito lower part
+ sal_uInt16 phi0 = 0; // result angel higher part
+ sal_uInt16 phi = 0; // dito lower part
long x = rX.x;
long y = rY.x;
long z;
@@ -168,7 +168,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
FixCpx aTry;
FixCpx aInc;
FixCpx aIter(1L);
- BOOL Small = FALSE;
+ sal_Bool Small = sal_False;
if ( (x==0) && (y==0) )
return 0;
@@ -216,7 +216,7 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
phi += (1<<i);
if ( i > 11 )
- Small=TRUE;
+ Small=sal_True;
}
}
}
@@ -232,9 +232,9 @@ static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
|*
**************************************************************************/
-USHORT ImpATan2( const short x, const short y )
+sal_uInt16 ImpATan2( const short x, const short y )
{
- Fix rRad = ImpSqrt(ULONG(long(x)*x+long(y)*y));
+ Fix rRad = ImpSqrt(sal_uLong(long(x)*x+long(y)*y));
if ( !rRad.x )
return 0;
@@ -254,9 +254,9 @@ USHORT ImpATan2( const short x, const short y )
|*
**************************************************************************/
-void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi )
+void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi )
{
- rRad = Fix( ImpSqrt( ULONG( long(x)*x+long(y)*y ) ) );
+ rRad = Fix( ImpSqrt( sal_uLong( long(x)*x+long(y)*y ) ) );
if ( !rRad.x )
rPhi=0;
@@ -279,7 +279,7 @@ void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi )
|*
**************************************************************************/
-void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY )
+void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY )
{
FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos()
fc.GetReal().MultBig( rR );
diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx
index bad63f33093f..5e0d47e655ef 100644
--- a/svtools/source/dialogs/mcvmath.hxx
+++ b/svtools/source/dialogs/mcvmath.hxx
@@ -84,7 +84,7 @@ public:
Fix() { x=0; }
Fix( int i ) { x=(long(i)<<FIX_POST); }
Fix( short l ) { x=(long(l)<<FIX_POST); }
- Fix( USHORT l ) { x=(long(l)<<FIX_POST); }
+ Fix( sal_uInt16 l ) { x=(long(l)<<FIX_POST); }
Fix( long l ) { x=(l<<FIX_POST); }
Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; }
@@ -102,8 +102,8 @@ public:
void DivBig( const Fix& a )
{ x=((x<<FIX_P3)/a.x)<<FIX_P2; }
- friend BOOL operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; }
- friend BOOL operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; }
+ friend sal_Bool operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; }
+ friend sal_Bool operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; }
operator long() const { return (x+FIX_ADD) >> FIX_POST; }
operator double() const { return double(x)/(1<<FIX_POST); }
@@ -219,12 +219,12 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b )
Fix ImpMultBig2( const Fix& a, const Fix& b );
FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb );
-void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi );
-void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY );
+void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi );
+void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY );
-USHORT ImpSqrt( ULONG nRadi );
-USHORT ImpATan2( const short x, const short y );
-FixCpx ImpExPI( USHORT nPhi );
+sal_uInt16 ImpSqrt( sal_uLong nRadi );
+sal_uInt16 ImpATan2( const short x, const short y );
+FixCpx ImpExPI( sal_uInt16 nPhi );
#endif // _MCVMATH_HXX
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
deleted file mode 100644
index ebb75e0dc6cc..000000000000
--- a/svtools/source/dialogs/printdlg.cxx
+++ /dev/null
@@ -1,787 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/print.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/jobset.hxx>
-#include <sal/macros.h>
-#include <tools/urlobj.hxx>
-
-#include "printdlg.hrc"
-#include "controldims.hrc"
-#include <svtools/prnsetup.hxx>
-#include <svtools/printdlg.hxx>
-#include <svtools/svtdata.hxx>
-#include <filedlg.hxx>
-#include "svl/pickerhelper.hxx"
-#include <svtools/helpid.hrc>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <comphelper/processfactory.hxx>
-
-using rtl::OUString;
-using namespace com::sun::star;
-
-struct SvtPrinterImpl
-{
- Printer* m_pTempPrinter;
- sal_Bool m_bHelpDisabled;
- PrintSheetRange m_eSheetRange;
-
- SvtPrinterImpl() :
- m_pTempPrinter( NULL ), m_bHelpDisabled( sal_False ), m_eSheetRange( PRINTSHEETS_ALL ) {}
- ~SvtPrinterImpl() { delete m_pTempPrinter; }
-};
-
-#define TEMPPRINTER() mpPrinterImpl->m_pTempPrinter
-
-// =======================================================================
-
-PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) :
- ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRINTDLG ) ),
- maFlPrinter ( this, SvtResId( FL_PRINTER ) ),
- maFtName ( this, SvtResId( FT_NAME ) ),
- maLbName ( this, SvtResId( LB_NAMES ) ),
- maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ),
- maFtStatus ( this, SvtResId( FT_STATUS ) ),
- maFiStatus ( this, SvtResId( FI_STATUS ) ),
- maFtType ( this, SvtResId( FT_TYPE ) ),
- maFiType ( this, SvtResId( FI_TYPE ) ),
- maFtLocation ( this, SvtResId( FT_LOCATION ) ),
- maFiLocation ( this, SvtResId( FI_LOCATION ) ),
- maFtComment ( this, SvtResId( FT_COMMENT ) ),
- maFiComment ( this, SvtResId( FI_COMMENT ) ),
- maCbxFilePrint ( this, SvtResId( CBX_FILEPRINT ) ),
- maFiPrintFile ( this, SvtResId( FI_PRINTFILE ) ),
- maFiFaxNo ( this, SvtResId( FI_FAXNO ) ),
- maEdtFaxNo ( this, SvtResId( EDT_FAXNO ) ),
- maFlPrint ( this, SvtResId( FL_PRINT ) ),
- maRbtAllSheets ( this, SvtResId( RBT_ALL_SHEETS ) ),
- maRbtSelectedSheets ( this, SvtResId( RBT_SELECTED_SHEETS ) ),
- maRbtSelectedCells ( this, SvtResId( RBT_SELECTED_CELLS ) ),
- maFlPrintRange ( this, SvtResId( FL_PRINTRANGE ) ),
- maRbtAll ( this, SvtResId( RBT_ALL ) ),
- maRbtPages ( this, SvtResId( RBT_PAGES ) ),
- maRbtSelection ( this, SvtResId( RBT_SELECTION ) ),
- maEdtPages ( this, SvtResId( EDT_PAGES ) ),
- maFlSepCopiesRange ( this, SvtResId( FL_SEPCOPIESRANGE ) ),
- maFlCopies ( this, SvtResId( FL_COPIES ) ),
- maFtCopies ( this, SvtResId( FT_COPIES ) ),
- maNumCopies ( this, SvtResId( NUM_COPIES ) ),
- maImgCollate ( this, SvtResId( IMG_COLLATE ) ),
- maImgNotCollate ( this, SvtResId( IMG_NOT_COLLATE ) ),
- maCbxCollate ( this, SvtResId( CBX_COLLATE ) ),
- maFlSepButtonLine ( this, SvtResId( FL_SEPBUTTONLINE ) ),
- maBtnOptions ( this, SvtResId( BTN_OPTIONS ) ),
- maBtnOK ( this, SvtResId( BTN_OK ) ),
- maBtnCancel ( this, SvtResId( BTN_CANCEL ) ),
- maBtnHelp ( this, SvtResId( BTN_HELP ) ),
- mbWithSheetsAndCells( bWithSheetsAndCells ),
- maAllFilterStr ( SvtResId( STR_ALLFILTER ) )
-
-{
- FreeResource();
-
- mpPrinter = NULL;
- mpPrinterImpl = new SvtPrinterImpl;
- mnCopyCount = 1;
- mnFirstPage = 0;
- mnLastPage = 0;
- mnMinPage = 1;
- mnMaxPage = 65535;
- meCheckRange = PRINTDIALOG_ALL;
- mbAll = TRUE;
- mbSelection = FALSE;
- mbFromTo = FALSE;
- mbRange = FALSE;
- mbCollate = TRUE;
- mbCollateCheck = TRUE;
- mbOptions = FALSE;
-
- maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE );
- maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) );
- maBtnProperties.SetClickHdl( LINK( this, PrintDialog, ImplPropertiesHdl ) );
- maLbName.SetSelectHdl( LINK( this, PrintDialog, ImplChangePrinterHdl ) );
-
- maFiPrintFile.SetStyle( maFiPrintFile.GetStyle() | WB_PATHELLIPSIS );
-
- Link aLink( LINK( this, PrintDialog, ImplModifyControlHdl ) );
- maCbxFilePrint.SetClickHdl( aLink );
- maRbtAll.SetClickHdl( aLink );
- maRbtPages.SetClickHdl( aLink );
- maRbtSelection.SetClickHdl( aLink );
- maEdtPages.SetModifyHdl( aLink );
- maNumCopies.SetModifyHdl( aLink );
- maCbxCollate.SetClickHdl( aLink );
- maBtnOptions.SetClickHdl( aLink );
- maEdtFaxNo.SetModifyHdl( aLink );
- maBtnOK.SetClickHdl( aLink );
-
- maRbtAll.Check();
- ImplSetImages();
-}
-
-// -----------------------------------------------------------------------
-
-PrintDialog::~PrintDialog()
-{
- ImplFreePrnDlgListBox( &maLbName, FALSE );
- delete mpPrinterImpl;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetImages()
-{
- maImgCollate.SetModeImage( Image( SvtResId( RID_IMG_PRNDLG_COLLATE ) ) );
- maImgNotCollate.SetModeImage(Image( SvtResId( RID_IMG_PRNDLG_NOCOLLATE ) ) );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplSetInfo()
-{
- const QueueInfo* pInfo = Printer::GetQueueInfo( maLbName.GetSelectEntry(), true );
- if ( pInfo )
- {
- maFiType.SetText( pInfo->GetDriver() );
- maFiLocation.SetText( pInfo->GetLocation() );
- maFiComment.SetText( pInfo->GetComment() );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) );
- }
- else
- {
- XubString aTempStr;
- maFiType.SetText( aTempStr );
- maFiLocation.SetText( aTempStr );
- maFiComment.SetText( aTempStr );
- maFiStatus.SetText( aTempStr );
- }
-
-#ifdef UNX
- if( pInfo && pInfo->GetLocation().EqualsAscii( "fax_queue" ) )
- {
- maFiPrintFile.Show( FALSE );
- maCbxFilePrint.Show( FALSE );
- maFiFaxNo.Show( TRUE );
- maEdtFaxNo.Show( TRUE );
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- maEdtFaxNo.SetText( pPrinter->GetJobValue( String::CreateFromAscii( "FAX#" ) ) );
-
- Size aFTSize = maFiFaxNo.GetSizePixel();
- long nTextWidth = maFiFaxNo.GetCtrlTextWidth( maFiFaxNo.GetText() ) + 10;
- if ( aFTSize.Width() < nTextWidth )
- {
- long nDelta = nTextWidth - aFTSize.Width();
- aFTSize.Width() = aFTSize.Width() + nDelta;
- maFiFaxNo.SetSizePixel( aFTSize );
- Size aEdtSize = maEdtFaxNo.GetSizePixel();
- aEdtSize.Width() = aEdtSize.Width() - nDelta;
- Point aEdtPos = maEdtFaxNo.GetPosPixel();
- aEdtPos.X() = aEdtPos.X() + nDelta;
- maEdtFaxNo.SetPosSizePixel( aEdtPos, aEdtSize );
- }
- }
- else
-#endif
- {
- maFiPrintFile.Show( TRUE );
- maCbxFilePrint.Show( TRUE );
- maFiFaxNo.Show( FALSE );
- maEdtFaxNo.Show( FALSE );
- }
-
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplCheckOK()
-{
- // Ueberprueft, ob der OK-Button enabled ist
- BOOL bEnable = TRUE;
-
- if ( bEnable && maRbtPages.IsChecked() )
- bEnable = maEdtPages.GetText().Len() > 0;
-
- if ( bEnable )
- {
- if ( TEMPPRINTER() )
- bEnable = TEMPPRINTER()->IsValid();
- else
- bEnable = mpPrinter->IsValid();
- }
-
- maBtnOK.Enable( bEnable );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplInitControls()
-{
- // Alles
- if ( mbAll )
- {
- maRbtAll.Enable();
- if( meCheckRange == PRINTDIALOG_ALL )
- maRbtAll.Check( TRUE );
- }
- else
- maRbtAll.Enable( FALSE );
-
- // Selektion
- if ( mbSelection )
- {
- maRbtSelection.Enable();
- if ( meCheckRange == PRINTDIALOG_SELECTION )
- maRbtSelection.Check( TRUE );
- }
- else
- maRbtSelection.Enable( FALSE );
-
- // Seiten
- if ( mbRange )
- {
- maRbtPages.Enable();
- maEdtPages.Show();
- maEdtPages.SetText( maRangeText );
-
- if( ( meCheckRange == PRINTDIALOG_FROMTO ) ||
- ( meCheckRange == PRINTDIALOG_RANGE ) )
- {
- maRbtPages.Check( TRUE );
- maEdtPages.Enable();
- }
- else
- maEdtPages.Enable( FALSE );
- }
- else
- {
- maRbtPages.Enable( FALSE );
- maEdtPages.Hide();
- }
-
- // Anzahl Kopien
- maNumCopies.SetValue( mnCopyCount );
-
- // Sortierung
- maCbxCollate.Enable( mbCollate );
- maCbxCollate.Check( mbCollateCheck );
-
- // Zusaetze-Button
- if ( mbOptions )
- maBtnOptions.Show();
-
- if ( !mbWithSheetsAndCells )
- {
- Size aMarginSize =
- LogicToPixel( Size( RSC_SP_CTRL_GROUP_X, RSC_SP_CTRL_GROUP_Y ), MAP_APPFONT );
- long nTempPos = maImgCollate.GetPosPixel().Y() +
- maImgCollate.GetSizePixel().Height() + aMarginSize.Height();
- long nDelta1 = maFlPrintRange.GetPosPixel().Y() - maFlPrint.GetPosPixel().Y();
- long nDelta2 = maFlSepButtonLine.GetPosPixel().Y() - nTempPos;
-
- maFlPrint.Hide();
- maRbtAllSheets.Hide();
- maRbtSelectedSheets.Hide();
- maRbtSelectedCells.Hide();
- maRbtSelection.Show();
-
- Size aNewSize = GetSizePixel();
- aNewSize.Height() -= nDelta2;
- SetSizePixel( aNewSize );
- aNewSize = maFlSepCopiesRange.GetSizePixel();
- aNewSize.Height() -= nDelta2;
- maFlSepCopiesRange.SetSizePixel( aNewSize );
-
- long nDelta = nDelta1;
- Window* pControls[] = { &maFlPrintRange, &maRbtAll,
- &maRbtPages, &maEdtPages, &maRbtSelection, NULL,
- &maFlSepButtonLine, &maBtnOptions, &maBtnOK,
- &maBtnCancel, &maBtnHelp };
- Window** pCtrl = pControls;
- const sal_Int32 nCount = SAL_N_ELEMENTS( pControls );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCtrl )
- {
- if ( NULL == *pCtrl )
- {
- nDelta = nDelta2;
- continue;
- }
- Point aNewPos = (*pCtrl)->GetPosPixel();
- aNewPos.Y() -= nDelta;
- (*pCtrl)->SetPosPixel( aNewPos );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::ImplFillDialogData()
-{
- if ( maRbtAll.IsChecked() )
- meCheckRange = PRINTDIALOG_ALL;
- else if( maRbtSelection.IsChecked() )
- meCheckRange = PRINTDIALOG_SELECTION;
- else
- {
- meCheckRange = PRINTDIALOG_RANGE;
- maRangeText = maEdtPages.GetText();
- }
-
- mnCopyCount = (USHORT) maNumCopies.GetValue();
- mbCollateCheck = maCbxCollate.IsChecked();
-
- // In Datei drucken
- if ( maCbxFilePrint.IsChecked() )
- mpPrinter->SetPrintFile( maFiPrintFile.GetText() );
- mpPrinter->EnablePrintFile( maCbxFilePrint.IsChecked() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplStatusHdl, Timer*, EMPTYARG )
-{
- QueueInfo aInfo;
- ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo );
- maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplPropertiesHdl, void*, EMPTYARG )
-{
- if ( !TEMPPRINTER() )
- TEMPPRINTER() = new Printer( mpPrinter->GetJobSetup() );
- TEMPPRINTER()->Setup( this );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplChangePrinterHdl, void*, EMPTYARG )
-{
- TEMPPRINTER() = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties,
- mpPrinter, TEMPPRINTER() );
- ImplSetInfo();
- ImplCheckOK(); // Check if "OK" button can be enabled now!
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::ImplGetFilename()
-{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- static ::rtl::OUString aOldFile;
- if( xFactory.is() )
- {
- uno::Sequence< uno::Any > aTempl( 1 );
- aTempl.getArray()[0] <<= ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION;
- uno::Reference< ui::dialogs::XFilePicker > xFilePicker(
- xFactory->createInstanceWithArguments(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ),
- aTempl ), uno::UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- uno::Reference< ui::dialogs::XFilterManager > xFilterMgr( xFilePicker, uno::UNO_QUERY );
- if( xFilePicker.is() && xFilterMgr.is() )
- {
- try
- {
-#ifdef UNX
- // add PostScript and PDF
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- bool bPS = true, bPDF = true;
- if( pPrinter )
- {
- if( pPrinter->GetCapabilities( PRINTER_CAPABILITIES_PDF ) )
- bPS = false;
- else
- bPDF = false;
- }
- if( bPS )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- if( bPDF )
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) );
-#elif defined WNT
- xFilterMgr->appendFilter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.PRN" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
-#endif
- // add arbitrary files
- xFilterMgr->appendFilter( maAllFilterStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) );
- }
- catch( lang::IllegalArgumentException rExc )
- {
- DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( aOldFile.getLength() )
- {
- INetURLObject aUrl( aOldFile, INET_PROT_FILE );
- xFilePicker->setDefaultName( aUrl.GetLastName() );
- aUrl.CutLastName();
- xFilePicker->setDisplayDirectory( aUrl.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- }
-
- if( xFilePicker->execute() == ui::dialogs::ExecutableDialogResults::OK )
- {
- uno::Sequence< ::rtl::OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- maFiPrintFile.SetText( aOldFile = aObj.PathToFileName() );
- return true;
- }
- return false;
- }
- }
-
- // something went awry, lets try the old fashioned dialogue
- Window* pDlgParent = IsReallyVisible() ? this : GetParent();
- FileDialog aDlg( pDlgParent, WB_STDDIALOG | WB_SAVEAS );
-#ifdef WNT
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.prn" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "prn" ) ) );
-#elif defined UNX
- aDlg.AddFilter( String( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
- aDlg.SetDefaultExt( String( RTL_CONSTASCII_USTRINGPARAM( "ps" ) ) );
-#endif
-
- if( aOldFile.getLength() )
- aDlg.SetPath( aOldFile );
-
- if( aDlg.Execute() )
- {
- String aTargetFile = aDlg.GetPath();
- maFiPrintFile.SetText( aOldFile = aTargetFile );
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p )
-{
- // Radiobuttons (Umfang)
- if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) )
- {
- BOOL bCheck = maRbtPages.IsChecked();
- maEdtPages.Enable( bCheck );
- if ( p == &maRbtPages )
- maEdtPages.GrabFocus();
- ImplCheckOK();
- }
-
- // Edit-Felder (Seiten)
- if ( p == &maEdtPages )
- ImplCheckOK();
-
- if( p == &maEdtFaxNo )
- {
- Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
- pPrinter->SetJobValue( String::CreateFromAscii( "FAX#" ), maEdtFaxNo.GetText() );
- }
-
- // Anzahl Kopien
- BOOL bNumCopies = FALSE;
-
- if ( !p || p == &maNumCopies )
- {
- if ( p )
- bNumCopies = TRUE;
- //BOOL bCopies = maNumCopies.GetValue() > 1;
- maCbxCollate.Enable( mbCollate );
-
- /*if ( !bCopies )
- maCbxCollate.Check( FALSE );
- else*/
- if ( mbCollateCheck )
- maCbxCollate.Check( TRUE );
- }
-
- // Sortieren
- if ( !p || p == &maCbxCollate || bNumCopies )
- {
- BOOL bCheck = maCbxCollate.IsChecked();
-
- if ( !bNumCopies )
- mbCollateCheck = maCbxCollate.IsChecked();
-
- if( bCheck )
- {
- maImgCollate.Show();
- maImgNotCollate.Hide();
- }
- else
- {
- maImgCollate.Hide();
- maImgNotCollate.Show();
- }
- }
-
- // Zus"atze
- if ( p == &maBtnOptions )
- ClickOptionsHdl();
-
- if( p == &maBtnOK )
- {
- EndDialog( maCbxFilePrint.IsChecked() ? ImplGetFilename() : TRUE );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::ClickOptionsHdl()
-{
- if ( maOptionsHdlLink.IsSet() )
- return maOptionsHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::OK()
-{
- if ( maOKHdlLink.IsSet() )
- return maOKHdlLink.Call( this );
- else
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::EnableSheetRange( bool bEnable, PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Enable( bEnable != false );
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Enable( bEnable != false );
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::EnableSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeEnabled( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsEnabled() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsEnabled() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeEnabled(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::CheckSheetRange( PrintSheetRange eRange )
-{
- if ( mbWithSheetsAndCells )
- {
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- maRbtAllSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- maRbtSelectedSheets.Check();
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- maRbtSelectedCells.Check();
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::CheckSheetRange(): invalid range" );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-PrintSheetRange PrintDialog::GetCheckedSheetRange() const
-{
- PrintSheetRange eRange = PRINTSHEETS_ALL;
- if ( mbWithSheetsAndCells )
- {
- if ( maRbtSelectedSheets.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_SHEETS;
- else if ( maRbtSelectedCells.IsChecked() )
- eRange = PRINTSHEETS_SELECTED_CELLS;
- }
- return eRange;
-}
-
-// -----------------------------------------------------------------------
-
-bool PrintDialog::IsSheetRangeChecked( PrintSheetRange eRange ) const
-{
- if ( !mbWithSheetsAndCells )
- return false;
-
- bool bRet = false;
- switch ( eRange )
- {
- case PRINTSHEETS_ALL :
- bRet = maRbtAllSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_SHEETS :
- bRet = maRbtSelectedSheets.IsChecked() != FALSE;
- break;
- case PRINTSHEETS_SELECTED_CELLS :
- bRet = maRbtSelectedCells.IsChecked() != FALSE;
- break;
- default:
- DBG_ERRORFILE( "PrintDialog::IsSheetRangeChecked(): invalid range" );
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-long PrintDialog::Notify( NotifyEvent& rNEvt )
-{
- if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() )
- ImplStatusHdl( &maStatusTimer );
- else if ( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if ( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F1 && mpPrinterImpl->m_bHelpDisabled )
- return 1; // do nothing
- }
-
- return ModalDialog::Notify( rNEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( rDCEvt.GetType() == DATACHANGED_PRINTER )
- {
- TEMPPRINTER() = ImplPrnDlgUpdatePrinter( mpPrinter, TEMPPRINTER() );
- Printer* pPrn;
- if ( TEMPPRINTER() )
- pPrn = TEMPPRINTER();
- else
- pPrn = mpPrinter;
- ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties );
- ImplSetInfo();
- ImplCheckOK();
- }
- else if ( rDCEvt.GetType() == DATACHANGED_SETTINGS )
- ImplSetImages();
-
- ModalDialog::DataChanged( rDCEvt );
-}
-
-// -----------------------------------------------------------------------
-
-short PrintDialog::Execute()
-{
- if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
- {
- DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
- return FALSE;
- }
-
- // check if the printer brings up its own dialog
- // in that case leave the work to that dialog
- if( mpPrinter->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) )
- return TRUE;
-
- Printer::updatePrinters();
-
- // Controls initialisieren
- ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties );
- ImplSetInfo();
- maStatusTimer.Start();
- ImplInitControls();
- maNumCopies.GrabFocus();
- maNumCopies.SetSelection( Selection( 0, maNumCopies.GetText().Len() ) );
- ImplModifyControlHdl( NULL );
-
- // Dialog starten
- short nRet = ModalDialog::Execute();
-
- // Wenn Dialog mit OK beendet wurde, dann die Daten updaten
- if( nRet == TRUE )
- {
- if ( TEMPPRINTER() )
- mpPrinter->SetPrinterProps( TEMPPRINTER() );
- ImplFillDialogData();
- }
-
- maStatusTimer.Stop();
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------
-
-void PrintDialog::DisableHelp()
-{
- mpPrinterImpl->m_bHelpDisabled = sal_True;
- maBtnHelp.Disable();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/printdlg.hrc b/svtools/source/dialogs/printdlg.hrc
deleted file mode 100644
index 83b7b0b28c82..000000000000
--- a/svtools/source/dialogs/printdlg.hrc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/svtools.hrc>
-
-#define FL_PRINTER 1
-#define LB_NAMES 2
-#define BTN_PROPERTIES 3
-#define FT_NAME 4
-#define FT_STATUS 5
-#define FI_STATUS 6
-#define FT_TYPE 7
-#define FI_TYPE 8
-#define FT_LOCATION 9
-#define FI_LOCATION 10
-#define FT_COMMENT 11
-#define FI_COMMENT 12
-#define CBX_FILEPRINT 13
-#define FI_PRINTFILE 14
-#define FI_FAXNO 15
-#define EDT_FAXNO 16
-
-#define FL_PRINT 20
-#define RBT_ALL_SHEETS 21
-#define RBT_SELECTED_SHEETS 22
-#define RBT_SELECTED_CELLS 23
-
-#define FL_PRINTRANGE 30
-#define RBT_ALL 31
-#define RBT_PAGES 32
-#define EDT_PAGES 33
-#define RBT_SELECTION 34
-
-#define FL_SEPCOPIESRANGE 35
-
-#define FL_COPIES 40
-#define FT_COPIES 41
-#define NUM_COPIES 42
-#define CBX_COLLATE 43
-#define IMG_COLLATE 44
-#define IMG_NOT_COLLATE 45
-
-#define FL_SEPBUTTONLINE 50
-#define BTN_OK 51
-#define BTN_CANCEL 52
-#define BTN_HELP 53
-#define BTN_OPTIONS 54
-
-#define STR_ALLFILTER 10
-
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
deleted file mode 100644
index 6ce73d01aa7f..000000000000
--- a/svtools/source/dialogs/printdlg.src
+++ /dev/null
@@ -1,289 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "printdlg.hrc"
-
-#define IMAGE_MAGENTA_MASK Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
-
-ModalDialog DLG_SVT_PRNDLG_PRINTDLG
-{
- SVLook = TRUE ;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 265 , 210 ) ;
- Text [ en-US ] = "Print" ;
- FixedLine FL_PRINTER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 253 , 8 ) ;
- Text [ en-US ] = "Printer" ;
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- };
- ListBox LB_NAMES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 13 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- PushButton BTN_PROPERTIES
- {
- Pos = MAP_APPFONT ( 193 , 12 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Propert~ies..." ;
- };
- FixedText FT_STATUS
- {
- Pos = MAP_APPFONT ( 12 , 29 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Status" ;
- };
- FixedText FI_STATUS
- {
- Pos = MAP_APPFONT ( 60 , 29 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FI_TYPE
- {
- Pos = MAP_APPFONT ( 60 , 40 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_LOCATION
- {
- Pos = MAP_APPFONT ( 12 , 51 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Location" ;
- };
- FixedText FI_LOCATION
- {
- Pos = MAP_APPFONT ( 60 , 51 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FT_COMMENT
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Comment" ;
- };
- FixedText FI_COMMENT
- {
- Pos = MAP_APPFONT ( 60 , 62 ) ;
- Size = MAP_APPFONT ( 193 , 8 ) ;
- };
- FixedText FI_FAXNO
- {
- Pos = MAP_APPFONT ( 12 , 75 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Fax number";
- };
- Edit EDT_FAXNO
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 60 , 73 );
- Size = MAP_APPFONT ( 188 , 12 );
- };
- CheckBox CBX_FILEPRINT
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Print to file" ;
- };
- FixedText FI_PRINTFILE
- {
- Pos = MAP_APPFONT ( 90 , 74 ) ;
- Size = MAP_APPFONT ( 163 , 8 ) ;
- };
- /*!!!
- PushButton BTN_BROWSE
- {
- Pos = MAP_APPFONT ( 234 , 75 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
- Hide = TRUE ;
- };
- */
- FixedLine FL_PRINT
- {
- Pos = MAP_APPFONT ( 6 , 91 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print" ;
- };
- RadioButton RBT_ALL_SHEETS
- {
- Pos = MAP_APPFONT ( 12 , 102 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All sheets" ;
- };
- RadioButton RBT_SELECTED_SHEETS
- {
- Pos = MAP_APPFONT ( 12 , 115 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected sheets" ;
- };
- RadioButton RBT_SELECTED_CELLS
- {
- Pos = MAP_APPFONT ( 12 , 128 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selected cells" ;
- };
- FixedLine FL_PRINTRANGE
- {
- Pos = MAP_APPFONT ( 6 , 141 ) ;
- Size = MAP_APPFONT ( 117 , 8 ) ;
- Text [ en-US ] = "Print range" ;
- };
- RadioButton RBT_ALL
- {
- Pos = MAP_APPFONT ( 12 , 152 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "All pages" ;
- };
- RadioButton RBT_PAGES
- {
- Pos = MAP_APPFONT ( 12 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "Pages" ;
- };
- Edit EDT_PAGES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 65 , 164 ) ;
- Size = MAP_APPFONT ( 52 , 12 ) ;
- };
- RadioButton RBT_SELECTION
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 179 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Selection" ;
- };
- FixedLine FL_SEPCOPIESRANGE
- {
- Pos = MAP_APPFONT( 126, 102 );
- Size = MAP_APPFONT( 1, 74 );
- Vert = TRUE;
- };
- FixedLine FL_COPIES
- {
- Pos = MAP_APPFONT ( 129 , 91 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Copies" ;
- };
- FixedText FT_COPIES
- {
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 63 , 8 ) ;
- Text [ en-US ] = "Number of copies" ;
- };
- NumericField NUM_COPIES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 201 , 102 ) ;
- Size = MAP_APPFONT ( 33 , 12 ) ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- StrictFormat = TRUE ;
- First = 1 ;
- Last = 9999 ;
- };
- CheckBox CBX_COLLATE
- {
- Pos = MAP_APPFONT ( 201 , 123 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "Co~llate" ;
- };
- FixedImage IMG_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedImage IMG_NOT_COLLATE
- {
- Pos = MAP_APPFONT ( 132 , 117 ) ;
- Size = MAP_APPFONT ( 67 , 22 ) ;
- Hide = TRUE ;
- };
- FixedLine FL_SEPBUTTONLINE
- {
- Pos = MAP_APPFONT( 0, 179 );
- Size = MAP_APPFONT( 265, 8 );
- };
- PushButton BTN_OPTIONS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Options..." ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 100 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 153 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 209 , 190 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String STR_ALLFILTER
- {
- Text [ en-US ] = "<All>";
- };
-};
-
-Image RID_IMG_PRNDLG_COLLATE
-{
- ImageBitmap = Bitmap { File = "collate.png" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
-
-Image RID_IMG_PRNDLG_NOCOLLATE
-{
- ImageBitmap = Bitmap { File = "ncollate.png" ; };
- MaskColor = IMAGE_MAGENTA_MASK ;
-};
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 3abad8dd8505..728d0e6ea5c7 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -57,7 +57,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter,
// -----------------------------------------------------------------------
-void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear )
+void ImplFreePrnDlgListBox( ListBox* pBox, sal_Bool bClear )
{
if ( bClear )
pBox->Clear();
@@ -145,7 +145,7 @@ static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr )
// -----------------------------------------------------------------------
-static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId )
+static void ImplPrnDlgAddResString( XubString& rStr, sal_uInt16 nResId )
{
SvtResId aResId( nResId );
XubString aAddStr( aResId );
@@ -157,7 +157,7 @@ static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId )
XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo )
{
XubString aStr;
- ULONG nStatus = rInfo.GetStatus();
+ sal_uLong nStatus = rInfo.GetStatus();
// Default-Printer
if ( rInfo.GetPrinterName().Len() &&
@@ -217,7 +217,7 @@ XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo )
ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_POWER_SAVE );
// Anzahl Jobs
- ULONG nJobs = rInfo.GetJobs();
+ sal_uLong nJobs = rInfo.GetJobs();
if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) )
{
XubString aJobStr( SvtResId( STR_SVT_PRNDLG_JOBCOUNT ) );
@@ -269,7 +269,7 @@ PrinterSetupDialog::PrinterSetupDialog( Window* pWindow ) :
PrinterSetupDialog::~PrinterSetupDialog()
{
- ImplFreePrnDlgListBox( &maLbName, FALSE );
+ ImplFreePrnDlgListBox( &maLbName, sal_False );
delete mpTempPrinter;
}
@@ -374,7 +374,7 @@ short PrinterSetupDialog::Execute()
if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
{
DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
- return FALSE;
+ return sal_False;
}
Printer::updatePrinters();
@@ -387,7 +387,7 @@ short PrinterSetupDialog::Execute()
short nRet = ModalDialog::Execute();
// Wenn Dialog mit OK beendet wurde, dann die Daten updaten
- if ( nRet == TRUE )
+ if ( nRet == sal_True )
{
if ( mpTempPrinter )
mpPrinter->SetPrinterProps( mpTempPrinter );
diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src
index 8bb866c4e40e..b0ef9638d974 100644
--- a/svtools/source/dialogs/prnsetup.src
+++ b/svtools/source/dialogs/prnsetup.src
@@ -138,6 +138,7 @@ String STR_SVT_PRNDLG_JOBCOUNT
ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
{
+ HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRNSETUPDLG";
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
@@ -157,6 +158,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
ListBox LB_NAMES
{
+ HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRNSETUPDLG:LB_NAMES";
Border = TRUE ;
Pos = MAP_APPFONT ( 60 , 12 ) ;
Size = MAP_APPFONT ( 125 , 80 ) ;
@@ -165,6 +167,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_PROPERTIES
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_PROPERTIES";
Pos = MAP_APPFONT ( 188 , 12 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Propert~ies..." ;
@@ -220,6 +223,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
};
PushButton BTN_OPTIONS
{
+ HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_OPTIONS";
Pos = MAP_APPFONT ( 5 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Options..." ;
diff --git a/svtools/source/dialogs/propctrl.cxx b/svtools/source/dialogs/propctrl.cxx
deleted file mode 100644
index d24e7226d2bf..000000000000
--- a/svtools/source/dialogs/propctrl.cxx
+++ /dev/null
@@ -1,499 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-
-#include <usr/inspect.hxx>
-#include <usr/serinfo.hxx>
-#include <usr/introsp.hxx>
-
-#include <propctrl.hxx>
-#include <property.hxx>
-
-
-// Controller-Implementation
-class PropertyEditorControler_Impl : public SvPropertyDataControl
-{
- XIntrospectionAccessRef mxUnoAccess;
- PropertySequence mPropSeq;
- XPropertyEditorRef mxEditor;
- SvPropertyBox* mpPropBox;
- UsrAny maUnoObj;
-
-public:
- // Provisorisch direkt Window mitgeben
- PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ );
- //SimplePropertyEditor_Impl( void );
-
- // Objekt zum Editieren setzen, dies loest das Eintragen
- // der Properties in die PropertyBox aus
- void setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
- /* HACK fuer History-Interface*/String aPath, BOOL bBack=FALSE, BOOL bForward=FALSE );
-
- /* SPAETER
- SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
-
- // Methoden von XInterface
- XInterface * queryInterface( Uik aUik );
- XIdlClassRef getIdlClass();
- */
-
- // Methoden von SvPropertyDataControl
- virtual void Modified( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Clicked( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Commit( const String& aName,
- const String& aVal,
- void* pData);
-
- virtual void Select( const String& aName,
- void* pData);
-
- virtual void LinkClicked(const String& aName,
- void* pData);
-
- // TODO: Das muss raus, sehr unglueckliche Schnittstelle
- // PropertyBox erzwingt Zustand des Controllers
- virtual String GetTheCorrectProperty() const;
-};
-
-// Methoden von XPropertyEditor
-PropertyEditorControler_Impl::PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ )
-{
- mpPropBox = pPropBox_;
-}
-
-void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
- /* HACK fuer History-Interface*/ String aPath, BOOL bBack, BOOL bForward )
-{
- static XIntrospectionRef xIntrospection;
-
- // Ohne Fenster laeuft gar nix
- if( !mpPropBox )
- return;
-
- // Fenster aufraeumen
- mpPropBox->ClearAll();
-
- // Editor und Objekt bernehmen
- mxEditor = xEditor_;
- maUnoObj = aToEditObj;
-
- if( !xIntrospection.is() )
- {
- // Introspection-Service holen
- XServiceManagerRef xServiceManager = getGlobalServiceManager();
- XServiceProviderRef xProv = xServiceManager->getServiceProvider
- ( "com.sun.star.beans.Introspection", UikSequence(), UikSequence() );
- xIntrospection = (XIntrospection *)xProv->newInstance()
- ->queryInterface( XIntrospection::getSmartUik() );
- }
- if( !xIntrospection.is() )
- return;
-
- // und unspecten
- mxUnoAccess = xIntrospection->inspect( maUnoObj );
- if( !mxUnoAccess.Is() )
- return;
-
- // Uns als Controler anmelden
- mpPropBox->SetController( this );
-
- // Properties anlegen
- mPropSeq = mxUnoAccess->getProperties();
- UINT32 nPropCount = mPropSeq.getLen();
- const Property* pProps = mPropSeq.getConstArray();
-
- // 1. Seite anlegen
- USHORT nPropPageId = mpPropBox->AppendPage("Properties");
-
- // Beim Eintragen solls nicht flimmern
- mpPropBox->DisableUpdate();
-
- // Dummy-Properties fuer Path und Navigation
- SvPropertyData aProperty;
- if( aPath.Len() )
- {
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = FALSE;
- aProperty.bIsLocked = TRUE;
- aProperty.bHasVisibleXButton = FALSE;
- aProperty.eKind = KOC_EDIT;
- aProperty.pControl = NULL;
- aProperty.pDataPtr = NULL;
- aProperty.aName = "Path";
- aProperty.aValue = aPath;
- mpPropBox->InsertEntry( aProperty );
- }
- if( bBack || bForward )
- {
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = TRUE;
- aProperty.bIsLocked = TRUE;
- // HACK, solange Hyperlink nicht funktioniert
- aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
- aProperty.eKind = KOC_EDIT;
- UINT32 iHandle;
- aProperty.pControl = NULL;
- if( bBack )
- {
- iHandle = 1000001;
- aProperty.pDataPtr = (void*)iHandle;
- aProperty.aName = "<-";
- aProperty.aValue = "Back";
- mpPropBox->InsertEntry( aProperty );
- }
- if( bForward )
- {
- iHandle = 1000000;
- aProperty.pDataPtr = (void*)iHandle;
- aProperty.aName = "->";
- aProperty.aValue = "Forward";
- mpPropBox->InsertEntry( aProperty );
- }
- }
-
- // Properties eintragen
- // TODO: Wo kommen die Strings her
- UINT32 i;
- for( i = 0 ; i < nPropCount ; i++ )
- {
- const Property& rProp = pProps[ i ];
-
- // TypeClass des Property ermitteln
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
-
- // Interface und Structs werden Hyperlinks
- aProperty.bIsHyperLink = ( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT );
- aProperty.bIsLocked = ((rProp.Attributes & PROPERTY_READONLY) != 0 );
-
- // HACK, solange Hyperlink nicht funktioniert
- aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
-
- // Wert holen und in String wandeln
- UsrAny aVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, i );
- String aStrVal = AnyToString( aVal );
-
- // Properties reinbraten
- aProperty.eKind = KOC_EDIT;
- aProperty.aName = rProp.Name;
- aProperty.aValue = aStrVal;
- aProperty.pDataPtr = (void*)i;
- aProperty.pControl = NULL;
- //aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("2"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count());
- //aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count());
- mpPropBox->InsertEntry( aProperty );
- }
-
- // 2. Seite fuer Listener
- // TODO: Wo kommen die Eintraege her
- USHORT nListenerPageId = mpPropBox->AppendPage("Listener");
-
- XIdlClassSequence aSupportedListenerSeq = mxUnoAccess->getSupportedListeners();
- const XIdlClassRef* pListenerArray = aSupportedListenerSeq.getConstArray();
- UINT32 nIfaceCount = aSupportedListenerSeq.getLen();
-
- // Property-Data vorfuellen
- aProperty.eKind = KOC_EDIT;
- //aProperty.eKind = KOC_UNDEFINED;
- aProperty.aValue = "Listener-Value";
- aProperty.bHasVisibleXButton = TRUE;
- // TEST
- //aProperty.bIsHyperLink = TRUE;
- aProperty.bIsHyperLink = FALSE;
- aProperty.bIsLocked = TRUE;
- //aProperty.bIsLocked = FALSE;
- aProperty.pDataPtr = NULL;
- aProperty.pControl = NULL;
-
- for( UINT32 j = 0 ; j < nIfaceCount ; j++ )
- {
- const XIdlClassRef& rxIfaceClass = pListenerArray[j];
- aProperty.aName = rxIfaceClass->getName();
- mpPropBox->InsertEntry( aProperty );
- }
- mpPropBox->EnableUpdate();
- mpPropBox->SetPage( nPropPageId );
-}
-
-void PropertyEditorControler_Impl::Modified
-( const String& aName, const String& aVal, void* pData)
-{
-}
-
-void PropertyEditorControler_Impl::Clicked
-( const String& aName, const String& aVal, void* pData)
-{
- // HACK, solange LinkClicked nicht funktioniert
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- {
- // Spezial-IDs fuer forward/back?
- BOOL bForward = (iPos == 1000000);
- BOOL bBack = (iPos == 1000001);
- if( bForward || bBack )
- {
- // Unterstuetzt der PropertyEditor das?
- XPropertyEditorNavigationRef xPropEdNav = (XPropertyEditorNavigation*)
- mxEditor->queryInterface( XPropertyEditorNavigation::getSmartUik() );
- if( xPropEdNav.is() )
- {
- if( bForward )
- xPropEdNav->forward();
- else
- xPropEdNav->back();
- }
- }
- return;
- }
-
- const Property* pProps = mPropSeq.getConstArray();
- const Property& rProp = pProps[ iPos ];
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
- if( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT )
- LinkClicked( aName, pData );
-}
-
-void PropertyEditorControler_Impl::Commit
-( const String& aName, const String& aVal, void* pData)
-{
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- return;
-
- // String in Property-Typ wandeln
- const Property* pProps = mPropSeq.getConstArray();
- const Property& rProp = pProps[ iPos ];
- XIdlClassRef xPropClass = rProp.Type;
- if( !xPropClass.is() )
- {
- OSL_FAIL( "PropertyEditorControler_Impl::Commit(), Property without type" )
- return;
- }
- TypeClass eType = xPropClass->getTypeClass();
- UsrAny aValue = StringToAny( aVal, eType );
-
- // Wert setzen
- mxUnoAccess->setPropertyValueByIndex( maUnoObj, iPos, aValue );
-
- // Wert neu holen und ggf. neu setzen
- UsrAny aNewVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
- String aNewStrVal = AnyToString( aNewVal );
- if( aNewStrVal != aVal )
- mpPropBox->SetPropertyValue( aName, aNewStrVal );
-}
-
-void PropertyEditorControler_Impl::Select
-( const String& aName, void* pData)
-{
-}
-
-void PropertyEditorControler_Impl::LinkClicked(const String& aName, void* pData)
-{
- UINT32 iPos = (UINT32)pData;
- UINT32 nPropCount = mPropSeq.getLen();
- if( iPos >= nPropCount )
- return;
-
- // Wert holen und an Master-Controller zurueckgeben
- UsrAny aNewObj = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
- mxEditor->setObject( aNewObj, aName );
-}
-
-
-// TODO: Das muss raus, sehr unglueckliche Schnittstelle
-// PropertyBox erzwingt Zustand des Controllers
-String PropertyEditorControler_Impl::GetTheCorrectProperty() const
-{
- return String();
-}
-
-
-SMART_UNO_IMPLEMENTATION(SimplePropertyEditor_Impl,UsrObject);
-
-// Methoden von XInterface
-XInterface * SimplePropertyEditor_Impl::queryInterface( Uik aUik )
-{
- if( aUik == XPropertyEditor::getSmartUik() )
- return (XPropertyEditor *)this;
- if( aUik == XPropertyEditorNavigation::getSmartUik() )
- return (XPropertyEditorNavigation *)this;
- return UsrObject::queryInterface( aUik );
-}
-
-XIdlClassRef SimplePropertyEditor_Impl::getIdlClass()
-{
- // TODO: Unterstuetzen
- return NULL;
-}
-
-
-// Methoden von SimplePropertyEditor_Impl
-SimplePropertyEditor_Impl::SimplePropertyEditor_Impl( Window *pParent )
- : maHistorySeq( 10 ), maHistoryNames( 10 ), bSimpleHistory( FALSE )
-{
- //XVCLComponent xC = pParent->getVCLComponent
- //xC->addVCLComponentListener( MyListener )
-
- pActiveControler = NULL;
- mpPropBox = new SvPropertyBox( pParent );
- mpPropBox->Show();
-
- long cxOut = pParent->GetOutputSizePixel().Width();
- long cyOut = pParent->GetOutputSizePixel().Height();
- Size aSize( cxOut, cyOut );
- mpPropBox->SetPosSizePixel( Point( 0, 0 ), aSize );
-
- mnHistoryCount = 0;
- mnActualHistoryLevel = -1;
-}
-
-SimplePropertyEditor_Impl::~SimplePropertyEditor_Impl()
-{
- delete mpPropBox;
- if( pActiveControler )
- delete pActiveControler;
-}
-
-// Private Methode zum Anlegen/Aktivieren der Controller
-void SimplePropertyEditor_Impl::showObject( const UsrAny& aToShowObj )
-{
- if( pActiveControler )
- delete pActiveControler;
-
- // Neuen Controller auf der Wiese anlegen (TODO: Controller cachen?)
- pActiveControler = new PropertyEditorControler_Impl( mpPropBox );
-
- XPropertyEditorRef xThis = (XPropertyEditor *)this;
- pActiveControler->setObject( xThis, aToShowObj,
- /*aPath*/bSimpleHistory ? getPath() : String(),
- /*bBack*/bSimpleHistory && mnActualHistoryLevel > 0,
- /*bForward*/bSimpleHistory && (INT32)mnHistoryCount > mnActualHistoryLevel );
-}
-
-String SimplePropertyEditor_Impl::getPath( void )
-{
- String aRetStr;
- const String* pStr = maHistoryNames.getConstArray();
- for( INT32 i = 0 ; i <= mnActualHistoryLevel ; i++ )
- {
- String aName = pStr[i];
-
- // Root speziell behandeln
- if( i == 0 )
- {
- aRetStr += aName;
- }
- else
- {
- // Ist es ein Index?
- long l = (long)aName;
- String aNumStr( l );
- if( aNumStr == aName )
- {
- aRetStr += '[';
- aRetStr += aName;
- aRetStr += ']';
- }
- else
- {
- aRetStr += '.';
- aRetStr += aName;
- }
- }
- }
- return aRetStr;
-}
-
-// Methoden von XPropertyEditor
-void SimplePropertyEditor_Impl::setObject( const UsrAny& aToEditObj, const XubString& aObjName )
-{
- // History pflegen
- mnActualHistoryLevel++;
- mnHistoryCount = (UINT32)mnActualHistoryLevel;
- UINT32 iHistorySize = maHistorySeq.getLen();
- if( mnHistoryCount > iHistorySize )
- {
- maHistorySeq.realloc( iHistorySize + 10 );
- maHistoryNames.realloc( iHistorySize + 10 );
- }
-
- // Neues Object eintragen
- maHistorySeq.getArray()[ mnHistoryCount ] = aToEditObj;
- maHistoryNames.getArray()[ mnHistoryCount ] = aObjName;
-
- // Object anzeigen
- showObject( aToEditObj );
-}
-
-// Methoden von PropertyEditorNavigation
-void SimplePropertyEditor_Impl::forward(void)
-{
- if( (INT32)mnHistoryCount > mnActualHistoryLevel )
- {
- // Naechstes Object darstellen
- mnActualHistoryLevel++;
- showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
- }
-}
-
-void SimplePropertyEditor_Impl::back(void)
-{
- if( mnActualHistoryLevel > 0 )
- {
- // Voriges Object darstellen
- mnActualHistoryLevel--;
- showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
- }
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/propctrl.hxx b/svtools/source/dialogs/propctrl.hxx
deleted file mode 100644
index bc93914af014..000000000000
--- a/svtools/source/dialogs/propctrl.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/*
-#include <tools/stream.hxx>
-#include <vcl/sound.hxx>
-#include "sbx.hxx"
-#include "sbxbase.hxx"
-#include "sbxres.hxx"
-#include <svl/brdcst.hxx>
- */
-
-
-#include <proped.hxx>
-#include <usr/uno.hxx>
-#include <usr/sequ.hxx>
-#include <usr/toolsidl.hxx>
-
-/*
-class XPropertyEditor
- : public XInterface
-{
-public:
-
- virtual void setObject(const UsrAny& aToInspectObj) = 0;
-
- static Uik getSmartUik() { return(385); }
-};
-*/
-
-class PropertyEditorControler_Impl;
-class SvPropertyBox;
-class Window;
-
-class SimplePropertyEditor_Impl :
- public XPropertyEditor,
- public XPropertyEditorNavigation,
- public UsrObject
-{
- PropertyEditorControler_Impl* pActiveControler;
- SvPropertyBox* mpPropBox;
- UsrAny maStartUnoObj;
- UsrAny maActiveUnoObj;
-
- // History der Objekte speichern
- AnySequence maHistorySeq;
- WSStringSequence maHistoryNames;
- UINT32 mnHistoryCount;
- INT32 mnActualHistoryLevel;
-
- // Einfache History via Dummy-Properties
- BOOL bSimpleHistory;
-
- // Methode zum Anlegen/Aktivieren der Controller
- void showObject( const UsrAny& aToShowObj );
- String getPath( void );
-
-public:
- // Provisorischer Ctor mit Parent-Window
- SimplePropertyEditor_Impl( Window *pParent );
- ~SimplePropertyEditor_Impl();
-
- // HACK fuer History-Test
- void enableSimpleHistory( BOOL bHistory_ ) { bSimpleHistory = bHistory_; }
-
- SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
-
- // Methoden von XInterface
- XInterface * queryInterface( Uik aUik );
- XIdlClassRef getIdlClass();
-
- // Methoden von XPropertyEditor
- virtual void setObject(const UsrAny& aToInspectObj, const XubString& aObjName);
-
- // Methoden von PropertyEditorNavigation
- virtual void forward(void);
- virtual void back(void);
-
-};
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/dialogs/property.cxx b/svtools/source/dialogs/property.cxx
index 61ce869cacec..7bc07c88a6e6 100644
--- a/svtools/source/dialogs/property.cxx
+++ b/svtools/source/dialogs/property.cxx
@@ -98,7 +98,7 @@ void SvXPropertyEdit::SetCtrSize(const Size& rSize)
aEdit.SetSizePixel(aSize);
}
-void SvXPropertyEdit::SetLocked(BOOL bLocked)
+void SvXPropertyEdit::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -116,9 +116,9 @@ String SvXPropertyEdit::GetProperty() const
return aEdit.GetText();
}
-BOOL SvXPropertyEdit::HasList()
+sal_Bool SvXPropertyEdit::HasList()
{
- return FALSE;
+ return sal_False;
};
@@ -126,7 +126,7 @@ void SvXPropertyEdit::ClearList()
{
return;
}
-void SvXPropertyEdit::InsertEntry( const String&,USHORT )
+void SvXPropertyEdit::InsertEntry( const String&,sal_uInt16 )
{
return;
}
@@ -226,7 +226,7 @@ void SvXPropertyListBox::SetCtrSize(const Size& rSize)
aListBox.SetSizePixel(aSize);
}
-void SvXPropertyListBox::SetLocked(BOOL bLocked)
+void SvXPropertyListBox::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -244,9 +244,9 @@ String SvXPropertyListBox::GetProperty()const
return aListBox.GetSelectEntry();
}
-BOOL SvXPropertyListBox::HasList()
+sal_Bool SvXPropertyListBox::HasList()
{
- return TRUE;
+ return sal_True;
}
@@ -255,7 +255,7 @@ void SvXPropertyListBox::ClearList()
aListBox.Clear();
}
-void SvXPropertyListBox::InsertEntry( const String& rString,USHORT nPos)
+void SvXPropertyListBox::InsertEntry( const String& rString,sal_uInt16 nPos)
{
aListBox.InsertEntry(rString,nPos);
}
@@ -335,7 +335,7 @@ SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId)
aComboBox.Show();
}
-void SvXPropertyComboBox::SetLocked(BOOL bLocked)
+void SvXPropertyComboBox::SetLocked(sal_Bool bLocked)
{
if(bLocked)
Disable();
@@ -374,9 +374,9 @@ String SvXPropertyComboBox::GetProperty() const
return aComboBox.GetText();
}
-BOOL SvXPropertyComboBox::HasList()
+sal_Bool SvXPropertyComboBox::HasList()
{
- return TRUE;
+ return sal_True;
}
void SvXPropertyComboBox::ClearList()
@@ -384,7 +384,7 @@ void SvXPropertyComboBox::ClearList()
aComboBox.Clear();
}
-void SvXPropertyComboBox::InsertEntry( const String& rString,USHORT nPos)
+void SvXPropertyComboBox::InsertEntry( const String& rString,sal_uInt16 nPos)
{
aComboBox.InsertEntry(rString,nPos);
}
@@ -436,11 +436,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle)
aName(this,WB_BORDER),
pSvXPropertyControl(NULL),
aXButton(this,WB_BORDER),
- bIsLocked(FALSE),
- bIsHyperlink(FALSE)
+ bIsLocked(sal_False),
+ bIsHyperlink(sal_False)
{
- bNeedsRepaint = TRUE;
- bHasXButton = FALSE;
+ bNeedsRepaint = sal_True;
+ bHasXButton = sal_False;
aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
aName.Show();
aXButton.Show();
@@ -455,11 +455,11 @@ SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId )
aName (this,WB_BORDER),
pSvXPropertyControl(NULL),
aXButton (this,WB_BORDER),
- bIsLocked(FALSE),
- bIsHyperlink(FALSE)
+ bIsLocked(sal_False),
+ bIsHyperlink(sal_False)
{
- bNeedsRepaint = TRUE;
- bHasXButton = FALSE;
+ bNeedsRepaint = sal_True;
+ bHasXButton = sal_False;
eKindOfCtr = KOC_UNDEFINED;
aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
aName.Show();
@@ -494,11 +494,11 @@ void SvPropertyLine::Resize()
aName.SetPosPixel(aPos);
aName.SetSizePixel(aSize);
- USHORT nXButtonWidth=0;
+ sal_uInt16 nXButtonWidth=0;
if(bHasXButton)
{
- nXButtonWidth=(USHORT)aSize.Height();
+ nXButtonWidth=(sal_uInt16)aSize.Height();
}
a2Size.Width()=a2Size.Width()-nXButtonWidth;
@@ -520,12 +520,12 @@ void SvPropertyLine::Resize()
}
}
-void SvPropertyLine::SetNeedsRepaint(BOOL bFlag)
+void SvPropertyLine::SetNeedsRepaint(sal_Bool bFlag)
{
bNeedsRepaint=bFlag;
}
-BOOL SvPropertyLine::NeedsRepaint()
+sal_Bool SvPropertyLine::NeedsRepaint()
{
return bNeedsRepaint;
}
@@ -553,22 +553,22 @@ eKindOfControl SvPropertyLine::GetKindOfControl()
void SvPropertyLine::ShowXButton()
{
- bHasXButton=TRUE;
+ bHasXButton=sal_True;
aXButton.Show();
Resize();
}
void SvPropertyLine::HideXButton()
{
- bHasXButton=FALSE;
+ bHasXButton=sal_False;
aXButton.Hide();
Resize();
}
-BOOL SvPropertyLine::IsVisibleXButton()
+sal_Bool SvPropertyLine::IsVisibleXButton()
{
return bHasXButton;
}
-void SvPropertyLine::ShowAsHyperLink(BOOL nFlag)
+void SvPropertyLine::ShowAsHyperLink(sal_Bool nFlag)
{
bIsHyperlink=nFlag;
if(nFlag)
@@ -585,24 +585,24 @@ void SvPropertyLine::ShowAsHyperLink(BOOL nFlag)
}
}
-BOOL SvPropertyLine::IsShownAsHyperlink()
+sal_Bool SvPropertyLine::IsShownAsHyperlink()
{
return bIsHyperlink;
}
-void SvPropertyLine::Locked(BOOL nFlag)
+void SvPropertyLine::Locked(sal_Bool nFlag)
{
bIsLocked=nFlag;
if(pSvXPropertyControl!=NULL)
pSvXPropertyControl->SetLocked(nFlag);
}
-BOOL SvPropertyLine::IsLineLocked()
+sal_Bool SvPropertyLine::IsLineLocked()
{
return bIsLocked;
}
-void SvPropertyLine::SetNameWidth(USHORT nWidth)
+void SvPropertyLine::SetNameWidth(sal_uInt16 nWidth)
{
nNameWidth=nWidth;
Resize();
@@ -677,7 +677,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinSty
nTheNameSize=0;
ListBox aListBox(this,WB_DROPDOWN);
aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
Wallpaper aWall = aPlayGround.GetBackground();
aWall.SetColor( Color( COL_TRANSPARENT ) );
aPlayGround.SetBackground( aWall );
@@ -699,7 +699,7 @@ SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rR
nYOffset=0;
ListBox aListBox(this,WB_DROPDOWN);
aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ nRowHeight=(sal_uInt16)aListBox.GetSizePixel().Height();
Wallpaper aWall = aPlayGround.GetBackground();
aWall.SetColor( Color( COL_TRANSPARENT ) );
aPlayGround.SetBackground( aWall );
@@ -717,7 +717,7 @@ SvListBoxForProperties::~SvListBoxForProperties()
void SvListBoxForProperties::Clear()
{
- for(USHORT i=0;i<PLineArray.Count();i++)
+ for(sal_uInt16 i=0;i<PLineArray.Count();i++)
{
SvPropertyLine* pPropLine=PLineArray[i];
@@ -763,19 +763,19 @@ void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC)
pPropDataControl=pPDC;
}
-USHORT SvListBoxForProperties::CalcVisibleLines()
+sal_uInt16 SvListBoxForProperties::CalcVisibleLines()
{
Size aSize=aPlayGround.GetOutputSizePixel();
- USHORT nResult=0;
+ sal_uInt16 nResult=0;
if(nRowHeight!=0)
- nResult=(USHORT) aSize.Height()/nRowHeight;
+ nResult=(sal_uInt16) aSize.Height()/nRowHeight;
return nResult;
}
void SvListBoxForProperties::UpdateVScroll()
{
- USHORT nLines=CalcVisibleLines();
+ sal_uInt16 nLines=CalcVisibleLines();
aVScroll.SetPageSize(nLines-1);
aVScroll.SetVisibleSize(nLines-1);
aVScroll.SetRange(Range(0,PLineArray.Count()-1));
@@ -785,7 +785,7 @@ void SvListBoxForProperties::UpdateVScroll()
}
else
{
- BOOL bFlag=aVScroll.IsVisible();
+ sal_Bool bFlag=aVScroll.IsVisible();
aVScroll.Show();
if(!bFlag)Resize();
}
@@ -797,7 +797,7 @@ void SvListBoxForProperties::UpdatePosNSize()
{
Point aPos(0,nYOffset);
- for(USHORT i=0; i<PLineArray.Count();i++)
+ for(sal_uInt16 i=0; i<PLineArray.Count();i++)
{
if((PLineArray[i])->NeedsRepaint())
{
@@ -809,7 +809,7 @@ void SvListBoxForProperties::UpdatePosNSize()
(PLineArray[i])->Invalidate();
(PLineArray[i])->Update();
(PLineArray[i])->Show();
- (PLineArray[i])->SetNeedsRepaint(FALSE);
+ (PLineArray[i])->SetNeedsRepaint(sal_False);
}
else
{
@@ -836,21 +836,21 @@ void SvListBoxForProperties::UpdatePlayGround()
long nLines=aVScroll.GetPageSize();
long nDelta=aVScroll.GetDelta();
- USHORT nStart,nEnd;
+ sal_uInt16 nStart,nEnd;
Size aSize=aPlayGround.GetOutputSizePixel();
Point aPEnd;
aPEnd.X()=aSize.Width();
if(nDelta>0)
{
- nStart=(USHORT)(nThumbPos+nLines+1-nDelta);
- nEnd=(USHORT)(nThumbPos+nLines);
+ nStart=(sal_uInt16)(nThumbPos+nLines+1-nDelta);
+ nEnd=(sal_uInt16)(nThumbPos+nLines);
aPos.Y()=(nLines+1-nDelta)*nRowHeight;
}
else
{
- nStart=(USHORT)nThumbPos;
- nEnd=(USHORT)(nThumbPos-nDelta);
+ nStart=(sal_uInt16)nThumbPos;
+ nEnd=(sal_uInt16)(nThumbPos-nDelta);
aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;;
}
@@ -860,7 +860,7 @@ void SvListBoxForProperties::UpdatePlayGround()
aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN);
- for(USHORT i=nStart; i<=nEnd;i++)
+ for(sal_uInt16 i=nStart; i<=nEnd;i++)
{
(PLineArray[i])->SetPosSizePixel(aPos,aSize);
(PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
@@ -879,18 +879,18 @@ void SvListBoxForProperties::UpdateAll()
void SvListBoxForProperties::DisableUpdate()
{
- bUpdate=FALSE;
+ bUpdate=sal_False;
}
void SvListBoxForProperties::EnableUpdate()
{
- bUpdate=TRUE;
+ bUpdate=sal_True;
UpdateAll();
}
void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue )
{
- USHORT i, iEnd = PLineArray.Count();
+ sal_uInt16 i, iEnd = PLineArray.Count();
for( i = 0 ; i < iEnd ; i++ )
{
SvPropertyLine* pPropLine = PLineArray[ i ];
@@ -902,14 +902,14 @@ void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const
}
}
-USHORT SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
+sal_uInt16 SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
{
return InsertEntry(aPropData);
}
-USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USHORT nPos)
+sal_uInt16 SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
{
- USHORT nInsPos=nPos;
+ sal_uInt16 nInsPos=nPos;
SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL);
if(nPos==LISTBOX_APPEND)
@@ -928,7 +928,7 @@ USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USH
return nInsPos;
}
-void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHORT nPos)
+void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, sal_uInt16 nPos)
{
if(nPos<PLineArray.Count())
{
@@ -983,7 +983,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
if(pSvXPCtr->HasList())
{
- for(USHORT i=0;i<aPropData.theValues.Count();i++)
+ for(sal_uInt16 i=0;i<aPropData.theValues.Count();i++)
{
pSvXPCtr->InsertEntry(*(aPropData.theValues[i]));
}
@@ -992,7 +992,7 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
pPropLine->SetName(aPropData.aName);
- USHORT nTextWidth=(USHORT)aPlayGround.GetTextWidth(aPropData.aName);
+ sal_uInt16 nTextWidth=(sal_uInt16)aPlayGround.GetTextWidth(aPropData.aName);
if ( nTheNameSize < nTextWidth )
nTheNameSize = nTextWidth;
@@ -1012,21 +1012,21 @@ void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHOR
}
}
-USHORT SvListBoxForProperties::GetFirstVisibleEntry()
+sal_uInt16 SvListBoxForProperties::GetFirstVisibleEntry()
{
return 0;
}
-void SvListBoxForProperties::SetFirstVisibleEntry(USHORT)
+void SvListBoxForProperties::SetFirstVisibleEntry(sal_uInt16)
{
return;
}
-void SvListBoxForProperties::SetSelectedEntry(USHORT)
+void SvListBoxForProperties::SetSelectedEntry(sal_uInt16)
{
return;
}
-USHORT SvListBoxForProperties::GetSelectedEntry()
+sal_uInt16 SvListBoxForProperties::GetSelectedEntry()
{
return 0;
}
@@ -1037,7 +1037,7 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
{
long nDelta=aVScroll.GetDelta();
nYOffset=-aVScroll.GetThumbPos()*nRowHeight;
- //aPlayGround.SetUpdateMode(FALSE);
+ //aPlayGround.SetUpdateMode(sal_False);
long nThumbPos=aVScroll.GetThumbPos();
long nLines=aVScroll.GetPageSize();
@@ -1048,14 +1048,14 @@ IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
{
if(i>=nThumbPos && i<=nThumbPos+nLines)
{
- (PLineArray[sal::static_int_cast< USHORT >(i)])->
- SetNeedsRepaint(TRUE);
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
+ SetNeedsRepaint(sal_True);
}
else
{
- (PLineArray[sal::static_int_cast< USHORT >(i)])->Hide();
- (PLineArray[sal::static_int_cast< USHORT >(i)])->
- SetNeedsRepaint(FALSE);
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->Hide();
+ (PLineArray[sal::static_int_cast< sal_uInt16 >(i)])->
+ SetNeedsRepaint(sal_False);
}
}
}
@@ -1176,9 +1176,9 @@ SvPropertyBox::~SvPropertyBox()
void SvPropertyBox::ClearAll()
{
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
- for(USHORT i=nCount;i>=1;i--)
+ for(sal_uInt16 i=nCount;i>=1;i--)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1197,10 +1197,10 @@ void SvPropertyBox::Resize()
aTabControl.SetPosSizePixel(aPos,aSize);
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
aSize=aTabControl.GetTabPageSizePixel();
- for(USHORT i=1;i<=nCount;i++)
+ for(sal_uInt16 i=1;i<=nCount;i++)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1210,9 +1210,9 @@ void SvPropertyBox::Resize()
}
-USHORT SvPropertyBox::AppendPage( const String & rText )
+sal_uInt16 SvPropertyBox::AppendPage( const String & rText )
{
- USHORT nId=aTabControl.GetPageCount()+1;
+ sal_uInt16 nId=aTabControl.GetPageCount()+1;
aTabControl.InsertPage( nId,rText);
SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl);
pPage->SetSizePixel(aTabControl.GetTabPageSizePixel());
@@ -1222,17 +1222,17 @@ USHORT SvPropertyBox::AppendPage( const String & rText )
return nId;
}
-void SvPropertyBox::SetPage( USHORT nId)
+void SvPropertyBox::SetPage( sal_uInt16 nId)
{
aTabControl.SetCurPageId(nId);
}
-USHORT SvPropertyBox::GetCurPage()
+sal_uInt16 SvPropertyBox::GetCurPage()
{
return aTabControl.GetCurPageId();
}
-USHORT SvPropertyBox::CalcVisibleLines()
+sal_uInt16 SvPropertyBox::CalcVisibleLines()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1255,9 +1255,9 @@ void SvPropertyBox::DisableUpdate()
void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
{
pThePropDataCtr=pDataCtr;
- USHORT nCount=aTabControl.GetPageCount();
+ sal_uInt16 nCount=aTabControl.GetPageCount();
- for(USHORT i=1;i<=nCount;i++)
+ for(sal_uInt16 i=1;i<=nCount;i++)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(i);
@@ -1267,21 +1267,21 @@ void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
}
-USHORT SvPropertyBox::InsertEntry( const SvPropertyData& rData, USHORT nPos)
+sal_uInt16 SvPropertyBox::InsertEntry( const SvPropertyData& rData, sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
return pPage->GetTheListBox()->InsertEntry(rData,nPos);
}
-void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, USHORT nPos)
+void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->ChangeEntry(rData,nPos);
}
-USHORT SvPropertyBox::AppendEntry( const SvPropertyData& rData)
+sal_uInt16 SvPropertyBox::AppendEntry( const SvPropertyData& rData)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1295,26 +1295,26 @@ void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String &
pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue );
}
-void SvPropertyBox::SetFirstVisibleEntry(USHORT nPos)
+void SvPropertyBox::SetFirstVisibleEntry(sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->SetFirstVisibleEntry(nPos);
}
-USHORT SvPropertyBox::GetFirstVisibleEntry()
+sal_uInt16 SvPropertyBox::GetFirstVisibleEntry()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
return pPage->GetTheListBox()->GetFirstVisibleEntry();
}
-void SvPropertyBox::SetSelectedEntry(USHORT nPos)
+void SvPropertyBox::SetSelectedEntry(sal_uInt16 nPos)
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
pPage->GetTheListBox()->SetSelectedEntry(nPos);
}
-USHORT SvPropertyBox::GetSelectedEntry()
+sal_uInt16 SvPropertyBox::GetSelectedEntry()
{
SvTabPageForProperties* pPage=(SvTabPageForProperties*)
aTabControl.GetTabPage(aTabControl.GetCurPageId());
@@ -1401,7 +1401,7 @@ void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString)
aCorrectProperty=aString;
}
-void SvBasicPropertyDataControl::SetIsCorrect(BOOL nFlag)
+void SvBasicPropertyDataControl::SetIsCorrect(sal_Bool nFlag)
{
bCorrectness=nFlag;
}
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 056e16d07e7b..db6e4434c980 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -32,7 +32,7 @@
#include <svtools/roadmapwizard.hxx>
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
-#include "roadmap.hxx"
+#include <svtools/roadmap.hxx>
#include <tools/debug.hxx>
#include <stdarg.h>
@@ -240,15 +240,15 @@ namespace svt
}
//--------------------------------------------------------------------
- void RoadmapWizard::SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode )
+ void RoadmapWizard::SetRoadmapHelpId( const rtl::OString& _rId )
{
- m_pImpl->pRoadmap->SetSmartHelpId( _rId, _aMode );
+ m_pImpl->pRoadmap->SetHelpId( _rId );
}
//--------------------------------------------------------------------
- SmartId RoadmapWizard::GetRoadmapSmartHelpId() const
+ const rtl::OString& RoadmapWizard::GetRoadmapHelpId() const
{
- return m_pImpl->pRoadmap->GetSmartHelpId();
+ return m_pImpl->pRoadmap->GetHelpId();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/dialogs/so3res.src b/svtools/source/dialogs/so3res.src
index 5fb5ad49a076..3b2aab346584 100644
--- a/svtools/source/dialogs/so3res.src
+++ b/svtools/source/dialogs/so3res.src
@@ -25,10 +25,11 @@
*
************************************************************************/
-#include "sores.hxx"
+#include "svtools/sores.hxx"
#define __RSC
-#include "soerr.hxx"
+#include <svtools/soerr.hxx>
#define S_MAX 0x7fff
+
Resource RID_SO_ERROR_HANDLER
{
String ERRCODE_SO_GENERALERROR&S_MAX
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index d652a1a8a294..f4e024b65cc1 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -196,7 +196,7 @@ namespace svt
if (_nButtonFlags & WZB_PREVIOUS)
{
m_pPrevPage = new PushButton(this, WB_TABSTOP);
- m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) );
+ m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS)));
m_pPrevPage->Show();
@@ -213,7 +213,7 @@ namespace svt
if (_nButtonFlags & WZB_NEXT)
{
m_pNextPage = new PushButton(this, WB_TABSTOP);
- m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) );
+ m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT)));
m_pNextPage->Show();
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index de1e30d8f647..e7bb12989e4a 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -198,7 +198,7 @@ void WizardDialog::ImplPosCtrls()
long nViewWidth = 0;
long nViewHeight = 0;
long nDlgHeight = nOffY;
- USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS;
if ( meViewAlign == WINDOWALIGN_TOP )
{
nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
@@ -333,9 +333,9 @@ void WizardDialog::ImplShowTabPage( TabPage* pTabPage )
// -----------------------------------------------------------------------
-TabPage* WizardDialog::ImplGetPage( USHORT nLevel ) const
+TabPage* WizardDialog::ImplGetPage( sal_uInt16 nLevel ) const
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -442,7 +442,7 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( aKeyCode.IsMod1() )
{
@@ -453,11 +453,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
if ( mpPrevBtn->IsVisible() &&
mpPrevBtn->IsEnabled() && mpPrevBtn->IsInputEnabled() )
{
- mpPrevBtn->SetPressed( TRUE );
- mpPrevBtn->SetPressed( FALSE );
+ mpPrevBtn->SetPressed( sal_True );
+ mpPrevBtn->SetPressed( sal_False );
mpPrevBtn->Click();
}
- return TRUE;
+ return sal_True;
}
}
else
@@ -467,11 +467,11 @@ long WizardDialog::Notify( NotifyEvent& rNEvt )
if ( mpNextBtn->IsVisible() &&
mpNextBtn->IsEnabled() && mpNextBtn->IsInputEnabled() )
{
- mpNextBtn->SetPressed( TRUE );
- mpNextBtn->SetPressed( FALSE );
+ mpNextBtn->SetPressed( sal_True );
+ mpNextBtn->SetPressed( sal_False );
mpNextBtn->Click();
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -494,43 +494,43 @@ long WizardDialog::DeactivatePage()
if ( maDeactivateHdl.IsSet() )
return maDeactivateHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowNextPage()
+sal_Bool WizardDialog::ShowNextPage()
{
return ShowPage( mnCurLevel+1 );
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowPrevPage()
+sal_Bool WizardDialog::ShowPrevPage()
{
if ( !mnCurLevel )
- return FALSE;
+ return sal_False;
return ShowPage( mnCurLevel-1 );
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::ShowPage( USHORT nLevel )
+sal_Bool WizardDialog::ShowPage( sal_uInt16 nLevel )
{
if ( DeactivatePage() )
{
mnCurLevel = nLevel;
ActivatePage();
ImplShowTabPage( ImplGetPage( mnCurLevel ) );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL WizardDialog::Finnish( long nResult )
+sal_Bool WizardDialog::Finnish( long nResult )
{
if ( DeactivatePage() )
{
@@ -541,10 +541,10 @@ BOOL WizardDialog::Finnish( long nResult )
EndDialog( nResult );
else if ( GetStyle() & WB_CLOSEABLE )
Close();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -595,9 +595,9 @@ void WizardDialog::RemovePage( TabPage* pPage )
// -----------------------------------------------------------------------
-void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage )
+void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage )
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -618,9 +618,9 @@ void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage )
// -----------------------------------------------------------------------
-TabPage* WizardDialog::GetPage( USHORT nLevel ) const
+TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const
{
- USHORT nTempLevel = 0;
+ sal_uInt16 nTempLevel = 0;
ImplWizPageData* pPageData = mpFirstPage;
while ( pPageData )
{
@@ -681,7 +681,7 @@ void WizardDialog::RemoveButton( Button* pButton )
// -----------------------------------------------------------------------
-void WizardDialog::ShowButtonFixedLine( BOOL bVisible )
+void WizardDialog::ShowButtonFixedLine( sal_Bool bVisible )
{
if ( !mpFixedLine )
{
@@ -696,7 +696,7 @@ void WizardDialog::ShowButtonFixedLine( BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL WizardDialog::IsButtonFixedLineVisible()
+sal_Bool WizardDialog::IsButtonFixedLineVisible()
{
return (mpFixedLine && mpFixedLine->IsVisible());
}
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 14a737a99e60..bc81a96ea142 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -32,7 +32,7 @@
#include <svtools/svmedit.hxx>
#include <svtools/xtextedt.hxx>
#include <svtools/editsyntaxhighlighter.hxx>
-#include "../../inc/txtattr.hxx"
+#include <svtools/txtattr.hxx>
MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle,
@@ -69,12 +69,12 @@ void MultiLineEditSyntaxHighlight::SetText(const String& rNewText)
UpdateData();
}
-void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
+void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey)
{
TextSelection aCurrentPos = GetTextView()->GetSelection();
xub_StrLen aStartPos = aCurrentPos.GetStart().GetIndex();
- ULONG nStartPara = aCurrentPos.GetStart().GetPara();
- USHORT aCount = 0;
+ sal_uLong nStartPara = aCurrentPos.GetStart().GetPara();
+ sal_uInt16 aCount = 0;
int aChar = -1;
switch (aKey)
@@ -110,16 +110,16 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
continue;
String aLine( GetTextEngine()->GetText( aPara ) );
- for (USHORT i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (USHORT)(aLine.Len()-1); i>0; --i)
+ for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i)
{
if (aLine.GetChar(i)==aChar)
{
if (!aCount)
{
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, sal_True );
return;
}
else
@@ -185,19 +185,19 @@ void MultiLineEditSyntaxHighlight::UpdateData()
{
// syntax highlighting
// this must be possible improved by using notifychange correctly
- BOOL bTempModified = GetTextEngine()->IsModified();
+ sal_Bool bTempModified = GetTextEngine()->IsModified();
for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++)
{
String aLine( GetTextEngine()->GetText( nLine ) );
aHighlighter.notifyChange( nLine, 0, &aLine, 1 );
- GetTextEngine()->RemoveAttribs( nLine, TRUE );
+ GetTextEngine()->RemoveAttribs( nLine, sal_True );
HighlightPortions aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
- for ( USHORT i = 0; i < aPortions.Count(); i++ )
+ for ( size_t i = 0; i < aPortions.size(); i++ )
{
HighlightPortion& r = aPortions[i];
- GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True );
}
}
GetTextView()->ShowCursor( false, true );
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
deleted file mode 100644
index 9aacde1bfc73..000000000000
--- a/svtools/source/edit/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=edit
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/txtattr.obj \
- $(SLO)$/xtextedt.obj \
- $(SLO)$/editsyntaxhighlighter.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/editsyntaxhighlighter.obj \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/xtextedt.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
index 6fcc61dd467b..2e45ae38172b 100644
--- a/svtools/source/edit/svmedit.cxx
+++ b/svtools/source/edit/svmedit.cxx
@@ -66,11 +66,11 @@ private:
ExtTextEngine* mpExtTextEngine;
ExtTextView* mpExtTextView;
- BOOL mbInMBDown;
- BOOL mbFocusSelectionHide;
- BOOL mbIgnoreTab;
- BOOL mbActivePopup;
- BOOL mbSelectOnTab;
+ sal_Bool mbInMBDown;
+ sal_Bool mbFocusSelectionHide;
+ sal_Bool mbIgnoreTab;
+ sal_Bool mbActivePopup;
+ sal_Bool mbSelectOnTab;
public:
TextWindow( Window* pParent );
@@ -92,17 +92,17 @@ public:
virtual void GetFocus();
virtual void LoseFocus();
- BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; }
- void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
+ sal_Bool IsAutoFocusHide() const { return mbFocusSelectionHide; }
+ void SetAutoFocusHide( sal_Bool bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
- BOOL IsIgnoreTab() const { return mbIgnoreTab; }
- void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; }
+ sal_Bool IsIgnoreTab() const { return mbIgnoreTab; }
+ void SetIgnoreTab( sal_Bool bIgnore ) { mbIgnoreTab = bIgnore; }
void DisableSelectionOnFocus() {mbSelectOnTab = sal_False;}
virtual
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface(BOOL bCreate = TRUE);
+ GetComponentInterface(sal_Bool bCreate = sal_True);
};
@@ -132,17 +132,17 @@ public:
ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle );
~ImpSvMEdit();
- void SetModified( BOOL bMod );
- BOOL IsModified() const;
+ void SetModified( sal_Bool bMod );
+ sal_Bool IsModified() const;
- void SetReadOnly( BOOL bRdOnly );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bRdOnly );
+ sal_Bool IsReadOnly() const;
void SetMaxTextLen( xub_StrLen nLen );
xub_StrLen GetMaxTextLen() const;
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
void InsertText( const String& rStr );
String GetSelected() const;
@@ -164,13 +164,13 @@ public:
void Resize();
void GetFocus();
- BOOL HandleCommand( const CommandEvent& rCEvt );
+ sal_Bool HandleCommand( const CommandEvent& rCEvt );
- void Enable( BOOL bEnable );
+ void Enable( sal_Bool bEnable );
Size CalcMinimumSize() const;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
void SetAlign( WinBits nWinStyle );
@@ -198,27 +198,27 @@ ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle )
void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
{
- const BOOL bHaveVScroll = (NULL != mpVScrollBar);
- const BOOL bHaveHScroll = (NULL != mpHScrollBar);
- const BOOL bHaveScrollBox = (NULL != mpScrollBox);
+ const sal_Bool bHaveVScroll = (NULL != mpVScrollBar);
+ const sal_Bool bHaveHScroll = (NULL != mpHScrollBar);
+ const sal_Bool bHaveScrollBox = (NULL != mpScrollBox);
- BOOL bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
- const BOOL bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
+ sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
+ const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
- const BOOL bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
+ const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
if ( !bNeedVScroll && bAutoVScroll )
{
TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
- ULONG nOverallTextHeight(0);
- for ( ULONG i=0; i<rEngine.GetParagraphCount(); ++i )
+ sal_uLong nOverallTextHeight(0);
+ for ( sal_uLong i=0; i<rEngine.GetParagraphCount(); ++i )
nOverallTextHeight += rEngine.GetTextHeight( i );
- if ( nOverallTextHeight > (ULONG)mpTextWindow->GetOutputSizePixel().Height() )
+ if ( nOverallTextHeight > (sal_uLong)mpTextWindow->GetOutputSizePixel().Height() )
bNeedVScroll = true;
}
- const BOOL bNeedScrollBox = bNeedVScroll && bNeedHScroll;
+ const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll;
- BOOL bScrollbarsChanged = false;
+ sal_Bool bScrollbarsChanged = false;
if ( bHaveVScroll != bNeedVScroll )
{
delete mpVScrollBar;
@@ -269,22 +269,22 @@ void ImpSvMEdit::InitFromStyle( WinBits nWinStyle )
SetAlign( nWinStyle );
if ( nWinStyle & WB_NOHIDESELECTION )
- mpTextWindow->SetAutoFocusHide( FALSE );
+ mpTextWindow->SetAutoFocusHide( sal_False );
else
- mpTextWindow->SetAutoFocusHide( TRUE );
+ mpTextWindow->SetAutoFocusHide( sal_True );
if ( nWinStyle & WB_READONLY )
- mpTextWindow->GetTextView()->SetReadOnly( TRUE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_True );
else
- mpTextWindow->GetTextView()->SetReadOnly( FALSE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_False );
if ( nWinStyle & WB_IGNORETAB )
{
- mpTextWindow->SetIgnoreTab( TRUE );
+ mpTextWindow->SetIgnoreTab( sal_True );
}
else
{
- mpTextWindow->SetIgnoreTab( FALSE );
+ mpTextWindow->SetIgnoreTab( sal_False );
// #103667# MultiLineEdit has the flag, but focusable window also needs this flag
WinBits nStyle = mpTextWindow->GetStyle();
nStyle |= WINDOW_DLGCTRL_MOD1TAB;
@@ -305,14 +305,14 @@ void ImpSvMEdit::ImpSetScrollBarRanges()
{
if ( mpVScrollBar )
{
- ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
+ sal_uLong nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
mpVScrollBar->SetRange( Range( 0, (long)nTextHeight-1 ) );
}
if ( mpHScrollBar )
{
-// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+// sal_uLong nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
// Es gibt kein Notify bei Breiten-Aenderung...
-// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth );
+// sal_uLong nW = Max( (sal_uLong)mpTextWindow->GetOutputSizePixel().Width()*5, (sal_uLong)nTextWidth );
// mpHScrollBar->SetRange( Range( 0, (long)nW ) );
mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth-1 ) );
}
@@ -365,7 +365,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
- // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE );
+ // mpTextWindow->GetTextView()->ShowCursor( sal_False, sal_True );
return 0;
}
@@ -379,7 +379,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
void ImpSvMEdit::SetAlign( WinBits nWinStyle )
{
- BOOL bRTL = Application::GetSettings().GetLayoutRTL();
+ sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
mpTextWindow->GetTextEngine()->SetRightToLeft( bRTL );
if ( nWinStyle & WB_CENTER )
@@ -396,28 +396,28 @@ void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset )
Resize();
}
-void ImpSvMEdit::SetModified( BOOL bMod )
+void ImpSvMEdit::SetModified( sal_Bool bMod )
{
mpTextWindow->GetTextEngine()->SetModified( bMod );
}
-BOOL ImpSvMEdit::IsModified() const
+sal_Bool ImpSvMEdit::IsModified() const
{
return mpTextWindow->GetTextEngine()->IsModified();
}
-void ImpSvMEdit::SetInsertMode( BOOL bInsert )
+void ImpSvMEdit::SetInsertMode( sal_Bool bInsert )
{
mpTextWindow->GetTextView()->SetInsertMode( bInsert );
}
-void ImpSvMEdit::SetReadOnly( BOOL bRdOnly )
+void ImpSvMEdit::SetReadOnly( sal_Bool bRdOnly )
{
mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
// Farbe anpassen ???????????????????????????
}
-BOOL ImpSvMEdit::IsReadOnly() const
+sal_Bool ImpSvMEdit::IsReadOnly() const
{
return mpTextWindow->GetTextView()->IsReadOnly();
}
@@ -534,10 +534,10 @@ void ImpSvMEdit::Paste()
void ImpSvMEdit::SetText( const String& rStr )
{
- BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified();
+ sal_Bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
mpTextWindow->GetTextEngine()->SetText( rStr );
if ( !bWasModified )
- mpTextWindow->GetTextEngine()->SetModified( FALSE );
+ mpTextWindow->GetTextEngine()->SetModified( sal_False );
mpTextWindow->GetTextView()->SetSelection( TextSelection() );
@@ -594,7 +594,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( mpHScrollBar )
{
- ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+ sal_uLong nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
if ( nWidth != mnTextWidth )
{
mnTextWidth = sal::static_int_cast< xub_StrLen >(nWidth);
@@ -626,9 +626,9 @@ void ImpSvMEdit::SetSelection( const Selection& rSelection )
long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
- ULONG nPara = 0;
- USHORT nChar = 0;
- USHORT x = 0;
+ sal_uLong nPara = 0;
+ sal_uInt16 nChar = 0;
+ sal_uInt16 x = 0;
while ( x <= nEnd )
{
if ( x == aNewSelection.Min() )
@@ -657,7 +657,7 @@ const Selection& ImpSvMEdit::GetSelection() const
ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
// Absaetze davor:
- ULONG n;
+ sal_uLong n;
for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ )
{
maSelection.Min() += pExtTextEngine->GetTextLen( n );
@@ -692,7 +692,7 @@ Size ImpSvMEdit::CalcMinimumSize() const
return aSz;
}
-Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
static const sal_Unicode sampleText[] = { 'X', '\0' };
@@ -719,16 +719,16 @@ Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
static const sal_Unicode sampleText[] = { 'x', '\0' };
Size aOutSz = mpTextWindow->GetOutputSizePixel();
Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() );
- rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width());
- rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height());
+ rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width());
+ rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height());
}
-void ImpSvMEdit::Enable( BOOL bEnable )
+void ImpSvMEdit::Enable( sal_Bool bEnable )
{
mpTextWindow->Enable( bEnable );
if ( mpHScrollBar )
@@ -737,15 +737,15 @@ void ImpSvMEdit::Enable( BOOL bEnable )
mpVScrollBar->Enable( bEnable );
}
-BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
+sal_Bool ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
{
mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -753,12 +753,12 @@ BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
TextWindow::TextWindow( Window* pParent ) : Window( pParent )
{
- mbInMBDown = FALSE;
- mbSelectOnTab = TRUE;
- mbFocusSelectionHide = FALSE;
- mbIgnoreTab = FALSE;
- mbActivePopup = FALSE;
- mbSelectOnTab = TRUE;
+ mbInMBDown = sal_False;
+ mbSelectOnTab = sal_True;
+ mbFocusSelectionHide = sal_False;
+ mbIgnoreTab = sal_False;
+ mbActivePopup = sal_False;
+ mbSelectOnTab = sal_True;
SetPointer( Pointer( POINTER_TEXT ) );
@@ -769,7 +769,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent )
mpExtTextEngine->SetLocale( GetSettings().GetLocale() );
mpExtTextView = new ExtTextView( mpExtTextEngine, this );
mpExtTextEngine->InsertView( mpExtTextView );
- mpExtTextEngine->EnableUndo( TRUE );
+ mpExtTextEngine->EnableUndo( sal_True );
mpExtTextView->ShowCursor();
Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
@@ -791,11 +791,11 @@ void TextWindow::MouseMove( const MouseEvent& rMEvt )
void TextWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird
+ mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren wird
mpExtTextView->MouseButtonDown( rMEvt );
Window::MouseButtonDown( rMEvt );
GrabFocus();
- mbInMBDown = FALSE;
+ mbInMBDown = sal_False;
}
void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
@@ -806,29 +806,29 @@ void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
void TextWindow::KeyInput( const KeyEvent& rKEvent )
{
- BOOL bDone = FALSE;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
if ( nCode == com::sun::star::awt::Key::SELECT_ALL ||
( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
)
{
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
{
if ( Edit::GetGetSpecialCharsFunction() )
{
// Damit die Selektion erhalten bleibt
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() );
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextView->GetTextEngine()->SetModified( TRUE );
+ mpExtTextView->GetTextEngine()->SetModified( sal_True );
}
- mbActivePopup = FALSE;
- bDone = TRUE;
+ mbActivePopup = sal_False;
+ bDone = sal_True;
}
}
else if ( nCode == KEY_TAB )
@@ -864,33 +864,33 @@ void TextWindow::Command( const CommandEvent& rCEvt )
pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !mpExtTextView->HasSelection() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
}
if ( mpExtTextView->IsReadOnly() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False );
}
if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
{
- pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
}
// if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
// {
-// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
+// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
// }
if ( !Edit::GetGetSpecialCharsFunction() )
{
- USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
@@ -899,26 +899,26 @@ void TextWindow::Command( const CommandEvent& rCEvt )
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
// pPopup->RemoveDisabledEntries();
- USHORT n = pPopup->Execute( this, aPos );
+ sal_uInt16 n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
switch ( n )
{
case SV_MENU_EDIT_UNDO: mpExtTextView->Undo();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_CUT: mpExtTextView->Cut();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_COPY: mpExtTextView->Copy();
break;
case SV_MENU_EDIT_PASTE: mpExtTextView->Paste();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
@@ -929,13 +929,13 @@ void TextWindow::Command( const CommandEvent& rCEvt )
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
}
}
break;
}
- mbActivePopup = FALSE;
+ mbActivePopup = sal_False;
}
else
{
@@ -949,19 +949,19 @@ void TextWindow::GetFocus()
Window::GetFocus();
if ( !mbActivePopup )
{
- BOOL bGotoCursor = !mpExtTextView->IsReadOnly();
+ sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly();
if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly()
&& ( mbSelectOnTab &&
(!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) )) )
{
// Alles selektieren, aber nicht scrollen
- BOOL bAutoScroll = mpExtTextView->IsAutoScroll();
- mpExtTextView->SetAutoScroll( FALSE );
+ sal_Bool bAutoScroll = mpExtTextView->IsAutoScroll();
+ mpExtTextView->SetAutoScroll( sal_False );
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
mpExtTextView->SetAutoScroll( bAutoScroll );
- bGotoCursor = FALSE;
+ bGotoCursor = sal_False;
}
- mpExtTextView->SetPaintSelection( TRUE );
+ mpExtTextView->SetPaintSelection( sal_True );
mpExtTextView->ShowCursor( bGotoCursor );
}
}
@@ -971,12 +971,12 @@ void TextWindow::LoseFocus()
Window::LoseFocus();
if ( mbFocusSelectionHide && !mbActivePopup )
- mpExtTextView->SetPaintSelection( FALSE );
+ mpExtTextView->SetPaintSelection( sal_False );
}
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-TextWindow::GetComponentInterface(BOOL bCreate)
+TextWindow::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Window::GetComponentInterface(false));
@@ -993,10 +993,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle )
{
SetType( WINDOW_MULTILINEEDIT );
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
}
@@ -1006,10 +1006,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
SetType( WINDOW_MULTILINEEDIT );
WinBits nWinStyle = rResId.GetWinBits();
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- USHORT nMaxLen = Edit::GetMaxTextLen();
+ sal_uInt16 nMaxLen = Edit::GetMaxTextLen();
if ( nMaxLen )
SetMaxTextLen( nMaxLen );
@@ -1018,7 +1018,7 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
if ( IsVisible() )
pImpSvMEdit->Resize();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
// Base Edit ctor could call Show already, but that would cause problems
@@ -1053,7 +1053,7 @@ WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle )
}
-void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL bBackground )
+void MultiLineEdit::ImplInitSettings( sal_Bool /*bFont*/, sal_Bool /*bForeground*/, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1085,7 +1085,7 @@ void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1127,20 +1127,20 @@ void MultiLineEdit::UpdateData()
void MultiLineEdit::SetModifyFlag()
{
- pImpSvMEdit->SetModified( TRUE );
+ pImpSvMEdit->SetModified( sal_True );
}
void MultiLineEdit::ClearModifyFlag()
{
- pImpSvMEdit->SetModified( FALSE );
+ pImpSvMEdit->SetModified( sal_False );
}
-BOOL MultiLineEdit::IsModified() const
+sal_Bool MultiLineEdit::IsModified() const
{
return pImpSvMEdit->IsModified();
}
-void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
+void MultiLineEdit::EnableUpdateData( sal_uLong nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -1155,7 +1155,7 @@ void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
}
}
-void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
+void MultiLineEdit::SetReadOnly( sal_Bool bReadOnly )
{
pImpSvMEdit->SetReadOnly( bReadOnly );
Edit::SetReadOnly( bReadOnly );
@@ -1169,7 +1169,7 @@ void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
SetStyle( nStyle );
}
-BOOL MultiLineEdit::IsReadOnly() const
+sal_Bool MultiLineEdit::IsReadOnly() const
{
return pImpSvMEdit->IsReadOnly();
}
@@ -1300,7 +1300,7 @@ Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const
return aSz;
}
-Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size MultiLineEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines );
@@ -1311,7 +1311,7 @@ Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void MultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
}
@@ -1321,7 +1321,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
if( nType == STATE_CHANGE_ENABLE )
{
pImpSvMEdit->Enable( IsEnabled() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
}
else if( nType == STATE_CHANGE_READONLY )
{
@@ -1330,23 +1330,23 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_ZOOM )
{
pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_STYLE )
@@ -1358,7 +1358,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1374,7 +1374,7 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Resize();
Invalidate();
}
@@ -1382,14 +1382,14 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
Control::DataChanged( rDCEvt );
}
-void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -1400,8 +1400,8 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1435,7 +1435,7 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
XubString aText = GetText();
Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
- ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height());
+ sal_uLong nLines = (sal_uLong) (aSize.Height() / aTextSz.Height());
if ( !nLines )
nLines = 1;
aTextSz.Height() = nLines*aTextSz.Height();
@@ -1589,24 +1589,24 @@ ScrollBar* MultiLineEdit::GetVScrollBar() const
return pImpSvMEdit->GetVScrollBar();
}
-void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide )
+void MultiLineEdit::EnableFocusSelectionHide( sal_Bool bHide )
{
pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
}
-BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const
+sal_Bool MultiLineEdit::IsFocusSelectionHideEnabled() const
{
return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide();
}
-void MultiLineEdit::SetLeftMargin( USHORT n )
+void MultiLineEdit::SetLeftMargin( sal_uInt16 n )
{
if ( GetTextEngine() )
GetTextEngine()->SetLeftMargin( n );
}
-USHORT MultiLineEdit::GetLeftMargin() const
+sal_uInt16 MultiLineEdit::GetLeftMargin() const
{
if ( GetTextEngine() )
return GetTextEngine()->GetLeftMargin();
@@ -1614,7 +1614,7 @@ USHORT MultiLineEdit::GetLeftMargin() const
return 0;
}
-void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
+void MultiLineEdit::SetRightToLeft( sal_Bool bRightToLeft )
{
if ( GetTextEngine() )
{
@@ -1623,9 +1623,9 @@ void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
}
}
-BOOL MultiLineEdit::IsRightToLeft() const
+sal_Bool MultiLineEdit::IsRightToLeft() const
{
- BOOL bRightToLeft = FALSE;
+ sal_Bool bRightToLeft = sal_False;
if ( GetTextEngine() )
bRightToLeft = GetTextEngine()->IsRightToLeft();
@@ -1635,7 +1635,7 @@ BOOL MultiLineEdit::IsRightToLeft() const
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-MultiLineEdit::GetComponentInterface(BOOL bCreate)
+MultiLineEdit::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Edit::GetComponentInterface(false));
diff --git a/svtools/source/edit/svmedit2.cxx b/svtools/source/edit/svmedit2.cxx
index 1241eef2089e..bb496e47a7ef 100644
--- a/svtools/source/edit/svmedit2.cxx
+++ b/svtools/source/edit/svmedit2.cxx
@@ -50,32 +50,32 @@ ExtMultiLineEdit::~ExtMultiLineEdit()
{
}
-void ExtMultiLineEdit::InsertText( const String& rNew, BOOL )
+void ExtMultiLineEdit::InsertText( const String& rNew, sal_Bool )
{
- GetTextView()->InsertText( rNew, FALSE );
+ GetTextView()->InsertText( rNew, sal_False );
}
-void ExtMultiLineEdit::SetAutoScroll( BOOL bAutoScroll )
+void ExtMultiLineEdit::SetAutoScroll( sal_Bool bAutoScroll )
{
GetTextView()->SetAutoScroll( bAutoScroll );
}
-void ExtMultiLineEdit::EnableCursor( BOOL bEnable )
+void ExtMultiLineEdit::EnableCursor( sal_Bool bEnable )
{
GetTextView()->EnableCursor( bEnable );
}
-void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd )
+void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd )
{
GetTextEngine()->SetAttrib( rAttr, nPara, nStart, nEnd );
}
-void ExtMultiLineEdit::SetLeftMargin( USHORT nLeftMargin )
+void ExtMultiLineEdit::SetLeftMargin( sal_uInt16 nLeftMargin )
{
GetTextEngine()->SetLeftMargin( nLeftMargin );
}
-ULONG ExtMultiLineEdit::GetParagraphCount() const
+sal_uLong ExtMultiLineEdit::GetParagraphCount() const
{
return GetTextEngine()->GetParagraphCount();
}
diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx
index e8d0d75cd6e0..c20ebd962acd 100644
--- a/svtools/source/edit/sychconv.cxx
+++ b/svtools/source/edit/sychconv.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "sychconv.hxx"
+#include <svtools/sychconv.hxx>
#include <vcl/outdev.hxx>
-BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
+sal_Bool SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
{
// hibyte 0 = exact matching
// 1 = little differences,
// 2 = the converted character does not look like the original but got the same meaning
// 3 = the destination does not match looking and meaning of the original
- static USHORT const aWingdingsToStarBatsTable[ 256 - 32 ] =
+ static sal_uInt16 const aWingdingsToStarBatsTable[ 256 - 32 ] =
{
0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C,
0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137,
@@ -56,7 +56,7 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8
};
- static USHORT const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
+ static sal_uInt16 const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
{
0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038,
0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086,
@@ -74,9 +74,9 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000
};
- const USHORT* pTransTable = NULL;
+ const sal_uInt16* pTransTable = NULL;
- BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE;
+ sal_Bool bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : sal_False;
if ( !bIsAvailable )
{
if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL )
@@ -87,20 +87,20 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
if ( pTransTable )
{
sal_Unicode c;
- for ( UINT16 i = rString.Len(); i--; )
+ for ( sal_uInt16 i = rString.Len(); i--; )
{
c = rString.GetChar( i );
c -= 32;
- c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
+ c = ( ((sal_uInt16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
if ( !c ) // if character is out of range or not matching
c = 0xA5; // we will default a StarBats-Bullet
rString.SetChar( i, c );
}
rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) );
- return TRUE;
+ return sal_True;
}
- else return FALSE;
+ else return sal_False;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index f326eb0ec8a5..f859e9930cf9 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -35,9 +35,6 @@
#include <tools/debug.hxx>
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
-
-
// ##########################################################################
// ATTENTION: all these words needs to be in small caps
// ##########################################################################
@@ -260,22 +257,22 @@ class BasicSimpleCharClass
static LetterTable aLetterTable;
public:
- static BOOL isAlpha( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlpha( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
+ sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|| (bCompatible && aLetterTable.isLetter( c ));
return bRet;
}
- static BOOL isDigit( sal_Unicode c )
+ static sal_Bool isDigit( sal_Unicode c )
{
- BOOL bRet = (c >= '0' && c <= '9');
+ sal_Bool bRet = (c >= '0' && c <= '9');
return bRet;
}
- static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible );
+ sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible );
return bRet;
}
};
@@ -287,68 +284,68 @@ LetterTable::LetterTable( void )
for( int i = 0 ; i < 256 ; ++i )
IsLetterTab[i] = false;
- IsLetterTab[0xC0] = true; // , CAPITAL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xC1] = true; // , CAPITAL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xC2] = true; // , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xC3] = true; // , CAPITAL LETTER A WITH TILDE
- IsLetterTab[0xC4] = true; // , CAPITAL LETTER A WITH DIAERESIS
- IsLetterTab[0xC5] = true; // , CAPITAL LETTER A WITH RING ABOVE
- IsLetterTab[0xC6] = true; // , CAPITAL LIGATURE AE
- IsLetterTab[0xC7] = true; // , CAPITAL LETTER C WITH CEDILLA
- IsLetterTab[0xC8] = true; // , CAPITAL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xC9] = true; // , CAPITAL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xCA] = true; // , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCB] = true; // , CAPITAL LETTER E WITH DIAERESIS
- IsLetterTab[0xCC] = true; // , CAPITAL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xCD] = true; // , CAPITAL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xCE] = true; // , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCF] = true; // , CAPITAL LETTER I WITH DIAERESIS
- IsLetterTab[0xD0] = true; // , CAPITAL LETTER ETH
- IsLetterTab[0xD1] = true; // , CAPITAL LETTER N WITH TILDE
- IsLetterTab[0xD2] = true; // , CAPITAL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xD3] = true; // , CAPITAL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xD4] = true; // , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xD5] = true; // , CAPITAL LETTER O WITH TILDE
- IsLetterTab[0xD6] = true; // , CAPITAL LETTER O WITH DIAERESIS
- IsLetterTab[0xD8] = true; // , CAPITAL LETTER O WITH STROKE
- IsLetterTab[0xD9] = true; // , CAPITAL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xDA] = true; // , CAPITAL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xDB] = true; // , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xDC] = true; // , CAPITAL LETTER U WITH DIAERESIS
- IsLetterTab[0xDD] = true; // , CAPITAL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xDE] = true; // , CAPITAL LETTER THORN
- IsLetterTab[0xDF] = true; // , SMALL LETTER SHARP S
- IsLetterTab[0xE0] = true; // , SMALL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xE1] = true; // , SMALL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xE2] = true; // , SMALL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xE3] = true; // , SMALL LETTER A WITH TILDE
- IsLetterTab[0xE4] = true; // , SMALL LETTER A WITH DIAERESIS
- IsLetterTab[0xE5] = true; // , SMALL LETTER A WITH RING ABOVE
- IsLetterTab[0xE6] = true; // , SMALL LIGATURE AE
- IsLetterTab[0xE7] = true; // , SMALL LETTER C WITH CEDILLA
- IsLetterTab[0xE8] = true; // , SMALL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xE9] = true; // , SMALL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xEA] = true; // , SMALL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEB] = true; // , SMALL LETTER E WITH DIAERESIS
- IsLetterTab[0xEC] = true; // , SMALL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xED] = true; // , SMALL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xEE] = true; // , SMALL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEF] = true; // , SMALL LETTER I WITH DIAERESIS
- IsLetterTab[0xF0] = true; // , SMALL LETTER ETH
- IsLetterTab[0xF1] = true; // , SMALL LETTER N WITH TILDE
- IsLetterTab[0xF2] = true; // , SMALL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xF3] = true; // , SMALL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xF4] = true; // , SMALL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xF5] = true; // , SMALL LETTER O WITH TILDE
- IsLetterTab[0xF6] = true; // , SMALL LETTER O WITH DIAERESIS
- IsLetterTab[0xF8] = true; // , SMALL LETTER O WITH OBLIQUE BAR
- IsLetterTab[0xF9] = true; // , SMALL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xFA] = true; // , SMALL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xFB] = true; // , SMALL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xFC] = true; // , SMALL LETTER U WITH DIAERESIS
- IsLetterTab[0xFD] = true; // , SMALL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xFE] = true; // , SMALL LETTER THORN
- IsLetterTab[0xFF] = true; // , SMALL LETTER Y WITH DIAERESIS
+ IsLetterTab[0xC0] = true; // ?, CAPITAL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xC1] = true; // ?, CAPITAL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xC2] = true; // ?, CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xC3] = true; // ?, CAPITAL LETTER A WITH TILDE
+ IsLetterTab[0xC4] = true; // ?, CAPITAL LETTER A WITH DIAERESIS
+ IsLetterTab[0xC5] = true; // ?, CAPITAL LETTER A WITH RING ABOVE
+ IsLetterTab[0xC6] = true; // ?, CAPITAL LIGATURE AE
+ IsLetterTab[0xC7] = true; // ?, CAPITAL LETTER C WITH CEDILLA
+ IsLetterTab[0xC8] = true; // ?, CAPITAL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xC9] = true; // ?, CAPITAL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xCA] = true; // ?, CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCB] = true; // ?, CAPITAL LETTER E WITH DIAERESIS
+ IsLetterTab[0xCC] = true; // ?, CAPITAL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xCD] = true; // ?, CAPITAL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xCE] = true; // ?, CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCF] = true; // ?, CAPITAL LETTER I WITH DIAERESIS
+ IsLetterTab[0xD0] = true; // ?, CAPITAL LETTER ETH
+ IsLetterTab[0xD1] = true; // ?, CAPITAL LETTER N WITH TILDE
+ IsLetterTab[0xD2] = true; // ?, CAPITAL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xD3] = true; // ?, CAPITAL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xD4] = true; // ?, CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xD5] = true; // ?, CAPITAL LETTER O WITH TILDE
+ IsLetterTab[0xD6] = true; // ?, CAPITAL LETTER O WITH DIAERESIS
+ IsLetterTab[0xD8] = true; // ?, CAPITAL LETTER O WITH STROKE
+ IsLetterTab[0xD9] = true; // ?, CAPITAL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xDA] = true; // ?, CAPITAL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xDB] = true; // ?, CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xDC] = true; // ?, CAPITAL LETTER U WITH DIAERESIS
+ IsLetterTab[0xDD] = true; // ?, CAPITAL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xDE] = true; // ?, CAPITAL LETTER THORN
+ IsLetterTab[0xDF] = true; // ?, SMALL LETTER SHARP S
+ IsLetterTab[0xE0] = true; // ?, SMALL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xE1] = true; // ?, SMALL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xE2] = true; // ?, SMALL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xE3] = true; // ?, SMALL LETTER A WITH TILDE
+ IsLetterTab[0xE4] = true; // ?, SMALL LETTER A WITH DIAERESIS
+ IsLetterTab[0xE5] = true; // ?, SMALL LETTER A WITH RING ABOVE
+ IsLetterTab[0xE6] = true; // ?, SMALL LIGATURE AE
+ IsLetterTab[0xE7] = true; // ?, SMALL LETTER C WITH CEDILLA
+ IsLetterTab[0xE8] = true; // ?, SMALL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xE9] = true; // ?, SMALL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xEA] = true; // ?, SMALL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEB] = true; // ?, SMALL LETTER E WITH DIAERESIS
+ IsLetterTab[0xEC] = true; // ?, SMALL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xED] = true; // ?, SMALL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xEE] = true; // ?, SMALL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEF] = true; // ?, SMALL LETTER I WITH DIAERESIS
+ IsLetterTab[0xF0] = true; // ?, SMALL LETTER ETH
+ IsLetterTab[0xF1] = true; // ?, SMALL LETTER N WITH TILDE
+ IsLetterTab[0xF2] = true; // ?, SMALL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xF3] = true; // ?, SMALL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xF4] = true; // ?, SMALL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xF5] = true; // ?, SMALL LETTER O WITH TILDE
+ IsLetterTab[0xF6] = true; // ?, SMALL LETTER O WITH DIAERESIS
+ IsLetterTab[0xF8] = true; // ?, SMALL LETTER O WITH OBLIQUE BAR
+ IsLetterTab[0xF9] = true; // ?, SMALL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xFA] = true; // ?, SMALL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xFB] = true; // ?, SMALL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xFC] = true; // ?, SMALL LETTER U WITH DIAERESIS
+ IsLetterTab[0xFD] = true; // ?, SMALL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xFE] = true; // ?, SMALL LETTER THORN
+ IsLetterTab[0xFF] = true; // � , SMALL LETTER Y WITH DIAERESIS
}
bool LetterTable::isLetterUnicode( sal_Unicode c )
@@ -362,7 +359,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c )
}
// Hilfsfunktion: Zeichen-Flag Testen
-BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
+sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags )
{
bool bRet = false;
if( c != 0 && c <= 255 )
@@ -377,14 +374,14 @@ BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
return bRet;
}
-void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, UINT16 nCount )
+void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount )
{
ppListKeyWords = ppKeyWords;
nKeyWordCount = nCount;
}
// Neues Token holen
-BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
+sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
/*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos )
{
reType = TT_UNKNOWN;
@@ -395,25 +392,25 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Zeichen untersuchen
sal_Unicode c = peekChar();
if( c == CHAR_EOF )
- return FALSE;
+ return sal_False;
// Zeichen lesen
getChar();
//*** Alle Moeglichkeiten durchgehen ***
// Space?
- if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) )
+ if ( (testCharFlags( c, CHAR_SPACE ) == sal_True) )
{
- while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE )
+ while( testCharFlags( peekChar(), CHAR_SPACE ) == sal_True )
getChar();
reType = TT_WHITESPACE;
}
// Identifier?
- else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) )
+ else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == sal_True) )
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -456,7 +453,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = peekChar();
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
c = getChar();
cPeek = peekChar();
@@ -471,14 +468,14 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Operator?
// only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there
- else if ( ( testCharFlags( c, CHAR_OPERATOR ) == TRUE ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
+ else if ( ( testCharFlags( c, CHAR_OPERATOR ) == sal_True ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
{
// paramters for SQL view
if ( (c==':') || (c=='?'))
{
if (c!='?')
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -497,7 +494,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='-')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -511,7 +508,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='/')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -528,7 +525,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = c;
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
getChar();
cPeek = peekChar();
@@ -555,7 +552,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zahl?
- else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_NUMBER ) == sal_True )
{
reType = TT_NUMBER;
@@ -597,7 +594,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if( reType == TT_NUMBER && nRadix == 10 )
{
// Flag, ob das letzte Zeichen ein Exponent war
- BOOL bAfterExpChar = FALSE;
+ sal_Bool bAfterExpChar = sal_False;
// Alle Ziffern einlesen
while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) ||
@@ -614,7 +611,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// String?
- else if( testCharFlags( c, CHAR_START_STRING ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_STRING ) == sal_True )
{
// Merken, welches Zeichen den String eroeffnet hat
sal_Unicode cEndString = c;
@@ -632,7 +629,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
break;
}
c = getChar();
- if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// ERROR: unterminated string literal
reType = TT_ERROR;
@@ -652,11 +649,11 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zeilenende?
- else if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ else if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// Falls ein weiteres anderes EOL-Char folgt, weg damit
sal_Unicode cNext = peekChar();
- if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE )
+ if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True )
getChar();
// Positions-Daten auf Zeilen-Beginn setzen
@@ -671,13 +668,13 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// End-Position eintragen
rpEndPos = mpActualPos;
- return TRUE;
+ return sal_True;
}
String SimpleTokenizer_Impl::getTokStr
( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos )
{
- return String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
#ifdef DBG_UTIL
@@ -702,7 +699,7 @@ String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType,
}
if( eType != TT_EOL )
{
- aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") );
return aOut;
@@ -714,10 +711,10 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) );
// Zeichen-Tabelle fuellen
- USHORT i;
+ sal_uInt16 i;
// Zulaessige Zeichen fuer Identifier
- USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
+ sal_uInt16 nHelpMask = (sal_uInt16)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
for( i = 'a' ; i <= 'z' ; i++ )
aCharTypeTab[i] |= nHelpMask;
for( i = 'A' ; i <= 'Z' ; i++ )
@@ -728,7 +725,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
aCharTypeTab[(int)'$'] |= nHelpMask;
// Ziffern (Identifier und Number ist moeglich)
- nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
+ nHelpMask = (sal_uInt16)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER );
for( i = '0' ; i <= '9' ; i++ )
aCharTypeTab[i] |= nHelpMask;
@@ -736,7 +733,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
// e und E sowie . von Hand ergaenzen
aCharTypeTab[(int)'e'] |= CHAR_IN_NUMBER;
aCharTypeTab[(int)'E'] |= CHAR_IN_NUMBER;
- aCharTypeTab[(int)'.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
+ aCharTypeTab[(int)'.'] |= (sal_uInt16)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
aCharTypeTab[(int)'&'] |= CHAR_START_NUMBER;
// Hex-Ziffern
@@ -804,7 +801,7 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void )
}
// Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul
-UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource )
+sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const String* aSource )
{
// Position auf den Anfang des Source-Strings setzen
mpStringBegin = mpActualPos = aSource->GetBuffer();
@@ -819,14 +816,14 @@ UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource
const sal_Unicode* pEndPos;
// Schleife ueber alle Tokens
- UINT16 nTokenCount = 0;
+ sal_uInt16 nTokenCount = 0;
while( getNextToken( eType, pStartPos, pEndPos ) )
nTokenCount++;
return nTokenCount;
}
-void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine,
+void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
// Position auf den Anfang des Source-Strings setzen
@@ -846,11 +843,11 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String
{
HighlightPortion portion;
- portion.nBegin = (UINT16)(pStartPos - mpStringBegin);
- portion.nEnd = (UINT16)(pEndPos - mpStringBegin);
+ portion.nBegin = (sal_uInt16)(pStartPos - mpStringBegin);
+ portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin);
portion.tokenType = eType;
- portions.Insert(portion, portions.Count());
+ portions.push_back(portion);
}
}
@@ -892,18 +889,18 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ )
}
}
-const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference,
- const String* pChangedLines, UINT32 nArrayLength)
+const Range SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference,
+ const String* pChangedLines, sal_uInt32 nArrayLength)
{
(void)nLineCountDifference;
- for( UINT32 i=0 ; i < nArrayLength ; i++ )
+ for( sal_uInt32 i=0 ; i < nArrayLength ; i++ )
m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]);
return Range( nLine, nLine + nArrayLength-1 );
}
-void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine,
+void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx
index df2e3ffaf6a5..579810ce37ab 100644
--- a/svtools/source/edit/textdat2.hxx
+++ b/svtools/source/edit/textdat2.hxx
@@ -56,35 +56,35 @@ class TextView;
class TETextPortion
{
private:
- USHORT nLen;
+ sal_uInt16 nLen;
long nWidth;
- BYTE nKind;
- BYTE nRightToLeft;
+ sal_uInt8 nKind;
+ sal_uInt8 nRightToLeft;
TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;}
public:
- TETextPortion( USHORT nL ) {
+ TETextPortion( sal_uInt16 nL ) {
nLen = nL;
nKind = PORTIONKIND_TEXT;
nWidth= -1;
nRightToLeft = 0;
}
- USHORT GetLen() const { return nLen; }
- USHORT& GetLen() { return nLen; }
+ sal_uInt16 GetLen() const { return nLen; }
+ sal_uInt16& GetLen() { return nLen; }
long GetWidth()const { return nWidth; }
long& GetWidth() { return nWidth; }
- BYTE GetKind() const { return nKind; }
- BYTE& GetKind() { return nKind; }
+ sal_uInt8 GetKind() const { return nKind; }
+ sal_uInt8& GetKind() { return nKind; }
- BYTE GetRightToLeft() const { return nRightToLeft; }
- BYTE& GetRightToLeft() { return nRightToLeft; }
- BOOL IsRightToLeft() const { return (nRightToLeft&1); }
+ sal_uInt8 GetRightToLeft() const { return nRightToLeft; }
+ sal_uInt8& GetRightToLeft() { return nRightToLeft; }
+ sal_Bool IsRightToLeft() const { return (nRightToLeft&1); }
- BOOL HasValidSize() const { return nWidth != (-1); }
+ sal_Bool HasValidSize() const { return nWidth != (-1); }
};
@@ -99,17 +99,17 @@ public:
~TETextPortionList();
void Reset();
- USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE );
- USHORT GetPortionStartIndex( USHORT nPortion );
- void DeleteFromPortion( USHORT nDelFrom );
+ sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False );
+ sal_uInt16 GetPortionStartIndex( sal_uInt16 nPortion );
+ void DeleteFromPortion( sal_uInt16 nDelFrom );
};
struct TEWritingDirectionInfo
{
- BYTE nType;
- USHORT nStartPos;
- USHORT nEndPos;
- TEWritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End )
+ sal_uInt8 nType;
+ sal_uInt16 nStartPos;
+ sal_uInt16 nEndPos;
+ TEWritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End )
{
nType = _Type;
nStartPos = _Start;
@@ -122,65 +122,65 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 )
class TextLine
{
private:
- USHORT mnStart;
- USHORT mnEnd;
- USHORT mnStartPortion;
- USHORT mnEndPortion;
+ sal_uInt16 mnStart;
+ sal_uInt16 mnEnd;
+ sal_uInt16 mnStartPortion;
+ sal_uInt16 mnEndPortion;
short mnStartX;
- BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe
+ sal_Bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
public:
TextLine() {
mnStart = mnEnd = 0;
mnStartPortion = mnEndPortion = 0;
mnStartX = 0;
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
- BOOL IsIn( USHORT nIndex ) const
+ sal_Bool IsIn( sal_uInt16 nIndex ) const
{ return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); }
- BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const
+ sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const
{ return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); }
- void SetStart( USHORT n ) { mnStart = n; }
- USHORT GetStart() const { return mnStart; }
- USHORT& GetStart() { return mnStart; }
+ void SetStart( sal_uInt16 n ) { mnStart = n; }
+ sal_uInt16 GetStart() const { return mnStart; }
+ sal_uInt16& GetStart() { return mnStart; }
- void SetEnd( USHORT n ) { mnEnd = n; }
- USHORT GetEnd() const { return mnEnd; }
- USHORT& GetEnd() { return mnEnd; }
+ void SetEnd( sal_uInt16 n ) { mnEnd = n; }
+ sal_uInt16 GetEnd() const { return mnEnd; }
+ sal_uInt16& GetEnd() { return mnEnd; }
- void SetStartPortion( USHORT n ) { mnStartPortion = n; }
- USHORT GetStartPortion() const { return mnStartPortion; }
- USHORT& GetStartPortion() { return mnStartPortion; }
+ void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; }
+ sal_uInt16 GetStartPortion() const { return mnStartPortion; }
+ sal_uInt16& GetStartPortion() { return mnStartPortion; }
- void SetEndPortion( USHORT n ) { mnEndPortion = n; }
- USHORT GetEndPortion() const { return mnEndPortion; }
- USHORT& GetEndPortion() { return mnEndPortion; }
+ void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; }
+ sal_uInt16 GetEndPortion() const { return mnEndPortion; }
+ sal_uInt16& GetEndPortion() { return mnEndPortion; }
- USHORT GetLen() const { return mnEnd - mnStart; }
+ sal_uInt16 GetLen() const { return mnEnd - mnStart; }
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsValid() const { return !mbInvalid; }
- void SetInvalid() { mbInvalid = TRUE; }
- void SetValid() { mbInvalid = FALSE; }
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsValid() const { return !mbInvalid; }
+ void SetInvalid() { mbInvalid = sal_True; }
+ void SetValid() { mbInvalid = sal_False; }
- BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; }
+ sal_Bool IsEmpty() const { return (mnEnd > mnStart) ? sal_False : sal_True; }
short GetStartX() const { return mnStartX; }
void SetStartX( short n ) { mnStartX = n; }
- inline BOOL operator == ( const TextLine& rLine ) const;
- inline BOOL operator != ( const TextLine& rLine ) const;
+ inline sal_Bool operator == ( const TextLine& rLine ) const;
+ inline sal_Bool operator != ( const TextLine& rLine ) const;
};
typedef TextLine* TextLinePtr;
SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 )
-inline BOOL TextLine::operator == ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const
{
return ( ( mnStart == rLine.mnStart ) &&
( mnEnd == rLine.mnEnd ) &&
@@ -188,7 +188,7 @@ inline BOOL TextLine::operator == ( const TextLine& rLine ) const
( mnEndPortion == rLine.mnEndPortion ) );
}
-inline BOOL TextLine::operator != ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator != ( const TextLine& rLine ) const
{
return !( *this == rLine );
}
@@ -205,11 +205,11 @@ private:
TEWritingDirectionInfos maWritingDirectionInfos;
- USHORT mnInvalidPosStart;
+ sal_uInt16 mnInvalidPosStart;
short mnInvalidDiff;
- BOOL mbInvalid;
- BOOL mbSimple; // nur lineares Tippen
+ sal_Bool mbInvalid;
+ sal_Bool mbSimple; // nur lineares Tippen
TEParaPortion( const TEParaPortion& ) {;}
@@ -219,15 +219,15 @@ public:
~TEParaPortion();
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsSimpleInvalid() const { return mbSimple; }
- void SetNotSimpleInvalid() { mbSimple = FALSE; }
- void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;}
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsSimpleInvalid() const { return mbSimple; }
+ void SetNotSimpleInvalid() { mbSimple = sal_False; }
+ void SetValid() { mbInvalid = sal_False; mbSimple = sal_True;}
- void MarkInvalid( USHORT nStart, short nDiff);
- void MarkSelectionInvalid( USHORT nStart, USHORT nEnd );
+ void MarkInvalid( sal_uInt16 nStart, short nDiff);
+ void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd );
- USHORT GetInvalidPosStart() const { return mnInvalidPosStart; }
+ sal_uInt16 GetInvalidPosStart() const { return mnInvalidPosStart; }
short GetInvalidDiff() const { return mnInvalidDiff; }
TextNode* GetNode() const { return mpNode; }
@@ -236,8 +236,8 @@ public:
TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; }
- USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd );
- void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine );
+ sal_uInt16 GetLineNumber( sal_uInt16 nIndex, sal_Bool bInclEnd );
+ void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine );
};
@@ -262,9 +262,9 @@ public:
virtual void CreateAnchor();
- virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False );
- virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
virtual void DeselectAll();
virtual void DeselectAtPoint( const Point& );
@@ -276,13 +276,13 @@ class IdleFormatter : public Timer
{
private:
TextView* mpView;
- USHORT mnRestarts;
+ sal_uInt16 mnRestarts;
public:
IdleFormatter();
~IdleFormatter();
- void DoIdleFormat( TextView* pV, USHORT nMaxRestarts );
+ void DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts );
void ForceTimeout();
TextView* GetView() { return mpView; }
};
@@ -292,14 +292,14 @@ struct TextDDInfo
Cursor maCursor;
TextPaM maDropPos;
- BOOL mbStarterOfDD;
- BOOL mbVisCursor;
+ sal_Bool mbStarterOfDD;
+ sal_Bool mbVisCursor;
TextDDInfo()
{
maCursor.SetStyle( CURSOR_SHADOW );
- mbStarterOfDD = FALSE;
- mbVisCursor = FALSE;
+ mbStarterOfDD = sal_False;
+ mbVisCursor = sal_False;
}
};
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 18301a181fae..d1586de4352a 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -38,7 +38,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr );
SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo );
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
@@ -67,7 +67,7 @@ void TextSelection::Justify()
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList()
@@ -81,24 +81,24 @@ TETextPortionList::~TETextPortionList()
void TETextPortionList::Reset()
{
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
delete GetObject( nPortion );
Remove( 0, Count() );
}
-void TETextPortionList::DeleteFromPortion( USHORT nDelFrom )
+void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom )
{
DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" );
- for ( USHORT nP = nDelFrom; nP < Count(); nP++ )
+ for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ )
delete GetObject( nP );
Remove( nDelFrom, Count()-nDelFrom );
}
-USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion )
+sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion )
{
// Bei nCharPos an Portion-Grenze wird die linke Portion gefunden
- USHORT nTmpPos = 0;
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ sal_uInt16 nTmpPos = 0;
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
{
TETextPortion* pPortion = GetObject( nPortion );
nTmpPos = nTmpPos + pPortion->GetLen();
@@ -117,10 +117,10 @@ USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, B
}
/*
-USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
+sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion )
{
- USHORT nPos = 0;
- for ( USHORT nP = 0; nP < nPortion; nP++ )
+ sal_uInt16 nPos = 0;
+ for ( sal_uInt16 nP = 0; nP < nPortion; nP++ )
{
TETextPortion* pPortion = GetObject( nP );
nPos += pPortion->GetLen();
@@ -130,24 +130,24 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
*/
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN )
{
mpNode = pN;
mnInvalidPosStart = mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
TEParaPortion::~TEParaPortion()
{
}
-void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
+void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff );
mnInvalidDiff = nDiff;
@@ -169,20 +169,20 @@ void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
else
{
DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
- mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
+ mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
mnInvalidDiff = 0;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
}
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
-void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
+void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = nStart;
// nInvalidPosEnd = nEnd;
@@ -196,13 +196,13 @@ void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
-USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
+sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd )
{
- for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ )
{
TextLine* pLine = maLines.GetObject( nLine );
if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) ||
@@ -219,9 +219,9 @@ USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
}
-void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine )
+void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine )
{
- USHORT nLines = maLines.Count();
+ sal_uInt16 nLines = maLines.Count();
DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" );
if ( nLastFormattedLine < ( nLines - 1 ) )
{
@@ -239,7 +239,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 ));
if ( nPDiff || nTDiff )
{
- for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ )
+ for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
{
TextLine* pLine = maLines[ nL ];
@@ -255,7 +255,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
}
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions()
@@ -275,7 +275,7 @@ void TEParaPortions::Reset()
clear();
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter()
@@ -289,7 +289,7 @@ IdleFormatter::~IdleFormatter()
mpView = 0;
}
-void IdleFormatter::DoIdleFormat( TextView* pV, USHORT nMaxRestarts )
+void IdleFormatter::DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts )
{
mpView = pV;
@@ -319,12 +319,12 @@ void IdleFormatter::ForceTimeout()
TYPEINIT1( TextHint, SfxSimpleHint );
-TextHint::TextHint( ULONG Id ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
{
mnValue = 0;
}
-TextHint::TextHint( ULONG Id, ULONG nValue ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id, sal_uLong nValue ) : SfxSimpleHint( Id )
{
mnValue = nValue;
}
@@ -334,9 +334,9 @@ TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos
{
aPos = rPos;
nLen = 0;
- bCursor = TRUE;
+ bCursor = sal_True;
pAttribs = NULL;
- bWasCursorOverwrite = FALSE;
+ bWasCursorOverwrite = sal_False;
}
TEIMEInfos::~TEIMEInfos()
@@ -344,12 +344,12 @@ TEIMEInfos::~TEIMEInfos()
delete[] pAttribs;
}
-void TEIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL )
+void TEIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL )
{
nLen = nL;
delete pAttribs;
- pAttribs = new USHORT[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(USHORT) );
+ pAttribs = new sal_uInt16[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
}
void TEIMEInfos::DestroyAttribs()
diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx
index 59072e2e1d9f..b4eeb76d8a06 100644
--- a/svtools/source/edit/textdoc.cxx
+++ b/svtools/source/edit/textdoc.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include <textdoc.hxx>
#include <stdlib.h>
@@ -67,7 +66,7 @@ CompareStart( const void* pFirst, const void* pSecond )
// -------------------------------------------------------------------------
// (+) class TextCharAttrib
// -------------------------------------------------------------------------
-TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd )
+TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd )
{
mpAttr = rAttr.Clone();
mnStart = nStart,
@@ -92,7 +91,7 @@ TextCharAttrib::~TextCharAttrib()
TextCharAttribList::TextCharAttribList()
{
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
TextCharAttribList::~TextCharAttribList()
@@ -100,7 +99,7 @@ TextCharAttribList::~TextCharAttribList()
// PTRARR_DEL
}
-void TextCharAttribList::Clear( BOOL bDestroyAttribs )
+void TextCharAttribList::Clear( sal_Bool bDestroyAttribs )
{
if ( bDestroyAttribs )
TextCharAttribs::DeleteAndDestroy( 0, Count() );
@@ -112,18 +111,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs )
void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
{
if ( pAttrib->IsEmpty() )
- mbHasEmptyAttribs = TRUE;
+ mbHasEmptyAttribs = sal_True;
- const USHORT nCount = Count();
- const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
- BOOL bInserted = FALSE;
- for ( USHORT x = 0; x < nCount; x++ )
+ const sal_uInt16 nCount = Count();
+ const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
+ sal_Bool bInserted = sal_False;
+ for ( sal_uInt16 x = 0; x < nCount; x++ )
{
TextCharAttrib* pCurAttrib = GetObject( x );
if ( pCurAttrib->GetStart() > nStart )
{
Insert( pAttrib, x );
- bInserted = TRUE;
+ bInserted = sal_True;
break;
}
}
@@ -137,12 +136,12 @@ void TextCharAttribList::ResortAttribs()
qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart );
}
-TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
@@ -155,11 +154,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
return NULL;
}
-TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const
+TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const
{
DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( ( pAttr->GetStart() >= nFromPos ) &&
@@ -170,41 +169,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP
return NULL;
}
-BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const
+sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const
{
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
const TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->Which() == nWhich )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound )
+sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->GetEnd() < nBound )
- return FALSE;
+ return sal_False;
if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
if ( !mbHasEmptyAttribs )
return 0;
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > nPos )
@@ -218,7 +217,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos
void TextCharAttribList::DeleteEmptyAttribs()
{
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->IsEmpty() )
@@ -228,19 +227,19 @@ void TextCharAttribList::DeleteEmptyAttribs()
nAttr--;
}
}
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
#ifdef DBG_UTIL
-BOOL TextCharAttribList::DbgCheckAttribs()
+sal_Bool TextCharAttribList::DbgCheckAttribs()
{
- BOOL bOK = TRUE;
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ sal_Bool bOK = sal_True;
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > pAttr->GetEnd() )
{
- bOK = FALSE;
+ bOK = sal_False;
OSL_FAIL( "Attr verdreht" );
}
}
@@ -257,14 +256,14 @@ TextNode::TextNode( const String& rText ) :
{
}
-void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
+void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew )
{
if ( !nNew )
return;
- BOOL bResort = FALSE;
- USHORT nAttribs = maCharAttribs.Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() >= nIndex )
@@ -295,7 +294,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
pAttrib->Expand( nNew );
}
else
- bResort = TRUE;
+ bResort = sal_True;
}
// 2: Attribut startet davor, geht hinter Index...
else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -308,7 +307,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
if ( nIndex == 0 )
{
pAttrib->Expand( nNew );
-// bResort = TRUE; // es gibt ja keine Features mehr...
+// bResort = sal_True; // es gibt ja keine Features mehr...
}
else
pAttrib->MoveForward( nNew );
@@ -328,18 +327,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
#endif
}
-void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
+void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted )
{
if ( !nDeleted )
return;
- BOOL bResort = FALSE;
- USHORT nEndChanges = nIndex+nDeleted;
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nEndChanges = nIndex+nDeleted;
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
- BOOL bDelAttr = FALSE;
+ sal_Bool bDelAttr = sal_False;
if ( pAttrib->GetEnd() >= nIndex )
{
// Alles Attribute hinter der Einfuegeposition verschieben...
@@ -355,7 +354,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
pAttrib->GetEnd() = nIndex; // leer
else
- bDelAttr = TRUE;
+ bDelAttr = sal_True;
}
// 2. Attribut beginnt davor, endet drinnen oder dahinter...
else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -378,13 +377,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" );
if ( bDelAttr /* || pAttrib->IsEmpty() */ )
{
- bResort = TRUE;
+ bResort = sal_True;
maCharAttribs.RemoveAttrib( nAttr );
delete pAttrib;
nAttr--;
}
else if ( pAttrib->IsEmpty() )
- maCharAttribs.HasEmptyAttribs() = TRUE;
+ maCharAttribs.HasEmptyAttribs() = sal_True;
}
if ( bResort )
@@ -395,25 +394,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
#endif
}
-void TextNode::InsertText( USHORT nPos, const String& rText )
+void TextNode::InsertText( sal_uInt16 nPos, const String& rText )
{
maText.Insert( rText, nPos );
ExpandAttribs( nPos, rText.Len() );
}
-void TextNode::InsertText( USHORT nPos, sal_Unicode c )
+void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c )
{
maText.Insert( c, nPos );
ExpandAttribs( nPos, 1 );
}
-void TextNode::RemoveText( USHORT nPos, USHORT nChars )
+void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars )
{
maText.Erase( nPos, nChars );
CollapsAttribs( nPos, nChars );
}
-TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
+TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs )
{
String aNewText;
if ( nPos < maText.Len() )
@@ -423,7 +422,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
}
TextNode* pNew = new TextNode( aNewText );
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() < nPos )
@@ -471,7 +470,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
void TextNode::Append( const TextNode& rNode )
{
- USHORT nOldLen = maText.Len();
+ sal_uInt16 nOldLen = maText.Len();
maText += rNode.GetText();
@@ -479,16 +478,16 @@ void TextNode::Append( const TextNode& rNode )
DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" );
#endif
- const USHORT nAttribs = rNode.GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr );
- BOOL bMelted = FALSE;
+ sal_Bool bMelted = sal_False;
if ( pAttrib->GetStart() == 0 )
{
// Evtl koennen Attribute zusammengefasst werden:
- USHORT nTmpAttribs = maCharAttribs.Count();
- for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
+ sal_uInt16 nTmpAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
{
TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr );
@@ -499,7 +498,7 @@ void TextNode::Append( const TextNode& rNode )
{
pTmpAttrib->GetEnd() =
pTmpAttrib->GetEnd() + pAttrib->GetLen();
- bMelted = TRUE;
+ bMelted = sal_True;
break; // es kann nur eins von der Sorte an der Stelle geben
}
}
@@ -541,15 +540,15 @@ void TextDoc::Clear()
void TextDoc::DestroyTextNodes()
{
- for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ )
+ for ( sal_uLong nNode = 0; nNode < maTextNodes.Count(); nNode++ )
delete maTextNodes.GetObject( nNode );
maTextNodes.clear();
}
String TextDoc::GetText( const sal_Unicode* pSep ) const
{
- ULONG nLen = GetTextLen( pSep );
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = GetTextLen( pSep );
+ sal_uLong nNodes = maTextNodes.Count();
if ( nLen > STRING_MAXLEN )
{
@@ -558,8 +557,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
}
String aASCIIText;
- ULONG nLastNode = nNodes-1;
- for ( ULONG nNode = 0; nNode < nNodes; nNode++ )
+ sal_uLong nLastNode = nNodes-1;
+ for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
String aTmp( pNode->GetText() );
@@ -571,7 +570,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
return aASCIIText;
}
-XubString TextDoc::GetText( ULONG nPara ) const
+XubString TextDoc::GetText( sal_uLong nPara ) const
{
XubString aText;
TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0;
@@ -582,26 +581,26 @@ XubString TextDoc::GetText( ULONG nPara ) const
}
-ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
+sal_uLong TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
{
- ULONG nLen = 0;
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = 0;
+ sal_uLong nNodes = maTextNodes.Count();
if ( nNodes )
{
- ULONG nStartNode = 0;
- ULONG nEndNode = nNodes-1;
+ sal_uLong nStartNode = 0;
+ sal_uLong nEndNode = nNodes-1;
if ( pSel )
{
nStartNode = pSel->GetStart().GetPara();
nEndNode = pSel->GetEnd().GetPara();
}
- for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
- USHORT nS = 0;
- ULONG nE = pNode->GetText().Len();
+ sal_uInt16 nS = 0;
+ sal_uLong nE = pNode->GetText().Len();
if ( pSel && ( nNode == pSel->GetStart().GetPara() ) )
nS = pSel->GetStart().GetIndex();
if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) )
@@ -641,7 +640,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr )
return aPaM;
}
-TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs );
@@ -654,20 +653,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight )
{
- USHORT nPrevLen = pLeft->GetText().Len();
+ sal_uInt16 nPrevLen = pLeft->GetText().Len();
pLeft->Append( *pRight );
// der rechte verschwindet.
- ULONG nRight = maTextNodes.GetPos( pRight );
+ sal_uLong nRight = maTextNodes.GetPos( pRight );
maTextNodes.Remove( nRight );
delete pRight;
- ULONG nLeft = maTextNodes.GetPos( pLeft );
+ sal_uLong nLeft = maTextNodes.GetPos( pLeft );
TextPaM aPaM( nLeft, nPrevLen );
return aPaM;
}
-TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
+TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
pNode->RemoveText( rPaM.GetIndex(), nChars );
@@ -675,20 +674,20 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
return rPaM;
}
-BOOL TextDoc::IsValidPaM( const TextPaM& rPaM )
+sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM )
{
if ( rPaM.GetPara() >= maTextNodes.Count() )
{
OSL_FAIL( "PaM: Para out of range" );
- return FALSE;
+ return sal_False;
}
TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() );
if ( rPaM.GetIndex() > pNode->GetText().Len() )
{
OSL_FAIL( "PaM: Index out of range" );
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx
index ea7619f3da25..c52190ca4d63 100644
--- a/svtools/source/edit/textdoc.hxx
+++ b/svtools/source/edit/textdoc.hxx
@@ -31,7 +31,7 @@
#include <svl/svarray.hxx>
#include <svtools/textdata.hxx>
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <tools/debug.hxx>
#include <tools/string.hxx>
@@ -42,7 +42,7 @@ SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 )
class TextCharAttribList : private TextCharAttribs
{
private:
- BOOL mbHasEmptyAttribs;
+ sal_Bool mbHasEmptyAttribs;
TextCharAttribList( const TextCharAttribList& ) : TextCharAttribs() {}
@@ -50,28 +50,28 @@ public:
TextCharAttribList();
~TextCharAttribList();
- void Clear( BOOL bDestroyAttribs );
- USHORT Count() const { return TextCharAttribs::Count(); }
+ void Clear( sal_Bool bDestroyAttribs );
+ sal_uInt16 Count() const { return TextCharAttribs::Count(); }
- TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); }
- void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); }
+ TextCharAttrib* GetAttrib( sal_uInt16 n ) const { return TextCharAttribs::GetObject( n ); }
+ void RemoveAttrib( sal_uInt16 n ) { TextCharAttribs::Remove( n, 1 ); }
void InsertAttrib( TextCharAttrib* pAttrib );
void DeleteEmptyAttribs();
void ResortAttribs();
- BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; }
- BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; }
+ sal_Bool HasEmptyAttribs() const { return mbHasEmptyAttribs; }
+ sal_Bool& HasEmptyAttribs() { return mbHasEmptyAttribs; }
- TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos );
- TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const;
- TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos );
- BOOL HasAttrib( USHORT nWhich ) const;
- BOOL HasBoundingAttrib( USHORT nBound );
+ TextCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ TextCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos = 0xFFFF ) const;
+ TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ sal_Bool HasAttrib( sal_uInt16 nWhich ) const;
+ sal_Bool HasBoundingAttrib( sal_uInt16 nBound );
#ifdef DBG_UTIL
- BOOL DbgCheckAttribs();
+ sal_Bool DbgCheckAttribs();
#endif
};
@@ -84,8 +84,8 @@ private:
TextNode( const TextNode& ) {;}
protected:
- void ExpandAttribs( USHORT nIndex, USHORT nNewChars );
- void CollapsAttribs( USHORT nIndex, USHORT nDelChars );
+ void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars );
+ void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars );
public:
TextNode( const String& rText );
@@ -96,11 +96,11 @@ public:
const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; }
TextCharAttribList& GetCharAttribs() { return maCharAttribs; }
- void InsertText( USHORT nPos, const String& rText );
- void InsertText( USHORT nPos, sal_Unicode c );
- void RemoveText( USHORT nPos, USHORT nChars );
+ void InsertText( sal_uInt16 nPos, const String& rText );
+ void InsertText( sal_uInt16 nPos, sal_Unicode c );
+ void RemoveText( sal_uInt16 nPos, sal_uInt16 nChars );
- TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs );
+ TextNode* Split( sal_uInt16 nPos, sal_Bool bKeepEndigAttribs );
void Append( const TextNode& rNode );
};
@@ -108,7 +108,7 @@ class TextDoc
{
private:
ToolsList<TextNode*> maTextNodes;
- USHORT mnLeftMargin;
+ sal_uInt16 mnLeftMargin;
protected:
void DestroyTextNodes();
@@ -122,27 +122,27 @@ public:
ToolsList<TextNode*>& GetNodes() { return maTextNodes; }
const ToolsList<TextNode*>& GetNodes() const { return maTextNodes; }
- TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars );
+ TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars );
TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c );
TextPaM InsertText( const TextPaM& rPaM, const String& rStr );
- TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs );
+ TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs );
TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight );
- ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
+ sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
String GetText( const sal_Unicode* pSep ) const;
- String GetText( ULONG nPara ) const;
+ String GetText( sal_uLong nPara ) const;
- void SetLeftMargin( USHORT n ) { mnLeftMargin = n; }
- USHORT GetLeftMargin() const { return mnLeftMargin; }
+ void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; }
+ sal_uInt16 GetLeftMargin() const { return mnLeftMargin; }
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 );
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ), sal_uInt16 nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 );
// void InsertAttrib( const EditCharAttrib* pAttr );
// void InsertAttribInSelection( const EditCharAttrib* pAttr );
-// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet );
+// void FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet );
- BOOL IsValidPaM( const TextPaM& rPaM );
+ sal_Bool IsValidPaM( const TextPaM& rPaM );
};
#endif // _TEXTDOC_HXX
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 45d23bcdbee9..15412276e587 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -74,8 +74,8 @@ typedef TextView* TextViewPtr;
SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 )
// SV_IMPL_PTRARR( TextViews, TextViewPtr );
-SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 )
-SV_IMPL_VARARR_SORT( TESortedPositions, ULONG )
+SV_DECL_VARARR_SORT( TESortedPositions, sal_uLong, 16, 8 )
+SV_IMPL_VARARR_SORT( TESortedPositions, sal_uLong )
#define RESDIFF 10
#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop
@@ -92,15 +92,15 @@ TextEngine::TextEngine()
mpViews = new TextViews;
mpActiveView = NULL;
- mbIsFormatting = FALSE;
- mbFormatted = FALSE;
- mbUpdate = TRUE;
- mbModified = FALSE;
- mbUndoEnabled = FALSE;
- mbIsInUndo = FALSE;
- mbDowning = FALSE;
- mbRightToLeft = FALSE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_False;
+ mbUpdate = sal_True;
+ mbModified = sal_False;
+ mbUndoEnabled = sal_False;
+ mbIsInUndo = sal_False;
+ mbDowning = sal_False;
+ mbRightToLeft = sal_False;
+ mbHasMultiLineParas = sal_False;
meAlign = TXTALIGN_LEFT;
@@ -124,7 +124,7 @@ TextEngine::TextEngine()
maTextColor = COL_BLACK;
Font aFont;
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aFillColor( aFont.GetFillColor() );
aFillColor.SetTransparency( 0 );
aFont.SetFillColor( aFillColor );
@@ -133,7 +133,7 @@ TextEngine::TextEngine()
TextEngine::~TextEngine()
{
- mbDowning = TRUE;
+ mbDowning = sal_True;
delete mpIdleFormatter;
delete mpDoc;
@@ -156,7 +156,7 @@ void TextEngine::InsertView( TextView* pTextView )
void TextEngine::RemoveView( TextView* pTextView )
{
- USHORT nPos = mpViews->GetPos( pTextView );
+ sal_uInt16 nPos = mpViews->GetPos( pTextView );
if( nPos != USHRT_MAX )
{
pTextView->HideCursor();
@@ -166,12 +166,12 @@ void TextEngine::RemoveView( TextView* pTextView )
}
}
-USHORT TextEngine::GetViewCount() const
+sal_uInt16 TextEngine::GetViewCount() const
{
return mpViews->Count();
}
-TextView* TextEngine::GetView( USHORT nView ) const
+TextView* TextEngine::GetView( sal_uInt16 nView ) const
{
return mpViews->GetObject( nView );
}
@@ -210,7 +210,7 @@ void TextEngine::SetFont( const Font& rFont )
// Wegen Selektion keinen Transparenten Font zulassen...
// (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...)
- maFont.SetTransparent( FALSE );
+ maFont.SetTransparent( sal_False );
// Tell VCL not to use the font color, use text color from OutputDevice
maFont.SetColor( COL_TRANSPARENT );
Color aFillColor( maFont.GetFillColor() );
@@ -225,10 +225,10 @@ void TextEngine::SetFont( const Font& rFont )
if ( !aTextSize.Width() )
aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) );
- mnDefTab = (USHORT)aTextSize.Width();
+ mnDefTab = (sal_uInt16)aTextSize.Width();
if ( !mnDefTab )
mnDefTab = 1;
- mnCharHeight = (USHORT)aTextSize.Height();
+ mnCharHeight = (sal_uInt16)aTextSize.Height();
/*
// #93746# Doesn't work with CJK HalfWidth/FullWidth
FontMetric aRealFont( mpRefDev->GetFontMetric() );
@@ -236,7 +236,7 @@ void TextEngine::SetFont( const Font& rFont )
{
String aX100;
aX100.Fill( 100, 'X' );
- mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 );
+ mnFixCharWidth100 = (sal_uInt16)mpRefDev->GetTextWidth( aX100 );
}
else
*/
@@ -245,7 +245,7 @@ void TextEngine::SetFont( const Font& rFont )
FormatFullDoc();
UpdateViews();
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) );
@@ -253,22 +253,22 @@ void TextEngine::SetFont( const Font& rFont )
}
}
-void TextEngine::SetDefTab( USHORT nDefTab )
+void TextEngine::SetDefTab( sal_uInt16 nDefTab )
{
mnDefTab = nDefTab;
// evtl neu setzen?
}
-void TextEngine::SetMaxTextLen( ULONG nLen )
+void TextEngine::SetMaxTextLen( sal_uLong nLen )
{
mnMaxTextLen = nLen;
}
-void TextEngine::SetMaxTextWidth( ULONG nMaxWidth )
+void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth )
{
if ( nMaxWidth != mnMaxTextWidth )
{
- mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF );
+ mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF );
FormatFullDoc();
UpdateViews();
}
@@ -304,14 +304,14 @@ String TextEngine::GetText( LineEnd aSeparator ) const
String TextEngine::GetTextLines( LineEnd aSeparator ) const
{
String aText;
- ULONG nParas = mpTEParaPortions->Count();
+ sal_uLong nParas = mpTEParaPortions->Count();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nP = 0; nP < nParas; nP++ )
+ for ( sal_uLong nP = 0; nP < nParas; nP++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- for ( USHORT nL = 0; nL < nLines; nL++ )
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ for ( sal_uInt16 nL = 0; nL < nLines; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines()[nL];
aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() );
@@ -322,17 +322,17 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const
return aText;
}
-String TextEngine::GetText( ULONG nPara ) const
+String TextEngine::GetText( sal_uLong nPara ) const
{
return mpDoc->GetText( nPara );
}
-ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( LineEnd aSeparator ) const
{
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) );
}
-ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
{
TextSelection aSel( rSel );
aSel.Justify();
@@ -340,12 +340,12 @@ ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) co
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
}
-USHORT TextEngine::GetTextLen( ULONG nPara ) const
+sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const
{
return mpDoc->GetNodes().GetObject( nPara )->GetText().Len();
}
-void TextEngine::SetUpdateMode( BOOL bUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUpdate )
{
if ( bUpdate != mbUpdate )
{
@@ -359,9 +359,9 @@ void TextEngine::SetUpdateMode( BOOL bUpdate )
}
}
-BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
{
- BOOL bDoesMove = FALSE;
+ sal_Bool bDoesMove = sal_False;
switch ( rKeyEvent.GetKeyCode().GetCode() )
{
@@ -375,16 +375,16 @@ BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
case KEY_PAGEDOWN:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesMove = TRUE;
+ bDoesMove = sal_True;
}
break;
}
return bDoesMove;
}
-BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
{
- BOOL bDoesChange = FALSE;
+ sal_Bool bDoesChange = sal_False;
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
@@ -394,7 +394,7 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEYFUNC_UNDO:
case KEYFUNC_REDO:
case KEYFUNC_CUT:
- case KEYFUNC_PASTE: bDoesChange = TRUE;
+ case KEYFUNC_PASTE: bDoesChange = sal_True;
break;
default: // wird dann evtl. unten bearbeitet.
eFunc = KEYFUNC_DONTKNOW;
@@ -408,14 +408,14 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEY_BACKSPACE:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
case KEY_RETURN:
case KEY_TAB:
{
if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
default:
@@ -427,15 +427,15 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
return bDoesChange;
}
-BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
{
if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 &&
KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#:
KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately
{
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void TextEngine::ImpInitDoc()
@@ -452,9 +452,9 @@ void TextEngine::ImpInitDoc()
mpDoc->GetNodes().Insert( pNode, 0 );
TEParaPortion* pIniPortion = new TEParaPortion( pNode );
- mpTEParaPortions->Insert( pIniPortion, (ULONG)0 );
+ mpTEParaPortions->Insert( pIniPortion, (sal_uLong)0 );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
ImpParagraphRemoved( TEXT_PARA_ALL );
ImpParagraphInserted( 0 );
@@ -470,15 +470,15 @@ String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) cons
TextSelection aSel( rSel );
aSel.Justify();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
+ for ( sal_uLong nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nNode == nStartPara )
nStartPos = aSel.GetStart().GetIndex();
if ( nNode == nEndPara ) // kann auch == nStart sein!
@@ -497,7 +497,7 @@ void TextEngine::ImpRemoveText()
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -509,9 +509,9 @@ void TextEngine::SetText( const XubString& rText )
{
ImpRemoveText();
- BOOL bUndoCurrentlyEnabled = IsUndoEnabled();
+ sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled();
// Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden.
- EnableUndo( FALSE );
+ EnableUndo( sal_False );
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
@@ -520,7 +520,7 @@ void TextEngine::SetText( const XubString& rText )
if ( rText.Len() )
aPaM = ImpInsertText( aEmptySel, rText );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -541,7 +541,7 @@ void TextEngine::SetText( const XubString& rText )
}
-void TextEngine::CursorMoved( ULONG nNode )
+void TextEngine::CursorMoved( sal_uLong nNode )
{
// Leere Attribute loeschen, aber nur, wenn Absatz nicht leer!
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -549,7 +549,7 @@ void TextEngine::CursorMoved( ULONG nNode )
pNode->GetCharAttribs().DeleteEmptyAttribs();
}
-void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* )
+void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* )
{
DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" );
if ( IsUndoEnabled() && !IsInUndo() )
@@ -559,9 +559,9 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
// Pruefen, ob Attribute geloescht oder geaendert werden:
- USHORT nStart = rPaM.GetIndex();
- USHORT nEnd = nStart + nChars;
- for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; )
+ sal_uInt16 nStart = rPaM.GetIndex();
+ sal_uInt16 nEnd = nStart + nChars;
+ for ( sal_uInt16 nAttr = pNode->GetCharAttribs().Count(); nAttr; )
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr );
if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) )
@@ -583,7 +583,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars );
}
-TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight )
+TextPaM TextEngine::ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight )
{
DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" );
@@ -627,11 +627,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" );
DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" );
- ULONG nStartNode = aStartPaM.GetPara();
- ULONG nEndNode = aEndPaM.GetPara();
+ sal_uLong nStartNode = aStartPaM.GetPara();
+ sal_uLong nEndNode = aEndPaM.GetPara();
// Alle Nodes dazwischen entfernen....
- for ( ULONG z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ )
{
// Immer nStartNode+1, wegen Remove()!
ImpRemoveParagraph( nStartNode+1 );
@@ -641,7 +641,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
{
// Den Rest des StartNodes...
TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode );
- USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
+ sal_uInt16 nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
if ( nChars )
{
ImpRemoveChars( aStartPaM, nChars );
@@ -668,7 +668,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
}
else
{
- USHORT nChars;
+ sal_uInt16 nChars;
nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
ImpRemoveChars( aStartPaM, nChars );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
@@ -681,7 +681,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
return aStartPaM;
}
-void TextEngine::ImpRemoveParagraph( ULONG nPara )
+void TextEngine::ImpRemoveParagraph( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
@@ -715,14 +715,14 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque
return xISC;
}
-BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
+sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
{
uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator();
SvtCTLOptions aCTLOptions;
// get the index that really is first
- USHORT nFirstPos = rCurSel.GetStart().GetIndex();
- USHORT nMaxPos = rCurSel.GetEnd().GetIndex();
+ sal_uInt16 nFirstPos = rCurSel.GetStart().GetIndex();
+ sal_uInt16 nMaxPos = rCurSel.GetEnd().GetIndex();
if (nMaxPos < nFirstPos)
nFirstPos = nMaxPos;
@@ -735,12 +735,12 @@ BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelec
return bIsSequenceChecking;
}
-TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite )
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, sal_Bool bOverwrite )
{
return ImpInsertText( c, rCurSel, bOverwrite, sal_False );
}
-TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, BOOL bOverwrite, BOOL bIsUserInput )
+TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bOverwrite, sal_Bool bIsUserInput )
{
DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" );
DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" );
@@ -750,13 +750,13 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( pNode->GetText().Len() < STRING_MAXLEN )
{
- BOOL bDoOverwrite = ( bOverwrite &&
- ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE;
+ sal_Bool bDoOverwrite = ( bOverwrite &&
+ ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False;
- BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
+ sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
if ( bUndoAction )
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
if ( rCurSel.HasRange() )
{
@@ -803,7 +803,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
String aChgText( aNewText.copy( nChgPos ), nChgLen );
// select text from first pos to be changed to current pos
- TextSelection aSel( TextPaM( aPaM.GetPara(), (USHORT) nChgPos ), aPaM );
+ TextSelection aSel( TextPaM( aPaM.GetPara(), (sal_uInt16) nChgPos ), aPaM );
if (aChgText.Len())
// ImpInsertText implicitly handles undo...
@@ -826,7 +826,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( IsUndoEnabled() && !IsInUndo() )
{
TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c );
- BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE;
+ sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False;
InsertUndo( pNewUndo, bTryMerge );
}
@@ -840,7 +840,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextModified();
if ( bUndoAction )
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
}
return aPaM;
@@ -849,7 +849,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
{
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
TextPaM aPaM;
@@ -861,21 +861,21 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
XubString aText( rStr );
aText.ConvertLineEnd( LINEEND_LF );
- USHORT nStart = 0;
+ sal_uInt16 nStart = 0;
while ( nStart < aText.Len() )
{
- USHORT nEnd = aText.Search( LINE_SEP, nStart );
+ sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart );
if ( nEnd == STRING_NOTFOUND )
nEnd = aText.Len(); // nicht dereferenzieren!
// Start == End => Leerzeile
if ( nEnd > nStart )
{
- ULONG nL = aPaM.GetIndex();
+ sal_uLong nL = aPaM.GetIndex();
nL += ( nEnd-nStart );
if ( nL > STRING_MAXLEN )
{
- USHORT nDiff = (USHORT) (nL-STRING_MAXLEN);
+ sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN);
nEnd = nEnd - nDiff;
}
@@ -901,13 +901,13 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
break;
}
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
TextModified();
return aPaM;
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, sal_Bool bKeepEndingAttribs )
{
TextPaM aPaM;
if ( rCurSel.HasRange() )
@@ -918,13 +918,13 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeep
return ImpInsertParaBreak( aPaM, bKeepEndingAttribs );
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) );
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
- BOOL bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
+ sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) );
@@ -946,9 +946,9 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAtt
return aPaM;
}
-Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
+Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: PaMtoEditCursor" );
Rectangle aEditCursor;
long nY = 0;
@@ -959,7 +959,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
}
else
{
- for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion);
nY += pPortion->GetLines().Count() * mnCharHeight;
@@ -972,7 +972,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
return aEditCursor;
}
-Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart )
+Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart )
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -993,9 +993,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
*/
long nY = 0;
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
TextLine* pLine = 0;
- for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) )
@@ -1029,21 +1029,21 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
return aEditCursor;
}
-long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart )
+long TextEngine::ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart )
{
DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos muss richtig gerufen werden!" );
- BOOL bDoPreferPortionStart = bPreferPortionStart;
+ sal_Bool bDoPreferPortionStart = bPreferPortionStart;
// Assure that the portion belongs to this line:
if ( nIndex == pLine->GetStart() )
- bDoPreferPortionStart = TRUE;
+ bDoPreferPortionStart = sal_True;
else if ( nIndex == pLine->GetEnd() )
- bDoPreferPortionStart = FALSE;
+ bDoPreferPortionStart = sal_False;
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " );
@@ -1074,7 +1074,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
// nX += pNextPortion->GetWidth();
// End of the tab portion, use start of next for cursor pos
DBG_ASSERT( !bPreferPortionStart, "ImpGetXPos - How can we this tab portion here???" );
- nX = ImpGetXPos( nPara, pLine, nIndex, TRUE );
+ nX = ImpGetXPos( nPara, pLine, nIndex, sal_True );
}
}
@@ -1110,7 +1110,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
return nX;
}
-const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextAttrib* pAttr = NULL;
const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich );
@@ -1119,7 +1119,7 @@ const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) c
return pAttr;
}
-const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextCharAttrib* pAttr = NULL;
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
@@ -1128,10 +1128,10 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nW
return pAttr;
}
-BOOL TextEngine::HasAttrib( USHORT nWhich ) const
+sal_Bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const
{
- BOOL bAttr = FALSE;
- for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; )
+ sal_Bool bAttr = sal_False;
+ for ( sal_uLong n = mpDoc->GetNodes().Count(); --n && !bAttr; )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( n );
bAttr = pNode->GetCharAttribs().HasAttrib( nWhich );
@@ -1139,12 +1139,12 @@ BOOL TextEngine::HasAttrib( USHORT nWhich ) const
return bAttr;
}
-TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
+TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: GetPaM" );
long nY = 0;
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight;
@@ -1162,21 +1162,21 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
}
// Nicht gefunden - Dann den letzten sichtbare...
- ULONG nLastNode = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nLastNode = mpDoc->GetNodes().Count() - 1;
TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode );
return TextPaM( nLastNode, pLast->GetText().Len() );
}
-USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart )
+sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart )
{
DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
long nY = 0;
TextLine* pLine = 0;
- USHORT nLine;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
@@ -1196,24 +1196,24 @@ USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL b
{
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
sal_Int32 nCount = 1;
- nCurIndex = (USHORT)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
+ nCurIndex = (sal_uInt16)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
}
return nCurIndex;
}
-USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
+sal_uInt16 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nXPos, sal_Bool )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
TextLine* pLine = pPortion->GetLines().GetObject( nLine );
- USHORT nCurIndex = pLine->GetStart();
+ sal_uInt16 nCurIndex = pLine->GetStart();
long nTmpX = pLine->GetStartX();
if ( nXPos <= nTmpX )
return nCurIndex;
- for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i );
nTmpX += pTextPortion->GetWidth();
@@ -1241,9 +1241,9 @@ USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
}
-ULONG TextEngine::GetTextHeight() const
+sal_uLong TextEngine::GetTextHeight() const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1251,9 +1251,9 @@ ULONG TextEngine::GetTextHeight() const
return mnCurTextHeight;
}
-ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1261,15 +1261,15 @@ ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
return CalcParaHeight( nParagraph );
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara )
{
- ULONG nParaWidth = 0;
+ sal_uLong nParaWidth = 0;
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT nLine = pPortion->GetLines().Count(); nLine; )
+ for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; )
{
- ULONG nLineWidth = 0;
+ sal_uLong nLineWidth = 0;
TextLine* pLine = pPortion->GetLines().GetObject( --nLine );
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP );
nLineWidth += pTextPortion->GetWidth();
@@ -1280,7 +1280,7 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara )
return nParaWidth;
}
-ULONG TextEngine::CalcTextWidth()
+sal_uLong TextEngine::CalcTextWidth()
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -1288,9 +1288,9 @@ ULONG TextEngine::CalcTextWidth()
if ( mnCurTextWidth == 0xFFFFFFFF )
{
mnCurTextWidth = 0;
- for ( ULONG nPara = mpTEParaPortions->Count(); nPara; )
+ for ( sal_uLong nPara = mpTEParaPortions->Count(); nPara; )
{
- ULONG nParaWidth = CalcTextWidth( --nPara );
+ sal_uLong nParaWidth = CalcTextWidth( --nPara );
if ( nParaWidth > mnCurTextWidth )
mnCurTextWidth = nParaWidth;
}
@@ -1298,25 +1298,25 @@ ULONG TextEngine::CalcTextWidth()
return mnCurTextWidth+1;// Ein breiter, da in CreateLines bei >= umgebrochen wird.
}
-ULONG TextEngine::CalcTextHeight()
+sal_uLong TextEngine::CalcTextHeight()
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: CalcTextHeight" );
- ULONG nY = 0;
- for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; )
+ sal_uLong nY = 0;
+ for ( sal_uLong nPortion = mpTEParaPortions->Count(); nPortion; )
nY += CalcParaHeight( --nPortion );
return nY;
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nLen, const Font* pFont )
{
// Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben!
DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" );
- ULONG nWidth;
+ sal_uLong nWidth;
if ( mnFixCharWidth100 )
{
- nWidth = (ULONG)nLen*mnFixCharWidth100/100;
+ nWidth = (sal_uLong)nLen*mnFixCharWidth100/100;
}
else
{
@@ -1332,14 +1332,14 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen,
mpRefDev->SetFont( aFont );
}
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
+ nWidth = (sal_uLong)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
}
return nWidth;
}
-USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
+sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1350,7 +1350,7 @@ USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
return 0xFFFF;
}
-USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
+sal_uInt16 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1364,9 +1364,9 @@ USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
return 0xFFFF;
}
-ULONG TextEngine::CalcParaHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const
{
- ULONG nHeight = 0;
+ sal_uLong nHeight = 0;
TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" );
@@ -1380,12 +1380,12 @@ void TextEngine::UpdateSelections()
{
}
-Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
+Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- USHORT nLastInvalid, nFirstInvalid = 0;
- USHORT nLine;
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nLastInvalid, nFirstInvalid = 0;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine );
@@ -1409,12 +1409,12 @@ Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 );
}
-ULONG TextEngine::GetParagraphCount() const
+sal_uLong TextEngine::GetParagraphCount() const
{
return mpDoc->GetNodes().Count();
}
-void TextEngine::EnableUndo( BOOL bEnable )
+void TextEngine::EnableUndo( sal_Bool bEnable )
{
// Beim Umschalten des Modus Liste loeschen:
if ( bEnable != IsUndoEnabled() )
@@ -1423,14 +1423,14 @@ void TextEngine::EnableUndo( BOOL bEnable )
mbUndoEnabled = bEnable;
}
-SfxUndoManager& TextEngine::GetUndoManager()
+::svl::IUndoManager& TextEngine::GetUndoManager()
{
if ( !mpUndoManager )
mpUndoManager = new TextUndoManager( this );
return *mpUndoManager;
}
-void TextEngine::UndoActionStart( USHORT nId )
+void TextEngine::UndoActionStart( sal_uInt16 nId )
{
if ( IsUndoEnabled() && !IsInUndo() )
{
@@ -1440,13 +1440,13 @@ void TextEngine::UndoActionStart( USHORT nId )
}
}
-void TextEngine::UndoActionEnd( USHORT )
+void TextEngine::UndoActionEnd()
{
if ( IsUndoEnabled() && !IsInUndo() )
GetUndoManager().LeaveListAction();
}
-void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge )
+void TextEngine::InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge )
{
DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" );
GetUndoManager().AddUndoAction( pUndo, bTryMerge );
@@ -1458,7 +1458,7 @@ void TextEngine::ResetUndo()
mpUndoManager->Clear();
}
-void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
+void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara )
{
DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " );
DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" );
@@ -1468,7 +1468,7 @@ void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
ImpParagraphInserted( nPara );
}
-TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
+TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_uInt16 nSepPos )
{
#ifdef DBG_UTIL
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -1480,21 +1480,21 @@ TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
return ImpInsertParaBreak( aPaM );
}
-TextPaM TextEngine::ConnectContents( ULONG nLeftNode )
+TextPaM TextEngine::ConnectContents( sal_uLong nLeftNode )
{
DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" );
return ImpConnectParagraphs( nLeftNode, nLeftNode+1 );
}
-void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice* pOutDev )
+void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev )
{
rFont = maFont;
if ( pOutDev )
pOutDev->SetTextColor( maTextColor );
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
if ( pAttrib->GetStart() > nPos )
@@ -1542,7 +1542,7 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
- rFont.SetTransparent( FALSE );
+ rFont.SetTransparent( sal_False );
}
else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
{
@@ -1553,9 +1553,9 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
}
}
-void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate )
{
- BOOL bChanged = ( GetUpdateMode() != bUp );
+ sal_Bool bChanged = ( GetUpdateMode() != bUp );
mbUpdate = bUp;
if ( mbUpdate && ( bChanged || bForceUpdate ) )
@@ -1577,15 +1577,15 @@ void TextEngine::FormatAndUpdate( TextView* pCurView )
}
-void TextEngine::IdleFormatAndUpdate( TextView* pCurView, USHORT nMaxTimerRestarts )
+void TextEngine::IdleFormatAndUpdate( TextView* pCurView, sal_uInt16 nMaxTimerRestarts )
{
mpIdleFormatter->DoIdleFormat( pCurView, nMaxTimerRestarts );
}
void TextEngine::TextModified()
{
- mbFormatted = FALSE;
- mbModified = TRUE;
+ mbFormatted = sal_False;
+ mbModified = sal_True;
}
void TextEngine::UpdateViews( TextView* pCurView )
@@ -1595,7 +1595,7 @@ void TextEngine::UpdateViews( TextView* pCurView )
DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->HideCursor();
@@ -1640,12 +1640,12 @@ void TextEngine::CheckIdleFormatter()
void TextEngine::FormatFullDoc()
{
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
- TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); USHORT nLen = pTEParaPortion->GetNode()->GetText().Len();
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); sal_uInt16 nLen = pTEParaPortion->GetNode()->GetText().Len();
pTEParaPortion->MarkSelectionInvalid( 0, nLen );
}
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatDoc();
}
@@ -1654,26 +1654,26 @@ void TextEngine::FormatDoc()
if ( IsFormatted() || !GetUpdateMode() || IsFormatting() )
return;
- mbIsFormatting = TRUE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_True;
+ mbHasMultiLineParas = sal_False;
long nY = 0;
- BOOL bGrow = FALSE;
+ sal_Bool bGrow = sal_False;
maInvalidRec = Rectangle(); // leermachen
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
if ( pTEParaPortion->IsInvalid() )
{
- ULONG nOldParaWidth = 0xFFFFFFFF;
+ sal_uLong nOldParaWidth = 0xFFFFFFFF;
if ( mnCurTextWidth != 0xFFFFFFFF )
nOldParaWidth = CalcTextWidth( nPara );
ImpFormattingParagraph( nPara );
if ( CreateLines( nPara ) )
- bGrow = TRUE;
+ bGrow = sal_True;
// InvalidRec nur einmal setzen...
if ( maInvalidRec.IsEmpty() )
@@ -1693,7 +1693,7 @@ void TextEngine::FormatDoc()
if ( mnCurTextWidth != 0xFFFFFFFF )
{
- ULONG nNewParaWidth = CalcTextWidth( nPara );
+ sal_uLong nNewParaWidth = CalcTextWidth( nPara );
if ( nNewParaWidth >= mnCurTextWidth )
mnCurTextWidth = nNewParaWidth;
else if ( ( nOldParaWidth != 0xFFFFFFFF ) && ( nOldParaWidth >= mnCurTextWidth ) )
@@ -1706,12 +1706,12 @@ void TextEngine::FormatDoc()
}
nY += CalcParaHeight( nPara );
if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 )
- mbHasMultiLineParas = TRUE;
+ mbHasMultiLineParas = sal_True;
}
if ( !maInvalidRec.IsEmpty() )
{
- ULONG nNewHeight = CalcTextHeight();
+ sal_uLong nNewHeight = CalcTextHeight();
long nDiff = nNewHeight - mnCurTextHeight;
if ( nNewHeight < mnCurTextHeight )
{
@@ -1728,18 +1728,18 @@ void TextEngine::FormatDoc()
mnCurTextHeight = nNewHeight;
if ( nDiff )
{
- mbFormatted = TRUE;
+ mbFormatted = sal_True;
ImpTextHeightChanged();
}
}
- mbIsFormatting = FALSE;
- mbFormatted = TRUE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_True;
ImpTextFormatted();
}
-void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
+void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
@@ -1756,31 +1756,31 @@ void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
else
pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
- BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE;
+ sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False;
TETextPortion* pDummyPortion = new TETextPortion( 0 );
pDummyPortion->GetWidth() = 0;
pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
{
// -2: Die neue ist bereits eingefuegt.
#ifdef DBG_UTIL
TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 );
DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" );
#endif
- USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ;
+ sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().Count() - 1 ;
pTmpLine->SetStartPortion( nPos );
pTmpLine->SetEndPortion( nPos );
}
}
-void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USHORT nPortionStart, long nRemainingWidth )
+void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, sal_uInt16 nPortionStart, long nRemainingWidth )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
// Font sollte noch eingestellt sein.
- USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
+ sal_uInt16 nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" );
@@ -1799,7 +1799,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
static const com::sun::star::lang::Locale aDefLocale;
i18n::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, aDefLocale, pLine->GetStart(), aHyphOptions, aUserOptions );
- USHORT nBreakPos = (USHORT)aLBR.breakIndex;
+ sal_uInt16 nBreakPos = (sal_uInt16)aLBR.breakIndex;
if ( nBreakPos <= pLine->GetStart() )
{
nBreakPos = nMaxBreakPos;
@@ -1810,7 +1810,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
// die angeknackste Portion ist die End-Portion
pLine->SetEnd( nBreakPos );
- USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos );
+ sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos );
sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) &&
( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False;
@@ -1825,7 +1825,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
pLine->SetEndPortion( nEndPortion );
}
-USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
+sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos )
{
// Die Portion bei nPos wird geplittet, wenn bei nPos nicht
@@ -1833,11 +1833,11 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
if ( nPos == 0 )
return 0;
- USHORT nSplitPortion;
- USHORT nTmpPos = 0;
+ sal_uInt16 nSplitPortion;
+ sal_uInt16 nTmpPos = 0;
TETextPortion* pTextPortion = 0;
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ )
{
TETextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion);
@@ -1853,7 +1853,7 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" );
- USHORT nOverlapp = nTmpPos - nPos;
+ sal_uInt16 nOverlapp = nTmpPos - nPos;
pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp;
TETextPortion* pNewPortion = new TETextPortion( nOverlapp );
pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 );
@@ -1862,18 +1862,18 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
return nSplitPortion;
}
-void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
+void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
TextNode* pNode = pTEParaPortion->GetNode();
DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" );
TESortedPositions aPositions;
- ULONG nZero = 0;
+ sal_uLong nZero = 0;
aPositions.Insert( nZero );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
@@ -1885,7 +1885,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
aPositions.Insert( pNode->GetText().Len() );
const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos();
- for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ )
+ for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ )
aPositions.Insert( rWritingDirections[nD].nStartPos );
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
@@ -1901,7 +1901,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
}
}
- USHORT nTabPos = pNode->GetText().Search( '\t', 0 );
+ sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 );
while ( nTabPos != STRING_NOTFOUND )
{
aPositions.Insert( nTabPos );
@@ -1912,9 +1912,9 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Ab ... loeschen:
// Leider muss die Anzahl der TextPortions mit aPositions.Count()
// nicht uebereinstimmen, da evtl. Zeilenumbrueche...
- USHORT nPortionStart = 0;
- USHORT nInvPortion = 0;
- USHORT nP;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nInvPortion = 0;
+ sal_uInt16 nP;
for ( nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ )
{
TETextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP);
@@ -1940,15 +1940,15 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Eine Portion kann auch durch einen Zeilenumbruch entstanden sein:
aPositions.Insert( nPortionStart );
- USHORT nInvPos;
+ sal_uInt16 nInvPos;
#ifdef DBG_UTIL
- BOOL bFound =
+ sal_Bool bFound =
#endif
aPositions.Seek_Entry( nPortionStart, &nInvPos );
DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" );
- for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ )
+ for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ )
{
- TETextPortion* pNew = new TETextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] );
+ TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] );
pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count());
}
@@ -1958,7 +1958,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
#endif
}
-void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars )
+void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" );
@@ -1976,7 +1976,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) ||
( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) )
{
- USHORT nNewPortionPos = 0;
+ sal_uInt16 nNewPortionPos = 0;
if ( nStartPos )
nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1;
// else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) &&
@@ -1989,7 +1989,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
!pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() )
{
// Dann die leere Portion verwenden.
- USHORT & r =
+ sal_uInt16 & r =
pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen();
r = r + nNewChars;
}
@@ -2001,8 +2001,8 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
}
else
{
- USHORT nPortionStart;
- const USHORT nTP = pTEParaPortion->GetTextPortions().
+ sal_uInt16 nPortionStart;
+ const sal_uInt16 nTP = pTEParaPortion->GetTextPortions().
FindPortion( nStartPos, nPortionStart );
TETextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ];
DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" );
@@ -2018,10 +2018,10 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
// Es darf keine reinragende oder im Bereich startende Portion geben,
// also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein
- USHORT nPortion = 0;
- USHORT nPos = 0;
- USHORT nEnd = nStartPos-nNewChars;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortion = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nEnd = nStartPos-nNewChars;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
TETextPortion* pTP = 0;
for ( nPortion = 0; nPortion < nPortions; nPortion++ )
{
@@ -2072,7 +2072,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM const* pSelEnd = 0;
if ( pSelection && pSelection->HasRange() )
{
- BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart();
+ sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart();
pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
}
@@ -2083,23 +2083,23 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// --------------------------------------------------
// Ueber alle Absaetze...
// --------------------------------------------------
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
// falls beim Tippen Idle-Formatierung, asynchrones Paint.
if ( pPortion->IsInvalid() )
return;
- ULONG nParaHeight = CalcParaHeight( nPara );
+ sal_uLong nParaHeight = CalcParaHeight( nPara );
if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) )
&& ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) )
{
// --------------------------------------------------
// Ueber die Zeilen des Absatzes...
// --------------------------------------------------
- USHORT nLines = pPortion->GetLines().Count();
- USHORT nIndex = 0;
- for ( USHORT nLine = 0; nLine < nLines; nLine++ )
+ sal_uInt16 nLines = pPortion->GetLines().Count();
+ sal_uInt16 nIndex = 0;
+ for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pLine = pPortion->GetLines().GetObject(nLine);
Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY );
@@ -2113,7 +2113,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// Ueber die Portions der Zeile...
// --------------------------------------------------
nIndex = pLine->GetStart();
- for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
+ for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
{
DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y );
@@ -2138,13 +2138,13 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
Font aFont;
SeekCursor( nPara, nIndex+1, aFont, pOutDev );
if( bTransparent )
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
else if ( pSelection )
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
pOutDev->SetFont( aFont );
- USHORT nTmpIndex = nIndex;
- USHORT nEnd = nTmpIndex + pTextPortion->GetLen();
+ sal_uInt16 nTmpIndex = nIndex;
+ sal_uInt16 nEnd = nTmpIndex + pTextPortion->GetLen();
Point aPos = aTmpPos;
if ( pPaintRange )
{
@@ -2161,7 +2161,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt ein Teil in der Selektion???
@@ -2169,7 +2169,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM aTextEnd( nPara, nEnd );
if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
{
- USHORT nL;
+ sal_uInt16 nL;
// 1) Bereich vor Selektion
if ( aTextStart < *pSelStart )
@@ -2204,7 +2204,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2222,7 +2222,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
if ( pSelStart || pPaintRange )
{
Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt der Tab in der Selektion???
@@ -2234,7 +2234,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
pOutDev->DrawRect( aTabArea );
pOutDev->SetFillColor( aOldColor );
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2275,15 +2275,15 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
-BOOL TextEngine::CreateLines( ULONG nPara )
+sal_Bool TextEngine::CreateLines( sal_uLong nPara )
{
- // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE
+ // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" );
- USHORT nOldLineCount = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count();
// ---------------------------------------------------------------
// Schnelle Sonderbehandlung fuer leere Absaetze...
@@ -2311,9 +2311,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
const short nInvalidDiff = pTEParaPortion->GetInvalidDiff();
- const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart();
- const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
- BOOL bQuickFormat = FALSE;
+ const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart();
+ const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
+ sal_Bool bQuickFormat = sal_False;
if ( !pTEParaPortion->GetWritingDirectionInfos().Count() )
ImpInitWritingDirections( nPara );
@@ -2322,24 +2322,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) )
{
- bQuickFormat = TRUE;
+ bQuickFormat = sal_True;
}
else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
{
// pruefen, ob loeschen ueber Portiongrenzen erfolgte...
- USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
- USHORT nEnd = nStart - nInvalidDiff; // neg.
- bQuickFormat = TRUE;
- USHORT nPos = 0;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
- for ( USHORT nTP = 0; nTP < nPortions; nTP++ )
+ sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
+ sal_uInt16 nEnd = nStart - nInvalidDiff; // neg.
+ bQuickFormat = sal_True;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
+ for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ )
{
// Es darf kein Start/Ende im geloeschten Bereich liegen.
TETextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP );
nPos = nPos + pTP->GetLen();
if ( ( nPos > nStart ) && ( nPos < nEnd ) )
{
- bQuickFormat = FALSE;
+ bQuickFormat = sal_False;
break;
}
}
@@ -2356,8 +2356,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Zeilen flaggen => nicht removen !
// ---------------------------------------------------------------
- USHORT nLine = pTEParaPortion->GetLines().Count()-1;
- for ( USHORT nL = 0; nL <= nLine; nL++ )
+ sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1;
+ for ( sal_uInt16 nL = 0; nL <= nLine; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL );
if ( pLine->GetEnd() > nInvalidStart )
@@ -2377,24 +2377,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// ---------------------------------------------------------------
// Ab hier alle Zeilen durchformatieren...
// ---------------------------------------------------------------
- USHORT nDelFromLine = 0xFFFF;
- BOOL bLineBreak = FALSE;
+ sal_uInt16 nDelFromLine = 0xFFFF;
+ sal_Bool bLineBreak = sal_False;
- USHORT nIndex = pLine->GetStart();
+ sal_uInt16 nIndex = pLine->GetStart();
TextLine aSaveLine( *pLine );
Font aFont;
- BOOL bCalcPortion = TRUE;
+ sal_Bool bCalcPortion = sal_True;
while ( nIndex < pNode->GetText().Len() )
{
- BOOL bEOL = FALSE;
- USHORT nPortionStart = 0;
- USHORT nPortionEnd = 0;
+ sal_Bool bEOL = sal_False;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nPortionEnd = 0;
- USHORT nTmpPos = nIndex;
- USHORT nTmpPortion = pLine->GetStartPortion();
+ sal_uInt16 nTmpPos = nIndex;
+ sal_uInt16 nTmpPortion = pLine->GetStartPortion();
long nTmpWidth = mpDoc->GetLeftMargin();
// long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF;
// Margin nicht abziehen, ist schon in TmpWidth enthalten.
@@ -2404,8 +2404,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Portion suchen, die nicht mehr in Zeile passt....
TETextPortion* pPortion = 0;
- BOOL bBrokenLine = FALSE;
- bLineBreak = FALSE;
+ sal_Bool bBrokenLine = sal_False;
+ bLineBreak = sal_False;
while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) )
{
@@ -2424,8 +2424,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Aber was jetzt ? Tab passend machen!
pPortion->GetWidth() = nXWidth-1;
nTmpWidth = pPortion->GetWidth();
- bEOL = TRUE;
- bBrokenLine = TRUE;
+ bEOL = sal_True;
+ bBrokenLine = sal_True;
}
pPortion->GetKind() = PORTIONKIND_TAB;
}
@@ -2446,28 +2446,28 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
// das war evtl. eine Portion zu weit:
- BOOL bFixedEnd = FALSE;
+ sal_Bool bFixedEnd = sal_False;
if ( nTmpWidth > nXWidth )
{
nPortionEnd = nTmpPos;
nTmpPos = nTmpPos - pPortion->GetLen();
nPortionStart = nTmpPos;
nTmpPortion--;
- bEOL = FALSE;
+ bEOL = sal_False;
nTmpWidth -= pPortion->GetWidth();
if ( pPortion->GetKind() == PORTIONKIND_TAB )
{
- bEOL = TRUE;
- bFixedEnd = TRUE;
+ bEOL = sal_True;
+ bFixedEnd = sal_True;
}
}
else
{
- bEOL = TRUE;
+ bEOL = sal_True;
pLine->SetEnd( nPortionEnd );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" );
- pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 );
+ pLine->SetEndPortion( (sal_uInt16)pTEParaPortion->GetTextPortions().Count() - 1 );
}
if ( bFixedEnd )
@@ -2491,7 +2491,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
// Ausrichten...
long nTextWidth = 0;
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP );
nTextWidth += pTextPortion->GetWidth();
@@ -2500,9 +2500,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
if ( nSpace > 0 )
{
if ( ImpGetAlign() == TXTALIGN_CENTER )
- pLine->SetStartX( (USHORT)(nSpace / 2) );
+ pLine->SetStartX( (sal_uInt16)(nSpace / 2) );
else // TXTALIGN_RIGHT
- pLine->SetStartX( (USHORT)nSpace );
+ pLine->SetStartX( (sal_uInt16)nSpace );
}
}
else
@@ -2531,8 +2531,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
else
{
- USHORT nStart = pLine->GetStart();
- USHORT nEnd = pLine->GetEnd();
+ sal_uInt16 nStart = pLine->GetStart();
+ sal_uInt16 nEnd = pLine->GetEnd();
if ( nStart > nInvalidEnd )
{
@@ -2542,7 +2542,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
pLine->SetValid();
if ( bCalcPortion && bQuickFormat )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2556,7 +2556,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// textbreiten neu bestimmen:
if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2567,7 +2567,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende
// weil nEnd hinter das letzte Zeichen zeigt!
- USHORT nEndPortion = pLine->GetEndPortion();
+ sal_uInt16 nEndPortion = pLine->GetEndPortion();
// Naechste Zeile oder ggf. neue Zeile....
pLine = 0;
@@ -2598,7 +2598,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
CreateAndInsertEmptyLine( nPara );
pTEParaPortion->SetValid();
@@ -2615,8 +2615,8 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
- aSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() );
if ( pStartOfWord )
*pStartOfWord = aSel.GetStart();
@@ -2624,18 +2624,18 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
return aWord;
}
-BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
+sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
{
- BOOL bUpdate = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bUpdate = GetUpdateMode();
+ SetUpdateMode( sal_False );
- UndoActionStart( TEXTUNDO_READ );
+ UndoActionStart();
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel = TextPaM( nParas-1 , pNode->GetText().Len() );
}
@@ -2644,7 +2644,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpDeleteText( aSel );
ByteString aLine;
- BOOL bDone = rInput.ReadLine( aLine );
+ sal_Bool bDone = rInput.ReadLine( aLine );
String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr;
while ( bDone )
{
@@ -2655,7 +2655,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpInsertParaBreak( aSel.GetEnd() );
}
- UndoActionEnd( TEXTUNDO_READ );
+ UndoActionEnd();
TextSelection aNewSel( aSel.GetEnd(), aSel.GetEnd() );
@@ -2666,17 +2666,17 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
SetUpdateMode( bUpdate );
FormatAndUpdate( GetActiveView() );
- return rInput.GetError() ? FALSE : TRUE;
+ return rInput.GetError() ? sal_False : sal_True;
}
-BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML )
+sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bool bHTML )
{
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() );
@@ -2688,12 +2688,12 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "<BODY>" );
}
- for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nPara == aSel.GetStart().GetPara() )
nStartPos = aSel.GetStart().GetIndex();
if ( nPara == aSel.GetEnd().GetPara() )
@@ -2715,8 +2715,8 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
}
else
{
- USHORT nTmpStart = nStartPos;
- USHORT nTmpEnd = nEndPos;
+ sal_uInt16 nTmpStart = nStartPos;
+ sal_uInt16 nTmpEnd = nEndPos;
do
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos );
@@ -2753,22 +2753,22 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "</HTML>" );
}
- return rOutput.GetError() ? FALSE : TRUE;
+ return rOutput.GetError() ? sal_False : sal_True;
}
-void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode->GetCharAttribs().Count() )
{
- pNode->GetCharAttribs().Clear( TRUE );
+ pNode->GetCharAttribs().Clear( sal_True );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
@@ -2777,7 +2777,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
}
}
}
-void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2785,15 +2785,15 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 )->Which() == nWhich)
rAttribs.RemoveAttrib( nAttr -1 );
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if(bIdleFormatAndUpdate)
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2801,7 +2801,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
}
}
}
-void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
+void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2809,8 +2809,8 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 ) == &rAttrib)
{
@@ -2820,13 +2820,13 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatAndUpdate( NULL );
}
}
}
-void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate )
+void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate )
{
// Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen!
// Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile
@@ -2840,7 +2840,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nMax = pNode->GetText().Len();
+ sal_uInt16 nMax = pNode->GetText().Len();
if ( nStart > nMax )
nStart = nMax;
if ( nEnd > nMax )
@@ -2849,7 +2849,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) );
pTEParaPortion->MarkSelectionInvalid( nStart, nEnd );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2876,14 +2876,14 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const
void TextEngine::ValidatePaM( TextPaM& rPaM ) const
{
- ULONG nMaxPara = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nMaxPara = mpDoc->GetNodes().Count() - 1;
if ( rPaM.GetPara() > nMaxPara )
{
rPaM.GetPara() = nMaxPara;
rPaM.GetIndex() = 0xFFFF;
}
- USHORT nMaxIndex = GetTextLen( rPaM.GetPara() );
+ sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() );
if ( rPaM.GetIndex() > nMaxIndex )
rPaM.GetIndex() = nMaxIndex;
}
@@ -2891,18 +2891,18 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
// Status & Selektionsanpassung
-void TextEngine::ImpParagraphInserted( ULONG nPara )
+void TextEngine::ImpParagraphInserted( sal_uLong nPara )
{
// Die aktive View braucht nicht angepasst werden, aber bei allen
// passiven muss die Selektion angepasst werden:
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
-// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
+// sal_Bool bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
// TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
// TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd();
//
@@ -2922,16 +2922,16 @@ void TextEngine::ImpParagraphInserted( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) );
}
-void TextEngine::ImpParagraphRemoved( ULONG nPara )
+void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2950,16 +2950,16 @@ void TextEngine::ImpParagraphRemoved( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
}
-void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- USHORT nEnd = nPos+nChars;
+ sal_uInt16 nEnd = nPos+nChars;
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2977,11 +2977,11 @@ void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
@@ -3001,7 +3001,7 @@ void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpFormattingParagraph( ULONG nPara )
+void TextEngine::ImpFormattingParagraph( sal_uLong nPara )
{
Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) );
}
@@ -3021,12 +3021,12 @@ void TextEngine::Draw( OutputDevice* pDev, const Point& rPos )
ImpPaint( pDev, rPos, NULL );
}
-void TextEngine::SetLeftMargin( USHORT n )
+void TextEngine::SetLeftMargin( sal_uInt16 n )
{
mpDoc->SetLeftMargin( n );
}
-USHORT TextEngine::GetLeftMargin() const
+sal_uInt16 TextEngine::GetLeftMargin() const
{
return mpDoc->GetLeftMargin();
}
@@ -3063,7 +3063,7 @@ LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
return mpLocaleDataWrapper;
}
-void TextEngine::SetRightToLeft( BOOL bR2L )
+void TextEngine::SetRightToLeft( sal_Bool bR2L )
{
if ( mbRightToLeft != bR2L )
{
@@ -3074,7 +3074,7 @@ void TextEngine::SetRightToLeft( BOOL bR2L )
}
}
-void TextEngine::ImpInitWritingDirections( ULONG nPara )
+void TextEngine::ImpInitWritingDirections( sal_uLong nPara )
{
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
TEWritingDirectionInfos& rInfos = pParaPortion->GetWritingDirectionInfos();
@@ -3101,10 +3101,10 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
int32_t nEnd;
UBiDiLevel nCurrDir;
- for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
+ for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
- rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ), rInfos.Count() );
nStart = nEnd;
}
@@ -3113,13 +3113,13 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
// No infos mean no CTL and default dir is L2R...
if ( !rInfos.Count() )
- rInfos.Insert( TEWritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
}
-BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd )
+sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd )
{
- BYTE nRightToLeft = 0;
+ sal_uInt8 nRightToLeft = 0;
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode && pNode->GetText().Len() )
@@ -3129,7 +3129,7 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
ImpInitWritingDirections( nPara );
TEWritingDirectionInfos& rDirInfos = pParaPortion->GetWritingDirectionInfos();
- for ( USHORT n = 0; n < rDirInfos.Count(); n++ )
+ for ( sal_uInt16 n = 0; n < rDirInfos.Count(); n++ )
{
if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) )
{
@@ -3145,13 +3145,13 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
return nRightToLeft;
}
-long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion )
+long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion )
{
long nX = pLine->GetStartX();
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ )
{
TETextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i );
nX += pPortion->GetWidth();
@@ -3225,9 +3225,9 @@ long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTex
return nX;
}
-void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion )
+void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion )
{
- ULONG nLayoutMode = pOutDev->GetLayoutMode();
+ sal_uLong nLayoutMode = pOutDev->GetLayoutMode();
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
if ( bDrawingR2LPortion )
@@ -3249,12 +3249,12 @@ TxtAlign TextEngine::ImpGetAlign() const
return eAlign;
}
-long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 )
+long TextEngine::ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortionStart;
- USHORT nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, TRUE );
+ sal_uInt16 nPortionStart;
+ sal_uInt16 nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, sal_True );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nPortion );
@@ -3275,7 +3275,7 @@ long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex
nX = ImpGetXPos( nPara, pLine, nIndex, nIndex == nPortionStart );
if ( nIndex2 != nIndex )
{
- long nX2 = ImpGetXPos( nPara, pLine, nIndex2, FALSE );
+ long nX2 = ImpGetXPos( nPara, pLine, nIndex2, sal_False );
if ( ( !IsRightToLeft() && ( nX2 < nX ) ) ||
( IsRightToLeft() && ( nX2 > nX ) ) )
{
diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx
index b49619894670..63937c31e0e8 100644
--- a/svtools/source/edit/textund2.hxx
+++ b/svtools/source/edit/textund2.hxx
@@ -34,13 +34,13 @@
class TextUndoDelPara : public TextUndo
{
private:
- BOOL mbDelObject;
- ULONG mnPara;
+ sal_Bool mbDelObject;
+ sal_uLong mnPara;
TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
public:
TYPEINFO();
- TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara );
+ TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
~TextUndoDelPara();
virtual void Undo();
@@ -51,12 +51,12 @@ public:
class TextUndoConnectParas : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoConnectParas();
virtual void Undo();
@@ -67,12 +67,12 @@ public:
class TextUndoSplitPara : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoSplitPara();
virtual void Undo();
@@ -96,7 +96,7 @@ public:
virtual void Undo();
virtual void Redo();
- virtual BOOL Merge( SfxUndoAction *pNextAction );
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
};
@@ -124,9 +124,9 @@ private:
TextSelection maSelection;
// SfxItemSet aNewAttribs;
// TextInfoArray aPrevAttribs;
-// BYTE nSpecial;
-// BOOL bSetIsRemove;
-// USHORT nRemoveWhich;
+// sal_uInt8 nSpecial;
+// sal_Bool bSetIsRemove;
+// sal_uInt16 nRemoveWhich;
//
// void ImpSetSelection( TextView* pView );
@@ -138,9 +138,9 @@ public:
// TextInfoArray& GetTextInfos() { return aPrevAttribs; }
// SfxItemSet& GetNewAttribs() { return aNewAttribs; }
-// void SetSpecial( BYTE n ) { nSpecial = n; }
-// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; }
-// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; }
+// void SetSpecial( sal_uInt8 n ) { nSpecial = n; }
+// void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; }
+// void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; }
virtual void Undo();
virtual void Redo();
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
index fcecb59452f5..660c272397f5 100644
--- a/svtools/source/edit/textundo.cxx
+++ b/svtools/source/edit/textundo.cxx
@@ -55,33 +55,33 @@ TextUndoManager::~TextUndoManager()
{
}
-BOOL TextUndoManager::Undo( USHORT nCount )
+sal_Bool TextUndoManager::Undo()
{
if ( GetUndoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Undo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Undo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
return bDone;
}
-BOOL TextUndoManager::Redo( USHORT nCount )
+sal_Bool TextUndoManager::Redo()
{
if ( GetRedoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Redo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Redo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
@@ -111,9 +111,8 @@ void TextUndoManager::UndoRedoEnd()
}
-TextUndo::TextUndo( USHORT nI, TextEngine* p )
+TextUndo::TextUndo( TextEngine* p )
{
- mnId = nI;
mpTextEngine = p;
}
@@ -121,12 +120,6 @@ TextUndo::~TextUndo()
{
}
-USHORT TextUndo::GetId() const
-{
- //nId sollte mal entfallen => GetId ueberall ueberladen...
- return mnId;
-}
-
XubString TextUndo::GetComment() const
{
// return mpTextEngine->GetUndoComment( this );
@@ -140,12 +133,12 @@ void TextUndo::SetSelection( const TextSelection& rSel )
}
-TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara )
- : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine )
+TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara )
+ : TextUndo( pTextEngine )
{
mpNode = pNode;
mnPara = nPara;
- mbDelObject = TRUE;
+ mbDelObject = sal_True;
}
TextUndoDelPara::~TextUndoDelPara()
@@ -157,7 +150,7 @@ TextUndoDelPara::~TextUndoDelPara()
void TextUndoDelPara::Undo()
{
GetTextEngine()->InsertContent( mpNode, mnPara );
- mbDelObject = FALSE; // gehoert wieder der Engine
+ mbDelObject = sal_False; // gehoert wieder der Engine
if ( GetView() )
{
@@ -179,10 +172,10 @@ void TextUndoDelPara::Redo()
GetDoc()->GetNodes().Remove( mnPara );
GetTextEngine()->ImpParagraphRemoved( mnPara );
- mbDelObject = TRUE; // gehoert wieder dem Undo
+ mbDelObject = sal_True; // gehoert wieder dem Undo
- ULONG nParas = GetDoc()->GetNodes().Count();
- ULONG n = mnPara < nParas ? mnPara : (nParas-1);
+ sal_uLong nParas = GetDoc()->GetNodes().Count();
+ sal_uLong n = mnPara < nParas ? mnPara : (nParas-1);
TextNode* pN = GetDoc()->GetNodes().GetObject( n );
TextPaM aPaM( n, pN->GetText().Len() );
SetSelection( aPaM );
@@ -191,8 +184,8 @@ void TextUndoDelPara::Redo()
// -----------------------------------------------------------------------
// TextUndoConnectParas
// ------------------------------------------------------------------------
-TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine )
+TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -215,8 +208,8 @@ void TextUndoConnectParas::Redo()
}
-TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine )
+TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -240,7 +233,7 @@ void TextUndoSplitPara::Redo()
TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -262,27 +255,27 @@ void TextUndoInsertChars::Redo()
SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) );
}
-BOOL TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
+sal_Bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
if ( !pNextAction->ISA( TextUndoInsertChars ) )
- return FALSE;
+ return sal_False;
TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction;
if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() )
- return FALSE;
+ return sal_False;
if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() )
{
maText += pNext->maText;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -305,11 +298,11 @@ void TextUndoRemoveChars::Redo()
TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel )
- : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel )
+ : TextUndo( pTextEngine ), maSelection( rSel )
{
maSelection.Justify();
// aNewAttribs.Set( rNewItems );
-// mbSetIsRemove = FALSE;
+// mbSetIsRemove = sal_False;
// mnRemoveWhich = 0;
// mnSpecial = 0;
}
@@ -321,12 +314,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs()
void TextUndoSetAttribs::Undo()
{
- for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
{
-// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ];
+// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ];
// GetTextEngine()->RemoveCharAttribs( nPara );
// TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara );
-// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
+// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
// {
// GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() );
// }
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
index 414f2f1f5db2..b8189eaa9711 100644
--- a/svtools/source/edit/textundo.hxx
+++ b/svtools/source/edit/textundo.hxx
@@ -48,16 +48,15 @@ public:
~TextUndoManager();
using SfxUndoManager::Undo;
- virtual BOOL Undo( USHORT nCount=1 );
+ virtual sal_Bool Undo();
using SfxUndoManager::Redo;
- virtual BOOL Redo( USHORT nCount=1 );
+ virtual sal_Bool Redo();
};
class TextUndo : public SfxUndoAction
{
private:
- USHORT mnId;
TextEngine* mpTextEngine;
protected:
@@ -70,7 +69,7 @@ protected:
public:
TYPEINFO();
- TextUndo( USHORT nId, TextEngine* pTextEngine );
+ TextUndo( TextEngine* pTextEngine );
virtual ~TextUndo();
TextEngine* GetTextEngine() const { return mpTextEngine; }
@@ -79,7 +78,6 @@ public:
virtual void Redo() = 0;
virtual XubString GetComment() const;
- virtual USHORT GetId() const;
};
#endif // _TEXTUNDO_HXX
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
index 292cf03ce86a..f2b370a9a923 100644
--- a/svtools/source/edit/textview.cxx
+++ b/svtools/source/edit/textview.cxx
@@ -117,7 +117,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
{
uno::Any aAny;
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetText();
@@ -125,7 +125,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
else if ( nT == SOT_FORMATSTR_ID_HTML )
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- ULONG nLen = GetHTMLStream().Tell();
+ sal_uLong nLen = GetHTMLStream().Tell();
GetHTMLStream().Seek(0);
uno::Sequence< sal_Int8 > aSeq( nLen );
@@ -142,7 +142,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException)
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- BOOL bHTML = GetHTMLStream().Tell() > 0;
+ sal_Bool bHTML = GetHTMLStream().Tell() > 0;
uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 );
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] );
if ( bHTML )
@@ -152,7 +152,7 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo
sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
@@ -176,17 +176,17 @@ struct ImpTextView
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener;
- USHORT mnTravelXPos;
-
- BOOL mbAutoScroll : 1;
- BOOL mbInsertMode : 1;
- BOOL mbReadOnly : 1;
- BOOL mbPaintSelection : 1;
- BOOL mbAutoIndent : 1;
- BOOL mbHighlightSelection : 1;
- BOOL mbCursorEnabled : 1;
- BOOL mbClickedInSelection : 1;
- BOOL mbSupportProtectAttribute : 1;
+ sal_uInt16 mnTravelXPos;
+
+ sal_Bool mbAutoScroll : 1;
+ sal_Bool mbInsertMode : 1;
+ sal_Bool mbReadOnly : 1;
+ sal_Bool mbPaintSelection : 1;
+ sal_Bool mbAutoIndent : 1;
+ sal_Bool mbHighlightSelection : 1;
+ sal_Bool mbCursorEnabled : 1;
+ sal_Bool mbClickedInSelection : 1;
+ sal_Bool mbSupportProtectAttribute : 1;
bool mbCursorAtEndOfLine;
};
@@ -196,30 +196,30 @@ struct ImpTextView
TextView::TextView( TextEngine* pEng, Window* pWindow ) :
mpImpl(new ImpTextView)
{
- pWindow->EnableRTL( FALSE );
+ pWindow->EnableRTL( sal_False );
mpImpl->mpWindow = pWindow;
mpImpl->mpTextEngine = pEng;
mpImpl->mpVirtDev = NULL;
- mpImpl->mbPaintSelection = TRUE;
- mpImpl->mbAutoScroll = TRUE;
- mpImpl->mbInsertMode = TRUE;
- mpImpl->mbReadOnly = FALSE;
- mpImpl->mbHighlightSelection = FALSE;
- mpImpl->mbAutoIndent = FALSE;
- mpImpl->mbCursorEnabled = TRUE;
- mpImpl->mbClickedInSelection = FALSE;
- mpImpl->mbSupportProtectAttribute = FALSE;
+ mpImpl->mbPaintSelection = sal_True;
+ mpImpl->mbAutoScroll = sal_True;
+ mpImpl->mbInsertMode = sal_True;
+ mpImpl->mbReadOnly = sal_False;
+ mpImpl->mbHighlightSelection = sal_False;
+ mpImpl->mbAutoIndent = sal_False;
+ mpImpl->mbCursorEnabled = sal_True;
+ mpImpl->mbClickedInSelection = sal_False;
+ mpImpl->mbSupportProtectAttribute = sal_False;
mpImpl->mbCursorAtEndOfLine = false;
-// mbInSelection = FALSE;
+// mbInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelFuncSet = new TextSelFunctionSet( this );
mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet );
mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION );
- mpImpl->mpSelEngine->EnableDrag( TRUE );
+ mpImpl->mpSelEngine->EnableDrag( sal_True );
mpImpl->mpCursor = new Cursor;
mpImpl->mpCursor->Show();
@@ -227,7 +227,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) :
pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) );
if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT )
- mpImpl->mbHighlightSelection = TRUE;
+ mpImpl->mbHighlightSelection = sal_True;
pWindow->SetLineColor();
@@ -265,7 +265,7 @@ void TextView::Invalidate()
mpImpl->mpWindow->Invalidate();
}
-void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor )
+void TextView::SetSelection( const TextSelection& rTextSel, sal_Bool bGotoCursor )
{
// Falls jemand gerade ein leeres Attribut hinterlassen hat,
// und dann der Outliner die Selektion manipulitert:
@@ -301,9 +301,9 @@ void TextView::DeleteSelected()
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionEnd();
ImpSetSelection( aPaM );
mpImpl->mpTextEngine->FormatAndUpdate( this );
@@ -335,10 +335,10 @@ void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle c
void TextView::Paint( const Rectangle& rRect )
{
- ImpPaint( rRect, FALSE );
+ ImpPaint( rRect, sal_False );
}
-void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
+void TextView::ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev )
{
if ( !mpImpl->mpTextEngine->GetUpdateMode() || mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -357,7 +357,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
if ( pVDev->GetBackground().GetColor() != rBackgroundColor )
pVDev->SetBackground( rBackgroundColor );
- BOOL bVDevValid = TRUE;
+ sal_Bool bVDevValid = sal_True;
Size aOutSz( pVDev->GetOutputSizePixel() );
if ( ( aOutSz.Width() < rRect.GetWidth() ) ||
( aOutSz.Height() < rRect.GetHeight() ) )
@@ -380,7 +380,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
}
if ( !bVDevValid )
{
- ImpPaint( rRect, FALSE /* ohne VDev */ );
+ ImpPaint( rRect, sal_False /* ohne VDev */ );
return;
}
@@ -418,27 +418,27 @@ void TextView::ImpHighlight( const TextSelection& rSel )
Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() );
long nY = 0;
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
- for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ )
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
+ for ( sal_uLong nPara = 0; nPara <= nEndPara; nPara++ )
{
long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara );
if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) )
{
TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara );
- USHORT nStartLine = 0;
- USHORT nEndLine = pTEParaPortion->GetLines().Count() -1;
+ sal_uInt16 nStartLine = 0;
+ sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1;
if ( nPara == nStartPara )
- nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE );
+ nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False );
if ( nPara == nEndPara )
- nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE );
+ nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), sal_True );
// ueber die Zeilen iterieren....
- for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ )
+ for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine );
- USHORT nStartIndex = pLine->GetStart();
- USHORT nEndIndex = pLine->GetEnd();
+ sal_uInt16 nStartIndex = pLine->GetStart();
+ sal_uInt16 nEndIndex = pLine->GetEnd();
if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
nStartIndex = aSel.GetStart().GetIndex();
if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
@@ -448,12 +448,12 @@ void TextView::ImpHighlight( const TextSelection& rSel )
if ( nEndIndex < nStartIndex )
nEndIndex = nStartIndex;
- Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) );
+ Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), sal_False ) );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aTopLeft( aTmpRec.TopLeft() );
- aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE );
+ aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), sal_True );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aBottomRight( aTmpRec.BottomRight() );
@@ -489,20 +489,20 @@ void TextView::ImpSetSelection( const TextSelection& rSelection )
void TextView::ShowSelection()
{
- ImpShowHideSelection( TRUE );
+ ImpShowHideSelection( sal_True );
}
void TextView::HideSelection()
{
- ImpShowHideSelection( FALSE );
+ ImpShowHideSelection( sal_False );
}
void TextView::ShowSelection( const TextSelection& rRange )
{
- ImpShowHideSelection( TRUE, &rRange );
+ ImpShowHideSelection( sal_True, &rRange );
}
-void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
+void TextView::ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange )
{
const TextSelection* pRangeOrSelection = pRange ? pRange : &mpImpl->maSelection;
@@ -522,7 +522,7 @@ void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
Point aStartPos( ImpGetOutputStartPos( mpImpl->maStartDocPos ) );
TextSelection aRange( *pRangeOrSelection );
aRange.Justify();
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
ImpPaint( mpImpl->mpWindow, aStartPos, &aOutArea, &aRange, bShow ? &mpImpl->maSelection : NULL );
if ( bVisCursor )
@@ -548,24 +548,24 @@ void TextView::EraseVirtualDevice()
mpImpl->mpVirtDev = 0;
}
-BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
+sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent )
{
- BOOL bDone = TRUE;
- BOOL bModified = FALSE;
- BOOL bMoved = FALSE;
- BOOL bEndKey = FALSE; // spezielle CursorPosition
- BOOL bAllowIdle = TRUE;
+ sal_Bool bDone = sal_True;
+ sal_Bool bModified = sal_False;
+ sal_Bool bMoved = sal_False;
+ sal_Bool bEndKey = sal_False; // spezielle CursorPosition
+ sal_Bool bAllowIdle = sal_True;
// Um zu pruefen ob durch irgendeine Aktion mModified, das lokale
// bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen
// Stellen das updaten erfolgt.
- BOOL bWasModified = mpImpl->mpTextEngine->IsModified();
- mpImpl->mpTextEngine->SetModified( FALSE );
+ sal_Bool bWasModified = mpImpl->mpTextEngine->IsModified();
+ mpImpl->mpTextEngine->SetModified( sal_False );
TextSelection aCurSel( mpImpl->maSelection );
TextSelection aOldSel( aCurSel );
- USHORT nCode = rKeyEvent.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode();
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -642,12 +642,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
uno::Reference<datatransfer::clipboard::XClipboard> aSelection(GetWindow()->GetPrimarySelection());
Copy( aSelection );
}
- bMoved = TRUE;
+ bMoved = sal_True;
if ( nCode == KEY_END )
- bEndKey = TRUE;
+ bEndKey = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_BACKSPACE:
@@ -659,8 +659,8 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
{
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() )
{
- BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
- BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
+ sal_uInt8 nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
+ sal_uInt8 nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() )
nMode = DELMODE_RESTOFCONTENT;
@@ -685,7 +685,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
default: break;
}
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
@@ -707,12 +707,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
}
}
aCurSel = ImpDelete( nDel, nMode );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
- bModified = TRUE;
- bAllowIdle = FALSE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
+ bAllowIdle = sal_False;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_TAB:
@@ -722,10 +722,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
ImplCheckTextLen( 'x' ) )
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() );
- bModified = TRUE;
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_RETURN:
@@ -735,12 +735,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
!rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) )
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel );
if ( mpImpl->mbAutoIndent )
{
TextNode* pPrev = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 );
- USHORT n = 0;
+ sal_uInt16 n = 0;
while ( ( n < pPrev->GetText().Len() ) && (
( pPrev->GetText().GetChar( n ) == ' ' ) ||
( pPrev->GetText().GetChar( n ) == '\t' ) ) )
@@ -750,11 +750,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( n )
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
- bModified = TRUE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_INSERT:
@@ -771,11 +771,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken...
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True );
- bModified = TRUE;
+ bModified = sal_True;
}
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
}
}
@@ -799,20 +799,20 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
else if ( bMoved )
{
// Selection wird jetzt gezielt in ImpMoveCursor gemalt.
- ImpShowCursor( mpImpl->mbAutoScroll, TRUE, bEndKey );
+ ImpShowCursor( mpImpl->mbAutoScroll, sal_True, bEndKey );
}
if ( mpImpl->mpTextEngine->IsModified() )
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
else if ( bWasModified )
- mpImpl->mpTextEngine->SetModified( TRUE );
+ mpImpl->mpTextEngine->SetModified( sal_True );
return bDone;
}
void TextView::MouseButtonUp( const MouseEvent& rMouseEvent )
{
- mpImpl->mbClickedInSelection = FALSE;
+ mpImpl->mbClickedInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelEngine->SelMouseButtonUp( rMouseEvent );
if ( rMouseEvent.IsMiddle() && !IsReadOnly() &&
@@ -866,18 +866,18 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
TextSelection aNewSel( mpImpl->maSelection );
- aNewSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aNewSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aNewSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aNewSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetStart().GetPara(),
- (USHORT)aBoundary.startPos),
+ (sal_uInt16)aBoundary.startPos),
TEXTATTR_PROTECTED );
const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetEnd().GetPara(),
- (USHORT)aBoundary.endPos),
+ (sal_uInt16)aBoundary.endPos),
TEXTATTR_PROTECTED );
if(pStartAttr && pStartAttr->GetStart() < aNewSel.GetStart().GetIndex())
{
@@ -890,7 +890,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
}
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
else if ( rMouseEvent.GetClicks() == 3 )
@@ -904,7 +904,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
aNewSel.GetEnd().GetIndex() = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( mpImpl->maSelection.GetEnd().GetPara() )->GetText().Len();
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
}
@@ -938,7 +938,7 @@ void TextView::Command( const CommandEvent& rCEvt )
TEParaPortion* pPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetPara() );
pPortion->MarkSelectionInvalid( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex(), 0 );
- BOOL bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
+ sal_Bool bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
delete mpImpl->mpTextEngine->mpIMEInfos;
mpImpl->mpTextEngine->mpIMEInfos = NULL;
@@ -967,14 +967,14 @@ void TextView::Command( const CommandEvent& rCEvt )
if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite )
{
- USHORT nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
- USHORT nNewIMETextLen = pData->GetText().Len();
+ sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
+ sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
TextPaM aPaM( mpImpl->mpTextEngine->mpIMEInfos->aPos );
aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen;
mpImpl->mpTextEngine->ImpInsertText( aPaM, mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) );
@@ -983,7 +983,7 @@ void TextView::Command( const CommandEvent& rCEvt )
( nOldIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" );
@@ -1028,13 +1028,13 @@ void TextView::Command( const CommandEvent& rCEvt )
TextPaM aPaM( GetSelection().GetEnd() );
Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM );
- USHORT nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
if ( !mpImpl->mpTextEngine->IsFormatted() )
mpImpl->mpTextEngine->FormatDoc();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
+ sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
TextLine* pLine = pParaPortion->GetLines().GetObject( nLine );
if ( pLine && ( nInputEnd > pLine->GetEnd() ) )
nInputEnd = pLine->GetEnd();
@@ -1055,12 +1055,12 @@ void TextView::Command( const CommandEvent& rCEvt )
}
}
-void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor )
+void TextView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor )
{
// Die Einstellung hat mehr Gewicht:
if ( !mpImpl->mbAutoScroll )
- bGotoCursor = FALSE;
- ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE );
+ bGotoCursor = sal_False;
+ ImpShowCursor( bGotoCursor, bForceVisCursor, sal_False );
}
void TextView::HideCursor()
@@ -1092,7 +1092,7 @@ void TextView::Scroll( long ndX, long ndY )
if ( nDiffX || nDiffY )
{
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
mpImpl->mpWindow->Update();
mpImpl->maStartDocPos = aNewStartPos;
@@ -1112,21 +1112,21 @@ void TextView::Scroll( long ndX, long ndY )
void TextView::Undo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Undo( 1 );
+ mpImpl->mpTextEngine->GetUndoManager().Undo();
}
void TextView::Redo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Redo( 0 );
+ mpImpl->mpTextEngine->GetUndoManager().Redo();
}
void TextView::Cut()
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionStart();
Copy();
DeleteSelected();
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionEnd();
}
void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
@@ -1136,7 +1136,7 @@ void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxCl
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
@@ -1194,7 +1194,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC
bool bWasTruncated = false;
if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 )
bWasTruncated = ImplTruncateNewText( aText );
- InsertNewText( aText, FALSE );
+ InsertNewText( aText, sal_False );
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
if( bWasTruncated )
@@ -1224,22 +1224,22 @@ String TextView::GetSelected( LineEnd aSeparator )
return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator );
}
-void TextView::SetInsertMode( BOOL bInsert )
+void TextView::SetInsertMode( sal_Bool bInsert )
{
if ( mpImpl->mbInsertMode != bInsert )
{
mpImpl->mbInsertMode = bInsert;
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
}
}
-void TextView::SetReadOnly( BOOL bReadOnly )
+void TextView::SetReadOnly( sal_Bool bReadOnly )
{
if ( mpImpl->mbReadOnly != bReadOnly )
{
mpImpl->mbReadOnly = bReadOnly;
if ( !mpImpl->mbReadOnly )
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
else
HideCursor();
@@ -1261,8 +1261,8 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection );
- BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE;
- USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
+ sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False;
+ sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
bool bSelect = aTranslatedKeyEvent.GetKeyCode().IsShift();
switch ( nCode )
@@ -1279,9 +1279,9 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
break;
case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM );
break;
- case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
- case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
case com::sun::star::awt::Key::SELECT_WORD_FORWARD:
bSelect = true; // fallthrough intentional
@@ -1352,15 +1352,15 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
return mpImpl->maSelection;
}
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
InsertNewText( rStr, bSelect );
}
-void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
+void TextView::InsertNewText( const rtl::OUString& rStr, sal_Bool bSelect )
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
/* #i87633#
break inserted text into chunks that fit into the underlying String
@@ -1395,21 +1395,21 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
nLen -= nChunkLen;
nPos += nChunkLen;
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
mpImpl->mpTextEngine->FormatAndUpdate( this );
}
/*
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
// HideSelection();
TextSelection aNewSel( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, rStr );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
if ( bSelect )
{
@@ -1428,22 +1428,22 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect )
*/
// OLD
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
// OLD
-TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1452,7 +1452,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() )
{
@@ -1463,7 +1463,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
return aPaM;
}
-TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1472,7 +1472,7 @@ TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMod
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1495,7 +1495,7 @@ TextPaM TextView::CursorWordLeft( const TextPaM& rPaM )
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
if ( aBoundary.startPos >= rPaM.GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (USHORT)aBoundary.startPos : 0;
+ aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (sal_uInt16)aBoundary.startPos : 0;
}
else if ( aPaM.GetPara() )
{
@@ -1516,7 +1516,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1527,7 +1527,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
return aPaM;
}
-TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
+TextPaM TextView::ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode )
{
if ( mpImpl->maSelection.HasRange() ) // dann nur Sel. loeschen
return mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
@@ -1538,7 +1538,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorLeft( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER );
+ aEndPaM = CursorLeft( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
@@ -1548,7 +1548,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
if ( aBoundary.startPos == mpImpl->maSelection.GetEnd().GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
// #i63506# startPos is -1 when the paragraph starts with a tab
- aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (USHORT)aBoundary.startPos : 0;
+ aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (sal_uInt16)aBoundary.startPos : 0;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1566,14 +1566,14 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorRight( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ aEndPaM = CursorRight( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aEndPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aEndPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1602,17 +1602,17 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine ) // gleicher Absatz
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
aPaM.GetIndex() = nCharPos;
// Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das
// Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang
@@ -1625,8 +1625,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
{
aPaM.GetPara()--;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nL = pPPortion->GetLines().Count() - 1;
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
+ sal_uInt16 nL = pPPortion->GetLines().Count() - 1;
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
aPaM.GetIndex() = nCharPos;
}
@@ -1640,17 +1640,17 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine < ( pPPortion->GetLines().Count() - 1 ) )
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
aPaM.GetIndex() = nCharPos;
// Sonderbehandlung siehe CursorUp...
@@ -1662,7 +1662,7 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
{
aPaM.GetPara()++;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
aPaM.GetIndex() = nCharPos;
TextLine* pLine = pPPortion->GetLines().GetObject( 0 );
if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) )
@@ -1677,7 +1677,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetStart();
@@ -1689,13 +1689,13 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetEnd();
if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile
{
- xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) );
+ xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((sal_uInt16)(aPaM.GetIndex()-1) );
if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) )
{
// Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn,
@@ -1730,7 +1730,7 @@ TextPaM TextView::CursorStartOfDoc()
TextPaM TextView::CursorEndOfDoc()
{
- ULONG nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
+ sal_uLong nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( nNode );
TextPaM aPaM( nNode, pNode->GetText().Len() );
return aPaM;
@@ -1763,11 +1763,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM )
return aPaM;
}
-void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial )
+void TextView::ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bSpecial )
{
if ( mpImpl->mpTextEngine->IsFormatting() )
return;
- if ( mpImpl->mpTextEngine->GetUpdateMode() == FALSE )
+ if ( mpImpl->mpTextEngine->GetUpdateMode() == sal_False )
return;
if ( mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -1786,7 +1786,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
{
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
mpImpl->mbCursorAtEndOfLine =
- pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
}
if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() )
@@ -1795,12 +1795,12 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) )
{
// If we are behind a portion, and the next portion has other direction, we must change position...
- aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, FALSE, TRUE ).Left();
+ aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, sal_False, sal_True ).Left();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True );
TETextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion );
if ( pTextPortion->GetKind() == PORTIONKIND_TAB )
{
@@ -1812,8 +1812,8 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
else
{
- TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
- aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, TRUE ).Left();
+ TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
+ aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, sal_True ).Left();
}
}
}
@@ -1862,7 +1862,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
// X kann durch das 'bischen mehr' falsch sein:
-// ULONG nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
+// sal_uLong nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
// if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) )
// nMaxTextWidth = 0x7FFFFFFF;
// long nMaxX = (long)nMaxTextWidth - aOutSz.Width();
@@ -1900,7 +1900,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
mpImpl->mpCursor->Show();
}
-BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
+sal_Bool TextView::SetCursorAtPoint( const Point& rPosPixel )
{
mpImpl->mpTextEngine->CheckIdleFormatter();
@@ -1926,50 +1926,50 @@ BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
ShowSelection( aTmpNewSel );
}
- BOOL bForceCursor = mpImpl->mpDDInfo ? FALSE : TRUE; // && !mbInSelection
- ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, FALSE );
- return TRUE;
+ sal_Bool bForceCursor = mpImpl->mpDDInfo ? sal_False : sal_True; // && !mbInSelection
+ ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, sal_False );
+ return sal_True;
}
-BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel )
+sal_Bool TextView::IsSelectionAtPoint( const Point& rPosPixel )
{
// if ( !Rectangle( Point(), mpImpl->mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection )
-// return FALSE;
+// return sal_False;
Point aDocPos = GetDocPos( rPosPixel );
- TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, FALSE );
+ TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, sal_False );
// Bei Hyperlinks D&D auch ohne Selektion starten.
// BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint()
// Problem: IsSelectionAtPoint wird bei Command() nicht gerufen,
- // wenn vorher im MBDown schon FALSE returnt wurde.
+ // wenn vorher im MBDown schon sal_False returnt wurde.
return ( IsInSelection( aPaM ) ||
( /* mpImpl->mpSelEngine->IsInCommand() && */ mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) );
}
-BOOL TextView::IsInSelection( const TextPaM& rPaM )
+sal_Bool TextView::IsInSelection( const TextPaM& rPaM )
{
TextSelection aSel = mpImpl->maSelection;
aSel.Justify();
- ULONG nStartNode = aSel.GetStart().GetPara();
- ULONG nEndNode = aSel.GetEnd().GetPara();
- ULONG nCurNode = rPaM.GetPara();
+ sal_uLong nStartNode = aSel.GetStart().GetPara();
+ sal_uLong nEndNode = aSel.GetEnd().GetPara();
+ sal_uLong nCurNode = rPaM.GetPara();
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
- return TRUE;
+ return sal_True;
if ( nStartNode == nEndNode )
{
if ( nCurNode == nStartNode )
if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
}
else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) )
- return TRUE;
+ return sal_True;
else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
void TextView::ImpHideDDCursor()
@@ -1977,7 +1977,7 @@ void TextView::ImpHideDDCursor()
if ( mpImpl->mpDDInfo && mpImpl->mpDDInfo->mbVisCursor )
{
mpImpl->mpDDInfo->maCursor.Hide();
- mpImpl->mpDDInfo->mbVisCursor = FALSE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_False;
}
}
@@ -1985,7 +1985,7 @@ void TextView::ImpShowDDCursor()
{
if ( !mpImpl->mpDDInfo->mbVisCursor )
{
- Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, TRUE );
+ Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, sal_True );
aCursor.Right()++;
aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) );
@@ -1993,11 +1993,11 @@ void TextView::ImpShowDDCursor()
mpImpl->mpDDInfo->maCursor.SetPos( aCursor.TopLeft() );
mpImpl->mpDDInfo->maCursor.SetSize( aCursor.GetSize() );
mpImpl->mpDDInfo->maCursor.Show();
- mpImpl->mpDDInfo->mbVisCursor = TRUE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_True;
}
}
-void TextView::SetPaintSelection( BOOL bPaint )
+void TextView::SetPaintSelection( sal_Bool bPaint )
{
if ( bPaint != mpImpl->mbPaintSelection )
{
@@ -2006,7 +2006,7 @@ void TextView::SetPaintSelection( BOOL bPaint )
}
}
-void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
+void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight )
{
if ( bSelectByHighlight != mpImpl->mbHighlightSelection )
{
@@ -2015,14 +2015,14 @@ void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
}
}
-BOOL TextView::Read( SvStream& rInput )
+sal_Bool TextView::Read( SvStream& rInput )
{
- BOOL bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
+ sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
ShowCursor();
return bDone;
}
-BOOL TextView::Write( SvStream& rOutput )
+sal_Bool TextView::Write( SvStream& rOutput )
{
return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection );
}
@@ -2037,17 +2037,17 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
bTruncated = true;
}
- ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
+ sal_uLong nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
// 0 means unlimited, there is just the String API limit handled above
if( nMaxLen != 0 )
{
- ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong nCurLen = mpImpl->mpTextEngine->GetTextLen();
sal_uInt32 nNewLen = rNewText.getLength();
if ( nCurLen + nNewLen > nMaxLen )
{
// see how much text will be replaced
- ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
+ sal_uLong nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
if ( nCurLen + nNewLen - nSelLen > nMaxLen )
{
sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen));
@@ -2059,12 +2059,12 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
return bTruncated;
}
-BOOL TextView::ImplCheckTextLen( const String& rNewText )
+sal_Bool TextView::ImplCheckTextLen( const String& rNewText )
{
- BOOL bOK = TRUE;
+ sal_Bool bOK = sal_True;
if ( mpImpl->mpTextEngine->GetMaxTextLen() )
{
- ULONG n = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong n = mpImpl->mpTextEngine->GetTextLen();
n += rNewText.Len();
if ( n > mpImpl->mpTextEngine->GetMaxTextLen() )
{
@@ -2075,7 +2075,7 @@ BOOL TextView::ImplCheckTextLen( const String& rNewText )
// Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl,
// aber so funktioniert es wenigstens in ME, BasicIDE, SourceView
Sound::Beep();
- bOK = FALSE;
+ bOK = sal_False;
}
}
}
@@ -2092,12 +2092,12 @@ void TextView::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd:
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = new TextDDInfo;
- mpImpl->mpDDInfo->mbStarterOfDD = TRUE;
+ mpImpl->mpDDInfo->mbStarterOfDD = sal_True;
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
/*
@@ -2141,7 +2141,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
{
SolarMutexGuard aVclGuard;
- BOOL bChanges = FALSE;
+ sal_Bool bChanges = sal_False;
if ( !mpImpl->mbReadOnly && mpImpl->mpDDInfo )
{
ImpHideDDCursor();
@@ -2149,17 +2149,17 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
// Daten fuer das loeschen nach einem DROP_MOVE:
TextSelection aPrevSel( mpImpl->maSelection );
aPrevSel.Justify();
- ULONG nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
- USHORT nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
+ sal_uLong nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
+ sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
- BOOL bStarterOfDD = FALSE;
- for ( USHORT nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
- bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : FALSE;
+ sal_Bool bStarterOfDD = sal_False;
+ for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
+ bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : sal_False;
HideSelection();
ImpSetSelection( mpImpl->mpDDInfo->maDropPos );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionStart();
String aText;
uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
@@ -2188,7 +2188,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->SetAttrib( TextAttribProtect(),
aTempStart.GetPara(),
aTempStart.GetIndex(),
- mpImpl->maSelection.GetEnd().GetIndex(), FALSE );
+ mpImpl->maSelection.GetEnd().GetIndex(), sal_False );
}
if ( aPrevSel.HasRange() &&
@@ -2200,7 +2200,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
( ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
&& ( mpImpl->mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) )
{
- ULONG nNewParasBeforeSelection =
+ sal_uLong nNewParasBeforeSelection =
mpImpl->mpTextEngine->GetParagraphCount() - nPrevParaCount;
aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection;
@@ -2208,7 +2208,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
{
- USHORT nNewChars =
+ sal_uInt16 nNewChars =
mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen;
aPrevSel.GetStart().GetIndex() =
@@ -2237,7 +2237,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->ImpDeleteText( aPrevSel );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionEnd();
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = 0;
@@ -2370,7 +2370,7 @@ sal_Int32 TextView::GetLineNumberOfCursorInSelection() const
{
TextPaM aPaM = GetSelection().GetEnd();
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
if( mpImpl->mbCursorAtEndOfLine )
--nLineNo;
}
@@ -2401,12 +2401,12 @@ void TextSelFunctionSet::CreateAnchor()
mpView->ImpSetSelection( mpView->mpImpl->maSelection.GetEnd() );
}
-BOOL TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL )
+sal_Bool TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool )
{
return mpView->SetCursorAtPoint( rPointPixel );
}
-BOOL TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+sal_Bool TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
{
return mpView->IsSelectionAtPoint( rPointPixel );
}
@@ -2429,31 +2429,31 @@ TextEngine* TextView::GetTextEngine() const
{ return mpImpl->mpTextEngine; }
Window* TextView::GetWindow() const
{ return mpImpl->mpWindow; }
-void TextView::EnableCursor( BOOL bEnable )
+void TextView::EnableCursor( sal_Bool bEnable )
{ mpImpl->mbCursorEnabled = bEnable; }
-BOOL TextView::IsCursorEnabled() const
+sal_Bool TextView::IsCursorEnabled() const
{ return mpImpl->mbCursorEnabled; }
void TextView::SetStartDocPos( const Point& rPos )
{ mpImpl->maStartDocPos = rPos; }
const Point& TextView::GetStartDocPos() const
{ return mpImpl->maStartDocPos; }
-void TextView::SetAutoIndentMode( BOOL bAutoIndent )
+void TextView::SetAutoIndentMode( sal_Bool bAutoIndent )
{ mpImpl->mbAutoIndent = bAutoIndent; }
-BOOL TextView::IsAutoIndentMode() const
+sal_Bool TextView::IsAutoIndentMode() const
{ return mpImpl->mbAutoIndent; }
-BOOL TextView::IsReadOnly() const
+sal_Bool TextView::IsReadOnly() const
{ return mpImpl->mbReadOnly; }
-void TextView::SetAutoScroll( BOOL bAutoScroll )
+void TextView::SetAutoScroll( sal_Bool bAutoScroll )
{ mpImpl->mbAutoScroll = bAutoScroll; }
-BOOL TextView::IsAutoScroll() const
+sal_Bool TextView::IsAutoScroll() const
{ return mpImpl->mbAutoScroll; }
-BOOL TextView::IsPaintSelection() const
+sal_Bool TextView::IsPaintSelection() const
{ return mpImpl->mbPaintSelection; }
-BOOL TextView::IsHighlightSelection() const
+sal_Bool TextView::IsHighlightSelection() const
{ return mpImpl->mbHighlightSelection; }
-BOOL TextView::HasSelection() const
+sal_Bool TextView::HasSelection() const
{ return mpImpl->maSelection.HasRange(); }
-BOOL TextView::IsInsertMode() const
+sal_Bool TextView::IsInsertMode() const
{ return mpImpl->mbInsertMode; }
void TextView::SupportProtectAttribute(sal_Bool bSupport)
{ mpImpl->mbSupportProtectAttribute = bSupport;}
diff --git a/svtools/source/edit/txtattr.cxx b/svtools/source/edit/txtattr.cxx
index 57b4ade43379..022a40ae848f 100644
--- a/svtools/source/edit/txtattr.cxx
+++ b/svtools/source/edit/txtattr.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <vcl/font.hxx>
diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx
index e7c77e7e65ce..eaef852b9d6d 100644
--- a/svtools/source/edit/xtextedt.cxx
+++ b/svtools/source/edit/xtextedt.cxx
@@ -53,12 +53,12 @@ ExtTextEngine::~ExtTextEngine()
TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
{
TextSelection aSel( rCursor );
- USHORT nPos = rCursor.GetIndex();
- ULONG nPara = rCursor.GetPara();
- ULONG nParas = GetParagraphCount();
+ sal_uInt16 nPos = rCursor.GetIndex();
+ sal_uLong nPara = rCursor.GetPara();
+ sal_uLong nParas = GetParagraphCount();
if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) )
{
- USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
+ sal_uInt16 nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
if ( nMatchChar != STRING_NOTFOUND )
{
if ( ( nMatchChar % 2 ) == 0 )
@@ -67,8 +67,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
sal_Unicode nSC = maGroupChars.GetChar( nMatchChar );
sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 );
- USHORT nCur = nPos+1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = nPos+1;
+ sal_uInt16 nLevel = 1;
while ( nLevel && ( nPara < nParas ) )
{
XubString aStr = GetText( nPara );
@@ -103,8 +103,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
xub_Unicode nEC = maGroupChars.GetChar( nMatchChar );
xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 );
- USHORT nCur = rCursor.GetIndex()-1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = rCursor.GetIndex()-1;
+ sal_uInt16 nLevel = 1;
while ( nLevel )
{
if ( GetTextLen( nPara ) )
@@ -149,12 +149,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
return aSel;
}
-BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
TextSelection aSel( rSel );
aSel.Justify();
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
TextPaM aStartPaM( aSel.GetEnd() );
if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) )
@@ -163,7 +163,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
}
bool bFound = false;
- ULONG nStartNode, nEndNode;
+ sal_uLong nStartNode, nEndNode;
if ( bSearchInSelection )
nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara();
@@ -177,13 +177,13 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
utl::TextSearch aSearcher( rSearchOptions );
// ueber die Absaetze iterieren...
- for ( ULONG nNode = nStartNode;
+ for ( sal_uLong nNode = nStartNode;
bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
bForward ? nNode++ : nNode-- )
{
String aText = GetText( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = aText.Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = aText.Len();
if ( nNode == nStartNode )
{
if ( bForward )
@@ -213,7 +213,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
// Ueber den Absatz selektieren?
// Select over the paragraph?
// FIXME This should be max long...
- if( nEndPos == sal::static_int_cast<USHORT>(-1) ) // USHORT for 0 and -1 !
+ if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 !
{
if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() )
{
@@ -250,34 +250,34 @@ ExtTextView::~ExtTextView()
{
}
-BOOL ExtTextView::MatchGroup()
+sal_Bool ExtTextView::MatchGroup()
{
TextSelection aTmpSel( GetSelection() );
aTmpSel.Justify();
if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) ||
( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) )
{
- return FALSE;
+ return sal_False;
}
TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() );
if ( aMatchSel.HasRange() )
SetSelection( aMatchSel );
- return aMatchSel.HasRange() ? TRUE : FALSE;
+ return aMatchSel.HasRange() ? sal_True : sal_False;
}
-BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
TextSelection aSel( GetSelection() );
if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) )
{
- bFound = TRUE;
+ bFound = sal_True;
// Erstmal den Anfang des Wortes als Selektion einstellen,
// damit das ganze Wort in den sichtbaren Bereich kommt.
SetSelection( aSel.GetStart() );
- ShowCursor( TRUE, FALSE );
+ ShowCursor( sal_True, sal_False );
}
else
{
@@ -290,9 +290,9 @@ BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForwa
return bFound;
}
-USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward )
+sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward )
{
- USHORT nFound = 0;
+ sal_uInt16 nFound = 0;
if ( !bAll )
{
@@ -317,7 +317,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
// HideSelection();
TextSelection aSel;
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
if ( bSearchInSelection )
{
aSel = GetSelection();
@@ -326,9 +326,9 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextSelection aSearchSel( aSel );
- BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ sal_Bool bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
if ( bFound )
- pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionStart();
while ( bFound )
{
nFound++;
@@ -336,42 +336,42 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString );
aSel = aSearchSel;
aSel.GetStart() = aNewStart;
- bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
}
if ( nFound )
{
SetSelection( aSel.GetStart() );
pTextEngine->FormatAndUpdate( this );
- pTextEngine->UndoActionEnd( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionEnd();
}
}
return nFound;
}
-BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
+sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
TextSelection aSel = GetSelection();
aSel.Justify();
HideSelection();
- GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionStart();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() )
{
nEndPara--; // den dann nicht einruecken...
}
- for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
if ( bRight )
{
// Tabs hinzufuegen
GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' );
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -382,14 +382,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
( aText.GetChar( 0 ) == ' ' ) ) )
{
GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
- GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionEnd();
- BOOL bRange = aSel.HasRange();
+ sal_Bool bRange = aSel.HasRange();
if ( bRight )
{
aSel.GetStart().GetIndex()++;
@@ -410,14 +410,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
return bDone;
}
-BOOL ExtTextView::IndentBlock()
+sal_Bool ExtTextView::IndentBlock()
{
- return ImpIndentBlock( TRUE );
+ return ImpIndentBlock( sal_True );
}
-BOOL ExtTextView::UnindentBlock()
+sal_Bool ExtTextView::UnindentBlock()
{
- return ImpIndentBlock( FALSE );
+ return ImpIndentBlock( sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx b/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
index 3c26d8cad9d4..c142aa1ce95d 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigCache.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::container ; // XNameAccess
using namespace ::com::sun::star::uno ; // Reference
using namespace ::com::sun::star::beans ; // PropertyValue
using namespace ::utl ; // getProcessServiceFactory();
-using namespace ::rtl ;
+using ::rtl::OUString;
const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameList[] =
{
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
index 8ad858a1d877..fddeec1f0482 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-using namespace ::rtl;
+using ::rtl::OUString;
using namespace ::utl ; // getProcessServiceFactory
using namespace ::com::sun::star::lang ; // XMultiServiceFactory
using namespace ::com::sun::star::beans ; // PropertyValue
@@ -429,7 +429,7 @@ void FilterConfigItem::WriteBool( const OUString& rKey, sal_Bool bNewValue )
Any aAny;
if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
{
- sal_Bool bOldValue;
+ sal_Bool bOldValue(sal_True);
if ( aAny >>= bOldValue )
{
if ( bOldValue != bNewValue )
@@ -463,7 +463,7 @@ void FilterConfigItem::WriteInt32( const OUString& rKey, sal_Int32 nNewValue )
if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
{
- sal_Int32 nOldValue;
+ sal_Int32 nOldValue = 0;
if ( aAny >>= nOldValue )
{
if ( nOldValue != nNewValue )
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
index efe020b1cbda..6f78dd19fb6e 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
@@ -37,9 +37,7 @@
#include <osl/module.hxx>
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
-#include "dlgexpor.hxx"
-#include "dlgejpg.hxx"
-#include "dlgepng.hxx"
+#include "exportdialog.hxx"
#include <uno/mapping.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
@@ -50,12 +48,6 @@
#include <unotools/syslocale.hxx>
#include "vcl/svapp.hxx"
-#if defined WIN || (defined OS2 && !defined ICC)
-#define EXPDLG_FUNCTION_NAME "_DoExportDialog"
-#else
-#define EXPDLG_FUNCTION_NAME "DoExportDialog"
-#endif
-
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -94,9 +86,10 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName
// -----------------------------------------------------------------------------
-SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > & xMgr ) :
- rxMgr ( xMgr ),
- eFieldUnit ( FUNIT_CM )
+SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) :
+ mxMgr ( xMgr ),
+ meFieldUnit ( FUNIT_CM ),
+ mbExportSelection ( sal_False )
{
}
@@ -149,18 +142,18 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues()
throw ( uno::RuntimeException )
{
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
+ if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
break;
}
if ( i == nCount )
- aMediaDescriptor.realloc( ++nCount );
+ maMediaDescriptor.realloc( ++nCount );
// the "FilterData" Property is an Any that will contain our PropertySequence of Values
- aMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
- aMediaDescriptor[ i ].Value <<= aFilterDataSequence;
- return aMediaDescriptor;
+ maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) );
+ maMediaDescriptor[ i ].Value <<= maFilterDataSequence;
+ return maMediaDescriptor;
}
void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::PropertyValue > & aProps )
@@ -168,15 +161,18 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException )
{
- aMediaDescriptor = aProps;
+ maMediaDescriptor = aProps;
sal_Int32 i, nCount;
- for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
+ for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
{
- if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
+ if ( maMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
{
- aMediaDescriptor[ i ].Value >>= aFilterDataSequence;
- break;
+ maMediaDescriptor[ i ].Value >>= maFilterDataSequence;
+ }
+ else if ( maMediaDescriptor[ i ].Name.equalsAscii( "SelectionOnly" ) )
+ {
+ maMediaDescriptor[ i ].Value >>= mbExportSelection;
}
}
}
@@ -185,7 +181,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
void SvFilterOptionsDialog::setTitle( const OUString& aTitle )
throw ( uno::RuntimeException )
{
- aDialogTitle = aTitle;
+ maDialogTitle = aTitle;
}
sal_Int16 SvFilterOptionsDialog::execute()
@@ -195,13 +191,13 @@ sal_Int16 SvFilterOptionsDialog::execute()
String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
String aInternalFilterName;
- sal_Int32 j, nCount = aMediaDescriptor.getLength();
+ sal_Int32 j, nCount = maMediaDescriptor.getLength();
for ( j = 0; j < nCount; j++ )
{
- if ( aMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
+ if ( maMediaDescriptor[ j ].Name.equals( aFilterNameStr ) )
{
OUString aStr;
- aMediaDescriptor[ j ].Value >>= aStr;
+ maMediaDescriptor[ j ].Value >>= aStr;
aInternalFilterName = aStr;
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 );
aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 );
@@ -220,79 +216,24 @@ sal_Int16 SvFilterOptionsDialog::execute()
}
if ( nFormat < nFilterCount )
{
- FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, eFieldUnit );
- aFltCallDlgPara.aFilterData = aFilterDataSequence;
-
- String aFilterName( aGraphicFilter.pConfig->GetExportFilterName( nFormat ) );
- if ( aGraphicFilter.pConfig->IsExportInternalFilter( nFormat ) )
- {
- // Export-Dialog fuer Bitmap's, SVM's und WMF's
- if( ( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_SVMETAFILE ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_WMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_EMF ) ) ||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )||
- ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) )
- {
- ByteString aResMgrName( "svt", 3 );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- aFltCallDlgPara.pResMgr = pResMgr;
- // JPEG-Dialog
- if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )
- {
- if ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) )
- {
- if ( DlgExportEPNG( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else if( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) )
- {
- // Fuer Vektorformate nehmen wir den Vektor-Dialog
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- else
- {
- aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
- if ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- delete pResMgr;
- }
- }
- else // ladbare Filter
- {
- xub_StrLen i, nTokenCount = aGraphicFilter.aFilterPath.GetTokenCount( ';' );
- for ( i = 0; i < nTokenCount; i++ )
- {
-
- OUString aPathURL;
-
- ::osl::FileBase::getFileURLFromSystemPath( aGraphicFilter.aFilterPath.GetToken( i ), aPathURL );
- aPathURL += String( '/' );
-
- OUString aSystemPath;
- ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath );
- aSystemPath += OUString( aFilterName );
-
- osl::Module aLibrary( aSystemPath );
- PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getFunctionSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) );
- // Dialog in DLL ausfuehren
- if( pFunc )
- {
- if ( (*pFunc)( aFltCallDlgPara ) )
- nRet = ui::dialogs::ExecutableDialogResults::OK;
- }
- }
- }
+ FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit );
+ aFltCallDlgPara.aFilterData = maFilterDataSequence;
+
+ ByteString aResMgrName( "svt", 3 );
+ ResMgr* pResMgr;
+
+ pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
+ aFltCallDlgPara.pResMgr = pResMgr;
+
+ aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat );
+ sal_Bool bIsPixelFormat( aGraphicFilter.pConfig->IsExportPixelFormat( nFormat ) );
+ if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK )
+ nRet = ui::dialogs::ExecutableDialogResults::OK;
+
+ delete pResMgr;
+
// taking the out parameter from the dialog
- aFilterDataSequence = aFltCallDlgPara.aFilterData;
+ maFilterDataSequence = aFltCallDlgPara.aFilterData;
}
}
return nRet;
@@ -302,6 +243,8 @@ sal_Int16 SvFilterOptionsDialog::execute()
void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
throw ( lang::IllegalArgumentException, uno::RuntimeException )
{
+ mxSourceDocument = xDoc;
+
// try to set the corresponding metric unit
String aConfigPath;
uno::Reference< lang::XServiceInfo > xServiceInfo
@@ -321,7 +264,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) );
else
aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) );
- eFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
+ meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
}
}
}
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
index 3e9fce6cf4ca..6cc10d98d6a7 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx
@@ -29,7 +29,7 @@
#ifndef _SV_FILTER_OPTIONS_DIALOG_HXX_
#define _SV_FILTER_OPTIONS_DIALOG_HXX_
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <cppuhelper/implbase5.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -47,18 +47,22 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5
com::sun::star::lang::XServiceInfo
>
{
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &
- rxMgr;
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aMediaDescriptor;
+ maMediaDescriptor;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
- aFilterDataSequence;
- rtl::OUString aDialogTitle;
- FieldUnit eFieldUnit;
+ maFilterDataSequence;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
+ mxSourceDocument;
+
+ rtl::OUString maDialogTitle;
+ FieldUnit meFieldUnit;
+ sal_Bool mbExportSelection;
public:
- SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
+ SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
~SvFilterOptionsDialog();
// XInterface
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx
deleted file mode 100644
index 4cedaf70e509..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.cxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include "dlgejpg.hxx"
-#include "dlgejpg.hrc"
-#include "strings.hrc"
-#include <svtools/FilterConfigItem.hxx>
-
-#define KEY_QUALITY "Quality"
-#define KEY_GRAYSCALES "ColorMode"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aFiDescr ( this, ResId( FI_DESCR, *rPara.pResMgr ) ),
- aNumFldQuality ( this, ResId( NUM_FLD_QUALITY, *rPara.pResMgr ) ),
- aGrpQuality ( this, ResId( GRP_QUALITY, *rPara.pResMgr ) ),
- aRbGray ( this, ResId( RB_GRAY, *rPara.pResMgr ) ),
- aRbRGB ( this, ResId( RB_RGB, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) )
-{
- FreeResource();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- // reading filter options
- sal_Int32 nQuality = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), 75 );
- sal_Int32 nColorMode = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), 0 );
- aNumFldQuality.SetValue( nQuality );
-
- if ( nColorMode )
- aRbGray.Check( sal_True );
- else
- aRbRGB.Check( sal_True );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) );
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), (sal_Int32)aNumFldQuality.GetValue() );
- pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), aRbGray.IsChecked() ? 1 : 0 );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
- return 0;
-}
-
-DlgExportEJPG::~DlgExportEJPG()
-{
- delete pConfigItem;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx
deleted file mode 100644
index efc5daa7105c..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEJPG_HXX_
-#define _DLGEJPG_HXX_
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/fltcall.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-class FilterConfigItem;
-class DlgExportEJPG : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedInfo aFiDescr;
- NumericField aNumFldQuality;
- FixedLine aGrpQuality;
- RadioButton aRbGray;
- RadioButton aRbRGB;
- FixedLine aGrpColors;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- FilterConfigItem* pConfigItem;
-
- DECL_LINK( OK, void * );
-
-public:
- DlgExportEJPG( FltCallDialogParameter& rDlgPara );
- ~DlgExportEJPG();
-};
-
-#endif // _DLGEJPG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src
deleted file mode 100644
index 0817f7cbf3c7..000000000000
--- a/svtools/source/filter.vcl/filter/dlgejpg.src
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "dlgejpg.hrc"
-ModalDialog DLG_EXPORT_JPG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 159 , 92 ) ;
- Text [ en-US ] = "JPEG Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 103 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 103 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 103 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_QUALITY
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Quality" ;
- };
- FixedText FI_DESCR
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 81 , 16 ) ;
- Text [ en-US ] = "1: min. quality\n100: max. quality" ;
- };
- NumericField NUM_FLD_QUALITY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 1;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Last = 100 ;
- Repeat = TRUE ;
- };
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 51 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- RadioButton RB_GRAY
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Grayscale" ;
- };
- RadioButton RB_RGB
- {
- Pos = MAP_APPFONT ( 12 , 76 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "True Colors" ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/dlgepng.cxx b/svtools/source/filter.vcl/filter/dlgepng.cxx
deleted file mode 100644
index 1b400cba87c6..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <tools/ref.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgepng.hxx"
-#include "dlgepng.hrc"
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ),
- FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ),
- rFltCallPara ( rPara ),
- aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ),
- aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ),
- aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ),
- aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
- sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
- if ( ( nCompression < 0 ) || ( nCompression > 9 ) )
- nCompression = 6;
- aNumCompression.SetValue( nCompression );
-
- sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 );
- sal_Bool bInterlaced = nInterlaced != 0;
- aCbxInterlaced.Check( bInterlaced );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) );
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast<sal_Int32>(aNumCompression.GetValue()) );
- sal_Int32 nInterlace = 0;
- if ( aCbxInterlaced.IsChecked() )
- nInterlace++;
- WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
- rFltCallPara.aFilterData = GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc
deleted file mode 100644
index b3ffaab3ab1e..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hrc
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_COMPRESSION 1
-#define FI_COMPRESSION 1
-#define NUM_COMPRESSION 1
-#define CBX_INTERLACED 1
diff --git a/svtools/source/filter.vcl/filter/dlgepng.hxx b/svtools/source/filter.vcl/filter/dlgepng.hxx
deleted file mode 100644
index b43feafc0d49..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEPNG_HXX_
-#define _DLGEPNG_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/FilterConfigItem.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class ResMgr;
-
-class DlgExportEPNG : public ModalDialog, FilterConfigItem
-{
-
- private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpCompression;
- FixedInfo aFiCompression;
- NumericField aNumCompression;
- CheckBox aCbxInterlaced;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
-
- public:
-
- DlgExportEPNG( FltCallDialogParameter& rPara );
-};
-
-#endif // _DLGEPNG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgepng.src b/svtools/source/filter.vcl/filter/dlgepng.src
deleted file mode 100644
index 14c53ad8374b..000000000000
--- a/svtools/source/filter.vcl/filter/dlgepng.src
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "dlgepng.hrc"
-ModalDialog DLG_EXPORT_EPNG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 169 , 64 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PNG Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 113 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 113 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 113 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_COMPRESSION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text[ en-US ] = "Mode";
- };
- FixedText FI_COMPRESSION
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text[ en-US ] = "~Compression 0..9";
- };
- NumericField NUM_COMPRESSION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 9 ;
- First = 0 ;
- Last = 9 ;
- StrictFormat = TRUE ;
- Repeat = TRUE ;
- };
- CheckBox CBX_INTERLACED
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 80 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Interlaced" ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx
deleted file mode 100644
index 951dd2c1a551..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.cxx
+++ /dev/null
@@ -1,444 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#ifndef GCC
-# pragma hdrstop
-#endif
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <com/sun/star/awt/Size.hpp>
-#include <vcl/msgbox.hxx>
-#include "dlgexpor.hxx"
-#include "dlgexpor.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_PIX, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_PIX, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_PIX, *rPara.pResMgr ) ),
- aLbColors ( this, ResId( LB_COLORS, *rPara.pResMgr ) ),
- aCbxRLE ( this, ResId( CBX_RLE, *rPara.pResMgr ) ),
- aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_PIX, *rPara.pResMgr ) ),
- aRbRes ( this, ResId( RB_RES_PIX, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_PIX, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_PIX, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_PIX, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_PIX, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_PIX, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_PIX, *rPara.pResMgr ) ),
- aCbbRes ( this, ResId( CBB_RES_PIX, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) );
- aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) );
- aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // Config-Parameter lesen
- sal_Int32 nColors = pConfigItem->ReadInt32( String( ResId( KEY_COLORS, *pMgr ) ), 0 );
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
- sal_Int32 nRes = pConfigItem->ReadInt32( String( ResId( KEY_RES, *pMgr ) ), 75 );
- sal_Bool bRleCoding = pConfigItem->ReadBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), sal_True );
-
- aLbColors.SelectEntryPos( Min( (sal_uInt16) 7, (sal_uInt16)nColors ) );
-
- String aStrRes( String::CreateFromInt32( nRes ) );
- aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) );
- aCbbRes.SetText( aStrRes );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aCbxRLE.Check( bRleCoding );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
-
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
-// case FUNIT_M :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
-
- default:
- break; // -Wall multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 2 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
- case 1 :
- {
- aRbRes.Check( TRUE );
- ClickRbRes( NULL );
- }
- break;
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
- SelectLbColors( &aLbColors );
-}
-
-DlgExportPix::~DlgExportPix()
-{
- delete pConfigItem;
-}
-
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
-
- sal_Int32 nRes = Max( Min( aCbbRes.GetText().ToInt32(), sal_Int32( 600 ) ), sal_Int32( 75 ) );
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbRes.IsChecked() )
- nMode = 1;
- else if ( aRbSize.IsChecked() )
- nMode = 2;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteInt32( String( ResId( KEY_RES, *pMgr ) ), nRes );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- pConfigItem->WriteInt32( String( ResId( KEY_COLORS, *pMgr ) ), (sal_Int32)aLbColors.GetSelectEntryPos() );
- pConfigItem->WriteBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), aCbxRLE.IsChecked() );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG )
-{
- aCbbRes.Disable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG )
-{
- aCbbRes.Enable();
-
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG )
-{
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- aCbbRes.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG )
-{
- const USHORT nLbPos = aLbColors.GetSelectEntryPos();
-
- if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) )
- aCbxRLE.Enable();
- else
- aCbxRLE.Disable();
-
- return 0L;
-}
-
-
-/******************************************************************************/
-
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK_VEC, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL_VEC, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP_VEC, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL_VEC, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE_VEC, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE_VEC, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX_VEC, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX_VEC, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY_VEC, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY_VEC, *rPara.pResMgr ) ),
- aGrpSize ( this, ResId( GRP_SIZE_VEC, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr ),
- aExt ( rPara.aFilterExt )
-{
- aExt.ToUpperAscii();
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
- aFilterConfigPath.Append( aExt );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aTitle( aExt );
- FreeResource();
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) );
-
- aTitle.ToUpperAscii();
- aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) );
- SetText( aTitle );
-
- // reading config-parameter
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
-
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_M :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
- default:
- break; // -Wall Multiple values not handled.
- }
-
- switch ( nMode )
- {
- case 1 :
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- break;
-
- default :
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
- break;
- }
-}
-
-DlgExportVec::~DlgExportVec()
-{
- delete pConfigItem;
-}
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- ::com::sun::star::awt::Size aSize(
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )),
- static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) );
-
- sal_Int32 nMode;
- if ( aRbSize.IsChecked() )
- nMode = 1;
- else
- nMode = 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG )
-{
- aGrpSize.Disable();
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG )
-{
- aGrpSize.Enable();
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- return 0;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc
deleted file mode 100644
index 69870c9b00b0..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hrc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
-
-#define BTN_OK_PIX 1
-#define BTN_CANCEL_PIX 1
-#define BTN_HELP_PIX 1
-#define CBX_RES_PIX 1
-#define CBX_SIZE_PIX 2
-#define CBX_RLE 3
-#define CBB_RES_PIX 1
-#define LB_COLORS 1
-#define MTF_SIZEX_PIX 1
-#define MTF_SIZEY_PIX 2
-#define FT_SIZEX_PIX 1
-#define FT_SIZEY_PIX 2
-#define GRP_MODE_PIX 1
-#define GRP_COLORS 4
-#define RB_ORIGINAL_PIX 1
-#define RB_RES_PIX 2
-#define RB_SIZE_PIX 3
-
-#define BTN_OK_VEC 1
-#define BTN_CANCEL_VEC 1
-#define BTN_HELP_VEC 1
-#define CBX_SIZE_VEC 2
-#define MTF_SIZEX_VEC 1
-#define MTF_SIZEY_VEC 2
-#define FT_SIZEX_VEC 1
-#define FT_SIZEY_VEC 2
-#define GRP_SIZE_VEC 1
-#define GRP_MODE_VEC 2
-#define RB_ORIGINAL_VEC 1
-#define RB_SIZE_VEC 2
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx
deleted file mode 100644
index 4c8b926335cd..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _DLGEXPOR_HXX_
-#define _DLGEXPOR_HXX_
-
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class DlgExportPix : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- ListBox aLbColors;
- CheckBox aCbxRLE;
- FixedLine aGrpColors;
-
- RadioButton aRbOriginal;
- RadioButton aRbRes;
- RadioButton aRbSize;
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpMode;
- ComboBox aCbbRes;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbRes,void* p );
- DECL_LINK( ClickRbSize,void* p );
- DECL_LINK( SelectLbColors, void* p );
-
-public:
- DlgExportPix( FltCallDialogParameter& rPara );
- ~DlgExportPix();
-};
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
-|*
-\************************************************************************/
-class DlgExportVec : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- RadioButton aRbOriginal;
- RadioButton aRbSize;
- FixedLine aGrpMode;
-
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpSize;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- String aExt;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbSize,void* p );
-
-public:
- DlgExportVec( FltCallDialogParameter& rPara );
- ~DlgExportVec();
-};
-
-#endif // _DLGEXPOR_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src
deleted file mode 100644
index f1e63268fb22..000000000000
--- a/svtools/source/filter.vcl/filter/dlgexpor.src
+++ /dev/null
@@ -1,276 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "dlgexpor.hrc"
-
-ModalDialog DLG_EXPORT_PIX
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 135 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- FixedLine GRP_COLORS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Color resolution" ;
- };
- ListBox LB_COLORS
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- StringList [ en-US ] =
- {
- < "Original" ; Default ; > ;
- < "1 Bit - Threshold Value" ; Default ; > ;
- < "1 Bit - Dithering" ; Default ; > ;
- < "4 Bit - Grayscale" ; Default ; > ;
- < "4 Bit - Color Palette" ; Default ; > ;
- < "8 Bit - Grayscales" ; Default ; > ;
- < "8 Bit - Color Palette" ; Default ; > ;
- < "24 Bit - True Colors" ; Default ; > ;
- };
- };
- CheckBox CBX_RLE
- {
- Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 98 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "RLE coding" ;
- };
- FixedLine GRP_MODE_PIX
- {
- Pos = MAP_APPFONT ( 6 , 48 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_PIX
- {
- Pos = MAP_APPFONT ( 12 , 59 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_RES_PIX
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 55 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Resolution" ;
- };
- ComboBox CBB_RES_PIX
- {
- Pos = MAP_APPFONT ( 70 , 73 ) ;
- Size = MAP_APPFONT ( 40 , 50 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList =
- {
- "75 DPI" ;
- "150 DPI" ;
- "300 DPI" ;
- "600 DPI" ;
- };
- };
- RadioButton RB_SIZE_PIX
- {
- Pos = MAP_APPFONT ( 12 , 87 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- MetricField MTF_SIZEX_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 101 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEX_PIX
- {
- Pos = MAP_APPFONT ( 18 , 102 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEY_PIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 117 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_PIX
- {
- Pos = MAP_APPFONT ( 18 , 118 ) ;
- Size = MAP_APPFONT ( 41 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- OKButton BTN_OK_PIX
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_PIX
- {
- Pos = MAP_APPFONT ( 122 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_PIX
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-ModalDialog DLG_EXPORT_VEC
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 89 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- FixedLine GRP_MODE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- RadioButton RB_ORIGINAL_VEC
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine GRP_SIZE_VEC
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_SIZEX_VEC
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MTF_SIZEX_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedText FT_SIZEY_VEC
- {
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- MetricField MTF_SIZEY_VEC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- OKButton BTN_OK_VEC
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL_VEC
- {
- Pos = MAP_APPFONT ( 122 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP_VEC
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx
new file mode 100644
index 000000000000..701619d31f6c
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.cxx
@@ -0,0 +1,1513 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#ifndef GCC
+# pragma hdrstop
+#endif
+
+#include <tools/ref.hxx>
+#include <tools/stream.hxx>
+#include <svtools/filter.hxx>
+#include <svtools/FilterConfigItem.hxx>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/drawing/XDrawView.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
+#include <com/sun/star/geometry/AffineMatrix2D.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <unotools/streamwrap.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/graph.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include "exportdialog.hxx"
+#include "exportdialog.hrc"
+
+#define FORMAT_UNKNOWN 0
+#define FORMAT_JPG 1
+#define FORMAT_PNG 2
+#define FORMAT_BMP 3
+#define FORMAT_GIF 4
+#define FORMAT_PBM 5
+#define FORMAT_PGM 6
+#define FORMAT_PPM 7
+#define FORMAT_PCT 8
+#define FORMAT_RAS 9
+#define FORMAT_TIF 10
+#define FORMAT_XPM 11
+#define FORMAT_WMF 12
+#define FORMAT_EMF 13
+#define FORMAT_EPS 14
+#define FORMAT_MET 15
+#define FORMAT_SVG 16
+#define FORMAT_SVM 17
+
+#define UNIT_DEFAULT -1
+#define UNIT_INCH 0
+#define UNIT_CM 1
+#define UNIT_MM 2
+#define UNIT_POINT 3
+#define UNIT_PIXEL 4
+#define UNIT_MAX_ID UNIT_PIXEL
+
+using namespace ::com::sun::star;
+
+static sal_Int16 GetFilterFormat( String& rExt )
+{
+ sal_Int16 nFormat = FORMAT_UNKNOWN;
+ ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
+ if ( aExt.Equals( "JPG" ) )
+ nFormat = FORMAT_JPG;
+ else if ( aExt.Equals( "PNG" ) )
+ nFormat = FORMAT_PNG;
+ else if ( aExt.Equals( "BMP" ) )
+ nFormat = FORMAT_BMP;
+ else if ( aExt.Equals( "GIF" ) )
+ nFormat = FORMAT_GIF;
+ else if ( aExt.Equals( "PBM" ) )
+ nFormat = FORMAT_PBM;
+ else if ( aExt.Equals( "PGM" ) )
+ nFormat = FORMAT_PGM;
+ else if ( aExt.Equals( "PPM" ) )
+ nFormat = FORMAT_PPM;
+ else if ( aExt.Equals( "PCT" ) )
+ nFormat = FORMAT_PCT;
+ else if ( aExt.Equals( "RAS" ) )
+ nFormat = FORMAT_RAS;
+ else if ( aExt.Equals( "TIF" ) )
+ nFormat = FORMAT_TIF;
+ else if ( aExt.Equals( "XPM" ) )
+ nFormat = FORMAT_XPM;
+ else if ( aExt.Equals( "WMF" ) )
+ nFormat = FORMAT_WMF;
+ else if ( aExt.Equals( "EMF" ) )
+ nFormat = FORMAT_EMF;
+ else if ( aExt.Equals( "EPS" ) )
+ nFormat = FORMAT_EPS;
+ else if ( aExt.Equals( "MET" ) )
+ nFormat = FORMAT_MET;
+ else if ( aExt.Equals( "SVG" ) )
+ nFormat = FORMAT_SVG;
+ else if ( aExt.Equals( "SVM" ) )
+ nFormat = FORMAT_SVM;
+ return nFormat;
+}
+
+static MapUnit GetMapUnit( sal_Int32 nUnit )
+{
+ MapUnit aMapUnit( MAP_PIXEL );
+ switch( nUnit )
+ {
+ case UNIT_INCH : aMapUnit = MAP_INCH; break;
+ case UNIT_CM : aMapUnit = MAP_CM; break;
+ case UNIT_MM : aMapUnit = MAP_MM; break;
+ case UNIT_POINT : aMapUnit = MAP_POINT; break;
+ case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break;
+ }
+ return aMapUnit;
+}
+
+sal_Int32 ExportDialog::GetDefaultUnit()
+{
+ sal_Int32 nDefaultUnit = UNIT_CM;
+ switch( mrFltCallPara.eFieldUnit )
+ {
+// case FUNIT_NONE :
+// case FUNIT_PERCENT :
+// case FUNIT_CUSTOM :
+ default: nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_MILE : // PASSTHROUGH INTENDED
+ case FUNIT_FOOT :
+ case FUNIT_TWIP :
+ case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break;
+
+ case FUNIT_KM : // PASSTHROUGH INTENDED
+ case FUNIT_M :
+ case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break;
+
+ case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break;
+ case FUNIT_CM : nDefaultUnit = UNIT_CM; break;
+ case FUNIT_MM : nDefaultUnit = UNIT_MM; break;
+ case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break;
+ }
+ return nDefaultUnit;
+}
+
+static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape,
+ const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation )
+{
+ basegfx::B2DRange aShapeRange;
+
+ const uno::Sequence< beans::PropertyValue > aParams;
+ const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) );
+
+ const sal_Int32 nCount = aPrimitiveSequence.getLength();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) );
+ aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) );
+ }
+ return aShapeRange;
+}
+
+uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpdateConfig )
+{
+ if ( bUpdateConfig )
+ {
+ sal_Int32 nUnit = maLbSizeX.GetSelectEntryPos();
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+
+ if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) )
+ nUnit = UNIT_DEFAULT;
+
+ // updating ui configuration
+ if ( mbIsPixelFormat )
+ {
+ if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( nResolution < 1 )
+ nResolution = 96;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), nUnit );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), nResolution );
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), maLbResolution.GetSelectEntryPos() );
+ }
+ else
+ {
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+
+ mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), nUnit );
+ }
+ }
+
+ FilterConfigItem* pFilterOptions;
+ if ( bUpdateConfig )
+ pFilterOptions = mpFilterOptionsItem;
+ else
+ {
+ uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() );
+ pFilterOptions = new FilterConfigItem( &aFilterData );
+ }
+
+ const String sLogicalWidth( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ) );
+ const String sLogicalHeight( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ) );
+ if ( mbIsPixelFormat )
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelWidth" ) ), static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelHeight" ) ), static_cast< sal_Int32 >( maSize.Height ) );
+ if ( maResolution.Width && maResolution.Height )
+ {
+ const double f100thmmPerPixelX = 100000.0 / maResolution.Width;
+ const double f100thmmPerPixelY = 100000.0 / maResolution.Height;
+ sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width );
+ sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height );
+ if ( nLogicalWidth && nLogicalHeight )
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth );
+ pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight );
+ }
+ }
+ }
+ else
+ {
+ pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) );
+ pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) );
+ }
+ switch ( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = maLbColorDepth.GetSelectEntryPos();
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), nColor );
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ }
+ break;
+
+ case FORMAT_PNG :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) );
+ sal_Int32 nInterlace = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nInterlace++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace );
+ }
+ break;
+
+ case FORMAT_BMP :
+ {
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), maLbColorDepth.GetSelectEntryPos() + 1 );
+ pFilterOptions->WriteBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), maCbRLEEncoding.IsChecked() );
+ }
+ break;
+
+ case FORMAT_GIF :
+ {
+ sal_Int32 nValue = 0;
+ if ( maCbInterlaced.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nValue );
+
+ nValue = 0;
+ if ( maCbSaveTransparency.IsChecked() )
+ nValue++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), nValue );
+ }
+ break;
+
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ sal_Int32 nFormat = 0;
+ if ( maRbText.IsChecked() )
+ nFormat++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), nFormat );
+ }
+ break;
+
+ case FORMAT_EPS :
+ {
+ sal_Int32 nCheck = 0;
+ if ( maCbEPSPreviewTIFF.IsChecked() )
+ nCheck++;
+ if ( maCbEPSPreviewEPSI.IsChecked() )
+ nCheck += 2;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSLevel2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSColorFormat2.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), nCheck );
+
+ nCheck = 1;
+ if ( maRbEPSCompressionNone.IsChecked() )
+ nCheck++;
+ pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), nCheck );
+ }
+ break;
+ }
+
+ uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() );
+ if ( bUpdateConfig == sal_False )
+ delete pFilterOptions;
+ return aRet;
+}
+
+//
+awt::Size ExportDialog::GetOriginalSize()
+{
+ basegfx::B2DRange aShapesRange;
+
+ if ( mxPage.is () )
+ {
+ uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY );
+ if ( xPagePropSet.is() )
+ {
+ sal_Int32 nWidth = 0;
+ sal_Int32 nHeight= 0;
+ com::sun::star::uno::Any aAny;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) );
+ aAny >>= nWidth;
+ aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) );
+ aAny >>= nHeight;
+ aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight );
+ }
+ }
+ else
+ {
+ uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory(
+ mxMgr->createInstance( String( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.graphic.PrimitiveFactory2D" ) ) ), uno::UNO_QUERY );
+ if ( xPrimitiveFactory.is() )
+ {
+ basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() );
+ com::sun::star::geometry::AffineMatrix2D aTransformation;
+ aTransformation.m00 = aViewTransformation.get(0,0);
+ aTransformation.m01 = aViewTransformation.get(0,1);
+ aTransformation.m02 = aViewTransformation.get(0,2);
+ aTransformation.m10 = aViewTransformation.get(1,0);
+ aTransformation.m11 = aViewTransformation.get(1,1);
+ aTransformation.m12 = aViewTransformation.get(1,2);
+
+ const rtl::OUString sViewTransformation( RTL_CONSTASCII_USTRINGPARAM( "ViewTransformation" ) );
+ uno::Sequence< beans::PropertyValue > aViewInformation( 1 );
+ aViewInformation[ 0 ].Value <<= aTransformation;
+ aViewInformation[ 0 ].Name = sViewTransformation;
+
+ if ( mxShape.is() )
+ aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation );
+ else if ( mxShapes.is() )
+ {
+ const sal_Int32 nCount = mxShapes->getCount();
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ mxShapes->getByIndex( nIndex ) >>= xShape;
+ aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) );
+ }
+ }
+ }
+ }
+ return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
+}
+
+void ExportDialog::GetGraphicSource()
+{
+ if ( mxSourceDocument.is() )
+ {
+ uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY );
+ if ( xModel.is() )
+ {
+ uno::Reference< frame::XController > xController( xModel->getCurrentController() );
+ if ( xController.is() )
+ {
+ if ( mbExportSelection ) // check if there is a selection
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY );
+ if ( xSelectionSupplier.is() )
+ {
+ uno::Any aAny( xSelectionSupplier->getSelection() );
+ if ( ! ( aAny >>= mxShapes ) )
+ aAny >>= mxShape;
+ }
+ }
+ if ( !mxShape.is() && !mxShapes.is() )
+ {
+ uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY );
+ if ( xDrawView.is() )
+ {
+ uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() );
+ if ( xCurrentPage.is() )
+ {
+ mxPage = xCurrentPage; // exporting whole page
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+sal_Bool ExportDialog::GetGraphicStream()
+{
+ sal_Bool bRet = sal_False;
+
+ if ( !IsTempExportAvailable() )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+ return bRet;
+ }
+
+ sal_Bool bRecreateOutputStream = mpTempStream->Tell() == 0;
+
+ static uno::Sequence< beans::PropertyValue > aOldFilterData;
+ uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( sal_False ) );
+ if ( aOldFilterData != aNewFilterData )
+ {
+ aOldFilterData = aNewFilterData;
+ bRecreateOutputStream = sal_True;
+ }
+ try
+ {
+ if ( bRecreateOutputStream )
+ {
+ delete mpTempStream, mpTempStream = new SvMemoryStream();
+ maBitmap = Bitmap();
+
+ uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) );
+ uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
+
+ uno::Reference< document::XExporter > xGraphicExporter(
+ mxMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter") ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW );
+
+ sal_Int32 nProperties = 2;
+ uno::Sequence< beans::PropertyValue > aFilterData( nProperties );
+
+
+ rtl::OUString sFormat( maExt );
+ uno::Sequence< beans::PropertyValue > aDescriptor( 3 );
+ aDescriptor[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OutputStream") );
+ aDescriptor[0].Value <<= xOutputStream;
+ aDescriptor[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
+ aDescriptor[1].Value <<= sFormat;
+ aDescriptor[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
+ aDescriptor[2].Value <<= aNewFilterData;
+
+ uno::Reference< lang::XComponent > xSourceDoc;
+ if ( mxPage.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW );
+ else if ( mxShapes.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW );
+ else if ( mxShape.is() )
+ xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );;
+ if ( xSourceDoc.is() )
+ {
+ xGraphicExporter->setSourceDocument( xSourceDoc );
+ xFilter->filter( aDescriptor );
+ bRet = sal_True;
+
+ if ( mnFormat == FORMAT_JPG )
+ {
+ mpTempStream->Seek( STREAM_SEEK_TO_BEGIN );
+ maBitmap = GetGraphicBitmap( *mpTempStream );
+ mpTempStream->Seek( STREAM_SEEK_TO_END );
+ }
+ }
+ }
+ else
+ bRet = sal_True;
+ }
+ catch( uno::Exception& )
+ {
+
+ // ups
+
+ }
+ return bRet;
+}
+
+Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream )
+{
+ Bitmap aRet;
+ Graphic aGraphic;
+ GraphicFilter aFilter( sal_False );
+ if ( aFilter.ImportGraphic( aGraphic, String(), rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, NULL ) == GRFILTER_OK )
+ {
+ aRet = aGraphic.GetBitmap();
+ }
+ return aRet;
+}
+
+sal_uInt32 ExportDialog::GetRawFileSize() const
+{
+ sal_uInt64 nRawFileSize = 0;
+ if ( mbIsPixelFormat )
+ {
+ sal_Int32 nBitsPerPixel = 24;
+ String aEntry( maLbColorDepth.GetSelectEntry() );
+ if ( ms1BitTreshold == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms1BitDithered == aEntry )
+ nBitsPerPixel = 1;
+ else if ( ms4BitGrayscale == aEntry )
+ nBitsPerPixel = 4;
+ else if ( ms4BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitGrayscale == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms8BitColorPalette == aEntry )
+ nBitsPerPixel = 8;
+ else if ( ms24BitColor == aEntry )
+ nBitsPerPixel = 24;
+
+ if ( mbIsPixelFormat )
+ {
+ nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits
+ nRawFileSize /= 8; // in bytes
+ nRawFileSize *= maSize.Height;
+ }
+ if ( nRawFileSize > SAL_MAX_UINT32 )
+ nRawFileSize = 0;
+ }
+ return static_cast< sal_uInt32 >( nRawFileSize );
+}
+
+// checks if the source dimension/resolution is not too big
+// to determine the exact graphic output size and preview for jpg
+sal_Bool ExportDialog::IsTempExportAvailable() const
+{
+ return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview );
+}
+
+ExportDialog::ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsPixelFormat ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT, *rPara.pResMgr ) ),
+ mrFltCallPara ( rPara ),
+ mpMgr ( rPara.pResMgr ),
+ mxMgr ( rxMgr ),
+ mxSourceDocument ( rxSourceDocument ),
+ maFlExportSize ( this, ResId( FL_EXPORT_SIZE, *rPara.pResMgr ) ),
+ maFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ),
+ maMfSizeX ( this, ResId( MF_SIZEX, *rPara.pResMgr ) ),
+ maLbSizeX ( this, ResId( LB_SIZEX, *rPara.pResMgr ) ),
+ maFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ),
+ maMfSizeY ( this, ResId( MF_SIZEY, *rPara.pResMgr ) ),
+ maLbSizeY ( this, ResId( LB_SIZEY, *rPara.pResMgr ) ),
+ maFtResolution ( this, ResId( FT_RESOLUTION, *rPara.pResMgr ) ),
+ maNfResolution ( this, ResId( NF_RESOLUTION, *rPara.pResMgr ) ),
+ maLbResolution ( this, ResId( LB_RESOLUTION, *rPara.pResMgr ) ),
+ maFlColorDepth ( this, ResId( FL_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maLbColorDepth ( this, ResId( LB_COLOR_DEPTH, *rPara.pResMgr ) ),
+ maFlJPGQuality ( this, ResId( FL_JPG_QUALITY, *rPara.pResMgr ) ),
+ maFlMode ( this, ResId( FL_MODE, *rPara.pResMgr ) ),
+ maFlPBMOptions ( this, ResId( FL_PBM_OPTIONS, *rPara.pResMgr ) ),
+ maSbCompression ( this, ResId( SB_COMPRESSION, *rPara.pResMgr ) ),
+ maNfCompression ( this, ResId( NF_COMPRESSION, *rPara.pResMgr ) ),
+ maFtJPGMin ( this, ResId( FT_JPG_MIN, *rPara.pResMgr ) ),
+ maFtJPGMax ( this, ResId( FT_JPG_MAX, *rPara.pResMgr ) ),
+ maFtPNGMin ( this, ResId( FT_PNG_MIN, *rPara.pResMgr ) ),
+ maFtPNGMax ( this, ResId( FT_PNG_MAX, *rPara.pResMgr ) ),
+ maCbJPGPreview ( this, ResId( CB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maCbInterlaced ( this, ResId( CB_INTERLACED, *rPara.pResMgr ) ),
+ maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ),
+ maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ),
+ maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ),
+ maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ),
+ maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ),
+ maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ),
+ maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ),
+ maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ),
+ maFlEPSVersion ( this, ResId( FL_EPS_VERSION, *rPara.pResMgr ) ),
+ maRbEPSLevel1 ( this, ResId( RB_EPS_LEVEL1, *rPara.pResMgr ) ),
+ maRbEPSLevel2 ( this, ResId( RB_EPS_LEVEL2, *rPara.pResMgr ) ),
+ maFlEPSColorFormat ( this, ResId( FL_EPS_COLOR_FORMAT, *rPara.pResMgr ) ),
+ maRbEPSColorFormat1 ( this, ResId( RB_EPS_COLOR_FORMAT1, *rPara.pResMgr ) ),
+ maRbEPSColorFormat2 ( this, ResId( RB_EPS_COLOR_FORMAT2, *rPara.pResMgr ) ),
+ maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ),
+ maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ),
+ maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ),
+ maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ),
+ msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ),
+ msEstimatedSizePix2 ( ResId( STR_ESTIMATED_SIZE_PIX_2, *rPara.pResMgr ) ),
+ msEstimatedSizeVec ( ResId( STR_ESTIMATED_SIZE_VEC, *rPara.pResMgr ) ),
+ maFlButtons ( this, ResId( FL_BUTTONS, *rPara.pResMgr ) ),
+ maFbJPGPreview ( this, ResId( FB_JPG_PREVIEW, *rPara.pResMgr ) ),
+ maSbZoom ( this, ResId( SB_ZOOM, *rPara.pResMgr ) ),
+ maNfZoom ( this, ResId( NF_ZOOM, *rPara.pResMgr ) ),
+ maSbJPGPreviewHorz ( this, ResId( SB_JPG_PREVIEW_HORZ, *rPara.pResMgr ) ),
+ maSbJPGPreviewVert ( this, ResId( SB_JPG_PREVIEW_VERT, *rPara.pResMgr ) ),
+ maBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
+ maBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
+ maBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
+ ms1BitTreshold ( ResId( STR_1BIT_THRESHOLD, *rPara.pResMgr ) ),
+ ms1BitDithered ( ResId( STR_1BIT_DITHERED, *rPara.pResMgr ) ),
+ ms4BitGrayscale ( ResId( STR_4BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms4BitColorPalette ( ResId( STR_4BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms8BitGrayscale ( ResId( STR_8BIT_GRAYSCALE, *rPara.pResMgr ) ),
+ ms8BitColorPalette ( ResId( STR_8BIT_COLOR_PALETTE, *rPara.pResMgr ) ),
+ ms24BitColor ( ResId( STR_24BIT_TRUE_COLOR, *rPara.pResMgr ) ),
+ maExt ( rPara.aFilterExt ),
+ mnFormat ( FORMAT_UNKNOWN ),
+ mnMaxFilesizeForRealtimePreview( 0 ),
+ mpTempStream ( new SvMemoryStream() ),
+ maOriginalSize ( awt::Size( 0, 0 ) ),
+ mbPreview ( sal_False ),
+ mbIsPixelFormat ( bIsPixelFormat ),
+ mbExportSelection ( bExportSelection ),
+ mbPreserveAspectRatio ( sal_True )
+{
+ GetGraphicSource();
+
+ maExt.ToUpperAscii();
+
+ String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) );
+ mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+ aFilterConfigPath.Append( maExt );
+ mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
+
+ mnInitialResolutionUnit = mbIsPixelFormat
+ ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_DEFAULT )
+ : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_DEFAULT );
+
+ mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 );
+ maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) );
+
+ String aTitle( maExt );
+ aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) );
+ SetText( aTitle );
+
+ mnFormat = GetFilterFormat( maExt );
+
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ maResolution.Width = aResolution.Width();
+ maResolution.Height= aResolution.Height();
+ maOriginalSize = GetOriginalSize();
+ if ( bIsPixelFormat )
+ {
+ double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0;
+ maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ),
+ static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) );
+ }
+ else
+ {
+ maSize = maOriginalSize;
+ }
+
+ // Size
+ maLbSizeX.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maSbCompression.SetScrollHdl( LINK( this, ExportDialog, SbCompressionUpdateHdl ) );
+ maNfCompression.SetModifyHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maMfSizeX.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) );
+ maMfSizeY.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) );
+
+ maNfResolution.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) );
+ maLbResolution.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maLbColorDepth.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbInterlaced.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbSaveTransparency.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maCbEPSPreviewTIFF.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maCbEPSPreviewEPSI.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbEPSCompressionLZW.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSCompressionNone.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maRbBinary.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbText.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+
+ // JPG Preview
+// maCbJPGPreview.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+maCbJPGPreview.Enable( sal_False );
+
+ maSbJPGPreviewVert.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbJPGPreviewHorz.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maSbZoom.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // BMP
+ maCbRLEEncoding.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ // EPS
+ maRbEPSLevel1.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+ maRbEPSLevel2.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
+
+ maBtnOK.SetClickHdl( LINK( this, ExportDialog, OK ) );
+
+ setupLayout();
+ updateControls();
+
+ FreeResource();
+}
+
+void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout )
+{
+ size_t nIndex;
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ // Size controls
+ rLayout.addWindow( &maFlExportSize );
+
+ Size aLbMax( maLbSizeX.GetSizePixel() );
+ aLbMax.Width() = Max( aLbMax.Width(), maLbResolution.GetSizePixel().Width() );
+
+ boost::shared_ptr< vcl::LabelColumn > xSizeColumns( new vcl::LabelColumn( &rLayout ) );
+ rLayout.addChild( xSizeColumns );
+
+ // row 1
+ boost::shared_ptr< vcl::RowOrColumn > xColumn( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeX, xColumn, nIndent );
+ Size aMinSize( maMfSizeX.GetSizePixel() );
+ nIndex = xColumn->addWindow( &maMfSizeX );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeX );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 2
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtSizeY, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maMfSizeY );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbSizeY );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+
+ // row 3
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport)
+ {
+ xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) );
+ xSizeColumns->addRow( &maFtResolution, xColumn, nIndent );
+ nIndex = xColumn->addWindow( &maNfResolution );
+ xColumn->setMinimumSize( nIndex, aMinSize );
+ nIndex = xColumn->addWindow( &maLbResolution );
+ xColumn->setMinimumSize( nIndex, aLbMax );
+ }
+
+ sal_Int32 nUnit = mnInitialResolutionUnit;
+ if ( nUnit == UNIT_DEFAULT )
+ nUnit = GetDefaultUnit();
+
+ if ( !mbIsPixelFormat )
+ {
+ maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel
+ if ( nUnit >= UNIT_PIXEL )
+ nUnit = UNIT_CM;
+ }
+ else if ( nUnit > UNIT_MAX_ID )
+ nUnit = UNIT_PIXEL;
+ if ( nUnit < 0 )
+ nUnit = UNIT_CM;
+ maLbSizeX.SelectEntryPos( static_cast< sal_uInt16 >( nUnit ) );
+
+ if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes
+ { // sense eg for bitmap fillings in metafiles, to preserve high dpi output
+ // (atm without special vector support the bitmaps are rendered with 96dpi)
+ sal_Int32 nResolution = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), 96 );
+ if ( nResolution < 1 )
+ nResolution = 96;
+ maNfResolution.SetValue( nResolution );
+
+ sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 );
+ if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) )
+ nResolutionUnit = 1;
+ maLbResolution.SelectEntryPos( static_cast< sal_uInt16 >( nResolutionUnit ) );
+ }
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createColorDepthControls( vcl::RowOrColumn& rLayout )
+{
+ // Color Depth
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ xRow->addWindow( &maFlColorDepth );
+
+ xRow = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ xRow->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maLbColorDepth );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+}
+
+void ExportDialog::createScrollBar( vcl::RowOrColumn& rLayout )
+{
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xRow );
+
+ Size aMinSize( maSbCompression.GetSizePixel() );
+ size_t nIndex = xRow->addWindow( &maSbCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+ aMinSize = maNfCompression.GetSizePixel();
+ nIndex = xRow->addWindow( &maNfCompression );
+ xRow->setMinimumSize( nIndex, aMinSize );
+}
+
+void ExportDialog::createFilterOptions( vcl::RowOrColumn& rLayout )
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ long nIndent = aBorder.Width();
+
+ switch( mnFormat )
+ {
+ case FORMAT_JPG :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 );
+ if ( nColor == 1 )
+ nColor = 0;
+ else
+ nColor = 1;
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // Quality
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtJPGMin );
+ xRows->addWindow( &maFtJPGMax );
+ if ( maCbJPGPreview.IsEnabled() )
+ xRows->addWindow( &maCbJPGPreview );
+
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 );
+ if ( ( nQuality < 1 ) || ( nQuality > 100 ) )
+ nQuality = 75;
+
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 100 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 100 );
+ maNfCompression.SetValue( nQuality );
+ maNfCompression.SetStrictFormat( sal_True );
+ if ( maCbJPGPreview.IsEnabled() )
+ maCbJPGPreview.Check( sal_False );
+ }
+ break;
+ case FORMAT_PNG :
+ {
+ rLayout.addWindow( &maFlCompression );
+
+ // Compression 1..9
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ createScrollBar( *xRows.get() );
+ xRows->addWindow( &maFtPNGMin );
+ xRows->addWindow( &maFtPNGMax );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ // Interlaced
+ rLayout.addWindow( &maFlMode );
+ xIndenter.reset( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows.reset( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 );
+ if ( ( nCompression < 1 ) || ( nCompression > 9 ) )
+ nCompression = 6;
+ maSbCompression.SetRangeMin( 1 );
+ maSbCompression.SetRangeMax( 9 );
+ maNfCompression.SetMin( 1 );
+ maNfCompression.SetMax( 9 );
+ maNfCompression.SetValue( 9 );
+ maNfCompression.SetStrictFormat( sal_True );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ) != 0 );
+ }
+ break;
+ case FORMAT_BMP :
+ {
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 );
+ if ( nColor == 0 )
+ nColor = 6;
+ else
+ nColor--;
+ maLbColorDepth.InsertEntry( ms1BitTreshold );
+ maLbColorDepth.InsertEntry( ms1BitDithered );
+ maLbColorDepth.InsertEntry( ms4BitGrayscale );
+ maLbColorDepth.InsertEntry( ms4BitColorPalette );
+ maLbColorDepth.InsertEntry( ms8BitGrayscale );
+ maLbColorDepth.InsertEntry( ms8BitColorPalette );
+ maLbColorDepth.InsertEntry( ms24BitColor );
+ maLbColorDepth.SelectEntryPos( nColor );
+ createColorDepthControls( maLayout );
+
+ rLayout.addWindow( &maFlCompression );
+ // RLE coding
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbRLEEncoding );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbRLEEncoding.Check( mpFilterOptionsItem->ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ) );
+ }
+ break;
+ case FORMAT_GIF :
+ {
+ rLayout.addWindow( &maFlMode );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbInterlaced );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ rLayout.addWindow( &maFlGIFDrawingObjects );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbSaveTransparency );
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 1 ) != 0 );
+ maCbSaveTransparency.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), 1 ) != 0 );
+ }
+ break;
+ case FORMAT_PBM :
+ case FORMAT_PGM :
+ case FORMAT_PPM :
+ {
+ rLayout.addWindow( &maFlJPGQuality );
+
+ // RB Binary / Text
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) );
+ rLayout.addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbBinary );
+ xRows->addWindow( &maRbText );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), 1 );
+ maRbBinary.Check( nFormat == 0 );
+ maRbText.Check( nFormat != 0 );
+ }
+ break;
+ case FORMAT_EPS :
+ {
+ boost::shared_ptr< vcl::RowOrColumn > xColumns( new vcl::RowOrColumn( &rLayout, false ) );
+ rLayout.addChild( xColumns );
+ boost::shared_ptr< vcl::RowOrColumn > xLeft( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xLeft );
+
+ xLeft->addWindow( &maFlEPSPreview );
+ boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maCbEPSPreviewTIFF );
+ xRows->addWindow( &maCbEPSPreviewEPSI );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ xLeft->addWindow( &maFlEPSVersion );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xLeft.get(), nIndent ) );
+ xLeft->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xLeft.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSLevel1 );
+ xRows->addWindow( &maRbEPSLevel2 );
+ xSpacer.reset( new vcl::Spacer( xLeft.get(), 2 ) );
+ xLeft->addChild( xSpacer );
+
+ boost::shared_ptr< vcl::RowOrColumn > xRight( new vcl::RowOrColumn( &rLayout, true ) );
+ xColumns->addChild( xRight );
+
+ xRight->addWindow( &maFlEPSColorFormat );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSColorFormat1 );
+ xRows->addWindow( &maRbEPSColorFormat2 );
+ xSpacer.reset( new vcl::Spacer( xRight.get(), 2 ) );
+ xRight->addChild( xSpacer );
+
+ xRight->addWindow( &maFlCompression );
+ xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) );
+ xRight->addChild( xIndenter );
+ xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) );
+ xIndenter->setChild( xRows );
+ xRows->addWindow( &maRbEPSCompressionLZW );
+ xRows->addWindow( &maRbEPSCompressionNone );
+
+ xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), 0 );
+ sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), 2 );
+ sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), 0 );
+ sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), 2 );
+
+ mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ), 0 );
+
+ maCbEPSPreviewTIFF.Check( ( nPreview & 1 ) != 0 );
+ maCbEPSPreviewEPSI.Check( ( nPreview & 2 ) != 0 );
+
+ maRbEPSLevel1.Check( nVersion == 1 );
+ maRbEPSLevel2.Check( nVersion == 2 );
+
+ maRbEPSColorFormat1.Check( nColor == 1 );
+ maRbEPSColorFormat2.Check( nColor != 1 );
+
+ maRbEPSCompressionLZW.Check( nCompr == 1 );
+ maRbEPSCompressionNone.Check( nCompr != 1 );
+ }
+ break;
+ }
+}
+
+void ExportDialog::createButtons( vcl::RowOrColumn& rLayout )
+{
+ rLayout.addWindow( &maFlButtons );
+ boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) );
+ rLayout.addChild( xSpacer );
+
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &rLayout, false ) );
+ size_t nIndex = rLayout.addChild( xButtons );
+ rLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+
+ Size aMinSize( maBtnCancel.GetSizePixel() );
+ // insert help button
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnHelp ), aMinSize );
+
+ // insert a spacer, cancel and OK buttons are right aligned
+
+ xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) );
+ xButtons->addChild( xSpacer );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnOK ), aMinSize );
+ xButtons->setMinimumSize( xButtons->addWindow( &maBtnCancel ), aMinSize );
+}
+
+void ExportDialog::setupLayout()
+{
+ Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ maLayout.setParentWindow( this );
+ maLayout.setOuterBorder( aBorder.Width() );
+
+ createSizeControls( maLayout );
+ createFilterOptions( maLayout );
+
+ if ( mnMaxFilesizeForRealtimePreview || mbIsPixelFormat )
+ {
+ maLayout.addWindow( &maFlEstimatedSize );
+ maLayout.addWindow( &maFtEstimatedSize );
+ }
+ createButtons( maLayout );
+
+ maLayout.show();
+ maDialogSize = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ maLayout.setManagedArea( Rectangle( Point(), maDialogSize ) );
+ SetOutputSizePixel( Size( mbPreview ? maDialogSize.Width() * 2 : maDialogSize.Width(), maDialogSize.Height() ) );
+
+ maRectFlButtons = Rectangle( maFlButtons.GetPosPixel(), maFlButtons.GetSizePixel() );
+ maRectBtnHelp = Rectangle( maBtnHelp.GetPosPixel(), maBtnHelp.GetSizePixel() );
+ maRectBtnOK = Rectangle( maBtnOK.GetPosPixel(), maBtnOK.GetSizePixel() );
+ maRectBtnCancel = Rectangle( maBtnCancel.GetPosPixel(), maBtnOK.GetSizePixel() );
+
+ maLbSizeY.Hide();
+}
+
+static rtl::OUString ImpValueOfInKB( const sal_Int64& rVal )
+{
+ double fVal( static_cast<double>( rVal ) );
+ fVal /= ( 1 << 10 );
+ fVal += 0.05;
+ rtl::OUStringBuffer aVal( rtl::OUString::valueOf( fVal ) );
+ sal_Int32 nX( rtl::OUString( aVal.getStr() ).indexOf( '.', 0 ) );
+ if ( nX > 0 )
+ aVal.setLength( nX + 2 );
+ return aVal.makeStringAndClear();
+}
+
+sal_Int32 static GetZoomValueFromThumbPos( sal_Int32 nThumbPos )
+{
+ sal_Int32 nProz = 0;
+ if ( nThumbPos <= 50 )
+ nProz = nThumbPos * 2; // so a range of 50 represents 100%
+ else
+ nProz = ( ( nThumbPos - 50 ) * 60 ) + 100; // we want to scale up to 3000%
+ return nProz;
+}
+
+void ExportDialog::updatePreview()
+{
+ // JPG
+// maCbJPGPreview.Enable( IsTempExportAvailable() );
+
+// if ( maCbJPGPreview.IsEnabled() && maCbJPGPreview.IsChecked() )
+ if ( mbPreview )
+ {
+ long nScrollBarSize = Application::GetSettings().GetStyleSettings().GetScrollBarSize();
+
+ Point aPreviewPos( maDialogSize.Width(), 0 );
+ Size aPreviewSize( maDialogSize.Width(), maFlButtons.GetPosPixel().Y() );
+
+ Point aFixedBitmapPos( aPreviewPos );
+ Size aFixedBitmapSize( aPreviewSize );
+
+ maSbZoom.Show( sal_False );
+ maSbZoom.SetPosPixel( Point( aPreviewPos.X(), aPreviewPos.Y() ) );
+ maSbZoom.SetSizePixel( Size( aPreviewSize.Width() / 4, nScrollBarSize ) );
+ maNfZoom.Show( sal_False );
+ maNfZoom.SetPosPixel( Point( aPreviewPos.X() + aPreviewSize.Width() / 4, aPreviewPos.Y() ) );
+ maNfZoom.SetSizePixel( Size( aPreviewSize.Width() / 6, nScrollBarSize ) );
+ maNfZoom.SetValue( GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ) );
+ maFbJPGPreview.Show( sal_True );
+
+ sal_Int32 nZoom = GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() );
+ double fSizePixelX = static_cast< double >( maSize.Width * nZoom ) / 100.0;
+ double fSizePixelY = static_cast< double >( maSize.Height * nZoom ) / 100.0;
+
+ double fXRatio = fSizePixelX / maSize.Width; // the size of each pixel
+ double fYRatio = fSizePixelY / maSize.Height;
+
+ sal_Bool bHorzSb = fSizePixelX > aFixedBitmapSize.Width();
+ sal_Bool bVertSb = fSizePixelY > aFixedBitmapSize.Height();
+ if ( bHorzSb )
+ {
+ aFixedBitmapSize.Height() -= nScrollBarSize;
+
+ maSbJPGPreviewHorz.Show( sal_True );
+ maSbJPGPreviewHorz.SetPosPixel( Point( aFixedBitmapPos.X(), aFixedBitmapPos.Y() + aFixedBitmapSize.Height() ) );
+ maSbJPGPreviewHorz.SetSizePixel( Size( aFixedBitmapSize.Width(), nScrollBarSize ) );
+ }
+ else
+ {
+ maSbJPGPreviewHorz.Show( sal_False );
+ }
+
+
+ if ( bVertSb )
+ {
+ aFixedBitmapSize.Width() -= nScrollBarSize;
+
+ maSbJPGPreviewVert.Show( sal_True );
+ maSbJPGPreviewVert.SetPosPixel( Point( aFixedBitmapPos.X() + aFixedBitmapSize.Width(), aFixedBitmapPos.Y() ) );
+ maSbJPGPreviewVert.SetSizePixel( Size( nScrollBarSize, aFixedBitmapSize.Height() ) );
+ }
+ else
+ {
+ maSbJPGPreviewVert.Show( sal_False );
+ }
+
+ Point aPos( 0, 0 );
+ Size aSize;
+ if ( fXRatio > 1.0 )
+ {
+ aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+ else
+ {
+ aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
+ aSize.Width() /= static_cast<long int>(fXRatio);
+ }
+
+ if ( fYRatio > 1.0 )
+ {
+ aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+ else
+ {
+ aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
+ aSize.Height() /= static_cast<long int>(fYRatio);
+ }
+
+ if ( aSize.Width() < maSize.Width )
+ {
+ sal_Int32 nXDiff = static_cast< sal_Int32 >( ( ( ( maSize.Width - aSize.Width() ) * maSbJPGPreviewHorz.GetThumbPos() ) / 100.0 ) );
+ aPos.X() += nXDiff;
+ }
+ if ( aSize.Height() < maSize.Height )
+ {
+ sal_Int32 nYDiff = static_cast< sal_Int32 >( ( ( ( maSize.Height - aSize.Height() ) * maSbJPGPreviewVert.GetThumbPos() ) / 100.0 ) );
+ aPos.Y() += nYDiff;
+ }
+
+ Bitmap aCroppedBitmap( maBitmap );
+ aCroppedBitmap.Crop( Rectangle( aPos, aSize ) );
+ aSize = aCroppedBitmap.GetSizePixel();
+ aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) );
+ aCroppedBitmap.Scale( aSize );
+
+ if ( aSize.Width() > aFixedBitmapSize.Width() )
+ aSize.Width() = aFixedBitmapSize.Width();
+ if ( aSize.Height() > aFixedBitmapSize.Height() )
+ aSize.Height() = aFixedBitmapSize.Height();
+ Point aPoint( aFixedBitmapPos );
+ if ( aSize.Width() < aFixedBitmapSize.Width() )
+ aPoint.X() += ( aFixedBitmapSize.Width() - aSize.Width() ) / 2;
+ if ( aSize.Height() < aFixedBitmapSize.Height() )
+ aPoint.Y() += ( aFixedBitmapSize.Height() - aSize.Height() ) / 2;
+
+ maFbJPGPreview.SetPosPixel( aPoint );
+ maFbJPGPreview.SetSizePixel( aSize );
+ maFbJPGPreview.SetBitmap( aCroppedBitmap );
+
+ SetOutputSizePixel( Size( maDialogSize.Width() * 2, maDialogSize.Height() ) );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth() * 2, maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left() + maDialogSize.Width(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left() + maDialogSize.Width(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left() + maDialogSize.Width(), maRectBtnCancel.Top() ) );
+ }
+ else
+ {
+ maSbZoom.Show( sal_False );
+ maNfZoom.Show( sal_False );
+ maFbJPGPreview.Show( sal_False );
+ maSbJPGPreviewHorz.Show( sal_False );
+ maSbJPGPreviewVert.Show( sal_False );
+
+ SetOutputSizePixel( maDialogSize );
+
+ maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth(), maRectFlButtons.GetHeight() ) );
+ maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left(), maRectBtnHelp.Top() ) );
+ maBtnOK.SetPosPixel( Point( maRectBtnOK.Left(), maRectBtnOK.Top() ) );
+ maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left(), maRectBtnCancel.Top() ) );
+ }
+}
+
+void ExportDialog::updateControls()
+{
+ GetGraphicStream();
+
+ // Size Controls
+ if ( !mbIsPixelFormat )
+ {
+ awt::Size aSize100thmm( maSize );
+ Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM,
+ MapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) ) );
+ maMfSizeX.SetValue( aSize.Width() );
+ maMfSizeY.SetValue( aSize.Height() );
+ }
+ else
+ {
+ MapUnit aMapUnit( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) );
+ if ( aMapUnit == MAP_PIXEL )
+ { // calculating pixel count via resolution and original graphic size
+ maMfSizeX.SetDecimalDigits( 0 );
+ maMfSizeY.SetDecimalDigits( 0 );
+ maMfSizeX.SetValue( maSize.Width );
+ maMfSizeY.SetValue( maSize.Height );
+ }
+ else
+ {
+ maMfSizeX.SetDecimalDigits( 2 );
+ maMfSizeY.SetDecimalDigits( 2 );
+ double fRatio;
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
+ case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
+ case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
+ default:
+ case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
+ }
+ maMfSizeX.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) );
+ maMfSizeY.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) );
+ }
+ }
+ sal_Int32 nResolution = 0;
+ switch( maLbResolution.GetSelectEntryPos() )
+ {
+ case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm
+ case 2 : nResolution = maResolution.Width; break; // pixels / meter
+ default:
+ case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch
+ }
+ maNfResolution.SetValue( nResolution );
+
+ if ( maSbCompression.IsVisible() )
+ maSbCompression.SetThumbPos( maNfCompression.GetValue() );
+
+ // updating estimated size
+ sal_Int64 nRealFileSize( mpTempStream->Tell() );
+ if ( mbIsPixelFormat )
+ {
+ String aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 );
+ sal_Int64 nRawFileSize( GetRawFileSize() );
+ xub_StrLen nInd = aEst.Search( '%' );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
+
+ if ( nRealFileSize )
+ {
+ nInd = aEst.Search( '%', nInd );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ }
+ maFtEstimatedSize.SetText( aEst );
+ }
+ else
+ {
+ if ( mnMaxFilesizeForRealtimePreview )
+ {
+ String aEst( msEstimatedSizeVec );
+ xub_StrLen nInd = aEst.Search( '%', 0 );
+ aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ maFtEstimatedSize.SetText( aEst );
+ }
+ }
+ updatePreview();
+
+ // EPS
+ if ( maRbEPSLevel1.IsVisible() )
+ {
+ sal_Bool bEnabled = maRbEPSLevel1.IsChecked() == sal_False;
+ maRbEPSColorFormat1.Enable( bEnabled );
+ maRbEPSColorFormat2.Enable( bEnabled );
+ maRbEPSCompressionLZW.Enable( bEnabled );
+ maRbEPSCompressionNone.Enable( bEnabled );
+ }
+}
+
+ExportDialog::~ExportDialog()
+{
+ delete mpFilterOptionsItem;
+ delete mpOptionsItem;
+}
+
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+IMPL_LINK( ExportDialog, UpdateHdl, void *, EMPTYARG )
+{
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break;
+ }
+ maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nWidth = maMfSizeX.GetValue();
+ sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Width = aDest.Width();
+ if ( mbPreserveAspectRatio )
+ maSize.Height = aDest.Height();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG )
+{
+ double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height;
+
+ if ( mbIsPixelFormat )
+ {
+ switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) )
+ {
+ case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break;
+ case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break;
+ default:
+ case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break;
+ }
+ maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 );
+ }
+ else
+ {
+ Fraction aFract( 1, 100 );
+ sal_Int32 nHeight= maMfSizeY.GetValue();
+ sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio );
+ const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
+ MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+
+ maSize.Height = aDest.Height();
+ if ( mbPreserveAspectRatio )
+ maSize.Width = aDest.Width();
+ }
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, UpdateHdlNfResolution, void *, EMPTYARG )
+{
+ sal_Int32 nResolution = maNfResolution.GetValue();
+ if ( maLbResolution.GetSelectEntryPos() == 0 ) // pixels / cm
+ nResolution *= 100;
+ else if ( maLbResolution.GetSelectEntryPos() == 1 ) // pixels / inch
+ nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) );
+ maResolution.Width = nResolution;
+ maResolution.Height= nResolution;
+
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, SbCompressionUpdateHdl, void *, EMPTYARG )
+{
+ maNfCompression.SetValue( maSbCompression.GetThumbPos() );
+ updateControls();
+ return 0;
+}
+
+IMPL_LINK( ExportDialog, OK, void *, EMPTYARG )
+{
+ // writing config parameter
+
+
+ mrFltCallPara.aFilterData = GetFilterData( sal_True );
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc
new file mode 100755
index 000000000000..e230bcd2c5c3
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hrc
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include <svtools/svtools.hrc>
+
+#define BTN_OK 1
+#define BTN_CANCEL 1
+#define BTN_HELP 1
+
+#define FL_EXPORT_SIZE 1
+#define FL_COLOR_DEPTH 2
+#define FL_JPG_QUALITY 3
+#define FL_COMPRESSION 4
+#define FL_MODE 5
+#define FL_GIF_DRAWING_OBJECTS 6
+#define FL_PBM_OPTIONS 7
+#define FL_EPS_PREVIEW 8
+#define FL_EPS_VERSION 9
+#define FL_EPS_COLOR_FORMAT 10
+#define FL_ESTIMATED_SIZE 11
+#define FL_BUTTONS 12
+
+#define FT_SIZEX 1
+#define FT_SIZEY 2
+#define FT_RESOLUTION 3
+#define FT_JPG_MIN 4
+#define FT_JPG_MAX 5
+#define FT_PNG_MIN 6
+#define FT_PNG_MAX 7
+#define FT_ESTIMATED_SIZE 8
+
+#define NF_RESOLUTION 1
+#define NF_COMPRESSION 2
+#define NF_ZOOM 3
+
+#define MF_SIZEX 1
+#define MF_SIZEY 2
+
+#define LB_SIZEX 1
+#define LB_SIZEY 2
+#define LB_RESOLUTION 3
+#define LB_COLOR_DEPTH 4
+
+#define RB_BINARY 1
+#define RB_TEXT 2
+#define RB_EPS_LEVEL1 3
+#define RB_EPS_LEVEL2 4
+#define RB_EPS_COLOR_FORMAT1 5
+#define RB_EPS_COLOR_FORMAT2 6
+#define RB_EPS_COMPRESSION_LZW 7
+#define RB_EPS_COMPRESSION_NONE 8
+
+#define CB_JPG_PREVIEW 1
+#define CB_INTERLACED 2
+#define CB_RLE_ENCODING 3
+#define CB_SAVE_TRANSPARENCY 4
+#define CB_EPS_PREVIEW_TIFF 5
+#define CB_EPS_PREVIEW_EPSI 6
+
+#define FB_JPG_PREVIEW 1
+
+#define SB_COMPRESSION 1
+#define SB_JPG_PREVIEW_HORZ 2
+#define SB_JPG_PREVIEW_VERT 3
+#define SB_ZOOM 4
+
+#define STR_1BIT_THRESHOLD 1
+#define STR_1BIT_DITHERED 2
+#define STR_4BIT_GRAYSCALE 3
+#define STR_4BIT_COLOR_PALETTE 4
+#define STR_8BIT_GRAYSCALE 5
+#define STR_8BIT_COLOR_PALETTE 6
+#define STR_24BIT_TRUE_COLOR 7
+#define STR_ESTIMATED_SIZE_PIX_1 8
+#define STR_ESTIMATED_SIZE_PIX_2 9
+#define STR_ESTIMATED_SIZE_VEC 10
diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx
new file mode 100755
index 000000000000..20a9ac3ea832
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.hxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef _EXPORTDIALOG_HXX_
+#define _EXPORTDIALOG_HXX_
+
+#include <svtools/fltcall.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/arrange.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
+|*
+\************************************************************************/
+
+class FilterConfigItem;
+class ExportDialog : public ModalDialog
+{
+private:
+
+ FltCallDialogParameter&
+ mrFltCallPara;
+
+ ResMgr* mpMgr;
+
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ mxMgr;
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
+ mxSourceDocument;
+
+ FixedLine maFlExportSize;
+ FixedText maFtSizeX;
+ MetricField maMfSizeX;
+ ListBox maLbSizeX;
+ FixedText maFtSizeY;
+ MetricField maMfSizeY;
+ ListBox maLbSizeY;
+ FixedText maFtResolution;
+ NumericField maNfResolution;
+ ListBox maLbResolution;
+ FixedLine maFlColorDepth;
+ ListBox maLbColorDepth;
+ FixedLine maFlJPGQuality;
+ FixedLine maFlMode;
+ FixedLine maFlPBMOptions;
+ ScrollBar maSbCompression;
+ NumericField maNfCompression;
+ FixedText maFtJPGMin;
+ FixedText maFtJPGMax;
+ FixedText maFtPNGMin;
+ FixedText maFtPNGMax;
+ CheckBox maCbJPGPreview;
+ CheckBox maCbInterlaced;
+ CheckBox maCbRLEEncoding;
+ FixedLine maFlGIFDrawingObjects;
+ CheckBox maCbSaveTransparency;
+ RadioButton maRbBinary;
+ RadioButton maRbText;
+ FixedLine maFlEPSPreview;
+ CheckBox maCbEPSPreviewTIFF;
+ CheckBox maCbEPSPreviewEPSI;
+ FixedLine maFlEPSVersion;
+ RadioButton maRbEPSLevel1;
+ RadioButton maRbEPSLevel2;
+ FixedLine maFlEPSColorFormat;
+ RadioButton maRbEPSColorFormat1;
+ RadioButton maRbEPSColorFormat2;
+ FixedLine maFlCompression;
+ RadioButton maRbEPSCompressionLZW;
+ RadioButton maRbEPSCompressionNone;
+ FixedLine maFlEstimatedSize;
+ FixedText maFtEstimatedSize;
+ String msEstimatedSizePix1;
+ String msEstimatedSizePix2;
+ String msEstimatedSizeVec;
+ FixedLine maFlButtons;
+ FixedBitmap maFbJPGPreview;
+ ScrollBar maSbZoom;
+ NumericField maNfZoom;
+ ScrollBar maSbJPGPreviewHorz;
+ ScrollBar maSbJPGPreviewVert;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+
+ String ms1BitTreshold;
+ String ms1BitDithered;
+ String ms4BitGrayscale;
+ String ms4BitColorPalette;
+ String ms8BitGrayscale;
+ String ms8BitColorPalette;
+ String ms24BitColor;
+
+ vcl::RowOrColumn maLayout;
+ Size maDialogSize;
+
+ FilterConfigItem* mpOptionsItem;
+ FilterConfigItem* mpFilterOptionsItem;
+
+ String maExt;
+ String maEstimatedSizeText;
+ sal_Int16 mnFormat;
+ sal_Int32 mnMaxFilesizeForRealtimePreview;
+
+ Rectangle maRectFlButtons;
+ Rectangle maRectBtnHelp;
+ Rectangle maRectBtnOK;
+ Rectangle maRectBtnCancel;
+
+ SvStream* mpTempStream;
+ Bitmap maBitmap;
+
+ com::sun::star::awt::Size
+ maOriginalSize; // the original graphic size in 1/100mm
+ com::sun::star::awt::Size
+ maSize; // for vector graphics it always contains the logical size in 1/100mm
+
+ sal_Bool mbPreview;
+ sal_Bool mbIsPixelFormat;
+ sal_Bool mbExportSelection;
+ sal_Bool mbPreserveAspectRatio;
+
+ sal_Int32 mnInitialResolutionUnit;
+
+ // for pixel graphics it always contains the pixel count
+ com::sun::star::awt::Size
+ maResolution; // it always contains the number of pixels per meter
+
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
+ mxShape;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
+ mxShapes;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
+ mxPage;
+
+
+ DECL_LINK( UpdateHdl,void* p );
+ DECL_LINK( UpdateHdlMtfSizeX,void* p );
+ DECL_LINK( UpdateHdlMtfSizeY,void* p );
+ DECL_LINK( UpdateHdlNfResolution,void* p );
+ DECL_LINK( SbCompressionUpdateHdl,void* p );
+ DECL_LINK( NfCompressionUpdateHdlX,void* p );
+
+ DECL_LINK( OK, void* p );
+
+ void createSizeControls( vcl::RowOrColumn& );
+ void createColorDepthControls( vcl::RowOrColumn& );
+ void createFilterOptions( vcl::RowOrColumn& );
+ void createButtons( vcl::RowOrColumn& );
+ void createScrollBar( vcl::RowOrColumn& );
+ void setupLayout();
+ void updatePreview();
+ void updateControls();
+
+ void GetGraphicSource();
+ sal_Bool GetGraphicStream();
+ Bitmap GetGraphicBitmap( SvStream& rStream );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
+ GetFilterData( sal_Bool bUpdateConfig );
+
+ sal_uInt32 GetRawFileSize() const;
+ sal_Bool IsTempExportAvailable() const;
+
+ com::sun::star::awt::Size
+ GetOriginalSize();
+
+ sal_Int32 GetDefaultUnit();
+
+public:
+ ExportDialog( FltCallDialogParameter& rPara,
+ const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
+ sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat );
+ ~ExportDialog();
+};
+
+
+
+#endif // _EXPORTDIALOG_HXX_
+
diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src
new file mode 100644
index 000000000000..c9e87989a314
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/exportdialog.src
@@ -0,0 +1,529 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "exportdialog.hrc"
+
+String DLG_EXPORT_TITLE
+{
+ Text [ en-US ] = " Options" ;
+};
+
+ModalDialog DLG_EXPORT
+{
+ HelpID = "svtools:ModalDialog:DLG_EXPORT";
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 178 , 135 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ FixedLine FL_EXPORT_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Size" ;
+ };
+ FixedText FT_SIZEX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Width:" ;
+ };
+ MetricField MF_SIZEX
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEX";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255;
+ };
+ ListBox LB_SIZEX
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEX";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_SIZEY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Height:" ;
+ };
+ MetricField MF_SIZEY
+ {
+ HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEY";
+ Hide = TRUE;
+ Border = TRUE;
+ Size = MAP_APPFONT ( 30, 12 );
+ TabStop = TRUE;
+ Repeat = TRUE;
+ Spin = FALSE;
+ StrictFormat = TRUE;
+ DecimalDigits = 2;
+ Unit = FUNIT_NONE;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_SIZEY
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEY";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "inches" ; > ;
+ < "cm" ; Default ; > ;
+ < "mm" ; > ;
+ < "points" ; > ;
+ < "pixels" ; > ;
+ };
+ };
+ FixedText FT_RESOLUTION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Resolution:" ;
+ };
+ NumericField NF_RESOLUTION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ ListBox LB_RESOLUTION
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_RESOLUTION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ StringList [ en-US ] =
+ {
+ < "pixels/cm" ; > ;
+ < "pixels/inch" ; Default ; > ;
+ < "pixels/meter" ; > ;
+ };
+ };
+ FixedLine FL_COLOR_DEPTH
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Color Depth" ;
+ };
+ ListBox LB_COLOR_DEPTH
+ {
+ HelpID = "svtools:ListBox:DLG_EXPORT:LB_COLOR_DEPTH";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 60, 80 ) ;
+ DropDown = TRUE ;
+ Sort = FALSE ;
+ };
+ String STR_1BIT_THRESHOLD
+ {
+ Text [ en-US ] = "1 bit threshold";
+ };
+ String STR_1BIT_DITHERED
+ {
+ Text [ en-US ] = "1 bit dithered";
+ };
+ String STR_4BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "4 bit grayscale";
+ };
+ String STR_4BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "4 bit color";
+ };
+ String STR_8BIT_GRAYSCALE
+ {
+ Text [ en-US ] = "8 bit grayscale";
+ };
+ String STR_8BIT_COLOR_PALETTE
+ {
+ Text [ en-US ] = "8 bit color";
+ };
+ String STR_24BIT_TRUE_COLOR
+ {
+ Text [ en-US ] = "24 bit true color";
+ };
+ FixedLine FL_JPG_QUALITY
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Quality" ;
+ };
+ FixedLine FL_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Compression" ;
+ };
+ FixedLine FL_MODE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Mode" ;
+ };
+ FixedLine FL_PBM_OPTIONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "File Format" ;
+ };
+ ScrollBar SB_COMPRESSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 ) ;
+ VScroll = FALSE ;
+ HScroll = TRUE;
+ Drag = TRUE ;
+ };
+ NumericField NF_COMPRESSION
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_COMPRESSION";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 99999;
+ Last = 255 ;
+ };
+ FixedText FT_JPG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "1 is minimum Quality and smallest file size." ;
+ };
+ FixedText FT_JPG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "100 is maximum Quality and biggest file size." ;
+ };
+ FixedText FT_PNG_MIN
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "0 is biggest file size and fastest loading." ;
+ };
+ FixedText FT_PNG_MAX
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "9 is smallest file size and slowest loading." ;
+ };
+ CheckBox CB_JPG_PREVIEW
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_JPG_PREVIEW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_INTERLACED
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_INTERLACED";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interlaced" ;
+ };
+ CheckBox CB_RLE_ENCODING
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_RLE_ENCODING";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "RLE encoding" ;
+ };
+ FixedLine FL_GIF_DRAWING_OBJECTS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Drawing Objects" ;
+ };
+ CheckBox CB_SAVE_TRANSPARENCY
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_SAVE_TRANSPARENCY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Save transparency" ;
+ };
+ RadioButton RB_BINARY
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_BINARY";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Binary" ;
+ };
+ RadioButton RB_TEXT
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_TEXT";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Text" ;
+ };
+ FixedLine FL_EPS_PREVIEW
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 110 , 8 ) ;
+ Text [ en-US ] = "Preview" ;
+ };
+ CheckBox CB_EPS_PREVIEW_TIFF
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_TIFF";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Image Preview (TIFF)" ;
+ };
+ CheckBox CB_EPS_PREVIEW_EPSI
+ {
+ HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_EPSI";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text [ en-US ] = "Interchange (EPSI)" ;
+ };
+ FixedLine FL_EPS_VERSION
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Version" ;
+ };
+ RadioButton RB_EPS_LEVEL1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 1" ;
+ };
+ RadioButton RB_EPS_LEVEL2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Level 2" ;
+ };
+ FixedLine FL_EPS_COLOR_FORMAT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text [ en-US ] = "Color format" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT1
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT1";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Color" ;
+ };
+ RadioButton RB_EPS_COLOR_FORMAT2
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT2";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "Grayscale" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_LZW
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_LZW";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "LZW encoding" ;
+ };
+ RadioButton RB_EPS_COMPRESSION_NONE
+ {
+ HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_NONE";
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 105 , 10 ) ;
+ Text [ en-US ] = "None" ;
+ };
+ FixedLine FL_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedText FT_ESTIMATED_SIZE
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ String STR_ESTIMATED_SIZE_PIX_1
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory.";
+ };
+ String STR_ESTIMATED_SIZE_PIX_2
+ {
+ Text [ en-US ] = "The picture needs about %1 KB of memory,\n the file size is %2 KB.";
+ };
+ String STR_ESTIMATED_SIZE_VEC
+ {
+ Text [ en-US ] = "The file size is %1 KB.";
+ };
+ FixedLine FL_BUTTONS
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ };
+ FixedBitmap FB_JPG_PREVIEW
+ {
+ Hide = TRUE;
+ OutputSize = TRUE ;
+ Scale = TRUE;
+ Border = TRUE;
+ };
+ ScrollBar SB_ZOOM
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 5;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ NumericField NF_ZOOM
+ {
+ HelpID = "svtools:NumericField:DLG_EXPORT:NF_ZOOM";
+ Hide = TRUE;
+ Border = TRUE ;
+ Size = MAP_APPFONT ( 30, 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = FALSE ;
+ Maximum = 3000;
+ Last = 255 ;
+ };
+ ScrollBar SB_JPG_PREVIEW_HORZ
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = FALSE;
+ HScroll = TRUE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ ScrollBar SB_JPG_PREVIEW_VERT
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 48, 10 );
+ VScroll = TRUE;
+ HScroll = FALSE;
+ Drag = TRUE;
+ MinPos = 0;
+ MaxPos = 100;
+ ThumbPos = 50;
+ };
+ OKButton BTN_OK
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Hide = TRUE;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index fe6adfa266ba..5ea07d2017f2 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -53,7 +53,7 @@
#include "xbmread.hxx"
#include "xpmread.hxx"
#include <svl/solar.hrc>
-#include "strings.hrc"
+#include <svtools/svtools.hrc>
#include "sgffilt.hxx"
#include "osl/module.hxx"
#include <com/sun/star/uno/Reference.h>
@@ -78,7 +78,7 @@
#define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF
-#if defined WIN || (defined OS2 && !defined ICC)
+#if (defined OS2 && !defined ICC)
#define IMPORT_FUNCTION_NAME "_GraphicImport"
#define EXPORT_FUNCTION_NAME "_GraphicExport"
@@ -94,10 +94,6 @@
#endif
-// Compilerfehler, wenn Optimierung bei WNT & MSC
-#ifdef _MSC_VER
-#pragma optimize( "", off )
-#endif
// -----------
// - statics -
@@ -136,9 +132,9 @@ public:
~ImpFilterOutputStream() {}
};
-BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj )
+sal_Bool ImplDirEntryHelper::Exists( const INetURLObject& rObj )
{
- BOOL bExists = FALSE;
+ sal_Bool bExists = sal_False;
try
{
@@ -191,11 +187,11 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl )
//--------------------------------------------------------------------------
-BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ sal_uLong i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -228,9 +224,9 @@ inline String ImpGetExtension( const String &rPath )
|* Eingabe-prarameter:
|* rPath - Dateipfad
|* rFormatExtension - Inhalt egal
-|* bTest - setze FALSE
+|* bTest - setze sal_False
|* Ausgabe-parameter:
-|* Funkionswert - TRUE wenn Erfolg
+|* Funkionswert - sal_True wenn Erfolg
|* rFormatExtension - Bei Erfolg: uebliche Dateiendung
|* des Formats (Grossbuchstaben)
|* 2.) Datei anlesen, Dateiformat ueberpruefen
@@ -238,32 +234,32 @@ inline String ImpGetExtension( const String &rPath )
|* rPath - Dateipfad
|* rFormatExtension - uebliche Dateiendung des Formats
|* (Grossbuchstaben)
-|* bTest - setze TRUE
+|* bTest - setze sal_True
|* Ausgabe-parameter:
-|* Funkionswert - FALSE, wenn die Datei bestimmt nicht
+|* Funkionswert - sal_False, wenn die Datei bestimmt nicht
|* vom uebgebenen Format ist.
-|* TRUE, wenn die Datei WAHRSCHEINLICH von
+|* sal_True, wenn die Datei WAHRSCHEINLICH von
|* dem Format ist, ODER WENN DAS FORMAT
|* DIESER FUNKTION NICHT BEKANNT IST!
|*
*************************************************************************/
-static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest )
+static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, sal_Bool bTest )
{
- USHORT i;
- BYTE sFirstBytes[ 256 ];
- ULONG nFirstLong,nSecondLong;
- ULONG nStreamPos = rStream.Tell();
+ sal_uInt16 i;
+ sal_uInt8 sFirstBytes[ 256 ];
+ sal_uLong nFirstLong,nSecondLong;
+ sal_uLong nStreamPos = rStream.Tell();
rStream.Seek( STREAM_SEEK_TO_END );
- ULONG nStreamLen = rStream.Tell() - nStreamPos;
+ sal_uLong nStreamLen = rStream.Tell() - nStreamPos;
rStream.Seek( nStreamPos );
if ( !nStreamLen )
{
SvLockBytes* pLockBytes = rStream.GetLockBytes();
if ( pLockBytes )
- pLockBytes->SetSynchronMode( TRUE );
+ pLockBytes->SetSynchronMode( sal_True );
rStream.Seek( STREAM_SEEK_TO_END );
nStreamLen = rStream.Tell() - nStreamPos;
@@ -276,25 +272,25 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
{
rStream.Read( sFirstBytes, nStreamLen );
- for( i = (USHORT) nStreamLen; i < 256; i++ )
+ for( i = (sal_uInt16) nStreamLen; i < 256; i++ )
sFirstBytes[ i ]=0;
}
if( rStream.GetError() )
- return FALSE;
+ return sal_False;
// Die ersten 8 Bytes in nFirstLong, nSecondLong unterbringen,
// Big-Endian:
for( i = 0, nFirstLong = 0L, nSecondLong = 0L; i < 4; i++ )
{
- nFirstLong=(nFirstLong<<8)|(ULONG)sFirstBytes[i];
- nSecondLong=(nSecondLong<<8)|(ULONG)sFirstBytes[i+4];
+ nFirstLong=(nFirstLong<<8)|(sal_uLong)sFirstBytes[i];
+ nSecondLong=(nSecondLong<<8)|(sal_uLong)sFirstBytes[i+4];
}
- // Folgende Variable ist nur bei bTest==TRUE interessant. Sie
- // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht
+ // Folgende Variable ist nur bei bTest==sal_True interessant. Sie
+ // bleibt sal_False, wenn das Format (rFormatExtension) hier noch nicht
// einprogrammiert wurde.
- BOOL bSomethingTested = FALSE;
+ sal_Bool bSomethingTested = sal_False;
// Nun werden die verschieden Formate ueberprueft. Dabei ist die
// Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch
@@ -303,7 +299,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
// Theoretisch waere aber vielleicht auch eine BMP-Datei denkbar,
// die durch den MET-Test geht.
// Diese Probleme gibt es natuerlich nicht nur bei MET und BMP.
- // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==TRUE)
+ // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==sal_True)
// nur genau dieses eine Format getestet. Alles andere koennte fatale
// Folgen haben, z.B. wenn der Benutzer sagt, es sei BMP-Datei (und es
// ist BMP-Datei), und hier wuerde die Datei durch den MET-Test gehen...
@@ -311,26 +307,26 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- MET ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "MET", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( sFirstBytes[2] == 0xd3 )
{
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStream.Seek( nStreamPos );
- USHORT nFieldSize;
- BYTE nMagic;
- BOOL bOK=TRUE;
+ sal_uInt16 nFieldSize;
+ sal_uInt8 nMagic;
+ sal_Bool bOK=sal_True;
rStream >> nFieldSize >> nMagic;
for (i=0; i<3; i++) {
- if (nFieldSize<6) { bOK=FALSE; break; }
- if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=FALSE; break; }
+ if (nFieldSize<6) { bOK=sal_False; break; }
+ if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=sal_False; break; }
rStream.SeekRel(nFieldSize-3);
rStream >> nFieldSize >> nMagic;
- if (nMagic!=0xd3) { bOK=FALSE; break; }
+ if (nMagic!=0xd3) { bOK=sal_False; break; }
}
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
if (bOK && !rStream.GetError()) {
rFormatExtension= UniString::CreateFromAscii( "MET", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -338,9 +334,9 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- BMP ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "BMP", 3 ) == COMPARE_EQUAL ) )
{
- BYTE nOffs;
+ sal_uInt8 nOffs;
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
// OS/2-Bitmaparray ('BA') koennen wir evtl. auch lesen,
// dementspr. muessen wir den Offset anpassen,
@@ -364,7 +360,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
sFirstBytes[14+nOffs] == 0x0c )
{
rFormatExtension = UniString::CreateFromAscii( "BMP", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -375,33 +371,33 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
( rFormatExtension.CompareToAscii( "WMF", 3 ) == COMPARE_EQUAL ) ||
( rFormatExtension.CompareToAscii( "EMF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if ( nFirstLong==0xd7cdc69a || nFirstLong==0x01000900 )
{
rFormatExtension = UniString::CreateFromAscii( "WMF", 3 );
- return TRUE;
+ return sal_True;
}
else if( nFirstLong == 0x01000000 && sFirstBytes[ 40 ] == 0x20 && sFirstBytes[ 41 ] == 0x45 &&
sFirstBytes[ 42 ] == 0x4d && sFirstBytes[ 43 ] == 0x46 )
{
rFormatExtension = UniString::CreateFromAscii( "EMF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCX ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCX", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if (sFirstBytes[0]==0x0a)
{
- BYTE nVersion=sFirstBytes[1];
- BYTE nEncoding=sFirstBytes[2];
+ sal_uInt8 nVersion=sFirstBytes[1];
+ sal_uInt8 nEncoding=sFirstBytes[2];
if( ( nVersion==0 || nVersion==2 || nVersion==3 || nVersion==5 ) && nEncoding<=1 )
{
rFormatExtension = UniString::CreateFromAscii( "PCX", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -409,69 +405,69 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- TIF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "TIF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a )
{
rFormatExtension=UniString::CreateFromAscii( "TIF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- GIF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "GIF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( nFirstLong==0x47494638 && (sFirstBytes[4]==0x37 || sFirstBytes[4]==0x39) && sFirstBytes[5]==0x61 )
{
rFormatExtension = UniString::CreateFromAscii( "GIF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PNG ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PNG", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if (nFirstLong==0x89504e47 && nSecondLong==0x0d0a1a0a)
{
rFormatExtension = UniString::CreateFromAscii( "PNG", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- JPG ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "JPG", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) ||
( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) )
{
rFormatExtension = UniString::CreateFromAscii( "JPG", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- SVM ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SVM", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( nFirstLong==0x53564744 && sFirstBytes[4]==0x49 )
{
rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
- return TRUE;
+ return sal_True;
}
else if( sFirstBytes[0]==0x56 && sFirstBytes[1]==0x43 && sFirstBytes[2]==0x4C &&
sFirstBytes[3]==0x4D && sFirstBytes[4]==0x54 && sFirstBytes[5]==0x46 )
{
rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCD ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCD", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( nStreamLen >= 2055 )
{
char sBuf[8];
@@ -481,7 +477,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 )
{
rFormatExtension = UniString::CreateFromAscii( "PCD", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -489,30 +485,30 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- PSD ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PSD", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if ( ( nFirstLong == 0x38425053 ) && ( (nSecondLong >> 16 ) == 1 ) )
{
rFormatExtension = UniString::CreateFromAscii( "PSD", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- EPS ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "EPS", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
- if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (BYTE*)"%!PS-Adobe", 10, 10 ) &&
- ImplSearchEntry( &sFirstBytes[15], (BYTE*)"EPS", 3, 3 ) ) )
+ bSomethingTested = sal_True;
+ if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"%!PS-Adobe", 10, 10 ) &&
+ ImplSearchEntry( &sFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
rFormatExtension = UniString::CreateFromAscii( "EPS", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- DXF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "DXF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
i=0;
while (i<256 && sFirstBytes[i]<=32)
@@ -533,31 +529,63 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
if (strncmp((char*)(sFirstBytes+i),"SECTION",7)==0)
{
rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
- return TRUE;
+ return sal_True;
}
}
if( strncmp( (char*) sFirstBytes, "AutoCAD Binary DXF", 18 ) == 0 )
{
rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- PCT ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
- BYTE sBuf[4];
+ bSomethingTested = sal_True;
+ sal_uInt8 sBuf[3];
+ // store number format
+ sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt();
sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes
- for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 )
+ for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 )
{
- rStream.Seek( nStreamPos + nOffset );
+ short y1,x1,y2,x2;
+ bool bdBoxOk = true;
+
+ rStream.Seek( nStreamPos + nOffset);
+ // size of the pict in version 1 pict ( 2bytes) : ignored
+ rStream.SeekRel(2);
+ // bounding box (bytes 2 -> 9)
+ rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
+ rStream >> y1 >> x1 >> y2 >> x2;
+ rStream.SetNumberFormatInt(oldNumberFormat); // reset format
+
+ if (x1 > x2 || y1 > y2 || // bad bdbox
+ (x1 == x2 && y1 == y2) || // 1 pixel picture
+ x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big
+ bdBoxOk = false;
+
+ // read version op
rStream.Read( sBuf,3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
+ // see http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/Imaging_With_QuickDraw/Appendix_A.pdf
+ // normal version 2 - page A23 and A24
+ if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
+ }
+ // normal version 1 - page A25
+ else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
+ }
+ // previous code kept in order to do not break any compatibility
+ // probably eroneous
+ else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk)
{
- rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
- return TRUE;
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return sal_True;
}
}
}
@@ -568,7 +596,7 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) ||
( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if ( sFirstBytes[ 0 ] == 'P' )
{
switch( sFirstBytes[ 1 ] )
@@ -576,17 +604,17 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
case '1' :
case '4' :
rFormatExtension = UniString::CreateFromAscii( "PBM", 3 );
- return TRUE;
+ return sal_True;
case '2' :
case '5' :
rFormatExtension = UniString::CreateFromAscii( "PGM", 3 );
- return TRUE;
+ return sal_True;
case '3' :
case '6' :
rFormatExtension = UniString::CreateFromAscii( "PPM", 3 );
- return TRUE;
+ return sal_True;
}
}
}
@@ -594,81 +622,81 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B
//--------------------------- RAS( SUN RasterFile )------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "RAS", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( nFirstLong == 0x59a66a95 )
{
rFormatExtension = UniString::CreateFromAscii( "RAS", 3 );
- return TRUE;
+ return sal_True;
}
}
//--------------------------- XPM ------------------------------------
if( !bTest )
{
- bSomethingTested = TRUE;
- if( ImplSearchEntry( sFirstBytes, (BYTE*)"/* XPM */", 256, 9 ) )
+ bSomethingTested = sal_True;
+ if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"/* XPM */", 256, 9 ) )
{
rFormatExtension = UniString::CreateFromAscii( "XPM", 3 );
- return TRUE;
+ return sal_True;
}
}
else if( rFormatExtension.CompareToAscii( "XPM", 3 ) == COMPARE_EQUAL )
{
- bSomethingTested = TRUE;
- return TRUE;
+ bSomethingTested = sal_True;
+ return sal_True;
}
//--------------------------- XBM ------------------------------------
if( !bTest )
{
- ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen;
- BYTE* pBuf = new BYTE [ nSize ];
+ sal_uLong nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen;
+ sal_uInt8* pBuf = new sal_uInt8 [ nSize ];
rStream.Seek( nStreamPos );
rStream.Read( pBuf, nSize );
- BYTE* pPtr = ImplSearchEntry( pBuf, (BYTE*)"#define", nSize, 7 );
+ sal_uInt8* pPtr = ImplSearchEntry( pBuf, (sal_uInt8*)"#define", nSize, 7 );
if( pPtr )
{
- if( ImplSearchEntry( pPtr, (BYTE*)"_width", pBuf + nSize - pPtr, 6 ) )
+ if( ImplSearchEntry( pPtr, (sal_uInt8*)"_width", pBuf + nSize - pPtr, 6 ) )
{
rFormatExtension = UniString::CreateFromAscii( "XBM", 3 );
delete[] pBuf;
- return TRUE;
+ return sal_True;
}
}
delete[] pBuf;
}
else if( rFormatExtension.CompareToAscii( "XBM", 3 ) == COMPARE_EQUAL )
{
- bSomethingTested = TRUE;
- return TRUE;
+ bSomethingTested = sal_True;
+ return sal_True;
}
//--------------------------- TGA ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL )
- return TRUE;
+ return sal_True;
}
//--------------------------- SGV ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested = TRUE;
+ bSomethingTested = sal_True;
if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL )
- return TRUE;
+ return sal_True;
}
//--------------------------- SGF ------------------------------------
if( !bTest || ( rFormatExtension.CompareToAscii( "SGF", 3 ) == COMPARE_EQUAL ) )
{
- bSomethingTested=TRUE;
+ bSomethingTested=sal_True;
if( sFirstBytes[ 0 ] == 'J' && sFirstBytes[ 1 ] == 'J' )
{
rFormatExtension = UniString::CreateFromAscii( "SGF", 3 );
- return TRUE;
+ return sal_True;
}
}
@@ -686,7 +714,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS
if( rFormat == GRFILTER_FORMAT_DONTKNOW )
{
String aFormatExt;
- if( ImpPeekGraphicFormat( rStream, aFormatExt, FALSE ) )
+ if( ImpPeekGraphicFormat( rStream, aFormatExt, sal_False ) )
{
for( sal_uInt16 i = 0; i < n; i++ )
{
@@ -715,7 +743,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const String& rPath, SvStream& rS
else
{
String aTmpStr( pConfig->GetImportFormatExtension( rFormat ) );
- if( !ImpPeekGraphicFormat( rStream, aTmpStr, TRUE ) )
+ if( !ImpPeekGraphicFormat( rStream, aTmpStr, sal_True ) )
return GRFILTER_FORMATERROR;
if ( pConfig->GetImportFormatExtension( rFormat ).EqualsIgnoreCaseAscii( "pcd" ) )
{
@@ -748,7 +776,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if ( rGraphic.GetType() != GRAPHIC_NONE )
{
- sal_Int32 nMode = rConfigItem.ReadInt32( String( ResId( KEY_MODE, *pResMgr ) ), -1 );
+ sal_Int32 nMode = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ExportMode" ) ), -1 );
if ( nMode == -1 ) // the property is not there, this is possible, if the graphic filter
{ // is called via UnoGraphicExporter and not from a graphic export Dialog
@@ -778,7 +806,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
Bitmap aBitmap( rGraphic.GetBitmap() );
MapMode aMap( MAP_100TH_INCH );
- sal_Int32 nDPI = rConfigItem.ReadInt32( String( ResId( KEY_RES, *pResMgr ) ), 75 );
+ sal_Int32 nDPI = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), 75 );
Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
aMap.SetScaleX( aFrac );
@@ -802,7 +830,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
else
aGraphic = rGraphic;
- sal_Int32 nColors = rConfigItem.ReadInt32( String( ResId( KEY_COLORS, *pResMgr ) ), 0 ); // #92767#
+ sal_Int32 nColors = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); // #92767#
if ( nColors ) // graphic conversion necessary ?
{
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
@@ -1047,7 +1075,7 @@ void GraphicFilter::ImplInit()
// ------------------------------------------------------------------------
-ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm )
+sal_uLong GraphicFilter::ImplSetError( sal_uLong nError, const SvStream* pStm )
{
pErrorEx->nFilterError = nError;
pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE;
@@ -1055,28 +1083,28 @@ ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm )
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatCount()
+sal_uInt16 GraphicFilter::GetImportFormatCount()
{
return pConfig->GetImportFormatCount();
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName )
+sal_uInt16 GraphicFilter::GetImportFormatNumber( const String& rFormatName )
{
return pConfig->GetImportFormatNumber( rFormatName );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType )
+sal_uInt16 GraphicFilter::GetImportFormatNumberForMediaType( const String& rMediaType )
{
return pConfig->GetImportFormatNumberForMediaType( rMediaType );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName )
+sal_uInt16 GraphicFilter::GetImportFormatNumberForShortName( const String& rShortName )
{
return pConfig->GetImportFormatNumberForShortName( rShortName );
}
@@ -1090,35 +1118,35 @@ sal_uInt16 GraphicFilter::GetImportFormatNumberForTypeName( const String& rType
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatName( USHORT nFormat )
+String GraphicFilter::GetImportFormatName( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatTypeName( USHORT nFormat )
+String GraphicFilter::GetImportFormatTypeName( sal_uInt16 nFormat )
{
return pConfig->GetImportFilterTypeName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatMediaType( USHORT nFormat )
+String GraphicFilter::GetImportFormatMediaType( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatMediaType( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportFormatShortName( USHORT nFormat )
+String GraphicFilter::GetImportFormatShortName( sal_uInt16 nFormat )
{
return pConfig->GetImportFormatShortName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportOSFileType( USHORT )
+String GraphicFilter::GetImportOSFileType( sal_uInt16 )
{
String aOSFileType;
return aOSFileType;
@@ -1126,42 +1154,42 @@ String GraphicFilter::GetImportOSFileType( USHORT )
// ------------------------------------------------------------------------
-String GraphicFilter::GetImportWildcard( USHORT nFormat, sal_Int32 nEntry )
+String GraphicFilter::GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry )
{
return pConfig->GetImportWildcard( nFormat, nEntry );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat )
+sal_Bool GraphicFilter::IsImportPixelFormat( sal_uInt16 nFormat )
{
return pConfig->IsImportPixelFormat( nFormat );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatCount()
+sal_uInt16 GraphicFilter::GetExportFormatCount()
{
return pConfig->GetExportFormatCount();
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName )
+sal_uInt16 GraphicFilter::GetExportFormatNumber( const String& rFormatName )
{
return pConfig->GetExportFormatNumber( rFormatName );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType )
+sal_uInt16 GraphicFilter::GetExportFormatNumberForMediaType( const String& rMediaType )
{
return pConfig->GetExportFormatNumberForMediaType( rMediaType );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName )
+sal_uInt16 GraphicFilter::GetExportFormatNumberForShortName( const String& rShortName )
{
return pConfig->GetExportFormatNumberForShortName( rShortName );
}
@@ -1175,35 +1203,35 @@ sal_uInt16 GraphicFilter::GetExportFormatNumberForTypeName( const String& rType
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatName( USHORT nFormat )
+String GraphicFilter::GetExportFormatName( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatTypeName( USHORT nFormat )
+String GraphicFilter::GetExportFormatTypeName( sal_uInt16 nFormat )
{
return pConfig->GetExportFilterTypeName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatMediaType( USHORT nFormat )
+String GraphicFilter::GetExportFormatMediaType( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatMediaType( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportFormatShortName( USHORT nFormat )
+String GraphicFilter::GetExportFormatShortName( sal_uInt16 nFormat )
{
return pConfig->GetExportFormatShortName( nFormat );
}
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportOSFileType( USHORT )
+String GraphicFilter::GetExportOSFileType( sal_uInt16 )
{
String aOSFileType;
return aOSFileType;
@@ -1211,22 +1239,22 @@ String GraphicFilter::GetExportOSFileType( USHORT )
// ------------------------------------------------------------------------
-String GraphicFilter::GetExportWildcard( USHORT nFormat, sal_Int32 nEntry )
+String GraphicFilter::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry )
{
return pConfig->GetExportWildcard( nFormat, nEntry );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat )
+sal_Bool GraphicFilter::IsExportPixelFormat( sal_uInt16 nFormat )
{
return pConfig->IsExportPixelFormat( nFormat );
}
// ------------------------------------------------------------------------
-USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
- USHORT nFormat, USHORT* pDeterminedFormat )
+sal_uInt16 GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::CanImportGraphic() : ProtType == INET_PROT_NOT_VALID" );
@@ -1243,10 +1271,10 @@ USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
// ------------------------------------------------------------------------
-USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat )
+sal_uInt16 GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat )
{
- ULONG nStreamPos = rIStream.Tell();
+ sal_uLong nStreamPos = rIStream.Tell();
sal_uInt16 nRes = ImpTestOrFindFormat( rMainUrl, rIStream, nFormat );
rIStream.Seek(nStreamPos);
@@ -1254,13 +1282,13 @@ USHORT GraphicFilter::CanImportGraphic( const String& rMainUrl, SvStream& rIStre
if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL )
*pDeterminedFormat = nFormat;
- return (USHORT) ImplSetError( nRes, &rIStream );
+ return (sal_uInt16) ImplSetError( nRes, &rIStream );
}
// ------------------------------------------------------------------------
//SJ: TODO, we need to create a GraphicImporter component
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
- USHORT nFormat, USHORT * pDeterminedFormat, sal_uInt32 nImportFlags )
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ImportGraphic() : ProtType == INET_PROT_NOT_VALID" );
@@ -1275,25 +1303,25 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa
return nRetValue;
}
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags )
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags )
{
return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL );
}
//-------------------------------------------------------------------------
-USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags,
+sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
+ sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags,
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData )
{
String aFilterName;
- ULONG nStmBegin;
- USHORT nStatus;
+ sal_uLong nStmBegin;
+ sal_uInt16 nStatus;
GraphicReader* pContext = rGraphic.GetContext();
GfxLinkType eLinkType = GFX_LINK_TYPE_NONE;
- BOOL bDummyContext = ( pContext == (GraphicReader*) 1 );
- const BOOL bLinkSet = rGraphic.IsLink();
+ sal_Bool bDummyContext = ( pContext == (GraphicReader*) 1 );
+ const sal_Bool bLinkSet = rGraphic.IsLink();
FilterConfigItem* pFilterConfigItem = NULL;
Size aPreviewSizeHint( 0, 0 );
@@ -1344,7 +1372,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
else
nStmBegin = rIStream.Tell();
- bAbort = FALSE;
+ bAbort = sal_False;
nStatus = ImpTestOrFindFormat( rPath, rIStream, nFormat );
// Falls Pending, geben wir GRFILTER_OK zurueck,
// um mehr Bytes anzufordern
@@ -1353,13 +1381,13 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
rGraphic.SetContext( (GraphicReader*) 1 );
rIStream.ResetError();
rIStream.Seek( nStmBegin );
- return (USHORT) ImplSetError( GRFILTER_OK );
+ return (sal_uInt16) ImplSetError( GRFILTER_OK );
}
rIStream.Seek( nStmBegin );
if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() )
- return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream );
+ return (sal_uInt16) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream );
if( pDeterminedFormat )
*pDeterminedFormat = nFormat;
@@ -1493,7 +1521,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
else if( aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGF )
|| aFilterName.EqualsIgnoreCaseAscii( IMP_SVSGV ) )
{
- USHORT nVersion;
+ sal_uInt16 nVersion;
unsigned char nTyp = CheckSgfTyp( rIStream, nVersion );
switch( nTyp )
@@ -1605,15 +1633,15 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
if( nStatus == GRFILTER_OK && bCreateNativeLink && ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet )
{
- const ULONG nStmEnd = rIStream.Tell();
- const ULONG nBufSize = nStmEnd - nStmBegin;
+ const sal_uLong nStmEnd = rIStream.Tell();
+ const sal_uLong nBufSize = nStmEnd - nStmBegin;
if( nBufSize )
{
- BYTE* pBuf=0;
+ sal_uInt8* pBuf=0;
try
{
- pBuf = new BYTE[ nBufSize ];
+ pBuf = new sal_uInt8[ nBufSize ];
}
catch (std::bad_alloc)
{
@@ -1624,7 +1652,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
{
rIStream.Seek( nStmBegin );
rIStream.Read( pBuf, nBufSize );
- rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) );
+ rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, sal_True ) );
}
}
}
@@ -1647,12 +1675,12 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
// ------------------------------------------------------------------------
-USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
+sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath,
sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData )
{
sal_uInt16 nRetValue = GRFILTER_FORMATERROR;
DBG_ASSERT( rPath.GetProtocol() != INET_PROT_NOT_VALID, "GraphicFilter::ExportGraphic() : ProtType == INET_PROT_NOT_VALID" );
- BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath );
+ sal_Bool bAlreadyExists = ImplDirEntryHelper::Exists( rPath );
String aMainUrl( rPath.GetMainURL( INetURLObject::NO_DECODE ) );
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMainUrl, STREAM_WRITE | STREAM_TRUNC );
@@ -1669,10 +1697,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObjec
// ------------------------------------------------------------------------
-USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath,
+sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath,
SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData )
{
- USHORT nFormatCount = GetExportFormatCount();
+ sal_uInt16 nFormatCount = GetExportFormatCount();
ResetLastError();
nExpGraphHint = 0;
@@ -1683,7 +1711,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
String aExt( aURL.GetFileExtension().toAsciiUpperCase() );
- for( USHORT i = 0; i < nFormatCount; i++ )
+ for( sal_uInt16 i = 0; i < nFormatCount; i++ )
{
if ( pConfig->GetExportFormatExtension( i ).EqualsIgnoreCaseAscii( aExt ) )
{
@@ -1693,13 +1721,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
}
}
if( nFormat >= nFormatCount )
- return (USHORT) ImplSetError( GRFILTER_FORMATERROR );
+ return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR );
FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData );
String aFilterName( pConfig->GetExportFilterName( nFormat ) );
- bAbort = FALSE;
- USHORT nStatus = GRFILTER_OK;
+ bAbort = sal_False;
+ sal_uInt16 nStatus = GRFILTER_OK;
GraphicType eType;
Graphic aGraphic( rGraphic );
@@ -1711,12 +1739,12 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
if( eType != GRAPHIC_BITMAP )
{
Size aSizePixel;
- ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem;
+ sal_uLong nColorCount,nBitsPerPixel,nNeededMem,nMaxMem;
VirtualDevice aVirDev;
// Maximalen Speicherbedarf fuer das Bildes holen:
// if( GetOptionsConfig() )
-// nMaxMem = (UINT32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32();
+// nMaxMem = (sal_uInt32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32();
// else
nMaxMem = 1024;
@@ -1733,14 +1761,14 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
else if (nColorCount<=256) nBitsPerPixel=8;
else if (nColorCount<=65536) nBitsPerPixel=16;
else nBitsPerPixel=24;
- nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8;
+ nNeededMem=((sal_uLong)aSizePixel.Width()*(sal_uLong)aSizePixel.Height()*nBitsPerPixel+7)/8;
// ggf. Groesse des Bildes einschraenken:
if (nMaxMem<nNeededMem)
{
double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem));
- aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak);
- aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak);
+ aSizePixel.Width()=(sal_uLong)(((double)aSizePixel.Width())*fFak);
+ aSizePixel.Height()=(sal_uLong)(((double)aSizePixel.Height())*fFak);
}
aVirDev.SetMapMode(MapMode(MAP_PIXEL));
@@ -1761,13 +1789,13 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
{
Bitmap aBmp( aGraphic.GetBitmap() );
sal_Int32 nColorRes = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Colors" ) ), 0 );
- if ( nColorRes && ( nColorRes <= (USHORT)BMP_CONVERSION_24BIT) )
+ if ( nColorRes && ( nColorRes <= (sal_uInt16)BMP_CONVERSION_24BIT) )
{
if( !aBmp.Convert( (BmpConversion) nColorRes ) )
aBmp = aGraphic.GetBitmap();
}
ResMgr* pResMgr = CREATERESMGR( svt );
- sal_Bool bRleCoding = aConfigItem.ReadBool( String( ResId( KEY_RLE_CODING, *pResMgr ) ), sal_True );
+ sal_Bool bRleCoding = aConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True );
// Wollen wir RLE-Kodiert speichern?
aBmp.Write( rOStm, bRleCoding );
delete pResMgr;
@@ -1987,16 +2015,16 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
// ------------------------------------------------------------------------
-BOOL GraphicFilter::Setup( USHORT )
+sal_Bool GraphicFilter::Setup( sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
/* ------------------------------------------------------------------------
No Import filter has a dialog, so
the following two methods are obsolete */
-BOOL GraphicFilter::HasImportDialog( USHORT )
+sal_Bool GraphicFilter::HasImportDialog( sal_uInt16 )
{
return sal_True;
// return pConfig->IsImportDialog( nFormat );
@@ -2004,26 +2032,26 @@ BOOL GraphicFilter::HasImportDialog( USHORT )
// ------------------------------------------------------------------------
-BOOL GraphicFilter::DoImportDialog( Window*, USHORT )
+sal_Bool GraphicFilter::DoImportDialog( Window*, sal_uInt16 )
{
return sal_True;
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::HasExportDialog( USHORT nFormat )
+sal_Bool GraphicFilter::HasExportDialog( sal_uInt16 nFormat )
{
return pConfig->IsExportDialog( nFormat );
}
// ------------------------------------------------------------------------
-BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat )
+sal_Bool GraphicFilter::DoExportDialog( Window* pWindow, sal_uInt16 nFormat )
{
return DoExportDialog( pWindow, nFormat, FUNIT_MM );
}
-BOOL GraphicFilter::DoExportDialog( Window*, USHORT nFormat, FieldUnit )
+sal_Bool GraphicFilter::DoExportDialog( Window*, sal_uInt16 nFormat, FieldUnit )
{
sal_Bool bRet = sal_False;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
@@ -2081,7 +2109,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
if( pData )
{
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW;
+ sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW;
ByteString aShortName;
switch( pData->mnFormat )
{
@@ -2129,12 +2157,12 @@ GraphicFilter* GraphicFilter::GetGraphicFilter()
int GraphicFilter::LoadGraphic( const String &rPath, const String &rFilterName,
Graphic& rGraphic, GraphicFilter* pFilter,
- USHORT* pDeterminedFormat )
+ sal_uInt16* pDeterminedFormat )
{
if ( !pFilter )
pFilter = GetGraphicFilter();
- const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount()
+ const sal_uInt16 nFilter = rFilterName.Len() && pFilter->GetImportFormatCount()
? pFilter->GetImportFormatNumber( rFilterName )
: GRFILTER_FORMAT_DONTKNOW;
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index 0220961b657a..586591b4d86c 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -41,30 +41,7 @@
#define DATA_SIZE 640
-BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG );
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
- pFileStm ( NULL )
-{
- ImpConstruct();
-
- if ( pPath )
- {
- INetURLObject aURL( *pPath, INET_PROT_FILE );
- aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
- }
- bLinked = TRUE;
- bLinkChanged = FALSE;
- bWideSearch = FALSE;
-}
-
+sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uLong , sal_uLong );
/*************************************************************************
|*
@@ -74,19 +51,10 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) :
GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ),
- aPathExt( rPath.GetFileExtension().toAsciiLowerCase() )
+ aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ),
+ bOwnStream( sal_True )
{
- if ( pFileStm )
- {
- nStmPos = 0;
- pFileStm->Seek( nStmPos );
- bDataReady = TRUE;
- }
-
ImpConstruct();
-
- if ( pFileStm && !pFileStm->GetError() )
- bDataReady = TRUE;
}
/*************************************************************************
@@ -96,7 +64,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
\************************************************************************/
GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) :
- pFileStm ( NULL )
+ pFileStm ( &rInStream ),
+ bOwnStream ( sal_False )
{
ImpConstruct();
@@ -105,15 +74,8 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
INetURLObject aURL( *pPath );
aPathExt = aURL.GetFileExtension().toAsciiLowerCase();
}
- nStmPos = rInStream.Tell();
- pBaseStm = &rInStream;
- bBaseStm = TRUE;
-
- if ( !pBaseStm->GetError() )
- bDataReady = TRUE;
}
-
/*************************************************************************
|*
|*
@@ -122,150 +84,54 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
GraphicDescriptor::~GraphicDescriptor()
{
- delete pFileStm;
+ if ( bOwnStream )
+ delete pFileStm;
}
-
/*************************************************************************
|*
|*
|*
\************************************************************************/
-BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo )
{
- BOOL bRet = FALSE;
-
- // Link-Status ueberpruefen
- if ( bLinked && bLinkChanged )
- {
- DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" );
- pMemStm = (SvStream*) aReqLink.Call( this );
- if ( pMemStm )
- {
- nStmPos = pMemStm->Tell();
- bDataReady = TRUE;
- }
- }
-
- if ( bDataReady )
+ sal_Bool bRet = sal_False;
+ if ( pFileStm && !pFileStm->GetError() )
{
- SvStream& rStm = GetSearchStream();
- UINT16 nOldFormat = rStm.GetNumberFormatInt();
-
- if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE;
- else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE;
-
- // diese Formate lassen sich nur bei WideSearch im gesamten
- // Stream ermitteln
- else if ( bWideSearch )
- {
- if ( ImpDetectPCD( rStm, bExtendedInfo ) )
- bRet = TRUE;
- }
+ SvStream& rStm = *pFileStm;
+ sal_uInt16 nOldFormat = rStm.GetNumberFormatInt();
+
+ if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = sal_True;
+ else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = sal_True;
rStm.SetNumberFormatInt( nOldFormat );
- rStm.Seek( nStmPos );
}
-
return bRet;
}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsDataReady() const
-{
- return bDataReady;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-BOOL GraphicDescriptor::IsWideSearch() const
-{
- return bWideSearch;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-SvStream& GraphicDescriptor::GetSearchStream() const
-{
- DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" );
-
- if ( bLinked )
- return *pMemStm;
- else if ( bBaseStm )
- return *pBaseStm;
- else
- return *pFileStm;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink )
-{
- aReqLink = rRequestLink;
- bLinkChanged = TRUE;
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-ULONG GraphicDescriptor::GetRequestedByteCount() const
-{
- return DATA_SIZE;
-}
-
-
-/******************************************************************************/
-/* IMP-Methoden */
-/* */
-
-
/*************************************************************************
|*
|*
@@ -274,17 +140,10 @@ ULONG GraphicDescriptor::GetRequestedByteCount() const
void GraphicDescriptor::ImpConstruct()
{
- if ( !pFileStm )
- pFileStm = new SvStream();
nFormat = GFF_NOT;
nBitsPerPixel = 0;
nPlanes = 0;
- bCompressed = FALSE;
- bDataReady = FALSE;
- bLinked = FALSE;
- bWideSearch = TRUE;
- bBaseStm = FALSE;
- pMemStm = NULL;
+ bCompressed = sal_False;
}
@@ -294,14 +153,13 @@ void GraphicDescriptor::ImpConstruct()
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT16 nTemp16;
- BOOL bRet = FALSE;
+ sal_uInt16 nTemp16;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp16;
// OS/2-BitmapArray
@@ -315,12 +173,12 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
if ( nTemp16 == 0x4d42 )
{
nFormat = GFF_BMP;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT32 nTemp32;
- UINT32 nCompression;
+ sal_uInt32 nTemp32;
+ sal_uInt32 nCompression;
// bis zur ersten Information
rStm.SeekRel( 0x10 );
@@ -361,11 +219,11 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) )
{
nFormat = GFF_NOT;
- bRet = FALSE;
+ bRet = sal_False;
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -376,28 +234,28 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 n32;
- UINT16 n16;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_uInt32 n32;
+ sal_uInt16 n16;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
+
if ( n32 == 0x38464947 )
{
rStm >> n16;
if ( ( n16 == 0x6137 ) || ( n16 == 0x6139 ) )
{
nFormat = GFF_GIF;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nTemp16;
+ sal_uInt16 nTemp16;
// PixelBreite auslesen
rStm >> nTemp16;
@@ -413,7 +271,7 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -424,125 +282,188 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
+// returns the next jpeg marker, a return value of 0 represents an error
+sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm )
{
- UINT32 nTemp32;
- BOOL bRet = FALSE;
- BYTE cByte = 0;
- BOOL bM_COM;
+ sal_uInt8 nByte;
+ do
+ {
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() ) // as 0 is not allowed as marker,
+ return 0; // we can use it as errorcode
+ }
+ while ( nByte != 0xff );
+ do
+ {
+ rStm >> nByte;
+ if ( rStm.IsEof() || rStm.GetError() )
+ return 0;
+ }
+ while( nByte == 0xff );
+ }
+ while( nByte == 0 ); // 0xff00 represents 0xff and not a marker,
+ // the marker detection has to be restartet.
+ return nByte;
+}
- rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
+sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo )
+{
+ sal_uInt32 nTemp32;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nTemp32;
- // compare upper 28 bits
+ // compare upper 24 bits
if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) )
{
nFormat = GFF_JPG;
- return TRUE;
- }
-
- bM_COM = ( nTemp32 == 0xffd8fffe );
- if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM )
- {
- if( !bM_COM )
- {
- rStm.SeekRel( 2 );
- rStm >> nTemp32;
- }
+ bRet = sal_True;
- if( bM_COM || ( nTemp32 == 0x4a464946 ) )
+ if ( bExtendedInfo )
{
- nFormat = GFF_JPG;
- bRet = TRUE;
-
- if( bExtendedInfo )
- {
- MapMode aMap;
- UINT16 nTemp16;
- ULONG nCount = 9;
- ULONG nMax;
- ULONG nResX;
- ULONG nResY;
- BYTE cUnit;
-
- // Groesse des verbleibenden Puffers ermitteln
- if ( bLinked )
- nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
- - 16;
- else
- nMax = DATA_SIZE - 16;
+ rStm.SeekRel( -2 );
- // max. 8K
- nMax = Min( nMax, (ULONG) 8192 );
+ sal_uInt32 nError( rStm.GetError() );
- // Res-Unit ermitteln
- rStm.SeekRel( 3 );
- rStm >> cUnit;
+ sal_Bool bScanFailure = sal_False;
+ sal_Bool bScanFinished = sal_False;
- // ResX ermitteln
- rStm >> nTemp16;
- nResX = nTemp16;
-
- // ResY ermitteln
- rStm >> nTemp16;
- nResY = nTemp16;
-
- // SOF0/1-Marker finden, aber dabei
- // nicht mehr als DATA_SIZE Pixel lesen, falls
- // kein WideSearch
- do
+ while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() )
+ {
+ sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm );
+ switch( nMarker )
{
- while ( ( cByte != 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
+ // fixed size marker, not having a two byte length parameter
+ case 0xd0 : // RST0
+ case 0xd1 :
+ case 0xd2 :
+ case 0xd3 :
+ case 0xd4 :
+ case 0xd5 :
+ case 0xd6 :
+ case 0xd7 : // RST7
+ case 0x01 : // TEM
+ break;
+
+ case 0xd8 : // SOI (has already been checked, there should not be a second one)
+ case 0x00 : // marker is invalid, we should stop now
+ bScanFailure = sal_True;
+ break;
+
+ case 0xd9 : // EOI
+ bScanFinished = sal_True;
+ break;
+
+ // per default we assume marker segments conaining a length parameter
+ default :
{
- rStm >> cByte;
- }
-
- while ( ( cByte == 0xff ) &&
- ( bWideSearch || ( nCount++ < nMax ) ) )
- {
- rStm >> cByte;
- }
- }
- while ( ( cByte != 0xc0 ) &&
- ( cByte != 0xc1 ) &&
- ( bWideSearch || ( nCount < nMax ) ) );
-
- // wir haben den SOF0/1-Marker
- if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) )
- {
- // Hoehe einlesen
- rStm.SeekRel( 3 );
- rStm >> nTemp16;
- aPixSize.Height() = nTemp16;
-
- // Breite einlesen
- rStm >> nTemp16;
- aPixSize.Width() = nTemp16;
+ sal_uInt16 nLength;
+ rStm >> nLength;
- // Bit/Pixel einlesen
- rStm >> cByte;
- nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 );
+ if ( nLength < 2 )
+ bScanFailure = sal_True;
+ else
+ {
+ sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2;
+ switch( nMarker )
+ {
+ case 0xe0 : // APP0 Marker
+ {
+ if ( nLength == 16 )
+ {
+ sal_Int32 nIdentifier;
+ rStm >> nIdentifier;
+ if ( nIdentifier == 0x4a464946 ) // JFIF Identifier
+ {
+ sal_uInt8 nStringTerminator;
+ sal_uInt8 nMajorRevision;
+ sal_uInt8 nMinorRevision;
+ sal_uInt8 nUnits;
+ sal_uInt16 nHorizontalResolution;
+ sal_uInt16 nVerticalResolution;
+ sal_uInt8 nHorzThumbnailPixelCount;
+ sal_uInt8 nVertThumbnailPixelCount;
+
+ rStm >> nStringTerminator
+ >> nMajorRevision
+ >> nMinorRevision
+ >> nUnits
+ >> nHorizontalResolution
+ >> nVerticalResolution
+ >> nHorzThumbnailPixelCount
+ >> nVertThumbnailPixelCount;
+
+ // setting the logical size
+ if ( nUnits && nHorizontalResolution && nVerticalResolution )
+ {
+ MapMode aMap;
+ aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) );
+ aMap.SetScaleY( Fraction( 1, nVerticalResolution ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ }
+ break;
- // logische Groesse setzen
- if ( cUnit && nResX && nResY )
- {
- aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM );
- aMap.SetScaleX( Fraction( 1, nResX ) );
- aMap.SetScaleY( Fraction( 1, nResY ) );
- aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
- MapMode( MAP_100TH_MM ) );
+ // Start of Frame Markers
+ case 0xc0 : // SOF0
+ case 0xc1 : // SOF1
+ case 0xc2 : // SOF2
+ case 0xc3 : // SOF3
+ case 0xc5 : // SOF5
+ case 0xc6 : // SOF6
+ case 0xc7 : // SOF7
+ case 0xc9 : // SOF9
+ case 0xca : // SOF10
+ case 0xcb : // SOF11
+ case 0xcd : // SOF13
+ case 0xce : // SOF14
+ case 0xcf : // SOF15
+ {
+ sal_uInt8 nSamplePrecision;
+ sal_uInt16 nNumberOfLines;
+ sal_uInt16 nSamplesPerLine;
+ sal_uInt8 nNumberOfImageComponents;
+ sal_uInt8 nComponentsIdentifier;
+ sal_uInt8 nHorizontalSamplingFactor;
+ sal_uInt8 nVerticalSamplingFactor;
+ sal_uInt8 nQuantizationTableDestinationSelector;
+ rStm >> nSamplePrecision
+ >> nNumberOfLines
+ >> nSamplesPerLine
+ >> nNumberOfImageComponents
+ >> nComponentsIdentifier
+ >> nHorizontalSamplingFactor
+ >> nQuantizationTableDestinationSelector;
+ nVerticalSamplingFactor = nHorizontalSamplingFactor & 0xf;
+ nHorizontalSamplingFactor >>= 4;
+
+ aPixSize.Height() = nNumberOfLines;
+ aPixSize.Width() = nSamplesPerLine;
+ nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 );
+ nPlanes = 1;
+
+ bScanFinished = sal_True;
+ }
+ break;
+ }
+ rStm.Seek( nNextMarkerPos );
+ }
}
-
- // Planes immer 1
- nPlanes = 1;
+ break;
}
}
+ rStm.SetError( nError );
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -553,41 +474,30 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
- if ( bWideSearch )
- {
- UINT32 nTemp32;
- UINT16 nTemp16;
- BYTE cByte;
+ sal_uInt32 nTemp32;
+ sal_uInt16 nTemp16;
+ sal_uInt8 cByte;
- rStm.SeekRel( 2048 );
- rStm >> nTemp32;
- rStm >> nTemp16;
- rStm >> cByte;
+ rStm.SeekRel( 2048 );
+ rStm >> nTemp32;
+ rStm >> nTemp16;
+ rStm >> cByte;
- if ( ( nTemp32 == 0x5f444350 ) &&
- ( nTemp16 == 0x5049 ) &&
- ( cByte == 0x49 ) )
- {
- nFormat = GFF_PCD;
- bRet = TRUE;
- }
- }
- else
+ if ( ( nTemp32 == 0x5f444350 ) &&
+ ( nTemp16 == 0x5049 ) &&
+ ( cByte == 0x49 ) )
{
- bRet = aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL;
- if ( bRet )
- {
- nFormat = GFF_PCD;
- }
+ nFormat = GFF_PCD;
+ bRet = sal_True;
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -598,35 +508,35 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo )
{
// ! Because 0x0a can be interpreted as LF too ...
// we cant be shure that this special sign represent a PCX file only.
// Every Ascii file is possible here :-(
// We must detect the whole header.
- bExtendedInfo = TRUE;
+ bExtendedInfo = sal_True;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> cByte;
+
if ( cByte == 0x0a )
{
nFormat = GFF_PCX;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nTemp16;
- USHORT nXmin;
- USHORT nXmax;
- USHORT nYmin;
- USHORT nYmax;
- USHORT nDPIx;
- USHORT nDPIy;
+ sal_uInt16 nTemp16;
+ sal_uInt16 nXmin;
+ sal_uInt16 nXmax;
+ sal_uInt16 nYmin;
+ sal_uInt16 nYmax;
+ sal_uInt16 nDPIx;
+ sal_uInt16 nDPIy;
rStm.SeekRel( 1 );
@@ -676,6 +586,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
}
}
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -686,26 +597,26 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 nTemp32;
- BOOL bRet = FALSE;
+ sal_uInt32 nTemp32;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> nTemp32;
+
if ( nTemp32 == 0x89504e47 )
{
rStm >> nTemp32;
if ( nTemp32 == 0x0d0a1a0a )
{
nFormat = GFF_PNG;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- BYTE cByte;
+ sal_uInt8 cByte;
// IHDR-Chunk
rStm.SeekRel( 8 );
@@ -725,57 +636,54 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
// Planes immer 1;
// Kompression immer
nPlanes = 1;
- bCompressed = TRUE;
+ bCompressed = sal_True;
- if ( bWideSearch )
- {
- UINT32 nLen32;
+ sal_uInt32 nLen32;
- rStm.SeekRel( 8 );
+ rStm.SeekRel( 8 );
- // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
- // den Anfang der Bilddaten
+ // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
+ // den Anfang der Bilddaten
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
+ {
+ rStm.SeekRel( 4 + nLen32 );
rStm >> nLen32;
rStm >> nTemp32;
- while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
- {
- rStm.SeekRel( 4 + nLen32 );
- rStm >> nLen32;
- rStm >> nTemp32;
- }
+ }
- if ( nTemp32 == 0x70485973 )
- {
- ULONG nXRes;
- ULONG nYRes;
+ if ( nTemp32 == 0x70485973 )
+ {
+ sal_uLong nXRes;
+ sal_uLong nYRes;
- // horizontale Aufloesung
- rStm >> nTemp32;
- nXRes = nTemp32;
+ // horizontale Aufloesung
+ rStm >> nTemp32;
+ nXRes = nTemp32;
- // vertikale Aufloesung
- rStm >> nTemp32;
- nYRes = nTemp32;
+ // vertikale Aufloesung
+ rStm >> nTemp32;
+ nYRes = nTemp32;
- // Unit einlesen
- rStm >> cByte;
+ // Unit einlesen
+ rStm >> cByte;
- if ( cByte )
- {
- if ( nXRes )
- aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
- nTemp32;
+ if ( cByte )
+ {
+ if ( nXRes )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
+ nTemp32;
- if ( nYRes )
- aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
- nTemp32;
- }
+ if ( nYRes )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
+ nTemp32;
}
}
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -786,14 +694,14 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo )
{
- BOOL bDetectOk = FALSE;
- BOOL bRet = FALSE;
- BYTE cByte1;
- BYTE cByte2;
+ sal_Bool bDetectOk = sal_False;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte1;
+ sal_uInt8 cByte2;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> cByte1;
rStm >> cByte2;
if ( cByte1 == cByte2 )
@@ -801,43 +709,43 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
if ( cByte1 == 0x49 )
{
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bDetectOk = TRUE;
+ bDetectOk = sal_True;
}
else if ( cByte1 == 0x4d )
{
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- bDetectOk = TRUE;
+ bDetectOk = sal_True;
}
if ( bDetectOk )
{
- UINT16 nTemp16;
+ sal_uInt16 nTemp16;
rStm >> nTemp16;
if ( nTemp16 == 0x2a )
{
nFormat = GFF_TIF;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- ULONG nCount;
- ULONG nMax = DATA_SIZE - 48;
- UINT32 nTemp32;
- BOOL bOk = FALSE;
+ sal_uLong nCount;
+ sal_uLong nMax = DATA_SIZE - 48;
+ sal_uInt32 nTemp32;
+ sal_Bool bOk = sal_False;
// Offset des ersten IFD einlesen
rStm >> nTemp32;
rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 );
- if ( bWideSearch || ( nCount < nMax ) )
+ if ( nCount < nMax )
{
// Tag's lesen, bis wir auf Tag256 ( Width ) treffen
// nicht mehr Bytes als DATA_SIZE lesen
rStm >> nTemp16;
while ( nTemp16 != 256 )
{
- bOk = bWideSearch || ( nCount < nMax );
+ bOk = nCount < nMax;
if ( !bOk )
{
break;
@@ -913,7 +821,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -924,9 +832,9 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectXBM( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_XBM;
@@ -940,9 +848,9 @@ BOOL GraphicDescriptor::ImpDetectXBM( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectXPM( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_XPM;
@@ -955,22 +863,23 @@ BOOL GraphicDescriptor::ImpDetectXPM( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// erst auf Datei Extension pruefen, da diese aussagekraeftiger ist
// als die 2 ID Bytes
if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
+ sal_uInt8 nFirst, nSecond;
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -985,19 +894,20 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_uInt8 nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1012,19 +922,20 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
- rStm.Seek( nStmPos );
+ sal_uInt8 nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
rStm >> nFirst >> nSecond;
if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) )
- bRet = TRUE;
+ bRet = sal_True;
+ rStm.Seek( nStmPos );
}
if ( bRet )
@@ -1039,19 +950,20 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool )
{
- UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_uInt32 nMagicNumber;
+ sal_Bool bRet = sal_False;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x59a66a95 )
{
nFormat = GFF_RAS;
- return TRUE;
+ bRet = sal_True;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1060,9 +972,9 @@ BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectTGA( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_TGA;
@@ -1075,28 +987,28 @@ BOOL GraphicDescriptor::ImpDetectTGA( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- UINT32 nMagicNumber;
- rStm.Seek( nStmPos );
+ sal_uInt32 nMagicNumber;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nMagicNumber;
if ( nMagicNumber == 0x38425053 )
{
- UINT16 nVersion;
+ sal_uInt16 nVersion;
rStm >> nVersion;
if ( nVersion == 1 )
{
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT16 nChannels;
- UINT32 nRows;
- UINT32 nColumns;
- UINT16 nDepth;
- UINT16 nMode;
+ sal_uInt16 nChannels;
+ sal_uInt32 nRows;
+ sal_uInt32 nColumns;
+ sal_uInt16 nDepth;
+ sal_uInt16 nMode;
rStm.SeekRel( 6 ); // Pad
rStm >> nChannels >> nRows >> nColumns >> nDepth >> nMode;
if ( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) )
@@ -1113,17 +1025,18 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
aPixSize.Height() = nRows;
break;
default:
- bRet = FALSE;
+ bRet = sal_False;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
}
}
if ( bRet )
nFormat = GFF_PSD;
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1133,15 +1046,16 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool )
{
// es wird die EPS mit Vorschaubild Variante und die Extensionuebereinstimmung
// geprueft
sal_uInt32 nFirstLong;
sal_uInt8 nFirstBytes[20];
+ sal_Bool bRet = sal_False;
- rStm.Seek( nStmPos );
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nFirstLong;
rStm.SeekRel( -4 );
@@ -1152,10 +1066,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
&& ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{
nFormat = GFF_EPS;
- return TRUE;
+ bRet = sal_True;
}
- else
- return FALSE;
+ rStm.Seek( nStmPos );
+ return bRet;
}
/*************************************************************************
@@ -1164,9 +1078,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectDXF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_DXF;
@@ -1179,9 +1093,9 @@ BOOL GraphicDescriptor::ImpDetectDXF( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectMET( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_MET;
@@ -1195,16 +1109,18 @@ BOOL GraphicDescriptor::ImpDetectMET( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_PCT;
else
{
- BYTE sBuf[3]={0};
+ sal_Int32 nStmPos = rStm.Tell();
- rStm.Seek( nStmPos + 522 );
+ sal_uInt8 sBuf[4];
+
+ rStm.SeekRel( 522 );
rStm.Read( sBuf, 3 );
if( !rStm.GetError() )
@@ -1212,10 +1128,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) &&
( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) )
{
- bRet = TRUE;
+ bRet = sal_True;
nFormat = GFF_PCT;
}
}
+ rStm.Seek( nStmPos );
}
return bRet;
@@ -1228,21 +1145,23 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool )
{
- BOOL bRet = FALSE;
-
+ sal_Bool bRet = sal_False;
if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL )
- bRet = TRUE;
+ bRet = sal_True;
else
{
- BYTE nFirst, nSecond;
+ sal_Int32 nStmPos = rStm.Tell();
+
+ sal_uInt8 nFirst, nSecond;
- rStm.Seek( nStmPos );
rStm >> nFirst >> nSecond;
if( nFirst == 'J' && nSecond == 'J' )
- bRet = TRUE;
+ bRet = sal_True;
+
+ rStm.Seek( nStmPos );
}
if( bRet )
@@ -1258,9 +1177,9 @@ BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectSGV( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_SGV;
@@ -1274,15 +1193,14 @@ BOOL GraphicDescriptor::ImpDetectSGV( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
+sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo )
{
- UINT32 n32;
- BOOL bRet = FALSE;
- BYTE cByte;
+ sal_uInt32 n32;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cByte;
+ sal_Int32 nStmPos = rStm.Tell();
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- rStm.Seek( nStmPos );
-
rStm >> n32;
if ( n32 == 0x44475653 )
{
@@ -1290,12 +1208,12 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
if ( cByte == 0x49 )
{
nFormat = GFF_SVM;
- bRet = TRUE;
+ bRet = sal_True;
if ( bExtendedInfo )
{
- UINT32 nTemp32;
- UINT16 nTemp16;
+ sal_uInt32 nTemp32;
+ sal_uInt16 nTemp16;
rStm.SeekRel( 0x04 );
@@ -1322,14 +1240,14 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
if( n32 == 0x4D4C4356 )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rStm >> nTmp16;
if( nTmp16 == 0x4654 )
{
nFormat = GFF_SVM;
- bRet = TRUE;
+ bRet = sal_True;
if( bExtendedInfo )
{
@@ -1343,7 +1261,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
}
}
}
-
+ rStm.Seek( nStmPos );
return bRet;
}
@@ -1354,9 +1272,9 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectWMF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_WMF;
@@ -1369,9 +1287,9 @@ BOOL GraphicDescriptor::ImpDetectWMF( SvStream&, BOOL )
|*
\************************************************************************/
-BOOL GraphicDescriptor::ImpDetectEMF( SvStream&, BOOL )
+sal_Bool GraphicDescriptor::ImpDetectEMF( SvStream&, sal_Bool )
{
- BOOL bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL;
+ sal_Bool bRet = aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL;
if (bRet)
nFormat = GFF_EMF;
diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk
deleted file mode 100644
index c1cd42b666c1..000000000000
--- a/svtools/source/filter.vcl/filter/makefile.mk
+++ /dev/null
@@ -1,97 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=filter
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES= strings.src \
- dlgexpor.src \
- dlgepng.src \
- dlgejpg.src
-
-SLOFILES= \
- $(SLO)$/FilterConfigCache.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/SvFilterOptionsDialog.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvspln.obj \
- $(SLO)$/sgvtext.obj
-
-EXCEPTIONSNOOPTFILES= \
- $(SLO)$/FilterConfigCache.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/SvFilterOptionsDialog.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvtext.obj
-
-LIB1TARGET= $(SLB)$/$(TARGET).uno.lib
-LIB1OBJFILES= \
- $(SLO)$/dlgexpor.obj \
- $(SLO)$/dlgejpg.obj \
- $(SLO)$/dlgepng.obj \
- $(SLO)$/SvFilterOptionsDialog.obj
-
-LIB2TARGET= $(SLB)$/$(TARGET).lib
-LIB2OBJFILES= \
- $(SLO)$/filter.obj \
- $(SLO)$/filter2.obj \
- $(SLO)$/sgfbram.obj \
- $(SLO)$/sgvmain.obj \
- $(SLO)$/sgvtext.obj \
- $(SLO)$/sgvspln.obj \
- $(SLO)$/FilterConfigItem.obj \
- $(SLO)$/FilterConfigCache.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx
index 2fee4470a203..8559cbee30eb 100644
--- a/svtools/source/filter.vcl/filter/sgfbram.cxx
+++ b/svtools/source/filter.vcl/filter/sgfbram.cxx
@@ -38,10 +38,6 @@
#include "sgffilt.hxx"
#include "sgfbram.hxx"
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" )
-#endif
-
/*************************************************************************
|*
|* operator>>( SvStream&, SgfHeader& )
@@ -72,11 +68,11 @@ SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead)
|* SgfHeader::ChkMagic()
|*
*************************************************************************/
-BOOL SgfHeader::ChkMagic()
+sal_Bool SgfHeader::ChkMagic()
{ return Magic=='J'*256+'J'; }
-UINT32 SgfHeader::GetOffset()
-{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+sal_uInt32 SgfHeader::GetOffset()
+{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); }
/*************************************************************************
@@ -98,8 +94,8 @@ SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr)
return rIStream;
}
-UINT32 SgfEntry::GetOffset()
-{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+sal_uInt32 SgfEntry::GetOffset()
+{ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi); }
/*************************************************************************
@@ -150,21 +146,21 @@ SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead)
return rOStream;
}
-void BmpFileHeader::SetSize(UINT32 Size)
+void BmpFileHeader::SetSize(sal_uInt32 Size)
{
- SizeLo=UINT16(Size & 0x0000FFFF);
- SizeHi=UINT16((Size & 0xFFFF0000)>>16);
+ SizeLo=sal_uInt16(Size & 0x0000FFFF);
+ SizeHi=sal_uInt16((Size & 0xFFFF0000)>>16);
}
-void BmpFileHeader::SetOfs(UINT32 Ofs)
+void BmpFileHeader::SetOfs(sal_uInt32 Ofs)
{
- OfsLo=UINT16(Ofs & 0x0000FFFF);
- OfsHi=UINT16((Ofs & 0xFFFF0000)>>16);
+ OfsLo=sal_uInt16(Ofs & 0x0000FFFF);
+ OfsHi=sal_uInt16((Ofs & 0xFFFF0000)>>16);
}
-UINT32 BmpFileHeader::GetOfs()
+sal_uInt32 BmpFileHeader::GetOfs()
{
- return UINT32(OfsLo)+0x00010000*UINT32(OfsHi);
+ return sal_uInt32(OfsLo)+0x00010000*sal_uInt32(OfsHi);
}
/*************************************************************************
@@ -224,14 +220,14 @@ SvStream& operator<<(SvStream& rOStream, const RGBQuad& rQuad)
class PcxExpand
{
private:
- USHORT Count;
- BYTE Data;
+ sal_uInt16 Count;
+ sal_uInt8 Data;
public:
PcxExpand() { Count=0; }
- BYTE GetByte(SvStream& rInp);
+ sal_uInt8 GetByte(SvStream& rInp);
};
-BYTE PcxExpand::GetByte(SvStream& rInp)
+sal_uInt8 PcxExpand::GetByte(SvStream& rInp)
{
if (Count>0) {
Count--;
@@ -255,21 +251,21 @@ BYTE PcxExpand::GetByte(SvStream& rInp)
|* SgfFilterBmp()
|*
*************************************************************************/
-BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
+sal_Bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
{
BmpFileHeader aBmpHead;
BmpInfoHeader aBmpInfo;
- USHORT nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes
- USHORT nWdtOut; // Breite der Output-Bitmap in Bytes
- USHORT nColors; // Anzahl der Farben (1,16,256)
- USHORT nColBits; // Anzahl der Bits/Pixel (2, 4, 8)
- USHORT i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler
- USHORT a,b; // Hilfsvariable
- BYTE pl1 = 0; // Masken fuer die Planes
- BYTE* pBuf=NULL; // Buffer fuer eine Pixelzeile
+ sal_uInt16 nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes
+ sal_uInt16 nWdtOut; // Breite der Output-Bitmap in Bytes
+ sal_uInt16 nColors; // Anzahl der Farben (1,16,256)
+ sal_uInt16 nColBits; // Anzahl der Bits/Pixel (2, 4, 8)
+ sal_uInt16 i,j,k; // Spaltenzaehler, Zeilenzaehler, Planezaehler
+ sal_uInt16 a,b; // Hilfsvariable
+ sal_uInt8 pl1 = 0; // Masken fuer die Planes
+ sal_uInt8* pBuf=NULL; // Buffer fuer eine Pixelzeile
PcxExpand aPcx;
- ULONG nOfs;
- BYTE cRGB[4];
+ sal_uLong nOfs;
+ sal_uInt8 cRGB[4];
if (rHead.Planes<=1) nColBits=1; else nColBits=4; if (rHead.Typ==4) nColBits=8;
nColors=1<<nColBits;
@@ -290,8 +286,8 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
aBmpInfo.yDpmm=0;
aBmpInfo.ColUsed=0;
aBmpInfo.ColMust=0;
- pBuf=new BYTE[nWdtOut];
- if (!pBuf) return FALSE; // Fehler: kein Speichel da
+ pBuf=new sal_uInt8[nWdtOut];
+ if (!pBuf) return sal_False; // Fehler: kein Speichel da
rOut<<aBmpHead<<aBmpInfo;
memset(pBuf,0,nWdtOut); // Buffer mit Nullen fuellen
@@ -308,11 +304,11 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
pBuf[i]=aPcx.GetByte(rInp);
}
for(i=nWdtInp;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
} else if (nColors==16) {
- BYTE pl2= 0; // Masken fuer die Planes
+ sal_uInt8 pl2= 0; // Masken fuer die Planes
rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz
rOut<<RGBQuad(0x24,0x24,0x24); // Grau 80%
@@ -356,7 +352,7 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
}
}
for(i=nWdtInp*4;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
} else if (nColors==256) {
@@ -376,12 +372,12 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
for(i=0;i<rHead.Xsize;i++)
pBuf[i]=aPcx.GetByte(rInp);
for(i=rHead.Xsize;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
- rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rueckwaerts schreiben!
+ rOut.Seek(nOfs+((sal_uLong)rHead.Ysize-j-1L)*(sal_uLong)nWdtOut); // rueckwaerts schreiben!
rOut.Write((char*)pBuf,nWdtOut);
}
}
delete[] pBuf;
- return TRUE;
+ return sal_True;
}
@@ -390,14 +386,14 @@ BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
|* SgfBMapFilter()
|*
*************************************************************************/
-BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
+sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
{
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
nFileStart=rInp.Tell();
rInp>>aHead;
@@ -409,7 +405,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
rInp>>aEntr;
nNext=aEntr.GetOffset();
if (aEntr.Typ==aHead.Typ) {
- bRdFlag=TRUE;
+ bRdFlag=sal_True;
switch(aEntr.Typ) {
case SgfBitImag0:
case SgfBitImag1:
@@ -419,7 +415,7 @@ BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
}
} // while(nNext)
}
- if (rInp.GetError()) bRet=FALSE;
+ if (rInp.GetError()) bRet=sal_False;
return(bRet);
}
@@ -435,15 +431,15 @@ long SgfVectXmul=0;
long SgfVectYmul=0;
long SgfVectXdiv=0;
long SgfVectYdiv=0;
-BOOL SgfVectScal=FALSE;
+sal_Bool SgfVectScal=sal_False;
////////////////////////////////////////////////////////////
// Hpgl2SvFarbe ////////////////////////////////////////////
////////////////////////////////////////////////////////////
-Color Hpgl2SvFarbe( BYTE nFarb )
+Color Hpgl2SvFarbe( sal_uInt8 nFarb )
{
- ULONG nColor = COL_BLACK;
+ sal_uLong nColor = COL_BLACK;
switch (nFarb & 0x07) {
case 0: nColor=COL_WHITE; break;
@@ -464,20 +460,20 @@ Color Hpgl2SvFarbe( BYTE nFarb )
|* SgfFilterVect()
|*
*************************************************************************/
-BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf)
+sal_Bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf)
{
VirtualDevice aOutDev;
SgfVector aVect;
- BYTE nFarb;
- BYTE nFrb0=7;
- BYTE nLTyp;
- BYTE nOTyp;
- BOOL bEoDt=FALSE;
- BOOL bPDwn=FALSE;
+ sal_uInt8 nFarb;
+ sal_uInt8 nFrb0=7;
+ sal_uInt8 nLTyp;
+ sal_uInt8 nOTyp;
+ sal_Bool bEoDt=sal_False;
+ sal_Bool bPDwn=sal_False;
Point aP0(0,0);
Point aP1(0,0);
String Msg;
- USHORT RecNr=0;
+ sal_uInt16 RecNr=0;
rMtf.Record(&aOutDev);
aOutDev.SetLineColor(Color(COL_BLACK));
@@ -485,9 +481,9 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
while (!bEoDt && !rInp.GetError()) {
rInp>>aVect; RecNr++;
- nFarb=(BYTE) (aVect.Flag & 0x000F);
- nLTyp=(BYTE)((aVect.Flag & 0x00F0) >>4);
- nOTyp=(BYTE)((aVect.Flag & 0x0F00) >>8);
+ nFarb=(sal_uInt8) (aVect.Flag & 0x000F);
+ nLTyp=(sal_uInt8)((aVect.Flag & 0x00F0) >>4);
+ nOTyp=(sal_uInt8)((aVect.Flag & 0x0F00) >>8);
bEoDt=(aVect.Flag & 0x4000) !=0;
bPDwn=(aVect.Flag & 0x8000) !=0;
@@ -528,7 +524,7 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
Fraction( 1, 4 ), Fraction( 1, 4 ) );
rMtf.SetPrefMapMode( aMap );
rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) );
- return TRUE;
+ return sal_True;
}
@@ -537,14 +533,14 @@ BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
|* SgfVectFilter()
|*
*************************************************************************/
-BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
+sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
{
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
nFileStart=rInp.Tell();
rInp>>aHead;
@@ -559,7 +555,7 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
}
} // while(nNext)
if (bRdFlag) {
- if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok
}
}
return(bRet);
@@ -571,9 +567,9 @@ BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
|* SgfFilterPScr()
|*
*************************************************************************/
-BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
+sal_Bool SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
{
- return FALSE; // PostSrcipt wird noch nicht unterstuetzt !
+ return sal_False; // PostSrcipt wird noch nicht unterstuetzt !
}
@@ -584,7 +580,7 @@ BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
|* Beschreibung Feststellen, um was fuer ein SGF/SGV es sich handelt.
|*
*************************************************************************/
-BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion)
+sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion)
{
#if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Allignment!
if (sizeof(SgfHeader)!=SgfHeaderSize ||
@@ -595,7 +591,7 @@ BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion)
sizeof(RGBQuad )!=RGBQuadSize ) return SGF_DONTKNOW;
#endif
- ULONG nPos;
+ sal_uLong nPos;
SgfHeader aHead;
nVersion=0;
nPos=rInp.Tell();
diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx
index 7d0e45a4c3fb..404e2b5b01a1 100644
--- a/svtools/source/filter.vcl/filter/sgvmain.cxx
+++ b/svtools/source/filter.vcl/filter/sgvmain.cxx
@@ -55,7 +55,7 @@
p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \
p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \
SWAPPOINT(p.U); \
- UINT16 iTemp; \
+ sal_uInt16 iTemp; \
for (iTemp=0;iTemp<20;iTemp++) { \
rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \
rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }}
@@ -107,58 +107,49 @@
//
////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Fontuebersetzung ///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
SgfFontLst* pSgfFonts = 0;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" )
-static void AntiMscBug() {}
-#endif
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Fuer Kreisunterarten, Text und gedrehte Rechtecke ///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
-void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs)
+void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs)
{
- INT16 dx,dy;
+ sal_Int16 dx,dy;
double x1,y1;
dx=P.x-cx;
dy=P.y-cy;
x1=dx*cs-dy*sn;
y1=dy*cs+dx*sn;
- P.x=cx+INT16(x1);
- P.y=cy+INT16(y1);
+ P.x=cx+sal_Int16(x1);
+ P.y=cy+sal_Int16(y1);
}
-void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs)
+void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs)
{
- INT16 dx,dy;
+ sal_Int16 dx,dy;
double x1,y1;
- dx=(INT16)(P.X()-cx);
- dy=(INT16)(P.Y()-cy);
+ dx=(sal_Int16)(P.X()-cx);
+ dy=(sal_Int16)(P.Y()-cy);
x1=dx*cs-dy*sn;
y1=dy*cs+dx*sn;
- P=Point(cx+INT16(x1),cy+INT16(y1));
+ P=Point(cx+sal_Int16(x1),cy+sal_Int16(y1));
}
-INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div)
+sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div)
{
- INT32 Temp;
- Temp=INT32(a)*INT32(Mul)/INT32(Div);
- return INT16(Temp);
+ sal_Int32 Temp;
+ Temp=sal_Int32(a)*sal_Int32(Mul)/sal_Int32(Div);
+ return sal_Int16(Temp);
}
-UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div)
+sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div)
{
- UINT32 Temp;
- Temp=UINT32(a)*UINT32(Mul)/UINT32(Div);
- return UINT16(Temp);
+ sal_uInt32 Temp;
+ Temp=sal_uInt32(a)*sal_uInt32(Mul)/sal_uInt32(Div);
+ return sal_uInt16(Temp);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -173,10 +164,10 @@ SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd)
void DtHdOverSeek(SvStream& rInp)
{
- ULONG FPos=rInp.Tell();
- FPos+=(ULONG)DtHdSize;
+ sal_uLong FPos=rInp.Tell();
+ FPos+=(sal_uLong)DtHdSize;
rInp.Seek(FPos);
-// rInp.seekg(rInp.tellg()+(ULONG)DtHdSize);
+// rInp.seekg(rInp.tellg()+(sal_uLong)DtHdSize);
}
@@ -191,21 +182,21 @@ SvStream& operator>>(SvStream& rIStream, PageType& rPage)
void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk)
{
- ULONG Siz;
- Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
+ sal_uLong Siz;
+ Siz=(sal_uLong)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
rInp.Seek(rInp.Tell()+Siz);
}
SvStream& operator>>(SvStream& rInp, ObjkType& rObjk)
{ // Die Fileposition im Stream bleibt unveraendert!
- ULONG nPos;
+ sal_uLong nPos;
nPos=rInp.Tell();
rInp.Read((char*)&rObjk.Last,ObjkSize);
#if defined OSL_BIGENDIAN
SWAPOBJK(rObjk);
#endif
#ifdef InArbeit
- ULONG nPos1=rInp.Tell();
+ sal_uLong nPos1=rInp.Tell();
if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute();
#endif
rInp.Seek(nPos);
@@ -333,10 +324,10 @@ SvStream& operator>>(SvStream& rInp, GrupType& rGrup)
|* Sgv2SvFarbe()
|*
*************************************************************************/
-Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
+Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts)
{
- UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
- BYTE nInt2=100-nInts;
+ sal_uInt16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
+ sal_uInt8 nInt2=100-nInts;
switch(nFrb1 & 0x07) {
case 0: r1=0xFF; g1=0xFF; b1=0xFF; break;
case 1: r1=0xFF; g1=0xFF; break;
@@ -357,9 +348,9 @@ Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
case 6: b2=0xFF; break;
case 7: break;
}
- r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100);
- g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100);
- b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100);
+ r1=(sal_uInt16)((sal_uInt32)r1*nInts/100+(sal_uInt32)r2*nInt2/100);
+ g1=(sal_uInt16)((sal_uInt32)g1*nInts/100+(sal_uInt32)g2*nInt2/100);
+ b1=(sal_uInt16)((sal_uInt32)b1*nInts/100+(sal_uInt32)b2*nInt2/100);
Color aColor( (sal_uInt8)r1, (sal_uInt8)g1, (sal_uInt8)b1 );
return aColor;
}
@@ -448,7 +439,7 @@ void StrkType::Draw(OutputDevice& rOut)
|* RectType::DrawObjekt()
|*
*************************************************************************/
-void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut)
+void SgfAreaColorIntens(sal_uInt16 Muster, sal_uInt8 Col1, sal_uInt8 Col2, sal_uInt8 Int, OutputDevice& rOut)
{
ObjAreaType F;
F.FMuster=Muster;
@@ -458,15 +449,15 @@ void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDev
SetArea(F,rOut);
}
-void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut)
+void DrawSlideRect(sal_Int16 x1, sal_Int16 y1, sal_Int16 x2, sal_Int16 y2, ObjAreaType& F, OutputDevice& rOut)
{
- INT16 i,i0,b,b0;
- INT16 Int1,Int2;
- INT16 Col1,Col2;
+ sal_Int16 i,i0,b,b0;
+ sal_Int16 Int1,Int2;
+ sal_Int16 Col1,Col2;
// ClipMerk: HgdClipRec;
- INT16 cx,cy;
- INT16 MaxR;
- INT32 dx,dy;
+ sal_Int16 cx,cy;
+ sal_Int16 MaxR;
+ sal_Int32 dx,dy;
rOut.SetLineColor();
if (x1>x2) { i=x1; x1=x2; x2=i; }
@@ -474,7 +465,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
Int1=100-F.FIntens; Int2=F.FIntens;
if (Int1==Int2) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(x1,y1,x2,y2));
} else {
b0=Int1;
@@ -483,30 +474,30 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
i0=y1;
i=y1;
while (i<=y2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawRect(Rectangle(x1,i0,x2,i-1));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(x1,i0,x2,y2));
} break;
case 0x28: { // horizontal
i0=x1;
i=x1;
while (i<=x2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawRect(Rectangle(i0,y1,i-1,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawRect(Rectangle(i0,y1,x2,y2));
} break;
@@ -520,14 +511,14 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
dx=x2-x1+1;
dy=y2-y1+1;
a=sqrt((double)(dx*dx+dy*dy));
- MaxR=INT16(a) /2 +1;
+ MaxR=sal_Int16(a) /2 +1;
b0=Int2;
i0=MaxR; if (MaxR<1) MaxR=1;
i=MaxR;
while (i>=0) {
- b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
//if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) {
// then begin { Fallunterscheidung fuer etwas bessere Performance }
// s2:=i0-i+2;
@@ -540,7 +531,7 @@ void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, Outpu
}
i--;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
rOut.SetClipRegion(ClipMerk);
} break; // Kreis
@@ -567,7 +558,7 @@ void RectType::Draw(OutputDevice& rOut)
}
} else {
Point aPts[4];
- USHORT i;
+ sal_uInt16 i;
double sn,cs;
sn=sin(double(DrehWink)*3.14159265359/18000);
cs=cos(double(DrehWink)*3.14159265359/18000);
@@ -594,7 +585,7 @@ void PolyType::Draw(OutputDevice& rOut)
if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
SetLine(L,rOut);
Polygon aPoly(nPoints);
- USHORT i;
+ sal_uInt16 i;
for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i);
if ((Flags & PolyClosBit) !=0) {
rOut.DrawPolygon(aPoly);
@@ -614,13 +605,13 @@ void SplnType::Draw(OutputDevice& rOut)
SetLine(L,rOut);
Polygon aPoly(0);
Polygon aSpln(nPoints);
- USHORT i;
+ sal_uInt16 i;
for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i);
if ((Flags & PolyClosBit) !=0) {
- Spline2Poly(aSpln,TRUE,aPoly);
+ Spline2Poly(aSpln,sal_True,aPoly);
if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly);
} else {
- Spline2Poly(aSpln,FALSE,aPoly);
+ Spline2Poly(aSpln,sal_False,aPoly);
if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly);
}
}
@@ -630,22 +621,22 @@ void SplnType::Draw(OutputDevice& rOut)
|* CircType::Draw()
|*
*************************************************************************/
-void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut)
+void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAreaType& F, OutputDevice& rOut)
{
- INT16 x1=cx-rx;
- INT16 y1=cy-ry;
- INT16 x2=cx+rx;
- INT16 y2=cy+ry;
+ sal_Int16 x1=cx-rx;
+ sal_Int16 y1=cy-ry;
+ sal_Int16 x2=cx+rx;
+ sal_Int16 y2=cy+ry;
- INT16 i,i0,b,b0;
- INT16 Int1,Int2;
- INT16 Col1,Col2;
+ sal_Int16 i,i0,b,b0;
+ sal_Int16 Int1,Int2;
+ sal_Int16 Col1,Col2;
rOut.SetLineColor();
Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
Int1=100-F.FIntens; Int2=F.FIntens;
if (Int1==Int2) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
} else {
b0=Int1;
@@ -655,16 +646,16 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=y1;
i=y1;
while (i<=y2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk);
@@ -674,23 +665,23 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=x1;
i=x1;
while (i<=x2) {
- b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1));
if (b!=b0) {
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b;
}
i++;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,x2,y2));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk);
} break;
case 0x18: case 0x38: { // Kreis
- INT16 MaxR;
+ sal_Int16 MaxR;
if (rx<1) rx=1;
if (ry<1) ry=1;
@@ -699,17 +690,17 @@ void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, Outpu
i0=MaxR; if (MaxR<1) MaxR=1;
i=MaxR;
while (i>=0) {
- b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ b=Int1+sal_Int16((sal_Int32(Int2-Int1)*sal_Int32(i)) /sal_Int32(MaxR));
if (b!=b0) {
- INT32 temp=INT32(i0)*INT32(ry)/INT32(rx);
- INT16 j0=INT16(temp);
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ sal_Int32 temp=sal_Int32(i0)*sal_Int32(ry)/sal_Int32(rx);
+ sal_Int16 j0=sal_Int16(temp);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0));
i0=i; b0=b;
}
i--;
}
- SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int1,rOut);
rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
} break; // Kreis
}
@@ -778,7 +769,7 @@ void BmapType::Draw(OutputDevice& rOut)
{
//ifstream aInp;
unsigned char nSgfTyp;
- USHORT nVersion;
+ sal_uInt16 nVersion;
String aStr(
reinterpret_cast< char const * >(&Filename[ 1 ]),
(xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
@@ -803,7 +794,7 @@ void BmapType::Draw(OutputDevice& rOut)
SgfVectYmul=Pos2.y-Pos1.y;
SgfVectXdiv=0;
SgfVectYdiv=0;
- SgfVectScal=TRUE;
+ SgfVectScal=sal_True;
SgfVectFilter(*pInp,aMtf);
SgfVectXofs=0;
SgfVectYofs=0;
@@ -811,7 +802,7 @@ void BmapType::Draw(OutputDevice& rOut)
SgfVectYmul=0;
SgfVectXdiv=0;
SgfVectYdiv=0;
- SgfVectScal=FALSE;
+ SgfVectScal=sal_False;
aMtf.Play(&rOut);
} break;
}
@@ -825,9 +816,9 @@ void BmapType::Draw(OutputDevice& rOut)
|* GrupType::...
|*
*************************************************************************/
-UINT32 GrupType::GetSubPtr()
+sal_uInt32 GrupType::GetSubPtr()
{
- return UINT32(SbLo)+0x00010000*UINT32(SbHi);
+ return sal_uInt32(SbLo)+0x00010000*sal_uInt32(SbHi);
}
/*************************************************************************
@@ -838,8 +829,8 @@ UINT32 GrupType::GetSubPtr()
void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
{
ObjkType aObjk;
- USHORT nGrpCnt=0;
- BOOL bEnde=FALSE;
+ sal_uInt16 nGrpCnt=0;
+ sal_Bool bEnde=sal_False;
do {
rInp>>aObjk;
if (!rInp.GetError()) {
@@ -906,11 +897,11 @@ void DrawObjkList( SvStream& rInp, OutputDevice& rOut )
} // if rInp
if (!rInp.GetError()) {
if (aObjk.Next==0L) {
- if (nGrpCnt==0) bEnde=TRUE;
+ if (nGrpCnt==0) bEnde=sal_True;
else nGrpCnt--;
}
} else {
- bEnde=TRUE; // Lesefehler
+ bEnde=sal_True; // Lesefehler
}
} while (!bEnde);
}
@@ -942,15 +933,15 @@ void SkipObjkList(SvStream& rInp)
|* SgfFilterSDrw()
|*
*************************************************************************/
-BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
+sal_Bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
PageType aPage;
VirtualDevice aOutDev;
OutputDevice* pOutDev;
- ULONG nStdPos;
- ULONG nZchPos;
- USHORT Num;
+ sal_uLong nStdPos;
+ sal_uLong nZchPos;
+ sal_uInt16 Num;
pOutDev=&aOutDev;
DtHdOverSeek(rInp); // DataHeader weglesen
@@ -986,8 +977,8 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
rMtf.WindStart();
MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4));
rMtf.SetPrefMapMode(aMap);
- rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y));
- bRet=TRUE;
+ rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y));
+ bRet=sal_True;
return bRet;
}
@@ -998,18 +989,18 @@ BOOL SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
|* SgfSDrwFilter()
|*
*************************************************************************/
-BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
+sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
{
#if OSL_DEBUG_LEVEL > 1 // Recordgroessen checken. Neuer Compiler hat vielleichte anderes Alignment!
- if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE;
+ if (sizeof(ObjTextType)!=ObjTextTypeSize) return sal_False;
#endif
- ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ sal_uLong nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
SgfHeader aHead;
SgfEntry aEntr;
- ULONG nNext;
- BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
- BOOL bRet=FALSE; // Returncode
+ sal_uLong nNext;
+ sal_Bool bRdFlag=sal_False; // Grafikentry gelesen ?
+ sal_Bool bRet=sal_False; // Returncode
aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) );
// aIniPath.ToAbs();
@@ -1030,7 +1021,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
}
} // while(nNext)
if (bRdFlag) {
- if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ if (!rInp.GetError()) bRet=sal_True; // Scheinbar Ok
}
}
delete pSgfFonts;
@@ -1038,7 +1029,7 @@ BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath )
}
/*
-Bitmap Dither(BYTE Intens)
+Bitmap Dither(sal_uInt8 Intens)
{
Bitmap aBmp;
BmpInfoHeader Info;
@@ -1081,8 +1072,4 @@ for n:=0 to 63 do
end;
*/
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "svtools", "AUTO_CODE" )
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx
index fb70950b2b2d..0ed81a50d534 100644
--- a/svtools/source/filter.vcl/filter/sgvspln.cxx
+++ b/svtools/source/filter.vcl/filter/sgvspln.cxx
@@ -34,11 +34,6 @@
#include <tools/poly.hxx>
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" )
-#pragma optimize( "", off )
-#endif
-
#if defined( PM2 ) && defined( __BORLANDC__ )
#pragma option -Od
#endif
@@ -146,10 +141,6 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */
#define NEGMAX -POSMIN /* groesste negative Zahl */
#define NEGMIN -POSMAX /* kleinste negative Zahl */
-#define TRUE 1
-#define FALSE 0
-
-
/* Definition von Funktionsmakros:
*/
@@ -176,7 +167,7 @@ short basis() /* BASIS maschinenunabhaengig bestimmen */
/*---------------------- MODUL TRIDIAGONAL ------------------------*/
-USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
+sal_uInt16 TriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower,
double* diag, double* upper, double* b)
/************************/
/* GAUSS-Verfahren fuer */
@@ -213,7 +204,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/* */
/* Eingabeparameter: */
/* ================ */
-/* n Dimension der Matrix ( > 1 ) USHORT n */
+/* n Dimension der Matrix ( > 1 ) sal_uInt16 n */
/* */
/* lower untere Nebendiagonale double lower[n] */
/* diag Hauptdiagonale double diag[n] */
@@ -223,7 +214,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/* Dreieckzerlegung der Ausgangsmatrix. */
/* */
/* b rechte Seite des Systems double b[n] */
-/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* rep = 0 erstmaliger Aufruf sal_Bool rep */
/* !=0 wiederholter Aufruf */
/* fuer gleiche Matrix, */
/* aber verschiedenes b. */
@@ -257,7 +248,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/*.cp 5 */
{
- USHORT i;
+ sal_uInt16 i;
short j;
// double fabs(double);
@@ -308,7 +299,7 @@ USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
/*---------------- MODUL ZYKLISCH TRIDIAGONAL ----------------------*/
-USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
+sal_uInt16 ZyklTriDiagGS(sal_Bool rep, sal_uInt16 n, double* lower, double* diag,
double* upper, double* lowrow, double* ricol, double* b)
/******************************/
/* Systeme mit zyklisch tri- */
@@ -349,12 +340,12 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
/* */
/* Eingabeparameter: */
/* ================ */
-/* n Dimension der Matrix ( > 2 ) USHORT n */
+/* n Dimension der Matrix ( > 2 ) sal_uInt16 n */
/* lower untere Nebendiagonale double lower[n] */
/* diag Hauptdiagonale double diag[n] */
/* upper obere Nebendiagonale double upper[n] */
/* b rechte Seite des Systems double b[n] */
-/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* rep = 0 erstmaliger Aufruf sal_Bool rep */
/* !=0 wiederholter Aufruf */
/* fuer gleiche Matrix, */
/* aber verschiedenes b. */
@@ -391,7 +382,7 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
/*.cp 5 */
{
double temp; // fabs(double);
- USHORT i;
+ sal_uInt16 i;
short j;
if ( n < 3 ) return(1);
@@ -462,15 +453,15 @@ USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
|*
*************************************************************************/
-USHORT NaturalSpline(USHORT n, double* x, double* y,
+sal_uInt16 NaturalSpline(sal_uInt16 n, double* x, double* y,
double Marg0, double MargN,
- BYTE MargCond,
+ sal_uInt8 MargCond,
double* b, double* c, double* d)
{
- USHORT i;
+ sal_uInt16 i;
double* a;
double* h;
- USHORT error;
+ sal_uInt16 error;
if (n<2) return 1;
if ( (MargCond & ~3) ) return 2;
@@ -520,7 +511,7 @@ USHORT NaturalSpline(USHORT n, double* x, double* y,
if (n==2) {
c[1]=a[0]/d[0];
} else {
- error=TriDiagGS(FALSE,n-1,b,d,c,a);
+ error=TriDiagGS(sal_False,n-1,b,d,c,a);
if (error!=0) { delete[] a; delete[] h; return error+2; }
for (i=0;i<n-1;i++) c[i+1]=a[i];
}
@@ -569,11 +560,11 @@ USHORT NaturalSpline(USHORT n, double* x, double* y,
*************************************************************************/
-USHORT PeriodicSpline(USHORT n, double* x, double* y,
+sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y,
double* b, double* c, double* d)
{ // Arrays muessen von [0..n] dimensioniert sein!
- USHORT Error;
- USHORT i,im1,nm1; //integer
+ sal_uInt16 Error;
+ sal_uInt16 i,im1,nm1; //integer
double hr,hl;
double* a;
double* lowrow;
@@ -610,7 +601,7 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y,
lowrow[0]=hr;
ricol[0]=hr;
a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl);
- Error=ZyklTriDiagGS(FALSE,n,b,d,c,lowrow,ricol,a);
+ Error=ZyklTriDiagGS(sal_False,n,b,d,c,lowrow,ricol,a);
if ( Error != 0 )
{
delete[] a;
@@ -645,22 +636,22 @@ USHORT PeriodicSpline(USHORT n, double* x, double* y,
|*
*************************************************************************/
-USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond,
+sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond,
double Marg01, double Marg02,
double MargN1, double MargN2,
- BOOL CondT, double* T,
+ sal_Bool CondT, double* T,
double* bx, double* cx, double* dx,
double* by, double* cy, double* dy)
{
- USHORT Error;
- USHORT i;
+ sal_uInt16 Error;
+ sal_uInt16 i;
double deltX,deltY,delt,
alphX = 0,alphY = 0,
betX = 0,betY = 0;
if (n<2) return 1;
if ((MargCond & ~3) && (MargCond != 4)) return 2; // ungueltige Randbedingung
- if (CondT==FALSE) {
+ if (CondT==sal_False) {
T[0]=0.0;
for (i=0;i<n;i++) {
deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i];
@@ -722,21 +713,21 @@ USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond,
|* Polygons werden als Stuetzstellen angenommen.
|* n liefert die Anzahl der Teilpolynome.
|* Ist die Berechnung fehlerfrei verlaufen, so
-|* liefert die Funktion TRUE. Nur in diesem Fall
+|* liefert die Funktion sal_True. Nur in diesem Fall
|* ist Speicher fuer die Koeffizientenarrays
|* allokiert, der dann spaeter vom Aufrufer mittels
|* delete freizugeben ist.
|*
*************************************************************************/
-BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n,
double*& ax, double*& ay, double*& bx, double*& by,
double*& cx, double*& cy, double*& dx, double*& dy, double*& T)
{
- BYTE Marg;
+ sal_uInt8 Marg;
double Marg01;
double MargN1,MargN2;
- USHORT i;
+ sal_uInt16 i;
Point P0(-32768,-32768);
Point Pt;
@@ -777,12 +768,12 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
MargN2=0.0;
if (n>0) n--; // n Korregieren (Anzahl der Teilpolynome)
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( ( Marg == 3 && n >= 3 ) || ( Marg == 2 && n >= 2 ) )
{
- bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,FALSE,T,bx,cx,dx,by,cy,dy) == 0;
+ bRet = ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,sal_False,T,bx,cx,dx,by,cy,dy) == 0;
}
- if ( bRet == FALSE )
+ if ( bRet == sal_False )
{
delete[] ax;
delete[] ay;
@@ -806,7 +797,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* Beschreibung Konvertiert einen parametrichen kubischen
|* Polynomspline Spline (natuerlich oder periodisch)
|* in ein angenaehertes Polygon.
-|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* Die Funktion liefert sal_False, wenn ein Fehler bei
|* der Koeffizientenberechnung aufgetreten ist oder
|* das Polygon zu gross wird (>PolyMax=16380). Im 1.
|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
@@ -814,7 +805,7 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* auf +/-32000 begrenzt.
|*
*************************************************************************/
-BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
+sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly)
{
short MinKoord=-32000; // zur Vermeidung
short MaxKoord=32000; // von Ueberlaeufen
@@ -832,11 +823,11 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
double Step; // Schrittweite fuer t
double dt1,dt2,dt3; // Delta t, y, ^3
double t;
- BOOL bEnde; // Teilpolynom zu Ende?
- USHORT n; // Anzahl der zu zeichnenden Teilpolynome
- USHORT i; // aktuelles Teilpolynom
- BOOL bOk; // noch alles ok?
- USHORT PolyMax=16380;// Maximale Anzahl von Polygonpunkten
+ sal_Bool bEnde; // Teilpolynom zu Ende?
+ sal_uInt16 n; // Anzahl der zu zeichnenden Teilpolynome
+ sal_uInt16 i; // aktuelles Teilpolynom
+ sal_Bool bOk; // noch alles ok?
+ sal_uInt16 PolyMax=16380;// Maximale Anzahl von Polygonpunkten
long x,y;
bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
@@ -848,7 +839,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
i=0;
while (i<n) { // n Teilpolynome malen
t=tv[i]+Step;
- bEnde=FALSE;
+ bEnde=sal_False;
while (!bEnde) { // ein Teilpolynom interpolieren
bEnde=t>=tv[i+1];
if (bEnde) t=tv[i+1];
@@ -861,7 +852,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
rPoly.SetSize(rPoly.GetSize()+1);
rPoly.SetPoint(Point(short(x),short(y)),rPoly.GetSize()-1);
} else {
- bOk=FALSE; // Fehler: Polygon wird zu gross
+ bOk=sal_False; // Fehler: Polygon wird zu gross
}
t=t+Step;
} // Ende von Teilpolynom
@@ -879,7 +870,7 @@ BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
return bOk;
} // Ende von if (bOk)
rPoly.SetSize(0);
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx
index 538b75245403..5eb0b5e5c1f4 100644
--- a/svtools/source/filter.vcl/filter/sgvtext.cxx
+++ b/svtools/source/filter.vcl/filter/sgvtext.cxx
@@ -38,10 +38,6 @@
extern SgfFontLst* pSgfFonts;
-#if defined( WIN ) && defined( MSC )
-#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" )
-#endif
-
#ifndef abs
#define abs(x) ((x)<0 ? -(x) : (x))
#endif
@@ -217,9 +213,9 @@ extern SgfFontLst* pSgfFonts;
/////////////////////////////////////////////////////////////////////////////////
-BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L);
+sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L);
-BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L)
+sal_Bool CheckTextOutl(ObjAreaType& F, ObjLineType& L)
{
return (F.FIntens!=L.LIntens) ||
((F.FFarbe!=L.LFarbe) && (F.FIntens>0)) ||
@@ -265,11 +261,11 @@ short Sgf2hPoint(short a)
// Unterkante berechnen. Alles in SGF-Units.
// ======================================================================
-USHORT GetTopToBaseLine(USHORT MaxGrad)
+sal_uInt16 GetTopToBaseLine(sal_uInt16 MaxGrad)
{
long ret;
ret=long(MaxGrad)*long(CharTopToBase) /long(100);
- return USHORT(ret);
+ return sal_uInt16(ret);
}
// ======================================================================
@@ -310,9 +306,9 @@ UCHAR ConvertTextChar(UCHAR c)
-USHORT GetSchnittBit(UCHAR c)
+sal_uInt16 GetSchnittBit(UCHAR c)
{
- USHORT r=0;
+ sal_uInt16 r=0;
switch (c) {
case EscBold : r=TextBoldBit; break;
case EscRSlnt: r=TextRSlnBit; break;
@@ -353,10 +349,10 @@ long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal)
-void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3,
- UCHAR FlgVal, USHORT Schnitt0, USHORT& Schnitt)
+void ChgSchnittBit(sal_uInt16 Bit, sal_uInt16 Radio1, sal_uInt16 Radio2, sal_uInt16 Radio3,
+ UCHAR FlgVal, sal_uInt16 Schnitt0, sal_uInt16& Schnitt)
{
- USHORT All,Rad;
+ sal_uInt16 All,Rad;
Rad=Radio1 | Radio2 | Radio3;
All=Bit | Rad;
@@ -371,9 +367,9 @@ void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3,
-UCHAR GetNextChar(UCHAR* TBuf, USHORT Index)
+UCHAR GetNextChar(UCHAR* TBuf, sal_uInt16 Index)
{
- USHORT Cnt;
+ sal_uInt16 Cnt;
while (TBuf[Index]==Escape) {
Index++;
Cnt=0;
@@ -386,24 +382,24 @@ UCHAR GetNextChar(UCHAR* TBuf, USHORT Index)
-UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
+UCHAR ProcessOne(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- BOOL ScanEsc)
+ sal_Bool ScanEsc)
{
UCHAR c;
UCHAR Ident;
- BOOL Ende;
- BOOL q;
+ sal_Bool Ende;
+ sal_Bool q;
UCHAR FlgVal;
long NumVal;
long Sgn;
short i;
- BOOL EoVal;
+ sal_Bool EoVal;
do {
c=TBuf[Index]; Index++;
Ende=(c!=Escape);
- if (Ende==FALSE) {
+ if (Ende==sal_False) {
c=TBuf[Index]; Index++;
Ident=c; // Identifer merken
FlgVal=EscNoFlg;
@@ -417,36 +413,36 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
do {
NumVal=10*NumVal+c-'0';
EoVal=(TBuf[Index]<'0' || TBuf[Index]>'9');
- if (EoVal==FALSE) { c=TBuf[Index]; Index++; }
+ if (EoVal==sal_False) { c=TBuf[Index]; Index++; }
i--;
- } while (i>0 && EoVal==FALSE);
+ } while (i>0 && EoVal==sal_False);
NumVal=Sgn*NumVal;
}
q=!CheckTextOutl(AktAtr.F,AktAtr.L);
switch (Ident) {
- case EscFont : AktAtr.SetFont(ULONG (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break;
- case EscGrad : AktAtr.Grad =USHORT(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break;
- case EscBreit: AktAtr.Breite =USHORT(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break;
- case EscKaptS: AktAtr.Kapit =(BYTE)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break;
- case EscLFeed: AktAtr.LnFeed =USHORT(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break;
- case EscSlant: AktAtr.Slant =USHORT(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break;
+ case EscFont : AktAtr.SetFont(sal_uLong (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break;
+ case EscGrad : AktAtr.Grad =sal_uInt16(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break;
+ case EscBreit: AktAtr.Breite =sal_uInt16(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break;
+ case EscKaptS: AktAtr.Kapit =(sal_uInt8)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break;
+ case EscLFeed: AktAtr.LnFeed =sal_uInt16(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break;
+ case EscSlant: AktAtr.Slant =sal_uInt16(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break;
case EscVPos : AktAtr.ChrVPos=char (ChgValue(Atr0.ChrVPos,-128,127 ,FlgVal,NumVal)); break;
- case EscZAbst: AktAtr.ZAbst =(BYTE)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break;
- case EscHJust: AktAtr.Justify=(BYTE)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break;
- case EscFarbe: { AktAtr.L.LFarbe =(BYTE)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break;
- case EscBFarb: { AktAtr.L.LBFarbe=(BYTE)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break;
- case EscInts : { AktAtr.L.LIntens=(BYTE)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break;
-
- case EscMustr: { AktAtr.F.FMuster=USHORT(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break;
- case EscMFarb: { AktAtr.F.FFarbe =(BYTE)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break;
- case EscMBFrb: { AktAtr.F.FBFarbe=(BYTE)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break;
- case EscMInts: { AktAtr.F.FIntens=(BYTE)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break;
-
- case EscSMstr: { AktAtr.ShdF.FMuster=USHORT(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break;
- case EscSFarb: { AktAtr.ShdL.LFarbe =(BYTE)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break;
- case EscSBFrb: { AktAtr.ShdL.LBFarbe=(BYTE)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break;
- case EscSInts: { AktAtr.ShdL.LIntens=(BYTE)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break;
+ case EscZAbst: AktAtr.ZAbst =(sal_uInt8)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break;
+ case EscHJust: AktAtr.Justify=(sal_uInt8)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break;
+ case EscFarbe: { AktAtr.L.LFarbe =(sal_uInt8)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break;
+ case EscBFarb: { AktAtr.L.LBFarbe=(sal_uInt8)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break;
+ case EscInts : { AktAtr.L.LIntens=(sal_uInt8)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break;
+
+ case EscMustr: { AktAtr.F.FMuster=sal_uInt16(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscMFarb: { AktAtr.F.FFarbe =(sal_uInt8)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break;
+ case EscMBFrb: { AktAtr.F.FBFarbe=(sal_uInt8)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break;
+ case EscMInts: { AktAtr.F.FIntens=(sal_uInt8)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break;
+
+ case EscSMstr: { AktAtr.ShdF.FMuster=sal_uInt16(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscSFarb: { AktAtr.ShdL.LFarbe =(sal_uInt8)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break;
+ case EscSBFrb: { AktAtr.ShdL.LBFarbe=(sal_uInt8)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break;
+ case EscSInts: { AktAtr.ShdL.LIntens=(sal_uInt8)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break;
case EscSDist: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); AktAtr.ShdVers.y=AktAtr.ShdVers.x; } break;
case EscSXDst: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); } break;
case EscSYDst: { AktAtr.ShdVers.y=(short)ChgValue(Atr0.ShdVers.y,0,30000,FlgVal,NumVal); } break;
@@ -467,21 +463,21 @@ UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
case EscEbShd: ChgSchnittBit(TextShEbBit,TextSh2DBit,TextSh3DBit,TextSh4DBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
} //endcase
if (TBuf[Index]==Escape) Index++; // zweites Esc weglesen }
- } // if Ende==FALSE
- } while (Ende==FALSE && ScanEsc==FALSE);
- if (Ende==FALSE) c=Escape;
+ } // if Ende==sal_False
+ } while (Ende==sal_False && ScanEsc==sal_False);
+ if (Ende==sal_False) c=Escape;
return c;
} // end of ProcessOne
-UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index,
+UCHAR GetTextChar(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT Rest, BOOL ScanEsc)
+ sal_uInt16 Rest, sal_Bool ScanEsc)
{
UCHAR c,c0,nc;
c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc);
- if (ScanEsc==FALSE) {
+ if (ScanEsc==sal_False) {
if (c==SoftTrennAdd || c==SoftTrennK || c==SoftTrenn) {
nc=GetNextChar(TBuf,Index);
c0=c;
@@ -511,9 +507,9 @@ UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index,
-UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index,
+UCHAR GetTextCharConv(UCHAR* TBuf, sal_uInt16& Index,
ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT Rest, BOOL ScanEsc)
+ sal_uInt16 Rest, sal_Bool ScanEsc)
{
UCHAR c;
@@ -534,23 +530,23 @@ UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index,
//
// Benoetigter Zeilenabstand in SGF-Units. ChrVPos wird beruecksichtigt.
// ======================================================================
-USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktAtr,
- USHORT nChar, USHORT& LF, USHORT& MaxGrad)
+sal_uInt16 GetLineFeed(UCHAR* TBuf, sal_uInt16 Index, ObjTextType Atr0, ObjTextType AktAtr,
+ sal_uInt16 nChar, sal_uInt16& LF, sal_uInt16& MaxGrad)
{
UCHAR c=0;
- BOOL AbsEnd=FALSE;
- ULONG LF100=0;
- ULONG MaxLF100=0;
- BOOL LFauto=0;
- BOOL First=TRUE;
- USHORT Grad;
- USHORT i=0;
- USHORT r=1;
+ sal_Bool AbsEnd=sal_False;
+ sal_uLong LF100=0;
+ sal_uLong MaxLF100=0;
+ sal_Bool LFauto=0;
+ sal_Bool First=sal_True;
+ sal_uInt16 Grad;
+ sal_uInt16 i=0;
+ sal_uInt16 r=1;
MaxGrad=0;
while (!AbsEnd && nChar>0) {
nChar--;
- c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,FALSE);
+ c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,sal_False);
i++;
AbsEnd=(c==TextEnd || c==AbsatzEnd);
if (First || (!AbsEnd && c!=' ' && c!=HardTrenn)) {
@@ -562,15 +558,15 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA
Grad=AktAtr.Grad;
if (AktAtr.ChrVPos>0) Grad=Grad-AktAtr.ChrVPos;
if (Grad>MaxGrad) MaxGrad=Grad;
- First=FALSE;
+ First=sal_False;
}
if (!AbsEnd && c!=' ') r=i;
}
MaxGrad=hPoint2Sgf(MaxGrad);
if (MaxLF100<=4000) { // sonst Overflowgefahr
- LF=USHORT(hPoint2Sgf(short(MaxLF100)) /100);
+ LF=sal_uInt16(hPoint2Sgf(short(MaxLF100)) /100);
} else {
- LF=USHORT(hPoint2Sgf(short(MaxLF100) /100));
+ LF=sal_uInt16(hPoint2Sgf(short(MaxLF100) /100));
}
return r;
@@ -592,17 +588,17 @@ USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktA
#define SuperSubFact 60 /* SuperScript/SubScript: 60% vom Schriftgrad */
#define DefaultSpace 40 /* Default: Space ist 40% vom SchriftGrad */
-USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dreh,
- USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, sal_uInt16 Dreh,
+ sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv)
{
SgfFontOne* pSgfFont; // Font aus dem IniFile
Font aFont;
Color aColor;
- ULONG Grad;
- ULONG Brei;
+ sal_uLong Grad;
+ sal_uLong Brei;
String FNam;
- USHORT StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
- BOOL bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
+ sal_uInt16 StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
+ sal_Bool bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
pSgfFont = pSgfFonts->GetFontDesc(Atr.GetFont());
@@ -621,7 +617,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
switch (Atr.GetFont()) {
case 92500: case 92501: case 92504: case 92505:
{
-#if defined(WIN) || defined(WNT) || defined(PM2)
+#if defined(WNT) || defined(PM2)
FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman
#else
FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times
@@ -630,7 +626,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
aFont.SetFamily(FAMILY_ROMAN);
} break;
case 94021: case 94022: case 94023: case 94024: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial
#else
FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica
@@ -639,7 +635,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
StdBrei=47;
} break;
case 93950: case 93951: case 93952: case 93953: {
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heisst Courier New
#else
FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier
@@ -653,25 +649,25 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
//aFont.SetCharSet(CHARSET_SYSTEM);
}
- Grad=ULONG(Atr.Grad);
- if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*ULONG(Atr.Kapit)/100;
+ Grad=sal_uLong(Atr.Grad);
+ if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*sal_uLong(Atr.Kapit)/100;
if ((Atr.Schnitt & TextSupSBit) !=0 || (Atr.Schnitt & TextSubSBit) !=0) Grad=Grad*SuperSubFact/100;
Brei=Grad;
if (Atr.Breite!=100 || bFit) {
if (bFit) {
- Grad=Grad*ULONG(FitYMul)/ULONG(FitYDiv);
- Brei=Brei*ULONG(FitXMul)/ULONG(FitXDiv);
+ Grad=Grad*sal_uLong(FitYMul)/sal_uLong(FitYDiv);
+ Brei=Brei*sal_uLong(FitXMul)/sal_uLong(FitXDiv);
}
- Brei=Brei*ULONG(Atr.Breite)/100;
- Brei=Brei*ULONG(StdBrei)/100;
- aFont.SetSize(Size(hPoint2Sgf(USHORT(Brei)),hPoint2Sgf(USHORT(Grad))));
+ Brei=Brei*sal_uLong(Atr.Breite)/100;
+ Brei=Brei*sal_uLong(StdBrei)/100;
+ aFont.SetSize(Size(hPoint2Sgf(sal_uInt16(Brei)),hPoint2Sgf(sal_uInt16(Grad))));
} else {
- aFont.SetSize(Size(0,hPoint2Sgf(USHORT(Grad))));
+ aFont.SetSize(Size(0,hPoint2Sgf(sal_uInt16(Grad))));
}
aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor);
aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor);
- aFont.SetTransparent(TRUE);
+ aFont.SetTransparent(sal_True);
aFont.SetAlign(ALIGN_BASELINE);
Dreh/=10; Dreh=3600-Dreh; if (Dreh==3600) Dreh=0;
@@ -683,11 +679,11 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
if ((Atr.Schnitt & TextDbUnBit) !=0) aFont.SetUnderline(UNDERLINE_DOUBLE);
if ((Atr.Schnitt & TextStrkBit) !=0) aFont.SetStrikeout(STRIKEOUT_SINGLE);
if ((Atr.Schnitt & TextDbStBit) !=0) aFont.SetStrikeout(STRIKEOUT_DOUBLE);
- if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(TRUE);
- if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(TRUE);
- if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(TRUE);
+ if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(sal_True);
+ if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(sal_True);
+ if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(sal_True);
if (aFont!=rOut.GetFont()) rOut.SetFont(aFont);
@@ -706,26 +702,26 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr
// Absatz.Pas
struct ProcChrSta {
- USHORT Index;
- USHORT ChrXP;
+ sal_uInt16 Index;
+ sal_uInt16 ChrXP;
UCHAR OutCh;
- BOOL Kapt;
+ sal_Bool Kapt;
ObjTextType Attrib;
};
-void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, USHORT IndexA)
+void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, sal_uInt16 IndexA)
{
State.Attrib=AktAtr;
State.OutCh=0;
State.Index=IndexA;
State.ChrXP=0;
- State.Kapt=FALSE;
+ State.Kapt=sal_False;
}
-BOOL UpcasePossible(UCHAR c)
+sal_Bool UpcasePossible(UCHAR c)
{
- if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return TRUE;
- else return FALSE;
+ if ((c>='a' && c<='z') || c == 0xe4 || c == 0xf6 || c == 0xfc ) return sal_True;
+ else return sal_False;
}
UCHAR Upcase(UCHAR c)
@@ -737,15 +733,15 @@ UCHAR Upcase(UCHAR c)
return c;
}
-USHORT GetCharWidth(OutputDevice& rOut, UCHAR c)
+sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c)
{
UCHAR c1;
- USHORT ChrWidth;
+ sal_uInt16 ChrWidth;
c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() );
if (c==' ')
{
- ChrWidth=(USHORT)rOut.GetTextWidth( String('A') );
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') );
if (rOut.GetFont().GetPitch()!=PITCH_FIXED) {
ChrWidth=MulDiv(ChrWidth,DefaultSpace,100);
}
@@ -755,30 +751,30 @@ USHORT GetCharWidth(OutputDevice& rOut, UCHAR c)
OSL_ENSURE( MaxChar == 255, "MaxChar not 255" );
if (c>=MinChar /*&& c<=MaxChar*/)
{
- ChrWidth=(USHORT)rOut.GetTextWidth(String((char)c1));
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth(String((char)c1));
}
else
{
- ChrWidth=(USHORT)rOut.GetTextWidth(String('A'));
+ ChrWidth=(sal_uInt16)rOut.GetTextWidth(String('A'));
}
}
return ChrWidth;
}
UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& Atr0,
- USHORT& nChars, USHORT Rest,
+ sal_uInt16& nChars, sal_uInt16 Rest,
short* Line, UCHAR* cLine)
{
- USHORT KernDist=0; // Wert fuer Kerning
- USHORT ChrWidth;
+ sal_uInt16 KernDist=0; // Wert fuer Kerning
+ sal_uInt16 ChrWidth;
UCHAR c;
UCHAR c1;
- BOOL AbsEnd;
+ sal_Bool AbsEnd;
- c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,FALSE); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt
+ c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,sal_False); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt
AbsEnd=(c==AbsatzEnd || c==TextEnd);
- if (AbsEnd==FALSE) {
+ if (AbsEnd==sal_False) {
R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ...
R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh);
if (R.Kapt) R.OutCh=Upcase(R.OutCh);
@@ -788,9 +784,9 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
ChrWidth=GetCharWidth(rOut,c1);
if (R.Attrib.ZAbst!=100) { // Spezial-Zeichenabstand ?
- ULONG Temp;
- Temp=ULONG(ChrWidth)*ULONG(R.Attrib.ZAbst)/100;
- ChrWidth=USHORT(Temp);
+ sal_uLong Temp;
+ Temp=sal_uLong(ChrWidth)*sal_uLong(R.Attrib.ZAbst)/100;
+ ChrWidth=sal_uInt16(Temp);
}
nChars++;
if (R.ChrXP>32000) R.ChrXP=32000;
@@ -801,44 +797,44 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
return c;
}
-void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktAtr,
- USHORT UmbWdt, USHORT AdjWdt,
- short* Line, USHORT& nChars,
+void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType& AktAtr,
+ sal_uInt16 UmbWdt, sal_uInt16 AdjWdt,
+ short* Line, sal_uInt16& nChars,
double, double,
- UCHAR* cLine, BOOL TextFit)
+ UCHAR* cLine, sal_Bool TextFit)
{
VirtualDevice vOut;
UCHAR c,c0;
UCHAR ct;
- BOOL First; // erster Char ?
- BYTE Just = 0; // Absatzformatierung
- BOOL Border; // Rand der Box erreicht ?
- BOOL Border0;
- BOOL AbsEnd; // Ende des Absatzes erreicht ?
+ sal_Bool First; // erster Char ?
+ sal_uInt8 Just = 0; // Absatzformatierung
+ sal_Bool Border; // Rand der Box erreicht ?
+ sal_Bool Border0;
+ sal_Bool AbsEnd; // Ende des Absatzes erreicht ?
ProcChrSta* R=new ProcChrSta;
ProcChrSta* R0=new ProcChrSta;
ProcChrSta* WErec=new ProcChrSta;
- USHORT WEnChar;
+ sal_uInt16 WEnChar;
ProcChrSta* WErec0=new ProcChrSta;
- USHORT WEnChar0;
+ sal_uInt16 WEnChar0;
ProcChrSta* TRrec=new ProcChrSta;
- USHORT TRnChar;
+ sal_uInt16 TRnChar;
- USHORT WordEndCnt; // Justieren und Trennen
- BOOL WordEnd;
- BOOL Trenn;
+ sal_uInt16 WordEndCnt; // Justieren und Trennen
+ sal_Bool WordEnd;
+ sal_Bool Trenn;
short BoxRest; // zum Quetschen und formatieren
- USHORT i,j,k,h;
- USHORT re,li;
+ sal_uInt16 i,j,k,h;
+ sal_uInt16 re,li;
vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)));
nChars=0;
- SetTextContext(vOut,AktAtr,FALSE,0,1,1,1,1);
+ SetTextContext(vOut,AktAtr,sal_False,0,1,1,1,1);
InitProcessCharState(*R,AktAtr,Index);
- (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=FALSE;
- Border=FALSE; First=TRUE;
+ (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=sal_False;
+ Border=sal_False; First=sal_True;
WordEndCnt=0;
do { // mal schauen, wieviele Worte so in die Zeile passen
@@ -866,16 +862,16 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
}
(*R0)=(*R); c0=c;
Border0=Border;
- First=FALSE;
+ First=sal_False;
AbsEnd=AbsEnd || (nChars>=MaxLineChars);
} while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn))));
if (Border) { // Trennen und Quetschen
(*WErec0)=(*WErec); WEnChar0=WEnChar;
- AbsEnd=FALSE; c0=0;
+ AbsEnd=sal_False; c0=0;
(*R)=(*WErec); nChars=WEnChar;
(*TRrec)=(*R); TRnChar=nChars;
- Border0=FALSE; Border=FALSE;
+ Border0=sal_False; Border=sal_False;
do { // erst mal gucken wieviele Silben noch reinpassen
ct=ProcessChar(vOut,TBuf,*TRrec,Atr0,TRnChar,DoTrenn,Line,cLine);
c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine);
@@ -922,7 +918,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
if (!AbsEnd) {
do { // Leerzeichen weglesen
(*WErec)=(*R);
- c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE);
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False);
nChars++;
Line[nChars]=R->ChrXP;
cLine[nChars]=c;
@@ -938,7 +934,7 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
nChars++; Line[nChars]=R->ChrXP; // Damit AbsatzEnde auch weggelesen wird
Line[nChars+1]=R->ChrXP; // denn die Breite von CR oder #0 ist nun mal sehr klein
if (TBuf[R->Index-1]!=AbsatzEnd && TBuf[R->Index-1]!=TextEnd) {
- c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); // Kleine Korrektur. Notig, wenn nur 1 Wort in
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,sal_False); // Kleine Korrektur. Notig, wenn nur 1 Wort in
}
}
@@ -1022,8 +1018,8 @@ void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktA
/////////////////////////////////////////////////////////////////////////////////
// DrawText.Pas
-void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, USHORT DrehWink,
- USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, sal_uInt16 DrehWink,
+ sal_uInt16 FitXMul, sal_uInt16 FitXDiv, sal_uInt16 FitYMul, sal_uInt16 FitYDiv)
{
SetTextContext(rOut,T,UpcasePossible(c),DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv);
if ((T.Schnitt & TextKaptBit)!=0 && UpcasePossible(c)) c=Upcase(c);
@@ -1041,32 +1037,32 @@ void TextType::Draw(OutputDevice& rOut)
if ((Flags & TextOutlBit)!=0) return; // Sourcetext fuer Outliner !!
ObjTextType T1,T2;
- USHORT Index1;
- USHORT Index2;
+ sal_uInt16 Index1;
+ sal_uInt16 Index2;
UCHAR c = TextEnd;
- USHORT l; // Anzahl der Zeichen in der Zeile
- USHORT i;
+ sal_uInt16 l; // Anzahl der Zeichen in der Zeile
+ sal_uInt16 i;
short yPos0;
short xPos;
short yPos;
- USHORT LF;
- USHORT MaxGrad;
+ sal_uInt16 LF;
+ sal_uInt16 MaxGrad;
short xSize;
short xSAdj;
short ySize;
double sn,cs;
- USHORT TopToBase;
- BOOL Ende = 0;
- USHORT lc;
- BOOL LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen
- BOOL TextFit;
+ sal_uInt16 TopToBase;
+ sal_Bool Ende = 0;
+ sal_uInt16 lc;
+ sal_Bool LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen
+ sal_Bool TextFit;
short* xLine;
UCHAR* cLine; // Buffer fuer FormatLine
- USHORT FitXMul;
- USHORT FitXDiv;
- USHORT FitYMul;
- USHORT FitYDiv;
- BOOL Fehler;
+ sal_uInt16 FitXMul;
+ sal_uInt16 FitXDiv;
+ sal_uInt16 FitYMul;
+ sal_uInt16 FitYDiv;
+ sal_Bool Fehler;
UCHAR* Buf=Buffer; // Zeiger auf die Buchstaben
pSgfFonts->ReadList();
@@ -1074,9 +1070,9 @@ void TextType::Draw(OutputDevice& rOut)
cLine=new UCHAR[CharLineSize];
TextFit=(Flags & TextFitBits)!=0;
- LineFit=FALSE;
+ LineFit=sal_False;
LineFit=((Flags & TextFitZBit)!=0);
- if (TextFit && FitSize.x==0) LineFit=TRUE;
+ if (TextFit && FitSize.x==0) LineFit=sal_True;
if (DrehWink==0) {
sn=0.0;
@@ -1091,9 +1087,9 @@ void TextType::Draw(OutputDevice& rOut)
ySize=Pos2.y-Pos1.y;
xSize=32000 /2; // Umbruch
xSAdj=Pos2.x-Pos1.x; // zum Ausrichten bei Zentriert/Blocksatz
- //if (xSize<=0) { xSize=32000 /2; LineFit=TRUE; }
- FitXMul=sal::static_int_cast< USHORT >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
- FitYMul=sal::static_int_cast< USHORT >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
+ //if (xSize<=0) { xSize=32000 /2; LineFit=sal_True; }
+ FitXMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.x-Pos1.x)); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
+ FitYMul=sal::static_int_cast< sal_uInt16 >(abs(Pos2.y-Pos1.y)); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
} else {
xSize=Pos2.x-Pos1.x;
xSAdj=xSize;
@@ -1132,7 +1128,7 @@ void TextType::Draw(OutputDevice& rOut)
T2=T1; Index2=Index1;
i=1;
while (i<=l) {
- c=GetTextCharConv(Buf,Index2,T,T2,l-i,FALSE);
+ c=GetTextCharConv(Buf,Index2,T,T2,l-i,sal_False);
long xp1,yp1; // wegen Overflowgefahr
PointType Pos;
xp1=long(Pos1.x)+xPos+long(xLine[i]);
@@ -1164,27 +1160,27 @@ void TextType::Draw(OutputDevice& rOut)
// (DEC Alpha hat naemlich 64Bit-Pointer!)
//UCHAR* TextType::GetBufPtr()
//{
-// ULONG Temp;
-// Temp=ULONG(BufLo)+0x00010000*ULONG(BufHi);
+// sal_uLong Temp;
+// Temp=sal_uLong(BufLo)+0x00010000*sal_uLong(BufHi);
// return (UCHAR*)Temp;
//}
//
//void TextType::SetBufPtr(UCHAR* Ptr)
//{
-// ULONG Temp=(ULONG)Ptr;
-// BufLo=USHORT(Temp & 0x0000FFFF);
-// BufHi=USHORT((Temp & 0xFFFF0000)>>16);
+// sal_uLong Temp=(sal_uLong)Ptr;
+// BufLo=sal_uInt16(Temp & 0x0000FFFF);
+// BufHi=sal_uInt16((Temp & 0xFFFF0000)>>16);
//}
-UINT32 ObjTextType::GetFont()
+sal_uInt32 ObjTextType::GetFont()
{
- return ULONG(FontLo)+0x00010000*ULONG(FontHi);
+ return sal_uLong(FontLo)+0x00010000*sal_uLong(FontHi);
}
-void ObjTextType::SetFont(UINT32 FontID)
+void ObjTextType::SetFont(sal_uInt32 FontID)
{
- FontLo=USHORT(FontID & 0x0000FFFF);
- FontHi=USHORT((FontID & 0xFFFF0000)>>16);
+ FontLo=sal_uInt16(FontID & 0x0000FFFF);
+ FontHi=sal_uInt16((FontID & 0xFFFF0000)>>16);
}
@@ -1195,11 +1191,11 @@ SgfFontOne::SgfFontOne()
{
Next=NULL;
IFID=0;
- Bold=FALSE;
- Ital=FALSE;
- Sans=FALSE;
- Serf=FALSE;
- Fixd=FALSE;
+ Bold=sal_False;
+ Ital=sal_False;
+ Sans=sal_False;
+ Serf=sal_False;
+ Fixd=sal_False;
SVFamil=FAMILY_DONTKNOW;
SVChSet=RTL_TEXTENCODING_DONTKNOW;
SVWidth=40;
@@ -1207,7 +1203,7 @@ SgfFontOne::SgfFontOne()
void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
{
- USHORT i,j,n;
+ sal_uInt16 i,j,n;
ByteString s;
if ( Dsc.Len() < 4 || ( Dsc.GetChar( 0 ) != '(' ) )
@@ -1229,7 +1225,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen
Dsc.Erase(i,j);
- IFID = (UINT32)ID.ToInt32();
+ IFID = (sal_uInt32)ID.ToInt32();
n=Dsc.GetTokenCount(' ');
for (i=0;i<n;i++)
{
@@ -1237,11 +1233,11 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
if ( s.Len() )
{
s.ToUpperAscii();
- if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=TRUE;
- else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=TRUE;
- else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=TRUE;
- else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=TRUE;
- else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=TRUE;
+ if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=sal_True;
+ else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=sal_True;
+ else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=sal_True;
+ else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=sal_True;
+ else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=sal_True;
else if ( s.CompareTo( "ROMAN", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_ROMAN;
else if ( s.CompareTo( "SWISS", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SWISS;
else if ( s.CompareTo( "MODERN", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_MODERN;
@@ -1252,7 +1248,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN;
else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL;
else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding();
- else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< USHORT >(s.ToInt32());
+ else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32());
}
}
}
@@ -1265,7 +1261,7 @@ SgfFontLst::SgfFontLst()
Last=NULL;
LastID=0;
LastLn=NULL;
- Tried=FALSE;
+ Tried=sal_False;
}
SgfFontLst::~SgfFontLst()
@@ -1285,7 +1281,7 @@ void SgfFontLst::RausList()
}
pList=NULL;
Last=NULL;
- Tried=FALSE;
+ Tried=sal_False;
LastID=0;
LastLn=NULL;
}
@@ -1296,14 +1292,14 @@ void SgfFontLst::AssignFN(const String& rFName)
void SgfFontLst::ReadList()
{
if (!Tried) {
- Tried=TRUE;
+ Tried=sal_True;
LastID=0;
LastLn=NULL;
SgfFontOne* P,P1;
Config aCfg(FNam);
aCfg.SetGroup("SGV Fonts fuer StarView");
- USHORT Anz=aCfg.GetKeyCount();
- USHORT i;
+ sal_uInt16 Anz=aCfg.GetKeyCount();
+ sal_uInt16 i;
ByteString FID,Dsc;
for (i=0;i<Anz;i++)
@@ -1321,7 +1317,7 @@ void SgfFontLst::ReadList()
}
}
-SgfFontOne* SgfFontLst::GetFontDesc(UINT32 ID)
+SgfFontOne* SgfFontLst::GetFontDesc(sal_uInt32 ID)
{
if (ID!=LastID) {
SgfFontOne* P;
diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc
deleted file mode 100644
index 0eea67fb2338..000000000000
--- a/svtools/source/filter.vcl/filter/strings.hrc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svtools/svtools.hrc>
diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src
deleted file mode 100644
index 3087a70f1316..000000000000
--- a/svtools/source/filter.vcl/filter/strings.src
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "strings.hrc"
-
-String EXPORT_DIALOG_TITLE
-{
- Text [ en-US ] = " Options" ;
-};
-
-String KEY_MODE
-{
- Text = "ExportMode" ;
-};
-
-String KEY_RES
-{
- Text = "Resolution" ;
-};
-
-String KEY_SIZE
-{
- Text = "Size" ;
-};
-
-String KEY_COLORS
-{
- Text = "Color" ;
-};
-
-String KEY_RLE_CODING
-{
- Text = "RLE_Coding" ;
-};
diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter.vcl/igif/decode.cxx
index d40cfab7cc50..03a69414cd4b 100644
--- a/svtools/source/filter.vcl/igif/decode.cxx
+++ b/svtools/source/filter.vcl/igif/decode.cxx
@@ -37,19 +37,19 @@ struct GIFLZWTableEntry
{
GIFLZWTableEntry* pPrev;
GIFLZWTableEntry* pFirst;
- BYTE nData;
+ sal_uInt8 nData;
};
// ------------------------------------------------------------------------
-GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) :
+GIFLZWDecompressor::GIFLZWDecompressor( sal_uInt8 cDataSize ) :
nInputBitsBuf ( 0 ),
nOutBufDataLen ( 0 ),
nInputBitsBufSize ( 0 ),
- bEOIFound ( FALSE ),
+ bEOIFound ( sal_False ),
nDataSize ( cDataSize )
{
- pOutBuf = new BYTE[ 4096 ];
+ pOutBuf = new sal_uInt8[ 4096 ];
nClearCode = 1 << nDataSize;
nEOICode = nClearCode + 1;
@@ -60,11 +60,11 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) :
pTable = new GIFLZWTableEntry[ 4098 ];
- for( USHORT i = 0; i < nTableSize; i++ )
+ for( sal_uInt16 i = 0; i < nTableSize; i++ )
{
pTable[i].pPrev = NULL;
pTable[i].pFirst = pTable + i;
- pTable[i].nData = (BYTE) i;
+ pTable[i].nData = (sal_uInt8) i;
}
}
@@ -78,11 +78,11 @@ GIFLZWDecompressor::~GIFLZWDecompressor()
// ------------------------------------------------------------------------
-HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
- ULONG& rCount, BOOL& rEOI )
+HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
+ sal_uLong& rCount, sal_Bool& rEOI )
{
- ULONG nTargetSize = 4096;
- ULONG nCount = 0;
+ sal_uLong nTargetSize = 4096;
+ sal_uLong nCount = 0;
HPBYTE pTarget = (HPBYTE) rtl_allocateMemory( nTargetSize );
HPBYTE pTmpTarget = pTarget;
@@ -96,8 +96,8 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
if( nCount > nTargetSize )
{
- ULONG nNewSize = nTargetSize << 1;
- ULONG nOffset = pTmpTarget - pTarget;
+ sal_uLong nNewSize = nTargetSize << 1;
+ sal_uLong nOffset = pTmpTarget - pTarget;
HPBYTE pTmp = (HPBYTE) rtl_allocateMemory( nNewSize );
memcpy( pTmp, pTarget, nTargetSize );
@@ -124,7 +124,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
// ------------------------------------------------------------------------
-void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData )
+void GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData )
{
GIFLZWTableEntry* pE;
@@ -136,37 +136,37 @@ void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData )
pE->nData = pTable[ nCodeFirstData ].pFirst->nData;
nTableSize++;
- if ( ( nTableSize == (USHORT) (1 << nCodeSize) ) && ( nTableSize < 4096 ) )
+ if ( ( nTableSize == (sal_uInt16) (1 << nCodeSize) ) && ( nTableSize < 4096 ) )
nCodeSize++;
}
}
// ------------------------------------------------------------------------
-BOOL GIFLZWDecompressor::ProcessOneCode()
+sal_Bool GIFLZWDecompressor::ProcessOneCode()
{
GIFLZWTableEntry* pE;
- USHORT nCode;
- BOOL bRet = FALSE;
- BOOL bEndOfBlock = FALSE;
+ sal_uInt16 nCode;
+ sal_Bool bRet = sal_False;
+ sal_Bool bEndOfBlock = sal_False;
while( nInputBitsBufSize < nCodeSize )
{
if( nBlockBufPos >= nBlockBufSize )
{
- bEndOfBlock = TRUE;
+ bEndOfBlock = sal_True;
break;
}
- nInputBitsBuf |= ( (ULONG) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize;
+ nInputBitsBuf |= ( (sal_uLong) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize;
nInputBitsBufSize += 8;
}
if ( !bEndOfBlock )
{
// Einen Code aus dem Eingabe-Buffer holen:
- nCode = sal::static_int_cast< USHORT >(
- ( (USHORT) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) ));
+ nCode = sal::static_int_cast< sal_uInt16 >(
+ ( (sal_uInt16) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) ));
nInputBitsBuf >>= nCodeSize;
nInputBitsBufSize = nInputBitsBufSize - nCodeSize;
@@ -192,9 +192,9 @@ BOOL GIFLZWDecompressor::ProcessOneCode()
nOutBufDataLen = 0;
}
else
- bEOIFound = TRUE;
+ bEOIFound = sal_True;
- return TRUE;
+ return sal_True;
}
nOldCode = nCode;
@@ -209,7 +209,7 @@ BOOL GIFLZWDecompressor::ProcessOneCode()
}
while( pE );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
diff --git a/svtools/source/filter.vcl/igif/decode.hxx b/svtools/source/filter.vcl/igif/decode.hxx
index 5bce26b724f1..3dd6328839d9 100644
--- a/svtools/source/filter.vcl/igif/decode.hxx
+++ b/svtools/source/filter.vcl/igif/decode.hxx
@@ -39,29 +39,29 @@ class GIFLZWDecompressor
HPBYTE pOutBuf;
HPBYTE pOutBufData;
HPBYTE pBlockBuf;
- ULONG nInputBitsBuf;
- USHORT nTableSize;
- USHORT nClearCode;
- USHORT nEOICode;
- USHORT nCodeSize;
- USHORT nOldCode;
- USHORT nOutBufDataLen;
- USHORT nInputBitsBufSize;
- BOOL bEOIFound;
- BYTE nDataSize;
- BYTE nBlockBufSize;
- BYTE nBlockBufPos;
+ sal_uLong nInputBitsBuf;
+ sal_uInt16 nTableSize;
+ sal_uInt16 nClearCode;
+ sal_uInt16 nEOICode;
+ sal_uInt16 nCodeSize;
+ sal_uInt16 nOldCode;
+ sal_uInt16 nOutBufDataLen;
+ sal_uInt16 nInputBitsBufSize;
+ sal_Bool bEOIFound;
+ sal_uInt8 nDataSize;
+ sal_uInt8 nBlockBufSize;
+ sal_uInt8 nBlockBufPos;
- void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData);
- BOOL ProcessOneCode();
+ void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData);
+ sal_Bool ProcessOneCode();
public:
- GIFLZWDecompressor( BYTE cDataSize );
+ GIFLZWDecompressor( sal_uInt8 cDataSize );
~GIFLZWDecompressor();
- HPBYTE DecompressBlock( HPBYTE pSrc, BYTE cBufSize, ULONG& rCount, BOOL& rEOI );
+ HPBYTE DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, sal_Bool& rEOI );
};
#endif
diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter.vcl/igif/gifread.cxx
index 62d1413e145f..8de8c6c01148 100644
--- a/svtools/source/filter.vcl/igif/gifread.cxx
+++ b/svtools/source/filter.vcl/igif/gifread.cxx
@@ -55,11 +55,11 @@ GIFReader::GIFReader( SvStream& rStm ) :
nLogHeight100 ( 0UL ),
nLoops ( 1 ),
eActAction ( GLOBAL_HEADER_READING ),
- bGCTransparent ( FALSE ),
- bImGraphicReady ( FALSE )
+ bGCTransparent ( sal_False ),
+ bImGraphicReady ( sal_False )
{
maUpperName = UniString::CreateFromAscii( "SVIGIF", 6 );
- pSrcBuf = new BYTE[ 256 ];
+ pSrcBuf = new sal_uInt8[ 256 ];
ClearImageExtensions();
}
@@ -83,14 +83,14 @@ GIFReader::~GIFReader()
void GIFReader::ClearImageExtensions()
{
nGCDisposalMethod = 0;
- bGCTransparent = FALSE;
+ bGCTransparent = sal_False;
nTimer = 0;
}
// ------------------------------------------------------------------------
-BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
- BOOL bWatchForBackgroundColor )
+sal_Bool GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
+ sal_Bool bWatchForBackgroundColor )
{
const Size aSize( nWidth, nHeight );
@@ -107,11 +107,11 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
if( pAcc1 )
{
- cTransIndex1 = (BYTE) pAcc1->GetBestPaletteIndex( aWhite );
+ cTransIndex1 = (sal_uInt8) pAcc1->GetBestPaletteIndex( aWhite );
cNonTransIndex1 = cTransIndex1 ? 0 : 1;
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
if( bStatus )
@@ -132,12 +132,12 @@ BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadGlobalHeader()
+sal_Bool GIFReader::ReadGlobalHeader()
{
char pBuf[ 7 ];
- BYTE nRF;
- BYTE nAspect;
- BOOL bRet = FALSE;
+ sal_uInt8 nRF;
+ sal_uInt8 nAspect;
+ sal_Bool bRet = sal_False;
rIStm.Read( pBuf, 6 );
if( NO_PENDING( rIStm ) )
@@ -150,14 +150,14 @@ BOOL GIFReader::ReadGlobalHeader()
{
SvMemoryStream aMemStm;
- aMemStm.SetBuffer( pBuf, 7, FALSE, 7 );
+ aMemStm.SetBuffer( pBuf, 7, sal_False, 7 );
aMemStm >> nGlobalWidth;
aMemStm >> nGlobalHeight;
aMemStm >> nRF;
aMemStm >> nBackgroundColor;
aMemStm >> nAspect;
- bGlobalPalette = (BOOL) ( nRF & 0x80 );
+ bGlobalPalette = (sal_Bool) ( nRF & 0x80 );
if( bGlobalPalette )
ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) );
@@ -165,11 +165,11 @@ BOOL GIFReader::ReadGlobalHeader()
nBackgroundColor = 0;
if( NO_PENDING( rIStm ) )
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
return bRet;
@@ -177,19 +177,19 @@ BOOL GIFReader::ReadGlobalHeader()
// ------------------------------------------------------------------------
-void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount )
+void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount )
{
- const ULONG nLen = 3UL * nCount;
- BYTE* pBuf = new BYTE[ nLen ];
+ const sal_uLong nLen = 3UL * nCount;
+ sal_uInt8* pBuf = new sal_uInt8[ nLen ];
rIStm.Read( pBuf, nLen );
if( NO_PENDING( rIStm ) )
{
- BYTE* pTmp = pBuf;
+ sal_uInt8* pTmp = pBuf;
- for( ULONG i = 0UL; i < nCount; )
+ for( sal_uLong i = 0UL; i < nCount; )
{
- BitmapColor& rColor = (*pPal)[ (USHORT) i++ ];
+ BitmapColor& rColor = (*pPal)[ (sal_uInt16) i++ ];
rColor.SetRed( *pTmp++ );
rColor.SetGreen( *pTmp++ );
@@ -211,13 +211,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount )
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadExtension()
+sal_Bool GIFReader::ReadExtension()
{
- BYTE cFunction;
- BYTE cSize;
- BYTE cByte;
- BOOL bRet = FALSE;
- BOOL bOverreadDataBlocks = FALSE;
+ sal_uInt8 cFunction;
+ sal_uInt8 cSize;
+ sal_uInt8 cByte;
+ sal_Bool bRet = sal_False;
+ sal_Bool bOverreadDataBlocks = sal_False;
// Extension-Label
rIStm >> cFunction;
@@ -231,7 +231,7 @@ BOOL GIFReader::ReadExtension()
// 'Graphic Control Extension'
case( 0xf9 ) :
{
- BYTE cFlags;
+ sal_uInt8 cFlags;
rIStm >> cFlags;
rIStm >> nTimer;
@@ -241,9 +241,9 @@ BOOL GIFReader::ReadExtension()
if ( NO_PENDING( rIStm ) )
{
nGCDisposalMethod = ( cFlags >> 2) & 7;
- bGCTransparent = ( cFlags & 1 ) ? TRUE : FALSE;
+ bGCTransparent = ( cFlags & 1 ) ? sal_True : sal_False;
bStatus = ( cSize == 4 ) && ( cByte == 0 );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -254,7 +254,7 @@ BOOL GIFReader::ReadExtension()
if ( NO_PENDING( rIStm ) )
{
// default diese Extension ueberlesen
- bOverreadDataBlocks = TRUE;
+ bOverreadDataBlocks = sal_True;
// Appl.-Extension hat Laenge 11
if ( cSize == 0x0b )
@@ -277,12 +277,12 @@ BOOL GIFReader::ReadExtension()
rIStm >> cByte;
nLoops = cByte;
rIStm >> cByte;
- nLoops |= ( (USHORT) cByte << 8 );
+ nLoops |= ( (sal_uInt16) cByte << 8 );
rIStm >> cByte;
bStatus = ( cByte == 0 );
bRet = NO_PENDING( rIStm );
- bOverreadDataBlocks = FALSE;
+ bOverreadDataBlocks = sal_False;
// Netscape interpretiert den LoopCount
// als reine Anzahl der _Wiederholungen_;
@@ -305,7 +305,7 @@ BOOL GIFReader::ReadExtension()
rIStm >> cByte;
bStatus = ( cByte == 0 );
bRet = NO_PENDING( rIStm );
- bOverreadDataBlocks = FALSE;
+ bOverreadDataBlocks = sal_False;
}
else
rIStm.SeekRel( -1 );
@@ -318,25 +318,25 @@ BOOL GIFReader::ReadExtension()
// alles andere ueberlesen
default:
- bOverreadDataBlocks = TRUE;
+ bOverreadDataBlocks = sal_True;
break;
}
// Sub-Blocks ueberlesen
if ( bOverreadDataBlocks )
{
- bRet = TRUE;
+ bRet = sal_True;
while( cSize && bStatus && !rIStm.IsEof() )
{
- USHORT nCount = (USHORT) cSize + 1;
+ sal_uInt16 nCount = (sal_uInt16) cSize + 1;
char* pBuffer = new char[ nCount ];
- bRet = FALSE;
+ bRet = sal_False;
rIStm.Read( pBuffer, nCount );
if( NO_PENDING( rIStm ) )
{
- cSize = (BYTE) pBuffer[ cSize ];
- bRet = TRUE;
+ cSize = (sal_uInt8) pBuffer[ cSize ];
+ bRet = sal_True;
}
else
cSize = 0;
@@ -351,19 +351,19 @@ BOOL GIFReader::ReadExtension()
// ------------------------------------------------------------------------
-BOOL GIFReader::ReadLocalHeader()
+sal_Bool GIFReader::ReadLocalHeader()
{
- BYTE pBuf[ 9 ];
- BOOL bRet = FALSE;
+ sal_uInt8 pBuf[ 9 ];
+ sal_Bool bRet = sal_False;
rIStm.Read( pBuf, 9 );
if( NO_PENDING( rIStm ) )
{
SvMemoryStream aMemStm;
BitmapPalette* pPal;
- BYTE nFlags;
+ sal_uInt8 nFlags;
- aMemStm.SetBuffer( (char*) pBuf, 9, FALSE, 9 );
+ aMemStm.SetBuffer( (char*) pBuf, 9, sal_False, 9 );
aMemStm >> nImagePosX;
aMemStm >> nImagePosY;
aMemStm >> nImageWidth;
@@ -391,7 +391,7 @@ BOOL GIFReader::ReadLocalHeader()
if( NO_PENDING( rIStm ) )
{
CreateBitmaps( nImageWidth, nImageHeight, pPal, bGlobalPalette && ( pPal == &aGPalette ) );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -400,11 +400,11 @@ BOOL GIFReader::ReadLocalHeader()
// ------------------------------------------------------------------------
-ULONG GIFReader::ReadNextBlock()
+sal_uLong GIFReader::ReadNextBlock()
{
- ULONG nRet = 0UL;
- ULONG nRead;
- BYTE cBlockSize;
+ sal_uLong nRet = 0UL;
+ sal_uLong nRead;
+ sal_uInt8 cBlockSize;
rIStm >> cBlockSize;
@@ -424,7 +424,7 @@ ULONG GIFReader::ReadNextBlock()
nRet = 3UL;
else
{
- BOOL bEOI;
+ sal_Bool bEOI;
HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
nRet = ( bEOI ? 3 : 1 );
@@ -443,9 +443,9 @@ ULONG GIFReader::ReadNextBlock()
// ------------------------------------------------------------------------
-void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
+void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
{
- for( ULONG i = 0UL; i < nCount; i++ )
+ for( sal_uLong i = 0UL; i < nCount; i++ )
{
if( nImageX >= nImageWidth )
{
@@ -464,9 +464,9 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) )
{
HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc );
- ULONG nSize8 = pAcc8->GetScanlineSize();
+ sal_uLong nSize8 = pAcc8->GetScanlineSize();
HPBYTE pScanline1 = 0;
- ULONG nSize1 = 0;
+ sal_uLong nSize1 = 0;
if( bGCTransparent )
{
@@ -508,7 +508,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
}
}
- nLastImageY = (USHORT) nT1;
+ nLastImageY = (sal_uInt16) nT1;
nYAcc = nT1;
}
else
@@ -523,7 +523,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
if( nImageY < nImageHeight )
{
- const BYTE cTmp = pBytes[ i ];
+ const sal_uInt8 cTmp = pBytes[ i ];
if( bGCTransparent )
{
@@ -540,7 +540,7 @@ void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
}
else
{
- bOverreadBlock = TRUE;
+ bOverreadBlock = sal_True;
break;
}
}
@@ -567,7 +567,7 @@ void GIFReader::CreateNewBitmaps()
aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY );
aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight );
aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK;
- aAnimBmp.bUserInput = FALSE;
+ aAnimBmp.bUserInput = sal_False;
if( nGCDisposalMethod == 2 )
aAnimBmp.eDisposal = DISPOSE_BACK;
@@ -618,10 +618,10 @@ const Graphic& GIFReader::GetIntermediateGraphic()
// ------------------------------------------------------------------------
-BOOL GIFReader::ProcessGIF()
+sal_Bool GIFReader::ProcessGIF()
{
- BOOL bRead = FALSE;
- BOOL bEnd = FALSE;
+ sal_Bool bRead = sal_False;
+ sal_Bool bEnd = sal_False;
if ( !bStatus )
eActAction = ABORT_READING;
@@ -634,7 +634,7 @@ BOOL GIFReader::ProcessGIF()
// naechsten Marker lesen
case( MARKER_READING ):
{
- BYTE cByte;
+ sal_uInt8 cByte;
rIStm >> cByte;
@@ -642,7 +642,7 @@ BOOL GIFReader::ProcessGIF()
eActAction = END_READING;
else if( NO_PENDING( rIStm ) )
{
- bRead = TRUE;
+ bRead = sal_True;
if( cByte == '!' )
eActAction = EXTENSION_READING;
@@ -659,7 +659,7 @@ BOOL GIFReader::ProcessGIF()
// ScreenDescriptor lesen
case( GLOBAL_HEADER_READING ):
{
- if( ( bRead = ReadGlobalHeader() ) == TRUE )
+ if( ( bRead = ReadGlobalHeader() ) == sal_True )
{
ClearImageExtensions();
eActAction = MARKER_READING;
@@ -671,7 +671,7 @@ BOOL GIFReader::ProcessGIF()
// Extension lesen
case( EXTENSION_READING ):
{
- if( ( bRead = ReadExtension() ) == TRUE )
+ if( ( bRead = ReadExtension() ) == sal_True )
eActAction = MARKER_READING;
}
break;
@@ -680,7 +680,7 @@ BOOL GIFReader::ProcessGIF()
// Image-Descriptor lesen
case( LOCAL_HEADER_READING ):
{
- if( ( bRead = ReadLocalHeader() ) == TRUE )
+ if( ( bRead = ReadLocalHeader() ) == sal_True )
{
nYAcc = nImageX = nImageY = 0;
eActAction = FIRST_BLOCK_READING;
@@ -692,20 +692,20 @@ BOOL GIFReader::ProcessGIF()
// ersten Datenblock lesen
case( FIRST_BLOCK_READING ):
{
- BYTE cDataSize;
+ sal_uInt8 cDataSize;
rIStm >> cDataSize;
if( rIStm.IsEof() )
eActAction = ABORT_READING;
else if( cDataSize > 12 )
- bStatus = FALSE;
+ bStatus = sal_False;
else if( NO_PENDING( rIStm ) )
{
- bRead = TRUE;
+ bRead = sal_True;
pDecomp = new GIFLZWDecompressor( cDataSize );
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = FALSE;
+ bOverreadBlock = sal_False;
}
else
eActAction = FIRST_BLOCK_READING;
@@ -715,20 +715,20 @@ BOOL GIFReader::ProcessGIF()
// naechsten Datenblock lesen
case( NEXT_BLOCK_READING ):
{
- USHORT nLastX = nImageX;
- USHORT nLastY = nImageY;
- ULONG nRet = ReadNextBlock();
+ sal_uInt16 nLastX = nImageX;
+ sal_uInt16 nLastY = nImageY;
+ sal_uLong nRet = ReadNextBlock();
// Return: 0:Pending / 1:OK; / 2:OK und letzter Block: / 3:EOI / 4:HardAbort
if( nRet )
{
- bRead = TRUE;
+ bRead = sal_True;
if ( nRet == 1UL )
{
- bImGraphicReady = TRUE;
+ bImGraphicReady = sal_True;
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = FALSE;
+ bOverreadBlock = sal_False;
}
else
{
@@ -742,7 +742,7 @@ BOOL GIFReader::ProcessGIF()
else if( nRet == 3UL )
{
eActAction = NEXT_BLOCK_READING;
- bOverreadBlock = TRUE;
+ bOverreadBlock = sal_True;
}
else
{
@@ -764,7 +764,7 @@ BOOL GIFReader::ProcessGIF()
// ein Fehler trat auf
case( ABORT_READING ):
{
- bEnd = TRUE;
+ bEnd = sal_True;
eActAction = END_READING;
}
break;
@@ -788,7 +788,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
{
ReadState eReadState;
- bStatus = TRUE;
+ bStatus = sal_True;
while( ProcessGIF() && ( eActAction != END_READING ) ) {}
@@ -825,12 +825,12 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
// - ImportGIF -
// -------------
-BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic )
+sal_Bool ImportGIF( SvStream & rStm, Graphic& rGraphic )
{
GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext();
- USHORT nOldFormat = rStm.GetNumberFormatInt();
+ sal_uInt16 nOldFormat = rStm.GetNumberFormatInt();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -842,7 +842,7 @@ BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic )
if( eReadState == GIFREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pGIFReader;
}
else if( eReadState == GIFREAD_OK )
diff --git a/svtools/source/filter.vcl/igif/makefile.mk b/svtools/source/filter.vcl/igif/makefile.mk
deleted file mode 100644
index 0821591e0178..000000000000
--- a/svtools/source/filter.vcl/igif/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=igif
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/gifread.obj \
- $(SLO)$/decode.obj
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/filter.vcl/ixbm/xbmread.cxx b/svtools/source/filter.vcl/ixbm/xbmread.cxx
index 6adb1e4a621b..0870eecb7187 100644
--- a/svtools/source/filter.vcl/ixbm/xbmread.cxx
+++ b/svtools/source/filter.vcl/ixbm/xbmread.cxx
@@ -45,7 +45,7 @@ XBMReader::XBMReader( SvStream& rStm ) :
nLastPos ( rStm.Tell() ),
nWidth ( 0 ),
nHeight ( 0 ),
- bStatus ( TRUE )
+ bStatus ( sal_True )
{
pHexTable = new short[ 256 ];
maUpperName = String::CreateFromAscii( "SVIXBM", 6 );
@@ -110,7 +110,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
long nPos2;
long nPos3;
- bStatus = FALSE;
+ bStatus = sal_False;
do
{
@@ -121,23 +121,23 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
{
if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
{
- bStatus = TRUE;
+ bStatus = sal_True;
if( pTok2 )
{
- bStatus = FALSE;
+ bStatus = sal_False;
if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
( nPos2 > nPos1 ) )
{
- bStatus = TRUE;
+ bStatus = sal_True;
if( pTok3 )
{
- bStatus = FALSE;
+ bStatus = sal_False;
if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
- bStatus = TRUE;
+ bStatus = sal_True;
}
}
}
@@ -200,16 +200,16 @@ long XBMReader::ParseDefine( const sal_Char* pDefine )
// ------------------------------------------------------------------------
-BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
+sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
{
ByteString aLine;
long nRow = 0;
long nCol = 0;
long nBits = ( eFormat == XBM10 ) ? 16 : 8;
long nBit;
- USHORT nValue;
- USHORT nDigits;
- BOOL bFirstLine = TRUE;
+ sal_uInt16 nValue;
+ sal_uInt16 nDigits;
+ sal_Bool bFirstLine = sal_True;
while( nRow < nHeight )
{
@@ -221,20 +221,20 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
aLine.Erase( 0, nPos + 1 );
- bFirstLine = FALSE;
+ bFirstLine = sal_False;
}
else if( !pInStm->ReadLine( aLine ) )
break;
if( aLine.Len() )
{
- const USHORT nCount = aLine.GetTokenCount( ',' );
+ const sal_uInt16 nCount = aLine.GetTokenCount( ',' );
- for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
+ for( sal_uInt16 i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
{
const ByteString aToken( aLine.GetToken( i, ',' ) );
const xub_StrLen nLen = aToken.Len();
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
nBit = nDigits = nValue = 0;
@@ -247,11 +247,11 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
{
nValue = ( nValue << 4 ) + nTable;
nDigits++;
- bProcessed = TRUE;
+ bProcessed = sal_True;
}
else if( ( nTable < 0 ) && nDigits )
{
- bProcessed = TRUE;
+ bProcessed = sal_True;
break;
}
}
@@ -268,7 +268,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
}
}
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -276,7 +276,7 @@ BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFor
ReadState XBMReader::ReadXBM( Graphic& rGraphic )
{
ReadState eReadState;
- BYTE cDummy;
+ sal_uInt8 cDummy;
// sehen, ob wir _alles_ lesen koennen
rIStm.Seek( STREAM_SEEK_TO_END );
@@ -289,7 +289,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
ByteString aLine;
rIStm.Seek( nLastPos );
- bStatus = FALSE;
+ bStatus = sal_False;
aLine = FindTokenLine( &rIStm, "#define", "_width" );
if ( bStatus )
@@ -309,7 +309,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
}
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
if ( bStatus )
{
@@ -327,7 +327,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
else if ( aLine.Search( "char" ) != STRING_NOTFOUND )
eFormat = XBM11;
else
- bStatus = FALSE;
+ bStatus = sal_False;
if ( bStatus && nWidth && nHeight )
{
@@ -341,7 +341,7 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
bStatus = ParseData( &rIStm, aLine, eFormat );
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
}
@@ -373,11 +373,11 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
// - ImportXBM -
// -------------
-BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic )
+sal_Bool ImportXBM( SvStream& rStm, Graphic& rGraphic )
{
XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pXBMReader )
pXBMReader = new XBMReader( rStm );
@@ -387,7 +387,7 @@ BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic )
if( eReadState == XBMREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pXBMReader;
}
else if( eReadState == XBMREAD_OK )
diff --git a/svtools/source/filter.vcl/ixpm/makefile.mk b/svtools/source/filter.vcl/ixpm/makefile.mk
deleted file mode 100644
index 98f93290d325..000000000000
--- a/svtools/source/filter.vcl/ixpm/makefile.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=ixpm
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/xpmread.obj
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/ixpm/rgbtable.hxx b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
index f3506a1d0465..738c3f33460c 100644
--- a/svtools/source/filter.vcl/ixpm/rgbtable.hxx
+++ b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
@@ -29,9 +29,9 @@
struct XPMRGBTab
{
const char* name;
- BYTE red;
- BYTE green;
- BYTE blue;
+ sal_uInt8 red;
+ sal_uInt8 green;
+ sal_uInt8 blue;
};
static XPMRGBTab pRGBTable[] = {
diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter.vcl/ixpm/xpmread.cxx
index e0bbad0f0ceb..c218cff1630f 100644
--- a/svtools/source/filter.vcl/ixpm/xpmread.cxx
+++ b/svtools/source/filter.vcl/ixpm/xpmread.cxx
@@ -48,8 +48,8 @@ XPMReader::XPMReader( SvStream& rStm ) :
mnHeight ( 0 ),
mnColors ( 0 ),
mnCpp ( 0 ),
- mbTransparent ( FALSE ),
- mbStatus ( TRUE ),
+ mbTransparent ( sal_False ),
+ mbStatus ( sal_True ),
mnStatus ( 0 ),
mnIdentifier ( XPMIDENTIFIER ),
mcThisByte ( 0 ),
@@ -77,7 +77,7 @@ XPMReader::~XPMReader()
ReadState XPMReader::ReadXPM( Graphic& rGraphic )
{
ReadState eReadState;
- BYTE cDummy;
+ sal_uInt8 cDummy;
// sehen, ob wir _alles_ lesen koennen
mrIStm.Seek( STREAM_SEEK_TO_END );
@@ -88,14 +88,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
if ( mrIStm.GetError() != ERRCODE_IO_PENDING )
{
mrIStm.Seek( mnLastPos );
- mbStatus = TRUE;
+ mbStatus = sal_True;
if ( mbStatus )
{
- mpStringBuf = new BYTE [ XPMSTRINGBUF ];
- mpTempBuf = new BYTE [ XPMTEMPBUFSIZE ];
+ mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ];
+ mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ];
- if ( ( mbStatus = ImplGetString() ) == TRUE )
+ if ( ( mbStatus = ImplGetString() ) == sal_True )
{
mnIdentifier = XPMVALUES; // Bitmap informationen einholen
mnWidth = ImplGetULONG( 0 );
@@ -115,14 +115,14 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
// Farbe: ( mnCpp )Byte(s)-> ASCII Eintrag der der Farbe zugeordnet ist
// 1 Byte -> 0xff wenn Farbe transparent ist
// 3 Bytes -> RGB Wert der Farbe
- mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ];
+ mpColMap = new sal_uInt8[ mnColors * ( 4 + mnCpp ) ];
if ( mpColMap )
{
- for ( ULONG i = 0; i < mnColors; i++ )
+ for ( sal_uLong i = 0; i < mnColors; i++ )
{
- if ( ImplGetColor( i ) == FALSE )
+ if ( ImplGetColor( i ) == sal_False )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -146,35 +146,35 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
maBmp = Bitmap( Size( mnWidth, mnHeight ), nBits );
mpAcc = maBmp.AcquireWriteAccess();
- // mbTransparent ist TRUE wenn mindestens eine Farbe Transparent ist
+ // mbTransparent ist sal_True wenn mindestens eine Farbe Transparent ist
if ( mbTransparent )
{
maMaskBmp = Bitmap( Size( mnWidth, mnHeight ), 1 );
if ( ( mpMaskAcc = maMaskBmp.AcquireWriteAccess() ) == NULL )
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if( mpAcc && mbStatus )
{
- ULONG i;
+ sal_uLong i;
if ( mnColors <=256 ) // palette is only needed by using less than 257
{ // colors
- BYTE* pPtr = &mpColMap[mnCpp];
+ sal_uInt8* pPtr = &mpColMap[mnCpp];
for ( i = 0; i < mnColors; i++ )
{
- mpAcc->SetPaletteColor( (BYTE)i, Color( pPtr[1], pPtr[2], pPtr[3] ) );
+ mpAcc->SetPaletteColor( (sal_uInt8)i, Color( pPtr[1], pPtr[2], pPtr[3] ) );
pPtr += ( mnCpp + 4 );
}
// using 2 charakters per pixel and less than 257 Colors we speed up
if ( mnCpp == 2 ) // by using a 64kb indexing table
{
- mpFastColorTable = new BYTE[ 256 * 256 ];
+ mpFastColorTable = new sal_uInt8[ 256 * 256 ];
for ( pPtr = mpColMap, i = 0; i < mnColors; i++, pPtr += mnCpp + 4 )
{
- ULONG j = pPtr[ 0 ] << 8;
+ sal_uLong j = pPtr[ 0 ] << 8;
j += pPtr[ 1 ];
- mpFastColorTable[ j ] = (BYTE)i;
+ mpFastColorTable[ j ] = (sal_uInt8)i;
}
}
}
@@ -182,9 +182,9 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
mnIdentifier = XPMPIXELS;
for ( i = 0; i < mnHeight; i++ )
{
- if ( ImplGetScanLine( i ) == FALSE )
+ if ( ImplGetScanLine( i ) == sal_False )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -235,17 +235,17 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
// ------------------------------------------------------------------------
// ImplGetColor ermittelt saemtliche Farbwerte,
-// die Rueckgabe ist TRUE wenn saemtliche Farben zugeordnet werden konnten
+// die Rueckgabe ist sal_True wenn saemtliche Farben zugeordnet werden konnten
-BOOL XPMReader::ImplGetColor( ULONG nNumb )
+sal_Bool XPMReader::ImplGetColor( sal_uLong nNumb )
{
- BYTE* pString = mpStringBuf;
- BYTE* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
- BOOL bStatus = ImplGetString();
+ sal_uInt8* pString = mpStringBuf;
+ sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
+ sal_Bool bStatus = ImplGetString();
if ( bStatus )
{
- for ( ULONG i = 0; i < mnCpp; i++ )
+ for ( sal_uLong i = 0; i < mnCpp; i++ )
*pPtr++ = *pString++;
bStatus = ImplGetColSub ( pPtr );
}
@@ -256,11 +256,11 @@ BOOL XPMReader::ImplGetColor( ULONG nNumb )
// ImpGetScanLine liest den String mpBufSize aus und schreibt die Pixel in die
// Bitmap. Der Parameter nY gibt die horizontale Position an.
-BOOL XPMReader::ImplGetScanLine( ULONG nY )
+sal_Bool XPMReader::ImplGetScanLine( sal_uLong nY )
{
- BOOL bStatus = ImplGetString();
- BYTE* pString = mpStringBuf;
- BYTE* pColor;
+ sal_Bool bStatus = ImplGetString();
+ sal_uInt8* pString = mpStringBuf;
+ sal_uInt8* pColor;
BitmapColor aWhite;
BitmapColor aBlack;
@@ -272,18 +272,18 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
aBlack = mpMaskAcc->GetBestMatchingColor( Color( COL_BLACK ) );
}
if ( mnStringSize != ( mnWidth * mnCpp ))
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- ULONG i, j;
+ sal_uLong i, j;
if ( mpFastColorTable )
{
for ( i = 0; i < mnWidth; i++ )
{
j = (*pString++) << 8;
j += *pString++;
- BYTE k = (BYTE)mpFastColorTable[ j ];
- mpAcc->SetPixel( nY, i, BitmapColor( (BYTE)k ) );
+ sal_uInt8 k = (sal_uInt8)mpFastColorTable[ j ];
+ mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8)k ) );
if ( mpMaskAcc )
mpMaskAcc->SetPixel( nY, i,
@@ -295,12 +295,12 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
pColor = mpColMap;
for ( j = 0; j < mnColors; j++ )
{
- if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == TRUE )
+ if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == sal_True )
{
if ( mnColors > 256 )
mpAcc->SetPixel( nY, i, Color ( pColor[3], pColor[4], pColor[5] ) );
else
- mpAcc->SetPixel( nY, i, BitmapColor( (BYTE) j ) );
+ mpAcc->SetPixel( nY, i, BitmapColor( (sal_uInt8) j ) );
if ( mpMaskAcc )
mpMaskAcc->SetPixel( nY, i, (
@@ -323,11 +323,11 @@ BOOL XPMReader::ImplGetScanLine( ULONG nY )
// wurde eine Farbe gefunden wird an pDest[1]..pDest[2] der RGB wert geschrieben
// pDest[0] enthaelt 0xff wenn die Farbe transparent ist sonst 0
-BOOL XPMReader::ImplGetColSub( BYTE* pDest )
+sal_Bool XPMReader::ImplGetColSub( sal_uInt8* pDest )
{
unsigned char cTransparent[] = "None";
- BOOL bColStatus = FALSE;
+ sal_Bool bColStatus = sal_False;
if ( ImplGetColKey( 'c' ) || ImplGetColKey( 'm' ) || ImplGetColKey( 'g' ) )
{
@@ -335,7 +335,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
if ( *mpPara == '#' )
{
*pDest++ = 0;
- bColStatus = TRUE;
+ bColStatus = sal_True;
switch ( mnParaSize )
{
case 25 :
@@ -348,7 +348,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
ImplGetRGBHex ( pDest, 0 );
break;
default:
- bColStatus = FALSE;
+ bColStatus = sal_False;
break;
}
}
@@ -356,14 +356,14 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
else if ( ImplCompare( &cTransparent[0], mpPara, 4 ))
{
*pDest++ = 0xff;
- bColStatus = TRUE;
- mbTransparent = TRUE;
+ bColStatus = sal_True;
+ mbTransparent = sal_True;
}
// last we will try to get the colorname
else if ( mnParaSize > 2 ) // name must enlarge the minimum size
{
- ULONG i = 0;
- while ( TRUE )
+ sal_uLong i = 0;
+ while ( sal_True )
{
if ( pRGBTable[ i ].name == NULL )
break;
@@ -372,7 +372,7 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
if ( ImplCompare ( (unsigned char*)pRGBTable[ i ].name,
mpPara, mnParaSize, XPMCASENONSENSITIVE ) )
{
- bColStatus = TRUE;
+ bColStatus = sal_True;
*pDest++ = 0;
*pDest++ = pRGBTable[ i ].red;
*pDest++ = pRGBTable[ i ].green;
@@ -388,11 +388,11 @@ BOOL XPMReader::ImplGetColSub( BYTE* pDest )
// ------------------------------------------------------------------------
// ImplGetColKey durchsuch den String mpStringBuf nach einem Parameter 'nKey'
-// und gibt einen BOOL zurueck. ( wenn TRUE werden mpPara und mnParaSize gesetzt )
+// und gibt einen sal_Bool zurueck. ( wenn sal_True werden mpPara und mnParaSize gesetzt )
-BOOL XPMReader::ImplGetColKey( BYTE nKey )
+sal_Bool XPMReader::ImplGetColKey( sal_uInt8 nKey )
{
- BYTE nTemp, nPrev = ' ';
+ sal_uInt8 nTemp, nPrev = ' ';
mpPara = mpStringBuf + mnCpp + 1;
mnParaSize = 0;
@@ -427,7 +427,7 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey )
}
}
}
- return ( mnParaSize ) ? TRUE : FALSE;
+ return ( mnParaSize ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
@@ -439,12 +439,12 @@ BOOL XPMReader::ImplGetColKey( BYTE nKey )
// 6 : '#12345678abcdefab12345678' " " " "
-void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd )
+void XPMReader::ImplGetRGBHex( sal_uInt8* pDest,sal_uLong nAdd )
{
- BYTE* pPtr = mpPara+1;
- BYTE nHex, nTemp;
+ sal_uInt8* pPtr = mpPara+1;
+ sal_uInt8 nHex, nTemp;
- for ( ULONG i = 0; i < 3; i++ )
+ for ( sal_uLong i = 0; i < 3; i++ )
{
nHex = (*pPtr++) - '0';
if ( nHex > 9 )
@@ -456,24 +456,24 @@ void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd )
nHex = ( nHex << 4 ) + nTemp;
pPtr += nAdd;
- *pDest++ = (BYTE)nHex;
+ *pDest++ = (sal_uInt8)nHex;
}
}
// ------------------------------------------------------------------------
// ImplGetUlong gibt den wert einer bis zu 6stelligen ASCII-Dezimalzahl zurueck.
-ULONG XPMReader::ImplGetULONG( ULONG nPara )
+sal_uLong XPMReader::ImplGetULONG( sal_uLong nPara )
{
if ( ImplGetPara ( nPara ) )
{
- ULONG nRetValue = 0;
- BYTE* pPtr = mpPara;
+ sal_uLong nRetValue = 0;
+ sal_uInt8* pPtr = mpPara;
if ( ( mnParaSize > 6 ) || ( mnParaSize == 0 ) ) return 0;
- for ( ULONG i = 0; i < mnParaSize; i++ )
+ for ( sal_uLong i = 0; i < mnParaSize; i++ )
{
- BYTE j = (*pPtr++) - 48;
+ sal_uInt8 j = (*pPtr++) - 48;
if ( j > 9 ) return 0; // ascii is invalid
nRetValue*=10;
nRetValue+=j;
@@ -485,28 +485,28 @@ ULONG XPMReader::ImplGetULONG( ULONG nPara )
// ------------------------------------------------------------------------
-BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMode )
+sal_Bool XPMReader::ImplCompare( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nSize, sal_uLong nMode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nMode == XPMCASENONSENSITIVE )
{
- for ( ULONG i = 0; i < nSize; i++ )
+ for ( sal_uLong i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
}
else
{
- for ( ULONG i = 0; i < nSize; i++ )
+ for ( sal_uLong i = 0; i < nSize; i++ )
{
if ( pSource[i] != pDest[i] )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -517,15 +517,15 @@ BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMod
// ------------------------------------------------------------------------
// ImplGetPara versucht den nNumb ( 0...x ) Parameter aus mpStringBuf zu ermitteln.
// Ein Parameter ist durch Spaces oder Tabs von den anderen getrennt.
-// Konnte der Parameter gefunden werden ist der Rueckgabewert TRUE und mpPara + mnParaSize
+// Konnte der Parameter gefunden werden ist der Rueckgabewert sal_True und mpPara + mnParaSize
// werden gesetzt.
-BOOL XPMReader::ImplGetPara ( ULONG nNumb )
+sal_Bool XPMReader::ImplGetPara ( sal_uLong nNumb )
{
- BYTE nByte;
- ULONG pSize = 0;
- BYTE* pPtr = mpStringBuf;
- ULONG nCount = 0;
+ sal_uInt8 nByte;
+ sal_uLong pSize = 0;
+ sal_uInt8* pPtr = mpStringBuf;
+ sal_uLong nCount = 0;
if ( ( *pPtr != ' ' ) && ( *pPtr != 0x09 ) )
{
@@ -567,7 +567,7 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb )
pSize++;
pPtr++;
}
- return ( ( nCount == nNumb ) && ( mpPara ) ) ? TRUE : FALSE;
+ return ( ( nCount == nNumb ) && ( mpPara ) ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
@@ -575,10 +575,10 @@ BOOL XPMReader::ImplGetPara ( ULONG nNumb )
// mnStringSize enthaelt die Groesse des gelesenen Strings.
// Bemerkungen wie '//' und '/*.....*/' werden uebersprungen.
-BOOL XPMReader::ImplGetString( void )
+sal_Bool XPMReader::ImplGetString( void )
{
- BYTE sID[] = "/* XPM */";
- BYTE* pString = mpStringBuf;
+ sal_uInt8 sID[] = "/* XPM */";
+ sal_uInt8* pString = mpStringBuf;
mnStringSize = 0;
mpStringBuf[0] = 0;
@@ -597,13 +597,13 @@ BOOL XPMReader::ImplGetString( void )
{
if ( mnTempAvail <= 50 )
{
- mbStatus = FALSE; // file is too short to be a correct XPM format
+ mbStatus = sal_False; // file is too short to be a correct XPM format
break;
}
for ( int i = 0; i < 9; i++ ) // searching for "/* XPM */"
if ( *mpTempPtr++ != sID[i] )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
mnTempAvail-=9;
@@ -635,7 +635,7 @@ BOOL XPMReader::ImplGetString( void )
}
if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
*pString++ = mcThisByte;
@@ -673,11 +673,11 @@ BOOL XPMReader::ImplGetString( void )
// - ImportXPM -
// -------------
-BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic )
+sal_Bool ImportXPM( SvStream& rStm, Graphic& rGraphic )
{
XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pXPMReader )
pXPMReader = new XPMReader( rStm );
@@ -687,7 +687,7 @@ BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic )
if( eReadState == XPMREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pXPMReader;
}
else if( eReadState == XPMREAD_OK )
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
index 146beff287bc..609e4684513e 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -33,12 +33,10 @@
extern "C"
{
- #define INT32 JPEG_INT32
#include "stdio.h"
#include "jpeg.h"
#include "jpeglib.h"
#include "jerror.h"
- #undef INT32
}
#define _JPEGPRIVATE
@@ -126,7 +124,7 @@ extern "C" int empty_output_buffer (j_compress_ptr cinfo)
dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = BUF_SIZE;
- return TRUE;
+ return sal_True;
}
extern "C" void term_destination (j_compress_ptr cinfo)
@@ -190,7 +188,7 @@ extern "C" void init_source (j_decompress_ptr cinfo)
* but we don't clear the input buffer.
* This is correct behavior for reading a series of images from one source.
*/
- src->start_of_file = TRUE;
+ src->start_of_file = sal_True;
}
long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
@@ -239,9 +237,9 @@ extern "C" int fill_input_buffer (j_decompress_ptr cinfo)
src->pub.next_input_byte = src->buffer;
src->pub.bytes_in_buffer = nbytes;
- src->start_of_file = FALSE;
+ src->start_of_file = sal_False;
- return TRUE;
+ return sal_True;
}
extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
@@ -256,7 +254,7 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
while (num_bytes > (long) src->pub.bytes_in_buffer) {
num_bytes -= (long) src->pub.bytes_in_buffer;
(void) fill_input_buffer(cinfo);
- /* note we assume that fill_input_buffer will never return FALSE,
+ /* note we assume that fill_input_buffer will never return sal_False,
* so suspension need not be handled.
*/
}
@@ -351,9 +349,9 @@ void* JPEGReader::CreateBitmap( void* pParam )
{
BitmapPalette aGrayPal( 256 );
- for( USHORT n = 0; n < 256; n++ )
+ for( sal_uInt16 n = 0; n < 256; n++ )
{
- const BYTE cGray = (BYTE) n;
+ const sal_uInt8 cGray = (sal_uInt8) n;
aGrayPal[ n ] = BitmapColor( cGray, cGray, cGray );
}
@@ -387,7 +385,7 @@ void* JPEGReader::CreateBitmap( void* pParam )
{
long nAlignedWidth;
- const ULONG nFormat = pAcc->GetScanlineFormat();
+ const sal_uLong nFormat = pAcc->GetScanlineFormat();
if(
( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
@@ -401,7 +399,7 @@ void* JPEGReader::CreateBitmap( void* pParam )
else
{
nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) );
- ((JPEGCreateBitmapParam*)pParam)->bTopDown = TRUE;
+ ((JPEGCreateBitmapParam*)pParam)->bTopDown = sal_True;
pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * aSize.Height() );
}
((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth;
@@ -426,9 +424,9 @@ void JPEGReader::FillBitmap()
{
BitmapColor* pCols = new BitmapColor[ 256 ];
- for( USHORT n = 0; n < 256; n++ )
+ for( sal_uInt16 n = 0; n < 256; n++ )
{
- const BYTE cGray = (BYTE) n;
+ const sal_uInt8 cGray = (sal_uInt8) n;
pCols[ n ] = pAcc->GetBestMatchingColor( BitmapColor( cGray, cGray, cGray ) );
}
@@ -436,7 +434,7 @@ void JPEGReader::FillBitmap()
for( long nY = 0L; nY < nHeight; nY++ )
{
- pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+ pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
pAcc->SetPixel( nY, nX, pCols[ *pTmp++ ] );
@@ -450,7 +448,7 @@ void JPEGReader::FillBitmap()
for( long nY = 0L; nY < nHeight; nY++ )
{
- pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+ pTmp = (sal_uInt8*) pBuffer + nY * nAlignedWidth;
for( long nX = 0L; nX < nWidth; nX++ )
{
@@ -516,8 +514,8 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
long nEndPos;
long nLines;
ReadState eReadState;
- BOOL bRet = FALSE;
- BYTE cDummy;
+ sal_Bool bRet = sal_False;
+ sal_uInt8 cDummy;
#if 1 // TODO: is it possible to get rid of this seek to the end?
// check if the stream's end is already available
@@ -563,10 +561,10 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
else
rGraphic = aBmp;
- bRet = TRUE;
+ bRet = sal_True;
}
else if( rIStm.GetError() == ERRCODE_IO_PENDING )
- bRet = TRUE;
+ bRet = sal_True;
// Status setzen ( Pending hat immer Vorrang )
if( rIStm.GetError() == ERRCODE_IO_PENDING )
@@ -630,13 +628,13 @@ void* JPEGWriter::GetScanline( long nY )
{
BitmapColor aColor;
long nWidth = pAcc->Width();
- BYTE* pTmp = pBuffer;
+ sal_uInt8* pTmp = pBuffer;
if( pAcc->HasPalette() )
{
for( long nX = 0L; nX < nWidth; nX++ )
{
- aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
+ aColor = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) );
*pTmp++ = aColor.GetRed();
if ( bGreys )
continue;
@@ -666,9 +664,9 @@ void* JPEGWriter::GetScanline( long nY )
// ------------------------------------------------------------------------
-BOOL JPEGWriter::Write( const Graphic& rGraphic )
+sal_Bool JPEGWriter::Write( const Graphic& rGraphic )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( xStatusIndicator.is() )
{
@@ -697,7 +695,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
BitmapColor aColor;
for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
{
- aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) )
+ aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) )
: pAcc->GetPixel( nY, nX );
bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() );
}
@@ -714,11 +712,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
if( !bNative )
- pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
+ pBuffer = new sal_uInt8[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
JPEGCallbackStruct aCallbackData;
aCallbackData.xStatusIndicator = xStatusIndicator;
- bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData );
+ bRet = (sal_Bool) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData );
delete[] pBuffer;
pBuffer = NULL;
@@ -736,11 +734,11 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
// - ImportJPEG -
// --------------
-BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags )
+sal_Bool ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags )
{
JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext();
ReadState eReadState;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( !pJPEGReader )
pJPEGReader = new JPEGReader( rStm, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 );
@@ -755,7 +753,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32
if( eReadState == JPEGREAD_ERROR )
{
- bRet = FALSE;
+ bRet = sal_False;
delete pJPEGReader;
}
else if( eReadState == JPEGREAD_OK )
@@ -770,7 +768,7 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32
// - ExportJPEG -
// --------------
-BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
+sal_Bool ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
bool* pExportWasGrey
)
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h
index c5284e968a8d..a77c335d4b66 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.h
+++ b/svtools/source/filter.vcl/jpeg/jpeg.h
@@ -51,12 +51,7 @@ struct JPEGCreateBitmapParam
};
typedef struct my_error_mgr* my_error_ptr;
-typedef unsigned char BYTE;
-#ifdef WIN
-typedef unsigned char _huge* HPBYTE;
-#else
typedef unsigned char* HPBYTE;
-#endif
void* JPEGMalloc( size_t size );
void JPEGFree( void *ptr );
diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c
index f94d7039920f..06c7d4f69964 100644
--- a/svtools/source/filter.vcl/jpeg/jpegc.c
+++ b/svtools/source/filter.vcl/jpeg/jpegc.c
@@ -101,13 +101,13 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
jpeg_create_decompress( &cinfo );
bDecompCreated = 1;
jpeg_svstream_src( &cinfo, pIStm );
- jpeg_read_header( &cinfo, TRUE );
+ jpeg_read_header( &cinfo, sal_True );
cinfo.scale_num = 1;
cinfo.scale_denom = 1;
cinfo.output_gamma = 1.0;
- cinfo.raw_data_out = FALSE;
- cinfo.quantize_colors = FALSE;
+ cinfo.raw_data_out = sal_False;
+ cinfo.quantize_colors = sal_False;
if ( cinfo.jpeg_color_space == JCS_YCbCr )
cinfo.out_color_space = JCS_RGB;
else if ( cinfo.jpeg_color_space == JCS_YCCK )
@@ -139,8 +139,8 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
if( cinfo.scale_denom > 1 )
{
cinfo.dct_method = JDCT_FASTEST;
- cinfo.do_fancy_upsampling = FALSE;
- cinfo.do_block_smoothing = FALSE;
+ cinfo.do_fancy_upsampling = sal_False;
+ cinfo.do_block_smoothing = sal_False;
}
}
@@ -254,12 +254,12 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm,
}
jpeg_set_defaults( &cinfo );
- jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE );
+ jpeg_set_quality( &cinfo, (int) nQualityPercent, sal_False );
if ( ( nWidth > 128 ) || ( nHeight > 128 ) )
jpeg_simple_progression( &cinfo );
- jpeg_start_compress( &cinfo, TRUE );
+ jpeg_start_compress( &cinfo, sal_True );
for( nY = 0; nY < nHeight; nY++ )
{
diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk
deleted file mode 100644
index 303398c5e0c9..000000000000
--- a/svtools/source/filter.vcl/jpeg/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=jpeg
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/jpegc.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/jpeg.obj
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx
index ba97834b4fbc..d556e889d2ad 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.cxx
@@ -169,17 +169,17 @@
// - EMFWriter -
// -------------
-BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem )
+sal_Bool EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem )
{
- const ULONG nHeaderPos = m_rStm.Tell();
+ const sal_uLong nHeaderPos = m_rStm.Tell();
- mpHandlesUsed = new BOOL[ MAXHANDLES ];
- memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) );
+ mpHandlesUsed = new sal_Bool[ MAXHANDLES ];
+ memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( sal_Bool ) );
mnHorTextAlign = mnHandleCount = mnLastPercent = mnRecordPos = mnRecordCount = 0;
mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID;
- mbRecordOpen = FALSE;
+ mbRecordOpen = sal_False;
- maVDev.EnableOutput( FALSE );
+ maVDev.EnableOutput( sal_False );
maVDev.SetMapMode( rMtf.GetPrefMapMode() );
mpFilterConfigItem = pFilterConfigItem;
@@ -197,29 +197,29 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// set 100th mm map mode in EMF
ImplBeginRecord( WIN_EMR_SETMAPMODE );
- m_rStm << (INT32) MM_ANISOTROPIC;
+ m_rStm << (sal_Int32) MM_ANISOTROPIC;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX );
- m_rStm << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY();
+ m_rStm << (sal_Int32) maVDev.ImplGetDPIX() << (sal_Int32) maVDev.ImplGetDPIY();
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX );
- m_rStm << (INT32) 2540 << (INT32) 2540;
+ m_rStm << (sal_Int32) 2540 << (sal_Int32) 2540;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX );
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETWINDOWORGEX );
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplEndRecord();
ImplWriteRasterOp( ROP_OVERPAINT );
ImplBeginRecord( WIN_EMR_SETBKMODE );
- m_rStm << (UINT32) 1; // TRANSPARENT
+ m_rStm << (sal_uInt32) 1; // TRANSPARENT
ImplEndRecord();
// write emf data
@@ -233,17 +233,17 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// write header
- const ULONG nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos );
-
- m_rStm << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object
- << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 )
- << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 )
- << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos )
- << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
- << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height()
- << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 )
- << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
- << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object
+ const sal_uLong nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos );
+
+ m_rStm << (sal_uInt32) 0x00000001 << (sal_uInt32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object
+ << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizePix.Width() - 1 ) << (sal_Int32) ( aMtfSizePix.Height() - 1 )
+ << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) ( aMtfSizeLog.Width() - 1 ) << (sal_Int32) ( aMtfSizeLog.Height() - 1 )
+ << (sal_uInt32) 0x464d4520 << (sal_uInt32) 0x10000 << (sal_uInt32) ( nEndPos - nHeaderPos )
+ << (sal_uInt32) mnRecordCount << (sal_uInt16) ( mnHandleCount + 1 ) << (sal_uInt16) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0
+ << (sal_Int32) aMtfSizePix.Width() << (sal_Int32) aMtfSizePix.Height()
+ << (sal_Int32) ( aMtfSizeLog.Width() / 100 ) << (sal_Int32) ( aMtfSizeLog.Height() / 100 )
+ << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0
+ << (sal_Int32) ( aMtfSizeLog.Width() * 10 ) << (sal_Int32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object
m_rStm.Seek( nEndPos );
delete[] mpHandlesUsed;
@@ -253,15 +253,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConf
// -----------------------------------------------------------------------------
-ULONG EMFWriter::ImplAcquireHandle()
+sal_uLong EMFWriter::ImplAcquireHandle()
{
- ULONG nHandle = HANDLE_INVALID;
+ sal_uLong nHandle = HANDLE_INVALID;
- for( ULONG i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ )
+ for( sal_uLong i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ )
{
if( !mpHandlesUsed[ i ] )
{
- mpHandlesUsed[ i ] = TRUE;
+ mpHandlesUsed[ i ] = sal_True;
if( ( nHandle = i ) == mnHandleCount )
mnHandleCount++;
@@ -274,10 +274,10 @@ ULONG EMFWriter::ImplAcquireHandle()
// -----------------------------------------------------------------------------
-void EMFWriter::ImplReleaseHandle( ULONG nHandle )
+void EMFWriter::ImplReleaseHandle( sal_uLong nHandle )
{
DBG_ASSERT( nHandle && ( nHandle < MAXHANDLES ), "Handle out of range" );
- mpHandlesUsed[ nHandle - 1 ] = FALSE;
+ mpHandlesUsed[ nHandle - 1 ] = sal_False;
}
// -----------------------------------------------------------------------------
@@ -288,7 +288,7 @@ void EMFWriter::ImplBeginRecord( sal_uInt32 nType )
if( !mbRecordOpen )
{
- mbRecordOpen = TRUE;
+ mbRecordOpen = sal_True;
mnRecordPos = m_rStm.Tell();
m_rStm << nType;
@@ -315,17 +315,17 @@ void EMFWriter::ImplEndRecord()
while( nFillBytes-- )
m_rStm << (sal_uInt8)0;
mnRecordCount++;
- mbRecordOpen = FALSE;
+ mbRecordOpen = sal_False;
}
}
// -----------------------------------------------------------------------------
-BOOL EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType )
+sal_Bool EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType )
{
if( rHandle != HANDLE_INVALID )
{
- UINT32 nStockObject = 0x80000000;
+ sal_uInt32 nStockObject = 0x80000000;
if( LINE_SELECT == nSelectType )
nStockObject |= 0x00000007;
@@ -410,7 +410,7 @@ void EMFWriter::ImplCheckTextAttr()
m_rStm << mnTextHandle;
ImplWriteExtent( -rFont.GetSize().Height() );
ImplWriteExtent( rFont.GetSize().Width() );
- m_rStm << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation();
+ m_rStm << (sal_Int32) rFont.GetOrientation() << (sal_Int32) rFont.GetOrientation();
switch( rFont.GetWeight() )
{
@@ -428,11 +428,11 @@ void EMFWriter::ImplCheckTextAttr()
}
m_rStm << nWeight;
- m_rStm << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 );
- m_rStm << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 );
- m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+ m_rStm << (sal_uInt8) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 );
+ m_rStm << (sal_uInt8) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 );
+ m_rStm << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0;
switch( rFont.GetPitch() )
{
@@ -465,24 +465,24 @@ void EMFWriter::ImplCheckTextAttr()
m_rStm << (sal_Unicode) 0;
// dummy elfVersion, elfStyleSize, elfMatch, elfReserved
- m_rStm << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ;
+ m_rStm << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 << (sal_uInt32) 0 ;
// dummy elfVendorId
- m_rStm << (UINT32) 0;
+ m_rStm << (sal_uInt32) 0;
// dummy elfCulture
- m_rStm << (UINT32) 0;
+ m_rStm << (sal_uInt32) 0;
// dummy elfPanose
- m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+ m_rStm << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0 << (sal_uInt8) 0;
// fill record to get a record size divideable by 4
- m_rStm << (UINT16) 0;
+ m_rStm << (sal_uInt16) 0;
ImplEndRecord();
// TextAlign
- UINT32 nTextAlign;
+ sal_uInt32 nTextAlign;
switch( rFont.GetAlign() )
{
@@ -511,10 +511,10 @@ void EMFWriter::ImplCheckTextAttr()
void EMFWriter::ImplWriteColor( const Color& rColor )
{
- UINT32 nCol = rColor.GetRed();
+ sal_uInt32 nCol = rColor.GetRed();
- nCol |= ( (UINT32) rColor.GetGreen() ) << 8;
- nCol |= ( (UINT32) rColor.GetBlue() ) << 16;
+ nCol |= ( (sal_uInt32) rColor.GetGreen() ) << 8;
+ nCol |= ( (sal_uInt32) rColor.GetBlue() ) << 16;
m_rStm << nCol;
}
@@ -523,7 +523,7 @@ void EMFWriter::ImplWriteColor( const Color& rColor )
void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
{
- UINT32 nROP2;
+ sal_uInt32 nROP2;
switch( eRop )
{
@@ -542,7 +542,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
void EMFWriter::ImplWriteExtent( long nExtent )
{
nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width();
- m_rStm << (INT32) nExtent;
+ m_rStm << (sal_Int32) nExtent;
}
// -----------------------------------------------------------------------------
@@ -550,7 +550,7 @@ void EMFWriter::ImplWriteExtent( long nExtent )
void EMFWriter::ImplWritePoint( const Point& rPoint )
{
const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode ));
- m_rStm << (INT32) aPoint.X() << (INT32) aPoint.Y();
+ m_rStm << (sal_Int32) aPoint.X() << (sal_Int32) aPoint.Y();
}
// -----------------------------------------------------------------------------
@@ -558,7 +558,7 @@ void EMFWriter::ImplWritePoint( const Point& rPoint )
void EMFWriter::ImplWriteSize( const Size& rSize)
{
const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode ));
- m_rStm << (INT32) aSize.Width() << (INT32) aSize.Height();
+ m_rStm << (sal_Int32) aSize.Width() << (sal_Int32) aSize.Height();
}
// -----------------------------------------------------------------------------
@@ -571,7 +571,7 @@ void EMFWriter::ImplWriteRect( const Rectangle& rRect )
// -----------------------------------------------------------------------------
-void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose )
+void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose )
{
if( rPoly.GetSize() )
{
@@ -586,9 +586,9 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose )
ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE );
ImplWriteRect( rPoly.GetBoundRect() );
- m_rStm << (UINT32) rPoly.GetSize();
+ m_rStm << (sal_uInt32) rPoly.GetSize();
- for( USHORT i = 0; i < rPoly.GetSize(); i++ )
+ for( sal_uInt16 i = 0; i < rPoly.GetSize(); i++ )
ImplWritePoint( rPoly[ i ] );
ImplEndRecord();
@@ -605,7 +605,7 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly )
if( nPolyCount )
{
if( 1 == nPolyCount )
- ImplWritePolygonRecord( rPolyPoly[ 0 ], TRUE );
+ ImplWritePolygonRecord( rPolyPoly[ 0 ], sal_True );
else
{
sal_Bool bHasFlags = sal_False;
@@ -737,7 +737,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed )
// -----------------------------------------------------------------------------
void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
- const Size& rSz, UINT32 nROP )
+ const Size& rSz, sal_uInt32 nROP )
{
if( !!rBmp )
{
@@ -747,19 +747,19 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
ImplBeginRecord( WIN_EMR_STRETCHDIBITS );
ImplWriteRect( Rectangle( rPt, rSz ) );
ImplWritePoint( rPt );
- m_rStm << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height();
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) aBmpSizePixel.Width() << (sal_Int32) aBmpSizePixel.Height();
// write offset positions and sizes later
- const ULONG nOffPos = m_rStm.Tell();
+ const sal_uLong nOffPos = m_rStm.Tell();
m_rStm.SeekRel( 16 );
- m_rStm << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP );
+ m_rStm << (sal_uInt32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP );
ImplWriteSize( rSz );
- rBmp.Write( aMemStm, TRUE, FALSE );
+ rBmp.Write( aMemStm, sal_True, sal_False );
- UINT32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
- UINT16 nBitCount;
+ sal_uInt32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
+ sal_uInt16 nBitCount;
// get DIB parameters
aMemStm.Seek( 0 );
@@ -769,15 +769,15 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
aMemStm.SeekRel( 8 );
aMemStm >> nColsUsed;
- nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) :
+ nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (sal_uInt32) nBitCount ) ) :
( ( 3 == nCompression ) ? 12 : 0 );
m_rStm.Write( aMemStm.GetData(), nDIBSize );
- const ULONG nEndPos = m_rStm.Tell();
+ const sal_uLong nEndPos = m_rStm.Tell();
m_rStm.Seek( nOffPos );
- m_rStm << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) );
- m_rStm << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize;
+ m_rStm << (sal_uInt32) 80 << (sal_uInt32)( nHeaderSize + ( nPalCount << 2 ) );
+ m_rStm << (sal_uInt32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize;
m_rStm.Seek( nEndPos );
ImplEndRecord();
@@ -827,12 +827,12 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
ImplBeginRecord( WIN_EMR_EXTTEXTOUTW );
ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) );
- m_rStm << (UINT32)1;
- m_rStm << (INT32) 0 << (INT32) 0;
+ m_rStm << (sal_uInt32)1;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0;
ImplWritePoint( rPos );
- m_rStm << (UINT32) nLen << (UINT32) 76 << (UINT32) 2;
- m_rStm << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0;
- m_rStm << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) );
+ m_rStm << (sal_uInt32) nLen << (sal_uInt32) 76 << (sal_uInt32) 2;
+ m_rStm << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0 << (sal_Int32) 0;
+ m_rStm << (sal_uInt32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) );
// write text
for( i = 0; i < nLen; i++ )
@@ -840,7 +840,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
// padding word
if( nLen & 1 )
- m_rStm << (UINT16) 0;
+ m_rStm << (sal_uInt16) 0;
// write DX array
ImplWriteExtent( pDX[ 0 ] );
@@ -874,7 +874,7 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas
for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++)
{
const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a));
- ImplWritePolygonRecord( Polygon(aCandidate), FALSE );
+ ImplWritePolygonRecord( Polygon(aCandidate), sal_False );
}
}
@@ -902,10 +902,10 @@ void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const bas
void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
- for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ )
+ for( sal_uLong j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ )
{
const MetaAction* pAction = rMtf.GetAction( j );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -1073,7 +1073,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
if(pA->GetLineInfo().IsDefault())
{
- ImplWritePolygonRecord( rPoly, FALSE );
+ ImplWritePolygonRecord( rPoly, sal_False );
}
else
{
@@ -1156,7 +1156,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
const GDIMetaFile aSubstitute( pA->GetSubstitute() );
- for( ULONG i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ )
+ for( sal_uLong i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ )
{
const MetaAction* pSubstAct = aSubstitute.GetAction( i );
if( pSubstAct->GetType() == META_BMPSCALE_ACTION )
@@ -1175,7 +1175,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
maVDev.Pop();
ImplBeginRecord( WIN_EMR_RESTOREDC );
- m_rStm << (INT32) -1;
+ m_rStm << (sal_Int32) -1;
ImplEndRecord();
break;
}
@@ -1306,14 +1306,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_LINECOLOR_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbLineChanged = TRUE;
+ mbLineChanged = sal_True;
}
break;
case( META_FILLCOLOR_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbFillChanged = TRUE;
+ mbFillChanged = sal_True;
}
break;
@@ -1324,7 +1324,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_FONT_ACTION ):
{
( (MetaAction*) pAction )->Execute( &maVDev );
- mbTextChanged = TRUE;
+ mbTextChanged = sal_True;
}
break;
@@ -1365,11 +1365,11 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
( (MetaAction*) pAction )->Execute( &maVDev );
ImplBeginRecord( WIN_EMR_RESTOREDC );
- m_rStm << (INT32) -1;
+ m_rStm << (sal_Int32) -1;
ImplEndRecord();
ImplWriteRasterOp( maVDev.GetRasterOp() );
- mbLineChanged = mbFillChanged = mbTextChanged = TRUE;
+ mbLineChanged = mbFillChanged = mbTextChanged = sal_True;
}
break;
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx
index fbee680b1cd0..ee3b723ace3e 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.hxx
@@ -51,27 +51,27 @@ private:
MapMode maDestMapMode;
FilterConfigItem* mpFilterConfigItem;
SvStream& m_rStm;
- BOOL* mpHandlesUsed;
- ULONG mnHandleCount;
- ULONG mnLastPercent;
- ULONG mnRecordCount;
- ULONG mnRecordPos;
- BOOL mbRecordOpen;
- BOOL mbLineChanged;
+ sal_Bool* mpHandlesUsed;
+ sal_uLong mnHandleCount;
+ sal_uLong mnLastPercent;
+ sal_uLong mnRecordCount;
+ sal_uLong mnRecordPos;
+ sal_Bool mbRecordOpen;
+ sal_Bool mbLineChanged;
sal_uInt32 mnLineHandle;
- BOOL mbFillChanged;
+ sal_Bool mbFillChanged;
sal_uInt32 mnFillHandle;
- BOOL mbTextChanged;
+ sal_Bool mbTextChanged;
sal_uInt32 mnTextHandle;
sal_uInt32 mnHorTextAlign;
void ImplBeginRecord( sal_uInt32 nType );
void ImplEndRecord();
- ULONG ImplAcquireHandle();
- void ImplReleaseHandle( ULONG nHandle );
+ sal_uLong ImplAcquireHandle();
+ void ImplReleaseHandle( sal_uLong nHandle );
- BOOL ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType );
+ sal_Bool ImplPrepareHandleSelect( sal_uInt32& rHandle, sal_uLong nSelectType );
void ImplCheckLineAttr();
void ImplCheckFillAttr();
void ImplCheckTextAttr();
@@ -83,9 +83,9 @@ private:
void ImplWriteSize( const Size& rSize);
void ImplWriteRect( const Rectangle& rRect );
void ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClose );
- void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose );
+ void ImplWritePolygonRecord( const Polygon& rPoly, sal_Bool bClose );
void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
- void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP );
+ void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, sal_uInt32 nROP );
void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
@@ -95,7 +95,7 @@ public:
EMFWriter(SvStream &rStream) : m_rStm(rStream) {}
- BOOL WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL );
+ sal_Bool WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL );
};
#endif // _EMFWR_HXX
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
index 259f518fbf95..91cabcf430a3 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -272,8 +272,8 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
length -= 4;
while (length > 0) {
- UINT16 type, flags;
- UINT32 size, dataSize;
+ sal_uInt16 type, flags;
+ sal_uInt32 size, dataSize;
sal_uInt32 next;
*pWMF >> type >> flags >> size >> dataSize;
@@ -332,7 +332,7 @@ void EnhWMFReader::ReadGDIComment()
}
}
-BOOL EnhWMFReader::ReadEnhWMF()
+sal_Bool EnhWMFReader::ReadEnhWMF()
{
sal_uInt32 nStretchBltMode = 0;
sal_uInt32 nRecType, nRecSize, nNextPos,
@@ -357,7 +357,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( ( nRecSize < 8 ) || ( nRecSize & 3 ) ) // Parameter sind immer durch 4 teilbar
{
- bStatus = FALSE;
+ bStatus = sal_False;
break;
}
@@ -365,7 +365,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( nNextPos > nEndPos )
{
- bStatus = FALSE;
+ bStatus = sal_False;
break;
}
@@ -384,7 +384,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
EMFP_DEBUG(printf ("\tGDI comment\n\t\tlength: %d\n", length));
if( length >= 4 ) {
- UINT32 id;
+ sal_uInt32 id;
*pWMF >> id;
@@ -430,8 +430,8 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- Polygon aPoly( (UINT16)nPoints );
- for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ )
{
*pWMF >> nX32 >> nY32;
aPoly[ k ] = Point( nX32, nY32 );
@@ -446,14 +446,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 0x10 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPolygon( (UINT16)nPoints );
- for ( ; i < (UINT16)nPoints; i++ )
+ Polygon aPolygon( (sal_uInt16)nPoints );
+ for ( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX32 >> nY32;
aPolygon[ i ] = Point( nX32, nY32 );
@@ -464,25 +464,25 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYLINE :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
- INT32 i, nPoly;
+ sal_Int32 i, nPoly;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> i;
// taking the amount of points of each polygon, retrieving the total number of points
- if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) )
+ if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
// Polygonpunkte holen:
@@ -490,7 +490,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ )
{
Polygon aPoly( pnPoints[ i ] );
- for( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ for( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ )
{
*pWMF >> nX32 >> nY32;
aPoly[ k ] = Point( nX32, nY32 );
@@ -505,25 +505,25 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYGON :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
- UINT32 i, nPoly, nGesPoints;
+ sal_uInt32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
- if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) )
+ if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) )
{
- if ( ( nPoly * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( nPoly * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
if ( ( nGesPoints * (sizeof(sal_uInt32)+sizeof(sal_uInt32)) ) <= ( nEndPos - pWMF->Tell() ) )
@@ -537,7 +537,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
pPtAry[ i ] = Point( nX32, nY32 );
}
// PolyPolygon Actions erzeugen
- PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+ PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
delete[] pPtAry;
}
@@ -693,7 +693,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_MODIFYWORLDTRANSFORM :
{
- UINT32 nMode;
+ sal_uInt32 nMode;
XForm aTempXForm;
*pWMF >> aTempXForm >> nMode;
pOut->ModifyWorldTransform( aTempXForm, nMode );
@@ -714,7 +714,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
LineInfo aLineInfo;
- UINT32 nStyle;
+ sal_uInt32 nStyle;
Size aSize;
*pWMF >> nStyle >> aSize.Width() >> aSize.Height();
@@ -722,9 +722,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
if ( aSize.Width() )
aLineInfo.SetWidth( aSize.Width() );
- BOOL bTransparent = FALSE;
- UINT16 nDashCount = 0;
- UINT16 nDotCount = 0;
+ sal_Bool bTransparent = sal_False;
+ sal_uInt16 nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
switch( nStyle )
{
case PS_DASHDOTDOT :
@@ -738,7 +738,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
nDashCount++;
break;
case PS_NULL :
- bTransparent = TRUE;
+ bTransparent = sal_True;
aLineInfo.SetStyle( LINE_NONE );
break;
default :
@@ -813,12 +813,12 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CREATEBRUSHINDIRECT :
{
- UINT32 nStyle;
+ sal_uInt32 nStyle;
*pWMF >> nIndex;
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
*pWMF >> nStyle;
- pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) );
}
}
break;
@@ -855,7 +855,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_ARC :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
}
@@ -863,7 +863,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CHORD :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
pOut->DrawChord( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
}
@@ -871,7 +871,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_PIE :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
const Rectangle aRect( ReadRectangle( nX32, nY32, nx32, ny32 ));
@@ -893,9 +893,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_ARCTO :
{
- UINT32 nStartX, nStartY, nEndX, nEndY;
+ sal_uInt32 nStartX, nStartY, nEndX, nEndY;
*pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
- pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), TRUE );
+ pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), sal_True );
}
break;
@@ -952,11 +952,11 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_BITBLT : // PASSTHROUGH INTENDED
case EMR_STRETCHBLT :
{
- INT32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc;
- UINT32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc;
+ sal_Int32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc;
+ sal_uInt32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc;
XForm xformSrc;
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
pWMF->SeekRel( 0x10 );
*pWMF >> xDest >> yDest >> cxDest >> cyDest >> dwRop >> xSrc >> ySrc
@@ -975,27 +975,27 @@ BOOL EnhWMFReader::ReadEnhWMF()
cyDest = abs( (int)cyDest ); // and also 122889
if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBitsSrc
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmiSrc + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBitsSrc
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmiSrc + 14;
pWMF->Seek( nStart + offBmiSrc );
pWMF->Read( pBuf + 14, cbBmiSrc );
pWMF->Seek( nStart + offBitsSrc );
pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
// test if it is sensible to crop
if ( ( cxSrc > 0 ) && ( cySrc > 0 ) &&
@@ -1017,9 +1017,9 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_STRETCHDIBITS :
{
- INT32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest;
- UINT32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop;
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_Int32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest;
+ sal_uInt32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
pWMF->SeekRel( 0x10 );
*pWMF >> xDest >> yDest >> xSrc >> ySrc >> cxSrc >> cySrc >> offBmiSrc >> cbBmiSrc >> offBitsSrc
@@ -1032,27 +1032,27 @@ BOOL EnhWMFReader::ReadEnhWMF()
cyDest = abs( (int)cyDest ); // and also 122889
if ( (cbBitsSrc > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc) )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
- UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBitsSrc
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmiSrc + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBitsSrc
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmiSrc + 14;
pWMF->Seek( nStart + offBmiSrc );
pWMF->Read( pBuf + 14, cbBmiSrc );
pWMF->Seek( nStart + offBitsSrc );
pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
// test if it is sensible to crop
if ( ( cxSrc > 0 ) && ( cySrc > 0 ) &&
@@ -1084,7 +1084,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
for ( int i = 0; i < LF_FACESIZE; i++ )
{
- UINT16 nChar;
+ sal_uInt16 nChar;
*pWMF >> nChar;
lfFaceName[ i ] = nChar;
}
@@ -1188,14 +1188,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPoly( (UINT16)nPoints );
- for( ; i < (UINT16)nPoints; i++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ i ] = Point( nX16, nY16 );
@@ -1208,8 +1208,8 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- Polygon aPoly( (UINT16)nPoints );
- for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( sal_uInt16 k = 0; k < (sal_uInt16)nPoints; k++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ k ] = Point( nX16, nY16 );
@@ -1224,15 +1224,15 @@ BOOL EnhWMFReader::ReadEnhWMF()
{
pWMF->SeekRel( 16 );
*pWMF >> nPoints;
- UINT16 i = 0;
+ sal_uInt16 i = 0;
if ( bFlag )
{
i++;
nPoints++;
}
- Polygon aPoly( (UINT16)nPoints );
- for( ; i < (UINT16)nPoints; i++ )
+ Polygon aPoly( (sal_uInt16)nPoints );
+ for( ; i < (sal_uInt16)nPoints; i++ )
{
*pWMF >> nX16 >> nY16;
aPoly[ i ] = Point( nX16, nY16 );
@@ -1243,29 +1243,29 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYLINE16 :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
- INT32 i, nPoly, nGesPoints;
+ sal_Int32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
// taking the amount of points of each polygon, retrieving the total number of points
- if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(UINT16) )
+ if ( static_cast< sal_uInt32 >(nPoly) < SAL_MAX_UINT32 / sizeof(sal_uInt16) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(UINT16) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof(sal_uInt16) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
// Polygonpunkte holen:
for ( i = 0; ( i < nPoly ) && !pWMF->IsEof(); i++ )
{
Polygon aPolygon( pnPoints[ i ] );
- for ( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ for ( sal_uInt16 k = 0; k < pnPoints[ i ]; k++ )
{
*pWMF >> nX16 >> nY16;
aPolygon[ k ] = Point( nX16, nY16 );
@@ -1280,22 +1280,22 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_POLYPOLYGON16 :
{
- UINT16* pnPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
- UINT32 i, nPoly, nGesPoints;
+ sal_uInt32 i, nPoly, nGesPoints;
pWMF->SeekRel( 0x10 );
// Anzahl der Polygone:
*pWMF >> nPoly >> nGesPoints;
- if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(UINT16) ) )
+ if ( ( nGesPoints < SAL_MAX_UINT32 / sizeof(Point) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) )
{
- if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( UINT16 ) ) <= ( nEndPos - pWMF->Tell() ) )
+ if ( ( static_cast< sal_uInt32 >( nPoly ) * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) )
{
- pnPoints = new UINT16[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly; i++ )
{
*pWMF >> nPoints;
- pnPoints[ i ] = (UINT16)nPoints;
+ pnPoints[ i ] = (sal_uInt16)nPoints;
}
if ( ( nGesPoints * (sizeof(sal_uInt16)+sizeof(sal_uInt16)) ) <= ( nEndPos - pWMF->Tell() ) )
{
@@ -1308,7 +1308,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
}
// PolyPolygon Actions erzeugen
- PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+ PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
delete[] pPtAry;
}
@@ -1337,14 +1337,14 @@ BOOL EnhWMFReader::ReadEnhWMF()
case EMR_CREATEDIBPATTERNBRUSHPT :
{
- UINT32 nStart = pWMF->Tell() - 8;
+ sal_uInt32 nStart = pWMF->Tell() - 8;
Bitmap aBitmap;
*pWMF >> nIndex;
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
- UINT32 usage, offBmi, cbBmi, offBits, cbBits;
+ sal_uInt32 usage, offBmi, cbBmi, offBits, cbBits;
*pWMF >> usage;
*pWMF >> offBmi;
@@ -1353,28 +1353,28 @@ BOOL EnhWMFReader::ReadEnhWMF()
*pWMF >> cbBits;
if ( (cbBits > (SAL_MAX_UINT32 - 14)) || ((SAL_MAX_UINT32 - 14) - cbBits < cbBmi) )
- bStatus = FALSE;
+ bStatus = sal_False;
else if ( offBmi )
{
- UINT32 nSize = cbBmi + cbBits + 14;
+ sal_uInt32 nSize = cbBmi + cbBits + 14;
if ( nSize <= ( nEndPos - nStartPos ) )
{
char* pBuf = new char[ nSize ];
SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
- aTmp.ObjectOwnsMemory( TRUE );
- aTmp << (BYTE)'B'
- << (BYTE)'M'
- << (UINT32)cbBits
- << (UINT16)0
- << (UINT16)0
- << (UINT32)cbBmi + 14;
+ aTmp.ObjectOwnsMemory( sal_True );
+ aTmp << (sal_uInt8)'B'
+ << (sal_uInt8)'M'
+ << (sal_uInt32)cbBits
+ << (sal_uInt16)0
+ << (sal_uInt16)0
+ << (sal_uInt32)cbBmi + 14;
pWMF->Seek( nStart + offBmi );
pWMF->Read( pBuf + 14, cbBmi );
pWMF->Seek( nStart + offBits );
pWMF->Read( pBuf + 14 + cbBmi, cbBits );
aTmp.Seek( 0 );
- aBitmap.Read( aTmp, TRUE );
+ aBitmap.Read( aTmp, sal_True );
}
}
}
@@ -1455,16 +1455,16 @@ BOOL EnhWMFReader::ReadEnhWMF()
//-----------------------------------------------------------------------------------
-BOOL EnhWMFReader::ReadHeader()
+sal_Bool EnhWMFReader::ReadHeader()
{
- UINT32 nUINT32, nHeaderSize, nPalEntries;
- INT32 nLeft, nTop, nRight, nBottom;
+ sal_uInt32 nsal_uInt32, nHeaderSize, nPalEntries;
+ sal_Int32 nLeft, nTop, nRight, nBottom;
// METAFILEHEADER SPARE ICH MIR HIER
// Einlesen des METAHEADER
- *pWMF >> nUINT32 >> nHeaderSize;
- if ( nUINT32 != 1 ) // Typ
- return FALSE;
+ *pWMF >> nsal_uInt32 >> nHeaderSize;
+ if ( nsal_uInt32 != 1 ) // Typ
+ return sal_False;
// bound size
Rectangle rclBounds; // rectangle in logical units 1/100th mm
@@ -1482,12 +1482,12 @@ BOOL EnhWMFReader::ReadHeader()
rclFrame.Right() = nRight;
rclFrame.Bottom() = nBottom;
- *pWMF >> nUINT32; // signature
+ *pWMF >> nsal_uInt32; // signature
- if ( nUINT32 != 0x464d4520 )
- return FALSE;
+ if ( nsal_uInt32 != 0x464d4520 )
+ return sal_False;
- *pWMF >> nUINT32; // nVersion
+ *pWMF >> nsal_uInt32; // nVersion
*pWMF >> nEndPos; // size of metafile
nEndPos += nStartPos;
@@ -1500,7 +1500,7 @@ BOOL EnhWMFReader::ReadHeader()
*pWMF >> nRecordCount;
if ( !nRecordCount )
- return FALSE;
+ return sal_False;
pWMF->SeekRel( 0xc );
@@ -1513,12 +1513,12 @@ BOOL EnhWMFReader::ReadHeader()
pOut->SetRefMill( Size( nMillX, nMillY ) );
pWMF->Seek( nStartPos + nHeaderSize );
- return TRUE;
+ return sal_True;
}
//-----------------------------------------------------------------------------------
-Rectangle EnhWMFReader::ReadRectangle( INT32 x1, INT32 y1, INT32 x2, INT32 y2 )
+Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 )
{
Point aTL ( Point( x1, y1 ) );
Point aBR( Point( --x2, --y2 ) );
diff --git a/svtools/source/filter.vcl/wmf/makefile.mk b/svtools/source/filter.vcl/wmf/makefile.mk
deleted file mode 100644
index 5c9412bc8387..000000000000
--- a/svtools/source/filter.vcl/wmf/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=wmf
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/wmf.obj \
- $(SLO)$/winmtf.obj \
- $(SLO)$/winwmf.obj \
- $(SLO)$/enhwmf.obj \
- $(SLO)$/emfwr.obj \
- $(SLO)$/wmfwr.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 4e52fb4d548c..b0625567d5d6 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -316,7 +316,7 @@ WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, FilterConfigI
SvLockBytes *pLB = pWMF->GetLockBytes();
if ( pLB )
- pLB->SetSynchronMode( TRUE );
+ pLB->SetSynchronMode( sal_True );
nStartPos = pWMF->Tell();
@@ -344,7 +344,7 @@ WinMtf::~WinMtf()
// ------------------------------------------------------------------------
-void WinMtf::Callback( USHORT nPercent )
+void WinMtf::Callback( sal_uInt16 nPercent )
{
if ( xStatusIndicator.is() )
xStatusIndicator->setValue( nPercent );
@@ -354,9 +354,9 @@ void WinMtf::Callback( USHORT nPercent )
Color WinMtf::ReadColor()
{
- UINT32 nColor;
+ sal_uInt32 nColor;
*pWMF >> nColor;
- return Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) );
+ return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
};
//-----------------------------------------------------------------------------------
@@ -522,8 +522,8 @@ void WinMtfOutput::ImplMap( Font& rFont )
Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon )
{
- UINT16 nPoints = rPolygon.GetSize();
- for ( UINT16 i = 0; i < nPoints; i++ )
+ sal_uInt16 nPoints = rPolygon.GetSize();
+ for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
rPolygon[ i ] = ImplMap( rPolygon[ i ] );
}
@@ -534,14 +534,14 @@ Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon )
PolyPolygon& WinMtfOutput::ImplMap( PolyPolygon& rPolyPolygon )
{
- UINT16 nPolys = rPolyPolygon.Count();
- for ( UINT16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ;
+ sal_uInt16 nPolys = rPolyPolygon.Count();
+ for ( sal_uInt16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) ) ;
return rPolyPolygon;
}
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SelectObject( INT32 nIndex )
+void WinMtfOutput::SelectObject( sal_Int32 nIndex )
{
GDIObj* pGDIObj = NULL;
@@ -551,7 +551,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
{
nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen
- if ( (UINT32)nIndex < vGDIObj.size() )
+ if ( (sal_uInt32)nIndex < vGDIObj.size() )
pGDIObj = vGDIObj[ nIndex ];
}
@@ -560,7 +560,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
if ( nIndex & ENHMETA_STOCK_OBJECT )
{
- UINT16 nStockId = (BYTE)nIndex;
+ sal_uInt16 nStockId = (sal_uInt8)nIndex;
switch( nStockId )
{
case WHITE_BRUSH :
@@ -586,7 +586,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
break;
case NULL_BRUSH :
{
- pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True ) );
}
break;
case WHITE_PEN :
@@ -601,7 +601,7 @@ void WinMtfOutput::SelectObject( INT32 nIndex )
break;
case NULL_PEN :
{
- pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True ) );
}
break;
default:
@@ -662,7 +662,7 @@ sal_uInt32 WinMtfOutput::GetTextLayoutMode() const
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetBkMode( UINT32 nMode )
+void WinMtfOutput::SetBkMode( sal_uInt32 nMode )
{
mnBkMode = nMode;
}
@@ -683,14 +683,14 @@ void WinMtfOutput::SetTextColor( const Color& rColor )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetTextAlign( UINT32 nAlign )
+void WinMtfOutput::SetTextAlign( sal_uInt32 nAlign )
{
mnTextAlign = nAlign;
}
//-----------------------------------------------------------------------------------
-void WinMtfOutput::ImplResizeObjectArry( UINT32 nNewEntrys )
+void WinMtfOutput::ImplResizeObjectArry( sal_uInt32 nNewEntrys )
{
sal_uInt32 i = vGDIObj.size();
vGDIObj.resize( nNewEntrys );
@@ -756,7 +756,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle )
}
}
}
- UINT32 nIndex;
+ sal_uInt32 nIndex;
for ( nIndex = 0; nIndex < vGDIObj.size(); nIndex++ )
{
if ( vGDIObj[ nIndex ] == NULL )
@@ -770,7 +770,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle )
+void WinMtfOutput::CreateObject( sal_Int32 nIndex, GDIObjectType eType, void* pStyle )
{
if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
{
@@ -793,7 +793,7 @@ void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle
}
}
}
- if ( (UINT32)nIndex >= vGDIObj.size() )
+ if ( (sal_uInt32)nIndex >= vGDIObj.size() )
ImplResizeObjectArry( nIndex + 16 );
if ( vGDIObj[ nIndex ] != NULL )
@@ -935,7 +935,7 @@ WinMtfOutput::~WinMtfOutput()
else
mpGDIMetaFile->SetPrefSize( mrclFrame.GetSize() );
- for ( UINT32 i = 0; i < vGDIObj.size(); i++ )
+ for ( sal_uInt32 i = 0; i < vGDIObj.size(); i++ )
delete vGDIObj[ i ];
};
@@ -971,7 +971,7 @@ void WinMtfOutput::UpdateClipRegion()
void WinMtfOutput::ImplSetNonPersistentLineColorTransparenz()
{
Color aColor( COL_TRANSPARENT);
- WinMtfLineStyle aTransparentLine( aColor, TRUE );
+ WinMtfLineStyle aTransparentLine( aColor, sal_True );
if ( ! ( maLatestLineStyle == aTransparentLine ) )
{
maLatestLineStyle = aTransparentLine;
@@ -1006,7 +1006,7 @@ void WinMtfOutput::UpdateFillStyle()
//-----------------------------------------------------------------------------------
-sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp )
+sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 nRasterOp )
{
sal_uInt32 nRetROP = mnRop;
if ( nRasterOp != mnRop )
@@ -1039,8 +1039,8 @@ sal_uInt32 WinMtfOutput::SetRasterOp( UINT32 nRasterOp )
{
aNopFillStyle = maFillStyle;
aNopLineStyle = maLineStyle;
- maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE );
- maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE );
+ maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), sal_True );
+ maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), sal_True );
mbNopMode = sal_True;
}
}
@@ -1070,7 +1070,7 @@ void WinMtfOutput::StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill )
if ( !bStroke )
{
mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
}
if ( aPathObj.Count() == 1 )
mpGDIMetaFile->AddAction( new MetaPolygonAction( aPathObj.GetObject( 0 ) ) );
@@ -1135,7 +1135,7 @@ void WinMtfOutput::DrawLine( const Point& rSource, const Point& rDest )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::DrawRect( const Rectangle& rRect, BOOL bEdge )
+void WinMtfOutput::DrawRect( const Rectangle& rRect, sal_Bool bEdge )
{
UpdateClipRegion();
UpdateFillStyle();
@@ -1209,7 +1209,7 @@ void WinMtfOutput::DrawEllipse( const Rectangle& rRect )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, BOOL bTo )
+void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, sal_Bool bTo )
{
UpdateClipRegion();
UpdateLineStyle();
@@ -1311,7 +1311,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath )
{
if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
{
- USHORT nCount = rPolygon.GetSize();
+ sal_uInt16 nCount = rPolygon.GetSize();
if ( nCount )
{
if ( rPolygon[ nCount - 1 ] != rPolygon[ 0 ] )
@@ -1352,7 +1352,7 @@ void WinMtfOutput::DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath )
aMemStm << aFill;
mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0,
- static_cast<const BYTE*>(aMemStm.GetData()),
+ static_cast<const sal_uInt8*>(aMemStm.GetData()),
aMemStm.Seek( STREAM_SEEK_TO_END ) ) );
mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) );
}
@@ -1554,7 +1554,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
pVDev->SetFont( maFont );
if( pDXArry )
{
- UINT32 nLen = rText.Len();
+ sal_uInt32 nLen = rText.Len();
nTextWidth = pVDev->GetTextWidth( rText.GetChar( (sal_uInt16)( nLen - 1 ) ) );
if( nLen > 1 )
nTextWidth += pDXArry[ nLen - 2 ];
@@ -1634,7 +1634,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B
const Point aEmptyPoint;
// #i50672# Extract whole VDev content (to match size of rBitmap)
- aVDev.EnableMapMode( FALSE );
+ aVDev.EnableMapMode( sal_False );
Bitmap aMask( aVDev.GetBitmap( aEmptyPoint, aSizePixel ).CreateMask( Color( COL_WHITE ) ) );
if ( aBmpEx.IsTransparent() )
@@ -1703,7 +1703,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
{ // patterns aren't well supported yet
sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT ); // in this case nRasterOperation is either 0 or 0xff
UpdateFillStyle();
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
SetRasterOp( nOldRop );
}
else
@@ -1768,7 +1768,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x1 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1786,7 +1786,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x7 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1795,7 +1795,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
case 0xb :
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
SetRasterOp( R2_COPYPEN );
Bitmap aMask( aBitmap );
aBitmap.Invert();
@@ -1806,7 +1806,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0xb )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1823,7 +1823,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0xd )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1835,7 +1835,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
if ( nOperation == 0x9 )
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
}
break;
@@ -1845,7 +1845,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
{ // in this case nRasterOperation is either 0 or 0xff
maFillStyle = WinMtfFillStyle( Color( nRasterOperation, nRasterOperation, nRasterOperation ) );
UpdateFillStyle();
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
break;
@@ -1861,7 +1861,7 @@ void WinMtfOutput::ResolveBitmapActions( List& rSaveList )
case 0x5 : // only destination is used
{
SetRasterOp( R2_NOT );
- DrawRect( aRect, FALSE );
+ DrawRect( aRect, sal_False );
}
case 0xa : // no operation
break;
@@ -1890,7 +1890,7 @@ void WinMtfOutput::SetDevOrg( const Point& rPoint )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd )
+void WinMtfOutput::SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd )
{
mnDevOrgX += nXAdd;
mnDevOrgY += nYAdd;
@@ -1932,7 +1932,7 @@ void WinMtfOutput::SetWinOrg( const Point& rPoint )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::SetWinOrgOffset( INT32 nXAdd, INT32 nYAdd )
+void WinMtfOutput::SetWinOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd )
{
mnWinOrgX += nXAdd;
mnWinOrgY += nYAdd;
@@ -2026,7 +2026,7 @@ void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
//-----------------------------------------------------------------------------------
-void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode )
+void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode )
{
switch( nMode )
{
@@ -2216,14 +2216,14 @@ void WinMtfOutput::PassEMFPlusHeaderInfo()
// rotate and scale operations
mem << one << zero << zero << one << zero << zero;
- mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const BYTE*) mem.GetData(), mem.GetEndOfData() ) );
- mpGDIMetaFile->UseCanvas( TRUE );
+ mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS_HEADER_INFO", 0, (const sal_uInt8*) mem.GetData(), mem.GetEndOfData() ) );
+ mpGDIMetaFile->UseCanvas( sal_True );
}
-void WinMtfOutput::PassEMFPlus( void* pBuffer, UINT32 nLength )
+void WinMtfOutput::PassEMFPlus( void* pBuffer, sal_uInt32 nLength )
{
EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS comment length %d\n", nLength));
- mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const BYTE*>(pBuffer), nLength ) );
+ mpGDIMetaFile->AddAction( new MetaCommentAction( "EMF_PLUS", 0, static_cast<const sal_uInt8*>(pBuffer), nLength ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx
index a068ad3eb3da..bd2293fe108b 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.hxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.hxx
@@ -142,19 +142,19 @@
struct LOGFONTW
{
- INT32 lfHeight;
- INT32 lfWidth;
- INT32 lfEscapement;
- INT32 lfOrientation;
- INT32 lfWeight;
- BYTE lfItalic;
- BYTE lfUnderline;
- BYTE lfStrikeOut;
- BYTE lfCharSet;
- BYTE lfOutPrecision;
- BYTE lfClipPrecision;
- BYTE lfQuality;
- BYTE lfPitchAndFamily;
+ sal_Int32 lfHeight;
+ sal_Int32 lfWidth;
+ sal_Int32 lfEscapement;
+ sal_Int32 lfOrientation;
+ sal_Int32 lfWeight;
+ sal_uInt8 lfItalic;
+ sal_uInt8 lfUnderline;
+ sal_uInt8 lfStrikeOut;
+ sal_uInt8 lfCharSet;
+ sal_uInt8 lfOutPrecision;
+ sal_uInt8 lfClipPrecision;
+ sal_uInt8 lfQuality;
+ sal_uInt8 lfPitchAndFamily;
String alfFaceName;
};
@@ -361,18 +361,18 @@ typedef enum {
struct WinMtfFillStyle
{
Color aFillColor;
- BOOL bTransparent;
+ sal_Bool bTransparent;
WinMtfFillStyleType aType;
Bitmap aBmp;
WinMtfFillStyle()
: aFillColor(Color(COL_BLACK))
- , bTransparent(FALSE)
+ , bTransparent(sal_False)
, aType(FillStyleSolid)
{
}
- WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE )
+ WinMtfFillStyle( const Color& rColor, sal_Bool bTrans = sal_False )
: aFillColor(rColor)
, bTransparent(bTrans)
, aType(FillStyleSolid)
@@ -385,9 +385,9 @@ struct WinMtfFillStyle
{
}
- BOOL operator==( const WinMtfFillStyle& rStyle )
+ sal_Bool operator==( const WinMtfFillStyle& rStyle )
{ return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) && ( aType == rStyle.aType ) ); }
- BOOL operator==( WinMtfFillStyle* pStyle )
+ sal_Bool operator==( WinMtfFillStyle* pStyle )
{ return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) && ( aType == pStyle->aType ) ); }
WinMtfFillStyle& operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; aBmp = rStyle.aBmp; aType = rStyle.aType; return *this; }
WinMtfFillStyle& operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; aBmp = pStyle->aBmp; aType = pStyle->aType; return *this; }
@@ -399,23 +399,23 @@ struct WinMtfLineStyle
{
Color aLineColor;
LineInfo aLineInfo;
- BOOL bTransparent;
+ sal_Bool bTransparent;
WinMtfLineStyle() :
aLineColor ( COL_BLACK ),
- bTransparent( FALSE ) {}
+ bTransparent( sal_False ) {}
- WinMtfLineStyle( const Color& rColor, BOOL bTrans = FALSE ) :
+ WinMtfLineStyle( const Color& rColor, sal_Bool bTrans = sal_False ) :
aLineColor ( rColor ),
bTransparent( bTrans ) {}
- WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, BOOL bTrans = FALSE ) :
+ WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, sal_Bool bTrans = sal_False ) :
aLineColor ( rColor ),
aLineInfo ( rStyle ),
bTransparent( bTrans ) {}
- BOOL operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }
- BOOL operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }
+ sal_Bool operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); }
+ sal_Bool operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); }
WinMtfLineStyle& operator=( const WinMtfLineStyle& rStyle )
{
aLineColor = rStyle.aLineColor;
@@ -486,10 +486,10 @@ struct BSaveStruct
{
Bitmap aBmp;
Rectangle aOutRect;
- UINT32 nWinRop;
+ sal_uInt32 nWinRop;
WinMtfFillStyle aStyle;
- BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop, WinMtfFillStyle& rStyle ) :
+ BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, sal_uInt32 nRop, WinMtfFillStyle& rStyle ) :
aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ), aStyle ( rStyle ){}
};
@@ -603,7 +603,7 @@ class WinMtfOutput
void ImplMap( Font& rFont );
Polygon& ImplMap( Polygon& rPolygon );
PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon );
- void ImplResizeObjectArry( UINT32 nNewEntry );
+ void ImplResizeObjectArry( sal_uInt32 nNewEntry );
void ImplSetNonPersistentLineColorTransparenz();
void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly );
void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap );
@@ -611,12 +611,12 @@ class WinMtfOutput
public:
void SetDevOrg( const Point& rPoint );
- void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd );
+ void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd );
void SetDevExt( const Size& rSize );
void ScaleDevExt( double fX, double fY );
void SetWinOrg( const Point& rPoint );
- void SetWinOrgOffset( INT32 nX, INT32 nY );
+ void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY );
void SetWinExt( const Size& rSize );
void ScaleWinExt( double fX, double fY );
@@ -628,24 +628,24 @@ class WinMtfOutput
sal_uInt32 GetMapMode() const { return mnMapMode; };
void SetMapMode( sal_uInt32 mnMapMode );
void SetWorldTransform( const XForm& rXForm );
- void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode );
+ void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode );
void Push();
void Pop();
- UINT32 SetRasterOp( UINT32 nRasterOp );
+ sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp );
void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill );
void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; };
sal_Int32 GetGfxMode() const { return mnGfxMode; };
- void SetBkMode( UINT32 nMode );
+ void SetBkMode( sal_uInt32 nMode );
void SetBkColor( const Color& rColor );
void SetTextColor( const Color& rColor );
- void SetTextAlign( UINT32 nAlign );
+ void SetTextAlign( sal_uInt32 nAlign );
void CreateObject( GDIObjectType, void* pStyle = NULL );
- void CreateObject( INT32 nIndex, GDIObjectType, void* pStyle = NULL );
- void DeleteObject( INT32 nIndex );
- void SelectObject( INT32 nIndex );
+ void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL );
+ void DeleteObject( sal_Int32 nIndex );
+ void SelectObject( sal_Int32 nIndex );
CharSet GetCharSet(){ return maFont.GetCharSet(); };
WinMtfFillStyle& GetFillStyle () { return maFillStyle; }
void SetFont( const Font& rFont );
@@ -661,10 +661,10 @@ class WinMtfOutput
void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False );
void DrawPixel( const Point& rSource, const Color& rColor );
void DrawLine( const Point& rSource, const Point& rDest );
- void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE );
+ void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True );
void DrawRoundRect( const Rectangle& rRect, const Size& rSize );
void DrawEllipse( const Rectangle& rRect );
- void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE );
+ void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, sal_Bool bDrawTo = sal_False );
void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False );
@@ -682,7 +682,7 @@ class WinMtfOutput
void UpdateClipRegion();
void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile );
- void PassEMFPlus( void* pBuffer, UINT32 nLength );
+ void PassEMFPlus( void* pBuffer, sal_uInt32 nLength );
void PassEMFPlusHeaderInfo();
WinMtfOutput( GDIMetaFile& rGDIMetaFile );
@@ -698,7 +698,7 @@ class WinMtf
WinMtfOutput* pOut; //
SvStream* pWMF; // Die einzulesende WMF/EMF-Datei
- UINT32 nStartPos, nEndPos;
+ sal_uInt32 nStartPos, nEndPos;
List aBmpSaveList;
FilterConfigItem* pFilterConfigItem;
@@ -708,7 +708,7 @@ class WinMtf
// Sorgt dafuer, das aSampledBrush der aktuelle Brush des GDIMetaFiles ist.
Color ReadColor();
- void Callback( USHORT nPercent );
+ void Callback( sal_uInt16 nPercent );
WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, FilterConfigItem* pConfigItem = NULL );
~WinMtf();
@@ -723,19 +723,19 @@ class EnhWMFReader : public WinMtf
{
sal_Bool bRecordPath;
sal_Int32 nRecordCount;
- BOOL bEMFPlus;
+ sal_Bool bEMFPlus;
- BOOL ReadHeader();
- Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck
- void ImplExtTextOut( BOOL bWideCharakter );
+ sal_Bool ReadHeader();
+ Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); // Liesst und konvertiert ein Rechteck
+ void ImplExtTextOut( sal_Bool bWideCharakter );
public:
EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL )
- : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus (FALSE) {};
+ : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus( sal_False ) {};
~EnhWMFReader();
- BOOL ReadEnhWMF();
+ sal_Bool ReadEnhWMF();
void ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC);
void ReadGDIComment();
};
@@ -747,7 +747,7 @@ class WMFReader : public WinMtf
private:
VirtualDevice aVDev; // just for the purpose of "IsFontAvailable"
- UINT16 nUnitsPerInch;
+ sal_uInt16 nUnitsPerInch;
sal_uInt32 nRecSize;
// embedded EMF data
@@ -767,10 +767,10 @@ private:
sal_uInt32 nUnicodeEscapeAction;
// Liesst den Kopf der WMF-Datei
- BOOL ReadHeader();
+ sal_Bool ReadHeader();
// Liesst die Parameter des Rocords mit der Funktionsnummer nFunction.
- void ReadRecordParams( USHORT nFunction );
+ void ReadRecordParams( sal_uInt16 nFunction );
Point ReadPoint(); // Liesst und konvertiert einen Punkt (erst X dann Y)
Point ReadYX(); // Liesst und konvertiert einen Punkt (erst Y dann X)
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx
index e2e9c4de3bd9..c7d33a824adf 100644
--- a/svtools/source/filter.vcl/wmf/winwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/winwmf.cxx
@@ -157,7 +157,7 @@ Size WMFReader::ReadYXExt()
// ------------------------------------------------------------------------
-void WMFReader::ReadRecordParams( USHORT nFunc )
+void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
switch( nFunc )
{
@@ -169,7 +169,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETBKMODE:
{
- USHORT nDat;
+ sal_uInt16 nDat;
*pWMF >> nDat;
pOut->SetBkMode( nDat );
}
@@ -186,7 +186,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETROP2:
{
- UINT16 nROP2;
+ sal_uInt16 nROP2;
*pWMF >> nROP2;
pOut->SetRasterOp( nROP2 );
}
@@ -323,7 +323,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYGON:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pWMF >> nPoints;
Polygon aPoly( nPoints );
for( i = 0; i < nPoints; i++ )
@@ -334,13 +334,13 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYPOLYGON:
{
- USHORT i, nPoly, nPoints;
- USHORT* pnPoints;
+ sal_uInt16 i, nPoly, nPoints;
+ sal_uInt16* pnPoints;
Point* pPtAry;
// Anzahl der Polygone:
*pWMF >> nPoly;
// Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
- pnPoints = new USHORT[ nPoly ];
+ pnPoints = new sal_uInt16[ nPoly ];
nPoints = 0;
for( i = 0; i < nPoly; i++ )
{
@@ -361,7 +361,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_POLYLINE:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pWMF >> nPoints;
Polygon aPoly( nPoints );
for( i = 0; i < nPoints; i++ )
@@ -397,7 +397,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_TEXTOUT:
{
- USHORT nLength;
+ sal_uInt16 nLength;
*pWMF >> nLength;
if ( nLength )
{
@@ -454,7 +454,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
sal_uInt32 nMaxStreamPos = nRecordPos + ( nRecordSize << 1 );
sal_Int32 nDxArySize = nMaxStreamPos - pWMF->Tell();
sal_Int32 nDxAryEntries = nDxArySize >> 1;
- sal_Bool bUseDXAry = FALSE;
+ sal_Bool bUseDXAry = sal_False;
if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( nNewTextLen <= nOriginalTextLen ) )
{
@@ -482,7 +482,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
pDXAry[ i ] = nDx;
}
if ( i == nNewTextLen )
- bUseDXAry = TRUE;
+ bUseDXAry = sal_True;
}
if ( pDXAry && bUseDXAry )
pOut->DrawText( aPosition, aText, pDXAry );
@@ -497,7 +497,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SELECTOBJECT:
{
- INT16 nObjIndex;
+ sal_Int16 nObjIndex;
*pWMF >> nObjIndex;
pOut->SelectObject( nObjIndex );
}
@@ -505,7 +505,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_SETTEXTALIGN:
{
- UINT16 nAlign;
+ sal_uInt16 nAlign;
*pWMF >> nAlign;
pOut->SetTextAlign( nAlign );
}
@@ -603,14 +603,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
if ( nWinROP == PATCOPY )
*pWMF >> nUsage; // i don't know anything of this parameter, so its called nUsage
- // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE );
+ // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False );
Size aDestSize( ReadYXExt() );
if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps
{
Rectangle aDestRect( ReadYX(), aDestSize );
if ( nWinROP != PATCOPY )
- aBmp.Read( *pWMF, FALSE );
+ aBmp.Read( *pWMF, sal_False );
// test if it is sensible to crop
if ( nSye && nSxe &&
@@ -630,18 +630,18 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
Bitmap aBmp;
BitmapReadAccess* pBmp;
- UINT32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1;
- UINT16 nFunction;
+ sal_uInt32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1;
+ sal_uInt16 nFunction;
*pWMF >> nFunction >> nFunction;
- aBmp.Read( *pWMF, FALSE );
+ aBmp.Read( *pWMF, sal_False );
pBmp = aBmp.AcquireReadAccess();
if ( pBmp )
{
- for ( INT32 y = 0; y < pBmp->Height(); y++ )
+ for ( sal_Int32 y = 0; y < pBmp->Height(); y++ )
{
- for ( INT32 x = 0; x < pBmp->Width(); x++ )
+ for ( sal_Int32 x = 0; x < pBmp->Width(); x++ )
{
const BitmapColor aColor( pBmp->GetColor( y, x ) );
@@ -655,14 +655,14 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
nCount++;
aBmp.ReleaseAccess( pBmp );
}
- Color aColor( (BYTE)( nRed / nCount ), (BYTE)( nGreen / nCount ), (BYTE)( nBlue / nCount ) );
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, FALSE ) );
+ Color aColor( (sal_uInt8)( nRed / nCount ), (sal_uInt8)( nGreen / nCount ), (sal_uInt8)( nBlue / nCount ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, sal_False ) );
}
break;
case W_META_DELETEOBJECT:
{
- INT16 nIndex;
+ sal_Int16 nIndex;
*pWMF >> nIndex;
pOut->DeleteObject( nIndex );
}
@@ -676,29 +676,29 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_CREATEBRUSH:
{
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) );
}
break;
case W_META_CREATEPATTERNBRUSH:
{
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), sal_False ) );
}
break;
case W_META_CREATEPENINDIRECT:
{
LineInfo aLineInfo;
- USHORT nStyle, nWidth, nHeight;
+ sal_uInt16 nStyle, nWidth, nHeight;
*pWMF >> nStyle >> nWidth >> nHeight;
if ( nWidth )
aLineInfo.SetWidth( nWidth );
- BOOL bTransparent = FALSE;
- UINT16 nDashCount = 0;
- UINT16 nDotCount = 0;
+ sal_Bool bTransparent = sal_False;
+ sal_uInt16 nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
switch( nStyle )
{
case PS_DASHDOTDOT :
@@ -712,7 +712,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
nDashCount++;
break;
case PS_NULL :
- bTransparent = TRUE;
+ bTransparent = sal_True;
aLineInfo.SetStyle( LINE_NONE );
break;
default :
@@ -732,9 +732,9 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_CREATEBRUSHINDIRECT:
{
- USHORT nStyle;
+ sal_uInt16 nStyle;
*pWMF >> nStyle;
- pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? sal_True : sal_False ) );
}
break;
@@ -742,7 +742,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
{
Size aFontSize;
char lfFaceName[ LF_FACESIZE ];
- INT16 lfEscapement, lfOrientation, lfWeight; // ( ehemals USHORT )
+ sal_Int16 lfEscapement, lfOrientation, lfWeight; // ( ehemals sal_uInt16 )
LOGFONTW aLogFont;
aFontSize = ReadYXExt();
@@ -797,11 +797,11 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
case W_META_PATBLT:
{
- UINT32 nROP, nOldROP;
+ sal_uInt32 nROP, nOldROP;
*pWMF >> nROP;
Size aSize = ReadYXExt();
nOldROP = pOut->SetRasterOp( nROP );
- pOut->DrawRect( Rectangle( ReadYX(), aSize ), FALSE );
+ pOut->DrawRect( Rectangle( ReadYX(), aSize ), sal_False );
pOut->SetRasterOp( nOldROP );
}
break;
@@ -997,7 +997,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
// ------------------------------------------------------------------------
-BOOL WMFReader::ReadHeader()
+sal_Bool WMFReader::ReadHeader()
{
Rectangle aPlaceableBound;
sal_uInt32 nl, nStrmPos = pWMF->Tell();
@@ -1008,7 +1008,7 @@ BOOL WMFReader::ReadHeader()
Size aWMFSize;
if ( nl == 0x9ac6cdd7L )
{
- INT16 nVal;
+ sal_Int16 nVal;
// hmf (Unused) ueberlesen wir
pWMF->SeekRel(2);
@@ -1056,7 +1056,7 @@ BOOL WMFReader::ReadHeader()
if( nl != 0x00090001 )
{
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
- return FALSE;
+ return sal_False;
}
pWMF->SeekRel( 2 ); // Version (von Windows)
@@ -1065,13 +1065,13 @@ BOOL WMFReader::ReadHeader()
pWMF->SeekRel( 4 ); // MaxRecord (Groesse des groessten Records in Words)
pWMF->SeekRel( 2 ); // NoParameters (Unused
- return TRUE;
+ return sal_True;
}
void WMFReader::ReadWMF()
{
- USHORT nFunction;
- ULONG nPos, nPercent, nLastPercent;
+ sal_uInt16 nFunction;
+ sal_uLong nPos, nPercent, nLastPercent;
nSkipActions = 0;
nCurrentAction = 0;
@@ -1091,7 +1091,7 @@ void WMFReader::ReadWMF()
nEndPos=pWMF->Seek( STREAM_SEEK_TO_END );
pWMF->Seek( nStartPos );
- Callback( (USHORT) ( nLastPercent = 0 ) );
+ Callback( (sal_uInt16) ( nLastPercent = 0 ) );
if ( ReadHeader() )
{
@@ -1100,14 +1100,14 @@ void WMFReader::ReadWMF()
if( nEndPos - nStartPos )
{
- while( TRUE )
+ while( sal_True )
{
nCurrentAction++;
nPercent = ( nPos - nStartPos ) * 100 / ( nEndPos - nStartPos );
if( nLastPercent + 4 <= nPercent )
{
- Callback( (USHORT) nPercent );
+ Callback( (sal_uInt16) nPercent );
nLastPercent = nPercent;
}
*pWMF >> nRecSize >> nFunction;
@@ -1289,7 +1289,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYGON:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pStm >> nPoints;
for( i = 0; i < nPoints; i++ )
GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode );
@@ -1298,7 +1298,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYPOLYGON:
{
- USHORT i, nPoly, nPoints = 0;
+ sal_uInt16 i, nPoly, nPoints = 0;
*pStm >> nPoly;
for( i = 0; i < nPoly; i++ )
{
@@ -1313,7 +1313,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_POLYLINE:
{
- USHORT i,nPoints;
+ sal_uInt16 i,nPoints;
*pStm >> nPoints;
for( i = 0; i < nPoints; i++ )
GetWinExtMax( ReadPoint(), rPlaceableBound, nMapMode );
@@ -1329,7 +1329,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_TEXTOUT:
{
- USHORT nLength;
+ sal_uInt16 nLength;
*pStm >> nLength;
// todo: we also have to take care of the text width
if ( nLength )
@@ -1383,7 +1383,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
{
if ( nWinROP == PATCOPY )
*pStm >> nUsage; // i don't know anything of this parameter, so its called nUsage
- // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE );
+ // pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), sal_False );
Size aDestSize( ReadYXExt() );
if ( aDestSize.Width() && aDestSize.Height() ) // #92623# do not try to read buggy bitmaps
@@ -1397,7 +1397,7 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
case W_META_PATBLT:
{
- UINT32 nROP;
+ sal_uInt32 nROP;
*pStm >> nROP;
Size aSize = ReadYXExt();
GetWinExtMax( Rectangle( ReadYX(), aSize ), rPlaceableBound, nMapMode );
diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter.vcl/wmf/wmf.cxx
index b56d9d07cc28..d78ce2d160bb 100644
--- a/svtools/source/filter.vcl/wmf/wmf.cxx
+++ b/svtools/source/filter.vcl/wmf/wmf.cxx
@@ -36,18 +36,18 @@
// -----------------------------------------------------------------------------
-BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem )
+sal_Bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem )
{
- UINT32 nMetaType;
- UINT32 nOrgPos = rStreamWMF.Tell();
- UINT16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt();
+ sal_uInt32 nMetaType;
+ sal_uInt32 nOrgPos = rStreamWMF.Tell();
+ sal_uInt16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt();
rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rStreamWMF.Seek( 0x28 );
rStreamWMF >> nMetaType;
rStreamWMF.Seek( nOrgPos );
if ( nMetaType == 0x464d4520 )
{
- if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == FALSE )
+ if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadEnhWMF() == sal_False )
rStreamWMF.SetError( SVSTREAM_FILEFORMAT_ERROR );
}
else
@@ -60,18 +60,18 @@ BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile,
// -----------------------------------------------------------------------------
-BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem )
+sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pFilterConfigItem )
{
- UINT32 nMetaType;
- UINT32 nOrgPos = rStream.Tell();
- UINT16 nOrigNumberFormat = rStream.GetNumberFormatInt();
+ sal_uInt32 nMetaType;
+ sal_uInt32 nOrgPos = rStream.Tell();
+ sal_uInt16 nOrigNumberFormat = rStream.GetNumberFormatInt();
rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rStream.Seek( 0x28 );
rStream >> nMetaType;
rStream.Seek( nOrgPos );
if ( nMetaType == 0x464d4520 )
{
- if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == FALSE )
+ if ( EnhWMFReader( rStream, rMTF, NULL ).ReadEnhWMF() == sal_False )
rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
}
else
@@ -84,8 +84,8 @@ BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem*
// -----------------------------------------------------------------------------
-BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
- FilterConfigItem* pConfigItem, BOOL bPlaceable)
+sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ FilterConfigItem* pConfigItem, sal_Bool bPlaceable)
{
WMFWriter aWMFWriter;
return aWMFWriter.WriteWMF( rMTF, rTargetStream, pConfigItem, bPlaceable );
@@ -93,7 +93,7 @@ BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream
// -----------------------------------------------------------------------------
-BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
FilterConfigItem* pConfigItem )
{
EMFWriter aEMFWriter(rTargetStream);
@@ -102,16 +102,16 @@ BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream
// -----------------------------------------------------------------------------
-BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF )
+sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF )
{
return WMFWriter().WriteWMF( rMTF, rStream, NULL );
}
// -----------------------------------------------------------------------------
-BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF )
+sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF )
{
- return WMFWriter().WriteWMF( rMTF, rStream, NULL, FALSE );
+ return WMFWriter().WriteWMF( rMTF, rStream, NULL, sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
index 5214918b9870..2e507f835e68 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -252,7 +252,7 @@ void WMFWriter::MayCallback()
{
if ( xStatusIndicator.is() )
{
- ULONG nPercent;
+ sal_uLong nPercent;
// Wir gehen mal einfach so davon aus, dass 16386 Actions einer Bitmap entsprechen
// (in der Regel wird ein Metafile entweder nur Actions oder einige Bitmaps und fast
@@ -273,7 +273,7 @@ void WMFWriter::MayCallback()
void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF )
{
- ULONG nAction, nActionCount;
+ sal_uLong nAction, nActionCount;
nActionCount = rMTF.GetActionCount();
@@ -341,7 +341,7 @@ void WMFWriter::WriteRectangle(const Rectangle & rRect)
void WMFWriter::WriteColor(const Color & rColor)
{
- *pWMF << (BYTE) rColor.GetRed() << (BYTE) rColor.GetGreen() << (BYTE) rColor.GetBlue() << (BYTE) 0;
+ *pWMF << (sal_uInt8) rColor.GetRed() << (sal_uInt8) rColor.GetGreen() << (sal_uInt8) rColor.GetBlue() << (sal_uInt8) 0;
}
@@ -355,12 +355,12 @@ void WMFWriter::WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType)
void WMFWriter::UpdateRecordHeader()
{
- ULONG nPos;
+ sal_uLong nPos;
sal_uInt32 nSize;
nPos=pWMF->Tell(); nSize=nPos-nActRecordPos;
if ((nSize & 1)!=0) {
- *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)0;
nPos++; nSize++;
}
nSize/=2;
@@ -393,19 +393,19 @@ void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor)
WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT);
if( rColor==Color(COL_TRANSPARENT) )
- *pWMF << (UINT16) W_BS_HOLLOW;
+ *pWMF << (sal_uInt16) W_BS_HOLLOW;
else
- *pWMF << (UINT16) W_BS_SOLID;
+ *pWMF << (sal_uInt16) W_BS_SOLID;
WriteColor( rColor );
- *pWMF << (UINT16) 0;
+ *pWMF << (sal_uInt16) 0;
}
void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
{
- USHORT nWeight,i;
- BYTE nPitchFamily;
+ sal_uInt16 nWeight,i;
+ sal_uInt8 nPitchFamily;
WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT);
WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
@@ -426,9 +426,9 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
}
*pWMF << nWeight;
- if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
- if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
- if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
+ if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
+ if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
+ if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (sal_uInt8)0; else *pWMF << (sal_uInt8)1;
CharSet eFontNameEncoding = rFont.GetCharSet();
sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontNameEncoding );
@@ -438,7 +438,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
nCharSet = W_ANSI_CHARSET;
*pWMF << nCharSet;
- *pWMF << (BYTE)0 << (BYTE)0 << (BYTE)0;
+ *pWMF << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0;
switch (rFont.GetPitch()) {
case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break;
@@ -467,7 +467,7 @@ void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo )
{
WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT);
- USHORT nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID;
+ sal_uInt16 nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID;
switch( rLineInfo.GetStyle() )
{
case LINE_DASH :
@@ -500,7 +500,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo&
WriteColor( rColor );
}
-void WMFWriter::WMFRecord_DeleteObject(USHORT nObjectHandle)
+void WMFWriter::WMFRecord_DeleteObject(sal_uInt16 nObjectHandle)
{
WriteRecordHeader(0x00000004,W_META_DELETEOBJECT);
*pWMF << nObjectHandle;
@@ -721,7 +721,7 @@ void WMFWriter::WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, c
void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
{
- USHORT nSize,i;
+ sal_uInt16 nSize,i;
Polygon aSimplePoly;
if ( rPoly.HasFlags() )
@@ -729,7 +729,7 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
else
aSimplePoly = rPoly;
nSize = aSimplePoly.GetSize();
- WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYGON);
+ WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYGON);
*pWMF << nSize;
for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i));
}
@@ -737,14 +737,14 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly)
{
- USHORT nSize,i;
+ sal_uInt16 nSize,i;
Polygon aSimplePoly;
if ( rPoly.HasFlags() )
rPoly.AdaptiveSubdivide( aSimplePoly );
else
aSimplePoly = rPoly;
nSize=aSimplePoly.GetSize();
- WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYLINE);
+ WriteRecordHeader(((sal_uLong)nSize)*2+4,W_META_POLYLINE);
*pWMF << nSize;
for (i=0; i<nSize; i++) WritePointXY(aSimplePoly.GetPoint(i));
}
@@ -753,7 +753,7 @@ void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly)
void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly)
{
const Polygon * pPoly;
- USHORT nCount,nSize,i,j;
+ sal_uInt16 nCount,nSize,i,j;
nCount=rPolyPoly.Count();
PolyPolygon aSimplePolyPoly( rPolyPoly );
@@ -768,7 +768,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly)
}
WriteRecordHeader(0,W_META_POLYPOLYGON);
*pWMF << nCount;
- for (i=0; i<nCount; i++) *pWMF << ((USHORT)(aSimplePolyPoly.GetObject(i).GetSize()));
+ for (i=0; i<nCount; i++) *pWMF << ((sal_uInt16)(aSimplePolyPoly.GetObject(i).GetSize()));
for (i=0; i<nCount; i++) {
pPoly=&(aSimplePolyPoly.GetObject(i));
nSize=pPoly->GetSize();
@@ -806,24 +806,24 @@ void WMFWriter::WMFRecord_SaveDC()
}
-void WMFWriter::WMFRecord_SelectObject(USHORT nObjectHandle)
+void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle)
{
WriteRecordHeader(0x00000004,W_META_SELECTOBJECT);
*pWMF << nObjectHandle;
}
-void WMFWriter::WMFRecord_SetBkMode(BOOL bTransparent)
+void WMFWriter::WMFRecord_SetBkMode(sal_Bool bTransparent)
{
WriteRecordHeader(0x00000004,W_META_SETBKMODE);
- if (bTransparent==TRUE) *pWMF << (USHORT)W_TRANSPARENT;
- else *pWMF << (USHORT)W_OPAQUE;
+ if (bTransparent==sal_True) *pWMF << (sal_uInt16)W_TRANSPARENT;
+ else *pWMF << (sal_uInt16)W_OPAQUE;
}
void WMFWriter::WMFRecord_SetStretchBltMode()
{
WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE );
- *pWMF << (USHORT) 3; // STRETCH_DELETESCANS
+ *pWMF << (sal_uInt16) 3; // STRETCH_DELETESCANS
}
void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
@@ -836,7 +836,7 @@ void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
void WMFWriter::WMFRecord_SetROP2(RasterOp eROP)
{
- USHORT nROP2;
+ sal_uInt16 nROP2;
switch (eROP) {
case ROP_INVERT: nROP2=W_R2_NOT; break;
@@ -848,9 +848,9 @@ void WMFWriter::WMFRecord_SetROP2(RasterOp eROP)
}
-void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign)
+void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign)
{
- USHORT nAlign;
+ sal_uInt16 nAlign;
switch (eFontAlign) {
case ALIGN_TOP: nAlign=W_TA_TOP; break;
@@ -889,7 +889,7 @@ void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint)
void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize,
const Bitmap & rBitmap, sal_uInt32 nROP )
{
- ULONG nPosAnf,nPosEnd;
+ sal_uLong nPosAnf,nPosEnd;
nActBitmapPercent=50;
MayCallback();
@@ -949,14 +949,14 @@ void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const String & rStr)
void WMFWriter::TrueTextOut(const Point & rPoint, const ByteString& rString)
{
- USHORT nLen,i;
+ sal_uInt16 nLen,i;
WriteRecordHeader(0,W_META_TEXTOUT);
nLen=rString.Len();
*pWMF << nLen;
for ( i = 0; i < nLen; i++ )
- *pWMF << (BYTE)rString.GetChar( i );
- if ((nLen&1)!=0) *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)rString.GetChar( i );
+ if ((nLen&1)!=0) *pWMF << (sal_uInt8)0;
WritePointYX(rPoint);
UpdateRecordHeader();
}
@@ -974,30 +974,30 @@ void WMFWriter::WMFRecord_IntersectClipRect( const Rectangle& rRect )
}
-USHORT WMFWriter::AllocHandle()
+sal_uInt16 WMFWriter::AllocHandle()
{
- USHORT i;
+ sal_uInt16 i;
for (i=0; i<MAXOBJECTHANDLES; i++) {
- if (bHandleAllocated[i]==FALSE) {
- bHandleAllocated[i]=TRUE;
+ if (bHandleAllocated[i]==sal_False) {
+ bHandleAllocated[i]=sal_True;
return i;
}
}
- bStatus=FALSE;
+ bStatus=sal_False;
return 0xffff;
}
-void WMFWriter::FreeHandle(USHORT nObjectHandle)
+void WMFWriter::FreeHandle(sal_uInt16 nObjectHandle)
{
- if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=FALSE;
+ if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=sal_False;
}
void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo )
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstPenHandle;
nDstPenHandle=AllocHandle();
@@ -1012,7 +1012,7 @@ void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLin
void WMFWriter::CreateSelectDeleteFont(const Font & rFont)
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstFontHandle;
nDstFontHandle=AllocHandle();
@@ -1027,7 +1027,7 @@ void WMFWriter::CreateSelectDeleteFont(const Font & rFont)
void WMFWriter::CreateSelectDeleteBrush(const Color& rColor)
{
- USHORT nOldHandle;
+ sal_uInt16 nOldHandle;
nOldHandle=nDstBrushHandle;
nDstBrushHandle=AllocHandle();
@@ -1059,7 +1059,7 @@ void WMFWriter::SetLineAndFillAttr()
CreateSelectDeleteBrush( aDstFillColor );
}
if ( bDstIsClipping != bSrcIsClipping ||
- (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) {
+ (bSrcIsClipping==sal_True && aDstClipRegion!=aSrcClipRegion)) {
bDstIsClipping=bSrcIsClipping;
aDstClipRegion=aSrcClipRegion;
}
@@ -1144,7 +1144,7 @@ void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx:
void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
{
- ULONG nA, nACount;
+ sal_uLong nA, nACount;
MetaAction* pMA;
if( bStatus )
@@ -1663,8 +1663,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- for ( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
@@ -1767,9 +1767,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
MayCallback();
if (pWMF->GetError())
- bStatus=FALSE;
+ bStatus=sal_False;
- if(bStatus==FALSE)
+ if(bStatus==sal_False)
break;
}
}
@@ -1777,13 +1777,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
// ------------------------------------------------------------------------
-void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
+void WMFWriter::WriteHeader( const GDIMetaFile &, sal_Bool bPlaceable )
{
if( bPlaceable )
{
- USHORT nCheckSum, nValue;
+ sal_uInt16 nCheckSum, nValue;
Size aSize( pVirDev->LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) );
- USHORT nUnitsPerInch = (USHORT) ( ( aSize.Width() + aSize.Height() ) >> 1 );
+ sal_uInt16 nUnitsPerInch = (sal_uInt16) ( ( aSize.Width() + aSize.Height() ) >> 1 );
nCheckSum=0;
nValue=0xcdd7; nCheckSum^=nValue; *pWMF << nValue;
@@ -1791,8 +1791,8 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
- nValue=(USHORT) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue;
- nValue=(USHORT) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(sal_uInt16) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(sal_uInt16) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue;
nValue=nUnitsPerInch; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
@@ -1813,13 +1813,13 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, BOOL bPlaceable )
void WMFWriter::UpdateHeader()
{
- ULONG nPos;
+ sal_uLong nPos;
sal_uInt32 nFileSize;
nPos=pWMF->Tell(); // Endposition = Gesammtgroesse der Datei
nFileSize=nPos-nMetafileHeaderPos; // Groesse des 1. Headers abziehen
if ((nFileSize&1)!=0) { // ggf. auf ganze Worte aufrunden
- *pWMF << (BYTE)0;
+ *pWMF << (sal_uInt8)0;
nPos++;
nFileSize++;
}
@@ -1833,13 +1833,13 @@ void WMFWriter::UpdateHeader()
// ------------------------------------------------------------------------
-BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
- FilterConfigItem* pFConfigItem, BOOL bPlaceable )
+sal_Bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
+ FilterConfigItem* pFConfigItem, sal_Bool bPlaceable )
{
WMFWriterAttrStackMember * pAt;
- bEmbedEMF = TRUE;
- bStatus=TRUE;
+ bEmbedEMF = sal_True;
+ bStatus=sal_True;
pConvert = 0;
pVirDev = new VirtualDevice;
@@ -1886,8 +1886,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
pAttrStack=NULL;
- for (USHORT i=0; i<MAXOBJECTHANDLES; i++)
- bHandleAllocated[i]=FALSE;
+ for (sal_uInt16 i=0; i<MAXOBJECTHANDLES; i++)
+ bHandleAllocated[i]=sal_False;
nDstPenHandle=0xffff;
nDstFontHandle=0xffff;
@@ -1906,7 +1906,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
WriteEmbeddedEMF( rMTF );
WMFRecord_SetWindowOrg(Point(0,0));
WMFRecord_SetWindowExt(rMTF.GetPrefSize());
- WMFRecord_SetBkMode( TRUE );
+ WMFRecord_SetBkMode( sal_True );
eDstROP2 = eSrcRasterOp = ROP_OVERPAINT;
WMFRecord_SetROP2(eDstROP2);
@@ -1919,7 +1919,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
CreateSelectDeleteBrush( aDstFillColor );
aDstClipRegion = aSrcClipRegion = Region();
- bDstIsClipping = bSrcIsClipping = FALSE;
+ bDstIsClipping = bSrcIsClipping = sal_False;
Font aFont;
aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
@@ -1959,11 +1959,11 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
// ------------------------------------------------------------------------
-USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
+sal_uInt16 WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
const Size& rPrefSize)
{
Fraction aDivFrac(2, 1);
- USHORT nDivisor = 1;
+ sal_uInt16 nDivisor = 1;
Size aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx
index 22fe8efb2256..42aa647d78c2 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx
@@ -70,9 +70,9 @@ class WMFWriter
{
private:
- BOOL bStatus;
+ sal_Bool bStatus;
- ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+ sal_uLong nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
FilterConfigItem* pFilterConfigItem;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
@@ -82,11 +82,11 @@ private:
StarSymbolToMSMultiFont *pConvert;
MapMode aTargetMapMode;
Size aTargetSize;
- USHORT nTargetDivisor;
+ sal_uInt16 nTargetDivisor;
- ULONG nMetafileHeaderPos;
+ sal_uLong nMetafileHeaderPos;
sal_uInt32 nMaxRecordSize; // in Worten
- ULONG nActRecordPos;
+ sal_uLong nActRecordPos;
// Aktuelle Attribute im Quell-Metafile:
Color aSrcLineColor;
@@ -97,11 +97,11 @@ private:
FontAlign eSrcTextAlign;
Font aSrcFont;
MapMode aSrcMapMode;
- BOOL bSrcIsClipping;
+ sal_Bool bSrcIsClipping;
Region aSrcClipRegion;
WMFWriterAttrStackMember * pAttrStack;
- UINT32 eSrcHorTextAlign;
+ sal_uInt32 eSrcHorTextAlign;
// Aktuelle Attribute im Ziel-Metafile:
Color aDstLineColor;
@@ -112,28 +112,28 @@ private:
FontAlign eDstTextAlign;
Font aDstFont;
- UINT32 eDstHorTextAlign;
+ sal_uInt32 eDstHorTextAlign;
- BOOL bDstIsClipping; // ???: derzeit unberuecksichtigt
+ sal_Bool bDstIsClipping; // ???: derzeit unberuecksichtigt
Region aDstClipRegion; // ???: derzeit unberuecksichtigt
- BOOL bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind
- USHORT nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen
+ sal_Bool bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind
+ sal_uInt16 nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen
// Selected-Objects besitzen
// 0xffff = keines:
// Damit nicht bei jeder Operation alle Attribute verglichen werden muessen:
- ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile
- ULONG nNumberOfBitmaps; // Anzahl der Bitmaps
- ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
- ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
- ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+ sal_uLong nNumberOfActions; // Anzahl der Actions im GDIMetafile
+ sal_uLong nNumberOfBitmaps; // Anzahl der Bitmaps
+ sal_uLong nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
+ sal_uLong nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
+ sal_uLong nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
- BOOL bEmbedEMF; // optionally embedd EMF data into WMF
+ sal_Bool bEmbedEMF; // optionally embedd EMF data into WMF
void MayCallback();
// Berechnet anhand der obigen 5 Parameter eine Prozentzahl
- // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
+ // und macht dann ggf. einen Callback. Setzt bStatus auf sal_False wenn User abbrechen
// moechte.
void CountActionsAndBitmaps(const GDIMetaFile & rMTF);
@@ -155,14 +155,14 @@ private:
void UpdateRecordHeader();
// berichtig die Groesse des Records nach dem Schreiben der Parameter, wenn
// nSizeWords bei Aufruf von WriteRecordHeader(..) unbekannt war.
- // fuegt ggf. noch ein BYTE 0 ein damit Anzahl Bytes immer gerade.
+ // fuegt ggf. noch ein sal_uInt8 0 ein damit Anzahl Bytes immer gerade.
void WMFRecord_Arc(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
void WMFRecord_Chord(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
void WMFRecord_CreateBrushIndirect(const Color& rColor);
void WMFRecord_CreateFontIndirect(const Font & rFont);
void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo );
- void WMFRecord_DeleteObject(USHORT nObjectHandle);
+ void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle);
void WMFRecord_Ellipse(const Rectangle & rRect);
void WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData );
sal_Bool WMFRecord_Escape_Unicode( const Point& rPoint, const String& rStr, const sal_Int32 * pDXAry );
@@ -181,12 +181,12 @@ private:
void WMFRecord_RestoreDC();
void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound);
void WMFRecord_SaveDC();
- void WMFRecord_SelectObject(USHORT nObjectHandle);
- void WMFRecord_SetBkMode(BOOL bTransparent);
+ void WMFRecord_SelectObject(sal_uInt16 nObjectHandle);
+ void WMFRecord_SetBkMode(sal_Bool bTransparent);
void WMFRecord_SetStretchBltMode();
void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor);
void WMFRecord_SetROP2(RasterOp eROP);
- void WMFRecord_SetTextAlign(FontAlign eFontAlign, UINT32 eHorTextAlign);
+ void WMFRecord_SetTextAlign(FontAlign eFontAlign, sal_uInt32 eHorTextAlign);
void WMFRecord_SetTextColor(const Color & rColor);
void WMFRecord_SetWindowExt(const Size & rSize);
void WMFRecord_SetWindowOrg(const Point & rPoint);
@@ -195,8 +195,8 @@ private:
void WMFRecord_EndOfFile();
void WMFRecord_IntersectClipRect( const Rectangle& rRect);
- USHORT AllocHandle();
- void FreeHandle(USHORT nObjectHandle);
+ sal_uInt16 AllocHandle();
+ void FreeHandle(sal_uInt16 nObjectHandle);
void CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo );
void CreateSelectDeleteFont(const Font & rFont);
void CreateSelectDeleteBrush(const Color& rColor);
@@ -207,7 +207,7 @@ private:
void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void WriteRecords(const GDIMetaFile & rMTF);
- void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable);
+ void WriteHeader(const GDIMetaFile & rMTF, sal_Bool bPlaceable);
void UpdateHeader();
void WriteEmbeddedEMF( const GDIMetaFile& rMTF );
@@ -217,13 +217,13 @@ private:
sal_uInt32 nRecCounts,
sal_uInt16 nCheckSum );
- USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
+ sal_uInt16 CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
public:
WMFWriter() {}
- BOOL WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, BOOL bPlaceable=TRUE);
+ sal_Bool WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem, sal_Bool bPlaceable=sal_True);
};
#endif
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index c3929f5007d0..5a2ed9d9df1b 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -458,7 +458,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
case( UNOGRAPHIC_BITSPERPIXEL ):
{
- USHORT nBitsPerPixel = 0;
+ sal_uInt16 nBitsPerPixel = 0;
if( mpGraphic )
{
diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx
index 38d0241dcd0d..2eeff29b9927 100644
--- a/svtools/source/graphic/descriptor.hxx
+++ b/svtools/source/graphic/descriptor.hxx
@@ -124,7 +124,7 @@ private:
::rtl::OUString maMimeType;
Size maSizePixel;
Size maSize100thMM;
- USHORT mnBitsPerPixel;
+ sal_uInt16 mnBitsPerPixel;
bool mbTransparent;
bool mbAlpha;
bool mbAnimated;
diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx
index 3515ed276529..a85cd90df079 100644
--- a/svtools/source/graphic/grfattr.cxx
+++ b/svtools/source/graphic/grfattr.cxx
@@ -49,7 +49,7 @@ GraphicAttr::GraphicAttr() :
mnRPercent ( 0 ),
mnGPercent ( 0 ),
mnBPercent ( 0 ),
- mbInvert ( FALSE ),
+ mbInvert ( sal_False ),
mcTransparency ( 0 ),
meDrawMode ( GRAPHICDRAWMODE_STANDARD )
{
@@ -63,7 +63,7 @@ GraphicAttr::~GraphicAttr()
// ------------------------------------------------------------------------
-BOOL GraphicAttr::operator==( const GraphicAttr& rAttr ) const
+sal_Bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
{
return( ( mfGamma == rAttr.mfGamma ) &&
( mnMirrFlags == rAttr.mnMirrFlags ) &&
@@ -88,7 +88,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr )
{
VersionCompat aCompat( rIStm, STREAM_READ );
sal_uInt32 nTmp32;
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp32 >> nTmp32 >> rAttr.mfGamma >> rAttr.mnMirrFlags >> rAttr.mnRotate10;
rIStm >> rAttr.mnContPercent >> rAttr.mnLumPercent >> rAttr.mnRPercent >> rAttr.mnGPercent >> rAttr.mnBPercent;
@@ -112,7 +112,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr )
rOStm << nTmp32 << nTmp32 << rAttr.mfGamma << rAttr.mnMirrFlags << rAttr.mnRotate10;
rOStm << rAttr.mnContPercent << rAttr.mnLumPercent << rAttr.mnRPercent << rAttr.mnGPercent << rAttr.mnBPercent;
- rOStm << rAttr.mbInvert << rAttr.mcTransparency << (UINT16) rAttr.meDrawMode;
+ rOStm << rAttr.mbInvert << rAttr.mcTransparency << (sal_uInt16) rAttr.meDrawMode;
rOStm << rAttr.mnLeftCrop << rAttr.mnTopCrop << rAttr.mnRightCrop << rAttr.mnBottomCrop;
return rOStm;
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 129ea5b5721e..658cf983bcb5 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -71,14 +71,14 @@ public:
GraphicID( const GraphicObject& rObj );
~GraphicID() {}
- BOOL operator==( const GraphicID& rID ) const
+ sal_Bool operator==( const GraphicID& rID ) const
{
return( rID.mnID1 == mnID1 && rID.mnID2 == mnID2 &&
rID.mnID3 == mnID3 && rID.mnID4 == mnID4 );
}
ByteString GetIDString() const;
- BOOL IsEmpty() const { return( 0 == mnID4 ); }
+ sal_Bool IsEmpty() const { return( 0 == mnID4 ); }
};
// -----------------------------------------------------------------------------
@@ -87,7 +87,7 @@ GraphicID::GraphicID( const GraphicObject& rObj )
{
const Graphic& rGraphic = rObj.GetGraphic();
- mnID1 = ( (ULONG) rGraphic.GetType() ) << 28;
+ mnID1 = ( (sal_uLong) rGraphic.GetType() ) << 28;
switch( rGraphic.GetType() )
{
@@ -106,7 +106,7 @@ GraphicID::GraphicID( const GraphicObject& rObj )
{
const BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- mnID1 |= ( ( ( (ULONG) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff );
+ mnID1 |= ( ( ( (sal_uLong) aBmpEx.GetTransparentType() << 8 ) | ( aBmpEx.IsAlpha() ? 1 : 0 ) ) & 0x0fffffff );
mnID2 = aBmpEx.GetSizePixel().Width();
mnID3 = aBmpEx.GetSizePixel().Height();
mnID4 = rGraphic.GetChecksum();
@@ -168,9 +168,9 @@ private:
BitmapEx* mpBmpEx;
GDIMetaFile* mpMtf;
Animation* mpAnimation;
- BOOL mbSwappedAll;
+ sal_Bool mbSwappedAll;
- BOOL ImplInit( const GraphicObject& rObj );
+ sal_Bool ImplInit( const GraphicObject& rObj );
void ImplFillSubstitute( Graphic& rSubstitute );
public:
@@ -181,13 +181,13 @@ public:
const GraphicID& GetID() const { return maID; }
void AddGraphicObjectReference( const GraphicObject& rObj, Graphic& rSubstitute );
- BOOL ReleaseGraphicObjectReference( const GraphicObject& rObj );
- ULONG GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); }
- BOOL HasGraphicObjectReference( const GraphicObject& rObj );
+ sal_Bool ReleaseGraphicObjectReference( const GraphicObject& rObj );
+ sal_uLong GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); }
+ sal_Bool HasGraphicObjectReference( const GraphicObject& rObj );
void TryToSwapIn();
void GraphicObjectWasSwappedOut( const GraphicObject& rObj );
- BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
void GraphicObjectWasSwappedIn( const GraphicObject& rObj );
};
@@ -216,9 +216,9 @@ GraphicCacheEntry::~GraphicCacheEntry()
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
{
- BOOL bRet;
+ sal_Bool bRet;
if( !rObj.IsSwappedOut() )
{
@@ -260,10 +260,10 @@ BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
else
maGfxLink = GfxLink();
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -277,9 +277,9 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() );
const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() );
const String aDocFileName( rSubstitute.GetDocFileName() );
- const ULONG nDocFilePos = rSubstitute.GetDocFilePos();
+ const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos();
const GraphicType eOldType = rSubstitute.GetType();
- const BOOL bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
+ const sal_Bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) )
maGfxLink = rSubstitute.GetLink();
@@ -321,16 +321,16 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() )
{
if( &rObj == (GraphicObject*) pObj )
{
maGraphicObjectList.Remove( pObj );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -339,13 +339,13 @@ BOOL GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj )
+sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() )
if( &rObj == (GraphicObject*) pObj )
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -362,11 +362,11 @@ void GraphicCacheEntry::TryToSwapIn()
void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*/ )
{
- mbSwappedAll = TRUE;
+ mbSwappedAll = sal_True;
for( void* pObj = maGraphicObjectList.First(); mbSwappedAll && pObj; pObj = maGraphicObjectList.Next() )
if( !( (GraphicObject*) pObj )->IsSwappedOut() )
- mbSwappedAll = FALSE;
+ mbSwappedAll = sal_False;
if( mbSwappedAll )
{
@@ -378,17 +378,17 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*
// -----------------------------------------------------------------------------
-BOOL GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
- BOOL bRet;
+ sal_Bool bRet;
if( !mbSwappedAll && rObj.IsSwappedOut() )
{
ImplFillSubstitute( rSubstitute );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -415,13 +415,13 @@ private:
BitmapEx* mpBmpEx;
GraphicAttr maAttr;
Size maOutSizePix;
- ULONG mnCacheSize;
- ULONG mnOutDevDrawMode;
- USHORT mnOutDevBitCount;
+ sal_uLong mnCacheSize;
+ sal_uLong mnOutDevDrawMode;
+ sal_uInt16 mnOutDevBitCount;
public:
- static ULONG GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ static sal_uLong GetNeededSize( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr );
public:
@@ -457,15 +457,15 @@ public:
const GraphicAttr& GetAttr() const { return maAttr; }
const Size& GetOutputSizePixel() const { return maOutSizePix; }
- ULONG GetCacheSize() const { return mnCacheSize; }
+ sal_uLong GetCacheSize() const { return mnCacheSize; }
const GraphicCacheEntry* GetReferencedCacheEntry() const { return mpRefCacheEntry; }
- ULONG GetOutDevDrawMode() const { return mnOutDevDrawMode; }
- USHORT GetOutDevBitCount() const { return mnOutDevBitCount; }
+ sal_uLong GetOutDevDrawMode() const { return mnOutDevDrawMode; }
+ sal_uInt16 GetOutDevBitCount() const { return mnOutDevBitCount; }
void SetReleaseTime( const ::salhelper::TTimeValue& rReleaseTime ) { maReleaseTime = rReleaseTime; }
const ::salhelper::TTimeValue& GetReleaseTime() const { return maReleaseTime; }
- BOOL Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel,
+ sal_Bool Matches( OutputDevice* pOut, const Point& /*rPtPixel*/, const Size& rSzPixel,
const GraphicCacheEntry* pCacheEntry, const GraphicAttr& rAttr ) const
{
// #i46805# Additional match
@@ -486,12 +486,12 @@ public:
// -----------------------------------------------------------------------------
-ULONG GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz,
+sal_uLong GraphicDisplayCacheEntry::GetNeededSize( OutputDevice* pOut, const Point& /*rPt*/, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr )
{
const Graphic& rGraphic = rObj.GetGraphic();
const GraphicType eType = rGraphic.GetType();
- ULONG nNeededSize;
+ sal_uLong nNeededSize;
if( GRAPHIC_BITMAP == eType )
{
@@ -560,7 +560,7 @@ void GraphicDisplayCacheEntry::Draw( OutputDevice* pOut, const Point& rPt, const
// - GraphicCache -
// -----------------------
-GraphicCache::GraphicCache( GraphicManager& rMgr, ULONG nDisplayCacheSize, ULONG nMaxObjDisplayCacheSize ) :
+GraphicCache::GraphicCache( GraphicManager& rMgr, sal_uLong nDisplayCacheSize, sal_uLong nMaxObjDisplayCacheSize ) :
mrMgr ( rMgr ),
mnReleaseTimeoutSeconds ( 0UL ),
mnMaxDisplaySize ( nDisplayCacheSize ),
@@ -585,7 +585,7 @@ GraphicCache::~GraphicCache()
void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute,
const ByteString* pID, const GraphicObject* pCopyObj )
{
- BOOL bInserted = FALSE;
+ sal_Bool bInserted = sal_False;
if( !rObj.IsSwappedOut() &&
( pID || ( pCopyObj && ( pCopyObj->GetType() != GRAPHIC_NONE ) ) || ( rObj.GetType() != GRAPHIC_NONE ) ) )
@@ -599,7 +599,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( pEntry->HasGraphicObjectReference( *pCopyObj ) )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
else
{
@@ -640,14 +640,14 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( rID.GetIDString() == *pID )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
if( !bInserted )
{
maGraphicCache.Insert( new GraphicCacheEntry( rObj ), LIST_APPEND );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
}
@@ -656,7 +656,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti
if( rEntryID == *apID )
{
pEntry->AddGraphicObjectReference( rObj, rSubstitute );
- bInserted = TRUE;
+ bInserted = sal_True;
}
}
@@ -676,7 +676,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj )
{
// Release cached object
GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First();
- BOOL bRemoved = FALSE;
+ sal_Bool bRemoved = sal_False;
while( !bRemoved && pEntry )
{
@@ -729,12 +729,12 @@ void GraphicCache::GraphicObjectWasSwappedOut( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-BOOL GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicCache::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
GraphicCacheEntry* pEntry = ImplGetCacheEntry( rObj );
if( !pEntry )
- return FALSE;
+ return sal_False;
return pEntry->FillSwappedGraphicObject( rObj, rSubstitute );
}
@@ -759,7 +759,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize )
+void GraphicCache::SetMaxDisplayCacheSize( sal_uLong nNewCacheSize )
{
mnMaxDisplaySize = nNewCacheSize;
@@ -769,9 +769,9 @@ void GraphicCache::SetMaxDisplayCacheSize( ULONG nNewCacheSize )
// -----------------------------------------------------------------------------
-void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached )
+void GraphicCache::SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached )
{
- const BOOL bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) );
+ const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) );
mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize );
@@ -796,7 +796,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestro
// -----------------------------------------------------------------------------
-void GraphicCache::SetCacheTimeout( ULONG nTimeoutSeconds )
+void GraphicCache::SetCacheTimeout( sal_uLong nTimeoutSeconds )
{
if( mnReleaseTimeoutSeconds != nTimeoutSeconds )
{
@@ -830,7 +830,7 @@ void GraphicCache::ClearDisplayCache()
// -----------------------------------------------------------------------------
-BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const
{
return( GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) <=
@@ -839,20 +839,20 @@ BOOL GraphicCache::IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, con
// -----------------------------------------------------------------------------
-BOOL GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const
{
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
//GraphicDisplayCacheEntry* pDisplayEntry = (GraphicDisplayCacheEntry*) ( (GraphicCache*) this )->maDisplayCache.First(); // -Wall removed ....
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
if( pCacheEntry )
{
for( long i = 0, nCount = maDisplayCache.Count(); !bFound && ( i < nCount ); i++ )
if( ( (GraphicDisplayCacheEntry*) maDisplayCache.GetObject( i ) )->Matches( pOut, aPtPixel, aSzPixel, pCacheEntry, rAttr ) )
- bFound = TRUE;
+ bFound = sal_True;
}
return bFound;
@@ -880,12 +880,12 @@ ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const
// -----------------------------------------------------------------------------
-BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const BitmapEx& rBmpEx )
{
- const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
- BOOL bRet = FALSE;
+ const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
+ sal_Bool bRet = sal_False;
if( nNeededSize <= GetMaxObjDisplayCacheSize() )
{
@@ -906,7 +906,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
maDisplayCache.Insert( pNewEntry, LIST_APPEND );
mnUsedDisplaySize += pNewEntry->GetCacheSize();
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -914,12 +914,12 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const GDIMetaFile& rMtf )
{
- const ULONG nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
- BOOL bRet = FALSE;
+ const sal_uLong nNeededSize = GraphicDisplayCacheEntry::GetNeededSize( pOut, rPt, rSz, rObj, rAttr );
+ sal_Bool bRet = sal_False;
if( nNeededSize <= GetMaxObjDisplayCacheSize() )
{
@@ -940,7 +940,7 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
maDisplayCache.Insert( pNewEntry, LIST_APPEND );
mnUsedDisplaySize += pNewEntry->GetCacheSize();
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -948,14 +948,14 @@ BOOL GraphicCache::CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr )
{
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj );
GraphicDisplayCacheEntry* pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.First();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( !bRet && pDisplayCacheEntry )
{
@@ -973,7 +973,7 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
}
pDisplayCacheEntry->SetReleaseTime( aReleaseTime );
- bRet = TRUE;
+ bRet = sal_True;
}
else
pDisplayCacheEntry = (GraphicDisplayCacheEntry*) maDisplayCache.Next();
@@ -987,9 +987,9 @@ BOOL GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
// -----------------------------------------------------------------------------
-BOOL GraphicCache::ImplFreeDisplayCacheSpace( ULONG nSizeToFree )
+sal_Bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree )
{
- ULONG nFreedSize = 0UL;
+ sal_uLong nFreedSize = 0UL;
if( nSizeToFree )
{
diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx
index a2b7593d159b..cfa946f6bca9 100644
--- a/svtools/source/graphic/grfcache.hxx
+++ b/svtools/source/graphic/grfcache.hxx
@@ -47,12 +47,12 @@ private:
Timer maReleaseTimer;
List maGraphicCache;
List maDisplayCache;
- ULONG mnReleaseTimeoutSeconds;
- ULONG mnMaxDisplaySize;
- ULONG mnMaxObjDisplaySize;
- ULONG mnUsedDisplaySize;
+ sal_uLong mnReleaseTimeoutSeconds;
+ sal_uLong mnMaxDisplaySize;
+ sal_uLong mnMaxObjDisplaySize;
+ sal_uLong mnUsedDisplaySize;
- BOOL ImplFreeDisplayCacheSpace( ULONG nSizeToFree );
+ sal_Bool ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree );
GraphicCacheEntry* ImplGetCacheEntry( const GraphicObject& rObj );
@@ -61,8 +61,8 @@ private:
public:
GraphicCache( GraphicManager& rMgr,
- ULONG nDisplayCacheSize = 10000000UL,
- ULONG nMaxObjDisplayCacheSize = 2400000UL );
+ sal_uLong nDisplayCacheSize = 10000000UL,
+ sal_uLong nMaxObjDisplayCacheSize = 2400000UL );
~GraphicCache();
public:
@@ -72,37 +72,37 @@ public:
void ReleaseGraphicObject( const GraphicObject& rObj );
void GraphicObjectWasSwappedOut( const GraphicObject& rObj );
- BOOL FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
+ sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute );
void GraphicObjectWasSwappedIn( const GraphicObject& rObj );
ByteString GetUniqueID( const GraphicObject& rObj ) const;
public:
- void SetMaxDisplayCacheSize( ULONG nNewCacheSize );
- ULONG GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; };
+ void SetMaxDisplayCacheSize( sal_uLong nNewCacheSize );
+ sal_uLong GetMaxDisplayCacheSize() const { return mnMaxDisplaySize; };
- void SetMaxObjDisplayCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE );
- ULONG GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; }
+ void SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False );
+ sal_uLong GetMaxObjDisplayCacheSize() const { return mnMaxObjDisplaySize; }
- ULONG GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; }
- ULONG GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); }
+ sal_uLong GetUsedDisplayCacheSize() const { return mnUsedDisplaySize; }
+ sal_uLong GetFreeDisplayCacheSize() const { return( mnMaxDisplaySize - mnUsedDisplaySize ); }
- void SetCacheTimeout( ULONG nTimeoutSeconds );
- ULONG GetCacheTimeout() const { return mnReleaseTimeoutSeconds; }
+ void SetCacheTimeout( sal_uLong nTimeoutSeconds );
+ sal_uLong GetCacheTimeout() const { return mnReleaseTimeoutSeconds; }
void ClearDisplayCache();
- BOOL IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool IsDisplayCacheable( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
- BOOL IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr ) const;
- BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const BitmapEx& rBmpEx );
- BOOL CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool CreateDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr,
const GDIMetaFile& rMtf );
- BOOL DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ sal_Bool DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GraphicObject& rObj, const GraphicAttr& rAttr );
};
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 303da056933e..9e7d635b9731 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -143,9 +143,9 @@ void GraphicObject::ImplConstruct()
mpSwapOutTimer = NULL;
mpSimpleCache = NULL;
mnAnimationLoopCount = 0;
- mbAutoSwapped = FALSE;
- mbIsInSwapIn = FALSE;
- mbIsInSwapOut = FALSE;
+ mbAutoSwapped = sal_False;
+ mbIsInSwapIn = sal_False;
+ mbIsInSwapOut = sal_False;
}
void GraphicObject::ImplAssignGraphicData()
@@ -165,7 +165,7 @@ void GraphicObject::ImplAssignGraphicData()
mbEPS = ( rMtf.GetActionCount() >= 1 ) && ( META_EPS_ACTION == rMtf.GetAction( 0 )->GetType() );
}
else
- mbEPS = FALSE;
+ mbEPS = sal_False;
}
void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const ByteString* pID, const GraphicObject* pCopyObj )
@@ -210,13 +210,13 @@ void GraphicObject::ImplAutoSwapIn()
if( IsSwappedOut() )
{
if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
else
{
- mbIsInSwapIn = TRUE;
+ mbIsInSwapIn = sal_True;
if( maGraphic.SwapIn() )
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
else
{
SvStream* pStream = GetSwapStream();
@@ -259,7 +259,7 @@ void GraphicObject::ImplAutoSwapIn()
}
}
- mbIsInSwapIn = FALSE;
+ mbIsInSwapIn = sal_False;
if( !mbAutoSwapped && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedIn( *this );
@@ -267,15 +267,15 @@ void GraphicObject::ImplAutoSwapIn()
}
}
-BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
- PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const
+sal_Bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
+ PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( GetType() != GRAPHIC_NONE )
{
Polygon aClipPoly( Rectangle( rPt, rSz ) );
- const USHORT nRot10 = pAttr->GetRotation() % 3600;
+ const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600;
const Point aOldOrigin( rPt );
const MapMode aMap100( MAP_100TH_MM );
Size aSize100;
@@ -286,10 +286,10 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
if( nRot10 )
{
aClipPoly.Rotate( rPt, nRot10 );
- bRectClipRegion = FALSE;
+ bRectClipRegion = sal_False;
}
else
- bRectClipRegion = TRUE;
+ bRectClipRegion = sal_True;
rClipPolyPoly = aClipPoly;
@@ -332,7 +332,7 @@ BOOL GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
rPt = aOriginPoly[ 0 ];
}
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -355,7 +355,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
mpLink = rGraphicObj.mpLink ? new String( *rGraphicObj.mpLink ) : NULL;
mpUserData = rGraphicObj.mpUserData ? new String( *rGraphicObj.mpUserData ) : NULL;
ImplAssignGraphicData();
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
mpMgr = rGraphicObj.mpMgr;
mpMgr->ImplRegisterObj( *this, maGraphic, NULL, &rGraphicObj );
@@ -364,7 +364,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
return *this;
}
-BOOL GraphicObject::operator==( const GraphicObject& rGraphicObj ) const
+sal_Bool GraphicObject::operator==( const GraphicObject& rGraphicObj ) const
{
return( ( rGraphicObj.maGraphic == maGraphic ) &&
( rGraphicObj.maAttr == maAttr ) &&
@@ -399,7 +399,7 @@ ByteString GraphicObject::GetUniqueID() const
return aRet;
}
-ULONG GraphicObject::GetChecksum() const
+sal_uLong GraphicObject::GetChecksum() const
{
return( ( maGraphic.IsSupportedGraphic() && !maGraphic.IsSwapOut() ) ? maGraphic.GetChecksum() : 0 );
}
@@ -410,7 +410,7 @@ SvStream* GraphicObject::GetSwapStream() const
}
// !!! to be removed
-ULONG GraphicObject::GetReleaseFromCache() const
+sal_uLong GraphicObject::GetReleaseFromCache() const
{
return 0;
}
@@ -470,7 +470,7 @@ void GraphicObject::SetSwapStreamHdl()
}
}
-void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout )
+void GraphicObject::SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout )
{
delete mpSwapStreamHdl, mpSwapStreamHdl = new Link( rHdl );
@@ -519,10 +519,10 @@ void GraphicObject::SetGraphicManager( const GraphicManager& rMgr )
ImplSetGraphicManager( &rMgr );
}
-BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr, ULONG nFlags ) const
+sal_Bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr, sal_uLong nFlags ) const
{
- BOOL bRet;
+ sal_Bool bRet;
if( nFlags & GRFMGR_DRAW_CACHED )
{
@@ -531,13 +531,13 @@ BOOL GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size&
if ( pAttr->IsCropped() )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
+ sal_Bool bRectClip;
ImplGetCropParams( pOut, aPt, aSz, pAttr, aClipPolyPoly, bRectClip );
}
bRet = mpMgr->IsInCache( pOut, aPt, aSz, *this, ( pAttr ? *pAttr : GetAttr() ) );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -558,16 +558,16 @@ List* GraphicObject::GetAnimationInfoList() const
return maGraphic.GetAnimationInfoList();
}
-BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr, ULONG nFlags )
+sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr, sal_uLong nFlags )
{
GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() );
Point aPt( rPt );
Size aSz( rSz );
const sal_uInt32 nOldDrawMode = pOut->GetDrawMode();
- BOOL bCropped = aAttr.IsCropped();
- BOOL bCached = FALSE;
- BOOL bRet;
+ sal_Bool bCropped = aAttr.IsCropped();
+ sal_Bool bCached = sal_False;
+ sal_Bool bRet;
// #i29534# Provide output rects for PDF writer
Rectangle aCropRect;
@@ -594,8 +594,8 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
if( bCropped )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
pOut->Push( PUSH_CLIPREGION );
@@ -636,10 +636,10 @@ BOOL GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
}
// #i105243#
-BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
+sal_Bool GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
const Point& rPt, const Size& rSz,
const GraphicAttr* pGrfAttr,
- const ULONG nFlags )
+ const sal_uLong nFlags )
{
const GraphicAttr aGrfAttr( pGrfAttr ? *pGrfAttr : GetAttr() );
@@ -666,8 +666,8 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
if( aGrfAttr.IsCropped() )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( &rOutDev,
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( &rOutDev,
aPt, aSz,
&aGrfAttr,
aClipPolyPoly,
@@ -682,7 +682,7 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
}
}
- BOOL bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags );
+ sal_Bool bRet = Draw( &rOutDev, rPt, rSz, &aGrfAttr, nFlags );
// Notify PDF writer about linked graphic (if any)
if( bWritingPdfLinkedGraphic )
@@ -696,11 +696,11 @@ BOOL GraphicObject::DrawWithPDFHandling( OutputDevice& rOutDev,
return bRet;
}
-BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
- const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D )
+sal_Bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
+ const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D )
{
if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 )
- return FALSE;
+ return sal_False;
const MapMode aOutMapMode( pOut->GetMapMode() );
const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
@@ -718,11 +718,11 @@ BOOL GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const
return ImplDrawTiled( pOut, rArea, aOutTileSize, rOffset, pAttr, nFlags, nTileCacheSize1D );
}
-BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- long nExtraData, const GraphicAttr* pAttr, ULONG /*nFlags*/,
+sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+ long nExtraData, const GraphicAttr* pAttr, sal_uLong /*nFlags*/,
OutputDevice* pFirstFrameOutDev )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
GetGraphic();
@@ -734,13 +734,13 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
{
Point aPt( rPt );
Size aSz( rSz );
- BOOL bCropped = aAttr.IsCropped();
+ sal_Bool bCropped = aAttr.IsCropped();
if( bCropped )
{
PolyPolygon aClipPolyPoly;
- BOOL bRectClip;
- const BOOL bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ sal_Bool bRectClip;
+ const sal_Bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
pOut->Push( PUSH_CLIPREGION );
@@ -767,7 +767,7 @@ BOOL GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
if( bCropped )
pOut->Pop();
- bRet = TRUE;
+ bRet = sal_True;
}
else
bRet = Draw( pOut, rPt, rSz, &aAttr, GRFMGR_DRAW_STANDARD );
@@ -798,7 +798,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC
mpSwapOutTimer->Stop();
maGraphic = rGraphic;
- mbAutoSwapped = FALSE;
+ mbAutoSwapped = sal_False;
ImplAssignGraphicData();
delete mpLink, mpLink = NULL;
delete mpSimpleCache, mpSimpleCache = NULL;
@@ -920,7 +920,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// #105641# Also crop animations
if( aTransGraphic.IsAnimated() )
{
- USHORT nFrame;
+ sal_uInt16 nFrame;
Animation aAnim( aTransGraphic.GetAnimation() );
for( nFrame=0; nFrame<aAnim.Count(); ++nFrame )
@@ -937,7 +937,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// cropping affects this frame, apply it then
// do _not_ apply enlargement, this is done below
ImplTransformBitmap( aAnimBmp.aBmpEx, rAttr, Size(), Size(),
- aCropRectRel, rDestSize, FALSE );
+ aCropRectRel, rDestSize, sal_False );
aAnim.Replace( aAnimBmp, nFrame );
}
@@ -984,7 +984,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
BitmapEx aBmpEx( aTransGraphic.GetBitmapEx() );
ImplTransformBitmap( aBmpEx, rAttr, aCropLeftTop, aCropRightBottom,
- aCropRect, rDestSize, TRUE );
+ aCropRect, rDestSize, sal_True );
aTransGraphic = aBmpEx;
}
@@ -1060,9 +1060,9 @@ void GraphicObject::ResetAnimationLoopCount()
}
}
-BOOL GraphicObject::SwapOut()
+sal_Bool GraphicObject::SwapOut()
{
- BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : FALSE );
+ sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut() : sal_False );
if( bRet && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1070,9 +1070,9 @@ BOOL GraphicObject::SwapOut()
return bRet;
}
-BOOL GraphicObject::SwapOut( SvStream* pOStm )
+sal_Bool GraphicObject::SwapOut( SvStream* pOStm )
{
- BOOL bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : FALSE );
+ sal_Bool bRet = ( !mbAutoSwapped ? maGraphic.SwapOut( pOStm ) : sal_False );
if( bRet && mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1080,17 +1080,17 @@ BOOL GraphicObject::SwapOut( SvStream* pOStm )
return bRet;
}
-BOOL GraphicObject::SwapIn()
+sal_Bool GraphicObject::SwapIn()
{
- BOOL bRet;
+ sal_Bool bRet;
if( mbAutoSwapped )
{
ImplAutoSwapIn();
- bRet = TRUE;
+ bRet = sal_True;
}
else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- bRet = TRUE;
+ bRet = sal_True;
else
{
bRet = maGraphic.SwapIn();
@@ -1105,17 +1105,17 @@ BOOL GraphicObject::SwapIn()
return bRet;
}
-BOOL GraphicObject::SwapIn( SvStream* pIStm )
+sal_Bool GraphicObject::SwapIn( SvStream* pIStm )
{
- BOOL bRet;
+ sal_Bool bRet;
if( mbAutoSwapped )
{
ImplAutoSwapIn();
- bRet = TRUE;
+ bRet = sal_True;
}
else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) )
- bRet = TRUE;
+ bRet = sal_True;
else
{
bRet = maGraphic.SwapIn( pIStm );
@@ -1134,7 +1134,7 @@ void GraphicObject::SetSwapState()
{
if( !IsSwappedOut() )
{
- mbAutoSwapped = TRUE;
+ mbAutoSwapped = sal_True;
if( mpMgr )
mpMgr->ImplGraphicObjectWasSwappedOut( *this );
@@ -1145,7 +1145,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG )
{
if( !IsSwappedOut() )
{
- mbIsInSwapOut = TRUE;
+ mbIsInSwapOut = sal_True;
SvStream* pStream = GetSwapStream();
@@ -1165,7 +1165,7 @@ IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, EMPTYARG )
}
}
- mbIsInSwapOut = FALSE;
+ mbIsInSwapOut = sal_False;
}
if( mpSwapOutTimer )
@@ -1180,7 +1180,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
Graphic aGraphic;
GraphicAttr aAttr;
ByteString aLink;
- BOOL bLink;
+ sal_Bool bLink;
rIStm >> aGraphic >> aAttr >> bLink;
@@ -1203,7 +1203,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- const BOOL bLink = rGraphicObj.HasLink();
+ const sal_Bool bLink = rGraphicObj.HasLink();
rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 51aada3e5cc5..dc21aba0c216 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -47,7 +47,7 @@
// -----------
#define MAX_PRINTER_EXT 1024
-#define MAP( cVal0, cVal1, nFrac ) ((BYTE)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L))
+#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20L)+nFrac*((long)(cVal1)-(cVal0)))>>20L))
#define WATERMARK_LUM_OFFSET 50
#define WATERMARK_CON_OFFSET -70
@@ -113,7 +113,7 @@ BitmapEx muckWithBitmap( const BitmapEx& rBmpEx,
// - GraphicManager -
// ------------------
-GraphicManager::GraphicManager( ULONG nCacheSize, ULONG nMaxObjCacheSize ) :
+GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize ) :
mpCache( new GraphicCache( *this, nCacheSize, nMaxObjCacheSize ) )
{
}
@@ -130,56 +130,56 @@ GraphicManager::~GraphicManager()
// -----------------------------------------------------------------------------
-void GraphicManager::SetMaxCacheSize( ULONG nNewCacheSize )
+void GraphicManager::SetMaxCacheSize( sal_uLong nNewCacheSize )
{
mpCache->SetMaxDisplayCacheSize( nNewCacheSize );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetMaxCacheSize() const
+sal_uLong GraphicManager::GetMaxCacheSize() const
{
return mpCache->GetMaxDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-void GraphicManager::SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached )
+void GraphicManager::SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached )
{
mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, bDestroyGreaterCached );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetMaxObjCacheSize() const
+sal_uLong GraphicManager::GetMaxObjCacheSize() const
{
return mpCache->GetMaxObjDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetUsedCacheSize() const
+sal_uLong GraphicManager::GetUsedCacheSize() const
{
return mpCache->GetUsedDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetFreeCacheSize() const
+sal_uLong GraphicManager::GetFreeCacheSize() const
{
return mpCache->GetFreeDisplayCacheSize();
}
// -----------------------------------------------------------------------------
-void GraphicManager::SetCacheTimeout( ULONG nTimeoutSeconds )
+void GraphicManager::SetCacheTimeout( sal_uLong nTimeoutSeconds )
{
mpCache->SetCacheTimeout( nTimeoutSeconds );
}
// -----------------------------------------------------------------------------
-ULONG GraphicManager::GetCacheTimeout() const
+sal_uLong GraphicManager::GetCacheTimeout() const
{
return mpCache->GetCacheTimeout();
}
@@ -200,7 +200,7 @@ void GraphicManager::ReleaseFromCache( const GraphicObject& /*rObj*/ )
// -----------------------------------------------------------------------------
-BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
+sal_Bool GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
const Size& rSz, const GraphicObject& rObj,
const GraphicAttr& rAttr ) const
{
@@ -209,15 +209,15 @@ BOOL GraphicManager::IsInCache( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
+sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
GraphicObject& rObj, const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached )
+ const sal_uLong nFlags, sal_Bool& rCached )
{
Point aPt( rPt );
Size aSz( rSz );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- rCached = FALSE;
+ rCached = sal_False;
if( ( rObj.GetType() == GRAPHIC_BITMAP ) || ( rObj.GetType() == GRAPHIC_GDIMETAFILE ) )
{
@@ -235,7 +235,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
if( aGraphic.IsSupportedGraphic() )
{
- const USHORT nRot10 = rAttr.GetRotation() % 3600;
+ const sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
if( nRot10 )
{
@@ -250,7 +250,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
aGraphic.Draw( pOut, aPt, aSz );
}
- bRet = TRUE;
+ bRet = sal_True;
}
if( !bRet )
@@ -259,7 +259,7 @@ BOOL GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Size&
if( !mpCache->DrawDisplayCacheObj( pOut, aPt, aSz, rObj, rAttr ) )
bRet = ImplDraw( pOut, aPt, aSz, rObj, rAttr, nFlags, rCached );
else
- bRet = rCached = TRUE;
+ bRet = rCached = sal_True;
}
}
@@ -299,7 +299,7 @@ ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
+sal_Bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
{
return( mpCache->FillSwappedGraphicObject( rObj, rSubstitute ) );
}
@@ -313,13 +313,13 @@ void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj )
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
+sal_Bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
const Size& rSz, GraphicObject& rObj,
const GraphicAttr& rAttr,
- const ULONG nFlags, BOOL& rCached )
+ const sal_uLong nFlags, sal_Bool& rCached )
{
const Graphic& rGraphic = rObj.GetGraphic();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rGraphic.IsSupportedGraphic() && !rGraphic.IsSwapOut() )
{
@@ -337,7 +337,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( ImplCreateOutput( pOut, rPt, rSz, aSrcBmpEx, rAttr, nFlags, &aDstBmpEx ) )
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -365,13 +365,13 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( ImplCreateOutput( pOut, rPt, rSz, aContainedBmpEx, rAttr, nFlags, &aDstBmpEx ) )
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstBmpEx );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
{
rCached = mpCache->CreateDisplayCacheObj( pOut, rPt, rSz, rObj, rAttr, aDstMtf );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -383,7 +383,7 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
if( aGraphic.IsSupportedGraphic() )
{
aGraphic.Draw( pOut, rPt, rSz );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -394,16 +394,16 @@ BOOL GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
+sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const Point& rPt, const Size& rSz,
const BitmapEx& rBmpEx, const GraphicAttr& rAttr,
- const ULONG nFlags, BitmapEx* pBmpEx )
+ const sal_uLong nFlags, BitmapEx* pBmpEx )
{
- USHORT nRot10 = rAttr.GetRotation() % 3600;
+ sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
Point aOutPtPix;
Size aOutSzPix;
Size aUnrotatedSzPix( pOut->LogicToPixel( rSz ) );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nRot10 )
{
@@ -438,8 +438,8 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
long* pMapFY = new long[ nNewH ];
long nStartX = -1, nStartY = -1, nEndX = -1, nEndY = -1;
long nX, nY, nTmp, nTmpX, nTmpY;
- BOOL bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
- BOOL bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
+ sal_Bool bHMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_HORZ ) != 0;
+ sal_Bool bVMirr = ( rAttr.GetMirrorFlags() & BMP_MIRROR_VERT ) != 0;
if( nFlags & GRFMGR_DRAW_BILINEAR )
{
@@ -541,7 +541,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
// do transformation
if( nStartX >= 0L )
{
- const BOOL bSimple = ( 1 == nW || 1 == nH );
+ const sal_Bool bSimple = ( 1 == nW || 1 == nH );
if( nRot10 )
{
@@ -570,7 +570,7 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
aOutPt = pOut->PixelToLogic( aOutPtPix );
aOutSz = pOut->PixelToLogic( aOutSzPix );
aOutBmpEx = aBmpEx;
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
@@ -624,10 +624,10 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
+sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr,
- const ULONG /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx )
+ const sal_uLong /*nFlags*/, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx )
{
const Size aNewSize( rMtf.GetPrefSize() );
@@ -919,12 +919,12 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
rOutBmpEx = BitmapEx();
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
+sal_Bool GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx )
@@ -938,8 +938,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
const long nDstH = nEndY - nStartY + 1L;
long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY;
long nXDst, nYDst;
- BYTE cR0, cG0, cB0, cR1, cG1, cB1;
- BOOL bRet = FALSE;
+ sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( aBmp.GetSizePixel() == rBmpEx.GetSizePixel(),
"GraphicManager::ImplCreateScaled(): bmp size inconsistent" );
@@ -1117,7 +1117,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
}
aOutBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aBmp.ReleaseAccess( pAcc );
@@ -1125,7 +1125,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
if( bRet && rBmpEx.IsTransparent() )
{
- bRet = FALSE;
+ bRet = sal_False;
if( rBmpEx.IsAlpha() )
{
@@ -1198,7 +1198,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
}
aOutAlpha.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aAlpha.ReleaseAccess( pAcc );
@@ -1277,7 +1277,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
{
for( nX = 0L; nX < nDstW; nX++ )
{
- if( pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
+ if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
pWAcc->SetPixel( nY, nX, aWB );
else
pWAcc->SetPixel( nY, nX, aWW );
@@ -1302,7 +1302,7 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
delete[] pMapLX;
delete[] pMapLY;
aOutMsk.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aMsk.ReleaseAccess( pAcc );
@@ -1323,8 +1323,8 @@ BOOL GraphicManager::ImplCreateScaled( const BitmapEx& rBmpEx,
// -----------------------------------------------------------------------------
-BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
- USHORT nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix,
+sal_Bool GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
+ sal_uInt16 nRot10, const Size& /*rOutSzPix*/, const Size& rUnrotatedSzPix,
long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY,
long nStartX, long nEndX, long nStartY, long nEndY,
BitmapEx& rOutBmpEx )
@@ -1347,8 +1347,8 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
long* pCosY = new long[ nDstH ];
long* pSinY = new long[ nDstH ];
long nX, nY, nTmpX, nTmpY, nTmpFX, nTmpFY, nUnRotX, nUnRotY, nSinY, nCosY;
- BYTE cR0, cG0, cB0, cR1, cG1, cB1;
- BOOL bRet = FALSE;
+ sal_uInt8 cR0, cG0, cB0, cR1, cG1, cB1;
+ sal_Bool bRet = sal_False;
// create horizontal mapping table
for( nX = 0L, nTmpX = aNewBound.Left() + nStartX; nX < nDstW; nX++ )
@@ -1455,7 +1455,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
}
aOutBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aBmp.ReleaseAccess( pAcc );
@@ -1464,7 +1464,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
// mask processing
if( bRet && ( rBmpEx.IsTransparent() || ( nRot10 != 900 && nRot10 != 1800 && nRot10 != 2700 ) ) )
{
- bRet = FALSE;
+ bRet = sal_False;
if( rBmpEx.IsAlpha() )
{
@@ -1555,7 +1555,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
}
aOutAlpha.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aAlpha.ReleaseAccess( pAcc );
@@ -1628,7 +1628,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
if( pMAcc )
aMsk.ReleaseAccess( pMAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aOutMsk.ReleaseAccess( pWAcc );
@@ -1654,7 +1654,7 @@ BOOL GraphicManager::ImplCreateRotatedScaled( const BitmapEx& rBmpEx,
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1702,7 +1702,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
if( ( nAdjustmentFlags & ADJUSTMENT_TRANSPARENCY ) && aAttr.IsTransparent() )
{
AlphaMask aAlpha;
- BYTE cTrans = aAttr.GetTransparency();
+ sal_uInt8 cTrans = aAttr.GetTransparency();
if( !rBmpEx.IsTransparent() )
aAlpha = AlphaMask( rBmpEx.GetSizePixel(), &cTrans );
@@ -1718,7 +1718,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
if( pA )
{
- ULONG nTrans = cTrans, nNewTrans;
+ sal_uLong nTrans = cTrans, nNewTrans;
const long nWidth = pA->Width(), nHeight = pA->Height();
if( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
@@ -1730,7 +1730,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
for( long nX = 0; nX < nWidth; nX++ )
{
nNewTrans = nTrans + *pAScan;
- *pAScan++ = (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans );
+ *pAScan++ = (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans );
}
}
}
@@ -1743,7 +1743,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
for( long nX = 0; nX < nWidth; nX++ )
{
nNewTrans = nTrans + pA->GetPixel( nY, nX ).GetIndex();
- aAlphaValue.SetIndex( (BYTE) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) );
+ aAlphaValue.SetIndex( (sal_uInt8) ( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) );
pA->SetPixel( nY, nX, aAlphaValue );
}
}
@@ -1759,7 +1759,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULO
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1812,7 +1812,7 @@ void GraphicManager::ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, UL
// -----------------------------------------------------------------------------
-void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags )
+void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags )
{
GraphicAttr aAttr( rAttr );
@@ -1868,7 +1868,7 @@ void GraphicManager::ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr
void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
const GDIMetaFile& rMtf, const GraphicAttr& rAttr )
{
- USHORT nRot10 = rAttr.GetRotation() % 3600;
+ sal_uInt16 nRot10 = rAttr.GetRotation() % 3600;
Point aOutPt( rPt );
Size aOutSz( rSz );
@@ -1926,7 +1926,7 @@ struct ImplTileInfo
bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
int nNumTilesX, int nNumTilesY,
const Size& rTileSizePixel,
- const GraphicAttr* pAttr, ULONG nFlags )
+ const GraphicAttr* pAttr, sal_uLong nFlags )
{
if( nExponent <= 1 )
return false;
@@ -1946,8 +1946,8 @@ bool GraphicObject::ImplRenderTempTile( VirtualDevice& rVDev, int nExponent,
// #105229# Switch off mapping (converting to logic and back to
// pixel might cause roundoff errors)
- BOOL bOldMap( rVDev.IsMapModeEnabled() );
- rVDev.EnableMapMode( FALSE );
+ sal_Bool bOldMap( rVDev.IsMapModeEnabled() );
+ rVDev.EnableMapMode( sal_False );
bool bRet( ImplRenderTileRecursive( rVDev, nExponent, nMSBFactor, nNumTilesX, nNumTilesY,
nNumTilesX, nNumTilesY, rTileSizePixel, pAttr, nFlags, aTileInfo ) );
@@ -1970,7 +1970,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
int nNumOrigTilesX, int nNumOrigTilesY,
int nRemainderTilesX, int nRemainderTilesY,
const Size& rTileSizePixel, const GraphicAttr* pAttr,
- ULONG nFlags, ImplTileInfo& rTileInfo )
+ sal_uLong nFlags, ImplTileInfo& rTileInfo )
{
// gets loaded with our tile bitmap
GraphicObject aTmpGraphic;
@@ -2145,7 +2145,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
// -----------------------------------------------------------------------------
bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel,
- const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D )
+ const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D )
{
// how many tiles to generate per recursion step
enum{ SubdivisionExponent=2 };
@@ -2256,7 +2256,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
int nNumTilesX, int nNumTilesY,
- const Size& rTileSizePixel, const GraphicAttr* pAttr, ULONG nFlags )
+ const Size& rTileSizePixel, const GraphicAttr* pAttr, sal_uLong nFlags )
{
Point aCurrPos( rPosPixel );
Size aTileSizeLogic( rOut.PixelToLogic( rTileSizePixel ) );
@@ -2264,14 +2264,14 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
// #107607# Use logical coordinates for metafile playing, too
bool bDrawInPixel( rOut.GetConnectMetaFile() == NULL && GRAPHIC_BITMAP == GetType() );
- BOOL bRet( FALSE );
+ sal_Bool bRet( sal_False );
// #105229# Switch off mapping (converting to logic and back to
// pixel might cause roundoff errors)
- BOOL bOldMap( rOut.IsMapModeEnabled() );
+ sal_Bool bOldMap( rOut.IsMapModeEnabled() );
if( bDrawInPixel )
- rOut.EnableMapMode( FALSE );
+ rOut.EnableMapMode( sal_False );
for( nY=0; nY < nNumTilesY; ++nY )
{
@@ -2310,7 +2310,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx,
const Size& rCropRightBottom,
const Rectangle& rCropRect,
const Size& rDstSize,
- BOOL bEnlarge ) const
+ sal_Bool bEnlarge ) const
{
// #107947# Extracted from svdograf.cxx
diff --git a/svtools/source/graphic/makefile.mk b/svtools/source/graphic/makefile.mk
deleted file mode 100644
index cf3a916e7aa1..000000000000
--- a/svtools/source/graphic/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=graphic
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-.IF "$(GUI)"=="WIN"
-LINKFLAGS=$(LINKFLAGS) /PACKC:32768
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/descriptor.obj \
- $(SLO)$/graphic.obj \
- $(SLO)$/graphicunofactory.obj \
- $(SLO)$/grfattr.obj \
- $(SLO)$/grfcache.obj \
- $(SLO)$/grfmgr.obj \
- $(SLO)$/grfmgr2.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/renderer.obj \
- $(SLO)$/transformer.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/descriptor.obj \
- $(SLO)$/graphic.obj \
- $(SLO)$/graphicunofactory.obj \
- $(SLO)$/grfcache.obj \
- $(SLO)$/grfmgr.obj \
- $(SLO)$/grfmgr2.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/renderer.obj \
- $(SLO)$/transformer.obj
-
-# --- Target -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index a4dcb7f51de8..af579f82c446 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -338,7 +338,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const :
if( 0 < nImageId )
{
- const Image aImage( aImageList.GetImage( sal::static_int_cast< USHORT >(nImageId) ) );
+ const Image aImage( aImageList.GetImage( sal::static_int_cast< sal_uInt16 >(nImageId) ) );
aBmpEx = aImage.GetBitmapEx();
}
else
diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx
index 1651eb2b16c3..c32e3a6c0b60 100644
--- a/svtools/source/hatchwindow/hatchwindow.cxx
+++ b/svtools/source/hatchwindow/hatchwindow.cxx
@@ -34,6 +34,8 @@
#include "ipwin.hxx"
#include <toolkit/helper/convert.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -51,6 +53,8 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer >
const awt::Rectangle& aBounds,
const awt::Size& aSize )
{
+ SolarMutexGuard aGuard;
+
Window* pParent = NULL;
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( xParent );
@@ -118,7 +122,7 @@ uno::Any SAL_CALL VCLXHatchWindow::queryInterface( const uno::Type & rType )
throw( uno::RuntimeException )
{
// Attention:
- // Don't use mutex or guard in this method!!! Is a method of XInterface.
+ // Don't use mutex or guard in this method!!! Is a method of XInterface.
uno::Any aReturn( ::cppu::queryInterface( rType,
static_cast< embed::XHatchWindow* >( this ) ) );
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component
new file mode 100644
index 000000000000..153fc8796281
--- /dev/null
+++ b/svtools/source/hatchwindow/hatchwindowfactory.component
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.DocumentCloser">
+ <service name="com.sun.star.embed.DocumentCloser"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.HatchWindowFactory">
+ <service name="com.sun.star.comp.embed.HatchWindowFactory"/>
+ <service name="com.sun.star.embed.HatchWindowFactory"/>
+ </implementation>
+</component>
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index d0e9786fe99c..a0ff0d4daf17 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -32,6 +32,7 @@
#include "hatchwindowfactory.hxx"
#include "hatchwindow.hxx"
#include "cppuhelper/factory.hxx"
+#include <vcl/svapp.hxx>
#include "documentcloser.hxx"
@@ -70,6 +71,7 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW
if ( !xParent.is() )
throw lang::IllegalArgumentException(); // TODO
+ SolarMutexGuard aGuard;
VCLXHatchWindow* pResult = new VCLXHatchWindow();
pResult->initializeWindow( xParent, aBounds, aHandlerSize );
return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) );
@@ -113,45 +115,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- uno::Reference< registry::XRegistryKey> xRegistryKey (
- reinterpret_cast< registry::XRegistryKey* >(pRegistryKey));
- uno::Reference< registry::XRegistryKey> xNewKey;
-
- // OHatchWindowFactory registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OHatchWindowFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- uno::Sequence< ::rtl::OUString > aServices =
- OHatchWindowFactory::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- // ODocumentCloser registration
-
- xNewKey = xRegistryKey->createKey (
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- ODocumentCloser::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ODocumentCloser::impl_staticGetSupportedServiceNames();
- for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/hatchwindow/ipwin.cxx b/svtools/source/hatchwindow/ipwin.cxx
index 4cf4f9dcf741..c4a68a49ec2a 100644
--- a/svtools/source/hatchwindow/ipwin.cxx
+++ b/svtools/source/hatchwindow/ipwin.cxx
@@ -44,7 +44,7 @@
SvResizeHelper::SvResizeHelper()
: aBorder( 5, 5 )
, nGrab( -1 )
- , bResizeable( TRUE )
+ , bResizeable( sal_True )
{
}
@@ -128,7 +128,7 @@ void SvResizeHelper::Draw( OutputDevice * pDev )
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- USHORT i;
+ sal_uInt16 i;
for( i = 0; i < 4; i++ )
pDev->DrawRect( aMoveRects[ i ] );
if( bResizeable )
@@ -152,7 +152,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin )
{
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( USHORT i = 0; i < 4; i++ )
+ for( sal_uInt16 i = 0; i < 4; i++ )
pWin->Invalidate( aMoveRects[ i ] );
}
@@ -161,7 +161,7 @@ void SvResizeHelper::InvalidateBorder( Window * pWin )
|*
|* Beschreibung
*************************************************************************/
-BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
+sal_Bool SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
{
if( -1 == nGrab )
{
@@ -170,10 +170,10 @@ BOOL SvResizeHelper::SelectBegin( Window * pWin, const Point & rPos )
{
aSelPos = rPos; // Start-Position merken
pWin->CaptureMouse();
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -189,14 +189,14 @@ short SvResizeHelper::SelectMove( Window * pWin, const Point & rPos )
{
Rectangle aRects[ 8 ];
FillHandleRectsPixel( aRects );
- for( USHORT i = 0; i < 8; i++ )
+ for( sal_uInt16 i = 0; i < 8; i++ )
if( aRects[ i ].IsInside( rPos ) )
return i;
}
// Move-Rect ueberlappen Handles
Rectangle aMoveRects[ 4 ];
FillMoveRectsPixel( aMoveRects );
- for( USHORT i = 0; i < 4; i++ )
+ for( sal_uInt16 i = 0; i < 4; i++ )
if( aMoveRects[ i ].IsInside( rPos ) )
return 8;
}
@@ -421,7 +421,7 @@ void SvResizeHelper::ValidateRect( Rectangle & rValidate ) const
|*
|* Beschreibung
*************************************************************************/
-BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
+sal_Bool SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
Rectangle & rOutPosSize )
{
if( -1 != nGrab )
@@ -431,9 +431,9 @@ BOOL SvResizeHelper::SelectRelease( Window * pWin, const Point & rPos,
nGrab = -1;
pWin->ReleaseMouse();
pWin->HideTracking();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -632,7 +632,7 @@ long SvResizeWindow::Notify( NotifyEvent& rEvt )
{
if ( rEvt.GetType() == EVENT_LOSEFOCUS && m_bActive )
{
- BOOL bHasFocus = HasChildPathFocus(TRUE);
+ sal_Bool bHasFocus = HasChildPathFocus(sal_True);
if ( !bHasFocus )
{
m_bActive = sal_False;
diff --git a/svtools/source/hatchwindow/ipwin.hxx b/svtools/source/hatchwindow/ipwin.hxx
index cbe91e7ed4d9..c5331a9e580c 100644
--- a/svtools/source/hatchwindow/ipwin.hxx
+++ b/svtools/source/hatchwindow/ipwin.hxx
@@ -41,11 +41,11 @@ class SvResizeHelper
Rectangle aOuter;
short nGrab; // -1 kein Grab, 0 - 7, 8 = Move, siehe FillHandle...
Point aSelPos;
- BOOL bResizeable;
+ sal_Bool bResizeable;
public:
SvResizeHelper();
- void SetResizeable( BOOL b ) { bResizeable = b; }
+ void SetResizeable( sal_Bool b ) { bResizeable = b; }
short GetGrab() const { return nGrab; }
void SetBorderPixel( const Size & rBorderP )
{ aBorder = rBorderP; }
@@ -68,12 +68,12 @@ public:
void FillMoveRectsPixel( Rectangle aRects[ 4 ] ) const;
void Draw( OutputDevice * );
void InvalidateBorder( Window * );
- BOOL SelectBegin( Window *, const Point & rPos );
+ sal_Bool SelectBegin( Window *, const Point & rPos );
short SelectMove( Window * pWin, const Point & rPos );
Point GetTrackPosPixel( const Rectangle & rRect ) const;
Rectangle GetTrackRectPixel( const Point & rTrackPos ) const;
void ValidateRect( Rectangle & rValidate ) const;
- BOOL SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize );
+ sal_Bool SelectRelease( Window *, const Point & rPos, Rectangle & rOutPosSize );
void Release( Window * pWin );
};
diff --git a/svtools/source/hatchwindow/makefile.mk b/svtools/source/hatchwindow/makefile.mk
deleted file mode 100644
index 316e4ab1bfe2..000000000000
--- a/svtools/source/hatchwindow/makefile.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=hatchwindowfactory.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/hatchwindow.obj\
- $(SLO)$/hatchwindowfactory.obj\
- $(SLO)$/documentcloser.obj\
- $(SLO)$/ipwin.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-SHL1OBJS= $(SLOFILES)
-SHL1STDLIBS=\
- $(TKLIB) \
- $(VCLLIB) \
- $(TOOLSLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/inc/filectrl.hrc b/svtools/source/inc/filectrl.hrc
index 1707e306e1b0..150bbba4ac68 100644
--- a/svtools/source/inc/filectrl.hrc
+++ b/svtools/source/inc/filectrl.hrc
@@ -30,5 +30,12 @@
#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+//IAccessibility2 Implementation 2009-----
+#define STR_TABBAR_PUSHBUTTON_MOVET0HOME ( STR_FILECTRL_BUTTONTEXT+ 1)
+#define STR_TABBAR_PUSHBUTTON_MOVELEFT ( STR_FILECTRL_BUTTONTEXT+ 2)
+#define STR_TABBAR_PUSHBUTTON_MOVERIGHT ( STR_FILECTRL_BUTTONTEXT+ 3)
+#define STR_TABBAR_PUSHBUTTON_MOVETOEND ( STR_FILECTRL_BUTTONTEXT+ 4)
+//-----IAccessibility2 Implementation 2009
+
#endif
diff --git a/svtools/source/inc/gifread.hxx b/svtools/source/inc/gifread.hxx
index ee42c86b23de..1b92271dfc9f 100644
--- a/svtools/source/inc/gifread.hxx
+++ b/svtools/source/inc/gifread.hxx
@@ -85,41 +85,41 @@ class GIFReader : public GraphicReader
long nLastPos;
sal_uInt32 nLogWidth100;
sal_uInt32 nLogHeight100;
- USHORT nTimer;
- USHORT nGlobalWidth; // maximale Bildbreite aus Header
- USHORT nGlobalHeight; // maximale Bildhoehe aus Header
- USHORT nImageWidth; // maximale Bildbreite aus Header
- USHORT nImageHeight; // maximale Bildhoehe aus Header
- USHORT nImagePosX;
- USHORT nImagePosY;
- USHORT nImageX; // maximale Bildbreite aus Header
- USHORT nImageY; // maximale Bildhoehe aus Header
- USHORT nLastImageY;
- USHORT nLastInterCount;
- USHORT nLoops;
+ sal_uInt16 nTimer;
+ sal_uInt16 nGlobalWidth; // maximale Bildbreite aus Header
+ sal_uInt16 nGlobalHeight; // maximale Bildhoehe aus Header
+ sal_uInt16 nImageWidth; // maximale Bildbreite aus Header
+ sal_uInt16 nImageHeight; // maximale Bildhoehe aus Header
+ sal_uInt16 nImagePosX;
+ sal_uInt16 nImagePosY;
+ sal_uInt16 nImageX; // maximale Bildbreite aus Header
+ sal_uInt16 nImageY; // maximale Bildhoehe aus Header
+ sal_uInt16 nLastImageY;
+ sal_uInt16 nLastInterCount;
+ sal_uInt16 nLoops;
GIFAction eActAction;
- BOOL bStatus;
- BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
- BOOL bInterlaced;
- BOOL bOverreadBlock;
- BOOL bImGraphicReady;
- BOOL bGlobalPalette;
- BYTE nBackgroundColor; // Hintergrundfarbe
- BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
- BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
- BYTE cTransIndex1;
- BYTE cNonTransIndex1;
-
- void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount );
+ sal_Bool bStatus;
+ sal_Bool bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
+ sal_Bool bInterlaced;
+ sal_Bool bOverreadBlock;
+ sal_Bool bImGraphicReady;
+ sal_Bool bGlobalPalette;
+ sal_uInt8 nBackgroundColor; // Hintergrundfarbe
+ sal_uInt8 nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
+ sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
+ sal_uInt8 cTransIndex1;
+ sal_uInt8 cNonTransIndex1;
+
+ void ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount );
void ClearImageExtensions();
- BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor );
- BOOL ReadGlobalHeader();
- BOOL ReadExtension();
- BOOL ReadLocalHeader();
- ULONG ReadNextBlock();
- void FillImages( HPBYTE pBytes, ULONG nCount );
+ sal_Bool CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, sal_Bool bWatchForBackgroundColor );
+ sal_Bool ReadGlobalHeader();
+ sal_Bool ReadExtension();
+ sal_Bool ReadLocalHeader();
+ sal_uLong ReadNextBlock();
+ void FillImages( HPBYTE pBytes, sal_uLong nCount );
void CreateNewBitmaps();
- BOOL ProcessGIF();
+ sal_Bool ProcessGIF();
public:
@@ -136,7 +136,7 @@ public:
// - ImportGIF -
// -------------
- BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic );
+ sal_Bool ImportGIF( SvStream& rStream, Graphic& rGraphic );
#endif // _GIFREAD_HXX
diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx
index 4163354d1416..00c267f71650 100644
--- a/svtools/source/inc/jpeg.hxx
+++ b/svtools/source/inc/jpeg.hxx
@@ -92,8 +92,8 @@ class JPEGWriter
SvStream& rOStm;
Bitmap aBmp;
BitmapReadAccess* pAcc;
- BYTE* pBuffer;
- BOOL bNative;
+ sal_uInt8* pBuffer;
+ sal_Bool bNative;
sal_Bool bGreys;
sal_Int32 nQuality;
@@ -110,7 +110,7 @@ public:
bool* pExportWasGrey = NULL );
~JPEGWriter() {};
- BOOL Write( const Graphic& rGraphic );
+ sal_Bool Write( const Graphic& rGraphic );
};
#endif // _JPEGPRIVATE
@@ -119,9 +119,9 @@ public:
// - Import/ExportJPEG -
// ---------------------
-BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
+sal_Bool ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
-BOOL ExportJPEG( SvStream& rStream,
+sal_Bool ExportJPEG( SvStream& rStream,
const Graphic& rGraphic,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
bool* pExportWasGrey = NULL
diff --git a/svtools/source/inc/msgrd.hxx b/svtools/source/inc/msgrd.hxx
index 6b1bc8cb5775..dd39a1446af2 100644
--- a/svtools/source/inc/msgrd.hxx
+++ b/svtools/source/inc/msgrd.hxx
@@ -30,9 +30,9 @@
#define _MSGRD_HXX
-BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile,
- BOOL(*pCallback)(void *, USHORT), void * pCallerData,
- ULONG nMinPercent, ULONG nMaxPercent);
+sal_Bool ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile,
+ sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData,
+ sal_uLong nMinPercent, sal_uLong nMaxPercent);
#endif // _MSGRD_HXX
diff --git a/svtools/source/inc/msgwr.hxx b/svtools/source/inc/msgwr.hxx
index 77eeda2b26b9..c382397899e2 100644
--- a/svtools/source/inc/msgwr.hxx
+++ b/svtools/source/inc/msgwr.hxx
@@ -30,9 +30,9 @@
#define _MSGWR_HXX
-BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream,
- BOOL(*pCallback)(void *, USHORT), void * pCallerData,
- ULONG nMinPercent, ULONG nMaxPercent);
+sal_Bool ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream,
+ sal_Bool(*pCallback)(void *, sal_uInt16), void * pCallerData,
+ sal_uLong nMinPercent, sal_uLong nMaxPercent);
#endif // _MSGWR_HXX
diff --git a/svtools/source/inc/property.hxx b/svtools/source/inc/property.hxx
index e77cbb4ed5e6..a6ef27fda9af 100644
--- a/svtools/source/inc/property.hxx
+++ b/svtools/source/inc/property.hxx
@@ -72,13 +72,13 @@ public:
virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0;
virtual void SetProperty(const String &rString)=0;
virtual String GetProperty()const=0;
- virtual BOOL HasList()=0;
+ virtual sal_Bool HasList()=0;
virtual void ClearList()=0;
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND )=0;
+ sal_uInt16 nPos = LISTBOX_APPEND )=0;
virtual void SetCtrSize(const Size& rSize)=0;
- virtual void SetLocked(BOOL bLocked=TRUE)=0;
+ virtual void SetLocked(sal_Bool bLocked=sal_True)=0;
virtual void SetMyName(const String &rString)=0;
virtual String GetMyName()const=0;
@@ -122,13 +122,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -165,13 +165,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -207,13 +207,13 @@ public:
virtual void SetProperty(const String &rString);
virtual String GetProperty()const;
- virtual BOOL HasList();
+ virtual sal_Bool HasList();
virtual void ClearList();
virtual void InsertEntry( const String& rString,
- USHORT nPos = LISTBOX_APPEND );
+ sal_uInt16 nPos = LISTBOX_APPEND );
virtual void SetCtrSize(const Size& rSize);
- virtual void SetLocked(BOOL bLocked=TRUE);
+ virtual void SetLocked(sal_Bool bLocked=sal_True);
virtual void SetMyName(const String &rString);
virtual String GetMyName()const;
@@ -228,14 +228,14 @@ class SvPropertyLine : public Control
{
private:
FixedText aName;
- USHORT nNameWidth;
- BOOL bNeedsRepaint;
+ sal_uInt16 nNameWidth;
+ sal_Bool bNeedsRepaint;
SvXPropertyControl* pSvXPropertyControl;
PushButton aXButton;
- BOOL bIsLocked;
- BOOL bHasXButton;
- BOOL bIsHyperlink;
+ sal_Bool bIsLocked;
+ sal_Bool bHasXButton;
+ sal_Bool bIsHyperlink;
eKindOfControl eKindOfCtr;
protected:
@@ -247,8 +247,8 @@ public:
SvPropertyLine( Window* pParent,
const ResId& rResId );
- BOOL NeedsRepaint();
- void SetNeedsRepaint(BOOL bFlag);
+ sal_Bool NeedsRepaint();
+ void SetNeedsRepaint(sal_Bool bFlag);
void SetSvXPropertyControl(SvXPropertyControl*);
SvXPropertyControl* GetSvXPropertyControl();
@@ -257,16 +257,16 @@ public:
void SetName(const String& rString );
String GetName() const;
- void SetNameWidth(USHORT);
+ void SetNameWidth(sal_uInt16);
void ShowXButton();
void HideXButton();
- BOOL IsVisibleXButton();
- void ShowAsHyperLink(BOOL nFlag=TRUE);
- BOOL IsShownAsHyperlink();
+ sal_Bool IsVisibleXButton();
+ void ShowAsHyperLink(sal_Bool nFlag=sal_True);
+ sal_Bool IsShownAsHyperlink();
- void Locked(BOOL nFlag=TRUE);
- BOOL IsLineLocked();
+ void Locked(sal_Bool nFlag=sal_True);
+ sal_Bool IsLineLocked();
void SetClickHdl(const Link&);
@@ -281,9 +281,9 @@ public:
String aValue;
SvStrings theValues; // ???
- BOOL bHasVisibleXButton;
- BOOL bIsHyperLink;
- BOOL bIsLocked;
+ sal_Bool bHasVisibleXButton;
+ sal_Bool bIsHyperLink;
+ sal_Bool bIsLocked;
void* pDataPtr;
SvXPropertyControl* pControl;
};
@@ -365,9 +365,9 @@ private:
ScrollBar aVScroll;
SvPropLineArray PLineArray;
SvPropertyDataControl* pPropDataControl;
- USHORT nRowHeight;
- BOOL bUpdate;
- USHORT nTheNameSize;
+ sal_uInt16 nRowHeight;
+ sal_Bool bUpdate;
+ sal_uInt16 nTheNameSize;
long nYOffset;
DECL_LINK( ScrollHdl,ScrollBar*);
@@ -392,7 +392,7 @@ public:
~SvListBoxForProperties();
- virtual USHORT CalcVisibleLines();
+ virtual sal_uInt16 CalcVisibleLines();
virtual void EnableUpdate();
virtual void DisableUpdate();
@@ -400,19 +400,19 @@ public:
virtual void Clear();
- virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND );
- virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
+ virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos);
- virtual USHORT AppendEntry( const SvPropertyData&);
+ virtual sal_uInt16 AppendEntry( const SvPropertyData&);
virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
- virtual void SetFirstVisibleEntry(USHORT nPos);
- virtual USHORT GetFirstVisibleEntry();
+ virtual void SetFirstVisibleEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetFirstVisibleEntry();
- virtual void SetSelectedEntry(USHORT nPos);
- virtual USHORT GetSelectedEntry();
+ virtual void SetSelectedEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetSelectedEntry();
};
class SvTabPageForProperties: public TabPage
@@ -437,7 +437,7 @@ class SvBasicPropertyDataControl: public SvPropertyDataControl
{
private:
- BOOL bCorrectness;
+ sal_Bool bCorrectness;
String aEntryName;
String aEntryProperty;
String aCorrectProperty;
@@ -468,7 +468,7 @@ public:
virtual void LinkClicked(const String& aName,
void* pData);
- virtual void SetIsCorrect(BOOL nFlag);
+ virtual void SetIsCorrect(sal_Bool nFlag);
//virtual String GetTheCorrectProperty()const;
virtual void SetTheCorrectProperty(const String& aName);
@@ -508,30 +508,30 @@ public:
~SvPropertyBox();
- virtual USHORT CalcVisibleLines();
+ virtual sal_uInt16 CalcVisibleLines();
virtual void EnableUpdate(); // auch IDL?
virtual void DisableUpdate(); // auch IDL?
// AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll
virtual void SetController(SvPropertyDataControl *);
- virtual USHORT AppendPage( const String & r );
- virtual void SetPage( USHORT );
- virtual USHORT GetCurPage();
+ virtual sal_uInt16 AppendPage( const String & r );
+ virtual void SetPage( sal_uInt16 );
+ virtual sal_uInt16 GetCurPage();
virtual void ClearAll();
virtual void ClearTable();
virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
- virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
- virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
- virtual USHORT AppendEntry( const SvPropertyData&);
+ virtual sal_uInt16 InsertEntry( const SvPropertyData&, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual void ChangeEntry( const SvPropertyData&, sal_uInt16 nPos);
+ virtual sal_uInt16 AppendEntry( const SvPropertyData&);
- virtual void SetFirstVisibleEntry(USHORT nPos);
- virtual USHORT GetFirstVisibleEntry();
+ virtual void SetFirstVisibleEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetFirstVisibleEntry();
- virtual void SetSelectedEntry(USHORT nPos);
- virtual USHORT GetSelectedEntry();
+ virtual void SetSelectedEntry(sal_uInt16 nPos);
+ virtual sal_uInt16 GetSelectedEntry();
};
@@ -543,8 +543,8 @@ private:
SvBasicPropertyDataControl aBaProDatCtr;
OKButton anOk;
CancelButton aCancel;
- USHORT nCount;
- USHORT nClickCount;
+ sal_uInt16 nCount;
+ sal_uInt16 nClickCount;
SvPropertyData aProperty;
SvPropertyBox aPropListBox;
diff --git a/svtools/source/inc/sgfbram.hxx b/svtools/source/inc/sgfbram.hxx
index d3003e5ba565..ef3ee7a7bfe4 100644
--- a/svtools/source/inc/sgfbram.hxx
+++ b/svtools/source/inc/sgfbram.hxx
@@ -41,11 +41,11 @@
#define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
// Konstanten fr SgfHeader.SwGrCol
-#define SgfBlckWhit 1 /* Schwarz/Wei Bild Ŀ SimpVector, */
-#define SgfGrayscal 2 /* Bild mit Graustufen StarDraw und */
+#define SgfBlckWhit 1 /* Schwarz/Wei?Bild Ŀ SimpVector, */
+#define SgfGrayscal 2 /* Bild mit Graustufen ?StarDraw und */
#define Sgf16Colors 3 /* Farbbild (16 Farben) Bit Image */
#define SgfVectFarb 4 /* Farben fr Linien verwenden Ŀ */
-#define SgfVectGray 5 /* Graustufen fr Linien verwenden Nur fr */
+#define SgfVectGray 5 /* Graustufen fr Linien verwenden ?Nur fr */
#define SgfVectWdth 6 /* Strichstrken fr Linien verwenden SimpVector */
@@ -53,35 +53,35 @@
class SgfHeader
{
public:
- UINT16 Magic;
- UINT16 Version;
- UINT16 Typ;
- UINT16 Xsize;
- UINT16 Ysize;
- INT16 Xoffs;
- INT16 Yoffs;
- UINT16 Planes; // Layer
- UINT16 SwGrCol;
+ sal_uInt16 Magic;
+ sal_uInt16 Version;
+ sal_uInt16 Typ;
+ sal_uInt16 Xsize;
+ sal_uInt16 Ysize;
+ sal_Int16 Xoffs;
+ sal_Int16 Yoffs;
+ sal_uInt16 Planes; // Layer
+ sal_uInt16 SwGrCol;
char Autor[10];
char Programm[10];
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
- UINT32 GetOffset();
+ sal_uInt32 GetOffset();
friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
- BOOL ChkMagic();
+ sal_Bool ChkMagic();
};
#define SgfEntrySize 22
class SgfEntry
{
public:
- UINT16 Typ;
- UINT16 iFrei;
- UINT16 lFreiLo,lFreiHi;
+ sal_uInt16 Typ;
+ sal_uInt16 iFrei;
+ sal_uInt16 lFreiLo,lFreiHi;
char cFrei[10];
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
- UINT32 GetOffset();
+ sal_uInt32 GetOffset();
friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
};
@@ -89,10 +89,10 @@ public:
class SgfVector
{
public:
- UINT16 Flag;
- INT16 x;
- INT16 y;
- UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
+ sal_uInt16 Flag;
+ sal_Int16 x;
+ sal_Int16 y;
+ sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
};
@@ -103,7 +103,7 @@ extern long SgfVectXmul;
extern long SgfVectYmul;
extern long SgfVectXdiv;
extern long SgfVectYdiv;
-extern BOOL SgfVectScal;
+extern sal_Bool SgfVectScal;
////////////////////////////////////////////////////////////////////////////////////////////////////
// Windows BMP /////////////////////////////////////////////////////////////////////////////////////
@@ -113,15 +113,15 @@ extern BOOL SgfVectScal;
class BmpFileHeader
{
public:
- UINT16 Typ; // = "BM"
- UINT16 SizeLo,SizeHi; // Filesize in Bytes
- UINT16 Reserve1; // Reserviert
- UINT16 Reserve2; // Reserviert
- UINT16 OfsLo,OfsHi; // Offset?
-
- void SetSize(UINT32 Size);
- void SetOfs(UINT32 Size);
- UINT32 GetOfs();
+ sal_uInt16 Typ; // = "BM"
+ sal_uInt16 SizeLo,SizeHi; // Filesize in Bytes
+ sal_uInt16 Reserve1; // Reserviert
+ sal_uInt16 Reserve2; // Reserviert
+ sal_uInt16 OfsLo,OfsHi; // Offset?
+
+ void SetSize(sal_uInt32 Size);
+ void SetOfs(sal_uInt32 Size);
+ sal_uInt32 GetOfs();
friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
};
@@ -129,17 +129,17 @@ public:
class BmpInfoHeader
{
public:
- UINT32 Size; // Gre des BmpInfoHeaders
- INT32 Width; // Breite in Pixel
- INT32 Hight; // Hhe in Pixel
- UINT16 Planes; // Anzahl der Planes (immer 1)
- UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
- UINT32 Compress; // Datenkompression
- UINT32 ImgSize; // Gre der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
- INT32 xDpmm; // Dot per Meter (0 ist erlaubt)
- INT32 yDpmm; // Dot per Meter (0 ist erlaubt)
- UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
- UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle)
+ sal_uInt32 Size; // Gre des BmpInfoHeaders
+ sal_Int32 Width; // Breite in Pixel
+ sal_Int32 Hight; // Hhe in Pixel
+ sal_uInt16 Planes; // Anzahl der Planes (immer 1)
+ sal_uInt16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
+ sal_uInt32 Compress; // Datenkompression
+ sal_uInt32 ImgSize; // Gre der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
+ sal_Int32 xDpmm; // Dot per Meter (0 ist erlaubt)
+ sal_Int32 yDpmm; // Dot per Meter (0 ist erlaubt)
+ sal_uInt32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
+ sal_uInt32 ColMust; // Anzahl der wichtigen Farben (0=alle)
friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
};
@@ -147,12 +147,12 @@ public:
#define RGBQuadSize 4
class RGBQuad {
private:
- BYTE Red;
- BYTE Grn;
- BYTE Blu;
- BYTE Fil;
+ sal_uInt8 Red;
+ sal_uInt8 Grn;
+ sal_uInt8 Blu;
+ sal_uInt8 Fil;
public:
- RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; }
+ RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; }
};
#endif //_SGFBRAM_HXX
diff --git a/svtools/source/inc/sgffilt.hxx b/svtools/source/inc/sgffilt.hxx
index e21810c6109e..427ba7edc8b0 100644
--- a/svtools/source/inc/sgffilt.hxx
+++ b/svtools/source/inc/sgffilt.hxx
@@ -30,10 +30,10 @@
#define _SGFFILT_HXX
#include <tools/urlobj.hxx>
-BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion);
-BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut);
-BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf);
-BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath );
+sal_uInt8 CheckSgfTyp(SvStream& rInp, sal_uInt16& nVersion);
+sal_Bool SgfBMapFilter(SvStream& rInp, SvStream& rOut);
+sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf);
+sal_Bool SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath );
// Konstanten fr CheckSgfTyp()
#define SGF_BITIMAGE 1 /* Bitmap */
diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx
index 25a4785c9b15..b4c79e748ab6 100644
--- a/svtools/source/inc/sgvmain.hxx
+++ b/svtools/source/inc/sgvmain.hxx
@@ -37,8 +37,8 @@
#define UCHAR unsigned char
struct PointType {
- INT16 x;
- INT16 y;
+ sal_Int16 x;
+ sal_Int16 y;
};
#define SgfDpmm 40
@@ -46,7 +46,7 @@ struct PointType {
#define DtHdSize 256
class DtHdType {
public:
- BYTE Reserved[256];
+ sal_uInt8 Reserved[256];
friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd);
friend void DtHdOverSeek(SvStream& rInp);
};
@@ -54,30 +54,30 @@ public:
struct Seitenformat {
PointType Size; // 0.00mm...819.175mm (Papiergr��e)
- INT16 RandL; // links Rand auf
- INT16 RandR; // rechts dem Papier
- INT16 RandO; // oben Rand auf
- INT16 RandU; // unten dem Papier
- BYTE PColor; // Future Use
- BYTE PIntens; // erst recht Future use
-// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+ sal_Int16 RandL; // links Rand auf
+ sal_Int16 RandR; // rechts dem Papier
+ sal_Int16 RandO; // oben Rand auf
+ sal_Int16 RandU; // unten dem Papier
+ sal_uInt8 PColor; // Future Use
+ sal_uInt8 PIntens; // erst recht Future use
+// sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
};
#define PageSize 146
class PageType {
public:
- UINT32 Next; // N�chste Seite
- UINT32 nList; // Objektdaten, erster Record
- UINT32 ListEnd; // Objektdaten, letzter Record
+ sal_uInt32 Next; // N�chste Seite
+ sal_uInt32 nList; // Objektdaten, erster Record
+ sal_uInt32 ListEnd; // Objektdaten, letzter Record
Seitenformat Paper; // Papierdaten
- BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
- BYTE StdPg; // welche Standardseite einblenden ?
+ sal_Bool BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+ sal_uInt8 StdPg; // welche Standardseite einblenden ?
PointType U; // Nullpunkt
- INT16 HlpLnH[20]; // Hilfslinien
- INT16 HlpLnV[20];
- BYTE LnAnzH;
- BYTE LnAnzV;
+ sal_Int16 HlpLnH[20]; // Hilfslinien
+ sal_Int16 HlpLnV[20];
+ sal_uInt8 LnAnzH;
+ sal_uInt8 LnAnzV;
UCHAR PgName[32]; // Seitenname
friend SvStream& operator>>(SvStream& rIStream, PageType& rPage);
};
@@ -87,21 +87,21 @@ enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln,
ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi};
struct ObjLineType {
- BYTE LFarbe; // [Index]
- BYTE LBFarbe; // [Index]
- BYTE LIntens; // [%]
- BYTE LMuster; // [Index] inkl. Transparenz
- INT16 LMSize; // [Koeffizient/100]
- INT16 LDicke; // Strichst�rke
+ sal_uInt8 LFarbe; // [Index]
+ sal_uInt8 LBFarbe; // [Index]
+ sal_uInt8 LIntens; // [%]
+ sal_uInt8 LMuster; // [Index] inkl. Transparenz
+ sal_Int16 LMSize; // [Koeffizient/100]
+ sal_Int16 LDicke; // Strichst�rke
};
struct ObjAreaType {
- BYTE FFarbe; // [Index]
- BYTE FBFarbe; // [Index]
- BYTE FIntens; // [%]
- BYTE FDummy1; //
- INT16 FDummy2; //
- UINT16 FMuster; // [Index] inkl. Invers, Transparenz
+ sal_uInt8 FFarbe; // [Index]
+ sal_uInt8 FBFarbe; // [Index]
+ sal_uInt8 FIntens; // [%]
+ sal_uInt8 FDummy1; //
+ sal_Int16 FDummy2; //
+ sal_uInt16 FMuster; // [Index] inkl. Invers, Transparenz
};
#define ObjTextTypeSize 64
@@ -109,24 +109,24 @@ class ObjTextType {
public:
ObjLineType L; // Text-Outline (future)
ObjAreaType F; // Text innen
- UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType.
- UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein
- UINT16 Breite; // 1..65535% bitte nicht mehr als 500%
- BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo)
- BYTE Kapit; // 1..255%
- UINT16 Schnitt; // 8 Flags
- UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile
- UINT16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen)
- BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als
- INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�)
+ sal_uInt16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType.
+ sal_uInt16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein
+ sal_uInt16 Breite; // 1..65535% bitte nicht mehr als 500%
+ sal_uInt8 Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo)
+ sal_uInt8 Kapit; // 1..255%
+ sal_uInt16 Schnitt; // 8 Flags
+ sal_uInt16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile
+ sal_uInt16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen)
+ sal_uInt8 ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als
+ sal_sChar ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�)
ObjLineType ShdL; // Schatten-Outline (neu 2.0)
ObjAreaType ShdF; // Schatten-innen (neu 2.0)
PointType ShdVers; // Schattenversatz Max.300.00%
- BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad
- BOOL NoSpc; // True-> kein Zwischenraum (f�r BackArea)
+ sal_Bool ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad
+ sal_Bool NoSpc; // True-> kein Zwischenraum (f�r BackArea)
ObjAreaType BackF; // Hintergrundfl�che
- UINT32 GetFont();
- void SetFont(UINT32 FontID);
+ sal_uInt32 GetFont();
+ void SetFont(sal_uInt32 FontID);
};
class Obj0Type { // SuperClass f�r Apple-VMT
@@ -138,16 +138,16 @@ public:
#define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/
class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte
public:
- UINT32 Last;
- UINT32 Next;
- UINT16 MemSize; // in Bytes
+ sal_uInt32 Last;
+ sal_uInt32 Next;
+ sal_uInt16 MemSize; // in Bytes
PointType ObjMin; // XY-Minimum des Objekts
PointType ObjMax; // XY-Maximum des Objekts
- BYTE Art;
- BYTE Layer;
-// BYTE Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Art;
+ sal_uInt8 Layer;
+// sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk);
- friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
+ friend sal_Bool ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
virtual void Draw(OutputDevice& rOut);
};
@@ -155,8 +155,8 @@ public:
#define StrkSize 38
class StrkType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // Linienenden
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // Linienenden
ObjLineType L;
PointType Pos1; // Anfangspunkt
PointType Pos2; // Endpunkt
@@ -168,15 +168,15 @@ public:
#define RectSize 52
class RectType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve;
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve;
ObjLineType L;
ObjAreaType F;
PointType Pos1; // LO-Ecke = Bezugspunkt
PointType Pos2; // R-Ecke
- INT16 Radius; // Eckenradius
- UINT16 DrehWink; // 315...<45
- UINT16 Slant; // >270...<90
+ sal_Int16 Radius; // Eckenradius
+ sal_uInt16 DrehWink; // 315...<45
+ sal_uInt16 Slant; // >270...<90
friend SvStream& operator>>(SvStream& rIStream, RectType& rRect);
virtual void Draw(OutputDevice& rOut);
};
@@ -185,13 +185,13 @@ public:
#define PolySize 44
class PolyType: public ObjkType { // identisch mit Spline !
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur f�r Polyline
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur f�r Polyline
ObjLineType L;
ObjAreaType F; // nicht f�r Polyline
- BYTE nPoints;
- BYTE Reserve;
- UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ sal_uInt8 nPoints;
+ sal_uInt8 Reserve;
+ sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly);
virtual void Draw(OutputDevice& rOut);
@@ -202,13 +202,13 @@ public:
#define SplnSize 44
class SplnType: public ObjkType { // identisch mit Poly !
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur f�r nSpline
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur f�r nSpline
ObjLineType L;
ObjAreaType F; // nicht f�r nSpline
- BYTE nPoints;
- BYTE Reserve;
- UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ sal_uInt8 nPoints;
+ sal_uInt8 Reserve;
+ sal_uInt32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln);
virtual void Draw(OutputDevice& rOut);
@@ -219,15 +219,15 @@ public:
#define CircSize 52
class CircType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE LEnden; // nur Bogen (Kr & El)
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 LEnden; // nur Bogen (Kr & El)
ObjLineType L;
ObjAreaType F; // nicht f�r Bogen (Kr & El)
PointType Center; // Mittelpunkt
PointType Radius; // Radius
- UINT16 DrehWink; // nur Ellipse
- UINT16 StartWink; // � nicht f�r Vollkreis
- UINT16 RelWink; // � und Vollellipse
+ sal_uInt16 DrehWink; // nur Ellipse
+ sal_uInt16 StartWink; // � nicht f�r Vollkreis
+ sal_uInt16 RelWink; // � und Vollellipse
friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc);
virtual void Draw(OutputDevice& rOut);
};
@@ -240,19 +240,19 @@ public:
#define TextSize 116
class TextType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve; // f�r Word Allign
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve; // f�r Word Allign
ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich
PointType Pos1; // Bezugspunkt (ObenLinks)
PointType Pos2; // (untenRechts)
- INT16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify)
- UINT16 DrehWink; // 0...<360
- UINT16 BoxSlant; // >270...<90 (nur Box)
- UINT16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so
- UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich
- UINT16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich
+ sal_Int16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify)
+ sal_uInt16 DrehWink; // 0...<360
+ sal_uInt16 BoxSlant; // >270...<90 (nur Box)
+ sal_uInt16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so
+ sal_uInt16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich
+ sal_uInt16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich
PointType FitSize; // Ursprungsgr��e f�r Fit2Size
- INT16 FitBreit; // Breite zum formatieren bei Fit2Size
+ sal_Int16 FitBreit; // Breite zum formatieren bei Fit2Size
UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gef�llt, sondern explizit!
friend SvStream& operator>>(SvStream& rIStream, TextType& rText);
virtual void Draw(OutputDevice& rOut);
@@ -269,21 +269,21 @@ enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf};
#define BmapSize 132
class BmapType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
- BYTE Reserve;
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Reserve;
ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap
PointType Pos1;
PointType Pos2;
- UINT16 DrehWink; // 315...<45 (Future)
- UINT16 Slant; // >270...<90 (Future)
+ sal_uInt16 DrehWink; // 315...<45 (Future)
+ sal_uInt16 Slant; // >270...<90 (Future)
UCHAR Filename[80]; // Pfad
PointType PixSize; // Gr��e in Pixel (0 bei Vektor)
GrafStat Format; // siehe GpmDef.Pas
- BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor)
- BOOL RawOut; // als Raw ausgeben ?
- BOOL InvOut; // invertiert ausgeben ?
- BOOL LightOut; // aufhellen? (SD20)
- BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp)
+ sal_uInt8 nPlanes; // Anzahl der Bitplanes (0 bei Vektor)
+ sal_Bool RawOut; // als Raw ausgeben ?
+ sal_Bool InvOut; // invertiert ausgeben ?
+ sal_Bool LightOut; // aufhellen? (SD20)
+ sal_uInt8 GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp)
INetURLObject aFltPath; // F�r GraphicFilter
friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap);
@@ -295,13 +295,13 @@ public:
#define GrupSize 48
class GrupType: public ObjkType {
public:
- BYTE Flags; // (Schummel f�r Allignment unter NT)
+ sal_uInt8 Flags; // (Schummel f�r Allignment unter NT)
UCHAR Name[13]; // Name der Gruppe
- UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich
- UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich
- UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur
- UINT32 ChartPtr; // Diagrammstruktur
- UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist.
+ sal_uInt16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich
+ sal_uInt16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich
+ sal_uInt16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur
+ sal_uInt32 ChartPtr; // Diagrammstruktur
+ sal_uInt32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist.
friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup);
// virtual void Draw(OutputDevice& rOut);
};
@@ -309,26 +309,26 @@ public:
void SetLine(ObjLineType& rLine, OutputDevice& rOut);
void SetArea(ObjAreaType& rArea, OutputDevice& rOut);
-Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts);
-void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs);
-void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs);
-INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div);
-UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div);
+Color Sgv2SvFarbe(sal_uInt8 nFrb1, sal_uInt8 nFrb2, sal_uInt8 nInts);
+void RotatePoint(PointType& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs);
+void RotatePoint(Point& P, sal_Int16 cx, sal_Int16 cy, double sn, double cs);
+sal_Int16 iMulDiv(sal_Int16 a, sal_Int16 Mul, sal_Int16 Div);
+sal_uInt16 MulDiv(sal_uInt16 a, sal_uInt16 Mul, sal_uInt16 Div);
class SgfFontOne {
public:
SgfFontOne* Next; // Zeiger f�r Listenverkettung
- UINT32 IFID;
- BOOL Bold;
- BOOL Ital;
- BOOL Sans;
- BOOL Serf;
- BOOL Fixd;
+ sal_uInt32 IFID;
+ sal_Bool Bold;
+ sal_Bool Ital;
+ sal_Bool Sans;
+ sal_Bool Serf;
+ sal_Bool Fixd;
FontFamily SVFamil;
CharSet SVChSet;
String SVFName; // z.B. "Times New Roman" = 15 Chars
- USHORT SVWidth; // Durchschnittliche Zeichenbreite in %
+ sal_uInt16 SVWidth; // Durchschnittliche Zeichenbreite in %
SgfFontOne();
void ReadOne( ByteString& ID, ByteString& Dsc);
};
@@ -338,15 +338,15 @@ public:
String FNam; // vollst�ndiger Filename des Inifiles
SgfFontOne* pList; // Listenanfang
SgfFontOne* Last; // Listenende
- UINT32 LastID; // f�r schnelleren Zugriff bei Wiederholungen
+ sal_uInt32 LastID; // f�r schnelleren Zugriff bei Wiederholungen
SgfFontOne* LastLn; // f�r schnelleren Zugriff bei Wiederholungen
- BOOL Tried;
+ sal_Bool Tried;
SgfFontLst();
~SgfFontLst();
void AssignFN(const String& rFName);
void ReadList();
void RausList();
- SgfFontOne* GetFontDesc(UINT32 ID);
+ SgfFontOne* GetFontDesc(sal_uInt32 ID);
};
#endif //_SGVMAIN_HXX
diff --git a/svtools/source/inc/sgvspln.hxx b/svtools/source/inc/sgvspln.hxx
index daa92e62db1c..18c86f743715 100644
--- a/svtools/source/inc/sgvspln.hxx
+++ b/svtools/source/inc/sgvspln.hxx
@@ -39,14 +39,14 @@
|* Polygons werden als Sttzstellen angenommen.
|* n liefert die Anzahl der Teilpolynome.
|* Ist die Berechnung fehlerfrei verlaufen, so
-|* liefert die Funktion TRUE. Nur in diesem Fall
+|* liefert die Funktion sal_True. Nur in diesem Fall
|* ist Speicher fr die Koeffizientenarrays
|* allokiert, der dann spter vom Aufrufer mittels
|* delete freizugeben ist.
|*
*************************************************************************/
-BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n,
double*& ax, double*& ay, double*& bx, double*& by,
double*& cx, double*& cy, double*& dx, double*& dy, double*& T);
@@ -57,15 +57,15 @@ BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
|* Beschreibung Konvertiert einen parametrichen kubischen
|* Polynomspline Spline (natrlich oder periodisch)
|* in ein angenhertes Polygon.
-|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* Die Funktion liefert sal_False, wenn ein Fehler bei
|* der Koeffizientenberechnung aufgetreten ist oder
-|* das Polygon zu gro wird (>PolyMax=16380). Im 1.
+|* das Polygon zu gro?wird (>PolyMax=16380). Im 1.
|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
|* Um Koordinatenberlufe zu vermeiden werden diese
|* auf +/-32000 begrenzt.
|*
*************************************************************************/
-BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly);
+sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly);
#endif //_SGVSPLN_HXX
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index fdc7fb867542..122416f8764d 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -61,9 +61,9 @@ public:
void BeginDrag();
void CreateAnchor();
void DestroyAnchor();
- BOOL SetCursorAtPoint( const Point& rPoint,
- BOOL bDontSelectAtCursor=FALSE );
- BOOL IsSelectionAtPoint( const Point& rPoint );
+ sal_Bool SetCursorAtPoint( const Point& rPoint,
+ sal_Bool bDontSelectAtCursor=sal_False );
+ sal_Bool IsSelectionAtPoint( const Point& rPoint );
void DeselectAtPoint( const Point& rPoint );
void DeselectAll();
};
@@ -140,22 +140,22 @@ private:
long nNodeBmpWidth;
long nNextVerVisSize;
long nMostRight;
- ULONG nVisibleCount; // Anzahl Zeilen im Control
- ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen
+ sal_uLong nVisibleCount; // Anzahl Zeilen im Control
+ sal_uLong nCurUserEvent; //-1 == kein Userevent amn Laufen
short nHorSBarHeight, nVerSBarWidth;
- USHORT nFlags;
- USHORT nCurTabPos;
+ sal_uInt16 nFlags;
+ sal_uInt16 nCurTabPos;
- WinBits nWinBits;
+ WinBits m_nStyle;
ExtendedWinBits nExtendedWinBits;
- BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION
- BOOL bUpdateMode : 1;
- BOOL bInVScrollHdl : 1;
- BOOL bAsyncBeginDrag : 1;
- BOOL bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with FALSE
- BOOL bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with FALSE
- BOOL bContextMenuHandling : 1;
- BOOL bIsCellFocusEnabled : 1;
+ sal_Bool bSimpleTravel : 1; // ist sal_True bei SINGLE_SELECTION
+ sal_Bool bUpdateMode : 1;
+ sal_Bool bInVScrollHdl : 1;
+ sal_Bool bAsyncBeginDrag : 1;
+ sal_Bool bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with sal_False
+ sal_Bool bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with sal_False
+ sal_Bool bContextMenuHandling : 1;
+ sal_Bool bIsCellFocusEnabled : 1;
sal_Bool bAreChildrenTransient;
@@ -179,16 +179,16 @@ private:
void ShowVerSBar();
// setzt Thumb auf FirstEntryToDraw
void SyncVerThumb();
- BOOL IsLineVisible( long nY ) const;
+ sal_Bool IsLineVisible( long nY ) const;
long GetEntryLine( SvLBoxEntry* pEntry ) const;
void FillView();
void CursorDown();
void CursorUp();
void KeyLeftRight( long nDiff );
- void PageDown( USHORT nDelta );
- void PageUp( USHORT nDelta );
+ void PageDown( sal_uInt16 nDelta );
+ void PageUp( sal_uInt16 nDelta );
- void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE );
+ void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
void DrawNet();
@@ -202,39 +202,39 @@ private:
// Selection-Engine
SvLBoxEntry* MakePointVisible( const Point& rPoint,
- BOOL bNotifyScroll=TRUE );
+ sal_Bool bNotifyScroll=sal_True );
void SetAnchorSelection( SvLBoxEntry* pOld,
SvLBoxEntry* pNewCursor );
void BeginDrag();
- BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt,
+ sal_Bool ButtonDownCheckCtrl( const MouseEvent& rMEvt,
SvLBoxEntry* pEntry, long nY );
- BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt,
+ sal_Bool MouseMoveCheckCtrl( const MouseEvent& rMEvt,
SvLBoxEntry* pEntry );
- BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt );
- BOOL ButtonDownCheckExpand( const MouseEvent&,
+ sal_Bool ButtonUpCheckCtrl( const MouseEvent& rMEvt );
+ sal_Bool ButtonDownCheckExpand( const MouseEvent&,
SvLBoxEntry*,long nY );
- void PositionScrollBars( Size& rOSize, USHORT nMask );
- USHORT AdjustScrollBars( Size& rSize );
+ void PositionScrollBars( Size& rOSize, sal_uInt16 nMask );
+ sal_uInt16 AdjustScrollBars( Size& rSize );
void BeginScroll();
void EndScroll();
- BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;}
+ sal_Bool InScroll() const { return (sal_Bool)(nFlags & F_IN_SCROLLING)!=0;}
Rectangle GetVisibleArea() const;
- BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine);
+ sal_Bool EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine);
void InitScrollBarBox();
SvLBoxTab* NextTab( SvLBoxTab* );
- BOOL SetMostRight( SvLBoxEntry* pEntry );
+ sal_Bool SetMostRight( SvLBoxEntry* pEntry );
void FindMostRight( SvLBoxEntry* EntryToIgnore );
void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore );
void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore );
void NotifyTabsChanged();
- inline BOOL IsExpandable() const // if element at cursor can be expanded in general
+ inline sal_Bool IsExpandable() const // if element at cursor can be expanded in general
{ return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); }
- inline BOOL IsNowExpandable() const // if element at cursor can be expanded at this moment
+ inline sal_Bool IsNowExpandable() const // if element at cursor can be expanded at this moment
{ return IsExpandable() && !pView->IsExpanded( pCursor ); }
static void implInitDefaultNodeImages();
@@ -257,7 +257,7 @@ public:
~SvImpLBox();
void Clear();
- void SetWindowBits( WinBits nWinStyle );
+ void SetStyle( WinBits i_nWinStyle );
void SetExtendedWindowBits( ExtendedWinBits _nBits );
ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; }
void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;}
@@ -273,40 +273,40 @@ public:
void EntryExpanded( SvLBoxEntry* pEntry );
void EntryCollapsed( SvLBoxEntry* pEntry );
void CollapsingEntry( SvLBoxEntry* pEntry );
- void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+ void EntrySelected( SvLBoxEntry*, sal_Bool bSelect );
void Paint( const Rectangle& rRect );
void RepaintSelectionItems();
void MouseButtonDown( const MouseEvent& );
void MouseButtonUp( const MouseEvent& );
void MouseMove( const MouseEvent&);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
void UpdateAll(
- BOOL bInvalidateCompleteView= TRUE,
- BOOL bUpdateVerSBar = TRUE );
+ sal_Bool bInvalidateCompleteView= sal_True,
+ sal_Bool bUpdateVerSBar = sal_True );
void SetEntryHeight( short nHeight );
void PaintEntry( SvLBoxEntry* pEntry );
void InvalidateEntry( SvLBoxEntry* );
void RecalcFocusRect();
- inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect );
+ inline void SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect );
void SetDragDropMode( DragDropMode eDDMode );
void SetSelectionMode( SelectionMode eSelMode );
- void SetAddMode( BOOL ) { aSelEng.AddAlways(FALSE); }
- BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); }
+ void SetAddMode( sal_Bool ) { aSelEng.AddAlways(sal_False); }
+ sal_Bool IsAddMode() const { return aSelEng.IsAlwaysAdding(); }
SvLBoxEntry* GetCurrentEntry() const { return pCursor; }
- BOOL IsEntryInView( SvLBoxEntry* ) const;
+ sal_Bool IsEntryInView( SvLBoxEntry* ) const;
SvLBoxEntry* GetEntry( const Point& rPos ) const;
// gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag
SvLBoxEntry* GetClickedEntry( const Point& ) const;
SvLBoxEntry* GetCurEntry() const { return pCursor; }
void SetCurEntry( SvLBoxEntry* );
Point GetEntryPosition( SvLBoxEntry* ) const;
- void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE );
+ void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False );
void PaintDDCursor( SvLBoxEntry* );
@@ -329,38 +329,38 @@ public:
static const Image& GetDefaultCollapsedNodeImage( );
const Size& GetOutputSize() const { return aOutputSize;}
- void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE );
- void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE );
- bool Command( const CommandEvent& rCEvt );
+ void KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll = sal_True );
+ void KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll = sal_True );
+ void Command( const CommandEvent& rCEvt );
void Invalidate();
void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); }
- void SelAllDestrAnch( BOOL bSelect,
- BOOL bDestroyAnchor = TRUE,
- BOOL bSingleSelToo = FALSE );
- void ShowCursor( BOOL bShow );
+ void SelAllDestrAnch( sal_Bool bSelect,
+ sal_Bool bDestroyAnchor = sal_True,
+ sal_Bool bSingleSelToo = sal_False );
+ void ShowCursor( sal_Bool bShow );
- BOOL RequestHelp( const HelpEvent& rHEvt );
+ sal_Bool RequestHelp( const HelpEvent& rHEvt );
void EndSelection();
- BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const;
+ sal_Bool IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const;
void RepaintScrollBars();
- void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; }
- void SetUpdateMode( BOOL );
- void SetUpdateModeFast( BOOL );
- BOOL GetUpdateMode() const { return bUpdateMode; }
+ void EnableAsyncDrag( sal_Bool b) { bAsyncBeginDrag = b; }
+ void SetUpdateMode( sal_Bool );
+ void SetUpdateModeFast( sal_Bool );
+ sal_Bool GetUpdateMode() const { return bUpdateMode; }
Rectangle GetClipRegionRect() const;
- BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); }
+ sal_Bool HasHorScrollBar() const { return aHorSBar.IsVisible(); }
void ShowFocusRect( const SvLBoxEntry* pEntry );
void SetTabBar( TabBar* pTabBar );
void CancelPendingEdit();
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
/** Enables, that one cell of a tablistbox entry can be focused */
- inline BOOL IsCellFocusEnabled() const { return bIsCellFocusEnabled; }
- inline void EnableCellFocus() { bIsCellFocusEnabled = TRUE; }
- bool SetCurrentTabPos( USHORT _nNewPos );
- inline USHORT GetCurrentTabPos() const { return nCurTabPos; }
+ inline sal_Bool IsCellFocusEnabled() const { return bIsCellFocusEnabled; }
+ inline void EnableCellFocus() { bIsCellFocusEnabled = sal_True; }
+ bool SetCurrentTabPos( sal_uInt16 _nNewPos );
+ inline sal_uInt16 GetCurrentTabPos() const { return nCurTabPos; }
bool IsSelectable( const SvLBoxEntry* pEntry );
};
@@ -432,11 +432,11 @@ inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry )
pView->PaintEntry( pEntry, nY );
}
-inline BOOL SvImpLBox::IsLineVisible( long nY ) const
+inline sal_Bool SvImpLBox::IsLineVisible( long nY ) const
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nY < 0 || nY >= aOutputSize.Height() )
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx
index 8d297e3476db..585827ff0c05 100644
--- a/svtools/source/inc/svimpicn.hxx
+++ b/svtools/source/inc/svimpicn.hxx
@@ -93,7 +93,6 @@ class SvImpIconView
nGridDY;
long nHorSBarHeight,
nVerSBarWidth;
- WinBits nWinBits;
int nViewMode;
long nHorDist;
long nVerDist;
@@ -101,8 +100,8 @@ class SvImpIconView
long nMaxBmpHeight;
long nMaxTextWidth;
long nMaxBoundHeight; // Hoehe des hoechsten BoundRects
- ULONG nFlags;
- ULONG nCurUserEvent;
+ sal_uLong nFlags;
+ sal_uLong nCurUserEvent;
SvLBoxEntry* pCurParent;
SvLBoxEntry* pCursor;
SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist
@@ -113,12 +112,12 @@ class SvImpIconView
VirtualDevice* pDDTempDev;
SvIconViewTextMode eTextMode;
- BOOL bMustRecalcBoundingRects;
+ sal_Bool bMustRecalcBoundingRects;
void CheckAllSizes();
void CheckSizes( SvLBoxEntry* pEntry,
const SvIcnVwDataEntry* pViewData = 0 );
- void ShowCursor( BOOL bShow );
+ void ShowCursor( sal_Bool bShow );
void SetNextEntryPos(const Point& rPos);
Point FindNextEntryPos( const Size& rBoundSize );
@@ -135,7 +134,7 @@ class SvImpIconView
void AdjustScrollBars();
void PositionScrollBars( long nRealWidth, long nRealHeight );
void CalcDocPos( Point& aMousePos );
- BOOL GetResizeRect( Rectangle& );
+ sal_Bool GetResizeRect( Rectangle& );
void PaintResizeRect( const Rectangle& );
SvLBoxEntry* GetNewCursor();
void ToggleSelection( SvLBoxEntry* );
@@ -158,8 +157,8 @@ class SvImpIconView
SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry,
const SvIcnVwDataEntry* pViewData ) const;
- BOOL CheckVerScrollBar();
- BOOL CheckHorScrollBar();
+ sal_Bool CheckVerScrollBar();
+ sal_Bool CheckHorScrollBar();
void CancelUserEvent();
public:
@@ -167,8 +166,8 @@ public:
SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle );
~SvImpIconView();
- void Clear( BOOL bInCtor = FALSE );
- void SetWindowBits( WinBits nWinStyle );
+ void Clear( sal_Bool bInCtor = sal_False );
+ void SetStyle( const WinBits i_nWinStyle );
void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent )
{ pModel = pTree; SetCurParent(pParent); }
void EntryInserted( SvLBoxEntry*);
@@ -182,14 +181,14 @@ public:
void EntryExpanded( SvLBoxEntry* pEntry );
void EntryCollapsed( SvLBoxEntry* pEntry );
void CollapsingEntry( SvLBoxEntry* pEntry );
- void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+ void EntrySelected( SvLBoxEntry*, sal_Bool bSelect );
void Paint( const Rectangle& rRect );
void RepaintSelectionItems();
void MouseButtonDown( const MouseEvent& );
void MouseButtonUp( const MouseEvent& );
void MouseMove( const MouseEvent&);
- BOOL KeyInput( const KeyEvent& );
+ sal_Bool KeyInput( const KeyEvent& );
void Resize();
void GetFocus();
void LoseFocus();
@@ -199,8 +198,8 @@ public:
void PaintEntry( SvLBoxEntry*, const Point&,
SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0);
void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos,
- BOOL bAdjustRow = FALSE,
- BOOL bCheckScrollBars = FALSE );
+ sal_Bool bAdjustRow = sal_False,
+ sal_Bool bCheckScrollBars = sal_False );
void InvalidateEntry( SvLBoxEntry* );
void ViewDataInitialized( SvLBoxEntry* pEntry );
SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos );
@@ -215,7 +214,7 @@ public:
SvLBoxEntry* GetCurEntry() const { return pCursor; }
void SetCursor( SvLBoxEntry* );
- BOOL IsEntryInView( SvLBoxEntry* );
+ sal_Bool IsEntryInView( SvLBoxEntry* );
SvLBoxEntry* GetEntry( const Point& rDocPos );
SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
@@ -235,7 +234,7 @@ public:
SvIcnVwDataEntry* pViewData=0 );
Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0,
const Point* pPos = 0,
- BOOL bForInplaceEdit = FALSE,
+ sal_Bool bForInplaceEdit = sal_False,
SvIcnVwDataEntry* pViewData = 0 );
long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const;
@@ -252,22 +251,22 @@ public:
SvIcnVwDataEntry* pViewData=0);
void InvalidateBoundingRect( SvLBoxEntry* );
void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; }
- BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); }
+ sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); }
- void PaintEmphasis( const Rectangle&, BOOL bSelected,
- BOOL bCursored, OutputDevice* pOut = 0 );
+ void PaintEmphasis( const Rectangle&, sal_Bool bSelected,
+ sal_Bool bCursored, OutputDevice* pOut = 0 );
void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem,
- SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 );
- // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
+ SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, OutputDevice* pOut = 0 );
+ // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True
void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); }
// berechnet alle invalidierten BoundingRects neu
void UpdateBoundingRects();
- void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow );
+ void ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow );
SvLBoxEntry* GetDropTarget( const Point& rPosPixel );
- BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
- BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
+ sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
+ sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos );
void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
@@ -275,9 +274,9 @@ public:
void SetCurParent( SvLBoxEntry* pNewParent );
SvLBoxEntry* GetCurParent() const { return pCurParent; }
- USHORT GetSelectionCount() const;
+ sal_uInt16 GetSelectionCount() const;
void SetGrid( long nDX, long nDY );
- void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE );
+ void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False );
const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*,
const SvIcnVwDataEntry* pViewData = 0 ) const;
void PrepareCommandEvent( const Point& rPt );
@@ -288,18 +287,18 @@ public:
SvLBoxEntry* mpViewData;
- BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const;
- void SelectRect( const Rectangle&, BOOL bAdd = TRUE,
+ sal_Bool IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const;
+ void SelectRect( const Rectangle&, sal_Bool bAdd = sal_True,
SvPtrarr* pOtherRects = 0,
short nOffs = SELRECT_BORDER_OFFS );
void DrawSelectionRect( const Rectangle& );
void HideSelectionRect();
void CalcScrollOffsets( const Point& rRefPosPixel,
- long& rX, long& rY, BOOL bDragDrop = FALSE,
- USHORT nBorderWidth = 10 );
+ long& rX, long& rY, sal_Bool bDragDrop = sal_False,
+ sal_uInt16 nBorderWidth = 10 );
void EndTracking();
- BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos );
- void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE);
+ sal_Bool IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos );
+ void MakeVisible( const Rectangle& rDocPos,sal_Bool bInScrollBarEvent=sal_False);
void AdjustAtGrid( SvLBoxEntry* pStart = 0 );
void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 );
SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0,
diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx
index 030a09a6185e..0e9b178e9428 100644
--- a/svtools/source/inc/xbmread.hxx
+++ b/svtools/source/inc/xbmread.hxx
@@ -66,13 +66,13 @@ class XBMReader : public GraphicReader
long nLastPos;
long nWidth;
long nHeight;
- BOOL bStatus;
+ sal_Bool bStatus;
void InitTable();
ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
const char* pTok2 = NULL, const char* pTok3 = NULL );
long ParseDefine( const sal_Char* pDefine );
- BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
+ sal_Bool ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
public:
@@ -89,7 +89,7 @@ public:
// - ImportXBM -
// -------------
-BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic );
+sal_Bool ImportXBM( SvStream& rStream, Graphic& rGraphic );
#endif // _XBMREAD_HXX
diff --git a/svtools/source/inc/xpmread.hxx b/svtools/source/inc/xpmread.hxx
index 0ef3d625525a..825a0efe34ea 100644
--- a/svtools/source/inc/xpmread.hxx
+++ b/svtools/source/inc/xpmread.hxx
@@ -82,35 +82,35 @@ private:
BitmapWriteAccess* mpMaskAcc;
long mnLastPos;
- ULONG mnWidth;
- ULONG mnHeight;
- ULONG mnColors;
- ULONG mnCpp; // characters per pix
- BOOL mbTransparent;
- BOOL mbStatus;
- ULONG mnStatus;
- ULONG mnIdentifier;
- BYTE mcThisByte;
- BYTE mcLastByte;
- ULONG mnTempAvail;
- BYTE* mpTempBuf;
- BYTE* mpTempPtr;
- BYTE* mpFastColorTable;
- BYTE* mpColMap;
- ULONG mnStringSize;
- BYTE* mpStringBuf;
- ULONG mnParaSize;
- BYTE* mpPara;
-
- BOOL ImplGetString( void );
- BOOL ImplGetColor( ULONG );
- BOOL ImplGetScanLine( ULONG );
- BOOL ImplGetColSub( BYTE* );
- BOOL ImplGetColKey( BYTE );
- void ImplGetRGBHex( BYTE*, ULONG );
- BOOL ImplGetPara( ULONG numb );
- BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE );
- ULONG ImplGetULONG( ULONG nPara );
+ sal_uLong mnWidth;
+ sal_uLong mnHeight;
+ sal_uLong mnColors;
+ sal_uLong mnCpp; // characters per pix
+ sal_Bool mbTransparent;
+ sal_Bool mbStatus;
+ sal_uLong mnStatus;
+ sal_uLong mnIdentifier;
+ sal_uInt8 mcThisByte;
+ sal_uInt8 mcLastByte;
+ sal_uLong mnTempAvail;
+ sal_uInt8* mpTempBuf;
+ sal_uInt8* mpTempPtr;
+ sal_uInt8* mpFastColorTable;
+ sal_uInt8* mpColMap;
+ sal_uLong mnStringSize;
+ sal_uInt8* mpStringBuf;
+ sal_uLong mnParaSize;
+ sal_uInt8* mpPara;
+
+ sal_Bool ImplGetString( void );
+ sal_Bool ImplGetColor( sal_uLong );
+ sal_Bool ImplGetScanLine( sal_uLong );
+ sal_Bool ImplGetColSub( sal_uInt8* );
+ sal_Bool ImplGetColKey( sal_uInt8 );
+ void ImplGetRGBHex( sal_uInt8*, sal_uLong );
+ sal_Bool ImplGetPara( sal_uLong numb );
+ sal_Bool ImplCompare( sal_uInt8*, sal_uInt8*, sal_uLong, sal_uLong nmode = XPMCASENONSENSITIVE );
+ sal_uLong ImplGetULONG( sal_uLong nPara );
public:
XPMReader( SvStream& rStm );
@@ -125,7 +125,7 @@ public:
// - ImportXPM -
// -------------
-BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic );
+sal_Bool ImportXPM( SvStream& rStream, Graphic& rGraphic );
#endif // _XPMREAD_HXX
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index 6c76d463216e..e4bf442ed42d 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -126,7 +126,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
com::sun::star::java::RestartRequiredException e5;
// Try to recover the Exception type in the any and
// react accordingly.
- USHORT nResult = RET_CANCEL;
+ sal_uInt16 nResult = RET_CANCEL;
::rtl::OUString aParameter;
if ( anyExc >>= e1 )
@@ -136,28 +136,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// No suitable JRE found
SolarMutexGuard aSolarGuard;
m_bJavaNotFound_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND);
- SvpResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_JAVANOTFOUND);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND ));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) );
+ String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) );
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
-
}
else
{
@@ -171,25 +153,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// javavendors.xml was updated and Java has not been configured yet
SolarMutexGuard aSolarGuard;
m_bInvalidSettings_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idWBX = SvtResId(WARNINGBOX_INVALIDJAVASETTINGS);
- SvpResId pidPatchWBX(WARNINGBOX_INVALIDJAVASETTINGS);
- pidPatchWBX.SetRT(RSC_WARNINGBOX);
- ResMgr *pMgrWB = pidPatchWBX.GetResMgr();
- if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX))
- idWBX = pidPatchWBX;
- WarningBox aWarningBox( NULL, idWBX);
-
- String aTitle;
- SvpResId pidString(STR_WARNING_INVALIDJAVASETTINGS);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
-
+ WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) );
+ String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS));
aWarningBox.SetText( aTitle );
nResult = aWarningBox.Execute();
}
@@ -205,28 +170,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
SolarMutexGuard aSolarGuard;
m_bJavaDisabled_Handled = true;
// Java disabled. Give user a chance to enable Java inside Office.
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idQBX = SvtResId( QBX_JAVADISABLED );
- SvpResId pidPatchQBX(QBX_JAVADISABLED);
- pidPatchQBX.SetRT(RSC_QUERYBOX);
- ResMgr *pMgrQB = pidPatchQBX.GetResMgr();
-
- if (pMgrQB && pMgrQB->IsAvailable(pidPatchQBX))
- idQBX = pidPatchQBX;
-
- QueryBox aQueryBox(NULL, idQBX);
-
- String aTitle;
-
- SvpResId pidString(STR_QUESTION_JAVADISABLED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId( STR_QUESTION_JAVADISABLED ));
-
+ QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) );
+ String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) );
aQueryBox.SetText( aTitle );
nResult = aQueryBox.Execute();
if ( nResult == RET_YES )
@@ -249,25 +194,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// Java not correctly installed, or damaged
SolarMutexGuard aSolarGuard;
m_bVMCreationFailure_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_JVMCREATIONFAILED);
- SvpResId pidPatchEBX(ERRORBOX_JVMCREATIONFAILED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox( NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_JVMCREATIONFAILED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_JVMCREATIONFAILED));
-
+ ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
+ String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
@@ -284,25 +212,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
//before it can be used.
SolarMutexGuard aSolarGuard;
m_bRestartRequired_Handled = true;
- //We first try to get the patch resource svp680xxx.res
- //If the resource is not found then svt680xxx.res is used
- ResId idEBX = SvtResId(ERRORBOX_RESTARTREQUIRED);
- SvpResId pidPatchEBX(ERRORBOX_RESTARTREQUIRED);
- pidPatchEBX.SetRT(RSC_ERRORBOX);
- ResMgr *pMgrEB = pidPatchEBX.GetResMgr();
- if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX))
- idEBX = pidPatchEBX;
- ErrorBox aErrorBox(NULL, idEBX);
-
- String aTitle;
- SvpResId pidString(STR_ERROR_RESTARTREQUIRED);
- pidString.SetRT(RSC_STRING);
- ResMgr *pmgr = pidString.GetResMgr();
- if ( pmgr && pmgr->IsAvailable(pidString))
- aTitle = String(pidString);
- else
- aTitle = String( SvtResId(STR_ERROR_RESTARTREQUIRED));
-
+ ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) );
+ String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) );
aErrorBox.SetText( aTitle );
nResult = aErrorBox.Execute();
}
diff --git a/svtools/source/java/makefile.mk b/svtools/source/java/makefile.mk
deleted file mode 100644
index 6db57388dca0..000000000000
--- a/svtools/source/java/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=java
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME= javaerror
-SRC1FILES= javaerror.src
-
-SRS2NAME= patchjavaerror
-SRC2FILES= patchjavaerror.src
-
-
-SLOFILES= \
- $(SLO)$/javainteractionhandler.obj \
- $(SLO)$/javacontext.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/java/patchjavaerror.src b/svtools/source/java/patchjavaerror.src
deleted file mode 100644
index fb750968b798..000000000000
--- a/svtools/source/java/patchjavaerror.src
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/svtools.hrc>
-
-WarningBox WARNINGBOX_JAVANOTFOUND
-{
- Buttons = WB_OK ;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] ="%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. Please install a JRE and restart %PRODUCTNAME.";
-};
-
-WarningBox WARNINGBOX_INVALIDJAVASETTINGS
-{
- Buttons = WB_OK ;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] ="The %PRODUCTNAME configuration has been changed. Under Tools - Options - %PRODUCTNAME - Java, select the Java runtime environment you want to have used by %PRODUCTNAME.";
-};
-
-QueryBox QBX_JAVADISABLED
-{
- Buttons = WB_YES_NO_CANCEL ;
- DefButton = WB_DEF_YES ;
- Message[ en-US ] = "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. However, use of a JRE has been disabled. Do you want to enable the use of a JRE now?";
-};
-
-ErrorBox ERRORBOX_JVMCREATIONFAILED
-{
- Buttons = WB_OK;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] = "%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools - Options - %PRODUCTNAME - Java.";
-};
-
-ErrorBox ERRORBOX_RESTARTREQUIRED
-{
- Buttons = WB_OK;
- DefButton = WB_DEF_OK ;
- Message[ en-US ] = "For the selected Java runtime environment to work properly, %PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now.";
-};
-
-
-
-String STR_WARNING_JAVANOTFOUND
-{
- Text[ en-US ] = "JRE Required" ;
-};
-
-String STR_WARNING_INVALIDJAVASETTINGS
-{
- Text[ en-US ] = "Select JRE";
-};
-
-String STR_ERROR_RESTARTREQUIRED
-{
- Text[ en-US ] = "Restart Required";
-};
-
-String STR_QUESTION_JAVADISABLED
-{
- Text[ en-US ] = "Enable JRE" ;
-};
-
-
-String STR_ERROR_JVMCREATIONFAILED
-{
- Text[ en-US ] = "JRE is Defective" ;
-};
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx
index 200163c0d3db..c18071664a03 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "acceleratorexecute.hxx"
+#include <svtools/acceleratorexecute.hxx>
//===============================================
// includes
@@ -254,7 +254,7 @@ KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey)
sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 );
sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 );
sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 );
- USHORT nKey = (USHORT)aAWTKey.KeyCode;
+ sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode;
return KeyCode(nKey, bShift, bMod1, bMod2, bMod3);
}
diff --git a/svtools/source/misc/cliplistener.cxx b/svtools/source/misc/cliplistener.cxx
index 741e62cb64a8..f059e5eb9c0b 100644
--- a/svtools/source/misc/cliplistener.cxx
+++ b/svtools/source/misc/cliplistener.cxx
@@ -35,7 +35,7 @@
#include <vcl/window.hxx>
#include <osl/mutex.hxx>
-#include "cliplistener.hxx"
+#include <svtools/cliplistener.hxx>
#include <svtools/transfer.hxx>
using namespace ::com::sun::star;
@@ -69,7 +69,7 @@ void SAL_CALL TransferableClipboardListener::changedContents(
}
}
-void TransferableClipboardListener::AddRemoveListener( Window* pWin, BOOL bAdd )
+void TransferableClipboardListener::AddRemoveListener( Window* pWin, sal_Bool bAdd )
{
try
{
diff --git a/svtools/source/misc/dialogclosedlistener.cxx b/svtools/source/misc/dialogclosedlistener.cxx
index a1edf0e5b859..f07d24b536a9 100644
--- a/svtools/source/misc/dialogclosedlistener.cxx
+++ b/svtools/source/misc/dialogclosedlistener.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include "precompiled_svtools.hxx"
-#include "dialogclosedlistener.hxx"
+#include <svtools/dialogclosedlistener.hxx>
//.........................................................................
namespace svt
diff --git a/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx
index c46ebfa7f85d..d5e9ac545962 100644
--- a/svtools/source/misc/dialogcontrolling.cxx
+++ b/svtools/source/misc/dialogcontrolling.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "dialogcontrolling.hxx"
+#include <svtools/dialogcontrolling.hxx>
#include <vcl/window.hxx>
#include <algorithm>
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index f146a84a969e..405b98588598 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -31,7 +31,7 @@
#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <tools/rcid.h>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#if defined(OS2)
@@ -41,13 +41,13 @@
#include <svtools/ehdl.hxx>
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
+#include <svtools/sfxecode.hxx>
//=========================================================================
-static USHORT aWndFunc(
+static sal_uInt16 aWndFunc(
Window *pWin, // Parent des Dialoges
- USHORT nFlags,
+ sal_uInt16 nFlags,
const String &rErr, // Fehlertext
const String &rAction) // Actiontext
@@ -130,7 +130,7 @@ static USHORT aWndFunc(
}
}
- USHORT nRet = RET_CANCEL;
+ sal_uInt16 nRet = RET_CANCEL;
switch ( pBox->Execute() )
{
case RET_OK:
@@ -158,7 +158,7 @@ static USHORT aWndFunc(
//-------------------------------------------------------------------------
-SfxErrorHandler::SfxErrorHandler(USHORT nIdP, ULONG lStartP, ULONG lEndP, ResMgr *pMgrP) :
+SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uLong lStartP, sal_uLong lEndP, ResMgr *pMgrP) :
lStart(lStartP), lEnd(lEndP), nId(nIdP), pMgr(pMgrP), pFreeMgr( NULL )
@@ -181,8 +181,8 @@ SfxErrorHandler::~SfxErrorHandler()
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::CreateString(
- const ErrorInfo *pErr, String &rStr, USHORT& nFlags) const
+sal_Bool SfxErrorHandler::CreateString(
+ const ErrorInfo *pErr, String &rStr, sal_uInt16& nFlags) const
/* [Beschreibung]
@@ -191,9 +191,9 @@ BOOL SfxErrorHandler::CreateString(
*/
{
- ULONG nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
+ sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
if( nErrCode>=lEnd || nErrCode<=lStart )
- return FALSE;
+ return sal_False;
MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr);
if(pMsgInfo)
{
@@ -207,7 +207,7 @@ BOOL SfxErrorHandler::CreateString(
break;
i = i + pMsgInfo->GetMessageArg().Len();
}
- return TRUE;
+ return sal_True;
}
}
else if(GetErrorString(nErrCode, rStr, nFlags))
@@ -227,10 +227,10 @@ BOOL SfxErrorHandler::CreateString(
TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo,
pErr);
if (pTwoStringInfo)
- for (USHORT i = 0; i < rStr.Len();)
+ for (sal_uInt16 i = 0; i < rStr.Len();)
{
- USHORT nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i);
- USHORT nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i);
+ sal_uInt16 nArg1Pos = rStr.Search(String::CreateFromAscii( "$(ARG1)" ), i);
+ sal_uInt16 nArg2Pos = rStr.Search(String::CreateFromAscii( "$(ARG2)" ), i);
if (nArg1Pos < nArg2Pos)
{
rStr.Replace(nArg1Pos, 7, pTwoStringInfo->GetArg1());
@@ -244,9 +244,9 @@ BOOL SfxErrorHandler::CreateString(
else break;
}
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------------
@@ -261,9 +261,9 @@ class ResString: public String
*/
{
- USHORT nFlags;
+ sal_uInt16 nFlags;
public:
- USHORT GetFlags() const {return nFlags;}
+ sal_uInt16 GetFlags() const {return nFlags;}
const String & GetString() const {return *this;}
ResString( ResId &rId);
};
@@ -271,14 +271,14 @@ class ResString: public String
//-------------------------------------------------------------------------
ResString::ResString(ResId & rId):
- String(rId.SetAutoRelease(FALSE)),
+ String(rId.SetAutoRelease(sal_False)),
nFlags(0)
{
ResMgr * pResMgr = rId.GetResMgr();
// String ctor temporarily sets global ResManager
if (pResMgr->GetRemainSize())
- nFlags = USHORT(pResMgr->ReadShort());
- rId.SetAutoRelease(TRUE);
+ nFlags = sal_uInt16(pResMgr->ReadShort());
+ rId.SetAutoRelease(sal_True);
pResMgr->PopContext();
}
@@ -295,18 +295,18 @@ struct ErrorResource_Impl : private Resource
ResId aResId;
- ErrorResource_Impl(ResId& rErrIdP, USHORT nId)
+ ErrorResource_Impl(ResId& rErrIdP, sal_uInt16 nId)
: Resource(rErrIdP),aResId(nId,*rErrIdP.GetResMgr()){}
~ErrorResource_Impl() { FreeResource(); }
operator ResString(){ return ResString( aResId ); }
- operator BOOL(){return IsAvailableRes(aResId.SetRT(RSC_STRING));}
+ operator sal_Bool(){return IsAvailableRes(aResId.SetRT(RSC_STRING));}
};
-BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
+sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, String &rStr) const
/* [Beschreibung]
@@ -316,17 +316,17 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
*/
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() );
ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale );
if( pResMgr )
{
ResId aId(RID_ERRHDL, *pResMgr );
- ErrorResource_Impl aEr(aId, (USHORT)lClassId);
+ ErrorResource_Impl aEr(aId, (sal_uInt16)lClassId);
if(aEr)
{
rStr=((ResString)aEr).GetString();
- bRet = TRUE;
+ bRet = sal_True;
}
}
delete pResMgr;
@@ -335,8 +335,8 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::GetMessageString(
- ULONG lErrId, String &rStr, USHORT &nFlags) const
+sal_Bool SfxErrorHandler::GetMessageString(
+ sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const
/* [Beschreibung]
@@ -345,18 +345,18 @@ BOOL SfxErrorHandler::GetMessageString(
*/
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
ResId *pResId= new ResId(nId, *pMgr);
- ErrorResource_Impl aEr(*pResId, (USHORT)lErrId);
+ ErrorResource_Impl aEr(*pResId, (sal_uInt16)lErrId);
if(aEr)
{
ResString aErrorString(aEr);
- USHORT nResFlags = aErrorString.GetFlags();
+ sal_uInt16 nResFlags = aErrorString.GetFlags();
if( nResFlags )
nFlags=aErrorString.GetFlags();
rStr = aErrorString.GetString();
- bRet = TRUE;
+ bRet = sal_True;
}
delete pResId;
@@ -365,8 +365,8 @@ BOOL SfxErrorHandler::GetMessageString(
//-------------------------------------------------------------------------
-BOOL SfxErrorHandler::GetErrorString(
- ULONG lErrId, String &rStr, USHORT &nFlags) const
+sal_Bool SfxErrorHandler::GetErrorString(
+ sal_uLong lErrId, String &rStr, sal_uInt16 &nFlags) const
/* [Beschreibung]
Erzeugt den Fehlerstring fuer den eigentlichen Fehler ohne
@@ -377,25 +377,25 @@ BOOL SfxErrorHandler::GetErrorString(
{
SolarMutexGuard aGuard;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rStr=String(SvtResId(RID_ERRHDL_CLASS));
ResId aResId(nId, *pMgr);
{
- ErrorResource_Impl aEr(aResId, (USHORT)lErrId);
+ ErrorResource_Impl aEr(aResId, (sal_uInt16)lErrId);
if(aEr)
{
ResString aErrorString(aEr);
- USHORT nResFlags = aErrorString.GetFlags();
+ sal_uInt16 nResFlags = aErrorString.GetFlags();
if ( nResFlags )
nFlags = nResFlags;
rStr.SearchAndReplace(
String::CreateFromAscii("$(ERROR)"), aErrorString.GetString());
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
if( bRet )
@@ -414,7 +414,7 @@ BOOL SfxErrorHandler::GetErrorString(
//-------------------------------------------------------------------------
SfxErrorContext::SfxErrorContext(
- USHORT nCtxIdP, Window *pWindow, USHORT nResIdP, ResMgr *pMgrP)
+ sal_uInt16 nCtxIdP, Window *pWindow, sal_uInt16 nResIdP, ResMgr *pMgrP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP)
{
if( nResId==USHRT_MAX )
@@ -424,8 +424,8 @@ SfxErrorContext::SfxErrorContext(
//-------------------------------------------------------------------------
SfxErrorContext::SfxErrorContext(
- USHORT nCtxIdP, const String &aArg1P, Window *pWindow,
- USHORT nResIdP, ResMgr *pMgrP)
+ sal_uInt16 nCtxIdP, const String &aArg1P, Window *pWindow,
+ sal_uInt16 nResIdP, ResMgr *pMgrP)
: ErrorContext(pWindow), nCtxId(nCtxIdP), nResId(nResIdP), pMgr(pMgrP),
aArg1(aArg1P)
{
@@ -435,7 +435,7 @@ SfxErrorContext::SfxErrorContext(
//-------------------------------------------------------------------------
-BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
+sal_Bool SfxErrorContext::GetString(sal_uLong nErrId, String &rStr)
/* [Beschreibung]
@@ -471,7 +471,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr)
if ( bRet )
{
- USHORT nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
+ sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR;
ResId aSfxResId( RID_ERRCTX, *pMgr );
ErrorResource_Impl aEr( aSfxResId, nId );
rStr.SearchAndReplace( String::CreateFromAscii( "$(ERR)" ), ( (ResString)aEr ).GetString() );
diff --git a/svtools/source/misc/ehdl.src b/svtools/source/misc/ehdl.src
index 436e06b7f3c5..2c2fab3e19b5 100644
--- a/svtools/source/misc/ehdl.src
+++ b/svtools/source/misc/ehdl.src
@@ -27,7 +27,8 @@
#define __RSC
#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
+#include <svtools/sfxecode.hxx>
+
// pragma ----------------------------------------------------------------
String STR_ERR_HDLMESS
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 1ae633cad254..59479c39d4b7 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -236,7 +236,7 @@ struct EmbeddedObjectRef_Impl
comphelper::EmbeddedObjectContainer* pContainer;
Graphic* pGraphic;
sal_Int64 nViewAspect;
- BOOL bIsLocked;
+ sal_Bool bIsLocked;
sal_Bool bNeedUpdate;
// #i104867#
@@ -250,7 +250,7 @@ void EmbeddedObjectRef::Construct_Impl()
mpImp->pContainer = 0;
mpImp->pGraphic = 0;
mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
- mpImp->bIsLocked = FALSE;
+ mpImp->bIsLocked = sal_False;
mpImp->bNeedUpdate = sal_False;
mpImp->mnGraphicVersion = 0;
mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000);
@@ -306,6 +306,7 @@ void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObj
mpImp->xListener = EmbedEventListener_Impl::Create( this );
//#i103460#
+ if ( IsChart() )
{
::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
@@ -360,7 +361,7 @@ void EmbeddedObjectRef::Clear()
}
mpImp->pContainer = 0;
- mpImp->bIsLocked = FALSE;
+ mpImp->bIsLocked = sal_False;
mpImp->bNeedUpdate = sal_False;
}
@@ -402,17 +403,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect )
mpImp->nViewAspect = nAspect;
}
-void EmbeddedObjectRef::Lock( BOOL bLock )
+void EmbeddedObjectRef::Lock( sal_Bool bLock )
{
mpImp->bIsLocked = bLock;
}
-BOOL EmbeddedObjectRef::IsLocked() const
+sal_Bool EmbeddedObjectRef::IsLocked() const
{
return mpImp->bIsLocked;
}
-void EmbeddedObjectRef::GetReplacement( BOOL bUpdate )
+void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate )
{
if ( bUpdate )
{
@@ -449,7 +450,7 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const
// bNeedUpdate will be set to false while retrieving new replacement
const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True );
else if ( !mpImp->pGraphic )
- const_cast < EmbeddedObjectRef* >(this)->GetReplacement( FALSE );
+ const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False );
if ( mpImp->pGraphic && pMediaType )
*pMediaType = mpImp->aMediaType;
@@ -561,7 +562,7 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri
mpImp->bNeedUpdate = sal_False;
}
-SvStream* EmbeddedObjectRef::GetGraphicStream( BOOL bUpdate ) const
+SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const
{
RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" );
DBG_ASSERT( bUpdate || mpImp->pContainer, "Can't retrieve current graphic!" );
@@ -615,7 +616,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri
MapMode aMM( MAP_APPFONT );
Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL );
Font aFnt( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica" ) ), aAppFontSz );
- aFnt.SetTransparent( TRUE );
+ aFnt.SetTransparent( sal_True );
aFnt.SetColor( Color( COL_LIGHTRED ) );
aFnt.SetWeight( WEIGHT_BOLD );
aFnt.SetFamily( FAMILY_SWISS );
@@ -627,14 +628,14 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const Stri
Point aPt;
// Nun den Text so skalieren, dass er in das Rect passt.
// Wir fangen mit der Defaultsize an und gehen 1-AppFont runter
- for( USHORT i = 8; i > 2; i-- )
+ for( sal_uInt16 i = 8; i > 2; i-- )
{
aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2;
aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2;
- BOOL bTiny = FALSE;
- if( aPt.X() < 0 ) bTiny = TRUE, aPt.X() = 0;
- if( aPt.Y() < 0 ) bTiny = TRUE, aPt.Y() = 0;
+ sal_Bool bTiny = sal_False;
+ if( aPt.X() < 0 ) bTiny = sal_True, aPt.X() = 0;
+ if( aPt.Y() < 0 ) bTiny = sal_True, aPt.Y() = 0;
if( bTiny )
{
// heruntergehen bei kleinen Bildern
@@ -696,8 +697,8 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut
aPixSize.Width() -= 1;
aPixSize.Height() -= 1;
Point aPixViewPos = pOut->LogicToPixel( rRect.TopLeft() );
- INT32 nMax = aPixSize.Width() + aPixSize.Height();
- for( INT32 i = 5; i < nMax; i += 5 )
+ sal_Int32 nMax = aPixSize.Width() + aPixSize.Height();
+ for( sal_Int32 i = 5; i < nMax; i += 5 )
{
Point a1( aPixViewPos ), a2( aPixViewPos );
if( i > aPixSize.Width() )
@@ -716,15 +717,15 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut
}
-BOOL EmbeddedObjectRef::TryRunningState()
+sal_Bool EmbeddedObjectRef::TryRunningState()
{
return TryRunningState( mxObj );
}
-BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj )
+sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj )
{
if ( !xEmbObj.is() )
- return FALSE;
+ return sal_False;
try
{
@@ -733,10 +734,10 @@ BOOL EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbedded
}
catch ( uno::Exception& )
{
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic,
@@ -797,7 +798,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand()
}
}
-BOOL EmbeddedObjectRef::IsChart() const
+sal_Bool EmbeddedObjectRef::IsChart() const
{
//todo maybe for 3.0:
//if the changes work good for chart
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 67d325cb41e5..34cf5c595e38 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <svtools/embedtransfer.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
#include <vcl/outdev.hxx>
#include <comphelper/storagehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -111,21 +111,21 @@ sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::D
// TODO/LATER: Propbably the graphic should be copied here as well
// currently it is handled by the applications
utl::TempFile aTmp;
- aTmp.EnableKillingFile( TRUE );
+ aTmp.EnableKillingFile( sal_True );
uno::Reference < embed::XEmbedPersist > xPers( m_xObj, uno::UNO_QUERY );
if ( xPers.is() )
{
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetTemporaryStorage();
::rtl::OUString aName( RTL_CONSTASCII_USTRINGPARAM( "Dummy" ));
SvStream* pStream = NULL;
- BOOL bDeleteStream = FALSE;
+ sal_Bool bDeleteStream = sal_False;
uno::Sequence < beans::PropertyValue > aEmpty;
xPers->storeToEntry( xStg, aName, aEmpty, aEmpty );
if ( xStg->isStreamElement( aName ) )
{
uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName );
pStream = utl::UcbStreamHelper::CreateStream( xStm );
- bDeleteStream = TRUE;
+ bDeleteStream = sal_True;
}
else
{
@@ -252,7 +252,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) );
rDesc.maDragStartPos = Point();
rDesc.maDisplayName = String();
- rDesc.mbCanLink = FALSE;
+ rDesc.mbCanLink = sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/errtxt.src b/svtools/source/misc/errtxt.src
deleted file mode 100644
index 08514ea23953..000000000000
--- a/svtools/source/misc/errtxt.src
+++ /dev/null
@@ -1,515 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define __RSC
-#include <svtools/svtools.hrc>
-#include "sfxecode.hxx"
- // pragma ----------------------------------------------------------------
-Resource RID_ERRCTX
-{
- String ERRCTX_ERROR
- {
- Text [ en-US ] = "Error" ;
- };
- String ERRCTX_WARNING
- {
- Text [ en-US ] = "Warning" ;
- };
- String ERRCTX_SFX_LOADTEMPLATE
- {
- Text [ en-US ] = "$(ERR) loading the template $(ARG1)" ;
- };
- String ERRCTX_SFX_SAVEDOC
- {
- Text [ en-US ] = "$(ERR) saving the document $(ARG1)";
- };
- String ERRCTX_SFX_SAVEASDOC
- {
- Text [ en-US ] = "$(ERR) saving the document $(ARG1)";
- };
- String ERRCTX_SFX_DOCINFO
- {
- Text [ en-US ] = "$(ERR) displaying doc. information for document $(ARG1)" ;
- };
- String ERRCTX_SFX_DOCTEMPLATE
- {
- Text [ en-US ] = "$(ERR) writing document $(ARG1) as template" ;
- };
- String ERRCTX_SFX_MOVEORCOPYCONTENTS
- {
- Text [ en-US ] = "$(ERR) copying or moving document contents" ;
- };
- String ERRCTX_SFX_DOCMANAGER
- {
- Text [ en-US ] = "$(ERR) starting the Document Manager" ;
- };
- String ERRCTX_SFX_OPENDOC
- {
- Text [ en-US ] = "$(ERR) loading document $(ARG1)" ;
- };
- String ERRCTX_SFX_NEWDOCDIRECT
- {
- Text [ en-US ] = "$(ERR) creating a new document" ;
- };
- String ERRCTX_SFX_NEWDOC
- {
- Text [ en-US ] = "$(ERR) creating a new document" ;
- };
- String ERRCTX_SFX_CREATEOBJSH
- {
- Text [ en-US ] = "$(ERR) expanding entry" ;
- };
- String ERRCTX_SFX_LOADBASIC
- {
- Text [ en-US ] = "$(ERR) loading BASIC of document $(ARG1)" ;
- };
- String ERRCTX_SFX_SEARCHADDRESS
- {
- Text [ en-US ] = "$(ERR) searching for an address";
- };
-};
-
-Resource RID_ERRHDL
-{
- String ERRCODE_CLASS_ABORT
- {
- Text [ en-US ] = "Abort" ;
- };
- String ERRCODE_CLASS_NOTEXISTS
- {
- Text [ en-US ] = "Nonexistent object" ;
- };
- String ERRCODE_CLASS_ALREADYEXISTS
- {
- Text [ en-US ] = "Object already exists" ;
- };
- String ERRCODE_CLASS_ACCESS
- {
- Text [ en-US ] = "Object not accessible" ;
- };
- String ERRCODE_CLASS_PATH
- {
- Text [ en-US ] = "Inadmissible path" ;
- };
- String ERRCODE_CLASS_LOCKING
- {
- Text [ en-US ] = "Locking problem" ;
- };
- String ERRCODE_CLASS_PARAMETER
- {
- Text [ en-US ] = "Wrong parameter" ;
- };
- String ERRCODE_CLASS_SPACE
- {
- Text [ en-US ] = "Resource exhausted" ;
- };
- String ERRCODE_CLASS_NOTSUPPORTED
- {
- Text [ en-US ] = "Action not supported" ;
- };
- String ERRCODE_CLASS_READ
- {
- Text [ en-US ] = "Read-Error" ;
- };
- String ERRCODE_CLASS_WRITE
- {
- Text [ en-US ] = "Write Error" ;
- };
- String ERRCODE_CLASS_UNKNOWN
- {
- Text [ en-US ] = "unknown" ;
- };
- String ERRCODE_CLASS_VERSION
- {
- Text [ en-US ] = "Version Incompatibility" ;
- };
- String ERRCODE_CLASS_GENERAL
- {
- Text [ en-US ] = "General Error" ;
- };
- String ERRCODE_CLASS_FORMAT
- {
- Text [ en-US ] = "Incorrect format" ;
- };
- String ERRCODE_CLASS_CREATE
- {
- Text [ en-US ] = "Error creating object" ;
- };
- String ERRCODE_CLASS_SBX
- {
- Text [ en-US ] = "Inadmissible value or data type" ;
- };
- String ERRCODE_CLASS_RUNTIME
- {
- Text [ en-US ] = "BASIC runtime error" ;
- };
- String ERRCODE_CLASS_COMPILER
- {
- Text [ en-US ] = "BASIC syntax error" ;
- };
- String 1
- {
- Text [ en-US ] = "General Error" ;
- };
- String ERRCODE_IO_GENERAL
- {
- Text [ en-US ] = "General input/output error." ;
- };
- String ERRCODE_IO_MISPLACEDCHAR
- {
- Text [ en-US ] = "Invalid file name." ;
- };
- String ERRCODE_IO_NOTEXISTS
- {
- Text [ en-US ] = "Nonexistent file." ;
- };
- String ERRCODE_IO_ALREADYEXISTS
- {
- Text [ en-US ] = "File already exists." ;
- };
- String ERRCODE_IO_NOTADIRECTORY
- {
- Text [ en-US ] = "The object is not a directory." ;
- };
- String ERRCODE_IO_NOTAFILE
- {
- Text [ en-US ] = "The object is not a file." ;
- };
- String ERRCODE_IO_INVALIDDEVICE
- {
- Text [ en-US ] = "The specified device is invalid." ;
- };
- String ERRCODE_IO_ACCESSDENIED
- {
- Text [ en-US ] = "The object cannot be accessed\ndue to insufficient user rights." ;
- };
- String ERRCODE_IO_LOCKVIOLATION
- {
- Text [ en-US ] = "Sharing violation while accessing the object." ;
- };
- String ERRCODE_IO_OUTOFSPACE
- {
- Text [ en-US ] = "No more space on device." ;
- };
- String ERRCODE_IO_ISWILDCARD
- {
- Text [ en-US ] = "This operation cannot be run on\nfiles containing wildcards." ;
- };
- String ERRCODE_IO_NOTSUPPORTED
- {
- Text [ en-US ] = "This operation is not supported on this operating system." ;
- };
- String ERRCODE_IO_TOOMANYOPENFILES
- {
- Text [ en-US ] = "There are too many files open." ;
- };
- String ERRCODE_IO_CANTREAD
- {
- Text [ en-US ] = "Data could not be read from the file." ;
- };
- String ERRCODE_IO_CANTWRITE
- {
- Text [ en-US ] = "The file could not be written." ;
- };
- String ERRCODE_IO_OUTOFMEMORY
- {
- Text [ en-US ] = "The operation could not be run due to insufficient memory." ;
- };
- String ERRCODE_IO_CANTSEEK
- {
- Text [ en-US ] = "The seek operation could not be run." ;
- };
- String ERRCODE_IO_CANTTELL
- {
- Text [ en-US ] = "The tell operation could not be run." ;
- };
- String ERRCODE_IO_WRONGVERSION
- {
- Text [ en-US ] = "Incorrect file version." ;
- };
- String ERRCODE_IO_WRONGFORMAT
- {
- Text [ en-US ] = "Incorrect file format." ;
- };
- String ERRCODE_IO_INVALIDCHAR
- {
- Text [ en-US ] = "The file name contains invalid characters." ;
- };
- String ERRCODE_IO_UNKNOWN
- {
- Text [ en-US ] = "An unknown I/O error has occurred." ;
- };
- String ERRCODE_IO_INVALIDACCESS
- {
- Text [ en-US ] = "An invalid attempt was made to access the file." ;
- };
- String ERRCODE_IO_CANTCREATE
- {
- Text [ en-US ] = "The file could not be created." ;
- };
- String ERRCODE_IO_INVALIDPARAMETER
- {
- Text [ en-US ] = "The operation was started under an invalid parameter." ;
- };
- String ERRCODE_IO_ABORT
- {
- Text [ en-US ] = "The operation on the file was aborted." ;
- };
- String ERRCODE_IO_NOTEXISTSPATH
- {
- Text [ en-US ] = "Path to the file does not exist." ;
- };
- String ERRCODE_IO_RECURSIVE
- {
- Text [ en-US ] = "An object cannot be copied into itself." ;
- };
- String ERRCODE_SFX_NOSTDTEMPLATE
- {
- Text [ en-US ] = "The default template could not be opened." ;
- };
- String ERRCODE_SFX_TEMPLATENOTFOUND
- {
- Text [ en-US ] = "The specified template could not be found." ;
- };
- String ERRCODE_SFX_NOTATEMPLATE
- {
- Text [ en-US ] = "The file cannot be used as template." ;
- };
- String ERRCODE_SFX_CANTREADDOCINFO
- {
- Text [ en-US ] = "Document information could not be read from the file because\nthe document information format is unknown or because document information does not\nexist." ;
- };
- String ERRCODE_SFX_ALREADYOPEN
- {
- Text [ en-US ] = "This document has already been opened for editing." ;
- };
- String ERRCODE_SFX_WRONGPASSWORD
- {
- Text [ en-US ] = "The wrong password has been entered." ;
- };
- String ERRCODE_SFX_DOLOADFAILED
- {
- Text [ en-US ] = "Error reading file." ;
- };
- String ERRCODE_SFX_DOCUMENTREADONLY
- {
- Text [ en-US ] = "The document was opened as read-only." ;
- };
- String ERRCODE_SFX_OLEGENERAL
- {
- Text [ en-US ] = "General OLE Error." ;
- };
- String ERRCODE_INET_NAME_RESOLVE
- {
- Text [ en-US ] = "The host name $(ARG1) could not be resolved." ;
- };
- String ERRCODE_INET_CONNECT
- {
- Text [ en-US ] = "Could not establish network connection to $(ARG1)." ;
- };
- String ERRCODE_INET_READ
- {
- Text [ en-US ] = "Error reading data from the network.\nServer error message: $(ARG1)." ;
- };
- String ERRCODE_INET_WRITE
- {
- Text [ en-US ] = "Error transferring data to the network.\nServer error message: $(ARG1)." ;
- };
- String ERRCODE_INET_GENERAL
- {
- Text [ en-US ] = "General network error has occurred." ;
- };
- String ERRCODE_INET_OFFLINE
- {
- Text [ en-US ] = "The requested network data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ;
- };
- String ERRCODE_SFXMSG_STYLEREPLACE
- {
- ExtraData = ERRCODE_MSG_ERROR | ERRCODE_BUTTON_OK_CANCEL ;
- Text [ en-US ] = "Should the $(ARG1) Style be replaced?" ;
- };
- String ERRCODE_SFX_NOFILTER
- {
- Text [ en-US ] = "A filter has not been found." ;
- };
- String ERRCODE_SFX_CANTFINDORIGINAL
- {
- Text [ en-US ] = "The original could not be determined." ;
- };
- String ERRCODE_SFX_CANTCREATECONTENT
- {
- Text [ en-US ] = "The contents could not be created." ;
- };
- String ERRCODE_SFX_CANTCREATELINK
- {
- Text [ en-US ] = "The link could not be created." ;
- };
- String ERRCODE_SFX_WRONGBMKFORMAT
- {
- Text [ en-US ] = "The link format is invalid." ;
- };
- String ERRCODE_SFX_WRONGICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display is invalid." ;
- };
- String ERRCODE_SFX_CANTWRITEICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display can not be saved." ;
- };
- String ERRCODE_SFX_CANTDELICONFILE
- {
- Text [ en-US ] = "The configuration of the icon display could not be deleted." ;
- };
- String ERRCODE_SFX_CANTRENAMECONTENT
- {
- Text [ en-US ] = "Contents cannot be renamed." ;
- };
- String ERRCODE_SFX_INVALIDBMKPATH
- {
- Text [ en-US ] = "The bookmark folder is invalid." ;
- };
- String ERRCODE_SFX_CANTWRITEURLCFGFILE
- {
- Text [ en-US ] = "The configuration of the URLs to be saved locally could not be saved." ;
- };
- String ERRCODE_SFX_WRONGURLCFGFORMAT
- {
- Text [ en-US ] = "The configuration format of the URLs to be saved locally is invalid." ;
- };
- String ERRCODE_SFX_NODOCUMENT
- {
- Text [ en-US ] = "This action cannot be applied to a document that does not exist." ;
- };
- String ERRCODE_SFX_INVALIDLINK
- {
- Text [ en-US ] = "The link refers to an invalid target." ;
- };
- String ERRCODE_SFX_INVALIDTRASHPATH
- {
- Text [ en-US ] = "The Recycle Bin path is invalid." ;
- };
- String ERRCODE_SFX_NOTRESTORABLE
- {
- Text [ en-US ] = "The entry could not be restored." ;
- };
- String ERRCODE_IO_NAMETOOLONG
- {
- Text [ en-US ] = "The file name is too long for the target file system." ;
- };
- String ERRCODE_SFX_CONSULTUSER
- {
- Text [ en-US ] = "The details for running the function are incomplete." ;
- };
- String ERRCODE_SFX_INVALIDSYNTAX
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_CANTCREATEFOLDER
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_CANTRENAMEFOLDER
- {
- Text [ en-US ] = "The input syntax is invalid." ;
- };
- String ERRCODE_SFX_WRONG_CDF_FORMAT
- {
- Text [ en-US ] = "The channel document has an invalid format." ;
- };
- String ERRCODE_SFX_EMPTY_SERVER
- {
- Text [ en-US ] = "The server must not be empty." ;
- };
- String ERRCODE_SFX_NO_ABOBOX
- {
- Text [ en-US ] = "A subscription folder is required to install a Channel." ;
- };
- String ERRCODE_IO_NOTSTORABLEINBINARYFORMAT
- {
- Text [ en-US ] = "This document contains attributes that cannot be saved in the selected format.\nPlease save the document in a %PRODUCTNAME %PRODUCTVERSION file format.";
- };
- String ERRCODE_SFX_TARGETFILECORRUPTED
- {
- Text [ en-US ] = "The file $(FILENAME) cannot be saved. Please check your system settings. You can find an automatically generated backup copy of this file in folder $(PATH) named $(BACKUPNAME).";
- };
- String ERRCODE_SFX_NOMOREDOCUMENTSALLOWED
- {
- Text [ en-US ] = "The maximum number of documents that can be opened at the same time has been reached. You need to close one or more documents before you can open a new document.";
- };
- String ERRCODE_SFX_CANTCREATEBACKUP
- {
- Text [ en-US ] = "Could not create backup copy." ;
- };
- String ERRCODE_SFX_MACROS_SUPPORT_DISABLED
- {
- Text [ en-US ] = "An attempt was made to execute a macro.\nFor security reasons, macro support is disabled.";
- };
- String ERRCODE_SFX_DOCUMENT_MACRO_DISABLED
- {
- Text [ en-US ] = "This document contains macros.\n\nMacros may contain viruses. Execution of macros is disabled due to the current macro security setting in Tools - Options - %PRODUCTNAME - Security.\n\nTherefore, some functionality may not be available." ;
- };
- String ERRCODE_SFX_BROKENSIGNATURE
- {
- Text [ en-US ] = "The digitally signed document content and/or macros do not match the current document signature.\n\nThis could be the result of document manipulation or of structural document damage due to data transmission.\n\nWe recommend that you do not trust the content of the current document.\nExecution of macros is disabled for this document.\n " ;
- };
- String ERRCODE_SFX_INCOMPLETE_ENCRYPTION
- {
- Text [ en-US ] = "The encrypted document contains unexpected non-encrypted streams.\n\nThis could be the result of document manipulation.\n\nWe recommend that you do not trust the content of the current document.\nExecution of macros is disabled for this document.\n " ;
- };
-
- String ERRCODE_IO_INVALIDLENGTH
- {
- Text [ en-US ] = "Invalid data length." ;
- };
- String ERRCODE_IO_CURRENTDIR
- {
- Text [ en-US ] = "Function not possible: path contains current directory." ;
- };
- String ERRCODE_IO_NOTSAMEDEVICE
- {
- Text [ en-US ] = "Function not possible: device (drive) not identical." ;
- };
- String ERRCODE_IO_DEVICENOTREADY
- {
- Text [ en-US ] = "Device (drive) not ready." ;
- };
- String ERRCODE_IO_BADCRC
- {
- Text [ en-US ] = "Wrong check amount." ;
- };
- String ERRCODE_IO_WRITEPROTECTED
- {
- Text [ en-US ] = "Function not possible: write protected." ;
- };
- String ERRCODE_SFX_SHARED_NOPASSWORDCHANGE
- {
- Text [ en-US ] = "The password of a shared spreadsheet cannot be set or changed.\nDeactivate sharing mode first.";
- };
-};
-
-// eof ------------------------------------------------------------------------
-
diff --git a/svtools/source/misc/filterutils.cxx b/svtools/source/misc/filterutils.cxx
index 578c94099fae..06640c55f10e 100644
--- a/svtools/source/misc/filterutils.cxx
+++ b/svtools/source/misc/filterutils.cxx
@@ -1,7 +1,7 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "filterutils.hxx"
+#include <svtools/filterutils.hxx>
#include <rtl/ustrbuf.hxx>
namespace svt
diff --git a/svtools/source/misc/helpagentwindow.cxx b/svtools/source/misc/helpagentwindow.cxx
index 46118ffbabfc..50a2341d1290 100644
--- a/svtools/source/misc/helpagentwindow.cxx
+++ b/svtools/source/misc/helpagentwindow.cxx
@@ -28,12 +28,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "helpagentwindow.hxx"
+#include <svtools/helpagentwindow.hxx>
#include <osl/diagnose.h>
#include <vcl/button.hxx>
#include <vcl/bitmap.hxx>
#include <svtools/svtdata.hxx>
-
#include <svtools/svtools.hrc>
#include <svtools/helpid.hrc>
@@ -101,7 +100,7 @@ namespace svt
m_aPreferredSize.Height() += aSize.Height() - aOutputSize.Height();
SetPointer(Pointer(POINTER_REFHAND));
- AlwaysEnableInput( TRUE, TRUE );
+ AlwaysEnableInput( sal_True, sal_True );
// unique id for the testtool
SetUniqueId( HID_HELPAGENT_WINDOW );
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index d17efb5f0287..92fd64bde9cc 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -31,7 +31,7 @@
// includes --------------------------------------------------------------
-#include "imagemgr.hxx"
+#include <svtools/imagemgr.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
@@ -50,167 +50,166 @@
#include <tools/rcid.h>
#include <rtl/logfile.hxx>
#include <unotools/configmgr.hxx>
-
#include <svtools/svtools.hrc>
-#include "imagemgr.hrc"
+#include <svtools/imagemgr.hrc>
#include <svtools/svtdata.hxx>
#include <osl/mutex.hxx>
// globals *******************************************************************
-#define NO_INDEX ((USHORT)0xFFFF)
+#define NO_INDEX ((sal_uInt16)0xFFFF)
#define CONTENT_HELPER ::utl::UCBContentHelper
#define ASCII_STRING(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) )
struct SvtExtensionResIdMapping_Impl
{
const char* _pExt;
- BOOL _bExt;
- USHORT _nStrId;
- USHORT _nImgId;
+ sal_Bool _bExt;
+ sal_uInt16 _nStrId;
+ sal_uInt16 _nImgId;
};
static SvtExtensionResIdMapping_Impl const ExtensionMap_Impl[] =
{
- { "awk", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "bas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "bat", TRUE, STR_DESCRIPTION_BATCHFILE, 0 },
- { "bmk", FALSE, STR_DESCRIPTION_BOOKMARKFILE, 0 },
- { "bmp", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP },
- { "c", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "cfg", FALSE, STR_DESCRIPTION_CFGFILE, 0 },
- { "cmd", TRUE, STR_DESCRIPTION_BATCHFILE, 0 },
- { "cob", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "com", TRUE, STR_DESCRIPTION_APPLICATION, 0 },
- { "cxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "dbf", TRUE, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE },
- { "def", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "dll", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "doc", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "dot", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE },
- { "docx", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "dxf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF },
- { "exe", TRUE, STR_DESCRIPTION_APPLICATION, 0 },
- { "gif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF },
- { "h", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "hlp", FALSE, STR_DESCRIPTION_HELP_DOC, 0 },
- { "hrc", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "htm", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "html", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "asp", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "hxx", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "ini", FALSE, STR_DESCRIPTION_CFGFILE, 0 },
- { "java", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "jpeg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
- { "jpg", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
- { "lha", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "awk", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "bas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "bat", sal_True, STR_DESCRIPTION_BATCHFILE, 0 },
+ { "bmk", sal_False, STR_DESCRIPTION_BOOKMARKFILE, 0 },
+ { "bmp", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP },
+ { "c", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "cfg", sal_False, STR_DESCRIPTION_CFGFILE, 0 },
+ { "cmd", sal_True, STR_DESCRIPTION_BATCHFILE, 0 },
+ { "cob", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "com", sal_True, STR_DESCRIPTION_APPLICATION, 0 },
+ { "cxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "dbf", sal_True, STR_DESCRIPTION_DATABASE_TABLE, IMG_TABLE },
+ { "def", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "dll", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "doc", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "dot", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITERTEMPLATE },
+ { "docx", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "dxf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_DXF },
+ { "exe", sal_True, STR_DESCRIPTION_APPLICATION, 0 },
+ { "gif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF },
+ { "h", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "hlp", sal_False, STR_DESCRIPTION_HELP_DOC, 0 },
+ { "hrc", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "htm", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "html", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "asp", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "hxx", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "ini", sal_False, STR_DESCRIPTION_CFGFILE, 0 },
+ { "java", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "jpeg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
+ { "jpg", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG },
+ { "lha", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
#ifdef WNT
- { "lnk", FALSE, 0, 0 },
+ { "lnk", sal_False, 0, 0 },
#endif
- { "log", TRUE, STR_DESCRIPTION_LOGFILE, 0 },
- { "lst", TRUE, STR_DESCRIPTION_LOGFILE, 0 },
- { "met", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET },
- { "mml", FALSE, STR_DESCRIPTION_MATHML_DOC, IMG_MATH },
- { "mod", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "odb", FALSE, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC },
- { "odg", FALSE, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC },
- { "odf", FALSE, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC },
- { "odm", FALSE, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC },
- { "odp", FALSE, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC },
- { "ods", FALSE, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC },
- { "odt", FALSE, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC },
- { "otg", FALSE, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE },
- { "otp", FALSE, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE },
- { "ots", FALSE, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE },
- { "ott", FALSE, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE },
- { "pas", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "pcd", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD },
- { "pct", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT },
- { "pcx", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX },
- { "pl", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "png", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG },
- { "rar", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "rtf", FALSE, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
- { "sbl", FALSE, 0, 0 },
- { "sch", FALSE, 0, 0 },
- { "sda", FALSE, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW },
- { "sdb", FALSE, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE },
- { "sdc", FALSE, STR_DESCRIPTION_SCALC_DOC, IMG_CALC },
- { "sdd", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS },
- { "sdp", FALSE, STR_DESCRIPTION_SIMPRESS_DOC, 0 },
- { "sds", FALSE, STR_DESCRIPTION_SCHART_DOC, 0 },
- { "sdw", FALSE, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER },
- { "sga", FALSE, 0, 0 },
- { "sgf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF },
- { "sgl", FALSE, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC },
- { "sgv", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV },
- { "shtml", FALSE, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
- { "sim", FALSE, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM },
- { "smf", FALSE, STR_DESCRIPTION_SMATH_DOC, IMG_MATH },
- { "src", TRUE, STR_DESCRIPTION_SOURCEFILE, 0 },
- { "svh", FALSE, STR_DESCRIPTION_HELP_DOC, 0 },
- { "svm", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM },
- { "stc", FALSE, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE },
- { "std", FALSE, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE },
- { "sti", FALSE, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE },
- { "stw", FALSE, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE },
- { "sxc", FALSE, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC },
- { "sxd", FALSE, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW },
- { "sxg", FALSE, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC },
- { "sxi", FALSE, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS },
- { "sxm", FALSE, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH },
- { "sxs", FALSE, STR_DESCRIPTION_SXCHART_DOC, 0 },
- { "sxw", FALSE, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER },
- { "sys", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "tif", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
- { "tiff", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
- { "txt", FALSE, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE },
- { "url", FALSE, STR_DESCRIPTION_LINK, 0 },
- { "vor", FALSE, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE },
- { "vxd", TRUE, STR_DESCRIPTION_SYSFILE, 0 },
- { "wmf", TRUE, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF },
- { "xls", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
- { "xlt", FALSE, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE },
- { "xlsx", FALSE, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
- { "uu", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "uue", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "z", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "zip", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "zoo", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "gz", TRUE, STR_DESCRIPTION_ARCHIVFILE, 0 },
- { "ppt", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
- { "pot", FALSE, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE },
- { "pps", FALSE, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS },
- { "pptx", FALSE, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
- { "oxt", FALSE, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION },
- { 0, FALSE, 0, 0 }
+ { "log", sal_True, STR_DESCRIPTION_LOGFILE, 0 },
+ { "lst", sal_True, STR_DESCRIPTION_LOGFILE, 0 },
+ { "met", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_MET },
+ { "mml", sal_False, STR_DESCRIPTION_MATHML_DOC, IMG_MATH },
+ { "mod", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "odb", sal_False, STR_DESCRIPTION_OO_DATABASE_DOC, IMG_OO_DATABASE_DOC },
+ { "odg", sal_False, STR_DESCRIPTION_OO_DRAW_DOC, IMG_OO_DRAW_DOC },
+ { "odf", sal_False, STR_DESCRIPTION_OO_MATH_DOC, IMG_OO_MATH_DOC },
+ { "odm", sal_False, STR_DESCRIPTION_OO_GLOBAL_DOC, IMG_OO_GLOBAL_DOC },
+ { "odp", sal_False, STR_DESCRIPTION_OO_IMPRESS_DOC, IMG_OO_IMPRESS_DOC },
+ { "ods", sal_False, STR_DESCRIPTION_OO_CALC_DOC, IMG_OO_CALC_DOC },
+ { "odt", sal_False, STR_DESCRIPTION_OO_WRITER_DOC, IMG_OO_WRITER_DOC },
+ { "otg", sal_False, STR_DESCRIPTION_OO_DRAW_TEMPLATE, IMG_OO_DRAW_TEMPLATE },
+ { "otp", sal_False, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE, IMG_OO_IMPRESS_TEMPLATE },
+ { "ots", sal_False, STR_DESCRIPTION_OO_CALC_TEMPLATE, IMG_OO_CALC_TEMPLATE },
+ { "ott", sal_False, STR_DESCRIPTION_OO_WRITER_TEMPLATE, IMG_OO_WRITER_TEMPLATE },
+ { "pas", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "pcd", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD },
+ { "pct", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT },
+ { "pcx", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX },
+ { "pl", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "png", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_PNG },
+ { "rar", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "rtf", sal_False, STR_DESCRIPTION_WORD_DOC, IMG_WRITER },
+ { "sbl", sal_False, 0, 0 },
+ { "sch", sal_False, 0, 0 },
+ { "sda", sal_False, STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW },
+ { "sdb", sal_False, STR_DESCRIPTION_SDATABASE_DOC, IMG_DATABASE },
+ { "sdc", sal_False, STR_DESCRIPTION_SCALC_DOC, IMG_CALC },
+ { "sdd", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, IMG_IMPRESS },
+ { "sdp", sal_False, STR_DESCRIPTION_SIMPRESS_DOC, 0 },
+ { "sds", sal_False, STR_DESCRIPTION_SCHART_DOC, 0 },
+ { "sdw", sal_False, STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER },
+ { "sga", sal_False, 0, 0 },
+ { "sgf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGF },
+ { "sgl", sal_False, STR_DESCRIPTION_GLOBALDOC, IMG_GLOBAL_DOC },
+ { "sgv", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SGV },
+ { "shtml", sal_False, STR_DESCRIPTION_HTMLFILE, IMG_HTML },
+ { "sim", sal_False, STR_DESCRIPTION_SIMAGE_DOC, IMG_SIM },
+ { "smf", sal_False, STR_DESCRIPTION_SMATH_DOC, IMG_MATH },
+ { "src", sal_True, STR_DESCRIPTION_SOURCEFILE, 0 },
+ { "svh", sal_False, STR_DESCRIPTION_HELP_DOC, 0 },
+ { "svm", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_SVM },
+ { "stc", sal_False, STR_DESCRIPTION_CALC_TEMPLATE, IMG_CALCTEMPLATE },
+ { "std", sal_False, STR_DESCRIPTION_DRAW_TEMPLATE, IMG_DRAWTEMPLATE },
+ { "sti", sal_False, STR_DESCRIPTION_IMPRESS_TEMPLATE, IMG_IMPRESSTEMPLATE },
+ { "stw", sal_False, STR_DESCRIPTION_WRITER_TEMPLATE, IMG_WRITERTEMPLATE },
+ { "sxc", sal_False, STR_DESCRIPTION_SXCALC_DOC, IMG_CALC },
+ { "sxd", sal_False, STR_DESCRIPTION_SXDRAW_DOC, IMG_DRAW },
+ { "sxg", sal_False, STR_DESCRIPTION_SXGLOBAL_DOC, IMG_GLOBAL_DOC },
+ { "sxi", sal_False, STR_DESCRIPTION_SXIMPRESS_DOC, IMG_IMPRESS },
+ { "sxm", sal_False, STR_DESCRIPTION_SXMATH_DOC, IMG_MATH },
+ { "sxs", sal_False, STR_DESCRIPTION_SXCHART_DOC, 0 },
+ { "sxw", sal_False, STR_DESCRIPTION_SXWRITER_DOC, IMG_WRITER },
+ { "sys", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "tif", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
+ { "tiff", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF },
+ { "txt", sal_False, STR_DESCRIPTION_TEXTFILE, IMG_TEXTFILE },
+ { "url", sal_False, STR_DESCRIPTION_LINK, 0 },
+ { "vor", sal_False, STR_DESCRIPTION_SOFFICE_TEMPLATE_DOC, IMG_WRITERTEMPLATE },
+ { "vxd", sal_True, STR_DESCRIPTION_SYSFILE, 0 },
+ { "wmf", sal_True, STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF },
+ { "xls", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
+ { "xlt", sal_False, STR_DESCRIPTION_EXCEL_TEMPLATE_DOC, IMG_CALCTEMPLATE },
+ { "xlsx", sal_False, STR_DESCRIPTION_EXCEL_DOC, IMG_CALC },
+ { "uu", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "uue", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "z", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "zip", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "zoo", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "gz", sal_True, STR_DESCRIPTION_ARCHIVFILE, 0 },
+ { "ppt", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
+ { "pot", sal_False, STR_DESCRIPTION_POWERPOINT_TEMPLATE, IMG_IMPRESSTEMPLATE },
+ { "pps", sal_False, STR_DESCRIPTION_POWERPOINT_SHOW, IMG_IMPRESS },
+ { "pptx", sal_False, STR_DESCRIPTION_POWERPOINT, IMG_IMPRESS },
+ { "oxt", sal_False, STR_DESCRIPTION_EXTENSION, IMG_EXTENSION },
+ { 0, sal_False, 0, 0 }
};
#ifdef OS2
SvtExtensionResIdMapping_Impl Mappings[] =
{
- {"StarWriter 4.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
- {"StarWriter 3.0", FALSE,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
- {"StarCalc 4.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
- {"StarCalc 3.0", FALSE,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
- {"StarImpress 4.0", FALSE,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS},
- {"StarDraw 4.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
- {"StarDraw 3.0", FALSE,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
- {"StarChart 3.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
- {"StarChart 4.0", FALSE,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
- {"Bitmap", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
- {"AutoCAD", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"Gif-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF},
- {"JPEG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG},
- {"Metafile ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"Photo-CD ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD},
- {"Mac Pict", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT},
- {"PCX-File ", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX},
- {"PNG-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"SV-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
- {"TIFF-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF},
- {"MS-Metafile", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF},
- {"XBM-File", FALSE,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
+ {"StarWriter 4.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
+ {"StarWriter 3.0", sal_False,STR_DESCRIPTION_SWRITER_DOC, IMG_WRITER},
+ {"StarCalc 4.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
+ {"StarCalc 3.0", sal_False,STR_DESCRIPTION_SCALC_DOC, IMG_CALC},
+ {"StarImpress 4.0", sal_False,STR_DESCRIPTION_SIMPRESS_DOC,IMG_IMPRESS},
+ {"StarDraw 4.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
+ {"StarDraw 3.0", sal_False,STR_DESCRIPTION_SDRAW_DOC, IMG_DRAW},
+ {"StarChart 3.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
+ {"StarChart 4.0", sal_False,STR_DESCRIPTION_SCHART_DOC, IMG_CHART},
+ {"Bitmap", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
+ {"AutoCAD", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"Gif-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_GIF},
+ {"JPEG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_JPG},
+ {"Metafile ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"Photo-CD ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCD},
+ {"Mac Pict", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCT},
+ {"PCX-File ", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_PCX},
+ {"PNG-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"SV-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_SIM},
+ {"TIFF-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_TIFF},
+ {"MS-Metafile", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_WMF},
+ {"XBM-File", sal_False,STR_DESCRIPTION_GRAPHIC_DOC, IMG_BITMAP},
{NULL, 0}
};
#endif
@@ -246,7 +245,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
if ( aPath.Len() )
{
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
while ( Fac2ExtMap_Impl[ nIndex ]._pFactory )
{
if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
@@ -304,12 +303,12 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
return aExtension;
}
-static USHORT GetIndexOfExtension_Impl( const String& rExtension )
+static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
{
- USHORT nRet = NO_INDEX;
+ sal_uInt16 nRet = NO_INDEX;
if ( rExtension.Len() )
{
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
String aExt = rExtension;
aExt.ToLowerAscii();
while ( ExtensionMap_Impl[ nIndex ]._pExt )
@@ -326,12 +325,12 @@ static USHORT GetIndexOfExtension_Impl( const String& rExtension )
return nRet;
}
-static USHORT GetImageId_Impl( const String& rExtension )
+static sal_uInt16 GetImageId_Impl( const String& rExtension )
{
- USHORT nImage = IMG_FILE;
+ sal_uInt16 nImage = IMG_FILE;
if ( rExtension.Len() != NO_INDEX )
{
- USHORT nIndex = GetIndexOfExtension_Impl( rExtension );
+ sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
{
nImage = ExtensionMap_Impl[ nIndex ]._nImgId;
@@ -367,9 +366,9 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool
return bRet;
}
-static USHORT GetFolderImageId_Impl( const String& rURL )
+static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
{
- USHORT nRet = IMG_FOLDER;
+ sal_uInt16 nRet = IMG_FOLDER;
::svtools::VolumeInfo aVolumeInfo;
try
{
@@ -397,12 +396,12 @@ static USHORT GetFolderImageId_Impl( const String& rURL )
return nRet;
}
-static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
+static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aTimeLog, "svtools", "hb93813", "SvFileInformationManager::GetImageId_Impl()" );
String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
- USHORT nImage = IMG_FILE;
+ sal_uInt16 nImage = IMG_FILE;
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
@@ -417,7 +416,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
return nImage;
}
else if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("image") ) )
- nImage = (USHORT)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
+ nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
}
else
{
@@ -425,7 +424,7 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
if ( aExt.EqualsAscii( "vor" ) )
{
SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ );
- USHORT nId = IMG_WRITERTEMPLATE;
+ sal_uInt16 nId = IMG_WRITERTEMPLATE;
if ( !aStorage->GetError() )
{
SvGlobalName aGlobalName = aStorage->GetClassName();
@@ -454,13 +453,13 @@ static USHORT GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFol
return nImage;
}
-static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
+static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
{
- USHORT nId = 0;
+ sal_uInt16 nId = 0;
if ( rExtension.Len() != NO_INDEX )
{
- USHORT nIndex = GetIndexOfExtension_Impl( rExtension );
+ sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
{
nId = ExtensionMap_Impl[ nIndex ]._nStrId;
@@ -473,7 +472,7 @@ static USHORT GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowE
static String GetDescriptionByFactory_Impl( const String& rFactory )
{
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) )
nResId = STR_DESCRIPTION_FACTORY_WRITER;
else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) )
@@ -500,9 +499,9 @@ static String GetDescriptionByFactory_Impl( const String& rFactory )
return aRet;
}
-static USHORT GetFolderDescriptionId_Impl( const String& rURL )
+static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL )
{
- USHORT nRet = STR_DESCRIPTION_FOLDER;
+ sal_uInt16 nRet = STR_DESCRIPTION_FOLDER;
svtools::VolumeInfo aVolumeInfo;
try
{
@@ -530,76 +529,7 @@ static USHORT GetFolderDescriptionId_Impl( const String& rURL )
return nRet;
}
-static ResMgr* GetIsoResMgr_Impl()
-{
- static ResMgr* pIsoResMgr = NULL;
-
- if ( !pIsoResMgr )
- {
- ByteString aResMgrName( "iso" );
- pIsoResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- if ( !pIsoResMgr )
- {
- // no "iso" resource -> search for "ooo" resource
- aResMgrName = ByteString( "ooo" );
- pIsoResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- }
- }
-
- return pIsoResMgr;
-}
-
-static ImageList* CreateImageList_Impl( USHORT nResId )
-{
- ImageList* pList = NULL;
- ResMgr* pResMgr = GetIsoResMgr_Impl();
- DBG_ASSERT( pResMgr, "SvFileInformationManager::CreateImageList_Impl(): no resmgr" );
- ResId aResId( nResId, *pResMgr );
- aResId.SetRT( RSC_IMAGELIST );
- if ( pResMgr->IsAvailable( aResId ) )
- pList = new ImageList( aResId );
- else
- pList = new ImageList();
- return pList;
-}
-
-static Image GetOfficeImageFromList_Impl( USHORT nImageId, BOOL bBig )
-{
- ImageList* pList = NULL;
-
- static ImageList* _pSmallOfficeImgList = NULL;
- static ImageList* _pBigOfficeImgList = NULL;
- static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
-
- // If the style has been changed, throw away our cache of the older images
- if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() )
- {
- delete _pSmallOfficeImgList, _pSmallOfficeImgList = NULL;
- delete _pBigOfficeImgList, _pBigOfficeImgList = NULL;
- nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
- }
-
- if ( bBig )
- {
- if ( !_pBigOfficeImgList )
- _pBigOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_BIG );
- pList = _pBigOfficeImgList;
- }
- else
- {
- if ( !_pSmallOfficeImgList )
- _pSmallOfficeImgList = CreateImageList_Impl( RID_SVTOOLS_IMAGELIST_SMALL );
- pList = _pSmallOfficeImgList;
- }
-
- Image aImage = pList->GetImage( nImageId );
-
- return aImage;
-}
-
-static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
+static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig )
{
if ( !bBig && IMG_FOLDER == nImageId )
// return our new small folder image (256 colors)
@@ -609,7 +539,7 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
static ImageList* _pSmallImageList = NULL;
static ImageList* _pBigImageList = NULL;
- static ULONG nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
+ static sal_uLong nStyle = Application::GetSettings().GetStyleSettings().GetSymbolsStyle();
// If the style has been changed, throw away our cache of the older images
if ( nStyle != Application::GetSettings().GetStyleSettings().GetSymbolsStyle() )
@@ -635,7 +565,8 @@ static Image GetImageFromList_Impl( USHORT nImageId, BOOL bBig )
if ( pList->HasImageAtPos( nImageId ) )
return pList->GetImage( nImageId );
else
- return GetOfficeImageFromList_Impl( nImageId, bBig );
+ return Image();
+// return GetOfficeImageFromList_Impl( nImageId, bBig );
}
String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
@@ -644,7 +575,7 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
String sDescription;
String sExtension( rObject.getExtension() ), sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) );
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
sal_Bool bShowExt = sal_False, bDetected = sal_False, bOnlyFile = sal_False;
sal_Bool bFolder = bDetectFolder ? CONTENT_HELPER::IsFolder( sURL ) : sal_False;
if ( !bFolder )
@@ -709,21 +640,21 @@ String SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObje
Image SvFileInformationManager::GetImage( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_True );
+ sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True );
DBG_ASSERT( nImage, "invalid ImageId" );
return GetImageFromList_Impl( nImage, bBig );
}
Image SvFileInformationManager::GetFileImage( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_False );
+ sal_Int16 nImage = GetImageId_Impl( rObject, sal_False );
DBG_ASSERT( nImage, "invalid ImageId" );
return GetImageFromList_Impl( nImage, bBig );
}
Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject, sal_Bool bBig )
{
- USHORT nImage = GetImageId_Impl( rObject, sal_True );
+ sal_uInt16 nImage = GetImageId_Impl( rObject, sal_True );
DBG_ASSERT( nImage, "invalid ImageId" );
if ( nImage == IMG_FILE )
@@ -734,7 +665,7 @@ Image SvFileInformationManager::GetImageNoDefault( const INetURLObject& rObject,
Image SvFileInformationManager::GetFolderImage( const svtools::VolumeInfo& rInfo, sal_Bool bBig )
{
- USHORT nImage = IMG_FOLDER;
+ sal_uInt16 nImage = IMG_FOLDER;
DBG_ASSERT( nImage, "invalid ImageId" );
if ( rInfo.m_bIsRemote )
@@ -761,7 +692,7 @@ String SvFileInformationManager::GetFileDescription( const INetURLObject& rObjec
String SvFileInformationManager::GetFolderDescription( const svtools::VolumeInfo& rInfo )
{
- USHORT nResId = STR_DESCRIPTION_FOLDER;
+ sal_uInt16 nResId = STR_DESCRIPTION_FOLDER;
if ( rInfo.m_bIsRemote )
nResId = STR_DESCRIPTION_REMOTE_VOLUME;
else if ( rInfo.m_bIsFloppy )
diff --git a/svtools/source/misc/imagemgr.src b/svtools/source/misc/imagemgr.src
index c49f048364e4..62104ea09d54 100644
--- a/svtools/source/misc/imagemgr.src
+++ b/svtools/source/misc/imagemgr.src
@@ -27,11 +27,26 @@
// includes ******************************************************************
#include <svtools/svtools.hrc>
-#include "imagemgr.hrc"
+#include <svtools/imagemgr.hrc>
// images ********************************************************************
#define X_IMAGE_LIST \
+ IMG_IMPRESS ; \
+ IMG_CALC ; \
+ IMG_CALCTEMPLATE ; \
+ IMG_CHART ; \
+ IMG_IMPRESSTEMPLATE ; \
+ IMG_HTML ; \
+ IMG_MATH ; \
+ IMG_WRITER ; \
+ IMG_WRITERTEMPLATE ; \
+ IMG_MACROLIB ; \
+ IMG_GLOBAL_DOC ; \
+ IMG_DRAW ; \
+ IMG_DRAWTEMPLATE ; \
+ IMG_NEWFROMTEMPLATE ; \
+ IMG_DATABASE; \
IMG_BITMAP ; \
IMG_CALC ; \
IMG_CALCTEMPLATE ; \
@@ -95,7 +110,7 @@ ImageList RID_SVTOOLS_IMAGELIST_BIG
};
IdCount =
{
- 51 ;
+ 66 ;
};
};
@@ -109,7 +124,7 @@ ImageList RID_SVTOOLS_IMAGELIST_SMALL
};
IdCount =
{
- 51;
+ 66;
};
};
diff --git a/svtools/source/misc/imageresourceaccess.cxx b/svtools/source/misc/imageresourceaccess.cxx
index 47a68a5684ea..e69f1967b462 100644
--- a/svtools/source/misc/imageresourceaccess.cxx
+++ b/svtools/source/misc/imageresourceaccess.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "imageresourceaccess.hxx"
+#include <svtools/imageresourceaccess.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/io/NotConnectedException.hpp>
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 105eb763fb7b..88bb9a9a510a 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -53,15 +53,11 @@ DBG_NAME( ImageMap )
/******************************************************************************/
-UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW;
+sal_uInt16 IMapObject::nActualTextEncoding = (sal_uInt16) RTL_TEXTENCODING_DONTKNOW;
/******************************************************************************/
-#ifdef WIN
-#pragma optimize ( "", off )
-#endif
-
IMapObject::IMapObject()
: bActive( false )
, nReadVersion( 0 )
@@ -69,7 +65,7 @@ IMapObject::IMapObject()
}
IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc,
- const String& rTarget, const String& rName, BOOL bURLActive )
+ const String& rTarget, const String& rName, sal_Bool bURLActive )
: aURL( rURL )
, aAltText( rAltText )
, aDesc( rDesc )
@@ -87,7 +83,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String
|*
\******************************************************************************/
-UINT16 IMapObject::GetVersion() const
+sal_uInt16 IMapObject::GetVersion() const
{
return IMAP_OBJ_VERSION;
}
@@ -106,7 +102,7 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const
rOStm << GetType();
rOStm << GetVersion();
- rOStm << ( (UINT16) eEncoding );
+ rOStm << ( (sal_uInt16) eEncoding );
const ByteString aRelURL = ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), eEncoding );
rOStm.WriteByteString( aRelURL );
@@ -197,7 +193,7 @@ Point IMapObject::GetLogPoint( const Point& rPixelPoint )
|*
\******************************************************************************/
-BOOL IMapObject::IsEqual( const IMapObject& rEqObj )
+sal_Bool IMapObject::IsEqual( const IMapObject& rEqObj )
{
return ( ( aURL == rEqObj.aURL ) &&
( aAltText == rEqObj.aAltText ) &&
@@ -218,8 +214,8 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
{
ImpConstruct( rRect, bPixelCoords );
@@ -232,7 +228,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
|*
\******************************************************************************/
-void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, BOOL bPixel )
+void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, sal_Bool bPixel )
{
if ( bPixel )
aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) );
@@ -271,7 +267,7 @@ void IMapRectangleObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapRectangleObject::GetType() const
+sal_uInt16 IMapRectangleObject::GetType() const
{
return IMAP_OBJ_RECTANGLE;
}
@@ -283,7 +279,7 @@ UINT16 IMapRectangleObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapRectangleObject::IsHit( const Point& rPoint ) const
{
return aRect.IsInside( rPoint );
}
@@ -295,7 +291,7 @@ BOOL IMapRectangleObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Rectangle IMapRectangleObject::GetRectangle( BOOL bPixelCoords ) const
+Rectangle IMapRectangleObject::GetRectangle( sal_Bool bPixelCoords ) const
{
Rectangle aNewRect;
@@ -335,7 +331,7 @@ void IMapRectangleObject::Scale( const Fraction& rFracX, const Fraction& rFracY
|*
\******************************************************************************/
-BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
+sal_Bool IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
{
return ( IMapObject::IsEqual( rEqObj ) && ( aRect == rEqObj.aRect ) );
}
@@ -345,14 +341,14 @@ BOOL IMapRectangleObject::IsEqual( const IMapRectangleObject& rEqObj )
/******************************************************************************/
/******************************************************************************/
-IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius,
+IMapCircleObject::IMapCircleObject( const Point& rCenter, sal_uLong nCircleRadius,
const String& rURL,
const String& rAltText,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
{
ImpConstruct( rCenter, nCircleRadius, bPixelCoords );
@@ -365,7 +361,7 @@ IMapCircleObject::IMapCircleObject( const Point& rCenter, ULONG nCircleRadius,
|*
\******************************************************************************/
-void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPixel )
+void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel )
{
if ( bPixel )
{
@@ -390,7 +386,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, ULONG nRad, BOOL bPix
void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const
{
- UINT32 nTmp = nRadius;
+ sal_uInt32 nTmp = nRadius;
rOStm << aCenter;
rOStm << nTmp;
@@ -405,7 +401,7 @@ void IMapCircleObject::WriteIMapObject( SvStream& rOStm ) const
void IMapCircleObject::ReadIMapObject( SvStream& rIStm )
{
- UINT32 nTmp;
+ sal_uInt32 nTmp;
rIStm >> aCenter;
rIStm >> nTmp;
@@ -420,7 +416,7 @@ void IMapCircleObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapCircleObject::GetType() const
+sal_uInt16 IMapCircleObject::GetType() const
{
return IMAP_OBJ_CIRCLE;
}
@@ -432,15 +428,15 @@ UINT16 IMapCircleObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapCircleObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const
{
const Point aPoint( aCenter - rPoint );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
- if ( (ULONG) sqrt( (double) aPoint.X() * aPoint.X() +
+ if ( (sal_uLong) sqrt( (double) aPoint.X() * aPoint.X() +
aPoint.Y() * aPoint.Y() ) <= nRadius )
{
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -453,7 +449,7 @@ BOOL IMapCircleObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const
+Point IMapCircleObject::GetCenter( sal_Bool bPixelCoords ) const
{
Point aNewPoint;
@@ -472,9 +468,9 @@ Point IMapCircleObject::GetCenter( BOOL bPixelCoords ) const
|*
\******************************************************************************/
-ULONG IMapCircleObject::GetRadius( BOOL bPixelCoords ) const
+sal_uLong IMapCircleObject::GetRadius( sal_Bool bPixelCoords ) const
{
- ULONG nNewRadius;
+ sal_uLong nNewRadius;
if ( bPixelCoords )
nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width();
@@ -528,7 +524,7 @@ void IMapCircleObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
|*
\******************************************************************************/
-BOOL IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj )
+sal_Bool IMapCircleObject::IsEqual( const IMapCircleObject& rEqObj )
{
return ( IMapObject::IsEqual( rEqObj ) &&
( aCenter == rEqObj.aCenter ) &&
@@ -545,10 +541,10 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly,
const String& rDesc,
const String& rTarget,
const String& rName,
- BOOL bURLActive,
- BOOL bPixelCoords ) :
+ sal_Bool bURLActive,
+ sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ),
- bEllipse ( FALSE )
+ bEllipse ( sal_False )
{
ImpConstruct( rPoly, bPixelCoords );
}
@@ -560,7 +556,7 @@ IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly,
|*
\******************************************************************************/
-void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, BOOL bPixel )
+void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, sal_Bool bPixel )
{
if ( bPixel )
aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) );
@@ -608,7 +604,7 @@ void IMapPolygonObject::ReadIMapObject( SvStream& rIStm )
|*
\******************************************************************************/
-UINT16 IMapPolygonObject::GetType() const
+sal_uInt16 IMapPolygonObject::GetType() const
{
return IMAP_OBJ_POLYGON;
}
@@ -620,7 +616,7 @@ UINT16 IMapPolygonObject::GetType() const
|*
\******************************************************************************/
-BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const
+sal_Bool IMapPolygonObject::IsHit( const Point& rPoint ) const
{
return aPoly.IsInside( rPoint );
}
@@ -632,7 +628,7 @@ BOOL IMapPolygonObject::IsHit( const Point& rPoint ) const
|*
\******************************************************************************/
-Polygon IMapPolygonObject::GetPolygon( BOOL bPixelCoords ) const
+Polygon IMapPolygonObject::GetPolygon( sal_Bool bPixelCoords ) const
{
Polygon aNewPoly;
@@ -655,7 +651,7 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse )
{
if ( aPoly.GetSize() )
{
- bEllipse = TRUE;
+ bEllipse = sal_True;
aEllipse = rEllipse;
}
}
@@ -669,9 +665,9 @@ void IMapPolygonObject::SetExtraEllipse( const Rectangle& rEllipse )
void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
{
- USHORT nCount = aPoly.GetSize();
+ sal_uInt16 nCount = aPoly.GetSize();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
Point aScaledPt( aPoly[ i ] );
@@ -705,30 +701,30 @@ void IMapPolygonObject::Scale( const Fraction& rFracX, const Fraction& rFracY )
|*
\******************************************************************************/
-BOOL IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj )
+sal_Bool IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( IMapObject::IsEqual( rEqObj ) )
{
const Polygon& rEqPoly = rEqObj.aPoly;
- const USHORT nCount = aPoly.GetSize();
- const USHORT nEqCount = rEqPoly.GetSize();
- BOOL bDifferent = FALSE;
+ const sal_uInt16 nCount = aPoly.GetSize();
+ const sal_uInt16 nEqCount = rEqPoly.GetSize();
+ sal_Bool bDifferent = sal_False;
if ( nCount == nEqCount )
{
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
if ( aPoly[ i ] != rEqPoly[ i ] )
{
- bDifferent = TRUE;
+ bDifferent = sal_True;
break;
}
}
if ( !bDifferent )
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -763,9 +759,9 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
{
DBG_CTOR( ImageMap, NULL );
- USHORT nCount = rImageMap.GetIMapObjectCount();
+ sal_uInt16 nCount = rImageMap.GetIMapObjectCount();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pCopyObj = rImageMap.GetIMapObject( i );
@@ -836,11 +832,11 @@ void ImageMap::ClearImageMap()
ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
{
- USHORT nCount = rImageMap.GetIMapObjectCount();
+ sal_uInt16 nCount = rImageMap.GetIMapObjectCount();
ClearImageMap();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pCopyObj = rImageMap.GetIMapObject( i );
@@ -875,17 +871,17 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
|*
\******************************************************************************/
-BOOL ImageMap::operator==( const ImageMap& rImageMap )
+sal_Bool ImageMap::operator==( const ImageMap& rImageMap )
{
- const USHORT nCount = (USHORT) maList.Count();
- const USHORT nEqCount = rImageMap.GetIMapObjectCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nCount = (sal_uInt16) maList.Count();
+ const sal_uInt16 nEqCount = rImageMap.GetIMapObjectCount();
+ sal_Bool bRet = sal_False;
if ( nCount == nEqCount )
{
- BOOL bDifferent = ( aName != rImageMap.aName );
+ sal_Bool bDifferent = ( aName != rImageMap.aName );
- for ( USHORT i = 0; ( i < nCount ) && !bDifferent; i++ )
+ for ( sal_uInt16 i = 0; ( i < nCount ) && !bDifferent; i++ )
{
IMapObject* pObj = (IMapObject*) maList.GetObject( i );
IMapObject* pEqObj = rImageMap.GetIMapObject( i );
@@ -897,21 +893,21 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
case( IMAP_OBJ_RECTANGLE ):
{
if ( !( (IMapRectangleObject*) pObj )->IsEqual( *(IMapRectangleObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
case( IMAP_OBJ_CIRCLE ):
{
if ( !( (IMapCircleObject*) pObj )->IsEqual( *(IMapCircleObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
case( IMAP_OBJ_POLYGON ):
{
if ( !( (IMapPolygonObject*) pObj )->IsEqual( *(IMapPolygonObject*) pEqObj ) )
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
break;
@@ -920,11 +916,11 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
}
}
else
- bDifferent = TRUE;
+ bDifferent = sal_True;
}
if ( !bDifferent )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -937,7 +933,7 @@ BOOL ImageMap::operator==( const ImageMap& rImageMap )
|*
\******************************************************************************/
-BOOL ImageMap::operator!=( const ImageMap& rImageMap )
+sal_Bool ImageMap::operator!=( const ImageMap& rImageMap )
{
return !( *this == rImageMap );
}
@@ -949,7 +945,7 @@ BOOL ImageMap::operator!=( const ImageMap& rImageMap )
|*
\******************************************************************************/
-UINT16 ImageMap::GetVersion() const
+sal_uInt16 ImageMap::GetVersion() const
{
return IMAGE_MAP_VERSION;
}
@@ -992,7 +988,7 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject )
IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize,
const Size& rDisplaySize,
const Point& rRelHitPoint,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aRelPoint( rTotalSize.Width() * rRelHitPoint.X() / rDisplaySize.Width(),
rTotalSize.Height() * rRelHitPoint.Y() / rDisplaySize.Height() );
@@ -1031,9 +1027,9 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize,
Rectangle ImageMap::GetBoundRect() const
{
Rectangle aBoundRect;
- ULONG nCount = maList.Count();
+ sal_uLong nCount = maList.Count();
- for ( ULONG i = 0; i < nCount; i++ )
+ for ( sal_uLong i = 0; i < nCount; i++ )
aBoundRect.Union( ( (IMapObject*) maList.GetObject( i ) )->GetBoundRect() );
return aBoundRect;
@@ -1048,9 +1044,9 @@ Rectangle ImageMap::GetBoundRect() const
void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY )
{
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
IMapObject* pObj = GetIMapObject( i );
@@ -1084,9 +1080,9 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY )
void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = (IMapObject*) maList.GetObject( i );
pObj->Write( rOStm, rBaseURL );
@@ -1100,12 +1096,12 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const
|*
\******************************************************************************/
-void ImageMap::ImpReadImageMap( SvStream& rIStm, USHORT nCount, const String& rBaseURL )
+void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& rBaseURL )
{
// neue Objekte einlesen
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- UINT16 nType;
+ sal_uInt16 nType;
rIStm >> nType;
rIStm.SeekRel( -2 );
@@ -1154,8 +1150,8 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
IMapCompat* pCompat;
String aImageName( GetName() );
String aDummy;
- USHORT nOldFormat = rOStm.GetNumberFormatInt();
- UINT16 nCount = (UINT16) GetIMapObjectCount();
+ sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount();
const rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1190,8 +1186,8 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
{
ByteString aString;
char cMagic[6];
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
- UINT16 nCount;
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uInt16 nCount;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rIStm.Read( cMagic, sizeof( cMagic ) );
@@ -1226,9 +1222,4 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
}
-#ifdef WIN
-#pragma optimize ( "", on )
-#endif
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index d1cb4ddafd72..20e8ae6431b8 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -29,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
#include <vcl/svapp.hxx>
#include <tools/urlobj.hxx>
@@ -46,9 +43,6 @@
#include <svtools/imapcirc.hxx>
#include <svtools/imappoly.hxx>
-#ifdef WIN
-#include <sysdep.hxx>
-#endif
#include <string.h>
#include <math.h>
@@ -216,9 +210,9 @@ void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) cons
void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
ByteString aStr( "polygon " );
- const USHORT nCount = aPoly.GetSize();
+ const sal_uInt16 nCount = aPoly.GetSize();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
AppendCERNCoords( aPoly[ i ], aStr );
AppendCERNURL( aStr, rBaseURL );
@@ -236,11 +230,11 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co
void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
ByteString aStr( "poly " );
- const USHORT nCount = Min( aPoly.GetSize(), (USHORT) 100 );
+ const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 );
AppendNCSAURL( aStr, rBaseURL );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
AppendNCSACoords( aPoly[ i ], aStr );
rOStm.WriteLine( aStr );
@@ -257,7 +251,7 @@ void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) co
|*
\******************************************************************************/
-void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) const
+void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const
{
switch( nFormat )
{
@@ -280,9 +274,9 @@ void ImageMap::Write( SvStream& rOStm, ULONG nFormat, const String& rBaseURL ) c
void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = GetIMapObject( i );
@@ -316,9 +310,9 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
IMapObject* pObj;
- USHORT nCount = (USHORT) maList.Count();
+ sal_uInt16 nCount = (sal_uInt16) maList.Count();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pObj = GetIMapObject( i );
@@ -349,9 +343,9 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
|*
\******************************************************************************/
-ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL )
+sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL )
{
- ULONG nRet = IMAP_ERR_FORMAT;
+ sal_uLong nRet = IMAP_ERR_FORMAT;
if ( nFormat == IMAP_FORMAT_DETECT )
nFormat = ImpDetectFormat( rIStm );
@@ -379,7 +373,7 @@ ULONG ImageMap::Read( SvStream& rIStm, ULONG nFormat, const String& rBaseURL )
|*
\******************************************************************************/
-ULONG ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -442,11 +436,11 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL
}
else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) )
{
- const USHORT nCount = aStr.GetTokenCount( '(' ) - 1;
+ const sal_uInt16 nCount = aStr.GetTokenCount( '(' ) - 1;
Polygon aPoly( nCount );
String aURL;
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadCERNCoords( &pStr );
aURL = ImpReadCERNURL( &pStr, rBaseURL );
@@ -557,7 +551,7 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
|*
\******************************************************************************/
-ULONG ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
{
ByteString aStr;
@@ -622,11 +616,11 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL
}
else if ( aToken == "poly" )
{
- const USHORT nCount = aStr.GetTokenCount( ',' ) - 1;
+ const sal_uInt16 nCount = aStr.GetTokenCount( ',' ) - 1;
const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
Polygon aPoly( nCount );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadNCSACoords( &pStr );
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
@@ -712,10 +706,10 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
|*
\******************************************************************************/
-ULONG ImageMap::ImpDetectFormat( SvStream& rIStm )
+sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
{
- ULONG nPos = rIStm.Tell();
- ULONG nRet = IMAP_FORMAT_BIN;
+ sal_uLong nPos = rIStm.Tell();
+ sal_uLong nRet = IMAP_FORMAT_BIN;
char cMagic[6];
rIStm.Read( cMagic, sizeof( cMagic ) );
diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx
index 1072121a3c5d..21cce8e7672f 100644
--- a/svtools/source/misc/imap3.cxx
+++ b/svtools/source/misc/imap3.cxx
@@ -41,7 +41,7 @@
|*
\******************************************************************************/
-IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) :
+IMapCompat::IMapCompat( SvStream& rStm, const sal_uInt16 nStreamMode ) :
pRWStm ( &rStm ),
nStmMode ( nStreamMode )
{
@@ -57,7 +57,7 @@ IMapCompat::IMapCompat( SvStream& rStm, const USHORT nStreamMode ) :
}
else
{
- UINT32 nTotalSizeTmp;
+ sal_uInt32 nTotalSizeTmp;
*pRWStm >> nTotalSizeTmp;
nTotalSize = nTotalSizeTmp;
nCompatPos = pRWStm->Tell();
@@ -78,15 +78,15 @@ IMapCompat::~IMapCompat()
{
if ( nStmMode == STREAM_WRITE )
{
- const ULONG nEndPos = pRWStm->Tell();
+ const sal_uLong nEndPos = pRWStm->Tell();
pRWStm->Seek( nCompatPos );
- *pRWStm << (UINT32) ( nEndPos - nTotalSize );
+ *pRWStm << (sal_uInt32) ( nEndPos - nTotalSize );
pRWStm->Seek( nEndPos );
}
else
{
- const ULONG nReadSize = pRWStm->Tell() - nCompatPos;
+ const sal_uLong nReadSize = pRWStm->Tell() - nCompatPos;
if ( nTotalSize > nReadSize )
pRWStm->SeekRel( nTotalSize - nReadSize );
diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx
index 184b631cec65..0850947b9064 100644
--- a/svtools/source/misc/itemdel.cxx
+++ b/svtools/source/misc/itemdel.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "itemdel.hxx"
+#include <svtools/itemdel.hxx>
#include <vcl/svapp.hxx>
#include <tools/errcode.hxx>
#include <limits.h>
@@ -125,7 +125,7 @@ void DeleteOnIdleItems()
= ImpSvtData::GetSvtData().pItemDesruptList;
if ( rpList )
{
- USHORT n;
+ sal_uInt16 n;
while ( 0 != ( n = rpList->Count() ) )
// Remove ist implizit im Dtor
delete rpList->GetObject( n-1 );
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 1a139a2ff966..7d5bb5d49f35 100644..100755
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -49,7 +49,7 @@ using namespace ::com::sun::star;
SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText )
{
- const USHORT nLen = rText.Len();
+ const sal_uInt16 nLen = rText.Len();
if (nLen == 0)
return String();
@@ -75,7 +75,7 @@ SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText )
// Thus we can avoid to check every character of the text.
bool bFound = false;
bool bIsRtlText = false;
- for (USHORT i = 0; i < nLen && !bFound; ++i)
+ for (sal_uInt16 i = 0; i < nLen && !bFound; ++i)
{
sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i );
switch (nDirection)
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index e521fbdba570..67d650b61c8e 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -301,7 +301,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Shuswap" ; LANGUAGE_USER_SHUSWAP ; > ;
< "Oromo" ; LANGUAGE_OROMO ; > ;
< "Greek, Ancient" ; LANGUAGE_USER_ANCIENT_GREEK ; > ;
- < "Yiddish" ; LANGUAGE_YIDDISH ; > ;
+ < "Yiddish (Israel)" ; LANGUAGE_YIDDISH ; > ;
< "Quechua (Ecuador)" ; LANGUAGE_QUECHUA_ECUADOR ; > ;
< "Uyghur" ; LANGUAGE_UIGHUR_CHINA ; > ;
< "Asturian" ; LANGUAGE_USER_ASTURIAN ; > ;
@@ -324,6 +324,12 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Rusyn (Ukraine)" ; LANGUAGE_USER_RUSYN_UKRAINE ; > ;
< "Rusyn (Slovakia)" ; LANGUAGE_USER_RUSYN_SLOVAKIA ; > ;
< "Kabyle Latin" ; LANGUAGE_TAMAZIGHT_LATIN ; > ;
+ < "Yiddish (USA)" ; LANGUAGE_USER_YIDDISH_US ; > ;
+ < "Hawaiian" ; LANGUAGE_HAWAIIAN_UNITED_STATES ; > ;
+ < "Limbu" ; LANGUAGE_USER_LIMBU ; > ;
+ < "Lojban" ; LANGUAGE_USER_LOJBAN ; > ;
+ < "Kabyle" ; LANGUAGE_USER_KABYLE ; > ;
+ < "Haitian" ; LANGUAGE_USER_HAITIAN ; > ;
};
};
diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk
deleted file mode 100755
index fe7680492cd0..000000000000
--- a/svtools/source/misc/makefile.mk
+++ /dev/null
@@ -1,88 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=misc
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-#use local "bmp" as it may not yet be delivered
-
-SRS1NAME=misc
-SRC1FILES=\
- ehdl.src \
- helpagent.src \
- imagemgr.src \
- langtab.src
-
-SRS2NAME=ehdl
-SRC2FILES=\
- errtxt.src
-
-SLOFILES=\
- $(SLO)$/acceleratorexecute.obj \
- $(SLO)$/chartprettypainter.obj \
- $(SLO)$/cliplistener.obj \
- $(SLO)$/dialogclosedlistener.obj\
- $(SLO)$/dialogcontrolling.obj \
- $(SLO)$/ehdl.obj \
- $(SLO)$/embedhlp.obj \
- $(SLO)$/embedtransfer.obj \
- $(SLO)$/filechangedchecker.obj \
- $(SLO)$/helpagentwindow.obj \
- $(SLO)$/imagemgr.obj \
- $(SLO)$/imageresourceaccess.obj \
- $(SLO)$/imap.obj \
- $(SLO)$/imap2.obj \
- $(SLO)$/imap3.obj \
- $(SLO)$/itemdel.obj \
- $(SLO)$/langtab.obj \
- $(SLO)$/langhelp.obj \
- $(SLO)$/stringtransfer.obj \
- $(SLO)$/svtaccessiblefactory.obj \
- $(SLO)$/svtdata.obj \
- $(SLO)$/templatefoldercache.obj \
- $(SLO)$/transfer.obj \
- $(SLO)$/transfer2.obj \
- $(SLO)$/unitconv.obj \
- $(SLO)$/bindablecontrolhelper.obj \
- $(SLO)$/filterutils.obj \
- $(SLO)$/wallitem.obj \
- $(SLO)$/xwindowitem.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx
index 9429ac014df9..23c98175f7a2 100644
--- a/svtools/source/misc/svtdata.cxx
+++ b/svtools/source/misc/svtdata.cxx
@@ -61,25 +61,6 @@ ResMgr * ImpSvtData::GetResMgr()
return GetResMgr(Application::GetSettings().GetUILocale());
}
-ResMgr * ImpSvtData::GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale)
-{
- if (!pPatchResMgr)
- {
- pPatchResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(svp), aLocale);
- }
- return pPatchResMgr;
-}
-
-ResMgr * ImpSvtData::GetPatchResMgr()
-{
- return GetPatchResMgr(Application::GetSettings().GetUILocale());
-}
-
-SvpResId::SvpResId( USHORT nId ) :
- ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() )
-{
-}
-
//============================================================================
// static
ImpSvtData & ImpSvtData::GetSvtData()
@@ -90,4 +71,9 @@ ImpSvtData & ImpSvtData::GetSvtData()
return *static_cast<ImpSvtData *>(*pAppData);
}
+SvtResId::SvtResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale):
+ ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {}
+
+SvtResId::SvtResId(sal_uInt16 nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 1543d2b5e076..20d82fe6e02b 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "templatefoldercache.hxx"
+#include <svtools/templatefoldercache.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/localfilehelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -117,8 +117,8 @@ namespace svt
//=====================================================================
struct TemplateContent;
typedef ::std::vector< ::rtl::Reference< TemplateContent > > TemplateFolderContent;
- typedef TemplateFolderContent::const_iterator ConstFolderIterator;
- typedef TemplateFolderContent::iterator FolderIterator;
+ typedef TemplateFolderContent::const_iterator ConstFolderIterator;
+ typedef TemplateFolderContent::iterator FolderIterator;
/** a struct describing one content in one of the template dirs (or at least it's relevant aspects)
*/
@@ -706,15 +706,18 @@ namespace svt
m_aCurrentState.swap( aTemplateFolderContent );
// the template directories from the config
- String aDirs = SvtPathOptions().GetTemplatePath();
+ const SvtPathOptions aPathOptions;
+ String aDirs = aPathOptions.GetTemplatePath();
sal_uInt16 nDirs = aDirs.GetTokenCount( ';' );
m_aCurrentState.reserve( nDirs );
// loop through all the root-level template folders
for ( sal_uInt16 i=0; i<nDirs; ++i)
{
+ String sTemplatePath( aDirs.GetToken( i, ';' ) );
+ sTemplatePath = aPathOptions.ExpandMacros( sTemplatePath );
// create a new entry
- m_aCurrentState.push_back( new TemplateContent( INetURLObject( aDirs.GetToken( i, ';' ) ) ) );
+ m_aCurrentState.push_back( new TemplateContent( INetURLObject( sTemplatePath ) ) );
TemplateFolderContent::iterator aCurrentRoot = m_aCurrentState.end();
--aCurrentRoot;
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 1ce02a305513..2adee87e49a3 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -432,7 +432,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
SvMemoryStream aDstStm( 65535, 65535 );
// taking wmf without file header
- if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, FALSE ) )
+ if ( ConvertGDIMetaFileToWMF( aMtf, aDstStm, NULL, sal_False ) )
{
maAny <<= ( aSeq = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aDstStm.GetData() ),
aDstStm.Seek( STREAM_SEEK_TO_END ) ) );
@@ -936,7 +936,7 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk,
rFDesc1.dwFlags = FD_LINKUI;
ByteString aStr( rBmk.GetDescription(), eSysCSet );
- for( USHORT nChar = 0; nChar < aStr.Len(); ++nChar )
+ for( sal_uInt16 nChar = 0; nChar < aStr.Len(); ++nChar )
if( strchr( "\\/:*?\"<>|", aStr.GetChar( nChar ) ) )
aStr.Erase( nChar--, 1 );
@@ -1843,7 +1843,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM
if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE )
{
rMtf = aGraphic.GetGDIMetaFile();
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1857,7 +1857,7 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIM
if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE )
{
rMtf = aGraphic.GetGDIMetaFile();
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 3ef70f236b0d..5e4fa8e56077 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -41,9 +41,8 @@
#include <vcl/window.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
-
#include "svl/urlbmk.hxx"
-#include "inetimg.hxx"
+#include <svtools/inetimg.hxx>
#include <svtools/imap.hxx>
#include <svtools/transfer.hxx>
@@ -436,7 +435,7 @@ sal_Bool TransferDataContainer::GetData( const
TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ),
aEnd( pImpl->aFmtList.end() );
sal_Bool bFnd = sal_False;
- ULONG nFmtId = SotExchange::GetFormat( rFlavor );
+ sal_uLong nFmtId = SotExchange::GetFormat( rFlavor );
// test first the list
for( ; aIter != aEnd; ++aIter )
@@ -502,8 +501,8 @@ void TransferDataContainer::CopyINetBookmark( const INetBookmark& rBkmk )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyAnyData( ULONG nFormatId,
- const sal_Char* pData, ULONG nLen )
+void TransferDataContainer::CopyAnyData( sal_uLong nFormatId,
+ const sal_Char* pData, sal_uLong nLen )
{
if( nLen )
{
@@ -520,7 +519,7 @@ void TransferDataContainer::CopyAnyData( ULONG nFormatId,
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyByteString( ULONG nFormatId,
+void TransferDataContainer::CopyByteString( sal_uLong nFormatId,
const ByteString& rStr )
{
CopyAnyData( nFormatId, rStr.GetBuffer(), rStr.Len() );
@@ -570,7 +569,7 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyString( USHORT nFmt, const String& rStr )
+void TransferDataContainer::CopyString( sal_uInt16 nFmt, const String& rStr )
{
if( rStr.Len() )
{
@@ -592,7 +591,7 @@ void TransferDataContainer::CopyString( const String& rStr )
// -----------------------------------------------------------------------------
-void TransferDataContainer::CopyAny( USHORT nFmt,
+void TransferDataContainer::CopyAny( sal_uInt16 nFmt,
const ::com::sun::star::uno::Any& rAny )
{
TDataCntnrEntry_Impl aEntry;
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/misc/undo.src
index fae40f4c3f6f..33c179a65032 100644
--- a/svtools/source/filter.vcl/filter/dlgejpg.hrc
+++ b/svtools/source/misc/undo.src
@@ -24,14 +24,20 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
+ // include ------------------------------------------------------------------
+
#include <svtools/svtools.hrc>
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define FI_DESCR 1
-#define NUM_FLD_QUALITY 1
-#define GRP_QUALITY 1
-#define GRP_COLORS 2
-#define RB_GRAY 1
-#define RB_RGB 2
+String STR_UNDO
+{
+ Text [ en-US ] = "Undo: " ;
+};
+String STR_REDO
+{
+ Text [ en-US ] = "Re~do: " ;
+};
+String STR_REPEAT
+{
+ Text [ en-US ] = "~Repeat: " ;
+}; \ No newline at end of file
diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index 2f59261f327f..17adaeaecd81 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -35,7 +35,7 @@
// -----------------------------------------------------------------------
-void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll )
+void SetFieldUnit( MetricField& rField, FieldUnit eUnit, sal_Bool bAll )
{
sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) );
sal_Int64 nLast = rField.Denormalize( rField.GetLast( FUNIT_TWIP ) );
@@ -95,7 +95,7 @@ void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll )
// -----------------------------------------------------------------------
-void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll )
+void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, sal_Bool bAll )
{
sal_Int64 nMin = rBox.Denormalize( rBox.GetMin( FUNIT_TWIP ) );
sal_Int64 nMax = rBox.Denormalize( rBox.GetMax( FUNIT_TWIP ) );
@@ -351,7 +351,7 @@ long ConvertValueToUnit( long nVal, SfxMapUnit eUnit )
// -----------------------------------------------------------------------
-long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor )
+long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor )
{
DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP ||
eUnit == SFX_MAPUNIT_100TH_MM ||
@@ -723,8 +723,8 @@ long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew )
return nVal;
}
- USHORT nOld = 0;
- USHORT nNew = 0;
+ sal_uInt16 nOld = 0;
+ sal_uInt16 nNew = 0;
switch ( aOld )
{
diff --git a/svtools/source/misc/wallitem.cxx b/svtools/source/misc/wallitem.cxx
index 147cd0a6b154..b9d0300a140c 100644
--- a/svtools/source/misc/wallitem.cxx
+++ b/svtools/source/misc/wallitem.cxx
@@ -49,7 +49,7 @@
#include <vcl/gradient.hxx>
#include <vcl/cvtgrf.hxx>
-#include "wallitem.hxx"
+#include <svtools/wallitem.hxx>
#include <svl/cntwall.hxx>
// -----------------------------------------------------------------------
diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx
index d801d06317b8..eea3f65577aa 100644
--- a/svtools/source/misc/xwindowitem.cxx
+++ b/svtools/source/misc/xwindowitem.cxx
@@ -47,7 +47,7 @@ XWindowItem::XWindowItem() :
}
-XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) :
+XWindowItem::XWindowItem( sal_uInt16 nWhichId, Window * pWin ) :
SfxPoolItem( nWhichId )
{
if (pWin)
@@ -59,7 +59,7 @@ XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) :
}
-XWindowItem::XWindowItem( USHORT nWhichId, uno::Reference< awt::XWindow > & rxWin ) :
+XWindowItem::XWindowItem( sal_uInt16 nWhichId, uno::Reference< awt::XWindow > & rxWin ) :
SfxPoolItem( nWhichId ),
m_xWin( rxWin )
{
diff --git a/svtools/source/plugapp/commtest.cxx b/svtools/source/plugapp/commtest.cxx
deleted file mode 100644
index 6dc88e4d9645..000000000000
--- a/svtools/source/plugapp/commtest.cxx
+++ /dev/null
@@ -1,262 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/toolbox.hxx>
-
-
-#include <tools/simplecm.hxx>
-#include "communi.hxx"
-#include "brooker.hxx"
-
-#include "commtest.hrc"
-
-
-
-#define TCP_PORT 17612
-
-#define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) )
-
-
-class PacketSender : public Timer
-{
- SvStream* mpData;
- CommunicationLinkRef mxCL;
-
-public:
- PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL );
- virtual void Timeout();
-};
-
-PacketSender::PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL )
-: mpData( pData )
-, mxCL( pCL )
-{
- SetTimeout( nDelay );
- Start();
-}
-
-void PacketSender::Timeout()
-{
- mxCL->TransferDataStream( mpData );
- delete mpData;
- delete this;
-}
-
-
-
-class DelayedDeleter : public Timer
-{
- CommunicationManager *mpManager;
-
-public:
- DelayedDeleter( ULONG nDelay, CommunicationManager *pManager );
- virtual void Timeout();
-};
-
-DelayedDeleter::DelayedDeleter( ULONG nDelay, CommunicationManager *pManager )
-: mpManager( pManager )
-{
- SetTimeout( nDelay );
- Start();
-}
-
-void DelayedDeleter::Timeout()
-{
- delete mpManager;
- delete this;
-}
-
-
-
-
-class CommunicationTester : public Application
-{
- DECL_LINK( TBClick, ToolBox* );
- DECL_LINK( DataReceived, CommunicationLink* );
- DECL_LINK( ConnectionOpened, CommunicationLink* );
- DECL_LINK( ConnectionClosed, CommunicationLink* );
-
-
- CommunicationManager *pClientTcp, *pServerTcp;
- InformationBroadcaster *pBCSTSend;
- InformationBroadcaster *pBCSTListen;
- InformationBrooker *pBCSTBrooker;
-public:
- CommunicationTester();
-
- virtual void Main();
-};
-
-CommunicationTester IchSelber;
-
-CommunicationTester::CommunicationTester()
-: pClientTcp( NULL )
-, pServerTcp( NULL )
-, pBCSTSend( NULL )
-, pBCSTListen( NULL )
-, pBCSTBrooker( NULL )
-{}
-
-void CommunicationTester::Main()
-{
- ResMgr *pRes = ResMgr::CreateResMgr( "commtest" );
- Resource::SetResManager( pRes );
- WorkWindow aWW( NULL, WB_APP | WB_STDWORK );
- aWW.Show();
- ToolBox aTB( &aWW, ResId( TBMenu ) );
- aTB.Show();
- aTB.RecalcItems();
- aTB.SetFloatingMode( TRUE );
- aTB.SetFloatingMode( FALSE );
- aTB.SetClickHdl( LINK( this, CommunicationTester, TBClick ) );
-
- Execute();
-}
-
-#define SWITCH( pManager, ManagerClass ) \
-{ \
- if ( pManager ) \
- { \
- pManager->StopCommunication(); \
- new DelayedDeleter( 1000, pManager ); \
- pTB->SetItemState( pTB->GetCurItemId(), STATE_NOCHECK ); \
- pManager = NULL; \
- } \
- else \
- { \
- pManager = new ManagerClass; \
- pManager->SetConnectionOpenedHdl( LINK( this, CommunicationTester, ConnectionOpened ) );\
- pManager->SetConnectionClosedHdl( LINK( this, CommunicationTester, ConnectionClosed ) );\
- pManager->SetDataReceivedHdl( LINK( this, CommunicationTester, DataReceived ) );\
- pTB->SetItemState( pTB->GetCurItemId(), STATE_CHECK ); \
- } \
-}
-
-
-IMPL_LINK( CommunicationTester, TBClick, ToolBox*, pTB )
-{
- switch ( pTB->GetCurItemId() )
- {
- case SERVER_TCP:
- {
- SWITCH( pServerTcp, CommunicationManagerServerViaSocket( TCP_PORT, (USHORT) 32000 ) );
- if ( pServerTcp )
- pServerTcp->StartCommunication(); // Am Port horchen
- }
- break;
- case CLIENT_TCP:
- {
- SWITCH( pClientTcp, CommunicationManagerClientViaSocket( "localhost", TCP_PORT ) );
- if ( pClientTcp )
- pClientTcp->StartCommunication(); // Eine Verbindung aufbauen
- }
- break;
- case BCST_BROOKER:
- {
- if ( pBCSTBrooker )
- {
- delete pBCSTBrooker;
- pBCSTBrooker = NULL;
- }
- else
- {
- pBCSTBrooker = new InformationBrooker();
- }
- }
- break;
- case BCST_LISTEN:
- {
- if ( pBCSTListen )
- {
- delete pBCSTListen;
- pBCSTListen = NULL;
- }
- else
- {
- pBCSTListen = new InformationBroadcaster();
- }
- }
- case BCST_SEND:
- {
- if ( pBCSTSend )
- {
- pBCSTSend->Broadcast( BCST_CAT_PL2X, "Message: BCST_CAT_PL2X" );
- pBCSTSend->Broadcast( BCST_CAT_MINORCOPY, "Message: BCST_CAT_MINORCOPY" );
- pBCSTSend->Broadcast( BCST_CAT_DELIVER, "Message: BCST_CAT_DELIVER" );
- pBCSTSend->Broadcast( BCST_CAT_ALL, "Message: BCST_CAT_ALL" );
- }
- else
- {
- pBCSTSend = new InformationBroadcaster();
- }
- }
- break;
- }
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, ConnectionOpened, CommunicationLink*, pCL )
-{
- SvStream *pData = pCL->GetBestCommunicationStream();
- while ( pData->Tell() < 70 ) *pData << 123;
-
- pCL->TransferDataStream( pData );
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, ConnectionClosed, CommunicationLink*, pCL )
-{
- return 0;
-}
-
-IMPL_LINK( CommunicationTester, DataReceived, CommunicationLink*, pCL )
-{
- // Find Manager
- CommunicationManager* pManager;
- if ( pClientTcp && pClientTcp->IsLinkValid( pCL ) )
- {
- pManager = pClientTcp;
- }
- if ( pServerTcp && pServerTcp->IsLinkValid( pCL ) )
- {
- DBG_ASSERT( !pManager, "CommunicationLink bei mehreren Managern eingetragen");
- pManager = pServerTcp;
- }
- DBG_ASSERT( pCL->GetCommunicationManager() == pManager, "Manager des Link != Manager bei dem der Link Valid ist");
-
- // Send Data Back (Echo)
- new PacketSender( 1000, pCL->GetServiceData(), pCL );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/plugapp/commtest.hrc b/svtools/source/plugapp/commtest.hrc
deleted file mode 100644
index f0f646b49bfc..000000000000
--- a/svtools/source/plugapp/commtest.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define TBMenu 256
-
-
-#define SERVER_TCP 1
-#define CLIENT_TCP 2
-#define BCST_BROOKER 3
-#define BCST_LISTEN 4
-#define BCST_SEND 5
diff --git a/svtools/source/plugapp/commtest.src b/svtools/source/plugapp/commtest.src
deleted file mode 100644
index d1efb29a1730..000000000000
--- a/svtools/source/plugapp/commtest.src
+++ /dev/null
@@ -1,59 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "commtest.hrc"
-
-ToolBox TBMenu {
- Border = TRUE;
- SVLook = TRUE;
- Dockable = TRUE;
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 100, 20 );
- LineCount = 2;
- ItemList = {
- ToolBoxItem {
- Identifier = SERVER_TCP;
- Text = "Server TCP";
- };
- ToolBoxItem {
- Identifier = CLIENT_TCP;
- Text = "Client TCP";
- };
- ToolBoxItem {
- Identifier = BCST_BROOKER;
- Text = "BroadcastBrooker";
- };
- ToolBoxItem {
- Identifier = BCST_SEND;
- Text = "BroadcastClientSend";
- };
- ToolBoxItem {
- Identifier = BCST_LISTEN;
- Text = "BroadcastClientListen";
- };
- };
- Scroll = TRUE;
-};
diff --git a/svtools/source/plugapp/makefile.mk b/svtools/source/plugapp/makefile.mk
deleted file mode 100644
index 094da3a0cd83..000000000000
--- a/svtools/source/plugapp/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=plugapp
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(EXCEPTIONSFILES)
-
-EXCEPTIONSFILES = \
- $(SLO)$/ttprops.obj
-
-
-SRS2NAME=$(TARGET)
-SRC2FILES= testtool.src
-
-
-LIB1TARGET= $(SLB)$/plugapp.lib
-LIB1OBJFILES= $(SLOFILES)
-
-######## Testapplikation #########
-
-SRC1FILES= commtest.src
-SRS1NAME= commtest
-
-######## Ende Testapplikation #########
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src
index 55112329dcf5..27f89221e0ba 100644
--- a/svtools/source/plugapp/testtool.src
+++ b/svtools/source/plugapp/testtool.src
@@ -97,6 +97,7 @@ Bitmap TT_SHOW2 {
};
WorkWindow TT_INLINE_TRANSLATION {
+ HelpID = "svtools:WorkWindow:TT_INLINE_TRANSLATION";
SVLook = TRUE;
Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 );
Moveable = TRUE;
@@ -109,6 +110,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Translation";
};
Edit TT_E_NEW {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_NEW";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 16 );
@@ -127,6 +129,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "Comment";
};
Edit TT_E_COMMENT {
+ HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_COMMENT";
Disable = TRUE;
Border = TRUE;
Pos = MAP_APPFONT( 7, 64 );
@@ -135,12 +138,14 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Comment";
};
PushButton TT_PB_SELECT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_SELECT";
Pos = MAP_APPFONT( Control_Border, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
Text[ en-US ] = "~Select";
};
PushButton TT_PB_RESTORE {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_RESTORE";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -148,6 +153,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Restore";
};
PushButton TT_PB_ACCEPT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_ACCEPT";
Disable = TRUE;
Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
@@ -155,6 +161,7 @@ WorkWindow TT_INLINE_TRANSLATION {
Text[ en-US ] = "~Accept";
};
PushButton TT_PB_NEXT {
+ HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_NEXT";
Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 );
Size = MAP_APPFONT( ButtonWidth, 12 );
TabStop = TRUE;
diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx
index fb556cfcebc1..3c6be8fac141 100644
--- a/svtools/source/plugapp/ttprops.cxx
+++ b/svtools/source/plugapp/ttprops.cxx
@@ -35,7 +35,7 @@
TYPEINIT1( TTProperties, ApplicationProperty )
-BOOL TTProperties::RequestProperty( USHORT nRequest )
+sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest )
{
if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 )
{
@@ -44,17 +44,17 @@ BOOL TTProperties::RequestProperty( USHORT nRequest )
GetpApp()->Property( *this );
return nActualPR == 0;
}
- return TRUE;
+ return sal_True;
}
-BOOL TTProperties::GetSlots()
+sal_Bool TTProperties::GetSlots()
{
RequestProperty( TT_PR_SLOTS );
return HasSlots();
}
-USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode )
+sal_uInt16 TTProperties::ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs, sal_uInt16 nMode )
{
mnSID = nSID;
mppArgs = ppArgs;
@@ -64,16 +64,16 @@ USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT
return nActualPR;
}
-BOOL TTProperties::Img( Bitmap *pBmp )
+sal_Bool TTProperties::Img( Bitmap *pBmp )
{
- BOOL bRet;
+ sal_Bool bRet;
mpBmp = pBmp;
bRet = RequestProperty( TT_PR_IMG );
mpBmp = NULL;
return bRet;
}
-SvtResId TTProperties::GetSvtResId( USHORT nId )
+SvtResId TTProperties::GetSvtResId( sal_uInt16 nId )
{
return SvtResId( nId );
}
diff --git a/svtools/source/productregistration/makefile.mk b/svtools/source/productregistration/makefile.mk
deleted file mode 100644
index a26e8feca753..000000000000
--- a/svtools/source/productregistration/makefile.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJNAME=svtools
-TARGET=productregistration.uno
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-GEN_HID=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-DLLPRE=
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/productregistration.obj \
- $(SLO)$/registrationdlg.obj
-
-SHL1TARGET= $(TARGET)
-SHL1IMPLIB= i$(TARGET)
-
-SHL1OBJS= \
- $(SLOFILES)
-
-SHL1STDLIBS=\
- $(TKLIB) \
- $(VCLLIB) \
- $(SVLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-SRS1NAME= productregistration
-SRC1FILES= \
- registrationdlg.src
-
-RESLIB1NAME=productregistration
-RESLIB1IMAGES=$(PRJ)$/res
-RESLIB1SRSFILES=\
- $(SRS)$/productregistration.srs
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx
index 683d06e54985..720cf15a41f3 100644
--- a/svtools/source/productregistration/productregistration.cxx
+++ b/svtools/source/productregistration/productregistration.cxx
@@ -459,25 +459,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * /* pServiceManager */, void * pRegistryKey)
-{
- if (pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
-
- xNewKey = xRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/" PRODREG_IMPLNAME "/UNO/SERVICES" )));
- xNewKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( PRODREG_SERVNAME )));
-
- return sal_True;
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component
new file mode 100644
index 000000000000..da2cfd37c483
--- /dev/null
+++ b/svtools/source/productregistration/productregistration.uno.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.setup.ProductRegistration">
+ <service name="com.sun.star.setup.ProductRegistration"/>
+ </implementation>
+</component>
diff --git a/svtools/source/productregistration/registrationdlg.cxx b/svtools/source/productregistration/registrationdlg.cxx
index 07dcb095535a..f2bc90416313 100644
--- a/svtools/source/productregistration/registrationdlg.cxx
+++ b/svtools/source/productregistration/registrationdlg.cxx
@@ -109,7 +109,7 @@ namespace svt
FreeResource();
- m_aNow.Check( TRUE );
+ m_aNow.Check( sal_True );
}
//--------------------------------------------------------------------
diff --git a/svtools/source/productregistration/registrationdlg.src b/svtools/source/productregistration/registrationdlg.src
index 4021e395b069..01127b44227c 100644
--- a/svtools/source/productregistration/registrationdlg.src
+++ b/svtools/source/productregistration/registrationdlg.src
@@ -66,6 +66,7 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_NOW
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NOW";
Pos = MAP_APPFONT ( 33 , 41 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Register now" ;
@@ -73,18 +74,21 @@ ModalDialog DLG_REGISTRATION_REQUEST
RadioButton RB_LATER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_LATER";
Pos = MAP_APPFONT ( 33 , 54 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Remind me to register later" ;
};
RadioButton RB_NEVER
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NEVER";
Pos = MAP_APPFONT ( 33 , 67 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text [ en-US ] = "Never register" ;
};
RadioButton RB_DONE
{
+ HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_DONE";
Pos = MAP_APPFONT ( 33 , 80 ) ;
Size = MAP_APPFONT ( 153 , 20 ) ;
WordBreak = TRUE;
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
index e1631efc84b9..412140f9a3f5 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -35,8 +35,8 @@
#include <limits.h>
#include <svtools/svparser.hxx>
-#include "htmlkywd.hxx"
-#include "htmltokn.h"
+#include <svtools/htmlkywd.hxx>
+#include <svtools/htmltokn.h>
// die Tabelle muss noch sortiert werden
struct HTML_TokenEntry
@@ -50,7 +50,7 @@ struct HTML_TokenEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortKeyWords = FALSE;
+static int bSortKeyWords = sal_False;
static HTML_TokenEntry aHTMLTokenTab[] = {
{{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0
@@ -245,7 +245,7 @@ int GetHTMLToken( const String& rName )
sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
HTMLKeyCompare );
- bSortKeyWords = TRUE;
+ bSortKeyWords = sal_True;
}
int nRet = 0;
@@ -280,7 +280,7 @@ struct HTML_CharEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortCharKeyWords = FALSE;
+static int bSortCharKeyWords = sal_False;
static HTML_CharEntry aHTMLCharNameTab[] = {
{{OOO_STRING_SVTOOLS_HTML_C_lt}, 60},
@@ -600,7 +600,7 @@ sal_Unicode GetHTMLCharName( const String& rName )
sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ),
sizeof( HTML_CharEntry ),
HTMLCharNameCompare );
- bSortCharKeyWords = TRUE;
+ bSortCharKeyWords = sal_True;
}
sal_Unicode cRet = 0;
@@ -621,7 +621,7 @@ sal_Unicode GetHTMLCharName( const String& rName )
/* */
// Flag: Optionen-Tabelle wurde schon sortiert
-static int bSortOptionKeyWords = FALSE;
+static int bSortOptionKeyWords = sal_False;
static HTML_TokenEntry aHTMLOptionTab[] = {
@@ -833,7 +833,7 @@ int GetHTMLOption( const String& rName )
sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
sizeof( HTML_TokenEntry ),
HTMLKeyCompare );
- bSortOptionKeyWords = TRUE;
+ bSortOptionKeyWords = sal_True;
}
int nRet = HTML_O_UNKNOWN;
@@ -861,10 +861,10 @@ struct HTML_ColorEntry
const sal_Char* sName;
const String *pUName;
};
- ULONG nColor;
+ sal_uLong nColor;
};
-static int bSortColorKeyWords = FALSE;
+static int bSortColorKeyWords = sal_False;
#define HTML_NO_COLOR 0xffffffffUL
@@ -1053,7 +1053,7 @@ static int
}
-ULONG GetHTMLColor( const String& rName )
+sal_uLong GetHTMLColor( const String& rName )
{
if( !bSortColorKeyWords )
{
@@ -1061,10 +1061,10 @@ ULONG GetHTMLColor( const String& rName )
sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ),
sizeof( HTML_ColorEntry ),
HTMLColorNameCompare );
- bSortColorKeyWords = TRUE;
+ bSortColorKeyWords = sal_True;
}
- ULONG nRet = ULONG_MAX;
+ sal_uLong nRet = ULONG_MAX;
void* pFound;
HTML_ColorEntry aSrch;
aSrch.pUName = &rName;
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 29a142e88151..31e60e1ab1a1 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -37,7 +37,7 @@
#include <svl/zforlist.hxx>
#include <svtools/htmlout.hxx>
-#include "htmlkywd.hxx"
+#include <svtools/htmlkywd.hxx>
#include <svtools/imap.hxx>
#include <svtools/imaprect.hxx>
#include <svtools/imapcirc.hxx>
@@ -529,7 +529,7 @@ void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc,
}
SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr,
- BOOL bOn, rtl_TextEncoding )
+ sal_Bool bOn, rtl_TextEncoding )
{
sal_Char sStt[3] = "</";
if( bOn )
@@ -570,7 +570,7 @@ SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream,
return rStream;
}
-SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen,
+SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen,
rtl_TextEncoding )
{ // in einen Stream aus
sal_Char aNToABuf[] = "0000000000000000";
@@ -581,7 +581,7 @@ SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen,
// Pointer an das Bufferende setzen
sal_Char *pStr = aNToABuf + (sizeof(aNToABuf)-1);
- for( BYTE n = 0; n < nLen; ++n )
+ for( sal_uInt8 n = 0; n < nLen; ++n )
{
*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
if( *pStr > '9' )
@@ -616,7 +616,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
const ImageMap& rIMap,
const String& rName,
const HTMLOutEvent *pEventTable,
- BOOL bOutStarBasic,
+ sal_Bool bOutStarBasic,
const sal_Char *pDelim,
const sal_Char *pIndentArea,
const sal_Char *pIndentMap,
@@ -641,7 +641,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
Out_String( rStream, rOutName, eDestEnc, pNonConvertableChars );
rStream << "\">";
- for( USHORT i=0U; i<rIMap.GetIMapObjectCount(); i++ )
+ for( sal_uInt16 i=0U; i<rIMap.GetIMapObjectCount(); i++ )
{
const IMapObject* pObj = rIMap.GetIMapObject( i );
DBG_ASSERT( pObj, "Wo ist das ImageMap-Object?" );
@@ -684,7 +684,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
(const IMapPolygonObject *)pObj;
pShape= OOO_STRING_SVTOOLS_HTML_SH_poly;
Polygon aPoly( pPolyObj->GetPolygon() );
- USHORT nCount = aPoly.GetSize();
+ sal_uInt16 nCount = aPoly.GetSize();
if( nCount>0 )
{
const Point& rPoint = aPoly[0];
@@ -692,7 +692,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
ByteString::CreateFromInt32(rPoint.X())) += ',')
+= ByteString::CreateFromInt32(rPoint.Y());
}
- for( USHORT j=1; j<nCount; j++ )
+ for( sal_uInt16 j=1; j<nCount; j++ )
{
const Point& rPoint = aPoly[j];
(((aCoords += ',')
@@ -772,7 +772,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
rStream << pDelim;
if( pIndentMap )
rStream << pIndentMap;
- Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, FALSE );
+ Out_AsciiTag( rStream, OOO_STRING_SVTOOLS_HTML_map, sal_False );
return rStream;
}
@@ -886,7 +886,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
}
}
- HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, FALSE );
+ HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_script, sal_False );
return rStrm;
}
@@ -895,11 +895,11 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm,
const SvxMacroTableDtor& rMacroTable,
const HTMLOutEvent *pEventTable,
- BOOL bOutStarBasic,
+ sal_Bool bOutStarBasic,
rtl_TextEncoding eDestEnc,
String *pNonConvertableChars )
{
- USHORT i=0;
+ sal_uInt16 i=0;
while( pEventTable[i].pBasicName || pEventTable[i].pJavaName )
{
const SvxMacro *pMacro =
@@ -928,8 +928,8 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm,
}
ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD,
- BOOL bValue,
- double fVal, ULONG nFormat, SvNumberFormatter& rFormatter,
+ sal_Bool bValue,
+ double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter,
rtl_TextEncoding eDestEnc, String* pNonConvertableChars )
{
if ( bValue )
@@ -966,16 +966,16 @@ ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD,
return aStrTD;
}
-BOOL HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
+sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
{
if( rURL.Len() > 14UL &&
rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_private_image, 14UL ) == COMPARE_EQUAL )
{
rURL.Erase( 0UL, 14UL );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index cfb0fca37e11..76f49e7d0558 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -38,8 +38,8 @@
#endif
#include <svtools/parhtml.hxx>
-#include "htmltokn.h"
-#include "htmlkywd.hxx"
+#include <svtools/htmltokn.h>
+#include <svtools/htmlkywd.hxx>
/* */
@@ -57,7 +57,7 @@ static HTMLOptionEnum const aScriptLangOptEnums[] =
{ 0, 0 }
};
-BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL,
+sal_Bool HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL,
HTMLScriptLanguage& rLang,
String& rSrc,
String& rLibrary,
@@ -71,7 +71,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
rLibrary.Erase();
rModule.Erase();
- for( USHORT i = pScriptOptions->Count(); i; )
+ for( sal_uInt16 i = pScriptOptions->Count(); i; )
{
const HTMLOption *pOption = (*pScriptOptions)[ --i ];
switch( pOption->GetToken() )
@@ -79,7 +79,7 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
case HTML_O_LANGUAGE:
{
rLangString = pOption->GetString();
- USHORT nLang;
+ sal_uInt16 nLang;
if( pOption->GetEnum( nLang, aScriptLangOptEnums ) )
rLang = (HTMLScriptLanguage)nLang;
else
@@ -100,10 +100,10 @@ BOOL HTMLParser::ParseScriptOptions( String& rLangString, const String& rBaseURL
}
}
- return TRUE;
+ return sal_True;
}
-void HTMLParser::RemoveSGMLComment( String &rString, BOOL bFull )
+void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull )
{
sal_Unicode c = 0;
while( rString.Len() &&
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index dc3f593c6729..dbaae52db17e 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -49,8 +49,8 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <svtools/parhtml.hxx>
-#include "htmltokn.h"
-#include "htmlkywd.hxx"
+#include <svtools/htmltokn.h>
+#include <svtools/htmlkywd.hxx>
using namespace ::com::sun::star;
@@ -115,9 +115,9 @@ SV_IMPL_PTRARR(HTMLOptions,HTMLOptionPtr)
/* */
-USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) const
+sal_uInt16 HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, sal_uInt16 nDflt ) const
{
- USHORT nValue = nDflt;
+ sal_uInt16 nValue = nDflt;
while( pOptEnums->pName )
if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) )
@@ -131,7 +131,7 @@ USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) cons
return nValue;
}
-BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const
+sal_Bool HTMLOption::GetEnum( sal_uInt16 &rEnum, const HTMLOptionEnum *pOptEnums ) const
{
while( pOptEnums->pName )
{
@@ -148,7 +148,7 @@ BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const
return (pName != 0);
}
-HTMLOption::HTMLOption( USHORT nTok, const String& rToken,
+HTMLOption::HTMLOption( sal_uInt16 nTok, const String& rToken,
const String& rValue )
: aValue(rValue)
, aToken(rToken)
@@ -172,7 +172,7 @@ sal_uInt32 HTMLOption::GetNumber() const
return nTmp >= 0 ? (sal_uInt32)nTmp : 0;
}
-INT32 HTMLOption::GetSNumber() const
+sal_Int32 HTMLOption::GetSNumber() const
{
DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) ||
(nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END),
@@ -191,8 +191,8 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
{
// das ist ein sehr stark vereinfachter Scanner. Er sucht einfach
// alle Tiffern aus dem String
- BOOL bInNum = FALSE;
- ULONG nNum = 0;
+ sal_Bool bInNum = sal_False;
+ sal_uLong nNum = 0;
for( xub_StrLen i=0; i<aValue.Len(); i++ )
{
register sal_Unicode c = aValue.GetChar( i );
@@ -200,12 +200,12 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
{
nNum *= 10;
nNum += (c - '0');
- bInNum = TRUE;
+ bInNum = sal_True;
}
else if( bInNum )
{
rLongs.Insert( nNum, rLongs.Count() );
- bInNum = FALSE;
+ bInNum = sal_False;
nNum = 0;
}
}
@@ -228,7 +228,7 @@ void HTMLOption::GetNumbers( SvULongs &rLongs, sal_Bool bSpaceDelim ) const
nPos++;
if( nPos==aValue.Len() )
- rLongs.Insert( ULONG(0), rLongs.Count() );
+ rLongs.Insert( sal_uLong(0), rLongs.Count() );
else
{
xub_StrLen nEnd = aValue.Search( (sal_Unicode)',', nPos );
@@ -259,7 +259,7 @@ void HTMLOption::GetColor( Color& rColor ) const
String aTmp( aValue );
aTmp.ToUpperAscii();
- ULONG nColor = ULONG_MAX;
+ sal_uLong nColor = ULONG_MAX;
if( '#'!=aTmp.GetChar( 0 ) )
nColor = GetHTMLColor( aTmp );
@@ -289,9 +289,9 @@ void HTMLOption::GetColor( Color& rColor ) const
}
}
- rColor.SetRed( (BYTE)((nColor & 0x00ff0000) >> 16) );
- rColor.SetGreen( (BYTE)((nColor & 0x0000ff00) >> 8));
- rColor.SetBlue( (BYTE)(nColor & 0x000000ff) );
+ rColor.SetRed( (sal_uInt8)((nColor & 0x00ff0000) >> 16) );
+ rColor.SetGreen( (sal_uInt8)((nColor & 0x0000ff00) >> 8));
+ rColor.SetBlue( (sal_uInt8)(nColor & 0x000000ff) );
}
HTMLInputType HTMLOption::GetInputType() const
@@ -321,8 +321,8 @@ HTMLParser::HTMLParser( SvStream& rIn, int bReadNewDoc )
bReadListing = bReadXMP = bReadPRE = bReadTextArea =
bReadScript = bReadStyle =
bEndTokenFound = bIsInBody = bReadNextChar =
- bReadComment = FALSE;
- bIsInHeader = TRUE;
+ bReadComment = sal_False;
+ bIsInHeader = sal_True;
pOptions = new HTMLOptions;
//#i76649, default to UTF-8 for HTML unless we know differently
@@ -343,7 +343,7 @@ SvParserState HTMLParser::CallParser()
SaveState( 0 );
nPre_LinePos = 0;
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
AddRef();
Continue( 0 );
@@ -382,24 +382,24 @@ int HTMLParser::FilterToken( int nToken )
break; // nicht verschicken
case HTML_HEAD_OFF:
- bIsInBody = TRUE;
+ bIsInBody = sal_True;
case HTML_HEAD_ON:
bIsInHeader = HTML_HEAD_ON == nToken;
break;
case HTML_BODY_ON:
case HTML_FRAMESET_ON:
- bIsInHeader = FALSE;
+ bIsInHeader = sal_False;
bIsInBody = HTML_BODY_ON == nToken;
break;
case HTML_BODY_OFF:
- bIsInBody = bReadPRE = bReadListing = bReadXMP = FALSE;
+ bIsInBody = bReadPRE = bReadListing = bReadXMP = sal_False;
break;
case HTML_HTML_OFF:
nToken = 0;
- bReadPRE = bReadListing = bReadXMP = FALSE;
+ bReadPRE = bReadListing = bReadXMP = sal_False;
break; // HTML_ON wurde auch nicht verschickt !
case HTML_PREFORMTXT_ON:
@@ -450,23 +450,23 @@ int HTMLParser::FilterToken( int nToken )
int HTMLParser::ScanText( const sal_Unicode cBreak )
{
::rtl::OUStringBuffer sTmpBuffer( MAX_LEN );
- int bWeiter = TRUE;
- int bEqSignFound = FALSE;
+ int bWeiter = sal_True;
+ int bEqSignFound = sal_False;
sal_Unicode cQuote = 0U;
while( bWeiter && IsParserWorking() )
{
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '&':
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( bReadXMP )
sTmpBuffer.append( (sal_Unicode)'&' );
else
{
- ULONG nStreamPos = rInput.Tell();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLinePos = GetLinePos();
sal_Unicode cChar = 0U;
if( '#' == (nNextCh = GetNextChar()) )
@@ -544,7 +544,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( 0U == cChar && ';' != nNextCh )
{
DBG_ASSERT( rInput.Tell() - nStreamPos ==
- (ULONG)(nPos+1L)*GetCharSize(),
+ (sal_uLong)(nPos+1L)*GetCharSize(),
"UTF-8 geht hier schief" );
for( xub_StrLen i=nPos-1L; i>1L; i-- )
{
@@ -574,10 +574,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
// nlLinePos -= nPos;
DBG_ASSERT( rInput.Tell()-nStreamPos ==
- (ULONG)(nPos+1)*GetCharSize(),
+ (sal_uLong)(nPos+1)*GetCharSize(),
"Falsche Stream-Position" );
DBG_ASSERT( nlLinePos-nLinePos ==
- (ULONG)(nPos+1),
+ (sal_uLong)(nPos+1),
"Falsche Zeilen-Position" );
rInput.Seek( nStreamPos );
nlLinePos = nLinePos;
@@ -619,10 +619,10 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
// nlLinePos -= nPos;
DBG_ASSERT( rInput.Tell()-nStreamPos ==
- (ULONG)(nPos+1)*GetCharSize(),
+ (sal_uLong)(nPos+1)*GetCharSize(),
"Falsche Stream-Position" );
DBG_ASSERT( nlLinePos-nLinePos ==
- (ULONG)(nPos+1),
+ (sal_uLong)(nPos+1),
"Falsche Zeilen-Position" );
rInput.Seek( nStreamPos );
nlLinePos = nLinePos;
@@ -654,7 +654,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
else if( IsParserWorking() )
{
sTmpBuffer.append( (sal_Unicode)'&' );
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
@@ -691,15 +691,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
rInput.Seek( nStreamPos-(sal_uInt32)GetCharSize() );
nlLinePos = nLinePos-1;
ClearTxtConvContext();
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
}
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
break;
case '=':
if( '>'==cBreak && !cQuote )
- bEqSignFound = TRUE;
+ bEqSignFound = sal_True;
sTmpBuffer.append( nNextCh );
break;
@@ -724,7 +724,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
cQuote = 0U;
}
sTmpBuffer.append( nNextCh );
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
break;
case sal_Unicode(EOF):
@@ -734,7 +734,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
// abc&auml;<EOF> nicht angezeigt, also lassen wir das in Zukunft.
// if( '>' != cBreak )
// eState = SVPAR_ACCEPTED;
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
else
{
@@ -743,11 +743,11 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
break;
case '<':
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( '>'==cBreak )
sTmpBuffer.append( nNextCh );
else
- bWeiter = FALSE; // Abbrechen, String zusammen
+ bWeiter = sal_False; // Abbrechen, String zusammen
break;
case '\f':
@@ -759,7 +759,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
else
{
// sonst wird es ein eigenes Token
- bWeiter = FALSE;
+ bWeiter = sal_False;
}
break;
@@ -773,7 +773,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
}
else if( bReadListing || bReadXMP || bReadPRE || bReadTextArea )
{
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
}
// Bug 18984: CR-LF -> Blank
@@ -783,7 +783,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( '\t'==nNextCh && bReadPRE && '>'!=cBreak )
{
// In <PRE>: Tabs nach oben durchreichen
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
}
// kein break
@@ -820,15 +820,15 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
} while ( ' ' == nNextCh || '\t' == nNextCh ||
'\r' == nNextCh || '\n' == nNextCh ||
'\x0b' == nNextCh );
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
break;
default:
- bEqSignFound = FALSE;
+ bEqSignFound = sal_False;
if( (nNextCh==cBreak && !cQuote) ||
- (ULONG(aToken.Len()) + MAX_LEN) > ULONG(STRING_MAXLEN & ~1 ))
- bWeiter = FALSE;
+ (sal_uLong(aToken.Len()) + MAX_LEN) > sal_uLong(STRING_MAXLEN & ~1 ))
+ bWeiter = sal_False;
else
{
do {
@@ -837,8 +837,8 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( MAX_LEN == sTmpBuffer.getLength() )
{
aToken += String(sTmpBuffer.makeStringAndClear());
- if( (ULONG(aToken.Len()) + MAX_LEN) >
- ULONG(STRING_MAXLEN & ~1 ) )
+ if( (sal_uLong(aToken.Len()) + MAX_LEN) >
+ sal_uLong(STRING_MAXLEN & ~1 ) )
{
nNextCh = GetNextChar();
return HTML_TEXTTOKEN;
@@ -853,7 +853,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
return HTML_TEXTTOKEN;
}
} while( HTML_ISALPHA( nNextCh ) || HTML_ISDIGIT( nNextCh ) );
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
@@ -878,21 +878,21 @@ int HTMLParser::_GetNextRawToken()
{
// beim letzten Aufruf haben wir das End-Token bereits gefunden,
// deshalb muessen wir es nicht noch einmal suchen
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
- bEndTokenFound = FALSE;
+ bEndTokenFound = sal_False;
return 0;
}
// per default geben wir HTML_RAWDATA zurueck
- int bWeiter = TRUE;
+ int bWeiter = sal_True;
int nToken = HTML_RAWDATA;
SaveState( 0 );
while( bWeiter && IsParserWorking() )
{
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '<':
@@ -903,15 +903,15 @@ int HTMLParser::_GetNextRawToken()
aToken += String(sTmpBuffer.makeStringAndClear());
// und die Position im Stream merken
- ULONG nStreamPos = rInput.Tell();
- ULONG nLineNr = GetLineNr();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLineNr = GetLineNr();
+ sal_uLong nLinePos = GetLinePos();
// Start eines End-Token?
- int bOffState = FALSE;
+ int bOffState = sal_False;
if( '/' == (nNextCh = GetNextChar()) )
{
- bOffState = TRUE;
+ bOffState = sal_True;
nNextCh = GetNextChar();
}
else if( '!' == nNextCh )
@@ -932,7 +932,7 @@ int HTMLParser::_GetNextRawToken()
sal::static_int_cast< xub_StrLen >(
sTmpBuffer.getLength()) );
aTok.ToUpperAscii();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if( bReadScript || aEndToken.Len() )
{
if( !bReadComment )
@@ -940,7 +940,7 @@ int HTMLParser::_GetNextRawToken()
if( aTok.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3 )
== COMPARE_EQUAL )
{
- bReadComment = TRUE;
+ bReadComment = sal_True;
}
else
{
@@ -957,7 +957,7 @@ int HTMLParser::_GetNextRawToken()
aTok.Copy( aTok.Len()-2 ).EqualsAscii( "--" ) )
{
// hier ist ein Kommentar der Art <!-----> zuende
- bReadComment = FALSE;
+ bReadComment = sal_False;
}
}
else
@@ -980,15 +980,15 @@ int HTMLParser::_GetNextRawToken()
// bisher gelesenen String zurueckgeben und dnach normal
// weitermachen
- bWeiter = FALSE;
+ bWeiter = sal_False;
// nToken==0 heisst, dass _GetNextToken gleich weiterliest
if( !aToken.Len() && (bReadStyle || bReadScript) )
{
// wir koennen sofort die Umgebung beeden und
// das End-Token parsen
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
nToken = 0;
}
@@ -997,7 +997,7 @@ int HTMLParser::_GetNextRawToken()
// wir muessen bReadScript/bReadStyle noch am
// Leben lassen und koennen erst beim naechsten
// mal das End-Token Parsen
- bEndTokenFound = TRUE;
+ bEndTokenFound = sal_True;
}
// jetzt fahren wir im Stream auf das '<' zurueck
@@ -1017,7 +1017,7 @@ int HTMLParser::_GetNextRawToken()
if( bOffState )
aToken += (sal_Unicode)'/';
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
}
break;
@@ -1025,11 +1025,11 @@ int HTMLParser::_GetNextRawToken()
sTmpBuffer.append( nNextCh );
if( bReadComment )
{
- BOOL bTwoMinus = FALSE;
+ sal_Bool bTwoMinus = sal_False;
nNextCh = GetNextChar();
while( '-' == nNextCh && IsParserWorking() )
{
- bTwoMinus = TRUE;
+ bTwoMinus = sal_True;
if( MAX_LEN == sTmpBuffer.getLength() )
aToken += String(sTmpBuffer.makeStringAndClear());
@@ -1038,9 +1038,9 @@ int HTMLParser::_GetNextRawToken()
}
if( '>' == nNextCh && IsParserWorking() && bTwoMinus )
- bReadComment = FALSE;
+ bReadComment = sal_False;
- bNextCh = FALSE;
+ bNextCh = sal_False;
}
break;
@@ -1049,27 +1049,27 @@ int HTMLParser::_GetNextRawToken()
nNextCh = GetNextChar();
if( nNextCh=='\n' )
nNextCh = GetNextChar();
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
case '\n':
// \n beendet das aktuelle Text-Token (auch wenn es leer ist)
nNextCh = GetNextChar();
- bWeiter = FALSE;
+ bWeiter = sal_False;
break;
case sal_Unicode(EOF):
// eof beendet das aktuelle Text-Token und tut so, als ob
// ein End-Token gelesen wurde
if( rInput.IsEof() )
{
- bWeiter = FALSE;
+ bWeiter = sal_False;
if( aToken.Len() || sTmpBuffer.getLength() )
{
- bEndTokenFound = TRUE;
+ bEndTokenFound = sal_True;
}
else
{
- bReadScript = FALSE;
- bReadStyle = FALSE;
+ bReadScript = sal_False;
+ bReadStyle = sal_False;
aEndToken.Erase();
nToken = 0;
}
@@ -1111,7 +1111,7 @@ int HTMLParser::_GetNextToken()
if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
return 0;
- BOOL bReadNextCharSave = bReadNextChar;
+ sal_Bool bReadNextCharSave = bReadNextChar;
if( bReadNextChar )
{
DBG_ASSERT( !bEndTokenFound,
@@ -1119,7 +1119,7 @@ int HTMLParser::_GetNextToken()
nNextCh = GetNextChar();
if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
return 0;
- bReadNextChar = FALSE;
+ bReadNextChar = sal_False;
}
if( bReadScript || bReadStyle || aEndToken.Len() )
@@ -1130,19 +1130,19 @@ int HTMLParser::_GetNextToken()
}
do {
- int bNextCh = TRUE;
+ int bNextCh = sal_True;
switch( nNextCh )
{
case '<':
{
- ULONG nStreamPos = rInput.Tell();
- ULONG nLineNr = GetLineNr();
- ULONG nLinePos = GetLinePos();
+ sal_uLong nStreamPos = rInput.Tell();
+ sal_uLong nLineNr = GetLineNr();
+ sal_uLong nLinePos = GetLinePos();
- int bOffState = FALSE;
+ int bOffState = sal_False;
if( '/' == (nNextCh = GetNextChar()) )
{
- bOffState = TRUE;
+ bOffState = sal_True;
nNextCh = GetNextChar();
}
if( HTML_ISALPHA( nNextCh ) || '!'==nNextCh ) // fix #26984#
@@ -1202,12 +1202,12 @@ int HTMLParser::_GetNextToken()
aToken = sSaveToken;
if( '>'!=nNextCh )
aToken += (sal_Unicode)' ';
- ULONG nCStreamPos = 0;
- ULONG nCLineNr = 0;
- ULONG nCLinePos = 0;
+ sal_uLong nCStreamPos = 0;
+ sal_uLong nCLineNr = 0;
+ sal_uLong nCLinePos = 0;
xub_StrLen nCStrLen = 0;
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// bis zum schliessenden --> lesen. wenn keins gefunden
// wurde beim der ersten > wieder aufsetzen
while( !bDone && !rInput.IsEof() && IsParserWorking() )
@@ -1264,7 +1264,7 @@ int HTMLParser::_GetNextToken()
aToken = '<';
nRet = HTML_TEXTTOKEN;
nNextCh = GetNextChar();
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
}
@@ -1289,7 +1289,7 @@ int HTMLParser::_GetNextToken()
aToken = '<';
nRet = HTML_TEXTTOKEN;
nNextCh = GetNextChar();
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
if( SVPAR_PENDING == eState )
@@ -1300,10 +1300,10 @@ int HTMLParser::_GetNextToken()
{
nRet = HTML_UNKNOWNCONTROL_ON;
- ULONG nCStreamPos = rInput.Tell();
- ULONG nCLineNr = GetLineNr(), nCLinePos = GetLinePos();
+ sal_uLong nCStreamPos = rInput.Tell();
+ sal_uLong nCLineNr = GetLineNr(), nCLinePos = GetLinePos();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// bis zum schliessenden %> lesen. wenn keins gefunden
// wurde beim der ersten > wieder aufsetzen
while( !bDone && !rInput.IsEof() && IsParserWorking() )
@@ -1336,7 +1336,7 @@ int HTMLParser::_GetNextToken()
{
aToken = '<';
nRet = HTML_TEXTTOKEN;
- bNextCh = FALSE;
+ bNextCh = sal_False;
break;
}
}
@@ -1347,32 +1347,32 @@ int HTMLParser::_GetNextToken()
switch( nRet )
{
case HTML_TEXTAREA_ON:
- bReadTextArea = TRUE;
+ bReadTextArea = sal_True;
break;
case HTML_TEXTAREA_OFF:
- bReadTextArea = FALSE;
+ bReadTextArea = sal_False;
break;
case HTML_SCRIPT_ON:
if( !bReadTextArea )
- bReadScript = TRUE;
+ bReadScript = sal_True;
break;
case HTML_SCRIPT_OFF:
if( !bReadTextArea )
{
- bReadScript = FALSE;
+ bReadScript = sal_False;
// JavaScript kann den Stream veraendern
// also muss das letzte Zeichen nochmals
// gelesen werden
- bReadNextChar = TRUE;
- bNextCh = FALSE;
+ bReadNextChar = sal_True;
+ bNextCh = sal_False;
}
break;
case HTML_STYLE_ON:
- bReadStyle = TRUE;
+ bReadStyle = sal_True;
break;
case HTML_STYLE_OFF:
- bReadStyle = FALSE;
+ bReadStyle = sal_False;
break;
}
@@ -1406,7 +1406,7 @@ int HTMLParser::_GetNextToken()
if( ( '\n' != nNextCh || '\r' != c ) &&
( '\r' != nNextCh || '\n' != c ) )
{
- bNextCh = FALSE;
+ bNextCh = sal_False;
nNextCh = c;
}
nRet = HTML_NEWPARA;
@@ -1433,7 +1433,7 @@ scan_text:
if( !bNextCh && eState == SVPAR_PENDING )
{
eState = SVPAR_WORKING;
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
}
break;
@@ -1444,7 +1444,7 @@ scan_text:
nNextCh = GetNextChar();
if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet )
{
- bReadNextChar = TRUE;
+ bReadNextChar = sal_True;
eState = SVPAR_WORKING;
}
}
@@ -1461,15 +1461,15 @@ void HTMLParser::UnescapeToken()
{
xub_StrLen nPos=0;
- BOOL bEscape = FALSE;
+ sal_Bool bEscape = sal_False;
while( nPos < aToken.Len() )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
if( '\\'==aToken.GetChar(nPos) && !bOldEscape )
{
aToken.Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
else
{
@@ -1479,7 +1479,7 @@ void HTMLParser::UnescapeToken()
}
// hole die Optionen
-const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
+const HTMLOptions *HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) const
{
// wenn die Option fuer das aktuelle Token schon einmal
// geholt wurden, geben wir sie noch einmal zurueck
@@ -1517,7 +1517,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
nToken = GetHTMLOption( sNameUpperCase ); // der Name ist fertig
DBG_ASSERTWARNING( nToken!=HTML_O_UNKNOWN,
"GetOption: unbekannte HTML-Option" );
- BOOL bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START ||
+ sal_Bool bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START ||
nToken >= HTML_OPTION_SCRIPT_END) &&
(!pNoConvertToken || nToken != *pNoConvertToken);
@@ -1544,12 +1544,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
{
sal_Unicode cEnd = cChar;
nPos++; nStt++;
- BOOL bDone = FALSE;
- BOOL bEscape = FALSE;
+ sal_Bool bDone = sal_False;
+ sal_Bool bEscape = sal_False;
while( nPos < aToken.Len() && !bDone )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
cChar = aToken.GetChar(nPos);
switch( cChar )
{
@@ -1568,7 +1568,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
else
{
((String &)aToken).Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
break;
case '"':
@@ -1589,12 +1589,12 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
{
// hier sind wir etwas laxer als der
// Standard und erlauben alles druckbare
- BOOL bEscape = FALSE;
- BOOL bDone = FALSE;
+ sal_Bool bEscape = sal_False;
+ sal_Bool bDone = sal_False;
while( nPos < aToken.Len() && !bDone )
{
- BOOL bOldEscape = bEscape;
- bEscape = FALSE;
+ sal_Bool bOldEscape = bEscape;
+ bEscape = sal_False;
sal_Unicode c = aToken.GetChar(nPos);
switch( c )
{
@@ -1607,7 +1607,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
case '\t':
case '\r':
case '\n':
- bDone = TRUE;
+ bDone = sal_True;
break;
case '\\':
@@ -1618,7 +1618,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
else
{
((String &)aToken).Erase( nPos, 1 );
- bEscape = TRUE;
+ bEscape = sal_True;
}
break;
@@ -1626,7 +1626,7 @@ const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
if( HTML_ISPRINTABLE( c ) )
nPos++, nLen++;
else
- bDone = TRUE;
+ bDone = sal_True;
break;
}
}
@@ -1831,7 +1831,7 @@ int HTMLParser::FilterPRE( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
@@ -1872,7 +1872,7 @@ int HTMLParser::FilterXMP( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
@@ -1900,13 +1900,13 @@ int HTMLParser::FilterListing( int nToken )
break;
}
- bPre_IgnoreNewPara = FALSE;
+ bPre_IgnoreNewPara = sal_False;
return nToken;
}
bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
- BOOL bSwitchToUCS2,
+ sal_Bool bSwitchToUCS2,
rtl_TextEncoding eEnc )
{
// Einer der folgenden regulaeren Ausdrucke muss sich auf den String
@@ -1920,14 +1920,14 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// ensprechen muss
ByteString sCmp;
- BOOL bUCS2B = FALSE;
+ sal_Bool bUCS2B = sal_False;
if( bSwitchToUCS2 )
{
if( 0xfeU == (sal_uChar)pHeader[0] &&
0xffU == (sal_uChar)pHeader[1] )
{
eEnc = RTL_TEXTENCODING_UCS2;
- bUCS2B = TRUE;
+ bUCS2B = sal_True;
}
else if( 0xffU == (sal_uChar)pHeader[0] &&
0xfeU == (sal_uChar)pHeader[1] )
@@ -1945,7 +1945,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
)
{
if( 0xfe == (sal_uChar)pHeader[0] )
- bUCS2B = TRUE;
+ bUCS2B = sal_True;
xub_StrLen nLen;
for( nLen = 2;
@@ -1978,7 +1978,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// Ein HTML-Dokument muss in der ersten Zeile ein '<' besitzen
xub_StrLen nStart = sCmp.Search( '<' );
if( STRING_NOTFOUND == nStart )
- return FALSE;
+ return sal_False;
nStart++;
// danach duerfen beliebige andere Zeichen bis zu einem blank oder
@@ -1993,7 +1993,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
// wenn das Dokeument hinter dem < aufhoert ist es wohl kein HTML
if( nPos==nStart )
- return FALSE;
+ return sal_False;
// die Zeichenkette nach dem '<' muss ausserdem ein bekanntes
// HTML Token sein. Damit die Ausgabe eines DOS-dir-Befehls nicht
@@ -2002,30 +2002,30 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US );
int nTok = GetHTMLToken( sTest );
if( 0 != nTok && HTML_DIRLIST_ON != nTok )
- return TRUE;
+ return sal_True;
// oder es handelt sich um ein "<!" ganz am Anfang der Datei (fix #27092#)
if( nStart == 1 && '!' == sCmp.GetChar( 1 ) )
- return TRUE;
+ return sal_True;
// oder wir finden irgendwo ein <HTML> in den ersten 80 Zeichen
nStart = sCmp.Search( OOO_STRING_SVTOOLS_HTML_html );
if( nStart!=STRING_NOTFOUND &&
nStart>0 && '<'==sCmp.GetChar(nStart-1) &&
nStart+4 < sCmp.Len() && '>'==sCmp.GetChar(nStart+4) )
- return TRUE;
+ return sal_True;
// sonst ist es wohl doch eher kein HTML-Dokument
- return FALSE;
+ return sal_False;
}
-BOOL HTMLParser::InternalImgToPrivateURL( String& rURL )
+sal_Bool HTMLParser::InternalImgToPrivateURL( String& rURL )
{
if( rURL.Len() < 19 || 'i' != rURL.GetChar(0) ||
rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher, 9 ) != COMPARE_EQUAL )
- return FALSE;
+ return sal_False;
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
if( rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_internal_gopher,16) == COMPARE_EQUAL )
{
@@ -2133,10 +2133,10 @@ bool HTMLParser::ParseMetaOptionsImpl(
rtl_TextEncoding& o_rEnc )
{
String aName, aContent;
- USHORT nAction = HTML_META_NONE;
+ sal_uInt16 nAction = HTML_META_NONE;
bool bHTTPEquiv = false, bChanged = false;
- for ( USHORT i = i_pOptions->Count(); i; )
+ for ( sal_uInt16 i = i_pOptions->Count(); i; )
{
const HTMLOption *pOption = (*i_pOptions)[ --i ];
switch ( pOption->GetToken() )
@@ -2222,8 +2222,8 @@ bool HTMLParser::ParseMetaOptionsImpl(
if ( i_xDocProps.is() && aContent.Len() &&
aContent.GetTokenCount() == 2 )
{
- Date aDate( (ULONG)aContent.GetToken(0).ToInt32() );
- Time aTime( (ULONG)aContent.GetToken(1).ToInt32() );
+ Date aDate( (sal_uLong)aContent.GetToken(0).ToInt32() );
+ Time aTime( (sal_uLong)aContent.GetToken(1).ToInt32() );
DateTime aDateTime( aDate, aTime );
::util::DateTime uDT(aDateTime.Get100Sec(),
aDateTime.GetSec(), aDateTime.GetMin(),
@@ -2279,7 +2279,7 @@ bool HTMLParser::ParseMetaOptions(
const uno::Reference<document::XDocumentProperties> & i_xDocProps,
SvKeyValueIterator *i_pHeader )
{
- USHORT nContentOption = HTML_O_CONTENT;
+ sal_uInt16 nContentOption = HTML_O_CONTENT;
rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
bool bRet = ParseMetaOptionsImpl( i_xDocProps, i_pHeader,
@@ -2287,7 +2287,7 @@ bool HTMLParser::ParseMetaOptions(
eEnc );
// If the encoding is set by a META tag, it may only overwrite the
- // current encoding if both, the current and the new encoding, are 1-BYTE
+ // current encoding if both, the current and the new encoding, are 1-sal_uInt8
// encodings. Everything else cannot lead to reasonable results.
if (RTL_TEXTENCODING_DONTKNOW != eEnc &&
rtl_isOctetTextEncoding( eEnc ) &&
@@ -2326,7 +2326,7 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH
if( pHTTPHeader )
{
SvKeyValue aKV;
- for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont;
+ for( sal_Bool bCont = pHTTPHeader->GetFirst( aKV ); bCont;
bCont = pHTTPHeader->GetNext( aKV ) )
{
if( aKV.GetKey().EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) )
@@ -2341,15 +2341,15 @@ rtl_TextEncoding HTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPH
return eRet;
}
-BOOL HTMLParser::SetEncodingByHTTPHeader(
+sal_Bool HTMLParser::SetEncodingByHTTPHeader(
SvKeyValueIterator *pHTTPHeader )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rtl_TextEncoding eEnc = HTMLParser::GetEncodingByHttpHeader( pHTTPHeader );
if(RTL_TEXTENCODING_DONTKNOW != eEnc)
{
SetSrcEncoding( eEnc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk
deleted file mode 100644
index 5ebb0e28c69e..000000000000
--- a/svtools/source/svrtf/makefile.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=svrtf
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/svparser.obj \
- $(SLO)$/parrtf.obj \
- $(SLO)$/rtfout.obj \
- $(SLO)$/rtfkeywd.obj
-
-# ==========================================================================
-
-.INCLUDE : target.mk
-
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 8ddcdb70a37b..a475343dcaac 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -33,8 +33,8 @@
#include <rtl/tencinfo.h>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
-#include "rtftoken.h"
-#include "rtfkeywd.hxx"
+#include <svtools/rtftoken.h>
+#include <svtools/rtfkeywd.hxx>
#include <svtools/parrtf.hxx>
const int MAX_STRING_LEN = 1024;
@@ -43,9 +43,7 @@ const int MAX_TOKEN_LEN = 128;
#define RTF_ISDIGIT( c ) (c >= '0' && c <= '9')
#define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
-SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl )
-
-SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize )
+SvRTFParser::SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize )
: SvParser( rIn, nStackSize ),
eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet
nUCharOverread( 1 )
@@ -171,17 +169,16 @@ int SvRTFParser::_GetNextToken()
case RTF_UC:
if( 0 <= nTokenValue )
{
- nUCharOverread = (BYTE)nTokenValue;
+ nUCharOverread = (sal_uInt8)nTokenValue;
#if 1
//cmc: other ifdef breaks #i3584
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#else
if( !nUCharOverread )
- nUCharOverread = aParserStates[
- aParserStates.Count()-1].nUCharOverread;
+ nUCharOverread = aParserStates.top().nUCharOverread;
else
- aParserStates[ aParserStates.Count()-1].
+ aParserStates.top().
nUCharOverread = nUCharOverread;
#endif
}
@@ -210,7 +207,7 @@ int SvRTFParser::_GetNextToken()
// overread the next n "RTF" characters. This
// can be also \{, \}, \'88
- for( BYTE m = 0; m < nUCharOverread; ++m )
+ for( sal_uInt8 m = 0; m < nUCharOverread; ++m )
{
sal_Unicode cAnsi = nNextCh;
while( 0xD == cAnsi )
@@ -251,12 +248,12 @@ int SvRTFParser::_GetNextToken()
if( 0 <= nOpenBrakets )
{
RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() );
- aParserStates.Insert(
- aState, sal::static_int_cast< USHORT >(nOpenBrakets) );
+ aParserStates.push( aState );
}
++nOpenBrakets;
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
}
break;
@@ -265,12 +262,11 @@ int SvRTFParser::_GetNextToken()
--nOpenBrakets;
if( 0 <= nOpenBrakets )
{
- aParserStates.Remove(
- sal::static_int_cast< USHORT >(nOpenBrakets) );
- if( aParserStates.Count() )
+ aParserStates.pop();
+ if( !aParserStates.empty() )
{
const RtfParserState_Impl& rRPS =
- aParserStates[ aParserStates.Count() - 1 ];
+ aParserStates.top();
nUCharOverread = rRPS.nUCharOverread;
SetSrcEncoding( rRPS.eCodeSet );
}
@@ -280,8 +276,9 @@ int SvRTFParser::_GetNextToken()
SetSrcEncoding( GetCodeSet() );
}
}
- DBG_ASSERT( nOpenBrakets == aParserStates.Count(),
- "ParserStateStack unequal to bracket count" );
+ DBG_ASSERT(
+ static_cast<size_t>(nOpenBrakets) == aParserStates.size(),
+ "ParserStateStack unequal to bracket count" );
nRet = nNextCh;
break;
@@ -432,7 +429,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak )
// overread the next n "RTF" characters. This
// can be also \{, \}, \'88
- for( BYTE m = 0; m < nUCharOverread; ++m )
+ for( sal_uInt8 m = 0; m < nUCharOverread; ++m )
{
sal_Unicode cAnsi = nNextCh;
while( 0xD == cAnsi )
@@ -682,8 +679,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
if (eEnc == RTL_TEXTENCODING_DONTKNOW)
eEnc = GetCodeSet();
- if (aParserStates.Count())
- aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc;
+ if (!aParserStates.empty())
+ aParserStates.top().eCodeSet = eEnc;
SetSrcEncoding(eEnc);
}
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
deleted file mode 100644
index e2e2bef0f721..000000000000
--- a/svtools/source/svrtf/rtfkey2.cxx
+++ /dev/null
@@ -1,1159 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include "rtfkeywd.hxx"
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEXCHAR, "\\'" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IGNORE, "\\*" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OPTHYPH, "\\-" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBENTRY, "\\:" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSH, "\\absh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSW, "\\absw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALT, "\\alt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTATION, "\\annotation" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANSI, "\\ansi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNID, "\\atnid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUTHOR, "\\author" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_B, "\\b" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGBDIAG, "\\bgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGCROSS, "\\bgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDCROSS, "\\bgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKBDIAG, "\\bgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKCROSS, "\\bgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKDCROSS, "\\bgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKFDIAG, "\\bgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKHORIZ, "\\bgdkhoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGDKVERT, "\\bgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGFDIAG, "\\bgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGHORIZ, "\\bghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BGVERT, "\\bgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BIN, "\\bin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BINFSXN, "\\binfsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BINSXN, "\\binsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLF, "\\bkmkcolf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLL, "\\bkmkcoll" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKEND, "\\bkmkend" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKSTART, "\\bkmkstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLUE, "\\blue" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BOX, "\\box" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRB, "\\brdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBAR, "\\brdrbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBTW, "\\brdrbtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRCF, "\\brdrcf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDB, "\\brdrdb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDOT, "\\brdrdot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRHAIR, "\\brdrhair" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRL, "\\brdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRR, "\\brdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRS, "\\brdrs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRSH, "\\brdrsh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRT, "\\brdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTH, "\\brdrth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRW, "\\brdrw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRSP, "\\brsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BULLET, "\\bullet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BUPTIM, "\\buptim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BXE, "\\bxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CAPS, "\\caps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CB, "\\cb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CBPAT, "\\cbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CELL, "\\cell" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CELLX, "\\cellx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CF, "\\cf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CFPAT, "\\cfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHATN, "\\chatn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDATE, "\\chdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDPA, "\\chdpa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHDPL, "\\chdpl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTN, "\\chftn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEP, "\\chftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEPC, "\\chftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHPGN, "\\chpgn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHTIME, "\\chtime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGBDIAG, "\\clbgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGCROSS, "\\clbgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDCROSS, "\\clbgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKBDIAG, "\\clbgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKCROSS, "\\clbgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKDCROSS, "\\clbgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKFDIAG, "\\clbgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKHOR, "\\clbgdkhor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKVERT, "\\clbgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGFDIAG, "\\clbgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGHORIZ, "\\clbghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBGVERT, "\\clbgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRB, "\\clbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRL, "\\clbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRR, "\\clbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRT, "\\clbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLCBPAT, "\\clcbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLCFPAT, "\\clcfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLMGF, "\\clmgf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLMRG, "\\clmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLSHDNG, "\\clshdng" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLNO, "\\colno" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLORTBL, "\\colortbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLS, "\\cols" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLSR, "\\colsr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLSX, "\\colsx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLUMN, "\\column" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COLW, "\\colw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COMMENT, "\\comment" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CREATIM, "\\creatim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CTRL, "\\ctrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFF, "\\deff" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFFORMAT, "\\defformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANG, "\\deflang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFTAB, "\\deftab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DELETED, "\\deleted" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTX, "\\dfrmtxtx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTY, "\\dfrmtxty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DIBITMAP, "\\dibitmap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DN, "\\dn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCCOMM, "\\doccomm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCTEMP, "\\doctemp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPLI, "\\dropcapli" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPT, "\\dropcapt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSNOOVRLP, "\\absnoovrlp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DXFRTEXT, "\\dxfrtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DY, "\\dy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EDMINS, "\\edmins" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMDASH, "\\emdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDASH, "\\endash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDDOC, "\\enddoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDNHERE, "\\endnhere" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENDNOTES, "\\endnotes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPND, "\\expnd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPNDTW, "\\expndtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_F, "\\f" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACINGP, "\\facingp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACPGSXN, "\\facpgsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FALT, "\\falt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FCHARSET, "\\fcharset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FDECOR, "\\fdecor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FI, "\\fi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FIELD, "\\field" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDDIRTY, "\\flddirty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDEDIT, "\\fldedit" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDINST, "\\fldinst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDLOCK, "\\fldlock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDPRIV, "\\fldpriv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDRSLT, "\\fldrslt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FMODERN, "\\fmodern" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FN, "\\fn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNIL, "\\fnil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTTBL, "\\fonttbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTER, "\\footer" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERF, "\\footerf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERL, "\\footerl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERR, "\\footerr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERY, "\\footery" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTNOTE, "\\footnote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FPRQ, "\\fprq" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRACWIDTH, "\\fracwidth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FROMAN, "\\froman" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FS, "\\fs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FSCRIPT, "\\fscript" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FSWISS, "\\fswiss" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTECH, "\\ftech" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNBJ, "\\ftnbj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNCN, "\\ftncn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRESTART, "\\ftnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEP, "\\ftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEPC, "\\ftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNSTART, "\\ftnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNTJ, "\\ftntj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GREEN, "\\green" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GUTTER, "\\gutter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GUTTERSXN, "\\guttersxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADER, "\\header" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERF, "\\headerf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERL, "\\headerl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERR, "\\headerr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERY, "\\headery" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HR, "\\hr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHHOTZ, "\\hyphhotz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_I, "\\i" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ID, "\\id" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_INFO, "\\info" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_INTBL, "\\intbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IXE, "\\ixe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEEP, "\\keep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEEPN, "\\keepn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KERNING, "\\kerning" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEYCODE, "\\keycode" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_KEYWORDS, "\\keywords" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANDSCAPE, "\\landscape" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANG, "\\lang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LDBLQUOTE, "\\ldblquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVEL, "\\level" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LI, "\\li" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LIN, "\\lin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINE, "\\line" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEBETCOL, "\\linebetcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINECONT, "\\linecont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEMOD, "\\linemod" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEPPAGE, "\\lineppage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINERESTART, "\\linerestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINESTART, "\\linestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINESTARTS, "\\linestarts" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINEX, "\\linex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LNDSCPSXN, "\\lndscpsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LQUOTE, "\\lquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MAC, "\\mac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MACPICT, "\\macpict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MAKEBACKUP, "\\makebackup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGB, "\\margb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGBSXN, "\\margbsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGL, "\\margl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGLSXN, "\\marglsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGMIRROR, "\\margmirror" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGR, "\\margr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGRSXN, "\\margrsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGT, "\\margt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MARGTSXN, "\\margtsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MIN, "\\min" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MO, "\\mo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NEXTCSET, "\\nextcset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NEXTFILE, "\\nextfile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARS, "\\nofchars" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFPAGES, "\\nofpages" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFWORDS, "\\nofwords" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOLINE, "\\noline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSUPERSUB, "\\nosupersub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOWRAP, "\\nowrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OPERATOR, "\\operator" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OUTL, "\\outl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAGE, "\\page" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAGEBB, "\\pagebb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAPERH, "\\paperh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAPERW, "\\paperw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PAR, "\\par" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PARD, "\\pard" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PC, "\\pc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PCA, "\\pca" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGHSXN, "\\pghsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCONT, "\\pgncont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDEC, "\\pgndec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCLTR, "\\pgnlcltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCRM, "\\pgnlcrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNRESTART, "\\pgnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTART, "\\pgnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTARTS, "\\pgnstarts" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCLTR, "\\pgnucltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCRM, "\\pgnucrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNX, "\\pgnx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNY, "\\pgny" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGWSXN, "\\pgwsxn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHCOL, "\\phcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHMRG, "\\phmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PHPG, "\\phpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPB, "\\piccropb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPL, "\\piccropl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPR, "\\piccropr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPT, "\\piccropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICH, "\\pich" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICHGOAL, "\\pichgoal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALED, "\\picscaled" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEX, "\\picscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEY, "\\picscaley" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICT, "\\pict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICW, "\\picw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICWGOAL, "\\picwgoal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PLAIN, "\\plain" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PMMETAFILE, "\\pmmetafile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGX, "\\posnegx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGY, "\\posnegy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSX, "\\posx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXC, "\\posxc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXI, "\\posxi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXL, "\\posxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXO, "\\posxo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSXR, "\\posxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSY, "\\posy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYB, "\\posyb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYC, "\\posyc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYIL, "\\posyil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYT, "\\posyt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRINTIM, "\\printim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PSOVER, "\\psover" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVMRG, "\\pvmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVPARA, "\\pvpara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PVPG, "\\pvpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QC, "\\qc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QJ, "\\qj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QL, "\\ql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_QR, "\\qr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RDBLQUOTE, "\\rdblquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RED, "\\red" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVBAR, "\\revbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVISED, "\\revised" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVISIONS, "\\revisions" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVPROP, "\\revprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVTIM, "\\revtim" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RI, "\\ri" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RIN, "\\rin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ROW, "\\row" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RQUOTE, "\\rquote" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTF, "\\rtf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RXE, "\\rxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_S, "\\s" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SA, "\\sa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SB, "\\sb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBASEDON, "\\sbasedon" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKCOL, "\\sbkcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKEVEN, "\\sbkeven" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKNONE, "\\sbknone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKODD, "\\sbkodd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBKPAGE, "\\sbkpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SBYS, "\\sbys" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SCAPS, "\\scaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECT, "\\sect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTD, "\\sectd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHAD, "\\shad" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHADING, "\\shading" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHIFT, "\\shift" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SL, "\\sl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SNEXT, "\\snext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STRIKE, "\\strike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STYLESHEET, "\\stylesheet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUB, "\\sub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBJECT, "\\subject" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUPER, "\\super" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TAB, "\\tab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TB, "\\tb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TC, "\\tc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCF, "\\tcf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCL, "\\tcl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TEMPLATE, "\\template" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TITLE, "\\title" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TITLEPG, "\\titlepg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLDOT, "\\tldot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLEQ, "\\tleq" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLHYPH, "\\tlhyph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLTH, "\\tlth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLUL, "\\tlul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQC, "\\tqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQDEC, "\\tqdec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQR, "\\tqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TQL, "\\tql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRGAPH, "\\trgaph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRLEFT, "\\trleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TROWD, "\\trowd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQC, "\\trqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQL, "\\trql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRQR, "\\trqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRRH, "\\trrh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TX, "\\tx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TXE, "\\txe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UL, "\\ul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULD, "\\uld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDB, "\\uldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULNONE, "\\ulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULW, "\\ulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UP, "\\up" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_V, "\\v" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERN, "\\vern" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERSION, "\\version" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALB, "\\vertalb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALC, "\\vertalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALJ, "\\vertalj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VERTALT, "\\vertalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBITMAP, "\\wbitmap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMBITSPIXEL, "\\wbmbitspixel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMPLANES, "\\wbmplanes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WBMWIDTHBYTES, "\\wbmwidthbytes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WIDOWCTRL, "\\widowctrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WMETAFILE, "\\wmetafile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_XE, "\\xe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_YR, "\\yr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOBRKHYPH, "\\_" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMULA, "\\|" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOBREAK, "\\~" );
-
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AB, "\\ab" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACAPS, "\\acaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACF, "\\acf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADDITIVE, "\\additive" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADN, "\\adn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AENDDOC, "\\aenddoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AENDNOTES, "\\aendnotes" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AEXPND, "\\aexpnd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AF, "\\af" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFS, "\\afs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNBJ, "\\aftnbj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNCN, "\\aftncn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNALC, "\\aftnnalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAR, "\\aftnnar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAUC, "\\aftnnauc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHI, "\\aftnnchi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRLC, "\\aftnnrlc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRUC, "\\aftnnruc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRESTART, "\\aftnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRSTCONT, "\\aftnrstcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEP, "\\aftnsep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEPC, "\\aftnsepc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSTART, "\\aftnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNTJ, "\\aftntj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AI, "\\ai" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALANG, "\\alang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ALLPROT, "\\allprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTPROT, "\\annotprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AOUTL, "\\aoutl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASCAPS, "\\ascaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASHAD, "\\ashad" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASTRIKE, "\\astrike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNAUTHOR, "\\atnauthor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNICN, "\\atnicn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNREF, "\\atnref" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATNTIME, "\\atntime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATRFEND, "\\atrfend" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ATRFSTART, "\\atrfstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUL, "\\aul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULD, "\\auld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULDB, "\\auldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULNONE, "\\aulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AULW, "\\aulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AUP, "\\aup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKPUB, "\\bkmkpub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASH, "\\brdrdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRKFRM, "\\brkfrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CCHS, "\\cchs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CPG, "\\cpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CS, "\\cs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CVMME, "\\cvmme" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DATAFIELD, "\\datafield" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DO, "\\do" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXCOLUMN, "\\dobxcolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXMARGIN, "\\dobxmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBXPAGE, "\\dobxpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYMARGIN, "\\dobymargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPAGE, "\\dobypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPARA, "\\dobypara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DODHGT, "\\dodhgt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOLOCK, "\\dolock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDHOL, "\\dpaendhol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDL, "\\dpaendl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDSOL, "\\dpaendsol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDW, "\\dpaendw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARC, "\\dparc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPX, "\\dparcflipx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPY, "\\dparcflipy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTHOL, "\\dpastarthol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTL, "\\dpastartl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTSOL, "\\dpastartsol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTW, "\\dpastartw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCALLOUT, "\\dpcallout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOA, "\\dpcoa" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOACCENT, "\\dpcoaccent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBESTFIT, "\\dpcobestfit" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBORDER, "\\dpcoborder" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODABS, "\\dpcodabs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODBOTTOM, "\\dpcodbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODCENTER, "\\dpcodcenter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODTOP, "\\dpcodtop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOLENGTH, "\\dpcolength" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSX, "\\dpcominusx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSY, "\\dpcominusy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOOFFSET, "\\dpcooffset" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOSMARTA, "\\dpcosmarta" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTDOUBLE, "\\dpcotdouble" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTRIGHT, "\\dpcotright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTSINGLE, "\\dpcotsingle" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTTRIPLE, "\\dpcottriple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCOUNT, "\\dpcount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPELLIPSE, "\\dpellipse" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPENDGROUP, "\\dpendgroup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCB, "\\dpfillbgcb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCG, "\\dpfillbgcg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCR, "\\dpfillbgcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGGRAY, "\\dpfillbggray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGPAL, "\\dpfillbgpal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCB, "\\dpfillfgcb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCG, "\\dpfillfgcg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCR, "\\dpfillfgcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGGRAY, "\\dpfillfggray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGPAL, "\\dpfillfgpal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLPAT, "\\dpfillpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPGROUP, "\\dpgroup" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINE, "\\dpline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOB, "\\dplinecob" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOG, "\\dplinecog" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOR, "\\dplinecor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADO, "\\dplinedado" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADODO, "\\dplinedadodo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDASH, "\\dplinedash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDOT, "\\dplinedot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEGRAY, "\\dplinegray" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEHOLLOW, "\\dplinehollow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEPAL, "\\dplinepal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINESOLID, "\\dplinesolid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEW, "\\dplinew" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYCOUNT, "\\dppolycount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYGON, "\\dppolygon" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYLINE, "\\dppolyline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPTX, "\\dpptx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPPTY, "\\dppty" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPRECT, "\\dprect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPROUNDR, "\\dproundr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADOW, "\\dpshadow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADX, "\\dpshadx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADY, "\\dpshady" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBX, "\\dptxbx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXMAR, "\\dptxbxmar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXTEXT, "\\dptxbxtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPX, "\\dpx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPXSIZE, "\\dpxsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPY, "\\dpy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPYSIZE, "\\dpysize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DS, "\\ds" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMSPACE, "\\emspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ENSPACE, "\\enspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FBIDI, "\\fbidi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FET, "\\fet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FID, "\\fid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FILE, "\\file" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FILETBL, "\\filetbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDALT, "\\fldalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNETWORK, "\\fnetwork" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTEMB, "\\fontemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FONTFILE, "\\fontfile" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMDISP, "\\formdisp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMPROT, "\\formprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMSHADE, "\\formshade" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOSNUM, "\\fosnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRELATIVE, "\\frelative" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNALT, "\\ftnalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNIL, "\\ftnil" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNALC, "\\ftnnalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAR, "\\ftnnar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAUC, "\\ftnnauc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHI, "\\ftnnchi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRLC, "\\ftnnrlc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRUC, "\\ftnnruc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTCONT, "\\ftnrstcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTPG, "\\ftnrstpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTTRUETYPE, "\\fttruetype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDDOS, "\\fvaliddos" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDHPFS, "\\fvalidhpfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDMAC, "\\fvalidmac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDNTFS, "\\fvalidntfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHAUTO, "\\hyphauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCAPS, "\\hyphcaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCONSEC, "\\hyphconsec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHPAR, "\\hyphpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKSELF, "\\linkself" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKSTYLES, "\\linkstyles" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRCH, "\\ltrch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRDOC, "\\ltrdoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRMARK, "\\ltrmark" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRPAR, "\\ltrpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRROW, "\\ltrrow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LTRSECT, "\\ltrsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOCOLBAL, "\\nocolbal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOEXTRASPRL, "\\noextrasprl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOTABIND, "\\notabind" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOWIDCTLPAR, "\\nowidctlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIAS, "\\objalias" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIGN, "\\objalign" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJAUTLINK, "\\objautlink" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCLASS, "\\objclass" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPB, "\\objcropb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPL, "\\objcropl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPR, "\\objcropr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPT, "\\objcropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJDATA, "\\objdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJECT, "\\object" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJEMB, "\\objemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJH, "\\objh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJICEMB, "\\objicemb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJLINK, "\\objlink" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJLOCK, "\\objlock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJNAME, "\\objname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJPUB, "\\objpub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEX, "\\objscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEY, "\\objscaley" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSECT, "\\objsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSETSIZE, "\\objsetsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJSUB, "\\objsub" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJTIME, "\\objtime" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJTRANSY, "\\objtransy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJUPDATE, "\\objupdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJW, "\\objw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OTBLRUL, "\\otblrul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHN, "\\pgnhn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSC, "\\pgnhnsc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSH, "\\pgnhnsh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSM, "\\pgnhnsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSN, "\\pgnhnsn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSP, "\\pgnhnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICBMP, "\\picbmp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICBPP, "\\picbpp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PN, "\\pn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNACROSS, "\\pnacross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNB, "\\pnb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCAPS, "\\pncaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCARD, "\\pncard" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCF, "\\pncf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDEC, "\\pndec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNF, "\\pnf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNFS, "\\pnfs" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNHANG, "\\pnhang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNI, "\\pni" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNINDENT, "\\pnindent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLCLTR, "\\pnlcltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLCRM, "\\pnlcrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVL, "\\pnlvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBLT, "\\pnlvlblt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBODY, "\\pnlvlbody" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLCONT, "\\pnlvlcont" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNNUMONCE, "\\pnnumonce" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNORD, "\\pnord" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNORDT, "\\pnordt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNPREV, "\\pnprev" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQC, "\\pnqc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQL, "\\pnql" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNQR, "\\pnqr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRESTART, "\\pnrestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSCAPS, "\\pnscaps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSECLVL, "\\pnseclvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSP, "\\pnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSTART, "\\pnstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNSTRIKE, "\\pnstrike" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTEXT, "\\pntext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTA, "\\pntxta" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTB, "\\pntxtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUCLTR, "\\pnucltr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUCRM, "\\pnucrm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNUL, "\\pnul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULD, "\\pnuld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULDB, "\\pnuldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULNONE, "\\pnulnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNULW, "\\pnulw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRCOLBL, "\\prcolbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRINTDATA, "\\printdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PSZ, "\\psz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PUBAUTO, "\\pubauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RESULT, "\\result" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTH, "\\revauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTM, "\\revdttm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVPROT, "\\revprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVTBL, "\\revtbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTBMP, "\\rsltbmp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTMERGE, "\\rsltmerge" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTPICT, "\\rsltpict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTRTF, "\\rsltrtf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RSLTTXT, "\\rslttxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLCH, "\\rtlch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLDOC, "\\rtldoc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLMARK, "\\rtlmark" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLPAR, "\\rtlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLROW, "\\rtlrow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_RTLSECT, "\\rtlsect" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SEC, "\\sec" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTNUM, "\\sectnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTUNLOCKED, "\\sectunlocked" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SLMULT, "\\slmult" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTCOL, "\\softcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLHEIGHT, "\\softlheight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLINE, "\\softline" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOFTPAGE, "\\softpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSSPBF, "\\sprsspbf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSP, "\\sprstsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBDOCUMENT, "\\subdocument" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SWPBDR, "\\swpbdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCN, "\\tcn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRANSMF, "\\transmf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRB, "\\trbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRH, "\\trbrdrh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRL, "\\trbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRR, "\\trbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRT, "\\trbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRV, "\\trbrdrv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRHDR, "\\trhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRKEEP, "\\trkeep" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDB, "\\trpaddb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDL, "\\trpaddl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDR, "\\trpaddr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDT, "\\trpaddt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFB, "\\trpaddfb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFL, "\\trpaddfl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFR, "\\trpaddfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRPADDFT, "\\trpaddft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WRAPTRSP, "\\wraptrsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_XEF, "\\xef" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ZWJ, "\\zwj" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ZWNJ, "\\zwnj" );
-
-// neue Tokens zur 1.5
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ABSLOCK, "\\abslock" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADJUSTRIGHT, "\\adjustright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHOSUNG, "\\aftnnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCNUM, "\\aftnncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBAR, "\\aftnndbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUM, "\\aftnndbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMD, "\\aftnndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMK, "\\aftnndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMT, "\\aftnndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGANADA, "\\aftnnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUM, "\\aftnngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMD, "\\aftnngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMK, "\\aftnngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUML, "\\aftnngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIAC, "\\aftnnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACD, "\\aftnnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACL, "\\aftnnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANIMTEXT, "\\animtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ANSICPG, "\\ansicpg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BACKGROUND, "\\background" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BDBFHDR, "\\bdbfhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPTAG, "\\bliptag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUID, "\\blipuid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUPI, "\\blipupi" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRART, "\\brdrart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHD, "\\brdrdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDD, "\\brdrdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDOTSTR, "\\brdrdashdotstr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHSM, "\\brdrdashsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDREMBOSS, "\\brdremboss" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRENGRAVE, "\\brdrengrave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRFRAME, "\\brdrframe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNLG, "\\brdrthtnlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNMG, "\\brdrthtnmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNSG, "\\brdrthtnsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHLG, "\\brdrtnthlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHMG, "\\brdrtnthmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHSG, "\\brdrtnthsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNLG, "\\brdrtnthtnlg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNMG, "\\brdrtnthtnmg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNSG, "\\brdrtnthtnsg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTRIPLE, "\\brdrtriple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVY, "\\brdrwavy" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVYDB, "\\brdrwavydb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CATEGORY, "\\category" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CGRID, "\\cgrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHARSCALEX, "\\charscalex" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGBDIAG, "\\chbgbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGCROSS, "\\chbgcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDCROSS, "\\chbgdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKBDIAG, "\\chbgdkbdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKCROSS, "\\chbgdkcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKDCROSS, "\\chbgdkdcross" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKFDIAG, "\\chbgdkfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKHORIZ, "\\chbgdkhoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKVERT, "\\chbgdkvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGFDIAG, "\\chbgfdiag" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGHORIZ, "\\chbghoriz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBGVERT, "\\chbgvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHBRDR, "\\chbrdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHCBPAT, "\\chcbpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHCFPAT, "\\chcfpat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CHSHDNG, "\\chshdng" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADL, "\\clpadl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADT, "\\clpadt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADB, "\\clpadb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADR, "\\clpadr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFL, "\\clpadfl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFT, "\\clpadft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFB, "\\clpadfb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLPADFR, "\\clpadfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTB, "\\cltxlrtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRL, "\\cltxtbrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALB, "\\clvertalb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALC, "\\clvertalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALT, "\\clvertalt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVMGF, "\\clvmgf" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLVMRG, "\\clvmrg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRLV, "\\cltxtbrlv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXBTLR, "\\cltxbtlr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTBV, "\\cltxlrtbv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_COMPANY, "\\company" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CRAUTH, "\\crauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_CRDATE, "\\crdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DATE, "\\date" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANGFE, "\\deflangfe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRAUTH, "\\dfrauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRDATE, "\\dfrdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTART, "\\dfrstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTOP, "\\dfrstop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRXST, "\\dfrxst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DGMARGIN, "\\dgmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DNTBLNSBDB, "\\dntblnsbdb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCTYPE, "\\doctype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DOCVAR, "\\docvar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DPCODESCENT, "\\dpcodescent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMBO, "\\embo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EMFBLIP, "\\emfblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_EXPSHRTN, "\\expshrtn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAAUTO, "\\faauto" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FBIAS, "\\fbias" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFRES, "\\ffdefres" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFTEXT, "\\ffdeftext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFENTRYMCR, "\\ffentrymcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFEXITMCR, "\\ffexitmcr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFFORMAT, "\\ffformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHASLISTBOX, "\\ffhaslistbox" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHELPTEXT, "\\ffhelptext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFHPS, "\\ffhps" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFL, "\\ffl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFMAXLEN, "\\ffmaxlen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFNAME, "\\ffname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNHELP, "\\ffownhelp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNSTAT, "\\ffownstat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFPROT, "\\ffprot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFRECALC, "\\ffrecalc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFRES, "\\ffres" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFSIZE, "\\ffsize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFSTATTEXT, "\\ffstattext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPE, "\\fftype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPETXT, "\\fftypetxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLDTYPE, "\\fldtype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FNAME, "\\fname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FORMFIELD, "\\formfield" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FROMTEXT, "\\fromtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHOSUNG, "\\ftnnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCNUM, "\\ftnncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBAR, "\\ftnndbar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUM, "\\ftnndbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMD, "\\ftnndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMK, "\\ftnndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMT, "\\ftnndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGANADA, "\\ftnnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUM, "\\ftnngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMD, "\\ftnngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMK, "\\ftnngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUML, "\\ftnngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIAC, "\\ftnnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACD, "\\ftnnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACL, "\\ftnnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_G, "\\g" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GCW, "\\gcw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRIDTBL, "\\gridtbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HIGHLIGHT, "\\highlight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLFR, "\\hlfr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLINKBASE, "\\hlinkbase" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLLOC, "\\hlloc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HLSRC, "\\hlsrc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ILVL, "\\ilvl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_IMPR, "\\impr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_JPEGBLIP, "\\jpegblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELFOLLOW, "\\levelfollow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELINDENT, "\\levelindent" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELJC, "\\leveljc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELLEGAL, "\\levellegal" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNFC, "\\levelnfc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNORESTART, "\\levelnorestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNUMBERS, "\\levelnumbers" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELOLD, "\\levelold" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREV, "\\levelprev" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREVSPACE, "\\levelprevspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSPACE, "\\levelspace" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSTARTAT, "\\levelstartat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LEVELTEXT, "\\leveltext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LINKVAL, "\\linkval" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LIST, "\\list" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTID, "\\listid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTLEVEL, "\\listlevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTNAME, "\\listname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDE, "\\listoverride" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDECOUNT, "\\listoverridecount" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDEFORMAT, "\\listoverrideformat" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDESTART, "\\listoverridestart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDETABLE, "\\listoverridetable" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTRESTARTHDN, "\\listrestarthdn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTSIMPLE, "\\listsimple" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTABLE, "\\listtable" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEMPLATEID, "\\listtemplateid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEXT, "\\listtext" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LS, "\\ls" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LYTEXCTTP, "\\lytexcttp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LYTPRTMET, "\\lytprtmet" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MANAGER, "\\manager" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_MSMCAP, "\\msmcap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARSWS, "\\nofcharsws" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOLEAD, "\\nolead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NONSHPPICT, "\\nonshppict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSECTEXPAND, "\\nosectexpand" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSNAPLINEGRID, "\\nosnaplinegrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOSPACEFORUL, "\\nospaceforul" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOULTRLSPC, "\\noultrlspc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOXLATTOYEN, "\\noxlattoyen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJATTPH, "\\objattph" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJHTML, "\\objhtml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OBJOCX, "\\objocx" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDLINEWRAP, "\\oldlinewrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OUTLINELEVEL, "\\outlinelevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OVERLAY, "\\overlay" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PANOSE, "\\panose" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRB, "\\pgbrdrb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRFOOT, "\\pgbrdrfoot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRHEAD, "\\pgbrdrhead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRL, "\\pgbrdrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDROPT, "\\pgbrdropt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRR, "\\pgbrdrr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRSNAP, "\\pgbrdrsnap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRT, "\\pgbrdrt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCHOSUNG, "\\pgnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNCNUM, "\\pgncnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMK, "\\pgndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMT, "\\pgndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGANADA, "\\pgnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUM, "\\pgngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMD, "\\pgngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMK, "\\pgngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUML, "\\pgngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIAC, "\\pgnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACD, "\\pgnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACL, "\\pgnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PICPROP, "\\picprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEO, "\\pnaiueo" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEOD, "\\pnaiueod" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNCHOSUNG, "\\pnchosung" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMD, "\\pndbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMK, "\\pndbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUML, "\\pndbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMT, "\\pndbnumt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGANADA, "\\pnganada" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBLIP, "\\pngblip" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUM, "\\pngbnum" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMD, "\\pngbnumd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMK, "\\pngbnumk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUML, "\\pngbnuml" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRAUTH, "\\pnrauth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRDATE, "\\pnrdate" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRNFC, "\\pnrnfc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRNOT, "\\pnrnot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRPNBR, "\\pnrpnbr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRRGB, "\\pnrrgb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTART, "\\pnrstart" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTOP, "\\pnrstop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNRXST, "\\pnrxst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIAC, "\\pnzodiac" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACD, "\\pnzodiacd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACL, "\\pnzodiacl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LFOLEVEL, "\\lfolevel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYIN, "\\posyin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_POSYOUT, "\\posyout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRIVATE, "\\private" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PROPNAME, "\\propname" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PROPTYPE, "\\proptype" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTHDEL, "\\revauthdel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTMDEL, "\\revdttmdel" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SAUTOUPD, "\\sautoupd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTDEFAULTCL, "\\sectdefaultcl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTEXPAND, "\\sectexpand" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTLINEGRID, "\\sectlinegrid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYCL, "\\sectspecifycl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYL, "\\sectspecifyl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHIDDEN, "\\shidden" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBOTTOM, "\\shpbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXCOLUMN, "\\shpbxcolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXMARGIN, "\\shpbxmargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXPAGE, "\\shpbxpage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYMARGIN, "\\shpbymargin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPAGE, "\\shpbypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPARA, "\\shpbypara" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPFBLWTXT, "\\shpfblwtxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPFHDR, "\\shpfhdr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPGRP, "\\shpgrp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLID, "\\shplid" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLOCKANCHOR, "\\shplockanchor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPPICT, "\\shppict" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRIGHT, "\\shpright" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRSLT, "\\shprslt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTXT, "\\shptxt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPWRK, "\\shpwrk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPWR, "\\shpwr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPZ, "\\shpz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSBSP, "\\sprsbsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSLNSP, "\\sprslnsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSM, "\\sprstsm" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STATICVAL, "\\staticval" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STEXTFLOW, "\\stextflow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_STRIKED, "\\striked" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SUBFONTBYSIZE, "\\subfontbysize" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TCELLD, "\\tcelld" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TIME, "\\time" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TRUNCATEFONTHEIGHT, "\\truncatefontheight" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UC, "\\uc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UD, "\\ud" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASH, "\\uldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHD, "\\uldashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHDD, "\\uldashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTH, "\\ulth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULWAVE, "\\ulwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULC, "\\ulc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_U, "\\u" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UPR, "\\upr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_USERPROPS, "\\userprops" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWKIND, "\\viewkind" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWSCALE, "\\viewscale" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_VIEWZK, "\\viewzk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WIDCTLPAR, "\\widctlpar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WINDOWCAPTION, "\\windowcaption" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPEQN, "\\wpeqn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPJST, "\\wpjst" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_WPSP, "\\wpsp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_YXE, "\\yxe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXLRTB, "\\frmtxlrtb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXTBRL, "\\frmtxtbrl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXBTLR, "\\frmtxbtlr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXLRTBV, "\\frmtxlrtbv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FRMTXTBRLV, "\\frmtxtbrlv" );
-
-// MS-2000 Tokens
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHD, "\\ulthd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASH, "\\ulthdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULLDASH, "\\ulldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHLDASH, "\\ulthldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHD, "\\ulthdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHDD, "\\ulthdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULHWAVE, "\\ulhwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ULULDBWAVE, "\\ululdbwave" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LOCH, "\\loch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HICH, "\\hich" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DBCH, "\\dbch" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_LANGFE, "\\langfe" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADEFLANG, "\\adeflang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ADEFF, "\\adeff" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCNONE, "\\accnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCDOT, "\\accdot" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ACCCOMMA, "\\acccomma" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TWOINONE, "\\twoinone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HORZVERT, "\\horzvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAHANG, "\\fahang" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAVAR, "\\favar" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FACENTER, "\\facenter" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAROMAN, "\\faroman" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FAFIXED, "\\fafixed" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOCWRAP, "\\nocwrap" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_NOOVERFLOW,"\\nooverflow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_ASPALPHA, "\\aspalpha" );
-
-// SWG spezifische Attribute
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNV, "\\grfalignv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNH, "\\grfalignh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_GRFMIRROR, "\\grfmirror" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYB, "\\headeryb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXL, "\\headerxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXR, "\\headerxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYT, "\\footeryt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXL, "\\footerxl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXR, "\\footerxr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYH, "\\headeryh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYH, "\\footeryh" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BALANCEDCOLUMN, "\\swcolmnblnc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_UPDNPROP, "\\updnprop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PRTDATA, "\\prtdata" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BKMKKEY, "\\bkmkkey" );
-
-// Attribute fuer die freifliegenden Rahmen
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRINT, "\\flyprint" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYOPAQUE, "\\flyopaque" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRTCTD, "\\flyprtctd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYMAINCNT, "\\flymaincnt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYVERT, "\\flyvert" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYHORZ, "\\flyhorz" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTL, "\\dfrmtxtl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTR, "\\dfrmtxtr" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTU, "\\dfrmtxtu" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTW, "\\dfrmtxtw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYANCHOR, "\\flyanchor" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYCNTNT, "\\flycntnt" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYCOLUMN, "\\flycolumn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYPAGE, "\\flypage" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_FLYINPARA, "\\flyinpara" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDBOX, "\\brdbox" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNCOL, "\\brdlncol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNIN, "\\brdlnin" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNOUT, "\\brdlnout" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNDIST, "\\brdlndist" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHADOW, "\\shadow" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWDIST, "\\shdwdist" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWSTYLE, "\\shdwstyle" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWCOL, "\\shdwcol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHDWFCOL, "\\shdwfcol" );
-
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCTBL, "\\pgdsctbl" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSC, "\\pgdsc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCUSE, "\\pgdscuse" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNXT, "\\pgdscnxt" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHEN, "\\hyphen" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHLEAD, "\\hyphlead" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHTRAIL, "\\hyphtrail" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_HYPHMAX, "\\hyphmax" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_TLSWG, "\\tlswg" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGBRK, "\\pgbrk" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNO, "\\pgdscno" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
-
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHP, "\\shp" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SN, "\\sn" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SV, "\\sv" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SP, "\\sp" );
-/*
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPBOTTOM, "\\shpbottom" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPRIGHT, "\\shpright" );
-*/
-
-// Support for overline attributes
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OL, "\\ol" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLD, "\\old" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDB, "\\oldb" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLNONE, "\\olnone" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLW, "\\olw" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASH, "\\oldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASHD, "\\oldashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLDASHDD, "\\oldashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTH, "\\olth" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLWAVE, "\\olwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLC, "\\olc" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHD, "\\olthd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASH, "\\olthdash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLLDASH, "\\olldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHLDASH, "\\olthldash" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASHD, "\\olthdashd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLTHDASHDD, "\\olthdashdd" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLHWAVE, "\\olhwave" );
-sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_OLOLDBWAVE, "\\ololdbwave" );
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
index dc189d2f9f38..db41d05bfa28 100644
--- a/svtools/source/svrtf/rtfkeywd.cxx
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "rtfkeywd.hxx"
-#include "rtftoken.h"
+#include <svtools/rtfkeywd.hxx>
+#include <svtools/rtftoken.h>
#include "tools/string.hxx"
#include <string.h>
@@ -48,7 +48,7 @@ struct RTF_TokenEntry
};
// Flag: RTF-Token Tabelle wurde schon sortiert
-static int bSortKeyWords = FALSE;
+static int bSortKeyWords = sal_False;
static RTF_TokenEntry aRTFTokenTab[] = {
{{OOO_STRING_SVTOOLS_RTF_IGNORE}, RTF_IGNOREFLAG},
@@ -1227,7 +1227,7 @@ int GetRTFToken( const String& rSearch )
sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
sizeof( RTF_TokenEntry ),
RTFKeyCompare );
- bSortKeyWords = TRUE;
+ bSortKeyWords = sal_True;
}
int nRet = 0;
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index e9cca4d402fa..21368c0b14d3 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -33,8 +33,8 @@
#include <tools/string.hxx>
#include <rtl/string.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtfkeywd.hxx>
-#include <rtfout.hxx>
+#include <svtools/rtfkeywd.hxx>
+#include <svtools/rtfout.hxx>
using ::rtl::OUString;
using ::rtl::OString;
@@ -47,7 +47,7 @@ const sal_Char RTFOutFuncs::sNewLine[] = "\015\012";
SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
- int *pUCMode, rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ int *pUCMode, rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
const sal_Char* pStr = 0;
switch (c)
@@ -166,7 +166,7 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
}
SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
- rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
int nUCMode = 1;
for (xub_StrLen n = 0; n < rStr.Len(); ++n)
@@ -177,7 +177,7 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
}
SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr,
- rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile)
+ rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
{
//Fontnames in word have a quirk in that \uc and usage of ansi replacement
//chars after a \u don't work and in wordpad \u doesn't work, so we are
@@ -187,7 +187,7 @@ SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr,
return rStream;
}
-SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen )
+SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
{
sal_Char aNToABuf[] = "0000000000000000";
@@ -197,7 +197,7 @@ SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen )
// Pointer an das Bufferende setzen
sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
- for( BYTE n = 0; n < nLen; ++n )
+ for( sal_uInt8 n = 0; n < nLen; ++n )
{
*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
if( *pStr > '9' )
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
index 227de97e3cb1..11ecfe25bcef 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -50,11 +50,11 @@
struct SvParser_Impl
{
String aToken; // gescanntes Token
- ULONG nFilePos; // akt. Position im Stream
- ULONG nlLineNr; // akt. Zeilen Nummer
- ULONG nlLinePos; // akt. Spalten Nummer
+ sal_uLong nFilePos; // akt. Position im Stream
+ sal_uLong nlLineNr; // akt. Zeilen Nummer
+ sal_uLong nlLinePos; // akt. Spalten Nummer
long nTokenValue; // zusaetzlicher Wert (RTF)
- BOOL bTokenHasValue; // indicates whether nTokenValue is valid
+ sal_Bool bTokenHasValue; // indicates whether nTokenValue is valid
int nToken; // akt. Token
sal_Unicode nNextCh; // akt. Zeichen
@@ -77,7 +77,7 @@ struct SvParser_Impl
// Konstruktor
-SvParser::SvParser( SvStream& rIn, BYTE nStackSize )
+SvParser::SvParser( SvStream& rIn, sal_uInt8 nStackSize )
: rInput( rIn )
, nlLineNr( 1 )
, nlLinePos( 1 )
@@ -86,11 +86,11 @@ SvParser::SvParser( SvStream& rIn, BYTE nStackSize )
, bTokenHasValue( false )
, eState( SVPAR_NOTSTARTED )
, eSrcEnc( RTL_TEXTENCODING_DONTKNOW )
- , bDownloadingFile( FALSE )
+ , bDownloadingFile( sal_False )
, nTokenStackSize( nStackSize )
, nTokenStackPos( 0 )
{
- bUCS2BSrcEnc = bSwitchToUCS2 = FALSE;
+ bUCS2BSrcEnc = bSwitchToUCS2 = sal_False;
eState = SVPAR_NOTSTARTED;
if( nTokenStackSize < 3 )
nTokenStackSize = 3;
@@ -191,11 +191,11 @@ sal_Unicode SvParser::GetNextChar()
// When reading muliple bytes, we don't have to care about the file
// position when we run inti the pending state. The file position is
// maintained by SaveState/RestoreState.
- BOOL bErr;
+ sal_Bool bErr;
if( bSwitchToUCS2 && 0 == rInput.Tell() )
{
sal_uChar c1, c2;
- BOOL bSeekBack = TRUE;
+ sal_Bool bSeekBack = sal_True;
rInput >> c1;
bErr = rInput.IsEof() || rInput.GetError();
@@ -210,14 +210,14 @@ sal_Unicode SvParser::GetNextChar()
if( 0xfe == c1 && 0xff == c2 )
{
eSrcEnc = RTL_TEXTENCODING_UCS2;
- bUCS2BSrcEnc = TRUE;
- bSeekBack = FALSE;
+ bUCS2BSrcEnc = sal_True;
+ bSeekBack = sal_False;
}
else if( 0xff == c1 && 0xfe == c2 )
{
eSrcEnc = RTL_TEXTENCODING_UCS2;
- bUCS2BSrcEnc = FALSE;
- bSeekBack = FALSE;
+ bUCS2BSrcEnc = sal_False;
+ bSeekBack = sal_False;
}
}
}
@@ -225,7 +225,7 @@ sal_Unicode SvParser::GetNextChar()
if( bSeekBack )
rInput.Seek( 0 );
- bSwitchToUCS2 = FALSE;
+ bSwitchToUCS2 = sal_False;
}
nNextChPos = rInput.Tell();
@@ -480,7 +480,7 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen"
nTmp = 0;
else if( nTmp > nTokenStackSize )
nTmp = nTokenStackSize;
- nTokenStackPos = BYTE(nTmp);
+ nTokenStackPos = sal_uInt8(nTmp);
// und die Werte zurueck
aToken = pTokenStackPos->sToken;
@@ -492,15 +492,15 @@ int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen"
SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt )
{
- BYTE nAktPos = BYTE(pTokenStackPos - pTokenStack );
+ sal_uInt8 nAktPos = sal_uInt8(pTokenStackPos - pTokenStack );
if( nCnt > 0 )
{
if( nCnt >= nTokenStackSize )
nCnt = (nTokenStackSize-1);
if( nAktPos + nCnt < nTokenStackSize )
- nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt);
+ nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt);
else
- nAktPos = sal::static_int_cast< BYTE >(
+ nAktPos = sal::static_int_cast< sal_uInt8 >(
nAktPos + (nCnt - nTokenStackSize));
}
else if( nCnt < 0 )
@@ -508,9 +508,9 @@ SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt )
if( -nCnt >= nTokenStackSize )
nCnt = -nTokenStackSize+1;
if( -nCnt <= nAktPos )
- nAktPos = sal::static_int_cast< BYTE >(nAktPos + nCnt);
+ nAktPos = sal::static_int_cast< sal_uInt8 >(nAktPos + nCnt);
else
- nAktPos = sal::static_int_cast< BYTE >(
+ nAktPos = sal::static_int_cast< sal_uInt8 >(
nAktPos + (nCnt + nTokenStackSize));
}
return pTokenStack + nAktPos;
@@ -574,32 +574,32 @@ void SvParser::Continue( int )
}
void SvParser::BuildWhichTbl( SvUShorts &rWhichMap,
- USHORT *pWhichIds,
- USHORT nWhichIds )
+ sal_uInt16 *pWhichIds,
+ sal_uInt16 nWhichIds )
{
- USHORT aNewRange[2];
+ sal_uInt16 aNewRange[2];
- for( USHORT nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
+ for( sal_uInt16 nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
if( *pWhichIds )
{
aNewRange[0] = aNewRange[1] = *pWhichIds;
- BOOL bIns = TRUE;
+ sal_Bool bIns = sal_True;
// Position suchen
- for ( USHORT nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
+ for ( sal_uInt16 nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
{
if( *pWhichIds < rWhichMap[nOfs] - 1 )
{
// neuen Range davor
rWhichMap.Insert( aNewRange, 2, nOfs );
- bIns = FALSE;
+ bIns = sal_False;
break;
}
else if( *pWhichIds == rWhichMap[nOfs] - 1 )
{
// diesen Range nach unten erweitern
rWhichMap[nOfs] = *pWhichIds;
- bIns = FALSE;
+ bIns = sal_False;
break;
}
else if( *pWhichIds == rWhichMap[nOfs+1] + 1 )
@@ -613,7 +613,7 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap,
else
// diesen Range nach oben erweitern
rWhichMap[nOfs+1] = *pWhichIds;
- bIns = FALSE;
+ bIns = sal_False;
break;
}
}
@@ -691,7 +691,7 @@ SvKeyValueIterator::~SvKeyValueIterator (void)
/*
* GetFirst.
*/
-BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
+sal_Bool SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
{
m_nPos = m_pList->Count();
return GetNext (rKeyVal);
@@ -700,17 +700,17 @@ BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
/*
* GetNext.
*/
-BOOL SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
+sal_Bool SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
{
if (m_nPos > 0)
{
rKeyVal = *m_pList->GetObject(--m_nPos);
- return TRUE;
+ return sal_True;
}
else
{
// Nothing to do.
- return FALSE;
+ return sal_False;
}
}
diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx
new file mode 100755
index 000000000000..286ca505bb30
--- /dev/null
+++ b/svtools/source/table/cellvalueconversion.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svtools.hxx"
+
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString CellValueConversion::convertToString( const Any& i_value )
+ {
+ ::rtl::OUString sConvertString;
+ if ( !i_value.hasValue() )
+ return sConvertString;
+
+
+ // TODO: use css.script.XTypeConverter?
+
+ sal_Int32 nInt = 0;
+ sal_Bool bBool = false;
+ double fDouble = 0;
+
+ ::rtl::OUString sStringValue;
+ if ( i_value >>= sConvertString )
+ sStringValue = sConvertString;
+ else if ( i_value >>= nInt )
+ sStringValue = sConvertString.valueOf( nInt );
+ else if ( i_value >>= bBool )
+ sStringValue = sConvertString.valueOf( bBool );
+ else if ( i_value >>= fDouble )
+ sStringValue = sConvertString.valueOf( fDouble );
+ else
+ OSL_ENSURE( !i_value.hasValue(), "CellValueConversion::convertToString: cannot handle the given cell content type!" );
+
+ return sStringValue;
+ }
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
diff --git a/svtools/source/inc/accessibletableimp.hxx b/svtools/source/table/cellvalueconversion.hxx
index ffeba9b1deef..4d6b8c8d6aac 100644..100755
--- a/svtools/source/inc/accessibletableimp.hxx
+++ b/svtools/source/table/cellvalueconversion.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,43 +22,31 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
-************************************************************************/
+ ************************************************************************/
-#ifndef SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
-#define SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+#ifndef SVTOOLS_CELLVALUECONVERSION_HXX
+#define SVTOOLS_CELLVALUECONVERSION_HXX
-#include "svtaccessiblefactory.hxx"
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/Any.hxx>
+/** === end UNO includes === **/
-namespace svt { namespace table
+//......................................................................................................................
+namespace svt
{
-//........................................................................
+//......................................................................................................................
-
- class AccessibleTableControl_Impl
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ class CellValueConversion
{
- public:
- AccessibleFactoryAccess m_aFactoryAccess;
- IAccessibleTableControl* m_pAccessible;
-
- public:
- AccessibleTableControl_Impl() : m_pAccessible(NULL)
- {
- }
-
-
- /// @see AccessibleTableControl::getTableRowHeader
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTableHeader( AccessibleTableControlObjType _eObjType );
- /// @see AccessibleTableControl::getTable
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTable( );
-
+ public:
+ static ::rtl::OUString convertToString( const ::com::sun::star::uno::Any& i_cellValue );
};
-//........................................................................
-} } // namespace svt::table
-//........................................................................
-
-#endif // SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+#endif // SVTOOLS_CELLVALUECONVERSION_HXX
diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx
index b0c4a8c1bf9b..d0ecdb546837 100644
--- a/svtools/source/table/defaultinputhandler.cxx
+++ b/svtools/source/table/defaultinputhandler.cxx
@@ -29,121 +29,133 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/defaultinputhandler.hxx"
-#include "svtools/table/abstracttablecontrol.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include "tabledatawindow.hxx"
+#include "mousefunction.hxx"
#include <tools/debug.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
-#include "svtools/table/tabledatawindow.hxx"
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//.......................................................................
+//......................................................................................................................
+ typedef ::rtl::Reference< IMouseFunction > PMouseFunction;
+ typedef ::std::vector< PMouseFunction > MouseFunctions;
struct DefaultInputHandler_Impl
{
+ PMouseFunction pActiveFunction;
+ MouseFunctions aMouseFunctions;
};
- //====================================================================
+ //==================================================================================================================
//= DefaultInputHandler
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::DefaultInputHandler()
:m_pImpl( new DefaultInputHandler_Impl )
- ,m_bResize(false)
{
+ m_pImpl->aMouseFunctions.push_back( new ColumnResize );
+ m_pImpl->aMouseFunctions.push_back( new RowSelection );
+ m_pImpl->aMouseFunctions.push_back( new ColumnSortHandler );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::~DefaultInputHandler()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseMove( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- Point aPoint = _rMEvt.GetPosPixel();
- if(m_bResize)
+ bool lcl_delegateMouseEvent( DefaultInputHandler_Impl& i_impl, ITableControl& i_control, const MouseEvent& i_event,
+ FunctionResult ( IMouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) )
{
- _rControl.resizeColumn(aPoint);
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonDown( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
- {
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- RowPos nRow = _rControl.getCurrentRow(aPoint);
- if(nRow == -1)
- {
- m_bResize = _rControl.startResizeColumn(aPoint);
- bHandled = true;
- }
- else if(nRow >= 0)
- {
- if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
+ if ( i_impl.pActiveFunction.is() )
{
- _rControl.setCursorAtCurrentCell(aPoint);
- bHandled = true;
+ bool furtherHandler = false;
+ switch ( (i_impl.pActiveFunction.get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected - function already *is* active!" );
+ break;
+ case ContinueFunction:
+ break;
+ case DeactivateFunction:
+ i_impl.pActiveFunction.clear();
+ break;
+ case SkipFunction:
+ furtherHandler = true;
+ break;
+ }
+ if ( !furtherHandler )
+ // handled the event
+ return true;
}
- else
+
+ // ask all other handlers
+ bool handled = false;
+ for ( MouseFunctions::iterator handler = i_impl.aMouseFunctions.begin();
+ ( handler != i_impl.aMouseFunctions.end() ) && !handled;
+ ++handler
+ )
{
- if(!_rControl.isRowSelected(nRow))
- bHandled = _rControl.getSelEngine()->SelMouseButtonDown(_rMEvt);
- else
- bHandled = true;
+ if ( *handler == i_impl.pActiveFunction )
+ // we already invoked this function
+ continue;
+
+ switch ( (handler->get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ i_impl.pActiveFunction = *handler;
+ handled = true;
+ break;
+ case ContinueFunction:
+ case DeactivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected: inactivate handler cannot be continued or deactivated!" );
+ break;
+ case SkipFunction:
+ handled = false;
+ break;
+ }
}
+ return handled;
}
- return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonUp( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseMove( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- if(_rControl.getCurrentRow(aPoint) >= 0)
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- else if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
- {
- bHandled = true;
- }
- else
- {
- bHandled = _rControl.getSelEngine()->SelMouseButtonUp(_rMEvt);
- }
- }
- else
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- }
- return bHandled;
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseMove );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonDown( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseDown );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::KeyInput( IAbstractTableControl& _rControl, const KeyEvent& rKEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonUp( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseUp );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::KeyInput( ITableControl& _rControl, const KeyEvent& rKEvt )
{
bool bHandled = false;
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = rKeyCode.GetCode();
+ sal_uInt16 nKeyCode = rKeyCode.GetCode();
struct _ActionMapEntry
{
- USHORT nKeyCode;
- USHORT nKeyModifier;
+ sal_uInt16 nKeyCode;
+ sal_uInt16 nKeyModifier;
TableControlAction eAction;
}
static aKnownActions[] = {
@@ -159,11 +171,11 @@ namespace svt { namespace table
{ KEY_PAGEDOWN, KEY_MOD1, cursorToLastLine },
{ KEY_HOME, KEY_MOD1, cursorTopLeft },
{ KEY_END, KEY_MOD1, cursorBottomRight },
- { KEY_SPACE, KEY_MOD1, cursorSelectRow },
- { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
- { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
- { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
- { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
+ { KEY_SPACE, KEY_MOD1, cursorSelectRow },
+ { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
+ { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
+ { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
+ { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
{ 0, 0, invalidTableControlAction }
};
@@ -174,7 +186,6 @@ namespace svt { namespace table
if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) )
{
bHandled = _rControl.dispatchAction( pActions->eAction );
- bHandled = true; // always handled issue #i114340
break;
}
}
@@ -182,22 +193,22 @@ namespace svt { namespace table
return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::GetFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::GetFocus( ITableControl& _rControl )
{
_rControl.showCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::LoseFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::LoseFocus( ITableControl& _rControl )
{
_rControl.hideCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::RequestHelp( IAbstractTableControl& _rControl, const HelpEvent& _rHEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::RequestHelp( ITableControl& _rControl, const HelpEvent& _rHEvt )
{
(void)_rControl;
(void)_rHEvt;
@@ -205,8 +216,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Command( IAbstractTableControl& _rControl, const CommandEvent& _rCEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Command( ITableControl& _rControl, const CommandEvent& _rCEvt )
{
(void)_rControl;
(void)_rCEvt;
@@ -214,8 +225,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::PreNotify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::PreNotify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
@@ -223,16 +234,16 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Notify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Notify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
// TODO
return false;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index 1be46204a9d3..e69ad5589087 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -28,51 +28,209 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
+#include "cellvalueconversion.hxx"
#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/colorcfg.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/graphic/XGraphic.hpp>
+/** === end UNO includes === **/
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/image.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/decoview.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
+ using ::com::sun::star::graphic::XGraphic;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment_CENTER;
+ using ::com::sun::star::style::HorizontalAlignment_RIGHT;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment_MIDDLE;
+ using ::com::sun::star::style::VerticalAlignment_BOTTOM;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CachedSortIndicator
+ //==================================================================================================================
+ class CachedSortIndicator
+ {
+ public:
+ CachedSortIndicator()
+ :m_lastHeaderHeight( 0 )
+ ,m_lastArrowColor( COL_TRANSPARENT )
+ {
+ }
+
+ BitmapEx const & getBitmapFor( OutputDevice const & i_device, long const i_headerHeight, StyleSettings const & i_style, bool const i_sortAscending );
+
+ private:
+ long m_lastHeaderHeight;
+ Color m_lastArrowColor;
+ BitmapEx m_sortAscending;
+ BitmapEx m_sortDescending;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ BitmapEx const & CachedSortIndicator::getBitmapFor( OutputDevice const & i_device, long const i_headerHeight,
+ StyleSettings const & i_style, bool const i_sortAscending )
+ {
+ BitmapEx & rBitmap( i_sortAscending ? m_sortAscending : m_sortDescending );
+ if ( !rBitmap || ( i_headerHeight != m_lastHeaderHeight ) || ( i_style.GetActiveColor() != m_lastArrowColor ) )
+ {
+ long const nSortIndicatorWidth = 2 * i_headerHeight / 3;
+ long const nSortIndicatorHeight = 2 * nSortIndicatorWidth / 3;
+
+ Point const aBitmapPos( 0, 0 );
+ Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight );
+ VirtualDevice aDevice( i_device, 0, 0 );
+ aDevice.SetOutputSizePixel( aBitmapSize );
+
+ DecorationView aDecoView( &aDevice );
+ aDecoView.DrawSymbol(
+ Rectangle( aBitmapPos, aBitmapSize ),
+ i_sortAscending ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN,
+ i_style.GetActiveColor()
+ );
+
+ rBitmap = aDevice.GetBitmapEx( aBitmapPos, aBitmapSize );
+ m_lastHeaderHeight = i_headerHeight;
+ m_lastArrowColor = i_style.GetActiveColor();
+ }
+ return rBitmap;
+ }
+ //==================================================================================================================
+ //= GridTableRenderer_Impl
+ //==================================================================================================================
struct GridTableRenderer_Impl
{
- ITableModel& rModel;
- RowPos nCurrentRow;
+ ITableModel& rModel;
+ RowPos nCurrentRow;
+ bool bUseGridLines;
+ CachedSortIndicator aSortIndicator;
GridTableRenderer_Impl( ITableModel& _rModel )
:rModel( _rModel )
,nCurrentRow( ROW_INVALID )
+ ,bUseGridLines( true )
{
}
};
- //====================================================================
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ static Rectangle lcl_getContentArea( GridTableRenderer_Impl const & i_impl, Rectangle const & i_cellArea )
+ {
+ Rectangle aContentArea( i_cellArea );
+ if ( i_impl.bUseGridLines )
+ {
+ --aContentArea.Right();
+ --aContentArea.Bottom();
+ }
+ return aContentArea;
+ }
+ static Rectangle lcl_getTextRenderingArea( Rectangle const & i_contentArea )
+ {
+ Rectangle aTextArea( i_contentArea );
+ aTextArea.Left() += 2; aTextArea.Right() -= 2;
+ ++aTextArea.Top(); --aTextArea.Bottom();
+ return aTextArea;
+ }
+
+ static sal_uLong lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
+ {
+ sal_uLong nVertFlag = TEXT_DRAW_TOP;
+ VerticalAlignment const eVertAlign = i_impl.rModel.getVerticalAlign();
+ switch ( eVertAlign )
+ {
+ case VerticalAlignment_MIDDLE: nVertFlag = TEXT_DRAW_VCENTER; break;
+ case VerticalAlignment_BOTTOM: nVertFlag = TEXT_DRAW_BOTTOM; break;
+ default:
+ break;
+ }
+
+ sal_uLong nHorzFlag = TEXT_DRAW_LEFT;
+ HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER: nHorzFlag = TEXT_DRAW_CENTER; break;
+ case HorizontalAlignment_RIGHT: nHorzFlag = TEXT_DRAW_RIGHT; break;
+ default:
+ break;
+ }
+
+ return nVertFlag | nHorzFlag;
+ }
+
+ }
+
+ //==================================================================================================================
//= GridTableRenderer
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::GridTableRenderer( ITableModel& _rModel )
:m_pImpl( new GridTableRenderer_Impl( _rModel ) )
{
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::~GridTableRenderer()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- RowPos GridTableRenderer::getCurrentRow()
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos GridTableRenderer::getCurrentRow() const
{
return m_pImpl->nCurrentRow;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::useGridLines() const
+ {
+ return m_pImpl->bUseGridLines;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::useGridLines( bool const i_use )
+ {
+ m_pImpl->bUseGridLines = i_use;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ Color lcl_getEffectiveColor(
+ ::boost::optional< ::Color > const & i_modelColor,
+ StyleSettings const & i_styleSettings,
+ ::Color const & ( StyleSettings::*i_getDefaultColor ) () const
+ )
+ {
+ if ( !!i_modelColor )
+ return *i_modelColor;
+ return ( i_styleSettings.*i_getDefaultColor )();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea, bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
const StyleSettings& _rStyle )
@@ -80,15 +238,18 @@ namespace svt { namespace table
OSL_PRECOND( _bIsColHeaderArea || _bIsRowHeaderArea,
"GridTableRenderer::PaintHeaderArea: invalid area flags!" );
- _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color background = m_pImpl->rModel.getHeaderBackgroundColor();
- if( background != 0xFFFFFF)
- _rDevice.SetFillColor(background);
- else
- _rDevice.SetFillColor(_rStyle.GetDialogColor());
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
+
+ Color const background = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderBackgroundColor(), _rStyle, &StyleSettings::GetDialogColor );
+ _rDevice.SetFillColor( background );
+
+ _rDevice.SetLineColor();
_rDevice.DrawRect( _rArea );
+
// delimiter lines at bottom/right
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
_rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
@@ -97,48 +258,73 @@ namespace svt { namespace table
(void)_bIsRowHeaderArea;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
{
_rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
String sHeaderText;
- PColumnModel pColumn = m_pImpl->rModel.getColumnModel( _nCol );
+ PColumnModel const pColumn = m_pImpl->rModel.getColumnModel( _nCol );
DBG_ASSERT( !!pColumn, "GridTableRenderer::PaintColumnHeader: invalid column model object!" );
if ( !!pColumn )
sHeaderText = pColumn->getName();
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, sHeaderText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+ _rDevice.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+
+ // draw sort indicator if the model data is sorted by the given column
+ ITableDataSort const * pSortAdapter = m_pImpl->rModel.getSortAdapter();
+ ColumnSort aCurrentSortOrder;
+ if ( pSortAdapter != NULL )
+ aCurrentSortOrder = pSortAdapter->getCurrentSortOrder();
+ if ( aCurrentSortOrder.nColumnPos == _nCol )
+ {
+ long const nHeaderHeight( _rArea.GetHeight() );
+ BitmapEx const aIndicatorBitmap = m_pImpl->aSortIndicator.getBitmapFor( _rDevice, nHeaderHeight, _rStyle,
+ aCurrentSortOrder.eSortDirection == ColumnSortAscending );
+ Size const aBitmapSize( aIndicatorBitmap.GetSizePixel() );
+ long const nSortIndicatorPaddingX = 2;
+ long const nSortIndicatorPaddingY = ( nHeaderHeight - aBitmapSize.Height() ) / 2;
+
+ if ( ( nDrawTextFlags & TEXT_DRAW_RIGHT ) != 0 )
+ {
+ // text is right aligned => draw the sort indicator at the left hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Left() + nSortIndicatorPaddingX, _rArea.Top() + nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ else
+ {
+ // text is left-aligned or centered => draw the sort indicator at the right hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Right() - nSortIndicatorPaddingX - aBitmapSize.Width(), nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ }
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active column at the moment
(void)_bSelected;
- //selection for column header not yet implemented
+ // selection for column header not yet implemented
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle )
{
@@ -147,238 +333,289 @@ namespace svt { namespace table
_rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color aRowBackground = m_pImpl->rModel.getOddRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- Color aRowBackground2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color fieldColor = _rStyle.GetFieldColor();
- if(aRowBackground == 0xFFFFFF)
- aRowBackground = fieldColor;
- if(aRowBackground2 == 0xFFFFFF)
- aRowBackground2 = fieldColor;
- //if row is selected background color becomes blue, and lines should be also blue
- //if they aren't user defined
- if(_bSelected)
+ ::Color backgroundColor = _rStyle.GetFieldColor();
+
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected )
{
- Color aSelected(_rStyle.GetHighlightColor());
- aRowBackground = aSelected;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
- else
- _rDevice.SetLineColor(line);
+ // selected rows use the background color from the style
+ backgroundColor = _rStyle.GetHighlightColor();
+ if ( !aLineColor )
+ lineColor = backgroundColor;
}
- //if row not selected, check the cases whether user defined backgrounds are set
- //and set line color to be the same
else
{
- if(aRowBackground2 != fieldColor && _nRow%2)
+ ::boost::optional< ::std::vector< ::Color > > aRowColors = m_pImpl->rModel.getRowBackgroundColors();
+ if ( !aRowColors )
{
- aRowBackground = aRowBackground2;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
+ // use alternating default colors
+ Color const fieldColor = _rStyle.GetFieldColor();
+ if ( _rStyle.GetHighContrastMode() || ( ( m_pImpl->nCurrentRow % 2 ) == 0 ) )
+ {
+ backgroundColor = fieldColor;
+ }
else
- _rDevice.SetLineColor(line);
+ {
+ Color hilightColor = _rStyle.GetHighlightColor();
+ hilightColor.SetRed( 9 * ( fieldColor.GetRed() - hilightColor.GetRed() ) / 10 + hilightColor.GetRed() );
+ hilightColor.SetGreen( 9 * ( fieldColor.GetGreen() - hilightColor.GetGreen() ) / 10 + hilightColor.GetGreen() );
+ hilightColor.SetBlue( 9 * ( fieldColor.GetBlue() - hilightColor.GetBlue() ) / 10 + hilightColor.GetBlue() );
+ backgroundColor = hilightColor;
+ }
}
- //fill the rows with alternating background colors if second background color is specified
- else if(aRowBackground != fieldColor && line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
else
{
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ if ( aRowColors->empty() )
+ {
+ // all colors have the same background color
+ backgroundColor = _rStyle.GetFieldColor();
+ }
+ else
+ {
+ backgroundColor = aRowColors->at( m_pImpl->nCurrentRow % aRowColors->size() );
+ }
}
}
- _rDevice.SetFillColor( aRowBackground );
- _rDevice.DrawRect( _rRowArea );
- // TODO: active?
+ //m_pImpl->bUseGridLines ? _rDevice.SetLineColor( lineColor ) : _rDevice.SetLineColor();
+ _rDevice.SetLineColor();
+ _rDevice.SetFillColor( backgroundColor );
+ _rDevice.DrawRect( _rRowArea );
_rDevice.Pop();
+
(void)_bActive;
+ // row containing the active cell not rendered any special at the moment
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintRowHeader( bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText )
+ const StyleSettings& _rStyle )
{
- _rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_TEXTCOLOR );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ Any const rowHeading( m_pImpl->rModel.getRowHeading( m_pImpl->nCurrentRow ) );
+ ::rtl::OUString const rowTitle( CellValueConversion::convertToString( rowHeading ) );
+ if ( rowTitle.getLength() )
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+ // TODO: is using the horizontal alignment of the 0'th column a good idea here? This is pretty ... arbitray ..
+ _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags );
+ }
+
// TODO: active? selected?
(void)_bActive;
(void)_bSelected;
- //at the moment no special paint for selected row header
_rDevice.Pop();
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellImage( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, Image* _pCellData )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR);
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ struct GridTableRenderer::CellRenderContext
+ {
+ OutputDevice& rDevice;
+ Rectangle const aContentArea;
+ StyleSettings const & rStyle;
+ ColPos const nColumn;
+ bool const bSelected;
+
+ CellRenderContext( OutputDevice& i_device, Rectangle const & i_contentArea,
+ StyleSettings const & i_style, ColPos const i_column, bool const i_selected )
+ :rDevice( i_device )
+ ,aContentArea( i_contentArea )
+ ,rStyle( i_style )
+ ,nColumn( i_column )
+ ,bSelected( i_selected )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
}
- //else set line color to the color of row background
- else
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool _bActive,
+ OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
+ {
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+
+ Rectangle const aContentArea( lcl_getContentArea( *m_pImpl, _rArea ) );
+ CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected );
+ impl_paintCellContent( aRenderContext );
+
+ if ( m_pImpl->bUseGridLines )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
- {
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected && !aLineColor )
{
- //if line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ // if no line color is specified by the model, use the usual selection color for lines in selected cells
+ lineColor = _rStyle.GetHighlightColor();
}
- }
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- Point imagePos(Point(aRect.Left(), aRect.Top()));
- Size imageSize = _pCellData->GetSizePixel();
- if(aRect.GetWidth() > imageSize.Width())
- {
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- imagePos.X() = aRect.Left()+((double)(aRect.GetWidth() - imageSize.Width()))/2;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- imagePos.X() = aRect.Right() - imageSize.Width();
- }
- else
- imageSize.Width() = aRect.GetWidth();
- if(aRect.GetHeight() > imageSize.Height())
- {
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- imagePos.Y() = aRect.Top()+((double)(aRect.GetHeight() - imageSize.Height()))/2;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- imagePos.Y() = aRect.Bottom() - imageSize.Height();
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
}
- else
- imageSize.Height() = aRect.GetHeight()-1;
- Image& image (*_pCellData);
- _rDevice.DrawImage(imagePos, imageSize, image, 0);
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active cell at the moment
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellString( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellImage( CellRenderContext const & i_context, Image const & i_image )
+ {
+ Point imagePos( Point( i_context.aContentArea.Left(), i_context.aContentArea.Top() ) );
+ Size imageSize = i_image.GetSizePixel();
+ if ( i_context.aContentArea.GetWidth() > imageSize.Width() )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
+ const HorizontalAlignment eHorzAlign = m_pImpl->rModel.getColumnModel( i_context.nColumn )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER:
+ imagePos.X() += ( i_context.aContentArea.GetWidth() - imageSize.Width() ) / 2;
+ break;
+ case HorizontalAlignment_RIGHT:
+ imagePos.X() = i_context.aContentArea.Right() - imageSize.Width();
+ break;
+ default:
+ break;
+ }
+
}
- //else set line color to the color of row background
else
+ imageSize.Width() = i_context.aContentArea.GetWidth();
+
+ if ( i_context.aContentArea.GetHeight() > imageSize.Height() )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
+ const VerticalAlignment eVertAlign = m_pImpl->rModel.getVerticalAlign();
+ switch ( eVertAlign )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
- {
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ case VerticalAlignment_MIDDLE:
+ imagePos.Y() += ( i_context.aContentArea.GetHeight() - imageSize.Height() ) / 2;
+ break;
+ case VerticalAlignment_BOTTOM:
+ imagePos.Y() = i_context.aContentArea.Bottom() - imageSize.Height();
+ break;
+ default:
+ break;
}
}
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
+ else
+ imageSize.Height() = i_context.aContentArea.GetHeight() - 1;
+
+ i_context.rDevice.DrawImage( imagePos, imageSize, i_image, 0 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellContent( CellRenderContext const & i_context )
+ {
+ Any aCellContent;
+ m_pImpl->rModel.getCellContent( i_context.nColumn, m_pImpl->nCurrentRow, aCellContent );
+
+ if ( aCellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( aCellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ // allowed. kind of.
+ return;
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- if(_bSelected)
- _rDevice.SetTextColor(_rStyle.GetHighlightTextColor());
- else if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
+ Reference< XGraphic > const xGraphic( aCellContent, UNO_QUERY );
+ ENSURE_OR_RETURN_VOID( xGraphic.is(), "GridTableRenderer::impl_paintCellContent: only XGraphic interfaces (or NULL) are supported for painting." );
+
+ const Image aImage( xGraphic );
+ impl_paintCellImage( i_context, aImage );
+ return;
+ }
+
+ const ::rtl::OUString sText( CellValueConversion::convertToString( aCellContent ) );
+ impl_paintCellText( i_context, sText );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellText( CellRenderContext const & i_context, ::rtl::OUString const & i_text )
+ {
+ if ( i_context.bSelected )
+ i_context.rDevice.SetTextColor( i_context.rStyle.GetHighlightTextColor() );
else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- ULONG nHorFlag = TEXT_DRAW_LEFT;
- ULONG nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle textRect(_rArea);
- textRect.Left()+=4; textRect.Right()-=4;
- textRect.Bottom()-=2;
- _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), i_context.rStyle, &StyleSettings::GetFieldTextColor );
+ i_context.rDevice.SetTextColor( textColor );
+ }
- _rDevice.Pop();
- (void)_bActive;
- // no special painting for the active cell at the moment
+ Rectangle const textRect( lcl_getTextRenderingArea( i_context.aContentArea ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+ i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
_rView.ShowFocus( _rCursorRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::HideCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
- (void)_rCursorRect;
+ (void)_rCursorRect;
_rView.HideFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::FitsIntoCell( Any const & i_cellContent, ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea )
+ {
+ if ( !i_cellContent.hasValue() )
+ return true;
+
+ if ( i_cellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( i_cellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ return true;
+
+ Reference< XGraphic > const xGraphic( i_cellContent, UNO_QUERY );
+ if ( xGraphic.is() )
+ // for the moment, assume it fits. We can always scale it down during painting ...
+ return true;
+
+ OSL_ENSURE( false, "GridTableRenderer::FitsIntoCell: only XGraphic interfaces (or NULL) are supported for painting." );
+ return true;
+ }
+
+ ::rtl::OUString const sText( CellValueConversion::convertToString( i_cellContent ) );
+ if ( sText.getLength() == 0 )
+ return true;
+
+ Rectangle const aTargetArea( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, i_targetArea ) ) );
+
+ long const nTextHeight = i_targetDevice.GetTextHeight();
+ if ( nTextHeight > aTargetArea.GetHeight() )
+ return false;
+
+ long const nTextWidth = i_targetDevice.GetTextWidth( sText );
+ if ( nTextWidth > aTargetArea.GetWidth() )
+ return false;
+ OSL_UNUSED( i_active );
+ OSL_UNUSED( i_selected );
+ OSL_UNUSED( i_rowPos );
+ OSL_UNUSED( i_colPos );
+ return true;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/makefile.mk b/svtools/source/table/makefile.mk
deleted file mode 100644
index 78c50f9eca4a..000000000000
--- a/svtools/source/table/makefile.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-ENABLE_EXCEPTIONS=TRUE
-PRJNAME=svtools
-TARGET=table
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES=\
- $(SLO)$/tablecontrol.obj \
- $(SLO)$/tablecontrol_impl.obj \
- $(SLO)$/gridtablerenderer.obj \
- $(SLO)$/tablegeometry.obj \
- $(SLO)$/defaultinputhandler.obj \
- $(SLO)$/tabledatawindow.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
new file mode 100755
index 000000000000..20d505e911e9
--- /dev/null
+++ b/svtools/source/table/mousefunction.cxx
@@ -0,0 +1,320 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svtools.hxx"
+
+#include "mousefunction.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <vcl/window.hxx>
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::acquire()
+ {
+ return osl_incrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::release()
+ {
+ oslInterlockedCount newCount = osl_decrementInterlockedCount( &m_refCount );
+ if ( newCount == 0 )
+ {
+ delete this;
+ return 0;
+ }
+ return newCount;
+ }
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ Point const aPoint = i_event.GetPosPixel();
+
+ if ( m_nResizingColumn == COL_INVALID )
+ {
+ // if we hit a column divider, change the mosue pointer accordingly
+ Pointer aNewPointer( POINTER_ARROW );
+ TableCell const tableCell = i_tableControl.hitTest( aPoint );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.eArea == ColumnDivider ) )
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ return SkipFunction; // TODO: is this correct?
+ }
+
+ ::Size const tableSize = i_tableControl.getTableSizePixel();
+
+ // set proper pointer
+ Pointer aNewPointer( POINTER_ARROW );
+ ColumnMetrics const & columnMetrics( i_tableControl.getColumnMetrics( m_nResizingColumn ) );
+ if ( ( aPoint.X() > tableSize.Width() )
+ || ( aPoint.X() < columnMetrics.nStartPixel )
+ )
+ {
+ aNewPointer = Pointer( POINTER_NOTALLOWED );
+ }
+ else
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ // show tracking line
+ i_tableControl.hideTracking();
+ i_tableControl.showTracking(
+ Rectangle(
+ Point( aPoint.X(), 0 ),
+ Size( 1, tableSize.Height() )
+ ),
+ SHOWTRACK_SPLIT | SHOWTRACK_WINDOW
+ );
+
+ (void)i_event;
+ return ContinueFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnResize::handleMouseDown: suspicious: MouseButtonDown while still tracking?" );
+ return ContinueFunction;
+ }
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow == ROW_COL_HEADERS )
+ {
+ if ( ( tableCell.nColumn != COL_INVALID )
+ && ( tableCell.eArea == ColumnDivider )
+ )
+ {
+ m_nResizingColumn = tableCell.nColumn;
+ i_tableControl.captureMouse();
+ return ActivateFunction;
+ }
+ }
+
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn == COL_INVALID )
+ return SkipFunction;
+
+ Point const aPoint = i_event.GetPosPixel();
+
+ i_tableControl.hideTracking();
+ PColumnModel const pColumn = i_tableControl.getModel()->getColumnModel( m_nResizingColumn );
+ long const maxWidthLogical = pColumn->getMaxWidth();
+ long const minWidthLogical = pColumn->getMinWidth();
+
+ // new position of mouse
+ long const requestedEnd = aPoint.X();
+
+ // old position of right border
+ long const oldEnd = i_tableControl.getColumnMetrics( m_nResizingColumn ).nEndPixel;
+
+ // position of left border if cursor in the to-be-resized column
+ long const columnStart = i_tableControl.getColumnMetrics( m_nResizingColumn ).nStartPixel;
+ long const requestedWidth = requestedEnd - columnStart;
+ // TODO: this is not correct, strictly: It assumes that the mouse was pressed exactly on the "end" pos,
+ // but for a while now, we have relaxed this, and allow clicking a few pixels aside, too
+
+ if ( requestedEnd >= columnStart )
+ {
+ long requestedWidthLogical = i_tableControl.pixelWidthToAppFont( requestedWidth );
+ // respect column width limits
+ if ( oldEnd > requestedEnd )
+ {
+ // column has become smaller, check against minimum width
+ if ( ( minWidthLogical != 0 ) && ( requestedWidthLogical < minWidthLogical ) )
+ requestedWidthLogical = minWidthLogical;
+ }
+ else if ( oldEnd < requestedEnd )
+ {
+ // column has become larger, check against max width
+ if ( ( maxWidthLogical != 0 ) && ( requestedWidthLogical >= maxWidthLogical ) )
+ requestedWidthLogical = maxWidthLogical;
+ }
+ pColumn->setWidth( requestedWidthLogical );
+ i_tableControl.invalidate( TableAreaAll );
+ }
+
+ i_tableControl.setPointer( Pointer() );
+ i_tableControl.releaseMouse();
+
+ m_nResizingColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ bool handled = false;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow >= 0 )
+ {
+ bool bSetCursor = false;
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() == NO_SELECTION )
+ {
+ bSetCursor = true;
+ }
+ else
+ {
+ if ( !i_tableControl.isRowSelected( tableCell.nRow ) )
+ {
+ handled = i_tableControl.getSelEngine()->SelMouseButtonDown( i_event );
+ }
+ else
+ {
+ bSetCursor = true;
+ }
+ }
+
+ if ( bSetCursor )
+ {
+ i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow );
+ handled = true;
+ }
+ }
+
+ if ( handled )
+ m_bActive = true;
+ return handled ? ActivateFunction : SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ TableCell const tableCell = i_tableControl.hitTest( i_event.GetPosPixel() );
+ if ( tableCell.nRow >= 0 )
+ {
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION )
+ {
+ i_tableControl.getSelEngine()->SelMouseButtonUp( i_event );
+ }
+ }
+ if ( m_bActive )
+ {
+ m_bActive = false;
+ return DeactivateFunction;
+ }
+ return SkipFunction;
+ }
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnSortHandler::handleMouseDown: called while already active - suspicious!" );
+ return ContinueFunction;
+ }
+
+ if ( i_tableControl.getModel()->getSortAdapter() == NULL )
+ // no sorting support at the model
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow != ROW_COL_HEADERS ) || ( tableCell.nColumn < 0 ) )
+ return SkipFunction;
+
+ // TODO: ensure the column header is rendered in some special way, indicating its current state
+
+ m_nActiveColumn = tableCell.nColumn;
+ return ActivateFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn == COL_INVALID )
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.nColumn == m_nActiveColumn ) )
+ {
+ ITableDataSort* pSort = i_tableControl.getModel()->getSortAdapter();
+ ENSURE_OR_RETURN( pSort != NULL, "ColumnSortHandler::handleMouseUp: somebody is mocking with us!", DeactivateFunction );
+ // in handleMousButtonDown, the model claimed to have sort support ...
+
+ ColumnSortDirection eSortDirection = ColumnSortAscending;
+ ColumnSort const aCurrentSort = pSort->getCurrentSortOrder();
+ if ( aCurrentSort.nColumnPos == m_nActiveColumn )
+ // invert existing sort order
+ eSortDirection = ( aCurrentSort.eSortDirection == ColumnSortAscending ) ? ColumnSortDescending : ColumnSortAscending;
+
+ pSort->sortByColumn( m_nActiveColumn, eSortDirection );
+ }
+
+ m_nActiveColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
diff --git a/svtools/source/table/mousefunction.hxx b/svtools/source/table/mousefunction.hxx
new file mode 100755
index 000000000000..2149026a0923
--- /dev/null
+++ b/svtools/source/table/mousefunction.hxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_MOUSEFUNCTION_HXX
+#define SVTOOLS_MOUSEFUNCTION_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class MouseEvent;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ class ITableControl;
+
+ //==================================================================================================================
+ //= FunctionResult
+ //==================================================================================================================
+ enum FunctionResult
+ {
+ ActivateFunction,
+ ContinueFunction,
+ DeactivateFunction,
+
+ SkipFunction
+ };
+
+ //==================================================================================================================
+ //= IMouseFunction
+ //==================================================================================================================
+ class IMouseFunction : public ::rtl::IReference, public ::boost::noncopyable
+ {
+ public:
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+
+ protected:
+ virtual ~IMouseFunction() { }
+ };
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ class MouseFunction : public IMouseFunction
+ {
+ public:
+ MouseFunction()
+ :m_refCount( 0 )
+ {
+ }
+ protected:
+ ~MouseFunction()
+ {
+ }
+
+ public:
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ class ColumnResize : public MouseFunction
+ {
+ public:
+ ColumnResize()
+ :m_nResizingColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nResizingColumn;
+ };
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ class RowSelection : public MouseFunction
+ {
+ public:
+ RowSelection()
+ :m_bActive( false )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ bool m_bActive;
+ };
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ class ColumnSortHandler : public MouseFunction
+ {
+ public:
+ ColumnSortHandler()
+ :m_nActiveColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nActiveColumn;
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_MOUSEFUNCTION_HXX
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index 2cbf8c8628f2..6ec1ec5e7121 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -29,54 +29,38 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
+
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
-#include "accessibletableimp.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+#include "tabledatawindow.hxx"
+
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star::uno;
using ::com::sun::star::accessibility::XAccessible;
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::lang;
using namespace utl;
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
- //====================================================================
- //= AccessibleTableControl_Impl
- //====================================================================
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTableHeader( AccessibleTableControlObjType _eObjType )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTableHeader( _eObjType );
- return NULL;
- }
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTable( )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTable( );
- return NULL;
- }
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableControl
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::TableControl( Window* _pParent, WinBits _nStyle )
:Control( _pParent, _nStyle )
,m_pImpl( new TableControl_Impl( *this ) )
- ,m_bSelectionChanged(false)
- ,m_bTooltip(false)
{
- TableDataWindow* aTableData = m_pImpl->getDataWindow();
- aTableData->SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
- aTableData->SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
- aTableData->SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
- m_pAccessTable.reset(new ::svt::table::AccessibleTableControl_Impl());
+ TableDataWindow& rDataWindow = m_pImpl->getDataWindow();
+ rDataWindow.SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
+ rDataWindow.SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
+ rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -84,51 +68,39 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::~TableControl()
{
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
- DELETEZ( m_pImpl );
- if ( m_pAccessTable->m_pAccessible )
- {
- m_pAccessTable->m_pAccessible->dispose();
- }
+
+ m_pImpl->setModel( PTableModel() );
+ m_pImpl->disposeAccessible();
+ m_pImpl.reset();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::GetFocus()
{
if ( !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) )
- {
Control::GetFocus();
- Control::GrabFocus();
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::LoseFocus()
{
if ( !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) )
Control::LoseFocus();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::KeyInput( const KeyEvent& rKEvt )
{
if ( !m_pImpl->getInputHandler()->KeyInput( *m_pImpl, rKEvt ) )
Control::KeyInput( rKEvt );
- else
- {
- if(m_bSelectionChanged)
- {
- Select();
- m_bSelectionChanged = false;
- }
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::StateChanged( StateChangedType i_nStateChange )
{
Control::StateChanged( i_nStateChange );
@@ -138,156 +110,180 @@ namespace svt { namespace table
{
case STATE_CHANGE_CONTROLBACKGROUND:
if ( IsControlBackground() )
- getDataWindow()->SetControlBackground( GetControlBackground() );
+ getDataWindow().SetControlBackground( GetControlBackground() );
else
- getDataWindow()->SetControlBackground();
+ getDataWindow().SetControlBackground();
break;
case STATE_CHANGE_CONTROLFOREGROUND:
if ( IsControlForeground() )
- getDataWindow()->SetControlForeground( GetControlForeground() );
+ getDataWindow().SetControlForeground( GetControlForeground() );
else
- getDataWindow()->SetControlForeground();
+ getDataWindow().SetControlForeground();
break;
case STATE_CHANGE_CONTROLFONT:
if ( IsControlFont() )
- getDataWindow()->SetControlFont( GetControlFont() );
+ getDataWindow().SetControlFont( GetControlFont() );
else
- getDataWindow()->SetControlFont();
+ getDataWindow().SetControlFont();
break;
}
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::Resize()
{
Control::Resize();
m_pImpl->onResize();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetModel( PTableModel _pModel )
{
m_pImpl->setModel( _pModel );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
PTableModel TableControl::GetModel() const
{
return m_pImpl->getModel();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
RowPos TableControl::GetTopRow() const
{
return m_pImpl->getTopRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetTopRow( RowPos _nRow )
{
- // TODO
- (void)_nRow;
+ OSL_ENSURE( false, "TableControl::SetTopRow: not implemented!" );
+ OSL_UNUSED( _nRow );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentRow() const
{
- return m_pImpl->getCurRow();
+ return m_pImpl->getCurrentRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentColumn() const
{
- return m_pImpl->getCurColumn();
+ return m_pImpl->getCurrentColumn();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
bool TableControl::GoTo( ColPos _nColumn, RowPos _nRow )
{
return m_pImpl->goTo( _nColumn, _nRow );
}
- //--------------------------------------------------------------------
+
+ // -----------------------------------------------------------------------------------------------------------------
sal_Bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos)
{
return m_pImpl->goTo( _nColPos, _nRowPos );
}
- //--------------------------------------------------------------------
- void TableControl::clearSelection()
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowCount() const
+ {
+ return sal_Int32( m_pImpl->getSelectedRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const
{
- m_pImpl->clearSelection();
+ return sal_Int32( m_pImpl->getSelectedRowIndex( i_selectionIndex ) );
}
- //--------------------------------------------------------------------
- void TableControl::InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl::IsRowSelected( sal_Int32 const i_rowIndex ) const
{
- Rectangle _rRect;
- if(_bRemoved)
- m_pImpl->invalidateRows();
+ return m_pImpl->isRowSelected( i_rowIndex );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectRow( RowPos const i_rowIndex, bool const i_select )
+ {
+ ENSURE_OR_RETURN_VOID( ( i_rowIndex >= 0 ) && ( i_rowIndex < m_pImpl->getModel()->getRowCount() ),
+ "TableControl::SelectRow: no control (anymore)!" );
+
+ if ( i_select )
+ {
+ if ( !m_pImpl->markRowAsSelected( i_rowIndex ) )
+ // nothing to do
+ return;
+ }
else
{
- if(m_bSelectionChanged)
- {
- m_pImpl->invalidateSelectedRegion(_nRowStart, _nRowEnd, _rRect);
- m_bSelectionChanged = false;
- }
- else
- m_pImpl->invalidateRow(_nRowStart, _rRect);
+ m_pImpl->markRowAsDeselected( i_rowIndex );
}
+
+ m_pImpl->invalidateRowRange( i_rowIndex, i_rowIndex );
+ Select();
}
- //--------------------------------------------------------------------
- std::vector<sal_Int32>& TableControl::GetSelectedRows()
- {
- return m_pImpl->getSelectedRows();
- }
- //--------------------------------------------------------------------
- void TableControl::RemoveSelectedRow(RowPos _nRowPos)
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectAllRows( bool const i_select )
{
- m_pImpl->removeSelectedRow(_nRowPos);
+ if ( i_select )
+ {
+ if ( !m_pImpl->markAllRowsAsSelected() )
+ // nothing to do
+ return;
+ }
+ else
+ {
+ if ( !m_pImpl->markAllRowsAsDeselected() )
+ // nothing to do
+ return;
+ }
+
+
+ Invalidate();
+ // TODO: can't we do better than this, and invalidate only the rows which changed?
+ Select();
}
- //--------------------------------------------------------------------
- RowPos TableControl::GetCurrentRow(const Point& rPoint)
+ // -----------------------------------------------------------------------------------------------------------------
+ ITableControl& TableControl::getTableControlInterface()
{
- return m_pImpl->getCurrentRow( rPoint );
+ return *m_pImpl;
}
+ // -----------------------------------------------------------------------------------------------------------------
SelectionEngine* TableControl::getSelEngine()
{
return m_pImpl->getSelEngine();
}
- TableDataWindow* TableControl::getDataWindow()
+ // -----------------------------------------------------------------------------------------------------------------
+ Window& TableControl::getDataWindow()
{
return m_pImpl->getDataWindow();
}
+ // -----------------------------------------------------------------------------------------------------------------
Reference< XAccessible > TableControl::CreateAccessible()
{
Window* pParent = GetAccessibleParentWindow();
- DBG_ASSERT( pParent, "TableControl::CreateAccessible - parent not found" );
+ ENSURE_OR_RETURN( pParent, "TableControl::CreateAccessible - parent not found", NULL );
- if( pParent && !m_pAccessTable->m_pAccessible)
- {
- Reference< XAccessible > xAccParent = pParent->GetAccessible();
- if( xAccParent.is() )
- {
- m_pAccessTable->m_pAccessible = getAccessibleFactory().createAccessibleTableControl(
- xAccParent, *this
- );
- }
- }
- Reference< XAccessible > xAccessible;
- if ( m_pAccessTable->m_pAccessible )
- xAccessible = m_pAccessTable->m_pAccessible->getMyself();
- return xAccessible;
+ return m_pImpl->getAccessible( *pParent );
}
+
+ // -----------------------------------------------------------------------------------------------------------------
Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex )
{
(void)_nIndex;
- DBG_ASSERT( FALSE, "TableControl::CreateAccessibleControl: to be overwritten!" );
+ DBG_ASSERT( sal_False, "TableControl::CreateAccessibleControl: to be overwritten!" );
return NULL;
}
+
+ // -----------------------------------------------------------------------------------------------------------------
::rtl::OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const
{
::rtl::OUString aRetText;
@@ -320,311 +316,298 @@ namespace svt { namespace table
}
return aRetText;
}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
-{
- ::rtl::OUString aRetText;
- switch( eObjType )
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
{
- case TCTYPE_GRIDCONTROL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
- break;
- case TCTYPE_TABLE:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
- break;
- case TCTYPE_ROWHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
- break;
- case TCTYPE_TABLECELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
- break;
- case TCTYPE_ROWHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
- break;
+ ::rtl::OUString aRetText;
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
+ break;
+ case TCTYPE_TABLE:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
+ break;
+ case TCTYPE_TABLECELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
+ break;
+ }
+ return aRetText;
}
- return aRetText;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
-{
- (void)_nRow;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
+ {
+ (void)_nRow;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
+ }
-::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
-{
- return GetModel()->getRowHeaderName()[_nIndex];
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
+ {
+ ::rtl::OUString sRowName;
+ GetModel()->getRowHeading( _nIndex ) >>= sRowName;
+ return sRowName;
+ }
-::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
-{
- (void)_nColumn;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
+ {
+ (void)_nColumn;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
+ }
-::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
-{
- return GetModel()->getColumnModel(_nIndex)->getName();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
+ {
+ return GetModel()->getColumnModel(_nIndex)->getName();
+ }
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos ) const
+ {
+ Any aCellContent;
+ GetModel()->getCellContent( _nColPos, _nRowPos, aCellContent );
+ return aCellContent;
+ }
-::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- ::com::sun::star::uno::Any cellContent(::com::sun::star::uno::Any(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")) ));
- std::vector<std::vector< ::com::sun::star::uno::Any > >& aTableContent = GetModel()->getCellContent();
- if(&aTableContent)
- cellContent = aTableContent[_nRowPos][_nColPos];
- return cellContent;
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- const ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos);
- return m_pImpl->convertToString(cellContent);
-}
-// -----------------------------------------------------------------------------
-
-void TableControl::FillAccessibleStateSet(
- ::utl::AccessibleStateSetHelper& rStateSet,
- AccessibleTableControlObjType eObjType ) const
-{
- switch( eObjType )
- {
- case TCTYPE_GRIDCONTROL:
- case TCTYPE_TABLE:
-
- rStateSet.AddState( AccessibleStateType::FOCUSABLE );
- rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
- if ( HasFocus() )
- rStateSet.AddState( AccessibleStateType::FOCUSED );
- if ( IsActive() )
- rStateSet.AddState( AccessibleStateType::ACTIVE );
- if ( IsEnabled() )
- rStateSet.AddState( AccessibleStateType::ENABLED );
- if ( IsReallyVisible() )
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
+ {
+ return m_pImpl->getCellContentAsString( _nRowPos, _nColPos );
+ }
- break;
- case TCTYPE_ROWHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_TABLECELL:
- {
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const
+ {
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ case TCTYPE_TABLE:
+
+ rStateSet.AddState( AccessibleStateType::FOCUSABLE );
+ rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
+ if ( HasFocus() )
+ rStateSet.AddState( AccessibleStateType::FOCUSED );
+ if ( IsActive() )
+ rStateSet.AddState( AccessibleStateType::ACTIVE );
+ if ( IsEnabled() )
+ rStateSet.AddState( AccessibleStateType::ENABLED );
+ if ( IsReallyVisible() )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_TABLECELL:
+ {
+ rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ rStateSet.AddState( AccessibleStateType::SELECTABLE);
+ if( GetSelectedRowCount()>0)
+ rStateSet.AddState( AccessibleStateType::SELECTED);
+ }
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
rStateSet.AddState( AccessibleStateType::TRANSIENT );
- rStateSet.AddState( AccessibleStateType::SELECTABLE);
- if( GetSelectedRowCount()>0)
- rStateSet.AddState( AccessibleStateType::SELECTED);
- }
- break;
- case TCTYPE_ROWHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::TRANSIENT );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- break;
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ break;
+ }
}
-}
-Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
-{
- return Control::GetWindowExtentsRelative( pRelativeWindow );
-}
-//-----------------------------------------------------------------------------
-void TableControl::GrabFocus()
-{
- Control::GrabFocus();
-}
-// -----------------------------------------------------------------------------
-Reference< XAccessible > TableControl::GetAccessible( BOOL bCreate )
-{
- return Control::GetAccessible( bCreate );
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetAccessibleParentWindow() const
-{
- return Control::GetAccessibleParentWindow();
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetWindowInstance()
-{
- return this;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
+ {
+ return Control::GetWindowExtentsRelative( pRelativeWindow );
+ }
-sal_Bool TableControl::HasRowHeader()
-{
- return GetModel()->hasRowHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Bool TableControl::HasColHeader()
-{
- return GetModel()->hasColumnHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Int32 TableControl::GetAccessibleControlCount() const
-{
- sal_Int32 count = 0;
- if(GetRowCount()>0)
- count+=1;
- if(GetModel()->hasRowHeaders())
- count+=1;
- if(GetModel()->hasColumnHeaders())
- count+=1;
- return count;
-}
-sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
-{
- sal_Int32 nRow = m_pImpl->getCurrentRow(_rPoint);
- sal_Int32 nCol = GetCurrentColumn();
- _rnIndex = nRow * GetColumnCount() + nCol;
- return nRow>=0 ? sal_True : sal_False;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::GrabFocus()
+ {
+ Control::GrabFocus();
+ }
-long TableControl::GetRowCount() const
-{
- return m_pImpl->getRowCount();
-}
-long TableControl::GetColumnCount() const
-{
- return m_pImpl->getColumnCount();
-}
-sal_Bool TableControl::HasRowHeader() const
-{
- PTableModel pModel = GetModel();
- return pModel->hasRowHeaders();
-}
-sal_Int32 TableControl::GetSelectedRowCount() const
-{
- return m_pImpl->getSelectedRows().size();
-}
-bool TableControl::IsRowSelected( long _nRow ) const
-{
- return m_pImpl->isRowSelected(m_pImpl->getSelectedRows(), _nRow);
-}
-sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
-{
- _rnRow = m_pImpl->getCurrentRow(_rPoint);
- _rnColPos = GetCurrentColumn();
- return _rnRow>=0 ? sal_True : sal_False;
-}
-void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
-{
- if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
- _rStateSet.AddState( AccessibleStateType::FOCUSED );
- else // only transient when column is not focused
- _rStateSet.AddState( AccessibleStateType::TRANSIENT );
-}
-Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetCharacterBounds(nIndex);
-}
-sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetIndexForPoint(_rPoint);
-;
-}
- // -----------------------------------------------------------------------------
-sal_Bool TableControl::isAccessibleAlive( ) const
-{
- return ( NULL != m_pAccessTable->m_pAccessible ) && m_pAccessTable->m_pAccessible->isAlive();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate )
+ {
+ return Control::GetAccessible( bCreate );
+ }
-// -----------------------------------------------------------------------------
-::svt::IAccessibleFactory& TableControl::getAccessibleFactory()
-{
- return m_pAccessTable->m_aFactoryAccess.getFactory();
-}
-// -----------------------------------------------------------------------------
-void TableControl::commitGridControlEvent( sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
-{
- if ( isAccessibleAlive() )
- m_pAccessTable->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,BOOL _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcHeaderRect(_bIsColumnBar);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcTableRect(BOOL _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcTableRect();
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< sal_Int32 >& TableControl::getColumnsForTooltip()
-{
- return m_nCols;
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString >& TableControl::getTextForTooltip()
-{
- return m_aText;
-}
-//--------------------------------------------------------------------
-void TableControl::setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols )
-{
- m_aText = aText;
- m_nCols = nCols;
- m_bTooltip = true;
-}
-// -----------------------------------------------------------------------
-void TableControl::selectionChanged(bool _bChanged)
-{
- m_bSelectionChanged = _bChanged;
-}
-// -----------------------------------------------------------------------
-bool TableControl::isTooltip()
-{
- return m_bTooltip;
-}
-// -----------------------------------------------------------------------
-IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
-{
- Select();
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
- return 1;
-}
-// -----------------------------------------------------------------------
-void TableControl::Select()
-{
- ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_aSelectHdl, this );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetAccessibleParentWindow() const
+ {
+ return Control::GetAccessibleParentWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetWindowInstance()
+ {
+ return this;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader()
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasColHeader()
+ {
+ return GetModel()->hasColumnHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetAccessibleControlCount() const
+ {
+ sal_Int32 count = 0;
+ if(GetRowCount()>0)
+ count+=1;
+ if(GetModel()->hasRowHeaders())
+ count+=1;
+ if(GetModel()->hasColumnHeaders())
+ count+=1;
+ return count;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
+ {
+ sal_Int32 nRow = m_pImpl->getRowAtPoint( _rPoint );
+ sal_Int32 nCol = m_pImpl->getColAtPoint( _rPoint );
+ _rnIndex = nRow * GetColumnCount() + nCol;
+ return nRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetRowCount() const
+ {
+ return GetModel()->getRowCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetColumnCount() const
+ {
+ return GetModel()->getColumnCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader() const
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
+ {
+ _rnRow = m_pImpl->getRowAtPoint( _rPoint );
+ _rnColPos = m_pImpl->getColAtPoint( _rPoint );
+ return _rnRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
+ {
+ if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
+ _rStateSet.AddState( AccessibleStateType::FOCUSED );
+ else // only transient when column is not focused
+ _rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetCharacterBounds(nIndex);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetIndexForPoint(_rPoint);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcTableRect();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
+ {
+ Select();
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::Select()
+ {
+ ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this );
+ }
//........................................................................
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::SetSelectHdl( const Link& i_selectHandler )
+ {
+ m_pImpl->setSelectHandler( i_selectHandler );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const Link& TableControl::GetSelectHdl() const
+ {
+ return m_pImpl->getSelectHandler();
+ }
}} // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index a02dd9a2a50d..bbcdbfaddeb6 100644..100755
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -31,40 +31,60 @@
#include "svtools/table/tablecontrol.hxx"
#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablemodel.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
#include "tablegeometry.hxx"
-#include "svtools/table/tabledatawindow.hxx"
-#include <com/sun/star/awt/XControl.hpp>
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/flagguard.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/seleng.hxx>
#include <rtl/ref.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include <vcl/image.hxx>
-#include <com/sun/star/graphic/XGraphic.hpp>
+#include <tools/diagnose_ex.h>
#include <functional>
-#include <stdlib.h>
-//........................................................................
+#define MIN_COLUMN_WIDTH_PIXEL 4
+
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
-
- //====================================================================
- //= TempHideCursor
- //====================================================================
- class TempHideCursor
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::accessibility::AccessibleTableModelChange;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::uno::Reference;
+ /** === end UNO using === **/
+ namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId;
+ namespace AccessibleTableModelChangeType = ::com::sun::star::accessibility::AccessibleTableModelChangeType;
+
+ //==================================================================================================================
+ //= SuppressCursor
+ //==================================================================================================================
+ class SuppressCursor
{
private:
- IAbstractTableControl& m_rTable;
+ ITableControl& m_rTable;
public:
- TempHideCursor( IAbstractTableControl& _rTable )
+ SuppressCursor( ITableControl& _rTable )
:m_rTable( _rTable )
{
m_rTable.hideCursor();
}
- ~TempHideCursor()
+ ~SuppressCursor()
{
m_rTable.showCursor();
}
@@ -103,50 +123,18 @@ namespace svt { namespace table
{
return false;
}
- virtual void setRowHeaders(bool _bRowHeaders)
- {
- (void)_bRowHeaders;
- }
- virtual void setColumnHeaders(bool _bColumnHeaders)
- {
- (void)_bColumnHeaders;
- }
- void setColumnCount(TableSize _nColCount)
- {
- (void) _nColCount;
- }
- void setRowCount(TableSize _nRowCount)
- {
- (void)_nRowCount;
- }
virtual bool isCellEditable( ColPos col, RowPos row ) const
{
(void)col;
(void)row;
return false;
}
- virtual void addTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
- virtual void removeTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
virtual PColumnModel getColumnModel( ColPos column )
{
OSL_FAIL( "EmptyTableModel::getColumnModel: invalid call!" );
(void)column;
return PColumnModel();
}
- virtual PColumnModel getColumnModelByID( ColumnID id )
- {
- OSL_FAIL( "EmptyTableModel::getColumnModel: invalid call!" );
- (void)id;
- return PColumnModel();
- }
virtual PTableRenderer getRenderer() const
{
return PTableRenderer();
@@ -171,83 +159,68 @@ namespace svt { namespace table
{
return 0;
}
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
}
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
+ }
+ virtual void addTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual void removeTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual ::boost::optional< ::Color > getLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::std::vector< ::Color > > getRowBackgroundColors() const
+ {
+ return ::boost::optional< ::std::vector< ::Color > >();
+ }
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const
+ {
+ return com::sun::star::style::VerticalAlignment(0);
+ }
+ virtual ITableDataSort* getSortAdapter()
+ {
+ return NULL;
+ }
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent )
+ {
+ (void)i_row;
+ (void)i_col;
+ o_cellContent.clear();
+ }
+ virtual void getCellToolTip( ColPos const, RowPos const, ::com::sun::star::uno::Any& )
+ {
+ }
+ virtual Any getRowHeading( RowPos const i_rowPos ) const
+ {
+ (void)i_rowPos;
+ return Any();
}
- virtual bool hasVerticalScrollbar()
- {
- return false;
- }
- virtual bool hasHorizontalScrollbar()
- {
- return false;
- }
- virtual void setCellContent(const std::vector<std::vector< ::com::sun::star::uno::Any > >& )
- {
- }
- virtual ::com::sun::star::util::Color getLineColor()
- {
- return 0;
- }
- virtual void setLineColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor()
- {
- return -1;
- }
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getTextColor()
- {
- return 0;
- }
- virtual void setTextColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor()
- {
- return -1;
- }
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign()
- {
- return com::sun::star::style::VerticalAlignment(0);
- }
- virtual void setVerticalAlign(com::sun::star::style::VerticalAlignment )
- {
- }
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor()
- {
- return -1;
- }
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual std::vector<std::vector< ::com::sun::star::uno::Any > >& getCellContent()
- {
- return m_aCellContent;
- }
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& )
- {
- }
- virtual std::vector<rtl::OUString>& getRowHeaderName()
- {
- aRowHeaderNames.clear();
- aRowHeaderNames.push_back( rtl::OUString() );
- return aRowHeaderNames;
- }
- private:
- std::vector<rtl::OUString> aRowHeaderNames;
- std::vector<std::vector< ::com::sun::star::uno::Any > > m_aCellContent;
};
@@ -313,7 +286,7 @@ namespace svt { namespace table
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
const sal_Char* TableControl_Impl::impl_checkInvariants() const
{
if ( !m_pModel )
@@ -328,12 +301,9 @@ namespace svt { namespace table
if ( m_pModel->getRowCount() != m_nRowCount )
return "row counts are inconsistent!";
- if ( ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidthsPixel.empty() && ( m_nCurColumn < 0 ) ) || ( m_nCurColumn >= (ColPos)m_aColumnWidthsPixel.size() ) )
+ if ( ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidths.empty() && ( m_nCurColumn < 0 ) ) || ( m_nCurColumn >= (ColPos)m_aColumnWidths.size() ) )
return "current column is invalid!";
- if ( m_aColumnWidthsPixel.size() != m_aAccColumnWidthsPixel.size() )
- return "columnd width caches are inconsistent!";
-
if ( !lcl_checkLimitsExclusive_OrDefault_OrFallback( m_nTopRow, (RowPos)-1, m_nRowCount, getModel(), (RowPos)0 ) )
return "invalid top row value!";
@@ -349,6 +319,20 @@ namespace svt { namespace table
if ( m_pInputHandler != m_pModel->getInputHandler() )
return "input handler is not the model-provided one!";
+ // m_aSelectedRows should have reasonable content
+ {
+ if ( m_aSelectedRows.size() > size_t( m_pModel->getRowCount() ) )
+ return "there are more rows selected than actually exist";
+ for ( ::std::vector< RowPos >::const_iterator selRow = m_aSelectedRows.begin();
+ selRow != m_aSelectedRows.end();
+ ++selRow
+ )
+ {
+ if ( ( *selRow < 0 ) || ( *selRow >= m_pModel->getRowCount() ) )
+ return "a non-existent row is selected";
+ }
+ }
+
// m_nColHeaderHeightPixel consistent with the model's value?
{
TableMetrics nHeaderHeight = m_pModel->hasColumnHeaders() ? m_pModel->getColumnHeaderHeight() : 0;
@@ -374,7 +358,28 @@ namespace svt { namespace table
return "row header widths are inconsistent!";
}
- // TODO: check m_aColumnWidthsPixel and m_aAccColumnWidthsPixel
+ // m_aColumnWidths consistency
+ if ( size_t( m_nColumnCount ) != m_aColumnWidths.size() )
+ return "wrong number of cached column widths";
+
+ for ( ColumnPositions::const_iterator col = m_aColumnWidths.begin();
+ col != m_aColumnWidths.end();
+ )
+ {
+ if ( col->getEnd() < col->getStart() )
+ return "column widths: 'end' is expected to not be smaller than start";
+
+ ColumnPositions::const_iterator nextCol = col + 1;
+ if ( nextCol != m_aColumnWidths.end() )
+ if ( col->getEnd() != nextCol->getStart() )
+ return "column widths: one column's end should be the next column's start";
+ col = nextCol;
+ }
+
+ if ( m_nLeftColumn < m_nColumnCount )
+ if ( m_aColumnWidths[ m_nLeftColumn ].getStart() != m_nRowHeaderWidthPixel )
+ return "the left-most column should start immediately after the row header";
+
if ( m_nCursorHidden < 0 )
return "invalid hidden count for the cursor!";
@@ -383,6 +388,8 @@ namespace svt { namespace table
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
// prevent infinite recursion
+ if ( m_nLeftColumn < 0 )
+ return "invalid left-most column index";
if ( m_pVScroll->GetThumbPos() != m_nTopRow )
return "vertical scroll bar |position| is incorrect!";
if ( m_pVScroll->GetRange().Max() != m_nRowCount )
@@ -411,44 +418,44 @@ namespace svt { namespace table
#define DBG_CHECK_ME() \
DBG_CHKTHIS( TableControl_Impl, TableControl_Impl_checkInvariants )
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::TableControl_Impl( TableControl& _rAntiImpl )
:m_rAntiImpl ( _rAntiImpl )
,m_pModel ( new EmptyTableModel )
,m_pInputHandler ( )
,m_nRowHeightPixel ( 15 )
- ,m_nColHeaderHeightPixel( 0 )
+ ,m_nColHeaderHeightPixel( 0 )
,m_nRowHeaderWidthPixel ( 0 )
,m_nColumnCount ( 0 )
,m_nRowCount ( 0 )
+ ,m_bColumnsFit ( true )
,m_nCurColumn ( COL_INVALID )
,m_nCurRow ( ROW_INVALID )
,m_nLeftColumn ( 0 )
- ,m_nTopRow ( 0 )
+ ,m_nTopRow ( 0 )
,m_nCursorHidden ( 1 )
,m_pDataWindow ( new TableDataWindow( *this ) )
- ,m_pVScroll ( NULL )
+ ,m_pVScroll ( NULL )
,m_pHScroll ( NULL )
,m_pScrollCorner ( NULL )
- ,m_pSelEngine ( )
- ,m_nRowSelected ( )
- ,m_pTableFunctionSet ( new TableFunctionSet(this ) )
- ,m_nAnchor (-1 )
- ,m_bResizing ( false )
- ,m_nResizingColumn ( 0 )
- ,m_bResizingGrid ( false )
+ ,m_pSelEngine ( )
+ ,m_aSelectedRows ( )
+ ,m_pTableFunctionSet ( new TableFunctionSet( this ) )
+ ,m_nAnchor ( -1 )
+ ,m_bUpdatingColWidths ( false )
+ ,m_pAccessibleTable ( NULL )
#if DBG_UTIL
,m_nRequiredInvariants ( INV_SCROLL_POSITION )
#endif
{
DBG_CTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
- m_pSelEngine = new SelectionEngine(m_pDataWindow, m_pTableFunctionSet);
- m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
+ m_pSelEngine = new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet );
+ m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
m_pDataWindow->SetPosPixel( Point( 0, 0 ) );
m_pDataWindow->Show();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::~TableControl_Impl()
{
DBG_DTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
@@ -458,35 +465,30 @@ namespace svt { namespace table
DELETEZ( m_pScrollCorner );
DELETEZ( m_pTableFunctionSet );
DELETEZ( m_pSelEngine );
- DELETEZ( m_pDataWindow );
}
- //--------------------------------------------------------------------
- PTableModel TableControl_Impl::getModel() const
- {
- if ( dynamic_cast< const EmptyTableModel* >( m_pModel.get() ) != NULL )
- // if it's an EmptyTableModel, pretend that there is no model
- return PTableModel();
-
- return m_pModel;
- }
-
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::setModel( PTableModel _pModel )
{
DBG_CHECK_ME();
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
+
+ if ( !!m_pModel )
+ m_pModel->removeTableModelListener( shared_from_this() );
m_pModel = _pModel;
if ( !m_pModel)
m_pModel.reset( new EmptyTableModel );
+ m_pModel->addTableModelListener( shared_from_this() );
+
m_nCurRow = ROW_INVALID;
m_nCurColumn = COL_INVALID;
// recalc some model-dependent cached info
impl_ni_updateCachedModelValues();
+ impl_ni_updateScrollbars();
// completely invalidate
m_rAntiImpl.Invalidate();
@@ -496,67 +498,308 @@ namespace svt { namespace table
if ( m_nColumnCount ) m_nCurColumn = 0;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ bool lcl_adjustSelectedRows( ::std::vector< RowPos >& io_selectionIndexes, RowPos const i_firstAffectedRowIndex, TableSize const i_offset )
+ {
+ bool didChanges = false;
+ for ( ::std::vector< RowPos >::iterator selPos = io_selectionIndexes.begin();
+ selPos != io_selectionIndexes.end();
+ ++selPos
+ )
+ {
+ if ( *selPos < i_firstAffectedRowIndex )
+ continue;
+ *selPos += i_offset;
+ didChanges = true;
+ }
+ return didChanges;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsInserted( RowPos i_first, RowPos i_last )
{
DBG_CHECK_ME();
+ OSL_PRECOND( i_last >= i_first, "TableControl_Impl::rowsInserted: invalid row indexes!" );
+
+ TableSize const insertedRows = i_last - i_first + 1;
+
+ // adjust selection, if necessary
+ bool const selectionChanged = lcl_adjustSelectedRows( m_aSelectedRows, i_first, insertedRows );
+
+ // adjust our cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // if the rows have been inserted before the current row, adjust this
+ if ( i_first <= m_nCurRow )
+ goTo( m_nCurColumn, m_nCurRow + insertedRows );
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A1YY events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent( AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange( AccessibleTableModelChangeType::INSERT, i_first, i_last, 0, m_pModel->getColumnCount() ) ),
+ Any()
+ );
+ impl_commitAccessibleEvent( AccessibleEventId::CHILD,
+ makeAny( m_pAccessibleTable->getTableHeader( TCTYPE_ROWHEADERBAR ) ),
+ Any()
+ );
+
+// for ( sal_Int32 i = 0 ; i <= m_pModel->getColumnCount(); ++i )
+// {
+// impl_commitAccessibleEvent(
+// CHILD,
+// makeAny( m_pAccessibleTable->getTable() ),
+// Any());
+// }
+ // Huh? What's that? We're notifying |columnCount| CHILD events here, claiming the *table* itself
+ // has been inserted. Doesn't make much sense, does it?
+ }
+
+ // schedule repaint
+ invalidateRowRange( i_first, ROW_INVALID );
+
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsRemoved( RowPos i_first, RowPos i_last )
+ {
+ sal_Int32 firstRemovedRow = i_first;
+ sal_Int32 lastRemovedRow = i_last;
+
+ // adjust selection, if necessary
+ bool selectionChanged = false;
+ if ( i_first == -1 )
+ {
+ selectionChanged = markAllRowsAsDeselected();
+
+ firstRemovedRow = 0;
+ lastRemovedRow = m_nRowCount - 1;
+ }
+ else
+ {
+ ENSURE_OR_RETURN_VOID( i_last >= i_first, "TableControl_Impl::rowsRemoved: illegal indexes!" );
+
+ for ( sal_Int32 row = i_first; row <= i_last; ++row )
+ {
+ if ( markRowAsDeselected( row ) )
+ selectionChanged = true;
+ }
+
+ if ( lcl_adjustSelectedRows( m_aSelectedRows, i_last + 1, i_first - i_last - 1 ) )
+ selectionChanged = true;
+ }
+
+ // adjust cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // adjust the current row, if it is larger than the row count now
+ if ( m_nCurRow >= m_nRowCount )
+ {
+ if ( m_nRowCount > 0 )
+ goTo( m_nCurColumn, m_nRowCount - 1 );
+ else
+ m_nCurRow = ROW_INVALID;
+ }
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A11Y events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent(
+ AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange(
+ AccessibleTableModelChangeType::DELETE,
+ firstRemovedRow,
+ lastRemovedRow,
+ 0,
+ m_pModel->getColumnCount()
+ ) ),
+ Any()
+ );
+ }
+
+ // schedule a repaint
+ invalidateRowRange( firstRemovedRow, ROW_INVALID );
- _rCellArea.Left() = 0;
- _rCellArea.Top() = 0;
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnInserted( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnRemoved( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::allColumnsRemoved()
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow )
+ {
+ invalidateRowRange( i_firstRow, i_lastRow );
+
+ OSL_UNUSED( i_firstCol );
+ OSL_UNUSED( i_lastCol );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::tableMetricsChanged()
+ {
+ long const oldRowHeaderWidthPixel = m_nRowHeaderWidthPixel;
+ impl_ni_updateCachedTableMetrics();
+ if ( oldRowHeaderWidthPixel != m_nRowHeaderWidthPixel )
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_invalidateColumn( ColPos const i_column )
+ {
+ DBG_CHECK_ME();
+
+ Rectangle const aAllCellsArea( impl_getAllVisibleCellsArea() );
+
+ const TableColumnGeometry aColumn( *this, aAllCellsArea, i_column );
+ if ( aColumn.isValid() )
+ m_rAntiImpl.Invalidate( aColumn.getRect() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup )
+ {
+ ColumnAttributeGroup nGroup( i_attributeGroup );
+ if ( nGroup & COL_ATTRS_APPEARANCE )
+ {
+ impl_invalidateColumn( i_column );
+ nGroup &= ~COL_ATTRS_APPEARANCE;
+ }
+
+ if ( nGroup & COL_ATTRS_WIDTH )
+ {
+ if ( !m_bUpdatingColWidths )
+ {
+ impl_ni_updateColumnWidths( i_column );
+ invalidate( TableAreaAll );
+ impl_ni_updateScrollbars();
+ }
+
+ nGroup &= ~COL_ATTRS_WIDTH;
+ }
+
+ OSL_ENSURE( ( nGroup == COL_ATTRS_NONE ) || ( i_attributeGroup == COL_ATTRS_ALL ),
+ "TableControl_Impl::columnChanged: don't know how to handle this change!" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleCellsArea() const
+ {
+ DBG_CHECK_ME();
+
+ Rectangle aArea( Point( 0, 0 ), Size( 0, 0 ) );
// determine the right-most border of the last column which is
// at least partially visible
- _rCellArea.Right() = m_nRowHeaderWidthPixel;
- if ( !m_aAccColumnWidthsPixel.empty() )
+ aArea.Right() = m_nRowHeaderWidthPixel;
+ if ( !m_aColumnWidths.empty() )
{
- // the number of pixels which are scroll out of the left hand
+ // the number of pixels which are scrolled out of the left hand
// side of the window
- long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ];
+ const long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aColumnWidths[ m_nLeftColumn - 1 ].getEnd();
- ArrayOfLong::const_reverse_iterator loop = m_aAccColumnWidthsPixel.rbegin();
+ ColumnPositions::const_reverse_iterator loop = m_aColumnWidths.rbegin();
do
{
- _rCellArea.Right() = *loop++ - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ aArea.Right() = loop->getEnd() - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ ++loop;
}
- while ( ( loop != m_aAccColumnWidthsPixel.rend() )
- && ( *loop - nScrolledOutLeft >= _rCellArea.Right() )
+ while ( ( loop != m_aColumnWidths.rend() )
+ && ( loop->getEnd() - nScrolledOutLeft >= aArea.Right() )
);
}
- // so far, _rCellArea.Right() denotes the first pixel *after* the cell area
- --_rCellArea.Right();
+ // so far, aArea.Right() denotes the first pixel *after* the cell area
+ --aArea.Right();
// determine the last row which is at least partially visible
- _rCellArea.Bottom() =
+ aArea.Bottom() =
m_nColHeaderHeightPixel
+ impl_getVisibleRows( true ) * m_nRowHeightPixel
- 1;
+
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleDataCellArea() const
{
DBG_CHECK_ME();
- impl_getAllVisibleCellsArea( _rCellArea );
- _rCellArea.Left() = m_nRowHeaderWidthPixel;
- _rCellArea.Top() = m_nColHeaderHeightPixel;
+ Rectangle aArea( impl_getAllVisibleCellsArea() );
+ aArea.Left() = m_nRowHeaderWidthPixel;
+ aArea.Top() = m_nColHeaderHeightPixel;
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateCachedModelValues()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedTableMetrics()
{
- m_nRowHeightPixel = 15;
- m_nColHeaderHeightPixel = 0;
- m_nRowHeaderWidthPixel = 0;
- m_pInputHandler.reset();
- m_nColumnCount = m_nRowCount = 0;
+ m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- if ( m_pModel->hasColumnHeaders() )
+ m_nColHeaderHeightPixel = 0;
+ if ( m_pModel->hasColumnHeaders() )
m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MAP_APPFONT ).Height();
+
+ m_nRowHeaderWidthPixel = 0;
if ( m_pModel->hasRowHeaders() )
m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT).Width();
+ }
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedModelValues()
+ {
+ m_pInputHandler.reset();
+ m_nColumnCount = m_nRowCount = 0;
+
+ impl_ni_updateCachedTableMetrics();
impl_ni_updateColumnWidths();
m_pInputHandler = m_pModel->getInputHandler();
@@ -567,145 +810,280 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateColumnWidths()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding )
{
- m_aColumnWidthsPixel.resize( 0 );
- m_aAccColumnWidthsPixel.resize( 0 );
+ ENSURE_OR_RETURN_VOID( !m_bUpdatingColWidths, "TableControl_Impl::impl_ni_updateColumnWidths: recursive call detected!" );
+
+ m_aColumnWidths.resize( 0 );
if ( !m_pModel )
return;
- TableSize colCount = m_pModel->getColumnCount();
+ const TableSize colCount = m_pModel->getColumnCount();
+ if ( colCount == 0 )
+ return;
+
+ m_bUpdatingColWidths = true;
+ const ::comphelper::FlagGuard aWidthUpdateFlag( m_bUpdatingColWidths );
+
+ m_aColumnWidths.reserve( colCount );
- m_aColumnWidthsPixel.reserve( colCount );
- m_aAccColumnWidthsPixel.reserve( colCount );
- if(colCount>0)
+ // the available horizontal space
+ long gridWidthPixel = m_rAntiImpl.GetOutputSizePixel().Width();
+ if ( m_pModel->hasRowHeaders() && ( gridWidthPixel != 0 ) )
{
- std::vector<sal_Int32> aPrePixelWidths(0);
- long accumulatedPixelWidth = 0;
- int lastResizableCol = -1;
- double gridWidth = m_rAntiImpl.GetOutputSizePixel().Width();
- if(m_pModel->hasRowHeaders())
- {
- TableMetrics rowHeaderWidth = m_pModel->getRowHeaderWidth();
- gridWidth-= m_rAntiImpl.LogicToPixel( Size( rowHeaderWidth, 0 ), MAP_APPFONT ).Width();
- }
- if(m_pModel->hasVerticalScrollbar())
+ gridWidthPixel -= m_nRowHeaderWidthPixel;
+ }
+ if ( m_pModel->getVerticalScrollbarVisibility() != ScrollbarShowNever )
+ {
+ long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
+ gridWidthPixel -= nScrollbarMetrics;
+ }
+
+ // TODO: shouldn't we take the visibility of the vertical scroll bar into account here, too?
+ long const gridWidthAppFont = m_rAntiImpl.PixelToLogic( Size( gridWidthPixel, 0 ), MAP_APPFONT ).Width();
+
+ // determine the accumulated current width of all columns
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ const PColumnModel pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ }
+
+ // collect some meta data for our columns:
+ // - their current (appt-font) metrics
+ long accumulatedCurrentWidth = 0;
+ ::std::vector< long > currentColWidths;
+ currentColWidths.reserve( colCount );
+ // - their effective minimal and maximal width (app-font!)
+ typedef ::std::vector< ::std::pair< long, long > > ColumnLimits;
+ ColumnLimits effectiveColumnLimits;
+ effectiveColumnLimits.reserve( colCount );
+ long accumulatedMinWidth = 0;
+ long accumulatedMaxWidth = 0;
+ // - their relative flexibility
+ ::std::vector< ::sal_Int32 > columnFlexibilities;
+ columnFlexibilities.reserve( colCount );
+ long flexibilityDenominator = 0;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ // current width
+ TableMetrics const currentWidth = pColumn->getWidth();
+ currentColWidths.push_back( currentWidth );
+
+ // accumulated width
+ accumulatedCurrentWidth += currentWidth;
+
+ // flexibility
+ ::sal_Int32 flexibility = pColumn->getFlexibility();
+ OSL_ENSURE( flexibility >= 0, "TableControl_Impl::impl_ni_updateColumnWidths: a column's flexibility should be non-negative." );
+ if ( ( flexibility < 0 ) // normalization
+ || ( !pColumn->isResizable() ) // column not resizeable => no auto-resize
+ || ( col <= i_assumeInflexibleColumnsUpToIncluding ) // column shall be treated as inflexible => respec this
+ )
+ flexibility = 0;
+
+ // min/max width
+ long effectiveMin = currentWidth, effectiveMax = currentWidth;
+ // if the column is not flexible, it will not be asked for min/max, but we assume the current width as limit then
+ if ( flexibility > 0 )
{
- sal_Int32 scrollbarWidth = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- gridWidth-=scrollbarWidth;
+ long const minWidth = pColumn->getMinWidth();
+ if ( minWidth > 0 )
+ effectiveMin = minWidth;
+ else
+ effectiveMin = MIN_COLUMN_WIDTH_PIXEL;
+
+ long const maxWidth = pColumn->getMaxWidth();
+ OSL_ENSURE( minWidth <= maxWidth, "TableControl_Impl::impl_ni_updateColumnWidths: pretty undecided 'bout its width limits, this column!" );
+ if ( ( maxWidth > 0 ) && ( maxWidth >= minWidth ) )
+ effectiveMax = maxWidth;
+ else
+ effectiveMax = gridWidthAppFont; // TODO: any better guess here?
+
+ if ( effectiveMin == effectiveMax )
+ // if the min and the max are identical, this implies no flexibility at all
+ flexibility = 0;
}
- double colWidthsSum = 0.0;
- double colWithoutFixedWidthsSum = 0.0;
- double minColWithoutFixedSum = 0.0;
- for ( ColPos col = 0; col < colCount; ++col )
+
+ columnFlexibilities.push_back( flexibility );
+ flexibilityDenominator += flexibility;
+
+ effectiveColumnLimits.push_back( ::std::pair< long, long >( effectiveMin, effectiveMax ) );
+ accumulatedMinWidth += effectiveMin;
+ accumulatedMaxWidth += effectiveMax;
+ }
+
+ ::std::vector< long > newWidths( currentColWidths );
+ if ( flexibilityDenominator == 0 )
+ {
+ // no column is flexible => don't adjust anything
+ }
+ else if ( gridWidthAppFont > accumulatedCurrentWidth )
+ { // we have space to give away ...
+ long distributeAppFontUnits = gridWidthAppFont - accumulatedCurrentWidth;
+ if ( gridWidthAppFont > accumulatedMaxWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( col );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- TableMetrics colWidth = 0;
- TableMetrics colPrefWidth = pColumn->getPreferredWidth();
- bool bResizable = pColumn->isResizable();
- if(pColumn->getMinWidth() == 0 && bResizable)
+ // ... but the column's maximal widths are still less than we have
+ // => set them all to max
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- pColumn->setMinWidth(1);
- minColWithoutFixedSum+=m_rAntiImpl.PixelToLogic( Size( 1, 0 ), MAP_APPFONT ).Width();
- }
- if(pColumn->getMaxWidth() == 0 && bResizable)
- pColumn->setMaxWidth(m_rAntiImpl.PixelToLogic( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width());
- if( colPrefWidth != 0)
- {
- if(m_bResizingGrid)
- {
- colWidth = pColumn->getWidth();
- pColumn->setPreferredWidth(0);
- }
- else
- {
- colWidth = colPrefWidth;
- pColumn->setWidth(colPrefWidth);
- }
+ newWidths[i] = effectiveColumnLimits[i].second;
}
- else
- colWidth = pColumn->getWidth();
- long pixelWidth = m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- if(bResizable && colPrefWidth == 0)
- {
- colWithoutFixedWidthsSum+=pixelWidth;
- lastResizableCol = col;
- }
- colWidthsSum+=pixelWidth;
- aPrePixelWidths.push_back(pixelWidth);
- }
- double gridWidthWithoutFixed = gridWidth - colWidthsSum + colWithoutFixedWidthsSum;
- double scalingFactor = 1.0;
- if(m_bResizingGrid)
- {
- if(gridWidthWithoutFixed > (minColWithoutFixedSum+colWidthsSum - colWithoutFixedWidthsSum))
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
}
else
{
- if(colWidthsSum < gridWidthWithoutFixed)
+ bool startOver = false;
+ do
{
- if(colWithoutFixedWidthsSum>0)
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
+ startOver = false;
+ // distribute the remaining space amongst all columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
+ {
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] + columnFlexibility * distributeAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth > effectiveColumnLimits[i].second )
+ { // that was too much, we hit the col's maximum
+ // set the new width to exactly this maximum
+ newColWidth = effectiveColumnLimits[i].second;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = newColWidth - currentColWidths[i];
+ distributeAppFontUnits -= difference;
+ // ... this way, we ensure that the width not taken up by this column is consumed by the other
+ // flexible ones (if there are some)
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
+ }
}
+ while ( startOver );
}
- for ( ColPos i = 0; i < colCount; ++i )
+ }
+ else if ( gridWidthAppFont < accumulatedCurrentWidth )
+ { // we need to take away some space from the columns which allow it ...
+ long takeAwayAppFontUnits = accumulatedCurrentWidth - gridWidthAppFont;
+ if ( gridWidthAppFont < accumulatedMinWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( i );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- if(pColumn->isResizable() && pColumn->getPreferredWidth() == 0)
+ // ... but the column's minimal widths are still more than we have
+ // => set them all to min
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- aPrePixelWidths[i]*=scalingFactor;
- TableMetrics logicColWidth = m_rAntiImpl.PixelToLogic( Size( aPrePixelWidths[i], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth);
+ newWidths[i] = effectiveColumnLimits[i].first;
}
- m_aColumnWidthsPixel.push_back( aPrePixelWidths[i] );
- m_aAccColumnWidthsPixel.push_back( accumulatedPixelWidth += aPrePixelWidths[i] );
}
- if(gridWidth > m_aAccColumnWidthsPixel[colCount-1])
+ else
{
- if(lastResizableCol >= 0)
+ bool startOver = false;
+ do
{
- PColumnModel pColumn = m_pModel->getColumnModel(lastResizableCol);
- m_aColumnWidthsPixel[lastResizableCol]+=gridWidth-m_aAccColumnWidthsPixel[colCount-1];
- TableMetrics logicColWidth1 = m_rAntiImpl.PixelToLogic( Size( m_aColumnWidthsPixel[lastResizableCol], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth1);
- while(lastResizableCol < colCount)
+ startOver = false;
+ // take away the space we need from the columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
{
- if(lastResizableCol == 0)
- m_aAccColumnWidthsPixel[0] = m_aColumnWidthsPixel[lastResizableCol];
- else
- m_aAccColumnWidthsPixel[lastResizableCol]=m_aAccColumnWidthsPixel[lastResizableCol-1]+m_aColumnWidthsPixel[lastResizableCol];
- ++lastResizableCol;
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] - columnFlexibility * takeAwayAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth < effectiveColumnLimits[i].first )
+ { // that was too much, we hit the col's minimum
+ // set the new width to exactly this minimum
+ newColWidth = effectiveColumnLimits[i].first;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = currentColWidths[i] - newColWidth;
+ takeAwayAppFontUnits -= difference;
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
}
}
+ while ( startOver );
+ }
+ }
+
+ // now that we have calculated the app-font widths, get the actual pixels
+ long accumulatedWidthPixel = m_nRowHeaderWidthPixel;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ long const colWidth = m_rAntiImpl.LogicToPixel( Size( newWidths[col], 0 ), MAP_APPFONT ).Width();
+ const long columnStart = accumulatedWidthPixel;
+ const long columnEnd = columnStart + colWidth;
+ m_aColumnWidths.push_back( MutableColumnMetrics( columnStart, columnEnd ) );
+ accumulatedWidthPixel = columnEnd;
+
+ // and don't forget to forward this to the column models
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+ pColumn->setWidth( newWidths[col] );
+ }
+
+ // if the column resizing happened to leave some space at the right, but there are columns
+ // scrolled out to the left, scroll them in
+ while ( ( m_nLeftColumn > 0 )
+ && ( accumulatedWidthPixel - m_aColumnWidths[ m_nLeftColumn - 1 ].getStart() <= gridWidthPixel )
+ )
+ {
+ --m_nLeftColumn;
+ }
+
+ // now adjust the column metrics, since they currently ignore the horizontal scroll position
+ if ( m_nLeftColumn > 0 )
+ {
+ const long offsetPixel = m_aColumnWidths[ 0 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getStart();
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( offsetPixel );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
namespace
{
- //................................................................
+ //..............................................................................................................
/// determines whether a scrollbar is needed for the given values
- bool lcl_determineScrollbarNeed( ScrollbarVisibility _eVisibility,
- long _nVisibleUnits, long _nRange )
+ bool lcl_determineScrollbarNeed( long const i_position, ScrollbarVisibility const i_visibility,
+ long const i_availableSpace, long const i_neededSpace )
{
- if ( _eVisibility == ScrollbarShowNever )
+ if ( i_visibility == ScrollbarShowNever )
return false;
- if ( _eVisibility == ScrollbarShowAlways )
+ if ( i_visibility == ScrollbarShowAlways )
+ return true;
+ if ( i_position > 0 )
return true;
- return _nVisibleUnits > _nRange;
+ if ( i_availableSpace >= i_neededSpace )
+ return false;
+ return true;
}
- //................................................................
- void lcl_setButtonRepeat( Window& _rWindow, ULONG _nDelay )
+ //..............................................................................................................
+ void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay )
{
AllSettings aSettings = _rWindow.GetSettings();
MouseSettings aMouseSettings = aSettings.GetMouseSettings();
@@ -713,27 +1091,26 @@ namespace svt { namespace table
aMouseSettings.SetButtonRepeat( _nDelay );
aSettings.SetMouseSettings( aMouseSettings );
- _rWindow.SetSettings( aSettings, TRUE );
+ _rWindow.SetSettings( aSettings, sal_True );
}
- //................................................................
+ //..............................................................................................................
void lcl_updateScrollbar( Window& _rParent, ScrollBar*& _rpBar,
- ScrollbarVisibility _eVisibility, long _nVisibleUnits,
+ bool const i_needBar, long _nVisibleUnits,
long _nPosition, long _nLineSize, long _nRange,
bool _bHorizontal, const Link& _rScrollHandler )
{
- // do we need the scrollbar?
- bool bNeedBar = lcl_determineScrollbarNeed( _eVisibility, _nVisibleUnits, _nRange );
-
// do we currently have the scrollbar?
bool bHaveBar = _rpBar != NULL;
// do we need to correct the scrollbar visibility?
- if ( bHaveBar && !bNeedBar )
+ if ( bHaveBar && !i_needBar )
{
+ if ( _rpBar->IsTracking() )
+ _rpBar->EndTracking();
DELETEZ( _rpBar );
}
- else if ( !bHaveBar && bNeedBar )
+ else if ( !bHaveBar && i_needBar )
{
_rpBar = new ScrollBar(
&_rParent,
@@ -755,7 +1132,7 @@ namespace svt { namespace table
}
}
- //................................................................
+ //..............................................................................................................
/** returns the number of rows fitting into the given range,
for the given row height. Partially fitting rows are counted, too, if the
respective parameter says so.
@@ -767,7 +1144,7 @@ namespace svt { namespace table
: _nOverallHeight / _nRowHeightPixel;
}
- //................................................................
+ //..............................................................................................................
/** returns the number of columns fitting into the given area,
with the first visible column as given. Partially fitting columns are counted, too,
if the respective parameter says so.
@@ -792,15 +1169,13 @@ namespace svt { namespace table
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_updateScrollbars()
{
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// the width/height of a scrollbar, needed several times below
- long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- if ( m_rAntiImpl.IsZoom() )
- nScrollbarMetrics = (long)( nScrollbarMetrics * (double)m_rAntiImpl.GetZoom() );
+ long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
// determine the playground for the data cells (excluding headers)
// TODO: what if the control is smaller than needed for the headers/scrollbars?
@@ -810,26 +1185,28 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
m_nColumnCount = m_pModel->getColumnCount();
- if(m_aAccColumnWidthsPixel.empty())
- {
+ if ( m_aColumnWidths.empty() )
impl_ni_updateColumnWidths();
- }
+ OSL_ENSURE( m_aColumnWidths.size() == size_t( m_nColumnCount ), "TableControl_Impl::impl_ni_updateScrollbars: inconsistency!" );
+ const long nAllColumnsWidth = m_aColumnWidths.empty()
+ ? 0
+ : m_aColumnWidths[ m_nColumnCount - 1 ].getEnd() - m_aColumnWidths[ 0 ].getStart();
+
+ const ScrollbarVisibility eVertScrollbar = m_pModel->getVerticalScrollbarVisibility();
+ const ScrollbarVisibility eHorzScrollbar = m_pModel->getHorizontalScrollbarVisibility();
// do we need a vertical scrollbar?
+ bool bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
bool bFirstRoundVScrollNeed = false;
- if ( lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(), m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( bNeedVerticalScrollbar )
{
aDataCellPlayground.Right() -= nScrollbarMetrics;
bFirstRoundVScrollNeed = true;
}
// do we need a horizontal scrollbar?
- if ( lcl_determineScrollbarNeed(
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
- lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
- m_nColumnCount ) )
+ const bool bNeedHorizontalScrollbar = lcl_determineScrollbarNeed( m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth );
+ if ( bNeedHorizontalScrollbar )
{
aDataCellPlayground.Bottom() -= nScrollbarMetrics;
@@ -837,19 +1214,21 @@ namespace svt { namespace table
// the need for a vertical one may have changed, since the horizontal
// SB might just occupy enough space so that not all rows do fit
// anymore
- if ( !bFirstRoundVScrollNeed && lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( !bFirstRoundVScrollNeed )
{
- aDataCellPlayground.Right() -= nScrollbarMetrics;
+ bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
+ if ( bNeedVerticalScrollbar )
+ {
+ aDataCellPlayground.Right() -= nScrollbarMetrics;
+ }
}
}
// create or destroy the vertical scrollbar, as needed
lcl_updateScrollbar(
m_rAntiImpl,
m_pVScroll,
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
+ bNeedVerticalScrollbar,
lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
// visible units
m_nTopRow, // current position
@@ -873,7 +1252,7 @@ namespace svt { namespace table
lcl_updateScrollbar(
m_rAntiImpl,
m_pHScroll,
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
+ bNeedHorizontalScrollbar,
lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
// visible units
m_nLeftColumn, // current position
@@ -885,14 +1264,14 @@ namespace svt { namespace table
// position it
if ( m_pHScroll )
{
- TableSize nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
- int nRange = m_nColumnCount;
- if( m_nLeftColumn + nVisibleUnits == nRange-1)
+ TableSize const nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
+ TableMetrics const nRange = m_nColumnCount;
+ if( m_nLeftColumn + nVisibleUnits == nRange - 1 )
{
- if(m_aAccColumnWidthsPixel[nRange-2] - m_aAccColumnWidthsPixel[m_nLeftColumn] + m_aColumnWidthsPixel[nRange-1]>aDataCellPlayground.GetWidth())
+ if ( m_aColumnWidths[ nRange - 1 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getEnd() + m_aColumnWidths[ nRange-1 ].getWidth() > aDataCellPlayground.GetWidth() )
{
m_pHScroll->SetVisibleSize( nVisibleUnits -1 );
- m_pHScroll->SetPageSize(nVisibleUnits -1);
+ m_pHScroll->SetPageSize( nVisibleUnits - 1 );
}
}
Rectangle aScrollbarArea(
@@ -930,33 +1309,17 @@ namespace svt { namespace table
) );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::onResize()
{
DBG_CHECK_ME();
- if(m_nRowCount != 0)
- {
- if(m_nColumnCount != 0)
- {
- if(m_bResizingGrid)
- impl_ni_updateColumnWidths();
- invalidateRows();
- m_bResizingGrid = true;
- }
- }
- else
- {
- //In the case that column headers are defined but data hasn't yet been set,
- //only column headers will be shown
- if(m_pModel->hasColumnHeaders())
- if(m_nColHeaderHeightPixel>1)
- m_pDataWindow->SetSizePixel( m_rAntiImpl.GetOutputSizePixel());
- if(m_nColumnCount != 0)
- impl_ni_updateScrollbars();
- }
+
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ checkCursorPosition();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::doPaintContent( const Rectangle& _rUpdateRect )
{
DBG_CHECK_ME();
@@ -964,32 +1327,24 @@ namespace svt { namespace table
if ( !getModel() )
return;
PTableRenderer pRenderer = getModel()->getRenderer();
- DBG_ASSERT( !!pRenderer, "TableDataWindow::Paint: invalid renderer!" );
+ DBG_ASSERT( !!pRenderer, "TableDataWindow::doPaintContent: invalid renderer!" );
if ( !pRenderer )
return;
// our current style settings, to be passed to the renderer
const StyleSettings& rStyle = m_rAntiImpl.GetSettings().GetStyleSettings();
m_nRowCount = m_pModel->getRowCount();
- TableSize nVisibleRows = impl_getVisibleRows(true);
- TableSize nActualRows = m_nRowCount;
- if(m_nRowCount>nVisibleRows)
- nActualRows = nVisibleRows;
// the area occupied by all (at least partially) visible cells, including
// headers
- Rectangle aAllCellsWithHeaders;
- impl_getAllVisibleCellsArea( aAllCellsWithHeaders );
+ Rectangle const aAllCellsWithHeaders( impl_getAllVisibleCellsArea() );
// ............................
// draw the header column area
if ( m_pModel->hasColumnHeaders() )
{
- TableRowGeometry aHeaderRow( *this, Rectangle( Point( 0, 0 ),
+ TableRowGeometry const aHeaderRow( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), ROW_COL_HEADERS );
- Rectangle aColRect(aHeaderRow.getRect());
- //to avoid double lines when scrolling horizontally
- if(m_nLeftColumn != 0)
- --aColRect.Left();
+ Rectangle const aColRect(aHeaderRow.getRect());
pRenderer->PaintHeaderArea(
*m_pDataWindow, aColRect, true, false, rStyle
);
@@ -1005,7 +1360,7 @@ namespace svt { namespace table
if ( _rUpdateRect.GetIntersection( aCell.getRect() ).IsEmpty() )
continue;
- bool isActiveColumn = ( aCell.getColumn() == getCurColumn() );
+ bool isActiveColumn = ( aCell.getColumn() == getCurrentColumn() );
bool isSelectedColumn = false;
pRenderer->PaintColumnHeader( aCell.getColumn(), isActiveColumn, isSelectedColumn,
*m_pDataWindow, aCell.getRect(), rStyle );
@@ -1017,31 +1372,23 @@ namespace svt { namespace table
{
aRowHeaderArea = aAllCellsWithHeaders;
aRowHeaderArea.Right() = m_nRowHeaderWidthPixel - 1;
- if(m_nTopRow+nActualRows>m_nRowCount)
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * (nActualRows -1)+ m_nColHeaderHeightPixel - 1;
- else
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * nActualRows + m_nColHeaderHeightPixel - 1;
- //to avoid double lines when scrolling vertically
- if(m_nTopRow != 0)
- --aRowHeaderArea.Top();
- --aRowHeaderArea.Right();
- pRenderer->PaintHeaderArea(*m_pDataWindow, aRowHeaderArea, false, true, rStyle);
+
+ TableSize const nVisibleRows = impl_getVisibleRows( true );
+ TableSize nActualRows = nVisibleRows;
+ if ( m_nTopRow + nActualRows > m_nRowCount )
+ nActualRows = m_nRowCount - m_nTopRow;
+ aRowHeaderArea.Bottom() = m_nColHeaderHeightPixel + m_nRowHeightPixel * nActualRows - 1;
+
+ pRenderer->PaintHeaderArea( *m_pDataWindow, aRowHeaderArea, false, true, rStyle );
// Note that strictly, aRowHeaderArea also contains the intersection between column
// and row header area. However, below we go to paint this intersection, again,
// so this hopefully doesn't hurt if we already paint it here.
if ( m_pModel->hasColumnHeaders() )
{
- TableCellGeometry aIntersection( *this, Rectangle( Point( 0, 0 ),
+ TableCellGeometry const aIntersection( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), COL_ROW_HEADERS, ROW_COL_HEADERS );
- Rectangle aInters(aIntersection.getRect());
- //to avoid double line when scrolling vertically
- if( m_nTopRow != 0 )
- {
- --aInters.Top();
- --aInters.Bottom();
- }
- --aInters.Right();
+ Rectangle const aInters( aIntersection.getRect() );
pRenderer->PaintHeaderArea(
*m_pDataWindow, aInters, true, true, rStyle
);
@@ -1054,51 +1401,36 @@ namespace svt { namespace table
TableSize colCount = getModel()->getColumnCount();
// paint all rows
- Rectangle aAllDataCellsArea;
- impl_getAllVisibleDataCellArea( aAllDataCellsArea );
- ::std::vector< std::vector< ::com::sun::star::uno::Any > >& aCellContent = m_pModel->getCellContent();
+ Rectangle const aAllDataCellsArea( impl_getAllVisibleDataCellArea() );
for ( TableRowGeometry aRowIterator( *this, aAllCellsWithHeaders, getTopRow() );
aRowIterator.isValid();
aRowIterator.moveDown() )
{
if ( _rUpdateRect.GetIntersection( aRowIterator.getRect() ).IsEmpty() )
continue;
- bool isActiveRow = ( aRowIterator.getRow() == getCurRow() );
- bool isSelectedRow = false;
- if(!m_nRowSelected.empty())
- {
- for(std::vector<RowPos>::iterator itSel=m_nRowSelected.begin();
- itSel!=m_nRowSelected.end();++itSel)
- {
- if(*itSel == aRowIterator.getRow())
- isSelectedRow = true;
- }
- }
- Rectangle aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
- //to avoid double lines
- if( aRowIterator.getRow() != 0 )
- --aRect.Top();
- if(m_nLeftColumn != 0)
- --aRect.Left();
- else
- {
- if(m_pModel->hasRowHeaders())
- --aRect.Left();
- }
+
+ bool const isActiveRow = ( aRowIterator.getRow() == getCurrentRow() );
+ bool const isSelectedRow = isRowSelected( aRowIterator.getRow() );
+
+ Rectangle const aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
+
// give the redenderer a chance to prepare the row
- pRenderer->PrepareRow( aRowIterator.getRow(), isActiveRow, isSelectedRow,
- *m_pDataWindow, aRect, rStyle );
+ pRenderer->PrepareRow(
+ aRowIterator.getRow(), isActiveRow, isSelectedRow,
+ *m_pDataWindow, aRect, rStyle
+ );
// paint the row header
if ( m_pModel->hasRowHeaders() )
{
- Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
- rtl::OUString rowHeaderName = m_pModel->getRowHeaderName()[aRowIterator.getRow()];
+ const Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
pRenderer->PaintRowHeader( isActiveRow, isSelectedRow, *m_pDataWindow, aCurrentRowHeader,
- rStyle, rowHeaderName );
+ rStyle );
}
+
if ( !colCount )
continue;
+
// paint all cells in this row
for ( TableCellGeometry aCell( aRowIterator, m_nLeftColumn );
aCell.isValid();
@@ -1106,25 +1438,12 @@ namespace svt { namespace table
)
{
bool isSelectedColumn = false;
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- ::com::sun::star::uno::Any rCellData = aCellContent[aRowIterator.getRow()][aCell.getColumn()];
- if(rCellData>>=xGraphic)
- {
- Image* pImage = new Image(xGraphic);
- if(pImage!=NULL)
- pRenderer->PaintCellImage( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, pImage );
- }
- else
- {
- ::rtl::OUString sContent = convertToString(rCellData);
- pRenderer->PaintCellString( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, sContent );
- }
+ pRenderer->PaintCell( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
+ *m_pDataWindow, aCell.getRect(), rStyle );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::hideCursor()
{
DBG_CHECK_ME();
@@ -1133,7 +1452,7 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( false );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::showCursor()
{
DBG_CHECK_ME();
@@ -1143,12 +1462,14 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( true );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
bool TableControl_Impl::dispatchAction( TableControlAction _eAction )
{
DBG_CHECK_ME();
bool bSuccess = false;
+ bool selectionChanged = false;
+
Rectangle rCells;
switch ( _eAction )
{
@@ -1156,25 +1477,25 @@ namespace svt { namespace table
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
//if other rows already selected, deselect them
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow < m_nRowCount-1)
{
++m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
}
else
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1187,28 +1508,28 @@ namespace svt { namespace table
case cursorUp:
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow>0)
{
--m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
else
{
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1270,259 +1591,269 @@ namespace svt { namespace table
case cursorBottomRight:
bSuccess = goTo( m_nColumnCount - 1, m_nRowCount - 1 );
break;
- case cursorSelectRow:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- //pos is the position of the current row in the vector of selected rows, if current row is selected
- int pos = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- //if current row is selected, it should be deselected, when ALT+SPACE are pressed
- if(pos>-1)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+pos);
- if(m_nRowSelected.empty() && m_nAnchor != -1)
- m_nAnchor = -1;
- }
- //else select the row->put it in the vector
- else
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
- break;
- case cursorSelectRowUp:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+
+ case cursorSelectRow:
{
- //if there are other selected rows, deselect them
- return false;
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ //pos is the position of the current row in the vector of selected rows, if current row is selected
+ int pos = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ //if current row is selected, it should be deselected, when ALT+SPACE are pressed
+ if(pos>-1)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+pos);
+ if(m_aSelectedRows.empty() && m_nAnchor != -1)
+ m_nAnchor = -1;
+ }
+ //else select the row->put it in the vector
+ else
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ selectionChanged = true;
+ bSuccess = true;
}
- else
+ break;
+ case cursorSelectRowUp:
{
- //there are other selected rows
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ //if there are other selected rows, deselect them
+ return false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ //there are other selected rows
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- else
- {
- //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow-1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the upper one, can move up, otherwise not
- if(m_nCurRow>0)
- m_nCurRow--;
- else
- return bSuccess = true;
- //if nextRow already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
- }
- else
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- }
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
else
{
- if(m_nCurRow>0)
+ //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow-1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the upper one, can move up, otherwise not
+ if(m_nCurRow>0)
+ m_nCurRow--;
+ else
+ return bSuccess = true;
+ //if nextRow already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
{
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
}
}
}
- }
- else
- {
- //if nothing is selected and the current row isn't the upper one
- //select the current and one row above
- //otherwise select only the upper row
- if(m_nCurRow>0)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
- }
else
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ //if nothing is selected and the current row isn't the upper one
+ //select the current and one row above
+ //otherwise select only the upper row
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(TRUE);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
- }
- break;
- case cursorSelectRowDown:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- {
- bSuccess = false;
}
- else
+ break;
+ case cursorSelectRowDown:
{
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ bSuccess = false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
+ {
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ else
+ {
+ //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow+1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the last one, can move down, otherwise not
+ if(m_nCurRow<m_nRowCount-1)
+ m_nCurRow++;
+ else
+ return bSuccess = true;
+ //if next row already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
+ {
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
+ }
+ }
}
+ }
else
{
- //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow+1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the last one, can move down, otherwise not
- if(m_nCurRow<m_nRowCount-1)
- m_nCurRow++;
- else
- return bSuccess = true;
- //if next row already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
- }
- else
- {
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
+ //there wasn't any selection, select current and row beneath, otherwise only row beneath
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
}
else
{
- if(m_nCurRow<m_nRowCount-1)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
+ }
+ break;
+
+ case cursorSelectRowAreaTop:
+ {
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ bSuccess = false;
else
{
- //there wasn't any selection, select current and row beneath, otherwise only row beneath
- if(m_nCurRow<m_nRowCount-1)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
- else
+ //select the region between the current and the upper row
+ RowPos iter = m_nCurRow;
+ invalidateSelectedRegion(m_nCurRow, 0, rCells);
+ //put the rows in vector
+ while(iter>=0)
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ --iter;
}
+ m_nCurRow = 0;
+ m_nAnchor = m_nCurRow;
+ m_pSelEngine->SetAnchor(sal_True);
+ ensureVisible(m_nCurColumn, 0, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(TRUE);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
}
- }
break;
- case cursorSelectRowAreaTop:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- bSuccess = false;
- else
+
+ case cursorSelectRowAreaBottom:
{
- //select the region between the current and the upper row
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ return bSuccess = false;
+ //select the region between the current and the last row
RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, 0, rCells);
- //put the rows in vector
- while(iter>=0)
+ invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
+ //put the rows in the vector
+ while(iter<=m_nRowCount)
{
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- --iter;
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ ++iter;
}
- m_nCurRow = 0;
+ m_nCurRow = m_nRowCount-1;
m_nAnchor = m_nCurRow;
- m_pSelEngine->SetAnchor(TRUE);
- ensureVisible(m_nCurColumn, 0, false);
- m_rAntiImpl.selectionChanged(true);
+ m_pSelEngine->SetAnchor(sal_True);
+ ensureVisible(m_nCurColumn, m_nRowCount-1, false);
+ selectionChanged = true;
bSuccess = true;
}
- }
- break;
- case cursorSelectRowAreaBottom:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- return bSuccess = false;
- //select the region between the current and the last row
- RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
- //put the rows in the vector
- while(iter<=m_nRowCount)
- {
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- ++iter;
- }
- m_nCurRow = m_nRowCount-1;
- m_nAnchor = m_nCurRow;
- m_pSelEngine->SetAnchor(TRUE);
- ensureVisible(m_nCurColumn, m_nRowCount-1, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
break;
default:
OSL_FAIL( "TableControl_Impl::dispatchAction: unsupported action!" );
+ break;
}
+
+ if ( bSuccess && selectionChanged )
+ {
+ m_rAntiImpl.Select();
+ }
+
return bSuccess;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_doSwitchCursor( bool _bShow )
{
PTableRenderer pRenderer = !!m_pModel ? m_pModel->getRenderer() : PTableRenderer();
@@ -1530,16 +1861,14 @@ namespace svt { namespace table
{
Rectangle aCellRect;
impl_getCellRect( m_nCurColumn, m_nCurRow, aCellRect );
- if(!m_pModel->hasRowHeaders() && m_nCurColumn == 0)
- aCellRect.Left()++;
if ( _bShow )
- pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect );
else
- pRenderer->HideCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->HideCellCursor( *m_pDataWindow, aCellRect );
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_getCellRect( ColPos _nColumn, RowPos _nRow, Rectangle& _rCellRect ) const
{
DBG_CHECK_ME();
@@ -1553,164 +1882,236 @@ namespace svt { namespace table
return;
}
- Rectangle aAllCells;
- impl_getAllVisibleCellsArea( aAllCells );
-
- TableCellGeometry aCell( *this, aAllCells, _nColumn, _nRow );
+ TableCellGeometry aCell( *this, impl_getAllVisibleCellsArea(), _nColumn, _nRow );
_rCellRect = aCell.getRect();
- _rCellRect.Top()--;_rCellRect.Left()--;
}
- //-------------------------------------------------------------------------------
- RowPos TableControl_Impl::getCurrentRow(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getRowAtPoint( const Point& rPoint ) const
+ {
+ DBG_CHECK_ME();
+ return impl_getRowForAbscissa( rPoint.Y() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos TableControl_Impl::getColAtPoint( const Point& rPoint ) const
{
DBG_CHECK_ME();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=-1;i<m_nRowCount;i++)
+ return impl_getColumnForOrdinate( rPoint.X() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableCell TableControl_Impl::hitTest( Point const & i_point ) const
+ {
+ TableCell aCell( getColAtPoint( i_point ), getRowAtPoint( i_point ) );
+ if ( aCell.nColumn > COL_ROW_HEADERS )
{
- for(int j=-1;j<m_nColumnCount;j++)
+ PColumnModel const pColumn = m_pModel->getColumnModel( aCell.nColumn );
+ MutableColumnMetrics const & rColInfo( m_aColumnWidths[ aCell.nColumn ] );
+ if ( ( rColInfo.getEnd() - 3 <= i_point.X() )
+ && ( rColInfo.getEnd() >= i_point.X() )
+ && pColumn->isResizable()
+ )
{
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- newColPos = j;
- if(newColPos != -1)
- m_nCurColumn = newColPos;
- return newRowPos;
- }
+ aCell.eArea = ColumnDivider;
}
}
- return newRowPos;
+ return aCell;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnMetrics TableControl_Impl::getColumnMetrics( ColPos const i_column ) const
+ {
+ DBG_CHECK_ME();
+
+ ENSURE_OR_RETURN( ( i_column >= 0 ) && ( i_column < m_pModel->getColumnCount() ),
+ "TableControl_Impl::getColumnMetrics: illegal column index!", ColumnMetrics() );
+ return (ColumnMetrics const &)m_aColumnWidths[ i_column ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ PTableModel TableControl_Impl::getModel() const
+ {
+ return m_pModel;
}
- //-------------------------------------------------------------------------------
- void TableControl_Impl::setCursorAtCurrentCell(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentColumn() const
+ {
+ return m_nCurColumn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentRow() const
+ {
+ return m_nCurRow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::Size TableControl_Impl::getTableSizePixel() const
+ {
+ return m_pDataWindow->GetOutputSizePixel();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::setPointer( Pointer const & i_pointer )
{
DBG_CHECK_ME();
- hideCursor();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=0;i<m_nRowCount;i++)
+ m_pDataWindow->SetPointer( i_pointer );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::captureMouse()
+ {
+ m_pDataWindow->CaptureMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::releaseMouse()
+ {
+ m_pDataWindow->ReleaseMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidate( TableArea const i_what )
+ {
+ switch ( i_what )
{
- for(int j=-1;j<m_nColumnCount;j++)
- {
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- m_nCurRow = newRowPos;
- newColPos = j;
- if(newColPos == -1)
- m_nCurColumn = 0;
- else
- m_nCurColumn = newColPos;
- }
- }
+ case TableAreaColumnHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( true ) );
+ break;
+
+ case TableAreaRowHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( false ) );
+ break;
+
+ case TableAreaDataArea:
+ m_pDataWindow->Invalidate( impl_getAllVisibleDataCellArea() );
+ break;
+
+ case TableAreaAll:
+ m_pDataWindow->Invalidate();
+ break;
}
- showCursor();
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl_Impl::pixelWidthToAppFont( long const i_pixels ) const
+ {
+ return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MAP_APPFONT ).Width();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::hideTracking()
+ {
+ m_pDataWindow->HideTracking();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::showTracking( Rectangle const & i_location, sal_uInt16 const i_flags )
+ {
+ m_pDataWindow->ShowTracking( i_location, i_flags );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::activateCell( ColPos const i_col, RowPos const i_row )
+ {
+ DBG_CHECK_ME();
+ return goTo( i_col, i_row );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect)
{
DBG_CHECK_ME();
- Rectangle aAllCells;
//get the visible area of the table control and set the Left and right border of the region to be repainted
- impl_getAllVisibleCellsArea( aAllCells );
+ Rectangle const aAllCells( impl_getAllVisibleCellsArea() );
_rCellRect.Left() = aAllCells.Left();
_rCellRect.Right() = aAllCells.Right();
- Rectangle rCells;
//if only one row is selected
if(_nPrevRow == _nCurRow)
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()=--rCells.Top();
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is above the current row
else if(_nPrevRow < _nCurRow )
{
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is beneath the current row
else
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
m_pDataWindow->Invalidate(_rCellRect);
}
- //-------------------------------------------------------------------------------
- //this method is to be called, when a new row is added
- void TableControl_Impl::invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect)
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow )
{
- if(m_nCurRow < 0)
- m_nCurRow = 0;
- if(m_nCursorHidden == 2)
+ if ( m_nCursorHidden == 2 )
+ // WTF? what kind of hack is this?
--m_nCursorHidden;
- impl_getAllVisibleCellsArea( _rCellRect );
- TableRowGeometry _rRow( *this, _rCellRect, _nRowPos);
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(_rRow.getRect());
- }
- //-------------------------------------------------------------------------------
- std::vector<RowPos>& TableControl_Impl::getSelectedRows()
- {
- return m_nRowSelected;
- }
- //--------------------------------------------------------------------
- void TableControl_Impl::clearSelection()
- {
- m_nRowSelected.clear();
- }
- //--------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- void TableControl_Impl::removeSelectedRow(RowPos _nRowPos)
- {
- int i =0;
- //if the row is selected, remove it from the selection vector
- if(isRowSelected(m_nRowSelected, _nRowPos))
+
+ RowPos const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow;
+ RowPos const lastVisibleRow = m_nTopRow + impl_getVisibleRows( true ) - 1;
+ RowPos const lastRow = ( ( i_lastRow == ROW_INVALID ) || ( i_lastRow > lastVisibleRow ) ) ? lastVisibleRow : i_lastRow;
+
+ Rectangle aInvalidateRect;
+
+ Rectangle const aVisibleCellsArea( impl_getAllVisibleCellsArea() );
+ TableRowGeometry aRow( *this, aVisibleCellsArea, firstRow, true );
+ while ( aRow.isValid() && ( aRow.getRow() <= lastRow ) )
{
- if(m_nRowSelected.size()>1)
- m_nRowSelected.erase(m_nRowSelected.begin()+_nRowPos);
- else
- m_nRowSelected.clear();
+ aInvalidateRect.Union( aRow.getRect() );
+ aRow.moveDown();
}
- //after removing a row, row positions must be updated, so selected rows could stay selected
- if(m_nRowSelected.size()>1)
- {
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();it!=m_nRowSelected.end();++it)
- {
- if(*it > _nRowPos)
- m_nRowSelected[i]=*it-1;
- ++i;
- }
- }
- if(_nRowPos == 0)
- m_nCurRow = 0;
- else
- m_nCurRow = _nRowPos-1;
+
+ if ( i_lastRow == ROW_INVALID )
+ aInvalidateRect.Bottom() = m_pDataWindow->GetOutputSizePixel().Height();
+
+ m_pDataWindow->Invalidate( aInvalidateRect );
}
+
//------------------------------------------------------------------------------
- void TableControl_Impl::invalidateRows()
+ void TableControl_Impl::checkCursorPosition()
{
- impl_ni_updateScrollbars();
+ DBG_CHECK_ME();
+
TableSize nVisibleRows = impl_getVisibleRows(true);
TableSize nVisibleCols = impl_getVisibleColumns(true);
- if(m_nTopRow+nVisibleRows>m_nRowCount && m_nRowCount>=nVisibleRows)
- m_nTopRow--;
+ if ( ( m_nTopRow + nVisibleRows > m_nRowCount )
+ && ( m_nRowCount >= nVisibleRows )
+ )
+ {
+ --m_nTopRow;
+ }
else
+ {
m_nTopRow = 0;
- if(m_nLeftColumn+nVisibleCols>m_nColumnCount && m_nColumnCount>=nVisibleCols)
- m_nLeftColumn--;
+ }
+
+ if ( ( m_nLeftColumn + nVisibleCols > m_nColumnCount )
+ && ( m_nColumnCount >= nVisibleCols )
+ )
+ {
+ --m_nLeftColumn;
+ }
else
+ {
m_nLeftColumn = 0;
+ }
+
m_pDataWindow->Invalidate();
}
@@ -1729,7 +2130,7 @@ namespace svt { namespace table
}
//--------------------------------------------------------------------
- TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialRow ) const
+ TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialCol ) const
{
DBG_CHECK_ME();
@@ -1739,7 +2140,7 @@ namespace svt { namespace table
Rectangle( Point( 0, 0 ), m_pDataWindow->GetOutputSizePixel() ),
m_nLeftColumn,
*this,
- _bAcceptPartialRow
+ _bAcceptPartialCol
);
}
@@ -1750,12 +2151,15 @@ namespace svt { namespace table
// TODO: give veto listeners a chance
- if ( ( _nColumn < -1 ) || ( _nColumn >= m_nColumnCount )
- || ( _nRow < -1 ) || ( _nRow >= m_nRowCount )
+ if ( ( _nColumn < 0 ) || ( _nColumn >= m_nColumnCount )
+ || ( _nRow < 0 ) || ( _nRow >= m_nRowCount )
)
+ {
+ OSL_ENSURE( false, "TableControl_Impl::goTo: invalid row or column index!" );
return false;
+ }
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
m_nCurColumn = _nColumn;
m_nCurRow = _nRow;
@@ -1772,32 +2176,40 @@ namespace svt { namespace table
&& ( _nRow >= 0 ) && ( _nRow < m_nRowCount ),
"TableControl_Impl::ensureVisible: invalid coordinates!" );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
if ( _nColumn < m_nLeftColumn )
- impl_ni_ScrollColumns( _nColumn - m_nLeftColumn );
+ impl_scrollColumns( _nColumn - m_nLeftColumn );
else
{
TableSize nVisibleColumns = impl_getVisibleColumns( _bAcceptPartialVisibility );
if ( _nColumn > m_nLeftColumn + nVisibleColumns - 1 )
{
- impl_ni_ScrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
+ impl_scrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
// TODO: since not all columns have the same width, this might in theory result
// in the column still not being visible.
}
}
if ( _nRow < m_nTopRow )
- impl_ni_ScrollRows( _nRow - m_nTopRow );
+ impl_scrollRows( _nRow - m_nTopRow );
else
{
TableSize nVisibleRows = impl_getVisibleRows( _bAcceptPartialVisibility );
if ( _nRow > m_nTopRow + nVisibleRows - 1 )
- impl_ni_ScrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
+ impl_scrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
}
}
//--------------------------------------------------------------------
+ ::rtl::OUString TableControl_Impl::getCellContentAsString( RowPos const i_row, ColPos const i_col )
+ {
+ ::com::sun::star::uno::Any content;
+ m_pModel->getCellContent( i_col, i_row, content );
+ return CellValueConversion::convertToString( content );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollRows( TableSize _nRowDelta )
{
// compute new top row
@@ -1811,10 +2223,10 @@ namespace svt { namespace table
m_nTopRow = nNewTopRow;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nTopRow != nOldTopRow ) )
+ if ( m_nTopRow != nOldTopRow )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
@@ -1837,43 +2249,68 @@ namespace svt { namespace table
m_pVScroll->SetThumbPos( m_nTopRow );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nTopRow == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nTopRow - nOldTopRow );
}
//--------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollRows( TableSize const i_rowDelta )
+ {
+ DBG_CHECK_ME();
+ return impl_ni_ScrollRows( i_rowDelta );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollColumns( TableSize _nColumnDelta )
{
// compute new left column
- ColPos nNewLeftColumn =
+ const ColPos nNewLeftColumn =
::std::max(
::std::min( (ColPos)( m_nLeftColumn + _nColumnDelta ), (ColPos)( m_nColumnCount - 1 ) ),
(ColPos)0
);
- ColPos nOldLeftColumn = m_nLeftColumn;
+ const ColPos nOldLeftColumn = m_nLeftColumn;
m_nLeftColumn = nNewLeftColumn;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nLeftColumn != nOldLeftColumn ) )
+ if ( m_nLeftColumn != nOldLeftColumn )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
// scroll the view port, if possible
- Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
+ const Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
long nPixelDelta =
- ( m_nLeftColumn > 0 ? m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ] : 0 )
- - ( nOldLeftColumn > 0 ? m_aAccColumnWidthsPixel[ nOldLeftColumn - 1 ] : 0 );
+ m_aColumnWidths[ nOldLeftColumn ].getStart()
+ - m_aColumnWidths[ m_nLeftColumn ].getStart();
+
+ // update our column positions
+ // Do this *before* scrolling, as SCROLL_UPDATE will trigger a paint, which already needs the correct
+ // information in m_aColumnWidths
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( nPixelDelta );
+ }
+ // scroll the window content (if supported and possible), or invalidate the complete window
if ( m_pDataWindow->GetBackground().IsScrollable()
&& abs( nPixelDelta ) < aDataArea.GetWidth()
)
{
- m_pDataWindow->Scroll( (long)-nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
+ m_pDataWindow->Scroll( nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
}
else
m_pDataWindow->Invalidate( INVALIDATE_UPDATE );
@@ -1882,39 +2319,55 @@ namespace svt { namespace table
m_pHScroll->SetThumbPos( m_nLeftColumn );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nLeftColumn == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nLeftColumn - nOldLeftColumn );
}
- //-------------------------------------------------------------------------------
- SelectionEngine* TableControl_Impl::getSelEngine()
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollColumns( TableSize const i_columnDelta )
{
- return m_pSelEngine;
+ DBG_CHECK_ME();
+ return impl_ni_ScrollColumns( i_columnDelta );
}
- //-------------------------------------------------------------------------------
- TableDataWindow* TableControl_Impl::getDataWindow()
+
+ //------------------------------------------------------------------------------------------------------------------
+ SelectionEngine* TableControl_Impl::getSelEngine()
{
- return m_pDataWindow;
+ return m_pSelEngine;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getHorzScrollbar()
{
return m_pHScroll;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getVertScrollbar()
{
return m_pVScroll;
}
- //-------------------------------------------------------------------------------
- BOOL TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::isRowSelected( RowPos i_row ) const
{
- return ::std::find(selectedRows.begin(),selectedRows.end(),current) != selectedRows.end();
+ return ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_row ) != m_aSelectedRows.end();
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isRowSelected(RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getSelectedRowIndex( size_t const i_selectionIndex ) const
{
- return ::std::find(m_nRowSelected.begin(),m_nRowSelected.end(),current) != m_nRowSelected.end();
+ if ( i_selectionIndex < m_aSelectedRows.size() )
+ return m_aSelectedRows[ i_selectionIndex ];
+ return ROW_INVALID;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
int TableControl_Impl::getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current)
{
std::vector<RowPos>::const_iterator it = ::std::find(selectedRows.begin(),selectedRows.end(),current);
@@ -1924,272 +2377,158 @@ namespace svt { namespace table
}
return -1;
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isTooltipActive()
- {
- return m_rAntiImpl.isTooltip();
- }
- //-------------------------------------------------------------------------------
- ::rtl::OUString& TableControl_Impl::setTooltip(const Point& rPoint )
+
+ //--------------------------------------------------------------------
+ ColPos TableControl_Impl::impl_getColumnForOrdinate( long const i_ordinate ) const
{
- ::rtl::OUString aTooltipText;
- RowPos current = getCurrentRow(rPoint);
- com::sun::star::uno::Sequence< sal_Int32 > cols = m_rAntiImpl.getColumnsForTooltip();
- com::sun::star::uno::Sequence< ::rtl::OUString > text = m_rAntiImpl.getTextForTooltip();
- if(text.getLength()==0 && cols.getLength()==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][m_nCurColumn];
- aTooltipText = convertToString(content);
- }
- else if(text.getLength() == 0)
- {
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText += convertToString(content);
- }
- }
- }
- else if(cols.getLength() == 0)
- {
- for(int i=0; i<text.getLength(); i++)
- {
- if(i==0)
- aTooltipText = text[i];
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- aTooltipText+= text[i];
- }
- }
- }
- else
+ DBG_CHECK_ME();
+
+ if ( ( m_aColumnWidths.empty() ) || ( i_ordinate < 0 ) )
+ return COL_INVALID;
+
+ if ( i_ordinate < m_nRowHeaderWidthPixel )
+ return COL_ROW_HEADERS;
+
+ long const ordinate = i_ordinate - m_nRowHeaderWidthPixel;
+
+ ColumnPositions::const_iterator lowerBound = ::std::lower_bound(
+ m_aColumnWidths.begin(),
+ m_aColumnWidths.end(),
+ ordinate + 1,
+ ColumnInfoPositionLess()
+ );
+ if ( lowerBound == m_aColumnWidths.end() )
{
- int nCols = cols.getLength();
- int mText = text.getLength();
- if(nCols < mText )
- cols.realloc(mText);
- else if(mText < nCols)
- text.realloc(nCols);
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = text[i] + convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ));
- aTooltipText+= text[i];
- if(nCols > i)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- aTooltipText += convertToString(content);
- }
- }
- }
+ // point is *behind* the start of the last column ...
+ if ( ordinate < m_aColumnWidths.rbegin()->getEnd() )
+ // ... but still before its end
+ return m_nColumnCount - 1;
+ return COL_INVALID;
}
- return m_aTooltipText = aTooltipText;
+ return lowerBound - m_aColumnWidths.begin();
}
+
//--------------------------------------------------------------------
- void TableControl_Impl::resizeColumn(const Point& rPoint)
- {
- Pointer aNewPointer(POINTER_ARROW);
- int resizingColumn=m_nCurColumn-m_nLeftColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nCurColumn);
- impl_ni_getAccVisibleColWidths();
- int newColWidth = m_aColumnWidthsPixel[m_nCurColumn];
- //subtract 1 from m_aAccColumnWidthPixel because right border should be part of the current cell
- if(m_aVisibleColumnWidthsPixel[resizingColumn]-1 == rPoint.X() && pColumn->isResizable())
- aNewPointer = Pointer( POINTER_HSPLIT );
- //MouseButton was pressed but not yet released, mouse is moving
- if(m_bResizing)
- {
- if(rPoint.X() > m_pDataWindow->GetOutputSizePixel().Width() || rPoint.X() < m_aVisibleColumnWidthsPixel[resizingColumn]-newColWidth)
- aNewPointer = Pointer( POINTER_NOTALLOWED);
- else
- aNewPointer = Pointer( POINTER_HSPLIT );
- m_pDataWindow->HideTracking();
- int lineHeight = 0;
- if(m_pModel->hasColumnHeaders())
- lineHeight+= m_nColHeaderHeightPixel;
- lineHeight+=m_nRowHeightPixel*m_nRowCount;
- int gridHeight = m_pDataWindow->GetOutputSizePixel().Height();
- if(lineHeight >= gridHeight)
- lineHeight = gridHeight;
- m_pDataWindow->ShowTracking(Rectangle(Point(rPoint.X(),0), Size(1, lineHeight )),
- SHOWTRACK_SPLIT | SHOWTRACK_WINDOW);
- }
- m_pDataWindow->SetPointer(aNewPointer);
+ RowPos TableControl_Impl::impl_getRowForAbscissa( long const i_abscissa ) const
+ {
+ DBG_CHECK_ME();
+
+ if ( i_abscissa < 0 )
+ return ROW_INVALID;
+
+ if ( i_abscissa < m_nColHeaderHeightPixel )
+ return ROW_COL_HEADERS;
+
+ long const abscissa = i_abscissa - m_nColHeaderHeightPixel;
+ long const row = m_nTopRow + abscissa / m_nRowHeightPixel;
+ return row < m_pModel->getRowCount() ? row : ROW_INVALID;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::startResizeColumn(const Point& rPoint)
+ bool TableControl_Impl::markRowAsDeselected( RowPos const i_rowIndex )
{
- m_bResizingGrid = false;
- m_nResizingColumn = m_nCurColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- if(m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-1 == rPoint.X() && pColumn->isResizable())
- {
- m_pDataWindow->CaptureMouse();
- m_bResizing = true;
- }
- return m_bResizing;
+ DBG_CHECK_ME();
+
+ ::std::vector< RowPos >::iterator selPos = ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_rowIndex );
+ if ( selPos == m_aSelectedRows.end() )
+ return false;
+
+ m_aSelectedRows.erase( selPos );
+ return true;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::endResizeColumn(const Point& rPoint)
- {
- if(m_bResizing)
- {
- m_pDataWindow->HideTracking();
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- int maxWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMaxWidth(), 0 ), MAP_APPFONT ).Width();
- int minWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMinWidth(), 0 ), MAP_APPFONT ).Width();
- int resizeCol = m_nResizingColumn-m_nLeftColumn;
- //new position of mouse
- int actX = rPoint.X();
- //old position of right border
- int oldX = m_aVisibleColumnWidthsPixel[resizeCol];
- //position of left border if cursor in the first cell
- int leftX = 0;
- if(m_nResizingColumn > m_nLeftColumn)
- leftX = m_aVisibleColumnWidthsPixel[resizeCol-1];
- else if(m_nResizingColumn == m_nLeftColumn && m_pModel->hasRowHeaders())
- leftX = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- int actWidth = actX - leftX;
- int newActWidth = 0;
- //minimize the column width
- if(oldX > actX && actX >= leftX)
+ bool TableControl_Impl::markRowAsSelected( RowPos const i_rowIndex )
+ {
+ DBG_CHECK_ME();
+
+ if ( isRowSelected( i_rowIndex ) )
+ return false;
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ switch ( eSelMode )
+ {
+ case SINGLE_SELECTION:
+ if ( !m_aSelectedRows.empty() )
{
- if(minWidth < actWidth)
- {
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
- }
- else
- pColumn->setPreferredWidth(pColumn->getMinWidth());
- if(m_nLeftColumn != 0)
- impl_updateLeftColumn();
+ OSL_ENSURE( m_aSelectedRows.size() == 1, "TableControl::markRowAsSelected: SingleSelection with more than one selected element?" );
+ m_aSelectedRows[0] = i_rowIndex;
+ break;
+ }
+ // fall through
+
+ case MULTIPLE_SELECTION:
+ m_aSelectedRows.push_back( i_rowIndex );
+ break;
+
+ default:
+ OSL_ENSURE( false, "TableControl_Impl::markRowAsSelected: unsupported selection mode!" );
+ return false;
}
- else if(oldX < actX)
+
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsDeselected()
+ {
+ if ( m_aSelectedRows.empty() )
+ return false;
+
+ m_aSelectedRows.clear();
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsSelected()
+ {
+ DBG_CHECK_ME();
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ ENSURE_OR_RETURN_FALSE( eSelMode == MULTIPLE_SELECTION, "TableControl_Impl::markAllRowsAsSelected: unsupported selection mode!" );
+
+ if ( m_aSelectedRows.size() == size_t( m_pModel->getRowCount() ) )
{
- if(actWidth < maxWidth)
+ #if OSL_DEBUG_LEVEL > 0
+ for ( TableSize row = 0; row < m_pModel->getRowCount(); ++row )
{
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
+ OSL_ENSURE( isRowSelected( row ), "TableControl_Impl::markAllRowsAsSelected: inconsistency in the selected rows!" );
}
- else
- pColumn->setPreferredWidth(pColumn->getMaxWidth());
+ #endif
+ // already all rows marked as selected
+ return false;
}
- m_nCurColumn = m_nResizingColumn;
- impl_ni_updateColumnWidths();
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(INVALIDATE_UPDATE);
- m_pDataWindow->SetPointer(Pointer());
- m_bResizing = false;
- m_bResizingGrid = true;
- }
- m_pDataWindow->ReleaseMouse();
- return m_bResizing;
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_ni_getAccVisibleColWidths()
- {
- TableSize nVisCols = impl_getVisibleColumns(true);
- int widthsPixel = 0;
- m_aVisibleColumnWidthsPixel.resize(0);
- m_aVisibleColumnWidthsPixel.reserve(nVisCols);
- int headerRowWidth = 0;
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- while(nVisCols)
- {
- m_aVisibleColumnWidthsPixel.push_back(widthsPixel+=m_aColumnWidthsPixel[col]);
- col++;
- nVisCols--;
- }
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_updateLeftColumn()
- {
- int nVisCols = m_aVisibleColumnWidthsPixel.size();
- int headerRowWidth = 0;
- //sum of currently visible columns
- int widthsPixel = 0;
- //header pixel should be added, because header doesn't vanish when scrolling
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- //add column width of the neighbour of the left column
- widthsPixel+=m_aColumnWidthsPixel[col-1];
- //compute the sum of the new column widths
- while(nVisCols)
- {
- PColumnModel pColumn = m_pModel->getColumnModel(col);
- int colWidth = pColumn->getWidth();
- int colPrefWidth = pColumn->getPreferredWidth();
- if(colPrefWidth!=0)
- colWidth = colPrefWidth;
- widthsPixel += m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- col++;
- nVisCols--;
- }
- //when the sum of all visible columns and the next to the left column is smaller than
- //window width, then update m_nLeftColumn
- if(widthsPixel<m_pDataWindow->GetOutputSizePixel().Width())
- m_nLeftColumn--;
+
+ m_aSelectedRows.clear();
+ for ( RowPos i=0; i < m_pModel->getRowCount(); ++i )
+ m_aSelectedRows.push_back(i);
+
+ return true;
}
+
//--------------------------------------------------------------------
- rtl::OUString TableControl_Impl::convertToString(const ::com::sun::star::uno::Any& value)
- {
- sal_Int32 nInt = 0;
- sal_Bool bBool = false;
- double fDouble = 0;
- ::rtl::OUString sNewString;
- ::rtl::OUString sConvertString;
- if(value >>= sConvertString)
- sNewString = sConvertString;
- else if(value >>= nInt)
- sNewString = sConvertString.valueOf(nInt);
- else if(value >>= bBool)
- sNewString = sConvertString.valueOf(bBool);
- else if(value >>= fDouble)
- sNewString = sConvertString.valueOf(fDouble);
- return sNewString;
- }
Rectangle TableControl_Impl::calcHeaderRect(bool bColHeader)
{
- Rectangle aRectTable, aRectTableWithHeaders;
- impl_getAllVisibleDataCellArea(aRectTable);
- impl_getAllVisibleCellsArea(aRectTableWithHeaders);
- Size aSizeTable(aRectTable.GetSize());
- Size aSizeTableWithHeaders(aRectTableWithHeaders.GetSize());
- if(bColHeader)
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width()-aSizeTable.Width(), aSizeTableWithHeaders.Height()));
+ Rectangle const aRectTableWithHeaders( impl_getAllVisibleCellsArea() );
+ Size const aSizeTableWithHeaders( aRectTableWithHeaders.GetSize() );
+ if ( bColHeader )
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( aSizeTableWithHeaders.Width(), m_nColHeaderHeightPixel ) );
else
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width(), aSizeTableWithHeaders.Height()-aSizeTable.Height()));
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( m_nRowHeaderWidthPixel, aSizeTableWithHeaders.Height() ) );
}
+
+ //--------------------------------------------------------------------
Rectangle TableControl_Impl::calcTableRect()
{
- Rectangle aRect;
- impl_getAllVisibleDataCellArea(aRect);
- return aRect;
+ return impl_getAllVisibleDataCellArea();
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( TableControl_Impl, OnUpdateScrollbars, void*, /**/ )
+ {
+ DBG_CHECK_ME();
+ impl_ni_updateScrollbars();
+ return 1L;
}
//--------------------------------------------------------------------
@@ -2205,159 +2544,202 @@ namespace svt { namespace table
return 0L;
}
- //---------------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl_Impl::getAccessible( Window& i_parentWindow )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pAccessibleTable == NULL )
+ {
+ Reference< XAccessible > const xAccParent = i_parentWindow.GetAccessible();
+ if ( xAccParent.is() )
+ {
+ m_pAccessibleTable = m_aFactoryAccess.getFactory().createAccessibleTableControl(
+ xAccParent, m_rAntiImpl
+ );
+ }
+ }
+
+ Reference< XAccessible > xAccessible;
+ if ( m_pAccessibleTable )
+ xAccessible = m_pAccessibleTable->getMyself();
+ return xAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::disposeAccessible()
+ {
+ if ( m_pAccessibleTable )
+ m_pAccessibleTable->dispose();
+ m_pAccessibleTable = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::impl_isAccessibleAlive() const
+ {
+ DBG_CHECK_ME();
+ return ( NULL != m_pAccessibleTable ) && m_pAccessibleTable->isAlive();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_commitAccessibleEvent( sal_Int16 const i_eventID, Any const & i_newValue, Any const & i_oldValue )
+ {
+ DBG_CHECK_ME();
+ if ( impl_isAccessibleAlive() )
+ m_pAccessibleTable->commitEvent( i_eventID, i_newValue, i_oldValue );
+ }
+
+ //==================================================================================================================
+ //= TableFunctionSet
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::TableFunctionSet(TableControl_Impl* _pTableControl)
:m_pTableControl( _pTableControl)
- ,m_nCurrentRow (-2)
+ ,m_nCurrentRow( ROW_INVALID )
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::~TableFunctionSet()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::BeginDrag()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::CreateAnchor()
{
- m_pTableControl->m_nAnchor = m_pTableControl->m_nCurRow;
+ m_pTableControl->setAnchor( m_pTableControl->getCurRow() );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DestroyAnchor()
{
- m_pTableControl->m_nAnchor = -1;
+ m_pTableControl->setAnchor( ROW_INVALID );
}
- //-------------------------------------------------------------------------------
- BOOL TableFunctionSet::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor)
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableFunctionSet::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
{
- BOOL bHandled = FALSE;
- Rectangle rCells;
- //curRow is the row where the mouse click happened, m_nCurRow is the last selected row, before the mouse click
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- if(curRow == -2)
- return FALSE;
- if( bDontSelectAtCursor )
+ sal_Bool bHandled = sal_False;
+ // newRow is the row which includes the point, getCurRow() is the last selected row, before the mouse click
+ RowPos newRow = m_pTableControl->getRowAtPoint( rPoint );
+ if ( newRow == ROW_COL_HEADERS )
+ newRow = m_pTableControl->getTopRow();
+
+ ColPos newCol = m_pTableControl->getColAtPoint( rPoint );
+ if ( newCol == COL_ROW_HEADERS )
+ newCol = m_pTableControl->getLeftColumn();
+
+ if ( ( newRow == ROW_INVALID ) || ( newCol == COL_INVALID ) )
+ return sal_False;
+
+ if ( bDontSelectAtCursor )
{
- if(m_pTableControl->m_nRowSelected.size()>1)
- m_pTableControl->m_pSelEngine->AddAlways(TRUE);
- bHandled = TRUE;
+ if ( m_pTableControl->getSelectedRowCount() > 1 )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
+ bHandled = sal_True;
}
- else if(m_pTableControl->m_nAnchor == m_pTableControl->m_nCurRow)
+ else if ( m_pTableControl->getAnchor() == m_pTableControl->getCurRow() )
{
//selecting region,
- int diff = m_pTableControl->m_nCurRow - curRow;
+ int diff = m_pTableControl->getCurRow() - newRow;
//selected region lies above the last selection
if( diff >= 0)
{
//put selected rows in vector
- while(m_pTableControl->m_nAnchor>=curRow)
+ while ( m_pTableControl->getAnchor() >= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- //if row isn't selected, put it in vector, otherwise don't put it there, because it will be twice there
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
diff--;
}
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
}
//selected region lies beneath the last selected row
else
{
- while(m_pTableControl->m_nAnchor<=curRow)
+ while ( m_pTableControl->getAnchor() <= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
diff++;
}
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
}
- m_pTableControl->invalidateSelectedRegion(m_pTableControl->m_nCurRow, curRow, rCells);
- bHandled = TRUE;
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( m_pTableControl->getCurRow(), newRow, aCellRect );
+ bHandled = sal_True;
}
//no region selected
else
{
- if(m_pTableControl->m_nRowSelected.empty())
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ if ( !m_pTableControl->hasRowSelection() )
+ m_pTableControl->markRowAsSelected( newRow );
else
{
- if(m_pTableControl->m_pSelEngine->GetSelectionMode()==SINGLE_SELECTION)
+ if ( m_pTableControl->getSelEngine()->GetSelectionMode() == SINGLE_SELECTION )
{
DeselectAll();
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
else
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
}
- if(m_pTableControl->m_nRowSelected.size()>1 && m_pTableControl->m_pSelEngine->GetSelectionMode()!=SINGLE_SELECTION)
- m_pTableControl->m_pSelEngine->AddAlways(TRUE);
- m_pTableControl->invalidateSelectedRegion(curRow, curRow, rCells);
- bHandled = TRUE;
+ if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SINGLE_SELECTION )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
+
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( newRow, newRow, aCellRect );
+ bHandled = sal_True;
}
- m_pTableControl->m_nCurRow = curRow;
- m_pTableControl->ensureVisible(m_pTableControl->m_nCurColumn,m_pTableControl->m_nCurRow,false);
+ m_pTableControl->goTo( newCol, newRow );
return bHandled;
}
- //-------------------------------------------------------------------------------
- BOOL TableFunctionSet::IsSelectionAtPoint( const Point& rPoint )
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableFunctionSet::IsSelectionAtPoint( const Point& rPoint )
{
- m_pTableControl->m_pSelEngine->AddAlways(FALSE);
- if(m_pTableControl->m_nRowSelected.empty())
- return FALSE;
+ m_pTableControl->getSelEngine()->AddAlways(sal_False);
+ if ( !m_pTableControl->hasRowSelection() )
+ return sal_False;
else
{
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- m_pTableControl->m_nAnchor = -1;
- bool selected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
+ RowPos curRow = m_pTableControl->getRowAtPoint( rPoint );
+ m_pTableControl->setAnchor( ROW_INVALID );
+ bool selected = m_pTableControl->isRowSelected( curRow );
m_nCurrentRow = curRow;
return selected;
}
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAtPoint( const Point& rPoint )
{
(void)rPoint;
- long pos = 0;
- long i = 0;
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
- {
- if(*it == m_nCurrentRow)
- {
- pos = i;
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
- }
- ++i;
- }
- m_pTableControl->m_nRowSelected.erase(m_pTableControl->m_nRowSelected.begin()+pos);
+ Rectangle aCellRange;
+ m_pTableControl->invalidateSelectedRegion( m_nCurrentRow, m_nCurrentRow, aCellRange );
+ m_pTableControl->markRowAsDeselected( m_nCurrentRow );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAll()
{
- if(!m_pTableControl->m_nRowSelected.empty())
+ if ( m_pTableControl->hasRowSelection() )
{
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
+ Rectangle aCellRange;
+ for ( size_t i=0; i<m_pTableControl->getSelectedRowCount(); ++i )
{
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
+ RowPos const rowIndex = m_pTableControl->getSelectedRowIndex(i);
+ m_pTableControl->invalidateSelectedRegion( rowIndex, rowIndex, aCellRange );
}
- m_pTableControl->m_nRowSelected.clear();
+
+ m_pTableControl->markAllRowsAsDeselected();
}
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx
index 3f10f9ce2830..2f9cffd3089b 100644..100755
--- a/svtools/source/table/tablecontrol_impl.hxx
+++ b/svtools/source/table/tablecontrol_impl.hxx
@@ -28,14 +28,16 @@
#ifndef SVTOOLS_TABLECONTROL_IMPL_HXX
#define SVTOOLS_TABLECONTROL_IMPL_HXX
-#include <svtools/table/tablemodel.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
-#include <svtools/table/abstracttablecontrol.hxx>
+#include "svtaccessiblefactory.hxx"
-#include <svtools/table/tablemodel.hxx>
-#include <vector>
#include <vcl/seleng.hxx>
+#include <vector>
+
+#include <boost/scoped_ptr.hpp>
class ScrollBar;
class ScrollBarBox;
@@ -45,7 +47,42 @@ namespace svt { namespace table
{
//........................................................................
- typedef ::std::vector< long > ArrayOfLong;
+ struct MutableColumnMetrics : protected ColumnMetrics
+ {
+ MutableColumnMetrics()
+ :ColumnMetrics()
+ {
+ }
+
+ MutableColumnMetrics( long const i_startPixel, long const i_endPixel )
+ :ColumnMetrics( i_startPixel, i_endPixel )
+ {
+ }
+
+ long getStart() const { return nStartPixel; }
+ long getEnd() const { return nEndPixel; }
+
+ void setEnd( long const i_end ) { nEndPixel = i_end; }
+ void move( long const i_offset ) { nStartPixel += i_offset; nEndPixel += i_offset; }
+
+ long getWidth() const { return nEndPixel - nStartPixel; }
+
+ ColumnMetrics const & operator()() { return *this; }
+ };
+
+ struct ColumnInfoPositionLess
+ {
+ bool operator()( MutableColumnMetrics const& i_colInfo, long const i_position )
+ {
+ return i_colInfo.getEnd() < i_position;
+ }
+ bool operator()( long const i_position, MutableColumnMetrics const& i_colInfo )
+ {
+ return i_position < i_colInfo.getStart();
+ }
+ };
+
+ typedef ::std::vector< MutableColumnMetrics > ColumnPositions;
class TableControl;
class TableDataWindow;
@@ -54,13 +91,14 @@ namespace svt { namespace table
//====================================================================
//= TableControl_Impl
//====================================================================
- class TableControl_Impl : public IAbstractTableControl
+ class TableControl_Impl :public ITableControl
+ ,public ITableModelListener
{
friend class TableGeometry;
friend class TableRowGeometry;
friend class TableColumnGeometry;
friend class SuspendInvariants;
- friend class TableFunctionSet;
+
private:
/// the control whose impl-instance we implemnt
TableControl& m_rAntiImpl;
@@ -68,14 +106,9 @@ namespace svt { namespace table
PTableModel m_pModel;
/// the input handler to use, usually the input handler as provided by ->m_pModel
PTableInputHandler m_pInputHandler;
- /// the widths of the single columns, measured in pixel
- ArrayOfLong m_aColumnWidthsPixel;
- /** the accumulated widths of the single columns, i.e. their exclusive right borders,
- <strong<not</strong> counting the space for a possible row header column
- */
- ArrayOfLong m_aAccColumnWidthsPixel;
+ /// info about the widths of our columns
+ ColumnPositions m_aColumnWidths;
- ArrayOfLong m_aVisibleColumnWidthsPixel;
/// the height of a single row in the table, measured in pixels
long m_nRowHeightPixel;
/// the height of the column header row in the table, measured in pixels
@@ -85,9 +118,13 @@ namespace svt { namespace table
/// the number of columns in the table control. Cached model value.
TableSize m_nColumnCount;
+
/// the number of rows in the table control. Cached model value.
TableSize m_nRowCount;
+ /// denotes whether or not the columns fitted into the available width, last time we checked
+ long m_bColumnsFit;
+
ColPos m_nCurColumn;
RowPos m_nCurRow;
ColPos m_nLeftColumn;
@@ -100,24 +137,27 @@ namespace svt { namespace table
The window's upper left corner is at position (0,0), relative to the
table control, which is the direct parent of the data window.
*/
- TableDataWindow* m_pDataWindow;
+ ::boost::scoped_ptr< TableDataWindow >
+ m_pDataWindow;
/// the vertical scrollbar, if any
ScrollBar* m_pVScroll;
/// the horizontal scrollbar, if any
- ScrollBar* m_pHScroll;
+ ScrollBar* m_pHScroll;
ScrollBarBox* m_pScrollCorner;
- //selection engine - for determining selection range, e.g. single, multiple
- SelectionEngine* m_pSelEngine;
- //vector which contains the selected rows
- std::vector<RowPos> m_nRowSelected;
- //part of selection engine
- TableFunctionSet* m_pTableFunctionSet;
- //part of selection engine
- RowPos m_nAnchor;
- bool m_bResizing;
- ColPos m_nResizingColumn;
- bool m_bResizingGrid;
- rtl::OUString m_aTooltipText;
+ //selection engine - for determining selection range, e.g. single, multiple
+ SelectionEngine* m_pSelEngine;
+ //vector which contains the selected rows
+ std::vector<RowPos> m_aSelectedRows;
+ //part of selection engine
+ TableFunctionSet* m_pTableFunctionSet;
+ //part of selection engine
+ RowPos m_nAnchor;
+ bool m_bUpdatingColWidths;
+
+ Link m_aSelectHdl;
+
+ AccessibleFactoryAccess m_aFactoryAccess;
+ IAccessibleTableControl* m_pAccessibleTable;
#if DBG_UTIL
#define INV_SCROLL_POSITION 1
@@ -130,21 +170,18 @@ namespace svt { namespace table
#endif
public:
-
-
- PTableModel getModel() const;
void setModel( PTableModel _pModel );
inline const PTableInputHandler& getInputHandler() const { return m_pInputHandler; }
- inline ColPos getCurColumn() const { return m_nCurColumn; }
- inline RowPos getCurRow() const { return m_nCurRow; }
- inline void setCurRow(RowPos curRow){ m_nCurRow = curRow; }
- inline RowPos getTopRow() const { return m_nTopRow; }
- inline long getRowCount() const { return m_nRowCount; }
- inline long getColumnCount() const { return m_nColumnCount; }
+ inline RowPos getCurRow() const { return m_nCurRow; }
+ inline void setCurRow( RowPos i_curRow ){ m_nCurRow = i_curRow; }
+
+ RowPos getAnchor() const { return m_nAnchor; }
+ void setAnchor( RowPos const i_anchor ) { m_nAnchor = i_anchor; }
- inline long getColHeaderHightPixel() const { return m_nColHeaderHeightPixel; }
+ inline RowPos getTopRow() const { return m_nTopRow; }
+ inline ColPos getLeftColumn() const { return m_nLeftColumn; }
inline const TableControl& getAntiImpl() const { return m_rAntiImpl; }
inline TableControl& getAntiImpl() { return m_rAntiImpl; }
@@ -182,45 +219,115 @@ namespace svt { namespace table
<TRUE/> if it's okay that the given cooordinate is only partially visible
*/
void ensureVisible( ColPos _nColumn, RowPos _nRow, bool _bAcceptPartialVisibility );
- /** returns the row, which contains the input point*/
- virtual RowPos getCurrentRow (const Point& rPoint);
-
- void setCursorAtCurrentCell(const Point& rPoint);
- /** checks whether the vector with the selected rows contains the current row*/
- BOOL isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current);
-
- bool isRowSelected(RowPos current);
- /** returns the position of the current row in the selection vector */
- int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
- /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
- void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
- /** to be called when a new row is added to the control*/
- void invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect );
- /** returns the vector, which contains the selected rows*/
- std::vector<RowPos>& getSelectedRows();
- /** updates the vector, which contains the selected rows after removing the row nRowPos*/
- void removeSelectedRow(RowPos _nRowPos);
- void invalidateRows();
- void clearSelection();
- // IAbstractTableControl
- virtual void hideCursor();
- virtual void showCursor();
- virtual bool dispatchAction( TableControlAction _eAction );
- virtual SelectionEngine* getSelEngine();
- virtual bool isTooltipActive();
- virtual rtl::OUString& setTooltip(const Point& rPoint );
- virtual void resizeColumn(const Point& rPoint);
- virtual bool startResizeColumn(const Point& rPoint);
- virtual bool endResizeColumn(const Point& rPoint);
-
- TableDataWindow* getDataWindow();
- ScrollBar* getHorzScrollbar();
- ScrollBar* getVertScrollbar();
-
- ::rtl::OUString convertToString(const ::com::sun::star::uno::Any& _value);
- Rectangle calcHeaderRect(bool bColHeader);
- Rectangle calcTableRect();
+
+ /** retrieves the content of the given cell, converted to a string
+ */
+ ::rtl::OUString getCellContentAsString( RowPos const i_row, ColPos const i_col );
+
+ /** returns the position of the current row in the selection vector */
+ int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
+
+ /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
+ void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
+
+ /** invalidates the part of the data window which is covered by the given row
+ @param i_firstRow
+ the index of the first row to include in the invalidation
+ @param i_lastRow
+ the index of the last row to include in the invalidation, or ROW_INVALID if the invalidation
+ should happen down to the bottom of the data window.
+ */
+ void invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow );
+
+ void checkCursorPosition();
+
+ bool hasRowSelection() const { return !m_aSelectedRows.empty(); }
+ size_t getSelectedRowCount() const { return m_aSelectedRows.size(); }
+ RowPos getSelectedRowIndex( size_t const i_selectionIndex ) const;
+
+ /** removes the given row index from m_aSelectedRows
+
+ @return
+ <TRUE/> if and only if the row was previously marked as selected
+ */
+ bool markRowAsDeselected( RowPos const i_rowIndex );
+
+ /** marks the given row as selectged, by putting it into m_aSelectedRows
+ @return
+ <TRUE/> if and only if the row was previously <em>not</em> marked as selected
+ */
+ bool markRowAsSelected( RowPos const i_rowIndex );
+
+ /** marks all rows as deselected
+ @return
+ <TRUE/> if and only if the selection actually changed by this operation
+ */
+ bool markAllRowsAsDeselected();
+
+ /** marks all rows as selected
+ @return
+ <FALSE/> if and only if all rows were selected already.
+ */
+ bool markAllRowsAsSelected();
+
+ void setSelectHandler( Link const & i_selectHandler ) { m_aSelectHdl = i_selectHandler; }
+ Link const& getSelectHandler() const { return m_aSelectHdl; }
+
+ // ITableControl
+ virtual void hideCursor();
+ virtual void showCursor();
+ virtual bool dispatchAction( TableControlAction _eAction );
+ virtual SelectionEngine* getSelEngine();
+ virtual PTableModel getModel() const;
+ virtual ColPos getCurrentColumn() const;
+ virtual RowPos getCurrentRow() const;
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row );
+ virtual ::Size getTableSizePixel() const;
+ virtual void setPointer( Pointer const & i_pointer );
+ virtual void captureMouse();
+ virtual void releaseMouse();
+ virtual void invalidate( TableArea const i_what );
+ virtual long pixelWidthToAppFont( long const i_pixels ) const;
+ virtual void hideTracking();
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags );
+ virtual RowPos getRowAtPoint( const Point& rPoint ) const;
+ virtual ColPos getColAtPoint( const Point& rPoint ) const;
+ virtual TableCell hitTest( const Point& rPoint ) const;
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const;
+ virtual bool isRowSelected( RowPos i_row ) const;
+
+
+ TableDataWindow& getDataWindow() { return *m_pDataWindow; }
+ const TableDataWindow& getDataWindow() const { return *m_pDataWindow; }
+ ScrollBar* getHorzScrollbar();
+ ScrollBar* getVertScrollbar();
+
+ Rectangle calcHeaderRect(bool bColHeader);
+ Rectangle calcTableRect();
+
+ // A11Y
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessible( Window& i_parentWindow );
+ void disposeAccessible();
+
+ // ITableModelListener
+ virtual void rowsInserted( RowPos first, RowPos last );
+ virtual void rowsRemoved( RowPos first, RowPos last );
+ virtual void columnInserted( ColPos const i_colIndex );
+ virtual void columnRemoved( ColPos const i_colIndex );
+ virtual void allColumnsRemoved();
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow );
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup );
+ virtual void tableMetricsChanged();
+
private:
+ bool impl_isAccessibleAlive() const;
+ void impl_commitAccessibleEvent(
+ sal_Int16 const i_eventID,
+ ::com::sun::star::uno::Any const & i_newValue,
+ ::com::sun::star::uno::Any const & i_oldValue
+ );
+
/** toggles the cursor visibility
The method is not bound to the classes public invariants, as it's used in
@@ -248,7 +355,7 @@ namespace svt { namespace table
specifies whether a possible only partially visible last row is
counted, too.
*/
- TableSize impl_getVisibleColumns( bool _bAcceptPartialRow ) const;
+ TableSize impl_getVisibleColumns( bool _bAcceptPartialCol ) const;
/** determines the rectangle occupied by the given cell
*/
@@ -261,15 +368,20 @@ namespace svt { namespace table
*/
void impl_ni_updateCachedModelValues();
- /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
+ /** updates the cached table metrics (row height etc.)
+ */
+ void impl_ni_updateCachedTableMetrics();
- The method takes into account the current zoom factor and map mode of the table
- control, plus any possible COLWIDTH_FIT_TO_VIEW widths in the model columns.
+ /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
The method is not bound to the classes public invariants, as it's used in
situations where the they must not necessarily be fullfilled.
+
+ @param i_assumeInflexibleColumnsUpToIncluding
+ the index of a column up to which all columns should be considered as inflexible, or
+ <code>COL_INVALID</code>.
*/
- void impl_ni_updateColumnWidths();
+ void impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID );
/** updates the scrollbars of the control
@@ -293,6 +405,10 @@ namespace svt { namespace table
*/
TableSize impl_ni_ScrollRows( TableSize _nRowDelta );
+ /** equivalent to impl_ni_ScrollRows, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollRows( TableSize const i_rowDelta );
+
/** scrolls the view by the given number of columns
The method is not bound to the classes public invariants, as it's used in
@@ -303,8 +419,13 @@ namespace svt { namespace table
from the given numbers to scroll in case the begin or the end of the
column range were reached.
*/
- TableSize impl_ni_ScrollColumns( TableSize _nRowDelta );
- /** retrieves the area occupied by the totality of (at least partially) visible cells
+ TableSize impl_ni_ScrollColumns( TableSize _nColumnDelta );
+
+ /** equivalent to impl_ni_ScrollColumns, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollColumns( TableSize const i_columnDelta );
+
+ /** retrieves the area occupied by the totality of (at least partially) visible cells
The returned area includes row and column headers. Also, it takes into
account the the fact that there might be less columns than would normally
@@ -313,27 +434,37 @@ namespace svt { namespace table
As a result of respecting the partial visibility of rows and columns,
the returned area might be larger than the data window's output size.
*/
- void impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleCellsArea() const;
/** retrieves the area occupied by all (at least partially) visible data cells.
Effectively, the returned area is the same as returned by ->impl_getAllVisibleCellsArea,
minus the row and column header areas.
*/
- void impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleDataCellArea() const;
+
+ /** retrieves the column which covers the given ordinate
+ */
+ ColPos impl_getColumnForOrdinate( long const i_ordinate ) const;
- void impl_ni_getAccVisibleColWidths();
- void impl_updateLeftColumn();
+ /** retrieves the row which covers the given abscissa
+ */
+ RowPos impl_getRowForAbscissa( long const i_abscissa ) const;
+
+ /// invalidates the window area occupied by the given column
+ void impl_invalidateColumn( ColPos const i_column );
DECL_LINK( OnScroll, ScrollBar* );
+ DECL_LINK( OnUpdateScrollbars, void* );
};
+
//see seleng.hxx, seleng.cxx, FunctionSet overridables, part of selection engine
class TableFunctionSet : public FunctionSet
{
- friend class TableDataWindow;
private:
- TableControl_Impl* m_pTableControl;
- RowPos m_nCurrentRow;
+ TableControl_Impl* m_pTableControl;
+ RowPos m_nCurrentRow;
+
public:
TableFunctionSet(TableControl_Impl* _pTableControl);
virtual ~TableFunctionSet();
@@ -341,8 +472,8 @@ namespace svt { namespace table
virtual void BeginDrag();
virtual void CreateAnchor();
virtual void DestroyAnchor();
- virtual BOOL SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor);
- virtual BOOL IsSelectionAtPoint( const Point& rPoint );
+ virtual sal_Bool SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor);
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPoint );
virtual void DeselectAtPoint( const Point& rPoint );
virtual void DeselectAll();
};
diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx
index 9607ec93036c..7c546421555d 100644
--- a/svtools/source/table/tabledatawindow.cxx
+++ b/svtools/source/table/tabledatawindow.cxx
@@ -29,23 +29,31 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
+#include "tablegeometry.hxx"
+#include "cellvalueconversion.hxx"
+
#include <vcl/help.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
- class TableControl_Impl;
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
//= TableDataWindow
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl )
:Window( &_rTableControl.getAntiImpl() )
- ,m_rTableControl ( _rTableControl )
+ ,m_rTableControl( _rTableControl )
+ ,m_nTipWindowHandle( 0 )
{
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -53,105 +61,164 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ TableDataWindow::~TableDataWindow()
+ {
+ impl_hideTipWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::Paint( const Rectangle& rUpdateRect )
{
m_rTableControl.doPaintContent( rUpdateRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground( const Wallpaper& rColor )
{
Window::SetBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground( const Color& rColor )
{
Window::SetControlBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground()
{
Window::SetBackground();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground()
{
Window::SetControlBackground();
}
- //--------------------------------------------------------------------
- void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::RequestHelp( const HelpEvent& rHEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ sal_uInt16 const nHelpMode = rHEvt.GetMode();
+ if ( ( IsMouseCaptured() )
+ || ( ( nHelpMode & HELPMODE_QUICK ) == 0 )
+ )
+ {
+ Window::RequestHelp( rHEvt );
+ return;
+ }
+
+ ::rtl::OUString sHelpText;
+ sal_uInt16 nHelpStyle = 0;
+
+ Point const aMousePos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aMousePos );
+ ColPos const hitCol = m_rTableControl.getColAtPoint( aMousePos );
+
+ PTableModel const pTableModel( m_rTableControl.getModel() );
+ if ( ( hitCol >= 0 ) && ( hitCol < pTableModel->getColumnCount() ) )
{
- if(m_rTableControl.getCurrentRow(aPoint)>=0 && m_rTableControl.isTooltipActive() )
+ if ( hitRow == ROW_COL_HEADERS )
{
- SetPointer(POINTER_ARROW);
- rtl::OUString& rHelpText = m_rTableControl.setTooltip(aPoint);
- Help::EnableBalloonHelp();
- Window::SetHelpText( rHelpText.getStr());
+ sHelpText = pTableModel->getColumnModel( hitCol )->getHelpText();
}
- else if(m_rTableControl.getCurrentRow(aPoint) == -1)
+ else if ( ( hitRow >= 0 ) && ( hitRow < pTableModel->getRowCount() ) )
{
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- m_rTableControl.resizeColumn(aPoint);
+ Any aCellToolTip;
+ pTableModel->getCellToolTip( hitCol, hitRow, aCellToolTip );
+ if ( !aCellToolTip.hasValue() )
+ {
+ // use the cell content
+ pTableModel->getCellContent( hitCol, hitRow, aCellToolTip );
+
+ // use the cell content as tool tip only if it doesn't fit into the cell.
+ bool const activeCell = ( hitRow == m_rTableControl.getCurrentRow() ) && ( hitCol == m_rTableControl.getCurrentColumn() );
+ bool const selectedCell = m_rTableControl.isRowSelected( hitRow );
+
+ Rectangle const aWindowRect( Point( 0, 0 ), GetOutputSizePixel() );
+ TableCellGeometry const aCell( m_rTableControl, aWindowRect, hitCol, hitRow );
+ Rectangle const aCellRect( aCell.getRect() );
+
+ PTableRenderer const pRenderer = pTableModel->getRenderer();
+ if ( pRenderer->FitsIntoCell( aCellToolTip, hitCol, hitRow, activeCell, selectedCell, *this, aCellRect ) )
+ aCellToolTip.clear();
+ }
+
+ sHelpText = CellValueConversion::convertToString( aCellToolTip );
+
+ if ( sHelpText.indexOf( '\n' ) >= 0 )
+ nHelpStyle = QUICKHELP_TIP_STYLE_BALLOON;
}
+ }
+
+ if ( sHelpText.getLength() )
+ {
+ Rectangle const aControlScreenRect(
+ OutputToScreenPixel( Point( 0, 0 ) ),
+ GetOutputSizePixel()
+ );
+
+ if ( m_nTipWindowHandle )
+ Help::UpdateTip( m_nTipWindowHandle, this, aControlScreenRect, sHelpText );
else
- {
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- Window::MouseMove( rMEvt );
- }
+ m_nTipWindowHandle = Help::ShowTip( this, aControlScreenRect, sHelpText, nHelpStyle );
}
+ else
+ impl_hideTipWindow();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::impl_hideTipWindow()
+ {
+ if ( m_nTipWindowHandle != 0 )
+ {
+ Help::HideTip( m_nTipWindowHandle );
+ m_nTipWindowHandle = 0;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+ {
+ if ( rMEvt.IsLeaveWindow() )
+ impl_hideTipWindow();
+
+ if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ {
+ Window::MouseMove( rMEvt );
+ }
+ }
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint);
- std::vector<RowPos> selectedRows(m_rTableControl.getSelectedRows());
+ impl_hideTipWindow();
+
+ Point const aPoint = rMEvt.GetPosPixel();
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aPoint );
+ bool const wasRowSelected = m_rTableControl.isRowSelected( hitRow );
+
if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) )
- Window::MouseButtonDown( rMEvt );
- else
{
- if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION)
- {
- bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end();
+ Window::MouseButtonDown( rMEvt );
+ return;
+ }
- if( !found )
- {
- m_aSelectHdl.Call( NULL );
- }
- }
+ bool const isRowSelected = m_rTableControl.isRowSelected( hitRow );
+ if ( isRowSelected != wasRowSelected )
+ {
+ m_aSelectHdl.Call( NULL );
}
m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().LoseFocus();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) )
Window::MouseButtonUp( rMEvt );
+
m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().GetFocus();
+ m_rTableControl.getAntiImpl().GrabFocus();
}
- //--------------------------------------------------------------------
- void TableDataWindow::SetPointer( const Pointer& rPointer )
- {
- Window::SetPointer(rPointer);
- }
- //--------------------------------------------------------------------
- void TableDataWindow::CaptureMouse()
- {
- Window::CaptureMouse();
- }
- //--------------------------------------------------------------------
- void TableDataWindow::ReleaseMouse( )
- {
- Window::ReleaseMouse();
- }
- // -----------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
long TableDataWindow::Notify(NotifyEvent& rNEvt )
{
long nDone = 0;
@@ -169,8 +236,8 @@ namespace svt { namespace table
}
return nDone ? nDone : Window::Notify( rNEvt );
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/source/table/tabledatawindow.hxx
index ea59e05f4e97..c26cd6ccd596 100644
--- a/svtools/inc/svtools/table/tabledatawindow.hxx
+++ b/svtools/source/table/tabledatawindow.hxx
@@ -54,8 +54,12 @@ namespace svt { namespace table
Link m_aMouseButtonDownHdl;
Link m_aMouseButtonUpHdl;
Link m_aSelectHdl;
+ sal_uLong m_nTipWindowHandle;
+
public:
TableDataWindow( TableControl_Impl& _rTableControl );
+ ~TableDataWindow();
+
inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; }
inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; }
inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; }
@@ -68,15 +72,16 @@ namespace svt { namespace table
virtual void MouseMove( const MouseEvent& rMEvt);
virtual void MouseButtonDown( const MouseEvent& rMEvt);
virtual void MouseButtonUp( const MouseEvent& rMEvt);
- virtual void SetPointer( const Pointer& rPointer );
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
virtual long Notify(NotifyEvent& rNEvt);
virtual void SetControlBackground(const Color& rColor);
virtual void SetControlBackground();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
void SetBackground(const Wallpaper& rColor);
void SetBackground();
+
+ private:
+ void impl_hideTipWindow();
};
//........................................................................
} } // namespace svt::table
diff --git a/svtools/source/table/tablegeometry.cxx b/svtools/source/table/tablegeometry.cxx
index edd2a73cd624..e00e21c28911 100644
--- a/svtools/source/table/tablegeometry.cxx
+++ b/svtools/source/table/tablegeometry.cxx
@@ -28,107 +28,141 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
#include <tools/debug.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableRowGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableRowGeometry::TableRowGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- RowPos _nRow )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableRowGeometry::TableRowGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ RowPos const _nRow, bool const i_allowVirtualRows )
:TableGeometry( _rControl, _rBoundaries )
,m_nRowPos( _nRow )
+ ,m_bAllowVirtualRows( i_allowVirtualRows )
{
if ( m_nRowPos == ROW_COL_HEADERS )
{
- //DBG_ASSERT( m_rControl.m_pModel->hasColumnHeaders(),
- // "TableRowGeometry::TableRowGeometry: why asking for the geoemtry of the non-existent column header row?" );
m_aRect.Top() = 0;
m_aRect.Bottom() = m_rControl.m_nColHeaderHeightPixel - 1;
}
else
{
- if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && ( m_nRowPos < m_rControl.m_pModel->getRowCount() ) )
- {
- m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
- m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
- }
- else
- m_aRect.SetEmpty();
+ impl_initRect();
}
}
- //--------------------------------------------------------------------
- bool TableRowGeometry::moveDown()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableRowGeometry::impl_initRect()
{
- if ( ++m_nRowPos < m_rControl.m_pModel->getRowCount() )
- m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && impl_isValidRow( m_nRowPos ) )
+ {
+ m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
+ m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
+ }
else
m_aRect.SetEmpty();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::impl_isValidRow( RowPos const i_row ) const
+ {
+ return m_bAllowVirtualRows || ( i_row < m_rControl.m_pModel->getRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::moveDown()
+ {
+ if ( m_nRowPos == ROW_COL_HEADERS )
+ {
+ m_nRowPos = m_rControl.m_nTopRow;
+ impl_initRect();
+ }
+ else
+ {
+ if ( impl_isValidRow( ++m_nRowPos ) )
+ m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
- //====================================================================
+ //==================================================================================================================
//= TableColumnGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableColumnGeometry::TableColumnGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- ColPos _nCol )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableColumnGeometry::TableColumnGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ ColPos const _nCol, bool const i_allowVirtualColumns )
:TableGeometry( _rControl, _rBoundaries )
,m_nColPos( _nCol )
+ ,m_bAllowVirtualColumns( i_allowVirtualColumns )
{
if ( m_nColPos == COL_ROW_HEADERS )
{
-/* DBG_ASSERT( m_rControl.m_pModel->hasRowHeaders(),
- "TableColumnGeometry::TableColumnGeometry: why asking for the geoemtry of the non-existent row header column?" )*/;
m_aRect.Left() = 0;
m_aRect.Right() = m_rControl.m_nRowHeaderWidthPixel - 1;
}
else
{
- ColPos nLeftColumn = m_rControl.m_nLeftColumn;
- if ( ( m_nColPos >= nLeftColumn ) && ( m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() ) )
- {
- m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
- // TODO: take into account any possibly frozen columns
+ impl_initRect();
+ }
+ }
- for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
- m_aRect.Left() += m_rControl.m_aColumnWidthsPixel[ col ];
- m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidthsPixel[ m_nColPos ] - 1;
- }
- else
- m_aRect.SetEmpty();
+ //------------------------------------------------------------------------------------------------------------------
+ void TableColumnGeometry::impl_initRect()
+ {
+ ColPos nLeftColumn = m_rControl.m_nLeftColumn;
+ if ( ( m_nColPos >= nLeftColumn ) && impl_isValidColumn( m_nColPos ) )
+ {
+ m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
+ // TODO: take into account any possibly frozen columns
+
+ for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
+ m_aRect.Left() += m_rControl.m_aColumnWidths[ col ].getWidth();
+ m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1;
}
+ else
+ m_aRect.SetEmpty();
}
- //--------------------------------------------------------------------
- bool TableColumnGeometry::moveRight()
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::impl_isValidColumn( ColPos const i_column ) const
{
- DBG_ASSERT( m_nColPos != COL_ROW_HEADERS, "TableColumnGeometry::moveRight: cannot move the row header column!" );
- // what would be COL_ROW_HEADERS + 1?
+ return m_bAllowVirtualColumns || ( i_column < ColPos( m_rControl.m_aColumnWidths.size() ) );
+ }
- if ( ++m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() )
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::moveRight()
+ {
+ if ( m_nColPos == COL_ROW_HEADERS )
{
- m_aRect.Left() = m_aRect.Right() + 1;
- m_aRect.Right() += m_rControl.m_aColumnWidthsPixel[ m_nColPos ];
+ m_nColPos = m_rControl.m_nLeftColumn;
+ impl_initRect();
}
else
- m_aRect.SetEmpty();
+ {
+ if ( impl_isValidColumn( ++m_nColPos ) )
+ {
+ m_aRect.Left() = m_aRect.Right() + 1;
+ m_aRect.Right() += m_rControl.m_aColumnWidths[ m_nColPos ].getWidth();
+ }
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/table/tablegeometry.hxx b/svtools/source/table/tablegeometry.hxx
index 979a78d0a5a2..9520e4992411 100644
--- a/svtools/source/table/tablegeometry.hxx
+++ b/svtools/source/table/tablegeometry.hxx
@@ -28,7 +28,7 @@
#ifndef SVTOOLS_TABLEGEOMETRY_HXX
#define SVTOOLS_TABLEGEOMETRY_HXX
-#include <svtools/table/tabletypes.hxx>
+#include "svtools/table/tabletypes.hxx"
#include <tools/gen.hxx>
@@ -76,18 +76,25 @@ namespace svt { namespace table
{
protected:
RowPos m_nRowPos;
+ bool m_bAllowVirtualRows;
public:
TableRowGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ RowPos const _nRow,
+ bool const i_allowVirtualRows = false
+ // allow rows >= getRowCount()?
);
// status
RowPos getRow() const { return m_nRowPos; }
// operations
bool moveDown();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidRow( RowPos const i_row ) const;
};
//====================================================================
@@ -97,18 +104,24 @@ namespace svt { namespace table
{
protected:
ColPos m_nColPos;
+ bool m_bAllowVirtualColumns;
public:
TableColumnGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ bool const i_allowVirtualColumns = false
);
// status
ColPos getCol() const { return m_nColPos; }
// operations
bool moveRight();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidColumn( ColPos const i_column ) const;
};
//====================================================================
@@ -124,13 +137,14 @@ namespace svt { namespace table
public:
TableCellGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ RowPos const _nRow,
+ bool const i_alllowVirtualCells = false
)
- :m_aRow( _rControl, _rBoundaries, _nRow )
- ,m_aCol( _rControl, _rBoundaries, _nCol )
+ :m_aRow( _rControl, _rBoundaries, _nRow, i_alllowVirtualCells )
+ ,m_aCol( _rControl, _rBoundaries, _nCol, i_alllowVirtualCells )
{
}
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 4a5ebfc95260..f6c36d673691 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -148,10 +148,10 @@ namespace svt
const PToolPanelDrawer pDrawer( m_aDrawers[ i_nChildIndex ] );
- Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( FALSE );
+ Reference< XAccessible > xItemAccessible = pDrawer->GetAccessible( sal_False );
if ( !xItemAccessible.is() )
{
- xItemAccessible = pDrawer->GetAccessible( TRUE );
+ xItemAccessible = pDrawer->GetAccessible( sal_True );
ENSURE_OR_RETURN( xItemAccessible.is(), "illegal accessible provided by the drawer implementation!", NULL );
OSL_VERIFY( ::comphelper::OAccessibleImplementationAccess::setAccessibleParent( xItemAccessible->getAccessibleContext(),
i_rParentAccessible ) );
@@ -166,7 +166,7 @@ namespace svt
OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" );
PToolPanelDrawer pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) );
- pDrawer->SetSmartHelpId( i_pPanel->GetHelpID() );
+ pDrawer->SetHelpId( i_pPanel->GetHelpID() );
// proper Z-Order
if ( i_nPosition == 0 )
{
diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx
index a5f1a6907750..a9bb28a097e8 100644
--- a/svtools/source/toolpanel/dummypanel.cxx
+++ b/svtools/source/toolpanel/dummypanel.cxx
@@ -81,9 +81,9 @@ namespace svt
}
//--------------------------------------------------------------------
- SmartId DummyPanel::GetHelpID() const
+ rtl::OString DummyPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//--------------------------------------------------------------------
diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx
index 7d71dfb68d8b..8a34f429d726 100644
--- a/svtools/source/toolpanel/dummypanel.hxx
+++ b/svtools/source/toolpanel/dummypanel.hxx
@@ -50,7 +50,7 @@ namespace svt
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
diff --git a/svtools/source/toolpanel/makefile.mk b/svtools/source/toolpanel/makefile.mk
deleted file mode 100755
index 698c9ee68ff3..000000000000
--- a/svtools/source/toolpanel/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=toolpanel
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- toolpanel.src
-
-SLOFILES=\
- $(SLO)$/drawerlayouter.obj \
- $(SLO)$/dummypanel.obj \
- $(SLO)$/paneldecklisteners.obj \
- $(SLO)$/paneltabbar.obj \
- $(SLO)$/paneltabbarpeer.obj \
- $(SLO)$/refbase.obj \
- $(SLO)$/tabbargeometry.obj \
- $(SLO)$/tablayouter.obj \
- $(SLO)$/toolpanel.obj \
- $(SLO)$/toolpanelcollection.obj \
- $(SLO)$/toolpaneldrawer.obj \
- $(SLO)$/toolpaneldrawerpeer.obj \
- $(SLO)$/toolpaneldeck.obj \
- $(SLO)$/toolpaneldeckpeer.obj \
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 21d110a13105..37bbcf4678c2 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -169,8 +169,8 @@ namespace svt
aSelectionRect,
( bHovered || bFocused ) ? ( bActive ? 1 : 2 ) : 0 /* hilight */,
bActive /* check */,
- TRUE /* border */,
- FALSE /* ext border only */,
+ sal_True /* border */,
+ sal_False /* ext border only */,
0 /* corner radius */,
NULL,
NULL
@@ -686,7 +686,7 @@ namespace svt
Font aFont( m_rTabBar.GetFont() );
aFont.SetOrientation( 2700 );
- aFont.SetVertical( TRUE );
+ aFont.SetVertical( sal_True );
m_rTabBar.SetFont( aFont );
aTextPos.X() += aTextSize.Height();
@@ -788,7 +788,7 @@ namespace svt
return;
}
- m_rTabBar.SetUpdateMode( FALSE );
+ m_rTabBar.SetUpdateMode( sal_False );
// the aligned bounding and content rect
const Rectangle aActualBounds = m_aNormalizer.getTransformed( aNormalizedBounds, m_eTabAlignment );
@@ -806,7 +806,7 @@ namespace svt
// render item "foreground" layer
m_pRenderer->postRenderItem( m_rTabBar, aActualBounds, nItemFlags );
- m_rTabBar.SetUpdateMode( TRUE );
+ m_rTabBar.SetUpdateMode( sal_True );
}
//------------------------------------------------------------------------------------------------------------------
@@ -1339,9 +1339,9 @@ namespace svt
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XWindowPeer > PanelTabBar::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > PanelTabBar::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new PanelTabBarPeer( *this ) );
diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx
index 3c209ab0503d..b9615dffc774 100644
--- a/svtools/source/toolpanel/tablayouter.cxx
+++ b/svtools/source/toolpanel/tablayouter.cxx
@@ -255,7 +255,7 @@ namespace svt
if ( lcl_checkDisposed( *m_pData ) )
return NULL;
- return m_pData->pTabBar->GetAccessible( TRUE );
+ return m_pData->pTabBar->GetAccessible( sal_True );
}
//........................................................................
diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx
index dd053f67082e..ccf3df37a527 100644
--- a/svtools/source/toolpanel/toolpaneldeck.cxx
+++ b/svtools/source/toolpanel/toolpaneldeck.cxx
@@ -545,9 +545,9 @@ namespace svt
}
//--------------------------------------------------------------------
- Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > ToolPanelDeck::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Control::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new ToolPanelDeckPeer( *this ) );
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 41593b1d6897..06712deb2775 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -58,7 +58,7 @@ namespace svt
:Window( &i_rParent )
,m_rDrawer( i_rParent )
{
- SetMouseTransparent( TRUE );
+ SetMouseTransparent( sal_True );
Show();
SetAccessibleRole( AccessibleRole::LABEL );
}
@@ -86,7 +86,7 @@ namespace svt
,m_bFocused( false )
,m_bExpanded( false )
{
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
SetBackground( Wallpaper() );
SetPointer( POINTER_REFHAND );
@@ -162,7 +162,7 @@ namespace svt
Image ToolPanelDrawer::impl_getExpansionIndicator() const
{
- USHORT nResourceId = 0;
+ sal_uInt16 nResourceId = 0;
if ( m_bExpanded )
nResourceId = IMG_TRIANGLE_DOWN;
else
@@ -171,9 +171,9 @@ namespace svt
}
- USHORT ToolPanelDrawer::impl_getTextStyle() const
+ sal_uInt16 ToolPanelDrawer::impl_getTextStyle() const
{
- const USHORT nBasicStyle = TEXT_DRAW_LEFT
+ const sal_uInt16 nBasicStyle = TEXT_DRAW_LEFT
| TEXT_DRAW_TOP
| TEXT_DRAW_WORDBREAK;
@@ -206,7 +206,7 @@ namespace svt
{
const Rectangle aTextPixelBox( m_pPaintDevice->LogicToPixel( i_rTextBox ) );
- m_pPaintDevice->EnableMapMode( FALSE );
+ m_pPaintDevice->EnableMapMode( sal_False );
m_pPaintDevice->SetFillColor();
Rectangle aBox( i_rTextBox );
@@ -223,7 +223,7 @@ namespace svt
m_pPaintDevice->SetLineColor( COL_BLACK );
m_pPaintDevice->DrawPolyLine( Polygon( aTextPixelBox ), aDottedStyle );
- m_pPaintDevice->EnableMapMode( FALSE );
+ m_pPaintDevice->EnableMapMode( sal_False );
}
else
HideFocus();
@@ -300,9 +300,9 @@ namespace svt
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( BOOL i_bCreate )
+ Reference< XWindowPeer > ToolPanelDrawer::GetComponentInterface( sal_Bool i_bCreate )
{
- Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( FALSE ) );
+ Reference< XWindowPeer > xWindowPeer( Window::GetComponentInterface( sal_False ) );
if ( !xWindowPeer.is() && i_bCreate )
{
xWindowPeer.set( new ToolPanelDrawerPeer() );
diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx
index 40a34b5b2431..943228a63030 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.hxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.hxx
@@ -87,13 +87,13 @@ namespace svt
virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface( BOOL i_bCreate );
+ GetComponentInterface( sal_Bool i_bCreate );
private:
Rectangle impl_calcTextBoundingBox() const;
Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const;
void impl_paintBackground( const Rectangle& i_rTitleBarBox );
- USHORT impl_getTextStyle() const;
+ sal_uInt16 impl_getTextStyle() const;
void impl_paintFocusIndicator( const Rectangle& i_rTextBox );
Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox );
Image impl_getExpansionIndicator() const;
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 48010373a091..8cb5a4945e2e 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include "svtools/genericunodialog.hxx"
-#include "addresstemplate.hxx"
-#include <cppuhelper/extract.hxx>
+#include <svtools/addresstemplate.hxx>
+#include <comphelper/extract.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 16a1bcc8ec96..82ae79fa2c92 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "contextmenuhelper.hxx"
+#include <svtools/contextmenuhelper.hxx>
#include <svtools/menuoptions.hxx>
#include <svtools/miscopt.hxx>
diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx
index 0f6d93bc9bad..2c228f28e5e6 100644
--- a/svtools/source/uno/framestatuslistener.cxx
+++ b/svtools/source/uno/framestatuslistener.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <framestatuslistener.hxx>
+#include <svtools/framestatuslistener.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <osl/mutex.hxx>
diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx
index 5d3a3bcdd53c..0c3ef6129e5a 100644
--- a/svtools/source/uno/generictoolboxcontroller.cxx
+++ b/svtools/source/uno/generictoolboxcontroller.cxx
@@ -71,7 +71,7 @@ struct ExecuteInfo
GenericToolboxController::GenericToolboxController( const Reference< XMultiServiceFactory >& rServiceManager,
const Reference< XFrame >& rFrame,
ToolBox* pToolbox,
- USHORT nID,
+ sal_uInt16 nID,
const ::rtl::OUString& aCommand ) :
svt::ToolboxController( rServiceManager, rFrame, aCommand )
, m_pToolbox( pToolbox )
@@ -158,7 +158,7 @@ throw ( RuntimeException )
{
m_pToolbox->EnableItem( m_nID, Event.IsEnabled );
- USHORT nItemBits = m_pToolbox->GetItemBits( m_nID );
+ sal_uInt16 nItemBits = m_pToolbox->GetItemBits( m_nID );
nItemBits &= ~TIB_CHECKABLE;
TriState eTri = STATE_NOCHECK;
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index a5bffed006b7..065c6207317a 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
#include <toolkit/awt/vclxwindow.hxx>
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <osl/diagnose.h>
diff --git a/svtools/source/uno/makefile.mk b/svtools/source/uno/makefile.mk
deleted file mode 100644
index 7c1c44006047..000000000000
--- a/svtools/source/uno/makefile.mk
+++ /dev/null
@@ -1,61 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=unoiface
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/addrtempuno.obj \
- $(SLO)$/contextmenuhelper.obj \
- $(SLO)$/framestatuslistener.obj \
- $(SLO)$/generictoolboxcontroller.obj \
- $(SLO)$/genericunodialog.obj \
- $(SLO)$/miscservices.obj\
- $(SLO)$/statusbarcontroller.obj \
- $(SLO)$/toolboxcontroller.obj \
- $(SLO)$/treecontrolpeer.obj \
- $(SLO)$/unocontroltablemodel.obj \
- $(SLO)$/unoevent.obj \
- $(SLO)$/unoiface.obj \
- $(SLO)$/unoimap.obj \
- $(SLO)$/svtxgridcontrol.obj \
- $(SLO)$/popupwindowcontroller.obj \
- $(SLO)$/popupmenucontrollerbase.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index ad614a3f7b88..c652b6028bf0 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -102,55 +102,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * pServiceManager, void * _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- Reference< XRegistryKey > xRegistryKey (
- reinterpret_cast< XRegistryKey* >( _pRegistryKey ));
- Reference< XRegistryKey > xNewKey;
- uno::Sequence< ::rtl::OUString > aServices;
-
- xNewKey = xRegistryKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/com.sun.star.comp.svtools.OAddressBookSourceDialogUno/UNO/SERVICES" )) );
- xNewKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.AddressBookSourceDialog" )) );
-
- xNewKey = xRegistryKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/com.sun.star.svtools.SvFilterOptionsDialog/UNO/SERVICES" )) );
- xNewKey->createKey (
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilterOptionsDialog" )) );
-
- // GraphicProvider
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicProvider::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = GraphicProvider::getSupportedServiceNames_Static();
- int i;
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- // GraphicRendererVCL
- xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- GraphicRendererVCL::getImplementationName_Static() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- aServices = ( GraphicRendererVCL::getSupportedServiceNames_Static() );
- for( i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[ i ] );
-
- if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( _pRegistryKey ), serviceDecl ) )
- return false;
-
- return ::cppu::component_writeInfoHelper( pServiceManager, _pRegistryKey, s_aServiceEntries );
- }
- return sal_False;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
{
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index 3ba2ecf2ddb2..a64117823c60 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <statusbarcontroller.hxx>
+#include <svtools/statusbarcontroller.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -38,7 +38,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/status.hxx>
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
#include <toolkit/unohlp.hxx>
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index e0d51e32aa63..778925a60c44 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -29,22 +29,18 @@
#include "precompiled_svtools.hxx"
#include "svtxgridcontrol.hxx"
-#include "accessibletableimp.hxx"
#include <com/sun/star/view/SelectionType.hpp>
+#include "svtools/table/tablecontrolinterface.hxx"
#include "svtools/table/gridtablerenderer.hxx"
-#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablecontrol.hxx"
#include "unocontroltablemodel.hxx"
#include <comphelper/sequence.hxx>
#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
-#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/grid/GridInvalidDataException.hpp>
#include <com/sun/star/awt/grid/GridInvalidModelException.hpp>
@@ -53,93 +49,175 @@
#include <vcl/svapp.hxx>
-using ::rtl::OUString;
using namespace ::svt::table;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::view;
-using namespace ::toolkit;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::container;
using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::accessibility::AccessibleEventId;
-using namespace ::com::sun::star::accessibility::AccessibleTableModelChangeType;
-using ::com::sun::star::accessibility::AccessibleTableModelChange;
SVTXGridControl::SVTXGridControl()
- :m_pTableModel (new UnoControlTableModel()),
- m_xDataModel(0),
- m_xColumnModel(0),
- m_bHasColumnHeaders(false),
- m_bHasRowHeaders(false),
- m_bVScroll(false),
- m_bHScroll(false),
- m_bUpdate(false),
- m_nSelectedRowCount(0),
- m_aSelectionListeners( *this )
+ :m_pTableModel( new UnoControlTableModel() )
+ ,m_bHasColumnHeaders( false )
+ ,m_bHasRowHeaders( false )
+ ,m_bTableModelInitCompleted( false )
+ ,m_nSelectedRowCount( 0 )
+ ,m_aSelectionListeners( *this )
{
}
-//--------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------
SVTXGridControl::~SVTXGridControl()
{
}
-::com::sun::star::uno::Any SVTXGridControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::SetWindow( Window* pWindow )
{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridControl*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridDataListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridColumnListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
- return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
+ SVTXGridControl_Base::SetWindow( pWindow );
+ impl_checkTableModelInit();
}
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( SVTXGridControl )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridControl>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener>* ) NULL ),
- VCLXWindow::getTypes()
-IMPL_XTYPEPROVIDER_END
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nRow >= 0 ) ? tableCell.nRow : -1;
+}
-sal_Int32 SAL_CALL SVTXGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- return pTable->GetCurrentRow( Point(x,y) );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nColumn >= 0 ) ? tableCell.nColumn : -1;
}
-void SAL_CALL SVTXGridControl::setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->setTooltip(text, columns);
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 );
+
+ sal_Int32 const nColumn = pTable->GetCurrentColumn();
+ return ( nColumn >= 0 ) ? nColumn : -1;
}
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 );
+
+ sal_Int32 const nRow = pTable->GetCurrentRow();
+ return ( nRow >= 0 ) ? nRow : -1;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.addInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.removeInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const Any& aValue) throw(RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::setProperty: no control (anymore)!" );
+
switch( GetPropertyId( PropertyName ) )
{
+ case BASEPROPERTY_ROW_HEADER_WIDTH:
+ {
+ sal_Int32 rowHeaderWidth( -1 );
+ aValue >>= rowHeaderWidth;
+ ENSURE_OR_BREAK( rowHeaderWidth > 0, "SVTXGridControl::setProperty: illegal row header width!" );
+ m_pTableModel->setRowHeaderWidth( rowHeaderWidth );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
+ {
+ sal_Int32 columnHeaderHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= columnHeaderHeight;
+ }
+ ENSURE_OR_BREAK( columnHeaderHeight > 0, "SVTXGridControl::setProperty: illegal column header height!" );
+ m_pTableModel->setColumnHeaderHeight( columnHeaderHeight );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::setProperty(UseGridLines): invalid renderer!" );
+ sal_Bool bUseGridLines = sal_False;
+ OSL_VERIFY( aValue >>= bUseGridLines );
+ pGridRenderer->useGridLines( bUseGridLines );
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_ROW_HEIGHT:
+ {
+ sal_Int32 rowHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= rowHeight;
+ }
+ m_pTableModel->setRowHeight( rowHeight );
+ ENSURE_OR_BREAK( rowHeight > 0, "SVTXGridControl::setProperty: illegal row height!" );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
case BASEPROPERTY_BACKGROUNDCOLOR:
{
// let the base class handle this for the TableControl
VCLXWindow::setProperty( PropertyName, aValue );
// and forward to the grid control's data window
if ( pTable->IsBackground() )
- pTable->getDataWindow()->SetBackground( pTable->GetBackground() );
+ pTable->getDataWindow().SetBackground( pTable->GetBackground() );
else
- pTable->getDataWindow()->SetBackground();
+ pTable->getDataWindow().SetBackground();
}
break;
@@ -154,7 +232,6 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break;
case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break;
case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break;
- // case SelectionType_NONE:
default: eSelMode = NO_SELECTION; break;
}
if( pTable->getSelEngine()->GetSelectionMode() != eSelMode )
@@ -166,19 +243,16 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
{
sal_Bool bHScroll = true;
if( aValue >>= bHScroll )
- {
- m_bHScroll = bHScroll;
- m_pTableModel->setHorizontalScrollbarVisibility(bHScroll);
- }
+ m_pTableModel->setHorizontalScrollbarVisibility( bHScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
break;
}
+
case BASEPROPERTY_VSCROLL:
{
sal_Bool bVScroll = true;
if( aValue >>= bVScroll )
{
- m_bVScroll = bVScroll;
- m_pTableModel->setVerticalScrollbarVisibility(bVScroll);
+ m_pTableModel->setVerticalScrollbarVisibility( bVScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
}
break;
}
@@ -192,64 +266,42 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
break;
}
- case BASEPROPERTY_GRID_HEADER_BACKGROUND:
- {
- sal_Int32 colorHeader = 0xFFFFFF;
- if( aValue >>= colorHeader )
- {
- m_pTableModel->setHeaderBackgroundColor(colorHeader);
- }
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ m_pTableModel->setRowBackgroundColors( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_GRID_LINE_COLOR:
- {
- sal_Int32 colorLine = 0xFFFFFF;
- if( aValue >>= colorLine )
- {
- m_pTableModel->setLineColor(colorLine);
- }
+ m_pTableModel->setLineColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND:
- {
- sal_Int32 colorEvenRow = 0xFFFFFF;
- if( aValue >>= colorEvenRow )
- {
- m_pTableModel->setEvenRowBackgroundColor(colorEvenRow);
- }
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ m_pTableModel->setHeaderBackgroundColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_ROW_BACKGROUND:
- {
- sal_Int32 colorBackground = 0xFFFFFF;
- if( aValue >>= colorBackground )
- {
- m_pTableModel->setOddRowBackgroundColor(colorBackground);
- }
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ m_pTableModel->setHeaderTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_TEXTCOLOR:
- {
- sal_Int32 colorText = 0x000000;
- if( aValue >>= colorText )
- {
- m_pTableModel->setTextColor(colorText);
- }
+ m_pTableModel->setTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ m_pTableModel->setTextLineColor( aValue );
+ pTable->Invalidate();
+ break;
+
case BASEPROPERTY_VERTICALALIGN:
{
- com::sun::star::style::VerticalAlignment vAlign(com::sun::star::style::VerticalAlignment(0));
- if( aValue >>= vAlign )
- {
- switch( vAlign )
- {
- case com::sun::star::style::VerticalAlignment_TOP: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- case com::sun::star::style::VerticalAlignment_MIDDLE: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(1)); break;
- case com::sun::star::style::VerticalAlignment_BOTTOM: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(2)); break;
- default: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- }
- }
+ VerticalAlignment eAlign( VerticalAlignment_TOP );
+ if ( aValue >>= eAlign )
+ m_pTableModel->setVerticalAlign( eAlign );
break;
}
@@ -264,97 +316,31 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
case BASEPROPERTY_GRID_DATAMODEL:
{
- {
- m_xDataModel = Reference< XGridDataModel >( aValue, UNO_QUERY );
- if(m_xDataModel != NULL)
- {
- Sequence<Sequence< Any > > cellData = m_xDataModel->getData();
- if(cellData.getLength()!= 0)
- {
- for (int i = 0; i < cellData.getLength(); i++)
- {
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = cellData[i];
- //check whether the data row vector length matches with the column count
- if(m_xColumnModel->getColumnCount() == 0)
- {
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- }
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- }
- else
- if((unsigned int)rawRowData.getLength()!=(unsigned)m_pTableModel->getColumnCount())
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column count doesn't match with the length of row data" )), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- {
- newRow.push_back(rawRowData[k]);
- }
- m_pTableModel->getCellContent().push_back(newRow);
- }
-
- Sequence< ::rtl::OUString > rowHeaders = m_xDataModel->getRowHeaders();
- std::vector< rtl::OUString > newRow(
- comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rowHeaders));
- m_pTableModel->setRowCount(m_xDataModel->getRowCount());
- m_pTableModel->setRowHeaderName(newRow);
- }
- }
- else
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The data model isn't set!" )), m_xDataModel);
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xDataModel->getRowHeight() == 0)
- {
- m_pTableModel->setRowHeight(fontHeight);
- m_xDataModel->setRowHeight(fontHeight);
- }
- else
- m_pTableModel->setRowHeight(m_xDataModel->getRowHeight());
- m_pTableModel->setRowHeaderWidth(m_xDataModel->getRowHeaderWidth());
- }
- break;
+ Reference< XGridDataModel > const xDataModel( aValue, UNO_QUERY );
+ if ( !xDataModel.is() )
+ throw GridInvalidDataException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid data model." ) ), *this );
+
+ m_pTableModel->setDataModel( xDataModel );
+ impl_checkTableModelInit();
}
+ break;
+
case BASEPROPERTY_GRID_COLUMNMODEL:
{
- m_xColumnModel = Reference< XGridColumnModel >( aValue, UNO_QUERY );
- if(m_xColumnModel != NULL)
- {
- if(m_xColumnModel->getColumnCount() != 0)
- {
- Sequence<Reference< XGridColumn > > columns = m_xColumnModel->getColumns();
- std::vector<Reference< XGridColumn > > aNewColumns(
- comphelper::sequenceToContainer<std::vector<Reference< XGridColumn > > >(columns));
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xColumnModel->getColumnHeaderHeight() == 0)
- {
- m_pTableModel->setColumnHeaderHeight(fontHeight);
- m_xColumnModel->setColumnHeaderHeight(fontHeight);
- }
- else
- m_pTableModel->setColumnHeaderHeight(m_xColumnModel->getColumnHeaderHeight());
- for ( ::svt::table::ColPos col = 0; col < m_xColumnModel->getColumnCount(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn(aNewColumns[col]);
- Reference< XGridColumn > xGridColumn = m_xColumnModel->getColumn(col);
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- tableColumn->setHorizontalAlign(xGridColumn->getHorizontalAlign());
- tableColumn->setWidth(xGridColumn->getColumnWidth());
- if(xGridColumn->getPreferredWidth() != 0)
- tableColumn->setPreferredWidth(xGridColumn->getPreferredWidth());
- if(xGridColumn->getMaxWidth() != 0)
- tableColumn->setMaxWidth(xGridColumn->getMaxWidth());
- if(xGridColumn->getMinWidth() != 0)
- tableColumn->setMinWidth(xGridColumn->getMinWidth());
- tableColumn->setResizable(xGridColumn->getResizeable());
- }
- }
- }
- else
- throw GridInvalidModelException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column model isn't set!" )), m_xColumnModel);
+ // obtain new col model
+ Reference< XGridColumnModel > const xColumnModel( aValue, UNO_QUERY );
+ if ( !xColumnModel.is() )
+ throw GridInvalidModelException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid column model." ) ), *this );
+
+ // remove all old columns
+ m_pTableModel->removeAllColumns();
+
+ // announce to the TableModel
+ m_pTableModel->setColumnModel( xColumnModel );
+ impl_checkTableModelInit();
+ // add new columns
+ impl_updateColumnsFromModel_nothrow();
break;
}
default:
@@ -363,489 +349,354 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
}
+
+void SVTXGridControl::impl_checkTableModelInit()
+{
+ if ( !m_bTableModelInitCompleted && m_pTableModel->hasColumnModel() && m_pTableModel->hasDataModel() )
+ {
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ if ( pTable )
+ {
+ pTable->SetModel( PTableModel( m_pTableModel ) );
+
+ m_bTableModelInitCompleted = true;
+
+ // ensure default columns exist, if they have not previously been added
+ Reference< XGridDataModel > const xDataModel( m_pTableModel->getDataModel(), UNO_QUERY_THROW );
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel(), UNO_QUERY_THROW );
+
+ sal_Int32 const nDataColumnCount = xDataModel->getColumnCount();
+ if ( ( nDataColumnCount > 0 ) && ( xColumnModel->getColumnCount() == 0 ) )
+ xColumnModel->setDefaultColumns( nDataColumnCount );
+ // this will trigger notifications, which in turn will let us update our m_pTableModel
+ }
+ }
+}
+
+namespace
+{
+ void lcl_convertColor( ::boost::optional< ::Color > const & i_color, Any & o_colorValue )
+ {
+ if ( !i_color )
+ o_colorValue.clear();
+ else
+ o_colorValue <<= i_color->GetColor();
+ }
+}
+
Any SVTXGridControl::getProperty( const ::rtl::OUString& PropertyName ) throw(RuntimeException)
{
SolarMutexGuard aGuard;
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getProperty: no control (anymore)!", Any() );
+
+ Any aPropertyValue;
+
const sal_uInt16 nPropId = GetPropertyId( PropertyName );
- TableControl* pTable = (TableControl*)GetWindow();
- if(pTable)
+ switch(nPropId)
+ {
+ case BASEPROPERTY_GRID_SELECTIONMODE:
{
- switch(nPropId)
+ SelectionType eSelectionType;
+
+ SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
+ switch( eSelMode )
{
- case BASEPROPERTY_GRID_SELECTIONMODE:
+ case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
+ case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
+ case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
+ default: eSelectionType = SelectionType_NONE; break;
+ }
+ aPropertyValue <<= eSelectionType;
+ break;
+ }
+
+ case BASEPROPERTY_GRID_SHOWROWHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasRowHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasColumnHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_DATAMODEL:
+ aPropertyValue <<= m_pTableModel->getDataModel();
+ break;
+
+ case BASEPROPERTY_GRID_COLUMNMODEL:
+ aPropertyValue <<= m_pTableModel->getColumnModel();
+ break;
+
+ case BASEPROPERTY_HSCROLL:
{
- SelectionType eSelectionType;
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getHorizontalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
+ }
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- switch( eSelMode )
- {
- case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
- case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
- case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
-// case NO_SELECTION:
- default: eSelectionType = SelectionType_NONE; break;
- }
- return Any( eSelectionType );
+ case BASEPROPERTY_VSCROLL:
+ {
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getVerticalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
}
- case BASEPROPERTY_GRID_SHOWROWHEADER:
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::getProperty(UseGridLines): invalid renderer!" );
+ aPropertyValue <<= pGridRenderer->useGridLines();
+ }
+ break;
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ {
+ ::boost::optional< ::std::vector< ::Color > > aColors( m_pTableModel->getRowBackgroundColors() );
+ if ( !aColors )
+ aPropertyValue.clear();
+ else
+ {
+ Sequence< ::com::sun::star::util::Color > aAPIColors( aColors->size() );
+ for ( size_t i=0; i<aColors->size(); ++i )
{
- return Any ((sal_Bool) m_pTableModel->hasRowHeaders());
+ aAPIColors[i] = aColors->at(i).GetColor();
}
- case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
- return Any ((sal_Bool) m_pTableModel->hasColumnHeaders());
- case BASEPROPERTY_GRID_DATAMODEL:
- return Any ( m_xDataModel );
- case BASEPROPERTY_GRID_COLUMNMODEL:
- return Any ( m_xColumnModel);
- case BASEPROPERTY_HSCROLL:
- return Any ( m_bHScroll);
- case BASEPROPERTY_VSCROLL:
- return Any ( m_bVScroll);
+ aPropertyValue <<= aAPIColors;
}
}
- return VCLXWindow::getProperty( PropertyName );
+ break;
+
+ case BASEPROPERTY_GRID_LINE_COLOR:
+ lcl_convertColor( m_pTableModel->getLineColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ lcl_convertColor( m_pTableModel->getHeaderBackgroundColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ lcl_convertColor( m_pTableModel->getHeaderTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTCOLOR:
+ lcl_convertColor( m_pTableModel->getTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ lcl_convertColor( m_pTableModel->getTextLineColor(), aPropertyValue );
+ break;
+
+ default:
+ aPropertyValue = VCLXWindow::getProperty( PropertyName );
+ break;
+ }
+
+ return aPropertyValue;
}
void SVTXGridControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
{
PushPropertyIds( rIds,
- BASEPROPERTY_GRID_SHOWROWHEADER,
- BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
- BASEPROPERTY_GRID_DATAMODEL,
- BASEPROPERTY_GRID_COLUMNMODEL,
- BASEPROPERTY_GRID_SELECTIONMODE,
- BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND,
- BASEPROPERTY_GRID_HEADER_BACKGROUND,
- BASEPROPERTY_GRID_LINE_COLOR,
- BASEPROPERTY_GRID_ROW_BACKGROUND,
- 0);
+ BASEPROPERTY_GRID_SHOWROWHEADER,
+ BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
+ BASEPROPERTY_GRID_DATAMODEL,
+ BASEPROPERTY_GRID_COLUMNMODEL,
+ BASEPROPERTY_GRID_SELECTIONMODE,
+ BASEPROPERTY_GRID_HEADER_BACKGROUND,
+ BASEPROPERTY_GRID_HEADER_TEXT_COLOR,
+ BASEPROPERTY_GRID_LINE_COLOR,
+ BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS,
+ 0
+ );
VCLXWindow::ImplGetPropertyIds( rIds, true );
}
-void SAL_CALL SVTXGridControl::setVisible( sal_Bool bVisible ) throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if ( pTable )
- {
- pTable->SetModel(PTableModel(m_pTableModel));
- pTable->Show( bVisible );
- }
+ m_pTableModel->notifyRowsInserted( i_event );
}
-void SAL_CALL SVTXGridControl::setFocus() throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL//----------------------------------------------------------------------------------------------------------------------
+ SVTXGridControl::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- if ( GetWindow())
- GetWindow()->GrabFocus();
+ m_pTableModel->notifyRowsRemoved( i_event );
}
-void SAL_CALL SVTXGridControl::rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = Event.rowData;
- int colCount = m_xColumnModel->getColumnCount();
- if(colCount == 0)
- {
- Reference<XGridColumnListener> listener(*this,UNO_QUERY_THROW);
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- m_xColumnModel->getColumn(col)->addColumnListener(listener);
- }
+ m_pTableModel->notifyDataChanged( i_event );
- }
- else if((unsigned int)rawRowData.getLength()!=(unsigned)colCount)
- throw GridInvalidDataException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The column count doesn't match with the length of row data" )), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- newRow.push_back(rawRowData[k]);
- m_pTableModel->getCellContent().push_back(newRow);
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().push_back(Event.headerName);
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->InvalidateDataWindow(m_pTableModel->getCellContent().size()-1, 0, false);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(INSERT, m_pTableModel->getRowCount()-1, m_pTableModel->getRowCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- pTable->commitGridControlEvent(CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTableHeader(TCTYPE_ROWHEADERBAR)),
- Any());
- for (sal_Int32 i = 0 ; i <= m_pTableModel->getColumnCount() ; ++i)
- {
- pTable->commitGridControlEvent(
- CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTable() ),
- Any());
- }
- }
+ // if the data model is sortable, a dataChanged event is also fired in case the sort order changed.
+ // So, just in case, invalidate the column header area, too.
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" );
+ pTable->getTableControlInterface().invalidate( TableAreaColumnHeaders );
}
-void SAL_CALL SVTXGridControl::rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
+ OSL_UNUSED( i_event );
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.index == -1)
- {
- if(!isSelectionEmpty())
- deselectAllRows();
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().clear();
- pTable->clearSelection();
- m_pTableModel->getCellContent().clear();
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, 0, m_pTableModel->getColumnCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- }
- }
- else if(Event.index >= 0 && Event.index < m_pTableModel->getRowCount())
- {
- if(isSelectedIndex(Event.index))
- {
- Sequence<sal_Int32> selected(1);
- selected[0]=Event.index;
- deselectRows(selected);
- }
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().erase(m_pTableModel->getRowHeaderName().begin()+Event.index);
- std::vector<std::vector<Any> >::iterator rowPos =m_pTableModel->getCellContent().begin() + Event.index;
- m_pTableModel->getCellContent().erase( rowPos );
- }
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- pTable->InvalidateDataWindow(Event.index, Event.index, true);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, Event.index, Event.index+1, 0, m_pTableModel->getColumnCount())),
- Any());
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" );
+
+ // TODO: we could do better than this - invalidate the header area only
+ pTable->getTableControlInterface().invalidate( TableAreaRowHeaders );
}
-void SAL_CALL SVTXGridControl::columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnResize" )))
- {
- bool resizable = m_pTableModel->getColumnModel()[Event.index]->isResizable();
- Event.newValue>>=resizable;
- m_pTableModel->getColumnModel()[Event.index]->setResizable(resizable);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColWidth" )))
- {
- sal_Int32 colWidth = m_pTableModel->getColumnModel()[Event.index]->getWidth();
- Event.newValue>>=colWidth;
- m_pTableModel->getColumnModel()[Event.index]->setWidth(colWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxWidth" )))
- {
- sal_Int32 maxWidth = m_pTableModel->getColumnModel()[Event.index]->getMaxWidth();
- Event.newValue>>=maxWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMaxWidth(maxWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MinWidth" )))
- {
- sal_Int32 minWidth = m_pTableModel->getColumnModel()[Event.index]->getMinWidth();
- Event.newValue>>=minWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMinWidth(minWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" )))
- {
- sal_Int32 prefWidth = m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth();
- Event.newValue>>=prefWidth;
- m_pTableModel->getColumnModel()[Event.index]->setPreferredWidth(prefWidth);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HAlign" )))
- {
- ::com::sun::star::style::HorizontalAlignment hAlign = m_pTableModel->getColumnModel()[Event.index]->getHorizontalAlign();
- Event.newValue>>=hAlign;
- m_pTableModel->getColumnModel()[Event.index]->setHorizontalAlign(hAlign);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UpdateWidth" )))
- {
- if(m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth() != 0)
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" )), m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth());
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColWidth" )), m_pTableModel->getColumnModel()[Event.index]->getWidth());
- }
- pTable->Invalidate();
+ Reference< XGridColumn > const xGridColumn( i_event.Element, UNO_QUERY_THROW );
+
+ sal_Int32 nIndex( m_pTableModel->getColumnCount() );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->insertColumn( nIndex, xGridColumn );
}
-void SAL_CALL SVTXGridControl::dataChanged(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" )))
- {
- sal_Int32 rowHeight = m_pTableModel->getRowHeight();
- Event.newValue>>=rowHeight;
- m_pTableModel->setRowHeight(rowHeight);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" )))
- {
- sal_Int32 rowHeaderWidth = m_pTableModel->getRowHeaderWidth();
- Event.newValue>>=rowHeaderWidth;
- m_pTableModel->setRowHeaderWidth(rowHeaderWidth);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" )))
- {
- Sequence< rtl::OUString > headers(0);
- Event.newValue>>=headers;
- std::vector< rtl::OUString > headerNames( comphelper::sequenceToContainer <std::vector< rtl::OUString > >(headers) );
- m_pTableModel->setRowHeaderName(headerNames);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellUpdated" )))
- {
- std::vector< std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- sal_Int32 col(0);
- Event.oldValue>>=col;
- rowContent[Event.index][col] = Event.newValue;
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
- else if(Event.valueName == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" )))
- {
- std::vector<std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- Sequence< sal_Int32 > cols(0);
- Sequence< Any > values(0);
- Event.oldValue>>=cols;
- Event.newValue>>=values;
- for(int i = 0; i< cols.getLength(); i++)
- {
- if(cols[i]>=0 && cols[i]<m_pTableModel->getColumnCount())
- rowContent[Event.index][cols[i]]=values[i];
- else
- break;
- }
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
+ sal_Int32 nIndex( -1 );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->removeColumn( nIndex );
}
-void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
{
- VCLXWindow::disposing( Source );
+ OSL_ENSURE( false, "SVTXGridControl::elementReplaced: not implemented!" );
+ // at the moment, the XGridColumnModel API does not allow replacing columns
+ OSL_UNUSED( i_event );
+ // TODO: replace the respective column in our table model
}
-::sal_Int32 SAL_CALL SVTXGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::min_element(itStart, itEnd));
- }
-}
-::sal_Int32 SAL_CALL SVTXGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::max_element(itStart, itEnd));
- }
+ VCLXWindow::disposing( Source );
}
-void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- sal_Int32 start = rangeOfRows[0];
- int seqSize = rangeOfRows.getLength();
- sal_Int32 end = rangeOfRows[seqSize-1];
- if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount()))
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- selectedRows.clear();
- if(rangeOfRows.getLength() == 1)
- selectedRows.push_back(start);
- else
- return;
- }
- else
- {
- for(int i=0;i<seqSize;i++)
- {
- if(!isSelectedIndex(rangeOfRows[i]))
- selectedRows.push_back(rangeOfRows[i]);
- }
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(start, end, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
- }
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, true );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- for(int i=0;i<m_pTableModel->getRowCount();i++)
- selectedRows.push_back(i);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( true );
}
-void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- for(int i = 0; i < rangeOfRows.getLength(); i++ )
- {
- std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]);
- selectedRows.erase(iter);
- }
- pTable->selectionChanged(true);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, false );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( false );
}
+//----------------------------------------------------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- Sequence<sal_Int32> selectedRowsToSequence(comphelper::containerToSequence(selectedRows));
- return selectedRowsToSequence;
-}
+ SolarMutexGuard aGuard;
-::sal_Bool SAL_CALL SVTXGridControl::isCellEditable() throw (::com::sun::star::uno::RuntimeException)
-{
- return sal_False;
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", Sequence< sal_Int32 >() );
+
+ sal_Int32 selectionCount = pTable->GetSelectedRowCount();
+ Sequence< sal_Int32 > selectedRows( selectionCount );
+ for ( sal_Int32 i=0; i<selectionCount; ++i )
+ selectedRows[i] = pTable->GetSelectedRowIndex(i);
+ return selectedRows;
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL SVTXGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return sal_True;
- else
- return sal_False;
-}
+ SolarMutexGuard aGuard;
-::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- return std::find(selectedRows.begin(),selectedRows.end(), index) != selectedRows.end();
-}
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", sal_True );
-void SAL_CALL SVTXGridControl::selectRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if(index<0 || index>=m_pTableModel->getRowCount())
- return;
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == MULTIPLE_SELECTION)
- {
- if(!isSelectedIndex(index))
- selectedRows.push_back(index);
- else
- return;
- }
- else if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- {
- if(!isSelectedIndex(index))
- deselectRows(getSelection());
- else
- return;
- }
- selectedRows.push_back(index);
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(index, index, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ return pTable->GetSelectedRowCount() > 0;
}
-void SAL_CALL SVTXGridControl::selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex( ::sal_Int32 index ) throw (::com::sun::star::uno::RuntimeException)
{
- (void)x;
+ SolarMutexGuard aGuard;
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::isSelectedIndex: no control (anymore)!", sal_False );
+
+ return pTable->IsRowSelected( index );
}
+
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::dispose() throw(::com::sun::star::uno::RuntimeException)
{
- SolarMutexGuard aGuard;
-
::com::sun::star::lang::EventObject aObj;
aObj.Source = (::cppu::OWeakObject*)this;
m_aSelectionListeners.disposeAndClear( aObj );
VCLXWindow::dispose();
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
+ SolarMutexGuard aGuard;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
switch ( rVclWindowEvent.GetId() )
{
case VCLEVENT_TABLEROW_SELECT:
{
- TableControl* pTable = (TableControl*)GetWindow();
-
- if( pTable )
- {
- if ( m_aSelectionListeners.getLength() )
- {
- ImplCallItemListeners();
- }
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_BREAK( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" );
+ if ( m_aSelectionListeners.getLength() )
+ ImplCallItemListeners();
}
break;
@@ -855,28 +706,30 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
}
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ImplCallItemListeners()
{
- TableControl* pTable = (TableControl*) GetWindow();
- if ( pTable && m_aSelectionListeners.getLength() )
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ImplCallItemListeners: no control (anymore)!" );
+
+ if ( m_aSelectionListeners.getLength() )
{
- ::std::vector<sal_Int32> selRows = pTable->GetSelectedRows();
+ sal_Int32 const actSelRowCount = pTable->GetSelectedRowCount();
::com::sun::star::awt::grid::GridSelectionEvent aEvent;
aEvent.Source = (::cppu::OWeakObject*)this;
aEvent.Column = 0;
- sal_Int32 actSelRowCount = selRows.size();
sal_Int32 diff = actSelRowCount - m_nSelectedRowCount;
//row added to selection
if(diff >= 1)
{
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(0);
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Range = diff;
}
//selected row changed
else if(diff == 0 && actSelRowCount != 0)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
aEvent.Range = 0;
}
@@ -885,7 +738,7 @@ void SVTXGridControl::ImplCallItemListeners()
//selection changed: multiple row deselected, only 1 row is selected
if(actSelRowCount == 1)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
}
//row is deselected
@@ -901,4 +754,31 @@ void SVTXGridControl::ImplCallItemListeners()
}
}
+//----------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::impl_updateColumnsFromModel_nothrow()
+{
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel() );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "no model!" );
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "no table!" );
+
+ try
+ {
+ const Sequence< Reference< XGridColumn > > columns = xColumnModel->getColumns();
+ for ( const Reference< XGridColumn >* colRef = columns.getConstArray();
+ colRef != columns.getConstArray() + columns.getLength();
+ ++colRef
+ )
+ {
+ ENSURE_OR_CONTINUE( colRef->is(), "illegal column!" );
+
+ m_pTableModel->appendColumn( *colRef );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx
index ef94979d79eb..6e4eb807667e 100644
--- a/svtools/source/uno/svtxgridcontrol.hxx
+++ b/svtools/source/uno/svtxgridcontrol.hxx
@@ -33,88 +33,90 @@
#include <svtools/table/tablecontrol.hxx>
#include <com/sun/star/awt/grid/XGridControl.hpp>
#include <com/sun/star/awt/grid/XGridDataListener.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxwindows.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase4.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
using namespace ::svt::table;
-class SVTXGridControl : public ::cppu::ImplInheritanceHelper3< VCLXWindow, ::com::sun::star::awt::grid::XGridControl,
- ::com::sun::star::awt::grid::XGridDataListener, ::com::sun::star::awt::grid::XGridColumnListener>
+typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::grid::XGridControl
+ , ::com::sun::star::awt::grid::XGridDataListener
+ , ::com::sun::star::container::XContainerListener
+ > SVTXGridControl_Base;
+class SVTXGridControl : public SVTXGridControl_Base
{
private:
- ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >m_xDataModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >m_xColumnModel;
- bool m_bHasColumnHeaders;
- bool m_bHasRowHeaders;
- bool m_bVScroll;
- bool m_bHScroll;
- bool m_bUpdate;
- sal_Int32 m_nSelectedRowCount;
- SelectionListenerMultiplexer m_aSelectionListeners;
+ ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
+ bool m_bHasColumnHeaders;
+ bool m_bHasRowHeaders;
+ bool m_bTableModelInitCompleted;
+ sal_Int32 m_nSelectedRowCount;
+ SelectionListenerMultiplexer m_aSelectionListeners;
protected:
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
void ImplCallItemListeners();
public:
- SVTXGridControl();
+ SVTXGridControl();
~SVTXGridControl();
- //XGridDataListener overridables
- virtual void SAL_CALL rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL dataChanged(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- //XGridColumnListener overridables
- virtual void SAL_CALL columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent & Event) throw (::com::sun::star::uno::RuntimeException);
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { VCLXWindow::acquire(); }
- void SAL_CALL release() throw() { VCLXWindow::release(); }
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
- //::com::sun::star::awt::grid::XGridControl
- virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ // XGridSelection
+ virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isCellEditable() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGridControl
+ virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
- void SAL_CALL setVisible(sal_Bool bVisible) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setFocus() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XComponent
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
- };
- #endif // _SVT_GRIDCONTROL_HXX_
+
+protected:
+ // VCLXWindow
+ virtual void SetWindow( Window* pWindow );
+
+private:
+ void impl_updateColumnsFromModel_nothrow();
+ void impl_checkTableModelInit();
+};
+#endif // _SVT_GRIDCONTROL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index b6575c475b12..110a9d3f4ce5 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -36,9 +36,8 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include <imgdef.hxx>
+#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
-
#include <toolkit/unohlp.hxx>
#include <vcl/toolbox.hxx>
//shizhobo
@@ -789,7 +788,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{
case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE:
{
- sal_Bool aNewValue;
+ sal_Bool aNewValue(sal_False);
aValue >>= aNewValue;
if (aNewValue != m_bSupportVisiable)
{
@@ -832,7 +831,7 @@ void ToolboxController::enable( bool bEnable )
sal_uInt16 nItemId = 0;
if( getToolboxId( nItemId, &pToolBox ) )
{
- pToolBox->EnableItem( nItemId, bEnable ? TRUE : FALSE );
+ pToolBox->EnableItem( nItemId, bEnable ? sal_True : sal_False );
}
}
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index a4d63c4aa144..e3cf909ea31c 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -83,7 +83,7 @@ public:
class ImplGraphicItem : public SvLBoxBmp
{
public:
- ImplGraphicItem( SvLBoxEntry* pEntry, USHORT nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {}
+ ImplGraphicItem( SvLBoxEntry* pEntry, sal_uInt16 nFlags, Image& aImage ) : SvLBoxBmp( pEntry, nFlags, aImage ) {}
OUString msGraphicURL;
};
@@ -93,7 +93,7 @@ public:
class ImplContextGraphicItem : public SvLBoxContextBmp
{
public:
- ImplContextGraphicItem( SvLBoxEntry* pEntry,USHORT nFlags,Image& rI1,Image& rI2, USHORT nEntryFlagsBmp1)
+ ImplContextGraphicItem( SvLBoxEntry* pEntry,sal_uInt16 nFlags,Image& rI1,Image& rI2, sal_uInt16 nEntryFlagsBmp1)
: SvLBoxContextBmp( pEntry, nFlags, rI1, rI2, nEntryFlagsBmp1 ) {}
OUString msExpandedGraphicURL;
@@ -108,12 +108,12 @@ public:
UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent, WinBits nWinStyle );
~UnoTreeListBoxImpl();
- sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos=LIST_APPEND );
+ sal_uInt32 insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos=LIST_APPEND );
virtual void RequestingChilds( SvLBoxEntry* pParent );
- virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& );
- virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
+ virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& );
+ virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
DECL_LINK( OnSelectionChangeHdl, UnoTreeListBoxImpl* );
DECL_LINK( OnExpandingHdl, UnoTreeListBoxImpl* );
@@ -131,7 +131,7 @@ public:
UnoTreeListItem( SvLBoxEntry* );
UnoTreeListItem();
virtual ~UnoTreeListItem();
- virtual USHORT IsA();
+ virtual sal_uInt16 IsA();
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
OUString GetText() const;
void SetText( const OUString& rText );
@@ -139,7 +139,7 @@ public:
void SetImage( const Image& rImage );
OUString GetGraphicURL() const;
void SetGraphicURL( const OUString& rGraphicURL );
- void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* );
+ void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
void Clone( SvLBoxItem* pSource );
@@ -261,7 +261,7 @@ void TreeControlPeer::SetWindow( Window* pWindow )
// --------------------------------------------------------------------
-UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos /* = LIST_APPEND */ )
+UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos /* = LIST_APPEND */ )
{
UnoTreeListEntry* pEntry = 0;
if( mpTreeImpl )
@@ -328,9 +328,9 @@ bool TreeControlPeer::updateEntry( UnoTreeListEntry* pEntry )
}
}
- if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == TRUE) )
+ if( (pEntry->mxNode->hasChildrenOnDemand() == sal_True) != (pEntry->HasChildsOnDemand() == sal_True) )
{
- pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? TRUE : FALSE );
+ pEntry->EnableChildsOnDemand( pEntry->mxNode->hasChildrenOnDemand() ? sal_True : sal_False );
bChanged = true;
}
@@ -532,14 +532,14 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect,
}
if( bSetSelection )
- rTree.SelectAll( FALSE );
+ rTree.SelectAll( sal_False );
if( pNodes && nCount )
{
while( nCount-- )
{
UnoTreeListEntry* pEntry = getEntry( *pNodes++ );
- rTree.Select( pEntry, bSelect ? TRUE : FALSE );
+ rTree.Select( pEntry, bSelect ? sal_True : sal_False );
}
}
}
@@ -565,7 +565,7 @@ Any SAL_CALL TreeControlPeer::getSelection() throw (RuntimeException)
Any aRet;
- ULONG nSelectionCount = rTree.GetSelectionCount();
+ sal_uLong nSelectionCount = rTree.GetSelectionCount();
if( nSelectionCount == 1 )
{
UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.FirstSelected() );
@@ -627,7 +627,7 @@ void SAL_CALL TreeControlPeer::removeSelection( const Any& rSelection ) throw (I
void SAL_CALL TreeControlPeer::clearSelection() throw (RuntimeException)
{
SolarMutexGuard aGuard;
- getTreeListBoxOrThrow().SelectAll( FALSE );
+ getTreeListBoxOrThrow().SelectAll( sal_False );
}
// -------------------------------------------------------------------
@@ -893,7 +893,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getNodeForLocation( sal_Int32 x
Reference< XTreeNode > xNode;
const Point aPos( x, y );
- UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) );
+ UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) );
if( pEntry )
xNode = pEntry->mxNode;
@@ -911,7 +911,7 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getClosestNodeForLocation( sal_
Reference< XTreeNode > xNode;
const Point aPos( x, y );
- UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, TRUE ) );
+ UnoTreeListEntry* pEntry = dynamic_cast< UnoTreeListEntry* >( rTree.GetEntry( aPos, sal_True ) );
if( pEntry )
xNode = pEntry->mxNode;
@@ -950,7 +950,7 @@ sal_Bool SAL_CALL TreeControlPeer::stopEditing() throw (RuntimeException)
UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
if( rTree.IsEditingActive() )
{
- rTree.EndEditing(FALSE);
+ rTree.EndEditing(sal_False);
return sal_True;
}
else
@@ -966,7 +966,7 @@ void SAL_CALL TreeControlPeer::cancelEditing( ) throw (RuntimeException)
SolarMutexGuard aGuard;
UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
- rTree.EndEditing(FALSE);
+ rTree.EndEditing(sal_False);
}
// -------------------------------------------------------------------
@@ -1106,7 +1106,7 @@ void TreeControlPeer::updateNode( UnoTreeListBoxImpl& rTree, const Reference< XT
{
Reference< XTreeNode > xParentNode( xNode->getParent() );
UnoTreeListEntry* pParentEntry = 0;
- ULONG nChild = LIST_APPEND;
+ sal_uLong nChild = LIST_APPEND;
if( xParentNode.is() )
{
@@ -1329,12 +1329,12 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = sal_False;
if ( aValue >>= bEnabled )
{
- WinBits nStyle = rTree.GetWindowBits();
+ WinBits nStyle = rTree.GetStyle();
if ( bEnabled )
nStyle |= WB_HIDESELECTION;
else
nStyle &= ~WB_HIDESELECTION;
- rTree.SetWindowBits( nStyle );
+ rTree.SetStyle( nStyle );
}
}
break;
@@ -1362,7 +1362,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
case BASEPROPERTY_TREE_DATAMODEL:
onChangeDataModel( rTree, Reference< XTreeDataModel >( aValue, UNO_QUERY ) );
break;
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
{
sal_Int32 nHeight = 0;
if( aValue >>= nHeight )
@@ -1373,7 +1373,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
{
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
- rTree.EnableInplaceEditing( bEnabled ? TRUE : FALSE );
+ rTree.EnableInplaceEditing( bEnabled ? sal_True : sal_False );
break;
}
case BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING:
@@ -1392,11 +1392,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINES);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINES);
if( bEnabled )
nBits |= WB_HASLINES;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1405,11 +1405,11 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
sal_Bool bEnabled = false;
if( aValue >>= bEnabled )
{
- WinBits nBits = rTree.GetWindowBits() & (~WB_HASLINESATROOT);
+ WinBits nBits = rTree.GetStyle() & (~WB_HASLINESATROOT);
if( bEnabled )
nBits |= WB_HASLINESATROOT;
- if( nBits != rTree.GetWindowBits() )
- rTree.SetWindowBits( nBits );
+ if( nBits != rTree.GetStyle() )
+ rTree.SetStyle( nBits );
}
break;
}
@@ -1430,7 +1430,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
switch(nPropId)
{
case BASEPROPERTY_HIDEINACTIVESELECTION:
- return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+ return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SELECTIONTYPE:
{
@@ -1447,7 +1447,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
}
return Any( eSelectionType );
}
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( (sal_Int32)rTree.GetEntryHeight() );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( mxDataModel );
@@ -1458,9 +1458,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
case BASEPROPERTY_TREE_ROOTDISPLAYED:
return Any( mbIsRootDisplayed );
case BASEPROPERTY_TREE_SHOWSHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINES) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINES) != 0 ? sal_True : sal_False );
case BASEPROPERTY_TREE_SHOWSROOTHANDLES:
- return Any( (rTree.GetWindowBits() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
+ return Any( (rTree.GetStyle() & WB_HASLINESATROOT) != 0 ? sal_True : sal_False );
}
}
return VCLXWindow::getProperty( PropertyName );
@@ -1529,7 +1529,7 @@ UnoTreeListBoxImpl::UnoTreeListBoxImpl( TreeControlPeer* pPeer, Window* pParent,
: SvTreeListBox( pParent, nWinStyle )
, mxPeer( pPeer )
{
- SetWindowBits( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
+ SetStyle( WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HSCROLL );
SetNodeDefaultImages();
SetSelectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
SetDeselectHdl( LINK(this, UnoTreeListBoxImpl, OnSelectionChangeHdl) );
@@ -1583,7 +1583,7 @@ IMPL_LINK(UnoTreeListBoxImpl, OnExpandedHdl, UnoTreeListBoxImpl*, EMPTYARG )
// --------------------------------------------------------------------
-sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,ULONG nPos )
+sal_uInt32 UnoTreeListBoxImpl::insert( SvLBoxEntry* pEntry,SvLBoxEntry* pParent,sal_uLong nPos )
{
if( pParent )
return SvTreeListBox::Insert( pEntry, pParent, nPos );
@@ -1602,14 +1602,14 @@ void UnoTreeListBoxImpl::RequestingChilds( SvLBoxEntry* pParent )
// --------------------------------------------------------------------
-BOOL UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& )
+sal_Bool UnoTreeListBoxImpl::EditingEntry( SvLBoxEntry* pEntry, Selection& )
{
return mxPeer.is() ? mxPeer->onEditingEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ) ) : false;
}
// --------------------------------------------------------------------
-BOOL UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText )
+sal_Bool UnoTreeListBoxImpl::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText )
{
return mxPeer.is() ? mxPeer->onEditedEntry( dynamic_cast< UnoTreeListEntry* >( pEntry ), rNewText ) : false;
}
@@ -1638,14 +1638,14 @@ UnoTreeListItem::~UnoTreeListItem()
// --------------------------------------------------------------------
-USHORT UnoTreeListItem::IsA()
+sal_uInt16 UnoTreeListItem::IsA()
{
return 0;
}
// --------------------------------------------------------------------
-void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, SvLBoxEntry* _pEntry)
+void UnoTreeListItem::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, SvLBoxEntry* _pEntry)
{
Point aPos( rPos );
if( _pEntry )
diff --git a/svtools/source/uno/treecontrolpeer.hxx b/svtools/source/uno/treecontrolpeer.hxx
index 5e3a9a1668ef..4c13acde8648 100644
--- a/svtools/source/uno/treecontrolpeer.hxx
+++ b/svtools/source/uno/treecontrolpeer.hxx
@@ -129,7 +129,7 @@ private:
void fillTree( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeDataModel >& xDataModel );
void addNode( UnoTreeListBoxImpl& rTree, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry );
- UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, ULONG nPos = LIST_APPEND );
+ UnoTreeListEntry* createEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos = LIST_APPEND );
bool updateEntry( UnoTreeListEntry* pEntry );
void updateTree( const ::com::sun::star::awt::tree::TreeDataModelEvent& rEvent, bool bRecursive );
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index 26084690c137..73085561e542 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -29,487 +29,867 @@
#include "precompiled_svtools.hxx"
#include "unocontroltablemodel.hxx"
-#include <com/sun/star/view/SelectionType.hpp>
-#include "svtools/table/gridtablerenderer.hxx"
+#include "unogridcolumnfacade.hxx"
+
#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include <comphelper/sequence.hxx>
-#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
-#include <toolkit/helper/property.hxx>
-#include <comphelper/processfactory.hxx>
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/awt/grid/XSortableGridData.hpp>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
+#include <comphelper/stlunosequence.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::awt::grid::XGridDataModel;
+ using ::com::sun::star::awt::grid::XGridColumnModel;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::uno::WeakReference;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::awt::grid::XSortableGridData;
+ using ::com::sun::star::beans::Pair;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= UnoControlTableModel_Impl
+ //==================================================================================================================
+ typedef ::std::vector< PTableModelListener > ModellListeners;
+ typedef ::std::vector< PColumnModel > ColumnModels;
+ struct UnoControlTableModel_Impl
+ {
+ ColumnModels aColumns;
+ bool bHasColumnHeaders;
+ bool bHasRowHeaders;
+ ScrollbarVisibility eVScrollMode;
+ ScrollbarVisibility eHScrollMode;
+ PTableRenderer pRenderer;
+ PTableInputHandler pInputHandler;
+ TableMetrics nRowHeight;
+ TableMetrics nColumnHeaderHeight;
+ TableMetrics nRowHeaderWidth;
+ ::boost::optional< ::Color > m_aGridLineColor;
+ ::boost::optional< ::Color > m_aHeaderBackgroundColor;
+ ::boost::optional< ::Color > m_aHeaderTextColor;
+ ::boost::optional< ::Color > m_aTextColor;
+ ::boost::optional< ::Color > m_aTextLineColor;
+ ::boost::optional< ::std::vector< ::Color > > m_aRowColors;
+ VerticalAlignment m_eVerticalAlign;
+ ModellListeners m_aListeners;
+ WeakReference< XGridDataModel > m_aDataModel;
+ WeakReference< XGridColumnModel > m_aColumnModel;
+ UnoControlTableModel_Impl()
+ :aColumns ( )
+ ,bHasColumnHeaders ( true )
+ ,bHasRowHeaders ( false )
+ ,eVScrollMode ( ScrollbarShowNever )
+ ,eHScrollMode ( ScrollbarShowNever )
+ ,pRenderer ( )
+ ,pInputHandler ( )
+ ,nRowHeight ( 10 )
+ ,nColumnHeaderHeight ( 10 )
+ ,nRowHeaderWidth ( 10 )
+ ,m_aGridLineColor ( )
+ ,m_aHeaderBackgroundColor ( )
+ ,m_aHeaderTextColor ( )
+ ,m_aTextColor ( )
+ ,m_aTextLineColor ( )
+ ,m_aRowColors ( )
+ ,m_eVerticalAlign ( VerticalAlignment_TOP )
+ {
+ }
+ };
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn(Reference<XGridColumn> m_xGridColumn)
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
- {
- m_sName = m_xGridColumn->getTitle();
- }
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn()
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+#ifdef DBG_UTIL
+ const char* UnoControlTableModel_checkInvariants( const void* _pInstance )
{
+ return static_cast< const UnoControlTableModel* >( _pInstance )->checkInvariants();
}
- //--------------------------------------------------------------------
- ColumnID UnoControlTableColumn::getID() const
+ //------------------------------------------------------------------------------------------------------------------
+ const char* UnoControlTableModel::checkInvariants() const
{
- return m_nID;
- }
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ if ( !xDataModel.is() )
+ return "data model anymore";
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::setID( const ColumnID _nID )
- {
- m_nID = _nID;
- return true;
- }
+ // TODO: more?
- //--------------------------------------------------------------------
- String UnoControlTableColumn::getName() const
- {
- return m_sName;
+ return NULL;
}
+#endif
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setName( const String& _rName )
+#define DBG_CHECK_ME() \
+ DBG_TESTSOLARMUTEX(); \
+ DBG_CHKTHIS( UnoControlTableModel, UnoControlTableModel_checkInvariants )
+
+ //------------------------------------------------------------------------------------------------------------------
+ DBG_NAME( UnoControlTableModel )
+ UnoControlTableModel::UnoControlTableModel()
+ :m_pImpl( new UnoControlTableModel_Impl )
{
- m_sName = _rName;
+ DBG_CTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ m_pImpl->bHasColumnHeaders = true;
+ m_pImpl->bHasRowHeaders = false;
+ m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
+ m_pImpl->pInputHandler.reset( new DefaultInputHandler );
}
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::isResizable() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlTableModel::~UnoControlTableModel()
{
- return m_bIsResizable;
+ DBG_DTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setResizable( bool _bResizable )
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getColumnCount() const
{
- m_bIsResizable = _bResizable;
+ DBG_CHECK_ME();
+ return (TableSize)m_pImpl->aColumns.size();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getRowCount() const
{
- return m_nWidth;
+ DBG_CHECK_ME();
+
+ TableSize nRowCount = 0;
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+ nRowCount = xDataModel->getRowCount();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return nRowCount;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnHeaders() const
{
- m_nWidth = _nWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasColumnHeaders;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMinWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasRowHeaders() const
{
- return m_nMinWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasRowHeaders;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMinWidth( TableMetrics _nMinWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
{
- m_nMinWidth = _nMinWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasRowHeaders == _bRowHeaders )
+ return;
+
+ m_pImpl->bHasRowHeaders = _bRowHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMaxWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
{
- return m_nMaxWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasColumnHeaders == _bColumnHeaders )
+ return;
+
+ m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMaxWidth( TableMetrics _nMaxWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
{
- m_nMaxWidth = _nMaxWidth;
+ DBG_CHECK_ME();
+ (void)col;
+ (void)row;
+ return false;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getPreferredWidth() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
{
- return m_nPrefWidth;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN( ( column >= 0 ) && ( column < getColumnCount() ),
+ "DefaultTableModel::getColumnModel: invalid index!", PColumnModel() );
+ return m_pImpl->aColumns[ column ];
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setPreferredWidth( TableMetrics _nPrefWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::appendColumn( Reference< XGridColumn > const & i_column )
{
- m_nPrefWidth = _nPrefWidth;
+ DBG_CHECK_ME();
+ insertColumn( m_pImpl->aColumns.size(), i_column );
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::HorizontalAlignment UnoControlTableColumn::getHorizontalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::insertColumn( ColPos const i_position, Reference< XGridColumn > const & i_column )
{
- return m_xHorizontalAlign;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::insertColumn: illegal position!" );
+
+ const PColumnModel pColumn( new UnoGridColumnFacade( *this, i_column ) );
+ m_pImpl->aColumns.insert( m_pImpl->aColumns.begin() + i_position, pColumn );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnInserted( i_position );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeColumn( ColPos const i_position )
{
- m_xHorizontalAlign = _align;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::removeColumn: illegal position!" );
+
+ // remove the column
+ ColumnModels::iterator pos = m_pImpl->aColumns.begin() + i_position;
+ const PColumnModel pColumn = *pos;
+ m_pImpl->aColumns.erase( pos );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnRemoved( i_position );
+ }
+
+ // dispose the column
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ OSL_ENSURE( pColumnImpl != NULL, "UnoControlTableModel::removeColumn: illegal column implementation!" );
+ if ( pColumnImpl )
+ pColumnImpl->dispose();
}
- //====================================================================
- //= DefaultTableModel_Impl
- //====================================================================
- struct UnoControlTableModel_Impl
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeAllColumns()
{
- ::std::vector< PColumnModel > aColumns;
- TableSize nRowCount;
- bool bHasColumnHeaders;
- bool bHasRowHeaders;
- bool bVScroll;
- bool bHScroll;
- PTableRenderer pRenderer;
- PTableInputHandler pInputHandler;
- TableMetrics nRowHeight;
- TableMetrics nColumnHeaderHeight;
- TableMetrics nRowHeaderWidth;
- std::vector<rtl::OUString> aRowHeadersTitle;
- std::vector<std::vector< Any > > aCellContent;
- ::com::sun::star::util::Color m_xLineColor;
- ::com::sun::star::util::Color m_xHeaderColor;
- ::com::sun::star::util::Color m_xTextColor;
- ::com::sun::star::util::Color m_xRowColor1;
- ::com::sun::star::util::Color m_xRowColor2;
- ::com::sun::star::style::VerticalAlignment m_xVerticalAlign;
+ DBG_CHECK_ME();
+ if ( m_pImpl->aColumns.empty() )
+ return;
- UnoControlTableModel_Impl()
- :aColumns ( )
- ,nRowCount ( 0 )
- ,bHasColumnHeaders ( false )
- ,bHasRowHeaders ( false )
- ,bVScroll ( false )
- ,bHScroll ( false )
- ,pRenderer ( )
- ,pInputHandler ( )
- ,nRowHeight ( 0 )
- ,nColumnHeaderHeight( 0 )
- ,nRowHeaderWidth ( 10 )
- ,aRowHeadersTitle ( )
- ,aCellContent ( )
- ,m_xLineColor ( 0xFFFFFF )
- ,m_xHeaderColor ( 0xFFFFFF )
- ,m_xTextColor ( 0 )//black as default
- ,m_xRowColor1 ( 0xFFFFFF )
- ,m_xRowColor2 ( 0xFFFFFF )
- ,m_xVerticalAlign (com::sun::star::style::VerticalAlignment(0))
+ // dispose the column instances
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
{
+ UnoGridColumnFacade* pColumn = dynamic_cast< UnoGridColumnFacade* >( col->get() );
+ ENSURE_OR_CONTINUE( pColumn != NULL, "UnoControlTableModel::removeAllColumns: illegal column implementation!" );
+ pColumn->dispose();
}
- };
+ m_pImpl->aColumns.clear();
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->allColumnsRemoved();
+ }
+ }
- //====================================================================
- //= UnoControlTableModel
- //====================================================================
- //--------------------------------------------------------------------
- UnoControlTableModel::UnoControlTableModel()
- :m_pImpl( new UnoControlTableModel_Impl )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::impl_notifyTableMetricsChanged() const
{
- m_pImpl->bHasColumnHeaders = false;
- m_pImpl->bHasRowHeaders = false;
- m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
- m_pImpl->pInputHandler.reset( new DefaultInputHandler );
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->tableMetricsChanged();
+ }
}
- //--------------------------------------------------------------------
- UnoControlTableModel::~UnoControlTableModel()
+ //------------------------------------------------------------------------------------------------------------------
+ PTableRenderer UnoControlTableModel::getRenderer() const
{
- DELETEZ( m_pImpl );
+ DBG_CHECK_ME();
+ return m_pImpl->pRenderer;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getColumnCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ PTableInputHandler UnoControlTableModel::getInputHandler() const
{
- return (TableSize)m_pImpl->aColumns.size();
+ DBG_CHECK_ME();
+ return m_pImpl->pInputHandler;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getRowCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeight() const
{
- return m_pImpl->nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->nRowHeight;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasColumnHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
{
- return m_pImpl->bHasColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeight == _nRowHeight )
+ return;
+
+ m_pImpl->nRowHeight = _nRowHeight;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasRowHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
{
- return m_pImpl->bHasRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
+ return m_pImpl->nColumnHeaderHeight;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeaderWidth() const
{
- m_pImpl->bHasRowHeaders = _bRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
+ return m_pImpl->nRowHeaderWidth;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
{
- m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nColumnHeaderHeight == _nHeight )
+ return;
+
+ m_pImpl->nColumnHeaderHeight = _nHeight;
+ impl_notifyTableMetricsChanged();
}
- void UnoControlTableModel::setColumnCount(TableSize _nColCount)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
{
- m_pImpl->aColumns.resize( _nColCount);
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeaderWidth == _nWidth )
+ return;
+
+ m_pImpl->nRowHeaderWidth = _nWidth;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowCount(TableSize _nRowCount)
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility() const
{
- m_pImpl->nRowCount = _nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->eVScrollMode;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility() const
{
- (void)col;
- (void)row;
- return false;
+ DBG_CHECK_ME();
+ return m_pImpl->eHScrollMode;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::addTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::addTableModelListener( const PTableModelListener& i_listener )
{
- (void) listener;
- // TODO
- OSL_FAIL( "DefaultTableModel::addTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( !!i_listener, "illegal NULL listener" );
+ m_pImpl->m_aListeners.push_back( i_listener );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::removeTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeTableModelListener( const PTableModelListener& i_listener )
{
- (void)listener;
- // TODO
- OSL_FAIL( "DefaultTableModel::removeTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ for ( ModellListeners::iterator lookup = m_pImpl->m_aListeners.begin();
+ lookup != m_pImpl->m_aListeners.end();
+ ++lookup
+ )
+ {
+ if ( *lookup == i_listener )
+ {
+ m_pImpl->m_aListeners.erase( lookup );
+ return;
+ }
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::removeTableModelListener: listener is not registered - sure you're doing the right thing here?" );
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- DBG_ASSERT( ( column >= 0 ) && ( column < getColumnCount() ),
- "DefaultTableModel::getColumnModel: invalid index!" );
- return m_pImpl->aColumns[ column ];
+ DBG_CHECK_ME();
+ m_pImpl->eVScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- std::vector<PColumnModel>& UnoControlTableModel::getColumnModel()
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- return m_pImpl->aColumns;
+ DBG_CHECK_ME();
+ m_pImpl->eHScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModelByID( ColumnID id )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setDataModel( Reference< XGridDataModel > const & i_gridDataModel )
{
- (void)id;
- // TODO
- OSL_FAIL( "DefaultTableModel::getColumnModelByID: not yet implemented!" );
- return PColumnModel();
+ DBG_CHECK_ME();
+ m_pImpl->m_aDataModel = i_gridDataModel;
+ // TODO: register as listener, so we're notified of row/data changes, and can multiplex them to our
+ // own listeners
}
- //--------------------------------------------------------------------
- PTableRenderer UnoControlTableModel::getRenderer() const
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridDataModel > UnoControlTableModel::getDataModel() const
{
- return m_pImpl->pRenderer;
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ return xDataModel;
}
- //--------------------------------------------------------------------
- PTableInputHandler UnoControlTableModel::getInputHandler() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasDataModel() const
{
- return m_pImpl->pInputHandler;
+ return getDataModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnModel( Reference< XGridColumnModel > const & i_gridColumnModel )
{
- return m_pImpl->nRowHeight;
+ DBG_CHECK_ME();
+ m_pImpl->m_aColumnModel = i_gridColumnModel;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumnModel > UnoControlTableModel::getColumnModel() const
{
- m_pImpl->nRowHeight = _nRowHeight;
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ return xColumnModel;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnModel() const
{
- DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
- return m_pImpl->nColumnHeaderHeight;
+ return getColumnModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeaderWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellContent( ColPos const i_col, RowPos const i_row, Any& o_cellContent )
{
- DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
- return m_pImpl->nRowHeaderWidth;
+ DBG_CHECK_ME();
+
+ o_cellContent.clear();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::getCellContent: no data model anymore!" );
+
+ PColumnModel const pColumn = getColumnModel( i_col );
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ ENSURE_OR_RETURN_VOID( pColumnImpl != NULL, "UnoControlTableModel::getCellContent: no (valid) column at this position!" );
+ sal_Int32 const nDataColumnIndex = pColumnImpl->getDataColumnIndex() >= 0 ? pColumnImpl->getDataColumnIndex() : i_col;
+
+ if ( nDataColumnIndex >= xDataModel->getColumnCount() )
+ {
+ // this is allowed, in case the column model has been dynamically extended, but the data model does
+ // not (yet?) know about it.
+ // So, handle it gracefully.
+ #if OSL_DEBUG_LEVEL > 0
+ {
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ OSL_ENSURE( xColumnModel.is() && i_col < xColumnModel->getColumnCount(),
+ "UnoControlTableModel::getCellContent: request a column's value which the ColumnModel doesn't know about!" );
+ }
+ #endif
+ }
+ else
+ {
+ o_cellContent = xDataModel->getCellData( nDataColumnIndex, i_row );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellToolTip( ColPos const i_col, RowPos const i_row, Any& o_cellToolTip )
{
- m_pImpl->nColumnHeaderHeight = _nHeight;
+ DBG_CHECK_ME();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+
+ o_cellToolTip = xDataModel->getCellToolTip( i_col, i_row );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoControlTableModel::getRowHeading( RowPos const i_rowPos ) const
{
- m_pImpl->nRowHeaderWidth = _nWidth;
+ DBG_CHECK_ME();
+
+ Any aRowHeading;
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN( xDataModel.is(), "UnoControlTableModel::getRowHeading: no data model anymore!", aRowHeading );
+
+ try
+ {
+ aRowHeading = xDataModel->getRowHeading( i_rowPos );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aRowHeading;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetTitleHeight( TableMetrics _nHeight )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- DBG_ASSERT( _nHeight > 0, "DefaultTableModel::SetTitleHeight: invalid height value!" );
- m_pImpl->nColumnHeaderHeight = _nHeight;
- // TODO: notification
+ void lcl_setColor( Any const & i_color, ::boost::optional< ::Color > & o_convertedColor )
+ {
+ if ( !i_color.hasValue() )
+ o_convertedColor.reset();
+ else
+ {
+ sal_Int32 nColor = COL_TRANSPARENT;
+ if ( i_color >>= nColor )
+ {
+ o_convertedColor.reset( ::Color( nColor ) );
+ }
+ else
+ {
+ OSL_ENSURE( false, "lcl_setColor: could not extract color value!" );
+ }
+ }
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetHandleWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getLineColor() const
{
- DBG_ASSERT( _nWidth > 0, "DefaultTableModel::SetHandleWidth: invalid width value!" );
- m_pImpl->nRowHeaderWidth = _nWidth;
- // TODO: notification
+ DBG_CHECK_ME();
+ return m_pImpl->m_aGridLineColor;
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setLineColor( Any const & i_color )
{
- if(overAllHeight>=actHeight && !m_pImpl->bVScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aGridLineColor );
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderBackgroundColor() const
{
- if(overAllWidth>=actWidth && !m_pImpl->bHScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderBackgroundColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalScrollbarVisibility(bool _bVScroll) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderBackgroundColor( Any const & i_color )
{
- m_pImpl->bVScroll = _bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderBackgroundColor );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHorizontalScrollbarVisibility(bool _bHScroll) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderTextColor() const
{
- m_pImpl->bHScroll = _bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderTextColor;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasVerticalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderTextColor( Any const & i_color )
{
- return m_pImpl->bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderTextColor );
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasHorizontalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextColor() const
{
- return m_pImpl->bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setCellContent(const std::vector<std::vector< Any > >& cellContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextColor( Any const & i_color )
{
- m_pImpl->aCellContent = cellContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextColor );
}
- std::vector<std::vector< Any > >& UnoControlTableModel::getCellContent()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextLineColor() const
{
- return m_pImpl->aCellContent;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextLineColor( Any const & i_color )
{
- m_pImpl->aRowHeadersTitle = cellColumnContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextLineColor );
}
- std::vector<rtl::OUString>& UnoControlTableModel::getRowHeaderName()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::std::vector< ::Color > > UnoControlTableModel::getRowBackgroundColors() const
{
- return m_pImpl->aRowHeadersTitle;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aRowColors;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getLineColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue )
{
- return m_pImpl->m_xLineColor;
+ DBG_CHECK_ME();
+ Sequence< ::com::sun::star::util::Color > aAPIColors;
+ if ( !( i_APIValue >>= aAPIColors ) )
+ m_pImpl->m_aRowColors.reset();
+ else
+ {
+ ::std::vector< ::Color > aColors( aAPIColors.getLength() );
+ for ( sal_Int32 i=0; i<aAPIColors.getLength(); ++i )
+ {
+ aColors[i] = ::Color( aAPIColors[i] );
+ }
+ m_pImpl->m_aRowColors.reset( aColors );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setLineColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ VerticalAlignment UnoControlTableModel::getVerticalAlign() const
{
- m_pImpl->m_xLineColor = _rColor;
+ DBG_CHECK_ME();
+ return m_pImpl->m_eVerticalAlign;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getHeaderBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalAlign( VerticalAlignment _xAlign )
{
- return m_pImpl->m_xHeaderColor;
+ DBG_CHECK_ME();
+ m_pImpl->m_eVerticalAlign = _xAlign;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHeaderBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos UnoControlTableModel::getColumnPos( UnoGridColumnFacade const & i_column ) const
{
- m_pImpl->m_xHeaderColor = _rColor;
+ DBG_CHECK_ME();
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
+ {
+ if ( &i_column == col->get() )
+ return col - m_pImpl->aColumns.begin();
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::getColumnPos: column not found!" );
+ return COL_INVALID;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getTextColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ITableDataSort* UnoControlTableModel::getSortAdapter()
{
- return m_pImpl->m_xTextColor;
+ DBG_CHECK_ME();
+
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY );
+ if ( xSortAccess.is() )
+ return this;
+ return NULL;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setTextColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection )
{
- m_pImpl->m_xTextColor = _rColor;
+ DBG_CHECK_ME();
+
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ xSortAccess->sortByColumn( i_column, i_sortDirection == ColumnSortAscending );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getOddRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnSort UnoControlTableModel::getCurrentSortOrder() const
{
- return m_pImpl->m_xRowColor1;
+ DBG_CHECK_ME();
+
+ ColumnSort currentSort;
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ Pair< ::sal_Int32, ::sal_Bool > const aCurrentSortOrder( xSortAccess->getCurrentSortOrder() );
+ currentSort.nColumnPos = aCurrentSortOrder.First;
+ currentSort.eSortDirection = aCurrentSortOrder.Second ? ColumnSortAscending : ColumnSortDescending;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return currentSort;
}
//--------------------------------------------------------------------
- void UnoControlTableModel::setOddRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ void UnoControlTableModel::notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const
{
- m_pImpl->m_xRowColor1 = _rColor;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_columnPos >= 0 ) && ( i_columnPos < getColumnCount() ),
+ "UnoControlTableModel::notifyColumnChange: invalid column index!" );
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnChanged( i_columnPos, i_attributeGroup );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getEvenRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsInserted( GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xRowColor2;
+ // check sanity of the event
+ ENSURE_OR_RETURN_VOID( i_event.FirstRow >= 0, "UnoControlTableModel::notifyRowsInserted: invalid first row!" );
+ ENSURE_OR_RETURN_VOID( i_event.LastRow >= i_event.FirstRow, "UnoControlTableModel::notifyRowsInserted: invalid row indexes!" );
+
+ // check own sanity
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "UnoControlTableModel::notifyRowsInserted: no column model anymore!" );
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::notifyRowsInserted: no data model anymore!" );
+
+ // implicitly add columns to the column model
+ // TODO: is this really a good idea?
+ sal_Int32 const dataColumnCount = xDataModel->getColumnCount();
+ OSL_ENSURE( dataColumnCount > 0, "UnoControlTableModel::notifyRowsInserted: no columns at all?" );
+
+ sal_Int32 const modelColumnCount = xColumnModel->getColumnCount();
+ if ( ( modelColumnCount == 0 ) && ( dataColumnCount > 0 ) )
+ {
+ // TODO: shouldn't we clear the mutexes guard for this call?
+ xColumnModel->setDefaultColumns( dataColumnCount );
+ }
+
+ // multiplex the event to our own listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsInserted( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setEvenRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsRemoved( GridDataEvent const & i_event ) const
{
- m_pImpl->m_xRowColor2 = _rColor;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsRemoved( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::VerticalAlignment UnoControlTableModel::getVerticalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xVerticalAlign;
+ ColPos const firstCol = i_event.FirstColumn == -1 ? 0 : i_event.FirstColumn;
+ ColPos const lastCol = i_event.FirstColumn == -1 ? getColumnCount() - 1 : i_event.LastColumn;
+ RowPos const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow;
+ RowPos const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow;
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( firstCol, lastCol, firstRow, lastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalAlign( com::sun::star::style::VerticalAlignment _xAlign )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyAllDataChanged() const
{
- m_pImpl->m_xVerticalAlign = _xAlign;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( 0, getColumnCount() - 1, 0, getRowCount() - 1 );
+ }
}
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx
index b17911b8ab85..d804ca0f03b4 100644
--- a/svtools/source/uno/unocontroltablemodel.hxx
+++ b/svtools/source/uno/unocontroltablemodel.hxx
@@ -29,67 +29,37 @@
#ifndef _UNOCONTROL_TABLEMODEL_HXX_
#define _UNOCONTROL_TABLEMODEL_HXX_
-#include <svtools/table/tablemodel.hxx>
-#include <svtools/table/tablecontrol.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridControl.hpp>
-#include <com/sun/star/awt/grid/XGridDataListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt::grid;
+#include <boost/noncopyable.hpp>
-class UnoControlTableColumn : public IColumnModel
-{
- private:
- ColumnID m_nID;
- String m_sName;
- bool m_bIsResizable;
- TableMetrics m_nWidth;
- TableMetrics m_nMinWidth;
- TableMetrics m_nMaxWidth;
- TableMetrics m_nPrefWidth;
- ::com::sun::star::style::HorizontalAlignment m_xHorizontalAlign;
-
- public:
- UnoControlTableColumn(Reference<XGridColumn>);
- UnoControlTableColumn();
-
- // IColumnModel overridables
- virtual ColumnID getID() const;
- virtual bool setID( const ColumnID _nID );
- virtual String getName() const;
- virtual void setName( const String& _rName );
- virtual bool isResizable() const;
- virtual void setResizable( bool _bResizable );
- virtual TableMetrics getWidth() const;
- virtual void setWidth( TableMetrics _nWidth );
- virtual TableMetrics getMinWidth() const;
- virtual void setMinWidth( TableMetrics _nMinWidth );
- virtual TableMetrics getMaxWidth() const;
- virtual void setMaxWidth( TableMetrics _nMaxWidth );
- virtual TableMetrics getPreferredWidth() const;
- virtual void setPreferredWidth( TableMetrics _nPrefWidth );
- virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
- virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
-};
-
-struct UnoControlTableModel_Impl;
-
-class UnoControlTableModel : public ITableModel
+// .....................................................................................................................
+namespace svt { namespace table
{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+ class UnoGridColumnFacade;
+ struct UnoControlTableModel_Impl;
+ class UnoControlTableModel : public ITableModel, public ITableDataSort
+ {
private:
UnoControlTableModel_Impl* m_pImpl;
@@ -97,84 +67,104 @@ class UnoControlTableModel : public ITableModel
UnoControlTableModel();
~UnoControlTableModel();
- /// returns the current row height, in 1/100 millimeters
- inline TableMetrics GetRowHeight() const { return getRowHeight(); }
- /// sets a new row height.
- void setRowHeight( TableMetrics _nHeight );
- /// sets a new row header width.
- void setRowHeaderWidth( TableMetrics _nWidth );
- /// sets a new column header height.
- void setColumnHeaderHeight( TableMetrics _nHeight );
-
- /// returns the height of the title row (containing the column headers)
- inline TableMetrics GetTitleHeight() const { return getColumnHeaderHeight(); }
- /// sets a new height for the title row (containing the column headers)
- void SetTitleHeight( TableMetrics _nHeight );
-
- /// returns the width of the handle column (containing the row headers)
- inline TableMetrics GetHandleWidth() const { return getRowHeaderWidth(); }
- /// sets a new width for the handle column (containing the row headers)
- void SetHandleWidth( TableMetrics _nWidth );
-
- /// sets the width of a column
- inline void SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM );
- /// retrieves the width of a column, in 1/100th millimeters
- inline TableMetrics GetColumnWidth( ColPos _nColumn );
-
public:
// ITableModel overridables
- virtual TableSize getColumnCount() const;
- virtual TableSize getRowCount() const;
- virtual void setColumnCount(TableSize _nColCount);
- virtual void setRowCount(TableSize _nRowCount);
- virtual bool hasColumnHeaders() const;
- virtual bool hasRowHeaders() const;
- virtual void setRowHeaders(bool _bRowHeaders);
- virtual void setColumnHeaders(bool _bColumnHeaders);
- virtual bool isCellEditable( ColPos col, RowPos row ) const;
- virtual void addTableModelListener( const PTableModelListener& listener );
- virtual void removeTableModelListener( const PTableModelListener& listener );
- virtual PColumnModel getColumnModel( ColPos column );
- virtual std::vector<PColumnModel>& getColumnModel();
- virtual PColumnModel getColumnModelByID( ColumnID id );
- virtual PTableRenderer getRenderer() const;
- virtual PTableInputHandler getInputHandler() const;
- virtual TableMetrics getRowHeight() const;
- virtual TableMetrics getColumnHeaderHeight() const;
- virtual TableMetrics getRowHeaderWidth() const;
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const;
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const;
- virtual void setVerticalScrollbarVisibility(bool _bVScroll) const;
- virtual void setHorizontalScrollbarVisibility(bool _bHScroll) const;
- virtual void setCellContent(const std::vector<std::vector< Any > >& cellContent);
- virtual std::vector<std::vector< Any > >& getCellContent();
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent);
- virtual std::vector<rtl::OUString>& getRowHeaderName();
- virtual ::com::sun::star::util::Color getLineColor();
- virtual void setLineColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor();
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getTextColor();
- virtual void setTextColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor();
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor();
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign();
- virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
- virtual bool hasVerticalScrollbar();
- virtual bool hasHorizontalScrollbar();
-};
-
-inline void UnoControlTableModel::SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM )
-{
- getColumnModel( _nColumn )->setWidth( _nWidth100thMM );
-}
+ virtual TableSize getColumnCount() const;
+ virtual TableSize getRowCount() const;
+ virtual bool hasColumnHeaders() const;
+ virtual bool hasRowHeaders() const;
+ virtual bool isCellEditable( ColPos col, RowPos row ) const;
+ virtual PColumnModel getColumnModel( ColPos column );
+ virtual PTableRenderer getRenderer() const;
+ virtual PTableInputHandler getInputHandler() const;
+ virtual TableMetrics getRowHeight() const;
+ virtual TableMetrics getColumnHeaderHeight() const;
+ virtual TableMetrics getRowHeaderWidth() const;
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const;
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const;
+ virtual void addTableModelListener( const PTableModelListener& i_listener );
+ virtual void removeTableModelListener( const PTableModelListener& i_listener );
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent );
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip );
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const;
+ virtual ::boost::optional< ::Color > getLineColor() const;
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const;
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const;
+ virtual ::boost::optional< ::Color > getTextColor() const;
+ virtual ::boost::optional< ::Color > getTextLineColor() const;
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const;
+ virtual ::com::sun::star::style::VerticalAlignment
+ getVerticalAlign() const;
+ virtual ITableDataSort* getSortAdapter();
+
+ // ITableDataSort overridables
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection );
+ virtual ColumnSort getCurrentSortOrder() const;
+
+ // column write access
+ void appendColumn( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void insertColumn( ColPos const i_position, ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void removeColumn( ColPos const i_position );
+ void removeAllColumns();
+
+ // other operations
+ void setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+ void setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+
+ void setDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > const & i_gridDataModel );
+ bool hasDataModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >
+ getDataModel() const;
+ void setColumnModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > const & i_gridColumnModel );
+ bool hasColumnModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >
+ getColumnModel() const;
+
+ void setRowHeaders(bool _bRowHeaders);
+ void setColumnHeaders(bool _bColumnHeaders);
+
+ void setRowHeight( TableMetrics _nHeight );
+ void setRowHeaderWidth( TableMetrics _nWidth );
+ void setColumnHeaderHeight( TableMetrics _nHeight );
+
+ void setLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderBackgroundColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue );
+
+ void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
+
+ // multiplexing of XGridDataListener events
+ void notifyRowsInserted( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyRowsRemoved( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+
+ /// retrieves the index of a column within the model
+ ColPos getColumnPos( UnoGridColumnFacade const & i_column ) const;
+
+ /// notifies a change in a column belonging to the model
+ void notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const;
+
+ /** notifies a change in all data represented by the model. To be used if you cannot specified the changed data
+ in more detail.
+ */
+ void notifyAllDataChanged() const;
+
+#ifdef DBG_UTIL
+ const char* checkInvariants() const;
+#endif
-inline TableMetrics UnoControlTableModel::GetColumnWidth( ColPos _nColumn )
-{
- return getColumnModel( _nColumn )->getWidth();
-}
- #endif // _UNOCONTROL_TABLEMODEL_HXX_
+ private:
+ void impl_notifyTableMetricsChanged() const;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // _UNOCONTROL_TABLEMODEL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 7ae5fab30b7c..f06f809af319 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -31,11 +31,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <rtl/ustrbuf.hxx>
-
-
#include <tools/rtti.hxx>
#include <tools/solar.h>
-#include "unoevent.hxx"
+#include <svtools/unoevent.hxx>
#include <svl/macitem.hxx>
using namespace ::com::sun::star;
diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx
new file mode 100755
index 000000000000..5f1286b90ed6
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.cxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#include "unogridcolumnfacade.hxx"
+#include "unocontroltablemodel.hxx"
+
+#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/stlunosequence.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ /** === end UNO using === **/
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ template< class ATTRIBUTE_TYPE >
+ void lcl_set( Reference< XGridColumn > const & i_column, void ( SAL_CALL XGridColumn::*i_setter )( ATTRIBUTE_TYPE ),
+ ATTRIBUTE_TYPE i_value )
+ {
+ try
+ {
+ (i_column.get()->*i_setter) ( i_value );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ template< class ATTRIBUTE_TYPE >
+ ATTRIBUTE_TYPE lcl_get( Reference< XGridColumn > const & i_column, ATTRIBUTE_TYPE ( SAL_CALL XGridColumn::*i_getter )() )
+ {
+ ATTRIBUTE_TYPE value = ATTRIBUTE_TYPE();
+ try
+ {
+ value = (i_column.get()->*i_getter)();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return value;
+ }
+ }
+
+ //==================================================================================================================
+ //= ColumnChangeMultiplexer
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper1 < XGridColumnListener
+ > ColumnChangeMultiplexer_Base;
+ class ColumnChangeMultiplexer :public ColumnChangeMultiplexer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl );
+
+ void dispose();
+
+ protected:
+ ~ColumnChangeMultiplexer();
+
+ // XGridColumnListener
+ virtual void SAL_CALL columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& i_event ) throw (RuntimeException);
+
+ private:
+ UnoGridColumnFacade* m_pColumnImplementation;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl )
+ :m_pColumnImplementation( &i_colImpl )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::~ColumnChangeMultiplexer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ColumnChangeMultiplexer::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ m_pColumnImplementation = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException)
+ {
+ if ( i_event.AttributeName.equalsAscii( "DataColumnIndex" ) )
+ {
+ SolarMutexGuard aGuard;
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->dataColumnIndexChanged();
+ return;
+ }
+
+ ColumnAttributeGroup nChangedAttributes( COL_ATTRS_NONE );
+
+ if ( i_event.AttributeName.equalsAscii( "HorizontalAlign" ) )
+ nChangedAttributes |= COL_ATTRS_APPEARANCE;
+
+ if ( i_event.AttributeName.equalsAscii( "ColumnWidth" )
+ || i_event.AttributeName.equalsAscii( "MaxWidth" )
+ || i_event.AttributeName.equalsAscii( "MinWidth" )
+ || i_event.AttributeName.equalsAscii( "PreferredWidth" )
+ || i_event.AttributeName.equalsAscii( "Resizeable" )
+ || i_event.AttributeName.equalsAscii( "Flexibility" )
+ )
+ nChangedAttributes |= COL_ATTRS_WIDTH;
+
+ OSL_ENSURE( nChangedAttributes != COL_ATTRS_NONE,
+ "ColumnChangeMultiplexer::columnChanged: unknown column attributed changed!" );
+
+ SolarMutexGuard aGuard;
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->columnChanged( nChangedAttributes );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ OSL_UNUSED( i_event );
+ }
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::UnoGridColumnFacade( UnoControlTableModel const & i_owner, Reference< XGridColumn > const & i_gridColumn )
+ :m_pOwner( &i_owner )
+ ,m_nDataColumnIndex( -1 )
+ ,m_xGridColumn( i_gridColumn, UNO_QUERY_THROW )
+ ,m_pChangeMultiplexer( new ColumnChangeMultiplexer( *this ) )
+ {
+ m_xGridColumn->addGridColumnListener( m_pChangeMultiplexer.get() );
+ impl_updateDataColumnIndex_nothrow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::~UnoGridColumnFacade()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ ENSURE_OR_RETURN_VOID( m_pOwner != NULL, "UnoGridColumnFacade::dispose: already disposed!" );
+
+ m_xGridColumn->removeGridColumnListener( m_pChangeMultiplexer.get() );
+ m_pChangeMultiplexer->dispose();
+ m_pChangeMultiplexer.clear();
+ m_xGridColumn.clear();
+ m_pOwner = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::impl_updateDataColumnIndex_nothrow()
+ {
+ m_nDataColumnIndex = -1;
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_nDataColumnIndex = m_xGridColumn->getDataColumnIndex();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dataColumnIndexChanged()
+ {
+ DBG_TESTSOLARMUTEX();
+ impl_updateDataColumnIndex_nothrow();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyAllDataChanged();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::columnChanged( ColumnAttributeGroup const i_attributeGroup )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyColumnChange( m_pOwner->getColumnPos( *this ), i_attributeGroup );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoGridColumnFacade::getID() const
+ {
+ Any aID;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", aID );
+ try
+ {
+ aID = m_xGridColumn->getIdentifier();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aID;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setID( const Any& i_ID )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setIdentifier( i_ID );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getName() const
+ {
+ ::rtl::OUString sName;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sName );
+ try
+ {
+ sName = m_xGridColumn->getTitle();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setName( const String& _rName )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setTitle( _rName );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getHelpText() const
+ {
+ ::rtl::OUString sHelpText;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sHelpText );
+ try
+ {
+ sHelpText = m_xGridColumn->getHelpText();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sHelpText;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHelpText( const String& i_helpText )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setHelpText( i_helpText );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoGridColumnFacade::isResizable() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", false );
+ return lcl_get( m_xGridColumn, &XGridColumn::getResizeable );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setResizable( bool i_resizable )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setResizeable, sal_Bool( i_resizable ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 UnoGridColumnFacade::getFlexibility() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 1 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getFlexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setFlexibility( sal_Int32 const i_flexibility )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setFlexibility, i_flexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getColumnWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setWidth( TableMetrics _nWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setColumnWidth, _nWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMinWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMinWidth( TableMetrics _nMinWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMaxWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMaxWidth( TableMetrics _nMaxWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::style::HorizontalAlignment UnoGridColumnFacade::getHorizontalAlign()
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", HorizontalAlignment_LEFT );
+ return lcl_get( m_xGridColumn, &XGridColumn::getHorizontalAlign );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setHorizontalAlign, _align );
+ }
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
diff --git a/svtools/source/uno/unogridcolumnfacade.hxx b/svtools/source/uno/unogridcolumnfacade.hxx
new file mode 100755
index 000000000000..7499621ba8af
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_GRIDCOLUMNFACADE_HXX
+#define SVTOOLS_GRIDCOLUMNFACADE_HXX
+
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ class ColumnChangeMultiplexer;
+ class UnoControlTableModel;
+ class UnoGridColumnFacade :public IColumnModel
+ ,public ::boost::noncopyable
+ {
+ public:
+ UnoGridColumnFacade(
+ UnoControlTableModel const & i_owner,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_gridColumn
+ );
+ ~UnoGridColumnFacade();
+
+ // IColumnModel overridables
+ virtual ::com::sun::star::uno::Any
+ getID() const;
+ virtual void setID( const ::com::sun::star::uno::Any& i_ID );
+ virtual String getName() const;
+ virtual void setName( const String& _rName );
+ virtual String getHelpText() const;
+ virtual void setHelpText( const String& i_helpText );
+ virtual bool isResizable() const;
+ virtual void setResizable( bool _bResizable );
+ virtual sal_Int32 getFlexibility() const;
+ virtual void setFlexibility( sal_Int32 const i_flexibility );
+ virtual TableMetrics getWidth() const;
+ virtual void setWidth( TableMetrics _nWidth );
+ virtual TableMetrics getMinWidth() const;
+ virtual void setMinWidth( TableMetrics _nMinWidth );
+ virtual TableMetrics getMaxWidth() const;
+ virtual void setMaxWidth( TableMetrics _nMaxWidth );
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
+
+ /** disposes the column wrapper
+
+ Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
+ do not own it.
+ */
+ void dispose();
+
+ sal_Int32
+ getDataColumnIndex() const { return m_nDataColumnIndex; }
+
+ // callbacks for the XGridColumnListener
+ void columnChanged( ColumnAttributeGroup const i_attributeGroup );
+ void dataColumnIndexChanged();
+
+ private:
+ void impl_updateDataColumnIndex_nothrow();
+
+ private:
+ UnoControlTableModel const * m_pOwner;
+ sal_Int32 m_nDataColumnIndex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > m_xGridColumn;
+ ::rtl::Reference< ColumnChangeMultiplexer > m_pChangeMultiplexer;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // SVTOOLS_GRIDCOLUMNFACADE_HXX
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index a58ce80bdcad..e58a4789428b 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -32,12 +32,11 @@
#define _SVT_UNOIFACE_CXX
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
-
#include <svtools/svmedit.hxx>
#include <unoiface.hxx>
-#include "filedlg.hxx"
-#include "filectrl.hxx"
-#include "roadmap.hxx"
+#include <svtools/filedlg.hxx>
+#include <svtools/filectrl.hxx>
+#include <svtools/roadmap.hxx>
#include <svtools/fixedhyper.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
@@ -47,9 +46,8 @@
#include <toolkit/helper/property.hxx>
#include <svtools/fmtfield.hxx>
#include <svl/numuno.hxx>
-#include <calendar.hxx>
-#include <prgsbar.hxx>
-
+#include <svtools/calendar.hxx>
+#include <svtools/prgsbar.hxx>
#include <svtools/svtreebx.hxx>
#include "treecontrolpeer.hxx"
#include "svtxgridcontrol.hxx"
@@ -124,7 +122,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com::
pWindow = new CalendarField( pParent, nWinBits);
static_cast<CalendarField*>(pWindow)->EnableToday();
static_cast<CalendarField*>(pWindow)->EnableNone();
- static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new SVTXDateField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
}
@@ -841,7 +839,7 @@ void SVTXFormattedField::SetWindow( Window* _pWindow )
{
VCLXSpinField::SetWindow(_pWindow);
if (GetFormattedField())
- GetFormattedField()->SetAutoColor(TRUE);
+ GetFormattedField()->SetAutoColor(sal_True);
}
// --------------------------------------------------------------------------------------
@@ -1651,7 +1649,7 @@ void SVTXRoadmap::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "SVTXRoadmap::ImplSetNewImage: window is required to be not-NULL!" );
::svt::ORoadmap* pButton = static_cast< ::svt::ORoadmap* >( GetWindow() );
- pButton->SetRoadmapBitmap( GetBitmap() );
+ pButton->SetRoadmapBitmap( GetImage().GetBitmapEx() );
}
void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
@@ -2135,7 +2133,7 @@ void VCLXProgressBar::ImplUpdateValue()
}
// set progressbar value
- pProgressBar->SetValue( (USHORT) nPercent );
+ pProgressBar->SetValue( (sal_uInt16) nPercent );
}
}
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 37fcc45f20f9..4c20ca232902 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -37,21 +37,17 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
-
#include <comphelper/servicehelper.hxx>
#include <comphelper/propertysethelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <cppuhelper/weakagg.hxx>
-
#include <cppuhelper/implbase3.hxx>
-
#include <list>
#include <rtl/uuid.h>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-
-#include "unoevent.hxx"
-#include "unoimap.hxx"
+#include <svtools/unoevent.hxx>
+#include <svtools/unoimap.hxx>
#include <svtools/imap.hxx>
#include <svtools/imapcirc.hxx>
#include <svtools/imaprect.hxx>
@@ -97,7 +93,7 @@ class SvUnoImageMapObject : public OWeakAggObject,
public XUnoTunnel
{
public:
- SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems );
+ SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems );
SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems );
virtual ~SvUnoImageMapObject() throw();
@@ -130,10 +126,10 @@ public:
virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw( RuntimeException );
private:
- static PropertySetInfo* createPropertySetInfo( UINT16 nType );
+ static PropertySetInfo* createPropertySetInfo( sal_uInt16 nType );
- UINT16 mnType;
+ sal_uInt16 mnType;
::rtl::OUString maURL;
::rtl::OUString maAltText;
@@ -149,7 +145,7 @@ private:
UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject );
-PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
+PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType )
{
switch( nType )
{
@@ -206,7 +202,7 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
}
}
-SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems )
+SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( nType ) ),
mnType( nType )
, mbIsActive( true )
@@ -254,11 +250,11 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv
{
const Polygon aPoly( ((IMapPolygonObject*)&rMapObject)->GetPolygon(sal_False) );
- const USHORT nCount = aPoly.GetSize();
+ const sal_uInt16 nCount = aPoly.GetSize();
maPolygon.realloc( nCount );
awt::Point* pPoints = maPolygon.getArray();
- for( USHORT nPoint = 0; nPoint < nCount; nPoint++ )
+ for( sal_uInt16 nPoint = 0; nPoint < nCount; nPoint++ )
{
const Point& rPoint = aPoly.GetPoint( nPoint );
pPoints->X = rPoint.X();
@@ -610,8 +606,8 @@ SvUnoImageMap::SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pS
{
maName = rMap.GetName();
- const UINT16 nCount = rMap.GetIMapObjectCount();
- for( UINT16 nPos = 0; nPos < nCount; nPos++ )
+ const sal_uInt16 nCount = rMap.GetIMapObjectCount();
+ for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ )
{
IMapObject* pMapObject = rMap.GetIMapObject( nPos );
SvUnoImageMapObject* pUnoObj = new SvUnoImageMapObject( *pMapObject, pSupportedMacroItems );
diff --git a/svtools/source/uno/wizard/makefile.mk b/svtools/source/uno/wizard/makefile.mk
deleted file mode 100644
index 521496fc5d48..000000000000
--- a/svtools/source/uno/wizard/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=../../..
-
-PRJNAME=svtools
-TARGET=unowiz
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/unowizard.obj \
- $(SLO)$/wizardshell.obj \
- $(SLO)$/wizardpagecontroller.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index e9300e2e12eb..e8d7adaf58a2 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -43,6 +43,7 @@
#include <rtl/strbuf.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/urlobj.hxx>
//......................................................................................................................
namespace svt { namespace uno
@@ -207,11 +208,32 @@ namespace svt { namespace uno
m_bInitialized = true;
}
+ static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ INetURLObject aHID( _rHelpURL );
+ if ( aHID.GetProtocol() == INET_PROT_HID )
+ return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 );
+ else
+ return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
+ }
+
+ //------------------------------------------------------------------------
+ static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 );
+ INetURLObject aHID( aTmp );
+ if ( aHID.GetProtocol() == INET_PROT_NOT_VALID )
+ aBuffer.appendAscii( INET_HID_SCHEME );
+ aBuffer.append( aTmp.getStr() );
+ return aBuffer.makeStringAndClear();
+ }
+
//--------------------------------------------------------------------
Dialog* Wizard::createDialog( Window* i_pParent )
{
WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) );
- pDialog->SetSmartHelpId( SmartId( m_sHelpURL ) );
+ pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) );
pDialog->setTitleBase( m_sTitle );
return pDialog;
}
@@ -220,7 +242,7 @@ namespace svt { namespace uno
void Wizard::destroyDialog()
{
if ( m_pDialog )
- m_sHelpURL = m_pDialog->GetSmartHelpId().GetStr();
+ m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() );
Wizard_Base::destroyDialog();
}
@@ -280,8 +302,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
return m_sHelpURL;
- const SmartId aSmartId( m_pDialog->GetSmartHelpId() );
- return aSmartId.GetStr();
+ return lcl_getHelpURL( m_pDialog->GetHelpId() );
}
//------------------------------------------------------------------------------------------------------------------
@@ -293,7 +314,7 @@ namespace svt { namespace uno
if ( !m_pDialog )
m_sHelpURL = i_HelpURL;
else
- m_pDialog->SetSmartHelpId( SmartId( i_HelpURL ) );
+ m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) );
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index fc6ab72ff6e9..eec2fe98dfde 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -76,7 +76,7 @@ namespace svt { namespace uno
try
{
m_xWizardPage.set( m_xController->createPage(
- Reference< XWindow >( i_rParent.GetComponentInterface( TRUE ), UNO_QUERY_THROW ),
+ Reference< XWindow >( i_rParent.GetComponentInterface( sal_True ), UNO_QUERY_THROW ),
m_nPageId
), UNO_SET_THROW );
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index cf6f211a739c..1994acdf5ceb 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -32,11 +32,11 @@
#include <sot/formats.hxx>
#include <tools/stream.hxx>
-#include "inetimg.hxx"
+#include <svtools/inetimg.hxx>
#define TOKEN_SEPARATOR '\001'
-sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const
+sal_Bool INetImage::Write( SvStream& rOStm, sal_uLong nFormat ) const
{
sal_Bool bRet = sal_False;
switch( nFormat )
@@ -66,7 +66,7 @@ sal_Bool INetImage::Write( SvStream& rOStm, ULONG nFormat ) const
return bRet;
}
-sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
+sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
{
sal_Bool bRet = sal_False;
switch( nFormat )
@@ -93,12 +93,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
/*
--> structure size MUST - alignment of 4!
int iSize; // size of all data, including variable length strings
- BOOL bIsMap; // For server side maps
- INT32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct
- INT32 iHeight; // and EDT_ImageData
- INT32 iHSpace;
- INT32 iVSpace;
- INT32 iBorder;
+ sal_Bool bIsMap; // For server side maps
+ sal_Int32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct
+ sal_Int32 iHeight; // and EDT_ImageData
+ sal_Int32 iHSpace;
+ sal_Int32 iVSpace;
+ sal_Int32 iBorder;
int iLowResOffset; // Offsets into string_data. If 0, string is NULL (not used)
int iAltOffset; // (alternate text?)
int iAnchorOffset; // HREF in image
@@ -110,12 +110,12 @@ sal_Bool INetImage::Read( SvStream& rIStm, ULONG nFormat )
ByteString sData;
nFilePos = rIStm.Tell();
- // skip over iSize (int), bIsMao ( BOOL ) alignment of 4 !!!!
+ // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!!
rIStm.SeekRel( 8 );
rIStm >> nVal; aSizePixel.Width() = nVal;
rIStm >> nVal; aSizePixel.Height() = nVal;
// skip over iHSpace, iVSpace, iBorder, iLowResOffset
- rIStm.SeekRel( 3 * sizeof( INT32 ) + sizeof( int ) );
+ rIStm.SeekRel( 3 * sizeof( sal_Int32 ) + sizeof( int ) );
rIStm >> nAltOffset;
rIStm >> nAnchorOffset;
// skip over iExtraHTML_Offset
diff --git a/svtools/source/urlobj/makefile.mk b/svtools/source/urlobj/makefile.mk
deleted file mode 100644
index c75e592ea10b..000000000000
--- a/svtools/source/urlobj/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=urlobj
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/inetimg.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/util/hidother.src b/svtools/util/hidother.src
index 77dd98115221..03aea7ebdf7e 100644
--- a/svtools/util/hidother.src
+++ b/svtools/util/hidother.src
@@ -57,3 +57,23 @@ hidspecial HID_PRINTDIALOG_TOFILE { HelpID = HID_PRINTDIALOG_TOFIL
hidspecial HID_WIZARD_NEXT { HelpID = HID_WIZARD_NEXT; };
hidspecial HID_WIZARD_PREVIOUS { HelpID = HID_WIZARD_PREVIOUS; };
+hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; };
+hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; };
+hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; };
+hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; };
+hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; };
+hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; };
+hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; };
+hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; };
+hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; };
+hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; };
+hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; };
+hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; };
+hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; };
+hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; };
+hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; };
+hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; };
+hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; };
+hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; };
+hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; };
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
deleted file mode 100644
index c8b9eac6a30f..000000000000
--- a/svtools/util/makefile.mk
+++ /dev/null
@@ -1,192 +0,0 @@
-#*************************************************************************
-#*
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=svtools
-TARGET=svtool
-RESTARGET=svt
-RESTARGETPATCH=svp
-GEN_HID=TRUE
-GEN_HID_OTHER=TRUE
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-USE_LDUMP2=TRUE
-
-# --- general section ----------------------------------------------------
-
-.IF "$(GUI)"!="UNX"
-LIB2TARGET= $(LB)$/svtool.lib
-LIB2FILES= $(LB)$/_svt.lib
-.ENDIF
-
-LIB1TARGET= $(SLB)/svt.lib
-LIB1FILES= \
- $(SLB)/browse.lib \
- $(SLB)/config.lib \
- $(SLB)/svcontnr.lib \
- $(SLB)/ctrl.lib \
- $(SLB)/dialogs.lib \
- $(SLB)/edit.lib \
- $(SLB)/filter.lib \
- $(SLB)/filter.uno.lib \
- $(SLB)$/graphic.lib \
- $(SLB)/igif.lib \
- $(SLB)/jpeg.lib \
- $(SLB)/ixpm.lib \
- $(SLB)/ixbm.lib \
- $(SLB)/wmf.lib \
- $(SLB)/java.lib \
- $(SLB)/misc.lib \
- $(SLB)/plugapp.lib \
- $(SLB)/svhtml.lib \
- $(SLB)/svrtf.lib \
- $(SLB)/table.lib \
- $(SLB)/unoiface.lib \
- $(SLB)/unowiz.lib \
- $(SLB)/urlobj.lib \
- $(SLB)/toolpanel.lib
-
-# generation of resourcen-lib ----------------------------------------
-
-RESLIB1NAME= $(RESTARGET)
-RESLIB1IMAGES=$(PRJ)$/res
-RESLIB1SRSFILES= \
- $(SRS)$/filter.srs \
- $(SRS)$/misc.srs \
- $(SRS)$/ctrl.srs \
- $(SRS)$/dialogs.srs \
- $(SRS)$/plugapp.srs \
- $(SRS)$/svcontnr.srs \
- $(SRS)$/browse.srs \
- $(SRS)$/toolpanel.srs \
- $(SRS)$/javaerror.srs
-
-RESLIB3NAME= $(RESTARGETPATCH)
-RESLIB3SRSFILES= \
- $(SRS)$/patchjavaerror.srs
-
-# build the shared library --------------------------------------------------
-
-SHL1TARGET= svt$(DLLPOSTFIX)
-SHL1IMPLIB= _svt
-SHL1USE_EXPORTS=name
-
-.IF "$(OS)"!="MACOSX"
-# static libraries
-SHL1STDLIBS+= $(JPEG3RDLIB)
-.ENDIF
-
-# dynamic libraries
-SHL1STDLIBS+= \
- $(TKLIB) \
- $(VCLLIB) \
- $(SVLLIB) \
- $(SOTLIB) \
- $(BASEGFXLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(I18NISOLANGLIB) \
- $(I18NUTILLIB) \
- $(UCBHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(ICUUCLIB) \
- $(JVMFWKLIB) \
- $(BASEGFXLIB)
-
-.IF "$(OS)"=="MACOSX"
-# static libraries go at end
-SHL1STDLIBS+= $(JPEG3RDLIB)
-.ENDIF
-
-.IF "$(GUI)"=="WNT"
-SHL1STDLIBS+= \
- $(UWINAPILIB) \
- $(ADVAPI32LIB) \
- $(GDI32LIB) \
- $(OLE32LIB) \
- $(UUIDLIB) \
- $(ADVAPI32LIB) \
- $(OLEAUT32LIB)
-.ENDIF # WNT
-
-SHL1LIBS= \
- $(SLB)$/svt.lib
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEFLIB1NAME =svt
-DEF1DES =SvTools
-
-
-# --- g2g application --------------------------------------------------
-
-APP2TARGET = g2g
-APP2BASE = 0x10000000
-APP2DEPN = $(SHL1TARGETN) $(SHL2TARGETN)
-
-APP2OBJS = $(OBJ)$/g2g.obj
-
-.IF "$(GUI)"!="UNX"
-APP2STDLIBS+= $(SVTOOLLIB)
-.ELSE
-APP2STDLIBS+= -lsvt$(DLLPOSTFIX)
-APP2STDLIBS+= -lsvl$(DLLPOSTFIX)
-.ENDIF
-
-APP2STDLIBS+= $(VCLLIB) \
- $(TOOLSLIB) \
- $(SALLIB)
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(GUI)"=="UNX"
-SVTTARGETS= $(LB)$/lib$(SHL1TARGET)$(DLLPOST)
-.ELSE
-SVTTARGETS= $(BIN)$/$(SHL1TARGET)$(DLLPOST)
-.ENDIF
-
-# just a quick fix - has to be cleaned up some day...
-.IF "$(L10N-framework)"==""
-ALL: $(SLB)$/svt.lib \
- $(MISC)$/$(SHL1TARGET).def \
- $(SVTTARGETS) \
- ALLTAR
-.ENDIF # "$(L10N-framework)"==""
-
-.INCLUDE : target.mk
-
-
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
new file mode 100644
index 000000000000..e15970547a38
--- /dev/null
+++ b/svtools/util/svt.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.graphic.GraphicProvider">
+ <service name="com.sun.star.graphic.GraphicProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.graphic.GraphicRendererVCL">
+ <service name="com.sun.star.graphic.GraphicRendererVCL"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno">
+ <service name="com.sun.star.ui.AddressBookSourceDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svtools.uno.Wizard">
+ <service name="com.sun.star.ui.dialogs.Wizard"/>
+ </implementation>
+ <implementation name="com.sun.star.graphic.GraphicObject">
+ <service name="com.sun.star.graphic.GraphicObject"/>
+ </implementation>
+ <implementation name="com.sun.star.svtools.SvFilterOptionsDialog">
+ <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
+ </implementation>
+</component>
diff --git a/svtools/workben/cui/makefile.mk b/svtools/workben/cui/makefile.mk
deleted file mode 100644
index 7c5a0bc4bed6..000000000000
--- a/svtools/workben/cui/makefile.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=cuidem
-LIBTARGET=NO
-
-TARGETTYPE=CUI
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= $(OBJ)$/loadlib.obj
-
-APP4TARGET= dllver
-APP4STDLIBS= \
- $(SVTOOLLIB) \
- $(SVLLIB) \
- $(VCLLIB) \
- $(TOOLSLIB) \
- $(SALLIB)
-.IF "$(GUI)"=="WNT" || "$(COM)"=="GCC"
-APP4STDLIBS+= $(CPPULIB)
-.ENDIF
-APP4OBJS= $(OBJ)$/loadlib.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/workben/makefile.mk b/svtools/workben/makefile.mk
deleted file mode 100644
index 3a0a81fec8bc..000000000000
--- a/svtools/workben/makefile.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=svtools
-TARGET=svdem
-LIBTARGET=NO
-TARGETTYPE=GUI
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= $(OBJ)$/svdem.obj
-
-APP1TARGET= $(TARGET)
-APP1STDLIBS= $(SVTOOLLIB) \
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(COMPHELPERLIB) \
- $(TOOLSLIB) \
- $(SALLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB)
-
-APP1OBJS= $(OBJ)$/svdem.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-ALLTAR : $(BIN)$/applicat.rdb
-
-$(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)
diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx
index 7f25a7d2b32a..f459ab261e8a 100644
--- a/svtools/workben/svdem.cxx
+++ b/svtools/workben/svdem.cxx
@@ -79,7 +79,7 @@ public:
ShowBitmap( Window* pParent, const Bitmap& rBmp );
virtual void Paint( const Rectangle& );
- virtual BOOL Close();
+ virtual sal_Bool Close();
};
// -----------------------------------------------------------------------
@@ -283,11 +283,11 @@ void ShowBitmap::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-BOOL ShowBitmap::Close()
+sal_Bool ShowBitmap::Close()
{
Hide();
delete this;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -353,8 +353,8 @@ MyFontDialog::MyFontDialog( Window* pParent ) :
{
pList = NULL;
- aFontBox.EnableWYSIWYG( TRUE );
- aFontBox.EnableSymbols( TRUE );
+ aFontBox.EnableWYSIWYG( sal_True );
+ aFontBox.EnableSymbols( sal_True );
aFontBox.SetPosSizePixel( Point( 10, 10 ), Size( 140, 140 ) );
aFontBox.SetSelectHdl( LINK( this, MyFontDialog, SelectFont ) );
aFontBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectFont ) );
@@ -422,7 +422,7 @@ MyFontDialog::MyFontDialog( Window* pParent ) :
{
aColorBox.SetPosSizePixel( Point( 15, 305 ), Size( 130, 100 ) );
aColorBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) );
- aColorBox.SetUpdateMode( FALSE );
+ aColorBox.SetUpdateMode( sal_False );
aColorBox.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) );
aColorBox.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) );
aColorBox.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) );
@@ -439,7 +439,7 @@ MyFontDialog::MyFontDialog( Window* pParent ) :
aColorBox.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) );
aColorBox.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) );
aColorBox.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) );
- aColorBox.SetUpdateMode( TRUE );
+ aColorBox.SetUpdateMode( sal_True );
aColorBox.Show();
}
@@ -516,7 +516,7 @@ void MyFontDialog::SetAttr()
aFont.SetShadow( aShadowBox.IsChecked() );
aFont.SetOutline( aOutlineBox.IsChecked() );
aFont.SetOrientation( aLineOrientSlider.GetOrientation() );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
aMapText.SetText( pList->GetFontMapText( aFont ) );
aShowFont.SetFont( aFont );
}
@@ -546,12 +546,12 @@ long MyTabBar::DeactivatePage()
QueryBox aQueryBox( this, WB_YES_NO | WB_DEF_YES,
XubString( RTL_CONSTASCII_USTRINGPARAM( "Deactivate" ) ) );
if ( aQueryBox.Execute() == RET_YES )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -602,8 +602,8 @@ MyCalendar::MyCalendar( Window* pParent ) :
uno::Sequence< i18n::CalendarItem> xItems = rCal.getDays();
const i18n::CalendarItem* pArr = xItems.getArray();
for ( sal_Int16 i = 0; i < nDays; i++ )
- aWeekStartMenu.InsertItem( 10+(USHORT)i, pArr[i].FullName, MIB_AUTOCHECK | MIB_RADIOCHECK );
- aWeekStartMenu.CheckItem( 10+(USHORT)rCal.getFirstDayOfWeek() );
+ aWeekStartMenu.InsertItem( 10+(sal_uInt16)i, pArr[i].FullName, MIB_AUTOCHECK | MIB_RADIOCHECK );
+ aWeekStartMenu.CheckItem( 10+(sal_uInt16)rCal.getFirstDayOfWeek() );
aWeekCountMenu.InsertItem( 20, XubString( RTL_CONSTASCII_USTRINGPARAM( "~1. Januar" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
aWeekCountMenu.InsertItem( 21, XubString( RTL_CONSTASCII_USTRINGPARAM( "~2 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
aWeekCountMenu.InsertItem( 22, XubString( RTL_CONSTASCII_USTRINGPARAM( "~3 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
@@ -611,8 +611,8 @@ MyCalendar::MyCalendar( Window* pParent ) :
aWeekCountMenu.InsertItem( 24, XubString( RTL_CONSTASCII_USTRINGPARAM( "~5 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
aWeekCountMenu.InsertItem( 25, XubString( RTL_CONSTASCII_USTRINGPARAM( "~6 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
aWeekCountMenu.InsertItem( 26, XubString( RTL_CONSTASCII_USTRINGPARAM( "Erste ~volle Woche" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
- //was: one of 0, 1, 2; aWeekCountMenu.CheckItem( 20+(USHORT)rIntn.GetWeekCountStart() );
- aWeekCountMenu.CheckItem( 20+(USHORT)rCal.getMinimumNumberOfDaysForFirstWeek() );
+ //was: one of 0, 1, 2; aWeekCountMenu.CheckItem( 20+(sal_uInt16)rIntn.GetWeekCountStart() );
+ aWeekCountMenu.CheckItem( 20+(sal_uInt16)rCal.getMinimumNumberOfDaysForFirstWeek() );
aMenuBar.SetSelectHdl( LINK( this, MyCalendar, MenuSelectHdl ) );
SetMenuBar( &aMenuBar );
@@ -647,7 +647,7 @@ MyCalendar::~MyCalendar()
IMPL_LINK( MyCalendar, RequestDateInfoHdl, Calendar*, EMPTYARG )
{
- USHORT nRequestYear = aCalendar.GetRequestYear();
+ sal_uInt16 nRequestYear = aCalendar.GetRequestYear();
if ( (nRequestYear >= 1954) && (nRequestYear <= 1989) )
aCalendar.AddDateInfo( Date( 17, 6, nRequestYear ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Tag der deutschen Einheit" ) ), &aHolidayColor, NULL );
else if ( nRequestYear >= 1990 )
@@ -670,7 +670,7 @@ IMPL_LINK( MyCalendar, DoubleClickHdl, Calendar*, EMPTYARG )
IMPL_LINK( MyCalendar, MenuSelectHdl, Menu*, pMenu )
{
- USHORT nItemId = pMenu->GetCurItemId();
+ sal_uInt16 nItemId = pMenu->GetCurItemId();
if ( (nItemId >= 10) && (nItemId <= 19) )
aCalendar.SetWeekStart( nItemId-10 );
@@ -751,7 +751,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) :
{
aColorList.SetPosSizePixel( Point( 10, nY ), Size( 130, 180 ) );
- aColorList.SetUpdateMode( FALSE );
+ aColorList.SetUpdateMode( sal_False );
aColorList.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) );
aColorList.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) );
aColorList.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) );
@@ -768,7 +768,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) :
aColorList.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) );
aColorList.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) );
aColorList.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) );
- aColorList.SetUpdateMode( TRUE );
+ aColorList.SetUpdateMode( sal_True );
aColorList.SetSelectHdl( LINK( this, MyWin, SelectHdl ) );
aColorList.Show();
}
@@ -819,7 +819,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) :
}
{
- aCalendarField.EnableEmptyFieldValue( TRUE );
+ aCalendarField.EnableEmptyFieldValue( sal_True );
aCalendarField.SetCalendarStyle( aCalendarField.GetCalendarStyle() | WB_RANGESELECT );
aCalendarField.SetSelectHdl( LINK( this, MyWin, CalSelectHdl ) );
// aCalendarField.SetDate( Date() );
@@ -969,7 +969,7 @@ IMPL_LINK( MyWin, SelectHdl, Window*, pCtrl )
}
else if ( pCtrl == &aValueSet )
{
- USHORT nId = aValueSet.GetSelectItemId();
+ sal_uInt16 nId = aValueSet.GetSelectItemId();
if ( nId > 8 )
{
Color aColor = aValueSet.GetItemColor( nId );
@@ -978,10 +978,10 @@ IMPL_LINK( MyWin, SelectHdl, Window*, pCtrl )
}
else if ( pCtrl == &aHeadBar )
{
- USHORT nCurItemId = aHeadBar.GetCurItemId();
- for ( USHORT i = 0; i < aHeadBar.GetItemCount(); i++ )
+ sal_uInt16 nCurItemId = aHeadBar.GetCurItemId();
+ for ( sal_uInt16 i = 0; i < aHeadBar.GetItemCount(); i++ )
{
- USHORT nItemId = aHeadBar.GetItemId( i );
+ sal_uInt16 nItemId = aHeadBar.GetItemId( i );
HeaderBarItemBits nBits = aHeadBar.GetItemBits( nItemId );
if ( nItemId == nCurItemId )
{
@@ -1073,9 +1073,9 @@ void MyWin::KeyInput( const KeyEvent& rKEvt )
{
if ( rKEvt.GetKeyCode().GetCode() == KEY_P )
{
- for ( USHORT i = 0; i <= 130; i += 2 )
+ for ( sal_uInt16 i = 0; i <= 130; i += 2 )
{
- for ( USHORT j = 0; j < 6000; j++ )
+ for ( sal_uInt16 j = 0; j < 6000; j++ )
{
aPrgsBar.SetValue( i );
Application::Reschedule();
diff --git a/svtools/workben/toolpanel/makefile.mk b/svtools/workben/toolpanel/makefile.mk
deleted file mode 100644
index 13035ff72f4f..000000000000
--- a/svtools/workben/toolpanel/makefile.mk
+++ /dev/null
@@ -1,106 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=toolpaneltest
-TARGETTYPE=GUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= toolpaneltest.cxx
-
-OBJFILES= $(OBJ)$/toolpaneltest.obj
-
-APP1TARGET= $(TARGET)
-APP1OBJS= $(OBJFILES)
-APP1STDLIBS=\
- $(VCLLIB) \
- $(UCBHELPERLIB) \
- $(SALLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(BASEGFXLIB) \
- $(SVTOOLLIB) \
-
-APP1RAPTH=BRAND
-
-.IF "$(GUI)"!="UNX"
-APP1DEF= $(MISC)$/$(TARGET).def
-.ENDIF
-
-.IF "$(COM)"=="GCC"
-ADDOPTFILES=$(OBJ)$/toolpaneltest.obj
-add_cflagscxx="-frtti -fexceptions"
-.ENDIF
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-# ------------------------------------------------------------------
-# MAC
-# ------------------------------------------------------------------
-
-.IF "$(GUI)" == "MAC"
-
-$(MISC)$/$(TARGET).def: makefile
- echo Kein Def-File fuer Applikationen auf Mac
-.ENDIF
-
-
-# ------------------------------------------------------------------
-# Windows
-# ------------------------------------------------------------------
-
-.IF "$(GUI)" == "WIN"
-
-$(MISC)$/$(TARGET).def: makefile
- echo NAME $(TARGET) >$@
- echo DESCRIPTION 'ToolPanel - Testprogramm' >>$@
- echo EXETYPE WINDOWS >>$@
- echo STUB 'winSTUB.EXE' >>$@
- echo PROTMODE >>$@
- echo CODE PRELOAD MOVEABLE DISCARDABLE >>$@
- echo DATA PRELOAD MOVEABLE MULTIPLE >>$@
- echo HEAPSIZE 8192 >>$@
- echo STACKSIZE 32768 >>$@
-
-.ENDIF
-
diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx
index edd45575538f..925eda2ad288 100644
--- a/svtools/workben/toolpanel/toolpaneltest.cxx
+++ b/svtools/workben/toolpanel/toolpaneltest.cxx
@@ -147,7 +147,7 @@ public:
// IToolPanel
virtual ::rtl::OUString GetDisplayName() const;
virtual Image GetImage() const;
- virtual SmartId GetHelpID() const;
+ virtual rtl::OString GetHelpID() const;
virtual void Activate( Window& i_rParentWindow );
virtual void Deactivate();
virtual void SetSizePixel( const Size& i_rPanelWindowSize );
@@ -274,9 +274,9 @@ Image ColoredPanel::GetImage() const
}
//-----------------------------------------------------------------------------
-SmartId ColoredPanel::GetHelpID() const
+rtl::OString ColoredPanel::GetHelpID() const
{
- return SmartId();
+ return rtl::OString();
}
//=============================================================================
@@ -607,13 +607,13 @@ void OptionsWindow::Resize()
//-----------------------------------------------------------------------------
void OptionsWindow::PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition )
{
- m_aPanelList.InsertEntry( i_pPanel->GetDisplayName(), i_pPanel->GetImage(), USHORT( i_nPosition ) );
+ m_aPanelList.InsertEntry( i_pPanel->GetDisplayName(), i_pPanel->GetImage(), sal_uInt16( i_nPosition ) );
}
//-----------------------------------------------------------------------------
void OptionsWindow::PanelRemoved( const size_t i_nPosition )
{
- m_aPanelList.RemoveEntry( USHORT( i_nPosition ) );
+ m_aPanelList.RemoveEntry( sal_uInt16( i_nPosition ) );
impl_updateRemoveButton();
}
@@ -625,7 +625,7 @@ void OptionsWindow::ActivePanelChanged( const ::boost::optional< size_t >& i_rOl
if ( !i_rNewActive )
m_aPanelList.SetNoSelection();
else
- m_aPanelList.SelectEntryPos( USHORT( *i_rNewActive ) );
+ m_aPanelList.SelectEntryPos( sal_uInt16( *i_rNewActive ) );
}
//-----------------------------------------------------------------------------
diff --git a/svtools/workben/treecontrol/makefile.mk b/svtools/workben/treecontrol/makefile.mk
deleted file mode 100644
index 2558ed2c9a94..000000000000
--- a/svtools/workben/treecontrol/makefile.mk
+++ /dev/null
@@ -1,91 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=treetest
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-APP1NOSAL= TRUE
-APP1TARGET= treetest
-APP1OBJS= $(OBJ)$/treetest.obj
-APP1STDLIBS=$(SOTLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB)
-
-# $(SVTOOLLIB) \
-
-APP2DEF= $(MISC)$/treetest.def
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-# ------------------------------------------------------------------
-# Windows
-# ------------------------------------------------------------------
-
-.IF "$(GUI)" == "WIN"
-
-$(MISC)$/treetest.def: makefile.mk
- echo NAME treetest >$@
- echo DESCRIPTION 'StarView - Testprogramm' >>$@
- echo EXETYPE WINDOWS >>$@
- echo STUB 'winSTUB.EXE' >>$@
- echo PROTMODE >>$@
- echo CODE PRELOAD MOVEABLE DISCARDABLE >>$@
- echo DATA PRELOAD MOVEABLE MULTIPLE >>$@
- echo HEAPSIZE 8192 >>$@
- echo STACKSIZE 32768 >>$@
-
-.ENDIF
-
-ALLTAR : $(BIN)$/treetest.rdb
-
-$(BIN)$/treetest.rdb : makefile.mk $(UNOUCRRDB)
- rm -f $@
- $(GNUCOPY) $(UNOUCRRDB) $@
- +cd $(BIN) && \
- regcomp -register -r treetest.rdb \
- -c i18nsearch.uno$(DLLPOST) \
- -c i18npool.uno$(DLLPOST) \
- -c connector.uno$(DLLPOST) \
- -c remotebridge.uno$(DLLPOST) \
- -c bridgefac.uno$(DLLPOST) \
- -c uuresolver.uno$(DLLPOST) \
- -c $(DLLPRE)tk$(DLLPOSTFIX)$(DLLPOST)
diff --git a/svtools/workben/unodialog/makefile.mk b/svtools/workben/unodialog/makefile.mk
deleted file mode 100644
index f18feffce5c3..000000000000
--- a/svtools/workben/unodialog/makefile.mk
+++ /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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)/inc
-PRJNAME=svtools
-TARGET=udlg
-USE_DEFFILE=TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files -------------------------------------
-
-# ... resource files ............................
-
-SRS1NAME=$(TARGET)
-SRC1FILES = \
- roadmapskeleton.src
-
-# ... object files ............................
-SLOFILES= $(SLO)$/unodialogsample.obj \
- $(SLO)$/roadmapskeleton.obj \
- $(SLO)$/roadmapskeletonpages.obj \
- $(SLO)$/udlg_module.obj \
- $(SLO)$/udlg_services.obj \
-
-# --- library -----------------------------------
-
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-
-SHL1STDLIBS= \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(SALLIB) \
- $(SVTOOLLIB) \
- $(VCLLIB)
-
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1IMPLIB= i$(TARGET)
-SHL1DEPN= $(SHL1LIBS)
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-# --- .res files -------------------------------
-
-RES1FILELIST=\
- $(SRS)$/$(TARGET).srs
-
-RESLIB1NAME=$(TARGET)
-RESLIB1IMAGES=$(PRJ)$/res
-RESLIB1SRSFILES=$(RES1FILELIST)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src
index 797490273b5f..33728c700df6 100644
--- a/svtools/workben/unodialog/roadmapskeleton.src
+++ b/svtools/workben/unodialog/roadmapskeleton.src
@@ -31,6 +31,7 @@
// -----------------------------------------------------------------------------
ModalDialog DLG_ROADMAP_SKELETON
{
+ HelpID = "svtools:ModalDialog:DLG_ROADMAP_SKELETON";
OutputSize = TRUE ;
Moveable = TRUE;
Closeable = TRUE ;
@@ -61,24 +62,28 @@ ModalDialog DLG_ROADMAP_SKELETON
TabPage TP_WELCOME
{
+ HelpID = "svtools:TabPage:TP_WELCOME";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_PREPARE
{
+ HelpID = "svtools:TabPage:TP_PREPARE";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_SETUP
{
+ HelpID = "svtools:TabPage:TP_SETUP";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
TabPage TP_FINISH
{
+ HelpID = "svtools:TabPage:TP_FINISH";
Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT );
Hide = TRUE;
};
diff --git a/comphelper/source/xml/makefile.mk b/toolkit/AllLangResTarget_tk.mk
index 8fa34b2477a2..1879f436c84b 100644
--- a/comphelper/source/xml/makefile.mk
+++ b/toolkit/AllLangResTarget_tk.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,24 +25,20 @@
#
#*************************************************************************
-PRJ=..$/..
-PRJNAME=comphelper
-TARGET=xml
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,tk))
-ENABLE_EXCEPTIONS=TRUE
+$(eval $(call gb_AllLangResTarget_set_reslocation,tk,toolkit))
-# --- Settings ----------------------------------
+$(eval $(call gb_AllLangResTarget_add_srs,tk,\
+ toolkit/awt \
+))
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_SrsTarget_SrsTarget,toolkit/awt))
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/ofopxmlhelper.obj \
- $(SLO)$/attributelist.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
+$(eval $(call gb_SrsTarget_set_include,toolkit/awt,\
+ $$(INCLUDE) \
+))
+$(eval $(call gb_SrsTarget_add_files,toolkit/awt,\
+ toolkit/source/awt/xthrobber.src \
+))
diff --git a/toolkit/JunitTest_toolkit_unoapi.mk b/toolkit/JunitTest_toolkit_unoapi.mk
new file mode 100755
index 000000000000..27dc89e13478
--- /dev/null
+++ b/toolkit/JunitTest_toolkit_unoapi.mk
@@ -0,0 +1,53 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_JunitTest_JunitTest,toolkit_unoapi))
+
+$(eval $(call gb_JunitTest_set_defs,toolkit_unoapi,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.sce=$(SRCDIR)/toolkit/qa/unoapi/toolkit.sce \
+ -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/toolkit/qa/unoapi/knownissues.xcl \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/toolkit/qa/unoapi/testdocuments \
+))
+
+$(eval $(call gb_JunitTest_add_jars,toolkit_unoapi,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
+
+$(eval $(call gb_JunitTest_add_sourcefiles,toolkit_unoapi,\
+ toolkit/qa/unoapi/Test \
+))
+
+$(eval $(call gb_JunitTest_add_classes,toolkit_unoapi,\
+ org.openoffice.toolkit.qa.unoapi.Test \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
new file mode 100644
index 000000000000..15c8692c1ca1
--- /dev/null
+++ b/toolkit/Library_tk.mk
@@ -0,0 +1,172 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,tk))
+
+$(eval $(call gb_Library_set_componentfile,tk,toolkit/util/tk))
+
+$(eval $(call gb_Library_add_package_headers,tk,toolkit_inc))
+
+#$(eval $(call gb_Library_add_precompiled_header,tk,$(SRCDIR)/toolkit/inc/pch/precompiled_toolkit))
+
+$(eval $(call gb_Library_set_include,tk,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/toolkit/inc) \
+ -I$(realpath $(SRCDIR)/toolkit/inc/pch) \
+ -I$(realpath $(SRCDIR)/toolkit/source) \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Library_set_defs,tk,\
+ $$(DEFS) \
+ -DTOOLKIT_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,tk,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ tl \
+ utl \
+ vcl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,tk,\
+ toolkit/source/awt/asynccallback \
+ toolkit/source/awt/stylesettings \
+ toolkit/source/awt/vclxaccessiblecomponent \
+ toolkit/source/awt/vclxbitmap \
+ toolkit/source/awt/vclxbutton \
+ toolkit/source/awt/vclxcontainer \
+ toolkit/source/awt/vclxdevice \
+ toolkit/source/awt/vclxdialog \
+ toolkit/source/awt/vclxfixedline \
+ toolkit/source/awt/vclxfont \
+ toolkit/source/awt/vclxgraphics \
+ toolkit/source/awt/vclxmenu \
+ toolkit/source/awt/vclxplugin \
+ toolkit/source/awt/vclxpointer \
+ toolkit/source/awt/vclxprinter \
+ toolkit/source/awt/vclxregion \
+ toolkit/source/awt/vclxscroller \
+ toolkit/source/awt/vclxspinbutton \
+ toolkit/source/awt/vclxsplitter \
+ toolkit/source/awt/vclxsystemdependentwindow \
+ toolkit/source/awt/vclxtabcontrol \
+ toolkit/source/awt/vclxtabpage \
+ toolkit/source/awt/vclxtabpagecontainer \
+ toolkit/source/awt/animatedimagespeer \
+ toolkit/source/awt/vclxtoolkit \
+ toolkit/source/awt/vclxtopwindow \
+ toolkit/source/awt/vclxwindow \
+ toolkit/source/awt/vclxwindow1 \
+ toolkit/source/awt/vclxwindows \
+ toolkit/source/awt/xsimpleanimation \
+ toolkit/source/awt/xthrobber \
+ toolkit/source/controls/accessiblecontrolcontext \
+ toolkit/source/controls/controlmodelcontainerbase \
+ toolkit/source/controls/dialogcontrol \
+ toolkit/source/controls/eventcontainer \
+ toolkit/source/controls/formattedcontrol \
+ toolkit/source/controls/geometrycontrolmodel \
+ toolkit/source/controls/grid/defaultgridcolumnmodel \
+ toolkit/source/controls/grid/defaultgriddatamodel \
+ toolkit/source/controls/grid/gridcolumn \
+ toolkit/source/controls/grid/grideventforwarder \
+ toolkit/source/controls/grid/sortablegriddatamodel \
+ toolkit/source/controls/grid/gridcontrol \
+ toolkit/source/controls/roadmapcontrol \
+ toolkit/source/controls/roadmapentry \
+ toolkit/source/controls/tabpagecontainer \
+ toolkit/source/controls/tabpagemodel \
+ toolkit/source/controls/stdtabcontroller \
+ toolkit/source/controls/stdtabcontrollermodel \
+ toolkit/source/controls/tkscrollbar \
+ toolkit/source/controls/tksimpleanimation \
+ toolkit/source/controls/tkspinbutton \
+ toolkit/source/controls/tkthrobber \
+ toolkit/source/controls/animatedimages \
+ toolkit/source/controls/spinningprogress \
+ toolkit/source/controls/tree/treecontrol \
+ toolkit/source/controls/tree/treedatamodel \
+ toolkit/source/controls/unocontrol \
+ toolkit/source/controls/unocontrolbase \
+ toolkit/source/controls/unocontrolcontainer \
+ toolkit/source/controls/unocontrolcontainermodel \
+ toolkit/source/controls/unocontrolmodel \
+ toolkit/source/controls/unocontrols \
+ toolkit/source/helper/accessibilityclient \
+ toolkit/source/helper/externallock \
+ toolkit/source/helper/fixedhyperbase \
+ toolkit/source/helper/formpdfexport \
+ toolkit/source/helper/imagealign \
+ toolkit/source/helper/listenermultiplexer \
+ toolkit/source/helper/property \
+ toolkit/source/helper/registerservices \
+ toolkit/source/helper/servicenames \
+ toolkit/source/helper/tkresmgr \
+ toolkit/source/helper/unomemorystream \
+ toolkit/source/helper/unopropertyarrayhelper \
+ toolkit/source/helper/unowrapper \
+ toolkit/source/helper/vclunohelper \
+ toolkit/source/layout/core/bin \
+ toolkit/source/layout/core/box \
+ toolkit/source/layout/core/box-base \
+ toolkit/source/layout/core/byteseq \
+ toolkit/source/layout/core/container \
+ toolkit/source/layout/core/dialogbuttonhbox \
+ toolkit/source/layout/core/factory \
+ toolkit/source/layout/core/flow \
+ toolkit/source/layout/core/helper \
+ toolkit/source/layout/core/import \
+ toolkit/source/layout/core/localized-string \
+ toolkit/source/layout/core/proplist \
+ toolkit/source/layout/core/root \
+ toolkit/source/layout/core/table \
+ toolkit/source/layout/core/timer \
+ toolkit/source/layout/core/translate \
+ toolkit/source/layout/core/vcl \
+ toolkit/source/layout/vcl/wbutton \
+ toolkit/source/layout/vcl/wcontainer \
+ toolkit/source/layout/vcl/wfield \
+ toolkit/source/layout/vcl/wrapper \
+))
+
+ifeq ($(GUIBASE),aqua)
+$(eval $(call gb_Library_set_cxxflags,tk,\
+ $$(CXXFLAGS) $(gb_OBJCXXFLAGS)))
+endif
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_linked_libs,tk,\
+ X11 \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/toolkit/Makefile b/toolkit/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/toolkit/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/source/inet/makefile.mk b/toolkit/Module_toolkit.mk
index 1e0bdfdd2391..858aecd1c13d 100644
--- a/tools/source/inet/makefile.mk
+++ b/toolkit/Module_toolkit.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,21 +25,18 @@
#
#*************************************************************************
-PRJ = ..$/..
-PRJNAME = tools
-TARGET = inet
+$(eval $(call gb_Module_Module,toolkit))
-.INCLUDE: settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+$(eval $(call gb_Module_add_targets,toolkit,\
+ AllLangResTarget_tk \
+ Library_tk \
+ Package_inc \
+ Package_source \
+ Package_util \
+))
-SLOFILES=\
- $(SLO)$/inetmime.obj \
- $(SLO)$/inetmsg.obj \
- $(SLO)$/inetstrm.obj
+$(eval $(call gb_Module_add_subsequentcheck_targets,toolkit,\
+ JunitTest_toolkit_unoapi \
+))
-OBJFILES=\
- $(OBJ)$/inetmime.obj \
- $(OBJ)$/inetmsg.obj \
- $(OBJ)$/inetstrm.obj
-
-.INCLUDE: target.mk
+# vim: set noet sw=4 ts=4:
diff --git a/toolkit/Package_inc.mk b/toolkit/Package_inc.mk
new file mode 100644
index 000000000000..03d49fe6a45e
--- /dev/null
+++ b/toolkit/Package_inc.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,toolkit_inc,$(SRCDIR)/toolkit/inc))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/layout/layout-post.hxx,layout/layout-post.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/layout/layout-pre.hxx,layout/layout-pre.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/layout/layout.hxx,layout/layout.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxaccessiblecomponent.hxx,toolkit/awt/vclxaccessiblecomponent.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxcontainer.hxx,toolkit/awt/vclxcontainer.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxdevice.hxx,toolkit/awt/vclxdevice.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxfont.hxx,toolkit/awt/vclxfont.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxmenu.hxx,toolkit/awt/vclxmenu.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxsystemdependentwindow.hxx,toolkit/awt/vclxsystemdependentwindow.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxtoolkit.hxx,toolkit/awt/vclxtoolkit.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxtopwindow.hxx,toolkit/awt/vclxtopwindow.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxwindow.hxx,toolkit/awt/vclxwindow.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/awt/vclxwindows.hxx,toolkit/awt/vclxwindows.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/controls/unocontrol.hxx,toolkit/controls/unocontrol.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/controls/unocontrolbase.hxx,toolkit/controls/unocontrolbase.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/controls/unocontrolmodel.hxx,toolkit/controls/unocontrolmodel.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/controls/unocontrols.hxx,toolkit/controls/unocontrols.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/dllapi.h,toolkit/dllapi.h))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/accessibilityclient.hxx,toolkit/helper/accessibilityclient.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/accessiblefactory.hxx,toolkit/helper/accessiblefactory.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/convert.hxx,toolkit/helper/convert.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/emptyfontdescriptor.hxx,toolkit/helper/emptyfontdescriptor.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/externallock.hxx,toolkit/helper/externallock.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/fixedhyperbase.hxx,toolkit/helper/fixedhyperbase.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/formpdfexport.hxx,toolkit/helper/formpdfexport.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/imagealign.hxx,toolkit/helper/imagealign.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/listenermultiplexer.hxx,toolkit/helper/listenermultiplexer.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/macros.hxx,toolkit/helper/macros.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/mutexandbroadcasthelper.hxx,toolkit/helper/mutexandbroadcasthelper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/mutexhelper.hxx,toolkit/helper/mutexhelper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/property.hxx,toolkit/helper/property.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/servicenames.hxx,toolkit/helper/servicenames.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/tkresmgr.hxx,toolkit/helper/tkresmgr.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/unomemorystream.hxx,toolkit/helper/unomemorystream.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/unopropertyarrayhelper.hxx,toolkit/helper/unopropertyarrayhelper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/unowrapper.hxx,toolkit/helper/unowrapper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/vclunohelper.hxx,toolkit/helper/vclunohelper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/unohlp.hxx,toolkit/helper/vclunohelper.hxx))
diff --git a/toolkit/Package_source.mk b/toolkit/Package_source.mk
new file mode 100644
index 000000000000..6dd69fda6098
--- /dev/null
+++ b/toolkit/Package_source.mk
@@ -0,0 +1,47 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,toolkit_source,$(SRCDIR)/toolkit/source))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/bin.hxx,layout/core/bin.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/box-base.hxx,layout/core/box-base.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/box.hxx,layout/core/box.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/container.hxx,layout/core/container.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/dialogbuttonhbox.hxx,layout/core/dialogbuttonhbox.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/factory.hxx,layout/core/factory.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/flow.hxx,layout/core/flow.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/helper.hxx,layout/core/helper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/import.hxx,layout/core/import.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/localized-string.hxx,layout/core/localized-string.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/precompiled_xmlscript.hxx,layout/core/precompiled_xmlscript.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/proplist.hxx,layout/core/proplist.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/root.hxx,layout/core/root.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/table.hxx,layout/core/table.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/timer.hxx,layout/core/timer.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/translate.hxx,layout/core/translate.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/vcl.hxx,layout/core/vcl.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/vcl/wrapper.hxx,layout/vcl/wrapper.hxx))
+$(eval $(call gb_Package_add_file,toolkit_source,inc/toolkit/awt/vclxdialog.hxx,awt/vclxdialog.hxx))
diff --git a/tools/util/makefile.pmk b/toolkit/Package_util.mk
index 9d8fc0d3ad24..b8580d0205c8 100644
--- a/tools/util/makefile.pmk
+++ b/toolkit/Package_util.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -25,7 +25,5 @@
#
#*************************************************************************
-# define TOOLS_DLLIMPLEMENTATION (see @ toolsdllapi.h)
-CDEFS += -DTOOLS_DLLIMPLEMENTATION
-
-VISIBILITY_HIDDEN=TRUE
+$(eval $(call gb_Package_Package,toolkit_util,$(SRCDIR)/toolkit/util))
+$(eval $(call gb_Package_add_file,toolkit_util,xml/toolkit.xml,toolkit.xml))
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index 9322cdc2924d..083214407e7a 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -39,10 +39,9 @@
#include <tools/string.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/combobox.h>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <vcl/lstbox.h>
-#include <vcl/smartid.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
class Button;
class ComboBox;
@@ -161,10 +160,8 @@ public:
String GetText() const;
void SetStyle( WinBits style );
void SetUpdateMode( bool mode );
- void SetHelpId( sal_uIntPtr id );
- sal_uIntPtr GetHelpId() const;
- void SetSmartHelpId( SmartId const&, SmartIdUpdateMode mode=SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& id );
+ const rtl::OString& GetHelpId() const;
void EnterWait ();
void LeaveWait ();
bool IsWait () const;
@@ -579,20 +576,20 @@ public:
#define DECL_MESSAGE_BOX_CTORS(Name)\
public:\
Name##Box (::Window *parent, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, char const* message,\
- char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
+ char const* yes=0, char const* no=0, const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box");\
Name##Box (::Window *parent, WinBits, rtl::OUString const& message,\
rtl::OUString yes=String (),\
rtl::OUString no=String (),\
- sal_uIntPtr help_id=0,\
+ const rtl::OString& help_id=rtl::OString(),\
char const* xml_file="message-box.xml", char const* id="message-box")\
class TOOLKIT_DLLPUBLIC MessageBox : public Dialog
@@ -613,10 +610,10 @@ protected:
YesButton yesButton;
void bits_init (WinBits bits, rtl::OUString const& message,
- rtl::OUString yes, rtl::OUString, sal_uIntPtr help_id);
+ rtl::OUString yes, rtl::OUString, const rtl::OString& help_id);
void init (rtl::OUString const& message,
- rtl::OUString const& yes, rtl::OUString const& no, sal_uIntPtr help_id);
- void init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id);
+ rtl::OUString const& yes, rtl::OUString const& no, const rtl::OString& help_id);
+ void init (char const* message, char const* yes, char const* no, const rtl::OString& help_id);
};
#define CLASS_MESSAGE_BOX(Name)\
@@ -794,7 +791,7 @@ public:
operator String();
String getString ();
rtl::OUString getOUString ();
- String GetToken (USHORT i, sal_Char c);
+ String GetToken (sal_uInt16 i, sal_Char c);
};
class InPlugImpl;
diff --git a/toolkit/inc/makefile.mk b/toolkit/inc/makefile.mk
deleted file mode 100644
index 41100071a4d8..000000000000
--- a/toolkit/inc/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=toolkit
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx
index 2a078fe1a8ba..c2c86fe35611 100644
--- a/toolkit/inc/pch/precompiled_toolkit.hxx
+++ b/toolkit/inc/pch/precompiled_toolkit.hxx
@@ -326,7 +326,7 @@
#include "vcl/gradient.hxx"
#include "vcl/image.hxx"
#include "vcl/jobset.hxx"
-#include "vcl/mapunit.hxx"
+#include "tools/mapunit.hxx"
#include "vcl/menu.hxx"
#include "vcl/metric.hxx"
#include "vcl/outdev.hxx"
diff --git a/toolkit/inc/toolkit/awt/animatedimagespeer.hxx b/toolkit/inc/toolkit/awt/animatedimagespeer.hxx
new file mode 100755
index 000000000000..b9bdecdf0e47
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/animatedimagespeer.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ * DO NOT ALTER 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 TOOLKIT_ANIMATEDIMAGEPEER_HXX
+#define TOOLKIT_ANIMATEDIMAGEPEER_HXX
+
+#include "toolkit/awt/vclxwindow.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase3.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer
+ //==================================================================================================================
+ struct AnimatedImagesPeer_Data;
+ typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XModifyListener
+ > AnimatedImagesPeer_Base;
+
+ class AnimatedImagesPeer :public AnimatedImagesPeer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ AnimatedImagesPeer();
+
+ protected:
+ ~AnimatedImagesPeer();
+
+ public:
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // VclWindowPeer
+ virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ void ProcessWindowEvent( const VclWindowEvent& i_windowEvent );
+
+ private:
+ /** updates our images with the ones from the givem XAnimatedImages component
+ */
+ void impl_updateImages_nolck( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_animatedImages );
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesPeer_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGEPEER_HXX
diff --git a/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx b/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
index 24eae01f8e9d..0b88ee59bb56 100644
--- a/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
+++ b/toolkit/inc/toolkit/awt/vclxaccessiblecomponent.hxx
@@ -75,8 +75,8 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> mxWindow;
VCLXWindow* mpVCLXindow;
- ULONG nDummy1;
- ULONG nDummy2;
+ sal_uLong nDummy1;
+ sal_uLong nDummy2;
void* pDummy1;
VCLExternalSolarLock* m_pSolarLock;
diff --git a/toolkit/inc/toolkit/awt/vclxcontainer.hxx b/toolkit/inc/toolkit/awt/vclxcontainer.hxx
index 3e95d8f9811f..fa66ba43af99 100644
--- a/toolkit/inc/toolkit/awt/vclxcontainer.hxx
+++ b/toolkit/inc/toolkit/awt/vclxcontainer.hxx
@@ -43,7 +43,7 @@
// class VCLXContainer
// ----------------------------------------------------
-class VCLXContainer : public ::com::sun::star::awt::XVclContainer,
+class TOOLKIT_DLLPUBLIC VCLXContainer : public ::com::sun::star::awt::XVclContainer,
public ::com::sun::star::awt::XVclContainerPeer,
public VCLXWindow
{
diff --git a/toolkit/inc/toolkit/awt/vclxdevice.hxx b/toolkit/inc/toolkit/awt/vclxdevice.hxx
index d7d144edff98..fba5ec764a86 100644
--- a/toolkit/inc/toolkit/awt/vclxdevice.hxx
+++ b/toolkit/inc/toolkit/awt/vclxdevice.hxx
@@ -45,7 +45,7 @@ class VirtualDevice;
// class VCLXDevice
// ----------------------------------------------------
-// For using nDummy, no incompatible update, add a BOOL bCreatedWithToolkitMember later...
+// For using nDummy, no incompatible update, add a sal_Bool bCreatedWithToolkitMember later...
#define FLAGS_CREATEDWITHTOOLKIT 0x00000001
class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice,
diff --git a/toolkit/inc/toolkit/awt/vclxfont.hxx b/toolkit/inc/toolkit/awt/vclxfont.hxx
index 3aa432071251..a35ec3aa1875 100644
--- a/toolkit/inc/toolkit/awt/vclxfont.hxx
+++ b/toolkit/inc/toolkit/awt/vclxfont.hxx
@@ -54,7 +54,7 @@ private:
FontMetric* mpFontMetric;
protected:
- BOOL ImplAssertValidFontMetric();
+ sal_Bool ImplAssertValidFontMetric();
::osl::Mutex& GetMutex() { return maMutex; }
public:
diff --git a/toolkit/inc/toolkit/awt/vclxmenu.hxx b/toolkit/inc/toolkit/awt/vclxmenu.hxx
index ad41e04033f9..74bdeeefa4d3 100644
--- a/toolkit/inc/toolkit/awt/vclxmenu.hxx
+++ b/toolkit/inc/toolkit/awt/vclxmenu.hxx
@@ -83,7 +83,7 @@ public:
Menu* GetMenu() const { return mpMenu; }
- BOOL IsPopupMenu() const;
+ sal_Bool IsPopupMenu() const;
// ::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);
diff --git a/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx
new file mode 100644
index 000000000000..d4fe2a727b43
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx
@@ -0,0 +1,90 @@
+// ----------------------------------------------------
+// class VCLXDialog
+/*************************************************************************
+ *
+ * DO NOT ALTER 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 _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+//#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <toolkit/awt/vclxcontainer.hxx>
+
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper2 < VCLXContainer
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ , ::com::sun::star::container::XContainerListener
+ > VCLXTabPageContainer_Base;
+class VCLXTabPageContainer : public VCLXTabPageContainer_Base
+{
+public:
+ VCLXTabPageContainer();
+ ~VCLXTabPageContainer();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::grid::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+private:
+ sal_Int16 m_nActiveTabPageId;
+ TabPageListenerMultiplexer m_aTabPageListeners;
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx
new file mode 100644
index 000000000000..670ed25c0f2d
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx
@@ -0,0 +1,82 @@
+// ----------------------------------------------------
+// class VCLXDialog
+/*************************************************************************
+ *
+ * DO NOT ALTER 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 _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include "forward.hxx"
+#include <cppuhelper/implbase1.hxx>
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel,
+ ::com::sun::star::awt::tab::XTabPageModel
+ > VCLXTabPageModel_Base;
+class VCLXTabPageModel : public VCLXTabPageModel_Base
+{
+public:
+ VCLXTabPageModel();
+ VCLXTabPageModel( const VCLXTabPageModel& rModel ) : VCLXTabPageModel_Base( rModel ) {;}
+ ~VCLXTabPageModel();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+ UnoControlModel* Clone() const { return new VCLXTabPageModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
index 314168738d93..e706d9cc4a81 100644
--- a/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
+++ b/toolkit/inc/toolkit/awt/vclxtoolkit.hxx
@@ -42,7 +42,7 @@
#include <osl/mutex.hxx>
#include <osl/module.h>
#include <tools/link.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <toolkit/dllapi.h>
diff --git a/toolkit/inc/toolkit/awt/vclxtopwindow.hxx b/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
index 76bdf0b8dceb..16f9910391d0 100644
--- a/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
+++ b/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
@@ -91,7 +91,7 @@ public:
// class VCLXTopWindow
// ----------------------------------------------------
-class VCLXTopWindow: public VCLXTopWindow_Base,
+class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base,
public VCLXContainer
{
protected:
diff --git a/toolkit/inc/toolkit/awt/vclxwindow.hxx b/toolkit/inc/toolkit/awt/vclxwindow.hxx
index fb3ca32b590a..e5c60349a2f7 100644
--- a/toolkit/inc/toolkit/awt/vclxwindow.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindow.hxx
@@ -101,7 +101,7 @@ protected:
CreateAccessibleContext();
void SetSynthesizingVCLEvent( sal_Bool b );
- BOOL IsSynthesizingVCLEvent() const;
+ sal_Bool IsSynthesizingVCLEvent() const;
void SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle );
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index a487c9080ec0..3949b543c685 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -124,7 +124,7 @@ private:
Image maImage;
protected:
- BitmapEx GetBitmap() const { return maImage.GetBitmapEx(); }
+ const Image& GetImage() const { return maImage; }
protected:
// ::com::sun::star::awt::XWindow
@@ -295,7 +295,7 @@ private:
::rtl::OUString maActionCommand;
protected:
- void ImplClickedOrToggled( BOOL bToggled );
+ void ImplClickedOrToggled( sal_Bool bToggled );
void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
@@ -414,7 +414,7 @@ public:
// ----------------------------------------------------
// class VCLXDialog
// ----------------------------------------------------
-class VCLXDialog : public ::com::sun::star::awt::XDialog2,
+class TOOLKIT_DLLPUBLIC VCLXDialog : public ::com::sun::star::awt::XDialog2,
public ::com::sun::star::document::XVbaMethodParameter, //liuchen 2009-6-22, add the support of input/output parameters to VBA UserForm_QueryClose event
public VCLXTopWindow
{
@@ -433,7 +433,7 @@ public:
// ::com::sun::star::awt::XDialog2
virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
@@ -536,7 +536,7 @@ public:
virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
// C++
TabControl* getTabControl() const throw ( ::com::sun::star::uno::RuntimeException);
- USHORT insertTab( TabPage*, rtl::OUString& sTitle );
+ sal_uInt16 insertTab( TabPage*, rtl::OUString& sTitle );
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
};
diff --git a/toolkit/inc/toolkit/awt/xsimpleanimation.hxx b/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
index 74ae6f619d24..e00c01082045 100644
--- a/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
+++ b/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
@@ -34,40 +34,28 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/awt/XSimpleAnimation.hpp>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace toolkit
{
- class Throbber_Impl;
//........................................................................
//====================================================================
//= XSimpleAnimation
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleAnimation
- > XSimpleAnimation_Base;
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XSimpleAnimation
+ > XSimpleAnimation_Base;
- class XSimpleAnimation :public VCLXWindow
- ,public XSimpleAnimation_Base
+ class XSimpleAnimation : public XSimpleAnimation_Base
{
- private:
- //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > maImageList;
- sal_Bool mbRepeat;
- sal_Int32 mnStepTime;
-
- Throbber_Impl *mpThrobber;
-
public:
XSimpleAnimation();
protected:
~XSimpleAnimation();
- // XInterface
- DECLARE_XINTERFACE()
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XSimpleAnimation
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
@@ -77,9 +65,6 @@ namespace toolkit
virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
- // VCLXWindow
- void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
-
private:
XSimpleAnimation( const XSimpleAnimation& ); // never implemented
XSimpleAnimation& operator=( const XSimpleAnimation& ); // never implemented
diff --git a/toolkit/inc/toolkit/awt/xthrobber.hxx b/toolkit/inc/toolkit/awt/xthrobber.hxx
index 8b87fec352cc..1ea916c56072 100644
--- a/toolkit/inc/toolkit/awt/xthrobber.hxx
+++ b/toolkit/inc/toolkit/awt/xthrobber.hxx
@@ -34,23 +34,25 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/awt/XThrobber.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
//........................................................................
namespace toolkit
{
//........................................................................
- class Throbber_Impl;
//====================================================================
//= XThrobber
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XThrobber
- > XThrobber_Base;
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XThrobber
+ > XThrobber_Base;
- class XThrobber :public VCLXWindow
- ,public XThrobber_Base
+ class XThrobber :public XThrobber_Base
+ ,public ::boost::noncopyable
{
private:
- Throbber_Impl *mpThrobber;
void SAL_CALL InitImageList() throw(::com::sun::star::uno::RuntimeException);
public:
@@ -59,22 +61,12 @@ namespace toolkit
protected:
~XThrobber();
- // XInterface
- DECLARE_XINTERFACE()
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XThrobber
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
- // VclWindowPeer
- virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
-
// VCLXWindow
- void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
+ virtual void SetWindow( Window* pWindow );
private:
XThrobber( const XThrobber& ); // never implemented
diff --git a/toolkit/inc/toolkit/controls/animatedimages.hxx b/toolkit/inc/toolkit/controls/animatedimages.hxx
new file mode 100755
index 000000000000..c19ed5e5451c
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/animatedimages.hxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ * DO NOT ALTER 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 TOOLKIT_ANIMATEDIMAGES_HXX
+#define TOOLKIT_ANIMATEDIMAGES_HXX
+
+#include "toolkit/controls/unocontrolbase.hxx"
+#include "toolkit/controls/unocontrolmodel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //=
+ //==================================================================================================================
+ typedef ::cppu::AggImplInheritanceHelper2 < UnoControlBase
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ > AnimatedImagesControl_Base;
+
+ class AnimatedImagesControl : public AnimatedImagesControl_Base
+ {
+ public:
+ AnimatedImagesControl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
+ ::rtl::OUString GetComponentServiceName();
+
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& i_rModel ) throw ( ::com::sun::star::uno::RuntimeException );
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& i_toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& i_parentPeer ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel
+ //==================================================================================================================
+ struct AnimatedImagesControlModel_Data;
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::XAnimatedImages
+ > AnimatedImagesControlModel_Base;
+ class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
+ {
+ public:
+ AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
+ AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages
+ virtual ::sal_Int32 SAL_CALL getStepTime() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStepTime( ::sal_Int32 _steptime ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAutoRepeat() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAutoRepeat( ::sal_Bool _autorepeat ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getScaleMode() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getImageSetCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL replaceImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages::XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~AnimatedImagesControlModel();
+
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesControlModel_Data >
+ m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGES_HXX
diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
new file mode 100644
index 000000000000..f6859690ce24
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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 TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+#define TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/util/XChangesNotifier.hpp>
+#include <com/sun/star/util/XChangesListener.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+// ----------------------------------------------------
+// class ControlModelContainerBase
+// ----------------------------------------------------
+typedef UnoControlModel ControlModel_Base;
+typedef ::cppu::AggImplInheritanceHelper8 < ControlModel_Base
+ , ::com::sun::star::lang::XMultiServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XNameContainer
+ , ::com::sun::star::awt::XTabControllerModel
+ , ::com::sun::star::util::XChangesNotifier
+ , ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::awt::tab::XTabPageModel
+ , ::com::sun::star::lang::XInitialization
+ > ControlModelContainer_IBase;
+
+class ControlModelContainerBase : public ControlModelContainer_IBase
+{
+public:
+ // would like to make this typedef private, too, but the Forte 7 compiler does have
+ // problems with this .....
+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, ::rtl::OUString >
+ UnoControlModelHolder;
+private:
+ typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
+
+public:
+ // for grouping control models (XTabControllerModel::getGroupXXX)
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
+ ModelGroup;
+ typedef ::std::vector< ModelGroup > AllGroups;
+
+ friend struct CloneControlModel;
+ friend struct FindControlModel;
+ friend struct CompareControlModel;
+
+protected:
+ ContainerListenerMultiplexer maContainerListeners;
+ ::cppu::OInterfaceContainerHelper maChangeListeners;
+ UnoControlModelHolderList maModels;
+
+ AllGroups maGroups;
+ sal_Bool mbGroupsUpToDate;
+
+ bool m_bEnabled;
+ ::rtl::OUString m_sTitle;
+ ::rtl::OUString m_sImageURL;
+ ::rtl::OUString m_sTooltip;
+ sal_Int16 m_nTabPageId;
+
+ void Clone_Impl(ControlModelContainerBase& _rClone) const;
+
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName );
+
+public:
+ ControlModelContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ControlModelContainerBase( const ControlModelContainerBase& rModel );
+ ~ControlModelContainerBase();
+
+ UnoControlModel* Clone() const;
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAcces
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
+ void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XMultiServiceFactory
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTabControllerModel
+ virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChangesNotifier
+ virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED(ControlModelContainerBase, ControlModel_Base, "toolkit.ControlModelContainerBase" )
+
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+ void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+
+ void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
+
+ void implUpdateGroupStructure();
+};
+
+class ResourceListener :public ::com::sun::star::util::XModifyListener,
+ public ::cppu::OWeakObject,
+ public ::cppu::BaseMutex
+{
+ public:
+ ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener );
+ virtual ~ResourceListener();
+
+ void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource );
+ void stopListening();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
+ bool m_bListening;
+};
+
+typedef ::cppu::AggImplInheritanceHelper2 < UnoControlContainer
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XChangesListener
+ > ContainerControl_IBase;
+
+class ControlContainerBase : public ContainerControl_IBase
+{
+protected:
+ bool mbSizeModified;
+ bool mbPosModified;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
+
+ void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
+ void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
+ virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
+ void ImplUpdateResourceResolver();
+ void ImplStartListingForResourceEvents();
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
+
+ ControlContainerBase();
+
+public:
+ ControlContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ~ControlContainerBase();
+
+ DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" )
+
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainerListener
+ void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XChangesListener
+ virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+ virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+};
+#endif
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 6adec8eeae4f..17b958aeace9 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,241 +28,56 @@
#ifndef TOOLKIT_DIALOG_CONTROL_HXX
#define TOOLKIT_DIALOG_CONTROL_HXX
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-#include <com/sun/star/awt/XTabListener.hpp>
-#include <com/sun/star/awt/XSimpleTabController.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/awt/XDialog2.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
#include <com/sun/star/resource/XStringResourceResolver.hpp>
-#include <com/sun/star/graphic/XGraphicObject.hpp>
-#include <cppuhelper/implbase6.hxx>
-#include <cppuhelper/implbase5.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <toolkit/helper/listenermultiplexer.hxx>
-#include <toolkit/controls/unocontrolmodel.hxx>
#include "toolkit/helper/servicenames.hxx"
#include "toolkit/helper/macros.hxx"
#include <toolkit/controls/unocontrolcontainer.hxx>
-#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/basemutex.hxx>
#include <list>
-#include <map>
-#include <com/sun/star/graphic/XGraphicObject.hpp>
// ----------------------------------------------------
// class UnoControlDialogModel
// ----------------------------------------------------
-typedef UnoControlModel UnoControlDialogModel_Base;
-typedef ::cppu::ImplHelper6 < ::com::sun::star::lang::XMultiServiceFactory
- , ::com::sun::star::container::XContainer
- , ::com::sun::star::container::XNameContainer
- , ::com::sun::star::awt::XTabControllerModel
- , ::com::sun::star::util::XChangesNotifier
- , ::com::sun::star::beans::XPropertyChangeListener
- > UnoControlDialogModel_IBase;
-class UnoControlDialogModel : public UnoControlDialogModel_IBase
- , public UnoControlDialogModel_Base
+class UnoControlDialogModel : public ControlModelContainerBase
{
-public:
- enum ChildOperation { Insert = 0, Remove };
- // would like to make this typedef private, too, but the Forte 7 compiler does have
- // problems with this .....
- typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, ::rtl::OUString >
- UnoControlModelHolder;
protected:
- void updateUserFormChildren( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& xAllChildren, const rtl::OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
-
- // for grouping control models (XTabControllerModel::getGroupXXX)
- typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
- ModelGroup;
- typedef ::std::vector< ModelGroup > AllGroups;
-
- friend struct CloneControlModel;
- friend struct FindControlModel;
- friend struct CompareControlModel;
-
- ContainerListenerMultiplexer maContainerListeners;
- ::cppu::OInterfaceContainerHelper maChangeListeners;
- UnoControlModelHolderList maModels;
-
- AllGroups maGroups;
- sal_Bool mbGroupsUpToDate;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
- bool mbAdjustingGraphic;
-
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-
- UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName );
-
public:
- // bRegProps = false => subclass will register its own props
- UnoControlDialogModel( bool bRegProps = true );
+ UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlDialogModel( const UnoControlDialogModel& rModel );
~UnoControlDialogModel();
UnoControlModel* Clone() const;
-
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); }
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
-
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XContainer
- void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XElementAcces
- ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XIndexContainer, XIndexReplace, XIndexAcces
- // void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
- // sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException) = 0;
- // ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
- // void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
- // void SAL_CALL removeByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
-
- // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
- void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::beans::XMultiPropertySet
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::lang::XMultiServiceFactory
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
- // XComponent
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTabControllerModel
- virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
-
- // XPropertyChangeListener
- virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- using cppu::OPropertySetHelper::disposing;
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
-
// XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel,UnoControlDialogModel_Base, szServiceName2_UnoControlDialogModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
-protected:
- void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
- void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
- // ::cppu::OPropertySetHelper
- void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
-
- void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
-
- void implUpdateGroupStructure();
-private:
- void AddRadioButtonToGroup (
- const ::com::sun::star::uno::Reference< XControlModel >& rControlModel,
- const ::rtl::OUString& rPropertyName,
- ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups,
- ModelGroup*& rpCurrentGroup );
- void AddRadioButtonGroup (
- ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups );
};
-// ----------------------------------------------------
-// class UnoDialogControl
-// ----------------------------------------------------
-typedef ::cppu::ImplHelper6 < ::com::sun::star::container::XContainerListener
- , ::com::sun::star::awt::XTopWindow
- , ::com::sun::star::awt::XDialog2
- , ::com::sun::star::util::XChangesListener
- , ::com::sun::star::util::XModifyListener
- , ::com::sun::star::awt::XWindowListener
- > UnoDialogControl_IBase;
-
-class ResourceListener :public ::com::sun::star::util::XModifyListener,
- public ::cppu::OWeakObject,
- public ::cppu::BaseMutex
-{
- public:
- ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener );
- virtual ~ResourceListener();
-
- void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource );
- void stopListening();
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
-
- // XModifyListener
- virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
- bool m_bListening;
-};
-
-class UnoDialogControl :public UnoControlContainer
- ,public UnoDialogControl_IBase
+class UnoDialogControl :public ControlContainerBase,
+ public ::com::sun::star::awt::XTopWindow,
+ public ::com::sun::star::awt::XDialog,
+ public ::com::sun::star::awt::XWindowListener
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
TopWindowListenerMultiplexer maTopWindowListeners;
bool mbWindowListener;
- bool mbSizeModified;
- bool mbPosModified;
-
-protected:
-
- void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
- void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
- void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
- void ImplUpdateResourceResolver();
- void ImplStartListingForResourceEvents();
public:
- UnoDialogControl();
+ UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ~UnoDialogControl();
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); }
@@ -288,15 +102,6 @@ public:
virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::container::XContainerListener
- void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XDialog2
- virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
@@ -309,10 +114,6 @@ public:
// ::com::sun::star::awt::XControl
sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
-
- // XChangesListener
- virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
// XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
@@ -321,206 +122,10 @@ public:
DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
protected:
- virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+ // virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
-
-protected:
- virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
- virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
-};
-
-
-typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
- ::com::sun::star::util::XChangesListener >
- UnoParentControl_IBase;
-
-class UnoParentControl : public UnoControlContainer, public UnoParentControl_IBase
-{
-protected:
- bool mbSizeModified;
- bool mbPosModified;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
- void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
- void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
- virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
-
-public:
- UnoParentControl();
- ~UnoParentControl();
-
- DECLIMPL_SERVICEINFO_DERIVED( UnoParentControl, UnoControlBase, "com.sun.star.awt.UnoParentControl" )
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); }
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
-
- void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
-
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XContainerListener
- void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
- // XChangesListener
- virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XControl
- sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
-protected:
virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
- virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
- virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
-};
-
-class UnoMultiPageModel : public UnoControlDialogModel
-{
-public:
- UnoMultiPageModel();
- ~UnoMultiPageModel();
- UnoMultiPageModel( const UnoMultiPageModel& rModel );
-
- UnoControlModel* Clone() const;
-
- DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, UnoControlDialogModel, szServiceName_UnoMultiPageModel )
-
- virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
- // XNamedContainer
- void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- // Override the method of parent Class
- virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
protected:
- virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
- ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-
-};
-
-class UnoMultiPageControl : public UnoParentControl
- ,public ::com::sun::star::awt::XSimpleTabController
- ,public ::com::sun::star::awt::XTabListener
-{
- TabListenerMultiplexer maTabListeners;
- void bindPage( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
-public:
- UnoMultiPageControl();
- ~UnoMultiPageControl();
- ::rtl::OUString GetComponentServiceName();
-
- // ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, UnoParentControl, szServiceName_UnoMultiPageControl )
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoParentControl::queryInterface(rType); }
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
- // com::sun::star::awt::XSimpleTabController
- virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
- // XTabListener
- virtual void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
-protected:
- virtual void impl_createControlPeerIfNecessary(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl
- );
-
-};
-
-
-class UnoPageModel : public UnoControlDialogModel
-{
-public:
- UnoPageModel();
- ~UnoPageModel();
- UnoPageModel( const UnoPageModel& rModel );
-
- UnoControlModel* Clone() const;
-
- DECLIMPL_SERVICEINFO_DERIVED( UnoPageModel, UnoControlDialogModel, szServiceName_UnoPageModel )
-
- virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
-
- // Override the method of parent Class
- virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
-protected:
- virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
- ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-
-};
-
-class UnoPageControl : public UnoParentControl
-{
-public:
- UnoPageControl();
- ~UnoPageControl();
- ::rtl::OUString GetComponentServiceName();
-
-
- // ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoPageControl, UnoParentControl, szServiceName_UnoPageControl )
-};
-
-class UnoFrameModel : public UnoControlDialogModel
-{
-public:
- UnoFrameModel();
- ~UnoFrameModel();
- UnoFrameModel( const UnoFrameModel& rModel );
-
- UnoControlModel* Clone() const;
-
- DECLIMPL_SERVICEINFO_DERIVED( UnoFrameModel, UnoControlDialogModel, szServiceName_UnoFrameModel )
-
- virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
-
-protected:
- virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
- ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-};
-
-class UnoFrameControl : public UnoParentControl
-{
-protected:
- virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
-public:
- UnoFrameControl();
- ~UnoFrameControl();
- ::rtl::OUString GetComponentServiceName();
-
-// ::com::sun::star::lang::XServiceInfo
-DECLIMPL_SERVICEINFO_DERIVED( UnoFrameControl, UnoParentControl, szServiceName_UnoPageControl )
};
#endif // TOOLKIT_DIALOG_CONTROL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/toolkit/controls/formattedcontrol.hxx b/toolkit/inc/toolkit/controls/formattedcontrol.hxx
index 40ba795487cc..525e67dc6027 100644
--- a/toolkit/inc/toolkit/controls/formattedcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/formattedcontrol.hxx
@@ -68,8 +68,11 @@ namespace toolkit
) throw (::com::sun::star::uno::Exception);
public:
- UnoControlFormattedFieldModel();
- UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+ UnoControlFormattedFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
+ :UnoControlModel( rModel )
+ {
+ }
UnoControlModel* Clone() const { return new UnoControlFormattedFieldModel( *this ); }
@@ -111,7 +114,7 @@ namespace toolkit
class UnoFormattedFieldControl : public UnoSpinFieldControl
{
public:
- UnoFormattedFieldControl();
+ UnoFormattedFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::awt::XTextListener
diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
index fe57638c43ad..3bb3e0f3be49 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
@@ -186,7 +186,7 @@ FORWARD_DECLARE_INTERFACE( script, XNameContainer )
,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > >
{
public:
- OGeometryControlModel();
+ OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
private:
OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
index 725b6998ec01..7eb5d0966282 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
@@ -33,11 +33,17 @@
//====================================================================
//--------------------------------------------------------------------
template <class CONTROLMODEL>
-OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel()
- :OGeometryControlModel_Base(new CONTROLMODEL)
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :OGeometryControlModel_Base(new CONTROLMODEL( i_factory ) )
{
}
+//template <class CONTROLMODEL>
+//OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_xCompContext)
+// :OGeometryControlModel_Base(new CONTROLMODEL(i_xCompContext))
+//{
+//}
+//
//--------------------------------------------------------------------
template <class CONTROLMODEL>
OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance)
diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
index 3669e7b795ba..d570216fbccd 100644
--- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
@@ -46,37 +46,37 @@
#include <cppuhelper/implbase4.hxx>
-
#include <comphelper/uno3.hxx>
-typedef GraphicControlModel UnoControlRoadmapModel_Base;
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+ typedef GraphicControlModel UnoControlRoadmapModel_Base;
-typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
- , ::com::sun::star::container::XContainer
- , ::com::sun::star::container::XIndexContainer
- > UnoControlRoadmapModel_IBase;
+ typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XIndexContainer
+ > UnoControlRoadmapModel_IBase;
-typedef UnoControlBase UnoControlRoadmap_Base;
-typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster
- , ::com::sun::star::container::XContainerListener
- , ::com::sun::star::awt::XItemListener
- , ::com::sun::star::beans::XPropertyChangeListener
- > UnoControlRoadmap_IBase;
+ typedef UnoControlBase UnoControlRoadmap_Base;
+ typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::beans::XPropertyChangeListener
+ > UnoControlRoadmap_IBase;
-typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
- ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
+ typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
+ ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
-//........................................................................
-namespace toolkit{
-//........................................................................
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::lang;
@@ -111,7 +111,7 @@ namespace toolkit{
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlRoadmapModel();
+ UnoControlRoadmapModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) :
UnoControlRoadmapModel_Base( rModel ),
UnoControlRoadmapModel_IBase( rModel ),
@@ -168,7 +168,7 @@ namespace toolkit{
private:
ItemListenerMultiplexer maItemListeners;
public:
- UnoRoadmapControl();
+ UnoRoadmapControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
diff --git a/toolkit/inc/toolkit/controls/spinningprogress.hxx b/toolkit/inc/toolkit/controls/spinningprogress.hxx
new file mode 100755
index 000000000000..e0a676b2aa86
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/spinningprogress.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ * DO NOT ALTER 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 TOOLKIT_SPINNINGPROGRESS_HXX
+#define TOOLKIT_SPINNINGPROGRESS_HXX
+
+#include "toolkit/controls/animatedimages.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= SpinningProgressControlModel
+ //==================================================================================================================
+ typedef AnimatedImagesControlModel SpinningProgressControlModel_Base;
+ class SpinningProgressControlModel : public SpinningProgressControlModel_Base
+ {
+ public:
+ SpinningProgressControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
+ SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~SpinningProgressControlModel();
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_SPINNINGPROGRESS_HXX
diff --git a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
new file mode 100644
index 000000000000..c7a2e3b8ef90
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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 TOOLKIT_TABPAGE_CONTAINER_HXX
+#define TOOLKIT_TABPAGE_CONTAINER_HXX
+
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerModel.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/sequence.hxx>
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+using namespace ::com::sun::star::uno;
+//using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+// ------------------------------------------------------------------
+// class ::com::sun::star::awt::tab::UnoControlTabPageContainerModel
+// ------------------------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::tab::XTabPageContainerModel
+ > UnoControlTabPageContainerModel_Base;
+class UnoControlTabPageContainerModel : public UnoControlTabPageContainerModel_Base
+{
+private:
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > > m_aTabPageVector;
+ ContainerListenerMultiplexer maContainerListeners;
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+public:
+ UnoControlTabPageContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlTabPageContainerModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainerModel, UnoControlModel, szServiceName_UnoControlTabPageContainerModel )
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( sal_Int32 Index )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException);
+ //{
+ //return ::getCppuType((com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*)0);
+ //}
+
+ virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+};
+// ===================================================================
+// = UnoControlTabPageContainer
+// ===================================================================
+typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ > UnoControlTabPageContainer_Base;
+class UnoControlTabPageContainer : public UnoControlTabPageContainer_Base
+{
+public:
+ UnoControlTabPageContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ::rtl::OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addControl( const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainer, UnoControlBase, szServiceName_UnoControlTabPageContainer )
+
+// using UnoControl::getPeer;
+protected:
+ virtual void updateFromModel();
+private:
+ TabPageListenerMultiplexer m_aTabPageListeners;
+ sal_Int16 m_nActiveTabPageId;
+};
+
+#endif // _TOOLKIT_TABPAGE_CONTAINER_HXX
diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
new file mode 100644
index 000000000000..08938669fa58
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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 TOOLKIT_TABPAGE_MODEL_HXX
+#define TOOLKIT_TABPAGE_MODEL_HXX
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/macros.hxx"
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <list>
+#include <cppuhelper/implbase2.hxx>
+
+// ----------------------------------------------------
+// class TabPageModel
+// ----------------------------------------------------
+//typedef ::cppu::ImplHelper2< ::com::sun::star::awt::tab::XTabPageModel,
+// ::com::sun::star::lang::XInitialization
+// > TabPageAccess_BASE;
+//
+//class TabPageModel : public TabPageAccess_BASE
+//{
+//
+//private:
+// bool m_bEnabled;
+// ::rtl::OUString m_sTitle;
+// ::rtl::OUString m_sImageURL;
+// ::rtl::OUString m_sTooltip;
+// sal_Int16 m_nTabPageId;
+//
+//public:
+// TabPageModel();
+// explicit TabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCompContext);
+// ~TabPageModel();
+//
+// // XInitialization
+// virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+// throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+//
+// ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+// void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+// void SAL_CALL release() throw() { OWeakAggObject::release(); }
+//
+// // ::com::sun::star::lang::XTypeProvider
+// //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+// //::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+//
+// // ::com::sun::star::awt::tab::XTabPageModel
+// virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+// virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+// virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+// virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+// virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+//};
+// ----------------------------------------------------
+// class UnoControlTabPageModel
+// ----------------------------------------------------
+
+class UnoControlTabPageModel : public ControlModelContainerBase
+ //public TabPageModel
+{
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+public:
+ UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory);
+
+ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageModel, ControlModelContainerBase, szServiceName_UnoControlTabPageModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoTabPageControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper2 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPage
+ , ::com::sun::star::awt::XWindowListener
+ > UnoControlTabPage_Base;
+class UnoControlTabPage : public UnoControlTabPage_Base
+{
+private:
+ bool m_bWindowListener;
+public:
+
+ UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ~UnoControlTabPage();
+ ::rtl::OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO( UnoControlTabPage, szServiceName_UnoControlTabPage)
+};
+
+#endif // TOOLKIT_TABPAGE_MODEL_HXX
diff --git a/toolkit/inc/toolkit/controls/tkscrollbar.hxx b/toolkit/inc/toolkit/controls/tkscrollbar.hxx
index 3cd3427345b4..d51dceef32c2 100644
--- a/toolkit/inc/toolkit/controls/tkscrollbar.hxx
+++ b/toolkit/inc/toolkit/controls/tkscrollbar.hxx
@@ -51,7 +51,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlScrollBarModel();
+ UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlScrollBarModel( *this ); }
@@ -77,7 +77,7 @@ namespace toolkit
AdjustmentListenerMultiplexer maAdjustmentListeners;
public:
- UnoScrollBarControl();
+ UnoScrollBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
diff --git a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
index cddaffb01e6f..944d9cfcb1fe 100644
--- a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
+++ b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
@@ -52,7 +52,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoSimpleAnimationControlModel();
+ UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoSimpleAnimationControlModel( const UnoSimpleAnimationControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoSimpleAnimationControlModel( *this ); }
@@ -72,28 +72,18 @@ namespace toolkit
//= UnoSimpleAnimationControl
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleAnimation
- > UnoSimpleAnimationControl_Base;
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::XSimpleAnimation
+ > UnoSimpleAnimationControl_Base;
- class UnoSimpleAnimationControl :public UnoControlBase
- ,public UnoSimpleAnimationControl_Base
+ class UnoSimpleAnimationControl : public UnoSimpleAnimationControl_Base
{
private:
public:
- UnoSimpleAnimationControl();
+ UnoSimpleAnimationControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
- DECLARE_UNO3_AGG_DEFAULTS( UnoSimpleAnimationControl, UnoControlBase );
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XSimpleAnimation
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/tkspinbutton.hxx b/toolkit/inc/toolkit/controls/tkspinbutton.hxx
index 645540be002c..6be8c21e0d0d 100644
--- a/toolkit/inc/toolkit/controls/tkspinbutton.hxx
+++ b/toolkit/inc/toolkit/controls/tkspinbutton.hxx
@@ -52,7 +52,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoSpinButtonModel();
+ UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); }
@@ -83,7 +83,7 @@ namespace toolkit
AdjustmentListenerMultiplexer maAdjustmentListeners;
public:
- UnoSpinButtonControl();
+ UnoSpinButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase );
diff --git a/toolkit/inc/toolkit/controls/tkthrobber.hxx b/toolkit/inc/toolkit/controls/tkthrobber.hxx
index 9e9b25914bda..0add98c51b85 100644
--- a/toolkit/inc/toolkit/controls/tkthrobber.hxx
+++ b/toolkit/inc/toolkit/controls/tkthrobber.hxx
@@ -52,7 +52,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoThrobberControlModel();
+ UnoThrobberControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoThrobberControlModel( const UnoThrobberControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoThrobberControlModel( *this ); }
@@ -81,7 +81,7 @@ namespace toolkit
private:
public:
- UnoThrobberControl();
+ UnoThrobberControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
DECLARE_UNO3_AGG_DEFAULTS( UnoThrobberControl, UnoControlBase );
diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx
index 5b2f9a894b94..d7d141148771 100644
--- a/toolkit/inc/toolkit/controls/unocontrol.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrol.hxx
@@ -48,6 +48,7 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase9.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
@@ -94,6 +95,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > mxVclWindowPeer; // just to avoid the query_interface thing
protected:
+ const ::comphelper::ComponentContext maContext;
EventListenerMultiplexer maDisposeListeners;
WindowListenerMultiplexer maWindowListeners;
FocusListenerMultiplexer maFocusListeners;
@@ -143,8 +145,11 @@ protected:
virtual sal_Bool requiresNewPeer( const ::rtl::OUString& _rPropertyName ) const;
-public:
+protected:
UnoControl();
+
+public:
+ UnoControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~UnoControl();
UnoControlComponentInfos& GetComponentInfos() { return maComponentInfos; }
diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
index 2d21f3f82c84..aa2036935344 100644
--- a/toolkit/inc/toolkit/controls/unocontrolbase.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
@@ -40,6 +40,14 @@
class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl
{
protected:
+ UnoControlBase();
+
+protected:
+ UnoControlBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControl( i_factory )
+ {
+ }
+
sal_Bool ImplHasProperty( sal_uInt16 nProp );
sal_Bool ImplHasProperty( const ::rtl::OUString& aPropertyName );
void ImplSetPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Bool bUpdateThis );
diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
index d2b225d23411..e29fab5b8350 100644
--- a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
@@ -65,8 +65,9 @@ protected:
void ImplActivateTabControllers();
public:
- UnoControlContainer();
- UnoControlContainer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer );
+ UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer );
~UnoControlContainer();
diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
index 21a338a0f2a7..8d4d97836989 100644
--- a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
@@ -46,7 +46,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlContainerModel();
+ UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlContainerModel( *this ); }
diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
index e46780b3b052..7aba0ec710ee 100644
--- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
@@ -45,6 +45,9 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/implbase7.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/uno3.hxx>
#include <list>
@@ -54,21 +57,25 @@ class ImplPropertyTable;
// class UnoControlModel
// ----------------------------------------------------
-class TOOLKIT_DLLPUBLIC UnoControlModel : public ::com::sun::star::awt::XControlModel,
- public ::com::sun::star::beans::XPropertyState,
- public ::com::sun::star::io::XPersistObject,
- public ::com::sun::star::lang::XComponent,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::lang::XTypeProvider,
- public ::com::sun::star::lang::XUnoTunnel,
- public ::com::sun::star::util::XCloneable,
- public MutexAndBroadcastHelper,
- public ::cppu::OPropertySetHelper,
- public ::cppu::OWeakAggObject
+typedef ::cppu::WeakAggImplHelper7 < ::com::sun::star::awt::XControlModel
+ , ::com::sun::star::beans::XPropertyState
+ , ::com::sun::star::io::XPersistObject
+ , ::com::sun::star::lang::XComponent
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel
+ , ::com::sun::star::util::XCloneable
+ > UnoControlModel_Base;
+
+class TOOLKIT_DLLPUBLIC UnoControlModel :public UnoControlModel_Base
+ ,public MutexAndBroadcastHelper
+ ,public ::cppu::OPropertySetHelper
{
private:
- ImplPropertyTable* mpData;
- EventListenerMultiplexer maDisposeListeners;
+ ImplPropertyTable* mpData;
+ EventListenerMultiplexer maDisposeListeners;
+
+protected:
+ const ::comphelper::ComponentContext maContext;
protected:
void ImplRegisterProperty( sal_uInt16 nPropType );
@@ -100,18 +107,21 @@ protected:
sal_Int32 _nSecondHandle /// second handle, which should supersede _nFirstHandle in the sequence
) const;
-public:
+protected:
UnoControlModel();
+public:
+ UnoControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlModel( const UnoControlModel& rModel );
~UnoControlModel();
virtual UnoControlModel* Clone() const = 0;
- // ::com::sun::star::uno::XAggregation
+ // ::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) { return OWeakAggObject::queryInterface(rType); }
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
+ void SAL_CALL acquire() throw();
+ void SAL_CALL release() throw();
+ // ::com::sun::star::uno::XAggregation
::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XUnoTunnel
@@ -123,10 +133,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XControlModel
+ DECLARE_XTYPEPROVIDER()
// ::com::sun::star::lang::XComponent
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx
index 531467f359be..201858da0a12 100644
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -72,17 +72,6 @@
#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
#define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:"
-class ImageHelper
-{
-public:
- // The routine will always attempt to return a valid XGraphic for the passed _rURL
- // additionallly xOutGraphicObject will container the associated XGraphicObject ( if url
- // is valid for that )
- // and is set appropriately ( e.g. NULL if non GraphicObject scheme ) or valid object
- // if the rURL points to a valid object
- static ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject >& xOutGraphicObject, const ::rtl::OUString& _rURL );
-};
-
// ----------------------------------------------------
// class UnoControlEditModel
// ----------------------------------------------------
@@ -93,7 +82,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlEditModel();
+ UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); }
@@ -127,7 +116,7 @@ private:
// They only support XTextComponent, so keep the text
// here, maybe there is no Peer when calling setText()...
::rtl::OUString maText;
- USHORT mnMaxTextLen;
+ sal_uInt16 mnMaxTextLen;
sal_Bool mbSetTextInPeer;
sal_Bool mbSetMaxTextLenInPeer;
@@ -135,7 +124,7 @@ private:
public:
- UnoEditControl();
+ UnoEditControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
TextListenerMultiplexer& GetTextListeners() { return maTextListeners; }
@@ -196,7 +185,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFileControlModel();
+ UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); }
@@ -217,7 +206,7 @@ public:
class UnoFileControl : public UnoEditControl
{
public:
- UnoFileControl();
+ UnoFileControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XServiceInfo
@@ -234,9 +223,15 @@ private:
bool mbAdjustingGraphic;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
protected:
- GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
+ GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
+ ,mbAdjustingImagePosition( false )
+ ,mbAdjustingGraphic( false )
+ {
+ }
GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
// ::cppu::OPropertySetHelper
@@ -252,14 +247,14 @@ private:
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
-class UnoControlButtonModel : public GraphicControlModel
+class UnoControlButtonModel : public GraphicControlModel
{
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlButtonModel();
+ UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); }
@@ -292,7 +287,7 @@ private:
public:
- UnoButtonControl();
+ UnoButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
@@ -337,7 +332,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlImageControlModel();
+ UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); }
@@ -369,7 +364,7 @@ private:
public:
- UnoImageControlControl();
+ UnoImageControlControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
@@ -397,7 +392,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlRadioButtonModel();
+ UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); }
@@ -431,7 +426,7 @@ private:
public:
- UnoRadioButtonControl();
+ UnoRadioButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
@@ -476,7 +471,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlCheckBoxModel();
+ UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); }
@@ -509,7 +504,7 @@ private:
public:
- UnoCheckBoxControl();
+ UnoCheckBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~UnoCheckBoxControl(){;}
::rtl::OUString GetComponentServiceName();
@@ -557,7 +552,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedHyperlinkModel();
+ UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); }
@@ -583,7 +578,7 @@ private:
ActionListenerMultiplexer maActionListeners;
public:
- UnoFixedHyperlinkControl();
+ UnoFixedHyperlinkControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
@@ -631,7 +626,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedTextModel();
+ UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); }
@@ -655,7 +650,7 @@ class UnoFixedTextControl : public UnoControlBase,
public ::com::sun::star::awt::XLayoutConstrains
{
public:
- UnoFixedTextControl();
+ UnoFixedTextControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
@@ -696,7 +691,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlGroupBoxModel();
+ UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); }
@@ -718,7 +713,7 @@ public:
class UnoGroupBoxControl : public UnoControlBase
{
public:
- UnoGroupBoxControl();
+ UnoGroupBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
@@ -735,12 +730,20 @@ struct UnoControlListBoxModel_Data;
typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
, ::com::sun::star::awt::XItemList
> UnoControlListBoxModel_Base;
-class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base
+class TOOLKIT_DLLPUBLIC UnoControlListBoxModel : public UnoControlListBoxModel_Base
{
protected:
- UnoControlListBoxModel(bool asComboBox);
+ enum ConstructorMode
+ {
+ ConstructDefault,
+ ConstructWithoutProperties
+ };
+
public:
- UnoControlListBoxModel();
+ UnoControlListBoxModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory,
+ ConstructorMode const i_mode = ConstructDefault
+ );
UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
~UnoControlListBoxModel();
@@ -838,7 +841,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
{
public:
- UnoListBoxControl();
+ UnoListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
@@ -918,7 +921,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlComboBoxModel();
+ UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); }
@@ -952,7 +955,7 @@ private:
public:
- UnoComboBoxControl();
+ UnoComboBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
@@ -1016,10 +1019,10 @@ class UnoSpinFieldControl : public UnoEditControl,
{
private:
SpinListenerMultiplexer maSpinListeners;
- BOOL mbRepeat;
+ sal_Bool mbRepeat;
public:
- UnoSpinFieldControl();
+ UnoSpinFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
@@ -1057,7 +1060,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlDateFieldModel();
+ UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); }
@@ -1084,7 +1087,7 @@ private:
sal_Int32 mnLast;
sal_Bool mbLongFormat;
public:
- UnoDateFieldControl();
+ UnoDateFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
@@ -1133,7 +1136,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlTimeFieldModel();
+ UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); }
@@ -1160,7 +1163,7 @@ private:
sal_Int32 mnLast;
public:
- UnoTimeFieldControl();
+ UnoTimeFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
@@ -1208,7 +1211,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlNumericFieldModel();
+ UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); }
@@ -1235,7 +1238,7 @@ private:
double mnLast;
public:
- UnoNumericFieldControl();
+ UnoNumericFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
@@ -1285,7 +1288,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlCurrencyFieldModel();
+ UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); }
@@ -1312,7 +1315,7 @@ private:
double mnLast;
public:
- UnoCurrencyFieldControl();
+ UnoCurrencyFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
@@ -1361,7 +1364,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlPatternFieldModel();
+ UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); }
@@ -1387,7 +1390,7 @@ protected:
void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
public:
- UnoPatternFieldControl();
+ UnoPatternFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); }
@@ -1422,7 +1425,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlProgressBarModel();
+ UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); }
@@ -1444,7 +1447,7 @@ class UnoProgressBarControl : public UnoControlBase,
public ::com::sun::star::awt::XProgressBar
{
public:
- UnoProgressBarControl();
+ UnoProgressBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); }
@@ -1478,7 +1481,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedLineModel();
+ UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); }
@@ -1500,7 +1503,7 @@ public:
class UnoFixedLineControl : public UnoControlBase
{
public:
- UnoFixedLineControl();
+ UnoFixedLineControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
@@ -1511,6 +1514,7 @@ public:
};
+
#endif // _TOOLKIT_HELPER_UNOCONTROLS_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
index ac38197bc5f1..46de6c4ad8d5 100644
--- a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
+++ b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
@@ -57,6 +57,7 @@
#include <toolkit/helper/mutexhelper.hxx>
#include <toolkit/helper/macros.hxx>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
// ----------------------------------------------------
// class ListenerMultiplexerBase
// ----------------------------------------------------
@@ -264,6 +265,13 @@ DECL_LISTENERMULTIPLEXER_START_DLLPUB( SelectionListenerMultiplexer, ::com::sun:
void SAL_CALL selectionChanged( const ::com::sun::star::awt::grid::GridSelectionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
DECL_LISTENERMULTIPLEXER_END
+// ----------------------------------------------------
+// class TabPageListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
+ void SAL_CALL tabPageActivated( const ::com::sun::star::awt::tab::TabPageActivatedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
#endif // _TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
index f9d5eec31a2b..4bc4d4d59825 100644
--- a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
+++ b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
@@ -40,19 +40,13 @@ class MutexAndBroadcastHelper
public:
MutexAndBroadcastHelper() : BrdcstHelper( Mutex ) {}
-
::osl::Mutex Mutex;
::cppu::OBroadcastHelper BrdcstHelper;
::osl::Mutex& GetMutex() { return Mutex; }
-
+ ::cppu::OBroadcastHelper& GetBroadcastHelper() { return BrdcstHelper; }
};
-
-
-
-
-
#endif // _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index 9b077cab2709..dd4bdd1f7d40 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -178,7 +178,7 @@ namespace rtl {
#define BASEPROPERTY_TREE_ROOTDISPLAYED 127
#define BASEPROPERTY_TREE_SHOWSHANDLES 128
#define BASEPROPERTY_TREE_SHOWSROOTHANDLES 129
-#define BASEPROPERTY_TREE_ROWHEIGHT 130
+#define BASEPROPERTY_ROW_HEIGHT 130
#define BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING 131
#define BASEPROPERTY_TREE_END 131
#define BASEPROPERTY_DIALOGSOURCEURL 132
@@ -198,15 +198,19 @@ namespace rtl {
#define BASEPROPERTY_REFERENCE_DEVICE 146
#define BASEPROPERTY_HIGHCONTRASTMODE 147
-#define BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND 148
-#define BASEPROPERTY_GRID_HEADER_BACKGROUND 149
-#define BASEPROPERTY_GRID_LINE_COLOR 150
-#define BASEPROPERTY_GRID_ROW_BACKGROUND 151
+#define BASEPROPERTY_GRID_HEADER_BACKGROUND 148
+#define BASEPROPERTY_GRID_HEADER_TEXT_COLOR 149
+#define BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS 150
+#define BASEPROPERTY_GRID_LINE_COLOR 151
#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152
#define BASEPROPERTY_ITEM_SEPARATOR_POS 153
#define BASEPROPERTY_GROUPNAME 154 // ::rtl::OUString
#define BASEPROPERTY_MULTIPAGEVALUE 155 // sal_Int32
#define BASEPROPERTY_USERFORMCONTAINEES 156 // css::container::XNameContainer
+#define BASEPROPERTY_AUTO_REPEAT 157
+#define BASEPROPERTY_ROW_HEADER_WIDTH 158
+#define BASEPROPERTY_COLUMN_HEADER_HEIGHT 159
+#define BASEPROPERTY_USE_GRID_LINES 160
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx
index 0a98bdf4bb25..d784f5950328 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -104,13 +104,24 @@ extern const sal_Char szServiceName_GridControlModel[];
extern const sal_Char szServiceName_DefaultGridDataModel[];
extern const sal_Char szServiceName_DefaultGridColumnModel[];
extern const sal_Char szServiceName_GridColumn[];
+extern const sal_Char szServiceName_SortableGridDataModel[];
extern const sal_Char szServiceName_UnoSimpleAnimationControl[], szServiceName2_UnoSimpleAnimationControl[];
extern const sal_Char szServiceName_UnoSimpleAnimationControlModel[], szServiceName2_UnoSimpleAnimationControlModel[];
extern const sal_Char szServiceName_UnoThrobberControl[], szServiceName2_UnoThrobberControl[];
extern const sal_Char szServiceName_UnoThrobberControlModel[], szServiceName2_UnoThrobberControlModel[];
+extern const sal_Char szServiceName_AnimatedImagesControl[];
+extern const sal_Char szServiceName_AnimatedImagesControlModel[];
+extern const sal_Char szServiceName_SpinningProgressControlModel[];
extern const sal_Char szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[];
+extern const sal_Char szServiceName_UnoControlTabPageModel[], szServiceName2_UnoControlTabPageModel[];
+extern const sal_Char szServiceName_UnoControlTabPage[];
+extern const sal_Char szServiceName_UnoControlTabPageContainerModel[];
+extern const sal_Char szServiceName_UnoControlTabPageContainer[];
+
+// ExtUnoWrapper:
+extern const char szServiceName_ImageProducer[], szServiceName2_ImageProducer[];
#endif // _TOOLKIT_HELPER_SERVICENAMES_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/toolkit/helper/throbberimpl.hxx b/toolkit/inc/toolkit/helper/throbberimpl.hxx
deleted file mode 100644
index b2c7a5771f78..000000000000
--- a/toolkit/inc/toolkit/helper/throbberimpl.hxx
+++ /dev/null
@@ -1,87 +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 _TOOLKIT_HELPER_THROBBERIMPL_HXX_
-#define _TOOLKIT_HELPER_THROBBERIMPL_HXX_
-
-#include <toolkit/awt/vclxwindow.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <vcl/timer.hxx>
-#include <osl/mutex.hxx>
-
-//........................................................................
-namespace toolkit
-//........................................................................
-{
-#define CSS_UNO ::com::sun::star::uno
-#define CSS_GRAPHIC ::com::sun::star::graphic
-
- class Throbber_Impl
- {
- private:
- CSS_UNO::Sequence< CSS_UNO::Reference< CSS_GRAPHIC::XGraphic > > maImageList;
- CSS_UNO::Reference< VCLXWindow > mxParent;
-
- sal_Bool mbRepeat;
- sal_Int32 mnStepTime;
- sal_Int32 mnCurStep;
- sal_Int32 mnStepCount;
- AutoTimer maWaitTimer;
-
- DECL_LINK( TimeOutHdl, Throbber_Impl* );
-
- public:
- Throbber_Impl( CSS_UNO::Reference< VCLXWindow > xParent,
- sal_Int32 nStepTime,
- sal_Bool bRepeat );
- ~Throbber_Impl();
-
- // Properties
- void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
- void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
-
- // XSimpleAnimation
- void start() throw ( CSS_UNO::RuntimeException );
- void stop() throw ( CSS_UNO::RuntimeException );
- void setImageList( const CSS_UNO::Sequence< CSS_UNO::Reference< CSS_GRAPHIC::XGraphic > >& ImageList )
- throw ( CSS_UNO::RuntimeException );
- // Helpers
- void initImage() throw ( CSS_UNO::RuntimeException );
- };
-//........................................................................
-#undef CSS_UNO
-#undef CSS_GRAPHIC
-
-} // namespacetoolkit
-//........................................................................
-
-#endif //_TOOLKIT_HELPER_THROBBERIMPL_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/toolkit/helper/tkresmgr.hxx b/toolkit/inc/toolkit/helper/tkresmgr.hxx
index 9d04fab909b4..17c65919bdc0 100644
--- a/toolkit/inc/toolkit/helper/tkresmgr.hxx
+++ b/toolkit/inc/toolkit/helper/tkresmgr.hxx
@@ -71,6 +71,7 @@ public:
// loads the image with the specified resource id
static Image loadImage( sal_uInt16 nResId );
+ static Image getImageFromURL( const ::rtl::OUString& i_rImageURL );
};
diff --git a/toolkit/inc/toolkit/helper/unowrapper.hxx b/toolkit/inc/toolkit/helper/unowrapper.hxx
index 75bb4b6dcab9..0518768bf952 100644
--- a/toolkit/inc/toolkit/helper/unowrapper.hxx
+++ b/toolkit/inc/toolkit/helper/unowrapper.hxx
@@ -67,11 +67,11 @@ public:
void WindowDestroyed( Window* pWindow );
void WindowEvent_Move( Window* pWindow );
void WindowEvent_Resize( Window* pWindow );
- void WindowEvent_Show( Window* pWindow, BOOL bShow );
+ void WindowEvent_Show( Window* pWindow, sal_Bool bShow );
void WindowEvent_Close( Window* pWindow );
void WindowEvent_Minimize( Window* pWindow );
void WindowEvent_Normalize( Window* pWindow );
- void WindowEvent_Activate( Window* pWindow, BOOL bActivated );
+ void WindowEvent_Activate( Window* pWindow, sal_Bool bActivated );
void WindowEvent_MouseButtonUp( Window* pWindow, const MouseEvent& rEvt );
void WindowEvent_MouseButtonDown( Window* pWindow, const MouseEvent& rEvt );
void WindowEvent_MouseMove( Window* pWindow, const MouseEvent& rEvt );
diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx
index fafff3fc07dc..ba8844eb277c 100644
--- a/toolkit/inc/toolkit/helper/vclunohelper.hxx
+++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx
@@ -65,8 +65,8 @@ namespace com { namespace sun { namespace star { namespace awt {
#include <vcl/bitmapex.hxx>
#include <vcl/region.hxx>
#include <vcl/metric.hxx>
-#include <vcl/mapunit.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/mapunit.hxx>
+#include <tools/fldunit.hxx>
#include <tools/poly.hxx>
class Window;
diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst
index 126eea24c66c..e11d32c435bf 100644
--- a/toolkit/prj/build.lst
+++ b/toolkit/prj/build.lst
@@ -1,14 +1,3 @@
-ti toolkit : vcl NULL
-ti toolkit usr1 - all ti_mkout NULL
-ti toolkit\prj get - all ti_prj NULL
-ti toolkit\inc nmake - all ti_inc NULL
-ti toolkit\uiconfig\layout nmake - all ti_uiconfig_layout NULL
-ti toolkit\source\helper nmake - all ti_helper ti_inc NULL
-ti toolkit\source\awt nmake - all ti_awt ti_inc NULL
-ti toolkit\source\controls nmake - all ti_controls ti_inc NULL
-ti toolkit\source\controls\tree nmake - all ti_tree NULL
-ti toolkit\source\controls\grid nmake - all ti_grid NULL
-ti toolkit\source\layout\core nmake - all ti_layout_core NULL
-ti toolkit\source\layout\vcl nmake - all ti_layout_vcl NULL
-ti toolkit\util nmake - all ti_util ti_awt ti_controls ti_layout_core ti_helper ti_tree ti_grid ti_layout_vcl NULL
-ti toolkit\qa\unoapi nmake - all ti_qa_unoapi NULL
+ti toolkit : LIBXSLT:libxslt vcl qadevOOo test NULL
+ti toolkit\prj nmake - all ti_prj NULL
+ti toolkit\qa\complex\toolkit nmake - all ti_complex_toolkit NULL
diff --git a/toolkit/prj/d.lst b/toolkit/prj/d.lst
index 375485c96e4d..e69de29bb2d1 100644
--- a/toolkit/prj/d.lst
+++ b/toolkit/prj/d.lst
@@ -1,65 +0,0 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-mkdir: %_DEST%\inc%_EXT%\toolkit
-mkdir: %_DEST%\inc%_EXT%\toolkit\helper
-mkdir: %_DEST%\inc%_EXT%\toolkit\awt
-mkdir: %_DEST%\inc%_EXT%\toolkit\controls
-
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\lib\itk.lib %_DEST%\lib%_EXT%\itk.lib
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
-..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl
-..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\bin\tk*.res %_DEST%\bin%_EXT%\tk*res
-..\%__SRC%\bin\tk?????.sym %_DEST%\bin%_EXT%\tk?????.sym
-..\%__SRC%\bin\tk?????.dll %_DEST%\bin%_EXT%\tk?????.dll
-..\%__SRC%\misc\tk?????.map %_DEST%\bin%_EXT%\tk?????.map
-
-..\util\toolkit.xml %_DEST%\xml%_EXT%\toolkit.xml
-
-..\inc\toolkit\awt\vclxaccessiblecomponent.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxaccessiblecomponent.hxx
-..\inc\toolkit\awt\vclxcontainer.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxcontainer.hxx
-..\inc\toolkit\awt\vclxdevice.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxdevice.hxx
-..\inc\toolkit\awt\vclxfont.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxfont.hxx
-..\inc\toolkit\awt\vclxtopwindow.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxtopwindow.hxx
-..\inc\toolkit\awt\vclxtoolkit.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxtoolkit.hxx
-..\inc\toolkit\awt\vclxwindow.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxwindow.hxx
-..\inc\toolkit\awt\vclxsystemdependentwindow.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxsystemdependentwindow.hxx
-..\source\awt\vclxdialog.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxdialog.hxx
-..\inc\toolkit\awt\vclxwindows.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxwindows.hxx
-..\inc\toolkit\awt\vclxmenu.hxx %_DEST%\inc%_EXT%\toolkit\awt\vclxmenu.hxx
-
-..\inc\toolkit\controls\unocontrol.hxx %_DEST%\inc%_EXT%\toolkit\controls\unocontrol.hxx
-..\inc\toolkit\controls\unocontrols.hxx %_DEST%\inc%_EXT%\toolkit\controls\unocontrols.hxx
-..\inc\toolkit\controls\unocontrolmodel.hxx %_DEST%\inc%_EXT%\toolkit\controls\unocontrolmodel.hxx
-..\inc\toolkit\controls\unocontrolbase.hxx %_DEST%\inc%_EXT%\toolkit\controls\unocontrolbase.hxx
-..\inc\toolkit\helper\servicenames.hxx %_DEST%\inc%_EXT%\toolkit\helper\servicenames.hxx
-
-..\inc\toolkit\helper\emptyfontdescriptor.hxx %_DEST%\inc%_EXT%\toolkit\helper\emptyfontdescriptor.hxx
-..\inc\toolkit\helper\vclunohelper.hxx %_DEST%\inc%_EXT%\toolkit\helper\vclunohelper.hxx
-..\inc\toolkit\helper\convert.hxx %_DEST%\inc%_EXT%\toolkit\helper\convert.hxx
-..\inc\toolkit\helper\property.hxx %_DEST%\inc%_EXT%\toolkit\helper\property.hxx
-..\inc\toolkit\helper\macros.hxx %_DEST%\inc%_EXT%\toolkit\helper\macros.hxx
-..\inc\toolkit\helper\mutexhelper.hxx %_DEST%\inc%_EXT%\toolkit\helper\mutexhelper.hxx
-..\inc\toolkit\helper\mutexandbroadcasthelper.hxx %_DEST%\inc%_EXT%\toolkit\helper\mutexandbroadcasthelper.hxx
-..\inc\toolkit\helper\listenermultiplexer.hxx %_DEST%\inc%_EXT%\toolkit\helper\listenermultiplexer.hxx
-..\inc\toolkit\helper\unowrapper.hxx %_DEST%\inc%_EXT%\toolkit\helper\unowrapper.hxx
-..\inc\toolkit\helper\externallock.hxx %_DEST%\inc%_EXT%\toolkit\helper\externallock.hxx
-..\inc\toolkit\helper\formpdfexport.hxx %_DEST%\inc%_EXT%\toolkit\helper/formpdfexport.hxx
-..\inc\toolkit\helper\accessiblefactory.hxx %_DEST%\inc%_EXT%\toolkit\helper\accessiblefactory.hxx
-..\inc\toolkit\helper\fixedhyperbase.hxx %_DEST%\inc%_EXT%\toolkit\helper\fixedhyperbase.hxx
-..\inc\toolkit\helper\unopropertyarrayhelper.hxx %_DEST%\inc%_EXT%\toolkit\helper\unopropertyarrayhelper.hxx
-
-..\inc\toolkit\helper\vclunohelper.hxx %_DEST%\inc%_EXT%\toolkit\unohlp.hxx
-..\inc\toolkit\dllapi.h %_DEST%\inc%_EXT%\toolkit\dllapi.h
-
-mkdir: %_DEST%\inc%_EXT%\layout
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-
-..\inc\layout\*.hxx %_DEST%\inc%_EXT%\layout\*.hxx
-mkdir: %_DEST%\inc%_EXT%\layout\core
-..\source\layout\core\*.hxx %_DEST%\inc%_EXT%\layout\core\*.hxx
-mkdir: %_DEST%\inc%_EXT%\layout\vcl
-..\source\layout\vcl\*.hxx %_DEST%\inc%_EXT%\layout\vcl\*.hxx
-
-..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.*
diff --git a/toolkit/prj/makefile.mk b/toolkit/prj/makefile.mk
new file mode 100644
index 000000000000..e312a7ccab65
--- /dev/null
+++ b/toolkit/prj/makefile.mk
@@ -0,0 +1,40 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..
+TARGET=prj
+
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java
new file mode 100755
index 000000000000..d4f2329d8f31
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java
@@ -0,0 +1,338 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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.toolkit;
+
+import complex.toolkit.accessibility._XAccessibleEventBroadcaster;
+import complex.toolkit.accessibility._XAccessibleExtendedComponent;
+import complex.toolkit.accessibility._XAccessibleComponent;
+import complex.toolkit.accessibility._XAccessibleContext;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCloseable;
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class AccessibleStatusBar {
+
+ XInterface testObject = null;
+ XMultiServiceFactory xMSF = null;
+ XWindow xWindow = null;
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+ /**
+ * Check document types
+ */
+ @Test
+ public void checkDocs() {
+ checkWriterDoc();
+ checkMathDoc();
+ checkDrawDoc();
+ checkImpressDoc();
+ checkCalcDoc();
+ }
+
+ /**
+ * Test the interfaces on a writer document
+ */
+ public void checkWriterDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XTextDocument xTextDoc = null;
+ try {
+ System.out.println("****** Open a new writer document");
+ xTextDoc = xSOF.createTextDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xTextDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on a math document
+ */
+ public void checkMathDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xMathDoc = null;
+ try {
+ System.out.println("****** Open a new math document");
+ xMathDoc = xSOF.createMathDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xMathDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on a draw document
+ */
+ public void checkDrawDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xDrawDoc = null;
+ try {
+ System.out.println("****** Open a new draw document");
+ xDrawDoc = xSOF.createDrawDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xDrawDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on an impress document
+ */
+ public void checkImpressDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xImpressDoc = null;
+ try {
+ System.out.println("****** Open a new impress document");
+ xImpressDoc = xSOF.createImpressDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xImpressDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+ /**
+ * Test the interfaces on an calc document
+ */
+ public void checkCalcDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+ try {
+ System.out.println("****** Open a new calc document");
+ xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
+ shortWait();
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xSpreadsheetDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ public void getTestObject() {
+ try {
+ XInterface xIfc = (XInterface) xMSF.createInstance(
+ "com.sun.star.awt.Toolkit") ;
+ XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xIfc);
+
+ shortWait();
+ xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
+
+ shortWait();
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+ XAccessibleContext parentContext = null;
+
+ System.out.println("Get the accessible status bar.");
+ parentContext = AccessibilityTools.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.STATUS_BAR, "");
+ shortWait();
+ System.out.println("...OK.");
+
+ XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, parentContext);
+ String[] services = xSI.getSupportedServiceNames();
+ System.out.println("*****");
+ System.out.println("* Implementation Name: " + xSI.getImplementationName());
+ for (int i=0; i<services.length; i++)
+ {
+ System.out.println("* ServiceName " + i + ": " + services[i]);
+ }
+ System.out.println("*****");
+ testObject=parentContext;
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ catch(Throwable t) {
+ System.out.println("Got throwable:");
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", t );
+ }
+ }
+
+ public void runAllInterfaceTests() {
+ System.out.println("*** Now testing XAccessibleComponent ***");
+ _XAccessibleComponent _xAccCompTest =
+ new _XAccessibleComponent(testObject);
+ assertTrue("failed: XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
+ assertTrue("failed: XAccessibleComponent::contains", _xAccCompTest._containsPoint());
+ assertTrue("failed: XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
+ assertTrue("failed: XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
+ assertTrue("failed: XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
+ assertTrue("failed: XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
+ assertTrue("failed: XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
+ assertTrue("failed: XAccessibleComponent::getSize", _xAccCompTest._getSize());
+ assertTrue("failed: XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
+
+ System.out.println("*** Now testing XAccessibleContext ***");
+ _XAccessibleContext _xAccContext =
+ new _XAccessibleContext(testObject);
+ assertTrue("failed: XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
+ assertTrue("failed: XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
+ assertTrue("failed: XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
+ assertTrue("failed: XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
+ assertTrue("failed: XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
+ assertTrue("failed: XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
+ assertTrue("failed: XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
+ assertTrue("failed: XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
+ assertTrue("failed: XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
+ assertTrue("failed: XAccessibleContext::getLocale", _xAccContext._getLocale());
+
+ System.out.println("*** Now testing XAccessibleExtendedComponent ***");
+ _XAccessibleExtendedComponent _xAccExtComp =
+ new _XAccessibleExtendedComponent(testObject);
+ assertTrue("failed: XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
+ assertTrue("failed: XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
+ assertTrue("failed: XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
+
+ System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
+ _XAccessibleEventBroadcaster _xAccEvBcast =
+ new _XAccessibleEventBroadcaster(testObject, xWindow);
+ assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
+ assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
+ }
+
+
+
+
+ @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/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java
new file mode 100755
index 000000000000..edd84651d45e
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java
@@ -0,0 +1,381 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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.toolkit;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+import complex.toolkit.accessibility._XAccessibleEventBroadcaster;
+import complex.toolkit.accessibility._XAccessibleExtendedComponent;
+import complex.toolkit.accessibility._XAccessibleText;
+import complex.toolkit.accessibility._XAccessibleComponent;
+import complex.toolkit.accessibility._XAccessibleContext;
+import util.SOfficeFactory;
+import util.AccessibilityTools;
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCloseable;
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.awt.XExtendedToolkit;
+
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class AccessibleStatusBarItem {
+
+ XMultiServiceFactory xMSF = null;
+ XAccessibleContext testObject = null;
+ XWindow xWindow = null;
+
+ /**
+ * Sleeps for a certain time.
+ * @param Thread is sleeping for this time in milliseconds.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+ }
+
+ /**
+ * Check document types
+ */
+ @Test
+ public void checkDocs()
+ {
+ checkWriterDoc();
+ checkMathDoc();
+ checkDrawDoc();
+ checkImpressDoc();
+ checkCalcDoc();
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ /**
+ * Test the interfaces on a writer document
+ */
+ private void checkWriterDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XTextDocument xTextDoc = null;
+ try {
+ System.out.println("****** Open a new writer document");
+ xTextDoc = xSOF.createTextDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xTextDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on a math document
+ */
+ public void checkMathDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xMathDoc = null;
+ try {
+ System.out.println("****** Open a new math document");
+ xMathDoc = xSOF.createMathDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xMathDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on a draw document
+ */
+ public void checkDrawDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xDrawDoc = null;
+ try {
+ System.out.println("****** Open a new draw document");
+ xDrawDoc = xSOF.createDrawDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xDrawDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ /**
+ * Test the interfaces on an impress document
+ */
+ public void checkImpressDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XComponent xImpressDoc = null;
+ try {
+ System.out.println("****** Open a new impress document");
+ xImpressDoc = xSOF.createImpressDoc("_blank");
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xImpressDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+ /**
+ * Test the interfaces on an calc document
+ */
+ public void checkCalcDoc() {
+ xMSF = getMSF();
+ SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+ try {
+ System.out.println("****** Open a new calc document");
+ xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
+ shortWait();
+ getTestObject();
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ runAllInterfaceTests();
+
+ if (xSpreadsheetDoc != null) {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
+ try {
+ xClose.close(false);
+ }
+ catch(com.sun.star.util.CloseVetoException e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ }
+ }
+
+ public void getTestObject() {
+ try {
+ XInterface xIfc = (XInterface) xMSF.createInstance(
+ "com.sun.star.awt.Toolkit") ;
+ XExtendedToolkit tk =
+ UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
+
+ shortWait();
+ xWindow = UnoRuntime.queryInterface(
+ XWindow.class,tk.getActiveTopWindow());
+
+ shortWait();
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+ XAccessibleContext parentContext = null;
+
+ System.out.println("Get the accessible status bar.");
+ parentContext = AccessibilityTools.getAccessibleObjectForRole(
+ xRoot, AccessibleRole.STATUS_BAR, "");
+ shortWait();
+ if ( parentContext == null ) {
+ fail("Could not create a test object.");
+ }
+ System.out.println("...OK.");
+
+ testObject=parentContext;
+ }
+ catch(com.sun.star.uno.Exception e) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
+ }
+ catch(Throwable t) {
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", t );
+ }
+ }
+
+ public void runAllInterfaceTests() {
+ int count = testObject.getAccessibleChildCount();
+ System.out.println("*****");
+ System.out.println("**** Found items to test: " + count);
+ for (int i=0;i<count;i++){
+ System.out.println("**** Now testing StatusBarItem " + i + ".");
+ XAccessible object = null;
+ try {
+ object = testObject.getAccessibleChild(i);
+ }
+ catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ System.out.println("* Cannot get item Nr: " + i);
+ continue;
+ }
+ XServiceInfo xSI = UnoRuntime.queryInterface(
+ XServiceInfo.class,object);
+ String[] services = xSI.getSupportedServiceNames();
+ System.out.println("* Implementation Name: " + xSI.getImplementationName());
+ String accName = object.getAccessibleContext().getAccessibleName();
+ System.out.println("* Accessible Name: " + accName);
+ for (int j=0; i<services.length; i++)
+ {
+ System.out.println("* ServiceName "+i+": "+ services[j]);
+ }
+ System.out.println("*****");
+
+ System.out.println("*** Now testing XAccessibleComponent ***");
+ _XAccessibleComponent _xAccCompTest =
+ new _XAccessibleComponent(object);
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::contains", _xAccCompTest._containsPoint());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::getSize", _xAccCompTest._getSize());
+ assertTrue("failed: "+accName+" - XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
+
+ System.out.println("*** Now testing XAccessibleContext ***");
+ _XAccessibleContext _xAccContext =
+ new _XAccessibleContext(object);
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
+ assertTrue("failed: "+accName+" - XAccessibleContext::getLocale", _xAccContext._getLocale());
+
+ System.out.println("*** Now testing XAccessibleExtendedComponent ***");
+ _XAccessibleExtendedComponent _xAccExtComp =
+ new _XAccessibleExtendedComponent(object);
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
+ assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
+
+ System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
+ _XAccessibleEventBroadcaster _xAccEvBcast =
+ new _XAccessibleEventBroadcaster(object, xWindow);
+ assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
+ assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
+
+ System.out.println("*** Now testing XAccessibleText ***");
+ _XAccessibleText _xAccText =
+ new _XAccessibleText(object, xMSF, "true");
+ assertTrue("failed: "+accName+" - XAccessibleText::getText", _xAccText._getText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterCount", _xAccText._getCharacterCount());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterBounds", _xAccText._getCharacterBounds());
+ assertTrue("failed: "+accName+" - XAccessibleText::setSelection", _xAccText._setSelection());
+ assertTrue("failed: "+accName+" - XAccessibleText::copyText", _xAccText._copyText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacter", _xAccText._getCharacter());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCharacterAttributes", _xAccText._getCharacterAttributes());
+ assertTrue("failed: "+accName+" - XAccessibleText::getIndexAtPoint", _xAccText._getIndexAtPoint());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectedText", _xAccText._getSelectedText());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectionEnd", _xAccText._getSelectionEnd());
+ assertTrue("failed: "+accName+" - XAccessibleText::getSelectionStart", _xAccText._getSelectionStart());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextAtIndex", _xAccText._getTextAtIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextBeforeIndex", _xAccText._getTextBeforeIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getBehindIndex", _xAccText._getTextBehindIndex());
+ assertTrue("failed: "+accName+" - XAccessibleText::getTextRange", _xAccText._getTextRange());
+ assertTrue("failed: "+accName+" - XAccessibleText::setCaretPosition", _xAccText._setCaretPosition());
+ assertTrue("failed: "+accName+" - XAccessibleText::getCaretPosition", _xAccText._getCaretPosition());
+ }
+ }
+
+
+
+
+ @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/toolkit/qa/complex/toolkit/Assert.java b/toolkit/qa/complex/toolkit/Assert.java
new file mode 100755
index 000000000000..93b1a2c490e1
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/Assert.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ * DO NOT ALTER 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.toolkit;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import com.sun.star.uno.UnoRuntime;
+import static org.junit.Assert.*;
+
+/**
+ * provides assertion capabilities not found in {@link org.junit.Assert}
+ * @author frank.schoenheit@oracle.com
+ */
+public class Assert
+{
+ // --------------------------------------------------------------------------------------------------------
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_message
+ * is the message to print when the check fails
+ * @param i_object
+ * is the object to invoke the method on
+ * @param i_methodName
+ * is the name of the method to invoke
+ * @param i_methodArgs
+ * are the arguments to pass to the method.
+ * @param i_argClasses
+ * are the classes to assume for the arguments of the methods
+ * @param i_expectedExceptionClass
+ * is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ public static void assertException( final String i_message, final Object i_object, final String i_methodName,
+ final Class[] i_argClasses, final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ Class objectClass = i_object.getClass();
+
+ boolean noExceptionAllowed = ( i_expectedExceptionClass == null );
+
+ boolean caughtExpected = noExceptionAllowed ? true : false;
+ try
+ {
+ Method method = impl_getMethod( objectClass, i_methodName, i_argClasses );
+ method.invoke(i_object, i_methodArgs );
+ }
+ catch ( NoSuchMethodException e )
+ {
+ StringBuilder message = new StringBuilder();
+ message.append( "no such method: " ).append( objectClass.getName() ).append( "." ).append( i_methodName ).append( "( " );
+ for ( int i=0; i<i_argClasses.length; ++i )
+ {
+ message.append( i_argClasses[i].getName() );
+ if ( i<i_argClasses.length - 1 )
+ message.append( ", " );
+ }
+ message.append( " )" );
+ fail( message.toString() );
+ }
+ catch ( InvocationTargetException e )
+ {
+ caughtExpected = noExceptionAllowed
+ ? false
+ : ( e.getTargetException().getClass().equals( i_expectedExceptionClass ) );
+ }
+ catch( Exception e )
+ {
+ caughtExpected = false;
+ }
+
+ assertTrue( i_message, caughtExpected );
+ }
+
+ /**
+ * retrieves a method, given by name and parameter signature, from the given class
+ *
+ * The method does somewhat more than simply calling {@link Class.getMethod}. In particular, it recognizes
+ * primitiive parameter types, and attempts to find a method taking the given primitive type, instead of the
+ * type represented by the parameter class.
+ *
+ * For instance, if you have a method <code>foo( int )</code>, {@link Class.getMethod} would not return this
+ * method when you pass <code>Integer.class</code>. <code>impl_getMethod</code> will recognize this, and
+ * properly retrieve the method.
+ *
+ * Note: <code>impl_getMethod</code> is limited in that it will not try all possible combinations of primitive
+ * and non-primitive types. That is, a method like <code>foo( int, Integer, int )</code> is likely to not be
+ * found.
+ *
+ * @param i_obbjectClass
+ * @param i_methodName
+ * @param i_argClasses
+ * @return
+ */
+ private static Method impl_getMethod( final Class i_objectClass, final String i_methodName, final Class[] i_argClasses ) throws NoSuchMethodException
+ {
+ try
+ {
+ return i_objectClass.getMethod( i_methodName, i_argClasses );
+ }
+ catch ( NoSuchMethodException ex )
+ {
+ }
+
+ int substitutedTypes = 0;
+ int substitutedTypesLastRound = 0;
+ final Class[][] substitutionTable = new Class[][] {
+ new Class[] { Long.class, long.class },
+ new Class[] { Integer.class, int.class },
+ new Class[] { Short.class, short.class },
+ new Class[] { Byte.class, byte.class },
+ new Class[] { Double.class, double.class },
+ new Class[] { Float.class, float.class },
+ new Class[] { Character.class, char.class }
+ };
+ do
+ {
+ substitutedTypes = 0;
+ final Class[] argClasses = new Class[ i_argClasses.length ];
+ for ( int i=0; i < argClasses.length; ++i )
+ {
+ argClasses[i] = i_argClasses[i];
+ if ( substitutedTypes > substitutedTypesLastRound )
+ continue;
+
+ for ( int c=0; c<substitutionTable.length; ++c )
+ {
+ if ( i_argClasses[i].equals( substitutionTable[c][0] ) )
+ {
+ argClasses[i] = substitutionTable[c][1];
+ ++substitutedTypes;
+ break;
+ }
+ }
+ }
+ if ( substitutedTypes == substitutedTypesLastRound )
+ throw new NoSuchMethodException();
+ substitutedTypesLastRound = substitutedTypes;
+
+ try
+ {
+ return i_objectClass.getMethod( i_methodName, argClasses );
+ }
+ catch ( NoSuchMethodException e )
+ {
+ }
+ }
+ while ( substitutedTypes > 0 );
+ throw new NoSuchMethodException();
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_message is the message to print when the check fails
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param i_expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ public static void assertException( final String i_message, final Object i_object, final String i_methodName,
+ final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ Class[] argClasses = new Class[ i_methodArgs.length ];
+ for ( int i=0; i<i_methodArgs.length; ++i )
+ argClasses[i] = i_methodArgs[i].getClass();
+ assertException( i_message, i_object, i_methodName, argClasses, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param i_expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ public static void assertException( final Object i_object, final String i_methodName, final Object[] i_methodArgs,
+ final Class i_expectedExceptionClass )
+ {
+ assertException(
+ "did not catch the expected exception (" +
+ ( ( i_expectedExceptionClass == null ) ? "none" : i_expectedExceptionClass.getName() ) +
+ ") while calling " + i_object.getClass().getName() + "." + i_methodName,
+ i_object, i_methodName, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method
+ * @param i_argClasses are the classes to assume for the arguments of the methods
+ * @param i_expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ public static void assertException( final Object i_object, final String i_methodName, final Class[] i_argClasses,
+ final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ assertException(
+ "did not catch the expected exception (" +
+ ( ( i_expectedExceptionClass == null ) ? "none" : i_expectedExceptionClass.getName() ) +
+ ") while calling " + i_object.getClass().getName() + "." + i_methodName,
+ i_object, i_methodName, i_argClasses, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public static void assertException( Object i_object, Class _unoInterfaceClass, String i_methodName, Object[] i_methodArgs,
+ Class i_expectedExceptionClass )
+ {
+ assertException( UnoRuntime.queryInterface( _unoInterfaceClass, i_object ), i_methodName,
+ i_methodArgs, i_expectedExceptionClass );
+ }
+}
diff --git a/toolkit/qa/complex/toolkit/CallbackClass.java b/toolkit/qa/complex/toolkit/CallbackClass.java
deleted file mode 100644
index efc0ef91f7c0..000000000000
--- a/toolkit/qa/complex/toolkit/CallbackClass.java
+++ /dev/null
@@ -1,67 +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.toolkit;
-
-import com.sun.star.awt.XCallback;
-import lib.MultiMethodTest;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
-
-/**
- * Testing <code>com.sun.star.awt.XRequestCallback</code>
- * interface methods :
- * <ul>
- * <li><code> addCallback()</code></li>
- * </ul> <p>
- * @see com.sun.star.awt.XRequestCallback
- */
-public class CallbackClass implements XCallback{
-
- private LogWriter log;
-
- private XMultiServiceFactory xMSF;
-
-
- public CallbackClass(LogWriter log, XMultiServiceFactory xMSF ) {
-
- this.xMSF = xMSF;
- this.log = log;
- }
-
-
- /**
- * Callback method which will be called by the asynchronous
- * service where we have added our request before.
- */
- public void notify( Object aData ) {
-
- log.println("callback called successfully" );
- }
-}
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
deleted file mode 100755
index fee95f2e6de0..000000000000
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
+++ /dev/null
@@ -1,331 +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.toolkit;
-
-import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-import util.AccessibilityTools;
-import complex.toolkit.interface_tests._XAccessibleComponent;
-import complex.toolkit.interface_tests._XAccessibleContext;
-import complex.toolkit.interface_tests._XAccessibleExtendedComponent;
-import complex.toolkit.interface_tests._XAccessibleEventBroadcaster;
-import com.sun.star.awt.XWindow;
-import com.sun.star.chart.XChartDocument;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
-import com.sun.star.accessibility.AccessibleRole;
-import com.sun.star.accessibility.XAccessible;
-import com.sun.star.accessibility.XAccessibleContext;
-import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
-
-/**
- *
- */
-public class CheckAccessibleStatusBar extends ComplexTestCase {
-
- XInterface testObject = null;
- XMultiServiceFactory xMSF = null;
- XWindow xWindow = null;
-
- public String[] getTestMethodNames() {
- return new String[]{"checkDocs"};//WriterDoc", "checkDrawDoc",
-// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
- }
-
-/* public String getTestObjectName() {
- return "com.sun.star.awt.AccessibleStatusBar";
- }
-*/
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
- /**
- * Check document types
- */
- public void checkDocs() {
- Object doc = param.get("DocType");
- String testDocType;
- if (doc == null)
- testDocType = "all";
- else
- testDocType = (String)doc;
-
- System.out.println("Param was " + doc);
- System.out.println("DocType " + testDocType);
- if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
- checkWriterDoc();
- if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
- checkMathDoc();
- if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
- checkDrawDoc();
- if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
- checkImpressDoc();
- if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
- checkCalcDoc();
-
- }
-
- /**
- * Test the interfaces on a writer document
- */
- public void checkWriterDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XTextDocument xTextDoc = null;
- try {
- log.println("****** Open a new writer document");
- xTextDoc = xSOF.createTextDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xTextDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on a math document
- */
- public void checkMathDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xMathDoc = null;
- try {
- log.println("****** Open a new math document");
- xMathDoc = xSOF.createMathDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xMathDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on a draw document
- */
- public void checkDrawDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xDrawDoc = null;
- try {
- log.println("****** Open a new draw document");
- xDrawDoc = xSOF.createDrawDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xDrawDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on an impress document
- */
- public void checkImpressDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xImpressDoc = null;
- try {
- log.println("****** Open a new impress document");
- xImpressDoc = xSOF.createImpressDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xImpressDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * Test the interfaces on an calc document
- */
- public void checkCalcDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XSpreadsheetDocument xSpreadsheetDoc = null;
- try {
- log.println("****** Open a new calc document");
- xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
- shortWait();
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xSpreadsheetDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void getTestObject() {
- try {
- XInterface xIfc = (XInterface) xMSF.createInstance(
- "com.sun.star.awt.Toolkit") ;
- XExtendedToolkit tk = (XExtendedToolkit)
- UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
-
- shortWait();
- xWindow = (XWindow)UnoRuntime.queryInterface(
- XWindow.class,tk.getActiveTopWindow());
-
- shortWait();
- AccessibilityTools at = new AccessibilityTools();
- XAccessible xRoot = at.getAccessibleObject(xWindow);
- XAccessibleContext parentContext = null;
-
- log.println("Get the accessible status bar.");
- parentContext = at.getAccessibleObjectForRole(
- xRoot, AccessibleRole.STATUS_BAR, "");
- shortWait();
- log.println("...OK.");
-
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
- XServiceInfo.class,parentContext);
- String[] services = xSI.getSupportedServiceNames();
- log.println("*****");
- log.println("* Implementation Name: " + xSI.getImplementationName());
- for (int i=0; i<services.length; i++)
- log.println("* ServiceName "+i+": "+ services[i]);
- log.println("*****");
- testObject=parentContext;
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- catch(Throwable t) {
- System.out.println("Got throwable:");
- t.printStackTrace();
- }
- }
-
- public void runAllInterfaceTests() {
- log.println("*** Now testing XAccessibleComponent ***");
- _XAccessibleComponent _xAccCompTest =
- new _XAccessibleComponent(testObject, log);
- assure("failed: XAccessibleComponent::getBounds", _xAccCompTest._getBounds());
- assure("failed: XAccessibleComponent::contains", _xAccCompTest._containsPoint());
- assure("failed: XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint());
- assure("failed: XAccessibleComponent::getBackground", _xAccCompTest._getBackground());
- assure("failed: XAccessibleComponent::getForeground", _xAccCompTest._getForeground());
- assure("failed: XAccessibleComponent::getLocation", _xAccCompTest._getLocation());
- assure("failed: XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen());
- assure("failed: XAccessibleComponent::getSize", _xAccCompTest._getSize());
- assure("failed: XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus());
-
- log.println("*** Now testing XAccessibleContext ***");
- _XAccessibleContext _xAccContext =
- new _XAccessibleContext(testObject, log);
- assure("failed: XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount());
- assure("failed: XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild());
- assure("failed: XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription());
- assure("failed: XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName());
- assure("failed: XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent());
- assure("failed: XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent());
- assure("failed: XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet());
- assure("failed: XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole());
- assure("failed: XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet());
- assure("failed: XAccessibleContext::getLocale", _xAccContext._getLocale());
-
- log.println("*** Now testing XAccessibleExtendedComponent ***");
- _XAccessibleExtendedComponent _xAccExtComp =
- new _XAccessibleExtendedComponent(testObject, log);
- assure("failed: XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont());
- assure("failed: XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText());
- assure("failed: XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText());
-
- log.println("*** Now testing XAccessibleEventBroadcaster ***");
- _XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(testObject, log, "Pfff", xWindow);
- assure("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
- assure("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
- }
-}
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
deleted file mode 100755
index 36394732ce78..000000000000
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
+++ /dev/null
@@ -1,385 +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.toolkit;
-
-import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-import util.AccessibilityTools;
-import complex.toolkit.interface_tests._XAccessibleComponent;
-import complex.toolkit.interface_tests._XAccessibleContext;
-import complex.toolkit.interface_tests._XAccessibleEventBroadcaster;
-import complex.toolkit.interface_tests._XAccessibleExtendedComponent;
-import complex.toolkit.interface_tests._XAccessibleText;
-import com.sun.star.awt.XWindow;
-import com.sun.star.chart.XChartDocument;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
-import com.sun.star.accessibility.AccessibleRole;
-import com.sun.star.accessibility.XAccessible;
-import com.sun.star.accessibility.XAccessibleContext;
-import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
-/**
- *
- */
-public class CheckAccessibleStatusBarItem extends ComplexTestCase {
-
- XMultiServiceFactory xMSF = null;
- XAccessibleContext testObject = null;
- XWindow xWindow = null;
-
-
- public String[] getTestMethodNames() {
- return new String[]{"checkDocs"};//{"checkWriterDoc", "checkDrawDoc",
-// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
- }
-
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- shortWait(500) ;
- }
-
- /**
- * Sleeps for a certain time.
- * @param Thread is sleeping for this time in milliseconds.
- */
- private void shortWait(int time) {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
- /**
- * Check document types
- */
- public void checkDocs() {
- Object doc = param.get("DocType");
- String testDocType;
- if (doc == null)
- testDocType = "all";
- else
- testDocType = (String)doc;
-
- System.out.println("Param was " + doc);
- System.out.println("DocType " + testDocType);
- if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
- checkWriterDoc();
- if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
- checkMathDoc();
- if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
- checkDrawDoc();
- if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
- checkImpressDoc();
- if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
- checkCalcDoc();
-
- }
-
- /**
- * Test the interfaces on a writer document
- */
- public void checkWriterDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XTextDocument xTextDoc = null;
- try {
- log.println("****** Open a new writer document");
- xTextDoc = xSOF.createTextDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xTextDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xTextDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on a math document
- */
- public void checkMathDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xMathDoc = null;
- try {
- log.println("****** Open a new math document");
- xMathDoc = xSOF.createMathDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xMathDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xMathDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on a draw document
- */
- public void checkDrawDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xDrawDoc = null;
- try {
- log.println("****** Open a new draw document");
- xDrawDoc = xSOF.createDrawDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xDrawDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xDrawDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test the interfaces on an impress document
- */
- public void checkImpressDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XComponent xImpressDoc = null;
- try {
- log.println("****** Open a new impress document");
- xImpressDoc = xSOF.createImpressDoc("_blank");
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xImpressDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xImpressDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * Test the interfaces on an calc document
- */
- public void checkCalcDoc() {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
- XSpreadsheetDocument xSpreadsheetDoc = null;
- try {
- log.println("****** Open a new calc document");
- xSpreadsheetDoc = xSOF.createCalcDoc("_blank");
- shortWait();
- getTestObject();
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- runAllInterfaceTests();
-
- if (xSpreadsheetDoc != null) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xSpreadsheetDoc);
- try {
- xClose.close(false);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void getTestObject() {
- try {
- XInterface xIfc = (XInterface) xMSF.createInstance(
- "com.sun.star.awt.Toolkit") ;
- XExtendedToolkit tk = (XExtendedToolkit)
- UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc);
-
- shortWait();
- xWindow = (XWindow)UnoRuntime.queryInterface(
- XWindow.class,tk.getActiveTopWindow());
-
- shortWait();
- AccessibilityTools at = new AccessibilityTools();
- XAccessible xRoot = at.getAccessibleObject(xWindow);
- XAccessibleContext parentContext = null;
-
- log.println("Get the accessible status bar.");
- parentContext = at.getAccessibleObjectForRole(
- xRoot, AccessibleRole.STATUS_BAR, "");
- shortWait();
- if ( parentContext == null ) {
- log.println("Could not get the test object: set the correct focus in the next 30 seconds.");
- shortWait(30000);
- parentContext = at.getAccessibleObjectForRole(
- xRoot, AccessibleRole.STATUS_BAR, "");
-
- if ( parentContext == null )
- failed("Could not create a test object.");
- }
- log.println("...OK.");
-
- testObject=parentContext;
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- catch(Throwable t) {
- System.out.println("Got throwable:");
- t.printStackTrace();
- }
- }
-
- public void runAllInterfaceTests() {
- int count = testObject.getAccessibleChildCount();
- log.println("*****");
- log.println("**** Found items to test: " + count);
- for (int i=0;i<count;i++){
- log.println("**** Now testing StatusBarItem " + i + ".");
- XAccessible object = null;
- try {
- object = testObject.getAccessibleChild(i);
- }
- catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- System.out.println("* Cannot get item Nr: " + i);
- continue;
- }
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
- XServiceInfo.class,object);
- String[] services = xSI.getSupportedServiceNames();
- log.println("* Implementation Name: " + xSI.getImplementationName());
- String accName = object.getAccessibleContext().getAccessibleName();
- log.println("* Accessible Name: " + accName);
- for (int j=0; i<services.length; i++)
- log.println("* ServiceName "+i+": "+ services[j]);
- log.println("*****");
-
- log.println("*** Now testing XAccessibleComponent ***");
- _XAccessibleComponent _xAccCompTest =
- new _XAccessibleComponent(object, log);
- assure("failed: "+accName+" - XAccessibleComponent::getBounds", _xAccCompTest._getBounds(), true);
- assure("failed: "+accName+" - XAccessibleComponent::contains", _xAccCompTest._containsPoint(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getAccessibleAt", _xAccCompTest._getAccessibleAtPoint(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getBackground", _xAccCompTest._getBackground(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getForeground", _xAccCompTest._getForeground(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getLocation", _xAccCompTest._getLocation(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getLocationOnScreen", _xAccCompTest._getLocationOnScreen(), true);
- assure("failed: "+accName+" - XAccessibleComponent::getSize", _xAccCompTest._getSize(), true);
- assure("failed: "+accName+" - XAccessibleComponent::grabFocus", _xAccCompTest._grabFocus(), true);
-
- log.println("*** Now testing XAccessibleContext ***");
- _XAccessibleContext _xAccContext =
- new _XAccessibleContext(object, log);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleChildCount", _xAccContext._getAccessibleChildCount(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleChild", _xAccContext._getAccessibleChild(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleDescription", _xAccContext._getAccessibleDescription(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleName", _xAccContext._getAccessibleName(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleParent", _xAccContext._getAccessibleParent(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleIndexInParent", _xAccContext._getAccessibleIndexInParent(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleRelationSet", _xAccContext._getAccessibleRelationSet(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleRole", _xAccContext._getAccessibleRole(), true);
- assure("failed: "+accName+" - XAccessibleContext::getAccessibleStateSet", _xAccContext._getAccessibleStateSet(), true);
- assure("failed: "+accName+" - XAccessibleContext::getLocale", _xAccContext._getLocale(), true);
-
- log.println("*** Now testing XAccessibleExtendedComponent ***");
- _XAccessibleExtendedComponent _xAccExtComp =
- new _XAccessibleExtendedComponent(object, log);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont(), true);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText(), true);
- assure("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText(), true);
-
- log.println("*** Now testing XAccessibleEventBroadcaster ***");
- _XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(object, log, "Pfff", xWindow);
- assure("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(), true);
- assure("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(), true);
-
- log.println("*** Now testing XAccessibleText ***");
- _XAccessibleText _xAccText =
- new _XAccessibleText(object, log, xMSF, "true");
- assure("failed: "+accName+" - XAccessibleText::getText", _xAccText._getText(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterCount", _xAccText._getCharacterCount(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterBounds", _xAccText._getCharacterBounds(), true);
- assure("failed: "+accName+" - XAccessibleText::setSelection", _xAccText._setSelection(), true);
- assure("failed: "+accName+" - XAccessibleText::copyText", _xAccText._copyText(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacter", _xAccText._getCharacter(), true);
- assure("failed: "+accName+" - XAccessibleText::getCharacterAttributes", _xAccText._getCharacterAttributes(), true);
- assure("failed: "+accName+" - XAccessibleText::getIndexAtPoint", _xAccText._getIndexAtPoint(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectedText", _xAccText._getSelectedText(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectionEnd", _xAccText._getSelectionEnd(), true);
- assure("failed: "+accName+" - XAccessibleText::getSelectionStart", _xAccText._getSelectionStart(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextAtIndex", _xAccText._getTextAtIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextBeforeIndex", _xAccText._getTextBeforeIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getBehindIndex", _xAccText._getTextBehindIndex(), true);
- assure("failed: "+accName+" - XAccessibleText::getTextRange", _xAccText._getTextRange(), true);
- assure("failed: "+accName+" - XAccessibleText::setCaretPosition", _xAccText._setCaretPosition(), true);
- assure("failed: "+accName+" - XAccessibleText::getCaretPosition", _xAccText._getCaretPosition(), true);
- }
- }
-
-}
diff --git a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java b/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
deleted file mode 100644
index cc184f3c1a73..000000000000
--- a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
+++ /dev/null
@@ -1,127 +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.toolkit;
-
-import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-import complex.toolkit.interface_tests._XRequestCallback;
-import complex.toolkit.CallbackClass;
-import com.sun.star.awt.XRequestCallback;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.awt.XExtendedToolkit;
-import java.io.PrintWriter;
-
-/**
- *
- */
-public class CheckAsyncCallback extends ComplexTestCase {
-
-
- XInterface testObject = null;
- XMultiServiceFactory xMSF = null;
-
- public String[] getTestMethodNames() {
- return new String[]{"checkService"};
- }
-
-/* public String getTestObjectName() {
- return "com.sun.star.awt.AccessibleStatusBar";
- }
-*/
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
- /**
- * Check services
- */
- public void checkService() {
- checkAsyncCallbackService();
-
- }
-
- /**
- * Test the interfaces
- */
- public void checkAsyncCallbackService() {
- runAllInterfaceTests();
- }
-
- public void getTestObject() {
- try {
- xMSF = (XMultiServiceFactory)param.getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
-
- XRequestCallback xAsyncCallback = null;
-
- XInterface xIfc = (XInterface)xMSF.createInstance(
- "com.sun.star.awt.AsyncCallback" );
- xAsyncCallback = (XRequestCallback)
- UnoRuntime.queryInterface(XRequestCallback.class,xIfc);
-
- testObject=xAsyncCallback;
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- catch(Throwable t) {
- System.out.println("Got throwable:");
- t.printStackTrace();
- }
- }
-
- public void runAllInterfaceTests() {
- getTestObject();
- log.println("*** Now testing XRequestCallback ***");
- _XRequestCallback _xRequestCallback =
- new _XRequestCallback(testObject, log, xMSF );
- assure("failed: XRequestCallback::addCallback", _xRequestCallback._addCallback());
- }
-
- public void checkCallback() {
- getTestObject();
- log.println("*** Now testing asynchronous callback service ***");
- XRequestCallback xAsyncCallback = null;
- xAsyncCallback = (XRequestCallback)
- UnoRuntime.queryInterface( XRequestCallback.class, testObject );
- CallbackClass aCallbackClass = new CallbackClass( log, xMSF );
- xAsyncCallback.addCallback( aCallbackClass, null );
- }
-}
diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java
new file mode 100755
index 000000000000..a06a52342417
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/GridControl.java
@@ -0,0 +1,687 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 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.toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.grid.DefaultGridDataModel;
+import com.sun.star.awt.grid.XGridColumn;
+import com.sun.star.awt.grid.XGridColumnModel;
+import com.sun.star.awt.grid.XGridDataModel;
+import com.sun.star.awt.grid.XMutableGridDataModel;
+import com.sun.star.awt.grid.XSortableMutableGridDataModel;
+import com.sun.star.beans.Pair;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.ContainerEvent;
+import com.sun.star.container.XContainerListener;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XEventListener;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloneable;
+import complex.toolkit.awtgrid.DummyColumn;
+import complex.toolkit.awtgrid.TMutableGridDataModel;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.openoffice.test.OfficeConnection;
+
+/** is a unit test for the grid control related implementations
+ * @author frank.schoenheit@sun.com
+ */
+public class GridControl
+{
+ // -----------------------------------------------------------------------------------------------------------------
+ public GridControl()
+ {
+ m_context = m_connection.getComponentContext();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static void impl_dispose( final Object... i_components )
+ {
+ for ( int i=0; i<i_components.length; ++i )
+ {
+ if ( i_components[i] != null )
+ {
+ final XComponent component = UnoRuntime.queryInterface( XComponent.class, i_components[i] );
+ component.dispose();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_recreateGridModel() throws Exception
+ {
+ impl_dispose( m_gridControlModel, m_columnModel, m_dataModel );
+
+ // create a grid control model, and ensure it has a proper data and column model already
+ m_gridControlModel = UnoRuntime.queryInterface( XPropertySet.class,
+ createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) );
+ assertNotNull( "grid control model does not provide XPropertySet interface", m_gridControlModel );
+
+ // ensure that the model has default column/data models
+ m_columnModel = UnoRuntime.queryInterface( XGridColumnModel.class, m_gridControlModel.getPropertyValue( "ColumnModel" ) );
+ assertNotNull( "the control model is expected to have an initial column model", m_columnModel );
+ final XGridDataModel dataModel = UnoRuntime.queryInterface( XGridDataModel.class, m_gridControlModel.getPropertyValue( "GridDataModel" ) );
+ assertNotNull( "the control model is expected to have an initial data model", dataModel );
+ m_dataModel = UnoRuntime.queryInterface( XSortableMutableGridDataModel.class,
+ dataModel );
+ assertNotNull( "the out-of-the-box data model should be mutable and sortable", m_dataModel );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testGridControlCloning() throws Exception
+ {
+ impl_recreateGridModel();
+
+ // give the test something to compare, actually
+ XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ m_gridControlModel.getPropertyValue( "ColumnModel" ) );
+ columnModel.setDefaultColumns( 10 );
+
+ // clone the grid model
+ final XCloneable cloneable = UnoRuntime.queryInterface( XCloneable.class, m_gridControlModel );
+ assertNotNull( "all UnoControlModel's are expected to be cloneable", cloneable );
+
+ final XInterface clone = cloneable.createClone();
+ final XPropertySet clonedProps = UnoRuntime.queryInterface( XPropertySet.class, clone );
+
+ // TODO: check all those generic properties for equality
+
+ // the data model and the column model should have been cloned, too
+ // in particular, the clone should not share the sub models with the orignal
+ final XMutableGridDataModel originalDataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ m_gridControlModel.getPropertyValue( "GridDataModel" ) );
+ final XMutableGridDataModel clonedDataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ clonedProps.getPropertyValue( "GridDataModel" ) );
+ assertFalse( "data model should not be shared after cloning", UnoRuntime.areSame( originalDataModel, clonedDataModel ) );
+ impl_assertEquality( originalDataModel, clonedDataModel );
+
+ final XGridColumnModel originalColumnModel = columnModel;
+ final XGridColumnModel clonedColumnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ clonedProps.getPropertyValue( "ColumnModel" ) );
+ assertFalse( "column model should not be shared after cloning", UnoRuntime.areSame( originalColumnModel, clonedColumnModel ) );
+ impl_assertEquality( originalColumnModel, clonedColumnModel );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testDisposal() throws Exception
+ {
+ impl_recreateGridModel();
+
+ final int columnCount = 3;
+ m_columnModel.setDefaultColumns( columnCount );
+
+ // add disposal listeners to all columns so far
+ final XGridColumn[] columns = m_columnModel.getColumns();
+ assertEquals( "creating default columns resulted in unexpected column count", columnCount, columns.length );
+ final DisposeListener[] columnListeners = new DisposeListener[columnCount];
+ for ( int i=0; i<columnCount; ++i )
+ columnListeners[i] = new DisposeListener( columns[i] );
+
+ // add another column, and check that upon removal, it is disposed
+ final int newColumnIndex = m_columnModel.addColumn( m_columnModel.createColumn() );
+ final DisposeListener columnListener = new DisposeListener( m_columnModel.getColumn( newColumnIndex ) );
+ m_columnModel.removeColumn( newColumnIndex );
+ assertTrue( "explicit column removal is expected to dispose the column", columnListener.isDisposed() );
+
+ // by definition, the grid control model is the owner of both the column and the data model. So, setting
+ // a new column/data model should implicitly dispose the old models
+ final DisposeListener oldDataModelListener = new DisposeListener( m_dataModel );
+ final DisposeListener oldColumnModelListener = new DisposeListener( m_columnModel );
+
+ final Object newDataModel = createInstance( "com.sun.star.awt.grid.DefaultGridDataModel" );
+ final Object newColumnModel = createInstance( "com.sun.star.awt.grid.DefaultGridColumnModel" );
+ final DisposeListener newDataModelListener = new DisposeListener( newDataModel );
+ final DisposeListener newColumnModelListener = new DisposeListener( newColumnModel );
+
+ m_gridControlModel.setPropertyValue( "GridDataModel", newDataModel );
+ assertTrue( "setting a new data model failed", impl_areSameInterface( newDataModel, m_gridControlModel.getPropertyValue( "GridDataModel" ) ) );
+ m_gridControlModel.setPropertyValue( "ColumnModel", newColumnModel );
+ assertTrue( "setting a new column model failed", impl_areSameInterface( newColumnModel, m_gridControlModel.getPropertyValue( "ColumnModel" ) ) );
+
+ assertTrue( "old data model has not been disposed", oldDataModelListener.isDisposed() );
+ assertTrue( "old column model has not been disposed", oldColumnModelListener.isDisposed() );
+ for ( int i=0; i<columnCount; ++i )
+ assertTrue( "column no. " + i + " has not been disposed", columnListeners[i].isDisposed() );
+
+ // the same holds if the grid control model itself is disposed - it should dispose the depending models, too
+ assertFalse( "new data model is already disposed - this is unexpected", newDataModelListener.isDisposed() );
+ assertFalse( "new column model is already disposed - this is unexpected", newColumnModelListener.isDisposed() );
+ impl_dispose( m_gridControlModel );
+ assertTrue( "new data model is not disposed after disposing the grid column model", newDataModelListener.isDisposed() );
+ assertTrue( "new column model is not disposed after disposing the grid column model", newColumnModelListener.isDisposed() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ /**
+ * tests various aspects of the <code>XMutableGridDataModel</code> interface
+ */
+ @Test
+ public void testMutableGridDataModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ TMutableGridDataModel test = new TMutableGridDataModel( m_dataModel );
+ test.testAddRow();
+ test.testAddRows();
+ test.testRemoveRow();
+ test.testRemoveAllRows();
+ test.testUpdateCellData();
+ test.testUpdateRowData();
+ test.testUpdateRowHeading();
+ test.cleanup();
+
+ // a somehwat less straight-forward test: the data model is expected to implicitly increase its column count
+ // when you add a row which has more columns than currently known
+ final XMutableGridDataModel dataModel = DefaultGridDataModel.create( m_context );
+ dataModel.addRow( 0, new Object[] { 1 } );
+ assertEquals( "unexpected column count after adding the most simple row", 1, dataModel.getColumnCount() );
+ dataModel.addRow( 1, new Object[] { 1, 2 } );
+ assertEquals( "implicit extension of the column count doesn't work", 2, dataModel.getColumnCount() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testGridColumnModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ ColumnModelListener listener = new ColumnModelListener();
+ m_columnModel.addContainerListener( listener );
+
+ // insert default columns into the previously empty model, ensure we get the right notifications
+ final int defaultColumnsCount = 3;
+ m_columnModel.setDefaultColumns( defaultColumnsCount );
+ impl_assertColumnModelConsistency();
+ List< ContainerEvent > events = listener.assertExclusiveInsertionEvents();
+ listener.reset();
+ assertEquals( "wrong number of events fired by setDefaulColumns", defaultColumnsCount, events.size() );
+ for ( int i=0; i<defaultColumnsCount; ++i )
+ {
+ final ContainerEvent event = events.get(i);
+ final int index = impl_assertInteger( event.Accessor );
+ assertEquals( "unexpected Accessor value in insert notification", i, index );
+ assertTrue( "wrong column object notified in insert notification",
+ impl_areSameInterface( event.Element, m_columnModel.getColumn(i) ) );
+ }
+
+ // insert some more default columns, ensure that all previously existing columns are removed
+ final int moreDefaultColumnsCount = 5;
+ m_columnModel.setDefaultColumns( moreDefaultColumnsCount );
+ impl_assertColumnModelConsistency();
+ assertEquals( "setting default columns is expected to remove all previously existing columns",
+ moreDefaultColumnsCount, m_columnModel.getColumnCount() );
+
+ // in this situation, both removal and insertion events have been notified
+ final List< ContainerEvent > removalEvents = listener.getRemovalEvents();
+ final List< ContainerEvent > insertionEvents = listener.getInsertionEvents();
+ listener.reset();
+
+ // for the removal events, check the indexes
+ assertEquals( "wrong number of columns removed (or notified) upon setting default columns",
+ defaultColumnsCount, removalEvents.size() );
+ for ( int i=0; i<removalEvents.size(); ++i )
+ {
+ final ContainerEvent event = removalEvents.get(i);
+ final int removedIndex = impl_assertInteger( event.Accessor );
+
+ // The implementation is allowed to remove the columns from the beginning, in which case the
+ // index of the removed column must always be 0, since e.g. the second column has index 0
+ // after the first column (which previously had index 0) had been removed.
+ // Alternatively, the implementation is allowed to remove columns from the end, which means
+ // that the column index given in the event is steadily increasing.
+ assertTrue( "unexpected column removal event column index",
+ ( removedIndex == 0 ) || ( removedIndex == removalEvents.size() - 1 - i ) );
+ }
+
+ // for the insertion events, check the indexes as well
+ assertEquals( "wrong number of insertion events when setting default columns over existing columns",
+ moreDefaultColumnsCount, insertionEvents.size() );
+ for ( int i=0; i<insertionEvents.size(); ++i )
+ {
+ final ContainerEvent event = insertionEvents.get(i);
+ final int index = impl_assertInteger( event.Accessor );
+ assertEquals( i, index );
+ }
+
+ // okay, remove all those columns
+ while ( m_columnModel.getColumnCount() != 0 )
+ {
+ final int columnCount = m_columnModel.getColumnCount();
+ final int removeColumnIndex = m_randomGenerator.nextInt( columnCount );
+ m_columnModel.removeColumn( removeColumnIndex );
+ events = listener.assertExclusiveRemovalEvents();
+ listener.reset();
+ assertEquals( "removing a single column should notify a single event", 1, events.size() );
+ final ContainerEvent event = events.get(0);
+ final int removalIndex = impl_assertInteger( event.Accessor );
+ assertEquals( "removing an arbitrary column does not notify the proper accessor",
+ removeColumnIndex, removalIndex );
+ }
+
+ // calling addColumn with a column not created by the given model/implementatoion should not succeed
+ boolean caughtExpected = false;
+ try
+ {
+ m_columnModel.addColumn( new DummyColumn() );
+ }
+ catch( final com.sun.star.lang.IllegalArgumentException e )
+ {
+ assertTrue( impl_areSameInterface( e.Context, m_columnModel ) );
+ caughtExpected = true;
+ }
+ assertTrue( "adding a dummy (self-implemented) grid column to the model should not succeed", caughtExpected );
+
+ // adding a single column to the end should succeed, properly notify, and still be consistent
+ final XGridColumn newColumn = m_columnModel.createColumn();
+ m_columnModel.addColumn( newColumn );
+ impl_assertColumnModelConsistency();
+ events = listener.assertExclusiveInsertionEvents();
+ listener.reset();
+ assertEquals( "addColumn notifies the wrong number of insertion events", 1, events.size() );
+ final int insertionIndex = impl_assertInteger( events.get(0).Accessor );
+ assertEquals( insertionIndex, newColumn.getIndex() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testSortableDataModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ final int colCount = 3;
+ final int rowCount = 10;
+ // initialize with some data
+ final Object[][] data = new Object[][] {
+ new Object[] { 15, 17, 0 },
+ new Object[] { 9, 8, 14 },
+ new Object[] { 17, 2, 16 },
+ new Object[] { 0, 7, 14 },
+ new Object[] { 10, 16, 16 },
+ new Object[] { 2, 8, 10 },
+ new Object[] { 4, 8, 3 },
+ new Object[] { 7, 9, 0 },
+ new Object[] { 15, 6, 19 },
+ new Object[] { 2, 14, 19 }
+ };
+ final Object[] rowHeadings = new Object[] {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+ };
+ // ensure consistency of the test data
+ assertEquals( rowHeadings.length, rowCount );
+ assertEquals( data.length, rowCount );
+ for ( Object[] rowData : data )
+ assertEquals( rowData.length, colCount );
+
+ // add the test data
+ m_dataModel.addRows( rowHeadings, data );
+ assertEquals( rowCount, m_dataModel.getRowCount() );
+ assertEquals( colCount, m_dataModel.getColumnCount() );
+
+ // sort by each column
+ for ( int colIndex = 0; colIndex < colCount; ++colIndex )
+ {
+ for ( boolean ascending : new boolean[] { true, false } )
+ {
+ m_dataModel.sortByColumn( colIndex, ascending );
+ Pair currentSortOrder = m_dataModel.getCurrentSortOrder();
+ assertEquals( "invalid current sort column (column " + colIndex + ")", ((Integer)currentSortOrder.First).intValue(), colIndex );
+ assertEquals( "invalid current sort direction", ((Boolean)currentSortOrder.Second).booleanValue(), ascending );
+
+ /*for ( int i=0; i<rowCount; ++i )
+ {
+ for ( int j=0; j<colCount; ++j )
+ System.out.print( m_dataModel.getCellData( j, i ).toString() + ", " );
+ System.out.println();
+ }*/
+
+ // verify the data is actually sorted by this column
+ for ( int rowIndex = 0; rowIndex < rowCount - 1; ++rowIndex )
+ {
+ final Object currentValue = m_dataModel.getCellData( colIndex, rowIndex );
+ final int currentIntValue = impl_assertInteger( currentValue );
+ final Object nextValue = m_dataModel.getCellData( colIndex, rowIndex + 1 );
+ final int nextIntValue = impl_assertInteger( nextValue );
+ assertTrue( "data in row " + rowIndex + " is actually not sorted " + ( ascending ? "ascending" : "descending" ),
+ ascending ? currentIntValue <= nextIntValue
+ : currentIntValue >= nextIntValue );
+
+ // ensure the data in the other columns, and the row headings, are sorted as well
+ final Object rowHeading = m_dataModel.getRowHeading( rowIndex );
+ final int unsortedRowIndex = impl_assertInteger( rowHeading );
+ for ( int innerColIndex = 0; innerColIndex < colCount; ++innerColIndex )
+ {
+ assertEquals( "sorted row " + rowIndex + ", unsorted row " + unsortedRowIndex + ", col " + innerColIndex +
+ ": wrong data",
+ data[unsortedRowIndex][innerColIndex], m_dataModel.getCellData( innerColIndex, rowIndex ) );
+ }
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testModelViewInteraction() throws Exception
+ {
+ final List< Object > disposables = new ArrayList< Object >();
+ try
+ {
+ // create a siple dialog model/control/peer trinity
+ final XControlModel dialogModel = createInstance( XControlModel.class, "com.sun.star.awt.UnoControlDialogModel" );
+ disposables.add( dialogModel );
+ final XPropertySet dialogProps = UnoRuntime.queryInterface( XPropertySet.class, dialogModel );
+ dialogProps.setPropertyValue( "Width", 200 );
+ dialogProps.setPropertyValue( "Height", 100 );
+ dialogProps.setPropertyValue( "Title", "Grid Control Unit Test" );
+ final XControl dialogControl = createInstance( XControl.class, "com.sun.star.awt.UnoControlDialog" );
+ disposables.add( dialogControl );
+ dialogControl.setModel( dialogModel );
+ dialogControl.createPeer( createInstance( XToolkit.class, "com.sun.star.awt.Toolkit" ), null );
+
+ // insert a grid control model
+ final XMultiServiceFactory controlModelFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ dialogModel );
+ XPropertySet gridModelProps = UnoRuntime.queryInterface( XPropertySet.class,
+ controlModelFactory.createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) );
+ disposables.add( gridModelProps );
+ gridModelProps.setPropertyValue( "PositionX", 6 );
+ gridModelProps.setPropertyValue( "PositionY", 6 );
+ gridModelProps.setPropertyValue( "Width", 188 );
+ gridModelProps.setPropertyValue( "Height", 88 );
+ final XNameContainer modelContainer = UnoRuntime.queryInterface( XNameContainer.class, dialogModel );
+ modelContainer.insertByName( "grid", gridModelProps );
+
+ // check the respective control has been created
+ final XControlContainer controlContainer = UnoRuntime.queryInterface( XControlContainer.class, dialogControl );
+ final XControl gridControl = controlContainer.getControl( "grid" );
+ assertNotNull( "no grid control created in the dialog", gridControl );
+
+ // in the current implementation (not sure this is a good idea at all), the control (more precise: the peer)
+ // ensures that if there are no columns in the column model, but in the data model, then the column model
+ // will implicitly have the needed columns added.
+ // To ensure that clients which rely on this do not break in the future, check this here.
+ final XMutableGridDataModel dataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ gridModelProps.getPropertyValue( "GridDataModel" ) );
+ assertNotNull( dataModel );
+ assertEquals( 0, dataModel.getColumnCount() );
+
+ final XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ gridModelProps.getPropertyValue( "ColumnModel" ) );
+ assertNotNull( columnModel );
+ assertEquals( 0, columnModel.getColumnCount() );
+
+ dataModel.addRow( null, new Object[] { 1, 2, 3 } );
+ assertEquals( 3, dataModel.getColumnCount() );
+ assertEquals( 3, columnModel.getColumnCount() );
+ }
+ finally
+ {
+ impl_dispose( disposables.toArray());
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private int impl_assertInteger( final Object i_object )
+ {
+ assertTrue( i_object instanceof Integer );
+ return ((Integer)i_object).intValue();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertColumnModelConsistency() throws IndexOutOfBoundsException
+ {
+ for ( int col = 0; col < m_columnModel.getColumnCount(); ++col )
+ {
+ final XGridColumn column = m_columnModel.getColumn( col );
+ assertNotNull( column );
+ assertEquals( "column/model inconsistency: column " + col + " has a wrong index!", col, column.getIndex() );
+ }
+
+ final XGridColumn[] allColumns = m_columnModel.getColumns();
+ assertEquals( "getColumns returns the wrong number of column objects",
+ m_columnModel.getColumnCount(), allColumns.length );
+ for ( int col = 0; col < m_columnModel.getColumnCount(); ++col )
+ {
+ assertTrue( "getColumns inconsistency", impl_areSameInterface( allColumns[col], m_columnModel.getColumn(col) ) );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridDataModel i_reference, final XGridDataModel i_compare ) throws IndexOutOfBoundsException
+ {
+ assertNotNull( i_reference );
+ assertNotNull( i_compare );
+
+ assertEquals( "data model comparison: wrong column counts", i_reference.getColumnCount(), i_compare.getColumnCount() );
+ assertEquals( "data model comparison: wrong row counts", i_reference.getRowCount(), i_compare.getRowCount() );
+
+ for ( int row = 0; row < i_reference.getRowCount(); ++row )
+ {
+ assertEquals( "data model comparison: wrong row heading content in row " + row,
+ i_reference.getRowHeading( row ) );
+ for ( int col = 0; col < i_reference.getRowCount(); ++col )
+ {
+ assertEquals( "data model comparison: wrong cell content in cell (" + col + ", " + row + ")",
+ i_reference.getCellData( col, row ) );
+ assertEquals( "data model comparison: wrong tooltip content in cell (" + col + ", " + row + ")",
+ i_reference.getCellToolTip( col, row ) );
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridColumnModel i_reference, final XGridColumnModel i_compare ) throws IndexOutOfBoundsException
+ {
+ assertEquals( "column model comparison: wrong column counts", i_reference.getColumnCount(), i_compare.getColumnCount() );
+ for ( int col = 0; col < i_reference.getColumnCount(); ++col )
+ {
+ final XGridColumn referenceColumn = i_reference.getColumn( col );
+ final XGridColumn compareColumn = i_compare.getColumn( col );
+ impl_assertEquality( referenceColumn, compareColumn );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridColumn i_reference, final XGridColumn i_compare )
+ {
+ final Method[] methods = XGridColumn.class.getMethods();
+ for ( int m=0; m<methods.length; ++m )
+ {
+ if ( !methods[m].getName().startsWith( "get" ) )
+ continue;
+ try
+ {
+ final Object referenceValue = methods[m].invoke( i_reference );
+ final Object compareValue = methods[m].invoke( i_compare );
+ assertEquals( "grid column comparison: column attribute '" + methods[m].getName().substring(3) + "' does not match",
+ referenceValue, compareValue );
+ }
+ catch ( java.lang.Exception ex )
+ {
+ fail( " could not retrieve object attributes: " + ex.toString() );
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private boolean impl_areSameInterface( final Object i_lhs, final Object i_rhs )
+ {
+ final XInterface lhs = UnoRuntime.queryInterface( XInterface.class, i_lhs );
+ final XInterface rhs = UnoRuntime.queryInterface( XInterface.class, i_rhs );
+ return UnoRuntime.areSame( lhs, rhs );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @BeforeClass
+ public static void setUpConnection() throws java.lang.Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "starting class: " + GridControl.class.getName() );
+ System.out.print( "connecting ... " );
+ m_connection.setUp();
+ System.out.println( "done.");
+
+ final long seed = m_randomGenerator.nextLong();
+ m_randomGenerator.setSeed( seed );
+ System.out.println( "seeding random number generator with " + seed );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println();
+ System.out.println( "tearing down connection" );
+ m_connection.tearDown();
+ System.out.println( "finished class: " + GridControl.class.getName() );
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ public <T> T createInstance( Class<T> i_interfaceClass, final String i_serviceIndentifer ) throws Exception
+ {
+ return UnoRuntime.queryInterface( i_interfaceClass, createInstance( i_serviceIndentifer ) );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private Object createInstance( final String i_serviceName ) throws Exception
+ {
+ Object instance = m_context.getServiceManager().createInstanceWithContext( i_serviceName, m_context );
+ assertNotNull( "could not create an instance of '" + i_serviceName + "'", instance );
+ return instance;
+ }
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final class DisposeListener implements XEventListener
+ {
+ DisposeListener( final Object i_component )
+ {
+ m_component = UnoRuntime.queryInterface( XComponent.class, i_component );
+ assertNotNull( m_component );
+ m_component.addEventListener( this );
+ }
+
+ public void disposing( EventObject i_event )
+ {
+ assertTrue( UnoRuntime.areSame( i_event.Source, m_component ) );
+ m_isDisposed = true;
+ }
+
+ final boolean isDisposed() { return m_isDisposed; }
+
+ private final XComponent m_component;
+ private boolean m_isDisposed;
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final class ColumnModelListener implements XContainerListener
+ {
+ ColumnModelListener()
+ {
+ }
+
+ public void elementInserted( ContainerEvent i_event )
+ {
+ m_insertionEvents.add( i_event );
+ }
+
+ public void elementRemoved( ContainerEvent i_event )
+ {
+ m_removalEvents.add( i_event );
+ }
+
+ public void elementReplaced( ContainerEvent i_event )
+ {
+ m_replacementEvents.add( i_event );
+ }
+
+ public void disposing( EventObject eo )
+ {
+ m_isDisposed = true;
+ }
+
+ private List< ContainerEvent > assertExclusiveInsertionEvents()
+ {
+ assertFalse( m_insertionEvents.isEmpty() );
+ assertTrue( m_removalEvents.isEmpty() );
+ assertTrue( m_replacementEvents.isEmpty() );
+ return m_insertionEvents;
+ }
+
+ private List< ContainerEvent > assertExclusiveRemovalEvents()
+ {
+ assertTrue( m_insertionEvents.isEmpty() );
+ assertFalse( m_removalEvents.isEmpty() );
+ assertTrue( m_replacementEvents.isEmpty() );
+ return m_removalEvents;
+ }
+
+ private void reset()
+ {
+ m_insertionEvents = new ArrayList< ContainerEvent >();
+ m_removalEvents = new ArrayList< ContainerEvent >();
+ m_replacementEvents = new ArrayList< ContainerEvent >();
+ }
+
+ private List< ContainerEvent > getInsertionEvents() { return m_insertionEvents; }
+ private List< ContainerEvent > getRemovalEvents() { return m_removalEvents; }
+
+ final boolean isDisposed() { return m_isDisposed; }
+
+ private List< ContainerEvent > m_insertionEvents = new ArrayList< ContainerEvent >();
+ private List< ContainerEvent > m_removalEvents = new ArrayList< ContainerEvent >();
+ private List< ContainerEvent > m_replacementEvents = new ArrayList< ContainerEvent >();
+ private boolean m_isDisposed = false;
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final OfficeConnection m_connection = new OfficeConnection();
+ private static Random m_randomGenerator = new Random();
+ private final XComponentContext m_context;
+
+ private XPropertySet m_gridControlModel;
+ private XGridColumnModel m_columnModel;
+ private XSortableMutableGridDataModel m_dataModel;
+}
diff --git a/toolkit/qa/complex/toolkit/UnitConversion.java b/toolkit/qa/complex/toolkit/UnitConversion.java
new file mode 100644
index 000000000000..b4cf8a8e1490
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/UnitConversion.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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.toolkit;
+
+import com.sun.star.awt.XUnitConversion;
+import com.sun.star.uno.UnoRuntime;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.awt.XWindowPeer;
+
+import util.DesktopTools;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ * This complex test is only for testing the com.sun.star.awt.XUnitConversion methods
+ * These are converter methods to get the size of a well known awt component
+ * in a com.sun.star.util.MeasureUnit you want.
+ * You don't need to know the factors to calculate by hand.
+ *
+ * @author ll93751
+ */
+public class UnitConversion
+{
+ /**
+ * returns the delta value between a and b
+ * @param a
+ * @param b
+ * @return
+ */
+ private int delta(int a, int b)
+ {
+ final int n = Math.abs(a - b);
+ return n;
+ }
+
+ private XUnitConversion m_xConversion = null;
+
+ /**
+ * Not really a check,
+ * only a simple test call to convertSizeToLogic(...) with different parameters
+ * @param _aSize
+ * @param _aMeasureUnit
+ * @param _sEinheit
+ */
+ private void checkSize(com.sun.star.awt.Size _aSize, short _aMeasureUnit, String _sEinheit)
+ {
+ try
+ {
+ com.sun.star.awt.Size aSizeIn = m_xConversion.convertSizeToLogic(_aSize, _aMeasureUnit);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeIn.Width + " " + _sEinheit);
+ System.out.println("Height:" + aSizeIn.Height + " " + _sEinheit);
+ System.out.println("");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ System.out.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
+ }
+ }
+
+ /**
+ * The real test function
+ * 1. try to get the XMultiServiceFactory of an already running office. Therefore make sure an (open|star)office is running with
+ * parameters like -accept="socket,host=localhost,port=8100;urp;"
+ * 2. try to create an empty window
+ * 3. try to convert the WindowPeer to an XWindow
+ * 4. try to resize and move the window to an other position, so we get a well knowing position and size.
+ * 5. run some more tests
+ *
+ * If no test fails, the test is well done and returns with 'PASSED, OK'
+ *
+ */
+ @Test
+ public void testXUnitConversion()
+ {
+ final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+
+ assertNotNull("failed: There is no office.", xMSF);
+
+ // create a window
+ XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
+ assertNotNull("failed: there is no window peer", xWindowPeer);
+
+
+ // resize and move the window to a well known position and size
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
+ assertNotNull("failed: there is no window, cast wrong?", xWindow);
+
+ xWindow.setVisible(Boolean.TRUE);
+
+ int x = 100;
+ int y = 100;
+ int width = 640;
+ int height = 480;
+ xWindow.setPosSize(x, y, width, height, com.sun.star.awt.PosSize.POSSIZE);
+
+ com.sun.star.awt.Rectangle aRect = xWindow.getPosSize();
+ com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
+ com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);
+
+ System.out.println("Window position and size in pixel:");
+ System.out.println("X:" + aPoint.X);
+ System.out.println("Y:" + aPoint.Y);
+ System.out.println("Width:" + aSize.Width);
+ System.out.println("Height:" + aSize.Height);
+ System.out.println("");
+
+ assertTrue("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
+
+ m_xConversion = UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
+
+ // try to get the position of the window in 1/100mm with the XUnitConversion method
+ try
+ {
+ com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window position:");
+ System.out.println("X:" + aPointInMM_100TH.X + " 1/100mm");
+ System.out.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
+ System.out.println("");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage());
+ }
+
+ // try to get the size of the window in 1/100mm with the XUnitConversion method
+ com.sun.star.awt.Size aSizeInMM_100TH = null;
+ com.sun.star.awt.Size aSizeInMM_10TH = null;
+ try
+ {
+ aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
+ System.out.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
+ System.out.println("");
+
+ // try to get the size of the window in 1/10mm with the XUnitConversion method
+
+ aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
+ System.out.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
+ System.out.println("");
+
+ // check the size with a delta which must be smaller a given difference
+ assertTrue("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
+ assertTrue("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
+
+ // new
+ checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.APPFONT, "appfont");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.SYSFONT, "sysfont");
+
+ // simply check some more parameters
+ checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_1000TH, "1/1000inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_100TH, "1/100inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_10TH, "1/10inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH, "inch");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.M, "m");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.POINT, "point");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.TWIP, "twip");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.KM, "km");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.PICA, "pica");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.FOOT, "foot");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.MILE, "mile");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage());
+ }
+
+ // convert the 1/100mm window size back to pixel
+ try
+ {
+ com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aNewSize.Width + " pixel");
+ System.out.println("Height:" + aNewSize.Height + " pixel");
+
+ // assure the pixels are the same as we already know
+ assertTrue("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage());
+ }
+
+ // close the window.
+ // IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
+ xWindow.dispose();
+ }
+
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "starting class: " + UnitConversion.class.getName() );
+ System.out.println( "connecting ..." );
+ connection.setUp();
+ }
+
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println();
+ System.out.println( "tearing down connection" );
+ connection.tearDown();
+ System.out.println( "finished class: " + UnitConversion.class.getName() );
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java
index 5c3a58c35f16..d1025979a0bf 100644
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleComponent.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java
@@ -25,9 +25,8 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit.accessibility;
-import share.LogWriter;
import com.sun.star.awt.Point;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.Size;
@@ -56,7 +55,7 @@ import java.util.Vector;
*/
public class _XAccessibleComponent {
- private LogWriter log;
+ // private LogWriter log;
public XAccessibleComponent oObj = null;
@@ -67,11 +66,12 @@ public class _XAccessibleComponent {
/**
* Constructor
+ * @param object
*/
- public _XAccessibleComponent(XInterface object, LogWriter log) {
- oObj = (XAccessibleComponent)UnoRuntime.queryInterface(
+ public _XAccessibleComponent(XInterface object/*, LogWriter log*/) {
+ oObj = UnoRuntime.queryInterface(
XAccessibleComponent.class, object);
- this.log = log;
+ // this.log = log;
}
/**
@@ -87,7 +87,8 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> : to have size of a component.</li>
* </ul>
- */
+ * @return
+ */
public boolean _containsPoint() {
boolean result = true ;
@@ -96,13 +97,13 @@ public class _XAccessibleComponent {
//while (!oObj.containsPoint(new Point(curX, bounds.Y)) && curX < bounds.Width+bounds.X) {
while (!oObj.containsPoint(new Point(curX, 0)) && curX < bounds.Width) {
curX++;
- };
+ }
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
- log.println("Upper bound of box contains point ("
+ System.out.println("Upper bound of box contains point ("
+ curX + ",0) - OK");
} else {
- log.println
+ System.out.println
("Upper bound of box contains no component points - FAILED");
result = false;
}
@@ -112,15 +113,15 @@ public class _XAccessibleComponent {
while (!oObj.containsPoint(new Point(curX, bounds.Height - 1))
&& curX < bounds.Width) {
- log.println("Contains returns false for ("+curX+","+bounds.Height+")");
+ System.out.println("Contains returns false for ("+curX+","+bounds.Height+")");
curX++;
- };
+ }
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
- log.println("Lower bound of box contains point ("
+ System.out.println("Lower bound of box contains point ("
+ curX + "," + (bounds.Height - 1) + ") - OK");
} else {
- log.println
+ System.out.println
("Lower bound of box contains no component points - FAILED");
result = false;
}
@@ -129,13 +130,13 @@ public class _XAccessibleComponent {
//while (!oObj.containsPoint(new Point(bounds.X, curY)) && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(0, curY)) && curY < bounds.Height) {
curY++;
- };
+ }
//if ((bounds.Y <= curY) && (curY < bounds.Height+bounds.Y)) {
if (curY < bounds.Height) {
- log.println("Left bound of box contains point (0,"
+ System.out.println("Left bound of box contains point (0,"
+ curY + ") - OK");
} else {
- log.println
+ System.out.println
("Left bound of box contains no component points - FAILED");
result = false;
}
@@ -145,13 +146,13 @@ public class _XAccessibleComponent {
// && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(bounds.Width - 1, curY)) && curY < bounds.Height) {
curY++;
- };
+ }
//if ((bounds.Y <= curY) && (curY < bounds.Height + bounds.Y)) {
if (curY < bounds.Height) {
- log.println("Right bound of box contains point ("
+ System.out.println("Right bound of box contains point ("
+ (bounds.Width - 1) + "," + curY + ") - OK");
} else {
- log.println
+ System.out.println
("Right bound of box contains no component points - FAILED");
result = false;
}
@@ -162,10 +163,10 @@ public class _XAccessibleComponent {
locRes &= !oObj.containsPoint(new Point(x, bounds.Height+bounds.Y));
}
if (locRes) {
- log.println("Outer upper and lower bounds contain no component "
+ System.out.println("Outer upper and lower bounds contain no component "
+ "points - OK");
} else {
- log.println("Outer upper and lower bounds CONTAIN some component "
+ System.out.println("Outer upper and lower bounds CONTAIN some component "
+ "points - FAILED");
result = false;
}
@@ -176,10 +177,10 @@ public class _XAccessibleComponent {
locRes &= !oObj.containsPoint(new Point(bounds.X+bounds.Width, y));
}
if (locRes) {
- log.println("Outer left and right bounds contain no component "
+ System.out.println("Outer left and right bounds contain no component "
+ "points - OK");
} else {
- log.println("Outer left and right bounds CONTAIN some component "
+ System.out.println("Outer left and right bounds CONTAIN some component "
+ "points - FAILED");
result = false;
}
@@ -198,6 +199,7 @@ public class _XAccessibleComponent {
* Has <b> OK </b> status if in the first cases the right children
* are returned, and in the second <code>null</code> or
* another child is returned.
+ * @return
*/
public boolean _getAccessibleAtPoint() {
@@ -207,23 +209,26 @@ public class _XAccessibleComponent {
if (children.length > 0) {
for (int i = 0; i < children.length; i++) {
Rectangle chBnd = children[i].getBounds();
- if (chBnd.X == -1) continue;
- log.println("Checking child with bounds " +
+ if (chBnd.X == -1)
+ {
+ continue;
+ }
+ System.out.println("Checking child with bounds " +
"(" + chBnd.X + "," + chBnd.Y + "),("
+ chBnd.Width + "," + chBnd.Height + "): "
+ util.AccessibilityTools.accessibleToString(children[i]));
- log.println("finding the point which lies on the component");
+ System.out.println("finding the point which lies on the component");
int curX = 0;
int curY = 0;
while (!children[i].containsPoint(new Point(curX, curY))
&& curX < chBnd.Width) {
curX++;
curY++;
- };
+ }
if (curX==chBnd.Width) {
- log.println("Couldn't find a point with contains");
+ System.out.println("Couldn't find a point with contains");
continue;
}
@@ -231,29 +236,29 @@ public class _XAccessibleComponent {
XAccessible xAcc = oObj.getAccessibleAtPoint
(new Point(chBnd.X , chBnd.Y));
if (xAcc == null) {
- log.println("The child not found at point ("
+ System.out.println("The child not found at point ("
+ (chBnd.X ) + "," + chBnd.Y + ") - FAILED");
result = false;
} else {
- XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
+ XAccessible xAccCh = UnoRuntime.queryInterface
(XAccessible.class, children[i]);
- log.println("Child found at point ("
+ System.out.println("Child found at point ("
+ (chBnd.X ) + "," + chBnd.Y + ") - OK");
boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
if (!res) {
int expIndex = xAccCh.getAccessibleContext().getAccessibleIndexInParent();
int gotIndex = xAcc.getAccessibleContext().getAccessibleIndexInParent();
if (expIndex < gotIndex) {
- log.println("The children found is not the same");
- log.println("The expected child " +
+ System.out.println("The children found is not the same");
+ System.out.println("The expected child " +
xAccCh.getAccessibleContext().getAccessibleName());
- log.println("is hidden behind the found Child ");
- log.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
+ System.out.println("is hidden behind the found Child ");
+ System.out.println(xAcc.getAccessibleContext().getAccessibleName()+" - OK");
} else {
- log.println("The children found is not the same - FAILED");
- log.println("Expected: "
+ System.out.println("The children found is not the same - FAILED");
+ System.out.println("Expected: "
+xAccCh.getAccessibleContext().getAccessibleName());
- log.println("Found: "
+ System.out.println("Found: "
+xAcc.getAccessibleContext().getAccessibleName());
result = false ;
}
@@ -264,22 +269,21 @@ public class _XAccessibleComponent {
xAcc = oObj.getAccessibleAtPoint
(new Point(chBnd.X - 1, chBnd.Y - 1));
if (xAcc == null) {
- log.println("No children found at point ("
+ System.out.println("No children found at point ("
+ (chBnd.X - 1) + "," + (chBnd.Y - 1) + ") - OK");
result &= true;
} else {
- XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, children[i]);
+ XAccessible xAccCh = UnoRuntime.queryInterface(XAccessible.class, children[i]);
boolean res = util.AccessibilityTools.equals(xAccCh, xAcc);
if (res) {
- log.println("The same child found outside "
+ System.out.println("The same child found outside "
+ "its bounds - FAILED");
result = false ;
}
}
}
} else {
- log.println("There are no children supporting "
+ System.out.println("There are no children supporting "
+ "XAccessibleComponent");
}
@@ -291,6 +295,7 @@ public class _XAccessibleComponent {
*
* Has <b> OK </b> status if boundary position (x,y) is not negative
* and size (Width, Height) is greater than 0.
+ * @return
*/
public boolean _getBounds() {
boolean result = true ;
@@ -300,7 +305,7 @@ public class _XAccessibleComponent {
&& bounds.X >=0 && bounds.Y >=0
&& bounds.Width >0 && bounds.Height >0;
- log.println("Bounds = " + (bounds != null
+ System.out.println("Bounds = " + (bounds != null
? "(" + bounds.X + "," + bounds.Y + "),("
+ bounds.Width + "," + bounds.Height + ")" : "null"));
@@ -317,6 +322,7 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> : to have bounds </li>
* </ul>
+ * @return
*/
public boolean _getLocation() {
@@ -341,6 +347,7 @@ public class _XAccessibleComponent {
* <li> <code> getBounds() </code> : to have location of the component
* relative to its parent</li>
* </ul>
+ * @return
*/
public boolean _getLocationOnScreen() {
@@ -348,11 +355,11 @@ public class _XAccessibleComponent {
boolean result = true ;
Point loc = oObj.getLocationOnScreen();
- log.println("Location is (" + loc.X + "," + loc.Y + ")");
+ System.out.println("Location is (" + loc.X + "," + loc.Y + ")");
if (parent != null) {
Point parLoc = parent.getLocationOnScreen();
- log.println("Parent location is ("
+ System.out.println("Parent location is ("
+ parLoc.X + "," + parLoc.Y + ")");
result &= parLoc.X + bounds.X == loc.X;
@@ -371,6 +378,7 @@ public class _XAccessibleComponent {
* <ul>
* <li> <code> getBounds() </code> </li>
* </ul>
+ * @return
*/
public boolean _getSize() {
@@ -387,6 +395,7 @@ public class _XAccessibleComponent {
* Just calls the method. <p>
*
* Has <b> OK </b> status if no runtime exceptions occurred.
+ * @return
*/
public boolean _grabFocus() {
@@ -404,26 +413,26 @@ public class _XAccessibleComponent {
* such children were not found or some error occurred.
*/
private XAccessibleComponent[] getChildrenComponents() {
- XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, oObj) ;
+ XAccessible xAcc = UnoRuntime.queryInterface(XAccessible.class, oObj) ;
if (xAcc == null) {
- log.println("Component doesn't support XAccessible.");
+ System.out.println("Component doesn't support XAccessible.");
return new XAccessibleComponent[0];
}
XAccessibleContext xAccCon = xAcc.getAccessibleContext();
int cnt = xAccCon.getAccessibleChildCount();
// for cases when too many children exist checking only first 50
- if (cnt > 50) cnt = 50 ;
+ if (cnt > 50)
+ {
+ cnt = 50;
+ }
Vector childComp = new Vector();
for (int i = 0; i < cnt; i++) {
try {
XAccessible child = xAccCon.getAccessibleChild(i);
XAccessibleContext xAccConCh = child.getAccessibleContext();
- XAccessibleComponent xChAccComp = (XAccessibleComponent)
- UnoRuntime.queryInterface(XAccessibleComponent.class,
- xAccConCh);
+ XAccessibleComponent xChAccComp = UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConCh);
if (xChAccComp != null) {
childComp.add(xChAccComp) ;
}
@@ -442,10 +451,9 @@ public class _XAccessibleComponent {
* has no parent or some errors occurred.
*/
private XAccessibleComponent getParentComponent() {
- XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface
- (XAccessible.class, oObj) ;
+ XAccessible xAcc = UnoRuntime.queryInterface(XAccessible.class, oObj) ;
if (xAcc == null) {
- log.println("Component doesn't support XAccessible.");
+ System.out.println("Component doesn't support XAccessible.");
return null;
}
@@ -453,14 +461,13 @@ public class _XAccessibleComponent {
XAccessible xAccPar = xAccCon.getAccessibleParent();
if (xAccPar == null) {
- log.println("Component has no accessible parent.");
+ System.out.println("Component has no accessible parent.");
return null;
}
XAccessibleContext xAccConPar = xAccPar.getAccessibleContext();
- XAccessibleComponent parent = (XAccessibleComponent)
- UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConPar);
+ XAccessibleComponent parent = UnoRuntime.queryInterface(XAccessibleComponent.class, xAccConPar);
if (parent == null) {
- log.println
+ System.out.println
("Accessible parent doesn't support XAccessibleComponent");
return null;
}
@@ -470,19 +477,21 @@ public class _XAccessibleComponent {
/**
* Just calls the method.
+ * @return
*/
public boolean _getForeground() {
int forColor = oObj.getForeground();
- log.println("getForeground(): " + forColor);
+ System.out.println("getForeground(): " + forColor);
return true;
}
/**
* Just calls the method.
+ * @return
*/
public boolean _getBackground() {
int backColor = oObj.getBackground();
- log.println("getBackground(): " + backColor);
+ System.out.println("getBackground(): " + backColor);
return true;
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java
index 230eb3d098d3..14debda92cd8 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleContext.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit.accessibility;
import com.sun.star.lang.Locale;
import com.sun.star.uno.XInterface;
@@ -35,9 +35,9 @@ import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleRelationSet;
import com.sun.star.accessibility.XAccessibleStateSet;
-import com.sun.star.accessibility.AccessibleRelationType;
+// import com.sun.star.accessibility.AccessibleRelationType;
import util.AccessibilityTools;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleContext</code>
@@ -59,7 +59,7 @@ import share.LogWriter;
*/
public class _XAccessibleContext {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleContext" ;
@@ -69,19 +69,19 @@ public class _XAccessibleContext {
private int childCount = 0;
private XAccessible parent = null ;
- public _XAccessibleContext(XInterface object, LogWriter log) {
- oObj = (XAccessibleContext)UnoRuntime.queryInterface(
- XAccessibleContext.class, object);
- this.log = log;
+ public _XAccessibleContext(XInterface object) {
+ oObj = UnoRuntime.queryInterface(XAccessibleContext.class, object);
+ // this.log = log;
}
/**
* Calls the method and stores the number of children. <p>
* Has <b> OK </b> status if non-negative number rutrned.
+ * @return
*/
public boolean _getAccessibleChildCount() {
childCount = oObj.getAccessibleChildCount();
- log.println("" + childCount + " children found.");
+ System.out.println("" + childCount + " children found.");
return childCount > -1;
}
@@ -96,40 +96,44 @@ public class _XAccessibleContext {
* <li> <code> getAccessibleChildCount() </code> : to have a number of
* children </li>
* </ul>
+ * @return
*/
public boolean _getAccessibleChild() {
boolean bOK = true;
int counter = childCount;
- if (childCount > 500) counter = 500;
+ if (childCount > 500)
+ {
+ counter = 500;
+ }
for (int i = 0; i < counter; i++) {
try {
XAccessible ch = oObj.getAccessibleChild(i) ;
XAccessibleContext chAC = ch.getAccessibleContext();
- log.println(" Child " + i + ": " +
+ System.out.println(" Child " + i + ": " +
chAC.getAccessibleDescription()) ;
if (!AccessibilityTools.equals
(chAC.getAccessibleParent().getAccessibleContext(), oObj)){
- log.println("Role:");
- log.println("Getting: "+chAC.getAccessibleParent().getAccessibleContext().getAccessibleRole());
- log.println("Expected: "+oObj.getAccessibleRole());
+ System.out.println("Role:");
+ System.out.println("Getting: "+chAC.getAccessibleParent().getAccessibleContext().getAccessibleRole());
+ System.out.println("Expected: "+oObj.getAccessibleRole());
- log.println("ImplementationName:");
- log.println("Getting: "+util.utils.getImplName(chAC.getAccessibleParent().getAccessibleContext()));
- log.println("Expected: "+util.utils.getImplName(oObj));
+ System.out.println("ImplementationName:");
+ System.out.println("Getting: "+util.utils.getImplName(chAC.getAccessibleParent().getAccessibleContext()));
+ System.out.println("Expected: "+util.utils.getImplName(oObj));
- log.println("The parent of child and component "+
+ System.out.println("The parent of child and component "+
"itself differ.");
- log.println("Getting(Description): "
+ System.out.println("Getting(Description): "
+chAC.getAccessibleParent().getAccessibleContext().getAccessibleDescription());
- log.println("Expected(Description): "
+ System.out.println("Expected(Description): "
+oObj.getAccessibleDescription());
bOK = false;
} else {
- log.println("Getting the expected Child -- OK");
+ System.out.println("Getting the expected Child -- OK");
}
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
e.printStackTrace();
@@ -144,6 +148,7 @@ public class _XAccessibleContext {
* Just gets the parent. <p>
*
* Has <b> OK </b> status if parent is not null.
+ * @return
*/
public boolean _getAccessibleParent() {
// assume that the component is not ROOT
@@ -163,6 +168,7 @@ public class _XAccessibleContext {
* <ul>
* <li> <code> getAccessibleParent() </code> : to have a parent </li>
* </ul>
+ * @return
*/
public boolean _getAccessibleIndexInParent() {
@@ -174,8 +180,8 @@ public class _XAccessibleContext {
bOK &= AccessibilityTools.equals(
parentAC.getAccessibleChild(idx).getAccessibleContext(),oObj);
if (!bOK) {
- log.println("Expected: "+util.utils.getImplName(oObj));
- log.println("Getting: "+util.utils.getImplName(
+ System.out.println("Expected: "+util.utils.getImplName(oObj));
+ System.out.println("Getting: "+util.utils.getImplName(
parentAC.getAccessibleChild(idx).getAccessibleContext()));
}
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
@@ -189,10 +195,11 @@ public class _XAccessibleContext {
* Get the accessible role of component. <p>
*
* Has <b> OK </b> status if non-negative number rutrned.
+ * @return
*/
public boolean _getAccessibleRole() {
short role = oObj.getAccessibleRole();
- log.println("The role is " + role);
+ System.out.println("The role is " + role);
return role > -1;
}
@@ -200,10 +207,11 @@ public class _XAccessibleContext {
* Get the accessible name of the component. <p>
*
* Has <b> OK </b> status if the name has non-zero length.
+ * @return
*/
public boolean _getAccessibleName() {
String name = oObj.getAccessibleName();
- log.println("The name is '" + name + "'");
+ System.out.println("The name is '" + name + "'");
return name != null;
}
@@ -211,10 +219,11 @@ public class _XAccessibleContext {
* Get the accessible description of the component. <p>
*
* Has <b> OK </b> status if the description has non-zero length.
+ * @return
*/
public boolean _getAccessibleDescription() {
String descr = oObj.getAccessibleDescription();
- log.println("The description is '" + descr + "'");
+ System.out.println("The description is '" + descr + "'");
return descr != null;
}
@@ -222,6 +231,7 @@ public class _XAccessibleContext {
* Just gets the set. <p>
*
* Has <b> OK </b> status if the set is not null.
+ * @return
*/
public boolean _getAccessibleRelationSet() {
XAccessibleRelationSet set = oObj.getAccessibleRelationSet();
@@ -232,6 +242,7 @@ public class _XAccessibleContext {
* Just gets the set. <p>
*
* Has <b> OK </b> status if the set is not null.
+ * @return
*/
public boolean _getAccessibleStateSet() {
XAccessibleStateSet set = oObj.getAccessibleStateSet();
@@ -244,12 +255,13 @@ public class _XAccessibleContext {
* Has <b> OK </b> status if <code>Country</code> and
* <code>Language</code> fields of locale structure
* are not empty.
+ * @return
*/
public boolean _getLocale() {
Locale loc = null ;
try {
loc = oObj.getLocale();
- log.println("The locale is " + loc.Language + "," + loc.Country);
+ System.out.println("The locale is " + loc.Language + "," + loc.Country);
} catch (IllegalAccessibleComponentStateException e) {
e.printStackTrace();
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java
index 18a20d02e233..535c7ce36c68 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleEventBroadcaster.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit.accessibility;
import com.sun.star.lang.EventObject;
import com.sun.star.awt.Rectangle;
@@ -33,13 +33,11 @@ import com.sun.star.awt.PosSize;
import com.sun.star.awt.XWindow;
import com.sun.star.accessibility.AccessibleEventObject;
import com.sun.star.accessibility.XAccessible;
-import com.sun.star.accessibility.XAccessibleComponent;
import com.sun.star.accessibility.XAccessibleEventBroadcaster;
import com.sun.star.accessibility.XAccessibleEventListener;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
/**
* Testing <code>
@@ -62,12 +60,7 @@ import share.LogWriter;
*/
public class _XAccessibleEventBroadcaster {
- private LogWriter log;
- private static final String className =
- "com.sun.star.accessibility.XAccessibleEventBroadcaster" ;
-
public XAccessibleEventBroadcaster oObj = null;
- public String EventMsg = "";
EventProducer prod = null ;
EvListener list = new EvListener();
@@ -97,7 +90,7 @@ public class _XAccessibleEventBroadcaster {
private class EvListener implements XAccessibleEventListener {
public AccessibleEventObject notifiedEvent = null ;
public void notifyEvent(AccessibleEventObject ev) {
- log.println("Listener, Event : " + ev.EventId);
+ System.out.println("Listener, Event : " + ev.EventId);
System.out.println("EventID: " + ev.EventId);
Object old=ev.OldValue;
if (old instanceof com.sun.star.accessibility.XAccessible) {
@@ -116,24 +109,25 @@ public class _XAccessibleEventBroadcaster {
/**
* c'tor
+ * @param object
+ * @param eventMessage
+ * @param window
*/
- public _XAccessibleEventBroadcaster(XInterface object, LogWriter log, String eventMessage, XWindow window) {
- oObj = (XAccessibleEventBroadcaster)UnoRuntime.queryInterface(
- XAccessibleEventBroadcaster.class, object);
- this.log = log;
+ public _XAccessibleEventBroadcaster(XInterface object, XWindow window) {
+ oObj = UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, object);
prod = new EventProducer(window);
- EventMsg = eventMessage;
}
/**
* Adds two listeners and fires event by mean of object relation. <p>
* Has <b> OK </b> status if both listeners were called
+ * @return
*/
public boolean _addEventListener() {
- log.println("adding two listeners");
+ System.out.println("adding two listeners");
oObj.addEventListener(list);
boolean isTransient = chkTransient(oObj);
- log.println("fire event");
+ System.out.println("fire event");
prod.fireEvent() ;
try {
@@ -146,15 +140,14 @@ public class _XAccessibleEventBroadcaster {
if (list.notifiedEvent == null) {
if (!isTransient) {
- log.println("listener wasn't called");
+ System.out.println("listener wasn't called");
works = false;
} else {
- log.println("Object is Transient, listener isn't expected to be called");
+ System.out.println("Object is Transient, listener isn't expected to be called");
}
oObj.removeEventListener(list);
}
-// log.println(EventMsg);
return works;
}
@@ -168,15 +161,16 @@ public class _XAccessibleEventBroadcaster {
* <ul>
* <li> <code>addEventListener()</code> : to have added listeners </li>
* </ul>
+ * @return
*/
public boolean _removeEventListener() {
list.notifiedEvent = null;
- log.println("remove first listener");
+ System.out.println("remove first listener");
oObj.removeEventListener(list);
- log.println("fire event");
+ System.out.println("fire event");
prod.fireEvent() ;
try {
@@ -186,7 +180,7 @@ public class _XAccessibleEventBroadcaster {
}
if (list.notifiedEvent == null) {
- log.println("listener wasn't called -- OK");
+ System.out.println("listener wasn't called -- OK");
}
return list.notifiedEvent == null;
@@ -194,8 +188,7 @@ public class _XAccessibleEventBroadcaster {
}
protected static boolean chkTransient(Object Testcase) {
- XAccessibleContext accCon = (XAccessibleContext)
- UnoRuntime.queryInterface(XAccessibleContext.class,Testcase);
+ XAccessibleContext accCon = UnoRuntime.queryInterface(XAccessibleContext.class, Testcase);
if (accCon.getAccessibleStateSet().contains(
com.sun.star.accessibility.AccessibleStateType.TRANSIENT)){
if (!accCon.getAccessibleParent().getAccessibleContext().getAccessibleStateSet().contains(
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java
index e022e60d90c0..551b00acada7 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleExtendedComponent.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java
@@ -25,16 +25,16 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit.accessibility;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
import com.sun.star.accessibility.XAccessibleExtendedComponent;
-import com.sun.star.accessibility.XAccessibleStateSet;
-import com.sun.star.accessibility.AccessibleStateType;
+// import com.sun.star.accessibility.XAccessibleStateSet;
+// import com.sun.star.accessibility.AccessibleStateType;
import com.sun.star.awt.XFont;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleExtendedComponent</code>
@@ -51,7 +51,7 @@ import share.LogWriter;
*/
public class _XAccessibleExtendedComponent {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleExtendedComponent" ;
@@ -62,38 +62,40 @@ public class _XAccessibleExtendedComponent {
return className;
}
- public _XAccessibleExtendedComponent(XInterface object, LogWriter log) {
- oObj = (XAccessibleExtendedComponent)UnoRuntime.queryInterface(
- XAccessibleExtendedComponent.class, object);
- this.log = log;
+ public _XAccessibleExtendedComponent(XInterface object/*, LogWriter log*/) {
+ oObj = UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, object);
+ // this.log = log;
}
/**
* Just calls the method.
+ * @return
*/
public boolean _getFont() {
XFont font = oObj.getFont();
- log.println("getFont(): " + font);
+ System.out.println("getFont(): " + font);
return true;
}
/**
* Calls the method and checks returned value.
* Has OK status if returned value isn't null.
+ * @return
*/
public boolean _getTitledBorderText() {
String titleBorderText = oObj.getTitledBorderText();
- log.println("getTitledBorderText(): '" + titleBorderText + "'");
+ System.out.println("getTitledBorderText(): '" + titleBorderText + "'");
return titleBorderText != null;
}
/**
* Calls the method and checks returned value.
* Has OK status if returned value isn't null.
+ * @return
*/
public boolean _getToolTipText() {
String toolTipText = oObj.getToolTipText();
- log.println("getToolTipText(): '" + toolTipText + "'");
+ System.out.println("getToolTipText(): '" + toolTipText + "'");
return toolTipText != null;
}
}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java
index d6357e8f24bc..a12d93a2d9e2 100755
--- a/toolkit/qa/complex/toolkit/interface_tests/_XAccessibleText.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java
@@ -25,10 +25,10 @@
*
************************************************************************/
-package complex.toolkit.interface_tests;
+package complex.toolkit.accessibility;
import com.sun.star.accessibility.XAccessibleText;
-import lib.MultiMethodTest;
+// import lib.MultiMethodTest;
//import lib.StatusException;
//import lib.Status;
import com.sun.star.beans.PropertyValue;
@@ -39,7 +39,7 @@ import com.sun.star.accessibility.AccessibleTextType;
import com.sun.star.accessibility.TextSegment;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+// import share.LogWriter;
/**
* Testing <code>com.sun.star.accessibility.XAccessibleText</code>
@@ -76,7 +76,7 @@ import share.LogWriter;
*/
public class _XAccessibleText {
- private LogWriter log;
+ // private LogWriter log;
private static final String className =
"com.sun.star.accessibility.XAccessibleText" ;
@@ -91,11 +91,10 @@ public class _XAccessibleText {
String editOnly = null;
- public _XAccessibleText(XInterface object, LogWriter log, XMultiServiceFactory xMSF, String editOnly) {
- oObj = (XAccessibleText)UnoRuntime.queryInterface(
- XAccessibleText.class, object);
+ public _XAccessibleText(XInterface object, XMultiServiceFactory xMSF, String editOnly) {
+ oObj = UnoRuntime.queryInterface(XAccessibleText.class, object);
this.xMSF = xMSF;
- this.log = log;
+ // this.log = log;
this.editOnly = editOnly;
}
@@ -107,11 +106,12 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setCaretPosition()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCaretPosition() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
@@ -123,7 +123,7 @@ public class _XAccessibleText {
}
int carPos = oObj.getCaretPosition();
- log.println("getCaretPosition: " + carPos);
+ System.out.println("getCaretPosition: " + carPos);
res = carPos == (chCount - 1);
}
return res;
@@ -138,36 +138,37 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _setCaretPosition() {
boolean res = true;
try {
- log.println("setCaretPosition(-1):");
+ System.out.println("setCaretPosition(-1):");
oObj.setCaretPosition(-1);
res &= false;
- log.println("exception was expected");
+ System.out.println("exception was expected");
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("expected exception");
+ System.out.println("expected exception");
res &= true;
}
try {
- log.println("setCaretPosition(chCount+1):");
+ System.out.println("setCaretPosition(chCount+1):");
oObj.setCaretPosition(chCount+1);
res &= false;
- log.println("exception was expected");
+ System.out.println("exception was expected");
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("expected exception");
+ System.out.println("expected exception");
res &= true;
}
if ( chCount > 0 ) {
try {
- log.println("setCaretPosition(chCount - 1)");
+ System.out.println("setCaretPosition(chCount - 1)");
oObj.setCaretPosition(chCount - 1);
res &= true;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("unexpected exception");
+ System.out.println("unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -186,46 +187,47 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacter() {
boolean res = true;
try {
- log.println("getCharacter(-1)");
+ System.out.println("getCharacter(-1)");
oObj.getCharacter(-1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res = false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res = true;
}
try {
- log.println("getCharacter(chCount)");
+ System.out.println("getCharacter(chCount)");
oObj.getCharacter(chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("Checking of every character in the text...");
+ System.out.println("Checking of every character in the text...");
boolean isEqCh = true;
for(int i = 0; i < chCount; i++) {
char ch = oObj.getCharacter(i);
isEqCh = ch == text.charAt(i);
res &= isEqCh;
if (!isEqCh) {
- log.println("At the position " + i +
+ System.out.println("At the position " + i +
"was expected character: " + text.charAt(i));
- log.println("but was returned: " + ch);
+ System.out.println("but was returned: " + ch);
break;
}
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -243,38 +245,39 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacterAttributes() {
boolean res = true;
try {
- log.println("getCharacterAttributes(-1)");
+ System.out.println("getCharacterAttributes(-1)");
oObj.getCharacterAttributes(-1, new String[0]);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getCharacterAttributes(chCount)");
+ System.out.println("getCharacterAttributes(chCount)");
oObj.getCharacterAttributes(chCount, new String[0]);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getCharacterAttributes(chCount-1)");
+ System.out.println("getCharacterAttributes(chCount-1)");
PropertyValue[] props = oObj.getCharacterAttributes(chCount - 1, new String[0]);
res &= props != null;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -293,41 +296,42 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getCharacterBounds() {
boolean res = true;
try {
- log.println("getCharacterBounds(-1)");
+ System.out.println("getCharacterBounds(-1)");
oObj.getCharacterBounds(-1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getCharacterBounds(chCount)");
+ System.out.println("getCharacterBounds(chCount)");
oObj.getCharacterBounds(chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if (chCount > 0) {
- log.println("getCharacterBounds(chCount-1)");
+ System.out.println("getCharacterBounds(chCount-1)");
chBounds = oObj.getCharacterBounds(chCount-1);
res &= chBounds != null;
- log.println("rect: " + chBounds.X + ", " + chBounds.Y + ", " +
+ System.out.println("rect: " + chBounds.X + ", " + chBounds.Y + ", " +
chBounds.Width + ", " + chBounds.Height);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -340,10 +344,11 @@ public class _XAccessibleText {
* Calls the method and stores a returned value to the variable
* <code>chCount</code>.
* Has OK status if a returned value is equal to the text length.
+ * @return
*/
public boolean _getCharacterCount() {
chCount = oObj.getCharacterCount();
- log.println("Character count:" + chCount);
+ System.out.println("Character count:" + chCount);
boolean res = chCount == text.length();
return res;
}
@@ -358,21 +363,22 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterBounds()</code> </li>
* </ul>
+ * @return
*/
public boolean _getIndexAtPoint() {
boolean res = true;
- log.println("getIndexAtPoint(-1, -1):");
+ System.out.println("getIndexAtPoint(-1, -1):");
Point pt = new Point(-1, -1);
int index = oObj.getIndexAtPoint(pt);
- log.println(Integer.toString(index));
+ System.out.println(Integer.toString(index));
res &= index == -1;
if (chBounds != null) {
pt = new Point(chBounds.X , chBounds.Y );
- log.println("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
+ System.out.println("getIndexAtPoint(" + pt.X + ", " + pt.Y + "):");
index = oObj.getIndexAtPoint(pt);
- log.println(Integer.toString(index));
+ System.out.println(Integer.toString(index));
res &= index == (chCount - 1);
}
@@ -386,40 +392,41 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectedText() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, 0)");
+ System.out.println("setSelection(0, 0)");
oObj.setSelection(0, 0);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
String txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.length() == 0;
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.equals(text);
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
- log.println("getSelectedText():");
+ System.out.println("getSelectedText():");
txt = oObj.getSelectedText();
- log.println("'" + txt + "'");
+ System.out.println("'" + txt + "'");
res &= txt.equals(text.substring(1, chCount - 1));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -434,31 +441,32 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectionStart() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
int start = oObj.getSelectionStart();
- log.println("getSelectionStart():" + start);
+ System.out.println("getSelectionStart():" + start);
res &= start == 0;
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
start = oObj.getSelectionStart();
- log.println("getSelectionStart():" + start);
+ System.out.println("getSelectionStart():" + start);
res &= start == 1;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -473,31 +481,32 @@ public class _XAccessibleText {
* <ul>
* <li> <code>setSelection()</code> </li>
* </ul>
+ * @return
*/
public boolean _getSelectionEnd() {
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
boolean res = true;
try {
- log.println("setSelection(0, chCount)");
+ System.out.println("setSelection(0, chCount)");
oObj.setSelection(0, chCount);
int end = oObj.getSelectionEnd();
- log.println("getSelectionEnd():" + end);
+ System.out.println("getSelectionEnd():" + end);
res &= end == chCount;
if (chCount > 2) {
- log.println("setSelection(1, chCount-1)");
+ System.out.println("setSelection(1, chCount-1)");
oObj.setSelection(1, chCount - 1);
end = oObj.getSelectionEnd();
- log.println("getSelectionEnd():" + end);
+ System.out.println("getSelectionEnd():" + end);
res &= end == chCount - 1;
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -513,67 +522,68 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _setSelection() {
boolean res = true;
boolean locRes = true;
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
try {
- log.println("setSelection(-1, chCount-1):");
+ System.out.println("setSelection(-1, chCount-1):");
locRes = oObj.setSelection(-1, chCount - 1);
- log.println(locRes + " exception was expected");
+ System.out.println(locRes + " exception was expected");
res &= !locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("setSelection(0, chCount+1):");
+ System.out.println("setSelection(0, chCount+1):");
locRes = oObj.setSelection(0, chCount + 1);
- log.println(locRes + " excepion was expected");
+ System.out.println(locRes + " excepion was expected");
res &= !locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if (chCount > 2) {
- log.println("setSelection(1, chCount-1):");
+ System.out.println("setSelection(1, chCount-1):");
locRes = oObj.setSelection(1, chCount - 1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
- log.println("setSelection(chCount-1, 1):");
+ System.out.println("setSelection(chCount-1, 1):");
locRes = oObj.setSelection(chCount - 1, 1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
}
if (chCount > 1) {
- log.println("setSelection(0, chCount-1):");
+ System.out.println("setSelection(0, chCount-1):");
locRes = oObj.setSelection(0, chCount-1);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
- log.println("setSelection(chCount-1, 0):");
+ System.out.println("setSelection(chCount-1, 0):");
locRes = oObj.setSelection(chCount-1, 0);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
}
- log.println("setSelection(0, 0):");
+ System.out.println("setSelection(0, 0):");
locRes = oObj.setSelection(0, 0);
- log.println(Boolean.toString(locRes));
+ System.out.println(Boolean.toString(locRes));
res &= locRes;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
@@ -585,10 +595,11 @@ public class _XAccessibleText {
* Calls the method and checks returned value.
* Has OK status if returned string is not null
* received from relation.
+ * @return
*/
public boolean _getText() {
text = oObj.getText();
- log.println("getText: '" + text + "'");
+ System.out.println("getText: '" + text + "'");
return (text != null);
}
@@ -602,6 +613,7 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextRange() {
boolean res = true;
@@ -609,75 +621,75 @@ public class _XAccessibleText {
try {
if (chCount > 3) {
- log.println("getTextRange(1, chCount - 2): ");
+ System.out.println("getTextRange(1, chCount - 2): ");
String txtRange = oObj.getTextRange(1, chCount - 2);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals(text.substring(1, chCount - 2));
res &= locRes;
if (!locRes) {
- log.println("Was expected: " +
+ System.out.println("Was expected: " +
text.substring(1, chCount - 2));
}
}
if (chCount > 0) {
- log.println("getTextRange(0, chCount-1): ");
+ System.out.println("getTextRange(0, chCount-1): ");
String txtRange = oObj.getTextRange(0, chCount-1);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals(text.substring(0, chCount - 1));
res &= locRes;
if (!locRes) {
- log.println("Was expected: " +
+ System.out.println("Was expected: " +
text.substring(0, chCount - 1));
}
- log.println("getTextRange(chCount, 0): ");
+ System.out.println("getTextRange(chCount, 0): ");
txtRange = oObj.getTextRange(chCount, 0);
- log.println(txtRange);
+ System.out.println(txtRange);
res &= txtRange.equals(text);
- log.println("getTextRange(0, 0): ");
+ System.out.println("getTextRange(0, 0): ");
txtRange = oObj.getTextRange(0, 0);
- log.println(txtRange);
+ System.out.println(txtRange);
locRes = txtRange.equals("");
res &= locRes;
if (!locRes) {
- log.println("Empty string was expected");
+ System.out.println("Empty string was expected");
}
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
try {
- log.println("getTextRange(-1, chCount - 1): ");
+ System.out.println("getTextRange(-1, chCount - 1): ");
String txtRange = oObj.getTextRange(-1, chCount - 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextRange(0, chCount + 1): ");
+ System.out.println("getTextRange(0, chCount + 1): ");
String txtRange = oObj.getTextRange(0, chCount + 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextRange(chCount+1, -1): ");
+ System.out.println("getTextRange(chCount+1, -1): ");
String txtRange = oObj.getTextRange(chCount+1, -1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
@@ -694,62 +706,63 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextAtIndex() {
boolean res = true;
try {
- log.println("getTextAtIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextAtIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt =
oObj.getTextAtIndex(-1, AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextAtIndex(chCount+1," +
+ System.out.println("getTextAtIndex(chCount+1," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextAtIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getTextAtIndex(chCount," +
+ System.out.println("getTextAtIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextAtIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
- log.println("getTextAtIndex(1," +
+ System.out.println("getTextAtIndex(1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextAtIndex(1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -767,78 +780,79 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextBeforeIndex() {
boolean res = true;
try {
- log.println("getTextBeforeIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextBeforeIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBeforeIndex(-1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextBeforeIndex(chCount+1, " +
+ System.out.println("getTextBeforeIndex(chCount+1, " +
"AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBeforeIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
TextSegment txt = null;
try {
if (chCount > 0) {
- log.println("getTextBeforeIndex(chCount," +
+ System.out.println("getTextBeforeIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBeforeIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == chCount ;
- log.println("getTextBeforeIndex(1," +
+ System.out.println("getTextBeforeIndex(1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBeforeIndex(1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
}
if (chCount > 2) {
- log.println("getTextBeforeIndex(chCount-1," +
+ System.out.println("getTextBeforeIndex(chCount-1," +
" AccessibleTextType.CHARACTER):");
txt = oObj.getTextBeforeIndex(chCount - 1,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(chCount - 2, chCount - 1));
- log.println("getTextBeforeIndex(2," +
+ System.out.println("getTextBeforeIndex(2," +
" AccessibleTextType.CHARACTER):");
txt = oObj.getTextBeforeIndex(2,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(1, 2));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -856,79 +870,80 @@ public class _XAccessibleText {
* <ul>
* <li> <code>getCharacterCount()</code> </li>
* </ul>
+ * @return
*/
public boolean _getTextBehindIndex() {
boolean res = true;
try {
- log.println("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
+ System.out.println("getTextBehindIndex(-1, AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(-1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("getTextBehindIndex(chCount+1, " +
+ System.out.println("getTextBehindIndex(chCount+1, " +
"AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount + 1,
AccessibleTextType.PARAGRAPH);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
if ( chCount > 0 ) {
- log.println("getTextBehindIndex(chCount," +
+ System.out.println("getTextBehindIndex(chCount," +
" AccessibleTextType.PARAGRAPH):");
TextSegment txt = oObj.getTextBehindIndex(chCount,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
- log.println("getTextBehindIndex(chCount-1," +
+ System.out.println("getTextBehindIndex(chCount-1," +
" AccessibleTextType.PARAGRAPH):");
txt = oObj.getTextBehindIndex(chCount - 1,
AccessibleTextType.PARAGRAPH);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.length() == 0;
}
if ( chCount > 1 ) {
- log.println("getTextBehindIndex(1," +
+ System.out.println("getTextBehindIndex(1," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(1,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(2, 3));
}
if (chCount > 2) {
- log.println("getTextBehindIndex(chCount-2," +
+ System.out.println("getTextBehindIndex(chCount-2," +
" AccessibleTextType.CHARACTER):");
TextSegment txt = oObj.getTextBehindIndex(chCount - 2,
AccessibleTextType.CHARACTER);
- log.println("'" + txt.SegmentText + "'");
+ System.out.println("'" + txt.SegmentText + "'");
res &= txt.SegmentText.equals(text.substring(chCount - 1, chCount));
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
} catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
res &= false;
}
@@ -942,40 +957,41 @@ public class _XAccessibleText {
* Has OK status if exception was thrown for invalid parameters,
* if exception wasn't thrown for valid parameter and if returned value for
* valid parameter is equal to <code>true</code>.
+ * @return
*/
public boolean _copyText() {
boolean res = true;
boolean locRes = true;
if (editOnly != null) {
- log.println(editOnly);
+ System.out.println(editOnly);
return true;
}
try {
- log.println("copyText(-1,chCount):");
+ System.out.println("copyText(-1,chCount):");
oObj.copyText(-1, chCount);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("copyText(0,chCount+1):");
+ System.out.println("copyText(0,chCount+1):");
oObj.copyText(0, chCount + 1);
- log.println("Exception was expected");
+ System.out.println("Exception was expected");
res &= false;
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Expected exception");
+ System.out.println("Expected exception");
res &= true;
}
try {
- log.println("copyText(0,chCount):");
+ System.out.println("copyText(0,chCount):");
locRes = oObj.copyText(0, chCount);
- log.println(""+locRes);
+ System.out.println(""+locRes);
res &= locRes;
String cbText = null;
@@ -983,31 +999,31 @@ public class _XAccessibleText {
cbText =
util.SysUtils.getSysClipboardText(xMSF);
} catch (com.sun.star.uno.Exception e) {
- log.println("Couldn't access system clipboard :");
+ System.out.println("Couldn't access system clipboard :");
e.printStackTrace();
}
- log.println("Clipboard: '" + cbText + "'");
+ System.out.println("Clipboard: '" + cbText + "'");
res &= text.equals(cbText);
if (chCount > 2) {
- log.println("copyText(1,chCount-1):");
+ System.out.println("copyText(1,chCount-1):");
locRes = oObj.copyText(1, chCount - 1);
- log.println(""+locRes);
+ System.out.println(""+locRes);
res &= locRes;
try {
cbText = util.SysUtils.getSysClipboardText(xMSF);
} catch (com.sun.star.uno.Exception e) {
- log.println("Couldn't access system clipboard :");
+ System.out.println("Couldn't access system clipboard :");
e.printStackTrace();
}
- log.println("Clipboard: '" + cbText + "'");
+ System.out.println("Clipboard: '" + cbText + "'");
res &= text.substring(1, chCount - 1).equals(cbText);
}
} catch(com.sun.star.lang.IndexOutOfBoundsException e) {
- log.println("Unexpected exception");
+ System.out.println("Unexpected exception");
e.printStackTrace();
res &= false;
}
diff --git a/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java
new file mode 100755
index 000000000000..11e4a4b19f80
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ * DO NOT ALTER 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.toolkit.awtgrid;
+
+import com.sun.star.awt.grid.XGridColumn;
+import com.sun.star.awt.grid.XGridColumnListener;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.XEventListener;
+import com.sun.star.style.HorizontalAlignment;
+import com.sun.star.util.XCloneable;
+
+/**
+ * a dummy implementation of css.awt.grid.XGridColumn
+ * @author frank.schoenheit@oracle.com
+ */
+public class DummyColumn implements XGridColumn
+{
+ public DummyColumn()
+ {
+ }
+
+ public Object getIdentifier()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setIdentifier( Object o )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getColumnWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setColumnWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getMinWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setMinWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getMaxWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setMaxWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public boolean getResizeable()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setResizeable( boolean bln )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getFlexibility()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setFlexibility( int i ) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public HorizontalAlignment getHorizontalAlign()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setHorizontalAlign( HorizontalAlignment ha )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public String getTitle()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setTitle( String string )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public String getHelpText()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setHelpText( String string )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getIndex()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getDataColumnIndex()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setDataColumnIndex( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void addGridColumnListener( XGridColumnListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void removeGridColumnListener( XGridColumnListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void dispose()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void addEventListener( XEventListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void removeEventListener( XEventListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public XCloneable createClone()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+}
diff --git a/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java
new file mode 100755
index 000000000000..c31f27796cf1
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java
@@ -0,0 +1,98 @@
+package complex.toolkit.awtgrid;
+
+import com.sun.star.awt.grid.GridDataEvent;
+import com.sun.star.awt.grid.XGridDataListener;
+import com.sun.star.lang.EventObject;
+import static org.junit.Assert.*;
+
+final public class GridDataListener implements XGridDataListener
+{
+ public GridDataListener()
+ {
+ }
+
+ public void rowsInserted( GridDataEvent i_event )
+ {
+ assertNull( m_rowInsertionEvent );
+ m_rowInsertionEvent = i_event;
+ }
+
+ public void rowsRemoved( GridDataEvent i_event )
+ {
+ assertNull( m_rowRemovalEvent );
+ m_rowRemovalEvent = i_event;
+ }
+
+ public void dataChanged( GridDataEvent i_event )
+ {
+ assertNull( m_dataChangeEvent );
+ m_dataChangeEvent = i_event;
+ }
+
+ public void rowHeadingChanged( GridDataEvent i_event )
+ {
+ assertNull( m_rowHeadingChangeEvent );
+ m_rowHeadingChangeEvent = i_event;
+ }
+
+ public void disposing( EventObject eo )
+ {
+ m_disposed = true;
+ }
+
+ public final GridDataEvent assertSingleRowInsertionEvent()
+ {
+ assertNotNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowInsertionEvent;
+ }
+
+ public final GridDataEvent assertSingleRowRemovalEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNotNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowRemovalEvent;
+ }
+
+ public final GridDataEvent assertSingleDataChangeEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNotNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_dataChangeEvent;
+ }
+
+ public final GridDataEvent assertSingleRowHeadingChangeEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNotNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowHeadingChangeEvent;
+ }
+
+ public final boolean isDisposed()
+ {
+ return m_disposed;
+ }
+
+ public final void reset()
+ {
+ m_rowInsertionEvent = m_rowRemovalEvent = m_dataChangeEvent = m_rowHeadingChangeEvent = null;
+ // m_disposed is not reset intentionally
+ }
+ private GridDataEvent m_rowInsertionEvent = null;
+ private GridDataEvent m_rowRemovalEvent = null;
+ private GridDataEvent m_dataChangeEvent = null;
+ private GridDataEvent m_rowHeadingChangeEvent = null;
+ private boolean m_disposed = false;
+}
diff --git a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java
new file mode 100755
index 000000000000..c550dd9a047d
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java
@@ -0,0 +1,314 @@
+/*************************************************************************
+ * DO NOT ALTER 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.toolkit.awtgrid;
+
+import java.lang.reflect.Method;
+import com.sun.star.awt.grid.GridDataEvent;
+import com.sun.star.awt.grid.XMutableGridDataModel;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import static org.junit.Assert.*;
+import static complex.toolkit.Assert.*;
+
+/** test for the <code>css.awt.grid.XMutableGridData</code> interface
+ *
+ * @author frank.schoenheit@oracle.com
+ */
+public class TMutableGridDataModel
+{
+ public TMutableGridDataModel( final XMutableGridDataModel i_dataModel )
+ {
+ m_dataModel = i_dataModel;
+
+ m_listener = new GridDataListener();
+ m_dataModel.addGridDataListener( m_listener );
+ }
+
+ /*
+ * tests the XMutableGridDataModel.addRow method
+ */
+ public void testAddRow() throws IndexOutOfBoundsException
+ {
+ m_dataModel.addRow( 1, m_rowValues[0] );
+ GridDataEvent event = m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+ assertEquals( "row insertion: wrong FirstRow (1)", 0, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (1)", 0, event.LastRow );
+ impl_assertRowData( 0 );
+
+ m_dataModel.addRow( 2, m_rowValues[1] );
+ event = m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+ assertEquals( "row insertion: wrong FirstRow (2)", 1, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (2)", 1, event.LastRow );
+ impl_assertRowData( 1 );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.addRows method
+ */
+ public void testAddRows() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testAddRow, please!", 2, m_dataModel.getRowCount() );
+
+ m_dataModel.addRows( new Object[] { "3", 4.0, "5" }, new Object[][] { m_rowValues[2], m_rowValues[3], m_rowValues[4] } );
+ GridDataEvent event = m_listener.assertSingleRowInsertionEvent();
+ assertEquals( "row insertion: wrong FirstRow (1)", 2, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (1)", 4, event.LastRow );
+ m_listener.reset();
+
+ assertEquals( "data model's row count is not adjusted when adding rows", m_rowValues.length, m_dataModel.getRowCount() );
+ assertEquals( "data model's column count is not adjusted when adding rows", m_rowValues[0].length, m_dataModel.getColumnCount() );
+ for ( int row=0; row<m_rowValues.length; ++row )
+ {
+ for ( int col=0; col<m_rowValues[row].length; ++col )
+ {
+ assertEquals( "added row values are not preserved",
+ m_rowValues[row][col], m_dataModel.getCellData( col, row ) );
+ }
+ }
+
+ assertException( "addRows is expected to throw when invoked with different-sized arrays",
+ m_dataModel, "addRows", new Object[] { new Object[0], new Object[1][2] }, IllegalArgumentException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.removeRow method
+ */
+ public void testRemoveRow() throws IndexOutOfBoundsException
+ {
+ assertEquals( "precondition not met: call this directly after testAddRows, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ final int rowToRemove = 2;
+ m_dataModel.removeRow( rowToRemove );
+ GridDataEvent event = m_listener.assertSingleRowRemovalEvent();
+ assertEquals( "incorrect notification of row removal (FirstRow)", rowToRemove, event.FirstRow );
+ assertEquals( "incorrect notification of row removal (LastRow)", rowToRemove, event.LastRow );
+ m_listener.reset();
+
+ assertEquals( "data model's row count does not reflect the removed row", m_rowValues.length - 1, m_dataModel.getRowCount() );
+ for ( int row = rowToRemove; row<m_rowValues.length-1; ++row )
+ {
+ for ( int col=0; col<m_rowValues[row].length; ++col )
+ {
+ assertEquals( "unexpected row values after removing a row (col: " + col + ", row: " + row + ")",
+ m_rowValues[row+1][col], m_dataModel.getCellData( col, row ) );
+ }
+ }
+
+ assertException( "removeRow silently ignores an invalid index (1)",
+ m_dataModel, "removeRow", new Object[] { -1 }, IndexOutOfBoundsException.class );
+ assertException( "removeRow silently ignores an invalid index (2)",
+ m_dataModel, "removeRow", new Object[] { m_dataModel.getRowCount() }, IndexOutOfBoundsException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.removeAllRows method
+ */
+ public void testRemoveAllRows()
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveRow, please!", m_rowValues.length - 1, m_dataModel.getRowCount() );
+
+ m_dataModel.removeAllRows();
+ final GridDataEvent event = m_listener.assertSingleRowRemovalEvent();
+ if ( event.FirstRow != -1 )
+ { // notifying "-1" is allowed, this means "all rows affected", by definition
+ assertEquals( "removeAllRows is not notifying properly (1)", 0, event.FirstRow );
+ assertEquals( "removeAllRows is not notifying properly (2)", m_rowValues.length - 1, event.LastRow );
+ }
+ m_listener.reset();
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateCellData method
+ */
+ public void testUpdateCellData() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveAllRows, please!", 0, m_dataModel.getRowCount() );
+
+ m_dataModel.addRows( new Object[] { 1, 2, 3, 4, 5 }, m_rowValues );
+ m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+
+ final Object[][] modifyValues = new Object[][] {
+ new Object[] { 2, 1, "text" },
+ new Object[] { 3, 0, null },
+ new Object[] { 0, 4, new Double( 33.0 ) }
+ };
+ for ( int i = 0; i < modifyValues.length; ++i )
+ {
+ final int row = ((Integer)modifyValues[i][0]).intValue();
+ final int col = ((Integer)modifyValues[i][1]).intValue();
+ final Object value = modifyValues[i][2];
+ m_dataModel.updateCellData( col, row, value );
+
+ final GridDataEvent event = m_listener.assertSingleDataChangeEvent();
+ assertEquals( "data change notification: FirstRow is invalid", row, event.FirstRow );
+ assertEquals( "data change notification: LastRow is invalid", row, event.LastRow );
+ assertEquals( "data change notification: FirstColumn is invalid", col, event.FirstColumn );
+ assertEquals( "data change notification: LastColumn is invalid", col, event.LastColumn );
+ m_listener.reset();
+
+ assertEquals( "data change at (" + col + ", " + row + ") not successful", value, m_dataModel.getCellData( col, row ) );
+ }
+
+ assertException( "updateCellData silently ignores an invalid index (1)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { -1, -1, "text" }, IndexOutOfBoundsException.class );
+ assertException( "updateCellData silently ignores an invalid index (2)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { 0, m_dataModel.getRowCount(), "text" }, IndexOutOfBoundsException.class );
+ assertException( "updateCellData silently ignores an invalid index (3)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { m_dataModel.getColumnCount(), 0, "text" }, IndexOutOfBoundsException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateRowData method
+ */
+ public void testUpdateRowData() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveAllRows, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ // get data from before the update
+ final Object[][] preUpdateValues = impl_getCurrentData();
+
+ // do the update
+ final int[] colIndexes = new int[] {
+ 0, 3, 4
+ };
+ final Object[] values = new Object[] {
+ 13, null, 42.0
+ };
+ final int rowToUpdate = 2;
+ m_dataModel.updateRowData( colIndexes, rowToUpdate, values );
+ final GridDataEvent event = m_listener.assertSingleDataChangeEvent();
+ assertEquals( "row update notification: FirstRow is invalid", rowToUpdate, event.FirstRow );
+ assertEquals( "row update notification: LastRow is invalid", rowToUpdate, event.LastRow );
+ assertEquals( "row update notification: FirstColumn is invalid", 0, event.FirstColumn );
+ assertEquals( "row update notification: LastColumn is invalid", 4, event.LastColumn );
+ m_listener.reset();
+
+ // reflect the changes made in the pre-update data
+ for ( int i=0; i<colIndexes.length; ++i )
+ {
+ preUpdateValues[rowToUpdate][colIndexes[i]] = values[i];
+ }
+
+ // get data from after the update
+ final Object[][] postUpdateValues = impl_getCurrentData();
+
+ // ensure both the manually updated pre-update data and the post-update data are identical
+ assertArrayEquals( preUpdateValues, postUpdateValues );
+
+
+ assertException( "updateRowData silently ignores an invalid index (1)",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { -1 }, 0, new Object[] { "text" } }, IndexOutOfBoundsException.class );
+ assertException( "updateRowData silently ignores an invalid index (2)",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { 0 }, -1, new Object[] { "" } }, IndexOutOfBoundsException.class );
+ assertException( "updateRowData silently ignores different-sized arrays",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { 0, 0 }, 0, new Object[] { "" } }, IllegalArgumentException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateRowHeading method
+ */
+ public void testUpdateRowHeading() throws IndexOutOfBoundsException
+ {
+ assertEquals( "precondition not met: call this directly after testUpdateRowData, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ final Object[] preUpdateHeadings = impl_getCurrentRowHeadings();
+
+ final int rowToUpdate = 2;
+ final String valueToUpdate = "some text";
+ m_dataModel.updateRowHeading( rowToUpdate, valueToUpdate );
+ final GridDataEvent event = m_listener.assertSingleRowHeadingChangeEvent();
+ assertEquals( "row heading update notification: FirstRow is invalid", rowToUpdate, event.FirstRow );
+ assertEquals( "row heading update notification: FirstRow is invalid", rowToUpdate, event.LastRow );
+ m_listener.reset();
+
+ preUpdateHeadings[rowToUpdate] = valueToUpdate;
+
+ final Object[] postUpdateHeadings = impl_getCurrentRowHeadings();
+ assertArrayEquals( preUpdateHeadings, postUpdateHeadings );
+
+ assertException( "updateRowHeading silently ignores an invalid index",
+ m_dataModel, "updateRowHeading", new Class[] { int.class, Object.class },
+ new Object[] { -1, "" }, IndexOutOfBoundsException.class );
+ }
+
+ public void cleanup()
+ {
+ m_dataModel.removeGridDataListener( m_listener );
+ }
+
+ private Object[][] impl_getCurrentData() throws IndexOutOfBoundsException
+ {
+ final int rowCount = m_dataModel.getRowCount();
+ final int colCount = m_dataModel.getColumnCount();
+ final Object[][] data = new Object[rowCount][colCount];
+ for ( int row=0; row<rowCount; ++row )
+ {
+ for ( int col=0; col<colCount; ++col )
+ {
+ data[row][col] = m_dataModel.getCellData( col, row );
+ }
+ }
+ return data;
+ }
+
+ private Object[] impl_getCurrentRowHeadings() throws IndexOutOfBoundsException
+ {
+ final int rowCount = m_dataModel.getRowCount();
+ final Object[] headings = new Object[rowCount];
+ for ( int row=0; row<rowCount; ++row )
+ headings[row] = m_dataModel.getRowHeading( row );
+ return headings;
+ }
+
+ private void impl_assertRowData( final int i_rowIndex ) throws IndexOutOfBoundsException
+ {
+ for ( int i=0; i<m_rowValues[i_rowIndex].length; ++i )
+ {
+ assertEquals( m_rowValues[i_rowIndex][i], m_dataModel.getCellData( i, i_rowIndex ) );
+ }
+ }
+
+ private final XMutableGridDataModel m_dataModel;
+ private final GridDataListener m_listener;
+
+ private final static Object[][] m_rowValues = new Object[][] {
+ new Object[] { 1, 2, "3", 4, 5 },
+ new Object[] { 2, 3, 4, "5", 6 },
+ new Object[] { "3", 4, 5, 6, 7 },
+ new Object[] { 4, 5, 6, 7, "8" },
+ new Object[] { 5, "6", 7, 8, 9 },
+ };
+}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java b/toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java
deleted file mode 100644
index 472412e80aa6..000000000000
--- a/toolkit/qa/complex/toolkit/interface_tests/_XRequestCallback.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package complex.toolkit.interface_tests;
-
-import com.sun.star.awt.XRequestCallback;
-import lib.MultiMethodTest;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
-
-/**
- * Testing <code>com.sun.star.awt.XRequestCallback</code>
- * interface methods :
- * <ul>
- * <li><code> addCallback()</code></li>
- * </ul> <p>
- * @see com.sun.star.awt.XRequestCallback
- */
-public class _XRequestCallback {
-
- private LogWriter log;
-
- private static final String className =
- "com.sun.star.awt.XRequestCallback" ;
-
- public XRequestCallback oObj = null;
- private XMultiServiceFactory xMSF;
-
- String text = null;
-
-
- public _XRequestCallback(XInterface object, LogWriter log, XMultiServiceFactory xMSF ) {
- oObj = (XRequestCallback)UnoRuntime.queryInterface(
- XRequestCallback.class, object);
- this.xMSF = xMSF;
- this.log = log;
- }
-
-
- /**
- * Calls the method and checks returned value.
- * Has OK status if returned value is equal to <code>chCount - 1</code>.
- * The following method tests are to be executed before:
- * <ul>
- * <li> <code>addCallback()</code> </li>
- * </ul>
- */
- public boolean _addCallback() {
-
- boolean res = true;
- try {
- Object a = new Object();
- oObj.addCallback( null, a );
- } catch (com.sun.star.uno.RuntimeException ie) {
- res = false;
- }
- log.println("addCallback called" );
-
- return res;
- }
-
-}
diff --git a/toolkit/qa/complex/toolkit/interface_tests/makefile.mk b/toolkit/qa/complex/toolkit/interface_tests/makefile.mk
deleted file mode 100755
index 0e324109f28d..000000000000
--- a/toolkit/qa/complex/toolkit/interface_tests/makefile.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..$/..$/..
-TARGET = Toolkit
-PRJNAME = $(TARGET)
-PACKAGE = complex$/toolkit$/interface_tests
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = _XAccessibleComponent.java \
- _XAccessibleContext.java \
- _XAccessibleExtendedComponent.java \
- _XAccessibleEventBroadcaster.java \
- _XAccessibleText.java \
- _XRequestCallback.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(depend)" == ""
-ALL : ALLTAR
-.ELSE
-ALL: ALLDEP
-.ENDIF
-
-.INCLUDE : target.mk
-
diff --git a/toolkit/qa/complex/toolkit/makefile.mk b/toolkit/qa/complex/toolkit/makefile.mk
index 3a4e096719bb..ecb173f9bdac 100755
--- a/toolkit/qa/complex/toolkit/makefile.mk
+++ b/toolkit/qa/complex/toolkit/makefile.mk
@@ -25,58 +25,73 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = Toolkit
-PRJNAME = $(TARGET)
-PACKAGE = complex$/toolkit
+.IF "$(OOO_JUNIT_JAR)" == ""
+nothing .PHONY:
+ @echo -----------------------------------------------------
+ @echo - JUnit not available, not building anything
+ @echo -----------------------------------------------------
+.ELSE # IF "$(OOO_JUNIT_JAR)" != ""
+
+PRJ = ../../..
+PRJNAME = toolkit
+TARGET = qa_complex_toolkit
+PACKAGE = complex/toolkit
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
-
#----- compile .java files -----------------------------------------
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckAccessibleStatusBar.java CheckAccessibleStatusBarItem.java CheckAsyncCallback.java CallbackClass.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-SUBDIRS = interface_tests
+JARFILES = OOoRunnerLight.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-#----- make a jar from compiled files ------------------------------
+JAVAFILES = \
+ $(JAVATESTFILES) \
+ accessibility/_XAccessibleComponent.java \
+ accessibility/_XAccessibleContext.java \
+ accessibility/_XAccessibleEventBroadcaster.java \
+ accessibility/_XAccessibleExtendedComponent.java \
+ accessibility/_XAccessibleText.java \
+ Assert.java \
+ awtgrid/GridDataListener.java \
+ awtgrid/TMutableGridDataModel.java \
+ awtgrid/DummyColumn.java \
-MAXLINELENGTH = 100000
+#----- create a jar from compiled files ----------------------------
-JARCLASSDIRS = $(PACKAGE)
JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-# --- Parameters for the test --------------------------------------
+#----- JUnit tests class -------------------------------------------
-# 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
+JAVATESTFILES = \
+ GridControl.java \
+ UnitConversion.java \
-# test base is java complex
-CT_TESTBASE = -tb java_complex
-# build up package name with "." instead of $/
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+# disabled for now - the tests fail on at least one platform
+# no issue, yet (not sure this is worth it. Don't know who to give the issue to, and don't know whether the test really makes sense)
+DISABLED_JAVA_TEST_FILES=\
+ AccessibleStatusBar.java\
+ AccessibleStatusBarItem.java
-# start the runner application
-CT_APP = org.openoffice.Runner
# --- Targets ------------------------------------------------------
-.INCLUDE : target.mk
+.INCLUDE: target.mk
+
+ALL : ALLTAR
+
+# --- subsequent tests ---------------------------------------------
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" != ""
+
+.INCLUDE: installationtest.mk
-run: \
- CheckAccessibleStatusBarItem
+ALLTAR : javatest
-CheckAccessibleStatusBar:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBar
+ # Sample how to debug
+ # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-CheckAccessibleStatusBarItem:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).CheckAccessibleStatusBarItem
+.END # "$(OOO_SUBSEQUENT_TESTS)" == ""
+.END # ELSE "$(OOO_JUNIT_JAR)" != ""
diff --git a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
deleted file mode 100644
index 654f5ec69da5..000000000000
--- a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
+++ /dev/null
@@ -1,222 +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.xunitconversion;
-
-import com.sun.star.awt.XUnitConversion;
-import com.sun.star.uno.UnoRuntime;
-import complexlib.ComplexTestCase;
-import com.sun.star.awt.XWindow;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.awt.XWindowPeer;
-
-import util.DesktopTools;
-
-/**
- * This complex test is only for testing the com.sun.star.awt.XUnitConversion methods
- * These are converter methods to get the size of a well known awt component
- * in a com.sun.star.util.MeasureUnit you want.
- * You don't need to know the factors to calculate by hand.
- *
- * @author ll93751
- */
-public class XUnitConversionTest extends ComplexTestCase
-{
- public String[] getTestMethodNames()
- {
- return new String[]{"testXUnitConversion"}; // function name of the test method
- }
-
- /**
- * returns the delta value between a and b
- * @param a
- * @param b
- * @return
- */
- private int delta(int a, int b)
- {
- final int n = Math.abs(a - b);
- return n;
- }
-
- private XUnitConversion m_xConversion = null;
-
- /**
- * Not really a check,
- * only a simple test call to convertSizeToLogic(...) with different parameters
- * @param _aSize
- * @param _aMeasureUnit
- * @param _sEinheit
- */
- private void checkSize(com.sun.star.awt.Size _aSize, short _aMeasureUnit, String _sEinheit)
- {
- try
- {
- com.sun.star.awt.Size aSizeIn = m_xConversion.convertSizeToLogic(_aSize, _aMeasureUnit);
- log.println("Window size:");
- log.println("Width:" + aSizeIn.Width + " " + _sEinheit);
- log.println("Height:" + aSizeIn.Height + " " + _sEinheit);
- log.println("");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- log.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
- }
- }
-
-/**
- * The real test function
- * 1. try to get the XMultiServiceFactory of an already running office. Therefore make sure an (open|star)office is running with
- * parameters like -accept="socket,host=localhost,port=8100;urp;"
- * 2. try to create an empty window
- * 3. try to convert the WindowPeer to an XWindow
- * 4. try to resize and move the window to an other position, so we get a well knowing position and size.
- * 5. run some more tests
- *
- * If no test fails, the test is well done and returns with 'PASSED, OK'
- *
- */ public void testXUnitConversion()
- {
- XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
- assure("failed: There is no office.", xMSF != null);
-
- // create a window
- XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
- assure("failed: there is no window peer", xWindowPeer != null);
-
-
- // resize and move the window to a well known position and size
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
- assure("failed: there is no window, cast wrong?", xWindow != null);
-
- xWindow.setVisible(Boolean.TRUE);
-
- int x = 100;
- int y = 100;
- int width = 640;
- int height = 480;
- xWindow.setPosSize(x, y, width, height, com.sun.star.awt.PosSize.POSSIZE);
-
- com.sun.star.awt.Rectangle aRect = xWindow.getPosSize();
- com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
- com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);
-
- log.println("Window position and size in pixel:");
- log.println("X:" + aPoint.X);
- log.println("Y:" + aPoint.Y);
- log.println("Width:" + aSize.Width);
- log.println("Height:" + aSize.Height);
- log.println("");
-
- assure("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
-
- // XToolkit aToolkit = xWindowPeer.getToolkit();
- m_xConversion = (XUnitConversion) UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
-
- // try to get the position of the window in 1/100mm with the XUnitConversion method
- try
- {
- com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window position:");
- log.println("X:" + aPointInMM_100TH.X + " 1/100mm");
- log.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
- log.println("");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- assure("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage(), Boolean.FALSE);
- }
-
- // try to get the size of the window in 1/100mm with the XUnitConversion method
- com.sun.star.awt.Size aSizeInMM_100TH = null;
- com.sun.star.awt.Size aSizeInMM_10TH = null;
- try
- {
- aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window size:");
- log.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
- log.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
- log.println("");
-
- // try to get the size of the window in 1/10mm with the XUnitConversion method
-
- aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
- log.println("Window size:");
- log.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
- log.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
- log.println("");
-
- // check the size with a delta which must be smaller a given difference
- assure("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
- assure("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
-
- // new
- checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel");
- checkSize(aSize, com.sun.star.util.MeasureUnit.APPFONT, "appfont");
- checkSize(aSize, com.sun.star.util.MeasureUnit.SYSFONT, "sysfont");
-
- // simply check some more parameters
- checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm");
- checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_1000TH, "1/1000inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_100TH, "1/100inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_10TH, "1/10inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH, "inch");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.M, "m");
- checkSize(aSize, com.sun.star.util.MeasureUnit.POINT, "point");
- checkSize(aSize, com.sun.star.util.MeasureUnit.TWIP, "twip");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.KM, "km");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.PICA, "pica");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.FOOT, "foot");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.MILE, "mile");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- assure("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage(), Boolean.FALSE);
- }
-
- // convert the 1/100mm window size back to pixel
- try
- {
- com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
- log.println("Window size:");
- log.println("Width:" + aNewSize.Width + " pixel");
- log.println("Height:" + aNewSize.Height + " pixel");
-
- // assure the pixels are the same as we already know
- assure("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- assure("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage(), Boolean.FALSE);
- }
-
- // close the window.
- // IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
- xWindow.dispose();
- }
-}
diff --git a/toolkit/qa/complex/xunitconversion/makefile.mk b/toolkit/qa/complex/xunitconversion/makefile.mk
deleted file mode 100644
index 18b59ee19f18..000000000000
--- a/toolkit/qa/complex/xunitconversion/makefile.mk
+++ /dev/null
@@ -1,77 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..$/..
-TARGET = XUnitConversionTest
-PRJNAME = $(TARGET)
-PACKAGE = complex$/xunitconversion
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = XUnitConversionTest.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-SUBDIRS =
-
-#----- 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 = -tb java_complex
-
-# build up package name with "." instead of $/
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
-
-# start the runner application
-CT_APP = org.openoffice.Runner
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-run: $(JAVAFILES) XUnitConversionTest
-
-XUnitConversionTest:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_PACKAGE).XUnitConversionTest
diff --git a/toolkit/qa/unoapi/Test.java b/toolkit/qa/unoapi/Test.java
index f27d882314d2..0543fee83f9f 100644
--- a/toolkit/qa/unoapi/Test.java
+++ b/toolkit/qa/unoapi/Test.java
@@ -27,6 +27,7 @@ package org.openoffice.toolkit.qa.unoapi;
import org.openoffice.Runner;
import org.openoffice.test.OfficeConnection;
+import org.openoffice.test.Argument;
import static org.junit.Assert.*;
public final class Test {
@@ -43,8 +44,8 @@ public final class Test {
@org.junit.Test public void test() {
assertTrue(
Runner.run(
- "-sce", "toolkit.sce", "-xcl", "knownissues.xcl", "-tdoc",
- "testdocuments", "-cs", connection.getDescription()));
+ "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"), "-tdoc",
+ Argument.get("tdoc"), "-cs", connection.getDescription()));
}
private final OfficeConnection connection = new OfficeConnection();
diff --git a/toolkit/qa/unoapi/knownissues.xcl b/toolkit/qa/unoapi/knownissues.xcl
index 429d7693c833..273b4b72dbe2 100644
--- a/toolkit/qa/unoapi/knownissues.xcl
+++ b/toolkit/qa/unoapi/knownissues.xcl
@@ -178,7 +178,6 @@ toolkit.UnoControlDialogModel::com::sun::star::lang::XComponent
toolkit.UnoControlFileControlModel::com::sun::star::lang::XComponent
toolkit.UnoControlGroupBox::com::sun::star::lang::XComponent
toolkit.UnoControlContainer::com::sun::star::lang::XComponent
-toolkit.MutableTreeDataModel::com::sun::star::lang::XComponent
toolkit.UnoControlFixedText::com::sun::star::lang::XComponent
toolkit.UnoControlListBox::com::sun::star::lang::XComponent
toolkit.UnoControlCheckBoxModel::com::sun::star::lang::XComponent
@@ -241,12 +240,21 @@ toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleValue
toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleEventBroadcaster
toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleSelection
-### i111076 ###
-toolkit.Toolkit::com::sun::star::awt::XDataTransferProviderAccess
-
### i111113 ###
toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleComponent
toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleContext
### i111195 ###
toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue
+
+### i113489 ###
+toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleText
+toolkit.AccessibleMenuBar::com::sun::star::accessibility::XAccessibleComponent
+toolkit.AccessibleMenuSeparator::com::sun::star::accessibility::XAccessibleComponent
+
+### i114213 ###
+toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection
+
+### i114636 ###
+toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction
+toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleContext
diff --git a/toolkit/qa/unoapi/makefile.mk b/toolkit/qa/unoapi/makefile.mk
deleted file mode 100644
index 9517601c3917..000000000000
--- a/toolkit/qa/unoapi/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#***********************************************************************/
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
-PRJ = ../..
-PRJNAME = toolkit
-TARGET = qa_unoapi
-
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = org/openoffice/toolkit/qa/unoapi
-JAVATESTFILES = Test.java
-JAVAFILES = $(JAVATESTFILES)
-JARFILES = OOoRunner.jar ridl.jar test.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.END
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
-
-ALLTAR : javatest
-
-.END
diff --git a/toolkit/qa/unoapi/toolkit.sce b/toolkit/qa/unoapi/toolkit.sce
index 5a148feee573..00af010d23d6 100644
--- a/toolkit/qa/unoapi/toolkit.sce
+++ b/toolkit/qa/unoapi/toolkit.sce
@@ -8,10 +8,10 @@
#i86110 -o toolkit.AccessibleList
#i86110 -o toolkit.AccessibleListBox
#i86110 -o toolkit.AccessibleListItem
-#i111047# -o toolkit.AccessibleMenu
-#i111047# -o toolkit.AccessibleMenuBar
+-o toolkit.AccessibleMenu
+-o toolkit.AccessibleMenuBar
#i86009 -o toolkit.AccessibleMenuItem
-#i111047# -o toolkit.AccessibleMenuSeparator
+-o toolkit.AccessibleMenuSeparator
#i52607 -o toolkit.AccessiblePopupMenu
#i86107,i86110 -o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx
new file mode 100755
index 000000000000..45d60f0d88aa
--- /dev/null
+++ b/toolkit/source/awt/animatedimagespeer.cxx
@@ -0,0 +1,539 @@
+/*************************************************************************
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include "toolkit/awt/animatedimagespeer.hxx"
+#include "toolkit/helper/property.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+/** === end UNO includes === **/
+
+#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 <vcl/throbber.hxx>
+#include <vcl/svapp.hxx>
+
+#include <limits>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::awt::XAnimatedImages;
+ using ::com::sun::star::awt::Size;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::graphic::XGraphicProvider;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::graphic::XGraphic;
+ /** === end UNO using === **/
+ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer_Data
+ //==================================================================================================================
+ struct CachedImage
+ {
+ ::rtl::OUString sImageURL;
+ mutable Reference< XGraphic > xGraphic;
+
+ CachedImage()
+ :sImageURL()
+ ,xGraphic()
+ {
+ }
+
+ CachedImage( ::rtl::OUString const& i_imageURL )
+ :sImageURL( i_imageURL )
+ ,xGraphic()
+ {
+ }
+ };
+
+ struct AnimatedImagesPeer_Data
+ {
+ AnimatedImagesPeer& rAntiImpl;
+ ::std::vector< ::std::vector< CachedImage > > aCachedImageSets;
+
+ AnimatedImagesPeer_Data( AnimatedImagesPeer& i_antiImpl )
+ :rAntiImpl( i_antiImpl )
+ ,aCachedImageSets()
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ 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();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ bool lcl_ensureImage_throw( Reference< XGraphicProvider > const& i_graphicProvider, const bool i_isHighContrast, const CachedImage& i_cachedImage )
+ {
+ if ( !i_cachedImage.xGraphic.is() )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ if ( i_isHighContrast )
+ {
+ // try (to find) the high-contrast version of the graphic first
+ aMediaProperties.put( "URL", lcl_getHighContrastURL( i_cachedImage.sImageURL ) );
+ i_cachedImage.xGraphic.set( i_graphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ if ( !i_cachedImage.xGraphic.is() )
+ {
+ aMediaProperties.put( "URL", i_cachedImage.sImageURL );
+ i_cachedImage.xGraphic.set( i_graphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ }
+ return i_cachedImage.xGraphic.is();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Size lcl_getGraphicSizePixel( Reference< XGraphic > const& i_graphic )
+ {
+ Size aSizePixel;
+ try
+ {
+ if ( i_graphic.is() )
+ {
+ const Reference< XPropertySet > xGraphicProps( i_graphic, UNO_QUERY_THROW );
+ OSL_VERIFY( xGraphicProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SizePixel" ) ) ) >>= aSizePixel );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aSizePixel;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_init( Sequence< ::rtl::OUString > const& i_imageURLs, ::std::vector< CachedImage >& o_images )
+ {
+ o_images.resize(0);
+ size_t count = size_t( i_imageURLs.getLength() );
+ o_images.reserve( count );
+ for ( size_t i = 0; i < count; ++i )
+ {
+ o_images.push_back( CachedImage( i_imageURLs[i] ) );
+ }
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_updateImageList_nothrow( AnimatedImagesPeer_Data& i_data )
+ {
+ Throbber* pThrobber = dynamic_cast< Throbber* >( i_data.rAntiImpl.GetWindow() );
+ if ( pThrobber == NULL )
+ return;
+
+ try
+ {
+ // collect the image sizes of the different image sets
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ const bool isHighContrast = pThrobber->GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ sal_Int32 nPreferredSet = -1;
+ const size_t nImageSetCount = i_data.aCachedImageSets.size();
+ if ( nImageSetCount < 2 )
+ {
+ nPreferredSet = sal_Int32( nImageSetCount ) - 1;
+ }
+ else
+ {
+ ::std::vector< Size > aImageSizes( nImageSetCount );
+ for ( sal_Int32 nImageSet = 0; size_t( nImageSet ) < nImageSetCount; ++nImageSet )
+ {
+ ::std::vector< CachedImage > const& rImageSet( i_data.aCachedImageSets[ nImageSet ] );
+ if ( ( rImageSet.empty() )
+ || ( !lcl_ensureImage_throw( xGraphicProvider, isHighContrast, rImageSet[0] ) )
+ )
+ {
+ aImageSizes[ nImageSet ] = Size( ::std::numeric_limits< long >::max(), ::std::numeric_limits< long >::max() );
+ }
+ else
+ {
+ aImageSizes[ nImageSet ] = lcl_getGraphicSizePixel( rImageSet[0].xGraphic );
+ }
+ }
+
+ // find the set with the smallest difference between window size and image size
+ const ::Size aWindowSizePixel = pThrobber->GetSizePixel();
+ long nMinimalDistance = ::std::numeric_limits< long >::max();
+ for ( ::std::vector< Size >::const_iterator check = aImageSizes.begin();
+ check != aImageSizes.end();
+ ++check
+ )
+ {
+ if ( ( check->Width > aWindowSizePixel.Width() )
+ || ( check->Height > aWindowSizePixel.Height() )
+ )
+ // do not use an image set which doesn't fit into the window
+ continue;
+
+ const sal_Int64 distance =
+ ( aWindowSizePixel.Width() - check->Width ) * ( aWindowSizePixel.Width() - check->Width )
+ + ( aWindowSizePixel.Height() - check->Height ) * ( aWindowSizePixel.Height() - check->Height );
+ if ( distance < nMinimalDistance )
+ {
+ nMinimalDistance = distance;
+ nPreferredSet = check - aImageSizes.begin();
+ }
+ }
+ }
+
+ // found a set?
+ Sequence< Reference< XGraphic > > aImages;
+ if ( ( nPreferredSet >= 0 ) && ( size_t( nPreferredSet ) < nImageSetCount ) )
+ {
+ // => set the images
+ ::std::vector< CachedImage > const& rImageSet( i_data.aCachedImageSets[ nPreferredSet ] );
+ aImages.realloc( rImageSet.size() );
+ sal_Int32 imageIndex = 0;
+ for ( ::std::vector< CachedImage >::const_iterator cachedImage = rImageSet.begin();
+ cachedImage != rImageSet.end();
+ ++cachedImage, ++imageIndex
+ )
+ {
+ lcl_ensureImage_throw( xGraphicProvider, isHighContrast, *cachedImage );
+ aImages[ imageIndex ] = cachedImage->xGraphic;
+ }
+ }
+ pThrobber->setImageList( aImages );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_updateImageList_nothrow( AnimatedImagesPeer_Data& i_data, const Reference< XAnimatedImages >& i_images )
+ {
+ try
+ {
+ const sal_Int32 nImageSetCount = i_images->getImageSetCount();
+ i_data.aCachedImageSets.resize(0);
+ for ( sal_Int32 set = 0; set < nImageSetCount; ++set )
+ {
+ const Sequence< ::rtl::OUString > aImageURLs( i_images->getImageSet( set ) );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ i_data.aCachedImageSets.push_back( aImages );
+ }
+
+ lcl_updateImageList_nothrow( i_data );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesPeer::AnimatedImagesPeer()
+ :AnimatedImagesPeer_Base()
+ ,m_pData( new AnimatedImagesPeer_Data( *this ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesPeer::~AnimatedImagesPeer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::startAnimation( ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::stopAnimation( ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesPeer::isAnimationRunning( ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ return pThrobber->isRunning();
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::setProperty( const ::rtl::OUString& i_propertyName, const Any& i_value ) throw(RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ {
+ VCLXWindow::setProperty( i_propertyName, i_value );
+ return;
+ }
+
+ const sal_uInt16 nPropertyId = GetPropertyId( i_propertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME:
+ {
+ sal_Int32 nStepTime( 0 );
+ if ( i_value >>= nStepTime )
+ pThrobber->setStepTime( nStepTime );
+ break;
+ }
+ case BASEPROPERTY_AUTO_REPEAT:
+ {
+ sal_Bool bRepeat( sal_True );
+ if ( i_value >>= bRepeat )
+ pThrobber->setRepeat( bRepeat );
+ break;
+ }
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ sal_Int16 nScaleMode( ImageScaleMode::Anisotropic );
+ ImageControl* pImageControl = dynamic_cast< ImageControl* >( GetWindow() );
+ if ( pImageControl && ( i_value >>= nScaleMode ) )
+ {
+ pImageControl->SetScaleMode( nScaleMode );
+ }
+ }
+ break;
+
+ default:
+ AnimatedImagesPeer_Base::setProperty( i_propertyName, i_value );
+ break;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL AnimatedImagesPeer::getProperty( const ::rtl::OUString& i_propertyName ) throw(RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+
+ Any aReturn;
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ return VCLXWindow::getProperty( i_propertyName );
+
+ const sal_uInt16 nPropertyId = GetPropertyId( i_propertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME:
+ aReturn <<= pThrobber->getStepTime();
+ break;
+
+ case BASEPROPERTY_AUTO_REPEAT:
+ aReturn <<= pThrobber->getRepeat();
+ break;
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ ImageControl const* pImageControl = dynamic_cast< ImageControl* >( GetWindow() );
+ aReturn <<= ( pImageControl ? pImageControl->GetScaleMode() : ImageScaleMode::Anisotropic );
+ }
+ break;
+
+ default:
+ aReturn = AnimatedImagesPeer_Base::getProperty( i_propertyName );
+ break;
+ }
+
+ return aReturn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void AnimatedImagesPeer::ProcessWindowEvent( const VclWindowEvent& i_windowEvent )
+ {
+ switch ( i_windowEvent.GetId() )
+ {
+ case VCLEVENT_WINDOW_RESIZE:
+ lcl_updateImageList_nothrow( *m_pData );
+ break;
+ }
+
+ AnimatedImagesPeer_Base::ProcessWindowEvent( i_windowEvent );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void AnimatedImagesPeer::impl_updateImages_nolck( const Reference< XInterface >& i_animatedImages )
+ {
+ SolarMutexGuard aGuard;
+
+ lcl_updateImageList_nothrow( *m_pData, Reference< XAnimatedImages >( i_animatedImages, UNO_QUERY_THROW ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position > m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementInserted: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ Sequence< ::rtl::OUString > aImageURLs;
+ OSL_VERIFY( i_event.Element >>= aImageURLs );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ m_pData->aCachedImageSets.insert( m_pData->aCachedImageSets.begin() + position, aImages );
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position >= m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementRemoved: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ m_pData->aCachedImageSets.erase( m_pData->aCachedImageSets.begin() + position );
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ SolarMutexGuard aGuard;
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position >= m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementReplaced: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ Sequence< ::rtl::OUString > aImageURLs;
+ OSL_VERIFY( i_event.Element >>= aImageURLs );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ m_pData->aCachedImageSets[ position ] = aImages;
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ VCLXWindow::disposing( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::modified( const EventObject& i_event ) throw (RuntimeException)
+ {
+ impl_updateImages_nolck( i_event.Source );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::dispose( ) throw(RuntimeException)
+ {
+ AnimatedImagesPeer_Base::dispose();
+ SolarMutexGuard aGuard;
+ m_pData->aCachedImageSets.resize(0);
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/awt/asynccallback.cxx b/toolkit/source/awt/asynccallback.cxx
index e912e83bd12e..672c939d8fd4 100644
--- a/toolkit/source/awt/asynccallback.cxx
+++ b/toolkit/source/awt/asynccallback.cxx
@@ -194,10 +194,5 @@ void * SAL_CALL comp_AsyncCallback_component_getFactory(
implName, serviceManager, registryKey, entries);
}
-sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey, entries);
-}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/toolkit/source/awt/makefile.mk b/toolkit/source/awt/makefile.mk
deleted file mode 100644
index 88b40a597410..000000000000
--- a/toolkit/source/awt/makefile.mk
+++ /dev/null
@@ -1,84 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=toolkit
-TARGET=awt
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(GUIBASE)"=="aqua"
-CFLAGSCXX+=$(OBJCXXFLAGS)
-.ENDIF # "$(GUIBASE)"=="aqua"
-
-SLOFILES= \
- $(SLO)$/stylesettings.obj \
- $(SLO)$/vclxaccessiblecomponent.obj \
- $(SLO)$/vclxbitmap.obj \
- $(SLO)$/vclxcontainer.obj \
- $(SLO)$/vclxdevice.obj \
- $(SLO)$/vclxfont.obj \
- $(SLO)$/vclxgraphics.obj \
- $(SLO)$/vclxmenu.obj \
- $(SLO)$/vclxpointer.obj \
- $(SLO)$/vclxprinter.obj \
- $(SLO)$/vclxregion.obj \
- $(SLO)$/vclxsystemdependentwindow.obj \
- $(SLO)$/vclxtoolkit.obj \
- $(SLO)$/vclxtopwindow.obj \
- $(SLO)$/vclxwindow.obj \
- $(SLO)$/vclxwindow1.obj \
- $(SLO)$/vclxwindows.obj \
- $(SLO)$/vclxspinbutton.obj \
- $(SLO)$/xsimpleanimation.obj \
- $(SLO)$/xthrobber.obj \
- $(SLO)$/asynccallback.obj\
- $(SLO)/vclxbutton.obj\
- $(SLO)/vclxdialog.obj\
- $(SLO)/vclxfixedline.obj\
- $(SLO)/vclxplugin.obj\
- $(SLO)/vclxscroller.obj\
- $(SLO)/vclxsplitter.obj\
- $(SLO)/vclxtabcontrol.obj\
- $(SLO)/vclxtabpage.obj
-
-SRS1NAME=$(TARGET)
-SRC1FILES=\
- xthrobber.src
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index e8626333aad5..66a2a4bf1cb3 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -249,9 +249,9 @@ void VCLXAccessibleComponent::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
Window* pWindow = (Window*) rVclWindowEvent.GetData();
DBG_ASSERT( pWindow, "VCLEVENT_WINDOW_CHILDDESTROYED - Window=?" );
- if ( pWindow->GetAccessible( FALSE ).is() )
+ if ( pWindow->GetAccessible( sal_False ).is() )
{
- aOldValue <<= pWindow->GetAccessible( FALSE );
+ aOldValue <<= pWindow->GetAccessible( sal_False );
NotifyAccessibleEvent( accessibility::AccessibleEventId::CHILD, aOldValue, aNewValue );
}
}
@@ -446,7 +446,7 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation
Window* pWindow = GetWindow();
if ( pWindow )
{
- Window *pLabeledBy = pWindow->GetLabeledBy();
+ Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
@@ -454,7 +454,7 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation
rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) );
}
- Window* pLabelFor = pWindow->GetLabelFor();
+ Window* pLabelFor = pWindow->GetAccessibleRelationLabelFor();
if ( pLabelFor && pLabelFor != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
@@ -569,7 +569,7 @@ uno::Reference< accessibility::XAccessible > VCLXAccessibleComponent::getAccessi
uno::Reference< accessibility::XAccessible > xAcc;
if ( GetWindow() )
{
- Window* pChild = GetWindow()->GetAccessibleChildWindow( (USHORT)i );
+ Window* pChild = GetWindow()->GetAccessibleChildWindow( (sal_uInt16)i );
if ( pChild )
xAcc = pChild->GetAccessible();
}
@@ -621,7 +621,7 @@ sal_Int32 VCLXAccessibleComponent::getAccessibleIndexInParent( ) throw (uno::Ru
if ( pParent )
{
/*
- for ( USHORT n = pParent->GetAccessibleChildWindowCount(); n; )
+ for ( sal_uInt16 n = pParent->GetAccessibleChildWindowCount(); n; )
{
Window* pChild = pParent->GetAccessibleChildWindow( --n );
if ( pChild == GetWindow() )
diff --git a/toolkit/source/awt/vclxdialog.cxx b/toolkit/source/awt/vclxdialog.cxx
index d75ada7de73e..066cadc06978 100644
--- a/toolkit/source/awt/vclxdialog.cxx
+++ b/toolkit/source/awt/vclxdialog.cxx
@@ -202,13 +202,13 @@ void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star
pWindow->SetText( Title );
}
-void VCLXDialog::setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXDialog::setHelpId( const rtl::OUString& rId ) throw(::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aGuard;
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
::rtl::OUString VCLXDialog::getTitle() throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/awt/vclxdialog.hxx b/toolkit/source/awt/vclxdialog.hxx
index e7d92aad59c7..785f6b3b7e48 100644
--- a/toolkit/source/awt/vclxdialog.hxx
+++ b/toolkit/source/awt/vclxdialog.hxx
@@ -98,7 +98,7 @@ public:
// ::com::sun::star::awt::XDialog2
void SAL_CALL endDialog( sal_Int32 nResult ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setHelpId( const rtl::OUString& id ) throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx
index 66461db68e77..28224c30232d 100644
--- a/toolkit/source/awt/vclxfont.cxx
+++ b/toolkit/source/awt/vclxfont.cxx
@@ -63,7 +63,7 @@ void VCLXFont::Init( ::com::sun::star::awt::XDevice& rxDev, const Font& rFont )
maFont = rFont;
}
-BOOL VCLXFont::ImplAssertValidFontMetric()
+sal_Bool VCLXFont::ImplAssertValidFontMetric()
{
if ( !mpFontMetric && mxDevice.is() )
{
@@ -76,7 +76,7 @@ BOOL VCLXFont::ImplAssertValidFontMetric()
pOutDev->SetFont( aOldFont );
}
}
- return mpFontMetric ? TRUE : FALSE;
+ return mpFontMetric ? sal_True : sal_False;
}
@@ -150,7 +150,7 @@ sal_Int16 VCLXFont::getCharWidth( sal_Unicode c ) throw(::com::sun::star::uno::R
sal_Int16 nCount = nLast-nFirst + 1;
aSeq = ::com::sun::star::uno::Sequence<sal_Int16>( nCount );
- for ( USHORT n = 0; n < nCount; n++ )
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
aSeq.getArray()[n] = sal::static_int_cast< sal_Int16 >(
pOutDev->GetTextWidth(
@@ -205,7 +205,7 @@ void VCLXFont::getKernPairs( ::com::sun::star::uno::Sequence< sal_Unicode >& rnC
Font aOldFont = pOutDev->GetFont();
pOutDev->SetFont( maFont );
- ULONG nPairs = pOutDev->GetKerningPairCount();
+ sal_uLong nPairs = pOutDev->GetKerningPairCount();
if ( nPairs )
{
KerningPair* pData = new KerningPair[ nPairs ];
@@ -219,7 +219,7 @@ void VCLXFont::getKernPairs( ::com::sun::star::uno::Sequence< sal_Unicode >& rnC
sal_Unicode* pChars2 = rnChars2.getArray();
sal_Int16* pKerns = rnKerns.getArray();
- for ( ULONG n = 0; n < nPairs; n++ )
+ for ( sal_uLong n = 0; n < nPairs; n++ )
{
pChars1[n] = pData[n].nChar1;
pChars2[n] = pData[n].nChar2;
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 3257da29fb49..919986fa49f6 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -108,7 +108,7 @@ VCLXMenu::~VCLXMenu()
}
}
-BOOL VCLXMenu::IsPopupMenu() const
+sal_Bool VCLXMenu::IsPopupMenu() const
{
return (mpMenu && ! mpMenu->IsMenuBar());
}
@@ -721,7 +721,7 @@ namespace
sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 );
sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 );
sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 );
- USHORT nKey = (USHORT)aAWTKey.KeyCode;
+ sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode;
return KeyCode(nKey, bShift, bMod1, bMod2, bMod3);
}
@@ -1089,7 +1089,7 @@ DBG_NAME(VCLXMenuBar);
VCLXMenuBar::VCLXMenuBar()
{
DBG_CTOR( VCLXMenuBar, 0 );
- ImplCreateMenu( FALSE );
+ ImplCreateMenu( sal_False );
}
VCLXMenuBar::VCLXMenuBar( MenuBar* pMenuBar ) : VCLXMenu( (Menu *)pMenuBar )
@@ -1106,7 +1106,7 @@ DBG_NAME(VCLXPopupMenu);
VCLXPopupMenu::VCLXPopupMenu()
{
DBG_CTOR( VCLXPopupMenu, 0 );
- ImplCreateMenu( TRUE );
+ ImplCreateMenu( sal_True );
}
VCLXPopupMenu::VCLXPopupMenu( PopupMenu* pPopMenu ) : VCLXMenu( (Menu *)pPopMenu )
diff --git a/toolkit/source/awt/vclxplugin.hxx b/toolkit/source/awt/vclxplugin.hxx
index 340fa453441f..458fef360d57 100644
--- a/toolkit/source/awt/vclxplugin.hxx
+++ b/toolkit/source/awt/vclxplugin.hxx
@@ -30,7 +30,7 @@
#define LAYOUT_AWT_VCLXPLUGIN_HXX
#include <toolkit/awt/vclxwindow.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
class Control;
namespace layoutimpl
diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx
index 99a1924cecd1..f7df2a3291b3 100644
--- a/toolkit/source/awt/vclxregion.cxx
+++ b/toolkit/source/awt/vclxregion.cxx
@@ -155,7 +155,7 @@ void VCLXRegion::xOrRegion( const ::com::sun::star::uno::Reference< ::com::sun::
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- ULONG nRects = maRegion.GetRectCount();
+ sal_uLong nRects = maRegion.GetRectCount();
::com::sun::star::uno::Sequence< ::com::sun::star::awt::Rectangle > aRects( nRects );
Rectangle aRect;
diff --git a/toolkit/source/awt/vclxtabcontrol.cxx b/toolkit/source/awt/vclxtabcontrol.cxx
index 40566b886676..cc3940c92784 100644
--- a/toolkit/source/awt/vclxtabcontrol.cxx
+++ b/toolkit/source/awt/vclxtabcontrol.cxx
@@ -123,7 +123,7 @@ TabControl *VCLXTabControl::getTabControl() const throw (uno::RuntimeException)
sal_Int32 SAL_CALL VCLXTabControl::insertTab() throw (uno::RuntimeException)
{
TabControl *pTabControl = getTabControl();
- USHORT id = sal::static_int_cast< USHORT >( mTabId++ );
+ sal_uInt16 id = sal::static_int_cast< sal_uInt16 >( mTabId++ );
rtl::OUString title (RTL_CONSTASCII_USTRINGPARAM( "" ) );
pTabControl->InsertPage( id, title.getStr(), TAB_APPEND );
pTabControl->SetTabPage( id, new TabPage( pTabControl ) );
@@ -133,17 +133,17 @@ sal_Int32 SAL_CALL VCLXTabControl::insertTab() throw (uno::RuntimeException)
void SAL_CALL VCLXTabControl::removeTab( sal_Int32 ID ) throw (uno::RuntimeException, IndexOutOfBoundsException)
{
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw IndexOutOfBoundsException();
- pTabControl->RemovePage( sal::static_int_cast< USHORT >( ID ) );
+ pTabControl->RemovePage( sal::static_int_cast< sal_uInt16 >( ID ) );
}
void SAL_CALL VCLXTabControl::activateTab( sal_Int32 ID ) throw (uno::RuntimeException, IndexOutOfBoundsException)
{
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw IndexOutOfBoundsException();
- pTabControl->SelectTabPage( sal::static_int_cast< USHORT >( ID ) );
+ pTabControl->SelectTabPage( sal::static_int_cast< sal_uInt16 >( ID ) );
}
sal_Int32 SAL_CALL VCLXTabControl::getActiveTabID() throw (uno::RuntimeException)
@@ -181,7 +181,7 @@ void SAL_CALL VCLXTabControl::removeTabListener( const uno::Reference< awt::XTab
void SAL_CALL VCLXTabControl::setTabProps( sal_Int32 ID, const uno::Sequence< NamedValue >& Properties ) throw (uno::RuntimeException, IndexOutOfBoundsException)
{
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw IndexOutOfBoundsException();
for ( int i = 0; i < Properties.getLength(); i++ )
@@ -192,7 +192,7 @@ void SAL_CALL VCLXTabControl::setTabProps( sal_Int32 ID, const uno::Sequence< Na
if ( name == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ) )
{
rtl::OUString title = value.get<rtl::OUString>();
- pTabControl->SetPageText( sal::static_int_cast< USHORT >( ID ), title.getStr() );
+ pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( ID ), title.getStr() );
}
}
}
@@ -201,7 +201,7 @@ uno::Sequence< NamedValue > SAL_CALL VCLXTabControl::getTabProps( sal_Int32 ID )
throw (IndexOutOfBoundsException, uno::RuntimeException)
{
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw IndexOutOfBoundsException();
#define ADD_PROP( seq, i, name, val ) { \
@@ -212,8 +212,8 @@ uno::Sequence< NamedValue > SAL_CALL VCLXTabControl::getTabProps( sal_Int32 ID )
}
uno::Sequence< NamedValue > props( 2 );
- ADD_PROP( props, 0, "Title", rtl::OUString( pTabControl->GetPageText( sal::static_int_cast< USHORT >( ID ) ) ) );
- ADD_PROP( props, 1, "Position", pTabControl->GetPagePos( sal::static_int_cast< USHORT >( ID ) ) );
+ ADD_PROP( props, 0, "Title", rtl::OUString( pTabControl->GetPageText( sal::static_int_cast< sal_uInt16 >( ID ) ) ) );
+ ADD_PROP( props, 1, "Position", pTabControl->GetPagePos( sal::static_int_cast< sal_uInt16 >( ID ) ) );
#undef ADD_PROP
return props;
}
@@ -224,7 +224,7 @@ void SAL_CALL VCLXTabControl::draw( sal_Int32 nX, sal_Int32 nY ) throw(uno::Runt
SolarMutexGuard aGuard;
TabControl *pTabControl = getTabControl();
- TabPage *pTabPage = pTabControl->GetTabPage( sal::static_int_cast< USHORT >( getActiveTabID() ) );
+ TabPage *pTabPage = pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( getActiveTabID() ) );
if ( pTabPage )
{
::Point aPos( nX, nY );
@@ -385,8 +385,8 @@ void SAL_CALL VCLXTabControl::allocateArea (awt::Rectangle const &area)
if ( active )
{
- ::Rectangle label_rect = pTabControl->GetTabBounds( sal::static_int_cast< USHORT >( i+1 ) );
- ::Rectangle page_rect = pTabControl->GetTabPageBounds( sal::static_int_cast< USHORT >( i+1 ) );
+ ::Rectangle label_rect = pTabControl->GetTabBounds( sal::static_int_cast< sal_uInt16 >( i+1 ) );
+ ::Rectangle page_rect = pTabControl->GetTabPageBounds( sal::static_int_cast< sal_uInt16 >( i+1 ) );
awt::Rectangle childRect;
childRect.X = page_rect.Left();
@@ -419,7 +419,7 @@ awt::Size SAL_CALL VCLXTabControl::getMinimumSize()
if ( child->mxChild.is() )
{
// set the title prop here...
- pTabControl->SetPageText( sal::static_int_cast< USHORT >( i+1 ), child->maTitle.getStr() );
+ pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( i+1 ), child->maTitle.getStr() );
awt::Size childSize( child->mxChild->getMinimumSize() );
childrenSize.Width = SAL_MAX( childSize.Width, childrenSize.Width );
@@ -459,7 +459,7 @@ void VCLXTabControl::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent
case VCLEVENT_TABPAGE_REMOVEDALL:
case VCLEVENT_TABPAGE_PAGETEXTCHANGED:
{
- ULONG page = (ULONG) _rVclWindowEvent.GetData();
+ sal_uLong page = (sal_uLong) _rVclWindowEvent.GetData();
for ( std::list< uno::Reference
< awt::XTabListener > >::iterator it
= mxTabListeners.begin(); it != mxTabListeners.end(); ++it )
@@ -485,7 +485,7 @@ void VCLXTabControl::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent
case VCLEVENT_TABPAGE_REMOVEDALL:
for ( int i = 1; i < mTabId; i++)
{
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( i ) ) )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( i ) ) )
listener->removed( i );
}
break;
diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx
new file mode 100644
index 000000000000..9eecb16286ca
--- /dev/null
+++ b/toolkit/source/awt/vclxtabpagecontainer.cxx
@@ -0,0 +1,234 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include <toolkit/awt/vclxtabpagecontainer.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
+#include <vcl/svapp.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+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::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::view;
+// ----------------------------------------------------
+// class VCLXTabPageContainer
+// ----------------------------------------------------
+void VCLXTabPageContainer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+ VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
+VCLXTabPageContainer::VCLXTabPageContainer() :
+ m_aTabPageListeners( *this )
+{
+}
+
+VCLXTabPageContainer::~VCLXTabPageContainer()
+{
+#ifndef __SUNPRO_CC
+ OSL_TRACE ("%s", __FUNCTION__);
+#endif
+}
+
+void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ TabControl* pTabControl = (TabControl*)GetWindow();
+ if ( pTabControl )
+ {
+ TabPage *pTabPage = pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( pTabControl->GetCurPageId( ) ) );
+ if ( pTabPage )
+ {
+ ::Point aPos( nX, nY );
+ ::Size aSize = pTabPage->GetSizePixel();
+
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ aPos = pDev->PixelToLogic( aPos );
+ aSize = pDev->PixelToLogic( aSize );
+
+ pTabPage->Draw( pDev, aPos, aSize, 0 );
+ }
+ }
+
+ VCLXWindow::draw( nX, nY );
+/*
+ if ( pWindow )
+ {
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ if ( !pDev )
+ pDev = pWindow->GetParent();
+
+ Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() );
+ Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
+
+ pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
+ }
+*/
+}
+
+::com::sun::star::awt::DeviceInfo VCLXTabPageContainer::getInfo() throw(RuntimeException)
+{
+ ::com::sun::star::awt::DeviceInfo aInfo = VCLXDevice::getInfo();
+ return aInfo;
+}
+
+void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyName, const Any& Value ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ TabControl* pTabPage = (TabControl*)GetWindow();
+ if ( pTabPage )
+ {
+ VCLXWindow::setProperty( PropertyName, Value );
+ }
+}
+::sal_Int16 SAL_CALL VCLXTabPageContainer::getActiveTabPageID() throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ return pTabCtrl != NULL ? pTabCtrl->GetCurPageId( ) : 0;
+}
+void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ if ( pTabCtrl )
+ pTabCtrl->SelectTabPage(_activetabpageid);
+}
+::sal_Int32 SAL_CALL VCLXTabPageContainer::getTabPageCount( ) throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ return pTabCtrl != NULL ? pTabCtrl->GetPageCount() : 0;
+}
+::sal_Bool SAL_CALL VCLXTabPageContainer::isTabPageActive( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ return (getActiveTabPageID() == tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ return (tabPageIndex >= 0 && tabPageIndex < static_cast<sal_Int16>(m_aTabPages.size())) ? m_aTabPages[tabPageIndex] : NULL;
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage;
+ ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aIter = m_aTabPages.begin();
+ ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aEnd = m_aTabPages.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ Reference< awt::XControl > xControl(*aIter,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ if ( tabPageID == xP->getTabPageID() )
+ {
+ xTabPage = *aIter;
+ break;
+ }
+ }
+ return xTabPage;
+}
+void SAL_CALL VCLXTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.addInterface( listener );
+}
+void SAL_CALL VCLXTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.removeInterface( listener );
+}
+
+void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
+{
+ SolarMutexClearableGuard aGuard;
+ TabControl* pTabControl = static_cast< TabControl* >( GetWindow() );
+ if ( pTabControl )
+ {
+ switch ( _rVclWindowEvent.GetId() )
+ {
+ case VCLEVENT_TABPAGE_ACTIVATE:
+ {
+// allocateArea( maAllocation );
+ sal_uLong page = (sal_uLong)_rVclWindowEvent.GetData();
+ awt::tab::TabPageActivatedEvent aEvent(NULL,page);
+ m_aTabPageListeners.tabPageActivated(aEvent);
+ break;
+ }
+ default:
+ aGuard.clear();
+ VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
+ break;
+ }
+ }
+}
+void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
+ if ( pTabCtrl && xTabPage.is() )
+ {
+ Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ sal_Int16 nPageID = xP->getTabPageID();
+
+ Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
+ TabPage* pPage = (TabPage*)pWindow;
+ pTabCtrl->InsertPage(nPageID,pPage->GetText());
+
+ pPage->Hide();
+ pTabCtrl->SetTabPage(nPageID,pPage);
+ pTabCtrl->SetHelpText(nPageID,xP->getTooltip());
+ pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
+ pTabCtrl->SelectTabPage(nPageID);
+ m_aTabPages.push_back(xTabPage);
+ }
+}
+void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
+ if ( pTabCtrl && xTabPage.is() )
+ {
+ Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ pTabCtrl->RemovePage(xP->getTabPageID());
+ m_aTabPages.erase(::std::remove(m_aTabPages.begin(),m_aTabPages.end(),xTabPage));
+ }
+}
+void SAL_CALL VCLXTabPageContainer::elementReplaced( const ::com::sun::star::container::ContainerEvent& /*Event*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
diff --git a/toolkit/source/awt/vclxtabpagemodel.cxx b/toolkit/source/awt/vclxtabpagemodel.cxx
new file mode 100644
index 000000000000..c7145992bd7f
--- /dev/null
+++ b/toolkit/source/awt/vclxtabpagemodel.cxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include <toolkit/awt/vclxtabpagemodel.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <cppuhelper/typeprovider.hxx>
+// ----------------------------------------------------
+// class VCLXDialog
+// ----------------------------------------------------
+
+VCLXTabPageModel::VCLXTabPageModel()
+{
+}
+
+VCLXTabPageModel::~VCLXTabPageModel()
+{
+#ifndef __SUNPRO_CC
+ OSL_TRACE ("%s", __FUNCTION__);
+#endif
+}
+
+void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( GetMutex() );
+ Window* pWindow = GetWindow();
+
+ if ( pWindow )
+ {
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ if ( !pDev )
+ pDev = pWindow->GetParent();
+
+ Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() );
+ Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
+
+ pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
+ }
+}
+
+::com::sun::star::awt::DeviceInfo VCLXTabPageModel::getInfo() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::awt::DeviceInfo aInfo;// = VCLXDevice::getInfo();
+ return aInfo;
+}
+
+
+void SAL_CALL VCLXTabPageModel::setProperty(
+ const ::rtl::OUString& /*PropertyName*/,
+ const ::com::sun::star::uno::Any& /*Value*/ )
+throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( GetMutex() );
+
+ /*TabPage* pTabPage = (TabPage*)GetWindow();
+ if ( pTabPage )
+ {
+ VCLXWindow::setProperty( PropertyName, Value );
+ }*/
+}
+//XTabPageModel
+::sal_Int16 SAL_CALL VCLXTabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+{
+ return 0;
+}
+::sal_Bool SAL_CALL VCLXTabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+{
+ return false;
+}
+void SAL_CALL VCLXTabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // pTabControl->EnablePage(0, true);
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // return pTabControl->GetPageText(0);
+ //else
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // pTabControl->SetPageText(0, _title);
+
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setImageURL( const ::rtl::OUString& /*_imageurl*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //m_sImageURL = _imageurl;
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+{
+ //return m_sTooltip;
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)_tooltip;
+}
+::cppu::IPropertyArrayHelper& VCLXTabPageModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ com::sun::star::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > VCLXTabPageModel::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index cdac85f86885..72b9e05688c8 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -35,6 +35,7 @@
#include <tools/svwin.h>
#include <stdio.h>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
@@ -69,9 +70,12 @@
#include <toolkit/awt/vclxsystemdependentwindow.hxx>
#include <toolkit/awt/vclxregion.hxx>
#include <toolkit/awt/vclxtoolkit.hxx>
+#include <toolkit/awt/vclxtabpagecontainer.hxx>
+#include <toolkit/awt/vclxtabpagemodel.hxx>
#include <toolkit/awt/xsimpleanimation.hxx>
#include <toolkit/awt/xthrobber.hxx>
+#include <toolkit/awt/animatedimagespeer.hxx>
#include <toolkit/awt/vclxtopwindow.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -113,6 +117,7 @@
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
+#include <vcl/throbber.hxx>
#include "toolkit/awt/vclxspinbutton.hxx"
#include <tools/debug.hxx>
@@ -313,6 +318,7 @@ static ComponentInfo aComponentInfos [] =
{ "scrollbar", WINDOW_SCROLLBAR },
{ "scrollbarbox", WINDOW_SCROLLBARBOX },
{ "simpleanimation", WINDOW_CONTROL },
+ { "animatedimages", WINDOW_CONTROL },
{ "spinbutton", WINDOW_SPINBUTTON },
{ "spinfield", WINDOW_SPINFIELD },
{ "throbber", WINDOW_CONTROL },
@@ -329,7 +335,9 @@ static ComponentInfo aComponentInfos [] =
{ "tristatebox", WINDOW_TRISTATEBOX },
{ "warningbox", WINDOW_WARNINGBOX },
{ "window", WINDOW_WINDOW },
- { "workwindow", WINDOW_WORKWINDOW }
+ { "workwindow", WINDOW_WORKWINDOW },
+ { "tabpagecontainer", WINDOW_CONTROL },
+ { "tabpagemodel", WINDOW_TABPAGE }
};
extern "C"
@@ -384,7 +392,7 @@ sal_uInt16 ImplGetComponentType( const String& rServiceName )
// ----------------------------------------------------
static sal_Int32 nVCLToolkitInstanceCount = 0;
-static BOOL bInitedByVCLToolkit = sal_False;
+static sal_Bool bInitedByVCLToolkit = sal_False;
//static cppu::OInterfaceContainerHelper * pToolkits = 0;
static osl::Mutex & getInitMutex()
@@ -687,7 +695,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
break;
case WINDOW_CURRENCYFIELD:
pNewWindow = new CurrencyField( pParent, nWinBits );
- static_cast<CurrencyField*>(pNewWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<CurrencyField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new VCLXNumericField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(CurrencyField*)pNewWindow );
break;
@@ -696,7 +704,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
break;
case WINDOW_DATEFIELD:
pNewWindow = new DateField( pParent, nWinBits );
- static_cast<DateField*>(pNewWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<DateField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new VCLXDateField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pNewWindow );
break;
@@ -738,7 +746,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
*ppNewComp = new VCLXFrame;
// Frame control needs to recieve
// Mouse events
- pGroupBox->SetMouseTransparent( FALSE );
+ pGroupBox->SetMouseTransparent( sal_False );
}
}
break;
@@ -811,7 +819,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
break;
case WINDOW_NUMERICFIELD:
pNewWindow = new NumericField( pParent, nWinBits );
- static_cast<NumericField*>(pNewWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<NumericField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new VCLXNumericField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(NumericField*)pNewWindow );
break;
@@ -843,12 +851,12 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
// Since the VCLXRadioButton really cares for it's RadioCheck settings, this is important:
// if we enable it, the VCLXRadioButton will use RadioButton::Check instead of RadioButton::SetState
// This leads to a strange behaviour if the control is newly created: when settings the initial
- // state to "checked", the RadioButton::Check (called because RadioCheck=TRUE) will uncheck
+ // state to "checked", the RadioButton::Check (called because RadioCheck=sal_True) will uncheck
// _all_other_ radio buttons in the same group. However, at this moment the grouping of the controls
// is not really valid: the controls are grouped after they have been created, but we're still in
// the creation process, so the RadioButton::Check relies on invalid grouping information.
// 07.08.2001 - #87254# - frank.schoenheit@sun.com
- static_cast<RadioButton*>(pNewWindow)->EnableRadioCheck( FALSE );
+ static_cast<RadioButton*>(pNewWindow)->EnableRadioCheck( sal_False );
break;
case WINDOW_SCROLLBAR:
pNewWindow = new ScrollBar( pParent, nWinBits );
@@ -886,15 +894,26 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
pNewWindow = new TabDialog( pParent, nWinBits );
break;
case WINDOW_TABPAGE:
- pNewWindow = new TabPage( pParent, nWinBits );
- *ppNewComp = new VCLXTabPage;
+ /*
+ if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
+ ::rtl::OUString::createFromAscii("tabpagemodel") ) )
+ {
+ pNewWindow = new TabControl( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPageContainer;
+ }
+ else
+ */
+ {
+ pNewWindow = new TabPage( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPage;
+ }
break;
case WINDOW_TIMEBOX:
pNewWindow = new TimeBox( pParent, nWinBits );
break;
case WINDOW_TIMEFIELD:
pNewWindow = new TimeField( pParent, nWinBits );
- static_cast<TimeField*>(pNewWindow)->EnableEmptyFieldValue( TRUE );
+ static_cast<TimeField*>(pNewWindow)->EnableEmptyFieldValue( sal_True );
*ppNewComp = new VCLXTimeField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(TimeField*)pNewWindow );
break;
@@ -1002,22 +1021,35 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
}
break;
case WINDOW_CONTROL:
- if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simpleanimation")) ) )
+ if ( aServiceName.EqualsAscii( "simpleanimation" ) )
{
- nWinBits |= WB_SCALE;
- pNewWindow = new FixedImage( pParent, nWinBits );
+ pNewWindow = new Throbber( pParent, nWinBits, Throbber::IMAGES_NONE );
+ ((Throbber*)pNewWindow)->SetScaleMode( css::awt::ImageScaleMode::Anisotropic );
+ // (compatibility)
*ppNewComp = new ::toolkit::XSimpleAnimation;
}
- else if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("throbber")) ) )
+ else if ( aServiceName.EqualsAscii( "throbber" ) )
{
- nWinBits |= WB_SCALE;
- pNewWindow = new FixedImage( pParent, nWinBits );
+ pNewWindow = new Throbber( pParent, nWinBits, Throbber::IMAGES_NONE );
+ ((Throbber*)pNewWindow)->SetScaleMode( css::awt::ImageScaleMode::Anisotropic );
+ // (compatibility)
*ppNewComp = new ::toolkit::XThrobber;
}
+ else if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
+ ::rtl::OUString::createFromAscii("tabpagecontainer") ) )
+ {
+ pNewWindow = new TabControl( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPageContainer;
+ }
+ else if ( aServiceName.EqualsAscii( "animatedimages" ) )
+ {
+ pNewWindow = new Throbber( pParent, nWinBits );
+ *ppNewComp = new ::toolkit::AnimatedImagesPeer;
+ }
break;
- default: DBG_ERRORFILE( "UNO3!" );
+ default:
+ OSL_ENSURE( false, "VCLXToolkit::ImplCreateWindow: unknown window type!" );
+ break;
}
}
@@ -1061,7 +1093,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
// try to load the lib
if ( !fnSvtCreateWindow && !hSvToolsLib )
{
- ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "svt", TRUE );
+ ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "svt", sal_True );
hSvToolsLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hSvToolsLib )
@@ -1108,11 +1140,11 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
}
else
{
- pNewComp->SetCreatedWithToolkit( TRUE );
+ pNewComp->SetCreatedWithToolkit( sal_True );
xRef = pNewComp;
pNewWindow->SetComponentInterface( xRef );
}
- DBG_ASSERT( pNewWindow->GetComponentInterface( FALSE ) == xRef,
+ DBG_ASSERT( pNewWindow->GetComponentInterface( sal_False ) == xRef,
"VCLXToolkit::createWindow: did #133706# resurge?" );
if ( rDescriptor.WindowAttributes & ::com::sun::star::awt::WindowAttribute::SHOW )
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index f43e020b2f74..4db3a3fde38e 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -66,8 +66,9 @@
#include <vcl/tabpage.hxx>
#include <vcl/button.hxx>
#include <comphelper/asyncnotification.hxx>
+#include <comphelper/flagguard.hxx>
#include "stylesettings.hxx"
-
+#include <tools/urlobj.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <boost/bind.hpp>
@@ -93,32 +94,6 @@ namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
//====================================================================
-//= misc helpers
-//====================================================================
-namespace
-{
- //................................................................
- //. FlagGuard
- //................................................................
- class FlagGuard
- {
- private:
- bool& m_rFlag;
-
- public:
- FlagGuard( bool& _rFlag )
- :m_rFlag( _rFlag )
- {
- m_rFlag = true;
- }
- ~FlagGuard()
- {
- m_rFlag = false;
- }
- };
-}
-
-//====================================================================
//= VCLXWindowImpl
//====================================================================
class SAL_DLLPRIVATE VCLXWindowImpl
@@ -148,7 +123,7 @@ private:
TopWindowListenerMultiplexer maTopWindowListeners;
CallbackArray maCallbackEvents;
- ULONG mnCallbackEventId;
+ sal_uLong mnCallbackEventId;
public:
bool mbDisposing : 1;
@@ -156,7 +131,7 @@ public:
bool mbSynthesizingVCLEvent : 1;
bool mbWithDefaultProps : 1;
- ULONG mnListenerLockLevel;
+ sal_uLong mnListenerLockLevel;
sal_Int16 mnWritingMode;
sal_Int16 mnContextWritingMode;
@@ -889,7 +864,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getDockableWindowListeners().getLength() )
{
- BOOL *p_bFloating = (BOOL*)rVclWindowEvent.GetData();
+ sal_Bool *p_bFloating = (sal_Bool*)rVclWindowEvent.GetData();
::com::sun::star::lang::EventObject aEvent;
aEvent.Source = (::cppu::OWeakObject*)this;
@@ -948,7 +923,7 @@ void VCLXWindow::SetSynthesizingVCLEvent( sal_Bool _b )
mpImpl->mbSynthesizingVCLEvent = _b;
}
-BOOL VCLXWindow::IsSynthesizingVCLEvent() const
+sal_Bool VCLXWindow::IsSynthesizingVCLEvent() const
{
return mpImpl->mbSynthesizingVCLEvent;
}
@@ -1089,7 +1064,7 @@ void VCLXWindow::setEnable( sal_Bool bEnable ) throw(::com::sun::star::uno::Runt
Window* pWindow = GetWindow();
if ( pWindow )
{
- pWindow->Enable( bEnable, FALSE ); // #95824# without children!
+ pWindow->Enable( bEnable, sal_False ); // #95824# without children!
pWindow->EnableInput( bEnable );
}
}
@@ -1114,7 +1089,7 @@ void VCLXWindow::addWindowListener( const ::com::sun::star::uno::Reference< ::co
// #100119# Get all resize events, even if height or width 0, or invisible
if ( GetWindow() )
- GetWindow()->EnableAllResize( TRUE );
+ GetWindow()->EnableAllResize( sal_True );
}
void VCLXWindow::removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
@@ -1347,7 +1322,7 @@ namespace toolkit
(aStyleSettings.*pSetter)( Color( nColor ) );
aSettings.SetStyleSettings( aStyleSettings );
- _pWindow->SetSettings( aSettings, TRUE );
+ _pWindow->SetSettings( aSettings, sal_True );
}
}
@@ -1423,11 +1398,11 @@ namespace
{
void lcl_updateWritingMode( Window& _rWindow, const sal_Int16 _nWritingMode, const sal_Int16 _nContextWritingMode )
{
- BOOL bEnableRTL = FALSE;
+ sal_Bool bEnableRTL = sal_False;
switch ( _nWritingMode )
{
- case WritingMode2::LR_TB: bEnableRTL = FALSE; break;
- case WritingMode2::RL_TB: bEnableRTL = TRUE; break;
+ case WritingMode2::LR_TB: bEnableRTL = sal_False; break;
+ case WritingMode2::RL_TB: bEnableRTL = sal_True; break;
case WritingMode2::CONTEXT:
{
// consult our ContextWritingMode. If it has an explicit RTL/LTR value, then use
@@ -1435,8 +1410,8 @@ namespace
// own window for its RTL mode
switch ( _nContextWritingMode )
{
- case WritingMode2::LR_TB: bEnableRTL = FALSE; break;
- case WritingMode2::RL_TB: bEnableRTL = TRUE; break;
+ case WritingMode2::LR_TB: bEnableRTL = sal_False; break;
+ case WritingMode2::RL_TB: bEnableRTL = sal_True; break;
case WritingMode2::CONTEXT:
{
const Window* pParent = _rWindow.GetParent();
@@ -1507,7 +1482,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
AllSettings aSettings = pWindow->GetSettings();
MouseSettings aMouseSettings = aSettings.GetMouseSettings();
- USHORT nVclBehavior( MOUSE_WHEEL_FOCUS_ONLY );
+ sal_uInt16 nVclBehavior( MOUSE_WHEEL_FOCUS_ONLY );
switch ( nWheelBehavior )
{
case MouseWheelBehavior::SCROLL_DISABLED: nVclBehavior = MOUSE_WHEEL_DISABLE; break;
@@ -1519,7 +1494,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
aMouseSettings.SetWheelBehavior( nVclBehavior );
aSettings.SetMouseSettings( aMouseSettings );
- pWindow->SetSettings( aSettings, TRUE );
+ pWindow->SetSettings( aSettings, sal_True );
}
break;
@@ -1594,17 +1569,11 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
::rtl::OUString aURL;
if ( Value >>= aURL )
{
- String aHelpURL( aURL );
- String aPattern( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) );
- if ( aHelpURL.CompareIgnoreCaseToAscii( aPattern, aPattern.Len() ) == COMPARE_EQUAL )
- {
- String aID = aHelpURL.Copy( aPattern.Len() );
- pWindow->SetHelpId( aID.ToInt32() );
- }
+ INetURLObject aHelpURL( aURL );
+ if ( aHelpURL.GetProtocol() == INET_PROT_HID )
+ pWindow->SetHelpId( rtl::OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
else
- {
- pWindow->SetSmartHelpId( SmartId( aHelpURL ) );
- }
+ pWindow->SetHelpId( rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) );
}
}
break;
@@ -1680,7 +1649,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
// support transparency only for special controls
pWindow->SetBackground();
pWindow->SetControlBackground();
- pWindow->SetPaintTransparent( TRUE );
+ pWindow->SetPaintTransparent( sal_True );
break;
}
@@ -1713,7 +1682,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
case WINDOW_RADIOBUTTON:
case WINDOW_GROUPBOX:
case WINDOW_FIXEDLINE:
- pWindow->SetPaintTransparent( FALSE );
+ pWindow->SetPaintTransparent( sal_False );
default: ;
}
pWindow->Invalidate(); // Falls das Control nicht drauf reagiert
@@ -1945,7 +1914,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
case BASEPROPERTY_REPEAT:
{
- sal_Bool bRepeat( FALSE );
+ sal_Bool bRepeat( sal_False );
Value >>= bRepeat;
WinBits nStyle = pWindow->GetStyle();
@@ -1968,7 +1937,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
aMouseSettings.SetButtonRepeat( nRepeatDelay );
aSettings.SetMouseSettings( aMouseSettings );
- pWindow->SetSettings( aSettings, TRUE );
+ pWindow->SetSettings( aSettings, sal_True );
}
}
break;
@@ -2023,7 +1992,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:
{
- USHORT nVclBehavior = GetWindow()->GetSettings().GetMouseSettings().GetWheelBehavior();
+ sal_uInt16 nVclBehavior = GetWindow()->GetSettings().GetMouseSettings().GetWheelBehavior();
sal_Int16 nBehavior = MouseWheelBehavior::SCROLL_FOCUS_ONLY;
switch ( nVclBehavior )
{
@@ -2075,19 +2044,8 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::
break;
case BASEPROPERTY_HELPURL:
{
- SmartId aSmartId = GetWindow()->GetSmartHelpId();
- if( aSmartId.HasString() )
- {
- String aStrHelpId = aSmartId.GetStr();
- aProp <<= ::rtl::OUString( aStrHelpId );
- }
- else
- {
- ::rtl::OUStringBuffer aURL;
- aURL.appendAscii( "HID:" );
- aURL.append( (sal_Int32) GetWindow()->GetHelpId() );
- aProp <<= aURL.makeStringAndClear();
- }
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ aProp <<= ::rtl::OUString( aHelpId );
}
break;
case BASEPROPERTY_FONTDESCRIPTOR:
@@ -2358,9 +2316,9 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno:
// #i40647# / 2005-01-18 / frank.schoenheit@sun.com
if ( !mpImpl->getDrawingOntoParent_ref() )
{
- FlagGuard aDrawingflagGuard( mpImpl->getDrawingOntoParent_ref() );
+ ::comphelper::FlagGuard aDrawingflagGuard( mpImpl->getDrawingOntoParent_ref() );
- BOOL bWasVisible = pWindow->IsVisible();
+ sal_Bool bWasVisible = pWindow->IsVisible();
Point aOldPos( pWindow->GetPosPixel() );
if ( bWasVisible && aOldPos == aPos )
@@ -2385,7 +2343,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno:
pWindow->SetPosPixel( aOldPos );
if ( bWasVisible )
- pWindow->Show( TRUE );
+ pWindow->Show( sal_True );
}
}
else if ( pDev )
@@ -2404,12 +2362,12 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno:
}
else
{
- BOOL bOldNW =pWindow->IsNativeWidgetEnabled();
+ sal_Bool bOldNW =pWindow->IsNativeWidgetEnabled();
if( bOldNW )
- pWindow->EnableNativeWidget(FALSE);
+ pWindow->EnableNativeWidget(sal_False);
pWindow->PaintToDevice( pDev, aP, aSz );
if( bOldNW )
- pWindow->EnableNativeWidget(TRUE);
+ pWindow->EnableNativeWidget(sal_True);
}
}
}
@@ -2505,7 +2463,7 @@ sal_Bool SAL_CALL VCLXWindow::isFloating( ) throw (::com::sun::star::uno::Runti
if( pWindow )
return Window::GetDockingManager()->IsFloating( pWindow );
else
- return FALSE;
+ return sal_False;
}
void SAL_CALL VCLXWindow::setFloatingMode( sal_Bool bFloating ) throw (::com::sun::star::uno::RuntimeException)
@@ -2525,7 +2483,7 @@ sal_Bool SAL_CALL VCLXWindow::isLocked( ) throw (::com::sun::star::uno::Runtime
if( pWindow )
return Window::GetDockingManager()->IsLocked( pWindow );
else
- return FALSE;
+ return sal_False;
}
void SAL_CALL VCLXWindow::lock( ) throw (::com::sun::star::uno::RuntimeException)
@@ -2556,7 +2514,7 @@ sal_Bool SAL_CALL VCLXWindow::isInPopupMode( ) throw (::com::sun::star::uno::Ru
{
// TODO: remove interface in the next incompatible build
SolarMutexGuard aGuard;
- return FALSE;
+ return sal_False;
}
@@ -2598,7 +2556,7 @@ sal_Bool SAL_CALL VCLXWindow::isVisible( ) throw (::com::sun::star::uno::Runtim
if( GetWindow() )
return GetWindow()->IsVisible();
else
- return FALSE;
+ return sal_False;
}
sal_Bool SAL_CALL VCLXWindow::isActive( ) throw (::com::sun::star::uno::RuntimeException)
@@ -2607,7 +2565,7 @@ sal_Bool SAL_CALL VCLXWindow::isActive( ) throw (::com::sun::star::uno::Runtime
if( GetWindow() )
return GetWindow()->IsActive();
else
- return FALSE;
+ return sal_False;
}
@@ -2617,7 +2575,7 @@ sal_Bool SAL_CALL VCLXWindow::isEnabled( ) throw (::com::sun::star::uno::Runtim
if( GetWindow() )
return GetWindow()->IsEnabled();
else
- return FALSE;
+ return sal_False;
}
sal_Bool SAL_CALL VCLXWindow::hasFocus( ) throw (::com::sun::star::uno::RuntimeException)
@@ -2626,7 +2584,7 @@ sal_Bool SAL_CALL VCLXWindow::hasFocus( ) throw (::com::sun::star::uno::Runtime
if( GetWindow() )
return GetWindow()->HasFocus();
else
- return FALSE;
+ return sal_False;
}
// ::com::sun::star::beans::XPropertySetInfo
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index 5f1640a69139..de6be4c34ef7 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -93,7 +93,7 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
// create system parent data
SystemParentData aSysParentData;
aSysParentData.nSize = sizeof ( SystemParentData );
-#if defined( WIN ) || defined( WNT ) || defined ( OS2 )
+#if defined( WNT ) || defined ( OS2 )
aSysParentData.hWnd = (HWND) nHandle;
#elif defined( QUARTZ )
aSysParentData.pView = reinterpret_cast<NSView*>(nHandle);
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index fbd635483b2b..1c6d5418dd38 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -38,6 +38,7 @@
#include <toolkit/helper/imagealign.hxx>
#include <toolkit/helper/accessibilityclient.hxx>
#include <toolkit/helper/fixedhyperbase.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -61,6 +62,7 @@
#include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx>
#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
#include <tools/diagnose_ex.h>
#include <boost/bind.hpp>
@@ -134,24 +136,24 @@ namespace toolkit
sal_Int32 nWhiteLuminance = Color( COL_WHITE ).GetLuminance();
Color aLightShadow( nBackgroundColor );
- aLightShadow.IncreaseLuminance( (UINT8)( ( nWhiteLuminance - nBackgroundLuminance ) * 2 / 3 ) );
+ aLightShadow.IncreaseLuminance( (sal_uInt8)( ( nWhiteLuminance - nBackgroundLuminance ) * 2 / 3 ) );
aStyleSettings.SetLightBorderColor( aLightShadow );
Color aLight( nBackgroundColor );
- aLight.IncreaseLuminance( (UINT8)( ( nWhiteLuminance - nBackgroundLuminance ) * 1 / 3 ) );
+ aLight.IncreaseLuminance( (sal_uInt8)( ( nWhiteLuminance - nBackgroundLuminance ) * 1 / 3 ) );
aStyleSettings.SetLightColor( aLight );
Color aShadow( nBackgroundColor );
- aShadow.DecreaseLuminance( (UINT8)( nBackgroundLuminance * 1 / 3 ) );
+ aShadow.DecreaseLuminance( (sal_uInt8)( nBackgroundLuminance * 1 / 3 ) );
aStyleSettings.SetShadowColor( aShadow );
Color aDarkShadow( nBackgroundColor );
- aDarkShadow.DecreaseLuminance( (UINT8)( nBackgroundLuminance * 2 / 3 ) );
+ aDarkShadow.DecreaseLuminance( (sal_uInt8)( nBackgroundLuminance * 2 / 3 ) );
aStyleSettings.SetDarkShadowColor( aDarkShadow );
}
aSettings.SetStyleSettings( aStyleSettings );
- _pWindow->SetSettings( aSettings, TRUE );
+ _pWindow->SetSettings( aSettings, sal_True );
}
Any getButtonLikeFaceColor( const Window* _pWindow )
@@ -172,7 +174,7 @@ namespace toolkit
_pWindow->SetStyle( nStyle );
}
- static void setVisualEffect( const Any& _rValue, Window* _pWindow, void (StyleSettings::*pSetter)( USHORT ), sal_Int16 _nFlatBits, sal_Int16 _n3DBits )
+ static void setVisualEffect( const Any& _rValue, Window* _pWindow )
{
AllSettings aSettings = _pWindow->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
@@ -182,22 +184,22 @@ namespace toolkit
switch ( nStyle )
{
case FLAT:
- (aStyleSettings.*pSetter)( _nFlatBits );
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() & ~STYLE_OPTION_MONO );
break;
case LOOK3D:
default:
- (aStyleSettings.*pSetter)( _n3DBits );
+ aStyleSettings.SetOptions( aStyleSettings.GetOptions() | STYLE_OPTION_MONO );
}
aSettings.SetStyleSettings( aStyleSettings );
_pWindow->SetSettings( aSettings );
}
- static Any getVisualEffect( Window* _pWindow, USHORT (StyleSettings::*pGetter)( ) const, sal_Int16 _nFlatBits )
+ static Any getVisualEffect( Window* _pWindow )
{
Any aEffect;
StyleSettings aStyleSettings = _pWindow->GetSettings().GetStyleSettings();
- if ( (aStyleSettings.*pGetter)() == _nFlatBits )
+ if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
aEffect <<= (sal_Int16)FLAT;
else
aEffect <<= (sal_Int16)LOOK3D;
@@ -218,7 +220,7 @@ void VCLXGraphicControl::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "VCLXGraphicControl::ImplSetNewImage: window is required to be not-NULL!" );
Button* pButton = static_cast< Button* >( GetWindow() );
- pButton->SetModeBitmap( GetBitmap() );
+ pButton->SetModeImage( GetImage() );
}
void VCLXGraphicControl::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException)
@@ -658,14 +660,14 @@ void VCLXImageControl::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "VCLXImageControl::ImplSetNewImage: window is required to be not-NULL!" );
ImageControl* pControl = static_cast< ImageControl* >( GetWindow() );
- pControl->SetBitmap( GetBitmap() );
+ pControl->SetImage( GetImage() );
}
::com::sun::star::awt::Size VCLXImageControl::getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException)
{
SolarMutexGuard aGuard;
- Size aSz = GetBitmap().GetSizePixel();
+ Size aSz = GetImage().GetSizePixel();
aSz = ImplCalcWindowSize( aSz );
return AWTSize(aSz);
@@ -959,7 +961,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- ::toolkit::setVisualEffect( Value, pCheckBox, &StyleSettings::SetCheckBoxStyle, STYLE_CHECKBOX_MONO, STYLE_CHECKBOX_WIN );
+ ::toolkit::setVisualEffect( Value, pCheckBox );
break;
case BASEPROPERTY_TRISTATE:
@@ -996,7 +998,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- aProp = ::toolkit::getVisualEffect( pCheckBox, &StyleSettings::GetCheckBoxStyle, STYLE_CHECKBOX_MONO );
+ aProp = ::toolkit::getVisualEffect( pCheckBox );
break;
case BASEPROPERTY_TRISTATE:
aProp <<= (sal_Bool)pCheckBox->IsTriStateEnabled();
@@ -1131,7 +1133,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- ::toolkit::setVisualEffect( Value, pButton, &StyleSettings::SetRadioButtonStyle, STYLE_RADIOBUTTON_MONO, STYLE_RADIOBUTTON_WIN );
+ ::toolkit::setVisualEffect( Value, pButton );
break;
case BASEPROPERTY_STATE:
@@ -1139,7 +1141,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
sal_Int16 n = sal_Int16();
if ( Value >>= n )
{
- BOOL b = n ? sal_True : sal_False;
+ sal_Bool b = n ? sal_True : sal_False;
if ( pButton->IsRadioCheckEnabled() )
pButton->Check( b );
else
@@ -1174,7 +1176,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
switch ( nPropType )
{
case BASEPROPERTY_VISUALEFFECT:
- aProp = ::toolkit::getVisualEffect( pButton, &StyleSettings::GetRadioButtonStyle, STYLE_RADIOBUTTON_MONO );
+ aProp = ::toolkit::getVisualEffect( pButton );
break;
case BASEPROPERTY_STATE:
aProp <<= (sal_Int16) ( pButton->IsChecked() ? 1 : 0 );
@@ -1307,11 +1309,11 @@ void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
aEvent.ActionCommand = maActionCommand;
maActionListeners.actionPerformed( aEvent );
}
- ImplClickedOrToggled( FALSE );
+ ImplClickedOrToggled( sal_False );
break;
case VCLEVENT_RADIOBUTTON_TOGGLE:
- ImplClickedOrToggled( TRUE );
+ ImplClickedOrToggled( sal_True );
break;
default:
@@ -1320,7 +1322,7 @@ void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
}
}
-void VCLXRadioButton::ImplClickedOrToggled( BOOL bToggled )
+void VCLXRadioButton::ImplClickedOrToggled( sal_Bool bToggled )
{
// In the formulars, RadioChecked is not enabled, call itemStateChanged only for click
// In the dialog editor, RadioChecked is enabled, call itemStateChanged only for bToggled
@@ -1712,14 +1714,14 @@ void VCLXListBox::selectItemsPos( const ::com::sun::star::uno::Sequence<sal_Int1
ListBox* pBox = (ListBox*) GetWindow();
if ( pBox )
{
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
for ( sal_uInt16 n = (sal_uInt16)aPositions.getLength(); n; )
{
- USHORT nPos = (USHORT) aPositions.getConstArray()[--n];
+ sal_uInt16 nPos = (sal_uInt16) aPositions.getConstArray()[--n];
if ( pBox->IsEntryPosSelected( nPos ) != bSelect )
{
pBox->SelectEntryPos( nPos, bSelect );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
@@ -2063,34 +2065,32 @@ void VCLXListBox::ImplCallItemListeners()
maItemListeners.itemStateChanged( aEvent );
}
}
-
namespace
{
- Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL )
- {
- if ( !i_rImageURL.getLength() )
- return Image();
+ Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL )
+ {
+ if ( !i_rImageURL.getLength() )
+ return Image();
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
- {
- ::comphelper::NamedValueCollection aMediaProperties;
- aMediaProperties.put( "URL", i_rImageURL );
- Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XGraphicProvider > xProvider;
+ if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put( "URL", i_rImageURL );
+ Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
return Image( xGraphic );
- }
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return Image();
- }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return Image();
+ }
}
-
void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
@@ -2102,7 +2102,7 @@ void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) thr
"VCLXListBox::listItemInserted: illegal (inconsistent) item position!" );
pListBox->InsertEntry(
i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(),
- i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
+ i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
i_rEvent.ItemPosition );
}
@@ -2132,7 +2132,7 @@ void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) thr
// VCL's ListBox does not support changing an entry's text or image, so remove and re-insert
const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pListBox->GetEntry( i_rEvent.ItemPosition ) );
- const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) );
+ const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) );
pListBox->RemoveEntry( i_rEvent.ItemPosition );
pListBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition );
@@ -2322,13 +2322,13 @@ void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result ) throw (RuntimeExcept
pDialog->EndDialog( i_result );
}
-void SAL_CALL VCLXDialog::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
+void SAL_CALL VCLXDialog::setHelpId( const ::rtl::OUString& rId ) throw (RuntimeException)
{
SolarMutexGuard aGuard;
Window* pWindow = GetWindow();
if ( pWindow )
- pWindow->SetHelpId( i_id );
+ pWindow->SetHelpId( rtl::OUStringToOString( rId, RTL_TEXTENCODING_UTF8 ) );
}
void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException)
@@ -2672,10 +2672,10 @@ sal_Int32 SAL_CALL VCLXMultiPage::insertTab() throw (uno::RuntimeException)
return static_cast< sal_Int32 >( insertTab( pTab, title ) );
}
-USHORT VCLXMultiPage::insertTab( TabPage* pPage, rtl::OUString& sTitle )
+sal_uInt16 VCLXMultiPage::insertTab( TabPage* pPage, rtl::OUString& sTitle )
{
TabControl *pTabControl = getTabControl();
- USHORT id = sal::static_int_cast< USHORT >( mTabId++ );
+ sal_uInt16 id = sal::static_int_cast< sal_uInt16 >( mTabId++ );
pTabControl->InsertPage( id, sTitle.getStr(), TAB_APPEND );
pTabControl->SetTabPage( id, pPage );
return id;
@@ -2684,18 +2684,18 @@ USHORT VCLXMultiPage::insertTab( TabPage* pPage, rtl::OUString& sTitle )
void SAL_CALL VCLXMultiPage::removeTab( sal_Int32 ID ) throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw lang::IndexOutOfBoundsException();
- pTabControl->RemovePage( sal::static_int_cast< USHORT >( ID ) );
+ pTabControl->RemovePage( sal::static_int_cast< sal_uInt16 >( ID ) );
}
void SAL_CALL VCLXMultiPage::activateTab( sal_Int32 ID ) throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
TabControl *pTabControl = getTabControl();
OSL_TRACE("Attempting to activate tab %d, active tab is %d, numtabs is %d", ID, getActiveTabID(), getWindows().getLength() );
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw lang::IndexOutOfBoundsException();
- pTabControl->SelectTabPage( sal::static_int_cast< USHORT >( ID ) );
+ pTabControl->SelectTabPage( sal::static_int_cast< sal_uInt16 >( ID ) );
}
sal_Int32 SAL_CALL VCLXMultiPage::getActiveTabID() throw (uno::RuntimeException)
@@ -2719,7 +2719,7 @@ void SAL_CALL VCLXMultiPage::setTabProps( sal_Int32 ID, const uno::Sequence< bea
{
SolarMutexGuard aGuard;
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw lang::IndexOutOfBoundsException();
for ( int i = 0; i < Properties.getLength(); i++ )
@@ -2730,7 +2730,7 @@ void SAL_CALL VCLXMultiPage::setTabProps( sal_Int32 ID, const uno::Sequence< bea
if ( name == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ) )
{
rtl::OUString title = value.get<rtl::OUString>();
- pTabControl->SetPageText( sal::static_int_cast< USHORT >( ID ), title.getStr() );
+ pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( ID ), title.getStr() );
}
}
}
@@ -2740,7 +2740,7 @@ uno::Sequence< beans::NamedValue > SAL_CALL VCLXMultiPage::getTabProps( sal_Int3
{
SolarMutexGuard aGuard;
TabControl *pTabControl = getTabControl();
- if ( pTabControl->GetTabPage( sal::static_int_cast< USHORT >( ID ) ) == NULL )
+ if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL )
throw lang::IndexOutOfBoundsException();
#define ADD_PROP( seq, i, name, val ) { \
@@ -2751,8 +2751,8 @@ uno::Sequence< beans::NamedValue > SAL_CALL VCLXMultiPage::getTabProps( sal_Int3
}
uno::Sequence< beans::NamedValue > props( 2 );
- ADD_PROP( props, 0, "Title", rtl::OUString( pTabControl->GetPageText( sal::static_int_cast< USHORT >( ID ) ) ) );
- ADD_PROP( props, 1, "Position", pTabControl->GetPagePos( sal::static_int_cast< USHORT >( ID ) ) );
+ ADD_PROP( props, 0, "Title", rtl::OUString( pTabControl->GetPageText( sal::static_int_cast< sal_uInt16 >( ID ) ) ) );
+ ADD_PROP( props, 1, "Position", pTabControl->GetPagePos( sal::static_int_cast< sal_uInt16 >( ID ) ) );
#undef ADD_PROP
return props;
}
@@ -2763,14 +2763,14 @@ void VCLXMultiPage::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
case VCLEVENT_TABPAGE_DEACTIVATE:
{
- ULONG nPageID = (ULONG)( rVclWindowEvent.GetData() );
+ sal_uLong nPageID = (sal_uLong)( rVclWindowEvent.GetData() );
maTabListeners.deactivated( nPageID );
break;
}
case VCLEVENT_TABPAGE_ACTIVATE:
{
- ULONG nPageID = (ULONG)( rVclWindowEvent.GetData() );
+ sal_uLong nPageID = (sal_uLong)( rVclWindowEvent.GetData() );
maTabListeners.activated( nPageID );
break;
}
@@ -2888,6 +2888,15 @@ throw(::com::sun::star::uno::RuntimeException)
}
}
break;
+ case BASEPROPERTY_TITLE:
+ {
+ ::rtl::OUString sTitle;
+ if ( Value >>= sTitle )
+ {
+ pTabPage->SetText(sTitle);
+ }
+ }
+ break;
default:
{
@@ -3594,7 +3603,7 @@ void VCLXScrollBar::setProperty( const ::rtl::OUString& PropertyName, const ::co
}
AllSettings aSettings( pScrollBar->GetSettings() );
StyleSettings aStyle( aSettings.GetStyleSettings() );
- ULONG nDragOptions = aStyle.GetDragFullOptions();
+ sal_uLong nDragOptions = aStyle.GetDragFullOptions();
if ( bDo )
nDragOptions |= DRAGFULL_OPTION_SCROLL;
else
diff --git a/toolkit/source/awt/xsimpleanimation.cxx b/toolkit/source/awt/xsimpleanimation.cxx
index f11dd3f547a5..f59016fd77a2 100644
--- a/toolkit/source/awt/xsimpleanimation.cxx
+++ b/toolkit/source/awt/xsimpleanimation.cxx
@@ -30,9 +30,8 @@
#include "precompiled_toolkit.hxx"
#include "toolkit/awt/xsimpleanimation.hxx"
#include "toolkit/helper/property.hxx"
-#include "toolkit/helper/throbberimpl.hxx"
#include <tools/debug.hxx>
-
+#include <vcl/throbber.hxx>
#include <vcl/svapp.hxx>
//........................................................................
@@ -51,53 +50,40 @@ namespace toolkit
XSimpleAnimation::XSimpleAnimation()
{
DBG_CTOR( XSimpleAnimation, NULL );
- mbRepeat = sal_True;
- mnStepTime = 100;
- mpThrobber = new Throbber_Impl( this, mnStepTime, mbRepeat );
}
//--------------------------------------------------------------------
XSimpleAnimation::~XSimpleAnimation()
{
DBG_DTOR( XSimpleAnimation, NULL );
- delete mpThrobber;
}
//--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( XSimpleAnimation, VCLXWindow, XSimpleAnimation_Base )
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( XSimpleAnimation, VCLXWindow, XSimpleAnimation_Base )
-
- //--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::start() throw ( uno::RuntimeException )
{
- mpThrobber->start();
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
}
//--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::stop() throw ( uno::RuntimeException )
{
- mpThrobber->stop();
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
}
//--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& rImageList )
throw ( uno::RuntimeException )
{
- mpThrobber->setImageList( rImageList );
- }
-
- //--------------------------------------------------------------------
- void XSimpleAnimation::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
- {
- // TODO: XSimpleAnimation::ProcessWindowEvent
- //Reference< XSimpleAnimation > xKeepAlive( this );
- //SpinButton* pSpinButton = static_cast< SpinButton* >( GetWindow() );
- //if ( !pSpinButton )
- // return;
-
- VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->setImageList( rImageList );
}
//--------------------------------------------------------------------
@@ -106,33 +92,31 @@ namespace toolkit
{
SolarMutexGuard aGuard;
- if ( GetWindow() )
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
{
- sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
- switch ( nPropertyId )
- {
- case BASEPROPERTY_STEP_TIME: {
- sal_Int32 nStepTime( 0 );
- if ( Value >>= nStepTime )
- {
- mnStepTime = nStepTime;
- mpThrobber->setStepTime( mnStepTime );
- }
-
- break;
- }
- case BASEPROPERTY_REPEAT: {
- sal_Bool bRepeat( sal_True );
- if ( Value >>= bRepeat )
- {
- mbRepeat = bRepeat;
- mpThrobber->setRepeat( mbRepeat );
- }
- break;
- }
- default:
- VCLXWindow::setProperty( PropertyName, Value );
+ VCLXWindow::setProperty( PropertyName, Value );
+ return;
+ }
+
+ sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME: {
+ sal_Int32 nStepTime( 0 );
+ if ( Value >>= nStepTime )
+ pThrobber->setStepTime( nStepTime );
+
+ break;
}
+ case BASEPROPERTY_REPEAT: {
+ sal_Bool bRepeat( sal_True );
+ if ( Value >>= bRepeat )
+ pThrobber->setRepeat( bRepeat );
+ break;
+ }
+ default:
+ VCLXWindow::setProperty( PropertyName, Value );
}
}
@@ -142,22 +126,22 @@ namespace toolkit
{
SolarMutexGuard aGuard;
- uno::Any aReturn;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ return VCLXWindow::getProperty( PropertyName );
- if ( GetWindow() )
+ uno::Any aReturn;
+ sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
+ switch ( nPropertyId )
{
- sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
- switch ( nPropertyId )
- {
- case BASEPROPERTY_STEP_TIME:
- aReturn <<= mnStepTime;
- break;
- case BASEPROPERTY_REPEAT:
- aReturn <<= mbRepeat;
- break;
- default:
- aReturn = VCLXWindow::getProperty( PropertyName );
- }
+ case BASEPROPERTY_STEP_TIME:
+ aReturn <<= pThrobber->getStepTime();
+ break;
+ case BASEPROPERTY_REPEAT:
+ aReturn <<= pThrobber->getRepeat();
+ break;
+ default:
+ aReturn = VCLXWindow::getProperty( PropertyName );
}
return aReturn;
}
diff --git a/toolkit/source/awt/xthrobber.cxx b/toolkit/source/awt/xthrobber.cxx
index 5f015953132c..95c6b5b3d197 100644
--- a/toolkit/source/awt/xthrobber.cxx
+++ b/toolkit/source/awt/xthrobber.cxx
@@ -31,13 +31,13 @@
#include "toolkit/awt/xthrobber.hxx"
#include "toolkit/helper/property.hxx"
#include <toolkit/helper/tkresmgr.hxx>
-#include <toolkit/helper/throbberimpl.hxx>
#include "xthrobber.hrc"
#include <tools/debug.hxx>
#include <vcl/fixed.hxx>
#include <vcl/timer.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/throbber.hxx>
//........................................................................
namespace toolkit
@@ -55,81 +55,37 @@ namespace toolkit
XThrobber::XThrobber()
{
DBG_CTOR( XThrobber, NULL );
-
- mpThrobber = new Throbber_Impl( this, 100, sal_True );
-
- InitImageList();
}
//--------------------------------------------------------------------
XThrobber::~XThrobber()
{
DBG_DTOR( XThrobber, NULL );
- delete mpThrobber;
}
//--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( XThrobber, VCLXWindow, XThrobber_Base )
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( XThrobber, VCLXWindow, XThrobber_Base )
-
- //--------------------------------------------------------------------
void SAL_CALL XThrobber::start() throw ( uno::RuntimeException )
{
- mpThrobber->start();
+ SolarMutexGuard aGuard;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
}
//--------------------------------------------------------------------
void SAL_CALL XThrobber::stop() throw ( uno::RuntimeException )
{
- mpThrobber->stop();
- }
-
- //--------------------------------------------------------------------
- void XThrobber::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
- {
- static bool bInit = false;
- if ( !bInit )
- {
- // Images won't be shown if set too early
- mpThrobber->initImage();
- bInit = true;
- }
- // TODO: XSimpleAnimation::ProcessWindowEvent
- //Reference< XSimpleAnimation > xKeepAlive( this );
- //SpinButton* pSpinButton = static_cast< SpinButton* >( GetWindow() );
- //if ( !pSpinButton )
- // return;
-
- VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL XThrobber::setProperty( const ::rtl::OUString& PropertyName, const uno::Any& Value )
- throw( uno::RuntimeException )
- {
SolarMutexGuard aGuard;
-
- if ( GetWindow() )
- {
- VCLXWindow::setProperty( PropertyName, Value );
- }
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
}
//--------------------------------------------------------------------
- uno::Any SAL_CALL XThrobber::getProperty( const ::rtl::OUString& PropertyName )
- throw( uno::RuntimeException )
+ void XThrobber::SetWindow( Window* pWindow )
{
- SolarMutexGuard aGuard;
-
- uno::Any aReturn;
-
- if ( GetWindow() )
- {
- aReturn = VCLXWindow::getProperty( PropertyName );
- }
- return aReturn;
+ XThrobber_Base::SetWindow( pWindow );
+ InitImageList();
}
//--------------------------------------------------------------------
@@ -137,6 +93,11 @@ namespace toolkit
throw( uno::RuntimeException )
{
SolarMutexGuard aGuard;
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL)
+ return;
+
uno::Sequence< uno::Reference< graphic::XGraphic > > aImageList(12);
sal_uInt16 nIconIdStart = RID_TK_ICON_THROBBER_START;
@@ -146,7 +107,7 @@ namespace toolkit
aImageList[i] = aImage.GetXGraphic();
}
- mpThrobber->setImageList( aImageList );
+ pThrobber->setImageList( aImageList );
}
//........................................................................
diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx
new file mode 100755
index 000000000000..c2fd91f1ea46
--- /dev/null
+++ b/toolkit/source/controls/animatedimages.cxx
@@ -0,0 +1,493 @@
+/*************************************************************************
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include "toolkit/controls/animatedimages.hxx"
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/property.hxx"
+#include "toolkit/helper/unopropertyarrayhelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::container::XContainerListener;
+ using ::com::sun::star::beans::XPropertySetInfo;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::lang::IndexOutOfBoundsException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::XControlModel;
+ using ::com::sun::star::awt::XAnimatedImages;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::awt::XWindowPeer;
+ using ::com::sun::star::util::XModifyListener;
+ using ::com::sun::star::awt::XToolkit;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ /** === end UNO using === **/
+ namespace VisualEffect = ::com::sun::star::awt::VisualEffect;
+ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+ //==================================================================================================================
+ //= AnimatedImagesControl
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControl::AnimatedImagesControl( Reference< XMultiServiceFactory > const & i_factory )
+ :AnimatedImagesControl_Base( i_factory )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString AnimatedImagesControl::GetComponentServiceName()
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AnimatedImages" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::startAnimation( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ xAnimation->startAnimation();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::stopAnimation( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ xAnimation->stopAnimation();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesControl::isAnimationRunning( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ return xAnimation->isAnimationRunning();
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControl::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.AnimatedImagesControl" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControl::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServices( AnimatedImagesControl_Base::getSupportedServiceNames() );
+ aServices.realloc( aServices.getLength() + 1 );
+ aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControl );
+ return aServices;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void lcl_updatePeer( Reference< XWindowPeer > const& i_peer, Reference< XControlModel > const& i_model )
+ {
+ const Reference< XModifyListener > xPeerModify( i_peer, UNO_QUERY );
+ if ( xPeerModify.is() )
+ {
+ EventObject aEvent;
+ aEvent.Source = i_model;
+ xPeerModify->modified( aEvent );
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL AnimatedImagesControl::setModel( const Reference< XControlModel >& i_rModel ) throw ( RuntimeException )
+ {
+ const Reference< XAnimatedImages > xOldContainer( getModel(), UNO_QUERY );
+ const Reference< XAnimatedImages > xNewContainer( i_rModel, UNO_QUERY );
+
+ if ( !AnimatedImagesControl_Base::setModel( i_rModel ) )
+ return sal_False;
+
+ if ( xOldContainer.is() )
+ xOldContainer->removeContainerListener( this );
+
+ if ( xNewContainer.is() )
+ xNewContainer->addContainerListener( this );
+
+ lcl_updatePeer( getPeer(), getModel() );
+
+ return sal_True;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::createPeer( const Reference< XToolkit >& i_toolkit, const Reference< XWindowPeer >& i_parentPeer ) throw(RuntimeException)
+ {
+ AnimatedImagesControl_Base::createPeer( i_toolkit, i_parentPeer );
+
+ lcl_updatePeer( getPeer(), getModel() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementReplaced( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ UnoControlBase::disposing( i_event );
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel_Data
+ //==================================================================================================================
+ struct AnimatedImagesControlModel_Data
+ {
+ ::std::vector< Sequence< ::rtl::OUString > > aImageSets;
+ };
+
+ namespace
+ {
+ void lcl_checkIndex( const AnimatedImagesControlModel_Data& i_data, const sal_Int32 i_index, const Reference< XInterface >& i_context,
+ const bool i_forInsert = false )
+ {
+ if ( ( i_index < 0 ) || ( size_t( i_index ) > i_data.aImageSets.size() + ( i_forInsert ? 1 : 0 ) ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), i_context );
+ }
+
+ void lcl_notify( ::osl::ClearableMutexGuard& i_guard, ::cppu::OBroadcastHelper& i_broadcaseHelper,
+ void ( SAL_CALL XContainerListener::*i_notificationMethod )( const ContainerEvent& ),
+ const sal_Int32 i_accessor, const Sequence< ::rtl::OUString >& i_imageURLs, const Reference< XInterface >& i_context )
+ {
+ ::cppu::OInterfaceContainerHelper* pContainerListeners = i_broadcaseHelper.getContainer( XContainerListener::static_type() );
+ if ( pContainerListeners == NULL )
+ return;
+
+ ContainerEvent aEvent;
+ aEvent.Source = i_context;
+ aEvent.Accessor <<= i_accessor;
+ aEvent.Element <<= i_imageURLs;
+
+ i_guard.clear();
+ pContainerListeners->notifyEach( i_notificationMethod, aEvent );
+ }
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< XMultiServiceFactory > const & i_factory )
+ :AnimatedImagesControlModel_Base( i_factory )
+ ,m_pData( new AnimatedImagesControlModel_Data )
+ {
+ ImplRegisterProperty( BASEPROPERTY_AUTO_REPEAT );
+ ImplRegisterProperty( BASEPROPERTY_BORDER );
+ ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_IMAGE_SCALE_MODE );
+ ImplRegisterProperty( BASEPROPERTY_STEP_TIME );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource )
+ :AnimatedImagesControlModel_Base( i_copySource )
+ ,m_pData( new AnimatedImagesControlModel_Data( *i_copySource.m_pData ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::~AnimatedImagesControlModel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlModel* AnimatedImagesControlModel::Clone() const
+ {
+ return new AnimatedImagesControlModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XPropertySetInfo > SAL_CALL AnimatedImagesControlModel::getPropertySetInfo( ) throw(RuntimeException)
+ {
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControlModel::getServiceName() throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControlModel::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( "org.openoffice.comp.toolkit.AnimatedImagesControlModel" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControlModel::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(2);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ aServiceNames[1] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 i_handle, const Any& i_value ) throw (Exception)
+ {
+ switch ( i_handle )
+ {
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ sal_Int16 nImageScaleMode( ImageScaleMode::Anisotropic );
+ OSL_VERIFY( i_value >>= nImageScaleMode ); // convertFastPropertyValue ensures that this has the proper type
+ if ( ( nImageScaleMode != ImageScaleMode::None )
+ && ( nImageScaleMode != ImageScaleMode::Isotropic )
+ && ( nImageScaleMode != ImageScaleMode::Anisotropic )
+ )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+ }
+ break;
+ }
+
+ AnimatedImagesControlModel_Base::setFastPropertyValue_NoBroadcast( i_handle, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any AnimatedImagesControlModel::ImplGetDefaultValue( sal_uInt16 i_propertyId ) const
+ {
+ switch ( i_propertyId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ return makeAny( ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControl ) );
+
+ case BASEPROPERTY_BORDER:
+ return makeAny( VisualEffect::NONE );
+
+ case BASEPROPERTY_STEP_TIME:
+ return makeAny( (sal_Int32) 100 );
+
+ case BASEPROPERTY_AUTO_REPEAT:
+ return makeAny( (sal_Bool)sal_True );
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ return makeAny( ImageScaleMode::None );
+
+ default:
+ return UnoControlModel::ImplGetDefaultValue( i_propertyId );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::cppu::IPropertyArrayHelper& SAL_CALL AnimatedImagesControlModel::getInfoHelper()
+ {
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence< sal_Int32 > aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getStepTime() throw (RuntimeException)
+ {
+ sal_Int32 nStepTime( 100 );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ) ) >>= nStepTime );
+ return nStepTime;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setStepTime( ::sal_Int32 i_stepTime ) throw (RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ), makeAny( i_stepTime ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesControlModel::getAutoRepeat() throw (RuntimeException)
+ {
+ sal_Bool bAutoRepeat( sal_True );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ) ) >>= bAutoRepeat );
+ return bAutoRepeat;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setAutoRepeat( ::sal_Bool i_autoRepeat ) throw (RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ), makeAny( i_autoRepeat ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int16 SAL_CALL AnimatedImagesControlModel::getScaleMode() throw (RuntimeException)
+ {
+ sal_Int16 nImageScaleMode( ImageScaleMode::Anisotropic );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ) ) >>= nImageScaleMode );
+ return nImageScaleMode;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setScaleMode( ::sal_Int16 i_scaleMode ) throw (IllegalArgumentException, RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), makeAny( i_scaleMode ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getImageSetCount( ) throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ return m_pData->aImageSets.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControlModel::getImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ return m_pData->aImageSets[ i_index ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::insertImageSet( ::sal_Int32 i_index, const Sequence< ::rtl::OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this, true );
+
+ // actaul insertion
+ m_pData->aImageSets.insert( m_pData->aImageSets.begin() + i_index, i_imageURLs );
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementInserted, i_index, i_imageURLs, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::replaceImageSet( ::sal_Int32 i_index, const Sequence< ::rtl::OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ // actaul insertion
+ m_pData->aImageSets[ i_index ] = i_imageURLs;
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementReplaced, i_index, i_imageURLs, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::removeImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ // actual removal
+ ::std::vector< Sequence< ::rtl::OUString > >::iterator removalPos = m_pData->aImageSets.begin() + i_index;
+ Sequence< ::rtl::OUString > aRemovedElement( *removalPos );
+ m_pData->aImageSets.erase( removalPos );
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementRemoved, i_index, aRemovedElement, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::addContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ BrdcstHelper.addListener( XContainerListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::removeContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ BrdcstHelper.removeListener( XContainerListener::static_type(), i_listener );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
new file mode 100644
index 000000000000..07b208588835
--- /dev/null
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -0,0 +1,1860 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/wall.hxx>
+#include <osl/mutex.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+#include <toolkit/controls/unocontrols.hxx>
+#include "toolkit/controls/formattedcontrol.hxx"
+#include "toolkit/controls/roadmapcontrol.hxx"
+#ifndef TOOLKIT_INC_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
+#include "toolkit/controls/tkscrollbar.hxx"
+#endif
+#include <toolkit/controls/stdtabcontroller.hxx>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <tools/list.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <comphelper/types.hxx>
+
+#include <comphelper/componentcontext.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/image.hxx>
+
+#include "tree/treecontrol.hxx"
+#include "grid/gridcontrol.hxx"
+#include <toolkit/controls/tabpagecontainer.hxx>
+
+#include <boost/bind.hpp>
+
+#include <map>
+#include <algorithm>
+#include <functional>
+#include "tools/urlobj.hxx"
+#include "osl/file.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+using namespace toolkit;
+
+#define PROPERTY_RESOURCERESOLVER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ))
+
+//HELPER
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
+
+struct LanguageDependentProp
+{
+ const char* pPropName;
+ sal_Int32 nPropNameLength;
+};
+
+// ----------------------------------------------------------------------------
+namespace
+{
+ static const Sequence< ::rtl::OUString >& lcl_getLanguageDependentProperties()
+ {
+ static Sequence< ::rtl::OUString > s_aLanguageDependentProperties;
+ if ( s_aLanguageDependentProperties.getLength() == 0 )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( s_aLanguageDependentProperties.getLength() == 0 )
+ {
+ s_aLanguageDependentProperties.realloc( 2 );
+ s_aLanguageDependentProperties[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
+ s_aLanguageDependentProperties[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
+ // note: properties must be sorted
+ }
+ }
+ return s_aLanguageDependentProperties;
+ }
+}
+
+// ----------------------------------------------------------------------------
+// functor for disposing a control model
+struct DisposeControlModel : public ::std::unary_function< Reference< XControlModel >, void >
+{
+ void operator()( Reference< XControlModel >& _rxModel )
+ {
+ try
+ {
+ ::comphelper::disposeComponent( _rxModel );
+ }
+ catch( const Exception& )
+ {
+ OSL_TRACE( "DisposeControlModel::(): caught an exception while disposing a component!" );
+ }
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for searching control model by name
+struct FindControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, bool >
+{
+private:
+ const ::rtl::OUString& m_rName;
+
+public:
+ FindControlModel( const ::rtl::OUString& _rName ) : m_rName( _rName ) { }
+
+ bool operator()( const ControlModelContainerBase::UnoControlModelHolder& _rCompare )
+ {
+ return ( _rCompare.second == m_rName ) ? true : false;
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for cloning a control model, and insertion into a target list
+struct CloneControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, void >
+{
+private:
+ ControlModelContainerBase::UnoControlModelHolderList& m_rTargetList;
+
+public:
+ CloneControlModel( ControlModelContainerBase::UnoControlModelHolderList& _rTargetList )
+ :m_rTargetList( _rTargetList )
+ {
+ }
+
+ void operator()( const ControlModelContainerBase::UnoControlModelHolder& _rSource )
+ {
+ // clone the source object
+ Reference< XCloneable > xCloneSource( _rSource.first, UNO_QUERY );
+ Reference< XControlModel > xClone( xCloneSource->createClone(), UNO_QUERY );
+ // add to target list
+ m_rTargetList.push_back( ControlModelContainerBase::UnoControlModelHolder( xClone, _rSource.second ) );
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for comparing a XControlModel with a given reference
+struct CompareControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, bool >
+{
+private:
+ Reference< XControlModel > m_xReference;
+public:
+ CompareControlModel( const Reference< XControlModel >& _rxReference ) : m_xReference( _rxReference ) { }
+
+ bool operator()( const ControlModelContainerBase::UnoControlModelHolder& _rCompare )
+ {
+ return ( _rCompare.first.get() == m_xReference.get() ) ? true : false;
+ }
+};
+
+// ----------------------------------------------------------------------------
+static void lcl_throwIllegalArgumentException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw IllegalArgumentException();
+}
+
+// ----------------------------------------------------------------------------
+static void lcl_throwNoSuchElementException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw NoSuchElementException();
+}
+
+// ----------------------------------------------------------------------------
+static void lcl_throwElementExistException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw ElementExistException();
+}
+
+// ----------------------------------------------------------------------------
+static const ::rtl::OUString& getTabIndexPropertyName( )
+{
+ static const ::rtl::OUString s_sTabIndexProperty( RTL_CONSTASCII_USTRINGPARAM( "TabIndex" ) );
+ return s_sTabIndexProperty;
+}
+
+// ----------------------------------------------------------------------------
+static const ::rtl::OUString& getStepPropertyName( )
+{
+ static const ::rtl::OUString s_sStepProperty( RTL_CONSTASCII_USTRINGPARAM( "Step" ) );
+ return s_sStepProperty;
+}
+
+// ----------------------------------------------------
+// class ControlModelContainerBase
+// ----------------------------------------------------
+ControlModelContainerBase::ControlModelContainerBase( const Reference< XMultiServiceFactory >& i_factory )
+ :ControlModelContainer_IBase( i_factory )
+ ,maContainerListeners( *this )
+ ,maChangeListeners ( GetMutex() )
+ ,mbGroupsUpToDate( sal_False )
+{
+}
+
+ControlModelContainerBase::ControlModelContainerBase( const ControlModelContainerBase& rModel )
+ : ControlModelContainer_IBase( rModel )
+ , maContainerListeners( *this )
+ , maChangeListeners ( GetMutex() )
+ , mbGroupsUpToDate( sal_False )
+{
+}
+
+ControlModelContainerBase::~ControlModelContainerBase()
+{
+ maModels.clear();
+ mbGroupsUpToDate = sal_False;
+}
+
+Any ControlModelContainerBase::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ Any aAny;
+
+ switch ( nPropId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlDialog );
+ break;
+ default:
+ aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+
+ return aAny;
+}
+
+::cppu::IPropertyArrayHelper& ControlModelContainerBase::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+
+void SAL_CALL ControlModelContainerBase::dispose( ) throw(RuntimeException)
+{
+ // ====================================================================
+ // tell our listeners
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ EventObject aDisposeEvent;
+ aDisposeEvent.Source = static_cast< XAggregation* >( static_cast< ::cppu::OWeakAggObject* >( this ) );
+
+ maContainerListeners.disposeAndClear( aDisposeEvent );
+ maChangeListeners.disposeAndClear( aDisposeEvent );
+ }
+
+ // ====================================================================
+ // call the base class
+ UnoControlModel::dispose();
+
+ // ====================================================================
+ // dispose our child models
+ // for this, collect the models (we collect them from maModels, and this is modified when disposing children)
+ ::std::vector< Reference< XControlModel > > aChildModels( maModels.size() );
+
+ ::std::transform(
+ maModels.begin(), maModels.end(), // source range
+ aChildModels.begin(), // target location
+ ::boost::bind( &UnoControlModelHolder::first, _1 ) // operation to apply -> select the XControlModel part
+ );
+
+ // now dispose
+ ::std::for_each( aChildModels.begin(), aChildModels.end(), DisposeControlModel() );
+ aChildModels.clear();
+
+ mbGroupsUpToDate = sal_False;
+}
+
+// XMultiPropertySet
+Reference< XPropertySetInfo > ControlModelContainerBase::getPropertySetInfo( ) throw(RuntimeException)
+{
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+void ControlModelContainerBase::Clone_Impl(ControlModelContainerBase& _rClone) const
+{
+ // clone all children
+ ::std::for_each(
+ maModels.begin(), maModels.end(),
+ CloneControlModel( _rClone.maModels )
+ );
+}
+UnoControlModel* ControlModelContainerBase::Clone() const
+{
+ // clone the container itself
+ ControlModelContainerBase* pClone = new ControlModelContainerBase( *this );
+ Clone_Impl(*pClone);
+
+ return pClone;
+}
+
+ControlModelContainerBase::UnoControlModelHolderList::iterator ControlModelContainerBase::ImplFindElement( const ::rtl::OUString& rName )
+{
+ return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) );
+}
+
+// ::XMultiServiceFactory
+Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(Exception, RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ OGeometryControlModel_Base* pNewModel = NULL;
+
+ const Reference< XMultiServiceFactory > xFactory( maContext.getLegacyServiceFactory() );
+ if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlEditModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFileControlModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlButtonModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlImageControlModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlListBoxModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoTreeModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoGridModel >( xFactory );
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageContainerModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( xFactory );
+
+ if ( !pNewModel )
+ {
+ if ( xFactory.is() )
+ {
+ Reference< XInterface > xObject = xFactory->createInstance( aServiceSpecifier );
+ Reference< XServiceInfo > xSI( xObject, UNO_QUERY );
+ Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY );
+ Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY );
+ if ( xAgg.is() )
+ {
+ if ( xSI->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" ) ) )
+ {
+ // release 3 of the 4 references we have to the object
+ xAgg.clear();
+ xSI.clear();
+ xObject.clear();
+
+ pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier );
+ }
+ }
+ }
+ }
+
+ Reference< XInterface > xNewModel = (::cppu::OWeakObject*)pNewModel;
+ return xNewModel;
+}
+
+Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException)
+{
+ return createInstance( ServiceSpecifier );
+}
+
+Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames() throw(RuntimeException)
+{
+ static Sequence< ::rtl::OUString >* pNamesSeq = NULL;
+ if ( !pNamesSeq )
+ {
+ pNamesSeq = new Sequence< ::rtl::OUString >( 23 );
+ ::rtl::OUString* pNames = pNamesSeq->getArray();
+ pNames[0] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlEditModel );
+ pNames[1] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFormattedFieldModel );
+ pNames[2] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFileControlModel );
+ pNames[3] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlButtonModel );
+ pNames[4] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlImageControlModel );
+ pNames[5] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel );
+ pNames[6] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCheckBoxModel );
+ pNames[7] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedTextModel );
+ pNames[8] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlGroupBoxModel );
+ pNames[9] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlListBoxModel );
+ pNames[10] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlComboBoxModel );
+ pNames[11] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlDateFieldModel );
+ pNames[12] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlTimeFieldModel );
+ pNames[13] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlNumericFieldModel );
+ pNames[14] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCurrencyFieldModel );
+ pNames[15] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlPatternFieldModel );
+ pNames[16] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlProgressBarModel );
+ pNames[17] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlScrollBarModel );
+ pNames[18] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedLineModel );
+ pNames[19] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRoadmapModel );
+ pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel );
+ pNames[21] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel );
+ pNames[22] = ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel );
+
+ }
+ return *pNamesSeq;
+}
+
+// XContainer
+void ControlModelContainerBase::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.addInterface( l );
+}
+
+void ControlModelContainerBase::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.removeInterface( l );
+}
+
+// XElementAcces
+Type ControlModelContainerBase::getElementType() throw(RuntimeException)
+{
+ Type aType = getCppuType( ( Reference< XControlModel>* ) NULL );
+ return aType;
+}
+
+sal_Bool ControlModelContainerBase::hasElements() throw(RuntimeException)
+{
+ return !maModels.empty();
+}
+
+// XNameContainer, XNameReplace, XNameAccess
+void ControlModelContainerBase::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XControlModel > xNewModel;
+ aElement >>= xNewModel;
+ if ( !xNewModel.is() )
+ lcl_throwIllegalArgumentException();
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ // stop listening at the old model
+ stopControlListening( aElementPos->first );
+ Reference< XControlModel > xReplaced( aElementPos->first );
+ // remember the new model, and start listening
+ aElementPos->first = xNewModel;
+ startControlListening( xNewModel );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element = aElement;
+ aEvent.ReplacedElement <<= xReplaced;
+ aEvent.Accessor <<= aName;
+
+ // notify the container listener
+ maContainerListeners.elementReplaced( aEvent );
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+Any ControlModelContainerBase::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ return makeAny( aElementPos->first );
+}
+
+Sequence< ::rtl::OUString > ControlModelContainerBase::getElementNames() throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aNames( maModels.size() );
+
+ ::std::transform(
+ maModels.begin(), maModels.end(), // source range
+ aNames.getArray(), // target range
+ ::boost::bind( &UnoControlModelHolder::second, _1 ) // operator to apply: select the second element (the name)
+ );
+
+ return aNames;
+}
+
+sal_Bool ControlModelContainerBase::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
+{
+ return maModels.end() != ImplFindElement( aName );
+}
+
+void ControlModelContainerBase::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XControlModel > xM;
+ aElement >>= xM;
+
+ if ( xM.is() )
+ {
+ Reference< beans::XPropertySet > xProps( xM, UNO_QUERY );
+ if ( xProps.is() )
+ {
+
+ Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo();
+
+ ::rtl::OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
+ if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty ) && ImplHasProperty(BASEPROPERTY_DIALOGSOURCEURL) )
+ {
+ Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty );
+
+ ::rtl::OUString absoluteUrl =
+ getPhysicalLocation( getPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ), aUrl );
+
+ aUrl <<= absoluteUrl;
+
+ xProps.get()->setPropertyValue( sImageSourceProperty , aUrl );
+ }
+ }
+ }
+
+
+
+ if ( !aName.getLength() || !xM.is() )
+ lcl_throwIllegalArgumentException();
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() != aElementPos )
+ lcl_throwElementExistException();
+
+ maModels.push_back( UnoControlModelHolder( xM, aName ) );
+ mbGroupsUpToDate = sal_False;
+ startControlListening( xM );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElement;
+ aEvent.Accessor <<= aName;
+ maContainerListeners.elementInserted( aEvent );
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+void ControlModelContainerBase::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElementPos->first;
+ aEvent.Accessor <<= aName;
+ maContainerListeners.elementRemoved( aEvent );
+
+ stopControlListening( aElementPos->first );
+ Reference< XPropertySet > xPS( aElementPos->first, UNO_QUERY );
+ maModels.erase( aElementPos );
+ mbGroupsUpToDate = sal_False;
+
+ if ( xPS.is() )
+ try
+ {
+ xPS->setPropertyValue( PROPERTY_RESOURCERESOLVER, makeAny( Reference< resource::XStringResourceResolver >() ) );
+ }
+ catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+// ----------------------------------------------------------------------------
+sal_Bool SAL_CALL ControlModelContainerBase::getGroupControl( ) throw (RuntimeException)
+{
+ return sal_True;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setGroupControl( sal_Bool ) throw (RuntimeException)
+{
+ OSL_TRACE( "UnoControlDialogModel::setGroupControl: explicit grouping not supported" );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ // set the tab indexes according to the order of models in the sequence
+ const Reference< XControlModel >* pControls = _rControls.getConstArray( );
+ const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength();
+
+ sal_Int16 nTabIndex = 1;
+
+ for ( ; pControls != pControlsEnd; ++pControls )
+ {
+ // look up the control in our own structure. This is to prevent invalid arguments
+ UnoControlModelHolderList::const_iterator aPos =
+ ::std::find_if(
+ maModels.begin(), maModels.end(),
+ CompareControlModel( *pControls )
+ );
+ if ( maModels.end() != aPos )
+ {
+ // okay, this is an existent model
+ // now set the TabIndex property (if applicable)
+ Reference< XPropertySet > xProps( aPos->first, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xProps.is() )
+ xPSI = xProps->getPropertySetInfo();
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xProps->setPropertyValue( getTabIndexPropertyName(), makeAny( nTabIndex++ ) );
+ }
+ mbGroupsUpToDate = sal_False;
+ }
+}
+
+
+typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal_Int32 > > MapIndexToModel;
+
+// ----------------------------------------------------------------------------
+Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getControlModels( ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ MapIndexToModel aSortedModels;
+ // will be the sorted container of all models which have a tab index property
+ ::std::vector< Reference< XControlModel > > aUnindexedModels;
+ // will be the container of all models which do not have a tab index property
+
+ UnoControlModelHolderList::const_iterator aLoop = maModels.begin();
+ for ( ; aLoop != maModels.end(); ++aLoop )
+ {
+ Reference< XControlModel > xModel( aLoop->first );
+
+ // see if the model has a TabIndex property
+ Reference< XPropertySet > xControlProps( xModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xControlProps.is() )
+ xPSI = xControlProps->getPropertySetInfo( );
+ DBG_ASSERT( xPSI.is(), "UnoControlDialogModel::getControlModels: invalid child model!" );
+
+ // has it?
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ { // yes
+ sal_Int32 nTabIndex = -1;
+ xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex;
+
+ aSortedModels.insert( MapIndexToModel::value_type( nTabIndex, xModel ) );
+ }
+ else if ( xModel.is() )
+ // no, it hasn't, but we have to include it, anyway
+ aUnindexedModels.push_back( xModel );
+ }
+
+ // okay, here we have a container of all our models, sorted by tab index,
+ // plus a container of "unindexed" models
+ // -> merge them
+ Sequence< Reference< XControlModel > > aReturn( aUnindexedModels.size() + aSortedModels.size() );
+ ::std::transform(
+ aSortedModels.begin(), aSortedModels.end(),
+ ::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ),
+ ::boost::bind( &MapIndexToModel::value_type::second, _1 )
+ );
+
+ return aReturn;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setGroup( const Sequence< Reference< XControlModel > >&, const ::rtl::OUString& ) throw (RuntimeException)
+{
+ // not supported. We have only implicit grouping:
+ // We only have a sequence of control models, and we _know_ (yes, that's a HACK relying on
+ // implementation details) that VCL does grouping according to the order of controls automatically
+ // At least VCL does this for all we're interested in: Radio buttons.
+ OSL_TRACE( "UnoControlDialogModel::setGroup: grouping not supported" );
+}
+
+////----- XInitialization -------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::initialize (const Sequence<Any>& rArguments) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nPageId = -1;
+ if ( rArguments.getLength() == 1 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ }
+ else
+ m_nTabPageId = -1;
+}
+::sal_Int16 SAL_CALL ControlModelContainerBase::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_nTabPageId;
+}
+::sal_Bool SAL_CALL ControlModelContainerBase::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_bEnabled;
+}
+void SAL_CALL ControlModelContainerBase::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_bEnabled = _enabled;
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getTitle() throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ ::rtl::OUString sTitle;
+ xThis->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE)) >>= sTitle;
+ return sTitle;
+ //return m_sTitle;
+}
+void SAL_CALL ControlModelContainerBase::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),makeAny(_title));
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_sImageURL;
+}
+void SAL_CALL ControlModelContainerBase::setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_sImageURL = _imageurl;
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_sTooltip;
+}
+void SAL_CALL ControlModelContainerBase::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_sTooltip = _tooltip;
+}
+
+// ----------------------------------------------------------------------------
+namespace
+{
+ enum GroupingMachineState
+ {
+ eLookingForGroup,
+ eExpandingGroup
+ };
+
+ // ........................................................................
+ static sal_Int32 lcl_getDialogStep( const Reference< XControlModel >& _rxModel )
+ {
+ sal_Int32 nStep = 0;
+ try
+ {
+ Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
+ xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep;
+ }
+ catch( const Exception& )
+ {
+ OSL_TRACE( "lcl_getDialogStep: caught an exception while determining the dialog page!" );
+ }
+ return nStep;
+ }
+}
+
+// ----------------------------------------------------------------------------
+sal_Int32 SAL_CALL ControlModelContainerBase::getGroupCount( ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ implUpdateGroupStructure();
+
+ return maGroups.size();
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ implUpdateGroupStructure();
+
+ if ( ( _nGroup < 0 ) || ( _nGroup >= (sal_Int32)maGroups.size() ) )
+ {
+ OSL_TRACE( "UnoControlDialogModel::getGroup: invalid argument and I am not allowed to throw an exception!" );
+ _rGroup.realloc( 0 );
+ _rName = ::rtl::OUString();
+ }
+ else
+ {
+ AllGroups::const_iterator aGroupPos = maGroups.begin() + _nGroup;
+ _rGroup.realloc( aGroupPos->size() );
+ // copy the models
+ ::std::copy( aGroupPos->begin(), aGroupPos->end(), _rGroup.getArray() );
+ // give the group a name
+ _rName = ::rtl::OUString::valueOf( _nGroup );
+ }
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ ::rtl::OUString sDummyName;
+ getGroup( _rName.toInt32( ), _rGroup, sDummyName );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::addChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
+{
+ maChangeListeners.addInterface( _rxListener );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::removeChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
+{
+ maChangeListeners.removeInterface( _rxListener );
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::implNotifyTabModelChange( const ::rtl::OUString& _rAccessor )
+{
+ // multiplex to our change listeners:
+ // the changes event
+ ChangesEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself
+ aEvent.Changes.realloc( 1 ); // exactly one change
+ aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
+
+
+ Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
+ const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
+ const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
+ for ( ; pListener != pListenerEnd; ++pListener )
+ {
+ if ( pListener->is() )
+ static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::implUpdateGroupStructure()
+{
+ if ( mbGroupsUpToDate )
+ // nothing to do
+ return;
+
+ // conditions for a group:
+ // * all elements of the group are radio buttons
+ // * all elements of the group are on the same dialog page
+ // * in the overall control order (determined by the tab index), all elements are subsequent
+
+ maGroups.clear();
+
+ Sequence< Reference< XControlModel > > aControlModels = getControlModels();
+ const Reference< XControlModel >* pControlModels = aControlModels.getConstArray();
+ const Reference< XControlModel >* pControlModelsEnd = pControlModels + aControlModels.getLength();
+
+ // in extreme we have as much groups as controls
+ maGroups.reserve( aControlModels.getLength() );
+
+ GroupingMachineState eState = eLookingForGroup; // the current state of our machine
+ Reference< XServiceInfo > xModelSI; // for checking for a radion button
+ AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building
+ sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to
+ sal_Bool bIsRadioButton; // is it a radio button?
+
+#if OSL_DEBUG_LEVEL > 1
+ ::std::vector< ::rtl::OUString > aCurrentGroupLabels;
+#endif
+
+ for ( ; pControlModels != pControlModelsEnd; ++pControlModels )
+ {
+ // we'll need this in every state
+ xModelSI = xModelSI.query( *pControlModels );
+ bIsRadioButton = xModelSI.is() && xModelSI->supportsService( ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel ) );
+
+ switch ( eState )
+ {
+ case eLookingForGroup:
+ {
+ if ( !bIsRadioButton )
+ // this is no radio button -> still looking for the beginning of a group
+ continue;
+ // the current model is a radio button
+ // -> we found the beginning of a new group
+ // create the place for this group
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ aCurrentGroup = maGroups.begin() + nGroups;
+ // and add the (only, til now) member
+ aCurrentGroup->push_back( *pControlModels );
+
+ // get the step which all controls of this group now have to belong to
+ nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
+ // new state: looking for further members
+ eState = eExpandingGroup;
+
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ }
+ break;
+
+ case eExpandingGroup:
+ {
+ if ( !bIsRadioButton )
+ { // no radio button -> the group is done
+ aCurrentGroup = maGroups.end();
+ eState = eLookingForGroup;
+#if OSL_DEBUG_LEVEL > 1
+ aCurrentGroupLabels.clear();
+#endif
+ continue;
+ }
+
+ // it is a radio button - is it on the proper page?
+ const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
+ if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page
+ || ( 0 == nThisModelStep ) // the current button appears on all pages
+ )
+ {
+ // -> it belongs to the same group
+ aCurrentGroup->push_back( *pControlModels );
+ // state still is eExpandingGroup - we're looking for further elements
+ eState = eExpandingGroup;
+
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ continue;
+ }
+
+ // it's a radio button, but on a different page
+ // -> we open a new group for it
+
+ // close the old group
+ aCurrentGroup = maGroups.end();
+#if OSL_DEBUG_LEVEL > 1
+ aCurrentGroupLabels.clear();
+#endif
+
+ // open a new group
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ aCurrentGroup = maGroups.begin() + nGroups;
+ // and add the (only, til now) member
+ aCurrentGroup->push_back( *pControlModels );
+
+ nCurrentGroupStep = nThisModelStep;
+
+ // state is the same: we still are looking for further elements of the current group
+ eState = eExpandingGroup;
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ }
+ break;
+ }
+ }
+
+ mbGroupsUpToDate = sal_True;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ),
+ "UnoControlDialogModel::propertyChange: not listening for this property!" );
+
+ // the accessor for the changed element
+ ::rtl::OUString sAccessor;
+ UnoControlModelHolderList::const_iterator aPos =
+ ::std::find_if(
+ maModels.begin(), maModels.end(),
+ CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) )
+ );
+ OSL_ENSURE( maModels.end() != aPos, "UnoControlDialogModel::propertyChange: don't know this model!" );
+ if ( maModels.end() != aPos )
+ sAccessor = aPos->second;
+
+ // our groups are not up-to-date
+ mbGroupsUpToDate = sal_False;
+
+ // notify
+ implNotifyTabModelChange( sAccessor );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::disposing( const EventObject& /*rEvent*/ ) throw (RuntimeException)
+{
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::startControlListening( const Reference< XControlModel >& _rxChildModel )
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xModelProps.is() )
+ xPSI = xModelProps->getPropertySetInfo();
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this );
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::stopControlListening( const Reference< XControlModel >& _rxChildModel )
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xModelProps.is() )
+ xPSI = xModelProps->getPropertySetInfo();
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this );
+}
+
+// ============================================================================
+// = class ResourceListener
+// ============================================================================
+
+ResourceListener::ResourceListener(
+ const Reference< util::XModifyListener >& rListener ) :
+ OWeakObject(),
+ m_xListener( rListener ),
+ m_bListening( false )
+{
+}
+
+ResourceListener::~ResourceListener()
+{
+}
+
+// XInterface
+Any SAL_CALL ResourceListener::queryInterface( const Type& rType )
+throw ( RuntimeException )
+{
+ Any a = ::cppu::queryInterface(
+ rType ,
+ static_cast< XModifyListener* >( this ),
+ static_cast< XEventListener* >( this ));
+
+ if ( a.hasValue() )
+ return a;
+
+ return OWeakObject::queryInterface( rType );
+}
+
+void SAL_CALL ResourceListener::acquire() throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL ResourceListener::release() throw ()
+{
+ OWeakObject::release();
+}
+
+void ResourceListener::startListening(
+ const Reference< resource::XStringResourceResolver >& rResource )
+{
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster( rResource, UNO_QUERY );
+
+ {
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ bool bListening( m_bListening );
+ bool bResourceSet( m_xResource.is() );
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( bListening && bResourceSet )
+ stopListening();
+
+ // --- SAFE ---
+ aGuard.reset();
+ m_xResource = rResource;
+ aGuard.clear();
+ // --- SAFE ---
+ }
+
+ Reference< util::XModifyListener > xThis( static_cast<OWeakObject*>( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ xModifyBroadcaster->addModifyListener( xThis );
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ m_bListening = true;
+ // --- SAFE ---
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+void ResourceListener::stopListening()
+{
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ if ( m_bListening && m_xResource.is() )
+ xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY );
+ aGuard.clear();
+ // --- SAFE ---
+
+ Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ m_xResource.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ xModifyBroadcaster->removeModifyListener( xThis );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+// XModifyListener
+void SAL_CALL ResourceListener::modified(
+ const lang::EventObject& aEvent )
+throw ( RuntimeException )
+{
+ Reference< util::XModifyListener > xListener;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ xListener = m_xListener;
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ {
+ try
+ {
+ xListener->modified( aEvent );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+// XEventListener
+void SAL_CALL ResourceListener::disposing(
+ const EventObject& Source )
+throw ( RuntimeException )
+{
+ Reference< lang::XEventListener > xListener;
+ Reference< resource::XStringResourceResolver > xResource;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY );
+ Reference< XInterface > xIfacList( m_xListener, UNO_QUERY );
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( Source.Source == xIfacRes )
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ xResource = m_xResource;
+ xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
+ m_xResource.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ {
+ try
+ {
+ xListener->disposing( Source );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+ }
+ else if ( Source.Source == xIfacList )
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
+ xResource = m_xResource;
+ m_xResource.clear();
+ m_xListener.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ // Remove ourself as listener from resource resolver
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster( xResource, UNO_QUERY );
+ Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ xModifyBroadcaster->removeModifyListener( xThis );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+ }
+}
+
+//===============================================================
+// ----------------------------------------------------
+// class DialogContainerControl
+// ----------------------------------------------------
+ControlContainerBase::ControlContainerBase( const Reference< XMultiServiceFactory >& i_factory )
+ :ContainerControl_IBase( i_factory )
+ ,mbSizeModified(false)
+ ,mbPosModified(false)
+{
+ maComponentInfos.nWidth = 280;
+ maComponentInfos.nHeight = 400;
+ mxListener = new ResourceListener( Reference< util::XModifyListener >(
+ static_cast< OWeakObject* >( this ), UNO_QUERY ));
+}
+
+ControlContainerBase::~ControlContainerBase()
+{
+}
+
+void ControlContainerBase::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ UnoControlContainer::createPeer( rxToolkit, rParentPeer );
+}
+
+void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName )
+{
+ Reference< XPropertySet > xP( rxModel, UNO_QUERY );
+
+ ::rtl::OUString aDefCtrl;
+ xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
+ Reference < XControl > xCtrl;
+ maContext.createComponent( aDefCtrl, xCtrl );
+
+ DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
+ if ( xCtrl.is() )
+ {
+ xCtrl->setModel( rxModel );
+ addControl( rName, xCtrl );
+ // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model
+ // (which we formerly did herein)
+ // 08.01.2001 - 96008 - fs@openoffice.org
+
+ ImplSetPosSize( xCtrl );
+ }
+}
+
+void ControlContainerBase::ImplRemoveControl( Reference< XControlModel >& rxModel )
+{
+ Sequence< Reference< XControl > > aControls = getControls();
+ Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
+ if ( xCtrl.is() )
+ {
+ removeControl( xCtrl );
+ try
+ {
+ Reference< XComponent > const xControlComp( xCtrl, UNO_QUERY_THROW );
+ xControlComp->dispose();
+ }
+ catch( Exception const & )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+}
+
+void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl )
+{
+ Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY );
+
+ sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
+ MapMode aMode( MAP_APPFONT );
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ if ( pOutDev )
+ {
+ ::Size aTmp( nX, nY );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
+ nX = aTmp.Width();
+ nY = aTmp.Height();
+ aTmp = ::Size( nWidth, nHeight );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
+ nWidth = aTmp.Width();
+ nHeight = aTmp.Height();
+ }
+ else
+ {
+ Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
+ Reference< XDevice > xD( xPeer, UNO_QUERY );
+
+ SimpleFontMetric aFM;
+ FontDescriptor aFD;
+ Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
+ aVal >>= aFD;
+ if ( aFD.StyleName.getLength() )
+ {
+ Reference< XFont > xFont = xD->getFont( aFD );
+ aFM = xFont->getFontMetric();
+ }
+ else
+ {
+ Reference< XGraphics > xG = xD->createGraphics();
+ aFM = xG->getFontMetric();
+ }
+
+ sal_Int16 nH = aFM.Ascent + aFM.Descent;
+ sal_Int16 nW = nH/2; // calculate avarage width?!
+
+ nX *= nW;
+ nX /= 4;
+ nWidth *= nW;
+ nWidth /= 4;
+ nY *= nH;
+ nY /= 8;
+ nHeight *= nH;
+ nHeight /= 8;
+ }
+ Reference < XWindow > xW( rxCtrl, UNO_QUERY );
+ xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
+}
+
+void ControlContainerBase::dispose() throw(RuntimeException)
+{
+ EventObject aEvt;
+ aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
+ // Notify our listener helper about dispose
+ // --- SAFE ---
+
+ SolarMutexClearableGuard aGuard;
+ Reference< XEventListener > xListener( mxListener, UNO_QUERY );
+ mxListener.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ xListener->disposing( aEvt );
+ UnoControlContainer::dispose();
+}
+
+void SAL_CALL ControlContainerBase::disposing(
+ const EventObject& Source )
+throw(RuntimeException)
+{
+ UnoControlContainer::disposing( Source );
+}
+
+sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ // destroy the old tab controller, if existent
+ if ( mxTabController.is() )
+ {
+ mxTabController->setModel( NULL ); // just to be sure, should not be necessary
+ removeTabController( mxTabController );
+ ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary
+ mxTabController.clear();
+ }
+
+ if ( getModel().is() )
+ {
+ Sequence< Reference< XControl > > aControls = getControls();
+ const Reference< XControl >* pCtrls = aControls.getConstArray();
+ const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
+
+ for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
+ removeControl( *pCtrls );
+ // will implicitly call removingControl, which will remove the PropertyChangeListener
+ // (which we formerly did herein)
+ // 08.01.2001 - 96008 - fs@openoffice.org
+
+ Reference< XContainer > xC( getModel(), UNO_QUERY );
+ if ( xC.is() )
+ xC->removeContainerListener( this );
+
+ Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
+ if ( xChangeNotifier.is() )
+ xChangeNotifier->removeChangesListener( this );
+ }
+
+ sal_Bool bRet = UnoControl::setModel( rxModel );
+
+ if ( getModel().is() )
+ {
+ Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
+ if ( xNA.is() )
+ {
+ Sequence< ::rtl::OUString > aNames = xNA->getElementNames();
+ const ::rtl::OUString* pNames = aNames.getConstArray();
+ sal_uInt32 nCtrls = aNames.getLength();
+
+ Reference< XControlModel > xCtrlModel;
+ for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames )
+ {
+ xNA->getByName( *pNames ) >>= xCtrlModel;
+ ImplInsertControl( xCtrlModel, *pNames );
+ }
+ }
+
+ Reference< XContainer > xC( getModel(), UNO_QUERY );
+ if ( xC.is() )
+ xC->addContainerListener( this );
+
+ Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
+ if ( xChangeNotifier.is() )
+ xChangeNotifier->addChangesListener( this );
+ }
+
+ Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY );
+ if ( xTabbing.is() )
+ {
+ mxTabController = new StdTabController;
+ mxTabController->setModel( xTabbing );
+ addTabController( mxTabController );
+ }
+ ImplStartListingForResourceEvents();
+
+ return bRet;
+}
+void ControlContainerBase::setDesignMode( sal_Bool bOn ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ UnoControl::setDesignMode( bOn );
+
+ Sequence< Reference< XControl > > xCtrls = getControls();
+ sal_Int32 nControls = xCtrls.getLength();
+ Reference< XControl >* pControls = xCtrls.getArray();
+ for ( sal_Int32 n = 0; n < nControls; n++ )
+ pControls[n]->setDesignMode( bOn );
+
+ // #109067# in design mode the tab controller is not notified about
+ // tab index changes, therefore the tab order must be activated
+ // when switching from design mode to live mode
+ if ( mxTabController.is() && !bOn )
+ mxTabController->activateTabOrder();
+}
+
+void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XControlModel > xModel;
+ ::rtl::OUString aName;
+
+ Event.Accessor >>= aName;
+ Event.Element >>= xModel;
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementInserted: illegal element!" );
+ try
+ {
+ ImplInsertControl( xModel, aName );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XControlModel > xModel;
+ Event.Element >>= xModel;
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementRemoved: illegal element!" );
+ try
+ {
+ ImplRemoveControl( xModel );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ Reference< XControlModel > xModel;
+ Event.ReplacedElement >>= xModel;
+ try
+ {
+ OSL_ENSURE( xModel.is(), "UnoDialogControl::elementReplaced: invalid ReplacedElement!" );
+ if ( xModel.is() )
+ ImplRemoveControl( xModel );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ ::rtl::OUString aName;
+ Event.Accessor >>= aName;
+ Event.Element >>= xModel;
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementReplaced: invalid new element!" );
+ try
+ {
+ ImplInsertControl( xModel, aName );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// XPropertiesChangeListener
+void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
+{
+ if( !isDesignMode() && !mbCreatingCompatiblePeer )
+ {
+ ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) );
+ ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) );
+ ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
+ ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) );
+
+ sal_Int32 nLen = rEvents.getLength();
+ for( sal_Int32 i = 0; i < nLen; i++ )
+ {
+ const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
+ Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
+ sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
+ if ( ( rEvt.PropertyName == s1 ) ||
+ ( rEvt.PropertyName == s2 ) ||
+ ( rEvt.PropertyName == s3 ) ||
+ ( rEvt.PropertyName == s4 ) )
+ {
+ if ( bOwnModel )
+ {
+ if ( !mbPosModified && !mbSizeModified )
+ {
+ // Don't set new pos/size if we get new values from window listener
+ Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY );
+ ImplSetPosSize( xThis );
+ }
+ }
+ else
+ {
+ Sequence<Reference<XControl> > aControlSequence(getControls());
+ Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) );
+ ImplSetPosSize( aControlRef );
+ }
+ break;
+ }
+ }
+ }
+
+ UnoControlContainer::ImplModelPropertiesChanged( rEvents );
+}
+
+void ControlContainerBase::addingControl( const Reference< XControl >& _rxControl )
+{
+ SolarMutexGuard aGuard;
+ UnoControlContainer::addingControl( _rxControl );
+
+ if ( _rxControl.is() )
+ {
+ Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
+ if ( xProps.is() )
+ {
+ Sequence< ::rtl::OUString > aNames( 4 );
+ ::rtl::OUString* pNames = aNames.getArray();
+ *pNames++ = ::rtl::OUString::createFromAscii( "PositionX" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "PositionY" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "Width" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "Height" );
+
+ xProps->addPropertiesChangeListener( aNames, this );
+ }
+ }
+}
+
+void ControlContainerBase::removingControl( const Reference< XControl >& _rxControl )
+{
+ SolarMutexGuard aGuard;
+ UnoControlContainer::removingControl( _rxControl );
+
+ if ( _rxControl.is() )
+ {
+ Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
+ if ( xProps.is() )
+ xProps->removePropertiesChangeListener( this );
+ }
+
+}
+
+void SAL_CALL ControlContainerBase::changesOccurred( const ChangesEvent& ) throw (RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ // a tab controller model may have changed
+
+ // #109067# in design mode don't notify the tab controller
+ // about tab index changes
+ if ( mxTabController.is() && !mbDesignMode )
+ mxTabController->activateTabOrder();
+}
+void lcl_ApplyResolverToNestedContainees( const Reference< resource::XStringResourceResolver >& xStringResourceResolver, const Reference< XControlContainer >& xContainer )
+{
+ rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
+
+ Any xNewStringResourceResolver; xNewStringResourceResolver <<= xStringResourceResolver;
+
+ Sequence< rtl::OUString > aPropNames(1);
+ aPropNames[0] = aPropName;
+
+ const Sequence< Reference< awt::XControl > > aSeq = xContainer->getControls();
+ for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
+ {
+ Reference< XControl > xControl( aSeq[i] );
+ Reference< XPropertySet > xPropertySet;
+
+ if ( xControl.is() )
+ xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY );
+
+ if ( !xPropertySet.is() )
+ continue;
+
+ try
+ {
+ Reference< resource::XStringResourceResolver > xCurrStringResourceResolver;
+ Any aOldValue = xPropertySet->getPropertyValue( aPropName );
+ if ( ( aOldValue >>= xCurrStringResourceResolver )
+ && ( xStringResourceResolver == xCurrStringResourceResolver )
+ )
+ {
+ Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
+ Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
+ xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener );
+ }
+ else
+ xPropertySet->setPropertyValue( aPropName, xNewStringResourceResolver );
+ }
+ /*catch ( NoSuchElementException& )*/ // that's nonsense, this is never thrown above ...
+ catch ( const Exception& )
+ {
+ }
+
+ uno::Reference< XControlContainer > xNestedContainer( xControl, uno::UNO_QUERY );
+ if ( xNestedContainer.is() )
+ lcl_ApplyResolverToNestedContainees( xStringResourceResolver, xNestedContainer );
+
+ }
+
+}
+void ControlContainerBase::ImplStartListingForResourceEvents()
+{
+ Reference< resource::XStringResourceResolver > xStringResourceResolver;
+
+ ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
+
+ // Add our helper as listener to retrieve notifications about changes
+ Reference< util::XModifyListener > rListener( mxListener );
+ ResourceListener* pResourceListener = static_cast< ResourceListener* >( rListener.get() );
+
+ // resource listener will stop listening if resolver reference is empty
+ if ( pResourceListener )
+ pResourceListener->startListening( xStringResourceResolver );
+ ImplUpdateResourceResolver();
+}
+
+void ControlContainerBase::ImplUpdateResourceResolver()
+{
+ rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
+ Reference< resource::XStringResourceResolver > xStringResourceResolver;
+
+ ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
+ if ( !xStringResourceResolver.is() )
+ return;
+
+ lcl_ApplyResolverToNestedContainees( xStringResourceResolver, this );
+
+ // propagate resource resolver changes to language dependent props of the dialog
+ Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY );
+ if ( xPropertySet.is() )
+ {
+ Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
+ Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
+ xMultiPropSet->firePropertiesChangeEvent( lcl_getLanguageDependentProperties(), xListener );
+ }
+}
+
+
+uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
+{
+ uno::Reference< graphic::XGraphic > xGraphic;
+ if ( !_rURL.getLength() )
+ return xGraphic;
+
+ try
+ {
+ uno::Reference< graphic::XGraphicProvider > xProvider;
+ if ( maContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ uno::Sequence< beans::PropertyValue > aMediaProperties(1);
+ aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
+ aMediaProperties[0].Value <<= _rURL;
+ xGraphic = xProvider->queryGraphic( aMediaProperties );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return xGraphic;
+}
+//// ----------------------------------------------------
+//// Helper Method to convert relative url to physical location
+//// ----------------------------------------------------
+
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
+{
+
+ ::rtl::OUString baseLocation;
+ ::rtl::OUString url;
+
+ rbase >>= baseLocation;
+ rUrl >>= url;
+
+ ::rtl::OUString absoluteURL( url );
+ if ( url.getLength() > 0 )
+ {
+ INetURLObject urlObj(baseLocation);
+ urlObj.removeSegment();
+ baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
+
+ const INetURLObject protocolCheck( url );
+ const INetProtocol protocol = protocolCheck.GetProtocol();
+ if ( protocol == INET_PROT_NOT_VALID )
+ {
+ ::rtl::OUString testAbsoluteURL;
+ if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
+ absoluteURL = testAbsoluteURL;
+ }
+ }
+
+ return absoluteURL;
+}
+
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 952cf533e0bb..85bcf95062eb 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,47 +35,28 @@
#include <toolkit/controls/dialogcontrol.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
-#include <toolkit/controls/geometrycontrolmodel.hxx>
-#include <toolkit/controls/unocontrols.hxx>
-#include "toolkit/controls/formattedcontrol.hxx"
-#include "toolkit/controls/roadmapcontrol.hxx"
-#include "toolkit/controls/tkscrollbar.hxx"
#include <toolkit/controls/stdtabcontroller.hxx>
-#include <toolkit/controls/tksimpleanimation.hxx>
-#include <toolkit/controls/tkthrobber.hxx>
-
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/resource/XStringResourceResolver.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <tools/list.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/componentcontext.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/graph.hxx>
#include <vcl/image.hxx>
-
-#include "tree/treecontrol.hxx"
-#include "grid/gridcontrol.hxx"
-
#include <map>
-#include <boost/unordered_map.hpp>
#include <algorithm>
-#include <o3tl/compat_functional.hxx>
+#include <functional>
#include "tools/urlobj.hxx"
#include "osl/file.hxx"
-#include <com/sun/star/awt/XSimpleTabController.hpp>
-#include <vcl/tabctrl.hxx>
-#include <vcl/tabpage.hxx>
-#include <vcl/button.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -85,249 +65,20 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::script;
-using namespace toolkit;
-#define PROPERTY_RESOURCERESOLVER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ))
#define PROPERTY_DIALOGSOURCEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ))
#define PROPERTY_IMAGEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ImageURL" ))
#define PROPERTY_GRAPHIC ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ))
-
-//HELPER
+//
+////HELPER
::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
-uno::Reference< graphic::XGraphic > getGraphicFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& rxGrfObj, const ::rtl::OUString& _rURL );
-
-struct LanguageDependentProp
-{
- const char* pPropName;
- sal_Int32 nPropNameLength;
-};
-
-// ----------------------------------------------------------------------------
-namespace
-{
- static const Sequence< ::rtl::OUString >& lcl_getLanguageDependentProperties()
- {
- static Sequence< ::rtl::OUString > s_aLanguageDependentProperties;
- if ( s_aLanguageDependentProperties.getLength() == 0 )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( s_aLanguageDependentProperties.getLength() == 0 )
- {
- s_aLanguageDependentProperties.realloc( 2 );
- s_aLanguageDependentProperties[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
- s_aLanguageDependentProperties[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
- // note: properties must be sorted
- }
- }
- return s_aLanguageDependentProperties;
- }
-
- static ::rtl::OUString lcl_GetStringProperty( const ::rtl::OUString& sProperty, const Reference< XPropertySet >& xSet )
- {
- ::rtl::OUString sValue;
- Reference< XPropertySetInfo > xPSI;
- if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() &&
- xPSI->hasPropertyByName( sProperty ) )
- {
- xSet->getPropertyValue( sProperty ) >>= sValue;
- }
- return sValue;
- }
-
-}
-
-// ----------------------------------------------------------------------------
-// functor for disposing a control model
-struct DisposeControlModel : public ::std::unary_function< Reference< XControlModel >, void >
-{
- void operator()( Reference< XControlModel >& _rxModel )
- {
- try
- {
- ::comphelper::disposeComponent( _rxModel );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "DisposeControlModel::(): caught an exception while disposing a component!" );
- }
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for searching control model by name
-struct FindControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, bool >
-{
-private:
- const ::rtl::OUString& m_rName;
-
-public:
- FindControlModel( const ::rtl::OUString& _rName ) : m_rName( _rName ) { }
-
- bool operator()( const UnoControlDialogModel::UnoControlModelHolder& _rCompare )
- {
- return ( _rCompare.second == m_rName ) ? true : false;
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for cloning a control model, and insertion into a target list
-struct CloneControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, void >
-{
-private:
- UnoControlDialogModel::UnoControlModelHolderList& m_rTargetList;
-
-public:
- CloneControlModel( UnoControlDialogModel::UnoControlModelHolderList& _rTargetList )
- :m_rTargetList( _rTargetList )
- {
- }
-
- void operator()( const UnoControlDialogModel::UnoControlModelHolder& _rSource )
- {
- // clone the source object
- Reference< XCloneable > xCloneSource( _rSource.first, UNO_QUERY );
- Reference< XControlModel > xClone( xCloneSource->createClone(), UNO_QUERY );
- // add to target list
- m_rTargetList.push_back( UnoControlDialogModel::UnoControlModelHolder( xClone, _rSource.second ) );
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for comparing a XControlModel with a given reference
-struct CompareControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, bool >
-{
-private:
- Reference< XControlModel > m_xReference;
-public:
- CompareControlModel( const Reference< XControlModel >& _rxReference ) : m_xReference( _rxReference ) { }
-
- bool operator()( const UnoControlDialogModel::UnoControlModelHolder& _rCompare )
- {
- return ( _rCompare.first.get() == m_xReference.get() ) ? true : false;
- }
-};
-
-// ----------------------------------------------------------------------------
-static void lcl_throwIllegalArgumentException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw IllegalArgumentException();
-}
-
-// ----------------------------------------------------------------------------
-static void lcl_throwNoSuchElementException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw NoSuchElementException();
-}
-
-// ----------------------------------------------------------------------------
-static void lcl_throwElementExistException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw ElementExistException();
-}
-
-// ----------------------------------------------------------------------------
-static const ::rtl::OUString& getTabIndexPropertyName( )
-{
- static const ::rtl::OUString s_sTabIndexProperty( RTL_CONSTASCII_USTRINGPARAM( "TabIndex" ) );
- return s_sTabIndexProperty;
-}
-
-// ----------------------------------------------------------------------------
-static const ::rtl::OUString& getStepPropertyName( )
-{
- static const ::rtl::OUString s_sStepProperty( RTL_CONSTASCII_USTRINGPARAM( "Step" ) );
- return s_sStepProperty;
-}
-
-// we probably will need both a hash of control models and hash of controls
-// => use some template magic
-
-typedef ::cppu::WeakImplHelper1< container::XNameContainer > SimpleNameContainer_BASE;
-
-template< typename T >
-class SimpleNamedThingContainer : public SimpleNameContainer_BASE
-{
- typedef boost::unordered_map< rtl::OUString, Reference< T >, ::rtl::OUStringHash,
- ::std::equal_to< ::rtl::OUString > > NamedThingsHash;
- NamedThingsHash things;
- ::osl::Mutex m_aMutex;
-public:
- // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !hasByName( aName ) )
- throw NoSuchElementException();
- Reference< T > xElement;
- if ( ! ( aElement >>= xElement ) )
- throw IllegalArgumentException();
- things[ aName ] = xElement;
- }
- virtual Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !hasByName( aName ) )
- throw NoSuchElementException();
- return uno::makeAny( things[ aName ] );
- }
- virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- Sequence< ::rtl::OUString > aResult( things.size() );
- typename NamedThingsHash::iterator it = things.begin();
- typename NamedThingsHash::iterator it_end = things.end();
- rtl::OUString* pName = aResult.getArray();
- for (; it != it_end; ++it, ++pName )
- *pName = it->first;
- return aResult;
- }
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- return ( things.find( aName ) != things.end() );
- }
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( hasByName( aName ) )
- throw ElementExistException();
- Reference< T > xElement;
- if ( ! ( aElement >>= xElement ) )
- throw IllegalArgumentException();
- things[ aName ] = xElement;
- }
- virtual void SAL_CALL removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !hasByName( aName ) )
- throw NoSuchElementException();
- things.erase( things.find( aName ) );
- }
- virtual Type SAL_CALL getElementType( ) throw (RuntimeException)
- {
- return T::static_type( NULL );
- }
- virtual ::sal_Bool SAL_CALL hasElements( ) throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- return ( things.size() > 0 );
- }
-};
-
-
// ----------------------------------------------------
// class UnoControlDialogModel
// ----------------------------------------------------
-UnoControlDialogModel::UnoControlDialogModel( bool regProps )
- :maContainerListeners( *this )
- ,maChangeListeners ( GetMutex() )
- ,mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
+UnoControlDialogModel::UnoControlDialogModel( const Reference< XMultiServiceFactory >& i_factory )
+ :ControlModelContainerBase( i_factory )
{
- if ( !regProps ) // Register properties elsewhere ( probably in class derived from this )
- return;
-
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
// ImplRegisterProperty( BASEPROPERTY_BORDER );
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
@@ -348,81 +99,33 @@ UnoControlDialogModel::UnoControlDialogModel( bool regProps )
aBool <<= (sal_Bool) sal_True;
ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
- // #TODO separate class for 'UserForm' ( instead of re-using Dialog ? )
- uno::Reference< XNameContainer > xNameCont = new SimpleNamedThingContainer< XControlModel >();
- ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES, uno::makeAny( xNameCont ) );
}
UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
- : UnoControlDialogModel_IBase( rModel )
- , UnoControlDialogModel_Base( rModel )
- , maContainerListeners( *this )
- , maChangeListeners ( GetMutex() )
- , mbGroupsUpToDate( sal_False ), mbAdjustingGraphic( false )
+ : ControlModelContainerBase( rModel )
{
}
UnoControlDialogModel::~UnoControlDialogModel()
{
- maModels.clear();
- mbGroupsUpToDate = sal_False;
}
-Any UnoControlDialogModel::queryAggregation( const Type & rType ) throw(RuntimeException)
+UnoControlModel* UnoControlDialogModel::Clone() const
{
- Any aRet( UnoControlDialogModel_IBase::queryInterface( rType ) );
- return (aRet.hasValue() ? aRet : UnoControlDialogModel_Base::queryAggregation( rType ));
-}
+ // clone the container itself
+ UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
-// XTypeProvider
-IMPL_IMPLEMENTATION_ID( UnoControlDialogModel )
-Sequence< Type > UnoControlDialogModel::getTypes() throw(RuntimeException)
-{
- return ::comphelper::concatSequences(
- UnoControlDialogModel_IBase::getTypes(),
- UnoControlDialogModel_Base::getTypes()
- );
+ Clone_Impl(*pClone);
+
+ return pClone;
}
+
::rtl::OUString UnoControlDialogModel::getServiceName( ) throw(RuntimeException)
{
return ::rtl::OUString::createFromAscii( szServiceName_UnoControlDialogModel );
}
-void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
-{
- UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
- try
- {
- switch ( nHandle )
- {
- case BASEPROPERTY_IMAGEURL:
- if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_GRAPHIC ) )
- {
- mbAdjustingGraphic = true;
- ::rtl::OUString sImageURL;
- OSL_VERIFY( rValue >>= sImageURL );
- setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) );
- mbAdjustingGraphic = false;
- }
- break;
-
- case BASEPROPERTY_GRAPHIC:
- if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) )
- {
- mbAdjustingGraphic = true;
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) );
- mbAdjustingGraphic = false;
- }
- break;
- }
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- OSL_ENSURE( sal_False, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting Graphic/ImageURL properties!" );
- }
-}
-
Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
Any aAny;
@@ -450,42 +153,6 @@ Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return *pHelper;
}
-void SAL_CALL UnoControlDialogModel::dispose( ) throw(RuntimeException)
-{
- // ====================================================================
- // tell our listeners
- {
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
- EventObject aDisposeEvent;
- aDisposeEvent.Source = static_cast< XAggregation* >( static_cast< ::cppu::OWeakAggObject* >( this ) );
-
- maContainerListeners.disposeAndClear( aDisposeEvent );
- maChangeListeners.disposeAndClear( aDisposeEvent );
- }
-
- // ====================================================================
- // call the base class
- UnoControlModel::dispose();
-
- // ====================================================================
- // dispose our child models
- // for this, collect the models (we collect them from maModels, and this is modified when disposing children)
- ::std::vector< Reference< XControlModel > > aChildModels( maModels.size() );
-
- ::std::transform(
- maModels.begin(), maModels.end(), // source range
- aChildModels.begin(), // target location
- ::o3tl::select1st< UnoControlModelHolder >( ) // operation to apply -> select the XControlModel part
- );
-
- // now dispose
- ::std::for_each( aChildModels.begin(), aChildModels.end(), DisposeControlModel() );
- aChildModels.clear();
-
- mbGroupsUpToDate = sal_False;
-}
-
// XMultiPropertySet
Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) throw(RuntimeException)
{
@@ -493,1072 +160,21 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro
return xInfo;
}
-UnoControlModel* UnoControlDialogModel::Clone() const
-{
- // clone the container itself
- UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
-
- // clone all children
- ::std::for_each(
- maModels.begin(), maModels.end(),
- CloneControlModel( pClone->maModels )
- );
-
- return pClone;
-}
-
-UnoControlDialogModel::UnoControlModelHolderList::iterator UnoControlDialogModel::ImplFindElement( const ::rtl::OUString& rName )
-{
- return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) );
-}
-
-// ::XMultiServiceFactory
-Reference< XInterface > UnoControlDialogModel::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(Exception, RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- OGeometryControlModel_Base* pNewModel = NULL;
-
- if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlEditModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFileControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlButtonModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlImageControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlListBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoTreeModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoGridModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoMultiPageModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoMultiPageModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoFrameModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoFrameModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoSimpleAnimationControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoSimpleAnimationControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoThrobberControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoThrobberControlModel >;
-
- if ( !pNewModel )
- {
- Reference< XMultiServiceFactory > xORB( ::comphelper::getProcessServiceFactory() );
- if ( xORB.is() )
- {
- Reference< XInterface > xObject = xORB->createInstance( aServiceSpecifier );
- Reference< XServiceInfo > xSI( xObject, UNO_QUERY );
- Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY );
- Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY );
- if ( xAgg.is() )
- {
- if ( xSI->supportsService( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlModel")) ) )
- {
- // release 3 of the 4 references we have to the object
- xAgg.clear();
- xSI.clear();
- xObject.clear();
-
- pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier );
- }
- }
- }
- }
-
- Reference< XInterface > xNewModel = (::cppu::OWeakObject*)pNewModel;
- return xNewModel;
-}
-
-Reference< XInterface > UnoControlDialogModel::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException)
-{
- return createInstance( ServiceSpecifier );
-}
-
-Sequence< ::rtl::OUString > UnoControlDialogModel::getAvailableServiceNames() throw(RuntimeException)
-{
- static Sequence< ::rtl::OUString >* pNamesSeq = NULL;
- if ( !pNamesSeq )
- {
- pNamesSeq = new Sequence< ::rtl::OUString >( 26 );
- ::rtl::OUString* pNames = pNamesSeq->getArray();
- pNames[0] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlEditModel );
- pNames[1] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFormattedFieldModel );
- pNames[2] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFileControlModel );
- pNames[3] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlButtonModel );
- pNames[4] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlImageControlModel );
- pNames[5] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel );
- pNames[6] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCheckBoxModel );
- pNames[7] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedTextModel );
- pNames[8] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlGroupBoxModel );
- pNames[9] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlListBoxModel );
- pNames[10] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlComboBoxModel );
- pNames[11] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlDateFieldModel );
- pNames[12] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlTimeFieldModel );
- pNames[13] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlNumericFieldModel );
- pNames[14] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCurrencyFieldModel );
- pNames[15] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlPatternFieldModel );
- pNames[16] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlProgressBarModel );
- pNames[17] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlScrollBarModel );
- pNames[18] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedLineModel );
- pNames[19] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRoadmapModel );
- pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel );
- pNames[21] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel );
- pNames[22] = ::rtl::OUString::createFromAscii( szServiceName2_UnoSimpleAnimationControlModel );
- pNames[23] = ::rtl::OUString::createFromAscii( szServiceName2_UnoThrobberControlModel );
- pNames[24] = ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageModel );
- pNames[25] = ::rtl::OUString::createFromAscii( szServiceName_UnoFrameModel );
- }
- return *pNamesSeq;
-}
-
-// XContainer
-void UnoControlDialogModel::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
-{
- maContainerListeners.addInterface( l );
-}
-
-void UnoControlDialogModel::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
-{
- maContainerListeners.removeInterface( l );
-}
-
-// XElementAcces
-Type UnoControlDialogModel::getElementType() throw(RuntimeException)
-{
- Type aType = getCppuType( ( Reference< XControlModel>* ) NULL );
- return aType;
-}
-
-void UnoControlDialogModel::updateUserFormChildren( const Reference< XNameContainer >& xAllChildren, const rtl::OUString& aName, ChildOperation Operation, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xTarget ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
-{
- if ( Operation < Insert || Operation > Remove )
- throw IllegalArgumentException();
-
- if ( xAllChildren.is() )
- {
- if ( Operation == Remove )
- {
- Reference< XControlModel > xOldModel( xAllChildren->getByName( aName ), UNO_QUERY );
- xAllChildren->removeByName( aName );
-
- Reference< XNameContainer > xChildContainer( xOldModel, UNO_QUERY );
- if ( xChildContainer.is() )
- {
- Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY );
- // container control is being removed from this container, reset the
- // global list of containees
- if ( xProps.is() )
- xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( uno::Reference< XNameContainer >() ) );
- Sequence< rtl::OUString > aChildNames = xChildContainer->getElementNames();
- for ( sal_Int32 index=0; index< aChildNames.getLength(); ++index )
- updateUserFormChildren( xAllChildren, aChildNames[ index ], Operation, Reference< XControlModel > () );
- }
- }
- else if ( Operation == Insert )
- {
- xAllChildren->insertByName( aName, uno::makeAny( xTarget ) );
- Reference< XNameContainer > xChildContainer( xTarget, UNO_QUERY );
- if ( xChildContainer.is() )
- {
- // container control is being added from this container, reset the
- // global list of containees to point to the correct global list
- Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY );
- if ( xProps.is() )
- xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( xAllChildren ) );
- Sequence< rtl::OUString > aChildNames = xChildContainer->getElementNames();
- for ( sal_Int32 index=0; index< aChildNames.getLength(); ++index )
- {
- Reference< XControlModel > xChildTarget( xChildContainer->getByName( aChildNames[ index ] ), UNO_QUERY );
- updateUserFormChildren( xAllChildren, aChildNames[ index ], Operation, xChildTarget );
- }
- }
- }
- }
- else
- throw IllegalArgumentException();
-}
-
-sal_Bool UnoControlDialogModel::hasElements() throw(RuntimeException)
-{
- return !maModels.empty();
-}
-
-// XNameContainer, XNameReplace, XNameAccess
-void UnoControlDialogModel::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xNewModel;
- aElement >>= xNewModel;
- if ( !xNewModel.is() )
- lcl_throwIllegalArgumentException();
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
- // Dialog behaviour is to have all containee names unique ( MSO Userform is the same )
- // With container controls you could have constructed an existing hierachy and are now
- // add this to an existing container, in this case a name nested in the containment
- // hierachy of the added control could contain a name clash, if we have access to the
- // list of global names then recursively check for previously existing names ( we need
- // to do this obviously before the 'this' objects container is updated
- Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
- if ( xAllChildren.is() )
- {
- // remove old control ( and children ) from global list of containees
- updateUserFormChildren( xAllChildren, aName, Remove, uno::Reference< XControlModel >() );
- // Add new control ( and containees if they exist )
- updateUserFormChildren( xAllChildren, aName, Insert, xNewModel );
- }
- // stop listening at the old model
- stopControlListening( aElementPos->first );
- Reference< XControlModel > xReplaced( aElementPos->first );
- // remember the new model, and start listening
- aElementPos->first = xNewModel;
- startControlListening( xNewModel );
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element = aElement;
- aEvent.ReplacedElement <<= xReplaced;
- aEvent.Accessor <<= aName;
-
- // notify the container listener
- maContainerListeners.elementReplaced( aEvent );
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-Any UnoControlDialogModel::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
-
- return makeAny( aElementPos->first );
-}
-
-Sequence< ::rtl::OUString > UnoControlDialogModel::getElementNames() throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aNames( maModels.size() );
-
- ::std::transform(
- maModels.begin(), maModels.end(), // source range
- aNames.getArray(), // target range
- ::o3tl::select2nd< UnoControlModelHolder >() // operator to apply: select the second element (the name)
- );
-
- return aNames;
-}
-
-sal_Bool UnoControlDialogModel::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
-{
- return maModels.end() != ImplFindElement( aName );
-}
-
-void UnoControlDialogModel::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xM;
- aElement >>= xM;
-
- if ( xM.is() )
- {
- Reference< beans::XPropertySet > xProps( xM, UNO_QUERY );
- if ( xProps.is() )
- {
-
- Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo();
-
- ::rtl::OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
- if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty ))
- {
- Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty );
-
- ::rtl::OUString absoluteUrl;
- aUrl >>= absoluteUrl;
- if ( absoluteUrl.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
- xProps.get()->setPropertyValue( sImageSourceProperty , aUrl );
- // Now we inherit from this class, no all containers have
- // DialogSourceURL
- else if ( getPropertySetInfo()->hasPropertyByName( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ) )
- getPhysicalLocation( getPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ), aUrl );
-
- aUrl <<= absoluteUrl;
-
- xProps.get()->setPropertyValue( sImageSourceProperty , aUrl );
- }
- }
- }
-
-
-
- if ( !aName.getLength() || !xM.is() )
- lcl_throwIllegalArgumentException();
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() != aElementPos )
- lcl_throwElementExistException();
-
- // Dialog behaviour is to have all containee names unique ( MSO Userform is the same )
- // With container controls you could have constructed an existing hierachy and are now
- // add this to an existing container, in this case a name nested in the containment
- // hierachy of the added control could contain a name clash, if we have access to the
- // list of global names then we need to recursively check for previously existing
- // names ( we need to do this obviously before the 'this' objects container is updated
- // remove old control ( and children ) from global list of containees
- Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
-
- if ( xAllChildren.is() )
- updateUserFormChildren( xAllChildren, aName, Insert, xM );
- maModels.push_back( UnoControlModelHolder( xM, aName ) );
-
- mbGroupsUpToDate = sal_False;
- startControlListening( xM );
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element <<= aElement;
- aEvent.Accessor <<= aName;
- maContainerListeners.elementInserted( aEvent );
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-void UnoControlDialogModel::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
-
- // Dialog behaviour is to have all containee names unique ( MSO Userform is the same )
- // With container controls you could have constructed an existing hierachy and are now
- // removing this control from an existing container, in this case all nested names in
- // the containment hierachy of the control to be removed need to be removed from the global
- // names cache ( we need to do this obviously before the 'this' objects container is updated )
- Reference< XNameContainer > xAllChildren( getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
- if ( xAllChildren.is() )
- updateUserFormChildren( xAllChildren, aName, Remove, uno::Reference< XControlModel >() );
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element <<= aElementPos->first;
- aEvent.Accessor <<= aName;
- maContainerListeners.elementRemoved( aEvent );
-
- stopControlListening( aElementPos->first );
- Reference< XPropertySet > xPS( aElementPos->first, UNO_QUERY );
- maModels.erase( aElementPos );
- mbGroupsUpToDate = sal_False;
-
- if ( xPS.is() )
- try
- {
- xPS->setPropertyValue( PROPERTY_RESOURCERESOLVER, makeAny( Reference< resource::XStringResourceResolver >() ) );
- }
- catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-// ----------------------------------------------------------------------------
-sal_Bool SAL_CALL UnoControlDialogModel::getGroupControl( ) throw (RuntimeException)
-{
- return sal_True;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setGroupControl( sal_Bool ) throw (RuntimeException)
-{
- OSL_FAIL( "UnoControlDialogModel::setGroupControl: explicit grouping not supported" );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- // set the tab indexes according to the order of models in the sequence
- const Reference< XControlModel >* pControls = _rControls.getConstArray( );
- const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength();
-
- sal_Int16 nTabIndex = 1;
-
- for ( ; pControls != pControlsEnd; ++pControls )
- {
- // look up the control in our own structure. This is to prevent invalid arguments
- UnoControlModelHolderList::const_iterator aPos =
- ::std::find_if(
- maModels.begin(), maModels.end(),
- CompareControlModel( *pControls )
- );
- if ( maModels.end() != aPos )
- {
- // okay, this is an existent model
- // now set the TabIndex property (if applicable)
- Reference< XPropertySet > xProps( aPos->first, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xProps.is() )
- xPSI = xProps->getPropertySetInfo();
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xProps->setPropertyValue( getTabIndexPropertyName(), makeAny( nTabIndex++ ) );
- }
- mbGroupsUpToDate = sal_False;
- }
-}
-
-
-typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal_Int32 > > MapIndexToModel;
-
-// ----------------------------------------------------------------------------
-Sequence< Reference< XControlModel > > SAL_CALL UnoControlDialogModel::getControlModels( ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- MapIndexToModel aSortedModels;
- // will be the sorted container of all models which have a tab index property
- ::std::vector< Reference< XControlModel > > aUnindexedModels;
- // will be the container of all models which do not have a tab index property
-
- UnoControlModelHolderList::const_iterator aLoop = maModels.begin();
- for ( ; aLoop != maModels.end(); ++aLoop )
- {
- Reference< XControlModel > xModel( aLoop->first );
-
- // see if the model has a TabIndex property
- Reference< XPropertySet > xControlProps( xModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xControlProps.is() )
- xPSI = xControlProps->getPropertySetInfo( );
- DBG_ASSERT( xPSI.is(), "UnoControlDialogModel::getControlModels: invalid child model!" );
-
- // has it?
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- { // yes
- sal_Int32 nTabIndex = -1;
- xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex;
-
- aSortedModels.insert( MapIndexToModel::value_type( nTabIndex, xModel ) );
- }
- else if ( xModel.is() )
- // no, it hasn't, but we have to include it, anyway
- aUnindexedModels.push_back( xModel );
- }
-
- // okay, here we have a container of all our models, sorted by tab index,
- // plus a container of "unindexed" models
- // -> merge them
- Sequence< Reference< XControlModel > > aReturn( aUnindexedModels.size() + aSortedModels.size() );
- ::std::transform(
- aSortedModels.begin(), aSortedModels.end(),
- ::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ),
- ::o3tl::select2nd< MapIndexToModel::value_type >( )
- );
-
- return aReturn;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setGroup( const Sequence< Reference< XControlModel > >&, const ::rtl::OUString& ) throw (RuntimeException)
-{
- // not supported. We have only implicit grouping:
- // We only have a sequence of control models, and we _know_ (yes, that's a HACK relying on
- // implementation details) that VCL does grouping according to the order of controls automatically
- // At least VCL does this for all we're interested in: Radio buttons.
- OSL_FAIL( "UnoControlDialogModel::setGroup: grouping not supported" );
-}
-
-// ----------------------------------------------------------------------------
-namespace
-{
- enum GroupingMachineState
- {
- eLookingForGroup,
- eExpandingGroup
- };
-
- // ........................................................................
- static sal_Int32 lcl_getDialogStep( const Reference< XControlModel >& _rxModel )
- {
- sal_Int32 nStep = 0;
- try
- {
- Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
- xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep;
- }
- catch( const Exception& )
- {
- OSL_FAIL( "lcl_getDialogStep: caught an exception while determining the dialog page!" );
- }
- return nStep;
- }
-}
-
-// ----------------------------------------------------------------------------
-sal_Int32 SAL_CALL UnoControlDialogModel::getGroupCount( ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- implUpdateGroupStructure();
-
- return maGroups.size();
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- implUpdateGroupStructure();
-
- if ( ( _nGroup < 0 ) || ( _nGroup >= (sal_Int32)maGroups.size() ) )
- {
- OSL_FAIL( "UnoControlDialogModel::getGroup: invalid argument and I am not allowed to throw an exception!" );
- _rGroup.realloc( 0 );
- _rName = ::rtl::OUString();
- }
- else
- {
- AllGroups::const_iterator aGroupPos = maGroups.begin() + _nGroup;
- _rGroup.realloc( aGroupPos->size() );
- // copy the models
- ::std::copy( aGroupPos->begin(), aGroupPos->end(), _rGroup.getArray() );
- // give the group a name
- _rName = ::rtl::OUString::valueOf( _nGroup );
- }
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- ::rtl::OUString sDummyName;
- getGroup( _rName.toInt32( ), _rGroup, sDummyName );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::addChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
-{
- maChangeListeners.addInterface( _rxListener );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::removeChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
-{
- maChangeListeners.removeInterface( _rxListener );
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rAccessor )
-{
- // multiplex to our change listeners:
- // the changes event
- ChangesEvent aEvent;
- aEvent.Source = *this;
- aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself
- aEvent.Changes.realloc( 1 ); // exactly one change
- aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
-
-
- Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
- const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
- const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
- for ( ; pListener != pListenerEnd; ++pListener )
- {
- if ( pListener->is() )
- static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
- }
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::AddRadioButtonGroup (
- ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups )
-{
- if ( rNamedGroups.size() == 0 )
- return;
-
- size_t nGroups = maGroups.size();
- maGroups.reserve( nGroups + rNamedGroups.size() );
- ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end();
- for( ; i != e; ++i)
- {
- maGroups.push_back( i->second );
- }
-
- rNamedGroups.clear();
-}
-
-void UnoControlDialogModel::AddRadioButtonToGroup (
- const Reference< XControlModel >& rControlModel,
- const ::rtl::OUString& rPropertyName,
- ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups,
- ModelGroup*& rpCurrentGroup )
-{
- Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY );
- ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps );
- const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel );
-
- if ( sGroup.getLength() == 0 )
- {
- // Create a new group if:
- if ( maGroups.size() == 0 || // no groups
- rpCurrentGroup == NULL || // previous group was closed
- (nControlModelStep != 0 && // control step matches current group
- maGroups.back().size() > 0 && // (group 0 == display everywhere)
- nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) )
- {
- size_t nGroups = maGroups.size();
- maGroups.resize( nGroups + 1 );
- }
- rpCurrentGroup = &maGroups.back();
- }
- else
- {
- // Different steps get different sets of named groups
- if ( rNamedGroups.size() > 0 &&
- rNamedGroups.begin()->second.size() > 0 )
- {
- const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() );
- if ( nControlModelStep != nPrevStep )
- AddRadioButtonGroup( rNamedGroups );
- }
-
- rpCurrentGroup = &rNamedGroups[ sGroup ];
- }
- rpCurrentGroup->push_back( rControlModel );
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::implUpdateGroupStructure()
-{
- if ( mbGroupsUpToDate )
- // nothing to do
- return;
-
- // conditions for a group:
- // * all elements of the group are radio buttons
- // * all elements of the group are on the same dialog page
- // * in the overall control order (determined by the tab index), all elements are subsequent
-
- maGroups.clear();
-
- Sequence< Reference< XControlModel > > aControlModels = getControlModels();
- const Reference< XControlModel >* pControlModels = aControlModels.getConstArray();
- const Reference< XControlModel >* pControlModelsEnd = pControlModels + aControlModels.getLength();
-
- // in extreme we have as much groups as controls
- maGroups.reserve( aControlModels.getLength() );
-
- GroupingMachineState eState = eLookingForGroup; // the current state of our machine
- Reference< XServiceInfo > xModelSI; // for checking for a radion button
- ModelGroup* aCurrentGroup = NULL; // the group which we're currently building
- sal_Bool bIsRadioButton; // is it a radio button?
-
- const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) );
-
- ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups;
-
-#if OSL_DEBUG_LEVEL > 1
- ::std::vector< ::rtl::OUString > aCurrentGroupLabels;
-#endif
-
- for ( ; pControlModels != pControlModelsEnd; ++pControlModels )
- {
- // we'll need this in every state
- xModelSI = xModelSI.query( *pControlModels );
- bIsRadioButton = xModelSI.is() && xModelSI->supportsService( ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel ) );
-
- switch ( eState )
- {
- case eLookingForGroup:
- {
- if ( !bIsRadioButton )
- // this is no radio button -> still looking for the beginning of a group
- continue;
- // the current model is a radio button
- // -> we found the beginning of a new group
- // create the place for this group
- AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
-
- // new state: looking for further members
- eState = eExpandingGroup;
-
-#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) )
- xModelProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- }
- break;
-
- case eExpandingGroup:
- {
- if ( !bIsRadioButton )
- { // no radio button -> the group is done
- aCurrentGroup = NULL;
- eState = eLookingForGroup;
-#if OSL_DEBUG_LEVEL > 1
- aCurrentGroupLabels.clear();
-#endif
- continue;
- }
-
- AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
-
-#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) )
- xModelProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- }
- break;
- }
- }
-
- AddRadioButtonGroup( aNamedGroups );
- mbGroupsUpToDate = sal_True;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ),
- "UnoControlDialogModel::propertyChange: not listening for this property!" );
-
- // the accessor for the changed element
- ::rtl::OUString sAccessor;
- UnoControlModelHolderList::const_iterator aPos =
- ::std::find_if(
- maModels.begin(), maModels.end(),
- CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) )
- );
- OSL_ENSURE( maModels.end() != aPos, "UnoControlDialogModel::propertyChange: don't know this model!" );
- if ( maModels.end() != aPos )
- sAccessor = aPos->second;
-
- // our groups are not up-to-date
- mbGroupsUpToDate = sal_False;
-
- // notify
- implNotifyTabModelChange( sAccessor );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::disposing( const EventObject& /*rEvent*/ ) throw (RuntimeException)
-{
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::startControlListening( const Reference< XControlModel >& _rxChildModel )
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xModelProps.is() )
- xPSI = xModelProps->getPropertySetInfo();
-
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this );
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::stopControlListening( const Reference< XControlModel >& _rxChildModel )
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xModelProps.is() )
- xPSI = xModelProps->getPropertySetInfo();
-
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this );
-}
-
-// ============================================================================
-// = class ResourceListener
-// ============================================================================
-
-ResourceListener::ResourceListener(
- const Reference< util::XModifyListener >& rListener ) :
- OWeakObject(),
- m_xListener( rListener ),
- m_bListening( false )
-{
-}
-
-ResourceListener::~ResourceListener()
-{
-}
-
-// XInterface
-Any SAL_CALL ResourceListener::queryInterface( const Type& rType )
-throw ( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- static_cast< XModifyListener* >( this ),
- static_cast< XEventListener* >( this ));
-
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
-void SAL_CALL ResourceListener::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL ResourceListener::release() throw ()
-{
- OWeakObject::release();
-}
-
-void ResourceListener::startListening(
- const Reference< resource::XStringResourceResolver >& rResource )
-{
- Reference< util::XModifyBroadcaster > xModifyBroadcaster( rResource, UNO_QUERY );
-
- {
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- bool bListening( m_bListening );
- bool bResourceSet( m_xResource.is() );
- aGuard.clear();
- // --- SAFE ---
-
- if ( bListening && bResourceSet )
- stopListening();
-
- // --- SAFE ---
- aGuard.reset();
- m_xResource = rResource;
- aGuard.clear();
- // --- SAFE ---
- }
-
- Reference< util::XModifyListener > xThis( static_cast<OWeakObject*>( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- xModifyBroadcaster->addModifyListener( xThis );
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- m_bListening = true;
- // --- SAFE ---
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-void ResourceListener::stopListening()
-{
- Reference< util::XModifyBroadcaster > xModifyBroadcaster;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- if ( m_bListening && m_xResource.is() )
- xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY );
- aGuard.clear();
- // --- SAFE ---
-
- Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- m_xResource.clear();
- aGuard.clear();
- // --- SAFE ---
-
- xModifyBroadcaster->removeModifyListener( xThis );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-// XModifyListener
-void SAL_CALL ResourceListener::modified(
- const lang::EventObject& aEvent )
-throw ( RuntimeException )
-{
- Reference< util::XModifyListener > xListener;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- xListener = m_xListener;
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- {
- try
- {
- xListener->modified( aEvent );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-// XEventListener
-void SAL_CALL ResourceListener::disposing(
- const EventObject& Source )
-throw ( RuntimeException )
-{
- Reference< lang::XEventListener > xListener;
- Reference< resource::XStringResourceResolver > xResource;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY );
- Reference< XInterface > xIfacList( m_xListener, UNO_QUERY );
- aGuard.clear();
- // --- SAFE ---
-
- if ( Source.Source == xIfacRes )
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- xResource = m_xResource;
- xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
- m_xResource.clear();
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- {
- try
- {
- xListener->disposing( Source );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
- }
- else if ( Source.Source == xIfacList )
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
- xResource = m_xResource;
- m_xResource.clear();
- m_xListener.clear();
- aGuard.clear();
- // --- SAFE ---
-
- // Remove ourself as listener from resource resolver
- Reference< util::XModifyBroadcaster > xModifyBroadcaster( xResource, UNO_QUERY );
- Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- xModifyBroadcaster->removeModifyListener( xThis );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
- }
-}
-
// ============================================================================
// = class UnoDialogControl
// ============================================================================
-UnoDialogControl::UnoDialogControl() :
- maTopWindowListeners( *this ),
- mbWindowListener(false),
- mbSizeModified(false),
- mbPosModified(false)
+UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :ControlContainerBase( i_factory )
+ ,maTopWindowListeners( *this )
+ ,mbWindowListener(false)
{
maComponentInfos.nWidth = 300;
maComponentInfos.nHeight = 450;
- mxListener = new ResourceListener( Reference< util::XModifyListener >(
- static_cast< OWeakObject* >( this ), UNO_QUERY ));
+ }
+
+UnoDialogControl::~UnoDialogControl()
+{
}
::rtl::OUString UnoDialogControl::GetComponentServiceName()
@@ -1567,270 +183,59 @@ UnoDialogControl::UnoDialogControl() :
sal_Bool bDecoration( sal_True );
ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
if ( bDecoration )
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dialog"));
+ return ::rtl::OUString::createFromAscii( "Dialog" );
else
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TabPage"));
+ return ::rtl::OUString::createFromAscii( "TabPage" );
}
// XInterface
Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeException)
{
- Any aRet( UnoDialogControl_IBase::queryInterface( rType ) );
- return (aRet.hasValue() ? aRet : UnoControlContainer::queryAggregation( rType ));
+ uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XTopWindow*, this ) );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XDialog*, this ) );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) );
+ return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
}
-// XTypeProvider
-IMPL_IMPLEMENTATION_ID( UnoDialogControl )
-Sequence< Type > UnoDialogControl::getTypes() throw(RuntimeException)
-{
- return ::comphelper::concatSequences(
- UnoDialogControl_IBase::getTypes(),
- UnoControlContainer::getTypes()
- );
-}
-
-void UnoDialogControl::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName )
-{
- Reference< XPropertySet > xP( rxModel, UNO_QUERY );
-
- ::rtl::OUString aDefCtrl;
- xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
-
- // Add our own resource resolver to a newly created control
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
-
- Any aAny;
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
-
- aAny <<= xStringResourceResolver;
- xP->setPropertyValue( aPropName, aAny );
-
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY );
-
- DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
- if ( xCtrl.is() )
- {
- xCtrl->setModel( rxModel );
- addControl( rName, xCtrl );
- // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model
- // (which we formerly did herein)
-
- ImplSetPosSize( xCtrl );
- }
-}
-
-void UnoDialogControl::ImplRemoveControl( Reference< XControlModel >& rxModel )
-{
- Sequence< Reference< XControl > > aControls = getControls();
- Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
- if ( xCtrl.is() )
- removeControl( xCtrl );
-}
-
-void UnoDialogControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
-{
- Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY );
-
- sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
-
- // Currentley we are simply using MAP_APPFONT
- OutputDevice*pOutDev = Application::GetDefaultDevice();
- DBG_ASSERT( pOutDev, "Missing Default Device!" );
- if ( pOutDev )
- {
- ::Size aTmp( nX, nY );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
- nX = aTmp.Width();
- nY = aTmp.Height();
- aTmp = ::Size( nWidth, nHeight );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
- nWidth = aTmp.Width();
- nHeight = aTmp.Height();
- }
- else
- {
- Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
- Reference< XDevice > xD( xPeer, UNO_QUERY );
-
- SimpleFontMetric aFM;
- FontDescriptor aFD;
- Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
- aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
- {
- Reference< XFont > xFont = xD->getFont( aFD );
- aFM = xFont->getFontMetric();
- }
- else
- {
- Reference< XGraphics > xG = xD->createGraphics();
- aFM = xG->getFontMetric();
- }
-
- sal_Int16 nH = aFM.Ascent + aFM.Descent;
- sal_Int16 nW = nH/2; // calculate avarage width?!
-
- nX *= nW;
- nX /= 4;
- nWidth *= nW;
- nWidth /= 4;
- nY *= nH;
- nY /= 8;
- nHeight *= nH;
- nHeight /= 8;
- }
- Reference < XWindow > xW( rxCtrl, UNO_QUERY );
- xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
-}
+ //lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( UnoDialogControl)
+ getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ),
+ getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ),
+ getCppuType( ( uno::Reference< awt::XWindowListener>* ) NULL ),
+ ControlContainerBase::getTypes()
+IMPL_XTYPEPROVIDER_END
void UnoDialogControl::dispose() throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
EventObject aEvt;
aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
maTopWindowListeners.disposeAndClear( aEvt );
-
- // Notify our listener helper about dispose
- // --- SAFE ---
- ::osl::ResettableGuard< ::osl::Mutex > aGuard( GetMutex() );
- Reference< XEventListener > xListener( mxListener, UNO_QUERY );
- mxListener.clear();
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- xListener->disposing( aEvt );
-
- UnoControlContainer::dispose();
+ ControlContainerBase::dispose();
}
void SAL_CALL UnoDialogControl::disposing(
const EventObject& Source )
throw(RuntimeException)
{
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
- Reference< XInterface > xIfac( xStringResourceResolver, UNO_QUERY );
-
- if ( Source.Source == xIfac )
- {
- Any aAny;
-
- // Reset resource resolver reference
- ImplSetPropertyValue( aPropName, aAny, sal_True );
- ImplUpdateResourceResolver();
- }
- else
- {
- UnoControlContainer::disposing( Source );
- }
+ ControlContainerBase::disposing( Source );
}
sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
-
- // destroy the old tab controller, if existent
- if ( mxTabController.is() )
- {
- mxTabController->setModel( NULL ); // just to be sure, should not be necessary
- removeTabController( mxTabController );
- ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary
- mxTabController.clear();
- }
-
- if ( getModel().is() )
- {
- Sequence< Reference< XControl > > aControls = getControls();
- const Reference< XControl >* pCtrls = aControls.getConstArray();
- const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
-
- for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
- removeControl( *pCtrls );
- // will implicitly call removingControl, which will remove the PropertyChangeListener
- // (which we formerly did herein)
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->removeContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->removeChangesListener( this );
- }
-
- sal_Bool bRet = UnoControl::setModel( rxModel );
-
- if ( getModel().is() )
- {
- Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
- if ( xNA.is() )
- {
- Sequence< ::rtl::OUString > aNames = xNA->getElementNames();
- const ::rtl::OUString* pNames = aNames.getConstArray();
- sal_uInt32 nCtrls = aNames.getLength();
-
- Reference< XControlModel > xCtrlModel;
- for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames )
- {
- xNA->getByName( *pNames ) >>= xCtrlModel;
- ImplInsertControl( xCtrlModel, *pNames );
- }
- }
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->addContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->addChangesListener( this );
- }
-
- Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY );
- if ( xTabbing.is() )
- {
- mxTabController = new StdTabController;
- mxTabController->setModel( xTabbing );
- addTabController( mxTabController );
- }
+ // #Can we move all the Resource stuff to the ControlContainerBase ?
+ SolarMutexGuard aGuard;
+ sal_Bool bRet = ControlContainerBase::setModel( rxModel );
ImplStartListingForResourceEvents();
-
return bRet;
}
-void UnoDialogControl::setDesignMode( sal_Bool bOn ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
- UnoControl::setDesignMode( bOn );
-
- Sequence< Reference< XControl > > xCtrls = getControls();
- sal_Int32 nControls = xCtrls.getLength();
- Reference< XControl >* pControls = xCtrls.getArray();
- for ( sal_Int32 n = 0; n < nControls; n++ )
- pControls[n]->setDesignMode( bOn );
-
- // #109067# in design mode the tab controller is not notified about
- // tab index changes, therefore the tab order must be activated
- // when switching from design mode to live mode
- if ( mxTabController.is() && !bOn )
- mxTabController->activateTabOrder();
-}
-
void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
UnoControlContainer::createPeer( rxToolkit, rParentPeer );
@@ -1867,53 +272,17 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes
// can lead to overwrites we have to set the graphic property
// before the propertiesChangeEvents are sent!
::rtl::OUString aImageURL;
+ Reference< graphic::XGraphic > xGraphic;
if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
( aImageURL.getLength() > 0 ))
{
- rtl::OUString absoluteUrl( aImageURL );
- if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
- absoluteUrl =
- getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
+ ::rtl::OUString absoluteUrl =
+ getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
ImplGetPropertyValue( PROPERTY_IMAGEURL ));
- ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( absoluteUrl ), sal_True );
- }
-}
-
-void UnoDialogControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xModel;
- ::rtl::OUString aName;
-
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
-}
-
-void UnoDialogControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- Reference< XControlModel > xModel;
- Event.Element >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-}
-
-void UnoDialogControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xModel;
- Event.ReplacedElement >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-
- ::rtl::OUString aName;
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
+ xGraphic = ControlContainerBase::Impl_getGraphicFromURL_nothrow( absoluteUrl );
+ ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True );
+ }
}
void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener ) throw (RuntimeException)
@@ -1938,7 +307,7 @@ void UnoDialogControl::removeTopWindowListener( const Reference< XTopWindowListe
void UnoDialogControl::toFront( ) throw (RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
if ( getPeer().is() )
{
Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
@@ -1949,7 +318,7 @@ void UnoDialogControl::toFront( ) throw (RuntimeException)
void UnoDialogControl::toBack( ) throw (RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
if ( getPeer().is() )
{
Reference< XTopWindow > xTW( getPeer(), UNO_QUERY );
@@ -1960,7 +329,7 @@ void UnoDialogControl::toBack( ) throw (RuntimeException)
void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) throw (RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
mxMenuBar = rxMenuBar;
if ( getPeer().is() )
{
@@ -1969,13 +338,11 @@ void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) thro
xTW->setMenuBar( mxMenuBar );
}
}
-
static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
{
::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
return aTmp;
}
-
// ::com::sun::star::awt::XWindowListener
void SAL_CALL UnoDialogControl::windowResized( const ::com::sun::star::awt::WindowEvent& e )
throw (::com::sun::star::uno::RuntimeException)
@@ -2054,170 +421,9 @@ throw (::com::sun::star::uno::RuntimeException)
(void)e;
}
-// XPropertiesChangeListener
-void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
-{
- if( !isDesignMode() && !mbCreatingCompatiblePeer )
- {
- ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) );
- ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) );
- ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
- ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) );
-
- sal_Int32 nLen = rEvents.getLength();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
- Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
- sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
- if ( ( rEvt.PropertyName == s1 ) ||
- ( rEvt.PropertyName == s2 ) ||
- ( rEvt.PropertyName == s3 ) ||
- ( rEvt.PropertyName == s4 ) )
- {
- if ( bOwnModel )
- {
- if ( !mbPosModified && !mbSizeModified )
- {
- // Don't set new pos/size if we get new values from window listener
- Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY );
- ImplSetPosSize( xThis );
- }
- }
- else
- {
- Sequence<Reference<XControl> > aControlSequence(getControls());
- Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) );
- ImplSetPosSize( aControlRef );
- }
- break;
- }
- else if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ResourceResolver", 16 ))
- {
- ImplStartListingForResourceEvents();
- }
- }
- }
-
- sal_Int32 nLen = rEvents.getLength();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
- Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
- sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
- if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 ))
- {
- ::rtl::OUString aImageURL;
- ::rtl::OUString absoluteUrl( aImageURL );
- // Ignore GraphicObject urls
- if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
- ( aImageURL.getLength() > 0 ))
- {
- absoluteUrl = aImageURL;
- if ( aImageURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
- absoluteUrl =
- getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
- ImplGetPropertyValue( PROPERTY_IMAGEURL ));
-
- ImplSetPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( absoluteUrl ), sal_True );
- }
- break;
- }
- }
-
- UnoControlContainer::ImplModelPropertiesChanged( rEvents );
-}
-
-void UnoDialogControl::ImplStartListingForResourceEvents()
-{
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
-
- // Add our helper as listener to retrieve notifications about changes
- Reference< util::XModifyListener > rListener( mxListener );
- ResourceListener* pResourceListener = static_cast< ResourceListener* >( rListener.get() );
-
- // resource listener will stop listening if resolver reference is empty
- if ( pResourceListener )
- pResourceListener->startListening( xStringResourceResolver );
- ImplUpdateResourceResolver();
-}
-
-void UnoDialogControl::ImplUpdateResourceResolver()
-{
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
- if ( !xStringResourceResolver.is() )
- return;
-
- Any xNewStringResourceResolver; xNewStringResourceResolver <<= xStringResourceResolver;
-
- Sequence< rtl::OUString > aPropNames(1);
- aPropNames[0] = aPropName;
-
- const Sequence< Reference< awt::XControl > > aSeq = getControls();
- for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
- {
- Reference< XControl > xControl( aSeq[i] );
- Reference< XPropertySet > xPropertySet;
-
- if ( xControl.is() )
- xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY );
-
- if ( !xPropertySet.is() )
- continue;
-
- try
- {
- Reference< resource::XStringResourceResolver > xCurrStringResourceResolver;
- Any aOldValue = xPropertySet->getPropertyValue( aPropName );
- if ( ( aOldValue >>= xCurrStringResourceResolver )
- && ( xStringResourceResolver == xCurrStringResourceResolver )
- )
- {
- Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
- Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
- xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener );
- }
- else
- xPropertySet->setPropertyValue( aPropName, xNewStringResourceResolver );
- }
- /*catch ( NoSuchElementException& )*/ // that's nonsense, this is never thrown above ...
- catch ( const Exception& )
- {
- }
- }
-
- // propagate resource resolver changes to language dependent props of the dialog
- Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY );
- if ( xPropertySet.is() )
- {
- Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
- Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
- xMultiPropSet->firePropertiesChangeEvent( lcl_getLanguageDependentProperties(), xListener );
- }
-}
-
-void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException)
-{
- Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
- if ( xPeerDialog.is() )
- xPeerDialog->endDialog( i_result );
-}
-
-void SAL_CALL UnoDialogControl::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException)
-{
- Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
- if ( xPeerDialog.is() )
- xPeerDialog->setHelpId( i_id );
-}
-
void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
Any aAny;
aAny <<= Title;
ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ), aAny, sal_True );
@@ -2225,13 +431,13 @@ void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeExc
::rtl::OUString UnoDialogControl::getTitle() throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
return ImplGetPropertyValue_UString( BASEPROPERTY_TITLE );
}
sal_Int16 UnoDialogControl::execute() throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
sal_Int16 nDone = -1;
if ( getPeer().is() )
{
@@ -2248,7 +454,7 @@ sal_Int16 UnoDialogControl::execute() throw(RuntimeException)
void UnoDialogControl::endExecute() throw(RuntimeException)
{
- SolarMutexGuard aSolarGuard;
+ SolarMutexGuard aGuard;
if ( getPeer().is() )
{
Reference< XDialog > xDlg( getPeer(), UNO_QUERY );
@@ -2260,53 +466,6 @@ void UnoDialogControl::endExecute() throw(RuntimeException)
}
}
-void UnoDialogControl::addingControl( const Reference< XControl >& _rxControl )
-{
- SolarMutexGuard aSolarGuard;
- UnoControlContainer::addingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- {
- Sequence< ::rtl::OUString > aNames( 4 );
- ::rtl::OUString* pNames = aNames.getArray();
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionX"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionY"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Width"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Height"));
-
- xProps->addPropertiesChangeListener( aNames, this );
- }
- }
-}
-
-void UnoDialogControl::removingControl( const Reference< XControl >& _rxControl )
-{
- SolarMutexGuard aSolarGuard;
- UnoControlContainer::removingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- xProps->removePropertiesChangeListener( this );
- }
-
-}
-
-void SAL_CALL UnoDialogControl::changesOccurred( const ChangesEvent& ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- // a tab controller model may have changed
-
- // #109067# in design mode don't notify the tab controller
- // about tab index changes
- if ( mxTabController.is() && !mbDesignMode )
- mxTabController->activateTabOrder();
-}
-
// XModifyListener
void SAL_CALL UnoDialogControl::modified(
const lang::EventObject& /*rEvent*/ )
@@ -2315,965 +474,30 @@ throw (RuntimeException)
ImplUpdateResourceResolver();
}
-// ----------------------------------------------------
-// Helper Method to convert relative url to physical location
-// ----------------------------------------------------
-
-::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
-{
-
- ::rtl::OUString ret;
-
- ::rtl::OUString baseLocation;
- ::rtl::OUString url;
-
- rbase >>= baseLocation;
- rUrl >>= url;
-
- ::rtl::OUString absoluteURL( url );
- if ( url.getLength() > 0 )
- {
- // Don't adjust GraphicObject url(s)
- if ( url.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) != 0 )
- {
- INetURLObject urlObj(baseLocation);
- urlObj.removeSegment();
- baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
- ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, ret );
- }
- else
- ret = url;
-
- const INetURLObject protocolCheck( url );
- const INetProtocol protocol = protocolCheck.GetProtocol();
- if ( protocol == INET_PROT_NOT_VALID )
- {
- ::rtl::OUString testAbsoluteURL;
- if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
- absoluteURL = testAbsoluteURL;
- }
- }
-
- return absoluteURL;
-}
-
-UnoParentControl::UnoParentControl() :
- mbSizeModified(false),
- mbPosModified(false)
-{
- maComponentInfos.nWidth = 280;
- maComponentInfos.nHeight = 400;
- // #TODO Do we need the ResourceListener foo ?
-}
-
-UnoParentControl::~UnoParentControl()
-{
-}
-
-// XInterface
-Any UnoParentControl::queryAggregation( const Type & rType ) throw(RuntimeException)
-{
- Any aRet( UnoParentControl_IBase::queryInterface( rType ) );
- return (aRet.hasValue() ? aRet : UnoControlContainer::queryAggregation( rType ));
-}
-
-// XTypeProvider
-IMPL_IMPLEMENTATION_ID( UnoParentControl )
-Sequence< Type >
-UnoParentControl::getTypes() throw(RuntimeException)
-{
- return ::comphelper::concatSequences(
- UnoParentControl_IBase::getTypes(),
- UnoControlContainer::getTypes()
- );
-}
-
-void UnoParentControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- UnoControlContainer::createPeer( rxToolkit, rParentPeer );
-}
-
-void UnoParentControl::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName )
-{
- Reference< XPropertySet > xP( rxModel, UNO_QUERY );
-
- ::rtl::OUString aDefCtrl;
- xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY );
-
- DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
- if ( xCtrl.is() )
- {
- xCtrl->setModel( rxModel );
- addControl( rName, xCtrl );
- // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model
- // (which we formerly did herein)
-
- ImplSetPosSize( xCtrl );
- }
-}
-
-void UnoParentControl::ImplRemoveControl( Reference< XControlModel >& rxModel )
-{
- Sequence< Reference< XControl > > aControls = getControls();
- Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
- if ( xCtrl.is() )
- removeControl( xCtrl );
-}
-
-void UnoParentControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
-{
- Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY );
-
- sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
- MapMode aMode( MAP_APPFONT );
- OutputDevice*pOutDev = Application::GetDefaultDevice();
- if ( pOutDev )
- {
- ::Size aTmp( nX, nY );
- aTmp = pOutDev->LogicToPixel( aTmp, aMode );
- nX = aTmp.Width();
- nY = aTmp.Height();
- aTmp = ::Size( nWidth, nHeight );
- aTmp = pOutDev->LogicToPixel( aTmp, aMode );
- nWidth = aTmp.Width();
- nHeight = aTmp.Height();
- }
- else
- {
- Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
- Reference< XDevice > xD( xPeer, UNO_QUERY );
-
- SimpleFontMetric aFM;
- FontDescriptor aFD;
- Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
- aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
- {
- Reference< XFont > xFont = xD->getFont( aFD );
- aFM = xFont->getFontMetric();
- }
- else
- {
- Reference< XGraphics > xG = xD->createGraphics();
- aFM = xG->getFontMetric();
- }
-
- sal_Int16 nH = aFM.Ascent + aFM.Descent;
- sal_Int16 nW = nH/2; // calculate avarage width?!
-
- nX *= nW;
- nX /= 4;
- nWidth *= nW;
- nWidth /= 4;
- nY *= nH;
- nY /= 8;
- nHeight *= nH;
- nHeight /= 8;
- }
- Reference < XWindow > xW( rxCtrl, UNO_QUERY );
- xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
-}
-
-void UnoParentControl::dispose() throw(RuntimeException)
-{
- UnoControlContainer::dispose();
-}
-
-void SAL_CALL UnoParentControl::disposing(
- const EventObject& Source )
-throw(RuntimeException)
-{
- UnoControlContainer::disposing( Source );
-}
-
-sal_Bool UnoParentControl::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- // destroy the old tab controller, if existent
- if ( mxTabController.is() )
- {
- mxTabController->setModel( NULL ); // just to be sure, should not be necessary
- removeTabController( mxTabController );
- ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary
- mxTabController.clear();
- }
-
- if ( getModel().is() )
- {
- Sequence< Reference< XControl > > aControls = getControls();
- const Reference< XControl >* pCtrls = aControls.getConstArray();
- const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
-
- for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
- removeControl( *pCtrls );
- // will implicitly call removingControl, which will remove the PropertyChangeListener
- // (which we formerly did herein)
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->removeContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->removeChangesListener( this );
- }
-
- sal_Bool bRet = UnoControl::setModel( rxModel );
-
- if ( getModel().is() )
- {
- Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
- if ( xNA.is() )
- {
- Sequence< ::rtl::OUString > aNames = xNA->getElementNames();
- const ::rtl::OUString* pNames = aNames.getConstArray();
- sal_uInt32 nCtrls = aNames.getLength();
-
- Reference< XControlModel > xCtrlModel;
- for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames )
- {
- xNA->getByName( *pNames ) >>= xCtrlModel;
- ImplInsertControl( xCtrlModel, *pNames );
- }
- }
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->addContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->addChangesListener( this );
- }
-
- Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY );
- if ( xTabbing.is() )
- {
- mxTabController = new StdTabController;
- mxTabController->setModel( xTabbing );
- addTabController( mxTabController );
- }
-// ImplStartListingForResourceEvents();
-
- return bRet;
-}
-void UnoParentControl::setDesignMode( sal_Bool bOn ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- UnoControl::setDesignMode( bOn );
-
- Sequence< Reference< XControl > > xCtrls = getControls();
- sal_Int32 nControls = xCtrls.getLength();
- Reference< XControl >* pControls = xCtrls.getArray();
- for ( sal_Int32 n = 0; n < nControls; n++ )
- pControls[n]->setDesignMode( bOn );
-
- // #109067# in design mode the tab controller is not notified about
- // tab index changes, therefore the tab order must be activated
- // when switching from design mode to live mode
- if ( mxTabController.is() && !bOn )
- mxTabController->activateTabOrder();
-}
-
-void UnoParentControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- Reference< XControlModel > xModel;
- ::rtl::OUString aName;
-
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
-}
-
-void UnoParentControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xModel;
- Event.Element >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-}
-
-void UnoParentControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- Reference< XControlModel > xModel;
- Event.ReplacedElement >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-
- ::rtl::OUString aName;
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
-}
-
-// XPropertiesChangeListener
-void UnoParentControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
-{
- if( !isDesignMode() && !mbCreatingCompatiblePeer )
- {
- ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) );
- ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) );
- ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
- ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) );
-
- sal_Int32 nLen = rEvents.getLength();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
- Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
- sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
- if ( ( rEvt.PropertyName == s1 ) ||
- ( rEvt.PropertyName == s2 ) ||
- ( rEvt.PropertyName == s3 ) ||
- ( rEvt.PropertyName == s4 ) )
- {
- if ( bOwnModel )
- {
- if ( !mbPosModified && !mbSizeModified )
- {
- // Don't set new pos/size if we get new values from window listener
- Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY );
- ImplSetPosSize( xThis );
- }
- }
- else
- {
- Sequence<Reference<XControl> > aControlSequence(getControls());
- Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) );
- ImplSetPosSize( aControlRef );
- }
- break;
- }
- }
- }
- UnoControlContainer::ImplModelPropertiesChanged( rEvents );
-}
-
-void UnoParentControl::addingControl( const Reference< XControl >& _rxControl )
-{
- SolarMutexGuard aSolarGuard;
- UnoControlContainer::addingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- {
- Sequence< ::rtl::OUString > aNames( 4 );
- ::rtl::OUString* pNames = aNames.getArray();
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionX"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PositionY"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Width"));
- *pNames++ = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Height"));
-
- xProps->addPropertiesChangeListener( aNames, this );
- }
- }
-}
-
-void UnoParentControl::removingControl( const Reference< XControl >& _rxControl )
-{
- SolarMutexGuard aSolarGuard;
- UnoControlContainer::removingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- xProps->removePropertiesChangeListener( this );
- }
-
-}
-
-void SAL_CALL UnoParentControl::changesOccurred( const ChangesEvent& ) throw (RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
- // a tab controller model may have changed
-
- // #109067# in design mode don't notify the tab controller
- // about tab index changes
- if ( mxTabController.is() && !mbDesignMode )
- mxTabController->activateTabOrder();
-}
-
-// ----------------------------------------------------
-// class MultiPageControl
-// ----------------------------------------------------
-UnoMultiPageControl::UnoMultiPageControl() : maTabListeners( *this )
-{
- maComponentInfos.nWidth = 280;
- maComponentInfos.nHeight = 400;
-}
-
-UnoMultiPageControl::~UnoMultiPageControl()
-{
-}
-// XTabListener
-
-void SAL_CALL UnoMultiPageControl::inserted( ::sal_Int32 /*ID*/ ) throw (RuntimeException)
-{
-}
-void SAL_CALL UnoMultiPageControl::removed( ::sal_Int32 /*ID*/ ) throw (RuntimeException)
-{
-}
-void SAL_CALL UnoMultiPageControl::changed( ::sal_Int32 /*ID*/, const Sequence< NamedValue >& /*Properties*/ ) throw (RuntimeException)
-{
-}
-void SAL_CALL UnoMultiPageControl::activated( ::sal_Int32 ID ) throw (RuntimeException)
-{
- ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), sal_False );
-
-}
-void SAL_CALL UnoMultiPageControl::deactivated( ::sal_Int32 /*ID*/ ) throw (RuntimeException)
-{
-}
-void SAL_CALL UnoMultiPageControl::disposing(const EventObject&) throw (RuntimeException)
-{
-}
-
-void SAL_CALL UnoMultiPageControl::dispose() throw (RuntimeException)
-{
- lang::EventObject aEvt;
- aEvt.Source = (::cppu::OWeakObject*)this;
- maTabListeners.disposeAndClear( aEvt );
- UnoParentControl::dispose();
-}
-
-// com::sun::star::awt::XSimpleTabController
-::sal_Int32 SAL_CALL UnoMultiPageControl::insertTab() throw (RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- return xMultiPage->insertTab();
-}
-
-void SAL_CALL UnoMultiPageControl::removeTab( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- xMultiPage->removeTab( ID );
-}
-
-void SAL_CALL UnoMultiPageControl::setTabProps( ::sal_Int32 ID, const Sequence< NamedValue >& Properties ) throw (IndexOutOfBoundsException, RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- xMultiPage->setTabProps( ID, Properties );
-}
-
-Sequence< NamedValue > SAL_CALL UnoMultiPageControl::getTabProps( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- return xMultiPage->getTabProps( ID );
-}
-
-void SAL_CALL UnoMultiPageControl::activateTab( ::sal_Int32 ID ) throw (IndexOutOfBoundsException, RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- xMultiPage->activateTab( ID );
- ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( ID ), sal_True );
-
-}
-
-::sal_Int32 SAL_CALL UnoMultiPageControl::getActiveTabID() throw (RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( !xMultiPage.is() )
- throw RuntimeException();
- return xMultiPage->getActiveTabID();
-}
-
-void SAL_CALL UnoMultiPageControl::addTabListener( const Reference< XTabListener >& Listener ) throw (RuntimeException)
-{
- maTabListeners.addInterface( Listener );
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
- xMultiPage->addTabListener( &maTabListeners );
-}
-
-void SAL_CALL UnoMultiPageControl::removeTabListener( const Reference< XTabListener >& Listener ) throw (RuntimeException)
-{
- Reference< XSimpleTabController > xMultiPage( getPeer(), UNO_QUERY );
- if ( xMultiPage.is() && maTabListeners.getLength() == 1 )
- xMultiPage->removeTabListener( &maTabListeners );
- maTabListeners.removeInterface( Listener );
-}
-
-
-// lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( UnoMultiPageControl )
- getCppuType( ( uno::Reference< awt::XSimpleTabController>* ) NULL ),
- getCppuType( ( uno::Reference< awt::XTabListener>* ) NULL ),
- UnoParentControl::getTypes()
-IMPL_XTYPEPROVIDER_END
-
-// uno::XInterface
-uno::Any UnoMultiPageControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
-{
- uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( awt::XTabListener*, this ), SAL_STATIC_CAST( awt::XSimpleTabController*, this ) );
- return (aRet.hasValue() ? aRet : UnoParentControl::queryAggregation( rType ));
-}
-
-::rtl::OUString UnoMultiPageControl::GetComponentServiceName()
-{
- sal_Bool bDecoration( sal_True );
- ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration;
- if ( bDecoration )
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabcontrol"));
- // Hopefully we can tweak the tabcontrol to display without tabs
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabcontrolnotabs"));
-}
-
-void UnoMultiPageControl::bindPage( const uno::Reference< awt::XControl >& _rxControl )
-{
- uno::Reference< awt::XWindowPeer > xPage( _rxControl->getPeer() );
- uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xProps( _rxControl->getModel(), uno::UNO_QUERY );
-
- VCLXTabPage* pXPage = dynamic_cast< VCLXTabPage* >( xPage.get() );
- TabPage* pPage = pXPage ? pXPage->getTabPage() : NULL;
- if ( xTabCntrl.is() && pPage )
- {
- VCLXMultiPage* pXTab = dynamic_cast< VCLXMultiPage* >( xTabCntrl.get() );
- if ( pXTab )
- {
- rtl::OUString sTitle;
- xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
- pXTab->insertTab( pPage, sTitle);
- }
- }
-
-}
-
-void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
-{
- SolarMutexGuard aSolarGuard;
-
- UnoControlContainer::createPeer( rxToolkit, rParentPeer );
-
- uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
- sal_uInt32 nCtrls = aCtrls.getLength();
- for( sal_uInt32 n = 0; n < nCtrls; n++ )
- bindPage( aCtrls[ n ] );
- sal_Int32 nActiveTab(0);
- Reference< XPropertySet > xMultiProps( getModel(), UNO_QUERY );
- xMultiProps->getPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ) ) >>= nActiveTab;
-
- uno::Reference< awt::XSimpleTabController > xTabCntrl( getPeer(), uno::UNO_QUERY );
- if ( xTabCntrl.is() )
- {
- xTabCntrl->addTabListener( this );
- if ( nActiveTab && nCtrls ) // Ensure peer is initialise with correct activated tab
- {
- xTabCntrl->activateTab( nActiveTab );
- ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_MULTIPAGEVALUE ), uno::makeAny( nActiveTab ), sal_True );
- }
- }
-}
-
-void UnoMultiPageControl::impl_createControlPeerIfNecessary( const uno::Reference< awt::XControl >& _rxControl)
-{
- OSL_PRECOND( _rxControl.is(), "UnoMultiPageControl::impl_createControlPeerIfNecessary: invalid control, this will crash!" );
-
- // if the container already has a peer, then also create a peer for the control
- uno::Reference< awt::XWindowPeer > xMyPeer( getPeer() );
-
- if( xMyPeer.is() )
- {
- _rxControl->createPeer( NULL, xMyPeer );
- bindPage( _rxControl );
- ImplActivateTabControllers();
- }
-
-}
-
-// ------------- UnoMultiPageModel -----------------
-
-UnoMultiPageModel::UnoMultiPageModel() : UnoControlDialogModel( false )
-{
- ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
- ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
- ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
- ImplRegisterProperty( BASEPROPERTY_ENABLED );
-
- ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
- ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
- ImplRegisterProperty( BASEPROPERTY_HELPURL );
- ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
- //ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
- ImplRegisterProperty( BASEPROPERTY_MULTIPAGEVALUE );
- ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
- ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
-
- Any aBool;
- aBool <<= (sal_Bool) sal_True;
- ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
- ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
- ImplRegisterProperty( BASEPROPERTY_DECORATION, aBool );
- // MultiPage Control has the tab stop property. And the default value is True.
- ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
-}
-
-UnoMultiPageModel::UnoMultiPageModel( const UnoMultiPageModel& rModel )
- : UnoControlDialogModel( rModel )
-{
-}
-
-UnoMultiPageModel::~UnoMultiPageModel()
-{
-}
-
-UnoControlModel*
-UnoMultiPageModel::Clone() const
-{
- // clone the container itself
- UnoMultiPageModel* pClone = new UnoMultiPageModel( *this );
-
- // clone all children
- ::std::for_each(
- maModels.begin(), maModels.end(),
- CloneControlModel( pClone->maModels )
- );
-
- return pClone;
-}
-
-::rtl::OUString UnoMultiPageModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageModel );
-}
-
-uno::Any UnoMultiPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
-{
- if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
- {
- uno::Any aAny;
- aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoMultiPageControl );
- return aAny;
- }
- return UnoControlDialogModel::ImplGetDefaultValue( nPropId );
-}
-
-::cppu::IPropertyArrayHelper& UnoMultiPageModel::getInfoHelper()
-{
- static UnoPropertyArrayHelper* pHelper = NULL;
- if ( !pHelper )
- {
- uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
- pHelper = new UnoPropertyArrayHelper( aIDs );
- }
- return *pHelper;
-}
-
-// beans::XMultiPropertySet
-uno::Reference< beans::XPropertySetInfo > UnoMultiPageModel::getPropertySetInfo( ) throw(uno::RuntimeException)
-{
- static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
- return xInfo;
-}
-
-void UnoMultiPageModel::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
-{
- Reference< XServiceInfo > xInfo;
- aElement >>= xInfo;
-
- if ( !xInfo.is() )
- throw IllegalArgumentException();
-
- // Only a Page model can be inserted into the multipage
- if ( !xInfo->supportsService( rtl::OUString::createFromAscii( szServiceName_UnoPageModel ) ) )
- throw IllegalArgumentException();
-
- return UnoControlDialogModel::insertByName( aName, aElement );
-}
-
-// ----------------------------------------------------------------------------
-sal_Bool SAL_CALL UnoMultiPageModel::getGroupControl( ) throw (RuntimeException)
-{
- return sal_True;
-}
-
-// ----------------------------------------------------
-// class UnoPageControl
-// ----------------------------------------------------
-UnoPageControl::UnoPageControl()
-{
- maComponentInfos.nWidth = 280;
- maComponentInfos.nHeight = 400;
-}
-
-UnoPageControl::~UnoPageControl()
-{
-}
-
-::rtl::OUString UnoPageControl::GetComponentServiceName()
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tabpage"));
-}
-
-
-// ------------- UnoPageModel -----------------
-
-UnoPageModel::UnoPageModel() : UnoControlDialogModel( false )
-{
- ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
- ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
- ImplRegisterProperty( BASEPROPERTY_ENABLED );
- ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
-
- ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
- ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
- ImplRegisterProperty( BASEPROPERTY_HELPURL );
- ImplRegisterProperty( BASEPROPERTY_TITLE );
- ImplRegisterProperty( BASEPROPERTY_SIZEABLE );
- ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
- ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
-// ImplRegisterProperty( BASEPROPERTY_DIALOGSOURCEURL );
-
- Any aBool;
- aBool <<= (sal_Bool) sal_True;
- ImplRegisterProperty( BASEPROPERTY_MOVEABLE, aBool );
- ImplRegisterProperty( BASEPROPERTY_CLOSEABLE, aBool );
- //ImplRegisterProperty( BASEPROPERTY_TABSTOP, aBool );
-}
-
-UnoPageModel::UnoPageModel( const UnoPageModel& rModel )
- : UnoControlDialogModel( rModel )
-{
-}
-
-UnoPageModel::~UnoPageModel()
-{
-}
-
-UnoControlModel*
-UnoPageModel::Clone() const
-{
- // clone the container itself
- UnoPageModel* pClone = new UnoPageModel( *this );
-
- // clone all children
- ::std::for_each(
- maModels.begin(), maModels.end(),
- CloneControlModel( pClone->maModels )
- );
-
- return pClone;
-}
-
-::rtl::OUString UnoPageModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString::createFromAscii( szServiceName_UnoPageModel );
-}
-
-uno::Any UnoPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
-{
- if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
- {
- uno::Any aAny;
- aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoPageControl );
- return aAny;
- }
- return UnoControlDialogModel::ImplGetDefaultValue( nPropId );
-}
-
-::cppu::IPropertyArrayHelper& UnoPageModel::getInfoHelper()
-{
- static UnoPropertyArrayHelper* pHelper = NULL;
- if ( !pHelper )
- {
- uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
- pHelper = new UnoPropertyArrayHelper( aIDs );
- }
- return *pHelper;
-}
-
-// beans::XMultiPropertySet
-uno::Reference< beans::XPropertySetInfo > UnoPageModel::getPropertySetInfo( ) throw(uno::RuntimeException)
-{
- static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
- return xInfo;
-}
-
-// ----------------------------------------------------------------------------
-sal_Bool SAL_CALL UnoPageModel::getGroupControl( ) throw (RuntimeException)
-{
- return sal_False;
-}
-
-// Frame control
-
-// ----------------------------------------------------
-// class UnoFrameControl
-// ----------------------------------------------------
-UnoFrameControl::UnoFrameControl()
-{
- maComponentInfos.nWidth = 280;
- maComponentInfos.nHeight = 400;
-}
-
-UnoFrameControl::~UnoFrameControl()
-{
-}
-
-::rtl::OUString UnoFrameControl::GetComponentServiceName()
-{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("frame"));
-}
-
-void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
+void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
{
- bool bOwnCtrl = false;
- rtl::OUString sTitle;
- if ( rxCtrl.get() == Reference<XControl>( this ).get() )
- bOwnCtrl = true;
- Reference< XPropertySet > xProps( getModel(), UNO_QUERY );
- //xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_TITLE ) ) >>= sTitle;
- xProps->getPropertyValue( GetPropertyName( BASEPROPERTY_LABEL ) ) >>= sTitle;
-
- UnoParentControl::ImplSetPosSize( rxCtrl );
- Reference < XWindow > xW( rxCtrl, UNO_QUERY );
- if ( !bOwnCtrl && xW.is() && sTitle.getLength() )
+ sal_Int32 nLen = rEvents.getLength();
+ for( sal_Int32 i = 0; i < nLen; i++ )
{
- awt::Rectangle aSizePos = xW->getPosSize();
-
- sal_Int32 nX = aSizePos.X, nY = aSizePos.Y, nWidth = aSizePos.Width, nHeight = aSizePos.Height;
- // Retrieve the values set by the base class
- OutputDevice*pOutDev = Application::GetDefaultDevice();
- if ( pOutDev )
+ const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
+ Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
+ sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
+ if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 ))
{
- if ( !bOwnCtrl && sTitle.getLength() )
+ ::rtl::OUString aImageURL;
+ Reference< graphic::XGraphic > xGraphic;
+ if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
+ ( aImageURL.getLength() > 0 ))
{
- // Adjust Y based on height of Title
- ::Rectangle aRect = pOutDev->GetTextRect( aRect, sTitle );
- nY = nY + ( aRect.GetHeight() / 2 );
- }
- }
- else
- {
- Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
- Reference< XDevice > xD( xPeer, UNO_QUERY );
+ ::rtl::OUString absoluteUrl =
+ getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
+ uno::makeAny(aImageURL));
- SimpleFontMetric aFM;
- FontDescriptor aFD;
- Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
- aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
- {
- Reference< XFont > xFont = xD->getFont( aFD );
- aFM = xFont->getFontMetric();
+ xGraphic = Impl_getGraphicFromURL_nothrow( absoluteUrl );
}
- else
- {
- Reference< XGraphics > xG = xD->createGraphics();
- aFM = xG->getFontMetric();
- }
-
- sal_Int16 nH = aFM.Ascent + aFM.Descent;
- if ( !bOwnCtrl && sTitle.getLength() )
- // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
- nY = nY + ( nH / 8); // how do I test this
+ ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), sal_True );
+ break;
}
- xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
- }
-}
-
-// ------------- UnoFrameModel -----------------
-
-UnoFrameModel::UnoFrameModel() : UnoControlDialogModel( false )
-{
- ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
- ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
- ImplRegisterProperty( BASEPROPERTY_ENABLED );
- ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
- ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
- ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
- ImplRegisterProperty( BASEPROPERTY_HELPURL );
- ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
- ImplRegisterProperty( BASEPROPERTY_LABEL );
- ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
- ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
- ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES );
-}
-
-UnoFrameModel::UnoFrameModel( const UnoFrameModel& rModel )
- : UnoControlDialogModel( rModel )
-{
-}
-
-UnoFrameModel::~UnoFrameModel()
-{
-}
-
-UnoControlModel*
-UnoFrameModel::Clone() const
-{
- // clone the container itself
- UnoFrameModel* pClone = new UnoFrameModel( *this );
-
- // clone all children
- ::std::for_each(
- maModels.begin(), maModels.end(),
- CloneControlModel( pClone->maModels )
- );
-
- return pClone;
-}
-
-::rtl::OUString UnoFrameModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
-{
- return ::rtl::OUString::createFromAscii( szServiceName_UnoFrameModel );
-}
-
-uno::Any UnoFrameModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
-{
- if ( nPropId == BASEPROPERTY_DEFAULTCONTROL )
- {
- uno::Any aAny;
- aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoFrameControl );
- return aAny;
}
- return UnoControlDialogModel::ImplGetDefaultValue( nPropId );
+ ControlContainerBase::ImplModelPropertiesChanged(rEvents);
}
-
-::cppu::IPropertyArrayHelper& UnoFrameModel::getInfoHelper()
-{
- static UnoPropertyArrayHelper* pHelper = NULL;
- if ( !pHelper )
- {
- uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
- pHelper = new UnoPropertyArrayHelper( aIDs );
- }
- return *pHelper;
-}
-
-// beans::XMultiPropertySet
-uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( ) throw(uno::RuntimeException)
-{
- static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
- return xInfo;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx
index e83749d3a6da..fc8b49ddebe6 100644
--- a/toolkit/source/controls/formattedcontrol.cxx
+++ b/toolkit/source/controls/formattedcontrol.cxx
@@ -126,8 +126,9 @@ namespace toolkit
// = UnoControlFormattedFieldModel
// ===================================================================
// -------------------------------------------------------------------
- UnoControlFormattedFieldModel::UnoControlFormattedFieldModel()
- :m_bRevokedAsClient( false )
+ UnoControlFormattedFieldModel::UnoControlFormattedFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
+ ,m_bRevokedAsClient( false )
,m_bSettingValueAndText( false )
{
ImplRegisterProperty( BASEPROPERTY_ALIGN );
@@ -434,7 +435,8 @@ namespace toolkit
// = UnoFormattedFieldControl
// ===================================================================
// -------------------------------------------------------------------
- UnoFormattedFieldControl::UnoFormattedFieldControl()
+ UnoFormattedFieldControl::UnoFormattedFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
}
@@ -458,7 +460,7 @@ namespace toolkit
aValues[0] = xPeer->getProperty( aNames[0] );
aValues[1] = xPeer->getProperty( aNames[1] );
- ImplSetPropertyValues( aNames, aValues, FALSE );
+ ImplSetPropertyValues( aNames, aValues, sal_False );
if ( GetTextListeners().getLength() )
GetTextListeners().textChanged( e );
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 4a644484b599..56eddb34fce4 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -28,175 +28,367 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include "defaultgridcolumnmodel.hxx"
-#include <comphelper/sequence.hxx>
-#include <toolkit/helper/servicenames.hxx>
+#include "gridcolumn.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <rtl/ref.hxx>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::style;
+#include <comphelper/sequence.hxx>
+#include <comphelper/componentguard.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+//......................................................................................................................
namespace toolkit
+//......................................................................................................................
{
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::container::XContainerListener;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::lang::IndexOutOfBoundsException;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= DefaultGridColumnModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::DefaultGridColumnModel( const Reference< XMultiServiceFactory >& i_factory )
+ :DefaultGridColumnModel_Base( m_aMutex )
+ ,m_aContext( i_factory )
+ ,m_aContainerListeners( m_aMutex )
+ ,m_aColumns()
+ {
+ }
-///////////////////////////////////////////////////////////////////////
-// class DefaultGridColumnModel
-///////////////////////////////////////////////////////////////////////
-
-DefaultGridColumnModel::DefaultGridColumnModel(const Reference< XMultiServiceFactory >& xFactory)
-: columns(std::vector< Reference< XGridColumn > >())
- ,m_nColumnHeaderHeight(0)
- ,m_xFactory(xFactory)
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,DefaultGridColumnModel_Base( m_aMutex )
+ ,m_aContext( i_copySource.m_aContext )
+ ,m_aContainerListeners( m_aMutex )
+ ,m_aColumns()
+ {
+ Columns aColumns;
+ aColumns.reserve( i_copySource.m_aColumns.size() );
+ try
+ {
+ for ( Columns::const_iterator col = i_copySource.m_aColumns.begin();
+ col != i_copySource.m_aColumns.end();
+ ++col
+ )
+ {
+ Reference< XCloneable > const xCloneable( *col, UNO_QUERY_THROW );
+ Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW );
+
+ GridColumn* const pGridColumn = GridColumn::getImplementation( xClone );
+ if ( pGridColumn == NULL )
+ throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid clone source implementation" ) ), *this );
+ // that's indeed a RuntimeException, not an IllegalArgumentException or some such:
+ // a DefaultGridColumnModel implementation whose columns are not GridColumn implementations
+ // is borked.
+ pGridColumn->setIndex( col - i_copySource.m_aColumns.begin() );
+
+ aColumns.push_back( xClone );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( aColumns.size() == i_copySource.m_aColumns.size() )
+ m_aColumns.swap( aColumns );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::~DefaultGridColumnModel()
+ {
+ }
-DefaultGridColumnModel::~DefaultGridColumnModel()
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnCount() throw (RuntimeException)
+ {
+ return m_aColumns.size();
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::createColumn( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return new GridColumn();
+ }
-::sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnCount() throw (::com::sun::star::uno::RuntimeException)
-{
- return columns.size();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn( const Reference< XGridColumn > & i_column ) throw (RuntimeException, IllegalArgumentException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ GridColumn* const pGridColumn = GridColumn::getImplementation( i_column );
+ if ( pGridColumn == NULL )
+ throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid column implementation" ) ), *this, 1 );
-::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- Reference<XGridColumn> xColumn(column);
- columns.push_back(xColumn);
- sal_Int32 index = columns.size() - 1;
- xColumn->setIndex(index);
- return index;
-}
+ m_aColumns.push_back( i_column );
+ sal_Int32 index = m_aColumns.size() - 1;
+ pGridColumn->setIndex( index );
-//---------------------------------------------------------------------
+ // fire insertion notifications
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= index;
+ aEvent.Element <<= i_column;
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (::com::sun::star::uno::RuntimeException)
-{
- return comphelper::containerToSequence(columns);
-}
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
-//---------------------------------------------------------------------
+ return index;
+ }
-::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if ( index >=0 && index < ((sal_Int32)columns.size()))
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::removeColumn( ::sal_Int32 i_columnIndex ) throw (RuntimeException, IndexOutOfBoundsException)
{
- return columns[index];
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ if ( ( i_columnIndex < 0 ) || ( size_t( i_columnIndex ) >= m_aColumns.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ Columns::iterator const pos = m_aColumns.begin() + i_columnIndex;
+ Reference< XGridColumn > const xColumn( *pos );
+ m_aColumns.erase( pos );
+
+ // update indexes of all subsequent columns
+ sal_Int32 columnIndex( i_columnIndex );
+ for ( Columns::iterator updatePos = m_aColumns.begin() + columnIndex;
+ updatePos != m_aColumns.end();
+ ++updatePos, ++columnIndex
+ )
+ {
+ GridColumn* pColumnImpl = GridColumn::getImplementation( *updatePos );
+ ENSURE_OR_CONTINUE( pColumnImpl, "DefaultGridColumnModel::removeColumn: invalid column implementation!" );
+ pColumnImpl->setIndex( columnIndex );
+ }
+
+ // fire removal notifications
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= i_columnIndex;
+ aEvent.Element <<= xColumn;
+
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
+
+ // dispose the removed column
+ try
+ {
+ Reference< XComponent > const xColComp( xColumn, UNO_QUERY_THROW );
+ xColComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- else
- return Reference< XGridColumn >();
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridColumnModel::setColumnHeaderHeight(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
-{
- m_nColumnHeaderHeight = _value;
-}
-//---------------------------------------------------------------------
-sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnHeaderHeight() throw (::com::sun::star::uno::RuntimeException)
-{
- return m_nColumnHeaderHeight;
-}
-
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridColumnModel::setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- for(sal_Int32 i=0;i<rowElements;i++)
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Reference< XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (RuntimeException)
{
- Reference<XGridColumn> xColumn( m_xFactory->createInstance ( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.grid.GridColumn")) ), UNO_QUERY );
- columns.push_back(xColumn);
- xColumn->setIndex(i);
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return ::comphelper::containerToSequence( m_aColumns );
}
-}
-::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL DefaultGridColumnModel::copyColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference<XGridColumn> xColumn( m_xFactory->createInstance ( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.grid.GridColumn")) ), UNO_QUERY );
- xColumn->setColumnWidth(column->getColumnWidth());
- xColumn->setPreferredWidth(column->getPreferredWidth());
- xColumn->setMaxWidth(column->getMaxWidth());
- xColumn->setMinWidth(column->getMinWidth());
- xColumn->setPreferredWidth(column->getPreferredWidth());
- xColumn->setResizeable(column->getResizeable());
- xColumn->setTitle(column->getTitle());
- xColumn->setHorizontalAlign(column->getHorizontalAlign());
- return xColumn;
-}
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
-
-void SAL_CALL DefaultGridColumnModel::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
-
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ if ( index >=0 && index < ((sal_Int32)m_aColumns.size()))
+ return m_aColumns[index];
-void SAL_CALL DefaultGridColumnModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ throw IndexOutOfBoundsException();
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::setDefaultColumns(sal_Int32 rowElements) throw (RuntimeException)
+ {
+ ::std::vector< ContainerEvent > aRemovedColumns;
+ ::std::vector< ContainerEvent > aInsertedColumns;
+
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ // remove existing columns
+ while ( !m_aColumns.empty() )
+ {
+ const size_t lastColIndex = m_aColumns.size() - 1;
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= sal_Int32( lastColIndex );
+ aEvent.Element <<= m_aColumns[ lastColIndex ];
+ aRemovedColumns.push_back( aEvent );
+
+ m_aColumns.erase( m_aColumns.begin() + lastColIndex );
+ }
+
+ // add new columns
+ for ( sal_Int32 i=0; i<rowElements; ++i )
+ {
+ ::rtl::Reference< GridColumn > const pGridColumn = new GridColumn();
+ Reference< XGridColumn > const xColumn( pGridColumn.get() );
+ ::rtl::OUStringBuffer colTitle;
+ colTitle.appendAscii( "Column " );
+ colTitle.append( i + 1 );
+ pGridColumn->setTitle( colTitle.makeStringAndClear() );
+ pGridColumn->setColumnWidth( 80 /* APPFONT */ );
+ pGridColumn->setFlexibility( 1 );
+ pGridColumn->setResizeable( sal_True );
+ pGridColumn->setDataColumnIndex( i );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= i;
+ aEvent.Element <<= xColumn;
+ aInsertedColumns.push_back( aEvent );
+
+ m_aColumns.push_back( xColumn );
+ pGridColumn->setIndex( i );
+ }
+ }
+
+ // fire removal notifications
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aRemovedColumns.begin();
+ event != aRemovedColumns.end();
+ ++event
+ )
+ {
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, *event );
+ }
+
+ // fire insertion notifications
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aInsertedColumns.begin();
+ event != aInsertedColumns.end();
+ ++event
+ )
+ {
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, *event );
+ }
+
+ // dispose removed columns
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aRemovedColumns.begin();
+ event != aRemovedColumns.end();
+ ++event
+ )
+ {
+ try
+ {
+ const Reference< XComponent > xColComp( event->Element, UNO_QUERY_THROW );
+ xColComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
-void SAL_CALL DefaultGridColumnModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultGridColumnModel::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.DefaultGridColumnModel" ) );
+ }
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
-::rtl::OUString SAL_CALL DefaultGridColumnModel::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridColumnModel" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
+ const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::addContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ if ( i_listener.is() )
+ m_aContainerListeners.addInterface( i_listener );
+ }
-sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_DefaultGridColumnModel );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::removeContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ if ( i_listener.is() )
+ m_aContainerListeners.removeInterface( i_listener );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::disposing()
+ {
+ DefaultGridColumnModel_Base::disposing();
+
+ EventObject aEvent( *this );
+ m_aContainerListeners.disposeAndClear( aEvent );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // remove, dispose and clear columns
+ while ( !m_aColumns.empty() )
+ {
+ try
+ {
+ const Reference< XComponent > xColComponent( m_aColumns[ 0 ], UNO_QUERY_THROW );
+ xColComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ m_aColumns.erase( m_aColumns.begin() );
+ }
+
+ Columns aEmpty;
+ m_aColumns.swap( aEmpty );
+ }
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL DefaultGridColumnModel::createClone( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return new DefaultGridColumnModel( *this );
+ }
-}
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
-Reference< XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const Reference< XMultiServiceFactory >& _rFactory)
+//----------------------------------------------------------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rFactory)
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridColumnModel( _rFactory ) );
+ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridColumnModel( _rFactory ) );
}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
index 7f01b625e62c..1cdc1ab30c0d 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
@@ -26,75 +26,73 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <rtl/ref.hxx>
-#include <vector>
-#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/util/Color.hpp>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <vector>
+
+namespace comphelper
+{
+ class ComponentGuard;
+}
namespace toolkit
{
//enum broadcast_type { column_added, column_removed, column_changed};
-class DefaultGridColumnModel : public ::cppu::WeakImplHelper2< XGridColumnModel, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::awt::grid::XGridColumnModel
+ , ::com::sun::star::lang::XServiceInfo
+ > DefaultGridColumnModel_Base;
+
+class DefaultGridColumnModel :public ::cppu::BaseMutex
+ ,public DefaultGridColumnModel_Base
{
public:
- DefaultGridColumnModel(const Reference< XMultiServiceFactory >& xFactory);
+ DefaultGridColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource );
virtual ~DefaultGridColumnModel();
// XGridColumnModel
-
- //virtual ::sal_Bool SAL_CALL getColumnSelectionAllowed() throw (::com::sun::star::uno::RuntimeException);
- //virtual void SAL_CALL setColumnSelectionAllowed(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL createColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);
+ virtual void SAL_CALL removeColumn( ::sal_Int32 i_columnIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL getColumns() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- //virtual void SAL_CALL addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
- //virtual void SAL_CALL removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL setColumnHeaderHeight( sal_Int32 _value) throw (com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnHeaderHeight() throw (com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL copyColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
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( ) throw (::com::sun::star::uno::RuntimeException);
-private:
- /*void broadcast( broadcast_type eType, const GridColumnEvent& aEvent );
- void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue, sal_Int32 index,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
- void broadcast_add( sal_Int32 index,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
- void broadcast_remove( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );*/
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+private:
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > Columns;
- std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > columns;
- sal_Bool selectionAllowed;
- sal_Int32 m_nColumnHeaderHeight;
- Reference< XMultiServiceFactory > m_xFactory;
+ ::comphelper::ComponentContext m_aContext;
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ Columns m_aColumns;
};
}
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index 1a4e9b36ab45..aae6d61a4692 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -28,318 +28,411 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include "defaultgriddatamodel.hxx"
-#include <comphelper/sequence.hxx>
+
+#include <comphelper/stlunosequence.hxx>
+#include <comphelper/componentguard.hxx>
#include <toolkit/helper/servicenames.hxx>
+#include <tools/diagnose_ex.h>
#include <rtl/ref.hxx>
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-
-#define ROWHEIGHT ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ))
-#define ROWHEADERS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" ))
-#define CELLUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellUpdated" ))
-#define ROWUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" ))
-#define ROWHEADERWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" ))
+#include <algorithm>
+//......................................................................................................................
namespace toolkit
+//......................................................................................................................
{
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::util::XCloneable;
+ /** === end UNO using === **/
+
+ using ::comphelper::stl_begin;
+ using ::comphelper::stl_end;
+
+ //==================================================================================================================
+ //= DefaultGridDataModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel()
+ :DefaultGridDataModel_Base( m_aMutex )
+ ,m_aRowHeaders()
+ ,m_nColumnCount(0)
+ {
+ }
-///////////////////////////////////////////////////////////////////////
-// class DefaultGridDataModel
-///////////////////////////////////////////////////////////////////////
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel( DefaultGridDataModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,DefaultGridDataModel_Base( m_aMutex )
+ ,m_aData( i_copySource.m_aData )
+ ,m_aRowHeaders( i_copySource.m_aRowHeaders )
+ ,m_nColumnCount( i_copySource.m_nColumnCount )
+ {
+ }
-DefaultGridDataModel::DefaultGridDataModel()
-: rowHeight(0),
- rowHeaders(std::vector< ::rtl::OUString >()),
- m_nRowHeaderWidth(10)
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::~DefaultGridDataModel()
+ {
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast( GridDataEvent const & i_event,
+ void ( SAL_CALL XGridDataListener::*i_listenerMethod )( GridDataEvent const & ), ::comphelper::ComponentGuard & i_instanceLock )
+ {
+ ::cppu::OInterfaceContainerHelper* pListeners = rBHelper.getContainer( XGridDataListener::static_type() );
+ if ( !pListeners )
+ return;
-DefaultGridDataModel::~DefaultGridDataModel()
-{
-}
+ i_instanceLock.clear();
+ pListeners->notifyEach( i_listenerMethod, i_event );
+ }
-void DefaultGridDataModel::broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridDataListener::static_type() );
- if( pIter )
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
{
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while(aListIter.hasMoreElements())
- {
- XGridDataListener* pListener = static_cast<XGridDataListener*>(aListIter.next());
- switch( eType )
- {
- case row_added: pListener->rowAdded(aEvent); break;
- case row_removed: pListener->rowRemoved(aEvent); break;
- case data_changed: pListener->dataChanged(aEvent); break;
- }
- }
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_aData.size();
}
-}
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getColumnCount() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nColumnCount;
+ }
-void DefaultGridDataModel::broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, name, oldValue, newValue, index, ::rtl::OUString(), Sequence< Any >());
- broadcast( data_changed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::CellData const & DefaultGridDataModel::impl_getCellData_throw( sal_Int32 const i_column, sal_Int32 const i_row ) const
+ {
+ if ( ( i_row < 0 ) || ( size_t( i_row ) > m_aData.size() )
+ || ( i_column < 0 ) || ( i_column > m_nColumnCount )
+ )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< DefaultGridDataModel* >( this ) );
-//---------------------------------------------------------------------
+ RowData const & rRow( m_aData[ i_row ] );
+ if ( size_t( i_column ) < rRow.size() )
+ return rRow[ i_column ];
-void DefaultGridDataModel::broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, (const ::com::sun::star::uno::Sequence< Any >&)rowData );
- broadcast( row_added, aEvent);
-}
+ static CellData s_aEmpty;
+ return s_aEmpty;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::RowData& DefaultGridDataModel::impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount )
+ {
+ OSL_ENSURE( i_requiredColumnCount <= size_t( m_nColumnCount ), "DefaultGridDataModel::impl_getRowDataAccess_throw: invalid column count!" );
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ RowData& rRowData( m_aData[ i_rowIndex ] );
+ if ( rRowData.size() < i_requiredColumnCount )
+ rRowData.resize( i_requiredColumnCount );
+ return rRowData;
+ }
-void DefaultGridDataModel::broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
- broadcast( row_removed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::CellData& DefaultGridDataModel::impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex )
+ {
+ if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= m_nColumnCount ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-//---------------------------------------------------------------------
+ RowData& rRowData( impl_getRowDataAccess_throw( i_rowIndex, size_t( i_columnIndex + 1 ) ) );
+ return rRowData[ i_columnIndex ];
+ }
-//---------------------------------------------------------------------
-// XDefaultGridDataModel
-//---------------------------------------------------------------------
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeight() throw (::com::sun::star::uno::RuntimeException)
-{
- return rowHeight;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getCellData( ::sal_Int32 i_column, ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return impl_getCellData_throw( i_column, i_row ).first;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getCellToolTip( ::sal_Int32 i_column, ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return impl_getCellData_throw( i_column, i_row ).second;
+ }
-void SAL_CALL DefaultGridDataModel::setRowHeight(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = rowHeight;
- rowHeight = value;
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getRowHeading( ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- broadcast_changed( ROWHEIGHT, 0, Any(oldValue), Any(value));
-}
+ if ( ( i_row < 0 ) || ( size_t( i_row ) >= m_aRowHeaders.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-//---------------------------------------------------------------------
+ return m_aRowHeaders[ i_row ];
+ }
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
-{
- return data.size();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ sal_Int32 const columnCount = i_data.getLength();
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getRowHeaders() throw (::com::sun::star::uno::RuntimeException)
-{
- return comphelper::containerToSequence(rowHeaders);
-}
+ // store header name
+ m_aRowHeaders.push_back( i_heading );
-//---------------------------------------------------------------------
+ // store row m_aData
+ impl_addRow( i_data );
-void SAL_CALL DefaultGridDataModel::setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > oldValue( comphelper::containerToSequence(rowHeaders) );
+ // update column count
+ if ( columnCount > m_nColumnCount )
+ m_nColumnCount = columnCount;
- std::vector< rtl::OUString>::iterator iterator;
- int i = 0;
- int sequenceSize = value.getLength();
+ sal_Int32 const rowIndex = sal_Int32( m_aData.size() - 1 );
+ broadcast(
+ GridDataEvent( *this, -1, -1, rowIndex, rowIndex ),
+ &XGridDataListener::rowsInserted,
+ aGuard
+ );
+ }
- for(iterator = rowHeaders.begin(); iterator != rowHeaders.end(); ++iterator)
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount )
{
- if ( sequenceSize > i )
- *iterator = value[i];
- else
- *iterator = ::rtl::OUString();
- i++;
+ OSL_PRECOND( ( i_assumedColCount <= 0 ) || ( i_assumedColCount >= i_rowData.getLength() ),
+ "DefaultGridDataModel::impl_addRow: invalid column count!" );
+
+ RowData newRow( i_assumedColCount > 0 ? i_assumedColCount : i_rowData.getLength() );
+ RowData::iterator cellData = newRow.begin();
+ for ( const Any* pData = stl_begin( i_rowData ); pData != stl_end( i_rowData ); ++pData, ++cellData )
+ cellData->first = *pData;
+
+ m_aData.push_back( newRow );
}
- broadcast_changed( ROWHEADERS, 0, Any(oldValue), Any(comphelper::containerToSequence(rowHeaders)) );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
+ {
+ if ( i_headings.getLength() != i_data.getLength() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, -1 );
-//---------------------------------------------------------------------
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-void SAL_CALL DefaultGridDataModel::addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & rRowdata) throw (::com::sun::star::uno::RuntimeException)
-{
- // store header name
- rowHeaders.push_back(headername);
+ sal_Int32 const rowCount = i_headings.getLength();
+ if ( rowCount == 0 )
+ return;
- // store row data
- std::vector< Any > newRow;
- for ( int i = 0; i < rRowdata.getLength();i++)
- {
- newRow.push_back(rRowdata[i]);
- }
+ // determine max col count in the new data
+ sal_Int32 maxColCount = 0;
+ for ( sal_Int32 row=0; row<rowCount; ++row )
+ if ( i_data[row].getLength() > maxColCount )
+ maxColCount = i_data[row].getLength();
- data.push_back( newRow );
+ if ( maxColCount < m_nColumnCount )
+ maxColCount = m_nColumnCount;
- broadcast_add( data.size()-1, headername, comphelper::containerToSequence(newRow));
+ for ( sal_Int32 row=0; row<rowCount; ++row )
+ {
+ m_aRowHeaders.push_back( i_headings[row] );
+ impl_addRow( i_data[row], maxColCount );
+ }
-}
+ if ( maxColCount > m_nColumnCount )
+ m_nColumnCount = maxColCount;
-//---------------------------------------------------------------------
+ sal_Int32 const firstRow = sal_Int32( m_aData.size() - rowCount );
+ sal_Int32 const lastRow = sal_Int32( m_aData.size() - 1 );
+ broadcast(
+ GridDataEvent( *this, -1, -1, firstRow, lastRow ),
+ &XGridDataListener::rowsInserted,
+ aGuard
+ );
+ }
-void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if ( index >= 0 && index <= getRowCount()-1)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeRow( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
{
- ::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] );
- rowHeaders.erase(rowHeaders.begin() + index);
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- Sequence< Any >& rowData ( (Sequence< Any >&)data[index] );
- data.erase(data.begin() + index);
- broadcast_remove( index, headerName, rowData);
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ m_aRowHeaders.erase( m_aRowHeaders.begin() + i_rowIndex );
+ m_aData.erase( m_aData.begin() + i_rowIndex );
+
+ broadcast(
+ GridDataEvent( *this, -1, -1, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::rowsRemoved,
+ aGuard
+ );
}
- else
- return;
-}
-//---------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL DefaultGridDataModel::getData() throw (::com::sun::star::uno::RuntimeException)
-{
- std::vector< std::vector< Any > >::iterator iterator;
- std::vector< Sequence< Any > > dummyContainer(0);
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeAllRows( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ m_aRowHeaders.clear();
+ m_aData.clear();
+ broadcast(
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ &XGridDataListener::rowsRemoved,
+ aGuard
+ );
+ }
- for(iterator = data.begin(); iterator != data.end(); ++iterator)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
{
- Sequence< Any > cols(comphelper::containerToSequence(*iterator));
- dummyContainer.push_back( cols );
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ impl_getCellDataAccess_throw( i_columnIndex, i_rowIndex ).first = i_value;
+
+ broadcast(
+ GridDataEvent( *this, i_columnIndex, i_columnIndex, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::dataChanged,
+ aGuard
+ );
}
- Sequence< Sequence< Any > > dataSequence(comphelper::containerToSequence(dummyContainer));
- return dataSequence;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowData( const Sequence< ::sal_Int32 >& i_columnIndexes, ::sal_Int32 i_rowIndex, const Sequence< Any >& i_values ) throw (IndexOutOfBoundsException, IllegalArgumentException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-void SAL_CALL DefaultGridDataModel::addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XGridDataListener::static_type(), xListener );
-}
+ if ( i_columnIndexes.getLength() != i_values.getLength() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
-//---------------------------------------------------------------------
+ sal_Int32 const columnCount = i_columnIndexes.getLength();
+ if ( columnCount == 0 )
+ return;
-void SAL_CALL DefaultGridDataModel::removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XGridDataListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
-{
- rowHeaders.clear();
- data.clear();
- broadcast_remove( -1, ::rtl::OUString(), 0);
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = m_nRowHeaderWidth;
- m_nRowHeaderWidth = _value;
- broadcast_changed( ROWHEADERWIDTH, 0, Any(oldValue), Any(_value) );
-}
-//---------------------------------------------------------------------
-sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return m_nRowHeaderWidth;
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateCell(::sal_Int32 row, ::sal_Int32 column, const Any& value) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
- {
- if(column >= 0 && column < (signed)data[0].size())
+ for ( sal_Int32 col = 0; col < columnCount; ++col )
{
- data[row][column] = value;
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( CELLUPDATED, row, Any(column), value );
+ if ( ( i_columnIndexes[col] < 0 ) || ( i_columnIndexes[col] > m_nColumnCount ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
}
- }
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateRow(::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 > & columns, const ::com::sun::star::uno::Sequence< Any > & values) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
- {
- if(columns.getLength() == values.getLength())
+
+ RowData& rDataRow = m_aData[ i_rowIndex ];
+ for ( sal_Int32 col = 0; col < columnCount; ++col )
{
- for(int i = 0; i < columns.getLength(); i++)
- data[row][i] = values[i];
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( ROWUPDATED, row, Any(columns), Any(values) );
+ sal_Int32 const columnIndex = i_columnIndexes[ col ];
+ if ( size_t( columnIndex ) >= rDataRow.size() )
+ rDataRow.resize( columnIndex + 1 );
+
+ rDataRow[ columnIndex ].first = i_values[ col ];
}
+
+ sal_Int32 const firstAffectedColumn = *::std::min_element( stl_begin( i_columnIndexes ), stl_end( i_columnIndexes ) );
+ sal_Int32 const lastAffectedColumn = *::std::max_element( stl_begin( i_columnIndexes ), stl_end( i_columnIndexes ) );
+ broadcast(
+ GridDataEvent( *this, firstAffectedColumn, lastAffectedColumn, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::dataChanged,
+ aGuard
+ );
}
-}
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowHeading( ::sal_Int32 i_rowIndex, const Any& i_heading ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aRowHeaders.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-}
+ m_aRowHeaders[ i_rowIndex ] = i_heading;
-//---------------------------------------------------------------------
+ broadcast(
+ GridDataEvent( *this, -1, -1, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::rowHeadingChanged,
+ aGuard
+ );
+ }
-void SAL_CALL DefaultGridDataModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ impl_getCellDataAccess_throw( i_columnIndex, i_rowIndex ).second = i_value;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowToolTip( ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-void SAL_CALL DefaultGridDataModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ RowData& rRowData = impl_getRowDataAccess_throw( i_rowIndex, m_nColumnCount );
+ for ( RowData::iterator cell = rRowData.begin(); cell != rRowData.end(); ++cell )
+ cell->second = i_value;
+ }
-::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addGridDataListener( const Reference< grid::XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridDataListener::static_type(), i_listener );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeGridDataListener( const Reference< grid::XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridDataListener::static_type(), i_listener );
+ }
-sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::disposing()
+ {
+ ::com::sun::star::lang::EventObject aEvent;
+ aEvent.Source.set( *this );
+ rBHelper.aLC.disposeAndClear( aEvent );
-//---------------------------------------------------------------------
+ ::osl::MutexGuard aGuard( m_aMutex );
+ GridData aEmptyData;
+ m_aData.swap( aEmptyData );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ ::std::vector< Any > aEmptyRowHeaders;
+ m_aRowHeaders.swap( aEmptyRowHeaders );
-}
+ m_nColumnCount = 0;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
+ {
+ static const ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
+ return aImplName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+ {
+ return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ static const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
+ static const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL DefaultGridDataModel::createClone( ) throw (RuntimeException)
+ {
+ return new DefaultGridDataModel( *this );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
Reference< XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const Reference< XMultiServiceFactory >& )
{
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
index ac6282a0eaef..b7fcf01c4f5b 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
@@ -26,60 +26,68 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
-#include <com/sun/star/awt/grid/XGridDataModel.hpp>
-#include <com/sun/star/awt/grid/GridDataEvent.hpp>
-#include <com/sun/star/awt/grid/XGridDataListener.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/grid/XMutableGridDataModel.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <rtl/ref.hxx>
-#include <vector>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase2.hxx>
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-using ::rtl::OUString;
+#include <vector>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::lang;
+namespace comphelper
+{
+ class ComponentGuard;
+}
+
namespace toolkit
{
enum broadcast_type { row_added, row_removed, data_changed};
-class DefaultGridDataModel : public ::cppu::WeakImplHelper2< XGridDataModel, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper2 < XMutableGridDataModel
+ , XServiceInfo
+ > DefaultGridDataModel_Base;
+
+class DefaultGridDataModel :public ::cppu::BaseMutex
+ ,public DefaultGridDataModel_Base
{
public:
DefaultGridDataModel();
+ DefaultGridDataModel( DefaultGridDataModel const & i_copySource );
virtual ~DefaultGridDataModel();
+ // XMutableGridDataModel
+ virtual void SAL_CALL addRow( const Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowData( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& ColumnIndexes, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowHeading( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Heading ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellToolTip( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowToolTip( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
// XGridDataModel
- virtual ::sal_Int32 SAL_CALL getRowHeight() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRowHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowHeaders() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & data) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeAll() throw (RuntimeException);
- virtual void SAL_CALL setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCell( ::sal_Int32 row, ::sal_Int32 column, const ::com::sun::star::uno::Any& value ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& values ) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
@@ -87,16 +95,25 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
private:
+ typedef ::std::pair< Any, Any > CellData;
+ typedef ::std::vector< CellData > RowData;
+ typedef ::std::vector< RowData > GridData;
+
+ void broadcast(
+ GridDataEvent const & i_event,
+ void ( SAL_CALL ::com::sun::star::awt::grid::XGridDataListener::*i_listenerMethod )( ::com::sun::star::awt::grid::GridDataEvent const & ),
+ ::comphelper::ComponentGuard & i_instanceLock
+ );
+
+ void impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 );
- void broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException);
+ CellData const & impl_getCellData_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ) const;
+ CellData& impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex );
+ RowData& impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount );
- sal_Int32 rowHeight;
- std::vector< std::vector < Any > > data;
- std::vector< ::rtl::OUString > rowHeaders;
- sal_Int32 m_nRowHeaderWidth;
+ GridData m_aData;
+ ::std::vector< ::com::sun::star::uno::Any > m_aRowHeaders;
+ sal_Int32 m_nColumnCount;
};
}
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
index 8c1645e2f6ae..0e7253509e7a 100644
--- a/toolkit/source/controls/grid/gridcolumn.cxx
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -26,282 +26,306 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
#include "gridcolumn.hxx"
+
#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/servicenames.hxx>
-#include <rtl/ref.hxx>
-
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::style;
-
-#define COLWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColWidth" ))
-#define MAXWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MaxWidth" ))
-#define MINWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MinWidth" ))
-#define PREFWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" ))
-#define HALIGN ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HAlign" ))
-#define TITLE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" ))
-#define COLRESIZE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColumnResize" ))
-#define UPDATE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UpdateWidth" ))
namespace toolkit
{
-
-///////////////////////////////////////////////////////////////////////
-// class GridColumn
-///////////////////////////////////////////////////////////////////////
-
-GridColumn::GridColumn()
-: identifier(Any())
-,index(0)
-,columnWidth(4)
-,preferredWidth(0)
-,maxWidth(0)
-,minWidth(0)
-,bResizeable(true)
-,horizontalAlign(HorizontalAlignment(0))
-{
-}
-
-//---------------------------------------------------------------------
-
-GridColumn::~GridColumn()
-{
-}
-
-//---------------------------------------------------------------------
-
-void GridColumn::broadcast( broadcast_column_type eType, const GridColumnEvent& aEvent )
-{
- ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridColumnListener::static_type() );
- if( pIter )
- {
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while(aListIter.hasMoreElements())
- {
- XGridColumnListener* pListener = static_cast<XGridColumnListener*>(aListIter.next());
- switch( eType )
- {
- case column_attribute_changed: pListener->columnChanged(aEvent); break;
- }
- }
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::awt;
+ using namespace ::com::sun::star::awt::grid;
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star::util;
+ using namespace ::com::sun::star::style;
+
+ //==================================================================================================================
+ //= DefaultGridColumnModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::GridColumn()
+ :GridColumn_Base( m_aMutex )
+ ,m_aIdentifier()
+ ,m_nIndex(-1)
+ ,m_nDataColumnIndex(-1)
+ ,m_nColumnWidth(4)
+ ,m_nMaxWidth(0)
+ ,m_nMinWidth(0)
+ ,m_nFlexibility(1)
+ ,m_bResizeable(true)
+ ,m_eHorizontalAlign( HorizontalAlignment_LEFT )
+ {
}
-}
-
-//---------------------------------------------------------------------
-
-void GridColumn::broadcast_changed(::rtl::OUString name, Any oldValue, Any newValue)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridColumnEvent aEvent( xSource, name, oldValue, newValue, index);
- broadcast( column_attribute_changed, aEvent);
-}
-
-void SAL_CALL GridColumn::updateColumn(const ::rtl::OUString& name, sal_Int32 width) throw (::com::sun::star::uno::RuntimeException)
-{
- if(PREFWIDTH == name)
- preferredWidth = width;
- else if (COLWIDTH == name)
- columnWidth = width;
-}
-//---------------------------------------------------------------------
-// XGridColumn
-//---------------------------------------------------------------------
-
-::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
-{
- return identifier;
-}
-//---------------------------------------------------------------------
-
-void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
-{
- value >>= identifier;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::GridColumn( GridColumn const & i_copySource )
+ :cppu::BaseMutex()
+ ,GridColumn_Base( m_aMutex )
+ ,m_aIdentifier( i_copySource.m_aIdentifier )
+ ,m_nIndex( -1 )
+ ,m_nDataColumnIndex( i_copySource.m_nDataColumnIndex )
+ ,m_nColumnWidth( i_copySource.m_nColumnWidth )
+ ,m_nMaxWidth( i_copySource.m_nMaxWidth )
+ ,m_nMinWidth( i_copySource.m_nMinWidth )
+ ,m_nFlexibility( i_copySource.m_nFlexibility )
+ ,m_bResizeable( i_copySource.m_bResizeable )
+ ,m_sTitle( i_copySource.m_sTitle )
+ ,m_sHelpText( i_copySource.m_sHelpText )
+ ,m_eHorizontalAlign( i_copySource.m_eHorizontalAlign )
+ {
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::~GridColumn()
+ {
+ }
-::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- broadcast_changed(UPDATE, Any(columnWidth), Any());
- return columnWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void GridColumn::broadcast_changed( sal_Char const * const i_asciiAttributeName, Any i_oldValue, Any i_newValue,
+ ::comphelper::ComponentGuard& i_Guard )
+ {
+ Reference< XInterface > const xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridColumnEvent const aEvent(
+ xSource, ::rtl::OUString::createFromAscii( i_asciiAttributeName ),
+ i_oldValue, i_newValue, m_nIndex
+ );
-//--------------------------------------------------------------------
+ ::cppu::OInterfaceContainerHelper* pIter = rBHelper.getContainer( XGridColumnListener::static_type() );
-void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- columnWidth = value;
- broadcast_changed(COLWIDTH, Any(columnWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ i_Guard.clear();
+ if( pIter )
+ pIter->notifyEach( &XGridColumnListener::columnChanged, aEvent );
+ }
-::sal_Int32 SAL_CALL GridColumn::getPreferredWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- broadcast_changed(UPDATE, Any(preferredWidth), Any());
- return preferredWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_aIdentifier;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ m_aIdentifier = value;
+ }
-void SAL_CALL GridColumn::setPreferredWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- preferredWidth = value;
- broadcast_changed(PREFWIDTH, Any(preferredWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nColumnWidth;
+ }
-::sal_Int32 SAL_CALL GridColumn::getMaxWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return maxWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nColumnWidth, value, "ColumnWidth" );
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getMaxWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nMaxWidth;
+ }
-void SAL_CALL GridColumn::setMaxWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- maxWidth = value;
- broadcast_changed(MAXWIDTH, Any(maxWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setMaxWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nMaxWidth, value, "MaxWidth" );
+ }
-::sal_Int32 SAL_CALL GridColumn::getMinWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return minWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getMinWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nMinWidth;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setMinWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nMinWidth, value, "MinWidth" );
+ }
-void SAL_CALL GridColumn::setMinWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- minWidth = value;
- broadcast_changed(MINWIDTH, Any(minWidth),Any(value));
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_sTitle;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_sTitle, value, "Title" );
+ }
-::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
-{
- return title;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getHelpText() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_sHelpText;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setHelpText( const ::rtl::OUString & value ) throw (RuntimeException)
+ {
+ impl_set( m_sHelpText, value, "HelpText" );
+ }
-void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
-{
- title = value;
- broadcast_changed(TITLE, Any(title),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL GridColumn::getResizeable() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_bResizeable;
+ }
-sal_Bool SAL_CALL GridColumn::getResizeable() throw (::com::sun::star::uno::RuntimeException)
-{
- return bResizeable;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setResizeable(sal_Bool value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_bResizeable, value, "Resizeable" );
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getFlexibility() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nFlexibility;
+ }
-void SAL_CALL GridColumn::setResizeable(sal_Bool value) throw (::com::sun::star::uno::RuntimeException)
-{
- bResizeable = value;
- broadcast_changed(COLRESIZE, Any(bResizeable),Any(value));
-}
-//---------------------------------------------------------------------
-HorizontalAlignment SAL_CALL GridColumn::getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException)
-{
- return horizontalAlign;
-}
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setFlexibility( ::sal_Int32 i_value ) throw (IllegalArgumentException, RuntimeException)
+ {
+ if ( i_value < 0 )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+ impl_set( m_nFlexibility, i_value, "Flexibility" );
+ }
-void SAL_CALL GridColumn::setHorizontalAlign(HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException)
-{
- horizontalAlign = align;
- broadcast_changed(HALIGN, Any(horizontalAlign),Any(align));
-}
-//---------------------------------------------------------------------
-void SAL_CALL GridColumn::addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XGridColumnListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ HorizontalAlignment SAL_CALL GridColumn::getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_eHorizontalAlign;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setHorizontalAlign(HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_eHorizontalAlign, align, "HorizontalAlign" );
+ }
-void SAL_CALL GridColumn::removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XGridColumnListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::addGridColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridColumnListener::static_type(), xListener );
+ }
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::removeGridColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridColumnListener::static_type(), xListener );
+ }
-void SAL_CALL GridColumn::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::disposing()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_aIdentifier.clear();
+ m_sTitle = m_sHelpText = ::rtl::OUString();
+ }
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getIndex() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nIndex;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void GridColumn::setIndex( sal_Int32 const i_index )
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ m_nIndex = i_index;
+ }
-void SAL_CALL GridColumn::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getDataColumnIndex() throw(RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nDataColumnIndex;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(RuntimeException)
+ {
+ impl_set( m_nDataColumnIndex, i_dataColumnIndex, "DataColumnIndex" );
+ }
-void SAL_CALL GridColumn::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
-void SAL_CALL GridColumn::setIndex(sal_Int32 _nIndex) throw (::com::sun::star::uno::RuntimeException)
-{
- index = _nIndex;
-}
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.GridColumn" ) );
+ }
-::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.GridColumn" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_GridColumn ) );
+ const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
-sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_GridColumn );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL GridColumn::createClone( ) throw (RuntimeException)
+ {
+ return new GridColumn( *this );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int64 SAL_CALL GridColumn::getSomething( const Sequence< sal_Int8 >& i_identifier ) throw(RuntimeException)
+ {
+ if ( ( i_identifier.getLength() == 16 ) && ( i_identifier == getUnoTunnelId() ) )
+ return ::sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
+ return 0;
+ }
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< sal_Int8 > GridColumn::getUnoTunnelId() throw()
+ {
+ static ::cppu::OImplementationId const aId;
+ return aId.getImplementationId();
+ }
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn* GridColumn::getImplementation( const Reference< XInterface >& i_component )
+ {
+ Reference< XUnoTunnel > const xTunnel( i_component, UNO_QUERY );
+ if ( xTunnel.is() )
+ return reinterpret_cast< GridColumn* >( ::sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( getUnoTunnelId() ) ) );
+ return NULL;
+ }
}
-Reference< XInterface > SAL_CALL GridColumn_CreateInstance( const Reference< XMultiServiceFactory >& )
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::GridColumn );
+ return *( new ::toolkit::GridColumn );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx
index 4d582201d128..87fe85afce94 100644
--- a/toolkit/source/controls/grid/gridcolumn.hxx
+++ b/toolkit/source/controls/grid/gridcolumn.hxx
@@ -26,83 +26,111 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
+
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
-#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <comphelper/componentguard.hxx>
#include <rtl/ref.hxx>
-#include <vector>
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-#include <com/sun/star/style/HorizontalAlignment.hpp>
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
+#include <vector>
namespace toolkit
{
-enum broadcast_column_type { column_attribute_changed};
-class GridColumn : public ::cppu::WeakImplHelper2< XGridColumn, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::awt::grid::XGridColumn
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel
+ > GridColumn_Base;
+class GridColumn :public ::cppu::BaseMutex
+ ,public GridColumn_Base
{
public:
GridColumn();
+ GridColumn( GridColumn const & i_copySource );
virtual ~GridColumn();
- // XGridColumn
+ // ::com::sun::star::awt::grid::XGridColumn
virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getColumnWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setColumnWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getPreferredWidth() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPreferredWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMaxWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMaxWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMinWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMinWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getResizeable() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setResizeable(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFlexibility() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFlexibility( ::sal_Int32 _flexibility ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpText(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDataColumnIndex() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::style::HorizontalAlignment SAL_CALL getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setHorizontalAlign(::com::sun::star::style::HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateColumn( const ::rtl::OUString& name, ::sal_Int32 width ) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+ virtual void SAL_CALL addGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable (base of XGridColumn)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ 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( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel and friends
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& i_identifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelId() throw();
+ static GridColumn* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_component );
+
+ // attribute access
+ void setIndex( sal_Int32 const i_index );
- virtual void SAL_CALL setIndex(sal_Int32 _nIndex)throw (::com::sun::star::uno::RuntimeException);
private:
- void broadcast( broadcast_column_type eType, const GridColumnEvent& aEvent );
- void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue);
-
- Any identifier;
- sal_Int32 index;
- sal_Int32 columnWidth;
- sal_Int32 preferredWidth;
- sal_Int32 maxWidth;
- sal_Int32 minWidth;
- sal_Bool bResizeable;
- ::rtl::OUString title;
- ::com::sun::star::style::HorizontalAlignment horizontalAlign;
+ void broadcast_changed(
+ sal_Char const * const i_asciiAttributeName,
+ ::com::sun::star::uno::Any i_oldValue,
+ ::com::sun::star::uno::Any i_newValue,
+ ::comphelper::ComponentGuard& i_Guard
+ );
+
+ template< class TYPE >
+ void impl_set( TYPE & io_attribute, TYPE const & i_newValue, sal_Char const * i_attributeName )
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ if ( io_attribute == i_newValue )
+ return;
+
+ TYPE const aOldValue( io_attribute );
+ io_attribute = i_newValue;
+ broadcast_changed( i_attributeName, ::com::sun::star::uno::makeAny( aOldValue ), ::com::sun::star::uno::makeAny( io_attribute ), aGuard );
+ }
+
+ ::com::sun::star::uno::Any m_aIdentifier;
+ sal_Int32 m_nIndex;
+ sal_Int32 m_nDataColumnIndex;
+ sal_Int32 m_nColumnWidth;
+ sal_Int32 m_nMaxWidth;
+ sal_Int32 m_nMinWidth;
+ sal_Int32 m_nFlexibility;
+ sal_Bool m_bResizeable;
+ ::rtl::OUString m_sTitle;
+ ::rtl::OUString m_sHelpText;
+ ::com::sun::star::style::HorizontalAlignment m_eHorizontalAlign;
};
}
diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx
index 9289352720bc..1aeb53fa42fb 100644
--- a/toolkit/source/controls/grid/gridcontrol.cxx
+++ b/toolkit/source/controls/grid/gridcontrol.cxx
@@ -29,22 +29,27 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
-#include <gridcontrol.hxx>
+#include "gridcontrol.hxx"
+#include "grideventforwarder.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
+#include <com/sun/star/awt/grid/XMutableGridDataModel.hpp>
+#include <com/sun/star/awt/grid/DefaultGridDataModel.hpp>
+#include <com/sun/star/awt/grid/SortableGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
-#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <toolkit/helper/property.hxx>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
-#include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
+#include <tools/color.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@@ -53,10 +58,28 @@ using namespace ::com::sun::star::view;
namespace toolkit
{
-// ----------------------------------------------------
-// class UnoGridModel
-// ----------------------------------------------------
-UnoGridModel::UnoGridModel()
+//======================================================================================================================
+//= UnoGridModel
+//======================================================================================================================
+namespace
+{
+ Reference< XGridDataModel > lcl_getDefaultDataModel_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XMutableGridDataModel > const xDelegatorModel( DefaultGridDataModel::create( i_context.getUNOContext() ), UNO_QUERY_THROW );
+ Reference< XGridDataModel > const xDataModel( SortableGridDataModel::create( i_context.getUNOContext(), xDelegatorModel ), UNO_QUERY_THROW );
+ return xDataModel;
+ }
+
+ Reference< XGridColumnModel > lcl_getDefaultColumnModel_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XGridColumnModel > const xColumnModel( i_context.createComponent( "com.sun.star.awt.grid.DefaultGridColumnModel" ), UNO_QUERY_THROW );
+ return xColumnModel;
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -72,36 +95,131 @@ UnoGridModel::UnoGridModel()
ImplRegisterProperty( BASEPROPERTY_VSCROLL );
ImplRegisterProperty( BASEPROPERTY_TABSTOP );
ImplRegisterProperty( BASEPROPERTY_GRID_SHOWROWHEADER );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEADER_WIDTH );
ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER );
- ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL );
- ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL );
+ ImplRegisterProperty( BASEPROPERTY_COLUMN_HEADER_HEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( lcl_getDefaultDataModel_throw( maContext ) ) );
+ ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( lcl_getDefaultColumnModel_throw( maContext ) ) );
ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE );
ImplRegisterProperty( BASEPROPERTY_FONTRELIEF );
ImplRegisterProperty( BASEPROPERTY_FONTEMPHASISMARK );
ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
ImplRegisterProperty( BASEPROPERTY_TEXTCOLOR );
- ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
- ImplRegisterProperty( BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND );
- ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_TEXTLINECOLOR );
+ ImplRegisterProperty( BASEPROPERTY_USE_GRID_LINES );
ImplRegisterProperty( BASEPROPERTY_GRID_LINE_COLOR );
- ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_TEXT_COLOR );
+ ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS );
+ ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
}
+//----------------------------------------------------------------------------------------------------------------------
UnoGridModel::UnoGridModel( const UnoGridModel& rModel )
-: UnoControlModel( rModel )
+ :UnoControlModel( rModel )
{
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ Reference< XGridDataModel > xDataModel;
+ // clone the data model
+ const Reference< XFastPropertySet > xCloneSource( &const_cast< UnoGridModel& >( rModel ) );
+ try
+ {
+ const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ), UNO_QUERY_THROW );
+ xDataModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( !xDataModel.is() )
+ xDataModel = lcl_getDefaultDataModel_throw( maContext );
+ UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_DATAMODEL, makeAny( xDataModel ) );
+ // do *not* use setFastPropertyValue here: The UnoControlModel ctor did a simple copy of all property values,
+ // so before this call here, we share our data model with the own of the clone source. setFastPropertyValue,
+ // then, disposes the old data model - which means the data model which in fact belongs to the clone source.
+ // so, call the UnoControlModel's impl-method for setting the value.
+
+ // clone the column model
+ Reference< XGridColumnModel > xColumnModel;
+ try
+ {
+ const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ), UNO_QUERY_THROW );
+ xColumnModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( !xColumnModel.is() )
+ xColumnModel = lcl_getDefaultColumnModel_throw( maContext );
+ UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( xColumnModel ) );
+ // same comment as above: do not use our own setPropertyValue here.
+ }
+ osl_decrementInterlockedCount( &m_refCount );
}
+//----------------------------------------------------------------------------------------------------------------------
UnoControlModel* UnoGridModel::Clone() const
{
return new UnoGridModel( *this );
}
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ void lcl_dispose_nothrow( const Any& i_component )
+ {
+ try
+ {
+ const Reference< XComponent > xComponent( i_component, UNO_QUERY_THROW );
+ xComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridModel::dispose( ) throw(RuntimeException)
+{
+ lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ) );
+ lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ) );
+
+ UnoControlModel::dispose();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception)
+{
+ Any aOldSubModel;
+ if ( ( nHandle == BASEPROPERTY_GRID_COLUMNMODEL ) || ( nHandle == BASEPROPERTY_GRID_DATAMODEL ) )
+ {
+ aOldSubModel = getFastPropertyValue( nHandle );
+ if ( aOldSubModel == rValue )
+ {
+ OSL_ENSURE( false, "UnoGridModel::setFastPropertyValue_NoBroadcast: setting the same value, again!" );
+ // shouldn't this have been caught by convertFastPropertyValue?
+ aOldSubModel.clear();
+ }
+ }
+
+ UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
+
+ if ( aOldSubModel.hasValue() )
+ lcl_dispose_nothrow( aOldSubModel );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
OUString UnoGridModel::getServiceName() throw(RuntimeException)
{
return OUString::createFromAscii( szServiceName_GridControlModel );
}
+//----------------------------------------------------------------------------------------------------------------------
Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
switch( nPropId )
@@ -111,27 +229,26 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
case BASEPROPERTY_GRID_SELECTIONMODE:
return uno::makeAny( SelectionType(1) );
case BASEPROPERTY_GRID_SHOWROWHEADER:
+ case BASEPROPERTY_USE_GRID_LINES:
return uno::makeAny( (sal_Bool)sal_False );
+ case BASEPROPERTY_ROW_HEADER_WIDTH:
+ return uno::makeAny( sal_Int32( 10 ) );
case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
- return uno::makeAny( (sal_Bool)sal_False );
- case BASEPROPERTY_GRID_DATAMODEL:
- return uno::makeAny( Reference<XGridDataModel> ());
- case BASEPROPERTY_GRID_COLUMNMODEL:
- return uno::makeAny(Reference<XGridColumnModel>() );
- case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
+ return uno::makeAny( (sal_Bool)sal_True );
+ case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
case BASEPROPERTY_GRID_HEADER_BACKGROUND:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
case BASEPROPERTY_GRID_LINE_COLOR:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
- case BASEPROPERTY_GRID_ROW_BACKGROUND:
- return uno::makeAny(com::sun::star::util::Color(0xFFFFFF) );
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ return Any();
default:
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
}
+//----------------------------------------------------------------------------------------------------------------------
::cppu::IPropertyArrayHelper& UnoGridModel::getInfoHelper()
{
static UnoPropertyArrayHelper* pHelper = NULL;
@@ -143,6 +260,7 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return *pHelper;
}
+//----------------------------------------------------------------------------------------------------------------------
// XMultiPropertySet
Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(RuntimeException)
{
@@ -151,20 +269,29 @@ Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(Runtime
}
-// ----------------------------------------------------
-// class UnoGridControl
-// ----------------------------------------------------
-UnoGridControl::UnoGridControl()
-: mSelectionMode(SelectionType(1)),
- m_aSelectionListeners( *this )
+//======================================================================================================================
+//= UnoGridControl
+//======================================================================================================================
+UnoGridControl::UnoGridControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoGridControl_Base( i_factory )
+ ,mSelectionMode(SelectionType(1))
+ ,m_aSelectionListeners( *this )
+ ,m_pEventForwarder( new GridEventForwarder( *this ) )
+{
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+UnoGridControl::~UnoGridControl()
{
}
+//----------------------------------------------------------------------------------------------------------------------
OUString UnoGridControl::GetComponentServiceName()
{
return OUString(RTL_CONSTASCII_USTRINGPARAM("Grid"));
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::dispose( ) throw(RuntimeException)
{
lang::EventObject aEvt;
@@ -173,115 +300,157 @@ void SAL_CALL UnoGridControl::dispose( ) throw(RuntimeException)
UnoControl::dispose();
}
-void UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
{
UnoControlBase::createPeer( rxToolkit, rParentPeer );
- Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW );
+ const Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW );
xGrid->addSelectionListener(&m_aSelectionListeners);
+}
- Reference<XGridDataListener> xListener ( getPeer(), UNO_QUERY_THROW );
- Reference<XGridColumnListener> xColListener ( getPeer(), UNO_QUERY_THROW );
- Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
-
- Reference<XGridDataModel> xGridDataModel ( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("GridDataModel"))), UNO_QUERY_THROW );
- if(xGridDataModel != NULL)
- xGridDataModel->addDataListener(xListener);
- Reference<XGridColumnModel> xGridColumnModel ( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnModel"))), UNO_QUERY_THROW );
- if(xGridColumnModel != NULL)
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ void lcl_setEventForwarding( const Reference< XControlModel >& i_gridControlModel, const ::boost::scoped_ptr< GridEventForwarder >& i_listener,
+ bool const i_add )
{
- for(int i = 0;i<xGridColumnModel->getColumnCount();i++)
+ const Reference< XPropertySet > xModelProps( i_gridControlModel, UNO_QUERY );
+ if ( !xModelProps.is() )
+ return;
+
+ try
{
- xGridColumnModel->getColumn(i)->addColumnListener(xColListener);
+ Reference< XContainer > const xColModel(
+ xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnModel" ) ) ),
+ UNO_QUERY_THROW );
+ if ( i_add )
+ xColModel->addContainerListener( i_listener.get() );
+ else
+ xColModel->removeContainerListener( i_listener.get() );
+
+ Reference< XGridDataModel > const xDataModel(
+ xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridDataModel" ) ) ),
+ UNO_QUERY_THROW
+ );
+ Reference< XMutableGridDataModel > const xMutableDataModel( xDataModel, UNO_QUERY );
+ if ( xMutableDataModel.is() )
+ {
+ if ( i_add )
+ xMutableDataModel->addGridDataListener( i_listener.get() );
+ else
+ xMutableDataModel->removeGridDataListener( i_listener.get() );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
+//----------------------------------------------------------------------------------------------------------------------
+sal_Bool SAL_CALL UnoGridControl::setModel( const Reference< XControlModel >& i_model ) throw(RuntimeException)
+{
+ lcl_setEventForwarding( getModel(), m_pEventForwarder, false );
+ if ( !UnoGridControl_Base::setModel( i_model ) )
+ return sal_False;
+ lcl_setEventForwarding( getModel(), m_pEventForwarder, true );
+ return sal_True;
+}
-// -------------------------------------------------------------------
-// XGridControl
-
-::sal_Int32 UnoGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 UnoGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl > xGrid ( getPeer(), UNO_QUERY_THROW );
- return xGrid->getItemIndexAtPoint( x, y );
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getRowAtPoint( x, y );
}
-void SAL_CALL UnoGridControl::setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 UnoGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->setToolTip( text, columns );
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getColumnAtPoint( x, y );
}
-// -------------------------------------------------------------------
-// XGridSelection
-// -------------------------------------------------------------------
-::sal_Int32 SAL_CALL UnoGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 SAL_CALL UnoGridControl::getCurrentColumn( ) throw (RuntimeException)
{
- return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMinSelectionIndex();
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getCurrentColumn();
}
-::sal_Int32 SAL_CALL UnoGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 SAL_CALL UnoGridControl::getCurrentRow( ) throw (RuntimeException)
{
- return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMaxSelectionIndex();
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getCurrentRow();
}
-void SAL_CALL UnoGridControl::selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRows( rangeOfRows);
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( i_rowIndex );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectAllRows();
}
-void SAL_CALL UnoGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectRows( rangeOfRows);
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectRow( i_rowIndex );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectAllRows();
}
+
+//----------------------------------------------------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getSelection();
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL UnoGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectionEmpty();
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL UnoGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectedIndex( index );
}
-void SAL_CALL UnoGridControl::selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( y );
-}
-
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.addInterface( listener );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.removeInterface( listener );
}
+
}//namespace toolkit
-Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl( i_factory ) );
}
-Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel( i_factory ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx
index 564e752e618e..97283e7827b5 100644
--- a/toolkit/source/controls/grid/gridcontrol.hxx
+++ b/toolkit/source/controls/grid/gridcontrol.hxx
@@ -31,21 +31,20 @@
#include <com/sun/star/awt/grid/XGridControl.hpp>
#include <com/sun/star/view/SelectionType.hpp>
+
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/controls/unocontrolmodel.hxx>
#include <toolkit/helper/servicenames.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/sequence.hxx>
-
#include <toolkit/helper/listenermultiplexer.hxx>
-namespace toolkit {
+#include <boost/scoped_ptr.hpp>
+
+namespace toolkit
+{
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
+class GridEventForwarder;
// ===================================================================
// = UnoGridModel
@@ -53,21 +52,27 @@ using namespace ::com::sun::star::container;
class UnoGridModel : public UnoControlModel
{
protected:
- Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoGridModel();
+ UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoGridModel( const UnoGridModel& rModel );
UnoControlModel* Clone() const;
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
// ::com::sun::star::beans::XMultiPropertySet
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
// XServiceInfo
DECLIMPL_SERVICEINFO_DERIVED( UnoGridModel, UnoControlModel, szServiceName_GridControlModel )
};
@@ -76,10 +81,13 @@ public:
// ===================================================================
// = UnoGridControl
// ===================================================================
-class UnoGridControl : public ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::grid::XGridControl >
+typedef ::cppu::ImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::grid::XGridControl
+ > UnoGridControl_Base;
+class UnoGridControl : public UnoGridControl_Base
{
public:
- UnoGridControl();
+ UnoGridControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XComponent
@@ -87,24 +95,22 @@ public:
// ::com::sun::star::awt::XControl
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::grid::XGridControl
-
- virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::grid::XGridSelection
-
- virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
@@ -112,9 +118,14 @@ public:
DECLIMPL_SERVICEINFO_DERIVED( UnoGridControl, UnoControlBase, szServiceName_GridControl )
using UnoControl::getPeer;
+
+protected:
+ ~UnoGridControl();
+
private:
- ::com::sun::star::view::SelectionType mSelectionMode;
- SelectionListenerMultiplexer m_aSelectionListeners;
+ ::com::sun::star::view::SelectionType mSelectionMode;
+ SelectionListenerMultiplexer m_aSelectionListeners;
+ ::boost::scoped_ptr< GridEventForwarder > m_pEventForwarder;
};
} // toolkit
diff --git a/toolkit/source/controls/grid/grideventforwarder.cxx b/toolkit/source/controls/grid/grideventforwarder.cxx
new file mode 100755
index 000000000000..c3760b8315a3
--- /dev/null
+++ b/toolkit/source/controls/grid/grideventforwarder.cxx
@@ -0,0 +1,149 @@
+/*************************************************************************
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include "grideventforwarder.hxx"
+#include "gridcontrol.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::lang::EventObject;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= GridEventForwarder
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ GridEventForwarder::GridEventForwarder( UnoGridControl& i_parent )
+ :m_parent( i_parent )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ GridEventForwarder::~GridEventForwarder()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::acquire() throw()
+ {
+ m_parent.acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::release() throw()
+ {
+ m_parent.release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowsInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowsRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->dataChanged( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowHeadingChanged( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementReplaced( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ Reference< XEventListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->disposing( i_event );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/grid/grideventforwarder.hxx b/toolkit/source/controls/grid/grideventforwarder.hxx
new file mode 100755
index 000000000000..5a8b03f57037
--- /dev/null
+++ b/toolkit/source/controls/grid/grideventforwarder.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ * DO NOT ALTER 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 TOOLKIT_GRIDEVENTFORWARDER_HXX
+#define TOOLKIT_GRIDEVENTFORWARDER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridDataListener.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ class UnoGridControl;
+
+ //==================================================================================================================
+ //= GridEventForwarder
+ //==================================================================================================================
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::grid::XGridDataListener
+ , ::com::sun::star::container::XContainerListener
+ > GridEventForwarder_Base;
+
+ class GridEventForwarder : public GridEventForwarder_Base
+ {
+ public:
+ GridEventForwarder( UnoGridControl& i_parent );
+ virtual ~GridEventForwarder();
+
+ public:
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ UnoGridControl& m_parent;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_GRIDEVENTFORWARDER_HXX
diff --git a/toolkit/source/controls/grid/initguard.hxx b/toolkit/source/controls/grid/initguard.hxx
new file mode 100755
index 000000000000..138cdd8c894c
--- /dev/null
+++ b/toolkit/source/controls/grid/initguard.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INITGUARD_HXX
+#define SVTOOLS_INITGUARD_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/NotInitializedException.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentguard.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= InitGuard
+ //==================================================================================================================
+ template < class IMPL >
+ class InitGuard : public ::comphelper::ComponentGuard
+ {
+ public:
+ InitGuard( IMPL& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper )
+ :comphelper::ComponentGuard( i_component, i_broadcastHelper )
+ {
+ if ( !i_component.isInitialized() )
+ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_component );
+ }
+
+ ~InitGuard()
+ {
+ }
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // SVTOOLS_INITGUARD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/toolkit/source/controls/grid/makefile.mk b/toolkit/source/controls/grid/makefile.mk
deleted file mode 100644
index 70bfc34b9d02..000000000000
--- a/toolkit/source/controls/grid/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=toolkit
-TARGET=grid
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/gridcontrol.obj\
- $(SLO)$/defaultgriddatamodel.obj\
- $(SLO)$/defaultgridcolumnmodel.obj\
- $(SLO)$/gridcolumn.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
new file mode 100755
index 000000000000..77a2ffa1637b
--- /dev/null
+++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
@@ -0,0 +1,877 @@
+/*************************************************************************
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include "sortablegriddatamodel.hxx"
+#include "toolkit/helper/servicenames.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/i18n/XCollator.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/anycompare.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
+
+#include <set>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::TypeClass;
+ using ::com::sun::star::uno::TypeClass_VOID;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::IndexOutOfBoundsException;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::awt::grid::XGridDataListener;
+ using ::com::sun::star::beans::Pair;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::i18n::XCollator;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::ucb::AlreadyInitializedException;
+ /** === end UNO using === **/
+
+#ifdef DBG_UTIL
+ const char* SortableGridDataModel_checkInvariants( const void* _pInstance )
+ {
+ return static_cast< const SortableGridDataModel* >( _pInstance )->checkInvariants();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const char* SortableGridDataModel::checkInvariants() const
+ {
+ if ( m_publicToPrivateRowIndex.size() != m_privateToPublicRowIndex.size() )
+ return "inconsistent index maps";
+
+ if ( m_delegator.is() )
+ {
+ if ( m_publicToPrivateRowIndex.size() != size_t( m_delegator->getRowCount() ) )
+ return "wrong cached row count";
+ }
+ else
+ {
+ if ( !m_publicToPrivateRowIndex.empty() )
+ return "disposed or not initialized, but having a non-empty map";
+ }
+
+ for ( size_t publicIndex=0; publicIndex<m_publicToPrivateRowIndex.size(); ++publicIndex )
+ {
+ ::sal_Int32 const privateIndex = m_publicToPrivateRowIndex[ publicIndex ];
+ if ( ( privateIndex < 0 ) || ( size_t( privateIndex ) >= m_privateToPublicRowIndex.size() ) )
+ return "invalid cached private index";
+
+ if ( m_privateToPublicRowIndex[ privateIndex ] != sal_Int32( publicIndex ) )
+ return "index map traversal not commutavive";
+ }
+
+ if ( impl_isSorted_nothrow() && m_publicToPrivateRowIndex.empty() )
+ return "sorted, but no row index translation tables";
+
+ if ( !impl_isSorted_nothrow() && !m_publicToPrivateRowIndex.empty() )
+ return "unsorted, but have index translation tables";
+
+ return NULL;
+ }
+#endif
+
+#define DBG_CHECK_ME() \
+ DBG_CHKTHIS( SortableGridDataModel, SortableGridDataModel_checkInvariants )
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ template< class STLCONTAINER >
+ static void lcl_clear( STLCONTAINER& i_container )
+ {
+ STLCONTAINER empty;
+ empty.swap( i_container );
+ }
+ }
+
+ //==================================================================================================================
+ //= SortableGridDataModel
+ //==================================================================================================================
+ DBG_NAME( SortableGridDataModel )
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::SortableGridDataModel( Reference< XMultiServiceFactory > const & i_factory )
+ :SortableGridDataModel_Base( m_aMutex )
+ ,SortableGridDataModel_PrivateBase()
+ ,m_context( i_factory )
+ ,m_isInitialized( false )
+ ,m_delegator()
+ ,m_collator()
+ ,m_currentSortColumn( -1 )
+ ,m_sortAscending( true )
+ ,m_publicToPrivateRowIndex()
+ ,m_privateToPublicRowIndex()
+ {
+ DBG_CTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::SortableGridDataModel( SortableGridDataModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,SortableGridDataModel_Base( m_aMutex )
+ ,SortableGridDataModel_PrivateBase()
+ ,m_context( i_copySource.m_context )
+ ,m_isInitialized( true )
+ ,m_delegator()
+ ,m_collator( i_copySource.m_collator )
+ ,m_currentSortColumn( i_copySource.m_currentSortColumn )
+ ,m_sortAscending( i_copySource.m_sortAscending )
+ ,m_publicToPrivateRowIndex( i_copySource.m_publicToPrivateRowIndex )
+ ,m_privateToPublicRowIndex( i_copySource.m_privateToPublicRowIndex )
+ {
+ DBG_CTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+
+ ENSURE_OR_THROW( i_copySource.m_delegator.is(),
+ "not expected to be called for a disposed copy source!" );
+ m_delegator.set( i_copySource.m_delegator->createClone(), UNO_QUERY_THROW );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::~SortableGridDataModel()
+ {
+ if ( !rBHelper.bDisposed )
+ {
+ acquire();
+ dispose();
+ }
+
+ DBG_DTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::queryInterface( const Type& aType ) throw (RuntimeException)
+ {
+ Any aReturn( SortableGridDataModel_Base::queryInterface( aType ) );
+ if ( !aReturn.hasValue() )
+ aReturn = SortableGridDataModel_PrivateBase::queryInterface( aType );
+ return aReturn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::acquire( ) throw ()
+ {
+ SortableGridDataModel_Base::acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::release( ) throw ()
+ {
+ SortableGridDataModel_Base::release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Type > SAL_CALL SortableGridDataModel::getTypes( ) throw (RuntimeException)
+ {
+ return SortableGridDataModel_Base::getTypes();
+ // don't expose the types got via SortableGridDataModel_PrivateBase - they're private, after all
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::sal_Int8 > SAL_CALL SortableGridDataModel::getImplementationId( ) throw (RuntimeException)
+ {
+ static ::cppu::OImplementationId aId;
+ return aId.getImplementationId();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ Reference< XCollator > lcl_loadDefaultCollator_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XCollator > const xCollator( i_context.createComponent( "com.sun.star.i18n.Collator" ), UNO_QUERY_THROW );
+ xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 );
+ return xCollator;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::initialize( const Sequence< Any >& i_arguments ) throw (Exception, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ if ( m_delegator.is() )
+ throw AlreadyInitializedException( ::rtl::OUString(), *this );
+
+ Reference< XMutableGridDataModel > xDelegator;
+ Reference< XCollator > xCollator;
+ switch ( i_arguments.getLength() )
+ {
+ case 1: // SortableGridDataModel.create( XMutableGridDataModel )
+ xDelegator.set( i_arguments[0], UNO_QUERY );
+ xCollator = lcl_loadDefaultCollator_throw( m_context );
+ break;
+
+ case 2: // SortableGridDataModel.createWithCollator( XMutableGridDataModel, XCollator )
+ xDelegator.set( i_arguments[0], UNO_QUERY );
+ xCollator.set( i_arguments[1], UNO_QUERY );
+ if ( !xCollator.is() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 2 );
+ break;
+ }
+ if ( !xDelegator.is() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+
+ m_delegator = xDelegator;
+ m_collator = xCollator;
+
+ m_delegator->addGridDataListener( this );
+
+ m_isInitialized = true;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ GridDataEvent SortableGridDataModel::impl_createPublicEvent( GridDataEvent const & i_originalEvent ) const
+ {
+ GridDataEvent aEvent( i_originalEvent );
+ aEvent.Source = *const_cast< SortableGridDataModel* >( this );
+ aEvent.FirstRow = impl_getPublicRowIndex_nothrow( aEvent.FirstRow );
+ aEvent.LastRow = impl_getPublicRowIndex_nothrow( aEvent.LastRow );
+ return aEvent;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_broadcast( void ( SAL_CALL XGridDataListener::*i_listenerMethod )( const GridDataEvent & ),
+ GridDataEvent const & i_publicEvent, MethodGuard& i_instanceLock )
+ {
+ ::cppu::OInterfaceContainerHelper* pListeners = rBHelper.getContainer( XGridDataListener::static_type() );
+ if ( pListeners == NULL )
+ return;
+
+ i_instanceLock.clear();
+ pListeners->notifyEach( i_listenerMethod, i_publicEvent );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ // if the data is not sorted, broadcast the event unchanged
+ if ( !impl_isSorted_nothrow() )
+ {
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard );
+ return;
+ }
+
+ bool needReIndex = false;
+ if ( i_event.FirstRow > i_event.LastRow )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - invalid row indexes!" );
+ needReIndex = true;
+ }
+ else if ( size_t( i_event.FirstRow ) > m_privateToPublicRowIndex.size() )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - too large row index!" );
+ needReIndex = true;
+ }
+
+ if ( needReIndex )
+ {
+ impl_rebuildIndexesAndNotify( aGuard );
+ return;
+ }
+
+ // we do not insert the new rows into the sort order - if somebody adds rows while we're sorted, s/he has
+ // to resort. Instead, we simply append the rows, no matter where they were inserted in the delegator data
+ // model.
+ sal_Int32 const nPublicFirstRow = sal_Int32( m_privateToPublicRowIndex.size() );
+ sal_Int32 nPublicLastRow = nPublicFirstRow;
+ for ( sal_Int32 newRow = i_event.FirstRow; newRow <= i_event.LastRow; ++newRow, ++nPublicLastRow )
+ {
+ m_privateToPublicRowIndex.push_back( nPublicLastRow );
+ m_publicToPrivateRowIndex.push_back( nPublicLastRow );
+ }
+
+ // broadcast the event
+ GridDataEvent const aEvent( *this, -1, -1, nPublicFirstRow, nPublicLastRow );
+ impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void lcl_decrementValuesGreaterThan( ::std::vector< ::sal_Int32 > & io_indexMap, sal_Int32 const i_threshold )
+ {
+ for ( ::std::vector< ::sal_Int32 >::iterator loop = io_indexMap.begin();
+ loop != io_indexMap.end();
+ ++loop
+ )
+ {
+ if ( *loop >= i_threshold )
+ --*loop;
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_rebuildIndexesAndNotify( MethodGuard& i_instanceLock )
+ {
+ OSL_PRECOND( impl_isSorted_nothrow(), "SortableGridDataModel::impl_rebuildIndexesAndNotify: illegal call!" );
+
+ // clear the indexes
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+
+ // broadcast an artificial event, saying that all rows have been removed
+ GridDataEvent const aRemovalEvent( *this, -1, -1, -1, -1 );
+ impl_broadcast( &XGridDataListener::rowsRemoved, aRemovalEvent, i_instanceLock );
+ i_instanceLock.reset();
+
+ // rebuild the index
+ impl_reIndex_nothrow( m_currentSortColumn, m_sortAscending );
+
+ // broadcast an artificial event, saying that n rows have been added
+ GridDataEvent const aAdditionEvent( *this, -1, -1, 0, m_delegator->getRowCount() - 1 );
+ impl_broadcast( &XGridDataListener::rowsInserted, aAdditionEvent, i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ // if the data is not sorted, broadcast the event unchanged
+ if ( !impl_isSorted_nothrow() )
+ {
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ return;
+ }
+
+ // if all rows have been removed, also simply multiplex to own listeners
+ if ( i_event.FirstRow < 0 )
+ {
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+ GridDataEvent aEvent( i_event );
+ aEvent.Source = *this;
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ return;
+ }
+
+ bool needReIndex = false;
+ if ( i_event.FirstRow != i_event.LastRow )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: missing implementation - removal of multiple rows!" );
+ needReIndex = true;
+ }
+ else if ( size_t( i_event.FirstRow ) >= m_privateToPublicRowIndex.size() )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: inconsistent/wrong data!" );
+ needReIndex = true;
+ }
+
+ if ( needReIndex )
+ {
+ impl_rebuildIndexesAndNotify( aGuard );
+ return;
+ }
+
+ // build public event version
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+
+ // remove the entries from the index maps
+ sal_Int32 const privateIndex = i_event.FirstRow;
+ sal_Int32 const publicIndex = aEvent.FirstRow;
+
+ m_publicToPrivateRowIndex.erase( m_publicToPrivateRowIndex.begin() + publicIndex );
+ m_privateToPublicRowIndex.erase( m_privateToPublicRowIndex.begin() + privateIndex );
+
+ // adjust remaining entries in the index maps
+ lcl_decrementValuesGreaterThan( m_publicToPrivateRowIndex, privateIndex );
+ lcl_decrementValuesGreaterThan( m_privateToPublicRowIndex, publicIndex );
+
+ // broadcast the event
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::dataChanged, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowHeadingChanged, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ // not interested in
+ OSL_UNUSED( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ class CellDataLessComparison : public ::std::binary_function< sal_Int32, sal_Int32, bool >
+ {
+ public:
+ CellDataLessComparison(
+ ::std::vector< Any > const & i_data,
+ ::comphelper::IKeyPredicateLess& i_predicate,
+ sal_Bool const i_sortAscending
+ )
+ :m_data( i_data )
+ ,m_predicate( i_predicate )
+ ,m_sortAscending( i_sortAscending )
+ {
+ }
+
+ bool operator()( sal_Int32 const i_lhs, sal_Int32 const i_rhs ) const
+ {
+ Any const & lhs = m_data[ i_lhs ];
+ Any const & rhs = m_data[ i_rhs ];
+ // <VOID/> is less than everything else
+ if ( !lhs.hasValue() )
+ return m_sortAscending;
+ if ( !rhs.hasValue() )
+ return !m_sortAscending;
+
+ // actually compare
+ if ( m_sortAscending )
+ return m_predicate.isLess( lhs, rhs );
+ else
+ return m_predicate.isLess( rhs, lhs );
+ }
+
+ private:
+ ::std::vector< Any > const & m_data;
+ ::comphelper::IKeyPredicateLess const & m_predicate;
+ sal_Bool const m_sortAscending;
+ };
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending )
+ {
+ ::sal_Int32 const rowCount( getRowCount() );
+ ::std::vector< ::sal_Int32 > aPublicToPrivate( rowCount );
+
+ try
+ {
+ // build an unsorted translation table, and retrieve the unsorted data
+ ::std::vector< Any > aColumnData( rowCount );
+ Type dataType;
+ for ( ::sal_Int32 rowIndex = 0; rowIndex < rowCount; ++rowIndex )
+ {
+ aColumnData[ rowIndex ] = m_delegator->getCellData( i_columnIndex, rowIndex );
+ aPublicToPrivate[ rowIndex ] = rowIndex;
+
+ // determine the data types we assume for the complete column
+ if ( ( dataType.getTypeClass() == TypeClass_VOID ) && aColumnData[ rowIndex ].hasValue() )
+ dataType = aColumnData[ rowIndex ].getValueType();
+ }
+
+ // get predicate object
+ ::std::auto_ptr< ::comphelper::IKeyPredicateLess > const pPredicate( ::comphelper::getStandardLessPredicate( dataType, m_collator ) );
+ ENSURE_OR_RETURN_VOID( pPredicate.get(), "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!" );
+
+ // then sort
+ CellDataLessComparison const aComparator( aColumnData, *pPredicate, i_sortAscending );
+ ::std::sort( aPublicToPrivate.begin(), aPublicToPrivate.end(), aComparator );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ return;
+ }
+
+ // also build the "private to public" mapping
+ ::std::vector< sal_Int32 > aPrivateToPublic( aPublicToPrivate.size() );
+ for ( size_t i=0; i<aPublicToPrivate.size(); ++i )
+ aPrivateToPublic[ aPublicToPrivate[i] ] = i;
+
+ m_publicToPrivateRowIndex.swap( aPublicToPrivate );
+ m_privateToPublicRowIndex.swap( aPrivateToPublic );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::sortByColumn( ::sal_Int32 i_columnIndex, ::sal_Bool i_sortAscending ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= getColumnCount() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ impl_reIndex_nothrow( i_columnIndex, i_sortAscending );
+
+ m_currentSortColumn = i_columnIndex;
+ m_sortAscending = i_sortAscending;
+
+ impl_broadcast(
+ &XGridDataListener::dataChanged,
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ aGuard
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeColumnSort( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+
+ m_currentSortColumn = -1;
+ m_sortAscending = sal_True;
+
+ impl_broadcast(
+ &XGridDataListener::dataChanged,
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ aGuard
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Pair< ::sal_Int32, ::sal_Bool > SAL_CALL SortableGridDataModel::getCurrentSortOrder( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ return Pair< ::sal_Int32, ::sal_Bool >( m_currentSortColumn, m_sortAscending );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->addRow( i_heading, i_data );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->addRows( i_headings, i_data );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeRow( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->removeRow( rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeAllRows( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->removeAllRows();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateCellData( i_columnIndex, rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowData( const Sequence< ::sal_Int32 >& i_columnIndexes, ::sal_Int32 i_rowIndex, const Sequence< Any >& i_values ) throw (IndexOutOfBoundsException, IllegalArgumentException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowData( i_columnIndexes, rowIndex, i_values );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowHeading( ::sal_Int32 i_rowIndex, const Any& i_heading ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowHeading( rowIndex, i_heading );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateCellToolTip( i_columnIndex, rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowToolTip( ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowToolTip( rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addGridDataListener( const Reference< XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridDataListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeGridDataListener( const Reference< XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridDataListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL SortableGridDataModel::getRowCount() throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getRowCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL SortableGridDataModel::getColumnCount() throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getColumnCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getCellData( i_columnIndex, rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getCellToolTip( i_columnIndex, rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getRowHeading( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getRowHeading( rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::disposing()
+ {
+ m_currentSortColumn = -1;
+
+ Reference< XComponent > const delegatorComponent( m_delegator.get() );
+ m_delegator->removeGridDataListener( this );
+ m_delegator.clear();
+ delegatorComponent->dispose();
+
+ Reference< XComponent > const collatorComponent( m_collator, UNO_QUERY );
+ m_collator.clear();
+ if ( collatorComponent.is() )
+ collatorComponent->dispose();
+
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL SortableGridDataModel::createClone( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ return new SortableGridDataModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SortableGridDataModel::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.SortableGridDataModel" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL SortableGridDataModel::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > const aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL SortableGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_SortableGridDataModel );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SortableGridDataModel::impl_getPrivateRowIndex_throw( ::sal_Int32 const i_publicRowIndex ) const
+ {
+ if ( ( i_publicRowIndex < 0 ) || ( i_publicRowIndex >= m_delegator->getRowCount() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< SortableGridDataModel* >( this ) );
+
+ if ( !impl_isSorted_nothrow() )
+ // no need to translate anything
+ return i_publicRowIndex;
+
+ ENSURE_OR_RETURN( size_t( i_publicRowIndex ) < m_publicToPrivateRowIndex.size(),
+ "SortableGridDataModel::impl_getPrivateRowIndex_throw: inconsistency!", i_publicRowIndex );
+ // obviously the translation table contains too few elements - it should have exactly |getRowCount()|
+ // elements
+
+ return m_publicToPrivateRowIndex[ i_publicRowIndex ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SortableGridDataModel::impl_getPublicRowIndex_nothrow( ::sal_Int32 const i_privateRowIndex ) const
+ {
+ if ( !impl_isSorted_nothrow() )
+ // no need to translate anything
+ return i_privateRowIndex;
+
+ if ( i_privateRowIndex < 0 )
+ return i_privateRowIndex;
+
+ ENSURE_OR_RETURN( size_t( i_privateRowIndex ) < m_privateToPublicRowIndex.size(),
+ "SortableGridDataModel::impl_getPublicRowIndex_nothrow: invalid index!", i_privateRowIndex );
+
+ return m_privateToPublicRowIndex[ i_privateRowIndex ];
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+{
+ return *( new ::toolkit::SortableGridDataModel( i_factory ) );
+}
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx
new file mode 100755
index 000000000000..50f08d3a7113
--- /dev/null
+++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx
@@ -0,0 +1,198 @@
+/*************************************************************************
+ * DO NOT ALTER 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 TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
+#define TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
+
+#include "initguard.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XSortableMutableGridDataModel.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+#include <com/sun/star/awt/grid/XGridDataListener.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ class SortableGridDataModel;
+ typedef InitGuard< SortableGridDataModel > MethodGuard;
+
+ //==================================================================================================================
+ //= SortableGridDataModel
+ //==================================================================================================================
+ typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::awt::grid::XSortableMutableGridDataModel
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XInitialization
+ > SortableGridDataModel_Base;
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::grid::XGridDataListener
+ > SortableGridDataModel_PrivateBase;
+ class SortableGridDataModel :public ::cppu::BaseMutex
+ ,public SortableGridDataModel_Base
+ ,public SortableGridDataModel_PrivateBase
+ {
+ public:
+ SortableGridDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
+ SortableGridDataModel( SortableGridDataModel const & i_copySource );
+
+ bool isInitialized() const { return m_isInitialized; }
+
+#ifdef DBG_UTIL
+ const char* checkInvariants() const;
+#endif
+
+ protected:
+ ~SortableGridDataModel();
+
+ public:
+ // XSortableGridData
+ virtual void SAL_CALL sortByColumn( ::sal_Int32 ColumnIndex, ::sal_Bool SortAscending ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeColumnSort( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Pair< ::sal_Int32, ::sal_Bool > SAL_CALL getCurrentSortOrder( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XMutableGridDataModel
+ virtual void SAL_CALL addRow( const ::com::sun::star::uno::Any& Heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowData( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& ColumnIndexes, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowHeading( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Heading ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellToolTip( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowToolTip( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGridDataModel
+ virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) 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 ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ /** translates the given public index into one to be passed to our delegator
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the given index does not denote a valid row
+ */
+ ::sal_Int32 impl_getPrivateRowIndex_throw( ::sal_Int32 const i_publicRowIndex ) const;
+
+ /** translates the given private row index to a public one
+ */
+ ::sal_Int32 impl_getPublicRowIndex_nothrow( ::sal_Int32 const i_privateRowIndex ) const;
+
+ inline bool impl_isSorted_nothrow() const
+ {
+ return m_currentSortColumn >= 0;
+ }
+
+ /** rebuilds the index translation structure.
+
+ Neither <member>m_currentSortColumn</member> nor <member>m_sortAscending</member> are touched by this method.
+ Also, the given column index is not checked, this is the responsibility of the caller.
+ */
+ void impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending );
+
+ /** translates the given event, obtained from our delegator, to a version which can be broadcasted to our own
+ clients.
+ */
+ ::com::sun::star::awt::grid::GridDataEvent
+ impl_createPublicEvent( ::com::sun::star::awt::grid::GridDataEvent const & i_originalEvent ) const;
+
+ /** broadcasts the given event to our registered XGridDataListeners
+ */
+ void impl_broadcast(
+ void ( SAL_CALL ::com::sun::star::awt::grid::XGridDataListener::*i_listenerMethod )( const ::com::sun::star::awt::grid::GridDataEvent & ),
+ ::com::sun::star::awt::grid::GridDataEvent const & i_publicEvent,
+ MethodGuard& i_instanceLock
+ );
+
+ /** rebuilds our indexes, notifying row removal and row addition events
+
+ First, a rowsRemoved event is notified to our registered listeners. Then, the index translation tables are
+ rebuilt, and a rowsInserted event is notified.
+
+ Only to be called when we're sorted.
+ */
+ void impl_rebuildIndexesAndNotify( MethodGuard& i_instanceLock );
+
+ private:
+ ::comphelper::ComponentContext m_context;
+ bool m_isInitialized;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XMutableGridDataModel > m_delegator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_collator;
+ ::sal_Int32 m_currentSortColumn;
+ ::sal_Bool m_sortAscending;
+ ::std::vector< ::sal_Int32 > m_publicToPrivateRowIndex;
+ ::std::vector< ::sal_Int32 > m_privateToPublicRowIndex;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
diff --git a/toolkit/source/controls/makefile.mk b/toolkit/source/controls/makefile.mk
deleted file mode 100644
index 1ce9f7b22c8c..000000000000
--- a/toolkit/source/controls/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=toolkit
-TARGET=controls
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/accessiblecontrolcontext.obj \
- $(SLO)$/geometrycontrolmodel.obj \
- $(SLO)$/eventcontainer.obj \
- $(SLO)$/stdtabcontroller.obj \
- $(SLO)$/stdtabcontrollermodel.obj \
- $(SLO)$/unocontrol.obj \
- $(SLO)$/unocontrolbase.obj \
- $(SLO)$/unocontrolcontainer.obj \
- $(SLO)$/unocontrolcontainermodel.obj \
- $(SLO)$/unocontrolmodel.obj \
- $(SLO)$/unocontrols.obj \
- $(SLO)$/formattedcontrol.obj \
- $(SLO)$/roadmapcontrol.obj \
- $(SLO)$/roadmapentry.obj \
- $(SLO)$/dialogcontrol.obj \
- $(SLO)$/tkscrollbar.obj \
- $(SLO)$/tkspinbutton.obj \
- $(SLO)$/tksimpleanimation.obj \
- $(SLO)$/tkthrobber.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index adb38b8ca05c..f72e4126e527 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -65,7 +65,9 @@ static void lcl_throwIndexOutOfBoundsException( )
// = UnoControlRoadmapModel
// ===================================================================
// -------------------------------------------------------------------
- UnoControlRoadmapModel::UnoControlRoadmapModel() : maContainerListeners( *this )
+ UnoControlRoadmapModel::UnoControlRoadmapModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlRoadmapModel_Base( i_factory )
+ ,maContainerListeners( *this )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -367,7 +369,9 @@ static void lcl_throwIndexOutOfBoundsException( )
// = UnoRoadmapControl
// ===================================================================
// -------------------------------------------------------------------
- UnoRoadmapControl::UnoRoadmapControl(): maItemListeners( *this )
+ UnoRoadmapControl::UnoRoadmapControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlRoadmap_Base( i_factory )
+ ,maItemListeners( *this )
{
}
diff --git a/toolkit/source/controls/spinningprogress.cxx b/toolkit/source/controls/spinningprogress.cxx
new file mode 100755
index 000000000000..cb02274e3997
--- /dev/null
+++ b/toolkit/source/controls/spinningprogress.cxx
@@ -0,0 +1,140 @@
+/*************************************************************************
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include "toolkit/controls/spinningprogress.hxx"
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/unopropertyarrayhelper.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/throbber.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::beans::XPropertySetInfo;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= SpinningProgressControlModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::SpinningProgressControlModel( Reference< XMultiServiceFactory > const & i_factory )
+ :SpinningProgressControlModel_Base( i_factory )
+ {
+ // default image sets
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ try
+ {
+ Throbber::ImageSet aImageSets[] =
+ {
+ Throbber::IMAGES_16_PX, Throbber::IMAGES_32_PX, Throbber::IMAGES_64_PX
+ };
+ for ( size_t i=0; i < sizeof( aImageSets ) / sizeof( aImageSets[0] ); ++i )
+ {
+ const ::std::vector< ::rtl::OUString > aDefaultURLs( Throbber::getDefaultImageURLs( aImageSets[i] ) );
+ const Sequence< ::rtl::OUString > aImageURLs( &aDefaultURLs[0], aDefaultURLs.size() );
+ insertImageSet( i, aImageURLs );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource )
+ :SpinningProgressControlModel_Base( i_copySource )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::~SpinningProgressControlModel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlModel* SpinningProgressControlModel::Clone() const
+ {
+ return new SpinningProgressControlModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XPropertySetInfo > SAL_CALL SpinningProgressControlModel::getPropertySetInfo( ) throw(RuntimeException)
+ {
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SpinningProgressControlModel::getServiceName() throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SpinningProgressControlModel::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( "org.openoffice.comp.toolkit.SpinningProgressControlModel" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL SpinningProgressControlModel::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(3);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
+ aServiceNames[1] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ aServiceNames[2] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" );
+ return aServiceNames;
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
new file mode 100644
index 000000000000..222f98105c9a
--- /dev/null
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -0,0 +1,294 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include <toolkit/controls/tabpagecontainer.hxx>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <comphelper/processfactory.hxx>
+#include <osl/diagnose.h>
+#include <vcl/svapp.hxx>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <tools/diagnose_ex.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::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::view;
+
+#define WRONG_TYPE_EXCEPTION "Type must be ::com::sun::star::awt::tab::XTabPageModel!"
+// ----------------------------------------------------
+// class UnoControlTabPageContainerModel
+// ----------------------------------------------------
+UnoControlTabPageContainerModel::UnoControlTabPageContainerModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPageContainerModel_Base( i_factory )
+ ,maContainerListeners( *this )
+{
+ ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_BORDER );
+ ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
+ ImplRegisterProperty( BASEPROPERTY_TEXT );
+}
+
+::rtl::OUString UnoControlTabPageContainerModel::getServiceName() throw(RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel );
+}
+
+uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ switch(nPropId)
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainer ) );
+ case BASEPROPERTY_BORDER:
+ return uno::makeAny((sal_Int16) 0); // No Border
+ default:
+ return UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+}
+
+::cppu::IPropertyArrayHelper& UnoControlTabPageContainerModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ com::sun::star::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContainerModel::getPropertySetInfo( ) throw(RuntimeException)
+{
+ static Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex, const com::sun::star::uno::Any& aElement) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ uno::Reference < ::awt::tab::XTabPageModel > xTabPageModel;
+ if(aElement >>= xTabPageModel)
+ {
+ if ( sal_Int32( m_aTabPageVector.size()) ==nIndex )
+ m_aTabPageVector.push_back( xTabPageModel );
+ else if ( sal_Int32( m_aTabPageVector.size()) > nIndex )
+ {
+ std::vector< uno::Reference< ::awt::tab::XTabPageModel > >::iterator aIter = m_aTabPageVector.begin();
+ aIter += nIndex;
+ m_aTabPageVector.insert( aIter, xTabPageModel );
+ }
+ else
+ throw IndexOutOfBoundsException( ::rtl::OUString(), (OWeakObject *)this );
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElement;
+ aEvent.Accessor <<= ::rtl::OUString::valueOf(nIndex);
+ maContainerListeners.elementInserted( aEvent );
+ }
+ else
+ throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( WRONG_TYPE_EXCEPTION )),
+ (OWeakObject *)this, 2 );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL UnoControlTabPageContainerModel::removeByIndex( ::sal_Int32 /*Index*/ ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+// XIndexReplace
+void SAL_CALL UnoControlTabPageContainerModel::replaceByIndex( ::sal_Int32 /*Index*/, const uno::Any& /*Element*/ ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL UnoControlTabPageContainerModel::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return sal_Int32( m_aTabPageVector.size());
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL UnoControlTabPageContainerModel::getByIndex( ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( nIndex < 0 || nIndex > sal_Int32(m_aTabPageVector.size()) )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny(m_aTabPageVector[nIndex]);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL UnoControlTabPageContainerModel::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< Reference< com::sun::star::awt::XControlModel>* >(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL UnoControlTabPageContainerModel::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return !m_aTabPageVector.empty();
+}
+// XContainer
+void UnoControlTabPageContainerModel::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.addInterface( l );
+}
+
+void UnoControlTabPageContainerModel::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.removeInterface( l );
+}
+
+// ----------------------------------------------------
+// class UnoControlTabPageContainer
+// ----------------------------------------------------
+UnoControlTabPageContainer::UnoControlTabPageContainer( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPageContainer_Base( i_factory )
+ ,m_aTabPageListeners( *this )
+{
+}
+
+OUString UnoControlTabPageContainer::GetComponentServiceName()
+{
+ return OUString::createFromAscii( "TabPageContainer" );
+}
+
+void SAL_CALL UnoControlTabPageContainer::dispose( ) throw(RuntimeException)
+{
+ lang::EventObject aEvt;
+ aEvt.Source = (::cppu::OWeakObject*)this;
+ m_aTabPageListeners.disposeAndClear( aEvt );
+ UnoControl::dispose();
+}
+
+void UnoControlTabPageContainer::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
+{
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
+
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ if ( m_aTabPageListeners.getLength() )
+ xTPContainer->addTabPageListener(&m_aTabPageListeners);
+}
+
+// -------------------------------------------------------------------
+// XTabPageContainer
+
+::sal_Int16 SAL_CALL UnoControlTabPageContainer::getActiveTabPageID() throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getActiveTabPageID();
+}
+void SAL_CALL UnoControlTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ xTPContainer->setActiveTabPageID(_activetabpageid);
+}
+::sal_Int32 SAL_CALL UnoControlTabPageContainer::getTabPageCount( ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPageCount();
+}
+::sal_Bool SAL_CALL UnoControlTabPageContainer::isTabPageActive( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->isTabPageActive(tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL UnoControlTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPage(tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL UnoControlTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPageByID(tabPageID);
+}
+void SAL_CALL UnoControlTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.addInterface( listener );
+ if( getPeer().is() && m_aTabPageListeners.getLength() == 1 )
+ {
+ uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY );
+ xTabPageContainer->addTabPageListener( &m_aTabPageListeners );
+ }
+}
+void SAL_CALL UnoControlTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ if( getPeer().is() && m_aTabPageListeners.getLength() == 1 )
+ {
+ uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY );
+ xTabPageContainer->addTabPageListener( &m_aTabPageListeners );
+ }
+ m_aTabPageListeners.removeInterface( listener );
+}
+
+void UnoControlTabPageContainer::updateFromModel()
+{
+ UnoControlTabPageContainer_Base::updateFromModel();
+ Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY );
+ ENSURE_OR_RETURN_VOID( xContainerListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" );
+
+ ContainerEvent aEvent;
+ aEvent.Source = getModel();
+ Sequence< Reference< XControl > > aControls = getControls();
+ const Reference< XControl >* pCtrls = aControls.getConstArray();
+ const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
+
+ for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
+ {
+ aEvent.Element <<= *pCtrls;
+ xContainerListener->elementInserted( aEvent );
+ }
+}
+void SAL_CALL UnoControlTabPageContainer::addControl( const ::rtl::OUString& Name, const Reference< ::com::sun::star::awt::XControl >& Control ) throw (RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ ControlContainerBase::addControl(Name,Control);
+ Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY );
+ ContainerEvent aEvent;
+ aEvent.Source = getModel();
+ aEvent.Element <<= Control;
+ xContainerListener->elementInserted( aEvent );
+}
+
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
new file mode 100644
index 000000000000..74e3c6b01000
--- /dev/null
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -0,0 +1,395 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER 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_toolkit.hxx"
+
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/wall.hxx>
+#include <toolkit/controls/tabpagemodel.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/controls/stdtabcontroller.hxx>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/awt/UnoControlDialogModelProvider.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <tools/list.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/sequence.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/image.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+
+#include <map>
+#include <algorithm>
+#include <functional>
+#include "tools/urlobj.hxx"
+#include "osl/file.hxx"
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+
+////HELPER
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
+
+// ----------------------------------------------------
+// class TabPageModel
+// ----------------------------------------------------
+
+//TabPageModel::TabPageModel()
+//{
+//}
+//TabPageModel::TabPageModel( uno::Reference< uno::XComponentContext > const & xCompContext)
+//{
+// (void) xCompContext;
+//}
+//
+//TabPageModel::~TabPageModel()
+//{
+//}
+//
+//////----- XInitialization -------------------------------------------------------------------
+//void SAL_CALL TabPageModel::initialize (const Sequence<Any>& rArguments)
+//{
+// sal_Int16 nPageId;
+// if ( rArguments.getLength() == 1 )
+// {
+// if ( !( rArguments[ 0 ] >>= nPageId ))
+// throw lang::IllegalArgumentException();
+// m_nTabPageId = nPageId;
+// }
+// else
+// m_nTabPageId = -1;
+//}
+//::sal_Int16 SAL_CALL TabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_nTabPageId;
+//}
+//::sal_Bool SAL_CALL TabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_bEnabled;
+//}
+//void SAL_CALL TabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_bEnabled = _enabled;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sTitle;
+//}
+//void SAL_CALL TabPageModel::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sTitle = _title;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sImageURL;
+//}
+//void SAL_CALL TabPageModel::setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sImageURL = _imageurl;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sTooltip;
+//}
+//void SAL_CALL TabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sTooltip = _tooltip;
+//}
+
+// ----------------------------------------------------
+// class UnoControlTabPageModel
+// ----------------------------------------------------
+UnoControlTabPageModel::UnoControlTabPageModel( Reference< XMultiServiceFactory > const & i_factory )
+ :ControlModelContainerBase( i_factory )
+{
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_TITLE );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+}
+
+::rtl::OUString UnoControlTabPageModel::getServiceName( ) throw(RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageModel );
+}
+
+Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ Any aAny;
+
+ switch ( nPropId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPage );
+ break;
+ default:
+ aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+
+ return aAny;
+}
+
+::cppu::IPropertyArrayHelper& UnoControlTabPageModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+// beans::XMultiPropertySet
+uno::Reference< beans::XPropertySetInfo > UnoControlTabPageModel::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+////----- XInitialization -------------------------------------------------------------------
+void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nPageId = -1;
+ if ( rArguments.getLength() == 1 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ }
+ else if ( rArguments.getLength() == 2 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ ::rtl::OUString sURL;
+ if ( !( rArguments[ 1 ] >>= sURL ))
+ throw lang::IllegalArgumentException();
+ Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( maContext.getUNOContext(),sURL);
+ if ( xDialogModel.is() )
+ {
+ Sequence< ::rtl::OUString> aNames = xDialogModel->getElementNames();
+ const ::rtl::OUString* pIter = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aNames.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ try
+ {
+ Any aElement(xDialogModel->getByName(*pIter));
+ xDialogModel->removeByName(*pIter);
+ insertByName(*pIter,aElement);
+ }
+ catch(const Exception& ex)
+ {
+ (void)ex;
+ }
+ }
+ Reference<XPropertySet> xDialogProp(xDialogModel,UNO_QUERY);
+ if ( xDialogProp.is() )
+ {
+ static const ::rtl::OUString s_sResourceResolver(RTL_CONSTASCII_USTRINGPARAM("ResourceResolver"));
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ xThis->setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_IMAGEURL),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_IMAGEURL)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_HELPURL),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_HELPURL)));
+ }
+ }
+ }
+ else
+ m_nTabPageId = -1;
+}
+//===== Service ===============================================================
+::rtl::OUString UnoControlTabPageModel_getImplementationName (void) throw(RuntimeException)
+{
+ return rtl::OUString::createFromAscii("com.sun.star.awt.tab.UnoControlTabPageModel");
+}
+
+Sequence<rtl::OUString> SAL_CALL UnoControlTabPageModel_getSupportedServiceNames (void)
+ throw (RuntimeException)
+{
+ static const ::rtl::OUString sServiceName(
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.tab.UnoControlTabPageModel"));
+ return Sequence<rtl::OUString>(&sServiceName, 1);
+}
+//=============================================================================
+// = class UnoControlTabPage
+// ============================================================================
+
+UnoControlTabPage::UnoControlTabPage( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPage_Base( i_factory )
+ ,m_bWindowListener(false)
+{
+ maComponentInfos.nWidth = 280;
+ maComponentInfos.nHeight = 400;
+}
+UnoControlTabPage::~UnoControlTabPage()
+{
+}
+
+::rtl::OUString UnoControlTabPage::GetComponentServiceName()
+{
+ return ::rtl::OUString::createFromAscii( "TabPageModel" );
+}
+
+void UnoControlTabPage::dispose() throw(RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+
+ EventObject aEvt;
+ aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
+ ControlContainerBase::dispose();
+}
+
+void SAL_CALL UnoControlTabPage::disposing( const EventObject& Source )throw(RuntimeException)
+{
+ ControlContainerBase::disposing( Source );
+}
+
+void UnoControlTabPage::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
+{
+ SolarMutexGuard aSolarGuard;
+ ImplUpdateResourceResolver();
+
+ UnoControlContainer::createPeer( rxToolkit, rParentPeer );
+
+ Reference < tab::XTabPage > xTabPage( getPeer(), UNO_QUERY );
+ if ( xTabPage.is() )
+ {
+ if ( !m_bWindowListener )
+ {
+ Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
+ addWindowListener( xWL );
+ m_bWindowListener = true;
+ }
+ }
+}
+
+static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
+{
+ ::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
+ return aTmp;
+}
+// ::com::sun::star::awt::XWindowListener
+void SAL_CALL UnoControlTabPage::windowResized( const ::com::sun::star::awt::WindowEvent& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ DBG_ASSERT( pOutDev, "Missing Default Device!" );
+ if ( pOutDev && !mbSizeModified )
+ {
+ // Currentley we are simply using MAP_APPFONT
+ ::Size aAppFontSize( e.Width, e.Height );
+
+ Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
+ Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
+ OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
+ if ( xDialogDevice.is() )
+ {
+ DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
+ aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
+ aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
+ }
+
+ aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbSizeModified = true;
+ Sequence< rtl::OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ // Properties in a sequence must be sorted!
+ aProps[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ));
+ aProps[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ));
+ aValues[0] <<= aAppFontSize.Height();
+ aValues[1] <<= aAppFontSize.Width();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbSizeModified = false;
+ }
+}
+
+void SAL_CALL UnoControlTabPage::windowMoved( const ::com::sun::star::awt::WindowEvent& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ DBG_ASSERT( pOutDev, "Missing Default Device!" );
+ if ( pOutDev && !mbPosModified )
+ {
+ // Currentley we are simply using MAP_APPFONT
+ Any aAny;
+ ::Size aTmp( e.X, e.Y );
+ aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbPosModified = true;
+ Sequence< rtl::OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ aProps[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ));
+ aProps[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ));
+ aValues[0] <<= aTmp.Width();
+ aValues[1] <<= aTmp.Height();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbPosModified = false;
+ }
+}
+
+void SAL_CALL UnoControlTabPage::windowShown( const ::com::sun::star::lang::EventObject& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)e;
+}
+
+void SAL_CALL UnoControlTabPage::windowHidden( const ::com::sun::star::lang::EventObject& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)e;
+}
diff --git a/toolkit/source/controls/tkscrollbar.cxx b/toolkit/source/controls/tkscrollbar.cxx
index 179cbe17b9ab..d32a849ae0e8 100644
--- a/toolkit/source/controls/tkscrollbar.cxx
+++ b/toolkit/source/controls/tkscrollbar.cxx
@@ -48,7 +48,8 @@ namespace toolkit
//= UnoControlScrollBarModel
//====================================================================
//--------------------------------------------------------------------
- UnoControlScrollBarModel::UnoControlScrollBarModel()
+ UnoControlScrollBarModel::UnoControlScrollBarModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXScrollBar );
}
@@ -97,8 +98,9 @@ namespace toolkit
//====================================================================
//= UnoControlScrollBarModel
//====================================================================
- UnoScrollBarControl::UnoScrollBarControl()
- : maAdjustmentListeners( *this )
+ UnoScrollBarControl::UnoScrollBarControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maAdjustmentListeners( *this )
{
}
diff --git a/toolkit/source/controls/tksimpleanimation.cxx b/toolkit/source/controls/tksimpleanimation.cxx
index 2ac9d1f1d478..e5760c215ce2 100644
--- a/toolkit/source/controls/tksimpleanimation.cxx
+++ b/toolkit/source/controls/tksimpleanimation.cxx
@@ -45,7 +45,8 @@ namespace toolkit
//= UnoSimpleAnimationControlModel
//====================================================================
//--------------------------------------------------------------------
- UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel()
+ UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
ImplRegisterProperty( BASEPROPERTY_REPEAT );
@@ -120,7 +121,8 @@ namespace toolkit
//= UnoSimpleAnimationControl
//====================================================================
//--------------------------------------------------------------------
- UnoSimpleAnimationControl::UnoSimpleAnimationControl()
+ UnoSimpleAnimationControl::UnoSimpleAnimationControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoSimpleAnimationControl_Base( i_factory )
{
}
@@ -131,27 +133,6 @@ namespace toolkit
}
//--------------------------------------------------------------------
- uno::Any UnoSimpleAnimationControl::queryAggregation( const uno::Type & rType )
- throw( uno::RuntimeException )
- {
- uno::Any aRet = UnoControlBase::queryAggregation( rType );
- if ( !aRet.hasValue() )
- aRet = UnoSimpleAnimationControl_Base::queryInterface( rType );
- return aRet;
- }
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoSimpleAnimationControl, UnoControlBase, UnoSimpleAnimationControl_Base )
-
- //--------------------------------------------------------------------
- void UnoSimpleAnimationControl::dispose() throw( uno::RuntimeException )
- {
- ::osl::ClearableMutexGuard aGuard( GetMutex() );
-
- UnoControl::dispose();
- }
-
- //--------------------------------------------------------------------
::rtl::OUString SAL_CALL UnoSimpleAnimationControl::getImplementationName()
throw( uno::RuntimeException )
{
@@ -162,26 +143,20 @@ namespace toolkit
uno::Sequence< ::rtl::OUString > SAL_CALL UnoSimpleAnimationControl::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- uno::Sequence< ::rtl::OUString > aServices( UnoControlBase::getSupportedServiceNames() );
+ uno::Sequence< ::rtl::OUString > aServices( UnoSimpleAnimationControl_Base::getSupportedServiceNames() );
aServices.realloc( aServices.getLength() + 1 );
aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName_UnoSimpleAnimationControl );
return aServices;
}
//--------------------------------------------------------------------
- void UnoSimpleAnimationControl::createPeer( const uno::Reference< awt::XToolkit > &rxToolkit,
- const uno::Reference< awt::XWindowPeer > &rParentPeer )
- throw( uno::RuntimeException )
- {
- UnoControl::createPeer( rxToolkit, rParentPeer );
- }
-
- //--------------------------------------------------------------------
void SAL_CALL UnoSimpleAnimationControl::start() throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->start();
}
@@ -189,9 +164,11 @@ namespace toolkit
//--------------------------------------------------------------------
void SAL_CALL UnoSimpleAnimationControl::stop() throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->stop();
}
@@ -200,9 +177,11 @@ namespace toolkit
void SAL_CALL UnoSimpleAnimationControl::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& ImageList )
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->setImageList( ImageList );
}
diff --git a/toolkit/source/controls/tkspinbutton.cxx b/toolkit/source/controls/tkspinbutton.cxx
index 6006c6514161..2dc7c14b78bd 100644
--- a/toolkit/source/controls/tkspinbutton.cxx
+++ b/toolkit/source/controls/tkspinbutton.cxx
@@ -51,7 +51,8 @@ namespace toolkit
//= UnoSpinButtonModel
//====================================================================
//--------------------------------------------------------------------
- UnoSpinButtonModel::UnoSpinButtonModel()
+ UnoSpinButtonModel::UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -138,8 +139,9 @@ namespace toolkit
//= UnoSpinButtonControl
//====================================================================
//--------------------------------------------------------------------
- UnoSpinButtonControl::UnoSpinButtonControl()
- :maAdjustmentListeners( *this )
+ UnoSpinButtonControl::UnoSpinButtonControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maAdjustmentListeners( *this )
{
}
diff --git a/toolkit/source/controls/tkthrobber.cxx b/toolkit/source/controls/tkthrobber.cxx
index b93ccda7c5ba..a70b7acc8175 100644
--- a/toolkit/source/controls/tkthrobber.cxx
+++ b/toolkit/source/controls/tkthrobber.cxx
@@ -45,7 +45,8 @@ namespace toolkit
//= UnoThrobberControlModel
//====================================================================
//--------------------------------------------------------------------
- UnoThrobberControlModel::UnoThrobberControlModel()
+ UnoThrobberControlModel::UnoThrobberControlModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BORDER );
ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
@@ -118,7 +119,8 @@ namespace toolkit
//= UnoThrobberControl
//====================================================================
//--------------------------------------------------------------------
- UnoThrobberControl::UnoThrobberControl()
+ UnoThrobberControl::UnoThrobberControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
}
diff --git a/toolkit/source/controls/tree/makefile.mk b/toolkit/source/controls/tree/makefile.mk
deleted file mode 100644
index 4e72b62b416b..000000000000
--- a/toolkit/source/controls/tree/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=toolkit
-TARGET=tree
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/treecontrol.obj\
- $(SLO)$/treedatamodel.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/toolkit/source/controls/tree/treecontrol.cxx b/toolkit/source/controls/tree/treecontrol.cxx
index 4e5fa657c33e..81d2c41f6139 100644
--- a/toolkit/source/controls/tree/treecontrol.cxx
+++ b/toolkit/source/controls/tree/treecontrol.cxx
@@ -54,7 +54,8 @@ namespace toolkit
// ----------------------------------------------------
// class UnoTreeModel
// ----------------------------------------------------
-UnoTreeModel::UnoTreeModel()
+UnoTreeModel::UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -73,7 +74,7 @@ UnoTreeModel::UnoTreeModel()
ImplRegisterProperty( BASEPROPERTY_TREE_ROOTDISPLAYED );
ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSHANDLES );
ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES );
- ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT );
ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING );
ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
}
@@ -99,7 +100,7 @@ Any UnoTreeModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
case BASEPROPERTY_TREE_SELECTIONTYPE:
return Any( SelectionType_NONE );
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( sal_Int32( 0 ) );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( Reference< XTreeDataModel >( 0 ) );
@@ -139,8 +140,9 @@ Reference< XPropertySetInfo > UnoTreeModel::getPropertySetInfo( ) throw(Runtime
// ----------------------------------------------------
// class UnoTreeControl
// ----------------------------------------------------
-UnoTreeControl::UnoTreeControl()
-: maSelectionListeners( *this )
+UnoTreeControl::UnoTreeControl( const Reference< XMultiServiceFactory >& i_factory )
+: UnoTreeControl_Base( i_factory )
+, maSelectionListeners( *this )
, maTreeExpansionListeners( *this )
, maTreeEditListeners( *this )
{
@@ -451,14 +453,14 @@ void UnoTreeControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolk
}
-Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl( i_factory ) );
}
-Reference< XInterface > SAL_CALL TreeControlModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL TreeControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel( i_factory ) );
}
void SAL_CALL TreeEditListenerMultiplexer::nodeEditing( const Reference< XTreeNode >& Node ) throw (RuntimeException, ::com::sun::star::util::VetoException)
diff --git a/toolkit/source/controls/tree/treecontrol.hxx b/toolkit/source/controls/tree/treecontrol.hxx
index a6f037f9c56a..61f6f6e59d71 100644
--- a/toolkit/source/controls/tree/treecontrol.hxx
+++ b/toolkit/source/controls/tree/treecontrol.hxx
@@ -55,7 +55,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoTreeModel();
+ UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoTreeModel( const UnoTreeModel& rModel );
UnoControlModel* Clone() const;
@@ -74,10 +74,11 @@ public:
// ===================================================================
// = UnoTreeControl
// ===================================================================
-class UnoTreeControl : public ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::tree::XTreeControl >
+typedef ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::tree::XTreeControl > UnoTreeControl_Base;
+class UnoTreeControl : public UnoTreeControl_Base
{
public:
- UnoTreeControl();
+ UnoTreeControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XComponent
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index d0bae3c244c3..d759e05e318d 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -51,6 +51,7 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <comphelper/stl_types.hxx>
+#include <comphelper/processfactory.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/servicenames.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -163,7 +164,26 @@ struct UnoControl_Data
// ----------------------------------------------------
DBG_NAME( UnoControl )
UnoControl::UnoControl()
- : maDisposeListeners( *this )
+ :maContext( ::comphelper::getProcessServiceFactory() )
+ ,maDisposeListeners( *this )
+ ,maWindowListeners( *this )
+ ,maFocusListeners( *this )
+ ,maKeyListeners( *this )
+ ,maMouseListeners( *this )
+ ,maMouseMotionListeners( *this )
+ ,maPaintListeners( *this )
+ ,maModeChangeListeners( GetMutex() )
+ ,mpData( new UnoControl_Data )
+{
+ DBG_CTOR( UnoControl, NULL );
+ OSL_ENSURE( false, "UnoControl::UnoControl: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+}
+
+UnoControl::UnoControl( const Reference< XMultiServiceFactory >& i_factory )
+ : maContext( i_factory )
+ , maDisposeListeners( *this )
, maWindowListeners( *this )
, maFocusListeners( *this )
, maKeyListeners( *this )
diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx
index 254fefe54cd0..c2622946009b 100644
--- a/toolkit/source/controls/unocontrolbase.cxx
+++ b/toolkit/source/controls/unocontrolbase.cxx
@@ -33,6 +33,7 @@
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/helper/property.hxx>
+#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
@@ -40,6 +41,14 @@
// class UnoControlBase
// ----------------------------------------------------
+UnoControlBase::UnoControlBase()
+ :UnoControl( ::comphelper::getProcessServiceFactory() )
+{
+ OSL_ENSURE( false, "UnoControlBase::UnoControlBase: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+}
+
sal_Bool UnoControlBase::ImplHasProperty( sal_uInt16 nPropId )
{
::rtl::OUString aPropName( GetPropertyName( nPropId ) );
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index b67ec421db96..c73bd401bf51 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -410,13 +410,16 @@ void SAL_CALL DialogStepChangedListener::propertyChange( const beans::PropertyC
// ----------------------------------------------------
// class UnoControlContainer
// ----------------------------------------------------
-UnoControlContainer::UnoControlContainer() : maCListeners( *this )
+UnoControlContainer::UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlContainer_Base( i_factory )
+ ,maCListeners( *this )
{
mpControls = new UnoControlHolderList;
}
-UnoControlContainer::UnoControlContainer( uno::Reference< awt::XWindowPeer > xP )
- : maCListeners( *this )
+UnoControlContainer::UnoControlContainer( const uno::Reference< lang::XMultiServiceFactory >& i_factory, const uno::Reference< awt::XWindowPeer >& xP )
+ :UnoControlContainer_Base( i_factory )
+ ,maCListeners( *this )
{
setPeer( xP );
mbDisposePeer = sal_False;
diff --git a/toolkit/source/controls/unocontrolcontainermodel.cxx b/toolkit/source/controls/unocontrolcontainermodel.cxx
index c29886dadf5f..a3fba37b273b 100644
--- a/toolkit/source/controls/unocontrolcontainermodel.cxx
+++ b/toolkit/source/controls/unocontrolcontainermodel.cxx
@@ -37,7 +37,8 @@
// ----------------------------------------------------
// class UnoControlContainerModel
// ----------------------------------------------------
-UnoControlContainerModel::UnoControlContainerModel()
+UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index c261f3d97def..a101d9fd8793 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -42,7 +42,6 @@
#include <toolkit/controls/unocontrolmodel.hxx>
#include <toolkit/helper/macros.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/extract.hxx>
#include <rtl/memory.h>
#include <rtl/uuid.h>
#include <tools/diagnose_ex.h>
@@ -60,6 +59,7 @@
#include <unotools/configmgr.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/extract.hxx>
#include <vcl/svapp.hxx>
#include <uno/data.h>
@@ -155,7 +155,24 @@ static void lcl_ImplMergeFontProperty( FontDescriptor& rFD, sal_uInt16 nPropId,
// class UnoControlModel
// ----------------------------------------------------
UnoControlModel::UnoControlModel()
- : OPropertySetHelper( BrdcstHelper ), maDisposeListeners( *this )
+ :UnoControlModel_Base()
+ ,MutexAndBroadcastHelper()
+ ,OPropertySetHelper( BrdcstHelper )
+ ,maDisposeListeners( *this )
+ ,maContext( ::comphelper::getProcessServiceFactory() )
+{
+ OSL_ENSURE( false, "UnoControlModel::UnoControlModel: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+ mpData = new ImplPropertyTable;
+}
+
+UnoControlModel::UnoControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel_Base()
+ ,MutexAndBroadcastHelper()
+ ,OPropertySetHelper( BrdcstHelper )
+ ,maDisposeListeners( *this )
+ ,maContext( i_factory )
{
// Die Properties muessen vom Model in die Tabelle gestopft werden,
// nur vorhandene Properties sind gueltige Properties, auch wenn VOID.
@@ -163,18 +180,11 @@ UnoControlModel::UnoControlModel()
}
UnoControlModel::UnoControlModel( const UnoControlModel& rModel )
- : XControlModel()
- , XPropertyState()
- , XPersistObject()
- , XComponent()
- , XServiceInfo()
- , XTypeProvider()
- , XUnoTunnel()
- , XCloneable()
+ : UnoControlModel_Base()
, MutexAndBroadcastHelper()
, OPropertySetHelper( BrdcstHelper )
- , OWeakAggObject()
, maDisposeListeners( *this )
+ , maContext( rModel.maContext )
{
mpData = new ImplPropertyTable;
@@ -405,7 +415,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
aLocale.Country = sDefaultCurrency.copy( nSepPos + 1 );
}
- LocaleDataWrapper aLocaleInfo( ::comphelper::getProcessServiceFactory(), aLocale );
+ LocaleDataWrapper aLocaleInfo( maContext.getLegacyServiceFactory(), aLocale );
if ( !sBankSymbol.getLength() )
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
@@ -488,36 +498,20 @@ void UnoControlModel::ImplRegisterProperties( const std::list< sal_uInt16 > &rId
// ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any UnoControlModel::queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::XControlModel*, this ),
- SAL_STATIC_CAST( ::com::sun::star::io::XPersistObject*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XComponent*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XServiceInfo*, this ),
- SAL_STATIC_CAST( ::com::sun::star::util::XCloneable*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XPropertyState*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XMultiPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XFastPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XUnoTunnel*, this ) );
- return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType ));
+ Any aRet = UnoControlModel_Base::queryAggregation( rType );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::OPropertySetHelper::queryInterface( rType );
+ return aRet;
}
// ::com::sun::star::lang::XUnoTunnel
IMPL_XUNOTUNNEL( UnoControlModel )
+// XInterface
+IMPLEMENT_FORWARD_REFCOUNT( UnoControlModel, UnoControlModel_Base )
+
// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( UnoControlModel )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>* ) NULL )
-IMPL_XTYPEPROVIDER_END
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoControlModel, UnoControlModel_Base, ::cppu::OPropertySetHelper )
uno::Reference< util::XCloneable > UnoControlModel::createClone() throw(::com::sun::star::uno::RuntimeException)
@@ -536,6 +530,8 @@ void UnoControlModel::dispose( ) throw(::com::sun::star::uno::RuntimeException)
aEvt.Source = (::com::sun::star::uno::XAggregation*)(::cppu::OWeakAggObject*)this;
maDisposeListeners.disposeAndClear( aEvt );
+ BrdcstHelper.aLC.disposeAndClear( aEvt );
+
// let the property set helper notify our property listeners
OPropertySetHelper::disposing();
}
@@ -1157,7 +1153,7 @@ sal_Bool UnoControlModel::convertFastPropertyValue( Any & rConvertedValue, Any &
}
else
{
- BOOL bConverted = FALSE;
+ sal_Bool bConverted = sal_False;
// 13.03.2001 - 84923 - frank.schoenheit@germany.sun.com
switch (pDestType->getTypeClass())
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index d7d651935bfc..480399241f48 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -43,7 +43,6 @@
#include <toolkit/controls/formattedcontrol.hxx>
#include <toolkit/controls/roadmapcontrol.hxx>
#include <toolkit/controls/unocontrols.hxx>
-#include <toolkit/controls/geometrycontrolmodel.hxx>
#include <toolkit/controls/stdtabcontroller.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
@@ -94,7 +93,8 @@ using namespace ::toolkit;
// ----------------------------------------------------
// class UnoControlEditModel
// ----------------------------------------------------
-UnoControlEditModel::UnoControlEditModel()
+UnoControlEditModel::UnoControlEditModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXEdit );
}
@@ -145,8 +145,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlEditModel::getPropertySetInf
// ----------------------------------------------------
// class UnoEditControl
// ----------------------------------------------------
-UnoEditControl::UnoEditControl()
- :maTextListeners( *this )
+UnoEditControl::UnoEditControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maTextListeners( *this )
,mnMaxTextLen( 0 )
,mbSetTextInPeer( sal_False )
,mbSetMaxTextLenInPeer( sal_False )
@@ -155,7 +156,7 @@ UnoEditControl::UnoEditControl()
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
mnMaxTextLen = 0;
- mbSetMaxTextLenInPeer = FALSE;
+ mbSetMaxTextLenInPeer = sal_False;
}
uno::Any SAL_CALL UnoEditControl::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
@@ -459,7 +460,8 @@ void UnoEditControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) t
// ----------------------------------------------------
// class UnoControlFileControlModel
// ----------------------------------------------------
-UnoControlFileControlModel::UnoControlFileControlModel()
+UnoControlFileControlModel::UnoControlFileControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_ALIGN );
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
@@ -518,7 +520,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFileControlModel::getPropert
// ----------------------------------------------------
// class UnoFileControl
// ----------------------------------------------------
-UnoFileControl::UnoFileControl()
+UnoFileControl::UnoFileControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
{
}
@@ -537,7 +540,8 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
- uno::Reference< graphic::XGraphic > ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const ::rtl::OUString& _rURL )
+
+ uno::Reference< graphic::XGraphic > GraphicControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
{
uno::Reference< graphic::XGraphic > xGraphic;
@@ -546,20 +550,18 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
// graphic manager uniqueid
rtl::OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
// get the DefaultContext
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- xOutGraphicObj = graphic::GraphicObject::createWithId( aContext.getUNOContext(), sID );
+ mxGrfObj = graphic::GraphicObject::createWithId( maContext.getUNOContext(), sID );
}
else // linked
- xOutGraphicObj = NULL; // release the GraphicObject
+ mxGrfObj = NULL; // release the GraphicObject
if ( !_rURL.getLength() )
return xGraphic;
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
uno::Reference< graphic::XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ if ( maContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
{
uno::Sequence< beans::PropertyValue > aMediaProperties(1);
aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
@@ -575,7 +577,6 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return xGraphic;
}
-
void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
{
UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
@@ -592,7 +593,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingGraphic = true;
::rtl::OUString sImageURL;
OSL_VERIFY( rValue >>= sImageURL );
- setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_GRAPHIC, uno::makeAny( getGraphicFromURL_nothrow( sImageURL ) ) );
mbAdjustingGraphic = false;
}
break;
@@ -601,7 +602,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
if ( !mbAdjustingGraphic && ImplHasProperty( BASEPROPERTY_IMAGEURL ) )
{
mbAdjustingGraphic = true;
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ), uno::makeAny( ::rtl::OUString() ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEURL, uno::makeAny( ::rtl::OUString() ) );
mbAdjustingGraphic = false;
}
break;
@@ -612,7 +613,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEPOSITION ), uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEPOSITION, uno::makeAny( getExtendedImagePosition( nUNOValue ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -622,7 +623,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
mbAdjustingImagePosition = true;
sal_Int16 nUNOValue = 0;
OSL_VERIFY( rValue >>= nUNOValue );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEALIGN ), uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGEALIGN, uno::makeAny( getCompatibleImageAlign( translateImagePosition( nUNOValue ) ) ) );
mbAdjustingImagePosition = false;
}
break;
@@ -638,7 +639,8 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
-UnoControlButtonModel::UnoControlButtonModel()
+UnoControlButtonModel::UnoControlButtonModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXButton );
@@ -694,9 +696,10 @@ uno::Reference< beans::XPropertySetInfo > UnoControlButtonModel::getPropertySetI
// ----------------------------------------------------
// class UnoButtonControl
// ----------------------------------------------------
-UnoButtonControl::UnoButtonControl()
- : maActionListeners( *this )
- , maItemListeners( *this )
+UnoButtonControl::UnoButtonControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoButtonControl_Base( i_factory )
+ ,maActionListeners( *this )
+ ,maItemListeners( *this )
{
maComponentInfos.nWidth = 50;
maComponentInfos.nHeight = 14;
@@ -833,8 +836,9 @@ awt::Size UnoButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) throw(
// ----------------------------------------------------
// class UnoControlImageControlModel
// ----------------------------------------------------
-UnoControlImageControlModel::UnoControlImageControlModel()
- :mbAdjustingImageScaleMode( false )
+UnoControlImageControlModel::UnoControlImageControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
+ ,mbAdjustingImageScaleMode( false )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXImageControl );
}
@@ -888,7 +892,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Int16 nScaleMode( awt::ImageScaleMode::Anisotropic );
OSL_VERIFY( _rValue >>= nScaleMode );
- setPropertyValue( GetPropertyName( BASEPROPERTY_SCALEIMAGE ), uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
+ setDependentFastPropertyValue( BASEPROPERTY_SCALEIMAGE, uno::makeAny( sal_Bool( nScaleMode != awt::ImageScaleMode::None ) ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -898,7 +902,7 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
mbAdjustingImageScaleMode = true;
sal_Bool bScale = sal_True;
OSL_VERIFY( _rValue >>= bScale );
- setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
+ setDependentFastPropertyValue( BASEPROPERTY_IMAGE_SCALE_MODE, uno::makeAny( bScale ? awt::ImageScaleMode::Anisotropic : awt::ImageScaleMode::None ) );
mbAdjustingImageScaleMode = false;
}
break;
@@ -914,8 +918,9 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
// ----------------------------------------------------
// class UnoImageControlControl
// ----------------------------------------------------
-UnoImageControlControl::UnoImageControlControl()
- : maActionListeners( *this )
+UnoImageControlControl::UnoImageControlControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoImageControlControl_Base( i_factory )
+ ,maActionListeners( *this )
{
// Woher die Defaults nehmen?
maComponentInfos.nWidth = 100;
@@ -958,7 +963,8 @@ awt::Size UnoImageControlControl::calcAdjustedSize( const awt::Size& rNewSize )
// ----------------------------------------------------
// class UnoControlRadioButtonModel
// ----------------------------------------------------
-UnoControlRadioButtonModel::UnoControlRadioButtonModel()
+UnoControlRadioButtonModel::UnoControlRadioButtonModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXRadioButton );
}
@@ -1005,8 +1011,10 @@ uno::Reference< beans::XPropertySetInfo > UnoControlRadioButtonModel::getPropert
// ----------------------------------------------------
// class UnoRadioButtonControl
// ----------------------------------------------------
-UnoRadioButtonControl::UnoRadioButtonControl()
- : maItemListeners( *this ), maActionListeners( *this )
+UnoRadioButtonControl::UnoRadioButtonControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoRadioButtonControl_Base( i_factory )
+ ,maItemListeners( *this )
+ ,maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1165,7 +1173,8 @@ awt::Size UnoRadioButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) t
// ----------------------------------------------------
// class UnoControlCheckBoxModel
// ----------------------------------------------------
-UnoControlCheckBoxModel::UnoControlCheckBoxModel()
+UnoControlCheckBoxModel::UnoControlCheckBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCheckBox );
}
@@ -1212,8 +1221,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCheckBoxModel::getPropertySe
// ----------------------------------------------------
// class UnoCheckBoxControl
// ----------------------------------------------------
-UnoCheckBoxControl::UnoCheckBoxControl()
- : maItemListeners( *this ), maActionListeners( *this )
+UnoCheckBoxControl::UnoCheckBoxControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoCheckBoxControl_Base( i_factory )
+ ,maItemListeners( *this ), maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1348,7 +1358,8 @@ awt::Size UnoCheckBoxControl::calcAdjustedSize( const awt::Size& rNewSize ) thro
// ----------------------------------------------------
// class UnoControlFixedHyperlinkModel
// ----------------------------------------------------
-UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel()
+UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedHyperlink );
}
@@ -1403,8 +1414,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedHyperlinkModel::getProp
// ----------------------------------------------------
// class UnoFixedHyperlinkControl
// ----------------------------------------------------
-UnoFixedHyperlinkControl::UnoFixedHyperlinkControl()
- : maActionListeners( *this )
+UnoFixedHyperlinkControl::UnoFixedHyperlinkControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1533,7 +1545,8 @@ void UnoFixedHyperlinkControl::removeActionListener(const uno::Reference< awt::X
// ----------------------------------------------------
// class UnoControlFixedTextModel
// ----------------------------------------------------
-UnoControlFixedTextModel::UnoControlFixedTextModel()
+UnoControlFixedTextModel::UnoControlFixedTextModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedText );
}
@@ -1583,7 +1596,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedTextModel::getPropertyS
// ----------------------------------------------------
// class UnoFixedTextControl
// ----------------------------------------------------
-UnoFixedTextControl::UnoFixedTextControl()
+UnoFixedTextControl::UnoFixedTextControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1663,7 +1677,8 @@ awt::Size UnoFixedTextControl::calcAdjustedSize( const awt::Size& rNewSize ) thr
// ----------------------------------------------------
// class UnoControlGroupBoxModel
// ----------------------------------------------------
-UnoControlGroupBoxModel::UnoControlGroupBoxModel()
+UnoControlGroupBoxModel::UnoControlGroupBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
ImplRegisterProperty( BASEPROPERTY_ENABLED );
@@ -1714,7 +1729,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlGroupBoxModel::getPropertySe
// ----------------------------------------------------
// class UnoGroupBoxControl
// ----------------------------------------------------
-UnoGroupBoxControl::UnoGroupBoxControl()
+UnoGroupBoxControl::UnoGroupBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 100;
@@ -1801,6 +1817,11 @@ struct UnoControlListBoxModel_Data
return aItems;
}
+ void copyItems( const UnoControlListBoxModel_Data& i_copySource )
+ {
+ m_aListItems = i_copySource.m_aListItems;
+ }
+
void setAllItems( const ::std::vector< ListItem >& i_rItems )
{
m_aListItems = i_rItems;
@@ -1831,27 +1852,23 @@ private:
// = UnoControlListBoxModel
// =====================================================================================================================
// ---------------------------------------------------------------------------------------------------------------------
-UnoControlListBoxModel::UnoControlListBoxModel()
- :UnoControlListBoxModel_Base()
- ,m_pData( new UnoControlListBoxModel_Data( *this ) )
- ,m_aItemListListeners( GetMutex() )
-{
- UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
-}
-// ---------------------------------------------------------------------------------------------------------------------
-UnoControlListBoxModel::UnoControlListBoxModel(bool)
- :UnoControlListBoxModel_Base()
+UnoControlListBoxModel::UnoControlListBoxModel( const Reference< XMultiServiceFactory >& i_factory, ConstructorMode const i_mode )
+ :UnoControlListBoxModel_Base( i_factory )
,m_pData( new UnoControlListBoxModel_Data( *this ) )
,m_aItemListListeners( GetMutex() )
{
+ if ( i_mode == ConstructDefault )
+ {
+ UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
+ }
}
-
// ---------------------------------------------------------------------------------------------------------------------
UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource )
:UnoControlListBoxModel_Base( i_rSource )
,m_pData( new UnoControlListBoxModel_Data( *this ) )
,m_aItemListListeners( GetMutex() )
{
+ m_pData->copyItems( *i_rSource.m_pData );
}
UnoControlListBoxModel::~UnoControlListBoxModel()
{
@@ -1862,6 +1879,7 @@ IMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName
{
return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel );
}
+
// ---------------------------------------------------------------------------------------------------------------------
uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
@@ -1917,7 +1935,7 @@ void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int3
uno::Sequence<sal_Int16> aSeq;
uno::Any aAny;
aAny <<= aSeq;
- setPropertyValue( GetPropertyName( BASEPROPERTY_SELECTEDITEMS ), aAny );
+ setDependentFastPropertyValue( BASEPROPERTY_SELECTEDITEMS, aAny );
if ( !m_pData->m_bSettingLegacyProperty )
{
@@ -2277,8 +2295,9 @@ void UnoControlListBoxModel::impl_notifyItemListEvent_nolck( const sal_Int32 i_n
// ----------------------------------------------------
// class UnoListBoxControl
// ----------------------------------------------------
-UnoListBoxControl::UnoListBoxControl()
- :maActionListeners( *this )
+UnoListBoxControl::UnoListBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoListBoxControl_Base( i_factory )
+ ,maActionListeners( *this )
,maItemListeners( *this )
{
maComponentInfos.nWidth = 100;
@@ -2707,7 +2726,8 @@ ItemListenerMultiplexer& UnoListBoxControl::getItemListeners()
// ----------------------------------------------------
// class UnoControlComboBoxModel
// ----------------------------------------------------
-UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true)
+UnoControlComboBoxModel::UnoControlComboBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlListBoxModel( i_factory, ConstructWithoutProperties )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox );
}
@@ -2782,9 +2802,10 @@ uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons
// ----------------------------------------------------
// class UnoComboBoxControl
// ----------------------------------------------------
-UnoComboBoxControl::UnoComboBoxControl()
- : maActionListeners( *this ),
- maItemListeners( *this )
+UnoComboBoxControl::UnoComboBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
+ ,maActionListeners( *this )
+ ,maItemListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -3102,7 +3123,9 @@ sal_Int16 UnoComboBoxControl::getDropDownLineCount() throw(uno::RuntimeException
// ----------------------------------------------------
// UnoSpinFieldControl
// ----------------------------------------------------
-UnoSpinFieldControl::UnoSpinFieldControl() : maSpinListeners( *this )
+UnoSpinFieldControl::UnoSpinFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
+ ,maSpinListeners( *this )
{
mbRepeat = sal_False;
}
@@ -3192,7 +3215,8 @@ void UnoSpinFieldControl::enableRepeat( sal_Bool bRepeat ) throw(::com::sun::sta
// ----------------------------------------------------
// class UnoControlDateFieldModel
// ----------------------------------------------------
-UnoControlDateFieldModel::UnoControlDateFieldModel()
+UnoControlDateFieldModel::UnoControlDateFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXDateField );
}
@@ -3237,7 +3261,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlDateFieldModel::getPropertyS
// ----------------------------------------------------
// class UnoDateFieldControl
// ----------------------------------------------------
-UnoDateFieldControl::UnoDateFieldControl()
+UnoDateFieldControl::UnoDateFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = Date( 1, 1, 1900 ).GetDate();
mnLast = Date( 31, 12, 2200 ).GetDate();
@@ -3432,7 +3457,8 @@ sal_Bool UnoDateFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlTimeFieldModel
// ----------------------------------------------------
-UnoControlTimeFieldModel::UnoControlTimeFieldModel()
+UnoControlTimeFieldModel::UnoControlTimeFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXTimeField );
}
@@ -3477,7 +3503,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlTimeFieldModel::getPropertyS
// ----------------------------------------------------
// class UnoTimeFieldControl
// ----------------------------------------------------
-UnoTimeFieldControl::UnoTimeFieldControl()
+UnoTimeFieldControl::UnoTimeFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = Time( 0, 0 ).GetTime();
mnLast = Time( 23, 59, 59, 99 ).GetTime();
@@ -3631,7 +3658,8 @@ sal_Bool UnoTimeFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlNumericFieldModel
// ----------------------------------------------------
-UnoControlNumericFieldModel::UnoControlNumericFieldModel()
+UnoControlNumericFieldModel::UnoControlNumericFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXNumericField );
}
@@ -3676,7 +3704,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlNumericFieldModel::getProper
// ----------------------------------------------------
// class UnoNumericFieldControl
// ----------------------------------------------------
-UnoNumericFieldControl::UnoNumericFieldControl()
+UnoNumericFieldControl::UnoNumericFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = 0;
mnLast = 0x7FFFFFFF;
@@ -3827,7 +3856,8 @@ sal_Int16 UnoNumericFieldControl::getDecimalDigits() throw(uno::RuntimeException
// ----------------------------------------------------
// class UnoControlCurrencyFieldModel
// ----------------------------------------------------
-UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel()
+UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCurrencyField );
}
@@ -3876,7 +3906,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCurrencyFieldModel::getPrope
// ----------------------------------------------------
// class UnoCurrencyFieldControl
// ----------------------------------------------------
-UnoCurrencyFieldControl::UnoCurrencyFieldControl()
+UnoCurrencyFieldControl::UnoCurrencyFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = 0;
mnLast = 0x7FFFFFFF;
@@ -4026,7 +4057,8 @@ sal_Int16 UnoCurrencyFieldControl::getDecimalDigits() throw(uno::RuntimeExceptio
// ----------------------------------------------------
// class UnoControlPatternFieldModel
// ----------------------------------------------------
-UnoControlPatternFieldModel::UnoControlPatternFieldModel()
+UnoControlPatternFieldModel::UnoControlPatternFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXPatternField );
}
@@ -4069,7 +4101,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlPatternFieldModel::getProper
// ----------------------------------------------------
// class UnoPatternFieldControl
// ----------------------------------------------------
-UnoPatternFieldControl::UnoPatternFieldControl()
+UnoPatternFieldControl::UnoPatternFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
}
@@ -4158,7 +4191,8 @@ sal_Bool UnoPatternFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlProgressBarModel
// ----------------------------------------------------
-UnoControlProgressBarModel::UnoControlProgressBarModel()
+UnoControlProgressBarModel::UnoControlProgressBarModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -4214,7 +4248,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlProgressBarModel::getPropert
// ----------------------------------------------------
// class UnoProgressBarControl
// ----------------------------------------------------
-UnoProgressBarControl::UnoProgressBarControl()
+UnoProgressBarControl::UnoProgressBarControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
}
@@ -4290,7 +4325,8 @@ sal_Int32 UnoProgressBarControl::getValue() throw(::com::sun::star::uno::Runtime
// ----------------------------------------------------
// class UnoControlFixedLineModel
// ----------------------------------------------------
-UnoControlFixedLineModel::UnoControlFixedLineModel()
+UnoControlFixedLineModel::UnoControlFixedLineModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
@@ -4341,7 +4377,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedLineModel::getPropertyS
// ----------------------------------------------------
// class UnoFixedLineControl
// ----------------------------------------------------
-UnoFixedLineControl::UnoFixedLineControl()
+UnoFixedLineControl::UnoFixedLineControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100; // ??
maComponentInfos.nHeight = 100; // ??
diff --git a/toolkit/source/helper/listenermultiplexer.cxx b/toolkit/source/helper/listenermultiplexer.cxx
index f8011846aa3c..fcad9bd5e287 100644
--- a/toolkit/source/helper/listenermultiplexer.cxx
+++ b/toolkit/source/helper/listenermultiplexer.cxx
@@ -227,4 +227,9 @@ IMPL_LISTENERMULTIPLEXER_BASEMETHODS( TreeEditListenerMultiplexer, ::com::sun::s
IMPL_LISTENERMULTIPLEXER_BASEMETHODS( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener )
IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener, selectionChanged, ::com::sun::star::awt::grid::GridSelectionEvent )
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// ----------------------------------------------------
+// class SelectionListenerMultiplexer
+// ----------------------------------------------------
+IMPL_LISTENERMULTIPLEXER_BASEMETHODS( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener, tabPageActivated, ::com::sun::star::awt::tab::TabPageActivatedEvent )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/toolkit/source/helper/makefile.mk b/toolkit/source/helper/makefile.mk
deleted file mode 100644
index bf10b0aa0178..000000000000
--- a/toolkit/source/helper/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=toolkit
-TARGET=helper
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/listenermultiplexer.obj \
- $(SLO)$/property.obj \
- $(SLO)$/registerservices.obj \
- $(SLO)$/servicenames.obj \
- $(SLO)$/tkresmgr.obj \
- $(SLO)$/unomemorystream.obj \
- $(SLO)$/unopropertyarrayhelper.obj \
- $(SLO)$/unowrapper.obj \
- $(SLO)$/vclunohelper.obj \
- $(SLO)$/externallock.obj \
- $(SLO)$/imagealign.obj \
- $(SLO)$/throbberimpl.obj \
- $(SLO)$/formpdfexport.obj \
- $(SLO)$/accessibilityclient.obj \
- $(SLO)$/fixedhyperbase.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 0702fd88720f..50358d779877 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -49,7 +49,6 @@
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
-#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -68,6 +67,7 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::awt::XDevice;
using ::com::sun::star::awt::FontDescriptor;
using ::com::sun::star::style::VerticalAlignment;
+using ::com::sun::star::graphic::XGraphic;
struct ImplPropertyInfo
{
@@ -183,7 +183,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_3 ( "FormatKey", FORMATKEY, sal_Int32, BOUND, MAYBEVOID, TRANSIENT ),
DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
- DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
+ DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< XGraphic >, BOUND, TRANSIENT ),
DECL_PROP_2 ( "GroupName", GROUPNAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
@@ -221,6 +221,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "PushButtonType", PUSHBUTTONTYPE, sal_Int16, BOUND, MAYBEDEFAULT),
DECL_PROP_2 ( "ReadOnly", READONLY, bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "Repeat", REPEAT, bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "AutoRepeat", AUTO_REPEAT, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "RepeatDelay", REPEAT_DELAY, sal_Int32, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ScaleImage", SCALEIMAGE, bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ScaleMode", IMAGE_SCALE_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
@@ -274,23 +275,26 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "RootDisplayed", TREE_ROOTDISPLAYED, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ShowsHandles", TREE_SHOWSHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ShowsRootHandles", TREE_SHOWSROOTHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_3 ( "RowHeight", TREE_ROWHEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "RowHeight", ROW_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "InvokesStopNodeEditing", TREE_INVOKESSTOPNODEEDITING, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "DialogSourceURL", DIALOGSOURCEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ),
- DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "RowHeaderWidth", ROW_HEADER_WIDTH, sal_Int32, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_3 ( "ColumnHeaderHeight", COLUMN_HEADER_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_1 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND ),
+ DECL_PROP_1 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND ),
DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ),
- DECL_PROP_3 ( "EvenRowBackgroundColor", GRID_EVEN_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "RowBackgroundColor", GRID_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "HeaderTextColor", GRID_HEADER_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "RowBackgroundColors", GRID_ROW_BACKGROUND_COLORS, Sequence< sal_Int32 >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_2 ( "UseGridLines", USE_GRID_LINES, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_DEP_PROP_3 ( "MultiPageValue", MULTIPAGEVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_3 ( "AllDialogChildren", USERFORMCONTAINEES, Reference< ::com::sun::star::container::XNameContainer >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
};
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index 7fbe410df046..4689b7ffa009 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -42,6 +42,7 @@
#include <toolkit/awt/vclxpointer.hxx>
#include <toolkit/awt/vclxprinter.hxx>
#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/dialogcontrol.hxx>
#include <toolkit/controls/unocontrolcontainer.hxx>
#include <toolkit/controls/unocontrolcontainermodel.hxx>
#include <toolkit/controls/stdtabcontroller.hxx>
@@ -52,8 +53,14 @@
#include "toolkit/controls/tkspinbutton.hxx"
#include <toolkit/controls/tksimpleanimation.hxx>
#include <toolkit/controls/tkthrobber.hxx>
+#include <toolkit/controls/animatedimages.hxx>
+#include <toolkit/controls/spinningprogress.hxx>
#include <toolkit/controls/dialogcontrol.hxx>
+#include <toolkit/controls/tabpagemodel.hxx>
+#include <toolkit/controls/tabpagecontainer.hxx>
#include "toolkit/dllapi.h"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace toolkit
{
@@ -120,88 +127,102 @@ namespace toolkit
{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); }
#define IMPL_CREATEINSTANCE2( ImplName ) \
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr) \
- { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( rSMgr ) ); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \
+ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( i_factory ) ); }
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlDialogModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlDialogModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
{
- return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlDialogModel> );
+ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlDialogModel>( i_factory ) );
}
-#define CHECKANDCREATEFACTORY( ImplName, ServiceName1, ServiceName2 ) \
- pRet = tryCreateFactory( sImplementationName, "stardiv.Toolkit." #ImplName, \
+#define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \
+ pRet = tryCreateFactory( sImplementationName, ImplNamePrefix "." #ClassName, \
ServiceName1, ServiceName2, \
- ImplName##_CreateInstance, xServiceFactory \
+ ClassName##_CreateInstance, xServiceFactory \
); \
if ( pRet ) \
return pRet; \
+#define GET_FACTORY( ImplName, ServiceName1, ServiceName2 ) \
+ GET_FACTORY_WITH_IMPL_PREFIX( ImplName, "stardiv.Toolkit", ServiceName1, ServiceName2 )
+
using namespace toolkit;
IMPL_CREATEINSTANCE2( VCLXToolkit )
IMPL_CREATEINSTANCE( StdTabController )
IMPL_CREATEINSTANCE( StdTabControllerModel )
-IMPL_CREATEINSTANCE( UnoButtonControl )
-IMPL_CREATEINSTANCE( UnoCheckBoxControl )
-IMPL_CREATEINSTANCE( UnoComboBoxControl )
-IMPL_CREATEINSTANCE( UnoControlButtonModel )
-IMPL_CREATEINSTANCE( UnoControlCheckBoxModel )
-IMPL_CREATEINSTANCE( UnoControlComboBoxModel )
-IMPL_CREATEINSTANCE( UnoControlContainer )
-IMPL_CREATEINSTANCE( UnoControlContainerModel )
-IMPL_CREATEINSTANCE( UnoControlCurrencyFieldModel )
-IMPL_CREATEINSTANCE( UnoControlDateFieldModel )
-IMPL_CREATEINSTANCE( UnoControlEditModel )
-IMPL_CREATEINSTANCE( UnoControlFileControlModel )
-IMPL_CREATEINSTANCE( UnoControlFixedHyperlinkModel )
-IMPL_CREATEINSTANCE( UnoControlFixedTextModel )
-IMPL_CREATEINSTANCE( UnoControlFormattedFieldModel )
-IMPL_CREATEINSTANCE( UnoControlGroupBoxModel )
-IMPL_CREATEINSTANCE( UnoControlImageControlModel )
-IMPL_CREATEINSTANCE( UnoControlListBoxModel )
-IMPL_CREATEINSTANCE( UnoControlNumericFieldModel )
-IMPL_CREATEINSTANCE( UnoControlPatternFieldModel )
-IMPL_CREATEINSTANCE( UnoControlRadioButtonModel )
-IMPL_CREATEINSTANCE( UnoControlTimeFieldModel )
-IMPL_CREATEINSTANCE( UnoControlProgressBarModel )
-IMPL_CREATEINSTANCE( UnoControlScrollBarModel )
-IMPL_CREATEINSTANCE( UnoSpinButtonModel )
-IMPL_CREATEINSTANCE( UnoMultiPageModel )
-IMPL_CREATEINSTANCE( UnoPageModel )
-IMPL_CREATEINSTANCE( UnoFrameModel )
-IMPL_CREATEINSTANCE( UnoControlFixedLineModel )
-IMPL_CREATEINSTANCE( UnoCurrencyFieldControl )
-IMPL_CREATEINSTANCE( UnoDateFieldControl )
-IMPL_CREATEINSTANCE( UnoDialogControl )
-IMPL_CREATEINSTANCE( UnoEditControl )
-IMPL_CREATEINSTANCE( UnoFileControl )
-IMPL_CREATEINSTANCE( UnoFixedHyperlinkControl )
-IMPL_CREATEINSTANCE( UnoFixedTextControl )
-IMPL_CREATEINSTANCE( UnoFormattedFieldControl )
-IMPL_CREATEINSTANCE( UnoGroupBoxControl )
-IMPL_CREATEINSTANCE( UnoImageControlControl )
-IMPL_CREATEINSTANCE( UnoListBoxControl )
-IMPL_CREATEINSTANCE( UnoNumericFieldControl )
-IMPL_CREATEINSTANCE( UnoPatternFieldControl )
-IMPL_CREATEINSTANCE( UnoRadioButtonControl )
-IMPL_CREATEINSTANCE( UnoTimeFieldControl )
-IMPL_CREATEINSTANCE( UnoProgressBarControl )
-IMPL_CREATEINSTANCE( UnoScrollBarControl )
-IMPL_CREATEINSTANCE( UnoSpinButtonControl )
-IMPL_CREATEINSTANCE( UnoMultiPageControl )
-IMPL_CREATEINSTANCE( UnoPageControl )
-IMPL_CREATEINSTANCE( UnoFrameControl )
-IMPL_CREATEINSTANCE( UnoFixedLineControl )
+IMPL_CREATEINSTANCE2( UnoButtonControl )
+IMPL_CREATEINSTANCE2( UnoCheckBoxControl )
+IMPL_CREATEINSTANCE2( UnoComboBoxControl )
+IMPL_CREATEINSTANCE2( UnoControlButtonModel )
+IMPL_CREATEINSTANCE2( UnoControlCheckBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlComboBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlContainer )
+IMPL_CREATEINSTANCE2( UnoControlContainerModel )
+IMPL_CREATEINSTANCE2( UnoControlCurrencyFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlDateFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlEditModel )
+IMPL_CREATEINSTANCE2( UnoControlFileControlModel )
+IMPL_CREATEINSTANCE2( UnoControlFixedHyperlinkModel )
+IMPL_CREATEINSTANCE2( UnoControlFixedTextModel )
+IMPL_CREATEINSTANCE2( UnoControlFormattedFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlGroupBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlImageControlModel )
+IMPL_CREATEINSTANCE2( UnoControlListBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlNumericFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlPatternFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlRadioButtonModel )
+IMPL_CREATEINSTANCE2( UnoControlTimeFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlProgressBarModel )
+IMPL_CREATEINSTANCE2( UnoControlScrollBarModel )
+IMPL_CREATEINSTANCE2( UnoSpinButtonModel )
+#ifdef NOEL_UNWINDS_THIS_ALL // FIXME
+IMPL_CREATEINSTANCE2( UnoMultiPageModel )
+IMPL_CREATEINSTANCE2( UnoPageModel )
+IMPL_CREATEINSTANCE2( UnoFrameModel )
+#endif
+IMPL_CREATEINSTANCE2( UnoControlFixedLineModel )
+IMPL_CREATEINSTANCE2( UnoCurrencyFieldControl )
+IMPL_CREATEINSTANCE2( UnoDateFieldControl )
+IMPL_CREATEINSTANCE2( UnoDialogControl )
+IMPL_CREATEINSTANCE2( UnoEditControl )
+IMPL_CREATEINSTANCE2( UnoFileControl )
+IMPL_CREATEINSTANCE2( UnoFixedHyperlinkControl )
+IMPL_CREATEINSTANCE2( UnoFixedTextControl )
+IMPL_CREATEINSTANCE2( UnoFormattedFieldControl )
+IMPL_CREATEINSTANCE2( UnoGroupBoxControl )
+IMPL_CREATEINSTANCE2( UnoImageControlControl )
+IMPL_CREATEINSTANCE2( UnoListBoxControl )
+IMPL_CREATEINSTANCE2( UnoNumericFieldControl )
+IMPL_CREATEINSTANCE2( UnoPatternFieldControl )
+IMPL_CREATEINSTANCE2( UnoRadioButtonControl )
+IMPL_CREATEINSTANCE2( UnoTimeFieldControl )
+IMPL_CREATEINSTANCE2( UnoProgressBarControl )
+IMPL_CREATEINSTANCE2( UnoScrollBarControl )
+IMPL_CREATEINSTANCE2( UnoSpinButtonControl )
+IMPL_CREATEINSTANCE2( UnoFixedLineControl )
+#ifdef NOEL_UNWINDS_THIS_ALL // FIXME
+IMPL_CREATEINSTANCE2( UnoMultiPageControl )
+IMPL_CREATEINSTANCE2( UnoPageControl )
+IMPL_CREATEINSTANCE2( UnoFrameControl )
+#endif
IMPL_CREATEINSTANCE( VCLXMenuBar )
IMPL_CREATEINSTANCE( VCLXPointer )
IMPL_CREATEINSTANCE( VCLXPopupMenu )
IMPL_CREATEINSTANCE( VCLXPrinterServer )
-IMPL_CREATEINSTANCE( UnoRoadmapControl )
-IMPL_CREATEINSTANCE( UnoControlRoadmapModel )
-IMPL_CREATEINSTANCE( UnoSimpleAnimationControl )
-IMPL_CREATEINSTANCE( UnoSimpleAnimationControlModel )
-IMPL_CREATEINSTANCE( UnoThrobberControl )
-IMPL_CREATEINSTANCE( UnoThrobberControlModel )
+IMPL_CREATEINSTANCE2( UnoRoadmapControl )
+IMPL_CREATEINSTANCE2( UnoControlRoadmapModel )
+IMPL_CREATEINSTANCE2( UnoSimpleAnimationControl )
+IMPL_CREATEINSTANCE2( UnoSimpleAnimationControlModel )
+IMPL_CREATEINSTANCE2( UnoThrobberControl )
+IMPL_CREATEINSTANCE2( UnoThrobberControlModel )
+IMPL_CREATEINSTANCE2( UnoControlTabPage )
+IMPL_CREATEINSTANCE2( UnoControlTabPageModel )
+IMPL_CREATEINSTANCE2( UnoControlTabPageContainer )
+IMPL_CREATEINSTANCE2( UnoControlTabPageContainerModel )
+IMPL_CREATEINSTANCE2( AnimatedImagesControl )
+IMPL_CREATEINSTANCE2( AnimatedImagesControlModel )
+IMPL_CREATEINSTANCE2( SpinningProgressControlModel )
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
@@ -211,11 +232,10 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
-extern sal_Bool SAL_CALL comp_AsyncCallback_component_writeInfo( void * serviceManager, void * registryKey );
extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
-extern sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * serviceManager, void * registryKey );
extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
extern "C"
@@ -226,97 +246,6 @@ TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sa
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-TOOLKIT_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager, void* _pRegistryKey )
-{
- if (_pRegistryKey)
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRegistryKey =
- static_cast< ::com::sun::star::registry::XRegistryKey* >( _pRegistryKey );
-
- registerServices( xRegistryKey, "VCLXToolkit", szServiceName_Toolkit, szServiceName2_Toolkit );
- registerServices( xRegistryKey, "VCLXPopupMenu", szServiceName_PopupMenu, szServiceName2_PopupMenu );
- registerServices( xRegistryKey, "VCLXMenuBar", szServiceName_MenuBar, szServiceName2_MenuBar );
- registerServices( xRegistryKey, "VCLXPointer", szServiceName_Pointer, szServiceName2_Pointer );
- registerServices( xRegistryKey, "UnoControlContainer", szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer );
- registerServices( xRegistryKey, "UnoControlContainerModel", szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel );
- registerServices( xRegistryKey, "StdTabController", szServiceName_TabController, szServiceName2_TabController );
- registerServices( xRegistryKey, "StdTabControllerModel", szServiceName_TabControllerModel, szServiceName2_TabControllerModel );
- registerServices( xRegistryKey, "UnoDialogControl", szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog );
- registerServices( xRegistryKey, "UnoControlDialogModel", szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel );
- registerServices( xRegistryKey, "UnoEditControl", szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit );
- registerServices( xRegistryKey, "UnoControlEditModel", szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel );
- registerServices( xRegistryKey, "UnoDateFieldControl", szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField );
- registerServices( xRegistryKey, "UnoControlDateFieldModel", szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel );
- registerServices( xRegistryKey, "UnoTimeFieldControl", szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField );
- registerServices( xRegistryKey, "UnoControlTimeFieldModel", szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel );
- registerServices( xRegistryKey, "UnoNumericFieldControl", szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField );
- registerServices( xRegistryKey, "UnoControlNumericFieldModel", szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel );
- registerServices( xRegistryKey, "UnoCurrencyFieldControl", szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField );
- registerServices( xRegistryKey, "UnoControlCurrencyFieldModel", szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel );
- registerServices( xRegistryKey, "UnoPatternFieldControl", szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField );
- registerServices( xRegistryKey, "UnoControlPatternFieldModel", szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel );
- registerServices( xRegistryKey, "UnoFormattedFieldControl", szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField );
- registerServices( xRegistryKey, "UnoControlFormattedFieldModel", szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel );
- registerServices( xRegistryKey, "UnoFileControl", szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl );
- registerServices( xRegistryKey, "UnoControlFileControlModel", szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel );
- registerServices( xRegistryKey, "UnoButtonControl", szServiceName_UnoControlButton, szServiceName2_UnoControlButton );
- registerServices( xRegistryKey, "UnoControlButtonModel", szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel );
- registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton );
- registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel );
- registerServices( xRegistryKey, "UnoImageControlControl", szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl );
- registerServices( xRegistryKey, "UnoControlImageControlModel", szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel );
- registerServices( xRegistryKey, "UnoRadioButtonControl", szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton );
- registerServices( xRegistryKey, "UnoControlRadioButtonModel", szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel );
- registerServices( xRegistryKey, "UnoCheckBoxControl", szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox );
- registerServices( xRegistryKey, "UnoControlCheckBoxModel", szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel );
- registerServices( xRegistryKey, "UnoListBoxControl", szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox );
- registerServices( xRegistryKey, "UnoControlListBoxModel", szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel );
- registerServices( xRegistryKey, "UnoComboBoxControl", szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox );
- registerServices( xRegistryKey, "UnoControlComboBoxModel", szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel );
- registerServices( xRegistryKey, "UnoFixedTextControl", szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText );
- registerServices( xRegistryKey, "UnoControlFixedTextModel", szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel );
- registerServices( xRegistryKey, "UnoGroupBoxControl", szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox );
- registerServices( xRegistryKey, "UnoControlGroupBoxModel", szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel );
- registerServices( xRegistryKey, "UnoProgressBarControl", szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar );
- registerServices( xRegistryKey, "UnoControlProgressBarModel", szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel );
- registerServices( xRegistryKey, "UnoScrollBarControl", szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar );
- registerServices( xRegistryKey, "UnoControlScrollBarModel", szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel );
- registerServices( xRegistryKey, "UnoSpinButtonModel", szServiceName_UnoSpinButtonModel );
- registerServices( xRegistryKey, "UnoSpinButtonControl", szServiceName_UnoSpinButtonControl );
- registerServices( xRegistryKey, "UnoMultiPageModel", szServiceName_UnoMultiPageModel );
- registerServices( xRegistryKey, "UnoMultiPageControl", szServiceName_UnoMultiPageControl );
- registerServices( xRegistryKey, "UnoPageModel", szServiceName_UnoPageModel );
- registerServices( xRegistryKey, "UnoPageControl", szServiceName_UnoPageControl );
- registerServices( xRegistryKey, "UnoFrameModel", szServiceName_UnoFrameModel );
- registerServices( xRegistryKey, "UnoFrameControl", szServiceName_UnoFrameControl );
- registerServices( xRegistryKey, "UnoFixedLineControl", szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine );
- registerServices( xRegistryKey, "UnoControlFixedLineModel", szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel );
- registerServices( xRegistryKey, "VCLXPrinterServer", szServiceName_PrinterServer, szServiceName2_PrinterServer );
- registerServices( xRegistryKey, "UnoRoadmapControl", szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap );
- registerServices( xRegistryKey, "UnoControlRoadmapModel", szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel );
- registerServices( xRegistryKey, "TreeControl", szServiceName_TreeControl );
- registerServices( xRegistryKey, "TreeControlModel", szServiceName_TreeControlModel );
- registerServices( xRegistryKey, "MutableTreeDataModel", szServiceName_MutableTreeDataModel );
- registerServices( xRegistryKey, "UnoSimpleAnimationControlModel", szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel );
- registerServices( xRegistryKey, "UnoSimpleAnimationControl", szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl );
- registerServices( xRegistryKey, "UnoThrobberControlModel", szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel );
- registerServices( xRegistryKey, "UnoThrobberControl", szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl );
- registerServices( xRegistryKey, "UnoFixedHyperlinkControl", szServiceName_UnoControlFixedHyperlink );
- registerServices( xRegistryKey, "UnoControlFixedHyperlinkModel", szServiceName_UnoControlFixedHyperlinkModel );
- registerServices( xRegistryKey, "GridControl", szServiceName_GridControl );
- registerServices( xRegistryKey, "GridControlModel", szServiceName_GridControlModel );
- registerServices( xRegistryKey, "DefaultGridDataModel", szServiceName_DefaultGridDataModel );
- registerServices( xRegistryKey, "DefaultGridColumnModel", szServiceName_DefaultGridColumnModel );
- registerServices( xRegistryKey, "GridColumn", szServiceName_GridColumn );
-
- comp_AsyncCallback_component_writeInfo( _pServiceManager, _pRegistryKey );
- comp_Layout_component_writeInfo( _pServiceManager, _pRegistryKey );
-
- return sal_True;
- }
- return sal_False;
-}
-
TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
{
void* pRet = NULL;
@@ -325,87 +254,94 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory =
static_cast< ::com::sun::star::lang::XMultiServiceFactory* >( _pServiceManager );
- CHECKANDCREATEFACTORY( VCLXToolkit, szServiceName_Toolkit, szServiceName2_Toolkit )
- CHECKANDCREATEFACTORY( VCLXPopupMenu, szServiceName_PopupMenu, szServiceName2_PopupMenu )
- CHECKANDCREATEFACTORY( VCLXMenuBar, szServiceName_MenuBar, szServiceName2_MenuBar )
- CHECKANDCREATEFACTORY( VCLXPointer, szServiceName_Pointer, szServiceName2_Pointer )
- CHECKANDCREATEFACTORY( UnoControlContainer, szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer )
- CHECKANDCREATEFACTORY( UnoControlContainerModel, szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel )
- CHECKANDCREATEFACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController )
- CHECKANDCREATEFACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel )
- CHECKANDCREATEFACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog )
- CHECKANDCREATEFACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel )
- CHECKANDCREATEFACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit )
- CHECKANDCREATEFACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel )
- CHECKANDCREATEFACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField )
- CHECKANDCREATEFACTORY( UnoControlDateFieldModel, szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel )
- CHECKANDCREATEFACTORY( UnoTimeFieldControl, szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField )
- CHECKANDCREATEFACTORY( UnoControlTimeFieldModel, szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel )
- CHECKANDCREATEFACTORY( UnoNumericFieldControl, szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField )
- CHECKANDCREATEFACTORY( UnoControlNumericFieldModel, szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel )
- CHECKANDCREATEFACTORY( UnoCurrencyFieldControl, szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField )
- CHECKANDCREATEFACTORY( UnoControlCurrencyFieldModel, szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel )
- CHECKANDCREATEFACTORY( UnoPatternFieldControl, szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField )
- CHECKANDCREATEFACTORY( UnoControlPatternFieldModel, szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel )
- CHECKANDCREATEFACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
- CHECKANDCREATEFACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
- CHECKANDCREATEFACTORY( UnoFileControl, szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl )
- CHECKANDCREATEFACTORY( UnoControlFileControlModel, szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel )
- CHECKANDCREATEFACTORY( UnoButtonControl, szServiceName_UnoControlButton, szServiceName2_UnoControlButton )
- CHECKANDCREATEFACTORY( UnoControlButtonModel, szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel )
- CHECKANDCREATEFACTORY( UnoImageControlControl, szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton )
- CHECKANDCREATEFACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel )
- CHECKANDCREATEFACTORY( UnoImageControlControl, szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl )
- CHECKANDCREATEFACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel )
- CHECKANDCREATEFACTORY( UnoRadioButtonControl, szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton )
- CHECKANDCREATEFACTORY( UnoControlRadioButtonModel, szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel )
- CHECKANDCREATEFACTORY( UnoCheckBoxControl, szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox )
- CHECKANDCREATEFACTORY( UnoControlCheckBoxModel, szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel )
- CHECKANDCREATEFACTORY( UnoListBoxControl, szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox )
- CHECKANDCREATEFACTORY( UnoControlListBoxModel, szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel )
- CHECKANDCREATEFACTORY( UnoComboBoxControl, szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox )
- CHECKANDCREATEFACTORY( UnoControlComboBoxModel, szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel )
- CHECKANDCREATEFACTORY( UnoFixedTextControl, szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText )
- CHECKANDCREATEFACTORY( UnoControlFixedTextModel, szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel )
- CHECKANDCREATEFACTORY( UnoGroupBoxControl, szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox )
- CHECKANDCREATEFACTORY( UnoControlGroupBoxModel, szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel )
- CHECKANDCREATEFACTORY( UnoProgressBarControl, szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar )
- CHECKANDCREATEFACTORY( UnoControlProgressBarModel, szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel )
- CHECKANDCREATEFACTORY( UnoScrollBarControl, szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar )
- CHECKANDCREATEFACTORY( UnoControlScrollBarModel, szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel )
- CHECKANDCREATEFACTORY( UnoFixedLineControl, szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine )
- CHECKANDCREATEFACTORY( UnoControlFixedLineModel, szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel )
- CHECKANDCREATEFACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
- CHECKANDCREATEFACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
- CHECKANDCREATEFACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
- CHECKANDCREATEFACTORY( UnoMultiPageModel, szServiceName_UnoMultiPageModel, NULL )
- CHECKANDCREATEFACTORY( UnoMultiPageControl, szServiceName_UnoMultiPageControl, NULL )
- CHECKANDCREATEFACTORY( UnoPageModel, szServiceName_UnoPageModel, NULL )
- CHECKANDCREATEFACTORY( UnoPageControl, szServiceName_UnoPageControl, NULL )
- CHECKANDCREATEFACTORY( UnoFrameModel, szServiceName_UnoFrameModel, NULL )
- CHECKANDCREATEFACTORY( UnoFrameControl, szServiceName_UnoFrameControl, NULL )
- CHECKANDCREATEFACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
- CHECKANDCREATEFACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
- CHECKANDCREATEFACTORY( TreeControl, szServiceName_TreeControl, NULL )
- CHECKANDCREATEFACTORY( TreeControlModel, szServiceName_TreeControlModel, NULL )
- CHECKANDCREATEFACTORY( MutableTreeDataModel, szServiceName_MutableTreeDataModel, NULL )
- CHECKANDCREATEFACTORY( UnoSimpleAnimationControlModel, szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel )
- CHECKANDCREATEFACTORY( UnoSimpleAnimationControl, szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl )
- CHECKANDCREATEFACTORY( UnoThrobberControlModel, szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel )
- CHECKANDCREATEFACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl )
- CHECKANDCREATEFACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
- CHECKANDCREATEFACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
- CHECKANDCREATEFACTORY( GridControl, szServiceName_GridControl, NULL );
- CHECKANDCREATEFACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
- CHECKANDCREATEFACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
- CHECKANDCREATEFACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
- CHECKANDCREATEFACTORY( GridColumn, szServiceName_GridColumn, NULL );
-
+ GET_FACTORY( VCLXToolkit, szServiceName_Toolkit, szServiceName2_Toolkit )
+ GET_FACTORY( VCLXPopupMenu, szServiceName_PopupMenu, szServiceName2_PopupMenu )
+ GET_FACTORY( VCLXMenuBar, szServiceName_MenuBar, szServiceName2_MenuBar )
+ GET_FACTORY( VCLXPointer, szServiceName_Pointer, szServiceName2_Pointer )
+ GET_FACTORY( UnoControlContainer, szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer )
+ GET_FACTORY( UnoControlContainerModel, szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel )
+ GET_FACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController )
+ GET_FACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel )
+ GET_FACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog )
+ GET_FACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel )
+ GET_FACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit )
+ GET_FACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel )
+ GET_FACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField )
+ GET_FACTORY( UnoControlDateFieldModel, szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel )
+ GET_FACTORY( UnoTimeFieldControl, szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField )
+ GET_FACTORY( UnoControlTimeFieldModel, szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel )
+ GET_FACTORY( UnoNumericFieldControl, szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField )
+ GET_FACTORY( UnoControlNumericFieldModel, szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel )
+ GET_FACTORY( UnoCurrencyFieldControl, szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField )
+ GET_FACTORY( UnoControlCurrencyFieldModel, szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel )
+ GET_FACTORY( UnoPatternFieldControl, szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField )
+ GET_FACTORY( UnoControlPatternFieldModel, szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel )
+ GET_FACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
+ GET_FACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
+ GET_FACTORY( UnoFileControl, szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl )
+ GET_FACTORY( UnoControlFileControlModel, szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel )
+ GET_FACTORY( UnoButtonControl, szServiceName_UnoControlButton, szServiceName2_UnoControlButton )
+ GET_FACTORY( UnoControlButtonModel, szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel )
+ GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton )
+ GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel )
+ GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl )
+ GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel )
+ GET_FACTORY( UnoRadioButtonControl, szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton )
+ GET_FACTORY( UnoControlRadioButtonModel, szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel )
+ GET_FACTORY( UnoCheckBoxControl, szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox )
+ GET_FACTORY( UnoControlCheckBoxModel, szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel )
+ GET_FACTORY( UnoListBoxControl, szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox )
+ GET_FACTORY( UnoControlListBoxModel, szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel )
+ GET_FACTORY( UnoComboBoxControl, szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox )
+ GET_FACTORY( UnoControlComboBoxModel, szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel )
+ GET_FACTORY( UnoFixedTextControl, szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText )
+ GET_FACTORY( UnoControlFixedTextModel, szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel )
+ GET_FACTORY( UnoGroupBoxControl, szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox )
+ GET_FACTORY( UnoControlGroupBoxModel, szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel )
+ GET_FACTORY( UnoProgressBarControl, szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar )
+ GET_FACTORY( UnoControlProgressBarModel, szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel )
+ GET_FACTORY( UnoScrollBarControl, szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar )
+ GET_FACTORY( UnoControlScrollBarModel, szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel )
+ GET_FACTORY( UnoFixedLineControl, szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine )
+ GET_FACTORY( UnoControlFixedLineModel, szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel )
+ GET_FACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
+ GET_FACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
+ GET_FACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
+#ifdef NOEL_UNWINDS_THIS_ALL // FIXME
+ GET_FACTORY( UnoMultiPageModel, szServiceName_UnoMultiPageModel, NULL )
+ GET_FACTORY( UnoMultiPageControl, szServiceName_UnoMultiPageControl, NULL )
+ GET_FACTORY( UnoPageModel, szServiceName_UnoPageModel, NULL )
+ GET_FACTORY( UnoPageControl, szServiceName_UnoPageControl, NULL )
+ GET_FACTORY( UnoFrameModel, szServiceName_UnoFrameModel, NULL )
+ GET_FACTORY( UnoFrameControl, szServiceName_UnoFrameControl, NULL )
+#endif
+ GET_FACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
+ GET_FACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
+ GET_FACTORY( TreeControl, szServiceName_TreeControl, NULL )
+ GET_FACTORY( TreeControlModel, szServiceName_TreeControlModel, NULL )
+ GET_FACTORY( MutableTreeDataModel, szServiceName_MutableTreeDataModel, NULL )
+ GET_FACTORY( UnoSimpleAnimationControlModel, szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel )
+ GET_FACTORY( UnoSimpleAnimationControl, szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl )
+ GET_FACTORY( UnoThrobberControlModel, szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel )
+ GET_FACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl )
+ GET_FACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
+ GET_FACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
+ GET_FACTORY( GridControl, szServiceName_GridControl, NULL );
+ GET_FACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
+ GET_FACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
+ GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL )
+ GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL )
+ GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL )
+ GET_FACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL )
+ GET_FACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL )
+ GET_FACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL )
+ GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
-
-
if( pRet == 0 )
pRet = comp_Layout_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
}
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index 9e30f0e8e42e..4c8f11c69484 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -96,6 +96,9 @@ const sal_Char szServiceName_UnoMultiPageModel[] = "com.sun.star.awt.UnoMultiPag
const sal_Char szServiceName_UnoPageControl[] = "com.sun.star.awt.UnoControlPage";
const sal_Char szServiceName_UnoPageModel[] = "com.sun.star.awt.UnoPageModel";
const sal_Char szServiceName_UnoFrameControl[] = "com.sun.star.awt.UnoControlFrame";
+const sal_Char szServiceName_AnimatedImagesControl[] = "com.sun.star.awt.AnimatedImagesControl";
+const sal_Char szServiceName_AnimatedImagesControlModel[] = "com.sun.star.awt.AnimatedImagesControlModel";
+const sal_Char szServiceName_SpinningProgressControlModel[] = "com.sun.star.awt.SpinningProgressControlModel";
const sal_Char szServiceName_UnoFrameModel[] = "com.sun.star.awt.UnoFrameModel";
const sal_Char szServiceName_TreeControl[] = "com.sun.star.awt.tree.TreeControl";
const sal_Char szServiceName_TreeControlModel[] = "com.sun.star.awt.tree.TreeControlModel";
@@ -111,5 +114,10 @@ const sal_Char szServiceName_GridControlModel[] = "com.sun.star.awt.grid.UnoCont
const sal_Char szServiceName_DefaultGridDataModel[] = "com.sun.star.awt.grid.DefaultGridDataModel";
const sal_Char szServiceName_DefaultGridColumnModel[] = "com.sun.star.awt.grid.DefaultGridColumnModel";
const sal_Char szServiceName_GridColumn[] = "com.sun.star.awt.grid.GridColumn";
+const sal_Char szServiceName_UnoControlTabPage[] = "com.sun.star.awt.tab.UnoControlTabPage";
+const sal_Char szServiceName_UnoControlTabPageModel[] = "com.sun.star.awt.tab.UnoControlTabPageModel";
+const sal_Char szServiceName_UnoControlTabPageContainerModel[] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel";
+const sal_Char szServiceName_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer";
+const sal_Char szServiceName_SortableGridDataModel[] = "com.sun.star.awt.grid.SortableGridDataModel";
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/helper/throbberimpl.cxx b/toolkit/source/helper/throbberimpl.cxx
deleted file mode 100644
index d11a13661148..000000000000
--- a/toolkit/source/helper/throbberimpl.cxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "precompiled_toolkit.hxx"
-#include <toolkit/helper/throbberimpl.hxx>
-
-#include <vcl/svapp.hxx>
-#include <vcl/fixed.hxx>
-
-//........................................................................
-namespace toolkit
-//........................................................................
-{
- using namespace ::com::sun::star;
-
- //--------------------------------------------------------------------
- Throbber_Impl::Throbber_Impl( uno::Reference< VCLXWindow > xParent,
- sal_Int32 nStepTime,
- sal_Bool bRepeat )
- {
- mxParent = xParent;
- mbRepeat = bRepeat;
- mnStepTime = nStepTime;
- maWaitTimer.SetTimeout( mnStepTime );
- maWaitTimer.SetTimeoutHdl( LINK( this, Throbber_Impl, TimeOutHdl ) );
- }
-
- //--------------------------------------------------------------------
- Throbber_Impl::~Throbber_Impl()
- {
- maWaitTimer.Stop();
- mxParent = NULL;
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::start() throw ( uno::RuntimeException )
- {
- SolarMutexGuard aGuard;
-
- mnCurStep = 0;
- maWaitTimer.Start();
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::stop() throw ( uno::RuntimeException )
- {
- SolarMutexGuard aGuard;
-
- maWaitTimer.Stop();
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& rImageList )
- throw ( uno::RuntimeException )
- {
- SolarMutexGuard aGuard;
-
- maImageList = rImageList;
-
- mnStepCount = maImageList.getLength();
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
- if ( pImage )
- {
- if ( mnStepCount )
- pImage->SetImage( maImageList[ 0 ] );
- else
- pImage->SetImage( Image() );
- }
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::initImage()
- throw ( uno::RuntimeException )
- {
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
- if ( pImage && maImageList.getLength() )
- pImage->SetImage( maImageList[ 0 ] );
- }
-
- // -----------------------------------------------------------------------
- IMPL_LINK( Throbber_Impl, TimeOutHdl, Throbber_Impl*, EMPTYARG )
- {
- SolarMutexGuard aGuard;
-
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
-
- if ( !pImage || !maImageList.getLength() )
- return 0;
-
- if ( mnCurStep < mnStepCount - 1 )
- mnCurStep += 1;
- else
- mnCurStep = 0;
-
- pImage->SetImage( maImageList[ mnCurStep ] );
-
- return 0;
- }
-
-//........................................................................
-} // namespacetoolkit
-//........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx
index 0fad4faba19f..8c4901326cf4 100644
--- a/toolkit/source/helper/tkresmgr.cxx
+++ b/toolkit/source/helper/tkresmgr.cxx
@@ -30,12 +30,19 @@
#include "precompiled_toolkit.hxx"
#include <toolkit/helper/tkresmgr.hxx>
#include <tools/simplerm.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <tools/resmgr.hxx>
-
+#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
-
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::graphic::XGraphic;
+using ::com::sun::star::graphic::XGraphicProvider;
+using namespace ::com::sun::star;
// -----------------------------------------------------------------------------
// TkResMgr
// -----------------------------------------------------------------------------
@@ -97,5 +104,28 @@ Image TkResMgr::loadImage( sal_uInt16 nResId )
}
// -----------------------------------------------------------------------------
+Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL )
+{
+ if ( !i_rImageURL.getLength() )
+ return Image();
+
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XGraphicProvider > xProvider;
+ if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put( "URL", i_rImageURL );
+ Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
+ return Image( xGraphic );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return Image();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/helper/unopropertyarrayhelper.cxx b/toolkit/source/helper/unopropertyarrayhelper.cxx
index 8d7e9a8ae024..f265a1bdf08c 100644
--- a/toolkit/source/helper/unopropertyarrayhelper.cxx
+++ b/toolkit/source/helper/unopropertyarrayhelper.cxx
@@ -100,7 +100,7 @@ sal_Bool UnoPropertyArrayHelper::fillPropertyMembersByHandle( ::rtl::OUString *
for ( sal_uInt32 n = 0; n < nProps; n++ )
{
- sal_uInt16 nId = (sal_uInt16)(sal_uIntPtr)aSortedPropsIds.GetObject( n );
+ sal_uInt16 nId = (sal_uInt16)(sal_uLong)aSortedPropsIds.GetObject( n );
pProps[n].Name = GetPropertyName( nId );
pProps[n].Handle = nId;
pProps[n].Type = *GetPropertyType( nId );
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index d9e79be6b59e..01cef532a60f 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -70,7 +70,6 @@ using namespace ::com::sun::star;
// instead of only a <VCLXWindow> instance, especially regarding its
// corresponding accessibility API.
case WINDOW_METRICBOX:
- // <--
case WINDOW_COMBOBOX: return new VCLXComboBox;
case WINDOW_SPINFIELD:
case WINDOW_NUMERICFIELD:
@@ -270,7 +269,7 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
Window* pClient = pChild->GetWindow( WINDOW_CLIENT );
if ( pClient->GetWindowPeer() )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( FALSE ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( sal_False ), ::com::sun::star::uno::UNO_QUERY );
xComp->dispose();
}
@@ -287,7 +286,7 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
if ( pClient->GetWindowPeer() && lcl_ImplIsParent( pWindow, pClient ) )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( FALSE ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pClient->GetComponentInterface( sal_False ), ::com::sun::star::uno::UNO_QUERY );
xComp->dispose();
}
@@ -299,7 +298,7 @@ void UnoWrapper::WindowDestroyed( Window* pWindow )
pParent->GetWindowPeer()->notifyWindowRemoved( *pWindow );
VCLXWindow* pWindowPeer = pWindow->GetWindowPeer();
- uno::Reference< lang::XComponent > xWindowPeerComp( pWindow->GetComponentInterface( FALSE ), uno::UNO_QUERY );
+ uno::Reference< lang::XComponent > xWindowPeerComp( pWindow->GetComponentInterface( sal_False ), uno::UNO_QUERY );
OSL_ENSURE( ( pWindowPeer != NULL ) == ( xWindowPeerComp.is() == sal_True ),
"UnoWrapper::WindowDestroyed: inconsistency in the window's peers!" );
if ( pWindowPeer )
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index a9f62f823d58..e2755f8a8112 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -214,10 +214,11 @@ Polygon VCLUnoHelper::CreatePolygon( const ::com::sun::star::uno::Sequence< sal_
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer> VCLUnoHelper::CreateControlContainer( Window* pWindow )
{
- UnoControlContainer* pContainer = new UnoControlContainer( pWindow->GetComponentInterface( sal_True ) );
+ const uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ UnoControlContainer* pContainer = new UnoControlContainer( xFactory, pWindow->GetComponentInterface( sal_True ) );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > x = pContainer;
- UnoControlModel* pContainerModel = new UnoControlContainerModel;
+ UnoControlModel* pContainerModel = new UnoControlContainerModel( xFactory );
pContainer->setModel( (::com::sun::star::awt::XControlModel*)pContainerModel );
return x;
diff --git a/toolkit/source/layout/core/factory.cxx b/toolkit/source/layout/core/factory.cxx
index ff52c3d14446..4cf442798d42 100644
--- a/toolkit/source/layout/core/factory.cxx
+++ b/toolkit/source/layout/core/factory.cxx
@@ -58,33 +58,6 @@ void * SAL_CALL comp_Layout_component_getFactory( const char * pImplName, void *
return pRet;
}
-sal_Bool SAL_CALL comp_Layout_component_writeInfo( void * /*serviceManager*/, void * pRegistryKey )
- {
- if ( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
- uno::Reference< registry::XRegistryKey > xNewKey;
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- LayoutFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
-
- const uno::Sequence< ::rtl::OUString > aServices = LayoutFactory::impl_staticGetSupportedServiceNames();
- for ( sal_Int32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
- }
-
// Component registration
::rtl::OUString SAL_CALL LayoutFactory::impl_staticGetImplementationName()
{
diff --git a/toolkit/source/layout/core/helper.cxx b/toolkit/source/layout/core/helper.cxx
index 86419bcd618c..6b50312eda86 100644
--- a/toolkit/source/layout/core/helper.cxx
+++ b/toolkit/source/layout/core/helper.cxx
@@ -365,7 +365,7 @@ Window* WidgetFactory::sfx2CreateWindow (VCLXWindow** component, Window* parent,
if (!mSfx2Library)
{
- OUString libraryName = ::vcl::unohelper::CreateLibraryName ("sfx", TRUE);
+ OUString libraryName = ::vcl::unohelper::CreateLibraryName ("sfx", sal_True);
mSfx2Library = osl_loadModuleRelative (&thisModule, libraryName.pData, SAL_LOADMODULE_DEFAULT);
if (mSfx2Library)
{
diff --git a/toolkit/source/layout/core/import.cxx b/toolkit/source/layout/core/import.cxx
index 299eb6478d01..5114ca586a74 100644
--- a/toolkit/source/layout/core/import.cxx
+++ b/toolkit/source/layout/core/import.cxx
@@ -102,7 +102,7 @@ SAL_THROW (())
if ( findAndRemove( "help-id", aProps, aHelpId ) )
{
OSL_TRACE("Setting help-id: %s", OUSTRING_CSTR( aHelpId ) );
- xDialog->setHelpId( aHelpId.toInt32 () );
+ xDialog->setHelpId( aHelpId );
}
} // DEBUG:
else if ( pParent == NULL )
diff --git a/toolkit/source/layout/core/makefile.mk b/toolkit/source/layout/core/makefile.mk
deleted file mode 100644
index 2c90921799af..000000000000
--- a/toolkit/source/layout/core/makefile.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=../../..
-PRJNAME=toolkit
-TARGET=layout-core
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-# FIXME: This is bad, hmkay
-CFLAGS+= -I$(PRJ)/source
-
-SLOFILES= \
- $(SLO)$/bin.obj \
- $(SLO)$/box-base.obj \
- $(SLO)$/box.obj \
- $(SLO)$/byteseq.obj \
- $(SLO)$/container.obj \
- $(SLO)$/dialogbuttonhbox.obj \
- $(SLO)$/factory.obj \
- $(SLO)$/flow.obj \
- $(SLO)$/helper.obj \
- $(SLO)$/import.obj \
- $(SLO)$/localized-string.obj \
- $(SLO)$/proplist.obj \
- $(SLO)$/root.obj \
- $(SLO)$/table.obj \
- $(SLO)$/timer.obj \
- $(SLO)$/translate.obj\
- $(SLO)$/vcl.obj\
-#
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/toolkit/source/layout/core/vcl.cxx b/toolkit/source/layout/core/vcl.cxx
index 9fc861506a00..2b9d2d3c4f5d 100644
--- a/toolkit/source/layout/core/vcl.cxx
+++ b/toolkit/source/layout/core/vcl.cxx
@@ -50,7 +50,7 @@ static PushButton* get_button (Dialog const* dialog, sal_uInt32 type)
, mClosing (false)\
{\
}\
- BOOL Closing##cls::Close ()\
+ sal_Bool Closing##cls::Close ()\
{\
if (mClosing)\
EndDialog (false);\
diff --git a/toolkit/source/layout/core/vcl.hxx b/toolkit/source/layout/core/vcl.hxx
index 45c01314782b..bcf6cfb700f1 100644
--- a/toolkit/source/layout/core/vcl.hxx
+++ b/toolkit/source/layout/core/vcl.hxx
@@ -37,7 +37,7 @@
public:\
bool mClosing;\
Closing##cls (Window* parent, WinBits bits);\
- virtual BOOL Close ();\
+ virtual sal_Bool Close ();\
}
DECLARE_CLOSING_DIALOG (Dialog);
diff --git a/toolkit/source/layout/vcl/makefile.mk b/toolkit/source/layout/vcl/makefile.mk
deleted file mode 100644
index 529ddc31d97e..000000000000
--- a/toolkit/source/layout/vcl/makefile.mk
+++ /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.
-#
-#*************************************************************************
-
-PRJ=../../..
-PRJNAME=toolkit
-TARGET=layout-vcl
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(COMNAME)" == "gcc3"
-CFLAGS+=-Wall -fno-default-inline
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/wrapper.obj \
- $(SLO)$/wbutton.obj \
- $(SLO)$/wcontainer.obj \
- $(SLO)$/wfield.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx
index b39d14c1e4f1..d4d16357d037 100644
--- a/toolkit/source/layout/vcl/wrapper.cxx
+++ b/toolkit/source/layout/vcl/wrapper.cxx
@@ -305,13 +305,17 @@ void Window::setRes (ResId const& res)
{
return Resource::ReadStringRes ();
}
+ rtl::OString ReadByteStringRes()
+ {
+ return Resource::ReadByteStringRes();
+ }
};
Resource_open_up r (res);
#endif /* !RESOURCE_PUBLISH_PROTECTED */
- if (sal_uInt32 help_id = (sal_uInt32)r.GetLongRes (static_cast<char *> (r.GetClassRes ()) + 12))
- SetHelpId (help_id);
sal_uInt32 mask = r.ReadLongRes ();
+ if (mask & WINDOW_HELPID)
+ SetHelpId (r.ReadByteStringRes());
if ( mask & WINDOW_TEXT )
SetText( r.ReadStringRes ());
}
@@ -367,26 +371,16 @@ VCLXWindow* Window::GetVCLXWindow() const
return GetWindow()->GetParent();
}
-void Window::SetHelpId( sal_uIntPtr id )
+void Window::SetHelpId( const rtl::OString& id )
{
GetWindow()->SetHelpId( id );
}
-sal_uIntPtr Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
return GetWindow()->GetHelpId();
}
-void Window::SetSmartHelpId( SmartId const& id, SmartIdUpdateMode mode )
-{
- GetWindow()->SetSmartHelpId( id, mode );
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- return GetWindow()->GetSmartHelpId();
-}
-
void Window::EnterWait ()
{
GetWindow()->EnterWait ();
@@ -867,7 +861,7 @@ void Dialog::Initialize (SfxChildWinInfo*)
, yesButton (this, "BTN_YES")
MessageBox::MessageBox (::Window *parent, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -877,7 +871,7 @@ MessageBox::MessageBox (::Window *parent, char const* message,
}
MessageBox::MessageBox (::Window *parent, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -891,7 +885,7 @@ MessageBox::MessageBox (::Window *parent, OUString const& message,
#endif /* !__GNUC__ */
MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
- char const* yes, char const* no, sal_uIntPtr help_id,
+ char const* yes, char const* no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -904,7 +898,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
}
MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id,
+ OUString yes, OUString no, const rtl::OString& help_id,
char const* xml_file, char const* id)
: MESSAGE_BOX_MEMBER_INIT
{
@@ -917,7 +911,7 @@ MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
}
void MessageBox::bits_init (WinBits bits, OUString const& message,
- OUString yes, OUString no, sal_uIntPtr help_id)
+ OUString yes, OUString no, const rtl::OString& help_id)
{
if ( bits & ( WB_OK_CANCEL | WB_OK ))
yes = Button::GetStandardText ( BUTTON_OK );
@@ -942,12 +936,12 @@ void MessageBox::bits_init (WinBits bits, OUString const& message,
init (message, yes, no, help_id);
}
-void MessageBox::init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id)
+void MessageBox::init (char const* message, char const* yes, char const* no, const rtl::OString& help_id)
{
init ( OUString::createFromAscii (message), OUString::createFromAscii (yes), OUString::createFromAscii (no), help_id);
}
-void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, sal_uIntPtr help_id)
+void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, const rtl::OString& help_id)
{
imageError.Hide ();
imageInfo.Hide ();
@@ -975,28 +969,28 @@ void MessageBox::init (OUString const& message, OUString const& yes, OUString co
#undef MESSAGE_BOX_IMPL
#define MESSAGE_BOX_IMPL(Name)\
Name##Box::Name##Box (::Window *parent, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, char const* message,\
- char const* yes, char const* no, sal_uIntPtr help_id,\
+ char const* yes, char const* no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
image##Name.Show ();\
}\
Name##Box::Name##Box (::Window *parent, WinBits bits, OUString const& message,\
- OUString yes, OUString no, sal_uIntPtr help_id,\
+ OUString yes, OUString no, const rtl::OString& help_id,\
char const* xml_file, char const* id)\
: MessageBox (parent, bits, message, yes, no, help_id, xml_file, id)\
{\
@@ -1487,7 +1481,7 @@ LocalizedString::operator String()
return getImpl ().maString;
}
-String LocalizedString::GetToken (USHORT i, sal_Char c)
+String LocalizedString::GetToken (sal_uInt16 i, sal_Char c)
{
return getString ().GetToken (i, c);
}
diff --git a/toolkit/src2xml/src-sw.lst b/toolkit/src2xml/src-sw.lst
index 8d43400462d8..a0e7245fc4f4 100644
--- a/toolkit/src2xml/src-sw.lst
+++ b/toolkit/src2xml/src-sw.lst
@@ -51,7 +51,6 @@
../../sw/source/ui/fldui/DropDownFieldDialog.src
../../sw/source/ui/fldui/fldui.src
../../sw/source/ui/fmtui/tmpdlg.src
-../../sw/source/ui/fmtui/fmtui.src
../../sw/source/ui/index/cnttab.src
../../sw/source/ui/index/multmrk.src
../../sw/source/ui/index/idxmrk.src
diff --git a/toolkit/src2xml/src.lst b/toolkit/src2xml/src.lst
index 524262cf54c1..44143571b0dc 100644
--- a/toolkit/src2xml/src.lst
+++ b/toolkit/src2xml/src.lst
@@ -170,7 +170,6 @@
../../sw/source/ui/fldui/DropDownFieldDialog.src
../../sw/source/ui/fldui/fldui.src
../../sw/source/ui/fmtui/tmpdlg.src
-../../sw/source/ui/fmtui/fmtui.src
../../sw/source/ui/index/cnttab.src
../../sw/source/ui/index/multmrk.src
../../sw/source/ui/index/idxmrk.src
diff --git a/toolkit/test/accessibility/makefile.mk b/toolkit/test/accessibility/makefile.mk
deleted file mode 100644
index cc6f410f7404..000000000000
--- a/toolkit/test/accessibility/makefile.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-# This is the dmake version.
-
-# copied from settings.mk
-SOLARBINDIR=$(SOLARVERSION)$/$(INPATH)$/bin$(UPDMINOREXT)
-
-# Please modify the following lines to match your environment:
-# If you use the run: target at the end of the file, then adapt port number.
-PORT_NUMBER = 5678
-
-# The following variables probably don't need to be changed.
-JAVAC = javac
-JAVA = java
-# The JAR_PATH points to the jar files of your local office installation.
-JAR_PATH = $(SOLARBINDIR)$/
-
-
-# The rest of this makefile should not need to be touched.
-
-all : AccessibilityWorkBench
-
-JAR_FILES = \
- unoil.jar \
- ridl.jar \
- jurt.jar \
- juh.jar \
- java_uno.jar
-
-JAVA_FILES = \
- AccTreeNode.java \
- AccessibilityTree.java \
- AccessibilityTreeModel.java \
- AccessibilityTreeModelBase.java \
- AccessibilityWorkBench.java \
- AccessibleActionHandler.java \
- AccessibleActionNode.java \
- AccessibleCellHandler.java \
- AccessibleComponentHandler.java \
- AccessibleContextHandler.java \
- AccessibleEditableTextHandler.java \
- AccessibleExtendedComponentHandler.java \
- AccessibleHyperlinkHandler.java \
- AccessibleHypertextHandler.java \
- AccessibleImageHandler.java \
- AccessibleRelationHandler.java \
- AccessibleSelectionHandler.java \
- AccessibleTableHandler.java \
- AccessibleTextHandler.java \
- AccessibleTreeCellRenderer.java \
- AccessibleTreeHandler.java \
- AccessibleTreeNode.java \
- AccessibleUNOHandler.java \
- Canvas.java \
- CanvasShape.java \
- ChildEventHandler.java \
- ContextEventHandler.java \
- EventHandler.java \
- EventListener.java \
- EventLogger.java \
- EventQueue.java \
- FrameActionListener.java \
- GeometryEventHandler.java \
- HelpWindow.java \
- InformationWriter.java \
- MessageArea.java \
- NodeFactory.java \
- NodeHandler.java \
- NodeMap.java \
- OfficeConnection.java \
- Options.java \
- QueuedListener.java \
- QueuedTopWindowListener.java \
- SelectionDialog.java \
- SimpleOffice.java \
- StringNode.java \
- TableEventHandler.java \
- TextLogger.java \
- TextUpdateListener.java \
- TopWindowListener.java \
- VectorNode.java
-
-JAVA_CLASSPATHS := \
- . \
- $(foreach,i,$(JAR_FILES) $(JAR_PATH)$i) \
- $(CLASSPATH)
-
-CLASSPATH !:=$(JAVA_CLASSPATHS:t$(PATH_SEPERATOR))
-
-JFLAGS = -deprecation -classpath $(CLASSPATH)
-
-%.class : %.java
- $(JAVAC) $(JFLAGS) $<
-
-%.class : %.java
- $(JAVAC) $(JFLAGS) $<
-
-AccessibilityWorkBench : ObjectView Tools $(JAVA_FILES:b:+".class")
-
-ObjectView .SETDIR=ov :
- @echo "making package ObjectView"
- dmake
-
-Tools .SETDIR=tools :
- @echo "making package Tools"
- dmake
-
-# Remove all class files.
-clean : ObjectView.clean Tools.clean
- rm *.class
- rm AccessibilityWorkBench.jar
-ObjectView.clean .SETDIR=ov :
- rm *.class
-Tools.clean .SETDIR=tools :
- rm *.class
-
-# Create a jar file of all files neccessary to build and run the work bench.
-dist: AccessibilityWorkBench.jar
-
-AccessibilityWorkBench.jar: $(JAVA_FILES:b:+".class") jawb.mf
- jar -cfm AccessibilityWorkBench.jar jawb.mf *.class ov\*.class tools\*.class
-
-# Example of how to run the work bench.
-run: all
- $(JAVA) -classpath $(CLASSPATH) AccessibilityWorkBench -p $(PORT_NUMBER)
-
-runjar: all dist
- $(JAVA) -classpath $(CLASSPATH) -jar AccessibilityWorkBench.jar -p $(PORT_NUMBER)
-
diff --git a/toolkit/test/accessibility/ov/makefile.mk b/toolkit/test/accessibility/ov/makefile.mk
deleted file mode 100644
index 56fb563eeee0..000000000000
--- a/toolkit/test/accessibility/ov/makefile.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-# This is the dmake version.
-
-# copied from settings.mk
-SOLARBINDIR=$(SOLARVERSION)$/$(INPATH)$/bin$(UPDMINOREXT)
-
-# Please modify the following lines to match your environment:
-# If you use the run: target at the end of the file, then adapt port number.
-PORT_NUMBER = 5678
-
-# The following variables probably don't need to be changed.
-JAVAC = javac
-JAVA = java
-# The JAR_PATH points to the jar files of your local office installation.
-JAR_PATH = $(SOLARBINDIR)$/
-
-
-# The rest of this makefile should not need to be touched.
-
-all : ov
-
-JAR_FILES = \
- unoil.jar \
- ridl.jar \
- jurt.jar \
- juh.jar \
- java_uno.jar
-
-JAVA_FILES = \
- ov/ObjectViewContainer.java \
- ov/ObjectView.java \
- ov/ListeningObjectView.java \
- ov/ContextView.java \
- ov/FocusView.java \
- ov/SelectionView.java \
- ov/TextView.java
-# ov/StateSetView.java \
-
-
-JAVA_CLASSPATHS := \
- . .. \
- $(foreach,i,$(JAR_FILES) $(JAR_PATH)$i) \
- $(CLASSPATH)
-
-CLASSPATH !:=$(JAVA_CLASSPATHS:t$(PATH_SEPERATOR))
-
-JFLAGS = -deprecation -classpath $(CLASSPATH)
-
-%.class : %.java
- $(JAVAC) $(JFLAGS) $<
-
-ov : $(JAVA_FILES:b:+".class")
diff --git a/toolkit/test/accessibility/tools/makefile.mk b/toolkit/test/accessibility/tools/makefile.mk
deleted file mode 100644
index 045ba6f65b49..000000000000
--- a/toolkit/test/accessibility/tools/makefile.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-# copied from settings.mk
-SOLARBINDIR=$(SOLARVERSION)$/$(INPATH)$/bin$(UPDMINOREXT)
-
-# Please modify the following lines to match your environment:
-# If you use the run: target at the end of the file, then adapt port number.
-PORT_NUMBER = 5678
-
-# The following variables probably don't need to be changed.
-JAVAC = javac
-JAVA = java
-# The JAR_PATH points to the jar files of your local office installation.
-JAR_PATH = $(SOLARBINDIR)$/
-
-
-# The rest of this makefile should not need to be touched.
-
-all : tools
-
-JAR_FILES = \
- unoil.jar \
- ridl.jar \
- jurt.jar \
- juh.jar \
- java_uno.jar
-
-JAVA_FILES = \
- tools/NameProvider.java
-
-
-JAVA_CLASSPATHS := \
- . .. \
- $(foreach,i,$(JAR_FILES) $(JAR_PATH)$i) \
- $(CLASSPATH)
-
-CLASSPATH !:=$(JAVA_CLASSPATHS:t$(PATH_SEPERATOR))
-
-JFLAGS = -deprecation -classpath $(CLASSPATH)
-
-%.class : %.java
- $(JAVAC) $(JFLAGS) $<
-
-tools : $(JAVA_FILES:b:+".class")
diff --git a/toolkit/uiconfig/layout/makefile.mk b/toolkit/uiconfig/layout/makefile.mk
deleted file mode 100644
index 46d0b187b744..000000000000
--- a/toolkit/uiconfig/layout/makefile.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=../..
-PRJNAME=toolkit
-TARGET=layout
-
-.INCLUDE : settings.mk
-
-.IF "$(ENABLE_LAYOUT)" == "TRUE"
-
-all: ALLTAR
-
-XML_FILES=\
- message-box.xml\
- tab-dialog.xml\
-
-#
-
-.INCLUDE : layout.mk
-
-.ELSE # ENABLE_LAYOUT != TRUE
-all .PHONY:
-.ENDIF # ENABLE_LAYOUT != TRUE
-
-.INCLUDE : target.mk
-
-localize.sdf:
- echo '#empty' | cat - > $@
- rm -f *-$@
diff --git a/toolkit/util/makefile.mk b/toolkit/util/makefile.mk
deleted file mode 100644
index 48d534a8a9b3..000000000000
--- a/toolkit/util/makefile.mk
+++ /dev/null
@@ -1,85 +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.
-#
-#*************************************************************************
-
-# tk.dxp should contain all c functions that have to be exported. MT 2001/11/29
-
-PRJ=..
-
-PRJNAME=toolkit
-TARGET=tk
-TARGET2=tka
-USE_DEFFILE=TRUE
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-
-# --- Allgemein ----------------------------------------------------------
-
-# ========================================================================
-# = tk lib: the "classic" toolkit library
-
-LIB1TARGET= $(SLB)$/$(TARGET).lib
-LIB1FILES= $(SLB)$/awt.lib \
- $(SLB)$/tree.lib \
- $(SLB)$/grid.lib \
- $(SLB)$/controls.lib \
- $(SLB)$/helper.lib\
- $(SLB)$/layout-core.lib \
- $(SLB)$/layout-vcl.lib
-
-SHL1TARGET= tk$(DLLPOSTFIX)
-SHL1IMPLIB= itk
-SHL1USE_EXPORTS=name
-
-SHL1STDLIBS=\
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1LIBS= $(LIB1TARGET)
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1DEPN=$(LIB1TARGET)
-
-DEF1NAME =$(SHL1TARGET)
-DEF1DEPN =$(LIB1TARGET)
-DEF1DES =TK
-DEFLIB1NAME =tk
-
-RESLIB1IMAGES=$(PRJ)$/source$/awt
-RES1FILELIST=$(SRS)$/awt.srs
-RESLIB1NAME=$(TARGET)
-RESLIB1SRSFILES=$(RES1FILELIST)
-
-# --- Footer -------------------------------------------------------------
-.INCLUDE : target.mk
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
new file mode 100644
index 000000000000..690b3f324498
--- /dev/null
+++ b/toolkit/util/tk.component
@@ -0,0 +1,322 @@
+<?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.awt.comp.AsyncCallback">
+ <service name="com.sun.star.awt.AsyncCallback"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.awt.Layout">
+ <service name="com.sun.star.awt.Layout"/>
+ <service name="com.sun.star.comp.awt.Layout"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPage">
+ <service name="com.sun.star.awt.tab.UnoControlTabPage"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageModel">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageContainerModel">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageContainerModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageContainer">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageContainer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.DefaultGridColumnModel">
+ <service name="com.sun.star.awt.grid.DefaultGridColumnModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.DefaultGridDataModel">
+ <service name="com.sun.star.awt.grid.DefaultGridDataModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.GridColumn">
+ <service name="com.sun.star.awt.grid.GridColumn"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.SortableGridDataModel">
+ <service name="com.sun.star.awt.grid.SortableGridDataModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.GridControl">
+ <service name="com.sun.star.awt.grid.UnoControlGrid"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.GridControlModel">
+ <service name="com.sun.star.awt.grid.UnoControlGridModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.MutableTreeDataModel">
+ <service name="com.sun.star.awt.tree.MutableTreeDataModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.StdTabController">
+ <service name="com.sun.star.awt.TabController"/>
+ <service name="stardiv.vcl.control.TabController"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.StdTabControllerModel">
+ <service name="com.sun.star.awt.TabControllerModel"/>
+ <service name="stardiv.vcl.controlmodel.TabController"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.TreeControl">
+ <service name="com.sun.star.awt.tree.TreeControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.TreeControlModel">
+ <service name="com.sun.star.awt.tree.TreeControlModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoButtonControl">
+ <service name="com.sun.star.awt.UnoControlButton"/>
+ <service name="stardiv.vcl.control.Button"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoCheckBoxControl">
+ <service name="com.sun.star.awt.UnoControlCheckBox"/>
+ <service name="stardiv.vcl.control.CheckBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoComboBoxControl">
+ <service name="com.sun.star.awt.UnoControlComboBox"/>
+ <service name="stardiv.vcl.control.ComboBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlButtonModel">
+ <service name="com.sun.star.awt.UnoControlButtonModel"/>
+ <service name="stardiv.vcl.controlmodel.Button"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlCheckBoxModel">
+ <service name="com.sun.star.awt.UnoControlCheckBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.CheckBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlComboBoxModel">
+ <service name="com.sun.star.awt.UnoControlComboBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.ComboBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlContainer">
+ <service name="com.sun.star.awt.UnoControlContainer"/>
+ <service name="stardiv.vcl.control.ControlContainer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlContainerModel">
+ <service name="com.sun.star.awt.UnoControlContainerModel"/>
+ <service name="stardiv.vcl.controlmodel.ControlContainer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlCurrencyFieldModel">
+ <service name="com.sun.star.awt.UnoControlCurrencyFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.CurrencyField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlDateFieldModel">
+ <service name="com.sun.star.awt.UnoControlDateFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.DateField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlDialogModel">
+ <service name="com.sun.star.awt.UnoControlDialogModel"/>
+ <service name="stardiv.vcl.controlmodel.Dialog"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlEditModel">
+ <service name="com.sun.star.awt.UnoControlEditModel"/>
+ <service name="stardiv.vcl.controlmodel.Edit"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFileControlModel">
+ <service name="com.sun.star.awt.UnoControlFileControlModel"/>
+ <service name="stardiv.vcl.controlmodel.FileControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedHyperlinkModel">
+ <service name="com.sun.star.awt.UnoControlFixedHyperlinkModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedLineModel">
+ <service name="com.sun.star.awt.UnoControlFixedLineModel"/>
+ <service name="stardiv.vcl.controlmodel.FixedLine"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFixedTextModel">
+ <service name="com.sun.star.awt.UnoControlFixedTextModel"/>
+ <service name="stardiv.vcl.controlmodel.FixedText"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlFormattedFieldModel">
+ <service name="com.sun.star.awt.UnoControlFormattedFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.FormattedField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlGroupBoxModel">
+ <service name="com.sun.star.awt.UnoControlGroupBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.GroupBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlImageControlModel">
+ <service name="com.sun.star.awt.UnoControlImageButtonModel"/>
+ <service name="com.sun.star.awt.UnoControlImageControlModel"/>
+ <service name="stardiv.vcl.controlmodel.ImageButton"/>
+ <service name="stardiv.vcl.controlmodel.ImageControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlListBoxModel">
+ <service name="com.sun.star.awt.UnoControlListBoxModel"/>
+ <service name="stardiv.vcl.controlmodel.ListBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlNumericFieldModel">
+ <service name="com.sun.star.awt.UnoControlNumericFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.NumericField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlPatternFieldModel">
+ <service name="com.sun.star.awt.UnoControlPatternFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.PatternField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlProgressBarModel">
+ <service name="com.sun.star.awt.UnoControlProgressBarModel"/>
+ <service name="stardiv.vcl.controlmodel.ProgressBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlRadioButtonModel">
+ <service name="com.sun.star.awt.UnoControlRadioButtonModel"/>
+ <service name="stardiv.vcl.controlmodel.RadioButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlRoadmapModel">
+ <service name="com.sun.star.awt.UnoControlRoadmapModel"/>
+ <service name="stardiv.vcl.controlmodel.Roadmap"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlScrollBarModel">
+ <service name="com.sun.star.awt.UnoControlScrollBarModel"/>
+ <service name="stardiv.vcl.controlmodel.ScrollBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTimeFieldModel">
+ <service name="com.sun.star.awt.UnoControlTimeFieldModel"/>
+ <service name="stardiv.vcl.controlmodel.TimeField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoCurrencyFieldControl">
+ <service name="com.sun.star.awt.UnoControlCurrencyField"/>
+ <service name="stardiv.vcl.control.CurrencyField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoDateFieldControl">
+ <service name="com.sun.star.awt.UnoControlDateField"/>
+ <service name="stardiv.vcl.control.DateField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoDialogControl">
+ <service name="com.sun.star.awt.UnoControlDialog"/>
+ <service name="stardiv.vcl.control.Dialog"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoEditControl">
+ <service name="com.sun.star.awt.UnoControlEdit"/>
+ <service name="stardiv.vcl.control.Edit"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFileControl">
+ <service name="com.sun.star.awt.UnoControlFileControl"/>
+ <service name="stardiv.vcl.control.FileControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedHyperlinkControl">
+ <service name="com.sun.star.awt.UnoControlFixedHyperlink"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedLineControl">
+ <service name="com.sun.star.awt.UnoControlFixedLine"/>
+ <service name="stardiv.vcl.control.FixedLine"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFixedTextControl">
+ <service name="com.sun.star.awt.UnoControlFixedText"/>
+ <service name="stardiv.vcl.control.FixedText"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoFormattedFieldControl">
+ <service name="com.sun.star.awt.UnoControlFormattedField"/>
+ <service name="stardiv.vcl.control.FormattedField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoGroupBoxControl">
+ <service name="com.sun.star.awt.UnoControlGroupBox"/>
+ <service name="stardiv.vcl.control.GroupBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoImageControlControl">
+ <service name="com.sun.star.awt.UnoControlImageButton"/>
+ <service name="com.sun.star.awt.UnoControlImageControl"/>
+ <service name="stardiv.vcl.control.ImageButton"/>
+ <service name="stardiv.vcl.control.ImageControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoListBoxControl">
+ <service name="com.sun.star.awt.UnoControlListBox"/>
+ <service name="stardiv.vcl.control.ListBox"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoNumericFieldControl">
+ <service name="com.sun.star.awt.UnoControlNumericField"/>
+ <service name="stardiv.vcl.control.NumericField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoPatternFieldControl">
+ <service name="com.sun.star.awt.UnoControlPatternField"/>
+ <service name="stardiv.vcl.control.PatternField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoProgressBarControl">
+ <service name="com.sun.star.awt.UnoControlProgressBar"/>
+ <service name="stardiv.vcl.control.ProgressBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoRadioButtonControl">
+ <service name="com.sun.star.awt.UnoControlRadioButton"/>
+ <service name="stardiv.vcl.control.RadioButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoRoadmapControl">
+ <service name="com.sun.star.awt.UnoControlRoadmap"/>
+ <service name="stardiv.vcl.control.Roadmap"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoScrollBarControl">
+ <service name="com.sun.star.awt.UnoControlScrollBar"/>
+ <service name="stardiv.vcl.control.ScrollBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSimpleAnimationControl">
+ <service name="com.sun.star.awt.UnoControlSimpleAnimation"/>
+ <service name="com.sun.star.awt.UnoSimpleAnimationControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSimpleAnimationControlModel">
+ <service name="com.sun.star.awt.UnoControlSimpleAnimationModel"/>
+ <service name="com.sun.star.awt.UnoSimpleAnimationControlModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.SpinningProgressControlModel">
+ <service name="com.sun.star.awt.SpinningProgressControlModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.AnimatedImagesControlModel">
+ <service name="com.sun.star.awt.AnimatedImagesControlModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.AnimatedImagesControl">
+ <service name="com.sun.star.awt.AnimatedImagesControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSpinButtonControl">
+ <service name="com.sun.star.awt.UnoControlSpinButton"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoSpinButtonModel">
+ <service name="com.sun.star.awt.UnoControlSpinButtonModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoThrobberControl">
+ <service name="com.sun.star.awt.UnoControlThrobber"/>
+ <service name="com.sun.star.awt.UnoThrobberControl"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoThrobberControlModel">
+ <service name="com.sun.star.awt.UnoControlThrobberModel"/>
+ <service name="com.sun.star.awt.UnoThrobberControlModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoTimeFieldControl">
+ <service name="com.sun.star.awt.UnoControlTimeField"/>
+ <service name="stardiv.vcl.control.TimeField"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXMenuBar">
+ <service name="com.sun.star.awt.MenuBar"/>
+ <service name="stardiv.vcl.MenuBar"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPointer">
+ <service name="com.sun.star.awt.Pointer"/>
+ <service name="stardiv.vcl.Pointer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPopupMenu">
+ <service name="com.sun.star.awt.PopupMenu"/>
+ <service name="stardiv.vcl.PopupMenu"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXPrinterServer">
+ <service name="com.sun.star.awt.PrinterServer"/>
+ <service name="stardiv.vcl.PrinterServer"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.VCLXToolkit">
+ <service name="com.sun.star.awt.Toolkit"/>
+ <service name="stardiv.vcl.VclToolkit"/>
+ </implementation>
+</component>
diff --git a/toolkit/workben/layout/makefile.mk b/toolkit/workben/layout/makefile.mk
deleted file mode 100644
index 53797e5a3102..000000000000
--- a/toolkit/workben/layout/makefile.mk
+++ /dev/null
@@ -1,151 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=../..
-PRJNAME=toolkit
-TARGET=test
-TARGETTYPE=GUI
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-
-.IF "$(ENABLE_LAYOUT)" == "TRUE"
-
-# Allow zoom and wordcount to be built without depending on svx,sv,sfx2
-CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc -I../$(PRJ)/sc/inc -I../$(PRJ)/sc/source/ui/inc -I../$(PRJ)/sw/inc
-
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(COMNAME)" == "gcc3"
-CFLAGS+=-Wall -Wno-non-virtual-dtor
-.ENDIF
-
-CXXFILES=\
- editor.cxx \
- plugin.cxx \
- recover.cxx \
- wordcountdialog.cxx \
- test.cxx \
- zoom.cxx
-
-OBJFILES=\
- $(OBJ)$/editor.obj \
- $(OBJ)$/plugin.obj \
- $(OBJ)$/recover.obj \
- $(OBJ)$/test.obj \
- $(OBJ)$/tpsort.obj \
- $(OBJ)$/sortdlg.obj \
- $(OBJ)$/wordcountdialog.obj \
- $(OBJ)$/zoom.obj
-
-APP1TARGET=$(TARGET)
-APP1OBJS=$(OBJFILES)
-APP1STDLIBS= \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(VCLLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB) \
- $(XMLSCRIPTLIB) \
- $(TKLIB) \
- $(SVXLIB) \
- $(ISCLIB) \
-#
-
-svtools = $(INCCOM)/svtools
-default: ALLTAR
-
-.INCLUDE : target.mk
-
-XML_FILES=\
- insert-sheet.xml\
- message-box.xml\
- move-copy-sheet.xml\
- recover.xml\
- sort-options.xml\
- string-input.xml\
- tab-dialog.xml\
- wordcount.xml\
- zoom.xml\
-
-TRALAY=$(AUGMENT_LIBRARY_PATH) tralay
-XML_LANGS=$(alllangiso)
-
-ALLTAR: localize.sdf $(BIN)/testrc $(svtools) $(foreach,i,$(XML_FILES) en-US/$i)
-
-$(XML_LANGS:f:t"/%.xml ")/%.xml: %.xml
- $(TRALAY) -m localize.sdf -o . -l $(XML_LANGS:f:t" -l ") $<
- rm -rf en-US
-
-$(BIN)/%: %.in
- cp $< $@
-
-$(svtools):
-# FIXME: there's a bug in svtools layout or usage
-# Include files are in svtools/inc, but are referenced as <svtools/..>
-# They probably should be in svtools/inc/svtools
-# This means that include files can only be included after svtools
-# is built, which would mean a circular dependency,
-# because svtools depends on toolkit.
- ln -sf ..$/$(PRJ)$/svtools$/inc $(INCCOM)$/svtools
-
-dist .PHONY :
- cp -pv message-box.xml $(PRJ)/uiconfig/layout
- cp -pv tab-dialog.xml $(PRJ)/uiconfig/layout
- $(SHELL) ./un-test.sh zoom.cxx > ../$(PRJ)/svx/source/dialog/zoom.cxx
- $(SHELL) ./un-test.sh zoom.hxx > ../$(PRJ)/svx/source/dialog/zoom.hxx
- touch ../$(PRJ)/svx/source/dialog/dlgfact.cxx
- cp -pv zoom.xml ../$(PRJ)/svx/uiconfig/layout
- $(SHELL) ./un-test.sh wordcountdialog.cxx > ../$(PRJ)/sw/source/ui/dialog/wordcountdialog.cxx
- $(SHELL) ./un-test.sh wordcountdialog.hxx > ../$(PRJ)/sw/source/ui/inc/wordcountdialog.hxx
- touch ../$(PRJ)/sw/source/ui/dialog/swdlgfact.cxx
- cp -pv wordcount.xml ../$(PRJ)/sw/uiconfig/layout
- # FIXME: broken setup
- ln -sf ../inc/wordcountdialog.hxx ../$(PRJ)/sw/source/ui/dialog/wordcountdialog.hxx
- $(SHELL) ./un-test.sh tpsort.cxx > ../$(PRJ)/sc/source/ui/dbgui/tpsort.cxx
- $(SHELL) ./un-test.sh tpsort.hxx > ../$(PRJ)/sc/source/ui/inc/tpsort.hxx
- $(SHELL) ./un-test.sh sortdlg.cxx > ../$(PRJ)/sc/source/ui/dbgui/sortdlg.cxx
- $(SHELL) ./un-test.sh sortdlg.hxx > ../$(PRJ)/sc/source/ui/inc/sortdlg.hxx
- touch ../$(PRJ)/sc/source/ui/attrdlg/scdlgfact.cxx
- touch ../$(PRJ)/sc/source/ui/view/cellsh2.cxx
- cp -pv insert-sheet.xml ../$(PRJ)/sc/uiconfig/layout
- cp -pv move-copy-sheet.xml ../$(PRJ)/sc/uiconfig/layout
- cp -pv sort-options.xml ../$(PRJ)/sc/uiconfig/layout
- cp -pv string-input.xml ../$(PRJ)/sc/uiconfig/layout
-
-localize.sdf: $(PRJ)/../svx/source/dialog/localize.sdf $(PRJ)/../sw/source/ui/dialog/localize.sdf $(PRJ)/../sc/source/ui/src/localize.sdf
- grep sortdlg.src $(PRJ)/../sc/source/ui/src/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "sc\\uiconfig\\layout\\sort-options.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tRID_SCDLG_SORT_title/' > sort-options-$@
- grep wordcountdialog.src $(PRJ)/../sw/source/ui/dialog/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "sw\\uiconfig\\layout\\wordcount.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tDLG_WORDCOUNT_title/' > wordcount-$@
- grep zoom.src $(PRJ)/source/dialog/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "svx\\uiconfig\\layout\\zoom.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tRID_SVXDLG_ZOOM_title/' > zoom-$@
- echo '#empty' | cat - sort-options-$@ wordcount-$@ zoom-$@ > $@
- rm -f *-$@
-
-.ELSE # ENABLE_LAYOUT != TRUE
-all .PHONY:
-.ENDIF # ENABLE_LAYOUT != TRUE
diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src
index f9980f36002c..f52758f61785 100644
--- a/toolkit/workben/layout/sortdlg.src
+++ b/toolkit/workben/layout/sortdlg.src
@@ -33,6 +33,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
Size = MAP_APPFONT ( 260 , 185 ) ;
ListBox LB_SORT1
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT1";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 19 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -41,6 +42,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP1";
Pos = MAP_APPFONT ( 172 , 14 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Ascending" ;
@@ -48,6 +50,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN1
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN1";
Pos = MAP_APPFONT ( 172 , 28 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "~Descending" ;
@@ -61,6 +64,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT2
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT2";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 60 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -69,6 +73,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP2";
Pos = MAP_APPFONT ( 172 , 55 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "A~scending" ;
@@ -76,6 +81,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN2
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN2";
Pos = MAP_APPFONT ( 172 , 69 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "D~escending" ;
@@ -89,6 +95,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
ListBox LB_SORT3
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT3";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 101 ) ;
Size = MAP_APPFONT ( 154 , 90 ) ;
@@ -97,6 +104,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_UP3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP3";
Pos = MAP_APPFONT ( 172 , 96 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "As~cending" ;
@@ -104,6 +112,7 @@ TabPage RID_SCPAGE_SORT_FIELDS
};
RadioButton BTN_DOWN3
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN3";
Pos = MAP_APPFONT ( 172 , 110 ) ;
Size = MAP_APPFONT ( 79 , 10 ) ;
Text [ en-US ] = "Desce~nding" ;
@@ -126,6 +135,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
Size = MAP_APPFONT ( 260 , 185 ) ;
CheckBox BTN_CASESENSITIVE
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE";
Pos = MAP_APPFONT ( 12 , 6 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Case ~sensitive" ;
@@ -133,6 +143,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_LABEL
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_LABEL";
Pos = MAP_APPFONT ( 12 , 20 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
TabStop = TRUE ;
@@ -147,6 +158,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_FORMATS
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_FORMATS";
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Include ~formats" ;
@@ -154,6 +166,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_NATURALSORT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_NATURALSORT";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ de ] = "Enable ~natural sort" ;
@@ -165,6 +178,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_COPYRESULT
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT";
Pos = MAP_APPFONT ( 12 , 62 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Copy sort results to:" ;
@@ -172,6 +186,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_OUTAREA
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA";
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 73 ) ;
Size = MAP_APPFONT ( 93 , 90 ) ;
@@ -180,6 +195,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
Edit ED_OUTAREA
{
+ HelpID = "toolkit:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 73 ) ;
@@ -188,6 +204,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
CheckBox BTN_SORT_USER
{
+ HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER";
Pos = MAP_APPFONT ( 12 , 89 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "Custom sort ~order" ;
@@ -195,6 +212,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_SORT_USER
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER";
Disable = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 100 ) ;
@@ -210,6 +228,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_LANGUAGE
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 129 ) ;
Size = MAP_APPFONT ( 101 , 90 ) ;
@@ -225,6 +244,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
ListBox LB_ALGORITHM
{
+ HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM";
Border = TRUE ;
Pos = MAP_APPFONT ( 119 , 129 ) ;
Size = MAP_APPFONT ( 132 , 90 ) ;
@@ -239,6 +259,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_TOP_DOWN
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN";
Pos = MAP_APPFONT ( 12 , 158 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "~Top to bottom (sort rows)" ;
@@ -246,6 +267,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
};
RadioButton BTN_LEFT_RIGHT
{
+ HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT";
Pos = MAP_APPFONT ( 12 , 172 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text [ en-US ] = "L~eft to right (sort columns)" ;
diff --git a/toolkit/workben/makefile.mk b/toolkit/workben/makefile.mk
deleted file mode 100644
index 8e54c7737a20..000000000000
--- a/toolkit/workben/makefile.mk
+++ /dev/null
@@ -1,84 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=toolkit
-TARGET=unodialog
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= unodialog.cxx
-
-OBJFILES= $(OBJ)$/unodialog.obj
-
-
-APP2NOSAL= TRUE
-APP2TARGET= unodialog
-APP2OBJS= $(OBJ)$/unodialog.obj
-APP2STDLIBS=$(TOOLSLIB) \
- $(SOTLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(VCLLIB) \
- $(SALLIB)
-
-# $(SVTOOLLIB) \
-
-APP2DEF= $(MISC)$/unodialog.def
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-# ------------------------------------------------------------------
-# Windows
-# ------------------------------------------------------------------
-
-.IF "$(GUI)" == "WIN"
-
-$(MISC)$/unodialog.def: makefile.mk
- echo NAME unodialog >$@
- echo DESCRIPTION 'StarView - Testprogramm' >>$@
- echo EXETYPE WINDOWS >>$@
- echo STUB 'winSTUB.EXE' >>$@
- echo PROTMODE >>$@
- echo CODE PRELOAD MOVEABLE DISCARDABLE >>$@
- echo DATA PRELOAD MOVEABLE MULTIPLE >>$@
- echo HEAPSIZE 8192 >>$@
- echo STACKSIZE 32768 >>$@
-
-.ENDIF
diff --git a/tools/Executable_bestreversemap.mk b/tools/Executable_bestreversemap.mk
new file mode 100644
index 000000000000..c269296a607f
--- /dev/null
+++ b/tools/Executable_bestreversemap.mk
@@ -0,0 +1,38 @@
+# 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
+# Norbert Thiebaud <nthiebaud@gmail.com> (C) 2010, All Rights Reserved.
+#
+# 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.
+
+$(eval $(call gb_Executable_Executable,bestreversemap))
+
+$(eval $(call gb_Executable_set_include,bestreversemap,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/ \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,bestreversemap,\
+ sal \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,bestreversemap,\
+ tools/source/reversemap/bestreversemap \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Executable_mkunroll.mk b/tools/Executable_mkunroll.mk
new file mode 100644
index 000000000000..16cc39fd991d
--- /dev/null
+++ b/tools/Executable_mkunroll.mk
@@ -0,0 +1,59 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,mkunroll))
+
+$(eval $(call gb_Executable_set_include,mkunroll,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/inc) \
+ -I$(realpath $(SRCDIR)/tools/inc/pch) \
+ -I$(realpath $(SRCDIR)/tools/bootstrp) \
+))
+
+$(eval $(call gb_Executable_set_cxxflags,mkunroll,\
+ $$(CXXFLAGS) \
+ -D_TOOLS_STRINGLIST \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,mkunroll,\
+ basegfx \
+ sal \
+ tl \
+ $(gb_STDLIBS) \
+))
+
+# used to link against basegfxlx comphelp4gcc3 i18nisolang1gcc3 ucbhelper4gcc3 uno_cppu uno_cppuhelpergcc3 uno_salhelpergcc3 - seems to be superficial
+
+$(eval $(call gb_Executable_add_exception_objects,mkunroll,\
+ tools/bootstrp/addexes2/mkfilt \
+ tools/bootstrp/appdef \
+ tools/bootstrp/cppdep \
+ tools/bootstrp/inimgr \
+ tools/bootstrp/prj \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Executable_rscdep.mk b/tools/Executable_rscdep.mk
new file mode 100644
index 000000000000..f12a09296783
--- /dev/null
+++ b/tools/Executable_rscdep.mk
@@ -0,0 +1,69 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,rscdep))
+
+$(eval $(call gb_Executable_set_include,rscdep,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/inc) \
+ -I$(realpath $(SRCDIR)/tools/inc/pch) \
+ -I$(realpath $(SRCDIR)/tools/bootstrp) \
+))
+
+$(eval $(call gb_Executable_set_cxxflags,rscdep,\
+ $$(CXXFLAGS) \
+ -D_TOOLS_STRINGLIST \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,rscdep,\
+ sal \
+ tl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,rscdep,\
+ tools/bootstrp/appdef \
+ tools/bootstrp/cppdep \
+ tools/bootstrp/inimgr \
+ tools/bootstrp/prj \
+ tools/bootstrp/rscdep \
+))
+
+ifeq ($(OS),WNT)
+ifeq ($(HAVE_GETOPT),YES)
+$(eval $(call gb_Executable_set_cxxflags,rscdep,\
+ $$(CXXFLAGS) \
+ -DHAVE_GETOPT \
+))
+else
+$(eval $(call gb_Executable_add_linked_libs,rscdep,\
+ gnu_getopt \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Executable_so_checksum.mk b/tools/Executable_so_checksum.mk
new file mode 100644
index 000000000000..7adf7a998de7
--- /dev/null
+++ b/tools/Executable_so_checksum.mk
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,so_checksum))
+
+$(eval $(call gb_Executable_set_include,so_checksum,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/inc) \
+ -I$(realpath $(SRCDIR)/tools/inc/pch) \
+ -I$(realpath $(SRCDIR)/tools/bootstrp) \
+))
+
+$(eval $(call gb_Executable_set_cxxflags,so_checksum,\
+ $$(CXXFLAGS) \
+ -D_TOOLS_STRINGLIST \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,so_checksum,\
+ sal \
+ tl \
+ $(gb_STDLIBS) \
+))
+# used to link against basegfxlx comphelp4gcc3 i18nisolang1gcc3 ucbhelper4gcc3 uno_cppu uno_cppuhelpergcc3 uno_salhelpergcc3 vos3gcc3 - seems to be superficial
+
+$(eval $(call gb_Executable_add_exception_objects,so_checksum,\
+ tools/bootstrp/md5 \
+ tools/bootstrp/so_checksum \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Executable_sspretty.mk b/tools/Executable_sspretty.mk
new file mode 100644
index 000000000000..5cfd08768b6c
--- /dev/null
+++ b/tools/Executable_sspretty.mk
@@ -0,0 +1,57 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,sspretty))
+
+$(eval $(call gb_Executable_set_include,sspretty,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/inc) \
+ -I$(realpath $(SRCDIR)/tools/inc/pch) \
+ -I$(realpath $(SRCDIR)/tools/bootstrp) \
+))
+
+$(eval $(call gb_Executable_set_cxxflags,sspretty,\
+ $$(CXXFLAGS) \
+ -D_TOOLS_STRINGLIST \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,sspretty,\
+ sal \
+ tl \
+ $(gb_STDLIBS) \
+))
+# used to link against basegfxlx comphelp4gcc3 i18nisolang1gcc3 ucbhelper4gcc3 uno_cppu uno_cppuhelpergcc3 uno_salhelpergcc3 - seems to be superficial
+
+$(eval $(call gb_Executable_add_exception_objects,sspretty,\
+ tools/bootstrp/appdef \
+ tools/bootstrp/cppdep \
+ tools/bootstrp/inimgr \
+ tools/bootstrp/prj \
+ tools/bootstrp/sspretty \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk
new file mode 100644
index 000000000000..bd9cf81ba620
--- /dev/null
+++ b/tools/Library_tl.mk
@@ -0,0 +1,168 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,tl))
+
+$(eval $(call gb_Library_add_package_headers,tl,tools_inc))
+$(eval $(call gb_Library_add_package_headers,tl,tools_reversemap))
+
+$(eval $(call gb_Library_add_precompiled_header,tl,$(SRCDIR)/tools/inc/pch/precompiled_tools))
+
+$(eval $(call gb_Library_set_include,tl,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/inc) \
+ -I$(realpath $(SRCDIR)/tools/inc/pch) \
+ -I$(SRCDIR)/solenv/inc \
+ -I$(SRCDIR)/solenv/inc/Xp31 \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(WORKDIR)/CustomTarget/tools/source/reversemap \
+))
+
+$(eval $(call gb_Library_set_defs,tl,\
+ $$(DEFS) \
+ -DTOOLS_DLLIMPLEMENTATION \
+ -DVCL \
+))
+
+$(eval $(call gb_Library_add_linked_libs,tl,\
+ basegfx \
+ comphelper \
+ i18nisolang1 \
+ cppu \
+ sal \
+ $(gb_STDLIBS) \
+))
+
+
+$(eval $(call gb_Library_add_exception_objects,tl,\
+ tools/source/communi/geninfo \
+ tools/source/communi/parser \
+ tools/source/datetime/datetime \
+ tools/source/datetime/tdate \
+ tools/source/datetime/ttime \
+ tools/source/debug/debug \
+ tools/source/debug/stcktree \
+ tools/source/fsys/comdep \
+ tools/source/fsys/dirent \
+ tools/source/fsys/filecopy \
+ tools/source/fsys/fstat \
+ tools/source/fsys/tdir \
+ tools/source/fsys/tempfile \
+ tools/source/fsys/urlobj \
+ tools/source/fsys/wldcrd \
+ tools/source/generic/b3dtrans \
+ tools/source/generic/bigint \
+ tools/source/generic/color \
+ tools/source/generic/config \
+ tools/source/generic/fract \
+ tools/source/generic/gen \
+ tools/source/generic/line \
+ tools/source/generic/link \
+ tools/source/generic/poly \
+ tools/source/generic/poly2 \
+ tools/source/generic/svborder \
+ tools/source/generic/toolsin \
+ tools/source/generic/svlibrary \
+ tools/source/inet/inetmime \
+ tools/source/inet/inetmsg \
+ tools/source/inet/inetstrm \
+ tools/source/memtools/contnr \
+ tools/source/memtools/mempool \
+ tools/source/memtools/multisel \
+ tools/source/memtools/table \
+ tools/source/memtools/unqidx \
+ tools/source/misc/appendunixshellword \
+ tools/source/misc/extendapplicationenvironment \
+ tools/source/misc/getprocessworkingdir \
+ tools/source/misc/solarmutex \
+ tools/source/rc/isofallback \
+ tools/source/rc/rc \
+ tools/source/rc/resary \
+ tools/source/rc/resmgr \
+ tools/source/ref/errinf \
+ tools/source/ref/globname \
+ tools/source/ref/pstm \
+ tools/source/ref/ref \
+ tools/source/stream/cachestr \
+ tools/source/stream/stream \
+ tools/source/stream/strmsys \
+ tools/source/stream/vcompat \
+ tools/source/string/debugprint \
+ tools/source/string/tenccvt \
+ tools/source/string/tstring \
+ tools/source/string/tustring \
+ tools/source/string/reversemap \
+ tools/source/testtoolloader/testtoolloader \
+ tools/source/zcodec/zcodec \
+))
+
+ifeq ($(GUI),UNX)
+$(eval $(call gb_Library_add_exception_objects,tl,\
+ tools/unx/source/dll/toolsdll \
+))
+endif
+
+ifeq ($(SYSTEM_ZLIB),YES)
+$(eval $(call gb_Library_set_cxxflags,tl,\
+ $$(CXXFLAGS) \
+ -DSYSTEM_ZLIB \
+))
+$(eval $(call gb_Library_add_linked_libs,tl,\
+ z \
+))
+else
+$(eval $(call gb_Library_add_linked_static_libs,tl,\
+ zlib \
+))
+endif
+
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Library_set_include,tl,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/tools/win/inc) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,tl,\
+ tools/win/source/dll/toolsdll \
+))
+
+$(eval $(call gb_Library_add_linked_libs,tl,\
+ mpr \
+ ole32 \
+ shell32 \
+ user32 \
+ uuid \
+))
+
+endif
+
+# tools/source/string/debugprint -DDEBUG -DEXCEPTIONS_OFF -DOSL_DEBUG_LEVEL=2 -DSHAREDLIB -DTOOLS_DLLIMPLEMENTATION -D_DLL_ -O0 -fno-exceptions -fpic -fvisibility=hidden -g
+# -DOPTIMIZE
+# no -DTOOLS_DLLIMPLEMENTATION on toolsdll
+# -DEXCEPTIONS_OFF -fno-exceptions on geninfo parser datetime tdate ttime bigint color config fract gen line link poly2 svborder toolsin inetmime inetmsg inetstrm contnr mempool multisel table unqidx cachestr stream strmsys vcompat tenccvt tstring tustring testtoolloader
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 000000000000..a79aff831024
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/svtools/source/filter.vcl/ixbm/makefile.mk b/tools/Module_tools.mk
index 55708d2f2630..6e950b0c7a58 100644
--- a/svtools/source/filter.vcl/ixbm/makefile.mk
+++ b/tools/Module_tools.mk
@@ -25,20 +25,19 @@
#
#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME=svtools
-TARGET=ixbm
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-SOLARINC+=-I../../inc
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/xbmread.obj
-
-.INCLUDE : target.mk
+$(eval $(call gb_Module_Module,tools))
+
+$(eval $(call gb_Module_add_targets,tools,\
+ Executable_bestreversemap \
+ Executable_mkunroll \
+ Executable_rscdep \
+ Executable_so_checksum \
+ Executable_sspretty \
+ Library_tl \
+ Package_inc \
+ Package_reversemap \
+ StaticLibrary_ooopathutils \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
new file mode 100644
index 000000000000..3ee8689671b1
--- /dev/null
+++ b/tools/Package_inc.mk
@@ -0,0 +1,108 @@
+#*************************************************************************
+#
+# DO NOT ALTER 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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,tools_inc,$(SRCDIR)/tools/inc))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/StringListResource.hxx,tools/StringListResource.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/appendunixshellword.hxx,tools/appendunixshellword.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/b3dtrans.hxx,tools/b3dtrans.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/bigint.hxx,tools/bigint.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/cachestr.hxx,tools/cachestr.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/color.hxx,tools/color.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/config.hxx,tools/config.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/contnr.hxx,tools/contnr.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/date.hxx,tools/date.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/datetime.hxx,tools/datetime.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/debug.hxx,tools/debug.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/diagnose_ex.h,tools/diagnose_ex.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/dynary.hxx,tools/dynary.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/errcode.hxx,tools/errcode.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/errinf.hxx,tools/errinf.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/extendapplicationenvironment.hxx,tools/extendapplicationenvironment.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/fldunit.hxx,tools/fldunit.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/fontenum.hxx,tools/fontenum.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/fract.hxx,tools/fract.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/fsys.hxx,tools/fsys.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/gen.hxx,tools/gen.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/geninfo.hxx,tools/geninfo.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/getprocessworkingdir.hxx,tools/getprocessworkingdir.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/globname.hxx,tools/globname.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetdef.hxx,tools/inetdef.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmime.hxx,tools/inetmime.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmsg.hxx,tools/inetmsg.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetstrm.hxx,tools/inetstrm.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/iparser.hxx,tools/iparser.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/isofallback.hxx,tools/isofallback.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/line.hxx,tools/line.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/link.hxx,tools/link.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/list.hxx,tools/list.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/mapunit.hxx,tools/mapunit.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/mempool.hxx,tools/mempool.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/multisel.hxx,tools/multisel.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/ownlist.hxx,tools/ownlist.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/pathutils.hxx,tools/pathutils.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/poly.hxx,tools/poly.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/postsys.h,tools/postsys.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/postx.h,tools/postx.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/presys.h,tools/presys.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/prex.h,tools/prex.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/pstm.hxx,tools/pstm.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/queue.hxx,tools/queue.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/rc.h,tools/rc.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/rc.hxx,tools/rc.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/rcid.h,tools/rcid.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/ref.hxx,tools/ref.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resary.hxx,tools/resary.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resid.hxx,tools/resid.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resmgr.hxx,tools/resmgr.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/rtti.hxx,tools/rtti.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/shl.hxx,tools/shl.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/simplerm.hxx,tools/simplerm.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/solar.h,tools/solar.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/solarmutex.hxx,tools/solarmutex.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/stack.hxx,tools/stack.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/stream.hxx,tools/stream.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/string.hxx,tools/string.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/svborder.hxx,tools/svborder.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/svlibrary.hxx,tools/svlibrary.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/svwin.h,tools/svwin.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/table.hxx,tools/table.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/tempfile.hxx,tools/tempfile.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/tenccvt.hxx,tools/tenccvt.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/testtoolloader.hxx,tools/testtoolloader.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/time.hxx,tools/time.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/tools.h,tools/tools.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/toolsdllapi.h,tools/toolsdllapi.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/unqid.hxx,tools/unqid.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/unqidx.hxx,tools/unqidx.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/urlobj.hxx,tools/urlobj.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/vcompat.hxx,tools/vcompat.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/vector2d.hxx,tools/vector2d.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/weakbase.h,tools/weakbase.h))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/weakbase.hxx,tools/weakbase.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/wintypes.hxx,tools/wintypes.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/wldcrd.hxx,tools/wldcrd.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/zcodec.hxx,tools/zcodec.hxx))
diff --git a/tools/source/reversemap/makefile.mk b/tools/Package_reversemap.mk
index bfd3400d2d84..64450ae97d53 100644
--- a/tools/source/reversemap/makefile.mk
+++ b/tools/Package_reversemap.mk
@@ -1,6 +1,3 @@
-#*************************************************************************
-#
-#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
@@ -14,34 +11,23 @@
# License.
#
# The Initial Developer of the Original Code is
-# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
-# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
+# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
-# Contributor(s): Caolán McNamara <caolanm@redhat.com>
+# Contributor(s): Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
#
# 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.
-#
-#*************************************************************************
-
-PRJ = ../..
-PRJNAME = tl
-TARGET = bestreversemap
-LIBTARGET = NO
-TARGETTYPE = CUI
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE: settings.mk
-OBJFILES = \
- $(OBJ)$/bestreversemap.obj
+$(eval $(call gb_Package_Package,tools_reversemap,$(WORKDIR)/CustomTarget/tools/source/reversemap))
+$(eval $(call gb_Package_add_customtarget,tools_reversemap,tools/source/reversemap))
-APP1TARGET = bestreversemap
-APP1OBJS = $(OBJ)$/bestreversemap.obj
-APP1STDLIBS = $(SALLIB)
+$(eval $(call gb_CustomTarget_add_outdir_dependencies,tools/source/reversemap,\
+ $(call gb_Executable_get_target,bestreversemap) \
+))
-.INCLUDE: target.mk
+# vim: set noet sw=4:
diff --git a/svtools/source/config/test/makefile.mk b/tools/StaticLibrary_ooopathutils.mk
index 3f1eaac0efda..e58becb175d3 100644..100755
--- a/svtools/source/config/test/makefile.mk
+++ b/tools/StaticLibrary_ooopathutils.mk
@@ -14,48 +14,41 @@
#
# 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
+# 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
+# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..$/..$/..
-PRJNAME= svtools
-TARGET= test_configitems
-LIBTARGET= NO
-ENABLE_EXCEPTIONS= TRUE
-USE_DEFFILE= TRUE
+$(eval $(call gb_StaticLibrary_StaticLibrary,ooopathutils))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_StaticLibrary_add_package_headers,ooopathutils,tools_inc))
-.INCLUDE : settings.mk
+$(eval $(call gb_StaticLibrary_add_exception_objects,ooopathutils,\
+ tools/source/misc/pathutils \
+))
-# --- application: "test" --------------------------------------------------
-APP1TARGET= test
+# HACK for now
+# We really should fix the clients of this to link against the static library
+# Instead of this evil linking of an object from $(OUTDIR)
+define StaticLibrary_ooopathutils_hack
+$(call gb_StaticLibrary_get_target,ooopathutils) : $(OUTDIR)/lib/$(1)
+$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils)))
-APP1OBJS= $(SLO)$/test.obj \
- $(SLO)$/dynamicmenuoptions.obj
+$(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,tools/source/misc/pathutils)
+ $$(call gb_Deliver_deliver,$$<,$$@)
-DEPOBJFILES=$(APP1OBJS)
-
-APP1STDLIBS= $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(SALLIB) \
- $(TOOLSLIB) \
- $(VCLLIB)
-
-APP1DEPN= $(SLO)$/dynamicmenuoptions.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+endef
+ifeq ($(OS),WNT)
+$(eval $(call StaticLibrary_ooopathutils_hack,pathutils-obj.obj))
+else
+$(eval $(call StaticLibrary_ooopathutils_hack,pathutils-obj.o))
+endif
+# vim: set noet sw=4 ts=4:
diff --git a/tools/bootstrp/addexes/makefile.mk b/tools/bootstrp/addexes/makefile.mk
deleted file mode 100644
index 45ba1470a060..000000000000
--- a/tools/bootstrp/addexes/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=addexes
-TARGETTYPE=CUI
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-APP1TARGET= txtrepl
-APP1OBJS= $(OBJ)$/replace.obj
-APP1STDLIBS=$(TOOLSLIB)
-
-DEPOBJFILES = $(APP1OBJS)
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/bootstrp/addexes/replace.cxx b/tools/bootstrp/addexes/replace.cxx
index 761d260a03b5..07f8be79ab71 100644
--- a/tools/bootstrp/addexes/replace.cxx
+++ b/tools/bootstrp/addexes/replace.cxx
@@ -61,7 +61,7 @@ int _cdecl main( int argc, char *argv[] )
aUpperText.ToUpperAscii();
- ULONG nIndex;
+ sal_uIntPtr nIndex;
aSearch.ToUpperAscii();
nIndex = aUpperText.Search( aSearch.GetBuffer(), 0);
diff --git a/tools/bootstrp/addexes2/makefile.mk b/tools/bootstrp/addexes2/makefile.mk
deleted file mode 100644
index 8014fdb8eded..000000000000
--- a/tools/bootstrp/addexes2/makefile.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=addexes2
-TARGETTYPE=CUI
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-APP1TARGET= mkunroll
-APP1OBJS= $(OBJ)$/mkfilt.obj
-APP1STDLIBS= $(SALLIB) $(TOOLSLIB)
-.IF "$(OS)"=="LINUX"
-APP1STDLIBS+=-lpthread
-.ENDIF
-.IF "$(OS)"=="NETBSD"
-APP1STDLIBS+=-lpthread
-.ENDIF
-APP1LIBS= $(LB)$/btstrp.lib $(LB)$/bootstrp2.lib
-APP1DEPN= $(LB)$/atools.lib $(LB)$/btstrp.lib $(LB)$/bootstrp2.lib
-
-
-DEPOBJFILES = $(APP1OBJS)
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/bootstrp/addexes2/mkfilt.cxx b/tools/bootstrp/addexes2/mkfilt.cxx
index 56e4a276b819..b454f901de5b 100644
--- a/tools/bootstrp/addexes2/mkfilt.cxx
+++ b/tools/bootstrp/addexes2/mkfilt.cxx
@@ -90,16 +90,16 @@ class MkLine
public:
ByteString aLine;
ByteStringList* pPrivateTnrLst;
- BOOL bOut;
- BOOL bHier;
+ sal_Bool bOut;
+ sal_Bool bHier;
MkLine();
};
MkLine::MkLine()
{
- bOut = FALSE;
- bHier = FALSE;
+ bOut = sal_False;
+ bHier = sal_False;
pPrivateTnrLst = NULL;
}
@@ -165,32 +165,32 @@ void MkFilter::Filter()
MkLine *pMkLine = new MkLine();
ByteString *pStr = new ByteString( aLineBuf );
pMkLine->aLine = *pStr;
- pMkLine->bOut = FALSE;
+ pMkLine->bOut = sal_False;
pLst->push_back( pMkLine );
}
else if ( nState == 1 )
{
- BOOL bInTnrList = TRUE;
+ sal_Bool bInTnrList = sal_True;
fprintf( stderr, ":" );
MkLine *pMkLine = new MkLine();
if ( aLine.Search("unroll end") != STRING_NOTFOUND )
{
fprintf( stderr, ";\nunroll end\n" );
MkLine *p_MkLine = new MkLine();
- p_MkLine->bHier = TRUE;
+ p_MkLine->bHier = sal_True;
ByteString *pByteString = new ByteString("# do not delete this line === mkfilter3i\n");
p_MkLine->aLine = *pByteString;
- p_MkLine->bOut = FALSE;
+ p_MkLine->bOut = sal_False;
p_MkLine->pPrivateTnrLst = pTnrLst;
pTnrLst = new ByteStringList();
pLst->push_back( p_MkLine );
nState = 0;
- bInTnrList = FALSE;
+ bInTnrList = sal_False;
}
ByteString *pStr = new ByteString( aLineBuf );
pMkLine->aLine = *pStr;
- pMkLine->bOut = FALSE;
+ pMkLine->bOut = sal_False;
if ( bInTnrList )
pTnrLst->push_back( pMkLine );
@@ -209,14 +209,14 @@ void MkFilter::Filter()
if ( pLine->bHier )
{
// die List n - Mal abarbeiten
- for ( USHORT n=1; n<11; n++)
+ for ( sal_uInt16 n=1; n<11; n++)
{
size_t nCount = pLine->pPrivateTnrLst->size();
for ( size_t i=0; i<nCount; i++ )
{
MkLine *pMkLine = (*pLine->pPrivateTnrLst)[ i ];
ByteString aLine = pMkLine->aLine;
- while( aLine.SearchAndReplace( aTnr, ByteString::CreateFromInt32( n )) != (USHORT)-1 ) ;
+ while( aLine.SearchAndReplace( aTnr, ByteString::CreateFromInt32( n )) != (sal_uInt16)-1 ) ;
fputs( aLine.GetBuffer(), pOut );
fprintf( stderr, "o" );
}
diff --git a/tools/bootstrp/command.cxx b/tools/bootstrp/command.cxx
deleted file mode 100644
index 51fd7ea4e98a..000000000000
--- a/tools/bootstrp/command.cxx
+++ /dev/null
@@ -1,639 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_tools.hxx"
-
-#ifdef PRECOMPILED
-#include "first.hxx"
-#endif
-
-#include <tools/fsys.hxx>
-#include <tools/stream.hxx>
-#include "bootstrp/command.hxx"
-#include <tools/debug.hxx>
-#include "bootstrp/appdef.hxx"
-
-#ifdef _MSC_VER
-#pragma warning (push,1)
-#endif
-
-#include <iostream>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
-
-#if defined(WNT) || defined(OS2)
-#ifdef _MSC_VER
-#pragma warning (push,1)
-#endif
-#include <process.h> // for _SPAWN
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
-#endif
-#ifdef UNX
-#include <sys/types.h>
-#include <unistd.h>
-#if ( defined NETBSD ) || defined (FREEBSD) || defined (AIX) \
- || defined (MACOSX) || defined (OPENBSD) \
- || defined(DRAGONFLY)
-#include <sys/wait.h>
-#else
-#include <wait.h>
-#endif
-#define P_WAIT 1 // erstmal einen dummz
-#endif
-
-#if defined WNT
-#include <tools/svwin.h>
-#endif
-
-#if defined(WNT) || defined(OS2)
-#define cPathSeperator ';'
-#endif
-#ifdef UNX
-#define cPathSeperator ':'
-#endif
-
-/*****************************************************************************/
-CommandLine::CommandLine(BOOL bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- exit(0);
- }
- CommandBuffer[0] = '\0';
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-}
-
-/*****************************************************************************/
-CommandLine::CommandLine(const char *CommandString, BOOL bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- exit(0);
- }
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-
- BuildCommand(CommandString);
-}
-
-/*****************************************************************************/
-CommandLine::CommandLine(const CommandLine& CCommandLine, BOOL bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- exit(0);
- }
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-
- BuildCommand(CCommandLine.CommandBuffer);
-}
-
-/*****************************************************************************/
-CommandLine::~CommandLine()
-/*****************************************************************************/
-{
- delete [] CommandBuffer;
- delete [] ComShell;
- for (int i = 0; ppArgv[i] != 0; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
-
-}
-
-/*****************************************************************************/
-CommandLine& CommandLine::operator=(const CommandLine& CCommandLine)
-/*****************************************************************************/
-{
- strcpy (CommandBuffer, CCommandLine.CommandBuffer);
- for (int i = 0; i != nArgc; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
- BuildCommand(CommandBuffer);
- return *this;
-}
-
-/*****************************************************************************/
-CommandLine& CommandLine::operator=(const char *CommandString)
-/*****************************************************************************/
-{
- strcpy (CommandBuffer, CommandString);
- for (int i = 0; i != nArgc; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
- BuildCommand(CommandBuffer);
-
- return *this;
-}
-
-/*****************************************************************************/
-void CommandLine::Print()
-/*****************************************************************************/
-{
-}
-
-/*****************************************************************************/
-void CommandLine::BuildCommand(const char *CommandString)
-/*****************************************************************************/
-{
- int index = 0, pos=0;
- char buffer[1024];
- char WorkString[1024];
-
- strcpy(WorkString,CommandString);
-
- //falls LogWindow -> in tmpfile schreiben
- if(bTmpWrite)
- {
- strcpy(&WorkString[strlen(WorkString)]," >&");
- strcpy(&WorkString[strlen(WorkString)],getenv("TMP"));
- strcpy(&WorkString[strlen(WorkString)],TMPNAME);
- }
-
- // delete old memory and get some new memory for CommandBuffer
- delete [] CommandBuffer;
- CommandBuffer = new char [strlen(ComShell)+strlen(WorkString)+1];
- if (CommandBuffer == NULL) {
- exit(0);
- }
- strcpy (CommandBuffer, ComShell);
- strcpy (&CommandBuffer[strlen(ComShell)], WorkString);
-
- CommandString = CommandBuffer;
-
- // get the number of tokens
- Strtokens(CommandString);
-
- // delete the space for the old CommandLine
- for (int i = 0; ppArgv[i] != 0; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
-
- /* get space for the new command line */
- ppArgv = (char **) new char * [nArgc+1];
- if (ppArgv == NULL) {
- exit(0);
- }
-
- // flush the white space
- while ( isspace(*CommandString) )
- CommandString++;
-
- index = 0;
-
- // start the loop to build all the individual tokens
- while (*CommandString != '\0') {
- pos = 0;
-
- // copy the token until white space is found
- while ( !isspace(*CommandString) && *CommandString != '\0') {
- buffer[pos++] = *CommandString++;
- }
-
- buffer[pos] = '\0';
-
- // get space for the individual tokens
- ppArgv[index] = (char *) new char [strlen(buffer)+1];
- if (ppArgv[index] == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
-
- // copy the token
- strcpy (ppArgv[index++], buffer);
-
- // flush while space
- while ( isspace(*CommandString) )
- CommandString++;
- }
-
- // finish by setting the las pointer to NULL
- ppArgv[nArgc]= NULL;
-
-}
-
-/*****************************************************************************/
-void CommandLine::Strtokens(const char *CommandString)
-/*****************************************************************************/
-{
- int count = 0;
- const char *temp;
-
- temp = CommandString;
-
- /* bypass white space */
- while (isspace(*temp)) temp++;
-
- for (count=0; *temp != '\0'; count++) {
- /* continue until white space of string terminator is found */
- while ((!isspace(*temp)) && (*temp != '\0')) temp++;
-
- /* bypass white space */
- while (isspace(*temp)) temp++;
-
- }
- nArgc = count;
-}
-
-/*****************************************************************************/
-CCommand::CCommand( ByteString &rString )
-/*****************************************************************************/
-{
- rString.SearchAndReplace( '\t', ' ' );
- aCommand = rString.GetToken( 0, ' ' );
- aCommandLine = Search( "PATH" );
-#ifndef UNX
- aCommandLine += " /c ";
-#else
- aCommandLine += " -c ";
-#endif
-
- ByteString sCmd( rString.GetToken( 0, ' ' ));
- ByteString sParam( rString.Copy( sCmd.Len()));
-
- aCommandLine += Search( "PATH", sCmd );
- aCommandLine += sParam;
-
- ImplInit();
-}
-
-/*****************************************************************************/
-CCommand::CCommand( const char *pChar )
-/*****************************************************************************/
-{
- ByteString aString = pChar;
- aString.SearchAndReplace( '\t', ' ' );
- aCommand = aString.GetToken( 0, ' ' );
-
- aCommandLine = Search( "PATH" );
-#ifndef UNX
- aCommandLine += " /c ";
-#else
- aCommandLine += " -c ";
-#endif
- ByteString rString( pChar );
-
- ByteString sCmd( rString.GetToken( 0, ' ' ));
- ByteString sParam( rString.Copy( sCmd.Len()));
-
- aCommandLine += Search( "PATH", sCmd );
- aCommandLine += sParam;
-
- ImplInit();
-}
-
-/*****************************************************************************/
-void CCommand::ImplInit()
-/*****************************************************************************/
-{
- char pTmpStr[255];
- size_t *pPtr;
- char *pChar;
- int nVoid = sizeof( size_t * );
- nArgc = aCommandLine.GetTokenCount(' ');
- ULONG nLen = aCommandLine.Len();
-
- ppArgv = (char **) new char[ (ULONG)(nLen + nVoid * (nArgc +2) + nArgc ) ];
- pChar = (char *) ppArgv + ( (1+nArgc) * nVoid );
- pPtr = (size_t *) ppArgv;
- for ( xub_StrLen i=0; i<nArgc; i++ )
- {
- (void) strcpy( pTmpStr, aCommandLine.GetToken(i, ' ' ).GetBuffer() );
- size_t nStrLen = strlen( pTmpStr ) + 1;
- strcpy( pChar, pTmpStr );
- *pPtr = (sal_uIntPtr) pChar;
- pChar += nStrLen;
- pPtr += 1;
-#ifdef UNX
- if ( i == 1 )
- {
- USHORT nWo = aCommandLine.Search("csh -c ");
- if (nWo != STRING_NOTFOUND)
- aCommandLine.Erase(0, nWo + 7);
- else
- aCommandLine.Erase(0, 16);
- i = nArgc;
- strcpy( pChar, aCommandLine.GetBuffer() );
- *pPtr = (sal_uIntPtr) pChar;
- pPtr += 1;
- }
-#endif
- }
- *pPtr = 0;
-}
-
-/*****************************************************************************/
-CCommand::operator int()
-/*****************************************************************************/
-{
- int nRet;
-#if defined WNT
- nRet = _spawnv( P_WAIT, ppArgv[0], (const char **) ppArgv );
-#elif defined OS2
- nRet = _spawnv( P_WAIT, ppArgv[0], ppArgv );
-#elif defined UNX
- pid_t pid;
-
- if (( pid = fork()) < 0 )
- DBG_ASSERT( FALSE, "fork error" );
- else if ( pid == 0 )
- if ( execv( ppArgv[0], (char * const *) ppArgv ) < 0 )
- DBG_ASSERT( FALSE, "execv failed" );
- if ( (nRet = waitpid( pid, NULL, 0 ) < 0) )
- DBG_ASSERT( FALSE, "wait error" );
-#endif
-
- switch ( errno )
- {
- case E2BIG :
- nError = COMMAND_TOOBIG;
- break;
- case EINVAL :
- nError = COMMAND_INVALID;
- break;
- case ENOENT:
- nError = COMMAND_NOTFOUND;
- break;
- case ENOEXEC :
- nError = COMMAND_NOEXEC;
- break;
- case ENOMEM :
- nError = COMMAND_NOMEM;
- break;
- default:
- nError = COMMAND_UNKNOWN;
- }
-
- if ( nRet )
- fprintf( stderr, "Program returned with errros\n");
- return nRet;
-}
-
-/*****************************************************************************/
-ByteString CCommand::Search(ByteString aEnv, ByteString sItem)
-/*****************************************************************************/
-{
- // default wird eine Shell im Path gesucht,
- // wenn aber compsec gestzt ist holen wir uns die
- // Shell von dort
- if ( sItem.Equals( COMMAND_SHELL ))
- {
- ByteString aComspec = GetEnv( "COMSPEC" );
- if ( !aComspec.Equals(""))
- return aComspec;
- }
-
- DirEntry aItem( String( sItem, RTL_TEXTENCODING_ASCII_US ));
- if ( aItem.Exists())
- return sItem;
-
- ByteString aEntry, sReturn;
- ByteString sEnv( aEnv );
- ByteString sEnvironment = GetEnv( sEnv.GetBuffer());
- xub_StrLen nCount = sEnvironment.GetTokenCount( cPathSeperator );
-
- BOOL bFound = FALSE;
-
- for ( xub_StrLen i=0; i<nCount && !bFound; i++ )
- {
- aEntry = sEnvironment.GetToken(i, cPathSeperator );
-#ifndef UNX
- aEntry += '\\';
-#else
- aEntry += '/';
-#endif
- aEntry += sItem;
-
- String sEntry( aEntry, RTL_TEXTENCODING_ASCII_US );
- DirEntry aDirEntry( sEntry );
- aDirEntry.ToAbs();
- if ( aDirEntry.Exists()) {
- sReturn = aEntry;
- bFound = TRUE;
- }
- }
- if ( !bFound )
- {
- sEnv = sEnv.ToUpperAscii();
- ByteString sEnvironment2 = GetEnv(sEnv.GetBuffer() );
- xub_StrLen nCount2 = sEnvironment2.GetTokenCount( cPathSeperator );
- for ( xub_StrLen i=0; i<nCount2 && !bFound; i++ )
- {
- aEntry = sEnvironment2.GetToken(i, cPathSeperator );
-#ifndef UNX
- aEntry += '\\';
-#else
- aEntry += '/';
-#endif
- aEntry += sItem;
-
- String sEntry( aEntry, RTL_TEXTENCODING_ASCII_US );
- DirEntry aDirEntry( sEntry );
- aDirEntry.ToAbs();
- if ( aDirEntry.Exists()) {
- sReturn = aEntry;
- bFound = TRUE;
- }
- }
- }
-
- if ( sReturn.Equals( "" ))
- sReturn = sItem;
-
- return sReturn;
-}
-
-/*****************************************************************************/
-CCommandd::CCommandd( ByteString &rString, CommandBits nBits )
-/*****************************************************************************/
- : CCommand( rString ),
- nFlag( nBits )
-{
-}
-
-
-/*****************************************************************************/
-CCommandd::CCommandd( const char *pChar, CommandBits nBits )
-/*****************************************************************************/
- : CCommand( pChar ),
- nFlag( nBits )
-{
-}
-
-/*****************************************************************************/
-CCommandd::operator int()
-/*****************************************************************************/
-{
- int nRet = 0;
-
-#ifdef WNT
- LPCTSTR lpApplicationName = NULL;
- LPTSTR lpCommandLine = (char *) GetCommandLine_().GetBuffer();
- LPSECURITY_ATTRIBUTES lpProcessAttributes = NULL;
- LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- BOOL bInheritHandles = TRUE;
-
- // wie wuenschen wir denn gestartet zu werden ??
- DWORD dwCreationFlags;
-
- if ( nFlag & COMMAND_EXECUTE_START )
- dwCreationFlags = DETACHED_PROCESS;
- else
- dwCreationFlags = CREATE_NEW_CONSOLE;
-
- // wir erben vom Vaterprozess
- LPVOID lpEnvironment = NULL;
-
- // das exe im Pfad suchen
- LPCTSTR lpCurrentDirectory = NULL;
-
- // in dieser Struktur bekommen wir die erzeugte Processinfo
- // zurueck
- PROCESS_INFORMATION aProcessInformation;
-
- // weiteres Startupinfo anlegen
- STARTUPINFO aStartupInfo;
-
- aStartupInfo.cb = sizeof( STARTUPINFO );
- aStartupInfo.lpReserved = NULL;
- aStartupInfo.lpDesktop = NULL;
-
- // das Fenster bekommt den Namen des Exes
- aStartupInfo.lpTitle = NULL;
- aStartupInfo.dwX = 100;
- aStartupInfo.dwY = 100;
- aStartupInfo.dwXCountChars = 40;
- aStartupInfo.dwYCountChars = 40;
-
- // Farben setzen
- aStartupInfo.dwFillAttribute = FOREGROUND_RED | BACKGROUND_RED |
- BACKGROUND_BLUE | BACKGROUND_GREEN;
-
- aStartupInfo.wShowWindow = SW_SHOWNOACTIVATE;
- aStartupInfo.cbReserved2 = NULL;
- aStartupInfo.lpReserved2 = NULL;
-
- if ( nFlag & COMMAND_EXECUTE_HIDDEN )
- {
- aStartupInfo.wShowWindow = SW_HIDE;
- aStartupInfo.dwFlags = aStartupInfo.dwFlags | STARTF_USESHOWWINDOW;
- }
-
- bool bProcess = CreateProcess( lpApplicationName,
- lpCommandLine, lpProcessAttributes,
- lpThreadAttributes, bInheritHandles,
- dwCreationFlags, lpEnvironment, lpCurrentDirectory,
- &aStartupInfo, &aProcessInformation );
-
- LPVOID lpMsgBuf;
-
- if ( bProcess )
- {
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL );
-
- ByteString aErrorString = (char *) lpMsgBuf;
-
- if ( nFlag & COMMAND_EXECUTE_WAIT )
- {
- DWORD aProcessState = STILL_ACTIVE;
- while(aProcessState == STILL_ACTIVE)
- {
- GetExitCodeProcess(aProcessInformation.hProcess,&aProcessState);
- }
- }
- }
- else
- fprintf( stderr, "Can not start Process !" );
-
-#endif
- return nRet;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx
index 7ad18a494531..ad5bb80eaffc 100644
--- a/tools/bootstrp/cppdep.cxx
+++ b/tools/bootstrp/cppdep.cxx
@@ -81,26 +81,26 @@ void CppDep::Execute()
}
}
-BOOL CppDep::AddSearchPath( const char* aPath )
+sal_Bool CppDep::AddSearchPath( const char* aPath )
{
ByteString *pStr = new ByteString( aPath );
pSearchPath->push_back( pStr );
- return FALSE;
+ return sal_False;
}
-BOOL CppDep::AddSource( const char* aSource )
+sal_Bool CppDep::AddSource( const char* aSource )
{
ByteString *pStr = new ByteString( aSource );
pSources->push_back( pStr );
- return FALSE;
+ return sal_False;
}
-BOOL CppDep::Search( ByteString aFileName )
+sal_Bool CppDep::Search( ByteString aFileName )
{
#ifdef DEBUG_VERBOSE
fprintf( stderr, "SEARCH : %s\n", aFileName.GetBuffer());
#endif
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SvFileStream aFile;
ByteString aReadLine;
@@ -110,7 +110,7 @@ BOOL CppDep::Search( ByteString aFileName )
aFile.Open( suFileName, STREAM_READ );
while ( aFile.ReadLine( aReadLine ))
{
- USHORT nPos = aReadLine.Search( "include" );
+ sal_uInt16 nPos = aReadLine.Search( "include" );
if ( nPos != STRING_NOTFOUND )
{
#ifdef DEBUG_VERBOSE
@@ -125,13 +125,13 @@ BOOL CppDep::Search( ByteString aFileName )
if ( aResult !="")
if ( (aNewFile = Exists( aResult )) != "" )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
size_t nCount = pFileList->size();
for ( size_t i = 0; i < nCount; i++ )
{
ByteString *pStr = (*pFileList)[ i ];
if ( *pStr == aNewFile )
- bFound = TRUE;
+ bFound = sal_True;
}
#ifdef DEBUG_VERBOSE
fprintf( stderr, "not in list : %d %s\n", nPos, aReadLine.GetBuffer() );
@@ -227,7 +227,7 @@ ByteString CppDep::IsIncludeStatement( ByteString aLine )
if ( aTmpStr.Equals("#include") )
{
aTmpStr = aLine.Erase( 0, 8 );
- USHORT nLen = aLine.Len();
+ sal_uInt16 nLen = aLine.Len();
aLine.Erase( nLen-1, 1 );
aLine.Erase( 0, 1 );
#ifdef DEBUG_VERBOSE
diff --git a/tools/bootstrp/cppdep.hxx b/tools/bootstrp/cppdep.hxx
index d180bd8b115a..d1e4397f0476 100644
--- a/tools/bootstrp/cppdep.hxx
+++ b/tools/bootstrp/cppdep.hxx
@@ -42,7 +42,7 @@ protected:
ByteStringList *pFileList;
ByteStringList *pSources;
- BOOL Search( ByteString aFileName );
+ sal_Bool Search( ByteString aFileName );
ByteString Exists( ByteString aFileName );
ByteString IsIncludeStatement( ByteString aLine );
@@ -53,8 +53,8 @@ public:
virtual void Execute();
ByteStringList* GetDepList(){return pFileList;}
- BOOL AddSearchPath( const char* aPath );
- BOOL AddSource( const char * aSource );
+ sal_Bool AddSearchPath( const char* aPath );
+ sal_Bool AddSource( const char * aSource );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/bootstrp/inimgr.cxx b/tools/bootstrp/inimgr.cxx
index ebebcd692e9b..3d9d818e1a38 100644
--- a/tools/bootstrp/inimgr.cxx
+++ b/tools/bootstrp/inimgr.cxx
@@ -43,7 +43,7 @@
/****************************************************************************/
IniManager::IniManager( ByteString &rDir, ByteString &rLocalDir )
/****************************************************************************/
- : bUpdate( TRUE )
+ : bUpdate( sal_True )
{
sLocalPath = ByteString( getenv( "LOCALINI" ));
if ( !sLocalPath.Len())
@@ -60,7 +60,7 @@ IniManager::IniManager( ByteString &rDir, ByteString &rLocalDir )
/****************************************************************************/
IniManager::IniManager( ByteString &rDir )
/****************************************************************************/
- : bUpdate( TRUE )
+ : bUpdate( sal_True )
{
sLocalPath = GetLocalIni();
sGlobalDir = rDir;
@@ -74,7 +74,7 @@ IniManager::IniManager( ByteString &rDir )
/****************************************************************************/
IniManager::IniManager()
/****************************************************************************/
- : bUpdate( TRUE )
+ : bUpdate( sal_True )
{
sLocalPath = GetLocalIni();
@@ -170,7 +170,7 @@ void IniManager::ForceUpdate()
sLocalPath += "/";
#endif
- for ( USHORT i=0; i < aDir.Count(); i++ ) {
+ for ( sal_uInt16 i=0; i < aDir.Count(); i++ ) {
ByteString sEntry( aDir[i].GetName(), gsl_getSystemTextEncoding());
if (( sEntry != "." ) &&
( sEntry != ".." ))
@@ -206,7 +206,7 @@ void IniManager::Update()
if ( bUpdate )
{
ForceUpdate();
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
}
diff --git a/tools/bootstrp/makefile.mk b/tools/bootstrp/makefile.mk
deleted file mode 100644
index b4508e1aa21f..000000000000
--- a/tools/bootstrp/makefile.mk
+++ /dev/null
@@ -1,106 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=tools
-TARGET=btstrp
-TARGET1=bootstrp2
-TARGETTYPE=CUI
-LIBTARGET=NO
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.IF "$(HAVE_GETOPT)" == "YES"
-CDEFS += -DHAVE_GETOPT
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= \
- $(OBJ)$/appdef.obj \
- $(OBJ)$/command.obj \
- $(OBJ)$/cppdep.obj\
- $(OBJ)$/inimgr.obj\
- $(OBJ)$/mkcreate.obj \
- $(OBJ)$/sstring.obj \
- $(OBJ)$/prj.obj
-
-SLOFILES= \
- $(SLO)$/appdef.obj \
- $(SLO)$/command.obj \
- $(SLO)$/cppdep.obj \
- $(SLO)$/inimgr.obj \
- $(SLO)$/mkcreate.obj \
- $(SLO)$/sstring.obj \
- $(SLO)$/prj.obj
-
-
-LIB1TARGET= $(LB)$/$(TARGET).lib
-LIB1ARCHIV= $(LB)$/lib$(TARGET).a
-LIB1OBJFILES=\
- $(OBJ)$/appdef.obj \
- $(OBJ)$/command.obj \
- $(OBJ)$/cppdep.obj \
- $(OBJ)$/inimgr.obj \
- $(OBJ)$/mkcreate.obj \
- $(OBJ)$/sstring.obj
-
-LIB2TARGET= $(LB)$/$(TARGET1).lib
-LIB2ARCHIV= $(LB)$/lib$(TARGET1).a
-LIB2OBJFILES=\
- $(OBJ)$/prj.obj
-
-APP1TARGET= sspretty
-APP1OBJS= $(OBJ)$/sspretty.obj
-APP1LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib
-APP1STDLIBS=$(SALLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB)
-
-APP2TARGET= rscdep
-APP2OBJS= $(OBJ)$/rscdep.obj
-APP2LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib
-APP2STDLIBS= $(SALLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
-.IF "$(HAVE_GETOPT)" != "YES"
-.IF "$(OS)"=="WNT"
-APP2STDLIBS+=gnu_getopt.lib
-.ENDIF
-.ENDIF
-APP2RPATH= NONE
-APP2RPATH= NONE
-APP2RPATH= NONE
-
-APP3TARGET= so_checksum
-APP3OBJS= $(OBJ)$/md5.obj \
- $(OBJ)$/so_checksum.obj
-APP3STDLIBS= $(TOOLSLIB) $(SALLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB)
-
-DEPOBJFILES = $(APP1OBJS) $(APP2OBJS) $(APP3OBJS)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/bootstrp/mkcreate.cxx b/tools/bootstrp/mkcreate.cxx
index 2c02bd894d3c..f151464772a1 100644
--- a/tools/bootstrp/mkcreate.cxx
+++ b/tools/bootstrp/mkcreate.cxx
@@ -60,7 +60,7 @@ char const *LimitedPath[] = {
/*****************************************************************************/
SourceDirectory::SourceDirectory( const ByteString &rDirectoryName,
- USHORT nOperatingSystem, SourceDirectory *pParentDirectory )
+ sal_uInt16 nOperatingSystem, SourceDirectory *pParentDirectory )
/*****************************************************************************/
: ByteString( rDirectoryName ),
pParent( pParentDirectory ),
@@ -88,7 +88,7 @@ SourceDirectory::~SourceDirectory()
/*****************************************************************************/
CodedDependency *SourceDirectory::AddCodedDependency(
- const ByteString &rCodedIdentifier, USHORT nOperatingSystems )
+ const ByteString &rCodedIdentifier, sal_uInt16 nOperatingSystems )
/*****************************************************************************/
{
CodedDependency *pReturn = NULL;
@@ -115,7 +115,7 @@ CodedDependency *SourceDirectory::AddCodedDependency(
/*****************************************************************************/
CodedDependency *SourceDirectory::AddCodedIdentifier(
- const ByteString &rCodedIdentifier, USHORT nOperatingSystems )
+ const ByteString &rCodedIdentifier, sal_uInt16 nOperatingSystems )
/*****************************************************************************/
{
CodedDependency *pReturn = NULL;
@@ -169,22 +169,22 @@ SourceDirectory *SourceDirectory::GetRootDirectory()
/*****************************************************************************/
SourceDirectory *SourceDirectory::GetSubDirectory(
- const ByteString &rDirectoryPath, USHORT nOperatingSystem )
+ const ByteString &rDirectoryPath, sal_uInt16 nOperatingSystem )
/*****************************************************************************/
{
ByteString sSearch;
- BOOL bSubs = TRUE;
- ULONG nIndex = 0;
+ sal_Bool bSubs = sal_True;
+ sal_uIntPtr nIndex = 0;
while ( bSubs && ByteString( LimitedPath[ nIndex ]) != "EndOf_LimitedPath" ) {
SourceDirectory *pActDir = this;
ByteString sLimitation( LimitedPath[ nIndex ]);
- BOOL bBreak = FALSE;
- for ( ULONG i = sLimitation.GetTokenCount( '\\' ); i > 0 && !bBreak; i-- ) {
- if (( !pActDir ) || ( *pActDir != sLimitation.GetToken(( USHORT )( i - 1 ), '\\' )))
- bBreak = TRUE;
+ sal_Bool bBreak = sal_False;
+ for ( sal_uIntPtr i = sLimitation.GetTokenCount( '\\' ); i > 0 && !bBreak; i-- ) {
+ if (( !pActDir ) || ( *pActDir != sLimitation.GetToken(( sal_uInt16 )( i - 1 ), '\\' )))
+ bBreak = sal_True;
else
pActDir = pActDir->pParent;
}
@@ -220,7 +220,7 @@ SourceDirectory *SourceDirectory::GetSubDirectory(
/*****************************************************************************/
SourceDirectory *SourceDirectory::GetDirectory(
- const ByteString &rDirectoryName, USHORT nOperatingSystem )
+ const ByteString &rDirectoryName, sal_uInt16 nOperatingSystem )
/*****************************************************************************/
{
ByteString sDirectoryName( rDirectoryName );
@@ -246,7 +246,7 @@ SourceDirectory *SourceDirectory::GetDirectory(
/*****************************************************************************/
SourceDirectory *SourceDirectory::Insert( const ByteString &rDirectoryName,
- USHORT nOperatingSystem )
+ sal_uInt16 nOperatingSystem )
/*****************************************************************************/
{
SourceDirectory *pSubDirectory = NULL;
@@ -271,7 +271,7 @@ Dependency *SourceDirectory::ResolvesDependency(
size_t nPos = pCodedIdentifier->IsString( pCodedDependency );
if ( nPos != NOT_THERE ) {
CodedDependency *pIdentifier = ( CodedDependency* )(*pCodedIdentifier)[ nPos ];
- USHORT nResult =
+ sal_uInt16 nResult =
pIdentifier->GetOperatingSystem() &
pCodedDependency->GetOperatingSystem();
Dependency *pReturn = new Dependency( *this, nResult );
@@ -352,10 +352,10 @@ ByteString SourceDirectory::GetTarget()
return sReturn;
}
- BOOL bDependsOnPlatform = FALSE;
+ sal_Bool bDependsOnPlatform = sal_False;
for ( size_t i = 0; i < pDependencies->size(); i++ ) {
if ( ((Dependency*)(*pDependencies)[ i ])->GetOperatingSystem() != OS_ALL ) {
- bDependsOnPlatform = TRUE;
+ bDependsOnPlatform = sal_True;
break;
}
}
@@ -376,17 +376,17 @@ ByteString SourceDirectory::GetTarget()
ByteString sUNX( ".IF \"$(GUI)\" == \"UNX\"\n" );
sUNX += sTarget;
sUNX += " :";
- BOOL bUNX = FALSE;
+ sal_Bool bUNX = sal_False;
ByteString sWNT( ".IF \"$(GUI)\" == \"WNT\"\n" );
sWNT += sTarget;
sWNT += " :";
- BOOL bWNT = FALSE;
+ sal_Bool bWNT = sal_False;
ByteString sOS2( ".IF \"$(GUI)\" == \"OS2\"\n" );
sOS2 += sTarget;
sOS2 += " :";
- BOOL bOS2 = FALSE;
+ sal_Bool bOS2 = sal_False;
for ( size_t i = 0; i < pDependencies->size(); i++ ) {
Dependency *pDependency = (Dependency*)(*pDependencies)[ i ];
@@ -396,17 +396,17 @@ ByteString SourceDirectory::GetTarget()
if ( pDependency->GetOperatingSystem() & OS_UNX ) {
sUNX += " ";
sUNX += sDependency;
- bUNX = TRUE;
+ bUNX = sal_True;
}
if ( pDependency->GetOperatingSystem() & OS_WIN32 ) {
sWNT += " ";
sWNT += sDependency;
- bWNT = TRUE;
+ bWNT = sal_True;
}
if ( pDependency->GetOperatingSystem() & OS_OS2 ) {
sOS2 += " ";
sOS2 += sDependency;
- bOS2 = TRUE;
+ bOS2 = sal_True;
}
}
@@ -434,10 +434,10 @@ ByteString SourceDirectory::GetSubDirsTarget()
ByteString sReturn;
if ( pSubDirectories ) {
- BOOL bDependsOnPlatform = FALSE;
+ sal_Bool bDependsOnPlatform = sal_False;
for ( size_t i = 0; i < pSubDirectories->size(); i++ ) {
if ( ((SourceDirectory*)(*pSubDirectories)[ i ])->GetOperatingSystems() != OS_ALL ) {
- bDependsOnPlatform = TRUE;
+ bDependsOnPlatform = sal_True;
}
}
@@ -455,15 +455,15 @@ ByteString SourceDirectory::GetSubDirsTarget()
else {
ByteString sUNX( ".IF \"$(GUI)\" == \"UNX\"\n" );
sUNX += "RC_SUBDIRS = ";
- BOOL bUNX = FALSE;
+ sal_Bool bUNX = sal_False;
ByteString sWNT( ".IF \"$(GUI)\" == \"WNT\"\n" );
sWNT += "RC_SUBDIRS = ";
- BOOL bWNT = FALSE;
+ sal_Bool bWNT = sal_False;
ByteString sOS2( ".IF \"$(GUI)\" == \"OS2\"\n" );
sOS2 += "RC_SUBDIRS = ";
- BOOL bOS2 = FALSE;
+ sal_Bool bOS2 = sal_False;
for ( size_t i = 0; i < pSubDirectories->size(); i++ ) {
SourceDirectory *pDirectory = (SourceDirectory*)(*pSubDirectories)[ i ];
@@ -473,17 +473,17 @@ ByteString SourceDirectory::GetSubDirsTarget()
if ( pDirectory->GetOperatingSystems() & OS_UNX ) {
sUNX += " \\\n\t";
sUNX += sDirectory;
- bUNX = TRUE;
+ bUNX = sal_True;
}
if ( pDirectory->GetOperatingSystems() & OS_WIN32 ) {
sWNT += " \\\n\t";
sWNT += sDirectory;
- bWNT = TRUE;
+ bWNT = sal_True;
}
if ( pDirectory->GetOperatingSystems() & OS_OS2 ) {
sOS2 += " \\\n\t";
sOS2 += sDirectory;
- bOS2 = TRUE;
+ bOS2 = sal_True;
}
}
if ( bUNX ) {
@@ -504,10 +504,10 @@ ByteString SourceDirectory::GetSubDirsTarget()
}
/*****************************************************************************/
-USHORT SourceDirectory::GetOSType( const ByteString &sDependExt )
+sal_uInt16 SourceDirectory::GetOSType( const ByteString &sDependExt )
/*****************************************************************************/
{
- USHORT nOSType = 0;
+ sal_uInt16 nOSType = 0;
if ( sDependExt == "" )
nOSType |= OS_ALL;
else if ( sDependExt == "N" || sDependExt == "W" )
@@ -521,7 +521,7 @@ USHORT SourceDirectory::GetOSType( const ByteString &sDependExt )
/*****************************************************************************/
SourceDirectory *SourceDirectory::CreateRootDirectory(
- const ByteString &rRoot, const ByteString &rVersion, BOOL bAll )
+ const ByteString &rRoot, const ByteString &rVersion, sal_Bool bAll )
/*****************************************************************************/
{
IniManager aIniManager;
@@ -534,15 +534,15 @@ SourceDirectory *SourceDirectory::CreateRootDirectory(
GenericInformationList *pVerList = aParser.Execute( s );
ByteString sVersion( rVersion );
- Star aStar( pVerList, sVersion, TRUE, rRoot.GetBuffer());
+ Star aStar( pVerList, sVersion, sal_True, rRoot.GetBuffer());
SourceDirectory *pSourceRoot = new SourceDirectory( rRoot, OS_ALL );
- for ( ULONG i = 0; i < aStar.Count(); i++ ) {
+ for ( sal_uIntPtr i = 0; i < aStar.Count(); i++ ) {
Prj *pPrj = aStar.GetObject( i );
- BOOL bBuildable = TRUE;
- ULONG nIndex = 0;
+ sal_Bool bBuildable = sal_True;
+ sal_uIntPtr nIndex = 0;
while ( bBuildable && ByteString( NoBuildProject[ nIndex ]) != "EndOf_NoBuildProject" ) {
bBuildable = ( ByteString( NoBuildProject[ nIndex ]) != pPrj->GetProjectName());
@@ -552,14 +552,14 @@ SourceDirectory *SourceDirectory::CreateRootDirectory(
if ( bBuildable ) {
SourceDirectory *pProject = pSourceRoot->Insert( pPrj->GetProjectName(), OS_ALL );
- SByteStringList *pPrjDependencies = pPrj->GetDependencies( FALSE );
+ SByteStringList *pPrjDependencies = pPrj->GetDependencies( sal_False );
if ( pPrjDependencies )
for ( size_t x = 0; x < pPrjDependencies->size(); x++ )
pProject->AddCodedDependency( *(*pPrjDependencies)[ x ], OS_ALL );
pProject->AddCodedIdentifier( pPrj->GetProjectName(), OS_ALL );
- for ( ULONG j = 0; j < pPrj->Count(); j++ ) {
+ for ( sal_uIntPtr j = 0; j < pPrj->Count(); j++ ) {
CommandData *pData = pPrj->GetObject( j );
if ( bAll || ( pData->GetCommandType() == COMMAND_NMAKE )) {
ByteString sDirPath( rRoot );
@@ -590,11 +590,11 @@ SourceDirectory *SourceDirectory::CreateRootDirectory(
}
/*****************************************************************************/
-BOOL SourceDirectory::RemoveDirectoryTreeAndAllDependencies()
+sal_Bool SourceDirectory::RemoveDirectoryTreeAndAllDependencies()
/*****************************************************************************/
{
if ( !pParent )
- return FALSE;
+ return sal_False;
SourceDirectoryList *pParentContent = pParent->pSubDirectories;
size_t i = 0;
@@ -613,15 +613,15 @@ BOOL SourceDirectory::RemoveDirectoryTreeAndAllDependencies()
}
}
delete this;
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds )
+sal_Bool SourceDirectory::CreateRecursiveMakefile( sal_Bool bAllChilds )
/*****************************************************************************/
{
if ( !pSubDirectories )
- return TRUE;
+ return sal_True;
fprintf( stdout, "%s", GetFullPath().GetBuffer());
@@ -629,7 +629,7 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds )
DirEntry aEntry( aTmpStr );
if ( !aEntry.Exists()) {
fprintf( stdout, " ... no directory!\n" );
- return FALSE;
+ return sal_False;
}
size_t j = 0;
@@ -653,20 +653,20 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds )
DirEntry aMKEntry( aEntry );
aMKEntry += aMKFile;
- BOOL bMakefileMk = FALSE;
+ sal_Bool bMakefileMk = sal_False;
if ( aMKEntry.Exists()) {
if ( nDepth == 1 && *this == ByteString( "api" ))
fprintf( stdout, " ... makefile.mk exists, ignoring (hack: prj == api)!" );
else {
fprintf( stdout, " ... makefile.mk exists, including!" );
- bMakefileMk = TRUE;
+ bMakefileMk = sal_True;
}
}
SvFileStream aMakefile( aRCEntry.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC );
if ( !aMakefile.IsOpen()) {
fprintf( stdout, " ... failed!\n" );
- return FALSE;
+ return sal_False;
}
ByteString sHeader(
@@ -869,11 +869,11 @@ BOOL SourceDirectory::CreateRecursiveMakefile( BOOL bAllChilds )
fprintf( stdout, "\n" );
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
if ( bAllChilds ) {
for ( size_t k = 0; k < pSubDirectories->size(); k++ ) {
if ( !((SourceDirectory*)(*pSubDirectories)[ k ])->CreateRecursiveMakefile( TRUE ) ) {
- bSuccess = FALSE;
+ bSuccess = sal_False;
break;
}
}
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index dabd11a9b243..c519d337464c 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -30,7 +30,7 @@
#include "precompiled_tools.hxx"
#include <stdlib.h>
#include <stdio.h>
-#include "bootstrp/sstring.hxx"
+//#include "bootstrp/sstring.hxx"
#include <osl/mutex.hxx>
#include <tools/stream.hxx>
@@ -38,6 +38,8 @@
#include "bootstrp/prj.hxx"
#include "bootstrp/inimgr.hxx"
+DECLARE_LIST( UniStringList, UniString* )
+
#if defined(WNT) || defined(OS2)
#define LIST_DELIMETER ';'
#define PATH_DELIMETER '\\'
@@ -46,7 +48,7 @@
#define PATH_DELIMETER '/'
#endif
-Link Star::aDBNotFoundHdl;
+//Link Star::aDBNotFoundHdl;
//
// class SimpleConfig
@@ -110,9 +112,9 @@ ByteString SimpleConfig::GetNextLine()
aTmpStr = aTmpStr.EraseTrailingChars();
while ( aTmpStr.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND ) ;
int nLength = aTmpStr.Len();
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
ByteString aEraseString;
- for ( USHORT i = 0; i<= nLength; i++)
+ for ( sal_uInt16 i = 0; i<= nLength; i++)
{
if ( aTmpStr.GetChar( i ) == 0x20 && !bFound )
aTmpStr.SetChar( i, 0x09 );
@@ -121,7 +123,7 @@ ByteString SimpleConfig::GetNextLine()
}
/*****************************************************************************/
-ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments )
+ByteString SimpleConfig::GetCleanedNextLine( sal_Bool bReadComments )
/*****************************************************************************/
{
@@ -141,8 +143,8 @@ ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments )
aTmpStr = aTmpStr.EraseTrailingChars();
int nLength = aTmpStr.Len();
ByteString aEraseString;
- BOOL bFirstTab = TRUE;
- for ( USHORT i = 0; i<= nLength; i++)
+ sal_Bool bFirstTab = sal_True;
+ for ( sal_uInt16 i = 0; i<= nLength; i++)
{
if ( aTmpStr.GetChar( i ) == 0x20 )
aTmpStr.SetChar( i, 0x09 );
@@ -150,14 +152,14 @@ ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments )
if ( aTmpStr.GetChar( i ) == 0x09 )
{
if ( bFirstTab )
- bFirstTab = FALSE;
+ bFirstTab = sal_False;
else
{
aTmpStr.SetChar( i, 0x20 );
}
}
else
- bFirstTab = TRUE;
+ bFirstTab = sal_True;
}
aTmpStr.EraseAllChars(' ');
@@ -165,1391 +167,3 @@ ByteString SimpleConfig::GetCleanedNextLine( BOOL bReadComments )
}
-
-//
-// class CommandData
-//
-
-/*****************************************************************************/
-CommandData::CommandData()
-/*****************************************************************************/
-{
- nOSType = 0;
- nCommand = 0;
- pDepList = 0;
-}
-
-/*****************************************************************************/
-CommandData::~CommandData()
-/*****************************************************************************/
-{
- if ( pDepList )
- {
- for ( size_t i = 0, n = pDepList->size(); i < n; ++i ) {
- delete (*pDepList)[ i ];
- }
- delete pDepList;
-
- pDepList = NULL;
- }
-}
-
-/*****************************************************************************/
-ByteString CommandData::GetOSTypeString()
-/*****************************************************************************/
-{
- ByteString aRetStr;
-
- switch (nOSType)
- {
- case OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX :
- aRetStr = "all";
- break;
- case OS_WIN32 | OS_WIN16 :
- aRetStr = "w";
- break;
- case OS_OS2 :
- aRetStr = "p";
- break;
- case OS_UNX :
- aRetStr = "u";
- break;
- case OS_WIN16 :
- aRetStr = "d";
- break;
- case OS_WIN32 :
- aRetStr = "n";
- break;
- default :
- aRetStr = "none";
- }
-
- return aRetStr;
-}
-
-/*****************************************************************************/
-ByteString CommandData::GetCommandTypeString()
-/*****************************************************************************/
-{
- ByteString aRetStr;
-
- switch (nCommand)
- {
- case COMMAND_NMAKE :
- aRetStr = "nmake";
- break;
- case COMMAND_GET :
- aRetStr = "get";
- break;
- default :
- aRetStr = "usr";
- aRetStr += ByteString::CreateFromInt64( nCommand + 1 - COMMAND_USER_START );
-
- }
-
- return aRetStr;
-}
-
-/*****************************************************************************/
-CommandData* Prj::GetDirectoryList ( USHORT, USHORT )
-/*****************************************************************************/
-{
- return (CommandData *)NULL;
-}
-
-/*****************************************************************************/
-CommandData* Prj::GetDirectoryData( ByteString aLogFileName )
-/*****************************************************************************/
-{
- CommandData *pData = NULL;
- ULONG nObjCount = Count();
- for ( ULONG i=0; i<nObjCount; i++ )
- {
- pData = GetObject(i);
- if ( pData->GetLogFile() == aLogFileName )
- return pData;
- }
- return NULL;
-}
-
-//
-// class Prj
-//
-
-/*****************************************************************************/
-Prj::Prj() :
- bVisited( FALSE ),
- pPrjInitialDepList(0),
- pPrjDepList(0),
- bHardDependencies( FALSE ),
- bSorted( FALSE )
-/*****************************************************************************/
-{
-}
-
-/*****************************************************************************/
-Prj::Prj( ByteString aName ) :
- bVisited( FALSE ),
- aProjectName( aName ),
- pPrjInitialDepList(0),
- pPrjDepList(0),
- bHardDependencies( FALSE ),
- bSorted( FALSE )
-/*****************************************************************************/
-{
-}
-
-/*****************************************************************************/
-Prj::~Prj()
-/*****************************************************************************/
-{
- if ( pPrjDepList )
- {
- for ( size_t i = 0, n = maList.size(); i < n; ++i )
- delete maList[ i ];
- maList.clear();
-
- for ( size_t i = 0, n = pPrjDepList->size(); i < n; ++i )
- delete (*pPrjDepList)[ i ];
- delete pPrjDepList;
- pPrjDepList = NULL;
- }
-
- if ( pPrjInitialDepList )
- {
- for ( size_t i = 0, n = pPrjInitialDepList->size(); i < n; ++i )
- delete (*pPrjInitialDepList)[ i ];
- delete pPrjInitialDepList;
- pPrjInitialDepList = NULL;
- }
-}
-
-/*****************************************************************************/
-void Prj::AddDependencies( ByteString aStr )
-/*****************************************************************************/
-{
-
- // needs dirty flag - not expanded
- if ( !pPrjDepList )
- pPrjDepList = new SByteStringList;
-
- pPrjDepList->PutString( new ByteString(aStr) );
-
- if ( !pPrjInitialDepList )
- pPrjInitialDepList = new SByteStringList;
-
- pPrjInitialDepList->PutString( new ByteString(aStr) );
-}
-
-/*****************************************************************************/
-SByteStringList* Prj::GetDependencies( BOOL bExpanded )
-/*****************************************************************************/
-{
- if ( bExpanded )
- return pPrjDepList;
- else
- return pPrjInitialDepList;
-}
-
-
-
-/*****************************************************************************/
-BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat,
- USHORT aWhatOS, ByteString aLogFileName,
- const ByteString &rClientRestriction )
-/*****************************************************************************/
-{
- CommandData* pData = new CommandData();
-
- pData->SetPath( aDirName );
- pData->SetCommandType( aWhat );
- pData->SetOSType( aWhatOS );
- pData->SetLogFile( aLogFileName );
- pData->SetClientRestriction( rClientRestriction );
-
- maList.push_back( pData );
-
- return FALSE;
-}
-
-/*****************************************************************************/
-//
-// removes directory and existing dependencies on it
-//
-CommandData* Prj::RemoveDirectory ( ByteString aLogFileName )
-/*****************************************************************************/
-{
- size_t nCountMember = maList.size();
- CommandData* pData;
- CommandData* pDataFound = NULL;
- SByteStringList* pDataDeps;
-
- for ( size_t i = 0; i < nCountMember; i++ )
- {
- pData = maList[ i ];
- if ( pData->GetLogFile() == aLogFileName )
- pDataFound = pData;
- else
- {
- pDataDeps = pData->GetDependencies();
- if ( pDataDeps )
- {
- ByteString* pString;
- size_t nDataDepsCount = pDataDeps->size();
- for ( size_t j = nDataDepsCount; j > 0; )
- {
- pString = (*pDataDeps)[ --j ];
- if ( pString->GetToken( 0, '.') == aLogFileName )
- pDataDeps->erase( j );
- }
- }
- }
- }
-
- Remove( pDataFound );
-
- return pDataFound;
-}
-
-//
-// class Star
-//
-
-/*****************************************************************************/
-Star::Star()
-/*****************************************************************************/
-{
- // this ctor is only used by StarWriter
-}
-
-/*****************************************************************************/
-Star::Star(String aFileName, USHORT nMode )
-/*****************************************************************************/
- : nStarMode( nMode )
-{
- Read( aFileName );
-}
-
-/*****************************************************************************/
-Star::Star( SolarFileList *pSolarFiles )
-/*****************************************************************************/
- : nStarMode( STAR_MODE_MULTIPLE_PARSE )
-{
- // this ctor is used by StarBuilder to get the information for the whole workspace
- Read( pSolarFiles );
-}
-
-/*****************************************************************************/
-Star::Star( GenericInformationList *pStandLst, ByteString &rVersion,
- BOOL bLocal, const char *pSourceRoot )
-/*****************************************************************************/
-{
- ByteString sPath( rVersion );
- String sSrcRoot;
- if ( pSourceRoot )
- sSrcRoot = String::CreateFromAscii( pSourceRoot );
-
-#ifdef UNX
- sPath += "/settings/UNXSOLARLIST";
-#else
- sPath += "/settings/SOLARLIST";
-#endif
- GenericInformation *pInfo = pStandLst->GetInfo( sPath, TRUE );
-
- if( pInfo && pInfo->GetValue().Len()) {
- ByteString sFile( pInfo->GetValue());
- if ( bLocal ) {
- IniManager aIniManager;
- aIniManager.ToLocal( sFile );
- }
- String sFileName( sFile, RTL_TEXTENCODING_ASCII_US );
- nStarMode = STAR_MODE_SINGLE_PARSE;
- Read( sFileName );
- }
- else {
- SolarFileList *pFileList = new SolarFileList();
-
- sPath = rVersion;
- sPath += "/drives";
-
- GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, TRUE );
- if ( pInfo2 && pInfo2->GetSubList()) {
- GenericInformationList *pDrives = pInfo2->GetSubList();
- for ( size_t i = 0; i < pDrives->size(); i++ ) {
- GenericInformation *pDrive = (*pDrives)[ i ];
- if ( pDrive ) {
- DirEntry aEntry;
- BOOL bOk = FALSE;
- if ( sSrcRoot.Len()) {
- aEntry = DirEntry( sSrcRoot );
- bOk = TRUE;
- }
- else {
-#ifdef UNX
- sPath = "UnixVolume";
- GenericInformation *pUnixVolume = pDrive->GetSubInfo( sPath );
- if ( pUnixVolume ) {
- String sRoot( pUnixVolume->GetValue(), RTL_TEXTENCODING_ASCII_US );
- aEntry = DirEntry( sRoot );
- bOk = TRUE;
- }
-#else
- bOk = TRUE;
- String sRoot( *pDrive, RTL_TEXTENCODING_ASCII_US );
- sRoot += String::CreateFromAscii( "\\" );
- aEntry = DirEntry( sRoot );
-#endif
- }
- if ( bOk ) {
- sPath = "projects";
- GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, TRUE );
- if ( pProjectsKey ) {
- if ( !sSrcRoot.Len()) {
- sPath = rVersion;
- sPath += "/settings/PATH";
- GenericInformation *pPath = pStandLst->GetInfo( sPath, TRUE );
- if( pPath ) {
- ByteString sAddPath( pPath->GetValue());
-#ifdef UNX
- sAddPath.SearchAndReplaceAll( "\\", "/" );
-#else
- sAddPath.SearchAndReplaceAll( "/", "\\" );
-#endif
- String ssAddPath( sAddPath, RTL_TEXTENCODING_ASCII_US );
- aEntry += DirEntry( ssAddPath );
- }
- }
- GenericInformationList *pProjects = pProjectsKey->GetSubList();
- if ( pProjects ) {
- String sPrjDir( String::CreateFromAscii( "prj" ));
- String sSolarFile( String::CreateFromAscii( "build.lst" ));
-
- for ( size_t j = 0; j < pProjects->size(); j++ ) {
- ByteString sProject( *(*pProjects)[ j ] );
- String ssProject( sProject, RTL_TEXTENCODING_ASCII_US );
-
- DirEntry aPrjEntry( aEntry );
-
- aPrjEntry += DirEntry( ssProject );
- aPrjEntry += DirEntry( sPrjDir );
- aPrjEntry += DirEntry( sSolarFile );
-
- pFileList->push_back( new String( aPrjEntry.GetFull()) );
-
- ByteString sFile( aPrjEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
- }
- }
- }
- }
- }
- }
- }
- Read( pFileList );
- }
-}
-
-/*****************************************************************************/
-Star::~Star()
-/*****************************************************************************/
-{
- for ( size_t i = 0, n = maStarList.size(); i < n; ++i )
- delete maStarList[ i ];
- maStarList.clear();
-}
-
-/*****************************************************************************/
-void Star::Read( String &rFileName )
-/*****************************************************************************/
-{
- ByteString aString;
- aFileList.push_back( new String( rFileName ));
-
- DirEntry aEntry( rFileName );
- aEntry.ToAbs();
- aEntry = aEntry.GetPath().GetPath().GetPath();
- sSourceRoot = aEntry.GetFull();
-
- while ( !aFileList.empty() )
- {
- StarFile *pFile = new StarFile( *aFileList.front() );
- if ( pFile->Exists())
- {
- SimpleConfig aSolarConfig( *aFileList.front() );
- while (( aString = aSolarConfig.GetNext()) != "" )
- InsertToken (( char * ) aString.GetBuffer());
- }
- delete pFile;
- delete aFileList.front();
- aFileList.erase( aFileList.begin() );
- }
- // resolve all dependencies recursive
- Expand_Impl();
-}
-
-/*****************************************************************************/
-void Star::Read( SolarFileList *pSolarFiles )
-/*****************************************************************************/
-{
- while ( !pSolarFiles->empty() )
- {
- ByteString aString;
-
- StarFile *pFile = new StarFile( *pSolarFiles->front() );
- if ( pFile->Exists())
- {
- SimpleConfig aSolarConfig( *pSolarFiles->front() );
- while (( aString = aSolarConfig.GetNext()) != "" )
- InsertToken (( char * ) aString.GetBuffer());
- }
- delete pFile;
- delete pSolarFiles->front();
- aFileList.erase( aFileList.begin() );
- }
- delete pSolarFiles;
-
- Expand_Impl();
-}
-
-/*****************************************************************************/
-String Star::CreateFileName( String sProject )
-/*****************************************************************************/
-{
- // this method is used to find solarlist parts of nabours (other projects)
- String sPrjDir( String::CreateFromAscii( "prj" ));
- String sSolarFile( String::CreateFromAscii( "build.lst" ));
-
- DirEntry aEntry( sSourceRoot );
- aEntry += DirEntry( sProject );
- aEntry += DirEntry( sPrjDir );
- aEntry += DirEntry( sSolarFile );
-
- if ( !aEntry.Exists() && aDBNotFoundHdl.IsSet())
- aDBNotFoundHdl.Call( &sProject );
-
- return aEntry.GetFull();
-}
-
-/*****************************************************************************/
-void Star::InsertSolarList( String sProject )
-/*****************************************************************************/
-{
- // inserts a new solarlist part of another project
- String sFileName( CreateFileName( sProject ));
-
- for ( SolarFileList::iterator it = aFileList.begin(); it != aFileList.end(); ++it )
- if ( *(*it) == sFileName )
- return;
-
- ByteString ssProject( sProject, RTL_TEXTENCODING_ASCII_US );
- if ( HasProject( ssProject ))
- return;
-
- aFileList.push_back( new String( sFileName ) );
-}
-
-/*****************************************************************************/
-void Star::ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj )
-/*****************************************************************************/
-{
- if ( pDepPrj->bVisited )
- return;
-
- pDepPrj->bVisited = TRUE;
-
- SByteStringList* pPrjLst = pPrj->GetDependencies();
- SByteStringList* pDepLst = NULL;
- ByteString* pDepend;
- ByteString* pPutStr;
- Prj *pNextPrj = NULL;
- size_t i, nRetPos;
-
- if ( pPrjLst ) {
- pDepLst = pDepPrj->GetDependencies();
- if ( pDepLst ) {
- for ( i = 0; i < pDepLst->size(); i++ ) {
- pDepend = (*pDepLst)[ i ];
- pPutStr = new ByteString( *pDepend );
- nRetPos = pPrjLst->PutString( pPutStr );
- if( nRetPos == NOT_THERE )
- delete pPutStr;
- pNextPrj = GetPrj( *pDepend );
- if ( pNextPrj ) {
- ExpandPrj_Impl( pPrj, pNextPrj );
- }
- }
- }
- }
-}
-
-/*****************************************************************************/
-void Star::Expand_Impl()
-/*****************************************************************************/
-{
- for ( ULONG i = 0; i < Count(); i++ ) {
- for ( ULONG j = 0; j < Count(); j++ )
- GetObject( j )->bVisited = FALSE;
-
- Prj* pPrj = GetObject( i );
- ExpandPrj_Impl( pPrj, pPrj );
- }
-}
-
-/*****************************************************************************/
-void Star::InsertToken ( char *yytext )
-/*****************************************************************************/
-{
- static int i = 0;
- static ByteString aDirName, aWhat, aWhatOS,
- sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara;
- static BOOL bPrjDep = FALSE;
- static BOOL bHardDep = FALSE;
- static USHORT nCommandType, nOSType;
- CommandData* pCmdData;
- static SByteStringList *pStaticDepList;
- Prj* pPrj;
-
- switch (i)
- {
- case 0:
- aPrefix = yytext;
- pStaticDepList = 0;
- break;
- case 1:
- aDirName = yytext;
- break;
- case 2:
- if ( !strcmp( yytext, ":" ))
- {
- bPrjDep = TRUE;
- bHardDep = FALSE;
- i = 9;
- }
- else if ( !strcmp( yytext, "::" ))
- {
- bPrjDep = TRUE;
- bHardDep = TRUE;
- i = 9;
- }
- else
- {
- bPrjDep = FALSE;
- bHardDep = FALSE;
-
- aWhat = yytext;
- if ( aWhat == "nmake" )
- nCommandType = COMMAND_NMAKE;
- else if ( aWhat == "get" )
- nCommandType = COMMAND_GET;
- else {
- ULONG nOffset = aWhat.Copy( 3 ).ToInt32();
- nCommandType = sal::static_int_cast< USHORT >(
- COMMAND_USER_START + nOffset - 1);
- }
- }
- break;
- case 3:
- if ( !bPrjDep )
- {
- aWhat = yytext;
- if ( aWhat == "-" )
- {
- aCommandPara = ByteString();
- }
- else
- aCommandPara = aWhat;
- }
- break;
- case 4:
- if ( !bPrjDep )
- {
- aWhatOS = yytext;
- if ( aWhatOS.GetTokenCount( ',' ) > 1 ) {
- sClientRestriction = aWhatOS.Copy( aWhatOS.GetToken( 0, ',' ).Len() + 1 );
- aWhatOS = aWhatOS.GetToken( 0, ',' );
- }
- if ( aWhatOS == "all" )
- nOSType = ( OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX );
- else if ( aWhatOS == "w" )
- nOSType = ( OS_WIN16 | OS_WIN32 );
- else if ( aWhatOS == "p" )
- nOSType = OS_OS2;
- else if ( aWhatOS == "u" )
- nOSType = OS_UNX;
- else if ( aWhatOS == "d" )
- nOSType = OS_WIN16;
- else if ( aWhatOS == "n" )
- nOSType = OS_WIN32;
- else
- nOSType = OS_NONE;
- }
- break;
- case 5:
- if ( !bPrjDep )
- {
- aLogFileName = yytext;
- }
- break;
- default:
- if ( !bPrjDep )
- {
- ByteString aItem = yytext;
- if ( aItem == "NULL" )
- {
- // Liste zu Ende
- i = -1;
- }
- else
- {
- // ggfs. Dependency liste anlegen und ergaenzen
- if ( !pStaticDepList )
- pStaticDepList = new SByteStringList;
- pStaticDepList->PutString( new ByteString( aItem ));
- }
- }
- else
- {
- ByteString aItem = yytext;
- if ( aItem == "NULL" )
- {
- // Liste zu Ende
- i = -1;
- bPrjDep= FALSE;
- }
- else
- {
- aProjectName = aDirName.GetToken ( 0, '\\');
- if ( HasProject( aProjectName ))
- {
- pPrj = GetPrj( aProjectName );
- // Projekt exist. schon, neue Eintraege anhaengen
- }
- else
- {
- // neues Project anlegen
- pPrj = new Prj ( aProjectName );
- pPrj->SetPreFix( aPrefix );
- Insert(pPrj,LIST_APPEND);
- }
- pPrj->AddDependencies( aItem );
- pPrj->HasHardDependencies( bHardDep );
-
- if ( nStarMode == STAR_MODE_RECURSIVE_PARSE ) {
- String sItem( aItem, RTL_TEXTENCODING_ASCII_US );
- InsertSolarList( sItem );
- }
- }
- }
- break;
- }
- /* Wenn dieses Project noch nicht vertreten ist, in die Liste
- der Solar-Projekte einfuegen */
- if ( i == -1 )
- {
- aProjectName = aDirName.GetToken ( 0, '\\');
- if ( HasProject( aProjectName ))
- {
- pPrj = GetPrj( aProjectName );
- // Projekt exist. schon, neue Eintraege anhaengen
- }
- else
- {
- // neues Project anlegen
- pPrj = new Prj ( aProjectName );
- pPrj->SetPreFix( aPrefix );
- Insert(pPrj,LIST_APPEND);
- }
-
- pCmdData = new CommandData;
- pCmdData->SetPath( aDirName );
- pCmdData->SetCommandType( nCommandType );
- pCmdData->SetCommandPara( aCommandPara );
- pCmdData->SetOSType( nOSType );
- pCmdData->SetLogFile( aLogFileName );
- pCmdData->SetClientRestriction( sClientRestriction );
- if ( pStaticDepList )
- pCmdData->SetDependencies( pStaticDepList );
-
- pStaticDepList = 0;
- pPrj->Insert ( pCmdData, LIST_APPEND );
- aDirName ="";
- aWhat ="";
- aWhatOS = "";
- sClientRestriction = "";
- aLogFileName = "";
- nCommandType = 0;
- nOSType = 0;
- }
- i++;
-
- // und wer raeumt die depLst wieder ab ?
-}
-
-/*****************************************************************************/
-BOOL Star::HasProject ( ByteString aProjectName )
-/*****************************************************************************/
-{
- Prj *pPrj;
- int nCountMember;
-
- nCountMember = Count();
-
- for ( int i=0; i<nCountMember; i++)
- {
- pPrj = GetObject(i);
- if ( pPrj->GetProjectName().EqualsIgnoreCaseAscii(aProjectName) )
- return TRUE;
- }
- return FALSE;
-}
-
-/*****************************************************************************/
-Prj* Star::GetPrj ( ByteString aProjectName )
-/*****************************************************************************/
-{
- Prj* pPrj;
- int nCountMember = Count();
- for ( int i=0;i<nCountMember;i++)
- {
- pPrj = GetObject(i);
- if ( pPrj->GetProjectName().EqualsIgnoreCaseAscii(aProjectName) )
- return pPrj;
- }
- return 0L ;
-}
-
-/*****************************************************************************/
-ByteString Star::GetPrjName( DirEntry &aPath )
-/*****************************************************************************/
-{
- ByteString aRetPrj, aDirName;
- ByteString aFullPathName = ByteString( aPath.GetFull(), gsl_getSystemTextEncoding());
-
- xub_StrLen nToken = aFullPathName.GetTokenCount(PATH_DELIMETER);
- for ( xub_StrLen i=0; i< nToken; i++ )
- {
- aDirName = aFullPathName.GetToken( i, PATH_DELIMETER );
- if ( HasProject( aDirName ))
- {
- aRetPrj = aDirName;
- break;
- }
- }
-
- return aRetPrj;
-}
-
-
-//
-// class StarWriter
-//
-
-/*****************************************************************************/
-StarWriter::StarWriter( String aFileName, BOOL bReadComments, USHORT nMode )
-/*****************************************************************************/
-{
- Read ( aFileName, bReadComments, nMode );
-}
-
-/*****************************************************************************/
-StarWriter::StarWriter( SolarFileList *pSolarFiles, BOOL bReadComments )
-/*****************************************************************************/
-{
- Read( pSolarFiles, bReadComments );
-}
-
-/*****************************************************************************/
-StarWriter::StarWriter( GenericInformationList *pStandLst, ByteString &rVersion,
- BOOL bLocal, const char *pSourceRoot )
-/*****************************************************************************/
-{
- ByteString sPath( rVersion );
- String sSrcRoot;
- if ( pSourceRoot )
- sSrcRoot = String::CreateFromAscii( pSourceRoot );
-
-#ifdef UNX
- sPath += "/settings/UNXSOLARLIST";
-#else
- sPath += "/settings/SOLARLIST";
-#endif
- GenericInformation *pInfo = pStandLst->GetInfo( sPath, TRUE );
-
- if( pInfo && pInfo->GetValue().Len()) {
- ByteString sFile( pInfo->GetValue());
- if ( bLocal ) {
- IniManager aIniManager;
- aIniManager.ToLocal( sFile );
- }
- String sFileName( sFile, RTL_TEXTENCODING_ASCII_US );
- nStarMode = STAR_MODE_SINGLE_PARSE;
- Read( sFileName );
- }
- else {
- SolarFileList *pFileList = new SolarFileList();
-
- sPath = rVersion;
- sPath += "/drives";
-
- GenericInformation *pInfo2 = pStandLst->GetInfo( sPath, TRUE );
- if ( pInfo2 && pInfo2->GetSubList()) {
- GenericInformationList *pDrives = pInfo2->GetSubList();
- for ( size_t i = 0; i < pDrives->size(); i++ ) {
- GenericInformation *pDrive = (*pDrives)[ i ];
- if ( pDrive ) {
- DirEntry aEntry;
- BOOL bOk = FALSE;
- if ( sSrcRoot.Len()) {
- aEntry = DirEntry( sSrcRoot );
- bOk = TRUE;
- }
- else {
-#ifdef UNX
- sPath = "UnixVolume";
- GenericInformation *pUnixVolume = pDrive->GetSubInfo( sPath );
- if ( pUnixVolume ) {
- String sRoot( pUnixVolume->GetValue(), RTL_TEXTENCODING_ASCII_US );
- aEntry = DirEntry( sRoot );
- bOk = TRUE;
- }
-#else
- bOk = TRUE;
- String sRoot( *pDrive, RTL_TEXTENCODING_ASCII_US );
- sRoot += String::CreateFromAscii( "\\" );
- aEntry = DirEntry( sRoot );
-#endif
- }
- if ( bOk ) {
- sPath = "projects";
- GenericInformation *pProjectsKey = pDrive->GetSubInfo( sPath, TRUE );
- if ( pProjectsKey ) {
- if ( !sSrcRoot.Len()) {
- sPath = rVersion;
- sPath += "/settings/PATH";
- GenericInformation *pPath = pStandLst->GetInfo( sPath, TRUE );
- if( pPath ) {
- ByteString sAddPath( pPath->GetValue());
-#ifdef UNX
- sAddPath.SearchAndReplaceAll( "\\", "/" );
-#else
- sAddPath.SearchAndReplaceAll( "/", "\\" );
-#endif
- String ssAddPath( sAddPath, RTL_TEXTENCODING_ASCII_US );
- aEntry += DirEntry( ssAddPath );
- }
- }
- GenericInformationList *pProjects = pProjectsKey->GetSubList();
- if ( pProjects ) {
- String sPrjDir( String::CreateFromAscii( "prj" ));
- String sSolarFile( String::CreateFromAscii( "build.lst" ));
-
- for ( size_t j = 0; j < pProjects->size(); j++ ) {
- ByteString sProject( *(*pProjects)[ j ] );
- String ssProject( sProject, RTL_TEXTENCODING_ASCII_US );
-
- DirEntry aPrjEntry( aEntry );
-
- aPrjEntry += DirEntry( ssProject );
- aPrjEntry += DirEntry( sPrjDir );
- aPrjEntry += DirEntry( sSolarFile );
-
- pFileList->push_back( new String( aPrjEntry.GetFull()) );
-
- ByteString sFile( aPrjEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
- fprintf( stdout, "%s\n", sFile.GetBuffer());
- }
- }
- }
- }
- }
- }
- }
- Read( pFileList );
- }
-}
-
-/*****************************************************************************/
-void StarWriter::CleanUp()
-/*****************************************************************************/
-{
- Expand_Impl();
-}
-
-/*****************************************************************************/
-USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode )
-/*****************************************************************************/
-{
- nStarMode = nMode;
-
- ByteString aString;
- aFileList.push_back( new String( aFileName ) );
-
- DirEntry aEntry( aFileName );
- aEntry.ToAbs();
- aEntry = aEntry.GetPath().GetPath().GetPath();
- sSourceRoot = aEntry.GetFull();
-
- while ( !aFileList.empty() )
- {
- StarFile *pFile = new StarFile( *aFileList.front() );
- if ( pFile->Exists()) {
- SimpleConfig aSolarConfig( *aFileList.front() );
- while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
- InsertTokenLine ( aString );
- }
- delete pFile;
- delete aFileList.front();
- aFileList.erase( aFileList.begin() );
- }
- // resolve all dependencies recursive
- Expand_Impl();
-
- // Die gefundenen Abhaengigkeiten rekursiv aufloesen
- Expand_Impl();
- return 0;
-}
-
-/*****************************************************************************/
-USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments )
-/*****************************************************************************/
-{
- nStarMode = STAR_MODE_MULTIPLE_PARSE;
-
- // this ctor is used by StarBuilder to get the information for the whole workspace
- while ( !pSolarFiles->empty() )
- {
- ByteString aString;
- StarFile *pFile = new StarFile( *pSolarFiles->front() );
- if ( pFile->Exists()) {
- SimpleConfig aSolarConfig( *pSolarFiles->front() );
- while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
- InsertTokenLine ( aString );
- }
- delete pFile;
- delete pSolarFiles->front();
- pSolarFiles->erase( pSolarFiles->begin() );
- }
- delete pSolarFiles;
-
- Expand_Impl();
- return 0;
-}
-
-/*****************************************************************************/
-USHORT StarWriter::WritePrj( Prj *pPrj, SvFileStream& rStream )
-/*****************************************************************************/
-{
- ByteString aDataString;
- ByteString aTab('\t');
- ByteString aSpace(' ');
- ByteString aEmptyString("");
- SByteStringList* pCmdDepList;
-
- CommandData* pCmdData = NULL;
- if ( pPrj->Count() > 0 )
- {
- pCmdData = pPrj->First();
- SByteStringList* pPrjDepList = pPrj->GetDependencies( FALSE );
- if ( pPrjDepList != 0 )
- {
- aDataString = pPrj->GetPreFix();
- aDataString += aTab;
- aDataString += pPrj->GetProjectName();
- aDataString += aTab;
- if ( pPrj->HasHardDependencies())
- aDataString+= ByteString("::");
- else
- aDataString+= ByteString(":");
- aDataString += aTab;
- for ( size_t i = 0; i< pPrjDepList->size(); i++ ) {
- aDataString += *(*pPrjDepList)[ i ];
- aDataString += aSpace;
- }
- aDataString+= "NULL";
-
- rStream.WriteLine( aDataString );
-
- pCmdData = pPrj->Next();
- }
- if ( pCmdData ) {
- do
- {
- if (( aDataString = pCmdData->GetComment()) == aEmptyString )
- {
- aDataString = pPrj->GetPreFix();
- aDataString += aTab;
-
- aDataString+= pCmdData->GetPath();
- aDataString += aTab;
- USHORT nPathLen = pCmdData->GetPath().Len();
- if ( nPathLen < 40 )
- for ( int i = 0; i < 9 - pCmdData->GetPath().Len() / 4 ; i++ )
- aDataString += aTab;
- else
- for ( int i = 0; i < 12 - pCmdData->GetPath().Len() / 4 ; i++ )
- aDataString += aTab;
- aDataString += pCmdData->GetCommandTypeString();
- aDataString += aTab;
- if ( pCmdData->GetCommandType() == COMMAND_GET )
- aDataString += aTab;
- if ( pCmdData->GetCommandPara() == aEmptyString )
- aDataString+= ByteString("-");
- else
- aDataString+= pCmdData->GetCommandPara();
- aDataString += aTab;
- aDataString+= pCmdData->GetOSTypeString();
- if ( pCmdData->GetClientRestriction().Len()) {
- aDataString += ByteString( "," );
- aDataString += pCmdData->GetClientRestriction();
- }
- aDataString += aTab;
- aDataString += pCmdData->GetLogFile();
- aDataString += aSpace;
-
- pCmdDepList = pCmdData->GetDependencies();
- if ( pCmdDepList )
- for ( size_t i = 0; i< pCmdDepList->size(); i++ ) {
- aDataString += *(*pCmdDepList)[ i ];
- aDataString += aSpace;
- }
- aDataString += "NULL";
- }
-
- rStream.WriteLine( aDataString );
-
- pCmdData = pPrj->Next();
- } while ( pCmdData );
- }
- }
- return 0;
-}
-
-/*****************************************************************************/
-USHORT StarWriter::Write( String aFileName )
-/*****************************************************************************/
-{
- SvFileStream aFileStream;
-
- aFileStream.Open( aFileName, STREAM_WRITE | STREAM_TRUNC);
-
- if ( Count() > 0 )
- {
- Prj* pPrj = First();
- do
- {
- WritePrj( pPrj, aFileStream );
- pPrj = Next();
- } while ( pPrj );
- }
-
- aFileStream.Close();
-
- return 0;
-}
-
-/*****************************************************************************/
-USHORT StarWriter::WriteMultiple( String rSourceRoot )
-/*****************************************************************************/
-{
- if ( Count() > 0 )
- {
- String sPrjDir( String::CreateFromAscii( "prj" ));
- String sSolarFile( String::CreateFromAscii( "build.lst" ));
-
- Prj* pPrj = First();
- do
- {
- String sName( pPrj->GetProjectName(), RTL_TEXTENCODING_ASCII_US );
-
- DirEntry aEntry( rSourceRoot );
- aEntry += DirEntry( sName );
- aEntry += DirEntry( sPrjDir );
- aEntry += DirEntry( sSolarFile );
-
- SvFileStream aFileStream;
- aFileStream.Open( aEntry.GetFull(), STREAM_WRITE | STREAM_TRUNC);
-
- WritePrj( pPrj, aFileStream );
-
- aFileStream.Close();
-
- pPrj = Next();
- } while ( pPrj );
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-void StarWriter::InsertTokenLine ( ByteString& rString )
-/*****************************************************************************/
-{
- int i = 0;
- ByteString aWhat, aWhatOS,
- sClientRestriction, aLogFileName, aProjectName, aPrefix, aCommandPara;
- static ByteString aDirName;
- BOOL bPrjDep = FALSE;
- BOOL bHardDep = FALSE;
- USHORT nCommandType = 0;
- USHORT nOSType = 0;
- CommandData* pCmdData;
- SByteStringList *pDepList2 = NULL;
- Prj* pPrj;
-
- ByteString aEmptyString;
- ByteString aToken = rString.GetToken( 0, '\t' );
- ByteString aCommentString;
-
- const char* yytext = aToken.GetBuffer();
-
- while ( !( aToken == aEmptyString ) )
- {
- switch (i)
- {
- case 0:
- if ( rString.Search( "#" ) == 0 )
- {
- i = -1;
- aCommentString = rString;
- rString = aEmptyString;
- if ( Count() == 0 )
- aDirName = "null_entry" ; //comments at begin of file
- break;
- }
- aPrefix = yytext;
- pDepList2 = NULL;
- break;
- case 1:
- aDirName = yytext;
- break;
- case 2:
- if ( !strcmp( yytext, ":" ))
- {
- bPrjDep = TRUE;
- bHardDep = FALSE;
- i = 9;
- }
- else if ( !strcmp( yytext, "::" ))
- {
- bPrjDep = TRUE;
- bHardDep = TRUE;
- i = 9;
- }
- else
- {
- bPrjDep = FALSE;
- bHardDep = FALSE;
-
- aWhat = yytext;
- if ( aWhat == "nmake" )
- nCommandType = COMMAND_NMAKE;
- else if ( aWhat == "get" )
- nCommandType = COMMAND_GET;
- else {
- ULONG nOffset = aWhat.Copy( 3 ).ToInt32();
- nCommandType = sal::static_int_cast< USHORT >(
- COMMAND_USER_START + nOffset - 1);
- }
- }
- break;
- case 3:
- if ( !bPrjDep )
- {
- aWhat = yytext;
- if ( aWhat == "-" )
- {
- aCommandPara = ByteString();
- }
- else
- aCommandPara = aWhat;
- }
- break;
- case 4:
- if ( !bPrjDep )
- {
- aWhatOS = yytext;
- if ( aWhatOS.GetTokenCount( ',' ) > 1 ) {
- sClientRestriction = aWhatOS.Copy( aWhatOS.GetToken( 0, ',' ).Len() + 1 );
- aWhatOS = aWhatOS.GetToken( 0, ',' );
- }
- aWhatOS = aWhatOS.GetToken( 0, ',' );
- if ( aWhatOS == "all" )
- nOSType = ( OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX );
- else if ( aWhatOS == "w" )
- nOSType = ( OS_WIN16 | OS_WIN32 );
- else if ( aWhatOS == "p" )
- nOSType = OS_OS2;
- else if ( aWhatOS == "u" )
- nOSType = OS_UNX;
- else if ( aWhatOS == "d" )
- nOSType = OS_WIN16;
- else if ( aWhatOS == "n" )
- nOSType = OS_WIN32;
- else
- nOSType = OS_NONE;
- }
- break;
- case 5:
- if ( !bPrjDep )
- {
- aLogFileName = yytext;
- }
- break;
- default:
- if ( !bPrjDep )
- {
- ByteString aItem = yytext;
- if ( aItem == "NULL" )
- {
- // Liste zu Ende
- i = -1;
- }
- else
- {
- // ggfs. Dependency liste anlegen und ergaenzen
- if ( !pDepList2 )
- pDepList2 = new SByteStringList;
- pDepList2->PutString( new ByteString( aItem ));
- }
- }
- else
- {
- ByteString aItem = yytext;
- if ( aItem == "NULL" )
- {
- // Liste zu Ende
- i = -1;
- bPrjDep= FALSE;
- }
- else
- {
- aProjectName = aDirName.GetToken ( 0, '\\');
- if ( HasProject( aProjectName ))
- {
- pPrj = GetPrj( aProjectName );
- // Projekt exist. schon, neue Eintraege anhaengen
- }
- else
- {
- // neues Project anlegen
- pPrj = new Prj ( aProjectName );
- pPrj->SetPreFix( aPrefix );
- Insert(pPrj,LIST_APPEND);
- }
- pPrj->AddDependencies( aItem );
- pPrj->HasHardDependencies( bHardDep );
-
- if ( nStarMode == STAR_MODE_RECURSIVE_PARSE ) {
- String sItem( aItem, RTL_TEXTENCODING_ASCII_US );
- InsertSolarList( sItem );
- }
- }
-
- }
- break;
- }
- /* Wenn dieses Project noch nicht vertreten ist, in die Liste
- der Solar-Projekte einfuegen */
- if ( i == -1 )
- {
- aProjectName = aDirName.GetToken ( 0, '\\');
- if ( HasProject( aProjectName ))
- {
- pPrj = GetPrj( aProjectName );
- // Projekt exist. schon, neue Eintraege anhaengen
- }
- else
- {
- // neues Project anlegen
- pPrj = new Prj ( aProjectName );
- pPrj->SetPreFix( aPrefix );
- Insert(pPrj,LIST_APPEND);
- }
-
- pCmdData = new CommandData;
- pCmdData->SetPath( aDirName );
- pCmdData->SetCommandType( nCommandType );
- pCmdData->SetCommandPara( aCommandPara );
- pCmdData->SetOSType( nOSType );
- pCmdData->SetLogFile( aLogFileName );
- pCmdData->SetComment( aCommentString );
- pCmdData->SetClientRestriction( sClientRestriction );
- if ( pDepList2 )
- pCmdData->SetDependencies( pDepList2 );
-
- pPrj->Insert ( pCmdData, LIST_APPEND );
-
- }
- i++;
-
- rString.Erase(0, aToken.Len()+1);
- aToken = rString.GetToken( 0, '\t' );
- yytext = aToken.GetBuffer();
-
- }
- // und wer raeumt die depLst wieder ab ?
-}
-
-/*****************************************************************************/
-BOOL StarWriter::InsertProject ( Prj* )
-/*****************************************************************************/
-{
- return FALSE;
-}
-
-/*****************************************************************************/
-Prj* StarWriter::RemoveProject ( ByteString aProjectName )
-/*****************************************************************************/
-{
- size_t nCountMember = Count();
- Prj* pPrj;
- Prj* pPrjFound = NULL;
- SByteStringList* pPrjDeps;
-
- for ( size_t i = 0; i < nCountMember; i++ )
- {
- pPrj = GetObject( i );
- if ( pPrj->GetProjectName() == aProjectName )
- pPrjFound = pPrj;
- else
- {
- pPrjDeps = pPrj->GetDependencies( FALSE );
- if ( pPrjDeps )
- {
- ByteString* pString;
- size_t nPrjDepsCount = pPrjDeps->size();
- for ( ULONG j = nPrjDepsCount; j > 0; )
- {
- pString = (*pPrjDeps)[ --j ];
- if ( pString->GetToken( 0, '.') == aProjectName )
- pPrjDeps->erase( j );
- }
- }
- }
- }
-
- Remove( pPrjFound );
-
- return pPrjFound;
-}
-
-//
-// class StarFile
-//
-
-/*****************************************************************************/
-StarFile::StarFile( const String &rFile )
-/*****************************************************************************/
- : aFileName( rFile )
-{
- DirEntry aEntry( aFileName );
- if ( aEntry.Exists()) {
- bExists = TRUE;
- FileStat aStat( aEntry );
- aDate = aStat.DateModified();
- aTime = aStat.TimeModified();
- }
- else
- bExists = FALSE;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index 650f4ade4b58..1ebd9e85ac9a 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -78,7 +78,7 @@ void RscHrcDep::Execute()
CppDep::Execute();
}
-SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
+int main( int argc, char** argv )
{
int c;
char aBuf[255];
@@ -86,7 +86,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
char pOutputFileName[255];
char pSrsFileName[255];
String aSrsBaseName;
- BOOL bSource = FALSE;
+ sal_Bool bSource = sal_False;
ByteString aRespArg;
// who needs anything but '/' ?
// String aDelim = String(DirEntry::GetAccessDelimiter());
@@ -160,7 +160,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
pDep->AddSource( &aBuf2[0] );
aRespArg += " ";
aRespArg += &aBuf2[0];
- bSource = TRUE;
+ bSource = sal_True;
}
}
}
@@ -193,7 +193,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
case 'h' :
case 'H' :
case '?' :
- printf("RscDep 1.0 (c)2000 StarOffice\n");
+ printf("RscDep 1.0\n");
break;
default:
diff --git a/tools/bootstrp/sstring.cxx b/tools/bootstrp/sstring.cxx
deleted file mode 100644
index 9d96508deb88..000000000000
--- a/tools/bootstrp/sstring.cxx
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_tools.hxx"
-
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-#include <tools/stream.hxx>
-#include "bootstrp/sstring.hxx"
-
-SByteStringList::SByteStringList()
-{
-}
-
-SByteStringList::~SByteStringList()
-{
- CleanUp();
-}
-
-size_t SByteStringList::size() const {
- return maList.size();
-}
-
-ByteString* SByteStringList::erase( size_t i ) {
- ByteString* result = NULL;
- if ( i < maList.size() ) {
- ByteStringList::iterator it = maList.begin();
- ::std::advance( it, i );
- result = *it;
- maList.erase( it );
- }
- return result;
-}
-
-
-ByteString* SByteStringList::operator[]( size_t i ) const {
- return ( i < maList.size() ) ? maList[ i ] : NULL;
-}
-
-ByteString* SByteStringList::at( size_t i ) const {
- return ( i < maList.size() ) ? maList[ i ] : NULL;
-}
-
-size_t SByteStringList::IsString( ByteString* pStr )
-{
- size_t nRet = NOT_THERE;
- if ( (nRet = GetPrevString( pStr )) != 0 )
- {
- ByteString* pString = maList[ nRet ];
- if ( *pString == *pStr )
- return nRet;
- else
- return NOT_THERE;
- }
- else
- {
- ByteString* pString = maList.empty() ? NULL : maList[ 0 ];
- if ( pString && (*pString == *pStr) )
- return 0;
- else
- return NOT_THERE;
- }
-}
-
-size_t SByteStringList::GetPrevString( ByteString* pStr )
-{
- size_t nRet = 0;
- BOOL bFound = FALSE;
- size_t nCountMember = maList.size();
- size_t nUpper = nCountMember;
- size_t nLower = 0;
- size_t nCurrent = nUpper / 2;
- size_t nRem = 0;
- ByteString* pString;
-
- do
- {
- if ( (nCurrent == nLower) || (nCurrent == nUpper) )
- return nLower;
- pString = maList[ nCurrent ];
- StringCompare nResult = pStr->CompareTo( *pString );
- if ( nResult == COMPARE_LESS )
- {
- nUpper = nCurrent;
- nCurrent = (nCurrent + nLower) /2;
- }
- else if ( nResult == COMPARE_GREATER )
- {
- nLower = nCurrent;
- nCurrent = (nUpper + nCurrent) /2;
- }
- else if ( nResult == COMPARE_EQUAL )
- return nCurrent;
- if ( nRem == nCurrent )
- return nCurrent;
- nRem = nCurrent;
- }
- while ( !bFound );
- return nRet;
-}
-
-/**************************************************************************
-*
-* Sortiert einen ByteString in die Liste ein und gibt die Position,
-* an der einsortiert wurde, zurueck
-*
-**************************************************************************/
-
-size_t SByteStringList::PutString( ByteString* pStr )
-{
- size_t nPos = GetPrevString ( pStr );
- if ( maList.size() )
- {
- ByteString* pString = NULL;
- pString = maList[ 0 ];
- if ( pString->CompareTo( *pStr ) == COMPARE_GREATER )
- {
- maList.insert( maList.begin(), pStr );
- return 0;
- }
- pString = maList[ nPos ];
- if ( *pStr != *pString )
- {
- if ( ++nPos < maList.size() ) {
- ByteStringList::iterator it = maList.begin();
- ::std::advance( it, nPos );
- maList.insert( it, pStr );
- return nPos;
- } else {
- maList.push_back( pStr );
- return maList.size() - 1;
- }
- }
- }
- else
- {
- maList.push_back( pStr );
- return 0;
- }
-
- return NOT_THERE;
-}
-
-ByteString* SByteStringList::RemoveString( const ByteString& rName )
-{
- ByteString* pReturn = NULL;
-
- for ( ByteStringList::iterator it = maList.begin(); it < maList.end(); ++it )
- {
- if ( rName == *(*it) )
- {
- pReturn = *it;
- maList.erase( it );
- return pReturn;
- }
- }
-
- return pReturn;
-}
-
-void SByteStringList::CleanUp()
-{
- for ( size_t i = 0, n = maList.size(); i < n; ++i ) {
- delete maList[ i ];
- }
- maList.clear();
-}
-
-SByteStringList& SByteStringList::operator<< ( SvStream& rStream )
-{
- sal_uInt32 nListCount;
- rStream >> nListCount;
- for ( sal_uInt32 i = 0; i < nListCount; i++ ) {
- ByteString* pByteString = new ByteString();
- rStream >> *pByteString;
- maList.push_back( pByteString );
- }
- return *this;
-}
-
-SByteStringList& SByteStringList::operator>> ( SvStream& rStream )
-{
- sal_uInt32 nListCount = maList.size();
- rStream << nListCount;
- for ( size_t i = 0; i < nListCount; ++i ) {
- rStream << *( maList[ i ] );
- }
- return *this;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/bootstrp/command.hxx b/tools/inc/bootstrp/command.hxx
deleted file mode 100644
index 1671c20bc1e3..000000000000
--- a/tools/inc/bootstrp/command.hxx
+++ /dev/null
@@ -1,166 +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 COMMAND_HXX
-#define COMMAND_HXX
-
-#include <iostream>
-
-#include <tools/stream.hxx>
-#define STRLEN 100
-#ifndef UNX
-#define TMPNAME "\\command.tmp"
-#else
-#define TMPNAME "/tmp/command.tmp"
-#endif
-
-/** Different types of spawnable programs
-*/
-enum ExeType
-{
- EXE, /// programm is a native executable
- BAT, /// programm is a DOS-Batch
- BTM /// programm is a 4DOS-Batch
-};
-
-#define COMMAND_NOTFOUND 0x0001
-#define COMMAND_TOOBIG 0x0002
-#define COMMAND_INVALID 0x0004
-#define COMMAND_NOEXEC 0x0008
-#define COMMAND_NOMEM 0x0010
-#define COMMAND_UNKNOWN 0x0020
-
-#ifdef WNT
-#define COMMAND_SHELL "4nt.exe"
-#endif
-#ifdef OS2
-#define COMMAND_SHELL "4os2.exe"
-#endif
-#ifdef UNX
-#define COMMAND_SHELL "csh"
-#endif
-
-class CommandLine;
-class LogWindow;
-
-class CommandLine
-{
-friend class ChildProcess;
-private:
- char *CommandBuffer;
- char *ComShell;
- char **ppArgv;
- BOOL bTmpWrite;
-
-public:
- CommandLine(BOOL bTmpWrite = FALSE);
- CommandLine(const char *, BOOL bTmpWrite = FALSE);
- CommandLine(const CommandLine&, BOOL bTmpWrite = FALSE);
- virtual ~CommandLine();
-
- int nArgc;
-
- CommandLine& operator=(const CommandLine&);
- CommandLine& operator=(const char *);
- void BuildCommand(const char *);
- char** GetCommand(void) { return ppArgv; }
- void Strtokens(const char *);
- void Print();
-};
-
-/** Declares and spawns a child process.
- The spawned programm could be a native executable or a schell script.
-*/
-class CCommand
-{
-private:
- ByteString aCommandLine;
- ByteString aCommand;
- char *pArgv;
- char **ppArgv;
- ULONG nArgc;
- int nError;
-
-protected:
- void ImplInit();
- void Initpp( ULONG nCount, ByteString &rStr );
-
-public:
- /** Creates the process specified without spawning it
- @param rString specifies the programm or shell scrip
- */
- CCommand( ByteString &rString );
-
- /** Creates the process specified without spawning it
- @param pChar specifies the programm or shell scrip
- */
- CCommand( const char *pChar );
-
- /** Try to find the given programm in specified path
- @param sEnv specifies the current search path, defaulted by environment
- @param sItem specifies the system shell
- @return the Location (when programm was found)
- */
- static ByteString Search( ByteString sEnv,
- ByteString sItem = COMMAND_SHELL );
-
- /** Spawns the Process
- @return 0 when spawned without errors, otherwise a error code
- */
- operator int();
-
- ByteString GetCommandLine_() { return aCommandLine; }
- ByteString GetCommand() { return aCommand; }
-
- char** GetCommandStr() { return ppArgv; }
-};
-
-#define COMMAND_EXECUTE_WINDOW 0x0000001
-#define COMMAND_EXECUTE_CONSOLE 0x0000002
-#define COMMAND_EXECUTE_HIDDEN 0x0000004
-#define COMMAND_EXECUTE_START 0x0000008
-#define COMMAND_EXECUTE_WAIT 0x0000010
-#define COMMAND_EXECUTE_REMOTE 0x1000000
-
-typedef ULONG CommandBits;
-
-/** Allowes to spawn programms hidden, waiting etc.
- @see CCommand
-*/
-class CCommandd : public CCommand
-{
- CommandBits nFlag;
-public:
- CCommandd( ByteString &rString, CommandBits nBits );
- CCommandd( const char *pChar, CommandBits nBits );
- operator int();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/bootstrp/inimgr.hxx b/tools/inc/bootstrp/inimgr.hxx
index 12a42db22c24..016eee7bcb76 100644
--- a/tools/inc/bootstrp/inimgr.hxx
+++ b/tools/inc/bootstrp/inimgr.hxx
@@ -40,7 +40,7 @@ Source and Destination Dir is used. Otherwise ForceUpdate has to be used
class IniManager
{
private:
- BOOL bUpdate;
+ sal_Bool bUpdate;
ByteString sGlobalDir; /// holds the org. ini dir
ByteString sLocalPath; /// holds path of local ini dir
diff --git a/tools/inc/bootstrp/mkcreate.hxx b/tools/inc/bootstrp/mkcreate.hxx
index 0178d57c6ef2..13b95074e970 100644
--- a/tools/inc/bootstrp/mkcreate.hxx
+++ b/tools/inc/bootstrp/mkcreate.hxx
@@ -30,7 +30,9 @@
#define _MK_CREATE_HXX
#include <tools/string.hxx>
-#include "bootstrp/sstring.hxx"
+//#include "bootstrp/sstring.hxx"
+
+DECLARE_LIST( UniStringList, UniString* )
#include "bootstrp/prj.hxx"
@@ -44,14 +46,14 @@ class SourceDirectoryList;
class CodedDependency : public ByteString
{
private:
- USHORT nOSType; // operating systems where dependeny exists
+ sal_uInt16 nOSType; // operating systems where dependeny exists
public:
/* create a dependency instance with given coded directory name
*/
CodedDependency(
const ByteString &rCodedIdentifier, // the coded name of the directory
- USHORT nOperatingSystems // the operating systems where this dependency exists
+ sal_uInt16 nOperatingSystems // the operating systems where this dependency exists
) :
ByteString( rCodedIdentifier ),
nOSType( nOperatingSystems )
@@ -60,29 +62,29 @@ public:
/* returns the operating system
*/
- USHORT GetOperatingSystem()
+ sal_uInt16 GetOperatingSystem()
{
return nOSType;
}
/* set operating system
*/
- void SetOperatingSystem( USHORT nOperatingSystems )
+ void SetOperatingSystem( sal_uInt16 nOperatingSystems )
{
nOSType = nOperatingSystems;
}
/* add operating systems if same dependency
*/
- BOOL TryToMerge(
+ sal_Bool TryToMerge(
const ByteString &rCodedIdentifier, // the coded name of the directory
- USHORT nOperatingSystems // the operating systems where this dependency exists
+ sal_uInt16 nOperatingSystems // the operating systems where this dependency exists
)
{
if ( rCodedIdentifier != *this )
- return FALSE;
+ return sal_False;
nOSType |= nOperatingSystems;
- return TRUE;
+ return sal_True;
}
};
@@ -93,14 +95,14 @@ public:
class Dependency : public ByteString
{
private:
- USHORT nOSType; // operating systems where dependecy exists
+ sal_uInt16 nOSType; // operating systems where dependecy exists
public:
/* create a dependency instance with given directory name
*/
Dependency(
const ByteString &rDirectoryName, // the coded name of the directory
- USHORT nOperatingSystems // the operating systems where this dependency exists
+ sal_uInt16 nOperatingSystems // the operating systems where this dependency exists
) :
ByteString( rDirectoryName ),
nOSType( nOperatingSystems )
@@ -109,7 +111,7 @@ public:
/* returns the operating system
*/
- USHORT GetOperatingSystem()
+ sal_uInt16 GetOperatingSystem()
{
return nOSType;
}
@@ -124,8 +126,8 @@ class SourceDirectory : public ByteString
private:
SourceDirectory *pParent; // the parent directory
SourceDirectoryList *pSubDirectories; // list of sub directories
- USHORT nOSType; // operating systems where this directory is used
- USHORT nDepth; // depth of directory structure (root is 0)
+ sal_uInt16 nOSType; // operating systems where this directory is used
+ sal_uInt16 nDepth; // depth of directory structure (root is 0)
SByteStringList *pDependencies; // dependencies on other directories in this depth
@@ -140,13 +142,13 @@ private:
/* returns the operating systems of a coded dependency
*/
- static USHORT GetOSType(
+ static sal_uInt16 GetOSType(
const ByteString &sDependExt // the corresponding dependency extension (see also prj.hxx)
);
/* removes this and all sub directories with all dependencies
*/
- BOOL RemoveDirectoryTreeAndAllDependencies();
+ sal_Bool RemoveDirectoryTreeAndAllDependencies();
public:
@@ -155,7 +157,7 @@ public:
*/
SourceDirectory(
const ByteString &rDirectoryName, // name without parent
- USHORT nOperatingSystem, // the operating systems where this directory is used
+ sal_uInt16 nOperatingSystem, // the operating systems where this directory is used
SourceDirectory *pParentDirectory = NULL // parent (if not root)
);
~SourceDirectory();
@@ -170,20 +172,20 @@ public:
/* returns the Operating systems where this directory is used
*/
- USHORT GetOperatingSystems() { return nOSType; }
+ sal_uInt16 GetOperatingSystems() { return nOSType; }
/* returns the given directory
*/
SourceDirectory *GetDirectory(
const ByteString &rDirectoryName, // full path
- USHORT nOperatingSystem // the operating systems where this directory is used
+ sal_uInt16 nOperatingSystem // the operating systems where this directory is used
);
/* create the directory and all mandatory parents
*/
SourceDirectory *InsertFull(
const ByteString &rDirectoryName, // full path
- USHORT nOperatingSystem // the operating systems where this directory is used
+ sal_uInt16 nOperatingSystem // the operating systems where this directory is used
)
{
return GetDirectory( rDirectoryName, nOperatingSystem );
@@ -193,7 +195,7 @@ public:
*/
SourceDirectory *Insert(
const ByteString &rDirectoryName, // name without parent
- USHORT nOperatingSystem // the operating systems where this directory is used
+ sal_uInt16 nOperatingSystem // the operating systems where this directory is used
);
/* get the root directory
@@ -204,14 +206,14 @@ public:
*/
SourceDirectory *GetSubDirectory(
const ByteString &rDirectoryPath, // full sub path
- USHORT nOperatingSystem // the operating systems where this directory is used
+ sal_uInt16 nOperatingSystem // the operating systems where this directory is used
);
/* add a dependency for several platforms
*/
CodedDependency *AddCodedDependency(
const ByteString &rCodedIdentifier, // the coded name of the directory
- USHORT nOperatingSystems // the operating systems where this dependency exists
+ sal_uInt16 nOperatingSystems // the operating systems where this dependency exists
);
/* returns the dependency list
@@ -225,7 +227,7 @@ public:
*/
CodedDependency *AddCodedIdentifier(
const ByteString &rCodedIdentifier, // the coded name of the directory
- USHORT nOperatingSystems // the operating systems where this dependency exists
+ sal_uInt16 nOperatingSystems // the operating systems where this dependency exists
);
/* returns the identifier list
@@ -252,13 +254,13 @@ public:
static SourceDirectory *CreateRootDirectory(
const ByteString &rRoot, // the root directory in file system
const ByteString &rVersion, // the solar verion (r.g. SRC590, SRC591 etc.)
- BOOL bAll = FALSE // add all directories or only buildable ones
+ sal_Bool bAll = sal_False // add all directories or only buildable ones
);
/* create the makefile.rc in file system
*/
- BOOL CreateRecursiveMakefile(
- BOOL bAllChilds = FALSE // create rcursive for all sub directories
+ sal_Bool CreateRecursiveMakefile(
+ sal_Bool bAllChilds = sal_False // create rcursive for all sub directories
);
};
diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx
index 5e809cd1a3c4..c85928ce11ba 100644
--- a/tools/inc/bootstrp/prj.hxx
+++ b/tools/inc/bootstrp/prj.hxx
@@ -31,94 +31,6 @@
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
-#include <osl/mutex.hxx>
-#include <vector>
-#include <list>
-
-#define OS_NONE 0x0000
-#define OS_WIN16 0x0001
-#define OS_WIN32 0x0002
-#define OS_OS2 0x0004
-#define OS_UNX 0x0008
-#define OS_ALL ( OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX )
-
-#define COMMAND_PROJECTROOT 0x0000
-#define COMMAND_NMAKE 0x0001
-#define COMMAND_GET 0x0002
-#define COMMAND_USER_START 0x0003
-#define COMMAND_USER_END 0xFFFE
-#define COMMAND_ALLDIRS 0xFFFF
-
-class SByteStringList;
-class GenericInformationList;
-
-/*********************************************************************
-*
-* Die Klasse CommandData haelte alle Informationen, die fuer die
-* Abarbeitung eines Kommandos (nmake, get) noetig sind
-*
-*********************************************************************/
-
-class CommandData
-{
- ByteString aPrj;
- ByteString aLogFileName;
- ByteString aInpath;
- ByteString aUpd;
- ByteString aUpdMinor;
- ByteString aProduct;
- ByteString aCommand;
- ByteString aPath;
- ByteString aPrePath;
- ByteString aPreFix;
- ByteString aCommandPara;
- ByteString aComment;
- ByteString sClientRestriction;
- SByteStringList *pDepList;
- USHORT nOSType;
- USHORT nCommand;
-
- ULONG nDepth; // Tiefe der Abhaenigkeit
-
-public:
- CommandData();
- ~CommandData();
- ByteString GetProjectName(){return aPrj;}
- void SetProjectName( ByteString aName ){aPrj = aName;}
- ByteString GetLogFile(){return aLogFileName;}
- void SetLogFile( ByteString aName ){aLogFileName = aName;}
- ByteString GetInpath(){return aInpath;}
- void SetInpath( ByteString aName ){aInpath = aName;}
- ByteString GetUpd(){return aUpd;}
- void SetUpd( ByteString aName ){aUpd = aName;}
- ByteString GetUpdMinor(){return aUpdMinor;}
- void SetUpdMinor( ByteString aName ){aUpdMinor = aName;}
- ByteString GetProduct(){return aProduct;}
- void SetProduct( ByteString aName ){aProduct = aName;}
- ByteString GetCommand(){return aCommand;}
- void SetCommand ( ByteString aName ){aCommand = aName;}
- ByteString GetCommandPara(){return aCommandPara;}
- void SetCommandPara ( ByteString aName ){aCommandPara = aName;}
- ByteString GetComment(){return aComment;}
- void SetComment ( ByteString aCommentString ){aComment = aCommentString;}
- ByteString GetPath(){return aPath;}
- void SetPath( ByteString aName ){aPath = aName;}
- ByteString GetPrePath(){return aPrePath;}
- void SetPrePath( ByteString aName ){aPrePath = aName;}
- USHORT GetOSType(){return nOSType;}
- ByteString GetOSTypeString();
- void SetOSType( USHORT nType ){nOSType = nType;}
- USHORT GetCommandType(){return nCommand;}
- ByteString GetCommandTypeString();
- void SetCommandType( USHORT nCommandType ){nCommand = nCommandType;}
- SByteStringList* GetDependencies(){return pDepList;}
- void SetDependencies( SByteStringList *pList ){pDepList = pList;}
- ByteString GetClientRestriction() { return sClientRestriction; }
- void SetClientRestriction( ByteString sRestriction ) { sClientRestriction = sRestriction; }
-
- void AddDepth(){nDepth++;}
- ULONG GetDepth(){return nDepth;}
-};
/*********************************************************************
*
@@ -141,281 +53,7 @@ public:
SimpleConfig(DirEntry& rDirEntry);
~SimpleConfig();
ByteString GetNext();
- ByteString GetCleanedNextLine( BOOL bReadComments = FALSE );
-};
-
-#define ENV_GUI 0x00000000
-#define ENV_OS 0x00000001
-#define ENV_UPD 0x00000002
-#define ENV_UPDMIN 0x00000004
-#define ENV_INPATH 0x00000008
-#define ENV_OUTPATH 0x00000010
-#define ENV_GUIBASE 0x00000020
-#define ENV_CVER 0x00000040
-#define ENV_GVER 0x00000080
-#define ENV_GUIENV 0x00000100
-#define ENV_CPU 0x00000200
-#define ENV_CPUNAME 0x00000400
-#define ENV_DLLSUFF 0x00000800
-#define ENV_COMEX 0x00001000
-#define ENV_COMPATH 0x00002000
-#define ENV_INCLUDE 0x00004000
-#define ENV_LIB 0x00008000
-#define ENV_PATH 0x00010000
-#define ENV_SOLVER 0x00020000
-#define ENV_SOLENV 0x00040000
-#define ENV_SOLROOT 0x00080000
-#define ENV_DEVROOT 0x00100000
-#define ENV_EMERG 0x00200000
-#define ENV_STAND 0x00400000
-
-/*********************************************************************
-*
-* class Prj
-* alle Daten eines Projektes werden hier gehalten
-*
-*********************************************************************/
-
-typedef ::std::vector< CommandData* > PrjList;
-
-class Star;
-class Prj
-{
-friend class Star;
-private:
- PrjList maList;
- size_t maCurrent;
-
- BOOL bVisited;
-
- ByteString aPrjPath;
- ByteString aProjectName;
- ByteString aProjectPrefix; // max. 2-buchstabige Abk.
- SByteStringList* pPrjInitialDepList;
- SByteStringList* pPrjDepList;
- BOOL bHardDependencies;
- BOOL bSorted;
-
-public:
- Prj();
- Prj( ByteString aName );
- ~Prj();
- void SetPreFix( ByteString aPre ){aProjectPrefix = aPre;}
- ByteString GetPreFix(){return aProjectPrefix;}
- ByteString GetProjectName()
- {return aProjectName;}
- void SetProjectName(ByteString aName)
- {aProjectName = aName;}
- BOOL InsertDirectory( ByteString aDirName , USHORT aWhat,
- USHORT aWhatOS, ByteString aLogFileName,
- const ByteString &rClientRestriction );
- CommandData* RemoveDirectory( ByteString aLogFileName );
- CommandData* GetDirectoryList ( USHORT nWhatOs, USHORT nCommand );
- CommandData* GetDirectoryData( ByteString aLogFileName );
- inline CommandData* GetData( ByteString aLogFileName )
- { return GetDirectoryData( aLogFileName ); };
-
- SByteStringList* GetDependencies( BOOL bExpanded = TRUE );
- void AddDependencies( ByteString aStr );
- void HasHardDependencies( BOOL bHard ) { bHardDependencies = bHard; }
- BOOL HasHardDependencies() { return bHardDependencies; }
-
- size_t Count() const { return maList.size(); }
-
- CommandData* GetObject( size_t i ) { return ( i < maList.size() ) ? maList[ i ] : NULL; }
-
- void Insert( CommandData* item, size_t i )
- {
- if ( i < maList.size() )
- {
- PrjList::iterator it = maList.begin();
- ::std::advance( it, i );
- maList.insert( it, item );
- maCurrent = i;
- }
- else
- {
- maCurrent = maList.size();
- maList.push_back( item );
- }
- }
-
- CommandData* First()
- {
- maCurrent = 0;
- return maList.empty() ? NULL : maList[ 0 ];
- }
-
- CommandData* Next()
- {
- if ( maCurrent+1 >= maList.size() ) return NULL;
- maCurrent++;
- return maList[ maCurrent ];
- }
-
- CommandData* Remove( CommandData* item )
- {
- for ( PrjList::iterator it = maList.begin(); it < maList.end(); ++it )
- {
- if ( *it == item )
- {
- maList.erase( it );
- return item;
- }
- }
- return NULL;
- }
-};
-
-/*********************************************************************
-*
-* class Star
-* Diese Klasse liest die Projectstruktur aller StarDivision Projekte
-* aus \\dev\data1\upenv\data\config\solar.lst aus
-*
-*********************************************************************/
-
-class StarFile
-{
-private:
- String aFileName;
- Date aDate;
- Time aTime;
-
- BOOL bExists;
-
-public:
- StarFile( const String &rFile );
- BOOL Exists() { return bExists; }
-};
-
-#define STAR_MODE_SINGLE_PARSE 0x0000
-#define STAR_MODE_RECURSIVE_PARSE 0x0001
-#define STAR_MODE_MULTIPLE_PARSE 0x0002
-
-typedef ::std::vector< Prj* > StarList;
-// todo: SolarFileList should be a linked list and not a vector.
-// also, the Read() functions need to be changed (see 1st read() in prj.cxx for notes)
-typedef ::std::list< String* > SolarFileList;
-
-class Star
-{
-private:
- StarList maStarList;
- size_t maCurrent;
-
- ByteString aStarName;
-
- static Link aDBNotFoundHdl;
-protected:
- osl::Mutex aMutex;
-
- USHORT nStarMode;
- SolarFileList aFileList;
- String sSourceRoot;
-
- void InsertSolarList( String sProject );
- String CreateFileName( String sProject );
-
- void Expand_Impl();
- void ExpandPrj_Impl( Prj *pPrj, Prj *pDepPrj );
-
-private:
- void Read( String &rFileName );
- void Read( SolarFileList *pSOlarFiles );
-
-public:
- Star();
- Star( String aFileName, USHORT nMode = STAR_MODE_SINGLE_PARSE );
- Star( SolarFileList *pSolarFiles );
- Star( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bLocal = FALSE,
- const char *pSourceRoot = NULL );
-
- ~Star();
-
- static void SetDBNotFoundHdl( const Link &rLink ) { aDBNotFoundHdl = rLink; }
-
- ByteString GetName(){ return aStarName; };
-
- BOOL HasProject( ByteString aProjectName );
- Prj* GetPrj( ByteString aProjectName );
- ByteString GetPrjName( DirEntry &rPath );
-
- void InsertToken( char *pChar );
-
- USHORT GetMode() { return nStarMode; }
-
- size_t Count() const { return maStarList.size(); }
-
- Prj* GetObject( size_t i )
- { return ( i < maStarList.size() ) ? maStarList[ i ] : NULL; }
-
- void Insert( Prj* item, size_t i )
- {
- if ( i < maStarList.size() )
- {
- StarList::iterator it = maStarList.begin();
- ::std::advance( it, i );
- maStarList.insert( it, item );
- maCurrent = i;
- }
- else
- {
- maCurrent = maStarList.size();
- maStarList.push_back( item );
- }
- }
-
- Prj* First()
- {
- maCurrent = 0;
- return maStarList.empty() ? NULL : maStarList[ 0 ];
- }
-
- Prj* Next()
- {
- if ( maCurrent+1 >= maStarList.size() ) return NULL;
- maCurrent++;
- return maStarList[ maCurrent ];
- }
-
- Prj* Remove( Prj* item )
- {
- for ( StarList::iterator it = maStarList.begin(); it < maStarList.end(); ++it )
- {
- if ( *it == item )
- {
- maStarList.erase( it );
- return item;
- }
- }
- return NULL;
- }
-
-};
-
-class StarWriter : public Star
-{
-private:
- USHORT WritePrj( Prj *pPrj, SvFileStream& rStream );
-
-public:
- StarWriter( String aFileName, BOOL bReadComments = FALSE, USHORT nMode = STAR_MODE_SINGLE_PARSE );
- StarWriter( SolarFileList *pSolarFiles, BOOL bReadComments = FALSE );
- StarWriter( GenericInformationList *pStandLst, ByteString &rVersion, BOOL bLocal = FALSE,
- const char *pSourceRoot = NULL );
-
- void CleanUp();
-
- BOOL InsertProject ( Prj* pNewPrj );
- Prj* RemoveProject ( ByteString aProjectName );
-
- USHORT Read( String aFileName, BOOL bReadComments = FALSE, USHORT nMode = STAR_MODE_SINGLE_PARSE );
- USHORT Read( SolarFileList *pSolarFiles, BOOL bReadComments = FALSE );
- USHORT Write( String aFileName );
- USHORT WriteMultiple( String rSourceRoot );
-
- void InsertTokenLine( ByteString& rString );
+ ByteString GetCleanedNextLine( sal_Bool bReadComments = sal_False );
};
#endif
diff --git a/tools/inc/bootstrp/sstring.hxx b/tools/inc/bootstrp/sstring.hxx
deleted file mode 100644
index ba63b9a1c8ea..000000000000
--- a/tools/inc/bootstrp/sstring.hxx
+++ /dev/null
@@ -1,77 +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 _SSTRING_HXX
-#define _SSTRING_HXX
-
-#include <tools/string.hxx>
-#include <vector>
-
-#define NOT_THERE LIST_ENTRY_NOTFOUND
-
-typedef ::std::vector< ByteString* > ByteStringList;
-
-class SvStream;
-
-// ---------------------
-// - class SStringList -
-// ---------------------
-
-class SByteStringList
-{
-private:
- ByteStringList maList;
-
-public:
- SByteStringList();
- ~SByteStringList();
-
- // neuen ByteString in Liste einfuegen
- size_t PutString( ByteString* );
- ByteString* RemoveString( const ByteString& rName );
-
- // Position des ByteString in Liste, wenn nicht enthalten, dann
- // return = NOT_THERE
- size_t IsString( ByteString* );
-
- // Vorgaenger ermitteln ( auch wenn selbst noch nicht in
- // Liste enthalten
- size_t GetPrevString( ByteString* );
- void CleanUp();
- size_t size() const;
- ByteString* erase( size_t i );
-
- SByteStringList& operator<< ( SvStream& rStream );
- SByteStringList& operator>> ( SvStream& rStream );
- ByteString* operator[]( size_t i ) const;
- ByteString* at( size_t i ) const;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/impcont.hxx b/tools/inc/impcont.hxx
index e60bd80b1318..8734f9d4ae74 100644
--- a/tools/inc/impcont.hxx
+++ b/tools/inc/impcont.hxx
@@ -43,8 +43,8 @@ class CBlock
private:
CBlock* pPrev; // Vorheriger Block
CBlock* pNext; // Naechster Block
- USHORT nSize; // Groesse des Blocks
- USHORT nCount; // Anzahl Pointer
+ sal_uInt16 nSize; // Groesse des Blocks
+ sal_uInt16 nCount; // Anzahl Pointer
void** pNodes; // Pointer auf die Daten
#if defined DBG_UTIL
@@ -53,26 +53,26 @@ private:
public:
// Fuer List-Container
- CBlock( USHORT nSize, CBlock* pPrev, CBlock* pNext );
+ CBlock( sal_uInt16 nSize, CBlock* pPrev, CBlock* pNext );
// Fuer Array-Container
- CBlock( USHORT nSize, CBlock* pPrev );
+ CBlock( sal_uInt16 nSize, CBlock* pPrev );
// Copy-Ctor
CBlock( const CBlock& r, CBlock* pPrev );
~CBlock();
- void Insert( void* p, USHORT nIndex, USHORT nReSize );
- CBlock* Split( void* p, USHORT nIndex, USHORT nReSize );
- void* Remove( USHORT nIndex, USHORT nReSize );
- void* Replace( void* pNew, USHORT nIndex );
+ void Insert( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize );
+ CBlock* Split( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize );
+ void* Remove( sal_uInt16 nIndex, sal_uInt16 nReSize );
+ void* Replace( void* pNew, sal_uInt16 nIndex );
void** GetNodes() const { return pNodes; }
- void** GetObjectPtr( USHORT nIndex );
- void* GetObject( USHORT nIndex ) const;
+ void** GetObjectPtr( sal_uInt16 nIndex );
+ void* GetObject( sal_uInt16 nIndex ) const;
- void SetSize( USHORT nNewSize );
+ void SetSize( sal_uInt16 nNewSize );
- USHORT GetSize() const { return nCount; }
- USHORT Count() const { return nCount; }
+ sal_uInt16 GetSize() const { return nCount; }
+ sal_uInt16 Count() const { return nCount; }
void SetPrevBlock( CBlock* p ) { pPrev = p; }
void SetNextBlock( CBlock* p ) { pNext = p; }
CBlock* GetPrevBlock() const { return pPrev; }
@@ -93,7 +93,7 @@ private:
|*
*************************************************************************/
-inline void* CBlock::GetObject( USHORT nIndex ) const
+inline void* CBlock::GetObject( sal_uInt16 nIndex ) const
{
return pNodes[nIndex];
}
@@ -108,11 +108,11 @@ inline void* CBlock::GetObject( USHORT nIndex ) const
|*
*************************************************************************/
-inline void* Container::ImpGetObject( ULONG nIndex ) const
+inline void* Container::ImpGetObject( sal_uIntPtr nIndex ) const
{
if ( pFirstBlock && (nIndex < pFirstBlock->Count()) )
// Item innerhalb des gefundenen Blocks zurueckgeben
- return pFirstBlock->GetObject( (USHORT)nIndex );
+ return pFirstBlock->GetObject( (sal_uInt16)nIndex );
else
return GetObject( nIndex );
}
diff --git a/tools/inc/makefile.mk b/tools/inc/makefile.mk
deleted file mode 100644
index a3a76dc94a11..000000000000
--- a/tools/inc/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=tools
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/tools/inc/poly.h b/tools/inc/poly.h
index c584a9d32700..08bb5081c726 100644
--- a/tools/inc/poly.h
+++ b/tools/inc/poly.h
@@ -31,7 +31,7 @@
#include <tools/gen.hxx>
-#define MAX_64KPOINTS ((((USHORT)0xFFFF)-32)/sizeof(Point))
+#define MAX_64KPOINTS ((((sal_uInt16)0xFFFF)-32)/sizeof(Point))
// -------------------
// - ImplPolygonData -
@@ -40,17 +40,10 @@
class ImplPolygonData
{
public:
-#ifdef WIN
- Point huge* mpPointAry;
- BYTE* mpFlagAry;
- GLOBALHANDLE mhPoints;
-#else
Point* mpPointAry;
- BYTE* mpFlagAry;
-#endif
-
- USHORT mnPoints;
- ULONG mnRefCount;
+ sal_uInt8* mpFlagAry;
+ sal_uInt16 mnPoints;
+ sal_uIntPtr mnRefCount;
};
// ---------------
@@ -60,22 +53,22 @@ public:
class ImplPolygon : public ImplPolygonData
{
public:
- ImplPolygon( USHORT nInitSize, BOOL bFlags = FALSE );
- ImplPolygon( USHORT nPoints, const Point* pPtAry, const BYTE* pInitFlags = NULL );
+ ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags = sal_False );
+ ImplPolygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pInitFlags = NULL );
ImplPolygon( const ImplPolygon& rImplPoly );
~ImplPolygon();
- void ImplSetSize( USHORT nSize, BOOL bResize = TRUE );
+ void ImplSetSize( sal_uInt16 nSize, sal_Bool bResize = sal_True );
void ImplCreateFlagArray();
- void ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly = NULL );
- void ImplRemove( USHORT nPos, USHORT nCount );
+ void ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = NULL );
+ void ImplRemove( sal_uInt16 nPos, sal_uInt16 nCount );
};
// -------------------
// - ImplPolyPolygon -
// -------------------
-#define MAX_POLYGONS ((USHORT)0x3FF0)
+#define MAX_POLYGONS ((sal_uInt16)0x3FF0)
class Polygon;
typedef Polygon* SVPPOLYGON;
@@ -84,15 +77,15 @@ class ImplPolyPolygon
{
public:
SVPPOLYGON* mpPolyAry;
- ULONG mnRefCount;
- USHORT mnCount;
- USHORT mnSize;
- USHORT mnResize;
+ sal_uIntPtr mnRefCount;
+ sal_uInt16 mnCount;
+ sal_uInt16 mnSize;
+ sal_uInt16 mnResize;
- ImplPolyPolygon( USHORT nInitSize, USHORT nResize )
+ ImplPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
{ mpPolyAry = NULL; mnCount = 0; mnRefCount = 1;
mnSize = nInitSize; mnResize = nResize; }
- ImplPolyPolygon( USHORT nInitSize );
+ ImplPolyPolygon( sal_uInt16 nInitSize );
ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly );
~ImplPolyPolygon();
};
diff --git a/tools/inc/tools/StringListResource.hxx b/tools/inc/tools/StringListResource.hxx
index 5b45be439230..6b199d855c87 100644
--- a/tools/inc/tools/StringListResource.hxx
+++ b/tools/inc/tools/StringListResource.hxx
@@ -40,7 +40,7 @@ namespace tools
public:
StringListResource(const ResId& _aResId,::std::vector< ::rtl::OUString>& _rToFill ) : Resource(_aResId)
{
- USHORT i = 1;
+ sal_uInt16 i = 1;
while( IsAvailableRes(ResId(i,*m_pResMgr).SetRT(RSC_STRING)) )
{
String sStr = String(ResId(i,*m_pResMgr));
diff --git a/tools/inc/tools/agapi.hxx b/tools/inc/tools/agapi.hxx
deleted file mode 100644
index 731594ad4df1..000000000000
--- a/tools/inc/tools/agapi.hxx
+++ /dev/null
@@ -1,69 +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 _AGAPI_HXX
-#define _AGAPI_HXX
-
-#include <tools/solar.h>
-
-class INetURLObject;
-class ChannelList;
-class AgentItem;
-class String;
-
-class AgentApi
-{
-protected:
- friend class ChannelList;
-
- AgentItem* pChannelAgent;
- virtual BOOL StartAgent() = 0;
-
- AgentApi(AgentItem* pAgent) { pChannelAgent = pAgent; }
-
-public:
- virtual ~AgentApi() {}
-
- virtual void InitAgent() = 0;
- virtual void ShutDownAgent() = 0;
-
- virtual BOOL NewDataPermission(const String& rChannelName) = 0;
- virtual void NewData(const String& rChannelName,
- const INetURLObject& rURL) = 0;
- virtual void NotifyChannelObjFile(const INetURLObject& rURL,
- const String& rFileName) = 0;
- virtual void NotifyChannelObjData(const INetURLObject& rURL,
- void* pBuffer, long nOffset, long nLen, long nTotalLen) = 0;
-
- virtual void RegisterChannels() = 0;
- virtual void RegisterUpdateTransmitter() = 0;
-};
-
-#endif //_AGAPI_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/agitem.hxx b/tools/inc/tools/agitem.hxx
deleted file mode 100644
index 869fb99d8510..000000000000
--- a/tools/inc/tools/agitem.hxx
+++ /dev/null
@@ -1,53 +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 _AGITEM_HXX
-#define _AGITEM_HXX
-
-#include <tools/solar.h>
-
-class String;
-class INetURLObject;
-class AgentApi;
-class ChApi;
-
-class AgentItem
-{
-public:
- virtual const String& GetChAgentName() const = 0;
- virtual const INetURLObject& GetLocation() const = 0;
- virtual AgentApi* GetApi() const = 0;
- virtual ChApi* GetChApi() const = 0;
-
- virtual void SetIsActive(BOOL bNew) = 0;
- virtual BOOL IsActive() const = 0;
-};
-
-#endif //_AGITEM_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/bigint.hxx b/tools/inc/tools/bigint.hxx
index 544b0b5ef26d..965e85fdbbdb 100644
--- a/tools/inc/tools/bigint.hxx
+++ b/tools/inc/tools/bigint.hxx
@@ -94,8 +94,8 @@ public:
operator long() const;
operator int() const;
operator double() const;
- operator USHORT() const;
- operator ULONG() const;
+ operator sal_uInt16() const;
+ operator sal_uIntPtr() const;
void Set( sal_Bool bSet ) { bIsSet = bSet; }
ByteString GetByteString() const;
@@ -200,10 +200,10 @@ inline BigInt::operator int() const
return 0;
}
-inline BigInt::operator USHORT() const
+inline BigInt::operator sal_uInt16() const
{
if ( !bIsBig && nVal >= 0 && nVal <= USHRT_MAX )
- return (USHORT)nVal;
+ return (sal_uInt16)nVal;
else
return 0;
}
diff --git a/tools/inc/tools/cachestr.hxx b/tools/inc/tools/cachestr.hxx
index cbc16e5950b4..adb9aacc28d2 100644
--- a/tools/inc/tools/cachestr.hxx
+++ b/tools/inc/tools/cachestr.hxx
@@ -43,7 +43,7 @@ class TOOLS_DLLPUBLIC SvCacheStream : public SvStream
{
private:
String aFileName;
- ULONG nMaxSize;
+ sal_uIntPtr nMaxSize;
int bPersistent;
SvStream* pSwapStream;
@@ -52,17 +52,17 @@ private:
Link aFilenameLinkHdl;
- TOOLS_DLLPRIVATE virtual ULONG GetData( void* pData, ULONG nSize );
- TOOLS_DLLPRIVATE virtual ULONG PutData( const void* pData, ULONG nSize );
- TOOLS_DLLPRIVATE virtual ULONG SeekPos( ULONG nPos );
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize );
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize );
+ TOOLS_DLLPRIVATE virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos );
TOOLS_DLLPRIVATE virtual void FlushData();
- TOOLS_DLLPRIVATE virtual void SetSize( ULONG nSize );
+ TOOLS_DLLPRIVATE virtual void SetSize( sal_uIntPtr nSize );
public:
- SvCacheStream( ULONG nMaxMemSize = 0 );
+ SvCacheStream( sal_uIntPtr nMaxMemSize = 0 );
SvCacheStream( const String &rFileName,
- ULONG nExpectedSize = 0,
- ULONG nMaxMemSize = 0 );
+ sal_uIntPtr nExpectedSize = 0,
+ sal_uIntPtr nMaxMemSize = 0 );
~SvCacheStream();
void SetFilenameHdl( const Link& rLink);
@@ -73,10 +73,10 @@ public:
void SwapOut();
const void* GetBuffer();
- ULONG GetSize();
+ sal_uIntPtr GetSize();
- BOOL IsPersistent() { return bPersistent != 0; }
- void SetPersistence( BOOL b = TRUE ) { bPersistent = b; }
+ sal_Bool IsPersistent() { return bPersistent != 0; }
+ void SetPersistence( sal_Bool b = sal_True ) { bPersistent = b; }
void SetSwapStream( SvStream *p )
{ pSwapStream = p; } // darf nur vom FilenameHdl gerufen werden!
};
diff --git a/tools/inc/tools/chapi.hxx b/tools/inc/tools/chapi.hxx
deleted file mode 100644
index d83367a4a246..000000000000
--- a/tools/inc/tools/chapi.hxx
+++ /dev/null
@@ -1,71 +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 _CHAPI_HXX
-#define _CHAPI_HXX
-
-#include <tools/solar.h>
-
-class ChannelAgentItem;
-class INetURLObject;
-class String;
-
-enum RequestType {
- REQTYP_LOCAL_FILE = 1,
- REQTYP_MEMORY = 2
-};
-
-class ChApi
-{
-public:
- virtual ~ChApi() {}
-
- virtual void ShutDownAgent() = 0;
- virtual void SetLastSuccUpd() = 0;
-
- virtual void GetChannelObject( const INetURLObject& rURL, RequestType eStreamType,
- const String& rFileName ) = 0;
- virtual void AddChannelItem( const String& aChName, const INetURLObject& aTransmitter,
- const String& aChannel, USHORT nUpdPeriode,
- const String& rChAgentName ) = 0;
- virtual void DelChannelItem( const String& aChName ) = 0;
- virtual void SetChTransmitter( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChannel( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChannelName( const String& aChName, const String& rNewVal ) = 0;
- virtual void SetChUpdPeriode( const String& aChName, USHORT nUpdPeriode ) = 0;
- virtual void SetChannelAgentName( const String& aChName, const String& rNewVal ) = 0;
-
- virtual void SetUpdateTransmitter(ChannelAgentItem* pAgent, const INetURLObject& rTransmitter) = 0;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-
-#endif //_CHAPI_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/color.hxx b/tools/inc/tools/color.hxx
index a46fc60ea554..a75319d89677 100644
--- a/tools/inc/tools/color.hxx
+++ b/tools/inc/tools/color.hxx
@@ -40,24 +40,24 @@ class ResId;
// - ColorCount-Types -
// --------------------
-#define COLCOUNT_MONOCHROM ((ULONG)2)
-#define COLCOUNT_16 ((ULONG)16)
-#define COLCOUNT_256 ((ULONG)256)
-#define COLCOUNT_HICOLOR1 (((ULONG)0x00007FFF)+1)
-#define COLCOUNT_HICOLOR2 (((ULONG)0x0000FFFF)+1)
-#define COLCOUNT_TRUECOLOR (((ULONG)0x00FFFFFF)+1)
+#define COLCOUNT_MONOCHROM ((sal_uIntPtr)2)
+#define COLCOUNT_16 ((sal_uIntPtr)16)
+#define COLCOUNT_256 ((sal_uIntPtr)256)
+#define COLCOUNT_HICOLOR1 (((sal_uIntPtr)0x00007FFF)+1)
+#define COLCOUNT_HICOLOR2 (((sal_uIntPtr)0x0000FFFF)+1)
+#define COLCOUNT_TRUECOLOR (((sal_uIntPtr)0x00FFFFFF)+1)
// ---------------
// - Color-Types -
// ---------------
-typedef UINT32 ColorData;
-#define RGB_COLORDATA( r,g,b ) ((ColorData)(((UINT32)((UINT8)(b))))|(((UINT32)((UINT8)(g)))<<8)|(((UINT32)((UINT8)(r)))<<16))
-#define TRGB_COLORDATA( t,r,g,b ) ((ColorData)(((UINT32)((UINT8)(b))))|(((UINT32)((UINT8)(g)))<<8)|(((UINT32)((UINT8)(r)))<<16)|(((UINT32)((UINT8)(t)))<<24))
-#define COLORDATA_RED( n ) ((UINT8)((n)>>16))
-#define COLORDATA_GREEN( n ) ((UINT8)(((UINT16)(n)) >> 8))
-#define COLORDATA_BLUE( n ) ((UINT8)(n))
-#define COLORDATA_TRANSPARENCY( n ) ((UINT8)((n)>>24))
+typedef sal_uInt32 ColorData;
+#define RGB_COLORDATA( r,g,b ) ((ColorData)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16))
+#define TRGB_COLORDATA( t,r,g,b ) ((ColorData)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16)|(((sal_uInt32)((sal_uInt8)(t)))<<24))
+#define COLORDATA_RED( n ) ((sal_uInt8)((n)>>16))
+#define COLORDATA_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
+#define COLORDATA_BLUE( n ) ((sal_uInt8)(n))
+#define COLORDATA_TRANSPARENCY( n ) ((sal_uInt8)((n)>>24))
#define COLORDATA_RGB( n ) ((ColorData)((n) & 0x00FFFFFF))
#define COL_BLACK RGB_COLORDATA( 0x00, 0x00, 0x00 )
@@ -107,7 +107,7 @@ typedef UINT32 ColorData;
#define COL_AUTHOR9_LIGHT RGB_COLORDATA(255, 231, 199)
#define COLOR_CHANNEL_MERGE( _def_cDst, _def_cSrc, _def_cSrcTrans ) \
- ((BYTE)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8L)|(_def_cDst)))>>8L))
+ ((sal_uInt8)((((long)(_def_cDst)-(_def_cSrc))*(_def_cSrcTrans)+(((_def_cSrc)<<8L)|(_def_cDst)))>>8L))
// ---------
// - Color -
@@ -121,9 +121,9 @@ protected:
public:
Color() { mnColor = COL_BLACK; }
Color( ColorData nColor ) { mnColor = nColor; }
- Color( UINT8 nRed, UINT8 nGreen, UINT8 nBlue )
+ Color( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue )
{ mnColor = RGB_COLORDATA( nRed, nGreen, nBlue ); }
- Color( UINT8 nTransparency, UINT8 nRed, UINT8 nGreen, UINT8 nBlue )
+ Color( sal_uInt8 nTransparency, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue )
{ mnColor = TRGB_COLORDATA( nTransparency, nRed, nGreen, nBlue ); }
Color( const ResId& rResId );
// This ctor is defined in svtools, not tools!
@@ -132,58 +132,58 @@ public:
explicit Color(const ::basegfx::BColor& rBColor)
{
mnColor = RGB_COLORDATA(
- UINT8((rBColor.getRed() * 255.0) + 0.5),
- UINT8((rBColor.getGreen() * 255.0) + 0.5),
- UINT8((rBColor.getBlue() * 255.0) + 0.5));
+ sal_uInt8((rBColor.getRed() * 255.0) + 0.5),
+ sal_uInt8((rBColor.getGreen() * 255.0) + 0.5),
+ sal_uInt8((rBColor.getBlue() * 255.0) + 0.5));
}
- void SetRed( UINT8 nRed );
- UINT8 GetRed() const { return COLORDATA_RED( mnColor ); }
- void SetGreen( UINT8 nGreen );
- UINT8 GetGreen() const { return COLORDATA_GREEN( mnColor ); }
- void SetBlue( UINT8 nBlue );
- UINT8 GetBlue() const { return COLORDATA_BLUE( mnColor ); }
- void SetTransparency( UINT8 nTransparency );
- UINT8 GetTransparency() const { return COLORDATA_TRANSPARENCY( mnColor ); }
+ void SetRed( sal_uInt8 nRed );
+ sal_uInt8 GetRed() const { return COLORDATA_RED( mnColor ); }
+ void SetGreen( sal_uInt8 nGreen );
+ sal_uInt8 GetGreen() const { return COLORDATA_GREEN( mnColor ); }
+ void SetBlue( sal_uInt8 nBlue );
+ sal_uInt8 GetBlue() const { return COLORDATA_BLUE( mnColor ); }
+ void SetTransparency( sal_uInt8 nTransparency );
+ sal_uInt8 GetTransparency() const { return COLORDATA_TRANSPARENCY( mnColor ); }
void SetColor( ColorData nColor ) { mnColor = nColor; }
ColorData GetColor() const { return mnColor; }
ColorData GetRGBColor() const { return COLORDATA_RGB( mnColor ); }
- UINT8 GetColorError( const Color& rCompareColor ) const;
+ sal_uInt8 GetColorError( const Color& rCompareColor ) const;
- UINT8 GetLuminance() const;
- void IncreaseLuminance( UINT8 cLumInc );
- void DecreaseLuminance( UINT8 cLumDec );
+ sal_uInt8 GetLuminance() const;
+ void IncreaseLuminance( sal_uInt8 cLumInc );
+ void DecreaseLuminance( sal_uInt8 cLumDec );
- void IncreaseContrast( UINT8 cContInc );
- void DecreaseContrast( UINT8 cContDec );
+ void IncreaseContrast( sal_uInt8 cContInc );
+ void DecreaseContrast( sal_uInt8 cContDec );
void Invert();
- void Merge( const Color& rMergeColor, BYTE cTransparency );
+ void Merge( const Color& rMergeColor, sal_uInt8 cTransparency );
- BOOL IsRGBEqual( const Color& rColor ) const;
+ sal_Bool IsRGBEqual( const Color& rColor ) const;
// comparison with luminance thresholds
- BOOL IsDark() const;
- BOOL IsBright() const;
+ sal_Bool IsDark() const;
+ sal_Bool IsBright() const;
// color space conversion tools
// the range for h/s/b is:
// Hue: 0-360 degree
// Saturation: 0-100 %
// Brightness: 0-100 %
- static ColorData HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri );
- void RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const;
+ static ColorData HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri );
+ void RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const;
- BOOL operator==( const Color& rColor ) const
+ sal_Bool operator==( const Color& rColor ) const
{ return (mnColor == rColor.mnColor); }
- BOOL operator!=( const Color& rColor ) const
+ sal_Bool operator!=( const Color& rColor ) const
{ return !(Color::operator==( rColor )); }
- SvStream& Read( SvStream& rIStm, BOOL bNewFormat = TRUE );
- SvStream& Write( SvStream& rOStm, BOOL bNewFormat = TRUE );
+ SvStream& Read( SvStream& rIStm, sal_Bool bNewFormat = sal_True );
+ SvStream& Write( SvStream& rOStm, sal_Bool bNewFormat = sal_True );
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Color& rColor );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Color& rColor );
@@ -192,43 +192,43 @@ public:
::basegfx::BColor getBColor() const { return ::basegfx::BColor(GetRed() / 255.0, GetGreen() / 255.0, GetBlue() / 255.0); }
};
-inline void Color::SetRed( UINT8 nRed )
+inline void Color::SetRed( sal_uInt8 nRed )
{
mnColor &= 0xFF00FFFF;
- mnColor |= ((UINT32)nRed)<<16;
+ mnColor |= ((sal_uInt32)nRed)<<16;
}
-inline void Color::SetGreen( UINT8 nGreen )
+inline void Color::SetGreen( sal_uInt8 nGreen )
{
mnColor &= 0xFFFF00FF;
- mnColor |= ((UINT16)nGreen)<<8;
+ mnColor |= ((sal_uInt16)nGreen)<<8;
}
-inline void Color::SetBlue( UINT8 nBlue )
+inline void Color::SetBlue( sal_uInt8 nBlue )
{
mnColor &= 0xFFFFFF00;
mnColor |= nBlue;
}
-inline void Color::SetTransparency( UINT8 nTransparency )
+inline void Color::SetTransparency( sal_uInt8 nTransparency )
{
mnColor &= 0x00FFFFFF;
- mnColor |= ((UINT32)nTransparency)<<24;
+ mnColor |= ((sal_uInt32)nTransparency)<<24;
}
-inline BOOL Color::IsRGBEqual( const Color& rColor ) const
+inline sal_Bool Color::IsRGBEqual( const Color& rColor ) const
{
return (COLORDATA_RGB( mnColor ) == COLORDATA_RGB( rColor.mnColor ));
}
-inline UINT8 Color::GetLuminance() const
+inline sal_uInt8 Color::GetLuminance() const
{
- return( (UINT8) ( ( COLORDATA_BLUE( mnColor ) * 28UL +
+ return( (sal_uInt8) ( ( COLORDATA_BLUE( mnColor ) * 28UL +
COLORDATA_GREEN( mnColor ) * 151UL +
COLORDATA_RED( mnColor ) * 77UL ) >> 8UL ) );
}
-inline void Color::Merge( const Color& rMergeColor, BYTE cTransparency )
+inline void Color::Merge( const Color& rMergeColor, sal_uInt8 cTransparency )
{
SetRed( COLOR_CHANNEL_MERGE( COLORDATA_RED( mnColor ), COLORDATA_RED( rMergeColor.mnColor ), cTransparency ) );
SetGreen( COLOR_CHANNEL_MERGE( COLORDATA_GREEN( mnColor ), COLORDATA_GREEN( rMergeColor.mnColor ), cTransparency ) );
diff --git a/tools/inc/tools/config.hxx b/tools/inc/tools/config.hxx
index d18d410452b2..fae05fb8bc42 100644
--- a/tools/inc/tools/config.hxx
+++ b/tools/inc/tools/config.hxx
@@ -45,13 +45,13 @@ private:
ByteString maGroupName;
ImplConfigData* mpData;
ImplGroupData* mpActGroup;
- ULONG mnDataUpdateId;
- USHORT mnLockCount;
- BOOL mbPersistence;
- BOOL mbDummy1;
+ sal_uIntPtr mnDataUpdateId;
+ sal_uInt16 mnLockCount;
+ sal_Bool mbPersistence;
+ sal_Bool mbDummy1;
#ifdef _CONFIG_CXX
- TOOLS_DLLPRIVATE BOOL ImplUpdateConfig() const;
+ TOOLS_DLLPRIVATE sal_Bool ImplUpdateConfig() const;
TOOLS_DLLPRIVATE ImplGroupData* ImplGetGroup() const;
#endif
@@ -67,9 +67,9 @@ public:
void SetGroup( const ByteString& rGroup );
const ByteString& GetGroup() const { return maGroupName; }
void DeleteGroup( const ByteString& rGroup );
- ByteString GetGroupName( USHORT nGroup ) const;
- USHORT GetGroupCount() const;
- BOOL HasGroup( const ByteString& rGroup ) const;
+ ByteString GetGroupName( sal_uInt16 nGroup ) const;
+ sal_uInt16 GetGroupCount() const;
+ sal_Bool HasGroup( const ByteString& rGroup ) const;
ByteString ReadKey( const ByteString& rKey ) const;
UniString ReadKey( const ByteString& rKey, rtl_TextEncoding eEncoding ) const;
@@ -77,19 +77,19 @@ public:
void WriteKey( const ByteString& rKey, const ByteString& rValue );
void WriteKey( const ByteString& rKey, const UniString& rValue, rtl_TextEncoding eEncoding );
void DeleteKey( const ByteString& rKey );
- ByteString GetKeyName( USHORT nKey ) const;
- ByteString ReadKey( USHORT nKey ) const;
- USHORT GetKeyCount() const;
+ ByteString GetKeyName( sal_uInt16 nKey ) const;
+ ByteString ReadKey( sal_uInt16 nKey ) const;
+ sal_uInt16 GetKeyCount() const;
void EnterLock();
void LeaveLock();
- BOOL IsLocked() const { return (mnLockCount != 0); }
- BOOL Update();
+ sal_Bool IsLocked() const { return (mnLockCount != 0); }
+ sal_Bool Update();
void Flush();
- void EnablePersistence( BOOL bPersistence = TRUE )
+ void EnablePersistence( sal_Bool bPersistence = sal_True )
{ mbPersistence = bPersistence; }
- BOOL IsPersistenceEnabled() const { return mbPersistence; }
+ sal_Bool IsPersistenceEnabled() const { return mbPersistence; }
void SetLineEnd( LineEnd eLineEnd );
LineEnd GetLineEnd() const;
diff --git a/tools/inc/tools/contnr.hxx b/tools/inc/tools/contnr.hxx
index d619b8979bc1..ea70c1756f3a 100644
--- a/tools/inc/tools/contnr.hxx
+++ b/tools/inc/tools/contnr.hxx
@@ -40,7 +40,7 @@ class CBlock;
// -------------
// Maximale Blockgroesse
-#define CONTAINER_MAXBLOCKSIZE ((USHORT)0x3FF0)
+#define CONTAINER_MAXBLOCKSIZE ((sal_uInt16)0x3FF0)
#define CONTAINER_APPEND ULONG_MAX
#define CONTAINER_ENTRY_NOTFOUND ULONG_MAX
@@ -51,11 +51,11 @@ private:
CBlock* pFirstBlock;
CBlock* pCurBlock;
CBlock* pLastBlock;
- USHORT nCurIndex;
- USHORT nBlockSize;
- USHORT nInitSize;
- USHORT nReSize;
- ULONG nCount;
+ sal_uInt16 nCurIndex;
+ sal_uInt16 nBlockSize;
+ sal_uInt16 nInitSize;
+ sal_uInt16 nReSize;
+ sal_uIntPtr nCount;
TOOLS_DLLPRIVATE void ImpCopyContainer(Container const *);
#if defined DBG_UTIL
@@ -64,49 +64,49 @@ private:
protected:
#ifdef _IMPCONT_HXX
- void ImpInsert( void* p, CBlock* pBlock, USHORT nIndex );
- void* ImpRemove( CBlock* pBlock, USHORT nIndex );
- void* ImpGetObject( ULONG nIndex ) const;
+ void ImpInsert( void* p, CBlock* pBlock, sal_uInt16 nIndex );
+ void* ImpRemove( CBlock* pBlock, sal_uInt16 nIndex );
+ void* ImpGetObject( sal_uIntPtr nIndex ) const;
void** ImpGetOnlyNodes() const;
#endif
- void** GetObjectPtr( ULONG nIndex );
+ void** GetObjectPtr( sal_uIntPtr nIndex );
public:
- Container( USHORT nBlockSize,
- USHORT nInitSize,
- USHORT nReSize );
- Container( ULONG nSize );
+ Container( sal_uInt16 nBlockSize,
+ sal_uInt16 nInitSize,
+ sal_uInt16 nReSize );
+ Container( sal_uIntPtr nSize );
Container( const Container& rContainer );
~Container();
void Insert( void* p );
- void Insert( void* p, ULONG nIndex );
+ void Insert( void* p, sal_uIntPtr nIndex );
void Insert( void* pNew, void* pOld );
void* Remove();
- void* Remove( ULONG nIndex );
+ void* Remove( sal_uIntPtr nIndex );
void* Remove( void* p )
{ return Remove( GetPos( p ) ); }
void* Replace( void* p );
- void* Replace( void* p, ULONG nIndex );
+ void* Replace( void* p, sal_uIntPtr nIndex );
void* Replace( void* pNew, void* pOld )
{ return Replace( pNew, GetPos( pOld ) ); }
- void SetSize( ULONG nNewSize );
- ULONG GetSize() const { return nCount; }
+ void SetSize( sal_uIntPtr nNewSize );
+ sal_uIntPtr GetSize() const { return nCount; }
- ULONG Count() const { return nCount; }
+ sal_uIntPtr Count() const { return nCount; }
void Clear();
void* GetCurObject() const;
- ULONG GetCurPos() const;
- void* GetObject( ULONG nIndex ) const;
- ULONG GetPos( const void* p ) const;
- ULONG GetPos( const void* p, ULONG nStartIndex,
- BOOL bForward = TRUE ) const;
+ sal_uIntPtr GetCurPos() const;
+ void* GetObject( sal_uIntPtr nIndex ) const;
+ sal_uIntPtr GetPos( const void* p ) const;
+ sal_uIntPtr GetPos( const void* p, sal_uIntPtr nStartIndex,
+ sal_Bool bForward = sal_True ) const;
- void* Seek( ULONG nIndex );
+ void* Seek( sal_uIntPtr nIndex );
void* Seek( void* p ) { return Seek( GetPos( p ) ); }
void* First();
@@ -116,8 +116,8 @@ public:
Container& operator =( const Container& rContainer );
- BOOL operator ==( const Container& rContainer ) const;
- BOOL operator !=( const Container& rContainer ) const
+ sal_Bool operator ==( const Container& rContainer ) const;
+ sal_Bool operator !=( const Container& rContainer ) const
{ return !(Container::operator==( rContainer )); }
};
diff --git a/tools/inc/tools/date.hxx b/tools/inc/tools/date.hxx
index d87fa54b999f..183f6af43fbd 100644
--- a/tools/inc/tools/date.hxx
+++ b/tools/inc/tools/date.hxx
@@ -55,7 +55,7 @@ public:
Date( sal_uInt32 _nDate ) { Date::nDate = _nDate; }
Date( const Date& rDate )
{ nDate = rDate.nDate; }
- Date( USHORT nDay, USHORT nMonth, USHORT nYear )
+ Date( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
{ nDate = ( sal_uInt32( nDay % 100 ) ) +
( ( sal_uInt32( nMonth % 100 ) ) * 100 ) +
( ( sal_uInt32( nYear % 10000 ) ) * 10000); }
@@ -63,40 +63,40 @@ public:
void SetDate( sal_uInt32 nNewDate ) { nDate = nNewDate; }
sal_uInt32 GetDate() const { return nDate; }
- void SetDay( USHORT nNewDay );
- void SetMonth( USHORT nNewMonth );
- void SetYear( USHORT nNewYear );
- USHORT GetDay() const { return (USHORT)(nDate % 100); }
- USHORT GetMonth() const { return (USHORT)((nDate / 100) % 100); }
- USHORT GetYear() const { return (USHORT)(nDate / 10000); }
+ void SetDay( sal_uInt16 nNewDay );
+ void SetMonth( sal_uInt16 nNewMonth );
+ void SetYear( sal_uInt16 nNewYear );
+ sal_uInt16 GetDay() const { return (sal_uInt16)(nDate % 100); }
+ sal_uInt16 GetMonth() const { return (sal_uInt16)((nDate / 100) % 100); }
+ sal_uInt16 GetYear() const { return (sal_uInt16)(nDate / 10000); }
DayOfWeek GetDayOfWeek() const;
- USHORT GetDayOfYear() const;
+ sal_uInt16 GetDayOfYear() const;
/** nMinimumNumberOfDaysInWeek: how many days of a week must reside in the
first week of a year. */
- USHORT GetWeekOfYear( DayOfWeek eStartDay = MONDAY,
+ sal_uInt16 GetWeekOfYear( DayOfWeek eStartDay = MONDAY,
sal_Int16 nMinimumNumberOfDaysInWeek = 4 ) const;
- USHORT GetDaysInMonth() const;
- USHORT GetDaysInYear() const { return (IsLeapYear()) ? 366 : 365; }
- BOOL IsLeapYear() const;
- BOOL IsValid() const;
+ sal_uInt16 GetDaysInMonth() const;
+ sal_uInt16 GetDaysInYear() const { return (IsLeapYear()) ? 366 : 365; }
+ sal_Bool IsLeapYear() const;
+ sal_Bool IsValid() const;
- BOOL IsBetween( const Date& rFrom, const Date& rTo ) const
+ sal_Bool IsBetween( const Date& rFrom, const Date& rTo ) const
{ return ((nDate >= rFrom.nDate) &&
(nDate <= rTo.nDate)); }
- BOOL operator ==( const Date& rDate ) const
+ sal_Bool operator ==( const Date& rDate ) const
{ return (nDate == rDate.nDate); }
- BOOL operator !=( const Date& rDate ) const
+ sal_Bool operator !=( const Date& rDate ) const
{ return (nDate != rDate.nDate); }
- BOOL operator >( const Date& rDate ) const
+ sal_Bool operator >( const Date& rDate ) const
{ return (nDate > rDate.nDate); }
- BOOL operator <( const Date& rDate ) const
+ sal_Bool operator <( const Date& rDate ) const
{ return (nDate < rDate.nDate); }
- BOOL operator >=( const Date& rDate ) const
+ sal_Bool operator >=( const Date& rDate ) const
{ return (nDate >= rDate.nDate); }
- BOOL operator <=( const Date& rDate ) const
+ sal_Bool operator <=( const Date& rDate ) const
{ return (nDate <= rDate.nDate); }
Date& operator =( const Date& rDate )
@@ -114,7 +114,7 @@ public:
TOOLS_DLLPUBLIC friend Date operator -( const Date& rDate, long nDays );
TOOLS_DLLPUBLIC friend long operator -( const Date& rDate1, const Date& rDate2 );
- static long DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear );
+ static long DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear );
};
diff --git a/tools/inc/tools/datetime.hxx b/tools/inc/tools/datetime.hxx
index 280b5d81cef7..d12a276d0f03 100644
--- a/tools/inc/tools/datetime.hxx
+++ b/tools/inc/tools/datetime.hxx
@@ -48,29 +48,29 @@ public:
DateTime( const Date& rDate, const Time& rTime ) :
Date( rDate ), Time( rTime ) {}
- BOOL IsBetween( const DateTime& rFrom,
+ sal_Bool IsBetween( const DateTime& rFrom,
const DateTime& rTo ) const;
- BOOL IsEqualIgnore100Sec( const DateTime& rDateTime ) const
+ sal_Bool IsEqualIgnore100Sec( const DateTime& rDateTime ) const
{
if ( Date::operator!=( rDateTime ) )
- return FALSE;
+ return sal_False;
return Time::IsEqualIgnore100Sec( rDateTime );
}
- BOOL operator ==( const DateTime& rDateTime ) const
+ sal_Bool operator ==( const DateTime& rDateTime ) const
{ return (Date::operator==( rDateTime ) &&
Time::operator==( rDateTime )); }
- BOOL operator !=( const DateTime& rDateTime ) const
+ sal_Bool operator !=( const DateTime& rDateTime ) const
{ return (Date::operator!=( rDateTime ) ||
Time::operator!=( rDateTime )); }
- BOOL operator >( const DateTime& rDateTime ) const;
- BOOL operator <( const DateTime& rDateTime ) const;
- BOOL operator >=( const DateTime& rDateTime ) const;
- BOOL operator <=( const DateTime& rDateTime ) const;
+ sal_Bool operator >( const DateTime& rDateTime ) const;
+ sal_Bool operator <( const DateTime& rDateTime ) const;
+ sal_Bool operator >=( const DateTime& rDateTime ) const;
+ sal_Bool operator <=( const DateTime& rDateTime ) const;
long GetSecFromDateTime( const Date& rDate ) const;
- void MakeDateTimeFromSec( const Date& rDate, ULONG nSec );
+ void MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec );
void ConvertToUTC() { *this -= Time::GetUTCOffset(); }
void ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx
index 7501937e12b1..6626a984abec 100644
--- a/tools/inc/tools/debug.hxx
+++ b/tools/inc/tools/debug.hxx
@@ -92,15 +92,15 @@ typedef void (*DbgTestSolarMutexProc)();
struct DbgData
{
- ULONG nTestFlags;
- ULONG bOverwrite;
- ULONG nTraceOut;
- ULONG nWarningOut;
- ULONG nErrorOut;
- ULONG bHookOSLAssert;
- BYTE bMemInit;
- BYTE bMemBound;
- BYTE bMemFree;
+ sal_uIntPtr nTestFlags;
+ sal_uIntPtr bOverwrite;
+ sal_uIntPtr nTraceOut;
+ sal_uIntPtr nWarningOut;
+ sal_uIntPtr nErrorOut;
+ sal_uIntPtr bHookOSLAssert;
+ sal_uInt8 bMemInit;
+ sal_uInt8 bMemBound;
+ sal_uInt8 bMemFree;
sal_Char aDebugName[260];
sal_Char aInclFilter[512];
sal_Char aExclFilter[512];
@@ -137,7 +137,7 @@ struct DbgDataType
#define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967
#define DBG_FUNC_UPDATEOSLHOOK 19
-TOOLS_DLLPUBLIC void* DbgFunc( USHORT nAction, void* pData = NULL );
+TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL );
inline void DbgUpdateOslHook( DbgData* pData )
{
@@ -179,7 +179,7 @@ inline void DbgSetPrintTestTool( DbgPrintLine pProc )
DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc );
}
-typedef USHORT DbgChannelId;
+typedef sal_uInt16 DbgChannelId;
/** registers a user-defined channel for emitting the diagnostic messages
Note that such a user-defined channel cannot be revoked during the lifetime
@@ -198,9 +198,9 @@ typedef USHORT DbgChannelId;
*/
TOOLS_DLLPUBLIC DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc );
-inline BOOL DbgFilterMessage( const char* pMsg )
+inline sal_Bool DbgFilterMessage( const char* pMsg )
{
- return (BOOL)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
+ return (sal_Bool)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
}
inline int DbgIsAllErrorOut()
@@ -218,34 +218,34 @@ inline void DbgSaveData( const DbgData& rData )
DbgFunc( DBG_FUNC_SAVEDATA, (void*)&rData );
}
-inline ULONG DbgIsTraceOut()
+inline sal_uIntPtr DbgIsTraceOut()
{
DbgData* pData = DbgGetData();
if ( pData )
return (pData->nTraceOut != DBG_OUT_NULL);
else
- return FALSE;
+ return sal_False;
}
-inline ULONG DbgIsWarningOut()
+inline sal_uIntPtr DbgIsWarningOut()
{
DbgData* pData = DbgGetData();
if ( pData )
return (pData->nWarningOut != DBG_OUT_NULL);
else
- return FALSE;
+ return sal_False;
}
-inline ULONG DbgIsErrorOut()
+inline sal_uIntPtr DbgIsErrorOut()
{
DbgData* pData = DbgGetData();
if ( pData )
return (pData->nErrorOut != DBG_OUT_NULL);
else
- return FALSE;
+ return sal_False;
}
-inline ULONG DbgGetErrorOut() // Testtool: test wether to collect OSL_ASSERTions as well
+inline sal_uIntPtr DbgGetErrorOut() // Testtool: test wether to collect OSL_ASSERTions as well
{
DbgData* pData = DbgGetData();
if ( pData )
@@ -254,41 +254,41 @@ inline ULONG DbgGetErrorOut() // Testtool: test wether to collect OSL_ASSERTio
return DBG_OUT_NULL;
}
-inline ULONG DbgIsAssertWarning()
+inline sal_uIntPtr DbgIsAssertWarning()
{
return DbgIsWarningOut();
}
-inline ULONG DbgIsAssert()
+inline sal_uIntPtr DbgIsAssert()
{
return DbgIsErrorOut();
}
-inline ULONG DbgIsResource()
+inline sal_uIntPtr DbgIsResource()
{
DbgData* pData = DbgGetData();
if ( pData )
return pData->nTestFlags & DBG_TEST_RESOURCE;
else
- return FALSE;
+ return sal_False;
}
-inline ULONG DbgIsDialog()
+inline sal_uIntPtr DbgIsDialog()
{
DbgData* pData = DbgGetData();
if ( pData )
return pData->nTestFlags & DBG_TEST_DIALOG;
else
- return FALSE;
+ return sal_False;
}
-inline ULONG DbgIsBoldAppFont()
+inline sal_uIntPtr DbgIsBoldAppFont()
{
DbgData* pData = DbgGetData();
if ( pData )
return pData->nTestFlags & DBG_TEST_BOLDAPPFONT;
else
- return FALSE;
+ return sal_False;
}
inline void DbgXtorInfo( sal_Char* pBuf )
@@ -325,8 +325,8 @@ inline void DbgPrintFile( const sal_Char* pLine )
TOOLS_DLLPUBLIC void DbgStartStackTree();
TOOLS_DLLPUBLIC void DbgEndStackTree();
-void* DbgGetStackTree( ULONG nAlloc = 0 );
-void DbgFreeStackTree( void* p, ULONG nAlloc = 0 );
+void* DbgGetStackTree( sal_uIntPtr nAlloc = 0 );
+void DbgFreeStackTree( void* p, sal_uIntPtr nAlloc = 0 );
void DbgPrintStackTree( void* p );
// --- Dbg-Output ---
@@ -335,27 +335,27 @@ void DbgPrintStackTree( void* p );
#define DBG_OUT_WARNING 2
#define DBG_OUT_ERROR 3
-TOOLS_DLLPUBLIC void DbgOut( const sal_Char* pMsg, USHORT nOutType = DBG_OUT_TRACE,
- const sal_Char* pFile = NULL, USHORT nLine = 0 );
+TOOLS_DLLPUBLIC void DbgOut( const sal_Char* pMsg, sal_uInt16 nOutType = DBG_OUT_TRACE,
+ const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 );
TOOLS_DLLPUBLIC void DbgPrintShell(char const * message);
-TOOLS_DLLPUBLIC void DbgOutTypef( USHORT nOutType, const sal_Char* pFStr, ... );
+TOOLS_DLLPUBLIC void DbgOutTypef( sal_uInt16 nOutType, const sal_Char* pFStr, ... );
TOOLS_DLLPUBLIC void DbgOutf( const sal_Char* pFStr, ... );
TOOLS_DLLPUBLIC void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... );
inline void DbgTrace( const sal_Char* pMsg,
- const sal_Char* pFile = NULL, USHORT nLine = 0 )
+ const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 )
{
DbgOut( pMsg, DBG_OUT_TRACE, pFile, nLine );
}
inline void DbgWarning( const sal_Char* pMsg,
- const sal_Char* pFile = NULL, USHORT nLine = 0 )
+ const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 )
{
DbgOut( pMsg, DBG_OUT_WARNING, pFile, nLine );
}
inline void DbgError( const sal_Char* pMsg,
- const sal_Char* pFile = NULL, USHORT nLine = 0 )
+ const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 )
{
DbgOut( pMsg, DBG_OUT_ERROR, pFile, nLine );
}
@@ -372,7 +372,7 @@ inline void DbgMemTest( void* p = NULL )
#define DBG_PROF_CONTINUE 3
#define DBG_PROF_PAUSE 4
-TOOLS_DLLPUBLIC void DbgProf( USHORT nAction, DbgDataType* );
+TOOLS_DLLPUBLIC void DbgProf( sal_uInt16 nAction, DbgDataType* );
#define DBG_XTOR_CTOR 1
#define DBG_XTOR_DTOR 2
@@ -381,7 +381,7 @@ TOOLS_DLLPUBLIC void DbgProf( USHORT nAction, DbgDataType* );
#define DBG_XTOR_DTOROBJ 0x8000
TOOLS_DLLPUBLIC void DbgXtor( DbgDataType* pDbgData,
- USHORT nAction, const void* pThis, DbgUsr fDbgUsr );
+ sal_uInt16 nAction, const void* pThis, DbgUsr fDbgUsr );
class DbgXtorObj
{
@@ -389,11 +389,11 @@ private:
DbgDataType* pDbgData;
const void* pThis;
DbgUsr fDbgUsr;
- USHORT nAction;
+ sal_uInt16 nAction;
public:
DbgXtorObj( DbgDataType* pData,
- USHORT nAct, const void* pThs, DbgUsr fUsr )
+ sal_uInt16 nAct, const void* pThs, DbgUsr fUsr )
{
DbgXtor( pData, nAct, pThs, fUsr );
pDbgData = pData;
diff --git a/tools/inc/tools/download.hxx b/tools/inc/tools/download.hxx
deleted file mode 100644
index 7f4363631ebf..000000000000
--- a/tools/inc/tools/download.hxx
+++ /dev/null
@@ -1,59 +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 _DOWNLOAD_HXX
-#define _DOWNLOAD_HXX
-
-// Forward declarations
-class String;
-class Link;
-
-#define DOWNLOAD_SUCCESS 0
-#define DOWNLOAD_CONNECT 1
-#define DOWNLOAD_LOCATION 2
-#define DOWNLOAD_ABORT 3
-#define DOWNLOAD_FILEACCESS 4
-#define DOWNLOAD_INSTALL 5
-#define DOWNLOAD_ERROR 6
-
-class Downloader
-/* ***************************************************************************
-Purpose: Abstract base class for a file downloader
-*************************************************************************** */
-{
-public:
- Downloader() {};
-
- virtual void Download(const String &rDestLocation,
- const String &rSourceLocation,
- const Link &rFinishedLink) = 0;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/dynary.hxx b/tools/inc/tools/dynary.hxx
index abbd7d93d2ff..fb2fcce0d17b 100644
--- a/tools/inc/tools/dynary.hxx
+++ b/tools/inc/tools/dynary.hxx
@@ -45,26 +45,26 @@ public:
using Container::GetSize;
using Container::Clear;
- DynArray( ULONG nSize = 16 ) : Container( nSize ) {}
+ DynArray( sal_uIntPtr nSize = 16 ) : Container( nSize ) {}
DynArray( const DynArray& rAry ) : Container( rAry ) {}
- void* Put( ULONG nIndex, void* p )
+ void* Put( sal_uIntPtr nIndex, void* p )
{ return Container::Replace( p, nIndex ); }
- void* Get( ULONG nIndex ) const
+ void* Get( sal_uIntPtr nIndex ) const
{ return Container::GetObject( nIndex ); }
- ULONG GetIndex( const void* p ) const
+ sal_uIntPtr GetIndex( const void* p ) const
{ return Container::GetPos( p ); }
- ULONG GetIndex( const void* p, ULONG nStartIndex,
- BOOL bForward = TRUE ) const
+ sal_uIntPtr GetIndex( const void* p, sal_uIntPtr nStartIndex,
+ sal_Bool bForward = sal_True ) const
{ return Container::GetPos( p, nStartIndex, bForward ); }
DynArray& operator =( const DynArray& rAry )
{ Container::operator =( rAry ); return *this; }
- BOOL operator ==( const DynArray& rAry ) const
+ sal_Bool operator ==( const DynArray& rAry ) const
{ return Container::operator ==( rAry ); }
- BOOL operator !=( const DynArray& rAry ) const
+ sal_Bool operator !=( const DynArray& rAry ) const
{ return Container::operator !=( rAry ); }
};
@@ -80,20 +80,20 @@ public: \
using DynArray::GetSize; \
using DynArray::Clear; \
\
- ClassName( ULONG nSize = 16 ) : \
+ ClassName( sal_uIntPtr nSize = 16 ) : \
DynArray( nSize ) {} \
ClassName( const ClassName& rClassName ) : \
DynArray( rClassName ) {} \
\
- Type Put( ULONG nIndex, Type p ) \
+ Type Put( sal_uIntPtr nIndex, Type p ) \
{ return (Type)DynArray::Put( nIndex, (void*)p ); } \
- Type Get( ULONG nIndex ) const \
+ Type Get( sal_uIntPtr nIndex ) const \
{ return (Type)DynArray::Get( nIndex ); } \
\
- ULONG GetIndex( const Type p ) const \
+ sal_uIntPtr GetIndex( const Type p ) const \
{ return DynArray::GetIndex( (const void*)p ); } \
- ULONG GetIndex( const Type p, ULONG nStartIndex, \
- BOOL bForward = TRUE ) const \
+ sal_uIntPtr GetIndex( const Type p, sal_uIntPtr nStartIndex, \
+ sal_Bool bForward = sal_True ) const \
{ return DynArray::GetIndex( (const void*)p, \
nStartIndex, \
bForward ); } \
@@ -102,9 +102,9 @@ public: \
{ DynArray::operator =( rClassName ); \
return *this; } \
\
- BOOL operator ==( const ClassName& rAry ) const \
+ sal_Bool operator ==( const ClassName& rAry ) const \
{ return DynArray::operator ==( rAry ); } \
- BOOL operator !=( const ClassName& rAry ) const \
+ sal_Bool operator !=( const ClassName& rAry ) const \
{ return DynArray::operator !=( rAry ); } \
};
diff --git a/tools/inc/tools/eacopier.hxx b/tools/inc/tools/eacopier.hxx
deleted file mode 100644
index 8009cd38209c..000000000000
--- a/tools/inc/tools/eacopier.hxx
+++ /dev/null
@@ -1,49 +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 _EACOPIER_HXX
-#define _EACOPIER_HXX
-
-#include <tools/solar.h>
-
-class SvFileStream;
-
-class EA_Copier
-{
- static EA_Copier* _pCopier;
-
-public:
- static void Register( EA_Copier* pCopier );
- static EA_Copier* Get();
-
- virtual ~EA_Copier();
- virtual BOOL Copy( const SvFileStream& rFrom, const SvFileStream& rTo ) const = 0;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/errcode.hxx b/tools/inc/tools/errcode.hxx
index 35e75ca33072..f2cdf4f5e533 100644
--- a/tools/inc/tools/errcode.hxx
+++ b/tools/inc/tools/errcode.hxx
@@ -94,14 +94,14 @@ Warning || || |
#else
-typedef ULONG ErrCode;
+typedef sal_uIntPtr ErrCode;
-inline ULONG ERRCODE_TOERRID( ULONG x )
+inline sal_uIntPtr ERRCODE_TOERRID( sal_uIntPtr x )
{
return x & ~ERRCODE_DYNAMIC_MASK;
}
-inline ULONG ERRCODE_TOERROR( ULONG x )
+inline sal_uIntPtr ERRCODE_TOERROR( sal_uIntPtr x )
{
return ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK));
}
diff --git a/tools/inc/tools/errinf.hxx b/tools/inc/tools/errinf.hxx
index 4d4779bac509..ae407e345885 100644
--- a/tools/inc/tools/errinf.hxx
+++ b/tools/inc/tools/errinf.hxx
@@ -48,18 +48,18 @@ class Window;
class ErrorInfo
{
private:
- ULONG lUserId;
+ sal_uIntPtr lUserId;
public:
TYPEINFO();
- ErrorInfo( ULONG lArgUserId ) :
+ ErrorInfo( sal_uIntPtr lArgUserId ) :
lUserId( lArgUserId ){}
virtual ~ErrorInfo(){}
- ULONG GetErrorCode() const { return lUserId; }
+ sal_uIntPtr GetErrorCode() const { return lUserId; }
- static ErrorInfo* GetErrorInfo(ULONG);
+ static ErrorInfo* GetErrorInfo(sal_uIntPtr);
};
@@ -77,11 +77,11 @@ private:
public:
TYPEINFO();
- DynamicErrorInfo(ULONG lUserId, USHORT nMask);
+ DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
virtual ~DynamicErrorInfo();
- operator ULONG() const;
- USHORT GetDialogMask() const;
+ operator sal_uIntPtr() const;
+ sal_uInt16 GetDialogMask() const;
};
@@ -92,14 +92,14 @@ public:
class StandardErrorInfo : public DynamicErrorInfo
{
private:
- ULONG lExtId;
+ sal_uIntPtr lExtId;
public:
TYPEINFO();
- StandardErrorInfo( ULONG lUserId, ULONG lExtId,
- USHORT nFlags = 0);
- ULONG GetExtendedErrorCode() const { return lExtId; }
+ StandardErrorInfo( sal_uIntPtr lUserId, sal_uIntPtr lExtId,
+ sal_uInt16 nFlags = 0);
+ sal_uIntPtr GetExtendedErrorCode() const { return lExtId; }
};
@@ -116,9 +116,9 @@ private:
public:
TYPEINFO();
- StringErrorInfo( ULONG lUserId,
+ StringErrorInfo( sal_uIntPtr lUserId,
const String& aStringP,
- USHORT nFlags = 0);
+ sal_uInt16 nFlags = 0);
const String& GetErrorString() const { return aString; }
};
@@ -132,8 +132,8 @@ private:
public:
TYPEINFO();
- TwoStringErrorInfo(ULONG nUserID, const String & rTheArg1,
- const String & rTheArg2, USHORT nFlags = 0):
+ TwoStringErrorInfo(sal_uIntPtr nUserID, const String & rTheArg1,
+ const String & rTheArg2, sal_uInt16 nFlags = 0):
DynamicErrorInfo(nUserID, nFlags), aArg1(rTheArg1), aArg2(rTheArg2) {}
virtual ~TwoStringErrorInfo() {}
@@ -150,10 +150,10 @@ class TOOLS_DLLPUBLIC MessageInfo : public DynamicErrorInfo
public:
TYPEINFO();
- MessageInfo(ULONG UserId, USHORT nFlags = 0) :
+ MessageInfo(sal_uIntPtr UserId, sal_uInt16 nFlags = 0) :
DynamicErrorInfo(UserId, nFlags){}
- MessageInfo(ULONG UserId, const String &rArg,
- USHORT nFlags = 0 ) :
+ MessageInfo(sal_uIntPtr UserId, const String &rArg,
+ sal_uInt16 nFlags = 0 ) :
DynamicErrorInfo(UserId, nFlags), aArg(rArg) {}
const String& GetMessageArg() const { return aArg; }
@@ -179,7 +179,7 @@ public:
ErrorContext(Window *pWin=0);
virtual ~ErrorContext();
- virtual BOOL GetString( ULONG nErrId, String& rCtxStr ) = 0;
+ virtual sal_Bool GetString( sal_uIntPtr nErrId, String& rCtxStr ) = 0;
Window* GetParent() { return pWin; }
static ErrorContext* GetContext();
@@ -190,8 +190,8 @@ public:
// - ErrorHandler -
// ----------------
-typedef USHORT WindowDisplayErrorFunc(
- Window *, USHORT nMask, const String &rErr, const String &rAction);
+typedef sal_uInt16 WindowDisplayErrorFunc(
+ Window *, sal_uInt16 nMask, const String &rErr, const String &rAction);
typedef void BasicDisplayErrorFunc(
const String &rErr, const String &rAction);
@@ -203,22 +203,22 @@ class TOOLS_DLLPUBLIC ErrorHandler
private:
ErrHdl_Impl* pImpl;
- static USHORT HandleError_Impl( ULONG lId,
- USHORT nFlags,
- BOOL bJustCreateString,
+ static sal_uInt16 HandleError_Impl( sal_uIntPtr lId,
+ sal_uInt16 nFlags,
+ sal_Bool bJustCreateString,
String & rError);
protected:
- virtual BOOL CreateString( const ErrorInfo *,
- String &, USHORT& nMask ) const = 0;
- BOOL ForwCreateString( const ErrorInfo*,
- String&, USHORT& nMask ) const;
+ virtual sal_Bool CreateString( const ErrorInfo *,
+ String &, sal_uInt16& nMask ) const = 0;
+ sal_Bool ForwCreateString( const ErrorInfo*,
+ String&, sal_uInt16& nMask ) const;
public:
ErrorHandler();
virtual ~ErrorHandler();
- static USHORT HandleError ( ULONG lId, USHORT nMask = USHRT_MAX );
- static BOOL GetErrorString( ULONG lId, String& rStr );
+ static sal_uInt16 HandleError ( sal_uIntPtr lId, sal_uInt16 nMask = USHRT_MAX );
+ static sal_Bool GetErrorString( sal_uIntPtr lId, String& rStr );
static void RegisterDisplay( BasicDisplayErrorFunc* );
static void RegisterDisplay( WindowDisplayErrorFunc* );
@@ -232,8 +232,8 @@ public:
class TOOLS_DLLPUBLIC SimpleErrorHandler : private ErrorHandler
{
protected:
- virtual BOOL CreateString( const ErrorInfo*, String &,
- USHORT &nMask ) const;
+ virtual sal_Bool CreateString( const ErrorInfo*, String &,
+ sal_uInt16 &nMask ) const;
public:
SimpleErrorHandler();
diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx
index 60e662e9c7a5..d98cb69185a0 100644
--- a/tools/inc/tools/fldunit.hxx
+++ b/tools/inc/tools/fldunit.hxx
@@ -33,7 +33,6 @@
// - FieldTypes -
// --------------
-// By changes you must also change: rsc/vclrsc.hxx
enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
diff --git a/tools/inc/tools/fontenum.hxx b/tools/inc/tools/fontenum.hxx
index d514f2b1c23c..849bb2720e5c 100644
--- a/tools/inc/tools/fontenum.hxx
+++ b/tools/inc/tools/fontenum.hxx
@@ -128,7 +128,7 @@ enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
#ifndef ENUM_FONTEMPHASISMARK_DECLARED
#define ENUM_FONTEMPHASISMARK_DECLARED
-typedef USHORT FontEmphasisMark;
+typedef sal_uInt16 FontEmphasisMark;
#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 0142de053602..b0854f58daa5 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -148,7 +148,7 @@ typedef int FSysAction;
#define RFS_LOWER "-rfs-"
#define RFS_UPPER "-RFS-"
-typedef ULONG FSysError;
+typedef sal_uIntPtr FSysError;
// FSysExact
enum FSysExact
@@ -161,21 +161,10 @@ enum FSysExact
// - Char-Set -
// ------------
-#if defined(WIN) || defined(W30)
-
-// MS-Windows has different char-sets for file-system and user-interface
-String Gui2FSys( const String& rStr );
-String FSys2Gui( const String& rStr );
-#define GUI2FSYS(s) Gui2FSys( s )
-#define FSYS2GUI(s) FSys2Gui( s )
-
-#else
-
-// all other OS have the same char-set for both
+// Was different for WIN, no longer needed...
#define GUI2FSYS(s) s
#define FSYS2GUI(s) s
-#endif
// ------------
// - FileStat -
@@ -189,9 +178,9 @@ class TOOLS_DLLPUBLIC FileStat
friend struct DirReader_Impl;
friend void ImpInitFileStat( FileStat&, dirent* );
- ULONG nError;
+ sal_uIntPtr nError;
DirEntryKind nKindFlags;
- ULONG nSize;
+ sal_uIntPtr nSize;
String aCreator;
String aType;
Date aDateCreated;
@@ -212,16 +201,16 @@ public:
FileStat();
FileStat( const DirEntry& rDirEntry,
FSysAccess nAccess = FSYS_ACCESS_FLOPPY );
- BOOL Update( const DirEntry& rDirEntry,
- BOOL bForceAccess = TRUE );
+ sal_Bool Update( const DirEntry& rDirEntry,
+ sal_Bool bForceAccess = sal_True );
- ULONG GetError() const { return ERRCODE_TOERROR(nError); }
- ULONG GetErrorCode() const { return nError; }
+ sal_uIntPtr GetError() const { return ERRCODE_TOERROR(nError); }
+ sal_uIntPtr GetErrorCode() const { return nError; }
- ULONG GetSize() const { return nSize; }
+ sal_uIntPtr GetSize() const { return nSize; }
DirEntryKind GetKind() const { return nKindFlags; }
- BOOL IsKind( DirEntryKind nKind ) const;
+ sal_Bool IsKind( DirEntryKind nKind ) const;
String GetType() const { return aType; }
String GetCreator() const { return aCreator; }
@@ -232,12 +221,12 @@ public:
Time TimeModified() const { return aTimeModified; }
Date DateAccessed() const { return aDateAccessed; }
Time TimeAccessed() const { return aTimeAccessed; }
- BOOL IsYounger( const FileStat& rIsOlder ) const;
+ sal_Bool IsYounger( const FileStat& rIsOlder ) const;
#define TF_FSYS_READONLY_FLAG
- static ULONG SetReadOnlyFlag( const DirEntry &rEntry, BOOL bRO = TRUE );
- static BOOL GetReadOnlyFlag( const DirEntry &rEntry );
- static BOOL HasReadOnlyFlag();
+ static sal_uIntPtr SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO = sal_True );
+ static sal_Bool GetReadOnlyFlag( const DirEntry &rEntry );
+ static sal_Bool HasReadOnlyFlag();
static ErrCode QueryDiskSpace( const String &rPath,
BigInt &rFreeBytes, BigInt &rTotalBytes );
@@ -264,7 +253,7 @@ friend class FileCopier;
#endif
ByteString aName;
DirEntry* pParent;
- ULONG nError;
+ sal_uIntPtr nError;
DirEntryFlag eFlag;
private:
@@ -284,13 +273,13 @@ private:
FSysPathStyle eStyle );
TOOLS_DLLPRIVATE const DirEntry* ImpGetTopPtr() const;
TOOLS_DLLPRIVATE DirEntry* ImpGetTopPtr();
- TOOLS_DLLPRIVATE BOOL ImpToRel( String aStart );
+ TOOLS_DLLPRIVATE sal_Bool ImpToRel( String aStart );
protected:
void ImpTrim( FSysPathStyle eStyle );
const ByteString& ImpTheName() const;
DirEntryFlag ImpTheFlag() const { return eFlag; };
- DirEntry* ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize = TRUE );
+ DirEntry* ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize = sal_True );
DirEntry* ImpGetParent() { return pParent; }
#ifdef FEAT_FSYS_DOUBLESPEED
FileStat* ImpGetStat() const { return pStat; }
@@ -298,7 +287,7 @@ protected:
#endif
protected:
- void SetError( ULONG nErr ) { nError = nErr; }
+ void SetError( sal_uIntPtr nErr ) { nError = nErr; }
DirEntry* GetParent() { return pParent; }
public:
DirEntry( DirEntryFlag aDirFlag = FSYS_FLAG_CURRENT );
@@ -309,11 +298,11 @@ public:
FSysPathStyle eParser = FSYS_STYLE_HOST );
~DirEntry();
- BOOL IsLongNameOnFAT() const;
- BOOL IsCaseSensitive (FSysPathStyle eFormatter = FSYS_STYLE_HOST) const;
+ sal_Bool IsLongNameOnFAT() const;
+ sal_Bool IsCaseSensitive (FSysPathStyle eFormatter = FSYS_STYLE_HOST) const;
- ULONG GetError() const { return nError; }
- BOOL IsValid() const;
+ sal_uIntPtr GetError() const { return nError; }
+ sal_Bool IsValid() const;
DirEntryFlag GetFlag() const { return eFlag; };
void SetExtension( const String& rExt, char cSep = '.' );
@@ -329,31 +318,31 @@ public:
DirEntry GetDevice() const;
String GetVolume() const;
String GetFull( FSysPathStyle eFormatter = FSYS_STYLE_HOST,
- BOOL bWithDelimiter = FALSE,
- USHORT nMaxChars = STRING_MAXLEN ) const;
+ sal_Bool bWithDelimiter = sal_False,
+ sal_uInt16 nMaxChars = STRING_MAXLEN ) const;
DirEntry TempName( DirEntryKind = FSYS_KIND_NONE ) const;
static const DirEntry& SetTempNameBase( const String &rBaseName );
- BOOL MakeShortName( const String& rLongName,
+ sal_Bool MakeShortName( const String& rLongName,
DirEntryKind eCreateKind = FSYS_KIND_NONE,
- BOOL bUseTilde = TRUE,
+ sal_Bool bUseTilde = sal_True,
FSysPathStyle eStyle = FSYS_STYLE_DETECT );
bool IsAbs() const;
- BOOL ToAbs();
- BOOL Find( const String& rPfad, char cDelim = 0 );
- BOOL ToRel();
- BOOL ToRel( const DirEntry& rRefDir );
- USHORT CutRelParents();
+ sal_Bool ToAbs();
+ sal_Bool Find( const String& rPfad, char cDelim = 0 );
+ sal_Bool ToRel();
+ sal_Bool ToRel( const DirEntry& rRefDir );
+ sal_uInt16 CutRelParents();
- BOOL SetCWD( BOOL bSloppy = FALSE ) const;
- BOOL MakeDir( BOOL bSloppy = FALSE ) const;
- BOOL Exists( FSysAccess nAccess = FSYS_ACCESS_FLOPPY ) const;
- BOOL First();
+ sal_Bool SetCWD( sal_Bool bSloppy = sal_False ) const;
+ sal_Bool MakeDir( sal_Bool bSloppy = sal_False ) const;
+ sal_Bool Exists( FSysAccess nAccess = FSYS_ACCESS_FLOPPY ) const;
+ sal_Bool First();
- USHORT Level() const;
- const DirEntry& operator []( USHORT nParentLevel ) const;
- BOOL Contains( const DirEntry &rSubEntry ) const;
+ sal_uInt16 Level() const;
+ const DirEntry& operator []( sal_uInt16 nParentLevel ) const;
+ sal_Bool Contains( const DirEntry &rSubEntry ) const;
FSysError CopyTo( const DirEntry& rDestDir,
FSysAction nActions = FSYS_ACTION_STANDARD ) const;
@@ -363,8 +352,8 @@ public:
DirEntry& operator =( const DirEntry& rOrigDir );
DirEntry operator +( const DirEntry& rSubDir ) const;
DirEntry& operator +=( const DirEntry& rSubDir );
- BOOL operator ==( const DirEntry& rAnotherDir ) const;
- BOOL operator !=( const DirEntry& rAnotherDir ) const
+ sal_Bool operator ==( const DirEntry& rAnotherDir ) const;
+ sal_Bool operator !=( const DirEntry& rAnotherDir ) const
{ return !(DirEntry::operator==( rAnotherDir )); }
StringCompare NameCompare( const DirEntry &rWith ) const;
@@ -379,11 +368,11 @@ public:
static String GetAccessDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
static String GetSearchDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
- static USHORT GetMaxNameLen( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
+ static sal_uInt16 GetMaxNameLen( FSysPathStyle eFormatter = FSYS_STYLE_HOST );
static FSysPathStyle GetPathStyle( const String &rDevice );
static String ConvertNameToSystem( const String & rName );
static String ConvertSystemToName( const String & rName );
- static BOOL IsRFSAvailable();
+ static sal_Bool IsRFSAvailable();
};
// --------------
@@ -394,10 +383,10 @@ class TOOLS_DLLPUBLIC FileCopier
{
DirEntry aSource;
DirEntry aTarget;
- ULONG nBytesTotal;
- ULONG nBytesCopied;
+ sal_uIntPtr nBytesTotal;
+ sal_uIntPtr nBytesCopied;
Link aProgressLink;
- USHORT nBlockSize;
+ sal_uInt16 nBlockSize;
FileCopier_Impl* pImp;
private:
@@ -405,7 +394,7 @@ private:
const DirEntry &rSource, const DirEntry &rTarget );
protected:
- virtual BOOL Progress();
+ virtual sal_Bool Progress();
virtual ErrCode Error( ErrCode eErr,
const DirEntry *pSource, const DirEntry *pTarget );
@@ -418,11 +407,11 @@ public:
FileCopier& operator = ( const FileCopier &rCopier );
- void SetBlockSize( USHORT nBytes ) { nBlockSize = nBytes; }
- USHORT GetBlockSize() const { return nBlockSize; }
+ void SetBlockSize( sal_uInt16 nBytes ) { nBlockSize = nBytes; }
+ sal_uInt16 GetBlockSize() const { return nBlockSize; }
- ULONG GetBytesTotal() const { return nBytesTotal; }
- ULONG GetBytesCopied() const { return nBytesCopied; }
+ sal_uIntPtr GetBytesTotal() const { return nBytesTotal; }
+ sal_uIntPtr GetBytesCopied() const { return nBytesCopied; }
void SetSource( const DirEntry &rSource ) { aSource = rSource; }
void SetTarget( const DirEntry &rTarget ) { aTarget = rTarget; }
@@ -471,7 +460,7 @@ private:
#ifndef _TOOLS_HXX
protected:
- BOOL ImpInsertPointReached( const DirEntry& rIsSmaller,
+ sal_Bool ImpInsertPointReached( const DirEntry& rIsSmaller,
const FileStat& rNewStat,
size_t nCurPos,
size_t nSortIndex ) const;
@@ -493,9 +482,9 @@ public:
FSysError SetSort( FSysSort nSort, ... );
void Reset();
- USHORT Scan( USHORT nCount = 5 );
- size_t Count( BOOL bUpdated = TRUE ) const;
- BOOL Update();
+ sal_uInt16 Scan( sal_uInt16 nCount = 5 );
+ size_t Count( sal_Bool bUpdated = sal_True ) const;
+ sal_Bool Update();
Dir& operator +=( const Dir& rDir );
DirEntry& operator []( size_t nIndex ) const;
@@ -516,7 +505,7 @@ public:
class FSysRedirector
{
static FSysRedirector* _pRedirector;
- static BOOL _bEnabled;
+ static sal_Bool _bEnabled;
public:
/** This method must called with the one and only instance of the
@@ -548,9 +537,9 @@ public:
redirected (modified) path too, which can be of both formats
too.
- @return BOOL<BR>
- TRUE, if the path is redirected
- FALSE, if the path is not redirected (unchanged)
+ @return sal_Bool<BR>
+ sal_True, if the path is redirected
+ sal_False, if the path is not redirected (unchanged)
*/
static void DoRedirect( String &rPath );
};
@@ -559,7 +548,7 @@ public:
//========================================================================
-void FSysEnableSysErrorBox( BOOL bEnable );
+void FSysEnableSysErrorBox( sal_Bool bEnable );
//========================================================================
diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx
index c4fec945e51a..6bb133d8c32e 100644
--- a/tools/inc/tools/gen.hxx
+++ b/tools/inc/tools/gen.hxx
@@ -85,8 +85,8 @@ public:
long& A() { return nA; }
long& B() { return nB; }
- BOOL operator == ( const Pair& rPair ) const;
- BOOL operator != ( const Pair& rPair ) const;
+ sal_Bool operator == ( const Pair& rPair ) const;
+ sal_Bool operator != ( const Pair& rPair ) const;
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Pair& rPair );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Pair& rPair );
@@ -103,12 +103,12 @@ inline Pair::Pair( long _nA, long _nB )
Pair::nB = _nB;
}
-inline BOOL Pair::operator == ( const Pair& rPair ) const
+inline sal_Bool Pair::operator == ( const Pair& rPair ) const
{
return ((nA == rPair.nA) && (nB == rPair.nB));
}
-inline BOOL Pair::operator != ( const Pair& rPair ) const
+inline sal_Bool Pair::operator != ( const Pair& rPair ) const
{
return ((nA != rPair.nA) || (nB != rPair.nB));
}
@@ -130,10 +130,10 @@ public:
long& Y() { return nB; }
void Move( long nHorzMove, long nVertMove );
- BOOL IsAbove( const Point& rPoint ) const;
- BOOL IsBelow( const Point& rPoint ) const;
- BOOL IsLeft( const Point& rPoint ) const;
- BOOL IsRight( const Point& rPoint ) const;
+ sal_Bool IsAbove( const Point& rPoint ) const;
+ sal_Bool IsBelow( const Point& rPoint ) const;
+ sal_Bool IsLeft( const Point& rPoint ) const;
+ sal_Bool IsRight( const Point& rPoint ) const;
Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint );
@@ -172,22 +172,22 @@ inline void Point::Move( long nHorzMove, long nVertMove )
nB += nVertMove;
}
-inline BOOL Point::IsAbove( const Point& rPoint ) const
+inline sal_Bool Point::IsAbove( const Point& rPoint ) const
{
return (nB > rPoint.nB);
}
-inline BOOL Point::IsBelow( const Point& rPoint ) const
+inline sal_Bool Point::IsBelow( const Point& rPoint ) const
{
return (nB < rPoint.nB);
}
-inline BOOL Point::IsLeft( const Point& rPoint ) const
+inline sal_Bool Point::IsLeft( const Point& rPoint ) const
{
return (nA < rPoint.nA);
}
-inline BOOL Point::IsRight( const Point& rPoint ) const
+inline sal_Bool Point::IsRight( const Point& rPoint ) const
{
return (nA > rPoint.nA);
}
@@ -291,7 +291,7 @@ public:
long& Min() { return nA; }
long& Max() { return nB; }
- BOOL IsInside( long nIs ) const;
+ sal_Bool IsInside( long nIs ) const;
void Justify();
};
@@ -304,7 +304,7 @@ inline Range::Range( long nMin, long nMax ) : Pair( nMin, nMax )
{
}
-inline BOOL Range::IsInside( long nIs ) const
+inline sal_Bool Range::IsInside( long nIs ) const
{
return ((nA <= nIs) && (nIs <= nB ));
}
@@ -340,11 +340,11 @@ public:
long& Min() { return nA; }
long& Max() { return nB; }
- BOOL IsInside( long nIs ) const;
+ sal_Bool IsInside( long nIs ) const;
void Justify();
- BOOL operator !() const { return !Len(); }
+ sal_Bool operator !() const { return !Len(); }
long getMin() const { return Min(); }
long getMax() const { return Max(); }
@@ -365,7 +365,7 @@ inline Selection::Selection( long nMin, long nMax ) :
{
}
-inline BOOL Selection::IsInside( long nIs ) const
+inline sal_Bool Selection::IsInside( long nIs ) const
{
return ((nA <= nIs) && (nIs < nB ));
}
@@ -436,15 +436,15 @@ public:
void Justify();
- BOOL IsInside( const Point& rPOINT ) const;
- BOOL IsInside( const Rectangle& rRect ) const;
- BOOL IsOver( const Rectangle& rRect ) const;
+ sal_Bool IsInside( const Point& rPOINT ) const;
+ sal_Bool IsInside( const Rectangle& rRect ) const;
+ sal_Bool IsOver( const Rectangle& rRect ) const;
void SetEmpty() { nRight = nBottom = RECT_EMPTY; }
- BOOL IsEmpty() const;
+ sal_Bool IsEmpty() const;
- BOOL operator == ( const Rectangle& rRect ) const;
- BOOL operator != ( const Rectangle& rRect ) const;
+ sal_Bool operator == ( const Rectangle& rRect ) const;
+ sal_Bool operator != ( const Rectangle& rRect ) const;
Rectangle& operator += ( const Point& rPt );
Rectangle& operator -= ( const Point& rPt );
@@ -502,7 +502,7 @@ inline Rectangle::Rectangle( const Point& rLT, const Size& rSize )
nBottom = rSize.Height() ? nTop+rSize.Height()-1 : RECT_EMPTY;
}
-inline BOOL Rectangle::IsEmpty() const
+inline sal_Bool Rectangle::IsEmpty() const
{
return ((nRight == RECT_EMPTY) || (nBottom == RECT_EMPTY));
}
@@ -655,7 +655,7 @@ inline Rectangle Rectangle::GetIntersection( const Rectangle& rRect ) const
return aTmpRect.Intersection( rRect );
}
-inline BOOL Rectangle::operator == ( const Rectangle& rRect ) const
+inline sal_Bool Rectangle::operator == ( const Rectangle& rRect ) const
{
return ((nLeft == rRect.nLeft ) &&
(nTop == rRect.nTop ) &&
@@ -663,7 +663,7 @@ inline BOOL Rectangle::operator == ( const Rectangle& rRect ) const
(nBottom == rRect.nBottom ));
}
-inline BOOL Rectangle::operator != ( const Rectangle& rRect ) const
+inline sal_Bool Rectangle::operator != ( const Rectangle& rRect ) const
{
return ((nLeft != rRect.nLeft ) ||
(nTop != rRect.nTop ) ||
diff --git a/tools/inc/tools/geninfo.hxx b/tools/inc/tools/geninfo.hxx
index 97a6b963cdb0..9501ac771a83 100644
--- a/tools/inc/tools/geninfo.hxx
+++ b/tools/inc/tools/geninfo.hxx
@@ -63,7 +63,7 @@ public:
GenericInformation( const ByteString &rKey, const ByteString &rValue,
GenericInformationList *pParentList = NULL,
GenericInformationList *pSubInfos = NULL );
- GenericInformation( const GenericInformation& rInf, BOOL bCopySubs = TRUE);
+ GenericInformation( const GenericInformation& rInf, sal_Bool bCopySubs = sal_True);
~GenericInformation();
@@ -74,18 +74,18 @@ public:
void SetComment( const ByteString &rComment ) { sComment = rComment; }
// this methods used to handle sub informations
- BOOL InsertSubInfo( GenericInformation *pInfo );
+ sal_Bool InsertSubInfo( GenericInformation *pInfo );
// siehe GenericInformationList
- BOOL InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath = FALSE, BOOL bNewPath = FALSE);
- void RemoveSubInfo( GenericInformation *pInfo, BOOL bDelete = FALSE );
- // void RemoveSelf( BOOL bDelete = FALSE ); // loescht sich selbst aus der Parentliste
+ sal_Bool InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath = sal_False, sal_Bool bNewPath = sal_False);
+ void RemoveSubInfo( GenericInformation *pInfo, sal_Bool bDelete = sal_False );
+ // void RemoveSelf( sal_Bool bDelete = sal_False ); // loescht sich selbst aus der Parentliste
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // bei bDelete = TRUE werden auch alle Sublisten UND DIE INFO SELBST geloescht.
+ // bei bDelete = sal_True werden auch alle Sublisten UND DIE INFO SELBST geloescht.
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- GenericInformation *GetSubInfo( ByteString &rKey, BOOL bSearchByPath = FALSE,
- BOOL bCreatePath = FALSE );
+ GenericInformation *GetSubInfo( ByteString &rKey, sal_Bool bSearchByPath = sal_False,
+ sal_Bool bCreatePath = sal_False );
// path can be something like this: src370/drives/o:
void SetSubList( GenericInformationList *pSubList )
@@ -133,43 +133,43 @@ GenericLockInformation( const ByteString &rKey, const ByteString &rValue,
/* der Schreibschutz darf nur aktiviert werden, wenn
* der Status auf Lesen steht
*/
- BOOL SetWriteLock(UINT32 nKey = 0) { return ((read==aLockState) &&
- (aLockState=writeonly, nLockKey=nKey, TRUE)); }
+ sal_Bool SetWriteLock(sal_uInt32 nKey = 0) { return ((read==aLockState) &&
+ (aLockState=writeonly, nLockKey=nKey, sal_True)); }
/* Schreibschutz darf nur geloest werden, wenn
* der Schreibschutz drin ist, und
* entweder der LockKey Null ist(Generalschluessel) oder der Key zum LockKey passt
*/
- BOOL ReleaseWriteLock(UINT32 nKey = 0) { return ((writeonly==aLockState) &&
+ sal_Bool ReleaseWriteLock(sal_uInt32 nKey = 0) { return ((writeonly==aLockState) &&
(!nLockKey||nKey==nLockKey) &&
- (aLockState=read, nLockKey=0, TRUE)); } // setzt den zustand auf "read"
- BOOL SetReadLock(UINT32 nKey = 0) { return ((read==aLockState) &&
- (aLockState=readonly, nLockKey=nKey, TRUE)); }
- BOOL ReleaseReadLock(UINT32 nKey = 0) { return ((readonly==aLockState) &&
+ (aLockState=read, nLockKey=0, sal_True)); } // setzt den zustand auf "read"
+ sal_Bool SetReadLock(sal_uInt32 nKey = 0) { return ((read==aLockState) &&
+ (aLockState=readonly, nLockKey=nKey, sal_True)); }
+ sal_Bool ReleaseReadLock(sal_uInt32 nKey = 0) { return ((readonly==aLockState) &&
(!nLockKey||nKey==nLockKey) &&
- (aLockState=read, nLockKey=0, TRUE)); } // setzt den zustand auf "read"
+ (aLockState=read, nLockKey=0, sal_True)); } // setzt den zustand auf "read"
LockState GetLockState() const { return aLockState; }
- BOOL IsWriteLocked() const { return (writeonly==aLockState); }
- BOOL IsReadLocked() const { return (readonly==aLockState); }
- BOOL IsNotLocked() const { return (read==aLockState); }
- BOOL IsLocker( UINT32 nKey ) { return (nKey==nLockKey || !nLockKey); }
+ sal_Bool IsWriteLocked() const { return (writeonly==aLockState); }
+ sal_Bool IsReadLocked() const { return (readonly==aLockState); }
+ sal_Bool IsNotLocked() const { return (read==aLockState); }
+ sal_Bool IsLocker( sal_uInt32 nKey ) { return (nKey==nLockKey || !nLockKey); }
/* wenn der Schreibschutz aktiviert wurde,
* und bei vorhandenem Schreibschutz die Keys stimmen
* rufe die Parentmethode auf */
- BOOL InsertSubInfo( GenericInformation *pInfo, UINT32 nKey = 0 ) {
+ sal_Bool InsertSubInfo( GenericInformation *pInfo, sal_uInt32 nKey = 0 ) {
return ((writeonly==aLockState) &&
(!nLockKey || nKey==nLockKey) &&
- (GenericInformation::InsertSubInfo( pInfo ), TRUE)); }
+ (GenericInformation::InsertSubInfo( pInfo ), sal_True)); }
- BOOL InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue, UINT32 nKey = 0,
- BOOL bSearchByPath = FALSE, BOOL bNewPath = FALSE) {
+ sal_Bool InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue, sal_uInt32 nKey = 0,
+ sal_Bool bSearchByPath = sal_False, sal_Bool bNewPath = sal_False) {
return ((writeonly==aLockState) &&
(!nLockKey || nKey==nLockKey) &&
- (GenericInformation::InsertSubInfo( rPathKey, rValue, bSearchByPath, bNewPath ), TRUE)); }
+ (GenericInformation::InsertSubInfo( rPathKey, rValue, bSearchByPath, bNewPath ), sal_True)); }
/* 29.jan.98: erweiterung um lesemoeglichkeit vom Lockclienten */
- GenericInformation *GetSubInfo( ByteString &rKey, BOOL bSearchByPath = FALSE,
- BOOL bCreatePath = FALSE, UINT32 nKey = 0 ) {
+ GenericInformation *GetSubInfo( ByteString &rKey, sal_Bool bSearchByPath = sal_False,
+ sal_Bool bCreatePath = sal_False, sal_uInt32 nKey = 0 ) {
if (writeonly==aLockState && nLockKey && nKey!=nLockKey )
return NULL;
return GenericInformation::GetSubInfo(rKey, bSearchByPath, bCreatePath); }
@@ -178,7 +178,7 @@ GenericLockInformation( const ByteString &rKey, const ByteString &rValue,
private:
LockState aLockState;
- UINT32 nLockKey;
+ sal_uInt32 nLockKey;
};
//
@@ -199,7 +199,7 @@ private:
protected:
// methods
- size_t InsertSorted( GenericInformation *pInfo, BOOL bOverwrite,
+ size_t InsertSorted( GenericInformation *pInfo, sal_Bool bOverwrite,
size_t nStart, size_t nEnd );
GenericInformation *Search( size_t &rPos, ByteString sKey,
size_t nStart, size_t nEnd );
@@ -210,20 +210,19 @@ public:
~GenericInformationList();
// this methods used to handle the informations using binary search
- GenericInformation *GetInfo( ByteString &rKey, BOOL bSearchByPath = FALSE,
- BOOL bCreatePath = FALSE );
+ GenericInformation *GetInfo( ByteString &rKey, sal_Bool bSearchByPath = sal_False,
+ sal_Bool bCreatePath = sal_False );
/* path can be something like this: src370/drives/o:
* bCreatePath will create the neccecary paths to the GI */
- BOOL InsertInfo( GenericInformation *pInfo, BOOL bOverwrite = TRUE );
+ sal_Bool InsertInfo( GenericInformation *pInfo, sal_Bool bOverwrite = sal_True );
/* legt eine GenericInformation im Baum an mit Key-Value
* wenn bNewPath gesetzt, wird der nichtexistente Teil des Pfades neu kreiert
* wenn bNewPath nicht gesetzt ist und ein Teil des Pfades nicht vorhanden ist,
- * gibt die Methode FALSE zurueck.*/
- BOOL InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath = FALSE, BOOL bNewPath = FALSE);
-
- void RemoveInfo( GenericInformation *pInfo, BOOL bDelete = FALSE );
+ * gibt die Methode sal_False zurueck.*/
+ sal_Bool InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath = sal_False, sal_Bool bNewPath = sal_False);
+ void RemoveInfo( GenericInformation *pInfo, sal_Bool bDelete = sal_False );
GenericInformation* SetOwner( GenericInformation *pNewOwner );
diff --git a/tools/inc/tools/globname.hxx b/tools/inc/tools/globname.hxx
index cbca2169b518..552b702c4084 100644..100755
--- a/tools/inc/tools/globname.hxx
+++ b/tools/inc/tools/globname.hxx
@@ -38,8 +38,8 @@
*************************************************************************/
struct ImpSvGlobalName
{
- BYTE szData[ 16 ];
- USHORT nRefCount;
+ sal_uInt8 szData[ 16 ];
+ sal_uInt16 nRefCount;
ImpSvGlobalName()
{
@@ -48,7 +48,7 @@ struct ImpSvGlobalName
ImpSvGlobalName( const ImpSvGlobalName & rObj );
ImpSvGlobalName( int );
- BOOL operator == ( const ImpSvGlobalName & rObj ) const;
+ sal_Bool operator == ( const ImpSvGlobalName & rObj ) const;
};
#ifdef WNT
@@ -77,9 +77,9 @@ public:
pImp = pImpP;
pImp->nRefCount++;
}
- SvGlobalName( UINT32 n1, USHORT n2, USHORT n3,
- BYTE b8, BYTE b9, BYTE b10, BYTE b11,
- BYTE b12, BYTE b13, BYTE b14, BYTE b15 );
+ SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
+ sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
+ sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 );
// create SvGlobalName from a platform independent representation
SvGlobalName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aSeq );
@@ -90,16 +90,16 @@ public:
TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName & );
TOOLS_DLLPUBLIC friend SvStream & operator << ( SvStream &, const SvGlobalName & );
- BOOL operator < ( const SvGlobalName & rObj ) const;
- SvGlobalName & operator += ( UINT32 );
+ sal_Bool operator < ( const SvGlobalName & rObj ) const;
+ SvGlobalName & operator += ( sal_uInt32 );
SvGlobalName & operator ++ () { return operator += ( 1 ); }
- BOOL operator == ( const SvGlobalName & rObj ) const;
- BOOL operator != ( const SvGlobalName & rObj ) const
+ sal_Bool operator == ( const SvGlobalName & rObj ) const;
+ sal_Bool operator != ( const SvGlobalName & rObj ) const
{ return !(*this == rObj); }
void MakeFromMemory( void * pData );
- BOOL MakeId( const String & rId );
+ sal_Bool MakeId( const String & rId );
String GetctorName() const;
String GetHexName() const;
String GetRegDbName() const
@@ -112,7 +112,7 @@ public:
SvGlobalName( const CLSID & rId );
const CLSID & GetCLSID() const { return *(CLSID *)pImp->szData; }
- const BYTE* GetBytes() const { return pImp->szData; }
+ const sal_uInt8* GetBytes() const { return pImp->szData; }
// platform independent representation of a "GlobalName"
// maybe transported remotely
@@ -127,9 +127,9 @@ public:
~SvGlobalNameList();
void Append( const SvGlobalName & );
- SvGlobalName GetObject( ULONG );
- BOOL IsEntry( const SvGlobalName & rName );
- ULONG Count() const { return aList.size(); }
+ SvGlobalName GetObject( sal_uLong );
+ sal_Bool IsEntry( const SvGlobalName & rName );
+ size_t Count() const { return aList.size(); }
private:
// nicht erlaubt
SvGlobalNameList( const SvGlobalNameList & );
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx
index f02a487987ea..4c07917ebf1c 100644..100755
--- a/tools/inc/tools/inetmime.hxx
+++ b/tools/inc/tools/inetmime.hxx
@@ -1425,7 +1425,7 @@ public:
void Clear();
- void Insert(INetContentTypeParameter * pParameter, ULONG nIndex)
+ void Insert(INetContentTypeParameter * pParameter, sal_uIntPtr nIndex)
{
maEntries.insert(maEntries.begin()+nIndex,pParameter);
}
@@ -1435,7 +1435,7 @@ public:
maEntries.push_back(pParameter);
}
- inline const INetContentTypeParameter * GetObject(ULONG nIndex) const
+ inline const INetContentTypeParameter * GetObject(sal_uIntPtr nIndex) const
{
return &(maEntries[nIndex]);
}
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index 63af8114ddf8..c22e63208781 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -112,7 +112,7 @@ class INetMessage
{
List m_aHeaderList;
- ULONG m_nDocSize;
+ sal_uIntPtr m_nDocSize;
UniString m_aDocName;
SvLockBytesRef m_xDocLB;
@@ -121,7 +121,7 @@ class INetMessage
protected:
UniString GetHeaderName_Impl (
- ULONG nIndex, rtl_TextEncoding eEncoding) const
+ sal_uIntPtr nIndex, rtl_TextEncoding eEncoding) const
{
INetMessageHeader *p =
(INetMessageHeader*)(m_aHeaderList.GetObject(nIndex));
@@ -132,7 +132,7 @@ protected:
}
UniString GetHeaderValue_Impl (
- ULONG nIndex, INetMIME::HeaderFieldType eType) const
+ sal_uIntPtr nIndex, INetMIME::HeaderFieldType eType) const
{
INetMessageHeader *p =
(INetMessageHeader*)(m_aHeaderList.GetObject(nIndex));
@@ -143,7 +143,7 @@ protected:
}
void SetHeaderField_Impl (
- const INetMessageHeader &rHeader, ULONG &rnIndex)
+ const INetMessageHeader &rHeader, sal_uIntPtr &rnIndex)
{
INetMessageHeader *p = new INetMessageHeader (rHeader);
if (m_aHeaderList.Count() <= rnIndex)
@@ -162,7 +162,7 @@ protected:
INetMIME::HeaderFieldType eType,
const ByteString &rName,
const UniString &rValue,
- ULONG &rnIndex);
+ sal_uIntPtr &rnIndex);
virtual SvStream& operator<< (SvStream& rStrm) const;
virtual SvStream& operator>> (SvStream& rStrm);
@@ -188,19 +188,19 @@ public:
return *this;
}
- ULONG GetHeaderCount (void) const { return m_aHeaderList.Count(); }
+ sal_uIntPtr GetHeaderCount (void) const { return m_aHeaderList.Count(); }
- UniString GetHeaderName (ULONG nIndex) const
+ UniString GetHeaderName (sal_uIntPtr nIndex) const
{
return GetHeaderName_Impl (nIndex, RTL_TEXTENCODING_ASCII_US);
}
- UniString GetHeaderValue (ULONG nIndex) const
+ UniString GetHeaderValue (sal_uIntPtr nIndex) const
{
return GetHeaderValue_Impl (nIndex, INetMIME::HEADER_FIELD_TEXT);
}
- INetMessageHeader GetHeaderField (ULONG nIndex) const
+ INetMessageHeader GetHeaderField (sal_uIntPtr nIndex) const
{
INetMessageHeader *p =
(INetMessageHeader*)(m_aHeaderList.GetObject(nIndex));
@@ -210,16 +210,16 @@ public:
return INetMessageHeader();
}
- ULONG SetHeaderField (
+ sal_uIntPtr SetHeaderField (
const UniString& rName,
const UniString& rValue,
- ULONG nIndex = LIST_APPEND);
+ sal_uIntPtr nIndex = LIST_APPEND);
- virtual ULONG SetHeaderField (
- const INetMessageHeader &rField, ULONG nIndex = LIST_APPEND);
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rField, sal_uIntPtr nIndex = LIST_APPEND);
- ULONG GetDocumentSize (void) const { return m_nDocSize; }
- void SetDocumentSize (ULONG nSize) { m_nDocSize = nSize; }
+ sal_uIntPtr GetDocumentSize (void) const { return m_nDocSize; }
+ void SetDocumentSize (sal_uIntPtr nSize) { m_nDocSize = nSize; }
const UniString& GetDocumentName (void) const { return m_aDocName; }
void SetDocumentName (const UniString& rName) { m_aDocName = rName; }
@@ -247,7 +247,7 @@ public:
*=====================================================================*/
class INetMessageHeaderIterator
{
- ULONG nValueCount;
+ sal_uIntPtr nValueCount;
List aValueList;
UniString aEmptyString;
@@ -256,8 +256,8 @@ public:
const INetMessage& rMsg, const UniString& rHdrName);
virtual ~INetMessageHeaderIterator (void);
- ULONG GetValueCount (void) const { return nValueCount; }
- const UniString& GetValue (ULONG nIndex) const
+ sal_uIntPtr GetValueCount (void) const { return nValueCount; }
+ const UniString& GetValue (sal_uIntPtr nIndex) const
{
if (nIndex < nValueCount)
{
@@ -297,7 +297,7 @@ public:
class TOOLS_DLLPUBLIC INetRFC822Message : public INetMessage
{
- ULONG m_nIndex[INETMSG_RFC822_NUMHDR];
+ sal_uIntPtr m_nIndex[INETMSG_RFC822_NUMHDR];
protected:
virtual SvStream& operator<< (SvStream& rStrm) const;
@@ -310,14 +310,14 @@ public:
INetRFC822Message& operator= (const INetRFC822Message& rMsg);
- static BOOL GenerateDateField (
+ static sal_Bool GenerateDateField (
const DateTime& rDateTime, UniString& rDateField);
- static BOOL ParseDateField (
+ static sal_Bool ParseDateField (
const UniString& rDateField, DateTime& rDateTime);
using INetMessage::SetHeaderField;
- virtual ULONG SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nIndex = LIST_APPEND);
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nIndex = LIST_APPEND);
/** Header fields.
*/
@@ -491,23 +491,23 @@ enum INetMessageContainerType
class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message
{
- ULONG m_nIndex[INETMSG_MIME_NUMHDR];
+ sal_uIntPtr m_nIndex[INETMSG_MIME_NUMHDR];
INetMIMEMessage *pParent;
- ULONG nNumChildren;
+ sal_uIntPtr nNumChildren;
List aChildren;
ByteString m_aBoundary;
- BOOL bHeaderParsed;
+ sal_Bool bHeaderParsed;
friend class INetMIMEMessageStream;
- void SetChildCount (ULONG nCount) { nNumChildren = nCount; }
+ void SetChildCount (sal_uIntPtr nCount) { nNumChildren = nCount; }
const ByteString& GetMultipartBoundary (void) const { return m_aBoundary; }
void SetMultipartBoundary (const ByteString& rBnd) { m_aBoundary = rBnd; }
void CleanupImp (void);
void CopyImp (const INetMIMEMessage& rMsg);
- void SetHeaderParsed() { bHeaderParsed = TRUE; }
+ void SetHeaderParsed() { bHeaderParsed = sal_True; }
protected:
virtual SvStream& operator<< (SvStream& rStrm) const;
@@ -520,14 +520,14 @@ public:
INetMIMEMessage& operator= (const INetMIMEMessage& rMsg);
- BOOL HeaderParsed() const { return bHeaderParsed; }
+ sal_Bool HeaderParsed() const { return bHeaderParsed; }
virtual INetMIMEMessage* CreateMessage (
const INetMIMEMessage& rMsg) const;
using INetRFC822Message::SetHeaderField;
- virtual ULONG SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nIndex = LIST_APPEND);
+ virtual sal_uIntPtr SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nIndex = LIST_APPEND);
/** Header fields.
*/
@@ -571,34 +571,34 @@ public:
/** Message container methods.
*/
- BOOL IsContainer (void) const
+ sal_Bool IsContainer (void) const
{
return (IsMessage() || IsMultipart());
}
- BOOL IsMessage (void) const
+ sal_Bool IsMessage (void) const
{
UniString aType (GetContentType());
return (aType.CompareIgnoreCaseToAscii("message/", 8) == 0);
}
- BOOL IsMultipart (void) const
+ sal_Bool IsMultipart (void) const
{
UniString aType (GetContentType());
return (aType.CompareIgnoreCaseToAscii("multipart/", 10) == 0);
}
- ULONG GetChildCount (void) const { return nNumChildren; }
- INetMIMEMessage* GetChild (ULONG nIndex) const
+ sal_uIntPtr GetChildCount (void) const { return nNumChildren; }
+ INetMIMEMessage* GetChild (sal_uIntPtr nIndex) const
{
return ((INetMIMEMessage *)(aChildren.GetObject (nIndex)));
}
INetMIMEMessage* GetParent (void) const { return pParent; }
- BOOL EnableAttachChild (
+ sal_Bool EnableAttachChild (
INetMessageContainerType eType = INETMSG_MULTIPART_MIXED);
- BOOL AttachChild (
- INetMIMEMessage& rChildMsg, BOOL bOwner = TRUE);
- BOOL DetachChild (
- ULONG nIndex, INetMIMEMessage& rChildMsg) const;
+ sal_Bool AttachChild (
+ INetMIMEMessage& rChildMsg, sal_Bool bOwner = sal_True);
+ sal_Bool DetachChild (
+ sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const;
/** Stream operators.
*/
diff --git a/tools/inc/tools/inetstrm.hxx b/tools/inc/tools/inetstrm.hxx
index 91fb416e1544..16de7beedd98 100644
--- a/tools/inc/tools/inetstrm.hxx
+++ b/tools/inc/tools/inetstrm.hxx
@@ -61,13 +61,13 @@ class TOOLS_DLLPUBLIC INetIStream
INetIStream& operator= (const INetIStream& rStrm);
protected:
- virtual int GetData (sal_Char *pData, ULONG nSize) = 0;
+ virtual int GetData (sal_Char *pData, sal_uIntPtr nSize) = 0;
public:
INetIStream ();
virtual ~INetIStream (void);
- int Read (sal_Char *pData, ULONG nSize);
+ int Read (sal_Char *pData, sal_uIntPtr nSize);
static void Decode64 (SvStream& rIn, SvStream& rOut);
static void Encode64 (SvStream& rIn, SvStream& rOut);
@@ -84,13 +84,13 @@ class INetOStream
protected:
virtual int PutData (
- const sal_Char *pData, ULONG nSize) = 0;
+ const sal_Char *pData, sal_uIntPtr nSize) = 0;
public:
INetOStream ();
virtual ~INetOStream (void);
- int Write (const sal_Char *pData, ULONG nSize);
+ int Write (const sal_Char *pData, sal_uIntPtr nSize);
};
/*
@@ -103,7 +103,7 @@ class INetIOStream : public INetIStream, public INetOStream
INetIOStream& operator= (const INetIOStream& rStrm);
public:
- INetIOStream (ULONG nIBufferSize = 0, ULONG nOBufferSize = 0);
+ INetIOStream (sal_uIntPtr nIBufferSize = 0, sal_uIntPtr nOBufferSize = 0);
virtual ~INetIOStream (void);
};
@@ -129,9 +129,9 @@ enum INetMessageStreamState
class INetMessageIStream : public INetIStream
{
INetMessage *pSourceMsg;
- BOOL bHeaderGenerated;
+ sal_Bool bHeaderGenerated;
- ULONG nBufSiz;
+ sal_uIntPtr nBufSiz;
sal_Char *pBuffer;
sal_Char *pRead;
sal_Char *pWrite;
@@ -141,24 +141,24 @@ class INetMessageIStream : public INetIStream
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
- virtual int GetData (sal_Char *pData, ULONG nSize);
+ virtual int GetData (sal_Char *pData, sal_uIntPtr nSize);
// Not implemented.
INetMessageIStream (const INetMessageIStream& rStrm);
INetMessageIStream& operator= (const INetMessageIStream& rStrm);
protected:
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageIStream (ULONG nBufferSize = 2048);
+ INetMessageIStream (sal_uIntPtr nBufferSize = 2048);
virtual ~INetMessageIStream (void);
INetMessage *GetSourceMessage (void) const { return pSourceMsg; }
void SetSourceMessage (INetMessage *pMsg) { pSourceMsg = pMsg; }
- void GenerateHeader (BOOL bGen = TRUE) { bHeaderGenerated = !bGen; }
- BOOL IsHeaderGenerated (void) const { return bHeaderGenerated; }
+ void GenerateHeader (sal_Bool bGen = sal_True) { bHeaderGenerated = !bGen; }
+ sal_Bool IsHeaderGenerated (void) const { return bHeaderGenerated; }
};
/*
@@ -167,20 +167,20 @@ public:
class INetMessageOStream : public INetOStream
{
INetMessage *pTargetMsg;
- BOOL bHeaderParsed;
+ sal_Bool bHeaderParsed;
INetMessageStreamState eOState;
SvMemoryStream *pMsgBuffer;
- virtual int PutData (const sal_Char *pData, ULONG nSize);
+ virtual int PutData (const sal_Char *pData, sal_uIntPtr nSize);
// Not implemented.
INetMessageOStream (const INetMessageOStream& rStrm);
INetMessageOStream& operator= (const INetMessageOStream& rStrm);
protected:
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
INetMessageOStream (void);
@@ -189,8 +189,8 @@ public:
INetMessage *GetTargetMessage (void) const { return pTargetMsg; }
void SetTargetMessage (INetMessage *pMsg) { pTargetMsg = pMsg; }
- void ParseHeader (BOOL bParse = TRUE) { bHeaderParsed = !bParse; }
- BOOL IsHeaderParsed (void) const { return bHeaderParsed; }
+ void ParseHeader (sal_Bool bParse = sal_True) { bHeaderParsed = !bParse; }
+ sal_Bool IsHeaderParsed (void) const { return bHeaderParsed; }
};
/*
@@ -205,7 +205,7 @@ class INetMessageIOStream
INetMessageIOStream& operator= (const INetMessageIOStream& rStrm);
public:
- INetMessageIOStream (ULONG nBufferSize = 2048);
+ INetMessageIOStream (sal_uIntPtr nBufferSize = 2048);
virtual ~INetMessageIOStream (void);
};
@@ -227,7 +227,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream
{
int eState;
- ULONG nChildIndex;
+ sal_uIntPtr nChildIndex;
INetMIMEMessageStream *pChildStrm;
INetMessageEncoding eEncoding;
@@ -244,11 +244,11 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream
INetMIMEMessageStream& operator= (const INetMIMEMessageStream& rStrm);
protected:
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMIMEMessageStream (ULONG nBufferSize = 2048);
+ INetMIMEMessageStream (sal_uIntPtr nBufferSize = 2048);
virtual ~INetMIMEMessageStream (void);
using INetMessageIStream::SetSourceMessage;
diff --git a/tools/inc/tools/iparser.hxx b/tools/inc/tools/iparser.hxx
index 83f4e2530bae..23f0a1b68534 100644
--- a/tools/inc/tools/iparser.hxx
+++ b/tools/inc/tools/iparser.hxx
@@ -73,18 +73,18 @@ key [value]
#define IP_NO_ERROR 0x0000
#define IP_UNEXPECTED_EOF 0x0001
-#define REPLACE_VARIABLES TRUE
+#define REPLACE_VARIABLES sal_True
class TOOLS_DLLPUBLIC InformationParser
{
private:
- BOOL bRecover;
+ sal_Bool bRecover;
ByteString sOldLine;
ByteString sCurrentComment;
- BOOL bReplaceVariables; // meaning %UPD and %VERSION
- USHORT nLevel;
+ sal_Bool bReplaceVariables; // meaning %UPD and %VERSION
+ sal_uInt16 nLevel;
ByteString sUPD;
ByteString sVersion;
@@ -92,10 +92,10 @@ private:
SvStream *pActStream;
UniString sStreamName;
- USHORT nErrorCode;
- ULONG nErrorLine;
+ sal_uInt16 nErrorCode;
+ sal_uIntPtr nErrorLine;
ByteString sErrorText;
- ULONG nActLine;
+ sal_uIntPtr nActLine;
// methods
TOOLS_DLLPRIVATE ByteString &ReadLine();
@@ -103,15 +103,15 @@ private:
inline void Recover();
protected:
- BOOL Save( SvStream &rOutStream,
- const GenericInformationList *pSaveList, USHORT nLevel, BOOL bStripped );
+ sal_Bool Save( SvStream &rOutStream,
+ const GenericInformationList *pSaveList, sal_uInt16 nLevel, sal_Bool bStripped );
GenericInformationList *Execute( SvStream &rSourceStream,
GenericInformationList *pExistingList );
virtual void PrintStatus( ByteString &rStatus )
{ if ( aStatusLink.IsSet()) aStatusLink.Call( &rStatus ); }
public:
- InformationParser( BOOL bReplace = FALSE );
+ InformationParser( sal_Bool bReplace = sal_False );
virtual ~InformationParser();
// the following methods return NULL if any errors are detected
@@ -130,15 +130,15 @@ public:
GenericInformationList *pExistingList = NULL );
// save the InfrormationList to rSourceFile
- // returns FALSE on error
- BOOL Save( SvFileStream &rSourceStream,
+ // returns sal_False on error
+ sal_Bool Save( SvFileStream &rSourceStream,
const GenericInformationList *pSaveList );
- BOOL Save( SvMemoryStream &rSourceStream,
+ sal_Bool Save( SvMemoryStream &rSourceStream,
const GenericInformationList *pSaveList );
- BOOL Save( const UniString &rSourceFile,
+ sal_Bool Save( const UniString &rSourceFile,
const GenericInformationList *pSaveList );
- USHORT GetErrorCode();
+ sal_uInt16 GetErrorCode();
ByteString &GetErrorText();
void SetStatusHdl( const Link &rHdl ) { aStatusLink = rHdl; }
diff --git a/tools/inc/tools/line.hxx b/tools/inc/tools/line.hxx
index 592aeecce899..ffe1ceec69b1 100644
--- a/tools/inc/tools/line.hxx
+++ b/tools/inc/tools/line.hxx
@@ -61,9 +61,9 @@ public:
double GetLength() const;
- BOOL Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const;
- BOOL Intersection( const Line& rLine, Point& rIntersection ) const;
- BOOL Intersection( const Rectangle& rRect, Line& rIntersection ) const;
+ sal_Bool Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const;
+ sal_Bool Intersection( const Line& rLine, Point& rIntersection ) const;
+ sal_Bool Intersection( const Rectangle& rRect, Line& rIntersection ) const;
double GetDistance( const double& rPtX, const double& rPtY ) const;
double GetDistance( const Point& rPoint ) const { return( GetDistance( rPoint.X(), rPoint.Y() ) ); }
diff --git a/tools/inc/tools/link.hxx b/tools/inc/tools/link.hxx
index 85ce0b344833..02187e339187 100644
--- a/tools/inc/tools/link.hxx
+++ b/tools/inc/tools/link.hxx
@@ -113,14 +113,14 @@ public:
long Call( void* pCaller ) const;
- BOOL IsSet() const;
- BOOL operator !() const;
+ sal_Bool IsSet() const;
+ sal_Bool operator !() const;
- BOOL operator==( const Link& rLink ) const;
- BOOL operator!=( const Link& rLink ) const
+ sal_Bool operator==( const Link& rLink ) const;
+ sal_Bool operator!=( const Link& rLink ) const
{ return !(Link::operator==( rLink )); }
- BOOL operator<( const Link& rLink ) const
- { return ((ULONG)rLink.pFunc < (ULONG)pFunc); }
+ sal_Bool operator<( const Link& rLink ) const
+ { return ((sal_uIntPtr)rLink.pFunc < (sal_uIntPtr)pFunc); }
};
inline Link::Link()
@@ -140,20 +140,20 @@ inline long Link::Call(void *pCaller) const
return pFunc ? (*pFunc)(pInst, pCaller) : 0;
}
-inline BOOL Link::IsSet() const
+inline sal_Bool Link::IsSet() const
{
if ( pFunc )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL Link::operator !() const
+inline sal_Bool Link::operator !() const
{
if ( !pFunc )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
#endif // _LINK_HXX
diff --git a/tools/inc/tools/list.hxx b/tools/inc/tools/list.hxx
index dcbf54f9ae15..9f920356b489 100644
--- a/tools/inc/tools/list.hxx
+++ b/tools/inc/tools/list.hxx
@@ -57,18 +57,18 @@ public:
using Container::Next;
using Container::Prev;
- List( USHORT _nInitSize = 16, USHORT _nReSize = 16 ) :
+ List( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) :
Container( 1024, _nInitSize, _nReSize ) {}
- List( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) :
+ List( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
Container( _nBlockSize, _nInitSize, _nReSize ) {}
List( const List& rList ) : Container( rList ) {}
List& operator =( const List& rList )
{ Container::operator =( rList ); return *this; }
- BOOL operator ==( const List& rList ) const
+ sal_Bool operator ==( const List& rList ) const
{ return Container::operator ==( rList ); }
- BOOL operator !=( const List& rList ) const
+ sal_Bool operator !=( const List& rList ) const
{ return Container::operator !=( rList ); }
};
@@ -84,16 +84,16 @@ public: \
using List::Count; \
using List::GetCurPos; \
\
- ClassName( USHORT _nInitSize = 16, \
- USHORT _nReSize = 16 ) : \
+ ClassName( sal_uInt16 _nInitSize = 16, \
+ sal_uInt16 _nReSize = 16 ) : \
List( _nInitSize, _nReSize ) {} \
- ClassName( USHORT _nBlockSize, USHORT _nInitSize, \
- USHORT _nReSize ) : \
+ ClassName( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, \
+ sal_uInt16 _nReSize ) : \
List( _nBlockSize, _nInitSize, _nReSize ) {} \
ClassName( const ClassName& rClassName ) : \
List( rClassName ) {} \
\
- void Insert( Type p, ULONG nIndex ) \
+ void Insert( Type p, sal_uIntPtr nIndex ) \
{ List::Insert( (void*)p, nIndex ); } \
void Insert( Type p ) \
{ List::Insert( (void*)p ); } \
@@ -101,13 +101,13 @@ public: \
{ List::Insert( (void*)pNew, (void*)pOld ); } \
Type Remove() \
{ return (Type)List::Remove(); } \
- Type Remove( ULONG nIndex ) \
+ Type Remove( sal_uIntPtr nIndex ) \
{ return (Type)List::Remove( nIndex ); } \
Type Remove( Type p ) \
{ return (Type)List::Remove( (void*)p ); } \
Type Replace( Type p ) \
{ return (Type)List::Replace( (void*)p ); } \
- Type Replace( Type p, ULONG nIndex ) \
+ Type Replace( Type p, sal_uIntPtr nIndex ) \
{ return (Type)List::Replace( (void*)p, nIndex ); } \
Type Replace( Type pNew, Type pOld ) \
{ return (Type)List::Replace( (void*)pNew, \
@@ -115,16 +115,16 @@ public: \
\
Type GetCurObject() const \
{ return (Type)List::GetCurObject(); } \
- Type GetObject( ULONG nIndex ) const \
+ Type GetObject( sal_uIntPtr nIndex ) const \
{ return (Type)List::GetObject( nIndex ); } \
- ULONG GetPos( const Type p ) const \
+ sal_uIntPtr GetPos( const Type p ) const \
{ return List::GetPos( (const void*)p ); } \
- ULONG GetPos( const Type p, ULONG nStartIndex, \
- BOOL bForward = TRUE ) const \
+ sal_uIntPtr GetPos( const Type p, sal_uIntPtr nStartIndex, \
+ sal_Bool bForward = sal_True ) const \
{ return List::GetPos( (const void*)p, nStartIndex, \
bForward ); } \
\
- Type Seek( ULONG nIndex ) \
+ Type Seek( sal_uIntPtr nIndex ) \
{ return (Type)List::Seek( nIndex ); } \
Type Seek( void* p ) { return (Type)List::Seek( p ); } \
Type First() { return (Type)List::First(); } \
@@ -135,9 +135,9 @@ public: \
ClassName& operator =( const ClassName& rClassName ) \
{ List::operator =( rClassName ); return *this; } \
\
- BOOL operator ==( const ClassName& rList ) const \
+ sal_Bool operator ==( const ClassName& rList ) const \
{ return List::operator ==( rList ); } \
- BOOL operator !=( const ClassName& rList ) const \
+ sal_Bool operator !=( const ClassName& rList ) const \
{ return List::operator !=( rList ); } \
};
diff --git a/tools/inc/tools/mapunit.hxx b/tools/inc/tools/mapunit.hxx
index 53e9c61b8d26..e57316c8c380 100644
--- a/tools/inc/tools/mapunit.hxx
+++ b/tools/inc/tools/mapunit.hxx
@@ -33,7 +33,6 @@
// - MapMode-Types -
// -----------------
-// By changes you must also change: rsc/vclrsc.hxx
enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
diff --git a/tools/inc/tools/mempool.hxx b/tools/inc/tools/mempool.hxx
index 9544f33f35fa..6bd13859c80f 100644
--- a/tools/inc/tools/mempool.hxx
+++ b/tools/inc/tools/mempool.hxx
@@ -42,9 +42,9 @@ class TOOLS_DLLPUBLIC FixedMemPool
FixedMemPool_Impl * m_pImpl;
public:
- FixedMemPool( USHORT nTypeSize,
- USHORT nInitSize = 512,
- USHORT nGrowSize = 256 );
+ FixedMemPool( sal_uInt16 nTypeSize,
+ sal_uInt16 nInitSize = 512,
+ sal_uInt16 nGrowSize = 256 );
~FixedMemPool();
void* Alloc();
diff --git a/tools/inc/tools/multisel.hxx b/tools/inc/tools/multisel.hxx
index e077914c8eea..bb74783a7a35 100644
--- a/tools/inc/tools/multisel.hxx
+++ b/tools/inc/tools/multisel.hxx
@@ -52,17 +52,17 @@ class TOOLS_DLLPUBLIC MultiSelection
private:
ImpSelList aSels; // array of SV-selections
Range aTotRange; // total range of indexes
- ULONG nCurSubSel; // index in aSels of current selected index
+ sal_uIntPtr nCurSubSel; // index in aSels of current selected index
long nCurIndex; // current selected entry
- ULONG nSelCount; // number of selected indexes
- BOOL bInverseCur;// inverse cursor
- BOOL bCurValid; // are nCurIndex and nCurSubSel valid
- BOOL bSelectNew; // auto-select newly inserted indexes
+ sal_uIntPtr nSelCount; // number of selected indexes
+ sal_Bool bInverseCur;// inverse cursor
+ sal_Bool bCurValid; // are nCurIndex and nCurSubSel valid
+ sal_Bool bSelectNew; // auto-select newly inserted indexes
#ifdef _SV_MULTISEL_CXX
TOOLS_DLLPRIVATE void ImplClear();
TOOLS_DLLPRIVATE size_t ImplFindSubSelection( long nIndex ) const;
- TOOLS_DLLPRIVATE BOOL ImplMergeSubSelections( size_t nPos1, size_t nPos2 );
+ TOOLS_DLLPRIVATE sal_Bool ImplMergeSubSelections( size_t nPos1, size_t nPos2 );
TOOLS_DLLPRIVATE long ImplFwdUnselected();
TOOLS_DLLPRIVATE long ImplBwdUnselected();
#endif
@@ -77,18 +77,18 @@ public:
~MultiSelection();
MultiSelection& operator= ( const MultiSelection& rOrig );
- BOOL operator== ( MultiSelection& rOrig );
- BOOL operator!= ( MultiSelection& rOrig )
+ sal_Bool operator== ( MultiSelection& rOrig );
+ sal_Bool operator!= ( MultiSelection& rOrig )
{ return !operator==( rOrig ); }
- BOOL operator !() const
+ sal_Bool operator !() const
{ return nSelCount == 0; }
- void SelectAll( BOOL bSelect = TRUE );
- BOOL Select( long nIndex, BOOL bSelect = TRUE );
- void Select( const Range& rIndexRange, BOOL bSelect = TRUE );
- BOOL IsSelected( long nIndex ) const;
- BOOL IsAllSelected() const
- { return nSelCount == ULONG(aTotRange.Len()); }
+ void SelectAll( sal_Bool bSelect = sal_True );
+ sal_Bool Select( long nIndex, sal_Bool bSelect = sal_True );
+ void Select( const Range& rIndexRange, sal_Bool bSelect = sal_True );
+ sal_Bool IsSelected( long nIndex ) const;
+ sal_Bool IsAllSelected() const
+ { return nSelCount == sal_uIntPtr(aTotRange.Len()); }
long GetSelectCount() const { return nSelCount; }
void SetTotalRange( const Range& rTotRange );
@@ -97,9 +97,9 @@ public:
void Append( long nCount = 1 );
const Range& GetTotalRange() const { return aTotRange; }
- BOOL IsCurValid() const { return bCurValid; }
+ sal_Bool IsCurValid() const { return bCurValid; }
long GetCurSelected() const { return nCurIndex; }
- long FirstSelected( BOOL bInverse = FALSE );
+ long FirstSelected( sal_Bool bInverse = sal_False );
long LastSelected();
long NextSelected();
long PrevSelected();
diff --git a/tools/inc/tools/ownlist.hxx b/tools/inc/tools/ownlist.hxx
index f0d708a88ba8..715734f162f6 100644
--- a/tools/inc/tools/ownlist.hxx
+++ b/tools/inc/tools/ownlist.hxx
@@ -36,8 +36,8 @@
#define PRV_SV_DECL_OWNER_LIST(ClassName,Type) \
List aTypes; \
public: \
- ClassName( USHORT nInitSize = 16, \
- USHORT nReSize = 16 ) \
+ ClassName( sal_uInt16 nInitSize = 16, \
+ sal_uInt16 nReSize = 16 ) \
: aTypes( nInitSize, nReSize ) {} \
ClassName( const ClassName & rObj ) \
{ *this = rObj; } \
@@ -49,18 +49,18 @@ public: \
{ delete (Type *)aTypes.Remove(); } \
void Remove( Type * pObj ) \
{ delete (Type *)aTypes.Remove( pObj ); } \
- void Remove( ULONG nPos ) \
+ void Remove( sal_uIntPtr nPos ) \
{ delete (Type *)aTypes.Remove( nPos ); } \
- Type & Insert( const Type &, ULONG nPos ); \
+ Type & Insert( const Type &, sal_uIntPtr nPos ); \
Type & Insert( const Type & rType ) \
{ return Insert( rType, aTypes.GetCurPos() ); } \
Type & Append( const Type & rType ) \
{ return Insert( rType, LIST_APPEND ); } \
- Type & GetObject( ULONG nPos ) const \
+ Type & GetObject( sal_uIntPtr nPos ) const \
{ return *(Type *)aTypes.GetObject( nPos ); } \
- Type & operator []( ULONG nPos ) const \
+ Type & operator []( sal_uIntPtr nPos ) const \
{ return *(Type *)aTypes.GetObject( nPos ); } \
- ULONG Count() const { return aTypes.Count(); }
+ sal_uIntPtr Count() const { return aTypes.Count(); }
#define PRV_SV_IMPL_OWNER_LIST(ClassName,Type) \
ClassName & ClassName::operator = ( const ClassName & rObj ) \
@@ -68,7 +68,7 @@ ClassName & ClassName::operator = ( const ClassName & rObj ) \
if( this != &rObj ) \
{ \
Clear(); \
- for( ULONG i = 0; i < rObj.Count(); i++ ) \
+ for( sal_uIntPtr i = 0; i < rObj.Count(); i++ ) \
Append( rObj.GetObject( i ) ); \
} \
return *this; \
@@ -83,7 +83,7 @@ void ClassName::Clear() \
} \
aTypes.Clear(); \
} \
-Type & ClassName::Insert( const Type & rType, ULONG nPos ) \
+Type & ClassName::Insert( const Type & rType, sal_uIntPtr nPos ) \
{ \
Type * pType = new Type( rType ); \
aTypes.Insert( pType, nPos ); \
diff --git a/tools/inc/tools/poly.hxx b/tools/inc/tools/poly.hxx
index 09cfeebfdb49..02d2355e5af9 100644
--- a/tools/inc/tools/poly.hxx
+++ b/tools/inc/tools/poly.hxx
@@ -86,16 +86,16 @@ private:
enum DataType { DATA_NONE = 0, DATA_ABSOLUT = 1, DATA_PERCENT = 2 };
DataType eType;
- union { ULONG mnAbsolut; USHORT mnPercent; };
+ union { sal_uIntPtr mnAbsolut; sal_uInt16 mnPercent; };
public:
PolyOptimizeData() : eType( DATA_NONE ) {}
- PolyOptimizeData( ULONG nAbsolut ) : eType( DATA_ABSOLUT ), mnAbsolut( nAbsolut ) {}
- PolyOptimizeData( USHORT nPercent ) : eType( DATA_PERCENT ), mnPercent( nPercent ) {}
+ PolyOptimizeData( sal_uIntPtr nAbsolut ) : eType( DATA_ABSOLUT ), mnAbsolut( nAbsolut ) {}
+ PolyOptimizeData( sal_uInt16 nPercent ) : eType( DATA_PERCENT ), mnPercent( nPercent ) {}
- ULONG GetAbsValue() const { DBG_ASSERT( eType == DATA_ABSOLUT, "Wrong data type" ); return mnAbsolut; }
- USHORT GetPercentValue() const { DBG_ASSERT( eType == DATA_PERCENT, "Wrong data type" ); return mnPercent; }
+ sal_uIntPtr GetAbsValue() const { DBG_ASSERT( eType == DATA_ABSOLUT, "Wrong data type" ); return mnAbsolut; }
+ sal_uInt16 GetPercentValue() const { DBG_ASSERT( eType == DATA_PERCENT, "Wrong data type" ); return mnPercent; }
};
// -----------
@@ -124,57 +124,57 @@ private:
public:
Point* ImplGetPointAry();
- BYTE* ImplGetFlagAry();
+ sal_uInt8* ImplGetFlagAry();
- static void ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPercent );
+ static void ImplReduceEdges( Polygon& rPoly, const double& rArea, sal_uInt16 nPercent );
void ImplRead( SvStream& rIStream );
void ImplWrite( SvStream& rOStream ) const;
public:
Polygon();
- Polygon( USHORT nSize );
- Polygon( USHORT nPoints, const Point* pPtAry,
- const BYTE* pFlagAry = NULL );
+ Polygon( sal_uInt16 nSize );
+ Polygon( sal_uInt16 nPoints, const Point* pPtAry,
+ const sal_uInt8* pFlagAry = NULL );
Polygon( const Rectangle& rRect );
Polygon( const Rectangle& rRect,
- ULONG nHorzRound, ULONG nVertRound );
+ sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound );
Polygon( const Point& rCenter,
long nRadX, long nRadY,
- USHORT nPoints = 0 );
+ sal_uInt16 nPoints = 0 );
Polygon( const Rectangle& rBound,
const Point& rStart, const Point& rEnd,
PolyStyle ePolyStyle = POLY_ARC );
Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
const Point& rBezPt2, const Point& rCtrlPt2,
- USHORT nPoints = 0 );
+ sal_uInt16 nPoints = 0 );
Polygon( const Polygon& rPoly );
~Polygon();
- void SetPoint( const Point& rPt, USHORT nPos );
- const Point& GetPoint( USHORT nPos ) const;
+ void SetPoint( const Point& rPt, sal_uInt16 nPos );
+ const Point& GetPoint( sal_uInt16 nPos ) const;
- void SetFlags( USHORT nPos, PolyFlags eFlags );
- PolyFlags GetFlags( USHORT nPos ) const;
+ void SetFlags( sal_uInt16 nPos, PolyFlags eFlags );
+ PolyFlags GetFlags( sal_uInt16 nPos ) const;
sal_Bool HasFlags() const;
- BOOL IsControl( USHORT nPos ) const;
- BOOL IsSmooth( USHORT nPos ) const;
- BOOL IsRect() const;
+ sal_Bool IsControl( sal_uInt16 nPos ) const;
+ sal_Bool IsSmooth( sal_uInt16 nPos ) const;
+ sal_Bool IsRect() const;
- void SetSize( USHORT nNewSize );
- USHORT GetSize() const;
+ void SetSize( sal_uInt16 nNewSize );
+ sal_uInt16 GetSize() const;
void Clear();
Rectangle GetBoundRect() const;
double GetArea() const;
double GetSignedArea() const;
- BOOL IsInside( const Point& rPt ) const;
- BOOL IsRightOrientated() const;
- double CalcDistance( USHORT nPt1, USHORT nPt2 );
- void Clip( const Rectangle& rRect, BOOL bPolygon = TRUE );
- void Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData = NULL );
+ sal_Bool IsInside( const Point& rPt ) const;
+ sal_Bool IsRightOrientated() const;
+ double CalcDistance( sal_uInt16 nPt1, sal_uInt16 nPt2 );
+ void Clip( const Rectangle& rRect, sal_Bool bPolygon = sal_True );
+ void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
/** Adaptive subdivision of polygons with curves
@@ -205,21 +205,21 @@ public:
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
- void Rotate( const Point& rCenter, USHORT nAngle10 );
+ void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
void SlantX( long nYRef, double fSin, double fCos );
void SlantY( long nXRef, double fSin, double fCos );
void Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect );
- void Insert( USHORT nPos, const Point& rPt, PolyFlags eFlags = POLY_NORMAL );
- void Insert( USHORT nPos, const Polygon& rPoly );
- void Remove( USHORT nPos, USHORT nCount );
+ void Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags = POLY_NORMAL );
+ void Insert( sal_uInt16 nPos, const Polygon& rPoly );
+ void Remove( sal_uInt16 nPos, sal_uInt16 nCount );
- const Point& operator[]( USHORT nPos ) const { return GetPoint( nPos ); }
- Point& operator[]( USHORT nPos );
+ const Point& operator[]( sal_uInt16 nPos ) const { return GetPoint( nPos ); }
+ Point& operator[]( sal_uInt16 nPos );
Polygon& operator=( const Polygon& rPoly );
- BOOL operator==( const Polygon& rPoly ) const;
- BOOL operator!=( const Polygon& rPoly ) const
+ sal_Bool operator==( const Polygon& rPoly ) const;
+ sal_Bool operator!=( const Polygon& rPoly ) const
{ return !(Polygon::operator==( rPoly )); }
sal_Bool IsEqual( const Polygon& rPoly ) const;
@@ -232,7 +232,7 @@ public:
void Write( SvStream& rOStream ) const;
const Point* GetConstPointAry() const;
- const BYTE* GetConstFlagAry() const;
+ const sal_uInt8* GetConstFlagAry() const;
// convert to ::basegfx::B2DPolygon and return
::basegfx::B2DPolygon getB2DPolygon() const;
@@ -252,32 +252,32 @@ private:
ImplPolyPolygon* mpImplPolyPolygon;
- TOOLS_DLLPRIVATE void ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, ULONG nOperation ) const;
+ TOOLS_DLLPRIVATE void ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, sal_uIntPtr nOperation ) const;
TOOLS_DLLPRIVATE void *ImplCreateArtVpath() const;
TOOLS_DLLPRIVATE void ImplSetFromArtVpath( void *pVpath );
public:
- PolyPolygon( USHORT nInitSize = 16, USHORT nResize = 16 );
+ PolyPolygon( sal_uInt16 nInitSize = 16, sal_uInt16 nResize = 16 );
PolyPolygon( const Polygon& rPoly );
- PolyPolygon( USHORT nPoly, const USHORT* pPointCountAry,
+ PolyPolygon( sal_uInt16 nPoly, const sal_uInt16* pPointCountAry,
const Point* pPtAry );
PolyPolygon( const PolyPolygon& rPolyPoly );
~PolyPolygon();
- void Insert( const Polygon& rPoly, USHORT nPos = POLYPOLY_APPEND );
- void Remove( USHORT nPos );
- void Replace( const Polygon& rPoly, USHORT nPos );
- const Polygon& GetObject( USHORT nPos ) const;
+ void Insert( const Polygon& rPoly, sal_uInt16 nPos = POLYPOLY_APPEND );
+ void Remove( sal_uInt16 nPos );
+ void Replace( const Polygon& rPoly, sal_uInt16 nPos );
+ const Polygon& GetObject( sal_uInt16 nPos ) const;
- BOOL IsRect() const;
+ sal_Bool IsRect() const;
void Clear();
- USHORT Count() const;
+ sal_uInt16 Count() const;
Rectangle GetBoundRect() const;
void Clip( const Rectangle& rRect );
- void Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData = NULL );
+ void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
/** Adaptive subdivision of polygons with curves
@@ -308,17 +308,17 @@ public:
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
- void Rotate( const Point& rCenter, USHORT nAngle10 );
+ void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
void SlantX( long nYRef, double fSin, double fCos );
void SlantY( long nXRef, double fSin, double fCos );
void Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect );
- const Polygon& operator[]( USHORT nPos ) const { return GetObject( nPos ); }
- Polygon& operator[]( USHORT nPos );
+ const Polygon& operator[]( sal_uInt16 nPos ) const { return GetObject( nPos ); }
+ Polygon& operator[]( sal_uInt16 nPos );
PolyPolygon& operator=( const PolyPolygon& rPolyPoly );
- BOOL operator==( const PolyPolygon& rPolyPoly ) const;
- BOOL operator!=( const PolyPolygon& rPolyPoly ) const
+ sal_Bool operator==( const PolyPolygon& rPolyPoly ) const;
+ sal_Bool operator!=( const PolyPolygon& rPolyPoly ) const
{ return !(PolyPolygon::operator==( rPolyPoly )); }
sal_Bool IsEqual( const PolyPolygon& rPolyPoly ) const;
diff --git a/tools/inc/tools/postsys.h b/tools/inc/tools/postsys.h
index 9b7fbf729942..c31074c845ed 100644
--- a/tools/inc/tools/postsys.h
+++ b/tools/inc/tools/postsys.h
@@ -34,9 +34,6 @@
#undef PolyPolygon
#undef Polygon
#undef Rectangle
-#undef ULONG
-#undef BYTE
-#undef BOOL
#undef DELETE
/* Hilfe-Ids umbenennen */
@@ -234,9 +231,9 @@
extern "C"
{
-WIN_BOOL WINAPI WIN_Rectangle( HDC hDC, int X1, int Y1, int X2, int Y2 );
-WIN_BOOL WINAPI WIN_Polygon( HDC hDC, CONST POINT * ppt, int ncnt );
-WIN_BOOL WINAPI WIN_PolyPolygon( HDC hDC, CONST POINT * ppt, LPINT npcnt, int ncnt );
+ BOOL WINAPI WIN_Rectangle( HDC hDC, int X1, int Y1, int X2, int Y2 );
+ BOOL WINAPI WIN_Polygon( HDC hDC, CONST POINT * ppt, int ncnt );
+ BOOL WINAPI WIN_PolyPolygon( HDC hDC, CONST POINT * ppt, LPINT npcnt, int ncnt );
}
#endif
diff --git a/tools/inc/tools/presys.h b/tools/inc/tools/presys.h
index fe7cc68d9460..3f71249b7cc5 100644
--- a/tools/inc/tools/presys.h
+++ b/tools/inc/tools/presys.h
@@ -28,15 +28,11 @@
/* nicht geschuetzt, darf nur einmal includet werden */
-// Konflkt mit den Tools-Pair vermeiden
+// Konfl�kt mit den Tools-Pair vermeiden
#define Pair StlPair
#if defined WNT
-#define BOOL WIN_BOOL
-#define BYTE WIN_BYTE
-#define ULONG WIN_ULONG
-
#define Rectangle BLA_Rectangle
#define Polygon BLA_Polygon
#define PolyPolygon BLA_PolyPolygon
diff --git a/tools/inc/tools/prex.h b/tools/inc/tools/prex.h
index bed32750929c..151b0fe46279 100644
--- a/tools/inc/tools/prex.h
+++ b/tools/inc/tools/prex.h
@@ -30,10 +30,6 @@
#define _PREX_H
#define Window XLIB_Window
-#define BYTE XLIB_BYTE
-#define INT8 XLIB_INT8
-#define INT64 XLIB_INT64
-#define BOOL XLIB_BOOL
#define Font XLIB_Font
#define Cursor XLIB_Cursor
#define String XLIB_String
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index a435fc586539..68b4932e1e51 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -49,11 +49,11 @@ typedef void * (*SvCreateInstancePersist)( SvPersistBase ** );
class TOOLS_DLLPUBLIC SvClassManager
{
- typedef boost::unordered_map< USHORT, SvCreateInstancePersist > Map;
+ typedef boost::unordered_map< sal_uInt16, SvCreateInstancePersist > Map;
Map aAssocTable;
public:
- void Register( USHORT nClassId, SvCreateInstancePersist pFunc );
- SvCreateInstancePersist Get( USHORT nClassId );
+ void Register( sal_uInt16 nClassId, SvCreateInstancePersist pFunc );
+ SvCreateInstancePersist Get( sal_uInt16 nClassId );
};
/************************** S v R t t i B a s e **************************/
@@ -68,11 +68,11 @@ SV_DECL_IMPL_REF(SvRttiBase)
/*************************************************************************/
#define SV_DECL_PERSIST( Class, CLASS_ID ) \
TYPEINFO(); \
- static USHORT StaticClassId() { return CLASS_ID; } \
+ static sal_uInt16 StaticClassId() { return CLASS_ID; } \
static void * CreateInstance( SvPersistBase ** ppBase ); \
friend SvPersistStream& operator >> ( SvPersistStream & rStm, \
Class *& rpObj); \
- virtual USHORT GetClassId() const; \
+ virtual sal_uInt16 GetClassId() const; \
virtual void Load( SvPersistStream & ); \
virtual void Save( SvPersistStream & );
@@ -86,7 +86,7 @@ SV_DECL_IMPL_REF(SvRttiBase)
*ppBase = p; \
return p; \
} \
- USHORT Class::GetClassId() const \
+ sal_uInt16 Class::GetClassId() const \
{ return StaticClassId(); } \
SvPersistStream& operator >> (SvPersistStream & rStm, Class *& rpObj)\
{ \
@@ -109,7 +109,7 @@ class SvPersistStream;
class SvPersistBase : public SvRttiBase
{
public:
- virtual USHORT GetClassId() const = 0;
+ virtual sal_uInt16 GetClassId() const = 0;
virtual void Load( SvPersistStream & ) = 0;
virtual void Save( SvPersistStream & ) = 0;
TOOLS_DLLPUBLIC friend SvPersistStream& operator >> ( SvPersistStream & rStm,
@@ -127,9 +127,9 @@ class TOOLS_DLLPUBLIC SvPersistBaseMemberList : public SuperSvPersistBaseMemberL
{
public:
SvPersistBaseMemberList();
- SvPersistBaseMemberList(USHORT nInitSz, USHORT nResize );
+ SvPersistBaseMemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );
- void WriteObjects( SvPersistStream &, BOOL bOnlyStreamedObj = FALSE ) const;
+ void WriteObjects( SvPersistStream &, sal_Bool bOnlyStreamedObj = sal_False ) const;
TOOLS_DLLPUBLIC friend SvPersistStream& operator << (SvPersistStream &, const SvPersistBaseMemberList &);
TOOLS_DLLPUBLIC friend SvPersistStream& operator >> (SvPersistStream &, SvPersistBaseMemberList &);
};
@@ -163,7 +163,7 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream
die im Stream vorkommen k"onnen, ben"otigt. Die Liste aller Klassen
wird in einem <SvClassManager> Objekt gespeichert und dem
SvPersistStream "ubergeben, wenn er erzeugt wird.
- Weiterhin wird die M"oglichkeit geboten UINT32 Werte komprimiert
+ Weiterhin wird die M"oglichkeit geboten sal_uInt32 Werte komprimiert
zu schreiben und zu lesen (<SvPersistStream::WriteCompressed>,
<SvPersistStream::ReadCompressed>).
Es gibt auch die drei Hilfsmethoden <SvPersistStream::WriteDummyLen>,
@@ -194,49 +194,49 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream
SvStream * pStm;
Table aPTable; // Pointer und Key gedreht
SvPersistUIdx aPUIdx;
- ULONG nStartIdx;
+ sal_uIntPtr nStartIdx;
const SvPersistStream * pRefStm;
- UINT32 nFlags;
+ sal_uInt32 nFlags;
- virtual ULONG GetData( void* pData, ULONG nSize );
- virtual ULONG PutData( const void* pData, ULONG nSize );
- virtual ULONG SeekPos( ULONG nPos );
+ virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize );
+ virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize );
+ virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos );
virtual void FlushData();
protected:
- ULONG GetCurMaxIndex( const SvPersistUIdx & ) const;
- ULONG GetCurMaxIndex() const
+ sal_uIntPtr GetCurMaxIndex( const SvPersistUIdx & ) const;
+ sal_uIntPtr GetCurMaxIndex() const
{ return GetCurMaxIndex( aPUIdx ); }
- void WriteObj( BYTE nHdr, SvPersistBase * pObj );
- UINT32 ReadObj( SvPersistBase * & rpObj,
- BOOL bRegister );
+ void WriteObj( sal_uInt8 nHdr, SvPersistBase * pObj );
+ sal_uInt32 ReadObj( SvPersistBase * & rpObj,
+ sal_Bool bRegister );
public:
- BOOL IsStreamed( SvPersistBase * pObj ) const
+ sal_Bool IsStreamed( SvPersistBase * pObj ) const
{ return 0 != GetIndex( pObj ); }
virtual void ResetError();
SvPersistStream( SvClassManager &, SvStream * pStream,
- UINT32 nStartIdx = 1 );
+ sal_uInt32 nStartIdx = 1 );
SvPersistStream( SvClassManager &, SvStream * pStream,
const SvPersistStream & rPersStm );
~SvPersistStream();
void SetStream( SvStream * pStream );
SvStream * GetStream() const { return pStm; }
- virtual USHORT IsA() const;
+ virtual sal_uInt16 IsA() const;
- SvPersistBase * GetObject( ULONG nIdx ) const;
- ULONG GetIndex( SvPersistBase * ) const;
+ SvPersistBase * GetObject( sal_uIntPtr nIdx ) const;
+ sal_uIntPtr GetIndex( SvPersistBase * ) const;
- void SetContextFlags( UINT32 n ) { nFlags = n; }
- UINT32 GetContextFlags() const { return nFlags; }
+ void SetContextFlags( sal_uInt32 n ) { nFlags = n; }
+ sal_uInt32 GetContextFlags() const { return nFlags; }
- static void WriteCompressed( SvStream & rStm, UINT32 nVal );
- static UINT32 ReadCompressed( SvStream & rStm );
+ static void WriteCompressed( SvStream & rStm, sal_uInt32 nVal );
+ static sal_uInt32 ReadCompressed( SvStream & rStm );
- UINT32 WriteDummyLen();
- void WriteLen( UINT32 nLenPos );
- UINT32 ReadLen( UINT32 * pTestPos );
+ sal_uInt32 WriteDummyLen();
+ void WriteLen( sal_uInt32 nLenPos );
+ sal_uInt32 ReadLen( sal_uInt32 * pTestPos );
SvPersistStream& WritePointer( SvPersistBase * pObj );
SvPersistStream& ReadPointer( SvPersistBase * & rpObj );
@@ -247,8 +247,8 @@ public:
// gespeichert werden.
friend SvStream& operator >> ( SvStream &, SvPersistStream & );
friend SvStream& operator << ( SvStream &, SvPersistStream & );
- ULONG InsertObj( SvPersistBase * );
- ULONG RemoveObj( SvPersistBase * );
+ sal_uIntPtr InsertObj( SvPersistBase * );
+ sal_uIntPtr RemoveObj( SvPersistBase * );
};
#endif // _PSTM_HXX
diff --git a/tools/inc/tools/queue.hxx b/tools/inc/tools/queue.hxx
index 233ed20ff8ca..c32880b764d5 100644
--- a/tools/inc/tools/queue.hxx
+++ b/tools/inc/tools/queue.hxx
@@ -46,19 +46,19 @@ public:
using Container::GetObject;
using Container::GetPos;
- Queue( USHORT _nInitSize = 16, USHORT _nReSize = 16 ) :
+ Queue( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) :
Container( _nReSize, _nInitSize, _nReSize ) {}
Queue( const Queue& rQueue ) : Container( rQueue ) {}
void Put( void* p ) { Container::Insert( p, CONTAINER_APPEND ); }
- void* Get() { return Container::Remove( (ULONG)0 ); }
+ void* Get() { return Container::Remove( (sal_uIntPtr)0 ); }
Queue& operator =( const Queue& rQueue )
{ Container::operator =( rQueue ); return *this; }
- BOOL operator ==( const Queue& rQueue ) const
+ sal_Bool operator ==( const Queue& rQueue ) const
{ return Container::operator ==( rQueue ); }
- BOOL operator !=( const Queue& rQueue ) const
+ sal_Bool operator !=( const Queue& rQueue ) const
{ return Container::operator !=( rQueue ); }
};
@@ -73,8 +73,8 @@ public: \
using Queue::Clear; \
using Queue::Count; \
\
- ClassName( USHORT _nInitSize = 16, \
- USHORT _nReSize = 16 ) : \
+ ClassName( sal_uInt16 _nInitSize = 16, \
+ sal_uInt16 _nReSize = 16 ) : \
Queue( _nInitSize, _nReSize ) {} \
ClassName( const ClassName& rClassName ) : \
Queue( rClassName ) {} \
@@ -82,12 +82,12 @@ public: \
void Put( Type p ) { Queue::Put( (void*)p ); } \
Type Get() { return (Type)Queue::Get(); } \
\
- Type GetObject( ULONG nIndex ) const \
+ Type GetObject( sal_uIntPtr nIndex ) const \
{ return (Type)Queue::GetObject( nIndex ); } \
- ULONG GetPos( const Type p ) const \
+ sal_uIntPtr GetPos( const Type p ) const \
{ return Queue::GetPos( (const void*)p ); } \
- ULONG GetPos( const Type p, ULONG nStartIndex, \
- BOOL bForward = TRUE ) const \
+ sal_uIntPtr GetPos( const Type p, sal_uIntPtr nStartIndex, \
+ sal_Bool bForward = sal_True ) const \
{ return Queue::GetPos( (const void*)p, \
nStartIndex, \
bForward ); } \
@@ -96,9 +96,9 @@ public: \
{ Queue::operator =( rClassName ); \
return *this; } \
\
- BOOL operator ==( const Queue& rQueue ) const \
+ sal_Bool operator ==( const Queue& rQueue ) const \
{ return Queue::operator ==( rQueue ); } \
- BOOL operator !=( const Queue& rQueue ) const \
+ sal_Bool operator !=( const Queue& rQueue ) const \
{ return Queue::operator !=( rQueue ); } \
};
diff --git a/tools/inc/tools/rc.h b/tools/inc/tools/rc.h
index dd6ddd8a548a..ce735d6a70e3 100644
--- a/tools/inc/tools/rc.h
+++ b/tools/inc/tools/rc.h
@@ -51,6 +51,7 @@ typedef short RSWND_STYLE;
#define WINDOW_EXTRALONG 0x0800
#define WINDOW_UNIQUEID 0x1000
#define WINDOW_BORDER_STYLE 0x2000
+#define WINDOW_HELPID 0x4000
// Definition der Struktur die alle "WorkWindow"-Resourcen haben
#define WORKWIN_SHOWNORMAL 0
diff --git a/tools/inc/tools/rc.hxx b/tools/inc/tools/rc.hxx
index 1720c96c4680..a6310197e442 100644
--- a/tools/inc/tools/rc.hxx
+++ b/tools/inc/tools/rc.hxx
@@ -43,7 +43,7 @@ class TOOLS_DLLPUBLIC Resource
ResMgr* m_pResMgr;
// check availability of Resource
- BOOL IsAvailableRes( const ResId& rId ) const
+ sal_Bool IsAvailableRes( const ResId& rId ) const
{ return m_pResMgr->IsAvailable( rId, this ); }
// Load a Resource
@@ -57,7 +57,7 @@ class TOOLS_DLLPUBLIC Resource
{ return m_pResMgr->GetClass(); }
// read a string from the resource
- static sal_uInt32 GetStringRes( UniString& rStr, const BYTE* pStr )
+ static sal_uInt32 GetStringRes( UniString& rStr, const sal_uInt8* pStr )
{ return ResMgr::GetString( rStr, pStr ); }
// increase the memory pointer gotten by GetClassRes()
@@ -88,6 +88,9 @@ class TOOLS_DLLPUBLIC Resource
// read a string from resource data and increment pointer
UniString ReadStringRes()
{ return m_pResMgr->ReadString(); }
+ // read a byte string from resource data and increment pointer
+ rtl::OString ReadByteStringRes()
+ { return m_pResMgr->ReadByteString(); }
// Gibt die Resource frei (this-Zeiger fuer Fehlerueberpruefung)
// free the resource from m_pResMgr's stack (pass this ptr for validation)
diff --git a/tools/inc/tools/ref.hxx b/tools/inc/tools/ref.hxx
index e1e20ebe5448..9ef9fd0d1776 100644
--- a/tools/inc/tools/ref.hxx
+++ b/tools/inc/tools/ref.hxx
@@ -73,7 +73,7 @@ public: \
inline ~ClassName##Ref(); \
inline ClassName##Ref & operator = ( const ClassName##Ref & rObj ); \
inline ClassName##Ref & operator = ( ClassName * pObj ); \
- inline BOOL Is() const { return pObj != NULL; } \
+ inline sal_Bool Is() const { return pObj != NULL; } \
inline ClassName * operator & () const { return pObj; } \
inline ClassName * operator -> () const { return pObj; } \
inline ClassName & operator * () const { return *pObj; } \
@@ -101,8 +101,8 @@ PRV_SV_IMPL_REF_COUNTERS( ClassName, Ref, AddRef(), AddNextRef(),\
ReleaseReference(), EMPTYARG, pObj )
#define SV_IMPL_LOCK( ClassName ) \
-PRV_SV_IMPL_REF_COUNTERS( ClassName, Lock, OwnerLock( TRUE ), \
- OwnerLock( TRUE ), OwnerLock( FALSE ), \
+PRV_SV_IMPL_REF_COUNTERS( ClassName, Lock, OwnerLock( sal_True ), \
+ OwnerLock( sal_True ), OwnerLock( sal_False ), \
EMPTYARG, pObj )
#define SV_DECL_IMPL_REF(ClassName) \
@@ -117,7 +117,7 @@ class vis CN##MemberList : public CN##List\
{\
public:\
inline CN##MemberList();\
-inline CN##MemberList(USHORT nInitSz, USHORT nResize );\
+inline CN##MemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );\
inline CN##MemberList( const CN##MemberList & rRef );\
inline ~CN##MemberList();\
inline CN##MemberList & operator =\
@@ -125,17 +125,17 @@ inline CN##MemberList & operator =\
inline void Clear();\
inline void Insert( EN p )\
{ CN##List::Insert( p ); p->AddRef();}\
-inline void Insert( EN p, ULONG nIndex )\
+inline void Insert( EN p, sal_uIntPtr nIndex )\
{ CN##List::Insert( p, nIndex ); p->AddRef();}\
inline void Insert( EN p, EN pOld )\
{ CN##List::Insert( p, pOld ); p->AddRef();}\
inline void Append( EN p )\
{ Insert( p, LIST_APPEND );}\
inline EN Remove();\
-inline EN Remove( ULONG nIndex );\
+inline EN Remove( sal_uIntPtr nIndex );\
inline EN Remove( EN p );\
inline EN Replace( EN p );\
-inline EN Replace( EN p, ULONG nIndex );\
+inline EN Replace( EN p, sal_uIntPtr nIndex );\
inline EN Replace( EN pNew, EN pOld );\
inline void Append( const CN##MemberList & );\
};
@@ -149,12 +149,12 @@ PRV_SV_DECL_REF_LIST(CN,EN,vis)
/************************** S v R e f L i s t ****************************/
#define SV_IMPL_REF_LIST( CN, EN ) \
inline CN##MemberList::CN##MemberList(){}\
-inline CN##MemberList::CN##MemberList(USHORT nInitSz, USHORT nResize )\
+inline CN##MemberList::CN##MemberList(sal_uInt16 nInitSz, sal_uInt16 nResize )\
: CN##List( nInitSz, nResize ){}\
inline CN##MemberList::CN##MemberList( const CN##MemberList & rRef ) \
: CN##List( rRef ) \
{\
- ULONG nOldCount = Count(); \
+ sal_uIntPtr nOldCount = Count(); \
EN pEntry = First(); \
while( pEntry ) \
{ pEntry->AddRef(); pEntry = Next(); } \
@@ -165,7 +165,7 @@ inline CN##MemberList & CN##MemberList::operator = \
( const CN##MemberList & rRef ) \
{\
CN##MemberList & rList = (CN##MemberList &)rRef; \
- ULONG nOldCount = rList.Count(); \
+ sal_uIntPtr nOldCount = rList.Count(); \
/* Count der Objekte erhoehen */ \
EN pEntry = rList.First(); \
while( pEntry ) \
@@ -187,7 +187,7 @@ inline EN CN##MemberList::Remove() \
EN p = CN##List::Remove(); \
if( p ) p->ReleaseReference(); return p; \
}\
-inline EN CN##MemberList::Remove( ULONG nIndex ) \
+inline EN CN##MemberList::Remove( sal_uIntPtr nIndex ) \
{\
EN p = CN##List::Remove( nIndex ); \
if( p ) p->ReleaseReference(); return p; \
@@ -202,7 +202,7 @@ inline EN CN##MemberList::Replace( EN p ) \
p->AddRef(); p = CN##List::Replace( p ); \
if( p ) p->ReleaseReference(); return p; \
}\
-inline EN CN##MemberList::Replace( EN p, ULONG nIndex ) \
+inline EN CN##MemberList::Replace( EN p, sal_uIntPtr nIndex ) \
{\
p->AddRef(); p = CN##List::Replace( p, nIndex ); \
if( p ) p->ReleaseReference(); return p; \
@@ -214,7 +214,7 @@ inline EN CN##MemberList::Replace( EN pNew, EN pOld ) \
}\
inline void CN##MemberList::Append( const CN##MemberList & rList )\
{\
- for( ULONG i = 0; i < rList.Count(); i++ )\
+ for( sal_uIntPtr i = 0; i < rList.Count(); i++ )\
Append( rList.GetObject( i ) );\
}
@@ -226,23 +226,23 @@ inline void CN##MemberList::Append( const CN##MemberList & rList )\
/************************** S v M e m b e r L i s t **********************/
#define PRV_SV_DECL_MEMBER_LIST(Class,EntryName) \
Class##MemberList() {} \
-inline Class##MemberList(USHORT nInitSz,USHORT nResize);\
+inline Class##MemberList(sal_uInt16 nInitSz,sal_uInt16 nResize);\
inline void Insert( EntryName p ); \
-inline void Insert( EntryName p, ULONG nIndex ); \
+inline void Insert( EntryName p, sal_uIntPtr nIndex ); \
inline void Insert( EntryName p, EntryName pOld ); \
inline void Append( EntryName p ); \
inline EntryName Remove(); \
-inline EntryName Remove( ULONG nIndex ); \
+inline EntryName Remove( sal_uIntPtr nIndex ); \
inline EntryName Remove( EntryName p ); \
inline EntryName Replace( EntryName p ); \
-inline EntryName Replace( EntryName p, ULONG nIndex );\
+inline EntryName Replace( EntryName p, sal_uIntPtr nIndex );\
inline EntryName Replace( EntryName pNew, EntryName pOld );\
inline EntryName GetCurObject() const;\
-inline EntryName GetObject( ULONG nIndex ) const;\
-inline ULONG GetPos( const EntryName ) const;\
-inline ULONG GetPos( const EntryName, ULONG nStartIndex,\
- BOOL bForward = TRUE ) const;\
-inline EntryName Seek( ULONG nIndex );\
+inline EntryName GetObject( sal_uIntPtr nIndex ) const;\
+inline sal_uIntPtr GetPos( const EntryName ) const;\
+inline sal_uIntPtr GetPos( const EntryName, sal_uIntPtr nStartIndex,\
+ sal_Bool bForward = sal_True ) const;\
+inline EntryName Seek( sal_uIntPtr nIndex );\
inline EntryName Seek( EntryName p );\
inline EntryName First();\
inline EntryName Last();\
@@ -252,11 +252,11 @@ inline void Append( const Class##MemberList & rList );
#define PRV_SV_IMPL_MEMBER_LIST(ClassName,EntryName,BaseList)\
inline ClassName##MemberList::ClassName##MemberList\
- (USHORT nInitSz,USHORT nResize)\
+ (sal_uInt16 nInitSz,sal_uInt16 nResize)\
: BaseList( nInitSz, nResize ){}\
inline void ClassName##MemberList::Insert( EntryName p )\
{BaseList::Insert(p);}\
-inline void ClassName##MemberList::Insert( EntryName p, ULONG nIdx )\
+inline void ClassName##MemberList::Insert( EntryName p, sal_uIntPtr nIdx )\
{BaseList::Insert(p,nIdx);}\
inline void ClassName##MemberList::Insert( EntryName p, EntryName pOld )\
{BaseList::Insert(p,pOld);}\
@@ -264,21 +264,21 @@ inline void ClassName##MemberList::Append( EntryName p )\
{BaseList::Append(p);}\
inline EntryName ClassName##MemberList::Remove()\
{return (EntryName)BaseList::Remove();}\
-inline EntryName ClassName##MemberList::Remove( ULONG nIdx )\
+inline EntryName ClassName##MemberList::Remove( sal_uIntPtr nIdx )\
{return (EntryName)BaseList::Remove(nIdx);}\
inline EntryName ClassName##MemberList::Remove( EntryName p )\
{return (EntryName)BaseList::Remove(p);}\
inline EntryName ClassName##MemberList::Replace( EntryName p )\
{return (EntryName)BaseList::Replace(p);}\
-inline EntryName ClassName##MemberList::Replace( EntryName p, ULONG nIdx )\
+inline EntryName ClassName##MemberList::Replace( EntryName p, sal_uIntPtr nIdx )\
{return (EntryName)BaseList::Replace(p,nIdx);}\
inline EntryName ClassName##MemberList::Replace( EntryName p, EntryName pOld )\
{return (EntryName)BaseList::Replace(p,pOld);}\
inline EntryName ClassName##MemberList::GetCurObject() const\
{return (EntryName)BaseList::GetCurObject();}\
-inline EntryName ClassName##MemberList::GetObject( ULONG nIdx ) const\
+inline EntryName ClassName##MemberList::GetObject( sal_uIntPtr nIdx ) const\
{return (EntryName)BaseList::GetObject( nIdx );}\
-inline EntryName ClassName##MemberList::Seek( ULONG nIdx )\
+inline EntryName ClassName##MemberList::Seek( sal_uIntPtr nIdx )\
{return (EntryName)BaseList::Seek( nIdx );}\
inline EntryName ClassName##MemberList::Seek( EntryName p )\
{return (EntryName)BaseList::Seek( p );}\
@@ -292,10 +292,10 @@ inline EntryName ClassName##MemberList::Prev()\
{return (EntryName)BaseList::Prev();}\
inline void ClassName##MemberList::Append( const ClassName##MemberList & rList )\
{BaseList::Append(rList);}\
-inline ULONG ClassName##MemberList::GetPos( const EntryName p) const\
+inline sal_uIntPtr ClassName##MemberList::GetPos( const EntryName p) const\
{return BaseList::GetPos( p );}\
-inline ULONG ClassName##MemberList::GetPos\
- ( const EntryName p, ULONG nStart, BOOL bForward ) const\
+inline sal_uIntPtr ClassName##MemberList::GetPos\
+ ( const EntryName p, sal_uIntPtr nStart, sal_Bool bForward ) const\
{return BaseList::GetPos( p, nStart, bForward );}
#define SV_DECL_MEMBER_LIST(ClassName,EntryName)\
@@ -309,7 +309,7 @@ public:\
#define SV_NO_DELETE_REFCOUNT 0x80000000
class TOOLS_DLLPUBLIC SvRefBase
{
- UINT32 nRefCount;
+ sal_uIntPtr nRefCount;
#if defined (GCC) && (defined (C281) || defined (C290) || defined (C291))
public:
#else
@@ -328,9 +328,9 @@ public:
if( nRefCount < SV_NO_DELETE_REFCOUNT )
nRefCount += SV_NO_DELETE_REFCOUNT;
}
- UINT32 AddMulRef( UINT32 n ) { return nRefCount += n; }
- UINT32 AddNextRef() { return ++nRefCount; }
- UINT32 AddRef()
+ sal_uIntPtr AddMulRef( sal_uIntPtr n ) { return nRefCount += n; }
+ sal_uIntPtr AddNextRef() { return ++nRefCount; }
+ sal_uIntPtr AddRef()
{
if( nRefCount >= SV_NO_DELETE_REFCOUNT )
nRefCount -= SV_NO_DELETE_REFCOUNT;
@@ -341,14 +341,14 @@ public:
if( !--nRefCount )
QueryDelete();
}
- UINT32 ReleaseRef()
+ sal_uIntPtr ReleaseRef()
{
- UINT32 n = --nRefCount;
+ sal_uIntPtr n = --nRefCount;
if( !n )
QueryDelete();
return n;
}
- UINT32 GetRefCount() const { return nRefCount; }
+ sal_uIntPtr GetRefCount() const { return nRefCount; }
};
#ifndef EMPTYARG
@@ -419,7 +419,7 @@ public: \
inline void Clear() { _xHdl.Clear(); } \
inline ClassName##Weak& operator = ( ClassName * pObj ) { \
_xHdl = pObj ? pObj->GetHdl() : 0; return *this; } \
- inline BOOL Is() const { \
+ inline sal_Bool Is() const { \
return _xHdl.Is() && _xHdl->GetObj(); } \
inline ClassName * operator & () const { \
return (ClassName*) ( _xHdl.Is() ? _xHdl->GetObj() : 0 ); } \
diff --git a/tools/inc/tools/resid.hxx b/tools/inc/tools/resid.hxx
index 96109dad338e..99d0bc45b022 100644
--- a/tools/inc/tools/resid.hxx
+++ b/tools/inc/tools/resid.hxx
@@ -81,7 +81,7 @@ class ResId
ImplInit( nId, rMgr, NULL );
}
// backwards compatibility; avoid ambiguities
- ResId( USHORT nId, ResMgr& rMgr )
+ ResId( sal_uInt16 nId, ResMgr& rMgr )
{
ImplInit( sal_uInt32(nId), rMgr, NULL );
}
@@ -149,7 +149,7 @@ class ResId
return *this;
}
- const ResId & SetAutoRelease(BOOL bRelease) const
+ const ResId & SetAutoRelease(sal_Bool bRelease) const
{
if( bRelease )
m_nResId &= ~RSC_DONTRELEASE;
@@ -158,7 +158,7 @@ class ResId
return *this;
}
- BOOL IsAutoRelease() const
+ sal_Bool IsAutoRelease() const
{ return !(m_nResId & RSC_DONTRELEASE); }
sal_uInt32 GetId() const { return m_nResId & ~RSC_DONTRELEASE; }
diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx
index 26d52bebbdb4..72f8d8d2827e 100644
--- a/tools/inc/tools/resmgr.hxx
+++ b/tools/inc/tools/resmgr.hxx
@@ -139,7 +139,7 @@ private:
// the next two methods are needed to prevent the string hook called
// with the res mgr mutex locked
// like GetString, but doesn't call the string hook
- TOOLS_DLLPRIVATE static sal_uInt32 GetStringWithoutHook( UniString& rStr, const BYTE* pStr );
+ TOOLS_DLLPRIVATE static sal_uInt32 GetStringWithoutHook( UniString& rStr, const sal_uInt8* pStr );
// like ReadString but doesn't call the string hook
TOOLS_DLLPRIVATE UniString ReadStringWithoutHook();
@@ -154,7 +154,7 @@ public:
~ResMgr();
// Sprachabhaengige Ressource Library
- static const sal_Char* GetLang( LanguageType& eLanguage, USHORT nPrio = 0 ); //depricated! see "tools/source/rc/resmgr.cxx"
+ static const sal_Char* GetLang( LanguageType& eLanguage, sal_uInt16 nPrio = 0 ); //depricated! see "tools/source/rc/resmgr.cxx"
static ResMgr* SearchCreateResMgr( const sal_Char* pPrefixName,
com::sun::star::lang::Locale& rLocale );
static ResMgr* CreateResMgr( const sal_Char* pPrefixName,
@@ -166,11 +166,11 @@ public:
void TestStack( const Resource * );
// ist Resource verfuegbar
- BOOL IsAvailable( const ResId& rId,
+ sal_Bool IsAvailable( const ResId& rId,
const Resource* = NULL) const;
// Resource suchen und laden
- BOOL GetResource( const ResId& rId, const Resource * = NULL );
+ sal_Bool GetResource( const ResId& rId, const Resource * = NULL );
static void * GetResourceSkipHeader( const ResId& rResId, ResMgr ** ppResMgr );
// Kontext freigeben
void PopContext( const Resource* = NULL );
@@ -182,20 +182,22 @@ public:
static sal_uInt32 GetObjSize( RSHEADER_TYPE* pHT )
{ return( pHT->GetGlobOff() ); }
- // Liefert einen String aus der Resource
- static sal_uInt32 GetString( UniString& rStr, const BYTE* pStr );
+ // returns a string and its length out of the resource
+ static sal_uInt32 GetString( UniString& rStr, const sal_uInt8* pStr );
+ // returns a byte string and its length out of the resource
+ static sal_uInt32 GetByteString( rtl::OString& rStr, const sal_uInt8* pStr );
// Groesse eines Strings in der Resource
static sal_uInt32 GetStringSize( sal_uInt32 nLen )
{ nLen++; return (nLen + nLen%2); }
- static sal_uInt32 GetStringSize( const BYTE* pStr );
+ static sal_uInt32 GetStringSize( const sal_uInt8* pStr, sal_uInt32& nLen );
// return a int64
static sal_uInt64 GetUInt64( void* pDatum );
// Gibt einen long zurueck
- static INT32 GetLong( void * pLong );
+ static sal_Int32 GetLong( void * pLong );
// return a short
- static INT16 GetShort( void * pShort );
+ static sal_Int16 GetShort( void * pShort );
// Gibt einen Zeiger auf die Resource zurueck
void * GetClass();
@@ -207,12 +209,13 @@ public:
const rtl::OUString&GetFileName() const;
- INT16 ReadShort();
- INT32 ReadLong();
+ sal_Int16 ReadShort();
+ sal_Int32 ReadLong();
UniString ReadString();
+ rtl::OString ReadByteString();
- // generate auto help id for current resource stack
- ULONG GetAutoHelpId();
+ // generate auto help id for current resource stack
+ rtl::OString GetAutoHelpId();
static void SetReadStringHook( ResHookProc pProc );
static ResHookProc GetReadStringHook();
diff --git a/tools/inc/tools/rtti.hxx b/tools/inc/tools/rtti.hxx
index 98e9152502a3..34f14c59f747 100644
--- a/tools/inc/tools/rtti.hxx
+++ b/tools/inc/tools/rtti.hxx
@@ -39,25 +39,25 @@ typedef void* (*TypeId)();
#define TYPEINFO() \
static void* CreateType(); \
static TypeId StaticType(); \
- static BOOL IsOf( TypeId aSameOrSuperType ); \
+ static sal_Bool IsOf( TypeId aSameOrSuperType ); \
virtual TypeId Type() const; \
- virtual BOOL IsA( TypeId aSameOrSuperType ) const
+ virtual sal_Bool IsA( TypeId aSameOrSuperType ) const
#define TYPEINFO_VISIBILITY(visibility) \
visibility static void* CreateType(); \
visibility static TypeId StaticType(); \
- visibility static BOOL IsOf( TypeId aSameOrSuperType ); \
+ visibility static sal_Bool IsOf( TypeId aSameOrSuperType ); \
visibility virtual TypeId Type() const; \
- visibility virtual BOOL IsA( TypeId aSameOrSuperType ) const
+ visibility virtual sal_Bool IsA( TypeId aSameOrSuperType ) const
#define TYPEINIT_FACTORY(sType, Factory ) \
void* sType::CreateType() { return Factory; } \
TypeId sType::StaticType() { return &CreateType; } \
TypeId sType::Type() const { return &CreateType; } \
- BOOL sType::IsOf( TypeId aSameOrSuperType ) \
+ sal_Bool sType::IsOf( TypeId aSameOrSuperType ) \
{ \
if ( aSameOrSuperType == StaticType() ) \
- return TRUE
+ return sal_True
#define STATICTYPE(sType) (sType::StaticType())
@@ -68,12 +68,12 @@ typedef void* (*TypeId)();
#define SUPERTYPE(sSuper) \
if ( sSuper::IsOf(aSameOrSuperType ) ) \
- return TRUE
+ return sal_True
#define TYPEINIT_END(sType) \
- return FALSE; \
+ return sal_False; \
} \
- BOOL sType::IsA( TypeId aSameOrSuperType ) const \
+ sal_Bool sType::IsA( TypeId aSameOrSuperType ) const \
{ return IsOf( aSameOrSuperType ); }
#define TYPEINIT0_FACTORY(sType, Factory) \
@@ -122,16 +122,16 @@ typedef void* (*TypeId)();
#define TYPEINFO_ID(id) \
static TypeId StaticType() { return (TypeId) ( id | 0xF000000L ); } \
- static BOOL IsOf( TypeId aSameOrSuperType ); \
+ static sal_Bool IsOf( TypeId aSameOrSuperType ); \
virtual TypeId Type() const; \
- virtual BOOL IsA( TypeId aSameOrSuperType ) const
+ virtual sal_Bool IsA( TypeId aSameOrSuperType ) const
#define TYPEINIT_ID(sType) \
TypeId sType::Type() const { return StaticType(); } \
- BOOL sType::IsOf( TypeId aSameOrSuperType ) \
+ sal_Bool sType::IsOf( TypeId aSameOrSuperType ) \
{ \
if ( aSameOrSuperType == StaticType() ) \
- return TRUE
+ return sal_True
#define TYPEINIT0_ID(sType) \
TYPEINIT_ID(sType); \
diff --git a/tools/inc/tools/shl.hxx b/tools/inc/tools/shl.hxx
index 4a77b1d5d14f..0abf98c25c45 100644
--- a/tools/inc/tools/shl.hxx
+++ b/tools/inc/tools/shl.hxx
@@ -110,7 +110,7 @@
#define SHL_COUNT 64
-TOOLS_DLLPUBLIC void** GetAppData( USHORT nSharedLib );
+TOOLS_DLLPUBLIC void** GetAppData( sal_uInt16 nSharedLib );
#endif // _SHL_HXX
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 09ad054a8257..a68d32ef588a 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -35,56 +35,24 @@
/*** common solar defines ***********************************/
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
#ifdef _SOLAR__PRIVATE
#undef _SOLAR__PRIVATE
#endif
#define _SOLAR__PRIVATE 1
#define __REFERENCED 0
-/*** common solar types ********************************************/
-/* NOTE: these types are deprecated, or soon will be. They should */
-/* not be used in new code, and should be replaced with their */
-/* corresponding types from sal/types.h in old code when possible. */
-/* Previous typedefs from before sal convergence are in comments */
-/* to the right of the new types. */
-
-typedef sal_Bool BOOL; /* typedef unsigned char BOOL; */
-typedef sal_uInt8 BYTE; /* typedef unsigned char BYTE; */
-typedef sal_uInt16 USHORT; /* typedef unsigned short USHORT; */
-typedef sal_uIntPtr ULONG; /* typedef unsigned long ULONG; */
-
-#if !defined(VCL_NEED_BASETSD) || defined(__MINGW32__)
-#ifndef _SOLAR_NOUINT
-typedef sal_Int16 INT16; /* typedef short INT16; */
-typedef sal_uInt16 UINT16; /* typedef unsigned short UINT16; */
-#if defined(SAL_W32)
-typedef sal_sChar INT8;
-#else
-typedef sal_Char INT8; /* typedef char INT8; */
-#endif
-typedef sal_uInt8 UINT8; /* typedef unsigned char UINT8; */
-#endif /* _SOLAR_NOUINT */
-#endif
-
-#ifndef VCL_NEED_BASETSD
-#ifndef _SOLAR_NOUINT
-/* types with exact defined size (not just the minimum size) */
-typedef sal_Int64 INT64; /* typedef long INT64; previously "void" on Windows */
-typedef sal_uInt64 UINT64; /* typedef unsigned long UINT64; previously "void" on Windows */
-typedef sal_Int32 INT32; /* typedef int INT32; previously "long" on Windows */
-typedef sal_uInt32 UINT32; /* typedef unsigned int UINT32; previously "unsigned long" on Windows */
-#endif /* _SOLAR_NOUINT */
-#endif
+/************************************************************
+ Intermediate type to solve type clash with Windows headers.
+ Should be removed as soon as all code parts have been reviewed
+ and the correct type is known. Most of the times ULONG is meant
+ to be a 32-Bit unsigned integer type as sal_uInt32 is often
+ used for data exchange or for similiar method args.
+*************************************************************/
+typedef sal_uIntPtr sal_uLong; /* Replaces type ULONG */
/*** misc. macros to leverage platform and compiler differences ********/
+typedef int FASTBOOL;
#define DELETEZ( p ) ( delete p,p = 0 )
#ifdef WNT
@@ -110,69 +78,69 @@ typedef sal_uInt32 UINT32; /* typedef unsigned int UINT32; previousl
always little endian;
not necessarily aligned */
-typedef BYTE SVBT8[1];
-typedef BYTE SVBT16[2];
-typedef BYTE SVBT32[4];
-typedef BYTE SVBT64[8];
+typedef sal_uInt8 SVBT8[1];
+typedef sal_uInt8 SVBT16[2];
+typedef sal_uInt8 SVBT32[4];
+typedef sal_uInt8 SVBT64[8];
#ifdef __cplusplus
-inline BYTE SVBT8ToByte ( const SVBT8 p ) { return p[0]; }
-inline USHORT SVBT16ToShort( const SVBT16 p ) { return (USHORT)p[0]
- + ((USHORT)p[1] << 8); }
+inline sal_uInt8 SVBT8ToByte ( const SVBT8 p ) { return p[0]; }
+inline sal_uInt16 SVBT16ToShort( const SVBT16 p ) { return (sal_uInt16)p[0]
+ + ((sal_uInt16)p[1] << 8); }
inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return (sal_uInt32)p[0]
+ ((sal_uInt32)p[1] << 8)
+ ((sal_uInt32)p[2] << 16)
+ ((sal_uInt32)p[3] << 24); }
#if defined OSL_LITENDIAN
inline double SVBT64ToDouble( const SVBT64 p ) { double n;
- ((BYTE*)&n)[0] = p[0];
- ((BYTE*)&n)[1] = p[1];
- ((BYTE*)&n)[2] = p[2];
- ((BYTE*)&n)[3] = p[3];
- ((BYTE*)&n)[4] = p[4];
- ((BYTE*)&n)[5] = p[5];
- ((BYTE*)&n)[6] = p[6];
- ((BYTE*)&n)[7] = p[7];
+ ((sal_uInt8*)&n)[0] = p[0];
+ ((sal_uInt8*)&n)[1] = p[1];
+ ((sal_uInt8*)&n)[2] = p[2];
+ ((sal_uInt8*)&n)[3] = p[3];
+ ((sal_uInt8*)&n)[4] = p[4];
+ ((sal_uInt8*)&n)[5] = p[5];
+ ((sal_uInt8*)&n)[6] = p[6];
+ ((sal_uInt8*)&n)[7] = p[7];
return n; }
#else
inline double SVBT64ToDouble( const SVBT64 p ) { double n;
- ((BYTE*)&n)[0] = p[7];
- ((BYTE*)&n)[1] = p[6];
- ((BYTE*)&n)[2] = p[5];
- ((BYTE*)&n)[3] = p[4];
- ((BYTE*)&n)[4] = p[3];
- ((BYTE*)&n)[5] = p[2];
- ((BYTE*)&n)[6] = p[1];
- ((BYTE*)&n)[7] = p[0];
+ ((sal_uInt8*)&n)[0] = p[7];
+ ((sal_uInt8*)&n)[1] = p[6];
+ ((sal_uInt8*)&n)[2] = p[5];
+ ((sal_uInt8*)&n)[3] = p[4];
+ ((sal_uInt8*)&n)[4] = p[3];
+ ((sal_uInt8*)&n)[5] = p[2];
+ ((sal_uInt8*)&n)[6] = p[1];
+ ((sal_uInt8*)&n)[7] = p[0];
return n; }
#endif
-inline void ByteToSVBT8 ( BYTE n, SVBT8 p ) { p[0] = n; }
-inline void ShortToSVBT16( USHORT n, SVBT16 p ) { p[0] = (BYTE) n;
- p[1] = (BYTE)(n >> 8); }
-inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p ) { p[0] = (BYTE) n;
- p[1] = (BYTE)(n >> 8);
- p[2] = (BYTE)(n >> 16);
- p[3] = (BYTE)(n >> 24); }
+inline void ByteToSVBT8 ( sal_uInt8 n, SVBT8 p ) { p[0] = n; }
+inline void ShortToSVBT16( sal_uInt16 n, SVBT16 p ) { p[0] = (sal_uInt8) n;
+ p[1] = (sal_uInt8)(n >> 8); }
+inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p ) { p[0] = (sal_uInt8) n;
+ p[1] = (sal_uInt8)(n >> 8);
+ p[2] = (sal_uInt8)(n >> 16);
+ p[3] = (sal_uInt8)(n >> 24); }
#if defined OSL_LITENDIAN
-inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((BYTE*)&n)[0];
- p[1] = ((BYTE*)&n)[1];
- p[2] = ((BYTE*)&n)[2];
- p[3] = ((BYTE*)&n)[3];
- p[4] = ((BYTE*)&n)[4];
- p[5] = ((BYTE*)&n)[5];
- p[6] = ((BYTE*)&n)[6];
- p[7] = ((BYTE*)&n)[7]; }
+inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[0];
+ p[1] = ((sal_uInt8*)&n)[1];
+ p[2] = ((sal_uInt8*)&n)[2];
+ p[3] = ((sal_uInt8*)&n)[3];
+ p[4] = ((sal_uInt8*)&n)[4];
+ p[5] = ((sal_uInt8*)&n)[5];
+ p[6] = ((sal_uInt8*)&n)[6];
+ p[7] = ((sal_uInt8*)&n)[7]; }
#else
-inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((BYTE*)&n)[7];
- p[1] = ((BYTE*)&n)[6];
- p[2] = ((BYTE*)&n)[5];
- p[3] = ((BYTE*)&n)[4];
- p[4] = ((BYTE*)&n)[3];
- p[5] = ((BYTE*)&n)[2];
- p[6] = ((BYTE*)&n)[1];
- p[7] = ((BYTE*)&n)[0]; }
+inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[7];
+ p[1] = ((sal_uInt8*)&n)[6];
+ p[2] = ((sal_uInt8*)&n)[5];
+ p[3] = ((sal_uInt8*)&n)[4];
+ p[4] = ((sal_uInt8*)&n)[3];
+ p[5] = ((sal_uInt8*)&n)[2];
+ p[6] = ((sal_uInt8*)&n)[1];
+ p[7] = ((sal_uInt8*)&n)[0]; }
#endif
#endif
#endif
@@ -343,7 +311,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
// -----------------------------------------------------------------------
-#define NOOLDSTRING
#ifndef NOREPLACESTRING
#define UniString String
#define XubString String
@@ -355,7 +322,7 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
#ifdef STRING32
#define xub_StrLen sal_uInt32
#else
-#define xub_StrLen USHORT
+#define xub_StrLen sal_uInt16
#endif
// -- moved here from libcall.hxx ----------------------------------------
@@ -369,7 +336,7 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
#define LIBRARY_CONCAT4( s1, s2, s3, s4 ) \
s1 s2 s3 s4
-#if defined WIN || defined WNT || defined OS2
+#if defined WNT || defined OS2
#define SVLIBRARY( Base ) \
LIBRARY_CONCAT3( Base, __DLLEXTENSION, ".DLL" )
#define SVLIBRARYLANG( Base, Lang ) \
diff --git a/tools/inc/tools/stack.hxx b/tools/inc/tools/stack.hxx
index 2794c554f8d3..d3c76d1a0165 100644
--- a/tools/inc/tools/stack.hxx
+++ b/tools/inc/tools/stack.hxx
@@ -45,7 +45,7 @@ public:
using Container::GetObject;
using Container::GetPos;
- Stack( USHORT _nInitSize = 16, USHORT _nReSize = 16 ) :
+ Stack( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) :
Container( CONTAINER_MAXBLOCKSIZE, _nInitSize, _nReSize ) {}
Stack( const Stack& rStack ) : Container( rStack ) {}
@@ -56,9 +56,9 @@ public:
Stack& operator =( const Stack& rStack )
{ Container::operator =( rStack ); return *this; }
- BOOL operator ==( const Stack& rStack ) const
+ sal_Bool operator ==( const Stack& rStack ) const
{ return Container::operator ==( rStack ); }
- BOOL operator !=( const Stack& rStack ) const
+ sal_Bool operator !=( const Stack& rStack ) const
{ return Container::operator !=( rStack ); }
};
@@ -73,8 +73,8 @@ public: \
using Stack::Clear; \
using Stack::Count; \
\
- ClassName( USHORT _nInitSize = 16, \
- USHORT _nReSize = 16 ) : \
+ ClassName( sal_uInt16 _nInitSize = 16, \
+ sal_uInt16 _nReSize = 16 ) : \
Stack( _nInitSize, _nReSize ) {} \
ClassName( const ClassName& rClassName ) : \
Stack( rClassName ) {} \
@@ -83,12 +83,12 @@ public: \
Type Pop() { return (Type)Stack::Pop(); } \
Type Top() const { return (Type)Stack::Top(); } \
\
- Type GetObject( ULONG nIndex ) const \
+ Type GetObject( sal_uIntPtr nIndex ) const \
{ return (Type)Stack::GetObject( nIndex ); } \
- ULONG GetPos( const Type p ) const \
+ sal_uIntPtr GetPos( const Type p ) const \
{ return Stack::GetPos( (const void*)p ); } \
- ULONG GetPos( const Type p, ULONG nStartIndex, \
- BOOL bForward = TRUE ) const \
+ sal_uIntPtr GetPos( const Type p, sal_uIntPtr nStartIndex, \
+ sal_Bool bForward = sal_True ) const \
{ return Stack::GetPos( (const void*)p, \
nStartIndex, \
bForward ); } \
@@ -97,9 +97,9 @@ public: \
{ Stack::operator =( rClassName ); \
return *this; } \
\
- BOOL operator ==( const ClassName& rStack ) const \
+ sal_Bool operator ==( const ClassName& rStack ) const \
{ return Stack::operator ==( rStack ); } \
- BOOL operator !=( const ClassName& rStack ) const \
+ sal_Bool operator !=( const ClassName& rStack ) const \
{ return Stack::operator !=( rStack ); } \
};
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index dc34cdc2d96c..d86df43ce93c 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -141,16 +141,16 @@ protected:
public:
TYPEINFO();
- SvLockBytes(): m_pStream(0), m_bOwner(FALSE), m_bSync(FALSE) {}
+ SvLockBytes(): m_pStream(0), m_bOwner(sal_False), m_bSync(sal_False) {}
- SvLockBytes(SvStream * pTheStream, sal_Bool bTheOwner = FALSE):
- m_pStream(pTheStream), m_bOwner(bTheOwner), m_bSync(FALSE) {}
+ SvLockBytes(SvStream * pTheStream, sal_Bool bTheOwner = sal_False):
+ m_pStream(pTheStream), m_bOwner(bTheOwner), m_bSync(sal_False) {}
virtual ~SvLockBytes() { close(); }
virtual const SvStream * GetStream() const { return m_pStream; }
- virtual void SetSynchronMode(sal_Bool bTheSync = TRUE) { m_bSync = bTheSync; }
+ virtual void SetSynchronMode(sal_Bool bTheSync = sal_True) { m_bSync = bTheSync; }
virtual sal_Bool IsSynchronMode() const { return m_bSync; }
@@ -182,7 +182,7 @@ class TOOLS_DLLPUBLIC SvOpenLockBytes: public SvLockBytes
public:
TYPEINFO();
- SvOpenLockBytes(): SvLockBytes(0, FALSE) {}
+ SvOpenLockBytes(): SvLockBytes(0, sal_False) {}
SvOpenLockBytes(SvStream * pStream, sal_Bool bOwner):
SvLockBytes(pStream, bOwner) {}
@@ -212,7 +212,7 @@ public:
TYPEINFO();
SvAsyncLockBytes(SvStream * pStream, sal_Bool bOwner):
- SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(FALSE) {}
+ SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(sal_False) {}
virtual ErrCode ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
sal_Size * pRead) const;
@@ -227,7 +227,7 @@ public:
virtual sal_Size Seek(sal_Size nPos);
- virtual void Terminate() { m_bTerminated = TRUE; }
+ virtual void Terminate() { m_bTerminated = sal_True; }
};
SV_DECL_IMPL_REF(SvAsyncLockBytes);
@@ -256,8 +256,8 @@ private:
unsigned int eIOMode:2; // STREAM_IO_*
// Error-Codes, Konvertierung, Komprimierung, ...
- int bIsDirty:1; // TRUE: Stream != Pufferinhalt
- int bIsConsistent:1;// FALSE: Buffer enthaelt Daten, die NICHT
+ int bIsDirty:1; // sal_True: Stream != Pufferinhalt
+ int bIsConsistent:1;// sal_False: Buffer enthaelt Daten, die NICHT
// per PutData in den abgeleiteten Stream
// geschrieben werden duerfen (siehe PutBack)
int bSwap:1;
@@ -461,9 +461,20 @@ public:
/// Switch to no endian swapping and write 0xfeff
sal_Bool StartWritingUnicodeText();
- /// Read 16bit, if 0xfeff do nothing, if 0xfffe switch
- /// endian swapping, if none of them put back
- sal_Bool StartReadingUnicodeText();
+
+ /** If eReadBomCharSet==RTL_TEXTENCODING_DONTKNOW: read 16bit,
+ if 0xfeff do nothing (UTF-16), if 0xfffe switch endian
+ swapping (UTF-16), if 0xefbb or 0xbbef read another byte
+ and check for UTF-8. If no UTF-* BOM was detected put all
+ read bytes back. This means that if 2 bytes were read it
+ was an UTF-16 BOM, if 3 bytes were read it was an UTF-8
+ BOM. There is no UTF-7, UTF-32 or UTF-EBCDIC BOM detection!
+
+ If eReadBomCharSet!=RTL_TEXTENCODING_DONTKNOW: only read a
+ BOM of that encoding and switch endian swapping if UTF-16
+ and 0xfffe.
+ */
+ sal_Bool StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet );
/// Read a line of Unicode
sal_Bool ReadUniStringLine( String& rStr );
@@ -649,7 +660,7 @@ inline SvStream& SvStream::ReadNumber( int& rInt )
/*
inline SvStream& SvStream::ReadNumber( unsigned int& rUInt )
{
- ULONG nTmp;
+ sal_uIntPtr nTmp;
ReadNumber( nTmp );
rUInt = (unsigned int)nTmp;
return *this;
@@ -685,7 +696,7 @@ inline SvStream& SvStream::WriteNumber( int nInt )
/*
inline SvStream& SvStream::WriteNumber( unsigned int nUInt )
{
- WriteNumber( (ULONG)nUInt );
+ WriteNumber( (sal_uIntPtr)nUInt );
return *this;
}
*/
@@ -825,7 +836,7 @@ public:
void* SwitchBuffer( sal_Size nInitSize=512, sal_Size nResize=64 );
void* SetBuffer( void* pBuf, sal_Size nSize,
- sal_Bool bOwnsData=TRUE, sal_Size nEOF=0 );
+ sal_Bool bOwnsData=sal_True, sal_Size nEOF=0 );
void ObjectOwnsMemory( sal_Bool bOwn ) { bOwnsData = bOwn; }
sal_Bool IsObjectMemoryOwner() { return bOwnsData; }
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index ad2afc842b6b..e10e7288d1e8 100644..100755
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -168,7 +168,7 @@ private:
TOOLS_DLLPRIVATE void ImplUpdateStringFromUniString(
sal_Unicode const *, sal_Size, rtl_TextEncoding, sal_uInt32);
TOOLS_DLLPRIVATE void ImplStringConvert(
- rtl_TextEncoding, rtl_TextEncoding, BOOL);
+ rtl_TextEncoding, rtl_TextEncoding, sal_Bool);
ByteString( const int* pDummy ); // not implemented: to prevent ByteString( NULL )
ByteString(int); // not implemented; to detect misuses
@@ -270,29 +270,29 @@ public:
ByteString& Convert( rtl_TextEncoding eSource,
rtl_TextEncoding eTarget,
- BOOL bReplace = TRUE );
+ sal_Bool bReplace = sal_True );
static sal_Char Convert( sal_Char c, rtl_TextEncoding eSource,
rtl_TextEncoding eTarget,
- BOOL bReplace = TRUE );
+ sal_Bool bReplace = sal_True );
static sal_Unicode ConvertToUnicode( sal_Char c,
rtl_TextEncoding eTextEncoding );
static sal_Char ConvertFromUnicode( sal_Unicode c,
rtl_TextEncoding eTextEncoding,
- BOOL bReplace = TRUE );
+ sal_Bool bReplace = sal_True );
static sal_Unicode ConvertToUnicode( const sal_Char* pChar, sal_Size* pLen,
rtl_TextEncoding eTextEncoding );
static sal_Size ConvertFromUnicode( sal_Unicode c, sal_Char* pBuf, sal_Size nBufLen,
rtl_TextEncoding eTextEncoding,
- BOOL bReplace = TRUE );
+ sal_Bool bReplace = sal_True );
ByteString& ConvertLineEnd( LineEnd eLineEnd );
ByteString& ConvertLineEnd()
{ return ConvertLineEnd( GetSystemLineEnd() ); }
- BOOL IsLowerAscii() const;
- BOOL IsUpperAscii() const;
- BOOL IsAlphaAscii() const;
- BOOL IsNumericAscii() const;
- BOOL IsAlphaNumericAscii() const;
+ sal_Bool IsLowerAscii() const;
+ sal_Bool IsUpperAscii() const;
+ sal_Bool IsAlphaAscii() const;
+ sal_Bool IsNumericAscii() const;
+ sal_Bool IsAlphaNumericAscii() const;
ByteString& ToLowerAscii();
ByteString& ToUpperAscii();
@@ -305,17 +305,17 @@ public:
xub_StrLen nLen = STRING_LEN ) const;
StringCompare CompareIgnoreCaseToAscii( const sal_Char* pCharStr,
xub_StrLen nLen = STRING_LEN ) const;
- BOOL Equals( const ByteString& rStr ) const;
- BOOL Equals( const sal_Char* pCharStr ) const;
- BOOL EqualsIgnoreCaseAscii( const ByteString& rStr ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Char* pCharStr ) const;
- BOOL Equals( const ByteString& rStr,
+ sal_Bool Equals( const ByteString& rStr ) const;
+ sal_Bool Equals( const sal_Char* pCharStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const ByteString& rStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pCharStr ) const;
+ sal_Bool Equals( const ByteString& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL Equals( const sal_Char* pCharStr,
+ sal_Bool Equals( const sal_Char* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsIgnoreCaseAscii( const ByteString& rStr,
+ sal_Bool EqualsIgnoreCaseAscii( const ByteString& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Char* pCharStr,
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
xub_StrLen Match( const ByteString& rStr ) const;
@@ -354,41 +354,41 @@ public:
void ReleaseBufferAccess( xub_StrLen nLen = STRING_LEN );
sal_Char* AllocBuffer( xub_StrLen nLen );
- friend BOOL operator == ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator == ( const ByteString& rStr1, const ByteString& rStr2 )
{ return rStr1.Equals( rStr2 ); }
- friend BOOL operator == ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator == ( const ByteString& rStr, const sal_Char* pCharStr )
{ return rStr.Equals( pCharStr ); }
- friend BOOL operator == ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator == ( const sal_Char* pCharStr, const ByteString& rStr )
{ return rStr.Equals( pCharStr ); }
- friend BOOL operator != ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator != ( const ByteString& rStr1, const ByteString& rStr2 )
{ return !(operator == ( rStr1, rStr2 )); }
- friend BOOL operator != ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator != ( const ByteString& rStr, const sal_Char* pCharStr )
{ return !(operator == ( rStr, pCharStr )); }
- friend BOOL operator != ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator != ( const sal_Char* pCharStr, const ByteString& rStr )
{ return !(operator == ( pCharStr, rStr )); }
- friend BOOL operator < ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator < ( const ByteString& rStr1, const ByteString& rStr2 )
{ return (rStr1.CompareTo( rStr2 ) == COMPARE_LESS); }
- friend BOOL operator < ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator < ( const ByteString& rStr, const sal_Char* pCharStr )
{ return (rStr.CompareTo( pCharStr ) == COMPARE_LESS); }
- friend BOOL operator < ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator < ( const sal_Char* pCharStr, const ByteString& rStr )
{ return (rStr.CompareTo( pCharStr ) >= COMPARE_EQUAL); }
- friend BOOL operator > ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator > ( const ByteString& rStr1, const ByteString& rStr2 )
{ return (rStr1.CompareTo( rStr2 ) == COMPARE_GREATER); }
- friend BOOL operator > ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator > ( const ByteString& rStr, const sal_Char* pCharStr )
{ return (rStr.CompareTo( pCharStr ) == COMPARE_GREATER); }
- friend BOOL operator > ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator > ( const sal_Char* pCharStr, const ByteString& rStr )
{ return (rStr.CompareTo( pCharStr ) <= COMPARE_EQUAL); }
- friend BOOL operator <= ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator <= ( const ByteString& rStr1, const ByteString& rStr2 )
{ return !(operator > ( rStr1, rStr2 )); }
- friend BOOL operator <= ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator <= ( const ByteString& rStr, const sal_Char* pCharStr )
{ return !(operator > ( rStr, pCharStr )); }
- friend BOOL operator <= ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator <= ( const sal_Char* pCharStr, const ByteString& rStr )
{ return !(operator > ( pCharStr, rStr )); }
- friend BOOL operator >= ( const ByteString& rStr1, const ByteString& rStr2 )
+ friend sal_Bool operator >= ( const ByteString& rStr1, const ByteString& rStr2 )
{ return !(operator < ( rStr1, rStr2 )); }
- friend BOOL operator >= ( const ByteString& rStr, const sal_Char* pCharStr )
+ friend sal_Bool operator >= ( const ByteString& rStr, const sal_Char* pCharStr )
{ return !(operator < ( rStr, pCharStr )); }
- friend BOOL operator >= ( const sal_Char* pCharStr, const ByteString& rStr )
+ friend sal_Bool operator >= ( const sal_Char* pCharStr, const ByteString& rStr )
{ return !(operator < ( pCharStr, rStr )); }
};
@@ -438,14 +438,6 @@ typedef struct _UniStringData
#pragma pack()
#endif
-// -------------------
-// - UniString-Types -
-// -------------------
-
-#ifndef NOOLDSTRING
-#define WSTRING_MAXLEN STRING_MAXLEN
-#endif
-
// -------------
// - UniString -
// -------------
@@ -603,23 +595,23 @@ public:
xub_StrLen nLen = STRING_LEN ) const;
StringCompare CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
xub_StrLen nLen = STRING_LEN ) const;
- BOOL Equals( const UniString& rStr ) const;
- BOOL Equals( const sal_Unicode* pCharStr ) const;
- BOOL EqualsAscii( const sal_Char* pAsciiStr ) const;
- BOOL EqualsIgnoreCaseAscii( const UniString& rStr ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const;
- BOOL Equals( const UniString& rStr,
+ sal_Bool Equals( const UniString& rStr ) const;
+ sal_Bool Equals( const sal_Unicode* pCharStr ) const;
+ sal_Bool EqualsAscii( const sal_Char* pAsciiStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const UniString& rStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr ) const;
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const;
+ sal_Bool Equals( const UniString& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL Equals( const sal_Unicode* pCharStr,
+ sal_Bool Equals( const sal_Unicode* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsAscii( const sal_Char* pAsciiStr,
+ sal_Bool EqualsAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsIgnoreCaseAscii( const UniString& rStr,
+ sal_Bool EqualsIgnoreCaseAscii( const UniString& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr,
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- BOOL EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
+ sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
xub_StrLen Match( const UniString& rStr ) const;
@@ -663,17 +655,17 @@ public:
void ReleaseBufferAccess( xub_StrLen nLen = STRING_LEN );
sal_Unicode* AllocBuffer( xub_StrLen nLen );
- friend BOOL operator == ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator == ( const UniString& rStr1, const UniString& rStr2 )
{ return rStr1.Equals( rStr2 ); }
- friend BOOL operator != ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator != ( const UniString& rStr1, const UniString& rStr2 )
{ return !(operator == ( rStr1, rStr2 )); }
- friend BOOL operator < ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator < ( const UniString& rStr1, const UniString& rStr2 )
{ return (rStr1.CompareTo( rStr2 ) == COMPARE_LESS); }
- friend BOOL operator > ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator > ( const UniString& rStr1, const UniString& rStr2 )
{ return (rStr1.CompareTo( rStr2 ) == COMPARE_GREATER); }
- friend BOOL operator <= ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator <= ( const UniString& rStr1, const UniString& rStr2 )
{ return !(operator > ( rStr1, rStr2 )); }
- friend BOOL operator >= ( const UniString& rStr1, const UniString& rStr2 )
+ friend sal_Bool operator >= ( const UniString& rStr1, const UniString& rStr2 )
{ return !(operator < ( rStr1, rStr2 )); }
};
diff --git a/tools/inc/tools/svborder.hxx b/tools/inc/tools/svborder.hxx
index daba02272a05..86c5feb4f4dc 100644
--- a/tools/inc/tools/svborder.hxx
+++ b/tools/inc/tools/svborder.hxx
@@ -43,12 +43,12 @@ public:
SvBorder( const Rectangle & rOuter, const Rectangle & rInner );
SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
{ nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; }
- BOOL operator == ( const SvBorder & rObj ) const
+ sal_Bool operator == ( const SvBorder & rObj ) const
{
return nTop == rObj.nTop && nRight == rObj.nRight &&
nBottom == rObj.nBottom && nLeft == rObj.nLeft;
}
- BOOL operator != ( const SvBorder & rObj ) const
+ sal_Bool operator != ( const SvBorder & rObj ) const
{ return !(*this == rObj); }
SvBorder & operator = ( const SvBorder & rBorder )
{
@@ -74,7 +74,7 @@ public:
Bottom() -= rBorder.Bottom();
return *this;
}
- BOOL IsInside( const SvBorder & rInside )
+ sal_Bool IsInside( const SvBorder & rInside )
{
return nTop >= rInside.nTop && nRight >= rInside.nRight &&
nBottom >= rInside.nBottom && nLeft >= rInside.nLeft;
diff --git a/tools/inc/tools/table.hxx b/tools/inc/tools/table.hxx
index b29c5a955826..bfb91fbe7dc6 100644
--- a/tools/inc/tools/table.hxx
+++ b/tools/inc/tools/table.hxx
@@ -41,34 +41,34 @@
class TOOLS_DLLPUBLIC Table : private Container
{
private:
- ULONG nCount;
- TOOLS_DLLPRIVATE ULONG ImplGetIndex( ULONG nKey, ULONG* pIndex = NULL ) const;
+ sal_uIntPtr nCount;
+ TOOLS_DLLPRIVATE sal_uIntPtr ImplGetIndex( sal_uIntPtr nKey, sal_uIntPtr* pIndex = NULL ) const;
public:
- Table( USHORT nInitSize = 16, USHORT nReSize = 16 );
+ Table( sal_uInt16 nInitSize = 16, sal_uInt16 nReSize = 16 );
Table( const Table& rTable ) : Container( rTable )
{ nCount = rTable.nCount; }
- BOOL Insert( ULONG nKey, void* p );
- void* Remove( ULONG nKey );
- void* Replace( ULONG nKey, void* p );
- void* Get( ULONG nKey ) const;
+ sal_Bool Insert( sal_uIntPtr nKey, void* p );
+ void* Remove( sal_uIntPtr nKey );
+ void* Replace( sal_uIntPtr nKey, void* p );
+ void* Get( sal_uIntPtr nKey ) const;
void Clear() { Container::Clear(); nCount = 0; }
- ULONG Count() const { return( nCount ); }
+ sal_uIntPtr Count() const { return( nCount ); }
void* GetCurObject() const;
- ULONG GetCurKey() const { return (ULONG)Container::GetCurObject(); }
- ULONG GetKey( const void* p ) const;
- BOOL IsKeyValid( ULONG nKey ) const;
+ sal_uIntPtr GetCurKey() const { return (sal_uIntPtr)Container::GetCurObject(); }
+ sal_uIntPtr GetKey( const void* p ) const;
+ sal_Bool IsKeyValid( sal_uIntPtr nKey ) const;
- void* GetObject( ULONG nPos ) const
+ void* GetObject( sal_uIntPtr nPos ) const
{ return Container::GetObject( (nPos*2)+1 ); }
- ULONG GetObjectKey( ULONG nPos ) const
- { return (ULONG)Container::GetObject( nPos*2 ); }
- ULONG GetUniqueKey( ULONG nStartKey = 1 ) const;
- ULONG SearchKey( ULONG nKey, ULONG* pPos = NULL ) const;
+ sal_uIntPtr GetObjectKey( sal_uIntPtr nPos ) const
+ { return (sal_uIntPtr)Container::GetObject( nPos*2 ); }
+ sal_uIntPtr GetUniqueKey( sal_uIntPtr nStartKey = 1 ) const;
+ sal_uIntPtr SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos = NULL ) const;
- void* Seek( ULONG nKey );
+ void* Seek( sal_uIntPtr nKey );
void* Seek( void* p );
void* First();
void* Last();
@@ -77,9 +77,9 @@ public:
Table& operator =( const Table& rTable );
- BOOL operator ==( const Table& rTable ) const
+ sal_Bool operator ==( const Table& rTable ) const
{ return Container::operator ==( rTable ); }
- BOOL operator !=( const Table& rTable ) const
+ sal_Bool operator !=( const Table& rTable ) const
{ return Container::operator !=( rTable ); }
};
@@ -106,30 +106,30 @@ public: \
using Table::SearchKey; \
using Table::IsKeyValid; \
\
- ClassName( USHORT _nInitSize = 16, \
- USHORT _nReSize = 16 ) : \
+ ClassName( sal_uInt16 _nInitSize = 16, \
+ sal_uInt16 _nReSize = 16 ) : \
Table( _nInitSize, _nReSize ) {} \
ClassName( const ClassName& rClassName ) : \
Table( rClassName ) {} \
\
- BOOL Insert( ULONG nKey, Type p ) \
+ sal_Bool Insert( sal_uIntPtr nKey, Type p ) \
{ return Table::Insert( nKey, (void*)p ); } \
- Type Remove( ULONG nKey ) \
+ Type Remove( sal_uIntPtr nKey ) \
{ return (Type)Table::Remove( nKey ); } \
- Type Replace( ULONG nKey, Type p ) \
+ Type Replace( sal_uIntPtr nKey, Type p ) \
{ return (Type)Table::Replace( nKey, (void*)p ); } \
- Type Get( ULONG nKey ) const \
+ Type Get( sal_uIntPtr nKey ) const \
{ return (Type)Table::Get( nKey ); } \
\
Type GetCurObject() const \
{ return (Type)Table::GetCurObject(); } \
- ULONG GetKey( const Type p ) const \
+ sal_uIntPtr GetKey( const Type p ) const \
{ return Table::GetKey( (const void*)p ); } \
\
- Type GetObject( ULONG nPos ) const \
+ Type GetObject( sal_uIntPtr nPos ) const \
{ return (Type)Table::GetObject( nPos ); } \
\
- Type Seek( ULONG nKey ) \
+ Type Seek( sal_uIntPtr nKey ) \
{ return (Type)Table::Seek( nKey ); } \
Type Seek( Type p ) \
{ return (Type)Table::Seek( (void*)p ); } \
@@ -142,9 +142,9 @@ public: \
{ Table::operator =( rClassName ); \
return *this; } \
\
- BOOL operator ==( const ClassName& rTable ) const \
+ sal_Bool operator ==( const ClassName& rTable ) const \
{ return Table::operator ==( rTable ); } \
- BOOL operator !=( const ClassName& rTable ) const \
+ sal_Bool operator !=( const ClassName& rTable ) const \
{ return Table::operator !=( rTable ); } \
};
diff --git a/tools/inc/tools/tenccvt.hxx b/tools/inc/tools/tenccvt.hxx
index f5ca13191e49..a5840d77b34d 100644
--- a/tools/inc/tools/tenccvt.hxx
+++ b/tools/inc/tools/tenccvt.hxx
@@ -51,8 +51,8 @@ TOOLS_DLLPUBLIC rtl_TextEncoding GetExtendedTextEncoding( rtl_TextEncoding eEnco
// is returned (normally windows-1252).
TOOLS_DLLPUBLIC rtl_TextEncoding GetOneByteTextEncoding( rtl_TextEncoding eEncoding );
-TOOLS_DLLPUBLIC rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, USHORT nVersion = SOFFICE_FILEFORMAT_50 );
-TOOLS_DLLPUBLIC rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, USHORT nVersion = SOFFICE_FILEFORMAT_50 );
+TOOLS_DLLPUBLIC rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 nVersion = SOFFICE_FILEFORMAT_50 );
+TOOLS_DLLPUBLIC rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 nVersion = SOFFICE_FILEFORMAT_50 );
/*
* Given a Unicode character, return a legacy Microsoft Encoding which
diff --git a/tools/inc/tools/time.hxx b/tools/inc/tools/time.hxx
index 6fb93f2e718c..9b2534013af6 100644
--- a/tools/inc/tools/time.hxx
+++ b/tools/inc/tools/time.hxx
@@ -47,28 +47,28 @@ public:
Time( const ResId & rResId );
Time( sal_Int32 _nTime ) { Time::nTime = _nTime; }
Time( const Time& rTime );
- Time( ULONG nHour, ULONG nMin,
- ULONG nSec = 0, ULONG n100Sec = 0 );
+ Time( sal_uIntPtr nHour, sal_uIntPtr nMin,
+ sal_uIntPtr nSec = 0, sal_uIntPtr n100Sec = 0 );
void SetTime( sal_Int32 nNewTime ) { nTime = nNewTime; }
sal_Int32 GetTime() const { return nTime; }
- void SetHour( USHORT nNewHour );
- void SetMin( USHORT nNewMin );
- void SetSec( USHORT nNewSec );
- void Set100Sec( USHORT nNew100Sec );
- USHORT GetHour() const
- { ULONG nTempTime = (nTime >= 0) ? nTime : nTime*-1;
- return (USHORT)(nTempTime / 1000000); }
- USHORT GetMin() const
- { ULONG nTempTime = (nTime >= 0) ? nTime : nTime*-1;
- return (USHORT)((nTempTime / 10000) % 100); }
- USHORT GetSec() const
- { ULONG nTempTime = (nTime >= 0) ? nTime : nTime*-1;
- return (USHORT)((nTempTime / 100) % 100); }
- USHORT Get100Sec() const
- { ULONG nTempTime = (nTime >= 0) ? nTime : nTime*-1;
- return (USHORT)(nTempTime % 100); }
+ void SetHour( sal_uInt16 nNewHour );
+ void SetMin( sal_uInt16 nNewMin );
+ void SetSec( sal_uInt16 nNewSec );
+ void Set100Sec( sal_uInt16 nNew100Sec );
+ sal_uInt16 GetHour() const
+ { sal_uIntPtr nTempTime = (nTime >= 0) ? nTime : nTime*-1;
+ return (sal_uInt16)(nTempTime / 1000000); }
+ sal_uInt16 GetMin() const
+ { sal_uIntPtr nTempTime = (nTime >= 0) ? nTime : nTime*-1;
+ return (sal_uInt16)((nTempTime / 10000) % 100); }
+ sal_uInt16 GetSec() const
+ { sal_uIntPtr nTempTime = (nTime >= 0) ? nTime : nTime*-1;
+ return (sal_uInt16)((nTempTime / 100) % 100); }
+ sal_uInt16 Get100Sec() const
+ { sal_uIntPtr nTempTime = (nTime >= 0) ? nTime : nTime*-1;
+ return (sal_uInt16)(nTempTime % 100); }
sal_Int32 GetMSFromTime() const;
void MakeTimeFromMS( sal_Int32 nMS );
@@ -76,27 +76,27 @@ public:
/// 12 hours == 0.5 days
double GetTimeInDays() const;
- BOOL IsBetween( const Time& rFrom, const Time& rTo ) const
+ sal_Bool IsBetween( const Time& rFrom, const Time& rTo ) const
{ return ((nTime >= rFrom.nTime) && (nTime <= rTo.nTime)); }
- BOOL IsEqualIgnore100Sec( const Time& rTime ) const;
+ sal_Bool IsEqualIgnore100Sec( const Time& rTime ) const;
- BOOL operator ==( const Time& rTime ) const
+ sal_Bool operator ==( const Time& rTime ) const
{ return (nTime == rTime.nTime); }
- BOOL operator !=( const Time& rTime ) const
+ sal_Bool operator !=( const Time& rTime ) const
{ return (nTime != rTime.nTime); }
- BOOL operator >( const Time& rTime ) const
+ sal_Bool operator >( const Time& rTime ) const
{ return (nTime > rTime.nTime); }
- BOOL operator <( const Time& rTime ) const
+ sal_Bool operator <( const Time& rTime ) const
{ return (nTime < rTime.nTime); }
- BOOL operator >=( const Time& rTime ) const
+ sal_Bool operator >=( const Time& rTime ) const
{ return (nTime >= rTime.nTime); }
- BOOL operator <=( const Time& rTime ) const
+ sal_Bool operator <=( const Time& rTime ) const
{ return (nTime <= rTime.nTime); }
static Time GetUTCOffset();
- static ULONG GetSystemTicks(); // Elapsed time
- static ULONG GetProcessTicks(); // CPU time
+ static sal_uIntPtr GetSystemTicks(); // Elapsed time
+ static sal_uIntPtr GetProcessTicks(); // CPU time
void ConvertToUTC() { *this -= Time::GetUTCOffset(); }
void ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
diff --git a/tools/inc/tools/unqid.hxx b/tools/inc/tools/unqid.hxx
index 7758612556fb..9e05b44b4437 100644
--- a/tools/inc/tools/unqid.hxx
+++ b/tools/inc/tools/unqid.hxx
@@ -37,8 +37,8 @@
struct ImpUniqueId
{
- ULONG nId;
- USHORT nRefCount;
+ sal_uIntPtr nId;
+ sal_uInt16 nRefCount;
void Release()
{
nRefCount--;
@@ -72,7 +72,7 @@ public:
pId = rId.pId;
return *this;
}
- ULONG GetId() const { return pId ? pId->nId : 0; }
+ sal_uIntPtr GetId() const { return pId ? pId->nId : 0; }
};
// ---------------------
@@ -81,30 +81,30 @@ public:
class TOOLS_DLLPUBLIC UniqueIdContainer : private UniqueIndex
{
- USHORT nCollectCount;
+ sal_uInt16 nCollectCount;
public: // Irgend etwas mit protected falsch
- void Clear( BOOL bAll );
- UniqueItemId CreateIdProt( ULONG nId );
+ void Clear( sal_Bool bAll );
+ UniqueItemId CreateIdProt( sal_uIntPtr nId );
public:
- UniqueIdContainer( ULONG _nStartIndex,
- ULONG _nInitSize = 16,
- ULONG _nReSize = 16 )
+ UniqueIdContainer( sal_uIntPtr _nStartIndex,
+ sal_uIntPtr _nInitSize = 16,
+ sal_uIntPtr _nReSize = 16 )
: UniqueIndex( _nStartIndex, _nInitSize, _nReSize )
, nCollectCount( 0 )
{}
UniqueIdContainer( const UniqueIdContainer& );
~UniqueIdContainer()
- { Clear( TRUE ); }
+ { Clear( sal_True ); }
UniqueIdContainer& operator = ( const UniqueIdContainer & );
- BOOL IsIndexValid( ULONG nIndex ) const
+ sal_Bool IsIndexValid( sal_uIntPtr nIndex ) const
{ return UniqueIndex::IsIndexValid( nIndex ); }
UniqueItemId CreateId();
- static UniqueItemId CreateFreeId( ULONG nId ); // freies Id
+ static UniqueItemId CreateFreeId( sal_uIntPtr nId ); // freies Id
};
#endif // _UNQID_HXX
diff --git a/tools/inc/tools/unqidx.hxx b/tools/inc/tools/unqidx.hxx
index 1e957aeaa80f..74aa57d54d1a 100644
--- a/tools/inc/tools/unqidx.hxx
+++ b/tools/inc/tools/unqidx.hxx
@@ -41,47 +41,47 @@
class TOOLS_DLLPUBLIC UniqueIndex : private Container
{
private:
- ULONG nReSize;
- ULONG nStartIndex;
- ULONG nUniqIndex;
- ULONG nCount;
+ sal_uIntPtr nReSize;
+ sal_uIntPtr nStartIndex;
+ sal_uIntPtr nUniqIndex;
+ sal_uIntPtr nCount;
public:
using Container::GetCurObject;
- UniqueIndex( ULONG nStartIndex = 0,
- ULONG nInitSize = 16,
- ULONG nReSize = 16 );
+ UniqueIndex( sal_uIntPtr nStartIndex = 0,
+ sal_uIntPtr nInitSize = 16,
+ sal_uIntPtr nReSize = 16 );
UniqueIndex( const UniqueIndex& rIdx );
- ULONG Insert( ULONG nIndex, void* p );
- ULONG Insert( void* p );
- void* Remove( ULONG nIndex );
- void* Replace( ULONG nIndex, void* p );
- void* Get( ULONG nIndex ) const;
+ sal_uIntPtr Insert( sal_uIntPtr nIndex, void* p );
+ sal_uIntPtr Insert( void* p );
+ void* Remove( sal_uIntPtr nIndex );
+ void* Replace( sal_uIntPtr nIndex, void* p );
+ void* Get( sal_uIntPtr nIndex ) const;
void Clear();
- ULONG Count() const { return nCount; }
+ sal_uIntPtr Count() const { return nCount; }
- ULONG GetCurIndex() const;
- ULONG GetIndex( const void* p ) const;
- BOOL IsIndexValid( ULONG nIndex ) const;
+ sal_uIntPtr GetCurIndex() const;
+ sal_uIntPtr GetIndex( const void* p ) const;
+ sal_Bool IsIndexValid( sal_uIntPtr nIndex ) const;
- void* Seek( ULONG nIndex );
+ void* Seek( sal_uIntPtr nIndex );
void* Seek( void* p );
void* First();
void* Last();
void* Next();
void* Prev();
- ULONG GetStartIndex() const { return nStartIndex; }
- ULONG GetCurMaxIndex() const
+ sal_uIntPtr GetStartIndex() const { return nStartIndex; }
+ sal_uIntPtr GetCurMaxIndex() const
{ return (nStartIndex + Container::GetSize()); }
UniqueIndex& operator =( const UniqueIndex& rIdx );
- BOOL operator ==( const UniqueIndex& rIdx ) const;
- BOOL operator !=( const UniqueIndex& rIdx ) const
+ sal_Bool operator ==( const UniqueIndex& rIdx ) const;
+ sal_Bool operator !=( const UniqueIndex& rIdx ) const
{ return !(UniqueIndex::operator==( rIdx )); }
};
@@ -107,30 +107,30 @@ public: \
using UniqueIndex::GetStartIndex; \
using UniqueIndex::GetCurMaxIndex; \
\
- ClassName( ULONG _nStartIndex = 0, \
- ULONG _nInitSize = 16, ULONG _nReSize = 16 ):\
+ ClassName( sal_uIntPtr _nStartIndex = 0, \
+ sal_uIntPtr _nInitSize = 16, sal_uIntPtr _nReSize = 16 ):\
UniqueIndex( _nStartIndex, _nInitSize, _nReSize ) {}\
ClassName( const ClassName& rClassName ) : \
UniqueIndex( rClassName ) {} \
\
- ULONG Insert( ULONG nIndex, Type p ) \
+ sal_uIntPtr Insert( sal_uIntPtr nIndex, Type p ) \
{ return UniqueIndex::Insert( nIndex, (void*)p ); } \
- ULONG Insert( Type p ) \
+ sal_uIntPtr Insert( Type p ) \
{ return UniqueIndex::Insert( (void*)p ); } \
- Type Remove( ULONG nIndex ) \
+ Type Remove( sal_uIntPtr nIndex ) \
{ return (Type)UniqueIndex::Remove( nIndex ); } \
- Type Replace( ULONG nIndex, Type p ) \
+ Type Replace( sal_uIntPtr nIndex, Type p ) \
{ return (Type)UniqueIndex::Replace( nIndex, \
(void*)p ); } \
- Type Get( ULONG nIndex ) const \
+ Type Get( sal_uIntPtr nIndex ) const \
{ return (Type)UniqueIndex::Get( nIndex ); } \
\
Type GetCurObject() const \
{ return (Type)UniqueIndex::GetCurObject(); } \
- ULONG GetIndex( const Type p ) const \
+ sal_uIntPtr GetIndex( const Type p ) const \
{ return UniqueIndex::GetIndex( (const void*)p ); } \
\
- Type Seek( ULONG nKey ) \
+ Type Seek( sal_uIntPtr nKey ) \
{ return (Type)UniqueIndex::Seek( nKey ); } \
Type Seek( Type p ) \
{ return (Type)UniqueIndex::Seek( (void*)p ); } \
@@ -143,9 +143,9 @@ public: \
{ UniqueIndex::operator =( rClassName ); \
return *this; } \
\
- BOOL operator ==( const ClassName& rIdx ) const \
+ sal_Bool operator ==( const ClassName& rIdx ) const \
{ return UniqueIndex::operator ==( rIdx ); } \
- BOOL operator !=( const ClassName& rIdx ) const \
+ sal_Bool operator !=( const ClassName& rIdx ) const \
{ return UniqueIndex::operator !=( rIdx ); } \
};
diff --git a/tools/inc/tools/urlkeys.hxx b/tools/inc/tools/urlkeys.hxx
deleted file mode 100644
index 0182e2f2cae5..000000000000
--- a/tools/inc/tools/urlkeys.hxx
+++ /dev/null
@@ -1,79 +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 __URLKEYS_HXX
-#define __URLKEYS_HXX
-
-// Defines for common keys in URL files
-
-// ANSI version
-
-#define A_URLSECTION_SHORTCUT "InternetShortcut"
-#define A_URLKEY_URL "URL"
-#define A_URLKEY_TITLE "Title"
-#define A_URLKEY_TARGET "Target"
-#define A_URLKEY_FRAME "Frame"
-#define A_URLKEY_OPENAS "OpenAs"
-#define A_URLKEY_SOICON "SOIcon"
-#define A_URLKEY_WIN_ICONFILE "IconFile"
-#define A_URLKEY_WIN_ICONINDEX "IconIndex"
-#define A_URLKEY_WORKDIR "WorkingDirectory"
-#define A_URLKEY_ARGUMENTS "Arguments"
-#define A_URLKEY_INTERN_ORIGURL "[URL]"
-
-// Unicode version
-
-#define U_URLSECTION_SHORTCUT L"InternetShortcut"
-#define U_URLKEY_URL L"URL"
-#define U_URLKEY_TITLE L"Title"
-#define U_URLKEY_TARGET L"Target"
-#define U_URLKEY_FRAME L"Frame"
-#define U_URLKEY_OPENAS L"OpenAs"
-#define U_URLKEY_SOICON L"SOIcon"
-#define U_URLKEY_WIN_ICONFILE L"IconFile"
-#define U_URLKEY_WIN_ICONINDEX L"IconIndex"
-#define U_URLKEY_WORKDIR L"WorkingDirectory"
-#define U_URLKEY_ARGUMENTS L"Arguments"
-#define U_URLKEY_INTERN_ORIGURL L"[URL]"
-
-# define URLSECTION_SHORTCUT U_URLSECTION_SHORTCUT
-# define URLKEY_URL U_URLKEY_URL
-# define URLKEY_TITLE U_URLKEY_TITLE
-# define URLKEY_TARGET U_URLKEY_TARGET
-# define URLKEY_FRAME U_URLKEY_FRAME
-# define URLKEY_OPENAS U_URLKEY_OPENAS
-# define URLKEY_SOICON U_URLKEY_SOICON
-# define URLKEY_WIN_ICONFILE U_URLKEY_WIN_ICONFILE
-# define URLKEY_WIN_ICONINDEX U_URLKEY_WIN_ICONINDEX
-# define URLKEY_WORKDIR U_URLKEY_WORKDIR
-# define URLKEY_ARGUMENTS U_URLKEY_ARGUMENTS
-# define URLKEY_INTERN_ORIGURL U_URLKEY_INTERN_ORIGURL
-
-#endif // __URLKEYS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx
index b2a29af841a6..67342db5d161 100644
--- a/tools/inc/tools/urlobj.hxx
+++ b/tools/inc/tools/urlobj.hxx
@@ -82,6 +82,7 @@ namespace com { namespace sun { namespace star { namespace util {
#define INET_DB_SCHEME "db:"
#define INET_BUGID_SCHEME "bugid:"
#define INET_TELNET_SCHEME "telnet://"
+#define INET_HID_SCHEME "hid:"
#define URL_PREFIX_PRIV_SOFFICE "private:"
enum
@@ -140,8 +141,9 @@ enum INetProtocol
INET_PROT_VND_SUN_STAR_TDOC = 29,
INET_PROT_GENERIC = 30,
INET_PROT_SMB = 31,
- INET_PROT_SFTP = 32,
- INET_PROT_END = 33
+ INET_PROT_HID = 32,
+ INET_PROT_SFTP = 33,
+ INET_PROT_END = 34
};
//============================================================================
diff --git a/tools/inc/tools/vcompat.hxx b/tools/inc/tools/vcompat.hxx
index 8fbc897ec62c..dcac766aaf78 100644
--- a/tools/inc/tools/vcompat.hxx
+++ b/tools/inc/tools/vcompat.hxx
@@ -36,10 +36,10 @@
// -----------
#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
- ((UINT32)((((UINT32)(char)(char1)))| \
- (((UINT32)(char)(char2))<<8UL)| \
- (((UINT32)(char)(char3))<<16UL)| \
- ((UINT32)(char)(char4))<<24UL))
+ ((sal_uInt32)((((sal_uInt32)(char)(char1)))| \
+ (((sal_uInt32)(char)(char2))<<8UL)| \
+ (((sal_uInt32)(char)(char3))<<16UL)| \
+ ((sal_uInt32)(char)(char4))<<24UL))
// --------------
// - ImplCompat -
@@ -50,22 +50,22 @@ class SvStream;
class TOOLS_DLLPUBLIC VersionCompat
{
SvStream* mpRWStm;
- UINT32 mnCompatPos;
- UINT32 mnTotalSize;
- UINT16 mnStmMode;
- UINT16 mnVersion;
+ sal_uInt32 mnCompatPos;
+ sal_uInt32 mnTotalSize;
+ sal_uInt16 mnStmMode;
+ sal_uInt16 mnVersion;
VersionCompat() {}
VersionCompat( const VersionCompat& ) {}
VersionCompat& operator=( const VersionCompat& ) { return *this; }
- BOOL operator==( const VersionCompat& ) { return FALSE; }
+ sal_Bool operator==( const VersionCompat& ) { return sal_False; }
public:
- VersionCompat( SvStream& rStm, USHORT nStreamMode, UINT16 nVersion = 1 );
+ VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
~VersionCompat();
- UINT16 GetVersion() const { return mnVersion; }
+ sal_uInt16 GetVersion() const { return mnVersion; }
};
#endif // _VCOMPAT_HXX
diff --git a/tools/inc/tools/vector2d.hxx b/tools/inc/tools/vector2d.hxx
index e6d98b7cbb98..4b6d6473ff0b 100644
--- a/tools/inc/tools/vector2d.hxx
+++ b/tools/inc/tools/vector2d.hxx
@@ -88,8 +88,8 @@ public:
inline Vector2D& operator/=(double t) { mfX /= t; mfY /= t; return *this; }
inline Vector2D operator/(double t) const { Vector2D aNew(*this); aNew /= t; return aNew; }
- inline BOOL operator==( const Vector2D& rVec ) const { return( mfX == rVec.mfX && mfY == rVec.mfY ); }
- inline BOOL operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
+ inline sal_Bool operator==( const Vector2D& rVec ) const { return( mfX == rVec.mfX && mfY == rVec.mfY ); }
+ inline sal_Bool operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
inline Vector2D& operator=( const Vector2D& rVec ) { mfX = rVec.mfX, mfY = rVec.mfY; return *this; }
inline Vector2D& operator=( const Pair& rPair ) { mfX = rPair.nA, mfY = rPair.nB; return *this; }
@@ -98,11 +98,11 @@ public:
inline Vector2D& operator*=( const Pair& rPair ) { mfX *= rPair.nA, mfY *= rPair.nB; return *this; }
inline Vector2D& operator/=( const Pair& rPair ) { mfX /= rPair.nA, mfY /= rPair.nB; return *this; }
- inline BOOL operator==( const Pair& rPair ) const { return( mfX == rPair.nA && mfY == rPair.nB ); }
- inline BOOL operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
+ inline sal_Bool operator==( const Pair& rPair ) const { return( mfX == rPair.nA && mfY == rPair.nB ); }
+ inline sal_Bool operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
- inline BOOL IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }
- inline BOOL IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); }
+ inline sal_Bool IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }
+ inline sal_Bool IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); }
};
// -----------------------------------------------------------------------------
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index a590183c5154..e4f0a0daf7f1 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -35,7 +35,7 @@
// - Window-Types -
// ----------------
-typedef USHORT WindowType;
+typedef sal_uInt16 WindowType;
#define WINDOW_BASE 0x0100
#define WINDOW_FIRST (WINDOW_BASE + 0x30)
#define WINDOW_MESSBOX (WINDOW_FIRST)
@@ -118,14 +118,14 @@ typedef USHORT WindowType;
#define WINDOW_INTROWINDOW (WINDOW_FIRST + 0x4f)
#define WINDOW_LISTBOXWINDOW (WINDOW_FIRST + 0x50)
#define WINDOW_DOCKINGAREA (WINDOW_FIRST + 0x51)
-#define WINDOW_LAST (WINDOW_DOCKINGAREA)
+#define WINDOW_RULER (WINDOW_FIRST + 0x52)
+#define WINDOW_LAST (WINDOW_RULER)
// ---------------
// - Window-Bits -
// ---------------
-// By changes you must also change: rsc/vclrsc.hxx
typedef sal_Int64 WinBits;
// Window-Bits fuer Window
@@ -241,9 +241,6 @@ typedef sal_Int64 WinBits;
#define WB_SCROLL ((WinBits)0x02000000)
#define WB_FORCETABCYCLE ((WinBits)0x04000000)
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
// Window-Bits for DockingWindows
#define WB_DOCKBORDER ((WinBits)0x00001000)
@@ -277,9 +274,16 @@ typedef sal_Int64 WinBits;
#define WB_STDPOPUP (WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL)
// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
+#define WB_HASBUTTONS ((WinBits)SAL_CONST_INT64(0x000100000000))
+#define WB_HASLINES ((WinBits)SAL_CONST_INT64(0x000200000000))
+#define WB_HASLINESATROOT ((WinBits)SAL_CONST_INT64(0x000400000000))
+#define WB_HASBUTTONSATROOT ((WinBits)SAL_CONST_INT64(0x000800000000))
+#define WB_NOINITIALSELECTION ((WinBits)SAL_CONST_INT64(0x001000000000))
+#define WB_HIDESELECTION ((WinBits)SAL_CONST_INT64(0x002000000000))
+#define WB_FORCE_MAKEVISIBLE ((WinBits)SAL_CONST_INT64(0x004000000000))
+// DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW
+#define WB_QUICK_SEARCH ((WinBits)SAL_CONST_INT64(0x010000000000))
+
// For FileOpen Dialog
#define WB_PATH ((WinBits)0x00100000)
@@ -301,7 +305,6 @@ typedef sal_Int64 WinBits;
// - WindowAlign -
// ---------------
-// By changes you must also change: rsc/vclrsc.hxx
enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM,
IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT,
@@ -313,7 +316,6 @@ enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
// - TriState -
// ------------
-// By changes you must also change: rsc/vclrsc.hxx
enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
@@ -321,7 +323,7 @@ enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
// - ButtonDialog-Types -
// ----------------------
-typedef USHORT StandardButtonType;
+typedef sal_uInt16 StandardButtonType;
#define BUTTON_OK ((StandardButtonType)0)
#define BUTTON_CANCEL ((StandardButtonType)1)
#define BUTTON_YES ((StandardButtonType)2)
diff --git a/tools/inc/tools/wldcrd.hxx b/tools/inc/tools/wldcrd.hxx
index 3e200b2e7f0f..c1c6a33fcaa0 100644
--- a/tools/inc/tools/wldcrd.hxx
+++ b/tools/inc/tools/wldcrd.hxx
@@ -43,7 +43,7 @@ private:
ByteString aWildString;
char cSepSymbol;
- USHORT ImpMatch( const char *pWild, const char *pStr ) const;
+ sal_uInt16 ImpMatch( const char *pWild, const char *pStr ) const;
public:
WildCard();
@@ -53,11 +53,11 @@ public:
const String GetWildCard() const { return UniString( aWildString, osl_getThreadTextEncoding()); }
const String operator ()() const { return UniString( aWildString, osl_getThreadTextEncoding()); }
- BOOL Matches( const String& rStr ) const;
+ sal_Bool Matches( const String& rStr ) const;
- BOOL operator ==( const String& rString ) const
+ sal_Bool operator ==( const String& rString ) const
{ return Matches( rString ); }
- BOOL operator !=( const String& rString ) const
+ sal_Bool operator !=( const String& rString ) const
{ return !( Matches( rString ) ); }
WildCard& operator =( const String& rString );
diff --git a/tools/inc/tools/zcodec.hxx b/tools/inc/tools/zcodec.hxx
index 9d3a7e4739e2..578f367b4cdd 100644
--- a/tools/inc/tools/zcodec.hxx
+++ b/tools/inc/tools/zcodec.hxx
@@ -74,47 +74,47 @@ class TOOLS_DLLPUBLIC ZCodec
{
private:
- ULONG mbInit;
- BOOL mbStatus;
- BOOL mbFinish;
- ULONG mnMemUsage;
+ sal_uIntPtr mbInit;
+ sal_Bool mbStatus;
+ sal_Bool mbFinish;
+ sal_uIntPtr mnMemUsage;
SvStream* mpIStm;
- BYTE* mpInBuf;
- ULONG mnInBufSize;
- ULONG mnInToRead;
+ sal_uInt8* mpInBuf;
+ sal_uIntPtr mnInBufSize;
+ sal_uIntPtr mnInToRead;
SvStream* mpOStm;
- BYTE* mpOutBuf;
- ULONG mnOutBufSize;
+ sal_uInt8* mpOutBuf;
+ sal_uIntPtr mnOutBufSize;
- ULONG mnCRC;
- ULONG mnCompressMethod;
+ sal_uIntPtr mnCRC;
+ sal_uIntPtr mnCompressMethod;
void* mpsC_Stream;
- void ImplInitBuf( BOOL nIOFlag );
+ void ImplInitBuf( sal_Bool nIOFlag );
void ImplWriteBack( void );
public:
- ZCodec( ULONG nInBuf, ULONG nOutBuf, ULONG nMemUsage = MAX_MEM_USAGE );
+ ZCodec( sal_uIntPtr nInBuf, sal_uIntPtr nOutBuf, sal_uIntPtr nMemUsage = MAX_MEM_USAGE );
ZCodec( void );
virtual ~ZCodec();
- virtual void BeginCompression( ULONG nCompressMethod = ZCODEC_DEFAULT );
+ virtual void BeginCompression( sal_uIntPtr nCompressMethod = ZCODEC_DEFAULT );
virtual long EndCompression();
- BOOL IsFinished () const { return mbFinish; }
+ sal_Bool IsFinished () const { return mbFinish; }
long Compress( SvStream& rIStm, SvStream& rOStm );
long Decompress( SvStream& rIStm, SvStream& rOStm );
- long Write( SvStream& rOStm, const BYTE* pData, ULONG nSize );
- long Read( SvStream& rIStm, BYTE* pData, ULONG nSize );
- long ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize );
+ long Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize );
+ long Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
+ long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
- void SetBreak( ULONG );
- ULONG GetBreak( void );
- void SetCRC( ULONG nCurrentCRC );
- ULONG UpdateCRC( ULONG nLatestCRC, ULONG nSource );
- ULONG UpdateCRC( ULONG nLatestCRC, BYTE* pSource, long nDatSize );
- ULONG GetCRC();
+ void SetBreak( sal_uIntPtr );
+ sal_uIntPtr GetBreak( void );
+ void SetCRC( sal_uIntPtr nCurrentCRC );
+ sal_uIntPtr UpdateCRC( sal_uIntPtr nLatestCRC, sal_uIntPtr nSource );
+ sal_uIntPtr UpdateCRC( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize );
+ sal_uIntPtr GetCRC();
};
class GZCodec : public ZCodec
@@ -123,7 +123,7 @@ class GZCodec : public ZCodec
public:
GZCodec(){};
~GZCodec(){};
- virtual void BeginCompression( ULONG nCompressMethod = ZCODEC_DEFAULT );
+ virtual void BeginCompression( sal_uIntPtr nCompressMethod = ZCODEC_DEFAULT );
};
#endif // _ZCODEC_HXX
diff --git a/tools/os2/source/dll/makefile.mk b/tools/os2/source/dll/makefile.mk
deleted file mode 100644
index 97cff795defb..000000000000
--- a/tools/os2/source/dll/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=TOOLS
-TARGET=dll
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= toolsdll.cxx
-
-SLOFILES= $(SLO)$/toolsdll.obj
-
-OBJFILES= $(OBJ)$/toolsdll.obj
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/prj/build.lst b/tools/prj/build.lst
index 0c602a1e8890..eeb470c384d6 100644
--- a/tools/prj/build.lst
+++ b/tools/prj/build.lst
@@ -1,31 +1,3 @@
-tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL
-tl tools usr1 - all tl_mkout NULL
-tl tools\bootstrp\isdll get - all tl_bsisdll NULL
-tl tools\bootstrp\addexes get - all tl_bsexes NULL
-tl tools\inc nmake - all tl_inc NULL
-tl tools\prj get - all tl_prj NULL
-tl tools\prj usr7 - all tl_deliver NULL
-tl tools\prj usr42 - all tl_zn NULL
-tl tools\workben get - all tl_wben NULL
-tl tools\source\testtoolloader nmake - all tl_ttloader tl_inc NULL
-tl tools\source\generic nmake - all tl_gen tl_fsys tl_inc NULL
-tl tools\source\memtools nmake - all tl_mem tl_fsys tl_inc NULL
-tl tools\source\debug nmake - all tl_deb tl_fsys tl_inc NULL
-tl tools\source\datetime nmake - all tl_dat tl_fsys tl_inc NULL
-tl tools\source\stream nmake - all tl_str tl_fsys tl_inc NULL
-tl tools\source\rc nmake - all tl_rc tl_fsys tl_inc NULL
-tl tools\source\ref nmake - all tl_ref tl_fsys tl_inc NULL
-tl tools\source\fsys nmake - all tl_fsys tl_inc NULL
-tl tools\source\zcodec nmake - all tl_zco tl_fsys tl_inc NULL
-tl tools\source\communi nmake - all tl_com tl_fsys tl_inc NULL
-tl tools\source\inet nmake - all tl_inet tl_fsys tl_inc NULL
-tl tools\source\reversemap nmake - all tl_reversemap NULL
-tl tools\source\string nmake - all tl_string tl_reversemap tl_fsys tl_inc NULL
-tl tools\source\misc nmake - all tl_misc tl_inc NULL
-tl tools\win\source\dll nmake - w tl_dllw tl_inc NULL
-tl tools\os2\source\dll nmake - p tl_dllp tl_inc NULL
-tl tools\unx\source\dll nmake - u tl_dllu tl_inc NULL
-tl tools\util nmake - all tl_utl tl_com tl_dat tl_deb tl_dllu.u tl_dllp.p tl_dllw.w tl_fsys tl_gen tl_inet tl_mem tl_rc tl_ref tl_str tl_string tl_misc tl_zco tl_ttloader NULL
-tl tools\bootstrp nmake - all tl_bstrp tl_utl tl_inc NULL
-tl tools\bootstrp\addexes2 nmake - all tl_bsexes2 tl_bstrp tl_inc NULL
-tl tools\qa nmake - all tl_qa tl_utl NULL
+tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL
+tl tools\prj nmake - all tl_prj NULL
+# tl tools\qa nmake - all tl_qa tl_utl NULL
diff --git a/tools/prj/d.lst b/tools/prj/d.lst
index 375f2456a0fa..e69de29bb2d1 100644
--- a/tools/prj/d.lst
+++ b/tools/prj/d.lst
@@ -1,120 +0,0 @@
-mkdir: %_DEST%\inc%_EXT%\bootstrp
-
-..\%__SRC%\misc\_ooo_st_btstrp.pdb %_DEST%\lib%_EXT%\_ooo_st_btstrp.pdb
-..\%__SRC%\bin\mkunroll* %_DEST%\bin%_EXT%
-..\%__SRC%\bin\tl?????.dll %_DEST%\bin%_EXT%\tl?????.dll
-..\%__SRC%\bin\tl?????.sym %_DEST%\bin%_EXT%\tl?????.sym
-..\%__SRC%\lib\atools.lib %_DEST%\lib%_EXT%\atools.lib
-..\%__SRC%\lib\btstrp.lib %_DEST%\lib%_EXT%\btstrp.lib
-..\%__SRC%\lib\bootstrp2.lib %_DEST%\lib%_EXT%\bootstrp2.lib
-..\%__SRC%\lib\itools.lib %_DEST%\lib%_EXT%\itools.lib
-..\%__SRC%\lib\lib*.a %_DEST%\lib%_EXT%\lib*.a
-..\%__SRC%\lib\lib*.sl %_DEST%\lib%_EXT%\lib*.sl
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
-..\%__SRC%\lib\lib*.so.* %_DEST%\lib%_EXT%\lib*.so.*
-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
-..\%__SRC%\lib\stdstrm.lib %_DEST%\lib%_EXT%\stdstrm.lib
-..\%__SRC%\misc\tl?????.map %_DEST%\bin%_EXT%\tl?????.map
-..\%__SRC%\slb\btstrpsh.lib %_DEST%\lib%_EXT%\btstrpsh.lib
-
-..\inc\bootstrp\command.hxx %_DEST%\inc%_EXT%\bootstrp\command.hxx
-..\inc\bootstrp\inimgr.hxx %_DEST%\inc%_EXT%\bootstrp\inimgr.hxx
-..\inc\bootstrp\mkcreate.hxx %_DEST%\inc%_EXT%\bootstrp\mkcreate.hxx
-..\inc\bootstrp\prj.hxx %_DEST%\inc%_EXT%\bootstrp\prj.hxx
-
-..\inc\tools\toolsdllapi.h %_DEST%\inc%_EXT%\tools\toolsdllapi.h
-..\inc\tools\weakbase.hxx %_DEST%\inc%_EXT%\tools\weakbase.hxx
-..\inc\tools\weakbase.h %_DEST%\inc%_EXT%\tools\weakbase.h
-
-..\inc\tools\postx.h %_DEST%\inc%_EXT%\tools\postx.h
-..\inc\tools\prex.h %_DEST%\inc%_EXT%\tools\prex.h
-
-..\inc\tools\svlibrary.hxx %_DEST%\inc%_EXT%\tools\svlibrary.hxx
-..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx
-..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx
-..\inc\tools\mapunit.hxx %_DEST%\inc%_EXT%\tools\mapunit.hxx
-..\inc\tools\fldunit.hxx %_DEST%\inc%_EXT%\tools\fldunit.hxx
-..\inc\tools\fontenum.hxx %_DEST%\inc%_EXT%\tools\fontenum.hxx
-..\inc\tools\agapi.hxx %_DEST%\inc%_EXT%\tools\agapi.hxx
-..\inc\tools\agitem.hxx %_DEST%\inc%_EXT%\tools\agitem.hxx
-..\inc\tools\appendunixshellword.hxx %_DEST%\inc%_EXT%\tools\appendunixshellword.hxx
-..\inc\tools\bigint.hxx %_DEST%\inc%_EXT%\tools\bigint.hxx
-..\inc\tools\cachestr.hxx %_DEST%\inc%_EXT%\tools\cachestr.hxx
-..\inc\tools\chapi.hxx %_DEST%\inc%_EXT%\tools\chapi.hxx
-..\inc\tools\color.hxx %_DEST%\inc%_EXT%\tools\color.hxx
-..\inc\tools\contnr.hxx %_DEST%\inc%_EXT%\tools\contnr.hxx
-..\inc\tools\date.hxx %_DEST%\inc%_EXT%\tools\date.hxx
-..\inc\tools\datetime.hxx %_DEST%\inc%_EXT%\tools\datetime.hxx
-..\inc\tools\debug.hxx %_DEST%\inc%_EXT%\tools\debug.hxx
-..\inc\tools\diagnose_ex.h %_DEST%\inc%_EXT%\tools\diagnose_ex.h
-..\inc\tools\download.hxx %_DEST%\inc%_EXT%\tools\download.hxx
-..\inc\tools\dynary.hxx %_DEST%\inc%_EXT%\tools\dynary.hxx
-..\inc\tools\errcode.hxx %_DEST%\inc%_EXT%\tools\errcode.hxx
-..\inc\tools\errinf.hxx %_DEST%\inc%_EXT%\tools\errinf.hxx
-..\inc\tools\extendapplicationenvironment.hxx %_DEST%\inc%_EXT%\tools\extendapplicationenvironment.hxx
-..\inc\tools\fract.hxx %_DEST%\inc%_EXT%\tools\fract.hxx
-..\inc\tools\fsys.hxx %_DEST%\inc%_EXT%\tools\fsys.hxx
-..\inc\tools\eacopier.hxx %_DEST%\inc%_EXT%\tools\eacopier.hxx
-..\inc\tools\gen.hxx %_DEST%\inc%_EXT%\tools\gen.hxx
-..\inc\tools\globname.hxx %_DEST%\inc%_EXT%\tools\globname.hxx
-..\inc\tools\inetdef.hxx %_DEST%\inc%_EXT%\tools\inetdef.hxx
-..\inc\tools\inetmime.hxx %_DEST%\inc%_EXT%\tools\inetmime.hxx
-..\inc\tools\inetmsg.hxx %_DEST%\inc%_EXT%\tools\inetmsg.hxx
-..\inc\tools\inetstrm.hxx %_DEST%\inc%_EXT%\tools\inetstrm.hxx
-..\inc\tools\link.hxx %_DEST%\inc%_EXT%\tools\link.hxx
-..\inc\tools\list.hxx %_DEST%\inc%_EXT%\tools\list.hxx
-..\inc\tools\mempool.hxx %_DEST%\inc%_EXT%\tools\mempool.hxx
-..\inc\tools\multisel.hxx %_DEST%\inc%_EXT%\tools\multisel.hxx
-..\inc\tools\ownlist.hxx %_DEST%\inc%_EXT%\tools\ownlist.hxx
-..\inc\tools\postsys.h %_DEST%\inc%_EXT%\tools\postsys.h
-..\inc\tools\presys.h %_DEST%\inc%_EXT%\tools\presys.h
-..\inc\tools\pstm.hxx %_DEST%\inc%_EXT%\tools\pstm.hxx
-..\inc\tools\queue.hxx %_DEST%\inc%_EXT%\tools\queue.hxx
-..\inc\tools\rc.h %_DEST%\inc%_EXT%\tools\rc.h
-..\inc\tools\rc.hxx %_DEST%\inc%_EXT%\tools\rc.hxx
-..\inc\tools\rcid.h %_DEST%\inc%_EXT%\tools\rcid.h
-..\inc\tools\ref.hxx %_DEST%\inc%_EXT%\tools\ref.hxx
-..\inc\tools\resid.hxx %_DEST%\inc%_EXT%\tools\resid.hxx
-..\inc\tools\resmgr.hxx %_DEST%\inc%_EXT%\tools\resmgr.hxx
-..\inc\tools\StringListResource.hxx %_DEST%\inc%_EXT%\tools\StringListResource.hxx
-..\inc\tools\isofallback.hxx %_DEST%\inc%_EXT%\tools\isofallback.hxx
-..\inc\tools\rtti.hxx %_DEST%\inc%_EXT%\tools\rtti.hxx
-..\inc\tools\shl.hxx %_DEST%\inc%_EXT%\tools\shl.hxx
-..\inc\tools\simplerm.hxx %_DEST%\inc%_EXT%\tools\simplerm.hxx
-..\inc\tools\solar.h %_DEST%\inc%_EXT%\tools\solar.h
-..\inc\tools\stack.hxx %_DEST%\inc%_EXT%\tools\stack.hxx
-..\inc\tools\stream.hxx %_DEST%\inc%_EXT%\tools\stream.hxx
-..\inc\tools\string.hxx %_DEST%\inc%_EXT%\tools\string.hxx
-..\inc\tools\svwin.h %_DEST%\inc%_EXT%\tools\svwin.h
-..\inc\tools\table.hxx %_DEST%\inc%_EXT%\tools\table.hxx
-..\inc\tools\tenccvt.hxx %_DEST%\inc%_EXT%\tools\tenccvt.hxx
-..\inc\tools\time.hxx %_DEST%\inc%_EXT%\tools\time.hxx
-..\inc\tools\tools.h %_DEST%\inc%_EXT%\tools\tools.h
-..\inc\tools\unqid.hxx %_DEST%\inc%_EXT%\tools\unqid.hxx
-..\inc\tools\unqidx.hxx %_DEST%\inc%_EXT%\tools\unqidx.hxx
-..\inc\tools\urlkeys.hxx %_DEST%\inc%_EXT%\tools\urlkeys.hxx
-..\inc\tools\urlobj.hxx %_DEST%\inc%_EXT%\tools\urlobj.hxx
-..\inc\tools\vcompat.hxx %_DEST%\inc%_EXT%\tools\vcompat.hxx
-..\inc\tools\wldcrd.hxx %_DEST%\inc%_EXT%\tools\wldcrd.hxx
-..\inc\tools\zcodec.hxx %_DEST%\inc%_EXT%\tools\zcodec.hxx
-..\inc\tools\tempfile.hxx %_DEST%\inc%_EXT%\tools\tempfile.hxx
-..\inc\tools\geninfo.hxx %_DEST%\inc%_EXT%\tools\geninfo.hxx
-..\inc\tools\iparser.hxx %_DEST%\inc%_EXT%\tools\iparser.hxx
-..\inc\tools\config.hxx %_DEST%\inc%_EXT%\tools\config.hxx
-..\inc\tools\resary.hxx %_DEST%\inc%_EXT%\tools\resary.hxx
-..\inc\tools\poly.hxx %_DEST%\inc%_EXT%\tools\poly.hxx
-..\inc\tools\line.hxx %_DEST%\inc%_EXT%\tools\line.hxx
-..\inc\tools\vector2d.hxx %_DEST%\inc%_EXT%\tools\vector2d.hxx
-..\inc\tools\testtoolloader.hxx %_DEST%\inc%_EXT%\tools\testtoolloader.hxx
-..\inc\tools\svborder.hxx %_DEST%\inc%_EXT%\tools\svborder.hxx
-..\inc\tools\getprocessworkingdir.hxx %_DEST%\inc%_EXT%\tools\getprocessworkingdir.hxx
-..\inc\tools\b3dtrans.hxx %_DEST%\inc%_EXT%\tools\b3dtrans.hxx
-
-..\%__SRC%\bin\rscdep.exe %_DEST%\bin%_EXT%\rscdep.exe
-..\%__SRC%\bin\rscdep %_DEST%\bin%_EXT%\rscdep
-..\%__SRC%\bin\so_checksum.exe %_DEST%\bin%_EXT%\so_checksum.exe
-..\%__SRC%\bin\so_checksum %_DEST%\bin%_EXT%\so_checksum
-
-..\inc\tools\pathutils.hxx %_DEST%\inc%_EXT%\tools\pathutils.hxx
-..\%__SRC%\obj\pathutils.obj %_DEST%\lib%_EXT%\pathutils-obj.obj
-..\%__SRC%\slo\pathutils.obj %_DEST%\lib%_EXT%\pathutils-slo.obj
diff --git a/tools/prj/makefile.mk b/tools/prj/makefile.mk
new file mode 100644
index 000000000000..e312a7ccab65
--- /dev/null
+++ b/tools/prj/makefile.mk
@@ -0,0 +1,40 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..
+TARGET=prj
+
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/tools/qa/makefile.mk b/tools/qa/makefile.mk
deleted file mode 100644
index e82b39337ac2..000000000000
--- a/tools/qa/makefile.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..
-PRJNAME = tools
-TARGET = qa
-ENABLE_EXCEPTIONS = TRUE
-
-.INCLUDE: settings.mk
-
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
-DLLPRE = # no leading "lib" on .so files
-
-SHL1TARGET=test_tools
-SHL1OBJS=\
- $(SLO)$/pathutils.obj \
- $(SLO)$/test_pathutils.obj \
- $(SLO)$/test_reversemap.obj
-SHL1STDLIBS = $(TOOLSLIB) $(CPPUNITLIB) $(SALLIB)
-SHL1VERSIONMAP = version.map
-SHL1IMPLIB = i$(SHL1TARGET)
-DEF1NAME = $(SHL1TARGET)
-
-SLOFILES = $(SHL1OBJS)
-
-.INCLUDE: target.mk
-.INCLUDE: _cppunit.mk
diff --git a/tools/source/communi/geninfo.cxx b/tools/source/communi/geninfo.cxx
index 988816111def..bc05827ab622 100644
--- a/tools/source/communi/geninfo.cxx
+++ b/tools/source/communi/geninfo.cxx
@@ -56,7 +56,7 @@ GenericInformation::GenericInformation( const ByteString &rKey,
/*****************************************************************************/
GenericInformation::GenericInformation( const GenericInformation& rInf,
- BOOL bCopySubs)
+ sal_Bool bCopySubs)
/*****************************************************************************/
: ByteString( rInf ),
sValue( rInf.sValue ),
@@ -81,15 +81,15 @@ GenericInformation::~GenericInformation()
}
/*****************************************************************************/
-BOOL GenericInformation::InsertSubInfo( GenericInformation *pInfo )
+sal_Bool GenericInformation::InsertSubInfo( GenericInformation *pInfo )
/*****************************************************************************/
{
return ( pInfoList && pInfoList->InsertInfo( pInfo ));
}
/*****************************************************************************/
-BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath, BOOL bNewPath )
+sal_Bool GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath, sal_Bool bNewPath )
/*****************************************************************************/
{
return (pInfoList && pInfoList->InsertInfo( rPathKey, rValue, bSearchByPath, bNewPath ));
@@ -97,7 +97,7 @@ BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteSt
/*****************************************************************************/
void GenericInformation::RemoveSubInfo( GenericInformation *pInfo,
- BOOL bDelete )
+ sal_Bool bDelete )
/*****************************************************************************/
{
pInfoList->RemoveInfo( pInfo, bDelete );
@@ -105,8 +105,8 @@ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo,
/*****************************************************************************/
GenericInformation *GenericInformation::GetSubInfo( ByteString &rKey,
- BOOL bSearchByPath,
- BOOL bCreatePath )
+ sal_Bool bSearchByPath,
+ sal_Bool bCreatePath )
/*****************************************************************************/
{
if ( !pInfoList && bCreatePath )
@@ -142,7 +142,7 @@ GenericInformationList::GenericInformationList(
for( size_t i = 0; i < rList.size(); i++ )
{
pTemp = rList[ i ];
- pWork = new GenericInformation( *pTemp, TRUE );
+ pWork = new GenericInformation(*pTemp,sal_True);
maList.push_back( pWork );
}
@@ -203,8 +203,8 @@ GenericInformation *GenericInformationList::Search(
/*****************************************************************************/
GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
- BOOL bSearchByPath,
- BOOL bCreatePath )
+ sal_Bool bSearchByPath,
+ sal_Bool bCreatePath )
/*****************************************************************************/
{
@@ -226,7 +226,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
* wenn searchpath gesetzt kein returninfo vorhanden und newpath gesetzt,
* mache neues Verzeichniss
*/
- USHORT nTokenCount = rKey.GetTokenCount('/');
+ sal_uInt16 nTokenCount = rKey.GetTokenCount('/');
// search for next key of path in next level of tree
if ( bSearchByPath && (nTokenCount > 1)) {
ByteString sPath = ByteString(rKey.Copy( sKey.Len() + 1 ));
@@ -236,7 +236,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
pReturnInfo = new GenericInformation( sKey, "", this, NULL);
pReturnInfo->SetSubList( new GenericInformationList( pReturnInfo ));
}
- return pReturnInfo->GetSubInfo( sPath, TRUE, bCreatePath );
+ return pReturnInfo->GetSubInfo( sPath, sal_True, bCreatePath );
}
if ( !pReturnInfo && bCreatePath ) {
pReturnInfo = new GenericInformation ( sKey, "", this, NULL);
@@ -248,7 +248,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
/*****************************************************************************/
size_t GenericInformationList::InsertSorted(
GenericInformation *pInfo,
- BOOL bOverwrite,
+ sal_Bool bOverwrite,
size_t nStart,
size_t nEnd
)
@@ -346,21 +346,21 @@ size_t GenericInformationList::InsertSorted(
}
/*****************************************************************************/
-BOOL GenericInformationList::InsertInfo( GenericInformation *pInfo,
- BOOL bOverwrite )
+sal_Bool GenericInformationList::InsertInfo( GenericInformation *pInfo,
+ sal_Bool bOverwrite )
/*****************************************************************************/
{
if ( !pInfo->Len())
- return FALSE;
+ return sal_False;
InsertSorted( pInfo, bOverwrite, 0, maList.size() - 1 );
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath, BOOL bNewPath )
+sal_Bool GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath, sal_Bool bNewPath )
/*****************************************************************************/
{
GenericInformation *pInfo;
@@ -372,14 +372,14 @@ BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteS
if ( pInfo ) {
pInfo->SetValue( rValue );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*****************************************************************************/
void GenericInformationList::RemoveInfo( GenericInformation *pInfo,
- BOOL bDelete )
+ sal_Bool bDelete )
/*****************************************************************************/
{
for (
diff --git a/tools/source/communi/makefile.mk b/tools/source/communi/makefile.mk
deleted file mode 100644
index 1795081a9ec5..000000000000
--- a/tools/source/communi/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=TOOLS
-TARGET=communi
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= \
- $(OBJ)$/parser.obj \
- $(OBJ)$/geninfo.obj \
-
-SLOFILES= \
- $(SLO)$/parser.obj \
- $(SLO)$/geninfo.obj \
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/communi/parser.cxx b/tools/source/communi/parser.cxx
index bd2c87846aaf..f0e3534a8dce 100644
--- a/tools/source/communi/parser.cxx
+++ b/tools/source/communi/parser.cxx
@@ -43,9 +43,9 @@
#define cKeyLevelChar '\t'
/*****************************************************************************/
-InformationParser::InformationParser( BOOL bReplace )
+InformationParser::InformationParser( sal_Bool bReplace )
/*****************************************************************************/
- : bRecover( FALSE ),
+ : bRecover( sal_False ),
sOldLine( "" ),
bReplaceVariables( bReplace ),
nLevel( 0 ),
@@ -72,24 +72,24 @@ ByteString &InformationParser::ReadLine()
ByteString sLine;
if ( bRecover ) {
- bRecover = FALSE;
+ bRecover = sal_False;
}
else {
if ( !pActStream->IsEof()) {
pActStream->ReadLine( sLine );
xub_StrLen nStart = 0;
xub_StrLen nEnd = sLine.Len();
- BOOL bCopy = FALSE;
+ sal_Bool bCopy = sal_False;
while ( nStart < nEnd && ( sLine.GetChar( nStart ) == ' ' || sLine.GetChar( nStart ) == 0x09 ) )
{
nStart++;
- bCopy = TRUE;
+ bCopy = sal_True;
}
while ( nStart < nEnd && ( sLine.GetChar( nEnd-1 ) == ' ' || sLine.GetChar( nEnd-1 ) == 0x09 ) )
{
nEnd--;
- bCopy = TRUE;
+ bCopy = sal_True;
}
if ( bCopy )
@@ -163,7 +163,7 @@ GenericInformation *InformationParser::ReadKey(
sCurrentComment = "";
// key separated from value by tab?
- USHORT nWSPos = sLine.Search( ' ' );
+ sal_uInt16 nWSPos = sLine.Search( ' ' );
if ( sLine.Search( '\t' ) < nWSPos ) {
nWSPos = sLine.Search( '\t' );
sLine.SearchAndReplace( "\t", " " );
@@ -212,17 +212,17 @@ GenericInformation *InformationParser::ReadKey(
void InformationParser::Recover()
/*****************************************************************************/
{
- bRecover = TRUE;
+ bRecover = sal_True;
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvStream &rOutStream,
+sal_Bool InformationParser::Save( SvStream &rOutStream,
const GenericInformationList *pSaveList,
- USHORT level, BOOL bStripped )
+ sal_uInt16 level, sal_Bool bStripped )
/*****************************************************************************/
{
- USHORT i;
- ULONG nInfoListCount;
+ sal_uInt16 i;
+ sal_uIntPtr nInfoListCount;
ByteString sTmpStr;
GenericInformation *pGenericInfo;
GenericInformationList *pGenericInfoList;
@@ -249,7 +249,7 @@ BOOL InformationParser::Save( SvStream &rOutStream,
sTmpStr += ' ';
sTmpStr += pGenericInfo->GetValue();
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
// wenn vorhanden, bearbeite recursive die Sublisten
if (( pGenericInfoList = pGenericInfo->GetSubList() ) != NULL ) {
@@ -259,20 +259,20 @@ BOOL InformationParser::Save( SvStream &rOutStream,
sTmpStr.Append( aKeyLevel.GetBuffer(), level );
sTmpStr += '{';
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
// recursiv die sublist abarbeiten
if ( !Save( rOutStream, pGenericInfoList, level+1, bStripped ) )
- return FALSE;
+ return sal_False;
// schliessende Klammer
sTmpStr = "";
if ( !bStripped && level )
sTmpStr.Append( aKeyLevel.GetBuffer(), level );
sTmpStr += '}';
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
@@ -372,7 +372,7 @@ GenericInformationList *InformationParser::Execute( Dir &rDir,
else
pList = new GenericInformationList();
- for ( USHORT i = 0; i < rDir.Count(); i++ ) {
+ for ( sal_uInt16 i = 0; i < rDir.Count(); i++ ) {
// execute this dir
UniString sNextFile( rDir[i].GetFull());
@@ -396,33 +396,33 @@ GenericInformationList *InformationParser::Execute( Dir &rDir,
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvFileStream &rSourceStream,
+sal_Bool InformationParser::Save( SvFileStream &rSourceStream,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
- if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, FALSE ))
+ if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, sal_False ))
{
printf( "ERROR saving file \"%s\"\n",ByteString( rSourceStream.GetFileName(), gsl_getSystemTextEncoding()).GetBuffer() );
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvMemoryStream &rSourceStream,
+sal_Bool InformationParser::Save( SvMemoryStream &rSourceStream,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
Time a;
- BOOL bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, TRUE );
+ sal_Bool bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, sal_True );
Time b;
b = b - a;
return bRet;
}
/*****************************************************************************/
-BOOL InformationParser::Save( const UniString &rSourceFile,
+sal_Bool InformationParser::Save( const UniString &rSourceFile,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
@@ -430,14 +430,14 @@ BOOL InformationParser::Save( const UniString &rSourceFile,
if ( !Save( *pOutFile, pSaveList )) {
delete pOutFile;
- return FALSE;
+ return sal_False;
}
delete pOutFile;
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-USHORT InformationParser::GetErrorCode()
+sal_uInt16 InformationParser::GetErrorCode()
/*****************************************************************************/
{
return nErrorCode;
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx
index 593d709626d3..05d25edd91b9 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -38,13 +38,13 @@
|*
*************************************************************************/
-BOOL DateTime::IsBetween( const DateTime& rFrom,
+sal_Bool DateTime::IsBetween( const DateTime& rFrom,
const DateTime& rTo ) const
{
if ( (*this >= rFrom) && (*this <= rTo) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -53,13 +53,13 @@ BOOL DateTime::IsBetween( const DateTime& rFrom,
|*
*************************************************************************/
-BOOL DateTime::operator >( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator >( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -68,13 +68,13 @@ BOOL DateTime::operator >( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator <( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator <( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -83,13 +83,13 @@ BOOL DateTime::operator <( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator >=( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator >=( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>=( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -98,13 +98,13 @@ BOOL DateTime::operator >=( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator <=( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator <=( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<=( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -134,14 +134,14 @@ long DateTime::GetSecFromDateTime( const Date& rDate ) const
|*
*************************************************************************/
-void DateTime::MakeDateTimeFromSec( const Date& rDate, ULONG nSec )
+void DateTime::MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec )
{
long nDays = nSec / (24UL*60*60);
((Date*)this)->operator=( rDate );
nSec -= nDays * (24UL*60*60);
- USHORT nMin = (USHORT)(nSec / 60);
+ sal_uInt16 nMin = (sal_uInt16)(nSec / 60);
nSec -= nMin * 60;
- ((Time*)this)->operator=( Time( 0, nMin, (USHORT)nSec ) );
+ ((Time*)this)->operator=( Time( 0, nMin, (sal_uInt16)nSec ) );
operator+=( nDays );
}
@@ -155,7 +155,7 @@ DateTime& DateTime::operator +=( const Time& rTime )
{
Time aTime = *this;
aTime += rTime;
- USHORT nHours = aTime.GetHour();
+ sal_uInt16 nHours = aTime.GetHour();
if ( aTime.GetTime() > 0 )
{
while ( nHours >= 24 )
@@ -190,7 +190,7 @@ DateTime& DateTime::operator -=( const Time& rTime )
{
Time aTime = *this;
aTime -= rTime;
- USHORT nHours = aTime.GetHour();
+ sal_uInt16 nHours = aTime.GetHour();
if ( aTime.GetTime() > 0 )
{
while ( nHours >= 24 )
@@ -370,22 +370,22 @@ DateTime DateTime::CreateFromWin32FileDateTime( const sal_uInt32 & rLower, const
( nDays / ( 400 * 365 ) ) ) / 365;
nDays -= nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400;
- USHORT nMonths = 0;
+ sal_uInt16 nMonths = 0;
for( sal_Int64 nDaysCount = nDays; nDaysCount >= 0; )
{
nDays = nDaysCount;
nMonths ++;
nDaysCount -= Date(
- 1, nMonths, sal::static_int_cast< USHORT >(1601 + nYears) ).
+ 1, nMonths, sal::static_int_cast< sal_uInt16 >(1601 + nYears) ).
GetDaysInMonth();
}
Date _aDate(
- (USHORT)( nDays + 1 ), nMonths,
- sal::static_int_cast< USHORT >(nYears + 1601) );
- Time _aTime( ULONG( ( aTime / ( a100nPerSecond * 60 * 60 ) ) % sal_Int64( 24 ) ),
- ULONG( ( aTime / ( a100nPerSecond * 60 ) ) % sal_Int64( 60 ) ),
- ULONG( ( aTime / ( a100nPerSecond ) ) % sal_Int64( 60 ) ) );
+ (sal_uInt16)( nDays + 1 ), nMonths,
+ sal::static_int_cast< sal_uInt16 >(nYears + 1601) );
+ Time _aTime( sal_uIntPtr( ( aTime / ( a100nPerSecond * 60 * 60 ) ) % sal_Int64( 24 ) ),
+ sal_uIntPtr( ( aTime / ( a100nPerSecond * 60 ) ) % sal_Int64( 60 ) ),
+ sal_uIntPtr( ( aTime / ( a100nPerSecond ) ) % sal_Int64( 60 ) ) );
return DateTime( _aDate, _aTime );
}
diff --git a/tools/source/datetime/makefile.mk b/tools/source/datetime/makefile.mk
deleted file mode 100644
index 3d46cc6ce1b0..000000000000
--- a/tools/source/datetime/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=datetime
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/tdate.obj \
- $(SLO)$/ttime.obj \
- $(SLO)$/datetime.obj
-
-OBJFILES= $(OBJ)$/tdate.obj \
- $(OBJ)$/ttime.obj \
- $(OBJ)$/datetime.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index eca1ab40b49e..fcd739bfda68 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -54,14 +54,14 @@ struct tm *localtime_r(const time_t *timep, struct tm *buffer);
// =======================================================================
-static USHORT aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
+static sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
#define MAX_DAYS 3636532
// =======================================================================
-inline BOOL ImpIsLeapYear( USHORT nYear )
+inline sal_Bool ImpIsLeapYear( sal_uInt16 nYear )
{
return (
( ((nYear % 4) == 0) && ((nYear % 100) != 0) ) ||
@@ -71,7 +71,7 @@ inline BOOL ImpIsLeapYear( USHORT nYear )
// -----------------------------------------------------------------------
-inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
+inline sal_uInt16 DaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear )
{
if ( nMonth != 2 )
return aDaysInMonth[nMonth-1];
@@ -86,13 +86,13 @@ inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
// -----------------------------------------------------------------------
-long Date::DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
+long Date::DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
{
long nDays;
- nDays = ((ULONG)nYear-1) * 365;
+ nDays = ((sal_uIntPtr)nYear-1) * 365;
nDays += ((nYear-1) / 4) - ((nYear-1) / 100) + ((nYear-1) / 400);
- for( USHORT i = 1; i < nMonth; i++ )
+ for( sal_uInt16 i = 1; i < nMonth; i++ )
nDays += DaysInMonth(i,nYear);
nDays += nDay;
return nDays;
@@ -101,23 +101,23 @@ long Date::DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
// -----------------------------------------------------------------------
static void DaysToDate( long nDays,
- USHORT& rDay, USHORT& rMonth, USHORT& rYear )
+ sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt16& rYear )
{
long nTempDays;
long i = 0;
- BOOL bCalc;
+ sal_Bool bCalc;
do
{
nTempDays = (long)nDays;
- rYear = (USHORT)((nTempDays / 365) - i);
- nTempDays -= ((ULONG)rYear-1) * 365;
+ rYear = (sal_uInt16)((nTempDays / 365) - i);
+ nTempDays -= ((sal_uIntPtr)rYear-1) * 365;
nTempDays -= ((rYear-1) / 4) - ((rYear-1) / 100) + ((rYear-1) / 400);
- bCalc = FALSE;
+ bCalc = sal_False;
if ( nTempDays < 1 )
{
i++;
- bCalc = TRUE;
+ bCalc = sal_True;
}
else
{
@@ -126,7 +126,7 @@ static void DaysToDate( long nDays,
if ( (nTempDays != 366) || !ImpIsLeapYear( rYear ) )
{
i--;
- bCalc = TRUE;
+ bCalc = sal_True;
}
}
}
@@ -134,12 +134,12 @@ static void DaysToDate( long nDays,
while ( bCalc );
rMonth = 1;
- while ( (ULONG)nTempDays > DaysInMonth( rMonth, rYear ) )
+ while ( (sal_uIntPtr)nTempDays > DaysInMonth( rMonth, rYear ) )
{
nTempDays -= DaysInMonth( rMonth, rYear );
rMonth++;
}
- rDay = (USHORT)nTempDays;
+ rDay = (sal_uInt16)nTempDays;
}
// =======================================================================
@@ -151,17 +151,17 @@ Date::Date()
DosGetDateTime( &aDateTime );
// Datum zusammenbauen
- nDate = ((ULONG)aDateTime.day) +
- (((ULONG)aDateTime.month)*100) +
- (((ULONG)aDateTime.year)*10000);
+ nDate = ((sal_uIntPtr)aDateTime.day) +
+ (((sal_uIntPtr)aDateTime.month)*100) +
+ (((sal_uIntPtr)aDateTime.year)*10000);
#elif defined WNT
SYSTEMTIME aDateTime;
GetLocalTime( &aDateTime );
// Datum zusammenbauen
- nDate = ((ULONG)aDateTime.wDay) +
- (((ULONG)aDateTime.wMonth)*100) +
- (((ULONG)aDateTime.wYear)*10000);
+ nDate = ((sal_uIntPtr)aDateTime.wDay) +
+ (((sal_uIntPtr)aDateTime.wMonth)*100) +
+ (((sal_uIntPtr)aDateTime.wYear)*10000);
#else
time_t nTmpTime;
struct tm aTime;
@@ -172,65 +172,65 @@ Date::Date()
// Datum zusammenbauen
if ( localtime_r( &nTmpTime, &aTime ) )
{
- nDate = ((ULONG)aTime.tm_mday) +
- (((ULONG)(aTime.tm_mon+1))*100) +
- (((ULONG)(aTime.tm_year+1900))*10000);
+ nDate = ((sal_uIntPtr)aTime.tm_mday) +
+ (((sal_uIntPtr)(aTime.tm_mon+1))*100) +
+ (((sal_uIntPtr)(aTime.tm_year+1900))*10000);
}
else
- nDate = 1 + 100 + (((ULONG)1900)*10000);
+ nDate = 1 + 100 + (((sal_uIntPtr)1900)*10000);
#endif
}
// -----------------------------------------------------------------------
-void Date::SetDay( USHORT nNewDay )
+void Date::SetDay( sal_uInt16 nNewDay )
{
- ULONG nMonth = GetMonth();
- ULONG nYear = GetYear();
+ sal_uIntPtr nMonth = GetMonth();
+ sal_uIntPtr nYear = GetYear();
- nDate = ((ULONG)(nNewDay%100)) + (nMonth*100) + (nYear*10000);
+ nDate = ((sal_uIntPtr)(nNewDay%100)) + (nMonth*100) + (nYear*10000);
}
// -----------------------------------------------------------------------
-void Date::SetMonth( USHORT nNewMonth )
+void Date::SetMonth( sal_uInt16 nNewMonth )
{
- ULONG nDay = GetDay();
- ULONG nYear = GetYear();
+ sal_uIntPtr nDay = GetDay();
+ sal_uIntPtr nYear = GetYear();
- nDate = nDay + (((ULONG)(nNewMonth%100))*100) + (nYear*10000);
+ nDate = nDay + (((sal_uIntPtr)(nNewMonth%100))*100) + (nYear*10000);
}
// -----------------------------------------------------------------------
-void Date::SetYear( USHORT nNewYear )
+void Date::SetYear( sal_uInt16 nNewYear )
{
- ULONG nDay = GetDay();
- ULONG nMonth = GetMonth();
+ sal_uIntPtr nDay = GetDay();
+ sal_uIntPtr nMonth = GetMonth();
- nDate = nDay + (nMonth*100) + (((ULONG)(nNewYear%10000))*10000);
+ nDate = nDay + (nMonth*100) + (((sal_uIntPtr)(nNewYear%10000))*10000);
}
// -----------------------------------------------------------------------
DayOfWeek Date::GetDayOfWeek() const
{
- return (DayOfWeek)((ULONG)(DateToDays( GetDay(), GetMonth(), GetYear() )-1) % 7);
+ return (DayOfWeek)((sal_uIntPtr)(DateToDays( GetDay(), GetMonth(), GetYear() )-1) % 7);
}
// -----------------------------------------------------------------------
-USHORT Date::GetDayOfYear() const
+sal_uInt16 Date::GetDayOfYear() const
{
- USHORT nDay = GetDay();
- for( USHORT i = 1; i < GetMonth(); i++ )
+ sal_uInt16 nDay = GetDay();
+ for( sal_uInt16 i = 1; i < GetMonth(); i++ )
nDay = nDay + ::DaysInMonth( i, GetYear() ); // += yields a warning on MSVC, so don't use it
return nDay;
}
// -----------------------------------------------------------------------
-USHORT Date::GetWeekOfYear( DayOfWeek eStartDay,
+sal_uInt16 Date::GetWeekOfYear( DayOfWeek eStartDay,
sal_Int16 nMinimumNumberOfDaysInWeek ) const
{
short nWeek;
@@ -308,76 +308,76 @@ USHORT Date::GetWeekOfYear( DayOfWeek eStartDay,
// == noch gleiche Woche
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays += 6 - (GetDayOfWeek()+(7-(short)eStartDay)) % 7;
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
DaysToDate( nTempDays, nDay, nMonth, nYear );
nWeek = Date( nDay, nMonth, nYear ).GetWeekOfYear( eStartDay, nMinimumNumberOfDaysInWeek );
}
}
}
- return (USHORT)nWeek;
+ return (sal_uInt16)nWeek;
}
// -----------------------------------------------------------------------
-USHORT Date::GetDaysInMonth() const
+sal_uInt16 Date::GetDaysInMonth() const
{
return DaysInMonth( GetMonth(), GetYear() );
}
// -----------------------------------------------------------------------
-BOOL Date::IsLeapYear() const
+sal_Bool Date::IsLeapYear() const
{
- USHORT nYear = GetYear();
+ sal_uInt16 nYear = GetYear();
return ImpIsLeapYear( nYear );
}
// -----------------------------------------------------------------------
-BOOL Date::IsValid() const
+sal_Bool Date::IsValid() const
{
- USHORT nDay = GetDay();
- USHORT nMonth = GetMonth();
- USHORT nYear = GetYear();
+ sal_uInt16 nDay = GetDay();
+ sal_uInt16 nMonth = GetMonth();
+ sal_uInt16 nYear = GetYear();
if ( !nMonth || (nMonth > 12) )
- return FALSE;
+ return sal_False;
if ( !nDay || (nDay > DaysInMonth( nMonth, nYear )) )
- return FALSE;
+ return sal_False;
else if ( nYear <= 1582 )
{
if ( nYear < 1582 )
- return FALSE;
+ return sal_False;
else if ( nMonth < 10 )
- return FALSE;
+ return sal_False;
else if ( (nMonth == 10) && (nDay < 15) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
Date& Date::operator +=( long nDays )
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays += nDays;
if ( nTempDays > MAX_DAYS )
- nDate = 31 + (12*100) + (((ULONG)9999)*10000);
+ nDate = 31 + (12*100) + (((sal_uIntPtr)9999)*10000);
else if ( nTempDays <= 0 )
nDate = 1 + 100;
else
{
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -387,20 +387,20 @@ Date& Date::operator +=( long nDays )
Date& Date::operator -=( long nDays )
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays -= nDays;
if ( nTempDays > MAX_DAYS )
- nDate = 31 + (12*100) + (((ULONG)9999)*10000);
+ nDate = 31 + (12*100) + (((sal_uIntPtr)9999)*10000);
else if ( nTempDays <= 0 )
nDate = 1 + 100;
else
{
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -410,16 +410,16 @@ Date& Date::operator -=( long nDays )
Date& Date::operator ++()
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
if ( nTempDays < MAX_DAYS )
{
nTempDays++;
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -429,16 +429,16 @@ Date& Date::operator ++()
Date& Date::operator --()
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
if ( nTempDays > 1 )
{
nTempDays--;
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
}
@@ -487,9 +487,9 @@ Date operator -( const Date& rDate, long nDays )
long operator -( const Date& rDate1, const Date& rDate2 )
{
- ULONG nTempDays1 = Date::DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
+ sal_uIntPtr nTempDays1 = Date::DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
rDate1.GetYear() );
- ULONG nTempDays2 = Date::DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
+ sal_uIntPtr nTempDays2 = Date::DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
rDate2.GetYear() );
return nTempDays1 - nTempDays2;
}
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 44a626284456..a7efa63c9290 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -146,7 +146,7 @@ Time::Time( const Time& rTime )
// -----------------------------------------------------------------------
-Time::Time( ULONG nHour, ULONG nMin, ULONG nSec, ULONG n100Sec )
+Time::Time( sal_uIntPtr nHour, sal_uIntPtr nMin, sal_uIntPtr nSec, sal_uIntPtr n100Sec )
{
// Zeit normalisieren
nSec += n100Sec / 100;
@@ -162,7 +162,7 @@ Time::Time( ULONG nHour, ULONG nMin, ULONG nSec, ULONG n100Sec )
// -----------------------------------------------------------------------
-void Time::SetHour( USHORT nNewHour )
+void Time::SetHour( sal_uInt16 nNewHour )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nMin = GetMin();
@@ -175,7 +175,7 @@ void Time::SetHour( USHORT nNewHour )
// -----------------------------------------------------------------------
-void Time::SetMin( USHORT nNewMin )
+void Time::SetMin( sal_uInt16 nNewMin )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -191,7 +191,7 @@ void Time::SetMin( USHORT nNewMin )
// -----------------------------------------------------------------------
-void Time::SetSec( USHORT nNewSec )
+void Time::SetSec( sal_uInt16 nNewSec )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -207,7 +207,7 @@ void Time::SetSec( USHORT nNewSec )
// -----------------------------------------------------------------------
-void Time::Set100Sec( USHORT nNew100Sec )
+void Time::Set100Sec( sal_uInt16 nNew100Sec )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -308,7 +308,7 @@ Time operator -( const Time& rTime1, const Time& rTime2 )
// -----------------------------------------------------------------------
-BOOL Time::IsEqualIgnore100Sec( const Time& rTime ) const
+sal_Bool Time::IsEqualIgnore100Sec( const Time& rTime ) const
{
sal_Int32 n1 = (nTime < 0 ? -Get100Sec() : Get100Sec() );
sal_Int32 n2 = (rTime.nTime < 0 ? -rTime.Get100Sec() : rTime.Get100Sec() );
@@ -328,7 +328,7 @@ Time Time::GetUTCOffset()
if ( aDateTime.timezone != -1 )
{
short nTempTime = (short)Abs( aDateTime.timezone );
- Time aTime( 0, (USHORT)nTempTime );
+ Time aTime( 0, (sal_uInt16)nTempTime );
if ( aDateTime.timezone > 0 )
aTime = -aTime;
return aTime;
@@ -344,14 +344,14 @@ Time Time::GetUTCOffset()
nTempTime += aTimeZone.StandardBias;
else if ( nTimeZoneRet == TIME_ZONE_ID_DAYLIGHT )
nTempTime += aTimeZone.DaylightBias;
- Time aTime( 0, (USHORT)Abs( nTempTime ) );
+ Time aTime( 0, (sal_uInt16)Abs( nTempTime ) );
if ( nTempTime > 0 )
aTime = -aTime;
return aTime;
#else
- static ULONG nCacheTicks = 0;
+ static sal_uIntPtr nCacheTicks = 0;
static sal_Int32 nCacheSecOffset = -1;
- ULONG nTicks = Time::GetSystemTicks();
+ sal_uIntPtr nTicks = Time::GetSystemTicks();
time_t nTime;
tm aTM;
sal_Int32 nLocalTime;
@@ -383,7 +383,7 @@ Time Time::GetUTCOffset()
}
nTempTime = (short)Abs( nCacheSecOffset );
- Time aTime( 0, (USHORT)nTempTime );
+ Time aTime( 0, (sal_uInt16)nTempTime );
if ( nCacheSecOffset < 0 )
aTime = -aTime;
return aTime;
@@ -393,14 +393,14 @@ Time Time::GetUTCOffset()
// -----------------------------------------------------------------------
-ULONG Time::GetSystemTicks()
+sal_uIntPtr Time::GetSystemTicks()
{
#if defined WNT
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
timeval tv;
gettimeofday (&tv, 0);
@@ -410,38 +410,38 @@ ULONG Time::GetSystemTicks()
fTicks += ((tv.tv_usec + 500) / 1000);
fTicks = fmod (fTicks, double(ULONG_MAX));
- return ULONG(fTicks);
+ return sal_uIntPtr(fTicks);
#endif
}
// -----------------------------------------------------------------------
-ULONG Time::GetProcessTicks()
+sal_uIntPtr Time::GetProcessTicks()
{
#if defined WNT
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
- static ULONG nImplTicksPerSecond = 0;
+ static sal_uIntPtr nImplTicksPerSecond = 0;
static double dImplTicksPerSecond;
static double dImplTicksULONGMAX;
- ULONG nTicks = (ULONG)clock();
+ sal_uIntPtr nTicks = (sal_uIntPtr)clock();
if ( !nImplTicksPerSecond )
{
nImplTicksPerSecond = CLOCKS_PER_SEC;
dImplTicksPerSecond = nImplTicksPerSecond;
- dImplTicksULONGMAX = (double)(ULONG)ULONG_MAX;
+ dImplTicksULONGMAX = (double)(sal_uIntPtr)ULONG_MAX;
}
double fTicks = nTicks;
fTicks *= 1000;
fTicks /= dImplTicksPerSecond;
fTicks = fmod (fTicks, dImplTicksULONGMAX);
- return (ULONG)fTicks;
+ return (sal_uIntPtr)fTicks;
#endif
}
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 7564e1d76594..c65745e65be0 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -96,7 +96,7 @@ static sal_Char const DbgTrace_LeaveMeth[] = "Leave method from class ";
struct PBlock
{
void* aData[PBLOCKCOUNT];
- USHORT nCount;
+ sal_uInt16 nCount;
PBlock* pPrev;
PBlock* pNext;
};
@@ -106,18 +106,18 @@ class PointerList
private:
PBlock* pFirst;
PBlock* pLast;
- ULONG nCount;
+ sal_uIntPtr nCount;
public:
PointerList() { pFirst = NULL; pLast = NULL; nCount = 0; }
~PointerList();
void Add( const void* p );
- BOOL Remove( const void* p );
+ sal_Bool Remove( const void* p );
- const void* Get( ULONG nPos ) const;
- BOOL IsIn( const void* p ) const;
- ULONG Count() const { return nCount; }
+ const void* Get( sal_uIntPtr nPos ) const;
+ sal_Bool IsIn( const void* p ) const;
+ sal_uIntPtr Count() const { return nCount; }
};
// --- Datentypen ---
@@ -126,31 +126,31 @@ public:
struct ProfType
{
- ULONG nCount;
- ULONG nTime;
- ULONG nMinTime;
- ULONG nMaxTime;
- ULONG nStart;
- ULONG nContinueTime;
- ULONG nContinueStart;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nTime;
+ sal_uIntPtr nMinTime;
+ sal_uIntPtr nMaxTime;
+ sal_uIntPtr nStart;
+ sal_uIntPtr nContinueTime;
+ sal_uIntPtr nContinueStart;
sal_Char aName[DBG_MAXNAME+1];
};
struct XtorType
{
- ULONG nCtorCalls;
- ULONG nDtorCalls;
- ULONG nMaxCount;
- ULONG nStatics;
+ sal_uIntPtr nCtorCalls;
+ sal_uIntPtr nDtorCalls;
+ sal_uIntPtr nMaxCount;
+ sal_uIntPtr nStatics;
sal_Char aName[DBG_MAXNAME+1];
- BOOL bTest;
+ sal_Bool bTest;
PointerList aThisList;
};
struct DebugData
{
DbgData aDbgData;
- USHORT bInit;
+ sal_uInt16 bInit;
DbgPrintLine pDbgPrintMsgBox;
DbgPrintLine pDbgPrintWindow;
DbgPrintLine pDbgPrintTestTool;
@@ -164,8 +164,8 @@ struct DebugData
bool bOslIsHooked;
DebugData()
- :bInit( FALSE )
- ,pDbgPrintMsgBox( FALSE )
+ :bInit( sal_False )
+ ,pDbgPrintMsgBox( sal_False )
,pDbgPrintWindow( NULL )
,pDbgPrintTestTool( NULL )
,pProfList( NULL )
@@ -175,7 +175,7 @@ struct DebugData
,bOslIsHooked( false )
{
aDbgData.nTestFlags = DBG_TEST_RESOURCE | DBG_TEST_MEM_INIT;
- aDbgData.bOverwrite = TRUE;
+ aDbgData.bOverwrite = sal_True;
aDbgData.nTraceOut = DBG_OUT_NULL;
aDbgData.nWarningOut = DBG_OUT_NULL;
#ifdef UNX
@@ -186,7 +186,7 @@ struct DebugData
aDbgData.bMemInit = 0x77;
aDbgData.bMemBound = 0x55;
aDbgData.bMemFree = 0x33;
- aDbgData.bHookOSLAssert = TRUE;
+ aDbgData.bHookOSLAssert = sal_True;
aDbgData.aDebugName[0] = 0;
aDbgData.aInclFilter[0] = 0;
aDbgData.aExclFilter[0] = 0;
@@ -207,7 +207,7 @@ static DebugData aDebugData;
static sal_Char aCurPath[260];
-static int bDbgImplInMain = FALSE;
+static int bDbgImplInMain = sal_False;
// =======================================================================
@@ -216,7 +216,7 @@ static CRITICAL_SECTION aImplCritDbgSection;
#elif defined( OS2 )
static HMTX hImplCritDbgSection = 0;
#endif
-static BOOL bImplCritDbgSectionInit = FALSE;
+static sal_Bool bImplCritDbgSectionInit = sal_False;
// -----------------------------------------------------------------------
@@ -225,9 +225,9 @@ void ImplDbgInitLock()
#if defined( WNT )
InitializeCriticalSection( &aImplCritDbgSection );
#elif defined( OS2 )
- DosCreateMutexSem( NULL, &hImplCritDbgSection, 0, FALSE );
+ DosCreateMutexSem( NULL, &hImplCritDbgSection, 0, sal_False );
#endif
- bImplCritDbgSectionInit = TRUE;
+ bImplCritDbgSectionInit = sal_True;
}
// -----------------------------------------------------------------------
@@ -239,7 +239,7 @@ void ImplDbgDeInitLock()
#elif defined( OS2 )
DosCloseMutexSem( hImplCritDbgSection );
#endif
- bImplCritDbgSectionInit = FALSE;
+ bImplCritDbgSectionInit = sal_False;
}
// -----------------------------------------------------------------------
@@ -285,7 +285,7 @@ void DbgImpMemoryInfo( sal_Char* pBuf );
// =======================================================================
-static BOOL ImplActivateDebugger( const sal_Char* pMsg )
+static sal_Bool ImplActivateDebugger( const sal_Char* pMsg )
{
#if defined( WNT )
static sal_Char aImplDbgOutBuf[DBG_BUF_MAXLEN];
@@ -293,16 +293,16 @@ static BOOL ImplActivateDebugger( const sal_Char* pMsg )
strcat( aImplDbgOutBuf, "\r\n" );
OutputDebugString( aImplDbgOutBuf );
DebugBreak();
- return TRUE;
+ return sal_True;
#else
(void) pMsg; // avoid warning about unused parameter
- return FALSE;
+ return sal_False;
#endif
}
// -----------------------------------------------------------------------
-static BOOL ImplCoreDump()
+static sal_Bool ImplCoreDump()
{
#if defined( WNT )
DebugBreak();
@@ -310,23 +310,23 @@ static BOOL ImplCoreDump()
long* pTemp = 0;
*pTemp = 0xCCCC;
#endif
- return TRUE;
+ return sal_True;
}
// =======================================================================
-static ULONG ImplGetPerfTime()
+static sal_uIntPtr ImplGetPerfTime()
{
#if defined( WNT )
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
- static ULONG nImplTicksPerSecond = 0;
+ static sal_uIntPtr nImplTicksPerSecond = 0;
static double dImplTicksPerSecond;
- ULONG nTicks = (ULONG)clock();
+ sal_uIntPtr nTicks = (sal_uIntPtr)clock();
if ( !nImplTicksPerSecond )
{
@@ -337,7 +337,7 @@ static ULONG ImplGetPerfTime()
double fTicks = nTicks;
fTicks *= 1000;
fTicks /= dImplTicksPerSecond;
- return (ULONG)fTicks;
+ return (sal_uIntPtr)fTicks;
#endif
}
@@ -417,12 +417,12 @@ namespace
lcl_writeConfigString( _pFile, _pKeyName, _bValue ? "1" : "0" );
}
- void lcl_writeConfigFlag( FILETYPE _pFile, const sal_Char* _pKeyName, ULONG _nAllFlags, ULONG _nCheckFlag )
+ void lcl_writeConfigFlag( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uIntPtr _nAllFlags, sal_uIntPtr _nCheckFlag )
{
lcl_writeConfigBoolean( _pFile, _pKeyName, ( _nAllFlags & _nCheckFlag ) != 0 );
}
- void lcl_writeConfigOutChannel( FILETYPE _pFile, const sal_Char* _pKeyName, ULONG _nValue )
+ void lcl_writeConfigOutChannel( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uIntPtr _nValue )
{
const sal_Char* names[ DBG_OUT_COUNT ] =
{
@@ -430,7 +430,7 @@ namespace
};
lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] );
}
- void lcl_writeHexByte( FILETYPE _pFile, const sal_Char* _pKeyName, BYTE _nValue )
+ void lcl_writeHexByte( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uInt8 _nValue )
{
sal_Char buf[RTL_STR_MAX_VALUEOFINT32];
rtl_String* stringData = NULL;
@@ -470,14 +470,14 @@ namespace
_pValue[ ( _nValueLen > nValueLen ) ? nValueLen : _nValueLen - 1 ] = 0;
return strlen( _pValue );
}
- void lcl_tryReadConfigBoolean( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnValue )
+ void lcl_tryReadConfigBoolean( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue )
{
sal_Char aBuf[2];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
- *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? TRUE : FALSE;
+ *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False;
}
- void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnValue )
+ void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue )
{
const sal_Char* names[ DBG_OUT_COUNT ] =
{
@@ -487,7 +487,7 @@ namespace
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
{
- for ( ULONG name = 0; name < SAL_N_ELEMENTS( names ); ++name )
+ for ( size_t name = 0; name < SAL_N_ELEMENTS( names ); ++name )
{
if ( strcmp( aBuf, names[ name ] ) == 0 )
{
@@ -497,7 +497,7 @@ namespace
}
}
}
- void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnAllFlags, ULONG _nCheckFlag )
+ void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag )
{
sal_Char aBuf[2];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
@@ -509,12 +509,12 @@ namespace
*_out_pnAllFlags &= ~_nCheckFlag;
}
}
- void lcl_tryReadHexByte( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, BYTE* _out_pnValue )
+ void lcl_tryReadHexByte( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uInt8* _out_pnValue )
{
sal_Char aBuf[3];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
- *_out_pnValue = (BYTE)rtl_str_toInt32( aBuf, 16 );
+ *_out_pnValue = (sal_uInt8)rtl_str_toInt32( aBuf, 16 );
}
}
@@ -560,7 +560,7 @@ void PointerList::Add( const void* p )
pLast = pBlock;
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( pBlock->aData[i] )
i++;
@@ -571,18 +571,18 @@ void PointerList::Add( const void* p )
// -----------------------------------------------------------------------
-BOOL PointerList::Remove( const void* p )
+sal_Bool PointerList::Remove( const void* p )
{
if ( !p )
- return FALSE;
+ return sal_False;
PBlock* pBlock = pFirst;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
- if ( ((ULONG)p) == ((ULONG)pBlock->aData[i]) )
+ if ( ((sal_uIntPtr)p) == ((sal_uIntPtr)pBlock->aData[i]) )
{
pBlock->aData[i] = NULL;
pBlock->nCount--;
@@ -601,7 +601,7 @@ BOOL PointerList::Remove( const void* p )
delete pBlock;
}
- return TRUE;
+ return sal_True;
}
i++;
}
@@ -609,21 +609,21 @@ BOOL PointerList::Remove( const void* p )
pBlock = pBlock->pNext;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-const void* PointerList::Get( ULONG nPos ) const
+const void* PointerList::Get( sal_uIntPtr nPos ) const
{
if ( nCount <= nPos )
return NULL;
PBlock* pBlock = pFirst;
- ULONG nStart = 0;
+ sal_uIntPtr nStart = 0;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
if ( pBlock->aData[i] )
@@ -644,26 +644,26 @@ const void* PointerList::Get( ULONG nPos ) const
// -----------------------------------------------------------------------
-BOOL PointerList::IsIn( const void* p ) const
+sal_Bool PointerList::IsIn( const void* p ) const
{
if ( !p )
- return FALSE;
+ return sal_False;
PBlock* pBlock = pFirst;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
- if ( ((ULONG)p) == ((ULONG)pBlock->aData[i]) )
- return TRUE;
+ if ( ((sal_uIntPtr)p) == ((sal_uIntPtr)pBlock->aData[i]) )
+ return sal_True;
i++;
}
pBlock = pBlock->pNext;
}
- return FALSE;
+ return sal_False;
}
@@ -731,7 +731,7 @@ static DebugData* GetDebugData()
{
if ( !aDebugData.bInit )
{
- aDebugData.bInit = TRUE;
+ aDebugData.bInit = sal_True;
// Default Debug-Namen setzen
DbgGetLogFileName( aDebugData.aDbgData.aDebugName );
@@ -745,7 +745,7 @@ static DebugData* GetDebugData()
ConfigSection eCurrentSection = eUnknown;
// no sophisticated algorithm here, assume that the whole file fits into aBuf ...
- ULONG nReallyRead = FileRead( aBuf, 1, sizeof( aBuf ) / sizeof( sal_Char ) - 1, pIniFile );
+ sal_uIntPtr nReallyRead = FileRead( aBuf, 1, sizeof( aBuf ) / sizeof( sal_Char ) - 1, pIniFile );
aBuf[ nReallyRead ] = 0;
const sal_Char* pLine = aBuf;
while ( const sal_Char* pNextLine = strstr( pLine, FILE_LINEEND ) )
@@ -846,7 +846,7 @@ inline DebugData* ImplGetDebugData()
static FILETYPE ImplDbgInitFile()
{
- static BOOL bFileInit = FALSE;
+ static sal_Bool bFileInit = sal_False;
sal_Char aBuf[4096];
getcwd( aBuf, sizeof( aBuf ) );
@@ -857,7 +857,7 @@ static FILETYPE ImplDbgInitFile()
if ( !bFileInit )
{
- bFileInit = TRUE;
+ bFileInit = sal_True;
if ( pData->aDbgData.bOverwrite )
pDebugFile = FileOpen( pData->aDbgData.aDebugName, "w" );
@@ -936,7 +936,7 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
if ( pTok[nTok] == ';' )
{
if ( nTok && ImplStrSearch( pTok, nTok, pMsg, nMsgLen ) )
- return TRUE;
+ return sal_True;
pTok += nTok+1;
nTok = 0;
@@ -946,9 +946,9 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
}
if ( nTok && ImplStrSearch( pTok, nTok, pMsg, nMsgLen ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -956,14 +956,14 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
extern "C"
void SAL_CALL dbg_printOslDebugMessage( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char * pszMessage )
{
- DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (USHORT)nLine );
+ DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (sal_uInt16)nLine );
}
// -----------------------------------------------------------------------
static void DebugInit()
{
- bDbgImplInMain = TRUE;
+ bDbgImplInMain = sal_True;
ImplDbgInitLock();
DebugData* pData = GetDebugData();
@@ -979,14 +979,14 @@ static void DebugInit()
static void DebugDeInit()
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
- ULONG nOldOut;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nOldOut;
if( pData->bOslIsHooked )
{
osl_setDetailedDebugMessageFunc( pData->pOldDebugMessageFunc );
- pData->bOslIsHooked = FALSE;
+ pData->bOslIsHooked = sal_False;
}
// Statistik-Ausgaben immer in File
@@ -1034,7 +1034,7 @@ static void DebugDeInit()
pData->pXtorList = NULL;
}
- // Alles auf FALSE setzen, damit globale Variablen nicht das
+ // Alles auf sal_False setzen, damit globale Variablen nicht das
// System zum Abstuerzen bringt. Dabei muessen aber die
// Memory-Flags erhalten bleiben, da sonst new/delete in globalen
// Variablen abstuerzen, da die Pointeranpassung dann nicht mehr richtig
@@ -1053,9 +1053,9 @@ static void DebugDeInit()
static void DebugGlobalDeInit()
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
- ULONG nOldOut;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nOldOut;
// Statistik-Ausgaben immer in File
nOldOut = pData->aDbgData.nTraceOut;
@@ -1073,7 +1073,7 @@ static void DebugGlobalDeInit()
for( i = 0, nCount = pData->pProfList->Count(); i < nCount; i++ )
{
ProfType* pProfData = (ProfType*)pData->pProfList->Get( i );
- ULONG nAve = pProfData->nTime / pProfData->nCount;
+ sal_uIntPtr nAve = pProfData->nTime / pProfData->nCount;
DbgOutf( "%-25s : %9lu : %6lu : %6lu : %6lu : %9lu :",
pProfData->aName, pProfData->nTime,
pProfData->nMinTime, pProfData->nMaxTime, nAve,
@@ -1123,8 +1123,8 @@ void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... )
static void DebugXTorInfo( sal_Char* pBuf )
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
// Xtor-Liste ausgeben
if ( pData->pXtorList && pData->pXtorList->Count() &&
@@ -1153,19 +1153,19 @@ static void DebugXTorInfo( sal_Char* pBuf )
}
// -----------------------------------------------------------------------
-BOOL ImplDbgFilterMessage( const sal_Char* pMsg )
+sal_Bool ImplDbgFilterMessage( const sal_Char* pMsg )
{
DebugData* pData = GetDebugData();
- if ( !ImplDbgFilter( pData->aDbgData.aInclFilter, pMsg, TRUE ) )
- return TRUE;
- if ( ImplDbgFilter( pData->aDbgData.aExclFilter, pMsg, FALSE ) )
- return TRUE;
- return FALSE;
+ if ( !ImplDbgFilter( pData->aDbgData.aInclFilter, pMsg, sal_True ) )
+ return sal_True;
+ if ( ImplDbgFilter( pData->aDbgData.aExclFilter, pMsg, sal_False ) )
+ return sal_True;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void* DbgFunc( USHORT nAction, void* pParam )
+void* DbgFunc( sal_uInt16 nAction, void* pParam )
{
DebugData* pDebugData = ImplGetDebugData();
@@ -1291,7 +1291,7 @@ void* DbgFunc( USHORT nAction, void* pParam )
break;
case DBG_FUNC_ALLERROROUT:
- return (void*)(ULONG)TRUE;
+ return (void*)(sal_uIntPtr)sal_True;
case DBG_FUNC_SETTESTSOLARMUTEX:
pDebugData->pDbgTestSolarMutex = (DbgTestSolarMutexProc)(long)pParam;
@@ -1312,12 +1312,12 @@ void* DbgFunc( USHORT nAction, void* pParam )
if( pDebugData->bOslIsHooked && ! pData->bHookOSLAssert )
{
osl_setDetailedDebugMessageFunc( pDebugData->pOldDebugMessageFunc );
- pDebugData->bOslIsHooked = FALSE;
+ pDebugData->bOslIsHooked = sal_False;
}
else if( ! pDebugData->bOslIsHooked && pData->bHookOSLAssert )
{
pDebugData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
- pDebugData->bOslIsHooked = TRUE;
+ pDebugData->bOslIsHooked = sal_True;
}
}
break;
@@ -1338,7 +1338,7 @@ DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc )
// -----------------------------------------------------------------------
-void DbgProf( USHORT nAction, DbgDataType* pDbgData )
+void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData )
{
// Ueberhaupt Profiling-Test an
DebugData* pData = ImplGetDebugData();
@@ -1348,7 +1348,7 @@ void DbgProf( USHORT nAction, DbgDataType* pDbgData )
sal_Char aBuf[DBG_BUF_MAXLEN];
ProfType* pProfData = (ProfType*)pDbgData->pData;
- ULONG nTime;
+ sal_uIntPtr nTime;
if ( (nAction != DBG_PROF_START) && !pProfData )
{
strcpy( aBuf, DbgError_ProfEnd1 );
@@ -1431,7 +1431,7 @@ void DbgProf( USHORT nAction, DbgDataType* pDbgData )
// -----------------------------------------------------------------------
-void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
+void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
DbgUsr fDbgUsr )
{
DebugData* pData = ImplGetDebugData();
@@ -1457,19 +1457,19 @@ void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
pXtorData->nDtorCalls = 0;
pXtorData->nMaxCount = 0;
pXtorData->nStatics = 0;
- pXtorData->bTest = TRUE;
+ pXtorData->bTest = sal_True;
pData->pXtorList->Add( (void*)pXtorData );
- if ( !ImplDbgFilter( pData->aDbgData.aInclClassFilter, pXtorData->aName, TRUE ) )
- pXtorData->bTest = FALSE;
- if ( ImplDbgFilter( pData->aDbgData.aExclClassFilter, pXtorData->aName, FALSE ) )
- pXtorData->bTest = FALSE;
+ if ( !ImplDbgFilter( pData->aDbgData.aInclClassFilter, pXtorData->aName, sal_True ) )
+ pXtorData->bTest = sal_False;
+ if ( ImplDbgFilter( pData->aDbgData.aExclClassFilter, pXtorData->aName, sal_False ) )
+ pXtorData->bTest = sal_False;
}
if ( !pXtorData->bTest )
return;
sal_Char aBuf[DBG_BUF_MAXLEN];
- USHORT nAct = nAction & ~DBG_XTOR_DTOROBJ;
+ sal_uInt16 nAct = nAction & ~DBG_XTOR_DTOROBJ;
// Trace (Enter)
if ( (pData->aDbgData.nTestFlags & DBG_TEST_XTOR_TRACE) &&
@@ -1616,16 +1616,16 @@ void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
// -----------------------------------------------------------------------
-void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT nLine )
+void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sal_uInt16 nLine )
{
- static BOOL bIn = FALSE;
+ static sal_Bool bIn = sal_False;
if ( bIn )
return;
- bIn = TRUE;
+ bIn = sal_True;
DebugData* pData = GetDebugData();
sal_Char const * pStr;
- ULONG nOut;
+ sal_uIntPtr nOut;
int nBufLen = 0;
if ( nDbgOut == DBG_OUT_ERROR )
@@ -1648,13 +1648,13 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
if ( nOut == DBG_OUT_NULL )
{
- bIn = FALSE;
+ bIn = sal_False;
return;
}
if ( ImplDbgFilterMessage( pMsg ) )
{
- bIn = FALSE;
+ bIn = sal_False;
return;
}
@@ -1692,7 +1692,7 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
// Line in String umwandeln und dranhaengen
sal_Char aLine[9];
sal_Char* pLine = &aLine[7];
- USHORT i;
+ sal_uInt16 i;
memset( aLine, 0, sizeof( aLine ) );
do
{
@@ -1762,7 +1762,7 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
ImplDbgUnlock();
- bIn = FALSE;
+ bIn = sal_False;
}
void DbgPrintShell(char const * message) {
@@ -1774,7 +1774,7 @@ void DbgPrintShell(char const * message) {
// -----------------------------------------------------------------------
-void DbgOutTypef( USHORT nDbgOut, const sal_Char* pFStr, ... )
+void DbgOutTypef( sal_uInt16 nDbgOut, const sal_Char* pFStr, ... )
{
va_list pList;
@@ -1804,13 +1804,13 @@ void DbgOutf( const sal_Char* pFStr, ... )
#else
-void* DbgFunc( USHORT, void* ) { return NULL; }
+void* DbgFunc( sal_uInt16, void* ) { return NULL; }
-void DbgProf( USHORT, DbgDataType* ) {}
-void DbgXtor( DbgDataType*, USHORT, const void*, DbgUsr ) {}
+void DbgProf( sal_uInt16, DbgDataType* ) {}
+void DbgXtor( DbgDataType*, sal_uInt16, const void*, DbgUsr ) {}
-void DbgOut( const sal_Char*, USHORT, const sal_Char*, USHORT ) {}
-void DbgOutTypef( USHORT, const sal_Char*, ... ) {}
+void DbgOut( const sal_Char*, sal_uInt16, const sal_Char*, sal_uInt16 ) {}
+void DbgOutTypef( sal_uInt16, const sal_Char*, ... ) {}
void DbgOutf( const sal_Char*, ... ) {}
#endif
diff --git a/tools/source/debug/makefile.mk b/tools/source/debug/makefile.mk
deleted file mode 100644
index 925ae90f333d..000000000000
--- a/tools/source/debug/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=debug
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= debug.cxx \
- stcktree.cxx
-
-SLOFILES= $(SLO)$/debug.obj \
- $(SLO)$/stcktree.obj
-
-OBJFILES= $(OBJ)$/debug.obj \
- $(OBJ)$/stcktree.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/debug/stcktree.cxx b/tools/source/debug/stcktree.cxx
index aa32a26c0184..d2dcbc5fb7a8 100644
--- a/tools/source/debug/stcktree.cxx
+++ b/tools/source/debug/stcktree.cxx
@@ -43,32 +43,32 @@ struct ImpDbgStackTree
ImpDbgStackTree* pRight_;
ImpDbgStackTree* pCaller_;
ImpDbgStackTree* pSub_;
- ULONG nIP_;
- ULONG nBytesLeak_;
- ULONG nBytesPeak_;
- ULONG nBytes_;
- ULONG nCountLeak_;
- ULONG nCountPeak_;
- ULONG nCount_;
- ULONG nMax_;
- ULONG nMin_;
-
- ImpDbgStackTree( ImpDbgStackTree* pSub, ULONG nIP );
+ sal_uIntPtr nIP_;
+ sal_uIntPtr nBytesLeak_;
+ sal_uIntPtr nBytesPeak_;
+ sal_uIntPtr nBytes_;
+ sal_uIntPtr nCountLeak_;
+ sal_uIntPtr nCountPeak_;
+ sal_uIntPtr nCount_;
+ sal_uIntPtr nMax_;
+ sal_uIntPtr nMin_;
+
+ ImpDbgStackTree( ImpDbgStackTree* pSub, sal_uIntPtr nIP );
~ImpDbgStackTree();
- ImpDbgStackTree* Add( ULONG nAlloc, ULONG* pBP, ULONG nIP );
- void Print( int nLevel, ULONG nCount, ULONG nCountLeak );
+ ImpDbgStackTree* Add( sal_uIntPtr nAlloc, sal_uIntPtr* pBP, sal_uIntPtr nIP );
+ void Print( int nLevel, sal_uIntPtr nCount, sal_uIntPtr nCountLeak );
void Print( int nLevel );
};
static ImpDbgStackTree* pImpDbgStackTreeRoot = NULL;
-static ULONG* pImpDbgStackTreeBP = NULL;
-static ULONG nImpDbgStackTreeMain = 0;
+static sal_uIntPtr* pImpDbgStackTreeBP = NULL;
+static sal_uIntPtr nImpDbgStackTreeMain = 0;
static int nImpDbgStackTreeSem = 0;
// -----------------------------------------------------------------------
-ImpDbgStackTree::ImpDbgStackTree( ImpDbgStackTree* pSub, ULONG nIP )
+ImpDbgStackTree::ImpDbgStackTree( ImpDbgStackTree* pSub, sal_uIntPtr nIP )
{
pSub_ = pSub;
nIP_ = nIP;
@@ -91,7 +91,7 @@ ImpDbgStackTree::~ImpDbgStackTree()
// -----------------------------------------------------------------------
-void ImpDbgStackTree::Print( int nLevel, ULONG nCount, ULONG nCountLeak )
+void ImpDbgStackTree::Print( int nLevel, sal_uIntPtr nCount, sal_uIntPtr nCountLeak )
{
if ( pLeft_ )
pLeft_->Print( nLevel, nCount, nCountLeak );
@@ -100,7 +100,7 @@ void ImpDbgStackTree::Print( int nLevel, ULONG nCount, ULONG nCountLeak )
{
if ( nMax_ == nMin_ )
{
- ULONG nTemp = nCountLeak_ * nMin_;
+ sal_uIntPtr nTemp = nCountLeak_ * nMin_;
DbgOutf( "%*c%08lx Count=%lu/%lu/%lu Bytes=%lu/%lu/%lu Size=%lu",
nLevel, ' ', nIP_,
nCount_, nCountPeak_, nCountLeak_,
@@ -138,7 +138,7 @@ void ImpDbgStackTree::Print( int nLevel )
// -----------------------------------------------------------------------
-ImpDbgStackTree* ImpDbgStackTree::Add( ULONG nAlloc, ULONG *pBP, ULONG nIP )
+ImpDbgStackTree* ImpDbgStackTree::Add( sal_uIntPtr nAlloc, sal_uIntPtr *pBP, sal_uIntPtr nIP )
{
if ( nIP < nIP_ )
{
@@ -168,9 +168,9 @@ ImpDbgStackTree* ImpDbgStackTree::Add( ULONG nAlloc, ULONG *pBP, ULONG nIP )
else if ( nMin_ > nAlloc )
nMin_ = nAlloc;
- if ( !(pBP[0] & 3) && (ULONG)pBP < pBP[0] && pBP[0] < (ULONG)pImpDbgStackTreeBP )
+ if ( !(pBP[0] & 3) && (sal_uIntPtr)pBP < pBP[0] && pBP[0] < (sal_uIntPtr)pImpDbgStackTreeBP )
{
- pBP = (ULONG*)pBP[0];
+ pBP = (sal_uIntPtr*)pBP[0];
nIP = pBP[1];
if ( 0x01100000 <= nIP && nIP < 0x20000000 && nIP != nImpDbgStackTreeMain )
{
@@ -191,10 +191,10 @@ void DbgStartStackTree()
{
if ( !nImpDbgStackTreeMain )
{
- ULONG* pBP;
+ sal_uIntPtr* pBP;
__asm mov pBP, ebp;
- pImpDbgStackTreeBP = (ULONG*)pBP[0];
+ pImpDbgStackTreeBP = (sal_uIntPtr*)pBP[0];
nImpDbgStackTreeMain = pImpDbgStackTreeBP[1];
}
}
@@ -210,7 +210,7 @@ void DbgEndStackTree()
{
// Ausgaben ins File umleiten
DbgData* pData = DbgGetData();
- ULONG nOldOut = pData->nTraceOut;
+ sal_uIntPtr nOldOut = pData->nTraceOut;
pData->nTraceOut = DBG_OUT_FILE;
DbgOutf( "Leak-Report" );
@@ -239,7 +239,7 @@ void DbgEndStackTree()
// -----------------------------------------------------------------------
-void* DbgGetStackTree( ULONG nAlloc )
+void* DbgGetStackTree( sal_uIntPtr nAlloc )
{
ImpDbgStackTree* pReturn = NULL;
@@ -247,10 +247,10 @@ void* DbgGetStackTree( ULONG nAlloc )
{
nImpDbgStackTreeSem++;
- ULONG* pBP;
+ sal_uIntPtr* pBP;
__asm mov pBP, ebp;
- ULONG nIP = pBP[1];
+ sal_uIntPtr nIP = pBP[1];
if ( !pImpDbgStackTreeRoot )
pImpDbgStackTreeRoot = new ImpDbgStackTree( NULL, nIP );
pReturn = pImpDbgStackTreeRoot->Add( nAlloc, pBP, nIP );
@@ -262,7 +262,7 @@ void* DbgGetStackTree( ULONG nAlloc )
// -----------------------------------------------------------------------
-void DbgFreeStackTree( void* pVoid, ULONG nAlloc )
+void DbgFreeStackTree( void* pVoid, sal_uIntPtr nAlloc )
{
ImpDbgStackTree* p = (ImpDbgStackTree*)pVoid;
@@ -298,7 +298,7 @@ void DbgPrintStackTree( void* pVoid )
{
// Ausgaben ins File umleiten
DbgData* pData = DbgGetData();
- ULONG nOldOut = pData->nTraceOut;
+ sal_uIntPtr nOldOut = pData->nTraceOut;
pData->nTraceOut = DBG_OUT_FILE;
DbgOutf( "Mem-StackTree:" );
@@ -314,8 +314,8 @@ void DbgPrintStackTree( void* pVoid )
void DbgStartStackTree() {}
void DbgEndStackTree() {}
-void* DbgGetStackTree( ULONG ) { return NULL; }
-void DbgFreeStackTree( void*, ULONG ) {}
+void* DbgGetStackTree( sal_uIntPtr ) { return NULL; }
+void DbgFreeStackTree( void*, sal_uIntPtr ) {}
void DbgPrintStackTree( void* ) {}
#endif
diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx
index bcb3d6b89e00..895216f8f3da 100644..100755
--- a/tools/source/fsys/comdep.hxx
+++ b/tools/source/fsys/comdep.hxx
@@ -75,16 +75,16 @@ struct DirReader_Impl
DirEntry* pParent;
String aPath;
ByteString aBypass;
- BOOL bReady;
- BOOL bInUse;
+ sal_Bool bReady;
+ sal_Bool bInUse;
DirReader_Impl( Dir &rDir )
: pDir( &rDir ),
pDosEntry( 0 ),
pParent( 0 ),
aPath( GUI2FSYS(rDir.GetFull()) ),
- bReady ( FALSE ),
- bInUse( FALSE )
+ bReady ( sal_False ),
+ bInUse( sal_False )
{
#ifndef BOOTSTRAP
// Redirection
@@ -112,8 +112,8 @@ struct DirReader_Impl
{ if( pDosDir ) closedir( pDosDir ); }
// die folgenden sind systemabh"angig implementiert
- USHORT Init(); // initialisiert, liest ggf. devices
- USHORT Read(); // liest 1 Eintrag, F2ugt ein falls ok
+ sal_uInt16 Init(); // initialisiert, liest ggf. devices
+ sal_uInt16 Read(); // liest 1 Eintrag, F2ugt ein falls ok
};
//--------------------------------------------------------------------
@@ -146,9 +146,9 @@ struct FileCopier_Impl
//--------------------------------------------------------------------
#if defined WNT || defined OS2
-BOOL IsRedirectable_Impl( const ByteString &rPath );
+sal_Bool IsRedirectable_Impl( const ByteString &rPath );
#else
-#define IsRedirectable_Impl( rPath ) TRUE
+#define IsRedirectable_Impl( rPath ) sal_True
#endif
//--------------------------------------------------------------------
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 6dde67ce186b..edfd1c2a055f 100644..100755
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -128,11 +128,11 @@ int Sys2SolarError_Impl( int nSysErr )
#ifndef BOOTSTRAP
FSysRedirector* FSysRedirector::_pRedirector = 0;
-BOOL FSysRedirector::_bEnabled = TRUE;
+sal_Bool FSysRedirector::_bEnabled = sal_True;
#ifdef UNX
-BOOL bInRedirection = TRUE;
+sal_Bool bInRedirection = sal_True;
#else
-BOOL bInRedirection = FALSE;
+sal_Bool bInRedirection = sal_False;
#endif
static osl::Mutex* pRedirectMutex = 0;
@@ -170,7 +170,7 @@ void FSysRedirector::DoRedirect( String &rPath )
return;
// dont redirect on nested calls
- bInRedirection = TRUE;
+ bInRedirection = sal_True;
// convert to URL
#ifndef UNX
@@ -184,7 +184,7 @@ void FSysRedirector::DoRedirect( String &rPath )
// do redirection
Redirector();
- bInRedirection = FALSE;
+ bInRedirection = sal_False;
return;
}
@@ -279,12 +279,12 @@ const char* ImpCheckDirEntry( const void* p )
|*
*************************************************************************/
-ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
+ByteString ImplCutPath( const ByteString& rStr, sal_uInt16 nMax, char cAccDel )
{
- USHORT nMaxPathLen = nMax;
+ sal_uInt16 nMaxPathLen = nMax;
ByteString aCutPath( rStr );
- BOOL bInsertPrefix = FALSE;
- USHORT nBegin = aCutPath.Search( cAccDel );
+ sal_Bool bInsertPrefix = sal_False;
+ sal_uInt16 nBegin = aCutPath.Search( cAccDel );
if( nBegin == STRING_NOTFOUND )
nBegin = 0;
@@ -293,14 +293,14 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
while( aCutPath.Len() > nMaxPathLen )
{
- USHORT nEnd = aCutPath.Search( cAccDel, nBegin + 1 );
- USHORT nCount;
+ sal_uInt16 nEnd = aCutPath.Search( cAccDel, nBegin + 1 );
+ sal_uInt16 nCount;
if ( nEnd != STRING_NOTFOUND )
{
nCount = nEnd - nBegin;
aCutPath.Erase( nBegin, nCount );
- bInsertPrefix = TRUE;
+ bInsertPrefix = sal_True;
}
else
break;
@@ -308,7 +308,7 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
if ( aCutPath.Len() > nMaxPathLen )
{
- for ( USHORT n = nMaxPathLen; n > nMaxPathLen/2; --n )
+ for ( sal_uInt16 n = nMaxPathLen; n > nMaxPathLen/2; --n )
if ( !ByteString(aCutPath.GetChar(n)).IsAlphaNumericAscii() )
{
aCutPath.Erase( n );
@@ -348,7 +348,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty
// der Rest immer ohne die fuehrenden '\\'.
// ein ":" trennt ebenfalls, gehoert aber zum Namen
// den ersten '\\', '/' oder ':' suchen
- USHORT nPos;
+ sal_uInt16 nPos;
for ( nPos = 0;
nPos < aPfad.Len() && //?O
aPfad.GetChar(nPos) != '\\' && aPfad.GetChar(nPos) != '/' && //?O
@@ -485,7 +485,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty
}
while ( aPfad.Len() );
- ULONG nErr = ERRCODE_NONE;
+ sal_uIntPtr nErr = ERRCODE_NONE;
// Haupt-Entry (selbst) zuweisen
if ( aStack.Count() == 0 )
{
@@ -615,7 +615,7 @@ void DirEntry::ImpTrim( FSysPathStyle eStyle )
{
case FSYS_STYLE_FAT:
{
- USHORT nPunktPos = aName.Search( '.' );
+ sal_uInt16 nPunktPos = aName.Search( '.' );
if ( nPunktPos == STRING_NOTFOUND )
{
if ( aName.Len() > 8 )
@@ -930,7 +930,7 @@ DirEntry* DirEntry::ImpGetTopPtr()
|*
*************************************************************************/
-DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize )
+DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -953,14 +953,14 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize )
|*
*************************************************************************/
-BOOL DirEntry::Exists( FSysAccess nAccess ) const
+sal_Bool DirEntry::Exists( FSysAccess nAccess ) const
{
#ifndef BOOTSTRAP
static osl::Mutex aLocalMutex;
osl::MutexGuard aGuard( aLocalMutex );
#endif
if ( !IsValid() )
- return FALSE;
+ return sal_False;
#if defined WNT || defined OS2
// spezielle Filenamen sind vom System da
@@ -976,14 +976,14 @@ BOOL DirEntry::Exists( FSysAccess nAccess ) const
aName.CompareIgnoreCaseToAscii("LPT3") == COMPARE_EQUAL ||
aName.CompareIgnoreCaseToAscii("NUL") == COMPARE_EQUAL ||
aName.CompareIgnoreCaseToAscii("PRN") == COMPARE_EQUAL ) )
- return TRUE;
+ return sal_True;
#endif
FSysFailOnErrorImpl();
DirEntryKind eKind = FileStat( *this, nAccess ).GetKind();
if ( eKind & ( FSYS_KIND_FILE | FSYS_KIND_DIR ) )
{
- return TRUE;
+ return sal_True;
}
#if defined WNT || defined OS2
@@ -1002,7 +1002,7 @@ BOOL DirEntry::Exists( FSysAccess nAccess ) const
|*
*************************************************************************/
-BOOL DirEntry::First()
+sal_Bool DirEntry::First()
{
FSysFailOnErrorImpl();
@@ -1032,12 +1032,12 @@ BOOL DirEntry::First()
{
aName = aFound;
closedir( pDir );
- return TRUE;
+ return sal_True;
}
}
closedir( pDir );
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1046,8 +1046,8 @@ BOOL DirEntry::First()
|*
*************************************************************************/
-String DirEntry::GetFull( FSysPathStyle eStyle, BOOL bWithDelimiter,
- USHORT nMaxChars ) const
+String DirEntry::GetFull( FSysPathStyle eStyle, sal_Bool bWithDelimiter,
+ sal_uInt16 nMaxChars ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1341,18 +1341,18 @@ StringCompare DirEntry::NameCompare( const DirEntry &rWith ) const
|*
*************************************************************************/
-BOOL DirEntry::operator==( const DirEntry& rEntry ) const
+sal_Bool DirEntry::operator==( const DirEntry& rEntry ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
// test wheather the contents are textual the same
if ( nError && ( nError == rEntry.nError ) )
- return TRUE;
+ return sal_True;
if ( nError || rEntry.nError ||
( eFlag == FSYS_FLAG_INVALID ) ||
( rEntry.eFlag == FSYS_FLAG_INVALID ) )
- return FALSE;
+ return sal_False;
#ifndef OS2
const
@@ -1417,10 +1417,10 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
#ifdef DBG_UTIL
- static BOOL bTested = FALSE;
+ static sal_Bool bTested = sal_False;
if ( !bTested )
{
- bTested = TRUE;
+ bTested = sal_True;
FSysTest();
}
#endif
@@ -1442,7 +1442,7 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
(eFlag == FSYS_FLAG_RELROOT && !aName.Len()) ||
(
(pEntryTop->aName.Len() ||
- ((rEntry.Level()>1)?(rEntry[rEntry.Level()-2].aName.CompareIgnoreCaseToAscii(RFS_IDENTIFIER)==COMPARE_EQUAL):FALSE))
+ ((rEntry.Level()>1)?(rEntry[rEntry.Level()-2].aName.CompareIgnoreCaseToAscii(RFS_IDENTIFIER)==COMPARE_EQUAL):sal_False))
&&
(pEntryTop->eFlag == FSYS_FLAG_ABSROOT ||
pEntryTop->eFlag == FSYS_FLAG_RELROOT ||
@@ -1613,23 +1613,23 @@ void DirEntry::SetName( const String& rName, FSysPathStyle eFormatter )
|* DirEntry::Find()
|*
*************************************************************************/
-BOOL DirEntry::Find( const String& rPfad, char cDelim )
+sal_Bool DirEntry::Find( const String& rPfad, char cDelim )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
if ( ImpGetTopPtr()->eFlag == FSYS_FLAG_ABSROOT )
- return TRUE;
+ return sal_True;
- BOOL bWild = aName.Search( '*' ) != STRING_NOTFOUND ||
+ sal_Bool bWild = aName.Search( '*' ) != STRING_NOTFOUND ||
aName.Search( '?' ) != STRING_NOTFOUND;
if ( !cDelim )
cDelim = SEARCHDELIM(DEFSTYLE)[0];
- USHORT nTokenCount = rPfad.GetTokenCount( cDelim );
- USHORT nIndex = 0;
+ sal_uInt16 nTokenCount = rPfad.GetTokenCount( cDelim );
+ sal_uInt16 nIndex = 0;
ByteString aThis = ACCESSDELIM(DEFSTYLE);
aThis += ByteString(GetFull(), osl_getThreadTextEncoding());
- for ( USHORT nToken = 0; nToken < nTokenCount; ++nToken )
+ for ( sal_uInt16 nToken = 0; nToken < nTokenCount; ++nToken )
{
ByteString aPath = ByteString(rPfad, osl_getThreadTextEncoding()).GetToken( 0, cDelim, nIndex );
@@ -1643,11 +1643,11 @@ BOOL DirEntry::Find( const String& rPfad, char cDelim )
( ( !bWild && aEntry.Exists() ) || ( bWild && aEntry.First() ) ) )
{
(*this) = aEntry;
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1656,7 +1656,7 @@ BOOL DirEntry::Find( const String& rPfad, char cDelim )
|*
*************************************************************************/
-BOOL DirEntry::ImpToRel( String aCurStr )
+sal_Bool DirEntry::ImpToRel( String aCurStr )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1673,7 +1673,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
}
// "Ubereinstimmung pr"ufen
- USHORT nPos = aThisCompareStr.Match( aCurCompareStr );
+ sal_uInt16 nPos = aThisCompareStr.Match( aCurCompareStr );
if ( nPos == STRING_MATCH && aThisStr.Len() != aCurStr.Len() )
nPos = Min( aThisStr.Len(), aCurStr.Len() );
@@ -1682,7 +1682,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
{
// dann ist der relative Pfad das aktuelle Verzeichnis
*this = DirEntry();
- return TRUE;
+ return sal_True;
}
// Sonderfall, die DirEntries sind total verschieden
@@ -1690,7 +1690,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
{
// dann ist der relativste Pfad absolut
*this = aThis;
- return FALSE;
+ return sal_False;
}
// sonst nehmen wir die identischen Einzelteile vorne weg
@@ -1706,7 +1706,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
// das ist dann unser relativer Pfad
*this = DirEntry( aThisStr, FSYS_STYLE_HPFS );
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1715,7 +1715,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
|*
*************************************************************************/
-USHORT DirEntry::CutRelParents()
+sal_uInt16 DirEntry::CutRelParents()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1729,7 +1729,7 @@ USHORT DirEntry::CutRelParents()
pDir = pPar;
// '..' zaehlen
- USHORT nParCount = 0;
+ sal_uInt16 nParCount = 0;
while ( pPar && pPar->eFlag == FSYS_FLAG_PARENT )
{
++nParCount;
@@ -1751,7 +1751,7 @@ USHORT DirEntry::CutRelParents()
|*
*************************************************************************/
-BOOL DirEntry::ToRel()
+sal_Bool DirEntry::ToRel()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1766,7 +1766,7 @@ BOOL DirEntry::ToRel()
|*
*************************************************************************/
-BOOL DirEntry::ToRel( const DirEntry& rStart )
+sal_Bool DirEntry::ToRel( const DirEntry& rStart )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1846,7 +1846,7 @@ String DirEntry::GetSearchDelimiter( FSysPathStyle eFormatter )
|*
*************************************************************************/
-USHORT DirEntry::GetMaxNameLen( FSysPathStyle eFormatter )
+sal_uInt16 DirEntry::GetMaxNameLen( FSysPathStyle eFormatter )
{
eFormatter = GetStyle( eFormatter );
switch ( eFormatter )
@@ -1889,7 +1889,7 @@ const DirEntry& DirEntry::SetTempNameBase( const String &rBase )
{
// Create the directory and only on success give all rights to
// everyone. Use mkdir instead of DirEntry::MakeDir because
- // this returns TRUE even if directory already exists.
+ // this returns sal_True even if directory already exists.
if ( !mkdir( aName.GetBuffer(), S_IRWXU | S_IRWXG | S_IRWXO ) )
chmod( aName.GetBuffer(), S_IRWXU | S_IRWXG | S_IRWXO );
@@ -2066,7 +2066,7 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
|*
*************************************************************************/
-const DirEntry &DirEntry::operator[]( USHORT nParentLevel ) const
+const DirEntry &DirEntry::operator[]( sal_uInt16 nParentLevel ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -2098,7 +2098,7 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
// falls '/' am Anfang, ist der Name '/',
// der Rest immer ohne die fuehrenden '/'.
// den ersten '/' suchen
- USHORT nPos;
+ sal_uInt16 nPos;
for ( nPos = 0;
nPos < aPfad.Len() && aPfad.GetChar(nPos) != '/';
nPos++ )
@@ -2124,8 +2124,8 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
else if ( aName == "~" )
{
DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
- for ( USHORT n = aHome.Level(); n; --n )
- aStack.Push( new DirEntry( aHome[ (USHORT) n-1 ] ) );
+ for ( sal_uInt16 n = aHome.Level(); n; --n )
+ aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
}
#endif
@@ -2226,11 +2226,11 @@ ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind )
return eErr;
}
-BOOL IsValidEntry_Impl( const DirEntry &rPath,
+sal_Bool IsValidEntry_Impl( const DirEntry &rPath,
const String &rLongName,
DirEntryKind eKind,
- BOOL bIsShortened,
- BOOL bUseDelim )
+ sal_Bool bIsShortened,
+ sal_Bool bUseDelim )
{
// Parameter-Pr"uefung
DBG_ASSERT( eKind == FSYS_KIND_NONE || eKind == FSYS_KIND_ALL ||
@@ -2244,16 +2244,16 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
DirEntry aPath(rPath);
DirEntry aName(rLongName, eStyle);
if ( !aName.IsValid() || aName.Level() != 1 )
- return FALSE;
+ return sal_False;
aPath += aName;
if ( 1 == aPath.Level() )
- return FALSE;
+ return sal_False;
if ( eStyle == FSYS_STYLE_FAT || eStyle == FSYS_STYLE_NWFS ||
eStyle == FSYS_STYLE_UNKNOWN )
{
DirEntry aDosEntry( rLongName, FSYS_STYLE_FAT );
if ( !aDosEntry.IsValid() )
- return FALSE;
+ return sal_False;
}
// Pfad-Trenner sind nicht erlaubt (bei ungek"urzten auch nicht FSYS_SHORTNAME_DELIMITER)
@@ -2263,12 +2263,12 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
(!bIsShortened && rLongName.Search(cDelim) != STRING_NOTFOUND)
)
{
- return FALSE;
+ return sal_False;
}
// MI: Abfrage nach 'CON:' etc. wird jetzt in Exists() mitgemacht
if ( aPath.Exists() )
- return FALSE;
+ return sal_False;
return (ERRCODE_NONE == CreateEntry_Impl( aPath, eKind ));
}
@@ -2287,8 +2287,8 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
#define MAX_LEN_MAX 255
#define INVALID_CHARS_DEF "\\/\"':|^<>?*"
-BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
- BOOL bUseDelim, FSysPathStyle eStyle )
+sal_Bool DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
+ sal_Bool bUseDelim, FSysPathStyle eStyle )
{
String aLongName(rLongName);
@@ -2308,14 +2308,14 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
}
// ist der Langname direkt verwendbar?
- if ( IsValidEntry_Impl( *this, aLongName, eKind, FALSE, bUseDelim ) )
+ if ( IsValidEntry_Impl( *this, aLongName, eKind, sal_False, bUseDelim ) )
{
operator+=( DirEntry(aLongName) );
- return TRUE;
+ return sal_True;
}
// max L"angen feststellen
- USHORT nMaxExt, nMaxLen;
+ sal_uInt16 nMaxExt, nMaxLen;
if ( FSYS_STYLE_DETECT == eStyle )
eStyle = DirEntry::GetPathStyle( GetDevice().GetName() );
ByteString aInvalidChars;
@@ -2387,11 +2387,11 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
operator+=( DirEntry(String(aNewName, osl_getThreadTextEncoding())) );
if ( FSYS_KIND_ALL == eKind && CMP_LOWER(aName) == aOldName )
if ( FSYS_KIND_ALL == eKind && CMP_LOWER(ByteString(GetName(), osl_getThreadTextEncoding())) == aOldName )
- return TRUE;
+ return sal_True;
// kann der gek"urzte Name direkt verwendet werden?
if ( !Exists() && (ERRCODE_NONE == CreateEntry_Impl( *this, eKind )) )
- return TRUE;
+ return sal_True;
// darf '?##' verwendet werden, um eindeutigen Name zu erzeugen?
if ( bUseDelim )
@@ -2422,7 +2422,7 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
// keine ## mehr frei / ?## soll nicht verwendet werden
nError = ERRCODE_IO_ALREADYEXISTS;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2431,34 +2431,34 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
|*
*************************************************************************/
-BOOL DirEntry::MakeDir( BOOL bSloppy ) const
+sal_Bool DirEntry::MakeDir( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
// Schnellpruefung, ob vorhanden
if ( FileStat( *this ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
if ( bSloppy && pParent )
if ( FileStat( *pParent ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
const DirEntry *pNewDir = bSloppy ? pParent : this;
if ( pNewDir )
{
// den Path zum Dir erzeugen
- if ( pNewDir->pParent && !pNewDir->pParent->MakeDir(FALSE) )
- return FALSE;
+ if ( pNewDir->pParent && !pNewDir->pParent->MakeDir(sal_False) )
+ return sal_False;
// das Dir selbst erzeugen
if ( pNewDir->eFlag == FSYS_FLAG_ABSROOT ||
pNewDir->eFlag == FSYS_FLAG_ABSROOT ||
pNewDir->eFlag == FSYS_FLAG_VOLUME )
- return TRUE;
+ return sal_True;
else
{
//? nError = ???
if ( FileStat( *pNewDir ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
else
{
FSysFailOnErrorImpl();
@@ -2472,7 +2472,7 @@ BOOL DirEntry::MakeDir( BOOL bSloppy ) const
#ifdef WIN32
SetLastError(0);
#endif
- BOOL bResult = (0 == _mkdir( (char*) bDirName.GetBuffer() ));
+ sal_Bool bResult = (0 == _mkdir( (char*) bDirName.GetBuffer() ));
if ( !bResult )
{
// Wer hat diese Methode const gemacht ?
@@ -2487,7 +2487,7 @@ BOOL DirEntry::MakeDir( BOOL bSloppy ) const
}
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -2591,7 +2591,7 @@ FSysError DirEntry::MoveTo( const DirEntry& rNewName ) const
// ja, also intra-device-move mit MoveFile
MoveFile( bFrom.GetBuffer(), bTo.GetBuffer() );
// MoveFile ist buggy bei cross-device operationen.
- // Der R?ckgabewert ist auch dann TRUE, wenn nur ein Teil der Operation geklappt hat.
+ // Der R?ckgabewert ist auch dann sal_True, wenn nur ein Teil der Operation geklappt hat.
// Zudem zeigt MoveFile unterschiedliches Verhalten bei unterschiedlichen NT-Versionen.
return Sys2SolarError_Impl( GetLastError() );
}
@@ -2709,10 +2709,10 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
pName[bTmpName.Len()+1] = (char) 0;
//read-only files sollen auch geloescht werden koennen
- BOOL isReadOnly = FileStat::GetReadOnlyFlag(*this);
+ sal_Bool isReadOnly = FileStat::GetReadOnlyFlag(*this);
if (isReadOnly)
{
- FileStat::SetReadOnlyFlag(*this, FALSE);
+ FileStat::SetReadOnlyFlag(*this, sal_False);
}
// directory?
@@ -2722,7 +2722,7 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
if ( FSYS_ACTION_RECURSIVE == (nActions & FSYS_ACTION_RECURSIVE) )
{
Dir aDir( *this, FSYS_KIND_DIR|FSYS_KIND_FILE );
- for ( USHORT n = 0; eError == FSYS_ERR_OK && n < aDir.Count(); ++n )
+ for ( sal_uInt16 n = 0; eError == FSYS_ERR_OK && n < aDir.Count(); ++n )
{
const DirEntry &rSubDir = aDir[n];
DirEntryFlag flag = rSubDir.GetFlag();
@@ -2823,20 +2823,20 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
|*
*************************************************************************/
-BOOL DirEntry::Contains( const DirEntry &rSubEntry ) const
+sal_Bool DirEntry::Contains( const DirEntry &rSubEntry ) const
{
DBG_ASSERT( IsAbs() && rSubEntry.IsAbs(), "must be absolute entries" );
- USHORT nThisLevel = Level();
- USHORT nSubLevel = rSubEntry.Level();
+ sal_uInt16 nThisLevel = Level();
+ sal_uInt16 nSubLevel = rSubEntry.Level();
if ( nThisLevel < nSubLevel )
{
for ( ; nThisLevel; --nThisLevel, --nSubLevel )
if ( (*this)[nThisLevel-1] != rSubEntry[nSubLevel-1] )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2845,11 +2845,11 @@ BOOL DirEntry::Contains( const DirEntry &rSubEntry ) const
|*
*************************************************************************/
-USHORT DirEntry::Level() const
+sal_uInt16 DirEntry::Level() const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
- USHORT nLevel = 0;
+ sal_uInt16 nLevel = 0;
const DirEntry *pRes = this;
while ( pRes )
{
@@ -2888,7 +2888,7 @@ String DirEntry::ConvertSystemToName( const String &rName )
|*
*************************************************************************/
-BOOL DirEntry::IsValid() const
+sal_Bool DirEntry::IsValid() const
{
return (nError == FSYS_ERR_OK);
}
@@ -2899,9 +2899,9 @@ BOOL DirEntry::IsValid() const
|*
*************************************************************************/
-BOOL DirEntry::IsRFSAvailable()
+sal_Bool DirEntry::IsRFSAvailable()
{
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2914,18 +2914,18 @@ BOOL DirEntry::IsRFSAvailable()
|*
*************************************************************************/
-BOOL DirEntry::IsLongNameOnFAT() const
+sal_Bool DirEntry::IsLongNameOnFAT() const
{
// FAT-System?
DirEntry aTempDirEntry(*this);
aTempDirEntry.ToAbs();
if (DirEntry::GetPathStyle(aTempDirEntry.GetDevice().GetName().GetChar(0)) != FSYS_STYLE_FAT)
{
- return FALSE; // nein, also false
+ return sal_False; // nein, also false
}
// DirEntry-Kette auf lange Dateinamen pr?fen
- for( USHORT iLevel = this->Level(); iLevel > 0; iLevel-- )
+ for( sal_uInt16 iLevel = this->Level(); iLevel > 0; iLevel-- )
{
const DirEntry& rEntry = (const DirEntry&) (*this)[iLevel-1];
String aBase( rEntry.GetBase() );
@@ -2933,15 +2933,15 @@ BOOL DirEntry::IsLongNameOnFAT() const
if (aBase.Len()>8) // Name > 8?
{
- return TRUE;
+ return sal_True;
}
if (aExtension.Len()>3) // Extension > 3?
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
//========================================================================
diff --git a/tools/source/fsys/filecopy.cxx b/tools/source/fsys/filecopy.cxx
index 3a7787c93159..82f776b5854a 100644..100755
--- a/tools/source/fsys/filecopy.cxx
+++ b/tools/source/fsys/filecopy.cxx
@@ -143,14 +143,14 @@ FileCopier& FileCopier::operator = ( const FileCopier &rCopier )
|*
*************************************************************************/
-BOOL FileCopier::Progress()
+sal_Bool FileCopier::Progress()
{
if ( !aProgressLink )
- return TRUE;
+ return sal_True;
else
{
if ( aProgressLink.Call( this ) )
- return TRUE;
+ return sal_True;
return ( 0 == Error( ERRCODE_ABORT, 0, 0 ) );
}
}
@@ -224,7 +224,7 @@ FSysError FileCopier::DoCopy_Impl(
// HPFS->FAT?
FSysPathStyle eSourceStyle = DirEntry::GetPathStyle( rSource.ImpGetTopPtr()->GetName() );
FSysPathStyle eTargetStyle = DirEntry::GetPathStyle( rTarget.ImpGetTopPtr()->GetName() );
- BOOL bMakeShortNames = ( eSourceStyle == FSYS_STYLE_HPFS && eTargetStyle == FSYS_STYLE_FAT );
+ sal_Bool bMakeShortNames = ( eSourceStyle == FSYS_STYLE_HPFS && eTargetStyle == FSYS_STYLE_FAT );
// Zieldateiname ggf. kuerzen
DirEntry aTgt;
@@ -296,7 +296,7 @@ FSysError FileCopier::DoCopy_Impl(
// recursive copy
eRet = Error( aTgt.MakeDir() ? FSYS_ERR_OK : FSYS_ERR_UNKNOWN, 0, &aTgt );
Dir aSourceDir( rSource, FSYS_KIND_DIR|FSYS_KIND_FILE );
- for ( USHORT n = 0; ERRCODE_TOERROR(eRet) == FSYS_ERR_OK && n < aSourceDir.Count(); ++n )
+ for ( sal_uInt16 n = 0; ERRCODE_TOERROR(eRet) == FSYS_ERR_OK && n < aSourceDir.Count(); ++n )
{
const DirEntry &rSubSource = aSourceDir[n];
DirEntryFlag eFlag = rSubSource.GetFlag();
diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx
index 60b45bd8ebdd..221ed2c0377b 100644..100755
--- a/tools/source/fsys/fstat.cxx
+++ b/tools/source/fsys/fstat.cxx
@@ -29,11 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#if defined( WIN)
-#include <stdio.h>
-#include <dos.h>
-#endif
-
#ifdef UNX
#include <errno.h>
#endif
@@ -52,12 +47,12 @@
FileStat::FileStat()
: // don't use Default-Ctors!
- aDateCreated( ULONG(0) ),
- aTimeCreated( ULONG(0) ),
- aDateModified( ULONG(0) ),
- aTimeModified( ULONG(0) ),
- aDateAccessed( ULONG(0) ),
- aTimeAccessed( ULONG(0) )
+ aDateCreated( sal_uIntPtr(0) ),
+ aTimeCreated( sal_uIntPtr(0) ),
+ aDateModified( sal_uIntPtr(0) ),
+ aTimeModified( sal_uIntPtr(0) ),
+ aDateAccessed( sal_uIntPtr(0) ),
+ aTimeAccessed( sal_uIntPtr(0) )
{
nSize = 0;
nKindFlags = FSYS_KIND_UNKNOWN;
@@ -72,15 +67,15 @@ FileStat::FileStat()
FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess )
: // don't use Default-Ctors!
- aDateCreated( ULONG(0) ),
- aTimeCreated( ULONG(0) ),
- aDateModified( ULONG(0) ),
- aTimeModified( ULONG(0) ),
- aDateAccessed( ULONG(0) ),
- aTimeAccessed( ULONG(0) )
+ aDateCreated( sal_uIntPtr(0) ),
+ aTimeCreated( sal_uIntPtr(0) ),
+ aDateModified( sal_uIntPtr(0) ),
+ aTimeModified( sal_uIntPtr(0) ),
+ aDateAccessed( sal_uIntPtr(0) ),
+ aTimeAccessed( sal_uIntPtr(0) )
{
- BOOL bCached = FSYS_ACCESS_CACHED == (nAccess & FSYS_ACCESS_CACHED);
- BOOL bFloppy = FSYS_ACCESS_FLOPPY == (nAccess & FSYS_ACCESS_FLOPPY);
+ sal_Bool bCached = FSYS_ACCESS_CACHED == (nAccess & FSYS_ACCESS_CACHED);
+ sal_Bool bFloppy = FSYS_ACCESS_FLOPPY == (nAccess & FSYS_ACCESS_FLOPPY);
#ifdef FEAT_FSYS_DOUBLESPEED
const FileStat *pStatFromDir = bCached ? rDirEntry.ImpGetStat() : 0;
@@ -109,18 +104,18 @@ FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess )
|*
*************************************************************************/
-// TRUE wenn die Instanz j"unger als rIsOlder ist.
-// FALSE wenn die Instanz "alter oder gleich alt wie rIsOlder ist.
+// sal_True wenn die Instanz j"unger als rIsOlder ist.
+// sal_False wenn die Instanz "alter oder gleich alt wie rIsOlder ist.
-BOOL FileStat::IsYounger( const FileStat& rIsOlder ) const
+sal_Bool FileStat::IsYounger( const FileStat& rIsOlder ) const
{
if ( aDateModified > rIsOlder.aDateModified )
- return TRUE;
+ return sal_True;
if ( ( aDateModified == rIsOlder.aDateModified ) &&
( aTimeModified > rIsOlder.aTimeModified ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -129,9 +124,9 @@ BOOL FileStat::IsYounger( const FileStat& rIsOlder ) const
|*
*************************************************************************/
-BOOL FileStat::IsKind( DirEntryKind nKind ) const
+sal_Bool FileStat::IsKind( DirEntryKind nKind ) const
{
- BOOL bRet = ( ( nKind == FSYS_KIND_UNKNOWN ) &&
+ sal_Bool bRet = ( ( nKind == FSYS_KIND_UNKNOWN ) &&
( nKindFlags == FSYS_KIND_UNKNOWN ) ) ||
( ( nKindFlags & nKind ) == nKind );
return bRet;
@@ -143,12 +138,12 @@ BOOL FileStat::IsKind( DirEntryKind nKind ) const
|*
*************************************************************************/
-BOOL FileStat::HasReadOnlyFlag()
+sal_Bool FileStat::HasReadOnlyFlag()
{
#if defined WNT || defined UNX || defined OS2
- return TRUE;
+ return sal_True;
#else
- return FALSE;
+ return sal_False;
#endif
}
@@ -158,7 +153,7 @@ BOOL FileStat::HasReadOnlyFlag()
|*
*************************************************************************/
-BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
+sal_Bool FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
@@ -174,17 +169,17 @@ BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
case NO_ERROR:
return FILE_READONLY == ( aFileStat.attrFile & FILE_READONLY );
default:
- return FALSE;
+ return sal_False;
}
#elif defined UNX
/* could we stat the object? */
struct stat aBuf;
if (stat(aFPath.GetBuffer(), &aBuf))
- return FALSE;
+ return sal_False;
/* jupp, is writable for user? */
return((aBuf.st_mode & S_IWUSR) != S_IWUSR);
#else
- return FALSE;
+ return sal_False;
#endif
}
@@ -194,7 +189,7 @@ BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
|*
*************************************************************************/
-ULONG FileStat::SetReadOnlyFlag( const DirEntry &rEntry, BOOL bRO )
+sal_uIntPtr FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
diff --git a/tools/source/fsys/makefile.mk b/tools/source/fsys/makefile.mk
deleted file mode 100644
index b1d34d6347f3..000000000000
--- a/tools/source/fsys/makefile.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=fsys
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(COM)"=="GCC"
-CFLAGSCXX+=-fexceptions
-.ENDIF
-
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/tempfile.obj \
- $(SLO)$/wldcrd.obj \
- $(SLO)$/fstat.obj \
- $(SLO)$/comdep.obj \
- $(SLO)$/filecopy.obj \
- $(SLO)$/dirent.obj \
- $(SLO)$/tdir.obj \
- $(SLO)$/urlobj.obj
-
-OBJFILES= $(OBJ)$/wldcrd.obj \
- $(OBJ)$/fstat.obj \
- $(OBJ)$/comdep.obj \
- $(OBJ)$/filecopy.obj \
- $(OBJ)$/dirent.obj \
- $(OBJ)$/tdir.obj \
- $(OBJ)$/urlobj.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx
index cf9bd901abc4..575d2c492c5b 100644..100755
--- a/tools/source/fsys/tdir.cxx
+++ b/tools/source/fsys/tdir.cxx
@@ -41,7 +41,7 @@
DBG_NAME( Dir )
-#define APPEND (USHORT) 65535
+#define APPEND (sal_uInt16) 65535
/*************************************************************************
|*
@@ -51,7 +51,7 @@ DBG_NAME( Dir )
|*
*************************************************************************/
-BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
+sal_Bool Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
const FileStat& rNewStat,
size_t nCurPos, size_t nSortIndex ) const
{
@@ -61,7 +61,7 @@ BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
// einfache Dinge erfordern einfache Loesungen
if ( pLst->empty() )
- return TRUE;
+ return sal_True;
FSysSort nSort = (*pSortLst)[ nSortIndex ];
FileStat *pOldStat = NULL;
@@ -74,121 +74,121 @@ BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
case FSYS_SORT_NAME:
case (FSYS_SORT_NAME | FSYS_SORT_ASCENDING):
if ( pCurLstObj->aName > rNewEntry.aName )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->aName == rNewEntry.aName) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_NAME | FSYS_SORT_DESCENDING):
if ( pCurLstObj->aName < rNewEntry.aName )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->aName == rNewEntry.aName) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_EXT:
case (FSYS_SORT_EXT | FSYS_SORT_ASCENDING):
{
if ( pCurLstObj->GetExtension() > rNewEntry.GetExtension() )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->GetExtension() == rNewEntry.GetExtension()) )
- return FALSE;
+ return sal_False;
break;
}
case (FSYS_SORT_EXT | FSYS_SORT_DESCENDING):
{
if ( pCurLstObj->GetExtension() < rNewEntry.GetExtension() )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->GetExtension() == rNewEntry.GetExtension()) )
- return FALSE;
+ return sal_False;
break;
}
case FSYS_SORT_KIND:
case (FSYS_SORT_KIND | FSYS_SORT_ASCENDING ):
if ( VALUE(pOldStat->nKindFlags) > VALUE(rNewStat.nKindFlags) )
- return TRUE;
+ return sal_True;
if ( !(VALUE(pOldStat->nKindFlags) == VALUE(rNewStat.nKindFlags)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_KIND | FSYS_SORT_DESCENDING):
if ( VALUE(pOldStat->nKindFlags) < VALUE(rNewStat.nKindFlags) )
- return TRUE;
+ return sal_True;
if ( !(VALUE(pOldStat->nKindFlags) == VALUE(rNewStat.nKindFlags)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_SIZE:
case (FSYS_SORT_SIZE | FSYS_SORT_ASCENDING):
if ( pOldStat->nSize > rNewStat.nSize )
- return TRUE;
+ return sal_True;
if ( !(pOldStat->nSize == rNewStat.nSize) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_SIZE | FSYS_SORT_DESCENDING):
if ( pOldStat->nSize < rNewStat.nSize )
- return TRUE;
+ return sal_True;
if ( !(pOldStat->nSize == rNewStat.nSize) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_MODIFYED:
case (FSYS_SORT_MODIFYED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateModified >= rNewStat.aDateModified) &&
(pOldStat->aTimeModified > rNewStat.aTimeModified) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateModified == rNewStat.aDateModified) &&
(pOldStat->aTimeModified == rNewStat.aTimeModified)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_MODIFYED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateModified <= rNewStat.aDateModified) &&
(pOldStat->aTimeModified < rNewStat.aTimeModified) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateModified == rNewStat.aDateModified) &&
(pOldStat->aTimeModified == rNewStat.aTimeModified)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_CREATED:
case (FSYS_SORT_CREATED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateCreated >= rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated > rNewStat.aTimeCreated) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateCreated == rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated == rNewStat.aTimeCreated)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_CREATED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateCreated <= rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated < rNewStat.aTimeCreated) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateCreated == rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated == rNewStat.aTimeCreated)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_ACCESSED:
case (FSYS_SORT_ACCESSED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateAccessed >= rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed > rNewStat.aTimeAccessed) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateAccessed == rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed == rNewStat.aTimeAccessed)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_ACCESSED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateAccessed <= rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed < rNewStat.aTimeAccessed) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateAccessed == rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed == rNewStat.aTimeAccessed)) )
- return FALSE;
+ return sal_False;
break;
default: /* Kann nicht sein */;
}
if ( nSortIndex == ( pSortLst->size() - 1 ) )
- return TRUE;
+ return sal_True;
else
//Rekursion
return ImpInsertPointReached( rNewEntry, rNewStat,
@@ -272,7 +272,7 @@ void Dir::Construct( DirEntryKind nKindFlags )
|*
*************************************************************************/
-BOOL Dir::Update()
+sal_Bool Dir::Update()
{
Reset();
return Scan( USHRT_MAX ) > 0;
@@ -350,10 +350,10 @@ void Dir::Reset()
|*
*************************************************************************/
-USHORT Dir::Scan( USHORT nCount )
+sal_uInt16 Dir::Scan( sal_uInt16 nCount )
{
- USHORT nRead = 0; // Anzahl in dieser Runde gelesener Eintr"age
+ sal_uInt16 nRead = 0; // Anzahl in dieser Runde gelesener Eintr"age
FSysFailOnErrorImpl();
// noch nicht fertig gewesen
@@ -363,7 +363,7 @@ USHORT Dir::Scan( USHORT nCount )
if ( pLst->empty() )
{
// dann ggf. Laufwerke scannen
- pReader->bInUse = TRUE;
+ pReader->bInUse = sal_True;
nRead = pReader->Init();
}
@@ -484,7 +484,7 @@ Dir::~Dir()
FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort )
{
- BOOL bLast;
+ sal_Bool bLast;
FSysSort aSort;
FSysSortList *pNewSortLst = new FSysSortList;
@@ -495,8 +495,8 @@ FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort )
bLast = FSYS_SORT_END == (aSort & FSYS_SORT_END);
aSort &= ~FSYS_SORT_END;
- FSysSort nSort = aSort & ~(USHORT)FSYS_SORT_ASCENDING
- & ~(USHORT)FSYS_SORT_DESCENDING;
+ FSysSort nSort = aSort & ~(sal_uInt16)FSYS_SORT_ASCENDING
+ & ~(sal_uInt16)FSYS_SORT_DESCENDING;
// g"utliges Sortierkriterium?
if ( ( nSort == FSYS_SORT_NAME ) ||
@@ -630,7 +630,7 @@ Dir& Dir::operator+=( const Dir& rDir )
pLst = new DirEntryList();
//Verlangen die Sortierkriterien FileStat's?
- BOOL bStat = FALSE;
+ sal_Bool bStat = sal_False;
if ( pSortLst ) {
for ( size_t i = 0, n = pSortLst->size(); i < n && !bStat; ++i ) {
if ( (*pSortLst)[ i ]
@@ -638,7 +638,7 @@ Dir& Dir::operator+=( const Dir& rDir )
| FSYS_SORT_ACCESSED | FSYS_SORT_KIND
)
) {
- bStat = TRUE;
+ bStat = sal_True;
}
}
}
@@ -664,7 +664,7 @@ Dir& Dir::operator+=( const Dir& rDir )
*************************************************************************/
-size_t Dir::Count( BOOL bUpdated ) const
+size_t Dir::Count( sal_Bool bUpdated ) const
{
// ggf. erst den Rest lesen
if ( bUpdated && pReader )
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index 471d1275ab64..53d319800319 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -86,18 +86,18 @@ struct mymnttab
#if defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) || \
defined(OPENBSD) || defined(DRAGONFLY)
-BOOL GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ )
+sal_Bool GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ )
{
DBG_WARNING( "Sorry, not implemented: GetMountEntry" );
- return FALSE;
+ return sal_False;
}
#elif defined AIX
-BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+sal_Bool GetMountEntry(dev_t dev, struct mymnttab *mytab)
{
int bufsize;
if (mntctl (MCTL_QUERY, sizeof bufsize, (char*) &bufsize))
- return FALSE;
+ return sal_False;
char* buffer = (char *)malloc( bufsize * sizeof(char) );
if (mntctl (MCTL_QUERY, bufsize, buffer) != -1)
@@ -118,34 +118,34 @@ BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+= vmt2dataptr((struct vmount*)vmt, VMT_OBJECT);
mytab->mountdevice = dev;
free( buffer );
- return TRUE;
+ return sal_True;
}
}
free( buffer );
- return FALSE;
+ return sal_False;
}
#else
-static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+static sal_Bool GetMountEntry(dev_t dev, struct mymnttab *mytab)
{
#if defined SOLARIS
FILE *fp = fopen (MNTTAB, "r");
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab mnt[1];
while (getmntent (fp, mnt) != -1)
#elif defined AIX
FILE *fp = NULL;
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab mnt[1];
while ( 0 )
#else
FILE *fp = setmntent (MOUNTED, "r");
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab *mnt;
while ((mnt = getmntent (fp)) != NULL)
#endif
@@ -178,7 +178,7 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
mytab->mountdevice = dev;
mytab->mymnttab_filesystem = mnt->MOUNTFS;
- return TRUE;
+ return sal_True;
}
# ifdef LINUX
/* #61624# dito */
@@ -186,7 +186,7 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
# else
fclose (fp);
# endif
- return FALSE;
+ return sal_False;
}
#endif
@@ -197,13 +197,13 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
|*
*************************************************************************/
-BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
+sal_Bool DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (eFormatter==FSYS_STYLE_HOST)
{
#if defined(NETBSD) || defined(DRAGONFLY)
- return TRUE;
+ return sal_True;
#else
struct stat buf;
DirEntry aPath(*this);
@@ -213,7 +213,7 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (aPath.Level() == 1)
{
- return TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ return sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
}
aPath = aPath [1];
}
@@ -227,17 +227,17 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
(fsmnt.mymnttab_filesystem.CompareTo("smb") ==COMPARE_EQUAL) ||
(fsmnt.mymnttab_filesystem.CompareTo("ncpfs")==COMPARE_EQUAL))
{
- return FALSE;
+ return sal_False;
}
else
{
- return TRUE;
+ return sal_True;
}
#endif
}
else
{
- BOOL isCaseSensitive = TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ sal_Bool isCaseSensitive = sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
switch ( eFormatter )
{
case FSYS_STYLE_MAC:
@@ -247,19 +247,19 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
case FSYS_STYLE_NWFS:
case FSYS_STYLE_HPFS:
{
- isCaseSensitive = FALSE;
+ isCaseSensitive = sal_False;
break;
}
case FSYS_STYLE_SYSV:
case FSYS_STYLE_BSD:
case FSYS_STYLE_DETECT:
{
- isCaseSensitive = TRUE;
+ isCaseSensitive = sal_True;
break;
}
default:
{
- isCaseSensitive = TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ isCaseSensitive = sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
break;
}
}
@@ -273,16 +273,16 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
|*
*************************************************************************/
-BOOL DirEntry::ToAbs()
+sal_Bool DirEntry::ToAbs()
{
if ( FSYS_FLAG_VOLUME == eFlag )
{
eFlag = FSYS_FLAG_ABSROOT;
- return TRUE;
+ return sal_True;
}
if ( IsAbs() )
- return TRUE;
+ return sal_True;
char sBuf[MAXPATHLEN + 1];
*this = DirEntry( String( getcwd( sBuf, MAXPATHLEN ), osl_getThreadTextEncoding() ) ) + *this;
@@ -345,7 +345,7 @@ DirEntry DirEntry::GetDevice() const
|*
*************************************************************************/
-BOOL DirEntry::SetCWD( BOOL bSloppy ) const
+sal_Bool DirEntry::SetCWD( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -353,31 +353,31 @@ BOOL DirEntry::SetCWD( BOOL bSloppy ) const
ByteString aPath( GetFull(), osl_getThreadTextEncoding());
if ( !chdir( aPath.GetBuffer() ) )
{
- return TRUE;
+ return sal_True;
}
else
{
if ( bSloppy && !chdir(aPath.GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
else
{
- return FALSE;
+ return sal_False;
}
}
}
//-------------------------------------------------------------------------
-USHORT DirReader_Impl::Init()
+sal_uInt16 DirReader_Impl::Init()
{
return 0;
}
//-------------------------------------------------------------------------
-USHORT DirReader_Impl::Read()
+sal_uInt16 DirReader_Impl::Read()
{
if (!pDosDir)
{
@@ -386,7 +386,7 @@ USHORT DirReader_Impl::Read()
if (!pDosDir)
{
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -403,7 +403,7 @@ USHORT DirReader_Impl::Read()
: FSYS_FLAG_NORMAL;
DirEntry *pTemp = new DirEntry( ByteString(pDosEntry->d_name), eFlag, FSYS_STYLE_UNX );
if ( pParent )
- pTemp->ImpChangeParent( new DirEntry( *pParent ), FALSE);
+ pTemp->ImpChangeParent( new DirEntry( *pParent ), sal_False);
FileStat aStat( *pTemp );
if ( ( ( ( pDir->eAttrMask & FSYS_KIND_DIR ) &&
( aStat.IsKind( FSYS_KIND_DIR ) ) ) ||
@@ -423,7 +423,7 @@ USHORT DirReader_Impl::Read()
}
}
else
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -448,7 +448,7 @@ FileStat::FileStat( const void *, const void * ):
|* FileStat::Update()
|*
*************************************************************************/
-BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
+sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool )
{
nSize = 0;
@@ -465,7 +465,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
if ( !rDirEntry.IsValid() )
{
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
// Sonderbehandlung falls es sich um eine Root handelt
@@ -473,7 +473,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
{
nKindFlags = FSYS_KIND_DIR;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
struct stat aStat;
@@ -494,11 +494,11 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
{
nKindFlags = FSYS_KIND_WILD;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
nError = FSYS_ERR_OK;
@@ -520,7 +520,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
Unx2DateAndTime( aStat.st_mtime, aTimeModified, aDateModified );
Unx2DateAndTime( aStat.st_atime, aTimeAccessed, aDateAccessed );
- return TRUE;
+ return sal_True;
}
//====================================================================
@@ -605,7 +605,7 @@ ErrCode FileStat::QueryDiskSpace( const String &, BigInt &, BigInt & )
//=========================================================================
-void FSysEnableSysErrorBox( BOOL )
+void FSysEnableSysErrorBox( sal_Bool )
{
}
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 91e4e6936bf5..57531aa4b05e 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -426,6 +426,8 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
{ "", "", 0, false, false, false, false, true, true, true, false },
{ "smb", "smb://", 139, true, true, false, true, true, true, true,
true },
+ { "hid", "hid:", 0, false, false, false, false, false, false,
+ false, true },
{ "sftp", "sftp://", 22, true, true, false, true, true, true, true,
true } };
@@ -2136,6 +2138,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
{ "db:", "staroffice.db:", INET_PROT_DB, PrefixInfo::INTERNAL },
{ "file:", 0, INET_PROT_FILE, PrefixInfo::OFFICIAL },
{ "ftp:", 0, INET_PROT_FTP, PrefixInfo::OFFICIAL },
+ { "hid:", "staroffice.hid:", INET_PROT_HID,
+ PrefixInfo::INTERNAL },
{ "http:", 0, INET_PROT_HTTP, PrefixInfo::OFFICIAL },
{ "https:", 0, INET_PROT_HTTPS, PrefixInfo::OFFICIAL },
{ "imap:", 0, INET_PROT_IMAP, PrefixInfo::OFFICIAL },
@@ -2171,6 +2175,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL },
{ "staroffice.helpid:", "private:helpid/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
+ { "staroffice.hid:", "hid:", INET_PROT_HID,
+ PrefixInfo::EXTERNAL },
{ "staroffice.java:", "private:java/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
{ "staroffice.macro:", "macro:", INET_PROT_MACRO,
@@ -3164,6 +3170,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
case INET_PROT_PRIV_SOFFICE:
case INET_PROT_SLOT:
+ case INET_PROT_HID:
case INET_PROT_MACRO:
case INET_PROT_UNO:
case INET_PROT_COMPONENT:
diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx
index e391dd5020c3..acc1ce9a2071 100644..100755
--- a/tools/source/fsys/wldcrd.cxx
+++ b/tools/source/fsys/wldcrd.cxx
@@ -45,7 +45,7 @@
*
*/
-USHORT WildCard::ImpMatch( const char *pWild, const char *pStr ) const
+sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const
{
int pos=0;
int flag=0;
@@ -110,12 +110,12 @@ USHORT WildCard::ImpMatch( const char *pWild, const char *pStr ) const
|*
*************************************************************************/
-BOOL WildCard::Matches( const String& rString ) const
+sal_Bool WildCard::Matches( const String& rString ) const
{
ByteString aTmpWild = aWildString;
ByteString aString(rString, osl_getThreadTextEncoding());
- USHORT nSepPos;
+ sal_uInt16 nSepPos;
if ( cSepSymbol != '\0' )
{
@@ -123,16 +123,16 @@ BOOL WildCard::Matches( const String& rString ) const
{
// alle getrennten WildCard's pruefen
if ( ImpMatch( aTmpWild.Copy( 0, nSepPos ).GetBuffer(), aString.GetBuffer() ) )
- return TRUE;
+ return sal_True;
aTmpWild.Erase( 0, nSepPos + 1 ); // Trennsymbol entfernen
}
// und noch den hinter dem letzen Trennsymbol bzw. den einzigen
}
if ( ImpMatch( aTmpWild.GetBuffer(), aString.GetBuffer() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx
index 21cf379ed031..cfe64bea12f8 100644..100755
--- a/tools/source/fsys/wntmsc.cxx
+++ b/tools/source/fsys/wntmsc.cxx
@@ -48,7 +48,7 @@
int Sys2SolarError_Impl( int nSysErr );
-static BOOL bLastCaseSensitive = FALSE;
+static sal_Bool bLastCaseSensitive = sal_False;
//--------------------------------------------------------------------
@@ -99,7 +99,7 @@ struct dirent *readdir( DIR *pDir )
int closedir( DIR *pDir )
{
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
if ( pDir )
{
bOk = 0 != pDir->p || FindClose( pDir->h );
@@ -128,7 +128,7 @@ ErrCode GetPathStyle_Impl( const String &rDevice, FSysPathStyle &rStyle )
// Windows95 hat VFAT, WindowsNT nicht
DWORD nVer = GetVersion();
- BOOL bW95 = ( nVer & 0xFF ) >= 4;
+ sal_Bool bW95 = ( nVer & 0xFF ) >= 4;
FSysFailOnErrorImpl();
rStyle = FSYS_STYLE_UNKNOWN;
@@ -173,7 +173,7 @@ FSysPathStyle DirEntry::GetPathStyle( const String &rDevice )
|*
*************************************************************************/
-BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
+sal_Bool DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (eFormatter==FSYS_STYLE_HOST)
@@ -182,7 +182,7 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
DirEntry aRoot(*this);
aRoot.ToAbs();
aRoot = aRoot[Level()-1];
- String aRootDir = aRoot.GetFull(FSYS_STYLE_HOST, TRUE);
+ String aRootDir = aRoot.GetFull(FSYS_STYLE_HOST, sal_True);
char sVolumeName[256];
DWORD nVolumeSerial;
@@ -199,30 +199,30 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
sFileSysName,
16 ))
{
- return (nFlags & FS_CASE_SENSITIVE) ? TRUE : FALSE;
+ return (nFlags & FS_CASE_SENSITIVE) ? sal_True : sal_False;
}
else
{
- return FALSE;
+ return sal_False;
}
*/
//
// guter versuch, aber FS_CASE_SENSITIVE ist D?nnsinn in T?ten:
//
// sFileSysName FS_CASE_SENSITIVE
- // FAT FALSE
- // NTFS TRUE !!!
- // NWCompat FALSE
- // Samba FALSE
+ // FAT sal_False
+ // NTFS sal_True !!!
+ // NWCompat sal_False
+ // Samba sal_False
//
// NT spricht auch NTFS lediglich case preserving an, also ist unter NT alles case insensitiv
//
- return FALSE;
+ return sal_False;
}
else
{
- BOOL isCaseSensitive = FALSE; // ich bin unter win32, also ist der default case insensitiv
+ sal_Bool isCaseSensitive = sal_False; // ich bin unter win32, also ist der default case insensitiv
switch ( eFormatter )
{
case FSYS_STYLE_MAC:
@@ -233,18 +233,18 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
case FSYS_STYLE_HPFS:
case FSYS_STYLE_DETECT:
{
- isCaseSensitive = FALSE;
+ isCaseSensitive = sal_False;
break;
}
case FSYS_STYLE_SYSV:
case FSYS_STYLE_BSD:
{
- isCaseSensitive = TRUE;
+ isCaseSensitive = sal_True;
break;
}
default:
{
- isCaseSensitive = FALSE; // ich bin unter win32, also ist der default case insensitiv
+ isCaseSensitive = sal_False; // ich bin unter win32, also ist der default case insensitiv
break;
}
}
@@ -258,19 +258,19 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
|*
*************************************************************************/
-BOOL DirEntry::ToAbs()
+sal_Bool DirEntry::ToAbs()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
if ( FSYS_FLAG_VOLUME == eFlag )
{
eFlag = FSYS_FLAG_ABSROOT;
- return TRUE;
+ return sal_True;
}
if ( IsAbs() )
{
- return TRUE;
+ return sal_True;
}
@@ -279,10 +279,10 @@ BOOL DirEntry::ToAbs()
ByteString aFullName( GetFull(), osl_getThreadTextEncoding() );
FSysFailOnErrorImpl();
if ( GetFullPathName((char*)aFullName.GetBuffer(),256,sBuf,&pOld) > 511 )
- return FALSE;
+ return sal_False;
*this = DirEntry( String(sBuf, osl_getThreadTextEncoding() ));
- return TRUE;
+ return sal_True;
}
@@ -340,27 +340,27 @@ String DirEntry::GetVolume() const
|*
*************************************************************************/
-BOOL DirEntry::SetCWD( BOOL bSloppy ) const
+sal_Bool DirEntry::SetCWD( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
FSysFailOnErrorImpl();
if ( eFlag == FSYS_FLAG_CURRENT && !aName.Len() )
- return TRUE;
+ return sal_True;
if ( SetCurrentDirectory(ByteString(GetFull(), osl_getThreadTextEncoding()).GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
if ( bSloppy && pParent &&
SetCurrentDirectory(ByteString(pParent->GetFull(), osl_getThreadTextEncoding()).GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------------
@@ -420,7 +420,7 @@ USHORT DirReader_Impl::Read()
CharLowerBuff( (char*) aLowerName.GetBuffer(), aLowerName.Len() );
// Flags pruefen
- BOOL bIsDirAndWantsDir =
+ sal_Bool bIsDirAndWantsDir =
( ( pDir->eAttrMask & FSYS_KIND_DIR ) &&
#ifdef ICC
( pDosEntry->d_type & ( strcmp(pDosEntry->d_name,".") ||
@@ -428,7 +428,7 @@ USHORT DirReader_Impl::Read()
#else
( pDosEntry->d_type & DOS_DIRECT ) );
#endif
- BOOL bIsFileAndWantsFile =
+ sal_Bool bIsFileAndWantsFile =
( ( pDir->eAttrMask & FSYS_KIND_FILE ) &&
#ifdef ICC
!( pDosEntry->d_type & ( strcmp(pDosEntry->d_name,".") ||
@@ -437,8 +437,8 @@ USHORT DirReader_Impl::Read()
!( pDosEntry->d_type & DOS_DIRECT ) &&
#endif
!( pDosEntry->d_type & DOS_VOLUMEID ) );
- BOOL bIsHidden = (pDosEntry->d_type & _A_HIDDEN) != 0;
- BOOL bWantsHidden = 0 == ( pDir->eAttrMask & FSYS_KIND_VISIBLE );
+ sal_Bool bIsHidden = (pDosEntry->d_type & _A_HIDDEN) != 0;
+ sal_Bool bWantsHidden = 0 == ( pDir->eAttrMask & FSYS_KIND_VISIBLE );
if ( ( bIsDirAndWantsDir || bIsFileAndWantsFile ) &&
( bWantsHidden || !bIsHidden ) &&
pDir->aNameMask.Matches( String(aLowerName, osl_getThreadTextEncoding()) ) )
@@ -459,7 +459,7 @@ USHORT DirReader_Impl::Read()
pTemp->ImpSetStat( new FileStat( (void*) pDosDir, (void*) 0 ) );
#endif
if ( pParent )
- pTemp->ImpChangeParent( new DirEntry( *pParent ), FALSE );
+ pTemp->ImpChangeParent( new DirEntry( *pParent ), sal_False );
if ( pDir->pStatLst ) //Status fuer Sort gewuenscht?
{
FileStat *pNewStat = new FileStat( (void*) pDosDir, (void*) 0 );
@@ -478,7 +478,7 @@ USHORT DirReader_Impl::Read()
}
else
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -567,9 +567,7 @@ FileStat::FileStat( const void *pInfo, // struct dirent
#pragma warning(push, 1)
#pragma warning(disable: 4917)
#endif
-#define ULONG WIN_ULONG
#include <shlobj.h>
-#undef ULONG
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@@ -608,7 +606,7 @@ HRESULT SHGetIDListFromPath( HWND hwndOwner, LPCTSTR pszPath, LPITEMIDLIST *ppid
if ( FAILED(hResult) )
return hResult;
- WIN_ULONG chEaten = lstrlen( pszPath );
+ ULONG chEaten = lstrlen( pszPath );
DWORD dwAttributes = FILE_ATTRIBUTE_DIRECTORY;
#ifdef UNICODE
@@ -761,13 +759,13 @@ HRESULT SHResolvePath( HWND hwndOwner, LPCTSTR pszPath, LPITEMIDLIST *ppidl )
// The Wrapper
//---------------------------------------------------------------------------
-BOOL Exists_Impl( const ByteString & crPath )
+sal_Bool Exists_Impl( const ByteString & crPath )
{
// We do not know if OLE was initialized for this thread
CoInitialize( NULL );
- BOOL bSuccess = SUCCEEDED( SHResolvePath(NULL, crPath.GetBuffer(), NULL) );
+ sal_Bool bSuccess = SUCCEEDED( SHResolvePath(NULL, crPath.GetBuffer(), NULL) );
CoUninitialize();
@@ -776,7 +774,7 @@ BOOL Exists_Impl( const ByteString & crPath )
//---------------------------------------------------------------------------
-BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
+sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
{
nSize = 0;
nKindFlags = 0;
@@ -793,7 +791,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nError = FSYS_ERR_UNKNOWN;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
// Sonderbehandlung falls es sich um eine Root ohne Laufwerk handelt
@@ -802,7 +800,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_DIR;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
// keine Error-Boxen anzeigen
@@ -817,7 +815,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
// ist ein Medium im Laufwerk?
HACK("wie?")
- BOOL bAccess = TRUE;
+ sal_Bool bAccess = sal_True;
const DirEntry *pTop = aDirEntry.ImpGetTopPtr();
ByteString aName = ByteString(pTop->aName).ToLowerAscii();
if ( !bForceAccess &&
@@ -825,7 +823,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
pTop->eFlag == FSYS_FLAG_RELROOT ||
pTop->eFlag == FSYS_FLAG_VOLUME ) )
if ( aName == "a:" || aName == "b:" )
- bAccess = FALSE;
+ bAccess = sal_False;
else
OSL_TRACE( "FSys: will access removable device!" );
if ( bAccess && ( aName == "a:" || aName == "b:" ) ) {
@@ -849,7 +847,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
nKindFlags |= FSYS_KIND_REMOVEABLE;
nError = FSYS_ERR_NOTEXISTS;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
ByteString aRootDir = aDirEntry.aName;
@@ -859,7 +857,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nError = FSYS_ERR_NOTEXISTS;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
if ( aDirEntry.eFlag == FSYS_FLAG_VOLUME )
@@ -873,7 +871,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
nError = ERRCODE_NONE;
- return TRUE;
+ return sal_True;
}
// Statusinformation vom Betriebssystem holen
@@ -913,7 +911,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_UNKNOWN;
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
// UNC-Volume?
@@ -927,13 +925,13 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_DIR|FSYS_KIND_REMOTE;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
else
{
nKindFlags = FSYS_KIND_UNKNOWN;
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
}
}
@@ -952,7 +950,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_WILD;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
if ( bAccess )
@@ -976,7 +974,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
}
-BOOL IsRedirectable_Impl( const ByteString &rPath )
+sal_Bool IsRedirectable_Impl( const ByteString &rPath )
{
if ( rPath.Len() >= 3 && ':' == rPath.GetBuffer()[1] )
{
@@ -985,7 +983,7 @@ BOOL IsRedirectable_Impl( const ByteString &rPath )
SetLastError( ERROR_SUCCESS );
return DRIVE_FIXED != nType;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1033,7 +1031,7 @@ ErrCode FileStat::QueryDiskSpace( const String &rPath,
//=========================================================================
-void FSysEnableSysErrorBox( BOOL bEnable )
+void FSysEnableSysErrorBox( sal_Bool bEnable )
{ // Preserve other Bits!!
sal_uInt32 nErrorMode = SetErrorMode( bEnable ? 0 : SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX );
if ( bEnable )
diff --git a/tools/source/fsys/wntmsc.hxx b/tools/source/fsys/wntmsc.hxx
index a50498bb0fd9..beeac31ef6fe 100644..100755
--- a/tools/source/fsys/wntmsc.hxx
+++ b/tools/source/fsys/wntmsc.hxx
@@ -52,7 +52,7 @@
//--------------------------------------------------------------------
-#define FSYS_UNIX FALSE
+#define FSYS_UNIX sal_False
#define DOS_DIRECT _A_SUBDIR
#define DOS_VOLUMEID 0x08
@@ -80,7 +80,7 @@ typedef struct
#define START_DRV 'a'
-inline BOOL DRIVE_EXISTS(char c)
+inline sal_Bool DRIVE_EXISTS(char c)
{
ByteString aDriveRoot( c );
aDriveRoot += ":\\";
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index ae99ab7ed886..724ec724748b 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -50,7 +50,7 @@ static const long MY_MINSHORT = -MY_MAXSHORT;
* sind diese Algorithmen im Kapitel 4.3.1. The Classical Algorithms.
*/
-// Muss auf UINT16/INT16/UINT32/INT32 umgestellt werden !!! W.P.
+// Muss auf sal_uInt16/INT16/sal_uInt32/sal_Int32 umgestellt werden !!! W.P.
// -----------------------------------------------------------------------
@@ -645,7 +645,7 @@ BigInt::BigInt( sal_uInt32 nValue )
// -----------------------------------------------------------------------
-BigInt::operator ULONG() const
+BigInt::operator sal_uIntPtr() const
{
if ( !bIsBig )
return (sal_uInt32)nVal;
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 88bfda6a1a04..9a209b38f754 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -61,10 +61,10 @@ Color::Color( const ResId& rResId )
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
// Daten laden
- USHORT nRed = pResMgr->ReadShort();
- USHORT nGreen = pResMgr->ReadShort();
- USHORT nBlue = pResMgr->ReadShort();
- // one more historical ULONG
+ sal_uInt16 nRed = pResMgr->ReadShort();
+ sal_uInt16 nGreen = pResMgr->ReadShort();
+ sal_uInt16 nBlue = pResMgr->ReadShort();
+ // one more historical sal_uIntPtr
pResMgr->ReadLong();
// RGB-Farbe
@@ -75,60 +75,60 @@ Color::Color( const ResId& rResId )
mnColor = RGB_COLORDATA( 0, 0, 0 );
}
}
-UINT8 Color::GetColorError( const Color& rCompareColor ) const
+sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const
{
const long nErrAbs = labs( (long) rCompareColor.GetRed() - GetRed() ) +
labs( (long) rCompareColor.GetGreen() - GetGreen() ) +
labs( (long) rCompareColor.GetBlue() - GetBlue() );
- return (UINT8) _FRound( nErrAbs * 0.3333333333 );
+ return (sal_uInt8) _FRound( nErrAbs * 0.3333333333 );
}
// -----------------------------------------------------------------------
-void Color::IncreaseLuminance( UINT8 cLumInc )
+void Color::IncreaseLuminance( sal_uInt8 cLumInc )
{
- SetRed( (UINT8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) );
}
// -----------------------------------------------------------------------
-void Color::DecreaseLuminance( UINT8 cLumDec )
+void Color::DecreaseLuminance( sal_uInt8 cLumDec )
{
- SetRed( (UINT8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) );
}
// -----------------------------------------------------------------------
-void Color::IncreaseContrast( UINT8 cContInc )
+void Color::IncreaseContrast( sal_uInt8 cContInc )
{
if( cContInc)
{
const double fM = 128.0 / ( 128.0 - 0.4985 * cContInc );
const double fOff = 128.0 - fM * 128.0;
- SetRed( (UINT8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
}
}
// -----------------------------------------------------------------------
-void Color::DecreaseContrast( UINT8 cContDec )
+void Color::DecreaseContrast( sal_uInt8 cContDec )
{
if( cContDec )
{
const double fM = ( 128.0 - 0.4985 * cContDec ) / 128.0;
const double fOff = 128.0 - fM * 128.0;
- SetRed( (UINT8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
}
}
@@ -143,14 +143,14 @@ void Color::Invert()
// -----------------------------------------------------------------------
-BOOL Color::IsDark() const
+sal_Bool Color::IsDark() const
{
return GetLuminance() <= 38;
}
// -----------------------------------------------------------------------
-BOOL Color::IsBright() const
+sal_Bool Color::IsBright() const
{
return GetLuminance() >= 245;
}
@@ -159,10 +159,10 @@ BOOL Color::IsBright() const
// color space conversion
// -----------------------------------------------------------------------
-void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
+void Color::RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const
{
- UINT8 c[3];
- UINT8 cMax, cMin;
+ sal_uInt8 c[3];
+ sal_uInt8 cMax, cMin;
c[0] = GetRed();
c[1] = GetGreen();
@@ -183,7 +183,7 @@ void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
if( c[2] < cMin )
cMin = c[2];
- UINT8 cDelta = cMax - cMin;
+ sal_uInt8 cDelta = cMax - cMin;
// Saturation = max - min / max
if( nBri > 0 )
@@ -214,14 +214,14 @@ void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
if( dHue < 0.0 )
dHue += 360.0;
- nHue = (UINT16) dHue;
+ nHue = (sal_uInt16) dHue;
}
}
-ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
+ColorData Color::HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri )
{
- UINT8 cR=0,cG=0,cB=0;
- UINT8 nB = (UINT8) ( nBri * 255 / 100 );
+ sal_uInt8 cR=0,cG=0,cB=0;
+ sal_uInt8 nB = (sal_uInt8) ( nBri * 255 / 100 );
if( nSat == 0 )
{
@@ -233,17 +233,17 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
{
double dH = nHue;
double f;
- UINT16 n;
+ sal_uInt16 n;
if( dH == 360.0 )
dH = 0.0;
dH /= 60.0;
- n = (UINT16) dH;
+ n = (sal_uInt16) dH;
f = dH - n;
- UINT8 a = (UINT8) ( nB * ( 100 - nSat ) / 100 );
- UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f + 0.5 ) ) / 100 );
- UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) + 0.5 ) ) / 100 );
+ sal_uInt8 a = (sal_uInt8) ( nB * ( 100 - nSat ) / 100 );
+ sal_uInt8 b = (sal_uInt8) ( nB * ( 100 - ( (double)nSat * f ) ) / 100 );
+ sal_uInt8 c = (sal_uInt8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) ) ) / 100 );
switch( n )
{
@@ -261,7 +261,7 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
// -----------------------------------------------------------------------
-SvStream& Color::Read( SvStream& rIStm, BOOL bNewFormat )
+SvStream& Color::Read( SvStream& rIStm, sal_Bool bNewFormat )
{
if ( bNewFormat )
rIStm >> mnColor;
@@ -273,7 +273,7 @@ SvStream& Color::Read( SvStream& rIStm, BOOL bNewFormat )
// -----------------------------------------------------------------------
-SvStream& Color::Write( SvStream& rOStm, BOOL bNewFormat )
+SvStream& Color::Write( SvStream& rOStm, sal_Bool bNewFormat )
{
if ( bNewFormat )
rOStm << mnColor;
@@ -285,13 +285,13 @@ SvStream& Color::Write( SvStream& rOStm, BOOL bNewFormat )
// -----------------------------------------------------------------------
-#define COL_NAME_USER ((USHORT)0x8000)
-#define COL_RED_1B ((USHORT)0x0001)
-#define COL_RED_2B ((USHORT)0x0002)
-#define COL_GREEN_1B ((USHORT)0x0010)
-#define COL_GREEN_2B ((USHORT)0x0020)
-#define COL_BLUE_1B ((USHORT)0x0100)
-#define COL_BLUE_2B ((USHORT)0x0200)
+#define COL_NAME_USER ((sal_uInt16)0x8000)
+#define COL_RED_1B ((sal_uInt16)0x0001)
+#define COL_RED_2B ((sal_uInt16)0x0002)
+#define COL_GREEN_1B ((sal_uInt16)0x0010)
+#define COL_GREEN_2B ((sal_uInt16)0x0020)
+#define COL_BLUE_1B ((sal_uInt16)0x0100)
+#define COL_BLUE_2B ((sal_uInt16)0x0200)
// -----------------------------------------------------------------------
@@ -299,10 +299,10 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor )
{
DBG_ASSERTWARNING( rIStream.GetVersion(), "Color::>> - Solar-Version not set on rIStream" );
- USHORT nColorName;
- USHORT nRed;
- USHORT nGreen;
- USHORT nBlue;
+ sal_uInt16 nColorName;
+ sal_uInt16 nRed;
+ sal_uInt16 nGreen;
+ sal_uInt16 nBlue;
rIStream >> nColorName;
@@ -311,7 +311,7 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor )
if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
{
unsigned char cAry[6];
- USHORT i = 0;
+ sal_uInt16 i = 0;
nRed = 0;
nGreen = 0;
@@ -437,10 +437,10 @@ SvStream& operator<<( SvStream& rOStream, const Color& rColor )
{
DBG_ASSERTWARNING( rOStream.GetVersion(), "Color::<< - Solar-Version not set on rOStream" );
- USHORT nColorName = COL_NAME_USER;
- USHORT nRed = rColor.GetRed();
- USHORT nGreen = rColor.GetGreen();
- USHORT nBlue = rColor.GetBlue();
+ sal_uInt16 nColorName = COL_NAME_USER;
+ sal_uInt16 nRed = rColor.GetRed();
+ sal_uInt16 nGreen = rColor.GetGreen();
+ sal_uInt16 nBlue = rColor.GetBlue();
nRed = (nRed<<8) + nRed;
nGreen = (nGreen<<8) + nGreen;
nBlue = (nBlue<<8) + nBlue;
@@ -448,7 +448,7 @@ SvStream& operator<<( SvStream& rOStream, const Color& rColor )
if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
{
unsigned char cAry[6];
- USHORT i = 0;
+ sal_uInt16 i = 0;
if ( nRed & 0x00FF )
{
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index b0c9eaf9ddae..6c533459f2a7 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -57,7 +57,7 @@ struct ImplKeyData
ImplKeyData* mpNext;
ByteString maKey;
ByteString maValue;
- BOOL mbIsComment;
+ sal_Bool mbIsComment;
};
struct ImplGroupData
@@ -65,20 +65,20 @@ struct ImplGroupData
ImplGroupData* mpNext;
ImplKeyData* mpFirstKey;
ByteString maGroupName;
- USHORT mnEmptyLines;
+ sal_uInt16 mnEmptyLines;
};
struct ImplConfigData
{
ImplGroupData* mpFirstGroup;
XubString maFileName;
- ULONG mnDataUpdateId;
- ULONG mnTimeStamp;
+ sal_uIntPtr mnDataUpdateId;
+ sal_uIntPtr mnTimeStamp;
LineEnd meLineEnd;
- USHORT mnRefCount;
- BOOL mbModified;
- BOOL mbRead;
- BOOL mbIsUTF8BOM;
+ sal_uInt16 mnRefCount;
+ sal_Bool mbModified;
+ sal_Bool mbRead;
+ sal_Bool mbIsUTF8BOM;
};
// =======================================================================
@@ -104,9 +104,9 @@ static String toUncPath( const String& rPath )
return aFileURL;
}
-static ULONG ImplSysGetConfigTimeStamp( const XubString& rFileName )
+static sal_uIntPtr ImplSysGetConfigTimeStamp( const XubString& rFileName )
{
- ULONG nTimeStamp = 0;
+ sal_uIntPtr nTimeStamp = 0;
::osl::DirectoryItem aItem;
::osl::FileStatus aStatus( osl_FileStatus_Mask_ModifyTime );
@@ -122,10 +122,10 @@ static ULONG ImplSysGetConfigTimeStamp( const XubString& rFileName )
// -----------------------------------------------------------------------
-static BYTE* ImplSysReadConfig( const XubString& rFileName,
- sal_uInt64& rRead, BOOL& rbRead, BOOL& rbIsUTF8BOM, ULONG& rTimeStamp )
+static sal_uInt8* ImplSysReadConfig( const XubString& rFileName,
+ sal_uInt64& rRead, sal_Bool& rbRead, sal_Bool& rbIsUTF8BOM, sal_uIntPtr& rTimeStamp )
{
- BYTE* pBuf = NULL;
+ sal_uInt8* pBuf = NULL;
::osl::File aFile( rFileName );
if( aFile.open( osl_File_OpenFlag_Read ) == ::osl::FileBase::E_None )
@@ -137,7 +137,7 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
aFile.close();
return 0;
}
- pBuf = new BYTE[static_cast< std::size_t >(nPos)];
+ pBuf = new sal_uInt8[static_cast< std::size_t >(nPos)];
sal_uInt64 nRead = 0;
if( aFile.read( pBuf, nPos, nRead ) == ::osl::FileBase::E_None && nRead == nPos )
{
@@ -146,12 +146,12 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
if (nRead > 2 && memcmp(pBuf, BOM, 3) == 0)
{
nRead -= 3;
- rtl_moveMemory(pBuf, pBuf + 3, sal::static_int_cast<sal_Size>(nRead * sizeof(BYTE)) );
- rbIsUTF8BOM = TRUE;
+ rtl_moveMemory(pBuf, pBuf + 3, sal::static_int_cast<sal_Size>(nRead * sizeof(sal_uInt8)) );
+ rbIsUTF8BOM = sal_True;
}
rTimeStamp = ImplSysGetConfigTimeStamp( rFileName );
- rbRead = TRUE;
+ rbRead = sal_True;
rRead = nRead;
}
else
@@ -168,11 +168,11 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
// -----------------------------------------------------------------------
-static BOOL ImplSysWriteConfig( const XubString& rFileName,
- const BYTE* pBuf, ULONG nBufLen, BOOL rbIsUTF8BOM, ULONG& rTimeStamp )
+static sal_Bool ImplSysWriteConfig( const XubString& rFileName,
+ const sal_uInt8* pBuf, sal_uIntPtr nBufLen, sal_Bool rbIsUTF8BOM, sal_uIntPtr& rTimeStamp )
{
- BOOL bSuccess = FALSE;
- BOOL bUTF8BOMSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
+ sal_Bool bUTF8BOMSuccess = sal_False;
::osl::File aFile( rFileName );
::osl::FileBase::RC eError = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
@@ -191,13 +191,13 @@ static BOOL ImplSysWriteConfig( const XubString& rFileName,
sal_uInt64 nUTF8BOMWritten;
if( aFile.write( BOM, 3, nUTF8BOMWritten ) == ::osl::FileBase::E_None && 3 == nUTF8BOMWritten )
{
- bUTF8BOMSuccess = TRUE;
+ bUTF8BOMSuccess = sal_True;
}
}
if( aFile.write( pBuf, nBufLen, nWritten ) == ::osl::FileBase::E_None && nWritten == nBufLen )
{
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
if ( rbIsUTF8BOM ? bSuccess && bUTF8BOMSuccess : bSuccess )
{
@@ -260,7 +260,7 @@ static String ImplMakeConfigName( const XubString* pFileName,
namespace {
-ByteString makeByteString(BYTE const * p, sal_uInt64 n) {
+ByteString makeByteString(sal_uInt8 const * p, sal_uInt64 n) {
if (n > STRING_MAXLEN) {
#ifdef WNT
abort();
@@ -276,7 +276,7 @@ ByteString makeByteString(BYTE const * p, sal_uInt64 n) {
}
static void ImplMakeConfigList( ImplConfigData* pData,
- const BYTE* pBuf, sal_uInt64 nLen )
+ const sal_uInt8* pBuf, sal_uInt64 nLen )
{
// kein Buffer, keine Daten
if ( !nLen )
@@ -288,7 +288,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
xub_StrLen nNameLen;
xub_StrLen nKeyLen;
sal_uInt64 i;
- const BYTE* pLine;
+ const sal_uInt8* pLine;
ImplKeyData* pPrevKey = NULL;
ImplKeyData* pKey;
ImplGroupData* pPrevGroup = NULL;
@@ -382,7 +382,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( pGroup->mnEmptyLines )
{
pKey = new ImplKeyData;
- pKey->mbIsComment = TRUE;
+ pKey->mbIsComment = sal_True;
pPrevKey->mpNext = pKey;
pPrevKey = pKey;
pGroup->mnEmptyLines--;
@@ -400,11 +400,11 @@ static void ImplMakeConfigList( ImplConfigData* pData,
if ( pLine[0] == ';' )
{
pKey->maValue = makeByteString(pLine, nLineLen);
- pKey->mbIsComment = TRUE;
+ pKey->mbIsComment = sal_True;
}
else
{
- pKey->mbIsComment = FALSE;
+ pKey->mbIsComment = sal_False;
nNameLen = 0;
while ( (nNameLen < nLineLen) && (pLine[nNameLen] != '=') )
nNameLen++;
@@ -451,17 +451,17 @@ static void ImplMakeConfigList( ImplConfigData* pData,
// -----------------------------------------------------------------------
-static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
+static sal_uInt8* ImplGetConfigBuffer( const ImplConfigData* pData, sal_uIntPtr& rLen )
{
- BYTE* pWriteBuf;
- BYTE* pBuf;
- BYTE aLineEndBuf[2] = {0, 0};
+ sal_uInt8* pWriteBuf;
+ sal_uInt8* pBuf;
+ sal_uInt8 aLineEndBuf[2] = {0, 0};
ImplKeyData* pKey;
ImplGroupData* pGroup;
unsigned int nBufLen;
- USHORT nValueLen;
- USHORT nKeyLen;
- USHORT nLineEndLen;
+ sal_uInt16 nValueLen;
+ sal_uInt16 nKeyLen;
+ sal_uInt16 nLineEndLen;
if ( pData->meLineEnd == LINEEND_CR )
{
@@ -514,7 +514,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
rLen = nBufLen;
if ( !nBufLen )
{
- pWriteBuf = new BYTE[nLineEndLen];
+ pWriteBuf = new sal_uInt8[nLineEndLen];
if ( pWriteBuf )
{
pWriteBuf[0] = aLineEndBuf[0];
@@ -527,7 +527,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
}
// Schreibbuffer anlegen (wird vom Aufrufer zerstoert)
- pWriteBuf = new BYTE[nBufLen];
+ pWriteBuf = new sal_uInt8[nBufLen];
if ( !pWriteBuf )
return 0;
@@ -584,7 +584,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
}
// Leerzeile nach jeder Gruppe auch wieder speichern
- USHORT nEmptyLines = pGroup->mnEmptyLines;
+ sal_uInt16 nEmptyLines = pGroup->mnEmptyLines;
while ( nEmptyLines )
{
*pBuf = aLineEndBuf[0]; pBuf++;
@@ -606,11 +606,11 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
static void ImplReadConfig( ImplConfigData* pData )
{
- ULONG nTimeStamp = 0;
+ sal_uIntPtr nTimeStamp = 0;
sal_uInt64 nRead = 0;
- BOOL bRead = FALSE;
- BOOL bIsUTF8BOM =FALSE;
- BYTE* pBuf = ImplSysReadConfig( pData->maFileName, nRead, bRead, bIsUTF8BOM, nTimeStamp );
+ sal_Bool bRead = sal_False;
+ sal_Bool bIsUTF8BOM =sal_False;
+ sal_uInt8* pBuf = ImplSysReadConfig( pData->maFileName, nRead, bRead, bIsUTF8BOM, nTimeStamp );
// Aus dem Buffer die Config-Verwaltungsliste aufbauen
if ( pBuf )
@@ -619,11 +619,11 @@ static void ImplReadConfig( ImplConfigData* pData )
delete[] pBuf;
}
pData->mnTimeStamp = nTimeStamp;
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
if ( bRead )
- pData->mbRead = TRUE;
+ pData->mbRead = sal_True;
if ( bIsUTF8BOM )
- pData->mbIsUTF8BOM = TRUE;
+ pData->mbIsUTF8BOM = sal_True;
}
// -----------------------------------------------------------------------
@@ -641,16 +641,16 @@ static void ImplWriteConfig( ImplConfigData* pData )
#endif
// Aus der Config-Liste einen Buffer zusammenbauen
- ULONG nBufLen;
- BYTE* pBuf = ImplGetConfigBuffer( pData, nBufLen );
+ sal_uIntPtr nBufLen;
+ sal_uInt8* pBuf = ImplGetConfigBuffer( pData, nBufLen );
if ( pBuf )
{
if ( ImplSysWriteConfig( pData->maFileName, pBuf, nBufLen, pData->mbIsUTF8BOM, pData->mnTimeStamp ) )
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
delete[] pBuf;
}
else
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
}
// -----------------------------------------------------------------------
@@ -694,8 +694,8 @@ static ImplConfigData* ImplGetConfigData( const XubString& rFileName )
pData->mnDataUpdateId = 0;
pData->meLineEnd = LINEEND_CRLF;
pData->mnRefCount = 0;
- pData->mbRead = FALSE;
- pData->mbIsUTF8BOM = FALSE;
+ pData->mbRead = sal_False;
+ pData->mbIsUTF8BOM = sal_False;
ImplReadConfig( pData );
return pData;
@@ -711,7 +711,7 @@ static void ImplFreeConfigData( ImplConfigData* pDelData )
// =======================================================================
-BOOL Config::ImplUpdateConfig() const
+sal_Bool Config::ImplUpdateConfig() const
{
// Wenn sich TimeStamp unterscheidet, dann Datei neu einlesen
if ( mpData->mnTimeStamp != ImplSysGetConfigTimeStamp( maFileName ) )
@@ -719,10 +719,10 @@ BOOL Config::ImplUpdateConfig() const
ImplDeleteConfigData( mpData );
ImplReadConfig( mpData );
mpData->mnDataUpdateId++;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -776,7 +776,7 @@ Config::Config()
mpActGroup = NULL;
mnDataUpdateId = 0;
mnLockCount = 1;
- mbPersistence = TRUE;
+ mbPersistence = sal_True;
#ifdef DBG_UTIL
OSL_TRACE( "Config::Config()" );
@@ -793,7 +793,7 @@ Config::Config( const XubString& rFileName )
mpActGroup = NULL;
mnDataUpdateId = 0;
mnLockCount = 1;
- mbPersistence = TRUE;
+ mbPersistence = sal_True;
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::Config( " );
@@ -856,7 +856,7 @@ void Config::DeleteGroup( const ByteString& rGroup )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
ImplGroupData* pPrevGroup = NULL;
@@ -894,7 +894,7 @@ void Config::DeleteGroup( const ByteString& rGroup )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
// Gruppen auf ungluetig setzen
@@ -905,14 +905,14 @@ void Config::DeleteGroup( const ByteString& rGroup )
// -----------------------------------------------------------------------
-ByteString Config::GetGroupName( USHORT nGroup ) const
+ByteString Config::GetGroupName( sal_uInt16 nGroup ) const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- USHORT nGroupCount = 0;
+ sal_uInt16 nGroupCount = 0;
ByteString aGroupName;
while ( pGroup )
{
@@ -931,14 +931,14 @@ ByteString Config::GetGroupName( USHORT nGroup ) const
// -----------------------------------------------------------------------
-USHORT Config::GetGroupCount() const
+sal_uInt16 Config::GetGroupCount() const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- USHORT nGroupCount = 0;
+ sal_uInt16 nGroupCount = 0;
while ( pGroup )
{
nGroupCount++;
@@ -950,20 +950,20 @@ USHORT Config::GetGroupCount() const
// -----------------------------------------------------------------------
-BOOL Config::HasGroup( const ByteString& rGroup ) const
+sal_Bool Config::HasGroup( const ByteString& rGroup ) const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( pGroup )
{
if( pGroup->maGroupName.EqualsIgnoreCaseAscii( rGroup ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
@@ -1045,7 +1045,7 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
// Key suchen und Value setzen
@@ -1063,18 +1063,18 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
pKey = pKey->mpNext;
}
- BOOL bNewValue;
+ sal_Bool bNewValue;
if ( !pKey )
{
pKey = new ImplKeyData;
pKey->mpNext = NULL;
pKey->maKey = rKey;
- pKey->mbIsComment = FALSE;
+ pKey->mbIsComment = sal_False;
if ( pPrevKey )
pPrevKey->mpNext = pKey;
else
pGroup->mpFirstKey = pKey;
- bNewValue = TRUE;
+ bNewValue = sal_True;
}
else
bNewValue = pKey->maValue != rStr;
@@ -1087,7 +1087,7 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
}
}
@@ -1110,7 +1110,7 @@ void Config::DeleteKey( const ByteString& rKey )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
// Key suchen und Value setzen
@@ -1142,7 +1142,7 @@ void Config::DeleteKey( const ByteString& rKey )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
}
}
@@ -1150,7 +1150,7 @@ void Config::DeleteKey( const ByteString& rKey )
// -----------------------------------------------------------------------
-USHORT Config::GetKeyCount() const
+sal_uInt16 Config::GetKeyCount() const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::GetKeyCount()" );
@@ -1166,7 +1166,7 @@ USHORT Config::GetKeyCount() const
ImplUpdateConfig();
// Key suchen und Value zurueckgeben
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
ImplGroupData* pGroup = ImplGetGroup();
if ( pGroup )
{
@@ -1185,7 +1185,7 @@ USHORT Config::GetKeyCount() const
// -----------------------------------------------------------------------
-ByteString Config::GetKeyName( USHORT nKey ) const
+ByteString Config::GetKeyName( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::GetKeyName( " );
@@ -1220,7 +1220,7 @@ ByteString Config::GetKeyName( USHORT nKey ) const
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( USHORT nKey ) const
+ByteString Config::ReadKey( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::ReadKey( " );
@@ -1277,7 +1277,7 @@ void Config::LeaveLock()
// -----------------------------------------------------------------------
-BOOL Config::Update()
+sal_Bool Config::Update()
{
return ImplUpdateConfig();
}
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index 7dbdbaf3f419..104662b4ff7b 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -49,7 +49,7 @@
// Die Funktion GetGGT berechnet den groessten gemeinsamen Teiler der
// beiden als Parameter uebergebenen Werte nVal1 und nVal2 nach dem
// Algorithmus von Euklid. Hat einer der beiden Parameter den Wert 0 oder
-// 1, so wird als Ergebnis der Wert 1 zurckgegeben. Da der Algorithmus
+// 1, so wird als Ergebnis der Wert 1 zur�ckgegeben. Da der Algorithmus
// nur mit positiven Zahlen arbeitet, werden die beiden Parameter
// entsprechend umgewandelt.
// Zum Algorithmus: die beiden Parameter werden solange ducheinander
@@ -594,7 +594,7 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits )
bool operator == ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
return rVal1.nNumerator == rVal2.nNumerator
&& rVal1.nDenominator == rVal2.nDenominator;
@@ -616,7 +616,7 @@ bool operator == ( const Fraction& rVal1, const Fraction& rVal2 )
bool operator < ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
BigInt nN( rVal1.nNumerator );
nN *= BigInt( rVal2.nDenominator );
@@ -642,7 +642,7 @@ bool operator < ( const Fraction& rVal1, const Fraction& rVal2 )
bool operator > ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
BigInt nN( rVal1.nNumerator );
nN *= BigInt( rVal2.nDenominator );
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 591873558ca5..8d72b1ab4cff 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -45,7 +45,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
int i;
int i1;
int i2;
- UINT32 nNum;
+ sal_uInt32 nNum;
rIStream >> cId;
i1 = (cId & 0x70) >> 4;
@@ -62,7 +62,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
}
if ( cId & 0x80 )
nNum ^= 0xFFFFFFFF;
- rPair.nA = (INT32)nNum;
+ rPair.nA = (sal_Int32)nNum;
nNum = 0;
i = i1+i2;
@@ -74,7 +74,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
}
if ( cId & 0x08 )
nNum ^= 0xFFFFFFFF;
- rPair.nB = (INT32)nNum;
+ rPair.nB = (sal_Int32)nNum;
}
else
{
@@ -94,11 +94,11 @@ SvStream& operator<<( SvStream& rOStream, const Pair& rPair )
{
unsigned char cAry[9];
int i = 1;
- UINT32 nNum;
+ sal_uInt32 nNum;
cAry[0] = 0;
- nNum = (UINT32)(INT32)rPair.nA;
+ nNum = (sal_uInt32)(sal_Int32)rPair.nA;
if ( rPair.nA < 0 )
{
cAry[0] |= 0x80;
@@ -139,7 +139,7 @@ SvStream& operator<<( SvStream& rOStream, const Pair& rPair )
cAry[0] |= 0x10;
}
- nNum = (UINT32)(INT32)rPair.nB;
+ nNum = (sal_uInt32)(sal_Int32)rPair.nB;
if ( rPair.nB < 0 )
{
cAry[0] |= 0x08;
@@ -304,31 +304,31 @@ void Rectangle::Justify()
|*
*************************************************************************/
-BOOL Rectangle::IsInside( const Point& rPoint ) const
+sal_Bool Rectangle::IsInside( const Point& rPoint ) const
{
if ( IsEmpty() )
- return FALSE;
+ return sal_False;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nLeft <= nRight )
{
if ( (rPoint.X() < nLeft) || (rPoint.X() > nRight) )
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
if ( (rPoint.X() > nLeft) || (rPoint.X() < nRight) )
- bRet = FALSE;
+ bRet = sal_False;
}
if ( nTop <= nBottom )
{
if ( (rPoint.Y() < nTop) || (rPoint.Y() > nBottom) )
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
if ( (rPoint.Y() > nTop) || (rPoint.Y() < nBottom) )
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
@@ -339,12 +339,12 @@ BOOL Rectangle::IsInside( const Point& rPoint ) const
|*
*************************************************************************/
-BOOL Rectangle::IsInside( const Rectangle& rRect ) const
+sal_Bool Rectangle::IsInside( const Rectangle& rRect ) const
{
if ( IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -353,7 +353,7 @@ BOOL Rectangle::IsInside( const Rectangle& rRect ) const
|*
*************************************************************************/
-BOOL Rectangle::IsOver( const Rectangle& rRect ) const
+sal_Bool Rectangle::IsOver( const Rectangle& rRect ) const
{
// Wenn sie sich nicht schneiden, ueberlappen sie auch nicht
return !GetIntersection( rRect ).IsEmpty();
@@ -375,7 +375,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
int i2;
int i3;
int i4;
- UINT32 nNum;
+ sal_uInt32 nNum;
rIStream.Read( cIdAry, 2 );
i1 = (cIdAry[0] & 0x70) >> 4;
@@ -396,7 +396,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast = i1;
if ( cIdAry[0] & 0x80 )
nNum ^= 0xFFFFFFFF;
- rRect.nLeft = (INT32)nNum;
+ rRect.nLeft = (sal_Int32)nNum;
nNum = 0;
i = iLast+i2;
@@ -409,7 +409,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast += i2;
if ( cIdAry[0] & 0x08 )
nNum ^= 0xFFFFFFFF;
- rRect.nTop = (INT32)nNum;
+ rRect.nTop = (sal_Int32)nNum;
nNum = 0;
i = iLast+i3;
@@ -422,7 +422,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast += i3;
if ( cIdAry[1] & 0x80 )
nNum ^= 0xFFFFFFFF;
- rRect.nRight = (INT32)nNum;
+ rRect.nRight = (sal_Int32)nNum;
nNum = 0;
i = iLast+i4;
@@ -434,7 +434,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
}
if ( cIdAry[1] & 0x08 )
nNum ^= 0xFFFFFFFF;
- rRect.nBottom = (INT32)nNum;
+ rRect.nBottom = (sal_Int32)nNum;
}
else
{
@@ -454,12 +454,12 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
{
unsigned char cAry[18];
int i = 2;
- UINT32 nNum;
+ sal_uInt32 nNum;
cAry[0] = 0;
cAry[1] = 0;
- nNum = (UINT32)(INT32)rRect.nLeft;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nLeft;
if ( rRect.nLeft < 0 )
{
cAry[0] |= 0x80;
@@ -500,7 +500,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[0] |= 0x10;
}
- nNum = (UINT32)(INT32)rRect.nTop;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nTop;
if ( rRect.nTop < 0 )
{
cAry[0] |= 0x08;
@@ -541,7 +541,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[0] |= 0x01;
}
- nNum = (UINT32)(INT32)rRect.nRight;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nRight;
if ( rRect.nRight < 0 )
{
cAry[1] |= 0x80;
@@ -582,7 +582,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[1] |= 0x10;
}
- nNum = (UINT32)(INT32)rRect.nBottom;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nBottom;
if ( rRect.nBottom < 0 )
{
cAry[1] |= 0x08;
diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx
index 54422858a995..c8558b7bf949 100644
--- a/tools/source/generic/line.cxx
+++ b/tools/source/generic/line.cxx
@@ -48,50 +48,50 @@ double Line::GetLength() const
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Line& rLine, Point& rIntersection ) const
+sal_Bool Line::Intersection( const Line& rLine, Point& rIntersection ) const
{
double fX, fY;
- BOOL bRet;
+ sal_Bool bRet;
if( Intersection( rLine, fX, fY ) )
{
rIntersection.X() = FRound( fX );
rIntersection.Y() = FRound( fY );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const
+sal_Bool Line::Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const
{
const double fAx = maEnd.X() - maStart.X();
const double fAy = maEnd.Y() - maStart.Y();
const double fBx = rLine.maStart.X() - rLine.maEnd.X();
const double fBy = rLine.maStart.Y() - rLine.maEnd.Y();
const double fDen = fAy * fBx - fAx * fBy;
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
if( fDen != 0. )
{
const double fCx = maStart.X() - rLine.maStart.X();
const double fCy = maStart.Y() - rLine.maStart.Y();
const double fA = fBy * fCx - fBx * fCy;
- const BOOL bGreater = ( fDen > 0. );
+ const sal_Bool bGreater = ( fDen > 0. );
- bOk = TRUE;
+ bOk = sal_True;
if ( bGreater )
{
if ( ( fA < 0. ) || ( fA > fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
}
else if ( ( fA > 0. ) || ( fA < fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{
@@ -100,10 +100,10 @@ BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rInt
if ( bGreater )
{
if ( ( fB < 0. ) || ( fB > fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
}
else if ( ( fB > 0. ) || ( fB < fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
if( bOk )
{
@@ -120,11 +120,11 @@ BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rInt
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
+sal_Bool Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
{
- const BOOL bStartInside = rRect.IsInside( maStart );
- const BOOL bEndInside = rRect.IsInside( maEnd );
- BOOL bRet = TRUE;
+ const sal_Bool bStartInside = rRect.IsInside( maStart );
+ const sal_Bool bEndInside = rRect.IsInside( maEnd );
+ sal_Bool bRet = sal_True;
if( bStartInside && bEndInside )
{
@@ -171,7 +171,7 @@ BOOL Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
rIntersection.maEnd = rIntersection.maStart;
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
diff --git a/tools/source/generic/link.cxx b/tools/source/generic/link.cxx
index 60231889556e..8b5615e964bd 100644
--- a/tools/source/generic/link.cxx
+++ b/tools/source/generic/link.cxx
@@ -36,22 +36,22 @@
|*
*************************************************************************/
-BOOL Link::operator==( const Link& rLink ) const
+sal_Bool Link::operator==( const Link& rLink ) const
{
if ( pFunc == rLink.pFunc )
{
if ( pFunc )
{
if ( pInst == rLink.pInst )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
else
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/generic/makefile.mk b/tools/source/generic/makefile.mk
deleted file mode 100644
index 07bab82f32b0..000000000000
--- a/tools/source/generic/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=gen
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES = $(SLO)$/poly.obj $(OBJ)$/poly.obj $(SLO)$/svlibrary.obj
-
-SLOFILES= $(SLO)$/toolsin.obj \
- $(SLO)$/svlibrary.obj \
- $(SLO)$/b3dtrans.obj \
- $(SLO)$/link.obj \
- $(SLO)$/bigint.obj \
- $(SLO)$/fract.obj \
- $(SLO)$/color.obj \
- $(SLO)$/gen.obj \
- $(SLO)$/config.obj \
- $(SLO)$/poly.obj \
- $(SLO)$/poly2.obj \
- $(SLO)$/svborder.obj \
- $(SLO)$/line.obj
-
-OBJFILES= $(OBJ)$/toolsin.obj \
- $(OBJ)$/b3dtrans.obj \
- $(OBJ)$/link.obj \
- $(OBJ)$/bigint.obj \
- $(OBJ)$/fract.obj \
- $(OBJ)$/color.obj \
- $(OBJ)$/gen.obj \
- $(OBJ)$/config.obj \
- $(OBJ)$/poly.obj \
- $(OBJ)$/poly2.obj \
- $(OBJ)$/svborder.obj \
- $(OBJ)$/line.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index ccf35d259bc5..ea1fbb3b8e14 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -77,19 +77,19 @@ static ImplPolygonData aStaticImplPolygon =
// =======================================================================
-ImplPolygon::ImplPolygon( USHORT nInitSize, BOOL bFlags )
+ImplPolygon::ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags )
{
if ( nInitSize )
{
- mpPointAry = (Point*)new char[(ULONG)nInitSize*sizeof(Point)];
- memset( mpPointAry, 0, (ULONG)nInitSize*sizeof(Point) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)nInitSize*sizeof(Point)];
+ memset( mpPointAry, 0, (sal_uIntPtr)nInitSize*sizeof(Point) );
}
else
mpPointAry = NULL;
if( bFlags )
{
- mpFlagAry = new BYTE[ nInitSize ];
+ mpFlagAry = new sal_uInt8[ nInitSize ];
memset( mpPointAry, 0, nInitSize );
}
else
@@ -105,12 +105,12 @@ ImplPolygon::ImplPolygon( const ImplPolygon& rImpPoly )
{
if ( rImpPoly.mnPoints )
{
- mpPointAry = (Point*)new char[(ULONG)rImpPoly.mnPoints*sizeof(Point)];
- memcpy( mpPointAry, rImpPoly.mpPointAry, (ULONG)rImpPoly.mnPoints*sizeof(Point) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)rImpPoly.mnPoints*sizeof(Point)];
+ memcpy( mpPointAry, rImpPoly.mpPointAry, (sal_uIntPtr)rImpPoly.mnPoints*sizeof(Point) );
if( rImpPoly.mpFlagAry )
{
- mpFlagAry = new BYTE[ rImpPoly.mnPoints ];
+ mpFlagAry = new sal_uInt8[ rImpPoly.mnPoints ];
memcpy( mpFlagAry, rImpPoly.mpFlagAry, rImpPoly.mnPoints );
}
else
@@ -128,16 +128,16 @@ ImplPolygon::ImplPolygon( const ImplPolygon& rImpPoly )
// -----------------------------------------------------------------------
-ImplPolygon::ImplPolygon( USHORT nInitSize, const Point* pInitAry, const BYTE* pInitFlags )
+ImplPolygon::ImplPolygon( sal_uInt16 nInitSize, const Point* pInitAry, const sal_uInt8* pInitFlags )
{
if ( nInitSize )
{
- mpPointAry = (Point*)new char[(ULONG)nInitSize*sizeof(Point)];
- memcpy( mpPointAry, pInitAry, (ULONG)nInitSize*sizeof( Point ) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)nInitSize*sizeof(Point)];
+ memcpy( mpPointAry, pInitAry, (sal_uIntPtr)nInitSize*sizeof( Point ) );
if( pInitFlags )
{
- mpFlagAry = new BYTE[ nInitSize ];
+ mpFlagAry = new sal_uInt8[ nInitSize ];
memcpy( mpFlagAry, pInitFlags, nInitSize );
}
else
@@ -168,7 +168,7 @@ ImplPolygon::~ImplPolygon()
// -----------------------------------------------------------------------
-void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
+void ImplPolygon::ImplSetSize( sal_uInt16 nNewSize, sal_Bool bResize )
{
if( mnPoints == nNewSize )
return;
@@ -177,7 +177,7 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
if ( nNewSize )
{
- pNewAry = (Point*)new char[(ULONG)nNewSize*sizeof(Point)];
+ pNewAry = (Point*)new char[(sal_uIntPtr)nNewSize*sizeof(Point)];
if ( bResize )
{
@@ -185,14 +185,14 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
if ( mnPoints < nNewSize )
{
// Neue Punkte mit 0 initialisieren
- memset( pNewAry+mnPoints, 0, (ULONG)(nNewSize-mnPoints)*sizeof(Point) );
+ memset( pNewAry+mnPoints, 0, (sal_uIntPtr)(nNewSize-mnPoints)*sizeof(Point) );
if ( mpPointAry )
memcpy( pNewAry, mpPointAry, mnPoints*sizeof(Point) );
}
else
{
if ( mpPointAry )
- memcpy( pNewAry, mpPointAry, (ULONG)nNewSize*sizeof(Point) );
+ memcpy( pNewAry, mpPointAry, (sal_uIntPtr)nNewSize*sizeof(Point) );
}
}
}
@@ -205,11 +205,11 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry;
+ sal_uInt8* pNewFlagAry;
if( nNewSize )
{
- pNewFlagAry = new BYTE[ nNewSize ];
+ pNewFlagAry = new sal_uInt8[ nNewSize ];
if( bResize )
{
@@ -237,21 +237,21 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
// -----------------------------------------------------------------------
-void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly )
+void ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly )
{
- const ULONG nSpaceSize = nSpace * sizeof( Point );
+ const sal_uIntPtr nSpaceSize = nSpace * sizeof( Point );
//Can't fit this in :-(, throw ?
if (mnPoints + nSpace > USHRT_MAX)
return;
- const USHORT nNewSize = mnPoints + nSpace;
+ const sal_uInt16 nNewSize = mnPoints + nSpace;
if( nPos >= mnPoints )
{
// Hinten anhaengen
nPos = mnPoints;
- ImplSetSize( nNewSize, TRUE );
+ ImplSetSize( nNewSize, sal_True );
if( pInitPoly )
{
@@ -264,10 +264,10 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
else
{
// PointArray ist in diesem Zweig immer vorhanden
- const USHORT nSecPos = nPos + nSpace;
- const USHORT nRest = mnPoints - nPos;
+ const sal_uInt16 nSecPos = nPos + nSpace;
+ const sal_uInt16 nRest = mnPoints - nPos;
- Point* pNewAry = (Point*) new char[ (ULONG) nNewSize * sizeof( Point ) ];
+ Point* pNewAry = (Point*) new char[ (sal_uIntPtr) nNewSize * sizeof( Point ) ];
memcpy( pNewAry, mpPointAry, nPos * sizeof( Point ) );
@@ -282,7 +282,7 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry = new BYTE[ nNewSize ];
+ sal_uInt8* pNewFlagAry = new sal_uInt8[ nNewSize ];
memcpy( pNewFlagAry, mpFlagAry, nPos );
@@ -303,17 +303,17 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
// -----------------------------------------------------------------------
-void ImplPolygon::ImplRemove( USHORT nPos, USHORT nCount )
+void ImplPolygon::ImplRemove( sal_uInt16 nPos, sal_uInt16 nCount )
{
- const USHORT nRemoveCount = Min( (USHORT) ( mnPoints - nPos ), (USHORT) nCount );
+ const sal_uInt16 nRemoveCount = Min( (sal_uInt16) ( mnPoints - nPos ), (sal_uInt16) nCount );
if( nRemoveCount )
{
- const USHORT nNewSize = mnPoints - nRemoveCount;
- const USHORT nSecPos = nPos + nRemoveCount;
- const USHORT nRest = mnPoints - nSecPos;
+ const sal_uInt16 nNewSize = mnPoints - nRemoveCount;
+ const sal_uInt16 nSecPos = nPos + nRemoveCount;
+ const sal_uInt16 nRest = mnPoints - nSecPos;
- Point* pNewAry = (Point*) new char[ (ULONG) nNewSize * sizeof( Point ) ];
+ Point* pNewAry = (Point*) new char[ (sal_uIntPtr) nNewSize * sizeof( Point ) ];
memcpy( pNewAry, mpPointAry, nPos * sizeof( Point ) );
memcpy( pNewAry + nPos, mpPointAry + nSecPos, nRest * sizeof( Point ) );
@@ -323,7 +323,7 @@ void ImplPolygon::ImplRemove( USHORT nPos, USHORT nCount )
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry = new BYTE[ nNewSize ];
+ sal_uInt8* pNewFlagAry = new sal_uInt8[ nNewSize ];
memcpy( pNewFlagAry, mpFlagAry, nPos );
memcpy( pNewFlagAry + nPos, mpFlagAry + nSecPos, nRest );
@@ -342,7 +342,7 @@ void ImplPolygon::ImplCreateFlagArray()
{
if( !mpFlagAry )
{
- mpFlagAry = new BYTE[ mnPoints ];
+ mpFlagAry = new sal_uInt8[ mnPoints ];
memset( mpFlagAry, 0, mnPoints );
}
}
@@ -378,7 +378,7 @@ Polygon::Polygon()
// -----------------------------------------------------------------------
-Polygon::Polygon( USHORT nSize )
+Polygon::Polygon( sal_uInt16 nSize )
{
DBG_CTOR( Polygon, NULL );
@@ -390,7 +390,7 @@ Polygon::Polygon( USHORT nSize )
// -----------------------------------------------------------------------
-Polygon::Polygon( USHORT nPoints, const Point* pPtAry, const BYTE* pFlagAry )
+Polygon::Polygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pFlagAry )
{
DBG_CTOR( Polygon, NULL );
@@ -434,7 +434,7 @@ Polygon::Polygon( const Rectangle& rRect )
// -----------------------------------------------------------------------
-Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
+Polygon::Polygon( const Rectangle& rRect, sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound )
{
DBG_CTOR( Polygon, NULL );
@@ -445,8 +445,8 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
Rectangle aRect( rRect );
aRect.Justify(); // SJ: i9140
- nHorzRound = Min( nHorzRound, (ULONG) labs( aRect.GetWidth() >> 1 ) );
- nVertRound = Min( nVertRound, (ULONG) labs( aRect.GetHeight() >> 1 ) );
+ nHorzRound = Min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) );
+ nVertRound = Min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) );
if( !nHorzRound && !nVertRound )
{
@@ -464,7 +464,7 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
const Point aBR( aRect.Right() - nHorzRound, aRect.Bottom() - nVertRound );
const Point aBL( aRect.Left() + nHorzRound, aRect.Bottom() - nVertRound );
Polygon* pEllipsePoly = new Polygon( Point(), nHorzRound, nVertRound );
- USHORT i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2;
+ sal_uInt16 i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2;
mpImplPolygon = new ImplPolygon( pEllipsePoly->GetSize() + 1 );
@@ -491,7 +491,7 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
// -----------------------------------------------------------------------
-Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
+Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoints )
{
DBG_CTOR( Polygon, NULL );
@@ -500,10 +500,10 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
// Default berechnen (abhaengig von Groesse)
if( !nPoints )
{
- nPoints = (USHORT) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
+ nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
sqrt( (double) labs( nRadX * nRadY ) ) ) );
- nPoints = (USHORT) MinMax( nPoints, 32, 256 );
+ nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 );
if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
nPoints >>= 1;
@@ -513,9 +513,9 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
mpImplPolygon = new ImplPolygon( nPoints = (nPoints + 3) & ~3 );
Point* pPt;
- USHORT i;
- USHORT nPoints2 = nPoints >> 1;
- USHORT nPoints4 = nPoints >> 2;
+ sal_uInt16 i;
+ sal_uInt16 nPoints2 = nPoints >> 1;
+ sal_uInt16 nPoints4 = nPoints >> 2;
double nAngle;
double nAngleStep = F_PI2 / ( nPoints4 - 1 );
@@ -557,12 +557,12 @@ Polygon::Polygon( const Rectangle& rBound,
const Point aCenter( rBound.Center() );
const long nRadX = aCenter.X() - rBound.Left();
const long nRadY = aCenter.Y() - rBound.Top();
- USHORT nPoints;
+ sal_uInt16 nPoints;
- nPoints = (USHORT) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
+ nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
sqrt( (double) labs( nRadX * nRadY ) ) ) );
- nPoints = (USHORT) MinMax( nPoints, 32, 256 );
+ nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 );
if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
nPoints >>= 1;
@@ -576,8 +576,8 @@ Polygon::Polygon( const Rectangle& rBound,
double fEnd = ImplGetAngle( aCenter, rEnd );
double fDiff = fEnd - fStart;
double fStep;
- USHORT nStart;
- USHORT nEnd;
+ sal_uInt16 nStart;
+ sal_uInt16 nEnd;
if( fDiff < 0. )
fDiff += F_2PI;
@@ -585,7 +585,7 @@ Polygon::Polygon( const Rectangle& rBound,
// Punktanzahl proportional verkleinern ( fDiff / (2PI) );
// ist eingentlich nur fuer einen Kreis richtig; wir
// machen es hier aber trotzdem
- nPoints = Max( (USHORT) ( ( fDiff * 0.1591549 ) * nPoints ), (USHORT) 16 );
+ nPoints = Max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 );
fStep = fDiff / ( nPoints - 1 );
if( POLY_PIE == eStyle )
@@ -624,7 +624,7 @@ Polygon::Polygon( const Rectangle& rBound,
Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
const Point& rBezPt2, const Point& rCtrlPt2,
- USHORT nPoints )
+ sal_uInt16 nPoints )
{
DBG_CTOR( Polygon, NULL );
@@ -644,7 +644,7 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
mpImplPolygon = new ImplPolygon( nPoints );
- for( USHORT i = 0; i < nPoints; i++, fK_1 += fInc, fK1_1 -= fInc )
+ for( sal_uInt16 i = 0; i < nPoints; i++, fK_1 += fInc, fK1_1 -= fInc )
{
Point& rPt = mpImplPolygon->mpPointAry[ i ];
@@ -686,7 +686,7 @@ Point* Polygon::ImplGetPointAry()
// -----------------------------------------------------------------------
-BYTE* Polygon::ImplGetFlagAry()
+sal_uInt8* Polygon::ImplGetFlagAry()
{
DBG_CHKTHIS( Polygon, NULL );
@@ -705,7 +705,7 @@ const Point* Polygon::GetConstPointAry() const
// -----------------------------------------------------------------------
-const BYTE* Polygon::GetConstFlagAry() const
+const sal_uInt8* Polygon::GetConstFlagAry() const
{
DBG_CHKTHIS( Polygon, NULL );
return mpImplPolygon->mpFlagAry;
@@ -713,7 +713,7 @@ const BYTE* Polygon::GetConstFlagAry() const
// -----------------------------------------------------------------------
-void Polygon::SetPoint( const Point& rPt, USHORT nPos )
+void Polygon::SetPoint( const Point& rPt, sal_uInt16 nPos )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -725,7 +725,7 @@ void Polygon::SetPoint( const Point& rPt, USHORT nPos )
// -----------------------------------------------------------------------
-void Polygon::SetFlags( USHORT nPos, PolyFlags eFlags )
+void Polygon::SetFlags( sal_uInt16 nPos, PolyFlags eFlags )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -737,13 +737,13 @@ void Polygon::SetFlags( USHORT nPos, PolyFlags eFlags )
{
ImplMakeUnique();
mpImplPolygon->ImplCreateFlagArray();
- mpImplPolygon->mpFlagAry[ nPos ] = (BYTE) eFlags;
+ mpImplPolygon->mpFlagAry[ nPos ] = (sal_uInt8) eFlags;
}
}
// -----------------------------------------------------------------------
-const Point& Polygon::GetPoint( USHORT nPos ) const
+const Point& Polygon::GetPoint( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -754,7 +754,7 @@ const Point& Polygon::GetPoint( USHORT nPos ) const
// -----------------------------------------------------------------------
-PolyFlags Polygon::GetFlags( USHORT nPos ) const
+PolyFlags Polygon::GetFlags( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -773,7 +773,7 @@ sal_Bool Polygon::HasFlags() const
// -----------------------------------------------------------------------
-BOOL Polygon::IsControl(USHORT nPos) const
+sal_Bool Polygon::IsControl(sal_uInt16 nPos) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -786,7 +786,7 @@ BOOL Polygon::IsControl(USHORT nPos) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsSmooth(USHORT nPos) const
+sal_Bool Polygon::IsSmooth(sal_uInt16 nPos) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -799,9 +799,9 @@ BOOL Polygon::IsSmooth(USHORT nPos) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsRect() const
+sal_Bool Polygon::IsRect() const
{
- BOOL bIsRect = FALSE;
+ sal_Bool bIsRect = sal_False;
if ( mpImplPolygon->mpFlagAry == NULL )
{
if ( ( ( mpImplPolygon->mnPoints == 5 ) && ( mpImplPolygon->mpPointAry[ 0 ] == mpImplPolygon->mpPointAry[ 4 ] ) ) ||
@@ -811,7 +811,7 @@ BOOL Polygon::IsRect() const
( mpImplPolygon->mpPointAry[ 0 ].Y() == mpImplPolygon->mpPointAry[ 1 ].Y() ) &&
( mpImplPolygon->mpPointAry[ 1 ].X() == mpImplPolygon->mpPointAry[ 2 ].X() ) &&
( mpImplPolygon->mpPointAry[ 2 ].Y() == mpImplPolygon->mpPointAry[ 3 ].Y() ) )
- bIsRect = TRUE;
+ bIsRect = sal_True;
}
}
return bIsRect;
@@ -819,7 +819,7 @@ BOOL Polygon::IsRect() const
// -----------------------------------------------------------------------
-void Polygon::SetSize( USHORT nNewSize )
+void Polygon::SetSize( sal_uInt16 nNewSize )
{
DBG_CHKTHIS( Polygon, NULL );
@@ -832,7 +832,7 @@ void Polygon::SetSize( USHORT nNewSize )
// -----------------------------------------------------------------------
-USHORT Polygon::GetSize() const
+sal_uInt16 Polygon::GetSize() const
{
DBG_CHKTHIS( Polygon, NULL );
@@ -858,7 +858,7 @@ void Polygon::Clear()
// -----------------------------------------------------------------------
-double Polygon::CalcDistance( USHORT nP1, USHORT nP2 )
+double Polygon::CalcDistance( sal_uInt16 nP1, sal_uInt16 nP2 )
{
DBG_ASSERT( nP1 < mpImplPolygon->mnPoints,
"Polygon::CalcDistance(): nPos1 >= nPoints" );
@@ -875,12 +875,12 @@ double Polygon::CalcDistance( USHORT nP1, USHORT nP2 )
// -----------------------------------------------------------------------
-void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
+void Polygon::Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( !mpImplPolygon->mpFlagAry, "Optimizing could fail with beziers!" );
- USHORT nSize = mpImplPolygon->mnPoints;
+ sal_uInt16 nSize = mpImplPolygon->mnPoints;
if( nOptimizeFlags && nSize )
{
@@ -888,7 +888,7 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
{
const Rectangle aBound( GetBoundRect() );
const double fArea = ( aBound.GetWidth() + aBound.GetHeight() ) * 0.5;
- const USHORT nPercent = pData ? pData->GetPercentValue() : 50;
+ const sal_uInt16 nPercent = pData ? pData->GetPercentValue() : 50;
Optimize( POLY_OPTIMIZE_NO_SAME );
ImplReduceEdges( *this, fArea, nPercent );
@@ -897,7 +897,7 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
{
Polygon aNewPoly;
const Point& rFirst = mpImplPolygon->mpPointAry[ 0 ];
- ULONG nReduce;
+ sal_uIntPtr nReduce;
if( nOptimizeFlags & ( POLY_OPTIMIZE_REDUCE ) )
nReduce = pData ? pData->GetAbsValue() : 4UL;
@@ -909,15 +909,15 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
if( nSize > 1 )
{
- USHORT nLast = 0, nNewCount = 1;
+ sal_uInt16 nLast = 0, nNewCount = 1;
aNewPoly.SetSize( nSize );
aNewPoly[ 0 ] = rFirst;
- for( USHORT i = 1; i < nSize; i++ )
+ for( sal_uInt16 i = 1; i < nSize; i++ )
{
if( ( mpImplPolygon->mpPointAry[ i ] != mpImplPolygon->mpPointAry[ nLast ] ) &&
- ( !nReduce || ( nReduce < (ULONG) FRound( CalcDistance( nLast, i ) ) ) ) )
+ ( !nReduce || ( nReduce < (sal_uIntPtr) FRound( CalcDistance( nLast, i ) ) ) ) )
{
aNewPoly[ nNewCount++ ] = mpImplPolygon->mpPointAry[ nLast = i ];
}
@@ -1048,8 +1048,8 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
}
else
{
- USHORT i;
- USHORT nPts( GetSize() );
+ sal_uInt16 i;
+ sal_uInt16 nPts( GetSize() );
::std::vector< Point > aPoints;
aPoints.reserve( nPts );
::std::back_insert_iterator< ::std::vector< Point > > aPointIter( aPoints );
@@ -1058,8 +1058,8 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
{
if( ( i + 3 ) < nPts )
{
- BYTE P1( mpImplPolygon->mpFlagAry[ i ] );
- BYTE P4( mpImplPolygon->mpFlagAry[ i + 3 ] );
+ sal_uInt8 P1( mpImplPolygon->mpFlagAry[ i ] );
+ sal_uInt8 P4( mpImplPolygon->mpFlagAry[ i + 3 ] );
if( ( POLY_NORMAL == P1 || POLY_SMOOTH == P1 || POLY_SYMMTR == P1 ) &&
( POLY_CONTROL == mpImplPolygon->mpFlagAry[ i + 1 ] ) &&
@@ -1080,7 +1080,7 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
}
// fill result polygon
- rResult = Polygon( (USHORT)aPoints.size() ); // ensure sufficient size for copy
+ rResult = Polygon( (sal_uInt16)aPoints.size() ); // ensure sufficient size for copy
::std::copy(aPoints.begin(), aPoints.end(), rResult.mpImplPolygon->mpPointAry);
}
}
@@ -1119,27 +1119,27 @@ void Polygon::GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const
// -----------------------------------------------------------------------
-void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPercent )
+void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, sal_uInt16 nPercent )
{
const double fBound = 2000.0 * ( 100 - nPercent ) * 0.01;
- USHORT nNumNoChange = 0, nNumRuns = 0;
+ sal_uInt16 nNumNoChange = 0, nNumRuns = 0;
while( nNumNoChange < 2 )
{
- USHORT nPntCnt = rPoly.GetSize(), nNewPos = 0;
+ sal_uInt16 nPntCnt = rPoly.GetSize(), nNewPos = 0;
Polygon aNewPoly( nPntCnt );
- BOOL bChangeInThisRun = FALSE;
+ sal_Bool bChangeInThisRun = sal_False;
- for( USHORT n = 0; n < nPntCnt; n++ )
+ for( sal_uInt16 n = 0; n < nPntCnt; n++ )
{
- BOOL bDeletePoint = FALSE;
+ sal_Bool bDeletePoint = sal_False;
if( ( n + nNumRuns ) % 2 )
{
- USHORT nIndPrev = !n ? nPntCnt - 1 : n - 1;
- USHORT nIndPrevPrev = !nIndPrev ? nPntCnt - 1 : nIndPrev - 1;
- USHORT nIndNext = ( n == nPntCnt-1 ) ? 0 : n + 1;
- USHORT nIndNextNext = ( nIndNext == nPntCnt - 1 ) ? 0 : nIndNext + 1;
+ sal_uInt16 nIndPrev = !n ? nPntCnt - 1 : n - 1;
+ sal_uInt16 nIndPrevPrev = !nIndPrev ? nPntCnt - 1 : nIndPrev - 1;
+ sal_uInt16 nIndNext = ( n == nPntCnt-1 ) ? 0 : n + 1;
+ sal_uInt16 nIndNextNext = ( nIndNext == nPntCnt - 1 ) ? 0 : nIndNext + 1;
Vector2D aVec1( rPoly[ nIndPrev ] ); aVec1 -= rPoly[ nIndPrevPrev ];
Vector2D aVec2( rPoly[ n ] ); aVec2 -= rPoly[ nIndPrev ];
Vector2D aVec3( rPoly[ nIndNext ] ); aVec3 -= rPoly[ n ];
@@ -1149,7 +1149,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
double fTurnB = aVec2.Normalize().Scalar( aVec3.Normalize() );
if( fabs( fTurnB ) < ( 1.0 + SMALL_DVALUE ) && fabs( fTurnB ) > ( 1.0 - SMALL_DVALUE ) )
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
else
{
Vector2D aVecB( rPoly[ nIndNext ] );
@@ -1178,7 +1178,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
if( ( fLenFact < ( FSQRT2 + SMALL_DVALUE ) ) &&
( ( ( fDist1 + fDist4 ) / ( fDist2 + fDist3 ) ) * 2000.0 ) > fBound )
{
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
}
}
else
@@ -1190,10 +1190,10 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
else if( fRelLen > 1.0 )
fRelLen = 1.0;
- if( ( (UINT32) ( ( ( fLenFact - 1.0 ) * 1000000.0 ) + 0.5 ) < fBound ) &&
+ if( ( (sal_uInt32) ( ( ( fLenFact - 1.0 ) * 1000000.0 ) + 0.5 ) < fBound ) &&
( fabs( fGradB ) <= ( fRelLen * fBound * 0.01 ) ) )
{
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
}
}
}
@@ -1202,7 +1202,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
if( !bDeletePoint )
aNewPoly[ nNewPos++ ] = rPoly[ n ];
else
- bChangeInThisRun = TRUE;
+ bChangeInThisRun = sal_True;
}
if( bChangeInThisRun && nNewPos )
@@ -1231,8 +1231,8 @@ void Polygon::Move( long nHorzMove, long nVertMove )
ImplMakeUnique();
// Punkte verschieben
- USHORT nCount = mpImplPolygon->mnPoints;
- for ( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
Point* pPt = &(mpImplPolygon->mpPointAry[i]);
pPt->X() += nHorzMove;
@@ -1247,7 +1247,7 @@ void Polygon::Translate(const Point& rTrans)
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for ( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
mpImplPolygon->mpPointAry[ i ] += rTrans;
}
@@ -1258,7 +1258,7 @@ void Polygon::Scale( double fScaleX, double fScaleY )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for ( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[i];
rPnt.X() = (long) ( fScaleX * rPnt.X() );
@@ -1268,7 +1268,7 @@ void Polygon::Scale( double fScaleX, double fScaleY )
// -----------------------------------------------------------------------
-void Polygon::Rotate( const Point& rCenter, USHORT nAngle10 )
+void Polygon::Rotate( const Point& rCenter, sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( Polygon, NULL );
nAngle10 %= 3600;
@@ -1291,7 +1291,7 @@ void Polygon::Rotate( const Point& rCenter, double fSin, double fCos )
long nCenterX = rCenter.X();
long nCenterY = rCenter.Y();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPt = mpImplPolygon->mpPointAry[ i ];
@@ -1309,7 +1309,7 @@ void Polygon::SlantX( long nYRef, double fSin, double fCos )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
const long nDy = rPnt.Y() - nYRef;
@@ -1326,7 +1326,7 @@ void Polygon::SlantY( long nXRef, double fSin, double fCos )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
const long nDx = rPnt.X() - nXRef;
@@ -1365,7 +1365,7 @@ void Polygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect
X4 = rDistortedRect[2].X();
Y4 = rDistortedRect[2].Y();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
@@ -1393,9 +1393,9 @@ class ImplPolygonPointFilter : public ImplPointFilter
{
public:
ImplPolygon* mpPoly; // Nicht loeschen, wird dem Polygon zugewiesen
- USHORT mnSize;
+ sal_uInt16 mnSize;
- ImplPolygonPointFilter( USHORT nDestSize ) :
+ ImplPolygonPointFilter( sal_uInt16 nDestSize ) :
mnSize( 0 )
{
mpPoly = new ImplPolygon( nDestSize );
@@ -1431,7 +1431,7 @@ class ImplEdgePointFilter : public ImplPointFilter
const long mnHigh;
const int mnEdge;
int mnLastOutside;
- BOOL mbFirst;
+ sal_Bool mbFirst;
public:
ImplEdgePointFilter( int nEdge, long nLow, long nHigh,
@@ -1440,7 +1440,7 @@ public:
mnLow( nLow ),
mnHigh( nHigh ),
mnEdge( nEdge ),
- mbFirst( TRUE )
+ mbFirst( sal_True )
{
}
@@ -1539,7 +1539,7 @@ void ImplEdgePointFilter::Input( const Point& rPoint )
if ( mbFirst )
{
maFirstPoint = rPoint;
- mbFirst = FALSE;
+ mbFirst = sal_False;
if ( !nOutside )
mrNextFilter.Input( rPoint );
}
@@ -1577,20 +1577,20 @@ void ImplEdgePointFilter::LastPoint()
// -----------------------------------------------------------------------
-void Polygon::Clip( const Rectangle& rRect, BOOL bPolygon )
+void Polygon::Clip( const Rectangle& rRect, sal_Bool bPolygon )
{
// #105251# Justify rect befor edge filtering
Rectangle aJustifiedRect( rRect );
aJustifiedRect.Justify();
- USHORT nSourceSize = mpImplPolygon->mnPoints;
+ sal_uInt16 nSourceSize = mpImplPolygon->mnPoints;
ImplPolygonPointFilter aPolygon( nSourceSize );
ImplEdgePointFilter aHorzFilter( EDGE_HORZ, aJustifiedRect.Left(), aJustifiedRect.Right(),
aPolygon );
ImplEdgePointFilter aVertFilter( EDGE_VERT, aJustifiedRect.Top(), aJustifiedRect.Bottom(),
aHorzFilter );
- for ( USHORT i = 0; i < nSourceSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSourceSize; i++ )
aVertFilter.Input( mpImplPolygon->mpPointAry[i] );
if ( bPolygon || aVertFilter.IsPolygon() )
aVertFilter.LastPoint();
@@ -1625,7 +1625,7 @@ Rectangle Polygon::GetBoundRect() const
//
// DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" );
- USHORT nCount = mpImplPolygon->mnPoints;
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
if( ! nCount )
return Rectangle();
@@ -1635,7 +1635,7 @@ Rectangle Polygon::GetBoundRect() const
nXMin = nXMax = pPt->X();
nYMin = nYMax = pPt->Y();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pPt = &(mpImplPolygon->mpPointAry[i]);
@@ -1671,9 +1671,9 @@ double Polygon::GetSignedArea() const
if( mpImplPolygon->mnPoints > 2 )
{
- const USHORT nCount1 = mpImplPolygon->mnPoints - 1;
+ const sal_uInt16 nCount1 = mpImplPolygon->mnPoints - 1;
- for( USHORT i = 0; i < nCount1; )
+ for( sal_uInt16 i = 0; i < nCount1; )
{
const Point& rPt = mpImplPolygon->mpPointAry[ i ];
const Point& rPt1 = mpImplPolygon->mpPointAry[ ++i ];
@@ -1690,15 +1690,15 @@ double Polygon::GetSignedArea() const
// -----------------------------------------------------------------------
-BOOL Polygon::IsInside( const Point& rPoint ) const
+sal_Bool Polygon::IsInside( const Point& rPoint ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( !mpImplPolygon->mpFlagAry, "IsInside could fail with beziers!" );
const Rectangle aBound( GetBoundRect() );
const Line aLine( rPoint, Point( aBound.Right() + 100L, rPoint.Y() ) );
- USHORT nCount = mpImplPolygon->mnPoints;
- USHORT nPCounter = 0;
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
+ sal_uInt16 nPCounter = 0;
if ( ( nCount > 2 ) && aBound.IsInside( rPoint ) )
{
@@ -1709,7 +1709,7 @@ BOOL Polygon::IsInside( const Point& rPoint ) const
while ( ( aPt1 == mpImplPolygon->mpPointAry[ nCount - 1 ] ) && ( nCount > 3 ) )
nCount--;
- for ( USHORT i = 1; i <= nCount; i++ )
+ for ( sal_uInt16 i = 1; i <= nCount; i++ )
{
const Point& rPt2 = mpImplPolygon->mpPointAry[ ( i < nCount ) ? i : 0 ];
@@ -1742,7 +1742,7 @@ BOOL Polygon::IsInside( const Point& rPoint ) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsRightOrientated() const
+sal_Bool Polygon::IsRightOrientated() const
{
DBG_CHKTHIS( Polygon, NULL );
return GetSignedArea() >= 0.0;
@@ -1750,7 +1750,7 @@ BOOL Polygon::IsRightOrientated() const
// -----------------------------------------------------------------------
-void Polygon::Insert( USHORT nPos, const Point& rPt, PolyFlags eFlags )
+void Polygon::Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags )
{
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
@@ -1764,16 +1764,16 @@ void Polygon::Insert( USHORT nPos, const Point& rPt, PolyFlags eFlags )
if( POLY_NORMAL != eFlags )
{
mpImplPolygon->ImplCreateFlagArray();
- mpImplPolygon->mpFlagAry[ nPos ] = (BYTE) eFlags;
+ mpImplPolygon->mpFlagAry[ nPos ] = (sal_uInt8) eFlags;
}
}
// -----------------------------------------------------------------------
-void Polygon::Insert( USHORT nPos, const Polygon& rPoly )
+void Polygon::Insert( sal_uInt16 nPos, const Polygon& rPoly )
{
DBG_CHKTHIS( Polygon, NULL );
- const USHORT nInsertCount = rPoly.mpImplPolygon->mnPoints;
+ const sal_uInt16 nInsertCount = rPoly.mpImplPolygon->mnPoints;
if( nInsertCount )
{
@@ -1791,7 +1791,7 @@ void Polygon::Insert( USHORT nPos, const Polygon& rPoly )
// -----------------------------------------------------------------------
-void Polygon::Remove( USHORT nPos, USHORT nCount )
+void Polygon::Remove( sal_uInt16 nPos, sal_uInt16 nCount )
{
DBG_CHKTHIS( Polygon, NULL );
if( nCount && ( nPos < mpImplPolygon->mnPoints ) )
@@ -1803,7 +1803,7 @@ void Polygon::Remove( USHORT nPos, USHORT nCount )
// -----------------------------------------------------------------------
-Point& Polygon::operator[]( USHORT nPos )
+Point& Polygon::operator[]( sal_uInt16 nPos )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints, "Polygon::[]: nPos >= nPoints" );
@@ -1841,15 +1841,15 @@ Polygon& Polygon::operator=( const Polygon& rPoly )
// -----------------------------------------------------------------------
-BOOL Polygon::operator==( const Polygon& rPoly ) const
+sal_Bool Polygon::operator==( const Polygon& rPoly ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_CHKOBJ( &rPoly, Polygon, NULL );
if ( (rPoly.mpImplPolygon == mpImplPolygon) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1882,10 +1882,10 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
DBG_CHKOBJ( &rPoly, Polygon, NULL );
DBG_ASSERTWARNING( rIStream.GetVersion(), "Polygon::>> - Solar-Version not set on rIStream" );
- USHORT i;
- USHORT nStart;
- USHORT nCurPoints;
- USHORT nPoints;
+ sal_uInt16 i;
+ sal_uInt16 nStart;
+ sal_uInt16 nCurPoints;
+ sal_uInt16 nPoints;
unsigned char bShort;
short nShortX;
short nShortY;
@@ -1901,7 +1901,7 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
rPoly.mpImplPolygon = new ImplPolygon( nPoints );
}
else
- rPoly.mpImplPolygon->ImplSetSize( nPoints, FALSE );
+ rPoly.mpImplPolygon->ImplSetSize( nPoints, sal_False );
// Je nach CompressMode das Polygon einlesen
if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
@@ -1966,9 +1966,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
unsigned char bShort;
unsigned char bCurShort;
- USHORT nStart;
- USHORT i;
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nStart;
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rPoly.GetSize();
// Anzahl der Punkte rausschreiben
rOStream << nPoints;
@@ -1986,9 +1986,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
(rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
(rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
- bShort = TRUE;
+ bShort = sal_True;
else
- bShort = FALSE;
+ bShort = sal_False;
while ( i < nPoints )
{
// Feststellen, welcher Typ geschrieben werden soll
@@ -1996,9 +1996,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
(rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
(rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
- bCurShort = TRUE;
+ bCurShort = sal_True;
else
- bCurShort = FALSE;
+ bCurShort = sal_False;
// Wenn sich die Werte in einen anderen Bereich begeben,
// muessen wir neu rausschreiben
@@ -2011,7 +2011,7 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
i++;
}
- rOStream << bShort << (USHORT)(i-nStart);
+ rOStream << bShort << (sal_uInt16)(i-nStart);
if ( bShort )
{
@@ -2108,7 +2108,7 @@ void Polygon::Write( SvStream& rOStream ) const
// -----------------------------------------------------------------------
// #i74631# numerical correction method for B2DPolygon
-void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, BYTE nCFlag)
+void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, sal_uInt8 nCFlag)
{
const sal_uInt32 nPointCount(roPolygon.count());
OSL_ENSURE(nIndex < nPointCount, "impCorrectContinuity: index access out of range (!)");
@@ -2150,7 +2150,7 @@ basegfx::B2DPolygon Polygon::getB2DPolygon() const
{
// handling for curves. Add start point
const Point aStartPoint(mpImplPolygon->mpPointAry[0]);
- BYTE nPointFlag(mpImplPolygon->mpFlagAry[0]);
+ sal_uInt8 nPointFlag(mpImplPolygon->mpFlagAry[0]);
aRetval.append(basegfx::B2DPoint(aStartPoint.X(), aStartPoint.Y()));
Point aControlA, aControlB;
@@ -2272,7 +2272,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
const Point aStartPoint(FRound(aBezier.getStartPoint().getX()), FRound(aBezier.getStartPoint().getY()));
const sal_uInt32 nStartPointIndex(nArrayInsert);
mpImplPolygon->mpPointAry[nStartPointIndex] = aStartPoint;
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
// prepare next segment
@@ -2285,11 +2285,11 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
{
// if one is used, add always two control points due to the old schema
mpImplPolygon->mpPointAry[nArrayInsert] = Point(FRound(aBezier.getControlPointA().getX()), FRound(aBezier.getControlPointA().getY()));
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_CONTROL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_CONTROL;
nArrayInsert++;
mpImplPolygon->mpPointAry[nArrayInsert] = Point(FRound(aBezier.getControlPointB().getX()), FRound(aBezier.getControlPointB().getY()));
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_CONTROL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_CONTROL;
nArrayInsert++;
}
@@ -2300,11 +2300,11 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
if(basegfx::CONTINUITY_C1 == eCont)
{
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_SMOOTH;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SMOOTH;
}
else if(basegfx::CONTINUITY_C2 == eCont)
{
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_SYMMTR;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SYMMTR;
}
}
@@ -2316,7 +2316,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
{
// add first point again as closing point due to old definition
mpImplPolygon->mpPointAry[nArrayInsert] = mpImplPolygon->mpPointAry[0];
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
}
else
@@ -2325,7 +2325,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
const basegfx::B2DPoint aClosingPoint(rPolygon.getB2DPoint(nB2DLocalCount - 1L));
const Point aEnd(FRound(aClosingPoint.getX()), FRound(aClosingPoint.getY()));
mpImplPolygon->mpPointAry[nArrayInsert] = aEnd;
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
}
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index 9fc7be7c0dcf..fac5cf8c2d20 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -54,7 +54,7 @@ DBG_NAME( PolyPolygon )
// -----------------------------------------------------------------------
-ImplPolyPolygon::ImplPolyPolygon( USHORT nInitSize )
+ImplPolyPolygon::ImplPolyPolygon( sal_uInt16 nInitSize )
{
mnRefCount = 1;
mnCount = nInitSize;
@@ -75,7 +75,7 @@ ImplPolyPolygon::ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly )
if ( rImplPolyPoly.mpPolyAry )
{
mpPolyAry = new SVPPOLYGON[mnSize];
- for ( USHORT i = 0; i < mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mnCount; i++ )
mpPolyAry[i] = new Polygon( *rImplPolyPoly.mpPolyAry[i] );
}
else
@@ -88,7 +88,7 @@ ImplPolyPolygon::~ImplPolyPolygon()
{
if ( mpPolyAry )
{
- for ( USHORT i = 0; i < mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mnCount; i++ )
delete mpPolyAry[i];
delete[] mpPolyAry;
}
@@ -96,7 +96,7 @@ ImplPolyPolygon::~ImplPolyPolygon()
// =======================================================================
-PolyPolygon::PolyPolygon( USHORT nInitSize, USHORT nResize )
+PolyPolygon::PolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
{
DBG_CTOR( PolyPolygon, NULL );
@@ -128,7 +128,7 @@ PolyPolygon::PolyPolygon( const Polygon& rPoly )
// -----------------------------------------------------------------------
-PolyPolygon::PolyPolygon( USHORT nPoly, const USHORT* pPointCountAry,
+PolyPolygon::PolyPolygon( sal_uInt16 nPoly, const sal_uInt16* pPointCountAry,
const Point* pPtAry )
{
DBG_CTOR( PolyPolygon, NULL );
@@ -137,7 +137,7 @@ PolyPolygon::PolyPolygon( USHORT nPoly, const USHORT* pPointCountAry,
nPoly = MAX_POLYGONS;
mpImplPolyPolygon = new ImplPolyPolygon( nPoly );
- for ( USHORT i = 0; i < nPoly; i++ )
+ for ( sal_uInt16 i = 0; i < nPoly; i++ )
{
mpImplPolyPolygon->mpPolyAry[i] = new Polygon( *pPointCountAry, pPtAry );
pPtAry += *pPointCountAry;
@@ -171,7 +171,7 @@ PolyPolygon::~PolyPolygon()
// -----------------------------------------------------------------------
-void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
+void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
@@ -191,8 +191,8 @@ void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
mpImplPolyPolygon->mpPolyAry = new SVPPOLYGON[mpImplPolyPolygon->mnSize];
else if ( mpImplPolyPolygon->mnCount == mpImplPolyPolygon->mnSize )
{
- USHORT nOldSize = mpImplPolyPolygon->mnSize;
- USHORT nNewSize = nOldSize + mpImplPolyPolygon->mnResize;
+ sal_uInt16 nOldSize = mpImplPolyPolygon->mnSize;
+ sal_uInt16 nNewSize = nOldSize + mpImplPolyPolygon->mnResize;
SVPPOLYGON* pNewAry;
if ( nNewSize >= MAX_POLYGONS )
@@ -218,7 +218,7 @@ void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
// -----------------------------------------------------------------------
-void PolyPolygon::Remove( USHORT nPos )
+void PolyPolygon::Remove( sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::Remove(): nPos >= nSize" );
@@ -238,7 +238,7 @@ void PolyPolygon::Remove( USHORT nPos )
// -----------------------------------------------------------------------
-void PolyPolygon::Replace( const Polygon& rPoly, USHORT nPos )
+void PolyPolygon::Replace( const Polygon& rPoly, sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::Replace(): nPos >= nSize" );
@@ -255,7 +255,7 @@ void PolyPolygon::Replace( const Polygon& rPoly, USHORT nPos )
// -----------------------------------------------------------------------
-const Polygon& PolyPolygon::GetObject( USHORT nPos ) const
+const Polygon& PolyPolygon::GetObject( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::GetObject(): nPos >= nSize" );
@@ -265,9 +265,9 @@ const Polygon& PolyPolygon::GetObject( USHORT nPos ) const
// -----------------------------------------------------------------------
-BOOL PolyPolygon::IsRect() const
+sal_Bool PolyPolygon::IsRect() const
{
- BOOL bIsRect = FALSE;
+ sal_Bool bIsRect = sal_False;
if ( Count() == 1 )
bIsRect = mpImplPolyPolygon->mpPolyAry[ 0 ]->IsRect();
return bIsRect;
@@ -289,7 +289,7 @@ void PolyPolygon::Clear()
{
if ( mpImplPolyPolygon->mpPolyAry )
{
- for ( USHORT i = 0; i < mpImplPolyPolygon->mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mpImplPolyPolygon->mnCount; i++ )
delete mpImplPolyPolygon->mpPolyAry[i];
delete[] mpImplPolyPolygon->mpPolyAry;
mpImplPolyPolygon->mpPolyAry = NULL;
@@ -301,15 +301,15 @@ void PolyPolygon::Clear()
// -----------------------------------------------------------------------
-void PolyPolygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
+void PolyPolygon::Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData )
{
DBG_CHKTHIS( PolyPolygon, NULL );
if( nOptimizeFlags )
{
double fArea;
- const BOOL bEdges = ( nOptimizeFlags & POLY_OPTIMIZE_EDGES ) == POLY_OPTIMIZE_EDGES;
- USHORT nPercent = 0;
+ const sal_Bool bEdges = ( nOptimizeFlags & POLY_OPTIMIZE_EDGES ) == POLY_OPTIMIZE_EDGES;
+ sal_uInt16 nPercent = 0;
if( bEdges )
{
@@ -328,7 +328,7 @@ void PolyPolygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData
}
// Optimize polygons
- for( USHORT i = 0, nPolyCount = mpImplPolyPolygon->mnCount; i < nPolyCount; i++ )
+ for( sal_uInt16 i = 0, nPolyCount = mpImplPolyPolygon->mnCount; i < nPolyCount; i++ )
{
if( bEdges )
{
@@ -352,7 +352,7 @@ void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, const double d ) cons
Polygon aPolygon;
- for( USHORT i = 0; i < mpImplPolyPolygon->mnCount; i++ )
+ for( sal_uInt16 i = 0; i < mpImplPolyPolygon->mnCount; i++ )
{
mpImplPolyPolygon->mpPolyAry[ i ]->AdaptiveSubdivide( aPolygon, d );
rResult.Insert( aPolygon );
@@ -389,7 +389,7 @@ void PolyPolygon::GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) c
// -----------------------------------------------------------------------
-void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, ULONG nOperation ) const
+void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, sal_uIntPtr nOperation ) const
{
// Convert to B2DPolyPolygon, temporarily. It might be
// advantageous in the future, to have a PolyPolygon adaptor that
@@ -442,7 +442,7 @@ void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rR
// -----------------------------------------------------------------------
-USHORT PolyPolygon::Count() const
+sal_uInt16 PolyPolygon::Count() const
{
DBG_CHKTHIS( PolyPolygon, NULL );
return mpImplPolyPolygon->mnCount;
@@ -465,8 +465,8 @@ void PolyPolygon::Move( long nHorzMove, long nVertMove )
}
// Punkte verschieben
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
mpImplPolyPolygon->mpPolyAry[i]->Move( nHorzMove, nVertMove );
}
}
@@ -485,7 +485,7 @@ void PolyPolygon::Translate( const Point& rTrans )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Translate( rTrans );
}
@@ -503,13 +503,13 @@ void PolyPolygon::Scale( double fScaleX, double fScaleY )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Scale( fScaleX, fScaleY );
}
// -----------------------------------------------------------------------
-void PolyPolygon::Rotate( const Point& rCenter, USHORT nAngle10 )
+void PolyPolygon::Rotate( const Point& rCenter, sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( PolyPolygon, NULL );
nAngle10 %= 3600;
@@ -535,7 +535,7 @@ void PolyPolygon::Rotate( const Point& rCenter, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Rotate( rCenter, fSin, fCos );
}
@@ -553,7 +553,7 @@ void PolyPolygon::SlantX( long nYRef, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->SlantX( nYRef, fSin, fCos );
}
@@ -571,7 +571,7 @@ void PolyPolygon::SlantY( long nXRef, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->SlantY( nXRef, fSin, fCos );
}
@@ -589,7 +589,7 @@ void PolyPolygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedR
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Distort( rRefRect, rDistortedRect );
}
@@ -599,8 +599,8 @@ void PolyPolygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedR
void PolyPolygon::Clip( const Rectangle& rRect )
{
// Polygon-Clippen
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
- USHORT i;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_uInt16 i;
if ( !nPolyCount )
return;
@@ -630,16 +630,16 @@ Rectangle PolyPolygon::GetBoundRect() const
DBG_CHKTHIS( PolyPolygon, NULL );
long nXMin=0, nXMax=0, nYMin=0, nYMax=0;
- BOOL bFirst = TRUE;
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_Bool bFirst = sal_True;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
- for ( USHORT n = 0; n < nPolyCount; n++ )
+ for ( sal_uInt16 n = 0; n < nPolyCount; n++ )
{
const Polygon* pPoly = mpImplPolyPolygon->mpPolyAry[n];
const Point* pAry = pPoly->GetConstPointAry();
- USHORT nPointCount = pPoly->GetSize();
+ sal_uInt16 nPointCount = pPoly->GetSize();
- for ( USHORT i = 0; i < nPointCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPointCount; i++ )
{
const Point* pPt = &pAry[ i ];
@@ -647,7 +647,7 @@ Rectangle PolyPolygon::GetBoundRect() const
{
nXMin = nXMax = pPt->X();
nYMin = nYMax = pPt->Y();
- bFirst = FALSE;
+ bFirst = sal_False;
}
else
{
@@ -671,7 +671,7 @@ Rectangle PolyPolygon::GetBoundRect() const
// -----------------------------------------------------------------------
-Polygon& PolyPolygon::operator[]( USHORT nPos )
+Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::[](): nPos >= nSize" );
@@ -706,15 +706,15 @@ PolyPolygon& PolyPolygon::operator=( const PolyPolygon& rPolyPoly )
// -----------------------------------------------------------------------
-BOOL PolyPolygon::operator==( const PolyPolygon& rPolyPoly ) const
+sal_Bool PolyPolygon::operator==( const PolyPolygon& rPolyPoly ) const
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL );
if ( rPolyPoly.mpImplPolyPolygon == mpImplPolyPolygon )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -747,7 +747,7 @@ SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly )
DBG_ASSERTWARNING( rIStream.GetVersion(), "PolyPolygon::>> - Solar-Version not set on rIStream" );
Polygon* pPoly;
- USHORT nPolyCount;
+ sal_uInt16 nPolyCount;
// Anzahl der Polygone einlesen
rIStream >> nPolyCount;
@@ -763,7 +763,7 @@ SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly )
rPolyPoly.mpImplPolyPolygon = new ImplPolyPolygon( nPolyCount );
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
{
pPoly = new Polygon;
rIStream >> *pPoly;
@@ -784,11 +784,11 @@ SvStream& operator<<( SvStream& rOStream, const PolyPolygon& rPolyPoly )
DBG_ASSERTWARNING( rOStream.GetVersion(), "PolyPolygon::<< - Solar-Version not set on rOStream" );
// Anzahl der Polygone rausschreiben
- USHORT nPolyCount = rPolyPoly.mpImplPolyPolygon->mnCount;
+ sal_uInt16 nPolyCount = rPolyPoly.mpImplPolyPolygon->mnCount;
rOStream << nPolyCount;
// Die einzelnen Polygone ausgeben
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
rOStream << *(rPolyPoly.mpImplPolyPolygon->mpPolyAry[i]);
return rOStream;
@@ -804,7 +804,7 @@ void PolyPolygon::Read( SvStream& rIStream )
DBG_ASSERTWARNING( rIStream.GetVersion(), "PolyPolygon::>> - Solar-Version not set on rIStream" );
Polygon* pPoly;
- USHORT nPolyCount;
+ sal_uInt16 nPolyCount;
// Anzahl der Polygone einlesen
rIStream >> nPolyCount;
@@ -820,7 +820,7 @@ void PolyPolygon::Read( SvStream& rIStream )
mpImplPolyPolygon = new ImplPolyPolygon( nPolyCount );
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
{
pPoly = new Polygon;
pPoly->ImplRead( rIStream );
@@ -841,11 +841,11 @@ void PolyPolygon::Write( SvStream& rOStream ) const
DBG_ASSERTWARNING( rOStream.GetVersion(), "PolyPolygon::<< - Solar-Version not set on rOStream" );
// Anzahl der Polygone rausschreiben
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
rOStream << nPolyCount;
// Die einzelnen Polygone ausgeben
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
mpImplPolyPolygon->mpPolyAry[i]->ImplWrite( rOStream );;
}
diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx
index b9912a97d853..86df3dcffd82 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -43,7 +43,7 @@ SvBorder::SvBorder( const Rectangle & rOuter, const Rectangle & rInner )
aInner.Justify();
OSL_ENSURE( aOuter.IsInside( aInner ),
- "SvBorder::SvBorder: FALSE == aOuter.IsInside( aInner )" );
+ "SvBorder::SvBorder: sal_False == aOuter.IsInside( aInner )" );
nTop = aInner.Top() - aOuter.Top();
nRight = aOuter.Right() - aInner.Right();
nBottom = aOuter.Bottom() - aInner.Bottom();
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index cc3f587e3e90..749efd8d0964 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -79,7 +79,7 @@ INetMessage::~INetMessage (void)
void INetMessage::ListCleanup_Impl (void)
{
// Cleanup.
- ULONG i, n = m_aHeaderList.Count();
+ sal_uIntPtr i, n = m_aHeaderList.Count();
for (i = 0; i < n; i++)
delete ((HEADERFIELD*)(m_aHeaderList.GetObject(i)));
m_aHeaderList.Clear();
@@ -96,7 +96,7 @@ void INetMessage::ListCopy (const INetMessage &rMsg)
ListCleanup_Impl();
// Copy.
- ULONG i, n = rMsg.GetHeaderCount();
+ sal_uIntPtr i, n = rMsg.GetHeaderCount();
for (i = 0; i < n; i++)
{
HEADERFIELD *p = (HEADERFIELD*)(rMsg.m_aHeaderList.GetObject(i));
@@ -112,7 +112,7 @@ void INetMessage::SetHeaderField_Impl (
INetMIME::HeaderFieldType eType,
const ByteString &rName,
const UniString &rValue,
- ULONG &rnIndex)
+ sal_uIntPtr &rnIndex)
{
INetMIMEStringOutputSink aSink (0, STRING_MAXLEN);
INetMIME::writeHeaderFieldBody (
@@ -124,10 +124,10 @@ void INetMessage::SetHeaderField_Impl (
/*
* SetHeaderField.
*/
-ULONG INetMessage::SetHeaderField (
- const UniString& rName, const UniString& rValue, ULONG nIndex)
+sal_uIntPtr INetMessage::SetHeaderField (
+ const UniString& rName, const UniString& rValue, sal_uIntPtr nIndex)
{
- ULONG nResult = nIndex;
+ sal_uIntPtr nResult = nIndex;
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
ByteString (rName, RTL_TEXTENCODING_ASCII_US), rValue,
@@ -138,10 +138,10 @@ ULONG INetMessage::SetHeaderField (
/*
* SetHeaderField.
*/
-ULONG INetMessage::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nIndex)
+sal_uIntPtr INetMessage::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nIndex)
{
- ULONG nResult = nIndex;
+ sal_uIntPtr nResult = nIndex;
SetHeaderField_Impl (rHeader, nResult);
return nResult;
}
@@ -155,7 +155,7 @@ SvStream& INetMessage::operator<< (SvStream& rStrm) const
rStrm << static_cast<sal_uInt32>(m_nDocSize);
rStrm.WriteByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
- ULONG i, n = m_aHeaderList.Count();
+ sal_uIntPtr i, n = m_aHeaderList.Count();
rStrm << static_cast<sal_uInt32>(n);
for (i = 0; i < n; i++)
@@ -181,7 +181,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
m_nDocSize = nTemp;
rStrm.ReadByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
- ULONG i, n = 0;
+ sal_uIntPtr i, n = 0;
rStrm >> nTemp;
n = nTemp;
@@ -204,7 +204,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
INetMessageHeaderIterator::INetMessageHeaderIterator (
const INetMessage& rMsg, const UniString& rHdrName)
{
- ULONG i, n = rMsg.GetHeaderCount();
+ sal_uIntPtr i, n = rMsg.GetHeaderCount();
for (i = 0; i < n; i++)
{
if (rHdrName.CompareIgnoreCaseToAscii (rMsg.GetHeaderName(i)) == 0)
@@ -218,7 +218,7 @@ INetMessageHeaderIterator::INetMessageHeaderIterator (
INetMessageHeaderIterator::~INetMessageHeaderIterator (void)
{
- ULONG i, n = aValueList.Count();
+ sal_uIntPtr i, n = aValueList.Count();
for (i = 0; i < n; i++)
delete ((UniString*)(aValueList.GetObject(i)));
aValueList.Clear();
@@ -290,14 +290,14 @@ enum _ImplINetRFC822MessageHeaderState
INetRFC822Message::INetRFC822Message (void)
: INetMessage()
{
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = LIST_ENTRY_NOTFOUND;
}
INetRFC822Message::INetRFC822Message (const INetRFC822Message& rMsg)
: INetMessage (rMsg)
{
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
}
@@ -310,7 +310,7 @@ INetRFC822Message& INetRFC822Message::operator= (const INetRFC822Message& rMsg)
{
INetMessage::operator= (rMsg);
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
}
return *this;
@@ -357,28 +357,28 @@ static const sal_Char *wkdays[7] =
/*
* GenerateDateField.
*/
-BOOL INetRFC822Message::GenerateDateField (
+sal_Bool INetRFC822Message::GenerateDateField (
const DateTime& rDateTime, UniString& rDateFieldW)
{
// Check arguments.
if (!rDateTime.IsValid() ||
(rDateTime.GetSec() > 59) ||
(rDateTime.GetMin() > 59) ||
- (rDateTime.GetHour() > 23) ) return FALSE;
+ (rDateTime.GetHour() > 23) ) return sal_False;
// Prepare output string.
ByteString rDateField;
// Insert Date.
- rDateField += wkdays[(USHORT)(rDateTime.GetDayOfWeek())];
+ rDateField += wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())];
rDateField += ", ";
- USHORT nNum = rDateTime.GetDay();
+ sal_uInt16 nNum = rDateTime.GetDay();
if (nNum < 10) rDateField += '0';
rDateField += ByteString::CreateFromInt32(nNum);
rDateField += ' ';
- rDateField += months[(USHORT)(rDateTime.GetMonth() - 1)];
+ rDateField += months[(sal_uInt16)(rDateTime.GetMonth() - 1)];
rDateField += ' ';
rDateField += ByteString::CreateFromInt32(rDateTime.GetYear());
@@ -402,47 +402,47 @@ BOOL INetRFC822Message::GenerateDateField (
// Done.
rDateFieldW = UniString (rDateField, RTL_TEXTENCODING_ASCII_US);
- return TRUE;
+ return sal_True;
}
/*
* ParseDateField and local helper functions.
*/
-static USHORT ParseNumber (const ByteString& rStr, USHORT& nIndex)
+static sal_uInt16 ParseNumber (const ByteString& rStr, sal_uInt16& nIndex)
{
- USHORT n = nIndex;
+ sal_uInt16 n = nIndex;
while ((n < rStr.Len()) && ascii_isDigit(rStr.GetChar(n))) n++;
ByteString aNum (rStr.Copy (nIndex, (n - nIndex)));
nIndex = n;
- return (USHORT)(aNum.ToInt32());
+ return (sal_uInt16)(aNum.ToInt32());
}
-static USHORT ParseMonth (const ByteString& rStr, USHORT& nIndex)
+static sal_uInt16 ParseMonth (const ByteString& rStr, sal_uInt16& nIndex)
{
- USHORT n = nIndex;
+ sal_uInt16 n = nIndex;
while ((n < rStr.Len()) && ascii_isLetter(rStr.GetChar(n))) n++;
ByteString aMonth (rStr.Copy (nIndex, 3));
nIndex = n;
- USHORT i;
+ sal_uInt16 i;
for (i = 0; i < 12; i++)
if (aMonth.CompareIgnoreCaseToAscii (months[i]) == 0) break;
return (i + 1);
}
-BOOL INetRFC822Message::ParseDateField (
+sal_Bool INetRFC822Message::ParseDateField (
const UniString& rDateFieldW, DateTime& rDateTime)
{
ByteString rDateField (rDateFieldW, RTL_TEXTENCODING_ASCII_US);
- if (rDateField.Len() == 0) return FALSE;
+ if (rDateField.Len() == 0) return sal_False;
if (rDateField.Search (':') != STRING_NOTFOUND)
{
// Some DateTime format.
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
// Skip over <Wkd> or <Weekday>, leading and trailing space.
while ((nIndex < rDateField.Len()) &&
@@ -462,7 +462,7 @@ BOOL INetRFC822Message::ParseDateField (
if (ascii_isLetter (rDateField.GetChar(nIndex)))
{
// Format: ctime().
- if ((rDateField.Len() - nIndex) < 20) return FALSE;
+ if ((rDateField.Len() - nIndex) < 20) return sal_False;
rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
@@ -472,19 +472,19 @@ BOOL INetRFC822Message::ParseDateField (
rDateTime.SetSec (ParseNumber (rDateField, nIndex)); nIndex++;
rDateTime.Set100Sec (0);
- USHORT nYear = ParseNumber (rDateField, nIndex);
+ sal_uInt16 nYear = ParseNumber (rDateField, nIndex);
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
}
else
{
// Format: RFC1036 or RFC1123.
- if ((rDateField.Len() - nIndex) < 17) return FALSE;
+ if ((rDateField.Len() - nIndex) < 17) return sal_False;
rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
- USHORT nYear = ParseNumber (rDateField, nIndex); nIndex++;
+ sal_uInt16 nYear = ParseNumber (rDateField, nIndex); nIndex++;
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
@@ -497,8 +497,8 @@ BOOL INetRFC822Message::ParseDateField (
(rDateField.GetChar(nIndex) == '-') )
{
// Offset from GMT: "(+|-)HHMM".
- BOOL bEast = (rDateField.GetChar(nIndex++) == '+');
- USHORT nOffset = ParseNumber (rDateField, nIndex);
+ sal_Bool bEast = (rDateField.GetChar(nIndex++) == '+');
+ sal_uInt16 nOffset = ParseNumber (rDateField, nIndex);
if (nOffset > 0)
{
Time aDiff;
@@ -531,7 +531,7 @@ BOOL INetRFC822Message::ParseDateField (
else
{
// Junk.
- return FALSE;
+ return sal_False;
}
return (rDateTime.IsValid() &&
@@ -544,15 +544,15 @@ BOOL INetRFC822Message::ParseDateField (
* SetHeaderField.
* (Header Field Parser).
*/
-ULONG INetRFC822Message::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nNewIndex)
+sal_uIntPtr INetRFC822Message::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
ByteString aName (rHeader.GetName());
const sal_Char *pData = aName.GetBuffer();
const sal_Char *pStop = pData + aName.Len() + 1;
const sal_Char *check = "";
- ULONG nIdx = LIST_APPEND;
+ sal_uIntPtr nIdx = LIST_APPEND;
int eState = INETMSG_RFC822_BEGIN;
int eOkState = INETMSG_RFC822_OK;
@@ -913,7 +913,7 @@ SvStream& INetRFC822Message::operator<< (SvStream& rStrm) const
{
INetMessage::operator<< (rStrm);
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
return rStrm;
@@ -927,7 +927,7 @@ SvStream& INetRFC822Message::operator>> (SvStream& rStrm)
INetMessage::operator>> (rStrm);
sal_uInt32 nTemp;
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
{
rStrm >> nTemp;
m_nIndex[i] = nTemp;
@@ -991,9 +991,9 @@ INetMIMEMessage::INetMIMEMessage (void)
: INetRFC822Message (),
pParent (NULL),
nNumChildren (0),
- bHeaderParsed (FALSE)
+ bHeaderParsed (sal_False)
{
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
m_nIndex[i] = LIST_ENTRY_NOTFOUND;
}
@@ -1050,7 +1050,7 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg)
{
bHeaderParsed = rMsg.bHeaderParsed;
- USHORT i;
+ sal_uInt16 i;
for (i = 0; i < INETMSG_MIME_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
@@ -1084,15 +1084,15 @@ INetMIMEMessage *INetMIMEMessage::CreateMessage (
* SetHeaderField.
* (Header Field Parser).
*/
-ULONG INetMIMEMessage::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nNewIndex)
+sal_uIntPtr INetMIMEMessage::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
ByteString aName (rHeader.GetName());
const sal_Char *pData = aName.GetBuffer();
const sal_Char *pStop = pData + aName.Len() + 1;
const sal_Char *check = "";
- ULONG nIdx = LIST_APPEND;
+ sal_uIntPtr nIdx = LIST_APPEND;
int eState = INETMSG_MIME_BEGIN;
int eOkState = INETMSG_MIME_OK;
@@ -1320,11 +1320,11 @@ void INetMIMEMessage::GetDefaultContentType (String& rContentType)
/*
* EnableAttachChild.
*/
-BOOL INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
+sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
{
// Check context.
if (IsContainer())
- return FALSE;
+ return sal_False;
// Setup Content-Type header field.
ByteString aContentType;
@@ -1384,14 +1384,14 @@ BOOL INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
SetContentTransferEncoding (String (CONSTASCII_STRINGPARAM("7bit")));
// Done.
- return TRUE;
+ return sal_True;
}
/*
* AttachChild.
*/
-BOOL INetMIMEMessage::AttachChild (
- INetMIMEMessage& rChildMsg, BOOL bOwner)
+sal_Bool INetMIMEMessage::AttachChild (
+ INetMIMEMessage& rChildMsg, sal_Bool bOwner)
{
if (IsContainer() /*&& rChildMsg.GetContentType().Len() */)
{
@@ -1399,21 +1399,21 @@ BOOL INetMIMEMessage::AttachChild (
aChildren.Insert (&rChildMsg, LIST_APPEND);
nNumChildren = aChildren.Count();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*
* DetachChild.
*/
-BOOL INetMIMEMessage::DetachChild (
- ULONG nIndex, INetMIMEMessage& rChildMsg) const
+sal_Bool INetMIMEMessage::DetachChild (
+ sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const
{
if (IsContainer())
{
// Check document stream.
- if (GetDocumentLB() == NULL) return FALSE;
+ if (GetDocumentLB() == NULL) return sal_False;
SvStream *pDocStrm = new SvStream (GetDocumentLB());
// Initialize message buffer.
@@ -1488,7 +1488,7 @@ BOOL INetMIMEMessage::DetachChild (
* Compare buffered line with part/close delimiter.
* Increment current part index upon match.
*/
- USHORT nLen = (USHORT)(aLineBuf.Tell() & 0xffff);
+ sal_uInt16 nLen = (sal_uInt16)(aLineBuf.Tell() & 0xffff);
if (nLen == aDelim.Len())
{
if (aDelim.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen)
@@ -1514,7 +1514,7 @@ BOOL INetMIMEMessage::DetachChild (
pMsgRead = pMsgWrite = pMsgBuffer;
// Read document stream.
- ULONG nRead = pDocStrm->Read (
+ sal_uIntPtr nRead = pDocStrm->Read (
pMsgBuffer, sizeof (pMsgBuffer));
if (nRead > 0)
{
@@ -1533,7 +1533,7 @@ BOOL INetMIMEMessage::DetachChild (
{
// Requested part not found.
delete pDocStrm;
- return FALSE;
+ return sal_False;
}
}
}
@@ -1573,7 +1573,7 @@ BOOL INetMIMEMessage::DetachChild (
pMsgRead = pMsgWrite = pMsgBuffer;
// Read document stream.
- ULONG nRead = pDocStrm->Read (
+ sal_uIntPtr nRead = pDocStrm->Read (
pMsgBuffer, sizeof (pMsgBuffer));
if (nRead > 0)
{
@@ -1592,9 +1592,9 @@ BOOL INetMIMEMessage::DetachChild (
// Done.
if (pDocStrm) delete pDocStrm;
if (pMsgStrm) delete pMsgStrm;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*
@@ -1604,7 +1604,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
{
INetRFC822Message::operator<< (rStrm);
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
@@ -1625,7 +1625,7 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm)
INetRFC822Message::operator>> (rStrm);
sal_uInt32 nTemp;
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
{
rStrm >> nTemp;
m_nIndex[i] = nTemp;
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 19434d323d10..9390cdd12a9e 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -54,23 +54,23 @@ class INetMessageEncodeQPStream_Impl : public INetMessageIStream
{
SvStream *pMsgStrm;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_Char *pMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
- ULONG nTokBufSiz;
+ sal_uIntPtr nTokBufSiz;
sal_Char *pTokBuffer;
sal_Char *pTokRead;
sal_Char *pTokWrite;
INetMessageStreamState eState;
- BOOL bDone;
+ sal_Bool bDone;
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageEncodeQPStream_Impl (ULONG nMsgBufferSize = 1024);
+ INetMessageEncodeQPStream_Impl (sal_uIntPtr nMsgBufferSize = 1024);
virtual ~INetMessageEncodeQPStream_Impl (void);
};
@@ -85,10 +85,10 @@ class INetMessageDecodeQPStream_Impl : public INetMessageOStream
INetMessageStreamState eState;
SvMemoryStream *pMsgBuffer;
- ULONG nTokBufLen;
+ sal_uIntPtr nTokBufLen;
sal_Char pTokBuffer[4];
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
INetMessageDecodeQPStream_Impl (void);
@@ -105,22 +105,22 @@ class INetMessageEncode64Stream_Impl : public INetMessageIStream
{
SvStream *pMsgStrm;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_uInt8 *pMsgBuffer;
sal_uInt8 *pMsgRead;
sal_uInt8 *pMsgWrite;
- ULONG nTokBufSiz;
+ sal_uIntPtr nTokBufSiz;
sal_Char *pTokBuffer;
sal_Char *pTokRead;
sal_Char *pTokWrite;
- BOOL bDone;
+ sal_Bool bDone;
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageEncode64Stream_Impl (ULONG nMsgBufferSize = 2048);
+ INetMessageEncode64Stream_Impl (sal_uIntPtr nMsgBufferSize = 2048);
virtual ~INetMessageEncode64Stream_Impl (void);
};
@@ -134,15 +134,15 @@ class INetMessageDecode64Stream_Impl : public INetMessageOStream
{
INetMessageStreamState eState;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_Char *pMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageDecode64Stream_Impl (ULONG nMsgBufferSize = 128);
+ INetMessageDecode64Stream_Impl (sal_uIntPtr nMsgBufferSize = 128);
virtual ~INetMessageDecode64Stream_Impl (void);
};
@@ -168,7 +168,7 @@ INetIStream::~INetIStream (void)
/*
* Read.
*/
-int INetIStream::Read (sal_Char *pData, ULONG nSize)
+int INetIStream::Read (sal_Char *pData, sal_uIntPtr nSize)
{
return GetData (pData, nSize);
}
@@ -179,7 +179,7 @@ int INetIStream::Read (sal_Char *pData, ULONG nSize)
void INetIStream::Decode64 (SvStream& rIn, SvStream& rOut)
{
INetMessage aMsg;
- aMsg.SetDocumentLB(new SvAsyncLockBytes(&rOut, FALSE));
+ aMsg.SetDocumentLB(new SvAsyncLockBytes(&rOut, sal_False));
INetMessageDecode64Stream_Impl aStream (8192);
aStream.SetTargetMessage (&aMsg);
@@ -201,7 +201,7 @@ void INetIStream::Encode64 (SvStream& rIn, SvStream& rOut)
{
INetMessage aMsg;
aMsg.SetDocumentLB (
- new SvLockBytes (&rIn, FALSE));
+ new SvLockBytes (&rIn, sal_False));
INetMessageEncode64Stream_Impl aStream (8192);
aStream.SetSourceMessage (&aMsg);
@@ -237,7 +237,7 @@ INetOStream::~INetOStream (void)
/*
* Write.
*/
-int INetOStream::Write (const sal_Char *pData, ULONG nSize)
+int INetOStream::Write (const sal_Char *pData, sal_uIntPtr nSize)
{
return PutData (pData, nSize);
}
@@ -250,9 +250,9 @@ int INetOStream::Write (const sal_Char *pData, ULONG nSize)
/*
* INetMessageIStream.
*/
-INetMessageIStream::INetMessageIStream (ULONG nBufferSize)
+INetMessageIStream::INetMessageIStream (sal_uIntPtr nBufferSize)
: pSourceMsg (NULL),
- bHeaderGenerated (FALSE),
+ bHeaderGenerated (sal_False),
nBufSiz (nBufferSize),
pMsgStrm (NULL),
pMsgBuffer (new SvMemoryStream)
@@ -275,7 +275,7 @@ INetMessageIStream::~INetMessageIStream (void)
/*
* GetData.
*/
-int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
+int INetMessageIStream::GetData (sal_Char *pData, sal_uIntPtr nSize)
{
if (pSourceMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -285,13 +285,13 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
while (pWBuf < pWEnd)
{
// Caller's buffer not yet filled.
- ULONG n = pRead - pWrite;
+ sal_uIntPtr n = pRead - pWrite;
if (n > 0)
{
// Bytes still in buffer.
- ULONG m = pWEnd - pWBuf;
+ sal_uIntPtr m = pWEnd - pWBuf;
if (m < n) n = m;
- for (ULONG i = 0; i < n; i++) *pWBuf++ = *pWrite++;
+ for (sal_uIntPtr i = 0; i < n; i++) *pWBuf++ = *pWrite++;
}
else
{
@@ -310,7 +310,7 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
if (!bHeaderGenerated)
{
// Header generated. Insert empty line.
- bHeaderGenerated = TRUE;
+ bHeaderGenerated = sal_True;
*pRead++ = '\r';
*pRead++ = '\n';
}
@@ -328,7 +328,7 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
/*
* GetMsgLine.
*/
-int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageIStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
if (pSourceMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -337,7 +337,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
if (!bHeaderGenerated)
{
- ULONG i, n;
+ sal_uIntPtr i, n;
if (pMsgBuffer->Tell() == 0)
{
@@ -380,7 +380,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
if (pMsgStrm == NULL)
pMsgStrm = new SvStream (pSourceMsg->GetDocumentLB());
- ULONG nRead = pMsgStrm->Read (pWBuf, (pWEnd - pWBuf));
+ sal_uIntPtr nRead = pMsgStrm->Read (pWBuf, (pWEnd - pWBuf));
pWBuf += nRead;
}
}
@@ -397,7 +397,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
*/
INetMessageOStream::INetMessageOStream (void)
: pTargetMsg (NULL),
- bHeaderParsed (FALSE),
+ bHeaderParsed (sal_False),
eOState (INETMSG_EOL_BEGIN),
pMsgBuffer (new SvMemoryStream)
{
@@ -428,7 +428,7 @@ INetMessageOStream::~INetMessageOStream (void)
* PutData.
* (Simple Field Parsing (RFC822, Appendix B)).
*/
-int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
+int INetMessageOStream::PutData (const sal_Char *pData, sal_uIntPtr nSize)
{
if (pTargetMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -463,7 +463,7 @@ int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
pMsgBuffer->Seek (STREAM_SEEK_TO_BEGIN);
// Mark header parsed.
- bHeaderParsed = TRUE;
+ bHeaderParsed = sal_True;
}
else if ((*pData == ' ') || (*pData == '\t'))
{
@@ -535,7 +535,7 @@ int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
/*
* PutMsgLine.
*/
-int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
+int INetMessageOStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
if (pTargetMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -544,7 +544,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
if (!IsHeaderParsed())
{
ByteString aField (pData);
- USHORT nPos = aField.Search (':');
+ sal_uInt16 nPos = aField.Search (':');
if (nPos != STRING_NOTFOUND)
{
ByteString aName (
@@ -583,7 +583,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
/*
* INetMessageIOStream.
*/
-INetMessageIOStream::INetMessageIOStream (ULONG nBufferSize)
+INetMessageIOStream::INetMessageIOStream (sal_uIntPtr nBufferSize)
: INetMessageIStream (nBufferSize),
INetMessageOStream ()
{
@@ -615,15 +615,15 @@ static const sal_Char ebcdic[] = {
* INetMessageEncodeQPStream_Impl.
*/
INetMessageEncodeQPStream_Impl::INetMessageEncodeQPStream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageIStream (),
pMsgStrm (NULL),
nMsgBufSiz (nMsgBufferSize),
nTokBufSiz (80),
eState (INETMSG_EOL_SCR),
- bDone (FALSE)
+ bDone (sal_False)
{
- GenerateHeader (FALSE);
+ GenerateHeader (sal_False);
pMsgBuffer = new sal_Char[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -645,7 +645,7 @@ INetMessageEncodeQPStream_Impl::~INetMessageEncodeQPStream_Impl (void)
/*
* GetMsgLine.
*/
-int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetSourceMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -774,7 +774,7 @@ int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pMsgRead = pMsgWrite = pMsgBuffer;
// Read next message block.
- ULONG nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
+ sal_uIntPtr nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
if (nRead > 0)
{
// Set read pointer.
@@ -789,7 +789,7 @@ int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
*pTokRead++ = '\r';
*pTokRead++ = '\n';
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -851,7 +851,7 @@ INetMessageDecodeQPStream_Impl::INetMessageDecodeQPStream_Impl (void)
pMsgBuffer (new SvMemoryStream),
nTokBufLen (0)
{
- ParseHeader (FALSE);
+ ParseHeader (sal_False);
}
/*
@@ -866,7 +866,7 @@ INetMessageDecodeQPStream_Impl::~INetMessageDecodeQPStream_Impl (void)
* PutMsgLine.
*/
int INetMessageDecodeQPStream_Impl::PutMsgLine (
- const sal_Char *pData, ULONG nSize)
+ const sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetTargetMessage();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -965,14 +965,14 @@ static const sal_Char six2pr[64] = {
* INetMessageEncode64Stream_Impl.
*/
INetMessageEncode64Stream_Impl::INetMessageEncode64Stream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageIStream (),
pMsgStrm (NULL),
nMsgBufSiz (nMsgBufferSize),
nTokBufSiz (80),
- bDone (FALSE)
+ bDone (sal_False)
{
- GenerateHeader (FALSE);
+ GenerateHeader (sal_False);
pMsgBuffer = new sal_uInt8[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -994,7 +994,7 @@ INetMessageEncode64Stream_Impl::~INetMessageEncode64Stream_Impl (void)
/*
* GetMsgLine.
*/
-int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetSourceMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -1064,7 +1064,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pMsgRead = pMsgWrite = pMsgBuffer;
// Read next message block.
- ULONG nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
+ sal_uIntPtr nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
if (nRead > 0)
{
// Set read pointer.
@@ -1093,7 +1093,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
*pTokRead++ = '\n';
// Mark we're done.
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -1109,7 +1109,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pTokRead = pTokWrite = pTokBuffer;
// Reset done flag, if everything has been done.
- // if (pWBuf == pData) bDone = FALSE;
+ // if (pWBuf == pData) bDone = sal_False;
// Return.
return (pWBuf - pData);
@@ -1173,12 +1173,12 @@ static const sal_uInt8 pr2six[256] = {
* INetMessageDecode64Stream_Impl.
*/
INetMessageDecode64Stream_Impl::INetMessageDecode64Stream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageOStream (),
eState (INETMSG_EOL_SCR),
nMsgBufSiz (nMsgBufferSize)
{
- ParseHeader (FALSE);
+ ParseHeader (sal_False);
pMsgBuffer = new sal_Char[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -1196,7 +1196,7 @@ INetMessageDecode64Stream_Impl::~INetMessageDecode64Stream_Impl (void)
* PutMsgLine.
*/
int INetMessageDecode64Stream_Impl::PutMsgLine (
- const sal_Char *pData, ULONG nSize)
+ const sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetTargetMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -1299,7 +1299,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine (
/*
* INetMIMEMessageStream.
*/
-INetMIMEMessageStream::INetMIMEMessageStream (ULONG nBufferSize)
+INetMIMEMessageStream::INetMIMEMessageStream (sal_uIntPtr nBufferSize)
: INetMessageIOStream (nBufferSize),
eState (INETMSG_EOL_BEGIN),
nChildIndex (0),
@@ -1361,7 +1361,7 @@ INetMIMEMessageStream::GetMsgEncoding (const String& rContentType)
* GetMsgLine.
* (Message Generator).
*/
-int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
INetMIMEMessage *pMsg = GetSourceMessage();
@@ -1595,7 +1595,7 @@ int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, ULONG nSize)
* PutMsgLine.
* (Message Parser).
*/
-int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
+int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
INetMIMEMessage *pMsg = GetTargetMessage();
@@ -1624,8 +1624,8 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
pMsg->SetChildCount( pMsg->GetChildCount() + 1);
INetMIMEMessage* pNewMessage = new INetMIMEMessage;
pNewMessage->SetDocumentLB (
- new SvAsyncLockBytes(new SvCacheStream, FALSE));
- pMsg->AttachChild( *pNewMessage, TRUE );
+ new SvAsyncLockBytes(new SvCacheStream, sal_False));
+ pMsg->AttachChild( *pNewMessage, sal_True );
// Encapsulated message body. Create message parser stream.
pChildStrm = new INetMIMEMessageStream;
@@ -1657,7 +1657,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
ByteString aLowerType (aType);
aLowerType.ToLowerAscii();
- USHORT nPos = aLowerType.Search ("boundary=");
+ sal_uInt16 nPos = aLowerType.Search ("boundary=");
ByteString aBoundary (aType.Copy (nPos + 9));
aBoundary.EraseLeadingAndTrailingChars (' ');
@@ -1679,7 +1679,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
if (pMsgBuffer == NULL) pMsgBuffer = new SvMemoryStream;
pMsgBuffer->Write (pData, nSize);
- ULONG nBufSize = pMsgBuffer->Tell();
+ sal_uIntPtr nBufSize = pMsgBuffer->Tell();
const sal_Char* pChar;
const sal_Char* pOldPos;
@@ -1736,9 +1736,9 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
new INetMIMEMessage;
pNewMessage->SetDocumentLB (
new SvAsyncLockBytes (
- new SvCacheStream, FALSE));
+ new SvCacheStream, sal_False));
- pMsg->AttachChild( *pNewMessage, TRUE );
+ pMsg->AttachChild( *pNewMessage, sal_True );
// Encapsulated message body. Create message parser stream.
pChildStrm = new INetMIMEMessageStream;
diff --git a/tools/source/makefile.mk b/tools/source/makefile.mk
deleted file mode 100644
index 8c3f3167635e..000000000000
--- a/tools/source/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-TARGET=source
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(GUI)" == "UNX"
-SUBDIRS+= solar
-.ENDIF
-
-SUBDIRS+= \
- datetime \
- timestamp \
- debug \
- fsys \
- generic \
- intntl \
- memtools \
- misc \
- rc \
- ref \
- stream \
- zcodec
-
-
-.INCLUDE : target.mk
-
diff --git a/tools/source/memtools/contnr.cxx b/tools/source/memtools/contnr.cxx
index 3aff098aa3bc..9fe9babc5f05 100644..100755
--- a/tools/source/memtools/contnr.cxx
+++ b/tools/source/memtools/contnr.cxx
@@ -75,7 +75,7 @@ const char* CBlock::DbgCheckCBlock( const void* pBlock )
|*
*************************************************************************/
-CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext )
+CBlock::CBlock( sal_uInt16 nInitSize, CBlock* _pPrev, CBlock* _pNext )
{
DBG_CTOR( CBlock, DbgCheckCBlock );
@@ -96,7 +96,7 @@ CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext )
|*
*************************************************************************/
-CBlock::CBlock( USHORT _nSize, CBlock* _pPrev )
+CBlock::CBlock( sal_uInt16 _nSize, CBlock* _pPrev )
{
DBG_CTOR( CBlock, DbgCheckCBlock );
DBG_ASSERT( _nSize, "CBlock::CBlock(): nSize == 0" );
@@ -158,7 +158,7 @@ inline CBlock::~CBlock()
|*
*************************************************************************/
-void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize )
+void CBlock::Insert( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
DBG_ASSERT( nIndex <= nCount, "CBlock::Insert(): Index > nCount" );
@@ -212,12 +212,12 @@ void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize )
+CBlock* CBlock::Split( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
- USHORT nNewSize;
- USHORT nMiddle;
+ sal_uInt16 nNewSize;
+ sal_uInt16 nMiddle;
CBlock* pNewBlock;
nMiddle = nCount/2;
@@ -347,7 +347,7 @@ CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-void* CBlock::Remove( USHORT nIndex, USHORT nReSize )
+void* CBlock::Remove( sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -404,7 +404,7 @@ void* CBlock::Remove( USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-inline void* CBlock::Replace( void* p, USHORT nIndex )
+inline void* CBlock::Replace( void* p, sal_uInt16 nIndex )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -423,7 +423,7 @@ inline void* CBlock::Replace( void* p, USHORT nIndex )
|*
*************************************************************************/
-inline void** CBlock::GetObjectPtr( USHORT nIndex )
+inline void** CBlock::GetObjectPtr( sal_uInt16 nIndex )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -438,7 +438,7 @@ inline void** CBlock::GetObjectPtr( USHORT nIndex )
|*
*************************************************************************/
-void CBlock::SetSize( USHORT nNewSize )
+void CBlock::SetSize( sal_uInt16 nNewSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
DBG_ASSERT( nNewSize, "CBlock::SetSize(): nNewSize == 0" );
@@ -554,7 +554,7 @@ void Container::ImpCopyContainer( const Container* pCont2 )
|*
*************************************************************************/
-Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize )
+Container::Container( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize )
{
DBG_CTOR( Container, DbgCheckContainer );
@@ -615,7 +615,7 @@ Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize )
|*
*************************************************************************/
-Container::Container( ULONG nSize )
+Container::Container( sal_uIntPtr nSize )
{
DBG_CTOR( Container, DbgCheckContainer );
@@ -636,7 +636,7 @@ Container::Container( ULONG nSize )
// Muss mehr als ein Block angelegt werden
if ( nSize <= nBlockSize )
{
- pFirstBlock = new CBlock( (USHORT)nSize, NULL );
+ pFirstBlock = new CBlock( (sal_uInt16)nSize, NULL );
pLastBlock = pFirstBlock;
}
else
@@ -657,7 +657,7 @@ Container::Container( ULONG nSize )
nSize -= nBlockSize;
}
- pLastBlock = new CBlock( (USHORT)nSize, pBlock1 );
+ pLastBlock = new CBlock( (sal_uInt16)nSize, pBlock1 );
pBlock1->SetNextBlock( pLastBlock );
}
@@ -707,7 +707,7 @@ Container::~Container()
|*
*************************************************************************/
-void Container::ImpInsert( void* p, CBlock* pBlock, USHORT nIndex )
+void Container::ImpInsert( void* p, CBlock* pBlock, sal_uInt16 nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -799,7 +799,7 @@ void Container::Insert( void* p )
|*
*************************************************************************/
-void Container::Insert( void* p, ULONG nIndex )
+void Container::Insert( void* p, sal_uIntPtr nIndex )
{
if ( nCount <= nIndex )
{
@@ -818,7 +818,7 @@ void Container::Insert( void* p, ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- ImpInsert( p, pTemp, (USHORT)nIndex );
+ ImpInsert( p, pTemp, (sal_uInt16)nIndex );
}
}
@@ -830,7 +830,7 @@ void Container::Insert( void* p, ULONG nIndex )
void Container::Insert( void* pNew, void* pOld )
{
- ULONG nIndex = GetPos( pOld );
+ sal_uIntPtr nIndex = GetPos( pOld );
if ( nIndex != CONTAINER_ENTRY_NOTFOUND )
Insert( pNew, nIndex );
}
@@ -843,7 +843,7 @@ void Container::Insert( void* pNew, void* pOld )
|*
*************************************************************************/
-void* Container::ImpRemove( CBlock* pBlock, USHORT nIndex )
+void* Container::ImpRemove( CBlock* pBlock, sal_uInt16 nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -931,7 +931,7 @@ void* Container::Remove()
|*
*************************************************************************/
-void* Container::Remove( ULONG nIndex )
+void* Container::Remove( sal_uIntPtr nIndex )
{
// Ist Index nicht innerhalb des Containers, dann NULL zurueckgeben
if ( nCount <= nIndex )
@@ -946,7 +946,7 @@ void* Container::Remove( ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- return ImpRemove( pTemp, (USHORT)nIndex );
+ return ImpRemove( pTemp, (sal_uInt16)nIndex );
}
}
@@ -972,7 +972,7 @@ void* Container::Replace( void* p )
|*
*************************************************************************/
-void* Container::Replace( void* p, ULONG nIndex )
+void* Container::Replace( void* p, sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -989,7 +989,7 @@ void* Container::Replace( void* p, ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- return pTemp->Replace( p, (USHORT)nIndex );
+ return pTemp->Replace( p, (sal_uInt16)nIndex );
}
}
@@ -999,7 +999,7 @@ void* Container::Replace( void* p, ULONG nIndex )
|*
*************************************************************************/
-void Container::SetSize( ULONG nNewSize )
+void Container::SetSize( sal_uIntPtr nNewSize )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1009,7 +1009,7 @@ void Container::SetSize( ULONG nNewSize )
if ( nNewSize != nCount )
{
CBlock* pTemp;
- ULONG nTemp;
+ sal_uIntPtr nTemp;
// Wird verkleinert
if ( nNewSize < nCount )
@@ -1023,14 +1023,14 @@ void Container::SetSize( ULONG nNewSize )
}
// Alle folgenden Bloecke loeschen
- BOOL bLast = FALSE;
+ sal_Bool bLast = sal_False;
CBlock* pDelNext;
CBlock* pDelBlock = pTemp->GetNextBlock();
while ( pDelBlock )
{
// Muss CurrentBlock umgesetzt werden
if ( pDelBlock == pCurBlock )
- bLast = TRUE;
+ bLast = sal_True;
pDelNext = pDelBlock->GetNextBlock();
delete pDelBlock;
pDelBlock = pDelNext;
@@ -1041,7 +1041,7 @@ void Container::SetSize( ULONG nNewSize )
{
pLastBlock = pTemp;
pTemp->SetNextBlock( NULL );
- pTemp->SetSize( (USHORT)(nNewSize-nTemp) );
+ pTemp->SetSize( (sal_uInt16)(nNewSize-nTemp) );
}
else
{
@@ -1068,7 +1068,7 @@ void Container::SetSize( ULONG nNewSize )
// Muss mehr als ein Block angelegt werden
if ( nNewSize <= nBlockSize )
{
- pFirstBlock = new CBlock( (USHORT)nNewSize, NULL );
+ pFirstBlock = new CBlock( (sal_uInt16)nNewSize, NULL );
pLastBlock = pFirstBlock;
}
else
@@ -1089,7 +1089,7 @@ void Container::SetSize( ULONG nNewSize )
nNewSize -= nBlockSize;
}
- pLastBlock = new CBlock( (USHORT)nNewSize, pBlock1 );
+ pLastBlock = new CBlock( (sal_uInt16)nNewSize, pBlock1 );
pBlock1->SetNextBlock( pLastBlock );
}
@@ -1097,7 +1097,7 @@ void Container::SetSize( ULONG nNewSize )
}
// Reicht es, den letzen Puffer in der Groesse anzupassen
else if ( (nTemp+pTemp->Count()) <= nBlockSize )
- pTemp->SetSize( (USHORT)(nTemp+pTemp->Count()) );
+ pTemp->SetSize( (sal_uInt16)(nTemp+pTemp->Count()) );
else
{
// Puffer auf max. Blockgroesse setzen
@@ -1118,7 +1118,7 @@ void Container::SetSize( ULONG nNewSize )
// Den letzten Block anlegen
if ( nTemp )
{
- pLastBlock = new CBlock( (USHORT)nTemp, pTemp );
+ pLastBlock = new CBlock( (sal_uInt16)nTemp, pTemp );
pTemp->SetNextBlock( pLastBlock );
}
else
@@ -1183,7 +1183,7 @@ void* Container::GetCurObject() const
|*
*************************************************************************/
-ULONG Container::GetCurPos() const
+sal_uIntPtr Container::GetCurPos() const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1194,7 +1194,7 @@ ULONG Container::GetCurPos() const
{
// Block suchen
CBlock* pTemp = pFirstBlock;
- ULONG nTemp = 0;
+ sal_uIntPtr nTemp = 0;
while ( pTemp != pCurBlock )
{
nTemp += pTemp->Count();
@@ -1213,7 +1213,7 @@ ULONG Container::GetCurPos() const
|*
*************************************************************************/
-void** Container::GetObjectPtr( ULONG nIndex )
+void** Container::GetObjectPtr( sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1231,7 +1231,7 @@ void** Container::GetObjectPtr( ULONG nIndex )
}
// Item innerhalb des gefundenen Blocks zurueckgeben
- return pTemp->GetObjectPtr( (USHORT)nIndex );
+ return pTemp->GetObjectPtr( (sal_uInt16)nIndex );
}
}
@@ -1241,7 +1241,7 @@ void** Container::GetObjectPtr( ULONG nIndex )
|*
*************************************************************************/
-void* Container::GetObject( ULONG nIndex ) const
+void* Container::GetObject( sal_uIntPtr nIndex ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1259,7 +1259,7 @@ void* Container::GetObject( ULONG nIndex ) const
}
// Item innerhalb des gefundenen Blocks zurueckgeben
- return pTemp->GetObject( (USHORT)nIndex );
+ return pTemp->GetObject( (sal_uInt16)nIndex );
}
}
@@ -1269,15 +1269,15 @@ void* Container::GetObject( ULONG nIndex ) const
|*
*************************************************************************/
-ULONG Container::GetPos( const void* p ) const
+sal_uIntPtr Container::GetPos( const void* p ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
void** pNodes;
CBlock* pTemp;
- ULONG nTemp;
- USHORT nBlockCount;
- USHORT i;
+ sal_uIntPtr nTemp;
+ sal_uInt16 nBlockCount;
+ sal_uInt16 i;
// Block suchen
pTemp = pFirstBlock;
@@ -1307,8 +1307,8 @@ ULONG Container::GetPos( const void* p ) const
|*
*************************************************************************/
-ULONG Container::GetPos( const void* p, ULONG nStartIndex,
- BOOL bForward ) const
+sal_uIntPtr Container::GetPos( const void* p, sal_uIntPtr nStartIndex,
+ sal_Bool bForward ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1318,12 +1318,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
{
void** pNodes;
- USHORT nBlockCount;
- USHORT i;
+ sal_uInt16 nBlockCount;
+ sal_uInt16 i;
// Block suchen
CBlock* pTemp = pFirstBlock;
- ULONG nTemp = 0;
+ sal_uIntPtr nTemp = 0;
while ( nTemp+pTemp->Count() <= nStartIndex )
{
nTemp += pTemp->Count();
@@ -1334,7 +1334,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
if ( bForward )
{
// Alle Bloecke durchrsuchen
- i = (USHORT)(nStartIndex - nTemp);
+ i = (sal_uInt16)(nStartIndex - nTemp);
pNodes = pTemp->GetObjectPtr( i );
do
{
@@ -1356,12 +1356,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
break;
}
- while ( TRUE );
+ while ( sal_True );
}
else
{
// Alle Bloecke durchrsuchen
- i = (USHORT)(nStartIndex-nTemp)+1;
+ i = (sal_uInt16)(nStartIndex-nTemp)+1;
pNodes = pTemp->GetObjectPtr( i-1 );
do
{
@@ -1385,7 +1385,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
break;
}
- while ( TRUE );
+ while ( sal_True );
}
}
@@ -1398,7 +1398,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
|*
*************************************************************************/
-void* Container::Seek( ULONG nIndex )
+void* Container::Seek( sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1417,7 +1417,7 @@ void* Container::Seek( ULONG nIndex )
// Item innerhalb des gefundenen Blocks zurueckgeben
pCurBlock = pTemp;
- nCurIndex = (USHORT)nIndex;
+ nCurIndex = (sal_uInt16)nIndex;
return pCurBlock->GetObject( nCurIndex );
}
}
@@ -1552,22 +1552,22 @@ Container& Container::operator =( const Container& r )
|*
*************************************************************************/
-BOOL Container::operator ==( const Container& r ) const
+sal_Bool Container::operator ==( const Container& r ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
if ( nCount != r.nCount )
- return FALSE;
+ return sal_False;
- ULONG i = 0;
+ sal_uIntPtr i = 0;
while ( i < nCount )
{
if ( GetObject( i ) != r.GetObject( i ) )
- return FALSE;
+ return sal_False;
i++;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/memtools/makefile.mk b/tools/source/memtools/makefile.mk
deleted file mode 100644
index de03a0d50cc3..000000000000
--- a/tools/source/memtools/makefile.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=mtools
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/contnr.obj \
- $(SLO)$/table.obj \
- $(SLO)$/unqidx.obj \
- $(SLO)$/mempool.obj \
- $(SLO)$/multisel.obj
-
-EXCEPTIONSFILES= $(SLO)$/multisel.obj $(OBJ)$/multisel.obj
-
-OBJFILES= $(OBJ)$/contnr.obj \
- $(OBJ)$/table.obj \
- $(OBJ)$/unqidx.obj \
- $(OBJ)$/mempool.obj \
- $(OBJ)$/multisel.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx
index 4e4886bb8ea9..006c5de7b6e0 100644..100755
--- a/tools/source/memtools/mempool.cxx
+++ b/tools/source/memtools/mempool.cxx
@@ -41,7 +41,7 @@
*************************************************************************/
FixedMemPool::FixedMemPool (
- USHORT _nTypeSize, USHORT, USHORT)
+ sal_uInt16 _nTypeSize, sal_uInt16, sal_uInt16)
{
char name[RTL_CACHE_NAME_LENGTH + 1];
snprintf (name, sizeof(name), "FixedMemPool_%d", (int)_nTypeSize);
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 6b4187de1ef3..295b8376d366 100644..100755
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -64,7 +64,7 @@ static void Print( const MultiSelection* pSel )
}
DbgOutf( "SelCount: %4ld\n", pSel->nSelCount );
DbgOutf( "SubCount: %4ld\n", pSel->aSels.Count() );
- for ( ULONG nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
+ for ( sal_uIntPtr nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
{
DbgOutf( "SubSel #%2ld: %4ld-%4ld\n", nPos,
pSel->aSels.GetObject(nPos)->Min(),
@@ -103,11 +103,11 @@ size_t MultiSelection::ImplFindSubSelection( long nIndex ) const
// -----------------------------------------------------------------------
-BOOL MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
+sal_Bool MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
{
// didn't a sub selection at nPos2 exist?
if ( nPos2 >= aSels.size() )
- return FALSE;
+ return sal_False;
// did the sub selections touch each other?
if ( (aSels[ nPos1 ]->Max() + 1) == aSels[ nPos2 ]->Min() )
@@ -118,10 +118,10 @@ BOOL MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
::std::advance( it, nPos2 );
delete *it;
aSels.erase( it );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -130,8 +130,8 @@ MultiSelection::MultiSelection():
aTotRange( 0, -1 ),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
}
@@ -141,8 +141,8 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
aTotRange(0,RANGE_MAX),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
// Dies ist nur ein Schnellschuss und sollte bald optimiert,
// an die verschiedenen Systeme (UNIX etc.)
@@ -151,8 +151,8 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
UniString aStr( rString );
sal_Unicode* pStr = aStr.GetBufferAccess();
sal_Unicode* pOld = pStr;
- BOOL bReady = FALSE;
- BOOL bUntil = FALSE;
+ sal_Bool bReady = sal_False;
+ sal_Bool bUntil = sal_False;
xub_StrLen nCut = 0;
// Hier normieren wir den String, sodass nur Ziffern,
@@ -178,11 +178,11 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = ';';
nCut++;
- bReady = FALSE;
+ bReady = sal_False;
}
*pStr++ = *pOld;
nCut++;
- bUntil = FALSE;
+ bUntil = sal_False;
break;
case '-':
@@ -194,12 +194,12 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = '-';
nCut++;
- bUntil = TRUE;
+ bUntil = sal_True;
}
- bReady = FALSE;
+ bReady = sal_False;
}
else
- bReady = TRUE;
+ bReady = sal_True;
break;
case ' ':
@@ -215,12 +215,12 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = '-';
nCut++;
- bUntil = TRUE;
+ bUntil = sal_True;
}
- bReady = FALSE;
+ bReady = sal_False;
}
else
- bReady = TRUE;
+ bReady = sal_True;
break;
}
@@ -234,7 +234,7 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
const sal_Unicode* pCStr = aStr.GetBuffer();
long nPage = 1;
long nNum = 1;
- bUntil = FALSE;
+ bUntil = sal_False;
while ( *pCStr )
{
switch ( *pCStr )
@@ -266,13 +266,13 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
Select( nNum );
nPage = 0;
aNumStr.Erase();
- bUntil = FALSE;
+ bUntil = sal_False;
break;
case '-':
nPage = aNumStr.ToInt32();
aNumStr.Erase();
- bUntil = TRUE;
+ bUntil = sal_True;
break;
}
@@ -299,7 +299,7 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) :
aTotRange(rOrig.aTotRange),
nSelCount(rOrig.nSelCount),
bCurValid(rOrig.bCurValid),
- bSelectNew(FALSE)
+ bSelectNew(sal_False)
{
if ( bCurValid )
{
@@ -318,8 +318,8 @@ MultiSelection::MultiSelection( const Range& rRange ):
aTotRange(rRange),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
}
@@ -355,24 +355,24 @@ MultiSelection& MultiSelection::operator= ( const MultiSelection& rOrig )
// -----------------------------------------------------------------------
-BOOL MultiSelection::operator== ( MultiSelection& rWith )
+sal_Bool MultiSelection::operator== ( MultiSelection& rWith )
{
if ( aTotRange != rWith.aTotRange || nSelCount != rWith.nSelCount ||
aSels.size() != rWith.aSels.size() )
- return FALSE;
+ return sal_False;
// compare the sub seletions
for ( size_t n = 0; n < aSels.size(); ++n )
if ( *aSels[ n ] != *rWith.aSels[ n ] )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void MultiSelection::SelectAll( BOOL bSelect )
+void MultiSelection::SelectAll( sal_Bool bSelect )
{
- DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "TRUE" : "FALSE" ));
+ DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "sal_True" : "sal_False" ));
ImplClear();
if ( bSelect )
@@ -386,13 +386,13 @@ void MultiSelection::SelectAll( BOOL bSelect )
// -----------------------------------------------------------------------
-BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
+sal_Bool MultiSelection::Select( long nIndex, sal_Bool bSelect )
{
DBG_ASSERT( aTotRange.IsInside(nIndex), "selected index out of range" );
// out of range?
if ( !aTotRange.IsInside(nIndex) )
- return FALSE;
+ return sal_False;
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -402,7 +402,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
// is it included in the found sub selection?
if ( nSubSelPos < aSels.size() && aSels[ nSubSelPos ]->IsInside( nIndex ) )
// already selected, nothing to do
- return FALSE;
+ return sal_False;
// it will become selected
++nSelCount;
@@ -445,7 +445,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
) {
// not selected, nothing to do
DBG(Print( this ));
- return FALSE;
+ return sal_False;
}
// it will become deselected
@@ -460,7 +460,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
delete *it;
aSels.erase( it );
DBG(Print( this ));
- return TRUE;
+ return sal_True;
}
// is it at the beginning of the found sub selection?
@@ -486,20 +486,20 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
DBG(Print( this ));
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
+void MultiSelection::Select( const Range& rIndexRange, sal_Bool bSelect )
{
Range* pRange;
long nOld;
- ULONG nTmpMin = rIndexRange.Min();
- ULONG nTmpMax = rIndexRange.Max();
- ULONG nCurMin = FirstSelected();
- ULONG nCurMax = LastSelected();
+ sal_uIntPtr nTmpMin = rIndexRange.Min();
+ sal_uIntPtr nTmpMax = rIndexRange.Max();
+ sal_uIntPtr nCurMin = FirstSelected();
+ sal_uIntPtr nCurMax = LastSelected();
DBG_ASSERT(aTotRange.IsInside(nTmpMax), "selected index out of range" );
DBG_ASSERT(aTotRange.IsInside(nTmpMin), "selected index out of range" );
@@ -533,7 +533,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
pRange->Min() = (long)nTmpMin;
nSelCount += ( nOld - nTmpMin );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
}
return;
}
@@ -556,7 +556,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
pRange->Max() = (long)nTmpMax;
nSelCount += ( nTmpMax - nOld );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
}
return;
}
@@ -571,7 +571,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
// -----------------------------------------------------------------------
-BOOL MultiSelection::IsSelected( long nIndex ) const
+sal_Bool MultiSelection::IsSelected( long nIndex ) const
{
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -629,7 +629,7 @@ void MultiSelection::Insert( long nIndex, long nCount )
}
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
aTotRange.Max() += nCount;
if ( bSelectNew )
nSelCount += nCount;
@@ -673,7 +673,7 @@ void MultiSelection::Remove( long nIndex )
--( aSels[ nPos ]->Max() );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
aTotRange.Max() -= 1;
DBG(Print( this ));
@@ -731,14 +731,14 @@ long MultiSelection::ImplBwdUnselected()
// -----------------------------------------------------------------------
-long MultiSelection::FirstSelected( BOOL bInverse )
+long MultiSelection::FirstSelected( sal_Bool bInverse )
{
bInverseCur = bInverse;
nCurSubSel = 0;
if ( bInverseCur )
{
- bCurValid = nSelCount < ULONG(aTotRange.Len());
+ bCurValid = nSelCount < sal_uIntPtr(aTotRange.Len());
if ( bCurValid )
{
nCurIndex = 0;
@@ -878,7 +878,7 @@ void MultiSelection::SetTotalRange( const Range& rTotRange )
nSelCount += pRange->Len();
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
nCurIndex = 0;
}
diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx
index 5e38574464f3..75119ba6f142 100644..100755
--- a/tools/source/memtools/table.cxx
+++ b/tools/source/memtools/table.cxx
@@ -38,16 +38,16 @@
// =======================================================================
-ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
+sal_uIntPtr Table::ImplGetIndex( sal_uIntPtr nKey, sal_uIntPtr* pIndex ) const
{
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
- if ( !nCount || (nKey < (ULONG)Container::ImpGetObject(0)) )
+ if ( !nCount || (nKey < (sal_uIntPtr)Container::ImpGetObject(0)) )
return TABLE_ENTRY_NOTFOUND;
- ULONG nLow;
- ULONG nHigh;
- ULONG nMid;
- ULONG nCompareKey;
+ sal_uIntPtr nLow;
+ sal_uIntPtr nHigh;
+ sal_uIntPtr nMid;
+ sal_uIntPtr nCompareKey;
void** pNodes = Container::ImpGetOnlyNodes();
// Binaeres Suchen
@@ -58,7 +58,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
do
{
nMid = (nLow + nHigh) / 2;
- nCompareKey = (ULONG)pNodes[nMid*2];
+ nCompareKey = (sal_uIntPtr)pNodes[nMid*2];
if ( nKey < nCompareKey )
nHigh = nMid-1;
else
@@ -76,7 +76,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
do
{
nMid = (nLow + nHigh) / 2;
- nCompareKey = (ULONG)Container::ImpGetObject( nMid*2 );
+ nCompareKey = (sal_uIntPtr)Container::ImpGetObject( nMid*2 );
if ( nKey < nCompareKey )
nHigh = nMid-1;
else
@@ -103,7 +103,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
// =======================================================================
-Table::Table( USHORT _nInitSize, USHORT _nReSize ) :
+Table::Table( sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
Container( CONTAINER_MAXBLOCKSIZE, _nInitSize*2, _nReSize*2 )
{
DBG_ASSERT( _nInitSize <= 32767, "Table::Table(): InitSize > 32767" );
@@ -113,26 +113,26 @@ Table::Table( USHORT _nInitSize, USHORT _nReSize ) :
// -----------------------------------------------------------------------
-BOOL Table::Insert( ULONG nKey, void* p )
+sal_Bool Table::Insert( sal_uIntPtr nKey, void* p )
{
// Tabellenelement einsortieren
- ULONG i;
+ sal_uIntPtr i;
if ( nCount )
{
if ( nCount <= 24 )
{
- USHORT n = 0;
- USHORT nTempCount = (USHORT)nCount * 2;
+ sal_uInt16 n = 0;
+ sal_uInt16 nTempCount = (sal_uInt16)nCount * 2;
if( void** pNodes = Container::ImpGetOnlyNodes() )
{
- ULONG nCompareKey = (ULONG)(*pNodes);
+ sal_uIntPtr nCompareKey = (sal_uIntPtr)(*pNodes);
while ( nKey > nCompareKey )
{
n += 2;
pNodes += 2;
if ( n < nTempCount )
- nCompareKey = (ULONG)(*pNodes);
+ nCompareKey = (sal_uIntPtr)(*pNodes);
else
{
nCompareKey = 0;
@@ -142,7 +142,7 @@ BOOL Table::Insert( ULONG nKey, void* p )
// Testen, ob sich der Key schon in der Tabelle befindet
if ( nKey == nCompareKey )
- return FALSE;
+ return sal_False;
i = n;
}
@@ -150,14 +150,14 @@ BOOL Table::Insert( ULONG nKey, void* p )
{
i = 0;
if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
- return FALSE;
+ return sal_False;
}
}
else
{
i = 0;
if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
- return FALSE;
+ return sal_False;
}
}
else
@@ -170,15 +170,15 @@ BOOL Table::Insert( ULONG nKey, void* p )
// Ein neuer Eintrag
nCount++;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void* Table::Remove( ULONG nKey )
+void* Table::Remove( sal_uIntPtr nKey )
{
// Index besorgen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Testen, ob sich der Key in der Tabelle befindet
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -196,10 +196,10 @@ void* Table::Remove( ULONG nKey )
// -----------------------------------------------------------------------
-void* Table::Replace( ULONG nKey, void* p )
+void* Table::Replace( sal_uIntPtr nKey, void* p )
{
// Index abfragen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Existiert kein Eintrag mit dem Schluessel
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -210,10 +210,10 @@ void* Table::Replace( ULONG nKey, void* p )
// -----------------------------------------------------------------------
-void* Table::Get( ULONG nKey ) const
+void* Table::Get( sal_uIntPtr nKey ) const
{
// Index besorgen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Testen, ob sich der Key in der Tabelle befindet
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -231,16 +231,16 @@ void* Table::GetCurObject() const
// -----------------------------------------------------------------------
-ULONG Table::GetKey( const void* p ) const
+sal_uIntPtr Table::GetKey( const void* p ) const
{
- ULONG nIndex = 0;
+ sal_uIntPtr nIndex = 0;
// Solange noch Eintraege Vorhanden sind
while ( nIndex < nCount )
{
// Stimmt der Pointer ueberein, wird der Key zurueckgegeben
if ( p == Container::ImpGetObject( (nIndex*2)+1 ) )
- return (ULONG)Container::ImpGetObject( nIndex*2 );
+ return (sal_uIntPtr)Container::ImpGetObject( nIndex*2 );
nIndex++;
}
@@ -250,14 +250,14 @@ ULONG Table::GetKey( const void* p ) const
// -----------------------------------------------------------------------
-BOOL Table::IsKeyValid( ULONG nKey ) const
+sal_Bool Table::IsKeyValid( sal_uIntPtr nKey ) const
{
- return (ImplGetIndex( nKey ) != TABLE_ENTRY_NOTFOUND) ? TRUE : FALSE;
+ return (ImplGetIndex( nKey ) != TABLE_ENTRY_NOTFOUND) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-ULONG Table::GetUniqueKey( ULONG nStartKey ) const
+sal_uIntPtr Table::GetUniqueKey( sal_uIntPtr nStartKey ) const
{
DBG_ASSERT( (nStartKey > 1) && (nStartKey < 0xFFFFFFFF),
"Table::GetUniqueKey() - nStartKey == 0 or nStartKey >= 0xFFFFFFFF" );
@@ -265,7 +265,7 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
if ( !nCount )
return nStartKey;
- ULONG nLastKey = (ULONG)Container::GetObject( (nCount*2)-2 );
+ sal_uIntPtr nLastKey = (sal_uIntPtr)Container::GetObject( (nCount*2)-2 );
if ( nLastKey < nStartKey )
return nStartKey;
else
@@ -274,18 +274,18 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
return nLastKey+1;
else
{
- ULONG nPos;
- ULONG nTempPos = ImplGetIndex( nStartKey, &nPos );
+ sal_uIntPtr nPos;
+ sal_uIntPtr nTempPos = ImplGetIndex( nStartKey, &nPos );
if ( nTempPos != TABLE_ENTRY_NOTFOUND )
nPos = nTempPos;
- nLastKey = (ULONG)Container::GetObject( nPos );
+ nLastKey = (sal_uIntPtr)Container::GetObject( nPos );
if ( nStartKey < nLastKey )
return nStartKey;
while ( nLastKey < 0xFFFFFFFE )
{
nPos += 2;
nLastKey++;
- if ( nLastKey != (ULONG)Container::GetObject( nPos ) )
+ if ( nLastKey != (sal_uIntPtr)Container::GetObject( nPos ) )
return nLastKey;
}
}
@@ -296,10 +296,10 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
// -----------------------------------------------------------------------
-ULONG Table::SearchKey( ULONG nKey, ULONG* pPos ) const
+sal_uIntPtr Table::SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos ) const
{
*pPos = 0;
- ULONG nPos = ImplGetIndex( nKey, pPos );
+ sal_uIntPtr nPos = ImplGetIndex( nKey, pPos );
if ( nPos != TABLE_ENTRY_NOTFOUND )
{
nPos /= 2;
@@ -312,12 +312,12 @@ ULONG Table::SearchKey( ULONG nKey, ULONG* pPos ) const
// -----------------------------------------------------------------------
-void* Table::Seek( ULONG nKey )
+void* Table::Seek( sal_uIntPtr nKey )
{
// Testen, ob ein Eintrag vorhanden ist
if ( nCount )
{
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Ist Key nicht enthalten
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -339,7 +339,7 @@ void* Table::Seek( ULONG nKey )
void* Table::Seek( void* p )
{
- ULONG nKey = GetKey( p );
+ sal_uIntPtr nKey = GetKey( p );
// Ist Key vorhanden, dann als aktuellen Eintrag setzen
if ( nKey != TABLE_ENTRY_NOTFOUND )
diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx
index b4b733f9452b..278199333e37 100644..100755
--- a/tools/source/memtools/unqidx.cxx
+++ b/tools/source/memtools/unqidx.cxx
@@ -38,8 +38,8 @@
|*
*************************************************************************/
-UniqueIndex::UniqueIndex( ULONG _nStartIndex,
- ULONG _nInitSize, ULONG _nReSize ) :
+UniqueIndex::UniqueIndex( sal_uIntPtr _nStartIndex,
+ sal_uIntPtr _nInitSize, sal_uIntPtr _nReSize ) :
Container( _nInitSize )
{
nReSize = _nReSize;
@@ -69,7 +69,7 @@ UniqueIndex::UniqueIndex( const UniqueIndex& rIdx ) :
|*
*************************************************************************/
-ULONG UniqueIndex::Insert( void* p )
+sal_uIntPtr UniqueIndex::Insert( void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
@@ -101,13 +101,13 @@ ULONG UniqueIndex::Insert( void* p )
|*
*************************************************************************/
-ULONG UniqueIndex::Insert( ULONG nIndex, void* p )
+sal_uIntPtr UniqueIndex::Insert( sal_uIntPtr nIndex, void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
return UNIQUEINDEX_ENTRY_NOTFOUND;
- ULONG nContIndex = nIndex - nStartIndex;
+ sal_uIntPtr nContIndex = nIndex - nStartIndex;
// Ist Array voll, dann expandieren
if ( nContIndex >= Container::GetSize() )
SetSize( nContIndex + nReSize );
@@ -126,7 +126,7 @@ ULONG UniqueIndex::Insert( ULONG nIndex, void* p )
|*
*************************************************************************/
-void* UniqueIndex::Remove( ULONG nIndex )
+void* UniqueIndex::Remove( sal_uIntPtr nIndex )
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -149,7 +149,7 @@ void* UniqueIndex::Remove( ULONG nIndex )
|*
*************************************************************************/
-void* UniqueIndex::Replace( ULONG nIndex, void* p )
+void* UniqueIndex::Replace( sal_uIntPtr nIndex, void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
@@ -171,7 +171,7 @@ void* UniqueIndex::Replace( ULONG nIndex, void* p )
|*
*************************************************************************/
-void* UniqueIndex::Get( ULONG nIndex ) const
+void* UniqueIndex::Get( sal_uIntPtr nIndex ) const
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -187,9 +187,9 @@ void* UniqueIndex::Get( ULONG nIndex ) const
|*
*************************************************************************/
-ULONG UniqueIndex::GetCurIndex() const
+sal_uIntPtr UniqueIndex::GetCurIndex() const
{
- ULONG nPos = Container::GetCurPos();
+ sal_uIntPtr nPos = Container::GetCurPos();
// Ist der Current-Index nicht belegt, dann gibt es keinen Current-Index
if ( !Container::ImpGetObject( nPos ) )
@@ -204,13 +204,13 @@ ULONG UniqueIndex::GetCurIndex() const
|*
*************************************************************************/
-ULONG UniqueIndex::GetIndex( const void* p ) const
+sal_uIntPtr UniqueIndex::GetIndex( const void* p ) const
{
// Wird ein NULL-Pointer uebergeben, dann wurde Pointer nicht gefunden
if ( !p )
return UNIQUEINDEX_ENTRY_NOTFOUND;
- ULONG nIndex = Container::GetPos( p );
+ sal_uIntPtr nIndex = Container::GetPos( p );
if ( nIndex != CONTAINER_ENTRY_NOTFOUND )
return nIndex+nStartIndex;
@@ -224,7 +224,7 @@ ULONG UniqueIndex::GetIndex( const void* p ) const
|*
*************************************************************************/
-BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
+sal_Bool UniqueIndex::IsIndexValid( sal_uIntPtr nIndex ) const
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -232,12 +232,12 @@ BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
{
// Index ist nur zulaessig, wenn Eintrag auch belegt ist
if ( Container::ImpGetObject( nIndex-nStartIndex ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -246,7 +246,7 @@ BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
|*
*************************************************************************/
-void* UniqueIndex::Seek( ULONG nIndex )
+void* UniqueIndex::Seek( sal_uIntPtr nIndex )
{
// Index-Eintrag als aktuellen setzten, wenn er gueltig ist
if ( IsIndexValid( nIndex ) )
@@ -267,7 +267,7 @@ void* UniqueIndex::Seek( void* p )
if ( !p )
return NULL;
- ULONG nIndex = GetIndex( p );
+ sal_uIntPtr nIndex = GetIndex( p );
// Ist Index vorhanden, dann als aktuellen Eintrag setzen
if ( nIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
@@ -363,15 +363,15 @@ UniqueIndex& UniqueIndex::operator =( const UniqueIndex& rIdx )
|*
*************************************************************************/
-BOOL UniqueIndex::operator ==( const UniqueIndex& rIdx ) const
+sal_Bool UniqueIndex::operator ==( const UniqueIndex& rIdx ) const
{
// Neue Werte zuweisen
if ( (nStartIndex == rIdx.nStartIndex) &&
(nCount == rIdx.nCount) &&
(Container::operator ==( rIdx )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|*
@@ -383,7 +383,7 @@ UniqueIdContainer::UniqueIdContainer( const UniqueIdContainer& rObj )
: UniqueIndex( rObj )
, nCollectCount( rObj.nCollectCount )
{
- ULONG nCur = GetCurIndex();
+ sal_uIntPtr nCur = GetCurIndex();
ImpUniqueId * pEle = (ImpUniqueId *)First();
while( pEle )
@@ -405,7 +405,7 @@ UniqueIdContainer& UniqueIdContainer::operator = ( const UniqueIdContainer & rOb
UniqueIndex::operator = ( rObj );
nCollectCount = rObj.nCollectCount;
- ULONG nCur = GetCurIndex();
+ sal_uIntPtr nCur = GetCurIndex();
ImpUniqueId * pEle = (ImpUniqueId *)First();
while( pEle )
@@ -423,12 +423,12 @@ UniqueIdContainer& UniqueIdContainer::operator = ( const UniqueIdContainer & rOb
|*
*************************************************************************/
-void UniqueIdContainer::Clear( BOOL bAll )
+void UniqueIdContainer::Clear( sal_Bool bAll )
{
- USHORT nFree = bAll ? 0xFFFF : 1;
+ sal_uInt16 nFree = bAll ? 0xFFFF : 1;
ImpUniqueId* pId = (ImpUniqueId*)Last();
- BOOL bLast = TRUE;
+ sal_Bool bLast = sal_True;
while ( pId )
{
if ( pId->nRefCount <= nFree )
@@ -442,7 +442,7 @@ void UniqueIdContainer::Clear( BOOL bAll )
else
{
pId = (ImpUniqueId *)Prev();
- bLast = FALSE;
+ bLast = sal_False;
}
}
}
@@ -457,7 +457,7 @@ UniqueItemId UniqueIdContainer::CreateId()
{
if( nCollectCount > 50 )
{ // aufraeumen
- Clear( FALSE );
+ Clear( sal_False );
nCollectCount = 0;
}
nCollectCount++;
@@ -474,7 +474,7 @@ UniqueItemId UniqueIdContainer::CreateId()
|*
*************************************************************************/
-UniqueItemId UniqueIdContainer::CreateFreeId( ULONG nId )
+UniqueItemId UniqueIdContainer::CreateFreeId( sal_uIntPtr nId )
{
// Einfach erzeugen, fuer abgeleitete Klasse
ImpUniqueId * pId = new ImpUniqueId;
@@ -489,7 +489,7 @@ UniqueItemId UniqueIdContainer::CreateFreeId( ULONG nId )
|*
*************************************************************************/
-UniqueItemId UniqueIdContainer::CreateIdProt( ULONG nId )
+UniqueItemId UniqueIdContainer::CreateIdProt( sal_uIntPtr nId )
{
if ( IsIndexValid( nId ) )
return UniqueItemId( (ImpUniqueId *)Get( nId ) );
diff --git a/tools/source/misc/makefile.mk b/tools/source/misc/makefile.mk
deleted file mode 100644
index a426bb4053c3..000000000000
--- a/tools/source/misc/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-PRJNAME = tools
-TARGET = misc
-LIBTARGET = NO
-ENABLE_EXCEPTIONS = TRUE
-
-.INCLUDE: settings.mk
-.INCLUDE: $(PRJ)$/util$/makefile.pmk
-
-LIB1TARGET = $(SLB)$/$(TARGET).lib
-LIB1OBJFILES = \
- $(SLO)$/appendunixshellword.obj \
- $(SLO)$/extendapplicationenvironment.obj \
- $(SLO)$/solarmutex.obj \
- $(SLO)$/getprocessworkingdir.obj
-
-OBJFILES = $(OBJ)$/pathutils.obj
-SLOFILES = $(SLO)$/pathutils.obj $(LIB1OBJFILES) $(SLO)$/solarmutex.obj
-
-.INCLUDE: target.mk
diff --git a/tools/source/misc/pathutils.cxx b/tools/source/misc/pathutils.cxx
index 387abd397efb..0f0d0b767356 100644
--- a/tools/source/misc/pathutils.cxx
+++ b/tools/source/misc/pathutils.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-#include "precompiled_tools.hxx"
#include "sal/config.h"
#if defined WNT
diff --git a/tools/source/rc/makefile.mk b/tools/source/rc/makefile.mk
deleted file mode 100644
index f8b46f38a0f7..000000000000
--- a/tools/source/rc/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=rc
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/rc.obj \
- $(SLO)$/isofallback.obj \
- $(SLO)$/resmgr.obj \
- $(SLO)$/resary.obj
-
-OBJFILES= $(OBJ)$/rc.obj \
- $(OBJ)$/isofallback.obj \
- $(OBJ)$/resmgr.obj \
- $(OBJ)$/resary.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/rc/rc.cxx b/tools/source/rc/rc.cxx
index face720c701a..e2ada0d111ac 100644
--- a/tools/source/rc/rc.cxx
+++ b/tools/source/rc/rc.cxx
@@ -66,16 +66,16 @@ Time::Time( const ResId& rResId )
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
- ULONG nObjMask = (USHORT)pResMgr->ReadLong();
+ sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
- SetHour( (USHORT)pResMgr->ReadShort() );
+ SetHour( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
- SetMin( (USHORT)pResMgr->ReadShort() );
+ SetMin( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
- SetSec( (USHORT)pResMgr->ReadShort() );
+ SetSec( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x08 & nObjMask )
- Set100Sec( (USHORT)pResMgr->ReadShort() );
+ Set100Sec( (sal_uInt16)pResMgr->ReadShort() );
}
// =======================================================================
@@ -87,14 +87,14 @@ Date::Date( const ResId& rResId ) : nDate(0)
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
- ULONG nObjMask = (USHORT)pResMgr->ReadLong();
+ sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
- SetYear( (USHORT)pResMgr->ReadShort() );
+ SetYear( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
- SetMonth( (USHORT)pResMgr->ReadShort() );
+ SetMonth( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
- SetDay( (USHORT)pResMgr->ReadShort() );
+ SetDay( (sal_uInt16)pResMgr->ReadShort() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index d0b63c9ab027..d68b71f255ae 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -45,6 +45,7 @@
#include <osl/mutex.hxx>
#include <osl/signal.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <rtl/instance.hxx>
#include <rtl/bootstrap.hxx>
@@ -97,11 +98,11 @@ class InternalResMgr
friend class ResMgrContainer;
ImpContent * pContent;
- UINT32 nOffCorrection;
- BYTE * pStringBlock;
+ sal_uInt32 nOffCorrection;
+ sal_uInt8 * pStringBlock;
SvStream * pStm;
- BOOL bEqual2Content;
- UINT32 nEntries;
+ sal_Bool bEqual2Content;
+ sal_uInt32 nEntries;
OUString aFileName;
OUString aPrefix;
OUString aResName;
@@ -114,9 +115,9 @@ class InternalResMgr
const OUString& aResName,
const com::sun::star::lang::Locale& rLocale );
~InternalResMgr();
- BOOL Create();
+ sal_Bool Create();
- BOOL IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const;
+ sal_Bool IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const;
void * LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
void **pResHandle );
public:
@@ -551,7 +552,7 @@ InternalResMgr::InternalResMgr( const OUString& rFileURL,
: pContent( NULL )
, pStringBlock( NULL )
, pStm( NULL )
- , bEqual2Content( TRUE )
+ , bEqual2Content( sal_True )
, nEntries( 0 )
, aFileName( rFileURL )
, aPrefix( rPrefix )
@@ -602,15 +603,15 @@ InternalResMgr::~InternalResMgr()
// -----------------------------------------------------------------------
-BOOL InternalResMgr::Create()
+sal_Bool InternalResMgr::Create()
{
ResMgrContainer::get();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
pStm = new SvFileStream( aFileName, (STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE) );
if( pStm->GetError() == 0 )
{
- INT32 lContLen = 0;
+ sal_Int32 lContLen = 0;
pStm->Seek( STREAM_SEEK_TO_END );
/*
@@ -624,15 +625,15 @@ BOOL InternalResMgr::Create()
lContLen = ResMgr::GetLong( &lContLen );
pStm->SeekRel( -lContLen );
// allocate stored ImpContent data (12 bytes per unit)
- BYTE* pContentBuf = (BYTE*)rtl_allocateMemory( lContLen );
+ sal_uInt8* pContentBuf = (sal_uInt8*)rtl_allocateMemory( lContLen );
pStm->Read( pContentBuf, lContLen );
// allocate ImpContent space (sizeof(ImpContent) per unit, not necessarily 12)
pContent = (ImpContent *)rtl_allocateMemory( sizeof(ImpContent)*lContLen/12 );
// Auf die Anzahl der ImpContent k�rzen
- nEntries = (UINT32)lContLen / 12;
- bEqual2Content = TRUE; // Die Daten der Resourcen liegen
+ nEntries = (sal_uInt32)lContLen / 12;
+ bEqual2Content = sal_True; // Die Daten der Resourcen liegen
// genauso wie das Inhaltsverzeichnis
- BOOL bSorted = TRUE;
+ sal_Bool bSorted = sal_True;
if( nEntries )
{
#ifdef DBG_UTIL
@@ -654,10 +655,10 @@ BOOL InternalResMgr::Create()
pContent[j].nTypeAndId = ResMgr::GetUInt64( pContentBuf + (12*j) );
pContent[j].nOffset = ResMgr::GetLong( pContentBuf + (12*j+8) );
if( pContent[i].nTypeAndId >= pContent[j].nTypeAndId )
- bSorted = FALSE;
+ bSorted = sal_False;
if( (pContent[i].nTypeAndId & 0xFFFFFFFF00000000LL) == (pContent[j].nTypeAndId & 0xFFFFFFFF00000000LL)
&& pContent[i].nOffset >= pContent[j].nOffset )
- bEqual2Content = FALSE;
+ bEqual2Content = sal_False;
}
}
rtl_freeMemory( pContentBuf );
@@ -669,7 +670,7 @@ BOOL InternalResMgr::Create()
::std::sort(pContent,pContent+nEntries,ImpContentLessCompare());
// qsort( pContent, nEntries, sizeof( ImpContent ), Compare );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
@@ -677,7 +678,7 @@ BOOL InternalResMgr::Create()
// -----------------------------------------------------------------------
-BOOL InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const
+sal_Bool InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const
{
// Anfang der Strings suchen
sal_uInt64 nValue = ((sal_uInt64(nRT) << 32) | nId);
@@ -719,18 +720,18 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
while( pLast < pEnd && (pLast->nTypeAndId >> 32) == RSC_STRING )
++pLast;
nOffCorrection = pFirst->nOffset;
- UINT32 nSize;
+ sal_uInt32 nSize;
--pLast;
pStm->Seek( pLast->nOffset );
RSHEADER_TYPE aHdr;
pStm->Read( &aHdr, sizeof( aHdr ) );
nSize = pLast->nOffset + aHdr.GetGlobOff() - nOffCorrection;
- pStringBlock = (BYTE*)rtl_allocateMemory( nSize );
+ pStringBlock = (sal_uInt8*)rtl_allocateMemory( nSize );
pStm->Seek( pFirst->nOffset );
pStm->Read( pStringBlock, nSize );
}
*pResHandle = pStringBlock;
- return (BYTE*)pStringBlock + pFind->nOffset - nOffCorrection;
+ return (sal_uInt8*)pStringBlock + pFind->nOffset - nOffCorrection;
} // if( nRT == RSC_STRING && bEqual2Content )
else
{
@@ -740,7 +741,7 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
pStm->Read( &aHeader, sizeof( RSHEADER_TYPE ) );
void * pRes = rtl_allocateMemory( aHeader.GetGlobOff() );
memcpy( pRes, &aHeader, sizeof( RSHEADER_TYPE ) );
- pStm->Read( (BYTE*)pRes + sizeof( RSHEADER_TYPE ),
+ pStm->Read( (sal_uInt8*)pRes + sizeof( RSHEADER_TYPE ),
aHeader.GetGlobOff() - sizeof( RSHEADER_TYPE ) );
return pRes;
}
@@ -766,12 +767,12 @@ void InternalResMgr::FreeGlobalRes( void * pResHandle, void * pResource )
UniString GetTypeRes_Impl( const ResId& rTypeId )
{
// Funktion verlassen, falls Resourcefehler in dieser Funktion
- static int bInUse = FALSE;
+ static int bInUse = sal_False;
UniString aTypStr( UniString::CreateFromInt32( rTypeId.GetId() ) );
if ( !bInUse )
{
- bInUse = TRUE;
+ bInUse = sal_True;
ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
aResId.SetRT( RSC_VERSIONCONTROL );
@@ -786,7 +787,7 @@ UniString GetTypeRes_Impl( const ResId& rTypeId )
rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) );
}
}
- bInUse = FALSE;
+ bInUse = sal_False;
}
return aTypStr;
@@ -899,14 +900,14 @@ static RSHEADER_TYPE* LocalResource( const ImpRCStack* pStack,
if ( pStack->pResource && pStack->pClassRes )
{
pTmp = (RSHEADER_TYPE*)
- ((BYTE*)pStack->pResource + pStack->pResource->GetLocalOff());
+ ((sal_uInt8*)pStack->pResource + pStack->pResource->GetLocalOff());
pEnd = (RSHEADER_TYPE*)
- ((BYTE*)pStack->pResource + pStack->pResource->GetGlobOff());
+ ((sal_uInt8*)pStack->pResource + pStack->pResource->GetGlobOff());
while ( pTmp != pEnd )
{
if ( pTmp->GetRT() == nRTType && pTmp->GetId() == nId )
return pTmp;
- pTmp = (RSHEADER_TYPE*)((BYTE*)pTmp + pTmp->GetGlobOff());
+ pTmp = (RSHEADER_TYPE*)((sal_uInt8*)pTmp + pTmp->GetGlobOff());
}
}
@@ -1073,11 +1074,11 @@ void ResMgr::TestStack( const Resource* )
#endif
// -----------------------------------------------------------------------
-BOOL ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
+sal_Bool ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
- BOOL bAvailable = FALSE;
+ sal_Bool bAvailable = sal_False;
RSHEADER_TYPE* pClassRes = rId.GetpResource();
RESOURCE_TYPE nRT = rId.GetRT2();
sal_uInt32 nId = rId.GetId();
@@ -1100,7 +1101,7 @@ BOOL ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
if ( pClassRes )
{
if ( pClassRes->GetRT() == nRT )
- bAvailable = TRUE;
+ bAvailable = sal_True;
}
}
@@ -1125,7 +1126,7 @@ void* ResMgr::GetClass()
// -----------------------------------------------------------------------
-BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
+sal_Bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
@@ -1170,7 +1171,7 @@ BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
pTop->Flags |= RC_NOTFOUND;
pTop->pClassRes = getEmptyBuffer();
pTop->pResource = (RSHEADER_TYPE*)pTop->pClassRes;
- return FALSE;
+ return sal_False;
}
}
else
@@ -1216,12 +1217,12 @@ BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
pTop->Flags |= RC_NOTFOUND;
pTop->pClassRes = getEmptyBuffer();
pTop->pResource = (RSHEADER_TYPE*)pTop->pClassRes;
- return FALSE;
+ return sal_False;
}
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1270,7 +1271,7 @@ void ResMgr::PopContext( const Resource* pResObj )
#ifdef DBG_UTIL
if ( DbgIsResource() && !(pTop->Flags & RC_NOTFOUND) )
{
- void* pRes = (BYTE*)pTop->pResource +
+ void* pRes = (sal_uInt8*)pTop->pResource +
pTop->pResource->GetLocalOff();
if ( pTop->pClassRes != pRes )
@@ -1322,7 +1323,7 @@ RSHEADER_TYPE* ResMgr::CreateBlock( const ResId& rId )
// ------------------------------------------------------------------
-INT16 ResMgr::GetShort( void * pShort )
+sal_Int16 ResMgr::GetShort( void * pShort )
{
return ((*((sal_uInt8*)pShort + 0) << 8) |
(*((sal_uInt8*)pShort + 1) << 0) );
@@ -1330,7 +1331,7 @@ INT16 ResMgr::GetShort( void * pShort )
// ------------------------------------------------------------------
-INT32 ResMgr::GetLong( void * pLong )
+sal_Int32 ResMgr::GetLong( void * pLong )
{
return ((*((sal_uInt8*)pLong + 0) << 24) |
(*((sal_uInt8*)pLong + 1) << 16) |
@@ -1353,9 +1354,10 @@ sal_uInt64 ResMgr::GetUInt64( void* pDatum )
}
// -----------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const sal_uInt8* pStr )
{
- sal_uInt32 nRet = GetStringSize( pStr );
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8,
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
@@ -1364,7 +1366,7 @@ sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
return nRet;
}
-sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
+sal_uInt32 ResMgr::GetString( UniString& rStr, const sal_uInt8* pStr )
{
UniString aString;
sal_uInt32 nRet = GetStringWithoutHook( aString, pStr );
@@ -1374,11 +1376,20 @@ sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
return nRet;
}
+sal_uInt32 ResMgr::GetByteString( rtl::OString& rStr, const sal_uInt8* pStr )
+{
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
+ rStr = rtl::OString( (const sal_Char*)pStr, nLen );
+ return nRet;
+}
+
// ------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringSize( const sal_uInt8* pStr, sal_uInt32& nLen )
{
- return GetStringSize( strlen( (const char*)pStr ) );
+ nLen = static_cast< sal_uInt32 >( strlen( (const char*)pStr ) );
+ return GetStringSize( nLen );
}
// -----------------------------------------------------------------------
@@ -1391,9 +1402,9 @@ sal_uInt32 ResMgr::GetRemainSize()
return pFallbackResMgr->GetRemainSize();
const ImpRCStack& rTop = aStack[nCurStack];
- return (sal_uInt32)((long)(BYTE *)rTop.pResource +
+ return (sal_uInt32)((long)(sal_uInt8 *)rTop.pResource +
rTop.pResource->GetLocalOff() -
- (long)(BYTE *)rTop.pClassRes);
+ (long)(sal_uInt8 *)rTop.pClassRes);
}
// -----------------------------------------------------------------------
@@ -1409,7 +1420,7 @@ void* ResMgr::Increment( sal_uInt32 nSize )
if( (rStack.Flags & RC_NOTFOUND) )
return rStack.pClassRes;
- BYTE* pClassRes = (BYTE*)rStack.pClassRes + nSize;
+ sal_uInt8* pClassRes = (sal_uInt8*)rStack.pClassRes + nSize;
rStack.pClassRes = pClassRes;
@@ -1500,7 +1511,7 @@ ResMgr* ResMgr::CreateFallbackResMgr( const ResId& rId, const Resource* pResourc
//
//---------------------------------------------------------------------------
-const char* ResMgr::GetLang( LanguageType& nType, USHORT nPrio )
+const char* ResMgr::GetLang( LanguageType& nType, sal_uInt16 nPrio )
{
if ( nType == LANGUAGE_SYSTEM || nType == LANGUAGE_DONTKNOW )
nType = MsLangId::getSystemUILanguage();
@@ -1711,29 +1722,29 @@ ResMgr* ResMgr::SearchCreateResMgr(
// -----------------------------------------------------------------------
-INT16 ResMgr::ReadShort()
+sal_Int16 ResMgr::ReadShort()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->ReadShort();
- INT16 n = GetShort( GetClass() );
- Increment( sizeof( INT16 ) );
+ sal_Int16 n = GetShort( GetClass() );
+ Increment( sizeof( sal_Int16 ) );
return n;
}
// -----------------------------------------------------------------------
-INT32 ResMgr::ReadLong()
+sal_Int32 ResMgr::ReadLong()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->ReadLong();
- INT32 n = GetLong( GetClass() );
- Increment( sizeof( INT32 ) );
+ sal_Int32 n = GetLong( GetClass() );
+ Increment( sizeof( sal_Int32 ) );
return n;
}
@@ -1756,7 +1767,7 @@ UniString ResMgr::ReadStringWithoutHook()
#endif
}
else
- Increment( GetStringWithoutHook( aRet, (const BYTE*)GetClass() ) );
+ Increment( GetStringWithoutHook( aRet, (const sal_uInt8*)GetClass() ) );
return aRet;
}
@@ -1769,90 +1780,125 @@ UniString ResMgr::ReadString()
return aRet;
}
+rtl::OString ResMgr::ReadByteString()
+{
+ osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
+
+ if( pFallbackResMgr )
+ return pFallbackResMgr->ReadByteString();
+
+ rtl::OString aRet;
+
+ const ImpRCStack& rTop = aStack[nCurStack];
+ if( (rTop.Flags & RC_NOTFOUND) )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ aRet = OString( "<resource not found>" );
+ #endif
+ }
+ else
+ Increment( GetByteString( aRet, (const sal_uInt8*)GetClass() ) );
+
+ return aRet;
+}
+
// -----------------------------------------------------------------------
-ULONG ResMgr::GetAutoHelpId()
+rtl::OString ResMgr::GetAutoHelpId()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->GetAutoHelpId();
- DBG_ASSERT( nCurStack, "resource stack empty in Auto help id generation" );
+ OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
if( nCurStack < 1 || nCurStack > 2 )
- return 0;
-
- const ImpRCStack *pRC = StackTop( nCurStack==1 ? 0 : 1 );
-
- DBG_ASSERT( pRC->pResource, "MM hat gesagt, dass der immer einen hat" );
- ULONG nGID = pRC->pResource->GetId();
-
- if( !nGID || nGID > 32767 )
- return 0;
-
- ULONG nHID = 0;
-
- // GGGg gggg::gggg gggg::ggLL LLLl::llll llll
- switch( pRC->pResource->GetRT() ) { // maximal 7
- case RSC_DOCKINGWINDOW:
- nHID += 0x20000000L;
- case RSC_WORKWIN:
- nHID += 0x20000000L;
- case RSC_MODELESSDIALOG:
- nHID += 0x20000000L;
- case RSC_FLOATINGWINDOW:
- nHID += 0x20000000L;
- case RSC_MODALDIALOG:
- nHID += 0x20000000L;
- case RSC_TABPAGE:
- nHID += 0x20000000L;
-
- if( nCurStack == 2 ) {
- pRC = StackTop();
- ULONG nLID = pRC->pResource->GetId();
-
- if( !nLID || nLID > 511 )
- return 0;
-
- switch( pRC->pResource->GetRT() ) { // maximal 32
- case RSC_TABCONTROL: nHID |= 0x0000; break;
- case RSC_RADIOBUTTON: nHID |= 0x0200; break;
- case RSC_CHECKBOX: nHID |= 0x0400; break;
- case RSC_TRISTATEBOX: nHID |= 0x0600; break;
- case RSC_EDIT: nHID |= 0x0800; break;
- case RSC_MULTILINEEDIT: nHID |= 0x0A00; break;
- case RSC_MULTILISTBOX: nHID |= 0x0C00; break;
- case RSC_LISTBOX: nHID |= 0x0E00; break;
- case RSC_COMBOBOX: nHID |= 0x1000; break;
- case RSC_PUSHBUTTON: nHID |= 0x1200; break;
- case RSC_SPINFIELD: nHID |= 0x1400; break;
- case RSC_PATTERNFIELD: nHID |= 0x1600; break;
- case RSC_NUMERICFIELD: nHID |= 0x1800; break;
- case RSC_METRICFIELD: nHID |= 0x1A00; break;
- case RSC_CURRENCYFIELD: nHID |= 0x1C00; break;
- case RSC_DATEFIELD: nHID |= 0x1E00; break;
- case RSC_TIMEFIELD: nHID |= 0x2000; break;
- case RSC_IMAGERADIOBUTTON: nHID |= 0x2200; break;
- case RSC_NUMERICBOX: nHID |= 0x2400; break;
- case RSC_METRICBOX: nHID |= 0x2600; break;
- case RSC_CURRENCYBOX: nHID |= 0x2800; break;
- case RSC_DATEBOX: nHID |= 0x2A00; break;
- case RSC_TIMEBOX: nHID |= 0x2C00; break;
- case RSC_IMAGEBUTTON: nHID |= 0x2E00; break;
- case RSC_MENUBUTTON: nHID |= 0x3000; break;
- case RSC_MOREBUTTON: nHID |= 0x3200; break;
+ return rtl::OString();
+
+ // prepare HID, start with resource prefix
+ rtl::OStringBuffer aHID( 32 );
+ aHID.append( rtl::OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
+ aHID.append( '.' );
+
+ // append type
+ const ImpRCStack *pRC = StackTop();
+ OSL_ENSURE( pRC, "missing resource stack level" );
+
+ if ( nCurStack == 1 )
+ {
+ // auto help ids for top level windows
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW: aHID.append( "DockingWindow" ); break;
+ case RSC_WORKWIN: aHID.append( "WorkWindow" ); break;
+ case RSC_MODELESSDIALOG: aHID.append( "ModelessDialog" ); break;
+ case RSC_FLOATINGWINDOW: aHID.append( "FloatingWindow" ); break;
+ case RSC_MODALDIALOG: aHID.append( "ModalDialog" ); break;
+ case RSC_TABPAGE: aHID.append( "TabPage" ); break;
+ default: return rtl::OString();
+ }
+ }
+ else
+ {
+ // only controls with the following parents get auto help ids
+ const ImpRCStack *pRC1 = StackTop(1);
+ switch( pRC1->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW:
+ case RSC_WORKWIN:
+ case RSC_MODELESSDIALOG:
+ case RSC_FLOATINGWINDOW:
+ case RSC_MODALDIALOG:
+ case RSC_TABPAGE:
+ // intentionally no breaks!
+ // auto help ids for controls
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_TABCONTROL: aHID.append( "TabControl" ); break;
+ case RSC_RADIOBUTTON: aHID.append( "RadioButton" ); break;
+ case RSC_CHECKBOX: aHID.append( "CheckBox" ); break;
+ case RSC_TRISTATEBOX: aHID.append( "TriStateBox" ); break;
+ case RSC_EDIT: aHID.append( "Edit" ); break;
+ case RSC_MULTILINEEDIT: aHID.append( "MultiLineEdit" ); break;
+ case RSC_MULTILISTBOX: aHID.append( "MultiListBox" ); break;
+ case RSC_LISTBOX: aHID.append( "ListBox" ); break;
+ case RSC_COMBOBOX: aHID.append( "ComboBox" ); break;
+ case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break;
+ case RSC_SPINFIELD: aHID.append( "SpinField" ); break;
+ case RSC_PATTERNFIELD: aHID.append( "PatternField" ); break;
+ case RSC_NUMERICFIELD: aHID.append( "NumericField" ); break;
+ case RSC_METRICFIELD: aHID.append( "MetricField" ); break;
+ case RSC_CURRENCYFIELD: aHID.append( "CurrencyField" ); break;
+ case RSC_DATEFIELD: aHID.append( "DateField" ); break;
+ case RSC_TIMEFIELD: aHID.append( "TimeField" ); break;
+ case RSC_IMAGERADIOBUTTON: aHID.append( "ImageRadioButton" ); break;
+ case RSC_NUMERICBOX: aHID.append( "NumericBox" ); break;
+ case RSC_METRICBOX: aHID.append( "MetricBox" ); break;
+ case RSC_CURRENCYBOX: aHID.append( "CurrencyBox" ); break;
+ case RSC_DATEBOX: aHID.append( "DateBox" ); break;
+ case RSC_TIMEBOX: aHID.append( "TimeBox" ); break;
+ case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break;
+ case RSC_MENUBUTTON: aHID.append( "MenuButton" ); break;
+ case RSC_MOREBUTTON: aHID.append( "MoreButton" ); break;
default:
- return 0;
- } // of switch
- nHID |= nLID;
- } // of if
- break;
- default:
- return 0;
- } // of switch
- nHID |= nGID << 14;
+ // no type, no auto HID
+ return rtl::OString();
+ }
+ break;
+ default:
+ return rtl::OString();
+ }
+ }
+
+ // append resource id hierarchy
+ for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
+ {
+ aHID.append( '.' );
+ pRC = StackTop( nOff );
+
+ OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
+ if( pRC->pResource )
+ aHID.append( sal_Int32( pRC->pResource->GetId() ) );
+ }
- return nHID;
+ return aHID.makeStringAndClear();
}
// -----------------------------------------------------------------------
@@ -1979,8 +2025,8 @@ UniString SimpleResMgr::ReadString( sal_uInt32 nId )
return sReturn;
}
- // ULONG nLen = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
- ResMgr::GetString( sReturn, (const BYTE*)(pResHeader+1) );
+ // sal_uIntPtr nLen = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
+ ResMgr::GetString( sReturn, (const sal_uInt8*)(pResHeader+1) );
// not neccessary with te current implementation which holds the string table permanently, but to be sure ....
// note: pFallback cannot be NULL here and is either the fallback or m_pResImpl
@@ -2056,7 +2102,7 @@ sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer )
// FreeBlob doesn't know that so it would probably crash ....
sal_uInt32 nRemaining = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
- *pBuffer = (void*)(((BYTE*)pResHeader) + sizeof(RSHEADER_TYPE));
+ *pBuffer = (void*)(((sal_uInt8*)pResHeader) + sizeof(RSHEADER_TYPE));
// free an eventual fallback InternalResMgr
if( m_pResImpl != pFallback )
@@ -2073,7 +2119,7 @@ sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer )
void SimpleResMgr::FreeBlob( void* pBuffer )
{
- void* pCompleteBuffer = (void*)(((BYTE*)pBuffer) - sizeof(RSHEADER_TYPE));
+ void* pCompleteBuffer = (void*)(((sal_uInt8*)pBuffer) - sizeof(RSHEADER_TYPE));
rtl_freeMemory(pCompleteBuffer);
}
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 35cf67d3b905..9ad9b71dcba3 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -50,11 +50,11 @@ struct EDcrData
ErrorHandler *pFirstHdl;
ErrorContext *pFirstCtx;
DisplayFnPtr pDsp;
- BOOL bIsWindowDsp;
+ sal_Bool bIsWindowDsp;
DynamicErrorInfo *ppDcr[ERRCODE_DYNAMIC_COUNT];
- USHORT nNextDcr;
+ sal_uInt16 nNextDcr;
EDcrData();
static EDcrData *GetData();
@@ -63,12 +63,12 @@ static EDcrData *GetData();
class EDcr_Impl
{
- ULONG lErrId;
- USHORT nMask;
+ sal_uIntPtr lErrId;
+ sal_uInt16 nMask;
void RegisterEDcr(DynamicErrorInfo *);
void UnRegisterEDcr(DynamicErrorInfo *);
- static ErrorInfo *GetDynamicErrorInfo(ULONG lId);
+ static ErrorInfo *GetDynamicErrorInfo(sal_uIntPtr lId);
friend class DynamicErrorInfo;
friend class ErrorInfo;
@@ -77,7 +77,7 @@ friend class ErrorInfo;
EDcrData::EDcrData()
{
- for(USHORT n=0;n<ERRCODE_DYNAMIC_COUNT;n++)
+ for(sal_uInt16 n=0;n<ERRCODE_DYNAMIC_COUNT;n++)
ppDcr[n]=0;
nNextDcr=0;
pFirstHdl=0;
@@ -106,10 +106,10 @@ void EDcr_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
//Vergibt eine dynamische Id
EDcrData* pData=EDcrData::GetData();
- lErrId= (((ULONG)pData->nNextDcr + 1) << ERRCODE_DYNAMIC_SHIFT) +
+ lErrId= (((sal_uIntPtr)pData->nNextDcr + 1) << ERRCODE_DYNAMIC_SHIFT) +
pDcr->GetErrorCode();
DynamicErrorInfo **ppDcr=pData->ppDcr;
- USHORT nNext=pData->nNextDcr;
+ sal_uInt16 nNext=pData->nNextDcr;
// bei einem Ringbuffer koennen wir uns das ASSERT wohl sparen!
// DBG_ASSERT(ppDcr[nNext]==0,"ErrHdl: Alle Errors belegt");
@@ -128,8 +128,8 @@ void EDcr_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr)
EDcrData* pData=EDcrData::GetData();
DynamicErrorInfo **ppDcr=pData->ppDcr;
- ULONG lIdx=(
- ((ULONG)(*pDcr) & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
+ sal_uIntPtr lIdx=(
+ ((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
if(ppDcr[lIdx]==pDcr)
ppDcr[lIdx]=0;
@@ -143,7 +143,7 @@ TYPEINIT1(TwoStringErrorInfo, DynamicErrorInfo);
TYPEINIT1(MessageInfo, DynamicErrorInfo);
-ErrorInfo *ErrorInfo::GetErrorInfo(ULONG lId)
+ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
{
if(lId & ERRCODE_DYNAMIC_MASK)
return EDcr_Impl::GetDynamicErrorInfo(lId);
@@ -151,12 +151,12 @@ ErrorInfo *ErrorInfo::GetErrorInfo(ULONG lId)
return new ErrorInfo(lId);
}
-DynamicErrorInfo::operator ULONG() const
+DynamicErrorInfo::operator sal_uIntPtr() const
{
return pImpl->lErrId;
}
-DynamicErrorInfo::DynamicErrorInfo(ULONG lArgUserId, USHORT nMask)
+DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask)
: ErrorInfo(lArgUserId)
{
pImpl=new EDcr_Impl;
@@ -170,32 +170,32 @@ DynamicErrorInfo::~DynamicErrorInfo()
delete pImpl;
}
-ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(ULONG lId)
+ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
{
- ULONG lIdx=((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
+ sal_uIntPtr lIdx=((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DynamicErrorInfo* pDcr=EDcrData::GetData()->ppDcr[lIdx];
- if(pDcr && (ULONG)(*pDcr)==lId)
+ if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
return pDcr;
else
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);
}
-USHORT DynamicErrorInfo::GetDialogMask() const
+sal_uInt16 DynamicErrorInfo::GetDialogMask() const
{
return pImpl->nMask;
}
StandardErrorInfo::StandardErrorInfo(
- ULONG UserId, ULONG lArgExtId, USHORT nFlags)
+ sal_uIntPtr UserId, sal_uIntPtr lArgExtId, sal_uInt16 nFlags)
: DynamicErrorInfo(UserId, nFlags), lExtId(lArgExtId)
{
}
StringErrorInfo::StringErrorInfo(
- ULONG UserId, const String& aStringP, USHORT nFlags)
+ sal_uIntPtr UserId, const String& aStringP, sal_uInt16 nFlags)
: DynamicErrorInfo(UserId, nFlags), aString(aStringP)
{
}
@@ -206,8 +206,8 @@ class ErrHdl_Impl
public:
ErrorHandler *pNext;
- static BOOL CreateString(const ErrorHandler *pStart,
- const ErrorInfo*, String&, USHORT&);
+ static sal_Bool CreateString(const ErrorHandler *pStart,
+ const ErrorInfo*, String&, sal_uInt16&);
};
@@ -268,19 +268,19 @@ ErrorHandler::~ErrorHandler()
void ErrorHandler::RegisterDisplay(WindowDisplayErrorFunc *aDsp)
{
EDcrData *pData=EDcrData::GetData();
- pData->bIsWindowDsp=TRUE;
+ pData->bIsWindowDsp=sal_True;
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
}
void ErrorHandler::RegisterDisplay(BasicDisplayErrorFunc *aDsp)
{
EDcrData *pData=EDcrData::GetData();
- pData->bIsWindowDsp=FALSE;
+ pData->bIsWindowDsp=sal_False;
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
}
-USHORT ErrorHandler::HandleError_Impl(
- ULONG lId, USHORT nFlags, BOOL bJustCreateString, String & rError)
+sal_uInt16 ErrorHandler::HandleError_Impl(
+ sal_uIntPtr lId, sal_uInt16 nFlags, sal_Bool bJustCreateString, String & rError)
{
/* [Beschreibung]
@@ -317,8 +317,8 @@ USHORT ErrorHandler::HandleError_Impl(
break;
}
- BOOL bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
- USHORT nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
+ sal_Bool bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
+ sal_uInt16 nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
if (bWarning)
nErrFlags |= ERRCODE_MSG_WARNING;
else
@@ -327,7 +327,7 @@ USHORT ErrorHandler::HandleError_Impl(
DynamicErrorInfo* pDynPtr=PTR_CAST(DynamicErrorInfo,pInfo);
if(pDynPtr)
{
- USHORT nDynFlags = pDynPtr->GetDialogMask();
+ sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
if( nDynFlags )
nErrFlags = nDynFlags;
}
@@ -380,12 +380,12 @@ USHORT ErrorHandler::HandleError_Impl(
}
// static
-BOOL ErrorHandler::GetErrorString(ULONG lId, String& rStr)
+sal_Bool ErrorHandler::GetErrorString(sal_uIntPtr lId, String& rStr)
{
- return (BOOL)HandleError_Impl( lId, USHRT_MAX, TRUE, rStr );
+ return (sal_Bool)HandleError_Impl( lId, USHRT_MAX, sal_True, rStr );
}
-USHORT ErrorHandler::HandleError(ULONG lId, USHORT nFlags)
+sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags)
{
/* [Beschreibung]
@@ -405,30 +405,30 @@ USHORT ErrorHandler::HandleError(ULONG lId, USHORT nFlags)
*/
String aDummy;
- return HandleError_Impl( lId, nFlags, FALSE, aDummy );
+ return HandleError_Impl( lId, nFlags, sal_False, aDummy );
}
-BOOL ErrorHandler::ForwCreateString(const ErrorInfo* pInfo, String& rStr, USHORT &rFlags) const
+sal_Bool ErrorHandler::ForwCreateString(const ErrorInfo* pInfo, String& rStr, sal_uInt16 &rFlags) const
{
return ErrHdl_Impl::CreateString(this->pImpl->pNext, pInfo, rStr, rFlags);
}
-BOOL ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
+sal_Bool ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
const ErrorInfo* pInfo, String& pStr,
- USHORT &rFlags)
+ sal_uInt16 &rFlags)
{
for(const ErrorHandler *pHdl=pStart;pHdl;pHdl=pHdl->pImpl->pNext)
{
if(pHdl->CreateString( pInfo, pStr, rFlags))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SimpleErrorHandler::CreateString(
- const ErrorInfo *pInfo, String &rStr, USHORT &) const
+sal_Bool SimpleErrorHandler::CreateString(
+ const ErrorInfo *pInfo, String &rStr, sal_uInt16 &) const
{
- ULONG nId = pInfo->GetErrorCode();
+ sal_uIntPtr nId = pInfo->GetErrorCode();
ByteString aStr;
aStr="Id ";
aStr+=ByteString::CreateFromInt32(nId);
@@ -444,7 +444,7 @@ BOOL SimpleErrorHandler::CreateString(
if(pDyn)
{
aStr+="\nDId ";
- aStr+=ByteString::CreateFromInt32((ULONG)*pDyn);
+ aStr+=ByteString::CreateFromInt32((sal_uIntPtr)*pDyn);
}
StandardErrorInfo *pStd=PTR_CAST(StandardErrorInfo,pInfo);
if(pStd)
@@ -453,7 +453,7 @@ BOOL SimpleErrorHandler::CreateString(
aStr+=ByteString::CreateFromInt32(pStd->GetExtendedErrorCode());
}
rStr = String( aStr, RTL_TEXTENCODING_ASCII_US );
- return TRUE;
+ return sal_True;
}
SimpleErrorHandler::SimpleErrorHandler()
diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx
index c220fbe1af92..05c7709931e6 100644..100755
--- a/tools/source/ref/globname.cxx
+++ b/tools/source/ref/globname.cxx
@@ -53,7 +53,7 @@ ImpSvGlobalName::ImpSvGlobalName( int )
/*************************************************************************
|* ImpSvGlobalName::operator ==()
*************************************************************************/
-BOOL ImpSvGlobalName::operator == ( const ImpSvGlobalName & rObj ) const
+sal_Bool ImpSvGlobalName::operator == ( const ImpSvGlobalName & rObj ) const
{
return !memcmp( szData, rObj.szData, sizeof( szData ) );
}
@@ -76,10 +76,10 @@ struct _GUID
struct GUID
#endif
{
- UINT32 Data1;
- UINT16 Data2;
- UINT16 Data3;
- BYTE Data4[8];
+ sal_uInt32 Data1;
+ sal_uInt16 Data2;
+ sal_uInt16 Data3;
+ sal_uInt8 Data4[8];
};
SvGlobalName::SvGlobalName( const CLSID & rId )
{
@@ -88,9 +88,9 @@ SvGlobalName::SvGlobalName( const CLSID & rId )
memcpy( pImp->szData, &rId, sizeof( pImp->szData ) );
}
-SvGlobalName::SvGlobalName( UINT32 n1, USHORT n2, USHORT n3,
- BYTE b8, BYTE b9, BYTE b10, BYTE b11,
- BYTE b12, BYTE b13, BYTE b14, BYTE b15 )
+SvGlobalName::SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
+ sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
+ sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 )
{
pImp = new ImpSvGlobalName();
pImp->nRefCount++;
@@ -188,14 +188,14 @@ SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj )
/*************************************************************************
|* SvGlobalName::operator < ()
*************************************************************************/
-BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
+sal_Bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const
{
int n = memcmp( pImp->szData +6, rObj.pImp->szData +6,
sizeof( pImp->szData ) -6);
if( n < 0 )
- return TRUE;
+ return sal_True;
else if( n > 0 )
- return FALSE;
+ return sal_False;
sal_uInt16 Data2_a;
memcpy(&Data2_a, pImp->szData+4, sizeof(sal_uInt16));
@@ -204,7 +204,7 @@ BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
memcpy(&Data2_b, rObj.pImp->szData+4, sizeof(sal_uInt16));
if( Data2_a < Data2_b )
- return TRUE;
+ return sal_True;
else if( Data2_a == Data2_b )
{
sal_uInt32 Data1_a;
@@ -216,14 +216,14 @@ BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
return Data1_a < Data1_b;
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|* SvGlobalName::operator +=()
*************************************************************************/
-SvGlobalName & SvGlobalName::operator += ( UINT32 n )
+SvGlobalName & SvGlobalName::operator += ( sal_uInt32 n )
{
NewImp();
@@ -246,7 +246,7 @@ SvGlobalName & SvGlobalName::operator += ( UINT32 n )
/*************************************************************************
|* SvGlobalName::operator ==()
*************************************************************************/
-BOOL SvGlobalName::operator == ( const SvGlobalName & rObj ) const
+sal_Bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const
{
return *pImp == *rObj.pImp;
}
@@ -260,7 +260,7 @@ void SvGlobalName::MakeFromMemory( void * pData )
/*************************************************************************
|* SvGlobalName::MakeId()
*************************************************************************/
-BOOL SvGlobalName::MakeId( const String & rIdStr )
+sal_Bool SvGlobalName::MakeId( const String & rIdStr )
{
ByteString aStr( rIdStr, RTL_TEXTENCODING_ASCII_US );
sal_Char * pStr = (sal_Char *)aStr.GetBuffer();
@@ -268,7 +268,7 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
&& '-' == pStr[ 8 ] && '-' == pStr[ 13 ]
&& '-' == pStr[ 18 ] && '-' == pStr[ 23 ] )
{
- UINT32 nFirst = 0;
+ sal_uInt32 nFirst = 0;
int i = 0;
for( i = 0; i < 8; i++ )
{
@@ -278,11 +278,11 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
else
nFirst = nFirst * 16 + (toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- UINT16 nSec = 0;
+ sal_uInt16 nSec = 0;
pStr++;
for( i = 0; i < 4; i++ )
{
@@ -290,13 +290,13 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
nSec = nSec * 16 + (*pStr - '0');
else
- nSec = nSec * 16 + (UINT16)(toupper( *pStr ) - 'A' + 10 );
+ nSec = nSec * 16 + (sal_uInt16)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- UINT16 nThird = 0;
+ sal_uInt16 nThird = 0;
pStr++;
for( i = 0; i < 4; i++ )
{
@@ -304,13 +304,13 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
nThird = nThird * 16 + (*pStr - '0');
else
- nThird = nThird * 16 + (UINT16)(toupper( *pStr ) - 'A' + 10 );
+ nThird = nThird * 16 + (sal_uInt16)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- BYTE szRemain[ 8 ];
+ sal_Int8 szRemain[ 8 ];
memset( szRemain, 0, sizeof( szRemain ) );
pStr++;
for( i = 0; i < 16; i++ )
@@ -319,9 +319,9 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
szRemain[i/2] = szRemain[i/2] * 16 + (*pStr - '0');
else
- szRemain[i/2] = szRemain[i/2] * 16 + (BYTE)(toupper( *pStr ) - 'A' + 10 );
+ szRemain[i/2] = szRemain[i/2] * 16 + (sal_Int8)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
if( i == 3 )
pStr++;
@@ -332,9 +332,9 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
memcpy(&pImp->szData[4], &nSec, sizeof(nSec));
memcpy(&pImp->szData[6], &nThird, sizeof(nThird));
memcpy(&pImp->szData[ 8 ], szRemain, 8);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -349,7 +349,7 @@ String SvGlobalName::GetctorName() const
memcpy(&Data1, pImp->szData, sizeof(sal_uInt32));
sprintf( buf, "0x%8.8" SAL_PRIXUINT32, Data1 );
aRet += buf;
- USHORT i;
+ sal_uInt16 i;
for( i = 4; i < 8; i += 2 )
{
aRet += ',';
@@ -380,7 +380,7 @@ String SvGlobalName::GetHexName() const
sprintf( buf, "%8.8" SAL_PRIXUINT32, Data1 );
aRet += buf;
aRet += '-';
- USHORT i ;
+ sal_uInt16 i ;
for( i = 4; i < 8; i += 2 )
{
sal_uInt16 Data2;
@@ -442,7 +442,7 @@ void SvGlobalNameList::Append( const SvGlobalName & rName )
/*************************************************************************
|* SvGlobalNameList::GetObject()
*************************************************************************/
-SvGlobalName SvGlobalNameList::GetObject( ULONG nPos )
+SvGlobalName SvGlobalNameList::GetObject( sal_uLong nPos )
{
return SvGlobalName(nPos < aList.size() ? aList[nPos] : NULL);
}
@@ -450,16 +450,16 @@ SvGlobalName SvGlobalNameList::GetObject( ULONG nPos )
/*************************************************************************
|* SvGlobalNameList::IsEntry()
*************************************************************************/
-BOOL SvGlobalNameList::IsEntry( const SvGlobalName & rName )
+sal_Bool SvGlobalNameList::IsEntry( const SvGlobalName & rName )
{
std::vector<ImpSvGlobalName*>::iterator piter;
for (piter = aList.begin(); piter != aList.end(); ++piter)
{
if (*rName.pImp == *(*piter))
- return true;
+ return sal_True;
}
- return false;
+ return sal_False;
}
com::sun::star::uno::Sequence < sal_Int8 > SvGlobalName::GetByteSequence() const
diff --git a/tools/source/ref/makefile.mk b/tools/source/ref/makefile.mk
deleted file mode 100644
index c87f8a740a4f..000000000000
--- a/tools/source/ref/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=ref
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/ref.obj \
- $(SLO)$/pstm.obj \
- $(SLO)$/globname.obj \
- $(SLO)$/errinf.obj
-
-OBJFILES= $(OBJ)$/ref.obj \
- $(OBJ)$/pstm.obj \
- $(OBJ)$/globname.obj \
- $(OBJ)$/errinf.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 84b21433d3da..75781b427c89 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -38,7 +38,7 @@
/************************************************************************
|* SvClassManager::Register()
*************************************************************************/
-void SvClassManager::Register( USHORT nClassId, SvCreateInstancePersist pFunc )
+void SvClassManager::Register( sal_uInt16 nClassId, SvCreateInstancePersist pFunc )
{
#ifdef DBG_UTIL
SvCreateInstancePersist p;
@@ -51,7 +51,7 @@ void SvClassManager::Register( USHORT nClassId, SvCreateInstancePersist pFunc )
/************************************************************************
|* SvClassManager::Get()
*************************************************************************/
-SvCreateInstancePersist SvClassManager::Get( USHORT nClassId )
+SvCreateInstancePersist SvClassManager::Get( sal_uInt16 nClassId )
{
Map::const_iterator i(aAssocTable.find(nClassId));
return i == aAssocTable.end() ? 0 : i->second;
@@ -64,32 +64,32 @@ TYPEINIT0( SvRttiBase );
SvPersistBaseMemberList::SvPersistBaseMemberList(){}
SvPersistBaseMemberList::SvPersistBaseMemberList(
- USHORT nInitSz, USHORT nResize )
+ sal_uInt16 nInitSz, sal_uInt16 nResize )
: SuperSvPersistBaseMemberList( nInitSz, nResize ){}
-#define PERSIST_LIST_VER (BYTE)0
-#define PERSIST_LIST_DBGUTIL (BYTE)0x80
+#define PERSIST_LIST_VER (sal_uInt8)0
+#define PERSIST_LIST_DBGUTIL (sal_uInt8)0x80
/************************************************************************
|* SvPersistBaseMemberList::WriteOnlyStreamedObjects()
*************************************************************************/
void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm,
- BOOL bOnlyStreamed ) const
+ sal_Bool bOnlyStreamed ) const
{
#ifdef STOR_NO_OPTIMIZE
- rStm << (BYTE)(PERSIST_LIST_VER | PERSIST_LIST_DBGUTIL);
- UINT32 nObjPos = rStm.WriteDummyLen();
+ rStm << (sal_uInt8)(PERSIST_LIST_VER | PERSIST_LIST_DBGUTIL);
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
#else
- BYTE bTmp = PERSIST_LIST_VER;
+ sal_uInt8 bTmp = PERSIST_LIST_VER;
rStm << bTmp;
#endif
- UINT32 nCountMember = Count();
- ULONG nCountPos = rStm.Tell();
- UINT32 nWriteCount = 0;
+ sal_uInt32 nCountMember = Count();
+ sal_uIntPtr nCountPos = rStm.Tell();
+ sal_uInt32 nWriteCount = 0;
rStm << nCountMember;
//bloss die Liste nicht veraendern,
//wegen Seiteneffekten beim Save
- for( ULONG n = 0; n < nCountMember; n++ )
+ for( sal_uIntPtr n = 0; n < nCountMember; n++ )
{
SvPersistBase * pObj = GetObject( n );
if( !bOnlyStreamed || rStm.IsStreamed( pObj ) )
@@ -101,7 +101,7 @@ void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm,
if( nWriteCount != nCountMember )
{
// nicht alle Objekte geschrieben, Count anpassen
- ULONG nPos = rStm.Tell();
+ sal_uIntPtr nPos = rStm.Tell();
rStm.Seek( nCountPos );
rStm << nWriteCount;
rStm.Seek( nPos );
@@ -127,7 +127,7 @@ SvPersistStream& operator << ( SvPersistStream & rStm,
SvPersistStream& operator >> ( SvPersistStream & rStm,
SvPersistBaseMemberList & rLst )
{
- BYTE nVer;
+ sal_uInt8 nVer;
rStm >> nVer;
if( (nVer & ~PERSIST_LIST_DBGUTIL) != PERSIST_LIST_VER )
@@ -136,13 +136,13 @@ SvPersistStream& operator >> ( SvPersistStream & rStm,
OSL_FAIL( "persist list, false version" );
}
- UINT32 nObjLen(0), nObjPos(0);
+ sal_uInt32 nObjLen(0), nObjPos(0);
if( nVer & PERSIST_LIST_DBGUTIL )
nObjLen = rStm.ReadLen( &nObjPos );
sal_uInt32 nCount;
rStm >> nCount;
- for( ULONG n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ )
+ for( sal_uIntPtr n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ )
{
SvPersistBase * pObj;
rStm >> pObj;
@@ -171,7 +171,7 @@ SvPersistStream::SvPersistStream
gespeichert werdn k"onnen */
SvStream * pStream, /* Dieser Stream wird als Medium genommen, auf
dem der PersistStream arbeitet */
- UINT32 nStartIdxP /* Ab diesem Index werden die Id's f"ur
+ sal_uInt32 nStartIdxP /* Ab diesem Index werden die Id's f"ur
die Objekte vergeben, er muss gr"osser
als Null sein. */
)
@@ -190,7 +190,7 @@ SvPersistStream::SvPersistStream
*/
{
DBG_ASSERT( nStartIdx != 0, "zero index not allowed" );
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
if( pStm )
{
SetVersion( pStm->GetVersion() );
@@ -228,7 +228,7 @@ SvPersistStream::SvPersistStream
wenn das erste aus dieser Hierarchie benutzt werden soll.
*/
{
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
if( pStm )
{
SetVersion( pStm->GetVersion() );
@@ -282,14 +282,14 @@ void SvPersistStream::SetStream
}
//=========================================================================
-USHORT SvPersistStream::IsA() const
+sal_uInt16 SvPersistStream::IsA() const
/* [Beschreibung]
Gibt den Identifier dieses Streamklasse zur"uck.
[R"uckgabewert]
- USHORT ID_PERSISTSTREAM wird zur"uckgegeben.
+ sal_uInt16 ID_PERSISTSTREAM wird zur"uckgegeben.
[Querverweise]
@@ -314,10 +314,10 @@ void SvPersistStream::ResetError()
/*************************************************************************
|* SvPersistStream::GetData()
*************************************************************************/
-ULONG SvPersistStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvPersistStream::GetData( void* pData, sal_uIntPtr nSize )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Read( pData, nSize );
+ sal_uIntPtr nRet = pStm->Read( pData, nSize );
SetError( pStm->GetError() );
return nRet;
}
@@ -325,10 +325,10 @@ ULONG SvPersistStream::GetData( void* pData, ULONG nSize )
/*************************************************************************
|* SvPersistStream::PutData()
*************************************************************************/
-ULONG SvPersistStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvPersistStream::PutData( const void* pData, sal_uIntPtr nSize )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Write( pData, nSize );
+ sal_uIntPtr nRet = pStm->Write( pData, nSize );
SetError( pStm->GetError() );
return nRet;
}
@@ -336,10 +336,10 @@ ULONG SvPersistStream::PutData( const void* pData, ULONG nSize )
/*************************************************************************
|* SvPersistStream::Seek()
*************************************************************************/
-ULONG SvPersistStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvPersistStream::SeekPos( sal_uIntPtr nPos )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Seek( nPos );
+ sal_uIntPtr nRet = pStm->Seek( nPos );
SetError( pStm->GetError() );
return nRet;
}
@@ -354,15 +354,15 @@ void SvPersistStream::FlushData()
/*************************************************************************
|* SvPersistStream::GetCurMaxIndex()
*************************************************************************/
-ULONG SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
+sal_uIntPtr SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
{
// const bekomme ich nicht den hoechsten Index
SvPersistUIdx * p = (SvPersistUIdx *)&rIdx;
// alten merken
- ULONG nCurIdx = p->GetCurIndex();
+ sal_uIntPtr nCurIdx = p->GetCurIndex();
p->Last();
// Bereiche nicht ueberschneiden, deshalb nur groessere Indexe
- ULONG nMaxIdx = p->GetCurIndex();
+ sal_uIntPtr nMaxIdx = p->GetCurIndex();
// wieder herstellen
p->Seek( nCurIdx );
return nMaxIdx;
@@ -371,9 +371,9 @@ ULONG SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
/*************************************************************************
|* SvPersistStream::GetIndex()
*************************************************************************/
-ULONG SvPersistStream::GetIndex( SvPersistBase * pObj ) const
+sal_uIntPtr SvPersistStream::GetIndex( SvPersistBase * pObj ) const
{
- ULONG nId = (ULONG)aPTable.Get( (ULONG)pObj );
+ sal_uIntPtr nId = (sal_uIntPtr)aPTable.Get( (sal_uIntPtr)pObj );
if( !nId && pRefStm )
return pRefStm->GetIndex( pObj );
return nId;
@@ -382,7 +382,7 @@ ULONG SvPersistStream::GetIndex( SvPersistBase * pObj ) const
/*************************************************************************
|* SvPersistStream::GetObject)
*************************************************************************/
-SvPersistBase * SvPersistStream::GetObject( ULONG nIdx ) const
+SvPersistBase * SvPersistStream::GetObject( sal_uIntPtr nIdx ) const
{
if( nIdx >= nStartIdx )
return aPUIdx.Get( nIdx );
@@ -396,7 +396,7 @@ SvPersistBase * SvPersistStream::GetObject( ULONG nIdx ) const
#define LEN_2 0x40
#define LEN_4 0x20
#define LEN_5 0x10
-UINT32 SvPersistStream::ReadCompressed
+sal_uInt32 SvPersistStream::ReadCompressed
(
SvStream & rStm /* Aus diesem Stream werden die komprimierten Daten
gelesen */
@@ -408,14 +408,14 @@ UINT32 SvPersistStream::ReadCompressed
[R"uckgabewert]
- UINT32 Das nicht komprimierte Wort wird zur"uckgegeben.
+ sal_uInt32 Das nicht komprimierte Wort wird zur"uckgegeben.
[Querverweise]
*/
{
- UINT32 nRet(0);
- BYTE nMask;
+ sal_uInt32 nRet(0);
+ sal_uInt8 nMask;
rStm >> nMask;
if( nMask & LEN_1 )
nRet = ~LEN_1 & nMask;
@@ -433,7 +433,7 @@ UINT32 SvPersistStream::ReadCompressed
rStm >> nMask;
nRet |= nMask;
nRet <<= 16;
- USHORT n;
+ sal_uInt16 n;
rStm >> n;
nRet |= n;
}
@@ -459,7 +459,7 @@ void SvPersistStream::WriteCompressed
(
SvStream & rStm,/* Aus diesem Stream werden die komprimierten Daten
gelesen */
- UINT32 nVal /* Dieser Wert wird komprimiert geschrieben */
+ sal_uInt32 nVal /* Dieser Wert wird komprimiert geschrieben */
)
/* [Beschreibung]
@@ -477,30 +477,30 @@ void SvPersistStream::WriteCompressed
{
#ifdef STOR_NO_OPTIMIZE
if( nVal < 0x80 )
- rStm << (BYTE)(LEN_1 | nVal);
+ rStm << (sal_uInt8)(LEN_1 | nVal);
else if( nVal < 0x4000 )
{
- rStm << (BYTE)(LEN_2 | (nVal >> 8));
- rStm << (BYTE)nVal;
+ rStm << (sal_uInt8)(LEN_2 | (nVal >> 8));
+ rStm << (sal_uInt8)nVal;
}
else if( nVal < 0x20000000 )
{
- // hoechstes BYTE
- rStm << (BYTE)(LEN_4 | (nVal >> 24));
- // 2. hoechstes BYTE
- rStm << (BYTE)(nVal >> 16);
- rStm << (USHORT)(nVal);
+ // hoechstes sal_uInt8
+ rStm << (sal_uInt8)(LEN_4 | (nVal >> 24));
+ // 2. hoechstes sal_uInt8
+ rStm << (sal_uInt8)(nVal >> 16);
+ rStm << (sal_uInt16)(nVal);
}
else
#endif
{
- rStm << (BYTE)LEN_5;
+ rStm << (sal_uInt8)LEN_5;
rStm << nVal;
}
}
//=========================================================================
-UINT32 SvPersistStream::WriteDummyLen()
+sal_uInt32 SvPersistStream::WriteDummyLen()
/* [Beschreibung]
Die Methode schreibt 4 Byte in den Stream und gibt die Streamposition
@@ -508,11 +508,11 @@ UINT32 SvPersistStream::WriteDummyLen()
[R"uckgabewert]
- UINT32 Die Position hinter der L"angenangabe wird zur"uckgegeben.
+ sal_uInt32 Die Position hinter der L"angenangabe wird zur"uckgegeben.
[Beispiel]
- UINT32 nObjPos = rStm.WriteDummyLen();
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
...
// Daten schreiben
...
@@ -525,13 +525,13 @@ UINT32 SvPersistStream::WriteDummyLen()
*/
{
#ifdef DBG_UTIL
- UINT32 nPos = Tell();
+ sal_uInt32 nPos = Tell();
#endif
- UINT32 n0 = 0;
+ sal_uInt32 n0 = 0;
*this << n0; // wegen Sun sp
// keine Assertion bei Streamfehler
DBG_ASSERT( GetError() != SVSTREAM_OK
- || (sizeof( UINT32 ) == Tell() -nPos),
+ || (sizeof( sal_uInt32 ) == Tell() -nPos),
"keine 4-Byte fuer Langenangabe" );
return Tell();
}
@@ -539,20 +539,20 @@ UINT32 SvPersistStream::WriteDummyLen()
//=========================================================================
void SvPersistStream::WriteLen
(
- UINT32 nObjPos /* die Position + 4, an der die L"ange geschrieben
+ sal_uInt32 nObjPos /* die Position + 4, an der die L"ange geschrieben
wird. */
)
/* [Beschreibung]
Die Methode schreibt die Differenz zwischen der aktuellen und
- nObjPos als UINT32 an die Position nObjPos -4 im Stream. Danach
+ nObjPos als sal_uInt32 an die Position nObjPos -4 im Stream. Danach
wird der Stream wieder auf die alte Position gestellt.
[Beispiel]
Die Differenz enth"alt nicht die L"angenangabe.
- UINT32 nObjPos = rStm.WriteDummyLen();
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
...
// Daten schreiben
...
@@ -564,19 +564,19 @@ void SvPersistStream::WriteLen
<SvPersistStream::ReadLen>, <SvPersistStream::WriteDummyLen>
*/
{
- UINT32 nPos = Tell();
- UINT32 nLen = nPos - nObjPos;
+ sal_uInt32 nPos = Tell();
+ sal_uInt32 nLen = nPos - nObjPos;
// die Laenge mu� im stream 4-Byte betragen
- Seek( nObjPos - sizeof( UINT32 ) );
+ Seek( nObjPos - sizeof( sal_uInt32 ) );
// Laenge schreiben
*this << nLen;
Seek( nPos );
}
//=========================================================================
-UINT32 SvPersistStream::ReadLen
+sal_uInt32 SvPersistStream::ReadLen
(
- UINT32 * pTestPos /* Die Position des Streams, nach dem Lesen der
+ sal_uInt32 * pTestPos /* Die Position des Streams, nach dem Lesen der
L"ange, wird zur"uckgegeben. Es darf auch NULL
"ubergeben werden. */
)
@@ -586,7 +586,7 @@ UINT32 SvPersistStream::ReadLen
und <SvPersistStream::WriteLen> geschrieben wurde.
*/
{
- UINT32 nLen;
+ sal_uInt32 nLen;
*this >> nLen;
if( pTestPos )
*pTestPos = Tell();
@@ -596,15 +596,15 @@ UINT32 SvPersistStream::ReadLen
//=========================================================================
// Dateirormat abw"arts kompatibel
#ifdef STOR_NO_OPTIMIZE
-#define P_VER (BYTE)0x00
+#define P_VER (sal_uInt8)0x00
#else
-#define P_VER (BYTE)0x01
+#define P_VER (sal_uInt8)0x01
#endif
-#define P_VER_MASK (BYTE)0x0F
-#define P_ID_0 (BYTE)0x80
-#define P_OBJ (BYTE)0x40
-#define P_DBGUTIL (BYTE)0x20
-#define P_ID (BYTE)0x10
+#define P_VER_MASK (sal_uInt8)0x0F
+#define P_ID_0 (sal_uInt8)0x80
+#define P_OBJ (sal_uInt8)0x40
+#define P_DBGUTIL (sal_uInt8)0x20
+#define P_ID (sal_uInt8)0x10
#ifdef STOR_NO_OPTIMIZE
#define P_STD P_DBGUTIL
#else
@@ -614,9 +614,9 @@ UINT32 SvPersistStream::ReadLen
static void WriteId
(
SvStream & rStm,
- BYTE nHdr,
- UINT32 nId,
- USHORT nClassId
+ sal_uInt8 nHdr,
+ sal_uInt32 nId,
+ sal_uInt16 nClassId
)
{
#ifdef STOR_NO_OPTIMIZE
@@ -627,12 +627,12 @@ static void WriteId
{
if( (nHdr & P_OBJ) || nId != 0 )
{ // Id nur bei Zeiger, oder DBGUTIL
- rStm << (BYTE)(nHdr);
+ rStm << (sal_uInt8)(nHdr);
SvPersistStream::WriteCompressed( rStm, nId );
}
else
{ // NULL Pointer
- rStm << (BYTE)(nHdr | P_ID_0);
+ rStm << (sal_uInt8)(nHdr | P_ID_0);
return;
}
}
@@ -649,9 +649,9 @@ static void WriteId
static void ReadId
(
SvStream & rStm,
- BYTE & nHdr,
- UINT32 & nId,
- USHORT & nClassId
+ sal_uInt8 & nHdr,
+ sal_uInt32 & nId,
+ sal_uInt16 & nClassId
)
{
nClassId = 0;
@@ -671,19 +671,19 @@ static void ReadId
nId = SvPersistStream::ReadCompressed( rStm );
if( (nHdr & P_DBGUTIL) || (nHdr & P_OBJ) )
- nClassId = (USHORT)SvPersistStream::ReadCompressed( rStm );
+ nClassId = (sal_uInt16)SvPersistStream::ReadCompressed( rStm );
}
}
//=========================================================================
void SvPersistStream::WriteObj
(
- BYTE nHdr,
+ sal_uInt8 nHdr,
SvPersistBase * pObj
)
{
#ifdef STOR_NO_OPTIMIZE
- UINT32 nObjPos = 0;
+ sal_uInt32 nObjPos = 0;
if( nHdr & P_DBGUTIL )
// Position fuer Laenge merken
nObjPos = WriteDummyLen();
@@ -701,17 +701,17 @@ SvPersistStream& SvPersistStream::WritePointer
SvPersistBase * pObj
)
{
- BYTE nP = P_STD;
+ sal_uInt8 nP = P_STD;
if( pObj )
{
- ULONG nId = GetIndex( pObj );
+ sal_uIntPtr nId = GetIndex( pObj );
if( nId )
nP |= P_ID;
else
{
nId = aPUIdx.Insert( pObj );
- aPTable.Insert( (ULONG)pObj, (void *)nId );
+ aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
nP |= P_OBJ;
}
WriteId( *this, nP, nId, pObj->GetClassId() );
@@ -726,15 +726,15 @@ SvPersistStream& SvPersistStream::WritePointer
}
//=========================================================================
-UINT32 SvPersistStream::ReadObj
+sal_uInt32 SvPersistStream::ReadObj
(
SvPersistBase * & rpObj,
- BOOL bRegister
+ sal_Bool bRegister
)
{
- BYTE nHdr;
- UINT32 nId = 0;
- USHORT nClassId;
+ sal_uInt8 nHdr;
+ sal_uInt32 nId = 0;
+ sal_uInt16 nClassId;
rpObj = NULL; // Spezifikation: Im Fehlerfall 0.
ReadId( *this, nHdr, nId, nClassId );
@@ -754,7 +754,7 @@ UINT32 SvPersistStream::ReadObj
"object already exist" );
SvCreateInstancePersist pFunc = rClassMgr.Get( nClassId );
- UINT32 nObjLen(0), nObjPos(0);
+ sal_uInt32 nObjLen(0), nObjPos(0);
if( nHdr & P_DBGUTIL )
nObjLen = ReadLen( &nObjPos );
if( !pFunc )
@@ -777,9 +777,9 @@ UINT32 SvPersistStream::ReadObj
if( bRegister )
{
// unbedingt erst in Tabelle eintragen
- ULONG nNewId = aPUIdx.Insert( rpObj );
+ sal_uIntPtr nNewId = aPUIdx.Insert( rpObj );
// um den gleichen Zustand, wie nach dem Speichern herzustellen
- aPTable.Insert( (ULONG)rpObj, (void *)nNewId );
+ aPTable.Insert( (sal_uIntPtr)rpObj, (void *)nNewId );
DBG_ASSERT( !(nHdr & P_DBGUTIL) || nId == nNewId,
"read write id conflict: not the same" );
}
@@ -814,7 +814,7 @@ SvPersistStream& SvPersistStream::ReadPointer
SvPersistBase * & rpObj
)
{
- ReadObj( rpObj, TRUE );
+ ReadObj( rpObj, sal_True );
return *this;
}
@@ -848,14 +848,14 @@ SvStream& operator <<
SvStream * pOldStm = rThis.GetStream();
rThis.SetStream( &rStm );
- BYTE bTmp = 0;
+ sal_uInt8 bTmp = 0;
rThis << bTmp; // Version
- UINT32 nCount = (UINT32)rThis.aPUIdx.Count();
+ sal_uInt32 nCount = (sal_uInt32)rThis.aPUIdx.Count();
rThis << nCount;
SvPersistBase * pEle = rThis.aPUIdx.First();
- for( UINT32 i = 0; i < nCount; i++ )
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
- BYTE nP = P_OBJ | P_ID | P_STD;
+ sal_uInt8 nP = P_OBJ | P_ID | P_STD;
WriteId( rThis, nP, rThis.aPUIdx.GetCurIndex(),
pEle->GetClassId() );
rThis.WriteObj( nP, pEle );
@@ -875,23 +875,23 @@ SvStream& operator >>
SvStream * pOldStm = rThis.GetStream();
rThis.SetStream( &rStm );
- BYTE nVers;
+ sal_uInt8 nVers;
rThis >> nVers; // Version
if( 0 == nVers )
{
- UINT32 nCount = 0;
+ sal_uInt32 nCount = 0;
rThis >> nCount;
- for( UINT32 i = 0; i < nCount; i++ )
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
SvPersistBase * pEle;
// Lesen, ohne in die Tabellen einzutragen
- sal_uIntPtr nId = rThis.ReadObj( pEle, FALSE );
+ sal_uIntPtr nId = rThis.ReadObj( pEle, sal_False );
if( rThis.GetError() )
break;
// Die Id eines Objektes wird nie modifiziert
rThis.aPUIdx.Insert( nId, pEle );
- rThis.aPTable.Insert( (ULONG)pEle, (void *)nId );
+ rThis.aPTable.Insert( (sal_uIntPtr)pEle, (void *)nId );
}
}
else
@@ -902,19 +902,19 @@ SvStream& operator >>
}
//=========================================================================
-ULONG SvPersistStream::InsertObj( SvPersistBase * pObj )
+sal_uIntPtr SvPersistStream::InsertObj( SvPersistBase * pObj )
{
- ULONG nId = aPUIdx.Insert( pObj );
- aPTable.Insert( (ULONG)pObj, (void *)nId );
+ sal_uIntPtr nId = aPUIdx.Insert( pObj );
+ aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
return nId;
}
//=========================================================================
-ULONG SvPersistStream::RemoveObj( SvPersistBase * pObj )
+sal_uIntPtr SvPersistStream::RemoveObj( SvPersistBase * pObj )
{
- ULONG nIdx = GetIndex( pObj );
+ sal_uIntPtr nIdx = GetIndex( pObj );
aPUIdx.Remove( nIdx );
- aPTable.Remove( (ULONG)pObj );
+ aPTable.Remove( (sal_uIntPtr)pObj );
return nIdx;
}
diff --git a/tools/source/reversemap/Makefile b/tools/source/reversemap/Makefile
new file mode 100644
index 000000000000..2bad931328fc
--- /dev/null
+++ b/tools/source/reversemap/Makefile
@@ -0,0 +1,32 @@
+# 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
+# Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s): Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
+#
+# 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.
+
+all : reversemap.hxx
+
+reversemap.hxx : $(OUTDIR)/bin/bestreversemap
+ $(gb_Helper_execute)bestreversemap > $@
+
+.PHONY : all
+# vim: set noet sw=4 ts=4:
diff --git a/tools/source/reversemap/bestreversemap.cxx b/tools/source/reversemap/bestreversemap.cxx
index a4956c1e58b3..d937724b126d 100644
--- a/tools/source/reversemap/bestreversemap.cxx
+++ b/tools/source/reversemap/bestreversemap.cxx
@@ -28,7 +28,6 @@
#include "sal/config.h"
#include "rtl/textcvt.h"
-#include "sal/main.h"
#include <stdio.h>
@@ -77,7 +76,7 @@ struct Encoder
};
-SAL_IMPLEMENT_MAIN()
+int main(int, char**)
{
# define EXP(x) Encoder(x, #x)
diff --git a/tools/source/solar/makefile.mk b/tools/source/solar/makefile.mk
deleted file mode 100644
index 6f5dd85c608b..000000000000
--- a/tools/source/solar/makefile.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=mksvconf
-TARGETTYPE=CUI
-
-LIBSALCPPRT=$(0)
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-CFILES= solar.c
-
-OBJFILES= $(OBJ)$/solar.obj
-
-APP1TARGET= $(TARGET)
-APP1OBJS= $(OBJFILES)
-APP1STDLIBS=
-APP1DEPN=
-APP1DEF=
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(L10N-framework)"==""
-ALLTAR : $(INCCOM)$/svconf.h
-.ENDIF # "$(L10N-framework)"==""
-
-$(INCCOM)$/svconf.h : $(BIN)$/$(TARGET)
- $(BIN)$/$(TARGET) $@
-
diff --git a/tools/source/solar/solar.c b/tools/source/solar/solar.c
deleted file mode 100644
index 5d1549459bbf..000000000000
--- a/tools/source/solar/solar.c
+++ /dev/null
@@ -1,520 +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.
- *
- ************************************************************************/
-
-/* POSIX defines that a program is undefined after a SIG_SEGV. The
- * code stopped working on Linux Kernel 2.6 so I have moved this back to
- * use FORK.
- * If at a later time the signals work correctly with the Linux Kernel 2.6
- * then this change may be reverted although not strictly posix safe. */
-#define USE_FORK_TO_CHECK 1
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include <unistd.h>
-#include <sys/types.h>
-
-#define I_STDARG
-#ifdef I_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#define NO_USE_FORK_TO_CHECK
-#ifdef USE_FORK_TO_CHECK
-#include <sys/wait.h>
-#else
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#define printTypeSize(Type,Name) printf( "sizeof(%s)\t= %d\n", Name, sizeof (Type) )
-
-#define isSignedType(Type) (((Type)-1) < 0)
-#define printTypeSign(Type,Name) printf( "%s\t= %s %s\n", Name, ( isSignedType(Type) ? "signed" : "unsigned" ), Name )
-
-
-/*************************************************************************
-|*
-|* IsBigEndian()
-|*
-|* Beschreibung True, wenn CPU BigEndian ist
-|*
-*************************************************************************/
-int IsBigEndian()
-{
- long l = 1;
- return ! *(char*)&l;
-}
-
-/*************************************************************************
-|*
-|* IsStackGrowingDown()
-|*
-|* Beschreibung True, wenn der Stack nach unten waechst
-|*
-*************************************************************************/
-int IsStackGrowingDown_2( int * pI )
-{
- int i = 1;
- return ((unsigned long)&i) < (unsigned long)pI;
-}
-
-int IsStackGrowingDown()
-{
- int i = 1;
- return IsStackGrowingDown_2(&i);
-}
-
-/*************************************************************************
-|*
-|* GetStackAlignment()
-|*
-|* Beschreibung Alignment von char Parametern, die (hoffentlich)
-|* ueber den Stack uebergeben werden
-|*
-*************************************************************************/
-int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment()
-{
- int nStackAlignment = GetStackAlignment_3(0,1,2,3,4,5);
- if ( nStackAlignment != GetStackAlignment_2(0,1,2,3,4,5) )
- printf( "Pascal calling convention\n" );
- return nStackAlignment;
-}
-
-
-/*************************************************************************
-|*
-|* Typdeclarations for memory access test functions
-|*
-*************************************************************************/
-typedef enum { t_char, t_short, t_int, t_long, t_double } Type;
-typedef int (*TestFunc)( Type, void* );
-
-
-/*************************************************************************
-|*
-|* PrintArgs()
-|*
-|* Beschreibung Testfunktion fuer variable Parameter
-|*
-*************************************************************************/
-#ifdef I_STDARG
-void PrintArgs( int p, ... )
-#else
-void PrintArgs( p, va_alist )
-int p;
-va_dcl
-#endif
-{
- int value;
- va_list ap;
-
-#ifdef I_STDARG
- va_start( ap, p );
-#else
- va_start( ap );
-#endif
-
- printf( "value = %d", p );
-
- while ( ( value = va_arg(ap, int) ) != 0 )
- printf( " %d", value );
-
- printf( "\n" );
- va_end(ap);
-}
-
-#ifndef USE_FORK_TO_CHECK
-/*************************************************************************
-|*
-|* SignalHdl()
-|*
-|* Beschreibung faengt SIGBUS und SIGSEGV in check() ab
-|*
-*************************************************************************/
-static jmp_buf check_env;
-static int bSignal;
-void SignalHdl( int sig )
-{
- bSignal = 1;
-
- fprintf( stderr, "Signal %d caught\n", sig );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- siglongjmp( check_env, sig );
-}
-#endif
-
-/*************************************************************************
-|*
-|* check()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|*
-*************************************************************************/
-int check( TestFunc func, Type eT, void* p )
-{
-#ifdef USE_FORK_TO_CHECK
- pid_t nChild = fork();
- if ( nChild )
- {
- int exitVal;
- wait( &exitVal );
- if ( exitVal & 0xff )
- return -1;
- else
- return exitVal >> 8;
- }
- else
- {
- exit( func( eT, p ) );
- }
-#else
- int result;
-
- bSignal = 0;
-
- if ( !sigsetjmp( check_env, 1 ) )
- {
- signal( SIGSEGV, SignalHdl );
- signal( SIGBUS, SignalHdl );
- result = func( eT, p );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- }
-
- if ( bSignal )
- return -1;
- else
- return 0;
-#endif
-}
-
-/*************************************************************************
-|*
-|* GetAtAddress()
-|*
-|* Beschreibung memory read access
-|*
-*************************************************************************/
-int GetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p);
- case t_short: return *((short*)p);
- case t_int: return *((int*)p);
- case t_long: return *((long*)p);
- case t_double: return *((double*)p);
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* SetAtAddress()
-|*
-|* Beschreibung memory write access
-|*
-*************************************************************************/
-int SetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p) = 0;
- case t_short: return *((short*)p) = 0;
- case t_int: return *((int*)p) = 0;
- case t_long: return *((long*)p) = 0;
- case t_double: return *((double*)p)= 0;
- }
- abort();
-}
-
-char* TypeName( Type eT )
-{
- switch ( eT )
- {
- case t_char: return "char";
- case t_short: return "short";
- case t_int: return "int";
- case t_long: return "long";
- case t_double: return "double";
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* Check(Get|Set)Access()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|* Zugriffsverletzungen werden abgefangen
-|*
-*************************************************************************/
-int CheckGetAccess( Type eT, void* p )
-{
- int b;
- b = -1 != check( (TestFunc)GetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s read %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-int CheckSetAccess( Type eT, void* p )
-{
- int b;
-
- b = -1 != check( (TestFunc)SetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s write %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-
-/*************************************************************************
-|*
-|* GetAlignment()
-|*
-|* Beschreibung Bestimmt das Alignment verschiedener Typen
-|*
-*************************************************************************/
-int GetAlignment( Type eT )
-{
- char a[ 16*8 ];
- long p = (long)(void*)a;
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 16*8; i++ )
- a[i] = 0;
-
- p = ( p + 0xF ) & ~0xF;
- for ( i = 1; i < 16; i++ )
- if ( CheckGetAccess( eT, (void*)(p+i) ) )
- return i;
- return 0;
-}
-
-/*************************************************************************
-|*
-|* struct Description
-|*
-|* Beschreibung Beschreibt die Parameter der Architektur
-|*
-*************************************************************************/
-struct Description
-{
- int bBigEndian;
- int bStackGrowsDown;
- int nStackAlignment;
- int nAlignment[3]; /* 2,4,8 */
-};
-
-/*************************************************************************
-|*
-|* Description_Ctor()
-|*
-|* Beschreibung Bestimmt die Parameter der Architektur
-|*
-*************************************************************************/
-void Description_Ctor( struct Description* pThis )
-{
- pThis->bBigEndian = IsBigEndian();
- pThis->bStackGrowsDown = IsStackGrowingDown();
- pThis->nStackAlignment = GetStackAlignment();
-
- if ( sizeof(short) != 2 )
- abort();
- pThis->nAlignment[0] = GetAlignment( t_short );
- if ( sizeof(int) != 4 )
- abort();
- pThis->nAlignment[1] = GetAlignment( t_int );
-
- if ( sizeof(long) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_long );
- else if ( sizeof(double) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_double );
- else
- abort();
-}
-
-/*************************************************************************
-|*
-|* Description_Print()
-|*
-|* Beschreibung Schreibt die Parameter der Architektur als Header
-|*
-*************************************************************************/
-void Description_Print( struct Description* pThis, char* name )
-{
- int i;
- FILE* f = fopen( name, "w" );
- if( ! f ) {
- fprintf( stderr, "Unable to open file %s: %s\n", name, strerror( errno ) );
- exit( 99 );
- }
- fprintf( f, "#define __%s\n",
- pThis->bBigEndian ? "BIGENDIAN" : "LITTLEENDIAN" );
- for ( i = 0; i < 3; i++ )
- fprintf( f, "#define __ALIGNMENT%d\t%d\n",
- 1 << (i+1), pThis->nAlignment[i] );
- fprintf( f, "/* Stack alignment is not used... */\n" );
- fprintf( f, "#define __STACKALIGNMENT\t%d\n", pThis->nStackAlignment );
- fprintf( f, "#define __STACKDIRECTION\t%d\n",
- pThis->bStackGrowsDown ? -1 : 1 );
- fprintf( f, "#define __SIZEOFCHAR\t%d\n", sizeof( char ) );
- fprintf( f, "#define __SIZEOFSHORT\t%d\n", sizeof( short ) );
- fprintf( f, "#define __SIZEOFINT\t%d\n", sizeof( int ) );
- fprintf( f, "#define __SIZEOFLONG\t%d\n", sizeof( long ) );
- fprintf( f, "#define __SIZEOFPOINTER\t%d\n", sizeof( void* ) );
- fprintf( f, "#define __SIZEOFDOUBLE\t%d\n", sizeof( double ) );
- fprintf( f, "#define __IEEEDOUBLE\n" );
- fclose( f );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryAccess()
-|*
-|* Beschreibung Informeller Bytezugriffstest
-|*
-*************************************************************************/
-void InfoMemoryAccess( char* p )
-{
- if ( CheckGetAccess( t_char, p ) )
- printf( "can read address %p\n", p );
- else
- printf( "can not read address %p\n", p );
-
- if ( CheckSetAccess( t_char, p ) )
- printf( "can write address %p\n", p );
- else
- printf( "can not write address %p\n", p );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryTypeAccess()
-|*
-|* Beschreibung Informeller Zugriffstest verschiedener Typen
-|*
-*************************************************************************/
-void InfoMemoryTypeAccess( Type eT )
-{
- char a[64];
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 64; i++ )
- a[i] = 0;
-
- for ( i = 56; i >= 7; i >>= 1 )
- {
- printf( "Zugriff %s auf %i-Aligned Adresse : ", TypeName( eT ), i / 7 );
- printf( ( CheckGetAccess( eT, (long*)&a[i] ) ? "OK\n" : "ERROR\n" ) );
- }
-}
-/************************************************************************
- *
- * Use C code to determine the characteristics of the building platform.
- *
- ************************************************************************/
-int main( int argc, char* argv[] )
-{
- printTypeSign( char, "char" );
- printTypeSign( short, "short" );
- printTypeSign( int, "int" );
- printTypeSign( long, "long" );
-
- printTypeSize( char, "char" );
- printTypeSize( short, "short" );
- printTypeSize( int, "int" );
- printTypeSize( long, "long" );
- printTypeSize( float, "float" );
- printTypeSize( double, "double" );
- printTypeSize( void *, "void *" );
-
- if ( IsBigEndian() )
- printf( "BIGENDIAN (Sparc, MC680x0, RS6000, IP22, IP32, g3)\n" );
- else
- printf( "LITTLEENDIAN (Intel, VAX, PowerPC)\n" );
-
- if( IsStackGrowingDown() )
- printf( "Stack waechst nach unten\n" );
- else
- printf( "Stack waechst nach oben\n" );
-
- printf( "STACKALIGNMENT : %d\n", GetStackAlignment() );
-
- /* PrintArgs( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ); */
-
- if ( argc > 1 )
- {
- struct Description description;
- Description_Ctor( &description );
- Description_Print( &description, argv[1] );
- }
- {
- char* p = NULL;
- InfoMemoryAccess( p );
- p = (char*)&p;
- InfoMemoryAccess( p );
- InfoMemoryTypeAccess( t_short );
- InfoMemoryTypeAccess( t_int );
- InfoMemoryTypeAccess( t_long );
- InfoMemoryTypeAccess( t_double );
- }
-
- exit( 0 );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/stream/cachestr.cxx b/tools/source/stream/cachestr.cxx
index f68f563d427c..ab8a2e7c7806 100644
--- a/tools/source/stream/cachestr.cxx
+++ b/tools/source/stream/cachestr.cxx
@@ -40,13 +40,13 @@
|*
*************************************************************************/
-SvCacheStream::SvCacheStream( ULONG nMaxMemSize )
+SvCacheStream::SvCacheStream( sal_uIntPtr nMaxMemSize )
{
if( !nMaxMemSize )
nMaxMemSize = 20480;
- SvStream::bIsWritable = TRUE;
+ SvStream::bIsWritable = sal_True;
nMaxSize = nMaxMemSize;
- bPersistent = FALSE;
+ bPersistent = sal_False;
pSwapStream = 0;
pCurrentStream = new SvMemoryStream( nMaxMemSize );
pTempFile = 0;
@@ -59,8 +59,8 @@ SvCacheStream::SvCacheStream( ULONG nMaxMemSize )
*************************************************************************/
SvCacheStream::SvCacheStream( const String &rFileName,
- ULONG nExpectedSize,
- ULONG nMaxMemSize )
+ sal_uIntPtr nExpectedSize,
+ sal_uIntPtr nMaxMemSize )
{
if( !nMaxMemSize )
nMaxMemSize = 20480;
@@ -70,9 +70,9 @@ SvCacheStream::SvCacheStream( const String &rFileName,
else if( !nExpectedSize )
nExpectedSize = 4096;
- SvStream::bIsWritable = TRUE;
+ SvStream::bIsWritable = sal_True;
nMaxSize = nMaxMemSize;
- bPersistent = TRUE;
+ bPersistent = sal_True;
aFileName = rFileName;
pSwapStream = 0;
pCurrentStream = new SvMemoryStream( nExpectedSize );
@@ -94,7 +94,7 @@ SvCacheStream::~SvCacheStream()
if( pSwapStream && !bPersistent && pTempFile )
{
// temporaeres File loeschen
- pTempFile->EnableKillingFile( TRUE );
+ pTempFile->EnableKillingFile( sal_True );
}
delete pTempFile;
@@ -130,7 +130,7 @@ void SvCacheStream::SwapOut()
}
}
- ULONG nPos = pCurrentStream->Tell();
+ sal_uIntPtr nPos = pCurrentStream->Tell();
pCurrentStream->Seek( 0 );
if( !pSwapStream )
pSwapStream = new SvFileStream( aFileName, STREAM_READWRITE | STREAM_TRUNC );
@@ -148,7 +148,7 @@ void SvCacheStream::SwapOut()
|*
*************************************************************************/
-ULONG SvCacheStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvCacheStream::GetData( void* pData, sal_uIntPtr nSize )
{
return pCurrentStream->Read( pData, nSize );
}
@@ -159,7 +159,7 @@ ULONG SvCacheStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvCacheStream::PutData( const void* pData, sal_uIntPtr nSize )
{
// lieber unnoetig auslagern als unnoetig umkopieren
if( pCurrentStream != pSwapStream
@@ -174,7 +174,7 @@ ULONG SvCacheStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvCacheStream::SeekPos( sal_uIntPtr nPos )
{
return pCurrentStream->Seek( nPos );
}
@@ -214,7 +214,7 @@ const void* SvCacheStream::GetBuffer()
|*
*************************************************************************/
-void SvCacheStream::SetSize( ULONG nSize )
+void SvCacheStream::SetSize( sal_uIntPtr nSize )
{
pCurrentStream->SetStreamSize( nSize );
}
@@ -225,13 +225,13 @@ void SvCacheStream::SetSize( ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::GetSize()
+sal_uIntPtr SvCacheStream::GetSize()
{
// ACHTUNG: SvMemoryStream::GetSize() gibt Groesse
// des allozierten Buffers zurueck
Flush();
- ULONG nTemp = Tell();
- ULONG nLength = Seek( STREAM_SEEK_TO_END );
+ sal_uIntPtr nTemp = Tell();
+ sal_uIntPtr nLength = Seek( STREAM_SEEK_TO_END );
Seek( nTemp );
return nLength;
}
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 879ce44d6d83..bdaf4422f4bf 100644..100755
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -118,7 +118,7 @@ inline static void SwapDouble( double& r )
{
if( sizeof(double) != 8 )
{
- DBG_ASSERT( FALSE, "Can only swap 8-Byte-doubles\n" );
+ DBG_ASSERT( sal_False, "Can only swap 8-Byte-doubles\n" );
}
else
{
@@ -168,7 +168,7 @@ if( (tmp==STREAM_IO_WRITE) && sizeof(datatype) <= nBufFree)\
if( nBufActualPos > nBufActualLen )\
nBufActualLen = nBufActualPos;\
pBufPos += sizeof(datatype);\
- bIsDirty = TRUE;\
+ bIsDirty = sal_True;\
}\
else\
Write( (char*)&value, sizeof(datatype) );\
@@ -444,7 +444,7 @@ void SvStream::ImpInit()
eStreamCharSet = osl_getThreadTextEncoding();
// eTargetCharSet = osl_getThreadTextEncoding();
nCryptMask = 0;
- bIsEof = FALSE;
+ bIsEof = sal_False;
#if defined UNX
eLineDelimiter = LINEEND_LF; // UNIX-Format
#else
@@ -455,9 +455,9 @@ void SvStream::ImpInit()
nBufFilePos = 0;
nBufActualPos = 0;
- bIsDirty = FALSE;
- bIsConsistent = TRUE;
- bIsWritable = TRUE;
+ bIsDirty = sal_False;
+ bIsConsistent = sal_True;
+ bIsWritable = sal_True;
pRWBuf = 0;
pBufPos = 0;
@@ -544,7 +544,7 @@ sal_uInt16 SvStream::IsA() const
void SvStream::ClearError()
{
- bIsEof = FALSE;
+ bIsEof = sal_False;
nError = SVSTREAM_OK;
}
@@ -570,13 +570,13 @@ void SvStream::SetError( sal_uInt32 nErrorCode )
void SvStream::SetNumberFormatInt( sal_uInt16 nNewFormat )
{
nNumberFormatInt = nNewFormat;
- bSwap = FALSE;
+ bSwap = sal_False;
#ifdef OSL_BIGENDIAN
if( nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN )
- bSwap = TRUE;
+ bSwap = sal_True;
#else
if( nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN )
- bSwap = TRUE;
+ bSwap = sal_True;
#endif
}
@@ -605,8 +605,8 @@ void SvStream::SetBufferSize( sal_uInt16 nBufferSize )
nBufActualPos = 0;
nBufSize = nBufferSize;
if( nBufSize )
- pRWBuf = new BYTE[ nBufSize ];
- bIsConsistent = TRUE;
+ pRWBuf = new sal_uInt8[ nBufSize ];
+ bIsConsistent = sal_True;
pBufPos = pRWBuf;
eIOMode = STREAM_IO_DONTKNOW;
if( !bDontSeek )
@@ -625,11 +625,11 @@ void SvStream::ClearBuffer()
nBufActualPos = 0;
nBufFilePos = 0;
pBufPos = pRWBuf;
- bIsDirty = FALSE;
- bIsConsistent = TRUE;
+ bIsDirty = sal_False;
+ bIsConsistent = sal_True;
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
}
/*************************************************************************
@@ -662,7 +662,7 @@ sal_Bool SvStream::ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSe
sal_Bool SvStream::ReadLine( ByteString& rStr )
{
sal_Char buf[256+1];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nOldFilePos = Tell();
sal_Char c = 0;
sal_Size nTotalLen = 0;
@@ -678,8 +678,8 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
if ( rStr.Len() == 0 )
{
// der allererste Blockread hat fehlgeschlagen -> Abflug
- bIsEof = TRUE;
- return FALSE;
+ bIsEof = sal_True;
+ return sal_False;
}
else
break;
@@ -691,7 +691,7 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
c = buf[j];
if ( c == '\n' || c == '\r' )
{
- bEnd = TRUE;
+ bEnd = sal_True;
break;
}
// erAck 26.02.01: Old behavior was no special treatment of '\0'
@@ -711,7 +711,7 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
}
if ( !bEnd && !GetError() && rStr.Len() )
- bEnd = TRUE;
+ bEnd = sal_True;
nOldFilePos += nTotalLen;
if( Tell() > nOldFilePos )
@@ -729,14 +729,14 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
}
if ( bEnd )
- bIsEof = FALSE;
+ bIsEof = sal_False;
return bEnd;
}
sal_Bool SvStream::ReadUniStringLine( String& rStr )
{
sal_Unicode buf[256+1];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nOldFilePos = Tell();
sal_Unicode c = 0;
sal_Size nTotalLen = 0;
@@ -755,8 +755,8 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
if ( rStr.Len() == 0 )
{
// der allererste Blockread hat fehlgeschlagen -> Abflug
- bIsEof = TRUE;
- return FALSE;
+ bIsEof = sal_True;
+ return sal_False;
}
else
break;
@@ -770,7 +770,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
c = buf[j];
if ( c == '\n' || c == '\r' )
{
- bEnd = TRUE;
+ bEnd = sal_True;
break;
}
// erAck 26.02.01: Old behavior was no special treatment of '\0'
@@ -790,7 +790,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
}
if ( !bEnd && !GetError() && rStr.Len() )
- bEnd = TRUE;
+ bEnd = sal_True;
nOldFilePos += nTotalLen * sizeof(sal_Unicode);
if( Tell() > nOldFilePos )
@@ -808,7 +808,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
}
if ( bEnd )
- bIsEof = FALSE;
+ bIsEof = sal_False;
return bEnd;
}
@@ -832,7 +832,7 @@ sal_Bool SvStream::ReadCString( ByteString& rStr )
rStr.Erase();
sal_Char buf[ 256 + 1 ];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nFilePos = Tell();
while( !bEnd && !GetError() )
@@ -1008,7 +1008,7 @@ sal_Bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCha
sal_Bool SvStream::StartWritingUnicodeText()
{
- SetEndianSwap( FALSE ); // write native format
+ SetEndianSwap( sal_False ); // write native format
// BOM, Byte Order Mark, U+FEFF, see
// http://www.unicode.org/faq/utf_bom.html#BOM
// Upon read: 0xfeff(-257) => no swap; 0xfffe(-2) => swap
@@ -1022,21 +1022,59 @@ sal_Bool SvStream::StartWritingUnicodeText()
|*
*************************************************************************/
-sal_Bool SvStream::StartReadingUnicodeText()
+sal_Bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet )
{
+ if (!( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ return sal_True; // nothing to read
+
+ bool bTryUtf8 = false;
sal_uInt16 nFlag;
+ sal_sSize nBack = sizeof(nFlag);
*this >> nFlag;
switch ( nFlag )
{
case 0xfeff :
- // native
+ // native UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ nBack = 0;
break;
case 0xfffe :
- SetEndianSwap( !bSwap );
+ // swapped UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ {
+ SetEndianSwap( !bSwap );
+ nBack = 0;
+ }
+ break;
+ case 0xefbb :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
+ break;
+ case 0xbbef :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
break;
default:
- SeekRel( -((sal_sSize)sizeof(nFlag)) ); // no BOM, pure data
+ ; // nothing
+ }
+ if (bTryUtf8)
+ {
+ sal_uChar nChar;
+ nBack += sizeof(nChar);
+ *this >> nChar;
+ if (nChar == 0xbf)
+ nBack = 0; // it is UTF-8
}
+ if (nBack)
+ SeekRel( -nBack ); // no BOM, pure data
return nError == SVSTREAM_OK;
}
@@ -1370,7 +1408,7 @@ SvStream& SvStream::operator<< ( signed char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--; // = sizeof(char);
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(signed char) );
@@ -1391,7 +1429,7 @@ SvStream& SvStream::operator<< ( char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--; // = sizeof(char);
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(char) );
@@ -1410,7 +1448,7 @@ SvStream& SvStream::operator<< ( unsigned char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(char) );
@@ -1607,7 +1645,7 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
CryptAndWriteBuffer(pRWBuf, nBufActualLen);
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
// passt der Datenblock in den Puffer ?
@@ -1652,10 +1690,10 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
}
}
}
- bIsEof = FALSE;
+ bIsEof = sal_False;
nBufFree = nBufActualLen - nBufActualPos;
if( nCount != nSaveCount && nError != ERRCODE_IO_PENDING )
- bIsEof = TRUE;
+ bIsEof = sal_True;
if( nCount == nSaveCount && nError == ERRCODE_IO_PENDING )
nError = ERRCODE_NONE;
return nCount;
@@ -1699,7 +1737,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
nBufActualLen = nBufActualPos;
pBufPos += nCount;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
{
@@ -1711,7 +1749,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
// passt der Block in den Puffer ?
@@ -1739,7 +1777,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
nBufActualPos = (sal_uInt16)nCount;
pBufPos = pRWBuf + nCount;
nBufActualLen = (sal_uInt16)nCount;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
}
nBufFree = nBufSize - nBufActualPos;
@@ -1757,7 +1795,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
{
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
if( !pRWBuf )
{
nBufFilePos = SeekPos( nFilePos );
@@ -1783,7 +1821,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
CryptAndWriteBuffer( pRWBuf, nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
nBufActualLen = 0;
nBufActualPos = 0;
@@ -1815,7 +1853,7 @@ void SvStream::Flush()
else
if( PutData( pRWBuf, nBufActualLen ) != nBufActualLen )
SetError( SVSTREAM_WRITE_ERROR );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
if( bIsWritable )
FlushData();
@@ -1855,9 +1893,9 @@ SvStream& SvStream::PutBack( char aCh )
CryptAndWriteBuffer( pRWBuf, nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
- bIsConsistent = FALSE; // Puffer enthaelt jetzt TRASH
+ bIsConsistent = sal_False; // Puffer enthaelt jetzt TRASH
if( nBufActualPos )
{
// 1. Fall
@@ -1886,7 +1924,7 @@ SvStream& SvStream::PutBack( char aCh )
*pRWBuf = aCh;
}
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -1921,7 +1959,7 @@ void SvStream::RefreshBuffer()
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
SeekPos( nBufFilePos );
nBufActualLen = (sal_uInt16)GetData( pRWBuf, nBufSize );
@@ -1929,7 +1967,7 @@ void SvStream::RefreshBuffer()
nError = ERRCODE_NONE;
if( nCryptMask )
EncryptBuffer(pRWBuf, (sal_Size)nBufActualLen);
- bIsConsistent = TRUE;
+ bIsConsistent = sal_True;
eIOMode = STREAM_IO_DONTKNOW;
}
@@ -1999,7 +2037,7 @@ SvStream& SvStream::ReadNumber( long& rLong )
rLong = strtol( buf, &pEndPtr, (int)nRadix );
nFPtr += ( (sal_Size)pEndPtr - (sal_Size)(&(buf[0])) );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2024,7 +2062,7 @@ SvStream& SvStream::ReadNumber( sal_uInt32& rUInt32 )
rUInt32 = strtoul( buf, &pEndPtr, (int)nRadix );
nFPtr += ( (sal_uIntPtr)pEndPtr - (sal_uIntPtr)buf );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2049,7 +2087,7 @@ SvStream& SvStream::ReadNumber( double& rDouble )
rDouble = strtod( buf, &pEndPtr );
nFPtr += ( (sal_Size)pEndPtr - (sal_Size)buf );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2204,7 +2242,7 @@ sal_Bool SvStream::EncryptBuffer(void* pStart, sal_Size nLen)
aCh ^= nMask;
*pTemp = aCh;
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -2361,12 +2399,12 @@ SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize,
StreamMode eMode )
{
if( eMode & STREAM_WRITE )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
else
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
nEndOfData = bufSize;
- bOwnsData = FALSE;
- pBuf = (BYTE *) pBuffer;
+ bOwnsData = sal_False;
+ pBuf = (sal_uInt8 *) pBuffer;
nResize = 0L;
nSize = bufSize;
nPos = 0L;
@@ -2381,8 +2419,8 @@ SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize,
SvMemoryStream::SvMemoryStream( sal_Size nInitSize, sal_Size nResizeOffset )
{
- bIsWritable = TRUE;
- bOwnsData = TRUE;
+ bIsWritable = sal_True;
+ bOwnsData = sal_True;
nEndOfData = 0L;
nResize = nResizeOffset;
nPos = 0;
@@ -2448,7 +2486,7 @@ void* SvMemoryStream::SetBuffer( void* pNewBuf, sal_Size nCount,
else
pResult = pBuf;
- pBuf = (BYTE *) pNewBuf;
+ pBuf = (sal_uInt8 *) pNewBuf;
nPos = 0;
nSize = nCount;
nResize = 0;
@@ -2612,7 +2650,7 @@ void SvMemoryStream::ResetError()
sal_Bool SvMemoryStream::AllocateMemory( sal_Size nNewSize )
{
- pBuf = new BYTE[nNewSize];
+ pBuf = new sal_uInt8[nNewSize];
return( pBuf != 0 );
}
@@ -2624,18 +2662,18 @@ sal_Bool SvMemoryStream::AllocateMemory( sal_Size nNewSize )
sal_Bool SvMemoryStream::ReAllocateMemory( long nDiff )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
long nTemp = (long)nSize;
nTemp += nDiff;
sal_Size nNewSize = (sal_Size)nTemp;
if( nNewSize )
{
- BYTE* pNewBuf = new BYTE[nNewSize];
+ sal_uInt8* pNewBuf = new sal_uInt8[nNewSize];
if( pNewBuf )
{
- bRetVal = TRUE; // Success!
+ bRetVal = sal_True; // Success!
if( nNewSize < nSize ) // Verkleinern ?
{
memcpy( pNewBuf, pBuf, (size_t)nNewSize );
@@ -2657,7 +2695,7 @@ sal_Bool SvMemoryStream::ReAllocateMemory( long nDiff )
}
else
{
- bRetVal = TRUE;
+ bRetVal = sal_True;
FreeMemory();
pBuf = 0;
nSize = 0;
diff --git a/tools/source/stream/strmos2.cxx b/tools/source/stream/strmos2.cxx
index 226c75f1d6f9..3957910cbfdb 100644
--- a/tools/source/stream/strmos2.cxx
+++ b/tools/source/stream/strmos2.cxx
@@ -58,20 +58,20 @@ class StreamData
{
public:
HFILE hFile;
- BOOL bIsEof;
+ sal_Bool bIsEof;
StreamData()
{
hFile = 0;
- bIsEof = TRUE;
+ bIsEof = sal_True;
}
};
// -----------------------------------------------------------------------
-ULONG GetSvError( APIRET nPMError )
+sal_uIntPtr GetSvError( APIRET nPMError )
{
- static struct { APIRET pm; ULONG sv; } errArr[] =
+ static struct { APIRET pm; sal_uIntPtr sv; } errArr[] =
{
{ ERROR_FILE_NOT_FOUND, SVSTREAM_FILE_NOT_FOUND },
{ ERROR_PATH_NOT_FOUND, SVSTREAM_PATH_NOT_FOUND },
@@ -92,7 +92,7 @@ ULONG GetSvError( APIRET nPMError )
{ 0xFFFF, SVSTREAM_GENERALERROR }
};
- ULONG nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
+ sal_uIntPtr nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
int i=0;
do
{
@@ -115,9 +115,9 @@ ULONG GetSvError( APIRET nPMError )
SvFileStream::SvFileStream( const String& rFileName, StreamMode nOpenMode )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -137,9 +137,9 @@ SvFileStream::SvFileStream( const String& rFileName, StreamMode nOpenMode )
SvFileStream::SvFileStream()
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
}
@@ -163,9 +163,9 @@ SvFileStream::~SvFileStream()
|*
*************************************************************************/
-ULONG SvFileStream::GetFileHandle() const
+sal_uIntPtr SvFileStream::GetFileHandle() const
{
- return (ULONG)pInstanceData->hFile;
+ return (sal_uIntPtr)pInstanceData->hFile;
}
/*************************************************************************
@@ -174,7 +174,7 @@ ULONG SvFileStream::GetFileHandle() const
|*
*************************************************************************/
-USHORT SvFileStream::IsA() const
+sal_uInt16 SvFileStream::IsA() const
{
return ID_FILESTREAM;
}
@@ -187,7 +187,7 @@ USHORT SvFileStream::IsA() const
|*
*************************************************************************/
-ULONG SvFileStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::GetData( void* pData, sal_uIntPtr nSize )
{
#ifdef DBG_UTIL
ByteString aTraceStr( "SvFileStream::GetData(): " );
@@ -197,7 +197,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
OSL_TRACE( "%s", aTraceStr.GetBuffer() );
#endif
- ULONG nCount = 0L;
+ sal_uIntPtr nCount = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -214,7 +214,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::PutData( const void* pData, sal_uIntPtr nSize )
{
#ifdef DBG_UTIL
ByteString aTraceStr( "SvFileStrean::PutData: " );
@@ -224,7 +224,7 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
OSL_TRACE( "%s", aTraceStr.GetBuffer() );
#endif
- ULONG nCount = 0L;
+ sal_uIntPtr nCount = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -243,9 +243,9 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvFileStream::SeekPos( sal_uIntPtr nPos )
{
- ULONG nNewPos = 0L;
+ sal_uIntPtr nNewPos = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -271,9 +271,9 @@ ULONG SvFileStream::SeekPos( ULONG nPos )
|*
*************************************************************************/
/*
-ULONG SvFileStream::Tell()
+sal_uIntPtr SvFileStream::Tell()
{
- ULONG nPos = 0L;
+ sal_uIntPtr nPos = 0L;
if( IsOpen() )
{
@@ -309,9 +309,9 @@ void SvFileStream::FlushData()
|*
*************************************************************************/
-sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::LockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( IsOpen() )
{
APIRET nResult;
@@ -330,7 +330,7 @@ sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
if( nResult )
SetError(::GetSvError(nResult) );
else
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -341,9 +341,9 @@ sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::UnlockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( IsOpen() )
{
APIRET nResult;
@@ -362,7 +362,7 @@ sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
if( nResult )
SetError(::GetSvError(nResult) );
else
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -375,19 +375,19 @@ sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
sal_Bool SvFileStream::LockFile()
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( !nLockCounter )
{
if( LockRange( 0L, LONG_MAX ) )
{
nLockCounter = 1;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter++;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -400,7 +400,7 @@ sal_Bool SvFileStream::LockFile()
sal_Bool SvFileStream::UnlockFile()
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( nLockCounter > 0)
{
if( nLockCounter == 1)
@@ -408,13 +408,13 @@ sal_Bool SvFileStream::UnlockFile()
if( UnlockRange( 0L, LONG_MAX ) )
{
nLockCounter = 0;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter--;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
return bRetVal;
@@ -437,10 +437,10 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
Close();
SvStream::ClearBuffer();
- ULONG nActionTaken;
- ULONG nOpenAction = 0L;
- ULONG nShareBits = 0L;
- ULONG nReadWriteBits = 0L;
+ sal_uIntPtr nActionTaken;
+ sal_uIntPtr nOpenAction = 0L;
+ sal_uIntPtr nShareBits = 0L;
+ sal_uIntPtr nReadWriteBits = 0L;
eStreamMode = nOpenMode;
eStreamMode &= ~STREAM_TRUNC; // beim ReOpen nicht cutten
@@ -508,7 +508,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
if( nRet == ERROR_TOO_MANY_OPEN_FILES )
{
long nToAdd = 10;
- ULONG nCurMaxFH;
+ sal_uIntPtr nCurMaxFH;
nRet = DosSetRelMaxFH( &nToAdd, &nCurMaxFH );
nRet = DosOpen( aFileNameA.GetBuffer(), &pInstanceData->hFile,
&nActionTaken, 0L, FILE_NORMAL, nOpenAction,
@@ -526,15 +526,15 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
if( nRet )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
SetError(::GetSvError(nRet) );
}
else
{
- bIsOpen = TRUE;
- pInstanceData->bIsEof = FALSE;
+ bIsOpen = sal_True;
+ pInstanceData->bIsEof = sal_False;
if( nReadWriteBits != OPEN_ACCESS_READONLY )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
}
}
@@ -575,10 +575,10 @@ void SvFileStream::Close()
DosClose( pInstanceData->hFile );
}
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter= 0;
- bIsWritable = FALSE;
- pInstanceData->bIsEof = TRUE;
+ bIsWritable = sal_False;
+ pInstanceData->bIsEof = sal_True;
SvStream::ClearBuffer();
SvStream::ClearError();
}
@@ -602,7 +602,7 @@ void SvFileStream::ResetError()
|*
*************************************************************************/
-void SvFileStream::SetSize( ULONG nSize )
+void SvFileStream::SetSize( sal_uIntPtr nSize )
{
if( IsOpen() )
{
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index bcfbb0fd03e8..62ed9e2df6c8 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -64,9 +64,9 @@ public:
// -----------------------------------------------------------------------
-static ULONG GetSvError( DWORD nWntError )
+static sal_uIntPtr GetSvError( DWORD nWntError )
{
- static struct { DWORD wnt; ULONG sv; } errArr[] =
+ static struct { DWORD wnt; sal_uIntPtr sv; } errArr[] =
{
{ ERROR_SUCCESS, SVSTREAM_OK },
{ ERROR_ACCESS_DENIED, SVSTREAM_ACCESS_DENIED },
@@ -106,7 +106,7 @@ static ULONG GetSvError( DWORD nWntError )
{ (DWORD)0xFFFFFFFF, SVSTREAM_GENERALERROR }
};
- ULONG nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
+ sal_uIntPtr nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
int i=0;
do
{
@@ -128,9 +128,9 @@ static ULONG GetSvError( DWORD nWntError )
SvFileStream::SvFileStream( const String& rFileName, StreamMode nMode )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -150,9 +150,9 @@ SvFileStream::SvFileStream( const String& rFileName, StreamMode nMode )
SvFileStream::SvFileStream()
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -177,17 +177,9 @@ SvFileStream::~SvFileStream()
|*
*************************************************************************/
-sal_uInt32 SvFileStream::GetFileHandle() const
+sal_uIntPtr SvFileStream::GetFileHandle() const
{
- // Note that this method is broken on 64-bit as it would return
- // only the lower 32 bits of a file handle. (As such, it might be
- // that on 64-bit Windows, even in a 64-bit process, the upper 32
- // bits of handles are always zero? But surely we should not rely
- // on that.) On the other hand, this method is private in
- // SvFileStream and isn't used anywhere for Windows. So make sure
- // it doesn't get used in the future either, just abort().
- abort( );
- return 0;
+ return (sal_uIntPtr)pInstanceData->hFile;
}
/*************************************************************************
@@ -196,7 +188,7 @@ sal_uInt32 SvFileStream::GetFileHandle() const
|*
*************************************************************************/
-USHORT SvFileStream::IsA() const
+sal_uInt16 SvFileStream::IsA() const
{
return ID_FILESTREAM;
}
@@ -209,7 +201,7 @@ USHORT SvFileStream::IsA() const
|*
*************************************************************************/
-ULONG SvFileStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::GetData( void* pData, sal_uIntPtr nSize )
{
DWORD nCount = 0;
if( IsOpen() )
@@ -217,7 +209,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
bool bResult = ReadFile(pInstanceData->hFile,(LPVOID)pData,nSize,&nCount,NULL);
if( !bResult )
{
- ULONG nTestError = GetLastError();
+ sal_uIntPtr nTestError = GetLastError();
SetError(::GetSvError( nTestError ) );
}
}
@@ -230,7 +222,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::PutData( const void* pData, sal_uIntPtr nSize )
{
DWORD nCount = 0;
if( IsOpen() )
@@ -247,7 +239,7 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvFileStream::SeekPos( sal_uIntPtr nPos )
{
DWORD nNewPos = 0;
if( IsOpen() )
@@ -266,7 +258,7 @@ ULONG SvFileStream::SeekPos( ULONG nPos )
}
else
SetError( SVSTREAM_GENERALERROR );
- return (ULONG)nNewPos;
+ return (sal_uIntPtr)nNewPos;
}
/*************************************************************************
@@ -290,7 +282,7 @@ void SvFileStream::FlushData()
|*
*************************************************************************/
-BOOL SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::LockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
bool bRetVal = false;
if( IsOpen() )
@@ -308,7 +300,7 @@ BOOL SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-BOOL SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::UnlockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
bool bRetVal = false;
if( IsOpen() )
@@ -326,21 +318,21 @@ BOOL SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-BOOL SvFileStream::LockFile()
+sal_Bool SvFileStream::LockFile()
{
- BOOL bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( !nLockCounter )
{
if( LockRange( 0L, LONG_MAX ) )
{
nLockCounter = 1;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter++;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -351,9 +343,9 @@ BOOL SvFileStream::LockFile()
|*
*************************************************************************/
-BOOL SvFileStream::UnlockFile()
+sal_Bool SvFileStream::UnlockFile()
{
- BOOL bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( nLockCounter > 0)
{
if( nLockCounter == 1)
@@ -361,13 +353,13 @@ BOOL SvFileStream::UnlockFile()
if( UnlockRange( 0L, LONG_MAX ) )
{
nLockCounter = 0;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter--;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
return bRetVal;
@@ -474,7 +466,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode )
if( (pInstanceData->hFile==INVALID_HANDLE_VALUE) &&
(nAccessMode & GENERIC_WRITE))
{
- ULONG nErr = ::GetSvError( GetLastError() );
+ sal_uIntPtr nErr = ::GetSvError( GetLastError() );
if(nErr==SVSTREAM_ACCESS_DENIED || nErr==SVSTREAM_SHARING_VIOLATION)
{
nMode &= (~STREAM_WRITE);
@@ -499,15 +491,15 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode )
if( GetLastError() != ERROR_SUCCESS )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
SetError(::GetSvError( GetLastError() ) );
}
else
{
- bIsOpen = TRUE;
- // pInstanceData->bIsEof = FALSE;
+ bIsOpen = sal_True;
+ // pInstanceData->bIsEof = sal_False;
if( nAccessMode & GENERIC_WRITE )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
}
SetErrorMode( nOldErrorMode );
}
@@ -542,9 +534,9 @@ void SvFileStream::Close()
Flush();
CloseHandle( pInstanceData->hFile );
}
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter= 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
SvStream::ClearBuffer();
SvStream::ClearError();
}
@@ -568,24 +560,24 @@ void SvFileStream::ResetError()
|*
*************************************************************************/
-void SvFileStream::SetSize( ULONG nSize )
+void SvFileStream::SetSize( sal_uIntPtr nSize )
{
if( IsOpen() )
{
- int bError = FALSE;
+ int bError = sal_False;
HANDLE hFile = pInstanceData->hFile;
- ULONG nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT );
+ sal_uIntPtr nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT );
if( nOld != 0xffffffff )
{
if( SetFilePointer(hFile,nSize,NULL,FILE_BEGIN ) != 0xffffffff)
{
bool bSucc = SetEndOfFile( hFile );
if( !bSucc )
- bError = TRUE;
+ bError = sal_True;
}
if( SetFilePointer( hFile,nOld,NULL,FILE_BEGIN ) == 0xffffffff)
- bError = TRUE;
+ bError = sal_True;
}
if( bError )
SetError(::GetSvError( GetLastError() ) );
diff --git a/tools/source/stream/vcompat.cxx b/tools/source/stream/vcompat.cxx
index 77ab0ef5f840..227c3e05ddca 100644
--- a/tools/source/stream/vcompat.cxx
+++ b/tools/source/stream/vcompat.cxx
@@ -37,7 +37,7 @@
// - VersionCompat -
// -----------------
-VersionCompat::VersionCompat( SvStream& rStm, USHORT nStreamMode, USHORT nVersion ) :
+VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) :
mpRWStm ( &rStm ),
mnStmMode ( nStreamMode ),
mnVersion ( nVersion )
@@ -65,7 +65,7 @@ VersionCompat::~VersionCompat()
{
if( STREAM_WRITE == mnStmMode )
{
- const UINT32 nEndPos = mpRWStm->Tell();
+ const sal_uInt32 nEndPos = mpRWStm->Tell();
mpRWStm->Seek( mnCompatPos );
*mpRWStm << ( nEndPos - mnTotalSize );
@@ -73,7 +73,7 @@ VersionCompat::~VersionCompat()
}
else
{
- const UINT32 nReadSize = mpRWStm->Tell() - mnCompatPos;
+ const sal_uInt32 nReadSize = mpRWStm->Tell() - mnCompatPos;
if( mnTotalSize > nReadSize )
mpRWStm->SeekRel( mnTotalSize - nReadSize );
diff --git a/tools/source/string/makefile.mk b/tools/source/string/makefile.mk
deleted file mode 100644
index d99ef7be8c4a..000000000000
--- a/tools/source/string/makefile.mk
+++ /dev/null
@@ -1,89 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=str
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(OS)"!="AIX"
-ALWAYSDBGFILES = $(SLO)$/debugprint.obj
-.ENDIF
-
-.IF "$(ALWAYSDBGFILES)" != ""
-ALWAYSDBGTARGET=do_it_alwaysdebug
-.ENDIF
-
-SLOFILES= $(SLO)$/tstring.obj \
- $(SLO)$/tustring.obj \
- $(SLO)$/tenccvt.obj \
- $(SLO)$/reversemap.obj \
- $(SLO)$/debugprint.obj
-
-OBJFILES= $(OBJ)$/tstring.obj \
- $(OBJ)$/tustring.obj \
- $(OBJ)$/tenccvt.obj \
- $(OBJ)$/reversemap.obj \
- $(OBJ)$/debugprint.obj
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(ALWAYSDBG_FLAG)"==""
-TARGETDEPS+=$(ALWAYSDBGTARGET)
-.ENDIF
-
-.INCLUDE : target.mk
-
-$(INCCOM)$/reversemap.hxx: $(BIN)$/bestreversemap
- $(AUGMENT_LIBRARY_PATH) $(BIN)$/bestreversemap > $@
-
-$(SLO)$/reversemap.obj: $(INCCOM)$/reversemap.hxx
-$(OBJ)$/reversemap.obj: $(INCCOM)$/reversemap.hxx
-
-.IF "$(ALWAYSDBGTARGET)" != ""
-.IF "$(ALWAYSDBG_FLAG)" == ""
-# --------------------------------------------------
-# - ALWAYSDBG - files always compiled with debugging
-# --------------------------------------------------
-$(ALWAYSDBGTARGET):
- @echo --- ALWAYSDBGFILES ---
- @dmake $(MFLAGS) $(MAKEFILE) debug=true $(ALWAYSDBGFILES) ALWAYSDBG_FLAG=TRUE $(CALLMACROS)
- @echo --- ALWAYSDBGFILES OVER ---
-
-$(ALWAYSDBGFILES):
- @echo --- ALWAYSDBG ---
- @dmake $(MFLAGS) $(MAKEFILE) debug=true ALWAYSDBG_FLAG=TRUE $(CALLMACROS) $@
- @echo --- ALWAYSDBG OVER ---
-.ENDIF
-.ENDIF
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 95fc092ad799..f7729c99b305 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -32,17 +32,17 @@
#ifdef DBG_UTIL
-static BOOL ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen )
+static sal_Bool ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen )
{
while ( nLen && *pAsciiStr )
{
if ( ((unsigned char)*pAsciiStr) > 127 )
- return FALSE;
+ return sal_False;
++pAsciiStr,
--nLen;
}
- return TRUE;
+ return sal_True;
}
#endif
@@ -505,7 +505,7 @@ StringCompare UniString::CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
// -----------------------------------------------------------------------
-BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
@@ -516,7 +516,7 @@ BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
// -----------------------------------------------------------------------
-BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
@@ -527,7 +527,7 @@ BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
// -----------------------------------------------------------------------
-BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr,
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
@@ -543,7 +543,7 @@ BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr,
// -----------------------------------------------------------------------
-BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx
index 81588c48e6cf..54169c3c0716 100644
--- a/tools/source/string/strcvt.cxx
+++ b/tools/source/string/strcvt.cxx
@@ -228,7 +228,7 @@ sal_Unicode* ImplGet1ByteUnicodeTab( rtl_TextEncoding eTextEncoding )
static sal_uChar* ImplGet1ByteConvertTab( rtl_TextEncoding eSrcTextEncoding,
rtl_TextEncoding eDestTextEncoding,
- BOOL bReplace )
+ sal_Bool bReplace )
{
#ifndef BOOTSTRAP
TOOLSINDATA* pToolsData = ImplGetToolsInData();
@@ -354,7 +354,7 @@ void ImplDeleteCharTabData()
// =======================================================================
void ByteString::ImplStringConvert(
- rtl_TextEncoding eSource, rtl_TextEncoding eTarget, BOOL bReplace )
+ rtl_TextEncoding eSource, rtl_TextEncoding eTarget, sal_Bool bReplace )
{
sal_uChar* pConvertTab = ImplGet1ByteConvertTab( eSource, eTarget, bReplace );
if ( pConvertTab )
@@ -410,7 +410,7 @@ void ByteString::ImplStringConvert(
// =======================================================================
-ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, BOOL bReplace )
+ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, sal_Bool bReplace )
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -443,7 +443,7 @@ ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTar
char ByteString::Convert( char c,
rtl_TextEncoding eSource, rtl_TextEncoding eTarget,
- BOOL bReplace )
+ sal_Bool bReplace )
{
// TextEncoding Dontknow kann nicht konvertiert werden
if ( (eSource == RTL_TEXTENCODING_DONTKNOW) || (eTarget == RTL_TEXTENCODING_DONTKNOW) )
@@ -481,7 +481,7 @@ sal_Unicode ByteString::ConvertToUnicode( char c, rtl_TextEncoding eTextEncoding
// -----------------------------------------------------------------------
-char ByteString::ConvertFromUnicode( sal_Unicode c, rtl_TextEncoding eTextEncoding, BOOL bReplace )
+char ByteString::ConvertFromUnicode( sal_Unicode c, rtl_TextEncoding eTextEncoding, sal_Bool bReplace )
{
sal_Size nLen;
char aBuf[30];
@@ -531,7 +531,7 @@ sal_Unicode ByteString::ConvertToUnicode( const char* pChar, sal_Size* pLen, rtl
// -----------------------------------------------------------------------
sal_Size ByteString::ConvertFromUnicode( sal_Unicode c, char* pBuf, sal_Size nBufLen, rtl_TextEncoding eTextEncoding,
- BOOL bReplace )
+ sal_Bool bReplace )
{
// TextEncoding Dontknow wird nicht konvertiert
if ( eTextEncoding == RTL_TEXTENCODING_DONTKNOW )
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index dd7ad23326c1..21065f999958 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -1142,7 +1142,7 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd )
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
// Zeilenumbrueche ermitteln und neue Laenge berechnen
- BOOL bConvert = FALSE; // Muss konvertiert werden
+ sal_Bool bConvert = sal_False; // Muss konvertiert werden
const STRCODE* pStr = mpData->maStr; // damit es schneller geht
xub_StrLen nLineEndLen = (eLineEnd == LINEEND_CRLF) ? 2 : 1;
xub_StrLen nLen = 0; // Ziel-Laenge
@@ -1165,7 +1165,7 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd )
((pStr[i] == _CR) || (pStr[i+1] == _CR))) ||
((eLineEnd == LINEEND_CR) &&
((pStr[i] == _LF) || (pStr[i+1] == _LF))) )
- bConvert = TRUE;
+ bConvert = sal_True;
}
// \r\n oder \n\r, dann Zeichen ueberspringen
@@ -1328,18 +1328,18 @@ StringCompare STRING::CompareIgnoreCaseToAscii( const STRCODE* pCharStr,
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRING& rStr ) const
+sal_Bool STRING::Equals( const STRING& rStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
// Sind die Daten gleich
if ( mpData == rStr.mpData )
- return TRUE;
+ return sal_True;
// Gleiche Laenge
if ( mpData->mnLen != rStr.mpData->mnLen )
- return FALSE;
+ return sal_False;
// String vergleichen
return (ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
@@ -1347,7 +1347,7 @@ BOOL STRING::Equals( const STRING& rStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRCODE* pCharStr ) const
+sal_Bool STRING::Equals( const STRCODE* pCharStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1356,18 +1356,18 @@ BOOL STRING::Equals( const STRCODE* pCharStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
// Sind die Daten gleich
if ( mpData == rStr.mpData )
- return TRUE;
+ return sal_True;
// Gleiche Laenge
if ( mpData->mnLen != rStr.mpData->mnLen )
- return FALSE;
+ return sal_False;
// String vergleichen
return (ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
@@ -1375,7 +1375,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1384,7 +1384,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
@@ -1396,7 +1396,7 @@ BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) co
if ( nMaxLen < nLen )
{
if ( rStr.mpData->mnLen != nMaxLen )
- return FALSE;
+ return sal_False;
nLen = static_cast< xub_StrLen >(nMaxLen);
}
@@ -1406,7 +1406,7 @@ BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) co
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1419,7 +1419,7 @@ BOOL STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
@@ -1431,7 +1431,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_S
if ( nMaxLen < nLen )
{
if ( rStr.mpData->mnLen != nMaxLen )
- return FALSE;
+ return sal_False;
nLen = static_cast< xub_StrLen >(nMaxLen);
}
@@ -1441,7 +1441,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_S
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/tools/source/string/tenccvt.cxx b/tools/source/string/tenccvt.cxx
index c259e63817c7..e4ffa7791180 100644
--- a/tools/source/string/tenccvt.cxx
+++ b/tools/source/string/tenccvt.cxx
@@ -85,14 +85,14 @@ rtl_TextEncoding GetOneByteTextEncoding( rtl_TextEncoding eEncoding )
// -----------------------------------------------------------------------
-rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, USHORT /* nVersion = SOFFICE_FILEFORMAT_50 */ )
+rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 /* nVersion = SOFFICE_FILEFORMAT_50 */ )
{
return GetExtendedCompatibilityTextEncoding( GetOneByteTextEncoding( eEncoding ) );
}
// -----------------------------------------------------------------------
-rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, USHORT /* nVersion = SOFFICE_FILEFORMAT_50 */ )
+rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 /* nVersion = SOFFICE_FILEFORMAT_50 */ )
{
return GetExtendedTextEncoding( GetOneByteTextEncoding( eEncoding ) );
}
diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx
index 10b9cef09965..c7a5f380fb72 100644
--- a/tools/source/string/tstring.cxx
+++ b/tools/source/string/tstring.cxx
@@ -181,7 +181,7 @@ double ByteString::ToDouble() const
// -----------------------------------------------------------------------
-BOOL ByteString::IsLowerAscii() const
+sal_Bool ByteString::IsLowerAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -191,18 +191,18 @@ BOOL ByteString::IsLowerAscii() const
while ( nIndex < nLen )
{
if ( (*pStr >= 65) && (*pStr <= 90) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsUpperAscii() const
+sal_Bool ByteString::IsUpperAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -212,18 +212,18 @@ BOOL ByteString::IsUpperAscii() const
while ( nIndex < nLen )
{
if ( (*pStr >= 97) && (*pStr <= 122) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsAlphaAscii() const
+sal_Bool ByteString::IsAlphaAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -234,18 +234,18 @@ BOOL ByteString::IsAlphaAscii() const
{
if ( !(((*pStr >= 97) && (*pStr <= 122)) ||
((*pStr >= 65) && (*pStr <= 90))) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsNumericAscii() const
+sal_Bool ByteString::IsNumericAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -255,18 +255,18 @@ BOOL ByteString::IsNumericAscii() const
while ( nIndex < nLen )
{
if ( !((*pStr >= 48) && (*pStr <= 57)) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsAlphaNumericAscii() const
+sal_Bool ByteString::IsAlphaNumericAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -278,13 +278,13 @@ BOOL ByteString::IsAlphaNumericAscii() const
if ( !(((*pStr >= 97) && (*pStr <= 122)) ||
((*pStr >= 65) && (*pStr <= 90)) ||
((*pStr >= 48) && (*pStr <= 57))) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/testtoolloader/makefile.mk b/tools/source/testtoolloader/makefile.mk
deleted file mode 100644
index 3d5cb8223e3f..000000000000
--- a/tools/source/testtoolloader/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=TOOLS
-TARGET=testtoolloader
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/testtoolloader.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx
index ae685a81df2e..f479faa5aa07 100644
--- a/tools/source/testtoolloader/testtoolloader.cxx
+++ b/tools/source/testtoolloader/testtoolloader.cxx
@@ -135,7 +135,7 @@ void InitTestToolLib()
if ( pInitFunc )
{
(reinterpret_cast< pfunc_CreateEventLogger >(pInitFunc))();
- bLoggerStarted = TRUE;
+ bLoggerStarted = sal_True;
}
else
{
@@ -172,7 +172,7 @@ void DeInitTestToolLib()
if ( pDeInitFunc )
{
(reinterpret_cast< pfunc_DestroyEventLogger >(pDeInitFunc))();
- bLoggerStarted = FALSE;
+ bLoggerStarted = sal_False;
}
}
diff --git a/tools/source/zcodec/makefile.mk b/tools/source/zcodec/makefile.mk
deleted file mode 100644
index 9067b45c3b5d..000000000000
--- a/tools/source/zcodec/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=zcodec
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_ZLIB)" == "YES"
-CFLAGS+=-DSYSTEM_ZLIB
-.ENDIF
-SLOFILES= $(SLO)$/zcodec.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index c86983d41799..2386415a4266 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -61,7 +61,7 @@ static int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
// - ZCodec -
// ----------
-ZCodec::ZCodec( ULONG nInBufSize, ULONG nOutBufSize, ULONG nMemUsage )
+ZCodec::ZCodec( sal_uIntPtr nInBufSize, sal_uIntPtr nOutBufSize, sal_uIntPtr nMemUsage )
: mnCRC(0)
{
mnMemUsage = nMemUsage;
@@ -88,11 +88,11 @@ ZCodec::~ZCodec()
// ------------------------------------------------------------------------
-void ZCodec::BeginCompression( ULONG nCompressMethod )
+void ZCodec::BeginCompression( sal_uIntPtr nCompressMethod )
{
mbInit = 0;
- mbStatus = TRUE;
- mbFinish = FALSE;
+ mbStatus = sal_True;
+ mbFinish = sal_False;
mpIStm = mpOStm = NULL;
mnInToRead = 0xffffffff;
mpInBuf = mpOutBuf = NULL;
@@ -147,8 +147,8 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
{
mpIStm = &rIStm;
mpOStm = &rOStm;
- ImplInitBuf( FALSE );
- mpInBuf = new BYTE[ mnInBufSize ];
+ ImplInitBuf( sal_False );
+ mpInBuf = new sal_uInt8[ mnInBufSize ];
}
while (( PZSTREAM->avail_in = mpIStm->Read( PZSTREAM->next_in = mpInBuf, mnInBufSize )) != 0 )
{
@@ -156,7 +156,7 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
ImplWriteBack();
if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
};
@@ -168,7 +168,7 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
{
int err;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
long nOldTotal_Out = PZSTREAM->total_out;
if ( mbFinish )
@@ -178,8 +178,8 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
{
mpIStm = &rIStm;
mpOStm = &rOStm;
- ImplInitBuf( TRUE );
- PZSTREAM->next_out = mpOutBuf = new BYTE[ PZSTREAM->avail_out = mnOutBufSize ];
+ ImplInitBuf( sal_True );
+ PZSTREAM->next_out = mpOutBuf = new sal_uInt8[ PZSTREAM->avail_out = mnOutBufSize ];
}
do
{
@@ -197,7 +197,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
err = inflate( PZSTREAM, Z_NO_FLUSH );
if ( err < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
@@ -206,18 +206,18 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
ImplWriteBack();
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return ( mbStatus ) ? (long)(PZSTREAM->total_out - nOldTotal_Out) : -1;
}
// ------------------------------------------------------------------------
-long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
+long ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize )
{
if ( mbInit == 0 )
{
mpOStm = &rOStm;
- ImplInitBuf( FALSE );
+ ImplInitBuf( sal_False );
}
PZSTREAM->avail_in = nSize;
@@ -230,7 +230,7 @@ long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -239,10 +239,10 @@ long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
// ------------------------------------------------------------------------
-long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
+long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
{
int err;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -250,7 +250,7 @@ long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
mpIStm = &rIStm;
if ( mbInit == 0 )
{
- ImplInitBuf( TRUE );
+ ImplInitBuf( sal_True );
}
PZSTREAM->avail_out = nSize;
PZSTREAM->next_out = pData;
@@ -279,17 +279,17 @@ long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
(PZSTREAM->avail_out != 0) &&
(PZSTREAM->avail_in || mnInToRead) );
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return (mbStatus ? (long)(nSize - PZSTREAM->avail_out) : -1);
}
// ------------------------------------------------------------------------
-long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
+long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
{
int err = 0;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -297,7 +297,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
if ( mbInit == 0 )
{
mpIStm = &rIStm;
- ImplInitBuf( TRUE );
+ ImplInitBuf( sal_True );
}
PZSTREAM->avail_out = nSize;
PZSTREAM->next_out = pData;
@@ -307,9 +307,9 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
{
nInToRead = (mnInBufSize > mnInToRead) ? mnInToRead : mnInBufSize;
- ULONG nStreamPos = rIStm.Tell();
+ sal_uIntPtr nStreamPos = rIStm.Tell();
rIStm.Seek( STREAM_SEEK_TO_END );
- ULONG nMaxPos = rIStm.Tell();
+ sal_uIntPtr nMaxPos = rIStm.Tell();
rIStm.Seek( nStreamPos );
if ( ( nMaxPos - nStreamPos ) < nInToRead )
{
@@ -338,7 +338,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
(PZSTREAM->avail_out != 0) &&
(PZSTREAM->avail_in || mnInToRead) );
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return (mbStatus ? (long)(nSize - PZSTREAM->avail_out) : -1);
}
@@ -347,7 +347,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
void ZCodec::ImplWriteBack()
{
- ULONG nAvail = mnOutBufSize - PZSTREAM->avail_out;
+ sal_uIntPtr nAvail = mnOutBufSize - PZSTREAM->avail_out;
if ( nAvail )
{
@@ -360,35 +360,35 @@ void ZCodec::ImplWriteBack()
// ------------------------------------------------------------------------
-void ZCodec::SetBreak( ULONG nInToRead )
+void ZCodec::SetBreak( sal_uIntPtr nInToRead )
{
mnInToRead = nInToRead;
}
// ------------------------------------------------------------------------
-ULONG ZCodec::GetBreak( void )
+sal_uIntPtr ZCodec::GetBreak( void )
{
return ( mnInToRead + PZSTREAM->avail_in );
}
// ------------------------------------------------------------------------
-void ZCodec::SetCRC( ULONG nCRC )
+void ZCodec::SetCRC( sal_uIntPtr nCRC )
{
mnCRC = nCRC;
}
// ------------------------------------------------------------------------
-ULONG ZCodec::GetCRC()
+sal_uIntPtr ZCodec::GetCRC()
{
return mnCRC;
}
// ------------------------------------------------------------------------
-void ZCodec::ImplInitBuf ( BOOL nIOFlag )
+void ZCodec::ImplInitBuf ( sal_Bool nIOFlag )
{
if ( mbInit == 0 )
{
@@ -397,19 +397,19 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
mbInit = 1;
if ( mbStatus && ( mnCompressMethod & ZCODEC_GZ_LIB ) )
{
- BYTE n1, n2, j, nMethod, nFlags;
+ sal_uInt8 n1, n2, j, nMethod, nFlags;
for ( int i = 0; i < 2; i++ ) // gz - magic number
{
*mpIStm >> j;
if ( j != gz_magic[ i ] )
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
*mpIStm >> nMethod;
*mpIStm >> nFlags;
if ( nMethod != Z_DEFLATED )
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( ( nFlags & GZ_RESERVED ) != 0 )
- mbStatus = FALSE;
+ mbStatus = sal_False;
/* Discard time, xflags and OS code: */
mpIStm->SeekRel( 6 );
/* skip the extra field */
@@ -440,13 +440,13 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
if ( nFlags & GZ_HEAD_CRC )
mpIStm->SeekRel( 2 );
if ( mbStatus )
- mbStatus = ( inflateInit2( PZSTREAM, -MAX_WBITS) != Z_OK ) ? FALSE : TRUE;
+ mbStatus = ( inflateInit2( PZSTREAM, -MAX_WBITS) != Z_OK ) ? sal_False : sal_True;
}
else
{
mbStatus = ( inflateInit( PZSTREAM ) >= 0 );
}
- mpInBuf = new BYTE[ mnInBufSize ];
+ mpInBuf = new sal_uInt8[ mnInBufSize ];
}
else
{
@@ -456,14 +456,14 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
MAX_WBITS, mnMemUsage, ( mnCompressMethod >> 8 ) & 0xff,
ZLIB_VERSION, sizeof( z_stream ) ) >= 0 );
- PZSTREAM->next_out = mpOutBuf = new BYTE[ PZSTREAM->avail_out = mnOutBufSize ];
+ PZSTREAM->next_out = mpOutBuf = new sal_uInt8[ PZSTREAM->avail_out = mnOutBufSize ];
}
}
}
// ------------------------------------------------------------------------
-ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, ULONG nNumber )
+sal_uIntPtr ZCodec::UpdateCRC ( sal_uIntPtr nLatestCRC, sal_uIntPtr nNumber )
{
#ifdef OSL_LITENDIAN
@@ -474,14 +474,14 @@ ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, ULONG nNumber )
// ------------------------------------------------------------------------
-ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, BYTE* pSource, long nDatSize)
+sal_uIntPtr ZCodec::UpdateCRC ( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize)
{
return rtl_crc32( nLatestCRC, pSource, nDatSize );
}
// ------------------------------------------------------------------------
-void GZCodec::BeginCompression( ULONG nCompressMethod )
+void GZCodec::BeginCompression( sal_uIntPtr nCompressMethod )
{
ZCodec::BeginCompression( nCompressMethod | ZCODEC_GZ_LIB );
};
diff --git a/tools/test/makefile.mk b/tools/test/makefile.mk
deleted file mode 100644
index 573dd91f736d..000000000000
--- a/tools/test/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=tools
-TARGET=tests
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
-
-# --- Common ----------------------------------------------------------
-
-SHL1OBJS= \
- $(SLO)$/tests.obj
-
-SHL1TARGET= tests
-SHL1STDLIBS= $(SALLIB) \
- $(TOOLSLIB) \
- $(CPPUNITLIB)
-
-SHL1IMPLIB= i$(SHL1TARGET)
-
-DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = export.map
-
-#------------------------------- All object files ----------------------------
-
-# do this here, so we get right dependencies
-SLOFILES=$(SHL1OBJS)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
diff --git a/tools/unx/source/dll/makefile.mk b/tools/unx/source/dll/makefile.mk
deleted file mode 100644
index da1d73f04682..000000000000
--- a/tools/unx/source/dll/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=TOOLS
-TARGET=dll
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= toolsdll.cxx
-
-SLOFILES= $(SLO)$/toolsdll.obj
-
-OBJFILES= $(OBJ)$/toolsdll.obj
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/unx/source/dll/toolsdll.cxx b/tools/unx/source/dll/toolsdll.cxx
index 1d09e371afd2..c5bf8ecd8282 100644
--- a/tools/unx/source/dll/toolsdll.cxx
+++ b/tools/unx/source/dll/toolsdll.cxx
@@ -40,7 +40,7 @@ static void* aAppData[SHL_COUNT];
|*
***************************************************************************/
-void** GetAppData( USHORT nSharedLib )
+void** GetAppData( sal_uInt16 nSharedLib )
{
return &(aAppData[nSharedLib]);
}
diff --git a/tools/util/makefile.mk b/tools/util/makefile.mk
deleted file mode 100644
index 9d6a4ac43fa8..000000000000
--- a/tools/util/makefile.mk
+++ /dev/null
@@ -1,171 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=TOOLS
-TARGET=tools
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Allgemein ----------------------------------------------------
-
-# --- STDSTRM.LIB ---
-LIB3TARGET= $(LB)$/stdstrm.lib
-LIB3ARCHIV= $(LB)$/libstdstrm.a
-LIB3FILES= $(LB)$/stream.lib
-
-LIB7TARGET= $(LB)$/a$(TARGET).lib
-LIB7ARCHIV= $(LB)$/liba$(TARGET).a
-LIB7FILES= $(LB)$/gen.lib \
- $(LB)$/str.lib \
- $(LB)$/mtools.lib \
- $(LB)$/datetime.lib \
- $(LB)$/fsys.lib \
- $(LB)$/communi.lib \
- $(LB)$/stream.lib \
- $(LB)$/ref.lib \
- $(LB)$/rc.lib \
- $(LB)$/inet.lib \
- $(LB)$/debug.lib
-
-
-LIB7FILES+= $(LB)$/dll.lib
-
-# --- TOOLS.LIB ---
-LIB1TARGET:= $(SLB)$/$(TARGET).lib
-LIB1FILES+= \
- $(SLB)$/gen.lib \
- $(SLB)$/str.lib \
- $(SLB)$/mtools.lib \
- $(SLB)$/datetime.lib \
- $(SLB)$/fsys.lib \
- $(SLB)$/communi.lib \
- $(SLB)$/stream.lib \
- $(SLB)$/ref.lib \
- $(SLB)$/rc.lib \
- $(SLB)$/debug.lib \
- $(SLB)$/zcodec.lib \
- $(SLB)$/inet.lib \
- $(SLB)$/testtoolloader.lib \
- $(SLB)$/misc.lib
-
-.IF "$(OS)"=="MACOSX"
-SHL1STDLIBS += $(CPPULIB) \
- $(ZLIB3RDLIB)
-.ELSE
-SHL1STDLIBS += $(ZLIB3RDLIB) \
- $(CPPULIB)
-.ENDIF
-
-LIB1FILES+= $(SLB)$/dll.lib
-
-
-.IF "$(BIG_TOOLS)"!=""
-.IF "$(GUI)"=="WNT"
-# bei lokalen osl rtl oder vos das SOLARLIBDIR bitte patchen !
-LIB1FILES+= $(SOLARLIBDIR)\xosl.lib \
- $(SOLARLIBDIR)\xrtl.lib
-
-SHL1STDLIBS+= $(WSOCK32LIB)
-.ENDIF
-.ENDIF # "$(BIG_TOOLS)"!=""
-
-# --- TOOLS.DLL ---
-
-SHL1TARGET= tl$(DLLPOSTFIX)
-SHL1LIBS= $(LIB1TARGET)
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1IMPLIB= itools
-SHL1USE_EXPORTS=name
-SHL1STDLIBS+= $(SALLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) $(COMPHELPERLIB)
-
-.IF "$(GUI)"=="WNT"
-SHL1STDLIBS+= $(SHELL32LIB) \
- $(MPRLIB) \
- $(OLE32LIB) \
- $(UUIDLIB) \
- $(ADVAPI32LIB)
-.ENDIF
-
-DEF1NAME =$(SHL1TARGET)
-DEF1DEPN = \
- $(MISC)$/$(SHL1TARGET).flt \
- $(HXX1FILES) \
- $(HXX2FILES) \
- $(HXX3FILES) \
- $(HXX4FILES) \
- $(HXX5FILES) \
- $(HXX6FILES) \
- $(HXX7FILES) \
- $(HXX8FILES) \
- $(HXX9FILES) \
- $(HXX10FILES) \
- $(HXX11FILES) \
- $(HXX12FILES) \
- $(HXX13FILES) \
- $(HXX14FILES) \
- $(HXX15FILES) \
- $(HXX16FILES) \
- $(HXX17FILES) \
- $(HXX18FILES) \
- $(HXX19FILES) \
- $(HXX20FILES) \
- makefile.mk
-
-DEFLIB1NAME =tools
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-# --- TOOLS.FLT ---
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- @echo Imp>$@
- @echo PointerList>>$@
- @echo DbgCheck>>$@
- @echo LabelList>>$@
- @echo ActionList>>$@
- @echo CBlock>>$@
- @echo DirEntryStack>>$@
- @echo readdir>>$@
- @echo closedir>>$@
- @echo opendir>>$@
- @echo volumeid>>$@
- @echo MsDos2Time>>$@
- @echo MsDos2Date>>$@
- @echo __new_alloc>>$@
- @echo __CT>>$@
- @echo unnamed>>$@
-.IF "$(COM)"=="BLC"
- @echo WEP>>$@
-.ENDIF
diff --git a/tools/util/tools.r b/tools/util/tools.r
deleted file mode 100644
index 0d1e8739bd42..000000000000
--- a/tools/util/tools.r
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "CodeFragmentTypes.r"
-
-resource 'cfrg' (0) {
- {
- kPowerPC, /* instruction set architecture */
- kFullLib, /* base-level library */
- kNoVersionNum, /* no implementation version number */
- kNoVersionNum, /* no definition version number */
- kDefaultStackSize, /* use default stack size */
- kNoAppSubFolder, /* no library directory */
- kIsLib, /* fragment is an application */
- kOnDiskFlat, /* fragment is on disk */
- kZeroOffset, /* fragment starts at fork start */
- kWholeFork, /* fragment occupies entire fork */
- "Tools.pef" /* name of the application */
- }
-};
diff --git a/tools/win/inc/dll.hxx b/tools/win/inc/dll.hxx
index 99cd3202c8a5..7444bba02854 100644
--- a/tools/win/inc/dll.hxx
+++ b/tools/win/inc/dll.hxx
@@ -29,10 +29,6 @@
#ifndef _DLL_HXX
#define _DLL_HXX
-// -------------------------------
-// - Sonstige Funktionen fuer SV -
-// -------------------------------
-
// Um Resourcen wieder freizugeben
inline void ImpDeInitWinTools() {}
diff --git a/tools/win/inc/parser.hxx b/tools/win/inc/parser.hxx
deleted file mode 100644
index 0c3f448db0a9..000000000000
--- a/tools/win/inc/parser.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _PARSER_HXX
-#define _PARSER_HXX
-
-#if defined WNT
-
-#include <tools/string.hxx>
-#include <winshell.hxx>
-
-void * NewBinaryFromString( const String & rBinStr );
-String CreateStringFromData( const void *pData, ULONG nBytes );
-
-String CreateStringFromItemIDList( const CItemIDList & rIDList );
-
-String GetURLFromHostNotation( const String & rPath );
-String GetHostNotationFromURL( const String & rURL );
-
-CItemIDList MakeIDToken( const String &rToken );
-CItemIDList ParseSpecialURL( const String & rURL );
-
-#endif
-
-#endif // _PARSER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/win/inc/shellex.h b/tools/win/inc/shellex.h
deleted file mode 100644
index 8aa68a5c8d5e..000000000000
--- a/tools/win/inc/shellex.h
+++ /dev/null
@@ -1,117 +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 _SHELLEX_H_
-#define _SHELLEX_H_
-
-#ifndef _SHLOBJ_H_
-#include <shlobj.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#define WINSHELLCALL inline
-#else
-#define WINSHELLCALL static
-#endif
-
-#define SHChangeNotifyRegister_PROC_STR MAKEINTRESOURCE(2)
-#define SHChangeNotifyDeregister_PROC_STR MAKEINTRESOURCE(4)
-
-#define SHCNF_ACCEPT_INTERRUPTS 0x0001
-#define SHCNF_ACCEPT_NON_INTERRUPTS 0x0002
-#define SHCNF_NO_PROXY 0x8000
-
-#define SHCNF_ACCEPT_ALL (SHCNF_ACCEPT_INTERRUPTS | SHCNF_ACCEPT_NON_INTERRUPTS)
-
-typedef struct tagNOTIFYREGISTER {
- LPCITEMIDLIST pidlPath;
- BOOL bWatchSubtree;
-} NOTIFYREGISTER;
-
-typedef NOTIFYREGISTER *LPNOTIFYREGISTER;
-typedef NOTIFYREGISTER const *LPCNOTIFYREGISTER;
-
-typedef HANDLE (WINAPI *SHChangeNotifyRegister_PROC)(
- HWND hWnd,
- DWORD dwFlags,
- LONG wEventMask,
- UINT uMsg,
- ULONG cItems,
- LPCNOTIFYREGISTER lpItems);
-
-
-WINSHELLCALL HANDLE WINAPI SHChangeNotifyRegister(
- HWND hWnd,
- DWORD dwFlags,
- LONG wEventMask,
- UINT uMsg,
- ULONG cItems,
- LPCNOTIFYREGISTER lpItems)
-
-{
- HMODULE hModule = GetModuleHandle( "SHELL32" );
- HANDLE hNotify = NULL;
-
- if ( hModule )
- {
- SHChangeNotifyRegister_PROC lpfnSHChangeNotifyRegister = (SHChangeNotifyRegister_PROC)GetProcAddress( hModule, SHChangeNotifyRegister_PROC_STR );
- if ( lpfnSHChangeNotifyRegister )
- hNotify = lpfnSHChangeNotifyRegister( hWnd, dwFlags, wEventMask, uMsg, cItems, lpItems );
- }
-
- return hNotify;
-}
-
-
-
-typedef BOOL (WINAPI *SHChangeNotifyDeregister_PROC)(
- HANDLE hNotify);
-
-WINSHELLCALL BOOL WINAPI SHChangeNotifyDeregister( HANDLE hNotify )
-{
- HMODULE hModule = GetModuleHandle( "SHELL32" );
- BOOL fSuccess = FALSE;
-
- if ( hModule )
- {
- SHChangeNotifyDeregister_PROC lpfnSHChangeNotifyDeregister = (SHChangeNotifyDeregister_PROC)GetProcAddress( hModule, SHChangeNotifyDeregister_PROC_STR );
- if ( lpfnSHChangeNotifyDeregister )
- fSuccess = lpfnSHChangeNotifyDeregister( hNotify );
- }
-
- return fSuccess;
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/win/inc/shutil.h b/tools/win/inc/shutil.h
deleted file mode 100644
index 0edd1dd2cb6c..000000000000
--- a/tools/win/inc/shutil.h
+++ /dev/null
@@ -1,217 +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 _SHUTIL_H_
-#define _SHUTIL_H_
-
-#if defined WNT
-
-#ifndef _SHOBJ_H
-#include <shlobj.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define PROTOCOL_FILE "file:"
-#define MAX_URL (MAX_PATH + sizeof(PROTOCOL_FILE))
-
-#define SHUTIL_TO_DELIVER
-
-//--------------------------------------------------------------------------
-
-void * WINAPI WIN_SHAlloc( ULONG cb );
-void * WINAPI WIN_SHRealloc( void *pv, ULONG cb );
-void WINAPI WIN_SHFree( void *pv );
-
-//--------------------------------------------------------------------------
-
-ULONG WINAPI WIN_SHGetIDListSize( LPCITEMIDLIST pidl );
-BOOL WINAPI WIN_SHCloneIDList( LPCITEMIDLIST pidl, LPITEMIDLIST *ppidl );
-BOOL WINAPI WIN_SHAppendIDList( LPCITEMIDLIST pidl, LPITEMIDLIST *ppidl );
-LONG WINAPI WIN_SHCompareIDList( LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2 );
-
-LONG WINAPI WIN_SHGetIDListTokenCount( LPCITEMIDLIST pidl );
-BOOL WINAPI WIN_SHGetIDListToken( LPCITEMIDLIST pidl, ULONG nToken, LPITEMIDLIST *ppidl );
-
-BOOL WINAPI WIN_SHSplitIDList(
- LPCITEMIDLIST pidl,
- LPITEMIDLIST * pidlFolder,
- LPITEMIDLIST * pidlItem
- );
-
-BOOL WINAPI WIN_SHSplitIDListEx(
- LPCITEMIDLIST pidl,
- LPITEMIDLIST * pidlParent,
- LPITEMIDLIST * pidlChild,
- ULONG nLevel
- );
-
-//--------------------------------------------------------------------------
-
-#define WIN_SHGetSpecialFolderLocation( nFolder, ppidl ) \
- ((BOOL)(NOERROR == SHGetSpecialFolderLocation( GetFocus(), nFolder, ppidl )))
-
-#define WIN_SHGetPathFromIDList( pidl, pszPath ) \
- SHGetPathFromIDList( pidl, pszPath )
-
-// #define SHGP_CLSID 0x00000001
-
-// BOOL WINAPI WIN_SHGetPathFromIDListEx( LPCITEMIDLIST pidl, LPSTR pszBuffer, UINT uFlags );
-
-BOOL WINAPI WIN_SHGetIDListFromPath( LPCSTR pszPath, LPITEMIDLIST *ppidl );
-
-BOOL WINAPI WIN_SHGetPathFromURL( LPCSTR pszURL, LPSTR pszPath );
-BOOL WINAPI WIN_SHGetURLFromPath( LPCSTR pszPath, LPSTR pszURL );
-
-BOOL WINAPI WIN_SHGetFolderFromIDList( LPCITEMIDLIST pidl, LPSHELLFOLDER *ppshf );
-BOOL WINAPI WIN_SHGetSpecialFolder( int nFolder, LPSHELLFOLDER *ppshf );
-BOOL WINAPI WIN_SHGetFolderFromPath( LPCSTR pszPath, LPSHELLFOLDER *ppshf );
-
-BOOL WINAPI WIN_SHGetSpecialFolderPath( int nFolder, LPSTR pszPath );
-
-HRESULT WINAPI WIN_SHGetDataFromIDList(
- LPSHELLFOLDER psf,
- LPCITEMIDLIST pidl,
- int nFormat,
- PVOID pv,
- int cb
- );
-
-
-//--------------------------------------------------------------------------
-
-#define SHIC_PIDL 0x00000001
-#define SHIC_NO_UI 0x00000002
-
-#define CMDSTR_OPENA "open"
-#define CMDSTR_EXPLOREA "explore"
-#define CMDSTR_FINDA "find"
-
-#define CMDSTR_OPENW L"open"
-#define CMDSTR_EXPLOREW L"explore"
-#define CMDSTR_FINDW L"find"
-
-#ifdef UNICODE
-#define CMDSTR_OPEN CMDSTR_OPENW
-#define CMDSTR_EXPLORE CMDSTR_EXPLOREW
-#define CMDSTR_FIND CMDSTR_FINDW
-#else
-#define CMDSTR_OPEN CMDSTR_OPENA
-#define CMDSTR_EXPLORE CMDSTR_EXPLOREA
-#define CMDSTR_FIND CMDSTR_FINDA
-#endif
-
-#define CMDSTR_DEFAULT MAKEINTRESOURCE(0x00)
-
-#define CMDSTR_LINK MAKEINTRESOURCE(0x10)
-#define CMDSTR_DELETE MAKEINTRESOURCE(0x11)
-#define CMDSTR_RENAME MAKEINTRESOURCE(0x12)
-#define CMDSTR_PROPERTIES MAKEINTRESOURCE(0x13)
-#define CMDSTR_CUT MAKEINTRESOURCE(0x18)
-#define CMDSTR_COPY MAKEINTRESOURCE(0x19)
-
-BOOL WINAPI WIN_SHInvokeCommand(
- HWND hwndOwner,
- DWORD dwFlags,
- LPCTSTR lpPath,
- LPCSTR lpVerb,
- LPCSTR lpParameters,
- LPCSTR lpDirectory,
- int nShow
- );
-
-//--------------------------------------------------------------------------
-
-BOOL WINAPI WIN_SHStrRetToMultiByte(
- LPCITEMIDLIST pidl,
- const STRRET * pStr,
- LPSTR lpMultiByte,
- int cchMultiByte
- );
-
-DWORD WIN_SHBuildCRC( LPVOID pBytes, ULONG nBytes );
-
-DWORD WINAPI WIN_GetShellVersion(VOID);
-
-HIMAGELIST WINAPI WIN_SHGetSystemImageList( UINT uFlags );
-
-//--------------------------------------------------------------------------
-
-/*
-
-ULONG WINAPI WIN_CreateStringFromBinary (
- LPCVOID pv,
- ULONG cbSize,
- LPSTR pszString,
- ULONG cbStringSize
- );
-
-ULONG WINAPI WIN_CreateBinaryFromString(
- LPCSTR pszStr,
- LPVOID pBuffer,
- ULONG cbSize
- );
-*/
-
-//--------------------------------------------------------------------------
-
-DWORD WINAPI WIN_SHSetValue(
- HKEY hKey,
- LPCTSTR pszSubKey,
- LPCTSTR pszValue,
- DWORD dwType,
- LPCVOID pvData,
- DWORD cbData
- );
-
-DWORD WINAPI WIN_SHGetValue(
- HKEY hKey,
- LPCTSTR pszSubKey,
- LPCTSTR pszValue,
- LPDWORD pdwType,
- LPVOID pvData,
- LPDWORD pcbData
- );
-
-DWORD WINAPI WIN_SHDeleteValue(
- HKEY hKey,
- LPCTSTR pszSubKey,
- LPCTSTR pszValue
- );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-#endif // _SHUTIL_H_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/win/inc/toolsdll.hxx b/tools/win/inc/toolsdll.hxx
deleted file mode 100644
index 0c8a1fd11d68..000000000000
--- a/tools/win/inc/toolsdll.hxx
+++ /dev/null
@@ -1,38 +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 _TOOLSDLL_HXX
-#define _TOOLSDLL_HXX
-
-/* Yes, this file is now effectively empty. Remove it completely in a
- * later commit.
- */
-
-#endif // _DLL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/win/inc/winshell.hxx b/tools/win/inc/winshell.hxx
deleted file mode 100644
index dce848f31daf..000000000000
--- a/tools/win/inc/winshell.hxx
+++ /dev/null
@@ -1,389 +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 _WINSHELL_HXX
-#define _WINSHELL_HXX
-
-#if defined WNT
-
-#include <prewin.h>
-#include "shutil.h"
-#include <postwin.h>
-
-#include <tools/string.hxx>
-
-//----------------------------------------------------------------------------
-// CItemIDList
-//----------------------------------------------------------------------------
-
-class CItemIDList
-{
-public:
- CItemIDList();
- CItemIDList( const CItemIDList & );
- CItemIDList( LPCITEMIDLIST );
- CItemIDList( const String & );
- CItemIDList( int nFolder );
- ~CItemIDList();
-
- CItemIDList & operator = ( const CItemIDList & );
- CItemIDList & operator += ( const CItemIDList & );
- CItemIDList operator + ( const CItemIDList & ) const;
-
- int operator == ( const CItemIDList & ) const;
- int operator != ( const CItemIDList & rIDList ) const
- { return ! operator == ( rIDList ); };
-
- operator LPCITEMIDLIST() const
- { return m_pidl; };
-
- int GetTokenCount() const;
- CItemIDList GetToken( int nIndex ) const;
- CItemIDList GetParent( int nLevelFromBottom = 1) const;
- CItemIDList GetChild( int nLevelFromBottom = 1 ) const;
- void Split( CItemIDList & rParent, CItemIDList & rChild, int nLevelFromBottom = 1 ) const;
-
- CItemIDList operator []( int nIndex ) const
- { return GetToken( nIndex ); };
-
- String GetFilePath() const;
-
- BOOL IsValid() const
- { return m_pidl != NULL && m_pidl->mkid.cb != sizeof(USHORT); }
-
- int GetRootID() const
- { return m_nFolder; }
-
-protected:
- ITEMIDLIST *m_pidl;
- int m_nFolder;
-};
-
-
-inline CItemIDList CItemIDList::operator + ( const CItemIDList & rIDList ) const
-{
- CItemIDList aCopy( *this );
- aCopy += rIDList;
- return aCopy;
-}
-
-//----------------------------------------------------------------------------
-// Types for CShellFolder
-//----------------------------------------------------------------------------
-
-// Notification Events fuer CShellFolder
-
-enum NotificationEvent
-{
- NotificationEvent_Error,
- NotificationEvent_Signaled,
- NotificationEvent_Canceled
-};
-
-// Volume information
-
-typedef struct _WIN32_VOLUME_DATA
-{
- TCHAR cDeviceName[MAX_PATH];
- TCHAR cVolumeName[MAX_PATH];
- TCHAR cFileSystemName[MAX_PATH];
- DWORD dwSerialNumber;
- DWORD dwFileSystemFlags;
- DWORD nMaxComponentLength;
-} WIN32_VOLUME_DATA;
-
-// Bekannte Class-IDs fuer wichtige Ordner
-
-// {871C5380-42A0-1069-A2EA-08002B30309D} Internet Explorer 4.0
-static const GUID CLSID_IE4 =
-{ 0x871C5380, 0x42A0, 0x1069, { 0xA2, 0xEA, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D } };
-
-// {208D2C60-3AEA-1069-A2D7-08002B30309D} Netzwerkumgebung
-static const GUID CLSID_Network =
-{ 0x208D2C60, 0x3AEA, 0x1069, { 0xA2, 0xD7, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D } };
-
-// {645FF040-5081-101B-9F08-00AA002F954E} Papierkorb
-static const GUID CLSID_RecycleBin =
-{ 0x645FF040, 0x5081, 0x101B, { 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E } };
-
-// {20D04FE0-3AEA-1069-A2D8-08002B30309D} Arbeitsplatz
-static const GUID CLSID_MyComputer =
-{ 0x20D04FE0, 0x3AEA, 0x1069, { 0xA2, 0xD8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D } };
-
-// {D6277990-4C6A-11CF-8D87-00AA0060F5BF} Geplante Vorgnge
-static const GUID CLSID_Tasks =
-{ 0xD6277990, 0x4C6A, 0x11CF, { 0x8D, 0x87, 0x00, 0xAA, 0x00, 0x60, 0xF5, 0xBF } };
-
-// Fehlt im Header
-
-#define SHGDN_INCLUDE_NONFILESYS 0x2000
-
-#define CSIDL_UNKNOWN -1
-#define CSIDL_ROOT -2
-#define CSIDL_SYSTEM -3
-
-// Suchmaske fuer IEnumIDList
-
-#define SHCONTF_ALL (SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN)
-
-// SHITEM Prefix Kinds
-
-#define SHGII_CONTAINER_MASK 0x70
-
-#define SHGII_COMPUTER 0x20
-
-#define SHGII_COMPUTER_REMOVABLE 0x22
-#define SHGII_COMPUTER_FIXED 0x23
-#define SHGII_COMPUTER_REMOTE 0x24
-#define SHGII_COMPUTER_CDROM 0x25
-#define SHGII_COMPUTER_RAMDISK 0x26
-#define SHGII_COMPUTER_FLOPPY525 0x28
-#define SHGII_COMPUTER_FLOPPY35 0x29
-#define SHGII_COMPUTER_NETWORK 0x2A
-#define SHGII_COMPUTER_REGITEM 0x2E
-
-#define SHGII_ROOT 0x10
-#define SHGII_ROOT_REGITEM 0x1F
-
-#define SHGII_NETWORK 0x40
-#define SHGII_NETWORK_TREE 0x47
-#define SHGII_NETWORK_SERVER 0x42
-#define SHGII_NETWORK_DIRECTORY 0x43
-#define SHGII_NETWORK_PRINTER 0x41
-
-#define SHGII_FILESYSTEM 0x30
-#define SHGII_FILESYSTEM_FILE 0x31
-#define SHGII_FILESYSTEM_DIRECTORY 0x32
-
-#define SHGII_ANCESTOR 0x80
-
-#define SHITEMCONTAINER( pidl ) ((pidl)->mkid.abID[0] & SHGII_CONTAINER_MASK)
-#define SHITEMKIND( pidl ) ((pidl)->mkid.abID[0] & 0x7F)
-
-//----------------------------------------------------------------------------
-// CShellFolderData
-//----------------------------------------------------------------------------
-
-class CShellFolderData
-{
-protected:
- CShellFolderData();
- virtual ~CShellFolderData();
-
- IShellFolder *m_pShellFolder;
- IEnumIDList *m_pEnumIDList;
- IShellIcon *m_pShellIcon;
- BOOL m_bIsOpen;
- HANDLE m_hCancelEvent;
- DWORD m_dwContentFlags;
-};
-
-//----------------------------------------------------------------------------
-// CShellFolder
-//----------------------------------------------------------------------------
-
-// Ganz "normaler" Ordner basierend auf dem IShellFolder Interface
-
-class CShellFolder : public CShellFolderData
-{
-public:
- CShellFolder( const CItemIDList & );
- CShellFolder( const CShellFolder & );
- CShellFolder( IShellFolder * );
-
- // Retrieval of Item IDs
-
- virtual BOOL Reset();
-
- BOOL GetNextValidID( CItemIDList & );
-
- virtual BOOL GetNextID( CItemIDList & );
- virtual BOOL ValidateID( const CItemIDList & );
-
- // Getting information about Items
-
- virtual BOOL GetAttributesOf( const CItemIDList &, LPDWORD pdwInOut );
- virtual BOOL GetNameOf( const CItemIDList &, String & );
-
- virtual BOOL GetFileInfo( const CItemIDList &, WIN32_FIND_DATA * );
- virtual BOOL GetVolumeInfo( const CItemIDList & rIDList, WIN32_VOLUME_DATA * );
-
- // Modifying the folder contents
-
- virtual BOOL SetNameOf( const CItemIDList &, const String &, CItemIDList & );
- virtual BOOL DeleteItem( const CItemIDList & );
-
- // Comparison of IDs
-
- virtual int CompareIDs( const CItemIDList &, const CItemIDList & );
-
- // UI Components
-
- virtual IContextMenu *GetContextMenu( int nItems, const CItemIDList * );
- virtual String GetIconLocation( const CItemIDList & );
-
- // Notifications
-
- virtual NotificationEvent WaitForChanges();
- virtual void CancelWaitNotifications();
-
-protected:
- CShellFolder() : CShellFolderData() {};
-
- void Initialize( IShellFolder *pShellFolder );
- void Initialize( LPCITEMIDLIST );
-};
-
-//----------------------------------------------------------------------------
-// CFileSystemFolder
-//----------------------------------------------------------------------------
-
-// Reiner !!! Filesystem-Ordner. Benutzt optimierten Notification Mechanismus
-
-class CFileSystemFolder : public CShellFolder
-{
-public:
- CFileSystemFolder( LPCSTR pszPath );
-
- virtual NotificationEvent WaitForChanges();
-
-protected:
- CFileSystemFolder() : CShellFolder() {};
-
- void Initialize( LPCTSTR pszPath );
-
- TCHAR m_szPath[MAX_PATH];
-};
-
-//----------------------------------------------------------------------------
-// CSpecialFolder
-//----------------------------------------------------------------------------
-
-// Wie SHellFolder, aber andere Konstruktion ueber definierte Junktion-Points
-
-class CSpecialFolder : public CShellFolder
-{
-public:
- CSpecialFolder( int nFolder );
-
-protected:
- CSpecialFolder() : CShellFolder() {};
-
- void Initialize( int nFolder );
-
- int m_nFolder;
-};
-
-//----------------------------------------------------------------------------
-// CMyComputerFolder
-//----------------------------------------------------------------------------
-
-// Der MS-Windows "Arbeitsplatz"
-
-class CMyComputerFolder : public CSpecialFolder
-{
-public:
- CMyComputerFolder() : CSpecialFolder( CSIDL_DRIVES ) {};
-};
-
-//----------------------------------------------------------------------------
-// CVolumesFolder
-//----------------------------------------------------------------------------
-
-// Wie CMyComputersFolder, enthlt aber nur die Laufwerke
-
-class CVolumesFolder : public CMyComputerFolder
-{
-public:
- CVolumesFolder() : CMyComputerFolder() {};
-
- virtual BOOL ValidateID( const CItemIDList & );
- virtual NotificationEvent WaitForChanges();
-};
-
-//----------------------------------------------------------------------------
-// CWorkplaceFolder
-//----------------------------------------------------------------------------
-
-// Wie CMyComputersFolder, enthlt aber keine!!! Laufwerke
-
-class CWorkplaceFolder : public CMyComputerFolder
-{
- CWorkplaceFolder() : CMyComputerFolder() {};
-
- virtual BOOL ValidateID( const CItemIDList & );
- virtual NotificationEvent WaitForChanges();
-};
-
-//----------------------------------------------------------------------------
-// CDesktopFolder
-//----------------------------------------------------------------------------
-
-// Der MS-Windows Desktop
-
-class CDesktopFolder : public CSpecialFolder
-{
-public:
- CDesktopFolder() : CSpecialFolder( CSIDL_DESKTOP ) {};
-};
-
-//----------------------------------------------------------------------------
-// CDesktopAncestorsFolder
-//----------------------------------------------------------------------------
-
-// Wie CDesktopFolder, enthlt aber nur Arbeitsplatz und Netzwerk
-
-class CDesktopAncestorsFolder : public CDesktopFolder
-{
-public:
- CDesktopAncestorsFolder() : CDesktopFolder() {};
-
- virtual BOOL ValidateID( const CItemIDList & );
- virtual NotificationEvent WaitForChanges();
-};
-
-//----------------------------------------------------------------------------
-// CDesktopContentsFolder
-//----------------------------------------------------------------------------
-
-// Wie CDesktopFolder, aber ohne!!! Arbeitsplatz und Netzwerk
-
-class CDesktopContentsFolder : public CDesktopFolder
-{
-public:
- CDesktopContentsFolder() : CDesktopFolder() {};
-
- virtual BOOL ValidateID( const CItemIDList & );
- virtual NotificationEvent WaitForChanges();
-};
-
-#endif
-
-#endif // _WINSHELL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/win/source/dll/makefile.mk b/tools/win/source/dll/makefile.mk
deleted file mode 100644
index 403da065d653..000000000000
--- a/tools/win/source/dll/makefile.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=TOOLS
-TARGET=dll
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-.INCLUDE: $(PRJ)$/util$/makefile.pmk
-
-# --- WNT ----------------------------------------------------------
-
-.IF "$(GUI)" == "WNT"
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= toolsdll.cxx
-
-SLOFILES= $(SLO)$/toolsdll.obj
-
-OBJFILES= $(OBJ)$/toolsdll.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.ENDIF
-
diff --git a/tools/win/source/dll/toolsdll.cxx b/tools/win/source/dll/toolsdll.cxx
index 2c9f09b2fc57..fe104751c81e 100644
--- a/tools/win/source/dll/toolsdll.cxx
+++ b/tools/win/source/dll/toolsdll.cxx
@@ -30,7 +30,6 @@
#include "precompiled_tools.hxx"
#include <tools/svwin.h>
#include <dll.hxx>
-#include <toolsdll.hxx>
#include <tools/shl.hxx>
// =======================================================================
diff --git a/tools/win/source/fastfsys/makefile.mk b/tools/win/source/fastfsys/makefile.mk
deleted file mode 100644
index 12df85d6a2f3..000000000000
--- a/tools/win/source/fastfsys/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..\..\..
-
-PRJNAME=TOOLS
-TARGET=fastfsys
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- WNT ----------------------------------------------------------
-
-.IF "$(GUI)" == "WNT"
-
-# --- Files --------------------------------------------------------
-
-
-OBJFILES= $(OBJ)$/shutil.obj \
- $(OBJ)$/shidl.obj \
- $(OBJ)$/shmalloc.obj \
- $(OBJ)$/fffolder.obj \
- $(OBJ)$/ffmenu.obj \
- $(OBJ)$/ffitem.obj \
- $(OBJ)$/fflink.obj \
- $(OBJ)$/ffparser.obj \
- $(OBJ)$/wincidl.obj \
- $(OBJ)$/wincshf.obj
-
-
-SLOFILES= $(SLO)$/shutil.obj \
- $(SLO)$/shidl.obj \
- $(SLO)$/shmalloc.obj \
- $(SLO)$/fffolder.obj \
- $(SLO)$/ffmenu.obj \
- $(SLO)$/ffitem.obj \
- $(SLO)$/fflink.obj \
- $(SLO)$/ffparser.obj \
- $(SLO)$/wincidl.obj \
- $(SLO)$/wincshf.obj
-
-# --- Targets ------------------------------------------------------
-
-.ENDIF
-
-.INCLUDE : target.mk
diff --git a/tools/workben/makefile.mk b/tools/workben/makefile.mk
deleted file mode 100644
index 97e7ebfa9a15..000000000000
--- a/tools/workben/makefile.mk
+++ /dev/null
@@ -1,89 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..
-PRJNAME = tl
-TARGET = tldem
-LIBTARGET = NO
-TARGETTYPE = CUI
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE: settings.mk
-
-OBJFILES = \
- $(OBJ)$/solar.obj \
- $(OBJ)$/urltest.obj \
- $(OBJ)$/inetmimetest.obj
-# $(OBJ)$/demostor.obj \
-# $(OBJ)$/fstest.obj \
-# $(OBJ)$/tldem.obj \
-
-APP1TARGET = solar
-APP1OBJS = $(OBJ)$/solar.obj
-.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
-APP1STDLIBS = $(TOOLSLIB)
-.ELSE
-APP1LIBS = $(LB)$/itools.lib
-.ENDIF
-
-APP2TARGET = urltest
-APP2OBJS = $(OBJ)$/urltest.obj
-.IF "$(GUI)" == "UNX" || "$(GUI)" == "OS2"
-APP2STDLIBS = $(TOOLSLIB) $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
-.ELSE
-APP2STDLIBS = $(LB)$/itools.lib $(SALLIB) $(CPPULIB) $(CPPUHELPERLIB)
-.ENDIF
-
-APP3TARGET = inetmimetest
-APP3OBJS = $(OBJ)$/inetmimetest.obj
-APP3STDLIBS = $(SALLIB) $(TOOLSLIB)
-
-# APP3TARGET = tldem
-# APP3OBJS = $(OBJ)$/tldem.obj
-# .IF "$(GUI)" == "UNX"
-# APP3STDLIBS = $(TOOLSLIB)
-# .ELSE
-# APP3STDLIBS = $(LB)$/itools.lib
-# .ENDIF
-
-# APP4TARGET = demostor
-# APP4OBJS = $(OBJ)$/demostor.obj
-# .IF "$(GUI)" == "UNX"
-# APP4STDLIBS = $(TOOLSLIB) $(SALLIB)
-# .ELSE
-# APP4STDLIBS = $(LB)$/itools.lib $(SALLIB)
-# .ENDIF
-
-# APP5TARGET = fstest
-# APP5OBJS = $(OBJ)$/fstest.obj
-# .IF "$(GUI)" == "UNX"
-# APP5STDLIBS = $(TOOLSLIB) $(SALLIB)
-# .ELSE
-# APP5STDLIBS = $(LB)$/itools.lib $(SALLIB)
-# .ENDIF
-
-.INCLUDE: target.mk
diff --git a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
index 8c2bff929d56..ca6a01e6b9fc 100644
--- a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
+++ b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
@@ -38,7 +38,7 @@ namespace ucbhelper {
/**
* This class implements a simple name clash resolve interaction request.
* Instances can be passed directly to XInteractionHandler::handle(...). Each
- * instance contains an NameClashResolveRequest and two interaction
+ * instance contains a NameClashResolveRequest and two interaction
* continuations: "Abort" and "SupplyName". Another continuation
* ("ReplaceExistingData") may be supplied optionally.
*
@@ -57,11 +57,11 @@ public:
*
* @param rTargetFolderURL contains the URL of the folder that contains
* the clashing resource.
- * @param rClashingName contains the clashing name,
+ * @param rClashingName contains the clashing name.
* @param rProposedNewName contains a proposal for the new name or is
* empty.
- * @param bSupportsOverwriteData indictes whether an
- * InteractioneplaceExistingData continuation shall be supplied
+ * @param bSupportsOverwriteData indicates whether an
+ * InteractionReplaceExistingData continuation shall be supplied
* with the interaction request.
*/
SimpleNameClashResolveRequest( const rtl::OUString & rTargetFolderURL,
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx
index 7d722b9247ab..beb1b194fac2 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -52,13 +52,15 @@
using namespace com::sun::star;
using namespace ucbhelper;
-#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings"
-#define PROXY_TYPE_KEY "ooInetProxyType"
-#define NO_PROXY_LIST_KEY "ooInetNoProxy"
-#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName"
-#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort"
-#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName"
-#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort"
+#define CONFIG_ROOT_KEY "org.openoffice.Inet/Settings"
+#define PROXY_TYPE_KEY "ooInetProxyType"
+#define NO_PROXY_LIST_KEY "ooInetNoProxy"
+#define HTTP_PROXY_NAME_KEY "ooInetHTTPProxyName"
+#define HTTP_PROXY_PORT_KEY "ooInetHTTPProxyPort"
+#define HTTPS_PROXY_NAME_KEY "ooInetHTTPSProxyName"
+#define HTTPS_PROXY_PORT_KEY "ooInetHTTPSProxyPort"
+#define FTP_PROXY_NAME_KEY "ooInetFTPProxyName"
+#define FTP_PROXY_PORT_KEY "ooInetFTPProxyPort"
//=========================================================================
namespace ucbhelper
@@ -133,6 +135,7 @@ class InternetProxyDecider_Impl :
{
mutable osl::Mutex m_aMutex;
InternetProxyServer m_aHttpProxy;
+ InternetProxyServer m_aHttpsProxy;
InternetProxyServer m_aFtpProxy;
const InternetProxyServer m_aEmptyProxy;
sal_Int32 m_nProxyType;
@@ -247,6 +250,63 @@ bool WildCard::Matches( const rtl::OUString& rString ) const
}
//=========================================================================
+bool getConfigStringValue(
+ const uno::Reference< container::XNameAccess > & xNameAccess,
+ const char * key,
+ rtl::OUString & value )
+{
+ try
+ {
+ if ( !( xNameAccess->getByName( rtl::OUString::createFromAscii( key ) )
+ >>= value ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - "
+ "Error getting config item value!" );
+ return false;
+ }
+ }
+ catch ( lang::WrappedTargetException const & )
+ {
+ return false;
+ }
+ catch ( container::NoSuchElementException const & )
+ {
+ return false;
+ }
+ return true;
+}
+
+//=========================================================================
+bool getConfigInt32Value(
+ const uno::Reference< container::XNameAccess > & xNameAccess,
+ const char * key,
+ sal_Int32 & value )
+{
+ try
+ {
+ uno::Any aValue = xNameAccess->getByName(
+ rtl::OUString::createFromAscii( key ) );
+ if ( aValue.hasValue() && !( aValue >>= value ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - "
+ "Error getting config item value!" );
+ return false;
+ }
+ }
+ catch ( lang::WrappedTargetException const & )
+ {
+ return false;
+ }
+ catch ( container::NoSuchElementException const & )
+ {
+ return false;
+ }
+ return true;
+}
+
+//=========================================================================
//=========================================================================
//
// InternetProxyDecider_Impl Implementation.
@@ -292,127 +352,43 @@ InternetProxyDecider_Impl::InternetProxyDecider_Impl(
if ( xNameAccess.is() )
{
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- PROXY_TYPE_KEY )) ) >>= m_nProxyType ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** Proxy type ***
+ getConfigInt32Value(
+ xNameAccess, PROXY_TYPE_KEY, m_nProxyType );
+ // *** No proxy list ***
rtl::OUString aNoProxyList;
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- NO_PROXY_LIST_KEY )) ) >>= aNoProxyList ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
-
+ getConfigStringValue(
+ xNameAccess, NO_PROXY_LIST_KEY, aNoProxyList );
setNoProxyList( aNoProxyList );
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- HTTP_PROXY_NAME_KEY )) )
- >>= m_aHttpProxy.aName ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** HTTP ***
+ getConfigStringValue(
+ xNameAccess, HTTP_PROXY_NAME_KEY, m_aHttpProxy.aName );
m_aHttpProxy.nPort = -1;
- try
- {
- uno::Any aValue = xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- HTTP_PROXY_PORT_KEY )) );
- if ( aValue.hasValue() &&
- !( aValue >>= m_aHttpProxy.nPort ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
-
+ getConfigInt32Value(
+ xNameAccess, HTTP_PROXY_PORT_KEY, m_aHttpProxy.nPort );
if ( m_aHttpProxy.nPort == -1 )
m_aHttpProxy.nPort = 80; // standard HTTP port.
- try
- {
- if ( !( xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- FTP_PROXY_NAME_KEY )) )
- >>= m_aFtpProxy.aName ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ // *** HTTPS ***
+ getConfigStringValue(
+ xNameAccess, HTTPS_PROXY_NAME_KEY, m_aHttpsProxy.aName );
+
+ m_aHttpsProxy.nPort = -1;
+ getConfigInt32Value(
+ xNameAccess, HTTPS_PROXY_PORT_KEY, m_aHttpsProxy.nPort );
+ if ( m_aHttpsProxy.nPort == -1 )
+ m_aHttpsProxy.nPort = 443; // standard HTTPS port.
+
+ // *** FTP ***
+ getConfigStringValue(
+ xNameAccess, FTP_PROXY_NAME_KEY, m_aFtpProxy.aName );
m_aFtpProxy.nPort = -1;
- try
- {
- uno::Any aValue = xNameAccess->getByName(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- FTP_PROXY_PORT_KEY )) );
- if ( aValue.hasValue() &&
- !( aValue >>= m_aFtpProxy.nPort ) )
- {
- OSL_ENSURE( sal_False,
- "InternetProxyDecider - "
- "Error getting config item value!" );
- }
- }
- catch ( lang::WrappedTargetException const & )
- {
- }
- catch ( container::NoSuchElementException const & )
- {
- }
+ getConfigInt32Value(
+ xNameAccess, FTP_PROXY_PORT_KEY, m_aFtpProxy.nPort );
}
// Register as listener for config changes.
@@ -589,6 +565,12 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy(
if ( m_aFtpProxy.aName.getLength() > 0 && m_aFtpProxy.nPort >= 0 )
return m_aFtpProxy;
}
+ else if ( rProtocol.toAsciiLowerCase()
+ .equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "https" ) ) )
+ {
+ if ( m_aHttpsProxy.aName.getLength() )
+ return m_aHttpsProxy;
+ }
else if ( m_aHttpProxy.aName.getLength() )
{
// All other protocols use the HTTP proxy.
@@ -663,6 +645,29 @@ void SAL_CALL InternetProxyDecider_Impl::changesOccurred(
m_aHttpProxy.nPort = 80; // standard HTTP port.
}
else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ HTTPS_PROXY_NAME_KEY ) ) )
+ {
+ if ( !( rElem.Element >>= m_aHttpsProxy.aName ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - changesOccurred - "
+ "Error getting config item value!" );
+ }
+ }
+ else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ HTTPS_PROXY_PORT_KEY ) ) )
+ {
+ if ( !( rElem.Element >>= m_aHttpsProxy.nPort ) )
+ {
+ OSL_ENSURE( sal_False,
+ "InternetProxyDecider - changesOccurred - "
+ "Error getting config item value!" );
+ }
+
+ if ( m_aHttpsProxy.nPort == -1 )
+ m_aHttpsProxy.nPort = 443; // standard HTTPS port.
+ }
+ else if ( aKey.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
FTP_PROXY_NAME_KEY ) ) )
{
if ( !( rElem.Element >>= m_aFtpProxy.aName ) )
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.hrc b/ucbhelper/workben/ucbexplorer/ucbexplorer.hrc
index c2dc98574e3a..7d6aa8dba4ad 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.hrc
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.hrc
@@ -24,13 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-//=========================================================================
-//
+
// UCB Explorer ( resource identifiers )
-//
-// (C) 2000 StarOffice Entwicklungs GmbH, Hamburg, Germany
-//
-//=========================================================================
#ifndef _UCBEXPLORER_HRC
#define _UCBEXPLORER_HRC
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
index ea9aa993cba2..aac9b6ac8571 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
@@ -81,6 +81,7 @@ Menu MENU_POPUP
ModalDialog DLG_STRINGINPUT
{
+ HelpID = "ucbhelper:ModalDialog:DLG_STRINGINPUT";
Border = TRUE ;
Moveable = TRUE ;
OutputSize = TRUE ;
@@ -94,6 +95,7 @@ ModalDialog DLG_STRINGINPUT
};
Edit ED_STRINGINPUT_DLG_NAME
{
+ HelpID = "ucbhelper:Edit:DLG_STRINGINPUT:ED_STRINGINPUT_DLG_NAME";
Pos = MAP_APPFONT ( 40 , 16 ) ;
Size = MAP_APPFONT ( 110 , 12 ) ;
Border = TRUE ;
diff --git a/unotools/inc/unotools/accelcfg.hxx b/unotools/inc/unotools/accelcfg.hxx
index 92ad6a0faaf5..9bc3f2178e34 100644
--- a/unotools/inc/unotools/accelcfg.hxx
+++ b/unotools/inc/unotools/accelcfg.hxx
@@ -79,7 +79,7 @@ public:
void SetCommand( const SvtAcceleratorConfigItem& rItem );
// sets several or all configuration items
- // if bClear=FALSE, all items not in the sequence remain unchanged
+ // if bClear=sal_False, all items not in the sequence remain unchanged
void SetItems( const SvtAcceleratorItemList& rItems, bool bClear );
};
diff --git a/unotools/inc/unotools/componentresmodule.hxx b/unotools/inc/unotools/componentresmodule.hxx
index 3f0924c5586a..5fa704951ac0 100644
--- a/unotools/inc/unotools/componentresmodule.hxx
+++ b/unotools/inc/unotools/componentresmodule.hxx
@@ -81,7 +81,7 @@ namespace utl
class UNOTOOLS_DLLPUBLIC ModuleRes : public ::ResId
{
public:
- ModuleRes( USHORT _nId, OComponentResourceModule& _rModule ) : ResId( _nId, *_rModule.getResManager() ) { }
+ ModuleRes( sal_uInt16 _nId, OComponentResourceModule& _rModule ) : ResId( _nId, *_rModule.getResManager() ) { }
};
//====================================================================
@@ -120,7 +120,7 @@ namespace utl
typedef ::utl::ModuleRes BaseClass; \
\
public: \
- ResClass( USHORT _nId ) : BaseClass( _nId, ModuleClass::getInstance() ) \
+ ResClass( sal_uInt16 _nId ) : BaseClass( _nId, ModuleClass::getInstance() ) \
{ \
} \
}; \
diff --git a/unotools/inc/unotools/configvaluecontainer.hxx b/unotools/inc/unotools/configvaluecontainer.hxx
index fc7f1d732f63..ed336373f703 100644
--- a/unotools/inc/unotools/configvaluecontainer.hxx
+++ b/unotools/inc/unotools/configvaluecontainer.hxx
@@ -188,7 +188,7 @@ namespace utl
<p>The current values in memory (your exchange locations registered using the registerXXX methods) is
forwarded to their respective configuration nodes.</p>
- <p>Note that calling <method>write</method>(<TRUE/) is the same as calling <method>commit</method>(<TRUE/>).</p>
+ <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
@precond
The access must have been created for update access
@@ -204,7 +204,7 @@ namespace utl
/** commits any changes done
- <p>Note that calling <method>write</method>(<TRUE/) is the same as calling <method>commit</method>(<TRUE/>).</p>
+ <p>Note that calling <method>write</method>(<sal_True/) is the same as calling <method>commit</method>(<TRUE/>).</p>
@precond
The access must have been created for update access
diff --git a/unotools/inc/unotools/defaultoptions.hxx b/unotools/inc/unotools/defaultoptions.hxx
index 1e7d04125aa4..ee6b005f05df 100644
--- a/unotools/inc/unotools/defaultoptions.hxx
+++ b/unotools/inc/unotools/defaultoptions.hxx
@@ -48,7 +48,7 @@ public:
SvtDefaultOptions();
virtual ~SvtDefaultOptions();
- String GetDefaultPath( USHORT nId ) const;
+ String GetDefaultPath( sal_uInt16 nId ) const;
};
#endif // #ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
diff --git a/unotools/inc/unotools/fontcfg.hxx b/unotools/inc/unotools/fontcfg.hxx
index 5ba0c65552ed..d370350484c1 100644
--- a/unotools/inc/unotools/fontcfg.hxx
+++ b/unotools/inc/unotools/fontcfg.hxx
@@ -119,38 +119,38 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
// IMPL_FONT_ATTR_COMIC - Like Comic Sans MS
// IMPL_FONT_ATTR_BRUSHSCRIPT - More Script
// IMPL_FONT_ATTR_OTHERSTYLE - OldStyle, ... so negativ points
-#define IMPL_FONT_ATTR_DEFAULT ((ULONG)0x00000001)
-#define IMPL_FONT_ATTR_STANDARD ((ULONG)0x00000002)
-#define IMPL_FONT_ATTR_NORMAL ((ULONG)0x00000004)
-#define IMPL_FONT_ATTR_SYMBOL ((ULONG)0x00000008)
-#define IMPL_FONT_ATTR_FIXED ((ULONG)0x00000010)
-#define IMPL_FONT_ATTR_SANSSERIF ((ULONG)0x00000020)
-#define IMPL_FONT_ATTR_SERIF ((ULONG)0x00000040)
-#define IMPL_FONT_ATTR_DECORATIVE ((ULONG)0x00000080)
-#define IMPL_FONT_ATTR_SPECIAL ((ULONG)0x00000100)
-#define IMPL_FONT_ATTR_ITALIC ((ULONG)0x00000200)
-#define IMPL_FONT_ATTR_TITLING ((ULONG)0x00000400)
-#define IMPL_FONT_ATTR_CAPITALS ((ULONG)0x00000800)
-#define IMPL_FONT_ATTR_CJK ((ULONG)0x00001000)
-#define IMPL_FONT_ATTR_CJK_JP ((ULONG)0x00002000)
-#define IMPL_FONT_ATTR_CJK_SC ((ULONG)0x00004000)
-#define IMPL_FONT_ATTR_CJK_TC ((ULONG)0x00008000)
-#define IMPL_FONT_ATTR_CJK_KR ((ULONG)0x00010000)
-#define IMPL_FONT_ATTR_CTL ((ULONG)0x00020000)
-#define IMPL_FONT_ATTR_NONELATIN ((ULONG)0x00040000)
-#define IMPL_FONT_ATTR_FULL ((ULONG)0x00080000)
-#define IMPL_FONT_ATTR_OUTLINE ((ULONG)0x00100000)
-#define IMPL_FONT_ATTR_SHADOW ((ULONG)0x00200000)
-#define IMPL_FONT_ATTR_ROUNDED ((ULONG)0x00400000)
-#define IMPL_FONT_ATTR_TYPEWRITER ((ULONG)0x00800000)
-#define IMPL_FONT_ATTR_SCRIPT ((ULONG)0x01000000)
-#define IMPL_FONT_ATTR_HANDWRITING ((ULONG)0x02000000)
-#define IMPL_FONT_ATTR_CHANCERY ((ULONG)0x04000000)
-#define IMPL_FONT_ATTR_COMIC ((ULONG)0x08000000)
-#define IMPL_FONT_ATTR_BRUSHSCRIPT ((ULONG)0x10000000)
-#define IMPL_FONT_ATTR_GOTHIC ((ULONG)0x20000000)
-#define IMPL_FONT_ATTR_SCHOOLBOOK ((ULONG)0x40000000)
-#define IMPL_FONT_ATTR_OTHERSTYLE ((ULONG)0x80000000)
+#define IMPL_FONT_ATTR_DEFAULT ((sal_uLong)0x00000001)
+#define IMPL_FONT_ATTR_STANDARD ((sal_uLong)0x00000002)
+#define IMPL_FONT_ATTR_NORMAL ((sal_uLong)0x00000004)
+#define IMPL_FONT_ATTR_SYMBOL ((sal_uLong)0x00000008)
+#define IMPL_FONT_ATTR_FIXED ((sal_uLong)0x00000010)
+#define IMPL_FONT_ATTR_SANSSERIF ((sal_uLong)0x00000020)
+#define IMPL_FONT_ATTR_SERIF ((sal_uLong)0x00000040)
+#define IMPL_FONT_ATTR_DECORATIVE ((sal_uLong)0x00000080)
+#define IMPL_FONT_ATTR_SPECIAL ((sal_uLong)0x00000100)
+#define IMPL_FONT_ATTR_ITALIC ((sal_uLong)0x00000200)
+#define IMPL_FONT_ATTR_TITLING ((sal_uLong)0x00000400)
+#define IMPL_FONT_ATTR_CAPITALS ((sal_uLong)0x00000800)
+#define IMPL_FONT_ATTR_CJK ((sal_uLong)0x00001000)
+#define IMPL_FONT_ATTR_CJK_JP ((sal_uLong)0x00002000)
+#define IMPL_FONT_ATTR_CJK_SC ((sal_uLong)0x00004000)
+#define IMPL_FONT_ATTR_CJK_TC ((sal_uLong)0x00008000)
+#define IMPL_FONT_ATTR_CJK_KR ((sal_uLong)0x00010000)
+#define IMPL_FONT_ATTR_CTL ((sal_uLong)0x00020000)
+#define IMPL_FONT_ATTR_NONELATIN ((sal_uLong)0x00040000)
+#define IMPL_FONT_ATTR_FULL ((sal_uLong)0x00080000)
+#define IMPL_FONT_ATTR_OUTLINE ((sal_uLong)0x00100000)
+#define IMPL_FONT_ATTR_SHADOW ((sal_uLong)0x00200000)
+#define IMPL_FONT_ATTR_ROUNDED ((sal_uLong)0x00400000)
+#define IMPL_FONT_ATTR_TYPEWRITER ((sal_uLong)0x00800000)
+#define IMPL_FONT_ATTR_SCRIPT ((sal_uLong)0x01000000)
+#define IMPL_FONT_ATTR_HANDWRITING ((sal_uLong)0x02000000)
+#define IMPL_FONT_ATTR_CHANCERY ((sal_uLong)0x04000000)
+#define IMPL_FONT_ATTR_COMIC ((sal_uLong)0x08000000)
+#define IMPL_FONT_ATTR_BRUSHSCRIPT ((sal_uLong)0x10000000)
+#define IMPL_FONT_ATTR_GOTHIC ((sal_uLong)0x20000000)
+#define IMPL_FONT_ATTR_SCHOOLBOOK ((sal_uLong)0x40000000)
+#define IMPL_FONT_ATTR_OTHERSTYLE ((sal_uLong)0x80000000)
#define IMPL_FONT_ATTR_CJK_ALLLANG (IMPL_FONT_ATTR_CJK_JP | IMPL_FONT_ATTR_CJK_SC | IMPL_FONT_ATTR_CJK_TC | IMPL_FONT_ATTR_CJK_KR)
#define IMPL_FONT_ATTR_ALLSCRIPT (IMPL_FONT_ATTR_SCRIPT | IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_COMIC | IMPL_FONT_ATTR_BRUSHSCRIPT)
@@ -220,7 +220,7 @@ public:
rtl::OUString(),
rtl::OUString() )
) const;
- static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, ULONG& rType );
+ static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType );
};
} // namespace utl
diff --git a/unotools/inc/unotools/fontcvt.hxx b/unotools/inc/unotools/fontcvt.hxx
index b5f912d97c70..12d937cb62e4 100644
--- a/unotools/inc/unotools/fontcvt.hxx
+++ b/unotools/inc/unotools/fontcvt.hxx
@@ -36,12 +36,12 @@
// - FontToSubsFont -
// ------------------
-#define FONTTOSUBSFONT_IMPORT ((ULONG)0x00000001)
-#define FONTTOSUBSFONT_EXPORT ((ULONG)0x00000002)
-#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((ULONG)0x00000004)
+#define FONTTOSUBSFONT_IMPORT ((sal_uLong)0x00000001)
+#define FONTTOSUBSFONT_EXPORT ((sal_uLong)0x00000002)
+#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((sal_uLong)0x00000004)
typedef void* FontToSubsFontConverter;
-UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, ULONG nFlags );
+UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, sal_uLong nFlags );
UNOTOOLS_DLLPUBLIC void DestroyFontToSubsFontConverter( FontToSubsFontConverter hConverter );
UNOTOOLS_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar( FontToSubsFontConverter hConverter, sal_Unicode c );
UNOTOOLS_DLLPUBLIC String GetFontToSubsFontName( FontToSubsFontConverter hConverter );
diff --git a/unotools/inc/unotools/fontdefs.hxx b/unotools/inc/unotools/fontdefs.hxx
index c48076f14b29..12d9c43a109d 100644
--- a/unotools/inc/unotools/fontdefs.hxx
+++ b/unotools/inc/unotools/fontdefs.hxx
@@ -41,12 +41,12 @@ namespace utl {
// - SubsFontName -
// ----------------
-#define SUBSFONT_ONLYONE ((ULONG)0x00000001)
-#define SUBSFONT_MS ((ULONG)0x00000002)
-#define SUBSFONT_PS ((ULONG)0x00000004)
-#define SUBSFONT_HTML ((ULONG)0x00000008)
+#define SUBSFONT_ONLYONE ((sal_uLong)0x00000001)
+#define SUBSFONT_MS ((sal_uLong)0x00000002)
+#define SUBSFONT_PS ((sal_uLong)0x00000004)
+#define SUBSFONT_HTML ((sal_uLong)0x00000008)
-UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, ULONG nFlags );
+UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, sal_uLong nFlags );
// -----------------
// - FontTokenName -
@@ -80,29 +80,29 @@ public:
// Default-Font
-#define DEFAULTFONT_SANS_UNICODE ((USHORT)1)
-#define DEFAULTFONT_SANS ((USHORT)2)
-#define DEFAULTFONT_SERIF ((USHORT)3)
-#define DEFAULTFONT_FIXED ((USHORT)4)
-#define DEFAULTFONT_SYMBOL ((USHORT)5)
-#define DEFAULTFONT_UI_SANS ((USHORT)1000)
-#define DEFAULTFONT_UI_FIXED ((USHORT)1001)
-#define DEFAULTFONT_LATIN_TEXT ((USHORT)2000)
-#define DEFAULTFONT_LATIN_PRESENTATION ((USHORT)2001)
-#define DEFAULTFONT_LATIN_SPREADSHEET ((USHORT)2002)
-#define DEFAULTFONT_LATIN_HEADING ((USHORT)2003)
-#define DEFAULTFONT_LATIN_DISPLAY ((USHORT)2004)
-#define DEFAULTFONT_LATIN_FIXED ((USHORT)2005)
-#define DEFAULTFONT_CJK_TEXT ((USHORT)3000)
-#define DEFAULTFONT_CJK_PRESENTATION ((USHORT)3001)
-#define DEFAULTFONT_CJK_SPREADSHEET ((USHORT)3002)
-#define DEFAULTFONT_CJK_HEADING ((USHORT)3003)
-#define DEFAULTFONT_CJK_DISPLAY ((USHORT)3004)
-#define DEFAULTFONT_CTL_TEXT ((USHORT)4000)
-#define DEFAULTFONT_CTL_PRESENTATION ((USHORT)4001)
-#define DEFAULTFONT_CTL_SPREADSHEET ((USHORT)4002)
-#define DEFAULTFONT_CTL_HEADING ((USHORT)4003)
-#define DEFAULTFONT_CTL_DISPLAY ((USHORT)4004)
+#define DEFAULTFONT_SANS_UNICODE ((sal_uInt16)1)
+#define DEFAULTFONT_SANS ((sal_uInt16)2)
+#define DEFAULTFONT_SERIF ((sal_uInt16)3)
+#define DEFAULTFONT_FIXED ((sal_uInt16)4)
+#define DEFAULTFONT_SYMBOL ((sal_uInt16)5)
+#define DEFAULTFONT_UI_SANS ((sal_uInt16)1000)
+#define DEFAULTFONT_UI_FIXED ((sal_uInt16)1001)
+#define DEFAULTFONT_LATIN_TEXT ((sal_uInt16)2000)
+#define DEFAULTFONT_LATIN_PRESENTATION ((sal_uInt16)2001)
+#define DEFAULTFONT_LATIN_SPREADSHEET ((sal_uInt16)2002)
+#define DEFAULTFONT_LATIN_HEADING ((sal_uInt16)2003)
+#define DEFAULTFONT_LATIN_DISPLAY ((sal_uInt16)2004)
+#define DEFAULTFONT_LATIN_FIXED ((sal_uInt16)2005)
+#define DEFAULTFONT_CJK_TEXT ((sal_uInt16)3000)
+#define DEFAULTFONT_CJK_PRESENTATION ((sal_uInt16)3001)
+#define DEFAULTFONT_CJK_SPREADSHEET ((sal_uInt16)3002)
+#define DEFAULTFONT_CJK_HEADING ((sal_uInt16)3003)
+#define DEFAULTFONT_CJK_DISPLAY ((sal_uInt16)3004)
+#define DEFAULTFONT_CTL_TEXT ((sal_uInt16)4000)
+#define DEFAULTFONT_CTL_PRESENTATION ((sal_uInt16)4001)
+#define DEFAULTFONT_CTL_SPREADSHEET ((sal_uInt16)4002)
+#define DEFAULTFONT_CTL_HEADING ((sal_uInt16)4003)
+#define DEFAULTFONT_CTL_DISPLAY ((sal_uInt16)4004)
UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex );
diff --git a/unotools/inc/unotools/intlwrapper.hxx b/unotools/inc/unotools/intlwrapper.hxx
index 4273d3611ddf..d614a2088e4e 100644
--- a/unotools/inc/unotools/intlwrapper.hxx
+++ b/unotools/inc/unotools/intlwrapper.hxx
@@ -70,7 +70,7 @@ private:
void ImplNewCharClass() const;
void ImplNewLocaleData() const;
void ImplNewCalendar() const;
- void ImplNewCollator( BOOL bCaseSensitive ) const;
+ void ImplNewCollator( sal_Bool bCaseSensitive ) const;
public:
@@ -109,14 +109,14 @@ public:
const CollatorWrapper* getCollator() const
{
if ( !pCollator )
- ImplNewCollator( FALSE );
+ ImplNewCollator( sal_False );
return pCollator;
}
/// case sensitive collator
const CollatorWrapper* getCaseCollator() const
{
if ( !pCaseCollator )
- ImplNewCollator( TRUE );
+ ImplNewCollator( sal_True );
return pCaseCollator;
}
};
diff --git a/unotools/inc/unotools/lingucfg.hxx b/unotools/inc/unotools/lingucfg.hxx
index cecc0147b9d7..f1a2e119a2ed 100644
--- a/unotools/inc/unotools/lingucfg.hxx
+++ b/unotools/inc/unotools/lingucfg.hxx
@@ -53,89 +53,89 @@ struct UNOTOOLS_DLLPUBLIC SvtLinguOptions
::com::sun::star::uno::Sequence< rtl::OUString > aActiveDics;
::com::sun::star::uno::Sequence< rtl::OUString > aActiveConvDics;
- BOOL bROActiveDics;
- BOOL bROActiveConvDics;
+ sal_Bool bROActiveDics;
+ sal_Bool bROActiveConvDics;
// Hyphenator service specific options
- INT16 nHyphMinLeading,
+ sal_Int16 nHyphMinLeading,
nHyphMinTrailing,
nHyphMinWordLength;
- BOOL bROHyphMinLeading,
+ sal_Bool bROHyphMinLeading,
bROHyphMinTrailing,
bROHyphMinWordLength;
// misc options (non-service specific)
- INT16 nDefaultLanguage;
- INT16 nDefaultLanguage_CJK;
- INT16 nDefaultLanguage_CTL;
+ sal_Int16 nDefaultLanguage;
+ sal_Int16 nDefaultLanguage_CJK;
+ sal_Int16 nDefaultLanguage_CTL;
- BOOL bRODefaultLanguage;
- BOOL bRODefaultLanguage_CJK;
- BOOL bRODefaultLanguage_CTL;
+ sal_Bool bRODefaultLanguage;
+ sal_Bool bRODefaultLanguage_CJK;
+ sal_Bool bRODefaultLanguage_CTL;
// spelling options (non-service specific)
- BOOL bIsSpellSpecial;
- BOOL bIsSpellAuto;
- BOOL bIsSpellReverse;
+ sal_Bool bIsSpellSpecial;
+ sal_Bool bIsSpellAuto;
+ sal_Bool bIsSpellReverse;
- BOOL bROIsSpellSpecial;
- BOOL bROIsSpellAuto;
- BOOL bROIsSpellReverse;
+ sal_Bool bROIsSpellSpecial;
+ sal_Bool bROIsSpellAuto;
+ sal_Bool bROIsSpellReverse;
// hyphenation options (non-service specific)
- BOOL bIsHyphSpecial;
- BOOL bIsHyphAuto;
+ sal_Bool bIsHyphSpecial;
+ sal_Bool bIsHyphAuto;
- BOOL bROIsHyphSpecial;
- BOOL bROIsHyphAuto;
+ sal_Bool bROIsHyphSpecial;
+ sal_Bool bROIsHyphAuto;
// common to SpellChecker, Hyphenator and Thesaurus service
- BOOL bIsUseDictionaryList;
- BOOL bIsIgnoreControlCharacters;
+ sal_Bool bIsUseDictionaryList;
+ sal_Bool bIsIgnoreControlCharacters;
- BOOL bROIsUseDictionaryList;
- BOOL bROIsIgnoreControlCharacters;
+ sal_Bool bROIsUseDictionaryList;
+ sal_Bool bROIsIgnoreControlCharacters;
// SpellChecker service specific options
- BOOL bIsSpellWithDigits,
+ sal_Bool bIsSpellWithDigits,
bIsSpellUpperCase,
bIsSpellCapitalization;
- BOOL bROIsSpellWithDigits,
+ sal_Bool bROIsSpellWithDigits,
bROIsSpellUpperCase,
bROIsSpellCapitalization;
// text conversion specific options
- BOOL bIsIgnorePostPositionalWord;
- BOOL bIsAutoCloseDialog;
- BOOL bIsShowEntriesRecentlyUsedFirst;
- BOOL bIsAutoReplaceUniqueEntries;
- BOOL bIsDirectionToSimplified;
- BOOL bIsUseCharacterVariants;
- BOOL bIsTranslateCommonTerms;
- BOOL bIsReverseMapping;
-
- BOOL bROIsIgnorePostPositionalWord;
- BOOL bROIsAutoCloseDialog;
- BOOL bROIsShowEntriesRecentlyUsedFirst;
- BOOL bROIsAutoReplaceUniqueEntries;
- BOOL bROIsDirectionToSimplified;
- BOOL bROIsUseCharacterVariants;
- BOOL bROIsTranslateCommonTerms;
- BOOL bROIsReverseMapping;
+ sal_Bool bIsIgnorePostPositionalWord;
+ sal_Bool bIsAutoCloseDialog;
+ sal_Bool bIsShowEntriesRecentlyUsedFirst;
+ sal_Bool bIsAutoReplaceUniqueEntries;
+ sal_Bool bIsDirectionToSimplified;
+ sal_Bool bIsUseCharacterVariants;
+ sal_Bool bIsTranslateCommonTerms;
+ sal_Bool bIsReverseMapping;
+
+ sal_Bool bROIsIgnorePostPositionalWord;
+ sal_Bool bROIsAutoCloseDialog;
+ sal_Bool bROIsShowEntriesRecentlyUsedFirst;
+ sal_Bool bROIsAutoReplaceUniqueEntries;
+ sal_Bool bROIsDirectionToSimplified;
+ sal_Bool bROIsUseCharacterVariants;
+ sal_Bool bROIsTranslateCommonTerms;
+ sal_Bool bROIsReverseMapping;
// check value need to determine if the configuration needs to updatet
// or not (used for a quick check if data files have been changed/added
// or deleted
- INT32 nDataFilesChangedCheckValue;
- BOOL bRODataFilesChangedCheckValue;
+ sal_Int32 nDataFilesChangedCheckValue;
+ sal_Bool bRODataFilesChangedCheckValue;
- BOOL bIsGrammarAuto;
- BOOL bIsGrammarInteractive;
+ sal_Bool bIsGrammarAuto;
+ sal_Bool bIsGrammarInteractive;
- BOOL bROIsGrammarAuto;
- BOOL bROIsGrammarInteractive;
+ sal_Bool bROIsGrammarAuto;
+ sal_Bool bROIsGrammarInteractive;
SvtLinguOptions();
};
@@ -197,29 +197,29 @@ public:
com::sun::star::uno::Any
GetProperty( const rtl::OUString &rPropertyName ) const;
com::sun::star::uno::Any
- GetProperty( INT32 nPropertyHandle ) const;
+ GetProperty( sal_Int32 nPropertyHandle ) const;
- BOOL SetProperty( const rtl::OUString &rPropertyName,
+ sal_Bool SetProperty( const rtl::OUString &rPropertyName,
const com::sun::star::uno::Any &rValue );
- BOOL SetProperty( INT32 nPropertyHandle,
+ sal_Bool SetProperty( sal_Int32 nPropertyHandle,
const com::sun::star::uno::Any &rValue );
- BOOL GetOptions( SvtLinguOptions &rOptions ) const;
- BOOL SetOptions( const SvtLinguOptions &rOptions );
+ sal_Bool GetOptions( SvtLinguOptions &rOptions ) const;
+ sal_Bool SetOptions( const SvtLinguOptions &rOptions );
- BOOL IsReadOnly( const rtl::OUString &rPropertyName ) const;
- BOOL IsReadOnly( INT32 nPropertyHandle ) const;
+ sal_Bool IsReadOnly( const rtl::OUString &rPropertyName ) const;
+ sal_Bool IsReadOnly( sal_Int32 nPropertyHandle ) const;
//!
//! the following functions work on the 'ServiceManager' sub node of the
//! linguistic configuration only
//!
- BOOL GetElementNamesFor( const rtl::OUString &rNodeName, com::sun::star::uno::Sequence< rtl::OUString > &rElementNames ) const;
+ sal_Bool GetElementNamesFor( const rtl::OUString &rNodeName, com::sun::star::uno::Sequence< rtl::OUString > &rElementNames ) const;
//
- BOOL GetSupportedDictionaryFormatsFor( const rtl::OUString &rSetName, const rtl::OUString &rSetEntry, com::sun::star::uno::Sequence< rtl::OUString > &rFormatList ) const;
+ sal_Bool GetSupportedDictionaryFormatsFor( const rtl::OUString &rSetName, const rtl::OUString &rSetEntry, com::sun::star::uno::Sequence< rtl::OUString > &rFormatList ) const;
void SetOrCreateSupportedDictionaryFormatsFor( const rtl::OUString &rSetName, const rtl::OUString &rSetEntry, const com::sun::star::uno::Sequence< rtl::OUString > &rFormatList ) const;
//
- BOOL GetDictionaryEntry( const rtl::OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
+ sal_Bool GetDictionaryEntry( const rtl::OUString &rNodeName, SvtLinguConfigDictionaryEntry &rDicEntry ) const;
void SetOrCreateDictionaryEntry( const rtl::OUString &rNodeName, const SvtLinguConfigDictionaryEntry &rDicEntry ) const;
//
com::sun::star::uno::Sequence< rtl::OUString > GetDisabledDictionaries() const;
diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx
index 865bddb455b3..306316683b94 100644
--- a/unotools/inc/unotools/localedatawrapper.hxx
+++ b/unotools/inc/unotools/localedatawrapper.hxx
@@ -64,7 +64,7 @@ enum MeasurementSystem {
class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
{
- static BYTE nLocaleDataChecking; // 0:=dontknow, 1:=yes, 2:=no
+ static sal_uInt8 nLocaleDataChecking; // 0:=dontknow, 1:=yes, 2:=no
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData2 > xLD;
@@ -80,11 +80,11 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
String aCurrBankSymbol;
int nDateFormat;
int nLongDateFormat;
- USHORT nCurrPositiveFormat;
- USHORT nCurrNegativeFormat;
- USHORT nCurrDigits;
- BOOL bLocaleDataItemValid;
- BOOL bReservedWordValid;
+ sal_uInt16 nCurrPositiveFormat;
+ sal_uInt16 nCurrNegativeFormat;
+ sal_uInt16 nCurrDigits;
+ sal_Bool bLocaleDataItemValid;
+ sal_Bool bReservedWordValid;
mutable ::utl::ReadWriteMutex aMutex;
// dummies, to be implemented or provided by XML locale data
@@ -118,8 +118,8 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
void getDefaultCalendarImpl();
sal_Unicode* ImplAddFormatNum( sal_Unicode* pBuf,
- sal_Int64 nNumber, USHORT nDecimals,
- BOOL bUseThousandSep, BOOL bTrailingZeros ) const;
+ sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const;
void getDigitGroupingImpl();
@@ -241,19 +241,19 @@ public:
// currency
const String& getCurrSymbol() const;
const String& getCurrBankSymbol() const;
- USHORT getCurrPositiveFormat() const;
- USHORT getCurrNegativeFormat() const;
- USHORT getCurrDigits() const;
+ sal_uInt16 getCurrPositiveFormat() const;
+ sal_uInt16 getCurrNegativeFormat() const;
+ sal_uInt16 getCurrDigits() const;
// simple date and time formatting
DateFormat getDateFormat() const;
DateFormat getLongDateFormat() const;
/// only numerical values of Gregorian calendar
String getDate( const Date& rDate ) const;
- String getTime( const Time& rTime, BOOL bSec = TRUE,
- BOOL b100Sec = FALSE ) const;
+ String getTime( const Time& rTime, sal_Bool bSec = sal_True,
+ sal_Bool b100Sec = sal_False ) const;
String getDuration( const Time& rTime,
- BOOL bSec = TRUE, BOOL b100Sec = FALSE ) const;
+ sal_Bool bSec = sal_True, sal_Bool b100Sec = sal_False ) const;
/** The CalendarWrapper already <b>MUST</b>
have loaded a calendar.
@@ -282,37 +282,37 @@ public:
@param nNumber
value * 10**nDecimals
@param bTrailingZeros
- </TRUE> := always display trailing zeros in
+ </sal_True> := always display trailing zeros in
decimal places, even if integer value.
- </FALSE> := trailing zeros are only displayed
+ </sal_False> := trailing zeros are only displayed
if the value is not an integer value.
*/
- String getNum( sal_Int64 nNumber, USHORT nDecimals,
- BOOL bUseThousandSep = TRUE,
- BOOL bTrailingZeros = TRUE ) const;
+ String getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True,
+ sal_Bool bTrailingZeros = sal_True ) const;
/// "Secure" currency formatted string.
- String getCurr( sal_Int64 nNumber, USHORT nDecimals,
+ String getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
const String& rCurrencySymbol,
- BOOL bUseThousandSep = TRUE ) const;
+ sal_Bool bUseThousandSep = sal_True ) const;
/** Default currency formatted string, use with
care as default currency may change in any
locale, for example, DEM -> EUR */
- String getCurr( sal_Int64 nNumber, USHORT nDecimals,
- BOOL bUseThousandSep = TRUE ) const
+ String getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep = sal_True ) const
{ return getCurr( nNumber, nDecimals,
getCurrSymbol(), bUseThousandSep ); }
// dummy returns, to be implemented
inline sal_Unicode getCurrZeroChar() const
{ return cCurrZeroChar; }
- inline BOOL isNumLeadingZero() const
- { return TRUE; }
+ inline sal_Bool isNumLeadingZero() const
+ { return sal_True; }
/// standard decimal places
- inline USHORT getNumDigits() const
+ inline sal_uInt16 getNumDigits() const
{ return 2; }
- inline BOOL isNumTrailingZeros() const
- { return TRUE; }
+ inline sal_Bool isNumTrailingZeros() const
+ { return sal_True; }
// reserved words
diff --git a/unotools/inc/unotools/misccfg.hxx b/unotools/inc/unotools/misccfg.hxx
index 030a433bc6e3..39777fc0b3d7 100644
--- a/unotools/inc/unotools/misccfg.hxx
+++ b/unotools/inc/unotools/misccfg.hxx
@@ -44,14 +44,14 @@ public:
MiscCfg( );
virtual ~MiscCfg( );
- BOOL IsNotFoundWarning() const;
- void SetNotFoundWarning( BOOL bSet);
+ sal_Bool IsNotFoundWarning() const;
+ void SetNotFoundWarning( sal_Bool bSet);
- BOOL IsPaperSizeWarning() const;
- void SetPaperSizeWarning(BOOL bSet);
+ sal_Bool IsPaperSizeWarning() const;
+ void SetPaperSizeWarning(sal_Bool bSet);
- BOOL IsPaperOrientationWarning() const;
- void SetPaperOrientationWarning( BOOL bSet);
+ sal_Bool IsPaperOrientationWarning() const;
+ void SetPaperOrientationWarning( sal_Bool bSet);
// 0 ... 99
sal_Int32 GetYear2000() const;
diff --git a/unotools/inc/unotools/pathoptions.hxx b/unotools/inc/unotools/pathoptions.hxx
index 7b471ed68a1d..53e6ccaca463 100644
--- a/unotools/inc/unotools/pathoptions.hxx
+++ b/unotools/inc/unotools/pathoptions.hxx
@@ -102,7 +102,7 @@ public:
const String& GetUIConfigPath() const;
const String& GetFingerprintPath() const;
- BOOL IsPathReadonly(Pathes ePath)const;
+ sal_Bool IsPathReadonly(Pathes ePath)const;
const String& GetPath(Pathes ePath) const;
// set the pathes
@@ -130,8 +130,9 @@ public:
void SetWorkPath( const String& rPath );
void SetPath( SvtPathOptions::Pathes ePath, const String& rNewPath );
- String SubstituteVariable( const String& rVar );
- String UseVariable( const String& rVar );
+ String SubstituteVariable( const String& rVar ) const;
+ String ExpandMacros( const String& rPath ) const;
+ String UseVariable( const String& rVar ) const;
sal_Bool SearchFile( String& rIniFile, Pathes ePath = PATH_USERCONFIG );
::com::sun::star::lang::Locale GetLocale() const;
sal_Bool IsReadonly() const;
diff --git a/unotools/inc/unotools/searchopt.hxx b/unotools/inc/unotools/searchopt.hxx
index d8cf6819f389..10ed2ca79bce 100644
--- a/unotools/inc/unotools/searchopt.hxx
+++ b/unotools/inc/unotools/searchopt.hxx
@@ -48,71 +48,71 @@ public:
SvtSearchOptions();
~SvtSearchOptions();
- INT32 GetTransliterationFlags() const;
+ sal_Int32 GetTransliterationFlags() const;
//
// General Options
//
- BOOL IsWholeWordsOnly() const;
- BOOL IsBackwards() const;
- BOOL IsUseRegularExpression() const;
- BOOL IsSearchForStyles() const;
- BOOL IsSimilaritySearch() const;
- BOOL IsUseAsianOptions() const;
- BOOL IsMatchCase() const; // also Japanese search option
- BOOL IsNotes() const;
-
- void SetWholeWordsOnly( BOOL bVal );
- void SetBackwards( BOOL bVal );
- void SetUseRegularExpression( BOOL bVal );
- void SetSearchForStyles( BOOL bVal );
- void SetSimilaritySearch( BOOL bVal );
- void SetUseAsianOptions( BOOL bVal );
- void SetMatchCase( BOOL bVal ); // also Japanese search option
- void SetNotes( BOOL bVal);
+ sal_Bool IsWholeWordsOnly() const;
+ sal_Bool IsBackwards() const;
+ sal_Bool IsUseRegularExpression() const;
+ sal_Bool IsSearchForStyles() const;
+ sal_Bool IsSimilaritySearch() const;
+ sal_Bool IsUseAsianOptions() const;
+ sal_Bool IsMatchCase() const; // also Japanese search option
+ sal_Bool IsNotes() const;
+
+ void SetWholeWordsOnly( sal_Bool bVal );
+ void SetBackwards( sal_Bool bVal );
+ void SetUseRegularExpression( sal_Bool bVal );
+ void SetSearchForStyles( sal_Bool bVal );
+ void SetSimilaritySearch( sal_Bool bVal );
+ void SetUseAsianOptions( sal_Bool bVal );
+ void SetMatchCase( sal_Bool bVal ); // also Japanese search option
+ void SetNotes( sal_Bool bVal);
//
// Japanese search options
//
- BOOL IsMatchFullHalfWidthForms() const;
- BOOL IsMatchHiraganaKatakana() const;
- BOOL IsMatchContractions() const;
- BOOL IsMatchMinusDashChoon() const;
- BOOL IsMatchRepeatCharMarks() const;
- BOOL IsMatchVariantFormKanji() const;
- BOOL IsMatchOldKanaForms() const;
- BOOL IsMatchDiziDuzu() const;
- BOOL IsMatchBavaHafa() const;
- BOOL IsMatchTsithichiDhizi() const;
- BOOL IsMatchHyuiyuByuvyu() const;
- BOOL IsMatchSesheZeje() const;
- BOOL IsMatchIaiya() const;
- BOOL IsMatchKiku() const;
- BOOL IsIgnorePunctuation() const;
- BOOL IsIgnoreWhitespace() const;
- BOOL IsIgnoreProlongedSoundMark() const;
- BOOL IsIgnoreMiddleDot() const;
-
- void SetMatchFullHalfWidthForms( BOOL bVal );
- void SetMatchHiraganaKatakana( BOOL bVal );
- void SetMatchContractions( BOOL bVal );
- void SetMatchMinusDashChoon( BOOL bVal );
- void SetMatchRepeatCharMarks( BOOL bVal );
- void SetMatchVariantFormKanji( BOOL bVal );
- void SetMatchOldKanaForms( BOOL bVal );
- void SetMatchDiziDuzu( BOOL bVal );
- void SetMatchBavaHafa( BOOL bVal );
- void SetMatchTsithichiDhizi( BOOL bVal );
- void SetMatchHyuiyuByuvyu( BOOL bVal );
- void SetMatchSesheZeje( BOOL bVal );
- void SetMatchIaiya( BOOL bVal );
- void SetMatchKiku( BOOL bVal );
- void SetIgnorePunctuation( BOOL bVal );
- void SetIgnoreWhitespace( BOOL bVal );
- void SetIgnoreProlongedSoundMark( BOOL bVal );
- void SetIgnoreMiddleDot( BOOL bVal );
+ sal_Bool IsMatchFullHalfWidthForms() const;
+ sal_Bool IsMatchHiraganaKatakana() const;
+ sal_Bool IsMatchContractions() const;
+ sal_Bool IsMatchMinusDashChoon() const;
+ sal_Bool IsMatchRepeatCharMarks() const;
+ sal_Bool IsMatchVariantFormKanji() const;
+ sal_Bool IsMatchOldKanaForms() const;
+ sal_Bool IsMatchDiziDuzu() const;
+ sal_Bool IsMatchBavaHafa() const;
+ sal_Bool IsMatchTsithichiDhizi() const;
+ sal_Bool IsMatchHyuiyuByuvyu() const;
+ sal_Bool IsMatchSesheZeje() const;
+ sal_Bool IsMatchIaiya() const;
+ sal_Bool IsMatchKiku() const;
+ sal_Bool IsIgnorePunctuation() const;
+ sal_Bool IsIgnoreWhitespace() const;
+ sal_Bool IsIgnoreProlongedSoundMark() const;
+ sal_Bool IsIgnoreMiddleDot() const;
+
+ void SetMatchFullHalfWidthForms( sal_Bool bVal );
+ void SetMatchHiraganaKatakana( sal_Bool bVal );
+ void SetMatchContractions( sal_Bool bVal );
+ void SetMatchMinusDashChoon( sal_Bool bVal );
+ void SetMatchRepeatCharMarks( sal_Bool bVal );
+ void SetMatchVariantFormKanji( sal_Bool bVal );
+ void SetMatchOldKanaForms( sal_Bool bVal );
+ void SetMatchDiziDuzu( sal_Bool bVal );
+ void SetMatchBavaHafa( sal_Bool bVal );
+ void SetMatchTsithichiDhizi( sal_Bool bVal );
+ void SetMatchHyuiyuByuvyu( sal_Bool bVal );
+ void SetMatchSesheZeje( sal_Bool bVal );
+ void SetMatchIaiya( sal_Bool bVal );
+ void SetMatchKiku( sal_Bool bVal );
+ void SetIgnorePunctuation( sal_Bool bVal );
+ void SetIgnoreWhitespace( sal_Bool bVal );
+ void SetIgnoreProlongedSoundMark( sal_Bool bVal );
+ void SetIgnoreMiddleDot( sal_Bool bVal );
};
diff --git a/unotools/inc/unotools/syslocaleoptions.hxx b/unotools/inc/unotools/syslocaleoptions.hxx
index dc3721bcaba7..7d70ebd589b3 100644..100755
--- a/unotools/inc/unotools/syslocaleoptions.hxx
+++ b/unotools/inc/unotools/syslocaleoptions.hxx
@@ -39,10 +39,10 @@
#include <unotools/options.hxx>
// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined
-const ULONG SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001;
-const ULONG SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002;
-const ULONG SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004;
-const ULONG SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008;
+const sal_uLong SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001;
+const sal_uLong SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002;
+const sal_uLong SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004;
+const sal_uLong SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008;
class SvtSysLocaleOptions_Impl;
class SvtListener;
@@ -93,8 +93,8 @@ public:
@ATTENTION
All SvtSysLocaleOptions instances point to exactly one refcounted
internal representation instance and broadcast blocks are counted.
- Thus if you issue a BlockBroadcasts(TRUE) you MUST issue a matching
- BlockBroadcasts(FALSE) or otherwise pending hints would never be
+ Thus if you issue a BlockBroadcasts(sal_True) you MUST issue a matching
+ BlockBroadcasts(sal_False) or otherwise pending hints would never be
broadcasted again.
*/
virtual void BlockBroadcasts( bool bBlock );
diff --git a/unotools/inc/unotools/textsearch.hxx b/unotools/inc/unotools/textsearch.hxx
index 664105bb8b47..bbc40cda01bd 100644
--- a/unotools/inc/unotools/textsearch.hxx
+++ b/unotools/inc/unotools/textsearch.hxx
@@ -82,9 +82,9 @@ private:
public:
SearchParam( const String &rText,
SearchType eSrchType = SearchParam::SRCH_NORMAL,
- BOOL bCaseSens = TRUE,
- BOOL bWrdOnly = FALSE,
- BOOL bSrchInSel = FALSE );
+ sal_Bool bCaseSens = sal_True,
+ sal_Bool bWrdOnly = sal_False,
+ sal_Bool bSrchInSel = sal_False );
SearchParam( const SearchParam& );
const String& GetSrchStr() const { return sSrchStr; }
@@ -151,14 +151,14 @@ public:
pStart - start position for the search
pEnde - end position for the search
- RETURN values == TRUE: something is found
+ RETURN values == sal_True: something is found
- pStart start pos of the found text,
- pStart end pos of the found text,
- pSrchResult - the search result with all found
positions. Is only filled with more positions
if the regular expression handles groups.
- == FALSE: nothing found, pStart,pEnde unchanged.
+ == sal_False: nothing found, pStart,pEnde unchanged.
Definitions: start pos always inclusive, end pos always exclusive!
The position must always in the right direction!
diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx
index 7bfd0d4f4a8c..44af28b17ecc 100644
--- a/unotools/inc/unotools/ucbhelper.hxx
+++ b/unotools/inc/unotools/ucbhelper.hxx
@@ -74,12 +74,12 @@ namespace utl
sal_Bool bNewOnly = sal_False );
static sal_Bool HasParentFolder( const String& rFolder );
- static ULONG GetSize( const String& rContent );
+ static sal_uLong GetSize( const String& rContent );
static sal_Bool IsYounger( const String& rIsYoung, const String& rIsOlder );
static sal_Bool Exists( const String& rContent );
- static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', BOOL bAllowWildCards = TRUE );
- static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards = FALSE );
+ static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', sal_Bool bAllowWildCards = sal_True );
+ static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, sal_Bool bAllowWildCards = sal_False );
static sal_Bool IsSubPath( const ::rtl::OUString& rPath, const ::rtl::OUString& rChildCandidate, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >& xContentProvider = ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >() );
static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
};
diff --git a/unotools/inc/unotools/ucblockbytes.hxx b/unotools/inc/unotools/ucblockbytes.hxx
index a7090d5efebc..d3c53e882fec 100644
--- a/unotools/inc/unotools/ucblockbytes.hxx
+++ b/unotools/inc/unotools/ucblockbytes.hxx
@@ -91,7 +91,7 @@ public:
{}
virtual void Handle( LoadHandlerItem nWhich, UcbLockBytesRef xLockBytes ) = 0;
- void Activate( BOOL bActivate = sal_True ) { m_bActive = bActivate; }
+ void Activate( sal_Bool bActivate = sal_True ) { m_bActive = bActivate; }
sal_Bool IsActive() const { return m_bActive; }
};
@@ -152,11 +152,11 @@ public:
static UcbLockBytesRef CreateLockBytes( const NS_UNO::Reference < NS_IO::XStream >& xContent );
// SvLockBytes
- virtual void SetSynchronMode (BOOL bSynchron);
- virtual ErrCode ReadAt ( ULONG nPos, void *pBuffer, ULONG nCount, ULONG *pRead) const;
- virtual ErrCode WriteAt ( ULONG, const void*, ULONG, ULONG *pWritten);
+ virtual void SetSynchronMode (sal_Bool bSynchron);
+ virtual ErrCode ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const;
+ virtual ErrCode WriteAt ( sal_uLong, const void*, sal_uLong, sal_uLong *pWritten);
virtual ErrCode Flush (void) const;
- virtual ErrCode SetSize (ULONG);
+ virtual ErrCode SetSize (sal_uLong);
virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const;
void SetError( ErrCode nError )
diff --git a/unotools/inc/unotools/unotunnelhelper.hxx b/unotools/inc/unotools/unotunnelhelper.hxx
index de9c82da995a..b573fef7b883 100644
--- a/unotools/inc/unotools/unotunnelhelper.hxx
+++ b/unotools/inc/unotools/unotunnelhelper.hxx
@@ -34,8 +34,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <rtl/uuid.h>
#include <rtl/memory.h>
-
-#include <cppuhelper/extract.hxx>
+#include <comphelper/extract.hxx>
namespace utl
{
diff --git a/unotools/inc/unotools/useroptions.hxx b/unotools/inc/unotools/useroptions.hxx
index 7230e3bb2da6..17f4d52bc248 100644
--- a/unotools/inc/unotools/useroptions.hxx
+++ b/unotools/inc/unotools/useroptions.hxx
@@ -36,23 +36,23 @@
// define ----------------------------------------------------------------
-#define USER_OPT_CITY ((USHORT)0)
-#define USER_OPT_COMPANY ((USHORT)1)
-#define USER_OPT_COUNTRY ((USHORT)2)
-#define USER_OPT_EMAIL ((USHORT)3)
-#define USER_OPT_FAX ((USHORT)4)
-#define USER_OPT_FIRSTNAME ((USHORT)5)
-#define USER_OPT_LASTNAME ((USHORT)6)
-#define USER_OPT_POSITION ((USHORT)7)
-#define USER_OPT_STATE ((USHORT)8)
-#define USER_OPT_STREET ((USHORT)9)
-#define USER_OPT_TELEPHONEHOME ((USHORT)10)
-#define USER_OPT_TELEPHONEWORK ((USHORT)11)
-#define USER_OPT_TITLE ((USHORT)12)
-#define USER_OPT_ID ((USHORT)13)
-#define USER_OPT_ZIP ((USHORT)14)
-#define USER_OPT_FATHERSNAME ((USHORT)15)
-#define USER_OPT_APARTMENT ((USHORT)16)
+#define USER_OPT_CITY ((sal_uInt16)0)
+#define USER_OPT_COMPANY ((sal_uInt16)1)
+#define USER_OPT_COUNTRY ((sal_uInt16)2)
+#define USER_OPT_EMAIL ((sal_uInt16)3)
+#define USER_OPT_FAX ((sal_uInt16)4)
+#define USER_OPT_FIRSTNAME ((sal_uInt16)5)
+#define USER_OPT_LASTNAME ((sal_uInt16)6)
+#define USER_OPT_POSITION ((sal_uInt16)7)
+#define USER_OPT_STATE ((sal_uInt16)8)
+#define USER_OPT_STREET ((sal_uInt16)9)
+#define USER_OPT_TELEPHONEHOME ((sal_uInt16)10)
+#define USER_OPT_TELEPHONEWORK ((sal_uInt16)11)
+#define USER_OPT_TITLE ((sal_uInt16)12)
+#define USER_OPT_ID ((sal_uInt16)13)
+#define USER_OPT_ZIP ((sal_uInt16)14)
+#define USER_OPT_FATHERSNAME ((sal_uInt16)15)
+#define USER_OPT_APARTMENT ((sal_uInt16)16)
// class SvtUserOptions --------------------------------------------------
@@ -112,8 +112,8 @@ public:
void SetFathersName( const ::rtl::OUString& rNewToken );
void SetApartment( const ::rtl::OUString& rNewToken );
- sal_Bool IsTokenReadonly( USHORT nToken ) const;
- ::rtl::OUString GetToken(USHORT nToken) const;
+ sal_Bool IsTokenReadonly( sal_uInt16 nToken ) const;
+ ::rtl::OUString GetToken(sal_uInt16 nToken) const;
};
#endif // #ifndef INCLUDED_unotools_USEROPTIONS_HXX
diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst
index bb63ba975ed2..d6f10335c254 100644
--- a/unotools/prj/build.lst
+++ b/unotools/prj/build.lst
@@ -1,4 +1,4 @@
-ut unotools : comphelper cppuhelper offuh tools ucbhelper NULL
+ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL
ut unotools usr1 - all ut_mkout NULL
ut unotools\inc nmake - all ut_inc NULL
ut unotools\source\misc nmake - all ut_misc ut_config ut_inc NULL
@@ -10,3 +10,5 @@ ut unotools\source\i18n nmake - all ut_i18n ut_inc NULL
ut unotools\source\property nmake - all ut_property ut_inc NULL
ut unotools\source\accessibility nmake - all ut_accessibility ut_inc NULL
ut unotools\util nmake - all ut_util ut_config ut_i18n ut_misc ut_procfact ut_streaming ut_ucbhelper ut_property ut_accessibility NULL
+
+ut unotools\qa\complex\tempfile nmake - all ut_qa_complex ut_util NULL
diff --git a/unotools/prj/d.lst b/unotools/prj/d.lst
index ad8a764055b2..38cafd0cc1f8 100644
--- a/unotools/prj/d.lst
+++ b/unotools/prj/d.lst
@@ -9,3 +9,4 @@
mkdir: %_DEST%\inc%_EXT%\unotools
..\inc\unotools\*.hxx %_DEST%\inc%_EXT%\unotools\*.hxx
..\inc\unotools\unotoolsdllapi.h %_DEST%\inc%_EXT%\unotools\unotoolsdllapi.h
+..\%__SRC%\misc\utl.component %_DEST%\xml%_EXT%\utl.component
diff --git a/unotools/qa/complex/tempfile/TempFileUnitTest.java b/unotools/qa/complex/tempfile/TempFileUnitTest.java
index 5cd0b7292105..e5f1f2d6d6b2 100644
--- a/unotools/qa/complex/tempfile/TempFileUnitTest.java
+++ b/unotools/qa/complex/tempfile/TempFileUnitTest.java
@@ -26,60 +26,89 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.uno.UnoRuntime;
+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.*;
+
/* Document.
*/
-public class TempFileUnitTest extends ComplexTestCase {
+public class TempFileUnitTest /* extends ComplexTestCase */ {
private XMultiServiceFactory m_xMSF = null;
private XSimpleFileAccess m_xSFA = null;
- public String[] getTestMethodNames() {
- return new String[] {
- "ExecuteTest01",
- "ExecuteTest02"};
- }
-
- public String getTestObjectName() {
- return "TempFileUnitTest";
- }
+// public String[] getTestMethodNames() {
+// return new String[] {
+// "ExecuteTest01",
+// "ExecuteTest02"};
+// }
+//
+// public String getTestObjectName() {
+// return "TempFileUnitTest";
+// }
- public void before() {
- m_xMSF = (XMultiServiceFactory)param.getMSF();
+ @Before public void before() {
+ m_xMSF = getMSF();
if ( m_xMSF == null ) {
- failed ( "Cannot create service factory!" );
+ fail ( "Cannot create service factory!" );
}
try
{
Object oSFA = m_xMSF.createInstance( "com.sun.star.ucb.SimpleFileAccess" );
- m_xSFA = ( XSimpleFileAccess )UnoRuntime.queryInterface( XSimpleFileAccess.class,
- oSFA );
+ m_xSFA = UnoRuntime.queryInterface( XSimpleFileAccess.class, oSFA );
}
catch ( Exception e )
{
- failed ( "Cannot get simple file access! Exception: " + e);
+ fail ( "Cannot get simple file access! Exception: " + e);
}
if ( m_xSFA == null ) {
- failed ( "Cannot get simple file access!" );
+ fail ( "Cannot get simple file access!" );
}
}
- public void after() {
+ @After public void after() {
m_xMSF = null;
m_xSFA = null;
}
- public void ExecuteTest01() {
- TempFileTest aTest = new Test01( m_xMSF, m_xSFA, log );
- assure( "Test01 failed!", aTest.test() );
+ @Test public void ExecuteTest01() {
+ TempFileTest aTest = new Test01( m_xMSF, m_xSFA );
+ assertTrue( "Test01 failed!", aTest.test() );
+ }
+
+ @Test public void ExecuteTest02() {
+ TempFileTest aTest = new Test02( m_xMSF, m_xSFA );
+ assertTrue( "Test02 failed!", aTest.test() );
}
- public void ExecuteTest02() {
- TempFileTest aTest = new Test02( m_xMSF, m_xSFA, log );
- assure( "Test02 failed!", aTest.test() );
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
}
-}; \ No newline at end of file
+
+ // 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/unotools/qa/complex/tempfile/Test01.java b/unotools/qa/complex/tempfile/Test01.java
index dbf3d6c15de2..3eac1c2ecf44 100644
--- a/unotools/qa/complex/tempfile/Test01.java
+++ b/unotools/qa/complex/tempfile/Test01.java
@@ -26,7 +26,7 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
@@ -42,10 +42,10 @@ public class Test01 implements TempFileTest {
XSimpleFileAccess m_xSFA = null;
TestHelper m_aTestHelper = null;
- public Test01(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA, LogWriter aLogWriter) {
+ public Test01(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA) {
m_xMSF = xMSF;
m_xSFA = xSFA;
- m_aTestHelper = new TestHelper(aLogWriter, "Test01: ");
+ m_aTestHelper = new TestHelper( "Test01: ");
}
public boolean test() {
@@ -56,11 +56,9 @@ public class Test01 implements TempFileTest {
//create a temporary file.
try {
Object oTempFile = m_xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFile = (XTempFile) UnoRuntime.queryInterface( XTempFile.class,
- oTempFile );
+ xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message( "Tempfile created." );
- xTruncate = (XTruncate)UnoRuntime.queryInterface( XTruncate.class,
- oTempFile );
+ xTruncate = UnoRuntime.queryInterface(XTruncate.class, oTempFile);
} catch( Exception e ) {
m_aTestHelper.Error( "Cannot create TempFile. exception: " + e );
return false;
diff --git a/unotools/qa/complex/tempfile/Test02.java b/unotools/qa/complex/tempfile/Test02.java
index 18ca4de2e04b..79e27720b31e 100644
--- a/unotools/qa/complex/tempfile/Test02.java
+++ b/unotools/qa/complex/tempfile/Test02.java
@@ -26,15 +26,13 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.ucb.XSimpleFileAccess;
import com.sun.star.io.*;
-import com.sun.star.lang.XServiceInfo;
+
import com.sun.star.uno.UnoRuntime;
import java.util.Random;
-import share.LogWriter;
public class Test02 implements TempFileTest {
@@ -42,10 +40,10 @@ public class Test02 implements TempFileTest {
XSimpleFileAccess m_xSFA;
TestHelper m_aTestHelper;
- public Test02(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA, LogWriter aLogWriter) {
+ public Test02(XMultiServiceFactory xMSF, XSimpleFileAccess xSFA) {
m_xMSF = xMSF;
m_xSFA = xSFA;
- m_aTestHelper = new TestHelper(aLogWriter, "Test02: ");
+ m_aTestHelper = new TestHelper( "Test02: ");
}
public boolean test() {
@@ -57,11 +55,9 @@ public class Test02 implements TempFileTest {
//create a temporary file.
try {
oTempFile = m_xMSF.createInstance( "com.sun.star.io.TempFile" );
- xTempFile = (XTempFile) UnoRuntime.queryInterface( XTempFile.class,
- oTempFile );
+ xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
m_aTestHelper.Message( "Tempfile created." );
- xTruncate = (XTruncate)UnoRuntime.queryInterface( XTruncate.class,
- oTempFile );
+ xTruncate = UnoRuntime.queryInterface(XTruncate.class, oTempFile);
} catch(Exception e) {
m_aTestHelper.Error( "Cannot create TempFile. exception: " + e );
return false;
diff --git a/unotools/qa/complex/tempfile/TestHelper.java b/unotools/qa/complex/tempfile/TestHelper.java
index 6edc2c362fa8..cf93828624f5 100644
--- a/unotools/qa/complex/tempfile/TestHelper.java
+++ b/unotools/qa/complex/tempfile/TestHelper.java
@@ -26,22 +26,20 @@
************************************************************************/
package complex.tempfile;
-import complexlib.ComplexTestCase;
-import com.sun.star.lang.XMultiServiceFactory;
+
import com.sun.star.io.*;
import com.sun.star.uno.AnyConverter;
import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-import share.LogWriter;
+
public class TestHelper {
- LogWriter m_aLogWriter;
+
String m_sTestPrefix;
- public TestHelper( LogWriter aLogWriter, String sTestPrefix ) {
- m_aLogWriter = aLogWriter;
+ public TestHelper( String sTestPrefix ) {
+
m_sTestPrefix = sTestPrefix;
}
public void SetTempFileRemove( XTempFile xTempFile, boolean b ) {
@@ -69,7 +67,7 @@ public class TestHelper {
} catch (Exception e) {
Error ( "Cannot get TempFileURL. exception: " + e );
}
- if ( sTempFileURL == null || sTempFileURL == "" ) {
+ if ( sTempFileURL == null || sTempFileURL.equals("") ) {
Error ( "Temporary file not valid." );
}
return sTempFileURL;
@@ -82,7 +80,7 @@ public class TestHelper {
} catch ( Exception e ) {
Error( "Cannot get TempFileName. exception: " + e );
}
- if ( sTempFileName == null || sTempFileName == "") {
+ if ( sTempFileName == null || sTempFileName.equals("") ) {
Error( "Temporary file not valid." );
}
return sTempFileName;
@@ -216,10 +214,10 @@ public class TestHelper {
}
public void Error( String sError ) {
- m_aLogWriter.println( m_sTestPrefix + "Error: " + sError );
+ System.out.println( m_sTestPrefix + "Error: " + sError );
}
public void Message( String sMessage ) {
- m_aLogWriter.println( m_sTestPrefix + sMessage );
+ System.out.println( m_sTestPrefix + sMessage );
}
}
diff --git a/unotools/qa/complex/tempfile/makefile.mk b/unotools/qa/complex/tempfile/makefile.mk
index 13d66ca3edd1..30a5eb7261ec 100644
--- a/unotools/qa/complex/tempfile/makefile.mk
+++ b/unotools/qa/complex/tempfile/makefile.mk
@@ -25,61 +25,33 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = TempFileUnitTest
-PRJNAME = unotools
-PACKAGE = complex$/tempfile
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-
-JAVAFILES =\
- TempFileUnitTest.java\
- TempFileTest.java\
- TestHelper.java\
- Test01.java\
- Test02.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- 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 =
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+PRJ = ../../..
+PRJNAME = unotools
+TARGET = qa_complex_tempfile
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/tempfile
+JAVATESTFILES = \
+ TempFileUnitTest.java
-# start the runner application
-CT_APP = org.openoffice.Runner
+JAVAFILES = $(JAVATESTFILES) \
+ TempFileTest.java \
+ Test01.java \
+ Test02.java \
+ TestHelper.java
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-RUN: run
-
-run:
- +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
-
+ALLTAR : javatest
+.END
diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx
index 37482ebcd67a..c1748e3b411c 100644
--- a/unotools/source/config/accelcfg.cxx
+++ b/unotools/source/config/accelcfg.cxx
@@ -72,7 +72,7 @@ public:
bool bModified;
SvtAcceleratorConfig_Impl()
- : bModified( FALSE )
+ : bModified( sal_False )
{}
SvtAcceleratorConfig_Impl( Reference< XInputStream >& xInputStream );
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
index 963a76a8297d..0b9f1331b261 100644
--- a/unotools/source/config/defaultoptions.cxx
+++ b/unotools/source/config/defaultoptions.cxx
@@ -108,7 +108,7 @@ public:
SvtDefaultOptions_Impl();
- String GetDefaultPath( USHORT nId ) const;
+ String GetDefaultPath( sal_uInt16 nId ) const;
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
};
@@ -201,10 +201,10 @@ void SvtDefaultOptions_Impl::Commit()
// class SvtDefaultOptions_Impl ------------------------------------------
-String SvtDefaultOptions_Impl::GetDefaultPath( USHORT nId ) const
+String SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const
{
String aRet;
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
while ( PathMap_Impl[nIdx]._ePath <= SvtPathOptions::PATH_WORK )
{
@@ -357,7 +357,7 @@ SvtDefaultOptions::~SvtDefaultOptions()
// -----------------------------------------------------------------------
-String SvtDefaultOptions::GetDefaultPath( USHORT nId ) const
+String SvtDefaultOptions::GetDefaultPath( sal_uInt16 nId ) const
{
return pImp->GetDefaultPath( nId );
}
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index e380bcbb0b7e..805a38f98620 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -234,7 +234,7 @@ void SvtCalcFilterOptions_Impl::Load()
struct SvtFilterOptions_Impl
{
- ULONG nFlags;
+ sal_uLong nFlags;
SvtWriterFilterOptions_Impl aWriterCfg;
SvtCalcFilterOptions_Impl aCalcCfg;
SvtAppFilterOptions_Impl aImpressCfg;
@@ -262,8 +262,8 @@ struct SvtFilterOptions_Impl
Load();
}
- void SetFlag( ULONG nFlag, BOOL bSet );
- BOOL IsFlag( ULONG nFlag ) const;
+ void SetFlag( sal_uLong nFlag, sal_Bool bSet );
+ sal_Bool IsFlag( sal_uLong nFlag ) const;
void Load()
{
aWriterCfg.Load();
@@ -272,7 +272,7 @@ struct SvtFilterOptions_Impl
}
};
-void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet )
+void SvtFilterOptions_Impl::SetFlag( sal_uLong nFlag, sal_Bool bSet )
{
switch(nFlag)
{
@@ -292,9 +292,9 @@ void SvtFilterOptions_Impl::SetFlag( ULONG nFlag, BOOL bSet )
}
}
-BOOL SvtFilterOptions_Impl::IsFlag( ULONG nFlag ) const
+sal_Bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
{
- BOOL bRet;
+ sal_Bool bRet;
switch(nFlag)
{
case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
@@ -356,9 +356,9 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
return aNames;
}
//-----------------------------------------------------------------------
-static ULONG lcl_GetFlag(sal_Int32 nProp)
+static sal_uLong lcl_GetFlag(sal_Int32 nProp)
{
- ULONG nFlag = 0;
+ sal_uLong nFlag = 0;
switch(nProp)
{
case 0: nFlag = FILTERCFG_MATH_LOAD; break;
@@ -393,7 +393,7 @@ void SvtFilterOptions::Commit()
const Type& rType = ::getBooleanCppuType();
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
{
- ULONG nFlag = lcl_GetFlag(nProp);
+ sal_uLong nFlag = lcl_GetFlag(nProp);
sal_Bool bVal = pImp->IsFlag( nFlag);
pValues[nProp].setValue(&bVal, rType);
@@ -415,7 +415,7 @@ void SvtFilterOptions::Load()
if(pValues[nProp].hasValue())
{
sal_Bool bVal = *(sal_Bool*)pValues[nProp].getValue();
- ULONG nFlag = lcl_GetFlag(nProp);
+ sal_uLong nFlag = lcl_GetFlag(nProp);
pImp->SetFlag( nFlag, bVal);
}
}
@@ -440,7 +440,7 @@ void SvtFilterOptions::SetLoadWordBasicExecutable( sal_Bool bFlag )
SetModified();
}
-BOOL SvtFilterOptions::IsLoadWordBasicExecutable() const
+sal_Bool SvtFilterOptions::IsLoadWordBasicExecutable() const
{
return pImp->IsFlag( FILTERCFG_WORD_WBCTBL );
}
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index ac2e7f797f76..6ff32c0b6e71 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -615,7 +615,7 @@ static ImplFontAttrWidthSearchData const aImplWidthAttrSearchList[] =
struct ImplFontAttrTypeSearchData
{
const char* mpStr;
- ULONG mnType;
+ sal_uLong mnType;
};
static ImplFontAttrTypeSearchData const aImplTypeAttrSearchList[] =
@@ -779,23 +779,23 @@ static bool ImplKillTrailingWithExceptions( String& rName, const char* const* pp
// -----------------------------------------------------------------------
-static BOOL ImplFindAndErase( String& rName, const char* pStr )
+static sal_Bool ImplFindAndErase( String& rName, const char* pStr )
{
xub_StrLen nPos = rName.SearchAscii( pStr );
if ( nPos == STRING_NOTFOUND )
- return FALSE;
+ return sal_False;
const char* pTempStr = pStr;
while ( *pTempStr )
pTempStr++;
rName.Erase( nPos, (xub_StrLen)(pTempStr-pStr) );
- return TRUE;
+ return sal_True;
}
// =======================================================================
void FontSubstConfiguration::getMapName( const String& rOrgName, String& rShortName,
- String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, ULONG& rType )
+ String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, sal_uLong& rType )
{
rShortName = rOrgName;
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 853d7d156d51..9805c14c362d 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -73,25 +73,25 @@ static osl::Mutex & GetOwnMutex()
///////////////////////////////////////////////////////////////////////////
-static BOOL lcl_SetLocale( INT16 &rLanguage, const uno::Any &rVal )
+static sal_Bool lcl_SetLocale( sal_Int16 &rLanguage, const uno::Any &rVal )
{
- BOOL bSucc = FALSE;
+ sal_Bool bSucc = sal_False;
lang::Locale aNew;
if (rVal >>= aNew) // conversion successful?
{
- INT16 nNew = MsLangId::convertLocaleToLanguage( aNew );
+ sal_Int16 nNew = MsLangId::convertLocaleToLanguage( aNew );
if (nNew != rLanguage)
{
rLanguage = nNew;
- bSucc = TRUE;
+ bSucc = sal_True;
}
}
return bSucc;
}
-static inline const OUString lcl_LanguageToCfgLocaleStr( INT16 nLanguage )
+static inline const OUString lcl_LanguageToCfgLocaleStr( sal_Int16 nLanguage )
{
OUString aRes;
if (LANGUAGE_SYSTEM != nLanguage)
@@ -100,7 +100,7 @@ static inline const OUString lcl_LanguageToCfgLocaleStr( INT16 nLanguage )
}
-static INT16 lcl_CfgAnyToLanguage( const uno::Any &rVal )
+static sal_Int16 lcl_CfgAnyToLanguage( const uno::Any &rVal )
{
OUString aTmp;
rVal >>= aTmp;
@@ -118,34 +118,34 @@ SvtLinguOptions::SvtLinguOptions()
// general options
bIsUseDictionaryList =
- bIsIgnoreControlCharacters = TRUE;
+ bIsIgnoreControlCharacters = sal_True;
// spelling options
bIsSpellCapitalization =
- bIsSpellSpecial = TRUE;
+ bIsSpellSpecial = sal_True;
bIsSpellAuto =
bIsSpellReverse =
bIsSpellWithDigits =
- bIsSpellUpperCase = FALSE;
+ bIsSpellUpperCase = sal_False;
// text conversion options
- bIsIgnorePostPositionalWord = TRUE;
+ bIsIgnorePostPositionalWord = sal_True;
bIsAutoCloseDialog =
bIsShowEntriesRecentlyUsedFirst =
- bIsAutoReplaceUniqueEntries = FALSE;
- bIsDirectionToSimplified = TRUE;
+ bIsAutoReplaceUniqueEntries = sal_False;
+ bIsDirectionToSimplified = sal_True;
bIsUseCharacterVariants =
bIsTranslateCommonTerms =
- bIsReverseMapping = FALSE;
+ bIsReverseMapping = sal_False;
bROIsDirectionToSimplified =
bROIsUseCharacterVariants =
bROIsTranslateCommonTerms =
- bROIsReverseMapping = FALSE;
+ bROIsReverseMapping = sal_False;
// hyphenation options
- bIsHyphSpecial = TRUE;
- bIsHyphAuto = FALSE;
+ bIsHyphSpecial = sal_True;
+ bIsHyphAuto = sal_False;
nHyphMinLeading =
nHyphMinTrailing = 2;
nHyphMinWordLength = 0;
@@ -170,10 +170,10 @@ class SvtLinguConfigItem : public utl::ConfigItem
SvtLinguConfigItem( const SvtLinguConfigItem & );
SvtLinguConfigItem & operator = ( const SvtLinguConfigItem & );
- static BOOL GetHdlByName( INT32 &rnHdl, const OUString &rPropertyName, sal_Bool bFullPropName = sal_False );
+ static sal_Bool GetHdlByName( sal_Int32 &rnHdl, const OUString &rPropertyName, sal_Bool bFullPropName = sal_False );
static const uno::Sequence< OUString > & GetPropertyNames();
- BOOL LoadOptions( const uno::Sequence< OUString > &rProperyNames );
- BOOL SaveOptions( const uno::Sequence< OUString > &rProperyNames );
+ sal_Bool LoadOptions( const uno::Sequence< OUString > &rProperyNames );
+ sal_Bool SaveOptions( const uno::Sequence< OUString > &rProperyNames );
public:
SvtLinguConfigItem();
@@ -195,18 +195,18 @@ public:
com::sun::star::uno::Any
GetProperty( const rtl::OUString &rPropertyName ) const;
com::sun::star::uno::Any
- GetProperty( INT32 nPropertyHandle ) const;
+ GetProperty( sal_Int32 nPropertyHandle ) const;
- BOOL SetProperty( const rtl::OUString &rPropertyName,
+ sal_Bool SetProperty( const rtl::OUString &rPropertyName,
const com::sun::star::uno::Any &rValue );
- BOOL SetProperty( INT32 nPropertyHandle,
+ sal_Bool SetProperty( sal_Int32 nPropertyHandle,
const com::sun::star::uno::Any &rValue );
- BOOL GetOptions( SvtLinguOptions &rOptions ) const;
- BOOL SetOptions( const SvtLinguOptions &rOptions );
+ sal_Bool GetOptions( SvtLinguOptions &rOptions ) const;
+ sal_Bool SetOptions( const SvtLinguOptions &rOptions );
- BOOL IsReadOnly( const rtl::OUString &rPropertyName ) const;
- BOOL IsReadOnly( INT32 nPropertyHandle ) const;
+ sal_Bool IsReadOnly( const rtl::OUString &rPropertyName ) const;
+ sal_Bool IsReadOnly( sal_Int32 nPropertyHandle ) const;
};
@@ -244,7 +244,7 @@ static struct NamesToHdl
{
const char *pFullPropName; // full qualified name as used in configuration
const char *pPropName; // property name only (atom) of above
- INT32 nHdl; // numeric handle representing the property
+ sal_Int32 nHdl; // numeric handle representing the property
}aNamesToHdl[] =
{
{/* 0 */ "General/DefaultLocale", UPN_DEFAULT_LOCALE, UPH_DEFAULT_LOCALE},
@@ -296,12 +296,12 @@ const uno::Sequence< OUString > & SvtLinguConfigItem::GetPropertyNames()
if (!bInitialized)
{
- INT32 nMax = SAL_N_ELEMENTS(aNamesToHdl);
+ sal_Int32 nMax = SAL_N_ELEMENTS(aNamesToHdl);
aNames.realloc( nMax );
OUString *pNames = aNames.getArray();
- INT32 nIdx = 0;
- for (INT32 i = 0; i < nMax; ++i)
+ sal_Int32 nIdx = 0;
+ for (sal_Int32 i = 0; i < nMax; ++i)
{
const sal_Char *pFullPropName = aNamesToHdl[i].pFullPropName;
if (pFullPropName)
@@ -314,8 +314,8 @@ const uno::Sequence< OUString > & SvtLinguConfigItem::GetPropertyNames()
}
-BOOL SvtLinguConfigItem::GetHdlByName(
- INT32 &rnHdl,
+sal_Bool SvtLinguConfigItem::GetHdlByName(
+ sal_Int32 &rnHdl,
const OUString &rPropertyName,
sal_Bool bFullPropName )
{
@@ -354,20 +354,20 @@ uno::Any SvtLinguConfigItem::GetProperty( const OUString &rPropertyName ) const
{
osl::MutexGuard aGuard( GetOwnMutex() );
- INT32 nHdl;
+ sal_Int32 nHdl;
return GetHdlByName( nHdl, rPropertyName ) ? GetProperty( nHdl ) : uno::Any();
}
-uno::Any SvtLinguConfigItem::GetProperty( INT32 nPropertyHandle ) const
+uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const
{
osl::MutexGuard aGuard( GetOwnMutex() );
uno::Any aRes;
- const INT16 *pnVal = 0;
- const BOOL *pbVal = 0;
- const INT32 *pnInt32Val = 0;
+ const sal_Int16 *pnVal = 0;
+ const sal_Bool *pbVal = 0;
+ const sal_Int32 *pnInt32Val = 0;
const SvtLinguOptions &rOpt = const_cast< SvtLinguConfigItem * >(this)->aOpt;
switch (nPropertyHandle)
@@ -442,31 +442,31 @@ uno::Any SvtLinguConfigItem::GetProperty( INT32 nPropertyHandle ) const
}
-BOOL SvtLinguConfigItem::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
+sal_Bool SvtLinguConfigItem::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
{
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bSucc = FALSE;
- INT32 nHdl;
+ sal_Bool bSucc = sal_False;
+ sal_Int32 nHdl;
if (GetHdlByName( nHdl, rPropertyName ))
bSucc = SetProperty( nHdl, rValue );
return bSucc;
}
-BOOL SvtLinguConfigItem::SetProperty( INT32 nPropertyHandle, const uno::Any &rValue )
+sal_Bool SvtLinguConfigItem::SetProperty( sal_Int32 nPropertyHandle, const uno::Any &rValue )
{
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bSucc = FALSE;
+ sal_Bool bSucc = sal_False;
if (!rValue.hasValue())
return bSucc;
- BOOL bMod = FALSE;
+ sal_Bool bMod = sal_False;
- INT16 *pnVal = 0;
- BOOL *pbVal = 0;
- INT32 *pnInt32Val = 0;
+ sal_Int16 *pnVal = 0;
+ sal_Bool *pbVal = 0;
+ sal_Int32 *pnInt32Val = 0;
SvtLinguOptions &rOpt = aOpt;
switch (nPropertyHandle)
@@ -488,13 +488,13 @@ BOOL SvtLinguConfigItem::SetProperty( INT32 nPropertyHandle, const uno::Any &rVa
case UPH_ACTIVE_DICTIONARIES :
{
rValue >>= rOpt.aActiveDics;
- bMod = TRUE;
+ bMod = sal_True;
break;
}
case UPH_ACTIVE_CONVERSION_DICTIONARIES :
{
rValue >>= rOpt.aActiveConvDics;
- bMod = TRUE;
+ bMod = sal_True;
break;
}
case UPH_DEFAULT_LOCALE :
@@ -534,41 +534,41 @@ BOOL SvtLinguConfigItem::SetProperty( INT32 nPropertyHandle, const uno::Any &rVa
if (pbVal)
{
- BOOL bNew = BOOL();
+ sal_Bool bNew = sal_Bool();
if (rValue >>= bNew)
{
if (bNew != *pbVal)
{
*pbVal = bNew;
- bMod = TRUE;
+ bMod = sal_True;
}
- bSucc = TRUE;
+ bSucc = sal_True;
}
}
else if (pnVal)
{
- INT16 nNew = INT16();
+ sal_Int16 nNew = sal_Int16();
if (rValue >>= nNew)
{
if (nNew != *pnVal)
{
*pnVal = nNew;
- bMod = TRUE;
+ bMod = sal_True;
}
- bSucc = TRUE;
+ bSucc = sal_True;
}
}
else if (pnInt32Val)
{
- INT32 nNew = INT32();
+ sal_Int32 nNew = sal_Int32();
if (rValue >>= nNew)
{
if (nNew != *pnInt32Val)
{
*pnInt32Val = nNew;
- bMod = TRUE;
+ bMod = sal_True;
}
- bSucc = TRUE;
+ bSucc = sal_True;
}
}
@@ -580,34 +580,34 @@ BOOL SvtLinguConfigItem::SetProperty( INT32 nPropertyHandle, const uno::Any &rVa
}
-BOOL SvtLinguConfigItem::GetOptions( SvtLinguOptions &rOptions ) const
+sal_Bool SvtLinguConfigItem::GetOptions( SvtLinguOptions &rOptions ) const
{
osl::MutexGuard aGuard( GetOwnMutex() );
rOptions = aOpt;
- return TRUE;
+ return sal_True;
}
-BOOL SvtLinguConfigItem::SetOptions( const SvtLinguOptions &rOptions )
+sal_Bool SvtLinguConfigItem::SetOptions( const SvtLinguOptions &rOptions )
{
osl::MutexGuard aGuard( GetOwnMutex() );
aOpt = rOptions;
SetModified();
NotifyListeners(0);
- return TRUE;
+ return sal_True;
}
-BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyNames )
+sal_Bool SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyNames )
{
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bRes = FALSE;
+ sal_Bool bRes = sal_False;
const OUString *pProperyNames = rProperyNames.getConstArray();
- INT32 nProps = rProperyNames.getLength();
+ sal_Int32 nProps = rProperyNames.getLength();
const uno::Sequence< uno::Any > aValues = GetProperties( rProperyNames );
const uno::Sequence< sal_Bool > aROStates = GetReadOnlyStates( rProperyNames );
@@ -618,10 +618,10 @@ BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyN
const uno::Any *pValue = aValues.getConstArray();
const sal_Bool *pROStates = aROStates.getConstArray();
- for (INT32 i = 0; i < nProps; ++i)
+ for (sal_Int32 i = 0; i < nProps; ++i)
{
const uno::Any &rVal = pValue[i];
- INT32 nPropertyHandle;
+ sal_Int32 nPropertyHandle;
GetHdlByName( nPropertyHandle, pProperyNames[i], sal_True );
switch ( nPropertyHandle )
{
@@ -682,11 +682,11 @@ BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyN
|| rOpt.nDefaultLanguage_CJK == LANGUAGE_CHINESE_MACAU
|| rOpt.nDefaultLanguage_CJK == LANGUAGE_CHINESE_TRADITIONAL )
{
- rOpt.bIsDirectionToSimplified = FALSE;
+ rOpt.bIsDirectionToSimplified = sal_False;
}
else
{
- rOpt.bIsDirectionToSimplified = TRUE;
+ rOpt.bIsDirectionToSimplified = sal_True;
}
}
} break;
@@ -712,7 +712,7 @@ BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyN
}
}
- bRes = TRUE;
+ bRes = sal_True;
}
DBG_ASSERT( bRes, "LoadOptions failed" );
@@ -720,19 +720,19 @@ BOOL SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyN
}
-BOOL SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyNames )
+sal_Bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyNames )
{
if (!IsModified())
- return TRUE;
+ return sal_True;
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const uno::Type &rBOOL = ::getBooleanCppuType();
- const uno::Type &rINT16 = ::getCppuType( (INT16 *) NULL );
- const uno::Type &rINT32 = ::getCppuType( (INT32 *) NULL );
+ const uno::Type &rINT16 = ::getCppuType( (sal_Int16 *) NULL );
+ const uno::Type &rINT32 = ::getCppuType( (sal_Int32 *) NULL );
- INT32 nProps = rProperyNames.getLength();
+ sal_Int32 nProps = rProperyNames.getLength();
uno::Sequence< uno::Any > aValues( nProps );
uno::Any *pValue = aValues.getArray();
@@ -788,22 +788,22 @@ BOOL SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyN
return bRet;
}
-BOOL SvtLinguConfigItem::IsReadOnly( const rtl::OUString &rPropertyName ) const
+sal_Bool SvtLinguConfigItem::IsReadOnly( const rtl::OUString &rPropertyName ) const
{
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bReadOnly = FALSE;
- INT32 nHdl;
+ sal_Bool bReadOnly = sal_False;
+ sal_Int32 nHdl;
if (GetHdlByName( nHdl, rPropertyName ))
bReadOnly = IsReadOnly( nHdl );
return bReadOnly;
}
-BOOL SvtLinguConfigItem::IsReadOnly( INT32 nPropertyHandle ) const
+sal_Bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const
{
osl::MutexGuard aGuard( GetOwnMutex() );
- BOOL bReadOnly = FALSE;
+ sal_Bool bReadOnly = sal_False;
const SvtLinguOptions &rOpt = const_cast< SvtLinguConfigItem * >(this)->aOpt;
switch(nPropertyHandle)
@@ -919,47 +919,47 @@ uno::Any SvtLinguConfig::GetProperty( const OUString &rPropertyName ) const
}
-uno::Any SvtLinguConfig::GetProperty( INT32 nPropertyHandle ) const
+uno::Any SvtLinguConfig::GetProperty( sal_Int32 nPropertyHandle ) const
{
return GetConfigItem().GetProperty( nPropertyHandle );
}
-BOOL SvtLinguConfig::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
+sal_Bool SvtLinguConfig::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
{
return GetConfigItem().SetProperty( rPropertyName, rValue );
}
-BOOL SvtLinguConfig::SetProperty( INT32 nPropertyHandle, const uno::Any &rValue )
+sal_Bool SvtLinguConfig::SetProperty( sal_Int32 nPropertyHandle, const uno::Any &rValue )
{
return GetConfigItem().SetProperty( nPropertyHandle, rValue );
}
-BOOL SvtLinguConfig::GetOptions( SvtLinguOptions &rOptions ) const
+sal_Bool SvtLinguConfig::GetOptions( SvtLinguOptions &rOptions ) const
{
return GetConfigItem().GetOptions( rOptions );
}
-BOOL SvtLinguConfig::SetOptions( const SvtLinguOptions &rOptions )
+sal_Bool SvtLinguConfig::SetOptions( const SvtLinguOptions &rOptions )
{
return GetConfigItem().SetOptions( rOptions );
}
-BOOL SvtLinguConfig::IsReadOnly( const rtl::OUString &rPropertyName ) const
+sal_Bool SvtLinguConfig::IsReadOnly( const rtl::OUString &rPropertyName ) const
{
return GetConfigItem().IsReadOnly( rPropertyName );
}
-BOOL SvtLinguConfig::IsReadOnly( INT32 nPropertyHandle ) const
+sal_Bool SvtLinguConfig::IsReadOnly( sal_Int32 nPropertyHandle ) const
{
return GetConfigItem().IsReadOnly( nPropertyHandle );
}
-BOOL SvtLinguConfig::GetElementNamesFor(
+sal_Bool SvtLinguConfig::GetElementNamesFor(
const rtl::OUString &rNodeName,
uno::Sequence< rtl::OUString > &rElementNames ) const
{
@@ -1000,7 +1000,7 @@ static uno::Reference< container::XNameAccess > GetOrCreateSetEntry_Impl(
return xResult;
}
-BOOL SvtLinguConfig::GetSupportedDictionaryFormatsFor(
+sal_Bool SvtLinguConfig::GetSupportedDictionaryFormatsFor(
const rtl::OUString &rSetName,
const rtl::OUString &rSetEntry,
uno::Sequence< rtl::OUString > &rFormatList ) const
@@ -1117,7 +1117,7 @@ static bool lcl_GetFileUrlFromOrigin(
}
-BOOL SvtLinguConfig::GetDictionaryEntry(
+sal_Bool SvtLinguConfig::GetDictionaryEntry(
const rtl::OUString &rNodeName,
SvtLinguConfigDictionaryEntry &rDicEntry ) const
{
diff --git a/unotools/source/config/misccfg.cxx b/unotools/source/config/misccfg.cxx
index 2ee1da91de96..733818d17132 100644
--- a/unotools/source/config/misccfg.cxx
+++ b/unotools/source/config/misccfg.cxx
@@ -58,9 +58,9 @@ static sal_Int32 nRefCount = 0;
class SfxMiscCfg : public utl::ConfigItem
{
- BOOL bPaperSize; // printer warnings
- BOOL bPaperOrientation;
- BOOL bNotFound;
+ sal_Bool bPaperSize; // printer warnings
+ sal_Bool bPaperOrientation;
+ sal_Bool bNotFound;
sal_Int32 nYear2000; // two digit year representation
const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
@@ -73,14 +73,14 @@ public:
virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
virtual void Commit();
- BOOL IsNotFoundWarning() const {return bNotFound;}
- void SetNotFoundWarning( BOOL bSet);
+ sal_Bool IsNotFoundWarning() const {return bNotFound;}
+ void SetNotFoundWarning( sal_Bool bSet);
- BOOL IsPaperSizeWarning() const {return bPaperSize;}
- void SetPaperSizeWarning(BOOL bSet);
+ sal_Bool IsPaperSizeWarning() const {return bPaperSize;}
+ void SetPaperSizeWarning(sal_Bool bSet);
- BOOL IsPaperOrientationWarning() const {return bPaperOrientation;}
- void SetPaperOrientationWarning( BOOL bSet);
+ sal_Bool IsPaperOrientationWarning() const {return bPaperOrientation;}
+ void SetPaperOrientationWarning( sal_Bool bSet);
// 0 ... 99
sal_Int32 GetYear2000() const { return nYear2000; }
@@ -90,9 +90,9 @@ public:
SfxMiscCfg::SfxMiscCfg() :
ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common")) ),
- bPaperSize(FALSE),
- bPaperOrientation (FALSE),
- bNotFound (FALSE),
+ bPaperSize(sal_False),
+ bPaperOrientation (sal_False),
+ bNotFound (sal_False),
nYear2000( 1930 )
{
RTL_LOGFILE_CONTEXT(aLog, "svl SfxMiscCfg::SfxMiscCfg()");
@@ -104,21 +104,21 @@ SfxMiscCfg::~SfxMiscCfg()
{
}
-void SfxMiscCfg::SetNotFoundWarning( BOOL bSet)
+void SfxMiscCfg::SetNotFoundWarning( sal_Bool bSet)
{
if(bNotFound != bSet)
SetModified();
bNotFound = bSet;
}
-void SfxMiscCfg::SetPaperSizeWarning( BOOL bSet)
+void SfxMiscCfg::SetPaperSizeWarning( sal_Bool bSet)
{
if(bPaperSize != bSet)
SetModified();
bPaperSize = bSet;
}
-void SfxMiscCfg::SetPaperOrientationWarning( BOOL bSet)
+void SfxMiscCfg::SetPaperOrientationWarning( sal_Bool bSet)
{
if(bPaperOrientation != bSet)
SetModified();
@@ -240,32 +240,32 @@ MiscCfg::~MiscCfg( )
}
}
-BOOL MiscCfg::IsNotFoundWarning() const
+sal_Bool MiscCfg::IsNotFoundWarning() const
{
return pImpl->IsNotFoundWarning();
}
-void MiscCfg::SetNotFoundWarning( BOOL bSet)
+void MiscCfg::SetNotFoundWarning( sal_Bool bSet)
{
pImpl->SetNotFoundWarning( bSet );
}
-BOOL MiscCfg::IsPaperSizeWarning() const
+sal_Bool MiscCfg::IsPaperSizeWarning() const
{
return pImpl->IsPaperSizeWarning();
}
-void MiscCfg::SetPaperSizeWarning(BOOL bSet)
+void MiscCfg::SetPaperSizeWarning(sal_Bool bSet)
{
pImpl->SetPaperSizeWarning( bSet );
}
-BOOL MiscCfg::IsPaperOrientationWarning() const
+sal_Bool MiscCfg::IsPaperOrientationWarning() const
{
return pImpl->IsPaperOrientationWarning();
}
-void MiscCfg::SetPaperOrientationWarning( BOOL bSet)
+void MiscCfg::SetPaperOrientationWarning( sal_Bool bSet)
{
pImpl->SetPaperOrientationWarning( bSet );
}
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 8d7419f7722c..56da35f59f26 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -858,7 +858,7 @@ css::uno::Sequence< ::rtl::OUString > SvtModuleOptions_Impl::impl_ExpandSetNames
@short helper to classify given factory by name
@descr Every factory has his own long and short name. So we can match right enum value for internal using.
- @attention We change in/out parameter "eFactory" in every case! But you should use it only, if return value is TRUE!
+ @attention We change in/out parameter "eFactory" in every case! But you should use it only, if return value is sal_True!
Algorithm: Set out-parameter to propably value ... and check the longname.
If it match with these factory - break operation and return true AND right set parameter.
Otherwise try next one and so on. If no factory was found return false. Out parameter eFactory
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 3d7eddf9c89f..8356064172c1 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -44,12 +44,14 @@
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
#include <rtl/instance.hxx>
#include <itemholder1.hxx>
@@ -136,6 +138,7 @@ class SvtPathOptions_Impl
std::vector< String > m_aPathArray;
Reference< XFastPropertySet > m_xPathSettings;
Reference< XStringSubstitution > m_xSubstVariables;
+ Reference< XMacroExpander > m_xMacroExpander;
mutable EnumToHandleMap m_aMapEnumToPropHandle;
VarNameToEnumMap m_aMapVarNamesToEnum;
@@ -198,13 +201,13 @@ class SvtPathOptions_Impl
void SetUserConfigPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); }
void SetWorkPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); }
- rtl::OUString SubstVar( const rtl::OUString& rVar );
- rtl::OUString SubstituteAndConvert( const rtl::OUString& rPath );
- rtl::OUString UsePathVariables( const rtl::OUString& rPath );
+ rtl::OUString SubstVar( const rtl::OUString& rVar ) const;
+ rtl::OUString ExpandMacros( const rtl::OUString& rPath ) const;
+ rtl::OUString UsePathVariables( const rtl::OUString& rPath ) const;
::com::sun::star::lang::Locale GetLocale() const { return m_aLocale; }
- BOOL IsPathReadonly(SvtPathOptions::Pathes ePath)const;
+ sal_Bool IsPathReadonly(SvtPathOptions::Pathes ePath)const;
};
// global ----------------------------------------------------------------
@@ -302,10 +305,10 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
return m_aEmptyString;
}
// -----------------------------------------------------------------------
-BOOL SvtPathOptions_Impl::IsPathReadonly(SvtPathOptions::Pathes ePath)const
+sal_Bool SvtPathOptions_Impl::IsPathReadonly(SvtPathOptions::Pathes ePath)const
{
::osl::MutexGuard aGuard( m_aMutex );
- BOOL bReadonly = FALSE;
+ sal_Bool bReadonly = sal_False;
if ( ePath < SvtPathOptions::PATH_COUNT )
{
Reference<XPropertySet> xPrSet(m_xPathSettings, UNO_QUERY);
@@ -363,29 +366,35 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Pathes ePath, const String& r
}
}
-// -----------------------------------------------------------------------
+//-------------------------------------------------------------------------
-OUString SvtPathOptions_Impl::SubstituteAndConvert( const rtl::OUString& rPath )
+OUString SvtPathOptions_Impl::ExpandMacros( const rtl::OUString& rPath ) const
{
- return SubstVar( rPath );
+ ::rtl::OUString sExpanded( rPath );
+
+ const INetURLObject aParser( rPath );
+ if ( aParser.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND )
+ sExpanded = m_xMacroExpander->expandMacros( aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+
+ return sExpanded;
}
//-------------------------------------------------------------------------
-OUString SvtPathOptions_Impl::UsePathVariables( const OUString& rPath )
+OUString SvtPathOptions_Impl::UsePathVariables( const OUString& rPath ) const
{
return m_xSubstVariables->reSubstituteVariables( rPath );
}
// -----------------------------------------------------------------------
-OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar )
+OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
{
// Don't work at parameter-string directly. Copy it.
OUString aWorkText = rVar;
// Convert the returned path to system path!
- BOOL bConvertLocal = FALSE;
+ sal_Bool bConvertLocal = sal_False;
// Search for first occure of "$(...".
sal_Int32 nPosition = aWorkText.indexOf( SIGN_STARTVARIABLE ); // = first position of "$(" in string
@@ -412,7 +421,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar )
// Look for special variable that needs a system path.
VarNameToEnumMap::const_iterator pIter = m_aMapVarNamesToEnum.find( aSubString );
if ( pIter != m_aMapVarNamesToEnum.end() )
- bConvertLocal = TRUE;
+ bConvertLocal = sal_True;
nPosition += nLength;
@@ -474,18 +483,9 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
Reference< XInterface >() );
}
- m_xSubstVariables = Reference< XStringSubstitution >( xSMgr->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.PathSubstitution" ))),
- UNO_QUERY );
- if ( !m_xSubstVariables.is() )
- {
- // #112719#: check for existance
- OSL_FAIL( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" );
- throw RuntimeException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Service com.sun.star.util.PathSubstitution cannot be created" )),
- Reference< XInterface >() );
- }
+ ::comphelper::ComponentContext aContext( xSMgr );
+ m_xSubstVariables.set( aContext.createComponent( "com.sun.star.util.PathSubstitution" ), UNO_QUERY_THROW );
+ m_xMacroExpander.set( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY_THROW );
// Create temporary hash map to have a mapping between property names and property handles
Reference< XPropertySet > xPropertySet = Reference< XPropertySet >( m_xPathSettings, UNO_QUERY );
@@ -896,13 +896,22 @@ void SvtPathOptions::SetWorkPath( const String& rPath )
// -----------------------------------------------------------------------
-String SvtPathOptions::SubstituteVariable( const String& rVar )
+String SvtPathOptions::SubstituteVariable( const String& rVar ) const
{
- String aRet = pImp->SubstituteAndConvert( rVar );
+ String aRet = pImp->SubstVar( rVar );
return aRet;
}
-String SvtPathOptions::UseVariable( const String& rPath )
+// -----------------------------------------------------------------------
+
+String SvtPathOptions::ExpandMacros( const String& rPath ) const
+{
+ return pImp->ExpandMacros( rPath );
+}
+
+// -----------------------------------------------------------------------
+
+String SvtPathOptions::UseVariable( const String& rPath ) const
{
String aRet = pImp->UsePathVariables( rPath );
return aRet;
@@ -973,7 +982,7 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
case PATH_TEMPLATE: aPath = GetTemplatePath(); break;
case PATH_WORK: aPath = GetWorkPath(); break;
case PATH_UICONFIG: aPath = GetUIConfigPath(); break;
- case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
+ case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
case PATH_USERCONFIG:/*-Wall???*/ break;
case PATH_COUNT: /*-Wall???*/ break;
}
@@ -981,16 +990,27 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
sal_uInt16 j, nIdx = 0, nTokenCount = aPath.GetTokenCount( SEARCHPATH_DELIMITER );
for ( j = 0; j < nTokenCount; ++j )
{
- BOOL bIsURL = TRUE;
+ sal_Bool bIsURL = sal_True;
String aPathToken = aPath.GetToken( 0, SEARCHPATH_DELIMITER, nIdx );
INetURLObject aObj( aPathToken );
if ( aObj.HasError() )
{
- bIsURL = FALSE;
+ bIsURL = sal_False;
String aURL;
if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) )
aObj.SetURL( aURL );
}
+ if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND )
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XMacroExpander > xMacroExpander( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY );
+ OSL_ENSURE( xMacroExpander.is(), "SvtPathOptions::SearchFile: unable to access the MacroExpander singleton!" );
+ if ( xMacroExpander.is() )
+ {
+ const ::rtl::OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+ aObj.SetURL( sExpandedPath );
+ }
+ }
xub_StrLen i, nCount = aIniFile.GetTokenCount( '/' );
for ( i = 0; i < nCount; ++i )
@@ -1020,7 +1040,7 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
return pImp->GetLocale();
}
// -----------------------------------------------------------------------
-BOOL SvtPathOptions::IsPathReadonly(Pathes ePath)const
+sal_Bool SvtPathOptions::IsPathReadonly(Pathes ePath)const
{
return pImp->IsPathReadonly(ePath);
}
diff --git a/unotools/source/config/regoptions.cxx b/unotools/source/config/regoptions.cxx
index 4328ed3ebcfe..fcd4c767ef8a 100644
--- a/unotools/source/config/regoptions.cxx
+++ b/unotools/source/config/regoptions.cxx
@@ -79,9 +79,9 @@ namespace utl
if ( bValid )
{
Date aDate;
- aDate.SetDay ( (USHORT)_rStringRep.copy( 0, 2 ).toInt32( ) );
- aDate.SetMonth ( (USHORT)_rStringRep.copy( 3, 2 ).toInt32( ) );
- aDate.SetYear ( (USHORT)_rStringRep.copy( 6, 4 ).toInt32( ) );
+ aDate.SetDay ( (sal_uInt16)_rStringRep.copy( 0, 2 ).toInt32( ) );
+ aDate.SetMonth ( (sal_uInt16)_rStringRep.copy( 3, 2 ).toInt32( ) );
+ aDate.SetYear ( (sal_uInt16)_rStringRep.copy( 6, 4 ).toInt32( ) );
nDateIntRep = aDate.GetDate();
}
}
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 80ba32920550..754c65d63ccf 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -107,16 +107,16 @@ public:
virtual void Commit();
sal_Int32 GetAutoSaveTime() const { return nAutoSaveTime; }
- BOOL IsUseUserData() const { return bUseUserData; }
- BOOL IsBackup() const { return bBackup; }
- BOOL IsAutoSave() const { return bAutoSave; }
- BOOL IsAutoSavePrompt() const { return bAutoSavePrompt; }
- BOOL IsDocInfoSave() const { return bDocInfSave; }
- BOOL IsSaveWorkingSet() const { return bSaveWorkingSet; }
- BOOL IsSaveDocView() const { return bSaveDocView; }
- BOOL IsSaveRelINet() const { return bSaveRelINet; }
- BOOL IsSaveRelFSys() const { return bSaveRelFSys; }
- BOOL IsSaveUnpacked() const { return bSaveUnpacked; }
+ sal_Bool IsUseUserData() const { return bUseUserData; }
+ sal_Bool IsBackup() const { return bBackup; }
+ sal_Bool IsAutoSave() const { return bAutoSave; }
+ sal_Bool IsAutoSavePrompt() const { return bAutoSavePrompt; }
+ sal_Bool IsDocInfoSave() const { return bDocInfSave; }
+ sal_Bool IsSaveWorkingSet() const { return bSaveWorkingSet; }
+ sal_Bool IsSaveDocView() const { return bSaveDocView; }
+ sal_Bool IsSaveRelINet() const { return bSaveRelINet; }
+ sal_Bool IsSaveRelFSys() const { return bSaveRelFSys; }
+ sal_Bool IsSaveUnpacked() const { return bSaveUnpacked; }
sal_Bool IsPrettyPrintingEnabled( ) const { return bDoPrettyPrinting; }
sal_Bool IsWarnAlienFormat() const { return bWarnAlienFormat; }
sal_Bool IsLoadDocPrinter() const { return bLoadDocPrinter; }
@@ -124,16 +124,16 @@ public:
GetODFDefaultVersion() const { return eODFDefaultVersion; }
void SetAutoSaveTime( sal_Int32 n );
- void SetUseUserData( BOOL b );
- void SetBackup( BOOL b );
- void SetAutoSave( BOOL b );
- void SetAutoSavePrompt( BOOL b );
- void SetDocInfoSave( BOOL b );
- void SetSaveWorkingSet( BOOL b );
- void SetSaveDocView( BOOL b );
- void SetSaveRelINet( BOOL b );
- void SetSaveRelFSys( BOOL b );
- void SetSaveUnpacked( BOOL b );
+ void SetUseUserData( sal_Bool b );
+ void SetBackup( sal_Bool b );
+ void SetAutoSave( sal_Bool b );
+ void SetAutoSavePrompt( sal_Bool b );
+ void SetDocInfoSave( sal_Bool b );
+ void SetSaveWorkingSet( sal_Bool b );
+ void SetSaveDocView( sal_Bool b );
+ void SetSaveRelINet( sal_Bool b );
+ void SetSaveRelFSys( sal_Bool b );
+ void SetSaveUnpacked( sal_Bool b );
void EnablePrettyPrinting( sal_Bool _bDoPP );
void SetWarnAlienFormat( sal_Bool _bDoPP );
void SetLoadDocPrinter( sal_Bool bNew );
@@ -152,7 +152,7 @@ void SvtSaveOptions_Impl::SetAutoSaveTime( sal_Int32 n )
}
}
-void SvtSaveOptions_Impl::SetUseUserData( BOOL b )
+void SvtSaveOptions_Impl::SetUseUserData( sal_Bool b )
{
if (!bROUseUserData && bUseUserData!=b)
{
@@ -161,7 +161,7 @@ void SvtSaveOptions_Impl::SetUseUserData( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetBackup( BOOL b )
+void SvtSaveOptions_Impl::SetBackup( sal_Bool b )
{
if (!bROBackup && bBackup!=b)
{
@@ -170,7 +170,7 @@ void SvtSaveOptions_Impl::SetBackup( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetAutoSave( BOOL b )
+void SvtSaveOptions_Impl::SetAutoSave( sal_Bool b )
{
if (!bROAutoSave && bAutoSave!=b)
{
@@ -180,7 +180,7 @@ void SvtSaveOptions_Impl::SetAutoSave( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetAutoSavePrompt( BOOL b )
+void SvtSaveOptions_Impl::SetAutoSavePrompt( sal_Bool b )
{
if (!bROAutoSavePrompt && bAutoSavePrompt!=b)
{
@@ -189,7 +189,7 @@ void SvtSaveOptions_Impl::SetAutoSavePrompt( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetDocInfoSave(BOOL b)
+void SvtSaveOptions_Impl::SetDocInfoSave(sal_Bool b)
{
if (!bRODocInfSave && bDocInfSave!=b)
{
@@ -198,7 +198,7 @@ void SvtSaveOptions_Impl::SetDocInfoSave(BOOL b)
}
}
-void SvtSaveOptions_Impl::SetSaveWorkingSet( BOOL b )
+void SvtSaveOptions_Impl::SetSaveWorkingSet( sal_Bool b )
{
if (!bROSaveWorkingSet && bSaveWorkingSet!=b)
{
@@ -207,7 +207,7 @@ void SvtSaveOptions_Impl::SetSaveWorkingSet( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetSaveDocView( BOOL b )
+void SvtSaveOptions_Impl::SetSaveDocView( sal_Bool b )
{
if (!bROSaveDocView && bSaveDocView!=b)
{
@@ -216,7 +216,7 @@ void SvtSaveOptions_Impl::SetSaveDocView( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetSaveRelINet( BOOL b )
+void SvtSaveOptions_Impl::SetSaveRelINet( sal_Bool b )
{
if (!bROSaveRelINet && bSaveRelINet!=b)
{
@@ -225,7 +225,7 @@ void SvtSaveOptions_Impl::SetSaveRelINet( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetSaveRelFSys( BOOL b )
+void SvtSaveOptions_Impl::SetSaveRelFSys( sal_Bool b )
{
if (!bROSaveRelFSys && bSaveRelFSys!=b)
{
@@ -234,7 +234,7 @@ void SvtSaveOptions_Impl::SetSaveRelFSys( BOOL b )
}
}
-void SvtSaveOptions_Impl::SetSaveUnpacked( BOOL b )
+void SvtSaveOptions_Impl::SetSaveUnpacked( sal_Bool b )
{
if (!bROSaveUnpacked && bSaveUnpacked!=b)
{
diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx
index 5da91ee1789a..800672c3ac95 100644
--- a/unotools/source/config/searchopt.cxx
+++ b/unotools/source/config/searchopt.cxx
@@ -53,19 +53,19 @@ using ::rtl::OUString;
class SvtSearchOptions_Impl : public ConfigItem
{
- INT32 nFlags;
- BOOL bModified;
+ sal_Int32 nFlags;
+ sal_Bool bModified;
// disallow copy-constructor and assignment-operator for now
SvtSearchOptions_Impl( const SvtSearchOptions_Impl & );
SvtSearchOptions_Impl & operator = ( const SvtSearchOptions_Impl & );
protected:
- BOOL IsModified() const { return bModified; }
+ sal_Bool IsModified() const { return bModified; }
using ConfigItem::SetModified;
- void SetModified( BOOL bVal );
- BOOL Load();
- BOOL Save();
+ void SetModified( sal_Bool bVal );
+ sal_Bool Load();
+ sal_Bool Save();
Sequence< OUString > GetPropertyNames() const;
@@ -77,8 +77,8 @@ public:
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
- BOOL GetFlag( USHORT nOffset ) const;
- void SetFlag( USHORT nOffset, BOOL bVal );
+ sal_Bool GetFlag( sal_uInt16 nOffset ) const;
+ void SetFlag( sal_uInt16 nOffset, sal_Bool bVal );
};
@@ -89,7 +89,7 @@ SvtSearchOptions_Impl::SvtSearchOptions_Impl() :
RTL_LOGFILE_CONTEXT(aLog, "unotools SvtSearchOptions_Impl::SvtSearchOptions_Impl()");
nFlags = 0x0003FFFF; // set all options values to 'true'
Load();
- SetModified( FALSE );
+ SetModified( sal_False );
}
@@ -110,28 +110,28 @@ void SvtSearchOptions_Impl::Notify( const Sequence< rtl::OUString >& )
}
-BOOL SvtSearchOptions_Impl::GetFlag( USHORT nOffset ) const
+sal_Bool SvtSearchOptions_Impl::GetFlag( sal_uInt16 nOffset ) const
{
DBG_ASSERT( nOffset <= MAX_FLAGS_OFFSET, "offset out of range");
- return ((nFlags >> nOffset) & 0x01) ? TRUE : FALSE;
+ return ((nFlags >> nOffset) & 0x01) ? sal_True : sal_False;
}
-void SvtSearchOptions_Impl::SetFlag( USHORT nOffset, BOOL bVal )
+void SvtSearchOptions_Impl::SetFlag( sal_uInt16 nOffset, sal_Bool bVal )
{
DBG_ASSERT( nOffset <= MAX_FLAGS_OFFSET, "offset out of range");
- INT32 nOldFlags = nFlags;
- INT32 nMask = ((INT32) 1) << nOffset;
+ sal_Int32 nOldFlags = nFlags;
+ sal_Int32 nMask = ((sal_Int32) 1) << nOffset;
if (bVal)
nFlags |= nMask;
else
nFlags &= ~nMask;
if (nFlags != nOldFlags)
- SetModified( TRUE );
+ SetModified( sal_True );
}
-void SvtSearchOptions_Impl::SetModified( BOOL bVal )
+void SvtSearchOptions_Impl::SetModified( sal_Bool bVal )
{
bModified = bVal;
if (bModified)
@@ -177,19 +177,19 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() const
const int nCount = SAL_N_ELEMENTS( aPropNames );
Sequence< OUString > aNames( nCount );
OUString* pNames = aNames.getArray();
- for (INT32 i = 0; i < nCount; ++i)
+ for (sal_Int32 i = 0; i < nCount; ++i)
pNames[i] = OUString::createFromAscii( aPropNames[i] );
return aNames;
}
-BOOL SvtSearchOptions_Impl::Load()
+sal_Bool SvtSearchOptions_Impl::Load()
{
- BOOL bSucc = FALSE;
+ sal_Bool bSucc = sal_False;
Sequence< OUString > aNames = GetPropertyNames();
- INT32 nProps = aNames.getLength();
+ sal_Int32 nProps = aNames.getLength();
const Sequence< Any > aValues = GetProperties( aNames );
DBG_ASSERT( aValues.getLength() == aNames.getLength(),
@@ -198,16 +198,16 @@ BOOL SvtSearchOptions_Impl::Load()
if (nProps && aValues.getLength() == nProps)
{
- bSucc = TRUE;
+ bSucc = sal_True;
const Any* pValues = aValues.getConstArray();
- for (USHORT i = 0; i < nProps; ++i)
+ for (sal_uInt16 i = 0; i < nProps; ++i)
{
const Any &rVal = pValues[i];
DBG_ASSERT( rVal.hasValue(), "property value missing" );
if (rVal.hasValue())
{
- BOOL bVal = BOOL();
+ sal_Bool bVal = sal_Bool();
if (rVal >>= bVal)
{
if (i <= MAX_FLAGS_OFFSET)
@@ -222,13 +222,13 @@ BOOL SvtSearchOptions_Impl::Load()
else
{
OSL_FAIL( "unexpected type" );
- bSucc = FALSE;
+ bSucc = sal_False;
}
}
else
{
OSL_FAIL( "value missing" );
- bSucc = FALSE;
+ bSucc = sal_False;
}
}
}
@@ -238,12 +238,12 @@ BOOL SvtSearchOptions_Impl::Load()
}
-BOOL SvtSearchOptions_Impl::Save()
+sal_Bool SvtSearchOptions_Impl::Save()
{
- BOOL bSucc = FALSE;
+ sal_Bool bSucc = sal_False;
const Sequence< OUString > aNames = GetPropertyNames();
- INT32 nProps = aNames.getLength();
+ sal_Int32 nProps = aNames.getLength();
Sequence< Any > aValues( nProps );
Any *pValue = aValues.getArray();
@@ -252,13 +252,13 @@ BOOL SvtSearchOptions_Impl::Save()
"unexpected size of index" );
if (nProps && nProps == MAX_FLAGS_OFFSET + 1)
{
- for (USHORT i = 0; i < nProps; ++i)
- pValue[i] <<= (BOOL) GetFlag(i);
+ for (sal_uInt16 i = 0; i < nProps; ++i)
+ pValue[i] <<= (sal_Bool) GetFlag(i);
bSucc |= PutProperties( aNames, aValues );
}
if (bSucc)
- SetModified( FALSE );
+ SetModified( sal_False );
return bSucc;
}
@@ -278,9 +278,9 @@ SvtSearchOptions::~SvtSearchOptions()
}
-INT32 SvtSearchOptions::GetTransliterationFlags() const
+sal_Int32 SvtSearchOptions::GetTransliterationFlags() const
{
- INT32 nRes = 0;
+ sal_Int32 nRes = 0;
if (!IsMatchCase()) // 'IsMatchCase' means act case sensitive
nRes |= TransliterationModules_IGNORE_CASE;
@@ -325,312 +325,312 @@ INT32 SvtSearchOptions::GetTransliterationFlags() const
}
-BOOL SvtSearchOptions::IsWholeWordsOnly() const
+sal_Bool SvtSearchOptions::IsWholeWordsOnly() const
{
return pImpl->GetFlag( 0 );
}
-void SvtSearchOptions::SetWholeWordsOnly( BOOL bVal )
+void SvtSearchOptions::SetWholeWordsOnly( sal_Bool bVal )
{
pImpl->SetFlag( 0, bVal );
}
-BOOL SvtSearchOptions::IsBackwards() const
+sal_Bool SvtSearchOptions::IsBackwards() const
{
return pImpl->GetFlag( 1 );
}
-void SvtSearchOptions::SetBackwards( BOOL bVal )
+void SvtSearchOptions::SetBackwards( sal_Bool bVal )
{
pImpl->SetFlag( 1, bVal );
}
-BOOL SvtSearchOptions::IsUseRegularExpression() const
+sal_Bool SvtSearchOptions::IsUseRegularExpression() const
{
return pImpl->GetFlag( 2 );
}
-void SvtSearchOptions::SetUseRegularExpression( BOOL bVal )
+void SvtSearchOptions::SetUseRegularExpression( sal_Bool bVal )
{
pImpl->SetFlag( 2, bVal );
}
-BOOL SvtSearchOptions::IsSearchForStyles() const
+sal_Bool SvtSearchOptions::IsSearchForStyles() const
{
return pImpl->GetFlag( 3 );
}
-void SvtSearchOptions::SetSearchForStyles( BOOL bVal )
+void SvtSearchOptions::SetSearchForStyles( sal_Bool bVal )
{
pImpl->SetFlag( 3, bVal );
}
-BOOL SvtSearchOptions::IsSimilaritySearch() const
+sal_Bool SvtSearchOptions::IsSimilaritySearch() const
{
return pImpl->GetFlag( 4 );
}
-void SvtSearchOptions::SetSimilaritySearch( BOOL bVal )
+void SvtSearchOptions::SetSimilaritySearch( sal_Bool bVal )
{
pImpl->SetFlag( 4, bVal );
}
-BOOL SvtSearchOptions::IsUseAsianOptions() const
+sal_Bool SvtSearchOptions::IsUseAsianOptions() const
{
return pImpl->GetFlag( 5 );
}
-void SvtSearchOptions::SetUseAsianOptions( BOOL bVal )
+void SvtSearchOptions::SetUseAsianOptions( sal_Bool bVal )
{
pImpl->SetFlag( 5, bVal );
}
-BOOL SvtSearchOptions::IsMatchCase() const
+sal_Bool SvtSearchOptions::IsMatchCase() const
{
return pImpl->GetFlag( 6 );
}
-void SvtSearchOptions::SetMatchCase( BOOL bVal )
+void SvtSearchOptions::SetMatchCase( sal_Bool bVal )
{
pImpl->SetFlag( 6, bVal );
}
-BOOL SvtSearchOptions::IsMatchFullHalfWidthForms() const
+sal_Bool SvtSearchOptions::IsMatchFullHalfWidthForms() const
{
return pImpl->GetFlag( 7 );
}
-void SvtSearchOptions::SetMatchFullHalfWidthForms( BOOL bVal )
+void SvtSearchOptions::SetMatchFullHalfWidthForms( sal_Bool bVal )
{
pImpl->SetFlag( 7, bVal );
}
-BOOL SvtSearchOptions::IsMatchHiraganaKatakana() const
+sal_Bool SvtSearchOptions::IsMatchHiraganaKatakana() const
{
return pImpl->GetFlag( 8 );
}
-void SvtSearchOptions::SetMatchHiraganaKatakana( BOOL bVal )
+void SvtSearchOptions::SetMatchHiraganaKatakana( sal_Bool bVal )
{
pImpl->SetFlag( 8, bVal );
}
-BOOL SvtSearchOptions::IsMatchContractions() const
+sal_Bool SvtSearchOptions::IsMatchContractions() const
{
return pImpl->GetFlag( 9 );
}
-void SvtSearchOptions::SetMatchContractions( BOOL bVal )
+void SvtSearchOptions::SetMatchContractions( sal_Bool bVal )
{
pImpl->SetFlag( 9, bVal );
}
-BOOL SvtSearchOptions::IsMatchMinusDashChoon() const
+sal_Bool SvtSearchOptions::IsMatchMinusDashChoon() const
{
return pImpl->GetFlag( 10 );
}
-void SvtSearchOptions::SetMatchMinusDashChoon( BOOL bVal )
+void SvtSearchOptions::SetMatchMinusDashChoon( sal_Bool bVal )
{
pImpl->SetFlag( 10, bVal );
}
-BOOL SvtSearchOptions::IsMatchRepeatCharMarks() const
+sal_Bool SvtSearchOptions::IsMatchRepeatCharMarks() const
{
return pImpl->GetFlag( 11 );
}
-void SvtSearchOptions::SetMatchRepeatCharMarks( BOOL bVal )
+void SvtSearchOptions::SetMatchRepeatCharMarks( sal_Bool bVal )
{
pImpl->SetFlag( 11, bVal );
}
-BOOL SvtSearchOptions::IsMatchVariantFormKanji() const
+sal_Bool SvtSearchOptions::IsMatchVariantFormKanji() const
{
return pImpl->GetFlag( 12 );
}
-void SvtSearchOptions::SetMatchVariantFormKanji( BOOL bVal )
+void SvtSearchOptions::SetMatchVariantFormKanji( sal_Bool bVal )
{
pImpl->SetFlag( 12, bVal );
}
-BOOL SvtSearchOptions::IsMatchOldKanaForms() const
+sal_Bool SvtSearchOptions::IsMatchOldKanaForms() const
{
return pImpl->GetFlag( 13 );
}
-void SvtSearchOptions::SetMatchOldKanaForms( BOOL bVal )
+void SvtSearchOptions::SetMatchOldKanaForms( sal_Bool bVal )
{
pImpl->SetFlag( 13, bVal );
}
-BOOL SvtSearchOptions::IsMatchDiziDuzu() const
+sal_Bool SvtSearchOptions::IsMatchDiziDuzu() const
{
return pImpl->GetFlag( 14 );
}
-void SvtSearchOptions::SetMatchDiziDuzu( BOOL bVal )
+void SvtSearchOptions::SetMatchDiziDuzu( sal_Bool bVal )
{
pImpl->SetFlag( 14, bVal );
}
-BOOL SvtSearchOptions::IsMatchBavaHafa() const
+sal_Bool SvtSearchOptions::IsMatchBavaHafa() const
{
return pImpl->GetFlag( 15 );
}
-void SvtSearchOptions::SetMatchBavaHafa( BOOL bVal )
+void SvtSearchOptions::SetMatchBavaHafa( sal_Bool bVal )
{
pImpl->SetFlag( 15, bVal );
}
-BOOL SvtSearchOptions::IsMatchTsithichiDhizi() const
+sal_Bool SvtSearchOptions::IsMatchTsithichiDhizi() const
{
return pImpl->GetFlag( 16 );
}
-void SvtSearchOptions::SetMatchTsithichiDhizi( BOOL bVal )
+void SvtSearchOptions::SetMatchTsithichiDhizi( sal_Bool bVal )
{
pImpl->SetFlag( 16, bVal );
}
-BOOL SvtSearchOptions::IsMatchHyuiyuByuvyu() const
+sal_Bool SvtSearchOptions::IsMatchHyuiyuByuvyu() const
{
return pImpl->GetFlag( 17 );
}
-void SvtSearchOptions::SetMatchHyuiyuByuvyu( BOOL bVal )
+void SvtSearchOptions::SetMatchHyuiyuByuvyu( sal_Bool bVal )
{
pImpl->SetFlag( 17, bVal );
}
-BOOL SvtSearchOptions::IsMatchSesheZeje() const
+sal_Bool SvtSearchOptions::IsMatchSesheZeje() const
{
return pImpl->GetFlag( 18 );
}
-void SvtSearchOptions::SetMatchSesheZeje( BOOL bVal )
+void SvtSearchOptions::SetMatchSesheZeje( sal_Bool bVal )
{
pImpl->SetFlag( 18, bVal );
}
-BOOL SvtSearchOptions::IsMatchIaiya() const
+sal_Bool SvtSearchOptions::IsMatchIaiya() const
{
return pImpl->GetFlag( 19 );
}
-void SvtSearchOptions::SetMatchIaiya( BOOL bVal )
+void SvtSearchOptions::SetMatchIaiya( sal_Bool bVal )
{
pImpl->SetFlag( 19, bVal );
}
-BOOL SvtSearchOptions::IsMatchKiku() const
+sal_Bool SvtSearchOptions::IsMatchKiku() const
{
return pImpl->GetFlag( 20 );
}
-void SvtSearchOptions::SetMatchKiku( BOOL bVal )
+void SvtSearchOptions::SetMatchKiku( sal_Bool bVal )
{
pImpl->SetFlag( 20, bVal );
}
-BOOL SvtSearchOptions::IsIgnorePunctuation() const
+sal_Bool SvtSearchOptions::IsIgnorePunctuation() const
{
return pImpl->GetFlag( 21 );
}
-void SvtSearchOptions::SetIgnorePunctuation( BOOL bVal )
+void SvtSearchOptions::SetIgnorePunctuation( sal_Bool bVal )
{
pImpl->SetFlag( 21, bVal );
}
-BOOL SvtSearchOptions::IsIgnoreWhitespace() const
+sal_Bool SvtSearchOptions::IsIgnoreWhitespace() const
{
return pImpl->GetFlag( 22 );
}
-void SvtSearchOptions::SetIgnoreWhitespace( BOOL bVal )
+void SvtSearchOptions::SetIgnoreWhitespace( sal_Bool bVal )
{
pImpl->SetFlag( 22, bVal );
}
-BOOL SvtSearchOptions::IsIgnoreProlongedSoundMark() const
+sal_Bool SvtSearchOptions::IsIgnoreProlongedSoundMark() const
{
return pImpl->GetFlag( 23 );
}
-void SvtSearchOptions::SetIgnoreProlongedSoundMark( BOOL bVal )
+void SvtSearchOptions::SetIgnoreProlongedSoundMark( sal_Bool bVal )
{
pImpl->SetFlag( 23, bVal );
}
-BOOL SvtSearchOptions::IsIgnoreMiddleDot() const
+sal_Bool SvtSearchOptions::IsIgnoreMiddleDot() const
{
return pImpl->GetFlag( 24 );
}
-void SvtSearchOptions::SetIgnoreMiddleDot( BOOL bVal )
+void SvtSearchOptions::SetIgnoreMiddleDot( sal_Bool bVal )
{
pImpl->SetFlag( 24, bVal );
}
-BOOL SvtSearchOptions::IsNotes() const
+sal_Bool SvtSearchOptions::IsNotes() const
{
return pImpl->GetFlag( 25 );
}
-void SvtSearchOptions::SetNotes( BOOL bVal )
+void SvtSearchOptions::SetNotes( sal_Bool bVal )
{
pImpl->SetFlag( 25, bVal );
}
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index 4e8dedc25db3..2b6f4f2cdc1b 100644..100755
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -89,7 +89,7 @@ class SvtSysLocaleOptions_Impl : public utl::ConfigItem
OUString m_aLocaleString; // en-US or de-DE or empty for SYSTEM
OUString m_aUILocaleString; // en-US or de-DE or empty for SYSTEM
OUString m_aCurrencyString; // USD-en-US or EUR-de-DE
- ULONG m_nBlockedHint; // pending hints
+ sal_uLong m_nBlockedHint; // pending hints
sal_Bool m_bDecimalSeparator; //use decimal separator same as locale
sal_Bool m_bROLocale;
@@ -387,7 +387,7 @@ void SvtSysLocaleOptions_Impl::SetLocaleString( const OUString& rStr )
MakeRealLocale();
MsLangId::setConfiguredSystemLanguage( m_eRealLanguage );
SetModified();
- ULONG nHint = SYSLOCALEOPTIONS_HINT_LOCALE;
+ sal_uLong nHint = SYSLOCALEOPTIONS_HINT_LOCALE;
if ( !m_aCurrencyString.getLength() )
nHint |= SYSLOCALEOPTIONS_HINT_CURRENCY;
NotifyListeners( nHint );
@@ -431,7 +431,7 @@ void SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale( sal_Bool bSet)
void SvtSysLocaleOptions_Impl::Notify( const Sequence< rtl::OUString >& seqPropertyNames )
{
- ULONG nHint = 0;
+ sal_uLong nHint = 0;
Sequence< Any > seqValues = GetProperties( seqPropertyNames );
Sequence< sal_Bool > seqROStates = GetReadOnlyStates( seqPropertyNames );
sal_Int32 nCount = seqPropertyNames.getLength();
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index f02795bd9a60..ee88691535a2 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -128,8 +128,8 @@ public:
void SetFathersName( const ::rtl::OUString& rNewToken );
void SetApartment( const ::rtl::OUString& rNewToken );
- sal_Bool IsTokenReadonly( USHORT nToken ) const;
- ::rtl::OUString GetToken(USHORT nToken) const;
+ sal_Bool IsTokenReadonly( sal_uInt16 nToken ) const;
+ ::rtl::OUString GetToken(sal_uInt16 nToken) const;
void Notify();
private:
@@ -802,7 +802,7 @@ void SvtUserOptions_Impl::Notify()
// -----------------------------------------------------------------------
-sal_Bool SvtUserOptions_Impl::IsTokenReadonly( USHORT nToken ) const
+sal_Bool SvtUserOptions_Impl::IsTokenReadonly( sal_uInt16 nToken ) const
{
css::uno::Reference< css::beans::XPropertySet > xData(m_xCfg, css::uno::UNO_QUERY);
css::uno::Reference< css::beans::XPropertySetInfo > xInfo = xData->getPropertySetInfo();
@@ -921,7 +921,7 @@ sal_Bool SvtUserOptions_Impl::IsTokenReadonly( USHORT nToken ) const
}
//------------------------------------------------------------------------
-::rtl::OUString SvtUserOptions_Impl::GetToken(USHORT nToken) const
+::rtl::OUString SvtUserOptions_Impl::GetToken(sal_uInt16 nToken) const
{
::rtl::OUString pRet;
switch(nToken)
@@ -1312,13 +1312,13 @@ void SvtUserOptions::SetApartment( const ::rtl::OUString& rNewToken )
// -----------------------------------------------------------------------
-sal_Bool SvtUserOptions::IsTokenReadonly( USHORT nToken ) const
+sal_Bool SvtUserOptions::IsTokenReadonly( sal_uInt16 nToken ) const
{
::osl::MutexGuard aGuard( GetInitMutex() );
return pImp->IsTokenReadonly( nToken );
}
//------------------------------------------------------------------------
-::rtl::OUString SvtUserOptions::GetToken(USHORT nToken) const
+::rtl::OUString SvtUserOptions::GetToken(sal_uInt16 nToken) const
{
::osl::MutexGuard aGuard( GetInitMutex() );
return pImp->GetToken( nToken );
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index c2c46b47afb6..f622b8d893a4 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -781,7 +781,7 @@ css::uno::Reference< css::uno::XInterface > SvtViewOptionsBase_Impl::impl_getSet
xNode = ::comphelper::ConfigurationHelper::makeSureSetNodeExists(m_xRoot, m_sListName, sNode);
else
{
- if (m_xSet.is())
+ if (m_xSet.is() && m_xSet->hasByName(sNode) )
m_xSet->getByName(sNode) >>= xNode;
}
}
diff --git a/unotools/source/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx
index ccf039c7f63d..f98d6828efb3 100644
--- a/unotools/source/i18n/intlwrapper.cxx
+++ b/unotools/source/i18n/intlwrapper.cxx
@@ -95,7 +95,7 @@ void IntlWrapper::ImplNewCalendar() const
}
-void IntlWrapper::ImplNewCollator( BOOL bCaseSensitive ) const
+void IntlWrapper::ImplNewCollator( sal_Bool bCaseSensitive ) const
{
CollatorWrapper* p = new CollatorWrapper( xSMgr );
if ( bCaseSensitive )
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 1c4856f07c67..656453dde274 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -57,8 +57,8 @@
#define LOCALEDATA_SERVICENAME "com.sun.star.i18n.LocaleData"
static const int nDateFormatInvalid = -1;
-static const USHORT nCurrFormatInvalid = 0xffff;
-static const USHORT nCurrFormatDefault = 0;
+static const sal_uInt16 nCurrFormatInvalid = 0xffff;
+static const sal_uInt16 nCurrFormatDefault = 0;
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
@@ -77,7 +77,7 @@ namespace
{};
}
-BYTE LocaleDataWrapper::nLocaleDataChecking = 0;
+sal_uInt8 LocaleDataWrapper::nLocaleDataChecking = 0;
LocaleDataWrapper::LocaleDataWrapper(
const Reference< lang::XMultiServiceFactory > & xSF,
@@ -85,8 +85,8 @@ LocaleDataWrapper::LocaleDataWrapper(
)
:
xSMgr( xSF ),
- bLocaleDataItemValid( FALSE ),
- bReservedWordValid( FALSE )
+ bLocaleDataItemValid( sal_False ),
+ bReservedWordValid( sal_False )
{
setLocale( rLocale );
if ( xSMgr.is() )
@@ -168,7 +168,7 @@ void LocaleDataWrapper::invalidateData()
{
aLocaleItem[j].Erase();
}
- bLocaleDataItemValid = FALSE;
+ bLocaleDataItemValid = sal_False;
}
if ( bReservedWordValid )
{
@@ -176,7 +176,7 @@ void LocaleDataWrapper::invalidateData()
{
aReservedWord[j].Erase();
}
- bReservedWordValid = FALSE;
+ bReservedWordValid = sal_False;
}
xDefaultCalendar.reset();
if (aGrouping.getLength())
@@ -544,7 +544,7 @@ void LocaleDataWrapper::getOneLocaleItemImpl( sal_Int16 nItem )
if ( !bLocaleDataItemValid )
{
aLocaleDataItem = getLocaleItem();
- bLocaleDataItemValid = TRUE;
+ bLocaleDataItemValid = sal_True;
}
switch ( nItem )
{
@@ -610,7 +610,7 @@ void LocaleDataWrapper::getOneReservedWordImpl( sal_Int16 nWord )
if ( !bReservedWordValid )
{
aReservedWordSeq = getReservedWord();
- bReservedWordValid = TRUE;
+ bReservedWordValid = sal_True;
}
DBG_ASSERT( nWord < aReservedWordSeq.getLength(), "getOneReservedWordImpl: which one?" );
if ( nWord < aReservedWordSeq.getLength() )
@@ -719,7 +719,7 @@ const String& LocaleDataWrapper::getCurrBankSymbol() const
}
-USHORT LocaleDataWrapper::getCurrPositiveFormat() const
+sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat() const
{
::utl::ReadWriteGuard aGuard( aMutex );
if ( nCurrPositiveFormat == nCurrFormatInvalid )
@@ -731,7 +731,7 @@ USHORT LocaleDataWrapper::getCurrPositiveFormat() const
}
-USHORT LocaleDataWrapper::getCurrNegativeFormat() const
+sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat() const
{
::utl::ReadWriteGuard aGuard( aMutex );
if ( nCurrNegativeFormat == nCurrFormatInvalid )
@@ -743,7 +743,7 @@ USHORT LocaleDataWrapper::getCurrNegativeFormat() const
}
-USHORT LocaleDataWrapper::getCurrDigits() const
+sal_uInt16 LocaleDataWrapper::getCurrDigits() const
{
::utl::ReadWriteGuard aGuard( aMutex );
if ( nCurrDigits == nCurrFormatInvalid )
@@ -802,13 +802,13 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
const sal_Unicode* const pStop = pStr + rCode.Len();
const sal_Unicode* p = pStr + nStart;
int nInSection = 0;
- BOOL bQuote = FALSE;
+ sal_Bool bQuote = sal_False;
while ( p < pStop )
{
if ( bQuote )
{
if ( *p == '"' && *(p-1) != '\\' )
- bQuote = FALSE;
+ bQuote = sal_False;
}
else
{
@@ -816,7 +816,7 @@ void LocaleDataWrapper::scanCurrFormatImpl( const String& rCode,
{
case '"' :
if ( pStr == p || *(p-1) != '\\' )
- bQuote = TRUE;
+ bQuote = sal_True;
break;
case '-' :
if ( !nInSection && nSign == STRING_NOTFOUND )
@@ -1335,7 +1335,7 @@ static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, sal_uInt64 nNumber, int nMin
}
-static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, USHORT nNumber, int bLeading )
+static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, int bLeading )
{
DBG_ASSERT( nNumber < 100, "ImplAdd2UNum() - Number >= 100" );
@@ -1350,7 +1350,7 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, USHORT nNumber, int bLeadin
}
else
{
- USHORT nTemp = nNumber % 10;
+ sal_uInt16 nTemp = nNumber % 10;
nNumber /= 10;
*pBuf = nNumber + '0';
pBuf++;
@@ -1393,13 +1393,13 @@ inline sal_Unicode* ImplAddString( sal_Unicode* pBuf, const sal_Unicode* pCopyBu
sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
- sal_Int64 nNumber, USHORT nDecimals, BOOL bUseThousandSep,
- BOOL bTrailingZeros ) const
+ sal_Int64 nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep,
+ sal_Bool bTrailingZeros ) const
{
sal_Unicode aNumBuf[64];
sal_Unicode* pNumBuf;
- USHORT nNumLen;
- USHORT i = 0;
+ sal_uInt16 nNumLen;
+ sal_uInt16 i = 0;
// negative number
if ( nNumber < 0 )
@@ -1411,7 +1411,7 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
// convert number
pNumBuf = ImplAddUNum( aNumBuf, (sal_uInt64)nNumber );
- nNumLen = (USHORT)(ULONG)(pNumBuf-aNumBuf);
+ nNumLen = (sal_uInt16)(sal_uLong)(pNumBuf-aNumBuf);
pNumBuf = aNumBuf;
if ( nNumLen <= nDecimals )
@@ -1457,7 +1457,7 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
const String& rThoSep = getNumThousandSep();
// copy number to buffer (excluding decimals)
- USHORT nNumLen2 = nNumLen-nDecimals;
+ sal_uInt16 nNumLen2 = nNumLen-nDecimals;
uno::Sequence< sal_Bool > aGroupPos;
if (bUseThousandSep)
aGroupPos = utl::DigitGroupingIterator::createForwardSequence(
@@ -1478,11 +1478,11 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
{
pBuf = ImplAddString( pBuf, getNumDecimalSep() );
- BOOL bNullEnd = TRUE;
+ sal_Bool bNullEnd = sal_True;
while ( i < nNumLen )
{
if ( *pNumBuf != '0' )
- bNullEnd = FALSE;
+ bNullEnd = sal_False;
*pBuf = *pNumBuf;
pBuf++;
@@ -1508,12 +1508,12 @@ String LocaleDataWrapper::getDate( const Date& rDate ) const
//!TODO: leading zeros et al
sal_Unicode aBuf[128];
sal_Unicode* pBuf = aBuf;
- USHORT nDay = rDate.GetDay();
- USHORT nMonth = rDate.GetMonth();
- USHORT nYear = rDate.GetYear();
- USHORT nYearLen;
+ sal_uInt16 nDay = rDate.GetDay();
+ sal_uInt16 nMonth = rDate.GetMonth();
+ sal_uInt16 nYear = rDate.GetYear();
+ sal_uInt16 nYearLen;
- if ( TRUE /* IsDateCentury() */ )
+ if ( sal_True /* IsDateCentury() */ )
nYearLen = 4;
else
{
@@ -1524,39 +1524,39 @@ String LocaleDataWrapper::getDate( const Date& rDate ) const
switch ( getDateFormat() )
{
case DMY :
- pBuf = ImplAdd2UNum( pBuf, nDay, TRUE /* IsDateDayLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nDay, sal_True /* IsDateDayLeadingZero() */ );
pBuf = ImplAddString( pBuf, getDateSep() );
- pBuf = ImplAdd2UNum( pBuf, nMonth, TRUE /* IsDateMonthLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nMonth, sal_True /* IsDateMonthLeadingZero() */ );
pBuf = ImplAddString( pBuf, getDateSep() );
pBuf = ImplAddUNum( pBuf, nYear, nYearLen );
break;
case MDY :
- pBuf = ImplAdd2UNum( pBuf, nMonth, TRUE /* IsDateMonthLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nMonth, sal_True /* IsDateMonthLeadingZero() */ );
pBuf = ImplAddString( pBuf, getDateSep() );
- pBuf = ImplAdd2UNum( pBuf, nDay, TRUE /* IsDateDayLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nDay, sal_True /* IsDateDayLeadingZero() */ );
pBuf = ImplAddString( pBuf, getDateSep() );
pBuf = ImplAddUNum( pBuf, nYear, nYearLen );
break;
default:
pBuf = ImplAddUNum( pBuf, nYear, nYearLen );
pBuf = ImplAddString( pBuf, getDateSep() );
- pBuf = ImplAdd2UNum( pBuf, nMonth, TRUE /* IsDateMonthLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nMonth, sal_True /* IsDateMonthLeadingZero() */ );
pBuf = ImplAddString( pBuf, getDateSep() );
- pBuf = ImplAdd2UNum( pBuf, nDay, TRUE /* IsDateDayLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nDay, sal_True /* IsDateDayLeadingZero() */ );
}
- return String( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
}
-String LocaleDataWrapper::getTime( const Time& rTime, BOOL bSec, BOOL b100Sec ) const
+String LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
//!TODO: leading zeros et al
sal_Unicode aBuf[128];
sal_Unicode* pBuf = aBuf;
- USHORT nHour = rTime.GetHour();
- BOOL bHour12 = FALSE; //!TODO: AM/PM from default time format code
+ sal_uInt16 nHour = rTime.GetHour();
+ sal_Bool bHour12 = sal_False; //!TODO: AM/PM from default time format code
if ( bHour12 )
{
@@ -1568,22 +1568,22 @@ String LocaleDataWrapper::getTime( const Time& rTime, BOOL bSec, BOOL b100Sec )
else
nHour %= 24;
- pBuf = ImplAdd2UNum( pBuf, nHour, TRUE /* IsTimeLeadingZero() */ );
+ pBuf = ImplAdd2UNum( pBuf, nHour, sal_True /* IsTimeLeadingZero() */ );
pBuf = ImplAddString( pBuf, getTimeSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.GetMin(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.GetMin(), sal_True );
if ( bSec )
{
pBuf = ImplAddString( pBuf, getTimeSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.GetSec(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.GetSec(), sal_True );
if ( b100Sec )
{
pBuf = ImplAddString( pBuf, getTime100SecSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.Get100Sec(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.Get100Sec(), sal_True );
}
}
- String aStr( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ String aStr( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
if ( bHour12 )
{
@@ -1615,7 +1615,7 @@ String LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
// day of month
nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_MONTH );
pBuf = ImplAdd2UNum( aBuf, nVal, bDayOfMonthWithLeadingZero );
- String aDay( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ String aDay( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
// month of year
nVal = rCal.getValue( CalendarFieldIndex::MONTH );
String aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, nDisplayMonth ) );
@@ -1625,7 +1625,7 @@ String LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
pBuf = ImplAddUNum( aBuf, nVal % 100, 2 );
else
pBuf = ImplAddUNum( aBuf, nVal );
- String aYear( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ String aYear( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
// concatenate
switch ( getLongDateFormat() )
{
@@ -1654,7 +1654,7 @@ String LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& rCal,
}
-String LocaleDataWrapper::getDuration( const Time& rTime, BOOL bSec, BOOL b100Sec ) const
+String LocaleDataWrapper::getDuration( const Time& rTime, sal_Bool bSec, sal_Bool b100Sec ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
sal_Unicode aBuf[128];
@@ -1663,31 +1663,31 @@ String LocaleDataWrapper::getDuration( const Time& rTime, BOOL bSec, BOOL b100Se
if ( rTime < Time( 0 ) )
pBuf = ImplAddString( pBuf, ' ' );
- if ( TRUE /* IsTimeLeadingZero() */ )
+ if ( sal_True /* IsTimeLeadingZero() */ )
pBuf = ImplAddUNum( pBuf, rTime.GetHour(), 2 );
else
pBuf = ImplAddUNum( pBuf, rTime.GetHour() );
pBuf = ImplAddString( pBuf, getTimeSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.GetMin(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.GetMin(), sal_True );
if ( bSec )
{
pBuf = ImplAddString( pBuf, getTimeSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.GetSec(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.GetSec(), sal_True );
if ( b100Sec )
{
pBuf = ImplAddString( pBuf, getTime100SecSep() );
- pBuf = ImplAdd2UNum( pBuf, rTime.Get100Sec(), TRUE );
+ pBuf = ImplAdd2UNum( pBuf, rTime.Get100Sec(), sal_True );
}
}
- return String( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
}
// --- simple number formatting ---------------------------------------
-inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, USHORT nDecimals )
+inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, sal_uInt16 nDecimals )
{
// approximately 3.2 bits per digit
const size_t nDig = ((sizeof(sal_Int64) * 8) / 3) + 1;
@@ -1699,8 +1699,8 @@ inline size_t ImplGetNumberStringLengthGuess( const LocaleDataWrapper& rLoc, USH
}
-String LocaleDataWrapper::getNum( sal_Int64 nNumber, USHORT nDecimals,
- BOOL bUseThousandSep, BOOL bTrailingZeros ) const
+String LocaleDataWrapper::getNum( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
sal_Unicode aBuf[128]; // big enough for 64-bit long and crazy grouping
@@ -1711,7 +1711,7 @@ String LocaleDataWrapper::getNum( sal_Int64 nNumber, USHORT nDecimals,
sal_Unicode* pBuf = ImplAddFormatNum( pBuffer, nNumber, nDecimals,
bUseThousandSep, bTrailingZeros );
- String aStr( pBuffer, (xub_StrLen)(ULONG)(pBuf-pBuffer) );
+ String aStr( pBuffer, (xub_StrLen)(sal_uLong)(pBuf-pBuffer) );
if ( pBuffer != aBuf )
delete [] pBuffer;
@@ -1719,8 +1719,8 @@ String LocaleDataWrapper::getNum( sal_Int64 nNumber, USHORT nDecimals,
}
-String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals,
- const String& rCurrencySymbol, BOOL bUseThousandSep ) const
+String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
+ const String& rCurrencySymbol, sal_Bool bUseThousandSep ) const
{
::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical );
sal_Unicode aBuf[192];
@@ -1737,26 +1737,26 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals,
new sal_Unicode[ rCurrencySymbol.Len() + nGuess + 20 ]);
sal_Unicode* pBuf = pBuffer;
- BOOL bNeg;
+ sal_Bool bNeg;
if ( nNumber < 0 )
{
- bNeg = TRUE;
+ bNeg = sal_True;
nNumber *= -1;
}
else
- bNeg = FALSE;
+ bNeg = sal_False;
// convert number
sal_Unicode* pEndNumBuf = ImplAddFormatNum( pNumBuffer, nNumber, nDecimals,
- bUseThousandSep, TRUE );
- xub_StrLen nNumLen = (xub_StrLen)(ULONG)(pEndNumBuf-pNumBuffer);
+ bUseThousandSep, sal_True );
+ xub_StrLen nNumLen = (xub_StrLen)(sal_uLong)(pEndNumBuf-pNumBuffer);
// replace zeros with zero character
if ( (cZeroChar != '0') && nDecimals /* && IsNumTrailingZeros() */ )
{
sal_Unicode* pTempBuf;
- USHORT i;
- BOOL bZero = TRUE;
+ sal_uInt16 i;
+ sal_Bool bZero = sal_True;
pTempBuf = pNumBuffer+nNumLen-nDecimals;
i = 0;
@@ -1764,7 +1764,7 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals,
{
if ( *pTempBuf != '0' )
{
- bZero = FALSE;
+ bZero = sal_False;
break;
}
@@ -1910,7 +1910,7 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, USHORT nDecimals,
}
}
- String aNumber( pBuffer, (xub_StrLen)(ULONG)(pBuf-pBuffer) );
+ String aNumber( pBuffer, (xub_StrLen)(sal_uLong)(pBuf-pBuffer) );
if ( pBuffer != aBuf )
delete [] pBuffer;
@@ -1970,7 +1970,7 @@ void LocaleDataWrapper::evaluateLocaleDataChecking()
// accesses, since we want to assign the result to the static member
// variable and would need to dereference the pointer returned and assign
// the value unguarded. This is the same pattern manually coded.
- BYTE nCheck = nLocaleDataChecking;
+ sal_uInt8 nCheck = nLocaleDataChecking;
if (!nCheck)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex());
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 1c4d2b4b2fd5..abf2ce5af79e 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -49,9 +49,9 @@ namespace utl
SearchParam::SearchParam( const String &rText,
SearchType eType,
- BOOL bCaseSensitive,
- BOOL bWrdOnly,
- BOOL bSearchInSel )
+ sal_Bool bCaseSensitive,
+ sal_Bool bWrdOnly,
+ sal_Bool bSearchInSel )
{
sSrchStr = rText;
eSrchType = eType;
@@ -63,7 +63,7 @@ SearchParam::SearchParam( const String &rText,
nTransliterationFlags = 0;
// Werte fuer "Gewichtete Levenshtein-Distanz"
- bLEV_Relaxed = TRUE;
+ bLEV_Relaxed = sal_True;
nLEV_OtherX = 2;
nLEV_ShorterY = 1;
nLEV_LongerZ = 3;
@@ -304,8 +304,8 @@ void TextSearch::ReplaceBackReferences( String& rReplaceStr, const String &rStr,
{
if( rReplaceStr.GetChar( nPos ) == '&')
{
- USHORT nStart = (USHORT)(rResult.startOffset[0]);
- USHORT nLength = (USHORT)(rResult.endOffset[0] - rResult.startOffset[0]);
+ sal_uInt16 nStart = (sal_uInt16)(rResult.startOffset[0]);
+ sal_uInt16 nLength = (sal_uInt16)(rResult.endOffset[0] - rResult.startOffset[0]);
rReplaceStr.Erase( nPos, 1 ); // delete ampersand
// replace by found string
rReplaceStr.Insert( rStr, nStart, nLength, nPos );
@@ -334,17 +334,17 @@ void TextSearch::ReplaceBackReferences( String& rReplaceStr, const String &rStr,
int i = sFndChar - '0'; // index
if(i < rResult.subRegExpressions)
{
- USHORT nSttReg = (USHORT)(rResult.startOffset[i]);
- USHORT nRegLen = (USHORT)(rResult.endOffset[i]);
+ sal_uInt16 nSttReg = (sal_uInt16)(rResult.startOffset[i]);
+ sal_uInt16 nRegLen = (sal_uInt16)(rResult.endOffset[i]);
if( nRegLen > nSttReg )
nRegLen = nRegLen - nSttReg;
else
{
nRegLen = nSttReg - nRegLen;
- nSttReg = (USHORT)(rResult.endOffset[i]);
+ nSttReg = (sal_uInt16)(rResult.endOffset[i]);
}
// Copy reference from found string
- sTmp = rStr.Copy((USHORT)nSttReg, (USHORT)nRegLen);
+ sTmp = rStr.Copy((sal_uInt16)nSttReg, (sal_uInt16)nRegLen);
// insert
rReplaceStr.Insert( sTmp, nPos );
// and step over
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 95342a0f896b..abeb9cbb6f80 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1378,7 +1378,7 @@ sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const
// from an traditional symbol font (i.e. U+F020..U+F0FF)
void ConvertChar::RecodeString( String& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
- ULONG nLastIndex = (ULONG)nIndex + nLen;
+ sal_uLong nLastIndex = (sal_uLong)nIndex + nLen;
if( nLastIndex > rStr.Len() )
nLastIndex = rStr.Len();
@@ -1462,7 +1462,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const
//=======================================================================
FontToSubsFontConverter CreateFontToSubsFontConverter(
- const String& rOrgName, ULONG nFlags )
+ const String& rOrgName, sal_uLong nFlags )
{
const ConvertChar* pCvt = NULL;
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 58121bd85ed0..ba90cde2cced 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -520,7 +520,7 @@ void AddTokenFontName( String& rName, const String& rNewToken )
// =======================================================================
-String GetSubsFontName( const String& rName, ULONG nFlags )
+String GetSubsFontName( const String& rName, sal_uLong nFlags )
{
String aName;
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx
index e064f2222b20..fc29a63bb1ac 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -182,7 +182,7 @@ void OInputStreamWrapper::checkError() const
//------------------------------------------------------------------------------
OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream& _rStream)
{
- SetStream( &_rStream, FALSE );
+ SetStream( &_rStream, sal_False );
}
//------------------------------------------------------------------------------
@@ -329,7 +329,7 @@ sal_Int64 SAL_CALL OSeekableOutputStreamWrapper::getLength( ) throw (IOExceptio
//------------------------------------------------------------------------------
OStreamWrapper::OStreamWrapper(SvStream& _rStream)
{
- SetStream( &_rStream, FALSE );
+ SetStream( &_rStream, sal_False );
}
//------------------------------------------------------------------------------
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 7a8c1f7e1fb9..b0ceb14b1a57 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -199,19 +199,19 @@ String ConstructTempDir_Impl( const String* pParent )
void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_True )
{
// add a suitable tempname
- // Prefix can have 5 chars, leaving 3 for numbers. 26 ** 3 == 17576
- // ER 13.07.00 why not radix 36 [0-9A-Z] ?!?
- const unsigned nRadix = 26;
+ // 36 ** 6 == 2176782336
+ unsigned const nRadix = 36;
+ unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix);
String aName( rName );
aName += String::CreateFromAscii( "lu" );
rName.Erase();
- static unsigned long u = Time::GetSystemTicks();
- for ( unsigned long nOld = u; ++u != nOld; )
+ unsigned long nSeed = Time::GetSystemTicks() % nMax;
+ for ( unsigned long u = nSeed; ++u != nSeed; )
{
- u %= (nRadix*nRadix*nRadix);
+ u %= nMax;
String aTmp( aName );
- aTmp += String::CreateFromInt32( (sal_Int32) (unsigned) u, nRadix );
+ aTmp += String::CreateFromInt64( static_cast<sal_Int64>(u), nRadix );
aTmp += String::CreateFromAscii( ".tmp" );
if ( bDir )
@@ -243,7 +243,7 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
#ifdef UNX /* RW permission for the user only! */
mode_t old_mode = umask(077);
#endif
- FileBase::RC err = aFile.open(osl_File_OpenFlag_Create);
+ FileBase::RC err = aFile.open( osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock );
#ifdef UNX
umask(old_mode);
#endif
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index 789fe3f6bebb..76fc443fb8ae 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -629,9 +629,9 @@ sal_Bool UCBContentHelper::HasParentFolder( const String& rFolder )
// -----------------------------------------------------------------------
-ULONG UCBContentHelper::GetSize( const String& rContent )
+sal_uLong UCBContentHelper::GetSize( const String& rContent )
{
- ULONG nSize = 0;
+ sal_uLong nSize = 0;
sal_Int64 nTemp = 0;
INetURLObject aObj( rContent );
DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
@@ -646,7 +646,7 @@ ULONG UCBContentHelper::GetSize( const String& rContent )
catch( ::com::sun::star::uno::Exception& )
{
}
- nSize = (UINT32)nTemp;
+ nSize = (sal_uInt32)nTemp;
return nSize;
}
@@ -682,9 +682,9 @@ sal_Bool UCBContentHelper::IsYounger( const String& rIsYoung, const String& rIsO
}
// -----------------------------------------------------------------------
-sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards )
+sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, String& rFile, sal_Bool bAllowWildCards )
{
- BOOL bWild = bAllowWildCards && ( rName.Search( '*' ) != STRING_NOTFOUND || rName.Search( '?' ) != STRING_NOTFOUND );
+ sal_Bool bWild = bAllowWildCards && ( rName.Search( '*' ) != STRING_NOTFOUND || rName.Search( '?' ) != STRING_NOTFOUND );
sal_Bool bRet = sal_False;
@@ -692,7 +692,7 @@ sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, Str
Sequence< ::rtl::OUString > aFiles = GetFolderContents( rFolder, sal_False );
const ::rtl::OUString* pFiles = aFiles.getConstArray();
- UINT32 i, nCount = aFiles.getLength();
+ sal_uInt32 i, nCount = aFiles.getLength();
for ( i = 0; i < nCount; ++i )
{
// get the last name of the URLs and compare it with rName
@@ -743,7 +743,7 @@ sal_Bool UCBContentHelper::Exists( const String& rURL )
Sequence< ::rtl::OUString > aFiles = GetFolderContents( aObj.GetMainURL( INetURLObject::NO_DECODE ), sal_True, sal_False );
const ::rtl::OUString* pFiles = aFiles.getConstArray();
- UINT32 i, nCount = aFiles.getLength();
+ sal_uInt32 i, nCount = aFiles.getLength();
for ( i = 0; i < nCount; ++i )
{
// get the last name of the URLs and compare it with rName
@@ -762,18 +762,18 @@ sal_Bool UCBContentHelper::Exists( const String& rURL )
}
// -----------------------------------------------------------------------
-sal_Bool UCBContentHelper::FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim, BOOL bAllowWildCards )
+sal_Bool UCBContentHelper::FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim, sal_Bool bAllowWildCards )
{
// extract the single folder names from the path variable and try to find the file in one of these folders
- USHORT nTokenCount = rPath.GetTokenCount( cDelim );
- for ( USHORT nToken = 0; nToken < nTokenCount; ++nToken )
+ sal_uInt16 nTokenCount = rPath.GetTokenCount( cDelim );
+ for ( sal_uInt16 nToken = 0; nToken < nTokenCount; ++nToken )
{
String aPath = rPath.GetToken( nToken, cDelim );
if ( Find( aPath, rName, rFile, bAllowWildCards ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index ac97a15f4b24..c95608c3faaf 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -1248,7 +1248,7 @@ UcbLockBytes::UcbLockBytes( UcbLockBytesHandler* pHandler )
, m_bDontClose( sal_False )
, m_bStreamValid (sal_False)
{
- SetSynchronMode( TRUE );
+ SetSynchronMode( sal_True );
}
//----------------------------------------------------------------------------
@@ -1386,13 +1386,13 @@ void UcbLockBytes::terminate_Impl()
}
//----------------------------------------------------------------------------
-void UcbLockBytes::SetSynchronMode (BOOL bSynchron)
+void UcbLockBytes::SetSynchronMode (sal_Bool bSynchron)
{
SvLockBytes::SetSynchronMode (bSynchron);
}
//----------------------------------------------------------------------------
-ErrCode UcbLockBytes::ReadAt ( ULONG nPos, void *pBuffer, ULONG nCount, ULONG *pRead) const
+ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const
{
if ( IsSynchronMode() )
{
@@ -1451,13 +1451,13 @@ ErrCode UcbLockBytes::ReadAt ( ULONG nPos, void *pBuffer, ULONG nCount, ULONG *p
rtl_copyMemory (pBuffer, aData.getConstArray(), nSize);
if (pRead)
- *pRead = ULONG(nSize);
+ *pRead = sal_uLong(nSize);
return ERRCODE_NONE;
}
//----------------------------------------------------------------------------
-ErrCode UcbLockBytes::WriteAt ( ULONG nPos, const void *pBuffer, ULONG nCount, ULONG *pWritten)
+ErrCode UcbLockBytes::WriteAt ( sal_uLong nPos, const void *pBuffer, sal_uLong nCount, sal_uLong *pWritten)
{
if ( pWritten )
*pWritten = 0;
@@ -1501,16 +1501,25 @@ ErrCode UcbLockBytes::Flush() const
Reference <XOutputStream > xOutputStream = getOutputStream_Impl();
if ( !xOutputStream.is() )
return ERRCODE_IO_CANTWRITE;
- xOutputStream->flush();
+
+ try
+ {
+ xOutputStream->flush();
+ }
+ catch( Exception )
+ {
+ return ERRCODE_IO_CANTWRITE;
+ }
+
return ERRCODE_NONE;
}
//----------------------------------------------------------------------------
-ErrCode UcbLockBytes::SetSize (ULONG nNewSize)
+ErrCode UcbLockBytes::SetSize (sal_uLong nNewSize)
{
SvLockBytesStat aStat;
Stat( &aStat, (SvLockBytesStatFlag) 0 );
- ULONG nSize = aStat.nSize;
+ sal_uLong nSize = aStat.nSize;
if ( nSize > nNewSize )
{
@@ -1527,8 +1536,8 @@ ErrCode UcbLockBytes::SetSize (ULONG nNewSize)
if ( nSize < nNewSize )
{
- ULONG nDiff = nNewSize-nSize, nCount=0;
- BYTE* pBuffer = new BYTE[ nDiff ];
+ sal_uLong nDiff = nNewSize-nSize, nCount=0;
+ sal_uInt8* pBuffer = new sal_uInt8[ nDiff ];
memset(pBuffer, 0, nDiff); // initialize for enhanced security
WriteAt( nSize, pBuffer, nDiff, &nCount );
delete[] pBuffer;
@@ -1566,7 +1575,7 @@ ErrCode UcbLockBytes::Stat( SvLockBytesStat *pStat, SvLockBytesStatFlag) const
try
{
- pStat->nSize = ULONG(xSeekable->getLength());
+ pStat->nSize = sal_uLong(xSeekable->getLength());
}
catch (IOException)
{
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index cbe09fcd7a0f..7883a3e85cb2 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -29,8 +29,6 @@
#include <XTempFile.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <unotools/tempfile.hxx>
#include <osl/file.hxx>
#include <unotools/configmgr.hxx>
@@ -486,43 +484,6 @@ throw ( ::css::uno::RuntimeException )
return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() );
}
-static sal_Bool writeInfo( void * pRegistryKey,
- const ::rtl::OUString & rImplementationName,
- ::css::uno::Sequence< ::rtl::OUString > const & rServiceNames )
-{
- ::rtl::OUString aKeyName( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/UNO/SERVICES" ) );
-
- ::css::uno::Reference< ::css::registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< ::css::registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( ::css::registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( ::css::registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
// C functions to implement this as a component
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
@@ -532,21 +493,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
}
/**
- * This function creates an implementation section in the registry and another subkey
- * for each supported service.
- * @param pServiceManager generic uno interface providing a service manager
- * @param pRegistryKey generic uno interface providing registry key to write
- */
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- return pRegistryKey &&
- writeInfo (pRegistryKey,
- OTempFileService::getImplementationName_Static(),
- OTempFileService::getSupportedServiceNames_Static() );
-}
-
-
-/**
* This function is called to get service factories for an implementation.
* @param pImplName name of implementation
* @param pServiceManager generic uno interface providing a service manager to instantiate components
diff --git a/unotools/util/makefile.mk b/unotools/util/makefile.mk
index 9adb6d1466d1..dffbdf0b6953 100644
--- a/unotools/util/makefile.mk
+++ b/unotools/util/makefile.mk
@@ -93,3 +93,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo UpdateToConfig >> $@
@echo _Impl >> $@
+
+ALLTAR : $(MISC)/utl.component
+
+$(MISC)/utl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ utl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt utl.component
diff --git a/unotools/util/utl.component b/unotools/util/utl.component
new file mode 100644
index 000000000000..8c8198741f55
--- /dev/null
+++ b/unotools/util/utl.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.io.comp.TempFile">
+ <service name="com.sun.star.io.TempFile"/>
+ </implementation>
+</component>
diff --git a/vcl/aqua/inc/aqua11yfactory.h b/vcl/aqua/inc/aqua11yfactory.h
index 15ba372ed320..2fa38d9901db 100644
--- a/vcl/aqua/inc/aqua11yfactory.h
+++ b/vcl/aqua/inc/aqua11yfactory.h
@@ -39,8 +39,8 @@
+(void)insertIntoWrapperRepository: (NSView *) viewElement forAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
+(AquaA11yWrapper *)wrapperForAccessible: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible >) rxAccessible;
+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate;
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup;
++(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate;
++(AquaA11yWrapper *)wrapperForAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup;
+(void)removeFromWrapperRepositoryFor: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
+(void)registerView: (NSView *) theView;
+(void)revokeView: (NSView *) theViewt;
diff --git a/vcl/aqua/inc/aqua11ywrapper.h b/vcl/aqua/inc/aqua11ywrapper.h
index 66faca457622..aebea78f0394 100644
--- a/vcl/aqua/inc/aqua11ywrapper.h
+++ b/vcl/aqua/inc/aqua11ywrapper.h
@@ -63,16 +63,16 @@ struct ReferenceWrapper
ReferenceWrapper * mpReferenceWrapper;
NSString * mpDefaultFontname;
float mDefaultFontsize;
- MacOSBOOL mActsAsRadioGroup;
- MacOSBOOL mIsTableCell;
+ BOOL mActsAsRadioGroup;
+ BOOL mIsTableCell;
}
// NSAccessibility Protocol
-(id)accessibilityAttributeValue:(NSString *)attribute;
--(MacOSBOOL)accessibilityIsIgnored;
+-(BOOL)accessibilityIsIgnored;
-(NSArray *)accessibilityAttributeNames;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityParameterizedAttributeNames;
--(MacOSBOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
+-(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
-(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
-(id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter;
-(id)accessibilityFocusedUIElement;
@@ -93,8 +93,8 @@ struct ReferenceWrapper
-(id)orientationAttribute;
-(id)windowAttribute;
// Wrapper-specific
--(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup;
--(MacOSBOOL)actsAsRadioGroup;
+-(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup;
+-(BOOL)actsAsRadioGroup;
-(NSView *)viewElementForParent;
-(id)initWithAccessibleContext: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) anAccessibleContext;
-(void) setDefaults: (::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >) rxAccessibleContext;
@@ -103,7 +103,7 @@ struct ReferenceWrapper
-(NSString *)defaultFontname;
-(void)setDefaultFontsize:(float)fontsize;
-(float)defaultFontsize;
-+(void)setPopupMenuOpen:(MacOSBOOL)popupMenuOpen;
++(void)setPopupMenuOpen:(BOOL)popupMenuOpen;
-(::com::sun::star::accessibility::XAccessibleAction *)accessibleAction;
-(::com::sun::star::accessibility::XAccessibleContext *)accessibleContext;
-(::com::sun::star::accessibility::XAccessibleComponent *)accessibleComponent;
diff --git a/vcl/aqua/inc/aquaprintview.h b/vcl/aqua/inc/aquaprintview.h
index 5e209bfa6233..2c5849f10e65 100644
--- a/vcl/aqua/inc/aquaprintview.h
+++ b/vcl/aqua/inc/aquaprintview.h
@@ -52,7 +52,7 @@ struct PrintAccessoryViewState
AquaSalInfoPrinter* mpInfoPrinter;
}
-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
--(MacOSBOOL)knowsPageRange: (NSRangePointer)range;
+-(BOOL)knowsPageRange: (NSRangePointer)range;
-(NSRect)rectForPage: (int)page;
-(NSPoint)locationOfPrintRect: (NSRect)aRect;
-(void)drawRect: (NSRect)rect;
diff --git a/vcl/aqua/inc/salbmp.h b/vcl/aqua/inc/salbmp.h
index 818b25d38772..33e671b05735 100644
--- a/vcl/aqua/inc/salbmp.h
+++ b/vcl/aqua/inc/salbmp.h
@@ -71,10 +71,10 @@ public:
public:
// SalBitmap methods
- bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
bool Create( const SalBitmap& rSalBmp );
bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics );
- bool Create( const SalBitmap& rSalBmp, USHORT nNewBitCount );
+ bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -82,7 +82,7 @@ public:
void Destroy();
Size GetSize() const;
- USHORT GetBitCount() const;
+ sal_uInt16 GetBitCount() const;
BitmapBuffer *AcquireBuffer( bool bReadOnly );
void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/aqua/inc/saldata.hxx b/vcl/aqua/inc/saldata.hxx
index ef5adced5506..d87938bd4474 100644
--- a/vcl/aqua/inc/saldata.hxx
+++ b/vcl/aqua/inc/saldata.hxx
@@ -132,7 +132,7 @@ inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData
// --- Prototypes ---
-BOOL ImplSalYieldMutexTryToAcquire();
+sal_Bool ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h
index bd0929829bc1..4025b0aea70a 100644
--- a/vcl/aqua/inc/salframe.h
+++ b/vcl/aqua/inc/salframe.h
@@ -80,10 +80,10 @@ public:
bool mbSized:1;
bool mbPresentation:1;
- ULONG mnStyle;
+ sal_uLong mnStyle;
unsigned int mnStyleMask; // our style mask from NSWindow creation
- ULONG mnLastEventTime;
+ sal_uLong mnLastEventTime;
unsigned int mnLastModifierFlags;
AquaSalMenu* mpMenu;
@@ -100,7 +100,7 @@ public:
Rectangle maInvalidRect;
- ULONG mnICOptions;
+ sal_uLong mnICOptions;
boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation
public:
@@ -110,43 +110,43 @@ public:
@throws std::runtime_error in case window creation fails
*/
- AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle );
+ AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle );
virtual ~AquaSalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
virtual void Flush( void );
virtual void Flush( const Rectangle& );
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -154,7 +154,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetExtendedFrameStyle( SalExtStyle );
@@ -166,7 +166,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 55fbc3bf66c5..1df070829fc7 100644
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -37,7 +37,8 @@
id mDraggingDestinationHandler;
}
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(MacOSBOOL)canBecomeKeyWindow;
+-(BOOL)canBecomeKeyWindow;
+-(void)displayIfNeeded;
-(void)windowDidBecomeKey: (NSNotification*)pNotification;
-(void)windowDidResignKey: (NSNotification*)pNotification;
-(void)windowDidChangeScreen: (NSNotification*)pNotification;
@@ -45,10 +46,10 @@
-(void)windowDidResize: (NSNotification*)pNotification;
-(void)windowDidMiniaturize: (NSNotification*)pNotification;
-(void)windowDidDeminiaturize: (NSNotification*)pNotification;
--(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification;
+-(BOOL)windowShouldClose: (NSNotification*)pNotification;
-(void)dockMenuItemTriggered: (id)sender;
-(AquaSalFrame*)getSalFrame;
--(MacOSBOOL)containsMouse;
+-(BOOL)containsMouse;
-(::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessibleContext >)accessibleContext;
/* NSDraggingDestination protocol methods
@@ -56,8 +57,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
-(void)registerDraggingDestinationHandler:(id)theHandler;
@@ -85,9 +86,9 @@
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
--(MacOSBOOL)acceptsFirstResponder;
--(MacOSBOOL)acceptsFirstMouse: (NSEvent *)pEvent;
--(MacOSBOOL)isOpaque;
+-(BOOL)acceptsFirstResponder;
+-(BOOL)acceptsFirstMouse: (NSEvent *)pEvent;
+-(BOOL)isOpaque;
-(void)drawRect: (NSRect)aRect;
-(void)mouseDown: (NSEvent*)pEvent;
-(void)mouseDragged: (NSEvent*)pEvent;
@@ -107,12 +108,12 @@
-(void)swipeWithEvent: (NSEvent*)pEvent;
-(void)keyDown: (NSEvent*)pEvent;
-(void)flagsChanged: (NSEvent*)pEvent;
--(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent;
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar;
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
--(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
--(MacOSBOOL)sendSingleCharacter:(NSEvent*)pEvent;
--(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent;
+-(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar;
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod;
+-(BOOL)sendSingleCharacter:(NSEvent*)pEvent;
+-(BOOL)handleKeyDownException:(NSEvent*)pEvent;
-(void)clearLastEvent;
/*
text action methods
@@ -201,8 +202,8 @@
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
-(void)registerDraggingDestinationHandler:(id)theHandler;
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 5e4276c725d8..c69f5d70bf96 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -61,7 +61,7 @@ public:
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
virtual sal_IntPtr GetFontId() const;
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
bool HasChar( sal_uInt32 cChar ) const;
@@ -71,7 +71,7 @@ public:
private:
const ATSUFontID mnFontId;
- mutable ImplFontCharMap* mpCharMap;
+ mutable const ImplFontCharMap* mpCharMap;
mutable vcl::FontCapabilities maFontCapabilities;
mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table;
@@ -181,26 +181,25 @@ public:
// InvalidateContext does an UnsetState and sets mrContext to 0
void InvalidateContext();
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags );
+ long nSrcHeight, sal_uInt16 nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -221,9 +220,9 @@ public:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
@@ -232,34 +231,29 @@ public:
virtual bool drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency );
- CGPoint* makeCGptArray(ULONG nPoints, const SalPoint* pPtAry);
+ CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry);
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
// get the width of the device
virtual long GetGraphicsWidth() const;
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
@@ -279,14 +273,14 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
// graphics must fill supplied font list
virtual void GetDevFontList( ImplDevFontList* );
@@ -306,7 +300,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -344,15 +338,15 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
@@ -387,8 +381,8 @@ private:
CGContextRef mxTargetContext;
CGContextRef mxMaskContext;
CGContextRef mxTempContext;
- ULONG* mpMaskBuffer;
- ULONG* mpTempBuffer;
+ sal_uLong* mpMaskBuffer;
+ sal_uLong* mpTempBuffer;
int mnBufferLongs;
bool mbIsEnabled;
};
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index db5b0219f821..9bd65be14ac8 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -50,7 +50,7 @@ class Image;
class SalYieldMutex : public vcl::SolarMutexObject
{
- ULONG mnCount;
+ sal_uLong mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -58,7 +58,7 @@ public:
virtual void acquire();
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uLong GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -84,9 +84,9 @@ class AquaSalInstance : public SalInstance
{
AquaSalFrame* mpFrame;
void* mpData;
- USHORT mnType;
+ sal_uInt16 mnType;
- SalUserEvent( AquaSalFrame* pFrame, void* pData, USHORT nType ) :
+ SalUserEvent( AquaSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
mpFrame( pFrame ), mpData( pData ), mnType( nType )
{}
};
@@ -110,14 +110,14 @@ public:
virtual SalSystem* CreateSystem();
virtual void DestroySystem(SalSystem*);
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -134,11 +134,12 @@ public:
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uLong ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uLong nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual bool AnyInput( sal_uInt16 nType );
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu );
virtual void DestroyMenu( SalMenu* );
virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
@@ -165,7 +166,7 @@ public:
public:
friend class AquaSalFrame;
- void PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData );
+ void PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData );
void delayedSettingsChanged( bool bInvalidate );
bool isNSAppThread() const;
@@ -186,7 +187,7 @@ public:
// helper class: inverted solar guard
class YieldMutexReleaser
{
- ULONG mnCount;
+ sal_uLong mnCount;
public:
YieldMutexReleaser();
~YieldMutexReleaser();
diff --git a/vcl/aqua/inc/salmenu.h b/vcl/aqua/inc/salmenu.h
index 0d30deedb176..71081ad48b77 100644
--- a/vcl/aqua/inc/salmenu.h
+++ b/vcl/aqua/inc/salmenu.h
@@ -59,32 +59,32 @@ public: // for OOStatusView
private:
std::vector< MenuBarButtonEntry > maButtons;
- MenuBarButtonEntry* findButtonItem( USHORT i_nItemId );
+ MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId );
void releaseButtonEntry( MenuBarButtonEntry& i_rEntry );
static void statusLayout();
public:
AquaSalMenu( bool bMenuBar );
virtual ~AquaSalMenu();
- virtual BOOL VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
virtual void RemoveItem( unsigned nPos );
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
virtual void SetFrame( const SalFrame* pFrame );
- virtual void CheckItem( unsigned nPos, BOOL bCheck );
- virtual void EnableItem( unsigned nPos, BOOL bEnable );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
virtual void GetSystemMenuData( SystemMenuData* pData );
- virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& );
- virtual void RemoveMenuBarButton( USHORT nId );
- virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual void RemoveMenuBarButton( sal_uInt16 nId );
+ virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
- int getItemIndexByPos( USHORT nPos ) const;
+ int getItemIndexByPos( sal_uInt16 nPos ) const;
const AquaSalFrame* getFrame() const;
void setMainMenu();
@@ -112,7 +112,7 @@ public:
AquaSalMenuItem( const SalItemParams* );
virtual ~AquaSalMenuItem();
- USHORT mnId; // Item ID
+ sal_uInt16 mnId; // Item ID
Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted
AquaSalMenu* mpParentMenu; // The menu in which this menu item is inserted
AquaSalMenu* mpSubMenu; // Sub menu of this item (if defined)
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h
index 99dea9483b4b..63f5fecb7279 100644
--- a/vcl/aqua/inc/salobj.h
+++ b/vcl/aqua/inc/salobj.h
@@ -71,17 +71,18 @@ public:
virtual ~AquaSalObject();
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/aqua/inc/salprn.h b/vcl/aqua/inc/salprn.h
index 3682ea6b5a9f..86d456907a67 100644
--- a/vcl/aqua/inc/salprn.h
+++ b/vcl/aqua/inc/salprn.h
@@ -82,16 +82,16 @@ class AquaSalInfoPrinter : public SalInfoPrinter
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* i_pGraphics );
- virtual BOOL Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG i_nFlags, ImplJobSetup* i_pSetupData );
+ virtual sal_Bool Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData );
virtual void GetPageInfo( const ImplJobSetup* i_pSetupData,
long& o_rOutWidth, long& o_rOutHeight,
long& o_rPageOffX, long& o_rPageOffY,
long& o_rPageWidth, long& o_rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* i_pSetupData, USHORT i_nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* i_pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin );
+ virtual sal_uLong GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType );
+ virtual sal_uLong GetPaperBinCount( const ImplJobSetup* i_pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
@@ -100,16 +100,16 @@ class AquaSalInfoPrinter : public SalInfoPrinter
// so let's make AquaSalPrinter just a forwarder to AquaSalInfoPrinter
// and concentrate the real work in one class
// implement pull model print system
- BOOL StartJob( const String* i_pFileName,
+ sal_Bool StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController );
- BOOL EndJob();
- BOOL AbortJob();
- SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
- BOOL EndPage();
- ULONG GetErrorCode() const;
+ sal_Bool EndJob();
+ sal_Bool AbortJob();
+ SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ sal_Bool EndPage();
+ sal_uLong GetErrorCode() const;
NSPrintInfo* getPrintInfo() const { return mpPrintInfo; }
void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
@@ -136,25 +136,25 @@ class AquaSalPrinter : public SalPrinter
AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
virtual ~AquaSalPrinter();
- virtual BOOL StartJob( const XubString* i_pFileName,
+ virtual sal_Bool StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies,
+ sal_uLong i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData );
// implement pull model print system
- virtual BOOL StartJob( const String* i_pFileName,
+ virtual sal_Bool StartJob( const String* i_pFileName,
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rListener );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uLong GetErrorCode();
private:
AquaSalPrinter( const AquaSalPrinter& );
diff --git a/vcl/aqua/inc/salsys.h b/vcl/aqua/inc/salsys.h
index 964da669301b..64e1791668b1 100644
--- a/vcl/aqua/inc/salsys.h
+++ b/vcl/aqua/inc/salsys.h
@@ -56,11 +56,6 @@ public:
virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetScreenName( unsigned int nScreen );
- // overload pure virtual methods
- virtual int ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton );
virtual int ShowNativeMessageBox( const String& rTitle,
const String& rMessage,
int nButtonCombination,
diff --git a/vcl/aqua/inc/saltimer.h b/vcl/aqua/inc/saltimer.h
index 0651ec584fef..03772a2dfc2c 100644
--- a/vcl/aqua/inc/saltimer.h
+++ b/vcl/aqua/inc/saltimer.h
@@ -42,7 +42,7 @@ class AquaSalTimer : public SalTimer
AquaSalTimer();
virtual ~AquaSalTimer();
- void Start( ULONG nMS );
+ void Start( sal_uLong nMS );
void Stop();
static void handleStartTimerEvent( NSEvent* pEvent );
diff --git a/vcl/aqua/inc/salvd.h b/vcl/aqua/inc/salvd.h
index 5970c07f7f9c..6333fd31e460 100644
--- a/vcl/aqua/inc/salvd.h
+++ b/vcl/aqua/inc/salvd.h
@@ -81,12 +81,12 @@ private:
void Destroy();
public:
- AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData );
+ AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual ~AquaSalVirtualDevice();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/aqua/inc/vclnsapp.h b/vcl/aqua/inc/vclnsapp.h
index 316f7e6af153..bdbe15840e0f 100644
--- a/vcl/aqua/inc/vclnsapp.h
+++ b/vcl/aqua/inc/vclnsapp.h
@@ -48,10 +48,10 @@ class AquaSalFrame;
-(void)sendEvent:(NSEvent*)pEvent;
-(void)sendSuperEvent:(NSEvent*)pEvent;
-(NSMenu*)applicationDockMenu:(NSApplication *)sender;
--(MacOSBOOL)application: (NSApplication*) app openFile: (NSString*)file;
+-(BOOL)application: (NSApplication*) app openFile: (NSString*)file;
-(void)application: (NSApplication*) app openFiles: (NSArray*)files;
--(MacOSBOOL)application: (NSApplication*) app printFile: (NSString*)file;
--(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)bShowPrintPanels;
+-(BOOL)application: (NSApplication*) app printFile: (NSString*)file;
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels;
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app;
-(void)systemColorsChanged: (NSNotification*) pNotification;
-(void)screenParametersChanged: (NSNotification*) pNotification;
@@ -62,7 +62,7 @@ class AquaSalFrame;
-(void)addDockMenuItem: (NSMenuItem*)pNewItem;
-(void)applicationWillBecomeActive: (NSNotification *)pNotification;
-(void)applicationWillResignActive: (NSNotification *)pNotification;
--(MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL)bWinVisible;
+-(BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL)bWinVisible;
-(void)setDockIconClickHandler: (NSObject*)pHandler;
-(void)cycleFrameForward: (AquaSalFrame*)pCurFrame;
-(void)cycleFrameBackward: (AquaSalFrame*)pCurFrame;
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
index 3968e71f4992..f7ec6e513fa7 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.h
@@ -39,7 +39,7 @@
+(id)positionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)descriptionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setFocusedAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
index a700b0b89ae9..c66e7c3d8515 100644
--- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm
@@ -75,8 +75,8 @@ using namespace ::com::sun::star::uno;
[ pool release ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
if ( [ attribute isEqualToString: NSAccessibilityFocusedAttribute ]
&& ! [ [ AquaA11yRoleHelper getNativeRoleFrom: [ wrapper accessibleContext ] ] isEqualToString: NSAccessibilityScrollBarRole ]
diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm
index 7732ce202cd2..5dcdf4bb9f61 100644
--- a/vcl/aqua/source/a11y/aqua11yfactory.mm
+++ b/vcl/aqua/source/a11y/aqua11yfactory.mm
@@ -95,11 +95,11 @@ static bool enabled = false;
return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: YES asRadioGroup: NO ];
}
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate {
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate {
return [ AquaA11yFactory wrapperForAccessibleContext: rxAccessibleContext createIfNotExists: bCreate asRadioGroup: NO ];
}
-+(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(MacOSBOOL) bCreate asRadioGroup:(MacOSBOOL) asRadioGroup{
++(AquaA11yWrapper *)wrapperForAccessibleContext: (Reference < XAccessibleContext >) rxAccessibleContext createIfNotExists:(BOOL) bCreate asRadioGroup:(BOOL) asRadioGroup{
NSMutableDictionary * dAllWrapper = [ AquaA11yFactory allWrapper ];
NSValue * nKey = nil;
if ( asRadioGroup ) {
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
index 56a77ae9b728..0585f01c9360 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.h
@@ -37,7 +37,7 @@
}
+(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setSelectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
index 81f203da5d68..66f19b80a9f9 100644
--- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm
@@ -65,7 +65,7 @@ using namespace ::com::sun::star::uno;
[ attributeNames addObject: NSAccessibilitySelectedChildrenAttribute ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper
{
if ( [ attribute isEqualToString: NSAccessibilitySelectedChildrenAttribute ] )
{
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 7bee05d49ce6..f0d0e46a517e 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -77,8 +77,8 @@ using namespace ::rtl;
return italicStyle;
}
-+(MacOSBOOL)isStrikethrough:(PropertyValue)property {
- MacOSBOOL strikethrough = NO;
++(BOOL)isStrikethrough:(PropertyValue)property {
+ BOOL strikethrough = NO;
sal_Int16 value = 0;
property.Value >>= value;
if ( value != FontStrikeout::NONE
@@ -88,8 +88,8 @@ using namespace ::rtl;
return strikethrough;
}
-+(MacOSBOOL)convertBoolean:(PropertyValue)property {
- MacOSBOOL myBoolean = NO;
++(BOOL)convertBoolean:(PropertyValue)property {
+ BOOL myBoolean = NO;
bool value = sal_False;
property.Value >>= value;
if ( value ) {
@@ -149,7 +149,7 @@ using namespace ::rtl;
int fonttraits = 0;
float fontsize = 0.0;
sal_Int32 underlineColor = 0;
- MacOSBOOL underlineHasColor = NO;
+ BOOL underlineHasColor = NO;
// add attributes to string
for ( int attrIndex = 0; attrIndex < attributes.getLength(); attrIndex++ ) {
PropertyValue property = attributes [ attrIndex ];
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.h b/vcl/aqua/source/a11y/aqua11ytextwrapper.h
index c793ae01a69e..ceb9bcbe393d 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.h
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.h
@@ -55,7 +55,7 @@
+(void)addParameterizedAttributeNamesTo:(NSMutableArray *)attributeNames;
+(NSArray *)specialAttributeNames;
+(NSArray *)specialParameterizedAttributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setVisibleCharacterRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
index 2033135564d8..89c164e5e0b9 100644
--- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm
@@ -273,8 +273,8 @@ using namespace ::rtl;
return rtfData;
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
index 6b92718cc808..1292ef5ab77b 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.h
@@ -40,7 +40,7 @@
+(id)minValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)maxValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setValueAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
@end
diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
index 85ef0041da95..fb257921b13e 100644
--- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm
@@ -82,8 +82,8 @@ using namespace ::com::sun::star::uno;
[ attributeNames addObject: NSAccessibilityValueAttribute ];
}
-+(MacOSBOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
- MacOSBOOL isSettable = NO;
++(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper {
+ BOOL isSettable = NO;
if ( [ wrapper accessibleValue ] != nil
&& [ attribute isEqualToString: NSAccessibilityValueAttribute ]
&& ! [ wrapper isKindOfClass: [ AquaA11yWrapperStaticText class ] ] ) {
diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index e86676e725f2..c2724a372f9f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -63,7 +63,7 @@ using namespace ::com::sun::star::uno;
-(Reference<XAccessibleContext>)accessibleContext;
@end
-static MacOSBOOL isPopupMenuOpen = NO;
+static BOOL isPopupMenuOpen = NO;
@implementation AquaA11yWrapper : NSView
@@ -154,7 +154,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
// (getter without parameter) attributeNameHereAttribute
// (getter with parameter) attributeNameHereAttributeForParameter:
// (setter) setAttributeNameHereAttributeForElement:to:
--(SEL)selectorForAttribute:(NSString *)attribute asGetter:(MacOSBOOL)asGetter withGetterParameter:(MacOSBOOL)withGetterParameter {
+-(SEL)selectorForAttribute:(NSString *)attribute asGetter:(BOOL)asGetter withGetterParameter:(BOOL)withGetterParameter {
SEL selector = nil;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
@try {
@@ -197,7 +197,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
return Reference < XAccessible > ();
}
--(MacOSBOOL)isFirstRadioButtonInGroup {
+-(BOOL)isFirstRadioButtonInGroup {
Reference < XAccessible > rFirstMateAccessible = [ self getFirstRadioButtonInGroup ];
if ( rFirstMateAccessible.is() && rFirstMateAccessible -> getAccessibleContext().get() == [ self accessibleContext ] ) {
return YES;
@@ -693,12 +693,12 @@ static MacOSBOOL isPopupMenuOpen = NO;
return value;
}
--(MacOSBOOL)accessibilityIsIgnored {
+-(BOOL)accessibilityIsIgnored {
// #i90575# guard NSAccessibility protocol against unwanted access
if ( isPopupMenuOpen ) {
return nil;
}
- MacOSBOOL ignored = NO;
+ BOOL ignored = NO;
sal_Int16 nRole = [ self accessibleContext ] -> getAccessibleRole();
switch ( nRole ) {
case AccessibleRole::PANEL:
@@ -796,8 +796,8 @@ static MacOSBOOL isPopupMenuOpen = NO;
}
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
- MacOSBOOL isSettable = NO;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+ BOOL isSettable = NO;
if ( [ self accessibleText ] != nil ) {
isSettable = [ AquaA11yTextWrapper isAttributeSettable: attribute forElement: self ];
}
@@ -830,7 +830,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
return nil; // TODO: to be completed
}
--(MacOSBOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
+-(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute {
return NO; // TODO
}
@@ -904,7 +904,7 @@ static MacOSBOOL isPopupMenuOpen = NO;
// get some information
NSString * role = (NSString *) [ self accessibilityAttributeValue: NSAccessibilityRoleAttribute ];
id enabledAttr = [ self enabledAttribute ];
- MacOSBOOL enabled = [ enabledAttr boolValue ];
+ BOOL enabled = [ enabledAttr boolValue ];
NSView * parent = (NSView *) [ self accessibilityAttributeValue: NSAccessibilityParentAttribute ];
AquaA11yWrapper * parentAsWrapper = nil;
if ( [ parent isKindOfClass: [ AquaA11yWrapper class ] ] ) {
@@ -947,8 +947,8 @@ static MacOSBOOL isPopupMenuOpen = NO;
#pragma mark -
#pragma mark Hit Test
--(MacOSBOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
- MacOSBOOL hit = NO;
+-(BOOL)isViewElement:(NSObject *)viewElement hitByPoint:(NSPoint)point {
+ BOOL hit = NO;
NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
NSValue * position = [ viewElement accessibilityAttributeValue: NSAccessibilityPositionAttribute ];
NSValue * size = [ viewElement accessibilityAttributeValue: NSAccessibilitySizeAttribute ];
@@ -1127,15 +1127,15 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin
return mDefaultFontsize;
}
--(void)setActsAsRadioGroup:(MacOSBOOL)actsAsRadioGroup {
+-(void)setActsAsRadioGroup:(BOOL)actsAsRadioGroup {
mActsAsRadioGroup = actsAsRadioGroup;
}
--(MacOSBOOL)actsAsRadioGroup {
+-(BOOL)actsAsRadioGroup {
return mActsAsRadioGroup;
}
-+(void)setPopupMenuOpen:(MacOSBOOL)popupMenuOpen {
++(void)setPopupMenuOpen:(BOOL)popupMenuOpen {
isPopupMenuOpen = popupMenuOpen;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
index e689e829a6e2..192e528e930d 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.h
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
index c4ac34dc5bce..25f012e1163f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ] ) {
return NO;
}
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.h b/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
index ea58a227ed95..5ca5c967234f 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.h
@@ -43,7 +43,7 @@
-(id)selectedTextRangeAttribute;
-(id)visibleCharacterRangeAttribute;
// Accessibility Protocol
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
index 85aed320e470..16fa1372fe4e 100644
--- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm
@@ -117,7 +117,7 @@ using namespace ::com::sun::star::uno;
#pragma mark -
#pragma mark Accessibility Protocol
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ self textArea ] != nil && (
[ attribute isEqualToString: NSAccessibilitySelectedTextAttribute ]
|| [ attribute isEqualToString: NSAccessibilitySelectedTextRangeAttribute ]
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
index 6edc9b139b70..ac9e0e7022ff 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.h
@@ -35,7 +35,7 @@
{
}
-(id)valueAttribute;
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
@end
diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
index 54d6edac619a..930f940c4971 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm
@@ -44,7 +44,7 @@
return [ NSNumber numberWithInt: 0 ];
}
--(MacOSBOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
if ( [ attribute isEqualToString: NSAccessibilityValueAttribute ] ) {
return NO;
}
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index da5b92b7ff7f..20ac4e2251d6 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -73,7 +73,7 @@
using namespace std;
using namespace ::com::sun::star;
-extern BOOL ImplSVMain();
+extern sal_Bool ImplSVMain();
static int* gpnInit = 0;
static NSMenu* pDockMenu = nil;
@@ -209,7 +209,7 @@ static void initNSApp()
[NSApp activateIgnoringOtherApps: YES];
}
-BOOL ImplSVMainHook( int * pnInit )
+sal_Bool ImplSVMainHook( int * pnInit )
{
gpnInit = pnInit;
@@ -404,7 +404,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
// some convenience functions regarding the yield mutex, aka solar mutex
-BOOL ImplSalYieldMutexTryToAcquire()
+sal_Bool ImplSalYieldMutexTryToAcquire()
{
AquaSalInstance* pInst = (AquaSalInstance*) GetSalData()->mpFirstInstance;
if ( pInst )
@@ -451,7 +451,7 @@ SalInstance* CreateSalInstance()
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
- ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
+ ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
@@ -515,7 +515,7 @@ void AquaSalInstance::wakeupYield()
// -----------------------------------------------------------------------
-void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, USHORT nType, void* pData )
+void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, void* pData )
{
osl_acquireMutex( maUserEventListMutex );
maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) );
@@ -534,14 +534,14 @@ osl::SolarMutex* AquaSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG AquaSalInstance::ReleaseYieldMutex()
+sal_uLong AquaSalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = pYieldMutex->GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -556,7 +556,7 @@ ULONG AquaSalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
+void AquaSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -568,6 +568,21 @@ void AquaSalInstance::AcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
+bool AquaSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier())
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
bool AquaSalInstance::isNSAppThread() const
{
return osl::Thread::getCurrentIdentifier() == maMainThread;
@@ -697,7 +712,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bDispatchUser = true;
while( bDispatchUser )
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
// get one user event
osl_acquireMutex( maUserEventListMutex );
@@ -738,7 +753,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool bHadEvent = false;
do
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil
inMode: NSDefaultRunLoopMode dequeue: YES];
@@ -755,7 +770,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// if we had no event yet, wait for one if requested
if( bWait && ! bHadEvent )
{
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
NSDate* pDt = AquaSalTimer::pRunningTimer ? [AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture];
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: pDt
@@ -799,7 +814,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// has dispatched an event, cop out at 200 ms
osl_resetCondition( maWaitingYieldCond );
TimeValue aVal = { 0, 200000000 };
- ULONG nCount = ReleaseYieldMutex();
+ sal_uLong nCount = ReleaseYieldMutex();
osl_waitCondition( maWaitingYieldCond, &aVal );
AcquireYieldMutex( nCount );
}
@@ -830,7 +845,7 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
// -----------------------------------------------------------------------
-bool AquaSalInstance::AnyInput( USHORT nType )
+bool AquaSalInstance::AnyInput( sal_uInt16 nType )
{
if( nType & INPUT_APPEVENT )
{
@@ -876,14 +891,14 @@ bool AquaSalInstance::AnyInput( USHORT nType )
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
{
return NULL;
}
// -----------------------------------------------------------------------
-SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
+SalFrame* AquaSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
{
SalData::ensureThreadAutoreleasePool();
@@ -900,7 +915,7 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame )
// -----------------------------------------------------------------------
-SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, BOOL /* bShow */ )
+SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ )
{
// SystemWindowData is meaningless on Mac OS X
AquaSalObject *pObject = NULL;
@@ -977,6 +992,9 @@ void AquaSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString AquaSalInstance::GetDefaultPrinter()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maDefaultPrinter.getLength() )
{
NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo];
@@ -1001,6 +1019,9 @@ XubString AquaSalInstance::GetDefaultPrinter()
SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalInfoPrinter* pNewInfoPrinter = NULL;
if( pQueueInfo )
{
@@ -1016,6 +1037,9 @@ SalInfoPrinter* AquaSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueI
void AquaSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
delete pPrinter;
}
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 91f5e4df0180..ea588c9de132 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -31,9 +31,11 @@
#include "tools/rc.hxx"
#include "vcl/svids.hrc"
+#include "vcl/button.hxx"
#include "salsys.h"
#include "saldata.hxx"
+#include "salinst.h"
#include "rtl/ustrbuf.hxx"
using ::rtl::OUString;
@@ -115,12 +117,22 @@ rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen )
return aRet;
}
-int AquaSalSystem::ShowNativeDialog( const String& rTitle,
- const String& rMessage,
- const std::list< String >& rButtons,
- int nDefButton )
+static NSString* getStandardString( int nButtonId )
{
- return 0;
+ rtl::OUString aText( Button::GetStandardText( nButtonId ) );
+ if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource
+ {
+ switch( nButtonId )
+ {
+ case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break;
+ case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break;
+ case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break;
+ case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break;
+ case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break;
+ case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break;
+ }
+ }
+ return aText.getLength() ? CreateNSString( aText) : nil;
}
int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
@@ -128,7 +140,84 @@ int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
int nButtonCombination,
int nDefaultButton)
{
- return 0;
+ NSString* pTitle = CreateNSString( rTitle );
+ NSString* pMessage = CreateNSString( rMessage );
+
+ struct id_entry
+ {
+ int nCombination;
+ int nDefaultButton;
+ int nTextIds[3];
+ } aButtonIds[] =
+ {
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } },
+ { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } }
+ };
+
+ NSString* pDefText = nil;
+ NSString* pAltText = nil;
+ NSString* pOthText = nil;
+
+ unsigned int nC;
+ for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ )
+ {
+ if( aButtonIds[nC].nCombination == nButtonCombination )
+ {
+ if( aButtonIds[nC].nDefaultButton == nDefaultButton )
+ {
+ if( aButtonIds[nC].nTextIds[0] != -1 )
+ pDefText = getStandardString( aButtonIds[nC].nTextIds[0] );
+ if( aButtonIds[nC].nTextIds[1] != -1 )
+ pAltText = getStandardString( aButtonIds[nC].nTextIds[1] );
+ if( aButtonIds[nC].nTextIds[2] != -1 )
+ pOthText = getStandardString( aButtonIds[nC].nTextIds[2] );
+ break;
+ }
+ }
+ }
+
+
+ int nResult = NSRunAlertPanel( pTitle, pMessage, pDefText, pAltText, pOthText );
+
+ if( pTitle )
+ [pTitle release];
+ if( pMessage )
+ [pMessage release];
+ if( pDefText )
+ [pDefText release];
+ if( pAltText )
+ [pAltText release];
+ if( pOthText )
+ [pOthText release];
+
+ int nRet = 0;
+ if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 )
+ {
+ int nPressed = aButtonIds[nC].nTextIds[nResult-1];
+ switch( nPressed )
+ {
+ case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break;
+ case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break;
+ case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break;
+ case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break;
+ case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break;
+ case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break;
+ case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break;
+ }
+ }
+
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/app/saltimer.cxx b/vcl/aqua/source/app/saltimer.cxx
index 75c5f92f820b..e0c406a6a589 100644
--- a/vcl/aqua/source/app/saltimer.cxx
+++ b/vcl/aqua/source/app/saltimer.cxx
@@ -41,7 +41,7 @@ NSTimer* AquaSalTimer::pRunningTimer = nil;
bool AquaSalTimer::bDispatchTimer = false;
-void ImplSalStartTimer( ULONG nMS )
+void ImplSalStartTimer( sal_uLong nMS )
{
SalData* pSalData = GetSalData();
if( pSalData->mpFirstInstance->isNSAppThread() )
@@ -109,7 +109,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
// timer already elapsed since event posted
pSVData->mpSalTimer->CallCallback();
}
- ImplSalStartTimer( ULONG( [pEvent data1] ) );
+ ImplSalStartTimer( sal_uLong( [pEvent data1] ) );
}
}
@@ -123,7 +123,7 @@ AquaSalTimer::~AquaSalTimer()
ImplSalStopTimer();
}
-void AquaSalTimer::Start( ULONG nMS )
+void AquaSalTimer::Start( sal_uLong nMS )
{
ImplSalStartTimer( nMS );
}
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 4264f8802126..455e7c64c6a4 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -287,7 +287,7 @@
return AquaSalInstance::GetDynamicDockMenu();
}
--(MacOSBOOL)application: (NSApplication*)app openFile: (NSString*)pFile
+-(BOOL)application: (NSApplication*)app openFile: (NSString*)pFile
{
const rtl::OUString aFile( GetOUString( pFile ) );
if( ! AquaSalInstance::isOnCommandLine( aFile ) )
@@ -328,7 +328,7 @@
}
}
--(MacOSBOOL)application: (NSApplication*)app printFile: (NSString*)pFile
+-(BOOL)application: (NSApplication*)app printFile: (NSString*)pFile
{
const rtl::OUString aFile( GetOUString( pFile ) );
const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(),
@@ -336,7 +336,7 @@
AquaSalInstance::aAppEventList.push_back( pAppEvent );
return YES;
}
--(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(MacOSBOOL)bShowPrintPanels
+-(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels
{
// currently ignores print settings an bShowPrintPanels
rtl::OUStringBuffer aFileList( 256 );
@@ -360,70 +360,35 @@
-(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
{
- SalData* pSalData = GetSalData();
- #if 1 // currently do some really bad hack
- if( ! pSalData->maFrames.empty() )
+ NSApplicationTerminateReply aReply = NSTerminateNow;
{
- /* #i92766# something really weird is going on with the retain count of
- our windows; sometimes we get a duplicate free before exit on one of our
- NSWindows. The reason is unclear; to avoid this currently we retain them once more
-
- FIXME: this is a really bad hack, relying on the system to catch the leaked
- resources. Find out what really goes on here and fix it !
- */
- std::vector< NSWindow* > aHackRetainedWindows;
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
- {
- #if OSL_DEBUG_LEVEL > 1
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "retaining %p (old count %d) windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, [(*it)->mpWindow retainCount],
- typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- #endif
- [(*it)->mpWindow retain];
- aHackRetainedWindows.push_back( (*it)->mpWindow );
- }
- if( pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) )
+ YIELD_GUARD;
+
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->maFrames.empty() )
{
- for( std::vector< NSWindow* >::iterator it = aHackRetainedWindows.begin();
- it != aHackRetainedWindows.end(); ++it )
- {
- // clean up the retaing count again from the shutdown workaround
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "releasing %p\n", (*it) );
- #endif
- [(*it) release];
- }
- return NSTerminateCancel;
+ // the following QueryExit will likely present a message box, activate application
+ [NSApp activateIgnoringOtherApps: YES];
+ aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
}
- #if OSL_DEBUG_LEVEL > 1
- for( std::list< AquaSalFrame* >::iterator it = pSalData->maFrames.begin();
- it != pSalData->maFrames.end(); ++it )
+
+ if( aReply == NSTerminateNow )
{
- Window* pWin = (*it)->GetWindow();
- String aTitle = pWin->GetText();
- Window* pClient = pWin->ImplGetClientWindow();
- fprintf( stderr, "frame still alive: NSWindow %p windowtype=%s clienttyp=%s title=%s\n",
- (*it)->mpWindow, typeid(*pWin).name(), pClient ? typeid(*pClient).name() : "<nil>",
- rtl::OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr()
- );
+ ApplicationEvent aEv( String(), ApplicationAddress(), ByteString( "PRIVATE:DOSHUTDOWN" ), String() );
+ GetpApp()->AppEvent( aEv );
+ ImplImageTreeSingletonRef()->shutDown();
+ // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
+ // can occur in Desktop::doShutdown for example
}
- #endif
}
- #else // the clean version follows
- return pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, NULL ) ? NSTerminateCancel : NSTerminateNow;
- #endif
- ImplImageTreeSingletonRef()->shutDown();
- return NSTerminateNow;
+
+ return aReply;
}
-(void)systemColorsChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() )
pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
@@ -431,6 +396,8 @@
-(void)screenParametersChanged: (NSNotification*) pNotification
{
+ YIELD_GUARD;
+
SalData* pSalData = GetSalData();
std::list< AquaSalFrame* >::iterator it;
for( it = pSalData->maFrames.begin(); it != pSalData->maFrames.end(); ++it )
@@ -501,7 +468,7 @@
}
}
-- (MacOSBOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (MacOSBOOL) bWinVisible
+- (BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: (BOOL) bWinVisible
{
NSObject* pHdl = GetSalData()->mpDockIconClickHandler;
if( pHdl && [pHdl respondsToSelector: @selector(dockIconClicked:)] )
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
index 0c388e4643d9..c660dbc0616d 100644
--- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
+++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
@@ -579,11 +579,19 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(NSString* systemFlavor, Refe
if (isByteSequenceType(data.getValueType()))
{
+ /*
+ the HTMLFormatDataProvider prepends segment information to HTML
+ this is useful for exchange with MS Word (which brings this stuff from Windows)
+ but annoying for other applications. Since this extension is not a standard datatype
+ on the Mac, let us not provide but provide normal HTML
+
if ([systemFlavor caseInsensitiveCompare: NSHTMLPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new HTMLFormatDataProvider(data));
}
- else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
+ else
+ */
+ if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t(new BMPDataProvider(data, PICTImageFileType));
}
diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx
index 93871add6ffa..bef1e639caf9 100644
--- a/vcl/aqua/source/dtrans/DragSource.cxx
+++ b/vcl/aqua/source/dtrans/DragSource.cxx
@@ -39,6 +39,7 @@
#include "DragSourceContext.hxx"
#include "aqua_clipboard.hxx"
#include "DragActionConversion.hxx"
+#include "salframe.h"
#include <rtl/ustring.h>
#include <memory>
@@ -46,6 +47,7 @@
using namespace cppu;
using namespace osl;
+using namespace com::sun::star;
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::datatransfer::dnd;
@@ -61,7 +63,7 @@ using ::rtl::OUString;
// For OOo internal D&D we provide the Transferable without NSDragPboard
// interference as a shortcut
-Reference<XTransferable> DragSource::g_XTransferable = Reference<XTransferable>();
+uno::Reference<XTransferable> DragSource::g_XTransferable;
NSView* DragSource::g_DragSourceView = nil;
bool DragSource::g_DropSuccessSet = false;
bool DragSource::g_DropSuccess = false;
@@ -105,7 +107,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
}
--(unsigned int)draggingSourceOperationMaskForLocal: (MacOSBOOL)isLocal
+-(unsigned int)draggingSourceOperationMaskForLocal: (BOOL)isLocal
{
return mDragSource->getSupportedDragOperations(isLocal);
}
@@ -138,7 +140,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
bDropSuccess );
mDragSource->mXDragSrcListener->dragDropEnd(dsde);
- mDragSource->mXDragSrcListener = Reference<XDragSourceListener>();
+ mDragSource->mXDragSrcListener = uno::Reference<XDragSourceListener>();
}
@@ -159,6 +161,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
DragSource::DragSource():
WeakComponentImplHelper3<XDragSource, XInitialization, XServiceInfo>(m_aMutex),
mView(NULL),
+ mpFrame(NULL),
mLastMouseEventBeforeStartDrag(nil),
m_MouseButton(0)
{
@@ -167,8 +170,9 @@ DragSource::DragSource():
DragSource::~DragSource()
{
- [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
- [mDragSourceHelper release];
+ if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
+ [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper];
+ [mDragSourceHelper release];
}
@@ -198,6 +202,13 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments)
throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view doesn't support mouse listener")),
static_cast<OWeakObject*>(this));
}
+ NSWindow* pWin = [mView window];
+ if( ! pWin || ![pWin respondsToSelector: @selector(getSalFrame)] )
+ {
+ throw Exception(OUString(RTL_CONSTASCII_USTRINGPARAM("DragSource::initialize: Provided view is not attached to a vcl frame")),
+ static_cast<OWeakObject*>(this));
+ }
+ mpFrame = (AquaSalFrame*)[pWin performSelector: @selector(getSalFrame)];
mDragSourceHelper = [[DragSourceHelper alloc] initWithDragSource: this];
@@ -233,8 +244,8 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
sal_Int8 sourceActions,
sal_Int32 cursor,
sal_Int32 image,
- const Reference<XTransferable >& transferable,
- const Reference<XDragSourceListener >& listener )
+ const uno::Reference<XTransferable >& transferable,
+ const uno::Reference<XDragSourceListener >& listener )
throw( RuntimeException)
{
MutexGuard guard(m_aMutex);
@@ -248,7 +259,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
mXCurrentContext = static_cast<XDragSourceContext*>(new DragSourceContext(this));
auto_ptr<AquaClipboard> clipb(new AquaClipboard(NULL, false));
g_XTransferable = transferable;
- clipb->setContents(g_XTransferable, Reference<XClipboardOwner>());
+ clipb->setContents(g_XTransferable, uno::Reference<XClipboardOwner>());
mDragSourceActions = sourceActions;
g_DragSourceView = mView;
@@ -288,7 +299,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
[dragImage release];
- g_XTransferable = Reference<XTransferable>();
+ g_XTransferable = uno::Reference<XTransferable>();
g_DragSourceView = nil;
// reset drop success flags
diff --git a/vcl/aqua/source/dtrans/DragSource.hxx b/vcl/aqua/source/dtrans/DragSource.hxx
index 498feaf819bb..943c84c5036e 100644
--- a/vcl/aqua/source/dtrans/DragSource.hxx
+++ b/vcl/aqua/source/dtrans/DragSource.hxx
@@ -47,6 +47,7 @@
class DragSource;
+class AquaSalFrame;
/* The functions declared in this protocol are actually
declared in vcl/aqua/inc/salframe.h. Because we want
@@ -72,7 +73,7 @@ class DragSource;
-(void)mouseDown: (NSEvent*)theEvent;
-(void)mouseDragged: (NSEvent*)theEvent;
--(unsigned int)draggingSourceOperationMaskForLocal:(MacOSBOOL)isLocal;
+-(unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
-(void)draggedImage:(NSImage*)anImage beganAt:(NSPoint)aPoint;
-(void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation;
-(void)draggedImage:(NSImage *)draggedImage movedTo:(NSPoint)screenPoint;
@@ -121,6 +122,7 @@ public:
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDragSourceContext > mXCurrentContext;
id mView;
+ AquaSalFrame* mpFrame;
NSEvent* mLastMouseEventBeforeStartDrag;
DragSourceHelper* mDragSourceHelper;
com::sun::star::awt::MouseEvent mMouseEvent;
diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx
index 6d5335dba6af..1fb6b9bb2d53 100644
--- a/vcl/aqua/source/dtrans/DropTarget.cxx
+++ b/vcl/aqua/source/dtrans/DropTarget.cxx
@@ -126,13 +126,13 @@ namespace /* private */
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->prepareForDragOperation(sender);
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return mDropTarget->performDragOperation(sender);
}
@@ -321,13 +321,13 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
}
- MacOSBOOL DropTarget::prepareForDragOperation(id sender)
+ BOOL DropTarget::prepareForDragOperation(id sender)
{
return 1;
}
-MacOSBOOL DropTarget::performDragOperation(id sender)
+BOOL DropTarget::performDragOperation(id sender)
{
bool bSuccess = false;
diff --git a/vcl/aqua/source/dtrans/DropTarget.hxx b/vcl/aqua/source/dtrans/DropTarget.hxx
index bb25497244a6..293db4d4eb39 100644
--- a/vcl/aqua/source/dtrans/DropTarget.hxx
+++ b/vcl/aqua/source/dtrans/DropTarget.hxx
@@ -75,8 +75,8 @@ class DropTarget;
-(NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
-(NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
-(void)draggingExited:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-(void)concludeDragOperation:(id <NSDraggingInfo>)sender;
@end
@@ -134,8 +134,8 @@ public:
virtual NSDragOperation draggingEntered(id sender);
virtual NSDragOperation draggingUpdated(id sender);
virtual void draggingExited(id sender);
- virtual MacOSBOOL prepareForDragOperation(id sender);
- virtual MacOSBOOL performDragOperation(id sender);
+ virtual BOOL prepareForDragOperation(id sender);
+ virtual BOOL performDragOperation(id sender);
virtual void concludeDragOperation(id sender);
/* If multiple actions are supported by the drag source and
diff --git a/vcl/aqua/source/dtrans/aqua_service.cxx b/vcl/aqua/source/dtrans/aqua_service.cxx
index d27548354022..aa46713bce1f 100644
--- a/vcl/aqua/source/dtrans/aqua_service.cxx
+++ b/vcl/aqua/source/dtrans/aqua_service.cxx
@@ -60,28 +60,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_False;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_REGKEY_NAME ) ) );
- bRetVal = sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
{
void* pRet = 0;
diff --git a/vcl/aqua/source/dtrans/service_entry.cxx b/vcl/aqua/source/dtrans/service_entry.cxx
index 73476525b6b4..661d87576fa8 100644
--- a/vcl/aqua/source/dtrans/service_entry.cxx
+++ b/vcl/aqua/source/dtrans/service_entry.cxx
@@ -35,32 +35,42 @@
#include "DropTarget.hxx"
#include "aqua_clipboard.hxx"
#include "osl/diagnose.h"
+#include "vcl/svapp.hxx"
using namespace ::osl;
using namespace ::rtl;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::cppu;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
-Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
+uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
{
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateClipboard( i_rArguments );
+
SalData* pSalData = GetSalData();
if( ! pSalData->mxClipboard.is() )
- pSalData->mxClipboard = Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
+ pSalData->mxClipboard = uno::Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
return pSalData->mxClipboard;
}
-
-Reference<XInterface> AquaSalInstance::CreateDragSource()
+uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
{
- return Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateDragSource();
+
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
}
-Reference<XInterface> AquaSalInstance::CreateDropTarget()
+uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
{
- return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
+ if ( Application::IsHeadlessModeEnabled() )
+ return SalInstance::CreateDropTarget();
+
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 8f0e080e5fb2..e62a950129e4 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -112,7 +112,7 @@ class ControllerProperties
maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
{
mpState->bNeedRestart = false;
- DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" );
+ DBG_ASSERT( maLocalizedStrings.Count() >= 5, "resources not found !" );
}
rtl::OUString getMoreString()
@@ -122,6 +122,13 @@ class ControllerProperties
: rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "More" ) );
}
+ rtl::OUString getPrintSelectionString()
+ {
+ return maLocalizedStrings.Count() >= 5
+ ? rtl::OUString( maLocalizedStrings.GetString( 4 ) )
+ : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Print selection only" ) );
+ }
+
void updatePrintJob()
{
// TODO: refresh page count etc from mpController
@@ -246,7 +253,11 @@ class ControllerProperties
PropertyValue* pVal = mpController->getValue( name_it->second );
if( pVal )
{
- pVal->Value <<= i_bValue;
+ // ugly
+ if( name_it->second.equalsAscii( "PrintContent" ) )
+ pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
+ else
+ pVal->Value <<= i_bValue;
updatePrintJob();
}
}
@@ -283,9 +294,9 @@ class ControllerProperties
-1;
std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
- if( name_it != maTagToPropertyName.end() )
+ if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAscii( "PrintContent" ) )
{
- MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
+ BOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
if( pCtrl )
{
[pCtrl setEnabled: bEnabled];
@@ -311,6 +322,9 @@ class ControllerProperties
GDIMetaFile aMtf;
PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
VirtualDevice aDev;
+ if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
+ aDev.SetDrawMode( aDev.GetDrawMode() | ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
// see salprn.cxx, currently we pretend to be a 720dpi device on printers
aDev.SetReferenceDevice( 720, 720 );
aDev.EnableOutput( TRUE );
@@ -768,6 +782,325 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
}
}
+static void addSubgroup( NSView* pCurParent, long& rCurY, const rtl::OUString& rText )
+{
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ NSRect aTextRect = [pTextView frame];
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
+ NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
+ [pBox setBoxType: NSBoxSeparator];
+ [pCurParent addSubview: [pBox autorelease]];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+}
+
+static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText, sal_Bool bEnabled,
+ const rtl::OUString& rProperty, sal_Bool bValue,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
+ NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
+ [pBtn setButtonType: NSSwitchButton];
+ [pBtn setState: bValue ? NSOnState : NSOffState];
+ if( ! bEnabled )
+ [pBtn setEnabled: NO];
+ linebreakCell( [pBtn cell], rText );
+ [pBtn sizeToFit];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: nTag];
+
+ aCheckRect = [pBtn frame];
+ // #i115837# add a murphy factor; it can apparently occasionally happen
+ // that sizeToFit does not a perfect job and that the button linebreaks again
+ // if - and only if - there is already a '\n' contained in the text and the width
+ // is minimally of
+ aCheckRect.size.width += 1;
+
+ // move to rCurY
+ aCheckRect.origin.y = rCurY - aCheckRect.size.height;
+ [pBtn setFrame: aCheckRect];
+
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ // update rCurY
+ rCurY = aCheckRect.origin.y - 5;
+}
+
+static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // indent the radio group relative to the text
+ // nOff = 20;
+ }
+
+ // setup radio matrix
+ NSButtonCell* pProto = [[NSButtonCell alloc] init];
+
+ NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } };
+ [pProto setTitle: @"RadioButtonGroup"];
+ [pProto setButtonType: NSRadioButton];
+ NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
+ mode: NSRadioModeMatrix
+ prototype: (NSCell*)pProto
+ numberOfRows: rChoices.getLength()
+ numberOfColumns: 1];
+ // set individual titles
+ NSArray* pCells = [pMatrix cells];
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSCell* pCell = [pCells objectAtIndex: m];
+ filterAccelerator( rChoices[m] );
+ linebreakCell( pCell, rChoices[m] );
+ // connect target and action
+ [pCell setTarget: pCtrlTarget];
+ [pCell setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ pControllerProperties->addObservedControl( pCell );
+ [pCell setTag: nTag];
+ // set current selection
+ if( nSelectValue == m )
+ [pMatrix selectCellAtRow: m column: 0];
+ }
+ [pMatrix sizeToFit];
+ aRadioRect = [pMatrix frame];
+
+ // move it down, so it comes to the correct position
+ aRadioRect.origin.y = rCurY - aRadioRect.size.height;
+ [pMatrix setFrame: aRadioRect];
+ [pCurParent addSubview: [pMatrix autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pMatrix ) );
+
+ // update nCurY
+ rCurY = aRadioRect.origin.y - 5;
+
+ [pProto release];
+}
+
+static void addList( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const Sequence< rtl::OUString > rChoices, sal_Int32 nSelectValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ // don't indent attached lists, looks bad in the existing cases
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX /* + nAttachOffset*/;
+
+ // don't indent attached lists, looks bad in the existing cases
+ NSRect aBtnRect = { { rCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
+ NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
+
+ // iterate options
+ for( sal_Int32 m = 0; m < rChoices.getLength(); m++ )
+ {
+ NSString* pItemText = CreateNSString( rChoices[m] );
+ [pBtn addItemWithTitle: pItemText];
+ NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
+ int nTag = pControllerProperties->addNameAndValueTag( rProperty, m );
+ [pItem setTag: nTag];
+ [pItemText release];
+ }
+
+ [pBtn selectItemAtIndex: nSelectValue];
+
+ // add the button to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: pControllerProperties->addNameTag( rProperty )];
+
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target and action
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+
+ // move to nCurY
+ aBtnRect = [pBtn frame];
+ aBtnRect.origin.y = rCurY - aBtnRect.size.height;
+ [pBtn setFrame: aBtnRect];
+
+ // align label
+ aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
+ [pTextView setFrame: aTextRect];
+
+ // update rCurY
+ rCurY = aBtnRect.origin.y - 5;
+}
+
+static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachOffset,
+ const rtl::OUString rCtrlType,
+ const rtl::OUString& rText,
+ const rtl::OUString& rProperty, const PropertyValue* pValue,
+ sal_Int64 nMinValue, sal_Int64 nMaxValue,
+ std::vector<ColumnItem >& rLeftColumn,
+ std::vector<ColumnItem >& rRightColumn,
+ ControllerProperties* pControllerProperties,
+ ControlTarget* pCtrlTarget
+ )
+{
+ sal_Int32 nOff = 0;
+ if( rText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( rText );
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ rLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = rCurX + nAttachOffset;
+ aTextRect.origin.y = rCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ rCurY = aTextRect.origin.y - 5;
+
+ // and set the offset for the real edit field
+ nOff = aTextRect.size.width + 5;
+ }
+
+ NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
+ NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
+ [pFieldView setEditable: YES];
+ [pFieldView setSelectable: YES];
+ [pFieldView setDrawsBackground: YES];
+ [pFieldView sizeToFit]; // FIXME: this does nothing
+ [pCurParent addSubview: [pFieldView autorelease]];
+
+ rRightColumn.push_back( ColumnItem( pFieldView ) );
+
+ // add the field to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pFieldView );
+ int nTag = pControllerProperties->addNameTag( rProperty );
+ [pFieldView setTag: nTag];
+ // pControllerProperties->addNamedView( pFieldView, aPropertyName );
+
+ // move to nCurY
+ aFieldRect.origin.y = rCurY - aFieldRect.size.height;
+ [pFieldView setFrame: aFieldRect];
+
+ if( rCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
+ {
+ // add a stepper control
+ NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
+ aFieldRect.origin.y },
+ { 15, aFieldRect.size.height } };
+ NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
+ [pStep setIncrement: 1];
+ [pStep setValueWraps: NO];
+ [pStep setTag: nTag];
+ [pCurParent addSubview: [pStep autorelease]];
+
+ rRightColumn.back().pSubControl = pStep;
+
+ pControllerProperties->addObservedControl( pStep );
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggered:)];
+
+ // constrain the text field to decimal numbers
+ NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
+ [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
+ [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
+ [pFormatter setAllowsFloats: NO];
+ [pFormatter setMaximumFractionDigits: 0];
+ if( nMinValue != nMaxValue )
+ {
+ [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
+ [pStep setMinValue: nMinValue];
+ [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
+ [pStep setMaxValue: nMaxValue];
+ }
+ [pFieldView setFormatter: pFormatter];
+
+ sal_Int64 nSelectVal = 0;
+ if( pValue && pValue->Value.hasValue() )
+ pValue->Value >>= nSelectVal;
+
+ [pFieldView setIntValue: nSelectVal];
+ [pStep setIntValue: nSelectVal];
+
+ pControllerProperties->addViewPair( pFieldView, pStep );
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggeredNumeric:)];
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggeredNumeric:)];
+ }
+ else
+ {
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggered:)];
+
+ if( pValue && pValue->Value.hasValue() )
+ {
+ rtl::OUString aValue;
+ pValue->Value >>= aValue;
+ if( aValue.getLength() )
+ {
+ NSString* pText = CreateNSString( aValue );
+ [pFieldView setStringValue: pText];
+ [pText release];
+ }
+ }
+ }
+
+ // update nCurY
+ rCurY = aFieldRect.origin.y - 5;
+}
@implementation AquaPrintAccessoryView
+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
@@ -792,6 +1125,54 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
std::vector< ColumnItem > aLeftColumn, aRightColumn;
+
+ // ugly:
+ // prepend a "selection" checkbox if the properties have such a selection in PrintContent
+ bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false;
+ for( int i = 0; i < rOptions.getLength(); i++ )
+ {
+ Sequence< beans::PropertyValue > aOptProp;
+ rOptions[i].Value >>= aOptProp;
+
+ rtl::OUString aCtrlType;
+ rtl::OUString aPropertyName;
+ Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
+ sal_Int32 aSelectionChecked = 0;
+ for( int n = 0; n < aOptProp.getLength(); n++ )
+ {
+ const beans::PropertyValue& rEntry( aOptProp[ n ] );
+ if( rEntry.Name.equalsAscii( "ControlType" ) )
+ {
+ rEntry.Value >>= aCtrlType;
+ }
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
+ {
+ rEntry.Value >>= aChoices;
+ }
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
+ else if( rEntry.Name.equalsAscii( "Property" ) )
+ {
+ PropertyValue aVal;
+ rEntry.Value >>= aVal;
+ aPropertyName = aVal.Name;
+ if( aPropertyName.equalsAscii( "PrintContent" ) )
+ aVal.Value >>= aSelectionChecked;
+ }
+ }
+ if( aCtrlType.equalsAscii( "Radio" ) &&
+ aPropertyName.equalsAscii( "PrintContent" ) &&
+ aChoices.getLength() > 2 )
+ {
+ bAddSelectionCheckBox = true;
+ bSelectionBoxEnabled = aChoicesDisabled.getLength() < 2 || ! aChoicesDisabled[2];
+ bSelectionBoxChecked = (aSelectionChecked==2);
+ break;
+ }
+ }
for( int i = 0; i < rOptions.getLength(); i++ )
{
@@ -803,6 +1184,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
rtl::OUString aCtrlType;
rtl::OUString aText;
rtl::OUString aPropertyName;
+ rtl::OUString aGroupHint;
Sequence< rtl::OUString > aChoices;
sal_Int64 nMinValue = 0, nMaxValue = 0;
long nAttachOffset = 0;
@@ -811,66 +1193,70 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
- if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Text" ) ) )
+ if( rEntry.Name.equalsAscii( "Text" ) )
{
rEntry.Value >>= aText;
filterAccelerator( aText );
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ControlType" ) ) )
+ else if( rEntry.Name.equalsAscii( "ControlType" ) )
{
rEntry.Value >>= aCtrlType;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Choices" ) ) )
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
{
rEntry.Value >>= aChoices;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
+ else if( rEntry.Name.equalsAscii( "Property" ) )
{
PropertyValue aVal;
rEntry.Value >>= aVal;
aPropertyName = aVal.Name;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Enabled" ) ) )
+ else if( rEntry.Name.equalsAscii( "Enabled" ) )
{
sal_Bool bValue = sal_True;
rEntry.Value >>= bValue;
bEnabled = bValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MinValue" ) ) )
+ else if( rEntry.Name.equalsAscii( "MinValue" ) )
{
rEntry.Value >>= nMinValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MaxValue" ) ) )
+ else if( rEntry.Name.equalsAscii( "MaxValue" ) )
{
rEntry.Value >>= nMaxValue;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AttachToDependency" ) ) )
+ else if( rEntry.Name.equalsAscii( "AttachToDependency" ) )
{
nAttachOffset = 20;
}
- else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InternalUIOnly" ) ) )
+ else if( rEntry.Name.equalsAscii( "InternalUIOnly" ) )
{
rEntry.Value >>= bIgnore;
}
+ else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
+ {
+ rEntry.Value >>= aGroupHint;
+ }
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) ||
- aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) )
+ if( aCtrlType.equalsAscii( "Group" ) ||
+ aCtrlType.equalsAscii( "Subgroup" ) ||
+ aCtrlType.equalsAscii( "Radio" ) ||
+ aCtrlType.equalsAscii( "List" ) ||
+ aCtrlType.equalsAscii( "Edit" ) ||
+ aCtrlType.equalsAscii( "Range" ) ||
+ aCtrlType.equalsAscii( "Bool" ) )
{
// since our build target is MacOSX 10.4 we can have only one accessory view
// so we have a single accessory view that is tabbed for grouping
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) )
+ if( aCtrlType.equalsAscii( "Group" )
|| ! pCurParent
- || ( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && nCurY < -250 && ! bIgnore )
+ || ( aCtrlType.equalsAscii( "Subgroup" ) && nCurY < -250 && ! bIgnore )
)
{
rtl::OUString aGroupTitle( aText );
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) )
+ if( aCtrlType.equalsAscii( "Subgroup" ) )
aGroupTitle = pControllerProperties->getMoreString();
// set size of current parent
if( pCurParent )
@@ -894,310 +1280,73 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
// clear columns
aLeftColumn.clear();
aRightColumn.clear();
+
+ if( bAddSelectionCheckBox )
+ {
+ addBool( pCurParent, nCurX, nCurY, 0,
+ pControllerProperties->getPrintSelectionString(), bSelectionBoxEnabled,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), bSelectionBoxChecked,
+ aRightColumn, pControllerProperties, pCtrlTarget );
+ bAddSelectionCheckBox = false;
+ }
}
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && pCurParent )
+ if( aCtrlType.equalsAscii( "Subgroup" ) && pCurParent )
{
bIgnoreSubgroup = bIgnore;
if( bIgnore )
continue;
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- NSRect aTextRect = [pTextView frame];
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
- NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
- [pBox setBoxType: NSBoxSeparator];
- [pCurParent addSubview: [pBox autorelease]];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
+ addSubgroup( pCurParent, nCurY, aText );
}
else if( bIgnoreSubgroup || bIgnore )
+ {
continue;
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) && pCurParent )
+ }
+ else if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
{
- NSRect aCheckRect = { { nCurX + nAttachOffset, 0 }, { 0, 15 } };
- NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
- [pBtn setButtonType: NSSwitchButton];
sal_Bool bVal = sal_False;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal )
pVal->Value >>= bVal;
- [pBtn setState: bVal ? NSOnState : NSOffState];
- linebreakCell( [pBtn cell], aText );
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: nTag];
-
- aCheckRect = [pBtn frame];
-
- // move to nCurY
- aCheckRect.origin.y = nCurY - aCheckRect.size.height;
- [pBtn setFrame: aCheckRect];
-
- // update nCurY
- nCurY = aCheckRect.origin.y - 5;
+ addBool( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, true, aPropertyName, bVal,
+ aRightColumn, pControllerProperties, pCtrlTarget );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
+ else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // indent the radio group relative to the text
- // nOff = 20;
- }
-
- // setup radio matrix
- NSButtonCell* pProto = [[NSButtonCell alloc] init];
-
- NSRect aRadioRect = { { nCurX + nOff, 0 }, { 280 - nCurX, 5*aChoices.getLength() } };
- [pProto setTitle: @"RadioButtonGroup"];
- [pProto setButtonType: NSRadioButton];
- NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
- mode: NSRadioModeMatrix
- prototype: (NSCell*)pProto
- numberOfRows: aChoices.getLength()
- numberOfColumns: 1];
// get currently selected value
sal_Int32 nSelectVal = 0;
PropertyValue* pVal = pController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- // set individual titles
- NSArray* pCells = [pMatrix cells];
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSCell* pCell = [pCells objectAtIndex: m];
- filterAccelerator( aChoices[m] );
- linebreakCell( pCell, aChoices[m] );
- //NSString* pTitle = CreateNSString( aChoices[m] );
- //[pCell setTitle: pTitle];
- // connect target and action
- [pCell setTarget: pCtrlTarget];
- [pCell setAction: @selector(triggered:)];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- pControllerProperties->addObservedControl( pCell );
- [pCell setTag: nTag];
- //[pTitle release];
- // set current selection
- if( nSelectVal == m )
- [pMatrix selectCellAtRow: m column: 0];
- }
- [pMatrix sizeToFit];
- aRadioRect = [pMatrix frame];
-
- // move it down, so it comes to the correct position
- aRadioRect.origin.y = nCurY - aRadioRect.size.height;
- [pMatrix setFrame: aRadioRect];
- [pCurParent addSubview: [pMatrix autorelease]];
- aRightColumn.push_back( ColumnItem( pMatrix ) );
-
- // update nCurY
- nCurY = aRadioRect.origin.y - 5;
-
- [pProto release];
+ addRadio( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, nSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) && pCurParent )
+ else if( aCtrlType.equalsAscii( "List" ) && pCurParent )
{
- // don't indent attached lists, looks bad in the existing cases
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
- aLeftColumn.push_back( ColumnItem( pTextView ) );
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX /* + nAttachOffset*/;
-
- // don't indent attached lists, looks bad in the existing cases
- NSRect aBtnRect = { { nCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
- NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
-
- // iterate options
- for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
- {
- NSString* pItemText = CreateNSString( aChoices[m] );
- [pBtn addItemWithTitle: pItemText];
- NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
- int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
- [pItem setTag: nTag];
- [pItemText release];
- }
-
PropertyValue* pVal = pController->getValue( aPropertyName );
sal_Int32 aSelectVal = 0;
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= aSelectVal;
- [pBtn selectItemAtIndex: aSelectVal];
-
- // add the button to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pBtn );
- [pBtn setTag: pControllerProperties->addNameTag( aPropertyName )];
-
- [pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
-
- aRightColumn.push_back( ColumnItem( pBtn ) );
-
- // connect target and action
- [pBtn setTarget: pCtrlTarget];
- [pBtn setAction: @selector(triggered:)];
-
- // move to nCurY
- aBtnRect = [pBtn frame];
- aBtnRect.origin.y = nCurY - aBtnRect.size.height;
- [pBtn setFrame: aBtnRect];
-
- // align label
- aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
- [pTextView setFrame: aTextRect];
- // update nCurY
- nCurY = aBtnRect.origin.y - 5;
+ addList( pCurParent, nCurX, nCurY, nAttachOffset,
+ aText, aPropertyName, aChoices, aSelectVal,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
- else if( (aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) || aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) )) && pCurParent )
+ else if( (aCtrlType.equalsAscii( "Edit" ) || aCtrlType.equalsAscii( "Range" )) && pCurParent )
{
- sal_Int32 nOff = 0;
- if( aText.getLength() )
- {
- // add a label
- NSControl* pTextView = createLabel( aText );
- [pCurParent addSubview: [pTextView autorelease]];
-
- aLeftColumn.push_back( ColumnItem( pTextView ) );
-
- // move to nCurY
- NSRect aTextRect = [pTextView frame];
- aTextRect.origin.x = nCurX + nAttachOffset;
- aTextRect.origin.y = nCurY - aTextRect.size.height;
- [pTextView setFrame: aTextRect];
-
- // update nCurY
- nCurY = aTextRect.origin.y - 5;
-
- // and set the offset for the real edit field
- nOff = aTextRect.size.width + 5;
- }
-
- NSRect aFieldRect = { { nCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
- NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
- [pFieldView setEditable: YES];
- [pFieldView setSelectable: YES];
- [pFieldView setDrawsBackground: YES];
- [pFieldView sizeToFit]; // FIXME: this does nothing
- [pCurParent addSubview: [pFieldView autorelease]];
-
- aRightColumn.push_back( ColumnItem( pFieldView ) );
-
- // add the field to observed controls for enabled state changes
- // also add a tag just for this purpose
- pControllerProperties->addObservedControl( pFieldView );
- int nTag = pControllerProperties->addNameTag( aPropertyName );
- [pFieldView setTag: nTag];
- // pControllerProperties->addNamedView( pFieldView, aPropertyName );
-
- // move to nCurY
- aFieldRect.origin.y = nCurY - aFieldRect.size.height;
- [pFieldView setFrame: aFieldRect];
-
// current value
PropertyValue* pVal = pController->getValue( aPropertyName );
- if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
- {
- // add a stepper control
- NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
- aFieldRect.origin.y },
- { 15, aFieldRect.size.height } };
- NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
- [pStep setIncrement: 1];
- [pStep setValueWraps: NO];
- [pStep setTag: nTag];
- [pCurParent addSubview: [pStep autorelease]];
-
- aRightColumn.back().pSubControl = pStep;
-
- pControllerProperties->addObservedControl( pStep );
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggered:)];
-
- // constrain the text field to decimal numbers
- NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
- [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
- [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
- [pFormatter setAllowsFloats: NO];
- [pFormatter setMaximumFractionDigits: 0];
- if( nMinValue != nMaxValue )
- {
- [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
- [pStep setMinValue: nMinValue];
- [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
- [pStep setMaxValue: nMaxValue];
- }
- [pFieldView setFormatter: pFormatter];
-
- sal_Int64 nSelectVal = 0;
- if( pVal && pVal->Value.hasValue() )
- pVal->Value >>= nSelectVal;
-
- [pFieldView setIntValue: nSelectVal];
- [pStep setIntValue: nSelectVal];
-
- pControllerProperties->addViewPair( pFieldView, pStep );
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggeredNumeric:)];
- [pStep setTarget: pCtrlTarget];
- [pStep setAction: @selector(triggeredNumeric:)];
- }
- else
- {
- // connect target and action
- [pFieldView setTarget: pCtrlTarget];
- [pFieldView setAction: @selector(triggered:)];
-
- if( pVal && pVal->Value.hasValue() )
- {
- rtl::OUString aValue;
- pVal->Value >>= aValue;
- if( aValue.getLength() )
- {
- NSString* pText = CreateNSString( aValue );
- [pFieldView setStringValue: pText];
- [pText release];
- }
- }
- }
-
- // update nCurY
- nCurY = aFieldRect.origin.y - 5;
-
+ addEdit( pCurParent, nCurX, nCurY, nAttachOffset,
+ aCtrlType, aText, aPropertyName, pVal,
+ nMinValue, nMaxValue,
+ aLeftColumn, aRightColumn,
+ pControllerProperties, pCtrlTarget );
}
}
else
@@ -1205,7 +1354,7 @@ static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
OSL_FAIL( "Unsupported UI option" );
}
}
-
+
pControllerProperties->updateEnableState();
adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm
index ae42c5c09e8d..11b4b9088591 100755
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -44,7 +44,7 @@
return self;
}
--(MacOSBOOL)knowsPageRange: (NSRangePointer)range
+-(BOOL)knowsPageRange: (NSRangePointer)range
{
range->location = 1;
range->length = mpInfoPrinter->getCurPageRangeCount();
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index f79da3559b35..3a88422a2160 100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -267,7 +267,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_STRONG) != 0 )
{
// control BiDi defaults
- MacOSBOOL nLineDirTag = kATSULeftToRightBaseDirection;
+ BOOL nLineDirTag = kATSULeftToRightBaseDirection;
if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) != 0 )
nLineDirTag = kATSURightToLeftBaseDirection;
aTagAttrs[0] = kATSULineDirectionTag;
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 2a531f243de2..7fc5ff74ed2e 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -105,7 +105,7 @@ bool AquaSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const Size& rSize, USHORT nBits, const BitmapPalette& rBitmapPalette )
+bool AquaSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette )
{
if( !isValidBitCount( nBits ) )
return false;
@@ -132,7 +132,7 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics )
// ------------------------------------------------------------------
-bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount )
+bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount )
{
const AquaSalBitmap& rSourceBitmap = static_cast<const AquaSalBitmap&>(rSalBmp);
@@ -568,7 +568,7 @@ Size AquaSalBitmap::GetSize() const
// ------------------------------------------------------------------
-USHORT AquaSalBitmap::GetBitCount() const
+sal_uInt16 AquaSalBitmap::GetBitCount() const
{
return mnBits;
}
@@ -577,9 +577,9 @@ USHORT AquaSalBitmap::GetBitCount() const
static struct pal_entry
{
- BYTE mnRed;
- BYTE mnGreen;
- BYTE mnBlue;
+ sal_uInt8 mnRed;
+ sal_uInt8 mnGreen;
+ sal_uInt8 mnBlue;
}
const aImplSalSysPalEntryAry[ 16 ] =
{
@@ -634,9 +634,9 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome )
// own palette (6/6/6)
const int DITHER_PAL_STEPS = 6;
- const BYTE DITHER_PAL_DELTA = 51;
+ const sal_uInt8 DITHER_PAL_DELTA = 51;
int nB, nG, nR;
- BYTE nRed, nGreen, nBlue;
+ sal_uInt8 nRed, nGreen, nBlue;
for( nB=0, nBlue=0; nB < DITHER_PAL_STEPS; nB++, nBlue += DITHER_PAL_DELTA )
{
for( nG=0, nGreen=0; nG < DITHER_PAL_STEPS; nG++, nGreen += DITHER_PAL_DELTA )
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index cd32820f258c..4eadc86ff15d 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -42,6 +42,7 @@
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/svapp.hxx"
+#include "vcl/region.h"
#include "osl/file.hxx"
#include "osl/process.h"
@@ -59,7 +60,7 @@
using namespace vcl;
-typedef unsigned char Boolean; // copied from MacTypes.h, should be properly included
+//typedef unsigned char Boolean; // copied from MacTypes.h, should be properly included
typedef std::vector<unsigned char> ByteVector;
@@ -118,17 +119,15 @@ inline FourCharCode GetTag(const char aTagName[5])
static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
-ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplMacFontData::GetImplFontCharMap() const
{
+ // return the cached charmap
if( mpCharMap )
- {
- // return the cached charmap
- mpCharMap->AddReference();
return mpCharMap;
- }
// set the default charmap
mpCharMap = ImplFontCharMap::GetDefaultMap();
+ mpCharMap->AddReference();
// get the CMAP byte size
ATSFontRef rFont = FMGetATSFontRefFromFont( mnFontId );
@@ -502,9 +501,9 @@ void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics )
// -----------------------------------------------------------------------
-USHORT AquaSalGraphics::GetBitCount() const
+sal_uInt16 AquaSalGraphics::GetBitCount() const
{
- USHORT nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
+ sal_uInt16 nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
return nBits;
}
@@ -611,7 +610,7 @@ void AquaSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void AquaSalGraphics::BeginSetClipRegion( ULONG nRectCount )
+bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
{
// release old clip path
if( mxClipPath )
@@ -619,41 +618,33 @@ void AquaSalGraphics::BeginSetClipRegion( ULONG nRectCount )
CGPathRelease( mxClipPath );
mxClipPath = NULL;
}
-}
-
-// -----------------------------------------------------------------------
-
-BOOL AquaSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( (nWidth <= 0) || (nHeight <= 0) )
- return TRUE;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- const CGRect aClipRect = {{nX,nY},{nWidth,nHeight}};
- CGPathAddRect( mxClipPath, NULL, aClipRect );
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-bool AquaSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& rPolyPolygon )
-{
- if( rPolyPolygon.count() <= 0 )
- return true;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- AddPolyPolygonToPath( mxClipPath, rPolyPolygon, !getAntiAliasB2DDraw(), false );
- return true;
-}
+ mxClipPath = CGPathCreateMutable();
-// -----------------------------------------------------------------------
-
-void AquaSalGraphics::EndSetClipRegion()
-{
+ // set current path, either as polypolgon or sequence of rectangles
+ if( i_rClip.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aClip( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAliasB2DDraw(), false );
+ }
+ else
+ {
+ long nX, nY, nW, nH;
+ ImplRegionInfo aInfo;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if( nW && nH )
+ {
+ CGRect aRect = {{nX,nY}, {nW,nH}};
+ CGPathAddRect( mxClipPath, NULL, aRect );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ }
+ // set the current path as clip region
if( CheckContext() )
SetState();
+ return true;
}
// -----------------------------------------------------------------------
@@ -796,13 +787,13 @@ void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-static void getBoundRect( ULONG nPoints, const SalPoint *pPtAry, long &rX, long& rY, long& rWidth, long& rHeight )
+static void getBoundRect( sal_uLong nPoints, const SalPoint *pPtAry, long &rX, long& rY, long& rWidth, long& rHeight )
{
long nX1 = pPtAry->mnX;
long nX2 = nX1;
long nY1 = pPtAry->mnY;
long nY2 = nY1;
- for( ULONG n = 1; n < nPoints; n++ )
+ for( sal_uLong n = 1; n < nPoints; n++ )
{
if( pPtAry[n].mnX < nX1 )
nX1 = pPtAry[n].mnX;
@@ -826,7 +817,7 @@ static inline void alignLinePoint( const SalPoint* i_pIn, float& o_fX, float& o_
o_fY = static_cast<float>(i_pIn->mnY ) + 0.5;
}
-void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints < 1 )
return;
@@ -842,7 +833,7 @@ void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -854,7 +845,7 @@ void AquaSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints <= 1 )
return;
@@ -882,7 +873,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -892,7 +883,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
{
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
}
@@ -902,7 +893,7 @@ void AquaSalGraphics::drawPolygon( ULONG nPoints, const SalPoint *pPtAry )
// -----------------------------------------------------------------------
-void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, PCONSTSALPOINT *ppPtAry )
+void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry )
{
if( nPolyCount <= 0 )
return;
@@ -912,7 +903,7 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
// find bound rect
long leftX = 0, topY = 0, maxWidth = 0, maxHeight = 0;
getBoundRect( pPoints[0], ppPtAry[0], leftX, topY, maxWidth, maxHeight );
- for( ULONG n = 1; n < nPolyCount; n++ )
+ for( sal_uLong n = 1; n < nPolyCount; n++ )
{
long nX = leftX, nY = topY, nW = maxWidth, nH = maxHeight;
getBoundRect( pPoints[n], ppPtAry[n], nX, nY, nW, nH );
@@ -947,9 +938,9 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
CGContextBeginPath( mrContext );
if( IsPenVisible() )
{
- for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const ULONG nPoints = pPoints[nPoly];
+ const sal_uLong nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
@@ -957,7 +948,7 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
alignLinePoint( pPtAry, fX, fY );
CGContextMoveToPoint( mrContext, fX, fY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
{
alignLinePoint( pPtAry, fX, fY );
CGContextAddLineToPoint( mrContext, fX, fY );
@@ -968,15 +959,15 @@ void AquaSalGraphics::drawPolyPolygon( ULONG nPolyCount, const ULONG *pPoints, P
}
else
{
- for( ULONG nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ for( sal_uLong nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
- const ULONG nPoints = pPoints[nPoly];
+ const sal_uLong nPoints = pPoints[nPoly];
if( nPoints > 1 )
{
const SalPoint *pPtAry = ppPtAry[nPoly];
CGContextMoveToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
pPtAry++;
- for( ULONG nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
+ for( sal_uLong nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++ )
CGContextAddLineToPoint( mrContext, pPtAry->mnX, pPtAry->mnY );
CGContextClosePath(mrContext);
}
@@ -1101,22 +1092,22 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
return sal_False;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints,
- const SalPoint* const* pPtAry, const BYTE* const* pFlgAry )
+sal_Bool AquaSalGraphics::drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints,
+ const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry )
{
return sal_False;
}
@@ -1202,7 +1193,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGrap
// -----------------------------------------------------------------------
-void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, USHORT nFlags )
+void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, sal_uInt16 nFlags )
{
ApplyXorContext();
@@ -1429,7 +1420,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn
// -----------------------------------------------------------------------
-void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
CGPoint* CGpoints ;
if ( CheckContext() )
@@ -1466,8 +1457,8 @@ void AquaSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert
// -----------------------------------------------------------------------
-BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
- void* pEpsData, ULONG nByteCount )
+sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
+ void* pEpsData, sal_uLong nByteCount )
{
// convert the raw data to an NSImageRef
NSData* xNSData = [NSData dataWithBytes:(void*)pEpsData length:(int)nByteCount];
@@ -1636,7 +1627,7 @@ void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackL
// -----------------------------------------------------------------------
-ULONG AquaSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong AquaSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
return 0;
}
@@ -1817,7 +1808,7 @@ static OSStatus GgoMoveToProc( const Float32Point* pPoint, void* pData )
return eStatus;
}
-BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
+sal_Bool AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
{
GgoData aGgoData;
aGgoData.mpPolyPoly = &rPolyPoly;
@@ -1859,7 +1850,7 @@ long AquaSalGraphics::GetGraphicsWidth() const
// -----------------------------------------------------------------------
-BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
+sal_Bool AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
{
ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
GlyphID aGlyphId = nGlyphId;
@@ -1892,7 +1883,7 @@ void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
// -----------------------------------------------------------------------
-USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
+sal_uInt16 AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLevel )
{
if( !pReqFont )
{
@@ -2026,7 +2017,7 @@ USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLeve
// -----------------------------------------------------------------------
-ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
{
if( !mpMacFontData )
return ImplFontCharMap::GetDefaultMap();
@@ -2217,10 +2208,10 @@ static bool GetRawFontData( const ImplFontData* pFontData,
DBG_ASSERT( (nOfs==nTotalLen), "AquaSalGraphics::CreateFontSubset (nOfs!=nTotalLen)");
- return true;
+ return sal_True;
}
-BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFontData, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2229,7 +2220,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// prepare the requested file name for writing the font-subset file
rtl::OUString aSysPath;
if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
- return FALSE;
+ return sal_False;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
@@ -2290,7 +2281,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// subset glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- USHORT aShortIDs[ 256 ];
+ sal_uInt16 aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef = -1;
@@ -2310,7 +2301,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical );
}
}
- aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
+ aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2338,7 +2329,7 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
TTSimpleGlyphMetrics* pGlyphMetrics =
::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical );
if( !pGlyphMetrics )
- return FALSE;
+ return sal_False;
sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv;
pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv;
pGlyphMetrics[nNotDef].adv = nNotDefAdv;
@@ -2396,8 +2387,10 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
const ImplFontCharMap* pMap = mpMacFontData->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no charmap" );
+ pMap->AddReference(); // TODO: add and use RAII object instead
// get unicode<->glyph encoding
+ // TODO? avoid sft mapping by using the pMap itself
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
for(; --nCharCount >= 0; nChar = pMap->GetNextChar( nChar ) )
@@ -2409,6 +2402,8 @@ void AquaSalGraphics::GetGlyphWidths( const ImplFontData* pFontData, bool bVerti
if( nGlyph > 0 )
rUnicodeEnc[ nUcsChar ] = nGlyph;
}
+
+ pMap->DeReference(); // TODO: add and use RAII object instead
}
::CloseTTFont( pSftFont );
@@ -2625,24 +2620,24 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
nBytesPerRow = 1;
}
nBytesPerRow *= nWidth;
- mnBufferLongs = (nHeight * nBytesPerRow + sizeof(ULONG)-1) / sizeof(ULONG);
+ mnBufferLongs = (nHeight * nBytesPerRow + sizeof(sal_uLong)-1) / sizeof(sal_uLong);
// create a XorMask context
- mpMaskBuffer = new ULONG[ mnBufferLongs ];
+ mpMaskBuffer = new sal_uLong[ mnBufferLongs ];
mxMaskContext = ::CGBitmapContextCreate( mpMaskBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
// reset the XOR mask to black
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(ULONG) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
// a bitmap context will be needed for manual XORing
// create one unless the target context is a bitmap context
if( nTargetDepth )
- mpTempBuffer = (ULONG*)CGBitmapContextGetData( mxTargetContext );
+ mpTempBuffer = (sal_uLong*)CGBitmapContextGetData( mxTargetContext );
if( !mpTempBuffer )
{
// create a bitmap context matching to the target context
- mpTempBuffer = new ULONG[ mnBufferLongs ];
+ mpTempBuffer = new sal_uLong[ mnBufferLongs ];
mxTempContext = ::CGBitmapContextCreate( mpTempBuffer,
nWidth, nHeight, nBitsPerComponent, nBytesPerRow,
aCGColorSpace, aCGBmpInfo );
@@ -2682,8 +2677,8 @@ bool XorEmulation::UpdateTarget()
// do a manual XOR with the XorMask
// this approach suffices for simple color manipulations
// and also the complex-clipping-XOR-trick used in metafiles
- const ULONG* pSrc = mpMaskBuffer;
- ULONG* pDst = mpTempBuffer;
+ const sal_uLong* pSrc = mpMaskBuffer;
+ sal_uLong* pDst = mpTempBuffer;
for( int i = mnBufferLongs; --i >= 0;)
*(pDst++) ^= *(pSrc++);
@@ -2701,7 +2696,7 @@ bool XorEmulation::UpdateTarget()
// reset the XorMask to black again
// TODO: not needed for last update
- memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(ULONG) );
+ memset( mpMaskBuffer, 0, mnBufferLongs * sizeof(sal_uLong) );
// TODO: return FALSE if target was not changed
return true;
diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx
index 56d40d3c7e72..22316a50da8d 100644
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -254,12 +254,12 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh
}
}
-CGPoint* AquaSalGraphics::makeCGptArray(ULONG nPoints, const SalPoint* pPtAry)
+CGPoint* AquaSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry)
{
CGPoint *CGpoints = new (CGPoint[nPoints]);
if ( CGpoints )
{
- for(ULONG i=0;i<nPoints;i++)
+ for(sal_uLong i=0;i<nPoints;i++)
{
CGpoints[i].x = (float)(pPtAry[i].mnX);
CGpoints[i].y = (float)(pPtAry[i].mnY);
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 4e40bfa7077d..1ad5f5d3919c 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -237,13 +237,13 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
/*
* IsNativeControlSupported()
* --------------------------
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart.
*
*/
-BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
- bool bOk = FALSE;
+ bool bOk = sal_False;
// Native controls are now defaults
// If you want to disable experimental native controls code,
@@ -372,18 +372,18 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
/*
* HitTestNativeControl()
*
- * If the return value is TRUE, bIsInside contains information whether
+ * If the return value is sal_True, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& rPos, BOOL& rIsInside )
+sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& rPos, sal_Bool& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
Rectangle aRect;
bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
- rIsInside = bValid ? aRect.IsInside( rPos ) : FALSE;
+ rIsInside = bValid ? aRect.IsInside( rPos ) : sal_False;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
// in double max mode the actual trough is a little smaller than the track
@@ -394,20 +394,20 @@ BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
{
// the left 4 pixels are not hit sensitive
if( rPos.X() - aRect.Left() < 4 )
- rIsInside = FALSE;
+ rIsInside = sal_False;
}
else if( nPart == PART_TRACK_VERT_AREA )
{
// the top 4 pixels are not hit sensitive
if( rPos.Y() - aRect.Top() < 4 )
- rIsInside = FALSE;
+ rIsInside = sal_False;
}
}
}
return bValid;
} // CTRL_SCROLLBAR
- return FALSE;
+ return sal_False;
}
/*
@@ -467,14 +467,14 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState )
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
+sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- BOOL bOK = FALSE;
+ sal_Bool bOK = sal_False;
if( ! CheckContext() )
return false;
@@ -1148,7 +1148,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
case CTRL_FRAME:
{
- USHORT nStyle = aValue.getNumericVal();
+ sal_uInt16 nStyle = aValue.getNumericVal();
if( nPart == PART_BORDER ) {
if(!( nStyle & FRAME_DRAW_MENU ) && !(nStyle & FRAME_DRAW_WINDOWBORDER) )
{
@@ -1225,18 +1225,18 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
+ * If the return value is sal_True, rNativeBoundingRegion
* contains the true bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
@@ -1246,12 +1246,12 @@ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPar
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+sal_Bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- BOOL toReturn = FALSE;
+ sal_Bool toReturn = sal_False;
Rectangle aCtrlBoundRect( rControlRegion );
short x = aCtrlBoundRect.Left();
@@ -1286,7 +1286,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
Rectangle aRect;
if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) )
{
- toReturn = TRUE;
+ toReturn = sal_True;
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
}
@@ -1316,7 +1316,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_PROGRESS:
@@ -1328,7 +1328,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
aRect.Bottom() = aRect.Top() + 15; // values taken from HIG for large progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
@@ -1338,7 +1338,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress
rNativeBoundingRegion = aRect;
rNativeContentRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
@@ -1354,7 +1354,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
break;
@@ -1370,7 +1370,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_LISTBOX:
@@ -1384,7 +1384,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_DOWN )
{
@@ -1433,7 +1433,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y ), Size( w-2*FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_SUB_EDIT ) {
w = aCtrlBoundRect.GetWidth() - SPIN_BUTTON_SPACE - SPIN_BUTTON_WIDTH;
@@ -1446,7 +1446,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_UP ) {
//aCtrlBoundRect.GetWidth() contains the width of the full control
@@ -1460,7 +1460,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
else if( nPart == PART_BUTTON_DOWN ) {
x += aCtrlBoundRect.GetWidth() - SPIN_BUTTON_WIDTH - SPIN_BUTTON_SPACE - CLIP_FUZZ;
@@ -1471,12 +1471,12 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
break;
case CTRL_FRAME:
{
- USHORT nStyle = aValue.getNumericVal();
+ sal_uInt16 nStyle = aValue.getNumericVal();
if( ( nPart == PART_BORDER ) &&
!( nStyle & (FRAME_DRAW_MENU | FRAME_DRAW_WINDOWBORDER | FRAME_DRAW_BORDERWINDOWBORDER) ) )
{
@@ -1499,7 +1499,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = aRect;
rNativeBoundingRegion = aRect;
- toReturn = TRUE;
+ toReturn = sal_True;
}
}
break;
@@ -1515,7 +1515,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) );
- toReturn = TRUE;
+ toReturn = sal_True;
}
}
break;
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index 3d6eba93a59b..3e25d9eb111d 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -174,9 +174,9 @@ void AquaSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
+sal_Bool AquaSalInfoPrinter::Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -249,14 +249,14 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight )
return aPaper;
}
-BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
+sal_Bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
{
// FIXME: implement driver data
if( io_pSetupData && io_pSetupData->mpDriverData )
return SetData( ~0, io_pSetupData );
- BOOL bSuccess = TRUE;
+ sal_Bool bSuccess = sal_True;
// set system type
io_pSetupData->mnSystem = JOBSETUP_SYSTEM_MAC;
@@ -283,11 +283,11 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
io_pSetupData->meOrientation = mePageOrientation;
io_pSetupData->mnPaperBin = 0;
- io_pSetupData->mpDriverData = reinterpret_cast<BYTE*>(rtl_allocateMemory( 4 ));
+ io_pSetupData->mpDriverData = reinterpret_cast<sal_uInt8*>(rtl_allocateMemory( 4 ));
io_pSetupData->mnDriverDataLen = 4;
}
else
- bSuccess = FALSE;
+ bSuccess = sal_False;
return bSuccess;
@@ -317,10 +317,10 @@ void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientatio
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
+sal_Bool AquaSalInfoPrinter::SetData( sal_uLong i_nFlags, ImplJobSetup* io_pSetupData )
{
if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC )
- return FALSE;
+ return sal_False;
if( mpPrintInfo )
@@ -358,14 +358,14 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
// -----------------------------------------------------------------------
-ULONG AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
+sal_uLong AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* i_pSetupData )
{
return 0;
}
// -----------------------------------------------------------------------
-XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin )
+XubString AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin )
{
return XubString();
}
@@ -378,14 +378,14 @@ static bool getUseNativeDialog()
try
{
// get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
// create configuration hierachical access name
if( xSMgr.is() )
{
try
{
- Reference< XMultiServiceFactory > xConfigProvider(
- Reference< XMultiServiceFactory >(
+ uno::Reference< XMultiServiceFactory > xConfigProvider(
+ uno::Reference< XMultiServiceFactory >(
xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationProvider" ))),
UNO_QUERY )
@@ -397,8 +397,8 @@ static bool getUseNativeDialog()
aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
aVal.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Misc" ) );
aArgs.getArray()[0] <<= aVal;
- Reference< XNameAccess > xConfigAccess(
- Reference< XNameAccess >(
+ uno::Reference< XNameAccess > xConfigAccess(
+ uno::Reference< XNameAccess >(
xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess" )),
aArgs ),
@@ -434,7 +434,7 @@ static bool getUseNativeDialog()
return bNative;
}
-ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USHORT i_nType )
+sal_uLong AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType )
{
switch( i_nType )
{
@@ -458,6 +458,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return getUseNativeDialog() ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
return 1;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ return 1;
default: break;
};
return 0;
@@ -514,7 +516,7 @@ static Size getPageSize( vcl::PrinterController& i_rController, sal_Int32 i_nPag
return aPageSize;
}
-BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
+sal_Bool AquaSalInfoPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -522,9 +524,9 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
)
{
if( mbJob )
- return FALSE;
+ return sal_False;
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
bool bWasAborted = false;
AquaSalInstance* pInst = GetSalData()->mpFirstInstance;
PrintAccessoryViewState aAccViewState;
@@ -659,7 +661,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
if( bShowPanel && mnCurPageRangeStart == 0 && nCurJob == 0) // only the first range of pages (in the first job) gets the accesory view
pReleaseAfterUse = [AquaPrintAccessoryView setupPrinterPanel: pPrintOperation withController: &i_rController withState: &aAccViewState];
- bSuccess = TRUE;
+ bSuccess = sal_True;
mbJob = true;
pInst->startedPrintJob();
[pPrintOperation runOperation];
@@ -677,7 +679,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// inform application that it can release its data
// this is awkward, but the XRenderable interface has no method for this,
- // so we need to call XRenderadble::render one last time with IsLastPage = TRUE
+ // so we need to call XRenderadble::render one last time with IsLastPage = sal_True
i_rController.setLastPage( sal_True );
GDIMetaFile aPageFile;
if( mrContext )
@@ -695,26 +697,26 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::EndJob()
+sal_Bool AquaSalInfoPrinter::EndJob()
{
mnStartPageOffsetX = mnStartPageOffsetY = 0;
mbJob = false;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::AbortJob()
+sal_Bool AquaSalInfoPrinter::AbortJob()
{
mbJob = false;
// FIXME: implementation
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
+SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
{
if( i_bNewJobData && i_pSetupData )
SetPrinterData( i_pSetupData );
@@ -728,15 +730,15 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_b
// -----------------------------------------------------------------------
-BOOL AquaSalInfoPrinter::EndPage()
+sal_Bool AquaSalInfoPrinter::EndPage()
{
mpGraphics->InvalidateContext();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG AquaSalInfoPrinter::GetErrorCode() const
+sal_uLong AquaSalInfoPrinter::GetErrorCode() const
{
return 0;
}
@@ -756,7 +758,7 @@ AquaSalPrinter::~AquaSalPrinter()
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
+sal_Bool AquaSalPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
@@ -767,49 +769,49 @@ BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::StartJob( const XubString* i_pFileName,
+sal_Bool AquaSalPrinter::StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies,
+ sal_uLong i_nCopies,
bool i_bCollate,
bool i_bDirect,
ImplJobSetup* i_pSetupData )
{
OSL_FAIL( "should never be called" );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::EndJob()
+sal_Bool AquaSalPrinter::EndJob()
{
return mpInfoPrinter->EndJob();
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::AbortJob()
+sal_Bool AquaSalPrinter::AbortJob()
{
return mpInfoPrinter->AbortJob();
}
// -----------------------------------------------------------------------
-SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData )
+SalGraphics* AquaSalPrinter::StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData )
{
return mpInfoPrinter->StartPage( i_pSetupData, i_bNewJobData );
}
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::EndPage()
+sal_Bool AquaSalPrinter::EndPage()
{
return mpInfoPrinter->EndPage();
}
// -----------------------------------------------------------------------
-ULONG AquaSalPrinter::GetErrorCode()
+sal_uLong AquaSalPrinter::GetErrorCode()
{
return mpInfoPrinter->GetErrorCode();
}
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index de09867e4071..2aa8357b28f6 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -34,13 +34,14 @@
#include "salgdi.h"
#include "saldata.hxx"
#include "salframe.h"
+#include <vcl/svapp.hxx>
#include "vcl/sysdata.hxx"
// -----------------------------------------------------------------------
SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
- long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
// #i92075# can be called first in a thread
SalData::ensureThreadAutoreleasePool();
@@ -57,7 +58,7 @@ void AquaSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
// =======================================================================
-AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
: mbGraphicsUsed( false )
, mxBitmapContext( NULL )
, mnBitmapDepth( 0 )
@@ -156,7 +157,7 @@ void AquaSalVirtualDevice::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
{
if( mbForeignContext )
{
@@ -198,9 +199,27 @@ BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY )
pSalFrame = *GetSalData()->maFrames.begin();
if( pSalFrame )
{
- NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pSalFrame->getWindow()];
- if( pNSContext )
- xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
+ // #i91990#
+ NSWindow* pWindow = pSalFrame->getWindow();
+ if ( pWindow )
+ {
+ NSGraphicsContext* pNSContext = [NSGraphicsContext graphicsContextWithWindow: pWindow];
+ if( pNSContext )
+ xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]);
+ }
+ else
+ {
+ // fall back to a bitmap context
+ mnBitmapDepth = 32;
+ const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
+ const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
+ const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
+
+ void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY );
+ mxBitmapContext = ::CGBitmapContextCreate( pRawData, nDX, nDY,
+ 8, nBytesPerRow, aCGColorSpace, aCGBmpInfo );
+ xCGContext = mxBitmapContext;
+ }
}
}
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index ca99a2ca6a2d..9c136fba262e 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -62,7 +62,7 @@ AquaSalFrame* AquaSalFrame::s_pCaptureFrame = NULL;
// =======================================================================
-AquaSalFrame::AquaSalFrame( SalFrame* pParent, ULONG salFrameStyle ) :
+AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) :
mpWindow(nil),
mpView(nil),
mpDockMenuEntry(nil),
@@ -192,8 +192,17 @@ void AquaSalFrame::initWindowAndView()
mnStyleMask |= NSTitledWindowMask;
}
+ // #i91990# support GUI-less (daemon) execution
+ @try
+ {
mpWindow = [[SalFrameWindow alloc] initWithSalFrame: this];
mpView = [[SalFrameView alloc] initWithSalFrame: this];
+ }
+ @catch ( id exception )
+ {
+ return;
+ }
+
if( (mnStyle & SAL_FRAME_STYLE_TOOLTIP) )
[mpWindow setIgnoresMouseEvents: YES];
else
@@ -208,8 +217,6 @@ void AquaSalFrame::initWindowAndView()
UpdateFrameGeometry();
- // setContentView causes a display; in multithreaded use this can deadlock
- //YieldMutexReleaser aRel;
[mpWindow setContentView: mpView];
}
@@ -285,7 +292,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
// -----------------------------------------------------------------------
-BOOL AquaSalFrame::PostEvent( void *pData )
+sal_Bool AquaSalFrame::PostEvent( void *pData )
{
GetSalData()->mpFirstInstance->PostUserEvent( this, SALEVENT_USEREVENT, pData );
return TRUE;
@@ -294,11 +301,17 @@ BOOL AquaSalFrame::PostEvent( void *pData )
// -----------------------------------------------------------------------
void AquaSalFrame::SetTitle(const XubString& rTitle)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSString* pTitle = CreateNSString( rTitle );
[mpWindow setTitle: pTitle];
// create an entry in the dock menu
- const ULONG nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
+ const sal_uLong nAppWindowStyle = (SAL_FRAME_STYLE_CLOSEABLE | SAL_FRAME_STYLE_MOVEABLE);
if( mpParent == NULL &&
(mnStyle & nAppWindowStyle) == nAppWindowStyle )
{
@@ -324,7 +337,7 @@ void AquaSalFrame::SetTitle(const XubString& rTitle)
// -----------------------------------------------------------------------
-void AquaSalFrame::SetIcon( USHORT )
+void AquaSalFrame::SetIcon( sal_uInt16 )
{
}
@@ -332,6 +345,9 @@ void AquaSalFrame::SetIcon( USHORT )
void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 )
{
rtl::OUString aSysPath;
@@ -357,12 +373,12 @@ void AquaSalFrame::initShow()
if( mpParent ) // center relative to parent
{
// center on parent
- long nNewX = mpParent->maGeometry.nX + (mpParent->maGeometry.nWidth - maGeometry.nWidth)/2;
+ long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2;
if( nNewX < aScreenRect.Left() )
nNewX = aScreenRect.Left();
if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() )
nNewX = aScreenRect.Right() - maGeometry.nWidth-1;
- long nNewY = mpParent->maGeometry.nY + (mpParent->maGeometry.nHeight - maGeometry.nHeight)/2;
+ long nNewY = mpParent->maGeometry.nY + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2;
if( nNewY < aScreenRect.Top() )
nNewY = aScreenRect.Top();
if( nNewY > aScreenRect.Bottom() )
@@ -400,8 +416,14 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect )
// -----------------------------------------------------------------------
-void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
+void AquaSalFrame::Show(sal_Bool bVisible, sal_Bool bNoActivate)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mbShown = bVisible;
if(bVisible)
{
@@ -412,8 +434,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
// trigger filling our backbuffer
SendPaintEvent();
- //YieldMutexReleaser aRel;
-
if( bNoActivate || [mpWindow canBecomeKeyWindow] == NO )
[mpWindow orderFront: NSApp];
else
@@ -444,8 +464,6 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
if( mpMenu && mpMenu->mbMenuBar && AquaSalMenu::pCurrentMenuBar == mpMenu )
AquaSalMenu::setDefaultMenu();
- //YieldMutexReleaser aRel;
-
// #i90440# #i94443# work around the focus going back to some other window
// if a child gets hidden for a parent window
if( mpParent && mpParent->mbShown && [mpWindow isKeyWindow] )
@@ -461,7 +479,7 @@ void AquaSalFrame::Show(BOOL bVisible, BOOL bNoActivate)
// -----------------------------------------------------------------------
-void AquaSalFrame::Enable( BOOL bEnable )
+void AquaSalFrame::Enable( sal_Bool bEnable )
{
}
@@ -469,6 +487,9 @@ void AquaSalFrame::Enable( BOOL bEnable )
void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMinWidth = nWidth;
mnMinHeight = nHeight;
@@ -491,6 +512,9 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
mnMaxWidth = nWidth;
mnMaxHeight = nHeight;
@@ -517,6 +541,9 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mpWindow )
{
NSSize aSize = { nWidth, nHeight };
@@ -549,6 +576,11 @@ void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
void AquaSalFrame::SetWindowState( const SalFrameState* pState )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ if ( mpWindow )
+ {
// set normal state
NSRect aStateRect = [mpWindow frame];
aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
@@ -564,18 +596,33 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
VCLToCocoa( aStateRect );
aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
- // relase and acquire mutex again since this call can block waiting for an internal lock
+ [mpWindow setFrame: aStateRect display: NO];
+ if( pState->mnState == SAL_FRAMESTATE_MINIMIZED )
+ [mpWindow miniaturize: NSApp];
+ else if( [mpWindow isMiniaturized] )
+ [mpWindow deminiaturize: NSApp];
+
+
+ /* ZOOMED is not really maximized (actually it toggles between a user set size and
+ the program specified one), but comes closest since the default behavior is
+ "maximized" if the user did not intervene
+ */
+ if( pState->mnState == SAL_FRAMESTATE_MAXIMIZED )
{
- //YieldMutexReleaser aRel;
- [mpWindow setFrame: aStateRect display: NO];
+ if(! [mpWindow isZoomed])
+ [mpWindow zoom: NSApp];
+ }
+ else
+ {
+ if( [mpWindow isZoomed] )
+ [mpWindow zoom: NSApp];
+ }
}
-
- // FIXME: HTH maximized state ?
// get new geometry
UpdateFrameGeometry();
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_X) )
{
mbPositioned = true;
@@ -591,22 +638,26 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
if( nEvent )
CallCallback( nEvent, NULL );
- if( mbShown )
+ if( mbShown && mpWindow )
{
// trigger filling our backbuffer
SendPaintEvent();
// tell the system the views need to be updated
- //YieldMutexReleaser aRel;
-
[mpWindow display];
}
}
// -----------------------------------------------------------------------
-BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool AquaSalFrame::GetWindowState( SalFrameState* pState )
{
+ if ( !mpWindow )
+ return FALSE;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
pState->mnMask = SAL_FRAMESTATE_MASK_X |
SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH |
@@ -621,8 +672,6 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
pState->mnWidth = long(aStateRect.size.width);
pState->mnHeight = long(aStateRect.size.height);
- // FIXME: HTH maximized state ?
-
if( [mpWindow isMiniaturized] )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
else if( ! [mpWindow isZoomed] )
@@ -637,6 +686,12 @@ BOOL AquaSalFrame::GetWindowState( SalFrameState* pState )
void AquaSalFrame::SetScreenNumber(unsigned int nScreen)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSArray* pScreens = [NSScreen screens];
Rectangle aRet;
NSScreen* pScreen = nil;
@@ -670,8 +725,14 @@ void AquaSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
+void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( mbFullScreen == bFullScreen )
return;
@@ -730,7 +791,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
maFullScreenRect = [mpWindow frame];
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aNewContentRect styleMask: mnStyleMask] display: mbShown ? YES : NO];
}
@@ -742,7 +802,6 @@ void AquaSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
else
{
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: maFullScreenRect display: mbShown ? YES : NO];
}
UpdateFrameGeometry();
@@ -779,8 +838,14 @@ public:
}
};
-void AquaSalFrame::StartPresentation( BOOL bStart )
+void AquaSalFrame::StartPresentation( sal_Bool bStart )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( bStart )
{
mpActivityTimer.reset( new PreventSleepTimer() );
@@ -797,14 +862,23 @@ void AquaSalFrame::StartPresentation( BOOL bStart )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void AquaSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
}
// -----------------------------------------------------------------------
-void AquaSalFrame::ToTop(USHORT nFlags)
+void AquaSalFrame::ToTop(sal_uInt16 nFlags)
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! (nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN) )
{
if( ! [mpWindow isVisible] || [mpWindow isMiniaturized] )
@@ -858,6 +932,12 @@ NSCursor* AquaSalFrame::getCurrentCursor() const
void AquaSalFrame::SetPointer( PointerStyle ePointerStyle )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ePointerStyle >= POINTER_COUNT || ePointerStyle == mePointerStyle )
return;
mePointerStyle = ePointerStyle;
@@ -884,6 +964,10 @@ void AquaSalFrame::Flush( void )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+
[mpView setNeedsDisplay: YES];
// outside of the application's event loop (e.g. IntroWindow)
@@ -902,6 +986,9 @@ void AquaSalFrame::Flush( const Rectangle& rRect )
if( !(mbGraphics && mpGraphics && mpView && mbShown) )
return;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } };
VCLToCocoa( aNSRect, false );
[mpView setNeedsDisplayInRect: aNSRect];
@@ -921,7 +1008,8 @@ void AquaSalFrame::Sync()
{
if( mbGraphics && mpGraphics && mpView && mbShown )
{
- //YieldMutexReleaser aRel;
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
[mpView setNeedsDisplay: YES];
[mpView display];
@@ -946,18 +1034,18 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void AquaSalFrame::EndExtTextInput( USHORT nFlags )
+void AquaSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
}
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
+XubString AquaSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
- static std::map< USHORT, rtl::OUString > aKeyMap;
+ static std::map< sal_uInt16, rtl::OUString > aKeyMap;
if( aKeyMap.empty() )
{
- USHORT i;
+ sal_uInt16 i;
for( i = KEY_A; i <= KEY_Z; i++ )
aKeyMap[ i ] = rtl::OUString( sal_Unicode( 'A' + (i - KEY_A) ) );
for( i = KEY_0; i <= KEY_9; i++ )
@@ -1018,8 +1106,8 @@ XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
rtl::OUStringBuffer aResult( 16 );
- USHORT nUnmodifiedCode = (nKeyCode & KEY_CODE);
- std::map< USHORT, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
+ sal_uInt16 nUnmodifiedCode = (nKeyCode & KEY_CODE);
+ std::map< sal_uInt16, rtl::OUString >::const_iterator it = aKeyMap.find( nUnmodifiedCode );
if( it != aKeyMap.end() )
{
if( (nKeyCode & KEY_SHIFT) != 0 )
@@ -1039,7 +1127,7 @@ XubString AquaSalFrame::GetKeyName( USHORT nKeyCode )
// -----------------------------------------------------------------------
-XubString AquaSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString AquaSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -1145,6 +1233,12 @@ void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY )
// doesn't make the anything cleaner for now
void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
[mpView lockFocus];
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
@@ -1256,9 +1350,15 @@ void AquaSalFrame::Beep( SoundType eSoundType )
// -----------------------------------------------------------------------
-void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHORT nFlags)
+void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
{
- USHORT nEvent = 0;
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
+ sal_uInt16 nEvent = 0;
if( [mpWindow isMiniaturized] )
[mpWindow deminiaturize: NSApp]; // expand the window
@@ -1322,7 +1422,6 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
// do not display yet, we need to update our backbuffer
{
- //YieldMutexReleaser aRel;
[mpWindow setFrame: [NSWindow frameRectForContentRect: aContentRect styleMask: mnStyleMask] display: NO];
}
@@ -1337,13 +1436,18 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, USHOR
SendPaintEvent();
// now inform the system that the views need to be drawn
- //YieldMutexReleaser aRel;
[mpWindow display];
}
}
void AquaSalFrame::GetWorkArea( Rectangle& rRect )
{
+ if ( !mpWindow )
+ return;
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
NSScreen* pScreen = [mpWindow screen];
if( pScreen == nil )
pScreen = [NSScreen mainScreen];
@@ -1357,6 +1461,9 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect )
SalPointerState AquaSalFrame::GetPointerState()
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
SalPointerState state;
state.mnState = 0;
@@ -1444,7 +1551,7 @@ SalFrame::SalIndicatorState AquaSalFrame::GetIndicatorState()
return aState;
}
-void AquaSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
+void AquaSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
{
}
@@ -1457,7 +1564,7 @@ bool AquaSalFrame::SetPluginParent( SystemParentData* pNewParent )
return sal_False;
}
-BOOL AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
return FALSE;
@@ -1475,6 +1582,9 @@ void AquaSalFrame::DrawMenuBar()
void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
AquaSalMenu* pMenu = static_cast<AquaSalMenu*>(pSalMenu);
DBG_ASSERT( ! pMenu || pMenu->mbMenuBar, "setting non menubar on frame" );
mpMenu = pMenu;
@@ -1484,8 +1594,15 @@ void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
{
+ if ( mpWindow )
+ {
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( (mnExtStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) != (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) )
[mpWindow setDocumentEdited: (nStyle & SAL_FRAME_EXT_STYLE_DOCMODIFIED) ? YES : NO];
+ }
+
mnExtStyle = nStyle;
}
@@ -1516,6 +1633,11 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
void AquaSalFrame::UpdateFrameGeometry()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
// keep in mind that view and window coordinates are lower left
// whereas vcl's are upper left
@@ -1559,7 +1681,7 @@ void AquaSalFrame::UpdateFrameGeometry()
// -----------------------------------------------------------------------
-void AquaSalFrame::CaptureMouse( BOOL bCapture )
+void AquaSalFrame::CaptureMouse( sal_Bool bCapture )
{
/* Remark:
we'll try to use a pidgin version of capture mouse
@@ -1588,6 +1710,14 @@ void AquaSalFrame::CaptureMouse( BOOL bCapture )
void AquaSalFrame::ResetClipRegion()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path and indicate no clipping
CGPathRelease( mrClippingPath );
mrClippingPath = NULL;
@@ -1601,8 +1731,16 @@ void AquaSalFrame::ResetClipRegion()
}
}
-void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
+void AquaSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
// release old path
if( mrClippingPath )
{
@@ -1621,6 +1759,9 @@ void AquaSalFrame::BeginSetClipRegion( ULONG nRects )
void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
{
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( nWidth && nHeight )
{
NSRect aRect = { { nX, nY }, { nWidth, nHeight } };
@@ -1631,6 +1772,14 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
void AquaSalFrame::EndSetClipRegion()
{
+ if ( !mpWindow )
+ {
+ return;
+ }
+
+ // #i113170# may not be the main thread if called from UNO API
+ SalData::ensureThreadAutoreleasePool();
+
if( ! maClippingRects.empty() )
{
mrClippingPath = CGPathCreateMutable();
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 8da1bf9f3085..a72810986c76 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -41,9 +41,9 @@
#define WHEEL_EVENT_FACTOR 1.5
-static USHORT ImplGetModifierMask( unsigned int nMask )
+static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
if( (nMask & NSShiftKeyMask) != 0 )
nRet |= KEY_SHIFT;
if( (nMask & NSControlKeyMask) != 0 )
@@ -55,9 +55,9 @@ static USHORT ImplGetModifierMask( unsigned int nMask )
return nRet;
}
-static USHORT ImplMapCharCode( sal_Unicode aCode )
+static sal_uInt16 ImplMapCharCode( sal_Unicode aCode )
{
- static USHORT aKeyCodeMap[ 128 ] =
+ static sal_uInt16 aKeyCodeMap[ 128 ] =
{
0, 0, 0, 0, 0, 0, 0, 0,
KEY_BACKSPACE, KEY_TAB, KEY_RETURN, 0, 0, KEY_RETURN, 0, 0,
@@ -85,7 +85,7 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
// tab alone is reported as 0x09 (as expected) but shift-tab is
// reported as 0x19 (end of medium)
- static USHORT aFunctionKeyCodeMap[ 128 ] =
+ static sal_uInt16 aFunctionKeyCodeMap[ 128 ] =
{
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_F1, KEY_F2, KEY_F3, KEY_F4,
KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12,
@@ -105,7 +105,7 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
0, 0, 0, 0, 0, 0, 0, 0
};
- USHORT nKeyCode = 0;
+ sal_uInt16 nKeyCode = 0;
if( aCode < SAL_N_ELEMENTS( aKeyCodeMap) )
nKeyCode = aKeyCodeMap[ aCode ];
else if( aCode >= 0xf700 && aCode < 0xf780 )
@@ -117,12 +117,12 @@ static USHORT ImplMapCharCode( sal_Unicode aCode )
static AquaSalFrame* s_pMouseFrame = NULL;
// store the last pressed button for enter/exit events
// which lack that information
-static USHORT s_nLastButton = 0;
+static sal_uInt16 s_nLastButton = 0;
// combinations of keys we need to handle ourselves
static const struct ExceptionalKey
{
- const USHORT nKeyCode;
+ const sal_uInt16 nKeyCode;
const unsigned int nModifierMask;
} aExceptionalKeys[] =
{
@@ -155,7 +155,9 @@ static AquaSalFrame* getMouseContainerFrame()
NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
{ pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
pFrame->VCLToCocoa( aRect );
- return [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
+ [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
+ return pNSWindow;
}
-(AquaSalFrame*)getSalFrame
@@ -163,16 +165,30 @@ static AquaSalFrame* getMouseContainerFrame()
return mpFrame;
}
--(MacOSBOOL)containsMouse
+-(void)displayIfNeeded
+{
+ if( GetSalData() && GetSalData()->mpFirstInstance )
+ {
+ osl::SolarMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
+ if( pMutex )
+ {
+ pMutex->acquire();
+ [super displayIfNeeded];
+ pMutex->release();
+ }
+ }
+}
+
+-(BOOL)containsMouse
{
// is this event actually inside that NSWindow ?
NSPoint aPt = [NSEvent mouseLocation];
NSRect aFrameRect = [self frame];
- MacOSBOOL bInRect = NSPointInRect( aPt, aFrameRect );
+ BOOL bInRect = NSPointInRect( aPt, aFrameRect );
return bInRect;
}
--(MacOSBOOL)canBecomeKeyWindow
+-(BOOL)canBecomeKeyWindow
{
if( (mpFrame->mnStyle &
( SAL_FRAME_STYLE_FLOAT |
@@ -195,7 +211,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
- static const ULONG nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
+ static const sal_uLong nGuessDocument = SAL_FRAME_STYLE_MOVEABLE|
SAL_FRAME_STYLE_SIZEABLE|
SAL_FRAME_STYLE_CLOSEABLE;
@@ -285,11 +301,11 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(MacOSBOOL)windowShouldClose: (NSNotification*)pNotification
+-(BOOL)windowShouldClose: (NSNotification*)pNotification
{
YIELD_GUARD;
- MacOSBOOL bRet = YES;
+ BOOL bRet = YES;
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
// #i84461# end possible input
@@ -332,12 +348,12 @@ static AquaSalFrame* getMouseContainerFrame()
[mDraggingDestinationHandler draggingExited: sender];
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler performDragOperation: sender];
}
@@ -393,17 +409,17 @@ static AquaSalFrame* getMouseContainerFrame()
}
}
--(MacOSBOOL)acceptsFirstResponder
+-(BOOL)acceptsFirstResponder
{
return YES;
}
--(MacOSBOOL)acceptsFirstMouse: (NSEvent*)pEvent
+-(BOOL)acceptsFirstMouse: (NSEvent*)pEvent
{
return YES;
}
--(MacOSBOOL)isOpaque
+-(BOOL)isOpaque
{
return mpFrame ? (mpFrame->getClipPath() != 0 ? NO : YES) : YES;
}
@@ -451,7 +467,7 @@ private:
}
}
--(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent
+-(void)sendMouseEventToFrame: (NSEvent*)pEvent button:(sal_uInt16)nButton eventtype:(sal_uInt16)nEvent
{
YIELD_GUARD;
@@ -507,13 +523,13 @@ private:
if( pDispatchFrame && AquaSalFrame::isAlive( pDispatchFrame ) )
{
- pDispatchFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ pDispatchFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
pDispatchFrame->mnLastModifierFlags = [pEvent modifierFlags];
NSPoint aPt = [NSEvent mouseLocation];
pDispatchFrame->CocoaToVCL( aPt );
- USHORT nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
+ sal_uInt16 nModMask = ImplGetModifierMask( [pEvent modifierFlags] );
// #i82284# emulate ctrl left
if( nModMask == KEY_MOD3 && nButton == MOUSE_LEFT )
{
@@ -574,8 +590,11 @@ private:
-(void)mouseEntered: (NSEvent*)pEvent
{
s_pMouseFrame = mpFrame;
-
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
+
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
}
-(void)mouseExited: (NSEvent*)pEvent
@@ -583,7 +602,10 @@ private:
if( s_pMouseFrame == mpFrame )
s_pMouseFrame = NULL;
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
+ // #i107215# the only mouse events we get when inactive are enter/exit
+ // actually we would like to have all of them, but better none than some
+ if( [NSApp isActive] )
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
}
-(void)rightMouseDown: (NSEvent*)pEvent
@@ -641,7 +663,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
const NSTimeInterval fMagnifyTime = [pEvent timestamp];
- mpFrame->mnLastEventTime = static_cast<ULONG>( fMagnifyTime * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( fMagnifyTime * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// check if this is a new series of magnify events
@@ -712,7 +734,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -772,7 +794,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
// merge pending scroll wheel events
@@ -844,7 +866,7 @@ private:
mbNeedSpecialKeyHandle = false;
mbKeyHandled = false;
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
if( ! [self handleKeyDownException: pEvent] )
@@ -857,7 +879,7 @@ private:
}
}
--(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent
+-(BOOL)handleKeyDownException:(NSEvent*)pEvent
{
// check for a very special set of modified characters
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
@@ -875,7 +897,7 @@ private:
return YES;
}
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- USHORT nKeyCode = ImplMapCharCode( keyChar );
+ sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
// Caution: should the table grow to more than 5 or 6 entries,
// we must consider moving it to a kind of hash map
@@ -901,7 +923,7 @@ private:
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ mpFrame->mnLastEventTime = static_cast<sal_uLong>( [pEvent timestamp] * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
}
}
@@ -931,7 +953,7 @@ private:
! [self hasMarkedText ]
)
{
- USHORT nKeyCode = ImplMapCharCode( aCharCode );
+ sal_uInt16 nKeyCode = ImplMapCharCode( aCharCode );
unsigned int nLastModifiers = mpFrame->mnLastModifierFlags;
// #i99567#
@@ -1307,18 +1329,18 @@ private:
}
}
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar
{
return [self sendKeyInputAndReleaseToFrame: nKeyCode character: aChar modifiers: mpFrame->mnLastModifierFlags];
}
--(MacOSBOOL)sendKeyInputAndReleaseToFrame: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
return [self sendKeyToFrameDirect: nKeyCode character: aChar modifiers: nMod] ||
[self sendSingleCharacter: mpLastEvent];
}
--(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
+-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod
{
YIELD_GUARD;
@@ -1341,20 +1363,20 @@ private:
}
--(MacOSBOOL)sendSingleCharacter: (NSEvent *)pEvent
+-(BOOL)sendSingleCharacter: (NSEvent *)pEvent
{
NSString* pUnmodifiedString = [pEvent charactersIgnoringModifiers];
if( pUnmodifiedString && [pUnmodifiedString length] == 1 )
{
unichar keyChar = [pUnmodifiedString characterAtIndex: 0];
- USHORT nKeyCode = ImplMapCharCode( keyChar );
+ sal_uInt16 nKeyCode = ImplMapCharCode( keyChar );
if( nKeyCode != 0 )
{
// don't send unicodes in the private use area
if( keyChar >= 0xf700 && keyChar < 0xf780 )
keyChar = 0;
- MacOSBOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
+ BOOL bRet = [self sendKeyToFrameDirect: nKeyCode character: keyChar modifiers: mpFrame->mnLastModifierFlags];
mbInKeyInput = false;
return bRet;
@@ -1370,9 +1392,9 @@ private:
return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil];
}
-- (MacOSBOOL)hasMarkedText
+- (BOOL)hasMarkedText
{
- MacOSBOOL bHasMarkedText;
+ BOOL bHasMarkedText;
bHasMarkedText = ( mMarkedRange.location != NSNotFound ) &&
( mMarkedRange.length != 0 );
@@ -1439,7 +1461,7 @@ private:
if( len > 0 ) {
NSString *pString = [aString string];
OUString aInsertString( GetOUString( pString ) );
- std::vector<USHORT> aInputFlags = std::vector<USHORT>( std::max( 1, len ), 0 );
+ std::vector<sal_uInt16> aInputFlags = std::vector<sal_uInt16>( std::max( 1, len ), 0 );
for ( int i = 0; i < len; i++ )
{
unsigned int nUnderlineValue;
@@ -1598,12 +1620,12 @@ private:
[mDraggingDestinationHandler draggingExited: sender];
}
--(MacOSBOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler prepareForDragOperation: sender];
}
--(MacOSBOOL)performDragOperation:(id <NSDraggingInfo>)sender
+-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [mDraggingDestinationHandler performDragOperation: sender];
}
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index a124201480b5..0b4f41651aa0 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -80,10 +80,14 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
-(void)showPreferences: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_PREFERENCES];
}
-(void)showAbout: (id) sender
{
+ YIELD_GUARD;
+
[self showDialog: SHOWDIALOG_ID_ABOUT];
}
@end
@@ -204,11 +208,12 @@ static void initAppMenu()
// =======================================================================
-SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* AquaSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
{
initAppMenu();
AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar );
+ pAquaSalMenu->mpVCLMenu = pVCLMenu;
return pAquaSalMenu;
}
@@ -335,9 +340,9 @@ sal_Int32 removeUnusedItemsRunner(NSMenu * pMenu)
return drawnItems;
}
-bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags)
+bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags)
{
- // do not use native popup menu when AQUA_NATIVE_MENUS is set to FALSE
+ // do not use native popup menu when AQUA_NATIVE_MENUS is set to sal_False
if( ! VisibleMenuBar() ) {
return false;
}
@@ -365,7 +370,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
// do the same strange semantics as vcl popup windows to arrive at a frame geometry
// in mirrored UI case; best done by actually executing the same code
- USHORT nArrangeIndex;
+ sal_uInt16 nArrangeIndex;
pWin->SetPosPixel( pWin->ImplCalcPos( pWin, rRect, nFlags, nArrangeIndex ) );
displayPopupFrame.origin.x = pWin->ImplGetFrame()->maGeometry.nX - pParentAquaSalFrame->maGeometry.nX + offset;
displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.nY - pParentAquaSalFrame->maGeometry.nY + offset;
@@ -389,7 +394,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
return true;
}
-int AquaSalMenu::getItemIndexByPos( USHORT nPos ) const
+int AquaSalMenu::getItemIndexByPos( sal_uInt16 nPos ) const
{
int nIndex = 0;
if( nPos == MENU_APPEND )
@@ -515,7 +520,7 @@ void AquaSalMenu::removeFallbackMenuItem( NSMenuItem* pOldItem )
}
}
-BOOL AquaSalMenu::VisibleMenuBar()
+sal_Bool AquaSalMenu::VisibleMenuBar()
{
// Enable/disable experimental native menus code?
//
@@ -524,11 +529,11 @@ BOOL AquaSalMenu::VisibleMenuBar()
static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
if ( ImplGetSVData()->mbIsTestTool || (pExperimental && !strcasecmp(pExperimental, "FALSE")) )
- return FALSE;
+ return sal_False;
// End of experimental code enable/disable part
- return TRUE;
+ return sal_True;
}
void AquaSalMenu::SetFrame( const SalFrame *pFrame )
@@ -627,7 +632,7 @@ void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsi
}
}
-void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
+void AquaSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
{
if( nPos < maItems.size() )
{
@@ -636,7 +641,7 @@ void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
}
}
-void AquaSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
+void AquaSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
{
if( nPos < maItems.size() )
{
@@ -697,10 +702,10 @@ void AquaSalMenu::SetItemText( unsigned i_nPos, SalMenuItem* i_pSalMenuItem, con
void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
{
- USHORT nModifier;
+ sal_uInt16 nModifier;
sal_Unicode nCommandKey = 0;
- USHORT nKeyCode=rKeyCode.GetCode();
+ sal_uInt16 nKeyCode=rKeyCode.GetCode();
if( nKeyCode )
{
if ((nKeyCode>=KEY_A) && (nKeyCode<=KEY_Z)) // letter A..Z
@@ -782,7 +787,7 @@ void AquaSalMenu::GetSystemMenuData( SystemMenuData* pData )
{
}
-AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( USHORT i_nItemId )
+AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( sal_uInt16 i_nItemId )
{
for( size_t i = 0; i < maButtons.size(); ++i )
{
@@ -848,7 +853,7 @@ bool AquaSalMenu::AddMenuBarButton( const SalMenuButtonItem& i_rNewItem )
return true;
}
-void AquaSalMenu::RemoveMenuBarButton( USHORT i_nId )
+void AquaSalMenu::RemoveMenuBarButton( sal_uInt16 i_nId )
{
MenuBarButtonEntry* pEntry = findButtonItem( i_nId );
if( pEntry )
@@ -862,7 +867,7 @@ void AquaSalMenu::RemoveMenuBarButton( USHORT i_nId )
statusLayout();
}
-Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame )
+Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame )
{
if( GetSalData()->mnSystemVersion < VER_LEOPARD )
return Rectangle( Point( -1, -1 ), Size( 1, 1 ) );
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 23df35581ecb..5bc239e26f29 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -108,14 +108,14 @@ void AquaSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-USHORT AquaSalObject::GetClipRegionType()
+sal_uInt16 AquaSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void AquaSalObject::BeginSetClipRegion( ULONG nRectCount )
+void AquaSalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
mbClip = false;
}
@@ -201,7 +201,7 @@ void AquaSalObject::setClippedPosSize()
// -----------------------------------------------------------------------
-void AquaSalObject::Show( BOOL bVisible )
+void AquaSalObject::Show( sal_Bool bVisible )
{
if( mpClipView )
[mpClipView setHidden: (bVisible ? NO : YES)];
@@ -209,7 +209,7 @@ void AquaSalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void AquaSalObject::Enable( BOOL bEnable )
+void AquaSalObject::Enable( sal_Bool bEnable )
{
}
@@ -238,4 +238,10 @@ const SystemEnvData* AquaSalObject::GetSystemData() const
return &maSysData;
}
+// -----------------------------------------------------------------------
+
+void AquaSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
index 295f479d5cb8..b76e8ef99289 100644
--- a/vcl/inc/cupsmgr.hxx
+++ b/vcl/inc/cupsmgr.hxx
@@ -71,7 +71,7 @@ class CUPSManager : public PrinterInfoManager
virtual void initialize();
- void getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const;
+ void getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const;
void runDests();
public:
// public for stub
@@ -85,7 +85,7 @@ public:
const char* authenticateUser( const char* );
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
virtual void setupJobContextData( JobData& rData );
// changes the info about a named printer
diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx
index 3e2ef6554079..012981fba7cf 100644
--- a/vcl/inc/vcl/abstdlg.hxx
+++ b/vcl/inc/vcl/abstdlg.hxx
@@ -42,7 +42,7 @@ class VCL_DLLPUBLIC VclAbstractDialog
{
public:
virtual short Execute() = 0;
- //virtual void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ) = 0;
+ //virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ) = 0;
virtual ~VclAbstractDialog();
};
diff --git a/vcl/inc/vcl/accel.h b/vcl/inc/vcl/accel.h
index aec7e7c1bbd2..bf3006c9ca7b 100644
--- a/vcl/inc/vcl/accel.h
+++ b/vcl/inc/vcl/accel.h
@@ -43,11 +43,11 @@ class Accelerator;
class ImplAccelEntry
{
public:
- USHORT mnId;
+ sal_uInt16 mnId;
KeyCode maKeyCode;
Accelerator* mpAccel;
Accelerator* mpAutoAccel;
- BOOL mbEnabled;
+ sal_Bool mbEnabled;
};
// -----------------
@@ -55,7 +55,7 @@ public:
// -----------------
// in KEYCOD.CXX
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 );
+void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 );
#endif // _SV_ACCEL_H
diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx
index 8c5ee6dfeb68..a7bf623cb20a 100644
--- a/vcl/inc/vcl/accel.hxx
+++ b/vcl/inc/vcl/accel.hxx
@@ -55,16 +55,16 @@ private:
// Werden vom AcceleratorManager gesetzt
KeyCode maCurKeyCode;
- USHORT mnCurId;
- USHORT mnCurRepeat;
- BOOL mbIsCancel;
- BOOL* mpDel;
+ sal_uInt16 mnCurId;
+ sal_uInt16 mnCurRepeat;
+ sal_Bool mbIsCancel;
+ sal_Bool* mpDel;
SAL_DLLPRIVATE void ImplInit();
SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData );
SAL_DLLPRIVATE void ImplDeleteData();
- SAL_DLLPRIVATE void ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
- BOOL bEnable, Accelerator* pAutoAccel );
+ SAL_DLLPRIVATE void ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel );
SAL_DLLPRIVATE ImplAccelEntry* ImplGetAccelData( const KeyCode& rKeyCode ) const;
@@ -81,35 +81,35 @@ public:
virtual void Deactivate();
virtual void Select();
- void InsertItem( USHORT nItemId, const KeyCode& rKeyCode );
+ void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode );
void InsertItem( const ResId& rResId );
- void RemoveItem( USHORT nItemId );
+ void RemoveItem( sal_uInt16 nItemId );
void RemoveItem( const KeyCode rKeyCode );
void Clear();
- USHORT GetCurItemId() const { return mnCurId; }
+ sal_uInt16 GetCurItemId() const { return mnCurId; }
const KeyCode& GetCurKeyCode() const { return maCurKeyCode; }
- USHORT GetCurRepeat() const { return mnCurRepeat; }
- BOOL IsCancel() const { return mbIsCancel; }
-
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- KeyCode GetItemKeyCode( USHORT nPos ) const;
- USHORT GetItemId( const KeyCode& rKeyCode ) const;
- KeyCode GetKeyCode( USHORT nItemId ) const;
- BOOL IsIdValid( USHORT nItemId ) const;
- BOOL IsKeyCodeValid( const KeyCode rKeyCode ) const;
- BOOL Call( const KeyCode& rKeyCode, USHORT nRepeat = 0 );
-
- void SetAccel( USHORT nItemId, Accelerator* pAccel );
- Accelerator* GetAccel( USHORT nItemId ) const;
+ sal_uInt16 GetCurRepeat() const { return mnCurRepeat; }
+ sal_Bool IsCancel() const { return mbIsCancel; }
+
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ KeyCode GetItemKeyCode( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const;
+ KeyCode GetKeyCode( sal_uInt16 nItemId ) const;
+ sal_Bool IsIdValid( sal_uInt16 nItemId ) const;
+ sal_Bool IsKeyCodeValid( const KeyCode rKeyCode ) const;
+ sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
+
+ void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel );
+ Accelerator* GetAccel( sal_uInt16 nItemId ) const;
void SetAccel( const KeyCode rKeyCode, Accelerator* pAccel );
Accelerator* GetAccel( const KeyCode rKeyCode ) const;
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
- void EnableItem( const KeyCode rKeyCode, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( const KeyCode rKeyCode ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
+ void EnableItem( const KeyCode rKeyCode, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( const KeyCode rKeyCode ) const;
void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; }
const XubString& GetHelpText() const { return maHelpStr; }
diff --git a/vcl/inc/vcl/accmgr.hxx b/vcl/inc/vcl/accmgr.hxx
index 5b9880532b98..2ffa2b366920 100644
--- a/vcl/inc/vcl/accmgr.hxx
+++ b/vcl/inc/vcl/accmgr.hxx
@@ -55,13 +55,13 @@ public:
}
~ImplAccelManager();
- BOOL InsertAccel( Accelerator* pAccel );
+ sal_Bool InsertAccel( Accelerator* pAccel );
void RemoveAccel( Accelerator* pAccel );
- void EndSequence( BOOL bCancel = FALSE );
- void FlushAccel() { EndSequence( TRUE ); }
+ void EndSequence( sal_Bool bCancel = sal_False );
+ void FlushAccel() { EndSequence( sal_True ); }
- BOOL IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat );
+ sal_Bool IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat );
};
#endif // _SV_ACCMGR_HXX
diff --git a/vcl/inc/vcl/alpha.hxx b/vcl/inc/vcl/alpha.hxx
index a31e68832ba1..8bcaf3789528 100644
--- a/vcl/inc/vcl/alpha.hxx
+++ b/vcl/inc/vcl/alpha.hxx
@@ -55,14 +55,14 @@ public:
AlphaMask();
AlphaMask( const Bitmap& rBitmap );
AlphaMask( const AlphaMask& rAlphaMask );
- AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency = NULL );
+ AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = NULL );
~AlphaMask();
AlphaMask& operator=( const Bitmap& rBitmap );
AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return (AlphaMask&) Bitmap::operator=( rAlphaMask ); }
- BOOL operator!() const { return Bitmap::operator!(); }
- BOOL operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
- BOOL operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
+ sal_Bool operator!() const { return Bitmap::operator!(); }
+ sal_Bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
+ sal_Bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
const MapMode& GetPrefMapMode() const { return Bitmap::GetPrefMapMode(); }
void SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); }
@@ -73,26 +73,26 @@ public:
Size GetSizePixel() const { return Bitmap::GetSizePixel(); }
void SetSizePixel( const Size& rNewSize ) { Bitmap::SetSizePixel( rNewSize ); }
- ULONG GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
- ULONG GetChecksum() const { return Bitmap::GetChecksum(); }
+ sal_uLong GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
+ sal_uLong GetChecksum() const { return Bitmap::GetChecksum(); }
Bitmap GetBitmap() const;
public:
- BOOL Crop( const Rectangle& rRectPixel );
- BOOL Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency = NULL );
- BOOL CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const AlphaMask* pAlphaSrc = NULL );
- BOOL Erase( BYTE cTransparency );
- BOOL Invert();
- BOOL Mirror( ULONG nMirrorFlags );
- BOOL Scale( const Size& rNewSize, ULONG nScaleFlag = BMP_SCALE_FAST );
- BOOL Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag = BMP_SCALE_FAST );
- BOOL Rotate( long nAngle10, BYTE cFillTransparency );
- BOOL Replace( const Bitmap& rMask, BYTE rReplaceTransparency );
- BOOL Replace( BYTE cSearchTransparency, BYTE cReplaceTransparency, ULONG nTol = 0UL );
- BOOL Replace( BYTE* pSearchTransparencies, BYTE* pReplaceTransparencies,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_Bool Crop( const Rectangle& rRectPixel );
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency = NULL );
+ sal_Bool CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const AlphaMask* pAlphaSrc = NULL );
+ sal_Bool Erase( sal_uInt8 cTransparency );
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Rotate( long nAngle10, sal_uInt8 cFillTransparency );
+ sal_Bool Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
+ sal_Bool Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol = 0UL );
+ sal_Bool Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
public:
@@ -102,8 +102,8 @@ public:
public:
- BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE ) { return Bitmap::Read( rIStm, bFileHeader ); }
- BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const { return Bitmap::Write( rOStm, bCompressed, bFileHeader ); }
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True ) { return Bitmap::Read( rIStm, bFileHeader ); }
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const { return Bitmap::Write( rOStm, bCompressed, bFileHeader ); }
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx
index 5a9b1b6dfc4f..e53a51e0e932 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -71,7 +71,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
Size aSizePix;
long nWait;
Disposal eDisposal;
- BOOL bUserInput;
+ sal_Bool bUserInput;
AnimationBitmap() {}
AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix,
@@ -82,9 +82,9 @@ struct VCL_DLLPUBLIC AnimationBitmap
aSizePix ( rSizePix ),
nWait ( _nWait ),
eDisposal ( _eDisposal ),
- bUserInput ( FALSE ) {}
+ bUserInput ( sal_False ) {}
- BOOL operator==( const AnimationBitmap& rAnimBmp ) const
+ sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aBmpEx == aBmpEx &&
rAnimBmp.aPosPix == aPosPix &&
@@ -94,9 +94,9 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.bUserInput == bUserInput );
}
- BOOL operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
+ sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); }
- BOOL IsEqual( const AnimationBitmap& rAnimBmp ) const
+ sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const
{
return( rAnimBmp.aPosPix == aPosPix &&
rAnimBmp.aSizePix == aSizePix &&
@@ -106,7 +106,7 @@ struct VCL_DLLPUBLIC AnimationBitmap
rAnimBmp.aBmpEx.IsEqual( aBmpEx ) );
}
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
};
// -------------------
@@ -125,14 +125,14 @@ struct AInfo
OutputDevice* pOutDev;
void* pViewData;
long nExtraData;
- BOOL bWithSize;
- BOOL bPause;
+ sal_Bool bWithSize;
+ sal_Bool bPause;
AInfo() : pOutDev( NULL ),
pViewData( NULL ),
nExtraData( 0L ),
- bWithSize( FALSE ),
- bPause( FALSE ) {}
+ bWithSize( sal_False ),
+ bPause( sal_False ) {}
};
// -------------------
@@ -141,7 +141,7 @@ struct AInfo
class VCL_DLLPUBLIC Animation
{
- SAL_DLLPRIVATE static ULONG mnAnimCount;
+ SAL_DLLPRIVATE static sal_uLong mnAnimCount;
List maList;
List maAInfoList;
@@ -156,21 +156,21 @@ class VCL_DLLPUBLIC Animation
long mnPos;
Disposal meLastDisposal;
CycleMode meCycleMode;
- BOOL mbFirst;
- BOOL mbIsInAnimation;
- BOOL mbWithSize;
- BOOL mbLoopTerminated;
- BOOL mbIsWaiting;
+ sal_Bool mbFirst;
+ sal_Bool mbIsInAnimation;
+ sal_Bool mbWithSize;
+ sal_Bool mbLoopTerminated;
+ sal_Bool mbIsWaiting;
- SAL_DLLPRIVATE void ImplRestartTimer( ULONG nTimeout );
+ SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout );
DECL_DLLPRIVATE_LINK( ImplTimeoutHdl, Timer* );
public:
SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; }
SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; }
- SAL_DLLPRIVATE ULONG ImplGetCurPos() const { return mnPos; }
+ SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; }
public:
@@ -179,28 +179,28 @@ public:
~Animation();
Animation& operator=( const Animation& rAnimation );
- BOOL operator==( const Animation& rAnimation ) const;
- BOOL operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
+ sal_Bool operator==( const Animation& rAnimation ) const;
+ sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); }
- BOOL IsEqual( const Animation& rAnimation ) const;
+ sal_Bool IsEqual( const Animation& rAnimation ) const;
- BOOL IsEmpty() const;
+ sal_Bool IsEmpty() const;
void SetEmpty();
void Clear();
- BOOL Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
+ sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
- BOOL Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
+ sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL );
void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 );
void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const;
void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const;
- BOOL IsInAnimation() const { return mbIsInAnimation; }
- BOOL IsTransparent() const;
- BOOL IsTerminated() const { return mbLoopTerminated; }
+ sal_Bool IsInAnimation() const { return mbIsInAnimation; }
+ sal_Bool IsTransparent() const;
+ sal_Bool IsTerminated() const { return mbLoopTerminated; }
const Size& GetDisplaySizePixel() const { return maGlobalSize; }
void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; }
@@ -208,8 +208,8 @@ public:
const BitmapEx& GetBitmapEx() const { return maBitmapEx; }
void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; }
- ULONG GetLoopCount() const { return mnLoopCount; }
- void SetLoopCount( const ULONG nLoopCount );
+ sal_uLong GetLoopCount() const { return mnLoopCount; }
+ void SetLoopCount( const sal_uLong nLoopCount );
void ResetLoopCount();
void SetCycleMode( CycleMode eMode );
@@ -218,31 +218,31 @@ public:
void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; }
const Link& GetNotifyHdl() const { return maNotifyLink; }
- USHORT Count() const { return (USHORT) maList.Count(); }
- BOOL Insert( const AnimationBitmap& rAnimationBitmap );
- const AnimationBitmap& Get( USHORT nAnimation ) const;
- void Replace( const AnimationBitmap& rNewAnimationBmp, USHORT nAnimation );
+ sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); }
+ sal_Bool Insert( const AnimationBitmap& rAnimationBitmap );
+ const AnimationBitmap& Get( sal_uInt16 nAnimation ) const;
+ void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation );
List* GetAInfoList() { return &maAInfoList; }
- ULONG GetSizeBytes() const;
- ULONG GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
public:
- BOOL Convert( BmpConversion eConversion );
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool Convert( BmpConversion eConversion );
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
- BOOL Invert();
- BOOL Mirror( ULONG nMirrorFlags );
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Invert();
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool bInvert = sal_False );
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
diff --git a/vcl/inc/vcl/apptypes.hxx b/vcl/inc/vcl/apptypes.hxx
index eba7f779ee81..42273f6a292c 100644
--- a/vcl/inc/vcl/apptypes.hxx
+++ b/vcl/inc/vcl/apptypes.hxx
@@ -37,14 +37,14 @@
// - Application-Types -
// ---------------------
-#define EXC_RSCNOTLOADED ((USHORT)0x0100)
-#define EXC_SYSOBJNOTCREATED ((USHORT)0x0200)
-#define EXC_SYSTEM ((USHORT)0x0300)
-#define EXC_DISPLAY ((USHORT)0x0400)
-#define EXC_REMOTE ((USHORT)0x0500)
-#define EXC_USER ((USHORT)0x1000)
-#define EXC_MAJORTYPE ((USHORT)0xFF00)
-#define EXC_MINORTYPE ((USHORT)0x00FF)
+#define EXC_RSCNOTLOADED ((sal_uInt16)0x0100)
+#define EXC_SYSOBJNOTCREATED ((sal_uInt16)0x0200)
+#define EXC_SYSTEM ((sal_uInt16)0x0300)
+#define EXC_DISPLAY ((sal_uInt16)0x0400)
+#define EXC_REMOTE ((sal_uInt16)0x0500)
+#define EXC_USER ((sal_uInt16)0x1000)
+#define EXC_MAJORTYPE ((sal_uInt16)0xFF00)
+#define EXC_MINORTYPE ((sal_uInt16)0x00FF)
#define UNIQUEID_SV_BEGIN 64000
@@ -72,10 +72,10 @@ public:
// - UserActive -
// --------------
-#define USERACTIVE_MOUSEDRAG ((USHORT)0x0001)
-#define USERACTIVE_INPUT ((USHORT)0x0002)
-#define USERACTIVE_MODALDIALOG ((USHORT)0x0004)
-#define USERACTIVE_ALL ((USHORT)0xFFFF)
+#define USERACTIVE_MOUSEDRAG ((sal_uInt16)0x0001)
+#define USERACTIVE_INPUT ((sal_uInt16)0x0002)
+#define USERACTIVE_MODALDIALOG ((sal_uInt16)0x0004)
+#define USERACTIVE_ALL ((sal_uInt16)0xFFFF)
#endif // _VCL_APPTYPES_HXX
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
index 45433f4f351e..5568cc3b05d8 100644
--- a/vcl/inc/vcl/arrange.hxx
+++ b/vcl/inc/vcl/arrange.hxx
@@ -49,7 +49,7 @@ namespace vcl
or a child WindowArranger (a node in the hierarchy), but never both
*/
- class WindowArranger
+ class VCL_DLLPUBLIC WindowArranger
{
protected:
struct Element
@@ -77,11 +77,13 @@ namespace vcl
Element( Window* i_pWin,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
: m_pElement( i_pWin )
, m_pChild( i_pChild )
, m_nExpandPriority( i_nExpandPriority )
+ , m_aMinSize( i_rMinSize )
, m_bHidden( false )
, m_nLeftBorder( 0 )
, m_nTopBorder( 0 )
@@ -102,12 +104,19 @@ namespace vcl
Rectangle m_aManagedArea;
long m_nOuterBorder;
+ rtl::OUString m_aIdentifier;
+
virtual Element* getElement( size_t i_nIndex ) = 0;
const Element* getConstElement( size_t i_nIndex ) const
{ return const_cast<WindowArranger*>(this)->getElement( i_nIndex ); }
public:
+ static long getDefaultBorder();
+
+ static long getBorderValue( long nBorder )
+ { return nBorder >= 0 ? nBorder : -nBorder * getDefaultBorder(); }
+
WindowArranger( WindowArranger* i_pParent = NULL )
: m_pParentWindow( i_pParent ? i_pParent->m_pParentWindow : NULL )
, m_pParentArranger( i_pParent )
@@ -142,6 +151,9 @@ namespace vcl
virtual bool isVisible() const; // true if any element is visible
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+
sal_Int32 getExpandPriority( size_t i_nIndex ) const
{
const Element* pEle = getConstElement( i_nIndex );
@@ -174,6 +186,19 @@ namespace vcl
}
}
+ void getBorders( size_t i_nIndex, long* i_pLeft = NULL, long* i_pTop = NULL, long* i_pRight = NULL, long* i_pBottom = NULL ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ if( pEle )
+ {
+ if( i_pLeft ) *i_pLeft = pEle->m_nLeftBorder;
+ if( i_pTop ) *i_pTop = pEle->m_nTopBorder;
+ if( i_pRight ) *i_pRight = pEle->m_nRightBorder;
+ if( i_pBottom ) *i_pBottom = pEle->m_nBottomBorder;
+ }
+ }
+
+
void show( bool i_bShow = true, bool i_bImmediateUpdate = true );
void setManagedArea( const Rectangle& i_rArea )
@@ -188,9 +213,15 @@ namespace vcl
m_nOuterBorder = i_nBorder;
resize();
}
+
+ const rtl::OUString getIdentifier() const
+ { return m_aIdentifier; }
+
+ void setIdentifier( const rtl::OUString& i_rId )
+ { m_aIdentifier = i_rId; }
};
- class RowOrColumn : public WindowArranger
+ class VCL_DLLPUBLIC RowOrColumn : public WindowArranger
{
long m_nBorderWidth;
bool m_bColumn;
@@ -205,7 +236,7 @@ namespace vcl
public:
RowOrColumn( WindowArranger* i_pParent = NULL,
- bool bColumn = true, long i_nBorderWidth = 5 )
+ bool bColumn = true, long i_nBorderWidth = -1 )
: WindowArranger( i_pParent )
, m_nBorderWidth( i_nBorderWidth )
, m_bColumn( bColumn )
@@ -219,7 +250,7 @@ namespace vcl
// add a managed window at the given index
// an index smaller than zero means add the window at the end
- size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size(), size_t i_nIndex = ~0 );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
@@ -231,7 +262,7 @@ namespace vcl
long getBorderWidth() const { return m_nBorderWidth; }
};
- class LabeledElement : public WindowArranger
+ class VCL_DLLPUBLIC LabeledElement : public WindowArranger
{
WindowArranger::Element m_aLabel;
WindowArranger::Element m_aElement;
@@ -249,7 +280,7 @@ namespace vcl
}
public:
- LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = -1 )
: WindowArranger( i_pParent )
, m_nDistance( i_nDistance )
, m_nLabelColumnWidth( 0 )
@@ -275,11 +306,11 @@ namespace vcl
{ return m_aElement.getOptimalSize( i_eType ); }
};
- class LabelColumn : public RowOrColumn
+ class VCL_DLLPUBLIC LabelColumn : public RowOrColumn
{
long getLabelWidth() const;
public:
- LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = -1 )
: RowOrColumn( i_pParent, true, i_nBorderWidth )
{}
virtual ~LabelColumn();
@@ -289,10 +320,10 @@ namespace vcl
// returns the index of the added label
size_t addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> const& i_rElement, long i_nIndent = 0 );
- size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0, const Size& i_rElementMinSize = Size() );
};
- class Indenter : public WindowArranger
+ class VCL_DLLPUBLIC Indenter : public WindowArranger
{
long m_nIndent;
WindowArranger::Element m_aElement;
@@ -302,7 +333,7 @@ namespace vcl
{ return i_nIndex == 0 ? &m_aElement : NULL; }
public:
- Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 3*getDefaultBorder() )
: WindowArranger( i_pParent )
, m_nIndent( i_nIndent )
{}
@@ -326,7 +357,7 @@ namespace vcl
{ setChild( boost::shared_ptr<WindowArranger>( i_pChild ), i_nExpandPrio ); }
};
- class Spacer : public WindowArranger
+ class VCL_DLLPUBLIC Spacer : public WindowArranger
{
WindowArranger::Element m_aElement;
Size m_aSize;
@@ -352,7 +383,7 @@ namespace vcl
virtual bool isVisible() const { return true; }
};
- class MatrixArranger : public WindowArranger
+ class VCL_DLLPUBLIC MatrixArranger : public WindowArranger
{
long m_nBorderX;
long m_nBorderY;
@@ -371,9 +402,10 @@ namespace vcl
MatrixElement( Window* i_pWin,
sal_uInt32 i_nX, sal_uInt32 i_nY,
boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
- sal_Int32 i_nExpandPriority = 0
+ sal_Int32 i_nExpandPriority = 0,
+ const Size& i_rMinSize = Size()
)
- : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority, i_rMinSize )
, m_nX( i_nX )
, m_nY( i_nY )
{
@@ -386,15 +418,20 @@ namespace vcl
sal_uInt64 getMap( sal_uInt32 i_nX, sal_uInt32 i_nY )
{ return static_cast< sal_uInt64 >(i_nX) | (static_cast< sal_uInt64>(i_nY) << 32 ); }
- Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const;
+ static void distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth );
+
+ Size getOptimalSize( WindowSizeType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const;
protected:
virtual Element* getElement( size_t i_nIndex )
{ return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }
public:
MatrixArranger( WindowArranger* i_pParent = NULL,
- long i_nBorderX = 5,
- long i_nBorderY = 5 )
+ long i_nBorderX = -1,
+ long i_nBorderY = -1 )
: WindowArranger( i_pParent )
, m_nBorderX( i_nBorderX )
, m_nBorderY( i_nBorderY )
@@ -407,7 +444,7 @@ namespace vcl
virtual size_t countElements() const { return m_aElements.size(); }
// add a managed window at the given matrix position
- size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0, const Size& i_rMinSize = Size() );
void remove( Window* );
size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index 6127dca70510..d514977fda38 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -157,27 +157,27 @@ class VCL_DLLPUBLIC BmpFilterParam
private:
BmpFilter meFilter;
- ULONG mnProgressStart;
- ULONG mnProgressEnd;
+ sal_uLong mnProgressStart;
+ sal_uLong mnProgressEnd;
public:
struct MosaicTileSize
{
- ULONG mnTileWidth;
- ULONG mnTileHeight;
+ sal_uLong mnTileWidth;
+ sal_uLong mnTileHeight;
};
struct EmbossAngles
{
- USHORT mnAzimuthAngle100;
- USHORT mnElevationAngle100;
+ sal_uInt16 mnAzimuthAngle100;
+ sal_uInt16 mnElevationAngle100;
};
private:
union
{
- USHORT mnSepiaPercent;
- BYTE mcSolarGreyThreshold;
+ sal_uInt16 mnSepiaPercent;
+ sal_uInt8 mcSolarGreyThreshold;
MosaicTileSize maMosaicTileSize;
EmbossAngles maEmbossAngles;
@@ -185,25 +185,25 @@ private:
public:
- BmpFilterParam( ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_UNKNOWN ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ) {}
- BmpFilterParam( BYTE cSolarGreyThreshold, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt8 cSolarGreyThreshold, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SOLARIZE ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mcSolarGreyThreshold( cSolarGreyThreshold ) {}
- BmpFilterParam( USHORT nSepiaPercent, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt16 nSepiaPercent, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_SEPIA ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd ),
mnSepiaPercent( nSepiaPercent ) {}
- BmpFilterParam( const Size& rMosaicTileSize, ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( const Size& rMosaicTileSize, sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_MOSAIC ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maMosaicTileSize.mnTileWidth = rMosaicTileSize.Width();
maMosaicTileSize.mnTileHeight= rMosaicTileSize.Height();
}
- BmpFilterParam( USHORT nEmbossAzimuthAngle100, USHORT nEmbossElevationAngle100,
- ULONG nProgressStart = 0, ULONG nProgressEnd = 0 ) :
+ BmpFilterParam( sal_uInt16 nEmbossAzimuthAngle100, sal_uInt16 nEmbossElevationAngle100,
+ sal_uLong nProgressStart = 0, sal_uLong nProgressEnd = 0 ) :
meFilter( BMP_FILTER_EMBOSS_GREY ), mnProgressStart( nProgressStart ), mnProgressEnd( nProgressEnd )
{
maEmbossAngles.mnAzimuthAngle100 = nEmbossAzimuthAngle100;
@@ -259,65 +259,65 @@ public:
SAL_DLLPRIVATE void ImplSetImpBitmap( ImpBitmap* pImpBmp );
SAL_DLLPRIVATE void ImplAssignWithSize( const Bitmap& rBitmap );
- SAL_DLLPRIVATE static BOOL ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bMSOFormat=FALSE );
- SAL_DLLPRIVATE static BOOL ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset );
- SAL_DLLPRIVATE static BOOL ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, BOOL bMSOFormat = FALSE );
- SAL_DLLPRIVATE static BOOL ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad );
- SAL_DLLPRIVATE static BOOL ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
- SAL_DLLPRIVATE BOOL ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const;
- SAL_DLLPRIVATE static BOOL ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static BOOL ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
- SAL_DLLPRIVATE static BOOL ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- ULONG nCompression, sal_uInt32& rImageSize );
- SAL_DLLPRIVATE static void ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, BOOL bRLE4 );
- SAL_DLLPRIVATE static BOOL ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 );
-
- SAL_DLLPRIVATE BOOL ImplScaleFast( const double& rScaleX, const double& rScaleY );
- SAL_DLLPRIVATE BOOL ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
- SAL_DLLPRIVATE BOOL ImplMakeMono( BYTE cThreshold );
- SAL_DLLPRIVATE BOOL ImplMakeMonoDither();
- SAL_DLLPRIVATE BOOL ImplMakeGreyscales( USHORT nGreyscales );
- SAL_DLLPRIVATE BOOL ImplConvertUp( USHORT nBitCount, Color* pExtColor = NULL );
- SAL_DLLPRIVATE BOOL ImplConvertDown( USHORT nBitCount, Color* pExtColor = NULL );
- SAL_DLLPRIVATE BOOL ImplConvertGhosted();
- SAL_DLLPRIVATE BOOL ImplDitherMatrix();
- SAL_DLLPRIVATE BOOL ImplDitherFloyd();
- SAL_DLLPRIVATE BOOL ImplDitherFloyd16();
- SAL_DLLPRIVATE BOOL ImplReduceSimple( USHORT nColorCount );
- SAL_DLLPRIVATE BOOL ImplReducePopular( USHORT nColorCount );
- SAL_DLLPRIVATE BOOL ImplReduceMedian( USHORT nColorCount );
- SAL_DLLPRIVATE void ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bMSOFormat = sal_False );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad );
+ SAL_DLLPRIVATE static sal_Bool ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
+ SAL_DLLPRIVATE sal_Bool ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const;
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ sal_uLong nCompression, sal_uInt32& rImageSize );
+ SAL_DLLPRIVATE static void ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, sal_Bool bRLE4 );
+ SAL_DLLPRIVATE static sal_Bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 );
+
+ SAL_DLLPRIVATE sal_Bool ImplScaleFast( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE sal_Bool ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
+ SAL_DLLPRIVATE sal_Bool ImplMakeMono( sal_uInt8 cThreshold );
+ SAL_DLLPRIVATE sal_Bool ImplMakeMonoDither();
+ SAL_DLLPRIVATE sal_Bool ImplMakeGreyscales( sal_uInt16 nGreyscales );
+ SAL_DLLPRIVATE sal_Bool ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplConvertGhosted();
+ SAL_DLLPRIVATE sal_Bool ImplDitherMatrix();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd();
+ SAL_DLLPRIVATE sal_Bool ImplDitherFloyd16();
+ SAL_DLLPRIVATE sal_Bool ImplReduceSimple( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReducePopular( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE sal_Bool ImplReduceMedian( sal_uInt16 nColorCount );
+ SAL_DLLPRIVATE void ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex );
- SAL_DLLPRIVATE BOOL ImplConvolute3( const long* pMatrix, long nDivisor,
+ SAL_DLLPRIVATE sal_Bool ImplConvolute3( const long* pMatrix, long nDivisor,
const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSolarize( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplSepia( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
- SAL_DLLPRIVATE BOOL ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMedianFilter( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSobelGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSolarize( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplSepia( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplMosaic( const BmpFilterParam* pFilterParam, const Link* pProgress );
+ SAL_DLLPRIVATE sal_Bool ImplPopArt( const BmpFilterParam* pFilterParam, const Link* pProgress );
public:
Bitmap();
Bitmap( const Bitmap& rBitmap );
- Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal = NULL );
+ Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal = NULL );
Bitmap( const ResId& rResId );
Bitmap( SalBitmap* pSalBitmap );
~Bitmap();
Bitmap& operator=( const Bitmap& rBitmap );
- inline BOOL operator!() const;
- inline BOOL operator==( const Bitmap& rBitmap ) const;
- inline BOOL operator!=( const Bitmap& rBitmap ) const;
+ inline sal_Bool operator!() const;
+ inline sal_Bool operator==( const Bitmap& rBitmap ) const;
+ inline sal_Bool operator!=( const Bitmap& rBitmap ) const;
- inline BOOL IsSameInstance( const Bitmap& rBmp ) const;
- BOOL IsEqual( const Bitmap& rBmp ) const;
+ inline sal_Bool IsSameInstance( const Bitmap& rBmp ) const;
+ sal_Bool IsEqual( const Bitmap& rBmp ) const;
- inline BOOL IsEmpty() const;
+ inline sal_Bool IsEmpty() const;
void SetEmpty();
inline const MapMode& GetPrefMapMode() const;
@@ -338,20 +338,20 @@ public:
void SetSourceSizePixel( const Size& );
- USHORT GetBitCount() const;
- inline ULONG GetColorCount() const;
- inline ULONG GetSizeBytes() const;
- BOOL HasGreyPalette() const;
+ sal_uInt16 GetBitCount() const;
+ inline sal_uLong GetColorCount() const;
+ inline sal_uLong GetSizeBytes() const;
+ sal_Bool HasGreyPalette() const;
/** get system dependent bitmap data
@param rData
The system dependent BitmapSystemData structure to be filled
- @return TRUE if the bitmap has a valid system object (e.g. not empty)
+ @return sal_True if the bitmap has a valid system object (e.g. not empty)
*/
bool GetSystemData( BitmapSystemData& rData ) const;
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
Bitmap CreateDisplayBitmap( OutputDevice* pDisplay );
Bitmap GetColorTransformedBitmap() const;
@@ -360,7 +360,7 @@ public:
public:
- BOOL MakeMono( BYTE cThreshold );
+ sal_Bool MakeMono( sal_uInt8 cThreshold );
/** Convert bitmap format
@@ -368,9 +368,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return TRUE, if the conversion was completed successfully.
+ @return sal_True, if the conversion was completed successfully.
*/
- BOOL Convert( BmpConversion eConversion );
+ sal_Bool Convert( BmpConversion eConversion );
/** Reduce number of colors for the bitmap
@@ -380,9 +380,9 @@ public:
@param eReduce
Algorithm to use for color reduction
- @return TRUE, if the color reduction operation was completed successfully.
+ @return sal_True, if the color reduction operation was completed successfully.
*/
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
/** Apply a dither algorithm to the bitmap
@@ -397,7 +397,7 @@ public:
@param pDitherPal
A custom palette to be used when dithering (not yet implemented, leave NULL)
*/
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -409,11 +409,11 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return TRUE, if cropping was performed successfully. If
+ @return sal_True, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, FALSE is returned, too!
+ included the bitmap, sal_False is returned, too!
*/
- BOOL Crop( const Rectangle& rRectPixel );
+ sal_Bool Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
@@ -426,11 +426,11 @@ public:
@param pInitColor
Color to use for padded pixel
- @return TRUE, if padding was performed successfully. FALSE is
+ @return sal_True, if padding was performed successfully. sal_False is
not only returned when the operation failed, but also if
nothing had to be done, e.g. because nDX and nDY were zero.
*/
- BOOL Expand( ULONG nDX, ULONG nDY,
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
const Color* pInitColor = NULL );
/** Copy a rectangular area from another bitmap
@@ -450,12 +450,12 @@ public:
equal to the object this method is called on, copying takes
place within the same bitmap.
- @return TRUE, if the operation completed successfully. FALSE
+ @return sal_True, if the operation completed successfully. sal_False
is not only returned when the operation failed, but also if
nothing had to be done, e.g. because one of the rectangles are
empty.
*/
- BOOL CopyPixel( const Rectangle& rRectDst,
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc,
const Bitmap* pBmpSrc = NULL );
@@ -467,9 +467,9 @@ public:
@param eCombine
The combine operation to perform on the bitmap
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL CombineSimple( const Bitmap& rMask,
+ sal_Bool CombineSimple( const Bitmap& rMask,
BmpCombine eCombine );
/** Alpha-blend the given bitmap against a specified uniform
@@ -486,9 +486,9 @@ public:
@param rBackgroundColor
Background color to use for every pixel during alpha blending
- @return TRUE, if blending was successful, FALSE otherwise
+ @return sal_True, if blending was successful, sal_False otherwise
*/
- BOOL Blend( const AlphaMask& rAlpha,
+ sal_Bool Blend( const AlphaMask& rAlpha,
const Color& rBackgroundColor );
/** Fill the entire bitmap with the given color
@@ -496,24 +496,24 @@ public:
@param rFillColor
Color value to use for filling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Erase( const Color& rFillColor );
+ sal_Bool Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Invert();
+ sal_Bool Invert();
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
/** Scale the bitmap
@@ -523,10 +523,10 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const Size& rNewSize,
- ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const Size& rNewSize,
+ sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -536,10 +536,10 @@ public:
@param rScaleY
The scale factor in y direction.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const double& rScaleX, const double& rScaleY,
- ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY,
+ sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -552,9 +552,9 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Rotate( long nAngle10, const Color& rFillColor );
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
/** Create on-off mask from bitmap
@@ -572,7 +572,7 @@ public:
@return the resulting bitmask.
*/
- Bitmap CreateMask( const Color& rTransColor, ULONG nTol = 0UL ) const;
+ Bitmap CreateMask( const Color& rTransColor, sal_uLong nTol = 0UL ) const;
/** Create region of similar colors in a given rectangle
@@ -595,9 +595,9 @@ public:
@param rReplaceColor
Color to be placed in all changed pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Bitmap& rMask, const Color& rReplaceColor );
+ sal_Bool Replace( const Bitmap& rMask, const Color& rReplaceColor );
/** Merge bitmap with given background color according to specified alpha mask
@@ -607,9 +607,9 @@ public:
@param rMergeColor
Background color to be used for merging
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
+ sal_Bool Replace( const AlphaMask& rAlpha, const Color& rMergeColor );
/** Replace all pixel having the search color with the specified color
@@ -624,9 +624,9 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@@ -644,10 +644,10 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color* pSearchColors, const Color* rReplaceColors,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_Bool Replace( const Color* pSearchColors, const Color* rReplaceColors,
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
/** Convert the bitmap to a PolyPolygon
@@ -664,10 +664,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Vectorize( PolyPolygon& rPolyPoly,
- ULONG nFlags = BMP_VECTORIZE_OUTER,
+ sal_Bool Vectorize( PolyPolygon& rPolyPoly,
+ sal_uLong nFlags = BMP_VECTORIZE_OUTER,
const Link* pProgress = NULL );
/** Convert the bitmap to a meta file
@@ -689,10 +689,10 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Vectorize( GDIMetaFile& rMtf, BYTE cReduce = 0,
- ULONG nFlags = BMP_VECTORIZE_INNER,
+ sal_Bool Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce = 0,
+ sal_uLong nFlags = BMP_VECTORIZE_INNER,
const Link* pProgress = NULL );
/** Change various global color characteristics
@@ -718,17 +718,17 @@ public:
(0.0,10.0]. Values outside this range are regarded as 1.0.
@param bInvert
- If TRUE, invert the channel values with the logical 'not' operator
+ If sal_True, invert the channel values with the logical 'not' operator
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
+ sal_Bool bInvert = sal_False );
/** Apply specified filter to the bitmap
@@ -741,9 +741,9 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
@@ -754,8 +754,8 @@ public:
public:
- BOOL Read( SvStream& rIStm, BOOL bFileHeader = TRUE, BOOL bMSOFormat = FALSE );
- BOOL Write( SvStream& rOStm, BOOL bCompressed = TRUE, BOOL bFileHeader = TRUE ) const;
+ sal_Bool Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True, sal_Bool bMSOFormat = sal_False );
+ sal_Bool Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap );
@@ -765,35 +765,35 @@ public:
// - Inlines -
// -----------
-inline BOOL Bitmap::operator!() const
+inline sal_Bool Bitmap::operator!() const
{
return( mpImpBmp == NULL );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::operator==( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::operator==( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::operator!=( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::operator!=( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp != mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
+inline sal_Bool Bitmap::IsSameInstance( const Bitmap& rBitmap ) const
{
return( rBitmap.mpImpBmp == mpImpBmp );
}
// ------------------------------------------------------------------
-inline BOOL Bitmap::IsEmpty() const
+inline sal_Bool Bitmap::IsEmpty() const
{
return( mpImpBmp == NULL );
}
@@ -828,17 +828,17 @@ inline void Bitmap::SetPrefSize( const Size& rSize )
// ------------------------------------------------------------------
-inline ULONG Bitmap::GetColorCount() const
+inline sal_uLong Bitmap::GetColorCount() const
{
- return( 1UL << (ULONG) GetBitCount() );
+ return( 1UL << (sal_uLong) GetBitCount() );
}
// ------------------------------------------------------------------
-inline ULONG Bitmap::GetSizeBytes() const
+inline sal_uLong Bitmap::GetSizeBytes() const
{
const Size aSizePix( GetSizePixel() );
- return( ( (ULONG) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
+ return( ( (sal_uLong) aSizePix.Width() * aSizePix.Height() * GetBitCount() ) >> 3UL );
}
#endif // _SV_BITMAP_HXX
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index 965f9e611818..9a6259fa61eb 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -60,7 +60,7 @@ private:
Size aBitmapSize;
Color aTransparentColor;
TransparentType eTransparent;
- BOOL bAlpha;
+ sal_Bool bAlpha;
public:
@@ -81,13 +81,13 @@ public:
~BitmapEx();
BitmapEx& operator=( const BitmapEx& rBitmapEx );
- BOOL operator==( const BitmapEx& rBitmapEx ) const;
- BOOL operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
- BOOL operator!() const { return !aBitmap; }
+ sal_Bool operator==( const BitmapEx& rBitmapEx ) const;
+ sal_Bool operator!=( const BitmapEx& rBitmapEx ) const { return !(*this==rBitmapEx); }
+ sal_Bool operator!() const { return !aBitmap; }
- BOOL IsEqual( const BitmapEx& rBmpEx ) const;
+ sal_Bool IsEqual( const BitmapEx& rBmpEx ) const;
- BOOL IsEmpty() const;
+ sal_Bool IsEmpty() const;
void SetEmpty();
void Clear();
@@ -99,7 +99,7 @@ public:
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel ) const;
- BOOL IsTransparent() const;
+ sal_Bool IsTransparent() const;
TransparentType GetTransparentType() const { return eTransparent; }
Bitmap GetBitmap( const Color* pTransReplaceColor = NULL ) const;
@@ -107,7 +107,7 @@ public:
BitmapEx GetColorTransformedBitmapEx() const;
- BOOL IsAlpha() const;
+ sal_Bool IsAlpha() const;
AlphaMask GetAlpha() const;
const Size& GetSizePixel() const { return aBitmapSize; }
@@ -122,9 +122,9 @@ public:
const Color& GetTransparentColor() const { return aTransparentColor; }
void SetTransparentColor( const Color& rColor ) { aTransparentColor = rColor; }
- USHORT GetBitCount() const { return aBitmap.GetBitCount(); }
- ULONG GetSizeBytes() const;
- ULONG GetChecksum() const;
+ sal_uInt16 GetBitCount() const { return aBitmap.GetBitCount(); }
+ sal_uLong GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
public:
@@ -133,9 +133,9 @@ public:
@param eConversion
The format this bitmap should be converted to.
- @return TRUE, if the conversion was completed successfully.
+ @return sal_True, if the conversion was completed successfully.
*/
- BOOL Convert( BmpConversion eConversion );
+ sal_Bool Convert( BmpConversion eConversion );
/** Reduce number of colors for the bitmap
@@ -145,9 +145,9 @@ public:
@param eReduce
Algorithm to use for color reduction
- @return TRUE, if the color reduction operation was completed successfully.
+ @return sal_True, if the color reduction operation was completed successfully.
*/
- BOOL ReduceColors( USHORT nNewColorCount,
+ sal_Bool ReduceColors( sal_uInt16 nNewColorCount,
BmpReduce eReduce = BMP_REDUCE_SIMPLE );
/** Apply a dither algorithm to the bitmap
@@ -159,7 +159,7 @@ public:
@param nDitherFlags
The algorithm to be used for dithering
*/
- BOOL Dither( ULONG nDitherFlags = BMP_DITHER_MATRIX );
+ sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX );
/** Crop the bitmap
@@ -171,11 +171,11 @@ public:
dimension, i.e. negative left,top rectangle coordinates or
exceeding width or height is ignored.
- @return TRUE, if cropping was performed successfully. If
+ @return sal_True, if cropping was performed successfully. If
nothing had to be cropped, because e.g. the crop rectangle
- included the bitmap, FALSE is returned, too!
+ included the bitmap, sal_False is returned, too!
*/
- BOOL Crop( const Rectangle& rRectPixel );
+ sal_Bool Crop( const Rectangle& rRectPixel );
/** Expand the bitmap by pixel padding
@@ -188,13 +188,13 @@ public:
@param pInitColor
Color to use for padded pixel
- @return TRUE, if padding was performed successfully. FALSE is
+ @return sal_True, if padding was performed successfully. sal_False is
not only returned when the operation failed, but also if
nothing had to be done, e.g. because nDX and nDY were zero.
*/
- BOOL Expand( ULONG nDX, ULONG nDY,
+ sal_Bool Expand( sal_uLong nDX, sal_uLong nDY,
const Color* pInitColor = NULL,
- BOOL bExpandTransparent = FALSE );
+ sal_Bool bExpandTransparent = sal_False );
/** Copy a rectangular area from another bitmap
@@ -213,12 +213,12 @@ public:
equal to the object this method is called on, copying takes
place within the same bitmap.
- @return TRUE, if the operation completed successfully. FALSE
+ @return sal_True, if the operation completed successfully. sal_False
is not only returned when the operation failed, but also if
nothing had to be done, e.g. because one of the rectangles are
empty.
*/
- BOOL CopyPixel( const Rectangle& rRectDst,
+ sal_Bool CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc,
const BitmapEx* pBmpExSrc = NULL );
@@ -228,24 +228,24 @@ public:
Color value to use for filling. Set the transparency part of
the color to fill the mask.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Erase( const Color& rFillColor );
+ sal_Bool Erase( const Color& rFillColor );
/** Perform the Invert operation on every pixel
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Invert();
+ sal_Bool Invert();
/** Mirror the bitmap
@param nMirrorFlags
About which axis (horizontal, vertical, or both) to mirror
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
/** Scale the bitmap
@@ -255,9 +255,9 @@ public:
@param nScaleFlag
The algorithm to be used for scaling
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const Size& rNewSize, ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const Size& rNewSize, sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Scale the bitmap
@@ -267,9 +267,9 @@ public:
@param rScaleY
The scale factor in y direction.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag = BMP_SCALE_FAST );
+ sal_Bool Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag = BMP_SCALE_FAST );
/** Rotate bitmap by the specified angle
@@ -282,9 +282,9 @@ public:
in. The empty spaces around that rotated original bitmap are
then filled with this color.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Rotate( long nAngle10, const Color& rFillColor );
+ sal_Bool Rotate( long nAngle10, const Color& rFillColor );
/** Replace all pixel having the search color with the specified color
@@ -299,9 +299,9 @@ public:
rSearchColor and the individual pixel values, such that the
corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ sal_Bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
/** Replace all pixel having one the search colors with the corresponding replace color
@@ -319,10 +319,10 @@ public:
pSearchColor colors and the individual pixel values, such that
the corresponding pixel is still regarded a match.
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Replace( const Color* pSearchColors, const Color* pReplaceColors,
- ULONG nColorCount, const ULONG* pTols = NULL );
+ sal_Bool Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ sal_uLong nColorCount, const sal_uLong* pTols = NULL );
/** Change various global color characteristics
@@ -347,17 +347,17 @@ public:
(0.0,10.0]. Values outside this range are regarded as 1.0.
@param bInvert
- If TRUE, invert the channel values with the logical 'not' operator
+ If sal_True, invert the channel values with the logical 'not' operator
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Adjust( short nLuminancePercent = 0,
+ sal_Bool Adjust( short nLuminancePercent = 0,
short nContrastPercent = 0,
short nChannelRPercent = 0,
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- BOOL bInvert = FALSE );
+ sal_Bool bInvert = sal_False );
/** Apply specified filter to the bitmap
@@ -370,9 +370,9 @@ public:
@param pProgress
A callback for showing the progress of the vectorization
- @return TRUE, if the operation was completed successfully.
+ @return sal_True, if the operation was completed successfully.
*/
- BOOL Filter( BmpFilter eFilter,
+ sal_Bool Filter( BmpFilter eFilter,
const BmpFilterParam* pFilterParam = NULL,
const Link* pProgress = NULL );
diff --git a/vcl/inc/vcl/bmpacc.hxx b/vcl/inc/vcl/bmpacc.hxx
index e3530b786e65..650a60a69077 100644
--- a/vcl/inc/vcl/bmpacc.hxx
+++ b/vcl/inc/vcl/bmpacc.hxx
@@ -98,12 +98,12 @@ protected:
ColorMask maColorMask;
FncGetPixel mFncGetPixel;
FncSetPixel mFncSetPixel;
- BOOL mbModify;
+ sal_Bool mbModify;
SAL_DLLPRIVATE void ImplCreate( Bitmap& rBitmap );
SAL_DLLPRIVATE void ImplDestroy();
-SAL_DLLPRIVATE BOOL ImplSetAccessPointers( ULONG nFormat );
+SAL_DLLPRIVATE sal_Bool ImplSetAccessPointers( sal_uLong nFormat );
public:
@@ -127,49 +127,49 @@ SAL_DLLPRIVATE BitmapBuffer* ImplGetBitmapBuffer() const { return mpBuffer; }
DECL_FORMAT( _32BIT_TC_RGBA )
DECL_FORMAT( _32BIT_TC_MASK )
protected:
- BitmapReadAccess( Bitmap& rBitmap, BOOL bModify );
+ BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify );
void Flush();
- void ReAccess( BOOL bModify );
+ void ReAccess( sal_Bool bModify );
public:
BitmapReadAccess( Bitmap& rBitmap );
virtual ~BitmapReadAccess();
- inline BOOL operator!() const;
+ inline sal_Bool operator!() const;
inline long Width() const;
inline long Height() const;
inline Point TopLeft() const;
inline Point BottomRight() const;
- inline BOOL IsTopDown() const;
- inline BOOL IsBottomUp() const;
+ inline sal_Bool IsTopDown() const;
+ inline sal_Bool IsBottomUp() const;
- inline ULONG GetScanlineFormat() const;
- inline ULONG GetScanlineSize() const;
+ inline sal_uLong GetScanlineFormat() const;
+ inline sal_uLong GetScanlineSize() const;
- inline USHORT GetBitCount() const;
+ inline sal_uInt16 GetBitCount() const;
inline BitmapColor GetBestMatchingColor( const BitmapColor& rBitmapColor );
inline Scanline GetBuffer() const;
inline Scanline GetScanline( long nY ) const;
- inline BOOL HasPalette() const;
+ inline sal_Bool HasPalette() const;
inline const BitmapPalette& GetPalette() const;
- inline USHORT GetPaletteEntryCount() const;
- inline const BitmapColor& GetPaletteColor( USHORT nColor ) const;
+ inline sal_uInt16 GetPaletteEntryCount() const;
+ inline const BitmapColor& GetPaletteColor( sal_uInt16 nColor ) const;
inline const BitmapColor& GetBestPaletteColor( const BitmapColor& rBitmapColor ) const;
- USHORT GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
+ sal_uInt16 GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const;
- inline BOOL HasColorMask() const;
+ inline sal_Bool HasColorMask() const;
inline ColorMask& GetColorMask() const;
- inline BitmapColor GetPixelFromData( const BYTE* pData, long nX ) const;
- inline void SetPixelOnData( BYTE* pData, long nX, const BitmapColor& rBitmapColor );
+ inline BitmapColor GetPixelFromData( const sal_uInt8* pData, long nX ) const;
+ inline void SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor );
inline BitmapColor GetPixel( long nY, long nX ) const;
inline BitmapColor GetColor( long nY, long nX ) const;
- inline BYTE GetLuminance( long nY, long nX ) const;
+ inline sal_uInt8 GetLuminance( long nY, long nX ) const;
};
// ---------------------
@@ -185,13 +185,13 @@ public:
void CopyScanline( long nY, const BitmapReadAccess& rReadAcc );
void CopyScanline( long nY, ConstScanline aSrcScanline,
- ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize );
+ sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize );
void CopyBuffer( const BitmapReadAccess& rReadAcc );
inline void SetPalette( const BitmapPalette& rPalette );
- inline void SetPaletteEntryCount( USHORT nCount );
- inline void SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor );
+ inline void SetPaletteEntryCount( sal_uInt16 nCount );
+ inline void SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor );
inline void SetPixel( long nY, long nX, const BitmapColor& rBitmapColor );
@@ -296,7 +296,7 @@ typedef ScopedBitmapAccess< BitmapWriteAccess > ScopedBitmapWriteAccess;
// - Inlines -
// -----------
-inline BOOL BitmapReadAccess::operator!() const
+inline sal_Bool BitmapReadAccess::operator!() const
{
return( mpBuffer == NULL );
}
@@ -331,22 +331,22 @@ inline Point BitmapReadAccess::BottomRight() const
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::IsTopDown() const
+inline sal_Bool BitmapReadAccess::IsTopDown() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- return( mpBuffer ? sal::static_int_cast<BOOL>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : FALSE );
+ return( mpBuffer ? sal::static_int_cast<sal_Bool>( BMP_SCANLINE_ADJUSTMENT( mpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN ) : sal_False );
}
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::IsBottomUp() const
+inline sal_Bool BitmapReadAccess::IsBottomUp() const
{
return !IsTopDown();
}
// ------------------------------------------------------------------
-inline ULONG BitmapReadAccess::GetScanlineFormat() const
+inline sal_uLong BitmapReadAccess::GetScanlineFormat() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? BMP_SCANLINE_FORMAT( mpBuffer->mnFormat ) : 0UL );
@@ -354,7 +354,7 @@ inline ULONG BitmapReadAccess::GetScanlineFormat() const
// ------------------------------------------------------------------
-inline ULONG BitmapReadAccess::GetScanlineSize() const
+inline sal_uLong BitmapReadAccess::GetScanlineSize() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnScanlineSize : 0UL );
@@ -362,7 +362,7 @@ inline ULONG BitmapReadAccess::GetScanlineSize() const
// ------------------------------------------------------------------
-inline USHORT BitmapReadAccess::GetBitCount() const
+inline sal_uInt16 BitmapReadAccess::GetBitCount() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer ? mpBuffer->mnBitCount : 0 );
@@ -373,7 +373,7 @@ inline USHORT BitmapReadAccess::GetBitCount() const
inline BitmapColor BitmapReadAccess::GetBestMatchingColor( const BitmapColor& rBitmapColor )
{
if( HasPalette() )
- return BitmapColor( (BYTE) GetBestPaletteIndex( rBitmapColor ) );
+ return BitmapColor( (sal_uInt8) GetBestPaletteIndex( rBitmapColor ) );
else
return rBitmapColor;
}
@@ -397,7 +397,7 @@ inline Scanline BitmapReadAccess::GetScanline( long nY ) const
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::HasPalette() const
+inline sal_Bool BitmapReadAccess::HasPalette() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
return( mpBuffer && !!mpBuffer->maPalette );
@@ -413,7 +413,7 @@ inline const BitmapPalette& BitmapReadAccess::GetPalette() const
// ------------------------------------------------------------------
-inline USHORT BitmapReadAccess::GetPaletteEntryCount() const
+inline sal_uInt16 BitmapReadAccess::GetPaletteEntryCount() const
{
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
return( HasPalette() ? mpBuffer->maPalette.GetEntryCount() : 0 );
@@ -421,7 +421,7 @@ inline USHORT BitmapReadAccess::GetPaletteEntryCount() const
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapReadAccess::GetPaletteColor( USHORT nColor ) const
+inline const BitmapColor& BitmapReadAccess::GetPaletteColor( sal_uInt16 nColor ) const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
@@ -437,10 +437,10 @@ inline const BitmapColor& BitmapReadAccess::GetBestPaletteColor( const BitmapCol
// ------------------------------------------------------------------
-inline BOOL BitmapReadAccess::HasColorMask() const
+inline sal_Bool BitmapReadAccess::HasColorMask() const
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
- const ULONG nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
+ const sal_uLong nFormat = BMP_SCANLINE_FORMAT( mpBuffer->mnFormat );
return( nFormat == BMP_FORMAT_8BIT_TC_MASK ||
nFormat == BMP_FORMAT_16BIT_TC_MSB_MASK ||
@@ -469,7 +469,7 @@ inline BitmapColor BitmapReadAccess::GetPixel( long nY, long nX ) const
// ------------------------------------------------------------------
-inline BitmapColor BitmapReadAccess::GetPixelFromData( const BYTE* pData, long nX ) const
+inline BitmapColor BitmapReadAccess::GetPixelFromData( const sal_uInt8* pData, long nX ) const
{
DBG_ASSERT( pData, "Access is not valid!" );
return mFncGetPixel( pData, nX, maColorMask );
@@ -477,7 +477,7 @@ inline BitmapColor BitmapReadAccess::GetPixelFromData( const BYTE* pData, long n
// ------------------------------------------------------------------
-inline void BitmapReadAccess::SetPixelOnData( BYTE* pData, long nX, const BitmapColor& rBitmapColor )
+inline void BitmapReadAccess::SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor )
{
DBG_ASSERT( pData, "Access is not valid!" );
mFncSetPixel( pData, nX, rBitmapColor, maColorMask );
@@ -498,7 +498,7 @@ inline BitmapColor BitmapReadAccess::GetColor( long nY, long nX ) const
// ------------------------------------------------------------------
-inline BYTE BitmapReadAccess::GetLuminance( long nY, long nX ) const
+inline sal_uInt8 BitmapReadAccess::GetLuminance( long nY, long nX ) const
{
return GetColor( nY, nX ).GetLuminance();
}
@@ -513,7 +513,7 @@ inline void BitmapWriteAccess::SetPalette( const BitmapPalette& rPalette )
// ------------------------------------------------------------------
-inline void BitmapWriteAccess::SetPaletteEntryCount( USHORT nCount )
+inline void BitmapWriteAccess::SetPaletteEntryCount( sal_uInt16 nCount )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
mpBuffer->maPalette.SetEntryCount( nCount );
@@ -521,7 +521,7 @@ inline void BitmapWriteAccess::SetPaletteEntryCount( USHORT nCount )
// ------------------------------------------------------------------
-inline void BitmapWriteAccess::SetPaletteColor( USHORT nColor, const BitmapColor& rBitmapColor )
+inline void BitmapWriteAccess::SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor )
{
DBG_ASSERT( mpBuffer, "Access is not valid!" );
DBG_ASSERT( HasPalette(), "Bitmap has no palette!" );
diff --git a/vcl/inc/vcl/brdwin.hxx b/vcl/inc/vcl/brdwin.hxx
index 016e50e1366e..e6374ea032f5 100644
--- a/vcl/inc/vcl/brdwin.hxx
+++ b/vcl/inc/vcl/brdwin.hxx
@@ -38,39 +38,39 @@ class ImplBorderWindowView;
// - ImplBorderWindow-Types -
// --------------------------
-#define BORDERWINDOW_STYLE_OVERLAP ((USHORT)0x0001)
-#define BORDERWINDOW_STYLE_BORDER ((USHORT)0x0002)
-#define BORDERWINDOW_STYLE_FLOAT ((USHORT)0x0004)
-#define BORDERWINDOW_STYLE_FRAME ((USHORT)0x0008)
-#define BORDERWINDOW_STYLE_APP ((USHORT)0x0010)
-
-#define BORDERWINDOW_HITTEST_TITLE ((USHORT)0x0001)
-#define BORDERWINDOW_HITTEST_LEFT ((USHORT)0x0002)
-#define BORDERWINDOW_HITTEST_MENU ((USHORT)0x0004)
-#define BORDERWINDOW_HITTEST_TOP ((USHORT)0x0008)
-#define BORDERWINDOW_HITTEST_RIGHT ((USHORT)0x0010)
-#define BORDERWINDOW_HITTEST_BOTTOM ((USHORT)0x0020)
-#define BORDERWINDOW_HITTEST_TOPLEFT ((USHORT)0x0040)
-#define BORDERWINDOW_HITTEST_TOPRIGHT ((USHORT)0x0080)
-#define BORDERWINDOW_HITTEST_BOTTOMLEFT ((USHORT)0x0100)
-#define BORDERWINDOW_HITTEST_BOTTOMRIGHT ((USHORT)0x0200)
-#define BORDERWINDOW_HITTEST_CLOSE ((USHORT)0x0400)
-#define BORDERWINDOW_HITTEST_ROLL ((USHORT)0x0800)
-#define BORDERWINDOW_HITTEST_DOCK ((USHORT)0x1000)
-#define BORDERWINDOW_HITTEST_HIDE ((USHORT)0x2000)
-#define BORDERWINDOW_HITTEST_HELP ((USHORT)0x4000)
-#define BORDERWINDOW_HITTEST_PIN ((USHORT)0x8000)
-
-#define BORDERWINDOW_DRAW_TITLE ((USHORT)0x0001)
-#define BORDERWINDOW_DRAW_BORDER ((USHORT)0x0002)
-#define BORDERWINDOW_DRAW_FRAME ((USHORT)0x0004)
-#define BORDERWINDOW_DRAW_CLOSE ((USHORT)0x0008)
-#define BORDERWINDOW_DRAW_ROLL ((USHORT)0x0010)
-#define BORDERWINDOW_DRAW_DOCK ((USHORT)0x0020)
-#define BORDERWINDOW_DRAW_HIDE ((USHORT)0x0040)
-#define BORDERWINDOW_DRAW_HELP ((USHORT)0x0080)
-#define BORDERWINDOW_DRAW_PIN ((USHORT)0x0100)
-#define BORDERWINDOW_DRAW_MENU ((USHORT)0x0200)
+#define BORDERWINDOW_STYLE_OVERLAP ((sal_uInt16)0x0001)
+#define BORDERWINDOW_STYLE_BORDER ((sal_uInt16)0x0002)
+#define BORDERWINDOW_STYLE_FLOAT ((sal_uInt16)0x0004)
+#define BORDERWINDOW_STYLE_FRAME ((sal_uInt16)0x0008)
+#define BORDERWINDOW_STYLE_APP ((sal_uInt16)0x0010)
+
+#define BORDERWINDOW_HITTEST_TITLE ((sal_uInt16)0x0001)
+#define BORDERWINDOW_HITTEST_LEFT ((sal_uInt16)0x0002)
+#define BORDERWINDOW_HITTEST_MENU ((sal_uInt16)0x0004)
+#define BORDERWINDOW_HITTEST_TOP ((sal_uInt16)0x0008)
+#define BORDERWINDOW_HITTEST_RIGHT ((sal_uInt16)0x0010)
+#define BORDERWINDOW_HITTEST_BOTTOM ((sal_uInt16)0x0020)
+#define BORDERWINDOW_HITTEST_TOPLEFT ((sal_uInt16)0x0040)
+#define BORDERWINDOW_HITTEST_TOPRIGHT ((sal_uInt16)0x0080)
+#define BORDERWINDOW_HITTEST_BOTTOMLEFT ((sal_uInt16)0x0100)
+#define BORDERWINDOW_HITTEST_BOTTOMRIGHT ((sal_uInt16)0x0200)
+#define BORDERWINDOW_HITTEST_CLOSE ((sal_uInt16)0x0400)
+#define BORDERWINDOW_HITTEST_ROLL ((sal_uInt16)0x0800)
+#define BORDERWINDOW_HITTEST_DOCK ((sal_uInt16)0x1000)
+#define BORDERWINDOW_HITTEST_HIDE ((sal_uInt16)0x2000)
+#define BORDERWINDOW_HITTEST_HELP ((sal_uInt16)0x4000)
+#define BORDERWINDOW_HITTEST_PIN ((sal_uInt16)0x8000)
+
+#define BORDERWINDOW_DRAW_TITLE ((sal_uInt16)0x0001)
+#define BORDERWINDOW_DRAW_BORDER ((sal_uInt16)0x0002)
+#define BORDERWINDOW_DRAW_FRAME ((sal_uInt16)0x0004)
+#define BORDERWINDOW_DRAW_CLOSE ((sal_uInt16)0x0008)
+#define BORDERWINDOW_DRAW_ROLL ((sal_uInt16)0x0010)
+#define BORDERWINDOW_DRAW_DOCK ((sal_uInt16)0x0020)
+#define BORDERWINDOW_DRAW_HIDE ((sal_uInt16)0x0040)
+#define BORDERWINDOW_DRAW_HELP ((sal_uInt16)0x0080)
+#define BORDERWINDOW_DRAW_PIN ((sal_uInt16)0x0100)
+#define BORDERWINDOW_DRAW_MENU ((sal_uInt16)0x0200)
#define BORDERWINDOW_DRAW_ALL (BORDERWINDOW_DRAW_TITLE | \
BORDERWINDOW_DRAW_BORDER | \
BORDERWINDOW_DRAW_FRAME | \
@@ -82,11 +82,11 @@ class ImplBorderWindowView;
BORDERWINDOW_DRAW_PIN | \
BORDERWINDOW_DRAW_MENU)
-#define BORDERWINDOW_TITLE_NORMAL ((USHORT)0x0001)
-#define BORDERWINDOW_TITLE_SMALL ((USHORT)0x0002)
-#define BORDERWINDOW_TITLE_TEAROFF ((USHORT)0x0004)
-#define BORDERWINDOW_TITLE_POPUP ((USHORT)0x0008)
-#define BORDERWINDOW_TITLE_NONE ((USHORT)0x0010)
+#define BORDERWINDOW_TITLE_NORMAL ((sal_uInt16)0x0001)
+#define BORDERWINDOW_TITLE_SMALL ((sal_uInt16)0x0002)
+#define BORDERWINDOW_TITLE_TEAROFF ((sal_uInt16)0x0004)
+#define BORDERWINDOW_TITLE_POPUP ((sal_uInt16)0x0008)
+#define BORDERWINDOW_TITLE_NONE ((sal_uInt16)0x0010)
// --------------------
// - ImplBorderWindow -
@@ -108,26 +108,26 @@ private:
long mnMaxHeight;
long mnRollHeight;
long mnOrgMenuHeight;
- USHORT mnTitleType;
- USHORT mnBorderStyle;
- BOOL mbFloatWindow;
- BOOL mbSmallOutBorder;
- BOOL mbFrameBorder;
- BOOL mbPined;
- BOOL mbRollUp;
- BOOL mbMenuHide;
- BOOL mbDockBtn;
- BOOL mbHideBtn;
- BOOL mbHelpBtn;
- BOOL mbMenuBtn;
- BOOL mbDisplayActive;
+ sal_uInt16 mnTitleType;
+ sal_uInt16 mnBorderStyle;
+ sal_Bool mbFloatWindow;
+ sal_Bool mbSmallOutBorder;
+ sal_Bool mbFrameBorder;
+ sal_Bool mbPined;
+ sal_Bool mbRollUp;
+ sal_Bool mbMenuHide;
+ sal_Bool mbDockBtn;
+ sal_Bool mbHideBtn;
+ sal_Bool mbHelpBtn;
+ sal_Bool mbMenuBtn;
+ sal_Bool mbDisplayActive;
using Window::ImplInit;
void ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
SystemParentData* pParentData );
void ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& );
// Copy assignment is forbidden and not implemented.
@@ -138,11 +138,11 @@ public:
ImplBorderWindow( Window* pParent,
SystemParentData* pParentData,
WinBits nStyle = 0,
- USHORT nTypeStyle = 0 );
+ sal_uInt16 nTypeStyle = 0 );
ImplBorderWindow( Window* pParent, WinBits nStyle = 0,
- USHORT nTypeStyle = 0 );
+ sal_uInt16 nTypeStyle = 0 );
ImplBorderWindow( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& );
~ImplBorderWindow();
@@ -158,28 +158,28 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
void InitView();
- void UpdateView( BOOL bNewView, const Size& rNewOutSize );
+ void UpdateView( sal_Bool bNewView, const Size& rNewOutSize );
void InvalidateBorder();
using Window::Draw;
void Draw( const Rectangle& rRect, OutputDevice* pDev, const Point& rPos );
- void SetDisplayActive( BOOL bActive );
- BOOL IsDisplayActive() const { return mbDisplayActive; }
- void SetTitleType( USHORT nTitleType, const Size& rSize );
- void SetBorderStyle( USHORT nStyle );
- USHORT GetBorderStyle() const { return mnBorderStyle; }
- void SetPin( BOOL bPin );
- void SetRollUp( BOOL bRollUp, const Size& rSize );
+ void SetDisplayActive( sal_Bool bActive );
+ sal_Bool IsDisplayActive() const { return mbDisplayActive; }
+ void SetTitleType( sal_uInt16 nTitleType, const Size& rSize );
+ void SetBorderStyle( sal_uInt16 nStyle );
+ sal_uInt16 GetBorderStyle() const { return mnBorderStyle; }
+ void SetPin( sal_Bool bPin );
+ void SetRollUp( sal_Bool bRollUp, const Size& rSize );
void SetCloser();
- void SetDockButton( BOOL bDockButton );
- void SetHideButton( BOOL bHideButton );
- void SetHelpButton( BOOL bHelpButton );
- void SetMenuButton( BOOL bMenuButton );
+ void SetDockButton( sal_Bool bDockButton );
+ void SetHideButton( sal_Bool bHideButton );
+ void SetHelpButton( sal_Bool bHelpButton );
+ void SetMenuButton( sal_Bool bMenuButton );
void UpdateMenuHeight();
void SetMenuBarWindow( Window* pWindow );
- void SetMenuBarMode( BOOL bHide );
+ void SetMenuBarMode( sal_Bool bHide );
void SetMinOutputSize( long nWidth, long nHeight )
{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
@@ -226,18 +226,18 @@ struct ImplBorderFrameData
long mnBorderSize;
long mnTitleHeight;
long mnTitleOff;
- USHORT mnHitTest;
- USHORT mnPinState;
- USHORT mnCloseState;
- USHORT mnRollState;
- USHORT mnDockState;
- USHORT mnMenuState;
- USHORT mnHideState;
- USHORT mnHelpState;
- USHORT mnTitleType;
- BOOL mbFloatWindow;
- BOOL mbDragFull;
- BOOL mbTitleClipped;
+ sal_uInt16 mnHitTest;
+ sal_uInt16 mnPinState;
+ sal_uInt16 mnCloseState;
+ sal_uInt16 mnRollState;
+ sal_uInt16 mnDockState;
+ sal_uInt16 mnMenuState;
+ sal_uInt16 mnHideState;
+ sal_uInt16 mnHelpState;
+ sal_uInt16 mnTitleType;
+ sal_Bool mbFloatWindow;
+ sal_Bool mbDragFull;
+ sal_Bool mbTitleClipped;
};
// =======================================================================
@@ -251,23 +251,23 @@ class ImplBorderWindowView
public:
virtual ~ImplBorderWindowView();
- virtual BOOL MouseMove( const MouseEvent& rMEvt );
- virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
- virtual BOOL Tracking( const TrackingEvent& rTEvt );
+ virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
+ virtual sal_Bool Tracking( const TrackingEvent& rTEvt );
virtual String RequestHelp( const Point& rPos, Rectangle& rHelpRect );
virtual void Init( OutputDevice* pDev, long nWidth, long nHeight ) = 0;
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const = 0;
virtual long CalcTitleWidth() const = 0;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev = NULL, const Point* pOffset = NULL ) = 0;
virtual Rectangle GetMenuRect() const;
void ImplInitTitle( ImplBorderFrameData* pData );
- USHORT ImplHitTest( ImplBorderFrameData* pData, const Point& rPos );
- BOOL ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
- BOOL ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
- BOOL ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt );
+ sal_uInt16 ImplHitTest( ImplBorderFrameData* pData, const Point& rPos );
+ sal_Bool ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
+ sal_Bool ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt );
+ sal_Bool ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt );
String ImplRequestHelp( ImplBorderFrameData* pData, const Point& rPos, Rectangle& rHelpRect );
long ImplCalcTitleWidth( const ImplBorderFrameData* pData ) const;
};
@@ -287,7 +287,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -316,7 +316,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
@@ -337,9 +337,9 @@ public:
ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow );
~ImplStdBorderWindowView();
- virtual BOOL MouseMove( const MouseEvent& rMEvt );
- virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
- virtual BOOL Tracking( const TrackingEvent& rTEvt );
+ virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
+ virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
+ virtual sal_Bool Tracking( const TrackingEvent& rTEvt );
virtual String RequestHelp( const Point& rPos, Rectangle& rHelpRect );
virtual Rectangle GetMenuRect() const;
@@ -347,7 +347,7 @@ public:
virtual void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
virtual long CalcTitleWidth() const;
- virtual void DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
+ virtual void DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset );
};
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index a3bfaf55caad..ec537f517374 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -42,13 +42,13 @@ class PushButton;
// - ButtonDialog-Types -
// ----------------------
-#define BUTTONDIALOG_BUTTON_NOTFOUND ((USHORT)0xFFFF)
+#define BUTTONDIALOG_BUTTON_NOTFOUND ((sal_uInt16)0xFFFF)
-#define BUTTONDIALOG_DEFBUTTON ((USHORT)0x0001)
-#define BUTTONDIALOG_OKBUTTON ((USHORT)0x0002)
-#define BUTTONDIALOG_CANCELBUTTON ((USHORT)0x0004)
-#define BUTTONDIALOG_HELPBUTTON ((USHORT)0x0008)
-#define BUTTONDIALOG_FOCUSBUTTON ((USHORT)0x0010)
+#define BUTTONDIALOG_DEFBUTTON ((sal_uInt16)0x0001)
+#define BUTTONDIALOG_OKBUTTON ((sal_uInt16)0x0002)
+#define BUTTONDIALOG_CANCELBUTTON ((sal_uInt16)0x0004)
+#define BUTTONDIALOG_HELPBUTTON ((sal_uInt16)0x0008)
+#define BUTTONDIALOG_FOCUSBUTTON ((sal_uInt16)0x0010)
// ----------------
// - ButtonDialog -
@@ -61,14 +61,14 @@ private:
Size maPageSize;
Size maCtrlSize;
long mnButtonSize;
- USHORT mnCurButtonId;
- USHORT mnFocusButtonId;
- BOOL mbFormat;
+ sal_uInt16 mnCurButtonId;
+ sal_uInt16 mnFocusButtonId;
+ sal_Bool mbFormat;
Link maClickHdl;
SAL_DLLPRIVATE void ImplInitButtonDialogData();
- SAL_DLLPRIVATE PushButton* ImplCreatePushButton( USHORT nBtnFlags );
- SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( USHORT nId ) const;
+ SAL_DLLPRIVATE PushButton* ImplCreatePushButton( sal_uInt16 nBtnFlags );
+ SAL_DLLPRIVATE ImplBtnDlgItem* ImplGetItem( sal_uInt16 nId ) const;
DECL_DLLPRIVATE_LINK( ImplClickHdl, PushButton* pBtn );
SAL_DLLPRIVATE void ImplPosControls();
@@ -92,25 +92,25 @@ public:
void SetPageSizePixel( const Size& rSize ) { maPageSize = rSize; }
const Size& GetPageSizePixel() const { return maPageSize; }
- USHORT GetCurButtonId() const { return mnCurButtonId; }
+ sal_uInt16 GetCurButtonId() const { return mnCurButtonId; }
- void AddButton( const XubString& rText, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void AddButton( StandardButtonType eType, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void AddButton( PushButton* pBtn, USHORT nId, USHORT nBtnFlags, long nSepPixel = 0 );
- void RemoveButton( USHORT nId );
+ void AddButton( const XubString& rText, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( StandardButtonType eType, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void AddButton( PushButton* pBtn, sal_uInt16 nId, sal_uInt16 nBtnFlags, long nSepPixel = 0 );
+ void RemoveButton( sal_uInt16 nId );
void Clear();
- USHORT GetButtonCount() const;
- USHORT GetButtonId( USHORT nButton ) const;
- PushButton* GetPushButton( USHORT nId ) const;
- void SetButtonText( USHORT nId, const XubString& rText );
- XubString GetButtonText( USHORT nId ) const;
- void SetButtonHelpText( USHORT nId, const XubString& rText );
- XubString GetButtonHelpText( USHORT nId ) const;
- void SetButtonHelpId( USHORT nId, ULONG nHelpId );
- ULONG GetButtonHelpId( USHORT nId ) const;
-
- void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
- USHORT GetFocusButton() const { return mnFocusButtonId; }
+ sal_uInt16 GetButtonCount() const;
+ sal_uInt16 GetButtonId( sal_uInt16 nButton ) const;
+ PushButton* GetPushButton( sal_uInt16 nId ) const;
+ void SetButtonText( sal_uInt16 nId, const XubString& rText );
+ XubString GetButtonText( sal_uInt16 nId ) const;
+ void SetButtonHelpText( sal_uInt16 nId, const XubString& rText );
+ XubString GetButtonHelpText( sal_uInt16 nId ) const;
+ void SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId );
+ rtl::OString GetButtonHelpId( sal_uInt16 nId ) const;
+
+ void SetFocusButton( sal_uInt16 nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
+ sal_uInt16 GetFocusButton() const { return mnFocusButtonId; }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 41d3899366bf..9205f9df7661 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -56,17 +56,17 @@ private:
SAL_DLLPRIVATE Button (const Button &);
SAL_DLLPRIVATE Button & operator= (const Button &);
public:
- SAL_DLLPRIVATE USHORT ImplGetButtonState() const;
- SAL_DLLPRIVATE USHORT& ImplGetButtonState();
- SAL_DLLPRIVATE USHORT ImplGetTextStyle( XubString& rText, WinBits nWinStyle, ULONG nDrawFlags );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetButtonState() const;
+ SAL_DLLPRIVATE sal_uInt16& ImplGetButtonState();
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( XubString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
SAL_DLLPRIVATE void ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size& rSize,
- BOOL bLayout, ULONG nImageSep, ULONG nDrawFlags,
- USHORT nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
+ sal_Bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
+ sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
SAL_DLLPRIVATE void ImplSetFocusRect( const Rectangle &rFocusRect );
SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const;
SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
SAL_DLLPRIVATE SymbolAlign ImplGetSymbolAlign() const;
- SAL_DLLPRIVATE void ImplSetSmallSymbol( BOOL bSmall = TRUE );
+ SAL_DLLPRIVATE void ImplSetSmallSymbol( sal_Bool bSmall = sal_True );
SAL_DLLPRIVATE const Rectangle& ImplGetSymbolRect() const;
SAL_DLLPRIVATE void ImplSetSymbolRect(const Rectangle&);
@@ -79,7 +79,6 @@ public:
~Button();
virtual void Click();
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
@@ -87,19 +86,19 @@ public:
static XubString GetStandardText( StandardButtonType eButton );
static XubString GetStandardHelpText( StandardButtonType eButton );
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image GetModeImage( ) const;
- BOOL HasImage() const;
+ sal_Bool HasImage() const;
void SetImageAlign( ImageAlign eAlign );
ImageAlign GetImageAlign() const;
- BOOL SetModeBitmap( const BitmapEx& rBitmap );
+ sal_Bool SetModeBitmap( const BitmapEx& rBitmap );
BitmapEx GetModeBitmap( ) const;
- void EnableImageDisplay( BOOL bEnable );
- BOOL IsImageDisplayEnabled();
- void EnableTextDisplay( BOOL bEnable );
- BOOL IsTextDisplayEnabled();
+ void EnableImageDisplay( sal_Bool bEnable );
+ sal_Bool IsImageDisplayEnabled();
+ void EnableTextDisplay( sal_Bool bEnable );
+ sal_Bool IsTextDisplayEnabled();
void SetFocusRect( const Rectangle& rFocusRect );
const Rectangle& GetFocusRect() const;
@@ -111,8 +110,8 @@ public:
// - PushButton-Types -
// --------------------
-#define PUSHBUTTON_DROPDOWN_TOOLBOX ((USHORT)0x0001)
-#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((USHORT)0x0002)
+#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
+#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
// --------------
// - PushButton -
@@ -124,21 +123,21 @@ protected:
SymbolType meSymbol;
TriState meState;
TriState meSaveValue;
- USHORT mnDDStyle;
- BOOL mbPressed;
- BOOL mbInUserDraw;
+ sal_uInt16 mnDDStyle;
+ sal_Bool mbPressed;
+ sal_Bool mbInUserDraw;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitPushButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
- const Rectangle& rRect, bool bLayout );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false );
using Button::ImplGetTextStyle;
- SAL_DLLPRIVATE USHORT ImplGetTextStyle( ULONG nDrawFlags ) const;
- SAL_DLLPRIVATE BOOL IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
- SAL_DLLPRIVATE BOOL IsImage() const { return Button::HasImage(); }
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE sal_Bool IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
+ SAL_DLLPRIVATE sal_Bool IsImage() const { return Button::HasImage(); }
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE PushButton( const PushButton & );
@@ -149,10 +148,10 @@ protected:
using Control::ImplInitSettings;
using Window::ImplInit;
public:
- SAL_DLLPRIVATE void ImplSetDefButton( BOOL bSet );
- SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, USHORT nStyle );
- SAL_DLLPRIVATE static BOOL ImplHitTestPushButton( Window* pDev, const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsDefButton() const;
+ SAL_DLLPRIVATE void ImplSetDefButton( sal_Bool bSet );
+ SAL_DLLPRIVATE static void ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, sal_uInt16 nStyle );
+ SAL_DLLPRIVATE static sal_Bool ImplHitTestPushButton( Window* pDev, const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsDefButton() const;
protected:
PushButton( WindowType nType );
@@ -172,7 +171,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -188,17 +187,17 @@ public:
void SetSymbolAlign( SymbolAlign eAlign );
SymbolAlign GetSymbolAlign() const;
- void SetDropDown( USHORT nStyle );
- USHORT GetDropDown() const { return mnDDStyle; }
+ void SetDropDown( sal_uInt16 nStyle );
+ sal_uInt16 GetDropDown() const { return mnDDStyle; }
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const;
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
- void SetPressed( BOOL bPressed );
- BOOL IsPressed() const { return mbPressed; }
+ void SetPressed( sal_Bool bPressed );
+ sal_Bool IsPressed() const { return mbPressed; }
void EndSelection();
@@ -212,12 +211,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void PushButton::Check( BOOL bCheck )
+inline void PushButton::Check( sal_Bool bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL PushButton::IsChecked() const
+inline sal_Bool PushButton::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
@@ -298,17 +297,17 @@ private:
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
- BOOL mbChecked;
- BOOL mbSaveValue;
- BOOL mbRadioCheck;
- BOOL mbStateChanged;
+ sal_Bool mbChecked;
+ sal_Bool mbSaveValue;
+ sal_Bool mbRadioCheck;
+ sal_Bool mbStateChanged;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitRadioButtonData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplDrawRadioButtonState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout = false );
@@ -329,7 +328,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE void ImplCallClick( BOOL bGrabFocus = FALSE, USHORT nFocusFlags = 0 );
+ SAL_DLLPRIVATE void ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
@@ -358,7 +357,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -368,22 +367,22 @@ public:
virtual void Toggle();
- BOOL IsStateChanged() const { return mbStateChanged; }
+ sal_Bool IsStateChanged() const { return mbStateChanged; }
- void EnableRadioCheck( BOOL bRadioCheck = TRUE ) { mbRadioCheck = bRadioCheck; }
- BOOL IsRadioCheckEnabled() const { return mbRadioCheck; }
+ void EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
+ sal_Bool IsRadioCheckEnabled() const { return mbRadioCheck; }
- BOOL SetModeRadioImage( const Image& rImage );
+ sal_Bool SetModeRadioImage( const Image& rImage );
const Image& GetModeRadioImage( ) const;
- void SetState( BOOL bCheck );
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const { return mbChecked; }
+ void SetState( sal_Bool bCheck );
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const { return mbChecked; }
void SaveValue() { mbSaveValue = IsChecked(); }
- BOOL GetSavedValue() const { return mbSaveValue; }
+ sal_Bool GetSavedValue() const { return mbSaveValue; }
- static Image GetRadioImage( const AllSettings& rSettings, USHORT nFlags );
+ static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -418,14 +417,14 @@ private:
Rectangle maMouseRect;
TriState meState;
TriState meSaveValue;
- BOOL mbTriState;
+ sal_Bool mbTriState;
Link maToggleHdl;
SAL_DLLPRIVATE void ImplInitCheckBoxData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout );
@@ -463,7 +462,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void GetFocus();
virtual void LoseFocus();
@@ -476,16 +475,16 @@ public:
void SetState( TriState eState );
TriState GetState() const { return meState; }
- void Check( BOOL bCheck = TRUE );
- BOOL IsChecked() const;
+ void Check( sal_Bool bCheck = sal_True );
+ sal_Bool IsChecked() const;
- void EnableTriState( BOOL bTriState = TRUE );
- BOOL IsTriStateEnabled() const { return mbTriState; }
+ void EnableTriState( sal_Bool bTriState = sal_True );
+ sal_Bool IsTriStateEnabled() const { return mbTriState; }
void SaveValue() { meSaveValue = GetState(); }
TriState GetSavedValue() const { return meSaveValue; }
- static Image GetCheckImage( const AllSettings& rSettings, USHORT nFlags );
+ static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
Size CalcMinimumSize( long nMaxWidth = 0 ) const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
@@ -494,12 +493,12 @@ public:
const Link& GetToggleHdl() const { return maToggleHdl; }
};
-inline void CheckBox::Check( BOOL bCheck )
+inline void CheckBox::Check( sal_Bool bCheck )
{
SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL CheckBox::IsChecked() const
+inline sal_Bool CheckBox::IsChecked() const
{
return (GetState() == STATE_CHECK);
}
diff --git a/vcl/inc/vcl/canvasbitmap.hxx b/vcl/inc/vcl/canvasbitmap.hxx
index 4c4ef77ff5f7..e0773257b029 100644
--- a/vcl/inc/vcl/canvasbitmap.hxx
+++ b/vcl/inc/vcl/canvasbitmap.hxx
@@ -67,7 +67,7 @@ namespace unotools
bool m_bSwap;
bool m_bPalette;
- SAL_DLLPRIVATE void setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift );
+ SAL_DLLPRIVATE void setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift );
virtual ~VclCanvasBitmap();
diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx
index 529dba50fb3d..c71160b3fce1 100644
--- a/vcl/inc/vcl/cmdevt.hxx
+++ b/vcl/inc/vcl/cmdevt.hxx
@@ -39,54 +39,54 @@
// - CommandExtTextInputData -
// ---------------------------
-#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((USHORT)0x0100)
-#define EXTTEXTINPUT_ATTR_UNDERLINE ((USHORT)0x0200)
-#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((USHORT)0x0400)
-#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((USHORT)0x0800)
-#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((USHORT)0x1000)
-#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((USHORT)0x2000)
-#define EXTTEXTINPUT_ATTR_REDTEXT ((USHORT)0x4000)
-#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((USHORT)0x8000)
-
-#define EXTTEXTINPUT_CURSOR_INVISIBLE ((USHORT)0x0001)
-#define EXTTEXTINPUT_CURSOR_OVERWRITE ((USHORT)0x0002)
+#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
+#define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
+#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
+#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
+#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
+#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
+#define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
+#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
+
+#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
class VCL_DLLPUBLIC CommandExtTextInputData
{
private:
XubString maText;
- USHORT* mpTextAttr;
+ sal_uInt16* mpTextAttr;
xub_StrLen mnCursorPos;
xub_StrLen mnDeltaStart;
xub_StrLen mnOldTextLen;
- USHORT mnCursorFlags;
- BOOL mbOnlyCursor;
+ sal_uInt16 mnCursorFlags;
+ sal_Bool mbOnlyCursor;
public:
CommandExtTextInputData();
CommandExtTextInputData( const XubString& rText,
- const USHORT* pTextAttr,
+ const sal_uInt16* pTextAttr,
xub_StrLen nCursorPos,
- USHORT nCursorFlags,
+ sal_uInt16 nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- BOOL bOnlyCursor );
+ sal_Bool bOnlyCursor );
CommandExtTextInputData( const CommandExtTextInputData& rData );
~CommandExtTextInputData();
const XubString& GetText() const { return maText; }
- const USHORT* GetTextAttr() const { return mpTextAttr; }
- USHORT GetCharTextAttr( USHORT nIndex ) const;
+ const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
+ sal_uInt16 GetCharTextAttr( sal_uInt16 nIndex ) const;
xub_StrLen GetCursorPos() const { return mnCursorPos; }
- BOOL IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
- BOOL IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
- USHORT GetCursorFlags() const { return mnCursorFlags; }
+ sal_Bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
+ sal_Bool IsCursorOverwrite() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_OVERWRITE) != 0; }
+ sal_uInt16 GetCursorFlags() const { return mnCursorFlags; }
xub_StrLen GetDeltaStart() const { return mnDeltaStart; }
xub_StrLen GetOldTextLen() const { return mnOldTextLen; }
- BOOL IsOnlyCursorChanged() const { return mbOnlyCursor; }
+ sal_Bool IsOnlyCursorChanged() const { return mbOnlyCursor; }
};
-inline USHORT CommandExtTextInputData::GetCharTextAttr( USHORT nIndex ) const
+inline sal_uInt16 CommandExtTextInputData::GetCharTextAttr( sal_uInt16 nIndex ) const
{
if ( mpTextAttr && (nIndex < maText.Len()) )
return mpTextAttr[nIndex];
@@ -124,47 +124,47 @@ inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
// - CommandWheelData -
// --------------------
-#define COMMAND_WHEEL_SCROLL ((USHORT)0x0001)
-#define COMMAND_WHEEL_ZOOM ((USHORT)0x0002)
-#define COMMAND_WHEEL_DATAZOOM ((USHORT)0x0004)
+#define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
+#define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
+#define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
-#define COMMAND_WHEEL_PAGESCROLL ((ULONG)0xFFFFFFFF)
+#define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
class VCL_DLLPUBLIC CommandWheelData
{
private:
long mnDelta;
long mnNotchDelta;
- ULONG mnLines;
- USHORT mnMode;
- USHORT mnCode;
- BOOL mbHorz;
- BOOL mbDeltaIsPixel;
+ sal_uLong mnLines;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnCode;
+ sal_Bool mbHorz;
+ sal_Bool mbDeltaIsPixel;
public:
CommandWheelData();
CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- ULONG nScrollLines,
- USHORT nWheelMode, USHORT nKeyModifier,
- BOOL bHorz = FALSE, BOOL bDeltaIsPixel = FALSE );
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz = sal_False, sal_Bool bDeltaIsPixel = sal_False );
long GetDelta() const { return mnDelta; }
long GetNotchDelta() const { return mnNotchDelta; }
- ULONG GetScrollLines() const { return mnLines; }
- BOOL IsHorz() const { return mbHorz; }
- BOOL IsDeltaPixel() const { return mbDeltaIsPixel; }
+ sal_uLong GetScrollLines() const { return mnLines; }
+ sal_Bool IsHorz() const { return mbHorz; }
+ sal_Bool IsDeltaPixel() const { return mbDeltaIsPixel; }
- USHORT GetMode() const { return mnMode; }
+ sal_uInt16 GetMode() const { return mnMode; }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
bool IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -175,14 +175,14 @@ inline CommandWheelData::CommandWheelData()
mnLines = 0;
mnMode = 0;
mnCode = 0;
- mbHorz = FALSE;
- mbDeltaIsPixel = FALSE;
+ mbHorz = sal_False;
+ mbDeltaIsPixel = sal_False;
}
inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
- ULONG nScrollLines,
- USHORT nWheelMode, USHORT nKeyModifier,
- BOOL bHorz, BOOL bDeltaIsPixel )
+ sal_uLong nScrollLines,
+ sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ sal_Bool bHorz, sal_Bool bDeltaIsPixel )
{
mnDelta = nWheelDelta;
mnNotchDelta = nWheelNotchDelta;
@@ -237,17 +237,17 @@ class VCL_DLLPUBLIC CommandVoiceData
{
private:
XubString maText;
- USHORT mnCommand;
+ sal_uInt16 mnCommand;
DictationCommandType meType;
public:
CommandVoiceData();
CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- USHORT nCommand );
+ sal_uInt16 nCommand );
const XubString& GetText() const { return maText; }
- USHORT GetCommand() const { return mnCommand; }
+ sal_uInt16 GetCommand() const { return mnCommand; }
DictationCommandType GetType() const { return meType; }
};
@@ -259,7 +259,7 @@ inline CommandVoiceData::CommandVoiceData()
inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
DictationCommandType eType,
- USHORT nCommand ) :
+ sal_uInt16 nCommand ) :
maText( rStr ),
mnCommand( nCommand ),
meType( eType )
@@ -273,26 +273,26 @@ inline CommandVoiceData::CommandVoiceData( const XubString& rStr,
class VCL_DLLPUBLIC CommandModKeyData
{
private:
- USHORT mnCode;
+ sal_uInt16 mnCode;
public:
CommandModKeyData();
- CommandModKeyData( USHORT nCode );
+ CommandModKeyData( sal_uInt16 nCode );
bool IsShift() const { return (mnCode & MODKEY_SHIFT) ? true : false; }
- BOOL IsMod1() const { return (mnCode & MODKEY_MOD1) ? TRUE : FALSE; }
- BOOL IsMod2() const { return (mnCode & MODKEY_MOD2) ? TRUE : FALSE; }
- BOOL IsMod3() const { return (mnCode & MODKEY_MOD3) ? TRUE : FALSE; }
-
- BOOL IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? TRUE : FALSE; }
- BOOL IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? TRUE : FALSE; }
- BOOL IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? TRUE : FALSE; }
- BOOL IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? TRUE : FALSE; }
-
- BOOL IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? TRUE : FALSE; }
- BOOL IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? TRUE : FALSE; }
- BOOL IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? TRUE : FALSE; }
- BOOL IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? TRUE : FALSE; }
+ sal_Bool IsMod1() const { return (mnCode & MODKEY_MOD1) ? sal_True : sal_False; }
+ sal_Bool IsMod2() const { return (mnCode & MODKEY_MOD2) ? sal_True : sal_False; }
+ sal_Bool IsMod3() const { return (mnCode & MODKEY_MOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? sal_True : sal_False; }
+ sal_Bool IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? sal_True : sal_False; }
+
+ sal_Bool IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? sal_True : sal_False; }
+ sal_Bool IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? sal_True : sal_False; }
+ sal_Bool IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? sal_True : sal_False; }
+ sal_Bool IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? sal_True : sal_False; }
};
inline CommandModKeyData::CommandModKeyData()
@@ -300,7 +300,7 @@ inline CommandModKeyData::CommandModKeyData()
mnCode = 0L;
}
-inline CommandModKeyData::CommandModKeyData( USHORT nCode )
+inline CommandModKeyData::CommandModKeyData( sal_uInt16 nCode )
{
mnCode = nCode;
}
@@ -358,15 +358,15 @@ class VCL_DLLPUBLIC CommandDialogData
class VCL_DLLPUBLIC CommandSelectionChangeData
{
private:
- ULONG mnStart;
- ULONG mnEnd;
+ sal_uLong mnStart;
+ sal_uLong mnEnd;
public:
CommandSelectionChangeData();
- CommandSelectionChangeData( ULONG nStart, ULONG nEnd );
+ CommandSelectionChangeData( sal_uLong nStart, sal_uLong nEnd );
- ULONG GetStart() const { return mnStart; }
- ULONG GetEnd() const { return mnEnd; }
+ sal_uLong GetStart() const { return mnStart; }
+ sal_uLong GetEnd() const { return mnEnd; }
};
inline CommandSelectionChangeData::CommandSelectionChangeData()
@@ -374,8 +374,8 @@ inline CommandSelectionChangeData::CommandSelectionChangeData()
mnStart = mnEnd = 0;
}
-inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
- ULONG nEnd )
+inline CommandSelectionChangeData::CommandSelectionChangeData( sal_uLong nStart,
+ sal_uLong nEnd )
{
mnStart = nStart;
mnEnd = nEnd;
@@ -385,43 +385,43 @@ inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
// - CommandEvent -
// ----------------
-#define COMMAND_CONTEXTMENU ((USHORT)1)
-#define COMMAND_STARTDRAG ((USHORT)2)
-#define COMMAND_WHEEL ((USHORT)3)
-#define COMMAND_STARTAUTOSCROLL ((USHORT)4)
-#define COMMAND_AUTOSCROLL ((USHORT)5)
-#define COMMAND_VOICE ((USHORT)6)
-#define COMMAND_STARTEXTTEXTINPUT ((USHORT)7)
-#define COMMAND_EXTTEXTINPUT ((USHORT)8)
-#define COMMAND_ENDEXTTEXTINPUT ((USHORT)9)
-#define COMMAND_INPUTCONTEXTCHANGE ((USHORT)10)
-#define COMMAND_CURSORPOS ((USHORT)11)
-#define COMMAND_PASTESELECTION ((USHORT)12)
-#define COMMAND_MODKEYCHANGE ((USHORT)13)
-#define COMMAND_HANGUL_HANJA_CONVERSION ((USHORT)14)
-#define COMMAND_INPUTLANGUAGECHANGE ((USHORT)15)
-#define COMMAND_SHOWDIALOG ((USHORT)16)
-#define COMMAND_MEDIA ((USHORT)17)
-#define COMMAND_SELECTIONCHANGE ((USHORT)18)
-#define COMMAND_PREPARERECONVERSION ((USHORT)19)
-#define COMMAND_USER ((USHORT)4096)
+#define COMMAND_CONTEXTMENU ((sal_uInt16)1)
+#define COMMAND_STARTDRAG ((sal_uInt16)2)
+#define COMMAND_WHEEL ((sal_uInt16)3)
+#define COMMAND_STARTAUTOSCROLL ((sal_uInt16)4)
+#define COMMAND_AUTOSCROLL ((sal_uInt16)5)
+#define COMMAND_VOICE ((sal_uInt16)6)
+#define COMMAND_STARTEXTTEXTINPUT ((sal_uInt16)7)
+#define COMMAND_EXTTEXTINPUT ((sal_uInt16)8)
+#define COMMAND_ENDEXTTEXTINPUT ((sal_uInt16)9)
+#define COMMAND_INPUTCONTEXTCHANGE ((sal_uInt16)10)
+#define COMMAND_CURSORPOS ((sal_uInt16)11)
+#define COMMAND_PASTESELECTION ((sal_uInt16)12)
+#define COMMAND_MODKEYCHANGE ((sal_uInt16)13)
+#define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
+#define COMMAND_INPUTLANGUAGECHANGE ((sal_uInt16)15)
+#define COMMAND_SHOWDIALOG ((sal_uInt16)16)
+#define COMMAND_MEDIA ((sal_uInt16)17)
+#define COMMAND_SELECTIONCHANGE ((sal_uInt16)18)
+#define COMMAND_PREPARERECONVERSION ((sal_uInt16)19)
+#define COMMAND_USER ((sal_uInt16)4096)
class VCL_DLLPUBLIC CommandEvent
{
private:
Point maPos;
void* mpData;
- USHORT mnCommand;
- BOOL mbMouseEvent;
+ sal_uInt16 mnCommand;
+ sal_Bool mbMouseEvent;
public:
CommandEvent();
- CommandEvent( const Point& rMousePos, USHORT nCmd,
- BOOL bMEvt = FALSE, const void* pCmdData = NULL );
+ CommandEvent( const Point& rMousePos, sal_uInt16 nCmd,
+ sal_Bool bMEvt = sal_False, const void* pCmdData = NULL );
- USHORT GetCommand() const { return mnCommand; }
+ sal_uInt16 GetCommand() const { return mnCommand; }
const Point& GetMousePosPixel() const { return maPos; }
- BOOL IsMouseEvent() const { return mbMouseEvent; }
+ sal_Bool IsMouseEvent() const { return mbMouseEvent; }
void* GetData() const { return mpData; }
const CommandExtTextInputData* GetExtTextInputData() const;
@@ -439,11 +439,11 @@ inline CommandEvent::CommandEvent()
{
mpData = NULL;
mnCommand = 0;
- mbMouseEvent = FALSE;
+ mbMouseEvent = sal_False;
}
inline CommandEvent::CommandEvent( const Point& rMousePos,
- USHORT nCmd, BOOL bMEvt, const void* pCmdData ) :
+ sal_uInt16 nCmd, sal_Bool bMEvt, const void* pCmdData ) :
maPos( rMousePos )
{
mpData = (void*)pCmdData;
diff --git a/vcl/inc/vcl/combobox.h b/vcl/inc/vcl/combobox.h
index cfcec12d75bc..387c20d544be 100644
--- a/vcl/inc/vcl/combobox.h
+++ b/vcl/inc/vcl/combobox.h
@@ -29,11 +29,11 @@
#ifndef _SV_COMBOBOX_H
#define _SV_COMBOBOX_H
-#define COMBOBOX_APPEND ((USHORT)0xFFFF)
-#define COMBOBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
-#define COMBOBOX_ERROR ((USHORT)0xFFFF)
+#define COMBOBOX_APPEND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define COMBOBOX_ERROR ((sal_uInt16)0xFFFF)
-#define COMBOBOX_USERDRAW_SELECTED ((USHORT)0x0001)
+#define COMBOBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
#endif // _SV_COMBOBOX_H
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index 3ab9f6dfa630..12385c9bd9e2 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -51,11 +51,11 @@ private:
ImplListBox* mpImplLB;
ImplBtn* mpBtn;
ImplListBoxFloatingWindow* mpFloatWin;
- USHORT mnDDHeight;
+ sal_uInt16 mnDDHeight;
xub_Unicode mcMultiSep;
- BOOL mbDDAutoSize : 1;
- BOOL mbSyntheticModify : 1;
- BOOL mbMatchCase : 1;
+ sal_Bool mbDDAutoSize : 1;
+ sal_Bool mbSyntheticModify : 1;
+ sal_Bool mbMatchCase : 1;
Link maSelectHdl;
Link maDoubleClickHdl;
@@ -81,7 +81,7 @@ protected:
protected:
ComboBox( WindowType nType );
- BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : FALSE; }
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
virtual void FillLayoutData() const;
public:
@@ -89,7 +89,7 @@ public:
ComboBox( Window* pParent, const ResId& rResId );
~ComboBox();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
virtual long Notify( NotifyEvent& rNEvt );
@@ -104,7 +104,7 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
- virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Edit::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
@@ -115,56 +115,56 @@ public:
// returns empty rectangle in DropDown mode,
// else it returns the PosSize of the ListBox
- void SetDropDownLineCount( USHORT nLines );
- USHORT GetDropDownLineCount() const;
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
- void EnableAutoSize( BOOL bAuto );
- BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( BOOL b );
- BOOL IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( sal_Bool b );
+ sal_Bool IsDDAutoWidthEnabled() const;
void SetText( const XubString& rStr );
void SetText( const XubString& rStr, const Selection& rNewSelection );
- USHORT InsertEntry( const XubString& rStr, USHORT nPos = COMBOBOX_APPEND );
- USHORT InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = COMBOBOX_APPEND );
+ sal_uInt16 InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveEntry( const XubString& rStr );
- void RemoveEntry( USHORT nPos );
+ void RemoveEntry( sal_uInt16 nPos );
void Clear();
- USHORT GetEntryPos( const XubString& rStr ) const;
- USHORT GetEntryPos( const void* pData ) const;
- Image GetEntryImage( USHORT nPos ) const;
- XubString GetEntry( USHORT nPos ) const;
- USHORT GetEntryCount() const;
+ sal_uInt16 GetEntryPos( const XubString& rStr ) const;
+ sal_uInt16 GetEntryPos( const void* pData ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ XubString GetEntry( sal_uInt16 nPos ) const;
+ sal_uInt16 GetEntryCount() const;
- BOOL IsTravelSelect() const;
- BOOL IsInDropDown() const;
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
void ToggleDropDown();
- long CalcWindowSizePixel( USHORT nLines ) const;
+ long CalcWindowSizePixel( sal_uInt16 nLines ) const;
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const;
- void EnableUserDraw( BOOL bUserDraw );
- BOOL IsUserDrawEnabled() const;
+ void EnableUserDraw( sal_Bool bUserDraw );
+ sal_Bool IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
- void SetBorderStyle( USHORT nBorderStyle );
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
- void SetSeparatorPos( USHORT n );
+ void SetSeparatorPos( sal_uInt16 n );
void SetSeparatorPos();
- USHORT GetSeparatorPos() const;
+ sal_uInt16 GetSeparatorPos() const;
- void EnableAutocomplete( BOOL bEnable, BOOL bMatchCase = FALSE );
- BOOL IsAutocompleteEnabled() const;
+ void EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase = sal_False );
+ sal_Bool IsAutocompleteEnabled() const;
- void EnableMultiSelection( BOOL bMulti );
- BOOL IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
void SetMultiSelectionSeparator( xub_Unicode cSep ) { mcMultiSep = cSep; }
xub_Unicode GetMultiSelectionSeparator() const { return mcMultiSep; }
@@ -177,32 +177,32 @@ public:
virtual Size GetOptimalSize(WindowSizeType eType) const;
Size CalcAdjustedSize( const Size& rPrefSize ) const;
using Edit::CalcSize;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( USHORT n );
- USHORT GetMaxMRUCount() const;
+ void SetMaxMRUCount( sal_uInt16 n );
+ sal_uInt16 GetMaxMRUCount() const;
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
- void SetTopEntry( USHORT nPos );
- void ShowProminentEntry( USHORT nPos );
- USHORT GetTopEntry() const;
+ void SetTopEntry( sal_uInt16 nPos );
+ void ShowProminentEntry( sal_uInt16 nPos );
+ sal_uInt16 GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
- USHORT GetDisplayLineCount() const;
+ sal_uInt16 GetDisplayLineCount() const;
- USHORT GetSelectEntryCount() const;
- USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
- BOOL IsEntryPosSelected( USHORT nPos ) const;
- void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
+ sal_uInt16 GetSelectEntryCount() const;
+ sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
+ sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
+ void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
void SetNoSelection();
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
/** checks whether a certain point lies within the bounds of
a list item and returns the item as well as the character position
@@ -223,7 +223,7 @@ public:
if no item is at that point.
*/
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
};
#endif // _COMBOBOX_HXX
diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 1790096f8cdd..71d7d88d6003 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -48,7 +48,7 @@ protected:
::vcl::ImplControlData* mpControlData;
private:
- BOOL mbHasFocus;
+ sal_Bool mbHasFocus;
Link maGetFocusHdl;
Link maLoseFocusHdl;
@@ -87,8 +87,8 @@ protected:
@return
if the Control instance has been destroyed in any of the call
*/
- BOOL ImplCallEventListenersAndHandler(
- ULONG nEvent, const Link& rHandler, void* pCaller
+ sal_Bool ImplCallEventListenersAndHandler(
+ sal_uLong nEvent, const Link& rHandler, void* pCaller
);
/** draws the given text onto the given device
@@ -100,7 +100,7 @@ protected:
directly at the target device, or taking the reference device into account) when returning.
*/
void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
- const XubString& _rStr, USHORT _nStyle,
+ const XubString& _rStr, sal_uInt16 _nStyle,
MetricVector* _pVector, String* _pDisplayText ) const;
virtual const Font&
@@ -108,7 +108,7 @@ protected:
virtual const Color&
GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
- void ImplInitSettings( const BOOL _bFont, const BOOL _bForeground );
+ void ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForeground );
public:
SAL_DLLPRIVATE void ImplClearLayoutData() const;
diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx
index f1f07957db96..8a6ecf482413 100644
--- a/vcl/inc/vcl/cursor.hxx
+++ b/vcl/inc/vcl/cursor.hxx
@@ -42,7 +42,7 @@ class Window;
// - Cursor-Styles -
// -----------------
-#define CURSOR_SHADOW ((USHORT)0x0001)
+#define CURSOR_SHADOW ((sal_uInt16)0x0001)
#define CURSOR_DIRECTION_NONE ((unsigned char)0x00)
#define CURSOR_DIRECTION_LTR ((unsigned char)0x01)
#define CURSOR_DIRECTION_RTL ((unsigned char)0x02)
@@ -61,15 +61,15 @@ private:
Size maSize; // Groesse
Point maPos; // Position
short mnOrientation; // Rotation
- USHORT mnStyle; // Style
- BOOL mbVisible; // Ist Cursor sichtbar
+ sal_uInt16 mnStyle; // Style
+ sal_Bool mbVisible; // Ist Cursor sichtbar
unsigned char mnDirection; // indicates direction
public:
SAL_DLLPRIVATE void ImplDraw();
SAL_DLLPRIVATE void ImplRestore();
DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* );
- SAL_DLLPRIVATE void ImplShow( BOOL bDrawDirect = TRUE );
+ SAL_DLLPRIVATE void ImplShow( sal_Bool bDrawDirect = sal_True );
SAL_DLLPRIVATE void ImplHide();
SAL_DLLPRIVATE void ImplNew();
@@ -78,12 +78,12 @@ public:
Cursor( const Cursor& rCursor );
~Cursor();
- void SetStyle( USHORT nStyle );
- USHORT GetStyle() const { return mnStyle; }
+ void SetStyle( sal_uInt16 nStyle );
+ sal_uInt16 GetStyle() const { return mnStyle; }
void Show();
void Hide();
- BOOL IsVisible() const { return mbVisible; }
+ sal_Bool IsVisible() const { return mbVisible; }
void SetWindow( Window* pWindow );
Window* GetWindow() const { return mpWindow; }
@@ -110,8 +110,8 @@ public:
unsigned char GetDirection() const { return mnDirection; }
Cursor& operator=( const Cursor& rCursor );
- BOOL operator==( const Cursor& rCursor ) const;
- BOOL operator!=( const Cursor& rCursor ) const
+ sal_Bool operator==( const Cursor& rCursor ) const;
+ sal_Bool operator!=( const Cursor& rCursor ) const
{ return !(Cursor::operator==( rCursor )); }
};
diff --git a/vcl/inc/vcl/cvtgrf.hxx b/vcl/inc/vcl/cvtgrf.hxx
index 37a3c271b52c..50d766f5565c 100644
--- a/vcl/inc/vcl/cvtgrf.hxx
+++ b/vcl/inc/vcl/cvtgrf.hxx
@@ -48,16 +48,16 @@ private:
ConvertData* mpConvertData;
public:
- SAL_DLLPRIVATE ULONG ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- void** ppOutBuffer, ULONG nOutFormat );
+ SAL_DLLPRIVATE sal_uLong ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ void** ppOutBuffer, sal_uLong nOutFormat );
public:
GraphicConverter();
~GraphicConverter();
- static ULONG Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat = CVT_UNKNOWN );
- static ULONG Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat );
+ static sal_uLong Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat = CVT_UNKNOWN );
+ static sal_uLong Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat );
ConvertData* GetConvertData() { return mpConvertData; }
diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index f7c45f50ed16..de4158e08efc 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -93,18 +93,18 @@
class Stack;
-class VCL_DLLPUBLIC SVMConverter
+class VCL_PLUGIN_PUBLIC SVMConverter
{
private:
SAL_DLLPRIVATE void ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf );
SAL_DLLPRIVATE void ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf );
- SAL_DLLPRIVATE ULONG ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, BOOL& rRop_0_1,
+ SAL_DLLPRIVATE sal_uLong ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet );
public:
- SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, ULONG nConvertMode );
+ SVMConverter( SvStream& rIStm, GDIMetaFile& rMtf, sal_uLong nConvertMode );
~SVMConverter() {}
private:
diff --git a/vcl/inc/vcl/dbggui.hxx b/vcl/inc/vcl/dbggui.hxx
index 326111273a1c..61d878de3451 100644
--- a/vcl/inc/vcl/dbggui.hxx
+++ b/vcl/inc/vcl/dbggui.hxx
@@ -51,7 +51,7 @@ void DbgDialogTest( Window* pWindow );
->DbgData::nWarningOut and ->DbgData::nTraceOut
@see DBG_OUT_USER_CHANNEL_0
*/
-USHORT DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc );
+sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc );
#define DBGGUI_INIT() DbgGUIInit()
#define DBGGUI_DEINIT() DbgGUIDeInit()
diff --git a/vcl/inc/vcl/decoview.hxx b/vcl/inc/vcl/decoview.hxx
index f5317c204a29..63434bea2830 100644
--- a/vcl/inc/vcl/decoview.hxx
+++ b/vcl/inc/vcl/decoview.hxx
@@ -43,45 +43,45 @@ class OutputDevice;
// ------------------------
// Flags for DrawSymbol()
-#define SYMBOL_DRAW_MONO ((USHORT)0x0001)
-#define SYMBOL_DRAW_DISABLE ((USHORT)0x0002)
+#define SYMBOL_DRAW_MONO ((sal_uInt16)0x0001)
+#define SYMBOL_DRAW_DISABLE ((sal_uInt16)0x0002)
// Flags for DrawFrame()
-#define FRAME_DRAW_IN ((USHORT)0x0001)
-#define FRAME_DRAW_OUT ((USHORT)0x0002)
-#define FRAME_DRAW_GROUP ((USHORT)0x0003)
-#define FRAME_DRAW_DOUBLEIN ((USHORT)0x0004)
-#define FRAME_DRAW_DOUBLEOUT ((USHORT)0x0005)
-#define FRAME_DRAW_MENU ((USHORT)0x0010)
-#define FRAME_DRAW_WINDOWBORDER ((USHORT)0x0020)
-#define FRAME_DRAW_BORDERWINDOWBORDER ((USHORT)0x0040)
-#define FRAME_DRAW_MONO ((USHORT)0x1000)
-#define FRAME_DRAW_NODRAW ((USHORT)0x8000)
-#define FRAME_DRAW_STYLE ((USHORT)0x000F)
+#define FRAME_DRAW_IN ((sal_uInt16)0x0001)
+#define FRAME_DRAW_OUT ((sal_uInt16)0x0002)
+#define FRAME_DRAW_GROUP ((sal_uInt16)0x0003)
+#define FRAME_DRAW_DOUBLEIN ((sal_uInt16)0x0004)
+#define FRAME_DRAW_DOUBLEOUT ((sal_uInt16)0x0005)
+#define FRAME_DRAW_MENU ((sal_uInt16)0x0010)
+#define FRAME_DRAW_WINDOWBORDER ((sal_uInt16)0x0020)
+#define FRAME_DRAW_BORDERWINDOWBORDER ((sal_uInt16)0x0040)
+#define FRAME_DRAW_MONO ((sal_uInt16)0x1000)
+#define FRAME_DRAW_NODRAW ((sal_uInt16)0x8000)
+#define FRAME_DRAW_STYLE ((sal_uInt16)0x000F)
// Flags for DrawHighlightFrame()
-#define FRAME_HIGHLIGHT_IN ((USHORT)0x0001)
-#define FRAME_HIGHLIGHT_OUT ((USHORT)0x0002)
-#define FRAME_HIGHLIGHT_TESTBACKGROUND ((USHORT)0x4000)
-#define FRAME_HIGHLIGHT_STYLE ((USHORT)0x000F)
+#define FRAME_HIGHLIGHT_IN ((sal_uInt16)0x0001)
+#define FRAME_HIGHLIGHT_OUT ((sal_uInt16)0x0002)
+#define FRAME_HIGHLIGHT_TESTBACKGROUND ((sal_uInt16)0x4000)
+#define FRAME_HIGHLIGHT_STYLE ((sal_uInt16)0x000F)
// Flags for DrawButton()
-#define BUTTON_DRAW_DEFAULT ((USHORT)0x0001)
-#define BUTTON_DRAW_NOLIGHTBORDER ((USHORT)0x0002)
-#define BUTTON_DRAW_PRESSED ((USHORT)0x0004)
-#define BUTTON_DRAW_CHECKED ((USHORT)0x0008)
-#define BUTTON_DRAW_DONTKNOW ((USHORT)0x0010)
-#define BUTTON_DRAW_MONO ((USHORT)0x0020)
-#define BUTTON_DRAW_NOFILL ((USHORT)0x0040)
-#define BUTTON_DRAW_DISABLED ((USHORT)0x0080)
-#define BUTTON_DRAW_HIGHLIGHT ((USHORT)0x0100)
-#define BUTTON_DRAW_FLAT ((USHORT)0x0200)
-#define BUTTON_DRAW_NOTOPLIGHTBORDER ((USHORT)0x0400)
-#define BUTTON_DRAW_NOBOTTOMSHADOWBORDER ((USHORT)0x0800)
-#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((USHORT)0x1000)
-#define BUTTON_DRAW_NOTEXT ((USHORT)0x2000)
-#define BUTTON_DRAW_NOIMAGE ((USHORT)0x4000)
-#define BUTTON_DRAW_NODRAW ((USHORT)0x8000)
+#define BUTTON_DRAW_DEFAULT ((sal_uInt16)0x0001)
+#define BUTTON_DRAW_NOLIGHTBORDER ((sal_uInt16)0x0002)
+#define BUTTON_DRAW_PRESSED ((sal_uInt16)0x0004)
+#define BUTTON_DRAW_CHECKED ((sal_uInt16)0x0008)
+#define BUTTON_DRAW_DONTKNOW ((sal_uInt16)0x0010)
+#define BUTTON_DRAW_MONO ((sal_uInt16)0x0020)
+#define BUTTON_DRAW_NOFILL ((sal_uInt16)0x0040)
+#define BUTTON_DRAW_DISABLED ((sal_uInt16)0x0080)
+#define BUTTON_DRAW_HIGHLIGHT ((sal_uInt16)0x0100)
+#define BUTTON_DRAW_FLAT ((sal_uInt16)0x0200)
+#define BUTTON_DRAW_NOTOPLIGHTBORDER ((sal_uInt16)0x0400)
+#define BUTTON_DRAW_NOBOTTOMSHADOWBORDER ((sal_uInt16)0x0800)
+#define BUTTON_DRAW_NOLEFTLIGHTBORDER ((sal_uInt16)0x1000)
+#define BUTTON_DRAW_NOTEXT ((sal_uInt16)0x2000)
+#define BUTTON_DRAW_NOIMAGE ((sal_uInt16)0x4000)
+#define BUTTON_DRAW_NODRAW ((sal_uInt16)0x8000)
// ------------------
// - DecorationView -
@@ -97,14 +97,14 @@ public:
{ mpOutDev = pOutDev; }
void DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, USHORT nStyle = 0 );
+ const Color& rColor, sal_uInt16 nStyle = 0 );
void DrawFrame( const Rectangle& rRect,
const Color& rLeftTopColor,
const Color& rRightBottomColor );
void DrawHighlightFrame( const Rectangle& rRect,
- USHORT nStyle = FRAME_HIGHLIGHT_OUT );
- Rectangle DrawFrame( const Rectangle& rRect, USHORT nStyle = FRAME_DRAW_OUT );
- Rectangle DrawButton( const Rectangle& rRect, USHORT nStyle );
+ sal_uInt16 nStyle = FRAME_HIGHLIGHT_OUT );
+ Rectangle DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle = FRAME_DRAW_OUT );
+ Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle );
void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
};
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 404b18127af8..7b8c3ac032f2 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -50,10 +50,10 @@ private:
Dialog* mpPrevExecuteDlg;
DialogImpl* mpDialogImpl;
long mnMousePositioned;
- BOOL mbInExecute;
- BOOL mbOldSaveBack;
- BOOL mbInClose;
- BOOL mbModalMode;
+ sal_Bool mbInExecute;
+ sal_Bool mbOldSaveBack;
+ sal_Bool mbInClose;
+ sal_Bool mbModalMode;
sal_Int8 mnCancelClose; //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
SAL_DLLPRIVATE void ImplInitDialogData();
@@ -71,11 +71,11 @@ protected:
SAL_DLLPRIVATE void ImplCenterDialog();
public:
- SAL_DLLPRIVATE BOOL IsInClose() const { return mbInClose; }
+ SAL_DLLPRIVATE sal_Bool IsInClose() const { return mbInClose; }
protected:
Dialog( WindowType nType );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
public:
Dialog( Window* pParent, WinBits nStyle = WB_STDDIALOG );
@@ -86,10 +86,10 @@ public:
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual short Execute();
- BOOL IsInExecute() const { return mbInExecute; }
+ sal_Bool IsInExecute() const { return mbInExecute; }
sal_Int8 GetCloseFlag() const { return mnCancelClose; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
void SetCloseFlag( sal_Int8 nCancel ) { mnCancelClose = nCancel; } //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
@@ -99,10 +99,10 @@ public:
public:
// Link impl: DECL_LINK( MyEndDialogHdl, Dialog* ); <= param is dialog just ended
virtual void StartExecuteModal( const Link& rEndDialogHdl );
- BOOL IsStartedModal() const;
+ sal_Bool IsStartedModal() const;
long GetResult() const;
private:
- BOOL ImplStartExecuteModal();
+ sal_Bool ImplStartExecuteModal();
void ImplEndExecuteModal();
public:
@@ -115,9 +115,9 @@ public:
void GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
- void SetModalInputMode( BOOL bModal );
- void SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs );
- BOOL IsModalInputMode() const { return mbModalMode; }
+ void SetModalInputMode( sal_Bool bModal );
+ void SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs );
+ sal_Bool IsModalInputMode() const { return mbModalMode; }
void GrabFocusToFirstControl();
};
@@ -149,7 +149,7 @@ public:
private:
using Window::Show;
- void Show( BOOL bVisible = TRUE );
+ void Show( sal_Bool bVisible = sal_True );
using Window::Hide;
void Hide();
diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx
new file mode 100644
index 000000000000..fea1d0b7cba9
--- /dev/null
+++ b/vcl/inc/vcl/displayconnectiondispatch.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+#define INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/awt/XDisplayConnection.hpp"
+#include "cppuhelper/implbase1.hxx"
+
+namespace vcl {
+
+class DisplayConnectionDispatch:
+ public cppu::WeakImplHelper1< com::sun::star::awt::XDisplayConnection >
+{
+public:
+ virtual bool dispatchEvent(void * pData, int nBytes) = 0;
+
+ virtual bool dispatchErrorEvent(void * pData, int nBytes) = 0;
+
+protected:
+ virtual ~DisplayConnectionDispatch() {}
+};
+
+}
+
+#endif
diff --git a/vcl/inc/vcl/dllapi.h b/vcl/inc/vcl/dllapi.h
index dfe59bb5b739..3ec80dd0ec7d 100644
--- a/vcl/inc/vcl/dllapi.h
+++ b/vcl/inc/vcl/dllapi.h
@@ -38,6 +38,12 @@
#define VCL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
+#if defined UNX && ! defined MACOS
+#define VCL_PLUGIN_PUBLIC VCL_DLLPUBLIC
+#else
+#define VCL_PLUGIN_PUBLIC SAL_DLLPRIVATE
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/dockingarea.hxx b/vcl/inc/vcl/dockingarea.hxx
index cc56a57f3315..7ba82d380f58 100644
--- a/vcl/inc/vcl/dockingarea.hxx
+++ b/vcl/inc/vcl/dockingarea.hxx
@@ -54,7 +54,7 @@ public:
void SetAlign( WindowAlign eNewAlign );
WindowAlign GetAlign() const;
- BOOL IsHorizontal() const;
+ sal_Bool IsHorizontal() const;
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
diff --git a/vcl/inc/vcl/dockwin.hxx b/vcl/inc/vcl/dockwin.hxx
index 4950e267a786..5721d979b188 100644
--- a/vcl/inc/vcl/dockwin.hxx
+++ b/vcl/inc/vcl/dockwin.hxx
@@ -39,24 +39,24 @@ struct DockingData
{
Point maMousePos; // in
Rectangle maTrackRect; // in/out
- BOOL mbFloating; // out
- BOOL mbLivemode; // in
- BOOL mbInteractive; // in
+ sal_Bool mbFloating; // out
+ sal_Bool mbLivemode; // in
+ sal_Bool mbInteractive; // in
DockingData() {};
- DockingData( const Point& rPt, const Rectangle& rRect, BOOL b) :
- maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( FALSE ), mbInteractive( TRUE )
+ DockingData( const Point& rPt, const Rectangle& rRect, sal_Bool b) :
+ maMousePos( rPt ), maTrackRect( rRect ), mbFloating( b ), mbLivemode( sal_False ), mbInteractive( sal_True )
{};
};
struct EndDockingData
{
Rectangle maWindowRect; // in
- BOOL mbFloating; // in
- BOOL mbCancelled; // in
+ sal_Bool mbFloating; // in
+ sal_Bool mbCancelled; // in
EndDockingData() {};
- EndDockingData( const Rectangle& rRect, BOOL b, BOOL bCancelled ) :
+ EndDockingData( const Rectangle& rRect, sal_Bool b, sal_Bool bCancelled ) :
maWindowRect( rRect ), mbFloating( b ), mbCancelled( bCancelled )
{};
};
@@ -64,10 +64,10 @@ struct EndDockingData
struct EndPopupModeData
{
Point maFloatingPos; // in
- BOOL mbTearoff; // in
+ sal_Bool mbTearoff; // in
EndPopupModeData() {};
- EndPopupModeData( const Point& rPos, BOOL bTearoff ) :
+ EndPopupModeData( const Point& rPos, sal_Bool bTearoff ) :
maFloatingPos( rPos ), mbTearoff( bTearoff )
{};
};
@@ -111,7 +111,7 @@ private:
sal_Int32 mnDockRight;
sal_Int32 mnDockBottom;
WinBits mnFloatBits;
- BOOL mbDockCanceled:1,
+ sal_Bool mbDockCanceled:1,
mbFloatPrevented:1,
mbDockable:1,
mbDocking:1,
@@ -129,21 +129,21 @@ private:
void ImplInitData();
DECL_LINK( PopupModeEnd, void* );
- void ImplEnableStartDocking( BOOL bEnable = TRUE ) { mbStartDockingEnabled = bEnable; }
- BOOL ImplStartDockingEnabled() { return mbStartDockingEnabled; }
+ void ImplEnableStartDocking( sal_Bool bEnable = sal_True ) { mbStartDockingEnabled = bEnable; }
+ sal_Bool ImplStartDockingEnabled() { return mbStartDockingEnabled; }
public:
ImplDockingWindowWrapper( const Window *pWindow );
virtual ~ImplDockingWindowWrapper();
Window* GetWindow() { return mpDockingWindow; }
- BOOL ImplStartDocking( const Point& rPos );
+ sal_Bool ImplStartDocking( const Point& rPos );
// those methods actually call the corresponding handlers
void StartDocking( const Point& rPos, Rectangle& rRect );
- BOOL Docking( const Point& rPos, Rectangle& rRect );
- void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
- BOOL PrepareToggleFloatingMode();
+ sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ sal_Bool PrepareToggleFloatingMode();
void ToggleFloatingMode();
void SetDragArea( const Rectangle& rRect );
@@ -151,29 +151,29 @@ public:
void Lock();
void Unlock();
- BOOL IsLocked() const;
+ sal_Bool IsLocked() const;
- void StartPopupMode( ToolBox* pParentToolBox, ULONG nPopupModeFlags );
- BOOL IsInPopupMode() const;
+ void StartPopupMode( ToolBox* pParentToolBox, sal_uLong nPopupModeFlags );
+ sal_Bool IsInPopupMode() const;
- void TitleButtonClick( USHORT nButton );
+ void TitleButtonClick( sal_uInt16 nButton );
void Pin();
void Roll();
void PopupModeEnd();
void Resizing( Size& rSize );
- BOOL Close();
+ sal_Bool Close();
void Tracking( const TrackingEvent& rTEvt );
long Notify( NotifyEvent& rNEvt );
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const;
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const;
void RollUp();
void RollDown();
- BOOL IsRollUp() const;
+ sal_Bool IsRollUp() const;
void SetRollUpOutputSizePixel( const Size& rSize );
Size GetRollUpOutputSizePixel() const;
@@ -184,13 +184,13 @@ public:
void SetMaxOutputSizePixel( const Size& rSize );
const Size& GetMaxOutputSizePixel() const;
- BOOL IsDocking() const { return mbDocking; }
- BOOL IsDockable() const { return mbDockable; }
- BOOL IsDockingCanceled() const { return mbDockCanceled; }
- BOOL IsFloatingPrevented() const { return mbFloatPrevented; }
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
- void SetFloatingMode( BOOL bFloatMode = FALSE );
- BOOL IsFloatingMode() const;
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
void SetFloatingPos( const Point& rNewPos );
@@ -202,7 +202,7 @@ public:
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ mpDockingWindow->SetPosSizePixel( rNewPos, rNewSize ); }
@@ -225,26 +225,26 @@ public:
void RemoveWindow( const Window *pWin );
ImplDockingWindowWrapper* GetDockingWindowWrapper( const Window *pWin );
- BOOL IsDockable( const Window *pWin );
+ sal_Bool IsDockable( const Window *pWin );
- BOOL IsFloating( const Window *pWin );
- void SetFloatingMode( const Window *pWin, BOOL bFloating );
+ sal_Bool IsFloating( const Window *pWin );
+ void SetFloatingMode( const Window *pWin, sal_Bool bFloating );
void Lock( const Window *pWin );
void Unlock( const Window *pWin );
- BOOL IsLocked( const Window *pWin );
+ sal_Bool IsLocked( const Window *pWin );
void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin );
- void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, ULONG nPopupModeFlags );
+ void StartPopupMode( ToolBox *pParentToolBox, const Window *pWin, sal_uLong nPopupModeFlags );
- BOOL IsInPopupMode( const Window *pWin );
+ sal_Bool IsInPopupMode( const Window *pWin );
void EndPopupMode( const Window *pWin );
// required because those methods are not virtual in Window (!!!) and must
// be availbale from the toolkit
void SetPosSizePixel( Window *pWin, long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
Rectangle GetPosSizePixel( const Window *pWin );
};
@@ -274,7 +274,7 @@ private:
sal_Int32 mnDockRight;
sal_Int32 mnDockBottom;
WinBits mnFloatBits;
- BOOL mbDockCanceled:1,
+ sal_Bool mbDockCanceled:1,
mbDockPrevented:1,
mbFloatPrevented:1,
mbDockable:1,
@@ -301,7 +301,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
- SAL_DLLPRIVATE BOOL ImplStartDocking( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplStartDocking( const Point& rPos );
protected:
DockingWindow( WindowType nType );
@@ -312,31 +312,31 @@ public:
~DockingWindow();
virtual void StartDocking();
- virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
- virtual BOOL PrepareToggleFloatingMode();
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
+ virtual sal_Bool PrepareToggleFloatingMode();
virtual void ToggleFloatingMode();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual void Tracking( const TrackingEvent& rTEvt );
virtual long Notify( NotifyEvent& rNEvt );
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const;
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const;
void RollUp();
void RollDown();
- BOOL IsRollUp() const;
+ sal_Bool IsRollUp() const;
void SetRollUpOutputSizePixel( const Size& rSize );
Size GetRollUpOutputSizePixel() const;
@@ -347,14 +347,14 @@ public:
void SetMaxOutputSizePixel( const Size& rSize );
const Size& GetMaxOutputSizePixel() const;
- BOOL IsDocking() const { return mbDocking; }
- BOOL IsDockable() const { return mbDockable; }
- BOOL IsDockingCanceled() const { return mbDockCanceled; }
- BOOL IsDockingPrevented() const { return mbDockPrevented; }
- BOOL IsFloatingPrevented() const { return mbFloatPrevented; }
+ sal_Bool IsDocking() const { return mbDocking; }
+ sal_Bool IsDockable() const { return mbDockable; }
+ sal_Bool IsDockingCanceled() const { return mbDockCanceled; }
+ sal_Bool IsDockingPrevented() const { return mbDockPrevented; }
+ sal_Bool IsFloatingPrevented() const { return mbFloatPrevented; }
- void SetFloatingMode( BOOL bFloatMode = FALSE );
- BOOL IsFloatingMode() const;
+ void SetFloatingMode( sal_Bool bFloatMode = sal_False );
+ sal_Bool IsFloatingMode() const;
FloatingWindow* GetFloatingWindow() const { return mpFloatWin; }
void SetFloatingPos( const Point& rNewPos );
@@ -366,7 +366,7 @@ public:
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize )
{ Window::SetPosSizePixel( rNewPos, rNewSize ); }
@@ -376,14 +376,14 @@ public:
Size GetOutputSizePixel() const;
};
-inline void DockingWindow::SetPin( BOOL bPin )
+inline void DockingWindow::SetPin( sal_Bool bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-inline BOOL DockingWindow::IsPined() const
+inline sal_Bool DockingWindow::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -394,17 +394,17 @@ inline void DockingWindow::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
}
inline void DockingWindow::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
}
-inline BOOL DockingWindow::IsRollUp() const
+inline sal_Bool DockingWindow::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index 6b0ca12eae8e..0263daa5a427 100644..100755
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -77,11 +77,11 @@ private:
XubString maRedoText;
long mnXOffset;
Selection maSelection;
- USHORT mnAlign;
+ sal_uInt16 mnAlign;
xub_StrLen mnMaxTextLen;
AutocompleteAction meAutocompleteAction;
xub_Unicode mcEchoChar;
- BOOL mbModified:1,
+ sal_Bool mbModified:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -101,19 +101,19 @@ private:
SAL_DLLPRIVATE XubString ImplGetText() const;
SAL_DLLPRIVATE void ImplRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN, bool bLayout = false );
SAL_DLLPRIVATE void ImplInvalidateOrRepaint( xub_StrLen nStart = 0, xub_StrLen nEnd = STRING_LEN );
- SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode );
+ SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
SAL_DLLPRIVATE void ImplSetText( const XubString& rStr, const Selection* pNewSelection = 0 );
SAL_DLLPRIVATE void ImplInsertText( const XubString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False );
SAL_DLLPRIVATE String ImplGetValidString( const String& rString ) const;
SAL_DLLPRIVATE void ImplClearBackground( long nXStart, long nXEnd );
- SAL_DLLPRIVATE void ImplShowCursor( BOOL bOnlyIfVisible = TRUE );
+ SAL_DLLPRIVATE void ImplShowCursor( sal_Bool bOnlyIfVisible = sal_True );
SAL_DLLPRIVATE void ImplAlign();
SAL_DLLPRIVATE void ImplAlignAndPaint();
SAL_DLLPRIVATE xub_StrLen ImplGetCharPos( const Point& rWindowPos ) const;
- SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect );
+ SAL_DLLPRIVATE void ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect );
SAL_DLLPRIVATE void ImplShowDDCursor();
SAL_DLLPRIVATE void ImplHideDDCursor();
- SAL_DLLPRIVATE BOOL ImplHandleKeyEvent( const KeyEvent& rKEvt );
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvt );
SAL_DLLPRIVATE void ImplCopyToSelectionClipboard();
SAL_DLLPRIVATE void ImplCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
SAL_DLLPRIVATE void ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
@@ -127,9 +127,9 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, BOOL bPaint = TRUE );
+ SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, sal_Bool bPaint = sal_True );
SAL_DLLPRIVATE int ImplGetNativeControlType();
static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( Window* pWin );
@@ -165,7 +165,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void GetFocus();
virtual void LoseFocus();
virtual void Tracking( const TrackingEvent& rTEvt );
@@ -177,24 +177,24 @@ public:
virtual void Modify();
virtual void UpdateData();
- static BOOL IsCharInput( const KeyEvent& rKEvt );
+ static sal_Bool IsCharInput( const KeyEvent& rKEvt );
virtual void SetModifyFlag();
virtual void ClearModifyFlag();
- virtual BOOL IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
+ virtual sal_Bool IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
- virtual void EnableUpdateData( ULONG nTimeout = EDIT_UPDATEDATA_TIMEOUT );
+ virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
- virtual ULONG IsUpdateDataEnabled() const;
+ virtual sal_uLong IsUpdateDataEnabled() const;
void SetEchoChar( xub_Unicode c );
xub_Unicode GetEchoChar() const { return mcEchoChar; }
- virtual void SetReadOnly( BOOL bReadOnly = TRUE );
- virtual BOOL IsReadOnly() const { return mbReadOnly; }
+ virtual void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ virtual sal_Bool IsReadOnly() const { return mbReadOnly; }
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT );
virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; }
@@ -232,7 +232,7 @@ public:
virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( USHORT nChars ) const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
virtual xub_StrLen GetMaxVisChars() const;
xub_StrLen GetCharPos( const Point& rWindowPos ) const;
@@ -248,14 +248,18 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // returns the minimum size a bordered Edit should have given the current
+ // global style settings (needed by sc's inputwin.cxx)
+ static Size GetMinimumEditSize();
};
-inline ULONG Edit::IsUpdateDataEnabled() const
+inline sal_uLong Edit::IsUpdateDataEnabled() const
{
if ( mpUpdateDataTimer )
return mpUpdateDataTimer->GetTimeout();
else
- return FALSE;
+ return sal_False;
}
#endif // _SV_EDIT_HXX
diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx
index 83902ad6b1af..9e8666ea7c78 100644
--- a/vcl/inc/vcl/event.hxx
+++ b/vcl/inc/vcl/event.hxx
@@ -58,13 +58,13 @@ class VCL_DLLPUBLIC KeyEvent
{
private:
KeyCode maKeyCode;
- USHORT mnRepeat;
+ sal_uInt16 mnRepeat;
xub_Unicode mnCharCode;
public:
KeyEvent();
KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
- USHORT nRepeat = 0 );
+ sal_uInt16 nRepeat = 0 );
/** inits this vcl KeyEvent with all settings from the given awt event **/
KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent );
@@ -74,7 +74,7 @@ public:
xub_Unicode GetCharCode() const { return mnCharCode; }
const KeyCode& GetKeyCode() const { return maKeyCode; }
- USHORT GetRepeat() const { return mnRepeat; }
+ sal_uInt16 GetRepeat() const { return mnRepeat; }
KeyEvent LogicalTextDirectionality (TextDirectionality eMode) const;
KeyEvent (const KeyEvent& rKeyEvent);
@@ -88,7 +88,7 @@ inline KeyEvent::KeyEvent()
}
inline KeyEvent::KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
- USHORT nRepeat ) :
+ sal_uInt16 nRepeat ) :
maKeyCode( rKeyCode )
{
@@ -101,24 +101,24 @@ inline KeyEvent::KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
// --------------------
// Maus-Move-Modi
-#define MOUSE_SIMPLEMOVE ((USHORT)0x0001)
-#define MOUSE_DRAGMOVE ((USHORT)0x0002)
-#define MOUSE_DRAGCOPY ((USHORT)0x0004)
-#define MOUSE_ENTERWINDOW ((USHORT)0x0010)
-#define MOUSE_LEAVEWINDOW ((USHORT)0x0020)
-#define MOUSE_SYNTHETIC ((USHORT)0x0040)
-#define MOUSE_MODIFIERCHANGED ((USHORT)0x0080)
+#define MOUSE_SIMPLEMOVE ((sal_uInt16)0x0001)
+#define MOUSE_DRAGMOVE ((sal_uInt16)0x0002)
+#define MOUSE_DRAGCOPY ((sal_uInt16)0x0004)
+#define MOUSE_ENTERWINDOW ((sal_uInt16)0x0010)
+#define MOUSE_LEAVEWINDOW ((sal_uInt16)0x0020)
+#define MOUSE_SYNTHETIC ((sal_uInt16)0x0040)
+#define MOUSE_MODIFIERCHANGED ((sal_uInt16)0x0080)
// Maus-Button-Down/Up-Modi
-#define MOUSE_SIMPLECLICK ((USHORT)0x0001)
-#define MOUSE_SELECT ((USHORT)0x0002)
-#define MOUSE_MULTISELECT ((USHORT)0x0004)
-#define MOUSE_RANGESELECT ((USHORT)0x0008)
+#define MOUSE_SIMPLECLICK ((sal_uInt16)0x0001)
+#define MOUSE_SELECT ((sal_uInt16)0x0002)
+#define MOUSE_MULTISELECT ((sal_uInt16)0x0004)
+#define MOUSE_RANGESELECT ((sal_uInt16)0x0008)
// Maus-Buttons
-#define MOUSE_LEFT ((USHORT)0x0001)
-#define MOUSE_MIDDLE ((USHORT)0x0002)
-#define MOUSE_RIGHT ((USHORT)0x0004)
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
// --------------
// - MouseEvent -
@@ -128,53 +128,53 @@ class VCL_DLLPUBLIC MouseEvent
{
private:
Point maPos;
- USHORT mnMode;
- USHORT mnClicks;
- USHORT mnCode;
+ sal_uInt16 mnMode;
+ sal_uInt16 mnClicks;
+ sal_uInt16 mnCode;
public:
MouseEvent();
- MouseEvent( const Point& rPos, USHORT nClicks = 1,
- USHORT nMode = 0, USHORT nButtons = 0,
- USHORT nModifier = 0 );
+ MouseEvent( const Point& rPos, sal_uInt16 nClicks = 1,
+ sal_uInt16 nMode = 0, sal_uInt16 nButtons = 0,
+ sal_uInt16 nModifier = 0 );
const Point& GetPosPixel() const { return maPos; }
- USHORT GetMode() const { return mnMode; }
+ sal_uInt16 GetMode() const { return mnMode; }
/** inits this vcl KeyEvent with all settings from the given awt event **/
MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent );
/** fills out the given awt KeyEvent with all settings from this vcl event **/
void InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) const;
- USHORT GetClicks() const { return mnClicks; }
+ sal_uInt16 GetClicks() const { return mnClicks; }
- BOOL IsEnterWindow() const
+ sal_Bool IsEnterWindow() const
{ return ((mnMode & MOUSE_ENTERWINDOW) != 0); }
- BOOL IsLeaveWindow() const
+ sal_Bool IsLeaveWindow() const
{ return ((mnMode & MOUSE_LEAVEWINDOW) != 0); }
- BOOL IsSynthetic() const
+ sal_Bool IsSynthetic() const
{ return ((mnMode & MOUSE_SYNTHETIC) != 0); }
- BOOL IsModifierChanged() const
+ sal_Bool IsModifierChanged() const
{ return ((mnMode & MOUSE_MODIFIERCHANGED) != 0); }
- USHORT GetButtons() const
+ sal_uInt16 GetButtons() const
{ return (mnCode & (MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)); }
- BOOL IsLeft() const
+ sal_Bool IsLeft() const
{ return ((mnCode & MOUSE_LEFT) != 0); }
- BOOL IsMiddle() const
+ sal_Bool IsMiddle() const
{ return ((mnCode & MOUSE_MIDDLE) != 0); }
- BOOL IsRight() const
+ sal_Bool IsRight() const
{ return ((mnCode & MOUSE_RIGHT) != 0); }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
bool IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((mnCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((mnCode & KEY_MOD3) != 0); }
};
@@ -185,9 +185,9 @@ inline MouseEvent::MouseEvent()
mnCode = 0;
}
-inline MouseEvent::MouseEvent( const Point& rPos, USHORT nClicks,
- USHORT nMode,
- USHORT nButtons, USHORT nModifier ) :
+inline MouseEvent::MouseEvent( const Point& rPos, sal_uInt16 nClicks,
+ sal_uInt16 nMode,
+ sal_uInt16 nButtons, sal_uInt16 nModifier ) :
maPos( rPos )
{
mnClicks = nClicks;
@@ -199,46 +199,46 @@ inline MouseEvent::MouseEvent( const Point& rPos, USHORT nClicks,
// - HelpEvent -
// -------------
-#define HELPMODE_CONTEXT ((USHORT)0x0001)
-#define HELPMODE_EXTENDED ((USHORT)0x0002)
-#define HELPMODE_BALLOON ((USHORT)0x0004)
-#define HELPMODE_QUICK ((USHORT)0x0008)
+#define HELPMODE_CONTEXT ((sal_uInt16)0x0001)
+#define HELPMODE_EXTENDED ((sal_uInt16)0x0002)
+#define HELPMODE_BALLOON ((sal_uInt16)0x0004)
+#define HELPMODE_QUICK ((sal_uInt16)0x0008)
class VCL_DLLPUBLIC HelpEvent
{
private:
Point maPos;
- USHORT mnMode;
- BOOL mbKeyboardActivated;
+ sal_uInt16 mnMode;
+ sal_Bool mbKeyboardActivated;
public:
HelpEvent();
- HelpEvent( USHORT nHelpMode );
- HelpEvent( const Point& rMousePos, USHORT nHelpMode );
+ HelpEvent( sal_uInt16 nHelpMode );
+ HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode );
const Point& GetMousePosPixel() const;
- USHORT GetMode() const { return mnMode; }
- BOOL KeyboardActivated() const { return mbKeyboardActivated; }
- void SetKeyboardActivated( BOOL bKeyboard ) { mbKeyboardActivated = bKeyboard; }
+ sal_uInt16 GetMode() const { return mnMode; }
+ sal_Bool KeyboardActivated() const { return mbKeyboardActivated; }
+ void SetKeyboardActivated( sal_Bool bKeyboard ) { mbKeyboardActivated = bKeyboard; }
};
inline HelpEvent::HelpEvent()
{
mnMode = HELPMODE_CONTEXT;
- mbKeyboardActivated = TRUE;
+ mbKeyboardActivated = sal_True;
}
-inline HelpEvent::HelpEvent( const Point& rMousePos, USHORT nHelpMode ) :
+inline HelpEvent::HelpEvent( const Point& rMousePos, sal_uInt16 nHelpMode ) :
maPos( rMousePos )
{
mnMode = nHelpMode;
- mbKeyboardActivated = FALSE;
+ mbKeyboardActivated = sal_False;
}
-inline HelpEvent::HelpEvent( USHORT nHelpMode )
+inline HelpEvent::HelpEvent( sal_uInt16 nHelpMode )
{
mnMode = nHelpMode;
- mbKeyboardActivated = TRUE;
+ mbKeyboardActivated = sal_True;
}
// -----------------
@@ -250,19 +250,19 @@ class VCL_DLLPUBLIC UserDrawEvent
private:
OutputDevice* mpOutDev;
Rectangle maOutRect;
- USHORT mnItemId;
- USHORT mnStyle;
+ sal_uInt16 mnItemId;
+ sal_uInt16 mnStyle;
public:
UserDrawEvent();
UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- USHORT nId, USHORT nStyle = 0 );
+ sal_uInt16 nId, sal_uInt16 nStyle = 0 );
OutputDevice* GetDevice() const { return mpOutDev; }
const Rectangle& GetRect() const { return maOutRect; }
- USHORT GetItemId() const { return mnItemId; }
- USHORT GetStyle() const { return mnStyle; }
+ sal_uInt16 GetItemId() const { return mnItemId; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
};
inline UserDrawEvent::UserDrawEvent()
@@ -274,7 +274,7 @@ inline UserDrawEvent::UserDrawEvent()
inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
const Rectangle& rOutRect,
- USHORT nId, USHORT nStyle ) :
+ sal_uInt16 nId, sal_uInt16 nStyle ) :
maOutRect( rOutRect )
{
mpOutDev = pOut;
@@ -286,13 +286,13 @@ inline UserDrawEvent::UserDrawEvent( OutputDevice* pOut,
// - Tracking-Types -
// ------------------
-#define ENDTRACK_CANCEL ((USHORT)0x0001)
-#define ENDTRACK_KEY ((USHORT)0x0002)
-#define ENDTRACK_FOCUS ((USHORT)0x0004)
-#define ENDTRACK_END ((USHORT)0x1000)
-#define ENDTRACK_DONTCALLHDL ((USHORT)0x8000)
+#define ENDTRACK_CANCEL ((sal_uInt16)0x0001)
+#define ENDTRACK_KEY ((sal_uInt16)0x0002)
+#define ENDTRACK_FOCUS ((sal_uInt16)0x0004)
+#define ENDTRACK_END ((sal_uInt16)0x1000)
+#define ENDTRACK_DONTCALLHDL ((sal_uInt16)0x8000)
-#define TRACKING_REPEAT ((USHORT)0x0100)
+#define TRACKING_REPEAT ((sal_uInt16)0x0100)
// -----------------
// - TrackingEvent -
@@ -302,23 +302,23 @@ class VCL_DLLPUBLIC TrackingEvent
{
private:
MouseEvent maMEvt;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
public:
TrackingEvent();
TrackingEvent( const MouseEvent& rMEvt,
- USHORT nTrackFlags = 0 );
+ sal_uInt16 nTrackFlags = 0 );
const MouseEvent& GetMouseEvent() const { return maMEvt; }
- BOOL IsTrackingRepeat() const
+ sal_Bool IsTrackingRepeat() const
{ return ((mnFlags & TRACKING_REPEAT) != 0); }
- BOOL IsTrackingEnded() const
+ sal_Bool IsTrackingEnded() const
{ return ((mnFlags & ENDTRACK_END) != 0); }
- BOOL IsTrackingCanceled() const
+ sal_Bool IsTrackingCanceled() const
{ return ((mnFlags & ENDTRACK_CANCEL) != 0); }
- USHORT GetTrackingFlags() const { return mnFlags; }
+ sal_uInt16 GetTrackingFlags() const { return mnFlags; }
};
inline TrackingEvent::TrackingEvent()
@@ -327,7 +327,7 @@ inline TrackingEvent::TrackingEvent()
}
inline TrackingEvent::TrackingEvent( const MouseEvent& rMEvt,
- USHORT nTrackFlags ) :
+ sal_uInt16 nTrackFlags ) :
maMEvt( rMEvt )
{
mnFlags = nTrackFlags;
@@ -357,17 +357,17 @@ class VCL_DLLPUBLIC NotifyEvent
private:
Window* mpWindow;
void* mpData;
- USHORT mnType;
+ sal_uInt16 mnType;
long mnRetValue;
public:
NotifyEvent();
- NotifyEvent( USHORT nType,
+ NotifyEvent( sal_uInt16 nType,
Window* pWindow,
const void* pEvent = NULL,
long nRet = 0 );
- USHORT GetType() const { return mnType; }
+ sal_uInt16 GetType() const { return mnType; }
Window* GetWindow() const { return mpWindow; }
void* GetData() const { return mpData; }
@@ -387,7 +387,7 @@ inline NotifyEvent::NotifyEvent()
mnRetValue = 0;
}
-inline NotifyEvent::NotifyEvent( USHORT nType, Window* pWindow,
+inline NotifyEvent::NotifyEvent( sal_uInt16 nType, Window* pWindow,
const void* pEvent, long nRet )
{
mpWindow = pWindow;
@@ -424,30 +424,30 @@ inline const CommandEvent* NotifyEvent::GetCommandEvent() const
// - DataChangedEvent -
// --------------------
-#define DATACHANGED_SETTINGS ((USHORT)1)
-#define DATACHANGED_DISPLAY ((USHORT)2)
-#define DATACHANGED_DATETIME ((USHORT)3)
-#define DATACHANGED_FONTS ((USHORT)4)
-#define DATACHANGED_PRINTER ((USHORT)5)
-#define DATACHANGED_FONTSUBSTITUTION ((USHORT)6)
-#define DATACHANGED_USER ((USHORT)10000)
+#define DATACHANGED_SETTINGS ((sal_uInt16)1)
+#define DATACHANGED_DISPLAY ((sal_uInt16)2)
+#define DATACHANGED_DATETIME ((sal_uInt16)3)
+#define DATACHANGED_FONTS ((sal_uInt16)4)
+#define DATACHANGED_PRINTER ((sal_uInt16)5)
+#define DATACHANGED_FONTSUBSTITUTION ((sal_uInt16)6)
+#define DATACHANGED_USER ((sal_uInt16)10000)
class VCL_DLLPUBLIC DataChangedEvent
{
private:
void* mpData;
- ULONG mnFlags;
- USHORT mnType;
+ sal_uLong mnFlags;
+ sal_uInt16 mnType;
public:
DataChangedEvent();
- DataChangedEvent( USHORT nType,
+ DataChangedEvent( sal_uInt16 nType,
const void* pData = NULL,
- ULONG nFlags = 0 );
+ sal_uLong nFlags = 0 );
- USHORT GetType() const { return mnType; }
+ sal_uInt16 GetType() const { return mnType; }
void* GetData() const { return mpData; }
- ULONG GetFlags() const { return mnFlags; }
+ sal_uLong GetFlags() const { return mnFlags; }
const AllSettings* GetOldSettings() const;
};
@@ -459,9 +459,9 @@ inline DataChangedEvent::DataChangedEvent()
mnType = 0;
}
-inline DataChangedEvent::DataChangedEvent( USHORT nType,
+inline DataChangedEvent::DataChangedEvent( sal_uInt16 nType,
const void* pData,
- ULONG nChangeFlags )
+ sal_uLong nChangeFlags )
{
mpData = (void*)pData;
mnFlags = nChangeFlags;
diff --git a/vcl/inc/vcl/evntpost.hxx b/vcl/inc/vcl/evntpost.hxx
index 2a27bbfff033..90a165506c65 100644
--- a/vcl/inc/vcl/evntpost.hxx
+++ b/vcl/inc/vcl/evntpost.hxx
@@ -37,13 +37,13 @@ namespace vcl
{
struct UserEvent
{
- ULONG m_nWhich;
+ sal_uLong m_nWhich;
void* m_pData;
};
class VCL_DLLPUBLIC EventPoster
{
- ULONG m_nId;
+ sal_uLong m_nId;
Link m_aLink;
DECL_DLLPRIVATE_LINK( DoEvent_Impl, UserEvent* );
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index c5cfe8947796..fd0ce90cb0d7 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -35,7 +35,7 @@
#include <tools/time.hxx>
#include <vcl/spinfld.hxx>
#include <vcl/combobox.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
@@ -52,21 +52,21 @@ private:
Edit* mpField;
LocaleDataWrapper* mpLocaleDataWrapper;
Link maErrorLink;
- BOOL mbReformat;
- BOOL mbStrictFormat;
- BOOL mbEmptyFieldValue;
- BOOL mbEmptyFieldValueEnabled;
- BOOL mbDefaultLocale;
+ sal_Bool mbReformat;
+ sal_Bool mbStrictFormat;
+ sal_Bool mbEmptyFieldValue;
+ sal_Bool mbEmptyFieldValueEnabled;
+ sal_Bool mbDefaultLocale;
protected:
SAL_DLLPRIVATE void ImplSetText( const XubString& rText, Selection* pNewSel = NULL );
- SAL_DLLPRIVATE BOOL ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
+ SAL_DLLPRIVATE sal_Bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
- void SetFieldText( const XubString& rText, BOOL bKeepSelection );
- void SetEmptyFieldValueData( BOOL bValue ) { mbEmptyFieldValue = bValue; }
+ void SetFieldText( const XubString& rText, sal_Bool bKeepSelection );
+ void SetEmptyFieldValueData( sal_Bool bValue ) { mbEmptyFieldValue = bValue; }
SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
- BOOL IsDefaultLocale() const { return mbDefaultLocale; }
+ sal_Bool IsDefaultLocale() const { return mbDefaultLocale; }
public:
FormatterBase( Edit* pField = NULL );
@@ -77,11 +77,11 @@ public:
void SetField( Edit* pField ) { mpField = pField; }
Edit* GetField() const { return mpField; }
- BOOL MustBeReformatted() const { return mbReformat; }
- void MarkToBeReformatted( BOOL b ) { mbReformat = b; }
+ sal_Bool MustBeReformatted() const { return mbReformat; }
+ void MarkToBeReformatted( sal_Bool b ) { mbReformat = b; }
- void SetStrictFormat( BOOL bStrict );
- BOOL IsStrictFormat() const { return mbStrictFormat; }
+ void SetStrictFormat( sal_Bool bStrict );
+ sal_Bool IsStrictFormat() const { return mbStrictFormat; }
virtual void Reformat();
virtual void ReformatAll();
@@ -95,10 +95,10 @@ public:
const Link& GetErrorHdl() const { return maErrorLink; }
void SetEmptyFieldValue();
- BOOL IsEmptyFieldValue() const;
+ sal_Bool IsEmptyFieldValue() const;
- void EnableEmptyFieldValue( BOOL bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
- BOOL IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
+ void EnableEmptyFieldValue( sal_Bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
+ sal_Bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
};
@@ -106,7 +106,7 @@ public:
// - PatternFormatter -
// --------------------
-#define PATTERN_FORMAT_EMPTYLITERALS ((USHORT)0x0001)
+#define PATTERN_FORMAT_EMPTYLITERALS ((sal_uInt16)0x0001)
class VCL_DLLPUBLIC PatternFormatter : public FormatterBase
{
@@ -114,17 +114,17 @@ private:
ByteString maEditMask;
XubString maFieldString;
XubString maLiteralMask;
- USHORT mnFormatFlags;
- BOOL mbSameMask;
- BOOL mbInPattKeyInput;
+ sal_uInt16 mnFormatFlags;
+ sal_Bool mbSameMask;
+ sal_Bool mbInPattKeyInput;
protected:
PatternFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask );
- SAL_DLLPRIVATE BOOL ImplIsSameMask() const { return mbSameMask; }
- SAL_DLLPRIVATE BOOL& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
+ SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; }
+ SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
public:
~PatternFormatter();
@@ -136,12 +136,12 @@ public:
const ByteString& GetEditMask() const { return maEditMask; }
const XubString& GetLiteralMask() const { return maLiteralMask; }
- void SetFormatFlags( USHORT nFlags ) { mnFormatFlags = nFlags; }
- USHORT GetFormatFlags() const { return mnFormatFlags; }
+ void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; }
+ sal_uInt16 GetFormatFlags() const { return mnFormatFlags; }
void SetString( const XubString& rStr );
XubString GetString() const;
- BOOL IsStringModified() const { return !(GetString().Equals( maFieldString )); }
+ sal_Bool IsStringModified() const { return !(GetString().Equals( maFieldString )); }
void SelectFixedFont();
};
@@ -161,10 +161,10 @@ protected:
sal_Int64 mnMin;
sal_Int64 mnMax;
sal_Int64 mnCorrectedValue;
- USHORT mnType;
- USHORT mnDecimalDigits;
- BOOL mbThousandSep;
- BOOL mbShowTrailingZeros;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
+ sal_Bool mbShowTrailingZeros;
// the members below are used in all derivatives of NumericFormatter
// not in NumericFormatter itself.
@@ -183,7 +183,7 @@ protected:
void FieldLast();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplNumericReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSelection = NULL );
@@ -204,20 +204,20 @@ public:
void SetSpinSize( sal_Int64 nNewSize ) { mnSpinSize = nNewSize; }
sal_Int64 GetSpinSize() const { return mnSpinSize; }
- void SetDecimalDigits( USHORT nDigits );
- USHORT GetDecimalDigits() const;
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
- void SetUseThousandSep( BOOL b );
- BOOL IsUseThousandSep() const { return mbThousandSep; }
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
- void SetShowTrailingZeros( BOOL bShowTrailingZeros );
- BOOL IsShowTrailingZeros() const { return mbShowTrailingZeros; }
+ void SetShowTrailingZeros( sal_Bool bShowTrailingZeros );
+ sal_Bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
void SetUserValue( sal_Int64 nNewValue );
virtual void SetValue( sal_Int64 nNewValue );
virtual sal_Int64 GetValue() const;
- BOOL IsValueModified() const;
+ sal_Bool IsValueModified() const;
sal_Int64 GetCorrectedValue() const { return mnCorrectedValue; }
Fraction ConvertToFraction( sal_Int64 nValue );
@@ -248,7 +248,7 @@ protected:
virtual XubString CreateFieldText( sal_Int64 nValue ) const;
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr );
public:
~MetricFormatter();
@@ -301,7 +301,7 @@ private:
protected:
CurrencyFormatter();
virtual XubString CreateFieldText( sal_Int64 nValue ) const;
- SAL_DLLPRIVATE BOOL ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplCurrencyReformat( const XubString& rStr, XubString& rOutStr );
public:
~CurrencyFormatter();
@@ -329,12 +329,12 @@ private:
Date maMin;
Date maMax;
Date maCorrectedDate;
- BOOL mbLongFormat;
- BOOL mbEmptyDate;
- BOOL mbShowDateCentury;
- USHORT mnDateFormat;
- ULONG mnExtDateFormat;
- BOOL mbEnforceValidValue;
+ sal_Bool mbLongFormat;
+ sal_Bool mbEmptyDate;
+ sal_Bool mbShowDateCentury;
+ sal_uInt16 mnDateFormat;
+ sal_uLong mnExtDateFormat;
+ sal_Bool mbEnforceValidValue;
SAL_DLLPRIVATE void ImplInit();
@@ -343,7 +343,7 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
- SAL_DLLPRIVATE BOOL ImplDateReformat( const XubString& rStr, XubString& rOutStr,
+ SAL_DLLPRIVATE sal_Bool ImplDateReformat( const XubString& rStr, XubString& rOutStr,
const AllSettings& rSettings );
SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
Selection* pNewSelection = NULL );
@@ -352,7 +352,7 @@ protected:
SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
CalendarWrapper& GetCalendarWrapper() const;
- SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
public:
~DateFormatter();
@@ -364,7 +364,7 @@ public:
void SetExtDateFormat( ExtDateFieldFormat eFormat );
- ExtDateFieldFormat GetExtDateFormat( BOOL bResolveSystemFormat = FALSE ) const;
+ ExtDateFieldFormat GetExtDateFormat( sal_Bool bResolveSystemFormat = sal_False ) const;
void SetMin( const Date& rNewMin );
const Date& GetMin() const { return maMin; }
@@ -375,27 +375,27 @@ public:
// --------------------------------------------------------------
// MT: Remove these methods too, ExtDateFormat should be enough!
- // What should happen if using DDMMYYYY, but ShowCentury=FALSE?
+ // What should happen if using DDMMYYYY, but ShowCentury=sal_False?
// --------------------------------------------------------------
- void SetLongFormat( BOOL bLong );
- BOOL IsLongFormat() const { return mbLongFormat; }
- void SetShowDateCentury( BOOL bShowCentury );
- BOOL IsShowDateCentury() const { return mbShowDateCentury; }
+ void SetLongFormat( sal_Bool bLong );
+ sal_Bool IsLongFormat() const { return mbLongFormat; }
+ void SetShowDateCentury( sal_Bool bShowCentury );
+ sal_Bool IsShowDateCentury() const { return mbShowDateCentury; }
// --------------------------------------------------------------
void SetDate( const Date& rNewDate );
void SetUserDate( const Date& rNewDate );
Date GetDate() const;
Date GetRealDate() const;
- BOOL IsDateModified() const;
+ sal_Bool IsDateModified() const;
void SetEmptyDate();
- BOOL IsEmptyDate() const;
+ sal_Bool IsEmptyDate() const;
Date GetCorrectedDate() const { return maCorrectedDate; }
void ResetLastDate() { maLastDate = Date( 0, 0, 0 ); }
static void ExpandCentury( Date& rDate );
- static void ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart );
+ static void ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
static Date GetInvalidDate() { return Date( 0, 0, 0 ); }
@@ -411,8 +411,8 @@ public:
In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
when the control loses the focus - instead, the invalid input will be preserved.
*/
- void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline BOOL IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
};
@@ -428,10 +428,10 @@ private:
Time maMax;
Time maCorrectedTime;
TimeFieldFormat meFormat;
- USHORT mnTimeFormat;
- BOOL mbDuration;
- BOOL mbEmptyTime;
- BOOL mbEnforceValidValue;
+ sal_uInt16 mnTimeFormat;
+ sal_Bool mbDuration;
+ sal_Bool mbEmptyTime;
+ sal_Bool mbEnforceValidValue;
SAL_DLLPRIVATE void ImplInit();
@@ -441,10 +441,10 @@ protected:
TimeFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE BOOL ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
+ SAL_DLLPRIVATE sal_Bool ImplTimeReformat( const XubString& rStr, XubString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( const Time& rTime );
SAL_DLLPRIVATE void ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection = NULL );
- SAL_DLLPRIVATE BOOL ImplAllowMalformedInput() const;
+ SAL_DLLPRIVATE sal_Bool ImplAllowMalformedInput() const;
public:
@@ -469,16 +469,16 @@ public:
void SetFormat( TimeFieldFormat eNewFormat );
TimeFieldFormat GetFormat() const { return meFormat; }
- void SetDuration( BOOL mbDuration );
- BOOL IsDuration() const { return mbDuration; }
+ void SetDuration( sal_Bool mbDuration );
+ sal_Bool IsDuration() const { return mbDuration; }
void SetTime( const Time& rNewTime );
void SetUserTime( const Time& rNewTime );
Time GetTime() const;
Time GetRealTime() const;
- BOOL IsTimeModified() const;
+ sal_Bool IsTimeModified() const;
void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
- BOOL IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
+ sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
Time GetCorrectedTime() const { return maCorrectedTime; }
static Time GetInvalidTime() { return Time( 99, 99, 99 ); }
@@ -495,8 +495,8 @@ public:
In addition, if this is set to <FALSE/>, the text in the field will <em>not</em> be corrected
when the control loses the focus - instead, the invalid input will be preserved.
*/
- void EnforceValidValue( BOOL _bEnforce ) { mbEnforceValidValue = _bEnforce; }
- inline BOOL IsEnforceValidValue( ) const { return mbEnforceValidValue; }
+ void EnforceValidValue( sal_Bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
+ inline sal_Bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
};
@@ -583,31 +583,31 @@ public:
static void SetDefaultUnit( FieldUnit eDefaultUnit );
static FieldUnit GetDefaultUnit();
- static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static sal_Int64 ConvertValue( sal_Int64 nValue, USHORT nDecDigits,
+ static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit );
- static double ConvertDoubleValue( double nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit );
// for backwards compatibility
// caution: conversion to double loses precision
- static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
- static double ConvertDoubleValue( sal_Int64 nValue, USHORT nDecDigits,
+ static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{ return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
};
@@ -651,7 +651,7 @@ private:
Date maLast;
protected:
- SAL_DLLPRIVATE void ImplDateSpinArea( BOOL bUp );
+ SAL_DLLPRIVATE void ImplDateSpinArea( sal_Bool bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -687,7 +687,7 @@ private:
Time maLast;
protected:
- SAL_DLLPRIVATE void ImplTimeSpinArea( BOOL bUp );
+ SAL_DLLPRIVATE void ImplTimeSpinArea( sal_Bool bUp );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -734,11 +734,11 @@ public:
virtual void ReformatAll();
void InsertString( const XubString& rStr,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveString( const XubString& rStr );
using PatternFormatter::GetString;
- XubString GetString( USHORT nPos ) const;
- USHORT GetStringPos( const XubString& rStr ) const;
+ XubString GetString( sal_uInt16 nPos ) const;
+ sal_uInt16 GetStringPos( const XubString& rStr ) const;
};
@@ -761,11 +761,11 @@ public:
virtual void ReformatAll();
- void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
using NumericFormatter::GetValue;
- sal_Int64 GetValue( USHORT nPos ) const;
- USHORT GetValuePos( sal_Int64 nPos ) const;
+ sal_Int64 GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nPos ) const;
};
@@ -790,10 +790,10 @@ public:
virtual void ReformatAll();
void InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue, FieldUnit eInUnit = FUNIT_NONE );
- sal_Int64 GetValue( USHORT nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
- USHORT GetValuePos( sal_Int64 nValue,
+ sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit = FUNIT_NONE ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nValue,
FieldUnit eInUnit = FUNIT_NONE ) const;
// Needed, because GetValue() with nPos hide these functions
@@ -821,10 +821,10 @@ public:
virtual void ReformatAll();
- void InsertValue( sal_Int64 nValue, USHORT nPos = COMBOBOX_APPEND );
+ void InsertValue( sal_Int64 nValue, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( sal_Int64 nValue );
- sal_Int64 GetValue( USHORT nPos ) const;
- USHORT GetValuePos( sal_Int64 nValue ) const;
+ sal_Int64 GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( sal_Int64 nValue ) const;
// Needed, because GetValue() with nPos hide this function
virtual sal_Int64 GetValue() const;
@@ -850,11 +850,11 @@ public:
virtual void ReformatAll();
- void InsertDate( const Date& rDate, USHORT nPos = COMBOBOX_APPEND );
+ void InsertDate( const Date& rDate, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveDate( const Date& rDate );
using DateFormatter::GetDate;
- Date GetDate( USHORT nPos ) const;
- USHORT GetDatePos( const Date& rDate ) const;
+ Date GetDate( sal_uInt16 nPos ) const;
+ sal_uInt16 GetDatePos( const Date& rDate ) const;
};
@@ -877,11 +877,11 @@ public:
virtual void ReformatAll();
- void InsertTime( const Time& rTime, USHORT nPos = COMBOBOX_APPEND );
+ void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveTime( const Time& rTime );
using TimeFormatter::GetTime;
- Time GetTime( USHORT nPos ) const;
- USHORT GetTimePos( const Time& rTime ) const;
+ Time GetTime( sal_uInt16 nPos ) const;
+ sal_uInt16 GetTimePos( const Time& rTime ) const;
};
#endif // _SV_FIELD_HXX
diff --git a/vcl/inc/vcl/fixbrd.hxx b/vcl/inc/vcl/fixbrd.hxx
index 70916cfb8704..e091f68d4fad 100644
--- a/vcl/inc/vcl/fixbrd.hxx
+++ b/vcl/inc/vcl/fixbrd.hxx
@@ -51,8 +51,8 @@
class VCL_DLLPUBLIC FixedBorder : public Control
{
private:
- USHORT mnType;
- BOOL mbTransparent;
+ sal_uInt16 mnType;
+ sal_Bool mbTransparent;
private:
using Control::ImplInitSettings;
@@ -60,7 +60,7 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize );
public:
@@ -69,15 +69,15 @@ public:
~FixedBorder();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void SetTransparent( BOOL bTransparent );
- BOOL IsTransparent() const { return mbTransparent; }
- void SetBorderType( USHORT nType );
- USHORT GetBorderType() const { return mnType; }
+ void SetTransparent( sal_Bool bTransparent );
+ sal_Bool IsTransparent() const { return mbTransparent; }
+ void SetBorderType( sal_uInt16 nType );
+ sal_uInt16 GetBorderType() const { return mnType; }
};
#endif // _SV_FIXBRD_HXX
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 42061cfa09ea..3912f19e778a 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -48,11 +48,11 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
public:
- SAL_DLLPRIVATE static USHORT ImplGetTextStyle( WinBits nWinBits );
+ SAL_DLLPRIVATE static sal_uInt16 ImplGetTextStyle( WinBits nWinBits );
protected:
virtual void FillLayoutData() const;
virtual const Font&
@@ -66,7 +66,7 @@ public:
FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabelForRelation );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -87,7 +87,7 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplDraw( bool bLayout = false );
protected:
@@ -102,7 +102,7 @@ public:
FixedLine( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -124,7 +124,7 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize );
protected:
@@ -136,7 +136,7 @@ public:
~FixedBitmap();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -144,7 +144,7 @@ public:
void SetBitmap( const Bitmap& rBitmap );
using OutputDevice::GetBitmap;
const Bitmap& GetBitmap() const { return maBitmap; }
- BOOL SetModeBitmap( const Bitmap& rBitmap );
+ sal_Bool SetModeBitmap( const Bitmap& rBitmap );
const Bitmap& GetModeBitmap( ) const;
};
@@ -156,7 +156,7 @@ class VCL_DLLPUBLIC FixedImage : public Control
{
private:
Image maImage;
- BOOL mbInUserDraw;
+ sal_Bool mbInUserDraw;
private:
using Control::ImplInitSettings;
@@ -164,10 +164,10 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
- const Point& rPos, const Size& rSize );
protected:
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
+ const Point& rPos, const Size& rSize );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
@@ -176,7 +176,7 @@ public:
~FixedImage();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -186,7 +186,7 @@ public:
void SetImage( const Image& rImage );
const Image& GetImage() const { return maImage; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
Point CalcImagePos( const Point& rPos,
diff --git a/vcl/inc/vcl/fldunit.hxx b/vcl/inc/vcl/fldunit.hxx
deleted file mode 100644
index 93c89ada98a0..000000000000
--- a/vcl/inc/vcl/fldunit.hxx
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _VCL_FLDUNIT_HXX
-#define _VCL_FLDUNIT_HXX
-
-#include <tools/fldunit.hxx>
-
-#endif // _VCL_FLDUNIT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx
index eb15b116938e..e6a5b58eea32 100644
--- a/vcl/inc/vcl/floatwin.hxx
+++ b/vcl/inc/vcl/floatwin.hxx
@@ -40,34 +40,34 @@ class PopupModeEvent;
// - FloatingWindow-Types -
// ------------------------
-#define FLOATWIN_POPUPMODE_ALLOWTEAROFF ((ULONG)0x00000001)
-#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE ((ULONG)0x00000002)
-#define FLOATWIN_POPUPMODE_NOAUTOARRANGE ((ULONG)0x00000004)
-#define FLOATWIN_POPUPMODE_NOANIMATION ((ULONG)0x00000008)
-#define FLOATWIN_POPUPMODE_DOWN ((ULONG)0x00000010)
-#define FLOATWIN_POPUPMODE_UP ((ULONG)0x00000020)
-#define FLOATWIN_POPUPMODE_LEFT ((ULONG)0x00000040)
-#define FLOATWIN_POPUPMODE_RIGHT ((ULONG)0x00000080)
-#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE ((ULONG)0x00000100)
-#define FLOATWIN_POPUPMODE_NOKEYCLOSE ((ULONG)0x00000200)
-#define FLOATWIN_POPUPMODE_NOMOUSECLOSE ((ULONG)0x00000400)
-#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE ((ULONG)0x00000800)
-#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ((ULONG)0x00001000)
-#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ((ULONG)0x00002000)
-#define FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ((ULONG)0x00004000)
-#define FLOATWIN_POPUPMODE_NEWLEVEL ((ULONG)0x00008000)
-#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ((ULONG)0x00010000)
-#define FLOATWIN_POPUPMODE_GRABFOCUS ((ULONG)0x00020000)
-
-#define FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0001)
-#define FLOATWIN_POPUPMODEEND_TEAROFF ((USHORT)0x0002)
-#define FLOATWIN_POPUPMODEEND_DONTCALLHDL ((USHORT)0x0004)
-#define FLOATWIN_POPUPMODEEND_CLOSEALL ((USHORT)0x0008)
-
-#define FLOATWIN_TITLE_NORMAL ((USHORT)0x0001)
-#define FLOATWIN_TITLE_TEAROFF ((USHORT)0x0002)
-#define FLOATWIN_TITLE_POPUP ((USHORT)0x0004)
-#define FLOATWIN_TITLE_NONE ((USHORT)0x0008)
+#define FLOATWIN_POPUPMODE_ALLOWTEAROFF ((sal_uLong)0x00000001)
+#define FLOATWIN_POPUPMODE_ANIMATIONSLIDE ((sal_uLong)0x00000002)
+#define FLOATWIN_POPUPMODE_NOAUTOARRANGE ((sal_uLong)0x00000004)
+#define FLOATWIN_POPUPMODE_NOANIMATION ((sal_uLong)0x00000008)
+#define FLOATWIN_POPUPMODE_DOWN ((sal_uLong)0x00000010)
+#define FLOATWIN_POPUPMODE_UP ((sal_uLong)0x00000020)
+#define FLOATWIN_POPUPMODE_LEFT ((sal_uLong)0x00000040)
+#define FLOATWIN_POPUPMODE_RIGHT ((sal_uLong)0x00000080)
+#define FLOATWIN_POPUPMODE_NOFOCUSCLOSE ((sal_uLong)0x00000100)
+#define FLOATWIN_POPUPMODE_NOKEYCLOSE ((sal_uLong)0x00000200)
+#define FLOATWIN_POPUPMODE_NOMOUSECLOSE ((sal_uLong)0x00000400)
+#define FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE ((sal_uLong)0x00000800)
+#define FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ((sal_uLong)0x00001000)
+#define FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ((sal_uLong)0x00002000)
+#define FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ((sal_uLong)0x00004000)
+#define FLOATWIN_POPUPMODE_NEWLEVEL ((sal_uLong)0x00008000)
+#define FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ((sal_uLong)0x00010000)
+#define FLOATWIN_POPUPMODE_GRABFOCUS ((sal_uLong)0x00020000)
+
+#define FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0001)
+#define FLOATWIN_POPUPMODEEND_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_POPUPMODEEND_DONTCALLHDL ((sal_uInt16)0x0004)
+#define FLOATWIN_POPUPMODEEND_CLOSEALL ((sal_uInt16)0x0008)
+
+#define FLOATWIN_TITLE_NORMAL ((sal_uInt16)0x0001)
+#define FLOATWIN_TITLE_TEAROFF ((sal_uInt16)0x0002)
+#define FLOATWIN_TITLE_POPUP ((sal_uInt16)0x0004)
+#define FLOATWIN_TITLE_NONE ((sal_uInt16)0x0008)
// ------------------
// - FloatingWindow -
@@ -81,18 +81,18 @@ private:
Window* mpFirstPopupModeWin;
ImplData* mpImplData;
Rectangle maFloatRect;
- ULONG mnPostId;
- ULONG mnPopupModeFlags;
- USHORT mnTitle;
- USHORT mnOldTitle;
- BOOL mbInPopupMode;
- BOOL mbPopupMode;
- BOOL mbPopupModeCanceled;
- BOOL mbPopupModeTearOff;
- BOOL mbMouseDown;
- BOOL mbOldSaveBackMode;
- BOOL mbGrabFocus; // act as key input window, although focus is not set
- BOOL mbInCleanUp;
+ sal_uLong mnPostId;
+ sal_uLong mnPopupModeFlags;
+ sal_uInt16 mnTitle;
+ sal_uInt16 mnOldTitle;
+ sal_Bool mbInPopupMode;
+ sal_Bool mbPopupMode;
+ sal_Bool mbPopupModeCanceled;
+ sal_Bool mbPopupModeTearOff;
+ sal_Bool mbMouseDown;
+ sal_Bool mbOldSaveBackMode;
+ sal_Bool mbGrabFocus; // act as key input window, although focus is not set
+ sal_Bool mbInCleanUp;
Link maPopupModeEndHdl;
SAL_DLLPRIVATE void ImplCallPopupModeEnd();
@@ -109,20 +109,20 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
-#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((USHORT)0x0001)
-#define IMPL_FLOATWIN_HITTEST_WINDOW ((USHORT)0x0002)
-#define IMPL_FLOATWIN_HITTEST_RECT ((USHORT)0x0004)
- SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest );
+#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((sal_uInt16)0x0001)
+#define IMPL_FLOATWIN_HITTEST_WINDOW ((sal_uInt16)0x0002)
+#define IMPL_FLOATWIN_HITTEST_RECT ((sal_uInt16)0x0004)
+ SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest );
SAL_DLLPRIVATE FloatingWindow* ImplFindLastLevelFloat();
- SAL_DLLPRIVATE BOOL ImplIsFloatPopupModeWindow( const Window* pWindow );
- SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = TRUE; }
- SAL_DLLPRIVATE BOOL ImplIsMouseDown() const { return mbMouseDown; }
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatPopupModeWindow( const Window* pWindow );
+ SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = sal_True; }
+ SAL_DLLPRIVATE sal_Bool ImplIsMouseDown() const { return mbMouseDown; }
SAL_DLLPRIVATE static Point ImplCalcPos( Window* pWindow,
- const Rectangle& rRect, ULONG nFlags,
- USHORT& rArrangeIndex );
- SAL_DLLPRIVATE void ImplEndPopupMode( USHORT nFlags = 0, ULONG nFocusId = 0 );
+ const Rectangle& rRect, sal_uLong nFlags,
+ sal_uInt16& rArrangeIndex );
+ SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
- SAL_DLLPRIVATE BOOL ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
+ SAL_DLLPRIVATE sal_Bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
public:
FloatingWindow( Window* pParent, WinBits nStyle = WB_STDFLOATWIN );
@@ -135,27 +135,27 @@ public:
virtual void PopupModeEnd();
- void SetTitleType( USHORT nTitle );
- USHORT GetTitleType() const { return mnTitle; }
+ void SetTitleType( sal_uInt16 nTitle );
+ sal_uInt16 GetTitleType() const { return mnTitle; }
- void StartPopupMode( const Rectangle& rRect, ULONG nFlags = 0 );
- void StartPopupMode( ToolBox* pBox, ULONG nFlags = 0 );
- void EndPopupMode( USHORT nFlags = 0 );
+ void StartPopupMode( const Rectangle& rRect, sal_uLong nFlags = 0 );
+ void StartPopupMode( ToolBox* pBox, sal_uLong nFlags = 0 );
+ void EndPopupMode( sal_uInt16 nFlags = 0 );
void AddPopupModeWindow( Window* pWindow );
void RemovePopupModeWindow( Window* pWindow );
- ULONG GetPopupModeFlags() const { return mnPopupModeFlags; }
- void SetPopupModeFlags( ULONG nFlags ) { mnPopupModeFlags = nFlags; }
- BOOL IsInPopupMode() const { return mbPopupMode; }
- BOOL IsInCleanUp() const { return mbInCleanUp; }
- BOOL IsPopupModeCanceled() const { return mbPopupModeCanceled; }
- BOOL IsPopupModeTearOff() const { return mbPopupModeTearOff; }
+ sal_uLong GetPopupModeFlags() const { return mnPopupModeFlags; }
+ void SetPopupModeFlags( sal_uLong nFlags ) { mnPopupModeFlags = nFlags; }
+ sal_Bool IsInPopupMode() const { return mbPopupMode; }
+ sal_Bool IsInCleanUp() const { return mbInCleanUp; }
+ sal_Bool IsPopupModeCanceled() const { return mbPopupModeCanceled; }
+ sal_Bool IsPopupModeTearOff() const { return mbPopupModeTearOff; }
void SetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; }
const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; }
- BOOL GrabsFocus() const { return mbGrabFocus; }
+ sal_Bool GrabsFocus() const { return mbGrabFocus; }
- static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex );
+ static Point CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex );
};
#endif // _SV_FLOATWIN_HXX
diff --git a/vcl/inc/vcl/fntstyle.hxx b/vcl/inc/vcl/fntstyle.hxx
index 72705fde16f2..82c8c8ad5932 100644
--- a/vcl/inc/vcl/fntstyle.hxx
+++ b/vcl/inc/vcl/fntstyle.hxx
@@ -47,7 +47,7 @@ enum FontRelief { RELIEF_NONE, RELIEF_EMBOSSED, RELIEF_ENGRAVED, FontRelief_FORC
// - Font types -
// --------------
-typedef BYTE FontKerning;
+typedef sal_uInt8 FontKerning;
#define KERNING_FONTSPECIFIC ((FontKerning)0x01)
#define KERNING_ASIAN ((FontKerning)0x02)
diff --git a/vcl/inc/vcl/font.hxx b/vcl/inc/vcl/font.hxx
index d9c4d62f57d0..8ca4ba5bbb87 100644
--- a/vcl/inc/vcl/font.hxx
+++ b/vcl/inc/vcl/font.hxx
@@ -65,8 +65,8 @@ public:
const Color& GetColor() const;
void SetFillColor( const Color& );
const Color& GetFillColor() const;
- void SetTransparent( BOOL bTransparent );
- BOOL IsTransparent() const;
+ void SetTransparent( sal_Bool bTransparent );
+ sal_Bool IsTransparent() const;
void SetAlign( FontAlign );
FontAlign GetAlign() const;
@@ -94,11 +94,11 @@ public:
void SetOrientation( short nLineOrientation );
short GetOrientation() const;
- void SetVertical( BOOL bVertical );
- BOOL IsVertical() const;
+ void SetVertical( sal_Bool bVertical );
+ sal_Bool IsVertical() const;
void SetKerning( FontKerning nKerning );
FontKerning GetKerning() const;
- BOOL IsKerning() const;
+ sal_Bool IsKerning() const;
void SetWeight( FontWeight );
FontWeight GetWeight() const;
@@ -106,10 +106,10 @@ public:
FontWidth GetWidthType() const;
void SetItalic( FontItalic );
FontItalic GetItalic() const;
- void SetOutline( BOOL bOutline );
- BOOL IsOutline() const;
- void SetShadow( BOOL bShadow );
- BOOL IsShadow() const;
+ void SetOutline( sal_Bool bOutline );
+ sal_Bool IsOutline() const;
+ void SetShadow( sal_Bool bShadow );
+ sal_Bool IsShadow() const;
void SetRelief( FontRelief );
FontRelief GetRelief() const;
void SetUnderline( FontUnderline );
@@ -120,17 +120,17 @@ public:
FontStrikeout GetStrikeout() const;
void SetEmphasisMark( FontEmphasisMark );
FontEmphasisMark GetEmphasisMark() const;
- void SetWordLineMode( BOOL bWordLine );
- BOOL IsWordLineMode() const;
+ void SetWordLineMode( sal_Bool bWordLine );
+ sal_Bool IsWordLineMode() const;
void Merge( const Font& rFont );
void GetFontAttributes( ImplFontAttributes& rAttrs ) const;
Font& operator=( const Font& );
- BOOL operator==( const Font& ) const;
- BOOL operator!=( const Font& rFont ) const
+ sal_Bool operator==( const Font& ) const;
+ sal_Bool operator!=( const Font& rFont ) const
{ return !(Font::operator==( rFont )); }
- BOOL IsSameInstance( const Font& ) const;
+ sal_Bool IsSameInstance( const Font& ) const;
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& );
diff --git a/vcl/inc/vcl/fontcache.hxx b/vcl/inc/vcl/fontcache.hxx
index f15be8dd1af7..ad261e8d8e6d 100644
--- a/vcl/inc/vcl/fontcache.hxx
+++ b/vcl/inc/vcl/fontcache.hxx
@@ -39,7 +39,7 @@
namespace psp
{
-class VCL_DLLPUBLIC FontCache
+class VCL_PLUGIN_PUBLIC FontCache
{
struct FontDir;
friend class FontDir;
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index d6d926f051d5..25674b76ae8a 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -225,7 +225,7 @@ class FontCache;
class FontCache;
-class VCL_DLLPUBLIC PrintFontManager
+class VCL_PLUGIN_PUBLIC PrintFontManager
{
struct PrintFont;
struct TrueTypeFontFile;
diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index ec0a8261e61d..ffbd4867ecb8 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -51,8 +51,8 @@ class Gradient;
// - GDIMetaFile-Types -
// ---------------------
-#define GDI_METAFILE_END ((ULONG)0xFFFFFFFF)
-#define GDI_METAFILE_LABEL_NOTFOUND ((ULONG)0xFFFFFFFF)
+#define GDI_METAFILE_END ((sal_uLong)0xFFFFFFFF)
+#define GDI_METAFILE_LABEL_NOTFOUND ((sal_uLong)0xFFFFFFFF)
#ifndef METAFILE_END
#define METAFILE_END GDI_METAFILE_END
@@ -104,9 +104,9 @@ private:
GDIMetaFile* pNext;
OutputDevice* pOutDev;
ImpLabelList* pLabelList;
- BOOL bPause;
- BOOL bRecord;
- BOOL bUseCanvas;
+ sal_Bool bPause;
+ sal_Bool bRecord;
+ sal_Bool bUseCanvas;
SAL_DLLPRIVATE static Color ImplColAdjustFnc( const Color& rColor, const void* pColParam );
@@ -140,7 +140,7 @@ private:
protected:
- virtual void Linker( OutputDevice* pOut, BOOL bLink );
+ virtual void Linker( OutputDevice* pOut, sal_Bool bLink );
virtual long Hook();
public:
@@ -151,12 +151,12 @@ public:
using List::operator==;
using List::operator!=;
GDIMetaFile& operator=( const GDIMetaFile& rMtf );
- BOOL operator==( const GDIMetaFile& rMtf ) const;
- BOOL operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
+ sal_Bool operator==( const GDIMetaFile& rMtf ) const;
+ sal_Bool operator!=( const GDIMetaFile& rMtf ) const { return !( *this == rMtf ); }
void Clear();
sal_Bool IsEqual( const GDIMetaFile& rMtf ) const;
- BOOL Mirror( ULONG nMirrorFlags );
+ sal_Bool Mirror( sal_uLong nMirrorFlags );
void Move( long nX, long nY );
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
void Move( long nX, long nY, long nDPIX, long nDPIY );
@@ -175,52 +175,52 @@ public:
void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0,
short nChannelRPercent = 0, short nChannelGPercent = 0,
- short nChannelBPercent = 0, double fGamma = 1.0, BOOL bInvert = FALSE );
+ short nChannelBPercent = 0, double fGamma = 1.0, sal_Bool bInvert = sal_False );
void Convert( MtfConversion eConversion );
- void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol = 0 );
+ void ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol = 0 );
void ReplaceColors( const Color* pSearchColors, const Color* rReplaceColors,
- ULONG nColorCount, ULONG* pTols = NULL );
+ sal_uLong nColorCount, sal_uLong* pTols = NULL );
GDIMetaFile GetMonochromeMtf( const Color& rCol ) const;
void Record( OutputDevice* pOutDev );
- BOOL IsRecord() const { return bRecord; }
+ sal_Bool IsRecord() const { return bRecord; }
- void Play( GDIMetaFile& rMtf, ULONG nPos = GDI_METAFILE_END );
- void Play( OutputDevice* pOutDev, ULONG nPos = GDI_METAFILE_END );
+ void Play( GDIMetaFile& rMtf, sal_uLong nPos = GDI_METAFILE_END );
+ void Play( OutputDevice* pOutDev, sal_uLong nPos = GDI_METAFILE_END );
void Play( OutputDevice* pOutDev, const Point& rPos,
- const Size& rSize, ULONG nPos = GDI_METAFILE_END );
+ const Size& rSize, sal_uLong nPos = GDI_METAFILE_END );
- void Pause( BOOL bPause );
- BOOL IsPause() const { return bPause; }
+ void Pause( sal_Bool bPause );
+ sal_Bool IsPause() const { return bPause; }
void Stop();
void WindStart();
void WindEnd();
- void Wind( ULONG nAction );
+ void Wind( sal_uLong nAction );
void WindPrev();
void WindNext();
- ULONG GetActionCount() const { return Count(); }
+ sal_uLong GetActionCount() const { return Count(); }
void AddAction( MetaAction* pAction );
- void AddAction( MetaAction* pAction, ULONG nPos );
- void RemoveAction( ULONG nPos );
- MetaAction* CopyAction( ULONG nPos ) const;
+ void AddAction( MetaAction* pAction, sal_uLong nPos );
+ void RemoveAction( sal_uLong nPos );
+ MetaAction* CopyAction( sal_uLong nPos ) const;
MetaAction* GetCurAction() const { return (MetaAction*) GetCurObject(); }
- MetaAction* GetAction( ULONG nAction ) const { return (MetaAction*) GetObject( nAction ); }
+ MetaAction* GetAction( sal_uLong nAction ) const { return (MetaAction*) GetObject( nAction ); }
MetaAction* FirstAction() { return (MetaAction*) First(); }
MetaAction* NextAction() { return (MetaAction*) Next(); }
- MetaAction* ReplaceAction( MetaAction* pAction, ULONG nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
+ MetaAction* ReplaceAction( MetaAction* pAction, sal_uLong nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
- ULONG GetActionPos( const String& rLabel );
- BOOL InsertLabel( const String& rLabel, ULONG nActionPos );
+ sal_uLong GetActionPos( const String& rLabel );
+ sal_Bool InsertLabel( const String& rLabel, sal_uLong nActionPos );
void RemoveLabel( const String& rLabel );
void RenameLabel( const String& rLabel, const String& rNewLabel );
- ULONG GetLabelCount() const;
- String GetLabel( ULONG nLabel );
+ sal_uLong GetLabelCount() const;
+ String GetLabel( sal_uLong nLabel );
- BOOL SaveStatus();
+ sal_Bool SaveStatus();
const Size& GetPrefSize() const { return aPrefSize; }
void SetPrefSize( const Size& rSize ) { aPrefSize = rSize; }
@@ -231,8 +231,8 @@ public:
void SetHookHdl( const Link& rLink ) { aHookHdlLink = rLink; }
const Link& GetHookHdl() const { return aHookHdlLink; }
- ULONG GetChecksum() const;
- ULONG GetSizeBytes() const;
+ sal_uLong GetChecksum() const;
+ sal_uLong GetSizeBytes() const;
// Methoden zum Lesen und Schreiben des neuen Formats;
// die Read-Methode kann auch das alte Format lesen
@@ -244,10 +244,10 @@ public:
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile );
- BOOL CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
+ sal_Bool CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
- void UseCanvas( BOOL _bUseCanvas );
- BOOL GetUseCanvas() const { return bUseCanvas; }
+ void UseCanvas( sal_Bool _bUseCanvas );
+ sal_Bool GetUseCanvas() const { return bUseCanvas; }
};
/** Create a special metaaction that delegates rendering to specified
diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx
index 5f1b593ba44a..1d4362f00dc1 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -40,16 +40,16 @@
struct ImpBuffer
{
- ULONG mnRefCount;
- BYTE* mpBuffer;
+ sal_uLong mnRefCount;
+ sal_uInt8* mpBuffer;
- ImpBuffer( ULONG nSize )
+ ImpBuffer( sal_uLong nSize )
{
mnRefCount = 1UL;
- mpBuffer = nSize ? new BYTE[ nSize ] : NULL;
+ mpBuffer = nSize ? new sal_uInt8[ nSize ] : NULL;
}
- ImpBuffer( BYTE* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
+ ImpBuffer( sal_uInt8* pBuf ) { mnRefCount = 1UL; mpBuffer = pBuf; }
~ImpBuffer() { delete[] mpBuffer; }
};
@@ -61,15 +61,15 @@ struct ImpBuffer
struct ImpSwap
{
rtl::OUString maURL;
- ULONG mnDataSize;
- ULONG mnRefCount;
+ sal_uLong mnDataSize;
+ sal_uLong mnRefCount;
- ImpSwap( BYTE* pData, ULONG nDataSize );
+ ImpSwap( sal_uInt8* pData, sal_uLong nDataSize );
~ImpSwap();
- BYTE* GetData() const;
+ sal_uInt8* GetData() const;
- BOOL IsSwapped() const { return maURL.getLength() > 0; }
+ sal_Bool IsSwapped() const { return maURL.getLength() > 0; }
void WriteTo( SvStream& rOStm ) const;
};
@@ -135,7 +135,7 @@ private:
sal_uInt32 mnBufSize;
sal_uInt32 mnUserId;
ImpGfxLink* mpImpData;
- ULONG mnExtra2;
+ sal_uLong mnExtra2;
SAL_DLLPRIVATE void ImplCopy( const GfxLink& rGfxLink );
@@ -143,7 +143,7 @@ public:
GfxLink();
GfxLink( const GfxLink& );
GfxLink( const String& rPath, GfxLinkType nType );
- GfxLink( BYTE* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, BOOL bOwns );
+ GfxLink( sal_uInt8* pBuf, sal_uInt32 nBufSize, GfxLinkType nType, sal_Bool bOwns );
~GfxLink();
GfxLink& operator=( const GfxLink& );
@@ -155,8 +155,8 @@ public:
sal_uInt32 GetUserId() const { return mnUserId; }
sal_uInt32 GetDataSize() const;
- void SetData( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns );
- const BYTE* GetData() const;
+ void SetData( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns );
+ const sal_uInt8* GetData() const;
const Size& GetPrefSize() const;
void SetPrefSize( const Size& rPrefSize );
@@ -166,16 +166,16 @@ public:
void SetPrefMapMode( const MapMode& rPrefMapMode );
bool IsPrefMapModeValid();
- BOOL IsNative() const;
- BOOL IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
+ sal_Bool IsNative() const;
+ sal_Bool IsUser() const { return( GFX_LINK_TYPE_USER == meType ); }
- BOOL LoadNative( Graphic& rGraphic );
+ sal_Bool LoadNative( Graphic& rGraphic );
- BOOL ExportNative( SvStream& rOStream ) const;
+ sal_Bool ExportNative( SvStream& rOStream ) const;
void SwapOut();
void SwapIn();
- BOOL IsSwappedOut() const { return( mpSwap != NULL ); }
+ sal_Bool IsSwappedOut() const { return( mpSwap != NULL ); }
public:
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index 48eb16a7f17b..b346f55273ef 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -49,7 +49,6 @@ class ImplFontOptions;
namespace basegfx { class B2DPolyPolygon; }
class RawBitmap;
-class CmapResult;
#include <vcl/outfont.hxx>
#include <vcl/impfont.hxx>
@@ -64,7 +63,7 @@ namespace vcl
// =======================================================================
-class VCL_DLLPUBLIC GlyphCache
+class VCL_PLUGIN_PUBLIC GlyphCache
{
public:
explicit GlyphCache( GlyphCachePeer& );
@@ -96,7 +95,7 @@ private:
void GrowNotify();
private:
- ULONG CalcByteCount() const;
+ sal_uLong CalcByteCount() const;
void GarbageCollect();
// the GlyphCache's FontList matches a font request to a serverfont instance
@@ -105,8 +104,8 @@ private:
struct IFSD_Hash{ size_t operator()( const ImplFontSelectData& ) const; };
typedef ::boost::unordered_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
FontList maFontList;
- ULONG mnMaxSize; // max overall cache size in bytes
- mutable ULONG mnBytesUsed;
+ sal_uLong mnMaxSize; // max overall cache size in bytes
+ mutable sal_uLong mnBytesUsed;
mutable long mnLruIndex;
mutable int mnGlyphCount;
ServerFont* mpCurrentGCFont;
@@ -179,7 +178,7 @@ private:
// =======================================================================
-class VCL_DLLPUBLIC ServerFont
+class VCL_PLUGIN_PUBLIC ServerFont
{
public:
virtual const ::rtl::OString* GetFontFileName() const { return NULL; }
@@ -195,9 +194,9 @@ public:
const ImplFontSelectData& GetFontSelData() const { return maFontSelData; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; }
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const { return 0; }
virtual int GetGlyphKernValue( int, int ) const { return 0; }
- virtual bool GetFontCodeRanges( CmapResult& ) const { return false; }
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
virtual bool GetFontCapabilities(vcl::FontCapabilities &) const { return false; }
Point TransformPoint( const Point& ) const;
@@ -225,7 +224,7 @@ protected:
void AddRef() const { ++mnRefCount; }
long GetRefCount() const { return mnRefCount; }
long Release() const;
- ULONG GetByteCount() const { return mnBytesUsed; }
+ sal_uLong GetByteCount() const { return mnBytesUsed; }
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const = 0;
virtual void GarbageCollect( long );
@@ -245,7 +244,7 @@ private:
// used by GlyphCache for cache LRU algorithm
mutable long mnRefCount;
- mutable ULONG mnBytesUsed;
+ mutable sal_uLong mnBytesUsed;
ServerFont* mpPrevGCFont;
ServerFont* mpNextGCFont;
@@ -263,7 +262,7 @@ private:
// =======================================================================
// a class for cache entries for physical font instances that are based on serverfonts
-class VCL_DLLPUBLIC ImplServerFontEntry : public ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
@@ -279,7 +278,7 @@ public:
// =======================================================================
-class VCL_DLLPUBLIC ServerFontLayout : public GenericSalLayout
+class VCL_PLUGIN_PUBLIC ServerFontLayout : public GenericSalLayout
{
private:
ServerFont& mrServerFont;
@@ -324,7 +323,7 @@ protected:
// =======================================================================
-class VCL_DLLPUBLIC RawBitmap
+class VCL_PLUGIN_PUBLIC RawBitmap
{
public:
RawBitmap();
@@ -333,13 +332,13 @@ public:
public:
unsigned char* mpBits;
- ULONG mnAllocated;
+ sal_uLong mnAllocated;
- ULONG mnWidth;
- ULONG mnHeight;
+ sal_uLong mnWidth;
+ sal_uLong mnHeight;
- ULONG mnScanlineSize;
- ULONG mnBitCount;
+ sal_uLong mnScanlineSize;
+ sal_uLong mnBitCount;
int mnXOffset;
int mnYOffset;
@@ -357,7 +356,7 @@ inline void ServerFont::SetExtended( int nInfo, void* pVoid )
// ExtraKernInfo allows an on-demand query of extra kerning info #i29881#
// The kerning values have to be scaled to match the font size before use
-class VCL_DLLPUBLIC ExtraKernInfo
+class VCL_PLUGIN_PUBLIC ExtraKernInfo
{
public:
ExtraKernInfo( sal_IntPtr nFontId );
diff --git a/vcl/inc/vcl/gradient.hxx b/vcl/inc/vcl/gradient.hxx
index e451e238b912..1ed0c12ce98f 100644
--- a/vcl/inc/vcl/gradient.hxx
+++ b/vcl/inc/vcl/gradient.hxx
@@ -56,17 +56,17 @@ class SvStream;
class Impl_Gradient
{
public:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
GradientStyle meStyle;
Color maStartColor;
Color maEndColor;
- USHORT mnAngle;
- USHORT mnBorder;
- USHORT mnOfsX;
- USHORT mnOfsY;
- USHORT mnIntensityStart;
- USHORT mnIntensityEnd;
- USHORT mnStepCount;
+ sal_uInt16 mnAngle;
+ sal_uInt16 mnBorder;
+ sal_uInt16 mnOfsX;
+ sal_uInt16 mnOfsY;
+ sal_uInt16 mnIntensityStart;
+ sal_uInt16 mnIntensityEnd;
+ sal_uInt16 mnStepCount;
friend SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImplGradient );
friend SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImplGradient );
@@ -102,31 +102,31 @@ public:
void SetEndColor( const Color& rColor );
const Color& GetEndColor() const { return mpImplGradient->maEndColor; }
- void SetAngle( USHORT nAngle );
- USHORT GetAngle() const { return mpImplGradient->mnAngle; }
+ void SetAngle( sal_uInt16 nAngle );
+ sal_uInt16 GetAngle() const { return mpImplGradient->mnAngle; }
- void SetBorder( USHORT nBorder );
- USHORT GetBorder() const { return mpImplGradient->mnBorder; }
- void SetOfsX( USHORT nOfsX );
- USHORT GetOfsX() const { return mpImplGradient->mnOfsX; }
- void SetOfsY( USHORT nOfsY );
- USHORT GetOfsY() const { return mpImplGradient->mnOfsY; }
+ void SetBorder( sal_uInt16 nBorder );
+ sal_uInt16 GetBorder() const { return mpImplGradient->mnBorder; }
+ void SetOfsX( sal_uInt16 nOfsX );
+ sal_uInt16 GetOfsX() const { return mpImplGradient->mnOfsX; }
+ void SetOfsY( sal_uInt16 nOfsY );
+ sal_uInt16 GetOfsY() const { return mpImplGradient->mnOfsY; }
- void SetStartIntensity( USHORT nIntens );
- USHORT GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
- void SetEndIntensity( USHORT nIntens );
- USHORT GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
+ void SetStartIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetStartIntensity() const { return mpImplGradient->mnIntensityStart; }
+ void SetEndIntensity( sal_uInt16 nIntens );
+ sal_uInt16 GetEndIntensity() const { return mpImplGradient->mnIntensityEnd; }
- void SetSteps( USHORT nSteps );
- USHORT GetSteps() const { return mpImplGradient->mnStepCount; }
+ void SetSteps( sal_uInt16 nSteps );
+ sal_uInt16 GetSteps() const { return mpImplGradient->mnStepCount; }
void GetBoundRect( const Rectangle& rRect, Rectangle &rBoundRect, Point& rCenter ) const;
Gradient& operator=( const Gradient& rGradient );
- BOOL operator==( const Gradient& rGradient ) const;
- BOOL operator!=( const Gradient& rGradient ) const
+ sal_Bool operator==( const Gradient& rGradient ) const;
+ sal_Bool operator!=( const Gradient& rGradient ) const
{ return !(Gradient::operator==( rGradient )); }
- BOOL IsSameInstance( const Gradient& rGradient ) const
+ sal_Bool IsSameInstance( const Gradient& rGradient ) const
{ return (mpImplGradient == rGradient.mpImplGradient); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Gradient& rGradient );
diff --git a/vcl/inc/vcl/graph.h b/vcl/inc/vcl/graph.h
index 803df074882d..1df2ee7a3df3 100644
--- a/vcl/inc/vcl/graph.h
+++ b/vcl/inc/vcl/graph.h
@@ -57,11 +57,11 @@ protected:
String maUpperName;
ReaderData* mpReaderData;
- BOOL mbIsReading;
+ sal_Bool mbIsReading;
GraphicReader() :
mpReaderData( NULL ),
- mbIsReading( FALSE ) {}
+ mbIsReading( sal_False ) {}
public:
@@ -69,11 +69,11 @@ public:
const String& GetUpperFilterName() const { return maUpperName; }
ReaderData* GetReaderData() const { return mpReaderData; }
- BOOL IsReading() const { return mbIsReading; }
+ sal_Bool IsReading() const { return mbIsReading; }
// TODO: when incompatible changes are possible again
// the preview size hint should be redone
- BOOL IsPreviewModeEnabled() const;
+ sal_Bool IsPreviewModeEnabled() const;
void DisablePreviewMode();
void SetPreviewSize( const Size& );
Size GetPreviewSize() const;
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index 78994327041e..3dfbb8d261d8 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -106,19 +106,19 @@ public:
virtual ~Graphic();
Graphic& operator=( const Graphic& rGraphic );
- BOOL operator==( const Graphic& rGraphic ) const;
- BOOL operator!=( const Graphic& rGraphic ) const;
- BOOL operator!() const;
+ sal_Bool operator==( const Graphic& rGraphic ) const;
+ sal_Bool operator!=( const Graphic& rGraphic ) const;
+ sal_Bool operator!() const;
void Clear();
GraphicType GetType() const;
void SetDefaultType();
- BOOL IsSupportedGraphic() const;
+ sal_Bool IsSupportedGraphic() const;
- BOOL IsTransparent() const;
- BOOL IsAlpha() const;
- BOOL IsAnimated() const;
+ sal_Bool IsTransparent() const;
+ sal_Bool IsAlpha() const;
+ sal_Bool IsAnimated() const;
// #i102089# Access of Bitmap potentially will have to rasterconvert the Graphic
// if it is a MetaFile. To be able to control this conversion it is necessary to
@@ -141,7 +141,7 @@ public:
Size GetSizePixel( const OutputDevice* pRefDevice = NULL ) const;
- ULONG GetSizeBytes() const;
+ sal_uLong GetSizeBytes() const;
void Draw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
@@ -170,12 +170,12 @@ public:
void SetAnimationNotifyHdl( const Link& rLink );
Link GetAnimationNotifyHdl() const;
- ULONG GetAnimationLoopCount() const;
+ sal_uLong GetAnimationLoopCount() const;
void ResetAnimationLoopCount();
List* GetAnimationInfoList() const;
- ULONG GetChecksum() const;
+ sal_uLong GetChecksum() const;
public:
@@ -184,26 +184,26 @@ public:
public:
- static USHORT GetGraphicsCompressMode( SvStream& rIStm );
+ static sal_uInt16 GetGraphicsCompressMode( SvStream& rIStm );
- void SetDocFileName( const String& rName, ULONG nFilePos );
+ void SetDocFileName( const String& rName, sal_uLong nFilePos );
const String& GetDocFileName() const;
- ULONG GetDocFilePos() const;
+ sal_uLong GetDocFilePos() const;
- BOOL ReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
- BOOL WriteEmbedded( SvStream& rOStream );
+ sal_Bool ReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
+ sal_Bool WriteEmbedded( SvStream& rOStream );
- BOOL SwapOut();
- BOOL SwapOut( SvStream* pOStm );
- BOOL SwapIn();
- BOOL SwapIn( SvStream* pIStm );
- BOOL IsSwapOut() const;
+ sal_Bool SwapOut();
+ sal_Bool SwapOut( SvStream* pOStm );
+ sal_Bool SwapIn();
+ sal_Bool SwapIn( SvStream* pIStm );
+ sal_Bool IsSwapOut() const;
void SetLink( const GfxLink& );
GfxLink GetLink() const;
- BOOL IsLink() const;
+ sal_Bool IsLink() const;
- BOOL ExportNative( SvStream& rOStream ) const;
+ sal_Bool ExportNative( SvStream& rOStream ) const;
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Graphic& rGraphic );
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Graphic& rGraphic );
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index de39ba36cdbc..f605f190f669 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -93,7 +93,7 @@ private:
// This class uses the SIL Graphite engine to provide complex text layout services to the VCL
// @author tse
//
-class VCL_DLLPUBLIC GraphiteLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayout : public SalLayout
{
public:
@@ -170,8 +170,6 @@ private:
long & rDXOffset, bool bIsBase, int baseChar);
};
-
-
#endif // _SV_GRAPHITELAYOUT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/graphite_serverfont.hxx b/vcl/inc/vcl/graphite_serverfont.hxx
index 8de41337feae..b4a6e10be925 100644
--- a/vcl/inc/vcl/graphite_serverfont.hxx
+++ b/vcl/inc/vcl/graphite_serverfont.hxx
@@ -37,7 +37,7 @@
// Modules
-class VCL_DLLPUBLIC GraphiteLayoutImpl : public GraphiteLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayoutImpl : public GraphiteLayout
{
public:
GraphiteLayoutImpl(const gr_face * pFace,
@@ -52,7 +52,7 @@ private:
// This class implments the server font specific parts.
// @author tse
//
-class VCL_DLLPUBLIC GraphiteServerFontLayout : public ServerFontLayout
+class VCL_PLUGIN_PUBLIC GraphiteServerFontLayout : public ServerFontLayout
{
private:
// mutable so that the DrawOffset/DrawBase can be set
@@ -102,8 +102,6 @@ public:
int getMaxCharPos() const { return mnEndCharPos; }
};
-
-
#endif
#endif //_SV_GRAPHITESERVERFONT_HXX
diff --git a/vcl/inc/vcl/group.hxx b/vcl/inc/vcl/group.hxx
index 765021fbe89b..3334988c7877 100644
--- a/vcl/inc/vcl/group.hxx
+++ b/vcl/inc/vcl/group.hxx
@@ -44,8 +44,8 @@ private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout = false );
virtual void FillLayoutData() const;
@@ -59,7 +59,7 @@ public:
GroupBox( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/vcl/inc/vcl/hatch.hxx b/vcl/inc/vcl/hatch.hxx
index 3cdcd0e24c2c..947740229f7f 100644
--- a/vcl/inc/vcl/hatch.hxx
+++ b/vcl/inc/vcl/hatch.hxx
@@ -42,11 +42,11 @@ class SvStream;
struct ImplHatch
{
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
Color maColor;
HatchStyle meStyle;
long mnDistance;
- USHORT mnAngle;
+ sal_uInt16 mnAngle;
ImplHatch();
ImplHatch( const ImplHatch& rImplHatch );
@@ -70,13 +70,13 @@ public:
Hatch();
Hatch( const Hatch& rHatch );
- Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, USHORT nAngle10 = 0 );
+ Hatch( HatchStyle eStyle, const Color& rHatchColor, long nDistance, sal_uInt16 nAngle10 = 0 );
~Hatch();
Hatch& operator=( const Hatch& rHatch );
- BOOL operator==( const Hatch& rHatch ) const;
- BOOL operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
- BOOL IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
+ sal_Bool operator==( const Hatch& rHatch ) const;
+ sal_Bool operator!=( const Hatch& rHatch ) const { return !(Hatch::operator==( rHatch ) ); }
+ sal_Bool IsSameInstance( const Hatch& rHatch ) const { return( mpImplHatch == rHatch.mpImplHatch ); }
void SetStyle( HatchStyle eStyle );
HatchStyle GetStyle() const { return mpImplHatch->meStyle; }
@@ -87,8 +87,8 @@ public:
void SetDistance( long nDistance );
long GetDistance() const { return mpImplHatch->mnDistance; }
- void SetAngle( USHORT nAngle10 );
- USHORT GetAngle() const { return mpImplHatch->mnAngle; }
+ void SetAngle( sal_uInt16 nAngle10 );
+ sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Hatch& rHatch );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch );
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index e91b459ee8cc..ce7d1baf4fd6 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -41,20 +41,26 @@ class Window;
// - Help-Types -
// --------------
-#define QUICKHELP_LEFT ((USHORT)0x0001)
-#define QUICKHELP_CENTER ((USHORT)0x0002)
-#define QUICKHELP_RIGHT ((USHORT)0x0004)
-#define QUICKHELP_TOP ((USHORT)0x0008)
-#define QUICKHELP_VCENTER ((USHORT)0x0010)
-#define QUICKHELP_BOTTOM ((USHORT)0x0020)
-#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
-#define QUICKHELP_CTRLTEXT ((USHORT)0x0040)
-#define QUICKHELP_NOEVADEPOINTER ((USHORT)0x4000)
-#define QUICKHELP_BIDI_RTL ((USHORT)0x8000)
+#define QUICKHELP_LEFT ((sal_uInt16)0x0001)
+#define QUICKHELP_CENTER ((sal_uInt16)0x0002)
+#define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
+#define QUICKHELP_TOP ((sal_uInt16)0x0008)
+#define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
+#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
+#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
+#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
+/// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
+#define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
+/// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
+#define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
+/// force balloon-style in ShowTip
+#define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
+#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
+#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
// --------
// - Help -
@@ -72,53 +78,56 @@ public:
void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
const String& GetHelpFile() const { return maHelpFile; }
- virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
- virtual BOOL Start( const XubString& rKeyWord, const Window* pWindow );
- virtual void OpenHelpAgent( ULONG nHelpId );
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
+ virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow );
+ virtual sal_Bool SearchKeyword( const XubString& rKeyWord );
+ virtual void OpenHelpAgent( const rtl::OString& rHelpId );
virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
static void EnableContextHelp();
static void DisableContextHelp();
- static BOOL IsContextHelpEnabled();
- static BOOL StartContextHelp();
+ static sal_Bool IsContextHelpEnabled();
+ static sal_Bool StartContextHelp();
static void EnableExtHelp();
static void DisableExtHelp();
- static BOOL IsExtHelpEnabled();
- static BOOL StartExtHelp();
- static BOOL EndExtHelp();
- static BOOL IsExtHelpActive();
+ static sal_Bool IsExtHelpEnabled();
+ static sal_Bool StartExtHelp();
+ static sal_Bool EndExtHelp();
+ static sal_Bool IsExtHelpActive();
static void EnableBalloonHelp();
static void DisableBalloonHelp();
- static BOOL IsBalloonHelpEnabled();
- static BOOL ShowBalloon( Window* pParent,
+ static sal_Bool IsBalloonHelpEnabled();
+ static sal_Bool ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText );
- static BOOL ShowBalloon( Window* pParent,
+ static sal_Bool ShowBalloon( Window* pParent,
const Point& rScreenPos,
const Rectangle&,
const XubString& rHelpText );
static void EnableQuickHelp();
static void DisableQuickHelp();
- static BOOL IsQuickHelpEnabled();
- static BOOL ShowQuickHelp( Window* pParent,
+ static sal_Bool IsQuickHelpEnabled();
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- USHORT nStyle = 0 );
- static BOOL ShowQuickHelp( Window* pParent,
+ sal_uInt16 nStyle = 0 );
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
- USHORT nStyle = 0 )
+ sal_uInt16 nStyle = 0 )
{ return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); }
- static ULONG ShowTip( Window* pParent,
+ static sal_uLong ShowTip( Window* pParent,
const Rectangle& rScreenRect,
- const XubString& rText, USHORT nStyle = 0 );
- static void HideTip( ULONG nId );
+ const XubString& rText, sal_uInt16 nStyle = 0 );
+ static void UpdateTip( sal_uLong nId,
+ Window* pParent,
+ const Rectangle& rScreenRect,
+ const XubString& rText );
+ static void HideTip( sal_uLong nId );
};
#endif // _SV_HELP_HXX
diff --git a/vcl/inc/vcl/helpwin.hxx b/vcl/inc/vcl/helpwin.hxx
index 9066012d05f2..7862a4961bbd 100644
--- a/vcl/inc/vcl/helpwin.hxx
+++ b/vcl/inc/vcl/helpwin.hxx
@@ -50,8 +50,8 @@ private:
Timer maShowTimer;
Timer maHideTimer;
- USHORT mnHelpWinStyle;
- USHORT mnStyle;
+ sal_uInt16 mnHelpWinStyle;
+ sal_uInt16 mnStyle;
protected:
DECL_LINK( TimerHdl, Timer* );
@@ -61,33 +61,34 @@ protected:
void ImplShow();
public:
- HelpTextWindow( Window* pParent, const String& rText, USHORT nHelpWinStyle, USHORT nStyle );
+ HelpTextWindow( Window* pParent, const String& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle );
~HelpTextWindow();
const String& GetHelpText() const { return maHelpText; }
void SetHelpText( const String& rHelpText );
- USHORT GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
// Nur merken:
void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
void SetHelpArea( const Rectangle& rRect ) { maHelpArea = rRect; }
- void ShowHelp( USHORT nDelayMode );
+ void ShowHelp( sal_uInt16 nDelayMode );
Size CalcOutSize() const;
const Rectangle& GetHelpArea() const { return maHelpArea; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- BOOL RegisterAccessibleParent();
+ sal_Bool RegisterAccessibleParent();
void RevokeAccessibleParent();
};
-void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const String& rHelpText, const String& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea = NULL );
void ImplDestroyHelpWindow( bool bUpdateHideTime );
-void ImplSetHelpWindowPos( Window* pHelpWindow, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const Point& rPos, const Rectangle* pHelpArea );
#endif // _SV_HELPWIN_HXX
diff --git a/vcl/inc/vcl/i18nhelp.hxx b/vcl/inc/vcl/i18nhelp.hxx
index 428032ae2017..a83afa4510ab 100644
--- a/vcl/inc/vcl/i18nhelp.hxx
+++ b/vcl/inc/vcl/i18nhelp.hxx
@@ -87,7 +87,7 @@ public:
sal_Bool MatchMnemonic( const String& rString, sal_Unicode cMnemonicChar ) const;
String GetDate( const Date& rDate ) const;
- String GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep = TRUE, BOOL bTrailingZeros = TRUE ) const;
+ String GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep = sal_True, sal_Bool bTrailingZeros = sal_True ) const;
static String filterFormattingChars( const String& );
};
diff --git a/vcl/inc/vcl/idlemgr.hxx b/vcl/inc/vcl/idlemgr.hxx
index a0f5aa9a052c..674bdf070c3a 100644
--- a/vcl/inc/vcl/idlemgr.hxx
+++ b/vcl/inc/vcl/idlemgr.hxx
@@ -50,7 +50,7 @@ public:
ImplIdleMgr();
~ImplIdleMgr();
- BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
+ sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
void RemoveIdleHdl( const Link& rLink );
void RestartIdler()
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index b468978f247e..850531c64d9d 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -37,6 +37,7 @@
#include <vcl/lstbox.h>
#include <vcl/timer.hxx>
+#include "vcl/quickselectionengine.hxx"
class ScrollBar;
class ScrollBarBox;
@@ -66,7 +67,7 @@ struct ImplEntryType
XubString maStr;
Image maImage;
void* mpUserData;
- BOOL mbIsSelected;
+ sal_Bool mbIsSelected;
long mnFlags;
long mnHeight;
@@ -76,7 +77,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
@@ -85,7 +86,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
@@ -94,7 +95,7 @@ struct ImplEntryType
mnFlags( 0 ),
mnHeight( 0 )
{
- mbIsSelected = FALSE;
+ mbIsSelected = sal_False;
mpUserData = NULL;
}
};
@@ -107,100 +108,98 @@ class ImplEntryList : private List
{
private:
Window* mpWindow; // For getting the current locale when matching strings
- USHORT mnLastSelected;
- USHORT mnSelectionAnchor;
- USHORT mnImages;
+ sal_uInt16 mnLastSelected;
+ sal_uInt16 mnSelectionAnchor;
+ sal_uInt16 mnImages;
- USHORT mnMRUCount;
- USHORT mnMaxMRUCount;
+ sal_uInt16 mnMRUCount;
+ sal_uInt16 mnMaxMRUCount;
Link maSelectionChangedHdl;
- BOOL mbCallSelectionChangedHdl;
+ sal_Bool mbCallSelectionChangedHdl;
- ImplEntryType* GetEntry( USHORT nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
+ ImplEntryType* GetEntry( sal_uInt16 nPos ) const { return (ImplEntryType*)List::GetObject( nPos ); }
public:
ImplEntryList( Window* pWindow );
~ImplEntryList();
- USHORT InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL bSort );
- void RemoveEntry( USHORT nPos );
- const ImplEntryType* GetEntryPtr( USHORT nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
- ImplEntryType* GetMutableEntryPtr( USHORT nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort );
+ void RemoveEntry( sal_uInt16 nPos );
+ const ImplEntryType* GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
+ ImplEntryType* GetMutableEntryPtr( sal_uInt16 nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
void Clear();
- USHORT FindMatchingEntry( const XubString& rStr, USHORT nStart = 0, BOOL bForward = TRUE, BOOL bLazy = TRUE ) const;
- USHORT FindEntry( const XubString& rStr, BOOL bSearchMRUArea = FALSE ) const;
- USHORT FindEntry( const void* pData ) const;
+ sal_uInt16 FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart = 0, sal_Bool bForward = sal_True, sal_Bool bLazy = sal_True ) const;
+ sal_uInt16 FindEntry( const XubString& rStr, sal_Bool bSearchMRUArea = sal_False ) const;
+ sal_uInt16 FindEntry( const void* pData ) const;
// helper: add up heights up to index nEndIndex.
// GetAddedHeight( 0 ) returns 0
// GetAddedHeight( LISTBOX_ENTRY_NOTFOUND ) returns 0
// GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i )
- long GetAddedHeight( USHORT nEndIndex, USHORT nBeginIndex = 0, long nBeginHeight = 0 ) const;
- long GetEntryHeight( USHORT nPos ) const;
+ long GetAddedHeight( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const;
+ long GetEntryHeight( sal_uInt16 nPos ) const;
- USHORT GetEntryCount() const { return (USHORT)List::Count(); }
- BOOL HasImages() const { return mnImages ? TRUE : FALSE; }
+ sal_uInt16 GetEntryCount() const { return (sal_uInt16)List::Count(); }
+ sal_Bool HasImages() const { return mnImages ? sal_True : sal_False; }
- XubString GetEntryText( USHORT nPos ) const;
+ XubString GetEntryText( sal_uInt16 nPos ) const;
- BOOL HasEntryImage( USHORT nPos ) const;
- Image GetEntryImage( USHORT nPos ) const;
+ sal_Bool HasEntryImage( sal_uInt16 nPos ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
- void SetEntryFlags( USHORT nPos, long nFlags );
- long GetEntryFlags( USHORT nPos ) const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
- USHORT GetSelectEntryCount() const;
- XubString GetSelectEntry( USHORT nIndex ) const;
- USHORT GetSelectEntryPos( USHORT nIndex ) const;
- BOOL IsEntrySelected( const XubString& rStr ) const;
- BOOL IsEntryPosSelected( USHORT nIndex ) const;
+ sal_uInt16 GetSelectEntryCount() const;
+ XubString GetSelectEntry( sal_uInt16 nIndex ) const;
+ sal_uInt16 GetSelectEntryPos( sal_uInt16 nIndex ) const;
+ sal_Bool IsEntrySelected( const XubString& rStr ) const;
+ sal_Bool IsEntryPosSelected( sal_uInt16 nIndex ) const;
- void SetLastSelected( USHORT nPos ) { mnLastSelected = nPos; }
- USHORT GetLastSelected() const { return mnLastSelected; }
+ void SetLastSelected( sal_uInt16 nPos ) { mnLastSelected = nPos; }
+ sal_uInt16 GetLastSelected() const { return mnLastSelected; }
- void SetSelectionAnchor( USHORT nPos ) { mnSelectionAnchor = nPos; }
- USHORT GetSelectionAnchor() const { return mnSelectionAnchor; }
+ void SetSelectionAnchor( sal_uInt16 nPos ) { mnSelectionAnchor = nPos; }
+ sal_uInt16 GetSelectionAnchor() const { return mnSelectionAnchor; }
void SetSelectionChangedHdl( const Link& rLnk ) { maSelectionChangedHdl = rLnk; }
- void SetCallSelectionChangedHdl( BOOL bCall ) { mbCallSelectionChangedHdl = bCall; }
+ void SetCallSelectionChangedHdl( sal_Bool bCall ) { mbCallSelectionChangedHdl = bCall; }
- void SetMRUCount( USHORT n ) { mnMRUCount = n; }
- USHORT GetMRUCount() const { return mnMRUCount; }
+ void SetMRUCount( sal_uInt16 n ) { mnMRUCount = n; }
+ sal_uInt16 GetMRUCount() const { return mnMRUCount; }
- void SetMaxMRUCount( USHORT n ) { mnMaxMRUCount = n; }
- USHORT GetMaxMRUCount() const { return mnMaxMRUCount; }
+ void SetMaxMRUCount( sal_uInt16 n ) { mnMaxMRUCount = n; }
+ sal_uInt16 GetMaxMRUCount() const { return mnMaxMRUCount; }
/** An Entry is selectable if its mnFlags does not have the
LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */
- bool IsEntrySelectable( USHORT nPos ) const;
+ bool IsEntrySelectable( sal_uInt16 nPos ) const;
/** returns the first entry found from the given position nPos that is selectable
or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable,
it returns the first selectable entry after nPos if bForward is true and the
first selectable entry after nPos is bForward is false.
*/
- USHORT FindFirstSelectable( USHORT nPos, bool bForward = true );
+ sal_uInt16 FindFirstSelectable( sal_uInt16 nPos, bool bForward = true );
};
// ---------------------
// - ImplListBoxWindow -
// ---------------------
-class ImplListBoxWindow : public Control
+class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
{
private:
ImplEntryList* mpEntryList; // EntryListe
Rectangle maFocusRect;
- String maSearchStr;
- Timer maSearchTimeout;
Size maUserItemSize;
@@ -214,22 +213,22 @@ private:
long mnMaxWidth; // Maximale Breite eines Eintrags
long mnMaxHeight; // Maximale Hoehe eines Eintrags
- USHORT mnCurrentPos; // Position (Focus)
- USHORT mnTrackingSaveSelection; // Selektion vor Tracking();
+ sal_uInt16 mnCurrentPos; // Position (Focus)
+ sal_uInt16 mnTrackingSaveSelection; // Selektion vor Tracking();
- USHORT mnSeparatorPos; // Separator
+ sal_uInt16 mnSeparatorPos; // Separator
- USHORT mnUserDrawEntry;
+ sal_uInt16 mnUserDrawEntry;
- USHORT mnTop; // Ausgabe ab Zeile
+ sal_uInt16 mnTop; // Ausgabe ab Zeile
long mnLeft; // Ausgabe ab Spalte
long mnBorder; // Abstand Rahmen - Text
long mnTextHeight; // Texthoehe
ProminentEntry meProminentType; // where is the "prominent" entry
- USHORT mnSelectModifier; // Modifiers
+ sal_uInt16 mnSelectModifier; // Modifiers
- BOOL mbHasFocusRect: 1,
+ sal_Bool mbHasFocusRect: 1,
mbSort: 1, // ListBox sortiert
mbTrack: 1, // Tracking
mbMulti: 1, // MultiListBox
@@ -255,9 +254,10 @@ private:
Link maUserDrawHdl;
Link maMRUChangedHdl;
-protected:
- DECL_LINK( SearchStringTimeout, Timer* );
+ ::vcl::QuickSelectionEngine
+ maQuickSelectionEngine;
+protected:
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -267,8 +267,8 @@ protected:
virtual void GetFocus();
virtual void LoseFocus();
- BOOL SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL bShift = FALSE, BOOL bCtrl = FALSE );
- void ImplPaint( USHORT nPos, BOOL bErase = FALSE, bool bLayout = false );
+ sal_Bool SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+ void ImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, bool bLayout = false );
void ImplDoPaint( const Rectangle& rRect, bool bLayout = false );
void ImplCalcMetrics();
void ImplUpdateEntryMetrics( ImplEntryType& rEntry );
@@ -289,65 +289,65 @@ public:
ImplEntryList* GetEntryList() const { return mpEntryList; }
- USHORT InsertEntry( USHORT nPos, ImplEntryType* pNewEntry );
- void RemoveEntry( USHORT nPos );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry );
+ void RemoveEntry( sal_uInt16 nPos );
void Clear();
void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
- USHORT GetCurrentPos() const { return mnCurrentPos; }
- USHORT GetDisplayLineCount() const;
- void SetEntryFlags( USHORT nPos, long nFlags );
+ sal_uInt16 GetCurrentPos() const { return mnCurrentPos; }
+ sal_uInt16 GetDisplayLineCount() const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
- void DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
+ void DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
void DeselectAll();
- USHORT GetEntryPosForPoint( const Point& rPoint ) const;
- USHORT GetLastVisibleEntry() const;
+ sal_uInt16 GetEntryPosForPoint( const Point& rPoint ) const;
+ sal_uInt16 GetLastVisibleEntry() const;
- BOOL ProcessKeyInput( const KeyEvent& rKEvt );
+ sal_Bool ProcessKeyInput( const KeyEvent& rKEvt );
- void SetTopEntry( USHORT nTop );
- USHORT GetTopEntry() const { return mnTop; }
+ void SetTopEntry( sal_uInt16 nTop );
+ sal_uInt16 GetTopEntry() const { return mnTop; }
// ShowProminentEntry will set the entry correspoding to nEntryPos
// either at top or in the middle depending on the chosen style
- void ShowProminentEntry( USHORT nEntryPos );
+ void ShowProminentEntry( sal_uInt16 nEntryPos );
void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
ProminentEntry GetProminentEntryType() const { return meProminentType; }
using Window::IsVisible;
- BOOL IsVisible( USHORT nEntry ) const;
+ sal_Bool IsVisible( sal_uInt16 nEntry ) const;
long GetLeftIndent() const { return mnLeft; }
void SetLeftIndent( long n );
void ScrollHorz( long nDiff );
- void AllowGrabFocus( BOOL b ) { mbGrabFocus = b; }
- BOOL IsGrabFocusAllowed() const { return mbGrabFocus; }
+ void AllowGrabFocus( sal_Bool b ) { mbGrabFocus = b; }
+ sal_Bool IsGrabFocusAllowed() const { return mbGrabFocus; }
- void SetSeparatorPos( USHORT n ) { mnSeparatorPos = n; }
- USHORT GetSeparatorPos() const { return mnSeparatorPos; }
+ void SetSeparatorPos( sal_uInt16 n ) { mnSeparatorPos = n; }
+ sal_uInt16 GetSeparatorPos() const { return mnSeparatorPos; }
- void SetTravelSelect( BOOL bTravelSelect ) { mbTravelSelect = bTravelSelect; }
- BOOL IsTravelSelect() const { return mbTravelSelect; }
- BOOL IsTrackingSelect() const { return mbTrackingSelect; }
+ void SetTravelSelect( sal_Bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
+ sal_Bool IsTravelSelect() const { return mbTravelSelect; }
+ sal_Bool IsTrackingSelect() const { return mbTrackingSelect; }
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
- BOOL IsMultiSelectionEnabled() const { return mbMulti; }
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
+ sal_Bool IsMultiSelectionEnabled() const { return mbMulti; }
- void SetMultiSelectionSimpleMode( BOOL bSimple ) { mbSimpleMode = bSimple; }
- BOOL IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
+ void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { mbSimpleMode = bSimple; }
+ sal_Bool IsMultiSelectionSimpleMode() const { return mbSimpleMode; }
- void EnableMouseMoveSelect( BOOL bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
- BOOL IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
- BOOL IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
+ void EnableMouseMoveSelect( sal_Bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
+ sal_Bool IsMouseMoveSelectEnabled() const { return mbMouseMoveSelect; }
+ sal_Bool IsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; }
- Size CalcSize( USHORT nMaxLines ) const;
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ Size CalcSize( sal_uInt16 nMaxLines ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
long GetEntryHeight() const { return mnMaxHeight; }
long GetMaxEntryWidth() const { return mnMaxWidth; }
@@ -365,21 +365,27 @@ public:
void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; }
const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; }
- BOOL IsSelectionChanged() const { return mbSelectionChanged; }
- USHORT GetSelectModifier() const { return mnSelectModifier; }
+ sal_Bool IsSelectionChanged() const { return mbSelectionChanged; }
+ sal_uInt16 GetSelectModifier() const { return mnSelectModifier; }
- void EnableSort( BOOL b ) { mbSort = b; }
+ void EnableSort( sal_Bool b ) { mbSort = b; }
- void SetReadOnly( BOOL bReadOnly ) { mbReadOnly = bReadOnly; }
- BOOL IsReadOnly() const { return mbReadOnly; }
+ void SetReadOnly( sal_Bool bReadOnly ) { mbReadOnly = bReadOnly; }
+ sal_Bool IsReadOnly() const { return mbReadOnly; }
using Control::ImplInitSettings;
- void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- USHORT ImplGetTextStyle() const;
+ void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ sal_uInt16 ImplGetTextStyle() const;
// pb: #106948# explicit mirroring for calc
- inline void EnableMirroring() { mbMirroring = TRUE; }
- inline BOOL IsMirroring() const { return mbMirroring; }
+ inline void EnableMirroring() { mbMirroring = sal_True; }
+ inline sal_Bool IsMirroring() const { return mbMirroring; }
+
+protected:
+ // ISearchableStringList
+ virtual ::vcl::StringEntryIdentifier CurrentEntry( String& _out_entryText ) const;
+ virtual ::vcl::StringEntryIdentifier NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
+ virtual void SelectEntry( ::vcl::StringEntryIdentifier _entry );
};
// ---------------
@@ -393,7 +399,7 @@ private:
ScrollBar* mpHScrollBar;
ScrollBar* mpVScrollBar;
ScrollBarBox* mpScrollBarBox;
- BOOL mbVScroll : 1, // VScroll an oder aus
+ sal_Bool mbVScroll : 1, // VScroll an oder aus
mbHScroll : 1, // HScroll an oder aus
mbAutoHScroll : 1; // AutoHScroll an oder aus
Link maScrollHdl; // Weil der vom ImplListBoxWindow selbst benoetigt wird.
@@ -425,55 +431,55 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
virtual Window* GetPreferredKeyInputWindow();
- USHORT InsertEntry( USHORT nPos, const XubString& rStr );
- USHORT InsertEntry( USHORT nPos, const Image& rImage );
- USHORT InsertEntry( USHORT nPos, const XubString& rStr, const Image& rImage );
- void RemoveEntry( USHORT nPos );
- void SetEntryData( USHORT nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const Image& rImage );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage );
+ void RemoveEntry( sal_uInt16 nPos );
+ void SetEntryData( sal_uInt16 nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
void Clear();
- void SetEntryFlags( USHORT nPos, long nFlags );
- long GetEntryFlags( USHORT nPos ) const;
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SelectEntry( USHORT nPos, BOOL bSelect );
+ void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
void SetNoSelection();
void ResetCurrentPos() { maLBWindow.ResetCurrentPos(); }
- USHORT GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
+ sal_uInt16 GetCurrentPos() const { return maLBWindow.GetCurrentPos(); }
- BOOL ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
- BOOL HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
+ sal_Bool ProcessKeyInput( const KeyEvent& rKEvt ) { return maLBWindow.ProcessKeyInput( rKEvt ); }
+ sal_Bool HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
- void SetSeparatorPos( USHORT n ) { maLBWindow.SetSeparatorPos( n ); }
- USHORT GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
+ void SetSeparatorPos( sal_uInt16 n ) { maLBWindow.SetSeparatorPos( n ); }
+ sal_uInt16 GetSeparatorPos() const { return maLBWindow.GetSeparatorPos(); }
- void SetTopEntry( USHORT nTop ) { maLBWindow.SetTopEntry( nTop ); }
- USHORT GetTopEntry() const { return maLBWindow.GetTopEntry(); }
- void ShowProminentEntry( USHORT nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
+ void SetTopEntry( sal_uInt16 nTop ) { maLBWindow.SetTopEntry( nTop ); }
+ sal_uInt16 GetTopEntry() const { return maLBWindow.GetTopEntry(); }
+ void ShowProminentEntry( sal_uInt16 nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
using Window::IsVisible;
- BOOL IsVisible( USHORT nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
+ sal_Bool IsVisible( sal_uInt16 nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
void SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); }
ProminentEntry GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); }
long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); }
- void SetLeftIndent( USHORT n ) { maLBWindow.SetLeftIndent( n ); }
+ void SetLeftIndent( sal_uInt16 n ) { maLBWindow.SetLeftIndent( n ); }
void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); }
- void SetTravelSelect( BOOL bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
- BOOL IsTravelSelect() const { return maLBWindow.IsTravelSelect(); }
- BOOL IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); }
+ void SetTravelSelect( sal_Bool bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
+ sal_Bool IsTravelSelect() const { return maLBWindow.IsTravelSelect(); }
+ sal_Bool IsTrackingSelect() const { return maLBWindow.IsTrackingSelect(); }
- void EnableMultiSelection( BOOL bMulti, BOOL bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
- BOOL IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
+ sal_Bool IsMultiSelectionEnabled() const { return maLBWindow.IsMultiSelectionEnabled(); }
- void SetMultiSelectionSimpleMode( BOOL bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
- BOOL IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
+ void SetMultiSelectionSimpleMode( sal_Bool bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
+ sal_Bool IsMultiSelectionSimpleMode() const { return maLBWindow.IsMultiSelectionSimpleMode(); }
- void SetReadOnly( BOOL b ) { maLBWindow.SetReadOnly( b ); }
- BOOL IsReadOnly() const { return maLBWindow.IsReadOnly(); }
+ void SetReadOnly( sal_Bool b ) { maLBWindow.SetReadOnly( b ); }
+ sal_Bool IsReadOnly() const { return maLBWindow.IsReadOnly(); }
- Size CalcSize( USHORT nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
+ Size CalcSize( sal_uInt16 nMaxLines ) const { return maLBWindow.CalcSize( nMaxLines ); }
long GetEntryHeight() const { return maLBWindow.GetEntryHeight(); }
long GetMaxEntryWidth() const { return maLBWindow.GetMaxEntryWidth(); }
@@ -489,15 +495,15 @@ public:
const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); }
void SetSelectionChangedHdl( const Link& rLnk ) { maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); }
- void SetCallSelectionChangedHdl( BOOL bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
- BOOL IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); }
- USHORT GetSelectModifier() const { return maLBWindow.GetSelectModifier(); }
+ void SetCallSelectionChangedHdl( sal_Bool bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
+ sal_Bool IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); }
+ sal_uInt16 GetSelectModifier() const { return maLBWindow.GetSelectModifier(); }
void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep );
XubString GetMRUEntries( xub_Unicode cSep ) const;
- void SetMaxMRUCount( USHORT n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
- USHORT GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
- USHORT GetDisplayLineCount() const
+ void SetMaxMRUCount( sal_uInt16 n ) { maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
+ sal_uInt16 GetMaxMRUCount() const { return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
+ sal_uInt16 GetDisplayLineCount() const
{ return maLBWindow.GetDisplayLineCount(); }
// pb: #106948# explicit mirroring for calc
@@ -514,9 +520,9 @@ class ImplListBoxFloatingWindow : public FloatingWindow
private:
ImplListBox* mpImplLB;
Size maPrefSz;
- USHORT mnDDLineCount;
- USHORT mnPopupModeStartSaveSelection;
- BOOL mbAutoWidth;
+ sal_uInt16 mnDDLineCount;
+ sal_uInt16 mnPopupModeStartSaveSelection;
+ sal_Bool mbAutoWidth;
protected:
long PreNotify( NotifyEvent& rNEvt );
@@ -529,21 +535,21 @@ public:
void SetPrefSize( const Size& rSz ) { maPrefSz = rSz; }
const Size& GetPrefSize() const { return maPrefSz; }
- void SetAutoWidth( BOOL b ) { mbAutoWidth = b; }
- BOOL IsAutoWidth() const { return mbAutoWidth; }
+ void SetAutoWidth( sal_Bool b ) { mbAutoWidth = b; }
+ sal_Bool IsAutoWidth() const { return mbAutoWidth; }
Size CalcFloatSize();
- void StartFloat( BOOL bStartTracking );
+ void StartFloat( sal_Bool bStartTracking );
virtual void SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
- void SetDropDownLineCount( USHORT n ) { mnDDLineCount = n; }
- USHORT GetDropDownLineCount() const { return mnDDLineCount; }
+ void SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; }
+ sal_uInt16 GetDropDownLineCount() const { return mnDDLineCount; }
- USHORT GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
+ sal_uInt16 GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
virtual void Resize();
};
@@ -556,7 +562,7 @@ class ImplWin : public Control
{
private:
- USHORT mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
+ sal_uInt16 mnItemPos; // wegen UserDraw muss ich wissen, welches Item ich darstelle.
XubString maString;
Image maImage;
@@ -566,7 +572,7 @@ private:
Link maMBDownHdl;
Link maUserDrawHdl;
- BOOL mbUserDrawEnabled : 1,
+ sal_Bool mbUserDrawEnabled : 1,
mbInUserDraw : 1;
@@ -585,8 +591,8 @@ public:
virtual void LoseFocus();
virtual long PreNotify( NotifyEvent& rNEvt );
- USHORT GetItemPos() const { return mnItemPos; }
- void SetItemPos( USHORT n ) { mnItemPos = n; }
+ sal_uInt16 GetItemPos() const { return mnItemPos; }
+ void SetItemPos( sal_uInt16 n ) { mnItemPos = n; }
const XubString& GetString() const { return maString; }
void SetString( const XubString& rStr ) { maString = rStr; }
@@ -594,7 +600,7 @@ public:
const Image& GetImage() const { return maImage; }
void SetImage( const Image& rImg ) { maImage = rImg; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
@@ -608,10 +614,10 @@ public:
void SetUserItemSize( const Size& rSz ) { maUserItemSize = rSz; }
const Size& GetUserItemSize() const { return maUserItemSize; }
- void EnableUserDraw( BOOL bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
- BOOL IsUserDrawEnabled() const { return mbUserDrawEnabled; }
+ void EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
+ sal_Bool IsUserDrawEnabled() const { return mbUserDrawEnabled; }
- void DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE, bool bLayout = false );
+ void DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
};
// -----------
@@ -621,7 +627,7 @@ public:
class ImplBtn : public PushButton
{
private:
- BOOL mbDown;
+ sal_Bool mbDown;
Link maMBDownHdl;
@@ -637,7 +643,7 @@ public:
};
-void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground );
+void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
void ImplInitDropDownButton( PushButton* pButton );
#endif // _SV_ILSTBOX_HXX
diff --git a/vcl/inc/vcl/image.h b/vcl/inc/vcl/image.h
index fede1f42178a..86f924993ed3 100644
--- a/vcl/inc/vcl/image.h
+++ b/vcl/inc/vcl/image.h
@@ -44,22 +44,22 @@ public:
ImplImageBmp();
~ImplImageBmp();
- void Create( long nItemWidth, long nItemHeight, USHORT nInitSize );
- void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,USHORT nInitSize );
+ void Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize );
+ void Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight,sal_uInt16 nInitSize );
- void Expand( USHORT nGrowSize );
+ void Expand( sal_uInt16 nGrowSize );
- void Replace( USHORT nPos, USHORT nSrcPos );
- void Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT nSrcPos );
- void Replace( USHORT nPos, const BitmapEx& rBmpEx );
+ void Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos );
+ void Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos );
+ void Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx );
- void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount );
+ void ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uIntPtr nColorCount );
void ColorTransform();
void Invert();
- BitmapEx GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const;
+ BitmapEx GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const;
- void Draw( USHORT nPos, OutputDevice* pDev, const Point& rPos, USHORT nStyle, const Size* pSize = NULL );
+ void Draw( sal_uInt16 nPos, OutputDevice* pDev, const Point& rPos, sal_uInt16 nStyle, const Size* pSize = NULL );
private:
@@ -67,8 +67,8 @@ private:
BitmapEx maDisabledBmpEx;
BitmapEx* mpDisplayBmp;
Size maSize;
- BYTE* mpInfoAry;
- USHORT mnSize;
+ sal_uInt8* mpInfoAry;
+ sal_uInt16 mnSize;
void ImplUpdateDisplayBmp( OutputDevice* pOutDev );
void ImplUpdateDisabledBmpEx( int nPos );
@@ -92,12 +92,12 @@ struct ImageAryData
{
::rtl::OUString maName;
// Images identified by either name, or by id
- USHORT mnId;
+ sal_uInt16 mnId;
BitmapEx maBitmapEx;
ImageAryData();
ImageAryData( const rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmap );
+ sal_uInt16 nId, const BitmapEx &aBitmap );
ImageAryData( const ImageAryData& rData );
~ImageAryData();
@@ -119,16 +119,16 @@ struct ImplImageList
ImageAryDataNameHash maNameHash;
rtl::OUString maPrefix;
Size maImageSize;
- ULONG mnRefCount;
+ sal_uIntPtr mnRefCount;
ImplImageList();
ImplImageList( const ImplImageList &aSrc );
~ImplImageList();
void AddImage( const ::rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmapEx );
- void RemoveImage( USHORT nPos );
- USHORT GetImageCount() const;
+ sal_uInt16 nId, const BitmapEx &aBitmapEx );
+ void RemoveImage( sal_uInt16 nPos );
+ sal_uInt16 GetImageCount() const;
};
// --------------------
@@ -138,12 +138,12 @@ struct ImplImageList
struct ImplImageRefData
{
ImplImageList* mpImplData;
- USHORT mnIndex;
+ sal_uInt16 mnIndex;
ImplImageRefData() {} // Um Warning zu umgehen
~ImplImageRefData();
- BOOL IsEqual( const ImplImageRefData& rData );
+ sal_Bool IsEqual( const ImplImageRefData& rData );
};
// ----------------
@@ -158,7 +158,7 @@ struct ImplImageData
ImplImageData( const BitmapEx& rBmpEx );
~ImplImageData();
- BOOL IsEqual( const ImplImageData& rData );
+ sal_Bool IsEqual( const ImplImageData& rData );
};
// -------------
@@ -167,7 +167,7 @@ struct ImplImageData
struct ImplImage
{
- ULONG mnRefCount;
+ sal_uIntPtr mnRefCount;
// TODO: use inheritance to get rid of meType+mpData
void* mpData;
ImageType meType;
diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx
index c0c7cf63be51..d536d6bd03d7 100644
--- a/vcl/inc/vcl/image.hxx
+++ b/vcl/inc/vcl/image.hxx
@@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star { namespace graphic { class XGrap
// -----------
#define IMAGE_STDBTN_COLOR Color( 0xC0, 0xC0, 0xC0 )
-#define IMAGELIST_IMAGE_NOTFOUND ((USHORT)0xFFFF)
+#define IMAGELIST_IMAGE_NOTFOUND ((sal_uInt16)0xFFFF)
// -----------------------
// - ImageColorTransform -
@@ -87,14 +87,14 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const;
- static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount );
+ static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount );
void Invert();
- BOOL operator!() const { return( !mpImplData ? true : false ); }
+ sal_Bool operator!() const { return( !mpImplData ? true : false ); }
Image& operator=( const Image& rImage );
- BOOL operator==( const Image& rImage ) const;
- BOOL operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
+ sal_Bool operator==( const Image& rImage ) const;
+ sal_Bool operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
private:
@@ -110,7 +110,7 @@ private:
class VCL_DLLPUBLIC ImageList
{
public:
- ImageList( USHORT nInit = 8, USHORT nGrow = 4 );
+ ImageList( sal_uInt16 nInit = 8, sal_uInt16 nGrow = 4 );
ImageList( const ResId& rResId );
ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
const ::rtl::OUString& rPrefix,
@@ -122,57 +122,57 @@ public:
void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector );
void InsertFromHorizontalBitmap( const ResId& rResId,
- USHORT nCount,
+ sal_uInt16 nCount,
const Color *pNonAlphaMaskColor,
const Color *pSearchColors = NULL,
const Color *pReplaceColors = NULL,
- ULONG nColorCount = 0);
+ sal_uLong nColorCount = 0);
BitmapEx GetAsHorizontalStrip() const;
- USHORT GetImageCount() const;
+ sal_uInt16 GetImageCount() const;
Size GetImageSize() const;
- void AddImage( USHORT nNewId, const Image& rImage );
+ void AddImage( sal_uInt16 nNewId, const Image& rImage );
void AddImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( USHORT nId, const Image& rImage );
+ void ReplaceImage( sal_uInt16 nId, const Image& rImage );
void ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage );
- void ReplaceImage( USHORT nId, USHORT nReplaceId );
+ void ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId );
void ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName );
- void RemoveImage( USHORT nId );
+ void RemoveImage( sal_uInt16 nId );
void RemoveImage( const ::rtl::OUString& rImageName );
- Image GetImage( USHORT nId ) const;
+ Image GetImage( sal_uInt16 nId ) const;
Image GetImage( const ::rtl::OUString& rImageName ) const;
- USHORT GetImagePos( USHORT nId ) const;
- bool HasImageAtPos( USHORT nId ) const;
- USHORT GetImagePos( const ::rtl::OUString& rImageName ) const;
+ sal_uInt16 GetImagePos( sal_uInt16 nId ) const;
+ bool HasImageAtPos( sal_uInt16 nId ) const;
+ sal_uInt16 GetImagePos( const ::rtl::OUString& rImageName ) const;
- USHORT GetImageId( USHORT nPos ) const;
- void GetImageIds( ::std::vector< USHORT >& rIds ) const;
+ sal_uInt16 GetImageId( sal_uInt16 nPos ) const;
+ void GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const;
- ::rtl::OUString GetImageName( USHORT nPos ) const;
+ ::rtl::OUString GetImageName( sal_uInt16 nPos ) const;
void GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const;
ImageList& operator=( const ImageList& rImageList );
- BOOL operator==( const ImageList& rImageList ) const;
- BOOL operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
+ sal_Bool operator==( const ImageList& rImageList ) const;
+ sal_Bool operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); }
private:
ImplImageList* mpImplData;
- USHORT mnInitSize;
- USHORT mnGrowSize;
+ sal_uInt16 mnInitSize;
+ sal_uInt16 mnGrowSize;
SAL_DLLPRIVATE void ImplInitBitmapEx( const ::rtl::OUString& rUserImageName,
const ::std::vector< ::rtl::OUString >& rImageNames,
const ::rtl::OUString& rSymbolsStyle,
BitmapEx& rBmpEx,
const Color* pMaskColor ) const;
- SAL_DLLPRIVATE void ImplInit( USHORT nItems, const Size &rSize );
- SAL_DLLPRIVATE USHORT ImplGetImageId( const ::rtl::OUString& rImageName ) const;
+ SAL_DLLPRIVATE void ImplInit( sal_uInt16 nItems, const Size &rSize );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetImageId( const ::rtl::OUString& rImageName ) const;
SAL_DLLPRIVATE void ImplMakeUnique();
};
diff --git a/vcl/inc/vcl/imgctrl.hxx b/vcl/inc/vcl/imgctrl.hxx
index 5867a6ff16d0..ec8ed99c93bb 100644
--- a/vcl/inc/vcl/imgctrl.hxx
+++ b/vcl/inc/vcl/imgctrl.hxx
@@ -41,26 +41,26 @@
class VCL_DLLPUBLIC ImageControl : public FixedImage
{
private:
- BitmapEx maBmp;
::sal_Int16 mnScaleMode;
public:
ImageControl( Window* pParent, WinBits nStyle = 0 );
+ ImageControl( Window* pParent, const ResId& rResId );
// set/get the scale mode. This is one of the css.awt.ImageScaleMode constants
void SetScaleMode( const ::sal_Int16 _nMode );
::sal_Int16 GetScaleMode() const { return mnScaleMode; }
virtual void Resize();
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Paint( const Rectangle& rRect );
virtual void GetFocus();
virtual void LoseFocus();
- void SetBitmap( const BitmapEx& rBmp );
- using OutputDevice::GetBitmap;
- const BitmapEx& GetBitmap() const { return maBmp; }
- BOOL SetModeBitmap( const BitmapEx& rBitmap );
+protected:
+ void ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const;
+private:
+ sal_Bool SetModeBitmap( const BitmapEx& rBitmap );
const BitmapEx& GetModeBitmap( ) const;
};
diff --git a/vcl/inc/vcl/impbmp.hxx b/vcl/inc/vcl/impbmp.hxx
index 1292cce59ef5..c77e906bd8ae 100644
--- a/vcl/inc/vcl/impbmp.hxx
+++ b/vcl/inc/vcl/impbmp.hxx
@@ -50,8 +50,8 @@ class ImpBitmap
{
private:
- ULONG mnRefCount;
- ULONG mnChecksum;
+ sal_uLong mnRefCount;
+ sal_uLong mnChecksum;
SalBitmap* mpSalBitmap;
Size maSourceSize;
@@ -69,29 +69,29 @@ public:
public:
- BOOL ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
- BOOL ImplCreate( const ImpBitmap& rImpBitmap, USHORT nNewBitCount );
+ sal_Bool ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
+ sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
void ImplDestroy();
Size ImplGetSize() const;
Size ImplGetSourceSize() const;
void ImplSetSourceSize( const Size&);
- USHORT ImplGetBitCount() const;
+ sal_uInt16 ImplGetBitCount() const;
- BitmapBuffer* ImplAcquireBuffer( BOOL bReadOnly );
- void ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly );
+ BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly );
+ void ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
public:
- ULONG ImplGetRefCount() const { return mnRefCount; }
+ sal_uLong ImplGetRefCount() const { return mnRefCount; }
void ImplIncRefCount() { mnRefCount++; }
void ImplDecRefCount() { mnRefCount--; }
- inline void ImplSetChecksum( ULONG nChecksum ) { mnChecksum = nChecksum; }
- inline ULONG ImplGetChecksum() const { return mnChecksum; }
+ inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
+ inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
#endif // PRIVATE
};
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index cc2807d3e420..630297e1d2f8 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -82,7 +82,7 @@ private:
FontType meType; // used by metrics only
short mnOrientation;
FontKerning mnKerning;
- BOOL mbWordLine:1,
+ sal_Bool mbWordLine:1,
mbOutline:1,
mbConfigLookup:1, // there was a config lookup
mbShadow:1,
@@ -108,8 +108,8 @@ private:
long mnExtLeading; // External Leading
long mnLineHeight; // Ascent+Descent+EmphasisMark
long mnSlant; // Slant
- USHORT mnMiscFlags; // Misc Flags
- UINT32 mnRefCount; // Reference Counter
+ sal_uInt16 mnMiscFlags; // Misc Flags
+ sal_uInt32 mnRefCount; // Reference Counter
enum { DEVICE_FLAG=1, SCALABLE_FLAG=2, LATIN_FLAG=4, CJK_FLAG=8, CTL_FLAG=16 };
@@ -176,7 +176,7 @@ public:
class CmapResult;
-class VCL_DLLPUBLIC ImplFontCharMap
+class VCL_PLUGIN_PUBLIC ImplFontCharMap
{
public:
explicit ImplFontCharMap( const CmapResult& );
@@ -198,8 +198,8 @@ public:
int GetIndexFromChar( sal_uInt32 ) const;
sal_uInt32 GetCharFromIndex( int ) const;
- void AddReference();
- void DeReference();
+ void AddReference() const;
+ void DeReference() const;
int GetGlyphIndex( sal_uInt32 ) const;
@@ -213,27 +213,23 @@ private:
private:
const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1)
const int* mpStartGlyphs; // range-specific mapper to glyphs
- const USHORT* mpGlyphIds; // individual glyphid mappings
+ const sal_uInt16* mpGlyphIds; // individual glyphid mappings
int mnRangeCount;
- int mnCharCount;
- int mnRefCount;
+ int mnCharCount; // covered codepoints
+ mutable int mnRefCount;
};
// CmapResult is a normalized version of the many CMAP formats
-class
-#ifdef UNX
- VCL_DLLPUBLIC // vcl-plugins need it
-#endif // UNX
-CmapResult
+class VCL_PLUGIN_PUBLIC CmapResult
{
public:
explicit CmapResult( bool bSymbolic = false,
const sal_uInt32* pRangeCodes = NULL, int nRangeCount = 0,
- const int* pStartGlyphs = 0, const USHORT* pGlyphIds = NULL );
+ const int* pStartGlyphs = 0, const sal_uInt16* pGlyphIds = NULL );
const sal_uInt32* mpRangeCodes;
const int* mpStartGlyphs;
- const USHORT* mpGlyphIds;
+ const sal_uInt16* mpGlyphIds;
int mnRangeCount;
bool mbSymbolic;
bool mbRecoded;
diff --git a/vcl/inc/vcl/impgraph.hxx b/vcl/inc/vcl/impgraph.hxx
index dfb47a153f2d..22c409fb476a 100644
--- a/vcl/inc/vcl/impgraph.hxx
+++ b/vcl/inc/vcl/impgraph.hxx
@@ -70,11 +70,11 @@ private:
GfxLink* mpGfxLink;
GraphicType meType;
String maDocFileURLStr;
- ULONG mnDocFilePos;
- mutable ULONG mnSizeBytes;
- ULONG mnRefCount;
- BOOL mbSwapOut;
- BOOL mbSwapUnderway;
+ sal_uLong mnDocFilePos;
+ mutable sal_uLong mnSizeBytes;
+ sal_uLong mnRefCount;
+ sal_Bool mbSwapOut;
+ sal_Bool mbSwapUnderway;
private:
@@ -87,19 +87,19 @@ private:
virtual ~ImpGraphic();
ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
- BOOL operator==( const ImpGraphic& rImpGraphic ) const;
- BOOL operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
+ sal_Bool operator==( const ImpGraphic& rImpGraphic ) const;
+ sal_Bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
- void ImplClearGraphics( BOOL bCreateSwapInfo );
+ void ImplClearGraphics( sal_Bool bCreateSwapInfo );
void ImplClear();
GraphicType ImplGetType() const;
void ImplSetDefaultType();
- BOOL ImplIsSupportedGraphic() const;
+ sal_Bool ImplIsSupportedGraphic() const;
- BOOL ImplIsTransparent() const;
- BOOL ImplIsAlpha() const;
- BOOL ImplIsAnimated() const;
+ sal_Bool ImplIsTransparent() const;
+ sal_Bool ImplIsAlpha() const;
+ sal_Bool ImplIsAnimated() const;
Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
@@ -112,7 +112,7 @@ private:
MapMode ImplGetPrefMapMode() const;
void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
- ULONG ImplGetSizeBytes() const;
+ sal_uLong ImplGetSizeBytes() const;
void ImplDraw( OutputDevice* pOutDev,
const Point& rDestPt ) const;
@@ -135,7 +135,7 @@ private:
void ImplSetAnimationNotifyHdl( const Link& rLink );
Link ImplGetAnimationNotifyHdl() const;
- ULONG ImplGetAnimationLoopCount() const;
+ sal_uLong ImplGetAnimationLoopCount() const;
void ImplResetAnimationLoopCount();
List* ImplGetAnimationInfoList() const;
@@ -147,28 +147,28 @@ private:
private:
- void ImplSetDocFileName( const String& rName, ULONG nFilePos );
+ void ImplSetDocFileName( const String& rName, sal_uLong nFilePos );
const String& ImplGetDocFileName() const;
- ULONG ImplGetDocFilePos() const;
+ sal_uLong ImplGetDocFilePos() const;
- BOOL ImplReadEmbedded( SvStream& rIStream, BOOL bSwap = FALSE );
- BOOL ImplWriteEmbedded( SvStream& rOStream );
+ sal_Bool ImplReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
+ sal_Bool ImplWriteEmbedded( SvStream& rOStream );
- BOOL ImplSwapIn();
- BOOL ImplSwapIn( SvStream* pIStm );
+ sal_Bool ImplSwapIn();
+ sal_Bool ImplSwapIn( SvStream* pIStm );
- BOOL ImplSwapOut();
- BOOL ImplSwapOut( SvStream* pOStm );
+ sal_Bool ImplSwapOut();
+ sal_Bool ImplSwapOut( SvStream* pOStm );
- BOOL ImplIsSwapOut() const;
+ sal_Bool ImplIsSwapOut() const;
void ImplSetLink( const GfxLink& );
GfxLink ImplGetLink();
- BOOL ImplIsLink() const;
+ sal_Bool ImplIsLink() const;
- ULONG ImplGetChecksum() const;
+ sal_uLong ImplGetChecksum() const;
- BOOL ImplExportNative( SvStream& rOStm ) const;
+ sal_Bool ImplExportNative( SvStream& rOStm ) const;
friend SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic );
friend SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic );
diff --git a/vcl/inc/vcl/impoct.hxx b/vcl/inc/vcl/impoct.hxx
index 1679b4802c63..daf6a275ada1 100644
--- a/vcl/inc/vcl/impoct.hxx
+++ b/vcl/inc/vcl/impoct.hxx
@@ -121,9 +121,9 @@ inline void ImpErrorQuad::ImplAddColorError7( const ImpErrorQuad& rErrQuad )
inline BitmapColor ImpErrorQuad::ImplGetColor()
{
- return BitmapColor( (BYTE) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5L ),
- (BYTE) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5L ),
- (BYTE) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5L ) );
+ return BitmapColor( (sal_uInt8) ( ( nRed < 0L ? 0L : nRed > 8160L ? 8160L : nRed ) >> 5L ),
+ (sal_uInt8) ( ( nGreen < 0L ? 0L : nGreen > 8160L ? 8160L : nGreen ) >> 5L ),
+ (sal_uInt8) ( ( nBlue < 0L ? 0L : nBlue > 8160L ? 8160L : nBlue ) >> 5L ) );
}
// -------------
@@ -133,14 +133,14 @@ inline BitmapColor ImpErrorQuad::ImplGetColor()
class ImpNodeCache
{
OctreeNode* pActNode;
- ULONG nNew;
- ULONG nDelete;
- ULONG nGet;
- ULONG nRelease;
+ sal_uLong nNew;
+ sal_uLong nDelete;
+ sal_uLong nGet;
+ sal_uLong nRelease;
public:
- ImpNodeCache( const ULONG nInitSize );
+ ImpNodeCache( const sal_uLong nInitSize );
~ImpNodeCache();
inline OctreeNode* ImplGetFreeNode();
diff --git a/vcl/inc/vcl/inputctx.hxx b/vcl/inc/vcl/inputctx.hxx
index 26a43530c8d0..eaaec5e7bd1d 100644
--- a/vcl/inc/vcl/inputctx.hxx
+++ b/vcl/inc/vcl/inputctx.hxx
@@ -37,10 +37,10 @@
// - InputContext-Flags -
// ----------------------
-#define INPUTCONTEXT_TEXT ((ULONG)0x00000001)
-#define INPUTCONTEXT_EXTTEXTINPUT ((ULONG)0x00000002)
-#define INPUTCONTEXT_EXTTEXTINPUT_ON ((ULONG)0x00000004)
-#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((ULONG)0x00000008)
+#define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
+#define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
+#define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
+#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
// ----------------
// - InputContext -
@@ -50,26 +50,26 @@ class VCL_DLLPUBLIC InputContext
{
private:
Font maFont;
- ULONG mnOptions;
+ sal_uLong mnOptions;
public:
InputContext() { mnOptions = 0; }
InputContext( const InputContext& rInputContext ) :
maFont( rInputContext.maFont )
{ mnOptions = rInputContext.mnOptions; }
- InputContext( const Font& rFont, ULONG nOptions = 0 ) :
+ InputContext( const Font& rFont, sal_uLong nOptions = 0 ) :
maFont( rFont )
{ mnOptions = nOptions; }
void SetFont( const Font& rFont ) { maFont = rFont; }
const Font& GetFont() const { return maFont; }
- void SetOptions( ULONG nOptions ) { mnOptions = nOptions; }
- ULONG GetOptions() const { return mnOptions; }
+ void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; }
+ sal_uLong GetOptions() const { return mnOptions; }
InputContext& operator=( const InputContext& rInputContext );
- BOOL operator==( const InputContext& rInputContext ) const;
- BOOL operator!=( const InputContext& rInputContext ) const
+ sal_Bool operator==( const InputContext& rInputContext ) const;
+ sal_Bool operator!=( const InputContext& rInputContext ) const
{ return !(InputContext::operator==( rInputContext )); }
};
@@ -80,7 +80,7 @@ inline InputContext& InputContext::operator=( const InputContext& rInputContext
return *this;
}
-inline BOOL InputContext::operator==( const InputContext& rInputContext ) const
+inline sal_Bool InputContext::operator==( const InputContext& rInputContext ) const
{
return ((mnOptions == rInputContext.mnOptions) &&
(maFont == rInputContext.maFont));
diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx
index 5765adfd26f1..a7b39d0bff8f 100644
--- a/vcl/inc/vcl/javachild.hxx
+++ b/vcl/inc/vcl/javachild.hxx
@@ -48,8 +48,6 @@ public:
private:
- SAL_DLLPRIVATE void implTestJavaException( void* pEnv );
-
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE JavaChildWindow (const JavaChildWindow &);
SAL_DLLPRIVATE JavaChildWindow & operator= (const JavaChildWindow &);
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index b51282d57b1e..7517b41ef03c 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -51,6 +51,7 @@ struct JobData
int m_nColorDepth;
int m_nPSLevel; // 0: no override, else languaglevel to use
int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
+ int m_nPDFDevice; // 0: PostScript, 1: PDF
orientation::type m_eOrientation;
::rtl::OUString m_aPrinterName;
const PPDParser* m_pParser;
@@ -65,6 +66,7 @@ struct JobData
m_nColorDepth( 24 ),
m_nPSLevel( 0 ),
m_nColorDevice( 0 ),
+ m_nPDFDevice( 0 ),
m_eOrientation( orientation::Portrait ),
m_pParser( NULL ) {}
@@ -73,6 +75,8 @@ struct JobData
JobData( const JobData& rData ) { *this = rData; }
void setCollate( bool bCollate );
+ bool setPaper( int nWidth, int nHeight ); // dimensions in pt
+ bool setPaperBin( int nPaperBin ); // dimensions in pt
// creates a new buffer using new
// it is up to the user to delete it again
diff --git a/vcl/inc/vcl/jobset.h b/vcl/inc/vcl/jobset.h
index 9b26c20dcd94..b1cbdb9853f9 100644
--- a/vcl/inc/vcl/jobset.h
+++ b/vcl/inc/vcl/jobset.h
@@ -53,18 +53,18 @@
struct ImplJobSetup
{
- USHORT mnRefCount; // RefCount (only independ data)
- USHORT mnSystem; // Sytem - JOBSETUP_SYSTEM_xxxx
+ sal_uInt16 mnRefCount; // RefCount (only independ data)
+ sal_uInt16 mnSystem; // Sytem - JOBSETUP_SYSTEM_xxxx
String maPrinterName; // Printer-Name
String maDriver; // Driver-Name
Orientation meOrientation; // Orientation
DuplexMode meDuplexMode; // Duplex
- USHORT mnPaperBin; // paper bin / in tray
+ sal_uInt16 mnPaperBin; // paper bin / in tray
Paper mePaperFormat; // paper format
long mnPaperWidth; // paper width (100th mm)
long mnPaperHeight; // paper height (100th mm)
- ULONG mnDriverDataLen; // length of system specific data
- BYTE* mpDriverData; // system specific data (will be streamed a byte block)
+ sal_uIntPtr mnDriverDataLen; // length of system specific data
+ sal_uInt8* mpDriverData; // system specific data (will be streamed a byte block)
::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > maValueMap;
ImplJobSetup();
diff --git a/vcl/inc/vcl/jobset.hxx b/vcl/inc/vcl/jobset.hxx
index a5a3735c3da5..0340f5dd8587 100644
--- a/vcl/inc/vcl/jobset.hxx
+++ b/vcl/inc/vcl/jobset.hxx
@@ -71,8 +71,8 @@ public:
JobSetup& operator=( const JobSetup& rJob );
- BOOL operator==( const JobSetup& rJobSetup ) const;
- BOOL operator!=( const JobSetup& rJobSetup ) const
+ sal_Bool operator==( const JobSetup& rJobSetup ) const;
+ sal_Bool operator!=( const JobSetup& rJobSetup ) const
{ return !(JobSetup::operator==( rJobSetup )); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup );
diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx
index 8092f2a6d964..b5be547b1781 100644
--- a/vcl/inc/vcl/keycod.hxx
+++ b/vcl/inc/vcl/keycod.hxx
@@ -63,54 +63,54 @@ enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN,
class VCL_DLLPUBLIC KeyCode
{
private:
- USHORT nCode;
+ sal_uInt16 nCode;
KeyFuncType eFunc;
public:
KeyCode() { nCode = 0; eFunc = KEYFUNC_DONTKNOW; }
KeyCode( const ResId& rResId );
- KeyCode( USHORT nKey, USHORT nModifier = 0 )
+ KeyCode( sal_uInt16 nKey, sal_uInt16 nModifier = 0 )
{ nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
- KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 );
+ KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 );
KeyCode( KeyFuncType eFunction );
- USHORT GetFullCode() const { return nCode; }
- USHORT GetFullKeyCode() const { return (nCode) ; }
+ sal_uInt16 GetFullCode() const { return nCode; }
+ sal_uInt16 GetFullKeyCode() const { return (nCode) ; }
KeyFuncType GetFullFunction() const { return eFunc; }
- BOOL IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
+ sal_Bool IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const;
- USHORT GetCode() const
+ sal_uInt16 GetCode() const
{ return (nCode & KEY_CODE); }
- USHORT GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (nCode & KEY_MODTYPE); }
- USHORT GetAllModifier() const
+ sal_uInt16 GetAllModifier() const
{ return (nCode & KEY_ALLMODTYPE); }
- BOOL IsShift() const
+ sal_Bool IsShift() const
{ return ((nCode & KEY_SHIFT) != 0); }
- BOOL IsMod1() const
+ sal_Bool IsMod1() const
{ return ((nCode & KEY_MOD1) != 0); }
- BOOL IsMod2() const
+ sal_Bool IsMod2() const
{ return ((nCode & KEY_MOD2) != 0); }
- BOOL IsMod3() const
+ sal_Bool IsMod3() const
{ return ((nCode & KEY_MOD3) != 0); }
- USHORT GetGroup() const
+ sal_uInt16 GetGroup() const
{ return (nCode & KEYGROUP_TYPE); }
XubString GetName( Window* pWindow = NULL ) const;
XubString GetSymbolName( const XubString& rFontName, Window* pWindow = NULL ) const;
- BOOL IsFunction() const
- { return ((eFunc != KEYFUNC_DONTKNOW) ? TRUE : FALSE); }
+ sal_Bool IsFunction() const
+ { return ((eFunc != KEYFUNC_DONTKNOW) ? sal_True : sal_False); }
KeyFuncType GetFunction() const;
KeyCode& operator = ( const KeyCode& rKeyCode );
- BOOL operator ==( const KeyCode& rKeyCode ) const;
- BOOL operator !=( const KeyCode& rKeyCode ) const;
+ sal_Bool operator ==( const KeyCode& rKeyCode ) const;
+ sal_Bool operator !=( const KeyCode& rKeyCode ) const;
};
-inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 )
+inline KeyCode::KeyCode( sal_uInt16 nKey, sal_Bool bShift, sal_Bool bMod1, sal_Bool bMod2, sal_Bool bMod3 )
{
nCode = nKey;
if( bShift )
@@ -124,7 +124,7 @@ inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL
eFunc = KEYFUNC_DONTKNOW;
}
-inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::operator ==( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode == rKeyCode.nCode);
@@ -132,7 +132,7 @@ inline BOOL KeyCode::operator ==( const KeyCode& rKeyCode ) const
return (GetFunction() == rKeyCode.GetFunction());
}
-inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::operator !=( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (nCode != rKeyCode.nCode);
@@ -140,7 +140,7 @@ inline BOOL KeyCode::operator !=( const KeyCode& rKeyCode ) const
return (GetFunction() != rKeyCode.GetFunction());
}
-inline BOOL KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
+inline sal_Bool KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
return (GetFullKeyCode() == rKeyCode.GetFullKeyCode());
diff --git a/vcl/inc/vcl/keycodes.hxx b/vcl/inc/vcl/keycodes.hxx
index ace5df3343b4..9b4fc0893b34 100644
--- a/vcl/inc/vcl/keycodes.hxx
+++ b/vcl/inc/vcl/keycodes.hxx
@@ -40,139 +40,139 @@
// By changes you must also change: rsc/vclrsc.hxx
// Key-Gruppen
-#define KEYGROUP_NUM ((USHORT)::com::sun::star::awt::KeyGroup::NUM)
-#define KEYGROUP_ALPHA ((USHORT)::com::sun::star::awt::KeyGroup::ALPHA)
-#define KEYGROUP_FKEYS ((USHORT)::com::sun::star::awt::KeyGroup::FKEYS)
-#define KEYGROUP_CURSOR ((USHORT)::com::sun::star::awt::KeyGroup::CURSOR)
-#define KEYGROUP_MISC ((USHORT)::com::sun::star::awt::KeyGroup::MISC)
-#define KEYGROUP_TYPE ((USHORT)::com::sun::star::awt::KeyGroup::TYPE)
+#define KEYGROUP_NUM ((sal_uInt16)::com::sun::star::awt::KeyGroup::NUM)
+#define KEYGROUP_ALPHA ((sal_uInt16)::com::sun::star::awt::KeyGroup::ALPHA)
+#define KEYGROUP_FKEYS ((sal_uInt16)::com::sun::star::awt::KeyGroup::FKEYS)
+#define KEYGROUP_CURSOR ((sal_uInt16)::com::sun::star::awt::KeyGroup::CURSOR)
+#define KEYGROUP_MISC ((sal_uInt16)::com::sun::star::awt::KeyGroup::MISC)
+#define KEYGROUP_TYPE ((sal_uInt16)::com::sun::star::awt::KeyGroup::TYPE)
// Key-Codes
-#define KEY_0 ((USHORT)::com::sun::star::awt::Key::NUM0)
-#define KEY_1 ((USHORT)::com::sun::star::awt::Key::NUM1)
-#define KEY_2 ((USHORT)::com::sun::star::awt::Key::NUM2)
-#define KEY_3 ((USHORT)::com::sun::star::awt::Key::NUM3)
-#define KEY_4 ((USHORT)::com::sun::star::awt::Key::NUM4)
-#define KEY_5 ((USHORT)::com::sun::star::awt::Key::NUM5)
-#define KEY_6 ((USHORT)::com::sun::star::awt::Key::NUM6)
-#define KEY_7 ((USHORT)::com::sun::star::awt::Key::NUM7)
-#define KEY_8 ((USHORT)::com::sun::star::awt::Key::NUM8)
-#define KEY_9 ((USHORT)::com::sun::star::awt::Key::NUM9)
-
-#define KEY_A ((USHORT)::com::sun::star::awt::Key::A)
-#define KEY_B ((USHORT)::com::sun::star::awt::Key::B)
-#define KEY_C ((USHORT)::com::sun::star::awt::Key::C)
-#define KEY_D ((USHORT)::com::sun::star::awt::Key::D)
-#define KEY_E ((USHORT)::com::sun::star::awt::Key::E)
-#define KEY_F ((USHORT)::com::sun::star::awt::Key::F)
-#define KEY_G ((USHORT)::com::sun::star::awt::Key::G)
-#define KEY_H ((USHORT)::com::sun::star::awt::Key::H)
-#define KEY_I ((USHORT)::com::sun::star::awt::Key::I)
-#define KEY_J ((USHORT)::com::sun::star::awt::Key::J)
-#define KEY_K ((USHORT)::com::sun::star::awt::Key::K)
-#define KEY_L ((USHORT)::com::sun::star::awt::Key::L)
-#define KEY_M ((USHORT)::com::sun::star::awt::Key::M)
-#define KEY_N ((USHORT)::com::sun::star::awt::Key::N)
-#define KEY_O ((USHORT)::com::sun::star::awt::Key::O)
-#define KEY_P ((USHORT)::com::sun::star::awt::Key::P)
-#define KEY_Q ((USHORT)::com::sun::star::awt::Key::Q)
-#define KEY_R ((USHORT)::com::sun::star::awt::Key::R)
-#define KEY_S ((USHORT)::com::sun::star::awt::Key::S)
-#define KEY_T ((USHORT)::com::sun::star::awt::Key::T)
-#define KEY_U ((USHORT)::com::sun::star::awt::Key::U)
-#define KEY_V ((USHORT)::com::sun::star::awt::Key::V)
-#define KEY_W ((USHORT)::com::sun::star::awt::Key::W)
-#define KEY_X ((USHORT)::com::sun::star::awt::Key::X)
-#define KEY_Y ((USHORT)::com::sun::star::awt::Key::Y)
-#define KEY_Z ((USHORT)::com::sun::star::awt::Key::Z)
-
-#define KEY_F1 ((USHORT)::com::sun::star::awt::Key::F1)
-#define KEY_F2 ((USHORT)::com::sun::star::awt::Key::F2)
-#define KEY_F3 ((USHORT)::com::sun::star::awt::Key::F3)
-#define KEY_F4 ((USHORT)::com::sun::star::awt::Key::F4)
-#define KEY_F5 ((USHORT)::com::sun::star::awt::Key::F5)
-#define KEY_F6 ((USHORT)::com::sun::star::awt::Key::F6)
-#define KEY_F7 ((USHORT)::com::sun::star::awt::Key::F7)
-#define KEY_F8 ((USHORT)::com::sun::star::awt::Key::F8)
-#define KEY_F9 ((USHORT)::com::sun::star::awt::Key::F9)
-#define KEY_F10 ((USHORT)::com::sun::star::awt::Key::F10)
-#define KEY_F11 ((USHORT)::com::sun::star::awt::Key::F11)
-#define KEY_F12 ((USHORT)::com::sun::star::awt::Key::F12)
-#define KEY_F13 ((USHORT)::com::sun::star::awt::Key::F13)
-#define KEY_F14 ((USHORT)::com::sun::star::awt::Key::F14)
-#define KEY_F15 ((USHORT)::com::sun::star::awt::Key::F15)
-#define KEY_F16 ((USHORT)::com::sun::star::awt::Key::F16)
-#define KEY_F17 ((USHORT)::com::sun::star::awt::Key::F17)
-#define KEY_F18 ((USHORT)::com::sun::star::awt::Key::F18)
-#define KEY_F19 ((USHORT)::com::sun::star::awt::Key::F19)
-#define KEY_F20 ((USHORT)::com::sun::star::awt::Key::F20)
-#define KEY_F21 ((USHORT)::com::sun::star::awt::Key::F21)
-#define KEY_F22 ((USHORT)::com::sun::star::awt::Key::F22)
-#define KEY_F23 ((USHORT)::com::sun::star::awt::Key::F23)
-#define KEY_F24 ((USHORT)::com::sun::star::awt::Key::F24)
-#define KEY_F25 ((USHORT)::com::sun::star::awt::Key::F25)
-#define KEY_F26 ((USHORT)::com::sun::star::awt::Key::F26)
-
-#define KEY_DOWN ((USHORT)::com::sun::star::awt::Key::DOWN)
-#define KEY_UP ((USHORT)::com::sun::star::awt::Key::UP)
-#define KEY_LEFT ((USHORT)::com::sun::star::awt::Key::LEFT)
-#define KEY_RIGHT ((USHORT)::com::sun::star::awt::Key::RIGHT)
-#define KEY_HOME ((USHORT)::com::sun::star::awt::Key::HOME)
-#define KEY_END ((USHORT)::com::sun::star::awt::Key::END)
-#define KEY_PAGEUP ((USHORT)::com::sun::star::awt::Key::PAGEUP)
-#define KEY_PAGEDOWN ((USHORT)::com::sun::star::awt::Key::PAGEDOWN)
-
-#define KEY_RETURN ((USHORT)::com::sun::star::awt::Key::RETURN)
-#define KEY_ESCAPE ((USHORT)::com::sun::star::awt::Key::ESCAPE)
-#define KEY_TAB ((USHORT)::com::sun::star::awt::Key::TAB)
-#define KEY_BACKSPACE ((USHORT)::com::sun::star::awt::Key::BACKSPACE)
-#define KEY_SPACE ((USHORT)::com::sun::star::awt::Key::SPACE)
-#define KEY_INSERT ((USHORT)::com::sun::star::awt::Key::INSERT)
-#define KEY_DELETE ((USHORT)::com::sun::star::awt::Key::DELETE)
-
-#define KEY_ADD ((USHORT)::com::sun::star::awt::Key::ADD)
-#define KEY_SUBTRACT ((USHORT)::com::sun::star::awt::Key::SUBTRACT)
-#define KEY_MULTIPLY ((USHORT)::com::sun::star::awt::Key::MULTIPLY)
-#define KEY_DIVIDE ((USHORT)::com::sun::star::awt::Key::DIVIDE)
-#define KEY_POINT ((USHORT)::com::sun::star::awt::Key::POINT)
-#define KEY_COMMA ((USHORT)::com::sun::star::awt::Key::COMMA)
-#define KEY_LESS ((USHORT)::com::sun::star::awt::Key::LESS)
-#define KEY_GREATER ((USHORT)::com::sun::star::awt::Key::GREATER)
-#define KEY_EQUAL ((USHORT)::com::sun::star::awt::Key::EQUAL)
-
-#define KEY_OPEN ((USHORT)::com::sun::star::awt::Key::OPEN)
-#define KEY_CUT ((USHORT)::com::sun::star::awt::Key::CUT)
-#define KEY_COPY ((USHORT)::com::sun::star::awt::Key::COPY)
-#define KEY_PASTE ((USHORT)::com::sun::star::awt::Key::PASTE)
-#define KEY_UNDO ((USHORT)::com::sun::star::awt::Key::UNDO)
-#define KEY_REPEAT ((USHORT)::com::sun::star::awt::Key::REPEAT)
-#define KEY_FIND ((USHORT)::com::sun::star::awt::Key::FIND)
-#define KEY_PROPERTIES ((USHORT)::com::sun::star::awt::Key::PROPERTIES)
-#define KEY_FRONT ((USHORT)::com::sun::star::awt::Key::FRONT)
-#define KEY_CONTEXTMENU ((USHORT)::com::sun::star::awt::Key::CONTEXTMENU)
-#define KEY_MENU ((USHORT)::com::sun::star::awt::Key::MENU)
-#define KEY_HELP ((USHORT)::com::sun::star::awt::Key::HELP)
-#define KEY_HANGUL_HANJA ((USHORT)::com::sun::star::awt::Key::HANGUL_HANJA)
-#define KEY_DECIMAL ((USHORT)::com::sun::star::awt::Key::DECIMAL)
-#define KEY_TILDE ((USHORT)::com::sun::star::awt::Key::TILDE)
-#define KEY_QUOTELEFT ((USHORT)::com::sun::star::awt::Key::QUOTELEFT)
-#define KEY_BRACKETLEFT ((USHORT)::com::sun::star::awt::Key::BRACKETLEFT)
-#define KEY_BRACKETRIGHT ((USHORT)::com::sun::star::awt::Key::BRACKETRIGHT)
-#define KEY_SEMICOLON ((USHORT)::com::sun::star::awt::Key::SEMICOLON)
-
-#define KEY_CAPSLOCK ((USHORT)::com::sun::star::awt::Key::CAPSLOCK)
-#define KEY_NUMLOCK ((USHORT)::com::sun::star::awt::Key::NUMLOCK)
-#define KEY_SCROLLLOCK ((USHORT)::com::sun::star::awt::Key::SCROLLLOCK)
-
-#define KEY_CODE ((USHORT)0x0FFF)
+#define KEY_0 ((sal_uInt16)::com::sun::star::awt::Key::NUM0)
+#define KEY_1 ((sal_uInt16)::com::sun::star::awt::Key::NUM1)
+#define KEY_2 ((sal_uInt16)::com::sun::star::awt::Key::NUM2)
+#define KEY_3 ((sal_uInt16)::com::sun::star::awt::Key::NUM3)
+#define KEY_4 ((sal_uInt16)::com::sun::star::awt::Key::NUM4)
+#define KEY_5 ((sal_uInt16)::com::sun::star::awt::Key::NUM5)
+#define KEY_6 ((sal_uInt16)::com::sun::star::awt::Key::NUM6)
+#define KEY_7 ((sal_uInt16)::com::sun::star::awt::Key::NUM7)
+#define KEY_8 ((sal_uInt16)::com::sun::star::awt::Key::NUM8)
+#define KEY_9 ((sal_uInt16)::com::sun::star::awt::Key::NUM9)
+
+#define KEY_A ((sal_uInt16)::com::sun::star::awt::Key::A)
+#define KEY_B ((sal_uInt16)::com::sun::star::awt::Key::B)
+#define KEY_C ((sal_uInt16)::com::sun::star::awt::Key::C)
+#define KEY_D ((sal_uInt16)::com::sun::star::awt::Key::D)
+#define KEY_E ((sal_uInt16)::com::sun::star::awt::Key::E)
+#define KEY_F ((sal_uInt16)::com::sun::star::awt::Key::F)
+#define KEY_G ((sal_uInt16)::com::sun::star::awt::Key::G)
+#define KEY_H ((sal_uInt16)::com::sun::star::awt::Key::H)
+#define KEY_I ((sal_uInt16)::com::sun::star::awt::Key::I)
+#define KEY_J ((sal_uInt16)::com::sun::star::awt::Key::J)
+#define KEY_K ((sal_uInt16)::com::sun::star::awt::Key::K)
+#define KEY_L ((sal_uInt16)::com::sun::star::awt::Key::L)
+#define KEY_M ((sal_uInt16)::com::sun::star::awt::Key::M)
+#define KEY_N ((sal_uInt16)::com::sun::star::awt::Key::N)
+#define KEY_O ((sal_uInt16)::com::sun::star::awt::Key::O)
+#define KEY_P ((sal_uInt16)::com::sun::star::awt::Key::P)
+#define KEY_Q ((sal_uInt16)::com::sun::star::awt::Key::Q)
+#define KEY_R ((sal_uInt16)::com::sun::star::awt::Key::R)
+#define KEY_S ((sal_uInt16)::com::sun::star::awt::Key::S)
+#define KEY_T ((sal_uInt16)::com::sun::star::awt::Key::T)
+#define KEY_U ((sal_uInt16)::com::sun::star::awt::Key::U)
+#define KEY_V ((sal_uInt16)::com::sun::star::awt::Key::V)
+#define KEY_W ((sal_uInt16)::com::sun::star::awt::Key::W)
+#define KEY_X ((sal_uInt16)::com::sun::star::awt::Key::X)
+#define KEY_Y ((sal_uInt16)::com::sun::star::awt::Key::Y)
+#define KEY_Z ((sal_uInt16)::com::sun::star::awt::Key::Z)
+
+#define KEY_F1 ((sal_uInt16)::com::sun::star::awt::Key::F1)
+#define KEY_F2 ((sal_uInt16)::com::sun::star::awt::Key::F2)
+#define KEY_F3 ((sal_uInt16)::com::sun::star::awt::Key::F3)
+#define KEY_F4 ((sal_uInt16)::com::sun::star::awt::Key::F4)
+#define KEY_F5 ((sal_uInt16)::com::sun::star::awt::Key::F5)
+#define KEY_F6 ((sal_uInt16)::com::sun::star::awt::Key::F6)
+#define KEY_F7 ((sal_uInt16)::com::sun::star::awt::Key::F7)
+#define KEY_F8 ((sal_uInt16)::com::sun::star::awt::Key::F8)
+#define KEY_F9 ((sal_uInt16)::com::sun::star::awt::Key::F9)
+#define KEY_F10 ((sal_uInt16)::com::sun::star::awt::Key::F10)
+#define KEY_F11 ((sal_uInt16)::com::sun::star::awt::Key::F11)
+#define KEY_F12 ((sal_uInt16)::com::sun::star::awt::Key::F12)
+#define KEY_F13 ((sal_uInt16)::com::sun::star::awt::Key::F13)
+#define KEY_F14 ((sal_uInt16)::com::sun::star::awt::Key::F14)
+#define KEY_F15 ((sal_uInt16)::com::sun::star::awt::Key::F15)
+#define KEY_F16 ((sal_uInt16)::com::sun::star::awt::Key::F16)
+#define KEY_F17 ((sal_uInt16)::com::sun::star::awt::Key::F17)
+#define KEY_F18 ((sal_uInt16)::com::sun::star::awt::Key::F18)
+#define KEY_F19 ((sal_uInt16)::com::sun::star::awt::Key::F19)
+#define KEY_F20 ((sal_uInt16)::com::sun::star::awt::Key::F20)
+#define KEY_F21 ((sal_uInt16)::com::sun::star::awt::Key::F21)
+#define KEY_F22 ((sal_uInt16)::com::sun::star::awt::Key::F22)
+#define KEY_F23 ((sal_uInt16)::com::sun::star::awt::Key::F23)
+#define KEY_F24 ((sal_uInt16)::com::sun::star::awt::Key::F24)
+#define KEY_F25 ((sal_uInt16)::com::sun::star::awt::Key::F25)
+#define KEY_F26 ((sal_uInt16)::com::sun::star::awt::Key::F26)
+
+#define KEY_DOWN ((sal_uInt16)::com::sun::star::awt::Key::DOWN)
+#define KEY_UP ((sal_uInt16)::com::sun::star::awt::Key::UP)
+#define KEY_LEFT ((sal_uInt16)::com::sun::star::awt::Key::LEFT)
+#define KEY_RIGHT ((sal_uInt16)::com::sun::star::awt::Key::RIGHT)
+#define KEY_HOME ((sal_uInt16)::com::sun::star::awt::Key::HOME)
+#define KEY_END ((sal_uInt16)::com::sun::star::awt::Key::END)
+#define KEY_PAGEUP ((sal_uInt16)::com::sun::star::awt::Key::PAGEUP)
+#define KEY_PAGEDOWN ((sal_uInt16)::com::sun::star::awt::Key::PAGEDOWN)
+
+#define KEY_RETURN ((sal_uInt16)::com::sun::star::awt::Key::RETURN)
+#define KEY_ESCAPE ((sal_uInt16)::com::sun::star::awt::Key::ESCAPE)
+#define KEY_TAB ((sal_uInt16)::com::sun::star::awt::Key::TAB)
+#define KEY_BACKSPACE ((sal_uInt16)::com::sun::star::awt::Key::BACKSPACE)
+#define KEY_SPACE ((sal_uInt16)::com::sun::star::awt::Key::SPACE)
+#define KEY_INSERT ((sal_uInt16)::com::sun::star::awt::Key::INSERT)
+#define KEY_DELETE ((sal_uInt16)::com::sun::star::awt::Key::DELETE)
+
+#define KEY_ADD ((sal_uInt16)::com::sun::star::awt::Key::ADD)
+#define KEY_SUBTRACT ((sal_uInt16)::com::sun::star::awt::Key::SUBTRACT)
+#define KEY_MULTIPLY ((sal_uInt16)::com::sun::star::awt::Key::MULTIPLY)
+#define KEY_DIVIDE ((sal_uInt16)::com::sun::star::awt::Key::DIVIDE)
+#define KEY_POINT ((sal_uInt16)::com::sun::star::awt::Key::POINT)
+#define KEY_COMMA ((sal_uInt16)::com::sun::star::awt::Key::COMMA)
+#define KEY_LESS ((sal_uInt16)::com::sun::star::awt::Key::LESS)
+#define KEY_GREATER ((sal_uInt16)::com::sun::star::awt::Key::GREATER)
+#define KEY_EQUAL ((sal_uInt16)::com::sun::star::awt::Key::EQUAL)
+
+#define KEY_OPEN ((sal_uInt16)::com::sun::star::awt::Key::OPEN)
+#define KEY_CUT ((sal_uInt16)::com::sun::star::awt::Key::CUT)
+#define KEY_COPY ((sal_uInt16)::com::sun::star::awt::Key::COPY)
+#define KEY_PASTE ((sal_uInt16)::com::sun::star::awt::Key::PASTE)
+#define KEY_UNDO ((sal_uInt16)::com::sun::star::awt::Key::UNDO)
+#define KEY_REPEAT ((sal_uInt16)::com::sun::star::awt::Key::REPEAT)
+#define KEY_FIND ((sal_uInt16)::com::sun::star::awt::Key::FIND)
+#define KEY_PROPERTIES ((sal_uInt16)::com::sun::star::awt::Key::PROPERTIES)
+#define KEY_FRONT ((sal_uInt16)::com::sun::star::awt::Key::FRONT)
+#define KEY_CONTEXTMENU ((sal_uInt16)::com::sun::star::awt::Key::CONTEXTMENU)
+#define KEY_MENU ((sal_uInt16)::com::sun::star::awt::Key::MENU)
+#define KEY_HELP ((sal_uInt16)::com::sun::star::awt::Key::HELP)
+#define KEY_HANGUL_HANJA ((sal_uInt16)::com::sun::star::awt::Key::HANGUL_HANJA)
+#define KEY_DECIMAL ((sal_uInt16)::com::sun::star::awt::Key::DECIMAL)
+#define KEY_TILDE ((sal_uInt16)::com::sun::star::awt::Key::TILDE)
+#define KEY_QUOTELEFT ((sal_uInt16)::com::sun::star::awt::Key::QUOTELEFT)
+#define KEY_BRACKETLEFT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETLEFT)
+#define KEY_BRACKETRIGHT ((sal_uInt16)::com::sun::star::awt::Key::BRACKETRIGHT)
+#define KEY_SEMICOLON ((sal_uInt16)::com::sun::star::awt::Key::SEMICOLON)
+
+#define KEY_CAPSLOCK ((sal_uInt16)::com::sun::star::awt::Key::CAPSLOCK)
+#define KEY_NUMLOCK ((sal_uInt16)::com::sun::star::awt::Key::NUMLOCK)
+#define KEY_SCROLLLOCK ((sal_uInt16)::com::sun::star::awt::Key::SCROLLLOCK)
+
+#define KEY_CODE ((sal_uInt16)0x0FFF)
// Modifier-Tasten
-#define KEY_SHIFT ((USHORT)0x1000)
-#define KEY_MOD1 ((USHORT)0x2000)
-#define KEY_MOD2 ((USHORT)0x4000)
-#define KEY_MOD3 ((USHORT)0x8000)
-#define KEY_MODTYPE ((USHORT)0xF000)
-#define KEY_ALLMODTYPE ((USHORT)0xF000)
+#define KEY_SHIFT ((sal_uInt16)0x1000)
+#define KEY_MOD1 ((sal_uInt16)0x2000)
+#define KEY_MOD2 ((sal_uInt16)0x4000)
+#define KEY_MOD3 ((sal_uInt16)0x8000)
+#define KEY_MODTYPE ((sal_uInt16)0xF000)
+#define KEY_ALLMODTYPE ((sal_uInt16)0xF000)
// extended Modifier-Keys (only used for modkey events)
#define MODKEY_LSHIFT 0x0001
@@ -192,9 +192,9 @@
// - Mouse-Types -
// ---------------
-#define MOUSE_LEFT ((USHORT)0x0001)
-#define MOUSE_MIDDLE ((USHORT)0x0002)
-#define MOUSE_RIGHT ((USHORT)0x0004)
+#define MOUSE_LEFT ((sal_uInt16)0x0001)
+#define MOUSE_MIDDLE ((sal_uInt16)0x0002)
+#define MOUSE_RIGHT ((sal_uInt16)0x0004)
// -------------------
// - Indicator-Types -
diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx
index 0a1e2a30f5f5..e7edee035e4d 100644
--- a/vcl/inc/vcl/lazydelete.hxx
+++ b/vcl/inc/vcl/lazydelete.hxx
@@ -40,6 +40,8 @@
#include <stdio.h>
#endif
+#include <com/sun/star/lang/XComponent.hpp>
+
namespace vcl
{
/* Helpers for lazy object deletion
@@ -257,6 +259,43 @@ namespace vcl
// ownership is transfered !
T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; }
};
+
+ /** Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit
+ template class makes sure that a static UNO object is disposed
+ and released at the right time.
+
+ Use like
+ static DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory>
+ xStaticFactory (<create factory object>);
+ Reference<lang::XMultiServiceFactory> xFactory (xStaticFactory.get());
+ if (xFactory.is())
+ <do something with xFactory>
+ */
+ template <typename I>
+ class DeleteUnoReferenceOnDeinit : public ::vcl::DeleteOnDeinitBase
+ {
+ ::com::sun::star::uno::Reference<I> m_xI;
+ virtual void doCleanup() { set(NULL); }
+ public:
+ DeleteUnoReferenceOnDeinit(const ::com::sun::star::uno::Reference<I>& r_xI ) : m_xI( r_xI ) {
+ addDeinitContainer( this ); }
+ virtual ~DeleteUnoReferenceOnDeinit() {}
+
+ ::com::sun::star::uno::Reference<I> get (void) { return m_xI; }
+
+ void set (const ::com::sun::star::uno::Reference<I>& r_xNew )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> xComponent (m_xI, ::com::sun::star::uno::UNO_QUERY);
+ m_xI = r_xNew;
+ if (xComponent.is()) try
+ {
+ xComponent->dispose();
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ }
+ }
+ };
}
#endif
diff --git a/vcl/inc/vcl/lineinfo.hxx b/vcl/inc/vcl/lineinfo.hxx
index be17988dd71d..046257cbdd9f 100644
--- a/vcl/inc/vcl/lineinfo.hxx
+++ b/vcl/inc/vcl/lineinfo.hxx
@@ -43,12 +43,12 @@ namespace basegfx { class B2DPolyPolygon; }
struct ImplLineInfo
{
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
LineStyle meStyle;
long mnWidth;
- USHORT mnDashCount;
+ sal_uInt16 mnDashCount;
long mnDashLen;
- USHORT mnDotCount;
+ sal_uInt16 mnDotCount;
long mnDotLen;
long mnDistance;
@@ -57,6 +57,8 @@ struct ImplLineInfo
ImplLineInfo();
ImplLineInfo( const ImplLineInfo& rImplLineInfo );
+ bool operator==( const ImplLineInfo& ) const;
+
friend SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo );
friend SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo );
};
@@ -83,9 +85,9 @@ public:
~LineInfo();
LineInfo& operator=( const LineInfo& rLineInfo );
- BOOL operator==( const LineInfo& rLineInfo ) const;
- BOOL operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
- BOOL IsSameInstance( const LineInfo& rLineInfo ) const { return( mpImplLineInfo == rLineInfo.mpImplLineInfo ); }
+ sal_Bool operator==( const LineInfo& rLineInfo ) const;
+ sal_Bool operator!=( const LineInfo& rLineInfo ) const { return !(LineInfo::operator==( rLineInfo ) ); }
+ sal_Bool IsSameInstance( const LineInfo& rLineInfo ) const { return( mpImplLineInfo == rLineInfo.mpImplLineInfo ); }
void SetStyle( LineStyle eStyle );
LineStyle GetStyle() const { return mpImplLineInfo->meStyle; }
@@ -93,14 +95,14 @@ public:
void SetWidth( long nWidth );
long GetWidth() const { return mpImplLineInfo->mnWidth; }
- void SetDashCount( USHORT nDashCount );
- USHORT GetDashCount() const { return mpImplLineInfo->mnDashCount; }
+ void SetDashCount( sal_uInt16 nDashCount );
+ sal_uInt16 GetDashCount() const { return mpImplLineInfo->mnDashCount; }
void SetDashLen( long nDashLen );
long GetDashLen() const { return mpImplLineInfo->mnDashLen; }
- void SetDotCount( USHORT nDotCount );
- USHORT GetDotCount() const { return mpImplLineInfo->mnDotCount; }
+ void SetDotCount( sal_uInt16 nDotCount );
+ sal_uInt16 GetDotCount() const { return mpImplLineInfo->mnDotCount; }
void SetDotLen( long nDotLen );
long GetDotLen() const { return mpImplLineInfo->mnDotLen; }
@@ -111,7 +113,7 @@ public:
void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
- BOOL IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
+ sal_Bool IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo );
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo );
diff --git a/vcl/inc/vcl/longcurr.hxx b/vcl/inc/vcl/longcurr.hxx
index fdbb36f7af6c..ca4ebcadc77e 100644
--- a/vcl/inc/vcl/longcurr.hxx
+++ b/vcl/inc/vcl/longcurr.hxx
@@ -42,7 +42,7 @@ class LocaleDataWrapper;
class VCL_DLLPUBLIC LongCurrencyFormatter : public FormatterBase
{
private:
- SAL_DLLPRIVATE friend BOOL ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, USHORT, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
+ SAL_DLLPRIVATE friend sal_Bool ImplLongCurrencyReformat( const XubString&, BigInt, BigInt, sal_uInt16, const LocaleDataWrapper&, XubString&, LongCurrencyFormatter& );
SAL_DLLPRIVATE void ImpInit();
protected:
@@ -52,9 +52,9 @@ protected:
BigInt mnMax;
BigInt mnCorrectedValue;
String maCurrencySymbol;
- USHORT mnType;
- USHORT mnDecimalDigits;
- BOOL mbThousandSep;
+ sal_uInt16 mnType;
+ sal_uInt16 mnDecimalDigits;
+ sal_Bool mbThousandSep;
LongCurrencyFormatter();
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
@@ -65,8 +65,8 @@ public:
virtual void Reformat();
virtual void ReformatAll();
- void SetUseThousandSep( BOOL b );
- BOOL IsUseThousandSep() const { return mbThousandSep; }
+ void SetUseThousandSep( sal_Bool b );
+ sal_Bool IsUseThousandSep() const { return mbThousandSep; }
void SetCurrencySymbol( const String& rStr );
String GetCurrencySymbol() const;
@@ -76,15 +76,15 @@ public:
void SetMax( BigInt nNewMax );
BigInt GetMax() const { return mnMax; }
- void SetDecimalDigits( USHORT nDigits );
- USHORT GetDecimalDigits() const;
+ void SetDecimalDigits( sal_uInt16 nDigits );
+ sal_uInt16 GetDecimalDigits() const;
void SetValue( BigInt nNewValue );
void SetUserValue( BigInt nNewValue );
BigInt GetValue() const;
- BOOL IsValueModified() const;
+ sal_Bool IsValueModified() const;
void SetEmptyValue();
- BOOL IsEmptyValue() const { return !GetField()->GetText().Len(); }
+ sal_Bool IsEmptyValue() const { return !GetField()->GetText().Len(); }
BigInt GetCorrectedValue() const { return mnCorrectedValue; }
@@ -148,12 +148,12 @@ public:
void ReformatAll();
void InsertValue( BigInt nValue,
- USHORT nPos = COMBOBOX_APPEND );
+ sal_uInt16 nPos = COMBOBOX_APPEND );
void RemoveValue( BigInt nValue );
BigInt GetValue() const
{ return LongCurrencyFormatter::GetValue(); }
- BigInt GetValue( USHORT nPos ) const;
- USHORT GetValuePos( BigInt nValue ) const;
+ BigInt GetValue( sal_uInt16 nPos ) const;
+ sal_uInt16 GetValuePos( BigInt nValue ) const;
};
#endif // _LONGCURR_HXX
diff --git a/vcl/inc/vcl/lstbox.h b/vcl/inc/vcl/lstbox.h
index 454156f83627..f4577dc1e718 100644
--- a/vcl/inc/vcl/lstbox.h
+++ b/vcl/inc/vcl/lstbox.h
@@ -29,11 +29,11 @@
#ifndef _SV_LSTBOX_H
#define _SV_LSTBOX_H
-#define LISTBOX_APPEND ((USHORT)0xFFFF)
-#define LISTBOX_ENTRY_NOTFOUND ((USHORT)0xFFFF)
-#define LISTBOX_ERROR ((USHORT)0xFFFF)
+#define LISTBOX_APPEND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
+#define LISTBOX_ERROR ((sal_uInt16)0xFFFF)
-#define LISTBOX_USERDRAW_SELECTED ((USHORT)0x0001)
+#define LISTBOX_USERDRAW_SELECTED ((sal_uInt16)0x0001)
// --------------------------------------------------------------------
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index 5d74ce5c7a99..cc1d0615cb7b 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -50,12 +50,12 @@ private:
ImplListBoxFloatingWindow* mpFloatWin;
ImplWin* mpImplWin;
ImplBtn* mpBtn;
- USHORT mnDDHeight;
- USHORT mnSaveValue;
- BOOL mbDDAutoSize;
+ sal_uInt16 mnDDHeight;
+ sal_uInt16 mnSaveValue;
+ sal_Bool mbDDAutoSize;
Link maSelectHdl;
Link maDoubleClickHdl;
- USHORT mnLineCount;
+ sal_uInt16 mnLineCount;
private:
SAL_DLLPRIVATE void ImplInitListBoxData();
@@ -74,7 +74,7 @@ protected:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- BOOL IsDropDownBox() const { return mpFloatWin ? TRUE : FALSE; }
+ sal_Bool IsDropDownBox() const { return mpFloatWin ? sal_True : sal_False; }
protected:
ListBox( WindowType nType );
@@ -86,7 +86,7 @@ public:
ListBox( Window* pParent, const ResId& rResId );
~ListBox();
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
virtual void StateChanged( StateChangedType nType );
@@ -102,7 +102,7 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
virtual void SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags = WINDOW_POSSIZE_ALL );
+ long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
{ Control::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
@@ -110,42 +110,42 @@ public:
Rectangle GetDropDownPosSizePixel() const;
- void SetDropDownLineCount( USHORT nLines );
- USHORT GetDropDownLineCount() const;
+ void SetDropDownLineCount( sal_uInt16 nLines );
+ sal_uInt16 GetDropDownLineCount() const;
- void EnableAutoSize( BOOL bAuto );
- BOOL IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ void EnableAutoSize( sal_Bool bAuto );
+ sal_Bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
- void EnableDDAutoWidth( BOOL b );
- BOOL IsDDAutoWidthEnabled() const;
+ void EnableDDAutoWidth( sal_Bool b );
+ sal_Bool IsDDAutoWidthEnabled() const;
- virtual USHORT InsertEntry( const XubString& rStr, USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( const Image& rImage, USHORT nPos = LISTBOX_APPEND );
- virtual USHORT InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
+ virtual sal_uInt16 InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = LISTBOX_APPEND );
virtual void RemoveEntry( const XubString& rStr );
- virtual void RemoveEntry( USHORT nPos );
+ virtual void RemoveEntry( sal_uInt16 nPos );
virtual void Clear();
- virtual USHORT GetEntryPos( const XubString& rStr ) const;
- virtual USHORT GetEntryPos( const void* pData ) const;
- Image GetEntryImage( USHORT nPos ) const;
- virtual XubString GetEntry( USHORT nPos ) const;
- virtual USHORT GetEntryCount() const;
+ virtual sal_uInt16 GetEntryPos( const XubString& rStr ) const;
+ virtual sal_uInt16 GetEntryPos( const void* pData ) const;
+ Image GetEntryImage( sal_uInt16 nPos ) const;
+ virtual XubString GetEntry( sal_uInt16 nPos ) const;
+ virtual sal_uInt16 GetEntryCount() const;
- virtual void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE );
- virtual void SelectEntryPos( USHORT nPos, BOOL bSelect = TRUE );
+ virtual void SelectEntry( const XubString& rStr, sal_Bool bSelect = sal_True );
+ virtual void SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect = sal_True );
- virtual USHORT GetSelectEntryCount() const;
- virtual XubString GetSelectEntry( USHORT nSelIndex = 0 ) const;
- virtual USHORT GetSelectEntryPos( USHORT nSelIndex = 0 ) const;
+ virtual sal_uInt16 GetSelectEntryCount() const;
+ virtual XubString GetSelectEntry( sal_uInt16 nSelIndex = 0 ) const;
+ virtual sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const;
- virtual BOOL IsEntrySelected( const XubString& rStr ) const;
- virtual BOOL IsEntryPosSelected( USHORT nPos ) const;
+ virtual sal_Bool IsEntrySelected( const XubString& rStr ) const;
+ virtual sal_Bool IsEntryPosSelected( sal_uInt16 nPos ) const;
virtual void SetNoSelection();
- void SetEntryData( USHORT nPos, void* pNewData );
- void* GetEntryData( USHORT nPos ) const;
+ void SetEntryData( sal_uInt16 nPos, void* pNewData );
+ void* GetEntryData( sal_uInt16 nPos ) const;
/** this methods stores a combination of flags from the
LISTBOX_ENTRY_FLAG_* defines at the given entry.
@@ -155,51 +155,51 @@ public:
to change the internal behaviour of the ListBox implementation
for specific entries.
*/
- void SetEntryFlags( USHORT nPos, long nFlags );
+ void SetEntryFlags( sal_uInt16 nPos, long nFlags );
/** this methods gets the current combination of flags from the
LISTBOX_ENTRY_FLAG_* defines from the given entry.
See description of the possible LISTBOX_ENTRY_FLAG_* flags
for details.
*/
- long GetEntryFlags( USHORT nPos ) const;
+ long GetEntryFlags( sal_uInt16 nPos ) const;
- void SetTopEntry( USHORT nPos );
- void ShowProminentEntry( USHORT nPos );
+ void SetTopEntry( sal_uInt16 nPos );
+ void ShowProminentEntry( sal_uInt16 nPos );
void SetTopEntryStr( const XubString& rStr );
- USHORT GetTopEntry() const;
+ sal_uInt16 GetTopEntry() const;
void SetProminentEntryType( ProminentEntry eType );
ProminentEntry GetProminentEntryType() const;
void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
- USHORT GetSavedValue() const { return mnSaveValue; }
+ sal_uInt16 GetSavedValue() const { return mnSaveValue; }
- void SetSeparatorPos( USHORT n );
+ void SetSeparatorPos( sal_uInt16 n );
void SetSeparatorPos();
- USHORT GetSeparatorPos() const;
+ sal_uInt16 GetSeparatorPos() const;
- BOOL IsTravelSelect() const;
- BOOL IsInDropDown() const;
+ sal_Bool IsTravelSelect() const;
+ sal_Bool IsInDropDown() const;
void ToggleDropDown();
- void EnableMultiSelection( BOOL bMulti, BOOL bStackSelection );
- void EnableMultiSelection( BOOL bMulti );
- BOOL IsMultiSelectionEnabled() const;
+ void EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection );
+ void EnableMultiSelection( sal_Bool bMulti );
+ sal_Bool IsMultiSelectionEnabled() const;
- void SetReadOnly( BOOL bReadOnly = TRUE );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bReadOnly = sal_True );
+ sal_Bool IsReadOnly() const;
- long CalcWindowSizePixel( USHORT nLines ) const;
- Rectangle GetBoundingRectangle( USHORT nItem ) const;
+ long CalcWindowSizePixel( sal_uInt16 nLines ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const;
void SetUserItemSize( const Size& rSz );
const Size& GetUserItemSize() const;
- void EnableUserDraw( BOOL bUserDraw );
- BOOL IsUserDrawEnabled() const;
+ void EnableUserDraw( sal_Bool bUserDraw );
+ sal_Bool IsUserDrawEnabled() const;
- void DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos = FALSE );
+ void DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False );
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
const Link& GetSelectHdl() const { return maSelectHdl; }
@@ -209,15 +209,15 @@ public:
Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
Size CalcAdjustedSize( const Size& rPrefSize ) const;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
void SetMRUEntries( const XubString& rEntries, xub_Unicode cSep = ';' );
XubString GetMRUEntries( xub_Unicode cSep = ';' ) const;
- void SetMaxMRUCount( USHORT n );
- USHORT GetMaxMRUCount() const;
+ void SetMaxMRUCount( sal_uInt16 n );
+ sal_uInt16 GetMaxMRUCount() const;
- USHORT GetDisplayLineCount() const;
+ sal_uInt16 GetDisplayLineCount() const;
void EnableMirroring();
@@ -240,7 +240,7 @@ public:
if no item is at that point.
*/
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const;
};
// ----------------
@@ -255,7 +255,7 @@ public:
private:
// Bei MultiListBox nicht erlaubt...
void SaveValue();
- USHORT GetSavedValue();
+ sal_uInt16 GetSavedValue();
public:
MultiListBox( Window* pParent, WinBits nStyle = 0 );
diff --git a/vcl/inc/vcl/mapmod.hxx b/vcl/inc/vcl/mapmod.hxx
index 53cea6801cb2..bf666bc782cb 100644
--- a/vcl/inc/vcl/mapmod.hxx
+++ b/vcl/inc/vcl/mapmod.hxx
@@ -34,7 +34,7 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
#include <tools/resid.hxx>
-#include <vcl/mapunit.hxx>
+#include <tools/mapunit.hxx>
class SvStream;
@@ -50,12 +50,12 @@ class ImplMapMode
friend class OutputDevice;
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
MapUnit meUnit;
Point maOrigin;
Fraction maScaleX;
Fraction maScaleY;
- BOOL mbSimple;
+ sal_Bool mbSimple;
friend SvStream& operator>>( SvStream& rIStm, ImplMapMode& rMapMode );
friend SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rMapMode );
@@ -103,11 +103,11 @@ public:
{ return mpImplMapMode->maScaleY; }
MapMode& operator=( const MapMode& rMapMode );
- BOOL operator==( const MapMode& rMapMode ) const;
- BOOL operator!=( const MapMode& rMapMode ) const
+ sal_Bool operator==( const MapMode& rMapMode ) const;
+ sal_Bool operator!=( const MapMode& rMapMode ) const
{ return !(MapMode::operator==( rMapMode )); }
- BOOL IsDefault() const;
- BOOL IsSameInstance( const MapMode& rMapMode ) const
+ sal_Bool IsDefault() const;
+ sal_Bool IsSameInstance( const MapMode& rMapMode ) const
{ return (mpImplMapMode == rMapMode.mpImplMapMode); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, MapMode& rMapMode );
diff --git a/vcl/inc/vcl/mapunit.hxx b/vcl/inc/vcl/mapunit.hxx
deleted file mode 100644
index f8fb7581c469..000000000000
--- a/vcl/inc/vcl/mapunit.hxx
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _VCL_MAPUNIT_HXX
-#define _VCL_MAPUNIT_HXX
-
-#include <tools/mapunit.hxx>
-
-#endif // _VCL_MAPUNIT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 751f4ac16ca5..2712cefbb5d8 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -68,22 +68,22 @@ namespace vcl { struct MenuLayoutData; }
// - Menu-Types -
// --------------
-#define MENU_APPEND ((USHORT)0xFFFF)
-#define MENU_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define MENU_APPEND ((sal_uInt16)0xFFFF)
+#define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
-#define POPUPMENU_EXECUTE_DOWN ((USHORT)0x0001)
-#define POPUPMENU_EXECUTE_UP ((USHORT)0x0002)
-#define POPUPMENU_EXECUTE_LEFT ((USHORT)0x0004)
-#define POPUPMENU_EXECUTE_RIGHT ((USHORT)0x0008)
+#define POPUPMENU_EXECUTE_DOWN ((sal_uInt16)0x0001)
+#define POPUPMENU_EXECUTE_UP ((sal_uInt16)0x0002)
+#define POPUPMENU_EXECUTE_LEFT ((sal_uInt16)0x0004)
+#define POPUPMENU_EXECUTE_RIGHT ((sal_uInt16)0x0008)
-#define POPUPMENU_NOMOUSEUPCLOSE ((USHORT)0x0010)
+#define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010)
// By changes you must also change: rsc/vclrsc.hxx
enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE,
MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR };
// By changes you must also change: rsc/vclrsc.hxx
-typedef USHORT MenuItemBits;
+typedef sal_uInt16 MenuItemBits;
#define MIB_CHECKABLE ((MenuItemBits)0x0001)
#define MIB_RADIOCHECK ((MenuItemBits)0x0002)
#define MIB_AUTOCHECK ((MenuItemBits)0x0004)
@@ -151,18 +151,18 @@ private:
XubString aTitleText; // PopupMenu-Text
- ULONG nEventId;
- USHORT mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
- USHORT nMenuFlags;
- USHORT nDefaultItem; // Id vom Default-Item
- USHORT nSelectedId;
+ sal_uLong nEventId;
+ sal_uInt16 mnHighlightedItemPos; // for native menues: keeps track of the highlighted item
+ sal_uInt16 nMenuFlags;
+ sal_uInt16 nDefaultItem; // Id vom Default-Item
+ sal_uInt16 nSelectedId;
// Fuer Ausgabe:
- USHORT nCheckPos;
- USHORT nImagePos;
- USHORT nTextPos;
+ sal_uInt16 nCheckPos;
+ sal_uInt16 nImagePos;
+ sal_uInt16 nTextPos;
- BOOL bIsMenuBar : 1, // Handelt es sich um den MenuBar
+ sal_Bool bIsMenuBar : 1, // Handelt es sich um den MenuBar
bCanceled : 1, // Waehrend eines Callbacks abgebrochen
bInCallback : 1, // In Activate/Deactivate
bKilled : 1; // Gekillt...
@@ -176,24 +176,24 @@ protected:
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE Menu* ImplGetStartMenu();
SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
- SAL_DLLPRIVATE Menu* ImplFindMenu( USHORT nId );
+ SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
SAL_DLLPRIVATE Size ImplCalcSize( Window* pWin );
- SAL_DLLPRIVATE BOOL ImplIsVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE BOOL ImplIsSelectable( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetVisibleItemCount() const;
- SAL_DLLPRIVATE USHORT ImplGetFirstVisible() const;
- SAL_DLLPRIVATE USHORT ImplGetPrevVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetNextVisible( USHORT nPos ) const;
- SAL_DLLPRIVATE void ImplPaint( Window* pWin, USHORT nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, BOOL bHighlighted = FALSE, bool bLayout = false ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSelectable( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE void ImplPaint( Window* pWin, sal_uInt16 nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, sal_Bool bHighlighted = sal_False, bool bLayout = false ) const;
SAL_DLLPRIVATE void ImplSelect();
- SAL_DLLPRIVATE void ImplCallHighlight( USHORT nHighlightItem );
- SAL_DLLPRIVATE void ImplCallEventListeners( ULONG nEvent, USHORT nPos );
+ SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
+ SAL_DLLPRIVATE void ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
DECL_DLLPRIVATE_LINK( ImplCallSelect, Menu* );
SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
// returns native check and option menu symbol height;
// return value is Max( rCheckHeight, rRadioHeight )
@@ -206,7 +206,7 @@ public:
SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const;
Menu();
- Menu( BOOL bMenuBar );
+ Menu( sal_Bool bMenuBar );
SAL_DLLPRIVATE Window* ImplGetWindow() const { return pWindow; }
@@ -220,93 +220,93 @@ public:
virtual void Select();
virtual void RequestHelp( const HelpEvent& rHEvt );
- void InsertItem( USHORT nItemId, const XubString& rStr,
+ void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( USHORT nItemId,
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( sal_uInt16 nItemId,
const XubString& rString, const Image& rImage,
MenuItemBits nItemBits = 0,
- USHORT nPos = MENU_APPEND );
- void InsertItem( const ResId& rResId, USHORT nPos = MENU_APPEND );
- void InsertSeparator( USHORT nPos = MENU_APPEND );
- void RemoveItem( USHORT nPos );
- void CopyItem( const Menu& rMenu, USHORT nPos,
- USHORT nNewPos = MENU_APPEND );
+ sal_uInt16 nPos = MENU_APPEND );
+ void InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
+ void InsertSeparator( sal_uInt16 nPos = MENU_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void CopyItem( const Menu& rMenu, sal_uInt16 nPos,
+ sal_uInt16 nNewPos = MENU_APPEND );
void Clear();
void CreateAutoMnemonics();
- void SetMenuFlags( USHORT nFlags ) { nMenuFlags = nFlags; }
- USHORT GetMenuFlags() const { return nMenuFlags; }
+ void SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
+ sal_uInt16 GetMenuFlags() const { return nMenuFlags; }
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- MenuItemType GetItemType( USHORT nPos ) const;
- USHORT GetCurItemId() const;
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ MenuItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetCurItemId() const;
- void SetDefaultItem( USHORT nItemId ) { nDefaultItem = nItemId; }
- USHORT GetDefaultItem() const { return nDefaultItem; }
+ void SetDefaultItem( sal_uInt16 nItemId ) { nDefaultItem = nItemId; }
+ sal_uInt16 GetDefaultItem() const { return nDefaultItem; }
- void SetItemBits( USHORT nItemId, MenuItemBits nBits );
- MenuItemBits GetItemBits( USHORT nItemId ) const;
+ void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
+ MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
- void SetUserValue( USHORT nItemId, ULONG nValue );
- ULONG GetUserValue( USHORT nItemId ) const;
+ void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
+ sal_uLong GetUserValue( sal_uInt16 nItemId ) const;
- void SetPopupMenu( USHORT nItemId, PopupMenu* pMenu );
- PopupMenu* GetPopupMenu( USHORT nItemId ) const;
+ void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
+ PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
- void SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode );
- KeyCode GetAccelKey( USHORT nItemId ) const;
+ void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
+ KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
- void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
- BOOL IsItemChecked( USHORT nItemId ) const;
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
- void SelectItem( USHORT nItemId );
+ void SelectItem( sal_uInt16 nItemId );
void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
- void ShowItem( USHORT nItemId, BOOL bVisible = TRUE );
- void HideItem( USHORT nItemId ) { ShowItem( nItemId, FALSE ); }
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
- BOOL IsItemVisible( USHORT nItemId ) const;
- BOOL IsItemPosVisible( USHORT nItemPos ) const;
- BOOL IsMenuVisible() const;
- BOOL IsMenuBar() const { return bIsMenuBar; }
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
+ sal_Bool IsMenuVisible() const;
+ sal_Bool IsMenuBar() const { return bIsMenuBar; }
- void RemoveDisabledEntries( BOOL bCheckPopups = TRUE, BOOL bRemoveEmptyPopups = FALSE );
- BOOL HasValidEntries( BOOL bCheckPopups = TRUE );
+ void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
+ sal_Bool HasValidEntries( sal_Bool bCheckPopups = sal_True );
- void SetItemText( USHORT nItemId, const XubString& rStr );
- XubString GetItemText( USHORT nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetItemText( sal_uInt16 nItemId ) const;
- void SetItemImage( USHORT nItemId, const Image& rImage );
- Image GetItemImage( USHORT nItemId ) const;
- void SetItemImageAngle( USHORT nItemId, long nAngle10 );
- long GetItemImageAngle( USHORT nItemId ) const;
- void SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror );
- BOOL GetItemImageMirrorMode( USHORT ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ long GetItemImageAngle( sal_uInt16 nItemId ) const;
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId ) const;
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
- void SetHelpText( USHORT nItemId, const XubString& rString );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
- void SetTipHelpText( USHORT nItemId, const XubString& rString );
- const XubString& GetTipHelpText( USHORT nItemId ) const;
+ void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetTipHelpText( sal_uInt16 nItemId ) const;
- void SetHelpCommand( USHORT nItemId, const XubString& rString );
- const XubString& GetHelpCommand( USHORT nItemId ) const;
+ void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
+ const XubString& GetHelpCommand( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
const Link& GetActivateHdl() const { return aActivateHdl; }
@@ -322,7 +322,7 @@ public:
void SetLogo( const MenuLogo& rLogo );
void SetLogo();
- BOOL HasLogo() const { return pLogo ? TRUE : FALSE; }
+ sal_Bool HasLogo() const { return pLogo ? sal_True : sal_False; }
MenuLogo GetLogo() const;
void AddEventListener( const Link& rEventListener );
@@ -337,7 +337,7 @@ public:
// returns the system's menu handle if native menues are supported
// pData must point to a SystemMenuData structure
- BOOL GetSystemMenuData( SystemMenuData* pData ) const;
+ sal_Bool GetSystemMenuData( SystemMenuData* pData ) const;
// accessibility helpers
@@ -346,41 +346,41 @@ public:
// returns the bounding box for the character at index nIndex
// where nIndex is relative to the starting index of the item
// with id nItemId (in coordinates of the displaying window)
- Rectangle GetCharacterBounds( USHORT nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
// -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0)
- long GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
// returns the number of lines in the result of GetDisplayText()
long GetLineCount() const;
// returns the interval [start,end] of line nLine
// returns [-1,-1] for an invalid line
Pair GetLineStartEnd( long nLine ) const;
// like GetLineStartEnd but first finds the line number for the item
- Pair GetItemStartEnd( USHORT nItemId ) const;
+ Pair GetItemStartEnd( sal_uInt16 nItemId ) const;
// returns the item id for line nLine or 0 if nLine is invalid
- USHORT GetDisplayItemId( long nLine ) const;
+ sal_uInt16 GetDisplayItemId( long nLine ) const;
// returns the bounding rectangle for an item at pos nItemPos
- Rectangle GetBoundingRectangle( USHORT nItemPos ) const;
- BOOL ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
+ Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
+ sal_Bool ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
// gets the activation key of the specified item
- KeyEvent GetActivationKey( USHORT nItemId ) const;
+ KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
Window* GetWindow() const { return pWindow; }
- void SetAccessibleName( USHORT nItemId, const XubString& rStr );
- XubString GetAccessibleName( USHORT nItemId ) const;
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetAccessibleName( sal_uInt16 nItemId ) const;
- void SetAccessibleDescription( USHORT nItemId, const XubString& rStr );
- XubString GetAccessibleDescription( USHORT nItemId ) const;
+ void SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr );
+ XubString GetAccessibleDescription( sal_uInt16 nItemId ) const;
// returns whether the item a position nItemPos is highlighted or not.
- bool IsHighlighted( USHORT nItemPos ) const;
+ bool IsHighlighted( sal_uInt16 nItemPos ) const;
- void HighlightItem( USHORT nItemPos );
+ void HighlightItem( sal_uInt16 nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
@@ -396,10 +396,10 @@ class VCL_DLLPUBLIC MenuBar : public Menu
Link maCloserHdl;
Link maFloatHdl;
Link maHideHdl;
- BOOL mbCloserVisible;
- BOOL mbFloatBtnVisible;
- BOOL mbHideBtnVisible;
- BOOL mbDisplayable;
+ sal_Bool mbCloserVisible;
+ sal_Bool mbFloatBtnVisible;
+ sal_Bool mbHideBtnVisible;
+ sal_Bool mbDisplayable;
friend class Application;
friend class Menu;
@@ -408,8 +408,8 @@ class VCL_DLLPUBLIC MenuBar : public Menu
friend class SystemWindow;
SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
- SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, BOOL bDelete );
- SAL_DLLPRIVATE BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE );
+ SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, sal_Bool bDelete );
+ SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
public:
MenuBar();
@@ -419,20 +419,20 @@ public:
MenuBar& operator =( const MenuBar& rMenu );
- void ShowCloser( BOOL bShow = TRUE );
- BOOL HasCloser() const { return mbCloserVisible; }
- void ShowFloatButton( BOOL bShow = TRUE );
- BOOL HasFloatButton() const { return mbFloatBtnVisible; }
- void ShowHideButton( BOOL bShow = TRUE );
- BOOL HasHideButton() const { return mbHideBtnVisible; }
- void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
-
- void SelectEntry( USHORT nId );
- BOOL HandleMenuActivateEvent( Menu *pMenu ) const;
- BOOL HandleMenuDeActivateEvent( Menu *pMenu ) const;
- BOOL HandleMenuHighlightEvent( Menu *pMenu, USHORT nEventId ) const;
- BOOL HandleMenuCommandEvent( Menu *pMenu, USHORT nEventId ) const;
- BOOL HandleMenuButtonEvent( Menu *pMenu, USHORT nEventId ) const;
+ void ShowCloser( sal_Bool bShow = sal_True );
+ sal_Bool HasCloser() const { return mbCloserVisible; }
+ void ShowFloatButton( sal_Bool bShow = sal_True );
+ sal_Bool HasFloatButton() const { return mbFloatBtnVisible; }
+ void ShowHideButton( sal_Bool bShow = sal_True );
+ sal_Bool HasHideButton() const { return mbHideBtnVisible; }
+ void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
+
+ void SelectEntry( sal_uInt16 nId );
+ sal_Bool HandleMenuActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuDeActivateEvent( Menu *pMenu ) const;
+ sal_Bool HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
+ sal_Bool HandleMenuButtonEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
void SetCloserHdl( const Link& rLink ) { maCloserHdl = rLink; }
const Link& GetCloserHdl() const { return maCloserHdl; }
@@ -445,31 +445,31 @@ public:
// - if a menubar is not displayable, its MenuBarWindow will never be shown
// and it will be hidden if it was visible before
// - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
- void SetDisplayable( BOOL bDisplayable );
- BOOL IsDisplayable() const { return mbDisplayable; }
+ void SetDisplayable( sal_Bool bDisplayable );
+ sal_Bool IsDisplayable() const { return mbDisplayable; }
struct MenuBarButtonCallbackArg
{
- USHORT nId; // Id of the button
+ sal_uInt16 nId; // Id of the button
bool bHighlight; // highlight on/off
MenuBar* pMenuBar; // menubar the button belongs to
};
// add an arbitrary button to the menubar (will appear next to closer)
// passed link will be call with a MenuBarButtonCallbackArg on press
- USHORT AddMenuBarButton( const Image&, const Link&, USHORT nPos = 0 );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, sal_uInt16 nPos = 0 );
// add an arbitrary button to the menubar (will appear next to closer)
// passed link will be call with a MenuBarButtonCallbackArg on press
// passed string will be set as tooltip
- USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos = 0 );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos = 0 );
// set the highlight link for additional button with ID nId
// highlight link will be called with a MenuBarButtonHighlightArg
// the bHighlight member of that struct shall contain the new state
- void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& );
+ void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
// returns the rectangle occupied by the additional button named nId
// coordinates are relative to the systemwindiow the menubar is attached to
// if the menubar is unattached an empty rectangle is returned
- Rectangle GetMenuBarButtonRectPixel( USHORT nId );
- void RemoveMenuBarButton( USHORT nId );
+ Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
+ void RemoveMenuBarButton( sal_uInt16 nId );
};
inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
@@ -496,9 +496,9 @@ private:
SAL_DLLPRIVATE MenuFloatingWindow* ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
protected:
- SAL_DLLPRIVATE USHORT ImplExecute( Window* pWindow, const Rectangle& rRect, ULONG nPopupFlags, Menu* pStaredFrom, BOOL bPreSelectFirst );
- SAL_DLLPRIVATE long ImplCalcHeight( USHORT nEntries ) const;
- SAL_DLLPRIVATE USHORT ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry = 0, USHORT* pLastVisible = NULL ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplExecute( Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, sal_Bool bPreSelectFirst );
+ SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
public:
PopupMenu();
@@ -509,15 +509,15 @@ public:
void SetText( const XubString& rTitle ) { aTitleText = rTitle; }
const XubString& GetText() const { return aTitleText; }
- USHORT Execute( Window* pWindow, const Point& rPopupPos );
- USHORT Execute( Window* pWindow, const Rectangle& rRect, USHORT nFlags = 0 );
+ sal_uInt16 Execute( Window* pWindow, const Point& rPopupPos );
+ sal_uInt16 Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
// Fuer das TestTool
- void EndExecute( USHORT nSelect = 0 );
- void SelectEntry( USHORT nId );
- void SetSelectedEntry( USHORT nId ); // for use by native submenu only
+ void EndExecute( sal_uInt16 nSelect = 0 );
+ void SelectEntry( sal_uInt16 nId );
+ void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
- static BOOL IsInExecute();
+ static sal_Bool IsInExecute();
static PopupMenu* GetActivePopupMenu();
PopupMenu& operator =( const PopupMenu& rMenu );
diff --git a/vcl/inc/vcl/menubtn.hxx b/vcl/inc/vcl/menubtn.hxx
index 588bdd4772cd..1e65504b97bc 100644
--- a/vcl/inc/vcl/menubtn.hxx
+++ b/vcl/inc/vcl/menubtn.hxx
@@ -40,7 +40,7 @@ class PopupMenu;
// - MenuButton-Types -
// --------------------
-#define MENUBUTTON_MENUMODE_TIMED ((USHORT)0x0001)
+#define MENUBUTTON_MENUMODE_TIMED ((sal_uInt16)0x0001)
// --------------
// - MenuButton -
@@ -53,8 +53,8 @@ private:
Timer* mpMenuTimer;
PopupMenu* mpOwnMenu;
PopupMenu* mpMenu;
- USHORT mnCurItemId;
- USHORT mnMenuMode;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnMenuMode;
Link maActivateHdl;
Link maSelectHdl;
@@ -82,13 +82,13 @@ public:
virtual void Activate();
virtual void Select();
- void SetMenuMode( USHORT nMode );
- USHORT GetMenuMode() const { return mnMenuMode; }
+ void SetMenuMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuMode() const { return mnMenuMode; }
void SetPopupMenu( PopupMenu* pNewMenu );
PopupMenu* GetPopupMenu() const { return mpMenu; }
- USHORT GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; }
const Link& GetActivateHdl() const { return maActivateHdl; }
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index f507063982bb..fd8f3b8e985b 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -144,8 +144,8 @@ Meta##Name##Action::~Meta##Name##Action() {}
class VCL_DLLPUBLIC MetaAction
{
private:
- ULONG mnRefCount;
- UINT16 mnType;
+ sal_uLong mnRefCount;
+ sal_uInt16 mnType;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -154,7 +154,7 @@ protected:
public:
MetaAction();
- MetaAction( USHORT nType );
+ MetaAction( sal_uInt16 nType );
virtual void Execute( OutputDevice* pOut );
@@ -168,8 +168,8 @@ public:
sal_Bool IsEqual( const MetaAction& ) const;
- USHORT GetType() const { return mnType; }
- ULONG GetRefCount() const { return mnRefCount; }
+ sal_uInt16 GetType() const { return mnType; }
+ sal_uLong GetRefCount() const { return mnRefCount; }
void ResetRefCount() { mnRefCount = 1; }
void Duplicate() { mnRefCount++; }
void Delete() { if ( 0 == --mnRefCount ) delete this; }
@@ -492,8 +492,8 @@ private:
Point maPt;
XubString maStr;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -501,15 +501,15 @@ public:
DECL_META_ACTION( Text, META_TEXT_ACTION )
MetaTextAction( const Point& rPt, const XubString& rStr,
- USHORT nIndex, USHORT nLen );
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Point& GetPoint() const { return maPt; }
const XubString& GetText() const { return maStr; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
};
// -----------------------
@@ -523,8 +523,8 @@ private:
Point maStartPt;
XubString maStr;
sal_Int32* mpDXAry;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -537,8 +537,8 @@ public:
MetaTextArrayAction( const Point& rStartPt,
const XubString& rStr,
const sal_Int32* pDXAry,
- USHORT nIndex,
- USHORT nLen );
+ sal_uInt16 nIndex,
+ sal_uInt16 nLen );
virtual void Execute( OutputDevice* pOut );
@@ -552,8 +552,8 @@ public:
const Point& GetPoint() const { return maStartPt; }
const XubString& GetText() const { return maStr; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
sal_Int32* GetDXArray() const { return mpDXAry; }
};
@@ -568,8 +568,8 @@ private:
Point maPt;
XubString maStr;
sal_uInt32 mnWidth;
- USHORT mnIndex;
- USHORT mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -578,7 +578,7 @@ public:
MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- USHORT nIndex, USHORT nLen );
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
@@ -586,8 +586,8 @@ public:
const Point& GetPoint() const { return maPt; }
const XubString& GetText() const { return maStr; }
sal_uInt32 GetWidth() const { return mnWidth; }
- USHORT GetIndex() const { return mnIndex; }
- USHORT GetLen() const { return mnLen; }
+ sal_uInt16 GetIndex() const { return mnIndex; }
+ sal_uInt16 GetLen() const { return mnLen; }
};
// ----------------------
@@ -600,7 +600,7 @@ private:
Rectangle maRect;
XubString maStr;
- USHORT mnStyle;
+ sal_uInt16 mnStyle;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -608,14 +608,14 @@ public:
DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle );
+ const XubString& rStr, sal_uInt16 nStyle );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Rectangle& GetRect() const { return maRect; }
const XubString& GetText() const { return maStr; }
- USHORT GetStyle() const { return mnStyle; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
};
// ----------------------
@@ -1029,20 +1029,20 @@ class VCL_DLLPUBLIC MetaClipRegionAction : public MetaAction
private:
Region maRegion;
- BOOL mbClip;
+ sal_Bool mbClip;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
- MetaClipRegionAction( const Region& rRegion, BOOL bClip );
+ MetaClipRegionAction( const Region& rRegion, sal_Bool bClip );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Region& GetRegion() const { return maRegion; }
- BOOL IsClipping() const { return mbClip; }
+ sal_Bool IsClipping() const { return mbClip; }
};
// ---------------------------------
@@ -1124,17 +1124,17 @@ class VCL_DLLPUBLIC MetaLineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
- MetaLineColorAction( const Color& rColor, BOOL bSet );
+ MetaLineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1146,17 +1146,17 @@ class VCL_DLLPUBLIC MetaFillColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
- MetaFillColorAction( const Color& rColor, BOOL bSet );
+ MetaFillColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1188,17 +1188,17 @@ class VCL_DLLPUBLIC MetaTextFillColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
- MetaTextFillColorAction( const Color& rColor, BOOL bSet );
+ MetaTextFillColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1210,17 +1210,17 @@ class VCL_DLLPUBLIC MetaTextLineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
- MetaTextLineColorAction( const Color& rColor, BOOL bSet );
+ MetaTextLineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------------
@@ -1232,17 +1232,17 @@ class VCL_DLLPUBLIC MetaOverlineColorAction : public MetaAction
private:
Color maColor;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
- MetaOverlineColorAction( const Color& rColor, BOOL bSet );
+ MetaOverlineColorAction( const Color& rColor, sal_Bool bSet );
const Color& GetColor() const { return maColor; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// -----------------------
@@ -1317,16 +1317,16 @@ class VCL_DLLPUBLIC MetaPushAction : public MetaAction
{
private:
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Push, META_PUSH_ACTION )
- MetaPushAction( USHORT nFlags );
+ MetaPushAction( sal_uInt16 nFlags );
- USHORT GetFlags() const { return mnFlags; }
+ sal_uInt16 GetFlags() const { return mnFlags; }
};
// -----------------
@@ -1369,20 +1369,20 @@ class VCL_DLLPUBLIC MetaTransparentAction : public MetaAction
private:
PolyPolygon maPolyPoly;
- USHORT mnTransPercent;
+ sal_uInt16 mnTransPercent;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
- MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT nTransPercent );
+ MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; }
- USHORT GetTransparence() const { return mnTransPercent; }
+ sal_uInt16 GetTransparence() const { return mnTransPercent; }
};
// ------------------------------
@@ -1454,17 +1454,17 @@ class VCL_DLLPUBLIC MetaRefPointAction : public MetaAction
private:
Point maRefPoint;
- BOOL mbSet;
+ sal_Bool mbSet;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
- MetaRefPointAction( const Point& rRefPoint, BOOL bSet );
+ MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet );
const Point& GetRefPoint() const { return maRefPoint; }
- BOOL IsSetting() const { return mbSet; }
+ sal_Bool IsSetting() const { return mbSet; }
};
// ---------------------
@@ -1478,9 +1478,9 @@ private:
ByteString maComment;
sal_Int32 mnValue;
sal_uInt32 mnDataSize;
- BYTE* mpData;
+ sal_uInt8* mpData;
- SAL_DLLPRIVATE void ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize );
+ SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual sal_Bool Compare( const MetaAction& ) const;
protected:
@@ -1489,8 +1489,8 @@ protected:
public:
MetaCommentAction( sal_Int32 nValue = 0L );
MetaCommentAction( const MetaCommentAction& rAct );
- MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const BYTE* pData = NULL, sal_uInt32 nDataSize = 0UL );
- MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize );
+ MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL );
+ MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
@@ -1503,7 +1503,7 @@ public:
const ByteString& GetComment() const { return maComment; }
sal_Int32 GetValue() const { return mnValue; }
sal_uInt32 GetDataSize() const { return mnDataSize; }
- const BYTE* GetData() const { return mpData; }
+ const sal_uInt8* GetData() const { return mpData; }
};
// ------------------------
diff --git a/vcl/inc/vcl/metric.hxx b/vcl/inc/vcl/metric.hxx
index 41cb707ffd62..677135b99990 100644
--- a/vcl/inc/vcl/metric.hxx
+++ b/vcl/inc/vcl/metric.hxx
@@ -54,14 +54,14 @@ public:
~FontInfo();
FontType GetType() const;
- BOOL IsDeviceFont() const;
- BOOL SupportsLatin() const;
- BOOL SupportsCJK() const;
- BOOL SupportsCTL() const;
+ sal_Bool IsDeviceFont() const;
+ sal_Bool SupportsLatin() const;
+ sal_Bool SupportsCJK() const;
+ sal_Bool SupportsCTL() const;
FontInfo& operator=( const FontInfo& );
- BOOL operator==( const FontInfo& ) const;
- BOOL operator!=( const FontInfo& rInfo ) const
+ sal_Bool operator==( const FontInfo& ) const;
+ sal_Bool operator!=( const FontInfo& rInfo ) const
{ return !operator==( rInfo ); }
};
@@ -84,8 +84,8 @@ public:
long GetSlant() const;
FontMetric& operator=( const FontMetric& rMetric );
- BOOL operator==( const FontMetric& rMetric ) const;
- BOOL operator!=( const FontMetric& rMetric ) const
+ sal_Bool operator==( const FontMetric& rMetric ) const;
+ sal_Bool operator!=( const FontMetric& rMetric ) const
{ return !operator==( rMetric ); }
};
@@ -96,14 +96,14 @@ public:
class VCL_DLLPUBLIC FontCharMap
{
private:
- ImplFontCharMap* mpImpl;
+ const ImplFontCharMap* mpImpl;
public:
FontCharMap();
~FontCharMap();
- BOOL IsDefaultMap() const;
- BOOL HasChar( sal_uInt32 ) const;
+ sal_Bool IsDefaultMap() const;
+ sal_Bool HasChar( sal_uInt32 ) const;
int CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
int GetCharCount() const;
@@ -119,7 +119,7 @@ public:
private:
friend class OutputDevice;
- void Reset( ImplFontCharMap* pNewMap = NULL );
+ void Reset( const ImplFontCharMap* pNewMap = NULL );
// prevent assignment and copy construction
FontCharMap( const FontCharMap& );
@@ -136,21 +136,21 @@ class VCL_DLLPUBLIC TextRectInfo
private:
long mnMaxWidth;
- USHORT mnLineCount;
- BOOL mbEllipsis;
+ sal_uInt16 mnLineCount;
+ sal_Bool mbEllipsis;
public:
TextRectInfo();
- USHORT GetLineCount() const { return mnLineCount; }
+ sal_uInt16 GetLineCount() const { return mnLineCount; }
long GetMaxLineWidth() const { return mnMaxWidth; }
- BOOL IsEllipses() const { return mbEllipsis; }
+ sal_Bool IsEllipses() const { return mbEllipsis; }
- BOOL operator ==( const TextRectInfo& rInfo ) const
+ sal_Bool operator ==( const TextRectInfo& rInfo ) const
{ return ((mnMaxWidth == rInfo.mnMaxWidth) &&
(mnLineCount == rInfo.mnLineCount) &&
(mbEllipsis == rInfo.mbEllipsis)); }
- BOOL operator !=( const TextRectInfo& rInfo ) const
+ sal_Bool operator !=( const TextRectInfo& rInfo ) const
{ return !(TextRectInfo::operator==( rInfo )); }
};
@@ -158,7 +158,7 @@ inline TextRectInfo::TextRectInfo()
{
mnMaxWidth = 0;
mnLineCount = 0;
- mbEllipsis = FALSE;
+ mbEllipsis = sal_False;
}
#endif // _SV_METRIC_HXX
diff --git a/vcl/inc/vcl/mnemonic.hxx b/vcl/inc/vcl/mnemonic.hxx
index 801ba7d26190..1a0aac80a4a4 100644
--- a/vcl/inc/vcl/mnemonic.hxx
+++ b/vcl/inc/vcl/mnemonic.hxx
@@ -58,7 +58,7 @@
(MNEMONIC_RANGE_4_END-MNEMONIC_RANGE_4_START+1))
#define MNEMONIC_CHAR ((sal_Unicode)'~')
-#define MNEMONIC_INDEX_NOTFOUND ((USHORT)0xFFFF)
+#define MNEMONIC_INDEX_NOTFOUND ((sal_uInt16)0xFFFF)
// -------------------------
// - MnemonicGenerator -
@@ -68,18 +68,18 @@ class VCL_DLLPUBLIC MnemonicGenerator
{
private:
// 0 == Mnemonic; >0 == count of characters
- BYTE maMnemonics[MAX_MNEMONICS];
+ sal_uInt8 maMnemonics[MAX_MNEMONICS];
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
protected:
- SAL_DLLPRIVATE USHORT ImplGetMnemonicIndex( sal_Unicode c );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetMnemonicIndex( sal_Unicode c );
SAL_DLLPRIVATE sal_Unicode ImplFindMnemonic( const XubString& rKey );
public:
MnemonicGenerator();
void RegisterMnemonic( const XubString& rKey );
- BOOL CreateMnemonic( XubString& rKey );
+ sal_Bool CreateMnemonic( XubString& rKey );
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > GetCharClass();
// returns a string where all '~'-characters and CJK mnemonics of the form (~A) are completely removed
diff --git a/vcl/inc/vcl/mnemonicengine.hxx b/vcl/inc/vcl/mnemonicengine.hxx
index cf32d7b70626..79f6856cb704 100644
--- a/vcl/inc/vcl/mnemonicengine.hxx
+++ b/vcl/inc/vcl/mnemonicengine.hxx
@@ -60,7 +60,7 @@ namespace vcl
If this value is <NULL/>, searching stops.
*/
- virtual const void* FirstSearchEntry( String& _rEntryText ) = 0;
+ virtual const void* FirstSearchEntry( String& _rEntryText ) const = 0;
/** returns the next list entry for the mnemonic search
@@ -75,7 +75,7 @@ namespace vcl
to <member>FirstSearchEntry</member> (i.e. you cycled
around), then searching stops, too.
*/
- virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) = 0;
+ virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, String& _rEntryText ) const = 0;
/** "selects" a given entry.
@@ -118,7 +118,7 @@ namespace vcl
the entry to select. This is the return value of a previous call
to <member>FirstSearchEntry</member> or <member>NextSearchEntry</member>.
*/
- virtual void ExecuteSearchEntry( const void* _pEntry ) = 0;
+ virtual void ExecuteSearchEntry( const void* _pEntry ) const = 0;
};
//====================================================================
diff --git a/vcl/inc/vcl/morebtn.hxx b/vcl/inc/vcl/morebtn.hxx
index fe787d2b1b26..e84798479d7f 100644
--- a/vcl/inc/vcl/morebtn.hxx
+++ b/vcl/inc/vcl/morebtn.hxx
@@ -44,9 +44,9 @@ class VCL_DLLPUBLIC MoreButton : public PushButton
{
private:
ImplMoreButtonData* mpMBData;
- ULONG mnDelta;
+ sal_uLong mnDelta;
MapUnit meUnit;
- BOOL mbState;
+ sal_Bool mbState;
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE MoreButton( const MoreButton & );
@@ -68,15 +68,15 @@ public:
void AddWindow( Window* pWindow );
void RemoveWindow( Window* pWindow );
- void SetDelta( ULONG nNewDelta ) { mnDelta = nNewDelta; }
- ULONG GetDelta() const { return mnDelta; }
+ void SetDelta( sal_uLong nNewDelta ) { mnDelta = nNewDelta; }
+ sal_uLong GetDelta() const { return mnDelta; }
void SetMapUnit( MapUnit eNewUnit = MAP_PIXEL ) { meUnit = eNewUnit; }
MapUnit GetMapUnit() const { return meUnit; }
using PushButton::SetState;
- void SetState( BOOL bNewState = TRUE );
- BOOL GetState() const { return mbState; }
+ void SetState( sal_Bool bNewState = sal_True );
+ sal_Bool GetState() const { return mbState; }
void SetText( const XubString& rNewText );
XubString GetText() const;
@@ -87,7 +87,7 @@ public:
XubString GetLessText() const;
};
-inline void MoreButton::SetState( BOOL bNewState )
+inline void MoreButton::SetState( sal_Bool bNewState )
{
if ( mbState != bNewState )
Click();
diff --git a/vcl/inc/vcl/msgbox.hxx b/vcl/inc/vcl/msgbox.hxx
index 42eaeef2a7e4..326dae5616e3 100644
--- a/vcl/inc/vcl/msgbox.hxx
+++ b/vcl/inc/vcl/msgbox.hxx
@@ -45,8 +45,8 @@ class CheckBox;
// Return-Werte von Execute
//!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
-#define RET_OK TRUE
-#define RET_CANCEL FALSE
+#define RET_OK sal_True
+#define RET_CANCEL sal_False
#define RET_YES 2
#define RET_NO 3
#define RET_RETRY 4
@@ -71,12 +71,12 @@ protected:
FixedImage* mpFixedImage;
XubString maMessText;
Image maImage;
- USHORT mnSoundType;
- BOOL mbHelpBtn;
- BOOL mbSound;
+ sal_uInt16 mnSoundType;
+ sal_Bool mbHelpBtn;
+ sal_Bool mbSound;
CheckBox* mpCheckBox;
XubString maCheckBoxText;
- BOOL mbCheck;
+ sal_Bool mbCheck;
SAL_DLLPRIVATE void ImplInitMessBoxData();
SAL_DLLPRIVATE void ImplInitButtons();
@@ -100,14 +100,14 @@ public:
void SetImage( const Image& rImage ) { maImage = rImage; }
const Image& GetImage() const { return maImage; }
- BOOL SetModeImage( const Image& rImage );
+ sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
void SetDefaultCheckBoxText();
void SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
const XubString& GetCheckBoxText() const { return maCheckBoxText;}
- void SetCheckBoxState( BOOL bCheck );
- BOOL GetCheckBoxState() const;
+ void SetCheckBoxState( sal_Bool bCheck );
+ sal_Bool GetCheckBoxState() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
};
diff --git a/vcl/inc/vcl/octree.hxx b/vcl/inc/vcl/octree.hxx
index 085ef648f98f..3cef6384a7d6 100644
--- a/vcl/inc/vcl/octree.hxx
+++ b/vcl/inc/vcl/octree.hxx
@@ -45,15 +45,15 @@
typedef struct OctreeNode
{
- ULONG nCount;
- ULONG nRed;
- ULONG nGreen;
- ULONG nBlue;
+ sal_uLong nCount;
+ sal_uLong nRed;
+ sal_uLong nGreen;
+ sal_uLong nBlue;
OctreeNode* pChild[ 8 ];
OctreeNode* pNext;
OctreeNode* pNextInCache;
- USHORT nPalIndex;
- BOOL bLeaf;
+ sal_uInt16 nPalIndex;
+ sal_Bool bLeaf;
} NODE;
typedef NODE* PNODE;
@@ -66,20 +66,20 @@ typedef PNODE* PPNODE;
class ImpNodeCache;
class BitmapReadAccess;
-class VCL_DLLPUBLIC Octree
+class VCL_PLUGIN_PUBLIC Octree
{
private:
BitmapPalette aPal;
- ULONG nMax;
- ULONG nLeafCount;
- ULONG nLevel;
+ sal_uLong nMax;
+ sal_uLong nLeafCount;
+ sal_uLong nLevel;
PNODE pTree;
PNODE pReduce[ OCTREE_BITS + 1 ];
BitmapColor* pColor;
ImpNodeCache* pNodeCache;
const BitmapReadAccess* pAcc;
- USHORT nPalIndex;
+ sal_uInt16 nPalIndex;
Octree() {};
@@ -93,21 +93,21 @@ private:
public:
- Octree( const BitmapReadAccess& rReadAcc, ULONG nColors );
- Octree( ULONG nColors );
+ Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors );
+ Octree( sal_uLong nColors );
~Octree();
void AddColor( const BitmapColor& rColor );
inline const BitmapPalette& GetPalette();
- inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
inline const BitmapPalette& Octree::GetPalette()
{
- aPal.SetEntryCount( (USHORT) nLeafCount );
+ aPal.SetEntryCount( (sal_uInt16) nLeafCount );
nPalIndex = 0;
CreatePalette( pTree );
return aPal;
@@ -115,7 +115,7 @@ inline const BitmapPalette& Octree::GetPalette()
// ------------------------------------------------------------------------
-inline USHORT Octree::GetBestPaletteIndex( const BitmapColor& rColor )
+inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
{
pColor = &(BitmapColor&) rColor;
nPalIndex = 65535;
@@ -128,32 +128,32 @@ inline USHORT Octree::GetBestPaletteIndex( const BitmapColor& rColor )
// - InverseColorMap -
// -------------------
-class VCL_DLLPUBLIC InverseColorMap
+class VCL_PLUGIN_PUBLIC InverseColorMap
{
private:
- BYTE* pBuffer;
- BYTE* pMap;
- const ULONG nBits;
+ sal_uInt8* pBuffer;
+ sal_uInt8* pMap;
+ const sal_uLong nBits;
- SAL_DLLPRIVATE void ImplCreateBuffers( const ULONG nMax );
+ SAL_DLLPRIVATE void ImplCreateBuffers( const sal_uLong nMax );
public:
- InverseColorMap( const BitmapPalette& rPal );
+ explicit InverseColorMap( const BitmapPalette& rPal );
~InverseColorMap();
- inline USHORT GetBestPaletteIndex( const BitmapColor& rColor );
+ inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
};
// ------------------------------------------------------------------------
-inline USHORT InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
+inline sal_uInt16 InverseColorMap::GetBestPaletteIndex( const BitmapColor& rColor )
{
- return pMap[ ( ( (ULONG) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
- ( ( (ULONG) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
- ( (ULONG) rColor.GetBlue() >> nBits ) ];
+ return pMap[ ( ( (sal_uLong) rColor.GetRed() >> nBits ) << OCTREE_BITS_1 ) |
+ ( ( (sal_uLong) rColor.GetGreen() >> nBits ) << OCTREE_BITS ) |
+ ( (sal_uLong) rColor.GetBlue() >> nBits ) ];
}
#endif // _SV_OCTREE_HXX
diff --git a/vcl/inc/vcl/outdev.h b/vcl/inc/vcl/outdev.h
index 163ca349ed97..fc6bab815c48 100644
--- a/vcl/inc/vcl/outdev.h
+++ b/vcl/inc/vcl/outdev.h
@@ -48,14 +48,14 @@ class GetDevSizeList;
// -----------------------
// flags for mnMatchType member
-#define IMPL_DEVFONT_SCALABLE ((ULONG)0x00000001)
-#define IMPL_DEVFONT_SYMBOL ((ULONG)0x00000002)
-#define IMPL_DEVFONT_NONESYMBOL ((ULONG)0x00000004)
-#define IMPL_DEVFONT_LIGHT ((ULONG)0x00000010)
-#define IMPL_DEVFONT_BOLD ((ULONG)0x00000020)
-#define IMPL_DEVFONT_NORMAL ((ULONG)0x00000040)
-#define IMPL_DEVFONT_NONEITALIC ((ULONG)0x00000100)
-#define IMPL_DEVFONT_ITALIC ((ULONG)0x00000200)
+#define IMPL_DEVFONT_SCALABLE ((sal_uIntPtr)0x00000001)
+#define IMPL_DEVFONT_SYMBOL ((sal_uIntPtr)0x00000002)
+#define IMPL_DEVFONT_NONESYMBOL ((sal_uIntPtr)0x00000004)
+#define IMPL_DEVFONT_LIGHT ((sal_uIntPtr)0x00000010)
+#define IMPL_DEVFONT_BOLD ((sal_uIntPtr)0x00000020)
+#define IMPL_DEVFONT_NORMAL ((sal_uIntPtr)0x00000040)
+#define IMPL_DEVFONT_NONEITALIC ((sal_uIntPtr)0x00000100)
+#define IMPL_DEVFONT_ITALIC ((sal_uIntPtr)0x00000200)
// TODO: rename ImplDevFontListData to PhysicalFontFamily
class ImplDevFontListData
@@ -86,8 +86,8 @@ friend class ImplDevFontList; // TODO: remove soon
String maName; // Fontname (original font family name)
String maSearchName; // normalized font family name
String maMapNames; // fontname aliases
- ULONG mnTypeFaces; // Typeface Flags
- ULONG mnMatchType; // MATCH - Type
+ sal_uIntPtr mnTypeFaces; // Typeface Flags
+ sal_uIntPtr mnMatchType; // MATCH - Type
String maMatchFamilyName; // MATCH - FamilyName
FontWeight meMatchWeight; // MATCH - Weight
FontWidth meMatchWidth; // MATCH - Width
@@ -162,9 +162,9 @@ struct ImplFontSubstEntry
String maReplaceName;
String maSearchName;
String maSearchReplaceName;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
- ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, USHORT nSubstFlags );
+ ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, sal_uInt16 nSubstFlags );
};
class ImplDirectFontSubstitution
@@ -174,14 +174,14 @@ private:
typedef std::list<ImplFontSubstEntry> FontSubstList;
FontSubstList maFontSubstList;
public:
- void AddFontSubstitute( const String& rFontName, const String& rSubstName, USHORT nFlags );
+ void AddFontSubstitute( const String& rFontName, const String& rSubstName, sal_uInt16 nFlags );
void RemoveFontSubstitute( int nIndex );
- bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, USHORT& rFlags ) const;
+ bool GetFontSubstitute( int nIndex, String& rFontName, String& rSubstName, sal_uInt16& rFlags ) const;
int GetFontSubstituteCount() const { return maFontSubstList.size(); };
bool Empty() const { return maFontSubstList.empty(); }
void Clear() { maFontSubstList.clear(); }
- bool FindFontSubstitute( String& rSubstName, const String& rFontName, USHORT nFlags ) const;
+ bool FindFontSubstitute( String& rSubstName, const String& rFontName, sal_uInt16 nFlags ) const;
};
// PreMatchFontSubstitution
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 967ee09efada..e6aaec2c9971 100644..100755
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -153,52 +153,55 @@ struct KerningPair
// ----------------------
// Flags for Push()
-#define PUSH_LINECOLOR ((USHORT)0x0001)
-#define PUSH_FILLCOLOR ((USHORT)0x0002)
-#define PUSH_FONT ((USHORT)0x0004)
-#define PUSH_TEXTCOLOR ((USHORT)0x0008)
-#define PUSH_MAPMODE ((USHORT)0x0010)
-#define PUSH_CLIPREGION ((USHORT)0x0020)
-#define PUSH_RASTEROP ((USHORT)0x0040)
-#define PUSH_TEXTFILLCOLOR ((USHORT)0x0080)
-#define PUSH_TEXTALIGN ((USHORT)0x0100)
-#define PUSH_REFPOINT ((USHORT)0x0200)
-#define PUSH_TEXTLINECOLOR ((USHORT)0x0400)
-#define PUSH_TEXTLAYOUTMODE ((USHORT)0x0800)
-#define PUSH_TEXTLANGUAGE ((USHORT)0x1000)
-#define PUSH_OVERLINECOLOR ((USHORT)0x2000)
+#define PUSH_LINECOLOR ((sal_uInt16)0x0001)
+#define PUSH_FILLCOLOR ((sal_uInt16)0x0002)
+#define PUSH_FONT ((sal_uInt16)0x0004)
+#define PUSH_TEXTCOLOR ((sal_uInt16)0x0008)
+#define PUSH_MAPMODE ((sal_uInt16)0x0010)
+#define PUSH_CLIPREGION ((sal_uInt16)0x0020)
+#define PUSH_RASTEROP ((sal_uInt16)0x0040)
+#define PUSH_TEXTFILLCOLOR ((sal_uInt16)0x0080)
+#define PUSH_TEXTALIGN ((sal_uInt16)0x0100)
+#define PUSH_REFPOINT ((sal_uInt16)0x0200)
+#define PUSH_TEXTLINECOLOR ((sal_uInt16)0x0400)
+#define PUSH_TEXTLAYOUTMODE ((sal_uInt16)0x0800)
+#define PUSH_TEXTLANGUAGE ((sal_uInt16)0x1000)
+#define PUSH_OVERLINECOLOR ((sal_uInt16)0x2000)
#define PUSH_ALLTEXT (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
#define PUSH_ALLFONT (PUSH_ALLTEXT | PUSH_FONT)
-#define PUSH_ALL ((USHORT)0xFFFF)
+#define PUSH_ALL ((sal_uInt16)0xFFFF)
// Flags for DrawText()
-#define TEXT_DRAW_DISABLE ((USHORT)0x0001)
-#define TEXT_DRAW_MNEMONIC ((USHORT)0x0002)
-#define TEXT_DRAW_MONO ((USHORT)0x0004)
-#define TEXT_DRAW_CLIP ((USHORT)0x0008)
-#define TEXT_DRAW_LEFT ((USHORT)0x0010)
-#define TEXT_DRAW_CENTER ((USHORT)0x0020)
-#define TEXT_DRAW_RIGHT ((USHORT)0x0040)
-#define TEXT_DRAW_TOP ((USHORT)0x0080)
-#define TEXT_DRAW_VCENTER ((USHORT)0x0100)
-#define TEXT_DRAW_BOTTOM ((USHORT)0x0200)
-#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400)
-#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800)
-#define TEXT_DRAW_MULTILINE ((USHORT)0x1000)
-#define TEXT_DRAW_WORDBREAK ((USHORT)0x2000)
-#define TEXT_DRAW_NEWSELLIPSIS ((USHORT)0x4000)
-
-#define TEXT_DRAW_WORDBREAK_HYPHENATION (((USHORT)0x8000) | TEXT_DRAW_WORDBREAK)
+#define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0002)
+#define TEXT_DRAW_MONO ((sal_uInt16)0x0004)
+#define TEXT_DRAW_CLIP ((sal_uInt16)0x0008)
+#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010)
+#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020)
+#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040)
+#define TEXT_DRAW_TOP ((sal_uInt16)0x0080)
+#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100)
+#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200)
+#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400)
+#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800)
+#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x1000)
+#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x2000)
+#define TEXT_DRAW_NEWSELLIPSIS ((sal_uInt16)0x4000)
+// in the long run we should make text style flags longer
+// but at the moment we can get away with this 2 bit field for ellipsis style
+#define TEXT_DRAW_CENTERELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
+
+#define TEXT_DRAW_WORDBREAK_HYPHENATION (((sal_uInt16)0x8000) | TEXT_DRAW_WORDBREAK)
// Flags for CopyArea()
-#define COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
+#define COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
// Flags for DrawImage()
-#define IMAGE_DRAW_DISABLE ((USHORT)0x0001)
-#define IMAGE_DRAW_HIGHLIGHT ((USHORT)0x0002)
-#define IMAGE_DRAW_DEACTIVE ((USHORT)0x0004)
-#define IMAGE_DRAW_COLORTRANSFORM ((USHORT)0x0008)
-#define IMAGE_DRAW_SEMITRANSPARENT ((USHORT)0x0010)
+#define IMAGE_DRAW_DISABLE ((sal_uInt16)0x0001)
+#define IMAGE_DRAW_HIGHLIGHT ((sal_uInt16)0x0002)
+#define IMAGE_DRAW_DEACTIVE ((sal_uInt16)0x0004)
+#define IMAGE_DRAW_COLORTRANSFORM ((sal_uInt16)0x0008)
+#define IMAGE_DRAW_SEMITRANSPARENT ((sal_uInt16)0x0010)
#define IMAGE_DRAW_3DLOOK 0
#define IMAGE_DRAW_BTNLOOK 0
@@ -208,63 +211,63 @@ struct KerningPair
#define WAVE_NORMAL 3
// Grid
-#define GRID_DOTS ((ULONG)0x00000001)
-#define GRID_HORZLINES ((ULONG)0x00000002)
-#define GRID_VERTLINES ((ULONG)0x00000004)
+#define GRID_DOTS ((sal_uLong)0x00000001)
+#define GRID_HORZLINES ((sal_uLong)0x00000002)
+#define GRID_VERTLINES ((sal_uLong)0x00000004)
#define GRID_LINES (GRID_HORZLINES | GRID_VERTLINES)
// LayoutModes for Complex Text Layout
-#define TEXT_LAYOUT_DEFAULT ((ULONG)0x00000000)
-#define TEXT_LAYOUT_BIDI_LTR ((ULONG)0x00000000)
-#define TEXT_LAYOUT_BIDI_RTL ((ULONG)0x00000001)
-#define TEXT_LAYOUT_BIDI_STRONG ((ULONG)0x00000002)
-#define TEXT_LAYOUT_TEXTORIGIN_LEFT ((ULONG)0x00000004)
-#define TEXT_LAYOUT_TEXTORIGIN_RIGHT ((ULONG)0x00000008)
-#define TEXT_LAYOUT_COMPLEX_DISABLED ((ULONG)0x00000100)
-#define TEXT_LAYOUT_ENABLE_LIGATURES ((ULONG)0x00000200)
-#define TEXT_LAYOUT_SUBSTITUTE_DIGITS ((ULONG)0x00000400)
+#define TEXT_LAYOUT_DEFAULT ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_LTR ((sal_uLong)0x00000000)
+#define TEXT_LAYOUT_BIDI_RTL ((sal_uLong)0x00000001)
+#define TEXT_LAYOUT_BIDI_STRONG ((sal_uLong)0x00000002)
+#define TEXT_LAYOUT_TEXTORIGIN_LEFT ((sal_uLong)0x00000004)
+#define TEXT_LAYOUT_TEXTORIGIN_RIGHT ((sal_uLong)0x00000008)
+#define TEXT_LAYOUT_COMPLEX_DISABLED ((sal_uLong)0x00000100)
+#define TEXT_LAYOUT_ENABLE_LIGATURES ((sal_uLong)0x00000200)
+#define TEXT_LAYOUT_SUBSTITUTE_DIGITS ((sal_uLong)0x00000400)
// DrawModes
-#define DRAWMODE_DEFAULT ((ULONG)0x00000000)
-#define DRAWMODE_BLACKLINE ((ULONG)0x00000001)
-#define DRAWMODE_BLACKFILL ((ULONG)0x00000002)
-#define DRAWMODE_BLACKTEXT ((ULONG)0x00000004)
-#define DRAWMODE_BLACKBITMAP ((ULONG)0x00000008)
-#define DRAWMODE_BLACKGRADIENT ((ULONG)0x00000010)
-#define DRAWMODE_GRAYLINE ((ULONG)0x00000020)
-#define DRAWMODE_GRAYFILL ((ULONG)0x00000040)
-#define DRAWMODE_GRAYTEXT ((ULONG)0x00000080)
-#define DRAWMODE_GRAYBITMAP ((ULONG)0x00000100)
-#define DRAWMODE_GRAYGRADIENT ((ULONG)0x00000200)
-#define DRAWMODE_NOFILL ((ULONG)0x00000400)
-#define DRAWMODE_NOBITMAP ((ULONG)0x00000800)
-#define DRAWMODE_NOGRADIENT ((ULONG)0x00001000)
-#define DRAWMODE_GHOSTEDLINE ((ULONG)0x00002000)
-#define DRAWMODE_GHOSTEDFILL ((ULONG)0x00004000)
-#define DRAWMODE_GHOSTEDTEXT ((ULONG)0x00008000)
-#define DRAWMODE_GHOSTEDBITMAP ((ULONG)0x00010000)
-#define DRAWMODE_GHOSTEDGRADIENT ((ULONG)0x00020000)
-#define DRAWMODE_WHITELINE ((ULONG)0x00100000)
-#define DRAWMODE_WHITEFILL ((ULONG)0x00200000)
-#define DRAWMODE_WHITETEXT ((ULONG)0x00400000)
-#define DRAWMODE_WHITEBITMAP ((ULONG)0x00800000)
-#define DRAWMODE_WHITEGRADIENT ((ULONG)0x01000000)
-#define DRAWMODE_SETTINGSLINE ((ULONG)0x02000000)
-#define DRAWMODE_SETTINGSFILL ((ULONG)0x04000000)
-#define DRAWMODE_SETTINGSTEXT ((ULONG)0x08000000)
-#define DRAWMODE_SETTINGSGRADIENT ((ULONG)0x10000000)
-#define DRAWMODE_NOTRANSPARENCY ((ULONG)0x80000000)
+#define DRAWMODE_DEFAULT ((sal_uLong)0x00000000)
+#define DRAWMODE_BLACKLINE ((sal_uLong)0x00000001)
+#define DRAWMODE_BLACKFILL ((sal_uLong)0x00000002)
+#define DRAWMODE_BLACKTEXT ((sal_uLong)0x00000004)
+#define DRAWMODE_BLACKBITMAP ((sal_uLong)0x00000008)
+#define DRAWMODE_BLACKGRADIENT ((sal_uLong)0x00000010)
+#define DRAWMODE_GRAYLINE ((sal_uLong)0x00000020)
+#define DRAWMODE_GRAYFILL ((sal_uLong)0x00000040)
+#define DRAWMODE_GRAYTEXT ((sal_uLong)0x00000080)
+#define DRAWMODE_GRAYBITMAP ((sal_uLong)0x00000100)
+#define DRAWMODE_GRAYGRADIENT ((sal_uLong)0x00000200)
+#define DRAWMODE_NOFILL ((sal_uLong)0x00000400)
+#define DRAWMODE_NOBITMAP ((sal_uLong)0x00000800)
+#define DRAWMODE_NOGRADIENT ((sal_uLong)0x00001000)
+#define DRAWMODE_GHOSTEDLINE ((sal_uLong)0x00002000)
+#define DRAWMODE_GHOSTEDFILL ((sal_uLong)0x00004000)
+#define DRAWMODE_GHOSTEDTEXT ((sal_uLong)0x00008000)
+#define DRAWMODE_GHOSTEDBITMAP ((sal_uLong)0x00010000)
+#define DRAWMODE_GHOSTEDGRADIENT ((sal_uLong)0x00020000)
+#define DRAWMODE_WHITELINE ((sal_uLong)0x00100000)
+#define DRAWMODE_WHITEFILL ((sal_uLong)0x00200000)
+#define DRAWMODE_WHITETEXT ((sal_uLong)0x00400000)
+#define DRAWMODE_WHITEBITMAP ((sal_uLong)0x00800000)
+#define DRAWMODE_WHITEGRADIENT ((sal_uLong)0x01000000)
+#define DRAWMODE_SETTINGSLINE ((sal_uLong)0x02000000)
+#define DRAWMODE_SETTINGSFILL ((sal_uLong)0x04000000)
+#define DRAWMODE_SETTINGSTEXT ((sal_uLong)0x08000000)
+#define DRAWMODE_SETTINGSGRADIENT ((sal_uLong)0x10000000)
+#define DRAWMODE_NOTRANSPARENCY ((sal_uLong)0x80000000)
// Antialiasing
-#define ANTIALIASING_DISABLE_TEXT ((USHORT)0x0001)
-#define ANTIALIASING_ENABLE_B2DDRAW ((USHORT)0x0002)
-#define ANTIALIASING_PIXELSNAPHAIRLINE ((USHORT)0x0004)
+#define ANTIALIASING_DISABLE_TEXT ((sal_uInt16)0x0001)
+#define ANTIALIASING_ENABLE_B2DDRAW ((sal_uInt16)0x0002)
+#define ANTIALIASING_PIXELSNAPHAIRLINE ((sal_uInt16)0x0004)
// AddFontSubstitute
-#define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001)
-#define FONT_SUBSTITUTE_SCREENONLY ((USHORT)0x0002)
+#define FONT_SUBSTITUTE_ALWAYS ((sal_uInt16)0x0001)
+#define FONT_SUBSTITUTE_SCREENONLY ((sal_uInt16)0x0002)
-#define DEFAULTFONT_FLAGS_ONLYONE ((ULONG)0x00000001)
+#define DEFAULTFONT_FLAGS_ONLYONE ((sal_uLong)0x00000001)
enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
@@ -337,8 +340,8 @@ private:
mutable long mnTextOffY;
mutable long mnEmphasisAscent;
mutable long mnEmphasisDescent;
- ULONG mnDrawMode;
- ULONG mnTextLayoutMode;
+ sal_uLong mnDrawMode;
+ sal_uLong mnTextLayoutMode;
ImplMapRes maMapRes;
ImplThresholdRes maThresRes;
OutDevType meOutDevType;
@@ -356,9 +359,9 @@ private:
AllSettings maSettings;
MapMode maMapMode;
Point maRefPoint;
- USHORT mnAntialiasing;
+ sal_uInt16 mnAntialiasing;
LanguageType meTextLanguage;
- mutable BOOL mbMap:1,
+ mutable sal_Bool mbMap:1,
mbMapIsDefault:1,
mbClipRegion:1,
mbBackground:1,
@@ -384,8 +387,8 @@ public:
SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; }
SAL_DLLPRIVATE sal_Int32 ImplGetDPIY() const { return mnDPIY; }
SAL_DLLPRIVATE int ImplGetGraphics() const;
- SAL_DLLPRIVATE void ImplReleaseGraphics( BOOL bRelease = TRUE );
- SAL_DLLPRIVATE BOOL ImplHasMirroredGraphics();
+ SAL_DLLPRIVATE void ImplReleaseGraphics( sal_Bool bRelease = sal_True );
+ SAL_DLLPRIVATE sal_Bool ImplHasMirroredGraphics();
SAL_DLLPRIVATE void ImplReMirror( Point &rPoint ) const;
SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const;
SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const;
@@ -399,7 +402,6 @@ public:
SAL_DLLPRIVATE void ImplInitClipRegion();
SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion );
- SAL_DLLPRIVATE void ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon );
SAL_DLLPRIVATE SalLayout* ImplLayout( const String&, xub_StrLen nIndex,
xub_StrLen nLen, const Point& rLogicPos = Point(0,0),
@@ -414,15 +416,15 @@ public:
SAL_DLLPRIVATE long ImplGetTextWidth( const SalLayout& ) const;
static
SAL_DLLPRIVATE XubString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rStr,
- long nMaxWidth, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
static
SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
+ const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText, ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplDrawTextBackground( const SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
SAL_DLLPRIVATE bool ImplDrawRotateText( SalLayout& );
- SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, BOOL bTextLines );
+ SAL_DLLPRIVATE void ImplDrawTextDirect( SalLayout&, sal_Bool bTextLines );
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawText( SalLayout& );
SAL_DLLPRIVATE Rectangle ImplGetTextBoundRect( const SalLayout& );
@@ -433,16 +435,16 @@ public:
SAL_DLLPRIVATE void ImplInitTextLineSize();
SAL_DLLPRIVATE void ImplInitAboveTextLineSize();
SAL_DLLPRIVATE void ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
- SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove );
- SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, BOOL bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
+ SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontUnderline eTextLine, Color aColor, sal_Bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
- SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bUnderlineAbove );
+ SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bUnderlineAbove );
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
- SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
- SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient );
+ SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
static
- SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, USHORT nStyle, const ::vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const XubString& rStr, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplInitFontList() const;
SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists );
SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists );
@@ -472,13 +474,13 @@ public:
SAL_DLLPRIVATE void ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pClipPolyPoly = NULL );
SAL_DLLPRIVATE void ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const PolyPolygon* pClipPolyPoly = NULL );
- SAL_DLLPRIVATE void ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly );
- SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
- SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, BOOL bMtf, const PolyPolygon* pClipPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
+ SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly );
- SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf );
- SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
- SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, BOOL bMtf );
+ SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf );
+ SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
+ SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, sal_Bool bMtf );
SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
@@ -489,14 +491,14 @@ public:
SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, void* pPosAry );
SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const ULONG nAction );
+ const Bitmap& rBitmap, const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx, const ULONG nAction );
+ const BitmapEx& rBitmapEx, const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor,
- const ULONG nAction );
+ const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
@@ -536,14 +538,14 @@ public:
SAL_DLLPRIVATE void ImplGetFrameBitmap( const Point& rPt, const Size& rSize,
Bitmap& rBitmap ) const;
- SAL_DLLPRIVATE BOOL ImplIsRecordLayout() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsRecordLayout() const;
void ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
- SAL_DLLPRIVATE static BOOL ImplIsUnderlineAbove( const Font& );
+ SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& );
// tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
@@ -596,8 +598,8 @@ public:
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove = FALSE );
- static BOOL IsTextUnderlineAbove( const Font& rFont );
+ sal_Bool bUnderlineAbove = sal_False );
+ static sal_Bool IsTextUnderlineAbove( const Font& rFont );
void DrawText( const Point& rStartPt, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
@@ -615,15 +617,15 @@ public:
bool GetCaretPositions( const XubString&, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry = NULL, long nWidth = 0,
- BOOL bCellBreaking = TRUE ) const;
- void DrawStretchText( const Point& rStartPt, ULONG nWidth,
+ sal_Bool bCellBreaking = sal_True ) const;
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
xub_StrLen GetTextBreak( const XubString& rStr, long nTextWidth,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- long nCharExtra = 0, BOOL bCellBreaking = TRUE ) const;
+ long nCharExtra = 0, sal_Bool bCellBreaking = sal_True ) const;
xub_StrLen GetTextBreak( const XubString& rStr, long nTextWidth,
- USHORT nExtraChar, xub_StrLen& rExtraCharPos,
+ sal_uInt16 nExtraChar, xub_StrLen& rExtraCharPos,
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra = 0 ) const;
/** Generate MetaTextActions for the text rect
@@ -636,47 +638,47 @@ public:
*/
void AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- USHORT nStyle,
+ sal_uInt16 nStyle,
GDIMetaFile& rMtf );
void DrawText( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0,
+ const XubString& rStr, sal_uInt16 nStyle = 0,
MetricVector* pVector = NULL, String* pDisplayText = NULL,
::vcl::ITextLayout* _pTextLayout = NULL );
Rectangle GetTextRect( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = TEXT_DRAW_WORDBREAK,
+ const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
TextRectInfo* pInfo = NULL,
const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
XubString GetEllipsisString( const XubString& rStr, long nMaxWidth,
- USHORT nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
+ sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
void DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- USHORT nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, String* pDisplayText = NULL );
long GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN,
- USHORT nStyle = TEXT_DRAW_MNEMONIC ) const;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
static XubString GetNonMnemonicString( const XubString& rStr, xub_StrLen& rMnemonicPos );
static XubString GetNonMnemonicString( const XubString& rStr )
{ xub_StrLen nDummy; return GetNonMnemonicString( rStr, nDummy ); }
- ULONG GetKerningPairCount() const;
- void GetKerningPairs( ULONG nPairs, KerningPair* pKernPairs ) const;
+ sal_uLong GetKerningPairCount() const;
+ void GetKerningPairs( sal_uLong nPairs, KerningPair* pKernPairs ) const;
- BOOL GetTextBoundRect( Rectangle& rRect,
+ sal_Bool GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutline( PolyPolygon&,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutline( PolyPolygon&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutlines( PolyPolyVector&,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( PolyPolyVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN, BOOL bOptimize = TRUE,
- ULONG nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
- BOOL GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
+ xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
+ sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
+ sal_Bool GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
int nLen, int nBase, MetricVector& rVector );
void DrawPixel( const Point& rPt );
@@ -740,7 +742,7 @@ public:
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
@@ -756,7 +758,7 @@ public:
const OutputDevice& rOutDev );
void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -783,9 +785,9 @@ public:
const Bitmap& rBitmap, const Color& rMaskColor );
void DrawImage( const Point& rPos,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
@@ -806,10 +808,10 @@ public:
#endif
void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
- void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle );
- void DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags );
+ void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle );
+ void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags );
- void DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent );
+ void DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
void DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency);
void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, const Gradient& rTransparenceGradient );
@@ -822,41 +824,40 @@ public:
*/
BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const;
- void EnableMapMode( BOOL bEnable = TRUE );
- BOOL IsMapModeEnabled() const { return mbMap; }
+ void EnableMapMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsMapModeEnabled() const { return mbMap; }
// Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout
- void EnableRTL( BOOL bEnable = TRUE);
- BOOL IsRTLEnabled() const { return mbEnableRTL; }
+ void EnableRTL( sal_Bool bEnable = sal_True);
+ sal_Bool IsRTLEnabled() const { return mbEnableRTL; }
void SetConnectMetaFile( GDIMetaFile* pMtf );
GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; }
- void EnableOutput( BOOL bEnable = TRUE );
- BOOL IsOutputEnabled() const { return mbOutput; }
- BOOL IsDeviceOutput() const { return mbDevOutput; }
- BOOL IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
- BOOL IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); }
+ void EnableOutput( sal_Bool bEnable = sal_True );
+ sal_Bool IsOutputEnabled() const { return mbOutput; }
+ sal_Bool IsDeviceOutput() const { return mbDevOutput; }
+ sal_Bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); }
+ sal_Bool IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); }
void SetClipRegion();
void SetClipRegion( const Region& rRegion );
- void SetTriangleClipRegion( const PolyPolygon &rRegion );
Region GetClipRegion() const;
- BOOL IsClipRegion() const { return mbClipRegion; }
+ sal_Bool IsClipRegion() const { return mbClipRegion; }
Region GetActiveClipRegion() const;
void MoveClipRegion( long nHorzMove, long nVertMove );
void IntersectClipRegion( const Rectangle& rRect );
void IntersectClipRegion( const Region& rRegion );
- void SetAntialiasing( USHORT nMode = 0 );
- USHORT GetAntialiasing() const { return mnAntialiasing; }
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetAntialiasing() const { return mnAntialiasing; }
- void SetDrawMode( ULONG nDrawMode );
- ULONG GetDrawMode() const { return mnDrawMode; }
+ void SetDrawMode( sal_uLong nDrawMode );
+ sal_uLong GetDrawMode() const { return mnDrawMode; }
- void SetLayoutMode( ULONG nTextLayoutMode );
- ULONG GetLayoutMode() const { return mnTextLayoutMode; }
+ void SetLayoutMode( sal_uLong nTextLayoutMode );
+ sal_uLong GetLayoutMode() const { return mnTextLayoutMode; }
void SetDigitLanguage( LanguageType );
LanguageType GetDigitLanguage() const { return meTextLanguage; }
@@ -877,18 +878,18 @@ public:
void SetLineColor();
void SetLineColor( const Color& rColor );
const Color& GetLineColor() const { return maLineColor; }
- BOOL IsLineColor() const { return mbLineColor; }
+ sal_Bool IsLineColor() const { return mbLineColor; }
void SetFillColor();
void SetFillColor( const Color& rColor );
const Color& GetFillColor() const { return maFillColor; }
- BOOL IsFillColor() const { return mbFillColor; }
+ sal_Bool IsFillColor() const { return mbFillColor; }
void SetBackground();
void SetBackground( const Wallpaper& rBackground );
const Wallpaper& GetBackground() const { return maBackground; }
- BOOL IsBackground() const { return mbBackground; }
+ sal_Bool IsBackground() const { return mbBackground; }
void SetFont( const Font& rNewFont );
const Font& GetFont() const { return maFont; }
@@ -904,15 +905,15 @@ public:
void SetTextFillColor( const Color& rColor );
Color GetTextFillColor() const;
- BOOL IsTextFillColor() const { return !maFont.IsTransparent(); }
+ sal_Bool IsTextFillColor() const { return !maFont.IsTransparent(); }
void SetTextLineColor();
void SetTextLineColor( const Color& rColor );
const Color& GetTextLineColor() const { return maTextLineColor; }
- BOOL IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
+ sal_Bool IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
void SetOverlineColor();
void SetOverlineColor( const Color& rColor );
const Color& GetOverlineColor() const { return maOverlineColor; }
- BOOL IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
+ sal_Bool IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
void SetTextAlign( TextAlign eAlign );
TextAlign GetTextAlign() const { return maFont.GetAlign(); }
@@ -926,12 +927,12 @@ public:
virtual void SetMapMode( const MapMode& rNewMapMode );
virtual void SetRelativeMapMode( const MapMode& rNewMapMode );
const MapMode& GetMapMode() const { return maMapMode; }
- BOOL IsMapMode() const { return mbMap; }
+ sal_Bool IsMapMode() const { return mbMap; }
void SetRefPoint();
void SetRefPoint( const Point& rRefPoint );
const Point& GetRefPoint() const { return maRefPoint; }
- BOOL IsRefPoint() const { return mbRefPoint; }
+ sal_Bool IsRefPoint() const { return mbRefPoint; }
// #i75163#
basegfx::B2DHomMatrix GetViewTransformation() const;
@@ -1032,7 +1033,7 @@ public:
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
long* LogicToLogic( long* pX,
- USHORT nCount,
+ sal_uInt16 nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const;
static Point LogicToLogic( const Point& rPtSource,
@@ -1068,16 +1069,16 @@ public:
void Erase();
void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
- BOOL AddTempDevFont( const String& rFileURL, const String& rFontName );
+ sal_Bool AddTempDevFont( const String& rFileURL, const String& rFontName );
int GetDevFontCount() const;
FontInfo GetDevFont( int nDevFontIndex ) const;
int GetDevFontSizeCount( const Font& ) const;
Size GetDevFontSize( const Font& rFont, int nSizeIndex ) const;
- BOOL IsFontAvailable( const String& rFontName ) const;
+ sal_Bool IsFontAvailable( const String& rFontName ) const;
FontMetric GetFontMetric() const;
FontMetric GetFontMetric( const Font& rFont ) const;
- BOOL GetFontCharMap( FontCharMap& rFontCharMap ) const;
+ sal_Bool GetFontCharMap( FontCharMap& rFontCharMap ) const;
bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
xub_StrLen HasGlyphs( const Font& rFont, const String& rStr,
@@ -1096,9 +1097,9 @@ public:
xub_StrLen* pKashidaPosDropped // invalid kashida positions (out)
) const;
- USHORT GetBitCount() const;
+ sal_uInt16 GetBitCount() const;
- BOOL GetTextIsRTL( const String&, xub_StrLen nIndex,
+ sal_Bool GetTextIsRTL( const String&, xub_StrLen nIndex,
xub_StrLen nLen ) const;
/** Query the existence and depth of the alpha channel
@@ -1106,21 +1107,25 @@ public:
@return 0, if no alpha channel available, and the bit depth of
the alpha channel otherwise.
*/
- USHORT GetAlphaBitCount() const;
- ULONG GetColorCount() const;
+ sal_uInt16 GetAlphaBitCount() const;
+ sal_uLong GetColorCount() const;
- void Push( USHORT nFlags = PUSH_ALL );
+ void Push( sal_uInt16 nFlags = PUSH_ALL );
void Pop();
+ // returns the curren stack depth; that is the number of Push() calls minus the number of Pop() calls
+ // this should not normally be used since Push and Pop must always be used symmetrically
+ // however this may be e.g. a help when debugging code in which this somehow is not the case
+ sal_uInt32 GetGCStackDepth() const;
/** Query availability of alpha channel
- @return TRUE, if this device has an alpha channel.
+ @return sal_True, if this device has an alpha channel.
*/
- BOOL HasAlpha();
+ sal_Bool HasAlpha();
/** Added return value to see if EPS could be painted directly.
Theoreticaly, handing over a matrix would be needed to handle
- painting rotated EPS files (e.g. contained mn Metafiles). This
+ painting rotated EPS files (e.g. contained in Metafiles). This
would then need to be supported for Mac and PS printers, but
that's too much for now, wrote #i107046# for this */
bool DrawEPS( const Point& rPt, const Size& rSz,
@@ -1138,17 +1143,17 @@ public:
static void EndFontSubstitution();
static void AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags = 0 );
- static void RemoveFontSubstitute( USHORT n );
- static USHORT GetFontSubstituteCount();
- static void GetFontSubstitute( USHORT n,
+ sal_uInt16 nFlags = 0 );
+ static void RemoveFontSubstitute( sal_uInt16 n );
+ static sal_uInt16 GetFontSubstituteCount();
+ static void GetFontSubstitute( sal_uInt16 n,
XubString& rFontName,
XubString& rReplaceFontName,
- USHORT& rFlags );
+ sal_uInt16& rFlags );
- static Font GetDefaultFont( USHORT nType,
+ static Font GetDefaultFont( sal_uInt16 nType,
LanguageType eLang,
- ULONG nFlags,
+ sal_uLong nFlags,
const OutputDevice* pOutDev = NULL );
/** helper method removing transparencies from a metafile (e.g. for printing)
@@ -1192,17 +1197,17 @@ public:
// These all just call through to the private mpGraphics functions of the same name.
// Query the platform layer for control support
- BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- BOOL HitTestNativeControl( ControlType nType,
+ sal_Bool HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside );
+ sal_Bool& rIsInside );
// Request rendering of a particular control and/or part
- BOOL DrawNativeControl( ControlType nType,
+ sal_Bool DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1210,7 +1215,7 @@ public:
::rtl::OUString aCaption );
// Request rendering of a caption string for a control
- BOOL DrawNativeControlText( ControlType nType,
+ sal_Bool DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1218,7 +1223,7 @@ public:
::rtl::OUString aCaption );
// Query the native control's actual drawing region (including adornment)
- BOOL GetNativeControlRegion( ControlType nType,
+ sal_Bool GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index 17492c14a3be..faf2b00793f2 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -39,8 +39,6 @@
#include <boost/unordered_map.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
-
class ImplDevFontListData;
class ImplGetDevFontList;
class ImplGetDevSizeList;
@@ -54,6 +52,8 @@ class ConvertChar;
struct FontMatchStatus;
class OutputDevice;
+namespace com { namespace sun { namespace star { namespace lang { struct Locale; }}}}
+
// ----------------------
// - ImplFontAttributes -
// ----------------------
@@ -116,7 +116,7 @@ public: // TODO: hide members behind accessor methods
// TODO: make cloning cheaper
// abstract base class for physical font faces
-class VCL_DLLPUBLIC ImplFontData : public ImplDevFontAttributes
+class VCL_PLUGIN_PUBLIC ImplFontData : public ImplDevFontAttributes
{
public:
// by using an ImplFontData object as a factory for its corresponding
@@ -140,7 +140,7 @@ public:
virtual ImplFontData* Clone() const = 0;
protected:
- ImplFontData( const ImplDevFontAttributes&, int nMagic );
+ explicit ImplFontData( const ImplDevFontAttributes&, int nMagic );
void SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
long mnWidth; // Width (in pixels)
@@ -185,7 +185,7 @@ public: // TODO: change to private
// TODO: merge with ImplFontCache
// TODO: rename to LogicalFontManager
-class VCL_DLLPUBLIC ImplDevFontList
+class VCL_PLUGIN_PUBLIC ImplDevFontList
{
private:
friend class WinGlyphFallbackSubstititution;
@@ -199,8 +199,8 @@ private:
ImplGlyphFallbackFontSubstitution* mpFallbackHook; // device specific glyh fallback substitution
public:
- ImplDevFontList();
- ~ImplDevFontList();
+ explicit ImplDevFontList();
+ virtual ~ImplDevFontList();
// fill the list with device fonts
void Add( ImplFontData* );
@@ -226,7 +226,7 @@ public:
ImplGetDevSizeList* GetDevSizeList( const String& rFontName ) const;
//used by 2-level font fallback
- ImplDevFontListData* ImplFindByLocale(com::sun::star::lang::Locale lc) const;
+ ImplDevFontListData* ImplFindByLocale( com::sun::star::lang::Locale& ) const;
protected:
void InitMatchData() const;
@@ -235,7 +235,7 @@ protected:
ImplDevFontListData* ImplFindByTokenNames( const String& ) const;
ImplDevFontListData* ImplFindByAliasName( const String& rSearchName, const String& rShortName ) const;
ImplDevFontListData* ImplFindBySubstFontAttr( const utl::FontNameAttr& ) const;
- ImplDevFontListData* ImplFindByAttributes( ULONG nSearchType, FontWeight, FontWidth,
+ ImplDevFontListData* ImplFindByAttributes( sal_uLong nSearchType, FontWeight, FontWidth,
FontFamily, FontItalic, const String& rSearchFamily ) const;
ImplDevFontListData* FindDefaultFont() const;
@@ -254,8 +254,8 @@ private:
struct ImplKernPairData
{
- USHORT mnChar1;
- USHORT mnChar2;
+ sal_uInt16 mnChar1;
+ sal_uInt16 mnChar2;
long mnKern;
};
@@ -267,7 +267,7 @@ struct ImplKernPairData
class ImplFontMetricData : public ImplFontAttributes
{
public:
- ImplFontMetricData( const ImplFontSelectData& );
+ explicit ImplFontMetricData( const ImplFontSelectData& );
void ImplInitTextLineSize( const OutputDevice* pDev );
void ImplInitAboveTextLineSize();
@@ -324,10 +324,10 @@ public: // TODO: hide members behind accessor methods
// TODO: rename ImplFontEntry to LogicalFontInstance
// TODO: allow sharing of metrics for related fonts
-class VCL_DLLPUBLIC ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplFontEntry
{
public:
- ImplFontEntry( const ImplFontSelectData& );
+ explicit ImplFontEntry( const ImplFontSelectData& );
virtual ~ImplFontEntry();
public: // TODO: make data members private
@@ -335,8 +335,8 @@ public: // TODO: make data members private
ImplFontMetricData maMetric; // Font Metric
const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
long mnLineHeight;
- ULONG mnRefCount;
- USHORT mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
+ sal_uLong mnRefCount;
+ sal_uInt16 mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
short mnOwnOrientation; // text angle if lower layers don't rotate text themselves
short mnOrientation; // text angle in 3600 system
bool mbInit; // true if maMetric member is valid
@@ -393,7 +393,7 @@ public:
void AddLine( ImplTextLineInfo* pLine );
void Clear();
- ImplTextLineInfo* GetLine( USHORT nLine ) const
+ ImplTextLineInfo* GetLine( sal_uInt16 nLine ) const
{ return mpLines[nLine]; }
xub_StrLen Count() const { return mnLines; }
diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx
index 804e8c03287e..f4b8039fc9e8 100644
--- a/vcl/inc/vcl/pdfextoutdevdata.hxx
+++ b/vcl/inc/vcl/pdfextoutdevdata.hxx
@@ -171,7 +171,7 @@ public :
rOutputRect, e.g. for cropped graphics.
*/
void EndGroup( const Graphic& rGraphic,
- BYTE nTransparency,
+ sal_uInt8 nTransparency,
const Rectangle& rOutputRect,
const Rectangle& rVisibleOutputRect );
//--->i56629
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index f87ef312c8de..b1f76046678d 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -39,7 +39,8 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include <com/sun/star/io/XOutputStream.hpp>
+#include "com/sun/star/io/XOutputStream.hpp"
+#include "com/sun/star/beans/XMaterialHolder.hpp"
#include <list>
#include <vector>
@@ -48,6 +49,7 @@
class Font;
class Point;
class OutputDevice;
+class GDIMetaFile;
class MapMode;
class Polygon;
class LineInfo;
@@ -62,15 +64,7 @@ class Wallpaper;
namespace vcl
{
-struct PDFDocInfo
-{
- String Title; // document title
- String Author; // document author
- String Subject; // subject
- String Keywords; // keywords
- String Creator; // application that created the original document
- String Producer; // OpenOffice
-};
+class PDFExtOutDevData;
struct PDFNote
{
@@ -236,7 +230,7 @@ public:
rtl::OUString Name; // a distinct name to identify the control
rtl::OUString Description;// descriptive text for the contro (e.g. for tool tip)
rtl::OUString Text; // user text to appear on the control
- USHORT TextStyle; // style flags
+ sal_uInt16 TextStyle; // style flags
bool ReadOnly;
Rectangle Location; // describes the area filled by the control
bool Border; // true: widget should have a border, false: no border
@@ -469,7 +463,7 @@ public:
FitVisible,
ActionZoom
};
-// These emuns are treated as integer while reading/writing to configuration
+// These enums are treated as integer while reading/writing to configuration
enum PDFPageLayout
{
DefaultLayout,
@@ -490,20 +484,35 @@ public:
/*
The following structure describes the permissions used in PDF security
*/
- struct PDFSecPermissions
+ struct PDFEncryptionProperties
{
-//for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
- bool CanPrintTheDocument;
+
+ bool Security128bit; // true to select 128 bit encryption, false for 40 bit
+ //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
+ bool CanPrintTheDocument;
bool CanModifyTheContent;
bool CanCopyOrExtract;
bool CanAddOrModify;
-//for revision 3 (bit 128 security) only
+ //for revision 3 (bit 128 security) only
bool CanFillInteractive;
bool CanExtractForAccessibility;
bool CanAssemble;
bool CanPrintFull;
-//permission default set for 128 bit, accessibility only
- PDFSecPermissions() :
+
+ // encryption will only happen if EncryptionKey is not empty
+ // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
+ // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
+ // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
+ // PDFDocInfo, Owner password and User password used the InitEncryption method which
+ // implements the algorithms described in the PDF reference chapter 3.5: Encryption
+ std::vector<sal_uInt8> OValue;
+ std::vector<sal_uInt8> UValue;
+ std::vector<sal_uInt8> EncryptionKey;
+ std::vector<sal_uInt8> DocumentIdentifier;
+
+ //permission default set for 128 bit, accessibility only
+ PDFEncryptionProperties() :
+ Security128bit ( true ),
CanPrintTheDocument ( false ),
CanModifyTheContent ( false ),
CanCopyOrExtract ( false ),
@@ -513,6 +522,25 @@ The following structure describes the permissions used in PDF security
CanAssemble ( false ),
CanPrintFull ( false )
{}
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+ };
+
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
+ };
+
+ enum ColorMode
+ {
+ DrawColor, DrawGreyscale
};
struct PDFWriterContext
@@ -571,14 +599,13 @@ The following structure describes the permissions used in PDF security
sal_Int32 InitialPage;
sal_Int32 OpenBookmarkLevels; // -1 means all levels
- struct PDFSecPermissions AccessPermissions;
-
- bool Encrypt; // main encryption flag, must be true to encript
- bool Security128bit; // true to select 128 bit encryption, false for 40 bit
- rtl::OUString OwnerPassword; // owner password for PDF, in clear text
- rtl::OUString UserPassword; // user password for PDF, in clear text
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
+ PDFWriter::ColorMode ColorMode;
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?
@@ -605,13 +632,14 @@ The following structure describes the permissions used in PDF security
FirstPageLeft( false ),
InitialPage( 1 ),
OpenBookmarkLevels( -1 ),
- AccessPermissions( ),
- Encrypt( false ),
- Security128bit( true )
+ Encryption(),
+ DPIx( 0 ),
+ DPIy( 0 ),
+ ColorMode( PDFWriter::DrawColor )
{}
};
- PDFWriter( const PDFWriterContext& rContext );
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
~PDFWriter();
/** Returns an OutputDevice for formatting
@@ -636,17 +664,24 @@ The following structure describes the permissions used in PDF security
returns the page id of the new page
*/
sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
- /*
- * set document info; due to the use of document information in building the PDF document ID, must be called before
- * emitting anything.
- */
- void SetDocInfo( const PDFDocInfo& rInfo );
-
- /*
- * get currently set document info
- */
- const PDFDocInfo& GetDocInfo() const;
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
/* sets the document locale originally passed with the context to a new value
* only affects the output if used before calling <code>Emit/code>.
@@ -665,9 +700,15 @@ The following structure describes the permissions used in PDF security
PDFVersion GetVersion() const;
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
/* functions for graphics state */
/* flag values: see vcl/outdev.hxx */
- void Push( USHORT nFlags = 0xffff );
+ void Push( sal_uInt16 nFlags = 0xffff );
void Pop();
void SetClipRegion();
@@ -676,9 +717,9 @@ The following structure describes the permissions used in PDF security
void IntersectClipRegion( const Rectangle& rRect );
void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
- void SetAntialiasing( USHORT nMode = 0 );
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
- void SetLayoutMode( ULONG nMode );
+ void SetLayoutMode( sal_uLong nMode );
void SetDigitLanguage( LanguageType eLang );
void SetLineColor( const Color& rColor );
@@ -709,16 +750,16 @@ The following structure describes the permissions used in PDF security
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove = FALSE );
+ sal_Bool bUnderlineAbove = sal_False );
void DrawTextArray( const Point& rStartPt, const XubString& rStr,
const sal_Int32* pDXAry = NULL,
xub_StrLen nIndex = 0,
xub_StrLen nLen = STRING_LEN );
- void DrawStretchText( const Point& rStartPt, ULONG nWidth,
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
void DrawText( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle = 0 );
+ const XubString& rStr, sal_uInt16 nStyle = 0 );
void DrawPixel( const Point& rPt, const Color& rColor );
void DrawPixel( const Point& rPt )
@@ -738,7 +779,7 @@ The following structure describes the permissions used in PDF security
void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
@@ -778,7 +819,7 @@ The following structure describes the permissions used in PDF security
void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
void DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent );
+ sal_uInt16 nTransparencePercent );
/** Start a transparency group
@@ -811,7 +852,7 @@ The following structure describes the permissions used in PDF security
@param nTransparencePercent
The transparency factor
*/
- void EndTransparencyGroup( const Rectangle& rBoundRect, USHORT nTransparencePercent );
+ void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
/** End a transparency group with an alpha mask
diff --git a/vcl/inc/vcl/pointr.hxx b/vcl/inc/vcl/pointr.hxx
index f003300b1f56..d5d2a49b33f0 100644
--- a/vcl/inc/vcl/pointr.hxx
+++ b/vcl/inc/vcl/pointr.hxx
@@ -51,9 +51,9 @@ public:
PointerStyle GetStyle() const { return meStyle; }
- BOOL operator==( const Pointer& rPointer ) const
+ sal_Bool operator==( const Pointer& rPointer ) const
{ return (meStyle == rPointer.meStyle); }
- BOOL operator!=( const Pointer& rPointer ) const
+ sal_Bool operator!=( const Pointer& rPointer ) const
{ return !(Pointer::operator==( rPointer )); }
};
diff --git a/vcl/inc/vcl/polyscan.hxx b/vcl/inc/vcl/polyscan.hxx
index a8d9b6a31b5a..da91477f6a67 100644
--- a/vcl/inc/vcl/polyscan.hxx
+++ b/vcl/inc/vcl/polyscan.hxx
@@ -90,26 +90,26 @@ public:
void Set( long nStart, long nEnd );
void Set( const PolyScanSegment& rSegment ) { Set( rSegment.mnStart, rSegment.mnEnd ); }
- inline BOOL GetFirstX( long& rX );
- inline BOOL GetNextX( long& rX );
+ inline sal_Bool GetFirstX( long& rX );
+ inline sal_Bool GetNextX( long& rX );
- BOOL GetFirstSegment( PolyScanSegment& rSegment );
- BOOL GetNextSegment( PolyScanSegment& rSegment );
+ sal_Bool GetFirstSegment( PolyScanSegment& rSegment );
+ sal_Bool GetNextSegment( PolyScanSegment& rSegment );
};
// ------------------------------------------------------------------------
-inline BOOL PolyScanline::GetFirstX( long& rX )
+inline sal_Bool PolyScanline::GetFirstX( long& rX )
{
mpAct = mpFirst;
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
}
// ------------------------------------------------------------------------
-inline BOOL PolyScanline::GetNextX( long& rX )
+inline sal_Bool PolyScanline::GetNextX( long& rX )
{
- return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, TRUE ) : FALSE );
+ return( mpAct ? ( rX = mpAct->mnX, mpAct = mpAct->mpNext, sal_True ) : sal_False );
}
// ---------------
@@ -149,8 +149,8 @@ public:
Rectangle GetBoundRect() const { return Rectangle( mnLeft, mnTop, mnRight, mnBottom ); }
- ULONG Count() const { return Height(); }
- PolyScanline* operator[]( ULONG nPos ) const;
+ sal_uLong Count() const { return Height(); }
+ PolyScanline* operator[]( sal_uLong nPos ) const;
};
#endif // _SV_POLYSCAN_HXX
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index e5ebf05c9415..846835e22d3b 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -154,7 +154,7 @@ private:
// some basic attributes
bool m_bColorDevice;
bool m_bType42Capable;
- ULONG m_nLanguageLevel;
+ sal_uLong m_nLanguageLevel;
rtl_TextEncoding m_aFileEncoding;
@@ -216,7 +216,7 @@ public:
bool isColorDevice() const { return m_bColorDevice; }
bool isType42Capable() const { return m_bType42Capable; }
- ULONG getLanguageLevel() const { return m_nLanguageLevel; }
+ sal_uLong getLanguageLevel() const { return m_nLanguageLevel; }
String getDefaultPaperDimension() const;
void getDefaultPaperDimension( int& rWidth, int& rHeight ) const
@@ -324,8 +324,8 @@ public:
void getUnconstrainedValues( const PPDKey*, ::std::list< const PPDValue* >& rValues );
// for printer setup
- void* getStreamableBuffer( ULONG& rBytes ) const;
- void rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes );
+ void* getStreamableBuffer( sal_uLong& rBytes ) const;
+ void rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes );
// convenience
int getRenderResolution() const;
diff --git a/vcl/inc/vcl/print.h b/vcl/inc/vcl/print.h
index 4fe4722714c4..db236f2a0f17 100644
--- a/vcl/inc/vcl/print.h
+++ b/vcl/inc/vcl/print.h
@@ -56,7 +56,7 @@ struct ImplPrnQueueData
// - ImplPrnQueueList -
// --------------------
-class VCL_DLLPUBLIC ImplPrnQueueList
+class VCL_PLUGIN_PUBLIC ImplPrnQueueList
{
public:
boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash >
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 8214f3425848..182258aeb3c1 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -77,18 +77,18 @@ class VCL_DLLPUBLIC PrinterPage
{
GDIMetaFile* mpMtf;
JobSetup maJobSetup;
- UINT16 mbNewJobSetup;
+ sal_uInt16 mbNewJobSetup;
public:
PrinterPage() : mpMtf( new GDIMetaFile() ) {}
- PrinterPage( GDIMetaFile* pMtf, BOOL bNewJobSetup, const JobSetup& rSetup ) :
+ PrinterPage( GDIMetaFile* pMtf, sal_Bool bNewJobSetup, const JobSetup& rSetup ) :
mpMtf( pMtf ), maJobSetup( rSetup ), mbNewJobSetup( bNewJobSetup ) {}
~PrinterPage() { delete mpMtf; }
GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
const JobSetup& GetJobSetup() const { return maJobSetup; }
- BOOL IsNewJobSetup() const { return (mbNewJobSetup != 0); }
+ sal_Bool IsNewJobSetup() const { return (mbNewJobSetup != 0); }
friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const PrinterPage& rPage )
{ rOStm << rPage.mbNewJobSetup; rOStm << rPage.maJobSetup; rPage.mpMtf->Write( rOStm ); return rOStm; }
@@ -164,51 +164,56 @@ class VCL_DLLPUBLIC PrinterOptions
{
private:
- BOOL mbReduceTransparency;
+ sal_Bool mbReduceTransparency;
PrinterTransparencyMode meReducedTransparencyMode;
- BOOL mbReduceGradients;
+ sal_Bool mbReduceGradients;
PrinterGradientMode meReducedGradientsMode;
- USHORT mnReducedGradientStepCount;
- BOOL mbReduceBitmaps;
+ sal_uInt16 mnReducedGradientStepCount;
+ sal_Bool mbReduceBitmaps;
PrinterBitmapMode meReducedBitmapMode;
- USHORT mnReducedBitmapResolution;
- BOOL mbReducedBitmapsIncludeTransparency;
- BOOL mbConvertToGreyscales;
+ sal_uInt16 mnReducedBitmapResolution;
+ sal_Bool mbReducedBitmapsIncludeTransparency;
+ sal_Bool mbConvertToGreyscales;
public:
PrinterOptions();
~PrinterOptions();
- BOOL IsReduceTransparency() const { return mbReduceTransparency; }
- void SetReduceTransparency( BOOL bSet ) { mbReduceTransparency = bSet; }
+ sal_Bool IsReduceTransparency() const { return mbReduceTransparency; }
+ void SetReduceTransparency( sal_Bool bSet ) { mbReduceTransparency = bSet; }
PrinterTransparencyMode GetReducedTransparencyMode() const { return meReducedTransparencyMode; }
void SetReducedTransparencyMode( PrinterTransparencyMode eMode ) { meReducedTransparencyMode = eMode; }
- BOOL IsReduceGradients() const { return mbReduceGradients; }
- void SetReduceGradients( BOOL bSet ) { mbReduceGradients = bSet; }
+ sal_Bool IsReduceGradients() const { return mbReduceGradients; }
+ void SetReduceGradients( sal_Bool bSet ) { mbReduceGradients = bSet; }
PrinterGradientMode GetReducedGradientMode() const { return meReducedGradientsMode; }
void SetReducedGradientMode( PrinterGradientMode eMode ) { meReducedGradientsMode = eMode; }
- USHORT GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
- void SetReducedGradientStepCount( USHORT nStepCount ) { mnReducedGradientStepCount = nStepCount; }
+ sal_uInt16 GetReducedGradientStepCount() const { return mnReducedGradientStepCount; }
+ void SetReducedGradientStepCount( sal_uInt16 nStepCount ) { mnReducedGradientStepCount = nStepCount; }
- BOOL IsReduceBitmaps() const { return mbReduceBitmaps; }
- void SetReduceBitmaps( BOOL bSet ) { mbReduceBitmaps = bSet; }
+ sal_Bool IsReduceBitmaps() const { return mbReduceBitmaps; }
+ void SetReduceBitmaps( sal_Bool bSet ) { mbReduceBitmaps = bSet; }
PrinterBitmapMode GetReducedBitmapMode() const { return meReducedBitmapMode; }
void SetReducedBitmapMode( PrinterBitmapMode eMode ) { meReducedBitmapMode = eMode; }
- USHORT GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
- void SetReducedBitmapResolution( USHORT nResolution ) { mnReducedBitmapResolution = nResolution; }
+ sal_uInt16 GetReducedBitmapResolution() const { return mnReducedBitmapResolution; }
+ void SetReducedBitmapResolution( sal_uInt16 nResolution ) { mnReducedBitmapResolution = nResolution; }
- BOOL IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
- void SetReducedBitmapIncludesTransparency( BOOL bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
+ sal_Bool IsReducedBitmapIncludesTransparency() const { return mbReducedBitmapsIncludeTransparency; }
+ void SetReducedBitmapIncludesTransparency( sal_Bool bSet ) { mbReducedBitmapsIncludeTransparency = bSet; }
- BOOL IsConvertToGreyscales() const { return mbConvertToGreyscales; }
- void SetConvertToGreyscales( BOOL bSet ) { mbConvertToGreyscales = bSet; }
+ sal_Bool IsConvertToGreyscales() const { return mbConvertToGreyscales; }
+ void SetConvertToGreyscales( sal_Bool bSet ) { mbConvertToGreyscales = bSet; }
+
+ // read printer options from configuration, parameter decides whether the set for
+ // print "to printer" or "to file" should be read.
+ // returns true if config was read, false if an error occured
+ bool ReadFromConfig( bool bFile );
};
// -----------
@@ -235,21 +240,21 @@ private:
JobSetup maJobSetup;
Point maPageOffset;
Size maPaperSize;
- ULONG mnError;
- USHORT mnCurPage;
- USHORT mnCurPrintPage;
- USHORT mnPageQueueSize;
- USHORT mnCopyCount;
- BOOL mbDefPrinter;
- BOOL mbPrinting;
- BOOL mbJobActive;
- BOOL mbCollateCopy;
- BOOL mbPrintFile;
- BOOL mbInPrintPage;
- BOOL mbNewJobSetup;
- BOOL mbIsQueuePrinter;
- BOOL mbUserSetupCompleted;
- BOOL mbUserSetupResult;
+ sal_uLong mnError;
+ sal_uInt16 mnCurPage;
+ sal_uInt16 mnCurPrintPage;
+ sal_uInt16 mnPageQueueSize;
+ sal_uInt16 mnCopyCount;
+ sal_Bool mbDefPrinter;
+ sal_Bool mbPrinting;
+ sal_Bool mbJobActive;
+ sal_Bool mbCollateCopy;
+ sal_Bool mbPrintFile;
+ sal_Bool mbInPrintPage;
+ sal_Bool mbNewJobSetup;
+ sal_Bool mbIsQueuePrinter;
+ sal_Bool mbUserSetupCompleted;
+ sal_Bool mbUserSetupResult;
Link maErrorHdl;
SAL_DLLPRIVATE void ImplInitData();
@@ -264,11 +269,11 @@ private:
SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
- static SAL_DLLPRIVATE ULONG ImplSalPrinterErrorCodeToVCL( ULONG nError );
+ static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError );
private:
SAL_DLLPRIVATE void ImplEndPrint();
- SAL_DLLPRIVATE BOOL EndJob();
+ SAL_DLLPRIVATE sal_Bool EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
public:
@@ -280,8 +285,8 @@ public:
protected:
- void SetSelfAsQueuePrinter( BOOL bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
- BOOL IsQueuePrinter() const { return mbIsQueuePrinter; }
+ void SetSelfAsQueuePrinter( sal_Bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
+ sal_Bool IsQueuePrinter() const { return mbIsQueuePrinter; }
public:
Printer();
@@ -299,68 +304,72 @@ public:
const XubString& GetName() const { return maPrinterName; }
const XubString& GetDriverName() const { return maDriver; }
- BOOL IsDefPrinter() const { return mbDefPrinter; }
- BOOL IsDisplayPrinter() const { return mpDisplayDev != NULL; }
- BOOL IsValid() const { return !IsDisplayPrinter(); }
+ sal_Bool IsDefPrinter() const { return mbDefPrinter; }
+ sal_Bool IsDisplayPrinter() const { return mpDisplayDev != NULL; }
+ sal_Bool IsValid() const { return !IsDisplayPrinter(); }
- ULONG GetCapabilities( USHORT nType ) const;
- BOOL HasSupport( PrinterSupport eFeature ) const;
+ sal_uLong GetCapabilities( sal_uInt16 nType ) const;
+ sal_Bool HasSupport( PrinterSupport eFeature ) const;
- BOOL SetJobSetup( const JobSetup& rSetup );
+ sal_Bool SetJobSetup( const JobSetup& rSetup );
const JobSetup& GetJobSetup() const { return maJobSetup; }
String GetJobValue( const String& rKey ) const { return maJobSetup.GetValue( rKey ); }
void SetJobValue( const String& rKey, const String& rValue ) { maJobSetup.SetValue( rKey, rValue ); }
- BOOL Setup( Window* pWindow = NULL );
- BOOL SetPrinterProps( const Printer* pPrinter );
+ sal_Bool Setup( Window* pWindow = NULL );
+ sal_Bool SetPrinterProps( const Printer* pPrinter );
- void SetPrinterOptions( const PrinterOptions& rOptions ) { *mpPrinterOptions = rOptions; }
+ // SetPrinterOptions is used internally only now
+ // in earlier times it was used only to set the options loaded directly from the configuration
+ // in SfxPrinter::InitJob, this is now handled internally
+ // should the need arise to set the printer options outside vcl, also a method would have to be devised
+ // to not override these again internally
+ SAL_DLLPRIVATE void SetPrinterOptions( const PrinterOptions& rOptions );
const PrinterOptions& GetPrinterOptions() const { return( *mpPrinterOptions ); }
- BOOL SetOrientation( Orientation eOrient );
+ sal_Bool SetOrientation( Orientation eOrient );
Orientation GetOrientation() const;
DuplexMode GetDuplexMode() const;
- BOOL SetDuplexMode( DuplexMode );
+ sal_Bool SetDuplexMode( DuplexMode );
// returns the angle that a landscape page will be turned counterclockwise
// wrt to portrait. The return value may be only valid for
// the current paper
int GetLandscapeAngle() const;
- BOOL SetPaperBin( USHORT nPaperBin );
- USHORT GetPaperBin() const;
- BOOL SetPaper( Paper ePaper );
- BOOL SetPaperSizeUser( const Size& rSize );
- BOOL SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
+ sal_Bool SetPaperBin( sal_uInt16 nPaperBin );
+ sal_uInt16 GetPaperBin() const;
+ sal_Bool SetPaper( Paper ePaper );
+ sal_Bool SetPaperSizeUser( const Size& rSize );
+ sal_Bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
Paper GetPaper() const;
+ static rtl::OUString GetPaperName( Paper ePaper );
+ // return a UI string for the current paper; i_bPaperUser == false means an empty string for PAPER_USER
+ rtl::OUString GetPaperName( bool i_bPaperUser = true ) const;
// returns number of available paper formats
int GetPaperInfoCount() const;
// returns info about paper format nPaper
const PaperInfo& GetPaperInfo( int nPaper ) const;
- USHORT GetPaperBinCount() const;
- XubString GetPaperBinName( USHORT nPaperBin ) const;
+ sal_uInt16 GetPaperBinCount() const;
+ XubString GetPaperBinName( sal_uInt16 nPaperBin ) const;
const Size& GetPaperSizePixel() const { return maPaperSize; }
Size GetPaperSize() const { return PixelToLogic( maPaperSize ); }
const Point& GetPageOffsetPixel() const { return maPageOffset; }
Point GetPageOffset() const { return PixelToLogic( maPageOffset ); }
- BOOL SetCopyCount( USHORT nCopy, BOOL bCollate = FALSE );
- USHORT GetCopyCount() const { return mnCopyCount; }
- BOOL IsCollateCopy() const { return mbCollateCopy; }
+ sal_Bool SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate = sal_False );
+ sal_uInt16 GetCopyCount() const { return mnCopyCount; }
+ sal_Bool IsCollateCopy() const { return mbCollateCopy; }
- BOOL IsPrinting() const { return mbPrinting; }
+ sal_Bool IsPrinting() const { return mbPrinting; }
- void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; }
- const XubString& GetPrintFile() const { return maPrintFile; }
- void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; }
- BOOL IsPrintFileEnabled() const { return mbPrintFile; }
- BOOL AbortJob();
+ sal_Bool AbortJob();
const XubString& GetCurJobName() const { return maJobName; }
- USHORT GetCurPage() const { return mnCurPage; }
- BOOL IsJobActive() const { return mbJobActive; }
+ sal_uInt16 GetCurPage() const { return mnCurPage; }
+ sal_Bool IsJobActive() const { return mbJobActive; }
- ULONG GetError() const { return ERRCODE_TOERROR(mnError); }
- ULONG GetErrorCode() const { return mnError; }
+ sal_uLong GetError() const { return ERRCODE_TOERROR(mnError); }
+ sal_uLong GetErrorCode() const { return mnError; }
void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
const Link& GetErrorHdl() const { return maErrorHdl; }
@@ -401,7 +410,7 @@ protected:
PrinterController( const boost::shared_ptr<Printer>& );
public:
enum NupOrderType
- { LRTB, TBLR };
+ { LRTB, TBLR, TBRL, RLTB };
struct MultiPageSetup
{
// all metrics in 100th mm
@@ -479,6 +488,7 @@ public:
*/
void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
+ bool isUIChoiceEnabled( const rtl::OUString& rPropName, sal_Int32 nChoice ) const;
/* returns the property name rPropName depends on or an empty string
if no dependency exists.
*/
@@ -514,27 +524,31 @@ public:
bool isDirectPrint() const;
// implementation details, not usable outside vcl
- SAL_DLLPRIVATE int getFilteredPageCount();
+ // don't use outside vcl. Some of these are exported for
+ // the benefit of vcl's plugins.
+ // Still: DO NOT USE OUTSIDE VCL
+ VCL_PLUGIN_PUBLIC int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- SAL_DLLPRIVATE PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
- SAL_DLLPRIVATE void createProgressDialog();
- SAL_DLLPRIVATE bool isProgressCanceled() const;
+ VCL_PLUGIN_PUBLIC void createProgressDialog();
+ VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
+ VCL_PLUGIN_PUBLIC void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- SAL_DLLPRIVATE void setJobState( com::sun::star::view::PrintableState );
+ VCL_PLUGIN_PUBLIC void setJobState( com::sun::star::view::PrintableState );
SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
SAL_DLLPRIVATE int getPageCountProtected() const;
SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const;
- SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE sal_uLong removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
+ SAL_DLLPRIVATE void resetPrinterOptions( bool i_bFileOutput );
};
class VCL_DLLPUBLIC PrinterOptionsHelper
@@ -617,28 +631,34 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
, mbEnabled( i_bEnabled ) {}
};
+ // note: in the following helper functions HelpIds are expected as an rtl::OUString
+ // the normal HelpId form is rtl::OString (byte string instead of UTF16 string)
+ // this is because the whole interface is base on UNO properties; in fact the structures
+ // are passed over UNO interfaces. UNO does not know a byte string, hence the string is
+ // transported via UTF16 strings.
+
// general control
static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rType,
const com::sun::star::beans::PropertyValue* i_pValue = NULL,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a group (e.g. a TabPage); following controls will be grouped in it until the next
// group begins
- static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
+ static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId );
// create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next
// subgroup or group begins
// setting bJobPage = true will make the subgroup appear on the first page of the print dialog
static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create a bool option (usually a checkbox)
static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
@@ -646,18 +666,19 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a set of choices (either a radio button group or a list box)
static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
// create an integer range (e.g. a spin field)
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue = -1,
@@ -668,7 +689,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
// create a string field
// note: max value < min value means do not apply min/max values
static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const UIControlOptions& i_rControlOptions = UIControlOptions()
diff --git a/vcl/inc/vcl/printergfx.hxx b/vcl/inc/vcl/printergfx.hxx
index fb1df7c94498..8bfd1c69a7d2 100644
--- a/vcl/inc/vcl/printergfx.hxx
+++ b/vcl/inc/vcl/printergfx.hxx
@@ -365,14 +365,14 @@ public:
const Point** pPolygonList);
void DrawPolyLineBezier (sal_uInt32 nPoints,
const Point* pPath,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
void DrawPolygonBezier (sal_uInt32 nPoints,
const Point* pPath,
- const BYTE* pFlgAry);
+ const sal_uInt8* pFlgAry);
void DrawPolyPolygonBezier (sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const Point* const* pPtAry,
- const BYTE* const* pFlgAry);
+ const sal_uInt8* const* pFlgAry);
// eps
sal_Bool DrawEPS ( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize);
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index 665f51933688..b6ebc072b8cf 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -157,6 +157,8 @@ public:
// there can only be one
static PrinterInfoManager& get();
+ // only called by SalData destructor, frees the global instance
+ static void release();
// get PrinterInfoManager type
Type getType() const { return m_eType; }
@@ -217,8 +219,10 @@ public:
// this may either be a regular file or the result of popen()
virtual FILE* startSpool( const rtl::OUString& rPrinterName, bool bQuickCommand );
// close the FILE* returned by startSpool and does the actual spooling
+ // set bBanner to "false" will attempt to suppress banner printing
+ // set bBanner to "true" will rely on the system default
// returns a numerical job id
- virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData );
+ virtual int endSpool( const rtl::OUString& rPrinterName, const rtl::OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
// for spadmin: whether adding or removing a printer is possible
virtual bool addOrRemovePossible() const;
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index 7549d1e5ea5e..247998303178 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -60,6 +60,9 @@ namespace vcl
VirtualDevice maPageVDev;
rtl::OUString maReplacementString;
rtl::OUString maToolTipString;
+ bool mbGreyscale;
+ FixedLine maHorzDim;
+ FixedLine maVertDim;
public:
PrintPreviewWindow( Window* pParent, const ResId& );
@@ -70,8 +73,11 @@ namespace vcl
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& );
- void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
- sal_Int32 i_nDPIX, sal_Int32 i_nDPIY
+ void setPreview( const GDIMetaFile&, const Size& i_rPaperSize,
+ const rtl::OUString& i_rPaperName,
+ const rtl::OUString& i_rNoPageString,
+ sal_Int32 i_nDPIX, sal_Int32 i_nDPIY,
+ bool i_bGreyscale
);
};
@@ -126,7 +132,6 @@ namespace vcl
// border around each page
CheckBox maBorderCB;
- vcl::RowOrColumn maLayout;
boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
@@ -142,7 +147,7 @@ namespace vcl
void showAdvancedControls( bool );
- virtual void Resize();
+ // virtual void Resize();
};
class JobTabPage : public TabPage
@@ -166,13 +171,13 @@ namespace vcl
NumericField maCopyCountField;
CheckBox maCollateBox;
FixedImage maCollateImage;
+ CheckBox maReverseOrderBox;
Image maCollateImg;
Image maNoCollateImg;
long mnCollateUIMode;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
boost::shared_ptr<vcl::WindowArranger> mxDetails;
@@ -182,7 +187,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -193,9 +198,7 @@ namespace vcl
FixedLine maOptionsLine;
CheckBox maToFileBox;
CheckBox maCollateSingleJobsBox;
- CheckBox maReverseOrderBox;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
OutputOptPage( Window*, const ResId& );
@@ -204,7 +207,7 @@ namespace vcl
void readFromSettings();
void storeToSettings();
- virtual void Resize();
+ // virtual void Resize();
void setupLayout();
};
@@ -249,7 +252,6 @@ namespace vcl
rtl::OUString maPrintText;
rtl::OUString maDefPrtText;
- vcl::RowOrColumn maLayout;
boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
Size maDetailsCollapsedSize;
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 086cc7314c7b..13d87a94d3ac 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -49,49 +49,50 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
// - QueueInfo-Types -
// -------------------
-#define QUEUE_STATUS_READY ((ULONG)0x00000001)
-#define QUEUE_STATUS_PAUSED ((ULONG)0x00000002)
-#define QUEUE_STATUS_PENDING_DELETION ((ULONG)0x00000004)
-#define QUEUE_STATUS_BUSY ((ULONG)0x00000008)
-#define QUEUE_STATUS_INITIALIZING ((ULONG)0x00000010)
-#define QUEUE_STATUS_WAITING ((ULONG)0x00000020)
-#define QUEUE_STATUS_WARMING_UP ((ULONG)0x00000040)
-#define QUEUE_STATUS_PROCESSING ((ULONG)0x00000080)
-#define QUEUE_STATUS_PRINTING ((ULONG)0x00000100)
-#define QUEUE_STATUS_OFFLINE ((ULONG)0x00000200)
-#define QUEUE_STATUS_ERROR ((ULONG)0x00000400)
-#define QUEUE_STATUS_SERVER_UNKNOWN ((ULONG)0x00000800)
-#define QUEUE_STATUS_PAPER_JAM ((ULONG)0x00001000)
-#define QUEUE_STATUS_PAPER_OUT ((ULONG)0x00002000)
-#define QUEUE_STATUS_MANUAL_FEED ((ULONG)0x00004000)
-#define QUEUE_STATUS_PAPER_PROBLEM ((ULONG)0x00008000)
-#define QUEUE_STATUS_IO_ACTIVE ((ULONG)0x00010000)
-#define QUEUE_STATUS_OUTPUT_BIN_FULL ((ULONG)0x00020000)
-#define QUEUE_STATUS_TONER_LOW ((ULONG)0x00040000)
-#define QUEUE_STATUS_NO_TONER ((ULONG)0x00080000)
-#define QUEUE_STATUS_PAGE_PUNT ((ULONG)0x00100000)
-#define QUEUE_STATUS_USER_INTERVENTION ((ULONG)0x00200000)
-#define QUEUE_STATUS_OUT_OF_MEMORY ((ULONG)0x00400000)
-#define QUEUE_STATUS_DOOR_OPEN ((ULONG)0x00800000)
-#define QUEUE_STATUS_POWER_SAVE ((ULONG)0x01000000)
+#define QUEUE_STATUS_READY ((sal_uLong)0x00000001)
+#define QUEUE_STATUS_PAUSED ((sal_uLong)0x00000002)
+#define QUEUE_STATUS_PENDING_DELETION ((sal_uLong)0x00000004)
+#define QUEUE_STATUS_BUSY ((sal_uLong)0x00000008)
+#define QUEUE_STATUS_INITIALIZING ((sal_uLong)0x00000010)
+#define QUEUE_STATUS_WAITING ((sal_uLong)0x00000020)
+#define QUEUE_STATUS_WARMING_UP ((sal_uLong)0x00000040)
+#define QUEUE_STATUS_PROCESSING ((sal_uLong)0x00000080)
+#define QUEUE_STATUS_PRINTING ((sal_uLong)0x00000100)
+#define QUEUE_STATUS_OFFLINE ((sal_uLong)0x00000200)
+#define QUEUE_STATUS_ERROR ((sal_uLong)0x00000400)
+#define QUEUE_STATUS_SERVER_UNKNOWN ((sal_uLong)0x00000800)
+#define QUEUE_STATUS_PAPER_JAM ((sal_uLong)0x00001000)
+#define QUEUE_STATUS_PAPER_OUT ((sal_uLong)0x00002000)
+#define QUEUE_STATUS_MANUAL_FEED ((sal_uLong)0x00004000)
+#define QUEUE_STATUS_PAPER_PROBLEM ((sal_uLong)0x00008000)
+#define QUEUE_STATUS_IO_ACTIVE ((sal_uLong)0x00010000)
+#define QUEUE_STATUS_OUTPUT_BIN_FULL ((sal_uLong)0x00020000)
+#define QUEUE_STATUS_TONER_LOW ((sal_uLong)0x00040000)
+#define QUEUE_STATUS_NO_TONER ((sal_uLong)0x00080000)
+#define QUEUE_STATUS_PAGE_PUNT ((sal_uLong)0x00100000)
+#define QUEUE_STATUS_USER_INTERVENTION ((sal_uLong)0x00200000)
+#define QUEUE_STATUS_OUT_OF_MEMORY ((sal_uLong)0x00400000)
+#define QUEUE_STATUS_DOOR_OPEN ((sal_uLong)0x00800000)
+#define QUEUE_STATUS_POWER_SAVE ((sal_uLong)0x01000000)
-#define QUEUE_JOBS_DONTKNOW ((ULONG)0xFFFFFFFF)
+#define QUEUE_JOBS_DONTKNOW ((sal_uLong)0xFFFFFFFF)
// -----------------
// - Printer-Types -
// -----------------
-#define PRINTER_CAPABILITIES_SUPPORTDIALOG ((USHORT)1)
-#define PRINTER_CAPABILITIES_COPIES ((USHORT)2)
-#define PRINTER_CAPABILITIES_COLLATECOPIES ((USHORT)3)
-#define PRINTER_CAPABILITIES_SETORIENTATION ((USHORT)4)
-#define PRINTER_CAPABILITIES_SETPAPERBIN ((USHORT)5)
-#define PRINTER_CAPABILITIES_SETPAPERSIZE ((USHORT)6)
-#define PRINTER_CAPABILITIES_SETPAPER ((USHORT)7)
-#define PRINTER_CAPABILITIES_FAX ((USHORT)8)
-#define PRINTER_CAPABILITIES_PDF ((USHORT)9)
-#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((USHORT)10)
-#define PRINTER_CAPABILITIES_SETDUPLEX ((USHORT)11)
+#define PRINTER_CAPABILITIES_SUPPORTDIALOG ((sal_uInt16)1)
+#define PRINTER_CAPABILITIES_COPIES ((sal_uInt16)2)
+#define PRINTER_CAPABILITIES_COLLATECOPIES ((sal_uInt16)3)
+#define PRINTER_CAPABILITIES_SETORIENTATION ((sal_uInt16)4)
+#define PRINTER_CAPABILITIES_SETPAPERBIN ((sal_uInt16)5)
+#define PRINTER_CAPABILITIES_SETPAPERSIZE ((sal_uInt16)6)
+#define PRINTER_CAPABILITIES_SETPAPER ((sal_uInt16)7)
+#define PRINTER_CAPABILITIES_FAX ((sal_uInt16)8)
+#define PRINTER_CAPABILITIES_PDF ((sal_uInt16)9)
+#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((sal_uInt16)10)
+#define PRINTER_CAPABILITIES_SETDUPLEX ((sal_uInt16)11)
+#define PRINTER_CAPABILITIES_USEPULLMODEL ((sal_uInt16)12)
#endif // _SV_PRNTYPES_HXX
diff --git a/vcl/inc/vcl/ptrstyle.hxx b/vcl/inc/vcl/ptrstyle.hxx
index 75502de85823..1f6b375e81b5 100644
--- a/vcl/inc/vcl/ptrstyle.hxx
+++ b/vcl/inc/vcl/ptrstyle.hxx
@@ -35,7 +35,7 @@
// - Pointer-Types -
// -----------------
-typedef USHORT PointerStyle;
+typedef sal_uInt16 PointerStyle;
#define POINTER_ARROW ((PointerStyle)0)
#define POINTER_NULL ((PointerStyle)1)
diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx
new file mode 100644
index 000000000000..f70736428010
--- /dev/null
+++ b/vcl/inc/vcl/quickselectionengine.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef VCL_QUICKSELECTIONENGINE_HXX
+#define VCL_QUICKSELECTIONENGINE_HXX
+
+#include "dllapi.h"
+
+#include <tools/string.hxx>
+
+#include <memory>
+
+class KeyEvent;
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ typedef const void* StringEntryIdentifier;
+
+ //====================================================================
+ //= ISearchableStringList
+ //====================================================================
+ // TODO: consolidate this with ::vcl::IMnemonicEntryList
+ class SAL_NO_VTABLE VCL_DLLPUBLIC ISearchableStringList
+ {
+ public:
+ /** returns the current entry in the list of searchable strings.
+
+ Search operations will start with this entry.
+ */
+ virtual StringEntryIdentifier CurrentEntry( String& _out_entryText ) const = 0;
+
+ /** returns the next entry in the list.
+
+ The implementation is expected to wrap around. That is, if the given entry denotes the last
+ entry in the list, then NextEntry should return the first entry.
+ */
+ virtual StringEntryIdentifier NextEntry( StringEntryIdentifier _currentEntry, String& _out_entryText ) const = 0;
+
+ /** selects a given entry
+ */
+ virtual void SelectEntry( StringEntryIdentifier _entry ) = 0;
+ };
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ struct QuickSelectionEngine_Data;
+ class VCL_DLLPUBLIC QuickSelectionEngine
+ {
+ public:
+ QuickSelectionEngine( ISearchableStringList& _entryList );
+ ~QuickSelectionEngine();
+
+ bool HandleKeyEvent( const KeyEvent& _rKEvt );
+ void Reset();
+
+ private:
+ ::std::auto_ptr< QuickSelectionEngine_Data > m_pData;
+
+ private:
+ QuickSelectionEngine(); // never implemented
+ QuickSelectionEngine( const QuickSelectionEngine& ); // never implemented
+ QuickSelectionEngine& operator=( const QuickSelectionEngine& ); // never implemented
+ };
+
+//........................................................................
+} // namespace vcl
+//........................................................................
+
+#endif // VCL_QUICKSELECTIONENGINE_HXX
diff --git a/vcl/inc/vcl/regband.hxx b/vcl/inc/vcl/regband.hxx
index 39f0bd3b0a08..0ebacbdb93d4 100644
--- a/vcl/inc/vcl/regband.hxx
+++ b/vcl/inc/vcl/regband.hxx
@@ -58,7 +58,7 @@ struct ImplRegionBandSep
ImplRegionBandSep* mpNextSep;
long mnXLeft;
long mnXRight;
- BOOL mbRemoved;
+ sal_Bool mbRemoved;
};
enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL };
@@ -69,7 +69,7 @@ struct ImplRegionBandPoint
ImplRegionBandPoint* mpNextBandPoint;
long mnX;
long mnLineId;
- BOOL mbEndPoint;
+ sal_Bool mbEndPoint;
LineType meLineType;
};
@@ -86,7 +86,7 @@ public:
ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines
long mnYTop; // actual boundary of the band
long mnYBottom;
- BOOL mbTouched;
+ sal_Bool mbTouched;
// create y-band with boundaries
ImplRegionBand( long nYTop, long nYBottom );
@@ -111,14 +111,14 @@ public:
long GetXRightBoundary() const;
// combine overlapping bands
- BOOL OptimizeBand();
+ sal_Bool OptimizeBand();
// generate separations from lines and process
// union with existing separations
void ProcessPoints();
// insert point in the list for later processing
- BOOL InsertPoint( long nX, long nLineID,
- BOOL bEndPoint, LineType eLineType );
+ sal_Bool InsertPoint( long nX, long nLineID,
+ sal_Bool bEndPoint, LineType eLineType );
void Union( long nXLeft, long nXRight );
void Intersect( long nXLeft, long nXRight );
@@ -128,13 +128,13 @@ public:
void MoveX( long nHorzMove );
void ScaleX( double fHorzScale );
- BOOL IsInside( long nX );
- BOOL IsInside( long nLeft, long nRight );
- BOOL IsOver( long nLeft, long nRight );
+ sal_Bool IsInside( long nX );
+ sal_Bool IsInside( long nLeft, long nRight );
+ sal_Bool IsOver( long nLeft, long nRight );
- BOOL IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
+ sal_Bool IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); }
- BOOL operator==( const ImplRegionBand& rRegionBand ) const;
+ sal_Bool operator==( const ImplRegionBand& rRegionBand ) const;
/** Split the called band at the given vertical coordinate. After the
split the called band will cover the upper part not including nY.
diff --git a/vcl/inc/vcl/region.h b/vcl/inc/vcl/region.h
index 62c5e51db070..5814e981aac2 100644
--- a/vcl/inc/vcl/region.h
+++ b/vcl/inc/vcl/region.h
@@ -50,7 +50,7 @@ struct ImplRegionHandle
Region* mpRegion;
ImplRegionBand* mpCurrRectBand;
ImplRegionBandSep* mpCurrRectBandSep;
- BOOL mbFirst;
+ sal_Bool mbFirst;
};
// ------------------
@@ -73,8 +73,8 @@ public:
ImplRegionBase( int nCount = 1 ); // TODO: replace manual refcounting
virtual ~ImplRegionBase();
public:
- ULONG mnRefCount;
- ULONG mnRectCount;
+ sal_uIntPtr mnRefCount;
+ sal_uIntPtr mnRectCount;
PolyPolygon* mpPolyPoly;
basegfx::B2DPolyPolygon* mpB2DPolyPoly;
};
@@ -99,14 +99,14 @@ public:
void CreateBandRange( long nYTop, long nYBottom );
void InsertBands( long nYTop, long nYBottom );
- BOOL InsertSingleBand( ImplRegionBand* mpImplRegionBand,
+ sal_Bool InsertSingleBand( ImplRegionBand* mpImplRegionBand,
long nYBandPosition );
- BOOL InsertLine( const Point & rFirstPoint,
+ sal_Bool InsertLine( const Point & rFirstPoint,
const Point & rSecondPoint,
long nLineID );
- BOOL InsertPoint( const Point &rPoint,
+ sal_Bool InsertPoint( const Point &rPoint,
long nLineID,
- BOOL bEndPoint, LineType eLineType );
+ sal_Bool bEndPoint, LineType eLineType );
/** Insert one band either after another band or as the first or only
band. Both the forward as well as the backward links are updated.
@@ -126,7 +126,7 @@ public:
void XOr( long nLeft, long nTop, long nRight, long nBottom );
// remove emtpy rects
- BOOL OptimizeBandList();
+ sal_Bool OptimizeBandList();
friend SvStream& operator>>( SvStream& rIStm, Region& rRegion );
friend SvStream& operator<<( SvStream& rOStm, const Region& rRegion );
diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx
index 4a9c146a158c..f21cca472252 100644..100755
--- a/vcl/inc/vcl/region.hxx
+++ b/vcl/inc/vcl/region.hxx
@@ -70,14 +70,19 @@ private:
SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; }
- SAL_DLLPRIVATE BOOL ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
- SAL_DLLPRIVATE BOOL ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
SAL_DLLPRIVATE void ImplBeginAddRect( );
- SAL_DLLPRIVATE BOOL ImplAddRect( const Rectangle& rRect );
+ SAL_DLLPRIVATE sal_Bool ImplAddRect( const Rectangle& rRect );
SAL_DLLPRIVATE void ImplEndAddRect( );
+ SAL_DLLPRIVATE void ImplIntersectWithPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplExcludePolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplUnionPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplXOrPolyPolygon( const Region& );
+public: // public within vcl
+ VCL_PLUGIN_PUBLIC bool ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
+ VCL_PLUGIN_PUBLIC bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
#ifdef DBG_UTIL
friend const char* ImplDbgTestRegion( const void* pObj );
#endif
@@ -94,48 +99,48 @@ public:
void Move( long nHorzMove, long nVertMove );
void Scale( double fScaleX, double fScaleY );
- BOOL Union( const Rectangle& rRegion );
- BOOL Intersect( const Rectangle& rRegion );
- BOOL Exclude( const Rectangle& rRegion );
- BOOL XOr( const Rectangle& rRegion );
- BOOL Union( const Region& rRegion );
- BOOL Intersect( const Region& rRegion );
- BOOL Exclude( const Region& rRegion );
- BOOL XOr( const Region& rRegion );
+ sal_Bool Union( const Rectangle& rRegion );
+ sal_Bool Intersect( const Rectangle& rRegion );
+ sal_Bool Exclude( const Rectangle& rRegion );
+ sal_Bool XOr( const Rectangle& rRegion );
+ sal_Bool Union( const Region& rRegion );
+ sal_Bool Intersect( const Region& rRegion );
+ sal_Bool Exclude( const Region& rRegion );
+ sal_Bool XOr( const Region& rRegion );
RegionType GetType() const;
- BOOL IsEmpty() const { return GetType() == REGION_EMPTY; };
- BOOL IsNull() const { return GetType() == REGION_NULL; };
+ sal_Bool IsEmpty() const { return GetType() == REGION_EMPTY; };
+ sal_Bool IsNull() const { return GetType() == REGION_NULL; };
void SetEmpty();
void SetNull();
Rectangle GetBoundRect() const;
- BOOL HasPolyPolygon() const;
+ sal_Bool HasPolyPolygon() const;
PolyPolygon GetPolyPolygon() const;
- // returns an empty polypolygon in case HasPolyPolygon is FALSE
+ // returns an empty polypolygon in case HasPolyPolygon is sal_False
const basegfx::B2DPolyPolygon GetB2DPolyPolygon() const;
// returns a PolyPolygon either copied from the set PolyPolygon region
// or created from the constituent rectangles
basegfx::B2DPolyPolygon ConvertToB2DPolyPolygon();
- ULONG GetRectCount() const;
+ sal_uLong GetRectCount() const;
RegionHandle BeginEnumRects();
- BOOL GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
- BOOL GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
+ sal_Bool GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect );
+ sal_Bool GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect )
{ return GetEnumRects( hRegionHandle, rRect ); }
void EndEnumRects( RegionHandle hRegionHandle );
- BOOL IsInside( const Point& rPoint ) const;
- BOOL IsInside( const Rectangle& rRect ) const;
- BOOL IsOver( const Rectangle& rRect ) const;
+ sal_Bool IsInside( const Point& rPoint ) const;
+ sal_Bool IsInside( const Rectangle& rRect ) const;
+ sal_Bool IsOver( const Rectangle& rRect ) const;
Region& operator=( const Region& rRegion );
Region& operator=( const Rectangle& rRect );
- BOOL operator==( const Region& rRegion ) const;
- BOOL operator!=( const Region& rRegion ) const
+ sal_Bool operator==( const Region& rRegion ) const;
+ sal_Bool operator!=( const Region& rRegion ) const
{ return !(Region::operator==( rRegion )); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Region& rRegion );
diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx
deleted file mode 100644
index 7507c6607dbe..000000000000
--- a/vcl/inc/vcl/salatype.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_SALATYPE_HXX
-#define _SV_SALATYPE_HXX
-
-#include <vcl/sv.h>
-
-// ---------------------
-// - Application-Types -
-// ---------------------
-
-// Derzeit doppelt und in apptypes.hxx auch vorhanden
-
-#define INPUT_MOUSE 0x0001
-#define INPUT_KEYBOARD 0x0002
-#define INPUT_PAINT 0x0004
-#define INPUT_TIMER 0x0008
-#define INPUT_OTHER 0x0010
-#define INPUT_MOUSEANDKEYBOARD (INPUT_MOUSE | INPUT_KEYBOARD)
-#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER)
-
-#endif // _SV_SALATYPE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/salbmp.hxx b/vcl/inc/vcl/salbmp.hxx
index e2234323e80d..d880be0d6d37 100644
--- a/vcl/inc/vcl/salbmp.hxx
+++ b/vcl/inc/vcl/salbmp.hxx
@@ -39,26 +39,26 @@ class SalGraphics;
class BitmapPalette;
struct BitmapSystemData;
-class VCL_DLLPUBLIC SalBitmap
+class VCL_PLUGIN_PUBLIC SalBitmap
{
public:
SalBitmap() {}
virtual ~SalBitmap();
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal ) = 0;
virtual bool Create( const SalBitmap& rSalBmp ) = 0;
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics ) = 0;
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount ) = 0;
+ sal_uInt16 nNewBitCount ) = 0;
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false ) = 0;
virtual void Destroy() = 0;
virtual Size GetSize() const = 0;
- virtual USHORT GetBitCount() const = 0;
+ virtual sal_uInt16 GetBitCount() const = 0;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ) = 0;
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) = 0;
diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx
index 1721e201b1ae..111fdecda62d 100644
--- a/vcl/inc/vcl/salbtype.hxx
+++ b/vcl/inc/vcl/salbtype.hxx
@@ -43,9 +43,9 @@
// - Memory -
// ----------
-typedef BYTE* HPBYTE;
+typedef sal_uInt8* HPBYTE;
typedef HPBYTE Scanline;
-typedef const BYTE* ConstHPBYTE;
+typedef const sal_uInt8* ConstHPBYTE;
typedef ConstHPBYTE ConstScanline;
// ------------------
@@ -85,22 +85,22 @@ typedef ConstHPBYTE ConstScanline;
// ------------------------------------------------------------------
#define MASK_TO_COLOR( d_nVal, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS, d_Col ) \
-ULONG _def_cR = (BYTE) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
-ULONG _def_cG = (BYTE) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
-ULONG _def_cB = (BYTE) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
-d_Col = BitmapColor( (BYTE) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \
- (BYTE) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \
- (BYTE) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) );
+sal_uLong _def_cR = (sal_uInt8) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \
+sal_uLong _def_cG = (sal_uInt8) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \
+sal_uLong _def_cB = (sal_uInt8) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \
+d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \
+ (sal_uInt8) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \
+ (sal_uInt8) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) );
// ------------------------------------------------------------------
#define COLOR_TO_MASK( d_rCol, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS ) \
-( ( ( ( d_RS < 0L ) ? ( (UINT32) (d_rCol).GetRed() >> -d_RS ) : \
- ( (UINT32) (d_rCol).GetRed() << d_RS ) ) & d_RM ) | \
- ( ( ( d_GS < 0L ) ? ( (UINT32) (d_rCol).GetGreen() >> -d_GS ) : \
- ( (UINT32) (d_rCol).GetGreen() << d_GS ) ) & d_GM ) | \
- ( ( ( d_BS < 0L ) ? ( (UINT32) (d_rCol).GetBlue() >> -d_BS ) : \
- ( (UINT32) (d_rCol).GetBlue() << d_BS ) ) & d_BM ) )
+( ( ( ( d_RS < 0L ) ? ( (sal_uInt32) (d_rCol).GetRed() >> -d_RS ) : \
+ ( (sal_uInt32) (d_rCol).GetRed() << d_RS ) ) & d_RM ) | \
+ ( ( ( d_GS < 0L ) ? ( (sal_uInt32) (d_rCol).GetGreen() >> -d_GS ) : \
+ ( (sal_uInt32) (d_rCol).GetGreen() << d_GS ) ) & d_GM ) | \
+ ( ( ( d_BS < 0L ) ? ( (sal_uInt32) (d_rCol).GetBlue() >> -d_BS ) : \
+ ( (sal_uInt32) (d_rCol).GetBlue() << d_BS ) ) & d_BM ) )
// ---------------
// - BitmapColor -
@@ -117,53 +117,53 @@ private:
// !!! zugegriffen wird, darf diese Klasse weder
// !!! in der Groesse noch der Reihenfolge der
// !!! Member veraendert werden (KA 02.09.97)
- BYTE mcBlueOrIndex;
- BYTE mcGreen;
- BYTE mcRed;
- BYTE mbIndex;
+ sal_uInt8 mcBlueOrIndex;
+ sal_uInt8 mcGreen;
+ sal_uInt8 mcRed;
+ sal_uInt8 mbIndex;
public:
inline BitmapColor();
inline BitmapColor( const BitmapColor& rBitmapColor );
- inline BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue );
+ inline BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
inline BitmapColor( const Color& rColor );
- inline BitmapColor( BYTE cIndex );
+ inline BitmapColor( sal_uInt8 cIndex );
inline ~BitmapColor() {};
- inline BOOL operator==( const BitmapColor& rBitmapColor ) const;
- inline BOOL operator!=( const BitmapColor& rBitmapColor ) const;
+ inline sal_Bool operator==( const BitmapColor& rBitmapColor ) const;
+ inline sal_Bool operator!=( const BitmapColor& rBitmapColor ) const;
inline BitmapColor& operator=( const BitmapColor& rBitmapColor );
- inline BOOL IsIndex() const;
+ inline sal_Bool IsIndex() const;
- inline BYTE GetRed() const;
- inline void SetRed( BYTE cRed );
+ inline sal_uInt8 GetRed() const;
+ inline void SetRed( sal_uInt8 cRed );
- inline BYTE GetGreen() const;
- inline void SetGreen( BYTE cGreen );
+ inline sal_uInt8 GetGreen() const;
+ inline void SetGreen( sal_uInt8 cGreen );
- inline BYTE GetBlue() const;
- inline void SetBlue( BYTE cBlue );
+ inline sal_uInt8 GetBlue() const;
+ inline void SetBlue( sal_uInt8 cBlue );
- inline BYTE GetIndex() const;
- inline void SetIndex( BYTE cIndex );
+ inline sal_uInt8 GetIndex() const;
+ inline void SetIndex( sal_uInt8 cIndex );
operator Color() const;
- inline operator BYTE() const;
+ inline operator sal_uInt8() const;
- inline BYTE GetBlueOrIndex() const;
+ inline sal_uInt8 GetBlueOrIndex() const;
inline BitmapColor& Invert();
- inline BYTE GetLuminance() const;
- inline BitmapColor& IncreaseLuminance( BYTE cGreyInc );
- inline BitmapColor& DecreaseLuminance( BYTE cGreyDec );
+ inline sal_uInt8 GetLuminance() const;
+ inline BitmapColor& IncreaseLuminance( sal_uInt8 cGreyInc );
+ inline BitmapColor& DecreaseLuminance( sal_uInt8 cGreyDec );
- inline BitmapColor& Merge( const BitmapColor& rColor, BYTE cTransparency );
- inline BitmapColor& Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency );
+ inline BitmapColor& Merge( const BitmapColor& rColor, sal_uInt8 cTransparency );
+ inline BitmapColor& Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency );
- inline ULONG GetColorError( const BitmapColor& rBitmapColor ) const;
+ inline sal_uLong GetColorError( const BitmapColor& rBitmapColor ) const;
};
// ---------------
@@ -180,7 +180,7 @@ class VCL_DLLPUBLIC BitmapPalette
private:
BitmapColor* mpBitmapColor;
- USHORT mnCount;
+ sal_uInt16 mnCount;
public:
@@ -192,21 +192,21 @@ public:
inline BitmapPalette();
inline BitmapPalette( const BitmapPalette& rBitmapPalette );
- inline BitmapPalette( USHORT nCount );
+ inline BitmapPalette( sal_uInt16 nCount );
inline ~BitmapPalette();
inline BitmapPalette& operator=( const BitmapPalette& rBitmapPalette );
- inline BOOL operator==( const BitmapPalette& rBitmapPalette ) const;
- inline BOOL operator!=( const BitmapPalette& rBitmapPalette ) const;
- inline BOOL operator!();
+ inline sal_Bool operator==( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!=( const BitmapPalette& rBitmapPalette ) const;
+ inline sal_Bool operator!();
- inline USHORT GetEntryCount() const;
- inline void SetEntryCount( USHORT nCount );
+ inline sal_uInt16 GetEntryCount() const;
+ inline void SetEntryCount( sal_uInt16 nCount );
- inline const BitmapColor& operator[]( USHORT nIndex ) const;
- inline BitmapColor& operator[]( USHORT nIndex );
+ inline const BitmapColor& operator[]( sal_uInt16 nIndex ) const;
+ inline BitmapColor& operator[]( sal_uInt16 nIndex );
- inline USHORT GetBestIndex( const BitmapColor& rCol ) const;
+ inline sal_uInt16 GetBestIndex( const BitmapColor& rCol ) const;
bool IsGreyPalette() const;
};
@@ -216,29 +216,29 @@ public:
class VCL_DLLPUBLIC ColorMask
{
- ULONG mnRMask;
- ULONG mnGMask;
- ULONG mnBMask;
+ sal_uLong mnRMask;
+ sal_uLong mnGMask;
+ sal_uLong mnBMask;
long mnRShift;
long mnGShift;
long mnBShift;
- ULONG mnROrShift;
- ULONG mnGOrShift;
- ULONG mnBOrShift;
- ULONG mnROr;
- ULONG mnGOr;
- ULONG mnBOr;
+ sal_uLong mnROrShift;
+ sal_uLong mnGOrShift;
+ sal_uLong mnBOrShift;
+ sal_uLong mnROr;
+ sal_uLong mnGOr;
+ sal_uLong mnBOr;
- SAL_DLLPRIVATE inline long ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const;
+ SAL_DLLPRIVATE inline long ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const;
public:
- inline ColorMask( ULONG nRedMask = 0UL, ULONG nGreenMask = 0UL, ULONG nBlueMask = 0UL );
+ inline ColorMask( sal_uLong nRedMask = 0UL, sal_uLong nGreenMask = 0UL, sal_uLong nBlueMask = 0UL );
inline ~ColorMask() {}
- inline ULONG GetRedMask() const;
- inline ULONG GetGreenMask() const;
- inline ULONG GetBlueMask() const;
+ inline sal_uLong GetRedMask() const;
+ inline sal_uLong GetGreenMask() const;
+ inline sal_uLong GetBlueMask() const;
inline void GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
inline void SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
@@ -261,14 +261,14 @@ public:
struct VCL_DLLPUBLIC BitmapBuffer
{
- ULONG mnFormat;
+ sal_uLong mnFormat;
long mnWidth;
long mnHeight;
long mnScanlineSize;
- USHORT mnBitCount;
+ sal_uInt16 mnBitCount;
ColorMask maColorMask;
BitmapPalette maPalette;
- BYTE* mpBits;
+ sal_uInt8* mpBits;
BitmapBuffer(){}
~BitmapBuffer() {}
@@ -279,7 +279,7 @@ struct VCL_DLLPUBLIC BitmapBuffer
// ---------------------
VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- ULONG nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
+ sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
// ------------------------------------------------------------------
@@ -287,17 +287,17 @@ inline BitmapColor::BitmapColor() :
mcBlueOrIndex ( 0 ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( FALSE )
+ mbIndex ( sal_False )
{
}
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( BYTE cRed, BYTE cGreen, BYTE cBlue ) :
+inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) :
mcBlueOrIndex ( cBlue ),
mcGreen ( cGreen ),
mcRed ( cRed ),
- mbIndex ( FALSE )
+ mbIndex ( sal_False )
{
}
@@ -323,17 +323,17 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
// ------------------------------------------------------------------
-inline BitmapColor::BitmapColor( BYTE cIndex ) :
+inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
mcBlueOrIndex ( cIndex ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( TRUE )
+ mbIndex ( sal_True )
{
}
// ------------------------------------------------------------------
-inline BOOL BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
+inline sal_Bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
{
return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
( mbIndex ? rBitmapColor.mbIndex :
@@ -342,7 +342,7 @@ inline BOOL BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
// ------------------------------------------------------------------
-inline BOOL BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
+inline sal_Bool BitmapColor::operator!=( const BitmapColor& rBitmapColor ) const
{
return !( *this == rBitmapColor );
}
@@ -361,14 +361,14 @@ inline BitmapColor& BitmapColor::operator=( const BitmapColor& rBitmapColor )
// ------------------------------------------------------------------
-inline BOOL BitmapColor::IsIndex() const
+inline sal_Bool BitmapColor::IsIndex() const
{
return mbIndex;
}
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetRed() const
+inline sal_uInt8 BitmapColor::GetRed() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcRed;
@@ -376,7 +376,7 @@ inline BYTE BitmapColor::GetRed() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetRed( BYTE cRed )
+inline void BitmapColor::SetRed( sal_uInt8 cRed )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcRed = cRed;
@@ -384,7 +384,7 @@ inline void BitmapColor::SetRed( BYTE cRed )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetGreen() const
+inline sal_uInt8 BitmapColor::GetGreen() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcGreen;
@@ -392,7 +392,7 @@ inline BYTE BitmapColor::GetGreen() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetGreen( BYTE cGreen )
+inline void BitmapColor::SetGreen( sal_uInt8 cGreen )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcGreen = cGreen;
@@ -400,7 +400,7 @@ inline void BitmapColor::SetGreen( BYTE cGreen )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetBlue() const
+inline sal_uInt8 BitmapColor::GetBlue() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
return mcBlueOrIndex;
@@ -408,7 +408,7 @@ inline BYTE BitmapColor::GetBlue() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetBlue( BYTE cBlue )
+inline void BitmapColor::SetBlue( sal_uInt8 cBlue )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = cBlue;
@@ -416,7 +416,7 @@ inline void BitmapColor::SetBlue( BYTE cBlue )
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetIndex() const
+inline sal_uInt8 BitmapColor::GetIndex() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -424,7 +424,7 @@ inline BYTE BitmapColor::GetIndex() const
// ------------------------------------------------------------------
-inline void BitmapColor::SetIndex( BYTE cIndex )
+inline void BitmapColor::SetIndex( sal_uInt8 cIndex )
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
mcBlueOrIndex = cIndex;
@@ -440,7 +440,7 @@ inline BitmapColor::operator Color() const
// ------------------------------------------------------------------
-inline BitmapColor::operator BYTE() const
+inline BitmapColor::operator sal_uInt8() const
{
DBG_ASSERT( mbIndex, "Pixel represents color values!" );
return mcBlueOrIndex;
@@ -448,7 +448,7 @@ inline BitmapColor::operator BYTE() const
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetBlueOrIndex() const
+inline sal_uInt8 BitmapColor::GetBlueOrIndex() const
{
// #i47518# Yield a value regardless of mbIndex
return mcBlueOrIndex;
@@ -466,39 +466,39 @@ inline BitmapColor& BitmapColor::Invert()
// ------------------------------------------------------------------
-inline BYTE BitmapColor::GetLuminance() const
+inline sal_uInt8 BitmapColor::GetLuminance() const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- return( (BYTE) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
+ return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::IncreaseLuminance( BYTE cGreyInc )
+inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
- mcGreen = (BYTE) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
- mcRed = (BYTE) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex + cGreyInc, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen + cGreyInc, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed + cGreyInc, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::DecreaseLuminance( BYTE cGreyDec )
+inline BitmapColor& BitmapColor::DecreaseLuminance( sal_uInt8 cGreyDec )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
- mcBlueOrIndex = (BYTE) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
- mcGreen = (BYTE) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
- mcRed = (BYTE) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
+ mcBlueOrIndex = (sal_uInt8) MinMax( (long) mcBlueOrIndex - cGreyDec, 0L, 255L );
+ mcGreen = (sal_uInt8) MinMax( (long) mcGreen - cGreyDec, 0L, 255L );
+ mcRed = (sal_uInt8) MinMax( (long) mcRed - cGreyDec, 0L, 255L );
return *this;
}
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, BYTE cTransparency )
+inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uInt8 cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
@@ -511,7 +511,7 @@ inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, BYTE cT
// ------------------------------------------------------------------
-inline BitmapColor& BitmapColor::Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTransparency )
+inline BitmapColor& BitmapColor::Merge( sal_uInt8 cR, sal_uInt8 cG, sal_uInt8 cB, sal_uInt8 cTransparency )
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
mcBlueOrIndex = COLOR_CHANNEL_MERGE( mcBlueOrIndex, cB, cTransparency );
@@ -523,11 +523,11 @@ inline BitmapColor& BitmapColor::Merge( BYTE cR, BYTE cG, BYTE cB, BYTE cTranspa
// ------------------------------------------------------------------
-inline ULONG BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
+inline sal_uLong BitmapColor::GetColorError( const BitmapColor& rBitmapColor ) const
{
DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
DBG_ASSERT( !rBitmapColor.mbIndex, "Pixel represents index into colortable!" );
- return( (ULONG) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
+ return( (sal_uLong) ( labs( mcBlueOrIndex - rBitmapColor.mcBlueOrIndex ) +
labs( mcGreen - rBitmapColor.mcGreen ) +
labs( mcRed - rBitmapColor.mcRed ) ) );
}
@@ -547,8 +547,8 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
{
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -557,13 +557,13 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) :
// ------------------------------------------------------------------
-inline BitmapPalette::BitmapPalette( USHORT nCount ) :
+inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) :
mnCount( nCount )
{
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memset( mpBitmapColor, 0, nSize );
}
else
@@ -574,20 +574,20 @@ inline BitmapPalette::BitmapPalette( USHORT nCount ) :
inline BitmapPalette::~BitmapPalette()
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
}
// ------------------------------------------------------------------
inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPalette )
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
mnCount = rBitmapPalette.mnCount;
if( mnCount )
{
- const ULONG nSize = mnCount * sizeof( BitmapColor );
- mpBitmapColor = (BitmapColor*) new BYTE[ nSize ];
+ const sal_uLong nSize = mnCount * sizeof( BitmapColor );
+ mpBitmapColor = (BitmapColor*) new sal_uInt8[ nSize ];
memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize );
}
else
@@ -598,19 +598,19 @@ inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPale
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
+inline sal_Bool BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( rBitmapPalette.mnCount == mnCount )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( USHORT i = 0; i < mnCount; i++ )
+ for( sal_uInt16 i = 0; i < mnCount; i++ )
{
if( mpBitmapColor[ i ] != rBitmapPalette.mpBitmapColor[ i ] )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -621,44 +621,44 @@ inline BOOL BitmapPalette::operator==( const BitmapPalette& rBitmapPalette ) con
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
+inline sal_Bool BitmapPalette::operator!=( const BitmapPalette& rBitmapPalette ) const
{
return !( *this == rBitmapPalette );
}
// ------------------------------------------------------------------
-inline BOOL BitmapPalette::operator!()
+inline sal_Bool BitmapPalette::operator!()
{
return( !mnCount || !mpBitmapColor );
}
// ------------------------------------------------------------------
-inline USHORT BitmapPalette::GetEntryCount() const
+inline sal_uInt16 BitmapPalette::GetEntryCount() const
{
return mnCount;
}
// ------------------------------------------------------------------
-inline void BitmapPalette::SetEntryCount( USHORT nCount )
+inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount )
{
if( !nCount )
{
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
mpBitmapColor = NULL;
mnCount = 0;
}
else if( nCount != mnCount )
{
- const ULONG nNewSize = nCount * sizeof( BitmapColor );
- const ULONG nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
- BYTE* pNewColor = new BYTE[ nNewSize ];
+ const sal_uLong nNewSize = nCount * sizeof( BitmapColor );
+ const sal_uLong nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor );
+ sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ];
if ( nMinSize && mpBitmapColor )
memcpy( pNewColor, mpBitmapColor, nMinSize );
- delete[] (BYTE*) mpBitmapColor;
+ delete[] (sal_uInt8*) mpBitmapColor;
memset( pNewColor + nMinSize, 0, nNewSize - nMinSize );
mpBitmapColor = (BitmapColor*) pNewColor;
mnCount = nCount;
@@ -667,7 +667,7 @@ inline void BitmapPalette::SetEntryCount( USHORT nCount )
// ------------------------------------------------------------------
-inline const BitmapColor& BitmapPalette::operator[]( USHORT nIndex ) const
+inline const BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex ) const
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -675,7 +675,7 @@ inline const BitmapColor& BitmapPalette::operator[]( USHORT nIndex ) const
// ------------------------------------------------------------------
-inline BitmapColor& BitmapPalette::operator[]( USHORT nIndex )
+inline BitmapColor& BitmapPalette::operator[]( sal_uInt16 nIndex )
{
DBG_ASSERT( nIndex < mnCount, "Palette index is out of range!" );
return mpBitmapColor[ nIndex ];
@@ -690,17 +690,17 @@ inline BitmapColor* BitmapPalette::ImplGetColorBuffer() const
}
// ------------------------------------------------------------------
-inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
+inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
{
- USHORT nRetIndex = 0;
+ sal_uInt16 nRetIndex = 0;
if( mpBitmapColor && mnCount )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
for( long j = 0L; ( j < mnCount ) && !bFound; j++ )
if( rCol == mpBitmapColor[ j ] )
- nRetIndex = ( (USHORT) j ), bFound = TRUE;
+ nRetIndex = ( (sal_uInt16) j ), bFound = sal_True;
if( !bFound )
{
@@ -708,7 +708,7 @@ inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
for( long i = nRetIndex - 1; i >= 0L; i-- )
if ( ( nActErr = rCol.GetColorError( mpBitmapColor[ i ] ) ) < nLastErr )
- nLastErr = nActErr, nRetIndex = (USHORT) i;
+ nLastErr = nActErr, nRetIndex = (sal_uInt16) i;
}
}
@@ -717,7 +717,7 @@ inline USHORT BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
// ------------------------------------------------------------------
-inline ColorMask::ColorMask( ULONG nRedMask, ULONG nGreenMask, ULONG nBlueMask ) :
+inline ColorMask::ColorMask( sal_uLong nRedMask, sal_uLong nGreenMask, sal_uLong nBlueMask ) :
mnRMask( nRedMask ),
mnGMask( nGreenMask ),
mnBMask( nBlueMask ),
@@ -735,48 +735,48 @@ inline ColorMask::ColorMask( ULONG nRedMask, ULONG nGreenMask, ULONG nBlueMask )
// ------------------------------------------------------------------
-inline long ColorMask::ImplCalcMaskShift( ULONG nMask, ULONG& rOr, ULONG& rOrShift ) const
+inline long ColorMask::ImplCalcMaskShift( sal_uLong nMask, sal_uLong& rOr, sal_uLong& rOrShift ) const
{
long nShift;
long nRet;
- ULONG nLen = 0UL;
+ sal_uLong nLen = 0UL;
// bei welchen Bits faengt die Maske an
- for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (ULONG) nShift ) ); nShift-- )
+ for( nShift = 31L; ( nShift >= 0L ) && !( nMask & ( 1 << (sal_uLong) nShift ) ); nShift-- )
{}
nRet = nShift;
// XXX Anzahl der gesetzten Bits ermitteln => nach rechts bis Null laufen
- while( ( nShift >= 0L ) && ( nMask & ( 1 << (ULONG) nShift ) ) )
+ while( ( nShift >= 0L ) && ( nMask & ( 1 << (sal_uLong) nShift ) ) )
{
nShift--;
nLen++;
}
rOrShift = 8L - nLen;
- rOr = (BYTE) ( ( 0xffUL >> nLen ) << rOrShift );
+ rOr = (sal_uInt8) ( ( 0xffUL >> nLen ) << rOrShift );
return( nRet -= 7 );
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetRedMask() const
+inline sal_uLong ColorMask::GetRedMask() const
{
return mnRMask;
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetGreenMask() const
+inline sal_uLong ColorMask::GetGreenMask() const
{
return mnGMask;
}
// ------------------------------------------------------------------
-inline ULONG ColorMask::GetBlueMask() const
+inline sal_uLong ColorMask::GetBlueMask() const
{
return mnBMask;
}
@@ -785,7 +785,7 @@ inline ULONG ColorMask::GetBlueMask() const
inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
- const UINT32 nVal = *pPixel;
+ const sal_uInt32 nVal = *pPixel;
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
}
@@ -793,7 +793,7 @@ inline void ColorMask::GetColorFor8Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- *pPixel = (BYTE) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
}
// ------------------------------------------------------------------
@@ -801,9 +801,9 @@ inline void ColorMask::SetColorFor8Bit( const BitmapColor& rColor, HPBYTE pPixel
inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = *(UINT16*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
#else
- const UINT32 nVal = pPixel[ 1 ] | ( (UINT32) pPixel[ 0 ] << 8UL );
+ const sal_uInt32 nVal = pPixel[ 1 ] | ( (sal_uInt32) pPixel[ 0 ] << 8UL );
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -813,13 +813,13 @@ inline void ColorMask::GetColorFor16BitMSB( BitmapColor& rColor, ConstHPBYTE pPi
inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- *(UINT16*) pPixel = nVal;
+ *(sal_uInt16*) pPixel = nVal;
#else
- pPixel[ 0 ] = (BYTE)(nVal >> 8U);
- pPixel[ 1 ] = (BYTE) nVal;
+ pPixel[ 0 ] = (sal_uInt8)(nVal >> 8U);
+ pPixel[ 1 ] = (sal_uInt8) nVal;
#endif
}
@@ -828,9 +828,9 @@ inline void ColorMask::SetColorFor16BitMSB( const BitmapColor& rColor, HPBYTE pP
inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL );
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL );
#else
- const UINT32 nVal = *(UINT16*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt16*) pPixel;
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -840,13 +840,13 @@ inline void ColorMask::GetColorFor16BitLSB( BitmapColor& rColor, ConstHPBYTE pPi
inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT16 nVal = (UINT16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ const sal_uInt16 nVal = (sal_uInt16)COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#ifdef OSL_BIGENDIAN
- pPixel[ 0 ] = (BYTE) nVal;
- pPixel[ 1 ] = (BYTE)(nVal >> 8U);
+ pPixel[ 0 ] = (sal_uInt8) nVal;
+ pPixel[ 1 ] = (sal_uInt8)(nVal >> 8U);
#else
- *(UINT16*) pPixel = nVal;
+ *(sal_uInt16*) pPixel = nVal;
#endif
}
@@ -855,7 +855,7 @@ inline void ColorMask::SetColorFor16BitLSB( const BitmapColor& rColor, HPBYTE pP
inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
- const UINT32 nVal = pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) | ( (UINT32) pPixel[ 2 ] << 16UL );
+ const sal_uInt32 nVal = pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) | ( (sal_uInt32) pPixel[ 2 ] << 16UL );
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
}
@@ -863,8 +863,8 @@ inline void ColorMask::GetColorFor24Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
- const UINT32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
- pPixel[ 0 ] = (BYTE) nVal; pPixel[ 1 ] = (BYTE) ( nVal >> 8UL ); pPixel[ 2 ] = (BYTE) ( nVal >> 16UL );
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL ); pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL );
}
// ------------------------------------------------------------------
@@ -872,10 +872,10 @@ inline void ColorMask::SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixe
inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = (UINT32) pPixel[ 0 ] | ( (UINT32) pPixel[ 1 ] << 8UL ) |
- ( (UINT32) pPixel[ 2 ] << 16UL ) | ( (UINT32) pPixel[ 3 ] << 24UL );
+ const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
+ ( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
#else
- const UINT32 nVal = *(UINT32*) pPixel;
+ const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
#endif
MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
@@ -886,11 +886,11 @@ inline void ColorMask::GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel
inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
{
#ifdef OSL_BIGENDIAN
- const UINT32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
- pPixel[ 0 ] = (BYTE) nVal; pPixel[ 1 ] = (BYTE) ( nVal >> 8UL );
- pPixel[ 2 ] = (BYTE) ( nVal >> 16UL ); pPixel[ 3 ] = (BYTE) ( nVal >> 24UL );
+ const sal_uInt32 nVal = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ pPixel[ 0 ] = (sal_uInt8) nVal; pPixel[ 1 ] = (sal_uInt8) ( nVal >> 8UL );
+ pPixel[ 2 ] = (sal_uInt8) ( nVal >> 16UL ); pPixel[ 3 ] = (sal_uInt8) ( nVal >> 24UL );
#else
- *(UINT32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
+ *(sal_uInt32*) pPixel = COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift );
#endif
}
diff --git a/vcl/inc/vcl/salctrlhandle.hxx b/vcl/inc/vcl/salctrlhandle.hxx
deleted file mode 100644
index 2cdb5af3a3e5..000000000000
--- a/vcl/inc/vcl/salctrlhandle.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_SALCTRLHANDLE_HXX
-#define _SV_SALCTRLHANDLE_HXX
-
-/* SalControlHandle:
- *
- * Container for platform-specific handles and data
- * about controls. Lives as long as the VCL control
- * lives.
- */
-
-class SalControlHandle
-{
- public:
- SalControlHandle() {}
- virtual ~SalControlHandle();
-
- // TODO: derive Sal implementation
- //SalControlHandleData maData;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/salctype.hxx b/vcl/inc/vcl/salctype.hxx
index c7136b98b5bf..93eb69bd439d 100644
--- a/vcl/inc/vcl/salctype.hxx
+++ b/vcl/inc/vcl/salctype.hxx
@@ -29,6 +29,9 @@
#ifndef _SV_SALCTYPE_HXX
#define _SV_SALCTYPE_HXX
+#include <com/sun/star/script/XInvocation.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
#include <vcl/graph.hxx>
// -----------
@@ -63,9 +66,9 @@ public:
Graphic maGraphic;
SvStream& mrStm;
- ULONG mnFormat;
+ sal_uLong mnFormat;
- ConvertData( const Graphic& rGraphic, SvStream& rStm, ULONG nFormat ) :
+ ConvertData( const Graphic& rGraphic, SvStream& rStm, sal_uLong nFormat ) :
maGraphic( rGraphic ), mrStm( rStm ), mnFormat( nFormat ) {}
~ConvertData() {}
};
@@ -74,9 +77,18 @@ public:
// - Callback -
// ------------
-typedef ULONG (*SALGRFCVTPROC)( void* pInst,
- ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- ULONG nOutFormat, void** ppOutBuffer );
+typedef sal_uLong (*SALGRFCVTPROC)( void* pInst,
+ sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ sal_uLong nOutFormat, void** ppOutBuffer );
+
+// -------------------
+// - BitmapConverter -
+// -------------------
+
+namespace vcl
+{
+com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+}
#endif // _SV_SALCTYPE_HXX
diff --git a/vcl/inc/vcl/saldatabasic.hxx b/vcl/inc/vcl/saldatabasic.hxx
index c4716507e7e6..e080cb91ff99 100644
--- a/vcl/inc/vcl/saldatabasic.hxx
+++ b/vcl/inc/vcl/saldatabasic.hxx
@@ -33,11 +33,17 @@
#include <vcl/salinst.hxx>
#include <osl/module.h>
-class VCL_DLLPUBLIC SalData
+namespace psp
+{
+ class PrinterInfoManager;
+}
+
+class VCL_PLUGIN_PUBLIC SalData
{
public:
- SalInstance* m_pInstance; // pointer to instance
- oslModule m_pPlugin; // plugin library handle
+ SalInstance* m_pInstance; // pointer to instance
+ oslModule m_pPlugin; // plugin library handle
+ psp::PrinterInfoManager* m_pPIManager;
SalData();
virtual ~SalData();
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index c1fa3e2b9eb4..f5b98756f5f6 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -62,55 +62,55 @@ struct SystemEnvData;
// - SalFrameTypes -
// -----------------
-#define SAL_FRAME_TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
-#define SAL_FRAME_TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
-#define SAL_FRAME_TOTOP_GRABFOCUS ((USHORT)0x0004)
-#define SAL_FRAME_TOTOP_GRABFOCUS_ONLY ((USHORT)0x0008)
+#define SAL_FRAME_TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
+#define SAL_FRAME_TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
+#define SAL_FRAME_TOTOP_GRABFOCUS ((sal_uInt16)0x0004)
+#define SAL_FRAME_TOTOP_GRABFOCUS_ONLY ((sal_uInt16)0x0008)
-#define SAL_FRAME_ENDEXTTEXTINPUT_COMPLETE ((USHORT)0x0001)
-#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((USHORT)0x0002)
+#define SAL_FRAME_ENDEXTTEXTINPUT_COMPLETE ((sal_uInt16)0x0001)
+#define SAL_FRAME_ENDEXTTEXTINPUT_CANCEL ((sal_uInt16)0x0002)
// -----------------
// - SalFrameStyle -
// -----------------
-#define SAL_FRAME_STYLE_DEFAULT ((ULONG)0x00000001)
-#define SAL_FRAME_STYLE_MOVEABLE ((ULONG)0x00000002)
-#define SAL_FRAME_STYLE_SIZEABLE ((ULONG)0x00000004)
-#define SAL_FRAME_STYLE_CLOSEABLE ((ULONG)0x00000008)
+#define SAL_FRAME_STYLE_DEFAULT ((sal_uLong)0x00000001)
+#define SAL_FRAME_STYLE_MOVEABLE ((sal_uLong)0x00000002)
+#define SAL_FRAME_STYLE_SIZEABLE ((sal_uLong)0x00000004)
+#define SAL_FRAME_STYLE_CLOSEABLE ((sal_uLong)0x00000008)
// no shadow effect on WindowsXP
-#define SAL_FRAME_STYLE_NOSHADOW ((ULONG)0x00000010)
+#define SAL_FRAME_STYLE_NOSHADOW ((sal_uLong)0x00000010)
// indicate tooltip windows, so they can always be topmost
-#define SAL_FRAME_STYLE_TOOLTIP ((ULONG)0x00000020)
+#define SAL_FRAME_STYLE_TOOLTIP ((sal_uLong)0x00000020)
// windows without windowmanager decoration, this typically only applies to floating windows
-#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((ULONG)0x00000040)
+#define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((sal_uLong)0x00000040)
// dialogs
-#define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00000080)
+#define SAL_FRAME_STYLE_DIALOG ((sal_uLong)0x00000080)
// partial fullscreen: fullscreen on one monitor of a multimonitor display
-#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((ULONG)0x00800000)
+#define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((sal_uLong)0x00800000)
// plugged system child window
-#define SAL_FRAME_STYLE_PLUG ((ULONG)0x10000000)
+#define SAL_FRAME_STYLE_PLUG ((sal_uLong)0x10000000)
// system child window inside another SalFrame
-#define SAL_FRAME_STYLE_SYSTEMCHILD ((ULONG)0x08000000)
+#define SAL_FRAME_STYLE_SYSTEMCHILD ((sal_uLong)0x08000000)
// floating window
-#define SAL_FRAME_STYLE_FLOAT ((ULONG)0x20000000)
+#define SAL_FRAME_STYLE_FLOAT ((sal_uLong)0x20000000)
// floating window that needs to be focusable
-#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((ULONG)0x04000000)
+#define SAL_FRAME_STYLE_FLOAT_FOCUSABLE ((sal_uLong)0x04000000)
// toolwindows should be painted with a smaller decoration
-#define SAL_FRAME_STYLE_TOOLWINDOW ((ULONG)0x40000000)
+#define SAL_FRAME_STYLE_TOOLWINDOW ((sal_uLong)0x40000000)
// the window containing the intro bitmap, aka splashscreen
-#define SAL_FRAME_STYLE_INTRO ((ULONG)0x80000000)
+#define SAL_FRAME_STYLE_INTRO ((sal_uLong)0x80000000)
/*
-#define SAL_FRAME_STYLE_MINABLE ((ULONG)0x00000008)
-#define SAL_FRAME_STYLE_MAXABLE ((ULONG)0x00000010)
-#define SAL_FRAME_STYLE_BORDER ((ULONG)0x00000040)
-#define SAL_FRAME_STYLE_DOC ((ULONG)0x00004000)
-#define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00008000)
-#define SAL_FRAME_STYLE_TOOL ((ULONG)0x00010000)
-#define SAL_FRAME_STYLE_FULLSIZE ((ULONG)0x00020000)
+#define SAL_FRAME_STYLE_MINABLE ((sal_uLong)0x00000008)
+#define SAL_FRAME_STYLE_MAXABLE ((sal_uLong)0x00000010)
+#define SAL_FRAME_STYLE_BORDER ((sal_uLong)0x00000040)
+#define SAL_FRAME_STYLE_DOC ((sal_uLong)0x00004000)
+#define SAL_FRAME_STYLE_DIALOG ((sal_uLong)0x00008000)
+#define SAL_FRAME_STYLE_TOOL ((sal_uLong)0x00010000)
+#define SAL_FRAME_STYLE_FULLSIZE ((sal_uLong)0x00020000)
*/
// ----------------------------------------
@@ -125,10 +125,10 @@ typedef sal_uInt64 SalExtStyle;
// - Flags for SetPosSize -
// ------------------------
-#define SAL_FRAME_POSSIZE_X ((USHORT)0x0001)
-#define SAL_FRAME_POSSIZE_Y ((USHORT)0x0002)
-#define SAL_FRAME_POSSIZE_WIDTH ((USHORT)0x0004)
-#define SAL_FRAME_POSSIZE_HEIGHT ((USHORT)0x0008)
+#define SAL_FRAME_POSSIZE_X ((sal_uInt16)0x0001)
+#define SAL_FRAME_POSSIZE_Y ((sal_uInt16)0x0002)
+#define SAL_FRAME_POSSIZE_WIDTH ((sal_uInt16)0x0004)
+#define SAL_FRAME_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
#ifdef __cplusplus
@@ -141,7 +141,7 @@ using ::rtl::OString;
struct SystemParentData;
-class VCL_DLLPUBLIC SalFrame : public vcl::DeletionNotifier
+class VCL_PLUGIN_PUBLIC SalFrame : public vcl::DeletionNotifier
{
// the VCL window corresponding to this frame
Window* m_pWindow;
@@ -161,10 +161,10 @@ public:
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual BOOL PostEvent( void* pData ) = 0;
+ virtual sal_Bool PostEvent( void* pData ) = 0;
virtual void SetTitle( const XubString& rTitle ) = 0;
- virtual void SetIcon( USHORT nIcon ) = 0;
+ virtual void SetIcon( sal_uInt16 nIcon ) = 0;
virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu *pSalMenu ) = 0;
virtual void DrawMenuBar() = 0;
@@ -173,13 +173,13 @@ public:
// Before the window is visible, a resize event
// must be sent with the correct size
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ) = 0;
- virtual void Enable( BOOL bEnable ) = 0;
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ) = 0;
+ virtual void Enable( sal_Bool bEnable ) = 0;
// Set ClientSize and Center the Window to the desktop
// and send/post a resize message
virtual void SetMinClientSize( long nWidth, long nHeight ) = 0;
virtual void SetMaxClientSize( long nWidth, long nHeight ) = 0;
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) = 0;
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) = 0;
virtual void GetClientSize( long& rWidth, long& rHeight ) = 0;
virtual void GetWorkArea( Rectangle& rRect ) = 0;
virtual SalFrame* GetParent() const = 0;
@@ -187,20 +187,20 @@ public:
SalFrameGeometry GetGeometry();
const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
virtual void SetWindowState( const SalFrameState* pState ) = 0;
- virtual BOOL GetWindowState( SalFrameState* pState ) = 0;
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) = 0;
+ virtual sal_Bool GetWindowState( SalFrameState* pState ) = 0;
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) = 0;
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( BOOL bStart ) = 0;
+ virtual void StartPresentation( sal_Bool bStart ) = 0;
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( BOOL bOnTop ) = 0;
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop ) = 0;
// Window to top and grab focus
- virtual void ToTop( USHORT nFlags ) = 0;
+ virtual void ToTop( sal_uInt16 nFlags ) = 0;
// this function can call with the same
// pointer style
virtual void SetPointer( PointerStyle ePointerStyle ) = 0;
- virtual void CaptureMouse( BOOL bMouse ) = 0;
+ virtual void CaptureMouse( sal_Bool bMouse ) = 0;
virtual void SetPointerPos( long nX, long nY ) = 0;
// flush output buffer
@@ -210,15 +210,15 @@ public:
virtual void Sync() = 0;
virtual void SetInputContext( SalInputContext* pContext ) = 0;
- virtual void EndExtTextInput( USHORT nFlags ) = 0;
+ virtual void EndExtTextInput( sal_uInt16 nFlags ) = 0;
- virtual String GetKeyName( USHORT nKeyCode ) = 0;
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode ) = 0;
+ virtual String GetKeyName( sal_uInt16 nKeyCode ) = 0;
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ) = 0;
// returns in 'rKeyCode' the single keycode that translates to the given unicode when using a keyboard layout of language 'aLangType'
- // returns FALSE if no mapping exists or function not supported
+ // returns sal_False if no mapping exists or function not supported
// this is required for advanced menu support
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ) = 0;
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ) = 0;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -242,7 +242,7 @@ public:
// get current modifier, button mask and mouse position
struct SalPointerState
{
- ULONG mnState;
+ sal_uLong mnState;
Point maPos; // in frame coordinates
};
@@ -250,12 +250,12 @@ public:
struct SalIndicatorState
{
- USHORT mnState;
+ sal_uInt16 mnState;
};
virtual SalIndicatorState GetIndicatorState() = 0;
- virtual void SimulateKeyPress( USHORT nKeyCode ) = 0;
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) = 0;
// set new parent window
virtual void SetParent( SalFrame* pNewParent ) = 0;
@@ -273,13 +273,12 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion() = 0;
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects ) = 0;
+ virtual void BeginSetClipRegion( sal_uLong nRects ) = 0;
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
// done setting up the clipregion
virtual void EndSetClipRegion() = 0;
-
// Callbacks (indepent part in vcl/source/window/winproc.cxx)
// for default message handling return 0
void SetCallback( Window* pWindow, SALFRAMEPROC pProc )
@@ -291,7 +290,7 @@ public:
// Call the callback set; this sometimes necessary for implementation classes
// that should not now more than necessary about the SalFrame implementation
// (e.g. input methods, printer update handlers).
- long CallCallback( USHORT nEvent, const void* pEvent ) const
+ long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
{ return m_pProc ? m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent ) : 0; }
};
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index 20220151cafc..5b9e59f68d8f 100644..100755
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -37,7 +37,6 @@
#include "osl/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
-#include "vcl/salctrlhandle.hxx"
#include <map>
@@ -67,13 +66,13 @@ namespace basegfx {
// - SalGraphics-Codes -
// ---------------------
-#define SAL_SETFONT_REMOVEANDMATCHNEW ((USHORT)0x0001)
-#define SAL_SETFONT_USEDRAWTEXT ((USHORT)0x0002)
-#define SAL_SETFONT_USEDRAWTEXTARRAY ((USHORT)0x0004)
-#define SAL_SETFONT_UNICODE ((USHORT)0x0008)
-#define SAL_SETFONT_BADFONT ((USHORT)0x1000)
+#define SAL_SETFONT_REMOVEANDMATCHNEW ((sal_uInt16)0x0001)
+#define SAL_SETFONT_USEDRAWTEXT ((sal_uInt16)0x0002)
+#define SAL_SETFONT_USEDRAWTEXTARRAY ((sal_uInt16)0x0004)
+#define SAL_SETFONT_UNICODE ((sal_uInt16)0x0008)
+#define SAL_SETFONT_BADFONT ((sal_uInt16)0x1000)
-#define SAL_COPYAREA_WINDOWINVALIDATE ((USHORT)0x0001)
+#define SAL_COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
// -------------------
// - common typedefs -
@@ -98,7 +97,7 @@ typedef std::vector< sal_Int32 > Int32Vector;
// note: all positions are in pixel and relative to
// the top/left-position of the virtual output area
-class VCL_DLLPUBLIC SalGraphics
+class VCL_PLUGIN_PUBLIC SalGraphics
{
int m_nLayout; // 0: mirroring off, 1: mirror x-axis
@@ -115,25 +114,24 @@ public:
virtual ~SalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ) = 0;
+ virtual bool setClipRegion( const Region& ) = 0;
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY ) = 0;
virtual void drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ) = 0;
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) = 0;
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ) = 0;
virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0;
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0;
- virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) = 0;
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ) = 0;
+ virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ) = 0;
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags ) = 0;
+ long nSrcHeight, sal_uInt16 nFlags ) = 0;
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -154,20 +152,20 @@ protected:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) = 0;
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) = 0;
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
@@ -200,17 +198,12 @@ public:
// get device resolution
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
// get the depth of the device
- virtual USHORT GetBitCount() const = 0;
+ virtual sal_uInt16 GetBitCount() const = 0;
// get the width of the device
virtual long GetGraphicsWidth() const = 0;
// set the clip region to empty
virtual void ResetClipRegion() = 0;
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount ) = 0;
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion() = 0;
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor() = 0;
@@ -230,7 +223,7 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor ) = 0;
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ) = 0;
// release the fonts
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
@@ -238,9 +231,9 @@ public:
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairCount, ImplKernPairData* ) = 0;
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
// get the layout capabilities of the current font
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
// graphics must fill supplied font list
@@ -251,7 +244,7 @@ public:
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ) = 0;
// CreateFontSubset: a method to get a subset of glyhps of a font
// inside a new valid font file
- // returns TRUE if creation of subset was successfull
+ // returns sal_True if creation of subset was successfull
// parameters: rToFile: contains a osl file URL to write the subset to
// pFont: describes from which font to create a subset
// pGlyphIDs: the glyph ids to be extracted
@@ -261,7 +254,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -305,8 +298,8 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc ) = 0;
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
- virtual BOOL GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
+ virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
@@ -351,7 +344,7 @@ public:
void mirror( long& nX, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( long& nX, long& nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
- BOOL mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
+ sal_Bool mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
void mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack = false ) const;
void mirror( ControlType,const ImplControlValue&,const OutputDevice*,bool bBack = false) const;
@@ -359,36 +352,35 @@ public:
basegfx::B2DPolygon mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
- // non virtual methods; these do eventual coordinate mirroring and
+ // non virtual methods; these do possible coordinate mirroring and
// then delegate to protected virtual methods
- BOOL UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
- BOOL UnionClipRegion( const ::basegfx::B2DPolyPolygon&, const OutputDevice* );
+ bool SetClipRegion( const Region&, const OutputDevice *pOutDev );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
void DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
void DrawPixel( long nX, long nY, SalColor nSalColor, const OutputDevice *pOutDev );
void DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
void DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
- void DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
- void DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
void DrawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry,
const OutputDevice *pOutDev );
bool DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* );
bool DrawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* );
- sal_Bool DrawPolyLineBezier( ULONG nPoints,
+ sal_Bool DrawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry,
+ const sal_uInt8* pFlgAry,
const OutputDevice *pOutDev );
- sal_Bool DrawPolygonBezier( ULONG nPoints,
+ sal_Bool DrawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry,
+ const sal_uInt8* pFlgAry,
const OutputDevice *pOutDev );
sal_Bool DrawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry,
+ const sal_uInt8* const* pFlgAry,
const OutputDevice *pOutDev );
// CopyArea --> No RasterOp, but ClipRegion
@@ -398,7 +390,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags,
+ sal_uInt16 nFlags,
const OutputDevice *pOutDev );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
@@ -429,27 +421,27 @@ public:
// invert --> ClipRegion (only Windows)
void Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev );
- void Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
+ void Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev );
- BOOL DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev );
+ sal_Bool DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev );
//-------------------------------------
// Native Widget Rendering functions
//-------------------------------------
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
// Query the native control to determine if it was acted upon
- BOOL HitTestNativeControl( ControlType nType,
+ sal_Bool HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside,
+ sal_Bool& rIsInside,
const OutputDevice *pOutDev );
// Request rendering of a particular control and/or part
- BOOL DrawNativeControl( ControlType nType,
+ sal_Bool DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -458,7 +450,7 @@ public:
const OutputDevice *pOutDev );
// Request rendering of a caption string for a control
- BOOL DrawNativeControlText( ControlType nType,
+ sal_Bool DrawNativeControlText( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -467,7 +459,7 @@ public:
const OutputDevice *pOutDev );
// Query the native control's actual drawing region (including adornment)
- BOOL GetNativeControlRegion( ControlType nType,
+ sal_Bool GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -480,7 +472,7 @@ public:
static void AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
bool DrawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
diff --git a/vcl/inc/vcl/salgtype.hxx b/vcl/inc/vcl/salgtype.hxx
index d6f0b6d7de2f..7f994f452f2c 100644
--- a/vcl/inc/vcl/salgtype.hxx
+++ b/vcl/inc/vcl/salgtype.hxx
@@ -35,11 +35,11 @@
// - SalColor -
// ------------
-typedef UINT32 SalColor;
-#define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((UINT32)((UINT8)(b))))|(((UINT32)((UINT8)(g)))<<8)|(((UINT32)((UINT8)(r)))<<16))
-#define SALCOLOR_RED( n ) ((UINT8)((n)>>16))
-#define SALCOLOR_GREEN( n ) ((UINT8)(((UINT16)(n)) >> 8))
-#define SALCOLOR_BLUE( n ) ((UINT8)(n))
+typedef sal_uInt32 SalColor;
+#define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16))
+#define SALCOLOR_RED( n ) ((sal_uInt8)((n)>>16))
+#define SALCOLOR_GREEN( n ) ((sal_uInt8)(((sal_uInt16)(n)) >> 8))
+#define SALCOLOR_BLUE( n ) ((sal_uInt8)(n))
#define SALCOLOR_NONE (~(SalColor)0)
// ------------
// - SalPoint -
@@ -74,7 +74,7 @@ struct SalTwoRect
// - SalROPColor -
// ---------------
-typedef USHORT SalROPColor;
+typedef sal_uInt16 SalROPColor;
#define SAL_ROP_0 ((SalROPColor)0)
#define SAL_ROP_1 ((SalROPColor)1)
#define SAL_ROP_INVERT ((SalROPColor)2)
@@ -83,7 +83,7 @@ typedef USHORT SalROPColor;
// - SalInvert -
// -------------
-typedef USHORT SalInvert;
+typedef sal_uInt16 SalInvert;
#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
#define SAL_INVERT_50 ((SalInvert)0x0002)
#define SAL_INVERT_TRACKFRAME ((SalInvert)0x0004)
diff --git a/vcl/inc/vcl/salimestatus.hxx b/vcl/inc/vcl/salimestatus.hxx
index 76255e4f495c..13362c20071d 100644
--- a/vcl/inc/vcl/salimestatus.hxx
+++ b/vcl/inc/vcl/salimestatus.hxx
@@ -31,7 +31,7 @@
#include <vcl/dllapi.h>
-class VCL_DLLPUBLIC SalI18NImeStatus
+class VCL_PLUGIN_PUBLIC SalI18NImeStatus
{
public:
SalI18NImeStatus() {}
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index 45c354ff4d5c..d878dd7fea80 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -32,10 +32,12 @@
#include "com/sun/star/uno/Reference.hxx"
#include "vcl/sv.h"
+#include "vcl/displayconnectiondispatch.hxx"
#include "vcl/dllapi.h"
#include "tools/string.hxx"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include <list>
@@ -61,38 +63,29 @@ struct SalItemParams;
class SalSession;
struct SystemGraphicsData;
struct SystemWindowData;
+class Menu;
// ---------------
// - SalInstance -
// ---------------
-class VCL_DLLPUBLIC SalInstance
+class VCL_PLUGIN_PUBLIC SalInstance
{
-public:
- typedef bool(*Callback)(void*,void*,int);
private:
- void* m_pEventInst;
- void* m_pErrorInst;
- Callback m_pEventCallback;
- Callback m_pErrorCallback;
+ rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst;
public:
- SalInstance() :
- m_pEventInst( NULL ),
- m_pErrorInst( NULL ),
- m_pEventCallback( NULL ),
- m_pErrorCallback( NULL )
- {}
+ SalInstance() {}
virtual ~SalInstance();
// Frame
// DisplayName for Unix ???
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle ) = 0;
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle ) = 0;
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ) = 0;
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ) = 0;
virtual void DestroyFrame( SalFrame* pFrame ) = 0;
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE ) = 0;
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ) = 0;
virtual void DestroyObject( SalObject* pObject ) = 0;
// VirtualDevice
@@ -101,7 +94,7 @@ public:
// pData allows for using a system dependent graphics or device context
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ) = 0;
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ) = 0;
// Printer
@@ -130,42 +123,34 @@ public:
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex() = 0;
- virtual ULONG ReleaseYieldMutex() = 0;
- virtual void AcquireYieldMutex( ULONG nCount ) = 0;
+ virtual sal_uLong ReleaseYieldMutex() = 0;
+ virtual void AcquireYieldMutex( sal_uLong nCount ) = 0;
+ // return true, if yield mutex is owned by this thread, else false
+ virtual bool CheckYieldMutex() = 0;
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
// and timer
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) = 0;
- virtual bool AnyInput( USHORT nType ) = 0;
+ virtual bool AnyInput( sal_uInt16 nType ) = 0;
// Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar ) = 0;
- virtual void DestroyMenu( SalMenu* pMenu) = 0;
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) = 0;
- virtual void DestroyMenuItem( SalMenuItem* pItem ) = 0;
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pMenu );
+ virtual void DestroyMenu( SalMenu* pMenu);
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual void DestroyMenuItem( SalMenuItem* pItem );
// may return NULL to disable session management
virtual SalSession* CreateSalSession() = 0;
// methods for XDisplayConnection
- // the parameters for the callbacks are:
- // void* pInst: pInstance form the SetCallback call
- // void* pEvent: address of the system specific event structure
- // int nBytes: length of the system specific event structure
- void SetEventCallback( void* pInstance, Callback pCallback )
- { m_pEventInst = pInstance; m_pEventCallback = pCallback; }
- Callback GetEventCallback() const
- { return m_pEventCallback; }
+ void SetEventCallback( rtl::Reference< vcl::DisplayConnectionDispatch > const & pInstance )
+ { m_pEventInst = pInstance; }
bool CallEventCallback( void* pEvent, int nBytes )
- { return m_pEventCallback ? m_pEventCallback( m_pEventInst, pEvent, nBytes ) : false; }
- void SetErrorEventCallback( void* pInstance, Callback pCallback )
- { m_pErrorInst = pInstance; m_pErrorCallback = pCallback; }
- Callback GetErrorEventCallback() const
- { return m_pErrorCallback; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchEvent( pEvent, nBytes ); }
bool CallErrorCallback( void* pEvent, int nBytes )
- { return m_pErrorCallback ? m_pErrorCallback( m_pErrorInst, pEvent, nBytes ) : false; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchErrorEvent( pEvent, nBytes ); }
enum ConnectionIdentifierType { AsciiCString, Blob };
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
@@ -198,7 +183,7 @@ void DestroySalInstance( SalInstance* pInst );
void SalAbort( const XubString& rErrorText );
-VCL_DLLPUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
+VCL_PLUGIN_PUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
// -----------
// - SalData -
diff --git a/vcl/inc/vcl/sallayout.hxx b/vcl/inc/vcl/sallayout.hxx
index b26970c708d5..b91185769b27 100644
--- a/vcl/inc/vcl/sallayout.hxx
+++ b/vcl/inc/vcl/sallayout.hxx
@@ -73,7 +73,7 @@ class ImplFontData;
// -----------------
// used for managing runs e.g. for BiDi, glyph and script fallback
-class VCL_DLLPUBLIC ImplLayoutRuns
+class VCL_PLUGIN_PUBLIC ImplLayoutRuns
{
private:
int mnRunIndex;
@@ -149,7 +149,7 @@ sal_UCS4 GetVerticalChar( sal_UCS4 );
// #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx
// VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
-VCL_DLLPUBLIC const char* GetAutofallback( sal_UCS4 ) ;
+VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
// -------------
// - SalLayout -
@@ -180,7 +180,7 @@ typedef sal_uInt32 sal_GlyphId;
// all positions/widths are in font units
// one exception: drawposition is in pixel units
-class VCL_DLLPUBLIC SalLayout
+class VCL_PLUGIN_PUBLIC SalLayout
{
public:
// used by upper layers
@@ -259,7 +259,7 @@ protected:
// - MultiSalLayout -
// ------------------
-class VCL_DLLPUBLIC MultiSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC MultiSalLayout : public SalLayout
{
public:
virtual void DrawText( SalGraphics& ) const;
@@ -272,7 +272,7 @@ public:
virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const;
// used only by OutputDevice::ImplLayout, TODO: make friend
- MultiSalLayout( SalLayout& rBaseLayout,
+ explicit MultiSalLayout( SalLayout& rBaseLayout,
const ImplFontData* pBaseFont = NULL );
virtual bool AddFallback( SalLayout& rFallbackLayout,
ImplLayoutRuns&, const ImplFontData* pFallbackFont );
@@ -342,7 +342,7 @@ typedef std::vector<GlyphItem> GlyphVector;
// ---------------
-class VCL_DLLPUBLIC GenericSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
{
public:
// used by layout engines
diff --git a/vcl/inc/vcl/salmenu.hxx b/vcl/inc/vcl/salmenu.hxx
index 3ddcb95d4475..63fb12ee4a84 100644
--- a/vcl/inc/vcl/salmenu.hxx
+++ b/vcl/inc/vcl/salmenu.hxx
@@ -41,7 +41,7 @@ class SalFrame;
struct SalItemParams
{
- USHORT nId; // item Id
+ sal_uInt16 nId; // item Id
MenuItemType eType; // MenuItem-Type
MenuItemBits nBits; // MenuItem-Bits
Menu* pMenu; // Pointer to Menu
@@ -52,49 +52,49 @@ struct SalItemParams
struct SalMenuButtonItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
Image maImage;
rtl::OUString maToolTipText;
SalMenuButtonItem() : mnId( 0 ) {}
- SalMenuButtonItem( USHORT i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
+ SalMenuButtonItem( sal_uInt16 i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
: mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
};
-class VCL_DLLPUBLIC SalMenuItem
+class VCL_PLUGIN_PUBLIC SalMenuItem
{
public:
SalMenuItem() {}
virtual ~SalMenuItem();
};
-class VCL_DLLPUBLIC SalMenu
+class VCL_PLUGIN_PUBLIC SalMenu
{
public:
SalMenu() {}
virtual ~SalMenu();
- virtual BOOL VisibleMenuBar() = 0; // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar() = 0; // must return sal_True to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) = 0;
virtual void RemoveItem( unsigned nPos ) = 0;
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) = 0;
virtual void SetFrame( const SalFrame* pFrame ) = 0;
- virtual void CheckItem( unsigned nPos, BOOL bCheck ) = 0;
- virtual void EnableItem( unsigned nPos, BOOL bEnable ) = 0;
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck ) = 0;
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable ) = 0;
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )= 0;
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName ) = 0;
virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
- virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, ULONG nFlags);
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
- virtual void RemoveMenuBarButton( USHORT nId );
+ virtual void RemoveMenuBarButton( sal_uInt16 nId );
// return an empty rectangle if not implemented
// return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented
// but rectangle cannot be determined
- virtual Rectangle GetMenuBarButtonRectPixel( USHORT i_nItemId, SalFrame* i_pReferenceFrame );
+ virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
};
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index bea43a41c24f..696a8660bb2f 100644..100755
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -177,6 +177,7 @@ typedef sal_uInt32 ControlPart;
#define PART_MENU_ITEM 250
#define PART_MENU_ITEM_CHECK_MARK 251
#define PART_MENU_ITEM_RADIO_MARK 252
+#define PART_MENU_SEPARATOR 253
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
@@ -308,7 +309,7 @@ class VCL_DLLPUBLIC ImplControlValue
*
* Value container for scrollbars.
*/
- class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
+class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
{
public:
long mnMin;
@@ -374,12 +375,12 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
};
virtual ~TabitemValue();
- BOOL isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
- BOOL isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
- BOOL isBothAligned() const { return isLeftAligned() && isRightAligned(); }
- BOOL isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
- BOOL isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
- BOOL isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+ sal_Bool isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+ sal_Bool isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+ sal_Bool isBothAligned() const { return isLeftAligned() && isRightAligned(); }
+ sal_Bool isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+ sal_Bool isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+ sal_Bool isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
};
/* SpinbuttonValue:
@@ -414,10 +415,10 @@ class ToolbarValue : public ImplControlValue
{
public:
ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
- { mbIsTopDockingArea = FALSE; }
+ { mbIsTopDockingArea = sal_False; }
virtual ~ToolbarValue();
Rectangle maGripRect;
- BOOL mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
+ sal_Bool mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
// adjacent to the menubar
};
@@ -434,6 +435,24 @@ public:
int maTopDockingAreaHeight;
};
+/* MenupopupValue:
+ *
+ * Value container for menu items; specifies the rectangle for the whole item which
+ * may be useful when drawing parts with a smaller rectangle.
+ */
+class MenupopupValue : public ImplControlValue
+{
+public:
+ MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 )
+ {}
+ MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
+ : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth )
+ , maItemRect( i_rItemRect )
+ {}
+ virtual ~MenupopupValue();
+ Rectangle maItemRect;
+};
+
/* PushButtonValue:
*
* Value container for pushbuttons specifying additional drawing hints
diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx
index 6ba025befdbe..4e781787b0c9 100644
--- a/vcl/inc/vcl/salobj.hxx
+++ b/vcl/inc/vcl/salobj.hxx
@@ -40,53 +40,55 @@ struct SystemEnvData;
// - SalObject-Types -
// -------------------
-#define SAL_OBJECT_CLIP_INCLUDERECTS ((USHORT)0x0001)
-#define SAL_OBJECT_CLIP_EXCLUDERECTS ((USHORT)0x0002)
-#define SAL_OBJECT_CLIP_ABSOLUTE ((USHORT)0x0004)
+#define SAL_OBJECT_CLIP_INCLUDERECTS ((sal_uInt16)0x0001)
+#define SAL_OBJECT_CLIP_EXCLUDERECTS ((sal_uInt16)0x0002)
+#define SAL_OBJECT_CLIP_ABSOLUTE ((sal_uInt16)0x0004)
// -------------
// - SalObject -
// -------------
-class VCL_DLLPUBLIC SalObject
+class VCL_PLUGIN_PUBLIC SalObject
{
void* m_pInst;
SALOBJECTPROC m_pCallback;
- BOOL m_bMouseTransparent:1,
+ sal_Bool m_bMouseTransparent:1,
m_bEraseBackground:1;
public:
- SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( FALSE ), m_bEraseBackground( TRUE ) {}
+ SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( sal_False ), m_bEraseBackground( sal_True ) {}
virtual ~SalObject();
virtual void ResetClipRegion() = 0;
- virtual USHORT GetClipRegionType() = 0;
- virtual void BeginSetClipRegion( ULONG nRects ) = 0;
+ virtual sal_uInt16 GetClipRegionType() = 0;
+ virtual void BeginSetClipRegion( sal_uLong nRects ) = 0;
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
virtual void EndSetClipRegion() = 0;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual void Show( BOOL bVisible ) = 0;
- virtual void Enable( BOOL nEnable ) = 0;
+ virtual void Show( sal_Bool bVisible ) = 0;
+ virtual void Enable( sal_Bool nEnable ) = 0;
virtual void GrabFocus() = 0;
virtual void SetBackground() = 0;
virtual void SetBackground( SalColor nSalColor ) = 0;
- virtual void SetForwardKey( BOOL /*bEnable*/ ) {}
+ virtual void SetForwardKey( sal_Bool /*bEnable*/ ) {}
virtual const SystemEnvData* GetSystemData() const = 0;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
+
void SetCallback( void* pInst, SALOBJECTPROC pProc )
{ m_pInst = pInst; m_pCallback = pProc; }
- long CallCallback( USHORT nEvent, const void* pEvent )
+ long CallCallback( sal_uInt16 nEvent, const void* pEvent )
{ return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
- void SetMouseTransparent( BOOL bMouseTransparent )
+ void SetMouseTransparent( sal_Bool bMouseTransparent )
{ m_bMouseTransparent = bMouseTransparent; }
- BOOL IsMouseTransparent()
+ sal_Bool IsMouseTransparent()
{ return m_bMouseTransparent; }
- void EnableEraseBackground( BOOL bEnable )
+ void EnableEraseBackground( sal_Bool bEnable )
{ m_bEraseBackground = bEnable; }
- BOOL IsEraseBackgroundEnabled()
+ sal_Bool IsEraseBackgroundEnabled()
{ return m_bEraseBackground; }
};
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index be387b4f1c7f..e820614e4cdd 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -45,14 +45,14 @@ namespace vcl { class PrinterController; }
// - SalPrinterQueueInfo -
// -----------------------
-struct VCL_DLLPUBLIC SalPrinterQueueInfo
+struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
{
XubString maPrinterName;
XubString maDriver;
XubString maLocation;
XubString maComment;
- ULONG mnStatus;
- ULONG mnJobs;
+ sal_uLong mnStatus;
+ sal_uLong mnJobs;
void* mpSysData;
SalPrinterQueueInfo();
@@ -63,7 +63,7 @@ struct VCL_DLLPUBLIC SalPrinterQueueInfo
// - SalInfoPrinter -
// ------------------
-class VCL_DLLPUBLIC SalInfoPrinter
+class VCL_PLUGIN_PUBLIC SalInfoPrinter
{
public:
std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
@@ -78,23 +78,23 @@ public:
virtual SalGraphics* GetGraphics() = 0;
virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
// This function set the driver data and
// set the new indepen data in pSetupData
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ) = 0;
// This function merged the indepen driver data
// and set the new indepen data in pSetupData
// Only the data must changed, where the bit
// in nFlags is set
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData ) = 0;
+ virtual sal_Bool SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight ) = 0;
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ) = 0;
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ) = 0;
+ virtual sal_uLong GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
+ virtual sal_uLong GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
// fills m_aPaperFormats and sets m_bPapersInit to true
virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
// returns angle that a landscape page will be turned counterclockwise wrt to portrait
@@ -105,33 +105,33 @@ public:
// - SalPrinter -
// --------------
-class VCL_DLLPUBLIC SalPrinter
+class VCL_PLUGIN_PUBLIC SalPrinter
{
public: // public for Sal Implementation
SalPrinter() {}
virtual ~SalPrinter();
- virtual BOOL StartJob( const String* pFileName,
+ virtual sal_Bool StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData ) = 0;
// implement for pull model print systems only,
- // default implementations (see salvtables.cxx) just returns FALSE
- virtual BOOL StartJob( const String* pFileName,
+ // default implementations (see salvtables.cxx) just returns sal_False
+ virtual sal_Bool StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
ImplJobSetup* pSetupData,
vcl::PrinterController& rController );
- virtual BOOL EndJob() = 0;
- virtual BOOL AbortJob() = 0;
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;
- virtual BOOL EndPage() = 0;
- virtual ULONG GetErrorCode() = 0;
+ virtual sal_Bool EndJob() = 0;
+ virtual sal_Bool AbortJob() = 0;
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ) = 0;
+ virtual sal_Bool EndPage() = 0;
+ virtual sal_uLong GetErrorCode() = 0;
};
diff --git a/vcl/inc/vcl/salptype.hxx b/vcl/inc/vcl/salptype.hxx
index 7ad8b2a2c5f9..ca47f599271c 100644
--- a/vcl/inc/vcl/salptype.hxx
+++ b/vcl/inc/vcl/salptype.hxx
@@ -35,10 +35,10 @@
// - SalJobSetupFlags -
// --------------------
-#define SAL_JOBSET_ORIENTATION ((ULONG)0x00000001)
-#define SAL_JOBSET_PAPERBIN ((ULONG)0x00000002)
-#define SAL_JOBSET_PAPERSIZE ((ULONG)0x00000004)
-#define SAL_JOBSET_DUPLEXMODE ((ULONG)0x00000008)
+#define SAL_JOBSET_ORIENTATION ((sal_uLong)0x00000001)
+#define SAL_JOBSET_PAPERBIN ((sal_uLong)0x00000002)
+#define SAL_JOBSET_PAPERSIZE ((sal_uLong)0x00000004)
+#define SAL_JOBSET_DUPLEXMODE ((sal_uLong)0x00000008)
#define SAL_JOBSET_ALL (SAL_JOBSET_ORIENTATION |\
SAL_JOBSET_PAPERBIN |\
SAL_JOBSET_PAPERSIZE |\
diff --git a/vcl/inc/vcl/salsession.hxx b/vcl/inc/vcl/salsession.hxx
index 5d2fc5cf34ff..c912565a920c 100644
--- a/vcl/inc/vcl/salsession.hxx
+++ b/vcl/inc/vcl/salsession.hxx
@@ -86,7 +86,7 @@ struct SalSessionQuitEvent : public SalSessionEvent
typedef void(*SessionProc)( SalSessionEvent *pEvent);
-class VCL_DLLPUBLIC SalSession
+class VCL_PLUGIN_PUBLIC SalSession
{
SessionProc m_aProc;
public:
diff --git a/vcl/inc/vcl/salsys.hxx b/vcl/inc/vcl/salsys.hxx
index df8223ca8759..2f2f6d08e9e6 100644
--- a/vcl/inc/vcl/salsys.hxx
+++ b/vcl/inc/vcl/salsys.hxx
@@ -59,7 +59,7 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7;
// - SalSystem -
// -------------
-class VCL_DLLPUBLIC SalSystem
+class VCL_PLUGIN_PUBLIC SalSystem
{
public:
SalSystem() {}
diff --git a/vcl/inc/vcl/saltimer.hxx b/vcl/inc/vcl/saltimer.hxx
index 78c27769c7a6..4bbaddb65b31 100644
--- a/vcl/inc/vcl/saltimer.hxx
+++ b/vcl/inc/vcl/saltimer.hxx
@@ -43,7 +43,7 @@
* this needed to be virtualized for the sal plugin migration
*/
-class VCL_DLLPUBLIC SalTimer
+class VCL_PLUGIN_PUBLIC SalTimer
{
SALTIMERPROC m_pProc;
public:
@@ -51,7 +51,7 @@ public:
virtual ~SalTimer();
// AutoRepeat and Restart
- virtual void Start( ULONG nMS ) = 0;
+ virtual void Start( sal_uLong nMS ) = 0;
virtual void Stop() = 0;
// Callbacks (indepen in \sv\source\app\timer.cxx)
diff --git a/vcl/inc/vcl/salvd.hxx b/vcl/inc/vcl/salvd.hxx
index 2b6c6191add6..68ed56a901d8 100644
--- a/vcl/inc/vcl/salvd.hxx
+++ b/vcl/inc/vcl/salvd.hxx
@@ -38,7 +38,7 @@ class SalGraphics;
// - SalVirtualDevice -
// --------------------
-class VCL_DLLPUBLIC SalVirtualDevice
+class VCL_PLUGIN_PUBLIC SalVirtualDevice
{
public: // public for Sal Implementation
SalVirtualDevice() {}
@@ -50,7 +50,7 @@ public: // public for Sal Implementation
virtual void ReleaseGraphics( SalGraphics* pGraphics ) = 0;
// Set new size, without saving the old contents
- virtual BOOL SetSize( long nNewDX, long nNewDY ) = 0;
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY ) = 0;
/// Get actual VDev size in pixel
virtual void GetSize( long& rWidth, long& rHeight ) = 0;
diff --git a/vcl/inc/vcl/salwtype.hxx b/vcl/inc/vcl/salwtype.hxx
index 90ccb92af6a2..d8bd6c527f85 100644
--- a/vcl/inc/vcl/salwtype.hxx
+++ b/vcl/inc/vcl/salwtype.hxx
@@ -46,68 +46,68 @@ class ImplFontSelectData;
// Muessen mit den Defines in cmdevt.hxx uebereinstimmen, da diese
// nicht konvertiert werden
-#define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((USHORT)0x0100)
-#define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((USHORT)0x0200)
-#define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((USHORT)0x0400)
-#define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((USHORT)0x0800)
-#define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((USHORT)0x1000)
-#define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((USHORT)0x2000)
-#define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((USHORT)0x4000)
-#define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((USHORT)0x8000)
-
-#define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((USHORT)0x0001)
-#define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((USHORT)0x0002)
+#define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
+#define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
+#define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
+#define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
+#define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
+#define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
+#define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
+#define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
+
+#define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
// ------------
// - SalEvent -
// ------------
-#define SALEVENT_MOUSEMOVE ((USHORT)1)
-#define SALEVENT_MOUSELEAVE ((USHORT)2)
-#define SALEVENT_MOUSEBUTTONDOWN ((USHORT)3)
-#define SALEVENT_MOUSEBUTTONUP ((USHORT)4)
-#define SALEVENT_KEYINPUT ((USHORT)5)
-#define SALEVENT_KEYUP ((USHORT)6)
-#define SALEVENT_KEYMODCHANGE ((USHORT)7)
-#define SALEVENT_PAINT ((USHORT)8)
-#define SALEVENT_RESIZE ((USHORT)9)
-#define SALEVENT_GETFOCUS ((USHORT)10)
-#define SALEVENT_LOSEFOCUS ((USHORT)11)
-#define SALEVENT_CLOSE ((USHORT)12)
-#define SALEVENT_SHUTDOWN ((USHORT)13)
-#define SALEVENT_SETTINGSCHANGED ((USHORT)14)
-#define SALEVENT_VOLUMECHANGED ((USHORT)15)
-#define SALEVENT_PRINTERCHANGED ((USHORT)16)
-#define SALEVENT_DISPLAYCHANGED ((USHORT)17)
-#define SALEVENT_FONTCHANGED ((USHORT)18)
-#define SALEVENT_DATETIMECHANGED ((USHORT)19)
-#define SALEVENT_KEYBOARDCHANGED ((USHORT)20)
-#define SALEVENT_WHEELMOUSE ((USHORT)21)
-#define SALEVENT_USEREVENT ((USHORT)22)
-#define SALEVENT_MOUSEACTIVATE ((USHORT)23)
-#define SALEVENT_EXTTEXTINPUT ((USHORT)24)
-#define SALEVENT_ENDEXTTEXTINPUT ((USHORT)25)
-#define SALEVENT_EXTTEXTINPUTPOS ((USHORT)26)
-#define SALEVENT_INPUTCONTEXTCHANGE ((USHORT)27)
-#define SALEVENT_MOVE ((USHORT)28)
-#define SALEVENT_MOVERESIZE ((USHORT)29)
-#define SALEVENT_CLOSEPOPUPS ((USHORT)30)
-#define SALEVENT_EXTERNALKEYINPUT ((USHORT)31)
-#define SALEVENT_EXTERNALKEYUP ((USHORT)32)
-#define SALEVENT_MENUCOMMAND ((USHORT)33)
-#define SALEVENT_MENUHIGHLIGHT ((USHORT)34)
-#define SALEVENT_MENUACTIVATE ((USHORT)35)
-#define SALEVENT_MENUDEACTIVATE ((USHORT)36)
-#define SALEVENT_EXTERNALMOUSEMOVE ((USHORT)37)
-#define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((USHORT)38)
-#define SALEVENT_EXTERNALMOUSEBUTTONUP ((USHORT)39)
-#define SALEVENT_INPUTLANGUAGECHANGE ((USHORT)40)
-#define SALEVENT_SHOWDIALOG ((USHORT)41)
-#define SALEVENT_MENUBUTTONCOMMAND ((USHORT)42)
-#define SALEVENT_SURROUNDINGTEXTREQUEST ((USHORT)43)
-#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((USHORT)44)
-#define SALEVENT_STARTRECONVERSION ((USHORT)45)
-#define SALEVENT_COUNT ((USHORT)45)
+#define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
+#define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
+#define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3)
+#define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4)
+#define SALEVENT_KEYINPUT ((sal_uInt16)5)
+#define SALEVENT_KEYUP ((sal_uInt16)6)
+#define SALEVENT_KEYMODCHANGE ((sal_uInt16)7)
+#define SALEVENT_PAINT ((sal_uInt16)8)
+#define SALEVENT_RESIZE ((sal_uInt16)9)
+#define SALEVENT_GETFOCUS ((sal_uInt16)10)
+#define SALEVENT_LOSEFOCUS ((sal_uInt16)11)
+#define SALEVENT_CLOSE ((sal_uInt16)12)
+#define SALEVENT_SHUTDOWN ((sal_uInt16)13)
+#define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14)
+#define SALEVENT_VOLUMECHANGED ((sal_uInt16)15)
+#define SALEVENT_PRINTERCHANGED ((sal_uInt16)16)
+#define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17)
+#define SALEVENT_FONTCHANGED ((sal_uInt16)18)
+#define SALEVENT_DATETIMECHANGED ((sal_uInt16)19)
+#define SALEVENT_KEYBOARDCHANGED ((sal_uInt16)20)
+#define SALEVENT_WHEELMOUSE ((sal_uInt16)21)
+#define SALEVENT_USEREVENT ((sal_uInt16)22)
+#define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23)
+#define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24)
+#define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25)
+#define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26)
+#define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27)
+#define SALEVENT_MOVE ((sal_uInt16)28)
+#define SALEVENT_MOVERESIZE ((sal_uInt16)29)
+#define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30)
+#define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31)
+#define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32)
+#define SALEVENT_MENUCOMMAND ((sal_uInt16)33)
+#define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34)
+#define SALEVENT_MENUACTIVATE ((sal_uInt16)35)
+#define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36)
+#define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37)
+#define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38)
+#define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39)
+#define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40)
+#define SALEVENT_SHOWDIALOG ((sal_uInt16)41)
+#define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42)
+#define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43)
+#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44)
+#define SALEVENT_STARTRECONVERSION ((sal_uInt16)45)
+#define SALEVENT_COUNT ((sal_uInt16)45)
// MOUSELEAVE must send, when the pointer leave the client area and
// the mouse is not captured
@@ -115,39 +115,39 @@ class ImplFontSelectData;
// MAC: Ctrl+Button is MOUSE_RIGHT
struct SalMouseEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
long mnX; // X-Position (Pixel, TopLeft-Output)
long mnY; // Y-Position (Pixel, TopLeft-Output)
- USHORT mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
+ sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
};
// KEYINPUT and KEYUP
struct SalKeyEvent
{
- ULONG mnTime; // Time in ms, when event is created
- USHORT mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
- USHORT mnCharCode; // SV-CharCode
- USHORT mnRepeat; // Repeat-Count (KeyInputs-1)
+ sal_uLong mnTime; // Time in ms, when event is created
+ sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
+ sal_uInt16 mnCharCode; // SV-CharCode
+ sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
};
// MENUEVENT
struct SalMenuEvent
{
- USHORT mnId; // Menu item ID
+ sal_uInt16 mnId; // Menu item ID
void* mpMenu; // pointer to VCL menu (class Menu)
SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {}
- SalMenuEvent( USHORT i_nId, void* i_pMenu )
+ SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
: mnId( i_nId ), mpMenu( i_pMenu ) {}
};
// KEYMODCHANGE
struct SalKeyModEvent
{
- ULONG mnTime; // Time in ms, when event is created
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
- USHORT mnModKeyCode; // extended Modifier (MODKEY_LEFT, MODKEY_RIGHT, MODKEY_PRESS, MODKEY_RELEASE)
+ sal_uLong mnTime; // Time in ms, when event is created
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
+ sal_uInt16 mnModKeyCode; // extended Modifier (MODKEY_LEFT, MODKEY_RIGHT, MODKEY_PRESS, MODKEY_RELEASE)
};
// PAINT
@@ -170,21 +170,21 @@ struct SalPaintEvent
// pEvent == pData
// WHEELMOUSE
-#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((ULONG)0xFFFFFFFF)
+#define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
struct SalWheelMouseEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
long mnX; // X-Position (Pixel, TopLeft-Output)
long mnY; // Y-Position (Pixel, TopLeft-Output)
long mnDelta; // Anzahl Drehungen
long mnNotchDelta; // Anzahl feste Drehungen
- ULONG mnScrollLines; // Aktuelle Anzahl zu scrollende Zeilen
- USHORT mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
- BOOL mbHorz; // Horizontal
- BOOL mbDeltaIsPixel; // delta value is a pixel value (on mac)
+ sal_uLong mnScrollLines; // Aktuelle Anzahl zu scrollende Zeilen
+ sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT)
+ sal_Bool mbHorz; // Horizontal
+ sal_Bool mbDeltaIsPixel; // delta value is a pixel value (on mac)
SalWheelMouseEvent()
- : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( FALSE ), mbDeltaIsPixel( FALSE )
+ : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False )
{}
};
@@ -200,13 +200,13 @@ struct SalMouseActivateEvent
// EXTTEXTINPUT
struct SalExtTextInputEvent
{
- ULONG mnTime; // Time in ms, when event is created
+ sal_uLong mnTime; // Time in ms, when event is created
UniString maText; // Text
- const USHORT* mpTextAttr; // Text-Attribute
- ULONG mnCursorPos; // Cursor-Position
- ULONG mnDeltaStart; // Start-Position der letzten Aenderung
- BYTE mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx
- BOOL mbOnlyCursor; // TRUE: Nur Cursor-Position wurde geaendert
+ const sal_uInt16* mpTextAttr; // Text-Attribute
+ sal_uLong mnCursorPos; // Cursor-Position
+ sal_uLong mnDeltaStart; // Start-Position der letzten Aenderung
+ sal_uInt8 mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx
+ sal_Bool mbOnlyCursor; // sal_True: Nur Cursor-Position wurde geaendert
};
#endif // __cplusplus
@@ -238,8 +238,8 @@ struct SalInputContextChangeEvent
struct SalSurroundingTextRequestEvent
{
UniString maText; // Text
- ULONG mnStart; // The beggining index of selected range
- ULONG mnEnd; // The end index of selected range
+ sal_uLong mnStart; // The beggining index of selected range
+ sal_uLong mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -249,8 +249,8 @@ struct SalSurroundingTextRequestEvent
// SURROUNDINGTEXTSELECTIONCHANGE
struct SalSurroundingTextSelectionChangeEvent
{
- ULONG mnStart; // The beggining index of selected range
- ULONG mnEnd; // The end index of selected range
+ sal_uLong mnStart; // The beggining index of selected range
+ sal_uLong mnEnd; // The end index of selected range
};
#endif // __cplusplus
@@ -260,50 +260,50 @@ struct SalSurroundingTextSelectionChangeEvent
// ------------------
typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
- USHORT nEvent, const void* pEvent );
+ sal_uInt16 nEvent, const void* pEvent );
// --------------------
// - SalObject-Events -
// --------------------
-#define SALOBJ_EVENT_GETFOCUS ((USHORT)1)
-#define SALOBJ_EVENT_LOSEFOCUS ((USHORT)2)
-#define SALOBJ_EVENT_TOTOP ((USHORT)3)
-#define SALOBJ_EVENT_COUNT ((USHORT)4)
+#define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1)
+#define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2)
+#define SALOBJ_EVENT_TOTOP ((sal_uInt16)3)
+#define SALOBJ_EVENT_COUNT ((sal_uInt16)4)
// ------------------
// - SalObject-Types -
// ------------------
typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
- USHORT nEvent, const void* pEvent );
+ sal_uInt16 nEvent, const void* pEvent );
// -----------------
// - SalFrameState -
// -----------------
// Must be the same as in syswin.hxx
-#define SAL_FRAMESTATE_MASK_X ((ULONG)0x00000001)
-#define SAL_FRAMESTATE_MASK_Y ((ULONG)0x00000002)
-#define SAL_FRAMESTATE_MASK_WIDTH ((ULONG)0x00000004)
-#define SAL_FRAMESTATE_MASK_HEIGHT ((ULONG)0x00000008)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((ULONG)0x00000100)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((ULONG)0x00000200)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((ULONG)0x00000400)
-#define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((ULONG)0x00000800)
-#define SAL_FRAMESTATE_MASK_STATE ((ULONG)0x00000010)
-
-#define SAL_FRAMESTATE_NORMAL ((ULONG)0x00000001)
-#define SAL_FRAMESTATE_MINIMIZED ((ULONG)0x00000002)
-#define SAL_FRAMESTATE_MAXIMIZED ((ULONG)0x00000004)
-#define SAL_FRAMESTATE_ROLLUP ((ULONG)0x00000008)
-#define SAL_FRAMESTATE_MAXIMIZED_HORZ ((ULONG)0x00000010)
-#define SAL_FRAMESTATE_MAXIMIZED_VERT ((ULONG)0x00000020)
-#define SAL_FRAMESTATE_SYSTEMMASK ((ULONG)0x0000FFFF)
+#define SAL_FRAMESTATE_MASK_X ((sal_uLong)0x00000001)
+#define SAL_FRAMESTATE_MASK_Y ((sal_uLong)0x00000002)
+#define SAL_FRAMESTATE_MASK_WIDTH ((sal_uLong)0x00000004)
+#define SAL_FRAMESTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
+#define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
+#define SAL_FRAMESTATE_MASK_STATE ((sal_uLong)0x00000010)
+
+#define SAL_FRAMESTATE_NORMAL ((sal_uLong)0x00000001)
+#define SAL_FRAMESTATE_MINIMIZED ((sal_uLong)0x00000002)
+#define SAL_FRAMESTATE_MAXIMIZED ((sal_uLong)0x00000004)
+#define SAL_FRAMESTATE_ROLLUP ((sal_uLong)0x00000008)
+#define SAL_FRAMESTATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
+#define SAL_FRAMESTATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
+#define SAL_FRAMESTATE_SYSTEMMASK ((sal_uLong)0x0000FFFF)
struct SalFrameState
{
- ULONG mnMask;
+ sal_uLong mnMask;
long mnX;
long mnY;
long mnWidth;
@@ -312,7 +312,7 @@ struct SalFrameState
long mnMaximizedY;
long mnMaximizedWidth;
long mnMaximizedHeight;
- ULONG mnState;
+ sal_uLong mnState;
};
// -------------------
@@ -321,11 +321,11 @@ struct SalFrameState
// Muessen mit den Defines in inputctx.hxx uebereinstimmen, da diese
// nicht konvertiert werden
-#define SAL_INPUTCONTEXT_TEXT ((ULONG)0x00000001)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((ULONG)0x00000002)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((ULONG)0x00000004)
-#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((ULONG)0x00000008)
-#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((ULONG)0x00000010)
+#define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
+#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
+#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010)
#ifdef __cplusplus
@@ -333,7 +333,7 @@ struct SalInputContext
{
ImplFontSelectData* mpFont;
LanguageType meLanguage;
- ULONG mnOptions;
+ sal_uLong mnOptions;
};
#endif // __cplusplus
diff --git a/vcl/inc/vcl/scrbar.hxx b/vcl/inc/vcl/scrbar.hxx
index fd675461cac5..6e894bc2263b 100644
--- a/vcl/inc/vcl/scrbar.hxx
+++ b/vcl/inc/vcl/scrbar.hxx
@@ -68,12 +68,12 @@ private:
long mnLineSize;
long mnPageSize;
long mnDelta;
- USHORT mnDragDraw;
- USHORT mnStateFlags;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
ScrollType meScrollType;
ScrollType meDDScrollType;
- BOOL mbCalcSize;
- BOOL mbFullDrag;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
Link maScrollHdl;
Link maEndScrollHdl;
@@ -82,17 +82,17 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplUpdateRects( BOOL bUpdate = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
- SAL_DLLPRIVATE void ImplCalc( BOOL bUpdate = TRUE );
- SAL_DLLPRIVATE void ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev );
using Window::ImplScroll;
- SAL_DLLPRIVATE long ImplScroll( long nNewPos, BOOL bCallEndScroll );
- SAL_DLLPRIVATE long ImplDoAction( BOOL bCallEndScroll );
- SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
+ SAL_DLLPRIVATE long ImplScroll( long nNewPos, sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndScroll );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
SAL_DLLPRIVATE void ImplInvert();
- SAL_DLLPRIVATE BOOL ImplDrawNative( USHORT nDrawFlags );
+ SAL_DLLPRIVATE sal_Bool ImplDrawNative( sal_uInt16 nDrawFlags );
SAL_DLLPRIVATE void ImplDragThumb( const Point& rMousePos );
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
DECL_DLLPRIVATE_LINK( ImplAutoTimerHdl, AutoTimer* );
@@ -106,7 +106,7 @@ public:
virtual void Tracking( const TrackingEvent& rTEvt );
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -121,9 +121,9 @@ public:
long DoScroll( long nNewPos );
long DoScrollAction( ScrollType eScrollType );
- void EnableDrag( BOOL bEnable = TRUE )
+ void EnableDrag( sal_Bool bEnable = sal_True )
{ mbFullDrag = bEnable; }
- BOOL IsDragEnabled() const { return mbFullDrag; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
void SetRangeMin( long nNewRange );
long GetRangeMin() const { return mnMinRange; }
diff --git a/vcl/inc/vcl/seleng.hxx b/vcl/inc/vcl/seleng.hxx
index 67c2f735ac71..8466df46a901 100644
--- a/vcl/inc/vcl/seleng.hxx
+++ b/vcl/inc/vcl/seleng.hxx
@@ -57,11 +57,11 @@ public:
virtual void DestroyAnchor() = 0;
// Cursor neu setzen, dabei die beim Anker beginnende
- // Selektion der neuen Cursor-Position anpassen. TRUE == Ok
- virtual BOOL SetCursorAtPoint( const Point& rPointPixel,
- BOOL bDontSelectAtCursor = FALSE ) = 0;
+ // Selektion der neuen Cursor-Position anpassen. sal_True == Ok
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel,
+ sal_Bool bDontSelectAtCursor = sal_False ) = 0;
- virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ) = 0;
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ) = 0;
virtual void DeselectAtPoint( const Point& rPointPixel ) = 0;
// Anker loeschen & alles deselektieren
virtual void DeselectAll() = 0;
@@ -90,29 +90,29 @@ private:
Timer aWTimer; // erzeugt kuenstliche Mouse-Moves
MouseEvent aLastMove;
SelectionMode eSelMode;
- ULONG nUpdateInterval;
+ sal_uLong nUpdateInterval;
// Stufigkeit fuer Mausbewegungen waehrend einer Selektion
- USHORT nMouseSensitivity;
- USHORT nLockedMods;
- USHORT nFlags;
+ sal_uInt16 nMouseSensitivity;
+ sal_uInt16 nLockedMods;
+ sal_uInt16 nFlags;
DECL_DLLPRIVATE_LINK( ImpWatchDog, Timer * );
- inline BOOL ShouldDeselect( BOOL bModifierKey1 ) const;
+ inline sal_Bool ShouldDeselect( sal_Bool bModifierKey1 ) const;
// determines to deselect or not when Ctrl-key is pressed on CursorPosChanging
public:
SelectionEngine( Window* pWindow,
FunctionSet* pFunctions = NULL,
- ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
+ sal_uLong nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
~SelectionEngine();
- // TRUE: Event wurde von Selection-Engine verarbeitet.
- BOOL SelMouseButtonDown( const MouseEvent& rMEvt );
- BOOL SelMouseButtonUp( const MouseEvent& rMEvt );
- BOOL SelMouseMove( const MouseEvent& rMEvt );
+ // sal_True: Event wurde von Selection-Engine verarbeitet.
+ sal_Bool SelMouseButtonDown( const MouseEvent& rMEvt );
+ sal_Bool SelMouseButtonUp( const MouseEvent& rMEvt );
+ sal_Bool SelMouseMove( const MouseEvent& rMEvt );
// Tastatur
- void CursorPosChanging( BOOL bShift, BOOL bMod1 );
+ void CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 );
// wird benoetigt, um bei ausserhalb des Bereichs stehender
// Maus ueber einen Timer Move-Events zu erzeugen
@@ -120,16 +120,16 @@ public:
{ aArea = rNewArea; }
const Rectangle& GetVisibleArea() const { return aArea; }
- void SetAddMode( BOOL);
- BOOL IsAddMode() const;
+ void SetAddMode( sal_Bool);
+ sal_Bool IsAddMode() const;
- void AddAlways( BOOL bOn );
- BOOL IsAlwaysAdding() const;
+ void AddAlways( sal_Bool bOn );
+ sal_Bool IsAlwaysAdding() const;
- void EnableDrag( BOOL bOn );
- BOOL IsDragEnabled() const;
+ void EnableDrag( sal_Bool bOn );
+ sal_Bool IsDragEnabled() const;
void ActivateDragMode();
- BOOL IsInDragMode() const;
+ sal_Bool IsInDragMode() const;
void SetSelectionMode( SelectionMode eMode );
SelectionMode GetSelectionMode() const { return eSelMode; }
@@ -138,9 +138,9 @@ public:
{ pFunctionSet = pFuncs; }
const FunctionSet* GetFunctionSet() const { return pFunctionSet; }
- void SetMouseSensitivity( USHORT nSensitivity )
+ void SetMouseSensitivity( sal_uInt16 nSensitivity )
{ nMouseSensitivity = nSensitivity; }
- USHORT GetMouseSensitivity() const
+ sal_uInt16 GetMouseSensitivity() const
{ return nMouseSensitivity; }
const Point& GetMousePosPixel() const
@@ -150,22 +150,22 @@ public:
void SetWindow( Window*);
Window* GetWindow() const { return pWin; }
- void LockModifiers( USHORT nModifiers )
+ void LockModifiers( sal_uInt16 nModifiers )
{ nLockedMods = nModifiers; }
- USHORT GetLockedModifiers() const { return nLockedMods; }
+ sal_uInt16 GetLockedModifiers() const { return nLockedMods; }
- BOOL IsInSelection() const;
+ sal_Bool IsInSelection() const;
void Reset();
void Command( const CommandEvent& rCEvt );
- BOOL HasAnchor() const;
- void SetAnchor( BOOL bAnchor );
+ sal_Bool HasAnchor() const;
+ void SetAnchor( sal_Bool bAnchor );
- void SetUpdateInterval( ULONG nInterval );
+ void SetUpdateInterval( sal_uLong nInterval );
// wird im Ctor eingeschaltet
- void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
+ void ExpandSelectionOnMouseMove( sal_Bool bExpand = sal_True )
{
if( bExpand )
nFlags |= SELENG_EXPANDONMOVE;
@@ -174,23 +174,23 @@ public:
}
};
-inline BOOL SelectionEngine::IsDragEnabled() const
+inline sal_Bool SelectionEngine::IsDragEnabled() const
{
if ( nFlags & SELENG_DRG_ENAB )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsAddMode() const
+inline sal_Bool SelectionEngine::IsAddMode() const
{
if ( nFlags & (SELENG_IN_ADD | SELENG_ADD_ALW) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline void SelectionEngine::SetAddMode( BOOL bNewMode )
+inline void SelectionEngine::SetAddMode( sal_Bool bNewMode )
{
if ( bNewMode )
nFlags |= SELENG_IN_ADD;
@@ -198,7 +198,7 @@ inline void SelectionEngine::SetAddMode( BOOL bNewMode )
nFlags &= (~SELENG_IN_ADD);
}
-inline void SelectionEngine::EnableDrag( BOOL bOn )
+inline void SelectionEngine::EnableDrag( sal_Bool bOn )
{
if ( bOn )
nFlags |= SELENG_DRG_ENAB;
@@ -206,7 +206,7 @@ inline void SelectionEngine::EnableDrag( BOOL bOn )
nFlags &= (~SELENG_DRG_ENAB);
}
-inline void SelectionEngine::AddAlways( BOOL bOn )
+inline void SelectionEngine::AddAlways( sal_Bool bOn )
{
if( bOn )
nFlags |= SELENG_ADD_ALW;
@@ -214,39 +214,39 @@ inline void SelectionEngine::AddAlways( BOOL bOn )
nFlags &= (~SELENG_ADD_ALW);
}
-inline BOOL SelectionEngine::IsAlwaysAdding() const
+inline sal_Bool SelectionEngine::IsAlwaysAdding() const
{
if ( nFlags & SELENG_ADD_ALW )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsInDragMode() const
+inline sal_Bool SelectionEngine::IsInDragMode() const
{
if ( nFlags & SELENG_IN_DRG )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::IsInSelection() const
+inline sal_Bool SelectionEngine::IsInSelection() const
{
if ( nFlags & SELENG_IN_SEL )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL SelectionEngine::HasAnchor() const
+inline sal_Bool SelectionEngine::HasAnchor() const
{
if ( nFlags & SELENG_HAS_ANCH )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline void SelectionEngine::SetAnchor( BOOL bAnchor )
+inline void SelectionEngine::SetAnchor( sal_Bool bAnchor )
{
if ( bAnchor )
nFlags |= SELENG_HAS_ANCH;
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index dc51764b6554..cc5b44169ff6 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -57,10 +57,10 @@ class ImplMachineData
ImplMachineData( const ImplMachineData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnScreenOptions;
- ULONG mnPrintOptions;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnScreenOptions;
+ sal_uLong mnPrintOptions;
long mnScreenRasterFontDeviation;
};
@@ -80,17 +80,17 @@ public:
MachineSettings( const MachineSettings& rSet );
~MachineSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetScreenOptions( ULONG nOptions )
+ void SetScreenOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnScreenOptions = nOptions; }
- ULONG GetScreenOptions() const
+ sal_uLong GetScreenOptions() const
{ return mpData->mnScreenOptions; }
- void SetPrintOptions( ULONG nOptions )
+ void SetPrintOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnPrintOptions = nOptions; }
- ULONG GetPrintOptions() const
+ sal_uLong GetPrintOptions() const
{ return mpData->mnPrintOptions; }
void SetScreenRasterFontDeviation( long nDeviation )
@@ -100,8 +100,8 @@ public:
const MachineSettings& operator =( const MachineSettings& rSet );
- BOOL operator ==( const MachineSettings& rSet ) const;
- BOOL operator !=( const MachineSettings& rSet ) const
+ sal_Bool operator ==( const MachineSettings& rSet ) const;
+ sal_Bool operator !=( const MachineSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -117,49 +117,49 @@ class ImplMouseData
ImplMouseData( const ImplMouseData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnDoubleClkTime;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnDoubleClkTime;
long mnDoubleClkWidth;
long mnDoubleClkHeight;
long mnStartDragWidth;
long mnStartDragHeight;
- USHORT mnStartDragCode;
- USHORT mnDragMoveCode;
- USHORT mnDragCopyCode;
- USHORT mnDragLinkCode;
- USHORT mnContextMenuCode;
- USHORT mnContextMenuClicks;
- BOOL mbContextMenuDown;
- ULONG mnScrollRepeat;
- ULONG mnButtonStartRepeat;
- ULONG mnButtonRepeat;
- ULONG mnActionDelay;
- ULONG mnMenuDelay;
- ULONG mnFollow;
- USHORT mnMiddleButtonAction;
- USHORT mnWheelBehavior;
- BOOL mbAlign1;
+ sal_uInt16 mnStartDragCode;
+ sal_uInt16 mnDragMoveCode;
+ sal_uInt16 mnDragCopyCode;
+ sal_uInt16 mnDragLinkCode;
+ sal_uInt16 mnContextMenuCode;
+ sal_uInt16 mnContextMenuClicks;
+ sal_Bool mbContextMenuDown;
+ sal_uLong mnScrollRepeat;
+ sal_uLong mnButtonStartRepeat;
+ sal_uLong mnButtonRepeat;
+ sal_uLong mnActionDelay;
+ sal_uLong mnMenuDelay;
+ sal_uLong mnFollow;
+ sal_uInt16 mnMiddleButtonAction;
+ sal_uInt16 mnWheelBehavior;
+ sal_Bool mbAlign1;
};
// -----------------
// - MouseSettings -
// -----------------
-#define MOUSE_OPTION_AUTOFOCUS ((ULONG)0x00000001)
-#define MOUSE_OPTION_AUTOCENTERPOS ((ULONG)0x00000002)
-#define MOUSE_OPTION_AUTODEFBTNPOS ((ULONG)0x00000004)
+#define MOUSE_OPTION_AUTOFOCUS ((sal_uLong)0x00000001)
+#define MOUSE_OPTION_AUTOCENTERPOS ((sal_uLong)0x00000002)
+#define MOUSE_OPTION_AUTODEFBTNPOS ((sal_uLong)0x00000004)
-#define MOUSE_FOLLOW_MENU ((ULONG)0x00000001)
-#define MOUSE_FOLLOW_DDLIST ((ULONG)0x00000002)
+#define MOUSE_FOLLOW_MENU ((sal_uLong)0x00000001)
+#define MOUSE_FOLLOW_DDLIST ((sal_uLong)0x00000002)
-#define MOUSE_MIDDLE_NOTHING ((USHORT)0)
-#define MOUSE_MIDDLE_AUTOSCROLL ((USHORT)1)
-#define MOUSE_MIDDLE_PASTESELECTION ((USHORT)2)
+#define MOUSE_MIDDLE_NOTHING ((sal_uInt16)0)
+#define MOUSE_MIDDLE_AUTOSCROLL ((sal_uInt16)1)
+#define MOUSE_MIDDLE_PASTESELECTION ((sal_uInt16)2)
-#define MOUSE_WHEEL_DISABLE ((USHORT)0)
-#define MOUSE_WHEEL_FOCUS_ONLY ((USHORT)1)
-#define MOUSE_WHEEL_ALWAYS ((USHORT)2)
+#define MOUSE_WHEEL_DISABLE ((sal_uInt16)0)
+#define MOUSE_WHEEL_FOCUS_ONLY ((sal_uInt16)1)
+#define MOUSE_WHEEL_ALWAYS ((sal_uInt16)2)
class VCL_DLLPUBLIC MouseSettings
{
@@ -173,14 +173,14 @@ public:
MouseSettings( const MouseSettings& rSet );
~MouseSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetDoubleClickTime( ULONG nDoubleClkTime )
+ void SetDoubleClickTime( sal_uLong nDoubleClkTime )
{ CopyData(); mpData->mnDoubleClkTime = nDoubleClkTime; }
- ULONG GetDoubleClickTime() const
+ sal_uLong GetDoubleClickTime() const
{ return mpData->mnDoubleClkTime; }
void SetDoubleClickWidth( long nDoubleClkWidth )
{ CopyData(); mpData->mnDoubleClkWidth = nDoubleClkWidth; }
@@ -199,76 +199,76 @@ public:
{ CopyData(); mpData->mnStartDragHeight = nDragHeight; }
long GetStartDragHeight() const
{ return mpData->mnStartDragHeight; }
- void SetStartDragCode( USHORT nCode )
+ void SetStartDragCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnStartDragCode = nCode; }
- USHORT GetStartDragCode() const
+ sal_uInt16 GetStartDragCode() const
{ return mpData->mnStartDragCode; }
- void SetDragMoveCode( USHORT nCode )
+ void SetDragMoveCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragMoveCode = nCode; }
- USHORT GetDragMoveCode() const
+ sal_uInt16 GetDragMoveCode() const
{ return mpData->mnDragMoveCode; }
- void SetDragCopyCode( USHORT nCode )
+ void SetDragCopyCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragCopyCode = nCode; }
- USHORT GetDragCopyCode() const
+ sal_uInt16 GetDragCopyCode() const
{ return mpData->mnDragCopyCode; }
- void SetDragLinkCode( USHORT nCode )
+ void SetDragLinkCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnDragLinkCode = nCode; }
- USHORT GetDragLinkCode() const
+ sal_uInt16 GetDragLinkCode() const
{ return mpData->mnDragLinkCode; }
- void SetContextMenuCode( USHORT nCode )
+ void SetContextMenuCode( sal_uInt16 nCode )
{ CopyData(); mpData->mnContextMenuCode = nCode; }
- USHORT GetContextMenuCode() const
+ sal_uInt16 GetContextMenuCode() const
{ return mpData->mnContextMenuCode; }
- void SetContextMenuClicks( USHORT nClicks )
+ void SetContextMenuClicks( sal_uInt16 nClicks )
{ CopyData(); mpData->mnContextMenuClicks = nClicks; }
- USHORT GetContextMenuClicks() const
+ sal_uInt16 GetContextMenuClicks() const
{ return mpData->mnContextMenuClicks; }
- void SetContextMenuDown( BOOL bDown )
+ void SetContextMenuDown( sal_Bool bDown )
{ CopyData(); mpData->mbContextMenuDown = bDown; }
- BOOL GetContextMenuDown() const
+ sal_Bool GetContextMenuDown() const
{ return mpData->mbContextMenuDown; }
- void SetScrollRepeat( ULONG nRepeat )
+ void SetScrollRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnScrollRepeat = nRepeat; }
- ULONG GetScrollRepeat() const
+ sal_uLong GetScrollRepeat() const
{ return mpData->mnScrollRepeat; }
- void SetButtonStartRepeat( ULONG nRepeat )
+ void SetButtonStartRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnButtonStartRepeat = nRepeat; }
- ULONG GetButtonStartRepeat() const
+ sal_uLong GetButtonStartRepeat() const
{ return mpData->mnButtonStartRepeat; }
- void SetButtonRepeat( ULONG nRepeat )
+ void SetButtonRepeat( sal_uLong nRepeat )
{ CopyData(); mpData->mnButtonRepeat = nRepeat; }
- ULONG GetButtonRepeat() const
+ sal_uLong GetButtonRepeat() const
{ return mpData->mnButtonRepeat; }
- void SetActionDelay( ULONG nDelay )
+ void SetActionDelay( sal_uLong nDelay )
{ CopyData(); mpData->mnActionDelay = nDelay; }
- ULONG GetActionDelay() const
+ sal_uLong GetActionDelay() const
{ return mpData->mnActionDelay; }
- void SetMenuDelay( ULONG nDelay )
+ void SetMenuDelay( sal_uLong nDelay )
{ CopyData(); mpData->mnMenuDelay = nDelay; }
- ULONG GetMenuDelay() const
+ sal_uLong GetMenuDelay() const
{ return mpData->mnMenuDelay; }
- void SetFollow( ULONG nFollow )
+ void SetFollow( sal_uLong nFollow )
{ CopyData(); mpData->mnFollow = nFollow; }
- ULONG GetFollow() const
+ sal_uLong GetFollow() const
{ return mpData->mnFollow; }
- void SetMiddleButtonAction( USHORT nAction )
+ void SetMiddleButtonAction( sal_uInt16 nAction )
{ CopyData(); mpData->mnMiddleButtonAction = nAction; }
- USHORT GetMiddleButtonAction() const
+ sal_uInt16 GetMiddleButtonAction() const
{ return mpData->mnMiddleButtonAction; }
- void SetWheelBehavior( USHORT nBehavior )
+ void SetWheelBehavior( sal_uInt16 nBehavior )
{ CopyData(); mpData->mnWheelBehavior = nBehavior; }
- USHORT GetWheelBehavior() const
+ sal_uInt16 GetWheelBehavior() const
{ return mpData->mnWheelBehavior; }
const MouseSettings& operator =( const MouseSettings& rSet );
- BOOL operator ==( const MouseSettings& rSet ) const;
- BOOL operator !=( const MouseSettings& rSet ) const
+ sal_Bool operator ==( const MouseSettings& rSet ) const;
+ sal_Bool operator !=( const MouseSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -284,16 +284,16 @@ class ImplKeyboardData
ImplKeyboardData( const ImplKeyboardData& rData );
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
Accelerator maStandardAccel;
- ULONG mnOptions;
+ sal_uLong mnOptions;
};
// --------------------
// - KeyboardSettings -
// --------------------
-#define KEYBOARD_OPTION_QUICKCURSOR ((ULONG)0x00000001)
+#define KEYBOARD_OPTION_QUICKCURSOR ((sal_uLong)0x00000001)
class VCL_DLLPUBLIC KeyboardSettings
{
@@ -312,15 +312,15 @@ public:
const Accelerator& GetStandardAccel() const
{ return mpData->maStandardAccel; }
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
const KeyboardSettings& operator =( const KeyboardSettings& rSet );
- BOOL operator ==( const KeyboardSettings& rSet ) const;
- BOOL operator !=( const KeyboardSettings& rSet ) const
+ sal_Bool operator ==( const KeyboardSettings& rSet ) const;
+ sal_Bool operator !=( const KeyboardSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -337,7 +337,7 @@ class ImplStyleData
void SetStandardStyles();
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
void* mpStyleData_NotUsedYet;
@@ -413,31 +413,27 @@ private:
long mnIconHorzSpace;
long mnIconVertSpace;
long mnAntialiasedMin;
- ULONG mnCursorBlinkTime;
- ULONG mnDragFullOptions;
- ULONG mnAnimationOptions;
- ULONG mnSelectionOptions;
- ULONG mnLogoDisplayTime;
- ULONG mnDisplayOptions;
- ULONG mnToolbarIconSize;
- ULONG mnUseFlatMenues;
- ULONG mnOptions;
- USHORT mnScreenZoom;
- USHORT mnScreenFontZoom;
- USHORT mnRadioButtonStyle;
- USHORT mnCheckBoxStyle;
- USHORT mnPushButtonStyle;
- USHORT mnTabControlStyle;
- USHORT mnHighContrast;
- USHORT mnUseSystemUIFonts;
- USHORT mnAutoMnemonic;
- USHORT mnUseImagesInMenus;
- BOOL mbPreferredUseImagesInMenus;
- ULONG mnUseFlatBorders;
+ sal_uLong mnCursorBlinkTime;
+ sal_uLong mnDragFullOptions;
+ sal_uLong mnAnimationOptions;
+ sal_uLong mnSelectionOptions;
+ sal_uLong mnLogoDisplayTime;
+ sal_uLong mnDisplayOptions;
+ sal_uLong mnToolbarIconSize;
+ sal_uLong mnUseFlatMenues;
+ sal_uLong mnOptions;
+ sal_uInt16 mnScreenZoom;
+ sal_uInt16 mnScreenFontZoom;
+ sal_uInt16 mnHighContrast;
+ sal_uInt16 mnUseSystemUIFonts;
+ sal_uInt16 mnAutoMnemonic;
+ sal_uInt16 mnUseImagesInMenus;
+ sal_uLong mnUseFlatBorders;
+ sal_Bool mbPreferredUseImagesInMenus;
long mnMinThumbSize;
- ULONG mnSymbolsStyle;
- ULONG mnPreferredSymbolsStyle;
- USHORT mnSkipDisabledInMenus;
+ sal_uLong mnSymbolsStyle;
+ sal_uLong mnPreferredSymbolsStyle;
+ sal_uInt16 mnSkipDisabledInMenus;
Wallpaper maWorkspaceGradient;
const void* mpFontOptions;
};
@@ -449,90 +445,65 @@ private:
// - StyleSettings -
// -----------------
-#define STYLE_OPTION_MONO ((ULONG)0x00000001)
-#define STYLE_OPTION_COLOR ((ULONG)0x00000002)
-#define STYLE_OPTION_FLAT ((ULONG)0x00000004)
-#define STYLE_OPTION_GREAT ((ULONG)0x00000008)
-#define STYLE_OPTION_HIGHLIGHT ((ULONG)0x00000010)
-#define STYLE_OPTION_ADVANCEDUSER ((ULONG)0x00000020)
-#define STYLE_OPTION_SCROLLARROW ((ULONG)0x00000040)
-#define STYLE_OPTION_SPINARROW ((ULONG)0x00000080)
-#define STYLE_OPTION_SPINUPDOWN ((ULONG)0x00000100)
-#define STYLE_OPTION_NOMNEMONICS ((ULONG)0x00000200)
-#define STYLE_OPTION_WINSTYLE ((ULONG)0x00010000)
-#define STYLE_OPTION_OS2STYLE ((ULONG)0x00020000)
-#define STYLE_OPTION_MACSTYLE ((ULONG)0x00040000)
-#define STYLE_OPTION_UNIXSTYLE ((ULONG)0x00080000)
-#define STYLE_OPTION_SYSTEMSTYLE ((ULONG)0x000F0000)
-#define STYLE_OPTION_HIDEDISABLED ((ULONG)0x00100000)
-
-#define DRAGFULL_OPTION_WINDOWMOVE ((ULONG)0x00000001)
-#define DRAGFULL_OPTION_WINDOWSIZE ((ULONG)0x00000002)
-#define DRAGFULL_OPTION_OBJECTMOVE ((ULONG)0x00000004)
-#define DRAGFULL_OPTION_OBJECTSIZE ((ULONG)0x00000008)
-#define DRAGFULL_OPTION_DOCKING ((ULONG)0x00000010)
-#define DRAGFULL_OPTION_SPLIT ((ULONG)0x00000020)
-#define DRAGFULL_OPTION_SCROLL ((ULONG)0x00000040)
-
-#define LOGO_DISPLAYTIME_NOLOGO ((ULONG)0)
-#define LOGO_DISPLAYTIME_STARTTIME ((ULONG)0xFFFFFFFF)
-
-#define ANIMATION_OPTION_MINIMIZE ((ULONG)0x00000001)
-#define ANIMATION_OPTION_POPUP ((ULONG)0x00000002)
-#define ANIMATION_OPTION_DIALOG ((ULONG)0x00000004)
-#define ANIMATION_OPTION_TREE ((ULONG)0x00000008)
-#define ANIMATION_OPTION_SCROLL ((ULONG)0x00000010)
-
-#define SELECTION_OPTION_WORD ((ULONG)0x00000001)
-#define SELECTION_OPTION_FOCUS ((ULONG)0x00000002)
-#define SELECTION_OPTION_INVERT ((ULONG)0x00000004)
-#define SELECTION_OPTION_SHOWFIRST ((ULONG)0x00000008)
-
-#define DISPLAY_OPTION_AA_DISABLE ((ULONG)0x00000001)
-
-#define STYLE_RADIOBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_RADIOBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_RADIOBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_RADIOBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_RADIOBUTTON_MONO ((USHORT)0x0005)
-#define STYLE_RADIOBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_CHECKBOX_WIN ((USHORT)0x0001)
-#define STYLE_CHECKBOX_OS2 ((USHORT)0x0002)
-#define STYLE_CHECKBOX_MAC ((USHORT)0x0003)
-#define STYLE_CHECKBOX_UNIX ((USHORT)0x0004)
-#define STYLE_CHECKBOX_MONO ((USHORT)0x0005)
-#define STYLE_CHECKBOX_STYLE ((USHORT)0x000F)
-
-#define STYLE_PUSHBUTTON_WIN ((USHORT)0x0001)
-#define STYLE_PUSHBUTTON_OS2 ((USHORT)0x0002)
-#define STYLE_PUSHBUTTON_MAC ((USHORT)0x0003)
-#define STYLE_PUSHBUTTON_UNIX ((USHORT)0x0004)
-#define STYLE_PUSHBUTTON_STYLE ((USHORT)0x000F)
-
-#define STYLE_TABCONTROL_SINGLELINE ((USHORT)0x0001)
-#define STYLE_TABCONTROL_COLOR ((USHORT)0x0002)
-
-#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((ULONG)0)
-#define STYLE_TOOLBAR_ICONSIZE_SMALL ((ULONG)1)
-#define STYLE_TOOLBAR_ICONSIZE_LARGE ((ULONG)2)
-
-#define STYLE_SYMBOLS_AUTO ((ULONG)0)
-#define STYLE_SYMBOLS_DEFAULT ((ULONG)1)
-#define STYLE_SYMBOLS_HICONTRAST ((ULONG)2)
-#define STYLE_SYMBOLS_INDUSTRIAL ((ULONG)3)
-#define STYLE_SYMBOLS_CRYSTAL ((ULONG)4)
-#define STYLE_SYMBOLS_TANGO ((ULONG)5)
-#define STYLE_SYMBOLS_OXYGEN ((ULONG)6)
-#define STYLE_SYMBOLS_CLASSIC ((ULONG)7)
-#define STYLE_SYMBOLS_HUMAN ((ULONG)8)
-#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)9)
-
-#define STYLE_MENUIMAGES_OFF ((USHORT)0)
-#define STYLE_MENUIMAGES_ON ((USHORT)1)
-#define STYLE_MENUIMAGES_AUTO ((USHORT)2)
-
-#define STYLE_CURSOR_NOBLINKTIME ((ULONG)0xFFFFFFFF)
+#define STYLE_OPTION_MONO ((sal_uLong)0x00000001)
+#define STYLE_OPTION_COLOR ((sal_uLong)0x00000002)
+#define STYLE_OPTION_FLAT ((sal_uLong)0x00000004)
+#define STYLE_OPTION_GREAT ((sal_uLong)0x00000008)
+#define STYLE_OPTION_HIGHLIGHT ((sal_uLong)0x00000010)
+#define STYLE_OPTION_ADVANCEDUSER ((sal_uLong)0x00000020)
+#define STYLE_OPTION_SCROLLARROW ((sal_uLong)0x00000040)
+#define STYLE_OPTION_SPINARROW ((sal_uLong)0x00000080)
+#define STYLE_OPTION_SPINUPDOWN ((sal_uLong)0x00000100)
+#define STYLE_OPTION_NOMNEMONICS ((sal_uLong)0x00000200)
+#define STYLE_OPTION_HIDEDISABLED ((sal_uLong)0x00100000)
+
+#define DRAGFULL_OPTION_WINDOWMOVE ((sal_uLong)0x00000001)
+#define DRAGFULL_OPTION_WINDOWSIZE ((sal_uLong)0x00000002)
+#define DRAGFULL_OPTION_OBJECTMOVE ((sal_uLong)0x00000004)
+#define DRAGFULL_OPTION_OBJECTSIZE ((sal_uLong)0x00000008)
+#define DRAGFULL_OPTION_DOCKING ((sal_uLong)0x00000010)
+#define DRAGFULL_OPTION_SPLIT ((sal_uLong)0x00000020)
+#define DRAGFULL_OPTION_SCROLL ((sal_uLong)0x00000040)
+
+#define LOGO_DISPLAYTIME_NOLOGO ((sal_uLong)0)
+#define LOGO_DISPLAYTIME_STARTTIME ((sal_uLong)0xFFFFFFFF)
+
+#define ANIMATION_OPTION_MINIMIZE ((sal_uLong)0x00000001)
+#define ANIMATION_OPTION_POPUP ((sal_uLong)0x00000002)
+#define ANIMATION_OPTION_DIALOG ((sal_uLong)0x00000004)
+#define ANIMATION_OPTION_TREE ((sal_uLong)0x00000008)
+#define ANIMATION_OPTION_SCROLL ((sal_uLong)0x00000010)
+
+#define SELECTION_OPTION_WORD ((sal_uLong)0x00000001)
+#define SELECTION_OPTION_FOCUS ((sal_uLong)0x00000002)
+#define SELECTION_OPTION_INVERT ((sal_uLong)0x00000004)
+#define SELECTION_OPTION_SHOWFIRST ((sal_uLong)0x00000008)
+
+#define DISPLAY_OPTION_AA_DISABLE ((sal_uLong)0x00000001)
+
+#define STYLE_RADIOBUTTON_MONO ((sal_uInt16)0x0001) // legacy
+#define STYLE_CHECKBOX_MONO ((sal_uInt16)0x0001) // legacy
+
+#define STYLE_TOOLBAR_ICONSIZE_UNKNOWN ((sal_uLong)0)
+#define STYLE_TOOLBAR_ICONSIZE_SMALL ((sal_uLong)1)
+#define STYLE_TOOLBAR_ICONSIZE_LARGE ((sal_uLong)2)
+
+#define STYLE_SYMBOLS_AUTO ((sal_uLong)0)
+#define STYLE_SYMBOLS_DEFAULT ((sal_uLong)1)
+#define STYLE_SYMBOLS_HICONTRAST ((sal_uLong)2)
+#define STYLE_SYMBOLS_INDUSTRIAL ((sal_uLong)3)
+#define STYLE_SYMBOLS_CRYSTAL ((sal_uLong)4)
+#define STYLE_SYMBOLS_TANGO ((sal_uLong)5)
+#define STYLE_SYMBOLS_OXYGEN ((sal_uLong)6)
+#define STYLE_SYMBOLS_CLASSIC ((sal_uLong)7)
+#define STYLE_SYMBOLS_HUMAN ((sal_uLong)8)
+#define STYLE_SYMBOLS_THEMES_MAX ((sal_uLong)9)
+
+#define STYLE_MENUIMAGES_OFF ((sal_uInt16)0)
+#define STYLE_MENUIMAGES_ON ((sal_uInt16)1)
+#define STYLE_MENUIMAGES_AUTO ((sal_uInt16)2)
+
+#define STYLE_CURSOR_NOBLINKTIME ((sal_uLong)0xFFFFFFFF)
class VCL_DLLPUBLIC StyleSettings
{
@@ -736,34 +707,34 @@ public:
const Color& GetInactiveTabColor() const
{ return mpData->maInactiveTabColor; }
- void SetHighContrastMode( BOOL bHighContrast )
+ void SetHighContrastMode( sal_Bool bHighContrast )
{ CopyData(); mpData->mnHighContrast = bHighContrast; }
- BOOL GetHighContrastMode() const
- { return (BOOL) mpData->mnHighContrast; }
- BOOL IsHighContrastBlackAndWhite() const;
- void SetUseSystemUIFonts( BOOL bUseSystemUIFonts )
+ sal_Bool GetHighContrastMode() const
+ { return (sal_Bool) mpData->mnHighContrast; }
+ sal_Bool IsHighContrastBlackAndWhite() const;
+ void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts )
{ CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; }
- BOOL GetUseSystemUIFonts() const
- { return (BOOL) mpData->mnUseSystemUIFonts; }
- void SetUseFlatBorders( BOOL bUseFlatBorders )
+ sal_Bool GetUseSystemUIFonts() const
+ { return (sal_Bool) mpData->mnUseSystemUIFonts; }
+ void SetUseFlatBorders( sal_Bool bUseFlatBorders )
{ CopyData(); mpData->mnUseFlatBorders = bUseFlatBorders; }
- BOOL GetUseFlatBorders() const
- { return (BOOL) mpData->mnUseFlatBorders; }
- void SetUseFlatMenues( BOOL bUseFlatMenues )
+ sal_Bool GetUseFlatBorders() const
+ { return (sal_Bool) mpData->mnUseFlatBorders; }
+ void SetUseFlatMenues( sal_Bool bUseFlatMenues )
{ CopyData(); mpData->mnUseFlatMenues = bUseFlatMenues; }
- BOOL GetUseFlatMenues() const
- { return (BOOL) mpData->mnUseFlatMenues; }
- void SetUseImagesInMenus( BOOL bUseImagesInMenus )
+ sal_Bool GetUseFlatMenues() const
+ { return (sal_Bool) mpData->mnUseFlatMenues; }
+ void SetUseImagesInMenus( sal_Bool bUseImagesInMenus )
{ CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus; }
- BOOL GetUseImagesInMenus() const;
- void SetPreferredUseImagesInMenus( BOOL bPreferredUseImagesInMenus )
+ sal_Bool GetUseImagesInMenus() const;
+ void SetPreferredUseImagesInMenus( sal_Bool bPreferredUseImagesInMenus )
{ CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
- BOOL GetPreferredUseImagesInMenus() const
+ sal_Bool GetPreferredUseImagesInMenus() const
{ return mpData->mbPreferredUseImagesInMenus; }
- void SetSkipDisabledInMenus( BOOL bSkipDisabledInMenus )
+ void SetSkipDisabledInMenus( sal_Bool bSkipDisabledInMenus )
{ CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
- BOOL GetSkipDisabledInMenus() const
- { return (BOOL) mpData->mnSkipDisabledInMenus; }
+ sal_Bool GetSkipDisabledInMenus() const
+ { return (sal_Bool) mpData->mnSkipDisabledInMenus; }
void SetCairoFontOptions( const void *pOptions )
{ CopyData(); mpData->mpFontOptions = pOptions; }
@@ -823,23 +794,6 @@ public:
const Font& GetIconFont() const
{ return mpData->maIconFont; }
- void SetRadioButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnRadioButtonStyle = nStyle; }
- USHORT GetRadioButtonStyle() const
- { return mpData->mnRadioButtonStyle; }
- void SetCheckBoxStyle( USHORT nStyle )
- { CopyData(); mpData->mnCheckBoxStyle = nStyle; }
- USHORT GetCheckBoxStyle() const
- { return mpData->mnCheckBoxStyle; }
- void SetPushButtonStyle( USHORT nStyle )
- { CopyData(); mpData->mnPushButtonStyle = nStyle; }
- USHORT GetPushButtonStyle() const
- { return mpData->mnPushButtonStyle; }
- void SetTabControlStyle( USHORT nStyle )
- { CopyData(); mpData->mnTabControlStyle = nStyle; }
- USHORT GetTabControlStyle() const
- { return mpData->mnTabControlStyle; }
-
void SetBorderSize( long nSize )
{ CopyData(); mpData->mnBorderSize = nSize; }
long GetBorderSize() const
@@ -895,78 +849,78 @@ public:
long GetCursorBlinkTime() const
{ return (long) mpData->mnCursorBlinkTime; }
- void SetScreenZoom( USHORT nPercent )
+ void SetScreenZoom( sal_uInt16 nPercent )
{ CopyData(); mpData->mnScreenZoom = nPercent; }
- USHORT GetScreenZoom() const
+ sal_uInt16 GetScreenZoom() const
{ return mpData->mnScreenZoom; }
- void SetScreenFontZoom( USHORT nPercent )
+ void SetScreenFontZoom( sal_uInt16 nPercent )
{ CopyData(); mpData->mnScreenFontZoom = nPercent; }
- USHORT GetScreenFontZoom() const
+ sal_uInt16 GetScreenFontZoom() const
{ return mpData->mnScreenFontZoom; }
- void SetLogoDisplayTime( ULONG nDisplayTime )
+ void SetLogoDisplayTime( sal_uLong nDisplayTime )
{ CopyData(); mpData->mnLogoDisplayTime = nDisplayTime; }
- ULONG GetLogoDisplayTime() const
+ sal_uLong GetLogoDisplayTime() const
{ return mpData->mnLogoDisplayTime; }
- void SetDragFullOptions( ULONG nOptions )
+ void SetDragFullOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnDragFullOptions = nOptions; }
- ULONG GetDragFullOptions() const
+ sal_uLong GetDragFullOptions() const
{ return mpData->mnDragFullOptions; }
- void SetAnimationOptions( ULONG nOptions )
+ void SetAnimationOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnAnimationOptions = nOptions; }
- ULONG GetAnimationOptions() const
+ sal_uLong GetAnimationOptions() const
{ return mpData->mnAnimationOptions; }
- void SetSelectionOptions( ULONG nOptions )
+ void SetSelectionOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnSelectionOptions = nOptions; }
- ULONG GetSelectionOptions() const
+ sal_uLong GetSelectionOptions() const
{ return mpData->mnSelectionOptions; }
- void SetDisplayOptions( ULONG nOptions )
+ void SetDisplayOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnDisplayOptions = nOptions; }
- ULONG GetDisplayOptions() const
+ sal_uLong GetDisplayOptions() const
{ return mpData->mnDisplayOptions; }
void SetAntialiasingMinPixelHeight( long nMinPixel )
{ CopyData(); mpData->mnAntialiasedMin = nMinPixel; }
- ULONG GetAntialiasingMinPixelHeight() const
+ sal_uLong GetAntialiasingMinPixelHeight() const
{ return mpData->mnAntialiasedMin; }
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetAutoMnemonic( BOOL bAutoMnemonic )
- { CopyData(); mpData->mnAutoMnemonic = (USHORT)bAutoMnemonic; }
- BOOL GetAutoMnemonic() const
- { return mpData->mnAutoMnemonic ? TRUE : FALSE; }
+ void SetAutoMnemonic( sal_Bool bAutoMnemonic )
+ { CopyData(); mpData->mnAutoMnemonic = (sal_uInt16)bAutoMnemonic; }
+ sal_Bool GetAutoMnemonic() const
+ { return mpData->mnAutoMnemonic ? sal_True : sal_False; }
void SetFontColor( const Color& rColor )
{ CopyData(); mpData->maFontColor = rColor; }
const Color& GetFontColor() const
{ return mpData->maFontColor; }
- void SetToolbarIconSize( ULONG nSize )
+ void SetToolbarIconSize( sal_uLong nSize )
{ CopyData(); mpData->mnToolbarIconSize = nSize; }
- ULONG GetToolbarIconSize() const
+ sal_uLong GetToolbarIconSize() const
{ return mpData->mnToolbarIconSize; }
- void SetSymbolsStyle( ULONG nStyle )
+ void SetSymbolsStyle( sal_uLong nStyle )
{ CopyData(); mpData->mnSymbolsStyle = nStyle; }
- ULONG GetSymbolsStyle() const
+ sal_uLong GetSymbolsStyle() const
{ return mpData->mnSymbolsStyle; }
- void SetPreferredSymbolsStyle( ULONG nStyle )
+ void SetPreferredSymbolsStyle( sal_uLong nStyle )
{ CopyData(); mpData->mnPreferredSymbolsStyle = nStyle; }
void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName );
- ULONG GetPreferredSymbolsStyle() const
+ sal_uLong GetPreferredSymbolsStyle() const
{ return mpData->mnPreferredSymbolsStyle; }
// check whether the symbols style is supported (icons are installed)
- bool CheckSymbolStyle( ULONG nStyle ) const;
- ULONG GetAutoSymbolsStyle() const;
+ bool CheckSymbolStyle( sal_uLong nStyle ) const;
+ sal_uLong GetAutoSymbolsStyle() const;
- ULONG GetCurrentSymbolsStyle() const;
+ sal_uLong GetCurrentSymbolsStyle() const;
void SetSymbolsStyleName( const ::rtl::OUString &rName )
{ return SetSymbolsStyle( ImplNameToSymbolsStyle( rName ) ); }
@@ -981,20 +935,16 @@ public:
{ CopyData(); mpData->maWorkspaceGradient = rWall; }
void SetStandardStyles();
- void SetStandardWinStyles();
- void SetStandardOS2Styles();
- void SetStandardMacStyles();
- void SetStandardUnixStyles();
const StyleSettings& operator =( const StyleSettings& rSet );
- BOOL operator ==( const StyleSettings& rSet ) const;
- BOOL operator !=( const StyleSettings& rSet ) const
+ sal_Bool operator ==( const StyleSettings& rSet ) const;
+ sal_Bool operator !=( const StyleSettings& rSet ) const
{ return !(*this == rSet); }
protected:
- ::rtl::OUString ImplSymbolsStyleToName( ULONG nStyle ) const;
- ULONG ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
+ ::rtl::OUString ImplSymbolsStyleToName( sal_uLong nStyle ) const;
+ sal_uLong ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const;
};
// ----------------
@@ -1009,10 +959,10 @@ class ImplMiscData
ImplMiscData( const ImplMiscData& rData );
private:
- ULONG mnRefCount;
- USHORT mnEnableATT;
- BOOL mbEnableLocalizedDecimalSep;
- USHORT mnDisablePrinting;
+ sal_uLong mnRefCount;
+ sal_uInt16 mnEnableATT;
+ sal_Bool mbEnableLocalizedDecimalSep;
+ sal_uInt16 mnDisablePrinting;
};
// ----------------
@@ -1031,16 +981,16 @@ public:
MiscSettings( const MiscSettings& rSet );
~MiscSettings();
- void SetEnableATToolSupport( BOOL bEnable );
- BOOL GetEnableATToolSupport() const;
- void SetDisablePrinting( BOOL bEnable );
- BOOL GetDisablePrinting() const;
- void SetEnableLocalizedDecimalSep( BOOL bEnable );
- BOOL GetEnableLocalizedDecimalSep() const;
+ void SetEnableATToolSupport( sal_Bool bEnable );
+ sal_Bool GetEnableATToolSupport() const;
+ void SetDisablePrinting( sal_Bool bEnable );
+ sal_Bool GetDisablePrinting() const;
+ void SetEnableLocalizedDecimalSep( sal_Bool bEnable );
+ sal_Bool GetEnableLocalizedDecimalSep() const;
const MiscSettings& operator =( const MiscSettings& rSet );
- BOOL operator ==( const MiscSettings& rSet ) const;
- BOOL operator !=( const MiscSettings& rSet ) const
+ sal_Bool operator ==( const MiscSettings& rSet ) const;
+ sal_Bool operator !=( const MiscSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1056,8 +1006,8 @@ class ImplNotificationData
ImplNotificationData( const ImplNotificationData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
};
// ------------------------
@@ -1076,15 +1026,15 @@ public:
NotificationSettings( const NotificationSettings& rSet );
~NotificationSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
const NotificationSettings& operator =( const NotificationSettings& rSet );
- BOOL operator ==( const NotificationSettings& rSet ) const;
- BOOL operator !=( const NotificationSettings& rSet ) const
+ sal_Bool operator ==( const NotificationSettings& rSet ) const;
+ sal_Bool operator !=( const NotificationSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1100,19 +1050,19 @@ class ImplHelpData
ImplHelpData( const ImplHelpData& rData );
private:
- ULONG mnRefCount;
- ULONG mnOptions;
- ULONG mnTipDelay;
- ULONG mnTipTimeout;
- ULONG mnBalloonDelay;
+ sal_uLong mnRefCount;
+ sal_uLong mnOptions;
+ sal_uLong mnTipDelay;
+ sal_uLong mnTipTimeout;
+ sal_uLong mnBalloonDelay;
};
// ----------------
// - HelpSettings -
// ----------------
-#define HELP_OPTION_QUICK ((ULONG)0x00000001)
-#define HELP_OPTION_ACTIVE ((ULONG)0x00000002)
+#define HELP_OPTION_QUICK ((sal_uLong)0x00000001)
+#define HELP_OPTION_ACTIVE ((sal_uLong)0x00000002)
class VCL_DLLPUBLIC HelpSettings
{
@@ -1126,27 +1076,27 @@ public:
HelpSettings( const HelpSettings& rSet );
~HelpSettings();
- void SetOptions( ULONG nOptions )
+ void SetOptions( sal_uLong nOptions )
{ CopyData(); mpData->mnOptions = nOptions; }
- ULONG GetOptions() const
+ sal_uLong GetOptions() const
{ return mpData->mnOptions; }
- void SetTipDelay( ULONG nTipDelay )
+ void SetTipDelay( sal_uLong nTipDelay )
{ CopyData(); mpData->mnTipDelay = nTipDelay; }
- ULONG GetTipDelay() const
+ sal_uLong GetTipDelay() const
{ return mpData->mnTipDelay; }
- void SetTipTimeout( ULONG nTipTimeout )
+ void SetTipTimeout( sal_uLong nTipTimeout )
{ CopyData(); mpData->mnTipTimeout = nTipTimeout; }
- ULONG GetTipTimeout() const
+ sal_uLong GetTipTimeout() const
{ return mpData->mnTipTimeout; }
- void SetBalloonDelay( ULONG nBalloonDelay )
+ void SetBalloonDelay( sal_uLong nBalloonDelay )
{ CopyData(); mpData->mnBalloonDelay = nBalloonDelay; }
- ULONG GetBalloonDelay() const
+ sal_uLong GetBalloonDelay() const
{ return mpData->mnBalloonDelay; }
const HelpSettings& operator =( const HelpSettings& rSet );
- BOOL operator ==( const HelpSettings& rSet ) const;
- BOOL operator !=( const HelpSettings& rSet ) const
+ sal_Bool operator ==( const HelpSettings& rSet ) const;
+ sal_Bool operator !=( const HelpSettings& rSet ) const
{ return !(*this == rSet); }
};
@@ -1163,7 +1113,7 @@ class ImplAllSettingsData
~ImplAllSettingsData();
private:
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
MachineSettings maMachineSettings;
MouseSettings maMouseSettings;
KeyboardSettings maKeyboardSettings;
@@ -1172,8 +1122,8 @@ private:
NotificationSettings maNotificationSettings;
HelpSettings maHelpSettings;
::com::sun::star::lang::Locale maLocale;
- ULONG mnSystemUpdate;
- ULONG mnWindowUpdate;
+ sal_uLong mnSystemUpdate;
+ sal_uLong mnWindowUpdate;
::com::sun::star::lang::Locale maUILocale;
LanguageType meLanguage;
LanguageType meUILanguage;
@@ -1189,24 +1139,24 @@ private:
// - AllSettings -
// ---------------
-#define SETTINGS_MACHINE ((ULONG)0x00000001)
-#define SETTINGS_MOUSE ((ULONG)0x00000002)
-#define SETTINGS_KEYBOARD ((ULONG)0x00000004)
-#define SETTINGS_STYLE ((ULONG)0x00000008)
-#define SETTINGS_MISC ((ULONG)0x00000010)
-#define SETTINGS_SOUND ((ULONG)0x00000020)
-#define SETTINGS_NOTIFICATION ((ULONG)0x00000040)
-#define SETTINGS_HELP ((ULONG)0x00000080)
-#define SETTINGS_INTERNATIONAL ((ULONG)0x00000100) /* was for class International, has no effect anymore */
-#define SETTINGS_LOCALE ((ULONG)0x00000200)
-#define SETTINGS_UILOCALE ((ULONG)0x00000400)
+#define SETTINGS_MACHINE ((sal_uLong)0x00000001)
+#define SETTINGS_MOUSE ((sal_uLong)0x00000002)
+#define SETTINGS_KEYBOARD ((sal_uLong)0x00000004)
+#define SETTINGS_STYLE ((sal_uLong)0x00000008)
+#define SETTINGS_MISC ((sal_uLong)0x00000010)
+#define SETTINGS_SOUND ((sal_uLong)0x00000020)
+#define SETTINGS_NOTIFICATION ((sal_uLong)0x00000040)
+#define SETTINGS_HELP ((sal_uLong)0x00000080)
+#define SETTINGS_INTERNATIONAL ((sal_uLong)0x00000100) /* was for class International, has no effect anymore */
+#define SETTINGS_LOCALE ((sal_uLong)0x00000200)
+#define SETTINGS_UILOCALE ((sal_uLong)0x00000400)
#define SETTINGS_ALLSETTINGS (SETTINGS_MACHINE |\
SETTINGS_MOUSE | SETTINGS_KEYBOARD |\
SETTINGS_STYLE | SETTINGS_MISC |\
SETTINGS_SOUND | SETTINGS_NOTIFICATION |\
SETTINGS_HELP |\
SETTINGS_LOCALE | SETTINGS_UILOCALE )
-#define SETTINGS_IN_UPDATE_SETTINGS ((ULONG)0x00000800) // this flag indicates that the data changed event was created
+#define SETTINGS_IN_UPDATE_SETTINGS ((sal_uLong)0x00000800) // this flag indicates that the data changed event was created
// in Windows::UpdateSettings probably because of a global
// settings changed
@@ -1265,7 +1215,7 @@ public:
LanguageType GetLanguage() const;
void SetUILanguage( LanguageType eLang );
LanguageType GetUILanguage() const;
- BOOL GetLayoutRTL() const; // returns TRUE if UI language requires right-to-left UI
+ sal_Bool GetLayoutRTL() const; // returns sal_True if UI language requires right-to-left UI
const LocaleDataWrapper& GetLocaleDataWrapper() const;
const LocaleDataWrapper& GetUILocaleDataWrapper() const;
const vcl::I18nHelper& GetLocaleI18nHelper() const;
@@ -1282,22 +1232,22 @@ public:
const String& rStr2, xub_StrLen nPos2, xub_StrLen nCount2 ) const;
*/
- void SetSystemUpdate( ULONG nUpdate )
+ void SetSystemUpdate( sal_uLong nUpdate )
{ CopyData(); mpData->mnSystemUpdate = nUpdate; }
- ULONG GetSystemUpdate() const
+ sal_uLong GetSystemUpdate() const
{ return mpData->mnSystemUpdate; }
- void SetWindowUpdate( ULONG nUpdate )
+ void SetWindowUpdate( sal_uLong nUpdate )
{ CopyData(); mpData->mnWindowUpdate = nUpdate; }
- ULONG GetWindowUpdate() const
+ sal_uLong GetWindowUpdate() const
{ return mpData->mnWindowUpdate; }
- ULONG Update( ULONG nFlags, const AllSettings& rSettings );
- ULONG GetChangeFlags( const AllSettings& rSettings ) const;
+ sal_uLong Update( sal_uLong nFlags, const AllSettings& rSettings );
+ sal_uLong GetChangeFlags( const AllSettings& rSettings ) const;
const AllSettings& operator =( const AllSettings& rSet );
- BOOL operator ==( const AllSettings& rSet ) const;
- BOOL operator !=( const AllSettings& rSet ) const
+ sal_Bool operator ==( const AllSettings& rSet ) const;
+ sal_Bool operator !=( const AllSettings& rSet ) const
{ return !(*this == rSet); }
static void LocaleSettingsChanged( sal_uInt32 nHint );
SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
diff --git a/vcl/inc/vcl/slider.hxx b/vcl/inc/vcl/slider.hxx
index 5208fffcfb54..15f049555386 100644
--- a/vcl/inc/vcl/slider.hxx
+++ b/vcl/inc/vcl/slider.hxx
@@ -60,11 +60,11 @@ private:
long mnLineSize;
long mnPageSize;
long mnDelta;
- USHORT mnDragDraw;
- USHORT mnStateFlags;
+ sal_uInt16 mnDragDraw;
+ sal_uInt16 mnStateFlags;
ScrollType meScrollType;
- BOOL mbCalcSize;
- BOOL mbFullDrag;
+ sal_Bool mbCalcSize;
+ sal_Bool mbFullDrag;
Link maSlideHdl;
Link maEndSlideHdl;
@@ -73,16 +73,16 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplUpdateRects( BOOL bUpdate = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateRects( sal_Bool bUpdate = sal_True );
SAL_DLLPRIVATE long ImplCalcThumbPos( long nPixPos );
SAL_DLLPRIVATE long ImplCalcThumbPosPix( long nPos );
- SAL_DLLPRIVATE void ImplCalc( BOOL bUpdate = TRUE );
- SAL_DLLPRIVATE void ImplDraw( USHORT nDrawFlags );
- SAL_DLLPRIVATE BOOL ImplIsPageUp( const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsPageDown( const Point& rPos );
- SAL_DLLPRIVATE long ImplSlide( long nNewPos, BOOL bCallEndSlide );
- SAL_DLLPRIVATE long ImplDoAction( BOOL bCallEndSlide );
- SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, BOOL bCallAction = TRUE );
+ SAL_DLLPRIVATE void ImplCalc( sal_Bool bUpdate = sal_True );
+ SAL_DLLPRIVATE void ImplDraw( sal_uInt16 nDrawFlags );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageUp( const Point& rPos );
+ SAL_DLLPRIVATE sal_Bool ImplIsPageDown( const Point& rPos );
+ SAL_DLLPRIVATE long ImplSlide( long nNewPos, sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE long ImplDoAction( sal_Bool bCallEndSlide );
+ SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, sal_Bool bCallAction = sal_True );
SAL_DLLPRIVATE long ImplDoSlide( long nNewPos );
SAL_DLLPRIVATE long ImplDoSlideAction( ScrollType eScrollType );
@@ -103,9 +103,9 @@ public:
virtual void Slide();
virtual void EndSlide();
- void EnableDrag( BOOL bEnable = TRUE )
+ void EnableDrag( sal_Bool bEnable = sal_True )
{ mbFullDrag = bEnable; }
- BOOL IsDragEnabled() const { return mbFullDrag; }
+ sal_Bool IsDragEnabled() const { return mbFullDrag; }
void SetRangeMin( long nNewRange );
long GetRangeMin() const { return mnMinRange; }
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
deleted file mode 100644
index fa005db25c80..000000000000
--- a/vcl/inc/vcl/smartid.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SMARTID_HXX_
-#define _SMARTID_HXX_
-
-#include <tools/string.hxx>
-#include <vcl/dllapi.h>
-
-/// SMART_SET_SMART only sets the Ids that are defined in the SmartId
-/// the other types set whatever is given. This can also be used to reset an Id
-enum SmartIdUpdateMode { SMART_SET_SMART, SMART_SET_NUM, SMART_SET_STR, SMART_SET_ALL };
-
-struct ImplSmartIdData;
-
-/*
-
-SmartId is a substitute for Numeric HelpIds. They can handle Numeric and String HelpIds and offer commonly needed operators.
-
-Matching Ids:
-if part of an Id is not set (HasNumeric HasString is False) then this part will never match to anything. Not even unset values
-
-*/
-class VCL_DLLPUBLIC SmartId
-{
-private:
- ImplSmartIdData* mpData;
- SAL_DLLPRIVATE ImplSmartIdData* GetSmartIdData();
-
-public:
- explicit SmartId( const String& rId );
- explicit SmartId( ULONG nId );
- SmartId( const String& rId, ULONG nId );
-
- SmartId();
-
- SmartId( const SmartId& rId );
- SmartId& operator = ( const SmartId& rId );
-
- ~SmartId();
-
- void UpdateId( const SmartId& rId, SmartIdUpdateMode aMode = SMART_SET_SMART );
-
- BOOL HasNumeric() const;
- BOOL HasString() const;
- BOOL HasAny() const;
- ULONG GetNum() const;
- String GetStr() const;
-
- String GetText() const; /// return String for UI usage
-
- BOOL Matches( const String &rId )const;
- BOOL Matches( const ULONG nId ) const;
-/// In case both Ids have both values set only the StringId is used for Matching
- BOOL Matches( const SmartId &rId ) const;
-
- BOOL Equals( const SmartId &rId ) const;
-
- BOOL operator == ( const SmartId& rRight ) const;
- BOOL operator < ( const SmartId& rRight ) const;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/sndstyle.hxx b/vcl/inc/vcl/sndstyle.hxx
index 62268d34a6ba..170a51173726 100644
--- a/vcl/inc/vcl/sndstyle.hxx
+++ b/vcl/inc/vcl/sndstyle.hxx
@@ -35,7 +35,7 @@
// - Sound-Types -
// ---------------
-typedef USHORT SoundType;
+typedef sal_uInt16 SoundType;
#define SOUND_DEFAULT ((SoundType)0)
#define SOUND_INFO ((SoundType)1)
#define SOUND_WARNING ((SoundType)2)
diff --git a/vcl/inc/vcl/spin.h b/vcl/inc/vcl/spin.h
index e20cb9aaa86a..f7b69cbf2a16 100644
--- a/vcl/inc/vcl/spin.h
+++ b/vcl/inc/vcl/spin.h
@@ -44,10 +44,10 @@ class OutputDevice;
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled = TRUE,
- BOOL bLowerEnabled = TRUE,
- BOOL bHorz = FALSE, BOOL bMirrorHorz = FALSE );
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled = sal_True,
+ sal_Bool bLowerEnabled = sal_True,
+ sal_Bool bHorz = sal_False, sal_Bool bMirrorHorz = sal_False );
#endif // _SV_SPIN_H
diff --git a/vcl/inc/vcl/spin.hxx b/vcl/inc/vcl/spin.hxx
index 6250c5020717..02141bccd448 100644
--- a/vcl/inc/vcl/spin.hxx
+++ b/vcl/inc/vcl/spin.hxx
@@ -45,13 +45,13 @@ private:
Rectangle maUpperRect;
Rectangle maLowerRect;
Rectangle maFocusRect;
- BOOL mbRepeat : 1;
- BOOL mbUpperIn : 1;
- BOOL mbLowerIn : 1;
- BOOL mbInitialUp : 1;
- BOOL mbInitialDown : 1;
- BOOL mbHorz : 1;
- BOOL mbUpperIsFocused : 1;
+ sal_Bool mbRepeat : 1;
+ sal_Bool mbUpperIn : 1;
+ sal_Bool mbLowerIn : 1;
+ sal_Bool mbInitialUp : 1;
+ sal_Bool mbInitialDown : 1;
+ sal_Bool mbHorz : 1;
+ sal_Bool mbUpperIsFocused : 1;
Link maUpHdlLink;
Link maDownHdlLink;
long mnMinRange;
@@ -74,7 +74,7 @@ public:
virtual void Resize();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -101,15 +101,15 @@ public:
const Link& GetDownHdl() const { return maDownHdlLink; }
private:
- // moves the focus to the upper or lower rect. Return TRUE if the focus rect actually changed.
- SAL_DLLPRIVATE BOOL ImplMoveFocus( BOOL _bUpper );
- SAL_DLLPRIVATE void ImplCalcFocusRect( BOOL _bUpper );
+ // moves the focus to the upper or lower rect. Return sal_True if the focus rect actually changed.
+ SAL_DLLPRIVATE sal_Bool ImplMoveFocus( sal_Bool _bUpper );
+ SAL_DLLPRIVATE void ImplCalcFocusRect( sal_Bool _bUpper );
- SAL_DLLPRIVATE inline BOOL ImplIsUpperEnabled( ) const
+ SAL_DLLPRIVATE inline sal_Bool ImplIsUpperEnabled( ) const
{
return mnValue + mnValueStep <= mnMaxRange;
}
- SAL_DLLPRIVATE inline BOOL ImplIsLowerEnabled( ) const
+ SAL_DLLPRIVATE inline sal_Bool ImplIsLowerEnabled( ) const
{
return mnValue >= mnMinRange + mnValueStep;
}
diff --git a/vcl/inc/vcl/spinfld.hxx b/vcl/inc/vcl/spinfld.hxx
index db46c16d331b..becfe4be426f 100644
--- a/vcl/inc/vcl/spinfld.hxx
+++ b/vcl/inc/vcl/spinfld.hxx
@@ -50,7 +50,7 @@ protected:
Link maDownHdlLink;
Link maFirstHdlLink;
Link maLastHdlLink;
- BOOL mbRepeat:1,
+ sal_Bool mbRepeat:1,
mbSpin:1,
mbInitialUp:1,
mbInitialDown:1,
@@ -82,7 +82,7 @@ public:
SpinField( Window* pParent, const ResId& rResId );
~SpinField();
- virtual BOOL ShowDropDown( BOOL bShow );
+ virtual sal_Bool ShowDropDown( sal_Bool bShow );
virtual void Up();
virtual void Down();
@@ -93,7 +93,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Resize();
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
@@ -110,7 +110,7 @@ public:
virtual Size CalcMinimumSize() const;
virtual Size GetOptimalSize(WindowSizeType eType) const;
- virtual Size CalcSize( USHORT nChars ) const;
+ virtual Size CalcSize( sal_uInt16 nChars ) const;
};
#endif // _SV_SPINFLD_HXX
diff --git a/vcl/inc/vcl/split.hxx b/vcl/inc/vcl/split.hxx
index 9cd77275820a..66371c6da1a2 100644
--- a/vcl/inc/vcl/split.hxx
+++ b/vcl/inc/vcl/split.hxx
@@ -48,9 +48,9 @@ private:
long mnStartSplitPos;
Point maDragPos;
Rectangle maDragRect;
- BOOL mbHorzSplit;
- BOOL mbDragFull;
- BOOL mbKbdSplitting;
+ sal_Bool mbHorzSplit;
+ sal_Bool mbDragFull;
+ sal_Bool mbKbdSplitting;
long mbInKeyEvent;
long mnKeyboardStepSize;
Link maStartSplitHdl;
@@ -62,7 +62,7 @@ private:
SAL_DLLPRIVATE void ImplSplitMousePos( Point& rPos );
SAL_DLLPRIVATE void ImplStartKbdSplitting();
SAL_DLLPRIVATE void ImplKbdTracking( KeyCode aKeyCode );
- SAL_DLLPRIVATE BOOL ImplSplitterActive();
+ SAL_DLLPRIVATE sal_Bool ImplSplitterActive();
SAL_DLLPRIVATE Splitter* ImplFindSibling();
SAL_DLLPRIVATE void ImplRestoreSplitter();
@@ -109,7 +109,7 @@ public:
void SetLastSplitPosPixel( long nNewPos );
long GetLastSplitPosPixel() const { return mnLastSplitPos; }
- BOOL IsHorizontal() const { return mbHorzSplit; }
+ sal_Bool IsHorizontal() const { return mbHorzSplit; }
// set the stepsize of the splitter for cursor movement
// the default is 10% of the reference window's width/height
diff --git a/vcl/inc/vcl/splitwin.hxx b/vcl/inc/vcl/splitwin.hxx
index c6671f2799c0..ce1e74958f48 100644
--- a/vcl/inc/vcl/splitwin.hxx
+++ b/vcl/inc/vcl/splitwin.hxx
@@ -40,7 +40,7 @@ struct ImplSplitSet;
// - SplitWindowItemBits -
// -----------------------
-typedef USHORT SplitWindowItemBits;
+typedef sal_uInt16 SplitWindowItemBits;
// -------------------------------
// - Bits fuer SplitWindow-Items -
@@ -56,8 +56,8 @@ typedef USHORT SplitWindowItemBits;
// - SplitWindow-Types -
// ---------------------
-#define SPLITWINDOW_APPEND ((USHORT)0xFFFF)
-#define SPLITWINDOW_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define SPLITWINDOW_APPEND ((sal_uInt16)0xFFFF)
+#define SPLITWINDOW_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
// ---------------
// - SplitWindow -
@@ -83,10 +83,10 @@ private:
long mnMSplitPos;
WinBits mnWinStyle;
WindowAlign meAlign;
- USHORT mnSplitTest;
- USHORT mnSplitPos;
- USHORT mnMouseModifier;
- BOOL mbDragFull:1,
+ sal_uInt16 mnSplitTest;
+ sal_uInt16 mnSplitPos;
+ sal_uInt16 mnMouseModifier;
+ sal_Bool mbDragFull:1,
mbHorz:1,
mbBottomRight:1,
mbCalc:1,
@@ -121,31 +121,31 @@ private:
SAL_DLLPRIVATE void ImplUpdateSet( ImplSplitSet* pSet );
SAL_DLLPRIVATE void ImplSetWindowSize( long nDelta );
SAL_DLLPRIVATE void ImplSplitMousePos( Point& rMousePos );
- SAL_DLLPRIVATE void ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const;
- SAL_DLLPRIVATE void ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
- SAL_DLLPRIVATE void ImplGetFadeInRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
- SAL_DLLPRIVATE void ImplGetFadeOutRect( Rectangle& rRect, BOOL bTest = FALSE ) const;
+ SAL_DLLPRIVATE void ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const;
+ SAL_DLLPRIVATE void ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
+ SAL_DLLPRIVATE void ImplGetFadeOutRect( Rectangle& rRect, sal_Bool bTest = sal_False ) const;
SAL_DLLPRIVATE void ImplDrawButtonRect( const Rectangle& rRect, long nSize );
- SAL_DLLPRIVATE void ImplDrawAutoHide( BOOL bInPaint );
- SAL_DLLPRIVATE void ImplDrawFadeIn( BOOL bInPaint );
- SAL_DLLPRIVATE void ImplDrawFadeOut( BOOL bInPaint );
+ SAL_DLLPRIVATE void ImplDrawAutoHide( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeIn( sal_Bool bInPaint );
+ SAL_DLLPRIVATE void ImplDrawFadeOut( sal_Bool bInPaint );
SAL_DLLPRIVATE void ImplNewAlign();
- SAL_DLLPRIVATE void ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft );
- SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft );
+ SAL_DLLPRIVATE void ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft );
+ SAL_DLLPRIVATE void ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft );
SAL_DLLPRIVATE void ImplStartSplit( const MouseEvent& rMEvt );
static SAL_DLLPRIVATE void ImplDrawBorder( SplitWindow* pWin );
static SAL_DLLPRIVATE void ImplDrawBorderLine( SplitWindow* pWin );
- static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
- BOOL bRows, BOOL bDown = TRUE );
+ static SAL_DLLPRIVATE void ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet );
static SAL_DLLPRIVATE void ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
const Wallpaper* pWall, const Bitmap* pBitmap );
- static SAL_DLLPRIVATE USHORT ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos,
- BOOL bRows, BOOL bDown = TRUE );
- static SAL_DLLPRIVATE USHORT ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
+ sal_Bool bRows, sal_Bool bDown = sal_True );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos );
static SAL_DLLPRIVATE void ImplDrawSplitTracking( SplitWindow* pThis, const Point& rPos );
// Copy assignment is forbidden and not implemented.
@@ -174,54 +174,66 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- void InsertItem( USHORT nId, Window* pWindow, long nSize,
- USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
+ void InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
SplitWindowItemBits nBits = 0 );
- void InsertItem( USHORT nId, long nSize,
- USHORT nPos = SPLITWINDOW_APPEND, USHORT nSetId = 0,
+ void InsertItem( sal_uInt16 nId, long nSize,
+ sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0,
SplitWindowItemBits nBits = 0 );
- void MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId = 0 );
- void RemoveItem( USHORT nId, BOOL bHide = TRUE );
+ void MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId = 0 );
+ void RemoveItem( sal_uInt16 nId, sal_Bool bHide = sal_True );
void Clear();
- void SetBaseSet( USHORT nSetId = 0 );
- USHORT GetBaseSet() const;
+ void SetBaseSet( sal_uInt16 nSetId = 0 );
+ sal_uInt16 GetBaseSet() const;
- void SetSplitSize( USHORT nSetId, long nSplitSize,
- BOOL bWithChilds = FALSE );
- long GetSplitSize( USHORT nSetId ) const;
- void SetItemBackground( USHORT nSetId );
- void SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper );
- Wallpaper GetItemBackground( USHORT nSetId ) const;
- BOOL IsItemBackground( USHORT nSetId ) const;
- void SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap );
- Bitmap GetItemBitmap( USHORT nSetId ) const;
+ void SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
+ sal_Bool bWithChilds = sal_False );
+ long GetSplitSize( sal_uInt16 nSetId ) const;
+ void SetItemBackground( sal_uInt16 nSetId );
+ void SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper );
+ Wallpaper GetItemBackground( sal_uInt16 nSetId ) const;
+ sal_Bool IsItemBackground( sal_uInt16 nSetId ) const;
+ void SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap );
+ Bitmap GetItemBitmap( sal_uInt16 nSetId ) const;
- void SplitItem( USHORT nId, long nNewSize,
- BOOL bPropSmall = FALSE,
- BOOL bPropGreat = FALSE );
- void SetItemSize( USHORT nId, long nNewSize );
- long GetItemSize( USHORT nId ) const;
- long GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const;
- void SetItemBits( USHORT nId, SplitWindowItemBits nNewBits );
- SplitWindowItemBits GetItemBits( USHORT nId ) const;
- Window* GetItemWindow( USHORT nId ) const;
- USHORT GetSet( USHORT nId ) const;
- BOOL GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) const;
- USHORT GetItemId( Window* pWindow ) const;
- USHORT GetItemId( const Point& rPos ) const;
- USHORT GetItemPos( USHORT nId, USHORT nSetId = 0 ) const;
- USHORT GetItemId( USHORT nPos, USHORT nSetId = 0 ) const;
- USHORT GetItemCount( USHORT nSetId = 0 ) const;
- BOOL IsItemValid( USHORT nId ) const;
+ void SplitItem( sal_uInt16 nId, long nNewSize,
+ sal_Bool bPropSmall = sal_False,
+ sal_Bool bPropGreat = sal_False );
+ void SetItemSize( sal_uInt16 nId, long nNewSize );
+ long GetItemSize( sal_uInt16 nId ) const;
+ /** Set a range that limits the (variable part of the) size with an
+ upper and a lower bound (both are valid values themselves.)
+ @param nId
+ Id of the item for which the size limits are set.
+ @param aRange
+ Values of -1 define missing bounds, thus setting a range (-1,-1)
+ (the default) removes the size limitiation.
+ */
+ void SetItemSizeRange (sal_uInt16 nId, const Range aRange);
+ /** Return the current size limits for the specified item.
+ */
+ Range GetItemSizeRange (sal_uInt16 nId) const;
+ long GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const;
+ void SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits );
+ SplitWindowItemBits GetItemBits( sal_uInt16 nId ) const;
+ Window* GetItemWindow( sal_uInt16 nId ) const;
+ sal_uInt16 GetSet( sal_uInt16 nId ) const;
+ sal_Bool GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const;
+ sal_uInt16 GetItemId( Window* pWindow ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId = 0 ) const;
+ sal_uInt16 GetItemCount( sal_uInt16 nSetId = 0 ) const;
+ sal_Bool IsItemValid( sal_uInt16 nId ) const;
- void SetNoAlign( BOOL bNoAlign );
- BOOL IsNoAlign() const { return mbNoAlign; }
+ void SetNoAlign( sal_Bool bNoAlign );
+ sal_Bool IsNoAlign() const { return mbNoAlign; }
void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
WindowAlign GetAlign() const { return meAlign; }
- BOOL IsHorizontal() const { return mbHorz; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
- BOOL IsSplitting() const { return IsTracking(); }
+ sal_Bool IsSplitting() const { return IsTracking(); }
void SetMaxSizePixel( long nNewMaxSize ) { mnMaxSize = nNewMaxSize; }
long GetMaxSizePixel() const { return mnMaxSize; }
@@ -229,24 +241,24 @@ public:
static Size CalcWindowSizePixel( const Size& rSize,
WindowAlign eAlign,
WinBits nWinStyle,
- BOOL bExtra = FALSE );
+ sal_Bool bExtra = sal_False );
Size CalcWindowSizePixel( const Size& rSize )
{ return CalcWindowSizePixel( rSize, meAlign, mnWinStyle, (mbAutoHide || mbFadeOut) ); }
Size CalcLayoutSizePixel( const Size& aNewSize );
- void ShowAutoHideButton( BOOL bShow = TRUE );
- BOOL IsAutoHideButtonVisible() const { return mbAutoHide; }
- void ShowFadeInHideButton( BOOL bShow = TRUE );
- void ShowFadeInButton( BOOL bShow = TRUE ) { ShowFadeInHideButton( bShow ); }
- BOOL IsFadeInButtonVisible() const { return mbFadeIn; }
- void ShowFadeOutButton( BOOL bShow = TRUE );
- BOOL IsFadeOutButtonVisible() const { return mbFadeOut; }
+ void ShowAutoHideButton( sal_Bool bShow = sal_True );
+ sal_Bool IsAutoHideButtonVisible() const { return mbAutoHide; }
+ void ShowFadeInHideButton( sal_Bool bShow = sal_True );
+ void ShowFadeInButton( sal_Bool bShow = sal_True ) { ShowFadeInHideButton( bShow ); }
+ sal_Bool IsFadeInButtonVisible() const { return mbFadeIn; }
+ void ShowFadeOutButton( sal_Bool bShow = sal_True );
+ sal_Bool IsFadeOutButtonVisible() const { return mbFadeOut; }
long GetFadeInSize() const;
- BOOL IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
+ sal_Bool IsFadeNoButtonMode() const { return mbFadeNoButtonMode; }
- void SetAutoHideState( BOOL bAutoHide );
- BOOL GetAutoHideState() const { return mbAutoHideIn; }
+ void SetAutoHideState( sal_Bool bAutoHide );
+ sal_Bool GetAutoHideState() const { return mbAutoHideIn; }
Rectangle GetAutoHideRect() const;
Rectangle GetFadeInRect() const;
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 9df46e99d14b..d039ddf8f203 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -43,7 +43,7 @@ typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
const Rectangle& rFramePosSize
);
@@ -51,7 +51,7 @@ void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
// - StatusBarItemBits -
// ---------------------
-typedef USHORT StatusBarItemBits;
+typedef sal_uInt16 StatusBarItemBits;
// ----------------------------
// - Bits fuer StatusBarItems -
@@ -70,8 +70,8 @@ typedef USHORT StatusBarItemBits;
// - StatusBar-Types -
// -------------------
-#define STATUSBAR_APPEND ((USHORT)0xFFFF)
-#define STATUSBAR_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define STATUSBAR_APPEND ((sal_uInt16)0xFFFF)
+#define STATUSBAR_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
#define STATUSBAR_OFFSET ((long)5)
// -------------
@@ -94,30 +94,30 @@ private:
long mnCalcHeight;
long mnTextY;
long mnItemY;
- USHORT mnCurItemId;
- USHORT mnPercent;
- USHORT mnPercentCount;
- BOOL mbVisibleItems;
- BOOL mbFormat;
- BOOL mbProgressMode;
- BOOL mbInUserDraw;
- BOOL mbBottomBorder;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
+ sal_Bool mbVisibleItems;
+ sal_Bool mbFormat;
+ sal_Bool mbProgressMode;
+ sal_Bool mbInUserDraw;
+ sal_Bool mbBottomBorder;
Link maClickHdl;
Link maDoubleClickHdl;
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplFormat();
- SAL_DLLPRIVATE BOOL ImplIsItemUpdate();
+ SAL_DLLPRIVATE sal_Bool ImplIsItemUpdate();
using OutputDevice::ImplDrawText;
- SAL_DLLPRIVATE void ImplDrawText( BOOL bOffScreen, long nOldTextWidth );
- SAL_DLLPRIVATE void ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame );
- SAL_DLLPRIVATE void ImplDrawProgress( BOOL bPaint,
- USHORT nOldPerc, USHORT nNewPerc );
+ SAL_DLLPRIVATE void ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame );
+ SAL_DLLPRIVATE void ImplDrawProgress( sal_Bool bPaint,
+ sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
SAL_DLLPRIVATE void ImplCalcProgressRect();
- SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( USHORT nPos ) const;
- SAL_DLLPRIVATE USHORT ImplGetFirstVisiblePos() const;
+ SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( sal_uInt16 nPos ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisiblePos() const;
SAL_DLLPRIVATE void ImplCalcBorder();
public:
@@ -138,65 +138,65 @@ public:
virtual void DoubleClick();
virtual void UserDraw( const UserDrawEvent& rUDEvt );
- void InsertItem( USHORT nItemId, ULONG nWidth,
+ void InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
StatusBarItemBits nBits = SIB_CENTER | SIB_IN,
long nOffset = STATUSBAR_OFFSET,
- USHORT nPos = STATUSBAR_APPEND );
- void RemoveItem( USHORT nItemId );
+ sal_uInt16 nPos = STATUSBAR_APPEND );
+ void RemoveItem( sal_uInt16 nItemId );
- void ShowItem( USHORT nItemId );
- void HideItem( USHORT nItemId );
- BOOL IsItemVisible( USHORT nItemId ) const;
+ void ShowItem( sal_uInt16 nItemId );
+ void HideItem( sal_uInt16 nItemId );
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
void ShowItems();
void HideItems();
- BOOL AreItemsVisible() const { return mbVisibleItems; }
+ sal_Bool AreItemsVisible() const { return mbVisibleItems; }
void CopyItems( const StatusBar& rStatusBar );
void Clear();
- USHORT GetItemCount() const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
- Point GetItemTextPos( USHORT nItemId ) const;
- USHORT GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetItemCount() const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Point GetItemTextPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
- ULONG GetItemWidth( USHORT nItemId ) const;
- StatusBarItemBits GetItemBits( USHORT nItemId ) const;
- long GetItemOffset( USHORT nItemId ) const;
+ sal_uLong GetItemWidth( sal_uInt16 nItemId ) const;
+ StatusBarItemBits GetItemBits( sal_uInt16 nItemId ) const;
+ long GetItemOffset( sal_uInt16 nItemId ) const;
- void SetItemText( USHORT nItemId, const XubString& rText );
- const XubString& GetItemText( USHORT nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
- void SetItemData( USHORT nItemId, void* pNewData );
- void* GetItemData( USHORT nItemId ) const;
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId );
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId );
- void SetHelpText( USHORT nItemId, const XubString& rText );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( USHORT nItemId, const XubString& rText );
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( USHORT nItemId ) const;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
- void SetBottomBorder( BOOL bBottomBorder = TRUE );
- BOOL IsBottomBorder() const { return mbBottomBorder; }
+ void SetBottomBorder( sal_Bool bBottomBorder = sal_True );
+ sal_Bool IsBottomBorder() const { return mbBottomBorder; }
- void SetTopBorder( BOOL bTopBorder = TRUE );
- BOOL IsTopBorder() const;
+ void SetTopBorder( sal_Bool bTopBorder = sal_True );
+ sal_Bool IsTopBorder() const;
void StartProgressMode( const XubString& rText );
- void SetProgressValue( USHORT nPercent );
+ void SetProgressValue( sal_uInt16 nPercent );
void EndProgressMode();
- BOOL IsProgressMode() const { return mbProgressMode; }
+ sal_Bool IsProgressMode() const { return mbProgressMode; }
void ResetProgressMode();
void SetText( const XubString& rText );
@@ -206,9 +206,9 @@ public:
const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
Size CalcWindowSizePixel() const;
@@ -219,9 +219,9 @@ public:
const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
using Window::SetAccessibleName;
- void SetAccessibleName( USHORT nItemId, const XubString& rName );
+ void SetAccessibleName( sal_uInt16 nItemId, const XubString& rName );
using Window::GetAccessibleName;
- const XubString& GetAccessibleName( USHORT nItemId ) const;
+ const XubString& GetAccessibleName( sal_uInt16 nItemId ) const;
};
#endif // _SV_STATUS_HXX
diff --git a/vcl/inc/vcl/stdtext.hxx b/vcl/inc/vcl/stdtext.hxx
index 96bd7ec14a1f..693a2692b010 100644
--- a/vcl/inc/vcl/stdtext.hxx
+++ b/vcl/inc/vcl/stdtext.hxx
@@ -40,16 +40,16 @@ class Window;
// ------------------
#define STANDARD_TEXT_FIRST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((USHORT)0)
+#define STANDARD_TEXT_SERVICE_NOT_AVAILABLE ((sal_uInt16)0)
#define STANDARD_TEXT_LAST STANDARD_TEXT_SERVICE_NOT_AVAILABLE
-XubString VCL_DLLPUBLIC GetStandardText( USHORT nStdText );
+XubString VCL_DLLPUBLIC GetStandardText( sal_uInt16 nStdText );
// -------------------------------------
// - Hilfsmethoden fuer Standard-Texte -
// -------------------------------------
-void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, BOOL bError );
+void VCL_DLLPUBLIC ShowServiceNotAvailableError( Window* pParent, const XubString& rServiceName, sal_Bool bError );
#endif // _VCL_STDTEXT_HXX
diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index cf433beadea6..450139b0ba14 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -47,10 +47,10 @@ int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& );
int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& );
// returns number of tokens (zero if empty or whitespace only)
-String VCL_DLLPUBLIC WhitespaceToSpace( const String&, BOOL bProtect = TRUE );
-ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE );
+String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
+ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect = sal_True );
// returns a string with multiple adjacent occurrences of whitespace
-// converted to a single space. if bProtect is TRUE (nonzero), then
+// converted to a single space. if bProtect is sal_True (nonzero), then
// doublequote, singlequote and singleleftquote protect their respective
// contents
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index df6229e62e6c..85e902161a48 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -78,8 +78,8 @@ VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
// - SystemWindowMode -
// --------------------
-#define SYSTEMWINDOW_MODE_NOAUTOMODE ((USHORT)0x0001)
-#define SYSTEMWINDOW_MODE_DIALOG ((USHORT)0x0002)
+#define SYSTEMWINDOW_MODE_NOAUTOMODE ((sal_uInt16)0x0001)
+#define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002)
// -------------
// - EventHook -
@@ -119,7 +119,7 @@ public:
const UniString& GetDomain() const { return aDomainName; }
int GetPID() const { return nPID; }
- BOOL IsConnectToSame( const ApplicationAddress& rAdr ) const;
+ sal_Bool IsConnectToSame( const ApplicationAddress& rAdr ) const;
};
inline ApplicationAddress::ApplicationAddress()
@@ -149,12 +149,12 @@ inline ApplicationAddress::ApplicationAddress( const UniString& rHost, int nPIDP
nPID = nPIDPar;
}
-inline BOOL ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
+inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const
{
if ( nPID && ((nPID == rAdr.nPID) && (aHostName.Equals( rAdr.aHostName))) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
#define APPEVENT_PARAM_DELIMITER '\n'
@@ -184,12 +184,12 @@ public:
const UniString& GetData() const { return aData; }
const ApplicationAddress& GetAppAddress() const { return aAppAddr; }
- BOOL IsOpenEvent() const;
- BOOL IsPrintEvent() const;
- BOOL IsDiskInsertEvent() const;
+ sal_Bool IsOpenEvent() const;
+ sal_Bool IsPrintEvent() const;
+ sal_Bool IsDiskInsertEvent() const;
- USHORT GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
- UniString GetParam( USHORT nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
+ sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); }
+ UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); }
};
inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName,
@@ -203,28 +203,28 @@ inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName,
{
}
-inline BOOL ApplicationEvent::IsOpenEvent() const
+inline sal_Bool ApplicationEvent::IsOpenEvent() const
{
if ( aEvent.Equals( APPEVENT_OPEN_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL ApplicationEvent::IsPrintEvent() const
+inline sal_Bool ApplicationEvent::IsPrintEvent() const
{
if ( aEvent.Equals( APPEVENT_PRINT_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-inline BOOL ApplicationEvent::IsDiskInsertEvent() const
+inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const
{
if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
class VCL_DLLPUBLIC PropertyHandler
@@ -245,9 +245,9 @@ public:
virtual int Main() = 0;
- virtual BOOL QueryExit();
+ virtual sal_Bool QueryExit();
- virtual void UserEvent( ULONG nEvent, void* pEventData );
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
virtual void ActivateExtHelp();
virtual void DeactivateExtHelp();
@@ -264,11 +264,11 @@ public:
static void InitAppRes( const ResId& rResId );
- static USHORT GetCommandLineParamCount();
- static XubString GetCommandLineParam( USHORT nParam );
+ static sal_uInt16 GetCommandLineParamCount();
+ static XubString GetCommandLineParam( sal_uInt16 nParam );
static const XubString& GetAppFileName();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
static void Abort( const XubString& rErrorText );
static void Execute();
@@ -278,23 +278,23 @@ public:
static void EndYield();
static osl::SolarMutex& GetSolarMutex();
static oslThreadIdentifier GetMainThreadIdentifier();
- static ULONG ReleaseSolarMutex();
- static void AcquireSolarMutex( ULONG nCount );
+ static sal_uLong ReleaseSolarMutex();
+ static void AcquireSolarMutex( sal_uLong nCount );
static void EnableNoYieldMode( bool i_bNoYield );
static void AddPostYieldListener( const Link& i_rListener );
static void RemovePostYieldListener( const Link& i_rListener );
- static BOOL IsInMain();
- static BOOL IsInExecute();
- static BOOL IsShutDown();
- static BOOL IsInModalMode();
- static USHORT GetModalModeCount();
+ static sal_Bool IsInMain();
+ static sal_Bool IsInExecute();
+ static sal_Bool IsShutDown();
+ static sal_Bool IsInModalMode();
+ static sal_uInt16 GetModalModeCount();
- static USHORT GetDispatchLevel();
- static BOOL AnyInput( USHORT nType = INPUT_ANY );
- static ULONG GetLastInputInterval();
- static BOOL IsUICaptured();
- static BOOL IsUserActive( USHORT nTest = USERACTIVE_ALL );
+ static sal_uInt16 GetDispatchLevel();
+ static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
+ static sal_uLong GetLastInputInterval();
+ static sal_Bool IsUICaptured();
+ static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL );
virtual void SystemSettingsChanging( AllSettings& rSettings,
Window* pFrame );
@@ -321,22 +321,22 @@ public:
static void RemoveEventListener( const Link& rEventListener );
static void AddKeyListener( const Link& rKeyListener );
static void RemoveKeyListener( const Link& rKeyListener );
- static void ImplCallEventListeners( ULONG nEvent, Window* pWin, void* pData );
+ static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData );
static void ImplCallEventListeners( VclSimpleEvent* pEvent );
- static BOOL HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
- static ULONG PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
- static ULONG PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent );
+ static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+ static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
static void RemoveMouseAndKeyEvents( Window *pWin );
- static BOOL IsProcessedMouseOrKeyEvent( ULONG nEventId );
+ static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId );
- static ULONG PostUserEvent( ULONG nEvent, void* pEventData = NULL );
- static ULONG PostUserEvent( const Link& rLink, void* pCaller = NULL );
- static BOOL PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData = NULL );
- static BOOL PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller = NULL );
- static void RemoveUserEvent( ULONG nUserEvent );
+ static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
+ static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
+ static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ static void RemoveUserEvent( sal_uLong nUserEvent );
- static BOOL InsertIdleHdl( const Link& rLink, USHORT nPriority );
+ static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority );
static void RemoveIdleHdl( const Link& rLink );
virtual void AppEvent( const ApplicationEvent& rAppEvent );
@@ -385,15 +385,15 @@ public:
static const LocaleDataWrapper& GetAppLocaleDataWrapper();
- static BOOL InsertAccel( Accelerator* pAccel );
+ static sal_Bool InsertAccel( Accelerator* pAccel );
static void RemoveAccel( Accelerator* pAccel );
static void FlushAccel();
- static BOOL CallAccel( const KeyCode& rKeyCode, USHORT nRepeat = 0 );
+ static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 );
- static ULONG AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
- static void RemoveHotKey( ULONG nId );
- static ULONG AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
- static void RemoveEventHook( ULONG nId );
+ static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL );
+ static void RemoveHotKey( sal_uLong nId );
+ static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL );
+ static void RemoveEventHook( sal_uLong nId );
static long CallEventHooks( NotifyEvent& rEvt );
static long CallPreNotify( NotifyEvent& rEvt );
static long CallEvent( NotifyEvent& rEvt );
@@ -401,24 +401,24 @@ public:
static void SetHelp( Help* pHelp = NULL );
static Help* GetHelp();
- static void EnableAutoHelpId( BOOL bEnabled = TRUE );
- static BOOL IsAutoHelpIdEnabled();
+ static void EnableAutoHelpId( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoHelpIdEnabled();
- static void EnableAutoMnemonic( BOOL bEnabled = TRUE );
- static BOOL IsAutoMnemonicEnabled();
+ static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True );
+ static sal_Bool IsAutoMnemonicEnabled();
- static ULONG GetReservedKeyCodeCount();
- static const KeyCode* GetReservedKeyCode( ULONG i );
- static String GetReservedKeyCodeDescription( ULONG i );
+ static sal_uLong GetReservedKeyCodeCount();
+ static const KeyCode* GetReservedKeyCode( sal_uLong i );
+ static String GetReservedKeyCodeDescription( sal_uLong i );
static void SetDefDialogParent( Window* pWindow );
static Window* GetDefDialogParent();
- static void EnableDialogCancel( BOOL bDialogCancel = TRUE );
- static BOOL IsDialogCancelEnabled();
+ static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True );
+ static sal_Bool IsDialogCancelEnabled();
- static void SetSystemWindowMode( USHORT nMode );
- static USHORT GetSystemWindowMode();
+ static void SetSystemWindowMode( sal_uInt16 nMode );
+ static sal_uInt16 GetSystemWindowMode();
static void SetDialogScaleX( short nScale );
static short GetDialogScaleX();
@@ -432,16 +432,16 @@ public:
// The global service manager has to be created before!
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit();
- static UnoWrapperBase* GetUnoWrapper( BOOL bCreateIfNotExists = TRUE );
+ static UnoWrapperBase* GetUnoWrapper( sal_Bool bCreateIfNotExists = sal_True );
static void SetUnoWrapper( UnoWrapperBase* pWrapper );
static void SetFilterHdl( const Link& rLink );
static const Link& GetFilterHdl();
- static BOOL IsAccessibilityEnabled();
+ static sal_Bool IsAccessibilityEnabled();
- static void EnableHeadlessMode( BOOL bEnable = TRUE );
- static BOOL IsHeadlessModeEnabled();
+ static void EnableHeadlessMode( sal_Bool bEnable = sal_True );
+ static sal_Bool IsHeadlessModeEnabled();
static void ShowNativeErrorBox(const String& sTitle ,
const String& sMessage);
@@ -557,6 +557,52 @@ protected:
osl::SolarMutex& m_solarMutex;
};
+class VCL_DLLPUBLIC SolarMutexResettableGuard
+{
+ SolarMutexResettableGuard( const SolarMutexResettableGuard& );
+ const SolarMutexResettableGuard& operator = ( const SolarMutexResettableGuard& );
+ bool m_bCleared;
+public:
+ /** Acquires mutex
+ @param pMutex pointer to mutex which is to be acquired */
+ SolarMutexResettableGuard()
+ : m_bCleared(false)
+ , m_solarMutex( Application::GetSolarMutex() )
+ {
+ m_solarMutex.acquire();
+ }
+
+ /** Releases mutex. */
+ virtual ~SolarMutexResettableGuard()
+ {
+ if( !m_bCleared )
+ {
+ m_solarMutex.release();
+ }
+ }
+
+ /** Releases mutex. */
+ void SAL_CALL clear()
+ {
+ if( !m_bCleared)
+ {
+ m_solarMutex.release();
+ m_bCleared = true;
+ }
+ }
+ /** Releases mutex. */
+ void SAL_CALL reset()
+ {
+ if( m_bCleared)
+ {
+ m_solarMutex.acquire();
+ m_bCleared = false;
+ }
+ }
+protected:
+ osl::SolarMutex& m_solarMutex;
+};
+
/**
A helper class that calls Application::ReleaseSolarMutex() in its constructor
@@ -564,7 +610,7 @@ protected:
*/
class SolarMutexReleaser
{
- ULONG mnReleased;
+ sal_uLong mnReleased;
const bool mbRescheduleDuringAcquire;
public:
enum
@@ -596,10 +642,10 @@ public:
VCL_DLLPUBLIC Application* GetpApp();
-VCL_DLLPUBLIC BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
+VCL_DLLPUBLIC sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
VCL_DLLPUBLIC void DeInitVCL();
-VCL_DLLPUBLIC BOOL InitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
+VCL_DLLPUBLIC sal_Bool InitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
// only allowed to call, if no thread is running. You must call JoinMainLoopThread to free all memory.
VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData );
diff --git a/vcl/inc/vcl/svcompat.hxx b/vcl/inc/vcl/svcompat.hxx
index 2aa0c82ad284..70d31381287f 100644
--- a/vcl/inc/vcl/svcompat.hxx
+++ b/vcl/inc/vcl/svcompat.hxx
@@ -36,10 +36,10 @@
// -----------
#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
- ((ULONG)((((ULONG)(char)(char1)))| \
- (((ULONG)(char)(char2))<<8UL)| \
- (((ULONG)(char)(char3))<<16UL)| \
- ((ULONG)(char)(char4))<<24UL))
+ ((sal_uLong)((((sal_uLong)(char)(char1)))| \
+ (((sal_uLong)(char)(char2))<<8UL)| \
+ (((sal_uLong)(char)(char3))<<16UL)| \
+ ((sal_uLong)(char)(char4))<<24UL))
class SvStream;
@@ -51,21 +51,21 @@ class SvStream;
class ImplCompat
{
SvStream* mpRWStm;
- UINT32 mnCompatPos;
- UINT32 mnTotalSize;
- UINT16 mnStmMode;
- UINT16 mnVersion;
+ sal_uInt32 mnCompatPos;
+ sal_uInt32 mnTotalSize;
+ sal_uInt16 mnStmMode;
+ sal_uInt16 mnVersion;
ImplCompat() {}
ImplCompat( const ImplCompat& rCompat ) {}
ImplCompat& operator=( const ImplCompat& rCompat ) { return *this; }
- BOOL operator==( const ImplCompat& rCompat ) { return FALSE; }
+ sal_Bool operator==( const ImplCompat& rCompat ) { return sal_False; }
public:
- ImplCompat( SvStream& rStm, USHORT nStreamMode, UINT16 nVersion = 1 );
+ ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
~ImplCompat();
- UINT16 GetVersion() const { return mnVersion; }
+ sal_uInt16 GetVersion() const { return mnVersion; }
};
#endif // _SV_SVCOMPAT_HXX
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 69ac3f540b65..b28283f1a405 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -30,17 +30,21 @@
#define _SV_SVDATA_HXX
#include <osl/thread.hxx>
-#include <tools/string.hxx>
-#include <tools/gen.hxx>
-#include <tools/shl.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclevent.hxx>
-#include <vcl/sv.h>
-#include <tools/color.hxx>
-#include <tools/debug.hxx>
-#include <vcl/dllapi.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/options.hxx>
+#include <rtl/ref.hxx>
+#include "tools/gen.hxx"
+#include "tools/shl.hxx"
+#include "tools/link.hxx"
+#include "tools/fldunit.hxx"
+#include "tools/string.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/sv.h"
+#include "tools/color.hxx"
+#include "tools/debug.hxx"
+#include "vcl/dllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include "unotools/options.hxx"
+
+#include <boost/unordered_map.hpp>
namespace com {
namespace sun {
@@ -51,9 +55,6 @@ namespace lang {
namespace frame {
class XSessionManagerClient;
}
-namespace awt {
- class XDisplayConnection;
-}
}}}
struct ImplTimerData;
@@ -150,21 +151,23 @@ struct ImplSVAppData
ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners
- ULONG mnLastInputTime; // GetLastInputTime()
- USHORT mnDispatchLevel; // DispatchLevel
- USHORT mnModalMode; // ModalMode Count
- USHORT mnModalDialog; // ModalDialog Count
- USHORT mnAccessCount; // AccessHdl Count
- USHORT mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
- USHORT mnLayout; // --- RTL-Flags --- currently not used, only for testing
+ sal_uLong mnLastInputTime; // GetLastInputTime()
+ sal_uInt16 mnDispatchLevel; // DispatchLevel
+ sal_uInt16 mnModalMode; // ModalMode Count
+ sal_uInt16 mnModalDialog; // ModalDialog Count
+ sal_uInt16 mnAccessCount; // AccessHdl Count
+ sal_uInt16 mnSysWinMode; // Modus, wann SystemWindows erzeugt werden sollen
+ sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
- BOOL mbInAppMain; // is Application::Main() on stack
- BOOL mbInAppExecute; // is Application::Execute() on stack
- BOOL mbAppQuit; // is Application::Quit() called
- BOOL mbSettingsInit; // TRUE: Settings are initialized
- BOOL mbDialogCancel; // TRUE: Alle Dialog::Execute()-Aufrufe werden mit return FALSE sofort beendet
- BOOL mbNoYield; // Application::Yield will not wait for events if the queue is empty
+ sal_Bool mbInAppMain; // is Application::Main() on stack
+ sal_Bool mbInAppExecute; // is Application::Execute() on stack
+ sal_Bool mbAppQuit; // is Application::Quit() called
+ sal_Bool mbSettingsInit; // sal_True: Settings are initialized
+ sal_Bool mbDialogCancel; // sal_True: Alle Dialog::Execute()-Aufrufe werden mit return sal_False sofort beendet
+ sal_Bool mbNoYield; // Application::Yield will not wait for events if the queue is empty
// essentially that makes it the same as Application::Reschedule
+ long mnDefaultLayoutBorder; // default value in pixel for layout distances used
+ // in window arrangers
/** Controls whether showing any IME status window is toggled on or off.
@@ -202,10 +205,9 @@ struct ImplSVGDIData
long mnRealAppFontX; // AppFont X-Numenator for 40/tel Width
long mnAppFontX; // AppFont X-Numenator for 40/tel Width + DialogScaleX
long mnAppFontY; // AppFont Y-Numenator for 80/tel Height
- BOOL mbFontSubChanged; // TRUE: FontSubstitution wurde zwischen Begin/End geaendert
+ sal_Bool mbFontSubChanged; // sal_True: FontSubstitution wurde zwischen Begin/End geaendert
utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
utl::FontSubstConfiguration* mpFontSubstConfiguration;
- bool mbPrinterPullModel; // true: use pull model instead of normal push model when printing
bool mbNativeFontConfig; // true: do not override UI font
bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
};
@@ -232,11 +234,11 @@ struct ImplSVWinData
AutoTimer* mpTrackTimer; // tracking timer
ImageList* mpMsgBoxImgList; // ImageList for MessageBox
Window* mpAutoScrollWin; // window, that is in AutoScrollMode mode
- USHORT mnTrackFlags; // tracking flags
- USHORT mnAutoScrollFlags; // auto scroll flags
- BOOL mbNoDeactivate; // TRUE: keine Deactivate durchfuehren
- BOOL mbNoSaveFocus; // TRUE: menues must not save/restore focus
- BOOL mbNoSaveBackground; // TRUE: save background is unnecessary or even less performant
+ sal_uInt16 mnTrackFlags; // tracking flags
+ sal_uInt16 mnAutoScrollFlags; // auto scroll flags
+ sal_Bool mbNoDeactivate; // sal_True: keine Deactivate durchfuehren
+ sal_Bool mbNoSaveFocus; // sal_True: menues must not save/restore focus
+ sal_Bool mbNoSaveBackground; // sal_True: save background is unnecessary or even less performant
};
@@ -244,6 +246,8 @@ struct ImplSVWinData
// - ImplSVCtrlData -
// ------------------
+typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
+
struct ImplSVCtrlData
{
ImageList* mpCheckImgList; // ImageList for CheckBoxes
@@ -256,15 +260,17 @@ struct ImplSVCtrlData
Image* mpDisclosurePlus;
Image* mpDisclosureMinus;
ImplTBDragMgr* mpTBDragMgr; // DragMgr for ToolBox
- USHORT mnCheckStyle; // CheckBox-Style for ImageList-Update
- USHORT mnRadioStyle; // Radio-Style for ImageList-Update
- ULONG mnLastCheckFColor; // Letzte FaceColor fuer CheckImage
- ULONG mnLastCheckWColor; // Letzte WindowColor fuer CheckImage
- ULONG mnLastCheckWTextColor; // Letzte WindowTextColor fuer CheckImage
- ULONG mnLastCheckLColor; // Letzte LightColor fuer CheckImage
- ULONG mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
- ULONG mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
- ULONG mnLastRadioLColor; // Letzte LightColor fuer RadioImage
+ sal_uInt16 mnCheckStyle; // CheckBox-Style for ImageList-Update
+ sal_uInt16 mnRadioStyle; // Radio-Style for ImageList-Update
+ sal_uLong mnLastCheckFColor; // Letzte FaceColor fuer CheckImage
+ sal_uLong mnLastCheckWColor; // Letzte WindowColor fuer CheckImage
+ sal_uLong mnLastCheckWTextColor; // Letzte WindowTextColor fuer CheckImage
+ sal_uLong mnLastCheckLColor; // Letzte LightColor fuer CheckImage
+ sal_uLong mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
+ sal_uLong mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
+ sal_uLong mnLastRadioLColor; // Letzte LightColor fuer RadioImage
+ FieldUnitStringList* mpFieldUnitStrings; // list with field units
+ FieldUnitStringList* mpCleanUnitStrings; // same list but with some "fluff" like spaces removed
};
@@ -274,18 +280,18 @@ struct ImplSVCtrlData
struct ImplSVHelpData
{
- BOOL mbContextHelp : 1; // is ContextHelp enabled
- BOOL mbExtHelp : 1; // is ExtendedHelp enabled
- BOOL mbExtHelpMode : 1; // is in ExtendedHelp Mode
- BOOL mbOldBalloonMode : 1; // BallonMode, befor ExtHelpMode started
- BOOL mbBalloonHelp : 1; // is BalloonHelp enabled
- BOOL mbQuickHelp : 1; // is QuickHelp enabled
- BOOL mbSetKeyboardHelp : 1; // tiphelp was activated by keyboard
- BOOL mbKeyboardHelp : 1; // tiphelp was activated by keyboard
- BOOL mbAutoHelpId : 1; // generate HelpIds
- BOOL mbRequestingHelp : 1; // In Window::RequestHelp
+ sal_Bool mbContextHelp : 1; // is ContextHelp enabled
+ sal_Bool mbExtHelp : 1; // is ExtendedHelp enabled
+ sal_Bool mbExtHelpMode : 1; // is in ExtendedHelp Mode
+ sal_Bool mbOldBalloonMode : 1; // BallonMode, befor ExtHelpMode started
+ sal_Bool mbBalloonHelp : 1; // is BalloonHelp enabled
+ sal_Bool mbQuickHelp : 1; // is QuickHelp enabled
+ sal_Bool mbSetKeyboardHelp : 1; // tiphelp was activated by keyboard
+ sal_Bool mbKeyboardHelp : 1; // tiphelp was activated by keyboard
+ sal_Bool mbAutoHelpId : 1; // generate HelpIds
+ sal_Bool mbRequestingHelp : 1; // In Window::RequestHelp
HelpTextWindow* mpHelpWin; // HelpWindow
- ULONG mnLastHelpHideTime; // ticks of last show
+ sal_uLong mnLastHelpHideTime; // ticks of last show
};
struct ImplSVNWFData
@@ -312,10 +318,8 @@ struct ImplSVNWFData
// window background before drawing the native
// checkbox
bool mbScrollbarJumpPage; // true for "jump to here" behavior
+ int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner
bool mbCanDrawWidgetAnySize; // set to true currently on gtk
- // signals that widgets can be drawn in any size and
- // brdwin.cxx ImplSmallBorderWindowView::DrawWindow
- // should not do GetNativeControlRegion
};
@@ -329,18 +333,18 @@ struct ImplSVData
SalInstance* mpDefInst; // Default SalInstance
Application* mpApp; // pApp
WorkWindow* mpDefaultWin; // Default-Window
- BOOL mbDeInit; // Is VCL deinitializing
- ULONG mnThreadCount; // is VCL MultiThread enabled
+ sal_Bool mbDeInit; // Is VCL deinitializing
+ sal_uLong mnThreadCount; // is VCL MultiThread enabled
ImplConfigData* mpFirstConfigData; // Zeiger auf ersten Config-Block
ImplTimerData* mpFirstTimerData; // list of all running timers
SalTimer* mpSalTimer; // interface to sal event loop/timers
SalI18NImeStatus* mpImeStatus; // interface to ime status window
SalSystem* mpSalSystem; // SalSystem interface
ResMgr* mpResMgr; // SV-Resource-Manager
- ULONG mnTimerPeriod; // current timer period
- ULONG mnTimerUpdate; // TimerCallbackProcs on stack
- BOOL mbNotAllTimerCalled;// TRUE: Es muessen noch Timer abgearbeitet werden
- BOOL mbNoCallTimer; // TRUE: No Timeout calls
+ sal_uLong mnTimerPeriod; // current timer period
+ sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
+ sal_Bool mbNotAllTimerCalled;// sal_True: Es muessen noch Timer abgearbeitet werden
+ sal_Bool mbNoCallTimer; // sal_True: No Timeout calls
ImplSVAppData maAppData; // indepen data for class Application
ImplSVGDIData maGDIData; // indepen data for Output classes
ImplSVWinData maWinData; // indepen data for Windows classes
@@ -350,24 +354,24 @@ struct ImplSVData
UnoWrapperBase* mpUnoWrapper;
Window* mpIntroWindow; // the splash screen
DockingManager* mpDockingManager;
- BOOL mbIsTestTool;
+ sal_Bool mbIsTestTool;
oslThreadIdentifier mnMainThreadId;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::awt::XDisplayConnection > mxDisplayConnection;
+ rtl::Reference< vcl::DisplayConnection > mxDisplayConnection;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge;
com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient;
::vcl::SettingsConfigItem* mpSettingsConfigItem;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
+ boost::unordered_map< int, rtl::OUString >* mpPaperNames;
};
void ImplInitSVData();
void ImplDeInitSVData();
void ImplDestroySVData();
Window* ImplGetDefaultWindow();
-VCL_DLLPUBLIC ResMgr* ImplGetResMgr();
-VCL_DLLPUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
+VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
+VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
void ImplWindowAutoMnemonic( Window* pWindow );
@@ -375,7 +379,7 @@ void ImplUpdateSystemProcessWindow();
Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
// SVAPP.CXX
-BOOL ImplCallHotKey( const KeyCode& rKeyCode );
+sal_Bool ImplCallHotKey( const KeyCode& rKeyCode );
void ImplFreeHotKeyData();
void ImplFreeEventHookData();
@@ -383,11 +387,15 @@ void ImplFreeEventHookData();
long ImplCallPreNotify( NotifyEvent& rEvt );
long ImplCallEvent( NotifyEvent& rEvt );
-extern VCL_DLLPUBLIC ImplSVData* pImplSVData;
-inline VCL_DLLPUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
+extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData;
+inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
inline ImplSVData* ImplGetAppSVData() { return ImplGetSVData(); }
-bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
+bool ImplInitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
+
+FieldUnitStringList* ImplGetFieldUnits();
+FieldUnitStringList* ImplGetCleanedFieldUnits();
+
// -----------------------------------------------------------------------
@@ -415,20 +423,20 @@ struct ImplDelData
{
ImplDelData* mpNext;
const Window* mpWindow;
- BOOL mbDel;
+ sal_Bool mbDel;
ImplDelData( const Window* pWindow = NULL )
- : mpNext( NULL ), mpWindow( NULL ), mbDel( FALSE )
+ : mpNext( NULL ), mpWindow( NULL ), mbDel( sal_False )
{ if( pWindow ) AttachToWindow( pWindow ); }
virtual ~ImplDelData();
bool IsDead() const
{
- DBG_ASSERT( mbDel == FALSE, "object deleted while in use !" );
- return (mbDel!=FALSE);
+ DBG_ASSERT( mbDel == sal_False, "object deleted while in use !" );
+ return (mbDel!=sal_False);
}
- BOOL /*deprecated */IsDelete() const { return (BOOL)IsDead(); }
+ sal_Bool /*deprecated */IsDelete() const { return (sal_Bool)IsDead(); }
private:
void AttachToWindow( const Window* );
@@ -440,12 +448,12 @@ private:
struct ImplSVEvent
{
- ULONG mnEvent;
+ sal_uLong mnEvent;
void* mpData;
Link* mpLink;
Window* mpWindow;
ImplDelData maDelData;
- BOOL mbCall;
+ sal_Bool mbCall;
};
#endif // _SV_SVDATA_HXX
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index 50e334deaa3b..bc76c70e1ebe 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -31,11 +31,7 @@
#include "svl/solar.hrc"
#define SV_RESID_STDOFFSET 0
-#define SV_RESID_WINOFFSET 1
-#define SV_RESID_OS2OFFSET 2
-#define SV_RESID_MACOFFSET 3
-#define SV_RESID_UNIXOFFSET 4
-#define SV_RESID_MONOOFFSET 5
+#define SV_RESID_MONOOFFSET 1
// Achtung: Diese Id's muessen min. 10 Werte auseinanderliegen, da
// je nach Style noch ein Offset aufgerechnet wird
@@ -58,6 +54,8 @@
#define SV_DISCLOSURE_PLUS 1060
#define SV_DISCLOSURE_MINUS 1061
+#define RID_STR_PAPERNAMES 1070
+
#define SV_RESID_MENU_EDIT 2000
#define SV_MENU_EDIT_UNDO 1
#define SV_MENU_EDIT_CUT 2
@@ -118,8 +116,10 @@
#define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT 1
#define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE 2
-#define SV_PRINT_PRT_NUP_ORDER_LRTD 0
-#define SV_PRINT_PRT_NUP_ORDER_TDLR 1
+#define SV_PRINT_PRT_NUP_ORDER_LRTB 0
+#define SV_PRINT_PRT_NUP_ORDER_TBLR 1
+#define SV_PRINT_PRT_NUP_ORDER_TBRL 2
+#define SV_PRINT_PRT_NUP_ORDER_RLTB 3
#define SV_PRINT_TAB_JOB 2
#define SV_PRINT_PRINTERS_FL 1
@@ -143,12 +143,12 @@
#define SV_PRINT_LOCATION_TXT 21
#define SV_PRINT_COMMENT_TXT 22
#define SV_PRINT_DETAILS_BTN 23
+#define SV_PRINT_OPT_REVERSE 24
#define SV_PRINT_TAB_OPT 3
#define SV_PRINT_OPT_PRINT_FL 1
#define SV_PRINT_OPT_TOFILE 2
#define SV_PRINT_OPT_SINGLEJOBS 3
-#define SV_PRINT_OPT_REVERSE 4
#define SV_DLG_PRINT_PROGRESS 2049
#define SV_PRINT_PROGRESS_CANCEL 1
@@ -206,7 +206,8 @@
#define SV_ACCESSERROR_JAVA_NOT_CONFIGURED 10507
#define SV_ACCESSERROR_JAVA_DISABLED 10508
#define SV_ACCESSERROR_TURNAROUND_MSG 10509
-#define SV_ACCESSERROR_LAST SV_ACCESSERROR_TURNAROUND_MSG
+#define SV_ACCESSERROR_NO_FONTS 10510
+#define SV_ACCESSERROR_LAST SV_ACCESSERROR_NO_FONTS
#define SV_SHORTCUT_HELP 10600
#define SV_SHORTCUT_CONTEXTHELP 10601
diff --git a/vcl/inc/vcl/symbol.hxx b/vcl/inc/vcl/symbol.hxx
index cb7074986911..c03bf9a6af58 100644
--- a/vcl/inc/vcl/symbol.hxx
+++ b/vcl/inc/vcl/symbol.hxx
@@ -36,7 +36,7 @@
// ----------------
// By changes you must also change: rsc/vclrsc.hxx
-typedef USHORT SymbolType;
+typedef sal_uInt16 SymbolType;
#define SYMBOL_DONTKNOW ((SymbolType)0)
#define SYMBOL_IMAGE ((SymbolType)1)
#define SYMBOL_ARROW_UP ((SymbolType)2)
@@ -72,9 +72,6 @@ typedef USHORT SymbolType;
#define SYMBOL_DOCK ((SymbolType)32)
#define SYMBOL_HIDE ((SymbolType)33)
#define SYMBOL_HELP ((SymbolType)34)
-#define SYMBOL_OS2CLOSE ((SymbolType)35)
-#define SYMBOL_OS2FLOAT ((SymbolType)36)
-#define SYMBOL_OS2HIDE ((SymbolType)37)
#define SYMBOL_MENU SYMBOL_SPIN_DOWN
#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW)
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index 459f97e68abd..275e41312f17 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -44,7 +44,8 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window
{
private:
using Window::ImplInit;
- SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE );
+ SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_False );
+ SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
@@ -53,7 +54,7 @@ private:
public:
SystemChildWindow( Window* pParent, WinBits nStyle = 0 );
// create a SystemChildWindow using the given SystemWindowData
- SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = TRUE );
+ SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow = sal_True );
SystemChildWindow( Window* pParent, const ResId& rResId );
~SystemChildWindow();
@@ -61,9 +62,13 @@ public:
// per default systemchildwindows erase their background for better plugin support
// however, this might not always be required
- void EnableEraseBackground( BOOL bEnable = TRUE );
- BOOL IsEraseBackgroundEnabled();
- void SetForwardKey( BOOL bEnable );
+ void EnableEraseBackground( sal_Bool bEnable = sal_True );
+ sal_Bool IsEraseBackgroundEnabled();
+ void SetForwardKey( sal_Bool bEnable );
+ // return the platform specific handle/id of this window;
+ // in case the flag bUseJava is set, a java compatible overlay window
+ // is created on which other java windows can be created (plugin interface)
+ sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False );
};
#endif // _SV_SYSCHILD_HXX
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index b25a1275673e..120ba30f4dff 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -181,6 +181,7 @@ struct SystemFontData
// --------------------
typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
+
struct SystemTextLayoutData
{
unsigned long nSize; // size in bytes of this structure
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index dcc287a4e2cc..0fd2fd8d1512 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -66,27 +66,27 @@ class TaskPaneList;
// - WindowStateData -
// -------------------
-#define WINDOWSTATE_MASK_X ((ULONG)0x00000001)
-#define WINDOWSTATE_MASK_Y ((ULONG)0x00000002)
-#define WINDOWSTATE_MASK_WIDTH ((ULONG)0x00000004)
-#define WINDOWSTATE_MASK_HEIGHT ((ULONG)0x00000008)
-#define WINDOWSTATE_MASK_STATE ((ULONG)0x00000010)
-#define WINDOWSTATE_MASK_MINIMIZED ((ULONG)0x00000020)
-#define WINDOWSTATE_MASK_MAXIMIZED_X ((ULONG)0x00000100)
-#define WINDOWSTATE_MASK_MAXIMIZED_Y ((ULONG)0x00000200)
-#define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((ULONG)0x00000400)
-#define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((ULONG)0x00000800)
+#define WINDOWSTATE_MASK_X ((sal_uLong)0x00000001)
+#define WINDOWSTATE_MASK_Y ((sal_uLong)0x00000002)
+#define WINDOWSTATE_MASK_WIDTH ((sal_uLong)0x00000004)
+#define WINDOWSTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
+#define WINDOWSTATE_MASK_STATE ((sal_uLong)0x00000010)
+#define WINDOWSTATE_MASK_MINIMIZED ((sal_uLong)0x00000020)
+#define WINDOWSTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
+#define WINDOWSTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
+#define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
+#define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
#define WINDOWSTATE_MASK_POS (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)
#define WINDOWSTATE_MASK_ALL (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)
-#define WINDOWSTATE_STATE_NORMAL ((ULONG)0x00000001)
-#define WINDOWSTATE_STATE_MINIMIZED ((ULONG)0x00000002)
-#define WINDOWSTATE_STATE_MAXIMIZED ((ULONG)0x00000004)
-#define WINDOWSTATE_STATE_ROLLUP ((ULONG)0x00000008)
-#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((ULONG)0x00000010)
-#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((ULONG)0x00000020)
+#define WINDOWSTATE_STATE_NORMAL ((sal_uLong)0x00000001)
+#define WINDOWSTATE_STATE_MINIMIZED ((sal_uLong)0x00000002)
+#define WINDOWSTATE_STATE_MAXIMIZED ((sal_uLong)0x00000004)
+#define WINDOWSTATE_STATE_ROLLUP ((sal_uLong)0x00000008)
+#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
+#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
-class VCL_DLLPUBLIC WindowStateData
+class VCL_PLUGIN_PUBLIC WindowStateData
{
private:
sal_uInt32 mnValidMask;
@@ -107,7 +107,7 @@ public:
mnMaximizedX = mnMaximizedY = mnMaximizedWidth = mnMaximizedHeight = 0;
}
- void SetMask( ULONG nValidMask ) { mnValidMask = nValidMask; }
+ void SetMask( sal_uLong nValidMask ) { mnValidMask = nValidMask; }
sal_uInt32 GetMask() const { return mnValidMask; }
void SetX( int nX ) { mnX = nX; }
@@ -134,12 +134,12 @@ public:
// - SystemWindow-Types -
// ----------------------
-#define MENUBAR_MODE_NORMAL ((USHORT)0)
-#define MENUBAR_MODE_HIDE ((USHORT)1)
+#define MENUBAR_MODE_NORMAL ((sal_uInt16)0)
+#define MENUBAR_MODE_HIDE ((sal_uInt16)1)
-#define TITLE_BUTTON_DOCKING ((USHORT)1)
-#define TITLE_BUTTON_HIDE ((USHORT)2)
-#define TITLE_BUTTON_MENU ((USHORT)4)
+#define TITLE_BUTTON_DOCKING ((sal_uInt16)1)
+#define TITLE_BUTTON_HIDE ((sal_uInt16)2)
+#define TITLE_BUTTON_MENU ((sal_uInt16)4)
// ----------------
// - SystemWindow -
@@ -156,20 +156,20 @@ private:
Size maOrgSize;
Size maRollUpOutSize;
Size maMinOutSize;
- BOOL mbPined;
- BOOL mbRollUp;
- BOOL mbRollFunc;
- BOOL mbDockBtn;
- BOOL mbHideBtn;
- BOOL mbSysChild;
- USHORT mnMenuBarMode;
- USHORT mnIcon;
+ sal_Bool mbPined;
+ sal_Bool mbRollUp;
+ sal_Bool mbRollFunc;
+ sal_Bool mbDockBtn;
+ sal_Bool mbHideBtn;
+ sal_Bool mbSysChild;
+ sal_uInt16 mnMenuBarMode;
+ sal_uInt16 mnIcon;
ImplData* mpImplData;
#if _SOLAR__PRIVATE
public:
using Window::ImplIsInTaskPaneList;
- SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList( Window* pWin );
+ SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList( Window* pWin );
#endif
private:
@@ -193,34 +193,34 @@ public:
virtual long Notify( NotifyEvent& rNEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
- virtual BOOL Close();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual sal_Bool Close();
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void Resizing( Size& rSize );
- void SetIcon( USHORT nIcon );
- USHORT GetIcon() const { return mnIcon; }
+ void SetIcon( sal_uInt16 nIcon );
+ sal_uInt16 GetIcon() const { return mnIcon; }
// for systems like MacOSX which can display the URL a document is loaded from
// separately from the window title
void SetRepresentedURL( const rtl::OUString& );
const rtl::OUString& GetRepresentedURL() const;
- void SetZLevel( BYTE nLevel );
- BYTE GetZLevel() const;
+ void SetZLevel( sal_uInt8 nLevel );
+ sal_uInt8 GetZLevel() const;
- void EnableSaveBackground( BOOL bSave = TRUE );
- BOOL IsSaveBackgroundEnabled() const;
+ void EnableSaveBackground( sal_Bool bSave = sal_True );
+ sal_Bool IsSaveBackgroundEnabled() const;
- void ShowTitleButton( USHORT nButton, BOOL bVisible = TRUE );
- BOOL IsTitleButtonVisible( USHORT nButton ) const;
+ void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
+ sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
- void SetPin( BOOL bPin );
- BOOL IsPined() const { return mbPined; }
+ void SetPin( sal_Bool bPin );
+ sal_Bool IsPined() const { return mbPined; }
void RollUp();
void RollDown();
- BOOL IsRollUp() const { return mbRollUp; }
+ sal_Bool IsRollUp() const { return mbRollUp; }
void SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
Size GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
@@ -232,12 +232,12 @@ public:
Size GetResizeOutputSizePixel() const;
void SetWindowState( const ByteString& rStr );
- ByteString GetWindowState( ULONG nMask = WINDOWSTATE_MASK_ALL ) const;
+ ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const;
void SetMenuBar( MenuBar* pMenuBar );
MenuBar* GetMenuBar() const { return mpMenuBar; }
- void SetMenuBarMode( USHORT nMode );
- USHORT GetMenuBarMode() const { return mnMenuBarMode; }
+ void SetMenuBarMode( sal_uInt16 nMode );
+ sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 5463246ec8a0..c6525138f73b 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -45,8 +45,8 @@ class ListBox;
// --------------------
#ifndef TAB_APPEND
-#define TAB_APPEND ((USHORT)0xFFFF)
-#define TAB_PAGE_NOTFOUND ((USHORT)0xFFFF)
+#define TAB_APPEND ((sal_uInt16)0xFFFF)
+#define TAB_PAGE_NOTFOUND ((sal_uInt16)0xFFFF)
#endif /* !TAB_APPEND */
// --------------
@@ -62,40 +62,30 @@ private:
long mnLastHeight;
long mnBtnSize;
long mnMaxPageWidth;
- USHORT mnActPageId;
- USHORT mnCurPageId;
- USHORT mnFirstPagePos;
- USHORT mnLastFirstPagePos;
- BOOL mbFormat;
- BOOL mbRestoreHelpId;
- BOOL mbRestoreUnqId;
- BOOL mbSingleLine;
- BOOL mbScroll;
- BOOL mbRestoreSmartId;
- BOOL mbSmallInvalidate;
- BOOL mbExtraSpace;
+ sal_uInt16 mnActPageId;
+ sal_uInt16 mnCurPageId;
+ sal_Bool mbFormat;
+ sal_Bool mbRestoreHelpId;
+ sal_Bool mbRestoreUnqId;
+ sal_Bool mbSmallInvalidate;
+ sal_Bool mbExtraSpace;
Link maActivateHdl;
Link maDeactivateHdl;
using Control::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE ImplTabItem* ImplGetItem( USHORT nId ) const;
- SAL_DLLPRIVATE void ImplScrollBtnsColor();
- SAL_DLLPRIVATE void ImplSetScrollBtnsState();
- SAL_DLLPRIVATE void ImplPosScrollBtns();
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SAL_DLLPRIVATE ImplTabItem* ImplGetItem( sal_uInt16 nId ) const;
SAL_DLLPRIVATE Size ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth );
- SAL_DLLPRIVATE Rectangle ImplGetTabRect( USHORT nPos, long nWidth = -1, long nHeight = -1 );
- SAL_DLLPRIVATE void ImplChangeTabPage( USHORT nId, USHORT nOldId );
- SAL_DLLPRIVATE BOOL ImplPosCurTabPage();
- SAL_DLLPRIVATE void ImplActivateTabPage( BOOL bNext );
- SAL_DLLPRIVATE void ImplSetFirstPagePos( USHORT nPagePos );
+ SAL_DLLPRIVATE Rectangle ImplGetTabRect( sal_uInt16 nPos, long nWidth = -1, long nHeight = -1 );
+ SAL_DLLPRIVATE void ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId );
+ SAL_DLLPRIVATE sal_Bool ImplPosCurTabPage();
+ SAL_DLLPRIVATE void ImplActivateTabPage( sal_Bool bNext );
SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout = false, bool bFirstInGroup = false, bool bLastInGroup = false, bool bIsCurrentItem = false );
SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false );
SAL_DLLPRIVATE void ImplFreeLayoutData();
SAL_DLLPRIVATE long ImplHandleKeyEvent( const KeyEvent& rKeyEvent );
- DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn );
DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, ListBox* );
DECL_DLLPRIVATE_LINK( ImplWindowEventListener, VclSimpleEvent* );
@@ -144,55 +134,52 @@ public:
Point GetItemsOffset() const;
void InsertPage( const ResId& rResId,
- USHORT nPos = TAB_APPEND );
- void InsertPage( USHORT nPageId, const XubString& rText,
- USHORT nPos = TAB_APPEND );
- void RemovePage( USHORT nPageId );
+ sal_uInt16 nPos = TAB_APPEND );
+ void InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ sal_uInt16 nPos = TAB_APPEND );
+ void RemovePage( sal_uInt16 nPageId );
void Clear();
- void EnablePage( USHORT nPageId, bool bEnable = true );
+ void EnablePage( sal_uInt16 nPageId, bool bEnable = true );
- USHORT GetPageCount() const;
- USHORT GetPageId( USHORT nPos ) const;
- USHORT GetPagePos( USHORT nPageId ) const;
- USHORT GetPageId( const Point& rPos ) const;
+ sal_uInt16 GetPageCount() const;
+ sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetPageId( const Point& rPos ) const;
- void SetCurPageId( USHORT nPageId );
- USHORT GetCurPageId() const;
+ void SetCurPageId( sal_uInt16 nPageId );
+ sal_uInt16 GetCurPageId() const;
- void SetFirstPageId( USHORT nPageId );
- USHORT GetFirstPageId() const { return GetPageId( mnFirstPagePos ); }
-
- void SelectTabPage( USHORT nPageId );
+ void SelectTabPage( sal_uInt16 nPageId );
void SetMaxPageWidth( long nMaxWidth ) { mnMaxPageWidth = nMaxWidth; }
long GetMaxPageWidth() const { return mnMaxPageWidth; }
void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
- BOOL IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+ sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
- void SetTabPage( USHORT nPageId, TabPage* pPage );
- TabPage* GetTabPage( USHORT nPageId ) const;
- USHORT GetTabPageResId( USHORT nPageId ) const;
+ void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
+ TabPage* GetTabPage( sal_uInt16 nPageId ) const;
+ sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const;
- void SetPageText( USHORT nPageId, const XubString& rText );
- XubString GetPageText( USHORT nPageId ) const;
+ void SetPageText( sal_uInt16 nPageId, const XubString& rText );
+ XubString GetPageText( sal_uInt16 nPageId ) const;
- void SetHelpText( USHORT nPageId, const XubString& rText );
- const XubString& GetHelpText( USHORT nPageId ) const;
+ void SetHelpText( sal_uInt16 nPageId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nPageId ) const;
- void SetPageImage( USHORT nPageId, const Image& rImage );
- const Image* GetPageImage( USHORT nPageId ) const;
+ void SetPageImage( sal_uInt16 nPageId, const Image& rImage );
+ const Image* GetPageImage( sal_uInt16 nPageId ) const;
void SetHelpText( const XubString& rText )
{ Control::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Control::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
@@ -203,19 +190,19 @@ public:
// returns (control relative) bounding rectangle for the
// character at index nIndex relative to the text of page nPageId
using Control::GetCharacterBounds;
- Rectangle GetCharacterBounds( USHORT nPageId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const;
// returns the index relative to the text of page nPageId (also returned)
// at position rPoint (control relative)
using Control::GetIndexForPoint;
- long GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const;
// returns the bounding rectangle of the union of tab page area and the
// corresponding tab
- Rectangle GetTabPageBounds( USHORT nPageId ) const;
+ Rectangle GetTabPageBounds( sal_uInt16 nPageId ) const;
// returns the rectangle of the tab for page nPageId
- Rectangle GetTabBounds( USHORT nPageId ) const;
+ Rectangle GetTabBounds( sal_uInt16 nPageId ) const;
};
#endif // _SV_TABCTRL_HXX
diff --git a/vcl/inc/vcl/tabdlg.hxx b/vcl/inc/vcl/tabdlg.hxx
index 51591522d8e5..0b654b409f33 100644
--- a/vcl/inc/vcl/tabdlg.hxx
+++ b/vcl/inc/vcl/tabdlg.hxx
@@ -46,7 +46,7 @@ private:
FixedLine* mpFixedLine;
Window* mpViewWindow;
WindowAlign meViewAlign;
- BOOL mbPosControls;
+ sal_Bool mbPosControls;
SAL_DLLPRIVATE void ImplInitTabDialogData();
SAL_DLLPRIVATE void ImplPosControls();
diff --git a/vcl/inc/vcl/tabpage.hxx b/vcl/inc/vcl/tabpage.hxx
index c385583e6ad7..92a00f892845 100644
--- a/vcl/inc/vcl/tabpage.hxx
+++ b/vcl/inc/vcl/tabpage.hxx
@@ -49,7 +49,7 @@ public:
TabPage( Window* pParent, const ResId& rResId );
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx
index 0eb4f20cd97d..102f755554f2 100644
--- a/vcl/inc/vcl/taskpanelist.hxx
+++ b/vcl/inc/vcl/taskpanelist.hxx
@@ -37,12 +37,12 @@
class VCL_DLLPUBLIC TaskPaneList
{
::std::vector<Window *> mTaskPanes;
- Window *FindNextPane( Window *pWindow, BOOL bForward = TRUE );
- Window *FindNextFloat( Window *pWindow, BOOL bForward = TRUE );
- Window *FindNextSplitter( Window *pWindow, BOOL bForward = TRUE );
+ Window *FindNextPane( Window *pWindow, sal_Bool bForward = sal_True );
+ Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True );
+ Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True );
public:
- BOOL IsInList( Window *pWindow );
+ sal_Bool IsInList( Window *pWindow );
public:
TaskPaneList();
@@ -50,7 +50,7 @@ public:
void AddWindow( Window *pWindow );
void RemoveWindow( Window *pWindow );
- BOOL HandleKeyEvent( KeyEvent aKeyEvent );
+ sal_Bool HandleKeyEvent( KeyEvent aKeyEvent );
};
#endif
diff --git a/vcl/inc/vcl/textlayout.hxx b/vcl/inc/vcl/textlayout.hxx
index 0f593ed00e21..5902573f8746 100644..100755
--- a/vcl/inc/vcl/textlayout.hxx
+++ b/vcl/inc/vcl/textlayout.hxx
@@ -118,7 +118,7 @@ namespace vcl
virtual ~ControlTextRenderer();
Rectangle DrawText( const Rectangle& _rRect,
- const XubString& _rText, USHORT _nStyle = 0,
+ const XubString& _rText, sal_uInt16 _nStyle = 0,
MetricVector* _pVector = NULL, String* _pDisplayText = NULL );
private:
diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx
new file mode 100644
index 000000000000..ce45631d2fda
--- /dev/null
+++ b/vcl/inc/vcl/throbber.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef VCL_THROBBER_HXX
+#define VCL_THROBBER_HXX
+
+#include "vcl/dllapi.h"
+#include "vcl/imgctrl.hxx"
+#include "vcl/timer.hxx"
+
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <vector>
+
+class VCL_DLLPUBLIC Throbber : public ImageControl
+{
+public:
+ enum ImageSet
+ {
+ /// no (default) images at all
+ IMAGES_NONE,
+ /// automatically decide between different image sets, depending on what fits best the actual size
+ IMAGES_AUTO,
+ /// default images, 16x16 pixels
+ IMAGES_16_PX,
+ /// default images, 32x32 pixels
+ IMAGES_32_PX,
+ /// default images, 64x64 pixels
+ IMAGES_64_PX,
+ };
+
+public:
+ Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO );
+ Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet = IMAGES_AUTO );
+ ~Throbber();
+
+ // Properties
+ void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
+ sal_Int32 getStepTime() const { return mnStepTime; }
+
+ void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
+ sal_Bool getRepeat() const { return mbRepeat; }
+
+ // animation control
+ void start();
+ void stop();
+ bool isRunning() const;
+
+ void setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList );
+ void setImageList( ::std::vector< Image > const& i_images );
+
+ // default images
+ static ::std::vector< ::rtl::OUString >
+ getDefaultImageURLs( const ImageSet i_imageSet );
+
+protected:
+ // Window overridables
+ virtual void Resize();
+
+private:
+ SAL_DLLPRIVATE void initImages();
+
+private:
+ ::std::vector< Image > maImageList;
+
+ sal_Bool mbRepeat;
+ sal_Int32 mnStepTime;
+ sal_Int32 mnCurStep;
+ sal_Int32 mnStepCount;
+ AutoTimer maWaitTimer;
+ ImageSet meImageSet;
+
+ DECL_LINK( TimeOutHdl, void* );
+};
+
+#endif // VCL_THROBBER_HXX
+
diff --git a/vcl/inc/vcl/timer.hxx b/vcl/inc/vcl/timer.hxx
index ae2ca9a3ba99..efc4b00924a7 100644
--- a/vcl/inc/vcl/timer.hxx
+++ b/vcl/inc/vcl/timer.hxx
@@ -44,9 +44,9 @@ class VCL_DLLPUBLIC Timer
{
protected:
ImplTimerData* mpTimerData;
- ULONG mnTimeout;
- BOOL mbActive;
- BOOL mbAuto;
+ sal_uLong mnTimeout;
+ sal_Bool mbActive;
+ sal_Bool mbAuto;
Link maTimeoutHdl;
public:
@@ -59,9 +59,9 @@ public:
void Start();
void Stop();
- void SetTimeout( ULONG nTimeout );
- ULONG GetTimeout() const { return mnTimeout; }
- BOOL IsActive() const { return mbActive; }
+ void SetTimeout( sal_uLong nTimeout );
+ sal_uLong GetTimeout() const { return mnTimeout; }
+ sal_Bool IsActive() const { return mbActive; }
void SetTimeoutHdl( const Link& rLink ) { maTimeoutHdl = rLink; }
const Link& GetTimeoutHdl() const { return maTimeoutHdl; }
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index bc169c18e160..aec0c11cf790 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -69,7 +69,7 @@ struct ImplToolItem
XubString maQuickHelpText;
XubString maHelpText;
String maCommandStr;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
@@ -79,8 +79,8 @@ struct ImplToolItem
ToolBoxItemType meType;
ToolBoxItemBits mnBits;
TriState meState;
- USHORT mnId;
- BOOL mbEnabled:1,
+ sal_uInt16 mnId;
+ sal_Bool mbEnabled:1,
mbVisible:1,
mbEmptyBtn:1,
mbShowWindow:1,
@@ -88,11 +88,11 @@ struct ImplToolItem
mbVisibleText:1; // indicates if text will definitely be drawn, influences dropdown pos
ImplToolItem();
- ImplToolItem( USHORT nItemId, const Image& rImage,
+ ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nItemBits );
- ImplToolItem( USHORT nItemId, const XubString& rTxt,
+ ImplToolItem( sal_uInt16 nItemId, const XubString& rTxt,
ToolBoxItemBits nItemBits );
- ImplToolItem( USHORT nItemId, const Image& rImage,
+ ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rTxt,
ToolBoxItemBits nItemBits );
~ImplToolItem();
@@ -104,18 +104,18 @@ struct ImplToolItem
// the default size is the precomputed size for standard items
// ie those that are just ordinary buttons (no windows or text etc.)
// bCheckMaxWidth indicates that item windows must not exceed maxWidth in which case they will be painted as buttons
- Size GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, const Size& rDefaultSize );
+ Size GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize );
// only useful for buttons: returns if the text or image part or both can be drawn according to current button drawing style
- void DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const;
+ void DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const;
// returns the rectangle which contains the drop down arrow
// or an empty rect if there is none
// bHorz denotes the toolbox alignment
- Rectangle GetDropDownRect( BOOL bHorz ) const;
+ Rectangle GetDropDownRect( sal_Bool bHorz ) const;
- // returns TRUE if the toolbar item is currently clipped, which can happen for docked toolbars
- BOOL IsClipped() const;
+ // returns sal_True if the toolbar item is currently clipped, which can happen for docked toolbars
+ sal_Bool IsClipped() const;
};
namespace vcl
@@ -123,8 +123,8 @@ namespace vcl
struct ToolBoxLayoutData : public ControlLayoutData
{
- std::vector< USHORT > m_aLineItemIds;
- std::vector< USHORT > m_aLineItemPositions;
+ std::vector< sal_uInt16 > m_aLineItemIds;
+ std::vector< sal_uInt16 > m_aLineItemPositions;
};
@@ -150,8 +150,8 @@ struct ImplToolBoxPrivateData
// the optional custom menu
PopupMenu* mpMenu;
- USHORT maMenuType;
- ULONG mnEventId;
+ sal_uInt16 maMenuType;
+ sal_uIntPtr mnEventId;
// called when menu button is clicked and before the popup menu is executed
Link maMenuButtonHdl;
@@ -166,7 +166,7 @@ struct ImplToolBoxPrivateData
vcl::IImageListProvider* mpImageListProvider;
vcl::ImageListType meImageListType;
- BOOL mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
+ sal_Bool mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
mbAssumeDocked:1, // only used during calculations to override current floating/popup mode
mbAssumeFloating:1,
mbAssumePopupMode:1,
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 66a13e975b1f..ccd7c229346b 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -54,27 +54,27 @@ namespace vcl
// - ToolBoxCustomizeEvent -
// -------------------------
-#define TOOLBOX_CUSTOMIZE_RESIZE ((USHORT)0xFFFE)
+#define TOOLBOX_CUSTOMIZE_RESIZE ((sal_uInt16)0xFFFE)
class VCL_DLLPUBLIC ToolBoxCustomizeEvent
{
private:
ToolBox* mpTargetBox;
void* mpData;
- USHORT mnIdFrom;
- USHORT mnPosTo;
+ sal_uInt16 mnIdFrom;
+ sal_uInt16 mnPosTo;
public:
ToolBoxCustomizeEvent();
ToolBoxCustomizeEvent( ToolBox* pDropBox,
- USHORT nId, USHORT nPos = 0,
+ sal_uInt16 nId, sal_uInt16 nPos = 0,
void* pUserData = NULL );
ToolBox* GetTargetBox() const { return mpTargetBox; }
- USHORT GetTargetPos() const { return mnPosTo; }
- USHORT GetSourceId() const { return mnIdFrom; }
+ sal_uInt16 GetTargetPos() const { return mnPosTo; }
+ sal_uInt16 GetSourceId() const { return mnIdFrom; }
void* GetData() const { return mpData; }
- BOOL IsResized() const;
+ sal_Bool IsResized() const;
};
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
@@ -86,7 +86,7 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent()
}
inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
- USHORT nId, USHORT nPos,
+ sal_uInt16 nId, sal_uInt16 nPos,
void* pUserData )
{
mpTargetBox = pDropBox;
@@ -95,19 +95,19 @@ inline ToolBoxCustomizeEvent::ToolBoxCustomizeEvent( ToolBox* pDropBox,
mpData = pUserData;
}
-inline BOOL ToolBoxCustomizeEvent::IsResized() const
+inline sal_Bool ToolBoxCustomizeEvent::IsResized() const
{
if ( mnPosTo == TOOLBOX_CUSTOMIZE_RESIZE )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -------------------
// - ToolBoxItemBits -
// -------------------
-typedef USHORT ToolBoxItemBits;
+typedef sal_uInt16 ToolBoxItemBits;
// --------------------------
// - Bits fuer ToolBoxItems -
@@ -130,20 +130,20 @@ typedef USHORT ToolBoxItemBits;
// - ToolBox-Types -
// -----------------
-#define TOOLBOX_STYLE_OUTBUTTON ((USHORT)0x0001)
-#define TOOLBOX_STYLE_HANDPOINTER ((USHORT)0x0002)
-#define TOOLBOX_STYLE_FLAT ((USHORT)0x0004)
+#define TOOLBOX_STYLE_OUTBUTTON ((sal_uInt16)0x0001)
+#define TOOLBOX_STYLE_HANDPOINTER ((sal_uInt16)0x0002)
+#define TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004)
-#define TOOLBOX_APPEND ((USHORT)0xFFFF)
-#define TOOLBOX_ITEM_NOTFOUND ((USHORT)0xFFFF)
+#define TOOLBOX_APPEND ((sal_uInt16)0xFFFF)
+#define TOOLBOX_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
// item ids in the custom menu may not exceed this constant
-#define TOOLBOX_MENUITEM_START ((USHORT)0xE000)
+#define TOOLBOX_MENUITEM_START ((sal_uInt16)0xE000)
// defines for the menubutton
-#define TOOLBOX_MENUTYPE_NONE ((USHORT)0x0000) // no menu at all, scrolling by spin buttons
-#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((USHORT)0x0001) // menu will contain "more" indicator
-#define TOOLBOX_MENUTYPE_CUSTOMIZE ((USHORT)0x0002) // menu will contain "customization" and "more" indicator
+#define TOOLBOX_MENUTYPE_NONE ((sal_uInt16)0x0000) // no menu at all, scrolling by spin buttons
+#define TOOLBOX_MENUTYPE_CLIPPEDITEMS ((sal_uInt16)0x0001) // menu will contain "more" indicator
+#define TOOLBOX_MENUTYPE_CUSTOMIZE ((sal_uInt16)0x0002) // menu will contain "customization" and "more" indicator
// By changes you must also change: rsc/vclrsc.hxx
enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
@@ -184,7 +184,7 @@ private:
Rectangle maInDockRect;
Rectangle maPaintRect;
FloatingWindow* mpFloatWin;
- USHORT mnKeyModifier;
+ sal_uInt16 mnKeyModifier;
long mnDX;
long mnDY;
long mnMaxItemWidth; // max item width
@@ -198,22 +198,22 @@ private:
long mnBottomBorder;
long mnLastResizeDY;
long mnActivateCount;
- USHORT mnLastFocusItemId;
- USHORT mnFocusPos;
- USHORT mnOutStyle;
- USHORT mnHighItemId;
- USHORT mnCurItemId;
- USHORT mnDownItemId;
- USHORT mnCurPos;
- USHORT mnLines; // total number of toolbox lines
- USHORT mnCurLine; // the currently visible line
- USHORT mnCurLines; // number of lines due to line breaking
- USHORT mnVisLines; // number of visible lines (for scrolling)
- USHORT mnFloatLines; // number of lines during floating mode
- USHORT mnDockLines;
- USHORT mnConfigItem;
- USHORT mnMouseClicks;
- USHORT mnMouseModifier;
+ sal_uInt16 mnLastFocusItemId;
+ sal_uInt16 mnFocusPos;
+ sal_uInt16 mnOutStyle;
+ sal_uInt16 mnHighItemId;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnDownItemId;
+ sal_uInt16 mnCurPos;
+ sal_uInt16 mnLines; // total number of toolbox lines
+ sal_uInt16 mnCurLine; // the currently visible line
+ sal_uInt16 mnCurLines; // number of lines due to line breaking
+ sal_uInt16 mnVisLines; // number of visible lines (for scrolling)
+ sal_uInt16 mnFloatLines; // number of lines during floating mode
+ sal_uInt16 mnDockLines;
+ sal_uInt16 mnConfigItem;
+ sal_uInt16 mnMouseClicks;
+ sal_uInt16 mnMouseModifier;
unsigned int mbDrag:1,
mbSelection:1,
mbCommandDrag:1,
@@ -252,44 +252,44 @@ private:
private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
using DockingWindow::ImplInitSettings;
- SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ SAL_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE ImplToolItem* ImplGetItem( USHORT nId ) const;
- SAL_DLLPRIVATE BOOL ImplCalcItem();
- SAL_DLLPRIVATE USHORT ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz );
- SAL_DLLPRIVATE void ImplFormat( BOOL bResize = FALSE );
- SAL_DLLPRIVATE void ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn );
- SAL_DLLPRIVATE void ImplDrawNext( BOOL bIn );
- SAL_DLLPRIVATE void ImplDrawSeparator( USHORT nPos, Rectangle rRect );
- SAL_DLLPRIVATE void ImplDrawItem( USHORT nPos, BOOL bHighlight = FALSE, BOOL bPaint = FALSE, BOOL bLayout = FALSE );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
+ SAL_DLLPRIVATE sal_Bool ImplCalcItem();
+ SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz );
+ SAL_DLLPRIVATE void ImplFormat( sal_Bool bResize = sal_False );
+ SAL_DLLPRIVATE void ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn );
+ SAL_DLLPRIVATE void ImplDrawNext( sal_Bool bIn );
+ SAL_DLLPRIVATE void ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect );
+ SAL_DLLPRIVATE void ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight = sal_False, sal_Bool bPaint = sal_False, sal_Bool bLayout = sal_False );
using Window::ImplInvalidate;
- SAL_DLLPRIVATE void ImplInvalidate( BOOL bNewCalc = FALSE, BOOL bFullPaint = FALSE );
- SAL_DLLPRIVATE void ImplUpdateItem( USHORT nIndex = 0xFFFF );
+ SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False );
+ SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF );
SAL_DLLPRIVATE void ImplStartCustomizeMode();
SAL_DLLPRIVATE void ImplEndCustomizeMode();
SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr );
- SAL_DLLPRIVATE BOOL ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat = FALSE );
- SAL_DLLPRIVATE BOOL ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel = FALSE );
- SAL_DLLPRIVATE void ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus = FALSE );
- SAL_DLLPRIVATE BOOL ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle = FALSE );
- SAL_DLLPRIVATE USHORT ImplGetItemLine( ImplToolItem* pCurrentItem );
- SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( USHORT nLine );
- SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( USHORT nLine );
- SAL_DLLPRIVATE BOOL ImplOpenItem( KeyCode aKeyCode );
- SAL_DLLPRIVATE BOOL ImplActivateItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False );
+ SAL_DLLPRIVATE void ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False );
+ SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine );
+ SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( sal_uInt16 nLine );
+ SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode );
+ SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode );
SAL_DLLPRIVATE void ImplShowFocus();
SAL_DLLPRIVATE void ImplHideFocus();
SAL_DLLPRIVATE void ImplUpdateInputEnable();
SAL_DLLPRIVATE void ImplFillLayoutData() const;
SAL_DLLPRIVATE void ImplUpdateCustomMenu();
- SAL_DLLPRIVATE BOOL ImplHasClippedItems();
+ SAL_DLLPRIVATE sal_Bool ImplHasClippedItems();
SAL_DLLPRIVATE Point ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) const;
SAL_DLLPRIVATE void ImplExecuteCustomMenu();
- SAL_DLLPRIVATE BOOL ImplIsFloatingMode() const;
- SAL_DLLPRIVATE BOOL ImplIsInPopupMode() const;
- SAL_DLLPRIVATE const XubString& ImplGetHelpText( USHORT nItemId ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingMode() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsInPopupMode() const;
+ SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
SAL_DLLPRIVATE Size ImplGetOptimalFloatingSize( FloatingSizeMode eMode );
- SAL_DLLPRIVATE BOOL ImplHasExternalMenubutton();
+ SAL_DLLPRIVATE sal_Bool ImplHasExternalMenubutton();
SAL_DLLPRIVATE void ImplDrawFloatwinBorder( ImplToolItem* pItem );
DECL_DLLPRIVATE_LINK( ImplCallExecuteCustomMenu, void* );
@@ -304,7 +304,7 @@ private:
SAL_DLLPRIVATE void ImplUpdateImageList(); // called if StateChanged
public:
- SAL_DLLPRIVATE void ImplFloatControl( BOOL bStart, FloatingWindow* pWindow = NULL );
+ SAL_DLLPRIVATE void ImplFloatControl( sal_Bool bStart, FloatingWindow* pWindow = NULL );
SAL_DLLPRIVATE void ImplDisableFlatButtons();
static SAL_DLLPRIVATE int ImplGetDragWidth( ToolBox* pThis );
@@ -313,35 +313,35 @@ public:
long& rRight, long& rBottom, const ToolBox *pThis );
static SAL_DLLPRIVATE void ImplDrawGrip( ToolBox* pThis );
static SAL_DLLPRIVATE void ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapper *pWrapper );
- static SAL_DLLPRIVATE BOOL ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
+ static SAL_DLLPRIVATE sal_Bool ImplDrawNativeBackground( ToolBox* pThis, const Region &rRegion );
static SAL_DLLPRIVATE void ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegion );
- static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode );
+ static SAL_DLLPRIVATE void ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode );
static SAL_DLLPRIVATE void ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect );
- static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight = FALSE, BOOL bHasOpenPopup = FALSE );
+ static SAL_DLLPRIVATE void ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight = sal_False, sal_Bool bHasOpenPopup = sal_False );
static SAL_DLLPRIVATE void ImplDrawBorder( ToolBox* pWin );
static SAL_DLLPRIVATE const ImplToolItem *ImplGetFirstClippedItem( const ToolBox* pThis );
- static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode = 0 );
+ static SAL_DLLPRIVATE Size ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode = 0 );
static SAL_DLLPRIVATE void ImplCalcFloatSizes( ToolBox* pThis );
- static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines );
+ static SAL_DLLPRIVATE Size ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines );
static SAL_DLLPRIVATE void ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMaxSize );
static SAL_DLLPRIVATE void ImplSetMinMaxFloatSize( ToolBox *pThis );
- static SAL_DLLPRIVATE USHORT ImplCalcLines( ToolBox* pThis, long nToolSize );
- static SAL_DLLPRIVATE USHORT ImplTestLineSize( ToolBox* pThis, const Point& rPos );
- static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, USHORT nLineMode );
- static SAL_DLLPRIVATE USHORT ImplFindItemPos( ToolBox* pBox, const Point& rPos );
- static SAL_DLLPRIVATE USHORT ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList );
- static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform,
- BOOL bLeft = FALSE, BOOL bTop = FALSE,
+ static SAL_DLLPRIVATE sal_uInt16 ImplCalcLines( ToolBox* pThis, long nToolSize );
+ static SAL_DLLPRIVATE sal_uInt16 ImplTestLineSize( ToolBox* pThis, const Point& rPos );
+ static SAL_DLLPRIVATE void ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, sal_uInt16 nLineMode );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( ToolBox* pBox, const Point& rPos );
+ static SAL_DLLPRIVATE sal_uInt16 ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList );
+ static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
+ sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
long nSize = 6 );
static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- BOOL bLeft = FALSE, BOOL bTop = FALSE,
+ sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False,
long nSize = 6 );
- static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight );
- static SAL_DLLPRIVATE USHORT ImplCountLineBreaks( const ToolBox *pThis );
+ static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight );
+ static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis );
SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; }
protected:
- void SetCurItemId(USHORT nSet) { mnCurItemId = nSet; }
+ void SetCurItemId(sal_uInt16 nSet) { mnCurItemId = nSet; }
public:
ToolBox( Window* pParent, WinBits nStyle = 0 );
@@ -375,36 +375,36 @@ public:
virtual void LoseFocus();
virtual void KeyInput( const KeyEvent& rKEvt );
- virtual BOOL PrepareToggleFloatingMode();
+ virtual sal_Bool PrepareToggleFloatingMode();
virtual void ToggleFloatingMode();
virtual void StartDocking();
- virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+ virtual sal_Bool Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
virtual void Resizing( Size& rSize );
void InsertItem( const ResId& rResId,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const Image& rImage,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertItem( USHORT nItemId, const XubString& rText,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertItem( sal_uInt16 nItemId, const XubString& rText,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertWindow( USHORT nItemId, Window* pWindow,
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertWindow( sal_uInt16 nItemId, Window* pWindow,
ToolBoxItemBits nBits = 0,
- USHORT nPos = TOOLBOX_APPEND );
- void InsertSpace( USHORT nPos = TOOLBOX_APPEND );
- void InsertSeparator( USHORT nPos = TOOLBOX_APPEND,
- USHORT nPixSize = 0 );
- void InsertBreak( USHORT nPos = TOOLBOX_APPEND );
- void RemoveItem( USHORT nPos );
- void MoveItem( USHORT nItemId, USHORT nNewPos = TOOLBOX_APPEND );
- void CopyItem( const ToolBox& rToolBox, USHORT nItemId,
- USHORT nNewPos = TOOLBOX_APPEND );
+ sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSpace( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void InsertSeparator( sal_uInt16 nPos = TOOLBOX_APPEND,
+ sal_uInt16 nPixSize = 0 );
+ void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND );
+ void RemoveItem( sal_uInt16 nPos );
+ void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND );
+ void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
+ sal_uInt16 nNewPos = TOOLBOX_APPEND );
void CopyItems( const ToolBox& rToolBox );
void Clear();
void RecalcItems();
@@ -421,106 +421,106 @@ public:
void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP );
WindowAlign GetAlign() const { return meAlign; }
- BOOL IsHorizontal() const { return mbHorz; }
+ sal_Bool IsHorizontal() const { return mbHorz; }
- void SetLineCount( USHORT nNewLines );
- USHORT GetLineCount() const { return mnLines; }
- USHORT GetCurLine() const { return mnCurLine; }
- void ShowLine( BOOL bNext );
+ void SetLineCount( sal_uInt16 nNewLines );
+ sal_uInt16 GetLineCount() const { return mnLines; }
+ sal_uInt16 GetCurLine() const { return mnCurLine; }
+ void ShowLine( sal_Bool bNext );
// Used to enable/disable scrolling one page at a time for toolbar
- void SetPageScroll( BOOL b );
- BOOL GetPageScroll();
+ void SetPageScroll( sal_Bool b );
+ sal_Bool GetPageScroll();
void SetNextToolBox( const XubString& rStr );
const XubString& GetNextToolBox() const { return maNextToolBoxStr; }
- USHORT GetItemCount() const;
- ToolBoxItemType GetItemType( USHORT nPos ) const;
- USHORT GetItemPos( USHORT nItemId ) const;
- USHORT GetItemPos( const Point& rPos ) const;
- USHORT GetItemId( USHORT nPos ) const;
- USHORT GetItemId( const Point& rPos ) const;
- Rectangle GetItemRect( USHORT nItemId ) const;
- Rectangle GetItemPosRect( USHORT nPos ) const;
- Rectangle GetItemDropDownRect( USHORT nItemId ) const;
- Rectangle GetItemPosDropDownRect( USHORT nPos ) const;
+ sal_uInt16 GetItemCount() const;
+ ToolBoxItemType GetItemType( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetItemPos( const Point& rPos ) const;
+ sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
+ sal_uInt16 GetItemId( const Point& rPos ) const;
+ Rectangle GetItemRect( sal_uInt16 nItemId ) const;
+ Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
+ Rectangle GetItemDropDownRect( sal_uInt16 nItemId ) const;
+ Rectangle GetItemPosDropDownRect( sal_uInt16 nPos ) const;
// retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
- Point GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const;
+ Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
Rectangle GetScrollRect() const;
Rectangle GetMenubuttonRect() const;
- USHORT GetCurItemId() const { return mnCurItemId; }
- USHORT GetDownItemId() const { return mnDownItemId; }
- USHORT GetClicks() const { return mnMouseClicks; }
- USHORT GetModifier() const { return mnMouseModifier; }
- USHORT GetKeyModifier() const { return mnKeyModifier; }
-
- void SetItemBits( USHORT nItemId, ToolBoxItemBits nBits );
- ToolBoxItemBits GetItemBits( USHORT nItemId ) const;
-
- void SetItemData( USHORT nItemId, void* pNewData );
- void* GetItemData( USHORT nItemId ) const;
- void SetItemImage( USHORT nItemId, const Image& rImage );
- Image GetItemImage( USHORT nItemId ) const;
- void SetItemImageAngle( USHORT nItemId, long nAngle10 );
- long GetItemImageAngle( USHORT nItemId ) const;
- void SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror );
- BOOL GetItemImageMirrorMode( USHORT ) const;
- void SetItemHighImage( USHORT nItemId, const Image& rImage );
- Image GetItemHighImage( USHORT nItemId ) const;
- void SetItemText( USHORT nItemId, const XubString& rText );
- const XubString& GetItemText( USHORT nItemId ) const;
- void SetItemWindow( USHORT nItemId, Window* pNewWindow );
- Window* GetItemWindow( USHORT nItemId ) const;
- USHORT GetHighlightItemId() const { return mnHighItemId; }
+ sal_uInt16 GetCurItemId() const { return mnCurItemId; }
+ sal_uInt16 GetDownItemId() const { return mnDownItemId; }
+ sal_uInt16 GetClicks() const { return mnMouseClicks; }
+ sal_uInt16 GetModifier() const { return mnMouseModifier; }
+ sal_uInt16 GetKeyModifier() const { return mnKeyModifier; }
+
+ void SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits );
+ ToolBoxItemBits GetItemBits( sal_uInt16 nItemId ) const;
+
+ void SetItemData( sal_uInt16 nItemId, void* pNewData );
+ void* GetItemData( sal_uInt16 nItemId ) const;
+ void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemImage( sal_uInt16 nItemId ) const;
+ void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
+ long GetItemImageAngle( sal_uInt16 nItemId ) const;
+ void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
+ sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
+ void SetItemHighImage( sal_uInt16 nItemId, const Image& rImage );
+ Image GetItemHighImage( sal_uInt16 nItemId ) const;
+ void SetItemText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetItemText( sal_uInt16 nItemId ) const;
+ void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow );
+ Window* GetItemWindow( sal_uInt16 nItemId ) const;
+ sal_uInt16 GetHighlightItemId() const { return mnHighItemId; }
void StartSelection();
void EndSelection();
- void SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease = TRUE );
- BOOL IsItemDown( USHORT nItemId ) const;
+ void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True );
+ sal_Bool IsItemDown( sal_uInt16 nItemId ) const;
- void SetItemState( USHORT nItemId, TriState eState );
- TriState GetItemState( USHORT nItemId ) const;
+ void SetItemState( sal_uInt16 nItemId, TriState eState );
+ TriState GetItemState( sal_uInt16 nItemId ) const;
- void CheckItem( USHORT nItemId, BOOL bCheck = TRUE );
- BOOL IsItemChecked( USHORT nItemId ) const;
+ void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
+ sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
- void EnableItem( USHORT nItemId, BOOL bEnable = TRUE );
- BOOL IsItemEnabled( USHORT nItemId ) const;
+ void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
+ sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
- void TriggerItem( USHORT nItemId, BOOL bShift = FALSE, BOOL bCtrl = FALSE );
- void ShowItem( USHORT nItemId, BOOL bVisible = TRUE );
- void HideItem( USHORT nItemId ) { ShowItem( nItemId, FALSE ); }
- BOOL IsItemVisible( USHORT nItemId ) const;
- BOOL IsItemReallyVisible( USHORT nItemId ) const;
+ void TriggerItem( sal_uInt16 nItemId, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+ void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
+ void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
+ sal_Bool IsItemVisible( sal_uInt16 nItemId ) const;
+ sal_Bool IsItemReallyVisible( sal_uInt16 nItemId ) const;
- void SetItemCommand( USHORT nItemId, const XubString& rCommand );
- const XubString& GetItemCommand( USHORT nItemId ) const;
+ void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
+ const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
using Window::SetQuickHelpText;
- void SetQuickHelpText( USHORT nItemId, const XubString& rText );
+ void SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText );
using Window::GetQuickHelpText;
- const XubString& GetQuickHelpText( USHORT nItemId ) const;
+ const XubString& GetQuickHelpText( sal_uInt16 nItemId ) const;
- void SetHelpText( USHORT nItemId, const XubString& rText );
- const XubString& GetHelpText( USHORT nItemId ) const;
+ void SetHelpText( sal_uInt16 nItemId, const XubString& rText );
+ const XubString& GetHelpText( sal_uInt16 nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
// window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const;
// window size according to current alignment, floating state and a given number of lines
- Size CalcWindowSizePixel( USHORT nCalcLines ) const;
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines ) const;
// window size according to current floating state and a given number of lines and a given alignment
- Size CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const;
+ Size CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const;
// floating window size according to number of lines (uses the number of line breaks)
Size CalcFloatingWindowSizePixel() const;
// floating window size with a given number of lines
- Size CalcFloatingWindowSizePixel( USHORT nCalcLines ) const;
+ Size CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const;
// automatic window size for popoup mode
Size CalcPopupWindowSizePixel() const;
@@ -529,8 +529,8 @@ public:
void SetDockingRects( const Rectangle& rOutRect,
const Rectangle& rInRect );
- void SetFloatingLines( USHORT nFloatLines );
- USHORT GetFloatingLines() const;
+ void SetFloatingLines( sal_uInt16 nFloatLines );
+ sal_uInt16 GetFloatingLines() const;
void SetBorder( long nX, long nY );
long GetBorderX() const { return mnBorderX; }
@@ -540,35 +540,35 @@ public:
WinBits GetStyle() const { return mnWinStyle; }
// enable/disable undocking
- void Lock( BOOL bLock = TRUE );
+ void Lock( sal_Bool bLock = sal_True );
// read configuration to determine locking behaviour
- static BOOL AlwaysLocked();
+ static sal_Bool AlwaysLocked();
- void EnableMenuStrings( BOOL bEnable = TRUE ) { mbMenuStrings = (bEnable != 0); }
- BOOL IsMenuStringsEnabled() const { return mbMenuStrings; }
+ void EnableMenuStrings( sal_Bool bEnable = sal_True ) { mbMenuStrings = (bEnable != 0); }
+ sal_Bool IsMenuStringsEnabled() const { return mbMenuStrings; }
- void SetOutStyle( USHORT nNewStyle );
- USHORT GetOutStyle() const { return mnOutStyle; }
+ void SetOutStyle( sal_uInt16 nNewStyle );
+ sal_uInt16 GetOutStyle() const { return mnOutStyle; }
- void EnableCustomize( BOOL bEnable = TRUE );
- BOOL IsCustomize() { return mbCustomize; }
+ void EnableCustomize( sal_Bool bEnable = sal_True );
+ sal_Bool IsCustomize() { return mbCustomize; }
void StartCustomize( const Rectangle& rRect, void* pData = NULL );
- void SetCustomizeMode( BOOL );
- BOOL IsInCustomizeMode() const { return mbCustomizeMode; }
+ void SetCustomizeMode( sal_Bool );
+ sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; }
static void StartCustomizeMode();
static void EndCustomizeMode();
- static BOOL IsCustomizeMode();
+ static sal_Bool IsCustomizeMode();
void SetHelpText( const XubString& rText )
{ DockingWindow::SetHelpText( rText ); }
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { DockingWindow::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return DockingWindow::GetHelpId(); }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
@@ -595,9 +595,9 @@ public:
// the private toolbox items will only use item ids starting from TOOLBOX_MENUITEM_START
// to allow for customization of the menu the coresponding handler is called
// when the menu button was clicked and before the menu is executed
- void SetMenuType( USHORT aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
- USHORT GetMenuType() const;
- BOOL IsMenuEnabled() const;
+ void SetMenuType( sal_uInt16 aType = TOOLBOX_MENUTYPE_CUSTOMIZE );
+ sal_uInt16 GetMenuType() const;
+ sal_Bool IsMenuEnabled() const;
PopupMenu* GetMenu() const;
void SetMenuButtonHdl( const Link& rLink );
const Link& GetMenuButtonHdl() const;
@@ -608,11 +608,11 @@ public:
// allow Click Handler to detect special key
bool IsShift() const { return mbIsShift; }
// allow Click Handler to distinguish between mouse and key input
- BOOL IsKeyEvent() const { return mbIsKeyEvent; }
+ sal_Bool IsKeyEvent() const { return mbIsKeyEvent; }
// allows framework to set/query the planned popupmode
- BOOL WillUsePopupMode() const;
- void WillUsePopupMode( BOOL b);
+ sal_Bool WillUsePopupMode() const;
+ void WillUsePopupMode( sal_Bool b);
// accessibility helpers
@@ -621,30 +621,30 @@ public:
// returns the bounding box for the character at index nIndex
// where nIndex is relative to the starting index of the item
// with id nItemId (in coordinates of the displaying window)
- Rectangle GetCharacterBounds( USHORT nItemId, long nIndex ) const;
+ Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
// -1 is returned if no character is at that point
// if an index is found the corresponding item id is filled in (else 0)
- long GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const;
+ long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
// returns the number of portions in the result of GetDisplayText()
long GetTextCount() const;
// returns the interval [start,end] of text portion nText
// returns [-1,-1] for an invalid text number
Pair GetTextStartEnd( long nText ) const;
// returns the item id for text portion nText or 0 if nText is invalid
- USHORT GetDisplayItemId( long nText ) const;
+ sal_uInt16 GetDisplayItemId( long nText ) const;
const Size& GetDefaultImageSize() const;
- void ChangeHighlight( USHORT nPos );
+ void ChangeHighlight( sal_uInt16 nPos );
void SetImageListProvider(vcl::IImageListProvider* _pProvider);
};
-inline void ToolBox::CheckItem( USHORT nItemId, BOOL bCheck )
+inline void ToolBox::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
SetItemState( nItemId, (bCheck) ? STATE_CHECK : STATE_NOCHECK );
}
-inline BOOL ToolBox::IsItemChecked( USHORT nItemId ) const
+inline sal_Bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const
{
return (GetItemState( nItemId ) == STATE_CHECK);
}
@@ -666,12 +666,12 @@ inline void ToolBox::SetDockingRects( const Rectangle& rOutRect,
maInDockRect = rInRect;
}
-inline void ToolBox::SetFloatingLines( USHORT nNewLines )
+inline void ToolBox::SetFloatingLines( sal_uInt16 nNewLines )
{
mnFloatLines = nNewLines;
}
-inline USHORT ToolBox::GetFloatingLines() const
+inline sal_uInt16 ToolBox::GetFloatingLines() const
{
return mnFloatLines;
}
diff --git a/vcl/inc/vcl/vclenum.hxx b/vcl/inc/vcl/vclenum.hxx
index 492f2293afaf..80b84b2fb0f2 100644
--- a/vcl/inc/vcl/vclenum.hxx
+++ b/vcl/inc/vcl/vclenum.hxx
@@ -240,7 +240,7 @@ enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
#ifndef ENUM_FONTEMPHASISMARK_DECLARED
#define ENUM_FONTEMPHASISMARK_DECLARED
-typedef USHORT FontEmphasisMark;
+typedef sal_uInt16 FontEmphasisMark;
#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx
index d4801fa9ed0a..c7347f7cd978 100644
--- a/vcl/inc/vcl/vclevent.hxx
+++ b/vcl/inc/vcl/vclevent.hxx
@@ -187,7 +187,7 @@ namespace com { namespace sun { namespace star {
#define VCLEVENT_WINDOW_STARTDOCKING 1217 // pData = DockingData
#define VCLEVENT_WINDOW_DOCKING 1218
#define VCLEVENT_WINDOW_ENDDOCKING 1219 // pData = EndDockingData
-#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = BOOL
+#define VCLEVENT_WINDOW_PREPARETOGGLEFLOATING 1220 // pData = sal_Bool
#define VCLEVENT_WINDOW_TOGGLEFLOATING 1221
#define VCLEVENT_WINDOW_ENDPOPUPMODE 1222 // pData = EndPopupModeData
@@ -198,13 +198,13 @@ namespace com { namespace sun { namespace star {
class VCL_DLLPUBLIC VclSimpleEvent
{
private:
- ULONG nId;
+ sal_uLong nId;
public:
- VclSimpleEvent( ULONG n ) { nId = n; }
+ VclSimpleEvent( sal_uLong n ) { nId = n; }
TYPEINFO();
- ULONG GetId() const { return nId; }
+ sal_uLong GetId() const { return nId; }
};
class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent
@@ -214,7 +214,7 @@ private:
void* pData;
public:
- VclWindowEvent( Window* pWin, ULONG n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
+ VclWindowEvent( Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
TYPEINFO();
Window* GetWindow() const { return pWindow; }
@@ -228,7 +228,7 @@ private:
MouseEvent aEvent;
public:
- VclMouseEvent( Window* pWin, ULONG n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
+ VclMouseEvent( Window* pWin, sal_uLong n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
TYPEINFO();
const MouseEvent& GetEvent() const { return aEvent; }
@@ -239,20 +239,20 @@ class VCL_DLLPUBLIC VclMenuEvent : public VclSimpleEvent
{
private:
Menu* pMenu;
- USHORT mnPos;
+ sal_uInt16 mnPos;
public:
- VclMenuEvent( Menu* pM, ULONG n, USHORT nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
+ VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
TYPEINFO();
Menu* GetMenu() const { return pMenu; }
- USHORT GetItemPos() const { return mnPos; }
+ sal_uInt16 GetItemPos() const { return mnPos; }
};
class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
{
public:
- VclAccessibleEvent( ULONG n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+ VclAccessibleEvent( sal_uLong n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
virtual ~VclAccessibleEvent();
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const;
@@ -266,9 +266,9 @@ public:
void Call( VclSimpleEvent* pEvent ) const;
// stops notifying when any handler has processed the event
- // and returns TRUE in that case
- // a handler must return TRUE to signal that it has processed the event
- BOOL Process( VclSimpleEvent* pEvent ) const;
+ // and returns sal_True in that case
+ // a handler must return sal_True to signal that it has processed the event
+ sal_Bool Process( VclSimpleEvent* pEvent ) const;
void addListener( const Link& rListener );
void removeListener( const Link& rListener );
private:
diff --git a/vcl/inc/vcl/virdev.hxx b/vcl/inc/vcl/virdev.hxx
index f3e52813c486..79b8233cf964 100644
--- a/vcl/inc/vcl/virdev.hxx
+++ b/vcl/inc/vcl/virdev.hxx
@@ -50,13 +50,13 @@ private:
SalVirtualDevice* mpVirDev;
VirtualDevice* mpPrev;
VirtualDevice* mpNext;
- USHORT mnBitCount;
- BOOL mbScreenComp;
+ sal_uInt16 mnBitCount;
+ sal_Bool mbScreenComp;
sal_Int8 mnAlphaDepth;
- BYTE meRefDevMode;
+ sal_uInt8 meRefDevMode;
- SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData = NULL );
- SAL_DLLPRIVATE BOOL ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase );
+ SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase );
// Copy assignment is forbidden and not implemented.
VirtualDevice (const VirtualDevice &);
@@ -73,9 +73,9 @@ private:
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
public:
- VirtualDevice( USHORT nBitCount = 0 );
+ VirtualDevice( sal_uInt16 nBitCount = 0 );
VirtualDevice( const OutputDevice& rCompDev,
- USHORT nBitCount = 0 );
+ sal_uInt16 nBitCount = 0 );
/** Create a virtual device with alpha channel
@param rCompDev
@@ -93,18 +93,18 @@ public:
are allowed here, with 1 denoting binary mask.
*/
VirtualDevice( const OutputDevice& rCompDev,
- USHORT nBitCount, USHORT nAlphaBitCount );
+ sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount );
/** Create a virtual device using an existing system dependent device or graphics context
Any rendering will happen directly on the context and not on any intermediate bitmap.
Note: This might not be suported on all platforms !
*/
- VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount );
+ VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount );
virtual ~VirtualDevice();
- BOOL SetOutputSizePixel( const Size& rNewSize, BOOL bErase = TRUE );
- BOOL SetOutputSize( const Size& rNewSize, BOOL bErase = TRUE )
+ sal_Bool SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase = sal_True );
+ sal_Bool SetOutputSize( const Size& rNewSize, sal_Bool bErase = sal_True )
{ return SetOutputSizePixel( LogicToPixel( rNewSize ), bErase ); }
// reference device modes for different compatibility levels
diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx
index 0011501392be..66a2a11038ed 100644
--- a/vcl/inc/vcl/wall.hxx
+++ b/vcl/inc/vcl/wall.hxx
@@ -90,7 +90,7 @@ class VCL_DLLPUBLIC Wallpaper
private:
ImplWallpaper* mpImplWallpaper;
- SAL_DLLPRIVATE void ImplMakeUnique( BOOL bReleaseCache = TRUE );
+ SAL_DLLPRIVATE void ImplMakeUnique( sal_Bool bReleaseCache = sal_True );
SAL_DLLPRIVATE Gradient ImplGetApplicationGradient() const;
public:
@@ -114,26 +114,26 @@ public:
void SetBitmap( const BitmapEx& rBitmap );
void SetBitmap();
BitmapEx GetBitmap() const;
- BOOL IsBitmap() const;
+ sal_Bool IsBitmap() const;
void SetGradient( const Gradient& rGradient );
void SetGradient();
Gradient GetGradient() const;
- BOOL IsGradient() const;
+ sal_Bool IsGradient() const;
void SetRect( const Rectangle& rRect );
void SetRect();
Rectangle GetRect() const;
- BOOL IsRect() const;
+ sal_Bool IsRect() const;
- BOOL IsFixed() const;
- BOOL IsScrollable() const;
+ sal_Bool IsFixed() const;
+ sal_Bool IsScrollable() const;
Wallpaper& operator=( const Wallpaper& rWallpaper );
- BOOL operator==( const Wallpaper& rWallpaper ) const;
- BOOL operator!=( const Wallpaper& rWallpaper ) const
+ sal_Bool operator==( const Wallpaper& rWallpaper ) const;
+ sal_Bool operator!=( const Wallpaper& rWallpaper ) const
{ return !(Wallpaper::operator==( rWallpaper )); }
- BOOL IsSameInstance( const Wallpaper& rWallpaper ) const
+ sal_Bool IsSameInstance( const Wallpaper& rWallpaper ) const
{ return (mpImplWallpaper == rWallpaper.mpImplWallpaper); }
friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Wallpaper& rWallpaper );
diff --git a/vcl/inc/vcl/wall2.hxx b/vcl/inc/vcl/wall2.hxx
index 311ad3b9cf1c..162614262095 100644
--- a/vcl/inc/vcl/wall2.hxx
+++ b/vcl/inc/vcl/wall2.hxx
@@ -41,7 +41,7 @@ private:
Gradient* mpGradient;
Rectangle* mpRect;
WallpaperStyle meStyle;
- ULONG mnRefCount;
+ sal_uLong mnRefCount;
BitmapEx* mpCache;
friend SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper );
diff --git a/vcl/inc/vcl/windata.hxx b/vcl/inc/vcl/windata.hxx
deleted file mode 100644
index bd8815b83f77..000000000000
--- a/vcl/inc/vcl/windata.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_WINDATA_HXX
-#define _SV_WINDATA_HXX
-
-#include <vcl/sv.h>
-
-class SalFrame;
-class Window;
-
-// --------------
-// - Prototypes -
-// --------------
-
-long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, USHORT nEvent, const void* pEvent );
-
-// -----------
-// - HitTest -
-// -----------
-
-#define WINDOW_HITTEST_INSIDE ((USHORT)0x0001)
-#define WINDOW_HITTEST_TRANSPARENT ((USHORT)0x0002)
-
-#endif // _SV_WINDATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index d52616a1c183..12f6eedc2906 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -39,7 +39,7 @@
#ifndef _SV_POINTR_HXX
#include <vcl/pointr.hxx>
#endif
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/vclevent.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
@@ -57,7 +57,6 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SmartId;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -100,10 +99,24 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ struct ExtWindowImpl;
+}
+
+// --------------
+// - Prototypes -
+// --------------
+long ImplWindowFrameProc( Window* pInst, SalFrame* pFrame, sal_uInt16 nEvent, const void* pEvent );
+// -----------
+// - HitTest -
+// -----------
+
+#define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
+#define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
// ---------------
// - ImplWinData -
@@ -112,17 +125,15 @@ namespace vcl { struct ControlLayoutData; }
struct ImplWinData
{
UniString* mpExtOldText;
- USHORT* mpExtOldAttrAry;
+ sal_uInt16* mpExtOldAttrAry;
Rectangle* mpCursorRect;
long mnCursorExtWidth;
Rectangle* mpFocusRect;
Rectangle* mpTrackRect;
- USHORT mnTrackFlags;
- USHORT mnIsTopWindow;
- BOOL mbMouseOver; // tracks mouse over for native widget paint effect
- BOOL mbEnableNativeWidget; // toggle native widget rendering
- SmartId* mpSmartHelpId;
- SmartId* mpSmartUniqueId;
+ sal_uInt16 mnTrackFlags;
+ sal_uInt16 mnIsTopWindow;
+ sal_Bool mbMouseOver; // tracks mouse over for native widget paint effect
+ sal_Bool mbEnableNativeWidget; // toggle native widget rendering
::std::list< Window* >
maTopWindowChildren;
};
@@ -136,9 +147,9 @@ struct ImplOverlapData
VirtualDevice* mpSaveBackDev; // Gesicherte Hintergrund-Bitmap
Region* mpSaveBackRgn; // Gesicherte Region, was invalidiert werden muss
Window* mpNextBackWin; // Naechstes Fenster mit Hintergrund-Sicherung
- ULONG mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
- BOOL mbSaveBack; // TRUE: Background sichern
- BYTE mnTopLevel; // Level for Overlap-Window
+ sal_uIntPtr mnSaveBackSize; // Groesse Bitmap fuer Hintergrund-Sicherung
+ sal_Bool mbSaveBack; // sal_True: Background sichern
+ sal_uInt8 mnTopLevel; // Level for Overlap-Window
};
// -----------------
@@ -162,9 +173,9 @@ struct ImplFrameData
sal_Int32 mnDPIX; // Original Screen Resolution
sal_Int32 mnDPIY; // Original Screen Resolution
ImplMapRes maMapUnitRes; // for LogicUnitToPixel
- ULONG mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
- ULONG mnFocusId; // FocusId for PostUserLink
- ULONG mnMouseMoveId; // MoveId for PostUserLink
+ sal_uIntPtr mnAllSaveBackSize; // Groesse aller Bitmaps fuer Hintergrund-Sicherung
+ sal_uIntPtr mnFocusId; // FocusId for PostUserLink
+ sal_uIntPtr mnMouseMoveId; // MoveId for PostUserLink
long mnLastMouseX; // last x mouse position
long mnLastMouseY; // last y mouse position
long mnBeforeLastMouseX; // last but one x mouse position
@@ -173,23 +184,23 @@ struct ImplFrameData
long mnFirstMouseY; // first y mouse position by mousebuttondown
long mnLastMouseWinX; // last x mouse position, rel. to pMouseMoveWin
long mnLastMouseWinY; // last y mouse position, rel. to pMouseMoveWin
- USHORT mnModalMode; // frame based modal count (app based makes no sense anymore)
- ULONG mnMouseDownTime; // mouse button down time for double click
- USHORT mnClickCount; // mouse click count
- USHORT mnFirstMouseCode; // mouse code by mousebuttondown
- USHORT mnMouseCode; // mouse code
- USHORT mnMouseMode; // mouse mode
+ sal_uInt16 mnModalMode; // frame based modal count (app based makes no sense anymore)
+ sal_uIntPtr mnMouseDownTime; // mouse button down time for double click
+ sal_uInt16 mnClickCount; // mouse click count
+ sal_uInt16 mnFirstMouseCode; // mouse code by mousebuttondown
+ sal_uInt16 mnMouseCode; // mouse code
+ sal_uInt16 mnMouseMode; // mouse mode
MapUnit meMapUnit; // last MapUnit for LogicUnitToPixel
- BOOL mbHasFocus; // focus
- BOOL mbInMouseMove; // is MouseMove on stack
- BOOL mbMouseIn; // is Mouse inside the frame
- BOOL mbStartDragCalled; // is command startdrag called
- BOOL mbNeedSysWindow; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
- BOOL mbMinimized; // set, when FrameSize <= 0
- BOOL mbStartFocusState; // FocusState, beim abschicken des Events
- BOOL mbInSysObjFocusHdl; // Innerhalb vom GetFocus-Handler eines SysChilds
- BOOL mbInSysObjToTopHdl; // Innerhalb vom ToTop-Handler eines SysChilds
- BOOL mbSysObjFocus; // Hat ein SysChild den Focus
+ sal_Bool mbHasFocus; // focus
+ sal_Bool mbInMouseMove; // is MouseMove on stack
+ sal_Bool mbMouseIn; // is Mouse inside the frame
+ sal_Bool mbStartDragCalled; // is command startdrag called
+ sal_Bool mbNeedSysWindow; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
+ sal_Bool mbMinimized; // set, when FrameSize <= 0
+ sal_Bool mbStartFocusState; // FocusState, beim abschicken des Events
+ sal_Bool mbInSysObjFocusHdl; // Innerhalb vom GetFocus-Handler eines SysChilds
+ sal_Bool mbInSysObjToTopHdl; // Innerhalb vom ToTop-Handler eines SysChilds
+ sal_Bool mbSysObjFocus; // Hat ein SysChild den Focus
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > mxDragSource;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > mxDropTarget;
@@ -197,9 +208,27 @@ struct ImplFrameData
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
- BOOL mbInternalDragGestureRecognizer;
+ sal_Bool mbInternalDragGestureRecognizer;
+};
+
+// -----------------------
+// - ImplAccessibleInfos -
+// -----------------------
+
+struct ImplAccessibleInfos
+{
+ sal_uInt16 nAccessibleRole;
+ String* pAccessibleName;
+ String* pAccessibleDescription;
+ Window* pLabeledByWindow;
+ Window* pLabelForWindow;
+ Window* pMemberOfWindow;
+
+ ImplAccessibleInfos();
+ ~ImplAccessibleInfos();
};
+
// ---------------
// - WindowImpl -
// ---------------
@@ -240,6 +269,7 @@ public:
ImplDelData* mpFirstDel;
void* mpUserData;
+ vcl::ExtWindowImpl* mpExtImpl;
Cursor* mpCursor;
Pointer maPointer;
Fraction maZoom;
@@ -255,8 +285,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- ULONG mnHelpId;
- ULONG mnUniqId;
+ rtl::OString maHelpId;
+ rtl::OString maUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
@@ -275,15 +305,15 @@ public:
WinBits mnPrevExtendedStyle;
WindowType mnType;
ControlPart mnNativeBackground;
- USHORT mnWaitCount;
- USHORT mnPaintFlags;
- USHORT mnGetFocusFlags;
- USHORT mnParentClipMode;
- USHORT mnActivateMode;
- USHORT mnDlgCtrlFlags;
- USHORT mnLockCount;
+ sal_uInt16 mnWaitCount;
+ sal_uInt16 mnPaintFlags;
+ sal_uInt16 mnGetFocusFlags;
+ sal_uInt16 mnParentClipMode;
+ sal_uInt16 mnActivateMode;
+ sal_uInt16 mnDlgCtrlFlags;
+ sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
- BOOL mbFrame:1,
+ sal_Bool mbFrame:1,
mbBorderWin:1,
mbOverlapWin:1,
mbSysWin:1,
@@ -356,7 +386,8 @@ public:
mbDisableAccessibleLabelForRelation:1,
mbDisableAccessibleLabeledByRelation:1,
mbHelpTextDynamic:1,
- mbFakeFocusSet:1;
+ mbFakeFocusSet:1,
+ mbInterceptChildWindowKeyDown:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
@@ -365,9 +396,9 @@ public:
// - Hilfsmethoden -
// -----------------
-long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
- long nX, long nY, ULONG nMsgTime,
- USHORT nCode, USHORT nMode );
+long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+ long nX, long nY, sal_uIntPtr nMsgTime,
+ sal_uInt16 nCode, sal_uInt16 nMode );
void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight );
#endif // _SV_WINDOW_H
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 172e099a236d..df82b7870854 100644..100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -34,7 +34,7 @@
#include <vcl/outdev.hxx>
#include <tools/resid.hxx>
#include <vcl/pointr.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/apptypes.hxx>
#include <vcl/inputctx.hxx>
#include <vcl/vclevent.hxx>
@@ -45,7 +45,7 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vcl/smartid.hxx>
+#include <boost/shared_ptr.hpp>
class VirtualDevice;
struct ImplDelData;
@@ -90,6 +90,13 @@ namespace accessibility {
namespace com {
namespace sun {
namespace star {
+namespace beans {
+ struct PropertyValue;
+}}}}
+
+namespace com {
+namespace sun {
+namespace star {
namespace rendering {
class XCanvas;
class XSpriteCanvas;
@@ -117,7 +124,11 @@ namespace dnd {
class XDropTarget;
} } } } }
-namespace vcl { struct ControlLayoutData; }
+namespace vcl {
+ struct ControlLayoutData;
+ class WindowArranger;
+ struct ExtWindowImpl;
+}
namespace svt { class PopupWindowControllerImpl; }
@@ -126,113 +137,113 @@ namespace svt { class PopupWindowControllerImpl; }
// ---------------
// Type fuer GetWindow()
-#define WINDOW_PARENT ((USHORT)0)
-#define WINDOW_FIRSTCHILD ((USHORT)1)
-#define WINDOW_LASTCHILD ((USHORT)2)
-#define WINDOW_PREV ((USHORT)3)
-#define WINDOW_NEXT ((USHORT)4)
-#define WINDOW_FIRSTOVERLAP ((USHORT)5)
-#define WINDOW_LASTOVERLAP ((USHORT)6)
-#define WINDOW_OVERLAP ((USHORT)7)
-#define WINDOW_PARENTOVERLAP ((USHORT)8)
-#define WINDOW_CLIENT ((USHORT)9)
-#define WINDOW_REALPARENT ((USHORT)10)
-#define WINDOW_FRAME ((USHORT)11)
-#define WINDOW_BORDER ((USHORT)12)
-#define WINDOW_FIRSTTOPWINDOWCHILD ((USHORT)13)
-#define WINDOW_LASTTOPWINDOWCHILD ((USHORT)14)
-#define WINDOW_PREVTOPWINDOWSIBLING ((USHORT)15)
-#define WINDOW_NEXTTOPWINDOWSIBLING ((USHORT)16)
+#define WINDOW_PARENT ((sal_uInt16)0)
+#define WINDOW_FIRSTCHILD ((sal_uInt16)1)
+#define WINDOW_LASTCHILD ((sal_uInt16)2)
+#define WINDOW_PREV ((sal_uInt16)3)
+#define WINDOW_NEXT ((sal_uInt16)4)
+#define WINDOW_FIRSTOVERLAP ((sal_uInt16)5)
+#define WINDOW_LASTOVERLAP ((sal_uInt16)6)
+#define WINDOW_OVERLAP ((sal_uInt16)7)
+#define WINDOW_PARENTOVERLAP ((sal_uInt16)8)
+#define WINDOW_CLIENT ((sal_uInt16)9)
+#define WINDOW_REALPARENT ((sal_uInt16)10)
+#define WINDOW_FRAME ((sal_uInt16)11)
+#define WINDOW_BORDER ((sal_uInt16)12)
+#define WINDOW_FIRSTTOPWINDOWCHILD ((sal_uInt16)13)
+#define WINDOW_LASTTOPWINDOWCHILD ((sal_uInt16)14)
+#define WINDOW_PREVTOPWINDOWSIBLING ((sal_uInt16)15)
+#define WINDOW_NEXTTOPWINDOWSIBLING ((sal_uInt16)16)
// Flags for SetPosSizePixel()
-#define WINDOW_POSSIZE_X ((USHORT)0x0001)
-#define WINDOW_POSSIZE_Y ((USHORT)0x0002)
-#define WINDOW_POSSIZE_WIDTH ((USHORT)0x0004)
-#define WINDOW_POSSIZE_HEIGHT ((USHORT)0x0008)
+#define WINDOW_POSSIZE_X ((sal_uInt16)0x0001)
+#define WINDOW_POSSIZE_Y ((sal_uInt16)0x0002)
+#define WINDOW_POSSIZE_WIDTH ((sal_uInt16)0x0004)
+#define WINDOW_POSSIZE_HEIGHT ((sal_uInt16)0x0008)
#define WINDOW_POSSIZE_POS (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
#define WINDOW_POSSIZE_SIZE (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
#define WINDOW_POSSIZE_POSSIZE (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
#define WINDOW_POSSIZE_ALL (WINDOW_POSSIZE_POSSIZE)
-#define WINDOW_POSSIZE_DROPDOWN ((USHORT)0x0010)
+#define WINDOW_POSSIZE_DROPDOWN ((sal_uInt16)0x0010)
// Flags for Show()
-#define SHOW_NOPARENTUPDATE ((USHORT)0x0001)
-#define SHOW_NOFOCUSCHANGE ((USHORT)0x0002)
-#define SHOW_NOACTIVATE ((USHORT)0x0004)
-#define SHOW_FOREGROUNDTASK ((USHORT)0x0008)
+#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001)
+#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002)
+#define SHOW_NOACTIVATE ((sal_uInt16)0x0004)
+#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008)
// Flags for SetZOrder()
-#define WINDOW_ZORDER_BEFOR ((USHORT)0x0001)
-#define WINDOW_ZORDER_BEHIND ((USHORT)0x0002)
-#define WINDOW_ZORDER_FIRST ((USHORT)0x0004)
-#define WINDOW_ZORDER_LAST ((USHORT)0x0008)
+#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
+#define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002)
+#define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004)
+#define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008)
// Activate-Flags
-#define ACTIVATE_MODE_GRABFOCUS ((USHORT)0x0001)
+#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
// ToTop-Flags
-#define TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
-#define TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
-#define TOTOP_NOGRABFOCUS ((USHORT)0x0004)
-#define TOTOP_GRABFOCUSONLY ((USHORT)0x0008)
+#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
+#define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
+#define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004)
+#define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008)
// Flags for Invalidate
-#define INVALIDATE_CHILDREN ((USHORT)0x0001)
-#define INVALIDATE_NOCHILDREN ((USHORT)0x0002)
-#define INVALIDATE_NOERASE ((USHORT)0x0004)
-#define INVALIDATE_UPDATE ((USHORT)0x0008)
-#define INVALIDATE_TRANSPARENT ((USHORT)0x0010)
-#define INVALIDATE_NOTRANSPARENT ((USHORT)0x0020)
-#define INVALIDATE_NOCLIPCHILDREN ((USHORT)0x4000)
+#define INVALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define INVALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+#define INVALIDATE_NOERASE ((sal_uInt16)0x0004)
+#define INVALIDATE_UPDATE ((sal_uInt16)0x0008)
+#define INVALIDATE_TRANSPARENT ((sal_uInt16)0x0010)
+#define INVALIDATE_NOTRANSPARENT ((sal_uInt16)0x0020)
+#define INVALIDATE_NOCLIPCHILDREN ((sal_uInt16)0x4000)
// Temporaer fuer Kompatibilitaet
#define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT
// Flags for Validate
-#define VALIDATE_CHILDREN ((USHORT)0x0001)
-#define VALIDATE_NOCHILDREN ((USHORT)0x0002)
+#define VALIDATE_CHILDREN ((sal_uInt16)0x0001)
+#define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
// Flags for Scroll
-#define SCROLL_CLIP ((USHORT)0x0001)
-#define SCROLL_CHILDREN ((USHORT)0x0002)
-#define SCROLL_NOCHILDREN ((USHORT)0x0004)
-#define SCROLL_NOERASE ((USHORT)0x0008)
-#define SCROLL_NOINVALIDATE ((USHORT)0x0010)
-#define SCROLL_NOWINDOWINVALIDATE ((USHORT)0x0020)
-#define SCROLL_USECLIPREGION ((USHORT)0x0040)
-#define SCROLL_UPDATE ((USHORT)0x0080)
+#define SCROLL_CLIP ((sal_uInt16)0x0001)
+#define SCROLL_CHILDREN ((sal_uInt16)0x0002)
+#define SCROLL_NOCHILDREN ((sal_uInt16)0x0004)
+#define SCROLL_NOERASE ((sal_uInt16)0x0008)
+#define SCROLL_NOINVALIDATE ((sal_uInt16)0x0010)
+#define SCROLL_NOWINDOWINVALIDATE ((sal_uInt16)0x0020)
+#define SCROLL_USECLIPREGION ((sal_uInt16)0x0040)
+#define SCROLL_UPDATE ((sal_uInt16)0x0080)
// Flags for ParentClipMode
-#define PARENTCLIPMODE_CLIP ((USHORT)0x0001)
-#define PARENTCLIPMODE_NOCLIP ((USHORT)0x0002)
+#define PARENTCLIPMODE_CLIP ((sal_uInt16)0x0001)
+#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
// Flags for Invert()
-#define INVERT_HIGHLIGHT ((USHORT)0x0001)
-#define INVERT_50 ((USHORT)0x0002)
+#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001)
+#define INVERT_50 ((sal_uInt16)0x0002)
// Flags for ShowTracking()
-#define SHOWTRACK_SMALL ((USHORT)0x0001)
-#define SHOWTRACK_BIG ((USHORT)0x0002)
-#define SHOWTRACK_SPLIT ((USHORT)0x0003)
-#define SHOWTRACK_OBJECT ((USHORT)0x0004)
-#define SHOWTRACK_WINDOW ((USHORT)0x1000)
-#define SHOWTRACK_CLIP ((USHORT)0x2000)
-#define SHOWTRACK_STYLE ((USHORT)0x000F)
+#define SHOWTRACK_SMALL ((sal_uInt16)0x0001)
+#define SHOWTRACK_BIG ((sal_uInt16)0x0002)
+#define SHOWTRACK_SPLIT ((sal_uInt16)0x0003)
+#define SHOWTRACK_OBJECT ((sal_uInt16)0x0004)
+#define SHOWTRACK_WINDOW ((sal_uInt16)0x1000)
+#define SHOWTRACK_CLIP ((sal_uInt16)0x2000)
+#define SHOWTRACK_STYLE ((sal_uInt16)0x000F)
// Flags for StartTracking()
-#define STARTTRACK_KEYINPUT ((USHORT)0x0001)
-#define STARTTRACK_KEYMOD ((USHORT)0x0002)
-#define STARTTRACK_NOKEYCANCEL ((USHORT)0x0004)
-#define STARTTRACK_SCROLLREPEAT ((USHORT)0x0008)
-#define STARTTRACK_BUTTONREPEAT ((USHORT)0x0010)
-#define STARTTRACK_MOUSEBUTTONDOWN ((USHORT)0x0020)
-#define STARTTRACK_FOCUSCANCEL ((USHORT)0x0040)
+#define STARTTRACK_KEYINPUT ((sal_uInt16)0x0001)
+#define STARTTRACK_KEYMOD ((sal_uInt16)0x0002)
+#define STARTTRACK_NOKEYCANCEL ((sal_uInt16)0x0004)
+#define STARTTRACK_SCROLLREPEAT ((sal_uInt16)0x0008)
+#define STARTTRACK_BUTTONREPEAT ((sal_uInt16)0x0010)
+#define STARTTRACK_MOUSEBUTTONDOWN ((sal_uInt16)0x0020)
+#define STARTTRACK_FOCUSCANCEL ((sal_uInt16)0x0040)
// Flags for StartAutoScroll()
-#define AUTOSCROLL_VERT ((USHORT)0x0001)
-#define AUTOSCROLL_HORZ ((USHORT)0x0002)
+#define AUTOSCROLL_VERT ((sal_uInt16)0x0001)
+#define AUTOSCROLL_HORZ ((sal_uInt16)0x0002)
// Flags for StateChanged()
-typedef USHORT StateChangedType;
+typedef sal_uInt16 StateChangedType;
#define STATE_CHANGE_INITSHOW ((StateChangedType)1)
#define STATE_CHANGE_VISIBLE ((StateChangedType)2)
#define STATE_CHANGE_UPDATEMODE ((StateChangedType)3)
@@ -255,49 +266,49 @@ typedef USHORT StateChangedType;
#define STATE_CHANGE_USER ((StateChangedType)10000)
// GetFocusFlags
-#define GETFOCUS_TAB ((USHORT)0x0001)
-#define GETFOCUS_CURSOR ((USHORT)0x0002)
-#define GETFOCUS_MNEMONIC ((USHORT)0x0004)
-#define GETFOCUS_FORWARD ((USHORT)0x0010)
-#define GETFOCUS_BACKWARD ((USHORT)0x0020)
-#define GETFOCUS_AROUND ((USHORT)0x0040)
-#define GETFOCUS_UNIQUEMNEMONIC ((USHORT)0x0100)
-#define GETFOCUS_INIT ((USHORT)0x0200)
-#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0400)
+#define GETFOCUS_TAB ((sal_uInt16)0x0001)
+#define GETFOCUS_CURSOR ((sal_uInt16)0x0002)
+#define GETFOCUS_MNEMONIC ((sal_uInt16)0x0004)
+#define GETFOCUS_FORWARD ((sal_uInt16)0x0010)
+#define GETFOCUS_BACKWARD ((sal_uInt16)0x0020)
+#define GETFOCUS_AROUND ((sal_uInt16)0x0040)
+#define GETFOCUS_UNIQUEMNEMONIC ((sal_uInt16)0x0100)
+#define GETFOCUS_INIT ((sal_uInt16)0x0200)
+#define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
// Draw-Flags fuer Draw()
-#define WINDOW_DRAW_MONO ((ULONG)0x00000001)
-#define WINDOW_DRAW_NOBORDER ((ULONG)0x00000002)
-#define WINDOW_DRAW_NOCONTROLS ((ULONG)0x00000004)
-#define WINDOW_DRAW_NODISABLE ((ULONG)0x00000008)
-#define WINDOW_DRAW_NOMNEMONIC ((ULONG)0x00000010)
-#define WINDOW_DRAW_NOSELECTION ((ULONG)0x00000020)
-#define WINDOW_DRAW_NOFOCUS ((ULONG)0x00000040)
-#define WINDOW_DRAW_NOBACKGROUND ((ULONG)0x00000080)
-#define WINDOW_DRAW_ROLLOVER ((ULONG)0x00000100)
+#define WINDOW_DRAW_MONO ((sal_uLong)0x00000001)
+#define WINDOW_DRAW_NOBORDER ((sal_uLong)0x00000002)
+#define WINDOW_DRAW_NOCONTROLS ((sal_uLong)0x00000004)
+#define WINDOW_DRAW_NODISABLE ((sal_uLong)0x00000008)
+#define WINDOW_DRAW_NOMNEMONIC ((sal_uLong)0x00000010)
+#define WINDOW_DRAW_NOSELECTION ((sal_uLong)0x00000020)
+#define WINDOW_DRAW_NOFOCUS ((sal_uLong)0x00000040)
+#define WINDOW_DRAW_NOBACKGROUND ((sal_uLong)0x00000080)
+#define WINDOW_DRAW_ROLLOVER ((sal_uLong)0x00000100)
// Border-Styles fuer SetBorder()
-#define WINDOW_BORDER_NORMAL ((USHORT)0x0001)
-#define WINDOW_BORDER_MONO ((USHORT)0x0002)
-#define WINDOW_BORDER_ACTIVE ((USHORT)0x0004)
-#define WINDOW_BORDER_DOUBLEOUT ((USHORT)0x0008)
-#define WINDOW_BORDER_MENU ((USHORT)0x0010)
-#define WINDOW_BORDER_NOBORDER ((USHORT)0x1000)
-#define WINDOW_BORDER_REMOVEBORDER ((USHORT)0x2000)
+#define WINDOW_BORDER_NORMAL ((sal_uInt16)0x0001)
+#define WINDOW_BORDER_MONO ((sal_uInt16)0x0002)
+#define WINDOW_BORDER_ACTIVE ((sal_uInt16)0x0004)
+#define WINDOW_BORDER_DOUBLEOUT ((sal_uInt16)0x0008)
+#define WINDOW_BORDER_MENU ((sal_uInt16)0x0010)
+#define WINDOW_BORDER_NOBORDER ((sal_uInt16)0x1000)
+#define WINDOW_BORDER_REMOVEBORDER ((sal_uInt16)0x2000)
// DialogControl-Flags
-#define WINDOW_DLGCTRL_RETURN ((USHORT)0x0001)
-#define WINDOW_DLGCTRL_WANTFOCUS ((USHORT)0x0002)
-#define WINDOW_DLGCTRL_MOD1TAB ((USHORT)0x0004)
-#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0008)
+#define WINDOW_DLGCTRL_RETURN ((sal_uInt16)0x0001)
+#define WINDOW_DLGCTRL_WANTFOCUS ((sal_uInt16)0x0002)
+#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
+#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
// GetWindowClipRegionPixel-Flags
-#define WINDOW_GETCLIPREGION_NULL ((USHORT)0x0001)
-#define WINDOW_GETCLIPREGION_NOCHILDREN ((USHORT)0x0002)
+#define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001)
+#define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
// EndExtTextInput-Flags
-#define EXTTEXTINPUT_END_COMPLETE ((USHORT)0x0001)
-#define EXTTEXTINPUT_END_CANCEL ((USHORT)0x0002)
+#define EXTTEXTINPUT_END_COMPLETE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_END_CANCEL ((sal_uInt16)0x0002)
#define IMPL_MINSIZE_BUTTON_WIDTH 70
#define IMPL_MINSIZE_BUTTON_HEIGHT 22
@@ -382,7 +393,7 @@ public:
SAL_DLLPRIVATE void ImplWindowRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent );
SAL_DLLPRIVATE void ImplInsertWindow( Window* pParent );
- SAL_DLLPRIVATE void ImplRemoveWindow( BOOL bRemoveFrameData );
+ SAL_DLLPRIVATE void ImplRemoveWindow( sal_Bool bRemoveFrameData );
SAL_DLLPRIVATE Window* ImplGetWindow();
SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
SAL_DLLPRIVATE SalFrame* ImplGetFrame() const;
@@ -390,26 +401,26 @@ public:
SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
SAL_DLLPRIVATE void ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
SAL_DLLPRIVATE Window* ImplFindWindow( const Point& rFramePos );
- SAL_DLLPRIVATE USHORT ImplHitTest( const Point& rFramePos );
+ SAL_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rFramePos );
SAL_DLLPRIVATE Window* ImplGetParent() const;
SAL_DLLPRIVATE Window* ImplGetClientWindow() const;
SAL_DLLPRIVATE Window* ImplGetBorderWindow() const;
SAL_DLLPRIVATE Window* ImplGetFirstOverlapWindow();
SAL_DLLPRIVATE const Window* ImplGetFirstOverlapWindow() const;
SAL_DLLPRIVATE Window* ImplGetFrameWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsRealParentPath( const Window* pWindow ) const;
- SAL_DLLPRIVATE BOOL ImplIsChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
- SAL_DLLPRIVATE BOOL ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsRealParentPath( const Window* pWindow ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
SAL_DLLPRIVATE Window* ImplGetSameParent( const Window* pWindow ) const;
- SAL_DLLPRIVATE BOOL ImplIsDockingWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsFloatingWindow() const;
- SAL_DLLPRIVATE BOOL ImplIsToolbox() const;
- SAL_DLLPRIVATE BOOL ImplIsSplitter() const;
- SAL_DLLPRIVATE BOOL ImplIsPushButton() const;
- SAL_DLLPRIVATE BOOL ImplIsOverlapWindow() const;
- SAL_DLLPRIVATE void ImplSetActive( BOOL bActive );
- SAL_DLLPRIVATE BOOL ImplIsMouseTransparent() const;
- SAL_DLLPRIVATE void ImplSetMouseTransparent( BOOL bTransparent );
+ SAL_DLLPRIVATE sal_Bool ImplIsDockingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsFloatingWindow() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsToolbox() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsSplitter() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsPushButton() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsOverlapWindow() const;
+ SAL_DLLPRIVATE void ImplSetActive( sal_Bool bActive );
+ SAL_DLLPRIVATE sal_Bool ImplIsMouseTransparent() const;
+ SAL_DLLPRIVATE void ImplSetMouseTransparent( sal_Bool bTransparent );
SAL_DLLPRIVATE int ImplTestMousePointerSet();
SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
SAL_DLLPRIVATE void ImplResetReallyVisible();
@@ -424,20 +435,20 @@ public:
SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
SAL_DLLPRIVATE void ImplOutputToFrame( Rectangle& rRect );
SAL_DLLPRIVATE void ImplFrameToOutput( Rectangle& rRect );
- SAL_DLLPRIVATE BOOL ImplSysObjClip( const Region* pOldRegion );
+ SAL_DLLPRIVATE sal_Bool ImplSysObjClip( const Region* pOldRegion );
SAL_DLLPRIVATE void ImplUpdateSysObjChildsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
SAL_DLLPRIVATE void ImplUpdateSysObjClip();
- SAL_DLLPRIVATE BOOL ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller = FALSE );
- SAL_DLLPRIVATE BOOL ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller = FALSE );
- SAL_DLLPRIVATE BOOL ImplSetClipFlag( BOOL bSysObjOnlySmaller = FALSE );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller = sal_False );
+ SAL_DLLPRIVATE sal_Bool ImplSetClipFlag( sal_Bool bSysObjOnlySmaller = sal_False );
SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeWindowRegion( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeOverlapWindows( Region& rRegion );
SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( Region& rRegion );
- SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps );
- SAL_DLLPRIVATE BOOL ImplClipChilds( Region& rRegion );
+ SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps );
+ SAL_DLLPRIVATE sal_Bool ImplClipChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipAllChilds( Region& rRegion );
SAL_DLLPRIVATE void ImplClipSiblings( Region& rRegion );
SAL_DLLPRIVATE void ImplInitWinClipRegion();
@@ -447,26 +458,30 @@ public:
SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion );
SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion );
SAL_DLLPRIVATE void ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
- BOOL bChilds, BOOL bParent, BOOL bSiblings );
- SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, USHORT nPaintFlags );
+ sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings );
+ SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags );
SAL_DLLPRIVATE void ImplCallOverlapPaint();
SAL_DLLPRIVATE void ImplPostPaint();
- SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags );
+ SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const Region& rRegion );
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( Region& rRegion );
- SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, USHORT nFlags );
- SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
- SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, BOOL bChilds );
- SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, USHORT nFlags );
- SAL_DLLPRIVATE void ImplUpdateAll( BOOL bOverlapWindows = TRUE );
+ SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
+ SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
+ SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplUpdateAll( sal_Bool bOverlapWindows = sal_True );
SAL_DLLPRIVATE void ImplUpdateWindowPtr( Window* pWindow );
SAL_DLLPRIVATE void ImplUpdateWindowPtr();
- SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( BOOL bNewFrame );
- SAL_DLLPRIVATE BOOL ImplUpdatePos();
+ SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame );
+ SAL_DLLPRIVATE sal_Bool ImplUpdatePos();
SAL_DLLPRIVATE void ImplUpdateSysObjPos();
SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; }
+ SAL_DLLPRIVATE void ImplFreeExtWindowImpl();
+ // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor)
+ SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const;
+ SAL_DLLPRIVATE void ImplDeleteOwnedChildren();
/** check whether a font is suitable for UI
The font to be tested will be checked whether it could display a
@@ -481,34 +496,34 @@ public:
<FALSE/> if the font is unsuitable as UI font
*/
SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont );
- SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl = TRUE );
+ SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True );
SAL_DLLPRIVATE void ImplAlignChilds();
- SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplToBottomChild();
SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
SAL_DLLPRIVATE void ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData );
- SAL_DLLPRIVATE void ImplToTop( USHORT nFlags );
- SAL_DLLPRIVATE void ImplStartToTop( USHORT nFlags );
- SAL_DLLPRIVATE void ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible );
+ SAL_DLLPRIVATE void ImplToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplStartToTop( sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible );
SAL_DLLPRIVATE void ImplShowAllOverlaps();
SAL_DLLPRIVATE void ImplHideAllOverlaps();
SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
- SAL_DLLPRIVATE void ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged = FALSE );
+ SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False );
SAL_DLLPRIVATE void ImplGenerateMouseMove();
- SAL_DLLPRIVATE void ImplGrabFocus( USHORT nFlags );
+ SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags );
SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect );
- SAL_DLLPRIVATE void ImplControlFocus( USHORT nFlags = 0 );
- SAL_DLLPRIVATE Window* ImplGetDlgWindow( USHORT n, USHORT nType, USHORT nStart = 0, USHORT nEnd = 0xFFFF, USHORT* pIndex = NULL );
- SAL_DLLPRIVATE BOOL ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput );
- SAL_DLLPRIVATE BOOL ImplHasDlgCtrl();
+ SAL_DLLPRIVATE void ImplControlFocus( sal_uInt16 nFlags = 0 );
+ SAL_DLLPRIVATE Window* ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL );
+ SAL_DLLPRIVATE sal_Bool ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput );
+ SAL_DLLPRIVATE sal_Bool ImplHasDlgCtrl();
SAL_DLLPRIVATE void ImplDlgCtrlNextWindow();
- SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus );
+ SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus );
SAL_DLLPRIVATE Window* ImplFindDlgCtrlWindow( Window* pWindow );
SAL_DLLPRIVATE long ImplLogicUnitToPixelX( long nX, MapUnit eUnit );
SAL_DLLPRIVATE long ImplLogicUnitToPixelY( long nY, MapUnit eUnit );
- SAL_DLLPRIVATE BOOL ImplIsWindowInFront( const Window* pTestWindow ) const;
+ SAL_DLLPRIVATE sal_Bool ImplIsWindowInFront( const Window* pTestWindow ) const;
SAL_DLLPRIVATE void ImplSaveOverlapBackground();
- SAL_DLLPRIVATE BOOL ImplRestoreOverlapBackground( Region& rInvRegion );
+ SAL_DLLPRIVATE sal_Bool ImplRestoreOverlapBackground( Region& rInvRegion );
SAL_DLLPRIVATE void ImplDeleteOverlapBackground();
SAL_DLLPRIVATE void ImplInvalidateAllOverlapBackgrounds();
SAL_DLLPRIVATE static void ImplNewInputContext();
@@ -524,14 +539,15 @@ public:
SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
SAL_DLLPRIVATE void ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
- SAL_DLLPRIVATE BOOL ImplGetCurrentBackgroundColor( Color& rCol );
- SAL_DLLPRIVATE BOOL ImplIsAccessibleCandidate() const;
- SAL_DLLPRIVATE BOOL ImplIsAccessibleNativeFrame() const;
- SAL_DLLPRIVATE USHORT ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const;
- SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel = TRUE ) const;
- SAL_DLLPRIVATE BOOL ImplRegisterAccessibleNativeFrame();
+ SAL_DLLPRIVATE sal_Bool ImplGetCurrentBackgroundColor( Color& rCol );
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleCandidate() const;
+ SAL_DLLPRIVATE sal_Bool ImplIsAccessibleNativeFrame() const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const;
+ SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel = sal_True ) const;
+ SAL_DLLPRIVATE sal_Bool ImplRegisterAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame();
SAL_DLLPRIVATE void ImplCallResize();
+ SAL_DLLPRIVATE void ImplExtResize();
SAL_DLLPRIVATE void ImplCallMove();
SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
@@ -543,16 +559,16 @@ public:
SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList();
SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow();
- SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const;
- SAL_DLLPRIVATE void ImplNotifyIconifiedState( BOOL bIconified );
+ SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const;
+ SAL_DLLPRIVATE void ImplNotifyIconifiedState( sal_Bool bIconified );
SAL_DLLPRIVATE bool ImplStopDnd();
SAL_DLLPRIVATE void ImplStartDnd();
SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow );
SAL_DLLPRIVATE void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos );
- SAL_DLLPRIVATE BOOL ImplIsInTaskPaneList();
- SAL_DLLPRIVATE void ImplIsInTaskPaneList( BOOL mbIsInTaskList );
+ SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList();
+ SAL_DLLPRIVATE void ImplIsInTaskPaneList( sal_Bool mbIsInTaskList );
SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const;
@@ -568,10 +584,10 @@ protected:
// Single argument ctors shall be explicit.
explicit Window( WindowType nType );
- void SetCompoundControl( BOOL bCompound );
+ void SetCompoundControl( sal_Bool bCompound );
- void ImplCallEventListeners( ULONG nEvent, void* pData = NULL );
- void CallEventListeners( ULONG nEvent, void* pData = NULL );
+ void ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL );
+ void CallEventListeners( sal_uLong nEvent, void* pData = NULL );
void FireVclEvent( VclSimpleEvent* pEvent );
// FIXME: this is a hack to workaround missing layout functionality
@@ -590,7 +606,9 @@ public:
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void PrePaint();
virtual void Paint( const Rectangle& rRect );
- virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+
+ virtual void PostPaint();
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
virtual void Move();
virtual void Resize();
virtual void Activate();
@@ -600,7 +618,7 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Command( const CommandEvent& rCEvt );
virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void UserEvent( ULONG nEvent, void* pEventData );
+ virtual void UserEvent( sal_uLong nEvent, void* pEventData );
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual long PreNotify( NotifyEvent& rNEvt );
@@ -612,16 +630,16 @@ public:
/*virtual*/ void AddChildEventListener( const Link& rEventListener );
/*virtual*/ void RemoveChildEventListener( const Link& rEventListener );
- ULONG PostUserEvent( ULONG nEvent, void* pEventData = NULL );
- ULONG PostUserEvent( const Link& rLink, void* pCaller = NULL );
- BOOL PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData = NULL );
- BOOL PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller = NULL );
- void RemoveUserEvent( ULONG nUserEvent );
+ sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
+ sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL );
+ sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
+ sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+ void RemoveUserEvent( sal_uLong nUserEvent );
void PostStateChanged( StateChangedType nState );
void IncrementLockCount();
void DecrementLockCount();
- BOOL IsLocked( BOOL bChilds = FALSE ) const;
+ sal_Bool IsLocked( sal_Bool bChilds = sal_False ) const;
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -635,64 +653,64 @@ public:
WinBits GetPrevExtendedStyle() const;
void SetType( WindowType nType );
WindowType GetType() const;
- BOOL IsSystemWindow() const;
- BOOL IsDialog() const;
- BOOL IsMenuFloatingWindow() const;
- BOOL IsToolbarFloatingWindow() const;
- BOOL IsTopWindow() const;
+ sal_Bool IsSystemWindow() const;
+ sal_Bool IsDialog() const;
+ sal_Bool IsMenuFloatingWindow() const;
+ sal_Bool IsToolbarFloatingWindow() const;
+ sal_Bool IsTopWindow() const;
SystemWindow* GetSystemWindow() const;
- void EnableAllResize( BOOL bEnable = TRUE );
- BOOL IsAllResizeEnabled() const;
+ void EnableAllResize( sal_Bool bEnable = sal_True );
+ sal_Bool IsAllResizeEnabled() const;
- void SetBorderStyle( USHORT nBorderStyle );
- USHORT GetBorderStyle() const;
+ void SetBorderStyle( sal_uInt16 nBorderStyle );
+ sal_uInt16 GetBorderStyle() const;
void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
Size CalcWindowSize( const Size& rOutSz ) const;
Size CalcOutputSize( const Size& rWinSz ) const;
long CalcTitleWidth() const;
- void EnableClipSiblings( BOOL bClipSiblings = TRUE );
- BOOL IsClipSiblingsEnabled() const;
+ void EnableClipSiblings( sal_Bool bClipSiblings = sal_True );
+ sal_Bool IsClipSiblingsEnabled() const;
- void EnableChildTransparentMode( BOOL bEnable = TRUE );
- BOOL IsChildTransparentModeEnabled() const;
+ void EnableChildTransparentMode( sal_Bool bEnable = sal_True );
+ sal_Bool IsChildTransparentModeEnabled() const;
- void SetMouseTransparent( BOOL bTransparent );
- BOOL IsMouseTransparent() const;
- void SetPaintTransparent( BOOL bTransparent );
- BOOL IsPaintTransparent() const;
- void SetDialogControlStart( BOOL bStart );
- BOOL IsDialogControlStart() const;
- void SetDialogControlFlags( USHORT nFlags );
- USHORT GetDialogControlFlags() const;
+ void SetMouseTransparent( sal_Bool bTransparent );
+ sal_Bool IsMouseTransparent() const;
+ void SetPaintTransparent( sal_Bool bTransparent );
+ sal_Bool IsPaintTransparent() const;
+ void SetDialogControlStart( sal_Bool bStart );
+ sal_Bool IsDialogControlStart() const;
+ void SetDialogControlFlags( sal_uInt16 nFlags );
+ sal_uInt16 GetDialogControlFlags() const;
struct PointerState
{
- ULONG mnState; // the button state
+ sal_uLong mnState; // the button state
Point maPos; // mouse position in output coordinates
};
PointerState GetPointerState();
- BOOL IsMouseOver();
+ sal_Bool IsMouseOver();
- ULONG GetCurrentModButtons();
+ sal_uLong GetCurrentModButtons();
void SetInputContext( const InputContext& rInputContext );
const InputContext& GetInputContext() const;
- void EndExtTextInput( USHORT nFlags );
- BOOL IsExtTextInput() const;
+ void EndExtTextInput( sal_uInt16 nFlags );
+ sal_Bool IsExtTextInput() const;
void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 );
const Rectangle* GetCursorRect() const;
long GetCursorExtTextInputWidth() const;
- void EnableChildNotify( BOOL bEnable );
- BOOL IsChildNotify() const;
+ void EnableChildNotify( sal_Bool bEnable );
+ sal_Bool IsChildNotify() const;
using OutputDevice::SetSettings;
virtual void SetSettings( const AllSettings& rSettings );
- virtual void SetSettings( const AllSettings& rSettings, BOOL bChild );
- void UpdateSettings( const AllSettings& rSettings, BOOL bChild = FALSE );
+ virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild );
+ void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False );
void NotifyAllChilds( DataChangedEvent& rDCEvt );
void SetPointFont( const Font& rFont );
@@ -704,26 +722,26 @@ public:
void SetControlFont();
void SetControlFont( const Font& rFont );
Font GetControlFont() const;
- BOOL IsControlFont() const;
+ sal_Bool IsControlFont() const;
void SetControlForeground();
void SetControlForeground( const Color& rColor );
Color GetControlForeground() const;
- BOOL IsControlForeground() const;
+ sal_Bool IsControlForeground() const;
void SetControlBackground();
void SetControlBackground( const Color& rColor );
Color GetControlBackground() const;
- BOOL IsControlBackground() const;
+ sal_Bool IsControlBackground() const;
- void SetParentClipMode( USHORT nMode = 0 );
- USHORT GetParentClipMode() const;
+ void SetParentClipMode( sal_uInt16 nMode = 0 );
+ sal_uInt16 GetParentClipMode() const;
void SetWindowRegionPixel();
void SetWindowRegionPixel( const Region& rRegion );
const Region& GetWindowRegionPixel() const;
- BOOL IsWindowRegionPixel() const;
- Region GetWindowClipRegionPixel( USHORT nFlags = 0 ) const;
+ sal_Bool IsWindowRegionPixel() const;
+ Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
Region GetPaintRegion() const;
- BOOL IsInPaint() const;
+ sal_Bool IsInPaint() const;
// while IsInPaint returns true ExpandPaintClipRegion adds the
// submitted region to the paint clip region so you can
// paint additional parts of your window if necessary
@@ -732,23 +750,23 @@ public:
void SetParent( Window* pNewParent );
Window* GetParent() const;
- void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 );
- void Hide( USHORT nFlags = 0 ) { Show( FALSE, nFlags ); }
- BOOL IsVisible() const;
- BOOL IsReallyVisible() const;
+ void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 );
+ void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); }
+ sal_Bool IsVisible() const;
+ sal_Bool IsReallyVisible() const;
// Do not use this function, use IsReallyVisible()
- BOOL IsParentPathVisible() const;
- BOOL IsReallyShown() const;
- BOOL IsInInitShow() const;
+ sal_Bool IsParentPathVisible() const;
+ sal_Bool IsReallyShown() const;
+ sal_Bool IsInInitShow() const;
void Enable( bool bEnable = true, bool bChild = true );
void Disable( bool bChild = true ) { Enable( false, bChild ); }
- BOOL IsEnabled() const;
+ sal_Bool IsEnabled() const;
- void EnableInput( BOOL bEnable = TRUE, BOOL bChild = TRUE );
- void EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
+ void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True );
+ void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
const Window* pExcludeWindow = NULL );
- BOOL IsInputEnabled() const;
+ sal_Bool IsInputEnabled() const;
/** Override <code>EnableInput</code>. This can be necessary due to other people
using EnableInput for whole window hierarchies.
@@ -762,12 +780,12 @@ public:
@param bChild
if true children are recursively set to AlwaysEnableInput
*/
- void AlwaysEnableInput( BOOL bAlways, BOOL bChild = TRUE );
+ void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
/** returns the current AlwaysEnableInput state
@return
true if window is in AlwaysEnableInput state
*/
- BOOL IsAlwaysEnableInput() const;
+ sal_Bool IsAlwaysEnableInput() const;
/** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput.
Windows with AlwaysDisableInput will not get key events even if enabled
and input enabled.This can be necessary due to other people using EnableInput
@@ -782,12 +800,12 @@ public:
@param bChild
if true children are recursively set to AlwaysDisableInput
*/
- void AlwaysDisableInput( BOOL bAlways, BOOL bChild = TRUE );
+ void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
/** returns the current AlwaysDisableInput state
@return
true if window is in AlwaysEnableInput state
*/
- BOOL IsAlwaysDisableInput() const;
+ sal_Bool IsAlwaysDisableInput() const;
/** usually event handlers (see AddEventListener and AddChildEventListener)
are not called on disabled, modal or input disabled windows. There are however rare cases
in which one wants a Window or rather one of its Control subclasses to
@@ -813,21 +831,21 @@ public:
/** A window is in modal mode if one of its children or subchildren
is a running modal window (a modal dialog)
- @returns TRUE if a child or subchild is a running modal window
+ @returns sal_True if a child or subchild is a running modal window
*/
- BOOL IsInModalMode() const;
+ sal_Bool IsInModalMode() const;
- void SetActivateMode( USHORT nMode );
- USHORT GetActivateMode() const;
+ void SetActivateMode( sal_uInt16 nMode );
+ sal_uInt16 GetActivateMode() const;
- void ToTop( USHORT nFlags = 0 );
- void SetZOrder( Window* pRefWindow, USHORT nFlags );
- void EnableAlwaysOnTop( BOOL bEnable = TRUE );
- BOOL IsAlwaysOnTopEnabled() const;
+ void ToTop( sal_uInt16 nFlags = 0 );
+ void SetZOrder( Window* pRefWindow, sal_uInt16 nFlags );
+ void EnableAlwaysOnTop( sal_Bool bEnable = sal_True );
+ sal_Bool IsAlwaysOnTopEnabled() const;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
virtual void SetPosPixel( const Point& rNewPos );
virtual Point GetPosPixel() const;
virtual void SetSizePixel( const Size& rNewSize );
@@ -835,8 +853,8 @@ public:
virtual void SetPosSizePixel( const Point& rNewPos,
const Size& rNewSize );
virtual void SetOutputSizePixel( const Size& rNewSize );
- BOOL IsDefaultPos() const;
- BOOL IsDefaultSize() const;
+ sal_Bool IsDefaultPos() const;
+ sal_Bool IsDefaultSize() const;
// those conversion routines might deliver different results during UI mirroring
Point OutputToScreenPixel( const Point& rPos ) const;
@@ -852,40 +870,40 @@ public:
// window extents of the client window, coordinates to be used in SetPosPixel
Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const;
- virtual BOOL IsScrollable() const;
+ virtual sal_Bool IsScrollable() const;
virtual void Scroll( long nHorzScroll, long nVertScroll,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
virtual void Scroll( long nHorzScroll, long nVertScroll,
- const Rectangle& rRect, USHORT nFlags = 0 );
- virtual void Invalidate( USHORT nFlags = 0 );
- virtual void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 );
- virtual void Invalidate( const Region& rRegion, USHORT nFlags = 0 );
- void Validate( USHORT nFlags = 0 );
- void Validate( const Rectangle& rRect, USHORT nFlags = 0 );
- void Validate( const Region& rRegion, USHORT nFlags = 0 );
- BOOL HasPaintEvent() const;
+ const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 );
+ void Validate( sal_uInt16 nFlags = 0 );
+ void Validate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Validate( const Region& rRegion, sal_uInt16 nFlags = 0 );
+ sal_Bool HasPaintEvent() const;
void Update();
void Flush();
void Sync();
// toggles new docking support, enabled via toolkit
- void EnableDocking( BOOL bEnable = TRUE );
+ void EnableDocking( sal_Bool bEnable = sal_True );
// retrieves the single dockingmanager instance
static DockingManager* GetDockingManager();
- void EnablePaint( BOOL bEnable );
- BOOL IsPaintEnabled() const;
- void SetUpdateMode( BOOL bUpdate );
- BOOL IsUpdateMode() const;
- void SetParentUpdateMode( BOOL bUpdate );
- BOOL IsParentUpdateMode() const;
+ void EnablePaint( sal_Bool bEnable );
+ sal_Bool IsPaintEnabled() const;
+ void SetUpdateMode( sal_Bool bUpdate );
+ sal_Bool IsUpdateMode() const;
+ void SetParentUpdateMode( sal_Bool bUpdate );
+ sal_Bool IsParentUpdateMode() const;
void GrabFocus();
- BOOL HasFocus() const;
- BOOL HasChildPathFocus( BOOL bSystemWindow = FALSE ) const;
- BOOL IsActive() const;
- BOOL HasActiveChildFrame();
- USHORT GetGetFocusFlags() const;
+ sal_Bool HasFocus() const;
+ sal_Bool HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsActive() const;
+ sal_Bool HasActiveChildFrame();
+ sal_uInt16 GetGetFocusFlags() const;
void GrabFocusToDocument();
/**
@@ -895,35 +913,35 @@ public:
*/
void SetFakeFocus( bool bFocus );
- BOOL IsCompoundControl() const;
- BOOL HasCompoundControlFocus() const;
+ sal_Bool IsCompoundControl() const;
+ sal_Bool HasCompoundControlFocus() const;
static sal_uIntPtr SaveFocus();
- static BOOL EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore = TRUE );
+ static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
void CaptureMouse();
void ReleaseMouse();
- BOOL IsMouseCaptured() const;
+ sal_Bool IsMouseCaptured() const;
void SetPointer( const Pointer& rPointer );
const Pointer& GetPointer() const;
- void EnableChildPointerOverwrite( BOOL bOverwrite = TRUE );
- BOOL IsChildPointerOverwrite() const;
+ void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True );
+ sal_Bool IsChildPointerOverwrite() const;
void SetPointerPosPixel( const Point& rPos );
Point GetPointerPosPixel();
Point GetLastPointerPosPixel();
- void ShowPointer( BOOL bVisible );
- BOOL IsPointerVisible() const;
+ void ShowPointer( sal_Bool bVisible );
+ sal_Bool IsPointerVisible() const;
void EnterWait();
void LeaveWait();
- BOOL IsWait() const;
+ sal_Bool IsWait() const;
void SetCursor( Cursor* pCursor );
Cursor* GetCursor() const;
void SetZoom( const Fraction& rZoom );
const Fraction& GetZoom() const;
- BOOL IsZoom() const;
+ sal_Bool IsZoom() const;
long CalcZoom( long n ) const;
virtual void SetText( const XubString& rStr );
@@ -943,59 +961,55 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( ULONG nHelpId ); /// deprecated
- ULONG GetHelpId() const; /// deprecated
- void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& );
+ const rtl::OString& GetHelpId() const;
- void SetUniqueId( ULONG nUniqueId ); /// deprecated
- ULONG GetUniqueId() const; /// deprecated
- void SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartUniqueId() const;
- SmartId GetSmartUniqueOrHelpId() const;
+ void SetUniqueId( const rtl::OString& );
+ const rtl::OString& GetUniqueId() const;
+ const rtl::OString& GetUniqueOrHelpId() const;
Window* FindWindow( const Point& rPos ) const;
- USHORT GetChildCount() const;
- Window* GetChild( USHORT nChild ) const;
- Window* GetWindow( USHORT nType ) const;
- BOOL IsChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
- BOOL IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow = FALSE ) const;
+ sal_uInt16 GetChildCount() const;
+ Window* GetChild( sal_uInt16 nChild ) const;
+ Window* GetWindow( sal_uInt16 nType ) const;
+ sal_Bool IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
+ sal_Bool IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
void SetData( void* pNewData );
void* GetData() const;
- Bitmap SnapShot( BOOL bBorder=TRUE ) const;
+ Bitmap SnapShot( sal_Bool bBorder = sal_True ) const;
void ShowFocus( const Rectangle& rRect );
void HideFocus();
- void Invert( const Rectangle& rRect, USHORT nFlags = 0 );
- void Invert( const Polygon& rPoly, USHORT nFlags = 0 );
+ void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
// transparent background for selected or checked items in toolboxes etc.
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly );
// the same, but fills a passed Color with a text color complementing the selection background
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor );
// support rounded edges in the selection rect
- void DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
+ void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
void ShowTracking( const Rectangle& rRect,
- USHORT nFlags = SHOWTRACK_SMALL );
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
void HideTracking();
void InvertTracking( const Rectangle& rRect,
- USHORT nFlags = SHOWTRACK_SMALL );
- void InvertTracking( const Polygon& rPoly, USHORT nFlags = 0 );
+ sal_uInt16 nFlags = SHOWTRACK_SMALL );
+ void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
- void StartTracking( USHORT nFlags = 0 );
- void EndTracking( USHORT nFlags = 0 );
- BOOL IsTracking() const;
+ void StartTracking( sal_uInt16 nFlags = 0 );
+ void EndTracking( sal_uInt16 nFlags = 0 );
+ sal_Bool IsTracking() const;
- void StartAutoScroll( USHORT nFlags );
+ void StartAutoScroll( sal_uInt16 nFlags );
void EndAutoScroll();
- BOOL IsAutoScroll() const;
+ sal_Bool IsAutoScroll() const;
- BOOL HandleScrollCommand( const CommandEvent& rCmd,
+ sal_Bool HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl = NULL,
ScrollBar* pVScrl = NULL );
@@ -1006,20 +1020,20 @@ public:
::com::sun::star::uno::Any GetSystemDataAny() const;
// API zum Setzen/Abfragen des Komponenteninterfaces
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( BOOL bCreate = TRUE );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True );
virtual void SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace );
// Accessibility
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( BOOL bCreate = TRUE );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
Window* GetAccessibleParentWindow() const;
- USHORT GetAccessibleChildWindowCount();
- Window* GetAccessibleChildWindow( USHORT n );
+ sal_uInt16 GetAccessibleChildWindowCount();
+ Window* GetAccessibleChildWindow( sal_uInt16 n );
- void SetAccessibleRole( USHORT nRole );
- USHORT GetAccessibleRole() const;
+ void SetAccessibleRole( sal_uInt16 nRole );
+ sal_uInt16 GetAccessibleRole() const;
void SetAccessibleName( const String& rName );
String GetAccessibleName() const;
@@ -1027,9 +1041,20 @@ public:
void SetAccessibleDescription( const String& rDescr );
String GetAccessibleDescription() const;
+ void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
+ Window* GetAccessibleRelationLabeledBy() const;
+
+ void SetAccessibleRelationLabelFor( Window* pLabelFor );
+ Window* GetAccessibleRelationLabelFor() const;
+
+ void SetAccessibleRelationMemberOf( Window* pMemberOf );
+ Window* GetAccessibleRelationMemberOf() const;
+
+
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
- BOOL IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath = TRUE );
+ sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
+ void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
/// request XCanvas render interface for this window
::com::sun::star::uno::Reference<
@@ -1051,11 +1076,10 @@ public:
void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow );
// Merken, ob vom Toolkit erzeugt
- BOOL IsCreatedWithToolkit() const;
- void SetCreatedWithToolkit( BOOL b );
+ sal_Bool IsCreatedWithToolkit() const;
+ void SetCreatedWithToolkit( sal_Bool b );
- Window* GetLabelFor() const;
- Window* GetLabeledBy() const;
+ // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
virtual Window* GetParentLabelFor( const Window* pLabel ) const;
virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
KeyEvent GetActivationKey() const;
@@ -1079,8 +1103,8 @@ public:
//-------------------------------------
// form controls must never use native widgets, this can be toggled here
- void EnableNativeWidget( BOOL bEnable = TRUE );
- BOOL IsNativeWidgetEnabled() const;
+ void EnableNativeWidget( sal_Bool bEnable = sal_True );
+ sal_Bool IsNativeWidgetEnabled() const;
// a helper method for a Control's Draw method
void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize );
@@ -1101,12 +1125,64 @@ public:
INDICATOR_NUM_LOCK
INDICATOR_SCROLL_LOCK
*/
- USHORT GetIndicatorState() const;
+ sal_uInt16 GetIndicatorState() const;
- void SimulateKeyPress( USHORT nKeyCode ) const;
+ void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
+
+ // let the window intercept the KeyDown messages of the system children
+ void InterceptChildWindowKeyDown( sal_Bool bIntercept );
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // ExtImpl
+
+ // layouting
+ boost::shared_ptr< vcl::WindowArranger > getLayout();
+
+ /* add a child Window
+ addWindow will do the following things
+ - insert the passed window into the child list (equivalent to i_pWin->SetParent( this ))
+ - mark the window as "owned", meaning that the added Window will be destroyed by
+ the parent's desctructor.
+ This means: do not pass in member windows or stack objects here. Do not cause
+ the destructor of the added window to be called in any way.
+
+ to avoid ownership pass i_bTakeOwnership as "false"
+ */
+ void addWindow( Window* i_pWin, bool i_bTakeOwnership = true );
+
+ /* remove a child Window
+ the remove window functions will
+ - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent ))
+ - return a pointer to the removed window or NULL if i_pWin was not found
+ caution: ownership passes to the new parent or the caller, if the new parent was NULL
+ */
+ Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL );
+
+ /* return the identifier of this window
+ */
+ const rtl::OUString& getIdentifier() const;
+ /* set an identifier
+ identifiers have only loosely defined rules per se
+ in context of Window they must be unique over the window
+ hierarchy you'd like to find them again using the findWindow method
+ */
+ void setIdentifier( const rtl::OUString& );
+
+ /* returns the first found descendant that matches
+ the passed identifier or NULL
+ */
+ Window* findWindow( const rtl::OUString& ) const;
+
+ /* get/set properties
+ this will contain window properties (like visible, enabled)
+ as well as properties of derived classes (e.g. text of Edit fields)
+ */
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
+ /*
+ */
+ virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
};
diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx
deleted file mode 100644
index 55de8b4fb5be..000000000000
--- a/vcl/inc/vcl/wintypes.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SV_WINTYPES_HXX
-#define _SV_WINTYPES_HXX
-
-#include <tools/wintypes.hxx>
-
-#endif // _SV_WINTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/impbmpconv.hxx b/vcl/inc/vcl/wpropset.hxx
index 0d82ed119d6d..ac0f98fd3525 100644
--- a/vcl/inc/vcl/impbmpconv.hxx
+++ b/vcl/inc/vcl/wpropset.hxx
@@ -26,15 +26,42 @@
*
************************************************************************/
-#ifndef _VCL_IMPBMPCONV_HXX_
-#define _VCL_IMPBMPCONV_HXX_
+#ifndef VCL_WPROPSET_HXX
+#define VCL_WPROPSET_HXX
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/uno/Reference.hxx>
+#include "vcl/dllapi.h"
+
+#include "tools/link.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+class VclWindowEvent;
namespace vcl
{
-com::sun::star::uno::Reference< com::sun::star::script::XInvocation > createBmpConverter();
+ class WindowPropertySetData;
+ class WindowPropertySetListener;
+
+ class VCL_DLLPUBLIC WindowPropertySet
+ {
+ WindowPropertySetData* mpImpl;
+
+ void addWindowToSet( Window* );
+ void addLayoutToSet( const boost::shared_ptr<WindowArranger>& );
+ void setupProperties();
+
+ DECL_LINK( ChildEventListener, VclWindowEvent* );
+
+ void propertyChange( const com::sun::star::beans::PropertyChangeEvent& );
+ friend class vcl::WindowPropertySetListener;
+
+ public:
+ WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership );
+ ~WindowPropertySet();
+
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > getPropertySet() const;
+ };
}
#endif
diff --git a/vcl/inc/vcl/wrkwin.hxx b/vcl/inc/vcl/wrkwin.hxx
index 50c1cf60dbb7..c58f6971ffc0 100644
--- a/vcl/inc/vcl/wrkwin.hxx
+++ b/vcl/inc/vcl/wrkwin.hxx
@@ -41,9 +41,9 @@ struct SystemParentData;
// ----------------------
// Presentation Flags
-#define PRESENTATION_HIDEALLAPPS ((USHORT)0x0001)
-#define PRESENTATION_NOFULLSCREEN ((USHORT)0x0002)
-#define PRESENTATION_NOAUTOSHOW ((USHORT)0x0004)
+#define PRESENTATION_HIDEALLAPPS ((sal_uInt16)0x0001)
+#define PRESENTATION_NOFULLSCREEN ((sal_uInt16)0x0002)
+#define PRESENTATION_NOAUTOSHOW ((sal_uInt16)0x0004)
// --------------
// - WorkWindow -
@@ -52,8 +52,8 @@ struct SystemParentData;
class VCL_DLLPUBLIC WorkWindow : public SystemWindow
{
private:
- USHORT mnPresentationFlags;
- BOOL mbPresentationMode:1,
+ sal_uInt16 mnPresentationFlags;
+ sal_Bool mbPresentationMode:1,
mbPresentationVisible:1,
mbPresentationFull:1,
mbFullScreenMode:1;
@@ -69,7 +69,7 @@ protected:
WorkWindow( WindowType nType );
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData = NULL );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- SAL_DLLPRIVATE void ImplSetFrameState( ULONG aFrameState );
+ SAL_DLLPRIVATE void ImplSetFrameState( sal_uLong aFrameState );
public:
WorkWindow( Window* pParent, const ResId& rResId );
@@ -78,7 +78,7 @@ public:
WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
~WorkWindow();
- virtual BOOL Close();
+ virtual sal_Bool Close();
/** The default value of nDisplay = -1 means "don't care" and
allows to backends to use any screen [** or display? terminology!]
@@ -87,23 +87,23 @@ public:
NOTE: The default value cannot be 0, because 0 is a legitimate
screen number.
*/
- void ShowFullScreenMode( BOOL bFullScreenMode = TRUE, sal_Int32 nDisplay = -1 );
- void EndFullScreenMode() { ShowFullScreenMode( FALSE ); }
- BOOL IsFullScreenMode() const { return mbFullScreenMode; }
+ void ShowFullScreenMode( sal_Bool bFullScreenMode = sal_True, sal_Int32 nDisplay = -1 );
+ void EndFullScreenMode() { ShowFullScreenMode( sal_False ); }
+ sal_Bool IsFullScreenMode() const { return mbFullScreenMode; }
- void StartPresentationMode( BOOL bPresentation = TRUE, USHORT nFlags = 0, sal_Int32 nDisplay = 0 );
- void EndPresentationMode() { StartPresentationMode( FALSE ); }
- BOOL IsPresentationMode() const { return mbPresentationMode; }
+ void StartPresentationMode( sal_Bool bPresentation = sal_True, sal_uInt16 nFlags = 0, sal_Int32 nDisplay = 0 );
+ void EndPresentationMode() { StartPresentationMode( sal_False ); }
+ sal_Bool IsPresentationMode() const { return mbPresentationMode; }
- BOOL IsMinimized() const;
+ sal_Bool IsMinimized() const;
- BOOL SetPluginParent( SystemParentData* pParent );
+ sal_Bool SetPluginParent( SystemParentData* pParent );
void Minimize();
void Restore();
- void Maximize( BOOL bMaximize = TRUE );
- BOOL IsMaximized() const;
+ void Maximize( sal_Bool bMaximize = sal_True );
+ sal_Bool IsMaximized() const;
};
#endif // _SV_WRKWIN_HXX
diff --git a/vcl/inc/vcl/xconnection.hxx b/vcl/inc/vcl/xconnection.hxx
index 1c4c5dd45140..bd3270fa24c7 100644
--- a/vcl/inc/vcl/xconnection.hxx
+++ b/vcl/inc/vcl/xconnection.hxx
@@ -29,11 +29,12 @@
#ifndef _VCL_XCONNECTION_HXX
#define _VCL_XCONNECTION_HXX
-#include <com/sun/star/awt/XDisplayConnection.hpp>
-#include <cppuhelper/implbase1.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include "vcl/displayconnectiondispatch.hxx"
+
#ifndef _STLP_LIST
#include <list>
#endif
@@ -41,7 +42,7 @@
namespace vcl {
class DisplayConnection :
- public ::cppu::WeakImplHelper1< ::com::sun::star::awt::XDisplayConnection >
+ public DisplayConnectionDispatch
{
::osl::Mutex m_aMutex;
::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
@@ -53,9 +54,11 @@ namespace vcl {
DisplayConnection();
virtual ~DisplayConnection();
- static bool dispatchEvent( void* pThis, void* pData, int nBytes );
- static bool dispatchErrorEvent( void* pThis, void* pData, int nBytes );
- void dispatchDowningEvent();
+ void start();
+ void terminate();
+
+ virtual bool dispatchEvent( void* pData, int nBytes );
+ virtual bool dispatchErrorEvent( void* pData, int nBytes );
// XDisplayConnection
virtual void SAL_CALL addEventHandler( const ::com::sun::star::uno::Any& window, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler, sal_Int32 eventMask ) throw();
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index 0970677b0fb1..3c72695bc2f2 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -75,7 +75,7 @@ public:
bool AliasSymbolsHigh() const { return mbAliasSymbolsHigh; }
bool AliasSymbolsLow() const { return mbAliasSymbolsLow; }
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
private:
sal_IntPtr mnId;
@@ -83,7 +83,7 @@ private:
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
- mutable ImplFontCharMap* mpUnicodeMap;
+ mutable const ImplFontCharMap* mpUnicodeMap;
// TODO: get rid of the members below needed to work with the Win9x non-unicode API
BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning)
@@ -152,8 +152,6 @@ public:
virtual ~Os2SalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
@@ -212,11 +210,7 @@ public:
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index c533c0b8339c..4d98b803dfba 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -85,12 +85,9 @@ public:
virtual osl::SolarMutex* GetYieldMutex();
virtual ULONG ReleaseYieldMutex();
virtual void AcquireYieldMutex( ULONG nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool, bool );
virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* );
virtual SalSession* CreateSalSession();
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h
index fc4a1c027159..467c4537dc2a 100644
--- a/vcl/os2/inc/salobj.h
+++ b/vcl/os2/inc/salobj.h
@@ -65,6 +65,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index 44b87dc2a57b..e4fd783ccb27 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -40,7 +40,7 @@
#include <tools/debug.hxx>
#include <salids.hrc>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <saldata.hxx>
#include <salinst.h>
#include <salframe.h>
@@ -295,10 +295,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool Os2SalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
ULONG nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -308,7 +307,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -319,14 +318,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void InitSalData()
diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx
index bef26eb6d02a..efd913c251b2 100644
--- a/vcl/os2/source/gdi/salgdi.cxx
+++ b/vcl/os2/source/gdi/salgdi.cxx
@@ -37,6 +37,7 @@
#include <salframe.h>
#include <tools/poly.hxx>
#include <rtl/strbuf.hxx>
+#include "vcl/region.h"
#ifndef __H_FT2LIB
#include <wingdi.h>
@@ -216,38 +217,29 @@ void Os2SalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void Os2SalGraphics::BeginSetClipRegion( ULONG nCount )
+bool Os2SalGraphics::setClipRegion( const Region& i_rClip )
{
+ ULONG nCount = i_rClip.GetRectCount();
+
mpClipRectlAry = new RECTL[ nCount ];
mnClipElementCount = 0;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL Os2SalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
- pClipRect->xLeft = nX;
- pClipRect->yTop = mnHeight - nY;
- pClipRect->xRight = nX + nWidth;
- pClipRect->yBottom = mnHeight - (nY + nHeight);
- mnClipElementCount++;
-
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-bool Os2SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-// -----------------------------------------------------------------------
-
-void Os2SalGraphics::EndSetClipRegion()
-{
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
+ pClipRect->xLeft = nX;
+ pClipRect->yTop = mnHeight - nY;
+ pClipRect->xRight = nX + nW;
+ pClipRect->yBottom = mnHeight - (nY + nH);
+ mnClipElementCount++;
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
#ifdef SAL_PRINTER_CLIPPATH
if ( mbPrinter )
{
@@ -286,6 +278,8 @@ void Os2SalGraphics::EndSetClipRegion()
}
delete [] mpClipRectlAry;
+
+ return true;
}
// -----------------------------------------------------------------------
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 11aa9df9ce76..f1580fe77185 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -427,9 +427,8 @@ bool ImplOs2FontData::IsGSUBstituted( sal_Ucs cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplOs2FontData::GetImplFontCharMap() const
{
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -562,6 +561,7 @@ void ImplOs2FontData::ReadCmapTable( HPS hPS ) const
aResult.mpPairCodes, aResult.mpStartGlyphs );
else
mpUnicodeMap = ImplFontCharMap::GetDefaultMap();
+ mpUnicodeMap->AddReference();
}
// =======================================================================
@@ -954,10 +954,10 @@ ULONG Os2SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-static ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
+static const ImplFontCharMap* pOs2DefaultImplFontCharMap = NULL;
static const sal_uInt32 pOs2DefaultRangeCodes[] = {0x0020,0x00FF};
-ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* Os2SalGraphics::GetImplFontCharMap() const
{
if( !mpOs2FontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -1636,7 +1636,7 @@ void Os2SalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplOs2FontData* pWinFont = static_cast<const ImplOs2FontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
int nCharCount = pMap->GetCharCount();
diff --git a/vcl/os2/source/window/makefile.mk b/vcl/os2/source/window/makefile.mk
index f4a6ad0cb870..560d35880b21 100644
--- a/vcl/os2/source/window/makefile.mk
+++ b/vcl/os2/source/window/makefile.mk
@@ -40,7 +40,7 @@ CXXFILES__YD= salframe.cxx \
salobj.cxx
SLOFILES= $(SLO)$/salframe.obj \
- $(SLO)$/salobj.obj $(SLO)$/salmenu.obj
+ $(SLO)$/salobj.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index f7fa3f645549..ebc557faafb2 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -2018,8 +2018,6 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// --- Style settings ---
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
-
// General settings
LONG nDisplayTime = PrfQueryProfileInt( HINI_PROFILE, (PSZ)aControlPanel, (PSZ)"LogoDisplayTime", -1 );
ULONG nSalDisplayTime;
@@ -2041,32 +2039,26 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
// Size settings
aStyleSettings.SetScrollBarSize( WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL ) );
- if ( bCompBorder )
- {
- aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
- }
+ aStyleSettings.SetTitleHeight( WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR ) );
// Color settings
- if ( bCompBorder )
- {
- aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
- aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
- aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
- aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
- aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
- aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
- aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
- aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
- aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
- }
+ aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
+ aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
+ aStyleSettings.SetDarkShadowColor( Color( COL_BLACK ) );
+ aStyleSettings.SetDialogColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_DIALOGBACKGROUND, 0 ) ) );
+ aStyleSettings.SetButtonTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetActiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetActiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetActiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetDeactiveColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLE, 0 ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVETITLETEXT, 0 ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_INACTIVEBORDER, 0 ) ) );
+ aStyleSettings.SetMenuColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENU, 0 ) ) );
+ aStyleSettings.SetMenuTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUTEXT, 0 ) ) );
aStyleSettings.SetDialogTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetRadioCheckTextColor( aStyleSettings.GetButtonTextColor() );
aStyleSettings.SetGroupTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWSTATICTEXT, 0 ) ) );
@@ -2083,11 +2075,8 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
Color aMenuHighColor = ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0 ) );
if ( ImplSalIsSameColor( aMenuHighColor, aStyleSettings.GetMenuColor() ) )
{
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
- aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
- }
+ aStyleSettings.SetMenuHighlightColor( Color( COL_BLUE ) );
+ aStyleSettings.SetMenuHighlightTextColor( Color( COL_WHITE ) );
}
else
{
diff --git a/vcl/os2/source/window/salmenu.cxx b/vcl/os2/source/window/salmenu.cxx
deleted file mode 100644
index fa8f74202b0a..000000000000
--- a/vcl/os2/source/window/salmenu.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define INCL_DOS
-#define INCL_PM
-#define INCL_WIN
-#include <svpm.h>
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// Os2SalInst factory methods
-
-SalMenu* Os2SalInstance::CreateMenu( BOOL bMenuBar )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* Os2SalInstance::CreateMenuItem( const SalItemParams* pItemData )
-{
- return NULL; // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * Os2SalMenu
- */
-
-
-Os2SalMenu::~Os2SalMenu()
-{
-}
-
-BOOL Os2SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void Os2SalMenu::SetFrame( const SalFrame *pFrame )
-{
-}
-
-void Os2SalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
-{
-}
-
-void Os2SalMenu::RemoveItem( unsigned nPos )
-{
-}
-
-void Os2SalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos )
-{
-}
-
-void Os2SalMenu::CheckItem( unsigned nPos, BOOL bCheck )
-{
-}
-
-void Os2SalMenu::EnableItem( unsigned nPos, BOOL bEnable )
-{
-}
-
-void Os2SalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
-{
-}
-
-void Os2SalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )
-{
-}
-
-void Os2SalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
-{
-}
-
-void Os2SalMenu::GetSystemMenuData( SystemMenuData* pData )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-Os2SalMenuItem::~Os2SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/os2/source/window/salobj.cxx b/vcl/os2/source/window/salobj.cxx
index 2017196cdf5f..5c1e9ed03358 100644
--- a/vcl/os2/source/window/salobj.cxx
+++ b/vcl/os2/source/window/salobj.cxx
@@ -551,3 +551,9 @@ const SystemChildData* Os2SalObject::GetSystemData() const
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void Os2SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index f64757f2c9e1..2cf0bd3963d5 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools shell svl NULL
+vc vcl : L10N:l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
@@ -48,3 +48,10 @@ vc vcl\mac\source\src nmake - m vc__srcm vc_inc NULL
vc vcl\util nmake - all vc_util vc__plug.u vc__desk.u vc__aquy.u vc__appa.u vc__dtra.u vc__appm.m vc__appu.u vc__dtru.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__kde4.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL
vc vcl\util\linksvp nmake - u vc_lsvp vc_util NULL
vc vcl\workben nmake - all vc_wrkb vc_util vc_salmain NULL
+
+# memCheck works only within unix
+# memCheck is not right yet
+# vc vcl\qa\complex\memCheck nmake - u vc_qa_complex vc_util NULL
+# GPF
+# vc vcl\qa\complex\persistent_window_states nmake - all vc_qa_complex vc_util NULL
+
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index c184c1d2cb2b..00b703cf43b9 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -12,17 +12,19 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\%__SRC%\misc\vcl?????.map %_DEST%\bin%_EXT%\vcl?????.map
..\%__SRC%\obj\salmain.obj %_DEST%\lib%_EXT%\salmain.obj
..\%__SRC%\obj\salmain.o %_DEST%\lib%_EXT%\salmain.o
+..\%__SRC%\lib\libvclmain.a %_DEST%\lib%_EXT%\libvclmain.a
+..\%__SRC%\lib\vclmain.lib %_DEST%\lib%_EXT%\vclmain.lib
..\inc\vcl\accel.hxx %_DEST%\inc%_EXT%\vcl\accel.hxx
..\inc\vcl\alpha.hxx %_DEST%\inc%_EXT%\vcl\alpha.hxx
..\inc\vcl\animate.hxx %_DEST%\inc%_EXT%\vcl\animate.hxx
..\inc\vcl\apptypes.hxx %_DEST%\inc%_EXT%\vcl\apptypes.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
..\inc\vcl\bitmap.hxx %_DEST%\inc%_EXT%\vcl\bitmap.hxx
..\inc\vcl\bitmapex.hxx %_DEST%\inc%_EXT%\vcl\bitmapex.hxx
..\inc\vcl\bmpacc.hxx %_DEST%\inc%_EXT%\vcl\bmpacc.hxx
..\inc\vcl\btndlg.hxx %_DEST%\inc%_EXT%\vcl\btndlg.hxx
..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\button.hxx
-..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\imagebtn.hxx
..\inc\vcl\cmdevt.h %_DEST%\inc%_EXT%\vcl\cmdevt.h
..\inc\vcl\cmdevt.hxx %_DEST%\inc%_EXT%\vcl\cmdevt.hxx
..\inc\vcl\combobox.h %_DEST%\inc%_EXT%\vcl\combobox.h
@@ -41,7 +43,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\field.hxx %_DEST%\inc%_EXT%\vcl\field.hxx
..\inc\vcl\fixbrd.hxx %_DEST%\inc%_EXT%\vcl\fixbrd.hxx
..\inc\vcl\fixed.hxx %_DEST%\inc%_EXT%\vcl\fixed.hxx
-..\inc\vcl\fldunit.hxx %_DEST%\inc%_EXT%\vcl\fldunit.hxx
..\inc\vcl\floatwin.hxx %_DEST%\inc%_EXT%\vcl\floatwin.hxx
..\inc\vcl\fntstyle.hxx %_DEST%\inc%_EXT%\vcl\fntstyle.hxx
..\inc\vcl\font.hxx %_DEST%\inc%_EXT%\vcl\font.hxx
@@ -58,6 +59,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\image.hxx %_DEST%\inc%_EXT%\vcl\image.hxx
..\inc\vcl\imagerepository.hxx %_DEST%\inc%_EXT%\vcl\imagerepository.hxx
..\inc\vcl\imgctrl.hxx %_DEST%\inc%_EXT%\vcl\imgctrl.hxx
+..\inc\vcl\throbber.hxx %_DEST%\inc%_EXT%\vcl\throbber.hxx
..\inc\vcl\impdel.hxx %_DEST%\inc%_EXT%\vcl\impdel.hxx
..\inc\vcl\inputctx.hxx %_DEST%\inc%_EXT%\vcl\inputctx.hxx
..\inc\vcl\javachild.hxx %_DEST%\inc%_EXT%\vcl\javachild.hxx
@@ -70,7 +72,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\lstbox.h %_DEST%\inc%_EXT%\vcl\lstbox.h
..\inc\vcl\lstbox.hxx %_DEST%\inc%_EXT%\vcl\lstbox.hxx
..\inc\vcl\mapmod.hxx %_DEST%\inc%_EXT%\vcl\mapmod.hxx
-..\inc\vcl\mapunit.hxx %_DEST%\inc%_EXT%\vcl\mapunit.hxx
..\inc\vcl\menu.hxx %_DEST%\inc%_EXT%\vcl\menu.hxx
..\inc\vcl\menubtn.hxx %_DEST%\inc%_EXT%\vcl\menubtn.hxx
..\inc\vcl\metaact.hxx %_DEST%\inc%_EXT%\vcl\metaact.hxx
@@ -78,6 +79,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\metric.hxx %_DEST%\inc%_EXT%\vcl\metric.hxx
..\inc\vcl\mnemonic.hxx %_DEST%\inc%_EXT%\vcl\mnemonic.hxx
..\inc\vcl\mnemonicengine.hxx %_DEST%\inc%_EXT%\vcl\mnemonicengine.hxx
+..\inc\vcl\quickselectionengine.hxx %_DEST%\inc%_EXT%\vcl\quickselectionengine.hxx
..\inc\vcl\morebtn.hxx %_DEST%\inc%_EXT%\vcl\morebtn.hxx
..\inc\vcl\msgbox.hxx %_DEST%\inc%_EXT%\vcl\msgbox.hxx
..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx
@@ -129,7 +131,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\waitobj.hxx %_DEST%\inc%_EXT%\vcl\waitobj.hxx
..\inc\vcl\wall.hxx %_DEST%\inc%_EXT%\vcl\wall.hxx
..\inc\vcl\window.hxx %_DEST%\inc%_EXT%\vcl\window.hxx
-..\inc\vcl\wintypes.hxx %_DEST%\inc%_EXT%\vcl\wintypes.hxx
..\inc\vcl\wrkwin.hxx %_DEST%\inc%_EXT%\vcl\wrkwin.hxx
..\inc\vcl\threadex.hxx %_DEST%\inc%_EXT%\vcl\threadex.hxx
..\inc\vcl\evntpost.hxx %_DEST%\inc%_EXT%\vcl\evntpost.hxx
@@ -145,7 +146,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\pdfextoutdevdata.hxx %_DEST%\inc%_EXT%\vcl\pdfextoutdevdata.hxx
..\inc\vcl\pngread.hxx %_DEST%\inc%_EXT%\vcl\pngread.hxx
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
-..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
@@ -155,3 +155,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
+..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
+..\inc\vcl\wpropset.hxx %_DEST%\inc%_EXT%\vcl\wpropset.hxx
+..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
+
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
index 9f8272240403..a089a1c99f54 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -32,19 +32,27 @@ import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
-import complexlib.ComplexTestCase;
+// import complexlib.ComplexTestCase;
import helper.ProcessHandler;
import java.io.File;
-import java.io.FilePermission;
+// import java.io.FilePermission;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.util.Vector;
+import lib.*;
import util.DesktopTools;
-import util.WriterTools;
-import util.utils;
+// import util.WriterTools;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Documents are opened and exported with StarOffice. The memory usage of
@@ -66,95 +74,141 @@ import util.utils;
* All parameters are used for iteration over the test document path.
* </ul>
*/
-public class CheckMemoryUsage extends ComplexTestCase {
+class TempDir
+{
+
+ private String m_sTempDir;
+
+ public TempDir(String _sTempDir)
+ {
+ m_sTempDir = _sTempDir;
+ }
+
+ public String getOfficeTempDir()
+ {
+ return m_sTempDir;
+ }
+
+ public String getTempDir()
+ {
+ final String sTempDir = FileHelper.getJavaCompatibleFilename(m_sTempDir);
+ return sTempDir;
+ }
+}
+
+public class CheckMemoryUsage /* extends ComplexTestCase */
+
+{
+
private final String sWriterDoc = "sxw,writer_pdf_Export";
private final String sCalcDoc = "sxc,calc_pdf_Export";
private final String sImpressDoc = "sxi,impress_pdf_Export";
- private String sProcessId = "ps -ef | grep $USER | grep soffice | grep -v grep";
- private String sMemoryMonitor = "pmap <processID> | grep total";
- private String sChmod = "chmod 777 ";
- private String sProcessIdCommand = null;
- private String sOfficeMemoryCommand = null;
- private String sTempDir = null;
- private String sFS = null;
- private String sMemoryMap1 = null;
- private String sMemoryMap2 = null;
- private String bash = "#!/bin/bash";
- private String sDocumentPath = "";
+ // private String sProcessIdCommand = null;
+ TempDir m_aTempDir;
+ // private String sFS = null;
+ // private String sMemoryMap1 = null;
+ // private String sMemoryMap2 = null;
+ // private String sDocumentPath = "";
private String[][] sDocTypeExportFilter;
private String[][] sDocuments;
private int iAllowMemoryIncrease = 10;
private int iExportDocCount = 25;
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
/**
* Get all test methods
* @return The test methods.
- */
- public String[] getTestMethodNames() {
- return new String[] {"loadAndSaveDocuments"};
- }
-
+ // */
+// public String[] getTestMethodNames() {
+// return new String[] {"loadAndSaveDocuments"};
+// }
/**
* Collect all documnets to load and all filters used for export.
*/
- public void before() {
+ @Before
+ public void before()
+ {
+
+ final XMultiServiceFactory xMsf = getMSF();
+
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+ param = new TestParameters();
+ param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
+
// test does definitely not run on Windows.
- if (param.get("OperatingSystem").equals("wntmsci")) {
- log.println("Test can only reasonably be executed with a tool that "
- + "displays the memory usage of StarOffice.");
- failed("Test does not run on Windows, only on Solaris or Linux.");
+ if (param.get("OperatingSystem").equals("wntmsci"))
+ {
+ System.out.println("Test can only reasonably be executed with a tool that "
+ + "displays the memory usage of StarOffice.");
+ System.out.println("Test does not run on Windows, only on Solaris or Linux.");
+ // in an automatic environment it is better to say, there is no error here.
+ // it is a limitation, but no error.
+ System.exit(0);
}
+
// how many times is every document exported.
int count = param.getInt("ExportDocCount");
if (count != 0)
+ {
iExportDocCount = count;
+ }
// get the temp dir for creating the command scripts.
- sTempDir = System.getProperty("java.io.tmpdir");
- sProcessIdCommand = sTempDir + "getPS";
- sOfficeMemoryCommand = sTempDir + "getPmap";
+ // sTempDir = System.getProperty("java.io.tmpdir");
+ m_aTempDir = new TempDir(util.utils.getOfficeTemp/*Dir*/(xMsf));
// get the file extension, export filter connection
Enumeration keys = param.keys();
- Vector v = new Vector();
- while(keys.hasMoreElements()) {
- String key = (String)keys.nextElement();
- if (key.startsWith("FileExportFilter")) {
- v.add(param.get(key));
+ Vector<String> v = new Vector<String>();
+ while (keys.hasMoreElements())
+ {
+ String key = (String) keys.nextElement();
+ if (key.startsWith("FileExportFilter"))
+ {
+ v.add((String) param.get(key));
}
}
// if no param given, set defaults.
- if (v.size() == 0){
+ if (v.size() == 0)
+ {
v.add(sWriterDoc);
v.add(sCalcDoc);
v.add(sImpressDoc);
}
// store a file extension
sDocTypeExportFilter = new String[v.size()][2];
- for (int i=0; i<v.size(); i++) {
+ for (int i = 0; i < v.size(); i++)
+ {
// 2do: error routine for wrong given params
- StringTokenizer t = new StringTokenizer((String)v.get(i), ",");
- sDocTypeExportFilter[i][0] = t.nextToken();
- sDocTypeExportFilter[i][1] = t.nextToken();
+ final String sVContent = v.get(i);
+ StringTokenizer t = new StringTokenizer(sVContent, ",");
+ final String sExt = t.nextToken();
+ final String sName = t.nextToken();
+ sDocTypeExportFilter[i][0] = sExt;
+ sDocTypeExportFilter[i][1] = sName;
}
// get files to load and export
- sDocumentPath = (String)param.get("TestDocumentPath");
- File f = new File(sDocumentPath);
- sDocumentPath = f.getAbsolutePath();
- String sFS = System.getProperty("file.separator");
+// sDocumentPath = (String) param.get("TestDocumentPath");
+ String sDocumentPath = TestDocument.getUrl();
+ File f = new File(FileHelper.getJavaCompatibleFilename(sDocumentPath));
+ // sDocumentPath = f.getAbsolutePath();
+ // String sFS = System.getProperty("file.separator");
sDocuments = new String[sDocTypeExportFilter.length][];
- for (int j=0; j<sDocTypeExportFilter.length; j++) {
+ for (int j = 0; j < sDocTypeExportFilter.length; j++)
+ {
FileFilter filter = new FileFilter(sDocTypeExportFilter[j][0]);
String[] doc = f.list(filter);
sDocuments[j] = new String[doc.length];
- for (int i=0; i<doc.length; i++) {
- if (sDocumentPath.endsWith(sFS))
- sDocuments[j][i] = sDocumentPath + doc[i];
- else
- sDocuments[j][i] = sDocumentPath + sFS + doc[i];
- sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ for (int i = 0; i < doc.length; i++)
+ {
+ // final String sDocument = FileHelper.appendPath(sDocumentPath, doc[i]);
+ // sDocuments[j][i] = utils.getFullURL(sDocuments[j][i]);
+ sDocuments[j][i] = TestDocument.getUrl(doc[i]);
}
}
}
@@ -162,141 +216,323 @@ public class CheckMemoryUsage extends ComplexTestCase {
/**
* delete all created files on disk
*/
- public void after() {
+ @After
+ public void after()
+ {
// delete the constructed files.
- for (int i=0; i<iExportDocCount; i++) {
- File f = new File(sTempDir + "DocExport" + i + ".pdf");
- f.delete();
- }
- File f = new File(sProcessIdCommand);
- f.delete();
- f = new File(sOfficeMemoryCommand);
- f.delete();
+// we don't need to delete anything, all is stored in $USER_TREE
+// for (int i = 0; i < iExportDocCount; i++)
+// {
+// final String sDocumentName = "DocExport" + i + ".pdf";
+// final String sFilename = FileHelper.appendPath(m_sTempDir, sDocumentName);
+// File f = new File(FileHelper.getJavaCompatibleFilename(sFilename));
+// f.delete();
+// }
+ // File f = new File(sProcessIdCommand);
+ // f.delete();
+ // f = new File(sOfficeMemoryCommand);
+ // f.delete();
}
/**
- * Thet etst function: load documents and save them using the given filters
+ * The test function: load documents and save them using the given filters
* for each given document type.
*/
- public void loadAndSaveDocuments() {
- int storageBefore = getOfficeMemoryUsage();
+ @Test
+ public void loadAndSaveDocuments()
+ {
+ int nOk = 0;
+ int nRunThrough = 0;
- XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF();
+ // At first:
+ // we load the document, there will be some post work in office like late initialisations
+ // we store exact one time the document
+ // so the memory footprint should be right
// iterate over all document types
- for (int k=0; k<sDocTypeExportFilter.length; k++) {
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
// iterate over all documents of this type
- for (int i=0; i<sDocuments[k].length; i++) {
- System.out.println("Document: "+ sDocuments[k][i]);
- XComponent xComponent = DesktopTools.loadDoc(xMSF, sDocuments[k][i], null);
- XStorable xStorable = (XStorable)UnoRuntime.queryInterface(XStorable.class, xComponent);
- if (xStorable != null) {
- // export each document iExportDocCount times
- for (int j=0; j<iExportDocCount; j++) {
- String url = utils.getFullURL(sTempDir + "DocExport" + j + ".pdf");
- try {
- PropertyValue[] props = new PropertyValue[1];
- props[0] = new PropertyValue();
- props[0].Name = "FilterName";
- // use export filter for this doc type
- props[0].Value = sDocTypeExportFilter[k][1];
- xStorable.storeToURL(url, props);
- }
- catch(com.sun.star.io.IOException e) {
- failed("Could not store to '" + url + "'", true);
- }
- }
- // close the doc
- XCloseable xCloseable = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xStorable);
- try {
- xCloseable.close(true);
- }
- catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Cannot close document: test is futile, Office will surely use more space.");
- }
- }
- else {
- log.println("Cannot query for XStorable interface on document '" + sDocuments[i] + "'");
- log.println(" -> Skipping storage.");
- }
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+// OfficeMemchecker aChecker = new OfficeMemchecker();
+// aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+// aChecker.setExtension(sExtension);
+// aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, 1, sExtension);
+
+// nOk += checkMemory(aChecker);
+// nRunThrough ++;
}
+ System.out.println();
+ System.out.println();
}
- // short wait for the office to 'calm down' and free some memory
- shortWait(5000);
- // wait util memory is not freed anymore.
- int storageAfter = getOfficeMemoryUsage();
- int mem = 0;
- int count = 0;
- while (storageAfter != mem && count < 10) {
- count++;
- mem = storageAfter;
- storageAfter = getOfficeMemoryUsage();
- shortWait(1000);
- }
- assure("The Office consumes now " + (storageAfter - storageBefore)
- + "K more memory than at the start of the test; allowed were "
- + iAllowMemoryIncrease * iExportDocCount + "K.",
- storageAfter - storageBefore < iAllowMemoryIncrease * iExportDocCount);
+ shortWait(10000);
+
+ // Now the real test, load document and store 25 times
+
+ // iterate over all document types
+ for (int k = 0; k < sDocTypeExportFilter.length; k++)
+ {
+ // iterate over all documents of this type
+ for (int i = 0; i < sDocuments[k].length; i++)
+ {
+
+ final String sDocument = sDocuments[k][i];
+ final String sExtension = sDocTypeExportFilter[k][1];
+
+ OfficeMemchecker aChecker = new OfficeMemchecker();
+ aChecker.setDocumentName(FileHelper.getBasename(sDocument));
+ aChecker.setExtension(sExtension);
+ aChecker.start();
+
+ loadAndSaveNTimesDocument(sDocument, iExportDocCount, sExtension);
+
+ aChecker.stop();
+ final int nConsumMore = aChecker.getConsumMore();
+
+ nOk += checkMemory(nConsumMore);
+ nRunThrough++;
+ }
+ System.out.println();
+ System.out.println();
+ }
+ System.out.println("Find the output of used 'pmap' here: " + m_aTempDir.getTempDir() + " if test failed.");
+ assertTrue("Office consumes too many memory.", nOk == nRunThrough);
}
/**
- * Get the process ID from the Office
- * @return the Id as String
+ * Checks how much memory should consum
+ * @param storageBefore
+ * @return 1 if consum is ok, else 0
*/
- private String getOfficeProcessID() {
- writeExecutableFile(sProcessIdCommand, sProcessId);
- ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1)
- failed("Could not determine Office process ID. Check " + sProcessIdCommand);
- StringTokenizer aToken = new StringTokenizer(text);
- // this is not nice, but ps gives the same output on every machine
- aToken.nextToken();
- String id = aToken.nextToken();
- return id;
+ private int checkMemory(int nConsumMore)
+ {
+ int nAllowed = iAllowMemoryIncrease * iExportDocCount;
+ System.out.println("The Office consumes now " + nConsumMore
+ + "K more memory than at the start of the test; allowed were "
+ + nAllowed + "K.");
+ if (nConsumMore > nAllowed)
+ {
+ System.out.println("ERROR: This is not allowed.");
+ return 0;
+ }
+ System.out.println("OK.");
+ return 1;
}
/**
- * Get the memory usage of the Office in KByte.
- * @return The memory used by the Office.
+ * load and save exact one document
*/
- private int getOfficeMemoryUsage() {
- String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
- writeExecutableFile(sOfficeMemoryCommand, command);
- ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
- processID.executeSynchronously();
- String text = processID.getOutputText();
- if (text == null || text.equals("") || text.indexOf(' ') == -1) {
- failed("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ private void loadAndSaveNTimesDocument(String _sDocument, int _nCount, String _sStoreExtension)
+ {
+ System.out.println("Document: " + _sDocument);
+ XComponent xComponent = DesktopTools.loadDoc(getMSF(), _sDocument, null);
+ XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, xComponent);
+ if (xStorable != null)
+ {
+ // export each document iExportDocCount times
+ for (int j = 0; j < _nCount; j++)
+ {
+ final String sDocumentName = FileHelper.getBasename(_sDocument) + "_" + j + ".pdf";
+ final String sFilename = FileHelper.appendPath(m_aTempDir.getOfficeTempDir(), sDocumentName);
+ // String url = utils.getFullURL(sFilename);
+ String url = sFilename; // graphical.FileHelper.getFileURLFromSystemPath(sFilename);
+ try
+ {
+ PropertyValue[] props = new PropertyValue[1];
+ props[0] = new PropertyValue();
+ props[0].Name = "FilterName";
+ // use export filter for this doc type
+ props[0].Value = _sStoreExtension;
+ xStorable.storeToURL(url, props);
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ fail("Could not store to '" + url + "'");
+ }
+ }
+ // close the doc
+ XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xStorable);
+ try
+ {
+ xCloseable.close(true);
+ }
+ catch (com.sun.star.util.CloseVetoException e)
+ {
+ e.printStackTrace();
+ fail("Cannot close document: test is futile, Office will surely use more space.");
+ }
+ }
+ else
+ {
+ System.out.println("Cannot query for XStorable interface on document '" + _sDocument + "'");
+ System.out.println(" -> Skipping storage.");
}
- StringTokenizer aToken = new StringTokenizer(text);
- // this works, because the output of pmap is quite standardized.
- aToken.nextToken();
- String mem = aToken.nextToken();
- mem = mem.substring(0, mem.indexOf('K'));
- Integer memory = new Integer(mem);
- return memory.intValue();
+
}
- /**
- * Write a script file and set its rights to rwxrwxrwx.
- * @param fileName The name of the created file
- * @param line The commandline that has to be written inside of the file.
- */
- private void writeExecutableFile(String fileName, String line) {
- try {
- PrintWriter fWriter = new PrintWriter(new FileWriter(fileName));
- fWriter.println(bash);
- fWriter.println(line);
- fWriter.close();
- // change rights to rwxrwxrwx
- ProcessHandler processID = new ProcessHandler(sChmod + fileName);
+// -----------------------------------------------------------------------------
+ private class OfficeMemchecker
+ {
+
+ /**
+ * After called start() it contains the memory need at startup
+ */
+ private int m_nMemoryStart;
+ /**
+ * After called stop() it contains the memory usage
+ */
+ private int m_nMemoryUsage;
+ private String m_sDocumentName;
+ private String m_sExtension;
+
+ public OfficeMemchecker()
+ {
+ m_nMemoryStart = 0;
+ }
+
+ public void setDocumentName(String _sDocName)
+ {
+ m_sDocumentName = _sDocName;
+ }
+
+ public void setExtension(String _sExt)
+ {
+ m_sExtension = _sExt;
+ }
+
+ public void start()
+ {
+ m_nMemoryStart = getOfficeMemoryUsage(createModeName("start", 0));
+ }
+
+ private String createModeName(String _sSub, int _nCount)
+ {
+ StringBuffer aBuf = new StringBuffer();
+ aBuf.append(_sSub);
+ aBuf.append('_').append(m_sDocumentName).append('_').append(m_sExtension);
+ aBuf.append('_').append(_nCount);
+ return aBuf.toString();
+ }
+
+ public void stop()
+ {
+ // short wait for the office to 'calm down' and free some memory
+ shortWait(20000);
+ // wait util memory is not freed anymore.
+ int storageAfter = getOfficeMemoryUsage(createModeName("stop", 0));
+ int mem = 0;
+ int count = 0;
+ while (storageAfter != mem && count < 10)
+ {
+ count++;
+ mem = storageAfter;
+ storageAfter = getOfficeMemoryUsage(createModeName("stop", count));
+ shortWait(1000);
+ }
+ m_nMemoryUsage = (storageAfter - m_nMemoryStart);
+ }
+
+ public int getConsumMore()
+ {
+ return m_nMemoryUsage;
+ }
+
+ /**
+ * Get the process ID from the Office
+ * @return the Id as String
+ */
+ private String getOfficeProcessID()
+ {
+ String sProcessIdCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPS");
+ final String sofficeArg = org.openoffice.test.Argument.get("soffice");
+ final String sPSGrep = "ps -ef | grep $USER | grep <soffice>.bin | grep -v grep";
+ final String sProcessId = sPSGrep.replaceAll("<soffice>", FileHelper.getJavaCompatibleFilename(sofficeArg));
+
+ createExecutableFile(sProcessIdCommand, sProcessId);
+ ProcessHandler processID = new ProcessHandler(sProcessIdCommand);
+ processID.noOutput();
+ processID.executeSynchronously();
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office process ID. Check " + sProcessIdCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this is not nice, but ps gives the same output on every machine
+ aToken.nextToken();
+ String id = aToken.nextToken();
+ return id;
+ }
+
+ /**
+ * Get the memory usage of the Office in KByte.
+ * @return The memory used by the Office.
+ */
+ private int getOfficeMemoryUsage(String _sMode)
+ {
+ final String sMemoryMonitor = "pmap <processID> |tee <pmapoutputfile> | grep total";
+ String sOfficeMemoryCommand = null;
+ sOfficeMemoryCommand = FileHelper.appendPath(m_aTempDir.getTempDir(), "getPmap");
+ // sOfficeMemoryCommand = FileHelper.getJavaCompatibleFilename(sOfficeMemoryCommand);
+ String command = sMemoryMonitor.replaceAll("<processID>", getOfficeProcessID());
+ String sPmapOutputFile = FileHelper.appendPath(m_aTempDir.getTempDir(), "pmap_" + _sMode + ".txt");
+ command = command.replaceAll("<pmapoutputfile>", sPmapOutputFile);
+ createExecutableFile(sOfficeMemoryCommand, command);
+
+ ProcessHandler processID = new ProcessHandler(sOfficeMemoryCommand);
+ processID.noOutput();
processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("Execute of " + sOfficeMemoryCommand + " failed", nError == 0);
+ String text = processID.getOutputText();
+ if (text == null || text.equals("") || text.indexOf(' ') == -1)
+ {
+ fail("Could not determine Office memory usage. Check " + sOfficeMemoryCommand);
+ }
+ StringTokenizer aToken = new StringTokenizer(text);
+ // this works, because the output of pmap is quite standardized.
+ aToken.nextToken();
+ String mem = aToken.nextToken();
+ mem = mem.substring(0, mem.indexOf('K'));
+ Integer memory = new Integer(mem);
+ return memory.intValue();
}
- catch(java.io.IOException e) {
+
+ /**
+ * Write a script file and set its rights to rwxrwxrwx.
+ * @param fileName The name of the created file
+ * @param line The commandline that has to be written inside of the file.
+ */
+ private void createExecutableFile(String fileName, String line)
+ {
+ final String sChmod = "chmod a+x ";
+ final String bash = "#!/bin/bash";
+
+ try
+ {
+ String sFilename = FileHelper.getJavaCompatibleFilename(fileName);
+ PrintWriter fWriter = new PrintWriter(new FileWriter(sFilename));
+ fWriter.println(bash);
+ fWriter.println(line);
+ fWriter.close();
+ // change rights to rwxrwxrwx
+ ProcessHandler processID = new ProcessHandler(sChmod + sFilename);
+ processID.noOutput();
+ processID.executeSynchronously();
+ int nError = processID.getExitCode();
+ assertTrue("chmod failed. ", nError == 0);
+ }
+ catch (java.io.IOException e)
+ {
+ }
}
}
@@ -304,11 +540,15 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Let this thread sleep for some time
* @param milliSeconds time to wait in milliseconds.
*/
- private void shortWait(int milliSeconds) {
- try {
+ public static void shortWait(int milliSeconds)
+ {
+ System.out.println("Wait for: " + milliSeconds + "ms");
+ try
+ {
Thread.sleep(milliSeconds);
}
- catch(java.lang.InterruptedException e) { // ignore
+ catch (java.lang.InterruptedException e)
+ { // ignore
}
}
@@ -316,15 +556,20 @@ public class CheckMemoryUsage extends ComplexTestCase {
* Own file filter, will just return ok for all files that end with a given
* suffix
*/
- private class FileFilter implements FilenameFilter {
+ private class FileFilter implements FilenameFilter
+ {
+
private String suffix = null;
+
/**
* C'tor.
* @param suffix The suffix each filename should end with.
*/
- public FileFilter(String suffix) {
+ public FileFilter(String suffix)
+ {
this.suffix = suffix;
}
+
/**
* Returns true, if the name of the file has the suffix given to the
* c'tor.
@@ -332,9 +577,32 @@ public class CheckMemoryUsage extends ComplexTestCase {
* @param file Not used.
* @return True, if name ends with suffix.
*/
- public boolean accept(File file, String name) {
+ public boolean accept(File file, String name)
+ {
return name.endsWith(suffix);
}
- };
+ }
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+ // setup and close connections
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/vcl/qa/complex/memCheck/FileHelper.java b/vcl/qa/complex/memCheck/FileHelper.java
new file mode 100644
index 000000000000..21ce46185b4a
--- /dev/null
+++ b/vcl/qa/complex/memCheck/FileHelper.java
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+
+/**
+ *
+ * @author ll93751
+ */
+public class FileHelper
+{
+ public static String appendPath(String _sPath, String _sRelativePathToAdd)
+ {
+ String sNewPath = _sPath;
+ String fs = System.getProperty("file.separator");
+ if (_sPath.startsWith("file:"))
+ {
+ fs = "/"; // we use a file URL so only '/' is allowed.
+ }
+ if (! (sNewPath.endsWith("/") || sNewPath.endsWith("\\") ) )
+ {
+ sNewPath += fs;
+ }
+ sNewPath += _sRelativePathToAdd;
+ return sNewPath;
+ }
+ public static String getJavaCompatibleFilename(String _sFilename)
+ {
+ // It is a little bit stupid that office urls not compatible to java file urls
+ // System.out.println("java.io.File can't access Office file urls.");
+ if(_sFilename.startsWith("path:"))
+ {
+ final String sPath = _sFilename.substring(5);
+ return sPath;
+ }
+
+ String sSystemPath = graphical.FileHelper.getSystemPathFromFileURL(_sFilename);
+ if (sSystemPath == null)
+ {
+ sSystemPath = _sFilename;
+ }
+ return sSystemPath;
+ }
+
+public static String getBasename(String _sFilename)
+ {
+ if (_sFilename == null)
+ {
+ return "";
+ }
+ // String fs = System.getProperty("file.separator");
+
+ int nIdx = _sFilename.lastIndexOf("\\");
+ if (nIdx == -1)
+ {
+ nIdx = _sFilename.lastIndexOf("/");
+ }
+ if (nIdx > 0)
+ {
+ return _sFilename.substring(nIdx + 1);
+ }
+ return _sFilename;
+ }
+}
diff --git a/vcl/qa/complex/memCheck/TestDocument.java b/vcl/qa/complex/memCheck/TestDocument.java
new file mode 100644
index 000000000000..8ca9f7b71192
--- /dev/null
+++ b/vcl/qa/complex/memCheck/TestDocument.java
@@ -0,0 +1,45 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package complex.memCheck;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument
+{
+ final static String sPathname = "testdocuments";
+ public static String getUrl(String name)
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname, name));
+ }
+ public static String getUrl()
+ {
+ return OfficeFileUrl.getAbsolute(new File(sPathname));
+ }
+ private TestDocument() {}
+}
diff --git a/vcl/qa/complex/memCheck/makefile.mk b/vcl/qa/complex/memCheck/makefile.mk
index d1d4b5c08c98..4a809e71e50e 100755
--- a/vcl/qa/complex/memCheck/makefile.mk
+++ b/vcl/qa/complex/memCheck/makefile.mk
@@ -25,65 +25,107 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = MemoryCheck
-PRJNAME = $(TARGET)
-PACKAGE = complex$/memCheck
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = CheckMemoryUsage.java
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Parameters for the test --------------------------------------
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_memCheck
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
-.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand \
- "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/memCheck
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ CheckMemoryUsage.java
-# replace $/ with . in package name
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ FileHelper.java \
+ TestDocument.java
-# start the runner application
-CT_APP = org.openoffice.Runner
-# --- Targets ------------------------------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.IF "$(depend)" == ""
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ELSE
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
-.ENDIF
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.INCLUDE : target.mk
+.END
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+ALLTAR : javatest
-$(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
- cp $(@:f) $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+.END
-RUN: run
-run:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
+#
+#
+#
+# PRJ = ..$/..$/..
+# TARGET = MemoryCheck
+# PRJNAME = $(TARGET)
+# PACKAGE = complex$/memCheck
+#
+# # --- Settings -----------------------------------------------------
+# .INCLUDE: settings.mk
+#
+#
+# #----- compile .java files -----------------------------------------
+#
+# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+# JAVAFILES = CheckMemoryUsage.java
+#
+# #----- make a jar from compiled files ------------------------------
+#
+# MAXLINELENGTH = 100000
+#
+# JARCLASSDIRS = $(PACKAGE)
+# JARTARGET = $(TARGET).jar
+# JARCOMPRESS = TRUE
+#
+# # --- Parameters for the test --------------------------------------
+#
+# # start an office if the parameter is set for the makefile
+# .IF "$(OFFICE)" == ""
+# CT_APPEXECCOMMAND =
+# .ELSE
+# CT_APPEXECCOMMAND = -AppExecutionCommand \
+# "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+# .ENDIF
+#
+# # test base is java complex
+# CT_TESTBASE = -TestBase java_complex
+#
+# # replace $/ with . in package name
+# CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
+#
+# # start the runner application
+# CT_APP = org.openoffice.Runner
+#
+# # --- Targets ------------------------------------------------------
+#
+# .IF "$(depend)" == ""
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ELSE
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : ALLTAR
+# .ENDIF
+#
+# .INCLUDE : target.mk
+#
+#
+#
+# $(CLASSDIR)$/$(PACKAGE)$/CheckMemoryUsage.props : CheckMemoryUsage.props
+# cp $(@:f) $@
+# jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(@:f)
+#
+#
+# RUN: run
+#
+# run:
+# java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckMemoryUsage
diff --git a/vcl/qa/testdocuments/CalcDoc.sxc b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
index 4b2b572085dc..4b2b572085dc 100755
--- a/vcl/qa/testdocuments/CalcDoc.sxc
+++ b/vcl/qa/complex/memCheck/testdocuments/CalcDoc.sxc
Binary files differ
diff --git a/vcl/qa/testdocuments/ImpressDoc.sxi b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
index efcdf9b6a25e..efcdf9b6a25e 100755
--- a/vcl/qa/testdocuments/ImpressDoc.sxi
+++ b/vcl/qa/complex/memCheck/testdocuments/ImpressDoc.sxi
Binary files differ
diff --git a/vcl/qa/testdocuments/WriterDoc.sxw b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
index 1b2c2cb2dab6..1b2c2cb2dab6 100755
--- a/vcl/qa/testdocuments/WriterDoc.sxw
+++ b/vcl/qa/complex/memCheck/testdocuments/WriterDoc.sxw
Binary files differ
diff --git a/vcl/qa/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
index 0b32eaaeff51..ea28c41f65f7 100644
--- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java
+++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java
@@ -34,13 +34,9 @@ import com.sun.star.lang.XComponent;
import com.sun.star.awt.XWindow;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.PropertyState;
-import com.sun.star.frame.XController;
-import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XFrame;
import com.sun.star.frame.FrameSearchFlag;
-import com.sun.star.frame.XFramesSupplier;
import helper.WindowListener;
/**
@@ -59,7 +55,7 @@ public class DocumentHandle {
/**
* Constructor
- * @param xComponentLoader A loader to load a document
+ * @param xCompLoader A loader to load a document
*/
public DocumentHandle(XComponentLoader xCompLoader) {
this.xCompLoader = xCompLoader;
@@ -71,6 +67,7 @@ public class DocumentHandle {
* @param docName The name of a document as file URL
* @param hidden If true, the document is loaded hidden.
* @return The size of the opened/created document.
+ * @throws Exception
*/
public Rectangle loadDocument(String docName, boolean hidden)
throws Exception{
@@ -91,13 +88,13 @@ public class DocumentHandle {
}
// get the current active window
- XFrame xCurFrame = (XFrame)UnoRuntime.queryInterface(XFrame.class, xCompLoader);
+ XFrame xCurFrame = UnoRuntime.queryInterface(XFrame.class, xCompLoader);
// create a new frame
XFrame xFrame = xCurFrame.findFrame("_blank", FrameSearchFlag.CREATE);
// load document in this frame
- XComponentLoader xFrameLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
+ XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame);
xComp = xFrameLoader.loadComponentFromURL(
docName, "_self", 0, szArgs);
// wait for the document to load.
diff --git a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
index edceeeafd883..898324504b4e 100644
--- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
+++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java
@@ -26,31 +26,27 @@
************************************************************************/
package complex.persistent_window_states;
-
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.uno.Type;
import com.sun.star.uno.Any;
-import com.sun.star.lang.XTypeProvider;
-import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XComponent;
-import com.sun.star.frame.XDesktop;
import com.sun.star.frame.XFramesSupplier;
import com.sun.star.frame.XFrames;
-import com.sun.star.registry.XRegistryKey;
-import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.container.XIndexAccess;
-import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.awt.Rectangle;
import com.sun.star.util.XCloseable;
import helper.ConfigurationRead;
-import complexlib.ComplexTestCase;
-import helper.OfficeProvider;
-import complex.persistent_window_states.DocumentHandle;
+
+
+
+// import org.junit.After;
+import org.junit.AfterClass;
+// import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Parameters:
@@ -58,10 +54,11 @@ import complex.persistent_window_states.DocumentHandle;
* <li>NoOffice=yes - StarOffice is not started initially.</li>
* </ul>
*/
-public class PersistentWindowTest extends ComplexTestCase {
+public class PersistentWindowTest
+{
- private XMultiServiceFactory xMSF;
- private OfficeProvider oProvider;
+ // private XMultiServiceFactory xMSF;
+// private OfficeProvider oProvider;
private int iOfficeCloseTime = 0;
/**
@@ -69,9 +66,18 @@ public class PersistentWindowTest extends ComplexTestCase {
* Right now, it's only 'checkPersistentWindowState'.
* @return All test methods.
*/
- public String[] getTestMethodNames() {
- return new String[]{"checkPersistentWindowState"};
- }
+// public String[] getTestMethodNames()
+// {
+// return new String[]
+// {
+// "checkPersistentWindowState"
+// };
+// }
+
+ /**
+ * The test parameters
+ */
+ // private static TestParameters param = null;
/**
* Test if all available document types change the
@@ -94,42 +100,32 @@ public class PersistentWindowTest extends ComplexTestCase {
* - close office
* - Test finished
*/
- public void checkPersistentWindowState()
+ @Test public void checkPersistentWindowState()
{
- try {
-
- log.println("Connect the first time.");
- log.println("AppExecCommand: " + (String)param.get("AppExecutionCommand"));
- log.println("ConnString: " + (String)param.get("ConnectionString"));
- oProvider = new OfficeProvider();
- iOfficeCloseTime = param.getInt("OfficeCloseTime");
- if ( iOfficeCloseTime == 0 ) {
- iOfficeCloseTime = 1000;
- }
+ // final XMultiServiceFactory xMsf = getMSF();
- if (!connect()) return;
+ // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
+// param = new TestParameters();
+// param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
- // create the configuration provider
- Object o = null;
- try {
- o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
- }
- catch(com.sun.star.uno.Exception e) {
- failed("Cannot create \"com.sun.star.configuration."+
- "ConfigurationProvider\"");
- return;
- }
+ try
+ {
- // fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ // At first we are already connected
+ // if (!connect())
+ // {
+ // return;
+ // }
- // create the configuration reader
- ConfigurationRead cfgRead = new ConfigurationRead(xCP);
+ // fetch the multi service factory for setup
+ // XMultiServiceFactory xCP = getMSF();
+
+ // create the configuration reader
+ // ConfigurationRead cfgRead = new ConfigurationRead(xCP);
- // just test the wrong ones, not all.
- String [] els = new String[]{
+ // just test the wrong ones, not all.
+ String[] els = new String[]
+ {
"Office/Factories/com.sun.star.drawing.DrawingDocument",
"Office/Factories/com.sun.star.formula.FormulaProperties",
//"Office/Factories/com.sun.star.presentation.PresentationDocument",
@@ -138,92 +134,98 @@ public class PersistentWindowTest extends ComplexTestCase {
"Office/Factories/com.sun.star.text.TextDocument",
"Office/Factories/com.sun.star.text.WebDocument",
};
- // uncomment the following line for all doc types
-// String [] els = cfgRead.getSubNodeNames("Office/Factories");
-
- log.println("Found "+ els.length + " document types to test.\n");
- if (!disconnect()) return;
-
- // for all types
- for(int i=0; i<els.length; i++) {
- log.println("\tStart test for document type " + i + ": " + els[i]);
- // exclude chart documents: cannot be created this way.
- if ( els[i].indexOf("ChartDocument") != -1) {
- log.println("Skipping chart document: cannot be create like this.");
- continue;
- }
+ // uncomment the following line for all doc types
+ // String [] els = cfgRead.getSubNodeNames("Office/Factories");
+
+ System.out.println("Found " + els.length + " document types to test.\n");
+ disconnect();
+
+ // for all types
+ for (int i = 0; i < els.length; i++)
+ {
+ System.out.println("\tStart test for document type " + i + ": " + els[i]);
+ // exclude chart documents: cannot be created this way.
+ if (els[i].indexOf("ChartDocument") != -1)
+ {
+ System.out.println("Skipping chart document: cannot be create like this.");
+ continue;
+ }
- // start an office
- if (!connect()) return;
+ // start an office
+ connect();
- // get configuration
- String[] settings = getConfigurationAndLoader(xMSF, els[i]);
- if (settings == null) {
- log.println("Skipping document type " + els[i]);
- disconnect();
- continue;
- }
- String cfg = settings[1];
+ // get configuration
+ String[] settings = getConfigurationAndLoader(getMSF(), els[i]);
+ if (settings == null)
+ {
+ System.out.println("Skipping document type " + els[i]);
+ disconnect();
+ continue;
+ }
+ String cfg = settings[1];
- // load a document
- DocumentHandle handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ DocumentHandle handle = loadDocument(getMSF(), settings[0]);
- // first size
- Rectangle rect1 = handle.getDocumentPosSize();
+ // first size
+ Rectangle rect1 = handle.getDocumentPosSize();
- // resize
- handle.resizeDocument();
- // after resize
- Rectangle rect2 = handle.getDocumentPosSize();
+ // resize
+ handle.resizeDocument();
+ // after resize
+ Rectangle rect2 = handle.getDocumentPosSize();
- // disposeManager and start a new office
- if (!disconnect()) return;
+ // disposeManager and start a new office
+ disconnect();
- if (!connect()) return;
+ connect();
- // get configuration
- settings = getConfigurationAndLoader(xMSF, els[i]);
+ // get configuration
+ settings = getConfigurationAndLoader(getMSF(), els[i]);
- String newCfg = settings[1];
+ String newCfg = settings[1];
- // load a document
- handle = loadDocument(xMSF, settings[0]);
+ // load a document
+ handle = loadDocument(getMSF(), settings[0]);
- Rectangle newRect = handle.getDocumentPosSize();
+ Rectangle newRect = handle.getDocumentPosSize();
- // print the settings and window sizes
- log.println("----------------------------");
- log.println("Initial Config String : " + cfg);
- log.println("Config String after restart: " + newCfg);
+ // print the settings and window sizes
+ System.out.println("----------------------------");
+ System.out.println("Initial Config String : " + cfg);
+ System.out.println("Config String after restart: " + newCfg);
- log.println("----------------------------");
- log.println("Initial window (X,Y,Width,Height): "
- +rect1.X+";"+rect1.Y+";"+ rect1.Width+";"+rect1.Height);
- log.println("Window after resize (X,Y,Width,Height): "
- +rect2.X+";"+rect2.Y+";"+ rect2.Width+";"+rect2.Height);
- log.println("Window after restart (X,Y,Width,Height): "
- +newRect.X+";"+newRect.Y+";"+newRect.Width+";"
- +newRect.Height);
+ System.out.println("----------------------------");
+ System.out.println("Initial window (X,Y,Width,Height): "
+ + rect1.X + ";" + rect1.Y + ";" + rect1.Width + ";" + rect1.Height);
+ System.out.println("Window after resize (X,Y,Width,Height): "
+ + rect2.X + ";" + rect2.Y + ";" + rect2.Width + ";" + rect2.Height);
+ System.out.println("Window after restart (X,Y,Width,Height): "
+ + newRect.X + ";" + newRect.Y + ";" + newRect.Width + ";"
+ + newRect.Height);
- // compare to see if resize worked
- log.println("----------------------------");
- assure("Resize values for "+ els[i] +
- " are equal.", !compareRectangles(rect1, rect2), true);
- // compare settings and sizes
- assure("Config settings for "+ els[i] +
- " were not changed.", !cfg.equals(newCfg), true);
- assure("Resized and restarted window for "+ els[i] +
- " are not equal.", compareRectangles(rect2, newRect), true);
- log.println("----------------------------");
+ // compare to see if resize worked
+ System.out.println("----------------------------");
+ if (els[i].indexOf("SpreadsheetDocument") == -1 &&
+ els[i].indexOf("DrawingDocument") == -1)
+ {
+ // leave out Spreadsheet- and DrawingDocumnt
+ assertTrue("Resize values for " + els[i] + " are equal.", !compareRectangles(rect1, rect2));
+ }
+ // compare settings and sizes
+ assertTrue("Config settings for " + els[i] + " were not changed.", !cfg.equals(newCfg));
+ assertTrue("Resized and restarted window for " + els[i] + " are not equal.", compareRectangles(rect2, newRect));
+ System.out.println("----------------------------");
- // disposeManager
- if (!disconnect()) return;
+ // disposeManager
+ disconnect();
- log.println("\tFinish test for document type " + i + ": " + els[i]);
+ System.out.println("\tFinish test for document type " + i + ": " + els[i]);
+ }
}
- }
- catch(Exception e) {
+ catch (Exception e)
+ {
e.printStackTrace();
}
}
@@ -235,16 +237,17 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return Settings and Loader
*/
private static String[] getConfigurationAndLoader(XMultiServiceFactory xMSF,
- String cfgString) {
+ String cfgString)
+ {
String[] conf = new String[2];
- try {
+ try
+ {
Object o = xMSF.createInstance(
- "com.sun.star.configuration.ConfigurationProvider");
+ "com.sun.star.configuration.ConfigurationProvider");
// fetch the multi service factory for setup
- XMultiServiceFactory xCP = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
+ XMultiServiceFactory xCP = UnoRuntime.queryInterface(XMultiServiceFactory.class, o);
// create the configuration reader
ConfigurationRead cfgRead = new ConfigurationRead(xCP);
@@ -253,22 +256,28 @@ public class PersistentWindowTest extends ComplexTestCase {
String loader = getStringFromObject(
cfgRead.getByHierarchicalName(cfgString + "/ooSetupFactoryEmptyDocumentURL"));
- if (loader == null) return null;
- log.println("\tLoader: " + loader);
+ if (loader == null)
+ {
+ return null;
+ }
+ System.out.println("\tLoader: " + loader);
// read attributes
String hierchName = cfgString + "/ooSetupFactoryWindowAttributes";
String setupSettings = getStringFromObject(cfgRead.getByHierarchicalName(hierchName));
// remove slots: just plain document types have to start
- if ( loader.indexOf("?slot") != -1 ) {
+ if (loader.indexOf("?slot") != -1)
+ {
loader = loader.substring(0, loader.indexOf("?slot"));
- System.out.println("Loader: "+loader);
+ System.out.println("Loader: " + loader);
}
conf[0] = loader;
conf[1] = setupSettings;
}
- catch(com.sun.star.uno.Exception e) {}
+ catch (com.sun.star.uno.Exception e)
+ {
+ }
return conf;
}
@@ -279,97 +288,105 @@ public class PersistentWindowTest extends ComplexTestCase {
* @return A handle to the document
*/
private DocumentHandle loadDocument(XMultiServiceFactory xMSF,
- String docLoader) {
+ String docLoader)
+ {
DocumentHandle docHandle = null;
- try {
+ try
+ {
// create component loaader
- XComponentLoader xCompLoader = (XComponentLoader)
- UnoRuntime.queryInterface(
- XComponentLoader.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- XFramesSupplier xFrameSupp = (XFramesSupplier)UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
+ XComponentLoader xCompLoader = UnoRuntime.queryInterface(XComponentLoader.class, xMSF.createInstance("com.sun.star.frame.Desktop"));
+ XFramesSupplier xFrameSupp = UnoRuntime.queryInterface(XFramesSupplier.class, xCompLoader);
// close all existing frames
XFrames xFrames = xFrameSupp.getFrames();
- XIndexAccess xAcc = (XIndexAccess)UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
- for ( int i=0; i<xAcc.getCount(); i++ ) {
- XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
- try {
- if ( xClose != null ) {
+ XIndexAccess xAcc = UnoRuntime.queryInterface(XIndexAccess.class, xFrames);
+ for (int i = 0; i < xAcc.getCount(); i++)
+ {
+ XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xAcc.getByIndex(i));
+ try
+ {
+ if (xClose != null)
+ {
xClose.close(false);
}
- else {
- failed("Could not query frame for XCloseable!");
+ else
+ {
+ fail("Could not query frame for XCloseable!");
}
}
- catch( com.sun.star.uno.Exception e ) {
- e.printStackTrace((java.io.PrintWriter)log);
- failed("Could not query frame for XCloseable!");
+ catch (com.sun.star.uno.Exception e)
+ {
+ e.printStackTrace();
+ fail("Could not query frame for XCloseable!");
}
}
docHandle = new DocumentHandle(xCompLoader);
docHandle.loadDocument(docLoader, false);
}
- catch(com.sun.star.uno.Exception e) {
+ catch (com.sun.star.uno.Exception e)
+ {
e.printStackTrace();
}
- catch(java.lang.Exception e) {
+ catch (java.lang.Exception e)
+ {
e.printStackTrace();
}
return docHandle;
}
- private boolean connect() {
- try {
- xMSF = (XMultiServiceFactory)oProvider.getManager(param);
- try {
- Thread.sleep(10000);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean connect()
+ {
+ try
+ {
+ connection.setUp();
+ }
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't connect.");
}
- catch (java.lang.Exception e) {
- log.println(e.getClass().getName());
- log.println("Message: " + e.getMessage());
- failed("Cannot connect the Office.");
- return false;
+ catch (Exception e)
+ {
+ fail("can't connect.");
}
return true;
}
- private boolean disconnect() {
- try {
- XDesktop desk = null;
- desk = (XDesktop) UnoRuntime.queryInterface(
- XDesktop.class, xMSF.createInstance(
- "com.sun.star.frame.Desktop"));
- xMSF = null;
- desk.terminate();
- log.println("Waiting " + iOfficeCloseTime + " milliseconds for the Office to close down");
- try {
- Thread.sleep(iOfficeCloseTime);
- }
- catch(java.lang.InterruptedException e) {}
+ private boolean disconnect()
+ {
+ try
+ {
+ connection.tearDown();
}
- catch (java.lang.Exception e) {
- e.printStackTrace();
- failed("Cannot dispose the Office.");
- return false;
+ catch (java.lang.InterruptedException e)
+ {
+ fail("can't disconnect.");
+ }
+ catch (Exception e)
+ {
+ fail("can't disconnect.");
}
return true;
}
- private static String getStringFromObject(Object oName) {
+ private static String getStringFromObject(Object oName)
+ {
if (oName instanceof String)
- return (String)oName;
+ {
+ return (String) oName;
+ }
String value = null;
- if (oName instanceof Any) {
- try {
+ if (oName instanceof Any)
+ {
+ try
+ {
value = AnyConverter.toString(oName);
- if (value == null) {
- log.println("Got a void css.uno.Any as loading string.");
+ if (value == null)
+ {
+ System.out.println("Got a void css.uno.Any as loading string.");
}
}
- catch(Exception e) {
- log.println("This document type cannot be opened directly.");
+ catch (Exception e)
+ {
+ System.out.println("This document type cannot be opened directly.");
}
}
return value;
@@ -382,12 +399,37 @@ public class PersistentWindowTest extends ComplexTestCase {
* @param rect2 Second Rectangle.
* @return True, if the rectangles are equal.
*/
- private boolean compareRectangles(Rectangle rect1, Rectangle rect2) {
+ private boolean compareRectangles(Rectangle rect1, Rectangle rect2)
+ {
boolean result = true;
- result &= (rect1.X==rect2.X);
- result &= (rect1.Y==rect2.Y);
- result &= (rect1.Width==rect2.Width);
- result &= (rect1.Height==rect2.Height);
+ result &= (rect1.X == rect2.X);
+ result &= (rect1.Y == rect2.Y);
+ result &= (rect1.Width == rect2.Width);
+ result &= (rect1.Height == rect2.Height);
return result;
}
+
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
}
diff --git a/vcl/qa/complex/persistent_window_states/makefile.mk b/vcl/qa/complex/persistent_window_states/makefile.mk
index 4c61d8969b8d..e4d9f6b514a0 100644
--- a/vcl/qa/complex/persistent_window_states/makefile.mk
+++ b/vcl/qa/complex/persistent_window_states/makefile.mk
@@ -24,58 +24,44 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJ = ..$/..$/..
-TARGET = PersistentWindowTest
-PRJNAME = $(TARGET)
-PACKAGE = complex$/persistent_window_states
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
+PRJ = ../../..
+PRJNAME = vcl
+TARGET = qa_complex_persistent_window_states
-#----- compile .java files -----------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/persistent_window_states
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = PersistentWindowTest.java DocumentHandle.java
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ PersistentWindowTest.java
-#----- make a jar from compiled files ------------------------------
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+DocumentHandle.java
-MAXLINELENGTH = 100000
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-# --- Parameters for the test --------------------------------------
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
+.END
-# test looks something like the.full.package.TestName
-CT_TEST = -o $(PACKAGE:s\$/\.\).$(TARGET)
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-# start the runner application
-CT_APP = org.openoffice.Runner
+ALLTAR : javatest
-# --- Targets ------------------------------------------------------
+.END
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : ALLTAR
-.INCLUDE : target.mk
-$(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props : $(TARGET).props
- cp $(TARGET).props $@
- jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(TARGET).props
-RUN: run
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-run:
- @echo "Execute this test with 'dmake run OFFICE=/system/path/to/office/program'."
- @echo "The office will be started by the test with a socket connection on port 8100"
-.ELSE
-run: $(CLASSDIR)$/$(PACKAGE)$/$(TARGET).props
- java -cp $(CLASSPATH) $(CT_APP) -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" $(CT_TESTBASE) $(CT_TEST)
-.ENDIF
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index cee78645b9f2..727911db36bd 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -38,32 +38,33 @@
#include <cmath>
#include <limits.h>
-#include <vcl/svdata.hxx>
-#include <svsys.h>
+#include "vcl/svdata.hxx"
+#include "svsys.h"
#ifdef WNT
#undef min
#endif
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/event.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/threadex.hxx>
-#include <vcl/dbggui.hxx>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
-
-#include <vcl/unohelp.hxx>
-#include <vcl/unohelp2.hxx>
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/event.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/button.hxx"
+#include "vcl/edit.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/group.hxx"
+#include "vcl/field.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/sound.hxx"
+#include "vcl/threadex.hxx"
+#include "vcl/dbggui.hxx"
+#include "com/sun/star/i18n/XCharacterClassification.hpp"
+
+#include "vcl/unohelp.hxx"
+#include "vcl/unohelp2.hxx"
#include <osl/mutex.hxx>
+#include "vcl/salinst.hxx"
#include <map>
#include <algorithm>
@@ -411,7 +412,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"char& String::operator [] ( USHORT nIndex )\n",
+"char& String::operator [] ( sal_uInt16 nIndex )\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_ASSERT( nIndex <= pData->nLen, \"String::[] : nIndex > Len\" );\n",
@@ -419,7 +420,7 @@ static const sal_Char* pDbgHelpText[] =
" //...\n",
"}\n",
"\n",
-"USHORT String::Search( const String& rStr, USHORT nIndex ) const\n",
+"sal_uInt16 String::Search( const String& rStr, sal_uInt16 nIndex ) const\n",
"{\n",
" DBG_CHKTHIS( String, DbgCheckString );\n",
" DBG_CHKOBJ( &rStr, String, DbgCheckString );\n",
@@ -451,19 +452,19 @@ namespace
++channel
)
{
- USHORT nEntryPos = rList.InsertEntry( channel->first );
+ sal_uInt16 nEntryPos = rList.InsertEntry( channel->first );
rList.SetEntryData( nEntryPos, reinterpret_cast< void* >( channel->second ) );
}
}
// -------------------------------------------------------------------
- void ImplSelectChannel( ListBox& rList, ULONG nChannelToSelect, USHORT nPositionOffset )
+ void ImplSelectChannel( ListBox& rList, sal_uLong nChannelToSelect, sal_uInt16 nPositionOffset )
{
if ( nChannelToSelect < DBG_OUT_USER_CHANNEL_0 )
- rList.SelectEntryPos( (USHORT)( nChannelToSelect - nPositionOffset ) );
+ rList.SelectEntryPos( (sal_uInt16)( nChannelToSelect - nPositionOffset ) );
else
{
- for ( USHORT pos = 0; pos < rList.GetEntryCount(); ++pos )
+ for ( sal_uInt16 pos = 0; pos < rList.GetEntryCount(); ++pos )
{
DbgChannelId nChannelId = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( pos )) );
if ( nChannelId == nChannelToSelect )
@@ -475,9 +476,9 @@ namespace
}
}
// -------------------------------------------------------------------
- DbgChannelId ImplGetChannelId( const ListBox& rList, USHORT nPositionOffset )
+ DbgChannelId ImplGetChannelId( const ListBox& rList, sal_uInt16 nPositionOffset )
{
- USHORT nSelectedChannelPos = rList.GetSelectEntryPos();
+ sal_uInt16 nSelectedChannelPos = rList.GetSelectEntryPos();
DbgChannelId nSelectedChannel = static_cast< DbgChannelId >( reinterpret_cast<sal_IntPtr>(rList.GetEntryData( nSelectedChannelPos )) );
if ( nSelectedChannel == 0)
return (DbgChannelId)( nSelectedChannelPos + nPositionOffset );
@@ -501,14 +502,14 @@ private:
public:
DbgWindow();
- virtual BOOL Close();
+ virtual sal_Bool Close();
virtual void Resize();
virtual long PreNotify( NotifyEvent& rNEvt );
void InsertLine( const XubString& rLine );
void Update() { WorkWindow::Update(); maLstBox.Update(); }
private:
- void GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast );
+ void GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast );
};
// -----------------
@@ -520,10 +521,10 @@ class DbgInfoDialog : public ModalDialog
private:
ListBox maListBox;
OKButton maOKButton;
- BOOL mbHelpText;
+ sal_Bool mbHelpText;
public:
- DbgInfoDialog( Window* pParent, BOOL bHelpText = FALSE );
+ DbgInfoDialog( Window* pParent, sal_Bool bHelpText = sal_False );
void SetInfoText( const XubString& rStr );
};
@@ -582,7 +583,7 @@ private:
CancelButton maCancelButton;
PushButton maInfoButton;
HelpButton maHelpButton;
- USHORT mnErrorOff;
+ sal_uInt16 mnErrorOff;
public:
DbgDialog();
@@ -621,7 +622,7 @@ DbgWindow::DbgWindow() :
// -----------------------------------------------------------------------
-BOOL DbgWindow::Close()
+sal_Bool DbgWindow::Close()
{
// remember window position
ByteString aState( GetWindowState() );
@@ -636,7 +637,7 @@ BOOL DbgWindow::Close()
delete this;
ImplGetSVData()->maWinData.mpDbgWin = NULL;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -648,7 +649,7 @@ void DbgWindow::Resize()
// -----------------------------------------------------------------------
-void DbgWindow::GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst, USHORT& nLast )
+void DbgWindow::GetAssertionEntryRange( sal_uInt16 nInbetweenEntry, sal_uInt16& nFirst, sal_uInt16& nLast )
{
nFirst = nInbetweenEntry;
while ( nFirst > 0 )
@@ -657,7 +658,7 @@ void DbgWindow::GetAssertionEntryRange( USHORT nInbetweenEntry, USHORT& nFirst,
break;
--nFirst;
}
- USHORT nEntryCount = maLstBox.GetEntryCount();
+ sal_uInt16 nEntryCount = maLstBox.GetEntryCount();
nLast = nInbetweenEntry + 1;
while ( nLast < nEntryCount )
{
@@ -689,12 +690,12 @@ long DbgWindow::PreNotify( NotifyEvent& rNEvt )
Rectangle aEntryRect( maLstBox.GetBoundingRectangle( maLstBox.GetSelectEntryPos() ) );
aPos = aEntryRect.Center();
}
- USHORT nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
+ sal_uInt16 nSelected = aMenu.Execute( rNEvt.GetWindow(), aPos );
if ( nSelected == 1 )
{
// search all entries which belong to this assertion
- USHORT nAssertionFirst = 0;
- USHORT nAssertionLast = 0;
+ sal_uInt16 nAssertionFirst = 0;
+ sal_uInt16 nAssertionLast = 0;
GetAssertionEntryRange( maLstBox.GetSelectEntryPos(), nAssertionFirst, nAssertionLast );
// build the string to copy to the clipboard
@@ -723,23 +724,23 @@ void DbgWindow::InsertLine( const XubString& rLine )
XubString aStr = rLine;
aStr.ConvertLineEnd( LINEEND_LF );
xub_StrLen nPos = aStr.Search( _LF );
- BOOL bFirstEntry = TRUE;
+ sal_Bool bFirstEntry = sal_True;
while ( nPos != STRING_NOTFOUND )
{
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- USHORT nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
+ sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr.Copy( 0, nPos ) );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
- bFirstEntry = FALSE;
+ bFirstEntry = sal_False;
aStr.Erase( 0, nPos+1 );
nPos = aStr.Search( _LF );
}
if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES )
maLstBox.RemoveEntry( 0 );
- USHORT nInsertionPos = maLstBox.InsertEntry( aStr );
+ sal_uInt16 nInsertionPos = maLstBox.InsertEntry( aStr );
if ( bFirstEntry )
maLstBox.SetEntryData( nInsertionPos, reinterpret_cast< void* >( 0x00000001 ) );
maLstBox.SetTopEntry( DBGWIN_MAXLINES-1 );
@@ -802,7 +803,7 @@ DbgDialog::DbgDialog() :
maXtorThis.Show();
maXtorThis.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "T~his" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_THIS )
- maXtorThis.Check( TRUE );
+ maXtorThis.Check( sal_True );
maXtorThis.SetPosSizePixel( LogicToPixel( Point( 10, 15 ), aAppMap ),
aButtonSize );
}
@@ -811,7 +812,7 @@ DbgDialog::DbgDialog() :
maXtorFunc.Show();
maXtorFunc.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Function" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_FUNC )
- maXtorFunc.Check( TRUE );
+ maXtorFunc.Check( sal_True );
maXtorFunc.SetPosSizePixel( LogicToPixel( Point( 75, 15 ), aAppMap ),
aButtonSize );
}
@@ -820,7 +821,7 @@ DbgDialog::DbgDialog() :
maXtorExit.Show();
maXtorExit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "E~xit" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_EXIT )
- maXtorExit.Check( TRUE );
+ maXtorExit.Check( sal_True );
maXtorExit.SetPosSizePixel( LogicToPixel( Point( 140, 15 ), aAppMap ),
aButtonSize );
}
@@ -829,7 +830,7 @@ DbgDialog::DbgDialog() :
maXtorReport.Show();
maXtorReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_REPORT )
- maXtorReport.Check( TRUE );
+ maXtorReport.Check( sal_True );
maXtorReport.SetPosSizePixel( LogicToPixel( Point( 205, 15 ), aAppMap ),
aButtonSize );
}
@@ -838,7 +839,7 @@ DbgDialog::DbgDialog() :
maXtorTrace.Show();
maXtorTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_XTOR_TRACE )
- maXtorTrace.Check( TRUE );
+ maXtorTrace.Check( sal_True );
maXtorTrace.SetPosSizePixel( LogicToPixel( Point( 270, 15 ), aAppMap ),
aButtonSize );
}
@@ -854,7 +855,7 @@ DbgDialog::DbgDialog() :
maMemInit.Show();
maMemInit.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Initialize" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_INIT )
- maMemInit.Check( TRUE );
+ maMemInit.Check( sal_True );
maMemInit.SetPosSizePixel( LogicToPixel( Point( 10, 50 ), aAppMap ),
aButtonSize );
}
@@ -863,7 +864,7 @@ DbgDialog::DbgDialog() :
maMemOverwrite.Show();
maMemOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Overwrite" )) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITE )
- maMemOverwrite.Check( TRUE );
+ maMemOverwrite.Check( sal_True );
maMemOverwrite.SetPosSizePixel( LogicToPixel( Point( 75, 50 ), aAppMap ),
aButtonSize );
}
@@ -872,7 +873,7 @@ DbgDialog::DbgDialog() :
maMemOverwriteFree.Show();
maMemOverwriteFree.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Free" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_OVERWRITEFREE )
- maMemOverwriteFree.Check( TRUE );
+ maMemOverwriteFree.Check( sal_True );
maMemOverwriteFree.SetPosSizePixel( LogicToPixel( Point( 140, 50 ), aAppMap ),
aButtonSize );
}
@@ -881,7 +882,7 @@ DbgDialog::DbgDialog() :
maMemPtr.Show();
maMemPtr.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Pointer" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_POINTER )
- maMemPtr.Check( TRUE );
+ maMemPtr.Check( sal_True );
maMemPtr.SetPosSizePixel( LogicToPixel( Point( 205, 50 ), aAppMap ),
aButtonSize );
}
@@ -890,7 +891,7 @@ DbgDialog::DbgDialog() :
maMemReport.Show();
maMemReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_REPORT )
- maMemReport.Check( TRUE );
+ maMemReport.Check( sal_True );
maMemReport.SetPosSizePixel( LogicToPixel( Point( 270, 50 ), aAppMap ),
aButtonSize );
}
@@ -899,7 +900,7 @@ DbgDialog::DbgDialog() :
maMemTrace.Show();
maMemTrace.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Trace" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_TRACE )
- maMemTrace.Check( TRUE );
+ maMemTrace.Check( sal_True );
maMemTrace.SetPosSizePixel( LogicToPixel( Point( 10, 65 ), aAppMap ),
aButtonSize );
}
@@ -908,7 +909,7 @@ DbgDialog::DbgDialog() :
maMemLeakReport.Show();
maMemLeakReport.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Leak-Report" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_LEAKREPORT )
- maMemLeakReport.Check( TRUE );
+ maMemLeakReport.Check( sal_True );
maMemLeakReport.SetPosSizePixel( LogicToPixel( Point( 75, 65 ), aAppMap ),
aButtonSize );
}
@@ -917,7 +918,7 @@ DbgDialog::DbgDialog() :
maMemNewDel.Show();
maMemNewDel.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~New/Delete" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_NEWDEL )
- maMemNewDel.Check( TRUE );
+ maMemNewDel.Check( sal_True );
maMemNewDel.SetPosSizePixel( LogicToPixel( Point( 140, 65 ), aAppMap ),
aButtonSize );
}
@@ -926,7 +927,7 @@ DbgDialog::DbgDialog() :
maMemXtor.Show();
maMemXtor.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Ob~ject Test" ) ) );
if ( pData->nTestFlags & DBG_TEST_MEM_XTOR )
- maMemXtor.Check( TRUE );
+ maMemXtor.Check( sal_True );
maMemXtor.SetPosSizePixel( LogicToPixel( Point( 205, 65 ), aAppMap ),
aButtonSize );
}
@@ -942,7 +943,7 @@ DbgDialog::DbgDialog() :
maProf.Show();
maProf.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Profiling" ) ) );
if ( pData->nTestFlags & DBG_TEST_PROFILING )
- maProf.Check( TRUE );
+ maProf.Check( sal_True );
maProf.SetPosSizePixel( LogicToPixel( Point( 10, 95 ), aAppMap ),
aButtonSize );
}
@@ -951,7 +952,7 @@ DbgDialog::DbgDialog() :
maRes.Show();
maRes.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Resourcen" ) ) );
if ( pData->nTestFlags & DBG_TEST_RESOURCE )
- maRes.Check( TRUE );
+ maRes.Check( sal_True );
maRes.SetPosSizePixel( LogicToPixel( Point( 75, 95 ), aAppMap ),
aButtonSize );
}
@@ -960,7 +961,7 @@ DbgDialog::DbgDialog() :
maDialog.Show();
maDialog.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Dialog" ) ) );
if ( pData->nTestFlags & DBG_TEST_DIALOG )
- maDialog.Check( TRUE );
+ maDialog.Check( sal_True );
maDialog.SetPosSizePixel( LogicToPixel( Point( 140, 95 ), aAppMap ),
aButtonSize );
}
@@ -969,7 +970,7 @@ DbgDialog::DbgDialog() :
maBoldAppFont.Show();
maBoldAppFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Bold AppFont" ) ) );
if ( pData->nTestFlags & DBG_TEST_BOLDAPPFONT )
- maBoldAppFont.Check( TRUE );
+ maBoldAppFont.Check( sal_True );
maBoldAppFont.SetPosSizePixel( LogicToPixel( Point( 205, 95 ), aAppMap ),
aButtonSize );
maBoldAppFont.SaveValue();
@@ -994,7 +995,7 @@ DbgDialog::DbgDialog() :
maOverwrite.Show();
maOverwrite.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Overwrite ~File" ) ) );
if ( pData->bOverwrite )
- maOverwrite.Check( TRUE );
+ maOverwrite.Check( sal_True );
maOverwrite.SetPosSizePixel( LogicToPixel( Point( 205, 130 ), aAppMap ),
aButtonSize );
}
@@ -1003,7 +1004,7 @@ DbgDialog::DbgDialog() :
maHookOSLBox.Show();
maHookOSLBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Reroute osl debug ~messages" ) ) );
if ( pData->bHookOSLAssert )
- maHookOSLBox.Check( TRUE );
+ maHookOSLBox.Check( sal_True );
maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
LogicToPixel( Size( 100, 12 ), aAppMap ) );
}
@@ -1206,8 +1207,8 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aData.aInclFilter[sizeof( aData.aInclFilter )-1] = '\0';
aData.aExclFilter[sizeof( aData.aExclFilter )-1] = '\0';
- aData.bOverwrite = maOverwrite.IsChecked() ? TRUE : FALSE;
- aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? TRUE : FALSE;
+ aData.bOverwrite = maOverwrite.IsChecked() ? sal_True : sal_False;
+ aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? sal_True : sal_False;
if ( maXtorThis.IsChecked() )
aData.nTestFlags |= DBG_TEST_XTOR_THIS;
@@ -1301,7 +1302,7 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
) ) );
aBox.Execute();
}
- EndDialog( TRUE );
+ EndDialog( sal_True );
}
else if ( pButton == &maInfoButton )
{
@@ -1324,7 +1325,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
{
if ( rHEvt.GetMode() & HELPMODE_CONTEXT )
{
- DbgInfoDialog aInfoDialog( this, TRUE );
+ DbgInfoDialog aInfoDialog( this, sal_True );
XubString aHelpText;
const sal_Char** pHelpStrs = pDbgHelpText;
while ( *pHelpStrs )
@@ -1340,7 +1341,7 @@ void DbgDialog::RequestHelp( const HelpEvent& rHEvt )
// =======================================================================
-DbgInfoDialog::DbgInfoDialog( Window* pParent, BOOL bHelpText ) :
+DbgInfoDialog::DbgInfoDialog( Window* pParent, sal_Bool bHelpText ) :
ModalDialog( pParent, WB_STDMODAL ),
maListBox( this, WB_BORDER | WB_AUTOHSCROLL ),
maOKButton( this, WB_DEFBUTTON )
@@ -1367,12 +1368,12 @@ DbgInfoDialog::DbgInfoDialog( Window* pParent, BOOL bHelpText ) :
void DbgInfoDialog::SetInfoText( const XubString& rStr )
{
- maListBox.SetUpdateMode( FALSE );
+ maListBox.SetUpdateMode( sal_False );
maListBox.Clear();
XubString aStr = rStr;
aStr.ConvertLineEnd( LINEEND_LF );
- USHORT nStrIndex = 0;
- USHORT nFoundIndex;
+ sal_uInt16 nStrIndex = 0;
+ sal_uInt16 nFoundIndex;
do
{
nFoundIndex = aStr.Search( _LF, nStrIndex );
@@ -1380,8 +1381,8 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
if ( mbHelpText )
{
long nMaxWidth = maListBox.GetOutputSizePixel().Width()-30;
- USHORT nLastIndex = 0;
- USHORT nIndex = aTextParagraph.Search( ' ' );
+ sal_uInt16 nLastIndex = 0;
+ sal_uInt16 nIndex = aTextParagraph.Search( ' ' );
while ( nIndex != STRING_NOTFOUND )
{
if ( maListBox.GetTextWidth( aTextParagraph, 0, nIndex ) > nMaxWidth )
@@ -1411,15 +1412,15 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr )
nStrIndex = nFoundIndex+1;
}
while ( nFoundIndex != STRING_NOTFOUND );
- maListBox.SetUpdateMode( TRUE );
+ maListBox.SetUpdateMode( sal_True );
}
// =======================================================================
void DbgDialogTest( Window* pWindow )
{
- BOOL aAccelBuf[65536];
- USHORT nChildCount = pWindow->GetChildCount();
+ sal_Bool aAccelBuf[65536];
+ sal_uInt16 nChildCount = pWindow->GetChildCount();
Window* pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
Window* pChild;
Point aTabPos;
@@ -1433,9 +1434,9 @@ void DbgDialogTest( Window* pWindow )
if ( pWindow->IsDialog() )
{
- BOOL bOKCancelButton = FALSE;
- BOOL bDefPushButton = FALSE;
- BOOL bButton = FALSE;
+ sal_Bool bOKCancelButton = sal_False;
+ sal_Bool bDefPushButton = sal_False;
+ sal_Bool bButton = sal_False;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1443,11 +1444,11 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->ImplIsPushButton() )
{
- bButton = TRUE;
+ bButton = sal_True;
if ( (pChild->GetType() == WINDOW_OKBUTTON) || (pChild->GetType() == WINDOW_CANCELBUTTON) )
- bOKCancelButton = TRUE;
+ bOKCancelButton = sal_True;
if ( pChild->GetStyle() & WB_DEFBUTTON )
- bDefPushButton = TRUE;
+ bDefPushButton = sal_True;
}
pGetChild = pGetChild->GetWindow( WINDOW_NEXT );
@@ -1462,7 +1463,7 @@ void DbgDialogTest( Window* pWindow )
}
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
@@ -1474,7 +1475,7 @@ void DbgDialogTest( Window* pWindow )
{
XubString aText = pChild->GetText();
XubString aErrorText = aText;
- USHORT nAccelPos = STRING_NOTFOUND;
+ sal_uInt16 nAccelPos = STRING_NOTFOUND;
xub_Unicode cAccel = 0;
if ( aErrorText.Len() > 128 )
{
@@ -1495,7 +1496,7 @@ void DbgDialogTest( Window* pWindow )
if ( aAccelBuf[cAccel] )
DbgOutTypef( DBG_OUT_ERROR, "Double mnemonic char: %c", cAccel );
else
- aAccelBuf[cAccel] = TRUE;
+ aAccelBuf[cAccel] = sal_True;
}
}
}
@@ -1648,66 +1649,66 @@ void DbgDialogTest( Window* pWindow )
if ( pChild->IsVisible() )
{
- BOOL bMaxWarning = FALSE;
+ sal_Bool bMaxWarning = sal_False;
if ( pChild->GetType() == WINDOW_NUMERICFIELD )
{
NumericField* pField = (NumericField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_METRICFIELD )
{
MetricField* pField = (MetricField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_CURRENCYFIELD )
{
CurrencyField* pField = (CurrencyField*)pChild;
if ( pField->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_TIMEFIELD )
{
TimeField* pField = (TimeField*)pChild;
if ( pField->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_DATEFIELD )
{
DateField* pField = (DateField*)pChild;
if ( pField->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_NUMERICBOX )
{
NumericBox* pBox = (NumericBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_METRICBOX )
{
MetricBox* pBox = (MetricBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_CURRENCYBOX )
{
CurrencyBox* pBox = (CurrencyBox*)pChild;
if ( pBox->GetMax() == LONG_MAX )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_TIMEBOX )
{
TimeBox* pBox = (TimeBox*)pChild;
if ( pBox->GetMax() == Time( 23, 59, 59, 99 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
else if ( pChild->GetType() == WINDOW_DATEBOX )
{
DateBox* pBox = (DateBox*)pChild;
if ( pBox->GetMax() == Date( 31, 12, 9999 ) )
- bMaxWarning = TRUE;
+ bMaxWarning = sal_True;
}
if ( bMaxWarning )
{
@@ -1761,7 +1762,7 @@ void DbgDialogTest( Window* pWindow )
aTabPos = aNewPos;
}
- for ( USHORT j = 0; j < i; j++ )
+ for ( sal_uInt16 j = 0; j < i; j++ )
{
if ( ((pRectAry[j].Right() != 0) || (pRectAry[j].Bottom() != 0)) &&
aChildRect.IsOver( pRectAry[j] ) )
@@ -1839,8 +1840,8 @@ long SolarMessageBoxExecutor::doIt()
#if ! defined USE_VCL_MSGBOX
#ifdef WNT
- BOOL bOldCallTimer = pSVData->mbNoCallTimer;
- pSVData->mbNoCallTimer = TRUE;
+ sal_Bool bOldCallTimer = pSVData->mbNoCallTimer;
+ pSVData->mbNoCallTimer = sal_True;
MessageBeep( MB_ICONHAND );
nResult = MessageBoxW( 0, (LPWSTR)m_sDebugMessage.GetBuffer(), L"Debug Output",
MB_TASKMODAL | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONSTOP );
@@ -1859,7 +1860,7 @@ long SolarMessageBoxExecutor::doIt()
}
#endif // WNT
#else
- USHORT nOldMode = Application::GetSystemWindowMode();
+ sal_uInt16 nOldMode = Application::GetSystemWindowMode();
Application::SetSystemWindowMode( nOldMode & ~SYSTEMWINDOW_MODE_NOAUTOMODE );
DbgMessageBox aBox( m_sDebugMessage );
Application::SetSystemWindowMode( nOldMode );
@@ -1945,12 +1946,12 @@ long SolarWindowPrinter::doIt()
void DbgPrintWindow( const char* pLine )
{
- static BOOL bIn = FALSE;
+ static sal_Bool bIn = sal_False;
// keine rekursiven Traces
if ( bIn )
return;
- bIn = TRUE;
+ bIn = sal_True;
SolarWindowPrinter aPrinter( String( pLine, RTL_TEXTENCODING_UTF8 ) );
TimeValue aTimeout; aTimeout.Seconds = 2; aTimeout.Nanosec = 0;
@@ -1959,14 +1960,16 @@ void DbgPrintWindow( const char* pLine )
if ( aPrinter.didTimeout() )
DbgPrintShell( pLine );
- bIn = FALSE;
+ bIn = sal_False;
}
// =======================================================================
-#ifdef WNT
-void ImplDbgTestSolarMutex();
-#endif
+void ImplDbgTestSolarMutex()
+{
+ bool bCheck = ImplGetSVData()->mpDefInst->CheckYieldMutex();
+ OSL_ENSURE( bCheck, "SolarMutex not locked" );
+}
// =======================================================================
@@ -1974,9 +1977,7 @@ void DbgGUIInit()
{
DbgSetPrintMsgBox( DbgPrintMsgBox );
DbgSetPrintWindow( DbgPrintWindow );
-#ifdef WNT
DbgSetTestSolarMutex( ImplDbgTestSolarMutex );
-#endif
}
// -----------------------------------------------------------------------
@@ -1985,9 +1986,7 @@ void DbgGUIDeInit()
{
DbgSetPrintMsgBox( NULL );
DbgSetPrintWindow( NULL );
-#ifdef WNT
DbgSetTestSolarMutex( NULL );
-#endif
DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
if ( pDbgWindow )
@@ -2004,7 +2003,7 @@ void DbgGUIStart()
{
DbgDialog* pDialog = new DbgDialog;
// Fuer den Debug-Dialog schalten wir Dialogtests aus
- ULONG nOldFlags = pData->nTestFlags;
+ sal_uLong nOldFlags = pData->nTestFlags;
pData->nTestFlags &= ~DBG_TEST_DIALOG;
if ( !pDialog->Execute() )
pData->nTestFlags |= (nOldFlags & DBG_TEST_DIALOG);
@@ -2019,7 +2018,7 @@ void DbgGUIStart()
// -----------------------------------------------------------------------
-USHORT DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
+sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPrintLine pProc )
{
DbgChannelId nChannelId = DbgRegisterUserChannel( pProc );
UserDefinedChannels& rChannels = ImplDbgGetUserDefinedChannels();
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index f26b5d3cb400..41263675840f 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -37,6 +37,7 @@
#include "vcl/help.hxx"
#include "vcl/helpwin.hxx"
#include "tools/debug.hxx"
+#include "tools/diagnose_ex.h"
#include "tools/time.hxx"
// =======================================================================
@@ -63,27 +64,20 @@ Help::~Help()
// -----------------------------------------------------------------------
-BOOL Help::Start( ULONG, const Window* )
-{
- return FALSE;
-}
-
-void Help::OpenHelpAgent( ULONG )
+void Help::OpenHelpAgent( const rtl::OString& )
{
}
// -----------------------------------------------------------------------
-BOOL Help::Start( const XubString&, const Window* )
+sal_Bool Help::Start( const XubString&, const Window* )
{
- return FALSE;
+ return sal_False;
}
-// -----------------------------------------------------------------------
-
-XubString Help::GetHelpText( ULONG, const Window* )
+sal_Bool Help::SearchKeyword( const XubString& )
{
- return ImplGetSVEmptyStr();
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -97,26 +91,26 @@ XubString Help::GetHelpText( const String&, const Window* )
void Help::EnableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbContextHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbContextHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsContextHelpEnabled()
+sal_Bool Help::IsContextHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbContextHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::StartContextHelp()
+sal_Bool Help::StartContextHelp()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -128,74 +122,74 @@ BOOL Help::StartContextHelp()
Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() );
HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT );
pWindow->RequestHelp( aHelpEvent );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
void Help::EnableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbExtHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbExtHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsExtHelpEnabled()
+sal_Bool Help::IsExtHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbExtHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::StartExtHelp()
+sal_Bool Help::StartExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && !pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = TRUE;
+ pSVData->maHelpData.mbExtHelpMode = sal_True;
pSVData->maHelpData.mbOldBalloonMode = pSVData->maHelpData.mbBalloonHelp;
- pSVData->maHelpData.mbBalloonHelp = TRUE;
+ pSVData->maHelpData.mbBalloonHelp = sal_True;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::EndExtHelp()
+sal_Bool Help::EndExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbExtHelp && pSVData->maHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = FALSE;
+ pSVData->maHelpData.mbExtHelpMode = sal_False;
pSVData->maHelpData.mbBalloonHelp = pSVData->maHelpData.mbOldBalloonMode;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsExtHelpActive()
+sal_Bool Help::IsExtHelpActive()
{
return ImplGetSVData()->maHelpData.mbExtHelpMode;
}
@@ -204,101 +198,115 @@ BOOL Help::IsExtHelpActive()
void Help::EnableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbBalloonHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsBalloonHelpEnabled()
+sal_Bool Help::IsBalloonHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbBalloonHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowBalloon( Window* pParent,
+sal_Bool Help::ShowBalloon( Window* pParent,
const Point& rScreenPos,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowBalloon( Window* pParent,
+sal_Bool Help::ShowBalloon( Window* pParent,
const Point& rScreenPos, const Rectangle& rRect,
const XubString& rHelpText )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0,
rHelpText, ImplGetSVEmptyStr(), rScreenPos, &rRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
void Help::EnableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = TRUE;
+ ImplGetSVData()->maHelpData.mbQuickHelp = sal_True;
}
// -----------------------------------------------------------------------
void Help::DisableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = FALSE;
+ ImplGetSVData()->maHelpData.mbQuickHelp = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Help::IsQuickHelpEnabled()
+sal_Bool Help::IsQuickHelpEnabled()
{
return ImplGetSVData()->maHelpData.mbQuickHelp;
}
// -----------------------------------------------------------------------
-BOOL Help::ShowQuickHelp( Window* pParent,
+sal_Bool Help::ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle,
rHelpText, rLongHelpText,
pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG Help::ShowTip( Window* pParent, const Rectangle& rRect,
- const XubString& rText, USHORT nStyle )
+sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect,
+ const XubString& rText, sal_uInt16 nStyle )
{
- USHORT nHelpWinStyle = HELPWINSTYLE_QUICK;
+ sal_uInt16 nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
HelpTextWindow* pHelpWin = new HelpTextWindow( pParent, rText, nHelpWinStyle, nStyle );
+ sal_uIntPtr nId = reinterpret_cast< sal_uIntPtr >( pHelpWin );
+ UpdateTip( nId, pParent, rScreenRect, rText );
+
+ pHelpWin->ShowHelp( HELPDELAY_NONE );
+ return nId;
+}
+
+// -----------------------------------------------------------------------
+
+void Help::UpdateTip( sal_uIntPtr nId, Window* pParent, const Rectangle& rScreenRect, const XubString& rText )
+{
+ HelpTextWindow* pHelpWin = reinterpret_cast< HelpTextWindow* >( nId );
+ ENSURE_OR_RETURN_VOID( pHelpWin != NULL, "Help::UpdateTip: invalid ID!" );
+
Size aSz = pHelpWin->CalcOutSize();
pHelpWin->SetOutputSizePixel( aSz );
- ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle,
- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rRect );
- pHelpWin->ShowHelp( HELPDELAY_NONE );
- return (ULONG)pHelpWin;
+ ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
+ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
+
+ pHelpWin->SetHelpText( rText );
}
// -----------------------------------------------------------------------
-void Help::HideTip( ULONG nId )
+void Help::HideTip( sal_uLong nId )
{
HelpTextWindow* pHelpWin = (HelpTextWindow*)nId;
Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
@@ -312,13 +320,13 @@ void Help::HideTip( ULONG nId )
// =======================================================================
-HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT nHelpWinStyle, USHORT nStyle ) :
+HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle ) :
//FloatingWindow( pParent->ImplGetFrameWindow(), WB_SYSTEMWINDOW ),
FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window
maHelpText( rText )
{
SetType( WINDOW_HELPTEXTWINDOW );
- ImplSetMouseTransparent( TRUE );
+ ImplSetMouseTransparent( sal_True );
mnHelpWinStyle = nHelpWinStyle;
mnStyle = nStyle;
// on windows this will raise the application window, because help windows are system windows now
@@ -331,9 +339,9 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
SetTextAlign( ALIGN_TOP );
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
@@ -346,7 +354,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
if( mnStyle & QUICKHELP_BIDI_RTL )
{
- ULONG nLayoutMode = GetLayoutMode();
+ sal_uLong nLayoutMode = GetLayoutMode();
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
SetLayoutMode( nLayoutMode );
}
@@ -355,7 +363,7 @@ HelpTextWindow::HelpTextWindow( Window* pParent, const XubString& rText, USHORT
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maHelpData.mbSetKeyboardHelp )
- pSVData->maHelpData.mbKeyboardHelp = TRUE;
+ pSVData->maHelpData.mbKeyboardHelp = sal_True;
const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
maShowTimer.SetTimeoutHdl( LINK( this, HelpTextWindow, TimerHdl ) );
@@ -392,13 +400,13 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
else // HELPWINSTYLE_BALLOON
{
Point aTmpPoint;
- USHORT nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
+ sal_uInt16 nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
XubString aXXX;
aXXX.Fill( nCharsInLine, 'x' ); // Durchschnittliche Breite, damit nicht jedes Fenster anders.
long nWidth = GetTextWidth( aXXX );
Size aTmpSize( nWidth, 0x7FFFFFFF );
Rectangle aTry1( aTmpPoint, aTmpSize );
- USHORT nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
+ sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
TEXT_DRAW_LEFT | TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -420,7 +428,7 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
void HelpTextWindow::ImplShow()
{
ImplDelData aDogTag( this );
- Show( TRUE, SHOW_NOACTIVATE );
+ Show( sal_True, SHOW_NOACTIVATE );
if( !aDogTag.IsDelete() )
Update();
}
@@ -450,7 +458,7 @@ void HelpTextWindow::Paint( const Rectangle& )
}
else // HELPWINSTYLE_BALLOON
{
- USHORT nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
+ sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
TEXT_DRAW_LEFT|TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
@@ -476,9 +484,9 @@ void HelpTextWindow::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void HelpTextWindow::ShowHelp( USHORT nDelayMode )
+void HelpTextWindow::ShowHelp( sal_uInt16 nDelayMode )
{
- ULONG nTimeout = 0;
+ sal_uLong nTimeout = 0;
if ( nDelayMode != HELPDELAY_NONE )
{
// Im ExtendedHelp-Fall die Hilfe schneller anzeigen
@@ -559,9 +567,9 @@ String HelpTextWindow::GetText() const
// -----------------------------------------------------------------------
-BOOL HelpTextWindow::RegisterAccessibleParent()
+sal_Bool HelpTextWindow::RegisterAccessibleParent()
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -572,7 +580,7 @@ void HelpTextWindow::RevokeAccessibleParent()
// =======================================================================
-void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const XubString& rHelpText, const XubString& rStatusText,
const Point& rScreenPos, const Rectangle* pHelpArea )
{
@@ -582,15 +590,19 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
return;
HelpTextWindow* pHelpWin = pSVData->maHelpData.mpHelpWin;
- USHORT nDelayMode = HELPDELAY_NORMAL;
+ sal_uInt16 nDelayMode = HELPDELAY_NORMAL;
if ( pHelpWin )
{
DBG_ASSERT( pHelpWin != pParent, "HelpInHelp ?!" );
- if ( (( pHelpWin->GetHelpText() != rHelpText ) ||
- ( pHelpWin->GetWinStyle() != nHelpWinStyle ) ||
- ( pHelpArea && ( pHelpWin->GetHelpArea() != *pHelpArea ) ) )
- && pSVData->maHelpData.mbRequestingHelp )
+ if ( ( ( pHelpWin->GetHelpText() != rHelpText )
+ || ( pHelpWin->GetWinStyle() != nHelpWinStyle )
+ || ( pHelpArea
+ && ( pHelpWin->GetHelpArea() != *pHelpArea )
+ )
+ )
+ && pSVData->maHelpData.mbRequestingHelp
+ )
{
// remove help window if no HelpText or other HelpText or
// other help mode. but keep it if we are scrolling, ie not requesting help
@@ -602,8 +614,8 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
}
else
{
- bool bTextChanged = rHelpText != pHelpWin->GetHelpText();
- if( bTextChanged )
+ bool const bTextChanged = rHelpText != pHelpWin->GetHelpText();
+ if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) )
{
Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
@@ -621,8 +633,10 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle,
if ( !pHelpWin && rHelpText.Len() )
{
- ULONG nCurTime = Time::GetSystemTicks();
- if( (nCurTime - pSVData->maHelpData.mnLastHelpHideTime) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ sal_uLong nCurTime = Time::GetSystemTicks();
+ if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 )
+ )
nDelayMode = HELPDELAY_NONE;
DBG_ASSERT( !pHelpWin, "Noch ein HelpWin ?!" );
@@ -657,7 +671,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
if( pHelpWin->IsVisible() )
pWindow->Invalidate( aInvRect );
pSVData->maHelpData.mpHelpWin = NULL;
- pSVData->maHelpData.mbKeyboardHelp = FALSE;
+ pSVData->maHelpData.mbKeyboardHelp = sal_False;
pHelpWin->Hide();
delete pHelpWin;
if( bUpdateHideTime )
@@ -667,7 +681,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
// -----------------------------------------------------------------------
-void ImplSetHelpWindowPos( Window* pHelpWin, USHORT nHelpWinStyle, USHORT nStyle,
+void ImplSetHelpWindowPos( Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle,
const Point& rPos, const Rectangle* pHelpArea )
{
Point aPos = rPos;
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 6841d84b424b..0f9a8df94255 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -131,7 +131,7 @@ sal_Int32 vcl::I18nHelper::CompareString( const String& rStr1, const String& rSt
{
// Change mbTransliterateIgnoreCase and destroy the warpper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = FALSE;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = sal_False;
delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
@@ -150,7 +150,7 @@ sal_Bool vcl::I18nHelper::MatchString( const String& rStr1, const String& rStr2
{
// Change mbTransliterateIgnoreCase and destroy the warpper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = TRUE;
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = sal_True;
delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
}
@@ -164,8 +164,8 @@ sal_Bool vcl::I18nHelper::MatchMnemonic( const String& rString, sal_Unicode cMne
{
::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
- BOOL bEqual = FALSE;
- USHORT n = rString.Search( '~' );
+ sal_Bool bEqual = sal_False;
+ sal_uInt16 n = rString.Search( '~' );
if ( n != STRING_NOTFOUND )
{
String aMatchStr( rString, n+1, STRING_LEN ); // not only one char, because of transliteration...
@@ -182,7 +182,7 @@ String vcl::I18nHelper::GetDate( const Date& rDate ) const
return ImplGetLocaleDataWrapper().getDate( rDate );
}
-String vcl::I18nHelper::GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep, BOOL bTrailingZeros ) const
+String vcl::I18nHelper::GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUseThousandSep, sal_Bool bTrailingZeros ) const
{
return ImplGetLocaleDataWrapper().getNum( nNumber, nDecimals, bUseThousandSep, bTrailingZeros );
}
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index 1ed8785bc8c8..cc6502a74896 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -36,8 +36,8 @@
struct ImplIdleData
{
Link maIdleHdl;
- USHORT mnPriority;
- BOOL mbTimeout;
+ sal_uInt16 mnPriority;
+ sal_Bool mbTimeout;
};
#define IMPL_IDLETIMEOUT 350
@@ -66,14 +66,14 @@ ImplIdleMgr::~ImplIdleMgr()
// -----------------------------------------------------------------------
-BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
+sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
{
size_t nPos = (size_t)-1;
size_t n = mpIdleList->size();
for ( size_t i = 0; i < n; ++i ) {
// we need to check each element to verify that rLink isn't in the array
if ( (*mpIdleList)[ i ]->maIdleHdl == rLink ) {
- return FALSE;
+ return sal_False;
}
if ( nPriority <= (*mpIdleList)[ i ]->mnPriority ) {
nPos = i;
@@ -83,7 +83,7 @@ BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
ImplIdleData* pIdleData = new ImplIdleData;
pIdleData->maIdleHdl = rLink;
pIdleData->mnPriority = nPriority;
- pIdleData->mbTimeout = FALSE;
+ pIdleData->mbTimeout = sal_False;
if ( nPos < mpIdleList->size() ) {
ImplIdleList::iterator it = mpIdleList->begin();
@@ -97,7 +97,7 @@ BOOL ImplIdleMgr::InsertIdleHdl( const Link& rLink, USHORT nPriority )
if ( !maTimer.IsActive() )
maTimer.Start();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -124,12 +124,12 @@ IMPL_LINK( ImplIdleMgr, TimeoutHdl, Timer*, EMPTYARG )
for ( size_t i = 0; i < mpIdleList->size(); ++i ) {
ImplIdleData* pIdleData = (*mpIdleList)[ i ];
if ( !pIdleData->mbTimeout ) {
- pIdleData->mbTimeout = TRUE;
+ pIdleData->mbTimeout = sal_True;
pIdleData->maIdleHdl.Call( GetpApp() );
// May have been removed in the handler
for ( size_t j = 0; j < mpIdleList->size(); ++j ) {
if ( (*mpIdleList)[ j ] == pIdleData ) {
- pIdleData->mbTimeout = FALSE;
+ pIdleData->mbTimeout = sal_False;
break;
}
}
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 08f199d5281c..8cbd1d816f8c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -39,7 +39,6 @@
#include <vcl/salbmp.hxx>
#include <vcl/salobj.hxx>
#include <vcl/salmenu.hxx>
-#include <vcl/salctrlhandle.hxx>
// this file contains the virtual destructors of the sal interface
// compilers ususally put their vtables where the destructor is
@@ -75,6 +74,29 @@ void SalInstance::FillFontPathList( std::list< rtl::OString >& )
// do nothing
}
+SalMenu* SalInstance::CreateMenu( sal_Bool, Menu* )
+{
+ // default: no native menus
+ return NULL;
+}
+
+void SalInstance::DestroyMenu( SalMenu* pMenu )
+{
+ (void)pMenu;
+ OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
+}
+
+SalMenuItem* SalInstance::CreateMenuItem( const SalItemParams* )
+{
+ return NULL;
+}
+
+void SalInstance::DestroyMenuItem( SalMenuItem* pItem )
+{
+ (void)pItem;
+ OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
+}
+
SalTimer::~SalTimer()
{
}
@@ -95,10 +117,10 @@ SalPrinter::~SalPrinter()
{
}
-BOOL SalPrinter::StartJob( const String*, const String&, const String&,
+sal_Bool SalPrinter::StartJob( const String*, const String&, const String&,
ImplJobSetup*, vcl::PrinterController& )
{
- return FALSE;
+ return sal_False;
}
SalInfoPrinter::~SalInfoPrinter()
@@ -117,7 +139,7 @@ SalMenu::~SalMenu()
{
}
-bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, ULONG )
+bool SalMenu::ShowNativePopupMenu(FloatingWindow *, const Rectangle&, sal_uLong )
{
return false;
}
@@ -127,11 +149,11 @@ bool SalMenu::AddMenuBarButton( const SalMenuButtonItem& )
return false;
}
-void SalMenu::RemoveMenuBarButton( USHORT )
+void SalMenu::RemoveMenuBarButton( sal_uInt16 )
{
}
-Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
+Rectangle SalMenu::GetMenuBarButtonRectPixel( sal_uInt16, SalFrame* )
{
return Rectangle();
}
@@ -139,8 +161,5 @@ Rectangle SalMenu::GetMenuBarButtonRectPixel( USHORT, SalFrame* )
SalMenuItem::~SalMenuItem()
{
}
-SalControlHandle::~SalControlHandle()
-{
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index d75b669b51f4..89aaf9026312 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -40,6 +40,12 @@
#include <list>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
@@ -54,12 +60,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
{
struct Listener
{
- Reference< XSessionManagerListener > m_xListener;
+ css::uno::Reference< XSessionManagerListener > m_xListener;
bool m_bInteractionRequested;
bool m_bInteractionDone;
bool m_bSaveDone;
- Listener( const Reference< XSessionManagerListener >& xListener )
+ Listener( const css::uno::Reference< XSessionManagerListener >& xListener )
: m_xListener( xListener ),
m_bInteractionRequested( false ),
m_bInteractionDone( false ),
@@ -86,11 +92,11 @@ public:
VCLSession();
virtual ~VCLSession();
- virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
- virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL addSessionManagerListener( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL removeSessionManagerListener( const css::uno::Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL queryInteraction( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException );
};
@@ -148,7 +154,7 @@ void VCLSession::callSaveRequested( bool bShutdown, bool bCancelable )
}
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->doSave( bShutdown, bCancelable );
Application::AcquireSolarMutex( nAcquireCount );
@@ -176,7 +182,7 @@ void VCLSession::callInteractionGranted( bool bInteractionGranted )
}
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->approveInteraction( bInteractionGranted );
@@ -194,7 +200,7 @@ void VCLSession::callShutdownCancelled()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
it->m_xListener->shutdownCanceled();
Application::AcquireSolarMutex( nAcquireCount );
@@ -211,10 +217,10 @@ void VCLSession::callQuit()
m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
}
- ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
{
- Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
+ css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
if( xListener2.is() )
xListener2->doQuit();
}
@@ -246,14 +252,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
}
}
-void SAL_CALL VCLSession::addSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
m_aListeners.push_back( Listener( xListener ) );
}
-void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -270,7 +276,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSession
}
}
-void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
if( m_bInteractionGranted )
{
@@ -297,7 +303,7 @@ void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListe
}
}
-void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
int nRequested = 0, nDone = 0;
@@ -320,7 +326,7 @@ void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListe
}
}
-void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -361,13 +367,13 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
return aRet;
}
-Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
+css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
{
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->xSMClient.is() )
pSVData->xSMClient = new VCLSession();
- return Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
+ return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 253c9f8d2ff2..84b8d7cc9154 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -148,18 +148,18 @@ void MachineSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MachineSettings::operator ==( const MachineSettings& rSet ) const
+sal_Bool MachineSettings::operator ==( const MachineSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnScreenOptions == rSet.mpData->mnScreenOptions) &&
(mpData->mnPrintOptions == rSet.mpData->mnPrintOptions) &&
(mpData->mnScreenRasterFontDeviation == rSet.mpData->mnScreenRasterFontDeviation) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -179,7 +179,7 @@ ImplMouseData::ImplMouseData()
mnDragLinkCode = KEY_SHIFT | KEY_MOD1;
mnContextMenuCode = MOUSE_RIGHT;
mnContextMenuClicks = 1;
- mbContextMenuDown = TRUE;
+ mbContextMenuDown = sal_True;
mnMiddleButtonAction = MOUSE_MIDDLE_AUTOSCROLL;
mnScrollRepeat = 100;
mnButtonStartRepeat = 370;
@@ -281,10 +281,10 @@ void MouseSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MouseSettings::operator ==( const MouseSettings& rSet ) const
+sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnDoubleClkTime == rSet.mpData->mnDoubleClkTime) &&
@@ -307,9 +307,9 @@ BOOL MouseSettings::operator ==( const MouseSettings& rSet ) const
(mpData->mnMenuDelay == rSet.mpData->mnMenuDelay) &&
(mpData->mnFollow == rSet.mpData->mnFollow) &&
(mpData->mnWheelBehavior == rSet.mpData->mnWheelBehavior ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -391,15 +391,15 @@ void KeyboardSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
+sal_Bool KeyboardSettings::operator ==( const KeyboardSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -418,12 +418,11 @@ ImplStyleData::ImplStyleData()
mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME;
mnScreenZoom = 100;
mnScreenFontZoom = 100;
- mnRadioButtonStyle = 0;
- mnCheckBoxStyle = 0;
- mnPushButtonStyle = 0;
- mnTabControlStyle = 0;
mnLogoDisplayTime = LOGO_DISPLAYTIME_STARTTIME;
- mnDragFullOptions = 0;
+ mnDragFullOptions = DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE |
+ DRAGFULL_OPTION_OBJECTMOVE | DRAGFULL_OPTION_OBJECTSIZE |
+ DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT |
+ DRAGFULL_OPTION_SCROLL;
mnAnimationOptions = 0;
mnSelectionOptions = 0;
mnDisplayOptions = 0;
@@ -520,10 +519,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnCursorBlinkTime = rData.mnCursorBlinkTime;
mnScreenZoom = rData.mnScreenZoom;
mnScreenFontZoom = rData.mnScreenFontZoom;
- mnRadioButtonStyle = rData.mnRadioButtonStyle;
- mnCheckBoxStyle = rData.mnCheckBoxStyle;
- mnPushButtonStyle = rData.mnPushButtonStyle;
- mnTabControlStyle = rData.mnTabControlStyle;
mnLogoDisplayTime = rData.mnLogoDisplayTime;
mnDragFullOptions = rData.mnDragFullOptions;
mnAnimationOptions = rData.mnAnimationOptions;
@@ -615,12 +610,6 @@ void ImplStyleData::SetStandardStyles()
maHighlightLinkColor = Color( COL_LIGHTBLUE );
maFontColor = Color( COL_BLACK );
- mnRadioButtonStyle &= ~STYLE_RADIOBUTTON_STYLE;
- mnCheckBoxStyle &= ~STYLE_CHECKBOX_STYLE;
- mnPushButtonStyle &= ~STYLE_PUSHBUTTON_STYLE;
- mnTabControlStyle = 0;
-
- mnOptions &= ~(STYLE_OPTION_SYSTEMSTYLE | STDSYS_STYLE);
mnBorderSize = 1;
mnTitleHeight = 18;
mnFloatTitleHeight = 13;
@@ -630,8 +619,8 @@ void ImplStyleData::SetStandardStyles()
mnUseSystemUIFonts = 1;
mnUseFlatBorders = 0;
mnUseFlatMenues = 0;
- mbPreferredUseImagesInMenus = TRUE;
- mnSkipDisabledInMenus = (USHORT)FALSE;
+ mbPreferredUseImagesInMenus = sal_True;
+ mnSkipDisabledInMenus = (sal_uInt16)sal_False;
Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
maWorkspaceGradient = Wallpaper( aGrad );
@@ -681,13 +670,13 @@ void StyleSettings::Set3DColors( const Color& rColor )
mpData->maShadowColor = rColor;
mpData->maLightColor.IncreaseLuminance( 64 );
mpData->maShadowColor.DecreaseLuminance( 64 );
- ULONG nRed = mpData->maLightColor.GetRed();
- ULONG nGreen = mpData->maLightColor.GetGreen();
- ULONG nBlue = mpData->maLightColor.GetBlue();
- nRed += (ULONG)(mpData->maShadowColor.GetRed());
- nGreen += (ULONG)(mpData->maShadowColor.GetGreen());
- nBlue += (ULONG)(mpData->maShadowColor.GetBlue());
- mpData->maCheckedColor = Color( (BYTE)(nRed/2), (BYTE)(nGreen/2), (BYTE)(nBlue/2) );
+ sal_uLong nRed = mpData->maLightColor.GetRed();
+ sal_uLong nGreen = mpData->maLightColor.GetGreen();
+ sal_uLong nBlue = mpData->maLightColor.GetBlue();
+ nRed += (sal_uLong)(mpData->maShadowColor.GetRed());
+ nGreen += (sal_uLong)(mpData->maShadowColor.GetGreen());
+ nBlue += (sal_uLong)(mpData->maShadowColor.GetBlue());
+ mpData->maCheckedColor = Color( (sal_uInt8)(nRed/2), (sal_uInt8)(nGreen/2), (sal_uInt8)(nBlue/2) );
}
else
{
@@ -699,7 +688,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-::rtl::OUString StyleSettings::ImplSymbolsStyleToName( ULONG nStyle ) const
+::rtl::OUString StyleSettings::ImplSymbolsStyleToName( sal_uLong nStyle ) const
{
switch ( nStyle )
{
@@ -718,7 +707,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
// -----------------------------------------------------------------------
-ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
+sal_uLong StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
{
if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default")) )
return STYLE_SYMBOLS_DEFAULT;
@@ -762,22 +751,22 @@ void StyleSettings::SetPreferredSymbolsStyleName( const ::rtl::OUString &rName )
// -----------------------------------------------------------------------
-ULONG StyleSettings::GetCurrentSymbolsStyle() const
+sal_uLong StyleSettings::GetCurrentSymbolsStyle() const
{
// style selected in Tools -> Options... -> OpenOffice.org -> View
- ULONG nStyle = GetSymbolsStyle();
+ sal_uLong nStyle = GetSymbolsStyle();
if ( nStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nStyle) ) )
{
// the preferred style can be read from the desktop setting by the desktop native widgets modules
- ULONG nPreferredStyle = GetPreferredSymbolsStyle();
+ sal_uLong nPreferredStyle = GetPreferredSymbolsStyle();
if ( nPreferredStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nPreferredStyle) ) )
{
// use a hardcoded desktop-specific fallback if no preferred style has been detected
static bool sbFallbackDesktopChecked = false;
- static ULONG snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
+ static sal_uLong snFallbackDesktopStyle = STYLE_SYMBOLS_DEFAULT;
if ( !sbFallbackDesktopChecked )
{
@@ -799,10 +788,10 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const
// -----------------------------------------------------------------------
-ULONG StyleSettings::GetAutoSymbolsStyle() const
+sal_uLong StyleSettings::GetAutoSymbolsStyle() const
{
const ::rtl::OUString& rDesktopEnvironment = Application::GetDesktopEnvironment();
- ULONG nRet = STYLE_SYMBOLS_DEFAULT;
+ sal_uLong nRet = STYLE_SYMBOLS_DEFAULT;
bool bCont = true;
try
@@ -833,9 +822,9 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
// falback to any existing style
if ( ! CheckSymbolStyle (nRet) )
{
- for ( ULONG n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
+ for ( sal_uLong n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
{
- ULONG nStyleToCheck = n;
+ sal_uLong nStyleToCheck = n;
// auto is not a real theme => can't be fallback
if ( nStyleToCheck == STYLE_SYMBOLS_AUTO )
@@ -860,7 +849,7 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
// -----------------------------------------------------------------------
-bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
+bool StyleSettings::CheckSymbolStyle( sal_uLong nStyle ) const
{
if ( nStyle == STYLE_SYMBOLS_INDUSTRIAL )
return false; // industrial is dead
@@ -871,15 +860,15 @@ bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
// -----------------------------------------------------------------------
-BOOL StyleSettings::GetUseImagesInMenus() const
+sal_Bool StyleSettings::GetUseImagesInMenus() const
{
// icon mode selected in Tools -> Options... -> OpenOffice.org -> View
- USHORT nStyle = mpData->mnUseImagesInMenus;
+ sal_uInt16 nStyle = mpData->mnUseImagesInMenus;
if ( nStyle == STYLE_MENUIMAGES_AUTO )
return GetPreferredUseImagesInMenus();
- return (BOOL)nStyle;
+ return (sal_Bool)nStyle;
}
// -----------------------------------------------------------------------
@@ -892,40 +881,12 @@ void StyleSettings::SetStandardStyles()
// -----------------------------------------------------------------------
-void StyleSettings::SetStandardWinStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardOS2Styles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardMacStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
-void StyleSettings::SetStandardUnixStyles()
-{
- return; // no more style changes since NWF
-}
-
-// -----------------------------------------------------------------------
-
Color StyleSettings::GetFaceGradientColor() const
{
// compute a brighter face color that can be used in gradients
// for a convex look (eg toolbars)
- USHORT h, s, b;
+ sal_uInt16 h, s, b;
GetFaceColor().RGBtoHSB( h, s, b );
if( s > 1) s=1;
if( b < 98) b=98;
@@ -937,7 +898,7 @@ Color StyleSettings::GetFaceGradientColor() const
Color StyleSettings::GetSeparatorColor() const
{
// compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
- USHORT h, s, b;
+ sal_uInt16 h, s, b;
GetShadowColor().RGBtoHSB( h, s, b );
b += b/4;
s -= s/4;
@@ -978,15 +939,15 @@ void StyleSettings::CopyData()
// -----------------------------------------------------------------------
-inline BOOL ImplIsBackOrWhite( const Color& rColor )
+inline sal_Bool ImplIsBackOrWhite( const Color& rColor )
{
- UINT8 nLuminance = rColor.GetLuminance();
+ sal_uInt8 nLuminance = rColor.GetLuminance();
return ( nLuminance < 8 ) || ( nLuminance > 250 );
}
-BOOL StyleSettings::IsHighContrastBlackAndWhite() const
+sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const
{
- BOOL bBWOnly = TRUE;
+ sal_Bool bBWOnly = sal_True;
// Only use B&W if fully B&W, like on GNOME.
// Some colors like CheckedColor and HighlightColor are not B&W in Windows Standard HC Black,
@@ -995,41 +956,41 @@ BOOL StyleSettings::IsHighContrastBlackAndWhite() const
// Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000)
if ( !ImplIsBackOrWhite( GetFaceColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetWindowColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetDialogColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetFieldColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) )
- bBWOnly = FALSE;
+ bBWOnly = sal_False;
return bBWOnly;
}
// -----------------------------------------------------------------------
-BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
+sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) &&
(mpData->mnAutoMnemonic == rSet.mpData->mnAutoMnemonic) &&
@@ -1054,14 +1015,12 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnAntialiasedMin == rSet.mpData->mnAntialiasedMin) &&
(mpData->mnScreenZoom == rSet.mpData->mnScreenZoom) &&
(mpData->mnScreenFontZoom == rSet.mpData->mnScreenFontZoom) &&
- (mpData->mnRadioButtonStyle == rSet.mpData->mnRadioButtonStyle) &&
- (mpData->mnCheckBoxStyle == rSet.mpData->mnCheckBoxStyle) &&
- (mpData->mnPushButtonStyle == rSet.mpData->mnPushButtonStyle) &&
- (mpData->mnTabControlStyle == rSet.mpData->mnTabControlStyle) &&
(mpData->mnHighContrast == rSet.mpData->mnHighContrast) &&
(mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) &&
(mpData->mnUseFlatBorders == rSet.mpData->mnUseFlatBorders) &&
(mpData->mnUseFlatMenues == rSet.mpData->mnUseFlatMenues) &&
+ (mpData->mnSymbolsStyle == rSet.mpData->mnSymbolsStyle) &&
+ (mpData->mnPreferredSymbolsStyle == rSet.mpData->mnPreferredSymbolsStyle) &&
(mpData->maFaceColor == rSet.mpData->maFaceColor) &&
(mpData->maCheckedColor == rSet.mpData->maCheckedColor) &&
(mpData->maLightColor == rSet.mpData->maLightColor) &&
@@ -1123,9 +1082,9 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
(mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
(mpData->maFontColor == rSet.mpData->maFontColor ))
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1133,10 +1092,10 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
ImplMiscData::ImplMiscData()
{
mnRefCount = 1;
- mnEnableATT = sal::static_int_cast<USHORT>(~0U);
- mnDisablePrinting = sal::static_int_cast<USHORT>(~0U);
+ mnEnableATT = sal::static_int_cast<sal_uInt16>(~0U);
+ mnDisablePrinting = sal::static_int_cast<sal_uInt16>(~0U);
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
- mbEnableLocalizedDecimalSep = (pEnv != NULL) ? TRUE : FALSE;
+ mbEnableLocalizedDecimalSep = (pEnv != NULL) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
@@ -1212,24 +1171,24 @@ void MiscSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const
+sal_Bool MiscSettings::operator ==( const MiscSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
(mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) &&
(mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL MiscSettings::GetDisablePrinting() const
+sal_Bool MiscSettings::GetDisablePrinting() const
{
- if( mpData->mnDisablePrinting == (USHORT)~0 )
+ if( mpData->mnDisablePrinting == (sal_uInt16)~0 )
{
rtl::OUString aEnable =
vcl::SettingsConfigItem::get()->
@@ -1238,15 +1197,15 @@ BOOL MiscSettings::GetDisablePrinting() const
mpData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (BOOL)mpData->mnDisablePrinting;
+ return (sal_Bool)mpData->mnDisablePrinting;
}
// -----------------------------------------------------------------------
-BOOL MiscSettings::GetEnableATToolSupport() const
+sal_Bool MiscSettings::GetEnableATToolSupport() const
{
#ifdef WNT
- if( mpData->mnEnableATT == (USHORT)~0 )
+ if( mpData->mnEnableATT == (sal_uInt16)~0 )
{
// Check in the Windows registry if an AT tool wants Accessibility support to
// be activated ..
@@ -1257,7 +1216,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
&hkey) )
{
DWORD dwType;
- WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
@@ -1269,7 +1228,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
mpData->mnEnableATT = ((0 == stricmp((const char *) Data, "1")) || (0 == stricmp((const char *) Data, "true")));
break;
case REG_DWORD:
- mpData->mnEnableATT = (USHORT) (((DWORD *) Data)[0]);
+ mpData->mnEnableATT = (sal_uInt16) (((DWORD *) Data)[0]);
break;
default:
// Unsupported registry type
@@ -1282,7 +1241,7 @@ BOOL MiscSettings::GetEnableATToolSupport() const
}
#endif
- if( mpData->mnEnableATT == (USHORT)~0 )
+ if( mpData->mnEnableATT == (sal_uInt16)~0 )
{
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( !pEnv || !*pEnv )
@@ -1299,12 +1258,12 @@ BOOL MiscSettings::GetEnableATToolSupport() const
}
}
- return (BOOL)mpData->mnEnableATT;
+ return (sal_Bool)mpData->mnEnableATT;
}
// -----------------------------------------------------------------------
-void MiscSettings::SetDisablePrinting( BOOL bEnable )
+void MiscSettings::SetDisablePrinting( sal_Bool bEnable )
{
if ( bEnable != mpData->mnDisablePrinting )
{
@@ -1318,11 +1277,11 @@ void MiscSettings::SetDisablePrinting( BOOL bEnable )
// -----------------------------------------------------------------------
-void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
+void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
{
if ( bEnable != mpData->mnEnableATT )
{
- BOOL bDummy;
+ sal_Bool bDummy;
if( bEnable && !ImplInitAccessBridge(false, bDummy) )
return;
@@ -1335,7 +1294,7 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
&hkey) )
{
DWORD dwType;
- WIN_BYTE Data[6]; // possible values: "true", "false", 1, 0
+ sal_uInt8 Data[6]; // possible values: "true", "false", 1, 0
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
@@ -1346,7 +1305,7 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
case REG_SZ:
RegSetValueEx(hkey, "SupportAssistiveTechnology",
NULL, dwType,
- bEnable ? (WIN_BYTE *) "true" : (WIN_BYTE *) "false",
+ bEnable ? (sal_uInt8 *) "true" : (sal_uInt8 *) "false",
bEnable ? sizeof("true") : sizeof("false"));
break;
case REG_DWORD:
@@ -1372,13 +1331,13 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
}
}
-void MiscSettings::SetEnableLocalizedDecimalSep( BOOL bEnable )
+void MiscSettings::SetEnableLocalizedDecimalSep( sal_Bool bEnable )
{
CopyData();
mpData->mbEnableLocalizedDecimalSep = bEnable;
}
-BOOL MiscSettings::GetEnableLocalizedDecimalSep() const
+sal_Bool MiscSettings::GetEnableLocalizedDecimalSep() const
{
return mpData->mbEnableLocalizedDecimalSep;
}
@@ -1462,15 +1421,15 @@ void NotificationSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL NotificationSettings::operator ==( const NotificationSettings& rSet ) const
+sal_Bool NotificationSettings::operator ==( const NotificationSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1558,18 +1517,18 @@ void HelpSettings::CopyData()
// -----------------------------------------------------------------------
-BOOL HelpSettings::operator ==( const HelpSettings& rSet ) const
+sal_Bool HelpSettings::operator ==( const HelpSettings& rSet ) const
{
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->mnOptions == rSet.mpData->mnOptions ) &&
(mpData->mnTipDelay == rSet.mpData->mnTipDelay ) &&
(mpData->mnTipTimeout == rSet.mpData->mnTipTimeout ) &&
(mpData->mnBalloonDelay == rSet.mpData->mnBalloonDelay ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -1698,12 +1657,12 @@ void AllSettings::CopyData()
// -----------------------------------------------------------------------
-ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
+sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- ULONG nChangeFlags = 0;
+ sal_uLong nChangeFlags = 0;
if ( nFlags & SETTINGS_MACHINE )
{
@@ -1800,12 +1759,12 @@ ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
// -----------------------------------------------------------------------
-ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
+sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- ULONG nChangeFlags = 0;
+ sal_uLong nChangeFlags = 0;
if ( mpData->maMachineSettings != rSet.mpData->maMachineSettings )
nChangeFlags |= SETTINGS_MACHINE;
@@ -1836,13 +1795,13 @@ ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
// -----------------------------------------------------------------------
-BOOL AllSettings::operator ==( const AllSettings& rSet ) const
+sal_Bool AllSettings::operator ==( const AllSettings& rSet ) const
{
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
if ( mpData == rSet.mpData )
- return TRUE;
+ return sal_True;
if ( (mpData->maMachineSettings == rSet.mpData->maMachineSettings) &&
(mpData->maMouseSettings == rSet.mpData->maMouseSettings) &&
@@ -1855,10 +1814,10 @@ BOOL AllSettings::operator ==( const AllSettings& rSet ) const
(mpData->maLocale == rSet.mpData->maLocale) &&
(mpData->mnWindowUpdate == rSet.mpData->mnWindowUpdate) )
{
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1924,7 +1883,7 @@ void AllSettings::SetUILanguage( LanguageType )
// -----------------------------------------------------------------------
-BOOL AllSettings::GetLayoutRTL() const
+sal_Bool AllSettings::GetLayoutRTL() const
{
static const char* pEnv = getenv("SAL_RTL_ENABLED" );
static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
@@ -1933,7 +1892,7 @@ BOOL AllSettings::GetLayoutRTL() const
if( pEnv )
return true;
- BOOL bRTL = FALSE;
+ sal_Bool bRTL = sal_False;
if( nUIMirroring == -1 )
{
@@ -1943,7 +1902,7 @@ BOOL AllSettings::GetLayoutRTL() const
OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/I18N/CTL")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
- BOOL bTmp = BOOL();
+ sal_Bool bTmp = sal_Bool();
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("UIMirroring")) );
if( aValue >>= bTmp )
{
@@ -2053,7 +2012,7 @@ void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
if ( nHint & SYSLOCALEOPTIONS_HINT_DECSEP )
{
MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
- BOOL bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
+ sal_Bool bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
{
aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
diff --git a/vcl/source/app/sound.cxx b/vcl/source/app/sound.cxx
index cae4991b3f18..13f832339977 100644
--- a/vcl/source/app/sound.cxx
+++ b/vcl/source/app/sound.cxx
@@ -35,6 +35,7 @@
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
#include <vcl/svdata.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/sound.hxx>
@@ -42,6 +43,10 @@
void Sound::Beep( SoundType eType, Window* pWindow )
{
+ // #i91990#
+ if ( Application::IsHeadlessModeEnabled() )
+ return;
+
if( !pWindow )
{
Window* pDefWindow = ImplGetDefaultWindow();
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index 22b51d8afef5..3fc2e67cc488 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -38,7 +38,7 @@
// =======================================================================
-XubString GetStandardText( USHORT nStdText )
+XubString GetStandardText( sal_uInt16 nStdText )
{
ResMgr* pResMgr = ImplGetResMgr();
XubString aText;
@@ -50,7 +50,7 @@ XubString GetStandardText( USHORT nStdText )
// =======================================================================
void ShowServiceNotAvailableError( Window* pParent,
- const XubString& rServiceName, BOOL bError )
+ const XubString& rServiceName, sal_Bool bError )
{
XubString aText( GetStandardText( STANDARD_TEXT_SERVICE_NOT_AVAILABLE ) );
aText.SearchAndReplaceAscii( "%s", rServiceName );
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 46a32b699650..e4cf7bf32330 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -44,7 +44,6 @@
#include "vcl/event.hxx"
#include "vcl/vclevent.hxx"
#include "vcl/virdev.hxx"
-#include "vcl/windata.hxx"
#include "vcl/window.h"
#include "vcl/wrkwin.hxx"
#include "vcl/idlemgr.hxx"
@@ -82,12 +81,12 @@ using namespace ::com::sun::star::uno;
class ImplReservedKey
{
public:
- ImplReservedKey( KeyCode aKeyCode, USHORT nResId ) :
+ ImplReservedKey( KeyCode aKeyCode, sal_uInt16 nResId ) :
mKeyCode(aKeyCode), mnResId( nResId)
{}
KeyCode mKeyCode;
- USHORT mnResId;
+ sal_uInt16 mnResId;
};
typedef std::pair<ImplReservedKey*, size_t> ReservedKeys;
@@ -183,16 +182,16 @@ struct ImplEventHook
struct ImplPostEventData
{
- ULONG mnEvent;
+ sal_uLong mnEvent;
const Window* mpWin;
- ULONG mnEventId;
+ sal_uLong mnEventId;
KeyEvent maKeyEvent;
MouseEvent maMouseEvent;
- ImplPostEventData( ULONG nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
+ ImplPostEventData( sal_uLong nEvent, const Window* pWin, const KeyEvent& rKeyEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maKeyEvent( rKeyEvent ) {}
- ImplPostEventData( ULONG nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
+ ImplPostEventData( sal_uLong nEvent, const Window* pWin, const MouseEvent& rMouseEvent ) :
mnEvent( nEvent ), mpWin( pWin ), mnEventId( 0 ), maMouseEvent( rMouseEvent ) {}
~ImplPostEventData() {}
@@ -241,7 +240,7 @@ void Application::InitAppRes( const ResId& )
// -----------------------------------------------------------------------
-BOOL Application::QueryExit()
+sal_Bool Application::QueryExit()
{
WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
@@ -249,12 +248,12 @@ BOOL Application::QueryExit()
if ( pAppWin )
return pAppWin->Close();
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void Application::UserEvent( ULONG, void* )
+void Application::UserEvent( sal_uLong, void* )
{
}
@@ -319,7 +318,7 @@ sal_uInt16 Application::GetCommandLineParamCount()
// -----------------------------------------------------------------------
-XubString Application::GetCommandLineParam( USHORT nParam )
+XubString Application::GetCommandLineParam( sal_uInt16 nParam )
{
rtl::OUString aParam;
osl_getCommandArg( nParam, &aParam.pData );
@@ -356,7 +355,7 @@ const XubString& Application::GetAppFileName()
// -----------------------------------------------------------------------
-USHORT Application::Exception( USHORT nError )
+sal_uInt16 Application::Exception( sal_uInt16 nError )
{
switch ( nError & EXC_MAJORTYPE )
{
@@ -398,12 +397,12 @@ void Application::Abort( const XubString& rErrorText )
// -----------------------------------------------------------------------
-ULONG Application::GetReservedKeyCodeCount()
+sal_uLong Application::GetReservedKeyCodeCount()
{
return ImplReservedKeys::get()->second;
}
-const KeyCode* Application::GetReservedKeyCode( ULONG i )
+const KeyCode* Application::GetReservedKeyCode( sal_uLong i )
{
if( i >= GetReservedKeyCodeCount() )
return NULL;
@@ -411,7 +410,7 @@ const KeyCode* Application::GetReservedKeyCode( ULONG i )
return &ImplReservedKeys::get()->first[i].mKeyCode;
}
-String Application::GetReservedKeyCodeDescription( ULONG i )
+String Application::GetReservedKeyCodeDescription( sal_uLong i )
{
ResMgr* pResMgr = ImplGetResMgr();
if( ! pResMgr )
@@ -430,12 +429,12 @@ void Application::Execute()
DBG_STARTAPPEXECUTE();
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maAppData.mbInAppExecute = TRUE;
+ pSVData->maAppData.mbInAppExecute = sal_True;
while ( !pSVData->maAppData.mbAppQuit )
Application::Yield();
- pSVData->maAppData.mbInAppExecute = FALSE;
+ pSVData->maAppData.mbInAppExecute = sal_False;
DBG_ENDAPPEXECUTE();
}
@@ -497,7 +496,7 @@ void Application::Yield( bool i_bAllEvents )
IMPL_STATIC_LINK_NOINSTANCE( ImplSVAppData, ImplQuitMsg, void*, EMPTYARG )
{
- ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ ImplGetSVData()->maAppData.mbAppQuit = sal_True;
return 0;
}
@@ -525,7 +524,7 @@ oslThreadIdentifier Application::GetMainThreadIdentifier()
// -----------------------------------------------------------------------
-ULONG Application::ReleaseSolarMutex()
+sal_uLong Application::ReleaseSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return pSVData->mpDefInst->ReleaseYieldMutex();
@@ -533,7 +532,7 @@ ULONG Application::ReleaseSolarMutex()
// -----------------------------------------------------------------------
-void Application::AcquireSolarMutex( ULONG nCount )
+void Application::AcquireSolarMutex( sal_uLong nCount )
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpDefInst->AcquireYieldMutex( nCount );
@@ -541,56 +540,56 @@ void Application::AcquireSolarMutex( ULONG nCount )
// -----------------------------------------------------------------------
-BOOL Application::IsInMain()
+sal_Bool Application::IsInMain()
{
return ImplGetSVData()->maAppData.mbInAppMain;
}
// -----------------------------------------------------------------------
-BOOL Application::IsInExecute()
+sal_Bool Application::IsInExecute()
{
return ImplGetSVData()->maAppData.mbInAppExecute;
}
// -----------------------------------------------------------------------
-BOOL Application::IsShutDown()
+sal_Bool Application::IsShutDown()
{
return ImplGetSVData()->maAppData.mbAppQuit;
}
// -----------------------------------------------------------------------
-BOOL Application::IsInModalMode()
+sal_Bool Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
}
// -----------------------------------------------------------------------
-USHORT Application::GetModalModeCount()
+sal_uInt16 Application::GetModalModeCount()
{
return ImplGetSVData()->maAppData.mnModalMode;
}
// -----------------------------------------------------------------------
-USHORT Application::GetDispatchLevel()
+sal_uInt16 Application::GetDispatchLevel()
{
return ImplGetSVData()->maAppData.mnDispatchLevel;
}
// -----------------------------------------------------------------------
-BOOL Application::AnyInput( USHORT nType )
+sal_Bool Application::AnyInput( sal_uInt16 nType )
{
- return (BOOL)ImplGetSVData()->mpDefInst->AnyInput( nType );
+ return (sal_Bool)ImplGetSVData()->mpDefInst->AnyInput( nType );
}
// -----------------------------------------------------------------------
-ULONG Application::GetLastInputInterval()
+sal_uLong Application::GetLastInputInterval()
{
return (Time::GetSystemTicks()-ImplGetSVData()->maAppData.mnLastInputTime);
}
@@ -599,7 +598,7 @@ ULONG Application::GetLastInputInterval()
extern int nImplSysDialog;
-BOOL Application::IsUICaptured()
+sal_Bool Application::IsUICaptured()
{
ImplSVData* pSVData = ImplGetSVData();
// Wenn Mouse gecaptured, oder im TrackingModus oder im Auswahlmodus
@@ -608,37 +607,37 @@ BOOL Application::IsUICaptured()
// D&D aktive !!!
if ( pSVData->maWinData.mpCaptureWin || pSVData->maWinData.mpTrackWin ||
pSVData->maWinData.mpFirstFloat || nImplSysDialog )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Application::IsUserActive( USHORT nTest )
+sal_Bool Application::IsUserActive( sal_uInt16 nTest )
{
if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) )
{
if ( IsUICaptured() )
- return TRUE;
+ return sal_True;
}
if ( nTest & USERACTIVE_INPUT )
{
if ( GetLastInputInterval() < 500 )
- return TRUE;
+ return sal_True;
if ( AnyInput( INPUT_KEYBOARD ) )
- return TRUE;
+ return sal_True;
}
if ( nTest & USERACTIVE_MODALDIALOG )
{
if ( ImplGetSVData()->maAppData.mnModalDialog )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -662,10 +661,10 @@ void Application::MergeSystemSettings( AllSettings& rSettings )
{
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
- pSVData->maAppData.mbSettingsInit = TRUE;
+ pSVData->maAppData.mbSettingsInit = sal_True;
}
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
- pWindow->ImplUpdateGlobalSettings( rSettings, FALSE );
+ pWindow->ImplUpdateGlobalSettings( rSettings, sal_False );
}
}
@@ -707,7 +706,7 @@ void Application::SetSettings( const AllSettings& rSettings )
}
ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
*pSVData->maAppData.mpSettings = rSettings;
- ULONG nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
+ sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
if ( nChangeFlags )
{
DataChangedEvent aDCEvt( DATACHANGED_SETTINGS, &aOldSettings, nChangeFlags );
@@ -738,7 +737,7 @@ void Application::SetSettings( const AllSettings& rSettings )
Window* pClientWin = pFrame;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, TRUE );
+ pClientWin->UpdateSettings( rSettings, sal_True );
Window* pTempWin = pFrame->mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
@@ -748,7 +747,7 @@ void Application::SetSettings( const AllSettings& rSettings )
pClientWin = pTempWin;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
- pClientWin->UpdateSettings( rSettings, TRUE );
+ pClientWin->UpdateSettings( rSettings, sal_True );
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
}
@@ -827,7 +826,7 @@ void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void Application::ImplCallEventListeners( ULONG nEvent, Window *pWin, void* pData )
+void Application::ImplCallEventListeners( sal_uLong nEvent, Window *pWin, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
VclWindowEvent aEvent( pWin, nEvent, pData );
@@ -885,13 +884,13 @@ void Application::RemoveKeyListener( const Link& rKeyListener )
// -----------------------------------------------------------------------
-BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
+sal_Bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
// let listeners process the key event
VclWindowEvent aEvent( pWin, nEvent, (void *) pKeyEvent );
ImplSVData* pSVData = ImplGetSVData();
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
if ( pSVData->maAppData.mpKeyListeners )
bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
@@ -901,10 +900,10 @@ BOOL Application::HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
// -----------------------------------------------------------------------------
-ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent )
+sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
const SolarMutexGuard aGuard;
- ULONG nEventId = 0;
+ sal_uLong nEventId = 0;
if( pWin && pKeyEvent )
{
@@ -928,10 +927,10 @@ ULONG Application::PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent
// -----------------------------------------------------------------------------
-ULONG Application::PostMouseEvent( ULONG nEvent, Window *pWin, MouseEvent* pMouseEvent )
+sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
{
const SolarMutexGuard aGuard;
- ULONG nEventId = 0;
+ sal_uLong nEventId = 0;
if( pWin && pMouseEvent )
{
@@ -968,8 +967,8 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
const SolarMutexGuard aGuard;
ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
const void* pEventData;
- ULONG nEvent;
- const ULONG nEventId = pData->mnEventId;
+ sal_uLong nEvent;
+ const sal_uLong nEventId = pData->mnEventId;
switch( pData->mnEvent )
{
@@ -1005,7 +1004,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
};
if( pData->mpWin && pData->mpWin->mpWindowImpl->mpFrameWindow && pEventData )
- ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (USHORT) nEvent, pEventData );
+ ImplWindowFrameProc( pData->mpWin->mpWindowImpl->mpFrameWindow, NULL, (sal_uInt16) nEvent, pEventData );
// remove this event from list of posted events, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
@@ -1050,7 +1049,7 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
// -----------------------------------------------------------------------
-BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
+sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId )
{
const SolarMutexGuard aGuard;
@@ -1060,79 +1059,79 @@ BOOL Application::IsProcessedMouseOrKeyEvent( ULONG nEventId )
while( aIter != aPostedEventList.end() )
{
if( (*aIter).second->mnEventId == nEventId )
- return FALSE;
+ return sal_False;
else
++aIter;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-ULONG Application::PostUserEvent( ULONG nEvent, void* pEventData )
+sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-ULONG Application::PostUserEvent( const Link& rLink, void* pCaller )
+sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-BOOL Application::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
+sal_Bool Application::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
{
ImplSVEvent* pSVEvent = new ImplSVEvent;
pSVEvent->mnEvent = nEvent;
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = NULL;
- pSVEvent->mbCall = TRUE;
- rEventId = (ULONG)pSVEvent;
+ pSVEvent->mbCall = sal_True;
+ rEventId = (sal_uLong)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Application::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
+sal_Bool Application::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
{
ImplSVEvent* pSVEvent = new ImplSVEvent;
pSVEvent->mnEvent = 0;
pSVEvent->mpData = pCaller;
pSVEvent->mpLink = new Link( rLink );
pSVEvent->mpWindow = NULL;
- pSVEvent->mbCall = TRUE;
- rEventId = (ULONG)pSVEvent;
+ pSVEvent->mbCall = sal_True;
+ rEventId = (sal_uLong)pSVEvent;
Window* pDefWindow = ImplGetDefaultWindow();
if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void Application::RemoveUserEvent( ULONG nUserEvent )
+void Application::RemoveUserEvent( sal_uLong nUserEvent )
{
if(nUserEvent)
{
@@ -1150,13 +1149,13 @@ void Application::RemoveUserEvent( ULONG nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = FALSE;
+ pSVEvent->mbCall = sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Application::InsertIdleHdl( const Link& rLink, USHORT nPrio )
+sal_Bool Application::InsertIdleHdl( const Link& rLink, sal_uInt16 nPrio )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1438,7 +1437,7 @@ unsigned int Application::GetBestScreen( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-BOOL Application::InsertAccel( Accelerator* pAccel )
+sal_Bool Application::InsertAccel( Accelerator* pAccel )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1469,17 +1468,17 @@ void Application::FlushAccel()
// -----------------------------------------------------------------------
-BOOL Application::CallAccel( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mpAccelMgr )
{
if ( pSVData->maAppData.mpAccelMgr->IsAccelKey( rKeyCode, nRepeat ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1498,21 +1497,21 @@ Help* Application::GetHelp()
// -----------------------------------------------------------------------
-void Application::EnableAutoHelpId( BOOL bEnabled )
+void Application::EnableAutoHelpId( sal_Bool bEnabled )
{
ImplGetSVData()->maHelpData.mbAutoHelpId = bEnabled;
}
// -----------------------------------------------------------------------
-BOOL Application::IsAutoHelpIdEnabled()
+sal_Bool Application::IsAutoHelpIdEnabled()
{
return ImplGetSVData()->maHelpData.mbAutoHelpId;
}
// -----------------------------------------------------------------------
-void Application::EnableAutoMnemonic( BOOL bEnabled )
+void Application::EnableAutoMnemonic( sal_Bool bEnabled )
{
AllSettings aSettings = GetSettings();
StyleSettings aStyle = aSettings.GetStyleSettings();
@@ -1523,7 +1522,7 @@ void Application::EnableAutoMnemonic( BOOL bEnabled )
// -----------------------------------------------------------------------
-BOOL Application::IsAutoMnemonicEnabled()
+sal_Bool Application::IsAutoMnemonicEnabled()
{
return GetSettings().GetStyleSettings().GetAutoMnemonic();
}
@@ -1561,7 +1560,7 @@ Window* Application::GetDefDialogParent()
// #103442# find some useful dialog parent if there
// was no default set
// NOTE: currently even the default is not used
- if( FALSE && pSVData->maWinData.mpDefDialogParent != NULL )
+ if( sal_False && pSVData->maWinData.mpDefDialogParent != NULL )
return pSVData->maWinData.mpDefDialogParent;
else
{
@@ -1625,28 +1624,28 @@ Window* Application::GetDefDialogParent()
// -----------------------------------------------------------------------
-void Application::EnableDialogCancel( BOOL bDialogCancel )
+void Application::EnableDialogCancel( sal_Bool bDialogCancel )
{
ImplGetSVData()->maAppData.mbDialogCancel = bDialogCancel;
}
// -----------------------------------------------------------------------
-BOOL Application::IsDialogCancelEnabled()
+sal_Bool Application::IsDialogCancelEnabled()
{
return ImplGetSVData()->maAppData.mbDialogCancel;
}
// -----------------------------------------------------------------------
-void Application::SetSystemWindowMode( USHORT nMode )
+void Application::SetSystemWindowMode( sal_uInt16 nMode )
{
ImplGetSVData()->maAppData.mnSysWinMode = nMode;
}
// -----------------------------------------------------------------------
-USHORT Application::GetSystemWindowMode()
+sal_uInt16 Application::GetSystemWindowMode()
{
return ImplGetSVData()->maAppData.mnSysWinMode;
}
@@ -1696,7 +1695,7 @@ UniqueItemId Application::CreateUniqueId()
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > Application::GetVCLToolkit()
{
::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > xT;
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( TRUE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_True );
if ( pWrapper )
xT = pWrapper->GetVCLToolkit();
return xT;
@@ -1706,13 +1705,13 @@ UniqueItemId Application::CreateUniqueId()
extern "C" { static void SAL_CALL thisModule() {} }
-UnoWrapperBase* Application::GetUnoWrapper( BOOL bCreateIfNotExist )
+UnoWrapperBase* Application::GetUnoWrapper( sal_Bool bCreateIfNotExist )
{
ImplSVData* pSVData = ImplGetSVData();
- static BOOL bAlreadyTriedToCreate = FALSE;
+ static sal_Bool bAlreadyTriedToCreate = sal_False;
if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
{
- ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", TRUE );
+ ::rtl::OUString aLibName = ::vcl::unohelper::CreateLibraryName( "tk", sal_True );
oslModule hTkLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hTkLib )
@@ -1725,7 +1724,7 @@ UnoWrapperBase* Application::GetUnoWrapper( BOOL bCreateIfNotExist )
}
}
DBG_ASSERT( pSVData->mpUnoWrapper, "UnoWrapper could not be created!" );
- bAlreadyTriedToCreate = TRUE;
+ bAlreadyTriedToCreate = sal_True;
}
return pSVData->mpUnoWrapper;
}
@@ -1746,9 +1745,12 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->mxDisplayConnection.is() )
+ {
pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection );
+ pSVData->mxDisplayConnection->start();
+ }
- return pSVData->mxDisplayConnection;
+ return pSVData->mxDisplayConnection.get();
}
// -----------------------------------------------------------------------
@@ -1767,7 +1769,7 @@ const Link& Application::GetFilterHdl()
// -----------------------------------------------------------------------
-BOOL ImplCallHotKey( const KeyCode& rKeyCode )
+sal_Bool ImplCallHotKey( const KeyCode& rKeyCode )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey;
@@ -1776,13 +1778,13 @@ BOOL ImplCallHotKey( const KeyCode& rKeyCode )
if ( pHotKeyData->maKeyCode.IsDefinedKeyCodeEqual( rKeyCode ) )
{
pHotKeyData->maLink.Call( pHotKeyData->mpUserData );
- return TRUE;
+ return sal_True;
}
pHotKeyData = pHotKeyData->mpNext;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1804,7 +1806,7 @@ void ImplFreeHotKeyData()
// -----------------------------------------------------------------------
-ULONG Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
+sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pHotKeyData = new ImplHotKey;
@@ -1813,12 +1815,12 @@ ULONG Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void*
pHotKeyData->maLink = rLink;
pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey;
pSVData->maAppData.mpFirstHotKey = pHotKeyData;
- return (ULONG)pHotKeyData;
+ return (sal_uIntPtr)pHotKeyData;
}
// -----------------------------------------------------------------------
-void Application::RemoveHotKey( ULONG nId )
+void Application::RemoveHotKey( sal_uIntPtr nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId;
@@ -1862,7 +1864,7 @@ void ImplFreeEventHookData()
// -----------------------------------------------------------------------
-ULONG Application::AddEventHook( VCLEventHookProc pProc, void* pData )
+sal_uIntPtr Application::AddEventHook( VCLEventHookProc pProc, void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pEventHookData = new ImplEventHook;
@@ -1870,12 +1872,12 @@ ULONG Application::AddEventHook( VCLEventHookProc pProc, void* pData )
pEventHookData->mpProc = pProc;
pEventHookData->mpNext = pSVData->maAppData.mpFirstEventHook;
pSVData->maAppData.mpFirstEventHook = pEventHookData;
- return (ULONG)pEventHookData;
+ return (sal_uIntPtr)pEventHookData;
}
// -----------------------------------------------------------------------
-void Application::RemoveEventHook( ULONG nId )
+void Application::RemoveEventHook( sal_uIntPtr nId )
{
ImplSVData* pSVData = ImplGetSVData();
ImplEventHook* pFindEventHookData = (ImplEventHook*)nId;
@@ -1943,14 +1945,14 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
// -----------------------------------------------------------------------
-void Application::EnableHeadlessMode( BOOL bEnable )
+void Application::EnableHeadlessMode( sal_Bool bEnable )
{
EnableDialogCancel( bEnable );
}
// -----------------------------------------------------------------------
-BOOL Application::IsHeadlessModeEnabled()
+sal_Bool Application::IsHeadlessModeEnabled()
{
return IsDialogCancelEnabled();
}
@@ -2011,14 +2013,14 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
}
-BOOL Application::IsAccessibilityEnabled()
+sal_Bool Application::IsAccessibilityEnabled()
{
- return FALSE;
+ return sal_False;
}
-BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
+sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
{
- BOOL bRet = true;
+ sal_Bool bRet = true;
// Disable Java bridge on UNIX
#if defined UNX
@@ -2032,7 +2034,7 @@ BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
// disable accessibility if the user chooses to continue
AllSettings aSettings = Application::GetSettings();
MiscSettings aMisc = aSettings.GetMiscSettings();
- aMisc.SetEnableATToolSupport( FALSE );
+ aMisc.SetEnableATToolSupport( sal_False );
aSettings.SetMiscSettings( aMisc );
Application::SetSettings( aSettings );
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index b21ee99b777e..ee46f14acae0 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -28,45 +28,54 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+
#include <string.h>
#include <boost/ptr_container/ptr_vector.hpp>
-#include <svsys.h>
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-
-#include <osl/mutex.hxx>
-
-#include <osl/process.h>
#include <osl/file.hxx>
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <tools/debug.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/window.h>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/unohelp.hxx>
-#include <vcl/button.hxx> // for Button::GetStandardText
-#include <vcl/dockwin.hxx> // for DockingManager
-#include <vcl/salimestatus.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/awt/XExtendedToolkit.hpp>
-#include <com/sun/star/java/JavaNotConfiguredException.hpp>
-#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
-#include <com/sun/star/java/MissingJavaRuntimeException.hpp>
-#include <com/sun/star/java/JavaDisabledException.hpp>
-
-#include <com/sun/star/lang/XComponent.hpp>
+#include <osl/mutex.hxx>
+#include <rtl/process.h>
+
+#include "tools/debug.hxx"
+#include "tools/resary.hxx"
+
+#include "vcl/salinst.hxx"
+#include "vcl/salframe.hxx"
+#include "vcl/configsettings.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/window.h"
+#include "vcl/svapp.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/unohelp.hxx"
+#include "vcl/button.hxx" // for Button::GetStandardText
+#include "vcl/dockwin.hxx" // for DockingManager
+#include "vcl/salimestatus.hxx"
+#include "vcl/salsys.hxx"
+#include "vcl/svids.hrc"
+#include "vcl/xconnection.hxx"
+
+#include "unotools/fontcfg.hxx"
+
+#include "cppuhelper/implbase1.hxx"
+#include "uno/current_context.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/awt/XExtendedToolkit.hpp"
+#include "com/sun/star/java/JavaNotConfiguredException.hpp"
+#include "com/sun/star/java/JavaVMCreationFailureException.hpp"
+#include "com/sun/star/java/MissingJavaRuntimeException.hpp"
+#include "com/sun/star/java/JavaDisabledException.hpp"
#include <stdio.h>
-#include <vcl/salsys.hxx>
-#include <vcl/svids.hrc>
-#include <rtl/instance.hxx>
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -126,6 +135,9 @@ void ImplInitSVData()
break;
}
}
+
+ // mark default layout border as unitialized
+ pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
}
// -----------------------------------------------------------------------
@@ -161,6 +173,13 @@ void ImplDeInitSVData()
delete pSVData->maAppData.mpMSFTempFileName;
pSVData->maAppData.mpMSFTempFileName = NULL;
}
+
+ if( pSVData->maCtrlData.mpFieldUnitStrings )
+ delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
+ if( pSVData->maCtrlData.mpCleanUnitStrings )
+ delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
+ if( pSVData->mpPaperNames )
+ delete pSVData->mpPaperNames, pSVData->mpPaperNames = NULL;
}
// -----------------------------------------------------------------------
@@ -238,6 +257,52 @@ ResId VclResId( sal_Int32 nId )
return ResId( nId, *pMgr );
}
+FieldUnitStringList* ImplGetFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpFieldUnitStrings )
+ {
+ ResMgr* pResMgr = ImplGetResMgr();
+ if( pResMgr )
+ {
+ ResStringArray aUnits( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ sal_uInt32 nUnits = aUnits.Count();
+ pSVData->maCtrlData.mpFieldUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
+ for( sal_uInt32 i = 0; i < nUnits; i++ )
+ {
+ std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
+ pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpFieldUnitStrings;
+}
+
+FieldUnitStringList* ImplGetCleanedFieldUnits()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->maCtrlData.mpCleanUnitStrings )
+ {
+ FieldUnitStringList* pUnits = ImplGetFieldUnits();
+ if( pUnits )
+ {
+ size_t nUnits = pUnits->size();
+ pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList();
+ pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits );
+ for( size_t i = 0; i < nUnits; i++ )
+ {
+ String aUnit( (*pUnits)[i].first );
+ aUnit.EraseAllChars( sal_Unicode( ' ' ) );
+ aUnit.ToLowerAscii();
+ std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
+ pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
+ }
+ }
+ }
+ return pSVData->maCtrlData.mpCleanUnitStrings;
+}
+
DockingManager* ImplGetDockingManager()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -279,16 +344,16 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
}
-bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
+bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
{
- rCancelled = FALSE;
+ rCancelled = sal_False;
bool bErrorMessage = true;
// Note:
- // if bAllowCancel is TRUE we were called from application startup
+ // if bAllowCancel is sal_True we were called from application startup
// where we will disable any Java errorboxes and show our own accessibility dialog if Java throws an exception
- // if bAllowCancel is FALSE we were called from Tools->Options
+ // if bAllowCancel is sal_False we were called from Tools->Options
// where we will see Java errorboxes, se we do not show our dialogs in addition to Java's
try
@@ -305,12 +370,12 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() )
{
- Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
+ css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
if( xFactory.is() )
{
- Reference< XExtendedToolkit > xToolkit =
- Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
+ css::uno::Reference< XExtendedToolkit > xToolkit =
+ css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
Sequence< Any > arguments(1);
arguments[0] = makeAny(xToolkit);
@@ -365,7 +430,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -390,7 +455,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -415,7 +480,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -440,7 +505,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
return false;
@@ -482,7 +547,7 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled)
// Do not change the setting in case the user chooses to cancel
if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
- rCancelled = TRUE;
+ rCancelled = sal_True;
}
else
{
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 37091c86e62a..cc1ccc45facf 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -90,11 +90,8 @@
#include "rtl/strbuf.hxx"
#endif
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-
+using ::rtl::OUString;
+using namespace ::com::sun::star;
// =======================================================================
@@ -165,27 +162,23 @@ int ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
- Reference<XMultiServiceFactory> xMS;
+ uno::Reference<lang::XMultiServiceFactory> xMS;
int nReturn = EXIT_FAILURE;
- BOOL bInit = InitVCL( xMS );
+ sal_Bool bInit = InitVCL( xMS );
if( bInit )
{
// Application-Main rufen
- pSVData->maAppData.mbInAppMain = TRUE;
+ pSVData->maAppData.mbInAppMain = sal_True;
nReturn = pSVData->mpApp->Main();
- pSVData->maAppData.mbInAppMain = FALSE;
+ pSVData->maAppData.mbInAppMain = sal_False;
}
if( pSVData->mxDisplayConnection.is() )
{
- vcl::DisplayConnection* pConnection =
- dynamic_cast<vcl::DisplayConnection*>(pSVData->mxDisplayConnection.get());
-
- if( pConnection )
- pConnection->dispatchDowningEvent();
+ pSVData->mxDisplayConnection->terminate();
pSVData->mxDisplayConnection.clear();
}
@@ -194,10 +187,10 @@ int ImplSVMain()
// be some events in the AWT EventQueue, which need the SolarMutex which
// - on the other hand - is destroyed in DeInitVCL(). So empty the queue
// here ..
- Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
+ uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY);
if( xComponent.is() )
{
- ULONG nCount = Application::ReleaseSolarMutex();
+ sal_uLong nCount = Application::ReleaseSolarMutex();
xComponent->dispose();
Application::AcquireSolarMutex(nCount);
pSVData->mxAccessBridge.clear();
@@ -210,7 +203,7 @@ int ImplSVMain()
int SVMain()
{
// #i47888# allow for alternative initialization as required for e.g. MacOSX
- extern BOOL ImplSVMainHook( int* );
+ extern sal_Bool ImplSVMainHook( int* );
int nRet;
if( ImplSVMainHook( &nRet ) )
@@ -244,13 +237,13 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > m_xNextContext;
};
-Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (RuntimeException)
+uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (uno::RuntimeException)
{
- Any retVal;
+ uno::Any retVal;
if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("system.desktop-environment")))
{
- retVal = makeAny( Application::GetDesktopEnvironment() );
+ retVal = uno::makeAny( Application::GetDesktopEnvironment() );
}
else if( m_xNextContext.is() )
{
@@ -260,12 +253,12 @@ Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Nam
return retVal;
}
-BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
+sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
{
RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::InitVCL" );
if( pExceptionHandler != NULL )
- return FALSE;
+ return sal_False;
if( ! ImplGetSVData() )
ImplInitSVData();
@@ -294,7 +287,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ ::CreateSalInstance" );
pSVData->mpDefInst = CreateSalInstance();
if ( !pSVData->mpDefInst )
- return FALSE;
+ return sal_False;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} ::CreateSalInstance" );
// Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible)
@@ -319,7 +312,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
// Initialize global data
pSVData->maGDIData.mpScreenFontList = new ImplDevFontList;
- pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( FALSE );
+ pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( sal_False );
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
// Exception-Handler setzen
@@ -328,7 +321,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
// Debug-Daten initialisieren
DBGGUI_INIT();
- return TRUE;
+ return sal_True;
}
namespace
@@ -341,12 +334,12 @@ namespace
*/
class VCLUnoWrapperDeleter : public cppu::WeakImplHelper1<com::sun::star::lang::XEventListener>
{
- virtual void SAL_CALL disposing(EventObject const& rSource) throw(RuntimeException);
+ virtual void SAL_CALL disposing(lang::EventObject const& rSource) throw(uno::RuntimeException);
};
void
-VCLUnoWrapperDeleter::disposing(EventObject const& /* rSource */)
- throw(RuntimeException)
+VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
+ throw(uno::RuntimeException)
{
ImplSVData* const pSVData = ImplGetSVData();
if (pSVData && pSVData->mpUnoWrapper)
@@ -361,7 +354,7 @@ VCLUnoWrapperDeleter::disposing(EventObject const& /* rSource */)
void DeInitVCL()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->mbDeInit = TRUE;
+ pSVData->mbDeInit = sal_True;
vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit();
@@ -475,14 +468,14 @@ void DeInitVCL()
{
try
{
- Reference<XComponent> const xDesktop(
+ uno::Reference<lang::XComponent> const xDesktop(
comphelper::createProcessComponent(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
- UNO_QUERY_THROW)
+ uno::UNO_QUERY_THROW)
;
xDesktop->addEventListener(new VCLUnoWrapperDeleter());
}
- catch (Exception const&)
+ catch (uno::Exception const&)
{
// ignore
}
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index 725f90f05dc1..dd446125a7aa 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -32,9 +32,9 @@
#ifndef MACOSX
-BOOL ImplSVMainHook( int * )
+sal_Bool ImplSVMainHook( int * )
{
- return FALSE; // indicate that ImplSVMainHook is not implemented
+ return sal_False; // indicate that ImplSVMainHook is not implemented
}
#else
@@ -46,7 +46,7 @@ BOOL ImplSVMainHook( int * )
#include <postmac.h>
#include <unistd.h>
-extern BOOL ImplSVMain();
+extern sal_Bool ImplSVMain();
// ============================================================================
@@ -76,7 +76,7 @@ static void RunSVMain(void *pData)
_exit( 0 );
}
-BOOL ImplSVMainHook( int *pnInit )
+sal_Bool ImplSVMainHook( int *pnInit )
{
// Mac OS X requires that any Cocoa code have a CFRunLoop started in the
// primordial thread. Since all of the AWT classes in Java 1.4 and higher
@@ -110,7 +110,7 @@ BOOL ImplSVMainHook( int *pnInit )
osl_joinWithThread( hThreadID );
osl_destroyThread( hThreadID );
- return TRUE; // indicate that ImplSVMainHook is implemented
+ return sal_True; // indicate that ImplSVMainHook is implemented
}
#endif // MACOSX
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index d83c11e4f270..6c2d08b18659 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -42,7 +42,7 @@
// =======================================================================
-#define MAX_TIMER_PERIOD ((ULONG)0xFFFFFFFF)
+#define MAX_TIMER_PERIOD ((sal_uLong)0xFFFFFFFF)
// ---------------------
// - TimeManager-Types -
@@ -52,10 +52,10 @@ struct ImplTimerData
{
ImplTimerData* mpNext; // Pointer to the next Instance
Timer* mpSVTimer; // Pointer to SV Timer instance
- ULONG mnUpdateTime; // Last Update Time
- ULONG mnTimerUpdate; // TimerCallbackProcs on stack
- BOOL mbDelete; // Wurde Timer waehren Update() geloescht
- BOOL mbInTimeout; // Befinden wir uns im Timeout-Handler
+ sal_uLong mnUpdateTime; // Last Update Time
+ sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
+ sal_Bool mbDelete; // Wurde Timer waehren Update() geloescht
+ sal_Bool mbInTimeout; // Befinden wir uns im Timeout-Handler
};
// =======================================================================
@@ -72,7 +72,7 @@ void Timer::ImplDeInitTimer()
ImplTimerData* pTempTimerData = pTimerData;
if ( pTimerData->mpSVTimer )
{
- pTimerData->mpSVTimer->mbActive = FALSE;
+ pTimerData->mpSVTimer->mbActive = sal_False;
pTimerData->mpSVTimer->mpTimerData = NULL;
}
pTimerData = pTimerData->mpNext;
@@ -89,7 +89,7 @@ void Timer::ImplDeInitTimer()
// -----------------------------------------------------------------------
-static void ImplStartTimer( ImplSVData* pSVData, ULONG nMS )
+static void ImplStartTimer( ImplSVData* pSVData, sal_uLong nMS )
{
if ( !nMS )
nMS = 1;
@@ -108,15 +108,15 @@ void Timer::ImplTimerCallbackProc()
ImplSVData* pSVData = ImplGetSVData();
ImplTimerData* pTimerData;
ImplTimerData* pPrevTimerData;
- ULONG nMinPeriod = MAX_TIMER_PERIOD;
- ULONG nDeltaTime;
- ULONG nTime = Time::GetSystemTicks();
+ sal_uLong nMinPeriod = MAX_TIMER_PERIOD;
+ sal_uLong nDeltaTime;
+ sal_uLong nTime = Time::GetSystemTicks();
if ( pSVData->mbNoCallTimer )
return;
pSVData->mnTimerUpdate++;
- pSVData->mbNotAllTimerCalled = TRUE;
+ pSVData->mbNotAllTimerCalled = sal_True;
// Suche Timer raus, wo der Timeout-Handler gerufen werden muss
pTimerData = pSVData->mpFirstTimerData;
@@ -137,14 +137,14 @@ void Timer::ImplTimerCallbackProc()
// kein AutoTimer, dann anhalten
if ( !pTimerData->mpSVTimer->mbAuto )
{
- pTimerData->mpSVTimer->mbActive = FALSE;
- pTimerData->mbDelete = TRUE;
+ pTimerData->mpSVTimer->mbActive = sal_False;
+ pTimerData->mbDelete = sal_True;
}
// call Timeout
- pTimerData->mbInTimeout = TRUE;
+ pTimerData->mbInTimeout = sal_True;
pTimerData->mpSVTimer->Timeout();
- pTimerData->mbInTimeout = FALSE;
+ pTimerData->mbInTimeout = sal_False;
}
}
@@ -152,7 +152,7 @@ void Timer::ImplTimerCallbackProc()
}
// Neue Zeit ermitteln
- ULONG nNewTime = Time::GetSystemTicks();
+ sal_uLong nNewTime = Time::GetSystemTicks();
pPrevTimerData = NULL;
pTimerData = pSVData->mpFirstTimerData;
while ( pTimerData )
@@ -213,7 +213,7 @@ void Timer::ImplTimerCallbackProc()
ImplStartTimer( pSVData, nMinPeriod );
pSVData->mnTimerUpdate--;
- pSVData->mbNotAllTimerCalled = FALSE;
+ pSVData->mbNotAllTimerCalled = sal_False;
}
// =======================================================================
@@ -222,8 +222,8 @@ Timer::Timer()
{
mpTimerData = NULL;
mnTimeout = 1;
- mbAuto = FALSE;
- mbActive = FALSE;
+ mbAuto = sal_False;
+ mbActive = sal_False;
}
// -----------------------------------------------------------------------
@@ -232,8 +232,8 @@ Timer::Timer( const Timer& rTimer )
{
mpTimerData = NULL;
mnTimeout = rTimer.mnTimeout;
- mbAuto = FALSE;
- mbActive = FALSE;
+ mbAuto = sal_False;
+ mbActive = sal_False;
maTimeoutHdl = rTimer.maTimeoutHdl;
if ( rTimer.IsActive() )
@@ -246,7 +246,7 @@ Timer::~Timer()
{
if ( mpTimerData )
{
- mpTimerData->mbDelete = TRUE;
+ mpTimerData->mbDelete = sal_True;
mpTimerData->mpSVTimer = NULL;
}
}
@@ -260,7 +260,7 @@ void Timer::Timeout()
// -----------------------------------------------------------------------
-void Timer::SetTimeout( ULONG nNewTimeout )
+void Timer::SetTimeout( sal_uLong nNewTimeout )
{
mnTimeout = nNewTimeout;
@@ -277,7 +277,7 @@ void Timer::SetTimeout( ULONG nNewTimeout )
void Timer::Start()
{
- mbActive = TRUE;
+ mbActive = sal_True;
ImplSVData* pSVData = ImplGetSVData();
if ( !mpTimerData )
@@ -297,8 +297,8 @@ void Timer::Start()
mpTimerData->mpSVTimer = this;
mpTimerData->mnUpdateTime = Time::GetSystemTicks();
mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = FALSE;
- mpTimerData->mbInTimeout = FALSE;
+ mpTimerData->mbDelete = sal_False;
+ mpTimerData->mbInTimeout = sal_False;
// !!!!! Wegen SFX hinten einordnen !!!!!
ImplTimerData* pPrev = NULL;
@@ -325,7 +325,7 @@ void Timer::Start()
{
mpTimerData->mnUpdateTime = Time::GetSystemTicks();
mpTimerData->mnTimerUpdate = pSVData->mnTimerUpdate;
- mpTimerData->mbDelete = FALSE;
+ mpTimerData->mbDelete = sal_False;
}
}
@@ -333,10 +333,10 @@ void Timer::Start()
void Timer::Stop()
{
- mbActive = FALSE;
+ mbActive = sal_False;
if ( mpTimerData )
- mpTimerData->mbDelete = TRUE;
+ mpTimerData->mbDelete = sal_True;
}
// -----------------------------------------------------------------------
@@ -346,7 +346,7 @@ Timer& Timer::operator=( const Timer& rTimer )
if ( IsActive() )
Stop();
- mbActive = FALSE;
+ mbActive = sal_False;
mnTimeout = rTimer.mnTimeout;
maTimeoutHdl = rTimer.maTimeoutHdl;
@@ -360,14 +360,14 @@ Timer& Timer::operator=( const Timer& rTimer )
AutoTimer::AutoTimer()
{
- mbAuto = TRUE;
+ mbAuto = sal_True;
}
// -----------------------------------------------------------------------
AutoTimer::AutoTimer( const AutoTimer& rTimer ) : Timer( rTimer )
{
- mbAuto = TRUE;
+ mbAuto = sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 0640d9cfbc49..1fe4158433a0 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -85,7 +85,7 @@ namespace vcl { namespace unohelper {
{
uno::Any aAny;
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetString();
@@ -106,7 +106,7 @@ namespace vcl { namespace unohelper {
sal_Bool TextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 705eebf93aee..f7614c99046b 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -41,7 +41,7 @@ TYPEINIT0(VclSimpleEvent);
TYPEINIT1(VclWindowEvent, VclSimpleEvent);
TYPEINIT1(VclMenuEvent, VclSimpleEvent);
-VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference<XAccessible>& rxAccessible ) :
+VclAccessibleEvent::VclAccessibleEvent( sal_uLong n, const Reference<XAccessible>& rxAccessible ) :
VclSimpleEvent(n),
mxAccessible(rxAccessible)
{
@@ -84,12 +84,12 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
}
}
-BOOL VclEventListeners::Process( VclSimpleEvent* pEvent ) const
+sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
if ( m_aListeners.empty() )
- return FALSE;
+ return sal_False;
- BOOL bProcessed = FALSE;
+ sal_Bool bProcessed = sal_False;
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
@@ -97,7 +97,7 @@ BOOL VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
if( (*aIter).Call( pEvent ) != 0 )
{
- bProcessed = TRUE;
+ bProcessed = sal_True;
break;
}
aIter++;
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 69be4002928f..9325c047b5d7 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -59,6 +59,10 @@ extern Sequence< OUString > SAL_CALL FontIdentificator_getSupportedServiceNames(
extern OUString SAL_CALL FontIdentificator_getImplementationName();
extern Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Reference< XMultiServiceFactory > & );
+extern Sequence< OUString > SAL_CALL StringMirror_getSupportedServiceNames();
+extern OUString SAL_CALL StringMirror_getImplementationName();
+extern Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory > & );
+
extern Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames();
extern OUString SAL_CALL Clipboard_getImplementationName();
extern Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & );
@@ -81,62 +85,6 @@ extern "C" {
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- VCL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pXUnoKey )
- {
- if( pXUnoKey )
- {
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) );
-
- OUStringBuffer aImplName(64);
- aImplName.appendAscii( "/" );
- aImplName.append( vcl_session_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl_session_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DisplayAccess_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DisplayAccess_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::FontIdentificator_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::FontIdentificator_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- #if defined UNX
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::Clipboard_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::Clipboard_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DragSource_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DragSource_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
-
- aImplName.appendAscii( "/" );
- aImplName.append( vcl::DropTarget_getImplementationName() );
- aImplName.appendAscii( "/UNO/SERVICES/" );
- aImplName.append( vcl::DropTarget_getSupportedServiceNames()[0] );
- xKey->createKey( aImplName.makeStringAndClear() );
- #endif
-
- return sal_True;
- }
- catch( ::com::sun::star::registry::InvalidRegistryException& )
- {
- }
- }
- return sal_False;
- }
-
VCL_DLLPUBLIC void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pXUnoSMgr,
@@ -169,6 +117,12 @@ extern "C" {
xMgr, vcl::FontIdentificator_getImplementationName(), vcl::FontIdentificator_createInstance,
vcl::FontIdentificator_getSupportedServiceNames() );
}
+ else if( vcl::StringMirror_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ xMgr, vcl::StringMirror_getImplementationName(), vcl::StringMirror_createInstance,
+ vcl::StringMirror_getSupportedServiceNames() );
+ }
else if( vcl::Clipboard_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = vcl::Clipboard_createFactory( xMgr );
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
index e30975dbc099..982687104c01 100644
--- a/vcl/source/components/makefile.mk
+++ b/vcl/source/components/makefile.mk
@@ -39,9 +39,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/display.obj \
- $(SLO)$/dtranscomp.obj \
- $(SLO)$/fontident.obj \
+SLOFILES= $(SLO)$/display.obj \
+ $(SLO)$/dtranscomp.obj \
+ $(SLO)$/fontident.obj \
+ $(SLO)$/stringmirror.obj \
$(SLO)$/factory.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx
new file mode 100644
index 000000000000..78806914a7c4
--- /dev/null
+++ b/vcl/source/components/stringmirror.cxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/util/XStringMapping.hpp"
+
+#include "cppuhelper/implbase2.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "vcl/svapp.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::util;
+
+// -----------------------------------------------------------------------
+
+namespace vcl
+{
+
+class StringMirror : public ::cppu::WeakAggImplHelper2< XStringMapping, XServiceInfo >
+{
+public:
+ StringMirror()
+ {}
+
+ virtual ~StringMirror()
+ {}
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ) throw (RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+ // XStringMapping
+ virtual sal_Bool SAL_CALL mapStrings( Sequence< OUString >& io_rStrings ) throw (RuntimeException)
+ {
+ sal_Int32 nItems = io_rStrings.getLength();
+ for( sal_Int32 n = 0; n < nItems; n++ )
+ {
+ rtl::OUString& rStr( io_rStrings.getArray()[n] );
+
+ sal_Int32 nLen = rStr.getLength();
+ rtl::OUStringBuffer aMirror( nLen );
+ for(sal_Int32 i = nLen - 1; i >= 0; i--)
+ {
+ sal_Unicode cChar = rStr[ i ];
+ aMirror.append(sal_Unicode(GetMirroredChar(cChar)));
+ }
+ rStr = aMirror.makeStringAndClear();
+ }
+ return sal_True;
+ }
+};
+
+Sequence< OUString > StringMirror_getSupportedServiceNames()
+{
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.StringMirror" ) );
+ static Sequence< OUString > aServiceNames( &aServiceName, 1 );
+ return aServiceNames;
+}
+
+OUString StringMirror_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "vcl::StringMirror" ) );
+}
+
+Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory >& )
+{
+ return static_cast< ::cppu::OWeakObject * >( new StringMirror );
+}
+
+
+// XServiceInfo
+OUString SAL_CALL StringMirror::getImplementationName() throw (RuntimeException)
+{
+ return StringMirror_getImplementationName();
+}
+
+sal_Bool SAL_CALL StringMirror::supportsService( const OUString& i_rServiceName ) throw (RuntimeException)
+{
+ Sequence< OUString > aSN( StringMirror_getSupportedServiceNames() );
+ for( sal_Int32 nService = 0; nService < aSN.getLength(); nService++ )
+ {
+ if( aSN[nService] == i_rServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (RuntimeException)
+{
+ return StringMirror_getSupportedServiceNames();
+}
+
+} // namespace vcl
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 962ad4553a29..7efaf732da34 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -77,8 +77,8 @@ class ImplCommonButtonData
public:
Rectangle maFocusRect;
Rectangle maSymbolRect;
- USHORT mnButtonState;
- BOOL mbSmallSymbol;
+ sal_uInt16 mnButtonState;
+ sal_Bool mbSmallSymbol;
Image maImage;
BitmapEx* mpBitmapEx;
@@ -94,7 +94,7 @@ public:
ImplCommonButtonData::ImplCommonButtonData()
{
mnButtonState = 0;
- mbSmallSymbol = FALSE;
+ mbSmallSymbol = sal_False;
mpBitmapEx = NULL;
meImageAlign = IMAGEALIGN_TOP;
@@ -180,12 +180,12 @@ XubString Button::GetStandardText( StandardButtonType eButton )
ResMgr* pResMgr = ImplGetResMgr();
if( pResMgr )
{
- ResId aResId( aResIdAry[(USHORT)eButton].nResId, *pResMgr );
+ ResId aResId( aResIdAry[(sal_uInt16)eButton].nResId, *pResMgr );
aText = String( aResId );
}
else
{
- ByteString aT( aResIdAry[(USHORT)eButton].pDefText );
+ ByteString aT( aResIdAry[(sal_uInt16)eButton].pDefText );
aText = String( aT, RTL_TEXTENCODING_ASCII_US );
}
return aText;
@@ -199,7 +199,7 @@ XubString Button::GetStandardHelpText( StandardButtonType /* eButton */ )
return aHelpText;
}
// -----------------------------------------------------------------------
-BOOL Button::SetModeImage( const Image& rImage )
+sal_Bool Button::SetModeImage( const Image& rImage )
{
if ( rImage != mpButtonData->maImage )
{
@@ -210,7 +210,7 @@ BOOL Button::SetModeImage( const Image& rImage )
StateChanged( STATE_CHANGE_DATA );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -220,7 +220,7 @@ const Image Button::GetModeImage( ) const
}
// -----------------------------------------------------------------------
-BOOL Button::HasImage() const
+sal_Bool Button::HasImage() const
{
return !!(mpButtonData->maImage);
}
@@ -242,15 +242,15 @@ ImageAlign Button::GetImageAlign() const
}
// -----------------------------------------------------------------------
-BOOL Button::SetModeBitmap( const BitmapEx& rBitmap )
+sal_Bool Button::SetModeBitmap( const BitmapEx& rBitmap )
{
if ( SetModeImage( rBitmap ) )
{
if ( !mpButtonData->mpBitmapEx )
mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -290,11 +290,11 @@ void Button::ImplSetSymbolRect( const Rectangle& i_rRect )
// -----------------------------------------------------------------------
-USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
- ULONG nDrawFlags )
+sal_uInt16 Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
+ sal_uLong nDrawFlags )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
@@ -321,15 +321,15 @@ USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
// -----------------------------------------------------------------------
void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
- Size& rSize, BOOL bLayout,
- ULONG nImageSep, ULONG nDrawFlags,
- USHORT nTextStyle, Rectangle *pSymbolRect,
+ Size& rSize, sal_Bool bLayout,
+ sal_uLong nImageSep, sal_uLong nDrawFlags,
+ sal_uInt16 nTextStyle, Rectangle *pSymbolRect,
bool bAddImageSep )
{
XubString aText( GetText() );
- BOOL bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
- BOOL bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
- BOOL bHasSymbol = pSymbolRect ? TRUE : FALSE;
+ sal_Bool bDrawImage = HasImage() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOIMAGE );
+ sal_Bool bDrawText = aText.Len() && ! ( ImplGetButtonState() & BUTTON_DRAW_NOTEXT );
+ sal_Bool bHasSymbol = pSymbolRect ? sal_True : sal_False;
// No text and no image => nothing to do => return
if ( !bDrawImage && !bDrawText && !bHasSymbol )
@@ -580,7 +580,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( ! ( nDrawFlags & WINDOW_DRAW_NODISABLE ) &&
! IsEnabled() )
@@ -640,13 +640,13 @@ const Rectangle& Button::ImplGetFocusRect() const
}
// -----------------------------------------------------------------------
-USHORT& Button::ImplGetButtonState()
+sal_uInt16& Button::ImplGetButtonState()
{
return mpButtonData->mnButtonState;
}
// -----------------------------------------------------------------------
-USHORT Button::ImplGetButtonState() const
+sal_uInt16 Button::ImplGetButtonState() const
{
return mpButtonData->mnButtonState;
}
@@ -668,13 +668,13 @@ SymbolAlign Button::ImplGetSymbolAlign() const
}
// -----------------------------------------------------------------------
-void Button::ImplSetSmallSymbol( BOOL bSmall )
+void Button::ImplSetSmallSymbol( sal_Bool bSmall )
{
mpButtonData->mbSmallSymbol = bSmall;
}
// -----------------------------------------------------------------------
-void Button::EnableImageDisplay( BOOL bEnable )
+void Button::EnableImageDisplay( sal_Bool bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOIMAGE;
@@ -683,13 +683,13 @@ void Button::EnableImageDisplay( BOOL bEnable )
}
// -----------------------------------------------------------------------
-BOOL Button::IsImageDisplayEnabled()
+sal_Bool Button::IsImageDisplayEnabled()
{
return (mpButtonData->mnButtonState & BUTTON_DRAW_NOIMAGE) == 0;
}
// -----------------------------------------------------------------------
-void Button::EnableTextDisplay( BOOL bEnable )
+void Button::EnableTextDisplay( sal_Bool bEnable )
{
if( bEnable )
mpButtonData->mnButtonState &= ~BUTTON_DRAW_NOTEXT;
@@ -698,53 +698,12 @@ void Button::EnableTextDisplay( BOOL bEnable )
}
// -----------------------------------------------------------------------
-BOOL Button::IsTextDisplayEnabled()
+sal_Bool Button::IsTextDisplayEnabled()
{
return (mpButtonData->mnButtonState & BUTTON_DRAW_NOTEXT) == 0;
}
// -----------------------------------------------------------------------
-void Button::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Control::DataChanged( rDCEvt );
-
- // The flag SETTINGS_IN_UPDATE_SETTINGS is set when the settings changed due to a
- // Application::SettingsChanged event. In this scenario we want to keep the style settings
- // of our radio buttons and our check boxes.
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
- ( rDCEvt.GetFlags() & SETTINGS_IN_UPDATE_SETTINGS ) )
-
- {
- const AllSettings* pOldSettings = rDCEvt.GetOldSettings();
- if ( pOldSettings )
- {
- BOOL bResetStyleSettings = FALSE;
- AllSettings aAllSettings = GetSettings();
- StyleSettings aStyleSetting = aAllSettings.GetStyleSettings();
-
- USHORT nCheckBoxStyle = aStyleSetting.GetCheckBoxStyle();
- if ( nCheckBoxStyle != pOldSettings->GetStyleSettings().GetCheckBoxStyle() )
- {
- aStyleSetting.SetCheckBoxStyle( pOldSettings->GetStyleSettings().GetCheckBoxStyle() );
- bResetStyleSettings = TRUE;
- }
-
- USHORT nRadioButtonStyle = aStyleSetting.GetRadioButtonStyle();
- if ( nRadioButtonStyle != pOldSettings->GetStyleSettings().GetRadioButtonStyle() )
- {
- aStyleSetting.SetRadioButtonStyle( pOldSettings->GetStyleSettings().GetRadioButtonStyle() );
- bResetStyleSettings = TRUE;
- }
-
- if ( bResetStyleSettings )
- {
- aAllSettings.SetStyleSettings( pOldSettings->GetStyleSettings() );
- SetSettings( aAllSettings );
- }
- }
- }
-}
-
void Button::SetSmallSymbol (bool small)
{
ImplSetSmallSymbol (small);
@@ -759,14 +718,14 @@ bool Button::IsSmallSymbol () const
void PushButton::ImplInitPushButtonData()
{
- mpWindowImpl->mbPushButton = TRUE;
+ mpWindowImpl->mbPushButton = sal_True;
meSymbol = SYMBOL_NOSYMBOL;
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
mnDDStyle = 0;
- mbPressed = FALSE;
- mbInUserDraw = FALSE;
+ mbPressed = sal_False;
+ mbInUserDraw = sal_False;
}
// -----------------------------------------------------------------------
@@ -779,7 +738,7 @@ void PushButton::ImplInit( Window* pParent, WinBits nStyle )
if ( nStyle & WB_NOLIGHTBORDER )
ImplGetButtonState() |= BUTTON_DRAW_NOLIGHTBORDER;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -820,8 +779,8 @@ const Color& PushButton::GetCanonicalTextColor( const StyleSettings& _rStyle ) c
// -----------------------------------------------------------------------
-void PushButton::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void PushButton::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -831,20 +790,21 @@ void PushButton::ImplInitSettings( BOOL bFont,
// #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
// otherwise the formcontrol button will be overdrawn due to PARENTCLIPMODE_NOCLIP
// for radio and checkbox this is ok as they shoud appear transparent in documents
- if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) )
+ if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ||
+ (GetStyle() & WB_FLATBUTTON) != 0 )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON)
? false
: ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
}
}
}
@@ -852,132 +812,13 @@ void PushButton::ImplInitSettings( BOOL bFont,
// -----------------------------------------------------------------------
void PushButton::ImplDrawPushButtonFrame( Window* pDev,
- Rectangle& rRect, USHORT nStyle )
+ Rectangle& rRect, sal_uInt16 nStyle )
{
if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) )
{
StyleSettings aStyleSettings = pDev->GetSettings().GetStyleSettings();
if ( pDev->IsControlBackground() )
aStyleSettings.Set3DColors( pDev->GetControlBackground() );
-
- USHORT nPushButtonSysStyle = aStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- pDev->SetLineColor();
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( rRect );
-
- if ( (aStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
- (pDev->GetOutDevType() == OUTDEV_PRINTER) )
- nStyle |= BUTTON_DRAW_MONO;
-
- if ( nStyle & BUTTON_DRAW_DEFAULT )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Top() ),
- Point( rRect.Right()-3, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom() ),
- Point( rRect.Right()-3, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+3 ),
- Point( rRect.Left(), rRect.Bottom()-3 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+3 ),
- Point( rRect.Right(), rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+2 ) );
- pDev->DrawPixel( Point( rRect.Left()+2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-2 ) );
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+3, rRect.Bottom()-1 ),
- Point( rRect.Right()-3, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+3 ),
- Point( rRect.Right()-1, rRect.Bottom()-3 ) );
- pDev->DrawPixel( Point( rRect.Right()-3, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-3 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetDarkShadowColor() );
-
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top() ),
- Point( rRect.Right()-2, rRect.Top() ) );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom() ),
- Point( rRect.Right()-2, rRect.Bottom() ) );
- pDev->DrawLine( Point( rRect.Left(), rRect.Top()+2 ),
- Point( rRect.Left(), rRect.Bottom()-2 ) );
- pDev->DrawLine( Point( rRect.Right(), rRect.Top()+2 ),
- Point( rRect.Right(), rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Top()+1 ) );
- pDev->DrawPixel( Point( rRect.Left()+1, rRect.Bottom()-1 ) );
- pDev->DrawPixel( Point( rRect.Right()-1, rRect.Bottom()-1 ) );
-
- pDev->SetLineColor();
- if ( nStyle & BUTTON_DRAW_CHECKED )
- pDev->SetFillColor( aStyleSettings.GetCheckedColor() );
- else
- pDev->SetFillColor( aStyleSettings.GetFaceColor() );
- pDev->DrawRect( Rectangle( rRect.Left()+2, rRect.Top()+2, rRect.Right()-2, rRect.Bottom()-2 ) );
-
- if ( !(nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED)) )
- {
- if ( nStyle & BUTTON_DRAW_MONO )
- pDev->SetLineColor( Color( COL_BLACK ) );
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Bottom()-1 ),
- Point( rRect.Right()-2, rRect.Bottom()-1 ) );
- pDev->DrawLine( Point( rRect.Right()-1, rRect.Top()+2 ),
- Point( rRect.Right()-1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Right()-2, rRect.Bottom()-2 ) );
- pDev->SetLineColor( aStyleSettings.GetLightColor() );
- }
- else
- pDev->SetLineColor( aStyleSettings.GetShadowColor() );
-
- if ( !(nStyle & BUTTON_DRAW_MONO) )
- {
- pDev->DrawLine( Point( rRect.Left()+2, rRect.Top()+1 ),
- Point( rRect.Right()-2, rRect.Top()+1 ) );
- pDev->DrawLine( Point( rRect.Left()+1, rRect.Top()+2 ),
- Point( rRect.Left()+1, rRect.Bottom()-2 ) );
- pDev->DrawPixel( Point( rRect.Top()+2, rRect.Right()+2 ) );
- }
-
- rRect.Left() += 2;
- rRect.Top() += 2;
- rRect.Right() -= 2;
- rRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- rRect.Left()++;
- rRect.Top()++;
- rRect.Right()++;
- rRect.Bottom()++;
- }
-
- return;
- }
}
DecorationView aDecoView( pDev );
@@ -998,36 +839,22 @@ void PushButton::ImplDrawPushButtonFrame( Window* pDev,
// -----------------------------------------------------------------------
-BOOL PushButton::ImplHitTestPushButton( Window* pDev,
+sal_Bool PushButton::ImplHitTestPushButton( Window* pDev,
const Point& rPos )
{
Point aTempPoint;
Rectangle aTestRect( aTempPoint, pDev->GetOutputSizePixel() );
- if ( !(pDev->GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) )
- {
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
-
- USHORT nPushButtonSysStyle = rStyleSettings.GetPushButtonStyle() & STYLE_PUSHBUTTON_STYLE;
- if ( nPushButtonSysStyle == STYLE_PUSHBUTTON_MAC )
- {
- aTestRect.Left() += 2;
- aTestRect.Top() += 2;
- aTestRect.Right() -= 2;
- aTestRect.Bottom() -= 2;
- }
- }
-
return aTestRect.IsInside( rPos );
}
// -----------------------------------------------------------------------
-USHORT PushButton::ImplGetTextStyle( ULONG nDrawFlags ) const
+sal_uInt16 PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
if ( ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) ||
( nDrawFlags & WINDOW_DRAW_MONO ) )
@@ -1062,7 +889,7 @@ USHORT PushButton::ImplGetTextStyle( ULONG nDrawFlags ) const
static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
long nX, long nY,
- Color& rColor, BOOL bBlack )
+ Color& rColor, sal_Bool bBlack )
{
Color aOldLineColor = pDev->GetLineColor();
Color aOldFillColor = pDev->GetFillColor();
@@ -1088,16 +915,18 @@ static void ImplDrawBtnDropDownArrow( OutputDevice* pDev,
// -----------------------------------------------------------------------
-void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags,
+void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
const Rectangle& rRect,
- bool bLayout )
+ bool bLayout,
+ bool bMenuBtnSep
+ )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aInRect = rRect;
Color aColor;
XubString aText = PushButton::GetText(); // PushButton:: wegen MoreButton
- USHORT nTextStyle = ImplGetTextStyle( nDrawFlags );
- USHORT nStyle;
+ sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
+ sal_uInt16 nStyle;
if( aInRect.nRight < aInRect.nLeft || aInRect.nBottom < aInRect.nTop )
aInRect.SetEmpty();
@@ -1124,7 +953,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
Size aSize = rRect.GetSize();
Point aPos = rRect.TopLeft();
- ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
+ sal_uLong nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
if( nImageSep < 1 )
nImageSep = 1;
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
@@ -1138,19 +967,22 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
aSize.Width() -= ( 5 + nSymbolSize );
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
- nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nDrawFlags, nTextStyle, NULL, true );
}
else
ImplCalcSymbolRect( aInRect );
if( ! bLayout )
{
- DecorationView aDecoView( pDev );
long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
- long nX = aInRect.Left() - 2*nDistance;;
- Point aStartPt( nX, aInRect.Top()+nDistance );
- Point aEndPt( nX, aInRect.Bottom()-nDistance );
- aDecoView.DrawSeparator( aStartPt, aEndPt );
+ DecorationView aDecoView( pDev );
+ if( bMenuBtnSep )
+ {
+ long nX = aInRect.Left() - 2*nDistance;;
+ Point aStartPt( nX, aInRect.Top()+nDistance );
+ Point aEndPt( nX, aInRect.Bottom()-nDistance );
+ aDecoView.DrawSeparator( aStartPt, aEndPt );
+ }
aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
aInRect.Left() -= 2*nDistance;
ImplSetSymbolRect( aInRect );
@@ -1162,7 +994,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
// FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary
// in the next major this should be replaced by "true"
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags,
- nTextStyle, IsSymbol() ? &aSymbolRect : NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ nTextStyle, IsSymbol() ? &aSymbolRect : NULL, true );
if ( IsSymbol() && ! bLayout )
{
@@ -1173,7 +1005,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
{
- BOOL bBlack = FALSE;
+ sal_Bool bBlack = sal_False;
Color aArrowColor( COL_BLACK );
if ( !(nDrawFlags & WINDOW_DRAW_MONO) )
@@ -1183,7 +1015,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
else
{
aArrowColor = Color( COL_LIGHTGREEN );
- bBlack = TRUE;
+ bBlack = sal_True;
}
}
@@ -1211,13 +1043,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
if( !bLayout )
HideFocus();
- USHORT nButtonStyle = ImplGetButtonState();
+ sal_uInt16 nButtonStyle = ImplGetButtonState();
Point aPoint;
Size aOutSz( GetOutputSizePixel() );
Rectangle aRect( aPoint, aOutSz );
Rectangle aInRect = aRect;
Rectangle aTextRect;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// adjust style if button should be rendered 'pressed'
if ( mbPressed )
@@ -1247,7 +1079,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
break;
}
- BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX ) )
{
@@ -1258,11 +1090,11 @@ void PushButton::ImplDrawPushButton( bool bLayout )
{
Edit* pEdit = static_cast<Edit*>(GetParent());
if( pEdit->ImplUseNativeBorder( pEdit->GetStyle() ) )
- bNativeOK = TRUE;
+ bNativeOK = sal_True;
}
else if( GetParent()->IsNativeControlSupported( aCtrlType, HAS_BACKGROUND_TEXTURE) )
{
- bNativeOK = TRUE;
+ bNativeOK = sal_True;
}
if( !bNativeOK && GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN ) )
{
@@ -1291,7 +1123,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
return;
bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
- if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ bool bDrawMenuSep = true;
+ if( (GetStyle() & WB_FLATBUTTON) )
+ {
+ if( ! bRollOver && ! HasFocus() )
+ bDrawMenuSep = false;
+ }
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
PushButtonValue aControlValue;
Rectangle aCtrlRegion( aInRect );
@@ -1341,13 +1179,13 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// draw content using the same aInRect as non-native VCL would do
ImplDrawPushButtonContent( this,
(nState&CTRL_STATE_ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0,
- aInRect, bLayout );
+ aInRect, bLayout, bDrawMenuSep );
if ( HasFocus() )
ShowFocus( ImplGetFocusRect() );
}
- if ( bNativeOK == FALSE )
+ if ( bNativeOK == sal_False )
{
// draw PushButtonFrame, aInRect has content size afterwards
if( (GetStyle() & WB_FLATBUTTON) )
@@ -1367,7 +1205,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
}
// draw content
- ImplDrawPushButtonContent( this, 0, aInRect, bLayout );
+ ImplDrawPushButtonContent( this, 0, aInRect, bLayout, bDrawMenuSep );
if( ! bLayout && HasFocus() )
{
@@ -1378,14 +1216,14 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// -----------------------------------------------------------------------
-void PushButton::ImplSetDefButton( BOOL bSet )
+void PushButton::ImplSetDefButton( sal_Bool bSet )
{
Size aSize( GetSizePixel() );
Point aPos( GetPosPixel() );
int dLeft(0), dRight(0), dTop(0), dBottom(0);
- BOOL bSetPos = FALSE;
+ sal_Bool bSetPos = sal_False;
- if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
Rectangle aBound, aCont;
Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
@@ -1438,7 +1276,7 @@ void PushButton::ImplSetDefButton( BOOL bSet )
// -----------------------------------------------------------------------
-BOOL PushButton::ImplIsDefButton() const
+sal_Bool PushButton::ImplIsDefButton() const
{
return (ImplGetButtonState() & BUTTON_DRAW_DEFAULT) != 0;
}
@@ -1488,7 +1326,7 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() &&
ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
{
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
if ( ( GetStyle() & WB_REPEAT ) &&
! ( GetStyle() & WB_TOGGLE ) )
@@ -1521,11 +1359,11 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
{
if ( IsChecked() )
{
- Check( FALSE );
+ Check( sal_False );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( TRUE );
+ Check( sal_True );
}
}
else
@@ -1610,11 +1448,11 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
{
if ( IsChecked() )
{
- Check( FALSE );
+ Check( sal_False );
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
}
else
- Check( TRUE );
+ Check( sal_True );
Toggle();
}
@@ -1649,7 +1487,7 @@ void PushButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1681,14 +1519,14 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextFillColor();
DecorationView aDecoView( pDev );
- USHORT nButtonStyle = 0;
+ sal_uInt16 nButtonStyle = 0;
if ( nFlags & WINDOW_DRAW_MONO )
nButtonStyle |= BUTTON_DRAW_MONO;
if ( IsChecked() )
nButtonStyle |= BUTTON_DRAW_CHECKED;
aRect = aDecoView.DrawButton( aRect, nButtonStyle );
- ImplDrawPushButtonContent( pDev, nFlags, aRect, false );
+ ImplDrawPushButtonContent( pDev, nFlags, aRect, false, true );
pDev->Pop();
}
@@ -1753,17 +1591,17 @@ void PushButton::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -1779,7 +1617,7 @@ void PushButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1821,7 +1659,7 @@ long PushButton::PreNotify( NotifyEvent& rNEvt )
break;
}
- BOOL bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
+ sal_Bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && !GetText().Len() );
if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, PART_ENTIRE_CONTROL) &&
!GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
@@ -1884,7 +1722,7 @@ SymbolAlign PushButton::GetSymbolAlign() const
// -----------------------------------------------------------------------
-void PushButton::SetDropDown( USHORT nStyle )
+void PushButton::SetDropDown( sal_uInt16 nStyle )
{
if ( mnDDStyle != nStyle )
{
@@ -1920,7 +1758,7 @@ void PushButton::SetState( TriState eState )
// -----------------------------------------------------------------------
-void PushButton::SetPressed( BOOL bPressed )
+void PushButton::SetPressed( sal_Bool bPressed )
{
if ( mbPressed != bPressed )
{
@@ -1961,7 +1799,7 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
aSize = GetModeImage().GetSizePixel();
if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
- ULONG nDrawFlags = 0;
+ sal_uLong nDrawFlags = 0;
Size textSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ),
PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize();
aSize.Width() += int( textSize.Width () * 1.15 );
@@ -2034,7 +1872,7 @@ void OKButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( TRUE );
+ ((Dialog*)pParent)->EndDialog( sal_True );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -2100,7 +1938,7 @@ void CancelButton::Click()
if ( pParent->IsDialog() )
{
if ( ((Dialog*)pParent)->IsInExecute() )
- ((Dialog*)pParent)->EndDialog( FALSE );
+ ((Dialog*)pParent)->EndDialog( sal_False );
// gegen rekursive Aufrufe schuetzen
else if ( !((Dialog*)pParent)->IsInClose() )
{
@@ -2174,10 +2012,10 @@ void HelpButton::Click()
void RadioButton::ImplInitRadioButtonData()
{
- mbChecked = FALSE;
- mbSaveValue = FALSE;
- mbRadioCheck = TRUE;
- mbStateChanged = FALSE;
+ mbChecked = sal_False;
+ mbSaveValue = sal_False;
+ mbRadioCheck = sal_True;
+ mbStateChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -2187,7 +2025,7 @@ void RadioButton::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -2222,8 +2060,8 @@ const Color& RadioButton::GetCanonicalTextColor( const StyleSettings& _rStyle )
// -----------------------------------------------------------------------
-void RadioButton::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void RadioButton::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -2233,18 +2071,18 @@ void RadioButton::ImplInitSettings( BOOL bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -2277,10 +2115,10 @@ void RadioButton::ImplInvalidateOrDrawRadioButtonState()
void RadioButton::ImplDrawRadioButtonState()
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// no native drawing for image radio buttons
- if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == sal_True )
{
ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
@@ -2299,12 +2137,12 @@ void RadioButton::ImplDrawRadioButtonState()
}
-if ( bNativeOK == FALSE )
+if ( bNativeOK == sal_False )
{
// kein Image-RadioButton
if ( !maImage )
{
- USHORT nStyle = ImplGetButtonState();
+ sal_uInt16 nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( mbChecked )
@@ -2323,8 +2161,8 @@ if ( bNativeOK == FALSE )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
- BOOL bEnabled = IsEnabled();
- USHORT nButtonStyle = FRAME_DRAW_DOUBLEIN;
+ sal_Bool bEnabled = IsEnabled();
+ sal_uInt16 nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
@@ -2387,7 +2225,7 @@ if ( bNativeOK == FALSE )
// -----------------------------------------------------------------------
-void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
@@ -2407,7 +2245,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -2481,7 +2319,7 @@ da im Writer ansonsten die Images noch weiter oben haengen
}
else
{
- BOOL bTopImage = (nWinStyle & WB_TOP) != 0;
+ sal_Bool bTopImage = (nWinStyle & WB_TOP) != 0;
Size aImageSize = maImage.GetSizePixel();
Rectangle aImageRect( rPos, rSize );
long nTextHeight = pDev->GetTextHeight();
@@ -2543,7 +2381,7 @@ void RadioButton::ImplDrawRadioButton( bool bLayout )
ImplDraw( this, 0, Point(), GetOutputSizePixel(),
aImageSize, maStateRect, maMouseRect, bLayout );
- if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==TRUE) )
+ if( !bLayout || (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)==sal_True) )
{
if ( !maImage && HasFocus() )
ShowFocus( ImplGetFocusRect() );
@@ -2603,7 +2441,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( FALSE );
+ ((RadioButton*)pWindow)->SetState( sal_False );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2634,7 +2472,7 @@ void RadioButton::ImplUncheckAllOther()
{
ImplDelData aDelData;
pWindow->ImplAddDel( &aDelData );
- ((RadioButton*)pWindow)->SetState( FALSE );
+ ((RadioButton*)pWindow)->SetState( sal_False );
if ( aDelData.IsDelete() )
return;
pWindow->ImplRemoveDel( &aDelData );
@@ -2650,10 +2488,10 @@ void RadioButton::ImplUncheckAllOther()
// -----------------------------------------------------------------------
-void RadioButton::ImplCallClick( BOOL bGrabFocus, USHORT nFocusFlags )
+void RadioButton::ImplCallClick( sal_Bool bGrabFocus, sal_uInt16 nFocusFlags )
{
mbStateChanged = !mbChecked;
- mbChecked = TRUE;
+ mbChecked = sal_True;
mpWindowImpl->mnStyle |= WB_TABSTOP;
ImplInvalidateOrDrawRadioButtonState();
ImplDelData aDelData;
@@ -2674,7 +2512,7 @@ void RadioButton::ImplCallClick( BOOL bGrabFocus, USHORT nFocusFlags )
if ( aDelData.IsDelete() )
return;
ImplRemoveDel( &aDelData );
- mbStateChanged = FALSE;
+ mbStateChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -2708,9 +2546,9 @@ void RadioButton::ImplLoadRes( const ResId& rResId )
Button::ImplLoadRes( rResId );
//anderer Wert als Default ?
- USHORT nChecked = ReadShortRes();
+ sal_uInt16 nChecked = ReadShortRes();
if ( nChecked )
- SetState( TRUE );
+ SetState( sal_True );
}
// -----------------------------------------------------------------------
@@ -2831,7 +2669,7 @@ void RadioButton::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
if ( !maImage )
{
@@ -2970,17 +2808,17 @@ void RadioButton::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -2996,7 +2834,7 @@ void RadioButton::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -3039,14 +2877,14 @@ void RadioButton::Toggle()
// -----------------------------------------------------------------------
-BOOL RadioButton::SetModeRadioImage( const Image& rImage )
+sal_Bool RadioButton::SetModeRadioImage( const Image& rImage )
{
if ( rImage != maImage )
{
maImage = rImage;
StateChanged( STATE_CHANGE_DATA );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -3058,7 +2896,7 @@ const Image& RadioButton::GetModeRadioImage( ) const
// -----------------------------------------------------------------------
-void RadioButton::SetState( BOOL bCheck )
+void RadioButton::SetState( sal_Bool bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -3076,7 +2914,7 @@ void RadioButton::SetState( BOOL bCheck )
// -----------------------------------------------------------------------
-void RadioButton::Check( BOOL bCheck )
+void RadioButton::Check( sal_Bool bCheck )
{
// TabStop-Flag richtig mitfuehren
if ( bCheck )
@@ -3142,7 +2980,7 @@ Size RadioButton::ImplGetRadioImageSize() const
static void LoadThemedImageList (const StyleSettings &rStyleSettings,
ImageList *pList, const ResId &rResId,
- USHORT nImages)
+ sal_uInt16 nImages)
{
Color aColorAry1[6];
Color aColorAry2[6];
@@ -3166,11 +3004,11 @@ static void LoadThemedImageList (const StyleSettings &rStyleSettings,
aColorAry1, aColorAry2, sizeof(aColorAry1) / sizeof(Color));
}
-Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
+Image RadioButton::GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetRadioButtonStyle() & STYLE_RADIOBUTTON_STYLE;
+ sal_uInt16 nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_RADIOBUTTON_MONO;
@@ -3213,7 +3051,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags )
pSVData->maCtrlData.mnRadioStyle = nStyle;
}
- USHORT nId;
+ sal_uInt16 nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_CHECKED )
@@ -3323,7 +3161,7 @@ void CheckBox::ImplInitCheckBoxData()
{
meState = STATE_NOCHECK;
meSaveValue = STATE_NOCHECK;
- mbTriState = FALSE;
+ mbTriState = sal_False;
}
// -----------------------------------------------------------------------
@@ -3333,7 +3171,7 @@ void CheckBox::ImplInit( Window* pParent, WinBits nStyle )
nStyle = ImplInitStyle( pParent->GetWindow( WINDOW_LASTCHILD ), nStyle );
Button::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -3363,8 +3201,8 @@ const Color& CheckBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void CheckBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void CheckBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Button::ImplInitSettings( bFont, bForeground );
@@ -3374,18 +3212,18 @@ void CheckBox::ImplInitSettings( BOOL bFont,
if ( !IsControlBackground() &&
(pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -3403,10 +3241,10 @@ void CheckBox::ImplLoadRes( const ResId& rResId )
if ( rResId.GetRT() != RSC_TRISTATEBOX )
{
- USHORT nChecked = ReadShortRes();
+ sal_uInt16 nChecked = ReadShortRes();
//anderer Wert als Default ?
if( nChecked )
- Check( TRUE );
+ Check( sal_True );
}
}
@@ -3428,9 +3266,9 @@ void CheckBox::ImplInvalidateOrDrawCheckBoxState()
void CheckBox::ImplDrawCheckBoxState()
{
- bool bNativeOK = TRUE;
+ bool bNativeOK = sal_True;
- if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == TRUE )
+ if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == sal_True )
{
ImplControlValue aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRegion( maStateRect );
@@ -3453,9 +3291,9 @@ void CheckBox::ImplDrawCheckBoxState()
aControlValue, rtl::OUString() );
}
- if ( bNativeOK == FALSE )
+ if ( bNativeOK == sal_False )
{
- USHORT nStyle = ImplGetButtonState();
+ sal_uInt16 nStyle = ImplGetButtonState();
if ( !IsEnabled() )
nStyle |= BUTTON_DRAW_DISABLED;
if ( meState == STATE_DONTKNOW )
@@ -3472,7 +3310,7 @@ void CheckBox::ImplDrawCheckBoxState()
// -----------------------------------------------------------------------
-void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
const Size& rImageSize, Rectangle& rStateRect,
Rectangle& rMouseRect, bool bLayout )
@@ -3487,7 +3325,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
( HasImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) )
{
- USHORT nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -3761,7 +3599,7 @@ void CheckBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
MapMode aResMapMode( MAP_100TH_MM );
Point aPos = pDev->LogicToPixel( rPos );
@@ -3951,17 +3789,17 @@ void CheckBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -3977,7 +3815,7 @@ void CheckBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -4035,7 +3873,7 @@ void CheckBox::SetState( TriState eState )
// -----------------------------------------------------------------------
-void CheckBox::EnableTriState( BOOL bTriState )
+void CheckBox::EnableTriState( sal_Bool bTriState )
{
if ( mbTriState != bTriState )
{
@@ -4085,11 +3923,11 @@ Size CheckBox::ImplGetCheckImageSize() const
return aSize;
}
-Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
+Image CheckBox::GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
const StyleSettings& rStyleSettings = rSettings.GetStyleSettings();
- USHORT nStyle = rStyleSettings.GetCheckBoxStyle() & STYLE_CHECKBOX_STYLE;
+ sal_uInt16 nStyle = 0;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle = STYLE_CHECKBOX_MONO;
@@ -4116,7 +3954,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags )
pSVData->maCtrlData.mnCheckStyle = nStyle;
}
- USHORT nId;
+ sal_uInt16 nId;
if ( nFlags & BUTTON_DRAW_DISABLED )
{
if ( nFlags & BUTTON_DRAW_DONTKNOW )
@@ -4244,7 +4082,7 @@ ImageButton::ImageButton( Window* pParent, WinBits nStyle ) :
ImageButton::ImageButton( Window* pParent, const ResId& rResId ) :
PushButton( pParent, rResId.SetRT( RSC_IMAGEBUTTON ) )
{
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_IMAGEBUTTON_IMAGE & nObjMask )
{
@@ -4293,7 +4131,7 @@ ImageRadioButton::ImageRadioButton( Window* pParent, WinBits nStyle ) :
ImageRadioButton::ImageRadioButton( Window* pParent, const ResId& rResId ) :
RadioButton( pParent, rResId.SetRT( RSC_IMAGERADIOBUTTON ) )
{
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_IMAGERADIOBUTTON_IMAGE & nObjMask )
{
@@ -4313,7 +4151,7 @@ ImageRadioButton::~ImageRadioButton()
TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
CheckBox( pParent, nStyle )
{
- EnableTriState( TRUE );
+ EnableTriState( sal_True );
}
// -----------------------------------------------------------------------
@@ -4321,15 +4159,15 @@ TriStateBox::TriStateBox( Window* pParent, WinBits nStyle ) :
TriStateBox::TriStateBox( Window* pParent, const ResId& rResId ) :
CheckBox( pParent, rResId.SetRT( RSC_TRISTATEBOX ) )
{
- EnableTriState( TRUE );
+ EnableTriState( sal_True );
- ULONG nTriState = ReadLongRes();
- USHORT bDisableTriState = ReadShortRes();
+ sal_uLong nTriState = ReadLongRes();
+ sal_uInt16 bDisableTriState = ReadShortRes();
//anderer Wert als Default ?
if ( (TriState)nTriState != STATE_NOCHECK )
SetState( (TriState)nTriState );
if ( bDisableTriState )
- EnableTriState( FALSE );
+ EnableTriState( sal_False );
}
// -----------------------------------------------------------------------
@@ -4391,7 +4229,7 @@ void DisclosureButton::ImplDrawCheckBoxState()
if( ! pImg )
return;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if( ! IsEnabled() )
nStyle |= IMAGE_DRAW_DISABLE;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index e65925db282c..9881edd62ca3 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -46,7 +46,7 @@
// =======================================================================
-inline ULONG ImplCreateKey( USHORT nPos )
+inline sal_uLong ImplCreateKey( sal_uInt16 nPos )
{
// Key = Pos+1, wegen Pos 0
return nPos+1;
@@ -60,7 +60,7 @@ static void lcl_GetSelectedEntries( Table& rSelectedPos, const XubString& rText,
{
XubString aToken = rText.GetToken( --n, cTokenSep );
aToken.EraseLeadingAndTrailingChars( ' ' );
- USHORT nPos = pEntryList->FindEntry( aToken );
+ sal_uInt16 nPos = pEntryList->FindEntry( aToken );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
rSelectedPos.Insert( ImplCreateKey( nPos ), (void*)sal_IntPtr(1L) );
}
@@ -122,9 +122,9 @@ void ComboBox::ImplInitComboBoxData()
mpFloatWin = NULL;
mnDDHeight = 0;
- mbDDAutoSize = TRUE;
- mbSyntheticModify = FALSE;
- mbMatchCase = FALSE;
+ mbDDAutoSize = sal_True;
+ mbSyntheticModify = sal_False;
+ mbMatchCase = sal_False;
mcMultiSep = ';';
}
@@ -134,7 +134,7 @@ void ComboBox::ImplCalcEditHeight()
{
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- mnDDHeight = (USHORT)(mpSubEdit->GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (sal_uInt16)(mpSubEdit->GetTextHeight() + nTop + nBottom + 4);
if ( !IsDropDownBox() )
mnDDHeight += 4;
@@ -150,7 +150,7 @@ void ComboBox::ImplCalcEditHeight()
{
const long nNCHeight = aBoundRegion.GetHeight();
if( mnDDHeight < nNCHeight )
- mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight );
+ mnDDHeight = sal::static_int_cast<sal_uInt16>( nNCHeight );
}
}
@@ -160,7 +160,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
{
ImplInitStyle( nStyle );
- BOOL bNoBorder = ( nStyle & WB_NOBORDER ) ? TRUE : FALSE;
+ sal_Bool bNoBorder = ( nStyle & WB_NOBORDER ) ? sal_True : sal_False;
if ( !(nStyle & WB_DROPDOWN) )
{
nStyle &= ~WB_BORDER;
@@ -181,7 +181,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if( nStyle & WB_DROPDOWN )
{
mpFloatWin = new ImplListBoxFloatingWindow( this );
- mpFloatWin->SetAutoWidth( TRUE );
+ mpFloatWin->SetAutoWidth( sal_True );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ComboBox, ImplPopupModeEndHdl ) );
mpBtn = new ImplBtn( this, WB_NOLIGHTBORDER | WB_RECTSTYLE );
@@ -204,10 +204,10 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
}
mpSubEdit = new Edit( this, nEditStyle );
- mpSubEdit->EnableRTL( FALSE );
+ mpSubEdit->EnableRTL( sal_False );
SetSubEdit( mpSubEdit );
mpSubEdit->SetPosPixel( Point() );
- EnableAutocomplete( TRUE );
+ EnableAutocomplete( sal_True );
mpSubEdit->Show();
Window* pLBParent = this;
@@ -225,11 +225,11 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if ( mpFloatWin )
mpFloatWin->SetImplListBox( mpImplLB );
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True );
ImplCalcEditHeight();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
// -----------------------------------------------------------------------
@@ -249,11 +249,11 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
{
Edit::ImplLoadRes( rResId );
- ULONG nNumber = ReadLongRes();
+ sal_uLong nNumber = ReadLongRes();
if( nNumber )
{
- for( USHORT i = 0; i < nNumber; i++ )
+ for( sal_uInt16 i = 0; i < nNumber; i++ )
{
InsertEntry( ReadStringRes(), LISTBOX_APPEND );
}
@@ -262,7 +262,7 @@ void ComboBox::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ComboBox::EnableAutocomplete( BOOL bEnable, BOOL bMatchCase )
+void ComboBox::EnableAutocomplete( sal_Bool bEnable, sal_Bool bMatchCase )
{
mbMatchCase = bMatchCase;
@@ -274,7 +274,7 @@ void ComboBox::EnableAutocomplete( BOOL bEnable, BOOL bMatchCase )
// -----------------------------------------------------------------------
-BOOL ComboBox::IsAutocompleteEnabled() const
+sal_Bool ComboBox::IsAutocompleteEnabled() const
{
return mpSubEdit->GetAutocompleteHdl().IsSet();
}
@@ -288,10 +288,10 @@ IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG )
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
else
- mpImplLB->SelectEntry( 0 , TRUE );
- mpBtn->SetPressed( TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
+ mpBtn->SetPressed( sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( TRUE );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
ImplClearLayoutData();
@@ -309,9 +309,9 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
{
if ( !mpImplLB->GetEntryList()->IsEntryPosSelected( mpFloatWin->GetPopupModeStartSaveSelection() ) )
{
- mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
- BOOL bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( TRUE );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
+ sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( sal_True );
Select();
mpImplLB->SetTravelSelect( bTravelSelect );
}
@@ -321,7 +321,7 @@ IMPL_LINK( ComboBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplLB )
mpImplLB->GetMainWindow()->ImplClearLayoutData();
- mpBtn->SetPressed( FALSE );
+ mpBtn->SetPressed( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -341,36 +341,36 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
{
XubString aFullText = pEdit->GetText();
XubString aStartText = aFullText.Copy( 0, (xub_StrLen)aSel.Max() );
- USHORT nStart = mpImplLB->GetCurrentPos();
+ sal_uInt16 nStart = mpImplLB->GetCurrentPos();
if ( nStart == LISTBOX_ENTRY_NOTFOUND )
nStart = 0;
- BOOL bForward = TRUE;
+ sal_Bool bForward = sal_True;
if ( eAction == AUTOCOMPLETE_TABFORWARD )
nStart++;
else if ( eAction == AUTOCOMPLETE_TABBACKWARD )
{
- bForward = FALSE;
+ bForward = sal_False;
nStart = nStart ? nStart - 1 : mpImplLB->GetEntryList()->GetEntryCount()-1;
}
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
if( ! mbMatchCase )
{
// Try match case insensitive from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, TRUE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_True );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match case insensitive, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, TRUE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_True );
}
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Try match full from current position
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, FALSE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, nStart, bForward, sal_False );
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
// Match full, but from start
- nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, FALSE );
+ nPos = mpImplLB->GetEntryList()->FindMatchingEntry( aStartText, bForward ? 0 : (mpImplLB->GetEntryList()->GetEntryCount()-1), bForward, sal_False );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
@@ -387,8 +387,8 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
{
- BOOL bPopup = IsInDropDown();
- BOOL bCallSelect = FALSE;
+ sal_Bool bPopup = IsInDropDown();
+ sal_Bool bCallSelect = sal_False;
if ( mpImplLB->IsSelectionChanged() || bPopup )
{
XubString aText;
@@ -404,7 +404,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex );
xub_StrLen nTokenLen = aToken.Len();
aToken.EraseLeadingAndTrailingChars( ' ' );
- USHORT nP = mpImplLB->GetEntryList()->FindEntry( aToken );
+ sal_uInt16 nP = mpImplLB->GetEntryList()->FindEntry( aToken );
if ( (nP != LISTBOX_ENTRY_NOTFOUND) && (!mpImplLB->GetEntryList()->IsEntryPosSelected( nP )) )
{
aText.Erase( nPrevIndex, nTokenLen );
@@ -421,10 +421,10 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
// Fehlende Eintraege anhaengen...
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, aText, mcMultiSep, mpImplLB->GetEntryList() );
- USHORT nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
- for ( USHORT n = 0; n < nSelectedEntries; n++ )
+ sal_uInt16 nSelectedEntries = mpImplLB->GetEntryList()->GetSelectEntryCount();
+ for ( sal_uInt16 n = 0; n < nSelectedEntries; n++ )
{
- USHORT nP = mpImplLB->GetEntryList()->GetSelectEntryPos( n );
+ sal_uInt16 nP = mpImplLB->GetEntryList()->GetSelectEntryPos( n );
if ( !aSelInText.IsKeyValid( ImplCreateKey( nP ) ) )
{
if ( aText.Len() && (aText.GetChar( aText.Len()-1 ) != mcMultiSep) )
@@ -450,7 +450,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
aNewSelection.Min() = aText.Len();
mpSubEdit->SetSelection( aNewSelection );
- bCallSelect = TRUE;
+ bCallSelect = sal_True;
}
// #84652# Call GrabFocus and EndPopupMode before calling Select/Modify, but after changing the text
@@ -465,9 +465,9 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
if ( bCallSelect )
{
mpSubEdit->SetModifyFlag();
- mbSyntheticModify = TRUE;
+ mbSyntheticModify = sal_True;
Modify();
- mbSyntheticModify = FALSE;
+ mbSyntheticModify = sal_False;
if (ImplGetWindowImpl() != NULL) //liuchen 2009-7-28, resolve the problem that soffice get crashed if in ComboBox_Change event a Worksheets("SheetX").Activate sentence needs to be executed
{
Select();
@@ -493,7 +493,7 @@ IMPL_LINK( ComboBox, ImplSelectionChangedHdl, void*, n )
{
if ( !mpImplLB->IsTrackingSelect() )
{
- USHORT nChanged = (USHORT)(ULONG)n;
+ sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
if ( !mpSubEdit->IsReadOnly() && mpImplLB->GetEntryList()->IsEntryPosSelected( nChanged ) )
mpSubEdit->SetText( mpImplLB->GetEntryList()->GetEntryText( nChanged ) );
}
@@ -522,11 +522,11 @@ void ComboBox::ToggleDropDown()
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
else
- mpImplLB->SelectEntry( 0 , TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
+ mpBtn->SetPressed( sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( TRUE );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -548,7 +548,7 @@ void ComboBox::DoubleClick()
// -----------------------------------------------------------------------
-void ComboBox::EnableAutoSize( BOOL bAuto )
+void ComboBox::EnableAutoSize( sal_Bool bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -562,7 +562,7 @@ void ComboBox::EnableAutoSize( BOOL bAuto )
// -----------------------------------------------------------------------
-void ComboBox::EnableDDAutoWidth( BOOL b )
+void ComboBox::EnableDDAutoWidth( sal_Bool b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -570,15 +570,15 @@ void ComboBox::EnableDDAutoWidth( BOOL b )
// -----------------------------------------------------------------------
-BOOL ComboBox::IsDDAutoWidthEnabled() const
+sal_Bool ComboBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
}
// -----------------------------------------------------------------------
-void ComboBox::SetDropDownLineCount( USHORT nLines )
+void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
{
if ( mpFloatWin )
mpFloatWin->SetDropDownLineCount( nLines );
@@ -586,9 +586,9 @@ void ComboBox::SetDropDownLineCount( USHORT nLines )
// -----------------------------------------------------------------------
-USHORT ComboBox::GetDropDownLineCount() const
+sal_uInt16 ComboBox::GetDropDownLineCount() const
{
- USHORT nLines = 0;
+ sal_uInt16 nLines = 0;
if ( mpFloatWin )
nLines = mpFloatWin->GetDropDownLineCount();
return nLines;
@@ -597,7 +597,7 @@ USHORT ComboBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
void ComboBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -758,7 +758,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? sal_True : sal_False );
}
else if( nType == STATE_CHANGE_MIRRORING )
{
@@ -813,7 +813,7 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
&& !IsReadOnly() )
{
KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
- USHORT nKeyCode = aKeyEvt.GetKeyCode().GetCode();
+ sal_uInt16 nKeyCode = aKeyEvt.GetKeyCode().GetCode();
switch( nKeyCode )
{
case KEY_UP:
@@ -825,11 +825,11 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
if( ( nKeyCode == KEY_DOWN ) && mpFloatWin && !mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
+ mpBtn->SetPressed( sal_True );
if ( mpImplLB->GetEntryList()->GetMRUCount() )
- mpImplLB->SelectEntry( 0 , TRUE );
+ mpImplLB->SelectEntry( 0 , sal_True );
SetSelection( Selection( 0, SELECTION_MAX ) );
- mpFloatWin->StartFloat( FALSE );
+ mpFloatWin->StartFloat( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
nDone = 1;
}
@@ -860,14 +860,14 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
{
if( mpFloatWin->HasChildPathFocus() )
mpSubEdit->GrabFocus();
- else if ( mpFloatWin->IsInPopupMode() && !HasChildPathFocus( TRUE ) )
+ else if ( mpFloatWin->IsInPopupMode() && !HasChildPathFocus( sal_True ) )
mpFloatWin->EndPopupMode();
}
else if( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpSubEdit) )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -924,12 +924,12 @@ void ComboBox::Modify()
void ComboBox::ImplUpdateFloatSelection()
{
// Text in der ListBox in den sichtbaren Bereich bringen
- mpImplLB->SetCallSelectionChangedHdl( FALSE );
+ mpImplLB->SetCallSelectionChangedHdl( sal_False );
if ( !IsMultiSelectionEnabled() )
{
XubString aSearchStr( mpSubEdit->GetText() );
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
- BOOL bSelect = TRUE;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_Bool bSelect = sal_True;
if ( mpImplLB->GetCurrentPos() != LISTBOX_ENTRY_NOTFOUND )
{
@@ -943,7 +943,7 @@ void ComboBox::ImplUpdateFloatSelection()
if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
{
nSelect = mpImplLB->GetEntryList()->FindMatchingEntry( aSearchStr );
- bSelect = FALSE;
+ bSelect = sal_False;
}
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -956,7 +956,7 @@ void ComboBox::ImplUpdateFloatSelection()
{
nSelect = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
- mpImplLB->SelectEntry( nSelect, FALSE );
+ mpImplLB->SelectEntry( nSelect, sal_False );
mpImplLB->ResetCurrentPos();
}
}
@@ -964,28 +964,28 @@ void ComboBox::ImplUpdateFloatSelection()
{
Table aSelInText;
lcl_GetSelectedEntries( aSelInText, mpSubEdit->GetText(), mcMultiSep, mpImplLB->GetEntryList() );
- for ( USHORT n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
+ for ( sal_uInt16 n = 0; n < mpImplLB->GetEntryList()->GetEntryCount(); n++ )
mpImplLB->SelectEntry( n, aSelInText.IsKeyValid( ImplCreateKey( n ) ) );
}
- mpImplLB->SetCallSelectionChangedHdl( TRUE );
+ mpImplLB->SetCallSelectionChangedHdl( sal_True );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
+sal_uInt16 ComboBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -999,7 +999,7 @@ void ComboBox::RemoveEntry( const XubString& rStr )
// -----------------------------------------------------------------------
-void ComboBox::RemoveEntry( USHORT nPos )
+void ComboBox::RemoveEntry( sal_uInt16 nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
CallEventListeners( VCLEVENT_COMBOBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
@@ -1014,7 +1014,7 @@ void ComboBox::Clear()
}
// -----------------------------------------------------------------------
-Image ComboBox::GetEntryImage( USHORT nPos ) const
+Image ComboBox::GetEntryImage( sal_uInt16 nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1023,70 +1023,70 @@ Image ComboBox::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryPos( const XubString& rStr ) const
+sal_uInt16 ComboBox::GetEntryPos( const XubString& rStr ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryPos( const void* pData ) const
+sal_uInt16 ComboBox::GetEntryPos( const void* pData ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ComboBox::GetEntry( USHORT nPos ) const
+XubString ComboBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetEntryCount() const
+sal_uInt16 ComboBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsTravelSelect() const
+sal_Bool ComboBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsInDropDown() const
+sal_Bool ComboBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-void ComboBox::EnableMultiSelection( BOOL bMulti )
+void ComboBox::EnableMultiSelection( sal_Bool bMulti )
{
- mpImplLB->EnableMultiSelection( bMulti, FALSE );
- mpImplLB->SetMultiSelectionSimpleMode( TRUE );
+ mpImplLB->EnableMultiSelection( bMulti, sal_False );
+ mpImplLB->SetMultiSelectionSimpleMode( sal_True );
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsMultiSelectionEnabled() const
+sal_Bool ComboBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
// -----------------------------------------------------------------------
-long ComboBox::CalcWindowSizePixel( USHORT nLines ) const
+long ComboBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
@@ -1153,7 +1153,7 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ComboBox::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ComboBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
@@ -1193,28 +1193,28 @@ Size ComboBox::CalcSize( USHORT nColumns, USHORT nLines ) const
// -----------------------------------------------------------------------
-void ComboBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
- rnLines = (USHORT)(aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
+ rnLines = (sal_uInt16)(aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpSubEdit->GetOutputSizePixel();
- rnCols = (USHORT)(aOutSz.Width()/nCharWidth);
+ rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
// -----------------------------------------------------------------------
-void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, TRUE );
+ mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1229,8 +1229,8 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1252,7 +1252,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
long nOnePixel = GetDrawPixel( pDev, 1 );
long nTextHeight = pDev->GetTextHeight();
long nEditHeight = nTextHeight + 6*nOnePixel;
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
// First, draw the edit part
mpSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight ), nFlags );
@@ -1284,10 +1284,10 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
- USHORT nLines = (USHORT) ( (aSize.Height()-nEditHeight) / nTextHeight );
+ sal_uInt16 nLines = (sal_uInt16) ( (aSize.Height()-nEditHeight) / nTextHeight );
if ( !nLines )
nLines = 1;
- USHORT nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
+ sal_uInt16 nTEntry = IsReallyVisible() ? mpImplLB->GetTopEntry() : 0;
Rectangle aTextRect( aPos, aSize );
@@ -1297,7 +1297,7 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, U
aTextRect.Bottom() = aTextRect.Top() + nTextHeight;
// the drawing starts here
- for ( USHORT n = 0; n < nLines; n++ )
+ for ( sal_uInt16 n = 0; n < nLines; n++ )
{
pDev->DrawText( aTextRect, mpImplLB->GetEntryList()->GetEntryText( n+nTEntry ), nTextStyle );
aTextRect.Top() += nTextHeight;
@@ -1346,21 +1346,21 @@ const Size& ComboBox::GetUserItemSize() const
// -----------------------------------------------------------------------
-void ComboBox::EnableUserDraw( BOOL bUserDraw )
+void ComboBox::EnableUserDraw( sal_Bool bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
}
// -----------------------------------------------------------------------
-BOOL ComboBox::IsUserDrawEnabled() const
+sal_Bool ComboBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ComboBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos )
+void ComboBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
{
DBG_ASSERT( rEvt.GetDevice() == mpImplLB->GetMainWindow(), "DrawEntry?!" );
mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
@@ -1368,7 +1368,7 @@ void ComboBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDraw
// -----------------------------------------------------------------------
-void ComboBox::SetSeparatorPos( USHORT n )
+void ComboBox::SetSeparatorPos( sal_uInt16 n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1382,7 +1382,7 @@ void ComboBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-USHORT ComboBox::GetSeparatorPos() const
+sal_uInt16 ComboBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1403,58 +1403,58 @@ XubString ComboBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ComboBox::SetMaxMRUCount( USHORT n )
+void ComboBox::SetMaxMRUCount( sal_uInt16 n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetMaxMRUCount() const
+sal_uInt16 ComboBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetDisplayLineCount() const
+sal_uInt16 ComboBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
// -----------------------------------------------------------------------
-void ComboBox::SetEntryData( USHORT nPos, void* pNewData )
+void ComboBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ComboBox::GetEntryData( USHORT nPos ) const
+void* ComboBox::GetEntryData( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::SetTopEntry( USHORT nPos )
+void ComboBox::SetTopEntry( sal_uInt16 nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ComboBox::ShowProminentEntry( USHORT nPos )
+void ComboBox::ShowProminentEntry( sal_uInt16 nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ComboBox::GetTopEntry() const
+sal_uInt16 ComboBox::GetTopEntry() const
{
- USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = 0;
return nPos;
@@ -1504,29 +1504,29 @@ const Wallpaper& ComboBox::GetDisplayBackground() const
return rBack;
}
// -----------------------------------------------------------------------------
-USHORT ComboBox::GetSelectEntryCount() const
+sal_uInt16 ComboBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------------
-USHORT ComboBox::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ComboBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = mpImplLB->GetEntryList()->FindEntry( mpImplLB->GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------------
-BOOL ComboBox::IsEntryPosSelected( USHORT nPos ) const
+sal_Bool ComboBox::IsEntryPosSelected( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------------
-void ComboBox::SelectEntryPos( USHORT nPos, BOOL bSelect)
+void ComboBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect)
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
@@ -1538,7 +1538,7 @@ void ComboBox::SetNoSelection()
mpSubEdit->SetText( String() );
}
// -----------------------------------------------------------------------------
-Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ComboBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1547,7 +1547,7 @@ Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
}
// -----------------------------------------------------------------------------
-void ComboBox::SetBorderStyle( USHORT nBorderStyle )
+void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
{
Window::SetBorderStyle( nBorderStyle );
if ( !IsDropDownBox() )
@@ -1558,7 +1558,7 @@ void ComboBox::SetBorderStyle( USHORT nBorderStyle )
}
// -----------------------------------------------------------------------------
-long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
+long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -1578,7 +1578,7 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- USHORT nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
nIndex = -1;
else
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index ad45da3b706e..99cd6b3cba60 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -48,7 +48,7 @@ using namespace vcl;
void Control::ImplInitControlData()
{
- mbHasFocus = FALSE;
+ mbHasFocus = sal_False;
mpControlData = new ImplControlData;
}
@@ -304,10 +304,10 @@ long Control::Notify( NotifyEvent& rNEvt )
{
if ( !mbHasFocus )
{
- mbHasFocus = TRUE;
+ mbHasFocus = sal_True;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) )
// been destroyed within the handler
- return TRUE;
+ return sal_True;
}
}
else
@@ -317,10 +317,10 @@ long Control::Notify( NotifyEvent& rNEvt )
Window* pFocusWin = Application::GetFocusWindow();
if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
{
- mbHasFocus = FALSE;
+ mbHasFocus = sal_False;
if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) )
// been destroyed within the handler
- return TRUE;
+ return sal_True;
}
}
}
@@ -373,7 +373,7 @@ void Control::AppendLayoutData( const Control& rSubControl ) const
// -----------------------------------------------------------------
-BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHandler, void* pCaller )
+sal_Bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Link& rHandler, void* pCaller )
{
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -386,10 +386,10 @@ BOOL Control::ImplCallEventListenersAndHandler( ULONG nEvent, const Link& rHand
if ( !aCheckDelete.IsDelete() )
{
ImplRemoveDel( &aCheckDelete );
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------
@@ -448,8 +448,8 @@ void Control::DataChanged( const DataChangedEvent& rDCEvt)
{
AllSettings aSettings = GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- ULONG nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
- ULONG nNewOptions = aStyleSettings.GetOptions();
+ sal_uLong nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions();
+ sal_uLong nNewOptions = aStyleSettings.GetOptions();
if ( !(nNewOptions & STYLE_OPTION_MONO) && ( nOldOptions & STYLE_OPTION_MONO ) )
{
@@ -518,7 +518,7 @@ const Color& Control::GetCanonicalTextColor( const StyleSettings& _rStyle ) cons
}
// -----------------------------------------------------------------
-void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
+void Control::ImplInitSettings( const sal_Bool _bFont, const sal_Bool _bForeground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -545,7 +545,7 @@ void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
// -----------------------------------------------------------------
void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const XubString& _rStr,
- USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
+ sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
{
#ifdef FS_DEBUG
if ( !_pVector )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 15ce9476cdd1..41d5ca198cf2 100644..100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -113,17 +113,19 @@ struct DDInfo
Cursor aCursor;
Selection aDndStartSel;
xub_StrLen nDropPos;
- BOOL bStarterOfDD;
- BOOL bDroppedInMe;
- BOOL bVisCursor;
+ sal_Bool bStarterOfDD;
+ sal_Bool bDroppedInMe;
+ sal_Bool bVisCursor;
+ sal_Bool bIsStringSupported;
DDInfo()
{
aCursor.SetStyle( CURSOR_SHADOW );
nDropPos = 0;
- bStarterOfDD = FALSE;
- bDroppedInMe = FALSE;
- bVisCursor = FALSE;
+ bStarterOfDD = sal_False;
+ bDroppedInMe = sal_False;
+ bVisCursor = sal_False;
+ bIsStringSupported = sal_False;
}
};
@@ -132,11 +134,11 @@ struct DDInfo
struct Impl_IMEInfos
{
String aOldTextAfterStartPos;
- USHORT* pAttribs;
+ sal_uInt16* pAttribs;
xub_StrLen nPos;
xub_StrLen nLen;
- BOOL bCursor;
- BOOL bWasCursorOverwrite;
+ sal_Bool bCursor;
+ sal_Bool bWasCursorOverwrite;
Impl_IMEInfos( xub_StrLen nPos, const String& rOldTextAfterStartPos );
~Impl_IMEInfos();
@@ -152,9 +154,9 @@ Impl_IMEInfos::Impl_IMEInfos( xub_StrLen nP, const String& rOldTextAfterStartPos
{
nPos = nP;
nLen = 0;
- bCursor = TRUE;
+ bCursor = sal_True;
pAttribs = NULL;
- bWasCursorOverwrite = FALSE;
+ bWasCursorOverwrite = sal_False;
}
// -----------------------------------------------------------------------
@@ -170,8 +172,8 @@ void Impl_IMEInfos::CopyAttribs( const xub_StrLen* pA, xub_StrLen nL )
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new USHORT[ nL ];
- rtl_copyMemory( pAttribs, pA, nL*sizeof(USHORT) );
+ pAttribs = new sal_uInt16[ nL ];
+ rtl_copyMemory( pAttribs, pA, nL*sizeof(sal_uInt16) );
}
// -----------------------------------------------------------------------
@@ -228,7 +230,7 @@ Edit::Edit( Window* pParent, const ResId& rResId, bool bDisableAccessibleLabeled
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabeledByRelation )
- ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = TRUE;
+ ImplGetWindowImpl()->mbDisableAccessibleLabeledByRelation = sal_True;
// Derived MultiLineEdit takes care to call Show only after MultiLineEdit
// ctor has already started:
@@ -281,21 +283,21 @@ void Edit::ImplInitEditData()
mnAlign = EDIT_ALIGN_LEFT;
mnMaxTextLen = EDIT_NOLIMIT;
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- mbModified = FALSE;
- mbInternModified = FALSE;
- mbReadOnly = FALSE;
- mbInsertMode = TRUE;
- mbClickedInSelection = FALSE;
- mbActivePopup = FALSE;
- mbIsSubEdit = FALSE;
- mbInMBDown = FALSE;
+ mbModified = sal_False;
+ mbInternModified = sal_False;
+ mbReadOnly = sal_False;
+ mbInsertMode = sal_True;
+ mbClickedInSelection = sal_False;
+ mbActivePopup = sal_False;
+ mbIsSubEdit = sal_False;
+ mbInMBDown = sal_False;
mpDDInfo = NULL;
mpIMEInfos = NULL;
mcEchoChar = 0;
// --- RTL --- no default mirroring for Edit controls
// note: controls that use a subedit will revert this (SpinField, ComboBox)
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
vcl::unohelper::DragAndDropWrapper* pDnDWrapper = new vcl::unohelper::DragAndDropWrapper( this );
mxDnDListener = pDnDWrapper;
@@ -342,7 +344,7 @@ void Edit::ImplInit( Window* pParent, WinBits nStyle )
SetCursor( new Cursor );
SetPointer( Pointer( POINTER_TEXT ) );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL( mxDnDListener, uno::UNO_QUERY );
uno::Reference< datatransfer::dnd::XDragGestureRecognizer > xDGR = GetDragGestureRecognizer();
@@ -370,7 +372,7 @@ WinBits Edit::ImplInitStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-BOOL Edit::IsCharInput( const KeyEvent& rKeyEvent )
+sal_Bool Edit::IsCharInput( const KeyEvent& rKeyEvent )
{
// In the future we must use new Unicode functions for this
xub_Unicode cCharCode = rKeyEvent.GetCharCode();
@@ -384,13 +386,13 @@ BOOL Edit::IsCharInput( const KeyEvent& rKeyEvent )
void Edit::ImplModified()
{
- mbModified = TRUE;
+ mbModified = sal_True;
Modify();
}
// -----------------------------------------------------------------------
-void Edit::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
+void Edit::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -537,7 +539,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
}
Cursor* pCursor = GetCursor();
- BOOL bVisCursor = pCursor ? pCursor->IsVisible() : FALSE;
+ sal_Bool bVisCursor = pCursor ? pCursor->IsVisible() : sal_False;
if ( pCursor )
pCursor->Hide();
@@ -545,7 +547,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( IsEnabled() )
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
else
SetTextColor( rStyleSettings.GetDisableColor() );
@@ -566,7 +568,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
- BOOL bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
+ sal_Bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
long nPos = nStart ? pDX[2*nStart] : 0;
aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
@@ -656,7 +658,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
for( i = 0; i < mpIMEInfos->nLen; )
{
- USHORT nAttr = mpIMEInfos->pAttribs[i];
+ sal_uInt16 nAttr = mpIMEInfos->pAttribs[i];
Region aClip;
int nIndex = i;
while( nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it
@@ -712,7 +714,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
// -----------------------------------------------------------------------
-void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode )
+void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode )
{
XubString aText = ImplGetText();
@@ -772,7 +774,7 @@ void Edit::ImplDelete( const Selection& rSelection, BYTE nDirection, BYTE nMode
maSelection.Min() = aSelection.Min();
maSelection.Max() = aSelection.Min();
ImplAlignAndPaint();
- mbInternModified = TRUE;
+ mbInternModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -787,19 +789,19 @@ String Edit::ImplGetValidString( const String& rString ) const
}
// -----------------------------------------------------------------------
-Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
+uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XBreakIterator > xBI;
+ uno::Reference < i18n::XBreakIterator > xBI;
// if ( !xBI.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
x >>= xBI;
}
}
@@ -807,19 +809,19 @@ Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
}
// -----------------------------------------------------------------------
-Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
+uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XExtendedInputSequenceChecker > xISC;
+ uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
// if ( !xISC.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XExtendedInputSequenceChecker >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
x >>= xISC;
}
}
@@ -894,8 +896,8 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// get access to the configuration of this office module
try
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
xMSF,
sModule,
::comphelper::ConfigurationHelper::E_READONLY ),
@@ -995,7 +997,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
}
ImplAlignAndPaint();
- mbInternModified = TRUE;
+ mbInternModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -1019,7 +1021,7 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
ImplAlign();
if ( pNewSelection )
- ImplSetSelection( *pNewSelection, FALSE );
+ ImplSetSelection( *pNewSelection, sal_False );
if ( mnXOffset && !pNewSelection )
maSelection.Max() = 0;
@@ -1157,7 +1159,7 @@ void Edit::ImplClearBackground( long nXStart, long nXEnd )
// -----------------------------------------------------------------------
-void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
+void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
{
if ( !IsUpdateMode() || ( bOnlyIfVisible && !IsReallyVisible() ) )
return;
@@ -1350,7 +1352,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
// -----------------------------------------------------------------------
-void Edit::ImplSetCursorPos( xub_StrLen nChar, BOOL bSelect )
+void Edit::ImplSetCursorPos( xub_StrLen nChar, sal_Bool bSelect )
{
Selection aSelection( maSelection );
aSelection.Max() = nChar;
@@ -1442,7 +1444,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() < 4 )
{
- mbClickedInSelection = FALSE;
+ mbClickedInSelection = sal_False;
if ( rMEvt.GetClicks() == 3 )
{
ImplSetSelection( Selection( 0, 0xFFFF ) );
@@ -1457,7 +1459,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
ImplCopyToSelectionClipboard();
}
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) )
- mbClickedInSelection = TRUE;
+ mbClickedInSelection = sal_True;
else if ( rMEvt.IsLeft() )
ImplSetCursorPos( nChar, rMEvt.IsShift() );
@@ -1465,9 +1467,9 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
StartTracking( STARTTRACK_SCROLLREPEAT );
}
- mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren
+ mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren
GrabFocus();
- mbInMBDown = FALSE;
+ mbInMBDown = sal_False;
}
// -----------------------------------------------------------------------
@@ -1477,8 +1479,8 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt )
if ( mbClickedInSelection && rMEvt.IsLeft() )
{
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() );
- ImplSetCursorPos( nChar, FALSE );
- mbClickedInSelection = FALSE;
+ ImplSetCursorPos( nChar, sal_False );
+ mbClickedInSelection = sal_False;
}
else if ( rMEvt.IsMiddle() && !mbReadOnly &&
( GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION ) )
@@ -1498,8 +1500,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if ( mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, FALSE );
- mbClickedInSelection = FALSE;
+ ImplSetCursorPos( nChar, sal_False );
+ mbClickedInSelection = sal_False;
}
else if ( rTEvt.GetMouseEvent().IsLeft() )
{
@@ -1511,7 +1513,7 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
if( !mbClickedInSelection )
{
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
- ImplSetCursorPos( nChar, TRUE );
+ ImplSetCursorPos( nChar, sal_True );
}
}
@@ -1521,13 +1523,13 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
+sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
- BOOL bDone = FALSE;
- USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
- mbInternModified = FALSE;
+ mbInternModified = sal_False;
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -1539,7 +1541,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
Cut();
ImplModified();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1549,7 +1551,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !(GetStyle() & WB_PASSWORD) )
{
Copy();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1559,7 +1561,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Paste();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1569,7 +1571,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
Undo();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1584,7 +1586,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( nCode == KEY_A )
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( rKEvt.GetKeyCode().IsShift() && (nCode == KEY_S) )
{
@@ -1598,7 +1600,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplInsertText( aChars );
ImplModified();
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
@@ -1610,7 +1612,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case com::sun::star::awt::Key::SELECT_ALL:
{
ImplSetSelection( Selection( 0, maText.Len() ) );
- bDone = TRUE;
+ bDone = sal_True;
}
break;
@@ -1736,7 +1738,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1750,8 +1752,8 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
- BYTE nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
- BYTE nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
+ sal_uInt8 nDel = (nCode == KEY_DELETE) ? EDIT_DEL_RIGHT : EDIT_DEL_LEFT;
+ sal_uInt8 nMode = rKEvt.GetKeyCode().IsMod1() ? EDIT_DELMODE_RESTOFWORD : EDIT_DELMODE_SIMPLE;
if ( (nMode == EDIT_DELMODE_RESTOFWORD) && rKEvt.GetKeyCode().IsShift() )
nMode = EDIT_DELMODE_RESTOFCONTENT;
switch( nCode )
@@ -1778,7 +1780,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplDelete( maSelection, nDel, nMode );
if ( maText.Len() != nOldLen )
ImplModified();
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
@@ -1788,11 +1790,14 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mpIMEInfos && !mbReadOnly && !rKEvt.GetKeyCode().IsMod2() )
{
SetInsertMode( !mbInsertMode );
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
+ /* #i101255# disable autocomplete tab forward/backward
+ users expect tab/shif-tab to move the focus to other controls
+ not suddenly to cycle the autocompletion
case KEY_TAB:
{
if ( !mbReadOnly && maAutocompleteHdl.IsSet() &&
@@ -1810,16 +1815,17 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
// Wurde nichts veraendert, dann TAB fuer DialogControl
if ( GetSelection().Len() )
- bDone = TRUE;
+ bDone = sal_True;
}
}
break;
+ */
default:
{
if ( IsCharInput( rKEvt ) )
{
- bDone = TRUE; // Auch bei ReadOnly die Zeichen schlucken.
+ bDone = sal_True; // Auch bei ReadOnly die Zeichen schlucken.
if ( !mbReadOnly )
{
ImplInsertText( rKEvt.GetCharCode(), 0, sal_True );
@@ -1887,9 +1893,9 @@ void Edit::Resize()
// -----------------------------------------------------------------------
-void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1904,8 +1910,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1997,7 +2003,7 @@ void Edit::GetFocus()
{
maUndoText = maText;
- ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ sal_uLong nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
if ( !( GetStyle() & (WB_NOHIDESELECTION|WB_READONLY) )
&& ( GetGetFocusFlags() & (GETFOCUS_INIT|GETFOCUS_TAB|GETFOCUS_CURSOR|GETFOCUS_MNEMONIC) ) )
{
@@ -2094,22 +2100,22 @@ void Edit::Command( const CommandEvent& rCEvt )
if ( !maSelection.Len() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
}
if ( IsReadOnly() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False );
}
else
{
// Paste nur, wenn Text im Clipboard
- BOOL bData = FALSE;
+ sal_Bool bData = sal_False;
uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetClipboard();
if ( xClipboard.is() )
{
@@ -2127,17 +2133,17 @@ void Edit::Command( const CommandEvent& rCEvt )
}
if ( maUndoText == maText )
- pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
- pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
if ( !pImplFncGetSpecialChars )
{
- USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
@@ -2146,7 +2152,7 @@ void Edit::Command( const CommandEvent& rCEvt )
Size aSize = GetOutputSizePixel();
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
- USHORT n = pPopup->Execute( this, aPos );
+ sal_uInt16 n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
SetSelection( aSaveSel );
switch ( n )
@@ -2185,7 +2191,7 @@ void Edit::Command( const CommandEvent& rCEvt )
}
break;
}
- mbActivePopup = FALSE;
+ mbActivePopup = sal_False;
}
else if ( rCEvt.GetCommand() == COMMAND_VOICE )
{
@@ -2233,12 +2239,12 @@ void Edit::Command( const CommandEvent& rCEvt )
}
else if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
{
- BOOL bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
+ sal_Bool bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
delete mpIMEInfos;
mpIMEInfos = NULL;
// Font wieder ohne Attribute einstellen, wird jetzt im Repaint nicht
// mehr neu initialisiert
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
SetInsertMode( bInsertMode );
@@ -2262,20 +2268,20 @@ void Edit::Command( const CommandEvent& rCEvt )
maText.Insert( pData->GetText(), mpIMEInfos->nPos );
if ( mpIMEInfos->bWasCursorOverwrite )
{
- USHORT nOldIMETextLen = mpIMEInfos->nLen;
- USHORT nNewIMETextLen = pData->GetText().Len();
+ sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen;
+ sal_uInt16 nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
+ sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
maText.Insert( mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ), mpIMEInfos->nPos + nNewIMETextLen );
}
else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
maText.Erase( mpIMEInfos->nPos + nNewIMETextLen, nOverwrite );
@@ -2307,7 +2313,7 @@ void Edit::Command( const CommandEvent& rCEvt )
{
if ( mpIMEInfos )
{
- xub_StrLen nCursorPos = (USHORT)GetSelection().Max();
+ xub_StrLen nCursorPos = (sal_uInt16)GetSelection().Max();
SetCursorRect( NULL, GetTextWidth(
maText, nCursorPos, mpIMEInfos->nPos+mpIMEInfos->nLen-nCursorPos ) );
}
@@ -2337,10 +2343,10 @@ void Edit::StateChanged( StateChangedType nType )
mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
ImplAlign();
if ( !mpSubEdit )
- ImplShowCursor( FALSE );
+ ImplShowCursor( sal_False );
}
// update background (eventual SetPaintTransparent)
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
}
else if ( nType == STATE_CHANGE_ENABLE )
{
@@ -2359,7 +2365,7 @@ void Edit::StateChanged( StateChangedType nType )
SetStyle( nStyle );
}
- USHORT nOldAlign = mnAlign;
+ sal_uInt16 nOldAlign = mnAlign;
mnAlign = EDIT_ALIGN_LEFT;
// --- RTL --- hack: right align until keyinput and cursor travelling works
@@ -2393,8 +2399,8 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
- ImplShowCursor( TRUE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplShowCursor( sal_True );
Invalidate();
}
}
@@ -2402,7 +2408,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplShowCursor();
Invalidate();
}
@@ -2411,7 +2417,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
}
@@ -2419,7 +2425,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -2438,8 +2444,8 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( !mpSubEdit )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
- ImplShowCursor( TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplShowCursor( sal_True );
Invalidate();
}
}
@@ -2460,7 +2466,7 @@ void Edit::ImplShowDDCursor()
mpDDInfo->aCursor.SetPos( aCursorRect.TopLeft() );
mpDDInfo->aCursor.SetSize( aCursorRect.GetSize() );
mpDDInfo->aCursor.Show();
- mpDDInfo->bVisCursor = TRUE;
+ mpDDInfo->bVisCursor = sal_True;
}
}
@@ -2471,7 +2477,7 @@ void Edit::ImplHideDDCursor()
if ( mpDDInfo && mpDDInfo->bVisCursor )
{
mpDDInfo->aCursor.Hide();
- mpDDInfo->bVisCursor = FALSE;
+ mpDDInfo->bVisCursor = sal_False;
}
}
@@ -2523,7 +2529,7 @@ IMPL_LINK( Edit, ImplUpdateDataHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-void Edit::EnableUpdateData( ULONG nTimeout )
+void Edit::EnableUpdateData( sal_uLong nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -2550,7 +2556,7 @@ void Edit::SetEchoChar( xub_Unicode c )
// -----------------------------------------------------------------------
-void Edit::SetReadOnly( BOOL bReadOnly )
+void Edit::SetReadOnly( sal_Bool bReadOnly )
{
if ( mbReadOnly != bReadOnly )
{
@@ -2573,7 +2579,7 @@ void Edit::SetAutocompleteHdl( const Link& rHdl )
// -----------------------------------------------------------------------
-void Edit::SetInsertMode( BOOL bInsert )
+void Edit::SetInsertMode( sal_Bool bInsert )
{
if ( bInsert != mbInsertMode )
{
@@ -2587,7 +2593,7 @@ void Edit::SetInsertMode( BOOL bInsert )
// -----------------------------------------------------------------------
-BOOL Edit::IsInsertMode() const
+sal_Bool Edit::IsInsertMode() const
{
if ( mpSubEdit )
return mpSubEdit->IsInsertMode();
@@ -2626,7 +2632,7 @@ void Edit::SetSelection( const Selection& rSelection )
// -----------------------------------------------------------------------
-void Edit::ImplSetSelection( const Selection& rSelection, BOOL bPaint )
+void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint )
{
if ( mpSubEdit )
mpSubEdit->ImplSetSelection( rSelection );
@@ -2797,9 +2803,9 @@ XubString Edit::GetText() const
void Edit::SetModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = TRUE;
+ mpSubEdit->mbModified = sal_True;
else
- mbModified = TRUE;
+ mbModified = sal_True;
}
// -----------------------------------------------------------------------
@@ -2807,9 +2813,9 @@ void Edit::SetModifyFlag()
void Edit::ClearModifyFlag()
{
if ( mpSubEdit )
- mpSubEdit->mbModified = FALSE;
+ mpSubEdit->mbModified = sal_False;
else
- mbModified = FALSE;
+ mbModified = sal_False;
}
// -----------------------------------------------------------------------
@@ -2820,7 +2826,7 @@ void Edit::SetSubEdit( Edit* pEdit )
if ( mpSubEdit )
{
SetPointer( POINTER_ARROW ); // Nur das SubEdit hat den BEAM...
- mpSubEdit->mbIsSubEdit = TRUE;
+ mpSubEdit->mbIsSubEdit = sal_True;
mpSubEdit->SetReadOnly( mbReadOnly );
}
@@ -2855,6 +2861,14 @@ Size Edit::CalcMinimumSize() const
return aSize;
}
+Size Edit::GetMinimumEditSize()
+{
+ Window* pDefWin = ImplGetDefaultWindow();
+ Edit aEdit( pDefWin, WB_BORDER );
+ Size aSize( aEdit.CalcMinimumSize() );
+ return aSize;
+}
+
// -----------------------------------------------------------------------
Size Edit::GetOptimalSize(WindowSizeType eType) const
@@ -2924,8 +2938,8 @@ PopupMenu* Edit::CreatePopupMenu()
pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE, FALSE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE, FALSE ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, sal_False, sal_True, sal_False, sal_False ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, sal_True, sal_True, sal_False, sal_False ) );
return pPopup;
}
@@ -2942,7 +2956,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
SolarMutexGuard aVclGuard;
if ( !IsTracking() && maSelection.Len() &&
- !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == FALSE) ) // Kein Mehrfach D&D
+ !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == sal_False) ) // Kein Mehrfach D&D
{
Selection aSel( maSelection );
aSel.Justify();
@@ -2955,7 +2969,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
if ( !mpDDInfo )
mpDDInfo = new DDInfo;
- mpDDInfo->bStarterOfDD = TRUE;
+ mpDDInfo->bStarterOfDD = sal_True;
mpDDInfo->aDndStartSel = aSel;
@@ -3005,7 +3019,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
{
SolarMutexGuard aVclGuard;
- BOOL bChanges = FALSE;
+ sal_Bool bChanges = sal_False;
if ( !mbReadOnly && mpDDInfo )
{
ImplHideDDCursor();
@@ -3016,7 +3030,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
if ( aSel.Len() && !mpDDInfo->bStarterOfDD )
ImplDelete( aSel, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
- mpDDInfo->bDroppedInMe = TRUE;
+ mpDDInfo->bDroppedInMe = sal_True;
aSel.Min() = mpDDInfo->nDropPos;
aSel.Max() = mpDDInfo->nDropPos;
@@ -3033,7 +3047,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
::rtl::OUString aText;
aData >>= aText;
ImplInsertText( aText );
- bChanges = TRUE;
+ bChanges = sal_True;
ImplModified();
}
}
@@ -3048,17 +3062,26 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent&
rDTDE.Context->dropComplete( bChanges );
}
-void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& ) throw (::com::sun::star::uno::RuntimeException)
+void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
if ( !mpDDInfo )
{
mpDDInfo = new DDInfo;
}
-// sal_Bool bTextContent = mbReadOnly ? sal_False : sal_True; // quiery from rDTDEE.SupportedDataFlavors()
-// if ( bTextContent )
-// rDTDEE.Context->acceptDrop(datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE);
-// else
-// rDTDEE.Context->rejectDrop();
+ // search for string data type
+ const Sequence< com::sun::star::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
+ sal_Int32 nEle = rFlavors.getLength();
+ mpDDInfo->bIsStringSupported = sal_False;
+ for( sal_Int32 i = 0; i < nEle; i++ )
+ {
+ sal_Int32 nIndex = 0;
+ rtl::OUString aMimetype = rFlavors[i].MimeType.getToken( 0, ';', nIndex );
+ if( aMimetype.equalsAscii( "text/plain" ) )
+ {
+ mpDDInfo->bIsStringSupported = sal_True;
+ break;
+ }
+ }
}
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
@@ -3090,7 +3113,7 @@ void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEv
aSel.Justify();
// Don't accept drop in selection or read-only field...
- if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) )
+ if ( IsReadOnly() || aSel.IsInside( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported )
{
ImplHideDDCursor();
rDTDE.Context->rejectDrag();
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 4fffe2f277ca..1d5b0c66b400 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -52,8 +52,6 @@
using namespace ::com::sun::star;
-static ResStringArray *strAllUnits = NULL;
-
// -----------------------------------------------------------------------
#define FORMAT_NUMERIC 1
@@ -62,9 +60,9 @@ static ResStringArray *strAllUnits = NULL;
// -----------------------------------------------------------------------
-static sal_Int64 ImplPower10( USHORT n )
+static sal_Int64 ImplPower10( sal_uInt16 n )
{
- USHORT i;
+ sal_uInt16 i;
sal_Int64 nValue = 1;
for ( i=0; i < n; i++ )
@@ -75,16 +73,16 @@ static sal_Int64 ImplPower10( USHORT n )
// -----------------------------------------------------------------------
-static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bThousandSep,
+static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bThousandSep,
const LocaleDataWrapper& rLocaleDataWrappper )
{
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -92,28 +90,28 @@ static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(cChar == rLocaleDataWrappper.getNumDecimalSep() ) ||
(bThousandSep && (cChar == rLocaleDataWrappper.getNumThousandSep())) ||
(cChar == '-') )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
- BOOL bCurrency = FALSE )
+static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper,
+ sal_Bool bCurrency = sal_False )
{
XubString aStr = rStr;
XubString aStr1;
XubString aStr2;
- BOOL bNegative = FALSE;
+ sal_Bool bNegative = sal_False;
xub_StrLen nDecPos;
xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -132,7 +130,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -141,14 +139,14 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- USHORT nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
+ sal_uInt16 nFormat = rLocaleDataWrappper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
@@ -158,7 +156,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
@@ -168,7 +166,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -188,7 +186,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return FALSE;
+ return sal_False;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -196,11 +194,11 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- BOOL bRound = FALSE;
+ sal_Bool bRound = sal_False;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = TRUE;
+ bRound = sal_True;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -221,7 +219,43 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
rValue = nValue;
- return TRUE;
+ return sal_True;
+}
+
+static void ImplUpdateSeparatorString( String& io_rText,
+ const String& rOldDecSep, const String& rNewDecSep,
+ const String& rOldThSep, const String& rNewThSep )
+{
+ rtl::OUStringBuffer aBuf( io_rText.Len() );
+ xub_StrLen nIndexDec = 0, nIndexTh = 0, nIndex = 0;
+
+ const sal_Unicode* pBuffer = io_rText.GetBuffer();
+ while( nIndex != STRING_NOTFOUND )
+ {
+ nIndexDec = io_rText.Search( rOldDecSep, nIndex );
+ nIndexTh = io_rText.Search( rOldThSep, nIndex );
+ if( (nIndexTh != STRING_NOTFOUND && nIndexDec != STRING_NOTFOUND && nIndexTh < nIndexDec )
+ || (nIndexTh != STRING_NOTFOUND && nIndexDec == STRING_NOTFOUND)
+ )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexTh - nIndex );
+ aBuf.append( rNewThSep );
+ nIndex = nIndexTh + rOldThSep.Len();
+ }
+ else if( nIndexDec != STRING_NOTFOUND )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexDec - nIndex );
+ aBuf.append( rNewDecSep );
+ nIndex = nIndexDec + rOldDecSep.Len();
+ }
+ else
+ {
+ aBuf.append( pBuffer + nIndex );
+ nIndex = STRING_NOTFOUND;
+ }
+ }
+
+ io_rText = aBuf.makeStringAndClear();
}
static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep,
@@ -233,29 +267,25 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
if( bChangeDec || bChangeTh )
{
- BOOL bUpdateMode = pEdit->IsUpdateMode();
- pEdit->SetUpdateMode( FALSE );
+ sal_Bool bUpdateMode = pEdit->IsUpdateMode();
+ pEdit->SetUpdateMode( sal_False );
String aText = pEdit->GetText();
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pEdit->SetText( aText );
ComboBox* pCombo = dynamic_cast<ComboBox*>(pEdit);
if( pCombo )
{
// update box entries
- USHORT nEntryCount = pCombo->GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ sal_uInt16 nEntryCount = pCombo->GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
aText = pCombo->GetEntry( i );
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ void* pEntryData = pCombo->GetEntryData( i );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pCombo->RemoveEntry( i );
pCombo->InsertEntry( aText, i );
+ pCombo->SetEntryData( i, pEntryData );
}
}
if( bUpdateMode )
@@ -269,11 +299,11 @@ FormatterBase::FormatterBase( Edit* pField )
{
mpField = pField;
mpLocaleDataWrapper = NULL;
- mbReformat = FALSE;
- mbStrictFormat = FALSE;
- mbEmptyFieldValue = FALSE;
- mbEmptyFieldValueEnabled = FALSE;
- mbDefaultLocale = TRUE;
+ mbReformat = sal_False;
+ mbStrictFormat = sal_False;
+ mbEmptyFieldValue = sal_False;
+ mbEmptyFieldValueEnabled = sal_False;
+ mbDefaultLocale = sal_True;
}
// -----------------------------------------------------------------------
@@ -314,7 +344,7 @@ void FormatterBase::ReformatAll()
// -----------------------------------------------------------------------
-void FormatterBase::SetStrictFormat( BOOL bStrict )
+void FormatterBase::SetStrictFormat( sal_Bool bStrict )
{
if ( bStrict != mbStrictFormat )
{
@@ -329,7 +359,7 @@ void FormatterBase::SetStrictFormat( BOOL bStrict )
void FormatterBase::SetLocale( const lang::Locale& rLocale )
{
ImplGetLocaleDataWrapper().setLocale( rLocale );
- mbDefaultLocale = FALSE;
+ mbDefaultLocale = sal_False;
ReformatAll();
}
@@ -360,7 +390,7 @@ const AllSettings& FormatterBase::GetFieldSettings() const
// -----------------------------------------------------------------------
-void FormatterBase::SetFieldText( const XubString& rText, BOOL bKeepSelection )
+void FormatterBase::SetFieldText( const XubString& rText, sal_Bool bKeepSelection )
{
if ( mpField )
{
@@ -387,7 +417,7 @@ void FormatterBase::ImplSetText( const XubString& rText, Selection* pNewSelectio
mpField->SetText( rText, aSel );
}
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
}
@@ -397,23 +427,23 @@ void FormatterBase::SetEmptyFieldValue()
{
if ( mpField )
mpField->SetText( ImplGetSVEmptyStr() );
- mbEmptyFieldValue = TRUE;
+ mbEmptyFieldValue = sal_True;
}
// -----------------------------------------------------------------------
-BOOL FormatterBase::IsEmptyFieldValue() const
+sal_Bool FormatterBase::IsEmptyFieldValue() const
{
return (!mpField || !mpField->GetText().Len());
}
// -----------------------------------------------------------------------
-BOOL NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
+sal_Bool NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValue,
XubString& rOutStr )
{
if ( !ImplNumericGetValue( rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
- return TRUE;
+ return sal_True;
else
{
double nTempVal = rValue;
@@ -429,14 +459,14 @@ BOOL NumericFormatter::ImplNumericReformat( const XubString& rStr, double& rValu
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -451,8 +481,8 @@ void NumericFormatter::ImplInit()
mnCorrectedValue = 0;
mnDecimalDigits = 2;
mnType = FORMAT_NUMERIC;
- mbThousandSep = TRUE;
- mbShowTrailingZeros = TRUE;
+ mbThousandSep = sal_True;
+ mbShowTrailingZeros = sal_True;
// for fields
mnSpinSize = 1;
@@ -477,7 +507,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
@@ -486,7 +516,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
mnMax = pMgr->ReadLong();
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
@@ -502,7 +532,7 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
}
if ( NUMERICFORMATTER_NOTHOUSANDSEP & nMask )
- SetUseThousandSep( !(BOOL)pMgr->ReadShort() );
+ SetUseThousandSep( !(sal_Bool)pMgr->ReadShort() );
}
}
@@ -532,7 +562,7 @@ void NumericFormatter::SetMax( sal_Int64 nNewMax )
// -----------------------------------------------------------------------
-void NumericFormatter::SetUseThousandSep( BOOL b )
+void NumericFormatter::SetUseThousandSep( sal_Bool b )
{
mbThousandSep = b;
ReformatAll();
@@ -540,7 +570,7 @@ void NumericFormatter::SetUseThousandSep( BOOL b )
// -----------------------------------------------------------------------
-void NumericFormatter::SetDecimalDigits( USHORT nDigits )
+void NumericFormatter::SetDecimalDigits( sal_uInt16 nDigits )
{
mnDecimalDigits = nDigits;
ReformatAll();
@@ -548,7 +578,7 @@ void NumericFormatter::SetDecimalDigits( USHORT nDigits )
// -----------------------------------------------------------------------
-void NumericFormatter::SetShowTrailingZeros( BOOL bShowTrailingZeros )
+void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros )
{
if ( mbShowTrailingZeros != bShowTrailingZeros )
{
@@ -559,7 +589,7 @@ void NumericFormatter::SetShowTrailingZeros( BOOL bShowTrailingZeros )
// -----------------------------------------------------------------------
-USHORT NumericFormatter::GetDecimalDigits() const
+sal_uInt16 NumericFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
@@ -570,7 +600,7 @@ void NumericFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -626,14 +656,14 @@ sal_Int64 NumericFormatter::GetValue() const
// -----------------------------------------------------------------------
-BOOL NumericFormatter::IsValueModified() const
+sal_Bool NumericFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyFieldValue();
else if ( GetValue() != mnFieldValue )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -690,7 +720,7 @@ void NumericFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- BOOL bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
+ sal_Bool bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
return;
@@ -810,7 +840,7 @@ void NumericField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
NumericFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( NUMERICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -846,7 +876,7 @@ long NumericField::PreNotify( NotifyEvent& rNEvt )
long NumericField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -879,7 +909,7 @@ void NumericField::DataChanged( const DataChangedEvent& rDCEvt )
void NumericField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -965,7 +995,7 @@ long NumericBox::PreNotify( NotifyEvent& rNEvt )
long NumericBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -998,7 +1028,7 @@ void NumericBox::DataChanged( const DataChangedEvent& rDCEvt )
void NumericBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -1008,21 +1038,21 @@ void NumericBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplNumericReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
NumericFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void NumericBox::InsertValue( sal_Int64 nValue, USHORT nPos )
+void NumericBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -1036,7 +1066,7 @@ void NumericBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 NumericBox::GetValue( USHORT nPos ) const
+sal_Int64 NumericBox::GetValue( sal_uInt16 nPos ) const
{
double nValue = 0;
ImplNumericGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -1045,19 +1075,19 @@ sal_Int64 NumericBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT NumericBox::GetValuePos( sal_Int64 nValue ) const
+sal_uInt16 NumericBox::GetValuePos( sal_Int64 nValue ) const
{
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
}
// -----------------------------------------------------------------------
-static BOOL ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
@@ -1083,7 +1113,7 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
/*
// MT: #90545# Preparation for translated strings...
String aMetricText;
- for ( USHORT n = rStr.Len(); n; )
+ for ( sal_uInt16 n = rStr.Len(); n; )
{
sal_Unicode c = rStr.GetChar( --n );
sal_Int32 nType = xCharClass->getStringType( rStr, n, 1, rLocale );
@@ -1105,38 +1135,37 @@ static XubString ImplMetricGetUnitText( const XubString& rStr )
// #104355# support localized mesaurements
-static String ImplMetricToString( FieldUnit rUnit )
+static const String& ImplMetricToString( FieldUnit rUnit )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return unit's default string (ie, the first one )
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->second == rUnit )
+ return it->first;
+ }
}
- // return unit's default string (ie, the first one )
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if( (FieldUnit) strAllUnits->GetValue( i ) == rUnit )
- return strAllUnits->GetString( i );
- return String();
+ return String::EmptyString();
}
static FieldUnit ImplStringToMetric( const String &rMetricString )
{
- if( !strAllUnits )
+ FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
+ if( pList )
{
- ResMgr* pResMgr = ImplGetResMgr();
- strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+ // return FieldUnit
+ String aStr( rMetricString );
+ aStr.ToLowerAscii();
+ aStr.EraseAllChars( sal_Unicode( ' ' ) );
+ for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+ {
+ if ( it->first.Equals( aStr ) )
+ return it->second;
+ }
}
- // return FieldUnit
- String aStr( rMetricString );
- aStr.ToLowerAscii();
- for( USHORT i=0; i < strAllUnits->Count(); i++ )
- if ( strAllUnits->GetString( i ).Equals( aStr ) )
- return (FieldUnit) strAllUnits->GetValue( i );
-
- // Amelia : about character unit
- if (aStr.EqualsIgnoreCaseAscii("cm"))
- return FUNIT_CM;
return FUNIT_NONE;
}
@@ -1225,7 +1254,7 @@ static double nonValueDoubleToValueDouble( double nValue )
return rtl::math::isFinite( nValue ) ? nValue : 0.0;
}
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
double nDouble = nonValueDoubleToValueDouble( ConvertDoubleValue(
@@ -1244,7 +1273,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, US
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1254,7 +1283,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
+sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
return static_cast<sal_Int64>(
@@ -1264,7 +1293,7 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, USHORT nDecDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
if ( eInUnit != eOutUnit )
@@ -1276,7 +1305,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, US
if ( (mnBaseValue <= 0) || (nValue <= 0) )
return nValue;
nDiv = 100;
- for ( USHORT i=0; i < nDecDigits; i++ )
+ for ( sal_uInt16 i=0; i < nDecDigits; i++ )
nDiv *= 10;
nMult = mnBaseValue;
@@ -1315,7 +1344,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, US
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
if ( eOutUnit == FUNIT_PERCENT ||
@@ -1372,7 +1401,7 @@ double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
+double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
if ( eInUnit == FUNIT_PERCENT ||
@@ -1429,12 +1458,12 @@ double MetricField::ConvertDoubleValue( double nValue, USHORT nDigits,
// -----------------------------------------------------------------------
-static BOOL ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
+static sal_Bool ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64 nBaseValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit )
{
// Zahlenwert holen
if ( !ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper ) )
- return FALSE;
+ return sal_False;
// Einheit rausfinden
FieldUnit eEntryUnit = ImplMetricGetUnit( rStr );
@@ -1442,15 +1471,15 @@ static BOOL ImplMetricGetValue( const XubString& rStr, double& rValue, sal_Int64
// Einheiten umrechnen
rValue = MetricField::ConvertDoubleValue( rValue, nBaseValue, nDecDigits, eEntryUnit, eUnit );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
+sal_Bool MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue, XubString& rOutStr )
{
if ( !ImplMetricGetValue( rStr, rValue, mnBaseValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), meUnit ) )
- return TRUE;
+ return sal_True;
else
{
double nTempVal = rValue;
@@ -1466,14 +1495,14 @@ BOOL MetricFormatter::ImplMetricReformat( const XubString& rStr, double& rValue,
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (sal_Int64)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -1502,7 +1531,7 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( METRICFORMATTER_UNIT & nMask )
meUnit = (FieldUnit)pMgr->ReadLong();
@@ -1676,7 +1705,7 @@ void MetricFormatter::Reformat()
XubString aStr;
// caution: precision loss in double cast
double nTemp = (double)mnLastValue;
- BOOL bOK = ImplMetricReformat( aText, nTemp, aStr );
+ sal_Bool bOK = ImplMetricReformat( aText, nTemp, aStr );
mnLastValue = (sal_Int64)nTemp;
if ( !bOK )
@@ -1733,7 +1762,7 @@ void MetricField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
MetricFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( METRICFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -1825,7 +1854,7 @@ long MetricField::PreNotify( NotifyEvent& rNEvt )
long MetricField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1858,7 +1887,7 @@ void MetricField::DataChanged( const DataChangedEvent& rDCEvt )
void MetricField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -1951,7 +1980,7 @@ long MetricBox::PreNotify( NotifyEvent& rNEvt )
long MetricBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1984,7 +2013,7 @@ void MetricBox::DataChanged( const DataChangedEvent& rDCEvt )
void MetricBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -1994,16 +2023,16 @@ void MetricBox::ReformatAll()
{
double nValue;
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplMetricReformat( GetEntry( i ), nValue, aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
MetricFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
@@ -2015,7 +2044,7 @@ void MetricBox::CustomConvert()
// -----------------------------------------------------------------------
-void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, USHORT nPos )
+void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPos )
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2035,7 +2064,7 @@ void MetricBox::RemoveValue( sal_Int64 nValue, FieldUnit eInUnit )
// -----------------------------------------------------------------------
-sal_Int64 MetricBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
+sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
{
double nValue = 0;
ImplMetricGetValue( ComboBox::GetEntry( nPos ), nValue, mnBaseValue,
@@ -2050,7 +2079,7 @@ sal_Int64 MetricBox::GetValue( USHORT nPos, FieldUnit eOutUnit ) const
// -----------------------------------------------------------------------
-USHORT MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
+sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
{
// Umrechnen auf eingestellte Einheiten
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
@@ -2076,31 +2105,31 @@ sal_Int64 MetricBox::GetValue() const
// -----------------------------------------------------------------------
-static BOOL ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rWrapper )
+static sal_Bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
// -----------------------------------------------------------------------
-inline BOOL ImplCurrencyGetValue( const XubString& rStr, double& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rWrapper )
+inline sal_Bool ImplCurrencyGetValue( const XubString& rStr, double& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, TRUE );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, sal_True );
}
// -----------------------------------------------------------------------
-BOOL CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
+sal_Bool CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
XubString& rOutStr )
{
double nValue;
- if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), TRUE ) )
- return TRUE;
+ if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), sal_True ) )
+ return sal_True;
else
{
double nTempVal = nValue;
@@ -2116,14 +2145,14 @@ BOOL CurrencyFormatter::ImplCurrencyReformat( const XubString& rStr,
if ( !GetErrorHdl().Call( this ) )
{
mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
mnCorrectedValue = 0;
}
rOutStr = CreateFieldText( (long)nTempVal );
- return TRUE;
+ return sal_True;
}
}
@@ -2168,7 +2197,7 @@ void CurrencyFormatter::SetValue( sal_Int64 nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -2207,7 +2236,7 @@ void CurrencyFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
+ sal_Bool bOK = ImplCurrencyReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
@@ -2254,7 +2283,7 @@ void CurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
CurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -2292,7 +2321,7 @@ long CurrencyField::PreNotify( NotifyEvent& rNEvt )
long CurrencyField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2325,7 +2354,7 @@ void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -2411,7 +2440,7 @@ long CurrencyBox::PreNotify( NotifyEvent& rNEvt )
long CurrencyBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -2444,7 +2473,7 @@ void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt )
void CurrencyBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -2453,21 +2482,21 @@ void CurrencyBox::Modify()
void CurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplCurrencyReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
CurrencyFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void CurrencyBox::InsertValue( sal_Int64 nValue, USHORT nPos )
+void CurrencyBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
{
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
}
@@ -2481,7 +2510,7 @@ void CurrencyBox::RemoveValue( sal_Int64 nValue )
// -----------------------------------------------------------------------
-sal_Int64 CurrencyBox::GetValue( USHORT nPos ) const
+sal_Int64 CurrencyBox::GetValue( sal_uInt16 nPos ) const
{
double nValue = 0;
ImplCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() );
@@ -2490,7 +2519,7 @@ sal_Int64 CurrencyBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT CurrencyBox::GetValuePos( sal_Int64 nValue ) const
+sal_uInt16 CurrencyBox::GetValuePos( sal_Int64 nValue ) const
{
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index bd6eec0029e8..65e8c8d91f82 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -92,7 +92,7 @@ static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const String& rStr )
// -----------------------------------------------------------------------
-static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, ULONG nNumber, int nMinLen )
+static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLen )
{
// fill temp buffer with digits
sal_Unicode aTempBuf[30];
@@ -129,15 +129,15 @@ static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, ULONG nNumber, int nMinLen )
// -----------------------------------------------------------------------
-static USHORT ImplGetNum( const sal_Unicode*& rpBuf, BOOL& rbError )
+static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, sal_Bool& rbError )
{
if ( !*rpBuf )
{
- rbError = TRUE;
+ rbError = sal_True;
return 0;
}
- USHORT nNumber = 0;
+ sal_uInt16 nNumber = 0;
while( ( *rpBuf >= '0' ) && ( *rpBuf <= '9' ) )
{
nNumber *= 10;
@@ -173,38 +173,38 @@ static int ImplIsPatternChar( xub_Unicode cChar, sal_Char cEditMask )
catch ( ::com::sun::star::uno::Exception& )
{
DBG_ERRORFILE( "ImplIsPatternChar: Exception caught!" );
- return FALSE;
+ return sal_False;
}
if ( (cEditMask == EDITMASK_ALPHA) || (cEditMask == EDITMASK_UPPERALPHA) )
{
if( !CharClass::isLetterType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( cEditMask == EDITMASK_NUM )
{
if( !CharClass::isNumericType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( (cEditMask == EDITMASK_ALPHANUM) || (cEditMask == EDITMASK_UPPERALPHANUM) )
{
if( !CharClass::isLetterNumericType( nType ) )
- return FALSE;
+ return sal_False;
}
else if ( (cEditMask == EDITMASK_ALLCHAR) || (cEditMask == EDITMASK_UPPERALLCHAR) )
{
if ( cChar < 32 )
- return FALSE;
+ return sal_False;
}
else if ( cEditMask == EDITMASK_NUMSPACE )
{
if ( !CharClass::isNumericType( nType ) && ( cChar != ' ' ) )
- return FALSE;
+ return sal_False;
}
else
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -230,12 +230,12 @@ static xub_Unicode ImplPatternChar( xub_Unicode cChar, sal_Char cEditMask )
static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
{
if ( c1 == c2 )
- return TRUE;
+ return sal_True;
else if ( ((c1 == '.') || (c1 == ',')) &&
((c2 == '.') || (c2 == ',')) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -243,7 +243,7 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 )
static XubString ImplPatternReformat( const XubString& rStr,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- USHORT nFormatFlags )
+ sal_uInt16 nFormatFlags )
{
if ( !rEditMask.Len() )
return rStr;
@@ -347,8 +347,8 @@ static XubString ImplPatternReformat( const XubString& rStr,
// -----------------------------------------------------------------------
static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask,
- USHORT nFormatFlags, BOOL bSameMask,
- USHORT nCursorPos, USHORT& rPos )
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask,
+ sal_uInt16 nCursorPos, sal_uInt16& rPos )
{
// Letzte Position darf nicht groesser als der enthaltene String sein
@@ -392,7 +392,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask
static void ImplPatternProcessStrictModify( Edit* pEdit,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- USHORT nFormatFlags, BOOL bSameMask )
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask )
{
XubString aText = pEdit->GetText();
@@ -421,7 +421,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
// Selection so anpassen, das diese wenn sie vorher am Ende
// stand, immer noch am Ende steht
Selection aSel = pEdit->GetSelection();
- ULONG nMaxSel = Max( aSel.Min(), aSel.Max() );
+ sal_uLong nMaxSel = Max( aSel.Min(), aSel.Max() );
if ( nMaxSel >= aText.Len() )
{
xub_StrLen nMaxPos = aNewText.Len();
@@ -462,7 +462,7 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC
// -----------------------------------------------------------------------
static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask,
- USHORT nFormatFlags, BOOL bSameMask,
+ sal_uInt16 nFormatFlags, sal_Bool bSameMask,
xub_StrLen nCursorPos )
{
// Naechstes Zeichen suchen, was kein Literal ist
@@ -483,22 +483,22 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString&
// -----------------------------------------------------------------------
-static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
const ByteString& rEditMask,
const XubString& rLiteralMask,
- BOOL bStrictFormat,
- USHORT nFormatFlags,
- BOOL bSameMask,
- BOOL& rbInKeyInput )
+ sal_Bool bStrictFormat,
+ sal_uInt16 nFormatFlags,
+ sal_Bool bSameMask,
+ sal_Bool& rbInKeyInput )
{
if ( !rEditMask.Len() || !bStrictFormat )
- return FALSE;
+ return sal_False;
Selection aOldSel = pEdit->GetSelection();
KeyCode aCode = rKEvt.GetKeyCode();
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nKeyCode = aCode.GetCode();
- BOOL bShift = aCode.IsShift();
+ sal_uInt16 nKeyCode = aCode.GetCode();
+ sal_Bool bShift = aCode.IsShift();
xub_StrLen nCursorPos = (xub_StrLen)aOldSel.Max();
xub_StrLen nNewPos;
xub_StrLen nTempPos;
@@ -511,7 +511,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_RIGHT )
{
@@ -527,7 +527,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_HOME )
{
@@ -543,7 +543,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( bShift )
aSel.Min() = aOldSel.Min();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_END )
{
@@ -565,7 +565,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
else
aSel.Min() = aSel.Max();
pEdit->SetSelection( aSel );
- return TRUE;
+ return sal_True;
}
else if ( (nKeyCode == KEY_BACKSPACE) || (nKeyCode == KEY_DELETE) )
{
@@ -616,16 +616,16 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( bSameMask )
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
- rbInKeyInput = TRUE;
+ rbInKeyInput = sal_True;
pEdit->SetText( aStr, Selection( nNewPos ) );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = FALSE;
+ rbInKeyInput = sal_False;
}
else
pEdit->SetSelection( Selection( nNewPos ) );
- return TRUE;
+ return sal_True;
}
else if ( nKeyCode == KEY_INSERT )
{
@@ -635,13 +635,13 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( !bSameMask )
{
Sound::Beep();
- return TRUE;
+ return sal_True;
}
}
}
if ( rKEvt.GetKeyCode().IsMod2() || (cChar < 32) || (cChar == 127) )
- return FALSE;
+ return sal_False;
Selection aSel = aOldSel;
aSel.Justify();
@@ -679,7 +679,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( nTempPos > nNewPos )
{
pEdit->SetSelection( Selection( nTempPos ) );
- return TRUE;
+ return sal_True;
}
}
break;
@@ -696,7 +696,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( cChar )
{
XubString aStr = pEdit->GetText();
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
if ( bSameMask && pEdit->IsInsertMode() )
{
// Text um Spacezeichen und Literale am Ende kuerzen, bis zur
@@ -727,7 +727,7 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags );
}
else
- bError = TRUE;
+ bError = sal_True;
}
else
{
@@ -748,18 +748,18 @@ static BOOL ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
Sound::Beep();
else
{
- rbInKeyInput = TRUE;
+ rbInKeyInput = sal_True;
Selection aNewSel( ImplPatternRightPos( aStr, rEditMask, nFormatFlags, bSameMask, nNewPos ) );
pEdit->SetText( aStr, aNewSel );
pEdit->SetModifyFlag();
pEdit->Modify();
- rbInKeyInput = FALSE;
+ rbInKeyInput = sal_False;
}
}
else
Sound::Beep();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -769,7 +769,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
{
maEditMask = rEditMask;
maLiteralMask = rLiteralMask;
- mbSameMask = TRUE;
+ mbSameMask = sal_True;
if ( maEditMask.Len() != maLiteralMask.Len() )
{
@@ -794,14 +794,14 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
(cTemp == EDITMASK_UPPERALLCHAR) ||
(cTemp == EDITMASK_NUMSPACE) )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
if ( i < rLiteralMask.Len() )
{
if ( rLiteralMask.GetChar( i ) != ' ' )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
}
@@ -809,7 +809,7 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
c = cTemp;
if ( cTemp != c )
{
- mbSameMask = FALSE;
+ mbSameMask = sal_False;
break;
}
}
@@ -822,8 +822,8 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask,
PatternFormatter::PatternFormatter()
{
mnFormatFlags = 0;
- mbSameMask = TRUE;
- mbInPattKeyInput = FALSE;
+ mbSameMask = sal_True;
+ mbInPattKeyInput = sal_False;
}
// -----------------------------------------------------------------------
@@ -835,10 +835,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( PATTERNFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( PATTERNFORMATTER_EDITMASK & nMask )
aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US );
@@ -874,7 +874,7 @@ void PatternFormatter::SetString( const XubString& rStr )
if ( GetField() )
{
GetField()->SetText( rStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
}
@@ -896,7 +896,7 @@ void PatternFormatter::Reformat()
{
ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) );
if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() )
- GetField()->SetInsertMode( FALSE );
+ GetField()->SetInsertMode( sal_False );
}
}
@@ -967,7 +967,7 @@ long PatternField::PreNotify( NotifyEvent& rNEvt )
long PatternField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -986,7 +986,7 @@ void PatternField::Modify()
if ( IsStrictFormat() )
ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() );
else
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
}
SpinField::Modify();
@@ -1045,7 +1045,7 @@ long PatternBox::PreNotify( NotifyEvent& rNEvt )
long PatternBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -1064,7 +1064,7 @@ void PatternBox::Modify()
if ( IsStrictFormat() )
ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() );
else
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
}
ComboBox::Modify();
@@ -1075,21 +1075,21 @@ void PatternBox::Modify()
void PatternBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
aStr = ImplPatternReformat( GetEntry( i ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
PatternFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void PatternBox::InsertString( const XubString& rStr, USHORT nPos )
+void PatternBox::InsertString( const XubString& rStr, sal_uInt16 nPos )
{
ComboBox::InsertEntry( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ), nPos );
}
@@ -1103,14 +1103,14 @@ void PatternBox::RemoveString( const XubString& rStr )
// -----------------------------------------------------------------------
-XubString PatternBox::GetString( USHORT nPos ) const
+XubString PatternBox::GetString( sal_uInt16 nPos ) const
{
return ImplPatternReformat( ComboBox::GetEntry( nPos ), GetEditMask(), GetLiteralMask(), GetFormatFlags() );
}
// -----------------------------------------------------------------------
-USHORT PatternBox::GetStringPos( const XubString& rStr ) const
+sal_uInt16 PatternBox::GetStringPos( const XubString& rStr ) const
{
return ComboBox::GetEntryPos( ImplPatternReformat( rStr, GetEditMask(), GetLiteralMask(), GetFormatFlags() ) );
}
@@ -1129,7 +1129,7 @@ static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld )
// -----------------------------------------------------------------------
-static USHORT ImplCutNumberFromString( XubString& rStr )
+static sal_uInt16 ImplCutNumberFromString( XubString& rStr )
{
// Nach Zahl suchen
while ( rStr.Len() && !(rStr.GetChar( 0 ) >= '0' && rStr.GetChar( 0 ) <= '9') )
@@ -1142,28 +1142,28 @@ static USHORT ImplCutNumberFromString( XubString& rStr )
aNumStr.Insert( rStr.GetChar( 0 ) );
rStr.Erase( 0, 1 );
}
- return (USHORT)aNumStr.ToInt32();
+ return (sal_uInt16)aNumStr.ToInt32();
}
// -----------------------------------------------------------------------
-static BOOL ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
+static sal_Bool ImplCutMonthName( XubString& rStr, const XubString& _rLookupMonthName )
{
- USHORT nPos = rStr.Search( _rLookupMonthName );
+ sal_uInt16 nPos = rStr.Search( _rLookupMonthName );
if ( nPos != STRING_NOTFOUND )
{
rStr.Erase( 0, nPos + _rLookupMonthName.Len() );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-static USHORT ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
+static sal_uInt16 ImplCutMonthFromString( XubString& rStr, const CalendarWrapper& rCalendarWrapper )
{
// search for a month' name
- for ( USHORT i=1; i <= 12; i++ )
+ for ( sal_uInt16 i=1; i <= 12; i++ )
{
String aMonthName = rCalendarWrapper.getMonths()[i-1].FullName;
// long month name?
@@ -1191,31 +1191,31 @@ static String ImplGetDateSep( const LocaleDataWrapper& rLocaleDataWrapper, ExtDa
return aDateSep;
}
-static BOOL ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
+static sal_Bool ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC)||
((cChar >= '0') && (cChar <= '9')) ||
(cChar == ImplGetDateSep( rLocaleDataWrapper, eFormat ).GetChar(0) ) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
+static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper,
const AllSettings& )
{
- USHORT nDay = 0;
- USHORT nMonth = 0;
- USHORT nYear = 0;
- BOOL bYear = TRUE;
- BOOL bError = FALSE;
+ sal_uInt16 nDay = 0;
+ sal_uInt16 nMonth = 0;
+ sal_uInt16 nYear = 0;
+ sal_Bool bYear = sal_True;
+ sal_Bool bError = sal_False;
String aStr( rStr );
if ( eDateFormat == XTDATEF_SYSTEM_LONG )
@@ -1245,13 +1245,13 @@ static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFo
{
// Check if year is present:
String aDateSep = ImplGetDateSep( rLocaleDataWrapper, eDateFormat );
- USHORT nSepPos = aStr.Search( aDateSep );
+ sal_uInt16 nSepPos = aStr.Search( aDateSep );
if ( nSepPos == STRING_NOTFOUND )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( aDateSep, nSepPos+1 );
if ( ( nSepPos == STRING_NOTFOUND ) || ( nSepPos == (aStr.Len()-1) ) )
{
- bYear = FALSE;
+ bYear = sal_False;
nYear = Date().GetYear();
}
@@ -1304,25 +1304,25 @@ static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFo
}
if ( bError || !nDay || !nMonth )
- return FALSE;
+ return sal_False;
Date aNewDate( nDay, nMonth, nYear );
DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() );
if ( aNewDate.IsValid() )
{
rDate = aNewDate;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
+sal_Bool DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr, const AllSettings& rSettings )
{
Date aDate( 0, 0, 0 );
- if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
- return TRUE;
+ if ( !ImplDateGetValue( rStr, aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ return sal_True;
Date aTempDate = aDate;
if ( aTempDate > GetMax() )
@@ -1336,7 +1336,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
if( !GetErrorHdl().Call( this ) )
{
maCorrectedDate = Date();
- return FALSE;
+ return sal_False;
}
else
maCorrectedDate = Date();
@@ -1344,7 +1344,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
rOutStr = ImplGetDateAsText( aTempDate, rSettings );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1352,7 +1352,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
const AllSettings& ) const
{
- BOOL bShowCentury = FALSE;
+ sal_Bool bShowCentury = sal_False;
switch ( GetExtDateFormat() )
{
case XTDATEF_SYSTEM_SHORT_YYYY:
@@ -1362,43 +1362,43 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
case XTDATEF_SHORT_YYYYMMDD:
case XTDATEF_SHORT_YYYYMMDD_DIN5008:
{
- bShowCentury = TRUE;
+ bShowCentury = sal_True;
}
break;
default:
{
- bShowCentury = FALSE;
+ bShowCentury = sal_False;
}
}
if ( !bShowCentury )
{
// Check if I have to use force showing the century
- USHORT nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
+ sal_uInt16 nYear = rDate.GetYear();
// Wenn Jahr nicht im 2stelligen Grenzbereich liegt,
if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
- bShowCentury = TRUE;
+ bShowCentury = sal_True;
}
sal_Unicode aBuf[128];
sal_Unicode* pBuf = aBuf;
- String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), GetExtDateFormat( TRUE ) );
- USHORT nDay = rDate.GetDay();
- USHORT nMonth = rDate.GetMonth();
- USHORT nYear = rDate.GetYear();
- USHORT nYearLen = bShowCentury ? 4 : 2;
+ String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), GetExtDateFormat( sal_True ) );
+ sal_uInt16 nDay = rDate.GetDay();
+ sal_uInt16 nMonth = rDate.GetMonth();
+ sal_uInt16 nYear = rDate.GetYear();
+ sal_uInt16 nYearLen = bShowCentury ? 4 : 2;
if ( !bShowCentury )
nYear %= 100;
- switch ( GetExtDateFormat( TRUE ) )
+ switch ( GetExtDateFormat( sal_True ) )
{
case XTDATEF_SYSTEM_LONG:
{
- return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !bShowCentury );
+ return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !bShowCentury );
}
case XTDATEF_SHORT_DDMMYY:
case XTDATEF_SHORT_DDMMYYYY:
@@ -1438,12 +1438,12 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
}
}
- return String( aBuf, (xub_StrLen)(ULONG)(pBuf-aBuf) );
+ return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementDay( Date& rDate, BOOL bUp )
+static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
@@ -1461,12 +1461,12 @@ static void ImplDateIncrementDay( Date& rDate, BOOL bUp )
// -----------------------------------------------------------------------
-static void ImplDateIncrementMonth( Date& rDate, BOOL bUp )
+static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
- USHORT nMonth = rDate.GetMonth();
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nMonth = rDate.GetMonth();
+ sal_uInt16 nYear = rDate.GetYear();
if ( bUp )
{
if ( (nMonth == 12) && (nYear < 9999) )
@@ -1494,18 +1494,18 @@ static void ImplDateIncrementMonth( Date& rDate, BOOL bUp )
}
}
- USHORT nDaysInMonth = rDate.GetDaysInMonth();
+ sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
if ( rDate.GetDay() > nDaysInMonth )
rDate.SetDay( nDaysInMonth );
}
// -----------------------------------------------------------------------
-static void ImplDateIncrementYear( Date& rDate, BOOL bUp )
+static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp )
{
DateFormatter::ExpandCentury( rDate );
- USHORT nYear = rDate.GetYear();
+ sal_uInt16 nYear = rDate.GetYear();
if ( bUp )
{
if ( nYear < 9999 )
@@ -1519,14 +1519,14 @@ static void ImplDateIncrementYear( Date& rDate, BOOL bUp )
}
// -----------------------------------------------------------------------
-BOOL DateFormatter::ImplAllowMalformedInput() const
+sal_Bool DateFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void DateField::ImplDateSpinArea( BOOL bUp )
+void DateField::ImplDateSpinArea( sal_Bool bUp )
{
// Wenn alles selektiert ist, Tage hochzaehlen
if ( GetField() )
@@ -1541,7 +1541,7 @@ void DateField::ImplDateSpinArea( BOOL bUp )
{
xub_StrLen nDateArea = 0;
- ExtDateFieldFormat eFormat = GetExtDateFormat( TRUE );
+ ExtDateFieldFormat eFormat = GetExtDateFormat( sal_True );
if ( eFormat == XTDATEF_SYSTEM_LONG )
{
eFormat = ImplGetExtFormat( ImplGetLocaleDataWrapper().getLongDateFormat() );
@@ -1555,7 +1555,7 @@ void DateField::ImplDateSpinArea( BOOL bUp )
for ( xub_StrLen i = 1; i <= 3; i++ )
{
nPos = aText.Search( aDateSep, nPos );
- if ( nPos >= (USHORT)aSelection.Max() )
+ if ( nPos >= (sal_uInt16)aSelection.Max() )
{
nDateArea = i;
break;
@@ -1620,8 +1620,8 @@ void DateField::ImplDateSpinArea( BOOL bUp )
void DateFormatter::ImplInit()
{
- mbLongFormat = FALSE;
- mbShowDateCentury = TRUE;
+ mbLongFormat = sal_False;
+ mbShowDateCentury = sal_True;
mpCalendarWrapper = NULL;
mnDateFormat = 0xFFFF;
mnExtDateFormat = XTDATEF_SYSTEM_SHORT;
@@ -1634,7 +1634,7 @@ DateFormatter::DateFormatter() :
maLastDate( 0 ),
maMin( 1, 1, 1900 ),
maMax( 31, 12, 2200 ),
- mbEnforceValidValue( TRUE )
+ mbEnforceValidValue( sal_True )
{
ImplInit();
}
@@ -1646,7 +1646,7 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( DATEFORMATTER_MIN & nMask )
{
@@ -1659,10 +1659,10 @@ void DateFormatter::ImplLoadRes( const ResId& rResId )
pMgr->Increment( pMgr->GetObjSize( (RSHEADER_TYPE*)pMgr->GetClass() ) );
}
if ( DATEFORMATTER_LONGFORMAT & nMask )
- mbLongFormat = (BOOL)pMgr->ReadShort();
+ mbLongFormat = (sal_Bool)pMgr->ReadShort();
if ( DATEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( DATEFORMATTER_VALUE & nMask )
{
@@ -1718,13 +1718,13 @@ void DateFormatter::SetExtDateFormat( ExtDateFieldFormat eFormat )
// -----------------------------------------------------------------------
-ExtDateFieldFormat DateFormatter::GetExtDateFormat( BOOL bResolveSystemFormat ) const
+ExtDateFieldFormat DateFormatter::GetExtDateFormat( sal_Bool bResolveSystemFormat ) const
{
ExtDateFieldFormat eDateFormat = (ExtDateFieldFormat)mnExtDateFormat;
if ( bResolveSystemFormat && ( eDateFormat <= XTDATEF_SYSTEM_SHORT_YYYY ) )
{
- BOOL bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY);
+ sal_Bool bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY);
switch ( ImplGetLocaleDataWrapper().getDateFormat() )
{
case DMY: eDateFormat = bShowCentury ? XTDATEF_SHORT_DDMMYYYY : XTDATEF_SHORT_DDMMYY;
@@ -1766,7 +1766,7 @@ void DateFormatter::SetMax( const Date& rNewMax )
// -----------------------------------------------------------------------
-void DateFormatter::SetLongFormat( BOOL bLong )
+void DateFormatter::SetLongFormat( sal_Bool bLong )
{
mbLongFormat = bLong;
@@ -1786,7 +1786,7 @@ void DateFormatter::SetLongFormat( BOOL bLong )
// -----------------------------------------------------------------------
-void DateFormatter::SetShowDateCentury( BOOL bShowDateCentury )
+void DateFormatter::SetShowDateCentury( sal_Bool bShowDateCentury )
{
mbShowDateCentury = bShowDateCentury;
@@ -1902,7 +1902,7 @@ Date DateFormatter::GetDate() const
if ( GetField() )
{
- if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
{
if ( aDate > maMax )
aDate = maMax;
@@ -1942,7 +1942,7 @@ Date DateFormatter::GetRealDate() const
if ( GetField() )
{
- if ( !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
if ( ImplAllowMalformedInput() )
aDate = GetInvalidDate();
}
@@ -1959,20 +1959,20 @@ void DateFormatter::SetEmptyDate()
// -----------------------------------------------------------------------
-BOOL DateFormatter::IsEmptyDate() const
+sal_Bool DateFormatter::IsEmptyDate() const
{
- BOOL bEmpty = FormatterBase::IsEmptyFieldValue();
+ sal_Bool bEmpty = FormatterBase::IsEmptyFieldValue();
if ( GetField() && MustBeReformatted() && IsEmptyFieldValueEnabled() )
{
if ( !GetField()->GetText().Len() )
{
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
else if ( !maLastDate.GetDate() )
{
Date aDate;
- bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ bEmpty = !ImplDateGetValue( GetField()->GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
}
return bEmpty;
@@ -1980,14 +1980,14 @@ BOOL DateFormatter::IsEmptyDate() const
// -----------------------------------------------------------------------
-BOOL DateFormatter::IsDateModified() const
+sal_Bool DateFormatter::IsDateModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyDate();
else if ( GetDate() != maFieldDate )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -2001,14 +2001,14 @@ void DateFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
+ sal_Bool bOK = ImplDateReformat( GetField()->GetText(), aStr, GetFieldSettings() );
if( !bOK )
return;
if ( aStr.Len() )
{
ImplSetText( aStr );
- ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+ ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
}
else
{
@@ -2019,7 +2019,7 @@ void DateFormatter::Reformat()
else
{
ImplSetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2033,12 +2033,12 @@ void DateFormatter::ExpandCentury( Date& rDate )
// -----------------------------------------------------------------------
-void DateFormatter::ExpandCentury( Date& rDate, USHORT nTwoDigitYearStart )
+void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart )
{
- USHORT nDateYear = rDate.GetYear();
+ sal_uInt16 nDateYear = rDate.GetYear();
if ( nDateYear < 100 )
{
- USHORT nCentury = nTwoDigitYearStart / 100;
+ sal_uInt16 nCentury = nTwoDigitYearStart / 100;
if ( nDateYear < (nTwoDigitYearStart % 100) )
nCentury++;
rDate.SetYear( nDateYear + (nCentury*100) );
@@ -2089,7 +2089,7 @@ void DateField::ImplLoadRes( const ResId& rResId )
{
DateFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( DATEFIELD_FIRST & nMask )
{
maFirst = Date( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
@@ -2119,7 +2119,7 @@ long DateField::PreNotify( NotifyEvent& rNEvt )
( GetExtDateFormat() != XTDATEF_SYSTEM_LONG ) &&
!rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
{
- if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( TRUE ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( sal_True ), ImplGetLocaleDataWrapper() ) )
return 1;
}
@@ -2131,7 +2131,7 @@ long DateField::PreNotify( NotifyEvent& rNEvt )
long DateField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() )
@@ -2141,7 +2141,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
// !!! allen anderen Feldern anders behandelt wird.
// !!! Siehe dazu Bug: 52304
- BOOL bTextLen = GetText().Len() != 0;
+ sal_Bool bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
{
if ( !ImplAllowMalformedInput() )
@@ -2149,7 +2149,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
else
{
Date aDate( 0, 0, 0 );
- if ( ImplDateGetValue( GetText(), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
+ if ( ImplDateGetValue( GetText(), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() ) )
// even with strict text analysis, our text is a valid date -> do a complete
// reformat
Reformat();
@@ -2158,7 +2158,7 @@ long DateField::Notify( NotifyEvent& rNEvt )
else if ( !bTextLen && IsEmptyFieldValueEnabled() )
{
ResetLastDate();
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2184,7 +2184,7 @@ void DateField::DataChanged( const DataChangedEvent& rDCEvt )
void DateField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -2192,7 +2192,7 @@ void DateField::Modify()
void DateField::Up()
{
- ImplDateSpinArea( TRUE );
+ ImplDateSpinArea( sal_True );
SpinField::Up();
}
@@ -2200,7 +2200,7 @@ void DateField::Up()
void DateField::Down()
{
- ImplDateSpinArea( FALSE );
+ ImplDateSpinArea( sal_False );
SpinField::Down();
}
@@ -2264,7 +2264,7 @@ long DateBox::PreNotify( NotifyEvent& rNEvt )
( GetExtDateFormat() != XTDATEF_SYSTEM_LONG ) &&
!rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() )
{
- if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( TRUE ), ImplGetLocaleDataWrapper() ) )
+ if ( ImplDateProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetExtDateFormat( sal_True ), ImplGetLocaleDataWrapper() ) )
return 1;
}
@@ -2290,18 +2290,18 @@ void DateBox::DataChanged( const DataChangedEvent& rDCEvt )
long DateBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() )
{
- BOOL bTextLen = GetText().Len() != 0;
+ sal_Bool bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
Reformat();
else if ( !bTextLen && IsEmptyFieldValueEnabled() )
{
ResetLastDate();
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
}
}
@@ -2313,7 +2313,7 @@ long DateBox::Notify( NotifyEvent& rNEvt )
void DateBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -2322,21 +2322,21 @@ void DateBox::Modify()
void DateBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplDateReformat( GetEntry( i ), aStr, GetFieldSettings() );
RemoveEntry( i );
InsertEntry( aStr, i );
}
DateFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void DateBox::InsertDate( const Date& rDate, USHORT nPos )
+void DateBox::InsertDate( const Date& rDate, sal_uInt16 nPos )
{
Date aDate = rDate;
if ( aDate > GetMax() )
@@ -2356,20 +2356,20 @@ void DateBox::RemoveDate( const Date& rDate )
// -----------------------------------------------------------------------
-Date DateBox::GetDate( USHORT nPos ) const
+Date DateBox::GetDate( sal_uInt16 nPos ) const
{
Date aDate( 0, 0, 0 );
- ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(TRUE), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
+ ImplDateGetValue( ComboBox::GetEntry( nPos ), aDate, GetExtDateFormat(sal_True), ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetSettings() );
return aDate;
}
// -----------------------------------------------------------------------
-USHORT DateBox::GetDatePos( const Date& rDate ) const
+sal_uInt16 DateBox::GetDatePos( const Date& rDate ) const
{
XubString aStr;
if ( IsLongFormat() )
- aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, FALSE, 1, !IsShowDateCentury() );
+ aStr = ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), 1, sal_False, 1, !IsShowDateCentury() );
else
aStr = ImplGetLocaleDataWrapper().getDate( rDate );
return ComboBox::GetEntryPos( aStr );
@@ -2377,18 +2377,18 @@ USHORT DateBox::GetDatePos( const Date& rDate ) const
// -----------------------------------------------------------------------
-static BOOL ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bDuration,
+static sal_Bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bDuration,
TimeFieldFormat eFormat,
const LocaleDataWrapper& rLocaleDataWrapper )
{
xub_Unicode cChar = rKEvt.GetCharCode();
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
((cChar >= '0') && (cChar <= '9')) ||
@@ -2400,55 +2400,55 @@ static BOOL ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
((eFormat == TIMEF_100TH_SEC) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
((eFormat == TIMEF_SEC_CS) && (cChar == rLocaleDataWrapper.getTime100SecSep())) ||
(bDuration && (cChar == '-')) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplIsOnlyDigits( const String& _rStr )
+static sal_Bool ImplIsOnlyDigits( const String& _rStr )
{
const sal_Unicode* _pChr = _rStr.GetBuffer();
for ( xub_StrLen i = 0; i < _rStr.Len(); ++i, ++_pChr )
{
if ( *_pChr < '0' || *_pChr > '9' )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplIsValidTimePortion( BOOL _bSkipInvalidCharacters, const String& _rStr )
+static sal_Bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const String& _rStr )
{
if ( !_bSkipInvalidCharacters )
{
if ( ( _rStr.Len() > 2 ) || ( _rStr.Len() < 1 ) || !ImplIsOnlyDigits( _rStr ) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, BOOL _bSkipInvalidCharacters, short* _pPortion )
+static sal_Bool ImplCutTimePortion( String& _rStr, xub_StrLen _nSepPos, sal_Bool _bSkipInvalidCharacters, short* _pPortion )
{
String sPortion = _rStr.Copy( 0, _nSepPos );
_rStr.Erase( 0, _nSepPos + 1 );
if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
- return FALSE;
+ return sal_False;
*_pPortion = (short)sPortion.ToInt32();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
- TimeFieldFormat eFormat, BOOL bDuration,
- const LocaleDataWrapper& rLocaleDataWrapper, BOOL _bSkipInvalidCharacters = TRUE )
+static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
+ TimeFieldFormat eFormat, sal_Bool bDuration,
+ const LocaleDataWrapper& rLocaleDataWrapper, sal_Bool _bSkipInvalidCharacters = sal_True )
{
XubString aStr = rStr;
short nHour = 0;
@@ -2458,7 +2458,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
Time aTime( 0, 0, 0 );
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Nach Separatoren suchen
if ( rLocaleDataWrapper.getTimeSep().Len() )
@@ -2480,34 +2480,34 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
}
- BOOL bNegative = FALSE;
+ sal_Bool bNegative = sal_False;
xub_StrLen nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( eFormat != TIMEF_SEC_CS )
{
if ( nSepPos == STRING_NOTFOUND )
nSepPos = aStr.Len();
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nHour ) )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nMinute ) )
- return FALSE;
+ return sal_False;
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) )
- return FALSE;
+ return sal_False;
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
n100Sec = (short)aStr.ToInt32();
}
else
@@ -2531,7 +2531,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
nMinute = nSecond;
@@ -2540,7 +2540,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
nSepPos = aStr.Search( rLocaleDataWrapper.getTimeSep() );
if ( aStr.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( nSepPos != STRING_NOTFOUND )
{
nHour = nMinute;
@@ -2592,7 +2592,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
}
if ( (nMinute > 59) || (nSecond > 59) || (n100Sec > 100) )
- return FALSE;
+ return sal_False;
if ( eFormat == TIMEF_NONE )
nSecond = n100Sec = 0;
@@ -2603,7 +2603,7 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
- return FALSE;
+ return sal_False;
aStr.ToUpperAscii();
XubString aAM( rLocaleDataWrapper.getTimeAM() );
@@ -2619,39 +2619,39 @@ static BOOL ImplTimeGetValue( const XubString& rStr, Time& rTime,
if ( (nHour == 12) && ( ( aStr.Search( aAM ) != STRING_NOTFOUND ) || ( aStr.Search( aAM2 ) != STRING_NOTFOUND ) ) )
nHour = 0;
- aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
- (USHORT)n100Sec );
+ aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
+ (sal_uInt16)n100Sec );
}
else
{
if ( bNegative || (nHour < 0) || (nMinute < 0) ||
(nSecond < 0) || (n100Sec < 0) )
{
- bNegative = TRUE;
+ bNegative = sal_True;
nHour = nHour < 0 ? -nHour : nHour;
nMinute = nMinute < 0 ? -nMinute : nMinute;
nSecond = nSecond < 0 ? -nSecond : nSecond;
n100Sec = n100Sec < 0 ? -n100Sec : n100Sec;
}
- aTime = Time( (USHORT)nHour, (USHORT)nMinute, (USHORT)nSecond,
- (USHORT)n100Sec );
+ aTime = Time( (sal_uInt16)nHour, (sal_uInt16)nMinute, (sal_uInt16)nSecond,
+ (sal_uInt16)n100Sec );
if ( bNegative )
aTime = -aTime;
}
rTime = aTime;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
+sal_Bool TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr )
{
Time aTime( 0, 0, 0 );
if ( !ImplTimeGetValue( rStr, aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
- return TRUE;
+ return sal_True;
Time aTempTime = aTime;
if ( aTempTime > GetMax() )
@@ -2665,22 +2665,22 @@ BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr
if ( !GetErrorHdl().Call( this ) )
{
maCorrectedTime = Time();
- return FALSE;
+ return sal_False;
}
else
maCorrectedTime = Time();
}
- BOOL bSecond = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSecond = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( meFormat != TIMEF_NONE )
- bSecond = TRUE;
+ bSecond = sal_True;
if ( meFormat == TIMEF_100TH_SEC )
- b100Sec = TRUE;
+ b100Sec = sal_True;
if ( meFormat == TIMEF_SEC_CS )
{
- ULONG n = aTempTime.GetHour() * 3600L;
+ sal_uLong n = aTempTime.GetHour() * 3600L;
n += aTempTime.GetMin() * 60L;
n += aTempTime.GetSec();
rOutStr = String::CreateFromInt32( n );
@@ -2710,18 +2710,18 @@ BOOL TimeFormatter::ImplTimeReformat( const XubString& rStr, XubString& rOutStr
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL TimeFormatter::ImplAllowMalformedInput() const
+sal_Bool TimeFormatter::ImplAllowMalformedInput() const
{
return !IsEnforceValidValue();
}
// -----------------------------------------------------------------------
-void TimeField::ImplTimeSpinArea( BOOL bUp )
+void TimeField::ImplTimeSpinArea( sal_Bool bUp )
{
if ( GetField() )
{
@@ -2792,7 +2792,7 @@ void TimeField::ImplTimeSpinArea( BOOL bUp )
void TimeFormatter::ImplInit()
{
meFormat = TIMEF_NONE;
- mbDuration = FALSE;
+ mbDuration = sal_False;
mnTimeFormat = HOUR_24; // Should become a ExtTimeFieldFormat in next implementation, merge with mbDuration and meFormat
}
@@ -2802,7 +2802,7 @@ TimeFormatter::TimeFormatter() :
maLastTime( 0, 0 ),
maMin( 0, 0 ),
maMax( 23, 59, 59, 99 ),
- mbEnforceValidValue( TRUE ),
+ mbEnforceValidValue( sal_True ),
maFieldTime( 0, 0 )
{
ImplInit();
@@ -2815,7 +2815,7 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( TIMEFORMATTER_MIN & nMask )
{
@@ -2833,10 +2833,10 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId )
meFormat = (TimeFieldFormat)pMgr->ReadLong();
if ( TIMEFORMATTER_DURATION & nMask )
- mbDuration = (BOOL)pMgr->ReadShort();
+ mbDuration = (sal_Bool)pMgr->ReadShort();
if ( TIMEFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( TIMEFORMATTER_VALUE & nMask )
{
@@ -2887,7 +2887,7 @@ void TimeFormatter::SetMax( const Time& rNewMax )
void TimeFormatter::SetTimeFormat( TimeFormatter::TimeFormat eNewFormat )
{
- mnTimeFormat = sal::static_int_cast<USHORT>(eNewFormat);
+ mnTimeFormat = sal::static_int_cast<sal_uInt16>(eNewFormat);
}
// -----------------------------------------------------------------------
@@ -2907,7 +2907,7 @@ void TimeFormatter::SetFormat( TimeFieldFormat eNewFormat )
// -----------------------------------------------------------------------
-void TimeFormatter::SetDuration( BOOL bNewDuration )
+void TimeFormatter::SetDuration( sal_Bool bNewDuration )
{
mbDuration = bNewDuration;
ReformatAll();
@@ -2919,7 +2919,7 @@ void TimeFormatter::SetTime( const Time& rNewTime )
{
SetUserTime( rNewTime );
maFieldTime = maLastTime;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -2966,15 +2966,15 @@ void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelect
if ( GetField() )
{
XubString aStr;
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( meFormat != TIMEF_NONE )
- bSec = TRUE;
+ bSec = sal_True;
if ( meFormat == TIMEF_100TH_SEC || meFormat == TIMEF_SEC_CS )
- b100Sec = TRUE;
+ b100Sec = sal_True;
if ( meFormat == TIMEF_SEC_CS )
{
- ULONG n = aNewTime.GetHour() * 3600L;
+ sal_uLong n = aNewTime.GetHour() * 3600L;
n += aNewTime.GetMin() * 60L;
n += aNewTime.GetSec();
aStr = String::CreateFromInt32( n );
@@ -3025,7 +3025,7 @@ Time TimeFormatter::GetTime() const
if ( GetField() )
{
- BOOL bAllowMailformed = ImplAllowMalformedInput();
+ sal_Bool bAllowMailformed = ImplAllowMalformedInput();
if ( ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
{
if ( aTime > GetMax() )
@@ -3053,7 +3053,7 @@ Time TimeFormatter::GetRealTime() const
if ( GetField() )
{
- BOOL bAllowMailformed = ImplAllowMalformedInput();
+ sal_Bool bAllowMailformed = ImplAllowMalformedInput();
if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) )
if ( bAllowMailformed )
aTime = GetInvalidTime();
@@ -3064,14 +3064,14 @@ Time TimeFormatter::GetRealTime() const
// -----------------------------------------------------------------------
-BOOL TimeFormatter::IsTimeModified() const
+sal_Bool TimeFormatter::IsTimeModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyTime();
else if ( GetTime() != maFieldTime )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -3085,7 +3085,7 @@ void TimeFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplTimeReformat( GetField()->GetText(), aStr );
+ sal_Bool bOK = ImplTimeReformat( GetField()->GetText(), aStr );
if ( !bOK )
return;
@@ -3106,7 +3106,7 @@ TimeField::TimeField( Window* pParent, WinBits nWinStyle ) :
maLast( GetMax() )
{
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
Reformat();
}
@@ -3121,7 +3121,7 @@ TimeField::TimeField( Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
SpinField::ImplInit( pParent, nStyle );
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
ImplLoadRes( rResId );
if ( !(nStyle & WB_HIDE ) )
@@ -3138,7 +3138,7 @@ void TimeField::ImplLoadRes( const ResId& rResId )
{
TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( TIMEFIELD_FIRST & nMask )
{
@@ -3179,7 +3179,7 @@ long TimeField::PreNotify( NotifyEvent& rNEvt )
long TimeField::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -3189,7 +3189,7 @@ long TimeField::Notify( NotifyEvent& rNEvt )
else
{
Time aTime( 0, 0, 0 );
- if ( ImplTimeGetValue( GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), FALSE ) )
+ if ( ImplTimeGetValue( GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), sal_False ) )
// even with strict text analysis, our text is a valid time -> do a complete
// reformat
Reformat();
@@ -3218,7 +3218,7 @@ void TimeField::DataChanged( const DataChangedEvent& rDCEvt )
void TimeField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -3226,7 +3226,7 @@ void TimeField::Modify()
void TimeField::Up()
{
- ImplTimeSpinArea( TRUE );
+ ImplTimeSpinArea( sal_True );
SpinField::Up();
}
@@ -3234,7 +3234,7 @@ void TimeField::Up()
void TimeField::Down()
{
- ImplTimeSpinArea( FALSE );
+ ImplTimeSpinArea( sal_False );
SpinField::Down();
}
@@ -3263,40 +3263,40 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
case EXTTIMEF_24H_SHORT:
{
SetTimeFormat( HOUR_24 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_24H_LONG:
{
SetTimeFormat( HOUR_24 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_12H_SHORT:
{
SetTimeFormat( HOUR_12 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_12H_LONG:
{
SetTimeFormat( HOUR_12 );
- SetDuration( FALSE );
+ SetDuration( sal_False );
SetFormat( TIMEF_SEC );
}
break;
case EXTTIMEF_DURATION_SHORT:
{
- SetDuration( TRUE );
+ SetDuration( sal_True );
SetFormat( TIMEF_NONE );
}
break;
case EXTTIMEF_DURATION_LONG:
{
- SetDuration( TRUE );
+ SetDuration( sal_True );
SetFormat( TIMEF_SEC );
}
break;
@@ -3314,7 +3314,7 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) :
ComboBox( pParent, nWinStyle )
{
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
Reformat();
}
@@ -3327,7 +3327,7 @@ TimeBox::TimeBox( Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
ComboBox::ImplInit( pParent, nStyle );
SetField( this );
- SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, FALSE, FALSE ) );
+ SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) );
ComboBox::ImplLoadRes( rResId );
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
@@ -3362,7 +3362,7 @@ long TimeBox::PreNotify( NotifyEvent& rNEvt )
long TimeBox::Notify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == EVENT_GETFOCUS )
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
if ( MustBeReformatted() && (GetText().Len() || !IsEmptyFieldValueEnabled()) )
@@ -3390,7 +3390,7 @@ void TimeBox::DataChanged( const DataChangedEvent& rDCEvt )
void TimeBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -3399,21 +3399,21 @@ void TimeBox::Modify()
void TimeBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplTimeReformat( GetEntry( i ), aStr );
RemoveEntry( i );
InsertEntry( aStr, i );
}
TimeFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
+void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos )
{
Time aTime = rTime;
if ( aTime > GetMax() )
@@ -3421,12 +3421,12 @@ void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
else if ( aTime < GetMin() )
aTime = GetMin();
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos );
}
@@ -3434,18 +3434,18 @@ void TimeBox::InsertTime( const Time& rTime, USHORT nPos )
void TimeBox::RemoveTime( const Time& rTime )
{
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
// -----------------------------------------------------------------------
-Time TimeBox::GetTime( USHORT nPos ) const
+Time TimeBox::GetTime( sal_uInt16 nPos ) const
{
Time aTime( 0, 0, 0 );
ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() );
@@ -3454,14 +3454,14 @@ Time TimeBox::GetTime( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT TimeBox::GetTimePos( const Time& rTime ) const
+sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const
{
- BOOL bSec = FALSE;
- BOOL b100Sec = FALSE;
+ sal_Bool bSec = sal_False;
+ sal_Bool b100Sec = sal_False;
if ( GetFormat() == TIMEF_SEC )
- bSec = TRUE;
+ bSec = sal_True;
if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS )
- bSec = b100Sec = TRUE;
+ bSec = b100Sec = sal_True;
return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
diff --git a/vcl/source/control/fixbrd.cxx b/vcl/source/control/fixbrd.cxx
index 374d15f599f8..4efbbe2deee1 100644
--- a/vcl/source/control/fixbrd.cxx
+++ b/vcl/source/control/fixbrd.cxx
@@ -40,7 +40,7 @@
void FixedBorder::ImplInit( Window* pParent, WinBits nStyle )
{
mnType = FIXEDBORDER_TYPE_DOUBLEOUT;
- mbTransparent = TRUE;
+ mbTransparent = sal_True;
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
@@ -65,18 +65,18 @@ void FixedBorder::ImplInitSettings()
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() && mbTransparent )
{
- SetMouseTransparent( TRUE );
- EnableChildTransparentMode( TRUE );
+ SetMouseTransparent( sal_True );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- SetMouseTransparent( FALSE );
- EnableChildTransparentMode( FALSE );
+ SetMouseTransparent( sal_False );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -115,12 +115,12 @@ FixedBorder::~FixedBorder()
// -----------------------------------------------------------------------
-void FixedBorder::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedBorder::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aRect( rPos, rSize );
- USHORT nBorderStyle = mnType;
+ sal_uInt16 nBorderStyle = mnType;
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
@@ -158,7 +158,7 @@ void FixedBorder::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBorder::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -213,7 +213,7 @@ void FixedBorder::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void FixedBorder::SetTransparent( BOOL bTransparent )
+void FixedBorder::SetTransparent( sal_Bool bTransparent )
{
if ( mbTransparent != bTransparent )
{
@@ -225,7 +225,7 @@ void FixedBorder::SetTransparent( BOOL bTransparent )
// -----------------------------------------------------------------------
-void FixedBorder::SetBorderType( USHORT nType )
+void FixedBorder::SetBorderType( sal_uInt16 nType )
{
if ( mnType != nType )
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index eed47fb59741..1828ded64a14 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -28,13 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/decoview.hxx>
-#include <vcl/event.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/controldata.hxx>
-#include <vcl/window.h>
+#include "vcl/decoview.hxx"
+#include "vcl/event.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/controldata.hxx"
+#include "vcl/window.h"
-#include <tools/rc.h>
+#include "tools/rc.h"
// =======================================================================
@@ -95,7 +95,7 @@ void FixedText::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -122,8 +122,8 @@ const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedText::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void FixedText::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -132,16 +132,16 @@ void FixedText::ImplInitSettings( BOOL bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -183,7 +183,7 @@ FixedText::FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessi
ImplInit( pParent, nStyle );
ImplLoadRes( rResId );
if ( bDisableAccessibleLabelForRelation )
- ImplGetWindowImpl()->mbDisableAccessibleLabelForRelation = TRUE;
+ ImplGetWindowImpl()->mbDisableAccessibleLabelForRelation = sal_True;
if ( !(nStyle & WB_HIDE) )
Show();
@@ -191,9 +191,9 @@ FixedText::FixedText( Window* pParent, const ResId& rResId, bool bDisableAccessi
// -----------------------------------------------------------------------
-USHORT FixedText::ImplGetTextStyle( WinBits nWinStyle )
+sal_uInt16 FixedText::ImplGetTextStyle( WinBits nWinStyle )
{
- USHORT nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
if( ! (nWinStyle & WB_NOMULTILINE) )
nTextStyle |= TEXT_DRAW_MULTILINE;
@@ -224,7 +224,7 @@ USHORT FixedText::ImplGetTextStyle( WinBits nWinStyle )
// -----------------------------------------------------------------------
-void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedText::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize,
bool bFillLayout
) const
@@ -232,7 +232,7 @@ void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
WinBits nWinStyle = GetStyle();
XubString aText( GetText() );
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
Point aPos = rPos;
if ( nWinStyle & WB_EXTRAOFFSET )
@@ -280,9 +280,9 @@ void FixedText::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -297,8 +297,8 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetTextColor( GetTextColor() );
pDev->SetTextFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -344,24 +344,24 @@ void FixedText::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & FIXEDTEXT_VIEW_STYLE) !=
(GetStyle() & FIXEDTEXT_VIEW_STYLE) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
}
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -377,7 +377,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -386,7 +386,7 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth )
{
- USHORT nStyle = ImplGetTextStyle( pControl->GetStyle() );
+ sal_uInt16 nStyle = ImplGetTextStyle( pControl->GetStyle() );
if ( !( pControl->GetStyle() & WB_NOLABEL ) )
nStyle |= TEXT_DRAW_MNEMONIC;
@@ -435,7 +435,7 @@ void FixedLine::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -462,8 +462,8 @@ const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) co
// -----------------------------------------------------------------------
-void FixedLine::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void FixedLine::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -472,16 +472,16 @@ void FixedLine::ImplInitSettings( BOOL bFont,
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -502,7 +502,7 @@ void FixedLine::ImplDraw( bool bLayout )
String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
DecorationView aDecoView( this );
- if ( !aText.Len() || (nWinStyle & WB_VERT) )
+ if ( !aText.Len() )
{
if( !pVector )
{
@@ -518,11 +518,34 @@ void FixedLine::ImplDraw( bool bLayout )
}
}
}
+ else if( (nWinStyle & WB_VERT) )
+ {
+ long nWidth = GetTextWidth( aText );
+ Push( PUSH_FONT );
+ Font aFont( GetFont() );
+ aFont.SetOrientation( 900 );
+ SetFont( aFont );
+ Point aStartPt( aOutSize.Width()/2, aOutSize.Height()-1 );
+ if( (nWinStyle & WB_VCENTER) )
+ aStartPt.Y() -= (aOutSize.Height() - nWidth)/2;
+ Point aTextPt( aStartPt );
+ aTextPt.X() -= GetTextHeight()/2;
+ DrawText( aTextPt, aText, 0, STRING_LEN, pVector, pDisplayText );
+ Pop();
+ if( aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aOutSize.Height()-1 ),
+ Point( aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER ) );
+ if( aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0 )
+ aDecoView.DrawSeparator( Point( aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER ),
+ Point( aStartPt.X(), 0 ) );
+ }
else
{
- USHORT nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
Rectangle aRect( 0, 0, aOutSize.Width(), aOutSize.Height() );
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( (nWinStyle & WB_CENTER) )
+ nStyle |= TEXT_DRAW_CENTER;
if ( !IsEnabled() )
nStyle |= TEXT_DRAW_DISABLE;
@@ -537,6 +560,8 @@ void FixedLine::ImplDraw( bool bLayout )
{
long nTop = aRect.Top() + ((aRect.GetHeight()-1)/2);
aDecoView.DrawSeparator( Point( aRect.Right()+FIXEDLINE_TEXT_BORDER, nTop ), Point( aOutSize.Width()-1, nTop ), false );
+ if( aRect.Left() > FIXEDLINE_TEXT_BORDER )
+ aDecoView.DrawSeparator( Point( 0, nTop ), Point( aRect.Left()-FIXEDLINE_TEXT_BORDER, nTop ), false );
}
}
}
@@ -582,7 +607,7 @@ void FixedLine::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void FixedLine::Draw( OutputDevice*, const Point&, const Size&, ULONG )
+void FixedLine::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
{
}
@@ -618,17 +643,17 @@ void FixedLine::StateChanged( StateChangedType nType )
(nType == STATE_CHANGE_STYLE) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -644,7 +669,7 @@ void FixedLine::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -686,16 +711,16 @@ void FixedBitmap::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -710,7 +735,7 @@ void FixedBitmap::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_FIXEDBITMAP_BITMAP & nObjMask )
{
@@ -749,10 +774,10 @@ FixedBitmap::~FixedBitmap()
// -----------------------------------------------------------------------
-void FixedBitmap::ImplDraw( OutputDevice* pDev, ULONG /* nDrawFlags */,
+void FixedBitmap::ImplDraw( OutputDevice* pDev, sal_uLong /* nDrawFlags */,
const Point& rPos, const Size& rSize )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
@@ -797,7 +822,7 @@ void FixedBitmap::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -876,10 +901,10 @@ void FixedBitmap::SetBitmap( const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-BOOL FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
+sal_Bool FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
{
SetBitmap( rBitmap );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -894,7 +919,7 @@ const Bitmap& FixedBitmap::GetModeBitmap( ) const
void FixedImage::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
Control::ImplInit( pParent, nStyle, NULL );
ImplInitSettings();
}
@@ -915,16 +940,16 @@ void FixedImage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -939,7 +964,7 @@ void FixedImage::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSC_FIXEDIMAGE_IMAGE & nObjMask )
{
@@ -978,10 +1003,10 @@ FixedImage::~FixedImage()
// -----------------------------------------------------------------------
-void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
@@ -1003,10 +1028,10 @@ void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
}
}
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
UserDrawEvent aUDEvt( pDev, Rectangle( rPos, rSize ), 0, nStyle );
UserDraw( aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
// -----------------------------------------------------------------------
@@ -1033,7 +1058,7 @@ void FixedImage::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -1115,10 +1140,10 @@ void FixedImage::SetImage( const Image& rImage )
// -----------------------------------------------------------------------
-BOOL FixedImage::SetModeImage( const Image& rImage )
+sal_Bool FixedImage::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 5b062d6ea8ef..52dd061e317e 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -49,8 +49,8 @@ void GroupBox::ImplInit( Window* pParent, WinBits nStyle )
{
nStyle = ImplInitStyle( nStyle );
Control::ImplInit( pParent, nStyle, NULL );
- SetMouseTransparent( TRUE );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ SetMouseTransparent( sal_True );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
@@ -77,8 +77,8 @@ const Color& GroupBox::GetCanonicalTextColor( const StyleSettings& _rStyle ) con
// -----------------------------------------------------------------------
-void GroupBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void GroupBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -89,16 +89,16 @@ void GroupBox::ImplInitSettings( BOOL bFont,
!(pParent->GetStyle() & WB_CLIPCHILDREN) ) &&
!IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -132,7 +132,7 @@ GroupBox::GroupBox( Window* pParent, const ResId& rResId ) :
// -----------------------------------------------------------------------
-void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout )
{
OSL_TRACE("GroupBox::ImplDraw Y %d, X %d", rPos.Y(), rPos.X() );
@@ -141,7 +141,7 @@ void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
XubString aText( GetText() );
Rectangle aRect( rPos, rSize );
- USHORT nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
if ( GetStyle() & WB_NOLABEL )
nTextStyle &= ~TEXT_DRAW_MNEMONIC;
@@ -241,7 +241,7 @@ void GroupBox::Paint( const Rectangle& )
// -----------------------------------------------------------------------
void GroupBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
- ULONG nFlags )
+ sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -291,17 +291,17 @@ void GroupBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -317,7 +317,7 @@ void GroupBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 0a0d4b8829c2..a288c3656317 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -55,7 +55,7 @@ using namespace ::com::sun::star;
// =======================================================================
-void ImplInitFieldSettings( Window* pWin, BOOL bFont, BOOL bForeground, BOOL bBackground )
+void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -106,7 +106,7 @@ ImplEntryList::ImplEntryList( Window* pWindow )
mnLastSelected = LISTBOX_ENTRY_NOTFOUND;
mnSelectionAnchor = LISTBOX_ENTRY_NOTFOUND;
mnImages = 0;
- mbCallSelectionChangedHdl = TRUE;
+ mbCallSelectionChangedHdl = sal_True;
mnMRUCount = 0;
mnMaxMRUCount = 0;
@@ -124,7 +124,7 @@ ImplEntryList::~ImplEntryList()
void ImplEntryList::Clear()
{
mnImages = 0;
- for ( USHORT n = GetEntryCount(); n; )
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
delete pImplEntry;
@@ -134,7 +134,7 @@ void ImplEntryList::Clear()
// -----------------------------------------------------------------------
-void ImplEntryList::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
ImplEntryType* pImplEntry = GetEntry( nPos );
if ( pImplEntry &&
@@ -172,7 +172,7 @@ namespace vcl
}
}
-USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL bSort )
+sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort )
{
if ( !!pNewEntry->maImage )
mnImages++;
@@ -186,11 +186,11 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
const XubString& rStr = pNewEntry->maStr;
- ULONG nLow, nHigh, nMid;
+ sal_uLong nLow, nHigh, nMid;
nHigh = Count();
- ImplEntryType* pTemp = GetEntry( (USHORT)(nHigh-1) );
+ ImplEntryType* pTemp = GetEntry( (sal_uInt16)(nHigh-1) );
try
{
@@ -206,12 +206,12 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
else
{
nLow = mnMRUCount;
- pTemp = (ImplEntryType*)GetEntry( (USHORT)nLow );
+ pTemp = (ImplEntryType*)GetEntry( (sal_uInt16)nLow );
eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
if ( eComp != COMPARE_GREATER )
{
- Insert( pNewEntry, (ULONG)0 );
+ Insert( pNewEntry, (sal_uLong)0 );
}
else
{
@@ -249,17 +249,17 @@ USHORT ImplEntryList::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry, BOOL b
// garbage you wouldn't insert it. If the exception occurred because the
// Collator implementation is garbage then give the user a chance to see
// his stuff
- Insert( pNewEntry, (ULONG)0 );
+ Insert( pNewEntry, (sal_uLong)0 );
}
}
- return (USHORT)GetPos( pNewEntry );
+ return (sal_uInt16)GetPos( pNewEntry );
}
// -----------------------------------------------------------------------
-void ImplEntryList::RemoveEntry( USHORT nPos )
+void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::Remove( nPos );
if ( pImplEntry )
@@ -273,10 +273,10 @@ void ImplEntryList::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea ) const
+sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchMRUArea ) const
{
- USHORT nEntries = GetEntryCount();
- for ( USHORT n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
+ sal_uInt16 nEntries = GetEntryCount();
+ for ( sal_uInt16 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) );
@@ -288,21 +288,21 @@ USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea )
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindMatchingEntry( const XubString& rStr, USHORT nStart, BOOL bForward, BOOL bLazy ) const
+sal_uInt16 ImplEntryList::FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart, sal_Bool bForward, sal_Bool bLazy ) const
{
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nEntryCount = GetEntryCount();
if ( !bForward )
nStart++; // wird sofort dekrementiert
const vcl::I18nHelper& rI18nHelper = mpWindow->GetSettings().GetLocaleI18nHelper();
- for ( USHORT n = nStart; bForward ? ( n < nEntryCount ) : n; )
+ for ( sal_uInt16 n = nStart; bForward ? ( n < nEntryCount ) : n; )
{
if ( !bForward )
n--;
ImplEntryType* pImplEntry = GetEntry( n );
- BOOL bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
+ sal_Bool bMatch = bLazy ? rI18nHelper.MatchString( rStr, pImplEntry->maStr ) != 0 : ( rStr.Match( pImplEntry->maStr ) == STRING_MATCH );
if ( bMatch )
{
nPos = n;
@@ -318,10 +318,10 @@ USHORT ImplEntryList::FindMatchingEntry( const XubString& rStr, USHORT nStart, B
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindEntry( const void* pData ) const
+sal_uInt16 ImplEntryList::FindEntry( const void* pData ) const
{
- USHORT nPos = LISTBOX_ENTRY_NOTFOUND;
- for ( USHORT n = GetEntryCount(); n; )
+ sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mpUserData == pData )
@@ -335,12 +335,12 @@ USHORT ImplEntryList::FindEntry( const void* pData ) const
// -----------------------------------------------------------------------
-long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, long i_nBeginHeight ) const
+long ImplEntryList::GetAddedHeight( sal_uInt16 i_nEndIndex, sal_uInt16 i_nBeginIndex, long i_nBeginHeight ) const
{
long nHeight = i_nBeginHeight;
- USHORT nStart = i_nEndIndex > i_nBeginIndex ? i_nBeginIndex : i_nEndIndex;
- USHORT nStop = i_nEndIndex > i_nBeginIndex ? i_nEndIndex : i_nBeginIndex;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nStart = i_nEndIndex > i_nBeginIndex ? i_nBeginIndex : i_nEndIndex;
+ sal_uInt16 nStop = i_nEndIndex > i_nBeginIndex ? i_nEndIndex : i_nBeginIndex;
+ sal_uInt16 nEntryCount = GetEntryCount();
if( nStop != LISTBOX_ENTRY_NOTFOUND && nEntryCount != 0 )
{
// sanity check
@@ -349,7 +349,7 @@ long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, lo
if( nStart > nEntryCount-1 )
nStart = nEntryCount-1;
- USHORT nIndex = nStart;
+ sal_uInt16 nIndex = nStart;
while( nIndex != LISTBOX_ENTRY_NOTFOUND && nIndex < nStop )
{
nHeight += GetEntryPtr( nIndex )-> mnHeight;
@@ -363,7 +363,7 @@ long ImplEntryList::GetAddedHeight( USHORT i_nEndIndex, USHORT i_nBeginIndex, lo
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryHeight( USHORT nPos ) const
+long ImplEntryList::GetEntryHeight( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? pImplEntry->mnHeight : 0;
@@ -371,7 +371,7 @@ long ImplEntryList::GetEntryHeight( USHORT nPos ) const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetEntryText( USHORT nPos ) const
+XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
{
XubString aEntryText;
ImplEntryType* pImplEntry = GetEntry( nPos );
@@ -382,9 +382,9 @@ XubString ImplEntryList::GetEntryText( USHORT nPos ) const
// -----------------------------------------------------------------------
-BOOL ImplEntryList::HasEntryImage( USHORT nPos ) const
+sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
{
- BOOL bImage = FALSE;
+ sal_Bool bImage = sal_False;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
bImage = !!pImplEntry->maImage;
@@ -393,7 +393,7 @@ BOOL ImplEntryList::HasEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-Image ImplEntryList::GetEntryImage( USHORT nPos ) const
+Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
{
Image aImage;
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
@@ -404,7 +404,7 @@ Image ImplEntryList::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryData( USHORT nPos, void* pNewData )
+void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -413,7 +413,7 @@ void ImplEntryList::SetEntryData( USHORT nPos, void* pNewData )
// -----------------------------------------------------------------------
-void* ImplEntryList::GetEntryData( USHORT nPos ) const
+void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mpUserData : NULL;
@@ -421,7 +421,7 @@ void* ImplEntryList::GetEntryData( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImplEntryList::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
if ( pImplEntry )
@@ -430,7 +430,7 @@ void ImplEntryList::SetEntryFlags( USHORT nPos, long nFlags )
// -----------------------------------------------------------------------
-long ImplEntryList::GetEntryFlags( USHORT nPos ) const
+long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
return pImplEntry ? pImplEntry->mnFlags : 0;
@@ -438,10 +438,10 @@ long ImplEntryList::GetEntryFlags( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ImplEntryList::GetSelectEntryCount() const
+sal_uInt16 ImplEntryList::GetSelectEntryCount() const
{
- USHORT nSelCount = 0;
- for ( USHORT n = GetEntryCount(); n; )
+ sal_uInt16 nSelCount = 0;
+ for ( sal_uInt16 n = GetEntryCount(); n; )
{
ImplEntryType* pImplEntry = GetEntry( --n );
if ( pImplEntry->mbIsSelected )
@@ -452,20 +452,20 @@ USHORT ImplEntryList::GetSelectEntryCount() const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetSelectEntry( USHORT nIndex ) const
+XubString ImplEntryList::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntryText( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-USHORT ImplEntryList::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ImplEntryList::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
- USHORT nSel = 0;
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nSelEntryPos = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSel = 0;
+ sal_uInt16 nEntryCount = GetEntryCount();
- for ( USHORT n = 0; n < nEntryCount; n++ )
+ for ( sal_uInt16 n = 0; n < nEntryCount; n++ )
{
ImplEntryType* pImplEntry = GetEntry( n );
if ( pImplEntry->mbIsSelected )
@@ -484,22 +484,22 @@ USHORT ImplEntryList::GetSelectEntryPos( USHORT nIndex ) const
// -----------------------------------------------------------------------
-BOOL ImplEntryList::IsEntrySelected( const XubString& rStr ) const
+sal_Bool ImplEntryList::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( FindEntry( rStr ) );
}
// -----------------------------------------------------------------------
-BOOL ImplEntryList::IsEntryPosSelected( USHORT nIndex ) const
+sal_Bool ImplEntryList::IsEntryPosSelected( sal_uInt16 nIndex ) const
{
ImplEntryType* pImplEntry = GetEntry( nIndex );
- return pImplEntry ? pImplEntry->mbIsSelected : FALSE;
+ return pImplEntry ? pImplEntry->mbIsSelected : sal_False;
}
// -----------------------------------------------------------------------
-bool ImplEntryList::IsEntrySelectable( USHORT nPos ) const
+bool ImplEntryList::IsEntrySelectable( sal_uInt16 nPos ) const
{
ImplEntryType* pImplEntry = GetEntry( nPos );
return pImplEntry ? ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0) : true;
@@ -507,7 +507,7 @@ bool ImplEntryList::IsEntrySelectable( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true */ )
+sal_uInt16 ImplEntryList::FindFirstSelectable( sal_uInt16 nPos, bool bForward /* = true */ )
{
if( IsEntrySelectable( nPos ) )
return nPos;
@@ -536,7 +536,8 @@ USHORT ImplEntryList::FindFirstSelectable( USHORT nPos, bool bForward /* = true
// =======================================================================
ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
- Control( pParent, 0 )
+ Control( pParent, 0 ),
+ maQuickSelectionEngine( *this )
{
mpEntryList = new ImplEntryList( this );
@@ -545,26 +546,26 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
mnBorder = 1;
mnSelectModifier = 0;
mnUserDrawEntry = LISTBOX_ENTRY_NOTFOUND;
- mbTrack = FALSE;
- mbImgsDiffSz = FALSE;
- mbTravelSelect = FALSE;
- mbTrackingSelect = FALSE;
- mbSelectionChanged = FALSE;
- mbMouseMoveSelect = FALSE;
- mbMulti = FALSE;
- mbStackMode = FALSE;
- mbGrabFocus = FALSE;
- mbUserDrawEnabled = FALSE;
- mbInUserDraw = FALSE;
- mbReadOnly = FALSE;
- mbHasFocusRect = FALSE;
- mbRight = ( nWinStyle & WB_RIGHT ) ? TRUE : FALSE;
- mbCenter = ( nWinStyle & WB_CENTER ) ? TRUE : FALSE;
- mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ) ? TRUE : FALSE;
- mbSort = ( nWinStyle & WB_SORT ) ? TRUE : FALSE;
+ mbTrack = sal_False;
+ mbImgsDiffSz = sal_False;
+ mbTravelSelect = sal_False;
+ mbTrackingSelect = sal_False;
+ mbSelectionChanged = sal_False;
+ mbMouseMoveSelect = sal_False;
+ mbMulti = sal_False;
+ mbStackMode = sal_False;
+ mbGrabFocus = sal_False;
+ mbUserDrawEnabled = sal_False;
+ mbInUserDraw = sal_False;
+ mbReadOnly = sal_False;
+ mbHasFocusRect = sal_False;
+ mbRight = ( nWinStyle & WB_RIGHT ) ? sal_True : sal_False;
+ mbCenter = ( nWinStyle & WB_CENTER ) ? sal_True : sal_False;
+ mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE ) ? sal_True : sal_False;
+ mbSort = ( nWinStyle & WB_SORT ) ? sal_True : sal_False;
// pb: #106948# explicit mirroring for calc
- mbMirroring = FALSE;
+ mbMirroring = sal_False;
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
@@ -575,10 +576,7 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
SetTextFillColor();
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- maSearchTimeout.SetTimeout( 2500 );
- maSearchTimeout.SetTimeoutHdl( LINK( this, ImplListBoxWindow, SearchStringTimeout ) );
-
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
ImplCalcMetrics();
}
@@ -586,13 +584,12 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
ImplListBoxWindow::~ImplListBoxWindow()
{
- maSearchTimeout.Stop();
delete mpEntryList;
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
+void ImplListBoxWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
{
ImplInitFieldSettings( this, bFont, bForeground, bBackground );
}
@@ -607,16 +604,16 @@ void ImplListBoxWindow::ImplCalcMetrics()
mnMaxImgTxtWidth= 0;
mnMaxImgHeight = 0;
- mnTextHeight = (USHORT)GetTextHeight();
+ mnTextHeight = (sal_uInt16)GetTextHeight();
mnMaxTxtHeight = mnTextHeight + mnBorder;
mnMaxHeight = mnMaxTxtHeight;
if ( maUserItemSize.Height() > mnMaxHeight )
- mnMaxHeight = (USHORT) maUserItemSize.Height();
+ mnMaxHeight = (sal_uInt16) maUserItemSize.Height();
if ( maUserItemSize.Width() > mnMaxWidth )
- mnMaxWidth= (USHORT) maUserItemSize.Width();
+ mnMaxWidth= (sal_uInt16) maUserItemSize.Width();
- for ( USHORT n = mpEntryList->GetEntryCount(); n; )
+ for ( sal_uInt16 n = mpEntryList->GetEntryCount(); n; )
{
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( --n );
ImplUpdateEntryMetrics( *pEntry );
@@ -631,14 +628,6 @@ void ImplListBoxWindow::ImplCalcMetrics()
// -----------------------------------------------------------------------
-IMPL_LINK( ImplListBoxWindow, SearchStringTimeout, Timer*, EMPTYARG )
-{
- maSearchStr.Erase();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
void ImplListBoxWindow::Clear()
{
mpEntryList->Clear();
@@ -651,10 +640,11 @@ void ImplListBoxWindow::Clear()
mnMaxImgHeight = 0;
mnTop = 0;
mnLeft = 0;
- mbImgsDiffSz = FALSE;
+ mbImgsDiffSz = sal_False;
ImplClearLayoutData();
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
+ maQuickSelectionEngine.Reset();
Invalidate();
}
@@ -670,8 +660,8 @@ void ImplListBoxWindow::SetUserItemSize( const Size& rSz )
struct ImplEntryMetrics
{
- BOOL bText;
- BOOL bImage;
+ sal_Bool bText;
+ sal_Bool bImage;
long nEntryWidth;
long nEntryHeight;
long nTextWidth;
@@ -684,7 +674,7 @@ struct ImplEntryMetrics
void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
{
ImplEntryMetrics aMetrics;
- aMetrics.bText = rEntry.maStr.Len() ? TRUE : FALSE;
+ aMetrics.bText = rEntry.maStr.Len() ? sal_True : sal_False;
aMetrics.bImage = !!rEntry.maImage;
aMetrics.nEntryWidth = 0;
aMetrics.nEntryHeight = 0;
@@ -712,7 +702,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
else
{
// normal single line case
- aMetrics.nTextWidth = (USHORT)GetTextWidth( rEntry.maStr );
+ aMetrics.nTextWidth = (sal_uInt16)GetTextWidth( rEntry.maStr );
if( aMetrics.nTextWidth > mnMaxTxtWidth )
mnMaxTxtWidth = aMetrics.nTextWidth;
aMetrics.nEntryWidth = mnMaxTxtWidth;
@@ -722,13 +712,13 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
if ( aMetrics.bImage )
{
Size aImgSz = rEntry.maImage.GetSizePixel();
- aMetrics.nImgWidth = (USHORT) CalcZoom( aImgSz.Width() );
- aMetrics.nImgHeight = (USHORT) CalcZoom( aImgSz.Height() );
+ aMetrics.nImgWidth = (sal_uInt16) CalcZoom( aImgSz.Width() );
+ aMetrics.nImgHeight = (sal_uInt16) CalcZoom( aImgSz.Height() );
if( mnMaxImgWidth && ( aMetrics.nImgWidth != mnMaxImgWidth ) )
- mbImgsDiffSz = TRUE;
+ mbImgsDiffSz = sal_True;
else if ( mnMaxImgHeight && ( aMetrics.nImgHeight != mnMaxImgHeight ) )
- mbImgsDiffSz = TRUE;
+ mbImgsDiffSz = sal_True;
if( aMetrics.nImgWidth > mnMaxImgWidth )
mnMaxImgWidth = aMetrics.nImgWidth;
@@ -770,19 +760,19 @@ void ImplListBoxWindow::ImplCallSelect()
if ( !IsTravelSelect() && GetEntryList()->GetMaxMRUCount() )
{
// Insert the selected entry as MRU, if not allready first MRU
- USHORT nSelected = GetEntryList()->GetSelectEntryPos( 0 );
- USHORT nMRUCount = GetEntryList()->GetMRUCount();
+ sal_uInt16 nSelected = GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nMRUCount = GetEntryList()->GetMRUCount();
String aSelected = GetEntryList()->GetEntryText( nSelected );
- USHORT nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, TRUE );
+ sal_uInt16 nFirstMatchingEntryPos = GetEntryList()->FindEntry( aSelected, sal_True );
if ( nFirstMatchingEntryPos || !nMRUCount )
{
- BOOL bSelectNewEntry = FALSE;
+ sal_Bool bSelectNewEntry = sal_False;
if ( nFirstMatchingEntryPos < nMRUCount )
{
RemoveEntry( nFirstMatchingEntryPos );
nMRUCount--;
if ( nFirstMatchingEntryPos == nSelected )
- bSelectNewEntry = TRUE;
+ bSelectNewEntry = sal_True;
}
else if ( nMRUCount == GetEntryList()->GetMaxMRUCount() )
{
@@ -794,7 +784,7 @@ void ImplListBoxWindow::ImplCallSelect()
ImplEntryType* pNewEntry = new ImplEntryType( aSelected );
pNewEntry->mbIsSelected = bSelectNewEntry;
- GetEntryList()->InsertEntry( 0, pNewEntry, FALSE );
+ GetEntryList()->InsertEntry( 0, pNewEntry, sal_False );
ImplUpdateEntryMetrics( *pNewEntry );
GetEntryList()->SetMRUCount( ++nMRUCount );
SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 );
@@ -803,15 +793,15 @@ void ImplListBoxWindow::ImplCallSelect()
}
maSelectHdl.Call( NULL );
- mbSelectionChanged = FALSE;
+ mbSelectionChanged = sal_False;
}
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
+sal_uInt16 ImplListBoxWindow::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry )
{
ImplClearLayoutData();
- USHORT nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
+ sal_uInt16 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
if( (GetStyle() & WB_WORDBREAK) )
pNewEntry->mnFlags |= LISTBOX_ENTRY_FLAG_MULTILINE;
@@ -822,7 +812,7 @@ USHORT ImplListBoxWindow::InsertEntry( USHORT nPos, ImplEntryType* pNewEntry )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::RemoveEntry( USHORT nPos )
+void ImplListBoxWindow::RemoveEntry( sal_uInt16 nPos )
{
ImplClearLayoutData();
mpEntryList->RemoveEntry( nPos );
@@ -833,7 +823,7 @@ void ImplListBoxWindow::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplListBoxWindow::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
mpEntryList->SetEntryFlags( nPos, nFlags );
ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( nPos );
@@ -848,7 +838,7 @@ void ImplListBoxWindow::ImplShowFocusRect()
if ( mbHasFocusRect )
HideFocus();
ShowFocus( maFocusRect );
- mbHasFocusRect = TRUE;
+ mbHasFocusRect = sal_True;
}
// -----------------------------------------------------------------------
@@ -858,18 +848,18 @@ void ImplListBoxWindow::ImplHideFocusRect()
if ( mbHasFocusRect )
{
HideFocus();
- mbHasFocusRect = FALSE;
+ mbHasFocusRect = sal_False;
}
}
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
+sal_uInt16 ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
{
long nY = mnBorder;
- USHORT nSelect = mnTop;
+ sal_uInt16 nSelect = mnTop;
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nSelect );
while( pEntry && rPoint.Y() > pEntry->mnHeight + nY )
{
@@ -884,16 +874,16 @@ USHORT ImplListBoxWindow::GetEntryPosForPoint( const Point& rPoint ) const
// -----------------------------------------------------------------------
-BOOL ImplListBoxWindow::IsVisible( USHORT i_nEntry ) const
+sal_Bool ImplListBoxWindow::IsVisible( sal_uInt16 i_nEntry ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( i_nEntry >= mnTop )
{
if( mpEntryList->GetAddedHeight( i_nEntry, mnTop ) <
PixelToLogic( GetSizePixel() ).Height() )
{
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -902,11 +892,11 @@ BOOL ImplListBoxWindow::IsVisible( USHORT i_nEntry ) const
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetLastVisibleEntry() const
+sal_uInt16 ImplListBoxWindow::GetLastVisibleEntry() const
{
- USHORT nPos = mnTop;
+ sal_uInt16 nPos = mnTop;
long nWindowHeight = GetSizePixel().Height();
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
long nDiff;
for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) )
nPos++;
@@ -924,14 +914,14 @@ USHORT ImplListBoxWindow::GetLastVisibleEntry() const
void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbMouseMoveSelect = FALSE; // Nur bis zum ersten MouseButtonDown
- maSearchStr.Erase();
+ mbMouseMoveSelect = sal_False; // Nur bis zum ersten MouseButtonDown
+ maQuickSelectionEngine.Reset();
if ( !IsReadOnly() )
{
if( rMEvt.GetClicks() == 1 )
{
- USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
@@ -940,9 +930,9 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt )
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
mnCurrentPos = nSelect;
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
if ( mbGrabFocus )
GrabFocus();
@@ -975,10 +965,10 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
SetTopEntry( 0 );
if ( mbStackMode ) // #87072#, #92323#
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -992,28 +982,28 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt )
{
if ( IsMouseMoveSelect() )
{
- USHORT nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
+ sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() );
if( nSelect == LISTBOX_ENTRY_NOTFOUND )
nSelect = mpEntryList->GetEntryCount() - 1;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
// Select only visible Entries with MouseMove, otherwise Tracking...
if ( IsVisible( nSelect ) &&
mpEntryList->IsEntrySelectable( nSelect ) &&
( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() || ( nSelect != GetEntryList()->GetSelectEntryPos( 0 ) ) ) )
{
- mbTrackingSelect = TRUE;
- if ( SelectEntries( nSelect, LET_TRACKING, FALSE, FALSE ) )
+ mbTrackingSelect = sal_True;
+ if ( SelectEntries( nSelect, LET_TRACKING, sal_False, sal_False ) )
{
if ( mbStackMode ) // #87072#
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rMEvt.GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
}
@@ -1041,14 +1031,14 @@ void ImplListBoxWindow::DeselectAll()
{
while ( GetEntryList()->GetSelectEntryCount() )
{
- USHORT nS = GetEntryList()->GetSelectEntryPos( 0 );
- SelectEntry( nS, FALSE );
+ sal_uInt16 nS = GetEntryList()->GetSelectEntryPos( 0 );
+ SelectEntry( nS, sal_False );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
if( (mpEntryList->IsEntryPosSelected( nPos ) != bSelect) && mpEntryList->IsEntrySelectable( nPos ) )
{
@@ -1058,16 +1048,16 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
if( !mbMulti )
{
// Selektierten Eintrag deselektieren
- USHORT nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nDeselect = GetEntryList()->GetSelectEntryPos( 0 );
if( nDeselect != LISTBOX_ENTRY_NOTFOUND )
{
- //SelectEntryPos( nDeselect, FALSE );
- GetEntryList()->SelectEntry( nDeselect, FALSE );
+ //SelectEntryPos( nDeselect, sal_False );
+ GetEntryList()->SelectEntry( nDeselect, sal_False );
if ( IsUpdateMode() && IsReallyVisible() )
- ImplPaint( nDeselect, TRUE );
+ ImplPaint( nDeselect, sal_True );
}
}
- mpEntryList->SelectEntry( nPos, TRUE );
+ mpEntryList->SelectEntry( nPos, sal_True );
mnCurrentPos = nPos;
if ( ( nPos != LISTBOX_ENTRY_NOTFOUND ) && IsUpdateMode() )
{
@@ -1075,7 +1065,7 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
if ( !IsVisible( nPos ) )
{
ImplClearLayoutData();
- USHORT nVisibleEntries = GetLastVisibleEntry()-mnTop;
+ sal_uInt16 nVisibleEntries = GetLastVisibleEntry()-mnTop;
if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
Resize();
@@ -1090,46 +1080,46 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
}
else
{
- mpEntryList->SelectEntry( nPos, FALSE );
- ImplPaint( nPos, TRUE );
+ mpEntryList->SelectEntry( nPos, sal_False );
+ ImplPaint( nPos, sal_True );
}
- mbSelectionChanged = TRUE;
+ mbSelectionChanged = sal_True;
}
}
// -----------------------------------------------------------------------
-BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL bShift, BOOL bCtrl )
+sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl )
{
- BOOL bFocusChanged = FALSE;
- BOOL bSelectionChanged = FALSE;
+ sal_Bool bFocusChanged = sal_False;
+ sal_Bool bSelectionChanged = sal_False;
if( IsEnabled() && mpEntryList->IsEntrySelectable( nSelect ) )
{
// Hier (Single-ListBox) kann nur ein Eintrag deselektiert werden
if( !mbMulti )
{
- USHORT nDeselect = mpEntryList->GetSelectEntryPos( 0 );
+ sal_uInt16 nDeselect = mpEntryList->GetSelectEntryPos( 0 );
if( nSelect != nDeselect )
{
- SelectEntry( nSelect, TRUE );
+ SelectEntry( nSelect, sal_True );
mpEntryList->SetLastSelected( nSelect );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
}
// MultiListBox ohne Modifier
else if( mbSimpleMode && !bCtrl && !bShift )
{
- USHORT nEntryCount = mpEntryList->GetEntryCount();
- for ( USHORT nPos = 0; nPos < nEntryCount; nPos++ )
+ sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
+ for ( sal_uInt16 nPos = 0; nPos < nEntryCount; nPos++ )
{
- BOOL bSelect = nPos == nSelect;
+ sal_Bool bSelect = nPos == nSelect;
if ( mpEntryList->IsEntryPosSelected( nPos ) != bSelect )
{
SelectEntry( nPos, bSelect );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
}
mpEntryList->SetLastSelected( nSelect );
@@ -1141,20 +1131,20 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
// Space fuer Selektionswechsel
if( !bShift && ( ( eLET == LET_KEYSPACE ) || ( eLET == LET_MBDOWN ) ) )
{
- BOOL bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? TRUE : !mpEntryList->IsEntryPosSelected( nSelect );
+ sal_Bool bSelect = ( mbStackMode && IsMouseMoveSelect() ) ? sal_True : !mpEntryList->IsEntryPosSelected( nSelect );
if ( mbStackMode )
{
- USHORT n;
+ sal_uInt16 n;
if ( bSelect )
{
// All entries before nSelect must be selected...
for ( n = 0; n < nSelect; n++ )
- SelectEntry( n, TRUE );
+ SelectEntry( n, sal_True );
}
if ( !bSelect )
{
for ( n = nSelect+1; n < mpEntryList->GetEntryCount(); n++ )
- SelectEntry( n, FALSE );
+ SelectEntry( n, sal_False );
}
}
SelectEntry( nSelect, bSelect );
@@ -1162,16 +1152,16 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
mpEntryList->SetSelectionAnchor( mbStackMode ? 0 : nSelect );
if ( !mpEntryList->IsEntryPosSelected( nSelect ) )
mpEntryList->SetSelectionAnchor( LISTBOX_ENTRY_NOTFOUND );
- bFocusChanged = TRUE;
- bSelectionChanged = TRUE;
+ bFocusChanged = sal_True;
+ bSelectionChanged = sal_True;
}
else if( ( ( eLET == LET_TRACKING ) && ( nSelect != mnCurrentPos ) ) ||
( (bShift||mbStackMode) && ( ( eLET == LET_KEYMOVE ) || ( eLET == LET_MBDOWN ) ) ) )
{
mnCurrentPos = nSelect;
- bFocusChanged = TRUE;
+ bFocusChanged = sal_True;
- USHORT nAnchor = mpEntryList->GetSelectionAnchor();
+ sal_uInt16 nAnchor = mpEntryList->GetSelectionAnchor();
if( ( nAnchor == LISTBOX_ENTRY_NOTFOUND ) && ( mpEntryList->GetSelectEntryCount() || mbStackMode ) )
{
nAnchor = mbStackMode ? 0 : mpEntryList->GetSelectEntryPos( mpEntryList->GetSelectEntryCount() - 1 );
@@ -1179,40 +1169,40 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
if( nAnchor != LISTBOX_ENTRY_NOTFOUND )
{
// Alle Eintraege vom Anchor bis nSelect muessen selektiert sein
- USHORT nStart = Min( nSelect, nAnchor );
- USHORT nEnd = Max( nSelect, nAnchor );
- for ( USHORT n = nStart; n <= nEnd; n++ )
+ sal_uInt16 nStart = Min( nSelect, nAnchor );
+ sal_uInt16 nEnd = Max( nSelect, nAnchor );
+ for ( sal_uInt16 n = nStart; n <= nEnd; n++ )
{
if ( !mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, TRUE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_True );
+ bSelectionChanged = sal_True;
}
}
// Ggf. muss noch was deselektiert werden...
- USHORT nLast = mpEntryList->GetLastSelected();
+ sal_uInt16 nLast = mpEntryList->GetLastSelected();
if ( nLast != LISTBOX_ENTRY_NOTFOUND )
{
if ( ( nLast > nSelect ) && ( nLast > nAnchor ) )
{
- for ( USHORT n = nSelect+1; n <= nLast; n++ )
+ for ( sal_uInt16 n = nSelect+1; n <= nLast; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_False );
+ bSelectionChanged = sal_True;
}
}
}
else if ( ( nLast < nSelect ) && ( nLast < nAnchor ) )
{
- for ( USHORT n = nLast; n < nSelect; n++ )
+ for ( sal_uInt16 n = nLast; n < nSelect; n++ )
{
if ( mpEntryList->IsEntryPosSelected( n ) )
{
- SelectEntry( n, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( n, sal_False );
+ bSelectionChanged = sal_True;
}
}
}
@@ -1223,17 +1213,17 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
else if( eLET != LET_TRACKING )
{
ImplHideFocusRect();
- ImplPaint( nSelect, TRUE );
- bFocusChanged = TRUE;
+ ImplPaint( nSelect, sal_True );
+ bFocusChanged = sal_True;
}
}
else if( bShift )
{
- bFocusChanged = TRUE;
+ bFocusChanged = sal_True;
}
if( bSelectionChanged )
- mbSelectionChanged = TRUE;
+ mbSelectionChanged = sal_True;
if( bFocusChanged )
{
@@ -1256,7 +1246,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
Point aPoint;
Rectangle aRect( aPoint, GetOutputSizePixel() );
- BOOL bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
+ sal_Bool bInside = aRect.IsInside( rTEvt.GetMouseEvent().GetPosPixel() );
if( rTEvt.IsTrackingCanceled() || rTEvt.IsTrackingEnded() ) // MouseButtonUp
{
@@ -1270,9 +1260,9 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
maCancelHdl.Call( NULL );
if ( !mbMulti )
{
- mbTrackingSelect = TRUE;
- SelectEntry( mnTrackingSaveSelection, TRUE );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_True;
+ SelectEntry( mnTrackingSaveSelection, sal_True );
+ mbTrackingSelect = sal_False;
if ( mnTrackingSaveSelection != LISTBOX_ENTRY_NOTFOUND )
{
long nHeightDiff = mpEntryList->GetAddedHeight( mnCurrentPos, mnTop, 0 );
@@ -1285,23 +1275,23 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
}
}
- mbTrack = FALSE;
+ mbTrack = sal_False;
}
else
{
- BOOL bTrackOrQuickClick = mbTrack;
+ sal_Bool bTrackOrQuickClick = mbTrack;
if( !mbTrack )
{
if ( bInside )
{
- mbTrack = TRUE;
+ mbTrack = sal_True;
}
// Folgender Fall tritt nur auf, wenn man ganz kurz die Maustaste drueckt
if( rTEvt.IsTrackingEnded() && mbTrack )
{
- bTrackOrQuickClick = TRUE;
- mbTrack = FALSE;
+ bTrackOrQuickClick = sal_True;
+ mbTrack = sal_False;
}
}
@@ -1309,10 +1299,10 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
MouseEvent aMEvt = rTEvt.GetMouseEvent();
Point aPt( aMEvt.GetPosPixel() );
- BOOL bShift = aMEvt.IsShift();
- BOOL bCtrl = aMEvt.IsMod1();
+ sal_Bool bShift = aMEvt.IsShift();
+ sal_Bool bCtrl = aMEvt.IsMod1();
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
if( aPt.Y() < 0 )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
@@ -1326,43 +1316,43 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND )
{
- nSelect = Min( (USHORT)(mnCurrentPos+1), (USHORT)(mpEntryList->GetEntryCount()-1) );
+ nSelect = Min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) );
if( nSelect >= GetLastVisibleEntry() )
SetTopEntry( mnTop+1 );
}
}
else
{
- nSelect = (USHORT) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (USHORT) mnTop;
+ nSelect = (sal_uInt16) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (sal_uInt16) mnTop;
nSelect = Min( nSelect, GetLastVisibleEntry() );
- nSelect = Min( nSelect, (USHORT) ( mpEntryList->GetEntryCount() - 1 ) );
+ nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) );
}
if ( bInside )
{
if ( ( nSelect != mnCurrentPos ) || !GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
if ( SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl ) )
{
if ( mbStackMode ) // #87734# (#87072#)
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
}
else
{
if ( !mbMulti && GetEntryList()->GetSelectEntryCount() )
{
- mbTrackingSelect = TRUE;
- SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), FALSE );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_True;
+ SelectEntry( GetEntryList()->GetSelectEntryPos( 0 ), sal_False );
+ mbTrackingSelect = sal_False;
}
else if ( mbStackMode )
{
@@ -1370,32 +1360,32 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 ) || ( rTEvt.GetMouseEvent().GetPosPixel().Y() > GetOutputSizePixel().Height() ) )
{
- BOOL bSelectionChanged = FALSE;
+ sal_Bool bSelectionChanged = sal_False;
if ( ( rTEvt.GetMouseEvent().GetPosPixel().Y() < 0 )
&& !mnCurrentPos )
{
if ( mpEntryList->IsEntryPosSelected( 0 ) )
{
- SelectEntry( 0, FALSE );
- bSelectionChanged = TRUE;
+ SelectEntry( 0, sal_False );
+ bSelectionChanged = sal_True;
nSelect = LISTBOX_ENTRY_NOTFOUND;
}
}
else
{
- mbTrackingSelect = TRUE;
+ mbTrackingSelect = sal_True;
bSelectionChanged = SelectEntries( nSelect, LET_TRACKING, bShift, bCtrl );
- mbTrackingSelect = FALSE;
+ mbTrackingSelect = sal_False;
}
if ( bSelectionChanged )
{
- mbSelectionChanged = TRUE;
- mbTravelSelect = TRUE;
+ mbSelectionChanged = sal_True;
+ mbTravelSelect = sal_True;
mnSelectModifier = rTEvt.GetMouseEvent().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
}
@@ -1433,18 +1423,18 @@ void ImplListBoxWindow::KeyInput( const KeyEvent& rKEvt )
#define IMPL_SELECT_UP 1
#define IMPL_SELECT_DOWN 2
-BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
+sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
// zu selektierender Eintrag
- USHORT nSelect = LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nSelect = LISTBOX_ENTRY_NOTFOUND;
LB_EVENT_TYPE eLET = LET_KEYMOVE;
KeyCode aKeyCode = rKEvt.GetKeyCode();
- BOOL bShift = aKeyCode.IsShift();
- BOOL bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
- BOOL bMod2 = aKeyCode.IsMod2();
- BOOL bDone = FALSE;
+ sal_Bool bShift = aKeyCode.IsShift();
+ sal_Bool bCtrl = aKeyCode.IsMod1() || aKeyCode.IsMod3();
+ sal_Bool bMod2 = aKeyCode.IsMod2();
+ sal_Bool bDone = sal_False;
switch( aKeyCode.GetCode() )
{
@@ -1470,9 +1460,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect < mnTop ) )
SetTopEntry( mnTop-1 );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1497,9 +1487,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( ( nSelect != LISTBOX_ENTRY_NOTFOUND ) && ( nSelect >= GetLastVisibleEntry() ) )
SetTopEntry( mnTop+1 );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1507,7 +1497,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if ( IsReadOnly() )
{
- USHORT nCurVis = GetLastVisibleEntry() - mnTop +1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
SetTopEntry( ( mnTop > nCurVis ) ?
(mnTop-nCurVis) : 0 );
}
@@ -1521,16 +1511,16 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
if( mnCurrentPos == mnTop )
{
- USHORT nCurVis = GetLastVisibleEntry() - mnTop +1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop +1;
SetTopEntry( ( mnTop > nCurVis ) ? ( mnTop-nCurVis+1 ) : 0 );
}
// find first selectable starting from mnTop looking foreward
nSelect = mpEntryList->FindFirstSelectable( mnTop, true );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1548,23 +1538,23 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- USHORT nCount = mpEntryList->GetEntryCount();
- USHORT nCurVis = GetLastVisibleEntry() - mnTop;
- USHORT nTmp = Min( nCurVis, nCount );
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop;
+ sal_uInt16 nTmp = Min( nCurVis, nCount );
nTmp += mnTop - 1;
if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 )
{
long nTmp2 = Min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) );
nTmp2 = Max( (long)0 , nTmp2 );
- nTmp = (USHORT)(nTmp2+(nCurVis-1) );
- SetTopEntry( (USHORT)nTmp2 );
+ nTmp = (sal_uInt16)(nTmp2+(nCurVis-1) );
+ SetTopEntry( (sal_uInt16)nTmp2 );
}
// find first selectable starting from nTmp looking backwards
nSelect = mpEntryList->FindFirstSelectable( nTmp, false );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1582,10 +1572,10 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( mnTop != 0 )
SetTopEntry( 0 );
- bDone = TRUE;
+ bDone = sal_True;
}
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1603,15 +1593,15 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() )
{
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
nSelect = mpEntryList->FindFirstSelectable( nCount - 1, false );
- USHORT nCurVis = GetLastVisibleEntry() - mnTop + 1;
+ sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop + 1;
if( nCount > nCurVis )
SetTopEntry( nCount - nCurVis );
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1620,9 +1610,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( -HORZ_SCROLL );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1631,9 +1621,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( !bCtrl && !bMod2 )
{
ScrollHorz( HORZ_SCROLL );
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1643,9 +1633,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
{
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- bDone = FALSE; // RETURN nicht abfangen.
+ bDone = sal_False; // RETURN nicht abfangen.
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1658,9 +1648,9 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
nSelect = mnCurrentPos;
eLET = LET_KEYSPACE;
}
- bDone = TRUE;
+ bDone = sal_True;
}
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
}
break;
@@ -1669,63 +1659,32 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if( bCtrl && mbMulti )
{
// paint only once
- BOOL bUpdates = IsUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bUpdates = IsUpdateMode();
+ SetUpdateMode( sal_False );
- USHORT nEntryCount = mpEntryList->GetEntryCount();
- for( USHORT i = 0; i < nEntryCount; i++ )
- SelectEntry( i, TRUE );
+ sal_uInt16 nEntryCount = mpEntryList->GetEntryCount();
+ for( sal_uInt16 i = 0; i < nEntryCount; i++ )
+ SelectEntry( i, sal_True );
// restore update mode
SetUpdateMode( bUpdates );
Invalidate();
- maSearchStr.Erase();
+ maQuickSelectionEngine.Reset();
- bDone = TRUE;
+ bDone = sal_True;
break;
}
}
// fall through intentional
default:
{
- xub_Unicode c = rKEvt.GetCharCode();
-
- if ( !IsReadOnly() && (c >= 32) && (c != 127) && !rKEvt.GetKeyCode().IsMod2() )
+ if ( !IsReadOnly() )
{
- maSearchStr += c;
- XubString aTmpSearch( maSearchStr );
-
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos );
- if ( (nSelect == LISTBOX_ENTRY_NOTFOUND) && (aTmpSearch.Len() > 1) )
- {
- // Wenn alles die gleichen Buchstaben, dann anderer Such-Modus
- BOOL bAllEqual = TRUE;
- for ( USHORT n = aTmpSearch.Len(); n && bAllEqual; )
- bAllEqual = aTmpSearch.GetChar( --n ) == c;
- if ( bAllEqual )
- {
- aTmpSearch = c;
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, mnCurrentPos+1 );
- }
- }
- if ( nSelect == LISTBOX_ENTRY_NOTFOUND )
- nSelect = mpEntryList->FindMatchingEntry( aTmpSearch, 0 );
-
- if ( nSelect != LISTBOX_ENTRY_NOTFOUND )
- {
- ShowProminentEntry( nSelect );
-
- if ( mpEntryList->IsEntryPosSelected( nSelect ) )
- nSelect = LISTBOX_ENTRY_NOTFOUND;
-
- maSearchTimeout.Start();
- }
- else
- maSearchStr.Erase();
- bDone = TRUE;
+ bDone = maQuickSelectionEngine.HandleKeyEvent( rKEvt );
}
- }
+ }
+ break;
}
if ( ( nSelect != LISTBOX_ENTRY_NOTFOUND )
@@ -1740,10 +1699,10 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
mnCurrentPos = nSelect;
if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) )
{
- mbTravelSelect = TRUE;
+ mbTravelSelect = sal_True;
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
- mbTravelSelect = FALSE;
+ mbTravelSelect = sal_False;
}
}
@@ -1751,8 +1710,74 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
}
// -----------------------------------------------------------------------
+namespace
+{
+ static ::vcl::StringEntryIdentifier lcl_getEntry( const ImplEntryList& _rList, sal_uInt16 _nPos, String& _out_entryText )
+ {
+ OSL_PRECOND( ( _nPos != LISTBOX_ENTRY_NOTFOUND ), "lcl_getEntry: invalid position!" );
+ sal_uInt16 nEntryCount( _rList.GetEntryCount() );
+ if ( _nPos >= nEntryCount )
+ _nPos = 0;
+ _out_entryText = _rList.GetEntryText( _nPos );
-void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
+ // ::vcl::StringEntryIdentifier does not allow for 0 values, but our position is 0-based
+ // => normalize
+ return reinterpret_cast< ::vcl::StringEntryIdentifier >( _nPos + 1 );
+ }
+
+ static sal_uInt16 lcl_getEntryPos( ::vcl::StringEntryIdentifier _entry )
+ {
+ // our pos is 0-based, but StringEntryIdentifier does not allow for a NULL
+ return static_cast< sal_uInt16 >( reinterpret_cast< sal_Int64 >( _entry ) ) - 1;
+ }
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::CurrentEntry( String& _out_entryText ) const
+{
+ return lcl_getEntry( *GetEntryList(), ( mnCurrentPos == LISTBOX_ENTRY_NOTFOUND ) ? 0 : mnCurrentPos + 1, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+::vcl::StringEntryIdentifier ImplListBoxWindow::NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const
+{
+ sal_uInt16 nNextPos = lcl_getEntryPos( _currentEntry ) + 1;
+ return lcl_getEntry( *GetEntryList(), nNextPos, _out_entryText );
+}
+
+// -----------------------------------------------------------------------
+void ImplListBoxWindow::SelectEntry( ::vcl::StringEntryIdentifier _entry )
+{
+ sal_uInt16 nSelect = lcl_getEntryPos( _entry );
+ if ( mpEntryList->IsEntryPosSelected( nSelect ) )
+ {
+ // ignore that. This method is a callback from the QuickSelectionEngine, which means the user attempted
+ // to select the given entry by typing its starting letters. No need to act.
+ return;
+ }
+
+ // normalize
+ OSL_ENSURE( nSelect < mpEntryList->GetEntryCount(), "ImplListBoxWindow::SelectEntry: how that?" );
+ if( nSelect >= mpEntryList->GetEntryCount() )
+ nSelect = mpEntryList->GetEntryCount()-1;
+
+ // make visible
+ ShowProminentEntry( nSelect );
+
+ // actually select
+ mnCurrentPos = nSelect;
+ if ( SelectEntries( nSelect, LET_KEYMOVE, sal_False, sal_False ) )
+ {
+ mbTravelSelect = sal_True;
+ mnSelectModifier = 0;
+ ImplCallSelect();
+ mbTravelSelect = sal_False;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ImplListBoxWindow::ImplPaint( sal_uInt16 nPos, sal_Bool bErase, bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1775,7 +1800,7 @@ void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
}
else
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
if( !IsEnabled() )
SetTextColor( rStyleSettings.GetDisableColor() );
SetTextFillColor();
@@ -1786,25 +1811,25 @@ void ImplListBoxWindow::ImplPaint( USHORT nPos, BOOL bErase, bool bLayout )
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
mnUserDrawEntry = nPos;
aRect.Left() -= mnLeft;
if ( nPos < GetEntryList()->GetMRUCount() )
nPos = GetEntryList()->FindEntry( GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - GetEntryList()->GetMRUCount());
UserDrawEvent aUDEvt( this, aRect, nPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
else
{
- DrawEntry( nPos, TRUE, TRUE, FALSE, bLayout );
+ DrawEntry( nPos, sal_True, sal_True, sal_False, bLayout );
}
}
// -----------------------------------------------------------------------
-void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
+void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nPos );
if( ! pEntry )
@@ -1878,7 +1903,7 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
aTextRect.Left() -= ( aImgSz.Width() + IMG_TXT_DISTANCE );
}
- USHORT nDrawStyle = ImplGetTextStyle();
+ sal_uInt16 nDrawStyle = ImplGetTextStyle();
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) )
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_DRAW_DISABLED) )
@@ -1919,22 +1944,22 @@ void ImplListBoxWindow::FillLayoutData() const
void ImplListBoxWindow::ImplDoPaint( const Rectangle& rRect, bool bLayout )
{
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
- BOOL bShowFocusRect = mbHasFocusRect;
+ sal_Bool bShowFocusRect = mbHasFocusRect;
if ( mbHasFocusRect && ! bLayout )
ImplHideFocusRect();
long nY = 0; // + mnBorder;
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- for( USHORT i = (USHORT)mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++ )
+ for( sal_uInt16 i = (sal_uInt16)mnTop; i < nCount && nY < nHeight + mnMaxHeight; i++ )
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( i );
if( nY + pEntry->mnHeight >= rRect.Top() &&
nY <= rRect.Bottom() + mnMaxHeight )
{
- ImplPaint( i, FALSE, bLayout );
+ ImplPaint( i, sal_False, bLayout );
}
nY += pEntry->mnHeight;
}
@@ -1956,13 +1981,13 @@ void ImplListBoxWindow::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::GetDisplayLineCount() const
+sal_uInt16 ImplListBoxWindow::GetDisplayLineCount() const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
- USHORT nCount = mpEntryList->GetEntryCount();
+ sal_uInt16 nCount = mpEntryList->GetEntryCount();
long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder;
- USHORT nEntries = static_cast< USHORT >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
+ sal_uInt16 nEntries = static_cast< sal_uInt16 >( ( nHeight + mnMaxHeight - 1 ) / mnMaxHeight );
if( nEntries > nCount-mnTop )
nEntries = nCount-mnTop;
@@ -1975,7 +2000,7 @@ void ImplListBoxWindow::Resize()
{
Control::Resize();
- BOOL bShowFocusRect = mbHasFocusRect;
+ sal_Bool bShowFocusRect = mbHasFocusRect;
if ( bShowFocusRect )
ImplHideFocusRect();
@@ -1995,7 +2020,7 @@ void ImplListBoxWindow::Resize()
void ImplListBoxWindow::GetFocus()
{
- USHORT nPos = mnCurrentPos;
+ sal_uInt16 nPos = mnCurrentPos;
if ( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
long nHeightDiff = mpEntryList->GetAddedHeight( nPos, mnTop, 0 );
@@ -2028,14 +2053,14 @@ void ImplListBoxWindow::RequestHelp( const HelpEvent& rHEvt )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::SetTopEntry( USHORT nTop )
+void ImplListBoxWindow::SetTopEntry( sal_uInt16 nTop )
{
if( mpEntryList->GetEntryCount() == 0 )
return;
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
- USHORT nLastEntry = mpEntryList->GetEntryCount()-1;
+ sal_uInt16 nLastEntry = mpEntryList->GetEntryCount()-1;
if( nTop > nLastEntry )
nTop = nLastEntry;
const ImplEntryType* pLast = mpEntryList->GetEntryPtr( nLastEntry );
@@ -2061,11 +2086,11 @@ void ImplListBoxWindow::SetTopEntry( USHORT nTop )
// -----------------------------------------------------------------------
-void ImplListBoxWindow::ShowProminentEntry( USHORT nEntryPos )
+void ImplListBoxWindow::ShowProminentEntry( sal_uInt16 nEntryPos )
{
if( meProminentType == PROMINENT_MIDDLE )
{
- USHORT nPos = nEntryPos;
+ sal_uInt16 nPos = nEntryPos;
long nWHeight = PixelToLogic( GetSizePixel() ).Height();
while( nEntryPos > 0 && mpEntryList->GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 )
nEntryPos--;
@@ -2103,7 +2128,7 @@ void ImplListBoxWindow::ScrollHorz( long n )
if ( nDiff )
{
ImplClearLayoutData();
- mnLeft = sal::static_int_cast<USHORT>(mnLeft + nDiff);
+ mnLeft = sal::static_int_cast<sal_uInt16>(mnLeft + nDiff);
Update();
ImplHideFocusRect();
Scroll( -nDiff, 0 );
@@ -2116,12 +2141,12 @@ void ImplListBoxWindow::ScrollHorz( long n )
// -----------------------------------------------------------------------
-Size ImplListBoxWindow::CalcSize( USHORT nMaxLines ) const
+Size ImplListBoxWindow::CalcSize( sal_uInt16 nMaxLines ) const
{
// FIXME: LISTBOX_ENTRY_FLAG_MULTILINE
Size aSz;
-// USHORT nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
+// sal_uInt16 nL = Min( nMaxLines, mpEntryList->GetEntryCount() );
aSz.Height() = nMaxLines * mnMaxHeight;
aSz.Width() = mnMaxWidth + 2*mnBorder;
return aSz;
@@ -2129,7 +2154,7 @@ Size ImplListBoxWindow::CalcSize( USHORT nMaxLines ) const
// -----------------------------------------------------------------------
-Rectangle ImplListBoxWindow::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const
{
const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem );
Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() );
@@ -2147,7 +2172,7 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
if ( nType == STATE_CHANGE_ZOOM )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplCalcMetrics();
Invalidate();
}
@@ -2158,18 +2183,18 @@ void ImplListBoxWindow::StateChanged( StateChangedType nType )
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
ImplCalcMetrics();
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
ImplClearLayoutData();
@@ -2187,7 +2212,7 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
ImplClearLayoutData();
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
ImplCalcMetrics();
Invalidate();
}
@@ -2195,9 +2220,9 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-USHORT ImplListBoxWindow::ImplGetTextStyle() const
+sal_uInt16 ImplListBoxWindow::ImplGetTextStyle() const
{
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
if ( mpEntryList->HasImages() )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -2228,9 +2253,9 @@ ImplListBox::ImplListBox( Window* pParent, WinBits nWinStyle ) :
mpVScrollBar->SetScrollHdl( aLink );
mpHScrollBar->SetScrollHdl( aLink );
- mbVScroll = FALSE;
- mbHScroll = FALSE;
- mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? TRUE : FALSE;
+ mbVScroll = sal_False;
+ mbHScroll = sal_False;
+ mbAutoHScroll = ( nWinStyle & WB_AUTOHSCROLL ) ? sal_True : sal_False;
maLBWindow.SetScrollHdl( LINK( this, ImplListBox, LBWindowScrolled ) );
maLBWindow.SetMRUChangedHdl( LINK( this, ImplListBox, MRUChanged ) );
@@ -2263,37 +2288,37 @@ void ImplListBox::Clear()
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const Image& rImage )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rImage );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-USHORT ImplListBox::InsertEntry( USHORT nPos, const XubString& rStr, const Image& rImage )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr, rImage );
- USHORT nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
+ sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
StateChanged( STATE_CHANGE_DATA );
return nNewPos;
}
// -----------------------------------------------------------------------
-void ImplListBox::RemoveEntry( USHORT nPos )
+void ImplListBox::RemoveEntry( sal_uInt16 nPos )
{
maLBWindow.RemoveEntry( nPos );
StateChanged( STATE_CHANGE_DATA );
@@ -2301,21 +2326,21 @@ void ImplListBox::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-void ImplListBox::SetEntryFlags( USHORT nPos, long nFlags )
+void ImplListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
maLBWindow.SetEntryFlags( nPos, nFlags );
}
// -----------------------------------------------------------------------
-long ImplListBox::GetEntryFlags( USHORT nPos ) const
+long ImplListBox::GetEntryFlags( sal_uInt16 nPos ) const
{
return maLBWindow.GetEntryList()->GetEntryFlags( nPos );
}
// -----------------------------------------------------------------------
-void ImplListBox::SelectEntry( USHORT nPos, BOOL bSelect )
+void ImplListBox::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
{
maLBWindow.SelectEntry( nPos, bSelect );
}
@@ -2363,7 +2388,11 @@ IMPL_LINK( ImplListBox, MRUChanged, void*, EMPTYARG )
IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
{
+ long nSet = GetTopEntry();
+ if( nSet > mpVScrollBar->GetRangeMax() )
+ mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
mpVScrollBar->SetThumbPos( GetTopEntry() );
+
mpHScrollBar->SetThumbPos( GetLeftIndent() );
maScrollHdl.Call( this );
@@ -2375,7 +2404,7 @@ IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
{
- USHORT nPos = (USHORT) pSB->GetThumbPos();
+ sal_uInt16 nPos = (sal_uInt16) pSB->GetThumbPos();
if( pSB == mpVScrollBar )
SetTopEntry( nPos );
else if( pSB == mpHScrollBar )
@@ -2388,34 +2417,38 @@ IMPL_LINK( ImplListBox, ScrollBarHdl, ScrollBar*, pSB )
void ImplListBox::ImplCheckScrollBars()
{
- BOOL bArrange = FALSE;
+ sal_Bool bArrange = sal_False;
Size aOutSz = GetOutputSizePixel();
- USHORT nEntries = GetEntryList()->GetEntryCount();
- USHORT nMaxVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
+ sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
+ sal_uInt16 nMaxVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
// vert. ScrollBar
if( nEntries > nMaxVisEntries )
{
if( !mbVScroll )
- bArrange = TRUE;
- mbVScroll = TRUE;
+ bArrange = sal_True;
+ mbVScroll = sal_True;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
else
{
if( mbVScroll )
- bArrange = TRUE;
- mbVScroll = FALSE;
+ bArrange = sal_True;
+ mbVScroll = sal_False;
SetTopEntry( 0 );
}
// horz. ScrollBar
if( mbAutoHScroll )
{
- long nWidth = (USHORT) aOutSz.Width();
+ long nWidth = (sal_uInt16) aOutSz.Width();
if ( mbVScroll )
nWidth -= mpVScrollBar->GetSizePixel().Width();
@@ -2423,32 +2456,36 @@ void ImplListBox::ImplCheckScrollBars()
if( nWidth < nMaxWidth )
{
if( !mbHScroll )
- bArrange = TRUE;
- mbHScroll = TRUE;
+ bArrange = sal_True;
+ mbHScroll = sal_True;
if ( !mbVScroll ) // ggf. brauchen wir jetzt doch einen
{
- nMaxVisEntries = (USHORT) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
+ nMaxVisEntries = (sal_uInt16) ( ( aOutSz.Height() - mpHScrollBar->GetSizePixel().Height() ) / GetEntryHeight() );
if( nEntries > nMaxVisEntries )
{
- bArrange = TRUE;
- mbVScroll = TRUE;
+ bArrange = sal_True;
+ mbVScroll = sal_True;
// Ueberpruefung des rausgescrollten Bereichs
- SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
+ if( GetEntryList()->GetSelectEntryCount() == 1 &&
+ GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+ ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+ else
+ SetTopEntry( GetTopEntry() ); // MaxTop wird geprueft...
}
}
// Ueberpruefung des rausgescrollten Bereichs
- USHORT nMaxLI = (USHORT) (nMaxWidth - nWidth);
+ sal_uInt16 nMaxLI = (sal_uInt16) (nMaxWidth - nWidth);
if ( nMaxLI < GetLeftIndent() )
SetLeftIndent( nMaxLI );
}
else
{
if( mbHScroll )
- bArrange = TRUE;
- mbHScroll = FALSE;
+ bArrange = sal_True;
+ mbHScroll = sal_False;
SetLeftIndent( 0 );
}
}
@@ -2467,8 +2504,8 @@ void ImplListBox::ImplInitScrollBars()
if ( mbVScroll )
{
- USHORT nEntries = GetEntryList()->GetEntryCount();
- USHORT nVisEntries = (USHORT) (aOutSz.Height() / GetEntryHeight());
+ sal_uInt16 nEntries = GetEntryList()->GetEntryCount();
+ sal_uInt16 nVisEntries = (sal_uInt16) (aOutSz.Height() / GetEntryHeight());
mpVScrollBar->SetRangeMax( nEntries );
mpVScrollBar->SetVisibleSize( nVisEntries );
mpVScrollBar->SetPageSize( nVisEntries - 1 );
@@ -2477,7 +2514,7 @@ void ImplListBox::ImplInitScrollBars()
if ( mbHScroll )
{
mpHScrollBar->SetRangeMax( GetMaxEntryWidth() + HORZ_SCROLL );
- mpHScrollBar->SetVisibleSize( (USHORT)aOutSz.Width() );
+ mpHScrollBar->SetVisibleSize( (sal_uInt16)aOutSz.Width() );
mpHScrollBar->SetLineSize( HORZ_SCROLL );
mpHScrollBar->SetPageSize( aOutSz.Width() - HORZ_SCROLL );
}
@@ -2502,7 +2539,7 @@ void ImplListBox::ImplResizeControls()
// pb: #106948# explicit mirroring for calc
// Scrollbar on left or right side?
- BOOL bMirroring = maLBWindow.IsMirroring();
+ sal_Bool bMirroring = maLBWindow.IsMirroring();
Point aWinPos( bMirroring && mbVScroll ? nSBWidth : 0, 0 );
maLBWindow.SetPosSizePixel( aWinPos, aInnerSz );
@@ -2557,7 +2594,7 @@ void ImplListBox::StateChanged( StateChangedType nType )
}
else if ( ( nType == STATE_CHANGE_UPDATEMODE ) || ( nType == STATE_CHANGE_DATA ) )
{
- BOOL bUpdate = IsUpdateMode();
+ sal_Bool bUpdate = IsUpdateMode();
maLBWindow.SetUpdateMode( bUpdate );
// mpHScrollBar->SetUpdateMode( bUpdate );
// mpVScrollBar->SetUpdateMode( bUpdate );
@@ -2643,15 +2680,15 @@ const Wallpaper& ImplListBox::GetDisplayBackground() const
// -----------------------------------------------------------------------
-BOOL ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
+sal_Bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
{
- USHORT nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
+ sal_uInt16 nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
KeyEvent aKeyEvent( 0, KeyCode( nKey ) );
bDone = ProcessKeyInput( aKeyEvent );
}
@@ -2663,23 +2700,23 @@ BOOL ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
{
- BOOL bChanges = GetEntryList()->GetMRUCount() ? TRUE : FALSE;
+ sal_Bool bChanges = GetEntryList()->GetMRUCount() ? sal_True : sal_False;
// Remove old MRU entries
- for ( USHORT n = GetEntryList()->GetMRUCount();n; )
+ for ( sal_uInt16 n = GetEntryList()->GetMRUCount();n; )
maLBWindow.RemoveEntry( --n );
- USHORT nMRUCount = 0;
- USHORT nEntries = rEntries.GetTokenCount( cSep );
- for ( USHORT nEntry = 0; nEntry < nEntries; nEntry++ )
+ sal_uInt16 nMRUCount = 0;
+ sal_uInt16 nEntries = rEntries.GetTokenCount( cSep );
+ for ( sal_uInt16 nEntry = 0; nEntry < nEntries; nEntry++ )
{
XubString aEntry = rEntries.GetToken( nEntry, cSep );
// Accept only existing entries
if ( GetEntryList()->FindEntry( aEntry ) != LISTBOX_ENTRY_NOTFOUND )
{
ImplEntryType* pNewEntry = new ImplEntryType( aEntry );
- maLBWindow.GetEntryList()->InsertEntry( nMRUCount++, pNewEntry, FALSE );
- bChanges = TRUE;
+ maLBWindow.GetEntryList()->InsertEntry( nMRUCount++, pNewEntry, sal_False );
+ bChanges = sal_True;
}
}
@@ -2696,7 +2733,7 @@ void ImplListBox::SetMRUEntries( const XubString& rEntries, xub_Unicode cSep )
XubString ImplListBox::GetMRUEntries( xub_Unicode cSep ) const
{
String aEntries;
- for ( USHORT n = 0; n < GetEntryList()->GetMRUCount(); n++ )
+ for ( sal_uInt16 n = 0; n < GetEntryList()->GetMRUCount(); n++ )
{
aEntries += GetEntryList()->GetEntryText( n );
if( n < ( GetEntryList()->GetMRUCount() - 1 ) )
@@ -2716,17 +2753,17 @@ ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) :
else
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
- mbInUserDraw = FALSE;
- mbUserDrawEnabled = FALSE;
+ mbInUserDraw = sal_False;
+ mbUserDrawEnabled = sal_False;
mnItemPos = LISTBOX_ENTRY_NOTFOUND;
}
// -----------------------------------------------------------------------
-BOOL ImplWin::SetModeImage( const Image& rImage )
+sal_Bool ImplWin::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2792,7 +2829,7 @@ void ImplWin::ImplDraw( bool bLayout )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( ! bLayout )
{
@@ -2819,11 +2856,11 @@ void ImplWin::ImplDraw( bool bLayout )
Point aPoint( -nLeft, -nTop );
Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
- BOOL bMouseOver = FALSE;
+ sal_Bool bMouseOver = sal_False;
if( GetParent() )
{
Window *pChild = GetParent()->GetWindow( WINDOW_FIRSTCHILD );
- while( pChild && (bMouseOver = pChild->IsMouseOver()) == FALSE )
+ while( pChild && (bMouseOver = pChild->IsMouseOver()) == sal_False )
pChild = pChild->GetWindow( WINDOW_NEXT );
}
@@ -2876,14 +2913,14 @@ void ImplWin::ImplDraw( bool bLayout )
if ( IsUserDrawEnabled() )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
UserDrawEvent aUDEvt( this, maFocusRect, mnItemPos, 0 );
maUserDrawHdl.Call( &aUDEvt );
- mbInUserDraw = FALSE;
+ mbInUserDraw = sal_False;
}
else
{
- DrawEntry( TRUE, TRUE, FALSE, bLayout );
+ DrawEntry( sal_True, sal_True, sal_False, bLayout );
}
}
@@ -2896,15 +2933,15 @@ void ImplWin::Paint( const Rectangle& )
// -----------------------------------------------------------------------
-void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos, bool bLayout )
+void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos, bool bLayout )
{
long nBorder = 1;
Size aOutSz = GetOutputSizePixel();
- BOOL bImage = !!maImage;
+ sal_Bool bImage = !!maImage;
if( bDrawImage && bImage && !bLayout )
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
Size aImgSz = maImage.GetSizePixel();
Point aPtImg( nBorder, ( ( aOutSz.Height() - aImgSz.Height() ) / 2 ) );
@@ -2925,7 +2962,7 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP
if( bDrawText && maString.Len() )
{
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
if ( bDrawImage && bImage && !bLayout )
nTextStyle |= TEXT_DRAW_LEFT;
@@ -3004,7 +3041,7 @@ void ImplWin::LoseFocus()
ImplBtn::ImplBtn( Window* pParent, WinBits nWinStyle ) :
PushButton( pParent, nWinStyle ),
- mbDown ( FALSE )
+ mbDown ( sal_False )
{
}
@@ -3024,7 +3061,7 @@ void ImplBtn::MouseButtonDown( const MouseEvent& )
if( IsEnabled() )
{
MBDown();
- mbDown = TRUE;
+ mbDown = sal_True;
}
}
@@ -3035,7 +3072,7 @@ ImplListBoxFloatingWindow::ImplListBoxFloatingWindow( Window* pParent ) :
{
mpImplLB = NULL;
mnDDLineCount = 0;
- mbAutoWidth = FALSE;
+ mbAutoWidth = sal_False;
mnPopupModeStartSaveSelection = LISTBOX_ENTRY_NOTFOUND;
@@ -3060,7 +3097,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- if( !GetParent()->HasChildPathFocus( TRUE ) )
+ if( !GetParent()->HasChildPathFocus( sal_True ) )
EndPopupMode();
}
@@ -3069,7 +3106,7 @@ long ImplListBoxFloatingWindow::PreNotify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
@@ -3086,7 +3123,7 @@ void ImplListBoxFloatingWindow::SetPosSizePixel( long nX, long nY, long nWidth,
if ( nFlags & WINDOW_POSSIZE_Y )
aPos.Y() = nY;
- USHORT nIndex;
+ sal_uInt16 nIndex;
SetPosPixel( ImplCalcPos( this, Rectangle( aPos, GetParent()->GetSizePixel() ), FLOATWIN_POPUPMODE_DOWN, nIndex ) );
}
@@ -3121,7 +3158,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- USHORT nLines = mpImplLB->GetEntryList()->GetEntryCount();
+ sal_uInt16 nLines = mpImplLB->GetEntryList()->GetEntryCount();
if ( mnDDLineCount && ( nLines > mnDDLineCount ) )
nLines = mnDDLineCount;
@@ -3187,7 +3224,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
// -----------------------------------------------------------------------
-void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
+void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
{
if( !IsInPopupMode() )
{
@@ -3196,7 +3233,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
SetSizePixel( aFloatSz );
mpImplLB->SetSizePixel( GetOutputSizePixel() );
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
mnPopupModeStartSaveSelection = nPos;
Size aSz = GetParent()->GetSizePixel();
@@ -3227,7 +3264,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
- mpImplLB->GetMainWindow()->EnableMouseMoveSelect( TRUE );
+ mpImplLB->GetMainWindow()->EnableMouseMoveSelect( sal_True );
if ( mpImplLB->GetMainWindow()->IsGrabFocusAllowed() )
mpImplLB->GetMainWindow()->GrabFocus();
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index b59766228e43..7f304e335f54 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -31,6 +31,7 @@
#include <vcl/event.hxx>
#include <vcl/imgctrl.hxx>
+#include <tools/rcid.h>
#include <com/sun/star/awt/ImageScaleMode.hdl>
@@ -38,10 +39,18 @@ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
// -----------------------------------------------------------------------
-ImageControl::ImageControl( Window* pParent, WinBits nStyle ) :
- FixedImage( pParent, nStyle )
+ImageControl::ImageControl( Window* pParent, WinBits nStyle )
+ :FixedImage( pParent, nStyle )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
+{
+}
+
+// -----------------------------------------------------------------------
+
+ImageControl::ImageControl( Window* pParent, const ResId& rResId )
+ :FixedImage( pParent, rResId )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
{
- mnScaleMode = ImageScaleMode::Anisotropic;
}
// -----------------------------------------------------------------------
@@ -87,137 +96,81 @@ namespace
// -----------------------------------------------------------------------
-void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
+void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Point& rPos, const Size& rSize ) const
{
- USHORT nStyle = 0;
- BitmapEx* pBitmap = &maBmp;
- if ( !*pBitmap )
+ sal_uInt16 nStyle = 0;
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ {
+ if ( !IsEnabled() )
+ nStyle |= IMAGE_DRAW_DISABLE;
+ }
+
+ const Image& rImage( GetModeImage() );
+ const Image* pImage = &rImage;
+ const Rectangle aDrawRect( rPos, rSize );
+ if ( !*pImage )
{
String sText( GetText() );
if ( !sText.Len() )
return;
WinBits nWinStyle = GetStyle();
- USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
- if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ if ( !IsEnabled() )
+ nTextStyle |= TEXT_DRAW_DISABLE;
- DrawText( rUDEvt.GetRect(), sText, nTextStyle );
+ rDev.DrawText( aDrawRect, sText, nTextStyle );
return;
}
- const Rectangle& rPaintRect = rUDEvt.GetRect();
- const Size& rBitmapSize = maBmp.GetSizePixel();
+ const Size& rBitmapSize = pImage->GetSizePixel();
- if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
+ switch ( mnScaleMode )
{
- // only images support IMAGE_DRAW_COLORTRANSFORM
- Image aImage( *pBitmap );
- if ( !!aImage )
- {
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, rBitmapSize ), aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize,
- aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- rUDEvt.GetDevice()->DrawImage(
- rPaintRect.TopLeft(),
- rPaintRect.GetSize(),
- aImage, nStyle );
- }
- break;
-
- default:
- OSL_FAIL( "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
- }
- }
- else
+ case ImageScaleMode::None:
{
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- pBitmap->Draw( rUDEvt.GetDevice(), lcl_centerWithin( rPaintRect, rBitmapSize ) );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- pBitmap->Draw( rUDEvt.GetDevice(),
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- pBitmap->Draw( rUDEvt.GetDevice(),
- rPaintRect.TopLeft(),
- rPaintRect.GetSize() );
- }
- break;
-
- default:
- OSL_FAIL( "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
+ rDev.DrawImage( lcl_centerWithin( aDrawRect, rBitmapSize ), *pImage, nStyle );
}
-}
+ break;
-// -----------------------------------------------------------------------
+ case ImageScaleMode::Isotropic:
+ {
+ const Size aPaintSize = lcl_calcPaintSize( aDrawRect, rBitmapSize );
+ rDev.DrawImage(
+ lcl_centerWithin( aDrawRect, aPaintSize ),
+ aPaintSize,
+ *pImage, nStyle );
+ }
+ break;
-void ImageControl::SetBitmap( const BitmapEx& rBmp )
-{
- maBmp = rBmp;
- StateChanged( STATE_CHANGE_DATA );
-}
+ case ImageScaleMode::Anisotropic:
+ {
+ rDev.DrawImage(
+ aDrawRect.TopLeft(),
+ aDrawRect.GetSize(),
+ *pImage, nStyle );
+ }
+ break;
-// -----------------------------------------------------------------------
+ default:
+ OSL_ENSURE( false, "ImageControl::ImplDraw: unhandled scale mode!" );
+ break;
-BOOL ImageControl::SetModeBitmap( const BitmapEx& rBitmap )
-{
- SetBitmap( rBitmap );
- return TRUE;
+ } // switch ( mnScaleMode )
}
// -----------------------------------------------------------------------
-const BitmapEx& ImageControl::GetModeBitmap( ) const
+void ImageControl::Paint( const Rectangle& /*rRect*/ )
{
- return maBmp;
-}
-
-// -----------------------------------------------------------------------
+ ImplDraw( *this, 0, Point(), GetOutputSizePixel() );
-void ImageControl::Paint( const Rectangle& rRect )
-{
- FixedImage::Paint( rRect );
if( HasFocus() )
{
Window *pWin = GetWindow( WINDOW_BORDER );
- BOOL bFlat = (GetBorderStyle() == 2);
+ sal_Bool bFlat = (GetBorderStyle() == 2);
Rectangle aRect( Point(0,0), pWin->GetOutputSizePixel() );
Color oldLineCol = pWin->GetLineColor();
Color oldFillCol = pWin->GetFillColor();
@@ -236,6 +189,27 @@ void ImageControl::Paint( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
+void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
+{
+ const Point aPos = pDev->LogicToPixel( rPos );
+ const Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
+
+ pDev->Push();
+ pDev->SetMapMode();
+
+ // Border
+ if ( !(nFlags & WINDOW_DRAW_NOBORDER) && (GetStyle() & WB_BORDER) )
+ {
+ ImplDrawFrame( pDev, aRect );
+ }
+ pDev->IntersectClipRegion( aRect );
+ ImplDraw( *pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
+
+ pDev->Pop();
+}
+
+// -----------------------------------------------------------------------
void ImageControl::GetFocus()
{
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index e072b406faae..e2d502026203 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -52,9 +52,9 @@
// =======================================================================
-static BigInt ImplPower10( USHORT n )
+static BigInt ImplPower10( sal_uInt16 n )
{
- USHORT i;
+ sal_uInt16 i;
BigInt nValue = 1;
for ( i=0; i < n; i++ )
@@ -65,7 +65,7 @@ static BigInt ImplPower10( USHORT n )
// -----------------------------------------------------------------------
-static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, USHORT nDigits, const String& rCurrSymbol, BOOL bShowThousandSep )
+static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const BigInt &rNumber, sal_uInt16 nDigits, const String& rCurrSymbol, sal_Bool bShowThousandSep )
{
DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
@@ -113,16 +113,16 @@ static XubString ImplGetCurr( const LocaleDataWrapper& rLocaleDataWrapper, const
// -----------------------------------------------------------------------
-static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
- BOOL bStrictFormat, BOOL bThousandSep,
+static sal_Bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
+ sal_Bool bStrictFormat, sal_Bool bThousandSep,
const LocaleDataWrapper& rLocaleDataWrapper )
{
if ( !bStrictFormat )
- return FALSE;
+ return sal_False;
else
{
sal_Unicode cChar = rKEvt.GetCharCode();
- USHORT nGroup = rKEvt.GetKeyCode().GetGroup();
+ sal_uInt16 nGroup = rKEvt.GetKeyCode().GetGroup();
if ( (nGroup == KEYGROUP_FKEYS) || (nGroup == KEYGROUP_CURSOR) ||
(nGroup == KEYGROUP_MISC) ||
@@ -130,28 +130,28 @@ static BOOL ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(bThousandSep && (cChar == rLocaleDataWrapper.getNumThousandSep())) ||
(cChar == rLocaleDataWrapper.getNumDecimalSep() ) ||
(cChar == '-') )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
}
// -----------------------------------------------------------------------
-static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
- BOOL bCurrency = FALSE )
+static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper,
+ sal_Bool bCurrency = sal_False )
{
XubString aStr = rStr;
XubString aStr1;
XubString aStr2;
- USHORT nDecPos;
- BOOL bNegative = FALSE;
+ sal_uInt16 nDecPos;
+ sal_Bool bNegative = sal_False;
xub_StrLen i;
// Reaktion auf leeren String
if ( !rStr.Len() )
- return FALSE;
+ return sal_False;
// Fuehrende und nachfolgende Leerzeichen entfernen
aStr.EraseLeadingAndTrailingChars( ' ' );
@@ -171,7 +171,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
- bNegative = TRUE;
+ bNegative = sal_True;
if ( !bNegative )
{
for ( i=0; i < aStr.Len(); i++ )
@@ -180,24 +180,24 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
}
if ( !bNegative && bCurrency && aStr.Len() )
{
- USHORT nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
+ sal_uInt16 nFormat = rLocaleDataWrapper.getCurrNegativeFormat();
if ( (nFormat == 3) || (nFormat == 6) ||
(nFormat == 7) || (nFormat == 10) )
{
- for ( i = (USHORT)(aStr.Len()-1); i > 0; i++ )
+ for ( i = (sal_uInt16)(aStr.Len()-1); i > 0; i++ )
{
if ( (aStr.GetChar( i ) >= '0') && (aStr.GetChar( i ) <= '9') )
break;
else if ( aStr.GetChar( i ) == '-' )
{
- bNegative = TRUE;
+ bNegative = sal_True;
break;
}
}
@@ -207,7 +207,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
else
{
if ( aStr1.GetChar( 0 ) == '-' )
- bNegative = TRUE;
+ bNegative = sal_True;
}
// Alle unerwuenschten Zeichen rauswerfen
@@ -227,7 +227,7 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
}
if ( !aStr1.Len() && !aStr2.Len() )
- return FALSE;
+ return sal_False;
if ( !aStr1.Len() )
aStr1.Insert( '0' );
@@ -235,11 +235,11 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
aStr1.Insert( '-', 0 );
// Nachkommateil zurechtstutzen und dabei runden
- BOOL bRound = FALSE;
+ sal_Bool bRound = sal_False;
if ( aStr2.Len() > nDecDigits )
{
if ( aStr2.GetChar( nDecDigits ) >= '5' )
- bRound = TRUE;
+ bRound = sal_True;
aStr2.Erase( nDecDigits );
}
if ( aStr2.Len() < nDecDigits )
@@ -260,38 +260,38 @@ static BOOL ImplNumericGetValue( const XubString& rStr, BigInt& rValue,
rValue = nValue;
- return TRUE;
+ return sal_True;
}
// =======================================================================
-static BOOL ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
- BOOL, BOOL bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
+static sal_Bool ImplLongCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
+ sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Es gibt hier kein sinnvolles StrictFormat, also alle
// Zeichen erlauben
- return ImplNumericProcessKeyInput( pEdit, rKEvt, FALSE, bUseThousandSep, rLocaleDataWrapper );
+ return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rLocaleDataWrapper );
}
// -----------------------------------------------------------------------
-inline BOOL ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
- USHORT nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
+inline sal_Bool ImplLongCurrencyGetValue( const XubString& rStr, BigInt& rValue,
+ sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper )
{
// Zahlenwert holen
- return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, TRUE );
+ return ImplNumericGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper, sal_True );
}
// -----------------------------------------------------------------------
-BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
- USHORT nDecDigits,
+sal_Bool ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
+ sal_uInt16 nDecDigits,
const LocaleDataWrapper& rLocaleDataWrapper, String& rOutStr,
LongCurrencyFormatter& rFormatter )
{
BigInt nValue;
- if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, TRUE ) )
- return TRUE;
+ if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper, sal_True ) )
+ return sal_True;
else
{
BigInt nTempVal = nValue;
@@ -306,7 +306,7 @@ BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
if ( !rFormatter.GetErrorHdl().Call( &rFormatter ) )
{
rFormatter.mnCorrectedValue = 0;
- return FALSE;
+ return sal_False;
}
else
{
@@ -315,7 +315,7 @@ BOOL ImplLongCurrencyReformat( const XubString& rStr, BigInt nMin, BigInt nMax,
}
rOutStr = ImplGetCurr( rLocaleDataWrapper, nTempVal, nDecDigits, rFormatter.GetCurrencySymbol(), rFormatter.IsUseThousandSep() );
- return TRUE;
+ return sal_True;
}
}
@@ -332,7 +332,7 @@ void LongCurrencyFormatter::ImpInit()
mnCorrectedValue = 0;
mnDecimalDigits = 0;
mnType = FORMAT_LONGCURRENCY;
- mbThousandSep = TRUE;
+ mbThousandSep = sal_True;
SetDecimalDigits( 0 );
}
@@ -352,7 +352,7 @@ void LongCurrencyFormatter::ImplLoadRes( const ResId& rResId )
ResMgr* pMgr = rResId.GetResMgr();
if( pMgr )
{
- ULONG nMask = pMgr->ReadLong();
+ sal_uLong nMask = pMgr->ReadLong();
if ( NUMERICFORMATTER_MIN & nMask )
mnMin = pMgr->ReadLong();
@@ -361,7 +361,7 @@ void LongCurrencyFormatter::ImplLoadRes( const ResId& rResId )
mnMax = pMgr->ReadLong();
if ( NUMERICFORMATTER_STRICTFORMAT & nMask )
- SetStrictFormat( (BOOL)pMgr->ReadShort() );
+ SetStrictFormat( (sal_Bool)pMgr->ReadShort() );
if ( NUMERICFORMATTER_DECIMALDIGITS & nMask )
SetDecimalDigits( pMgr->ReadShort() );
@@ -405,7 +405,7 @@ void LongCurrencyFormatter::SetValue( BigInt nNewValue )
{
SetUserValue( nNewValue );
mnFieldValue = mnLastValue;
- SetEmptyFieldValueData( FALSE );
+ SetEmptyFieldValueData( sal_False );
}
// -----------------------------------------------------------------------
@@ -430,7 +430,7 @@ void LongCurrencyFormatter::SetUserValue( BigInt nNewValue )
}
else
GetField()->SetText( aStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
// -----------------------------------------------------------------------
@@ -464,7 +464,7 @@ void LongCurrencyFormatter::Reformat()
return;
XubString aStr;
- BOOL bOK = ImplLongCurrencyReformat( GetField()->GetText(), mnMin, mnMax,
+ sal_Bool bOK = ImplLongCurrencyReformat( GetField()->GetText(), mnMin, mnMax,
GetDecimalDigits(), GetLocaleDataWrapper(), aStr, *this );
if ( !bOK )
return;
@@ -472,7 +472,7 @@ void LongCurrencyFormatter::Reformat()
if ( aStr.Len() )
{
GetField()->SetText( aStr );
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
ImplLongCurrencyGetValue( aStr, mnLastValue, GetDecimalDigits(), GetLocaleDataWrapper() );
}
else
@@ -504,7 +504,7 @@ void LongCurrencyFormatter::SetMax( BigInt nNewMax )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetUseThousandSep( BOOL b )
+void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b )
{
mbThousandSep = b;
ReformatAll();
@@ -513,7 +513,7 @@ void LongCurrencyFormatter::SetUseThousandSep( BOOL b )
// -----------------------------------------------------------------------
-void LongCurrencyFormatter::SetDecimalDigits( USHORT nDigits )
+void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits )
{
// DBG_ASSERT( nDigits < 10, "LongCurrency duerfen nur maximal 9 Nachkommastellen haben" );
@@ -526,21 +526,21 @@ void LongCurrencyFormatter::SetDecimalDigits( USHORT nDigits )
// -----------------------------------------------------------------------
-USHORT LongCurrencyFormatter::GetDecimalDigits() const
+sal_uInt16 LongCurrencyFormatter::GetDecimalDigits() const
{
return mnDecimalDigits;
}
// -----------------------------------------------------------------------
-BOOL LongCurrencyFormatter::IsValueModified() const
+sal_Bool LongCurrencyFormatter::IsValueModified() const
{
if ( ImplGetEmptyFieldValue() )
return !IsEmptyValue();
else if ( GetValue() != mnFieldValue )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -548,7 +548,7 @@ BOOL LongCurrencyFormatter::IsValueModified() const
void LongCurrencyFormatter::SetEmptyValue()
{
GetField()->SetText( ImplGetSVEmptyStr() );
- SetEmptyFieldValueData( TRUE );
+ SetEmptyFieldValueData( sal_True );
}
// -----------------------------------------------------------------------
@@ -577,7 +577,7 @@ void ImplNewLongCurrencyFieldValue( LongCurrencyField* pField, BigInt nNewValue
Selection aSelect = pField->GetSelection();
aSelect.Justify();
XubString aText = pField->GetText();
- BOOL bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? TRUE : FALSE;
+ sal_Bool bLastSelected = ((xub_StrLen)aSelect.Max() == aText.Len()) ? sal_True : sal_False;
BigInt nOldLastValue = pField->mnLastValue;
pField->SetUserValue( nNewValue );
@@ -634,7 +634,7 @@ void LongCurrencyField::ImplLoadRes( const ResId& rResId )
SpinField::ImplLoadRes( rResId );
LongCurrencyFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( CURRENCYFIELD_FIRST & nMask )
mnFirst = ReadLongRes();
@@ -669,7 +669,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -686,7 +686,7 @@ long LongCurrencyField::Notify( NotifyEvent& rNEvt )
void LongCurrencyField::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
SpinField::Modify();
}
@@ -781,7 +781,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- MarkToBeReformatted( FALSE );
+ MarkToBeReformatted( sal_False );
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
@@ -798,7 +798,7 @@ long LongCurrencyBox::Notify( NotifyEvent& rNEvt )
void LongCurrencyBox::Modify()
{
- MarkToBeReformatted( TRUE );
+ MarkToBeReformatted( sal_True );
ComboBox::Modify();
}
@@ -807,9 +807,9 @@ void LongCurrencyBox::Modify()
void LongCurrencyBox::ReformatAll()
{
XubString aStr;
- SetUpdateMode( FALSE );
- USHORT nEntryCount = GetEntryCount();
- for ( USHORT i=0; i < nEntryCount; i++ )
+ SetUpdateMode( sal_False );
+ sal_uInt16 nEntryCount = GetEntryCount();
+ for ( sal_uInt16 i=0; i < nEntryCount; i++ )
{
ImplLongCurrencyReformat( GetEntry( i ), mnMin, mnMax,
GetDecimalDigits(), GetLocaleDataWrapper(),
@@ -818,12 +818,12 @@ void LongCurrencyBox::ReformatAll()
InsertEntry( aStr, i );
}
LongCurrencyFormatter::Reformat();
- SetUpdateMode( TRUE );
+ SetUpdateMode( sal_True );
}
// -----------------------------------------------------------------------
-void LongCurrencyBox::InsertValue( BigInt nValue, USHORT nPos )
+void LongCurrencyBox::InsertValue( BigInt nValue, sal_uInt16 nPos )
{
XubString aStr = ImplGetCurr( GetLocaleDataWrapper(), nValue, GetDecimalDigits(), GetCurrencySymbol(), IsUseThousandSep() );
ComboBox::InsertEntry( aStr, nPos );
@@ -839,7 +839,7 @@ void LongCurrencyBox::RemoveValue( BigInt nValue )
// -----------------------------------------------------------------------
-BigInt LongCurrencyBox::GetValue( USHORT nPos ) const
+BigInt LongCurrencyBox::GetValue( sal_uInt16 nPos ) const
{
BigInt nValue = 0;
ImplLongCurrencyGetValue( ComboBox::GetEntry( nPos ), nValue,
@@ -849,7 +849,7 @@ BigInt LongCurrencyBox::GetValue( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT LongCurrencyBox::GetValuePos( BigInt nValue ) const
+sal_uInt16 LongCurrencyBox::GetValuePos( BigInt nValue ) const
{
XubString aStr = ImplGetCurr( GetLocaleDataWrapper(), nValue, GetDecimalDigits(), GetCurrencySymbol(), IsUseThousandSep() );
return ComboBox::GetEntryPos( aStr );
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 3ae3c47c0428..88b583a3240d 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -105,7 +105,7 @@ void ListBox::ImplInitListBoxData()
mpBtn = NULL;
mnDDHeight = 0;
- mbDDAutoSize = TRUE;
+ mbDDAutoSize = sal_True;
mnSaveValue = LISTBOX_ENTRY_NOTFOUND;
mnLineCount = 0;
}
@@ -127,7 +127,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
{
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
- mnDDHeight = (USHORT)(GetTextHeight() + nTop + nBottom + 4);
+ mnDDHeight = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4);
if( IsNativeWidgetEnabled() &&
IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
@@ -142,12 +142,12 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
{
sal_Int32 nHeight = aBoundingRgn.GetHeight();
if( nHeight > mnDDHeight )
- mnDDHeight = static_cast<USHORT>(nHeight);
+ mnDDHeight = static_cast<sal_uInt16>(nHeight);
}
}
mpFloatWin = new ImplListBoxFloatingWindow( this );
- mpFloatWin->SetAutoWidth( TRUE );
+ mpFloatWin->SetAutoWidth( sal_True );
mpFloatWin->SetPopupModeEndHdl( LINK( this, ListBox, ImplPopupModeEndHdl ) );
mpFloatWin->GetDropTarget()->addDropTargetListener(xDrop);
@@ -186,9 +186,9 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
}
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( TRUE );
+ mpImplLB->GetMainWindow()->AllowGrabFocus( sal_True );
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
// -----------------------------------------------------------------------
@@ -208,12 +208,12 @@ void ListBox::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- USHORT nSelPos = ReadShortRes();
- USHORT nNumber = sal::static_int_cast<USHORT>(ReadLongRes());
+ sal_uInt16 nSelPos = ReadShortRes();
+ sal_uInt16 nNumber = sal::static_int_cast<sal_uInt16>(ReadLongRes());
- for( USHORT i = 0; i < nNumber; i++ )
+ for( sal_uInt16 i = 0; i < nNumber; i++ )
{
- USHORT nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
+ sal_uInt16 nPos = InsertEntry( ReadStringRes(), LISTBOX_APPEND );
long nId = ReadLongRes();
if( nId )
@@ -228,7 +228,7 @@ void ListBox::ImplLoadRes( const ResId& rResId )
IMPL_LINK( ListBox, ImplSelectHdl, void*, EMPTYARG )
{
- BOOL bPopup = IsInDropDown();
+ sal_Bool bPopup = IsInDropDown();
if( IsDropDownBox() )
{
if( !mpImplLB->IsTravelSelect() )
@@ -277,7 +277,7 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
{
if ( !mpImplLB->IsTrackingSelect() )
{
- USHORT nChanged = (USHORT)(ULONG)n;
+ sal_uInt16 nChanged = (sal_uInt16)(sal_uLong)n;
const ImplEntryList* pEntryList = mpImplLB->GetEntryList();
if ( pEntryList->IsEntryPosSelected( nChanged ) )
{
@@ -313,8 +313,8 @@ IMPL_LINK( ListBox, ImplClickBtnHdl, void*, EMPTYARG )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( TRUE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
ImplClearLayoutData();
@@ -336,9 +336,9 @@ IMPL_LINK( ListBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if ( ( mpFloatWin->GetPopupModeStartSaveSelection() != LISTBOX_ENTRY_NOTFOUND )
&& !IsEntryPosSelected( mpFloatWin->GetPopupModeStartSaveSelection() ) )
{
- mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), TRUE );
- BOOL bTravelSelect = mpImplLB->IsTravelSelect();
- mpImplLB->SetTravelSelect( TRUE );
+ mpImplLB->SelectEntry( mpFloatWin->GetPopupModeStartSaveSelection(), sal_True );
+ sal_Bool bTravelSelect = mpImplLB->IsTravelSelect();
+ mpImplLB->SetTravelSelect( sal_True );
ImplDelData aCheckDelete;
ImplAddDel( &aCheckDelete );
@@ -357,7 +357,7 @@ IMPL_LINK( ListBox, ImplPopupModeEndHdl, void*, EMPTYARG )
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
- mpBtn->SetPressed( FALSE );
+ mpBtn->SetPressed( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
return 0;
}
@@ -374,8 +374,8 @@ void ListBox::ToggleDropDown()
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( TRUE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_True );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
}
}
@@ -383,9 +383,9 @@ void ListBox::ToggleDropDown()
// -----------------------------------------------------------------------
-void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( TRUE, TRUE, TRUE );
+ mpImplLB->GetMainWindow()->ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -400,8 +400,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -435,7 +435,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
}
long nOnePixel = GetDrawPixel( pDev, 1 );
- USHORT nTextStyle = TEXT_DRAW_VCENTER;
+ sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
Rectangle aTextRect( aPos, aSize );
if ( GetStyle() & WB_CENTER )
@@ -472,7 +472,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
else
{
long nTextHeight = pDev->GetTextHeight();
- USHORT nLines = (USHORT)(aSize.Height() / nTextHeight);
+ sal_uInt16 nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
Rectangle aClip( aPos, aSize );
pDev->IntersectClipRegion( aClip );
@@ -480,10 +480,10 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, UL
if ( !nLines )
nLines = 1;
- for ( USHORT n = 0; n < nLines; n++ )
+ for ( sal_uInt16 n = 0; n < nLines; n++ )
{
- USHORT nEntry = n+mpImplLB->GetTopEntry();
- BOOL bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
+ sal_uInt16 nEntry = n+mpImplLB->GetTopEntry();
+ sal_Bool bSelected = mpImplLB->GetEntryList()->IsEntryPosSelected( nEntry );
if ( bSelected )
{
pDev->SetFillColor( COL_BLACK );
@@ -567,7 +567,7 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
if ( mpImplWin )
{
mpImplWin->SetSettings( GetSettings() ); // Falls noch nicht eingestellt...
- ImplInitFieldSettings( mpImplWin, TRUE, TRUE, TRUE );
+ ImplInitFieldSettings( mpImplWin, sal_True, sal_True, sal_True );
mpBtn->SetSettings( GetSettings() );
ImplInitDropDownButton( mpBtn );
@@ -581,7 +581,7 @@ void ListBox::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void ListBox::EnableAutoSize( BOOL bAuto )
+void ListBox::EnableAutoSize( sal_Bool bAuto )
{
mbDDAutoSize = bAuto;
if ( mpFloatWin )
@@ -595,7 +595,7 @@ void ListBox::EnableAutoSize( BOOL bAuto )
// -----------------------------------------------------------------------
-void ListBox::EnableDDAutoWidth( BOOL b )
+void ListBox::EnableDDAutoWidth( sal_Bool b )
{
if ( mpFloatWin )
mpFloatWin->SetAutoWidth( b );
@@ -603,14 +603,14 @@ void ListBox::EnableDDAutoWidth( BOOL b )
// -----------------------------------------------------------------------
-BOOL ListBox::IsDDAutoWidthEnabled() const
+sal_Bool ListBox::IsDDAutoWidthEnabled() const
{
- return mpFloatWin ? mpFloatWin->IsAutoWidth() : FALSE;
+ return mpFloatWin ? mpFloatWin->IsAutoWidth() : sal_False;
}
// -----------------------------------------------------------------------
-void ListBox::SetDropDownLineCount( USHORT nLines )
+void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
{
mnLineCount = nLines;
if ( mpFloatWin )
@@ -619,7 +619,7 @@ void ListBox::SetDropDownLineCount( USHORT nLines )
// -----------------------------------------------------------------------
-USHORT ListBox::GetDropDownLineCount() const
+sal_uInt16 ListBox::GetDropDownLineCount() const
{
if ( mpFloatWin )
return mpFloatWin->GetDropDownLineCount();
@@ -628,7 +628,7 @@ USHORT ListBox::GetDropDownLineCount() const
// -----------------------------------------------------------------------
-void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void ListBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( IsDropDownBox() && ( nFlags & WINDOW_POSSIZE_SIZE ) )
{
@@ -748,7 +748,7 @@ void ListBox::FillLayoutData() const
// -----------------------------------------------------------------------
-long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
+long ListBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
{
if( !HasLayoutData() )
FillLayoutData();
@@ -768,7 +768,7 @@ long ListBox::GetIndexForPoint( const Point& rPoint, USHORT& rPos ) const
aConvPoint = pMain->PixelToLogic( aConvPoint );
// try to find entry
- USHORT nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_uInt16 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
{
// not found, maybe dropdown case
@@ -893,8 +893,8 @@ void ListBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? TRUE : FALSE );
- BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : FALSE;
+ mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? sal_True : sal_False );
+ sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
}
else if( nType == STATE_CHANGE_MIRRORING )
@@ -931,8 +931,8 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
aKeyEvt.GetKeyCode().IsMod2() )
{
ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
- mpBtn->SetPressed( TRUE );
- mpFloatWin->StartFloat( FALSE );
+ mpBtn->SetPressed( sal_True );
+ mpFloatWin->StartFloat( sal_False );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
nDone = 1;
}
@@ -974,14 +974,14 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
}
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- if ( IsInDropDown() && !HasChildPathFocus( TRUE ) )
+ if ( IsInDropDown() && !HasChildPathFocus( sal_True ) )
mpFloatWin->EndPopupMode();
}
else if ( (rNEvt.GetType() == EVENT_COMMAND) &&
(rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
(rNEvt.GetWindow() == mpImplWin) )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -1047,30 +1047,30 @@ void ListBox::SetNoSelection()
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const XubString& rStr, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const Image& rImage, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::InsertEntry( const XubString& rStr, const Image& rImage, USHORT nPos )
+sal_uInt16 ListBox::InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos )
{
- USHORT nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
- nRealPos = sal::static_int_cast<USHORT>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
+ sal_uInt16 nRealPos = mpImplLB->InsertEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), rStr, rImage );
+ nRealPos = sal::static_int_cast<sal_uInt16>(nRealPos - mpImplLB->GetEntryList()->GetMRUCount());
CallEventListeners( VCLEVENT_LISTBOX_ITEMADDED, (void*) sal_IntPtr(nRealPos) );
return nRealPos;
}
@@ -1084,7 +1084,7 @@ void ListBox::RemoveEntry( const XubString& rStr )
// -----------------------------------------------------------------------
-void ListBox::RemoveEntry( USHORT nPos )
+void ListBox::RemoveEntry( sal_uInt16 nPos )
{
mpImplLB->RemoveEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, (void*) sal_IntPtr(nPos) );
@@ -1092,7 +1092,7 @@ void ListBox::RemoveEntry( USHORT nPos )
// -----------------------------------------------------------------------
-Image ListBox::GetEntryImage( USHORT nPos ) const
+Image ListBox::GetEntryImage( sal_uInt16 nPos ) const
{
if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
return mpImplLB->GetEntryList()->GetEntryImage( nPos );
@@ -1101,90 +1101,90 @@ Image ListBox::GetEntryImage( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryPos( const XubString& rStr ) const
+sal_uInt16 ListBox::GetEntryPos( const XubString& rStr ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryPos( const void* pData ) const
+sal_uInt16 ListBox::GetEntryPos( const void* pData ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
return nPos;
}
// -----------------------------------------------------------------------
-XubString ListBox::GetEntry( USHORT nPos ) const
+XubString ListBox::GetEntry( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryText( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetEntryCount() const
+sal_uInt16 ListBox::GetEntryCount() const
{
return mpImplLB->GetEntryList()->GetEntryCount() - mpImplLB->GetEntryList()->GetMRUCount();
}
// -----------------------------------------------------------------------
-XubString ListBox::GetSelectEntry( USHORT nIndex ) const
+XubString ListBox::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntry( GetSelectEntryPos( nIndex ) );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetSelectEntryCount() const
+sal_uInt16 ListBox::GetSelectEntryCount() const
{
return mpImplLB->GetEntryList()->GetSelectEntryCount();
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetSelectEntryPos( USHORT nIndex ) const
+sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nIndex ) const
{
- USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ sal_uInt16 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = mpImplLB->GetEntryList()->FindEntry( mpImplLB->GetEntryList()->GetEntryText( nPos ) );
- nPos = sal::static_int_cast<USHORT>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
+ nPos = sal::static_int_cast<sal_uInt16>(nPos - mpImplLB->GetEntryList()->GetMRUCount());
}
return nPos;
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsEntrySelected( const XubString& rStr ) const
+sal_Bool ListBox::IsEntrySelected( const XubString& rStr ) const
{
return IsEntryPosSelected( GetEntryPos( rStr ) );
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsEntryPosSelected( USHORT nPos ) const
+sal_Bool ListBox::IsEntryPosSelected( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntry( const XubString& rStr, BOOL bSelect )
+void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
{
SelectEntryPos( GetEntryPos( rStr ), bSelect );
}
// -----------------------------------------------------------------------
-void ListBox::SelectEntryPos( USHORT nPos, BOOL bSelect )
+void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
@@ -1192,51 +1192,51 @@ void ListBox::SelectEntryPos( USHORT nPos, BOOL bSelect )
// -----------------------------------------------------------------------
-void ListBox::SetEntryData( USHORT nPos, void* pNewData )
+void ListBox::SetEntryData( sal_uInt16 nPos, void* pNewData )
{
mpImplLB->SetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount(), pNewData );
}
// -----------------------------------------------------------------------
-void* ListBox::GetEntryData( USHORT nPos ) const
+void* ListBox::GetEntryData( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetEntryFlags( USHORT nPos, long nFlags )
+void ListBox::SetEntryFlags( sal_uInt16 nPos, long nFlags )
{
mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags );
}
// -----------------------------------------------------------------------
-long ListBox::GetEntryFlags( USHORT nPos ) const
+long ListBox::GetEntryFlags( sal_uInt16 nPos ) const
{
return mpImplLB->GetEntryList()->GetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::SetTopEntry( USHORT nPos )
+void ListBox::SetTopEntry( sal_uInt16 nPos )
{
mpImplLB->SetTopEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-void ListBox::ShowProminentEntry( USHORT nPos )
+void ListBox::ShowProminentEntry( sal_uInt16 nPos )
{
mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetTopEntry() const
+sal_uInt16 ListBox::GetTopEntry() const
{
- USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
+ sal_uInt16 nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
nPos = 0;
return nPos;
@@ -1258,26 +1258,26 @@ ProminentEntry ListBox::GetProminentEntryType() const
// -----------------------------------------------------------------------
-BOOL ListBox::IsTravelSelect() const
+sal_Bool ListBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
}
// -----------------------------------------------------------------------
-BOOL ListBox::IsInDropDown() const
+sal_Bool ListBox::IsInDropDown() const
{
return mpFloatWin && mpFloatWin->IsInPopupMode();
}
// -----------------------------------------------------------------------
-long ListBox::CalcWindowSizePixel( USHORT nLines ) const
+long ListBox::CalcWindowSizePixel( sal_uInt16 nLines ) const
{
return mpImplLB->GetEntryHeight() * nLines;
}
-Rectangle ListBox::GetBoundingRectangle( USHORT nItem ) const
+Rectangle ListBox::GetBoundingRectangle( sal_uInt16 nItem ) const
{
Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
@@ -1287,12 +1287,12 @@ Rectangle ListBox::GetBoundingRectangle( USHORT nItem ) const
// -----------------------------------------------------------------------
-void ListBox::EnableMultiSelection( BOOL bMulti )
+void ListBox::EnableMultiSelection( sal_Bool bMulti )
{
- EnableMultiSelection( bMulti, FALSE );
+ EnableMultiSelection( bMulti, sal_False );
}
-void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
+void ListBox::EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackSelection )
{
mpImplLB->EnableMultiSelection( bMulti, bStackSelection );
@@ -1300,7 +1300,7 @@ void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
// Die MultiListBox verh�lt sich wie eine normale ListBox.
// Die Mehrfachselektion kann nur �ber entsprechende Zusatztasten erfolgen.
- BOOL bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? TRUE : FALSE;
+ sal_Bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? sal_True : sal_False;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
// ohne Focus ist das Traveln in einer MultiSelection nicht zu sehen:
@@ -1310,7 +1310,7 @@ void ListBox::EnableMultiSelection( BOOL bMulti, BOOL bStackSelection )
// -----------------------------------------------------------------------
-BOOL ListBox::IsMultiSelectionEnabled() const
+sal_Bool ListBox::IsMultiSelectionEnabled() const
{
return mpImplLB->IsMultiSelectionEnabled();
}
@@ -1407,7 +1407,7 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const
// -----------------------------------------------------------------------
-Size ListBox::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
// ggf. werden ScrollBars eingeblendet
Size aMinSz = CalcMinimumSize();
@@ -1449,19 +1449,19 @@ Size ListBox::CalcSize( USHORT nColumns, USHORT nLines ) const
// -----------------------------------------------------------------------
-void ListBox::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
long nCharWidth = GetTextWidth( UniString( 'x' ) );
if ( !IsDropDownBox() )
{
Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
- rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
- rnLines = (USHORT) (aOutSz.Height()/mpImplLB->GetEntryHeight());
+ rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
+ rnLines = (sal_uInt16) (aOutSz.Height()/mpImplLB->GetEntryHeight());
}
else
{
Size aOutSz = mpImplWin->GetOutputSizePixel();
- rnCols = (USHORT) (aOutSz.Width()/nCharWidth);
+ rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
rnLines = 1;
}
}
@@ -1482,7 +1482,7 @@ void ListBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ListBox::DrawEntry( const UserDrawEvent& rEvt, BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImagePos )
+void ListBox::DrawEntry( const UserDrawEvent& rEvt, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos )
{
if ( rEvt.GetDevice() == mpImplLB->GetMainWindow() )
mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
@@ -1508,7 +1508,7 @@ const Size& ListBox::GetUserItemSize() const
// -----------------------------------------------------------------------
-void ListBox::EnableUserDraw( BOOL bUserDraw )
+void ListBox::EnableUserDraw( sal_Bool bUserDraw )
{
mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
if ( mpImplWin )
@@ -1517,14 +1517,14 @@ void ListBox::EnableUserDraw( BOOL bUserDraw )
// -----------------------------------------------------------------------
-BOOL ListBox::IsUserDrawEnabled() const
+sal_Bool ListBox::IsUserDrawEnabled() const
{
return mpImplLB->GetMainWindow()->IsUserDrawEnabled();
}
// -----------------------------------------------------------------------
-void ListBox::SetReadOnly( BOOL bReadOnly )
+void ListBox::SetReadOnly( sal_Bool bReadOnly )
{
if ( mpImplLB->IsReadOnly() != bReadOnly )
{
@@ -1535,14 +1535,14 @@ void ListBox::SetReadOnly( BOOL bReadOnly )
// -----------------------------------------------------------------------
-BOOL ListBox::IsReadOnly() const
+sal_Bool ListBox::IsReadOnly() const
{
return mpImplLB->IsReadOnly();
}
// -----------------------------------------------------------------------
-void ListBox::SetSeparatorPos( USHORT n )
+void ListBox::SetSeparatorPos( sal_uInt16 n )
{
mpImplLB->SetSeparatorPos( n );
}
@@ -1556,7 +1556,7 @@ void ListBox::SetSeparatorPos()
// -----------------------------------------------------------------------
-USHORT ListBox::GetSeparatorPos() const
+sal_uInt16 ListBox::GetSeparatorPos() const
{
return mpImplLB->GetSeparatorPos();
}
@@ -1577,21 +1577,21 @@ XubString ListBox::GetMRUEntries( xub_Unicode cSep ) const
// -----------------------------------------------------------------------
-void ListBox::SetMaxMRUCount( USHORT n )
+void ListBox::SetMaxMRUCount( sal_uInt16 n )
{
mpImplLB->SetMaxMRUCount( n );
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetMaxMRUCount() const
+sal_uInt16 ListBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
// -----------------------------------------------------------------------
-USHORT ListBox::GetDisplayLineCount() const
+sal_uInt16 ListBox::GetDisplayLineCount() const
{
return mpImplLB->GetDisplayLineCount();
}
@@ -1626,7 +1626,7 @@ MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
ListBox( WINDOW_MULTILISTBOX )
{
ImplInit( pParent, nStyle );
- EnableMultiSelection( TRUE );
+ EnableMultiSelection( sal_True );
}
// -----------------------------------------------------------------------
@@ -1641,7 +1641,7 @@ MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
if ( !(nStyle & WB_HIDE ) )
Show();
- EnableMultiSelection( TRUE );
+ EnableMultiSelection( sal_True );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index f9e994e0a66c..de2613b1084f 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -43,51 +43,36 @@ CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/button.obj \
- $(SLO)$/combobox.obj \
+EXCEPTIONSFILES= \
+ $(SLO)$/button.obj \
$(SLO)$/ctrl.obj \
$(SLO)$/edit.obj \
- $(SLO)$/field.obj \
$(SLO)$/field2.obj \
- $(SLO)$/fixbrd.obj \
- $(SLO)$/fixed.obj \
- $(SLO)$/group.obj \
- $(SLO)$/ilstbox.obj \
- $(SLO)$/imgctrl.obj \
- $(SLO)$/longcurr.obj \
- $(SLO)$/lstbox.obj \
- $(SLO)$/menubtn.obj \
- $(SLO)$/morebtn.obj \
- $(SLO)$/scrbar.obj \
- $(SLO)$/slider.obj \
- $(SLO)$/spinbtn.obj \
- $(SLO)$/spinfld.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/ilstbox.obj \
+ $(SLO)$/tabctrl.obj \
+ $(SLO)$/throbber.obj
-EXCEPTIONSFILES= \
- $(SLO)$/button.obj \
+SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/combobox.obj \
- $(SLO)$/ctrl.obj \
- $(SLO)$/edit.obj \
$(SLO)$/field.obj \
- $(SLO)$/field2.obj \
$(SLO)$/fixbrd.obj \
$(SLO)$/fixed.obj \
$(SLO)$/group.obj \
- $(SLO)$/ilstbox.obj \
$(SLO)$/imgctrl.obj \
$(SLO)$/longcurr.obj \
$(SLO)$/lstbox.obj \
- $(SLO)$/menubtn.obj \
$(SLO)$/morebtn.obj \
+ $(SLO)$/menubtn.obj \
$(SLO)$/scrbar.obj \
$(SLO)$/slider.obj \
- $(SLO)$/spinbtn.obj \
$(SLO)$/spinfld.obj \
- $(SLO)$/tabctrl.obj
+ $(SLO)$/spinbtn.obj \
+ $(SLO)$/quickselectionengine.obj
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.INCLUDE : $(PRJ)$/util$/target.pmk
+
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 74780c805cac..13513f62b719 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -77,19 +77,10 @@ void MenuButton::ImplExecuteMenu()
Point aPos( 0, 1 );
Size aSize = GetSizePixel();
Rectangle aRect( aPos, aSize );
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if ( !((GetStyle() & (WB_RECTSTYLE | WB_SMALLSTYLE)) ||
- !(rStyleSettings.GetOptions() & STYLE_OPTION_MACSTYLE)) )
- {
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
- }
- SetPressed( TRUE );
+ SetPressed( sal_True );
EndSelection();
mnCurItemId = mpMenu->Execute( this, aRect, POPUPMENU_EXECUTE_DOWN );
- SetPressed( FALSE );
+ SetPressed( sal_False );
if ( mnCurItemId )
{
Select();
@@ -128,7 +119,7 @@ void MenuButton::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( RSCMENUBUTTON_MENU & nObjMask )
{
@@ -204,7 +195,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
void MenuButton::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( (nCode == KEY_DOWN) && aKeyCode.IsMod2() )
ImplExecuteMenu();
else if ( !(mnMenuMode & MENUBUTTON_MENUMODE_TIMED) &&
@@ -231,7 +222,7 @@ void MenuButton::Select()
// -----------------------------------------------------------------------
-void MenuButton::SetMenuMode( USHORT nMode )
+void MenuButton::SetMenuMode( sal_uInt16 nMode )
{
// Fuer die 5.1-Auslieferung besser noch nicht inline, ansonsten kann
// diese Funktion zur 6.0 inline werden
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 5d1fbc9c466b..f40bc376d5e0 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -51,7 +51,7 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
mpMBData = new ImplMoreButtonData;
mnDelta = 0;
meUnit = MAP_PIXEL;
- mbState = FALSE;
+ mbState = sal_False;
mpMBData->mpItemList = NULL;
@@ -65,7 +65,7 @@ void MoreButton::ImplInit( Window* pParent, WinBits nStyle )
ShowState();
SetSymbolAlign( SYMBOLALIGN_RIGHT );
- ImplSetSmallSymbol( TRUE );
+ ImplSetSmallSymbol( sal_True );
if ( ! ( nStyle & ( WB_RIGHT | WB_LEFT ) ) )
{
@@ -117,12 +117,12 @@ void MoreButton::ImplLoadRes( const ResId& rResId )
{
PushButton::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( nObjMask & RSC_MOREBUTTON_STATE )
{
// Nicht Methode rufen, da Dialog nicht umgeschaltet werden soll
- mbState = (BOOL)ReadShortRes();
+ mbState = (sal_Bool)ReadShortRes();
// SetText( GetText() );
ShowState();
}
diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx
new file mode 100644
index 000000000000..2d32393bf79a
--- /dev/null
+++ b/vcl/source/control/quickselectionengine.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "vcl/quickselectionengine.hxx"
+#include "vcl/event.hxx"
+#include "vcl/timer.hxx"
+#include "vcl/i18nhelp.hxx"
+#include "vcl/svapp.hxx"
+
+#include <boost/optional.hpp>
+
+//........................................................................
+namespace vcl
+{
+//........................................................................
+
+ //====================================================================
+ //= QuickSelectionEngine_Data
+ //====================================================================
+ struct QuickSelectionEngine_Data
+ {
+ ISearchableStringList& rEntryList;
+ String sCurrentSearchString;
+ ::boost::optional< sal_Unicode > aSingleSearchChar;
+ Timer aSearchTimeout;
+
+ QuickSelectionEngine_Data( ISearchableStringList& _entryList )
+ :rEntryList( _entryList )
+ ,sCurrentSearchString()
+ ,aSingleSearchChar()
+ ,aSearchTimeout()
+ {
+ aSearchTimeout.SetTimeout( 2500 );
+ aSearchTimeout.SetTimeoutHdl( LINK( this, QuickSelectionEngine_Data, SearchStringTimeout ) );
+ }
+
+ ~QuickSelectionEngine_Data()
+ {
+ aSearchTimeout.Stop();
+ }
+
+ DECL_LINK( SearchStringTimeout, Timer* );
+ };
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ static void lcl_reset( QuickSelectionEngine_Data& _data )
+ {
+ _data.sCurrentSearchString.Erase();
+ _data.aSingleSearchChar.reset();
+ _data.aSearchTimeout.Stop();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ )
+ {
+ lcl_reset( *this );
+ return 1;
+ }
+
+ //--------------------------------------------------------------------
+ static StringEntryIdentifier findMatchingEntry( const String& _searchString, QuickSelectionEngine_Data& _engineData )
+ {
+ const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
+ // TODO: do we really need the Window's settings here? The original code used it ...
+
+ String sEntryText;
+ // get the "current + 1" entry
+ StringEntryIdentifier pSearchEntry = _engineData.rEntryList.CurrentEntry( sEntryText );
+ if ( pSearchEntry )
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ // loop 'til we find another matching entry
+ StringEntryIdentifier pStartedWith = pSearchEntry;
+ while ( pSearchEntry )
+ {
+ if ( rI18nHelper.MatchString( _searchString, sEntryText ) != 0 )
+ break;
+
+ pSearchEntry = _engineData.rEntryList.NextEntry( pSearchEntry, sEntryText );
+ if ( pSearchEntry == pStartedWith )
+ pSearchEntry = NULL;
+ }
+
+ return pSearchEntry;
+ }
+
+ //====================================================================
+ //= QuickSelectionEngine
+ //====================================================================
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList )
+ :m_pData( new QuickSelectionEngine_Data( _entryList ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ QuickSelectionEngine::~QuickSelectionEngine()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent )
+ {
+ xub_Unicode c = _keyEvent.GetCharCode();
+
+ if ( ( c >= 32 ) && ( c != 127 ) && !_keyEvent.GetKeyCode().IsMod2() )
+ {
+ m_pData->sCurrentSearchString += c;
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", ByteString( m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+
+ if ( m_pData->sCurrentSearchString.Len() == 1 )
+ { // first character in the search -> remmeber
+ m_pData->aSingleSearchChar.reset( c );
+ }
+ else if ( m_pData->sCurrentSearchString.Len() > 1 )
+ {
+ if ( !!m_pData->aSingleSearchChar && ( *m_pData->aSingleSearchChar != c ) )
+ // we already have a "single char", but the current one is different -> reset
+ m_pData->aSingleSearchChar.reset();
+ }
+
+ XubString aSearchTemp( m_pData->sCurrentSearchString );
+
+ StringEntryIdentifier pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: found %p", pMatchingEntry );
+ if ( !pMatchingEntry && ( aSearchTemp.Len() > 1 ) && !!m_pData->aSingleSearchChar )
+ {
+ // if there's only one letter in the search string, use a different search mode
+ aSearchTemp = *m_pData->aSingleSearchChar;
+ pMatchingEntry = findMatchingEntry( aSearchTemp, *m_pData );
+ }
+
+ if ( pMatchingEntry )
+ {
+ m_pData->rEntryList.SelectEntry( pMatchingEntry );
+ m_pData->aSearchTimeout.Start();
+ }
+ else
+ {
+ lcl_reset( *m_pData );
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------
+ void QuickSelectionEngine::Reset()
+ {
+ lcl_reset( *m_pData );
+ }
+
+//........................................................................
+} // namespace vcl
+//........................................................................
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 6ce752d35c4b..938b7831985c 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -70,30 +70,30 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#define SCRBAR_DRAW_BTN1 ((USHORT)0x0001)
-#define SCRBAR_DRAW_BTN2 ((USHORT)0x0002)
-#define SCRBAR_DRAW_PAGE1 ((USHORT)0x0004)
-#define SCRBAR_DRAW_PAGE2 ((USHORT)0x0008)
-#define SCRBAR_DRAW_THUMB ((USHORT)0x0010)
-#define SCRBAR_DRAW_BACKGROUND ((USHORT)0x0020)
+#define SCRBAR_DRAW_BTN1 ((sal_uInt16)0x0001)
+#define SCRBAR_DRAW_BTN2 ((sal_uInt16)0x0002)
+#define SCRBAR_DRAW_PAGE1 ((sal_uInt16)0x0004)
+#define SCRBAR_DRAW_PAGE2 ((sal_uInt16)0x0008)
+#define SCRBAR_DRAW_THUMB ((sal_uInt16)0x0010)
+#define SCRBAR_DRAW_BACKGROUND ((sal_uInt16)0x0020)
#define SCRBAR_DRAW_ALL (SCRBAR_DRAW_BTN1 | SCRBAR_DRAW_BTN2 | \
SCRBAR_DRAW_PAGE1 | SCRBAR_DRAW_PAGE2 |\
SCRBAR_DRAW_THUMB | SCRBAR_DRAW_BACKGROUND )
-#define SCRBAR_STATE_BTN1_DOWN ((USHORT)0x0001)
-#define SCRBAR_STATE_BTN1_DISABLE ((USHORT)0x0002)
-#define SCRBAR_STATE_BTN2_DOWN ((USHORT)0x0004)
-#define SCRBAR_STATE_BTN2_DISABLE ((USHORT)0x0008)
-#define SCRBAR_STATE_PAGE1_DOWN ((USHORT)0x0010)
-#define SCRBAR_STATE_PAGE2_DOWN ((USHORT)0x0020)
-#define SCRBAR_STATE_THUMB_DOWN ((USHORT)0x0040)
+#define SCRBAR_STATE_BTN1_DOWN ((sal_uInt16)0x0001)
+#define SCRBAR_STATE_BTN1_DISABLE ((sal_uInt16)0x0002)
+#define SCRBAR_STATE_BTN2_DOWN ((sal_uInt16)0x0004)
+#define SCRBAR_STATE_BTN2_DISABLE ((sal_uInt16)0x0008)
+#define SCRBAR_STATE_PAGE1_DOWN ((sal_uInt16)0x0010)
+#define SCRBAR_STATE_PAGE2_DOWN ((sal_uInt16)0x0020)
+#define SCRBAR_STATE_THUMB_DOWN ((sal_uInt16)0x0040)
#define SCRBAR_VIEW_STYLE (WB_3DLOOK | WB_HORZ | WB_VERT)
struct ImplScrollBarData
{
AutoTimer maTimer; // Timer
- BOOL mbHide;
+ sal_Bool mbHide;
Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic
};
@@ -116,14 +116,14 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
mnStateFlags = 0;
meScrollType = SCROLL_DONTKNOW;
meDDScrollType = SCROLL_DONTKNOW;
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
mbFullDrag = 0;
if( !mpData ) // TODO: remove when maTrackRect is no longer in mpData
{
mpData = new ImplScrollBarData;
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
- mpData->mbHide = FALSE;
+ mpData->mbHide = sal_False;
}
ImplInitStyle( nStyle );
@@ -139,7 +139,7 @@ void ScrollBar::ImplInit( Window* pParent, WinBits nStyle )
void ScrollBar::ImplInitStyle( WinBits nStyle )
{
if ( nStyle & WB_DRAG )
- mbFullDrag = TRUE;
+ mbFullDrag = sal_True;
else
mbFullDrag = (GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_SCROLL) != 0;
}
@@ -180,12 +180,12 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- INT16 nMin = ReadShortRes();
- INT16 nMax = ReadShortRes();
- INT16 nThumbPos = ReadShortRes();
- INT16 nPage = ReadShortRes();
- INT16 nStep = ReadShortRes();
- INT16 nVisibleSize = ReadShortRes();
+ sal_Int16 nMin = ReadShortRes();
+ sal_Int16 nMax = ReadShortRes();
+ sal_Int16 nThumbPos = ReadShortRes();
+ sal_Int16 nPage = ReadShortRes();
+ sal_Int16 nStep = ReadShortRes();
+ sal_Int16 nVisibleSize = ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -196,9 +196,9 @@ void ScrollBar::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
-void ScrollBar::ImplUpdateRects( BOOL bUpdate )
+void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
{
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
Rectangle aOldPage1Rect = maPage1Rect;
Rectangle aOldPage2Rect = maPage2Rect;
Rectangle aOldThumbRect = maThumbRect;
@@ -280,7 +280,7 @@ void ScrollBar::ImplUpdateRects( BOOL bUpdate )
if ( bUpdate )
{
- USHORT nDraw = 0;
+ sal_uInt16 nDraw = 0;
if ( (nOldStateFlags & SCRBAR_STATE_BTN1_DISABLE) !=
(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) )
nDraw |= SCRBAR_DRAW_BTN1;
@@ -333,7 +333,7 @@ long ScrollBar::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void ScrollBar::ImplCalc( BOOL bUpdate )
+void ScrollBar::ImplCalc( sal_Bool bUpdate )
{
const Size aSize = GetOutputSizePixel();
const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize();;
@@ -430,7 +430,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( !mnThumbPixRange )
maThumbRect.SetEmpty();
- mbCalcSize = FALSE;
+ mbCalcSize = sal_False;
}
if ( mnThumbPixRange )
@@ -468,14 +468,14 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( bUpdate && HasPaintEvent() )
{
Invalidate();
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -504,7 +504,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
// -force recalculate
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
maBtn1Rect+=aPos;
maBtn2Rect+=aPos;
@@ -516,19 +516,19 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
ImplDraw( SCRBAR_DRAW_ALL, pDev );
pDev->Pop();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
}
// -----------------------------------------------------------------------
-BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
+sal_Bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
{
ScrollbarValue scrValue;
- BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
+ sal_Bool bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
if( bNativeOK )
{
- BOOL bHorz = (GetStyle() & WB_HORZ ? true : false);
+ sal_Bool bHorz = (GetStyle() & WB_HORZ ? true : false);
// Draw the entire background if the control supports it
if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) )
@@ -682,18 +682,18 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
return bNativeOK;
}
-void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
+void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
{
DecorationView aDecoView( pOutDev );
Rectangle aTempRect;
- USHORT nStyle;
+ sal_uInt16 nStyle;
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
SymbolType eSymbolType;
- BOOL bEnabled = IsEnabled();
+ sal_Bool bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Window *pWin = NULL;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
@@ -769,64 +769,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
if ( bEnabled )
{
nStyle = BUTTON_DRAW_NOLIGHTBORDER;
- // pressed thumbs only in OS2 style
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
- nStyle |= BUTTON_DRAW_PRESSED;
aTempRect = aDecoView.DrawButton( maThumbRect, nStyle );
- // OS2 style requires pattern on the thumb
- if ( rStyleSettings.GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- if ( GetStyle() & WB_HORZ )
- {
- if ( aTempRect.GetWidth() > 6 )
- {
- long nX = aTempRect.Center().X();
- nX -= 6;
- if ( nX < aTempRect.Left() )
- nX = aTempRect.Left();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nX > aTempRect.Right()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( nX, aTempRect.Top()+1 ),
- Point( nX, aTempRect.Bottom()-1 ) );
- nX++;
- }
- }
- }
- else
- {
- if ( aTempRect.GetHeight() > 6 )
- {
- long nY = aTempRect.Center().Y();
- nY -= 6;
- if ( nY < aTempRect.Top() )
- nY = aTempRect.Top();
- for ( int i = 0; i < 6; i++ )
- {
- if ( nY > aTempRect.Bottom()-1 )
- break;
-
- pOutDev->SetLineColor( rStyleSettings.GetButtonTextColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- pOutDev->SetLineColor( rStyleSettings.GetLightColor() );
- pOutDev->DrawLine( Point( aTempRect.Left()+1, nY ),
- Point( aTempRect.Right()-1, nY ) );
- nY++;
- }
- }
- }
- pOutDev->SetLineColor();
- }
}
else
{
@@ -856,7 +799,7 @@ void ScrollBar::ImplDraw( USHORT nDrawFlags, OutputDevice* pOutDev )
// -----------------------------------------------------------------------
-long ScrollBar::ImplScroll( long nNewPos, BOOL bCallEndScroll )
+long ScrollBar::ImplScroll( long nNewPos, sal_Bool bCallEndScroll )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -874,7 +817,7 @@ long ScrollBar::ImplScroll( long nNewPos, BOOL bCallEndScroll )
// -----------------------------------------------------------------------
-long ScrollBar::ImplDoAction( BOOL bCallEndScroll )
+long ScrollBar::ImplDoAction( sal_Bool bCallEndScroll )
{
long nDelta = 0;
@@ -904,12 +847,12 @@ long ScrollBar::ImplDoAction( BOOL bCallEndScroll )
// -----------------------------------------------------------------------
-void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
+void ScrollBar::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
{
- USHORT nOldStateFlags = mnStateFlags;
- BOOL bAction = FALSE;
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
+ sal_Bool bAction = sal_False;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -976,7 +919,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
if ( nOldStateFlags != mnStateFlags )
ImplDraw( mnDragDraw, this );
if ( bAction )
- ImplDoAction( FALSE );
+ ImplDoAction( sal_False );
}
// -----------------------------------------------------------------------
@@ -1016,10 +959,10 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() || rMEvt.IsMiddle() )
{
const Point& rMousePos = rMEvt.GetPosPixel();
- USHORT nTrackFlags = 0;
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
- BOOL bDragToMouse = FALSE;
+ sal_uInt16 nTrackFlags = 0;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
+ sal_Bool bDragToMouse = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1062,7 +1005,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if( mpData )
{
- mpData->mbHide = TRUE; // disable focus blinking
+ mpData->mbHide = sal_True; // disable focus blinking
if( HasFocus() )
ImplDraw( SCRBAR_DRAW_THUMB, this ); // paint without focus
}
@@ -1076,7 +1019,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
// calculate mouse offset
if( rMEvt.IsMiddle() || (ImplGetSVData()->maNWFData.mbScrollbarJumpPage && !bThumbHit) )
{
- bDragToMouse = TRUE;
+ bDragToMouse = sal_True;
if ( GetStyle() & WB_HORZ )
mnMouseOff = maThumbRect.GetWidth()/2;
else
@@ -1098,7 +1041,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
aControlRegion, rMousePos, bIsInside )?
- bIsInside : TRUE )
+ bIsInside : sal_True )
{
nTrackFlags = STARTTRACK_BUTTONREPEAT;
@@ -1143,7 +1086,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SCRBAR_STATE_BTN1_DOWN | SCRBAR_STATE_BTN2_DOWN |
SCRBAR_STATE_PAGE1_DOWN | SCRBAR_STATE_PAGE2_DOWN |
SCRBAR_STATE_THUMB_DOWN);
@@ -1180,7 +1123,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
meScrollType = SCROLL_DONTKNOW;
if( mpData )
- mpData->mbHide = FALSE; // re-enable focus blinking
+ mpData->mbHide = sal_False; // re-enable focus blinking
}
else
{
@@ -1254,9 +1197,9 @@ void ScrollBar::Paint( const Rectangle& )
void ScrollBar::Resize()
{
Control::Resize();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
if ( IsReallyVisible() )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
@@ -1295,7 +1238,7 @@ void ScrollBar::GetFocus()
{
mpData = new ImplScrollBarData;
mpData->maTimer.SetTimeoutHdl( LINK( this, ScrollBar, ImplAutoTimerHdl ) );
- mpData->mbHide = FALSE;
+ mpData->mbHide = sal_False;
}
ImplInvert(); // react immediately
mpData->maTimer.SetTimeout( GetSettings().GetStyleSettings().GetCursorBlinkTime() );
@@ -1321,17 +1264,17 @@ void ScrollBar::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( TRUE );
+ ImplCalc( sal_True );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1348,8 +1291,8 @@ void ScrollBar::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SCRBAR_VIEW_STYLE) !=
(GetStyle() & SCRBAR_VIEW_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1365,8 +1308,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -1375,8 +1318,8 @@ void ScrollBar::DataChanged( const DataChangedEvent& rDCEvt )
Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
{
- BOOL bHorizontal = ( GetStyle() & WB_HORZ )? TRUE: FALSE;
- BOOL bIsInside = FALSE;
+ sal_Bool bHorizontal = ( GetStyle() & WB_HORZ )? sal_True: sal_False;
+ sal_Bool bIsInside = sal_False;
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
@@ -1438,7 +1381,7 @@ long ScrollBar::PreNotify( NotifyEvent& rNEvt )
aClipRegion.Union( *pLastRect );
// Support for 3-button scroll bars
- BOOL bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
+ sal_Bool bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS );
if ( bHas3Buttons && ( pRect == &maBtn1Rect || pLastRect == &maBtn1Rect ) )
{
aClipRegion.Union( maBtn2Rect );
@@ -1478,7 +1421,7 @@ long ScrollBar::DoScroll( long nNewPos )
return 0;
meScrollType = SCROLL_DRAG;
- long nDelta = ImplScroll( nNewPos, TRUE );
+ long nDelta = ImplScroll( nNewPos, sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -1493,7 +1436,7 @@ long ScrollBar::DoScrollAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( TRUE );
+ long nDelta = ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 6d3c813dbe59..71eeeae665d4 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -46,15 +46,15 @@ static long ImplMulDiv( long nNumber, long nNumerator, long nDenominator )
// =======================================================================
-#define SLIDER_DRAW_THUMB ((USHORT)0x0001)
-#define SLIDER_DRAW_CHANNEL1 ((USHORT)0x0002)
-#define SLIDER_DRAW_CHANNEL2 ((USHORT)0x0004)
+#define SLIDER_DRAW_THUMB ((sal_uInt16)0x0001)
+#define SLIDER_DRAW_CHANNEL1 ((sal_uInt16)0x0002)
+#define SLIDER_DRAW_CHANNEL2 ((sal_uInt16)0x0004)
#define SLIDER_DRAW_CHANNEL (SLIDER_DRAW_CHANNEL1 | SLIDER_DRAW_CHANNEL2)
#define SLIDER_DRAW_ALL (SLIDER_DRAW_THUMB | SLIDER_DRAW_CHANNEL)
-#define SLIDER_STATE_CHANNEL1_DOWN ((USHORT)0x0001)
-#define SLIDER_STATE_CHANNEL2_DOWN ((USHORT)0x0002)
-#define SLIDER_STATE_THUMB_DOWN ((USHORT)0x0004)
+#define SLIDER_STATE_CHANNEL1_DOWN ((sal_uInt16)0x0001)
+#define SLIDER_STATE_CHANNEL2_DOWN ((sal_uInt16)0x0002)
+#define SLIDER_STATE_THUMB_DOWN ((sal_uInt16)0x0004)
#define SLIDER_THUMB_SIZE 9
#define SLIDER_THUMB_HALFSIZE 4
@@ -87,8 +87,8 @@ void Slider::ImplInit( Window* pParent, WinBits nStyle )
mnDragDraw = 0;
mnStateFlags = 0;
meScrollType = SCROLL_DONTKNOW;
- mbCalcSize = TRUE;
- mbFullDrag = TRUE;
+ mbCalcSize = sal_True;
+ mbFullDrag = sal_True;
Control::ImplInit( pParent, nStyle, NULL );
@@ -124,12 +124,12 @@ void Slider::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- INT16 nMin = ReadShortRes();
- INT16 nMax = ReadShortRes();
- INT16 nThumbPos = ReadShortRes();
- INT16 nPage = ReadShortRes();
- INT16 nStep = ReadShortRes();
- /* INT16 nVisibleSize = */ ReadShortRes();
+ sal_Int16 nMin = ReadShortRes();
+ sal_Int16 nMax = ReadShortRes();
+ sal_Int16 nThumbPos = ReadShortRes();
+ sal_Int16 nPage = ReadShortRes();
+ sal_Int16 nStep = ReadShortRes();
+ /* sal_Int16 nVisibleSize = */ ReadShortRes();
SetRange( Range( nMin, nMax ) );
SetLineSize( nStep );
@@ -144,16 +144,16 @@ void Slider::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -164,7 +164,7 @@ void Slider::ImplInitSettings()
// -----------------------------------------------------------------------
-void Slider::ImplUpdateRects( BOOL bUpdate )
+void Slider::ImplUpdateRects( sal_Bool bUpdate )
{
Rectangle aOldThumbRect = maThumbRect;
bool bInvalidateAll = false;
@@ -302,9 +302,9 @@ long Slider::ImplCalcThumbPosPix( long nPos )
// -----------------------------------------------------------------------
-void Slider::ImplCalc( BOOL bUpdate )
+void Slider::ImplCalc( sal_Bool bUpdate )
{
- BOOL bInvalidateAll = FALSE;
+ sal_Bool bInvalidateAll = sal_False;
if ( mbCalcSize )
{
@@ -355,9 +355,9 @@ void Slider::ImplCalc( BOOL bUpdate )
(nOldChannelPixRange != mnChannelPixRange) ||
(nOldChannelPixTop != mnChannelPixTop) ||
(nOldChannelPixBottom != mnChannelPixBottom) )
- bInvalidateAll = TRUE;
+ bInvalidateAll = sal_True;
- mbCalcSize = FALSE;
+ mbCalcSize = sal_False;
}
if ( mnThumbPixRange )
@@ -366,23 +366,23 @@ void Slider::ImplCalc( BOOL bUpdate )
if ( bUpdate && bInvalidateAll )
{
Invalidate();
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
ImplUpdateRects( bUpdate );
}
// -----------------------------------------------------------------------
-void Slider::ImplDraw( USHORT nDrawFlags )
+void Slider::ImplDraw( sal_uInt16 nDrawFlags )
{
DecorationView aDecoView( this );
- USHORT nStyle;
+ sal_uInt16 nStyle;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bEnabled = IsEnabled();
+ sal_Bool bEnabled = IsEnabled();
// Evt. noch offene Berechnungen nachholen
if ( mbCalcSize )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA;
ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
@@ -513,7 +513,7 @@ void Slider::ImplDraw( USHORT nDrawFlags )
// -----------------------------------------------------------------------
-BOOL Slider::ImplIsPageUp( const Point& rPos )
+sal_Bool Slider::ImplIsPageUp( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel1Rect;
@@ -532,7 +532,7 @@ BOOL Slider::ImplIsPageUp( const Point& rPos )
// -----------------------------------------------------------------------
-BOOL Slider::ImplIsPageDown( const Point& rPos )
+sal_Bool Slider::ImplIsPageDown( const Point& rPos )
{
Size aSize = GetOutputSizePixel();
Rectangle aRect = maChannel2Rect;
@@ -551,7 +551,7 @@ BOOL Slider::ImplIsPageDown( const Point& rPos )
// -----------------------------------------------------------------------
-long Slider::ImplSlide( long nNewPos, BOOL bCallEndSlide )
+long Slider::ImplSlide( long nNewPos, sal_Bool bCallEndSlide )
{
long nOldPos = mnThumbPos;
SetThumbPos( nNewPos );
@@ -569,7 +569,7 @@ long Slider::ImplSlide( long nNewPos, BOOL bCallEndSlide )
// -----------------------------------------------------------------------
-long Slider::ImplDoAction( BOOL bCallEndSlide )
+long Slider::ImplDoAction( sal_Bool bCallEndSlide )
{
long nDelta = 0;
@@ -603,10 +603,10 @@ long Slider::ImplDoAction( BOOL bCallEndSlide )
// -----------------------------------------------------------------------
-void Slider::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
+void Slider::ImplDoMouseAction( const Point& rMousePos, sal_Bool bCallAction )
{
- USHORT nOldStateFlags = mnStateFlags;
- BOOL bAction = FALSE;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
+ sal_Bool bAction = sal_False;
switch ( meScrollType )
{
@@ -649,7 +649,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
if ( bAction )
{
- if ( ImplDoAction( FALSE ) )
+ if ( ImplDoAction( sal_False ) )
{
// Update the channel complete
if ( mnDragDraw & SLIDER_DRAW_CHANNEL )
@@ -671,7 +671,7 @@ long Slider::ImplDoSlide( long nNewPos )
return 0;
meScrollType = SCROLL_DRAG;
- long nDelta = ImplSlide( nNewPos, TRUE );
+ long nDelta = ImplSlide( nNewPos, sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -686,7 +686,7 @@ long Slider::ImplDoSlideAction( ScrollType eScrollType )
return 0;
meScrollType = eScrollType;
- long nDelta = ImplDoAction( TRUE );
+ long nDelta = ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
return nDelta;
}
@@ -698,7 +698,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() )
{
const Point& rMousePos = rMEvt.GetPosPixel();
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
if ( maThumbRect.IsInside( rMousePos ) )
{
@@ -712,13 +712,6 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt )
mnMouseOff = rMousePos.X()-aCenterPos.X();
else
mnMouseOff = rMousePos.Y()-aCenterPos.Y();
-
- // Im OS2-Look geben wir den Thumb gedrueckt aus
- if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_OS2STYLE )
- {
- mnStateFlags |= SLIDER_STATE_THUMB_DOWN;
- ImplDraw( SLIDER_DRAW_THUMB );
- }
}
else if ( ImplIsPageUp( rMousePos ) )
{
@@ -766,7 +759,7 @@ void Slider::MouseButtonUp( const MouseEvent& )
if( SCROLL_SET == meScrollType )
{
// Button und PageRect-Status wieder herstellen
- const USHORT nOldStateFlags = mnStateFlags;
+ const sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN | SLIDER_STATE_THUMB_DOWN );
@@ -774,7 +767,7 @@ void Slider::MouseButtonUp( const MouseEvent& )
ImplDraw( mnDragDraw );
mnDragDraw = 0;
- ImplDoAction( TRUE );
+ ImplDoAction( sal_True );
meScrollType = SCROLL_DONTKNOW;
}
}
@@ -786,7 +779,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingEnded() )
{
// Button und PageRect-Status wieder herstellen
- USHORT nOldStateFlags = mnStateFlags;
+ sal_uInt16 nOldStateFlags = mnStateFlags;
mnStateFlags &= ~(SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN |
SLIDER_STATE_THUMB_DOWN);
if ( nOldStateFlags != mnStateFlags )
@@ -923,9 +916,9 @@ void Slider::Paint( const Rectangle& )
void Slider::Resize()
{
Control::Resize();
- mbCalcSize = TRUE;
+ mbCalcSize = sal_True;
if ( IsReallyVisible() )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
@@ -943,17 +936,17 @@ void Slider::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
else if ( nType == STATE_CHANGE_DATA )
{
if ( IsReallyVisible() && IsUpdateMode() )
- ImplCalc( TRUE );
+ ImplCalc( sal_True );
}
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
{
- ImplCalc( FALSE );
+ ImplCalc( sal_False );
Invalidate();
}
}
@@ -969,8 +962,8 @@ void Slider::StateChanged( StateChangedType nType )
if ( (GetPrevStyle() & SLIDER_VIEW_STYLE) !=
(GetStyle() & SLIDER_VIEW_STYLE) )
{
- mbCalcSize = TRUE;
- ImplCalc( FALSE );
+ mbCalcSize = sal_True;
+ ImplCalc( sal_False );
Invalidate();
}
}
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 21938dfad0e5..50265e911f80 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -37,10 +37,10 @@
void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
{
- mbUpperIn = FALSE;
- mbLowerIn = FALSE;
- mbInitialUp = FALSE;
- mbInitialDown = FALSE;
+ mbUpperIn = sal_False;
+ mbLowerIn = sal_False;
+ mbInitialUp = sal_False;
+ mbInitialDown = sal_False;
mnMinRange = 0;
mnMaxRange = 100;
@@ -53,9 +53,9 @@ void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
mbRepeat = 0 != ( nStyle & WB_REPEAT );
if ( nStyle & WB_HSCROLL )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
- mbHorz = FALSE;
+ mbHorz = sal_False;
Control::ImplInit( pParent, nStyle, NULL );
}
@@ -64,7 +64,7 @@ void SpinButton::ImplInit( Window* pParent, WinBits nStyle )
SpinButton::SpinButton( Window* pParent, WinBits nStyle )
:Control( WINDOW_SPINBUTTON )
- ,mbUpperIsFocused( FALSE )
+ ,mbUpperIsFocused( sal_False )
{
ImplInit( pParent, nStyle );
}
@@ -73,7 +73,7 @@ SpinButton::SpinButton( Window* pParent, WinBits nStyle )
SpinButton::SpinButton( Window* pParent, const ResId& rResId )
:Control( WINDOW_SPINBUTTON )
- ,mbUpperIsFocused( FALSE )
+ ,mbUpperIsFocused( sal_False )
{
rResId.SetRT( RSC_SPINBUTTON );
ImplInit( pParent, ImplInitRes( rResId ) );
@@ -116,7 +116,7 @@ void SpinButton::Up()
mnValue += mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( TRUE );
+ ImplMoveFocus( sal_True );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_UP, maUpHdlLink, this );
@@ -131,7 +131,7 @@ void SpinButton::Down()
mnValue -= mnValueStep;
StateChanged( STATE_CHANGE_DATA );
- ImplMoveFocus( FALSE );
+ ImplMoveFocus( sal_False );
}
ImplCallEventListenersAndHandler( VCLEVENT_SPINBUTTON_DOWN, maDownHdlLink, this );
@@ -164,7 +164,7 @@ void SpinButton::Resize()
// -----------------------------------------------------------------------
-void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -201,9 +201,9 @@ void SpinButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aUpperRect += aPos;
aLowerRect += aPos;
- ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, FALSE, FALSE,
+ ImplDrawSpinButton( pDev, aUpperRect, aLowerRect, sal_False, sal_False,
IsEnabled() && ImplIsUpperEnabled(),
- IsEnabled() && ImplIsLowerEnabled(), mbHorz, TRUE );
+ IsEnabled() && ImplIsLowerEnabled(), mbHorz, sal_True );
pDev->Pop();
}
@@ -212,10 +212,10 @@ void SpinButton::Paint( const Rectangle& )
{
HideFocus();
- BOOL bEnable = IsEnabled();
+ sal_Bool bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect, mbUpperIn, mbLowerIn,
bEnable && ImplIsUpperEnabled(),
- bEnable && ImplIsLowerEnabled(), mbHorz, TRUE );
+ bEnable && ImplIsLowerEnabled(), mbHorz, sal_True );
if ( HasFocus() )
ShowFocus( maFocusRect );
@@ -227,14 +227,14 @@ void SpinButton::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsUpperEnabled() ) )
{
- mbUpperIn = TRUE;
- mbInitialUp = TRUE;
+ mbUpperIn = sal_True;
+ mbInitialUp = sal_True;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) && ( ImplIsLowerEnabled() ) )
{
- mbLowerIn = TRUE;
- mbInitialDown = TRUE;
+ mbLowerIn = sal_True;
+ mbInitialDown = sal_True;
Invalidate( maLowerRect );
}
@@ -260,20 +260,20 @@ void SpinButton::MouseButtonUp( const MouseEvent& )
if ( mbUpperIn )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
Invalidate( maLowerRect );
Update();
Down();
}
- mbInitialUp = mbInitialDown = FALSE;
+ mbInitialUp = mbInitialDown = sal_False;
}
// -----------------------------------------------------------------------
@@ -286,7 +286,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
if ( !maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
mbUpperIn && mbInitialUp )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
maRepeatTimer.Stop();
Invalidate( maUpperRect );
Update();
@@ -294,7 +294,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( !maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
mbLowerIn & mbInitialDown )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
maRepeatTimer.Stop();
Invalidate( maLowerRect );
Update();
@@ -302,7 +302,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbUpperIn && mbInitialUp )
{
- mbUpperIn = TRUE;
+ mbUpperIn = sal_True;
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maUpperRect );
@@ -311,7 +311,7 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) &&
!mbLowerIn && mbInitialDown )
{
- mbLowerIn = TRUE;
+ mbLowerIn = sal_True;
if ( mbRepeat )
maRepeatTimer.Start();
Invalidate( maLowerRect );
@@ -330,7 +330,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_LEFT:
case KEY_RIGHT:
{
- BOOL bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
+ sal_Bool bUp = KEY_RIGHT == rKEvt.GetKeyCode().GetCode();
if ( mbHorz && !ImplMoveFocus( bUp ) )
bUp ? Up() : Down();
}
@@ -339,7 +339,7 @@ void SpinButton::KeyInput( const KeyEvent& rKEvt )
case KEY_UP:
case KEY_DOWN:
{
- BOOL bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
+ sal_Bool bUp = KEY_UP == rKEvt.GetKeyCode().GetCode();
if ( !mbHorz && !ImplMoveFocus( KEY_UP == rKEvt.GetKeyCode().GetCode() ) )
bUp ? Up() : Down();
}
@@ -371,7 +371,7 @@ void SpinButton::StateChanged( StateChangedType nType )
case STATE_CHANGE_STYLE:
{
- BOOL bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
+ sal_Bool bNewRepeat = 0 != ( GetStyle() & WB_REPEAT );
if ( bNewRepeat != mbRepeat )
{
if ( maRepeatTimer.IsActive() )
@@ -382,7 +382,7 @@ void SpinButton::StateChanged( StateChangedType nType )
mbRepeat = bNewRepeat;
}
- BOOL bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
+ sal_Bool bNewHorz = 0 != ( GetStyle() & WB_HSCROLL );
if ( bNewHorz != mbHorz )
{
mbHorz = bNewHorz;
@@ -471,21 +471,21 @@ void SpinButton::LoseFocus()
// -----------------------------------------------------------------------
-BOOL SpinButton::ImplMoveFocus( BOOL _bUpper )
+sal_Bool SpinButton::ImplMoveFocus( sal_Bool _bUpper )
{
if ( _bUpper == mbUpperIsFocused )
- return FALSE;
+ return sal_False;
HideFocus();
ImplCalcFocusRect( _bUpper );
if ( HasFocus() )
ShowFocus( maFocusRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void SpinButton::ImplCalcFocusRect( BOOL _bUpper )
+void SpinButton::ImplCalcFocusRect( sal_Bool _bUpper )
{
maFocusRect = _bUpper ? maUpperRect : maLowerRect;
// inflate by some pixels
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 1124819af8ab..f9215ab90835 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -41,8 +41,8 @@
void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz,
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz,
SpinbuttonValue& rValue )
{
// convert spinbutton data to a SpinbuttonValue structure for native painting
@@ -81,9 +81,9 @@ void ImplGetSpinbuttonValue( Window *pWin, const Rectangle& rUpperRect,
}
-BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( pWin->IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) &&
// there is just no useful native support for spinfields with dropdown
@@ -132,9 +132,9 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa
return bNativeOK;
}
-BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
+sal_Bool ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbuttonValue )
{
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) )
{
@@ -148,13 +148,13 @@ BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbutton
void ImplDrawSpinButton( OutputDevice* pOutDev,
const Rectangle& rUpperRect,
const Rectangle& rLowerRect,
- BOOL bUpperIn, BOOL bLowerIn,
- BOOL bUpperEnabled, BOOL bLowerEnabled, BOOL bHorz, BOOL bMirrorHorz )
+ sal_Bool bUpperIn, sal_Bool bLowerIn,
+ sal_Bool bUpperEnabled, sal_Bool bLowerEnabled, sal_Bool bHorz, sal_Bool bMirrorHorz )
{
DecorationView aDecoView( pOutDev );
- USHORT nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
- USHORT nSymStyle = 0;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLEFTLIGHTBORDER;
+ sal_uInt16 nSymStyle = 0;
SymbolType eType1, eType2;
@@ -188,11 +188,11 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
}
// Oberen/linken Button malen
- USHORT nTempStyle = nStyle;
+ sal_uInt16 nTempStyle = nStyle;
if ( bUpperIn )
nTempStyle |= BUTTON_DRAW_PRESSED;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
Rectangle aUpRect;
if( pOutDev->GetOutDevType() == OUTDEV_WINDOW )
@@ -298,14 +298,14 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
void SpinField::ImplInitSpinFieldData()
{
mpEdit = NULL;
- mbSpin = FALSE;
- mbRepeat = FALSE;
- mbUpperIn = FALSE;
- mbLowerIn = FALSE;
- mbInitialUp = FALSE;
- mbInitialDown = FALSE;
- mbNoSelect = FALSE;
- mbInDropDown = FALSE;
+ mbSpin = sal_False;
+ mbRepeat = sal_False;
+ mbUpperIn = sal_False;
+ mbLowerIn = sal_False;
+ mbInitialUp = sal_False;
+ mbInitialDown = sal_False;
+ mbNoSelect = sal_False;
+ mbInDropDown = sal_False;
}
// --------------------------------------------------------------------
@@ -316,7 +316,7 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
if ( nWinStyle & (WB_SPIN|WB_DROPDOWN) )
{
- mbSpin = TRUE;
+ mbSpin = sal_True;
// Some themes want external spin buttons, therefore the main
// spinfield should not overdraw the border between its encapsulated
@@ -330,7 +330,7 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
else
mpEdit = new Edit( this, WB_NOBORDER );
- mpEdit->EnableRTL( FALSE );
+ mpEdit->EnableRTL( sal_False );
mpEdit->SetPosPixel( Point() );
mpEdit->Show();
SetSubEdit( mpEdit );
@@ -338,9 +338,9 @@ void SpinField::ImplInit( Window* pParent, WinBits nWinStyle )
maRepeatTimer.SetTimeoutHdl( LINK( this, SpinField, ImplTimeout ) );
maRepeatTimer.SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
if ( nWinStyle & WB_REPEAT )
- mbRepeat = TRUE;
+ mbRepeat = sal_True;
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
}
}
@@ -417,7 +417,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( !HasFocus() && ( !mpEdit || !mpEdit->HasFocus() ) )
{
- mbNoSelect = TRUE;
+ mbNoSelect = sal_True;
GrabFocus();
}
@@ -425,20 +425,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( maUpperRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbUpperIn = TRUE;
- mbInitialUp = TRUE;
+ mbUpperIn = sal_True;
+ mbInitialUp = sal_True;
Invalidate( maUpperRect );
}
else if ( maLowerRect.IsInside( rMEvt.GetPosPixel() ) )
{
- mbLowerIn = TRUE;
- mbInitialDown = TRUE;
+ mbLowerIn = sal_True;
+ mbInitialDown = sal_True;
Invalidate( maLowerRect );
}
else if ( maDropDownRect.IsInside( rMEvt.GetPosPixel() ) )
{
// Rechts daneben liegt der DropDownButton:
- mbInDropDown = ShowDropDown( mbInDropDown ? FALSE : TRUE );
+ mbInDropDown = ShowDropDown( mbInDropDown ? sal_False : sal_True );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
@@ -460,20 +460,20 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt )
void SpinField::MouseButtonUp( const MouseEvent& rMEvt )
{
ReleaseMouse();
- mbInitialUp = mbInitialDown = FALSE;
+ mbInitialUp = mbInitialDown = sal_False;
maRepeatTimer.Stop();
maRepeatTimer.SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() );
if ( mbUpperIn )
{
- mbUpperIn = FALSE;
+ mbUpperIn = sal_False;
Invalidate( maUpperRect );
Update();
Up();
}
else if ( mbLowerIn )
{
- mbLowerIn = FALSE;
+ mbLowerIn = sal_False;
Invalidate( maLowerRect );
Update();
Down();
@@ -490,7 +490,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
{
if ( mbInitialUp )
{
- BOOL bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
+ sal_Bool bNewUpperIn = maUpperRect.IsInside( rMEvt.GetPosPixel() );
if ( bNewUpperIn != mbUpperIn )
{
if ( bNewUpperIn )
@@ -508,7 +508,7 @@ void SpinField::MouseMove( const MouseEvent& rMEvt )
}
else if ( mbInitialDown )
{
- BOOL bNewLowerIn = maLowerRect.IsInside( rMEvt.GetPosPixel() );
+ sal_Bool bNewLowerIn = maLowerRect.IsInside( rMEvt.GetPosPixel() );
if ( bNewLowerIn != mbLowerIn )
{
if ( bNewLowerIn )
@@ -539,7 +539,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
if ( !IsReadOnly() )
{
- USHORT nMod = rKEvt.GetKeyCode().GetModifier();
+ sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier();
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_UP:
@@ -560,7 +560,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
}
else if ( ( nMod == KEY_MOD2 ) && !mbInDropDown && ( GetStyle() & WB_DROPDOWN ) )
{
- mbInDropDown = ShowDropDown( TRUE );
+ mbInDropDown = ShowDropDown( sal_True );
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
nDone = 1;
}
@@ -592,7 +592,7 @@ long SpinField::Notify( NotifyEvent& rNEvt )
{
if ( ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) && !IsReadOnly() )
{
- USHORT nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
+ sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
if ( ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
|| ( ( nWheelBehavior == MOUSE_WHEEL_FOCUS_ONLY )
&& HasChildPathFocus()
@@ -644,7 +644,7 @@ void SpinField::Paint( const Rectangle& rRect )
{
if ( mbSpin )
{
- BOOL bEnable = IsEnabled();
+ sal_Bool bEnable = IsEnabled();
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
mbUpperIn, mbLowerIn, bEnable, bEnable );
}
@@ -653,7 +653,7 @@ void SpinField::Paint( const Rectangle& rRect )
{
DecorationView aView( this );
- USHORT nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
if ( mbInDropDown )
nStyle |= BUTTON_DRAW_PRESSED;
Rectangle aInnerRect = aView.DrawButton( maDropDownRect, nStyle );
@@ -700,7 +700,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
if ( !(aSize.Height() & 0x01) )
nBottom1--;
- BOOL bNativeRegionOK = FALSE;
+ sal_Bool bNativeRegionOK = sal_False;
Rectangle aContentUp, aContentDown;
if ( (pDev->GetOutDevType() == OUTDEV_WINDOW) &&
@@ -839,9 +839,9 @@ void SpinField::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
if ( GetStyle() & WB_REPEAT )
- mbRepeat = TRUE;
+ mbRepeat = sal_True;
else
- mbRepeat = FALSE;
+ mbRepeat = sal_False;
}
else if ( nType == STATE_CHANGE_ZOOM )
{
@@ -854,21 +854,21 @@ void SpinField::StateChanged( StateChangedType nType )
{
if ( mpEdit )
mpEdit->SetControlFont( GetControlFont() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
if ( mpEdit )
mpEdit->SetControlForeground( GetControlForeground() );
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
if ( mpEdit )
mpEdit->SetControlBackground( GetControlBackground() );
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if( nType == STATE_CHANGE_MIRRORING )
@@ -959,15 +959,15 @@ long SpinField::PreNotify( NotifyEvent& rNEvt )
void SpinField::EndDropDown()
{
- mbInDropDown = FALSE;
+ mbInDropDown = sal_False;
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
// -----------------------------------------------------------------------
-BOOL SpinField::ShowDropDown( BOOL )
+sal_Bool SpinField::ShowDropDown( sal_Bool )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -998,7 +998,7 @@ Size SpinField::GetOptimalSize(WindowSizeType eType) const
// -----------------------------------------------------------------------
-Size SpinField::CalcSize( USHORT nChars ) const
+Size SpinField::CalcSize( sal_uInt16 nChars ) const
{
Size aSz = Edit::CalcSize( nChars );
@@ -1031,7 +1031,7 @@ IMPL_LINK( SpinField, ImplTimeout, Timer*, pTimer )
// -----------------------------------------------------------------------
-void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
Edit::Draw( pDev, rPos, rSize, nFlags );
@@ -1072,7 +1072,7 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
if ( GetStyle() & WB_DROPDOWN )
{
DecorationView aView( pDev );
- USHORT nStyle = BUTTON_DRAW_NOLIGHTBORDER;
+ sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER;
Rectangle aInnerRect = aView.DrawButton( aDD, nStyle );
SymbolType eSymbol = SYMBOL_SPIN_DOWN;
if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_SPINUPDOWN )
@@ -1084,7 +1084,7 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
if ( GetStyle() & WB_SPIN )
{
- ImplDrawSpinButton( pDev, aUp, aDown, FALSE, FALSE, TRUE, TRUE );
+ ImplDrawSpinButton( pDev, aUp, aDown, sal_False, sal_False, sal_True, sal_True );
}
pDev->Pop();
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 5658d39cd3eb..bb60e7e5eea9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -43,7 +43,6 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/smartid.hxx"
#include "vcl/window.h"
@@ -54,22 +53,22 @@
struct ImplTabItem
{
- USHORT mnId;
- USHORT mnTabPageResId;
+ sal_uInt16 mnId;
+ sal_uInt16 mnTabPageResId;
TabPage* mpTabPage;
String maText;
String maFormatText;
String maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
- USHORT mnLine;
+ sal_uInt16 mnLine;
bool mbFullVisible;
bool mbEnabled;
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
- mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
+ mnLine( 0 ), mbFullVisible( sal_False ), mbEnabled( true )
{}
};
@@ -77,8 +76,6 @@ struct ImplTabItem
struct ImplTabCtrlData
{
- PushButton* mpLeftBtn;
- PushButton* mpRightBtn;
boost::unordered_map< int, int > maLayoutPageIdToLine;
boost::unordered_map< int, int > maLayoutLineToPageId;
std::vector< Rectangle > maTabRectangles;
@@ -113,9 +110,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
- // no single line tabs since NWF
- nStyle &= ~WB_SINGLELINE;
-
Control::ImplInit( pParent, nStyle, NULL );
mnLastWidth = 0;
@@ -124,23 +118,16 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mnMaxPageWidth = 0;
mnActPageId = 0;
mnCurPageId = 0;
- mnFirstPagePos = 0;
- mnLastFirstPagePos = 0;
- mbFormat = TRUE;
- mbRestoreHelpId = FALSE;
- mbRestoreUnqId = FALSE;
- mbSingleLine = FALSE;
- mbScroll = FALSE;
- mbRestoreSmartId = FALSE;
- mbSmallInvalidate = FALSE;
- mbExtraSpace = FALSE;
+ mbFormat = sal_True;
+ mbRestoreHelpId = sal_False;
+ mbRestoreUnqId = sal_False;
+ mbSmallInvalidate = sal_False;
+ mbExtraSpace = sal_False;
mpTabCtrlData = new ImplTabCtrlData;
- mpTabCtrlData->mpLeftBtn = NULL;
- mpTabCtrlData->mpRightBtn = NULL;
mpTabCtrlData->mpListBox = NULL;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
if( (nStyle & WB_DROPDOWN) )
{
@@ -153,7 +140,7 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
// if the tabcontrol is drawn (ie filled) by a native widget, make sure all contols will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) )
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
if ( pParent->IsDialog() )
pParent->AddChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) );
@@ -186,8 +173,8 @@ WinBits TabControl::ImplInitStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-void TabControl::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void TabControl::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
Control::ImplInitSettings( bFont, bForeground );
@@ -202,17 +189,17 @@ void TabControl::ImplInitSettings( BOOL bFont,
{
// set transparent mode for NWF tabcontrols to have
// the background always cleared properly
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -220,8 +207,6 @@ void TabControl::ImplInitSettings( BOOL bFont,
SetBackground( pParent->GetBackground() );
}
}
-
- ImplScrollBtnsColor();
}
// -----------------------------------------------------------------------
@@ -265,14 +250,14 @@ void TabControl::ImplLoadRes( const ResId& rResId )
{
Control::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( nObjMask & RSC_TABCONTROL_ITEMLIST )
{
- ULONG nEle = ReadLongRes();
+ sal_uLong nEle = ReadLongRes();
// Item hinzufuegen
- for( ULONG i = 0; i < nEle; i++ )
+ for( sal_uLong i = 0; i < nEle; i++ )
{
InsertPage( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -294,17 +279,13 @@ TabControl::~TabControl()
{
if( mpTabCtrlData->mpListBox )
delete mpTabCtrlData->mpListBox;
- if ( mpTabCtrlData->mpLeftBtn )
- delete mpTabCtrlData->mpLeftBtn;
- if ( mpTabCtrlData->mpRightBtn )
- delete mpTabCtrlData->mpRightBtn;
delete mpTabCtrlData;
}
}
// -----------------------------------------------------------------------
-ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
+ImplTabItem* TabControl::ImplGetItem( sal_uInt16 nId ) const
{
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
@@ -318,74 +299,6 @@ ImplTabItem* TabControl::ImplGetItem( USHORT nId ) const
// -----------------------------------------------------------------------
-void TabControl::ImplScrollBtnsColor()
-{
- if ( mpTabCtrlData && mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn->SetControlForeground();
- mpTabCtrlData->mpRightBtn->SetControlForeground();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplSetScrollBtnsState()
-{
- if ( mbScroll )
- {
- mpTabCtrlData->mpLeftBtn->Enable( mnFirstPagePos != 0 );
- mpTabCtrlData->mpRightBtn->Enable( mnFirstPagePos < mnLastFirstPagePos );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::ImplPosScrollBtns()
-{
- if ( mbScroll )
- {
- if ( !mpTabCtrlData->mpLeftBtn )
- {
- mpTabCtrlData->mpLeftBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpLeftBtn->SetSymbol( SYMBOL_PREV );
- mpTabCtrlData->mpLeftBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
- if ( !mpTabCtrlData->mpRightBtn )
- {
- mpTabCtrlData->mpRightBtn = new PushButton( this, WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOPOINTERFOCUS | WB_REPEAT );
- mpTabCtrlData->mpRightBtn->SetSymbol( SYMBOL_NEXT );
- mpTabCtrlData->mpRightBtn->SetClickHdl( LINK( this, TabControl, ImplScrollBtnHdl ) );
- }
-
- Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
- aRect.Left() -= TAB_OFFSET;
- aRect.Top() -= TAB_OFFSET;
- aRect.Right() += TAB_OFFSET;
- aRect.Bottom() += TAB_OFFSET;
- long nX = aRect.Right()-mnBtnSize+1;
- long nY = aRect.Top()-mnBtnSize;
- mpTabCtrlData->mpRightBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- nX -= mnBtnSize;
- mpTabCtrlData->mpLeftBtn->SetPosSizePixel( nX, nY, mnBtnSize, mnBtnSize );
- ImplScrollBtnsColor();
- ImplSetScrollBtnsState();
- mpTabCtrlData->mpLeftBtn->Show();
- mpTabCtrlData->mpRightBtn->Show();
- }
- else
- {
- if ( mpTabCtrlData )
- {
- if ( mpTabCtrlData->mpLeftBtn )
- mpTabCtrlData->mpLeftBtn->Hide();
- if ( mpTabCtrlData->mpRightBtn )
- mpTabCtrlData->mpRightBtn->Hide();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
{
pItem->maFormatText = pItem->maText;
@@ -453,7 +366,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
// -----------------------------------------------------------------------
-Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight )
+Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight )
{
Size aWinSize = Control::GetOutputSizePixel();
if ( nWidth < 0 )
@@ -472,7 +385,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
if ( nItemPos == TAB_PAGERECT )
{
- USHORT nLastPos;
+ sal_uInt16 nLastPos;
if ( mnCurPageId )
nLastPos = GetPagePos( mnCurPageId );
else
@@ -496,9 +409,9 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
{
Font aFont( GetFont() );
Font aLightFont = aFont;
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
- aLightFont.SetTransparent( TRUE );
+ aLightFont.SetTransparent( sal_True );
aLightFont.SetWeight( WEIGHT_LIGHT );
// If Bold and none Bold strings have the same width, we
@@ -518,18 +431,16 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
long nX = nOffsetX;
long nY = nOffsetY;
long nMaxWidth = nWidth;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if ( (mnMaxPageWidth > 0) && (mnMaxPageWidth < nMaxWidth) )
nMaxWidth = mnMaxPageWidth;
nMaxWidth -= GetItemsOffset().X();
- mbScroll = FALSE;
-
- USHORT nLines = 0;
- USHORT nCurLine = 0;
+ sal_uInt16 nLines = 0;
+ sal_uInt16 nCurLine = 0;
long nLineWidthAry[100];
- USHORT nLinePosAry[101];
+ sal_uInt16 nLinePosAry[101];
nLineWidthAry[0] = 0;
nLinePosAry[0] = 0;
@@ -552,10 +463,10 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
Rectangle aNewRect( Point( nX, nY ), aSize );
if ( mbSmallInvalidate && (it->maRect != aNewRect) )
- mbSmallInvalidate = FALSE;
+ mbSmallInvalidate = sal_False;
it->maRect = aNewRect;
it->mnLine = nLines;
- it->mbFullVisible = TRUE;
+ it->mbFullVisible = sal_True;
nLineWidthAry[nLines] += aSize.Width();
nX += aSize.Width();
@@ -571,8 +482,8 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
long nDX = 0;
long nModDX = 0;
long nIDX = 0;
- USHORT i;
- USHORT n;
+ sal_uInt16 i;
+ sal_uInt16 n;
long nLineHeightAry[100];
long nIH = mpTabCtrlData->maItemList[0].maRect.Bottom()-2;
@@ -588,7 +499,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
i = 0;
n = 0;
- nLinePosAry[nLines+1] = (USHORT)mpTabCtrlData->maItemList.size();
+ nLinePosAry[nLines+1] = (sal_uInt16)mpTabCtrlData->maItemList.size();
for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
@@ -649,9 +560,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
mnLastWidth = nWidth;
mnLastHeight = nHeight;
- mbFormat = FALSE;
-
- ImplPosScrollBtns();
+ mbFormat = sal_False;
}
return size_t(nItemPos) < mpTabCtrlData->maItemList.size() ? mpTabCtrlData->maItemList[nItemPos].maRect : Rectangle();
@@ -659,7 +568,7 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
// -----------------------------------------------------------------------
-void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
+void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
{
ImplFreeLayoutData();
@@ -671,7 +580,7 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( IsReallyVisible() && IsUpdateMode() )
{
- USHORT nPos = GetPagePos( nId );
+ sal_uInt16 nPos = GetPagePos( nId );
Rectangle aRect = ImplGetTabRect( nPos );
if ( !pOldItem || (pOldItem->mnLine != pItem->mnLine) )
@@ -703,11 +612,9 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( 0 );
+ pCtrlParent->SetHelpId( rtl::OString() );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( 0 );
- if( mbRestoreSmartId )
- pCtrlParent->SetSmartHelpId( SmartId() );
+ pCtrlParent->SetUniqueId( rtl::OString() );
pOldPage->DeactivatePage();
}
@@ -723,27 +630,22 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId() )
+ if ( !GetHelpId().getLength() )
{
- mbRestoreHelpId = TRUE;
+ mbRestoreHelpId = sal_True;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId() )
+ if ( !pCtrlParent->GetUniqueId().getLength() )
{
- mbRestoreUnqId = TRUE;
+ mbRestoreUnqId = sal_True;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
- if( ! GetSmartHelpId().HasAny() )
- {
- mbRestoreSmartId = TRUE;
- pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
- }
pPage->ActivatePage();
if ( pOldPage && pOldPage->HasChildPathFocus() )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window* pFirstChild = pPage->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus( GETFOCUS_INIT );
@@ -773,7 +675,7 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// -----------------------------------------------------------------------
-BOOL TabControl::ImplPosCurTabPage()
+sal_Bool TabControl::ImplPosCurTabPage()
{
// Aktuelle TabPage resizen/positionieren
ImplTabItem* pItem = ImplGetItem( GetCurPageId() );
@@ -783,21 +685,21 @@ BOOL TabControl::ImplPosCurTabPage()
{
Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
- return TRUE;
+ return sal_True;
}
Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
pItem->mpTabPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void TabControl::ImplActivateTabPage( BOOL bNext )
+void TabControl::ImplActivateTabPage( sal_Bool bNext )
{
- USHORT nCurPos = GetPagePos( GetCurPageId() );
+ sal_uInt16 nCurPos = GetPagePos( GetCurPageId() );
if ( bNext )
nCurPos = (nCurPos + 1) % GetPageCount();
@@ -814,13 +716,6 @@ void TabControl::ImplActivateTabPage( BOOL bNext )
// -----------------------------------------------------------------------
-void TabControl::ImplSetFirstPagePos( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
void TabControl::ImplShowFocus()
{
if ( !GetPageCount() || mpTabCtrlData->mpListBox )
@@ -834,14 +729,14 @@ void TabControl::ImplShowFocus()
aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
- USHORT nCurPos = GetPagePos( mnCurPageId );
+ sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
Rectangle aRect = ImplGetTabRect( nCurPos );
const ImplTabItem& rItem = mpTabCtrlData->maItemList[ nCurPos ];
Size aTabSize = aRect.GetSize();
Size aImageSize( 0, 0 );
long nTextHeight = GetTextHeight();
long nTextWidth = GetCtrlTextWidth( rItem.maFormatText );
- USHORT nOff;
+ sal_uInt16 nOff;
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -903,13 +798,13 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
Rectangle aRect = pItem->maRect;
long nLeftBottom = aRect.Bottom();
long nRightBottom = aRect.Bottom();
- BOOL bLeftBorder = TRUE;
- BOOL bRightBorder = TRUE;
- USHORT nOff;
- BOOL bNativeOK = FALSE;
+ sal_Bool bLeftBorder = sal_True;
+ sal_Bool bRightBorder = sal_True;
+ sal_uInt16 nOff;
+ sal_Bool bNativeOK = sal_False;
- USHORT nOff2 = 0;
- USHORT nOff3 = 0;
+ sal_uInt16 nOff2 = 0;
+ sal_uInt16 nOff3 = 0;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
nOff = 1;
@@ -931,10 +826,10 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
{
aLeftTestPos.X() -= 2;
if ( rCurRect.IsInside( aLeftTestPos ) )
- bLeftBorder = FALSE;
+ bLeftBorder = sal_False;
aRightTestPos.X() += 2;
if ( rCurRect.IsInside( aRightTestPos ) )
- bRightBorder = FALSE;
+ bRightBorder = sal_False;
}
else
{
@@ -945,7 +840,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
}
}
- if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == TRUE )
+ if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == sal_True )
{
Rectangle aCtrlRegion( pItem->maRect );
ControlState nState = 0;
@@ -1044,7 +939,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
// set font accordingly, current item is painted bold
// we set the font attributes always before drawing to be re-entrant (DrawNativeControl may trigger additional paints)
Font aFont( GetFont() );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
aFont.SetWeight( ((bIsCurrentItem) && (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus)) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
@@ -1062,7 +957,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
long nYPos = aRect.Top()+((aTabSize.Height()-nTextHeight)/2)-nOff3;
if( pItem->maFormatText.Len() )
{
- USHORT nStyle = TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC;
if( ! pItem->mbEnabled )
nStyle |= TEXT_DRAW_DISABLE;
DrawCtrlText( Point( nXPos + aImageSize.Width(), nYPos ),
@@ -1091,7 +986,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKeyEvent.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( aKeyCode.IsMod1() )
{
@@ -1099,7 +994,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEUP) )
{
- ImplActivateTabPage( FALSE );
+ ImplActivateTabPage( sal_False );
nRet = 1;
}
}
@@ -1107,7 +1002,7 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
{
if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEDOWN) )
{
- ImplActivateTabPage( TRUE );
+ ImplActivateTabPage( sal_True );
nRet = 1;
}
}
@@ -1120,14 +1015,6 @@ long TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent )
// -----------------------------------------------------------------------
-IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG )
-{
- ImplSetScrollBtnsState();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
{
SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) );
@@ -1160,7 +1047,7 @@ void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
{
if( rMEvt.IsLeft() )
{
- USHORT nPageId = GetPageId( rMEvt.GetPosPixel() );
+ sal_uInt16 nPageId = GetPageId( rMEvt.GetPosPixel() );
ImplTabItem* pItem = ImplGetItem( nPageId );
if( pItem && pItem->mbEnabled )
SelectTabPage( nPageId );
@@ -1177,11 +1064,11 @@ void TabControl::KeyInput( const KeyEvent& rKEvt )
else if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_LEFT) || (nKeyCode == KEY_RIGHT) )
{
- BOOL bNext = (nKeyCode == KEY_RIGHT);
+ sal_Bool bNext = (nKeyCode == KEY_RIGHT);
ImplActivateTabPage( bNext );
}
}
@@ -1231,17 +1118,17 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
// increased to avoid round corners that might be drawn by a theme
// in this case we're only interested in the top border of the tabpage because the tabitems are used
// standalone (eg impress)
- BOOL bNoTabPage = FALSE;
+ sal_Bool bNoTabPage = sal_False;
TabPage* pCurPage = (pCurItem) ? pCurItem->mpTabPage : NULL;
if( !pCurPage || !pCurPage->IsVisible() )
{
- bNoTabPage = TRUE;
+ bNoTabPage = sal_True;
aRect.Left()-=10;
aRect.Right()+=10;
}
- BOOL bNativeOK = FALSE;
- if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == TRUE )
+ sal_Bool bNativeOK = sal_False;
+ if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == sal_True )
{
const ImplControlValue aControlValue;
@@ -1352,7 +1239,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
if( !rRect.IsEmpty() )
aClipRgn.Intersect( rRect );
if( bLayout || !aClipRgn.IsEmpty() )
- ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), FALSE );
+ ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), sal_False );
}
if ( bDrawTabsRTL )
@@ -1368,7 +1255,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
if( !rRect.IsEmpty() )
aClipRgn.Intersect( rRect );
if( bLayout || !aClipRgn.IsEmpty() )
- ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), TRUE );
+ ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), sal_True );
}
}
@@ -1376,7 +1263,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
ImplShowFocus();
if( ! bLayout )
- mbSmallInvalidate = TRUE;
+ mbSmallInvalidate = sal_True;
}
// -----------------------------------------------------------------------
@@ -1400,26 +1287,21 @@ void TabControl::Resize()
mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Aktuelle TabPage resizen/positionieren
- BOOL bTabPage = ImplPosCurTabPage();
+ sal_Bool bTabPage = ImplPosCurTabPage();
// Feststellen, was invalidiert werden muss
Size aNewSize = Control::GetOutputSizePixel();
long nNewWidth = aNewSize.Width();
- if ( mbScroll )
- mbSmallInvalidate = FALSE;
- else
+ for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
+ it != mpTabCtrlData->maItemList.end(); ++it )
{
- for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin();
- it != mpTabCtrlData->maItemList.end(); ++it )
+ if ( !it->mbFullVisible ||
+ (it->maRect.Right()-2 >= nNewWidth) )
{
- if ( !it->mbFullVisible ||
- (it->maRect.Right()-2 >= nNewWidth) )
- {
- mbSmallInvalidate = FALSE;
- break;
- }
+ mbSmallInvalidate = sal_False;
+ break;
}
}
@@ -1475,7 +1357,7 @@ void TabControl::LoseFocus()
void TabControl::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = rHEvt.KeyboardActivated() ? mnCurPageId : GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -1497,13 +1379,13 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1564,7 +1446,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
if( (mpTabCtrlData->mpListBox == NULL) && (rCEvt.GetCommand() == COMMAND_CONTEXTMENU) && (GetPageCount() > 1) )
{
Point aMenuPos;
- BOOL bMenu;
+ sal_Bool bMenu;
if ( rCEvt.IsMouseEvent() )
{
aMenuPos = rCEvt.GetMousePosPixel();
@@ -1573,7 +1455,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
else
{
aMenuPos = ImplGetTabRect( GetPagePos( mnCurPageId ) ).Center();
- bMenu = TRUE;
+ bMenu = sal_True;
}
if ( bMenu )
@@ -1585,10 +1467,10 @@ void TabControl::Command( const CommandEvent& rCEvt )
aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE | MIB_RADIOCHECK );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
- aMenu.SetHelpId( it->mnId, it->mnHelpId );
+ aMenu.SetHelpId( it->mnId, it->maHelpId );
}
- USHORT nId = aMenu.Execute( this, aMenuPos );
+ sal_uInt16 nId = aMenu.Execute( this, aMenuPos );
if ( nId && (nId != mnCurPageId) )
SelectTabPage( nId );
return;
@@ -1618,17 +1500,17 @@ void TabControl::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_STYLE )
@@ -1648,7 +1530,7 @@ void TabControl::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
@@ -1748,7 +1630,7 @@ long TabControl::DeactivatePage()
if ( maDeactivateHdl.IsSet() )
return maDeactivateHdl.Call( this );
else
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1775,16 +1657,16 @@ Size TabControl::GetTabPageSizePixel() const
// -----------------------------------------------------------------------
-void TabControl::InsertPage( const ResId& rResId, USHORT nPos )
+void TabControl::InsertPage( const ResId& rResId, sal_uInt16 nPos )
{
GetRes( rResId.SetRT( RSC_TABCONTROLITEM ) );
- ULONG nObjMask = ReadLongRes();
- USHORT nItemId = 1;
+ sal_uLong nObjMask = ReadLongRes();
+ sal_uInt16 nItemId = 1;
// ID
if ( nObjMask & RSC_TABCONTROLITEM_ID )
- nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
// Text
XubString aTmpStr;
@@ -1796,14 +1678,14 @@ void TabControl::InsertPage( const ResId& rResId, USHORT nPos )
if ( nObjMask & RSC_TABCONTROLITEM_PAGERESID )
{
ImplTabItem& rItem = mpTabCtrlData->maItemList[ GetPagePos( nItemId ) ];
- rItem.mnTabPageResId = sal::static_int_cast<USHORT>(ReadLongRes());
+ rItem.mnTabPageResId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
}
}
// -----------------------------------------------------------------------
-void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
- USHORT nPos )
+void TabControl::InsertPage( sal_uInt16 nPageId, const XubString& rText,
+ sal_uInt16 nPos )
{
DBG_ASSERT( nPageId, "TabControl::InsertPage(): PageId == 0" );
DBG_ASSERT( GetPagePos( nPageId ) == TAB_PAGE_NOTFOUND,
@@ -1841,11 +1723,10 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
- pItem->mnHelpId = 0;
pItem->maText = rText;
- pItem->mbFullVisible = FALSE;
+ pItem->mbFullVisible = sal_False;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
@@ -1853,14 +1734,14 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
if( mpTabCtrlData->mpListBox ) // reposition/resize listbox
Resize();
- ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (ULONG)nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (sal_uLong)nPageId );
}
// -----------------------------------------------------------------------
-void TabControl::RemovePage( USHORT nPageId )
+void TabControl::RemovePage( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
// does the item exist ?
if ( nPos != TAB_PAGE_NOTFOUND )
@@ -1894,13 +1775,13 @@ void TabControl::RemovePage( USHORT nPageId )
}
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_REMOVED, (void*) (sal_uLong) nPageId );
}
}
@@ -1916,7 +1797,7 @@ void TabControl::Clear()
ImplFreeLayoutData();
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
@@ -1925,14 +1806,14 @@ void TabControl::Clear()
// -----------------------------------------------------------------------
-void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
+void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem && pItem->mbEnabled != i_bEnable )
{
pItem->mbEnabled = i_bEnable;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SetEntryFlags( GetPagePos( i_nPageId ),
i_bEnable ? 0 : (LISTBOX_ENTRY_FLAG_DISABLE_SELECTION | LISTBOX_ENTRY_FLAG_DRAW_DISABLED) );
@@ -1948,14 +1829,14 @@ void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageCount() const
+sal_uInt16 TabControl::GetPageCount() const
{
- return (USHORT)mpTabCtrlData->maItemList.size();
+ return (sal_uInt16)mpTabCtrlData->maItemList.size();
}
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageId( USHORT nPos ) const
+sal_uInt16 TabControl::GetPageId( sal_uInt16 nPos ) const
{
if( size_t(nPos) < mpTabCtrlData->maItemList.size() )
return mpTabCtrlData->maItemList[ nPos ].mnId;
@@ -1964,13 +1845,13 @@ USHORT TabControl::GetPageId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetPagePos( USHORT nPageId ) const
+sal_uInt16 TabControl::GetPagePos( sal_uInt16 nPageId ) const
{
for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin();
it != mpTabCtrlData->maItemList.end(); ++it )
{
if ( it->mnId == nPageId )
- return (USHORT)(it - mpTabCtrlData->maItemList.begin());
+ return (sal_uInt16)(it - mpTabCtrlData->maItemList.begin());
}
return TAB_PAGE_NOTFOUND;
@@ -1978,11 +1859,11 @@ USHORT TabControl::GetPagePos( USHORT nPageId ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetPageId( const Point& rPos ) const
+sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
{
for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i )
{
- if ( ((TabControl*)this)->ImplGetTabRect( static_cast<USHORT>(i) ).IsInside( rPos ) )
+ if ( ((TabControl*)this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) )
return mpTabCtrlData->maItemList[ i ].mnId;
}
@@ -1991,9 +1872,9 @@ USHORT TabControl::GetPageId( const Point& rPos ) const
// -----------------------------------------------------------------------
-void TabControl::SetCurPageId( USHORT nPageId )
+void TabControl::SetCurPageId( sal_uInt16 nPageId )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
while( nPos != TAB_PAGE_NOTFOUND &&
! mpTabCtrlData->maItemList[nPos].mbEnabled )
{
@@ -2018,8 +1899,8 @@ void TabControl::SetCurPageId( USHORT nPageId )
mnActPageId = nPageId;
else
{
- mbFormat = TRUE;
- USHORT nOldId = mnCurPageId;
+ mbFormat = sal_True;
+ sal_uInt16 nOldId = mnCurPageId;
mnCurPageId = nPageId;
ImplChangeTabPage( nPageId, nOldId );
}
@@ -2028,7 +1909,7 @@ void TabControl::SetCurPageId( USHORT nPageId )
// -----------------------------------------------------------------------
-USHORT TabControl::GetCurPageId() const
+sal_uInt16 TabControl::GetCurPageId() const
{
if ( mnActPageId )
return mnActPageId;
@@ -2038,20 +1919,13 @@ USHORT TabControl::GetCurPageId() const
// -----------------------------------------------------------------------
-void TabControl::SetFirstPageId( USHORT )
-{
- return; // was only required for single line
-}
-
-// -----------------------------------------------------------------------
-
-void TabControl::SelectTabPage( USHORT nPageId )
+void TabControl::SelectTabPage( sal_uInt16 nPageId )
{
if ( nPageId && (nPageId != mnCurPageId) )
{
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (ULONG) mnCurPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_DEACTIVATE, (void*) (sal_uLong) mnCurPageId );
if ( DeactivatePage() )
{
mnActPageId = nPageId;
@@ -2062,14 +1936,14 @@ void TabControl::SelectTabPage( USHORT nPageId )
SetCurPageId( nPageId );
if( mpTabCtrlData->mpListBox )
mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) );
- ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (sal_uLong) nPageId );
}
}
}
// -----------------------------------------------------------------------
-void TabControl::SetTabPage( USHORT nPageId, TabPage* pTabPage )
+void TabControl::SetTabPage( sal_uInt16 nPageId, TabPage* pTabPage )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2094,7 +1968,7 @@ void TabControl::SetTabPage( USHORT nPageId, TabPage* pTabPage )
// -----------------------------------------------------------------------
-TabPage* TabControl::GetTabPage( USHORT nPageId ) const
+TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2106,7 +1980,7 @@ TabPage* TabControl::GetTabPage( USHORT nPageId ) const
// -----------------------------------------------------------------------
-USHORT TabControl::GetTabPageResId( USHORT nPageId ) const
+sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2118,30 +1992,30 @@ USHORT TabControl::GetTabPageResId( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetPageText( USHORT nPageId, const XubString& rText )
+void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem && pItem->maText != rText )
{
pItem->maText = rText;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( mpTabCtrlData->mpListBox )
{
- USHORT nPos = GetPagePos( nPageId );
+ sal_uInt16 nPos = GetPagePos( nPageId );
mpTabCtrlData->mpListBox->RemoveEntry( nPos );
mpTabCtrlData->mpListBox->InsertEntry( rText, nPos );
}
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
- ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (ULONG) nPageId );
+ ImplCallEventListeners( VCLEVENT_TABPAGE_PAGETEXTCHANGED, (void*) (sal_uLong) nPageId );
}
}
// -----------------------------------------------------------------------
-XubString TabControl::GetPageText( USHORT nPageId ) const
+XubString TabControl::GetPageText( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2153,7 +2027,7 @@ XubString TabControl::GetPageText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpText( USHORT nPageId, const XubString& rText )
+void TabControl::SetHelpText( sal_uInt16 nPageId, const XubString& rText )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
@@ -2163,17 +2037,17 @@ void TabControl::SetHelpText( USHORT nPageId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& TabControl::GetHelpText( USHORT nPageId ) const
+const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2184,36 +2058,37 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabControl::GetHelpId( USHORT nPageId ) const
+rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const
{
+ rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ aRet = pItem->maHelpId;
+
+ return aRet;
}
// -----------------------------------------------------------------------
-void TabControl::SetPageImage( USHORT i_nPageId, const Image& i_rImage )
+void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage )
{
ImplTabItem* pItem = ImplGetItem( i_nPageId );
if ( pItem )
{
pItem->maTabImage = i_rImage;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( IsUpdateMode() )
Invalidate();
}
@@ -2221,7 +2096,7 @@ void TabControl::SetPageImage( USHORT i_nPageId, const Image& i_rImage )
// -----------------------------------------------------------------------
-const Image* TabControl::GetPageImage( USHORT i_nPageId ) const
+const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const
{
const ImplTabItem* pItem = ImplGetItem( i_nPageId );
return pItem ? &pItem->maTabImage : NULL;
@@ -2229,7 +2104,7 @@ const Image* TabControl::GetPageImage( USHORT i_nPageId ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
+Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const
{
Rectangle aRet;
@@ -2252,7 +2127,7 @@ Rectangle TabControl::GetCharacterBounds( USHORT nPageId, long nIndex ) const
// -----------------------------------------------------------------------
-long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
+long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPageId ) const
{
long nRet = -1;
@@ -2273,7 +2148,7 @@ long TabControl::GetIndexForPoint( const Point& rPoint, USHORT& rPageId ) const
if( aPair.A() <= nIndex && aPair.B() >= nIndex )
{
nRet = nIndex - aPair.A();
- rPageId = (USHORT)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
+ rPageId = (sal_uInt16)mpTabCtrlData->maLayoutLineToPageId[ nLine ];
break;
}
}
@@ -2294,7 +2169,7 @@ void TabControl::FillLayoutData() const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
+Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
{
Rectangle aRet;
@@ -2319,7 +2194,7 @@ Rectangle TabControl::GetTabPageBounds( USHORT nPage ) const
// -----------------------------------------------------------------------
-Rectangle TabControl::GetTabBounds( USHORT nPageId ) const
+Rectangle TabControl::GetTabBounds( sal_uInt16 nPageId ) const
{
Rectangle aRet;
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
new file mode 100644
index 000000000000..a55fdb3eb379
--- /dev/null
+++ b/vcl/source/control/throbber.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/throbber.hxx"
+#include "vcl/svapp.hxx"
+
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
+
+#include <limits>
+
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::graphic::XGraphic;
+using ::com::sun::star::graphic::XGraphicProvider;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Exception;
+namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_style )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//--------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_resId )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::~Throbber()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ //..................................................................................................................
+ ::rtl::OUString lcl_getHighContrastURL( ::rtl::OUString const& i_imageURL )
+ {
+ INetURLObject aURL( i_imageURL );
+ if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE )
+ {
+ OSL_VERIFY( aURL.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hicontrast" ) ), false, 0 ) );
+ return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ // the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
+ // segment
+ const sal_Int32 separatorPos = i_imageURL.indexOf( '/' );
+ ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsipported URL scheme - cannot automatically determine HC version!", i_imageURL );
+
+ ::rtl::OUStringBuffer composer;
+ composer.append( i_imageURL.copy( 0, separatorPos ) );
+ composer.appendAscii( "/hicontrast" );
+ composer.append( i_imageURL.copy( separatorPos ) );
+ return composer.makeStringAndClear();
+ }
+
+ //..................................................................................................................
+ ::std::vector< Image > lcl_loadImageSet( const Throbber::ImageSet i_imageSet, const bool i_isHiContrast )
+ {
+ ::std::vector< Image > aImages;
+ ENSURE_OR_RETURN( i_imageSet != Throbber::IMAGES_NONE, "lcl_loadImageSet: illegal image set", aImages );
+
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ ::std::vector< ::rtl::OUString > aImageURLs( Throbber::getDefaultImageURLs( i_imageSet ) );
+ aImages.reserve( aImageURLs.size() );
+
+ ::comphelper::NamedValueCollection aMediaProperties;
+ for ( ::std::vector< ::rtl::OUString >::const_iterator imageURL = aImageURLs.begin();
+ imageURL != aImageURLs.end();
+ ++imageURL
+ )
+ {
+ Reference< XGraphic > xGraphic;
+ if ( i_isHiContrast )
+ {
+ aMediaProperties.put( "URL", lcl_getHighContrastURL( *imageURL ) );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ if ( !xGraphic.is() )
+ {
+ aMediaProperties.put( "URL", *imageURL );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ aImages.push_back( Image( xGraphic ) );
+ }
+
+ return aImages;
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::Resize()
+{
+ ImageControl::Resize();
+
+ if ( meImageSet == IMAGES_AUTO )
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::initImages()
+{
+ if ( meImageSet == IMAGES_NONE )
+ return;
+
+ try
+ {
+ ::std::vector< ::std::vector< Image > > aImageSets;
+ const bool isHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ if ( meImageSet == IMAGES_AUTO )
+ {
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_16_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_32_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_64_PX, isHiContrast ) );
+ }
+ else
+ {
+ aImageSets.push_back( lcl_loadImageSet( meImageSet, isHiContrast ) );
+ }
+
+ // find the best matching image set (size-wise)
+ const ::Size aWindowSizePixel = GetSizePixel();
+ size_t nPreferredSet = 0;
+ if ( aImageSets.size() > 1 )
+ {
+ long nMinimalDistance = ::std::numeric_limits< long >::max();
+ for ( ::std::vector< ::std::vector< Image > >::const_iterator check = aImageSets.begin();
+ check != aImageSets.end();
+ ++check
+ )
+ {
+ ENSURE_OR_CONTINUE( !check->empty(), "Throbber::initImages: illegal image!" );
+ const Size aImageSize = (*check)[0].GetSizePixel();
+
+ if ( ( aImageSize.Width() > aWindowSizePixel.Width() )
+ || ( aImageSize.Height() > aWindowSizePixel.Height() )
+ )
+ // do not use an image set which doesn't fit into the window
+ continue;
+
+ const sal_Int64 distance =
+ ( aWindowSizePixel.Width() - aImageSize.Width() ) * ( aWindowSizePixel.Width() - aImageSize.Width() )
+ + ( aWindowSizePixel.Height() - aImageSize.Height() ) * ( aWindowSizePixel.Height() - aImageSize.Height() );
+ if ( distance < nMinimalDistance )
+ {
+ nMinimalDistance = distance;
+ nPreferredSet = check - aImageSets.begin();
+ }
+ }
+ }
+
+ if ( nPreferredSet < aImageSets.size() )
+ setImageList( aImageSets[nPreferredSet] );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::start()
+{
+ maWaitTimer.Start();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::stop()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+bool Throbber::isRunning() const
+{
+ return maWaitTimer.IsActive();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( ::std::vector< Image > const& i_images )
+{
+ maImageList = i_images;
+
+ mnStepCount = maImageList.size();
+ const Image aInitialImage( mnStepCount ? maImageList[ 0 ] : Image() );
+ SetImage( aInitialImage );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList )
+{
+ ::std::vector< Image > aImages( rImageList.getLength() );
+ ::std::copy(
+ rImageList.getConstArray(),
+ rImageList.getConstArray() + rImageList.getLength(),
+ aImages.begin()
+ );
+ setImageList( aImages );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+::std::vector< ::rtl::OUString > Throbber::getDefaultImageURLs( const ImageSet i_imageSet )
+{
+ ::std::vector< ::rtl::OUString > aImageURLs;
+
+ sal_Char const* const pResolutions[] = { "16", "32", "64" };
+ size_t const nImageCounts[] = { 6, 12, 12 };
+
+ size_t index = 0;
+ switch ( i_imageSet )
+ {
+ case IMAGES_16_PX: index = 0; break;
+ case IMAGES_32_PX: index = 1; break;
+ case IMAGES_64_PX: index = 2; break;
+ case IMAGES_NONE:
+ case IMAGES_AUTO:
+ OSL_ENSURE( false, "Throbber::getDefaultImageURLs: illegal image set!" );
+ return aImageURLs;
+ }
+
+ aImageURLs.reserve( nImageCounts[index] );
+ for ( size_t i=0; i<nImageCounts[index]; ++i )
+ {
+ ::rtl::OUStringBuffer aURL;
+ aURL.appendAscii( "private:graphicrepository/shared/spinner-" );
+ aURL.appendAscii( pResolutions[index] );
+ aURL.appendAscii( "-" );
+ if ( i < 9 )
+ aURL.appendAscii( "0" );
+ aURL.append ( sal_Int32( i + 1 ) );
+ aURL.appendAscii( ".png" );
+
+ aImageURLs.push_back( aURL.makeStringAndClear() );
+ }
+
+ return aImageURLs;
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG )
+{
+ SolarMutexGuard aGuard;
+ if ( maImageList.empty() )
+ return 0;
+
+ if ( mnCurStep < mnStepCount - 1 )
+ mnCurStep += 1;
+ else
+ {
+ if ( mbRepeat )
+ {
+ // start over
+ mnCurStep = 0;
+ }
+ else
+ {
+ stop();
+ }
+ }
+
+ SetImage( maImageList[ mnCurStep ] );
+
+ return 0;
+}
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index c2b0310c7ca9..da0d84cec089 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -42,12 +42,10 @@
namespace vcl
{
-typedef sal_uInt32 ULONG;
-typedef sal_uInt32 UINT32;
-typedef sal_uInt16 USHORT;
+typedef sal_uIntPtr sal_uLong;
typedef sal_uInt8 FT_Byte;
-typedef std::map<USHORT,USHORT> GlyphSubstitution;
+typedef std::map<sal_uInt16,sal_uInt16> GlyphSubstitution;
inline sal_uInt32 NEXT_Long( const unsigned char* &p )
@@ -57,9 +55,9 @@ inline sal_uInt32 NEXT_Long( const unsigned char* &p )
return nVal;
}
-inline USHORT NEXT_UShort( const unsigned char* &p )
+inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
{
- USHORT nVal = (p[0]<<8) + p[1];
+ sal_uInt16 nVal = (p[0]<<8) + p[1];
p += 2;
return nVal;
}
@@ -78,50 +76,50 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
// parse GSUB header
const FT_Byte* pGsubHeader = pGsubBase;
- const ULONG nVersion = NEXT_Long( pGsubHeader );
- const USHORT nOfsScriptList = NEXT_UShort( pGsubHeader );
- const USHORT nOfsFeatureTable = NEXT_UShort( pGsubHeader );
- const USHORT nOfsLookupList = NEXT_UShort( pGsubHeader );
+ const sal_uLong nVersion = NEXT_Long( pGsubHeader );
+ const sal_uInt16 nOfsScriptList = NEXT_UShort( pGsubHeader );
+ const sal_uInt16 nOfsFeatureTable = NEXT_UShort( pGsubHeader );
+ const sal_uInt16 nOfsLookupList = NEXT_UShort( pGsubHeader );
// sanity check the GSUB header
if( nVersion != 0x00010000 )
if( nVersion != 0x00001000 ) // workaround for SunBatang etc.
return -1; // unknown format or broken
- typedef std::vector<ULONG> ReqFeatureTagList;
+ typedef std::vector<sal_uLong> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
aReqFeatureTagList.push_back( MKTAG("vert") );
- typedef std::vector<USHORT> UshortList;
+ typedef std::vector<sal_uInt16> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const USHORT nCntScript = NEXT_UShort( pScriptHeader );
+ const sal_uInt16 nCntScript = NEXT_UShort( pScriptHeader );
if( pGsubLimit < pScriptHeader + 6 * nCntScript )
return false;
- for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- const ULONG nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
- const USHORT nOfsScriptTable= NEXT_UShort( pScriptHeader );
- if( (nTag != (USHORT)nRequestedScript) && (nRequestedScript != 0) )
+ const sal_uLong nTag = NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
+ const sal_uInt16 nOfsScriptTable= NEXT_UShort( pScriptHeader );
+ if( (nTag != (sal_uInt16)nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
if( pGsubLimit < pScriptTable + 4 )
return false;
- const USHORT nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
- const USHORT nCntLangSystem = NEXT_UShort( pScriptTable );
- USHORT nLangsysOffset = 0;
+ const sal_uInt16 nDefaultLangsysOfs = NEXT_UShort( pScriptTable );
+ const sal_uInt16 nCntLangSystem = NEXT_UShort( pScriptTable );
+ sal_uInt16 nLangsysOffset = 0;
if( pGsubLimit < pScriptTable + 6 * nCntLangSystem )
return false;
- for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- const ULONG nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
- const USHORT nOffset= NEXT_UShort( pScriptTable );
- if( (nInnerTag != (USHORT)nRequestedLangsys) && (nRequestedLangsys != 0) )
+ const sal_uLong nInnerTag = NEXT_Long( pScriptTable ); // e.g. KOR/ZHS/ZHT/JAN
+ const sal_uInt16 nOffset= NEXT_UShort( pScriptTable );
+ if( (nInnerTag != (sal_uInt16)nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
nLangsysOffset = nOffset;
break;
@@ -132,15 +130,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
- const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
- const USHORT nCntFeature = NEXT_UShort( pLangSys );
+ /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -150,15 +148,15 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
if( pGsubLimit < pLangSys + 6 )
return false;
- /*const USHORT nLookupOrder =*/ NEXT_UShort( pLangSys );
- const USHORT nReqFeatureIdx = NEXT_UShort( pLangSys );
- const USHORT nCntFeature = NEXT_UShort( pLangSys );
+ /*const sal_uInt16 nLookupOrder =*/ NEXT_UShort( pLangSys );
+ const sal_uInt16 nReqFeatureIdx = NEXT_UShort( pLangSys );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pLangSys );
if( pGsubLimit < pLangSys + 2 * nCntFeature )
return false;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = NEXT_UShort( pLangSys );
aFeatureIndexList.push_back( nFeatureIndex );
}
}
@@ -174,13 +172,13 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
if( pGsubLimit < pFeatureHeader + 2 )
return false;
- const USHORT nCntFeature = NEXT_UShort( pFeatureHeader );
+ const sal_uInt16 nCntFeature = NEXT_UShort( pFeatureHeader );
if( pGsubLimit < pFeatureHeader + 6 * nCntFeature )
return false;
- for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const ULONG nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const USHORT nOffset= NEXT_UShort( pFeatureHeader );
+ const sal_uLong nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const sal_uInt16 nOffset= NEXT_UShort( pFeatureHeader );
// ignore unneeded feature lookups
if( aFeatureIndexList[0] != nFeatureIndex ) // do not ignore the required feature
@@ -196,12 +194,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
if( pGsubLimit < pFeatureTable + 2 )
return false;
- const USHORT nCntLookups = NEXT_UShort( pFeatureTable );
+ const sal_uInt16 nCntLookups = NEXT_UShort( pFeatureTable );
if( pGsubLimit < pFeatureTable + 2 * nCntLookups )
return false;
- for( USHORT i = 0; i < nCntLookups; ++i )
+ for( sal_uInt16 i = 0; i < nCntLookups; ++i )
{
- const USHORT nLookupIndex = NEXT_UShort( pFeatureTable );
+ const sal_uInt16 nLookupIndex = NEXT_UShort( pFeatureTable );
aLookupIndexList.push_back( nLookupIndex );
}
if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
@@ -212,12 +210,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
if( pGsubLimit < pLookupHeader + 2 )
return false;
- const USHORT nCntLookupTable = NEXT_UShort( pLookupHeader );
+ const sal_uInt16 nCntLookupTable = NEXT_UShort( pLookupHeader );
if( pGsubLimit < pLookupHeader + 2 * nCntLookupTable )
return false;
- for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const USHORT nOffset = NEXT_UShort( pLookupHeader );
+ const sal_uInt16 nOffset = NEXT_UShort( pLookupHeader );
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
}
@@ -225,13 +223,13 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
UshortList::const_iterator it = aLookupOffsetList.begin();
for(; it != aLookupOffsetList.end(); ++it )
{
- const USHORT nOfsLookupTable = *it;
+ const sal_uInt16 nOfsLookupTable = *it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
if( pGsubLimit < pLookupTable + 6 )
return false;
- const USHORT eLookupType = NEXT_UShort( pLookupTable );
- /*const USHORT eLookupFlag =*/ NEXT_UShort( pLookupTable );
- const USHORT nCntLookupSubtable = NEXT_UShort( pLookupTable );
+ const sal_uInt16 eLookupType = NEXT_UShort( pLookupTable );
+ /*const sal_uInt16 eLookupFlag =*/ NEXT_UShort( pLookupTable );
+ const sal_uInt16 nCntLookupSubtable = NEXT_UShort( pLookupTable );
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
@@ -239,16 +237,16 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
if( pGsubLimit < pLookupTable + 2 * nCntLookupSubtable )
return false;
- for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const USHORT nOfsSubLookupTable = NEXT_UShort( pLookupTable );
+ const sal_uInt16 nOfsSubLookupTable = NEXT_UShort( pLookupTable );
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
if( pGsubLimit < pSubLookup + 6 )
return false;
- const USHORT nFmtSubstitution = NEXT_UShort( pSubLookup );
- const USHORT nOfsCoverage = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nFmtSubstitution = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nOfsCoverage = NEXT_UShort( pSubLookup );
- typedef std::pair<USHORT,USHORT> GlyphSubst;
+ typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
@@ -256,19 +254,19 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
+ nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
if( pGsubLimit < pCoverage + 4 )
return false;
- const USHORT nFmtCoverage = NEXT_UShort( pCoverage );
+ const sal_uInt16 nFmtCoverage = NEXT_UShort( pCoverage );
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const USHORT nCntGlyph = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCntGlyph = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 2 * nCntGlyph )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 2;
return false;
aSubstVector.reserve( nCntGlyph );
- for( USHORT i = 0; i < nCntGlyph; ++i )
+ for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
{
- const USHORT nGlyphId = NEXT_UShort( pCoverage );
+ const sal_uInt16 nGlyphId = NEXT_UShort( pCoverage );
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
}
@@ -276,17 +274,17 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Coverage Format 2
{
- const USHORT nCntRange = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCntRange = NEXT_UShort( pCoverage );
if( pGsubLimit < pCoverage + 6 * nCntRange )
// TODO? nCntGlyph = (pGsubLimit - pCoverage) / 6;
return false;
for( int i = nCntRange; --i >= 0; )
{
- const UINT32 nGlyph0 = NEXT_UShort( pCoverage );
- const UINT32 nGlyph1 = NEXT_UShort( pCoverage );
- const USHORT nCovIdx = NEXT_UShort( pCoverage );
- for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
+ const sal_uInt32 nGlyph0 = NEXT_UShort( pCoverage );
+ const sal_uInt32 nGlyph1 = NEXT_UShort( pCoverage );
+ const sal_uInt16 nCovIdx = NEXT_UShort( pCoverage );
+ for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
}
}
break;
@@ -298,7 +296,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
{
case 1: // Single Substitution Format 1
{
- const USHORT nDeltaGlyphId = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nDeltaGlyphId = NEXT_UShort( pSubLookup );
for(; subst_it != aSubstVector.end(); ++subst_it )
(*subst_it).second = (*subst_it).first + nDeltaGlyphId;
@@ -307,12 +305,12 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
case 2: // Single Substitution Format 2
{
- const USHORT nCntGlyph = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nCntGlyph = NEXT_UShort( pSubLookup );
for( int i = nCntGlyph; (subst_it != aSubstVector.end()) && (--i>=0); ++subst_it )
{
if( pGsubLimit < pSubLookup + 2 )
return false;
- const USHORT nGlyphId = NEXT_UShort( pSubLookup );
+ const sal_uInt16 nGlyphId = NEXT_UShort( pSubLookup );
(*subst_it).second = nGlyphId;
}
}
@@ -344,7 +342,7 @@ int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph, int /*wmode*/ )
GlyphSubstitution* pGlyphSubstitution = (GlyphSubstitution*)pTTFile->pGSubstitution;
if( pGlyphSubstitution != 0 )
{
- GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<USHORT>(nGlyph) ) );
+ GlyphSubstitution::const_iterator it( pGlyphSubstitution->find( sal::static_int_cast<sal_uInt16>(nGlyph) ) );
if( it != pGlyphSubstitution->end() )
nGlyph = (*it).second;
}
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index b9745147bb5a..4e3f8ceb0cf2 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1434,7 +1434,7 @@ static void GetKern(TrueTypeFont *ttf)
if( !table )
goto badtable;
- if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with USHORT version and nTables fields */
+ if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with sal_uInt16 version and nTables fields */
ttf->nkern = GetUInt16(table, 2, 1);
ttf->kerntables = (const sal_uInt8**)calloc(ttf->nkern, sizeof(sal_uInt8 *));
assert(ttf->kerntables != 0);
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index d144fe550882..6107affaf4e9 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -59,7 +59,7 @@ AlphaMask::AlphaMask( const AlphaMask& rAlphaMask ) :
// -----------------------------------------------------------------------------
-AlphaMask::AlphaMask( const Size& rSizePixel, BYTE* pEraseTransparency ) :
+AlphaMask::AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency ) :
Bitmap( rSizePixel, 8, &Bitmap::GetGreyPalette( 256 ) )
{
if( pEraseTransparency )
@@ -108,14 +108,14 @@ Bitmap AlphaMask::GetBitmap() const
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Crop( const Rectangle& rRectPixel )
+sal_Bool AlphaMask::Crop( const Rectangle& rRectPixel )
{
return Bitmap::Crop( rRectPixel );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency )
+sal_Bool AlphaMask::Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency )
{
Color aColor;
@@ -127,7 +127,7 @@ BOOL AlphaMask::Expand( ULONG nDX, ULONG nDY, BYTE* pInitTransparency )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const AlphaMask* pAlphaSrc )
{
// Note: this code is copied from Bitmap::CopyPixel but avoids any palette lookups
@@ -135,7 +135,7 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const Size aSizePix( GetSizePixel() );
Rectangle aRectDst( rRectDst );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -226,7 +226,7 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -238,26 +238,26 @@ BOOL AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Erase( BYTE cTransparency )
+sal_Bool AlphaMask::Erase( sal_uInt8 cTransparency )
{
return Bitmap::Erase( Color( cTransparency, cTransparency, cTransparency ) );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Invert()
+sal_Bool AlphaMask::Invert()
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc && pAcc->GetBitCount() == 8 )
{
BitmapColor aCol( 0 );
const long nWidth = pAcc->Width(), nHeight = pAcc->Height();
- BYTE* pMap = new BYTE[ 256 ];
+ sal_uInt8* pMap = new sal_uInt8[ 256 ];
for( long i = 0; i < 256; i++ )
- pMap[ i ] = ~(BYTE) i;
+ pMap[ i ] = ~(sal_uInt8) i;
for( long nY = 0L; nY < nHeight; nY++ )
{
@@ -269,7 +269,7 @@ BOOL AlphaMask::Invert()
}
delete[] pMap;
- bRet = TRUE;
+ bRet = sal_True;
}
if( pAcc )
@@ -280,16 +280,16 @@ BOOL AlphaMask::Invert()
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Mirror( ULONG nMirrorFlags )
+sal_Bool AlphaMask::Mirror( sal_uLong nMirrorFlags )
{
return Bitmap::Mirror( nMirrorFlags );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool AlphaMask::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
- BOOL bRet = Bitmap::Scale( rNewSize, nScaleFlag );
+ sal_Bool bRet = Bitmap::Scale( rNewSize, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -299,9 +299,9 @@ BOOL AlphaMask::Scale( const Size& rNewSize, ULONG nScaleFlag )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool AlphaMask::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
+ sal_Bool bRet = Bitmap::Scale( rScaleX, rScaleY, nScaleFlag );
if( bRet && ( nScaleFlag == BMP_SCALE_INTERPOLATE ) )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
@@ -311,18 +311,18 @@ BOOL AlphaMask::Scale( const double& rScaleX, const double& rScaleY, ULONG nScal
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Rotate( long nAngle10, BYTE cFillTransparency )
+sal_Bool AlphaMask::Rotate( long nAngle10, sal_uInt8 cFillTransparency )
{
return Bitmap::Rotate( nAngle10, Color( cFillTransparency, cFillTransparency, cFillTransparency ) );
}
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( const Bitmap& rMask, BYTE cReplaceTransparency )
+sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -345,14 +345,14 @@ BOOL AlphaMask::Replace( const Bitmap& rMask, BYTE cReplaceTransparency )
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( BYTE cSearchTransparency, BYTE cReplaceTransparency, ULONG
+sal_Bool AlphaMask::Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong
#ifdef DBG_UTIL
nTol
#endif
)
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
DBG_ASSERT( !nTol, "AlphaMask::Replace: nTol not used yet" );
@@ -387,7 +387,7 @@ nTol
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
if( pAcc )
@@ -398,17 +398,17 @@ nTol
// -----------------------------------------------------------------------------
-BOOL AlphaMask::Replace( BYTE* pSearchTransparencies, BYTE* pReplaceTransparencies,
- ULONG nColorCount, ULONG* pTols )
+sal_Bool AlphaMask::Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
+ sal_uLong nColorCount, sal_uLong* pTols )
{
Color* pSearchColors = new Color[ nColorCount ];
Color* pReplaceColors = new Color[ nColorCount ];
- BOOL bRet;
+ sal_Bool bRet;
- for( ULONG i = 0; i < nColorCount; i++ )
+ for( sal_uLong i = 0; i < nColorCount; i++ )
{
- const BYTE cSearchTransparency = pSearchTransparencies[ i ];
- const BYTE cReplaceTransparency = pReplaceTransparencies[ i ];
+ const sal_uInt8 cSearchTransparency = pSearchTransparencies[ i ];
+ const sal_uInt8 cReplaceTransparency = pReplaceTransparencies[ i ];
pSearchColors[ i ] = Color( cSearchTransparency, cSearchTransparency, cSearchTransparency );
pReplaceColors[ i ] = Color( cReplaceTransparency, cReplaceTransparency, cReplaceTransparency );
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 0da492c1fecb..63d0010bd5d2 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -50,13 +50,13 @@ DBG_NAME( Animation )
// - statics -
// -----------
-ULONG Animation::mnAnimCount = 0UL;
+sal_uLong Animation::mnAnimCount = 0UL;
// -------------------
// - AnimationBitmap -
// -------------------
-ULONG AnimationBitmap::GetChecksum() const
+sal_uLong AnimationBitmap::GetChecksum() const
{
sal_uInt32 nCrc = aBmpEx.GetChecksum();
SVBT32 aBT32;
@@ -94,9 +94,9 @@ Animation::Animation() :
mnLoops ( 0 ),
mnPos ( 0 ),
meCycleMode ( CYCLE_NORMAL ),
- mbIsInAnimation ( FALSE ),
- mbLoopTerminated ( FALSE ),
- mbIsWaiting ( FALSE )
+ mbIsInAnimation ( sal_False ),
+ mbLoopTerminated ( sal_False ),
+ mbIsWaiting ( sal_False )
{
DBG_CTOR( Animation, NULL );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
@@ -111,7 +111,7 @@ Animation::Animation( const Animation& rAnimation ) :
mnLoopCount ( rAnimation.mnLoopCount ),
mnPos ( rAnimation.mnPos ),
meCycleMode ( rAnimation.meCycleMode ),
- mbIsInAnimation ( FALSE ),
+ mbIsInAnimation ( sal_False ),
mbLoopTerminated ( rAnimation.mbLoopTerminated ),
mbIsWaiting ( rAnimation.mbIsWaiting )
{
@@ -166,24 +166,24 @@ Animation& Animation::operator=( const Animation& rAnimation )
// -----------------------------------------------------------------------
-BOOL Animation::operator==( const Animation& rAnimation ) const
+sal_Bool Animation::operator==( const Animation& rAnimation ) const
{
- const ULONG nCount = maList.Count();
- BOOL bRet = FALSE;
+ const sal_uLong nCount = maList.Count();
+ sal_Bool bRet = sal_False;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx == maBitmapEx &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0; n < nCount; n++ )
+ for( sal_uLong n = 0; n < nCount; n++ )
{
if( ( *(AnimationBitmap*) maList.GetObject( n ) ) !=
( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -194,19 +194,19 @@ BOOL Animation::operator==( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-BOOL Animation::IsEqual( const Animation& rAnimation ) const
+sal_Bool Animation::IsEqual( const Animation& rAnimation ) const
{
- const ULONG nCount = maList.Count();
- BOOL bRet = FALSE;
+ const sal_uLong nCount = maList.Count();
+ sal_Bool bRet = sal_False;
if( rAnimation.maList.Count() == nCount &&
rAnimation.maBitmapEx.IsEqual( maBitmapEx ) &&
rAnimation.maGlobalSize == maGlobalSize &&
rAnimation.meCycleMode == meCycleMode )
{
- for( ULONG n = 0; ( n < nCount ) && !bRet; n++ )
+ for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ )
if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -214,7 +214,7 @@ BOOL Animation::IsEqual( const Animation& rAnimation ) const
// ------------------------------------------------------------------
-BOOL Animation::IsEmpty() const
+sal_Bool Animation::IsEmpty() const
{
return( maBitmapEx.IsEmpty() && !maList.Count() );
}
@@ -224,7 +224,7 @@ BOOL Animation::IsEmpty() const
void Animation::SetEmpty()
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
maGlobalSize = Size();
maBitmapEx.SetEmpty();
@@ -246,11 +246,11 @@ void Animation::Clear()
// -----------------------------------------------------------------------
-BOOL Animation::IsTransparent() const
+sal_Bool Animation::IsTransparent() const
{
Point aPoint;
Rectangle aRect( aPoint, maGlobalSize );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// Falls irgendein 'kleines' Bildchen durch den Hintergrund
// ersetzt werden soll, muessen wir 'transparent' sein, um
@@ -262,7 +262,7 @@ BOOL Animation::IsTransparent() const
if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -275,9 +275,9 @@ BOOL Animation::IsTransparent() const
// -----------------------------------------------------------------------
-ULONG Animation::GetSizeBytes() const
+sal_uLong Animation::GetSizeBytes() const
{
- ULONG nSizeBytes = GetBitmapEx().GetSizeBytes();
+ sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
for( long i = 0, nCount = maList.Count(); i < nCount; i++ )
{
@@ -290,7 +290,7 @@ ULONG Animation::GetSizeBytes() const
// -----------------------------------------------------------------------
-ULONG Animation::GetChecksum() const
+sal_uLong Animation::GetChecksum() const
{
SVBT32 aBT32;
sal_uInt32 nCrc = GetBitmapEx().GetChecksum();
@@ -318,7 +318,7 @@ ULONG Animation::GetChecksum() const
// -----------------------------------------------------------------------
-BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
+sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
return Start( pOut, rDestPt, pOut->PixelToLogic( maGlobalSize ), nExtraData, pFirstFrameOutDev );
@@ -326,10 +326,10 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData
// -----------------------------------------------------------------------
-BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
+sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( maList.Count() )
{
@@ -362,7 +362,7 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDe
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
mnPos = 0UL;
}
@@ -372,13 +372,13 @@ BOOL Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDe
if( !mbIsInAnimation )
{
ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait );
- mbIsInAnimation = TRUE;
+ mbIsInAnimation = sal_True;
}
}
else
Draw( pOut, rDestPt, rDestSz );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -404,7 +404,7 @@ void Animation::Stop( OutputDevice* pOut, long nExtraData )
if( !mpViewList->Count() )
{
maTimer.Stop();
- mbIsInAnimation = FALSE;
+ mbIsInAnimation = sal_False;
}
}
@@ -419,7 +419,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const
void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const
{
- const ULONG nCount = maList.Count();
+ const sal_uLong nCount = maList.Count();
if( nCount )
{
@@ -431,7 +431,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes
pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz );
else
{
- const ULONG nOldPos = mnPos;
+ const sal_uLong nOldPos = mnPos;
( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 );
( (Animation*) this )->mnPos = nOldPos;
@@ -441,9 +441,9 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes
// -----------------------------------------------------------------------
-void Animation::ImplRestartTimer( ULONG nTimeout )
+void Animation::ImplRestartTimer( sal_uLong nTimeout )
{
- maTimer.SetTimeout( Max( nTimeout, (ULONG)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
+ maTimer.SetTimeout( Max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L );
maTimer.Start();
}
@@ -451,12 +451,12 @@ void Animation::ImplRestartTimer( ULONG nTimeout )
IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
{
- const ULONG nAnimCount = maList.Count();
+ const sal_uLong nAnimCount = maList.Count();
if( nAnimCount )
{
ImplAnimView* pView;
- BOOL bGlobalPause = TRUE;
+ sal_Bool bGlobalPause = sal_True;
if( maNotifyLink.IsSet() )
{
@@ -482,7 +482,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
pView = (ImplAnimView*) pAInfo->pViewData;
pView->ImplPause( pAInfo->bPause );
- pView->ImplSetMarked( TRUE );
+ pView->ImplSetMarked( sal_True );
}
// delete AInfo structures
@@ -502,15 +502,15 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
else
{
if( !pView->ImplIsPause() )
- bGlobalPause = FALSE;
+ bGlobalPause = sal_False;
- pView->ImplSetMarked( FALSE );
+ pView->ImplSetMarked( sal_False );
pView = (ImplAnimView*) mpViewList->Next();
}
}
}
else
- bGlobalPause = FALSE;
+ bGlobalPause = sal_False;
if( !mpViewList->Count() )
Stop();
@@ -525,7 +525,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
if( mnLoops == 1 )
{
Stop();
- mbLoopTerminated = TRUE;
+ mbLoopTerminated = sal_True;
mnPos = nAnimCount - 1UL;
maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx;
return 0L;
@@ -573,9 +573,9 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG )
// -----------------------------------------------------------------------
-BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
+sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !IsInAnimation() )
{
@@ -589,7 +589,7 @@ BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
if( maList.Count() == 1 )
maBitmapEx = rStepBmp.aBmpEx;
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -597,7 +597,7 @@ BOOL Animation::Insert( const AnimationBitmap& rStepBmp )
// -----------------------------------------------------------------------
-const AnimationBitmap& Animation::Get( USHORT nAnimation ) const
+const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const
{
DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
return *(AnimationBitmap*) maList.GetObject( nAnimation );
@@ -605,7 +605,7 @@ const AnimationBitmap& Animation::Get( USHORT nAnimation ) const
// -----------------------------------------------------------------------
-void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, USHORT nAnimation )
+void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation )
{
DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" );
@@ -624,7 +624,7 @@ void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, USHORT nAni
// -----------------------------------------------------------------------
-void Animation::SetLoopCount( const ULONG nLoopCount )
+void Animation::SetLoopCount( const sal_uLong nLoopCount )
{
mnLoopCount = nLoopCount;
ResetLoopCount();
@@ -635,20 +635,20 @@ void Animation::SetLoopCount( const ULONG nLoopCount )
void Animation::ResetLoopCount()
{
mnLoops = mnLoopCount;
- mbLoopTerminated = FALSE;
+ mbLoopTerminated = sal_False;
}
// -----------------------------------------------------------------------
-BOOL Animation::Convert( BmpConversion eConversion )
+sal_Bool Animation::Convert( BmpConversion eConversion )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion );
@@ -656,22 +656,22 @@ BOOL Animation::Convert( BmpConversion eConversion )
maBitmapEx.Convert( eConversion );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
+sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce );
@@ -679,22 +679,22 @@ BOOL Animation::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
maBitmapEx.ReduceColors( nNewColorCount, eReduce );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Invert()
+sal_Bool Animation::Invert()
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert();
@@ -702,22 +702,22 @@ BOOL Animation::Invert()
maBitmapEx.Invert();
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Mirror( ULONG nMirrorFlags )
+sal_Bool Animation::Mirror( sal_uLong nMirrorFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
if( nMirrorFlags )
{
@@ -725,7 +725,7 @@ BOOL Animation::Mirror( ULONG nMirrorFlags )
pStepBmp && bRet;
pStepBmp = (AnimationBitmap*) maList.Next() )
{
- if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == TRUE )
+ if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True )
{
if( nMirrorFlags & BMP_MIRROR_HORZ )
pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width();
@@ -739,22 +739,22 @@ BOOL Animation::Mirror( ULONG nMirrorFlags )
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Dither( ULONG nDitherFlags )
+sal_Bool Animation::Dither( sal_uLong nDitherFlags )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags );
@@ -762,24 +762,24 @@ BOOL Animation::Dither( ULONG nDitherFlags )
maBitmapEx.Dither( nDitherFlags );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
{
@@ -793,22 +793,22 @@ BOOL Animation::Adjust( short nLuminancePercent, short nContrastPercent,
fGamma, bInvert );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
- BOOL bRet;
+ sal_Bool bRet;
if( !IsInAnimation() && maList.Count() )
{
- bRet = TRUE;
+ bRet = sal_True;
for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() )
bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress );
@@ -816,7 +816,7 @@ BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, c
maBitmapEx.Filter( eFilter, pFilterParam, pProgress );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -825,12 +825,12 @@ BOOL Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, c
SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
{
- const USHORT nCount = rAnimation.Count();
+ const sal_uInt16 nCount = rAnimation.Count();
if( nCount )
{
const ByteString aDummyStr;
- const UINT32 nDummy32 = 0UL;
+ const sal_uInt32 nDummy32 = 0UL;
// Falls keine BitmapEx gesetzt wurde, schreiben wir
// einfach die erste Bitmap der Animation
@@ -840,22 +840,22 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
rOStm << rAnimation.GetBitmapEx();
// Kennung schreiben ( SDANIMA1 )
- rOStm << (UINT32) 0x5344414e << (UINT32) 0x494d4931;
+ rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931;
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
- const UINT16 nRest = nCount - i - 1;
+ const sal_uInt16 nRest = nCount - i - 1;
// AnimationBitmap schreiben
rOStm << rAnimBmp.aBmpEx;
rOStm << rAnimBmp.aPosPix;
rOStm << rAnimBmp.aSizePix;
rOStm << rAnimation.maGlobalSize;
- rOStm << (UINT16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
- rOStm << (UINT16) rAnimBmp.eDisposal;
- rOStm << (BYTE) rAnimBmp.bUserInput;
- rOStm << (UINT32) rAnimation.mnLoopCount;
+ rOStm << (sal_uInt16) ( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
+ rOStm << (sal_uInt16) rAnimBmp.eDisposal;
+ rOStm << (sal_uInt8) rAnimBmp.bUserInput;
+ rOStm << (sal_uInt32) rAnimation.mnLoopCount;
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
@@ -872,10 +872,10 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
{
Bitmap aBmp;
- ULONG nStmPos = rIStm.Tell();
- UINT32 nAnimMagic1, nAnimMagic2;
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
- BOOL bReadAnimations = FALSE;
+ sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt32 nAnimMagic1, nAnimMagic2;
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_Bool bReadAnimations = sal_False;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
nStmPos = rIStm.Tell();
@@ -886,7 +886,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
// Wenn die BitmapEx am Anfang schon gelesen
// wurde ( von Graphic ), koennen wir direkt die Animationsbitmaps einlesen
if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
- bReadAnimations = TRUE;
+ bReadAnimations = sal_True;
// ansonsten versuchen wir erstmal die Bitmap(-Ex) zu lesen
else
{
@@ -896,7 +896,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
rIStm >> nAnimMagic1 >> nAnimMagic2;
if( ( nAnimMagic1 == 0x5344414e ) && ( nAnimMagic2 == 0x494d4931 ) && !rIStm.GetError() )
- bReadAnimations = TRUE;
+ bReadAnimations = sal_True;
else
rIStm.Seek( nStmPos );
}
@@ -907,9 +907,9 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
AnimationBitmap aAnimBmp;
BitmapEx aBmpEx;
ByteString aDummyStr;
- UINT32 nTmp32;
- UINT16 nTmp16;
- BYTE cTmp;
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16;
+ sal_uInt8 cTmp;
do
{
@@ -919,8 +919,8 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
rIStm >> rAnimation.maGlobalSize;
rIStm >> nTmp16; aAnimBmp.nWait = ( ( 65535 == nTmp16 ) ? ANIMATION_TIMEOUT_ON_CLICK : nTmp16 );
rIStm >> nTmp16; aAnimBmp.eDisposal = ( Disposal) nTmp16;
- rIStm >> cTmp; aAnimBmp.bUserInput = (BOOL) cTmp;
- rIStm >> nTmp32; rAnimation.mnLoopCount = (USHORT) nTmp32;
+ rIStm >> cTmp; aAnimBmp.bUserInput = (sal_Bool) cTmp;
+ rIStm >> nTmp32; rAnimation.mnLoopCount = (sal_uInt16) nTmp32;
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 8d13cdb41a0f..a0b48f4ee124 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -86,7 +86,7 @@ Bitmap::Bitmap( SalBitmap* pSalBitmap )
// ------------------------------------------------------------------
-Bitmap::Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* pPal )
+Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalette* pPal )
{
if( rSizePixel.Width() && rSizePixel.Height() )
{
@@ -126,12 +126,12 @@ Bitmap::Bitmap( const Size& rSizePixel, USHORT nBitCount, const BitmapPalette* p
// Dither-Palette erzeugen
if( 8 == nBitCount )
{
- USHORT nActCol = 16;
+ sal_uInt16 nActCol = 16;
- for( USHORT nB = 0; nB < 256; nB += 51 )
- for( USHORT nG = 0; nG < 256; nG += 51 )
- for( USHORT nR = 0; nR < 256; nR += 51 )
- aPal[ nActCol++ ] = BitmapColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ for( sal_uInt16 nB = 0; nB < 256; nB += 51 )
+ for( sal_uInt16 nG = 0; nG < 256; nG += 51 )
+ for( sal_uInt16 nR = 0; nR < 256; nR += 51 )
+ aPal[ nActCol++ ] = BitmapColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
// Standard-Office-Farbe setzen
aPal[ nActCol++ ] = BitmapColor( 0, 184, 255 );
@@ -196,11 +196,11 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
if( !aGreyPalette16.GetEntryCount() )
{
- BYTE cGrey = 0, cGreyInc = 17;
+ sal_uInt8 cGrey = 0, cGreyInc = 17;
aGreyPalette16.SetEntryCount( 16 );
- for( USHORT i = 0; i < 16; i++, cGrey = sal::static_int_cast<BYTE>(cGrey + cGreyInc) )
+ for( sal_uInt16 i = 0; i < 16; i++, cGrey = sal::static_int_cast<sal_uInt8>(cGrey + cGreyInc) )
aGreyPalette16[ i ] = BitmapColor( cGrey, cGrey, cGrey );
}
@@ -212,8 +212,8 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
aGreyPalette256.SetEntryCount( 256 );
- for( USHORT i = 0; i < 256; i++ )
- aGreyPalette256[ i ] = BitmapColor( (BYTE) i, (BYTE) i, (BYTE) i );
+ for( sal_uInt16 i = 0; i < 256; i++ )
+ aGreyPalette256[ i ] = BitmapColor( (sal_uInt8) i, (sal_uInt8) i, (sal_uInt8) i );
}
return aGreyPalette256;
@@ -235,9 +235,13 @@ bool BitmapPalette::IsGreyPalette() const
const int nEntryCount = GetEntryCount();
if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping
return true;
- const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
- if( rGreyPalette == *this )
- return true;
+ // see above: only certain entry values will result in a valid call to GetGreyPalette
+ if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 )
+ {
+ const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
+ if( rGreyPalette == *this )
+ return true;
+ }
// TODO: is it worth to compare the entries?
return false;
}
@@ -260,7 +264,7 @@ Bitmap& Bitmap::operator=( const Bitmap& rBitmap )
// ------------------------------------------------------------------
-BOOL Bitmap::IsEqual( const Bitmap& rBmp ) const
+sal_Bool Bitmap::IsEqual( const Bitmap& rBmp ) const
{
return( IsSameInstance( rBmp ) ||
( rBmp.GetSizePixel() == GetSizePixel() &&
@@ -309,17 +313,17 @@ void Bitmap::SetSourceSizePixel( const Size& rSize)
// ------------------------------------------------------------------
-USHORT Bitmap::GetBitCount() const
+sal_uInt16 Bitmap::GetBitCount() const
{
return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 );
}
// ------------------------------------------------------------------
-BOOL Bitmap::HasGreyPalette() const
+sal_Bool Bitmap::HasGreyPalette() const
{
- const USHORT nBitCount = GetBitCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nBitCount = GetBitCount();
+ sal_Bool bRet = sal_False;
if( 1 == nBitCount )
{
@@ -332,12 +336,12 @@ BOOL Bitmap::HasGreyPalette() const
if( rCol0.GetRed() == rCol0.GetGreen() && rCol0.GetRed() == rCol0.GetBlue() &&
rCol1.GetRed() == rCol1.GetGreen() && rCol1.GetRed() == rCol1.GetBlue() )
{
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
else
- bRet = TRUE;
+ bRet = sal_True;
}
else if( 4 == nBitCount || 8 == nBitCount )
{
@@ -346,7 +350,7 @@ BOOL Bitmap::HasGreyPalette() const
if( pRAcc )
{
if( pRAcc->HasPalette() && ( (BitmapPalette&) pRAcc->GetPalette() == GetGreyPalette( 1 << nBitCount ) ) )
- bRet = TRUE;
+ bRet = sal_True;
( (Bitmap*) this )->ReleaseAccess( pRAcc );
}
@@ -357,9 +361,9 @@ BOOL Bitmap::HasGreyPalette() const
// ------------------------------------------------------------------
-ULONG Bitmap::GetChecksum() const
+sal_uLong Bitmap::GetChecksum() const
{
- ULONG nRet = 0UL;
+ sal_uLong nRet = 0UL;
if( mpImpBmp )
{
@@ -523,44 +527,44 @@ void Bitmap::ReleaseAccess( BitmapReadAccess* pBitmapAccess )
// ------------------------------------------------------------------
-BOOL Bitmap::Erase( const Color& rFillColor )
+sal_Bool Bitmap::Erase( const Color& rFillColor )
{
if( !(*this) )
- return TRUE;
+ return sal_True;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWriteAcc )
{
- const ULONG nFormat = pWriteAcc->GetScanlineFormat();
- BYTE cIndex = 0;
- BOOL bFast = FALSE;
+ const sal_uLong nFormat = pWriteAcc->GetScanlineFormat();
+ sal_uInt8 cIndex = 0;
+ sal_Bool bFast = sal_False;
switch( nFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
case( BMP_FORMAT_1BIT_LSB_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = ( cIndex ? 255 : 0 );
- bFast = TRUE;
+ bFast = sal_True;
}
break;
case( BMP_FORMAT_4BIT_MSN_PAL ):
case( BMP_FORMAT_4BIT_LSN_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
cIndex = cIndex | ( cIndex << 4 );
- bFast = TRUE;
+ bFast = sal_True;
}
break;
case( BMP_FORMAT_8BIT_PAL ):
{
- cIndex = (BYTE) pWriteAcc->GetBestPaletteIndex( rFillColor );
- bFast = TRUE;
+ cIndex = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( rFillColor );
+ bFast = sal_True;
}
break;
@@ -571,21 +575,21 @@ BOOL Bitmap::Erase( const Color& rFillColor )
( rFillColor.GetRed() == rFillColor.GetBlue() ) )
{
cIndex = rFillColor.GetRed();
- bFast = TRUE;
+ bFast = sal_True;
}
else
- bFast = FALSE;
+ bFast = sal_False;
}
break;
default:
- bFast = FALSE;
+ bFast = sal_False;
break;
}
if( bFast )
{
- const ULONG nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
+ const sal_uLong nBufSize = pWriteAcc->GetScanlineSize() * pWriteAcc->Height();
memset( pWriteAcc->GetBuffer(), cIndex, nBufSize );
}
else
@@ -597,7 +601,7 @@ BOOL Bitmap::Erase( const Color& rFillColor )
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -605,19 +609,19 @@ BOOL Bitmap::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Invert()
+sal_Bool Bitmap::Invert()
{
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
if( pAcc->HasPalette() )
{
BitmapPalette aBmpPal( pAcc->GetPalette() );
- const USHORT nCount = aBmpPal.GetEntryCount();
+ const sal_uInt16 nCount = aBmpPal.GetEntryCount();
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
aBmpPal[ i ].Invert();
pAcc->SetPalette( aBmpPal );
@@ -633,7 +637,7 @@ BOOL Bitmap::Invert()
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -641,11 +645,11 @@ BOOL Bitmap::Invert()
// ------------------------------------------------------------------
-BOOL Bitmap::Mirror( ULONG nMirrorFlags )
+sal_Bool Bitmap::Mirror( sal_uLong nMirrorFlags )
{
- BOOL bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
- BOOL bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
- BOOL bRet = FALSE;
+ sal_Bool bHorz = ( ( nMirrorFlags & BMP_MIRROR_HORZ ) == BMP_MIRROR_HORZ );
+ sal_Bool bVert = ( ( nMirrorFlags & BMP_MIRROR_VERT ) == BMP_MIRROR_VERT );
+ sal_Bool bRet = sal_False;
if( bHorz && !bVert )
{
@@ -670,7 +674,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else if( bVert && !bHorz )
@@ -680,7 +684,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
if( pAcc )
{
const long nScanSize = pAcc->GetScanlineSize();
- BYTE* pBuffer = new BYTE[ nScanSize ];
+ sal_uInt8* pBuffer = new sal_uInt8[ nScanSize ];
const long nHeight = pAcc->Height();
const long nHeight1 = nHeight - 1L;
const long nHeight_2 = nHeight >> 1L;
@@ -694,7 +698,7 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
delete[] pBuffer;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else if( bHorz && bVert )
@@ -731,26 +735,26 @@ BOOL Bitmap::Mirror( ULONG nMirrorFlags )
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------
-BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
+sal_Bool Bitmap::Rotate( long nAngle10, const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
nAngle10 %= 3600L;
nAngle10 = ( nAngle10 < 0L ) ? ( 3599L + nAngle10 ) : nAngle10;
if( !nAngle10 )
- bRet = TRUE;
+ bRet = sal_True;
else if( 1800L == nAngle10 )
bRet = Mirror( BMP_MIRROR_HORZ | BMP_MIRROR_VERT );
else
@@ -800,7 +804,7 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
Point aTmpPoint;
Rectangle aTmpRectangle( aTmpPoint, aSizePix );
Polygon aPoly( aTmpRectangle );
- aPoly.Rotate( aTmpPoint, (USHORT) nAngle10 );
+ aPoly.Rotate( aTmpPoint, (sal_uInt16) nAngle10 );
Rectangle aNewBound( aPoly.GetBoundRect() );
const Size aNewSizePix( aNewBound.GetSize() );
@@ -876,7 +880,7 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
ReleaseAccess( pReadAcc );
}
- if( ( bRet = !!aRotatedBmp ) == TRUE )
+ if( ( bRet = !!aRotatedBmp ) == sal_True )
ImplAssignWithSize( aRotatedBmp );
}
@@ -885,11 +889,11 @@ BOOL Bitmap::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Crop( const Rectangle& rRectPixel )
+sal_Bool Bitmap::Crop( const Rectangle& rRectPixel )
{
const Size aSizePix( GetSizePixel() );
Rectangle aRect( rRectPixel );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRect.Intersection( Rectangle( Point(), aSizePix ) );
@@ -916,7 +920,7 @@ BOOL Bitmap::Crop( const Rectangle& rRectPixel )
pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPixel( nY2, nX2 ) );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -931,12 +935,12 @@ BOOL Bitmap::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
+sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst,
const Rectangle& rRectSrc, const Bitmap* pBmpSrc )
{
const Size aSizePix( GetSizePixel() );
Rectangle aRectDst( rRectDst );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aRectDst.Intersection( Rectangle( Point(), aSizePix ) );
@@ -947,8 +951,8 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
Bitmap* pSrc = (Bitmap*) pBmpSrc;
const Size aCopySizePix( pSrc->GetSizePixel() );
Rectangle aRectSrc( rRectSrc );
- const USHORT nSrcBitCount = pBmpSrc->GetBitCount();
- const USHORT nDstBitCount = GetBitCount();
+ const sal_uInt16 nSrcBitCount = pBmpSrc->GetBitCount();
+ const sal_uInt16 nDstBitCount = GetBitCount();
if( nSrcBitCount > nDstBitCount )
{
@@ -976,25 +980,25 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
{
const long nSrcCount = pDstAcc->GetPaletteEntryCount();
const long nDstCount = 1 << nDstBitCount;
- BOOL bFound;
+ sal_Bool bFound;
for( long i = 0L; ( i < nSrcCount ) && ( nNextIndex < nSrcCount ); i++ )
{
- const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (USHORT) i );
+ const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( (sal_uInt16) i );
- bFound = FALSE;
+ bFound = sal_False;
for( long j = 0L; j < nDstCount; j++ )
{
- if( rSrcCol == pDstAcc->GetPaletteColor( (USHORT) j ) )
+ if( rSrcCol == pDstAcc->GetPaletteColor( (sal_uInt16) j ) )
{
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
if( !bFound )
- pDstAcc->SetPaletteColor( (USHORT) nNextIndex++, rSrcCol );
+ pDstAcc->SetPaletteColor( (sal_uInt16) nNextIndex++, rSrcCol );
}
}
@@ -1026,14 +1030,14 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
if( pReadAcc->HasPalette() && pWriteAcc->HasPalette() )
{
- const USHORT nCount = pReadAcc->GetPaletteEntryCount();
- BYTE* pMap = new BYTE[ nCount ];
+ const sal_uInt16 nCount = pReadAcc->GetPaletteEntryCount();
+ sal_uInt8* pMap = new sal_uInt8[ nCount ];
// Index-Map fuer Farbtabelle
// aufbauen, da das Bild ja (relativ) farbgenau
// kopiert werden soll
- for( USHORT i = 0; i < nCount; i++ )
- pMap[ i ] = (BYTE) pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) );
+ for( sal_uInt16 i = 0; i < nCount; i++ )
+ pMap[ i ] = (sal_uInt8) pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) );
for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
@@ -1109,7 +1113,7 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1120,9 +1124,9 @@ BOOL Bitmap::CopyPixel( const Rectangle& rRectDst,
// ------------------------------------------------------------------
-BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
+sal_Bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nDX || nDY )
{
@@ -1166,7 +1170,7 @@ BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
pWriteAcc->SetPixel( nY, nX, aColor );
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1181,11 +1185,11 @@ BOOL Bitmap::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor )
// ------------------------------------------------------------------
-Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
+Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
{
Bitmap aNewBmp( GetSizePixel(), 1 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWriteAcc )
{
@@ -1207,7 +1211,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_LSN_PAL )
{
// optimized for 4Bit-MSN/LSN source palette
- const BYTE cTest = aTest.GetIndex();
+ const sal_uInt8 cTest = aTest.GetIndex();
const long nShiftInit = ( ( pReadAcc->GetScanlineFormat() == BMP_FORMAT_4BIT_MSN_PAL ) ? 4 : 0 );
if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
@@ -1245,7 +1249,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
else if( pReadAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
// optimized for 8Bit source palette
- const BYTE cTest = aTest.GetIndex();
+ const sal_uInt8 cTest = aTest.GetIndex();
if( pWriteAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
aWhite.GetIndex() == 1 )
@@ -1352,7 +1356,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, ULONG nTol ) const
}
( (Bitmap*) this )->ReleaseAccess( pReadAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
aNewBmp.ReleaseAccess( pWriteAcc );
@@ -1424,11 +1428,11 @@ Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect ) const
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
+sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -1439,15 +1443,15 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
if( pAcc->HasPalette() )
{
- const USHORT nActColors = pAcc->GetPaletteEntryCount();
- const USHORT nMaxColors = 1 << pAcc->GetBitCount();
+ const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount();
+ const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount();
// erst einmal naechste Farbe nehmen
aReplace = pAcc->GetBestMatchingColor( rReplaceColor );
// falls Palettenbild, und die zu setzende Farbe ist nicht
// in der Palette, suchen wir nach freien Eintraegen (teuer)
- if( pAcc->GetPaletteColor( (BYTE) aReplace ) != BitmapColor( rReplaceColor ) )
+ if( pAcc->GetPaletteColor( (sal_uInt8) aReplace ) != BitmapColor( rReplaceColor ) )
{
// erst einmal nachsehen, ob wir unsere ReplaceColor
// nicht auf einen freien Platz am Ende der Palette
@@ -1456,26 +1460,26 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
{
pAcc->SetPaletteEntryCount( nActColors + 1 );
pAcc->SetPaletteColor( nActColors, rReplaceColor );
- aReplace = BitmapColor( (BYTE) nActColors );
+ aReplace = BitmapColor( (sal_uInt8) nActColors );
}
else
{
- BOOL* pFlags = new BOOL[ nMaxColors ];
+ sal_Bool* pFlags = new sal_Bool[ nMaxColors ];
// alle Eintraege auf 0 setzen
memset( pFlags, 0, nMaxColors );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pFlags[ (BYTE) pAcc->GetPixel( nY, nX ) ] = TRUE;
+ pFlags[ (sal_uInt8) pAcc->GetPixel( nY, nX ) ] = sal_True;
- for( USHORT i = 0UL; i < nMaxColors; i++ )
+ for( sal_uInt16 i = 0UL; i < nMaxColors; i++ )
{
// Hurra, wir haben einen unbenutzten Eintrag
if( !pFlags[ i ] )
{
- pAcc->SetPaletteColor( (USHORT) i, rReplaceColor );
- aReplace = BitmapColor( (BYTE) i );
+ pAcc->SetPaletteColor( (sal_uInt16) i, rReplaceColor );
+ aReplace = BitmapColor( (sal_uInt8) i );
}
}
@@ -1491,7 +1495,7 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
if( pMaskAcc->GetPixel( nY, nX ) == aMaskWhite )
pAcc->SetPixel( nY, nX, aReplace );
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1502,13 +1506,13 @@ BOOL Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
+sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
{
Bitmap aNewBmp( GetSizePixel(), 24 );
BitmapReadAccess* pAcc = AcquireReadAccess();
BitmapReadAccess* pAlphaAcc = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
BitmapWriteAccess* pNewAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc && pAlphaAcc && pNewAcc )
{
@@ -1521,11 +1525,11 @@ BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
for( long nX = 0L; nX < nWidth; nX++ )
{
aCol = pAcc->GetColor( nY, nX );
- pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (BYTE) pAlphaAcc->GetPixel( nY, nX ) ) );
+ pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (sal_uInt8) pAlphaAcc->GetPixel( nY, nX ) ) );
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pAcc );
@@ -1548,7 +1552,7 @@ BOOL Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+sal_Bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
@@ -1556,7 +1560,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
Convert( BMP_CONVERSION_4BIT_COLORS );
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
@@ -1569,7 +1573,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
if( pAcc->HasPalette() )
{
- for( USHORT i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
+ for( sal_uInt16 i = 0, nPalCount = pAcc->GetPaletteEntryCount(); i < nPalCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
@@ -1603,7 +1607,7 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
}
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1611,8 +1615,8 @@ BOOL Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULO
// ------------------------------------------------------------------
-BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
- ULONG nColorCount, ULONG* _pTols )
+sal_Bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
+ sal_uLong nColorCount, sal_uLong* _pTols )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
@@ -1620,7 +1624,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
Convert( BMP_CONVERSION_4BIT_COLORS );
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAcc )
{
@@ -1631,7 +1635,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
long* pMinB = new long[ nColorCount ];
long* pMaxB = new long[ nColorCount ];
long* pTols;
- ULONG i;
+ sal_uLong i;
if( !_pTols )
{
@@ -1656,7 +1660,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
if( pAcc->HasPalette() )
{
- for( USHORT nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
+ for( sal_uInt16 nEntry = 0, nPalCount = pAcc->GetPaletteEntryCount(); nEntry < nPalCount; nEntry++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( nEntry );
@@ -1666,7 +1670,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
pMinG[ i ] <= rCol.GetGreen() && pMaxG[ i ] >= rCol.GetGreen() &&
pMinB[ i ] <= rCol.GetBlue() && pMaxB[ i ] >= rCol.GetBlue() )
{
- pAcc->SetPaletteColor( (USHORT)nEntry, pReplaceColors[ i ] );
+ pAcc->SetPaletteColor( (sal_uInt16)nEntry, pReplaceColors[ i ] );
break;
}
}
@@ -1712,7 +1716,7 @@ BOOL Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
delete[] pMinB;
delete[] pMaxB;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1739,11 +1743,11 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
// ------------------------------------------------------------------
-BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
+sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pMaskAcc && pAcc )
{
@@ -1867,7 +1871,7 @@ BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
break;
}
- bRet = TRUE;
+ bRet = sal_True;
}
( (Bitmap&) rMask ).ReleaseAccess( pMaskAcc );
@@ -1878,7 +1882,7 @@ BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
// ------------------------------------------------------------------
-BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
+sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
{
// TODO: Have a look at OutputDevice::ImplDrawAlpha() for some
// optimizations. Might even consolidate the code here and there.
@@ -1890,7 +1894,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
BitmapReadAccess* pAlphaAcc = const_cast<AlphaMask&>(rAlpha).AcquireReadAccess();
BitmapWriteAccess* pAcc = AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pAlphaAcc && pAcc )
{
@@ -1903,7 +1907,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor,
255 - pAlphaAcc->GetPixel( nY, nX ) ) );
- bRet = TRUE;
+ bRet = sal_True;
}
const_cast<AlphaMask&>(rAlpha).ReleaseAccess( pAlphaAcc );
@@ -1914,7 +1918,7 @@ BOOL Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor )
// ------------------------------------------------------------------
-BOOL Bitmap::MakeMono( BYTE cThreshold )
+sal_Bool Bitmap::MakeMono( sal_uInt8 cThreshold )
{
return ImplMakeMono( cThreshold );
}
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 7c0d565445c5..9db334395e23 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -96,14 +96,14 @@ struct DIBInfoHeader
namespace
{
- inline USHORT discretizeBitcount( UINT16 nInputCount )
+ inline sal_uInt16 discretizeBitcount( sal_uInt16 nInputCount )
{
return ( nInputCount <= 1 ) ? 1 :
( nInputCount <= 4 ) ? 4 :
( nInputCount <= 8 ) ? 8 : 24;
}
- inline bool isBitfieldCompression( ULONG nScanlineFormat )
+ inline bool isBitfieldCompression( sal_uLong nScanlineFormat )
{
return nScanlineFormat == BMP_FORMAT_16BIT_TC_LSB_MASK ||
nScanlineFormat == BMP_FORMAT_32BIT_TC_MASK;
@@ -116,7 +116,7 @@ namespace
SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap )
{
- rBitmap.Read( rIStm, TRUE );
+ rBitmap.Read( rIStm, sal_True );
return rIStm;
}
@@ -124,18 +124,18 @@ SvStream& operator>>( SvStream& rIStm, Bitmap& rBitmap )
SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap )
{
- rBitmap.Write( rOStm, FALSE, TRUE );
+ rBitmap.Write( rOStm, sal_False, sal_True );
return rOStm;
}
// ------------------------------------------------------------------
-BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
+sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader, sal_Bool bIsMSOFormat )
{
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- const ULONG nOldPos = rIStm.Tell();
- ULONG nOffset = 0UL;
- BOOL bRet = FALSE;
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uLong nOldPos = rIStm.Tell();
+ sal_uLong nOffset = 0UL;
+ sal_Bool bRet = sal_False;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -162,16 +162,16 @@ BOOL Bitmap::Read( SvStream& rIStm, BOOL bFileHeader, BOOL bIsMSOFormat )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIsMSOFormat )
+sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bIsMSOFormat )
{
DIBInfoHeader aHeader;
- const ULONG nStmPos = rIStm.Tell();
- BOOL bRet = FALSE;
+ const sal_uLong nStmPos = rIStm.Tell();
+ sal_Bool bRet = sal_False;
sal_Bool bTopDown = sal_False;
if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
- const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
+ const sal_uInt16 nBitCount( discretizeBitcount(aHeader.nBitCount) );
const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
BitmapPalette aDummyPal;
@@ -180,15 +180,15 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
if( pAcc )
{
- USHORT nColors;
+ sal_uInt16 nColors;
SvStream* pIStm;
SvMemoryStream* pMemStm = NULL;
- BYTE* pData = NULL;
+ sal_uInt8* pData = NULL;
if( nBitCount <= 8 )
{
if( aHeader.nColsUsed )
- nColors = (USHORT) aHeader.nColsUsed;
+ nColors = (sal_uInt16) aHeader.nColsUsed;
else
nColors = ( 1 << aHeader.nBitCount );
}
@@ -199,11 +199,11 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
{
ZCodec aCodec;
sal_uInt32 nCodedSize, nUncodedSize;
- ULONG nCodedPos;
+ sal_uLong nCodedPos;
// read coding information
rIStm >> nCodedSize >> nUncodedSize >> aHeader.nCompression;
- pData = (BYTE*) rtl_allocateMemory( nUncodedSize );
+ pData = (sal_uInt8*) rtl_allocateMemory( nUncodedSize );
// decode buffer
nCodedPos = rIStm.Tell();
@@ -218,7 +218,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
// from which we will read the bitmap data
pMemStm = new SvMemoryStream;
pIStm = pMemStm;
- pMemStm->SetBuffer( (char*) pData, nUncodedSize, FALSE, nUncodedSize );
+ pMemStm->SetBuffer( (char*) pData, nUncodedSize, sal_False, nUncodedSize );
nOffset = 0;
}
else
@@ -266,11 +266,11 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset, BOOL bIs
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
+sal_Bool Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
{
- UINT32 nTmp32;
- UINT16 nTmp16 = 0;
- BOOL bRet = FALSE;
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16 = 0;
+ sal_Bool bRet = sal_False;
rIStm >> nTmp16;
@@ -301,7 +301,7 @@ BOOL Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, ULONG& rOffset )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
+sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
{
// BITMAPINFOHEADER or BITMAPCOREHEADER
rIStm >> rHeader.nSize;
@@ -337,7 +337,7 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
// unknown Header
if( rHeader.nSize < DIBINFOHEADERSIZE )
{
- ULONG nUnknownSize = sizeof( rHeader.nSize );
+ sal_uLong nUnknownSize = sizeof( rHeader.nSize );
rIStm >> rHeader.nWidth; nUnknownSize += sizeof( rHeader.nWidth );
rIStm >> rHeader.nHeight; nUnknownSize += sizeof( rHeader.nHeight );
@@ -418,17 +418,17 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL bQuad )
+sal_Bool Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad )
{
- const USHORT nColors = rAcc.GetPaletteEntryCount();
- const ULONG nPalSize = nColors * ( bQuad ? 4UL : 3UL );
+ const sal_uInt16 nColors = rAcc.GetPaletteEntryCount();
+ const sal_uLong nPalSize = nColors * ( bQuad ? 4UL : 3UL );
BitmapColor aPalColor;
- BYTE* pEntries = new BYTE[ nPalSize ];
+ sal_uInt8* pEntries = new sal_uInt8[ nPalSize ];
rIStm.Read( pEntries, nPalSize );
- BYTE* pTmpEntry = pEntries;
- for( USHORT i = 0; i < nColors; i++ )
+ sal_uInt8* pTmpEntry = pEntries;
+ for( sal_uInt16 i = 0; i < nColors; i++ )
{
aPalColor.SetBlue( *pTmpEntry++ );
aPalColor.SetGreen( *pTmpEntry++ );
@@ -447,15 +447,15 @@ BOOL Bitmap::ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, BOOL
// ------------------------------------------------------------------
-BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
+sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown )
{
- const ULONG nAlignedWidth = AlignedWidth4Bytes( rHeader.nWidth * rHeader.nBitCount );
- UINT32 nRMask = 0;
- UINT32 nGMask = 0;
- UINT32 nBMask = 0;
- BOOL bNative;
- BOOL bTCMask = ( rHeader.nBitCount == 16 ) || ( rHeader.nBitCount == 32 );
- BOOL bRLE = ( RLE_8 == rHeader.nCompression && rHeader.nBitCount == 8 ) ||
+ const sal_uLong nAlignedWidth = AlignedWidth4Bytes( rHeader.nWidth * rHeader.nBitCount );
+ sal_uInt32 nRMask = 0;
+ sal_uInt32 nGMask = 0;
+ sal_uInt32 nBMask = 0;
+ sal_Bool bNative;
+ sal_Bool bTCMask = ( rHeader.nBitCount == 16 ) || ( rHeader.nBitCount == 32 );
+ sal_Bool bRLE = ( RLE_8 == rHeader.nCompression && rHeader.nBitCount == 8 ) ||
( RLE_4 == rHeader.nCompression && rHeader.nBitCount == 4 );
// Is native format?
@@ -469,7 +469,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
break;
default:
- bNative = FALSE;
+ bNative = sal_False;
break;
}
// Read data
@@ -511,14 +511,14 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
if ( !rHeader.nSizeImage )
{
- const ULONG nOldPos = rIStm.Tell();
+ const sal_uLong nOldPos = rIStm.Tell();
rIStm.Seek( STREAM_SEEK_TO_END );
rHeader.nSizeImage = rIStm.Tell() - nOldPos;
rIStm.Seek( nOldPos );
}
- BYTE* pBuffer = (BYTE*) rtl_allocateMemory( rHeader.nSizeImage );
+ sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( rHeader.nSizeImage );
rIStm.Read( (char*) pBuffer, rHeader.nSizeImage );
ImplDecodeRLE( pBuffer, rHeader, rAcc, RLE_4 == rHeader.nCompression );
@@ -529,7 +529,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
const long nWidth = rHeader.nWidth;
const long nHeight = abs(rHeader.nHeight);
- BYTE* pBuf = new BYTE[ nAlignedWidth ];
+ sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
// true color DIB's can have a (optimization) palette
if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
@@ -543,8 +543,8 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
case( 1 ):
{
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
for( ; nCount--; nY += nI )
{
@@ -559,7 +559,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> --nShift ) & 1) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> --nShift ) & 1) );
}
}
}
@@ -567,8 +567,8 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 4 ):
{
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
for( ; nCount--; nY += nI )
{
@@ -583,7 +583,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
cTmp = *pTmp++;
}
- rAcc.SetPixel( nY, nX, sal::static_int_cast<BYTE>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
+ rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
}
}
}
@@ -591,7 +591,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 8 ):
{
- BYTE* pTmp;
+ sal_uInt8* pTmp;
for( ; nCount--; nY += nI )
{
@@ -607,15 +607,15 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- UINT16* pTmp16;
+ sal_uInt16* pTmp16;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp16 = (UINT16*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp16 = (sal_uInt16*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor16BitLSB( aColor, (BYTE*) pTmp16++ );
+ aMask.GetColorFor16BitLSB( aColor, (sal_uInt8*) pTmp16++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -625,7 +625,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
case( 24 ):
{
BitmapColor aPixelColor;
- BYTE* pTmp;
+ sal_uInt8* pTmp;
for( ; nCount--; nY += nI )
{
@@ -646,15 +646,15 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
{
ColorMask aMask( nRMask, nGMask, nBMask );
BitmapColor aColor;
- UINT32* pTmp32;
+ sal_uInt32* pTmp32;
for( ; nCount--; nY += nI )
{
- rIStm.Read( (char*)( pTmp32 = (UINT32*) pBuf ), nAlignedWidth );
+ rIStm.Read( (char*)( pTmp32 = (sal_uInt32*) pBuf ), nAlignedWidth );
for( long nX = 0L; nX < nWidth; nX++ )
{
- aMask.GetColorFor32Bit( aColor, (BYTE*) pTmp32++ );
+ aMask.GetColorFor32Bit( aColor, (sal_uInt8*) pTmp32++ );
rAcc.SetPixel( nY, nX, aColor );
}
}
@@ -670,18 +670,18 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
// ------------------------------------------------------------------
-BOOL Bitmap::Write( SvStream& rOStm, BOOL bCompressed, BOOL bFileHeader ) const
+sal_Bool Bitmap::Write( SvStream& rOStm, sal_Bool bCompressed, sal_Bool bFileHeader ) const
{
DBG_ASSERT( mpImpBmp, "Empty Bitmaps can't be saved" );
const Size aSizePix( GetSizePixel() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( mpImpBmp && aSizePix.Width() && aSizePix.Height() )
{
BitmapReadAccess* pAcc = ( (Bitmap*) this)->AcquireReadAccess();
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
- const ULONG nOldPos = rOStm.Tell();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uLong nOldPos = rOStm.Tell();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -712,14 +712,14 @@ BOOL Bitmap::Write( SvStream& rOStm, BOOL bCompressed, BOOL bFileHeader ) const
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompressed ) const
+sal_Bool Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const
{
const MapMode aMapPixel( MAP_PIXEL );
DIBInfoHeader aHeader;
- ULONG nImageSizePos;
- ULONG nEndPos;
+ sal_uLong nImageSizePos;
+ sal_uLong nEndPos;
sal_uInt32 nCompression = 0;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aHeader.nSize = DIBINFOHEADERSIZE;
aHeader.nWidth = rAcc.Width();
@@ -744,7 +744,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// recent.
// #i59239# discretize bitcount to 1,4,8,24 (other cases
// are not written below)
- const UINT16 nBitCount( sal::static_int_cast<UINT16>(rAcc.GetBitCount()) );
+ const sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
aHeader.nBitCount = discretizeBitcount( nBitCount );
aHeader.nSizeImage = rAcc.Height() *
@@ -787,8 +787,8 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
if( fabs(fBmpWidthM) > 0.000000001 &&
fabs(fBmpHeightM) > 0.000000001 )
{
- aHeader.nXPelsPerMeter = (UINT32)(rAcc.Width() / fBmpWidthM + .5);
- aHeader.nYPelsPerMeter = (UINT32)(rAcc.Height() / fBmpHeightM + .5);
+ aHeader.nXPelsPerMeter = (sal_uInt32)(rAcc.Width() / fBmpWidthM + .5);
+ aHeader.nYPelsPerMeter = (sal_uInt32)(rAcc.Height() / fBmpHeightM + .5);
}
}
@@ -814,7 +814,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
{
ZCodec aCodec;
SvMemoryStream aMemStm( aHeader.nSizeImage + 4096, 65535 );
- ULONG nCodedPos = rOStm.Tell(), nLastPos;
+ sal_uLong nCodedPos = rOStm.Tell(), nLastPos;
sal_uInt32 nCodedSize, nUncodedSize;
// write uncoded data palette
@@ -832,7 +832,7 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// write compressed data
aCodec.BeginCompression( 3 );
- aCodec.Write( rOStm, (BYTE*) aMemStm.GetData(), nUncodedSize );
+ aCodec.Write( rOStm, (sal_uInt8*) aMemStm.GetData(), nUncodedSize );
aCodec.EndCompression();
// update compress info ( coded size, uncoded size, uncoded compression )
@@ -862,16 +862,16 @@ BOOL Bitmap::ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bCompre
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
+sal_Bool Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- UINT32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
+ sal_uInt32 nPalCount = ( rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() :
isBitfieldCompression( rAcc.GetScanlineFormat() ) ? 3UL : 0UL );
- UINT32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
+ sal_uInt32 nOffset = 14 + DIBINFOHEADERSIZE + nPalCount * 4UL;
- rOStm << (UINT16) 0x4D42;
- rOStm << (UINT32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
- rOStm << (UINT16) 0;
- rOStm << (UINT16) 0;
+ rOStm << (sal_uInt16) 0x4D42;
+ rOStm << (sal_uInt32) ( nOffset + ( rAcc.Height() * rAcc.GetScanlineSize() ) );
+ rOStm << (sal_uInt16) 0;
+ rOStm << (sal_uInt16) 0;
rOStm << nOffset;
return( rOStm.GetError() == 0UL );
@@ -879,15 +879,15 @@ BOOL Bitmap::ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
+sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
{
- const USHORT nColors = rAcc.GetPaletteEntryCount();
- const ULONG nPalSize = nColors * 4UL;
- BYTE* pEntries = new BYTE[ nPalSize ];
- BYTE* pTmpEntry = pEntries;
+ const sal_uInt16 nColors = rAcc.GetPaletteEntryCount();
+ const sal_uLong nPalSize = nColors * 4UL;
+ sal_uInt8* pEntries = new sal_uInt8[ nPalSize ];
+ sal_uInt8* pTmpEntry = pEntries;
BitmapColor aPalColor;
- for( USHORT i = 0; i < nColors; i++ )
+ for( sal_uInt16 i = 0; i < nColors; i++ )
{
const BitmapColor& rPalColor = rAcc.GetPaletteColor( i );
@@ -905,8 +905,8 @@ BOOL Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
- ULONG nCompression, sal_uInt32& rImageSize )
+sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
+ sal_uLong nCompression, sal_uInt32& rImageSize )
{
if( BITFIELDS == nCompression )
{
@@ -914,13 +914,13 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
SVBT32 aVal32;
UInt32ToSVBT32( rMask.GetRedMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetGreenMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
UInt32ToSVBT32( rMask.GetBlueMask(), aVal32 );
- rOStm.Write( (BYTE*) aVal32, 4UL );
+ rOStm.Write( (sal_uInt8*) aVal32, 4UL );
rImageSize = rOStm.Tell();
@@ -947,10 +947,10 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
// bitmaps is relatively recent.
// #i59239# discretize bitcount for aligned width to 1,4,8,24
// (other cases are not written below)
- const USHORT nBitCount( sal::static_int_cast<USHORT>(rAcc.GetBitCount()) );
- const ULONG nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
+ const sal_uInt16 nBitCount( sal::static_int_cast<sal_uInt16>(rAcc.GetBitCount()) );
+ const sal_uLong nAlignedWidth = AlignedWidth4Bytes( rAcc.Width() *
discretizeBitcount(nBitCount));
- BOOL bNative = FALSE;
+ sal_Bool bNative = sal_False;
switch( rAcc.GetScanlineFormat() )
{
@@ -960,7 +960,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
case( BMP_FORMAT_24BIT_TC_BGR ):
{
if( rAcc.IsBottomUp() && ( rAcc.GetScanlineSize() == nAlignedWidth ) )
- bNative = TRUE;
+ bNative = sal_True;
}
break;
@@ -976,9 +976,9 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
{
const long nWidth = rAcc.Width();
const long nHeight = rAcc.Height();
- BYTE* pBuf = new BYTE[ nAlignedWidth ];
- BYTE* pTmp;
- BYTE cTmp;
+ sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
+ sal_uInt8* pTmp;
+ sal_uInt8 cTmp;
switch( nBitCount )
{
@@ -998,7 +998,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << --nShift );
+ cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << --nShift );
}
*pTmp = cTmp;
@@ -1023,7 +1023,7 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
cTmp = 0;
}
- cTmp |= ( (BYTE) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
+ cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
}
*pTmp = cTmp;
rOStm.Write( pBuf, nAlignedWidth );
@@ -1081,17 +1081,17 @@ BOOL Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
// ------------------------------------------------------------------
-void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
- BitmapWriteAccess& rAcc, BOOL bRLE4 )
+void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
+ BitmapWriteAccess& rAcc, sal_Bool bRLE4 )
{
Scanline pRLE = pBuffer;
long nY = abs(rHeader.nHeight) - 1L;
- const ULONG nWidth = rAcc.Width();
- ULONG nCountByte;
- ULONG nRunByte;
- ULONG nX = 0UL;
- BYTE cTmp;
- BOOL bEndDecoding = FALSE;
+ const sal_uLong nWidth = rAcc.Width();
+ sal_uLong nCountByte;
+ sal_uLong nRunByte;
+ sal_uLong nX = 0UL;
+ sal_uInt8 cTmp;
+ sal_Bool bEndDecoding = sal_False;
do
{
@@ -1105,7 +1105,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
{
nCountByte = nRunByte >> 1;
- for( ULONG i = 0UL; i < nCountByte; i++ )
+ for( sal_uLong i = 0UL; i < nCountByte; i++ )
{
cTmp = *pRLE++;
@@ -1129,7 +1129,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( ULONG i = 0UL; i < nRunByte; i++ )
+ for( sal_uLong i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, *pRLE );
@@ -1147,7 +1147,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
nX = 0UL;
}
else if( nRunByte == 1 )
- bEndDecoding = TRUE;
+ bEndDecoding = sal_True;
else
{
nX += *pRLE++;
@@ -1162,7 +1162,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
{
nRunByte = nCountByte >> 1;
- for( ULONG i = 0UL; i < nRunByte; i++ )
+ for( sal_uLong i = 0UL; i < nRunByte; i++ )
{
if( nX < nWidth )
rAcc.SetPixel( nY, nX++, cTmp >> 4 );
@@ -1176,7 +1176,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
}
else
{
- for( ULONG i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
+ for( sal_uLong i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
rAcc.SetPixel( nY, nX++, cTmp );
}
}
@@ -1186,19 +1186,19 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
// ------------------------------------------------------------------
-BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
+sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 )
{
- const ULONG nWidth = rAcc.Width();
- const ULONG nHeight = rAcc.Height();
- ULONG nX;
- ULONG nSaveIndex;
- ULONG nCount;
- ULONG nBufCount;
- BYTE* pBuf = new BYTE[ ( nWidth << 1 ) + 2 ];
- BYTE* pTmp;
- BYTE cPix;
- BYTE cLast;
- BOOL bFound;
+ const sal_uLong nWidth = rAcc.Width();
+ const sal_uLong nHeight = rAcc.Height();
+ sal_uLong nX;
+ sal_uLong nSaveIndex;
+ sal_uLong nCount;
+ sal_uLong nBufCount;
+ sal_uInt8* pBuf = new sal_uInt8[ ( nWidth << 1 ) + 2 ];
+ sal_uInt8* pTmp;
+ sal_uInt8 cPix;
+ sal_uInt8 cLast;
+ sal_Bool bFound;
for ( long nY = nHeight - 1L; nY >= 0L; nY-- )
{
@@ -1218,7 +1218,7 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
if ( nCount > 1 )
{
- *pTmp++ = (BYTE) nCount;
+ *pTmp++ = (sal_uInt8) nCount;
*pTmp++ = ( bRLE4 ? ( ( cPix << 4 ) | cPix ) : cPix );
nBufCount += 2;
}
@@ -1226,13 +1226,13 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
{
cLast = cPix;
nSaveIndex = nX - 1UL;
- bFound = FALSE;
+ bFound = sal_False;
while( ( nX < nWidth ) && ( nCount < 256L ) && ( cPix = rAcc.GetPixel( nY, nX ) ) != cLast )
{
nX++; nCount++;
cLast = cPix;
- bFound = TRUE;
+ bFound = sal_True;
}
if ( bFound )
@@ -1241,13 +1241,13 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
if ( nCount > 3 )
{
*pTmp++ = 0;
- *pTmp++ = (BYTE) --nCount;
+ *pTmp++ = (sal_uInt8) --nCount;
if( bRLE4 )
{
- for ( ULONG i = 0; i < nCount; i++, pTmp++ )
+ for ( sal_uLong i = 0; i < nCount; i++, pTmp++ )
{
- *pTmp = (BYTE) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
+ *pTmp = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
if ( ++i < nCount )
*pTmp |= rAcc.GetPixel( nY, nSaveIndex++ );
@@ -1257,7 +1257,7 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
}
else
{
- for( ULONG i = 0UL; i < nCount; i++ )
+ for( sal_uLong i = 0UL; i < nCount; i++ )
*pTmp++ = rAcc.GetPixel( nY, nSaveIndex++ );
}
@@ -1272,12 +1272,12 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
else
{
*pTmp++ = 1;
- *pTmp++ = (BYTE) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
if ( nCount == 3 )
{
*pTmp++ = 1;
- *pTmp++ = (BYTE) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+ *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
nBufCount += 4;
}
else
@@ -1292,8 +1292,8 @@ BOOL Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, BOOL bRLE4 )
rOStm.Write( pBuf, nBufCount );
}
- rOStm << (BYTE) 0;
- rOStm << (BYTE) 1;
+ rOStm << (sal_uInt8) 0;
+ rOStm << (sal_uInt8) 1;
delete[] pBuf;
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index f246ecd31058..c2d929ea4fa0 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -41,8 +41,8 @@
// - Defines -
// -----------
-#define RGB15( _def_cR, _def_cG, _def_cB ) (((ULONG)(_def_cR)<<10UL)|((ULONG)(_def_cG)<<5UL)|(ULONG)(_def_cB))
-#define GAMMA( _def_cVal, _def_InvGamma ) ((BYTE)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
+#define RGB15( _def_cR, _def_cG, _def_cB ) (((sal_uLong)(_def_cR)<<10UL)|((sal_uLong)(_def_cG)<<5UL)|(sal_uLong)(_def_cB))
+#define GAMMA( _def_cVal, _def_InvGamma ) ((sal_uInt8)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
#define CALC_ERRORS \
nTemp = p1T[nX++] >> 12; \
@@ -77,13 +77,13 @@
// - Statics -
// -----------
-ULONG nVCLRLut[ 6 ] = { 16, 17, 18, 19, 20, 21 };
-ULONG nVCLGLut[ 6 ] = { 0, 6, 12, 18, 24, 30 };
-ULONG nVCLBLut[ 6 ] = { 0, 36, 72, 108, 144, 180 };
+sal_uLong nVCLRLut[ 6 ] = { 16, 17, 18, 19, 20, 21 };
+sal_uLong nVCLGLut[ 6 ] = { 0, 6, 12, 18, 24, 30 };
+sal_uLong nVCLBLut[ 6 ] = { 0, 36, 72, 108, 144, 180 };
// ------------------------------------------------------------------------
-ULONG nVCLDitherLut[ 256 ] =
+sal_uLong nVCLDitherLut[ 256 ] =
{
0, 49152, 12288, 61440, 3072, 52224, 15360, 64512, 768, 49920, 13056,
62208, 3840, 52992, 16128, 65280, 32768, 16384, 45056, 28672, 35840, 19456,
@@ -113,7 +113,7 @@ ULONG nVCLDitherLut[ 256 ] =
// ------------------------------------------------------------------------
-ULONG nVCLLut[ 256 ] =
+sal_uLong nVCLLut[ 256 ] =
{
0, 1286, 2572, 3858, 5144, 6430, 7716, 9002,
10288, 11574, 12860, 14146, 15432, 16718, 18004, 19290,
@@ -243,14 +243,14 @@ long FloydIndexMap[6] =
// - ImplCreateDitherMatrix -
// --------------------------
-void ImplCreateDitherMatrix( BYTE (*pDitherMatrix)[16][16] )
+void ImplCreateDitherMatrix( sal_uInt8 (*pDitherMatrix)[16][16] )
{
double fVal = 3.125;
const double fVal16 = fVal / 16.;
long i, j, k, l;
- USHORT pMtx[ 16 ][ 16 ];
- USHORT nMax = 0;
- static BYTE pMagic[4][4] = { { 0, 14, 3, 13, },
+ sal_uInt16 pMtx[ 16 ][ 16 ];
+ sal_uInt16 nMax = 0;
+ static sal_uInt8 pMagic[4][4] = { { 0, 14, 3, 13, },
{11, 5, 8, 6, },
{12, 2, 15, 1, },
{7, 9, 4, 10 } };
@@ -261,22 +261,22 @@ void ImplCreateDitherMatrix( BYTE (*pDitherMatrix)[16][16] )
for ( k = 0; k < 4; k++ )
for ( l = 0; l < 4; l++ )
nMax = Max ( pMtx[ (k<<2) + i][(l<<2 ) + j] =
- (USHORT) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax );
+ (sal_uInt16) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax );
// auf Intervall [0;254] skalieren
for ( i = 0, fVal = 254. / nMax; i < 16; i++ )
for( j = 0; j < 16; j++ )
- (*pDitherMatrix)[i][j] = (BYTE) ( fVal * pMtx[i][j] );
+ (*pDitherMatrix)[i][j] = (sal_uInt8) ( fVal * pMtx[i][j] );
}
// ----------
// - Bitmap -
// ----------
-BOOL Bitmap::Convert( BmpConversion eConversion )
+sal_Bool Bitmap::Convert( BmpConversion eConversion )
{
- const USHORT nBitCount = GetBitCount();
- BOOL bRet = FALSE;
+ const sal_uInt16 nBitCount = GetBitCount();
+ sal_Bool bRet = sal_False;
switch( eConversion )
{
@@ -299,7 +299,7 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 4 )
bRet = ImplConvertDown( 4, NULL );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -325,7 +325,7 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
else if( nBitCount > 8 )
bRet = ImplConvertDown( 8 );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -343,9 +343,9 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
case( BMP_CONVERSION_24BIT ):
{
if( nBitCount < 24 )
- bRet = ImplConvertUp( 24, FALSE );
+ bRet = ImplConvertUp( 24, sal_False );
else
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -363,10 +363,10 @@ BOOL Bitmap::Convert( BmpConversion eConversion )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
+sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -414,7 +414,7 @@ BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -436,10 +436,10 @@ BOOL Bitmap::ImplMakeMono( BYTE cThreshold )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeMonoDither()
+sal_Bool Bitmap::ImplMakeMonoDither()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -452,7 +452,7 @@ BOOL Bitmap::ImplMakeMonoDither()
const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
- BYTE pDitherMatrix[ 16 ][ 16 ];
+ sal_uInt8 pDitherMatrix[ 16 ][ 16 ];
ImplCreateDitherMatrix( &pDitherMatrix );
@@ -490,7 +490,7 @@ BOOL Bitmap::ImplMakeMonoDither()
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -512,18 +512,18 @@ BOOL Bitmap::ImplMakeMonoDither()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
+sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys )
{
DBG_ASSERT( nGreys == 16 || nGreys == 256, "Only 16 or 256 greyscales are supported!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
const BitmapPalette& rPal = GetGreyPalette( nGreys );
- ULONG nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
- BOOL bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
+ sal_uLong nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
+ sal_Bool bPalDiffers = !pReadAcc->HasPalette() || ( rPal.GetEntryCount() != pReadAcc->GetPaletteEntryCount() );
if( !bPalDiffers )
bPalDiffers = ( (BitmapPalette&) rPal != pReadAcc->GetPalette() );
@@ -545,7 +545,7 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
pWriteAcc->SetPixel( nY, nX,
- (BYTE) ( pReadAcc->GetPaletteColor(
+ (sal_uInt8) ( pReadAcc->GetPaletteColor(
pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ) );
}
}
@@ -562,11 +562,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const ULONG nB = *pReadScan++;
- const ULONG nG = *pReadScan++;
- const ULONG nR = *pReadScan++;
+ const sal_uLong nB = *pReadScan++;
+ const sal_uLong nG = *pReadScan++;
+ const sal_uLong nR = *pReadScan++;
- *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -582,11 +582,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
for( long nX = 0L; nX < nWidth; nX++ )
{
- const ULONG nR = *pReadScan++;
- const ULONG nG = *pReadScan++;
- const ULONG nB = *pReadScan++;
+ const sal_uLong nR = *pReadScan++;
+ const sal_uLong nG = *pReadScan++;
+ const sal_uLong nB = *pReadScan++;
- *pWriteScan++ = (BYTE) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
+ *pWriteScan++ = (sal_uInt8) ( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
}
}
}
@@ -594,11 +594,11 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<BYTE>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
+ pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -617,7 +617,7 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
else
{
ReleaseAccess( pReadAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -626,12 +626,12 @@ BOOL Bitmap::ImplMakeGreyscales( USHORT nGreys )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
+sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount > GetBitCount(), "New BitCount must be greater!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -646,12 +646,12 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
if( pWriteAcc->HasPalette() )
{
- const USHORT nOldCount = 1 << GetBitCount();
+ const sal_uInt16 nOldCount = 1 << GetBitCount();
const BitmapPalette& rOldPal = pReadAcc->GetPalette();
aPal.SetEntryCount( 1 << nBitCount );
- for( USHORT i = 0; i < nOldCount; i++ )
+ for( sal_uInt16 i = 0; i < nOldCount; i++ )
aPal[ i ] = rOldPal[ i ];
if( pExtColor )
@@ -680,7 +680,7 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -702,12 +702,12 @@ BOOL Bitmap::ImplConvertUp( USHORT nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
+sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor )
{
DBG_ASSERT( nBitCount <= GetBitCount(), "New BitCount must be lower ( or equal when pExtColor is set )!" );
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -717,7 +717,7 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
if( pWriteAcc )
{
- const USHORT nCount = 1 << nBitCount;
+ const sal_uInt16 nCount = 1 << nBitCount;
const long nWidth = pWriteAcc->Width();
const long nWidth1 = nWidth - 1L;
const long nHeight = pWriteAcc->Height();
@@ -731,8 +731,8 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
ImpErrorQuad* pQLine2 = 0;
long nX, nY;
long nYTmp = 0L;
- BYTE cIndex;
- BOOL bQ1 = TRUE;
+ sal_uInt8 cIndex;
+ sal_Bool bQ1 = sal_True;
if( pExtColor )
{
@@ -764,12 +764,12 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
for( nY = 0L; nY < nHeight; nY++, nYTmp++ )
{
// erstes ZeilenPixel
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, 0, cIndex );
for( nX = 1L; nX < nWidth1; nX++ )
{
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( aColor = pQLine1[ nX ].ImplGetColor() );
aErrQuad = ( ImpErrorQuad( aColor ) -= pWriteAcc->GetPaletteColor( cIndex ) );
pQLine1[ ++nX ].ImplAddColorError7( aErrQuad );
pQLine2[ nX-- ].ImplAddColorError1( aErrQuad );
@@ -781,13 +781,13 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
// letztes ZeilenPixel
if( nX < nWidth )
{
- cIndex = (BYTE) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
+ cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
pWriteAcc->SetPixel( nY, nX, cIndex );
}
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
{
@@ -806,7 +806,7 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
delete[] pErrQuad2;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -828,11 +828,11 @@ BOOL Bitmap::ImplConvertDown( USHORT nBitCount, Color* pExtColor )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplConvertGhosted()
+sal_Bool Bitmap::ImplConvertGhosted()
{
Bitmap aNewBmp;
BitmapReadAccess* pR = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pR )
{
@@ -842,8 +842,8 @@ BOOL Bitmap::ImplConvertGhosted()
for( long i = 0, nCount = aNewPal.GetEntryCount(); i < nCount; i++ )
{
- const BitmapColor& rOld = pR->GetPaletteColor( (USHORT) i );
- aNewPal[ (USHORT) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
+ const BitmapColor& rOld = pR->GetPaletteColor( (sal_uInt16) i );
+ aNewPal[ (sal_uInt16) i ] = BitmapColor( ( rOld.GetRed() >> 1 ) | 0x80,
( rOld.GetGreen() >> 1 ) | 0x80,
( rOld.GetBlue() >> 1 ) | 0x80 );
}
@@ -855,7 +855,7 @@ BOOL Bitmap::ImplConvertGhosted()
{
pW->CopyBuffer( *pR );
aNewBmp.ReleaseAccess( pW );
- bRet = TRUE;
+ bRet = sal_True;
}
}
else
@@ -881,7 +881,7 @@ BOOL Bitmap::ImplConvertGhosted()
}
aNewBmp.ReleaseAccess( pW );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -904,9 +904,9 @@ BOOL Bitmap::ImplConvertGhosted()
// ------------------------------------------------------------------------
-BOOL Bitmap::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet;
+ sal_Bool bRet;
if( ( rScaleX != 1.0 ) || ( rScaleY != 1.0 ) )
{
@@ -915,20 +915,20 @@ BOOL Bitmap::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFl
else if( BMP_SCALE_INTERPOLATE == nScaleFlag )
bRet = ImplScaleInterpolate( rScaleX, rScaleY );
else
- bRet = FALSE;
+ bRet = sal_False;
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
const Size aSize( GetSizePixel() );
- BOOL bRet;
+ sal_Bool bRet;
if( aSize.Width() && aSize.Height() )
{
@@ -937,19 +937,19 @@ BOOL Bitmap::Scale( const Size& rNewSize, ULONG nScaleFlag )
nScaleFlag );
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
+sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
{
const Size aSizePix( GetSizePixel() );
const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nNewWidth && nNewHeight )
{
@@ -962,8 +962,8 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
const long nScanlineSize = pWriteAcc->GetScanlineSize();
const long nNewWidth1 = nNewWidth - 1L;
const long nNewHeight1 = nNewHeight - 1L;
- const long nWidth1 = pReadAcc->Width() - 1L;
- const long nHeight1 = pReadAcc->Height() - 1L;
+ const long nWidth = pReadAcc->Width();
+ const long nHeight = pReadAcc->Height();
long* pLutX = new long[ nNewWidth ];
long* pLutY = new long[ nNewHeight ];
@@ -972,10 +972,10 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
long nX, nY, nMapY, nActY = 0L;
for( nX = 0L; nX < nNewWidth; nX++ )
- pLutX[ nX ] = nX * nWidth1 / nNewWidth1;
+ pLutX[ nX ] = nX * nWidth / nNewWidth;
for( nY = 0L; nY < nNewHeight; nY++ )
- pLutY[ nY ] = nY * nHeight1 / nNewHeight1;
+ pLutY[ nY ] = nY * nHeight / nNewHeight;
while( nActY < nNewHeight )
{
@@ -994,7 +994,7 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
nActY++;
}
- bRet = TRUE;
+ bRet = sal_True;
}
delete[] pLutX;
@@ -1013,12 +1013,12 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY )
+sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY )
{
const Size aSizePix( GetSizePixel() );
const long nNewWidth = FRound( aSizePix.Width() * rScaleX );
const long nNewHeight = FRound( aSizePix.Height() * rScaleY );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( nNewWidth > 1L ) && ( nNewHeight > 1L ) )
{
@@ -1079,9 +1079,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1114,9 +1114,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1126,7 +1126,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
delete[] pLutInt;
delete[] pLutFrac;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1134,7 +1134,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
ImplAssignWithSize( aNewBmp );
pReadAcc = AcquireReadAccess();
aNewBmp = Bitmap( Size( nNewWidth, nNewHeight ), 24 );
@@ -1183,9 +1183,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1218,9 +1218,9 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
lXG1 = aCol1.GetGreen() - ( lXG0 = aCol0.GetGreen() );
lXB1 = aCol1.GetBlue() - ( lXB0 = aCol0.GetBlue() );
- aCol0.SetRed( (BYTE) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
- aCol0.SetGreen( (BYTE) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
- aCol0.SetBlue( (BYTE) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
+ aCol0.SetRed( (sal_uInt8) ( ( lXR1 * nTemp + ( lXR0 << 10 ) ) >> 10 ) );
+ aCol0.SetGreen( (sal_uInt8) ( ( lXG1 * nTemp + ( lXG0 << 10 ) ) >> 10 ) );
+ aCol0.SetBlue( (sal_uInt8) ( ( lXB1 * nTemp + ( lXB0 << 10 ) ) >> 10 ) );
pWriteAcc->SetPixel( nY, nX, aCol0 );
}
@@ -1230,7 +1230,7 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
delete[] pLutInt;
delete[] pLutFrac;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1249,14 +1249,14 @@ BOOL Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rScaleY
// ------------------------------------------------------------------------
-BOOL Bitmap::Dither( ULONG nDitherFlags )
+sal_Bool Bitmap::Dither( sal_uLong nDitherFlags )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
const Size aSizePix( GetSizePixel() );
if( aSizePix.Width() == 1 || aSizePix.Height() == 1 )
- bRet = TRUE;
+ bRet = sal_True;
else if( nDitherFlags & BMP_DITHER_MATRIX )
bRet = ImplDitherMatrix();
else if( nDitherFlags & BMP_DITHER_FLOYD )
@@ -1269,55 +1269,55 @@ BOOL Bitmap::Dither( ULONG nDitherFlags )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherMatrix()
+sal_Bool Bitmap::ImplDitherMatrix()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
Bitmap aNewBmp( GetSizePixel(), 8 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc && pWriteAcc )
{
- const ULONG nWidth = pReadAcc->Width();
- const ULONG nHeight = pReadAcc->Height();
- BitmapColor aIndex( (BYTE) 0 );
+ const sal_uLong nWidth = pReadAcc->Width();
+ const sal_uLong nHeight = pReadAcc->Height();
+ BitmapColor aIndex( (sal_uInt8) 0 );
if( pReadAcc->HasPalette() )
{
- for( ULONG nY = 0UL; nY < nHeight; nY++ )
+ for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
- for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) );
- const ULONG nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
- const ULONG nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
- const ULONG nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
- const ULONG nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
+ const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
+ const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
+ const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
+ const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
else
{
- for( ULONG nY = 0UL; nY < nHeight; nY++ )
+ for( sal_uLong nY = 0UL; nY < nHeight; nY++ )
{
- for( ULONG nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
+ for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
{
const BitmapColor aCol( pReadAcc->GetPixel( nY, nX ) );
- const ULONG nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
- const ULONG nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
- const ULONG nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
- const ULONG nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
+ const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
+ const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
+ const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
+ const sal_uLong nB = ( nVCLLut[ aCol.GetBlue() ] + nD ) >> 16UL;
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ nR ] + nVCLGLut[ nG ] + nVCLBLut[ nB ] ) );
pWriteAcc->SetPixel( nY, nX, aIndex );
}
}
}
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1339,10 +1339,10 @@ BOOL Bitmap::ImplDitherMatrix()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherFloyd()
+sal_Bool Bitmap::ImplDitherFloyd()
{
const Size aSize( GetSizePixel() );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( aSize.Width() > 3 ) && ( aSize.Height() > 2 ) )
{
@@ -1368,7 +1368,7 @@ BOOL Bitmap::ImplDitherFloyd()
long* p1T = p1;
long* p2T = p2;
long* pTmp;
- BOOL bPal = pReadAcc->HasPalette();
+ sal_Bool bPal = pReadAcc->HasPalette();
pTmp = p2T;
@@ -1433,7 +1433,7 @@ BOOL Bitmap::ImplDitherFloyd()
CALC_TABLES7;
nX -= 5;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
// mittlere Pixel ueber Schleife
long nXAcc;
@@ -1444,7 +1444,7 @@ BOOL Bitmap::ImplDitherFloyd()
nX -= 8;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
// letztes Pixel gesondert betrachten
@@ -1452,12 +1452,12 @@ BOOL Bitmap::ImplDitherFloyd()
nX -= 5;
CALC_TABLES3;
CALC_TABLES5;
- pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (BYTE) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+ pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
}
delete[] p1;
delete[] p2;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1480,12 +1480,12 @@ BOOL Bitmap::ImplDitherFloyd()
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplDitherFloyd16()
+sal_Bool Bitmap::ImplDitherFloyd16()
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
Bitmap aNewBmp( GetSizePixel(), 24 );
BitmapWriteAccess* pWriteAcc = aNewBmp.AcquireWriteAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc && pWriteAcc )
{
@@ -1501,7 +1501,7 @@ BOOL Bitmap::ImplDitherFloyd16()
ImpErrorQuad* pQLine2 = 0;
long nX, nY;
long nYTmp = 0L;
- BOOL bQ1 = TRUE;
+ sal_Bool bQ1 = sal_True;
for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ )
for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ )
@@ -1539,7 +1539,7 @@ BOOL Bitmap::ImplDitherFloyd16()
// Zeilenpuffer neu fuellen/kopieren
pQLine1 = pQLine2;
- pQLine2 = ( bQ1 = !bQ1 ) != FALSE ? pErrQuad2 : pErrQuad1;
+ pQLine2 = ( bQ1 = !bQ1 ) != sal_False ? pErrQuad2 : pErrQuad1;
if( nYTmp < nHeight )
for( nX = 0L; nX < nWidth; nX++ )
@@ -1549,7 +1549,7 @@ BOOL Bitmap::ImplDitherFloyd16()
// Zeilenpuffer zerstoeren
delete[] pErrQuad1;
delete[] pErrQuad2;
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -1571,12 +1571,12 @@ BOOL Bitmap::ImplDitherFloyd16()
// ------------------------------------------------------------------------
-BOOL Bitmap::ReduceColors( USHORT nColorCount, BmpReduce eReduce )
+sal_Bool Bitmap::ReduceColors( sal_uInt16 nColorCount, BmpReduce eReduce )
{
- BOOL bRet;
+ sal_Bool bRet;
- if( GetColorCount() <= (ULONG) nColorCount )
- bRet = TRUE;
+ if( GetColorCount() <= (sal_uLong) nColorCount )
+ bRet = sal_True;
else if( nColorCount )
{
if( BMP_REDUCE_SIMPLE == eReduce )
@@ -1587,20 +1587,20 @@ BOOL Bitmap::ReduceColors( USHORT nColorCount, BmpReduce eReduce )
bRet = ImplReduceMedian( nColorCount );
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReduceSimple( USHORT nColorCount )
+sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount )
{
Bitmap aNewBmp;
BitmapReadAccess* pRAcc = AcquireReadAccess();
- const USHORT nColCount = Min( nColorCount, (USHORT) 256 );
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ const sal_uInt16 nColCount = Min( nColorCount, (sal_uInt16) 256 );
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount <= 2 )
nBitCount = 1;
@@ -1627,17 +1627,17 @@ BOOL Bitmap::ImplReduceSimple( USHORT nColorCount )
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX =0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
}
else
{
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX =0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
}
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pRAcc );
@@ -1682,11 +1682,11 @@ extern "C" int __LOADONCALLAPI ImplPopularCmpFnc( const void* p1, const void* p2
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReducePopular( USHORT nColCount )
+sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
{
BitmapReadAccess* pRAcc = AcquireReadAccess();
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount > 256 )
nColCount = 256;
@@ -1755,12 +1755,12 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
qsort( pCountTable, nTotalColors, sizeof( PopularColorCount ), ImplPopularCmpFnc );
- for( USHORT n = 0; n < nColCount; n++ )
+ for( sal_uInt16 n = 0; n < nColCount; n++ )
{
const PopularColorCount& rPop = pCountTable[ n ];
- aNewPal[ n ] = BitmapColor( (BYTE) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
- (BYTE) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
- (BYTE) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
+ aNewPal[ n ] = BitmapColor( (sal_uInt8) ( ( rPop.mnIndex >> nLeftShiftBits2 ) << nRightShiftBits ),
+ (sal_uInt8) ( ( ( rPop.mnIndex >> nLeftShiftBits1 ) & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ),
+ (sal_uInt8) ( ( rPop.mnIndex & ( nColorsPerComponent - 1 ) ) << nRightShiftBits ) );
}
Bitmap aNewBmp( GetSizePixel(), nBitCount, &aNewPal );
@@ -1768,13 +1768,13 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
if( pWAcc )
{
- BitmapColor aDstCol( (BYTE) 0 );
- BYTE* pIndexMap = new BYTE[ nTotalColors ];
+ BitmapColor aDstCol( (sal_uInt8) 0 );
+ sal_uInt8* pIndexMap = new sal_uInt8[ nTotalColors ];
for( nR = 0, nIndex = 0; nR < 256; nR += nColorOffset )
for( nG = 0; nG < 256; nG += nColorOffset )
for( nB = 0; nB < 256; nB += nColorOffset )
- pIndexMap[ nIndex++ ] = (BYTE) aNewPal.GetBestIndex( BitmapColor( (BYTE) nR, (BYTE) nG, (BYTE) nB ) );
+ pIndexMap[ nIndex++ ] = (sal_uInt8) aNewPal.GetBestIndex( BitmapColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB ) );
if( pRAcc->HasPalette() )
{
@@ -1807,7 +1807,7 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
delete[] pIndexMap;
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
delete[] pCountTable;
@@ -1829,11 +1829,11 @@ BOOL Bitmap::ImplReducePopular( USHORT nColCount )
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
+sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
{
BitmapReadAccess* pRAcc = AcquireReadAccess();
- USHORT nBitCount;
- BOOL bRet = FALSE;
+ sal_uInt16 nBitCount;
+ sal_Bool bRet = sal_False;
if( nColCount < 17 )
nBitCount = 4;
@@ -1853,8 +1853,8 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
if( pWAcc )
{
- const ULONG nSize = 32768UL * sizeof( ULONG );
- ULONG* pColBuf = (ULONG*) rtl_allocateMemory( nSize );
+ const sal_uLong nSize = 32768UL * sizeof( sal_uLong );
+ sal_uLong* pColBuf = (sal_uLong*) rtl_allocateMemory( nSize );
const long nWidth = pWAcc->Width();
const long nHeight = pWAcc->Height();
long nIndex = 0L;
@@ -1895,11 +1895,11 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
pWAcc->SetPalette( aPal );
for( long nY = 0L; nY < nHeight; nY++ )
for( long nX = 0L; nX < nWidth; nX++ )
- pWAcc->SetPixel( nY, nX, (BYTE) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
+ pWAcc->SetPixel( nY, nX, (sal_uInt8) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
rtl_freeMemory( pColBuf );
aNewBmp.ReleaseAccess( pWAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pRAcc );
@@ -1920,7 +1920,7 @@ BOOL Bitmap::ImplReduceMedian( USHORT nColCount )
// ------------------------------------------------------------------------
-void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
+void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
long nR1, long nR2, long nG1, long nG2, long nB1, long nB2,
long nColors, long nPixels, long& rIndex )
{
@@ -1932,16 +1932,16 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
const long nGLen = nG2 - nG1;
const long nBLen = nB2 - nB1;
long nR, nG, nB;
- ULONG* pBuf = pColBuf;
+ sal_uLong* pBuf = pColBuf;
if( !nRLen && !nGLen && !nBLen )
{
if( pBuf[ RGB15( nR1, nG1, nB1 ) ] )
{
- aCol.SetRed( (BYTE) ( nR1 << 3 ) );
- aCol.SetGreen( (BYTE) ( nG1 << 3 ) );
- aCol.SetBlue( (BYTE) ( nB1 << 3 ) );
- rPal[ (USHORT) rIndex++ ] = aCol;
+ aCol.SetRed( (sal_uInt8) ( nR1 << 3 ) );
+ aCol.SetGreen( (sal_uInt8) ( nG1 << 3 ) );
+ aCol.SetBlue( (sal_uInt8) ( nB1 << 3 ) );
+ rPal[ (sal_uInt16) rIndex++ ] = aCol;
}
}
else
@@ -1968,10 +1968,10 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
}
}
- aCol.SetRed( (BYTE) ( ( nRSum / nPixels ) << 3 ) );
- aCol.SetGreen( (BYTE) ( ( nGSum / nPixels ) << 3 ) );
- aCol.SetBlue( (BYTE) ( ( nBSum / nPixels ) << 3 ) );
- rPal[ (USHORT) rIndex++ ] = aCol;
+ aCol.SetRed( (sal_uInt8) ( ( nRSum / nPixels ) << 3 ) );
+ aCol.SetGreen( (sal_uInt8) ( ( nGSum / nPixels ) << 3 ) );
+ aCol.SetBlue( (sal_uInt8) ( ( nBSum / nPixels ) << 3 ) );
+ rPal[ (sal_uInt16) rIndex++ ] = aCol;
}
else
{
@@ -2054,32 +2054,32 @@ void Bitmap::ImplMedianCut( ULONG* pColBuf, BitmapPalette& rPal,
// ------------------------------------------------------------------------
-BOOL Bitmap::Vectorize( PolyPolygon& rPolyPoly, ULONG nFlags, const Link* pProgress )
+sal_Bool Bitmap::Vectorize( PolyPolygon& rPolyPoly, sal_uLong nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rPolyPoly, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Vectorize( GDIMetaFile& rMtf, BYTE cReduce, ULONG nFlags, const Link* pProgress )
+sal_Bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
{
return ImplVectorizer().ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress );
}
// ------------------------------------------------------------------------
-BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
// nothing to do => return quickly
if( !nLuminancePercent && !nContrastPercent &&
!nChannelRPercent && !nChannelGPercent && !nChannelBPercent &&
( fGamma == 1.0 ) && !bInvert )
{
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
@@ -2090,9 +2090,9 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
BitmapColor aCol;
const long nW = pAcc->Width();
const long nH = pAcc->Height();
- BYTE* cMapR = new BYTE[ 256 ];
- BYTE* cMapG = new BYTE[ 256 ];
- BYTE* cMapB = new BYTE[ 256 ];
+ sal_uInt8* cMapR = new sal_uInt8[ 256 ];
+ sal_uInt8* cMapG = new sal_uInt8[ 256 ];
+ sal_uInt8* cMapB = new sal_uInt8[ 256 ];
long nX, nY;
double fM, fROff, fGOff, fBOff, fOff;
@@ -2112,14 +2112,14 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const BOOL bGamma = ( fGamma != 1.0 );
+ const sal_Bool bGamma = ( fGamma != 1.0 );
// create mapping table
for( nX = 0L; nX < 256L; nX++ )
{
- cMapR[ nX ] = (BYTE) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- cMapG[ nX ] = (BYTE) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- cMapB[ nX ] = (BYTE) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ cMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ cMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ cMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
if( bGamma )
{
@@ -2141,7 +2141,7 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
{
BitmapColor aNewCol;
- for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aNewCol.SetRed( cMapR[ rCol.GetRed() ] );
@@ -2197,7 +2197,7 @@ BOOL Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
delete[] cMapG;
delete[] cMapB;
ReleaseAccess( pAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 4411b5def4ce..1166f6cc0931 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -49,9 +49,9 @@
// - Bitmap -
// ----------
-BOOL Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
switch( eFilter )
{
@@ -107,11 +107,11 @@ BOOL Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, cons
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
+sal_Bool Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -124,9 +124,9 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
long* pColm = new long[ nWidth2 ];
long* pRows = new long[ nHeight2 ];
- BitmapColor* pColRow1 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow2 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow3 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow1 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow2 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow3 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
BitmapColor* pRowTmp1 = pColRow1;
BitmapColor* pRowTmp2 = pColRow2;
BitmapColor* pRowTmp3 = pColRow3;
@@ -205,9 +205,9 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
nSumB += pTmp[ pColor->GetBlue() ];
// calculate destination color
- pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) MinMax( nSumR / nDivisor, 0, 255 ),
- (BYTE) MinMax( nSumG / nDivisor, 0, 255 ),
- (BYTE) MinMax( nSumB / nDivisor, 0, 255 ) ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (sal_uInt8) MinMax( nSumR / nDivisor, 0, 255 ),
+ (sal_uInt8) MinMax( nSumG / nDivisor, 0, 255 ),
+ (sal_uInt8) MinMax( nSumB / nDivisor, 0, 255 ) ) );
}
if( ++nY < nHeight )
@@ -225,15 +225,15 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
}
delete[] pKoeff;
- delete[] (BYTE*) pColRow1;
- delete[] (BYTE*) pColRow2;
- delete[] (BYTE*) pColRow3;
+ delete[] (sal_uInt8*) pColRow1;
+ delete[] (sal_uInt8*) pColRow2;
+ delete[] (sal_uInt8*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -255,10 +255,10 @@ BOOL Bitmap::ImplConvolute3( const long* pMatrix, long nDivisor,
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -271,9 +271,9 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
long* pColm = new long[ nWidth2 ];
long* pRows = new long[ nHeight2 ];
- BitmapColor* pColRow1 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow2 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
- BitmapColor* pColRow3 = (BitmapColor*) new BYTE[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow1 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow2 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
+ BitmapColor* pColRow3 = (BitmapColor*) new sal_uInt8[ sizeof( BitmapColor ) * nWidth2 ];
BitmapColor* pRowTmp1 = pColRow1;
BitmapColor* pRowTmp2 = pColRow2;
BitmapColor* pRowTmp3 = pColRow3;
@@ -339,7 +339,7 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
MNMX3( nB9, nB2, nB3 );
// set destination color
- pWriteAcc->SetPixel( nY, nX, BitmapColor( (BYTE) nR2, (BYTE) nG2, (BYTE) nB2 ) );
+ pWriteAcc->SetPixel( nY, nX, BitmapColor( (sal_uInt8) nR2, (sal_uInt8) nG2, (sal_uInt8) nB2 ) );
}
if( ++nY < nHeight )
@@ -356,15 +356,15 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
}
}
- delete[] (BYTE*) pColRow1;
- delete[] (BYTE*) pColRow2;
- delete[] (BYTE*) pColRow3;
+ delete[] (sal_uInt8*) pColRow1;
+ delete[] (sal_uInt8*) pColRow2;
+ delete[] (sal_uInt8*) pColRow3;
delete[] pColm;
delete[] pRows;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -386,13 +386,13 @@ BOOL Bitmap::ImplMedianFilter( const BmpFilterParam* /*pFilterParam*/, const Lin
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BOOL bRet = ImplMakeGreyscales( 256 );
+ sal_Bool bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
@@ -403,7 +403,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
if( pWriteAcc )
{
- BitmapColor aGrey( (BYTE) 0 );
+ BitmapColor aGrey( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
const long nMask111 = -1, nMask121 = 0, nMask131 = 1;
@@ -474,7 +474,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
nSum2 += nMask332 * nGrey33;
nSum1 = (long) sqrt( (double)( nSum1 * nSum1 + nSum2 * nSum2 ) );
- aGrey.SetIndex( ~(BYTE) SAL_BOUND( nSum1, 0, 255 ) );
+ aGrey.SetIndex( ~(sal_uInt8) SAL_BOUND( nSum1, 0, 255 ) );
pWriteAcc->SetPixel( nY, nX, aGrey );
if( nX < ( nWidth - 1 ) )
@@ -491,7 +491,7 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -514,13 +514,13 @@ BOOL Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Link*
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- BOOL bRet = ImplMakeGreyscales( 256 );
+ sal_Bool bRet = ImplMakeGreyscales( 256 );
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapReadAccess* pReadAcc = AcquireReadAccess();
@@ -531,7 +531,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
if( pWriteAcc )
{
- BitmapColor aGrey( (BYTE) 0 );
+ BitmapColor aGrey( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
long nGrey11, nGrey12, nGrey13;
@@ -549,7 +549,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
const long nLz = FRound( sin( fElev ) * 255.0 );
const long nZ2 = ( ( 6 * 255 ) / 4 ) * ( ( 6 * 255 ) / 4 );
const long nNzLz = ( ( 6 * 255 ) / 4 ) * nLz;
- const BYTE cLz = (BYTE) SAL_BOUND( nLz, 0, 255 );
+ const sal_uInt8 cLz = (sal_uInt8) SAL_BOUND( nLz, 0, 255 );
// fill mapping tables
pHMap[ 0 ] = 0;
@@ -586,7 +586,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
else
{
const double fGrey = nDotL / sqrt( (double)(nNx * nNx + nNy * nNy + nZ2) );
- aGrey.SetIndex( (BYTE) SAL_BOUND( fGrey, 0, 255 ) );
+ aGrey.SetIndex( (sal_uInt8) SAL_BOUND( fGrey, 0, 255 ) );
}
pWriteAcc->SetPixel( nY, nX, aGrey );
@@ -605,7 +605,7 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
delete[] pHMap;
delete[] pVMap;
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -628,21 +628,21 @@ BOOL Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link* /*p
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
if( pWriteAcc )
{
- const BYTE cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
+ const sal_uInt8 cThreshold = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SOLARIZE ) ?
pFilterParam->mcSolarGreyThreshold : 128;
if( pWriteAcc->HasPalette() )
{
const BitmapPalette& rPal = pWriteAcc->GetPalette();
- for( USHORT i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPal.GetEntryCount(); i < nCount; i++ )
{
if( rPal[ i ].GetLuminance() >= cThreshold )
{
@@ -670,7 +670,7 @@ BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pPr
}
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -678,10 +678,10 @@ BOOL Bitmap::ImplSolarize( const BmpFilterParam* pFilterParam, const Link* /*pPr
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
BitmapReadAccess* pReadAcc = AcquireReadAccess();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pReadAcc )
{
@@ -692,12 +692,12 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
DBG_ASSERT( nSepiaPercent <= 100, "Bitmap::ImplSepia(): sepia value out of range; defaulting to 100%" );
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rCol = aSepiaPal[ i ];
- const BYTE cSepiaValue = (BYTE) ( ( nSepia * i ) / 10000 );
+ const sal_uInt8 cSepiaValue = (sal_uInt8) ( ( nSepia * i ) / 10000 );
- rCol.SetRed( (BYTE) i );
+ rCol.SetRed( (sal_uInt8) i );
rCol.SetGreen( cSepiaValue );
rCol.SetBlue( cSepiaValue );
}
@@ -707,7 +707,7 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
if( pWriteAcc )
{
- BitmapColor aCol( (BYTE) 0 );
+ BitmapColor aCol( (sal_uInt8) 0 );
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
@@ -715,10 +715,10 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
{
for( long nY = 0; nY < nHeight ; nY++ )
{
- const USHORT nPalCount = pReadAcc->GetPaletteEntryCount();
- BYTE* pIndexMap = new BYTE[ nPalCount ];
+ const sal_uInt16 nPalCount = pReadAcc->GetPaletteEntryCount();
+ sal_uInt8* pIndexMap = new sal_uInt8[ nPalCount ];
- for( USHORT i = 0; i < nPalCount; i++ )
+ for( sal_uInt16 i = 0; i < nPalCount; i++ )
pIndexMap[ i ] = pReadAcc->GetPaletteColor( i ).GetLuminance();
for( long nX = 0; nX < nWidth; nX++ )
@@ -743,7 +743,7 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
}
aNewBmp.ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -765,13 +765,13 @@ BOOL Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pProgr
// -----------------------------------------------------------------------------
-BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProgress*/ )
{
- ULONG nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileWidth = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileWidth : 4;
- ULONG nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
+ sal_uLong nTileHeight = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_MOSAIC ) ?
pFilterParam->maMosaicTileSize.mnTileHeight : 4;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !nTileWidth )
nTileWidth = 1;
@@ -834,9 +834,9 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
}
- aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -860,16 +860,16 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
{
for( nX = nX1; nX <= nX2; nX++ )
{
- const BitmapColor& rCol = pReadAcc->GetPaletteColor( (BYTE) pReadAcc->GetPixel( nY, nX ) );
+ const BitmapColor& rCol = pReadAcc->GetPaletteColor( (sal_uInt8) pReadAcc->GetPixel( nY, nX ) );
nSumR += rCol.GetRed();
nSumG += rCol.GetGreen();
nSumB += rCol.GetBlue();
}
}
- aCol.SetRed( (BYTE) ( nSumR * fArea_1 ) );
- aCol.SetGreen( (BYTE) ( nSumG * fArea_1 ) );
- aCol.SetBlue( (BYTE) ( nSumB * fArea_1 ) );
+ aCol.SetRed( (sal_uInt8) ( nSumR * fArea_1 ) );
+ aCol.SetGreen( (sal_uInt8) ( nSumG * fArea_1 ) );
+ aCol.SetBlue( (sal_uInt8) ( nSumB * fArea_1 ) );
for( nY = nY1; nY <= nY2; nY++ )
for( nX = nX1; nX <= nX2; nX++ )
@@ -893,7 +893,7 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
while( nY1 < nHeight );
- bRet = TRUE;
+ bRet = sal_True;
}
ReleaseAccess( pReadAcc );
@@ -917,7 +917,7 @@ BOOL Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*pProg
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -948,13 +948,13 @@ extern "C" int __LOADONCALLAPI ImplPopArtCmpFnc( const void* p1, const void* p2
// ------------------------------------------------------------------------
-BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
+sal_Bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*pProgress*/ )
{
- BOOL bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : TRUE;
+ sal_Bool bRet = ( GetBitCount() > 8 ) ? Convert( BMP_CONVERSION_8BIT_COLORS ) : sal_True;
if( bRet )
{
- bRet = FALSE;
+ bRet = sal_False;
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
@@ -962,8 +962,8 @@ BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*p
{
const long nWidth = pWriteAcc->Width();
const long nHeight = pWriteAcc->Height();
- const ULONG nEntryCount = 1 << pWriteAcc->GetBitCount();
- ULONG n;
+ const sal_uLong nEntryCount = 1 << pWriteAcc->GetBitCount();
+ sal_uLong n;
PopArtEntry* pPopArtTable = new PopArtEntry[ nEntryCount ];
for( n = 0; n < nEntryCount; n++ )
@@ -982,26 +982,26 @@ BOOL Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link* /*p
qsort( pPopArtTable, nEntryCount, sizeof( PopArtEntry ), ImplPopArtCmpFnc );
// get last used entry
- ULONG nFirstEntry;
- ULONG nLastEntry = 0;
+ sal_uLong nFirstEntry;
+ sal_uLong nLastEntry = 0;
for( n = 0; n < nEntryCount; n++ )
if( pPopArtTable[ n ].mnCount )
nLastEntry = n;
// rotate palette (one entry)
- const BitmapColor aFirstCol( pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ 0 ].mnIndex) ) );
+ const BitmapColor aFirstCol( pWriteAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ 0 ].mnIndex) ) );
for( nFirstEntry = 0; nFirstEntry < nLastEntry; nFirstEntry++ )
{
- pWriteAcc->SetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nFirstEntry ].mnIndex),
- pWriteAcc->GetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nFirstEntry + 1 ].mnIndex) ) );
+ pWriteAcc->SetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nFirstEntry ].mnIndex),
+ pWriteAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nFirstEntry + 1 ].mnIndex) ) );
}
- pWriteAcc->SetPaletteColor( sal::static_int_cast<USHORT>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
+ pWriteAcc->SetPaletteColor( sal::static_int_cast<sal_uInt16>(pPopArtTable[ nLastEntry ].mnIndex), aFirstCol );
// cleanup
delete[] pPopArtTable;
ReleaseAccess( pWriteAcc );
- bRet = TRUE;
+ bRet = sal_True;
}
}
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 777f169053da..d1f130d9d1cc 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -50,7 +50,7 @@
BitmapEx::BitmapEx() :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
}
@@ -68,7 +68,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx ) :
BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
if( rBitmapEx.IsEmpty() )
return;
@@ -77,7 +77,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
aBitmapSize = aSize;
if( rBitmapEx.IsAlpha() )
{
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask = AlphaMask( aSize ).ImplGetBitmap();
}
else if( rBitmapEx.IsTransparent() )
@@ -92,7 +92,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
BitmapEx::BitmapEx( const ResId& rResId ) :
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
static ImplImageTreeSingletonRef aImageTree;
ResMgr* pResMgr = NULL;
@@ -119,7 +119,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp ) :
aBitmap ( rBmp ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent( TRANSPARENT_NONE ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
}
@@ -130,7 +130,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
aMask ( rMask ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent ( !rMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
DBG_ASSERT( !rMask || rBmp.GetSizePixel() == rMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and mask." );
@@ -150,7 +150,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
aMask ( rAlphaMask.ImplGetBitmap() ),
aBitmapSize ( aBitmap.GetSizePixel() ),
eTransparent ( !rAlphaMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP ),
- bAlpha ( !rAlphaMask ? FALSE : TRUE )
+ bAlpha ( !rAlphaMask ? sal_False : sal_True )
{
DBG_ASSERT( !rAlphaMask || rBmp.GetSizePixel() == rAlphaMask.GetSizePixel(),
"BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask." );
@@ -169,7 +169,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) :
aBitmapSize ( aBitmap.GetSizePixel() ),
aTransparentColor ( rTransparentColor ),
eTransparent ( TRANSPARENT_BITMAP ),
- bAlpha ( FALSE )
+ bAlpha ( sal_False )
{
aMask = aBitmap.CreateMask( aTransparentColor );
@@ -204,19 +204,19 @@ BitmapEx& BitmapEx::operator=( const BitmapEx& rBitmapEx )
// ------------------------------------------------------------------
-BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
+sal_Bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
{
if( eTransparent != rBitmapEx.eTransparent )
- return FALSE;
+ return sal_False;
if( aBitmap != rBitmapEx.aBitmap )
- return FALSE;
+ return sal_False;
if( aBitmapSize != rBitmapEx.aBitmapSize )
- return FALSE;
+ return sal_False;
if( eTransparent == TRANSPARENT_NONE )
- return TRUE;
+ return sal_True;
if( eTransparent == TRANSPARENT_COLOR )
return aTransparentColor == rBitmapEx.aTransparentColor;
@@ -226,7 +226,7 @@ BOOL BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
// ------------------------------------------------------------------
-BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
+sal_Bool BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
{
return( rBmpEx.eTransparent == eTransparent &&
rBmpEx.bAlpha == bAlpha &&
@@ -236,7 +236,7 @@ BOOL BitmapEx::IsEqual( const BitmapEx& rBmpEx ) const
// ------------------------------------------------------------------
-BOOL BitmapEx::IsEmpty() const
+sal_Bool BitmapEx::IsEmpty() const
{
return( aBitmap.IsEmpty() && aMask.IsEmpty() );
}
@@ -248,7 +248,7 @@ void BitmapEx::SetEmpty()
aBitmap.SetEmpty();
aMask.SetEmpty();
eTransparent = TRANSPARENT_NONE;
- bAlpha = FALSE;
+ bAlpha = sal_False;
}
// ------------------------------------------------------------------
@@ -260,14 +260,14 @@ void BitmapEx::Clear()
// ------------------------------------------------------------------
-BOOL BitmapEx::IsTransparent() const
+sal_Bool BitmapEx::IsTransparent() const
{
return( eTransparent != TRANSPARENT_NONE );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::IsAlpha() const
+sal_Bool BitmapEx::IsAlpha() const
{
return( IsTransparent() && bAlpha );
}
@@ -324,9 +324,9 @@ AlphaMask BitmapEx::GetAlpha() const
// ------------------------------------------------------------------
-ULONG BitmapEx::GetSizeBytes() const
+sal_uLong BitmapEx::GetSizeBytes() const
{
- ULONG nSizeBytes = aBitmap.GetSizeBytes();
+ sal_uLong nSizeBytes = aBitmap.GetSizeBytes();
if( eTransparent == TRANSPARENT_BITMAP )
nSizeBytes += aMask.GetSizeBytes();
@@ -336,7 +336,7 @@ ULONG BitmapEx::GetSizeBytes() const
// ------------------------------------------------------------------
-ULONG BitmapEx::GetChecksum() const
+sal_uLong BitmapEx::GetChecksum() const
{
sal_uInt32 nCrc = aBitmap.GetChecksum();
SVBT32 aBT32;
@@ -365,9 +365,9 @@ void BitmapEx::SetSizePixel( const Size& rNewSize )
// ------------------------------------------------------------------
-BOOL BitmapEx::Invert()
+sal_Bool BitmapEx::Invert()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -382,9 +382,9 @@ BOOL BitmapEx::Invert()
// ------------------------------------------------------------------
-BOOL BitmapEx::Mirror( ULONG nMirrorFlags )
+sal_Bool BitmapEx::Mirror( sal_uLong nMirrorFlags )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -399,9 +399,9 @@ BOOL BitmapEx::Mirror( ULONG nMirrorFlags )
// ------------------------------------------------------------------
-BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScaleFlag )
+sal_Bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -421,9 +421,9 @@ BOOL BitmapEx::Scale( const double& rScaleX, const double& rScaleY, ULONG nScale
// ------------------------------------------------------------------------
-BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag )
+sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
- BOOL bRet;
+ sal_Bool bRet;
if( aBitmapSize.Width() && aBitmapSize.Height() )
{
@@ -432,20 +432,20 @@ BOOL BitmapEx::Scale( const Size& rNewSize, ULONG nScaleFlag )
nScaleFlag );
}
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
+sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
- const BOOL bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
+ const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
if( bTransRotate )
{
@@ -485,9 +485,9 @@ BOOL BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL BitmapEx::Crop( const Rectangle& rRectPixel )
+sal_Bool BitmapEx::Crop( const Rectangle& rRectPixel )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -507,23 +507,23 @@ BOOL BitmapEx::Crop( const Rectangle& rRectPixel )
// ------------------------------------------------------------------
-BOOL BitmapEx::Convert( BmpConversion eConversion )
+sal_Bool BitmapEx::Convert( BmpConversion eConversion )
{
- return( !!aBitmap ? aBitmap.Convert( eConversion ) : FALSE );
+ return( !!aBitmap ? aBitmap.Convert( eConversion ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::ReduceColors( USHORT nNewColorCount, BmpReduce eReduce )
+sal_Bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
{
- return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : FALSE );
+ return( !!aBitmap ? aBitmap.ReduceColors( nNewColorCount, eReduce ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpandTransparent )
+sal_Bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, sal_Bool bExpandTransparent )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -546,10 +546,10 @@ BOOL BitmapEx::Expand( ULONG nDX, ULONG nDY, const Color* pInitColor, BOOL bExpa
// ------------------------------------------------------------------
-BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
+sal_Bool BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
const BitmapEx* pBmpExSrc )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !pBmpExSrc || pBmpExSrc->IsEmpty() )
{
@@ -580,7 +580,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
else
@@ -591,7 +591,7 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
aMask = pAlpha->ImplGetBitmap();
delete pAlpha;
eTransparent = TRANSPARENT_BITMAP;
- bAlpha = TRUE;
+ bAlpha = sal_True;
aMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->aMask );
}
}
@@ -635,9 +635,9 @@ BOOL BitmapEx::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc,
// ------------------------------------------------------------------
-BOOL BitmapEx::Erase( const Color& rFillColor )
+sal_Bool BitmapEx::Erase( const Color& rFillColor )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !!aBitmap )
{
@@ -664,41 +664,41 @@ BOOL BitmapEx::Erase( const Color& rFillColor )
// ------------------------------------------------------------------
-BOOL BitmapEx::Dither( ULONG nDitherFlags )
+sal_Bool BitmapEx::Dither( sal_uLong nDitherFlags )
{
- return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : FALSE );
+ return( !!aBitmap ? aBitmap.Dither( nDitherFlags ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+sal_Bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
- return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : FALSE );
+ return( !!aBitmap ? aBitmap.Replace( rSearchColor, rReplaceColor, nTol ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, const ULONG* pTols )
+sal_Bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
{
- return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (ULONG*) pTols ) : FALSE );
+ return( !!aBitmap ? aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
+sal_Bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent, short nChannelBPercent,
- double fGamma, BOOL bInvert )
+ double fGamma, sal_Bool bInvert )
{
return( !!aBitmap ? aBitmap.Adjust( nLuminancePercent, nContrastPercent,
nChannelRPercent, nChannelGPercent, nChannelBPercent,
- fGamma, bInvert ) : FALSE );
+ fGamma, bInvert ) : sal_False );
}
// ------------------------------------------------------------------
-BOOL BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
+sal_Bool BitmapEx::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam, const Link* pProgress )
{
- return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : FALSE );
+ return( !!aBitmap ? aBitmap.Filter( eFilter, pFilterParam, pProgress ) : sal_False );
}
// ------------------------------------------------------------------
@@ -857,9 +857,9 @@ SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
{
rBitmapEx.aBitmap.Write( rOStm );
- rOStm << (UINT32) 0x25091962;
- rOStm << (UINT32) 0xACB20201;
- rOStm << (BYTE) rBitmapEx.eTransparent;
+ rOStm << (sal_uInt32) 0x25091962;
+ rOStm << (sal_uInt32) 0xACB20201;
+ rOStm << (sal_uInt8) rBitmapEx.eTransparent;
if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
rBitmapEx.aMask.Write( rOStm );
@@ -879,9 +879,9 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
if( !rIStm.GetError() )
{
- const ULONG nStmPos = rIStm.Tell();
- UINT32 nMagic1 = 0;
- UINT32 nMagic2 = 0;
+ const sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt32 nMagic1 = 0;
+ sal_uInt32 nMagic2 = 0;
rIStm >> nMagic1 >> nMagic2;
@@ -893,11 +893,11 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
}
else
{
- BYTE bTransparent = false;
+ sal_uInt8 bTransparent = false;
rIStm >> bTransparent;
- if( bTransparent == (BYTE) TRANSPARENT_BITMAP )
+ if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
{
Bitmap aMask;
@@ -920,7 +920,7 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
else
rBitmapEx = aBmp;
}
- else if( bTransparent == (BYTE) TRANSPARENT_COLOR )
+ else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
{
Color aTransparentColor;
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index e3a1eb37fa98..0762821c3267 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -38,7 +38,7 @@
// - BitmapReadAccess -
// --------------------
-BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, BOOL bModify ) :
+BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, sal_Bool bModify ) :
mpBuffer ( NULL ),
mpScanBuf ( NULL ),
mFncGetPixel ( NULL ),
@@ -55,7 +55,7 @@ BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap ) :
mpScanBuf ( NULL ),
mFncGetPixel ( NULL ),
mFncSetPixel ( NULL ),
- mbModify ( FALSE )
+ mbModify ( sal_False )
{
ImplCreate( rBitmap );
}
@@ -155,9 +155,9 @@ void BitmapReadAccess::ImplDestroy()
// ------------------------------------------------------------------
-BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat )
+sal_Bool BitmapReadAccess::ImplSetAccessPointers( sal_uLong nFormat )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch( nFormat )
{
@@ -179,7 +179,7 @@ BOOL BitmapReadAccess::ImplSetAccessPointers( ULONG nFormat )
CASE_FORMAT( _32BIT_TC_MASK )
default:
- bRet = FALSE;
+ bRet = sal_False;
break;
}
@@ -197,7 +197,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
sal_uInt32 nBits;
bool bMsb;
- const ULONG nScanlineFormat = GetScanlineFormat();
+ const sal_uLong nScanlineFormat = GetScanlineFormat();
switch( nScanlineFormat )
{
case( BMP_FORMAT_1BIT_MSB_PAL ):
@@ -273,7 +273,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else
nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL));
- BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes );
+ sal_uInt8* pLastBytes = (sal_uInt8*)GetBuffer() + ( nScanSize - nBytes );
for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize )
{
*pLastBytes &= nMask;
@@ -285,7 +285,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
else if( nBits & 0x1f )
{
sal_uInt32 nMask = 0xffffffff << ( ( nScanSize << 3 ) - nBits );
- BYTE* pLast4Bytes = (BYTE*) GetBuffer() + ( nScanSize - 4 );
+ sal_uInt8* pLast4Bytes = (sal_uInt8*) GetBuffer() + ( nScanSize - 4 );
#ifdef OSL_LITENDIAN
nMask = SWAPLONG( nMask );
@@ -305,7 +305,7 @@ void BitmapReadAccess::Flush()
// ------------------------------------------------------------------
-void BitmapReadAccess::ReAccess( BOOL bModify )
+void BitmapReadAccess::ReAccess( sal_Bool bModify )
{
const ImpBitmap* pImpBmp = maBitmap.ImplGetImpBitmap();
@@ -321,7 +321,7 @@ void BitmapReadAccess::ReAccess( BOOL bModify )
// ------------------------------------------------------------------
-USHORT BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
+sal_uInt16 BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor ) const
{
return( HasPalette() ? mpBuffer->maPalette.GetBestIndex( rBitmapColor ) : 0 );
}
@@ -331,7 +331,7 @@ USHORT BitmapReadAccess::GetBestPaletteIndex( const BitmapColor& rBitmapColor )
// ---------------------
BitmapWriteAccess::BitmapWriteAccess( Bitmap& rBitmap ) :
- BitmapReadAccess( rBitmap, TRUE ),
+ BitmapReadAccess( rBitmap, sal_True ),
mpLineColor ( NULL ),
mpFillColor ( NULL )
{
@@ -367,16 +367,16 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc
// ------------------------------------------------------------------
void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline,
- ULONG nSrcScanlineFormat, ULONG nSrcScanlineSize )
+ sal_uLong nSrcScanlineFormat, sal_uLong nSrcScanlineSize )
{
- const ULONG nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat );
+ const sal_uLong nFormat = BMP_SCANLINE_FORMAT( nSrcScanlineFormat );
DBG_ASSERT( ( nY >= 0 ) && ( nY < mpBuffer->mnHeight ), "y-coordinate in destination out of range!" );
DBG_ASSERT( ( HasPalette() && nFormat <= BMP_FORMAT_8BIT_PAL ) ||
( !HasPalette() && nFormat > BMP_FORMAT_8BIT_PAL ),
"No copying possible between palette and non palette scanlines!" );
- const ULONG nCount = Min( GetScanlineSize(), nSrcScanlineSize );
+ const sal_uLong nCount = Min( GetScanlineSize(), nSrcScanlineSize );
if( nCount )
{
@@ -438,7 +438,7 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc )
( GetScanlineSize() == rReadAcc.GetScanlineSize() ) )
{
const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() );
- const ULONG nCount = nHeight * mpBuffer->mnScanlineSize;
+ const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize;
memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount );
}
diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx
index 6cff281556ab..718bd56cdb0c 100644
--- a/vcl/source/gdi/bmpacc2.cxx
+++ b/vcl/source/gdi/bmpacc2.cxx
@@ -44,7 +44,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL )
{
- BYTE& rByte = pScanline[ nX >> 3 ];
+ sal_uInt8& rByte = pScanline[ nX >> 3 ];
( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( 7 - ( nX & 7 ) ) ) :
( rByte &= ~( 1 << ( 7 - ( nX & 7 ) ) ) );
@@ -61,7 +61,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL )
{
- BYTE& rByte = pScanline[ nX >> 3 ];
+ sal_uInt8& rByte = pScanline[ nX >> 3 ];
( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( nX & 7 ) ) :
( rByte &= ~( 1 << ( nX & 7 ) ) );
@@ -78,7 +78,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL )
{
- BYTE& rByte = pScanline[ nX >> 1 ];
+ sal_uInt8& rByte = pScanline[ nX >> 1 ];
( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) );
@@ -95,7 +95,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL )
{
- BYTE& rByte = pScanline[ nX >> 1 ];
+ sal_uInt8& rByte = pScanline[ nX >> 1 ];
( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) );
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index 55f4a8b412a6..5e87d680e9c0 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -54,7 +54,7 @@ void BitmapWriteAccess::SetLineColor( const Color& rColor )
if( rColor.GetTransparency() == 255 )
mpLineColor = NULL;
else
- mpLineColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpLineColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -88,7 +88,7 @@ void BitmapWriteAccess::SetFillColor( const Color& rColor )
if( rColor.GetTransparency() == 255 )
mpFillColor = NULL;
else
- mpFillColor = ( HasPalette() ? new BitmapColor( (BYTE) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
+ mpFillColor = ( HasPalette() ? new BitmapColor( (sal_uInt8) GetBestPaletteIndex( rColor ) ) : new BitmapColor( rColor ) );
}
// ------------------------------------------------------------------
@@ -113,7 +113,7 @@ void BitmapWriteAccess::Erase( const Color& rColor )
// TODO: provide and use Erase( BitmapColor& method)
BitmapColor aColor = rColor;
if( HasPalette() )
- aColor = BitmapColor( (BYTE)GetBestPaletteIndex( rColor) );
+ aColor = BitmapColor( (sal_uInt8)GetBestPaletteIndex( rColor) );
// try fast bitmap method first
if( ImplFastEraseBitmap( *mpBuffer, aColor ) )
return;
@@ -205,7 +205,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
const long nDYX = ( nDY - nDX ) << 1;
const long nDY2 = nDY << 1;
long nD = nDY2 - nDX;
- BOOL bPos = nY1 < nY2;
+ sal_Bool bPos = nY1 < nY2;
for ( nX = nX1, nY = nY1; nX <= nX2; nX++ )
{
@@ -244,7 +244,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
const long nDYX = ( nDX - nDY ) << 1;
const long nDY2 = nDX << 1;
long nD = nDY2 - nDY;
- BOOL bPos = nX1 < nX2;
+ sal_Bool bPos = nX1 < nX2;
for ( nX = nX1, nY = nY1; nY <= nY2; nY++ )
{
@@ -313,7 +313,7 @@ void BitmapWriteAccess::DrawRect( const Rectangle& rRect )
void BitmapWriteAccess::FillPolygon( const Polygon& rPoly )
{
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
if( nSize && mpFillColor )
{
@@ -346,9 +346,9 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
- for( USHORT i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
DrawLine( rPoly[ i ], rPoly[ i + 1 ] );
if( rPoly[ nSize - 1 ] != rPoly[ 0 ] )
@@ -360,7 +360,7 @@ void BitmapWriteAccess::DrawPolygon( const Polygon& rPoly )
void BitmapWriteAccess::FillPolyPolygon( const PolyPolygon& rPolyPoly )
{
- const USHORT nCount = rPolyPoly.Count();
+ const sal_uInt16 nCount = rPolyPoly.Count();
if( nCount && mpFillColor )
{
@@ -393,14 +393,14 @@ void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
if( mpLineColor && ( !mpFillColor || ( *mpFillColor != *mpLineColor ) ) )
{
- for( USHORT n = 0, nCount = rPolyPoly.Count(); n < nCount; )
+ for( sal_uInt16 n = 0, nCount = rPolyPoly.Count(); n < nCount; )
{
const Polygon& rPoly = rPolyPoly[ n++ ];
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
if( nSize )
{
- for( USHORT i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
+ for( sal_uInt16 i = 0, nSize1 = nSize - 1; i < nSize1; i++ )
DrawLine( rPoly[ i ], rPoly[ i + 1 ] );
if( rPoly[ nSize - 1 ] != rPoly[ 0 ] )
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index f71827fc7413..886055817312 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -29,14 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vcl/bitmap.hxx>
-#include <vcl/impbmpconv.hxx>
-#include <vcl/svapp.hxx>
+#include "vcl/bitmap.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/salctype.hxx"
#include <osl/mutex.hxx>
-#include <tools/stream.hxx>
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <cppuhelper/compbase1.hxx>
+#include "tools/stream.hxx"
+#include "com/sun/star/script/XInvocation.hpp"
+#include "com/sun/star/awt/XBitmap.hpp"
+#include "cppuhelper/compbase1.hxx"
using namespace com::sun::star::uno;
@@ -155,7 +155,7 @@ Any SAL_CALL BmpConverter::invoke(
SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
Bitmap aBM;
- aBM.Read( aStream, TRUE );
+ aBM.Read( aStream, sal_True );
if( nTargetDepth < 4 )
nTargetDepth = 1;
else if( nTargetDepth < 8 )
@@ -190,7 +190,7 @@ BmpTransporter::BmpTransporter( const Bitmap& rBM )
m_aSize.Width = rBM.GetSizePixel().Width();
m_aSize.Height = rBM.GetSizePixel().Height();
SvMemoryStream aStream;
- rBM.Write( aStream, FALSE, TRUE );
+ rBM.Write( aStream, sal_False, sal_True );
m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()),
aStream.GetEndOfData());
}
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 4c9ab03ea9c1..8fc5188c9204 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -56,7 +56,7 @@ protected:
PIXBYTE* mpPixel;
};
-template <ULONG PIXFMT>
+template <sal_uLong PIXFMT>
class TrueColorPixelPtr : public BasePixelPtr
{
public:
@@ -255,7 +255,7 @@ class TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL>
// =======================================================================
// converting truecolor formats
-template <ULONG SRCFMT, ULONG DSTFMT>
+template <sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc )
{
@@ -279,7 +279,7 @@ inline void ImplConvertPixel<BMP_FORMAT_16BIT_TC_LSB_MASK, BMP_FORMAT_16BIT_TC_M
// -----------------------------------------------------------------------
-template <ULONG SRCFMT, ULONG DSTFMT>
+template <sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, int nPixelCount )
{
@@ -296,7 +296,7 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst,
// =======================================================================
// alpha blending truecolor pixels
-template <unsigned ALPHABITS, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal )
{
@@ -328,7 +328,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst,
// -----------------------------------------------------------------------
-template <unsigned ALPHABITS, ULONG MASKFMT, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong MASKFMT, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, const TrueColorPixelPtr<MASKFMT>& rMsk,
int nPixelCount )
@@ -347,7 +347,7 @@ inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
// -----------------------------------------------------------------------
-template <unsigned ALPHABITS, ULONG SRCFMT, ULONG DSTFMT>
+template <unsigned ALPHABITS, sal_uLong SRCFMT, sal_uLong DSTFMT>
inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst,
const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal,
int nPixelCount )
@@ -405,7 +405,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf
// -----------------------------------------------------------------------
-template <ULONG DSTFMT,ULONG SRCFMT>
+template <sal_uLong DSTFMT,sal_uLong SRCFMT>
bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer )
{
@@ -438,7 +438,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
// -----------------------------------------------------------------------
-template <ULONG SRCFMT>
+template <sal_uLong SRCFMT>
inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc )
{
TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
@@ -539,8 +539,8 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
if( rDst.mnHeight < rTR.mnDestY + rTR.mnDestHeight )
return false;
- const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// TODO: also implement conversions for 16bit colormasks with non-565 format
if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) )
@@ -620,7 +620,7 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
// =======================================================================
-template <ULONG DSTFMT,ULONG SRCFMT> //,ULONG MSKFMT>
+template <sal_uLong DSTFMT,sal_uLong SRCFMT> //,sal_uLong MSKFMT>
bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer,
const BitmapBuffer& rMskBuffer )
@@ -697,7 +697,7 @@ inline bool ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_BGRA,BMP_FORMAT_32BIT_TC_BGRA>
// -----------------------------------------------------------------------
-template <ULONG SRCFMT>
+template <sal_uLong SRCFMT>
bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk )
{
TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
@@ -815,8 +815,8 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA,
const BitmapBuffer& rSrc = *rSrcRA.ImplGetBitmapBuffer();
const BitmapBuffer& rMsk = *rMskRA.ImplGetBitmapBuffer();
- const ULONG nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nSrcFormat = rSrc.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// accelerated conversions for 16bit colormasks with non-565 format are not yet implemented
if( nSrcFormat & (BMP_FORMAT_16BIT_TC_LSB_MASK | BMP_FORMAT_16BIT_TC_MSB_MASK) )
@@ -889,18 +889,18 @@ bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor )
if( bDisableFastBitops )
return false;
- const ULONG nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
+ const sal_uLong nDstFormat = rDst.mnFormat & ~BMP_FORMAT_TOP_DOWN;
// erasing a bitmap is often just a byte-wise memory fill
bool bByteFill = true;
- BYTE nFillByte;
+ sal_uInt8 nFillByte;
switch( nDstFormat )
{
case BMP_FORMAT_1BIT_MSB_PAL:
case BMP_FORMAT_1BIT_LSB_PAL:
nFillByte = rColor.GetIndex();
- nFillByte = static_cast<BYTE>( -(nFillByte & 1) ); // 0x00 or 0xFF
+ nFillByte = static_cast<sal_uInt8>( -(nFillByte & 1) ); // 0x00 or 0xFF
break;
case BMP_FORMAT_4BIT_MSN_PAL:
case BMP_FORMAT_4BIT_LSN_PAL:
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 4b2522601c7b..261781ebcf50 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -56,10 +56,10 @@ GraphicConverter::~GraphicConverter()
// ------------------------------------------------------------------------
-ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nInBufSize,
- void** ppOutBuffer, ULONG nOutFormat )
+sal_uLong GraphicConverter::ImplConvert( sal_uLong nInFormat, void* pInBuffer, sal_uLong nInBufSize,
+ void** ppOutBuffer, sal_uLong nOutFormat )
{
- ULONG nRetBufSize = 0UL;
+ sal_uLong nRetBufSize = 0UL;
if( ( nInFormat != nOutFormat ) && pInBuffer )
{
@@ -68,7 +68,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
SvMemoryStream aIStm;
Graphic aGraphic;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
aIStm >> aGraphic;
if( !aIStm.GetError() )
@@ -81,7 +81,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( FALSE );
+ aOStm.ObjectOwnsMemory( sal_False );
}
delete mpConvertData;
@@ -92,7 +92,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
SvMemoryStream aIStm;
- aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, FALSE, nInBufSize );
+ aIStm.SetBuffer( (char*) pInBuffer, nInBufSize, sal_False, nInBufSize );
mpConvertData = new ConvertData( Graphic(), aIStm, nInFormat );
if( maFilterHdl.IsSet() && maFilterHdl.Call( mpConvertData ) )
@@ -118,7 +118,7 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
{
nRetBufSize = aOStm.Seek( STREAM_SEEK_TO_END );
*ppOutBuffer = (void*) aOStm.GetData();
- aOStm.ObjectOwnsMemory( FALSE );
+ aOStm.ObjectOwnsMemory( sal_False );
}
}
@@ -132,10 +132,10 @@ ULONG GraphicConverter::ImplConvert( ULONG nInFormat, void* pInBuffer, ULONG nIn
// ------------------------------------------------------------------------
-ULONG GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ULONG nFormat )
+sal_uLong GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, sal_uLong nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- ULONG nRet = ERRCODE_IO_GENERAL;
+ sal_uLong nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
@@ -155,10 +155,10 @@ ULONG GraphicConverter::Import( SvStream& rIStm, Graphic& rGraphic, ULONG nForma
// ------------------------------------------------------------------------
-ULONG GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, ULONG nFormat )
+sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sal_uLong nFormat )
{
GraphicConverter* pCvt = ImplGetSVData()->maGDIData.mpGrfConverter;
- ULONG nRet = ERRCODE_IO_GENERAL;
+ sal_uLong nRet = ERRCODE_IO_GENERAL;
if( pCvt && pCvt->GetFilterHdl().IsSet() )
{
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 93883f8b5839..2d9fbef36e44 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -75,12 +75,12 @@ void ImplWriteRect( SvStream& rOStm, const Rectangle& rRect )
void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
{
- INT32 nSize;
+ sal_Int32 nSize;
rIStm >> nSize;
- rPoly = Polygon( (USHORT) nSize );
+ rPoly = Polygon( (sal_uInt16) nSize );
- for( USHORT i = 0; i < (USHORT) nSize; i++ )
+ for( sal_uInt16 i = 0; i < (sal_uInt16) nSize; i++ )
rIStm >> rPoly[ i ];
}
@@ -89,11 +89,11 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly )
void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly )
{
Polygon aPoly;
- INT32 nPolyCount;
+ sal_Int32 nPolyCount;
rIStm >> nPolyCount;
- for( USHORT i = 0; i < (USHORT) nPolyCount; i++ )
+ for( sal_uInt16 i = 0; i < (sal_uInt16) nPolyCount; i++ )
{
ImplReadPoly( rIStm, aPoly );
rPolyPoly.Insert( aPoly );
@@ -104,16 +104,16 @@ void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly )
void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
{
- const USHORT nPoly = rPolyPoly.Count();
- USHORT nPoints = 0;
- USHORT n;
+ const sal_uInt16 nPoly = rPolyPoly.Count();
+ sal_uInt16 nPoints = 0;
+ sal_uInt16 n;
for( n = 0; n < nPoly; n++ )
- nPoints = sal::static_int_cast<USHORT>(nPoints + rPolyPoly[ n ].GetSize());
+ nPoints = sal::static_int_cast<sal_uInt16>(nPoints + rPolyPoly[ n ].GetSize());
- rOStm << (INT16) GDI_POLYPOLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
- rOStm << (INT32) nPoly;
+ rOStm << (sal_Int16) GDI_POLYPOLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoly;
for( n = 0; n < nPoly; n++ )
{
@@ -122,11 +122,11 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
// a polygon representing the curve as good as possible
Polygon aSimplePoly;
rPolyPoly[n].AdaptiveSubdivide(aSimplePoly);
- const USHORT nSize(aSimplePoly.GetSize());
+ const sal_uInt16 nSize(aSimplePoly.GetSize());
- rOStm << (INT32) nSize;
+ rOStm << (sal_Int32) nSize;
- for( USHORT j = 0; j < nSize; j++ )
+ for( sal_uInt16 j = 0; j < nSize; j++ )
rOStm << aSimplePoly[ j ];
}
}
@@ -135,26 +135,26 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly )
void ImplReadColor( SvStream& rIStm, Color& rColor )
{
- INT16 nVal;
+ sal_Int16 nVal;
- rIStm >> nVal; rColor.SetRed( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
- rIStm >> nVal; rColor.SetGreen( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
- rIStm >> nVal; rColor.SetBlue( sal::static_int_cast<UINT8>((USHORT)nVal >> 8) );
+ rIStm >> nVal; rColor.SetRed( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
+ rIStm >> nVal; rColor.SetGreen( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
+ rIStm >> nVal; rColor.SetBlue( sal::static_int_cast<sal_uInt8>((sal_uInt16)nVal >> 8) );
}
// ------------------------------------------------------------------------
void ImplWriteColor( SvStream& rOStm, const Color& rColor )
{
- INT16 nVal;
+ sal_Int16 nVal;
- nVal = ( (INT16) rColor.GetRed() << 8 ) | rColor.GetRed();
+ nVal = ( (sal_Int16) rColor.GetRed() << 8 ) | rColor.GetRed();
rOStm << nVal;
- nVal = ( (INT16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
+ nVal = ( (sal_Int16) rColor.GetGreen() << 8 ) | rColor.GetGreen();
rOStm << nVal;
- nVal = ( (INT16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
+ nVal = ( (sal_Int16) rColor.GetBlue() << 8 ) | rColor.GetBlue();
rOStm << nVal;
}
@@ -163,11 +163,11 @@ void ImplWriteColor( SvStream& rOStm, const Color& rColor )
void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
{
Point aOrg;
- INT32 nXNum;
- INT32 nXDenom;
- INT32 nYNum;
- INT32 nYDenom;
- INT16 nUnit;
+ sal_Int32 nXNum;
+ sal_Int32 nXDenom;
+ sal_Int32 nYNum;
+ sal_Int32 nYDenom;
+ sal_Int16 nUnit;
rIStm >> nUnit >> aOrg >> nXNum >> nXDenom >> nYNum >> nYDenom;
rMapMode = MapMode( (MapUnit) nUnit, aOrg, Fraction( nXNum, nXDenom ), Fraction( nYNum, nYDenom ) );
@@ -177,39 +177,39 @@ void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
void ImplWriteMapMode( SvStream& rOStm, const MapMode& rMapMode )
{
- rOStm << (INT16) rMapMode.GetMapUnit();
+ rOStm << (sal_Int16) rMapMode.GetMapUnit();
rOStm << rMapMode.GetOrigin();
- rOStm << (INT32) rMapMode.GetScaleX().GetNumerator();
- rOStm << (INT32) rMapMode.GetScaleX().GetDenominator();
- rOStm << (INT32) rMapMode.GetScaleY().GetNumerator();
- rOStm << (INT32) rMapMode.GetScaleY().GetDenominator();
+ rOStm << (sal_Int32) rMapMode.GetScaleX().GetNumerator();
+ rOStm << (sal_Int32) rMapMode.GetScaleX().GetDenominator();
+ rOStm << (sal_Int32) rMapMode.GetScaleY().GetNumerator();
+ rOStm << (sal_Int32) rMapMode.GetScaleY().GetDenominator();
}
// ------------------------------------------------------------------------
void ImplWritePushAction( SvStream& rOStm )
{
- rOStm << (INT16) GDI_PUSH_ACTION;
- rOStm << (INT32) 4;
+ rOStm << (sal_Int16) GDI_PUSH_ACTION;
+ rOStm << (sal_Int32) 4;
}
// ------------------------------------------------------------------------
void ImplWritePopAction( SvStream& rOStm )
{
- rOStm << (INT16) GDI_POP_ACTION;
- rOStm << (INT32) 4;
+ rOStm << (sal_Int16) GDI_POP_ACTION;
+ rOStm << (sal_Int32) 4;
}
// ------------------------------------------------------------------------
-void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, INT16 nStyle, INT32 nWidth = 0L )
+void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle, sal_Int32 nWidth = 0L )
{
if( rColor.GetTransparency() > 127 )
nStyle = 0;
- rOStm << (INT16) GDI_PEN_ACTION;
- rOStm << (INT32) 16;
+ rOStm << (sal_Int16) GDI_PEN_ACTION;
+ rOStm << (sal_Int32) 16;
ImplWriteColor( rOStm, rColor );
rOStm << nWidth;
rOStm << nStyle;
@@ -217,10 +217,10 @@ void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, INT16 nStyle, INT
// ------------------------------------------------------------------------
-void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle )
+void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle )
{
- rOStm << (INT16) GDI_FILLBRUSH_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_FILLBRUSH_ACTION;
+ rOStm << (sal_Int32) 20;
ImplWriteColor( rOStm, rColor );
if( rColor.GetTransparency() > 127 )
@@ -230,13 +230,13 @@ void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle )
{
ImplWriteColor( rOStm, COL_WHITE );
rOStm << nStyle;
- rOStm << (INT16) 1;
+ rOStm << (sal_Int16) 1;
}
else
{
ImplWriteColor( rOStm, COL_BLACK );
rOStm << nStyle;
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
}
}
@@ -275,24 +275,24 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
break;
}
- rOStm << (INT16) GDI_FONT_ACTION;
- rOStm << (INT32) 78;
+ rOStm << (sal_Int16) GDI_FONT_ACTION;
+ rOStm << (sal_Int32) 78;
rActualCharSet = GetStoreCharSet( rFont.GetCharSet() );
ImplWriteColor( rOStm, rFont.GetColor() );
ImplWriteColor( rOStm, rFont.GetFillColor() );
rOStm.Write( aName, 32 );
rOStm << rFont.GetSize();
- rOStm << (INT16) 0; // no character orientation anymore
- rOStm << (INT16) rFont.GetOrientation();
- rOStm << (INT16) rActualCharSet;
- rOStm << (INT16) rFont.GetFamily();
- rOStm << (INT16) rFont.GetPitch();
- rOStm << (INT16) rFont.GetAlign();
- rOStm << (INT16) nWeight;
- rOStm << (INT16) rFont.GetUnderline();
- rOStm << (INT16) rFont.GetStrikeout();
- rOStm << (BOOL) ( rFont.GetItalic() != ITALIC_NONE );
+ rOStm << (sal_Int16) 0; // no character orientation anymore
+ rOStm << (sal_Int16) rFont.GetOrientation();
+ rOStm << (sal_Int16) rActualCharSet;
+ rOStm << (sal_Int16) rFont.GetFamily();
+ rOStm << (sal_Int16) rFont.GetPitch();
+ rOStm << (sal_Int16) rFont.GetAlign();
+ rOStm << (sal_Int16) nWeight;
+ rOStm << (sal_Int16) rFont.GetUnderline();
+ rOStm << (sal_Int16) rFont.GetStrikeout();
+ rOStm << (sal_Bool) ( rFont.GetItalic() != ITALIC_NONE );
rOStm << rFont.IsOutline();
rOStm << rFont.IsShadow();
rOStm << rFont.IsTransparent();
@@ -302,9 +302,9 @@ void ImplWriteFont( SvStream& rOStm, const Font& rFont,
// ------------------------------------------------------------------------
-void ImplWriteRasterOpAction( SvStream& rOStm, INT16 nRasterOp )
+void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
{
- rOStm << (INT16) GDI_RASTEROP_ACTION << (INT32) 6 << nRasterOp;
+ rOStm << (sal_Int16) GDI_RASTEROP_ACTION << (sal_Int32) 6 << nRasterOp;
}
// ------------------------------------------------------------------------
@@ -356,12 +356,12 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, String& rStri
// ------------------------------------------------------------------------
-void ImplSkipActions( SvStream& rIStm, ULONG nSkipCount )
+void ImplSkipActions( SvStream& rIStm, sal_uLong nSkipCount )
{
- INT32 nActionSize;
- INT16 nType;
+ sal_Int32 nActionSize;
+ sal_Int16 nType;
- for( ULONG i = 0UL; i < nSkipCount; i++ )
+ for( sal_uLong i = 0UL; i < nSkipCount; i++ )
{
rIStm >> nType >> nActionSize;
rIStm.SeekRel( nActionSize - 4L );
@@ -400,7 +400,7 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if((bOnlyWhenCurve && nAllFlagCount) || (!bOnlyWhenCurve && nAllPointCount))
{
- rOStm << (INT16) GDI_EXTENDEDPOLYGON_ACTION;
+ rOStm << (sal_Int16) GDI_EXTENDEDPOLYGON_ACTION;
const sal_Int32 nActionSize(
4 + // Action size
@@ -429,16 +429,16 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol
if(rCandidate.HasFlags())
{
- rOStm << (BYTE)true;
+ rOStm << (sal_uInt8)true;
for(sal_uInt16 c(0); c < nPointCount; c++)
{
- rOStm << (BYTE)rCandidate.GetFlags(c);
+ rOStm << (sal_uInt8)rCandidate.GetFlags(c);
}
}
else
{
- rOStm << (BYTE)false;
+ rOStm << (sal_uInt8)false;
}
}
}
@@ -471,12 +471,12 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly)
rIStm >> aCandidate[b];
}
- BYTE bHasFlags(false);
+ sal_uInt8 bHasFlags(false);
rIStm >> bHasFlags;
if(bHasFlags)
{
- BYTE aPolyFlags(0);
+ sal_uInt8 aPolyFlags(0);
for(sal_uInt16 c(0); c < nPointCount; c++)
{
@@ -494,7 +494,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, PolyPolygon& rPolyPoly)
// - SVMConverter -
// ----------------
-SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMode )
+SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, sal_uLong nConvertMode )
{
if( !rStm.GetError() )
{
@@ -509,15 +509,15 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMod
void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
- const ULONG nPos = rIStm.Tell();
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uLong nPos = rIStm.Tell();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
char aCode[ 5 ];
Size aPrefSz;
- INT16 nSize;
- INT16 nVersion;
+ sal_Int16 nSize;
+ sal_Int16 nVersion;
// read header
rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung
@@ -541,7 +541,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Stack aLIStack;
VirtualDevice aFontVDev;
rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
- BOOL bFatLine = FALSE;
+ sal_Bool bFatLine = sal_False;
// TODO: fix reindentation below if you can accept being blamed by the SCM
MapMode aMapMode;
@@ -550,12 +550,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Point aPt, aPt1;
Size aSz;
Color aActionColor;
- INT32 nTmp, nTmp1, nActionSize;
- INT32 nActions;
- INT16 nType;
+ sal_Int32 nTmp, nTmp1, nActionSize;
+ sal_Int32 nActions;
+ sal_Int16 nType;
sal_uInt32 nUnicodeCommentStreamPos = 0;
- INT32 nUnicodeCommentActionNumber = 0;
+ sal_Int32 nUnicodeCommentActionNumber = 0;
ImplReadMapMode( rIStm, aMapMode ); // MapMode
rIStm >> nActions; // Action count
@@ -564,7 +564,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rMtf.SetPrefMapMode( aMapMode );
sal_uInt32 nLastPolygonAction(0);
- for( INT32 i = 0L; i < nActions; i++ )
+ for( sal_Int32 i = 0L; i < nActions; i++ )
{
rIStm >> nType;
sal_Int32 nActBegin = rIStm.Tell();
@@ -598,7 +598,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case (GDI_LINEJOIN_ACTION) :
{
- INT16 nLineJoin(0);
+ sal_Int16 nLineJoin(0);
rIStm >> nLineJoin;
aLineInfo.SetLineJoin((basegfx::B2DLineJoin)nLineJoin);
}
@@ -606,8 +606,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case (GDI_LINEDASHDOT_ACTION) :
{
- INT16 a(0);
- INT32 b(0);
+ sal_Int16 a(0);
+ sal_Int32 b(0);
rIStm >> a; aLineInfo.SetDashCount(a);
rIStm >> b; aLineInfo.SetDashLen(b);
@@ -715,7 +715,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect.Center(), aRect.GetWidth() >> 1, aRect.GetHeight() >> 1 );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -735,7 +735,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect, aPt, aPt1, POLY_ARC );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -755,7 +755,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const Polygon aPoly( aRect, aPt, aPt1, POLY_PIE );
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) );
@@ -795,7 +795,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
if( bFatLine )
{
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolygonAction( aActionPoly ) );
rMtf.AddAction( new MetaPopAction() );
rMtf.AddAction( new MetaPolyLineAction( aActionPoly, aLineInfo ) );
@@ -817,11 +817,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
if( bFatLine )
{
rMtf.AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
- rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, FALSE ) );
+ rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, sal_False ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
rMtf.AddAction( new MetaPopAction() );
- for( USHORT nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
+ for( sal_uInt16 nPoly = 0, nCount = aPolyPoly.Count(); nPoly < nCount; nPoly++ )
rMtf.AddAction( new MetaPolyLineAction( aPolyPoly[ nPoly ], aLineInfo ) );
}
else
@@ -836,10 +836,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
Font aFont;
char aName[ 32 ];
- INT32 nWidth, nHeight;
- INT16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
- INT16 nCharOrient, nLineOrient;
- BOOL bItalic, bOutline, bShadow, bTransparent;
+ sal_Int32 nWidth, nHeight;
+ sal_Int16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
+ sal_Int16 nCharOrient, nLineOrient;
+ sal_Bool bItalic, bOutline, bShadow, bTransparent;
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
@@ -882,16 +882,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXT_ACTION ):
{
ByteString aByteStr;
- INT32 nIndex, nLen;
+ sal_Int32 nIndex, nLen;
rIStm >> aPt >> nIndex >> nLen >> nTmp;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextAction( aPt, aStr, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaTextAction( aPt, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -901,17 +901,17 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ByteString aByteStr;
sal_Int32* pDXAry = NULL;
- INT32 nIndex, nLen, nAryLen;
+ sal_Int32 nIndex, nLen, nAryLen;
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if( nAryLen > 0L )
{
- INT32 nStrLen( aStr.Len() );
+ sal_Int32 nStrLen( aStr.Len() );
pDXAry = new sal_Int32[ Max( nAryLen, nStrLen ) ];
@@ -925,7 +925,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
sal_Int32* pTmpAry = new sal_Int32[nStrLen];
- aFontVDev.GetTextArray( aStr, pTmpAry, (USHORT) nIndex, (USHORT) nLen );
+ aFontVDev.GetTextArray( aStr, pTmpAry, (sal_uInt16) nIndex, (sal_uInt16) nLen );
// now, the difference between the
// last and the second last DX array
@@ -949,7 +949,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
}
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaTextArrayAction( aPt, aStr, pDXAry, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
if( pDXAry )
delete[] pDXAry;
@@ -961,16 +961,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_STRETCHTEXT_ACTION ):
{
ByteString aByteStr;
- INT32 nIndex, nLen, nWidth;
+ sal_Int32 nIndex, nLen, nWidth;
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) )
{
- rIStm.Read( aByteStr.AllocBuffer( (USHORT)nTmp ), nTmp + 1 );
+ rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
UniString aStr( aByteStr, eActualCharSet );
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
- rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (USHORT) nIndex, (USHORT) nLen ) );
+ rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
}
rIStm.Seek( nActBegin + nActionSize );
}
@@ -1006,8 +1006,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_PEN_ACTION ):
{
- INT32 nPenWidth;
- INT16 nPenStyle;
+ sal_Int32 nPenWidth;
+ sal_Int16 nPenStyle;
ImplReadColor( rIStm, aActionColor );
rIStm >> nPenWidth >> nPenStyle;
@@ -1022,7 +1022,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_FILLBRUSH_ACTION ):
{
- INT16 nBrushStyle;
+ sal_Int16 nBrushStyle;
ImplReadColor( rIStm, aActionColor );
rIStm.SeekRel( 6L );
@@ -1045,9 +1045,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_CLIPREGION_ACTION ):
{
Region aRegion;
- INT16 nRegType;
- INT16 bIntersect;
- BOOL bClip = FALSE;
+ sal_Int16 nRegType;
+ sal_Int16 bIntersect;
+ sal_Bool bClip = sal_False;
rIStm >> nRegType >> bIntersect;
ImplReadRect( rIStm, aRect );
@@ -1063,7 +1063,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadRect( rIStm, aRegRect );
aRegion = Region( aRegRect );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
@@ -1071,25 +1071,25 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ImplReadPoly( rIStm, aActionPoly );
aRegion = Region( aActionPoly );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
case( 3 ):
{
PolyPolygon aPolyPoly;
- INT32 nPolyCount;
+ sal_Int32 nPolyCount;
rIStm >> nPolyCount;
- for( USHORT j = 0; j < (USHORT) nPolyCount; j++ )
+ for( sal_uInt16 j = 0; j < (sal_uInt16) nPolyCount; j++ )
{
ImplReadPoly( rIStm, aActionPoly );
aPolyPoly.Insert( aActionPoly );
}
aRegion = Region( aPolyPoly );
- bClip = TRUE;
+ bClip = sal_True;
}
break;
}
@@ -1118,7 +1118,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_RASTEROP_ACTION ):
{
RasterOp eRasterOp;
- INT16 nRasterOp;
+ sal_Int16 nRasterOp;
rIStm >> nRasterOp;
@@ -1176,13 +1176,13 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
Color aStartCol;
Color aEndCol;
- INT16 nStyle;
- INT16 nAngle;
- INT16 nBorder;
- INT16 nOfsX;
- INT16 nOfsY;
- INT16 nIntensityStart;
- INT16 nIntensityEnd;
+ sal_Int16 nStyle;
+ sal_Int16 nAngle;
+ sal_Int16 nBorder;
+ sal_Int16 nOfsX;
+ sal_Int16 nOfsY;
+ sal_Int16 nIntensityStart;
+ sal_Int16 nIntensityEnd;
ImplReadRect( rIStm, aRect );
rIStm >> nStyle;
@@ -1205,8 +1205,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TRANSPARENT_COMMENT ):
{
PolyPolygon aPolyPoly;
- INT32 nFollowingActionCount;
- INT16 nTrans;
+ sal_Int32 nFollowingActionCount;
+ sal_Int16 nTrans;
rIStm >> aPolyPoly >> nTrans >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1224,7 +1224,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
Point aPos;
Size aSize;
Gradient aGradient;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aMtf >> aPos >> aSize >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1240,7 +1240,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
PolyPolygon aPolyPoly;
Hatch aHatch;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aPolyPoly >> aHatch >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1255,8 +1255,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_REFPOINT_COMMENT ):
{
Point aRefPoint;
- BOOL bSet;
- INT32 nFollowingActionCount;
+ sal_Bool bSet;
+ sal_Int32 nFollowingActionCount;
rIStm >> aRefPoint >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1277,8 +1277,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_TEXTLINECOLOR_COMMENT ):
{
Color aColor;
- BOOL bSet;
- INT32 nFollowingActionCount;
+ sal_Bool bSet;
+ sal_Int32 nFollowingActionCount;
rIStm >> aColor >> bSet >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1296,7 +1296,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
long nWidth;
sal_uInt32 nStrikeout;
sal_uInt32 nUnderline;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aStartPt >> nWidth >> nStrikeout >> nUnderline >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1315,7 +1315,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
PolyPolygon aPolyPoly;
Gradient aGradient;
- INT32 nFollowingActionCount;
+ sal_Int32 nFollowingActionCount;
rIStm >> aPolyPoly >> aGradient >> nFollowingActionCount;
ImplSkipActions( rIStm, nFollowingActionCount );
@@ -1332,14 +1332,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ByteString aComment;
sal_Int32 nValue;
sal_uInt32 nDataSize;
- BYTE* pData;
- INT32 nFollowingActionCount;
+ sal_uInt8* pData;
+ sal_Int32 nFollowingActionCount;
rIStm >> aComment >> nValue >> nDataSize;
if( nDataSize )
{
- pData = new BYTE[ nDataSize ];
+ pData = new sal_uInt8[ nDataSize ];
rIStm.Read( pData, nDataSize );
}
else
@@ -1380,12 +1380,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
{
- ULONG nCountPos;
+ sal_uLong nCountPos;
Font aSaveFont;
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
const Size aPrefSize( rMtf.GetPrefSize() );
- BOOL bRop_0_1 = FALSE;
+ sal_Bool bRop_0_1 = sal_False;
VirtualDevice aSaveVDev;
Color aLineCol( COL_BLACK );
Stack aLineColStack;
@@ -1394,18 +1394,18 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
//MagicCode schreiben
rOStm << "SVGDI"; // Kennung
- rOStm << (INT16) 42; // HeaderSize
- rOStm << (INT16) 200; // VERSION
- rOStm << (INT32) aPrefSize.Width();
- rOStm << (INT32) aPrefSize.Height();
+ rOStm << (sal_Int16) 42; // HeaderSize
+ rOStm << (sal_Int16) 200; // VERSION
+ rOStm << (sal_Int32) aPrefSize.Width();
+ rOStm << (sal_Int32) aPrefSize.Height();
ImplWriteMapMode( rOStm, rMtf.GetPrefMapMode() );
// ActionCount wird spaeter geschrieben
nCountPos = rOStm.Tell();
rOStm.SeekRel( 4L );
- const INT32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
- const ULONG nActPos = rOStm.Tell();
+ const sal_Int32 nActCount = ImplWriteActions( rOStm, rMtf, aSaveVDev, bRop_0_1, aLineCol, aLineColStack, eActualCharSet );
+ const sal_uLong nActPos = rOStm.Tell();
rOStm.Seek( nCountPos );
rOStm << nActCount;
@@ -1419,13 +1419,13 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
- VirtualDevice& rSaveVDev, BOOL& rRop_0_1,
+sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
+ VirtualDevice& rSaveVDev, sal_Bool& rRop_0_1,
Color& rLineCol, Stack& rLineColStack,
rtl_TextEncoding& rActualCharSet )
{
- ULONG nCount = 0;
- for( ULONG i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
+ sal_uLong nCount = 0;
+ for( sal_uLong i = 0, nActionCount = rMtf.GetActionCount(); i < nActionCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
@@ -1435,8 +1435,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
- rOStm << (INT16) GDI_PIXEL_ACTION;
- rOStm << (INT32) 18;
+ rOStm << (sal_Int16) GDI_PIXEL_ACTION;
+ rOStm << (sal_Int32) 18;
rOStm << pAct->GetPoint();
ImplWriteColor( rOStm, pAct->GetColor() );
nCount++;
@@ -1447,8 +1447,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPointAction* pAct = (MetaPointAction*) pAction;
- rOStm << (INT16) GDI_POINT_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_POINT_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
nCount++;
}
@@ -1469,25 +1469,25 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (INT16) GDI_LINEJOIN_ACTION;
- rOStm << (INT32) 6;
- rOStm << (INT16) rInfo.GetLineJoin();
+ rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineJoin();
}
if(bLineDashDot)
{
- rOStm << (INT16) GDI_LINEDASHDOT_ACTION;
- rOStm << (INT32) 4 + 16;
- rOStm << (INT16)rInfo.GetDashCount();
- rOStm << (INT32)rInfo.GetDashLen();
- rOStm << (INT16)rInfo.GetDotCount();
- rOStm << (INT32)rInfo.GetDotLen();
- rOStm << (INT32)rInfo.GetDistance();
+ rOStm << (sal_Int16) GDI_LINEDASHDOT_ACTION;
+ rOStm << (sal_Int32) 4 + 16;
+ rOStm << (sal_Int16)rInfo.GetDashCount();
+ rOStm << (sal_Int32)rInfo.GetDashLen();
+ rOStm << (sal_Int16)rInfo.GetDotCount();
+ rOStm << (sal_Int32)rInfo.GetDotLen();
+ rOStm << (sal_Int32)rInfo.GetDistance();
}
}
- rOStm << (INT16) GDI_LINE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_LINE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
nCount++;
@@ -1514,11 +1514,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRectAction* pAct = (MetaRectAction*) pAction;
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) 0;
- rOStm << (INT32) 0;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) 0;
nCount++;
}
break;
@@ -1527,11 +1527,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) pAct->GetHorzRound();
- rOStm << (INT32) pAct->GetVertRound();
+ rOStm << (sal_Int32) pAct->GetHorzRound();
+ rOStm << (sal_Int32) pAct->GetVertRound();
nCount++;
}
break;
@@ -1540,8 +1540,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
- rOStm << (INT16) GDI_ELLIPSE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_ELLIPSE_ACTION;
+ rOStm << (sal_Int32) 20;
ImplWriteRect( rOStm, pAct->GetRect() );
nCount++;
}
@@ -1551,8 +1551,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaArcAction* pAct = (MetaArcAction*) pAction;
- rOStm << (INT16) GDI_ARC_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_ARC_ACTION;
+ rOStm << (sal_Int32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1564,8 +1564,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaPieAction* pAct = (MetaPieAction*) pAction;
- rOStm << (INT16) GDI_PIE_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_PIE_ACTION;
+ rOStm << (sal_Int32) 36;
ImplWriteRect( rOStm, pAct->GetRect() );
rOStm << pAct->GetStartPoint();
rOStm << pAct->GetEndPoint();
@@ -1578,13 +1578,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaChordAction* pAct = (MetaChordAction*) pAction;
Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(),
pAct->GetEndPoint(), POLY_CHORD );
- const USHORT nPoints = aChordPoly.GetSize();
+ const sal_uInt16 nPoints = aChordPoly.GetSize();
- rOStm << (INT16) GDI_POLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
rOStm << aChordPoly[ n ];
nCount++;
}
@@ -1600,7 +1600,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
const LineInfo& rInfo = pAct->GetLineInfo();
- const USHORT nPoints(aSimplePoly.GetSize());
+ const sal_uInt16 nPoints(aSimplePoly.GetSize());
const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle()));
const bool bLineJoin(bFatLine && basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin());
const bool bLineDashDot(LINE_DASH == rInfo.GetStyle());
@@ -1612,28 +1612,28 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if(bLineJoin)
{
- rOStm << (INT16) GDI_LINEJOIN_ACTION;
- rOStm << (INT32) 6;
- rOStm << (INT16) rInfo.GetLineJoin();
+ rOStm << (sal_Int16) GDI_LINEJOIN_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineJoin();
}
}
if(bLineDashDot)
{
- rOStm << (INT16) GDI_LINEDASHDOT_ACTION;
- rOStm << (INT32) 4 + 16;
- rOStm << (INT16)rInfo.GetDashCount();
- rOStm << (INT32)rInfo.GetDashLen();
- rOStm << (INT16)rInfo.GetDotCount();
- rOStm << (INT32)rInfo.GetDotLen();
- rOStm << (INT32)rInfo.GetDistance();
+ rOStm << (sal_Int16) GDI_LINEDASHDOT_ACTION;
+ rOStm << (sal_Int32) 4 + 16;
+ rOStm << (sal_Int16)rInfo.GetDashCount();
+ rOStm << (sal_Int32)rInfo.GetDashLen();
+ rOStm << (sal_Int16)rInfo.GetDotCount();
+ rOStm << (sal_Int32)rInfo.GetDotLen();
+ rOStm << (sal_Int32)rInfo.GetDistance();
}
- rOStm << (INT16) GDI_POLYLINE_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYLINE_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
{
rOStm << aSimplePoly[ n ];
}
@@ -1672,13 +1672,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// a polygon representing the curve as good as possible
Polygon aSimplePoly;
pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
- const USHORT nPoints(aSimplePoly.GetSize());
+ const sal_uInt16 nPoints(aSimplePoly.GetSize());
- rOStm << (INT16) GDI_POLYGON_ACTION;
- rOStm << (INT32) ( 8 + ( nPoints << 3 ) );
- rOStm << (INT32) nPoints;
+ rOStm << (sal_Int16) GDI_POLYGON_ACTION;
+ rOStm << (sal_Int32) ( 8 + ( nPoints << 3 ) );
+ rOStm << (sal_Int32) nPoints;
- for( USHORT n = 0; n < nPoints; n++ )
+ for( sal_uInt16 n = 0; n < nPoints; n++ )
rOStm << aSimplePoly[ n ];
nCount++;
@@ -1709,17 +1709,17 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextAction* pAct = (MetaTextAction*) pAction;
String aUniText( pAct->GetText() );
ByteString aText( aUniText, rActualCharSet );
- const ULONG nStrLen = aText.Len();
+ const sal_uLong nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (INT16) GDI_TEXT_ACTION;
- rOStm << (INT32) ( 24 + ( nStrLen + 1 ) );
+ rOStm << (sal_Int16) GDI_TEXT_ACTION;
+ rOStm << (sal_Int32) ( 24 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) pAct->GetIndex();
- rOStm << (INT32) pAct->GetLen();
- rOStm << (INT32) nStrLen;
+ rOStm << (sal_Int32) pAct->GetIndex();
+ rOStm << (sal_Int32) pAct->GetLen();
+ rOStm << (sal_Int32) nStrLen;
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1730,9 +1730,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction;
ByteString aText( pAct->GetText(), rActualCharSet );
String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() );
- ULONG nAryLen;
- ULONG nLen = pAct->GetLen();
- const ULONG nTextLen = aText.Len();
+ sal_uLong nAryLen;
+ sal_uLong nLen = pAct->GetLen();
+ const sal_uLong nTextLen = aText.Len();
sal_Int32* pDXArray = pAct->GetDXArray();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
@@ -1751,17 +1751,17 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
else
nAryLen = nLen; // #105987# Write out all of DX array
- rOStm << (INT16) GDI_TEXTARRAY_ACTION;
- rOStm << (INT32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
+ rOStm << (sal_Int16) GDI_TEXTARRAY_ACTION;
+ rOStm << (sal_Int32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) 0;
- rOStm << (INT32) nLen;
- rOStm << (INT32) nLen;
- rOStm << (INT32) nAryLen;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) nLen;
+ rOStm << (sal_Int32) nLen;
+ rOStm << (sal_Int32) nAryLen;
rOStm.Write( aText.GetBuffer()+pAct->GetIndex(), nLen + 1 );
- for( ULONG n = 0UL ; n < nAryLen; n++ )
- rOStm << (INT32) pDXArray[ n ];
+ for( sal_uLong n = 0UL ; n < nAryLen; n++ )
+ rOStm << (sal_Int32) pDXArray[ n ];
nCount++;
}
@@ -1772,18 +1772,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
String aUniText( pAct->GetText() );
ByteString aText( aUniText, rActualCharSet );
- const ULONG nStrLen = aText.Len();
+ const sal_uLong nStrLen = aText.Len();
if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
nCount++;
- rOStm << (INT16) GDI_STRETCHTEXT_ACTION;
- rOStm << (INT32) ( 28 + ( nStrLen + 1 ) );
+ rOStm << (sal_Int16) GDI_STRETCHTEXT_ACTION;
+ rOStm << (sal_Int32) ( 28 + ( nStrLen + 1 ) );
rOStm << pAct->GetPoint();
- rOStm << (INT32) pAct->GetIndex();
- rOStm << (INT32) pAct->GetLen();
- rOStm << (INT32) nStrLen;
- rOStm << (INT32) pAct->GetWidth();
+ rOStm << (sal_Int32) pAct->GetIndex();
+ rOStm << (sal_Int32) pAct->GetLen();
+ rOStm << (sal_Int32) nStrLen;
+ rOStm << (sal_Int32) pAct->GetWidth();
rOStm.Write( aText.GetBuffer(), nStrLen + 1 );
nCount++;
}
@@ -1793,8 +1793,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
- rOStm << (INT16) GDI_BITMAP_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_BITMAP_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
rOStm << pAct->GetBitmap();
nCount++;
@@ -1805,8 +1805,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
- rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << pAct->GetBitmap();
@@ -1818,8 +1818,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
- rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (sal_Int32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1834,8 +1834,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAP_ACTION;
- rOStm << (INT32) 12;
+ rOStm << (sal_Int16) GDI_BITMAP_ACTION;
+ rOStm << (sal_Int32) 12;
rOStm << pAct->GetPoint();
rOStm << aBmp;
nCount++;
@@ -1847,8 +1847,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAPSCALE_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_BITMAPSCALE_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetPoint();
rOStm << pAct->GetSize();
rOStm << aBmp;
@@ -1861,8 +1861,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() );
- rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION;
- rOStm << (INT32) 36;
+ rOStm << (sal_Int16) GDI_BITMAPSCALEPART_ACTION;
+ rOStm << (sal_Int32) 36;
rOStm << pAct->GetDestPoint();
rOStm << pAct->GetDestSize();
rOStm << pAct->GetSrcPoint();
@@ -1877,18 +1877,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
const Gradient& rGrad = pAct->GetGradient();
- rOStm << (INT16) GDI_GRADIENT_ACTION;
- rOStm << (INT32) 46;
+ rOStm << (sal_Int16) GDI_GRADIENT_ACTION;
+ rOStm << (sal_Int32) 46;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT16) rGrad.GetStyle();
+ rOStm << (sal_Int16) rGrad.GetStyle();
ImplWriteColor( rOStm, rGrad.GetStartColor() );
ImplWriteColor( rOStm, rGrad.GetEndColor() );
- rOStm << (INT16) rGrad.GetAngle();
- rOStm << (INT16) rGrad.GetBorder();
- rOStm << (INT16) rGrad.GetOfsX();
- rOStm << (INT16) rGrad.GetOfsY();
- rOStm << (INT16) rGrad.GetStartIntensity();
- rOStm << (INT16) rGrad.GetEndIntensity();
+ rOStm << (sal_Int16) rGrad.GetAngle();
+ rOStm << (sal_Int16) rGrad.GetBorder();
+ rOStm << (sal_Int16) rGrad.GetOfsX();
+ rOStm << (sal_Int16) rGrad.GetOfsY();
+ rOStm << (sal_Int16) rGrad.GetStartIntensity();
+ rOStm << (sal_Int16) rGrad.GetEndIntensity();
nCount++;
}
break;
@@ -1896,10 +1896,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_GRADIENTEX_ACTION ):
{
const MetaGradientExAction* pA = (MetaGradientExAction*) pAction;
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_GRADIENTEX_COMMENT;
+ rOStm << (sal_Int16) GDI_GRADIENTEX_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -1907,12 +1907,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << pA->GetPolyPolygon() << pA->GetGradient();
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -1928,11 +1928,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
ImplWriteLineColor( rOStm, rColor, 1 );
ImplWriteFillColor( rOStm, rColor, 1 );
- rOStm << (INT16) GDI_RECT_ACTION;
- rOStm << (INT32) 28;
+ rOStm << (sal_Int16) GDI_RECT_ACTION;
+ rOStm << (sal_Int32) 28;
ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm << (INT32) 0;
- rOStm << (INT32) 0;
+ rOStm << (sal_Int32) 0;
+ rOStm << (sal_Int32) 0;
ImplWritePopAction( rOStm );
nCount += 5;
@@ -1945,18 +1945,18 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const Region& rRegion = pAct->GetRegion();
Rectangle aClipRect;
- rOStm << (INT16) GDI_CLIPREGION_ACTION;
- rOStm << (INT32) 24;
+ rOStm << (sal_Int16) GDI_CLIPREGION_ACTION;
+ rOStm << (sal_Int32) 24;
if( pAct->IsClipping() )
{
aClipRect = rRegion.GetBoundRect();
- rOStm << (INT16) 1;
+ rOStm << (sal_Int16) 1;
}
else
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
- rOStm << (INT16) 0;
+ rOStm << (sal_Int16) 0;
ImplWriteRect( rOStm, aClipRect );
if( pAct->IsClipping() )
@@ -1970,8 +1970,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
- rOStm << (INT16) GDI_ISECTCLIPREGION_ACTION;
- rOStm << (INT32) 20;
+ rOStm << (sal_Int16) GDI_ISECTCLIPREGION_ACTION;
+ rOStm << (sal_Int32) 20;
rOStm << pAct->GetRect();
nCount++;
}
@@ -1981,10 +1981,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
- rOStm << (INT16) GDI_MOVECLIPREGION_ACTION;
- rOStm << (INT32) 12;
- rOStm << (INT32) pAct->GetHorzMove();
- rOStm << (INT32) pAct->GetVertMove();
+ rOStm << (sal_Int16) GDI_MOVECLIPREGION_ACTION;
+ rOStm << (sal_Int32) 12;
+ rOStm << (sal_Int32) pAct->GetHorzMove();
+ rOStm << (sal_Int32) pAct->GetVertMove();
nCount++;
}
break;
@@ -2055,8 +2055,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
MetaMapModeAction* pAct = (MetaMapModeAction*) pAction;
- rOStm << (INT16) GDI_MAPMODE_ACTION;
- rOStm << (INT32) 30;
+ rOStm << (sal_Int16) GDI_MAPMODE_ACTION;
+ rOStm << (sal_Int32) 30;
ImplWriteMapMode( rOStm, pAct->GetMapMode() );
nCount++;
}
@@ -2093,7 +2093,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( ( pAct->GetRasterOp() != ROP_0 ) && ( pAct->GetRasterOp() != ROP_1 ) )
{
- INT16 nRasterOp;
+ sal_Int16 nRasterOp;
// Falls vorher ROP_0/1 gesetzt war, alten
// Zustand durch Pop erst wieder herstellen
@@ -2101,7 +2101,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
ImplWritePopAction( rOStm );
rSaveVDev.Pop();
- rRop_0_1 = FALSE;
+ rRop_0_1 = sal_False;
nCount++;
}
@@ -2133,7 +2133,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
}
ImplWriteRasterOpAction( rOStm, 0 );
- rRop_0_1 = TRUE;
+ rRop_0_1 = sal_True;
nCount += 4;
}
}
@@ -2142,12 +2142,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
case( META_TRANSPARENT_ACTION ):
{
const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon();
- const INT16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence();
- const INT16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
- ULONG nOldPos, nNewPos;
+ const sal_Int16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence();
+ const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
+ sal_uLong nOldPos, nNewPos;
// write transparence comment
- rOStm << (INT16) GDI_TRANSPARENT_COMMENT;
+ rOStm << (sal_Int16) GDI_TRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2156,12 +2156,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write comment data
rOStm << rPolyPoly;
rOStm << nTrans;
- rOStm << (INT32) 15; // number of actions that follow this comment
+ rOStm << (sal_Int32) 15; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
{
@@ -2207,10 +2207,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const Point& rPos = pA->GetPoint();
const Size& rSize = pA->GetSize();
const Gradient& rGradient = pA->GetGradient();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_FLOATTRANSPARENT_COMMENT;
+ rOStm << (sal_Int16) GDI_FLOATTRANSPARENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2222,12 +2222,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos + 4 );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
// write actions for float transparence
- ULONG nAddCount;
+ sal_uLong nAddCount;
GDIMetaFile aMtf( rTransMtf );
const Size aSrcSize( rTransMtf.GetPrefSize() );
Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() );
@@ -2249,7 +2249,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
nAddCount = ImplWriteActions( rOStm, aMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) nAddCount;
+ rOStm << (sal_Int32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2266,10 +2266,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const MetaHatchAction* pA = (MetaHatchAction*) pAction;
const PolyPolygon& rPolyPoly = pA->GetPolyPolygon();
const Hatch& rHatch = pA->GetHatch();
- ULONG nOldPos, nNewPos, nAddCount;
+ sal_uLong nOldPos, nNewPos, nAddCount;
// write hatch comment
- rOStm << (INT16) GDI_HATCH_COMMENT;
+ rOStm << (sal_Int16) GDI_HATCH_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2282,7 +2282,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos + 4 );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos + 4 );
rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
{
@@ -2294,7 +2294,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
nAddCount = ImplWriteActions( rOStm, aTmpMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) nAddCount;
+ rOStm << (sal_Int32) nAddCount;
rOStm.Seek( nNewPos );
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
@@ -2310,11 +2310,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaRefPointAction* pA = (MetaRefPointAction*) pAction;
const Point& rRefPoint = pA->GetRefPoint();
- const BOOL bSet = pA->IsSetting();
- ULONG nOldPos, nNewPos;
+ const sal_Bool bSet = pA->IsSetting();
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_REFPOINT_COMMENT;
+ rOStm << (sal_Int16) GDI_REFPOINT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2322,12 +2322,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rRefPoint << bSet;
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2338,11 +2338,11 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction;
const Color& rColor = pA->GetColor();
- const BOOL bSet = pA->IsSetting();
- ULONG nOldPos, nNewPos;
+ const sal_Bool bSet = pA->IsSetting();
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_TEXTLINECOLOR_COMMENT;
+ rOStm << (sal_Int16) GDI_TEXTLINECOLOR_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2350,12 +2350,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
// write data
rOStm << rColor << bSet;
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2369,10 +2369,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
const long nWidth = pA->GetWidth();
const FontStrikeout eStrikeout = pA->GetStrikeout();
const FontUnderline eUnderline = pA->GetUnderline();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_TEXTLINE_COMMENT;
+ rOStm << (sal_Int16) GDI_TEXTLINE_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2382,12 +2382,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
rOStm << rStartPt << nWidth <<
static_cast<sal_uInt32>(eStrikeout) <<
static_cast<sal_uInt32>(eUnderline);
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
@@ -2401,10 +2401,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
{
const MetaCommentAction* pA = (MetaCommentAction*) pAction;
const sal_uInt32 nDataSize = pA->GetDataSize();
- ULONG nOldPos, nNewPos;
+ sal_uLong nOldPos, nNewPos;
// write RefPoint comment
- rOStm << (INT16) GDI_COMMENT_COMMENT;
+ rOStm << (sal_Int16) GDI_COMMENT_COMMENT;
// we'll write the ActionSize later
nOldPos = rOStm.Tell();
@@ -2416,12 +2416,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
if( nDataSize )
rOStm.Write( pA->GetData(), nDataSize );
- rOStm << (INT32) 0; // number of actions that follow this comment
+ rOStm << (sal_Int32) 0; // number of actions that follow this comment
// calculate and write ActionSize of comment
nNewPos = rOStm.Tell();
rOStm.Seek( nOldPos );
- rOStm << (INT32) ( nNewPos - nOldPos );
+ rOStm << (sal_Int32) ( nNewPos - nOldPos );
rOStm.Seek( nNewPos );
nCount++;
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 61db9f110a9e..2a10563441fa 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -172,7 +172,7 @@ void Impl_Font::AskConfig()
String aShortName;
String aFamilyName;
- ULONG nType = 0;
+ sal_uLong nType = 0;
FontWeight eWeight = WEIGHT_DONTKNOW;
FontWidth eWidthType = WIDTH_DONTKNOW;
String aMapName = maFamilyName;
@@ -349,7 +349,7 @@ void Font::SetFillColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Font::SetTransparent( BOOL bTransparent )
+void Font::SetTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Font, NULL );
@@ -486,7 +486,7 @@ void Font::SetOrientation( short nOrientation )
// -----------------------------------------------------------------------
-void Font::SetVertical( BOOL bVertical )
+void Font::SetVertical( sal_Bool bVertical )
{
DBG_CHKTHIS( Font, NULL );
@@ -512,7 +512,7 @@ void Font::SetKerning( FontKerning nKerning )
// -----------------------------------------------------------------------
-BOOL Font::IsKerning() const
+sal_Bool Font::IsKerning() const
{
return (mpImplFont->mnKerning & KERNING_FONTSPECIFIC) != 0;
}
@@ -558,7 +558,7 @@ void Font::SetItalic( FontItalic eItalic )
// -----------------------------------------------------------------------
-void Font::SetOutline( BOOL bOutline )
+void Font::SetOutline( sal_Bool bOutline )
{
DBG_CHKTHIS( Font, NULL );
@@ -571,7 +571,7 @@ void Font::SetOutline( BOOL bOutline )
// -----------------------------------------------------------------------
-void Font::SetShadow( BOOL bShadow )
+void Font::SetShadow( sal_Bool bShadow )
{
DBG_CHKTHIS( Font, NULL );
@@ -649,7 +649,7 @@ void Font::SetEmphasisMark( FontEmphasisMark eEmphasisMark )
// -----------------------------------------------------------------------
-void Font::SetWordLineMode( BOOL bWordLine )
+void Font::SetWordLineMode( sal_Bool bWordLine )
{
DBG_CHKTHIS( Font, NULL );
@@ -690,17 +690,17 @@ Font& Font::operator=( const Font& rFont )
// -----------------------------------------------------------------------
-BOOL Font::operator==( const Font& rFont ) const
+sal_Bool Font::operator==( const Font& rFont ) const
{
DBG_CHKTHIS( Font, NULL );
DBG_CHKOBJ( &rFont, Font, NULL );
if( mpImplFont == rFont.mpImplFont )
- return TRUE;
+ return sal_True;
if( *mpImplFont == *rFont.mpImplFont )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -775,9 +775,9 @@ void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const
SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
- BOOL bTmp;
- BYTE nTmp8;
+ sal_uInt16 nTmp16;
+ sal_Bool bTmp;
+ sal_uInt8 nTmp8;
rIStm.ReadByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
rIStm.ReadByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
@@ -826,31 +826,31 @@ SvStream& operator<<( SvStream& rOStm, const Impl_Font& rImpl_Font )
rOStm.WriteByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() );
rOStm << rImpl_Font.maSize;
- rOStm << (UINT16) GetStoreCharSet( rImpl_Font.meCharSet );
- rOStm << (UINT16) rImpl_Font.meFamily;
- rOStm << (UINT16) rImpl_Font.mePitch;
- rOStm << (UINT16) rImpl_Font.meWeight;
- rOStm << (UINT16) rImpl_Font.meUnderline;
- rOStm << (UINT16) rImpl_Font.meStrikeout;
- rOStm << (UINT16) rImpl_Font.meItalic;
- rOStm << (UINT16) rImpl_Font.meLanguage;
- rOStm << (UINT16) rImpl_Font.meWidthType;
+ rOStm << (sal_uInt16) GetStoreCharSet( rImpl_Font.meCharSet );
+ rOStm << (sal_uInt16) rImpl_Font.meFamily;
+ rOStm << (sal_uInt16) rImpl_Font.mePitch;
+ rOStm << (sal_uInt16) rImpl_Font.meWeight;
+ rOStm << (sal_uInt16) rImpl_Font.meUnderline;
+ rOStm << (sal_uInt16) rImpl_Font.meStrikeout;
+ rOStm << (sal_uInt16) rImpl_Font.meItalic;
+ rOStm << (sal_uInt16) rImpl_Font.meLanguage;
+ rOStm << (sal_uInt16) rImpl_Font.meWidthType;
rOStm << rImpl_Font.mnOrientation;
- rOStm << (BOOL) rImpl_Font.mbWordLine;
- rOStm << (BOOL) rImpl_Font.mbOutline;
- rOStm << (BOOL) rImpl_Font.mbShadow;
- rOStm << (BYTE) rImpl_Font.mnKerning;
+ rOStm << (sal_Bool) rImpl_Font.mbWordLine;
+ rOStm << (sal_Bool) rImpl_Font.mbOutline;
+ rOStm << (sal_Bool) rImpl_Font.mbShadow;
+ rOStm << (sal_uInt8) rImpl_Font.mnKerning;
// new in version 2
- rOStm << (BYTE) rImpl_Font.meRelief;
- rOStm << (UINT16) rImpl_Font.meCJKLanguage;
- rOStm << (BOOL) rImpl_Font.mbVertical;
- rOStm << (UINT16) rImpl_Font.meEmphasisMark;
+ rOStm << (sal_uInt8) rImpl_Font.meRelief;
+ rOStm << (sal_uInt16) rImpl_Font.meCJKLanguage;
+ rOStm << (sal_Bool) rImpl_Font.mbVertical;
+ rOStm << (sal_uInt16) rImpl_Font.meEmphasisMark;
// new in version 3
- rOStm << (UINT16) rImpl_Font.meOverline;
+ rOStm << (sal_uInt16) rImpl_Font.meOverline;
return rOStm;
}
@@ -1087,7 +1087,7 @@ Font Font::identifyFont( const void* i_pBuffer, sal_uInt32 i_nSize )
// TODO: reformat
const Color& Font::GetColor() const { return mpImplFont->maColor; }
const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; }
-BOOL Font::IsTransparent() const { return mpImplFont->mbTransparent; }
+sal_Bool Font::IsTransparent() const { return mpImplFont->mbTransparent; }
FontAlign Font::GetAlign() const { return mpImplFont->meAlign; }
const String& Font::GetName() const { return mpImplFont->maFamilyName; }
const String& Font::GetStyleName() const { return mpImplFont->maStyleName; }
@@ -1100,21 +1100,21 @@ rtl_TextEncoding Font::GetCharSet() const { return mpImplFont->meCharSet; }
LanguageType Font::GetLanguage() const { return mpImplFont->meLanguage; }
LanguageType Font::GetCJKContextLanguage() const { return mpImplFont->meCJKLanguage; }
short Font::GetOrientation() const { return mpImplFont->mnOrientation; }
-BOOL Font::IsVertical() const { return mpImplFont->mbVertical; }
+sal_Bool Font::IsVertical() const { return mpImplFont->mbVertical; }
FontKerning Font::GetKerning() const { return mpImplFont->mnKerning; }
FontPitch Font::GetPitch() const { return mpImplFont->GetPitch(); }
FontWeight Font::GetWeight() const { return mpImplFont->GetWeight(); }
FontWidth Font::GetWidthType() const { return mpImplFont->GetWidthType(); }
FontItalic Font::GetItalic() const { return mpImplFont->GetItalic(); }
FontFamily Font::GetFamily() const { return mpImplFont->GetFamily(); }
-BOOL Font::IsOutline() const { return mpImplFont->mbOutline; }
-BOOL Font::IsShadow() const { return mpImplFont->mbShadow; }
+sal_Bool Font::IsOutline() const { return mpImplFont->mbOutline; }
+sal_Bool Font::IsShadow() const { return mpImplFont->mbShadow; }
FontRelief Font::GetRelief() const { return mpImplFont->meRelief; }
FontUnderline Font::GetUnderline() const { return mpImplFont->meUnderline; }
FontUnderline Font::GetOverline() const { return mpImplFont->meOverline; }
FontStrikeout Font::GetStrikeout() const { return mpImplFont->meStrikeout; }
FontEmphasisMark Font::GetEmphasisMark() const { return mpImplFont->meEmphasisMark; }
-BOOL Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
-BOOL Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
+sal_Bool Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
+sal_Bool Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index f476fa8e8452..79b8f417891b 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -62,7 +62,7 @@ using namespace com::sun::star;
// - Defines -
// -----------
-#define GAMMA( _def_cVal, _def_InvGamma ) ((BYTE)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
+#define GAMMA( _def_cVal, _def_InvGamma ) ((sal_uInt8)MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0L,255L))
// --------------------------
// - Color exchange structs -
@@ -70,9 +70,9 @@ using namespace com::sun::star;
struct ImplColAdjustParam
{
- BYTE* pMapR;
- BYTE* pMapG;
- BYTE* pMapB;
+ sal_uInt8* pMapR;
+ sal_uInt8* pMapG;
+ sal_uInt8* pMapB;
};
struct ImplBmpAdjustParam
@@ -83,7 +83,7 @@ struct ImplBmpAdjustParam
short nChannelGPercent;
short nChannelBPercent;
double fGamma;
- BOOL bInvert;
+ sal_Bool bInvert;
};
// -----------------------------------------------------------------------------
@@ -114,22 +114,22 @@ struct ImplBmpMonoParam
struct ImplColReplaceParam
{
- ULONG* pMinR;
- ULONG* pMaxR;
- ULONG* pMinG;
- ULONG* pMaxG;
- ULONG* pMinB;
- ULONG* pMaxB;
+ sal_uLong* pMinR;
+ sal_uLong* pMaxR;
+ sal_uLong* pMinG;
+ sal_uLong* pMaxG;
+ sal_uLong* pMinB;
+ sal_uLong* pMaxB;
const Color* pDstCols;
- ULONG nCount;
+ sal_uLong nCount;
};
struct ImplBmpReplaceParam
{
const Color* pSrcCols;
const Color* pDstCols;
- ULONG nCount;
- const ULONG* pTols;
+ sal_uLong nCount;
+ const sal_uLong* pTols;
};
@@ -140,9 +140,9 @@ struct ImplBmpReplaceParam
struct ImpLabel
{
String aLabelName;
- ULONG nActionPos;
+ sal_uLong nActionPos;
- ImpLabel( const String& rLabelName, ULONG _nActionPos ) :
+ ImpLabel( const String& rLabelName, sal_uLong _nActionPos ) :
aLabelName( rLabelName ),
nActionPos( _nActionPos ) {}
};
@@ -160,13 +160,13 @@ public:
~ImpLabelList();
void ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); }
- ImpLabel* ImplRemove( ULONG nPos ) { return (ImpLabel*) Remove( nPos ); }
+ ImpLabel* ImplRemove( sal_uLong nPos ) { return (ImpLabel*) Remove( nPos ); }
void ImplReplace( ImpLabel* p ) { Replace( (void*)p ); }
ImpLabel* ImplFirst() { return (ImpLabel*) First(); }
ImpLabel* ImplNext() { return (ImpLabel*) Next(); }
- ImpLabel* ImplGetLabel( ULONG nPos ) const { return (ImpLabel*) GetObject( nPos ); }
- ULONG ImplGetLabelPos( const String& rLabelName );
- ULONG ImplCount() const { return Count(); }
+ ImpLabel* ImplGetLabel( sal_uLong nPos ) const { return (ImpLabel*) GetObject( nPos ); }
+ sal_uLong ImplGetLabelPos( const String& rLabelName );
+ sal_uLong ImplCount() const { return Count(); }
};
// ------------------------------------------------------------------------
@@ -188,9 +188,9 @@ ImpLabelList::~ImpLabelList()
// ------------------------------------------------------------------------
-ULONG ImpLabelList::ImplGetLabelPos( const String& rLabelName )
+sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName )
{
- ULONG nLabelPos = METAFILE_LABEL_NOTFOUND;
+ sal_uLong nLabelPos = METAFILE_LABEL_NOTFOUND;
for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
{
@@ -215,9 +215,9 @@ GDIMetaFile::GDIMetaFile() :
pNext ( NULL ),
pOutDev ( NULL ),
pLabelList ( NULL ),
- bPause ( FALSE ),
- bRecord ( FALSE ),
- bUseCanvas ( FALSE )
+ bPause ( sal_False ),
+ bRecord ( sal_False ),
+ bUseCanvas ( sal_False )
{
}
@@ -231,8 +231,8 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
pPrev ( rMtf.pPrev ),
pNext ( rMtf.pNext ),
pOutDev ( NULL ),
- bPause ( FALSE ),
- bRecord ( FALSE ),
+ bPause ( sal_False ),
+ bRecord ( sal_False ),
bUseCanvas ( rMtf.bUseCanvas )
{
// RefCount der MetaActions erhoehen
@@ -249,7 +249,7 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
Record( rMtf.pOutDev );
if ( rMtf.bPause )
- Pause( TRUE );
+ Pause( sal_True );
}
}
@@ -285,8 +285,8 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
pPrev = rMtf.pPrev;
pNext = rMtf.pNext;
pOutDev = NULL;
- bPause = FALSE;
- bRecord = FALSE;
+ bPause = sal_False;
+ bRecord = sal_False;
bUseCanvas = rMtf.bUseCanvas;
if( rMtf.bRecord )
@@ -294,7 +294,7 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
Record( rMtf.pOutDev );
if( rMtf.bPause )
- Pause( TRUE );
+ Pause( sal_True );
}
}
@@ -303,24 +303,24 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
+sal_Bool GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
{
- const ULONG nObjCount = Count();
- BOOL bRet = FALSE;
+ const sal_uLong nObjCount = Count();
+ sal_Bool bRet = sal_False;
if( this == &rMtf )
- bRet = TRUE;
+ bRet = sal_True;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0UL; n < nObjCount; n++ )
+ for( sal_uLong n = 0UL; n < nObjCount; n++ )
{
if( GetObject( n ) != rMtf.GetObject( n ) )
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -333,22 +333,22 @@ BOOL GDIMetaFile::operator==( const GDIMetaFile& rMtf ) const
sal_Bool GDIMetaFile::IsEqual( const GDIMetaFile& rMtf ) const
{
- const ULONG nObjCount = Count();
- BOOL bRet = FALSE;
+ const sal_uLong nObjCount = Count();
+ sal_Bool bRet = sal_False;
if( this == &rMtf )
- bRet = TRUE;
+ bRet = sal_True;
else if( rMtf.GetActionCount() == nObjCount &&
rMtf.GetPrefSize() == aPrefSize &&
rMtf.GetPrefMapMode() == aPrefMapMode )
{
- bRet = TRUE;
+ bRet = sal_True;
- for( ULONG n = 0UL; n < nObjCount; n++ )
+ for( sal_uLong n = 0UL; n < nObjCount; n++ )
{
if(!((MetaAction*)GetObject( n ))->IsEqual(*((MetaAction*)rMtf.GetObject( n ))))
{
- bRet = FALSE;
+ bRet = sal_False;
break;
}
}
@@ -375,7 +375,7 @@ void GDIMetaFile::Clear()
// ------------------------------------------------------------------------
-void GDIMetaFile::Linker( OutputDevice* pOut, BOOL bLink )
+void GDIMetaFile::Linker( OutputDevice* pOut, sal_Bool bLink )
{
if( bLink )
{
@@ -424,25 +424,25 @@ void GDIMetaFile::Record( OutputDevice* pOut )
Last();
pOutDev = pOut;
- bRecord = TRUE;
- Linker( pOut, TRUE );
+ bRecord = sal_True;
+ Linker( pOut, sal_True );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
+void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos )
{
if ( !bRecord && !rMtf.bRecord )
{
MetaAction* pAction = GetCurAction();
- const ULONG nObjCount = Count();
+ const sal_uLong nObjCount = Count();
rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
if( nPos > nObjCount )
nPos = nObjCount;
- for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -457,13 +457,13 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
// ------------------------------------------------------------------------
-void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos )
+void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
{
if( !bRecord )
{
MetaAction* pAction = GetCurAction();
- const ULONG nObjCount = Count();
- ULONG i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
+ const sal_uLong nObjCount = Count();
+ sal_uLong i = 0, nSyncCount = ( pOut->GetOutDevType() == OUTDEV_WINDOW ) ? 0x000000ff : 0xffffffff;
if( nPos > nObjCount )
nPos = nObjCount;
@@ -476,7 +476,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, ULONG nPos )
pOut->SetLayoutMode( 0 );
pOut->SetDigitLanguage( 0 );
- for( ULONG nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
+ for( sal_uLong nCurPos = GetCurPos(); nCurPos < nPos; nCurPos++ )
{
if( !Hook() )
{
@@ -587,8 +587,8 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") );
// read payload - string of service name, followed by raw render input
- const BYTE* pData = pAct->GetData();
- const BYTE* const pEndData = pData + pAct->GetDataSize();
+ const sal_uInt8* pData = pAct->GetData();
+ const sal_uInt8* const pEndData = pData + pAct->GetDataSize();
if( !pData )
return;
@@ -654,7 +654,7 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
// ------------------------------------------------------------------------
void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
- const Size& rSize, ULONG nPos )
+ const Size& rSize, sal_uLong nPos )
{
Region aDrawClipRegion;
MapMode aDrawMap( GetPrefMapMode() );
@@ -719,19 +719,19 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
// ------------------------------------------------------------------------
-void GDIMetaFile::Pause( BOOL _bPause )
+void GDIMetaFile::Pause( sal_Bool _bPause )
{
if( bRecord )
{
if( _bPause )
{
if( !bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
}
else
{
if( bPause )
- Linker( pOutDev, TRUE );
+ Linker( pOutDev, sal_True );
}
bPause = _bPause;
@@ -744,12 +744,12 @@ void GDIMetaFile::Stop()
{
if( bRecord )
{
- bRecord = FALSE;
+ bRecord = sal_False;
if( !bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
else
- bPause = FALSE;
+ bPause = sal_False;
}
}
@@ -771,7 +771,7 @@ void GDIMetaFile::WindEnd()
// ------------------------------------------------------------------------
-void GDIMetaFile::Wind( ULONG nActionPos )
+void GDIMetaFile::Wind( sal_uLong nActionPos )
{
if( !bRecord )
Seek( nActionPos );
@@ -808,7 +808,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction )
// ------------------------------------------------------------------------
-void GDIMetaFile::AddAction( MetaAction* pAction, ULONG nPos )
+void GDIMetaFile::AddAction( MetaAction* pAction, sal_uLong nPos )
{
Insert( pAction, nPos );
@@ -822,7 +822,7 @@ void GDIMetaFile::AddAction( MetaAction* pAction, ULONG nPos )
// ------------------------------------------------------------------------
// @since #110496#
-void GDIMetaFile::RemoveAction( ULONG nPos )
+void GDIMetaFile::RemoveAction( sal_uLong nPos )
{
Remove( nPos );
@@ -832,14 +832,14 @@ void GDIMetaFile::RemoveAction( ULONG nPos )
// ------------------------------------------------------------------------
-MetaAction* GDIMetaFile::CopyAction( ULONG nPos ) const
+MetaAction* GDIMetaFile::CopyAction( sal_uLong nPos ) const
{
return ( (MetaAction*) GetObject( nPos ) )->Clone();
}
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetActionPos( const String& rLabel )
+sal_uLong GDIMetaFile::GetActionPos( const String& rLabel )
{
ImpLabel* pLabel = NULL;
@@ -853,9 +853,9 @@ ULONG GDIMetaFile::GetActionPos( const String& rLabel )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::InsertLabel( const String& rLabel, ULONG nActionPos )
+sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !pLabelList )
pLabelList = new ImpLabelList;
@@ -863,7 +863,7 @@ BOOL GDIMetaFile::InsertLabel( const String& rLabel, ULONG nActionPos )
if( pLabelList->ImplGetLabelPos( rLabel ) == METAFILE_LABEL_NOTFOUND )
{
pLabelList->ImplInsert( new ImpLabel( rLabel, nActionPos ) );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -875,7 +875,7 @@ void GDIMetaFile::RemoveLabel( const String& rLabel )
{
if( pLabelList )
{
- const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if( nLabelPos != METAFILE_LABEL_NOTFOUND )
delete pLabelList->ImplRemove( nLabelPos );
@@ -888,7 +888,7 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
{
if( pLabelList )
{
- const ULONG nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
+ const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
if ( nLabelPos != METAFILE_LABEL_NOTFOUND )
pLabelList->ImplGetLabel( nLabelPos )->aLabelName = rNewLabel;
@@ -897,14 +897,14 @@ void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetLabelCount() const
+sal_uLong GDIMetaFile::GetLabelCount() const
{
return( pLabelList ? pLabelList->ImplCount() : 0UL );
}
// ------------------------------------------------------------------------
-String GDIMetaFile::GetLabel( ULONG nLabel )
+String GDIMetaFile::GetLabel( sal_uLong nLabel )
{
String aString;
@@ -921,12 +921,12 @@ String GDIMetaFile::GetLabel( ULONG nLabel )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::SaveStatus()
+sal_Bool GDIMetaFile::SaveStatus()
{
if ( bRecord )
{
if ( bPause )
- Linker( pOutDev, TRUE );
+ Linker( pOutDev, sal_True );
AddAction( new MetaLineColorAction( pOutDev->GetLineColor(),
pOutDev->IsLineColor() ) );
@@ -947,22 +947,22 @@ BOOL GDIMetaFile::SaveStatus()
pOutDev->IsClipRegion() ) );
if ( bPause )
- Linker( pOutDev, FALSE );
+ Linker( pOutDev, sal_False );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::Mirror( ULONG nMirrorFlags )
+sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
{
const Size aOldPrefSize( GetPrefSize() );
long nMoveX, nMoveY;
double fScaleX, fScaleY;
- BOOL bRet;
+ sal_Bool bRet;
if( nMirrorFlags & MTF_MIRROR_HORZ )
nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
@@ -979,10 +979,10 @@ BOOL GDIMetaFile::Mirror( ULONG nMirrorFlags )
Scale( fScaleX, fScaleY );
Move( nMoveX, nMoveY );
SetPrefSize( aOldPrefSize );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -995,7 +995,7 @@ void GDIMetaFile::Move( long nX, long nY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
@@ -1029,7 +1029,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY )
Size aOffset( aBaseOffset );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetReferenceDevice( nDPIX, nDPIY );
aMapVDev.SetMapMode( GetPrefMapMode() );
@@ -1103,7 +1103,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
Rectangle aCurRect( i_rClipRect );
VirtualDevice aMapVDev;
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
@@ -1123,7 +1123,7 @@ void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
Region aNewReg( aCurRect );
if( pOldAct->IsClipping() )
aNewReg.Intersect( pOldAct->GetRegion() );
- MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, TRUE );
+ MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, sal_True );
Replace( pNewAct, GetCurPos() );
pOldAct->Delete();
}
@@ -1178,7 +1178,7 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf,
// #105055# Generate comment, GradientEx and Gradient actions
// (within DrawGradient)
VirtualDevice aVDev( rMapDev, 0 );
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
GDIMetaFile aGradMtf;
aGradMtf.Record( &aVDev );
@@ -1213,7 +1213,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aPoly.Rotate( Point(), fSin, fCos );
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
const Rectangle aNewBound( aPoly.GetBoundRect() );
@@ -1226,7 +1226,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nActionType = pAction->GetType();
+ const sal_uInt16 nActionType = pAction->GetType();
switch( nActionType )
{
@@ -1443,7 +1443,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
// skip everything, except gradientex action
while( pAction )
{
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
if( META_GRADIENTEX_ACTION == nType )
{
@@ -1494,7 +1494,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aStroke.setPath( ImplGetRotatedPolygon( aPath, aRotAnchor, aRotOffset, fSin, fCos ) );
aDest << aStroke;
aMtf.AddAction( new MetaCommentAction( "XPATHSTROKE_SEQ_BEGIN", 0,
- static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
}
else
{
@@ -1505,7 +1505,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
aFill.setPath( ImplGetRotatedPolyPolygon( aPath, aRotAnchor, aRotOffset, fSin, fCos ) );
aDest << aFill;
aMtf.AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0,
- static_cast<const BYTE*>( aDest.GetData()), aDest.Tell() ) );
+ static_cast<const sal_uInt8*>( aDest.GetData()), aDest.Tell() ) );
}
}
}
@@ -1525,7 +1525,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaHatchAction* pAct = (MetaHatchAction*) pAction;
Hatch aHatch( pAct->GetHatch() );
- aHatch.SetAngle( aHatch.GetAngle() + (USHORT) nAngle10 );
+ aHatch.SetAngle( aHatch.GetAngle() + (sal_uInt16) nAngle10 );
aMtf.AddAction( new MetaHatchAction( ImplGetRotatedPolyPolygon( pAct->GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ),
aHatch ) );
}
@@ -1570,7 +1570,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
if( pAct->IsClipping() && pAct->GetRegion().HasPolyPolygon() )
- aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), TRUE ) );
+ aMtf.AddAction( new MetaClipRegionAction( Region( ImplGetRotatedPolyPolygon( pAct->GetRegion().GetPolyPolygon(), aRotAnchor, aRotOffset, fSin, fCos ) ), sal_True ) );
else
{
pAction->Duplicate();
@@ -1613,7 +1613,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
MetaFontAction* pAct = (MetaFontAction*) pAction;
Font aFont( pAct->GetFont() );
- aFont.SetOrientation( aFont.GetOrientation() + (USHORT) nAngle10 );
+ aFont.SetOrientation( aFont.GetOrientation() + (sal_uInt16) nAngle10 );
aMtf.AddAction( new MetaFontAction( aFont ) );
}
break;
@@ -1680,17 +1680,17 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
GDIMetaFile aMtf;
VirtualDevice aMapVDev( i_rReference );
- aMapVDev.EnableOutput( FALSE );
+ aMapVDev.EnableOutput( sal_False );
aMapVDev.SetMapMode( GetPrefMapMode() );
std::vector<Rectangle> aClipStack( 1, Rectangle() );
- std::vector<USHORT> aPushFlagStack;
+ std::vector<sal_uInt16> aPushFlagStack;
Rectangle aBound;
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nActionType = pAction->GetType();
+ const sal_uInt16 nActionType = pAction->GetType();
switch( nActionType )
{
@@ -2116,7 +2116,7 @@ BitmapEx GDIMetaFile::ImplBmpAdjustFnc( const BitmapEx& rBmpEx, const void* pBmp
Color GDIMetaFile::ImplColConvertFnc( const Color& rColor, const void* pColParam )
{
- BYTE cLum = rColor.GetLuminance();
+ sal_uInt8 cLum = rColor.GetLuminance();
if( MTF_CONVERSION_1BIT_THRESHOLD == ( (const ImplColConvertParam*) pColParam )->eConversion )
cLum = ( cLum < 128 ) ? 0 : 255;
@@ -2167,9 +2167,9 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa
Color GDIMetaFile::ImplColReplaceFnc( const Color& rColor, const void* pColParam )
{
- const ULONG nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
+ const sal_uLong nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
- for( ULONG i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
+ for( sal_uLong i = 0; i < ( (const ImplColReplaceParam*) pColParam )->nCount; i++ )
{
if( ( ( (const ImplColReplaceParam*) pColParam )->pMinR[ i ] <= nR ) &&
( ( (const ImplColReplaceParam*) pColParam )->pMaxR[ i ] >= nR ) &&
@@ -2209,7 +2209,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
for( MetaAction* pAction = (MetaAction*) First(); pAction; pAction = (MetaAction*) Next() )
{
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -2227,7 +2227,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2240,7 +2240,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2260,7 +2260,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaTextFillColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2273,7 +2273,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaTextLineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2286,7 +2286,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
if( !pAct->IsSetting() )
pAct->Duplicate();
else
- pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), TRUE );
+ pAct = new MetaOverlineColorAction( pFncCol( pAct->GetColor(), pColParam ), sal_True );
aMtf.Insert( pAct, LIST_APPEND );
}
@@ -2467,7 +2467,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
short nChannelRPercent, short nChannelGPercent,
- short nChannelBPercent, double fGamma, BOOL bInvert )
+ short nChannelBPercent, double fGamma, sal_Bool bInvert )
{
// nothing to do? => return quickly
if( nLuminancePercent || nContrastPercent ||
@@ -2478,9 +2478,9 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
ImplColAdjustParam aColParam;
ImplBmpAdjustParam aBmpParam;
- aColParam.pMapR = new BYTE[ 256 ];
- aColParam.pMapG = new BYTE[ 256 ];
- aColParam.pMapB = new BYTE[ 256 ];
+ aColParam.pMapR = new sal_uInt8[ 256 ];
+ aColParam.pMapG = new sal_uInt8[ 256 ];
+ aColParam.pMapB = new sal_uInt8[ 256 ];
// calculate slope
if( nContrastPercent >= 0 )
@@ -2498,14 +2498,14 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
// calculate gamma value
fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
- const BOOL bGamma = ( fGamma != 1.0 );
+ const sal_Bool bGamma = ( fGamma != 1.0 );
// create mapping table
for( long nX = 0L; nX < 256L; nX++ )
{
- aColParam.pMapR[ nX ] = (BYTE) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
- aColParam.pMapG[ nX ] = (BYTE) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
- aColParam.pMapB[ nX ] = (BYTE) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
+ aColParam.pMapR[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fROff ), 0L, 255L );
+ aColParam.pMapG[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fGOff ), 0L, 255L );
+ aColParam.pMapB[ nX ] = (sal_uInt8) MinMax( FRound( nX * fM + fBOff ), 0L, 255L );
if( bGamma )
{
@@ -2558,41 +2558,41 @@ void GDIMetaFile::Convert( MtfConversion eConversion )
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, ULONG nTol )
+void GDIMetaFile::ReplaceColors( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
{
ReplaceColors( &rSearchColor, &rReplaceColor, 1, &nTol );
}
// ------------------------------------------------------------------------
-void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, ULONG nColorCount, ULONG* pTols )
+void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, sal_uLong* pTols )
{
ImplColReplaceParam aColParam;
ImplBmpReplaceParam aBmpParam;
- aColParam.pMinR = new ULONG[ nColorCount ];
- aColParam.pMaxR = new ULONG[ nColorCount ];
- aColParam.pMinG = new ULONG[ nColorCount ];
- aColParam.pMaxG = new ULONG[ nColorCount ];
- aColParam.pMinB = new ULONG[ nColorCount ];
- aColParam.pMaxB = new ULONG[ nColorCount ];
+ aColParam.pMinR = new sal_uLong[ nColorCount ];
+ aColParam.pMaxR = new sal_uLong[ nColorCount ];
+ aColParam.pMinG = new sal_uLong[ nColorCount ];
+ aColParam.pMaxG = new sal_uLong[ nColorCount ];
+ aColParam.pMinB = new sal_uLong[ nColorCount ];
+ aColParam.pMaxB = new sal_uLong[ nColorCount ];
- for( ULONG i = 0; i < nColorCount; i++ )
+ for( sal_uLong i = 0; i < nColorCount; i++ )
{
const long nTol = pTols ? ( pTols[ i ] * 255 ) / 100 : 0;
long nVal;
nVal = pSearchColors[ i ].GetRed();
- aColParam.pMinR[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxR[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinR[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxR[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetGreen();
- aColParam.pMinG[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxG[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinG[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxG[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
nVal = pSearchColors[ i ].GetBlue();
- aColParam.pMinB[ i ] = (ULONG) Max( nVal - nTol, 0L );
- aColParam.pMaxB[ i ] = (ULONG) Min( nVal + nTol, 255L );
+ aColParam.pMinB[ i ] = (sal_uLong) Max( nVal - nTol, 0L );
+ aColParam.pMaxB[ i ] = (sal_uLong) Min( nVal + nTol, 255L );
}
aColParam.pDstCols = pReplaceColors;
@@ -2632,16 +2632,16 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetChecksum() const
+sal_uLong GDIMetaFile::GetChecksum() const
{
GDIMetaFile aMtf;
SvMemoryStream aMemStm( 65535, 65535 );
ImplMetaWriteData aWriteData; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
SVBT16 aBT16;
SVBT32 aBT32;
- ULONG nCrc = 0;
+ sal_uLong nCrc = 0;
- for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
+ for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
{
MetaAction* pAction = GetAction( i );
@@ -2912,11 +2912,11 @@ ULONG GDIMetaFile::GetChecksum() const
// ------------------------------------------------------------------------
-ULONG GDIMetaFile::GetSizeBytes() const
+sal_uLong GDIMetaFile::GetSizeBytes() const
{
- ULONG nSizeBytes = 0;
+ sal_uLong nSizeBytes = 0;
- for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
+ for( sal_uLong i = 0, nObjCount = GetActionCount(); i < nObjCount; ++i )
{
MetaAction* pAction = GetAction( i );
@@ -2944,7 +2944,7 @@ ULONG GDIMetaFile::GetSizeBytes() const
{
const PolyPolygon& rPolyPoly = ( (MetaPolyPolygonAction*) pAction )->GetPolyPolygon();
- for( USHORT n = 0; n < rPolyPoly.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rPolyPoly.Count(); ++n )
nSizeBytes += ( rPolyPoly[ n ].GetSize() * sizeof( Point ) );
}
break;
@@ -2978,8 +2978,8 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
if( !rIStm.GetError() )
{
char aId[ 7 ];
- ULONG nStmPos = rIStm.Tell();
- USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uLong nStmPos = rIStm.Tell();
+ sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -2992,8 +2992,8 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
// new format
VersionCompat* pCompat;
MetaAction* pAction;
- UINT32 nStmCompressMode = 0;
- UINT32 nCount = 0;
+ sal_uInt32 nStmCompressMode = 0;
+ sal_uInt32 nCount = 0;
pCompat = new VersionCompat( rIStm, STREAM_READ );
@@ -3007,7 +3007,7 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
ImplMetaReadData aReadData;
aReadData.meActualCharSet = rIStm.GetStreamCharSet();
- for( UINT32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
+ for( sal_uInt32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
{
pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
@@ -3065,8 +3065,8 @@ SvStream& GDIMetaFile::Read( SvStream& rIStm )
SvStream& GDIMetaFile::Write( SvStream& rOStm )
{
VersionCompat* pCompat;
- const UINT32 nStmCompressMode = rOStm.GetCompressMode();
- USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt32 nStmCompressMode = rOStm.GetCompressMode();
+ sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rOStm.Write( "VCLMTF", 6 );
@@ -3076,7 +3076,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
rOStm << nStmCompressMode;
rOStm << aPrefMapMode;
rOStm << aPrefSize;
- rOStm << (UINT32) GetActionCount();
+ rOStm << (sal_uInt32) GetActionCount();
delete pCompat;
@@ -3097,7 +3097,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
// ------------------------------------------------------------------------
-BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
+sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
BitmapEx& rBmpEx,
const BitmapEx* pOverlay,
const Rectangle* pOverlayRect ) const
@@ -3214,7 +3214,7 @@ BOOL GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
return !rBmpEx.IsEmpty();
}
-void GDIMetaFile::UseCanvas( BOOL _bUseCanvas )
+void GDIMetaFile::UseCanvas( sal_Bool _bUseCanvas )
{
bUseCanvas = _bUseCanvas;
}
@@ -3226,7 +3226,7 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe
const void* _pData,
sal_uInt32 nDataSize )
{
- const BYTE* pData=(BYTE*)_pData;
+ const sal_uInt8* pData=(sal_uInt8*)_pData;
// data gets copied twice, unfortunately
rtl::OString aRendererServiceName(
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 3a5b48ad2a0d..29b6a62253a6 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -65,7 +65,7 @@ GfxLink::GfxLink( const GfxLink& rGfxLink ) :
// ------------------------------------------------------------------------
-GfxLink::GfxLink( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns ) :
+GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, sal_Bool bOwns ) :
mpImpData( new ImpGfxLink )
{
DBG_ASSERT( (pBuf != NULL && nSize) || (!bOwns && nSize == 0),
@@ -167,7 +167,7 @@ GfxLinkType GfxLink::GetType() const
// ------------------------------------------------------------------------
-BOOL GfxLink::IsNative() const
+sal_Bool GfxLink::IsNative() const
{
return( meType >= GFX_LINK_FIRST_NATIVE_ID && meType <= GFX_LINK_LAST_NATIVE_ID );
}
@@ -181,7 +181,7 @@ sal_uInt32 GfxLink::GetDataSize() const
// ------------------------------------------------------------------------
-const BYTE* GfxLink::GetData() const
+const sal_uInt8* GfxLink::GetData() const
{
if( IsSwappedOut() )
( (GfxLink*) this )->SwapIn();
@@ -235,20 +235,20 @@ bool GfxLink::IsPrefMapModeValid()
// ------------------------------------------------------------------------
-BOOL GfxLink::LoadNative( Graphic& rGraphic )
+sal_Bool GfxLink::LoadNative( Graphic& rGraphic )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( IsNative() && mnBufSize )
{
- const BYTE* pData = GetData();
+ const sal_uInt8* pData = GetData();
if( pData )
{
SvMemoryStream aMemStm;
- ULONG nCvtType;
+ sal_uLong nCvtType;
- aMemStm.SetBuffer( (char*) pData, mnBufSize, FALSE, mnBufSize );
+ aMemStm.SetBuffer( (char*) pData, mnBufSize, sal_False, mnBufSize );
switch( meType )
{
@@ -264,7 +264,7 @@ BOOL GfxLink::LoadNative( Graphic& rGraphic )
}
if( nCvtType && ( GraphicConverter::Import( aMemStm, rGraphic, nCvtType ) == ERRCODE_NONE ) )
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -311,7 +311,7 @@ void GfxLink::SwapIn()
// ------------------------------------------------------------------------
-BOOL GfxLink::ExportNative( SvStream& rOStream ) const
+sal_Bool GfxLink::ExportNative( SvStream& rOStream ) const
{
if( GetDataSize() )
{
@@ -331,7 +331,7 @@ SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink )
VersionCompat* pCompat = new VersionCompat( rOStream, STREAM_WRITE, 2 );
// Version 1
- rOStream << (UINT16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
+ rOStream << (sal_uInt16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId();
// Version 2
rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode();
@@ -357,8 +357,8 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
MapMode aMapMode;
sal_uInt32 nSize;
sal_uInt32 nUserId;
- UINT16 nType;
- BYTE* pBuf;
+ sal_uInt16 nType;
+ sal_uInt8* pBuf;
bool bMapAndSizeValid( false );
VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ );
@@ -373,10 +373,10 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
delete pCompat;
- pBuf = new BYTE[ nSize ];
+ pBuf = new sal_uInt8[ nSize ];
rIStream.Read( pBuf, nSize );
- rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, TRUE );
+ rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, sal_True );
rGfxLink.SetUserId( nUserId );
if( bMapAndSizeValid )
@@ -392,7 +392,7 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink)
// - ImpSwap -
// -----------
-ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
+ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
mnDataSize( nDataSize ),
mnRefCount( 1UL )
{
@@ -430,16 +430,16 @@ ImpSwap::~ImpSwap()
// ------------------------------------------------------------------------
-BYTE* ImpSwap::GetData() const
+sal_uInt8* ImpSwap::GetData() const
{
- BYTE* pData;
+ sal_uInt8* pData;
if( IsSwapped() )
{
SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
- pData = new BYTE[ mnDataSize ];
+ pData = new sal_uInt8[ mnDataSize ];
pIStm->Read( pData, mnDataSize );
sal_Bool bError = ( ERRCODE_NONE != pIStm->GetError() );
delete pIStm;
@@ -460,7 +460,7 @@ BYTE* ImpSwap::GetData() const
void ImpSwap::WriteTo( SvStream& rOStm ) const
{
- BYTE* pData = GetData();
+ sal_uInt8* pData = GetData();
if( pData )
{
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index 9c0d8ee07043..38d8ba4567a2 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -175,7 +175,7 @@ void Gradient::SetEndColor( const Color& rColor )
// -----------------------------------------------------------------------
-void Gradient::SetAngle( USHORT nAngle )
+void Gradient::SetAngle( sal_uInt16 nAngle )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -185,7 +185,7 @@ void Gradient::SetAngle( USHORT nAngle )
// -----------------------------------------------------------------------
-void Gradient::SetBorder( USHORT nBorder )
+void Gradient::SetBorder( sal_uInt16 nBorder )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -195,7 +195,7 @@ void Gradient::SetBorder( USHORT nBorder )
// -----------------------------------------------------------------------
-void Gradient::SetOfsX( USHORT nOfsX )
+void Gradient::SetOfsX( sal_uInt16 nOfsX )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -205,7 +205,7 @@ void Gradient::SetOfsX( USHORT nOfsX )
// -----------------------------------------------------------------------
-void Gradient::SetOfsY( USHORT nOfsY )
+void Gradient::SetOfsY( sal_uInt16 nOfsY )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -215,7 +215,7 @@ void Gradient::SetOfsY( USHORT nOfsY )
// -----------------------------------------------------------------------
-void Gradient::SetStartIntensity( USHORT nIntens )
+void Gradient::SetStartIntensity( sal_uInt16 nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -225,7 +225,7 @@ void Gradient::SetStartIntensity( USHORT nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetEndIntensity( USHORT nIntens )
+void Gradient::SetEndIntensity( sal_uInt16 nIntens )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -235,7 +235,7 @@ void Gradient::SetEndIntensity( USHORT nIntens )
// -----------------------------------------------------------------------
-void Gradient::SetSteps( USHORT nSteps )
+void Gradient::SetSteps( sal_uInt16 nSteps )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -248,7 +248,7 @@ void Gradient::SetSteps( USHORT nSteps )
void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Point& rCenter ) const
{
Rectangle aRect( rRect );
- USHORT nAngle = GetAngle() % 3600;
+ sal_uInt16 nAngle = GetAngle() % 3600;
if( GetStyle() == GRADIENT_LINEAR || GetStyle() == GRADIENT_AXIAL )
{
@@ -359,13 +359,13 @@ Gradient& Gradient::operator=( const Gradient& rGradient )
// -----------------------------------------------------------------------
-BOOL Gradient::operator==( const Gradient& rGradient ) const
+sal_Bool Gradient::operator==( const Gradient& rGradient ) const
{
DBG_CHKTHIS( Gradient, NULL );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
if ( mpImplGradient == rGradient.mpImplGradient )
- return TRUE;
+ return sal_True;
if ( (mpImplGradient->meStyle == rGradient.mpImplGradient->meStyle) ||
(mpImplGradient->mnAngle == rGradient.mpImplGradient->mnAngle) ||
@@ -377,15 +377,15 @@ BOOL Gradient::operator==( const Gradient& rGradient ) const
(mpImplGradient->mnIntensityEnd == rGradient.mpImplGradient->mnIntensityEnd) ||
(mpImplGradient->maStartColor == rGradient.mpImplGradient->maStartColor) ||
(mpImplGradient->maEndColor == rGradient.mpImplGradient->maEndColor) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
SvStream& operator>>( SvStream& rIStm, Impl_Gradient& rImpl_Gradient )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImpl_Gradient.meStyle = (GradientStyle) nTmp16;
@@ -408,7 +408,7 @@ SvStream& operator<<( SvStream& rOStm, const Impl_Gradient& rImpl_Gradient )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImpl_Gradient.meStyle <<
+ rOStm << (sal_uInt16) rImpl_Gradient.meStyle <<
rImpl_Gradient.maStartColor <<
rImpl_Gradient.maEndColor <<
rImpl_Gradient.mnAngle <<
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index e6bb0b1e3e8a..f61bbf8dc041 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -60,11 +60,11 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
Font* pFont, const Bitmap* pBitmap, const BitmapEx* pBitmapEx,
const Point& rDestPt, const Size& rDestSize )
{
- USHORT nPixel = (USHORT) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
- USHORT nPixelWidth = nPixel;
+ sal_uInt16 nPixel = (sal_uInt16) pOutDev->PixelToLogic( Size( 1, 1 ) ).Width();
+ sal_uInt16 nPixelWidth = nPixel;
Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
- BOOL bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
+ sal_Bool bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
Rectangle aBorderRect( aPoint, aSize );
pOutDev->Push();
@@ -139,8 +139,8 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
{
- USHORT nStart = 0;
- USHORT nLen = 0;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nLen = 0;
while( nStart < pText->Len() && pText->GetChar( nStart ) == ' ' )
nStart++;
@@ -148,7 +148,7 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
nLen++;
while( nStart < pText->Len() && nLines-- )
{
- USHORT nNext = nLen;
+ sal_uInt16 nNext = nLen;
do
{
while ( nStart+nNext < pText->Len() && pText->GetChar( nStart+nNext ) == ' ' )
@@ -162,14 +162,14 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
}
while ( nStart+nNext < pText->Len() );
- USHORT n = nLen;
+ sal_uInt16 n = nLen;
nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
while( nTextWidth > aSize.Width() )
nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
pOutDev->DrawText( aPoint, *pText, nStart, n );
aPoint.Y() += nTextHeight;
- nStart = sal::static_int_cast<USHORT>(nStart + nLen);
+ nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
nLen = nNext-nLen;
while( nStart < pText->Len() && pText->GetChar( nStart ) == ' ' )
{
@@ -335,21 +335,21 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
// ------------------------------------------------------------------------
-BOOL Graphic::operator==( const Graphic& rGraphic ) const
+sal_Bool Graphic::operator==( const Graphic& rGraphic ) const
{
return( *mpImpGraphic == *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-BOOL Graphic::operator!=( const Graphic& rGraphic ) const
+sal_Bool Graphic::operator!=( const Graphic& rGraphic ) const
{
return( *mpImpGraphic != *rGraphic.mpImpGraphic );
}
// ------------------------------------------------------------------------
-BOOL Graphic::operator!() const
+sal_Bool Graphic::operator!() const
{
return( GRAPHIC_NONE == mpImpGraphic->ImplGetType() );
}
@@ -400,28 +400,28 @@ void Graphic::SetDefaultType()
// ------------------------------------------------------------------------
-BOOL Graphic::IsSupportedGraphic() const
+sal_Bool Graphic::IsSupportedGraphic() const
{
return mpImpGraphic->ImplIsSupportedGraphic();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsTransparent() const
+sal_Bool Graphic::IsTransparent() const
{
return mpImpGraphic->ImplIsTransparent();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsAlpha() const
+sal_Bool Graphic::IsAlpha() const
{
return mpImpGraphic->ImplIsAlpha();
}
// ------------------------------------------------------------------------
-BOOL Graphic::IsAnimated() const
+sal_Bool Graphic::IsAnimated() const
{
return mpImpGraphic->ImplIsAnimated();
}
@@ -532,7 +532,7 @@ Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
// ------------------------------------------------------------------
-ULONG Graphic::GetSizeBytes() const
+sal_uLong Graphic::GetSizeBytes() const
{
return mpImpGraphic->ImplGetSizeBytes();
}
@@ -616,7 +616,7 @@ Link Graphic::GetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-ULONG Graphic::GetAnimationLoopCount() const
+sal_uLong Graphic::GetAnimationLoopCount() const
{
return mpImpGraphic->ImplGetAnimationLoopCount();
}
@@ -651,20 +651,20 @@ void Graphic::SetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-USHORT Graphic::GetGraphicsCompressMode( SvStream& rIStm )
+sal_uInt16 Graphic::GetGraphicsCompressMode( SvStream& rIStm )
{
- const ULONG nPos = rIStm.Tell();
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- UINT32 nTmp32;
- UINT16 nTmp16;
- USHORT nCompressMode = COMPRESSMODE_NONE;
+ const sal_uLong nPos = rIStm.Tell();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_uInt32 nTmp32;
+ sal_uInt16 nTmp16;
+ sal_uInt16 nCompressMode = COMPRESSMODE_NONE;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
rIStm >> nTmp32;
// is it a swapped graphic with a bitmap?
- rIStm.SeekRel( (nTmp32 == (UINT32) GRAPHIC_BITMAP ) ? 40 : -4 );
+ rIStm.SeekRel( (nTmp32 == (sal_uInt32) GRAPHIC_BITMAP ) ? 40 : -4 );
// try to read bitmap id
rIStm >> nTmp16;
@@ -689,7 +689,7 @@ USHORT Graphic::GetGraphicsCompressMode( SvStream& rIStm )
// ------------------------------------------------------------------------
-void Graphic::SetDocFileName( const String& rName, ULONG nFilePos )
+void Graphic::SetDocFileName( const String& rName, sal_uLong nFilePos )
{
mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
}
@@ -703,14 +703,14 @@ const String& Graphic::GetDocFileName() const
// ------------------------------------------------------------------------
-ULONG Graphic::GetDocFilePos() const
+sal_uLong Graphic::GetDocFilePos() const
{
return mpImpGraphic->ImplGetDocFilePos();
}
// ------------------------------------------------------------------------
-BOOL Graphic::ReadEmbedded( SvStream& rIStream, BOOL bSwap )
+sal_Bool Graphic::ReadEmbedded( SvStream& rIStream, sal_Bool bSwap )
{
ImplTestRefCount();
return mpImpGraphic->ImplReadEmbedded( rIStream, bSwap );
@@ -718,7 +718,7 @@ BOOL Graphic::ReadEmbedded( SvStream& rIStream, BOOL bSwap )
// ------------------------------------------------------------------------
-BOOL Graphic::WriteEmbedded( SvStream& rOStream )
+sal_Bool Graphic::WriteEmbedded( SvStream& rOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplWriteEmbedded( rOStream );
@@ -726,7 +726,7 @@ BOOL Graphic::WriteEmbedded( SvStream& rOStream )
// ------------------------------------------------------------------------
-BOOL Graphic::SwapOut()
+sal_Bool Graphic::SwapOut()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut();
@@ -734,7 +734,7 @@ BOOL Graphic::SwapOut()
// ------------------------------------------------------------------------
-BOOL Graphic::SwapOut( SvStream* pOStream )
+sal_Bool Graphic::SwapOut( SvStream* pOStream )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapOut( pOStream );
@@ -742,7 +742,7 @@ BOOL Graphic::SwapOut( SvStream* pOStream )
// ------------------------------------------------------------------------
-BOOL Graphic::SwapIn()
+sal_Bool Graphic::SwapIn()
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn();
@@ -750,7 +750,7 @@ BOOL Graphic::SwapIn()
// ------------------------------------------------------------------------
-BOOL Graphic::SwapIn( SvStream* pStrm )
+sal_Bool Graphic::SwapIn( SvStream* pStrm )
{
ImplTestRefCount();
return mpImpGraphic->ImplSwapIn( pStrm );
@@ -758,7 +758,7 @@ BOOL Graphic::SwapIn( SvStream* pStrm )
// ------------------------------------------------------------------------
-BOOL Graphic::IsSwapOut() const
+sal_Bool Graphic::IsSwapOut() const
{
return mpImpGraphic->ImplIsSwapOut();
}
@@ -780,21 +780,21 @@ GfxLink Graphic::GetLink() const
// ------------------------------------------------------------------------
-BOOL Graphic::IsLink() const
+sal_Bool Graphic::IsLink() const
{
return mpImpGraphic->ImplIsLink();
}
// ------------------------------------------------------------------------
-ULONG Graphic::GetChecksum() const
+sal_uLong Graphic::GetChecksum() const
{
return mpImpGraphic->ImplGetChecksum();
}
// ------------------------------------------------------------------------
-BOOL Graphic::ExportNative( SvStream& rOStream ) const
+sal_Bool Graphic::ExportNative( SvStream& rOStream ) const
{
return mpImpGraphic->ImplExportNative( rOStream );
}
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 08533663c562..2e20a3639790 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -35,7 +35,7 @@
static ::rtl::OString polyToString( const Polygon& rPoly )
{
::rtl::OString aStr;
- USHORT nVertex;
+ sal_uInt16 nVertex;
for(nVertex=0; nVertex<rPoly.GetSize(); ++nVertex)
{
aStr += "(";
@@ -67,7 +67,7 @@ static ::rtl::OString polyToString( const Polygon& rPoly )
static ::rtl::OString polyPolyToString( const PolyPolygon& rPolyPoly )
{
::rtl::OString aStr;
- USHORT nPoly;
+ sal_uInt16 nPoly;
for(nPoly=0; nPoly<rPolyPoly.Count(); ++nPoly)
{
const Polygon& rPoly = rPolyPoly[nPoly];
@@ -328,9 +328,9 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass )
rClass.maEndArrow.Write( rOStm );
rOStm << rClass.mfTransparency;
rOStm << rClass.mfStrokeWidth;
- UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maCapType );
+ sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maCapType );
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maJoinType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maJoinType );
rOStm << nTmp;
rOStm << rClass.mfMiterLimit;
@@ -351,7 +351,7 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass )
rClass.maEndArrow.Read( rIStm );
rIStm >> rClass.mfTransparency;
rIStm >> rClass.mfStrokeWidth;
- UINT16 nTmp;
+ sal_uInt16 nTmp;
rIStm >> nTmp;
rClass.maCapType = SvtGraphicStroke::CapType(nTmp);
rIStm >> nTmp;
@@ -707,19 +707,19 @@ SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass )
rClass.maPath.Write( rOStm );
rOStm << rClass.maFillColor;
rOStm << rClass.mfTransparency;
- UINT16 nTmp = sal::static_int_cast<UINT16>( rClass.maFillRule );
+ sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillRule );
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maFillType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillType );
rOStm << nTmp;
int i;
for(i=0; i<SvtGraphicFill::Transform::MatrixSize; ++i)
rOStm << rClass.maFillTransform.matrix[i];
nTmp = rClass.mbTiling;
rOStm << nTmp;
- nTmp = sal::static_int_cast<UINT16>( rClass.maHatchType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maHatchType );
rOStm << nTmp;
rOStm << rClass.maHatchColor;
- nTmp = sal::static_int_cast<UINT16>( rClass.maGradientType );
+ nTmp = sal::static_int_cast<sal_uInt16>( rClass.maGradientType );
rOStm << nTmp;
rOStm << rClass.maGradient1stColor;
rOStm << rClass.maGradient2ndColor;
@@ -736,7 +736,7 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass )
rClass.maPath.Read( rIStm );
rIStm >> rClass.maFillColor;
rIStm >> rClass.mfTransparency;
- UINT16 nTmp;
+ sal_uInt16 nTmp;
rIStm >> nTmp;
rClass.maFillRule = SvtGraphicFill::FillRule( nTmp );
rIStm >> nTmp;
diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx
index 00b3d13991fd..9836b2e6e4b4 100644
--- a/vcl/source/gdi/hatch.cxx
+++ b/vcl/source/gdi/hatch.cxx
@@ -82,7 +82,7 @@ Hatch::Hatch( const Hatch& rHatch )
// -----------------------------------------------------------------------
Hatch::Hatch( HatchStyle eStyle, const Color& rColor,
- long nDistance, USHORT nAngle10 )
+ long nDistance, sal_uInt16 nAngle10 )
{
DBG_CTOR( Hatch, NULL );
mpImplHatch = new ImplHatch;
@@ -119,7 +119,7 @@ Hatch& Hatch::operator=( const Hatch& rHatch )
// -----------------------------------------------------------------------
-BOOL Hatch::operator==( const Hatch& rHatch ) const
+sal_Bool Hatch::operator==( const Hatch& rHatch ) const
{
DBG_CHKTHIS( Hatch, NULL );
DBG_CHKOBJ( &rHatch, Hatch, NULL );
@@ -173,7 +173,7 @@ void Hatch::SetDistance( long nDistance )
// -----------------------------------------------------------------------
-void Hatch::SetAngle( USHORT nAngle10 )
+void Hatch::SetAngle( sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( Hatch, NULL );
ImplMakeUnique();
@@ -185,7 +185,7 @@ void Hatch::SetAngle( USHORT nAngle10 )
SvStream& operator>>( SvStream& rIStm, ImplHatch& rImplHatch )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplHatch.meStyle = (HatchStyle) nTmp16;
rIStm >> rImplHatch.maColor >> rImplHatch.mnDistance >> rImplHatch.mnAngle;
@@ -199,7 +199,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplHatch& rImplHatch )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImplHatch.meStyle << rImplHatch.maColor;
+ rOStm << (sal_uInt16) rImplHatch.meStyle << rImplHatch.maColor;
rOStm << rImplHatch.mnDistance << rImplHatch.mnAngle;
return rOStm;
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index f5e686a71c38..24c86c326910 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -82,7 +82,7 @@ Image::Image( const ResId& rResId ) :
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
BitmapEx aBmpEx;
- ULONG nObjMask = pResMgr->ReadLong();
+ sal_uLong nObjMask = pResMgr->ReadLong();
if( nObjMask & RSC_IMAGE_IMAGEBITMAP )
{
@@ -285,7 +285,7 @@ void Image::Invert()
// -----------------------------------------------------------------------
void Image::GetColorTransformArrays( ImageColorTransform eColorTransform,
- Color*& rpSrcColor, Color*& rpDstColor, ULONG& rColorCount )
+ Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount )
{
if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
{
@@ -332,7 +332,7 @@ Image& Image::operator=( const Image& rImage )
// -----------------------------------------------------------------------
-BOOL Image::operator==( const Image& rImage ) const
+sal_Bool Image::operator==( const Image& rImage ) const
{
DBG_CHKTHIS( Image, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -370,7 +370,7 @@ BOOL Image::operator==( const Image& rImage ) const
// - ImageList -
// -------------
-ImageList::ImageList( USHORT nInit, USHORT nGrow ) :
+ImageList::ImageList( sal_uInt16 nInit, sal_uInt16 nGrow ) :
mpImplData( NULL ),
mnInitSize( nInit ),
mnGrowSize( nGrow )
@@ -397,7 +397,7 @@ ImageList::ImageList( const ResId& rResId ) :
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- ULONG nObjMask = pResMgr->ReadLong();
+ sal_uLong nObjMask = pResMgr->ReadLong();
const String aPrefix( pResMgr->ReadString() );
::boost::scoped_ptr< Color > spMaskColor;
@@ -413,13 +413,13 @@ ImageList::ImageList( const ResId& rResId ) :
}
sal_Int32 nCount = pResMgr->ReadLong();
- ImplInit( static_cast< USHORT >( nCount ), Size() );
+ ImplInit( static_cast< sal_uInt16 >( nCount ), Size() );
BitmapEx aEmpty;
for( sal_Int32 i = 0; i < nCount; ++i )
{
rtl::OUString aName = pResMgr->ReadString();
- USHORT nId = static_cast< USHORT >( pResMgr->ReadLong() );
+ sal_uInt16 nId = static_cast< sal_uInt16 >( pResMgr->ReadLong() );
mpImplData->AddImage( aName, nId, aEmpty );
}
@@ -441,12 +441,12 @@ ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
DBG_CTOR( ImageList, NULL );
- ImplInit( sal::static_int_cast< USHORT >( rNameVector.size() ), Size() );
+ ImplInit( sal::static_int_cast< sal_uInt16 >( rNameVector.size() ), Size() );
mpImplData->maPrefix = rPrefix;
for( sal_uInt32 i = 0; i < rNameVector.size(); ++i )
{
- mpImplData->AddImage( rNameVector[ i ], static_cast< USHORT >( i ) + 1, BitmapEx() );
+ mpImplData->AddImage( rNameVector[ i ], static_cast< sal_uInt16 >( i ) + 1, BitmapEx() );
}
}
@@ -473,7 +473,7 @@ ImageList::~ImageList()
delete mpImplData;
}
-void ImageList::ImplInit( USHORT nItems, const Size &rSize )
+void ImageList::ImplInit( sal_uInt16 nItems, const Size &rSize )
{
mpImplData = new ImplImageList;
mpImplData->mnRefCount = 1;
@@ -525,13 +525,13 @@ void ImageList::ImplMakeUnique()
BitmapEx ImageList::GetAsHorizontalStrip() const
{
Size aSize( mpImplData->maImageSize );
- USHORT nCount = GetImageCount();
+ sal_uInt16 nCount = GetImageCount();
if( !nCount )
return BitmapEx();
aSize.Width() *= nCount;
// Load any stragglers
- for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
{
ImageAryData *pData = mpImplData->maImages[ nIdx ];
if( pData->IsLoadable() )
@@ -549,7 +549,7 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
aResult = BitmapEx( aPixels );
Rectangle aSrcRect( Point( 0, 0 ), mpImplData->maImageSize );
- for (USHORT nIdx = 0; nIdx < nCount; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
{
Rectangle aDestRect( Point( nIdx * mpImplData->maImageSize.Width(), 0 ),
mpImplData->maImageSize );
@@ -565,7 +565,7 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
const std::vector< rtl::OUString > &rNameVector )
{
- USHORT nItems = sal::static_int_cast< USHORT >( rNameVector.size() );
+ sal_uInt16 nItems = sal::static_int_cast< sal_uInt16 >( rNameVector.size() );
if (!nItems)
return;
@@ -576,7 +576,7 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
aSize.Width() /= nItems;
ImplInit( nItems, aSize );
- for (USHORT nIdx = 0; nIdx < nItems; nIdx++)
+ for (sal_uInt16 nIdx = 0; nIdx < nItems; nIdx++)
{
BitmapEx aBitmap( rBitmapEx, Point( nIdx * aSize.Width(), 0 ), aSize );
mpImplData->AddImage( rNameVector[ nIdx ], nIdx + 1, aBitmap );
@@ -586,11 +586,11 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
// -----------------------------------------------------------------------
void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
- USHORT nCount,
+ sal_uInt16 nCount,
const Color *pMaskColor,
const Color *pSearchColors,
const Color *pReplaceColors,
- ULONG nColorCount)
+ sal_uLong nColorCount)
{
BitmapEx aBmpEx( rResId );
if (!aBmpEx.IsTransparent())
@@ -609,7 +609,7 @@ void ImageList::InsertFromHorizontalBitmap( const ResId& rResId,
// -----------------------------------------------------------------------
-USHORT ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
+sal_uInt16 ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -622,7 +622,7 @@ USHORT ImageList::ImplGetImageId( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-void ImageList::AddImage( USHORT nId, const Image& rImage )
+void ImageList::AddImage( sal_uInt16 nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -652,7 +652,7 @@ void ImageList::AddImage( const ::rtl::OUString& rImageName, const Image& rImage
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( USHORT nId, const Image& rImage )
+void ImageList::ReplaceImage( sal_uInt16 nId, const Image& rImage )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImage, Image, NULL );
@@ -666,7 +666,7 @@ void ImageList::ReplaceImage( USHORT nId, const Image& rImage )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rImage )
{
- const USHORT nId = ImplGetImageId( rImageName );
+ const sal_uInt16 nId = ImplGetImageId( rImageName );
if( nId )
{
@@ -680,14 +680,14 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const Image& rI
// -----------------------------------------------------------------------
-void ImageList::ReplaceImage( USHORT nId, USHORT nReplaceId )
+void ImageList::ReplaceImage( sal_uInt16 nId, sal_uInt16 nReplaceId )
{
DBG_CHKTHIS( ImageList, NULL );
DBG_ASSERT( GetImagePos( nId ) != IMAGELIST_IMAGE_NOTFOUND, "ImageList::ReplaceImage(): Unknown nId" );
DBG_ASSERT( GetImagePos( nReplaceId ) != IMAGELIST_IMAGE_NOTFOUND, "ImageList::ReplaceImage(): Unknown nReplaceId" );
- ULONG nPosDest = GetImagePos( nId );
- ULONG nPosSrc = GetImagePos( nReplaceId );
+ sal_uLong nPosDest = GetImagePos( nId );
+ sal_uLong nPosSrc = GetImagePos( nReplaceId );
if( nPosDest != IMAGELIST_IMAGE_NOTFOUND &&
nPosSrc != IMAGELIST_IMAGE_NOTFOUND )
{
@@ -700,7 +700,7 @@ void ImageList::ReplaceImage( USHORT nId, USHORT nReplaceId )
void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OUString& rReplaceName )
{
- const USHORT nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
+ const sal_uInt16 nId1 = ImplGetImageId( rImageName ), nId2 = ImplGetImageId( rReplaceName );
if( nId1 && nId2 )
ReplaceImage( nId1, nId2 );
@@ -708,7 +708,7 @@ void ImageList::ReplaceImage( const ::rtl::OUString& rImageName, const ::rtl::OU
// -----------------------------------------------------------------------
-void ImageList::RemoveImage( USHORT nId )
+void ImageList::RemoveImage( sal_uInt16 nId )
{
DBG_CHKTHIS( ImageList, NULL );
@@ -716,7 +716,7 @@ void ImageList::RemoveImage( USHORT nId )
{
if( mpImplData->maImages[ i ]->mnId == nId )
{
- mpImplData->RemoveImage( static_cast< USHORT >( i ) );
+ mpImplData->RemoveImage( static_cast< sal_uInt16 >( i ) );
break;
}
}
@@ -726,7 +726,7 @@ void ImageList::RemoveImage( USHORT nId )
void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
{
- const USHORT nId = ImplGetImageId( rImageName );
+ const sal_uInt16 nId = ImplGetImageId( rImageName );
if( nId )
RemoveImage( nId );
@@ -734,7 +734,7 @@ void ImageList::RemoveImage( const ::rtl::OUString& rImageName )
// -----------------------------------------------------------------------
-Image ImageList::GetImage( USHORT nId ) const
+Image ImageList::GetImage( sal_uInt16 nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -800,16 +800,16 @@ void ImageList::Clear()
// -----------------------------------------------------------------------
-USHORT ImageList::GetImageCount() const
+sal_uInt16 ImageList::GetImageCount() const
{
DBG_CHKTHIS( ImageList, NULL );
- return mpImplData ? static_cast< USHORT >( mpImplData->maImages.size() ) : 0;
+ return mpImplData ? static_cast< sal_uInt16 >( mpImplData->maImages.size() ) : 0;
}
// -----------------------------------------------------------------------
-USHORT ImageList::GetImagePos( USHORT nId ) const
+sal_uInt16 ImageList::GetImagePos( sal_uInt16 nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -818,21 +818,21 @@ USHORT ImageList::GetImagePos( USHORT nId ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); ++i )
{
if (mpImplData->maImages[ i ]->mnId == nId)
- return static_cast< USHORT >( i );
+ return static_cast< sal_uInt16 >( i );
}
}
return IMAGELIST_IMAGE_NOTFOUND;
}
-bool ImageList::HasImageAtPos( USHORT nId ) const
+bool ImageList::HasImageAtPos( sal_uInt16 nId ) const
{
return GetImagePos( nId ) != IMAGELIST_IMAGE_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
+sal_uInt16 ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -841,7 +841,7 @@ USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
{
if (mpImplData->maImages[i]->maName == rImageName)
- return static_cast< USHORT >( i );
+ return static_cast< sal_uInt16 >( i );
}
}
@@ -850,7 +850,7 @@ USHORT ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
// -----------------------------------------------------------------------
-USHORT ImageList::GetImageId( USHORT nPos ) const
+sal_uInt16 ImageList::GetImageId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -862,13 +862,13 @@ USHORT ImageList::GetImageId( USHORT nPos ) const
// -----------------------------------------------------------------------
-void ImageList::GetImageIds( ::std::vector< USHORT >& rIds ) const
+void ImageList::GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const
{
RTL_LOGFILE_CONTEXT( aLog, "vcl: ImageList::GetImageIds" );
DBG_CHKTHIS( ImageList, NULL );
- rIds = ::std::vector< USHORT >();
+ rIds = ::std::vector< sal_uInt16 >();
if( mpImplData )
{
@@ -879,7 +879,7 @@ void ImageList::GetImageIds( ::std::vector< USHORT >& rIds ) const
// -----------------------------------------------------------------------
-::rtl::OUString ImageList::GetImageName( USHORT nPos ) const
+::rtl::OUString ImageList::GetImageName( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( ImageList, NULL );
@@ -953,7 +953,7 @@ ImageList& ImageList::operator=( const ImageList& rImageList )
// -----------------------------------------------------------------------
-BOOL ImageList::operator==( const ImageList& rImageList ) const
+sal_Bool ImageList::operator==( const ImageList& rImageList ) const
{
DBG_CHKTHIS( ImageList, NULL );
DBG_CHKOBJ( &rImageList, ImageList, NULL );
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index bafb5ea8c490..59ee15fa558a 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -40,7 +40,7 @@
ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
const Point& rPt, const Size& rSz,
- ULONG nExtraData,
+ sal_uLong nExtraData,
OutputDevice* pFirstFrameOutDev ) :
mpParent ( pParent ),
mpOut ( pFirstFrameOutDev ? pFirstFrameOutDev : pOut ),
@@ -52,8 +52,8 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut,
mpBackground ( new VirtualDevice ),
mpRestore ( new VirtualDevice ),
meLastDisposal ( DISPOSE_BACK ),
- mbPause ( FALSE ),
- mbMarked ( FALSE ),
+ mbPause ( sal_False ),
+ mbMarked ( sal_False ),
mbHMirr ( maSz.Width() < 0L ),
mbVMirr ( maSz.Height() < 0L )
{
@@ -119,17 +119,17 @@ ImplAnimView::~ImplAnimView()
// ------------------------------------------------------------------------
-BOOL ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
+sal_Bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( nExtraData )
{
if( ( mnExtraData == nExtraData ) && ( !pOut || ( pOut == mpOut ) ) )
- bRet = TRUE;
+ bRet = sal_True;
}
else if( !pOut || ( pOut == mpOut ) )
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
@@ -175,15 +175,15 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix,
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDrawToPos( ULONG nPos )
+void ImplAnimView::ImplDrawToPos( sal_uLong nPos )
{
VirtualDevice aVDev;
Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL;
- aVDev.SetOutputSizePixel( maSzPix, FALSE );
- nPos = Min( nPos, (ULONG) mpParent->Count() - 1UL );
+ aVDev.SetOutputSizePixel( maSzPix, sal_False );
+ nPos = Min( nPos, (sal_uLong) mpParent->Count() - 1UL );
- for( ULONG i = 0UL; i <= nPos; i++ )
+ for( sal_uLong i = 0UL; i <= nPos; i++ )
ImplDraw( i, &aVDev );
if( pOldClip )
@@ -200,20 +200,20 @@ void ImplAnimView::ImplDrawToPos( ULONG nPos )
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( ULONG nPos )
+void ImplAnimView::ImplDraw( sal_uLong nPos )
{
ImplDraw( nPos, NULL );
}
// ------------------------------------------------------------------------
-void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
+void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev )
{
Rectangle aOutRect( mpOut->PixelToLogic( Point() ), mpOut->GetOutputSize() );
// check, if output lies out of display
if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() )
- ImplSetMarked( TRUE );
+ ImplSetMarked( sal_True );
else if( !mbPause )
{
VirtualDevice* pDev;
@@ -221,8 +221,8 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
Point aBmpPosPix;
Size aSizePix;
Size aBmpSizePix;
- const ULONG nLastPos = mpParent->Count() - 1;
- const AnimationBitmap& rAnm = mpParent->Get( (USHORT) ( mnActPos = Min( nPos, nLastPos ) ) );
+ const sal_uLong nLastPos = mpParent->Count() - 1;
+ const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = Min( nPos, nLastPos ) ) );
ImplGetPosSize( rAnm, aPosPix, aSizePix );
@@ -254,7 +254,7 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
if( !pVDev )
{
pDev = new VirtualDevice;
- pDev->SetOutputSizePixel( maSzPix, FALSE );
+ pDev->SetOutputSizePixel( maSzPix, sal_False );
pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
}
else
@@ -285,10 +285,10 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
// ==> ggf. in eine Bitmap stecken, ansonsten SaveBitmap
// aus Speichergruenden loeschen
if( ( meLastDisposal == DISPOSE_BACK ) || ( meLastDisposal == DISPOSE_NOT ) )
- mpRestore->SetOutputSizePixel( Size( 1, 1 ), FALSE );
+ mpRestore->SetOutputSizePixel( Size( 1, 1 ), sal_False );
else
{
- mpRestore->SetOutputSizePixel( maRestSz, FALSE );
+ mpRestore->SetOutputSizePixel( maRestSz, sal_False );
mpRestore->DrawOutDev( Point(), maRestSz, aPosPix, aSizePix, *pDev );
}
@@ -321,7 +321,7 @@ void ImplAnimView::ImplDraw( ULONG nPos, VirtualDevice* pVDev )
void ImplAnimView::ImplRepaint()
{
- const BOOL bOldPause = mbPause;
+ const sal_Bool bOldPause = mbPause;
if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
{
@@ -334,7 +334,7 @@ void ImplAnimView::ImplRepaint()
else
mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
- mbPause = FALSE;
+ mbPause = sal_False;
ImplDrawToPos( mnActPos );
mbPause = bOldPause;
}
diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx
index 84e3273fc8c5..4e96ecbd9b64 100644
--- a/vcl/source/gdi/impanmvw.hxx
+++ b/vcl/source/gdi/impanmvw.hxx
@@ -58,27 +58,27 @@ private:
Region maClip;
VirtualDevice* mpBackground;
VirtualDevice* mpRestore;
- ULONG mnActPos;
+ sal_uLong mnActPos;
Disposal meLastDisposal;
- BOOL mbPause;
- BOOL mbFirst;
- BOOL mbMarked;
- BOOL mbHMirr;
- BOOL mbVMirr;
+ sal_Bool mbPause;
+ sal_Bool mbFirst;
+ sal_Bool mbMarked;
+ sal_Bool mbHMirr;
+ sal_Bool mbVMirr;
void ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix );
- void ImplDraw( ULONG nPos, VirtualDevice* pVDev );
+ void ImplDraw( sal_uLong nPos, VirtualDevice* pVDev );
public:
ImplAnimView( Animation* pParent, OutputDevice* pOut,
- const Point& rPt, const Size& rSz, ULONG nExtraData,
+ const Point& rPt, const Size& rSz, sal_uLong nExtraData,
OutputDevice* pFirstFrameOutDev = NULL );
~ImplAnimView();
- BOOL ImplMatches( OutputDevice* pOut, long nExtraData ) const;
- void ImplDrawToPos( ULONG nPos );
- void ImplDraw( ULONG nPos );
+ sal_Bool ImplMatches( OutputDevice* pOut, long nExtraData ) const;
+ void ImplDrawToPos( sal_uLong nPos );
+ void ImplDraw( sal_uLong nPos );
void ImplRepaint();
AInfo* ImplCreateAInfo() const;
@@ -87,11 +87,11 @@ public:
const Size& ImplGetOutSize() const { return maSz; }
const Size& ImplGetOutSizePix() const { return maSzPix; }
- void ImplPause( BOOL bPause ) { mbPause = bPause; }
- BOOL ImplIsPause() const { return mbPause; }
+ void ImplPause( sal_Bool bPause ) { mbPause = bPause; }
+ sal_Bool ImplIsPause() const { return mbPause; }
- void ImplSetMarked( BOOL bMarked ) { mbMarked = bMarked; }
- BOOL ImplIsMarked() const { return mbMarked; }
+ void ImplSetMarked( sal_Bool bMarked ) { mbMarked = bMarked; }
+ sal_Bool ImplIsMarked() const { return mbMarked; }
};
#endif
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 4b4b1f4289b6..6957e32b3e25 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -64,7 +64,7 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
maSourceSize = rSize;
return mpSalBitmap->Create( rSize, nBitCount, rPal );
@@ -72,7 +72,7 @@ BOOL ImpBitmap::ImplCreate( const Size& rSize, USHORT nBitCount, const BitmapPal
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
{
maSourceSize = rImpBitmap.maSourceSize;
mnChecksum = rImpBitmap.mnChecksum;
@@ -81,14 +81,14 @@ BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, pGraphics );
}
// -----------------------------------------------------------------------
-BOOL ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, USHORT nNewBitCount )
+sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount )
{
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, nNewBitCount );
}
@@ -109,22 +109,22 @@ Size ImpBitmap::ImplGetSize() const
// -----------------------------------------------------------------------
-USHORT ImpBitmap::ImplGetBitCount() const
+sal_uInt16 ImpBitmap::ImplGetBitCount() const
{
- USHORT nBitCount = mpSalBitmap->GetBitCount();
+ sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 );
}
// -----------------------------------------------------------------------
-BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BOOL bReadOnly )
+BitmapBuffer* ImpBitmap::ImplAcquireBuffer( sal_Bool bReadOnly )
{
return mpSalBitmap->AcquireBuffer( bReadOnly );
}
// -----------------------------------------------------------------------
-void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, BOOL bReadOnly )
+void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly )
{
mpSalBitmap->ReleaseBuffer( pBuffer, bReadOnly );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index cbd53dc1b201..bf99364a0f64 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -69,7 +69,7 @@
struct ImpSwapFile
{
INetURLObject aSwapURL;
- ULONG nRefCount;
+ sal_uLong nRefCount;
};
// -----------------
@@ -89,15 +89,15 @@ GraphicReader::~GraphicReader()
// ------------------------------------------------------------------------
-BOOL GraphicReader::IsPreviewModeEnabled() const
+sal_Bool GraphicReader::IsPreviewModeEnabled() const
{
if( !mpReaderData )
- return FALSE;
+ return sal_False;
if( mpReaderData->maPreviewSize.Width() )
- return TRUE;
+ return sal_True;
if( mpReaderData->maPreviewSize.Height() )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// ------------------------------------------------------------------------
@@ -140,8 +140,8 @@ ImpGraphic::ImpGraphic() :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -158,7 +158,7 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
mnSizeBytes ( rImpGraphic.mnSizeBytes ),
mnRefCount ( 1UL ),
mbSwapOut ( rImpGraphic.mbSwapOut ),
- mbSwapUnderway ( FALSE )
+ mbSwapUnderway ( sal_False )
{
if( mpSwapFile )
mpSwapFile->nRefCount++;
@@ -189,8 +189,8 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -206,8 +206,8 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -223,8 +223,8 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -240,8 +240,8 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) :
mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
- mbSwapOut ( FALSE ),
- mbSwapUnderway ( FALSE )
+ mbSwapOut ( sal_False ),
+ mbSwapUnderway ( sal_False )
{
}
@@ -251,7 +251,7 @@ ImpGraphic::~ImpGraphic()
{
ImplClear();
- if( (ULONG) mpContext > 1UL )
+ if( (sal_uLong) mpContext > 1UL )
delete mpContext;
}
@@ -305,24 +305,24 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
+sal_Bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( this == &rImpGraphic )
- bRet = TRUE;
+ bRet = sal_True;
else if( !ImplIsSwapOut() && ( rImpGraphic.meType == meType ) )
{
switch( meType )
{
case( GRAPHIC_NONE ):
- bRet = TRUE;
+ bRet = sal_True;
break;
case( GRAPHIC_GDIMETAFILE ):
{
if( rImpGraphic.maMetaFile == maMetaFile )
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -331,10 +331,10 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
if( mpAnimation )
{
if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) )
- bRet = TRUE;
+ bRet = sal_True;
}
else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) )
- bRet = TRUE;
+ bRet = sal_True;
}
break;
@@ -348,7 +348,7 @@ BOOL ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
// ------------------------------------------------------------------------
-void ImpGraphic::ImplClearGraphics( BOOL bCreateSwapInfo )
+void ImpGraphic::ImplClearGraphics( sal_Bool bCreateSwapInfo )
{
if( bCreateSwapInfo && !ImplIsSwapOut() )
{
@@ -410,12 +410,12 @@ void ImpGraphic::ImplClear()
mpSwapFile = NULL;
}
- mbSwapOut = FALSE;
+ mbSwapOut = sal_False;
mnDocFilePos = 0UL;
maDocFileURLStr.Erase();
// cleanup
- ImplClearGraphics( FALSE );
+ ImplClearGraphics( sal_False );
meType = GRAPHIC_NONE;
mnSizeBytes = 0;
}
@@ -437,42 +437,42 @@ void ImpGraphic::ImplSetDefaultType()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsSupportedGraphic() const
+sal_Bool ImpGraphic::ImplIsSupportedGraphic() const
{
return( meType != GRAPHIC_NONE );
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsTransparent() const
+sal_Bool ImpGraphic::ImplIsTransparent() const
{
- BOOL bRet;
+ sal_Bool bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent() );
else
- bRet = TRUE;
+ bRet = sal_True;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsAlpha() const
+sal_Bool ImpGraphic::ImplIsAlpha() const
{
- BOOL bRet;
+ sal_Bool bRet;
if( meType == GRAPHIC_BITMAP )
bRet = ( NULL == mpAnimation ) && maEx.IsAlpha();
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsAnimated() const
+sal_Bool ImpGraphic::ImplIsAnimated() const
{
return( mpAnimation != NULL );
}
@@ -728,7 +728,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetSizeBytes() const
+sal_uLong ImpGraphic::ImplGetSizeBytes() const
{
if( 0 == mnSizeBytes )
{
@@ -855,7 +855,7 @@ Link ImpGraphic::ImplGetAnimationNotifyHdl() const
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetAnimationLoopCount() const
+sal_uLong ImpGraphic::ImplGetAnimationLoopCount() const
{
return( mpAnimation ? mpAnimation->GetLoopCount() : 0UL );
}
@@ -891,7 +891,7 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader )
// ------------------------------------------------------------------------
-void ImpGraphic::ImplSetDocFileName( const String& rName, ULONG nFilePos )
+void ImpGraphic::ImplSetDocFileName( const String& rName, sal_uLong nFilePos )
{
const INetURLObject aURL( rName );
@@ -910,29 +910,29 @@ const String& ImpGraphic::ImplGetDocFileName() const
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetDocFilePos() const
+sal_uLong ImpGraphic::ImplGetDocFilePos() const
{
return mnDocFilePos;
}
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
+sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
{
MapMode aMapMode;
Size aSize;
- const ULONG nStartPos = rIStm.Tell();
+ const sal_uLong nStartPos = rIStm.Tell();
sal_uInt32 nId;
- ULONG nHeaderLen;
+ sal_uLong nHeaderLen;
long nType;
long nLen;
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
- BOOL bRet = FALSE;
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
+ sal_Bool bRet = sal_False;
if( !mbSwapUnderway )
{
const String aTempURLStr( maDocFileURLStr );
- const ULONG nTempPos = mnDocFilePos;
+ const sal_uLong nTempPos = mnDocFilePos;
ImplClear();
@@ -1017,7 +1017,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
if( maDocFileURLStr.Len() )
{
rIStm.Seek( nStartPos + nHeaderLen + nLen );
- bRet = mbSwapOut = TRUE;
+ bRet = mbSwapOut = sal_True;
}
else
{
@@ -1030,9 +1030,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
if( pOStm )
{
- ULONG nFullLen = nHeaderLen + nLen;
- ULONG nPartLen = Min( nFullLen, (ULONG) GRAPHIC_MAXPARTLEN );
- BYTE* pBuffer = (BYTE*) rtl_allocateMemory( nPartLen );
+ sal_uLong nFullLen = nHeaderLen + nLen;
+ sal_uLong nPartLen = Min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN );
+ sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen );
pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1052,12 +1052,12 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
}
rtl_freeMemory( pBuffer );
- ULONG nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
+ sal_uLong nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
delete pOStm, pOStm = NULL;
if( !nReadErr && !nWriteErr )
{
- bRet = mbSwapOut = TRUE;
+ bRet = mbSwapOut = sal_True;
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
mpSwapFile->aSwapURL = aTmpURL;
@@ -1100,9 +1100,9 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
else if( meType >= SYS_WINMETAFILE && meType <= SYS_MACMETAFILE )
{
Graphic aSysGraphic;
- ULONG nCvtType;
+ sal_uLong nCvtType;
- switch( sal::static_int_cast<ULONG>(meType) )
+ switch( sal::static_int_cast<sal_uLong>(meType) )
{
case( SYS_WINMETAFILE ):
case( SYS_WNTMETAFILE ): nCvtType = CVT_WMF; break;
@@ -1130,7 +1130,7 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
}
}
else
- bRet = TRUE;
+ bRet = sal_True;
rIStm.SetNumberFormatInt( nOldFormat );
@@ -1139,16 +1139,16 @@ BOOL ImpGraphic::ImplReadEmbedded( SvStream& rIStm, BOOL bSwap )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
+sal_Bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ( meType != GRAPHIC_NONE ) && ( meType != GRAPHIC_DEFAULT ) && !ImplIsSwapOut() )
{
const MapMode aMapMode( ImplGetPrefMapMode() );
const Size aSize( ImplGetPrefSize() );
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
- ULONG nDataFieldPos;
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
+ sal_uLong nDataFieldPos;
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1195,18 +1195,18 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// write data block
if( !rOStm.GetError() )
{
- const ULONG nDataStart = rOStm.Tell();
+ const sal_uLong nDataStart = rOStm.Tell();
if( ImplIsSupportedGraphic() )
rOStm << *this;
if( !rOStm.GetError() )
{
- const ULONG nStmPos2 = rOStm.Tell();
+ const sal_uLong nStmPos2 = rOStm.Tell();
rOStm.Seek( nDataFieldPos );
rOStm << (long) ( nStmPos2 - nDataStart );
rOStm.Seek( nStmPos2 );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1218,9 +1218,9 @@ BOOL ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapOut()
+sal_Bool ImpGraphic::ImplSwapOut()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( !ImplIsSwapOut() )
{
@@ -1238,7 +1238,7 @@ BOOL ImpGraphic::ImplSwapOut()
pOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
pOStm->SetCompressMode( COMPRESSMODE_NATIVE );
- if( ( bRet = ImplSwapOut( pOStm ) ) == TRUE )
+ if( ( bRet = ImplSwapOut( pOStm ) ) == sal_True )
{
mpSwapFile = new ImpSwapFile;
mpSwapFile->nRefCount = 1;
@@ -1276,8 +1276,8 @@ BOOL ImpGraphic::ImplSwapOut()
}
else
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
}
@@ -1286,9 +1286,9 @@ BOOL ImpGraphic::ImplSwapOut()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
+sal_Bool ImpGraphic::ImplSwapOut( SvStream* pOStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pOStm )
{
@@ -1300,15 +1300,15 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
if( !pOStm->GetError() )
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
}
}
else
{
- ImplClearGraphics( TRUE );
- bRet = mbSwapOut = TRUE;
+ ImplClearGraphics( sal_True );
+ bRet = mbSwapOut = sal_True;
}
return bRet;
@@ -1316,9 +1316,9 @@ BOOL ImpGraphic::ImplSwapOut( SvStream* pOStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapIn()
+sal_Bool ImpGraphic::ImplSwapIn()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ImplIsSwapOut() )
{
@@ -1385,9 +1385,9 @@ BOOL ImpGraphic::ImplSwapIn()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
+sal_Bool ImpGraphic::ImplSwapIn( SvStream* pIStm )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pIStm )
{
@@ -1395,14 +1395,14 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
if( !pIStm->GetError() )
{
- mbSwapUnderway = TRUE;
+ mbSwapUnderway = sal_True;
bRet = ImplReadEmbedded( *pIStm );
- mbSwapUnderway = FALSE;
+ mbSwapUnderway = sal_False;
if( !bRet )
ImplClear();
else
- mbSwapOut = FALSE;
+ mbSwapOut = sal_False;
}
}
@@ -1411,7 +1411,7 @@ BOOL ImpGraphic::ImplSwapIn( SvStream* pIStm )
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsSwapOut() const
+sal_Bool ImpGraphic::ImplIsSwapOut() const
{
return mbSwapOut;
}
@@ -1436,16 +1436,16 @@ GfxLink ImpGraphic::ImplGetLink()
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplIsLink() const
+sal_Bool ImpGraphic::ImplIsLink() const
{
- return ( mpGfxLink != NULL ) ? TRUE : FALSE;
+ return ( mpGfxLink != NULL ) ? sal_True : sal_False;
}
// ------------------------------------------------------------------------
-ULONG ImpGraphic::ImplGetChecksum() const
+sal_uLong ImpGraphic::ImplGetChecksum() const
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
{
@@ -1474,9 +1474,9 @@ ULONG ImpGraphic::ImplGetChecksum() const
// ------------------------------------------------------------------------
-BOOL ImpGraphic::ImplExportNative( SvStream& rOStm ) const
+sal_Bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const
{
- BOOL bResult = FALSE;
+ sal_Bool bResult = sal_False;
if( !rOStm.GetError() )
{
@@ -1503,7 +1503,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
{
if( !rIStm.GetError() )
{
- const ULONG nStmPos1 = rIStm.Tell();
+ const sal_uLong nStmPos1 = rIStm.Tell();
sal_uInt32 nTmp;
if ( !rImpGraphic.mbSwapUnderway )
@@ -1537,7 +1537,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
if( !rIStm.GetError() && aLink.LoadNative( aGraphic ) )
{
// set link only, if no other link was set
- const BOOL bSetLink = ( rImpGraphic.mpGfxLink == NULL );
+ const sal_Bool bSetLink = ( rImpGraphic.mpGfxLink == NULL );
// assign graphic
rImpGraphic = *aGraphic.ImplGetImpGraphic();
@@ -1560,7 +1560,7 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
else
{
BitmapEx aBmpEx;
- const USHORT nOldFormat = rIStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
rIStm.SeekRel( -4 );
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -1568,8 +1568,8 @@ SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic )
if( !rIStm.GetError() )
{
- UINT32 nMagic1(0), nMagic2(0);
- ULONG nActPos = rIStm.Tell();
+ sal_uInt32 nMagic1(0), nMagic2(0);
+ sal_uLong nActPos = rIStm.Tell();
rIStm >> nMagic1 >> nMagic2;
rIStm.Seek( nActPos );
@@ -1639,7 +1639,7 @@ SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic )
else
{
// own format
- const USHORT nOldFormat = rOStm.GetNumberFormatInt();
+ const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
switch( rImpGraphic.ImplGetType() )
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 09bf08e05730..d2e479e1edb5 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -66,7 +66,7 @@ ImageAryData::ImageAryData( const ImageAryData& rData ) :
}
ImageAryData::ImageAryData( const rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmap )
+ sal_uInt16 nId, const BitmapEx &aBitmap )
: maName( aName ), mnId( nId ), maBitmapEx( aBitmap )
{
}
@@ -118,7 +118,7 @@ ImplImageList::~ImplImageList()
}
void ImplImageList::AddImage( const ::rtl::OUString &aName,
- USHORT nId, const BitmapEx &aBitmapEx )
+ sal_uInt16 nId, const BitmapEx &aBitmapEx )
{
ImageAryData *pImg = new ImageAryData( aName, nId, aBitmapEx );
maImages.push_back( pImg );
@@ -126,7 +126,7 @@ void ImplImageList::AddImage( const ::rtl::OUString &aName,
maNameHash [ aName ] = pImg;
}
-void ImplImageList::RemoveImage( USHORT nPos )
+void ImplImageList::RemoveImage( sal_uInt16 nPos )
{
ImageAryData *pImg = maImages[ nPos ];
if( pImg->maName.getLength() )
@@ -134,9 +134,9 @@ void ImplImageList::RemoveImage( USHORT nPos )
maImages.erase( maImages.begin() + nPos );
}
-USHORT ImplImageList::GetImageCount() const
+sal_uInt16 ImplImageList::GetImageCount() const
{
- return sal::static_int_cast< USHORT >( maImages.size() );
+ return sal::static_int_cast< sal_uInt16 >( maImages.size() );
}
// -----------------
@@ -160,7 +160,7 @@ ImplImageData::~ImplImageData()
// - ImplImageData -
// -----------------
-BOOL ImplImageData::IsEqual( const ImplImageData& rData )
+sal_Bool ImplImageData::IsEqual( const ImplImageData& rData )
{
return( maBmpEx == rData.maBmpEx );
}
@@ -212,7 +212,7 @@ ImplImageBmp::~ImplImageBmp()
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( long nItemWidth, long nItemHeight, USHORT nInitSize )
+void ImplImageBmp::Create( long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
{
const Size aTotalSize( nInitSize * nItemWidth, nItemHeight );
@@ -226,13 +226,13 @@ void ImplImageBmp::Create( long nItemWidth, long nItemHeight, USHORT nInitSize )
mnSize = nInitSize;
delete[] mpInfoAry;
- mpInfoAry = new BYTE[ mnSize ];
+ mpInfoAry = new sal_uInt8[ mnSize ];
memset( mpInfoAry, 0, mnSize );
}
// -----------------------------------------------------------------------
-void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, USHORT nInitSize )
+void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHeight, sal_uInt16 nInitSize )
{
maBmpEx = rBmpEx;
maDisabledBmpEx.SetEmpty();
@@ -244,7 +244,7 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe
mnSize = nInitSize;
delete[] mpInfoAry;
- mpInfoAry = new BYTE[ mnSize ];
+ mpInfoAry = new sal_uInt8[ mnSize ];
memset( mpInfoAry,
rBmpEx.IsAlpha() ? IMPSYSIMAGEITEM_ALPHA : ( rBmpEx.IsTransparent() ? IMPSYSIMAGEITEM_MASK : 0 ),
mnSize );
@@ -252,11 +252,11 @@ void ImplImageBmp::Create( const BitmapEx& rBmpEx, long nItemWidth, long nItemHe
// -----------------------------------------------------------------------
-void ImplImageBmp::Expand( USHORT nGrowSize )
+void ImplImageBmp::Expand( sal_uInt16 nGrowSize )
{
- const ULONG nDX = nGrowSize * maSize.Width();
- const USHORT nOldSize = mnSize;
- BYTE* pNewAry = new BYTE[ mnSize = sal::static_int_cast<USHORT>(mnSize+nGrowSize) ];
+ const sal_uLong nDX = nGrowSize * maSize.Width();
+ const sal_uInt16 nOldSize = mnSize;
+ sal_uInt8* pNewAry = new sal_uInt8[ mnSize = sal::static_int_cast<sal_uInt16>(mnSize+nGrowSize) ];
maBmpEx.Expand( nDX, 0UL );
@@ -284,7 +284,7 @@ void ImplImageBmp::Invert()
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, USHORT nSrcPos )
+void ImplImageBmp::Replace( sal_uInt16 nPos, sal_uInt16 nSrcPos )
{
const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aSrcPos, maSize );
@@ -303,7 +303,7 @@ void ImplImageBmp::Replace( USHORT nPos, USHORT nSrcPos )
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT nSrcPos )
+void ImplImageBmp::Replace( sal_uInt16 nPos, const ImplImageBmp& rImageBmp, sal_uInt16 nSrcPos )
{
const Point aSrcPos( nSrcPos * maSize.Width(), 0L ), aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aSrcPos, maSize );
@@ -320,7 +320,7 @@ void ImplImageBmp::Replace( USHORT nPos, const ImplImageBmp& rImageBmp, USHORT n
// -----------------------------------------------------------------------
-void ImplImageBmp::Replace( USHORT nPos, const BitmapEx& rBmpEx )
+void ImplImageBmp::Replace( sal_uInt16 nPos, const BitmapEx& rBmpEx )
{
const Point aNullPos, aPos( nPos * maSize.Width(), 0L );
const Rectangle aSrcRect( aNullPos, maSize );
@@ -338,7 +338,7 @@ void ImplImageBmp::Replace( USHORT nPos, const BitmapEx& rBmpEx )
// -----------------------------------------------------------------------
-void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount )
+void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColors, sal_uLong nColorCount )
{
maBmpEx.Replace( pSrcColors, pDstColors, nColorCount );
delete mpDisplayBmp;
@@ -347,7 +347,7 @@ void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColo
// -----------------------------------------------------------------------
-BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
+BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const
{
const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() );
BitmapEx aRet;
@@ -362,7 +362,7 @@ BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
else
aRet = BitmapEx( aNewBmp );
- for( USHORT i = 0; i < nPosCount; i++ )
+ for( sal_uInt16 i = 0; i < nPosCount; i++ )
{
const Point aSrcPos( pPosAry[ i ] * maSize.Width(), 0L );
const Point aPos( i * maSize.Width(), 0L );
@@ -377,8 +377,8 @@ BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
// -----------------------------------------------------------------------
-void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
- const Point& rPos, USHORT nStyle,
+void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
+ const Point& rPos, sal_uInt16 nStyle,
const Size* pSize )
{
if( pOutDev->IsDeviceOutputNecessary() )
@@ -421,9 +421,9 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
BitmapColor aCol;
const long nW = pAcc->Width();
const long nH = pAcc->Height();
- BYTE* pMapR = new BYTE[ 256 ];
- BYTE* pMapG = new BYTE[ 256 ];
- BYTE* pMapB = new BYTE[ 256 ];
+ sal_uInt8* pMapR = new sal_uInt8[ 256 ];
+ sal_uInt8* pMapG = new sal_uInt8[ 256 ];
+ sal_uInt8* pMapB = new sal_uInt8[ 256 ];
long nX, nY;
if( nStyle & IMAGE_DRAW_HIGHLIGHT )
@@ -431,20 +431,20 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
else
aColor = rSettings.GetDeactiveColor();
- const BYTE cR = aColor.GetRed();
- const BYTE cG = aColor.GetGreen();
- const BYTE cB = aColor.GetBlue();
+ const sal_uInt8 cR = aColor.GetRed();
+ const sal_uInt8 cG = aColor.GetGreen();
+ const sal_uInt8 cB = aColor.GetBlue();
for( nX = 0L; nX < 256L; nX++ )
{
- pMapR[ nX ] = (BYTE) ( ( ( nY = ( nX + cR ) >> 1 ) > 255 ) ? 255 : nY );
- pMapG[ nX ] = (BYTE) ( ( ( nY = ( nX + cG ) >> 1 ) > 255 ) ? 255 : nY );
- pMapB[ nX ] = (BYTE) ( ( ( nY = ( nX + cB ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapR[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cR ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapG[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cG ) >> 1 ) > 255 ) ? 255 : nY );
+ pMapB[ nX ] = (sal_uInt8) ( ( ( nY = ( nX + cB ) >> 1 ) > 255 ) ? 255 : nY );
}
if( pAcc->HasPalette() )
{
- for( USHORT i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = pAcc->GetPaletteEntryCount(); i < nCount; i++ )
{
const BitmapColor& rCol = pAcc->GetPaletteColor( i );
aCol.SetRed( pMapR[ rCol.GetRed() ] );
@@ -500,7 +500,7 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
}
else
{
- BYTE cErase = 128;
+ sal_uInt8 cErase = 128;
aTmpBmpEx = BitmapEx( aTmpBmp, AlphaMask( aTmpBmp.GetSizePixel(), &cErase ) );
}
}
@@ -536,14 +536,14 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
// -----------------------------------------------------------------------
void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
-#if defined WIN || defined WNT
+#if defined WNT
pOutDev
#endif
)
{
if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
{
-#if defined WIN || defined WNT
+#if defined WNT
if( maBmpEx.IsAlpha() )
mpDisplayBmp = new BitmapEx( maBmpEx );
else
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index df9270145c6b..21c0cbb0abd4 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -110,23 +110,23 @@ static ChainMove aImplMoveOuter[ 8 ] = {
struct ImplColorSet
{
BitmapColor maColor;
- USHORT mnIndex;
- BOOL mbSet;
+ sal_uInt16 mnIndex;
+ sal_Bool mbSet;
- BOOL operator<( const ImplColorSet& rSet ) const;
- BOOL operator>( const ImplColorSet& rSet ) const;
+ sal_Bool operator<( const ImplColorSet& rSet ) const;
+ sal_Bool operator>( const ImplColorSet& rSet ) const;
};
// ----------------------------------------------------------------------------
-inline BOOL ImplColorSet::operator<( const ImplColorSet& rSet ) const
+inline sal_Bool ImplColorSet::operator<( const ImplColorSet& rSet ) const
{
return( mbSet && ( !rSet.mbSet || ( maColor.GetLuminance() > rSet.maColor.GetLuminance() ) ) );
}
// ----------------------------------------------------------------------------
-inline BOOL ImplColorSet::operator>( const ImplColorSet& rSet ) const
+inline sal_Bool ImplColorSet::operator>( const ImplColorSet& rSet ) const
{
return( !mbSet || ( rSet.mbSet && maColor.GetLuminance() < rSet.maColor.GetLuminance() ) );
}
@@ -141,8 +141,8 @@ extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p
if( pSet1->mbSet && pSet2->mbSet )
{
- const BYTE cLum1 = pSet1->maColor.GetLuminance();
- const BYTE cLum2 = pSet2->maColor.GetLuminance();
+ const sal_uInt8 cLum1 = pSet1->maColor.GetLuminance();
+ const sal_uInt8 cLum2 = pSet2->maColor.GetLuminance();
nRet = ( ( cLum1 > cLum2 ) ? -1 : ( ( cLum1 == cLum2 ) ? 0 : 1 ) );
}
else if( pSet1->mbSet )
@@ -162,21 +162,21 @@ extern "C" int __LOADONCALLAPI ImplColorSetCmpFnc( const void* p1, const void* p
class ImplPointArray
{
Point* mpArray;
- ULONG mnSize;
- ULONG mnRealSize;
+ sal_uLong mnSize;
+ sal_uLong mnRealSize;
public:
ImplPointArray();
~ImplPointArray();
- void ImplSetSize( ULONG nSize );
+ void ImplSetSize( sal_uLong nSize );
- ULONG ImplGetRealSize() const { return mnRealSize; }
- void ImplSetRealSize( ULONG nRealSize ) { mnRealSize = nRealSize; }
+ sal_uLong ImplGetRealSize() const { return mnRealSize; }
+ void ImplSetRealSize( sal_uLong nRealSize ) { mnRealSize = nRealSize; }
- inline Point& operator[]( ULONG nPos );
- inline const Point& operator[]( ULONG nPos ) const;
+ inline Point& operator[]( sal_uLong nPos );
+ inline const Point& operator[]( sal_uLong nPos ) const;
void ImplCreatePoly( Polygon& rPoly ) const;
};
@@ -201,9 +201,9 @@ ImplPointArray::~ImplPointArray()
// -----------------------------------------------------------------------------
-void ImplPointArray::ImplSetSize( ULONG nSize )
+void ImplPointArray::ImplSetSize( sal_uLong nSize )
{
- const ULONG nTotal = nSize * sizeof( Point );
+ const sal_uLong nTotal = nSize * sizeof( Point );
mnSize = nSize;
mnRealSize = 0UL;
@@ -217,7 +217,7 @@ void ImplPointArray::ImplSetSize( ULONG nSize )
// -----------------------------------------------------------------------------
-inline Point& ImplPointArray::operator[]( ULONG nPos )
+inline Point& ImplPointArray::operator[]( sal_uLong nPos )
{
DBG_ASSERT( nPos < mnSize, "ImplPointArray::operator[]: nPos out of range!" );
return mpArray[ nPos ];
@@ -225,7 +225,7 @@ inline Point& ImplPointArray::operator[]( ULONG nPos )
// -----------------------------------------------------------------------------
-inline const Point& ImplPointArray::operator[]( ULONG nPos ) const
+inline const Point& ImplPointArray::operator[]( sal_uLong nPos ) const
{
DBG_ASSERT( nPos < mnSize, "ImplPointArray::operator[]: nPos out of range!" );
return mpArray[ nPos ];
@@ -235,7 +235,7 @@ inline const Point& ImplPointArray::operator[]( ULONG nPos ) const
void ImplPointArray::ImplCreatePoly( Polygon& rPoly ) const
{
- rPoly = Polygon( sal::static_int_cast<USHORT>(mnRealSize), mpArray );
+ rPoly = Polygon( sal::static_int_cast<sal_uInt16>(mnRealSize), mpArray );
}
// ---------------
@@ -261,12 +261,12 @@ public:
inline long Width() const { return mnWidth; }
inline long Height() const { return mnHeight; }
- inline void Set( long nY, long nX, BYTE cVal );
- inline BYTE Get( long nY, long nX ) const;
+ inline void Set( long nY, long nX, sal_uInt8 cVal );
+ inline sal_uInt8 Get( long nY, long nX ) const;
- inline BOOL IsFree( long nY, long nX ) const;
- inline BOOL IsCont( long nY, long nX ) const;
- inline BOOL IsDone( long nY, long nX ) const;
+ inline sal_Bool IsFree( long nY, long nX ) const;
+ inline sal_Bool IsCont( long nY, long nX ) const;
+ inline sal_Bool IsDone( long nY, long nX ) const;
};
@@ -298,36 +298,36 @@ ImplVectMap::~ImplVectMap()
// -----------------------------------------------------------------------------
-inline void ImplVectMap::Set( long nY, long nX, BYTE cVal )
+inline void ImplVectMap::Set( long nY, long nX, sal_uInt8 cVal )
{
- const BYTE cShift = sal::static_int_cast<BYTE>(6 - ( ( nX & 3 ) << 1 ));
+ const sal_uInt8 cShift = sal::static_int_cast<sal_uInt8>(6 - ( ( nX & 3 ) << 1 ));
( ( mpScan[ nY ][ nX >> 2 ] ) &= ~( 3 << cShift ) ) |= ( cVal << cShift );
}
// -----------------------------------------------------------------------------
-inline BYTE ImplVectMap::Get( long nY, long nX ) const
+inline sal_uInt8 ImplVectMap::Get( long nY, long nX ) const
{
- return sal::static_int_cast<BYTE>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
+ return sal::static_int_cast<sal_uInt8>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsFree( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsFree( long nY, long nX ) const
{
return( VECT_FREE_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsCont( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsCont( long nY, long nX ) const
{
return( VECT_CONT_INDEX == Get( nY, nX ) );
}
// -----------------------------------------------------------------------------
-inline BOOL ImplVectMap::IsDone( long nY, long nX ) const
+inline sal_Bool ImplVectMap::IsDone( long nY, long nX ) const
{
return( VECT_DONE_INDEX == Get( nY, nX ) );
}
@@ -342,10 +342,10 @@ private:
Polygon maPoly;
Point maStartPt;
- ULONG mnArraySize;
- ULONG mnCount;
+ sal_uLong mnArraySize;
+ sal_uLong mnCount;
long mnResize;
- BYTE* mpCodes;
+ sal_uInt8* mpCodes;
void ImplGetSpace();
@@ -356,25 +356,25 @@ private:
public:
- ImplChain( ULONG nInitCount = 1024UL, long nResize = -1L );
+ ImplChain( sal_uLong nInitCount = 1024UL, long nResize = -1L );
~ImplChain();
void ImplBeginAdd( const Point& rStartPt );
- inline void ImplAdd( BYTE nCode );
- void ImplEndAdd( ULONG nTypeFlag );
+ inline void ImplAdd( sal_uInt8 nCode );
+ void ImplEndAdd( sal_uLong nTypeFlag );
const Polygon& ImplGetPoly() const { return maPoly; }
};
// -----------------------------------------------------------------------------
-ImplChain::ImplChain( ULONG nInitCount, long nResize ) :
+ImplChain::ImplChain( sal_uLong nInitCount, long nResize ) :
mnArraySize ( nInitCount ),
mnCount ( 0UL ),
mnResize ( nResize )
{
DBG_ASSERT( nInitCount && nResize, "ImplChain::ImplChain(): invalid parameters!" );
- mpCodes = new BYTE[ mnArraySize ];
+ mpCodes = new sal_uInt8[ mnArraySize ];
}
// -----------------------------------------------------------------------------
@@ -388,11 +388,11 @@ ImplChain::~ImplChain()
void ImplChain::ImplGetSpace()
{
- const ULONG nOldArraySize = mnArraySize;
- BYTE* pNewCodes;
+ const sal_uLong nOldArraySize = mnArraySize;
+ sal_uInt8* pNewCodes;
- mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (ULONG) mnResize );
- pNewCodes = new BYTE[ mnArraySize ];
+ mnArraySize = ( mnResize < 0L ) ? ( mnArraySize << 1UL ) : ( mnArraySize + (sal_uLong) mnResize );
+ pNewCodes = new sal_uInt8[ mnArraySize ];
memcpy( pNewCodes, mpCodes, nOldArraySize );
delete[] mpCodes;
mpCodes = pNewCodes;
@@ -409,7 +409,7 @@ void ImplChain::ImplBeginAdd( const Point& rStartPt )
// -----------------------------------------------------------------------------
-inline void ImplChain::ImplAdd( BYTE nCode )
+inline void ImplChain::ImplAdd( sal_uInt8 nCode )
{
if( mnCount == mnArraySize )
ImplGetSpace();
@@ -419,7 +419,7 @@ inline void ImplChain::ImplAdd( BYTE nCode )
// -----------------------------------------------------------------------------
-void ImplChain::ImplEndAdd( ULONG nFlag )
+void ImplChain::ImplEndAdd( sal_uLong nFlag )
{
if( mnCount )
{
@@ -434,15 +434,15 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- USHORT i, nPolyPos;
+ sal_uInt16 i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- const BYTE cMove = mpCodes[ i ];
- const BYTE cNextMove = mpCodes[ i + 1 ];
+ const sal_uInt8 cMove = mpCodes[ i ];
+ const sal_uInt8 cNextMove = mpCodes[ i + 1 ];
const ChainMove& rMove = aImplMove[ cMove ];
const ChainMove& rMoveInner = aImplMoveInner[ cMove ];
// Point& rPt = aArr[ nPolyPos ];
- BOOL bDone = TRUE;
+ sal_Bool bDone = sal_True;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -500,7 +500,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
else if( cMove == 7 && cNextMove == 0 )
{
@@ -519,7 +519,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY;
}
else
- bDone = FALSE;
+ bDone = sal_False;
if( !bDone )
{
@@ -541,15 +541,15 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
nFirstY = nLastY = maStartPt.Y();
aArr.ImplSetSize( mnCount << 1 );
- USHORT i, nPolyPos;
+ sal_uInt16 i, nPolyPos;
for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
{
- const BYTE cMove = mpCodes[ i ];
- const BYTE cNextMove = mpCodes[ i + 1 ];
+ const sal_uInt8 cMove = mpCodes[ i ];
+ const sal_uInt8 cNextMove = mpCodes[ i + 1 ];
const ChainMove& rMove = aImplMove[ cMove ];
const ChainMove& rMoveOuter = aImplMoveOuter[ cMove ];
// Point& rPt = aArr[ nPolyPos ];
- BOOL bDone = TRUE;
+ sal_Bool bDone = sal_True;
nLastX += rMove.nDX;
nLastY += rMove.nDY;
@@ -607,7 +607,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY - 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
else if( cMove == 7 && cNextMove == 3 )
{
@@ -626,7 +626,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr[ nPolyPos++ ].Y() = nLastY + 1;
}
else
- bDone = FALSE;
+ bDone = sal_False;
if( !bDone )
{
@@ -646,7 +646,7 @@ void ImplChain::ImplEndAdd( ULONG nFlag )
aArr.ImplSetSize( mnCount + 1 );
aArr[ 0 ] = Point( nLastX, nLastY );
- for( ULONG i = 0; i < mnCount; )
+ for( sal_uLong i = 0; i < mnCount; )
{
const ChainMove& rMove = aImplMove[ mpCodes[ i ] ];
aArr[ ++i ] = Point( nLastX += rMove.nDX, nLastY += rMove.nDY );
@@ -669,9 +669,9 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
ImplPointArray aNewArr2;
Point* pLast;
Point* pLeast;
- ULONG nNewPos;
- ULONG nCount = rArr.ImplGetRealSize();
- ULONG n;
+ sal_uLong nNewPos;
+ sal_uLong nCount = rArr.ImplGetRealSize();
+ sal_uLong n;
// pass 1
aNewArr1.ImplSetSize( nCount );
@@ -738,10 +738,10 @@ ImplVectorizer::~ImplVectorizer()
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- BYTE cReduce, ULONG nFlags, const Link* pProgress )
+sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
+ sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
VECT_PROGRESS( pProgress, 0 );
@@ -755,9 +755,9 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
double fPercentStep_2 = 0.0;
const long nWidth = pRAcc->Width();
const long nHeight = pRAcc->Height();
- const USHORT nColorCount = pRAcc->GetPaletteEntryCount();
- USHORT n;
- ImplColorSet* pColorSet = (ImplColorSet*) new BYTE[ 256 * sizeof( ImplColorSet ) ];
+ const sal_uInt16 nColorCount = pRAcc->GetPaletteEntryCount();
+ sal_uInt16 n;
+ ImplColorSet* pColorSet = (ImplColorSet*) new sal_uInt8[ 256 * sizeof( ImplColorSet ) ];
memset( pColorSet, 0, 256 * sizeof( ImplColorSet ) );
rMtf.Clear();
@@ -784,11 +784,11 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
VECT_PROGRESS( pProgress, FRound( fPercent += 10.0 ) );
- for( USHORT i = 0; i < n; i++ )
+ for( sal_uInt16 i = 0; i < n; i++ )
{
const BitmapColor aBmpCol( pRAcc->GetPaletteColor( pColorSet[ i ].mnIndex ) );
const Color aFindColor( aBmpCol.GetRed(), aBmpCol.GetGreen(), aBmpCol.GetBlue() );
-// const BYTE cLum = aFindColor.GetLuminance();
+// const sal_uInt8 cLum = aFindColor.GetLuminance();
ImplVectMap* pMap = ImplExpand( pRAcc, aFindColor );
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
@@ -808,8 +808,8 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
if( aPolyPoly.Count() )
{
- rMtf.AddAction( new MetaLineColorAction( aFindColor, TRUE ) );
- rMtf.AddAction( new MetaFillColorAction( aFindColor, TRUE ) );
+ rMtf.AddAction( new MetaLineColorAction( aFindColor, sal_True ) );
+ rMtf.AddAction( new MetaFillColorAction( aFindColor, sal_True ) );
rMtf.AddAction( new MetaPolyPolygonAction( aPolyPoly ) );
}
}
@@ -818,7 +818,7 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
VECT_PROGRESS( pProgress, FRound( fPercent += fPercentStep_2 ) );
}
- delete[] (BYTE*) pColorSet;
+ delete[] (sal_uInt8*) pColorSet;
if( rMtf.GetActionCount() )
{
@@ -830,7 +830,7 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
rMtf.SetPrefSize( Size( nWidth + 2, nHeight + 2 ) );
rMtf.Move( 1, 1 );
rMtf.Scale( aLogSize1.Width(), aLogSize1.Height() );
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -843,14 +843,14 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
+sal_Bool ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
PolyPolygon& rPolyPoly,
- ULONG nFlags, const Link* pProgress )
+ sal_uLong nFlags, const Link* pProgress )
{
Bitmap* pBmp = new Bitmap( rMonoBmp );
BitmapReadAccess* pRAcc;
ImplVectMap* pMap;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
VECT_PROGRESS( pProgress, 10 );
@@ -924,13 +924,13 @@ BOOL ImplVectorizer::ImplVectorize( const Bitmap& rMonoBmp,
// put outmost polygon to the front
if( nFirstPoly > 0 )
{
- const Polygon aFirst( rPolyPoly.GetObject( static_cast< USHORT >( nFirstPoly ) ) );
+ const Polygon aFirst( rPolyPoly.GetObject( static_cast< sal_uInt16 >( nFirstPoly ) ) );
- rPolyPoly.Remove( static_cast< USHORT >( nFirstPoly ) );
+ rPolyPoly.Remove( static_cast< sal_uInt16 >( nFirstPoly ) );
rPolyPoly.Insert( aFirst, 0 );
}
- bRet = TRUE;
+ bRet = sal_True;
}
VECT_PROGRESS( pProgress, 100 );
@@ -946,14 +946,14 @@ void ImplVectorizer::ImplLimitPolyPoly( PolyPolygon& rPolyPoly )
{
PolyPolygon aNewPolyPoly;
long nReduce = 0;
- USHORT nNewCount;
+ sal_uInt16 nNewCount;
do
{
aNewPolyPoly.Clear();
nReduce++;
- for( USHORT i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
{
const Rectangle aBound( rPolyPoly[ i ].GetBoundRect() );
@@ -1067,14 +1067,14 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r
// -----------------------------------------------------------------------------
-void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, BYTE cReduce, ULONG nFlags )
+void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags )
{
const long nWidth = pMap->Width(), nHeight= pMap->Height();
for( long nY = 0L; nY < nHeight; nY++ )
{
long nX = 0L;
- BOOL bInner = TRUE;
+ sal_Bool bInner = sal_True;
while( nX < nWidth )
{
@@ -1136,15 +1136,15 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, B
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
+sal_Bool ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain )
{
long nActX = rStartPt.X();
long nActY = rStartPt.Y();
long nTryX;
long nTryY;
- ULONG nFound;
- ULONG nLastDir = 0UL;
- ULONG nDir;
+ sal_uLong nFound;
+ sal_uLong nLastDir = 0UL;
+ sal_uLong nDir;
do
{
@@ -1156,7 +1156,7 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (BYTE) nLastDir );
+ rChain.ImplAdd( (sal_uInt8) nLastDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
}
@@ -1173,7 +1173,7 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
if( pMap->IsCont( nTryY, nTryX ) )
{
- rChain.ImplAdd( (BYTE) nDir );
+ rChain.ImplAdd( (sal_uInt8) nDir );
pMap->Set( nActY = nTryY, nActX = nTryX, VECT_DONE_INDEX );
nFound = 1UL;
nLastDir = nDir;
@@ -1185,21 +1185,21 @@ BOOL ImplVectorizer::ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, Im
}
while( nFound );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------------
-BOOL ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
+sal_Bool ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
{
if( pMap->IsDone( nY - 1L, nX ) )
- return TRUE;
+ return sal_True;
else if( pMap->IsDone( nY + 1L, nX ) )
- return FALSE;
+ return sal_False;
else if( pMap->IsDone( nY - 1L, nX - 1L ) || pMap->IsDone( nY - 1L, nX + 1L ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index cf81e1799494..56591e969b8b 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -45,9 +45,9 @@ class ImplVectorizer
private:
ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor );
- void ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, BYTE cReduce, ULONG nFlags );
- BOOL ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain );
- BOOL ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const;
+ void ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, sal_uInt8 cReduce, sal_uLong nFlags );
+ sal_Bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain );
+ sal_Bool ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const;
void ImplLimitPolyPoly( PolyPolygon& rPolyPoly );
public:
@@ -55,10 +55,10 @@ public:
ImplVectorizer();
~ImplVectorizer();
- BOOL ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- BYTE cReduce, ULONG nFlags, const Link* pProgress );
- BOOL ImplVectorize( const Bitmap& rMonoBmp, PolyPolygon& rPolyPoly,
- ULONG nFlags, const Link* pProgress );
+ sal_Bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
+ sal_uInt8 cReduce, sal_uLong nFlags, const Link* pProgress );
+ sal_Bool ImplVectorize( const Bitmap& rMonoBmp, PolyPolygon& rPolyPoly,
+ sal_uLong nFlags, const Link* pProgress );
};
#endif
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 56b9c27b7048..34cd27b270cd 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -39,8 +39,8 @@
DBG_NAME( JobSetup )
#define JOBSET_FILEFORMAT2 3780
-#define JOBSET_FILE364_SYSTEM ((USHORT)0xFFFF)
-#define JOBSET_FILE605_SYSTEM ((USHORT)0xFFFE)
+#define JOBSET_FILE364_SYSTEM ((sal_uInt16)0xFFFF)
+#define JOBSET_FILE605_SYSTEM ((sal_uInt16)0xFFFE)
struct ImplOldJobSetupData
{
@@ -95,7 +95,7 @@ ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) :
mnDriverDataLen = rJobSetup.mnDriverDataLen;
if ( rJobSetup.mpDriverData )
{
- mpDriverData = (BYTE*)rtl_allocateMemory( mnDriverDataLen );
+ mpDriverData = (sal_uInt8*)rtl_allocateMemory( mnDriverDataLen );
memcpy( mpDriverData, rJobSetup.mpDriverData, mnDriverDataLen );
}
else
@@ -258,16 +258,16 @@ JobSetup& JobSetup::operator=( const JobSetup& rJobSetup )
// -----------------------------------------------------------------------
-BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
+sal_Bool JobSetup::operator==( const JobSetup& rJobSetup ) const
{
DBG_CHKTHIS( JobSetup, NULL );
DBG_CHKOBJ( &rJobSetup, JobSetup, NULL );
if ( mpData == rJobSetup.mpData )
- return TRUE;
+ return sal_True;
if ( !mpData || !rJobSetup.mpData )
- return FALSE;
+ return sal_False;
ImplJobSetup* pData1 = mpData;
ImplJobSetup* pData2 = rJobSetup.mpData;
@@ -284,9 +284,9 @@ BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
(memcmp( pData1->mpDriverData, pData2->mpDriverData, pData1->mnDriverDataLen ) == 0) &&
(pData1->maValueMap == pData2->maValueMap)
)
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -296,8 +296,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
DBG_ASSERTWARNING( rIStream.GetVersion(), "JobSetup::>> - Solar-Version not set on rOStream" );
{
- USHORT nLen(0);
- USHORT nSystem;
+ sal_uInt16 nLen(0);
+ sal_uInt16 nSystem;
sal_Size nFirstPos = rIStream.Tell();
rIStream >> nLen;
if ( !nLen )
@@ -330,7 +330,7 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
nSystem == JOBSET_FILE605_SYSTEM )
{
Impl364JobSetupData* pOldJobData = (Impl364JobSetupData*)(pTempBuf + sizeof( ImplOldJobSetupData ));
- USHORT nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
+ sal_uInt16 nOldJobDataSize = SVBT16ToShort( pOldJobData->nSize );
pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem );
pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen );
pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation );
@@ -341,8 +341,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
pJobData->mnPaperHeight = (long)SVBT32ToUInt32( pOldJobData->nPaperHeight );
if ( pJobData->mnDriverDataLen )
{
- BYTE* pDriverData = ((BYTE*)pOldJobData) + nOldJobDataSize;
- pJobData->mpDriverData = (BYTE*)rtl_allocateMemory( pJobData->mnDriverDataLen );
+ sal_uInt8* pDriverData = ((sal_uInt8*)pOldJobData) + nOldJobDataSize;
+ pJobData->mpDriverData = (sal_uInt8*)rtl_allocateMemory( pJobData->mnDriverDataLen );
memcpy( pJobData->mpDriverData, pDriverData, pJobData->mnDriverDataLen );
}
if( nSystem == JOBSET_FILE605_SYSTEM )
@@ -388,24 +388,24 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
// Zur Zeit haben wir noch kein neues FileFormat
// if ( rOStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
- USHORT nLen = 0;
+ sal_uInt16 nLen = 0;
if ( !rJobSetup.mpData )
rOStream << nLen;
else
{
- USHORT nSystem = JOBSET_FILE605_SYSTEM;
+ sal_uInt16 nSystem = JOBSET_FILE605_SYSTEM;
const ImplJobSetup* pJobData = rJobSetup.ImplGetConstData();
Impl364JobSetupData aOldJobData;
- USHORT nOldJobDataSize = sizeof( aOldJobData );
+ sal_uInt16 nOldJobDataSize = sizeof( aOldJobData );
ShortToSVBT16( nOldJobDataSize, aOldJobData.nSize );
ShortToSVBT16( pJobData->mnSystem, aOldJobData.nSystem );
UInt32ToSVBT32( pJobData->mnDriverDataLen, aOldJobData.nDriverDataLen );
- ShortToSVBT16( (USHORT)(pJobData->meOrientation), aOldJobData.nOrientation );
+ ShortToSVBT16( (sal_uInt16)(pJobData->meOrientation), aOldJobData.nOrientation );
ShortToSVBT16( pJobData->mnPaperBin, aOldJobData.nPaperBin );
- ShortToSVBT16( (USHORT)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
- UInt32ToSVBT32( (ULONG)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
- UInt32ToSVBT32( (ULONG)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
+ ShortToSVBT16( (sal_uInt16)(pJobData->mePaperFormat), aOldJobData.nPaperFormat );
+ UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperWidth), aOldJobData.nPaperWidth );
+ UInt32ToSVBT32( (sal_uLong)(pJobData->mnPaperHeight), aOldJobData.nPaperHeight );
ImplOldJobSetupData aOldData;
memset( &aOldData, 0, sizeof( aOldData ) );
@@ -434,7 +434,7 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
}
- nLen = sal::static_int_cast<USHORT>(rOStream.Tell() - nPos);
+ nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);
rOStream.Seek( nPos );
rOStream << nLen;
rOStream.Seek( nPos + nLen );
diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx
index 8b97c2ecdbff..542c3103eb27 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -71,6 +71,20 @@ ImplLineInfo::ImplLineInfo( const ImplLineInfo& rImplLineInfo ) :
{
}
+// -----------------------------------------------------------------------
+
+inline bool ImplLineInfo::operator==( const ImplLineInfo& rB ) const
+{
+ return(meStyle == rB.meStyle
+ && mnWidth == rB.mnWidth
+ && mnDashCount == rB.mnDashCount
+ && mnDashLen == rB.mnDashLen
+ && mnDotCount == rB.mnDotCount
+ && mnDotLen == rB.mnDotLen
+ && mnDistance == rB.mnDistance
+ && meLineJoin == rB.meLineJoin);
+}
+
// ------------
// - LineInfo -
// ------------
@@ -120,19 +134,13 @@ LineInfo& LineInfo::operator=( const LineInfo& rLineInfo )
// -----------------------------------------------------------------------
-BOOL LineInfo::operator==( const LineInfo& rLineInfo ) const
+sal_Bool LineInfo::operator==( const LineInfo& rLineInfo ) const
{
DBG_CHKTHIS( LineInfo, NULL );
DBG_CHKOBJ( &rLineInfo, LineInfo, NULL );
return( mpImplLineInfo == rLineInfo.mpImplLineInfo ||
- ( mpImplLineInfo->meStyle == rLineInfo.mpImplLineInfo->meStyle &&
- mpImplLineInfo->mnWidth == rLineInfo.mpImplLineInfo->mnWidth &&
- mpImplLineInfo->mnDashCount == rLineInfo.mpImplLineInfo->mnDashCount &&
- mpImplLineInfo->mnDashLen == rLineInfo.mpImplLineInfo->mnDashLen &&
- mpImplLineInfo->mnDotCount == rLineInfo.mpImplLineInfo->mnDotCount &&
- mpImplLineInfo->mnDotLen == rLineInfo.mpImplLineInfo->mnDotLen &&
- mpImplLineInfo->mnDistance == rLineInfo.mpImplLineInfo->mnDistance ) );
+ *mpImplLineInfo == *rLineInfo.mpImplLineInfo );
}
// -----------------------------------------------------------------------
@@ -168,7 +176,7 @@ void LineInfo::SetWidth( long nWidth )
// -----------------------------------------------------------------------
-void LineInfo::SetDashCount( USHORT nDashCount )
+void LineInfo::SetDashCount( sal_uInt16 nDashCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -186,7 +194,7 @@ void LineInfo::SetDashLen( long nDashLen )
// -----------------------------------------------------------------------
-void LineInfo::SetDotCount( USHORT nDotCount )
+void LineInfo::SetDotCount( sal_uInt16 nDotCount )
{
DBG_CHKTHIS( LineInfo, NULL );
ImplMakeUnique();
@@ -229,7 +237,7 @@ void LineInfo::SetLineJoin(basegfx::B2DLineJoin eLineJoin)
SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplLineInfo.meStyle = (LineStyle) nTmp16;
rIStm >> rImplLineInfo.mnWidth;
@@ -258,7 +266,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
// version 1
- rOStm << (UINT16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
+ rOStm << (sal_uInt16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
// since version2
rOStm << rImplLineInfo.mnDashCount << rImplLineInfo.mnDashLen;
@@ -266,7 +274,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
rOStm << rImplLineInfo.mnDistance;
// since version3
- rOStm << (UINT16) rImplLineInfo.meLineJoin;
+ rOStm << (sal_uInt16) rImplLineInfo.meLineJoin;
return rOStm;
}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index ee12daa8b53c..d01c46a77ca0 100644..100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -88,6 +88,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/pdffontcache.obj\
$(SLO)$/pdfwriter.obj \
$(SLO)$/pdfwriter_impl.obj \
+ $(SLO)$/pdfwriter_impl2.obj \
$(SLO)$/pngread.obj \
$(SLO)$/pngwrite.obj \
$(SLO)$/print.obj \
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index 31486c1aad05..ae7b13ca25b7 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -46,7 +46,7 @@ ImplMapMode::ImplMapMode() :
{
mnRefCount = 1;
meUnit = MAP_PIXEL;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
// -----------------------------------------------------------------------
@@ -58,7 +58,7 @@ ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) :
{
mnRefCount = 1;
meUnit = rImplMapMode.meUnit;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
// -----------------------------------------------------------------------
@@ -66,7 +66,7 @@ ImplMapMode::ImplMapMode( const ImplMapMode& rImplMapMode ) :
SvStream& operator>>( SvStream& rIStm, ImplMapMode& rImplMapMode )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
rIStm >> nTmp16; rImplMapMode.meUnit = (MapUnit) nTmp16;
rIStm >> rImplMapMode.maOrigin >> rImplMapMode.maScaleX >>
@@ -81,7 +81,7 @@ SvStream& operator<<( SvStream& rOStm, const ImplMapMode& rImplMapMode )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
- rOStm << (UINT16) rImplMapMode.meUnit <<
+ rOStm << (sal_uInt16) rImplMapMode.meUnit <<
rImplMapMode.maOrigin <<
rImplMapMode.maScaleX <<
rImplMapMode.maScaleY <<
@@ -107,7 +107,7 @@ ImplMapMode* ImplMapMode::ImplGetStaticMapMode( MapUnit eUnit )
pImplMapMode->maScaleX = aDefFraction;
pImplMapMode->maScaleY = aDefFraction;
pImplMapMode->meUnit = eUnit;
- pImplMapMode->mbSimple = TRUE;
+ pImplMapMode->mbSimple = sal_True;
}
return pImplMapMode;
@@ -260,40 +260,40 @@ MapMode& MapMode::operator=( const MapMode& rMapMode )
// -----------------------------------------------------------------------
-BOOL MapMode::operator==( const MapMode& rMapMode ) const
+sal_Bool MapMode::operator==( const MapMode& rMapMode ) const
{
DBG_CHKTHIS( MapMode, NULL );
DBG_CHKOBJ( &rMapMode, MapMode, NULL );
if ( mpImplMapMode == rMapMode.mpImplMapMode )
- return TRUE;
+ return sal_True;
if ( (mpImplMapMode->meUnit == rMapMode.mpImplMapMode->meUnit) &&
(mpImplMapMode->maOrigin == rMapMode.mpImplMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == rMapMode.mpImplMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == rMapMode.mpImplMapMode->maScaleY) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL MapMode::IsDefault() const
+sal_Bool MapMode::IsDefault() const
{
DBG_CHKTHIS( MapMode, NULL );
ImplMapMode* pDefMapMode = ImplMapMode::ImplGetStaticMapMode( MAP_PIXEL );
if ( mpImplMapMode == pDefMapMode )
- return TRUE;
+ return sal_True;
if ( (mpImplMapMode->meUnit == pDefMapMode->meUnit) &&
(mpImplMapMode->maOrigin == pDefMapMode->maOrigin) &&
(mpImplMapMode->maScaleX == pDefMapMode->maScaleX) &&
(mpImplMapMode->maScaleY == pDefMapMode->maScaleY) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 6f9d1a85e510..feba437c7c2f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -66,7 +66,7 @@ inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY )
inline void ImplScalePoly( Polygon& rPoly, double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
}
@@ -103,7 +103,7 @@ MetaAction::MetaAction() :
// ------------------------------------------------------------------------
-MetaAction::MetaAction( USHORT nType ) :
+MetaAction::MetaAction( sal_uInt16 nType ) :
mnRefCount( 1 ),
mnType( nType )
{
@@ -176,7 +176,7 @@ void MetaAction::Read( SvStream& rIStm, ImplMetaReadData* )
MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData )
{
MetaAction* pAction = NULL;
- UINT16 nType;
+ sal_uInt16 nType;
rIStm >> nType;
@@ -309,7 +309,7 @@ void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maPt;
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
}
// ------------------------------------------------------------------------
@@ -318,7 +318,7 @@ void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maPt;
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
}
// ========================================================================
@@ -1133,7 +1133,7 @@ void MetaPolyPolygonAction::Move( long nHorzMove, long nVertMove )
void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -1206,7 +1206,7 @@ IMPL_META_ACTION( Text, META_TEXT_ACTION )
// ------------------------------------------------------------------------
MetaTextAction::MetaTextAction( const Point& rPt, const XubString& rStr,
- USHORT nIndex, USHORT nLen ) :
+ sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_TEXT_ACTION ),
maPt ( rPt ),
maStr ( rStr ),
@@ -1315,7 +1315,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
{
if( rAction.mpDXAry )
{
- const ULONG nAryLen = mnLen;
+ const sal_uLong nAryLen = mnLen;
mpDXAry = new sal_Int32[ nAryLen ];
memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) );
@@ -1329,15 +1329,15 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
const XubString& rStr,
const sal_Int32* pDXAry,
- USHORT nIndex,
- USHORT nLen ) :
+ sal_uInt16 nIndex,
+ sal_uInt16 nLen ) :
MetaAction ( META_TEXTARRAY_ACTION ),
maStartPt ( rStartPt ),
maStr ( rStr ),
mnIndex ( nIndex ),
mnLen ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
{
- const ULONG nAryLen = pDXAry ? mnLen : 0;
+ const sal_uLong nAryLen = pDXAry ? mnLen : 0;
if( nAryLen )
{
@@ -1386,7 +1386,7 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
if ( mpDXAry && mnLen )
{
- for ( USHORT i = 0, nCount = mnLen; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) );
}
}
@@ -1415,7 +1415,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm << mnLen;
rOStm << nAryLen;
- for( ULONG i = 0UL; i < nAryLen; i++ )
+ for( sal_uLong i = 0UL; i < nAryLen; i++ )
rOStm << mpDXAry[ i ];
sal_uInt16 j, nLen = maStr.Len(); // version 2
@@ -1457,7 +1457,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
if ( mpDXAry )
{
- ULONG i;
+ sal_uLong i;
for( i = 0UL; i < nAryLen; i++ )
rIStm >> mpDXAry[ i ];
@@ -1499,7 +1499,7 @@ IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
const XubString& rStr,
- USHORT nIndex, USHORT nLen ) :
+ sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_STRETCHTEXT_ACTION ),
maPt ( rPt ),
maStr ( rStr ),
@@ -1537,7 +1537,7 @@ void MetaStretchTextAction::Move( long nHorzMove, long nVertMove )
void MetaStretchTextAction::Scale( double fScaleX, double fScaleY )
{
ImplScalePoint( maPt, fScaleX, fScaleY );
- mnWidth = (ULONG)FRound( mnWidth * fabs(fScaleX) );
+ mnWidth = (sal_uLong)FRound( mnWidth * fabs(fScaleX) );
}
// ------------------------------------------------------------------------
@@ -1599,7 +1599,7 @@ IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
// ------------------------------------------------------------------------
MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle ) :
+ const XubString& rStr, sal_uInt16 nStyle ) :
MetaAction ( META_TEXTRECT_ACTION ),
maRect ( rRect ),
maStr ( rStr ),
@@ -2457,7 +2457,7 @@ void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
rOStm << maBmp;
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
}
}
@@ -2468,7 +2468,7 @@ void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
rIStm >> maBmp;
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
}
@@ -2589,7 +2589,7 @@ void MetaGradientExAction::Move( long nHorzMove, long nVertMove )
void MetaGradientExAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2663,7 +2663,7 @@ void MetaHatchAction::Move( long nHorzMove, long nVertMove )
void MetaHatchAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -2771,7 +2771,7 @@ IMPL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
// ------------------------------------------------------------------------
-MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, BOOL bClip ) :
+MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, sal_Bool bClip ) :
MetaAction ( META_CLIPREGION_ACTION ),
maRegion ( rRegion ),
mbClip ( bClip )
@@ -3032,7 +3032,7 @@ IMPL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaLineColorAction::MetaLineColorAction( const Color& rColor, BOOL bSet ) :
+MetaLineColorAction::MetaLineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_LINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3071,7 +3071,7 @@ sal_Bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3080,7 +3080,7 @@ void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3090,7 +3090,7 @@ IMPL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaFillColorAction::MetaFillColorAction( const Color& rColor, BOOL bSet ) :
+MetaFillColorAction::MetaFillColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_FILLCOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3129,7 +3129,7 @@ sal_Bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3138,7 +3138,7 @@ void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3182,7 +3182,7 @@ sal_Bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
}
// ------------------------------------------------------------------------
@@ -3190,7 +3190,7 @@ void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
}
// ========================================================================
@@ -3199,7 +3199,7 @@ IMPL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, BOOL bSet ) :
+MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_TEXTFILLCOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3238,7 +3238,7 @@ sal_Bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3247,7 +3247,7 @@ void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3257,7 +3257,7 @@ IMPL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, BOOL bSet ) :
+MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_TEXTLINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3296,7 +3296,7 @@ sal_Bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3305,7 +3305,7 @@ void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3315,7 +3315,7 @@ IMPL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
// ------------------------------------------------------------------------
-MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, BOOL bSet ) :
+MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, sal_Bool bSet ) :
MetaAction ( META_OVERLINECOLOR_ACTION ),
maColor ( rColor ),
mbSet ( bSet )
@@ -3354,7 +3354,7 @@ sal_Bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const
void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- maColor.Write( rOStm, TRUE );
+ maColor.Write( rOStm, sal_True );
rOStm << mbSet;
}
@@ -3363,7 +3363,7 @@ void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maColor.Read( rIStm, TRUE );
+ maColor.Read( rIStm, sal_True );
rIStm >> mbSet;
}
@@ -3407,14 +3407,14 @@ sal_Bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const
void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << (UINT16) maAlign;
+ rOStm << (sal_uInt16) maAlign;
}
// ------------------------------------------------------------------------
void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; maAlign = (TextAlign) nTmp16;
@@ -3564,7 +3564,7 @@ IMPL_META_ACTION( Push, META_PUSH_ACTION )
// ------------------------------------------------------------------------
-MetaPushAction::MetaPushAction( USHORT nFlags ) :
+MetaPushAction::MetaPushAction( sal_uInt16 nFlags ) :
MetaAction ( META_PUSH_ACTION ),
mnFlags ( nFlags )
{
@@ -3683,14 +3683,14 @@ sal_Bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const
void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << (UINT16) meRasterOp;
+ rOStm << (sal_uInt16) meRasterOp;
}
// ------------------------------------------------------------------------
void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
COMPAT( rIStm );
rIStm >> nTmp16; meRasterOp = (RasterOp) nTmp16;
@@ -3702,7 +3702,7 @@ IMPL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
// ------------------------------------------------------------------------
-MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, USHORT nTransPercent ) :
+MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ) :
MetaAction ( META_TRANSPARENT_ACTION ),
maPolyPoly ( rPolyPoly ),
mnTransPercent ( nTransPercent )
@@ -3736,7 +3736,7 @@ void MetaTransparentAction::Move( long nHorzMove, long nVertMove )
void MetaTransparentAction::Scale( double fScaleX, double fScaleY )
{
- for( USHORT i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
}
@@ -3943,7 +3943,7 @@ IMPL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
// ------------------------------------------------------------------------
-MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, BOOL bSet ) :
+MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet ) :
MetaAction ( META_REFPOINT_ACTION ),
maRefPoint ( rRefPoint ),
mbSet ( bSet )
@@ -4014,7 +4014,7 @@ MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const BYTE* pData, sal_uInt32 nDataSize ) :
+MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
MetaAction ( META_COMMENT_ACTION ),
maComment ( rComment ),
mnValue ( nValue )
@@ -4024,7 +4024,7 @@ MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nVal
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const BYTE* pData, sal_uInt32 nDataSize ) :
+MetaCommentAction::MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ) :
MetaAction ( META_COMMENT_ACTION ),
mnValue ( 0L )
{
@@ -4041,11 +4041,11 @@ MetaCommentAction::~MetaCommentAction()
// ------------------------------------------------------------------------
-void MetaCommentAction::ImplInitDynamicData( const BYTE* pData, sal_uInt32 nDataSize )
+void MetaCommentAction::ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize )
{
if ( nDataSize && pData )
{
- mnDataSize = nDataSize, mpData = new BYTE[ mnDataSize ];
+ mnDataSize = nDataSize, mpData = new sal_uInt8[ mnDataSize ];
memcpy( mpData, pData, mnDataSize );
}
else
@@ -4104,7 +4104,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4147,7 +4147,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << aFill;
}
delete[] mpData;
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
} else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
SvMemoryStream aDest;
@@ -4173,7 +4173,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
aDest << m11 << m12 << m21 << m22 << mdx << mdy;
// save them
- ImplInitDynamicData( static_cast<const BYTE*>( aDest.GetData() ), aDest.Tell() );
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4212,7 +4212,7 @@ void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
if( mnDataSize )
{
- mpData = new BYTE[ mnDataSize ];
+ mpData = new sal_uInt8[ mnDataSize ];
rIStm.Read( mpData, mnDataSize );
}
else
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 5a65b04391f0..4814d6e3114e 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -35,6 +35,8 @@
#include <vector>
#include <set>
+#include <cstdio>
+
// =======================================================================
ImplFontMetric::ImplFontMetric()
@@ -52,6 +54,7 @@ ImplFontMetric::ImplFontMetric()
inline void ImplFontMetric::AddReference()
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
@@ -59,6 +62,7 @@ inline void ImplFontMetric::AddReference()
inline void ImplFontMetric::DeReference()
{
+ // TODO: disable refcounting on the default maps?
if( --mnRefCount <= 0 )
delete this;
}
@@ -123,15 +127,15 @@ FontInfo& FontInfo::operator=( const FontInfo& rInfo )
// -----------------------------------------------------------------------
-BOOL FontInfo::operator==( const FontInfo& rInfo ) const
+sal_Bool FontInfo::operator==( const FontInfo& rInfo ) const
{
if( !Font::operator==( rInfo ) )
- return FALSE;
+ return sal_False;
if( mpImplMetric == rInfo.mpImplMetric )
- return TRUE;
+ return sal_True;
if( *mpImplMetric == *rInfo.mpImplMetric )
- return TRUE;
- return FALSE;
+ return sal_True;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -143,28 +147,28 @@ FontType FontInfo::GetType() const
// -----------------------------------------------------------------------
-BOOL FontInfo::IsDeviceFont() const
+sal_Bool FontInfo::IsDeviceFont() const
{
return mpImplMetric->IsDeviceFont();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsLatin() const
+sal_Bool FontInfo::SupportsLatin() const
{
return mpImplMetric->SupportsLatin();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsCJK() const
+sal_Bool FontInfo::SupportsCJK() const
{
return mpImplMetric->SupportsCJK();
}
// -----------------------------------------------------------------------
-BOOL FontInfo::SupportsCTL() const
+sal_Bool FontInfo::SupportsCTL() const
{
return mpImplMetric->SupportsCTL();
}
@@ -227,7 +231,7 @@ FontMetric& FontMetric::operator =( const FontMetric& rMetric )
// -----------------------------------------------------------------------
-BOOL FontMetric::operator==( const FontMetric& rMetric ) const
+sal_Bool FontMetric::operator==( const FontMetric& rMetric ) const
{
return FontInfo::operator==( rMetric );
}
@@ -236,7 +240,7 @@ BOOL FontMetric::operator==( const FontMetric& rMetric ) const
CmapResult::CmapResult( bool bSymbolic,
const sal_uInt32* pRangeCodes, int nRangeCount,
- const int* pStartGlyphs, const USHORT* pExtraGlyphIds )
+ const int* pStartGlyphs, const sal_uInt16* pExtraGlyphIds )
: mpRangeCodes( pRangeCodes)
, mpStartGlyphs( pStartGlyphs)
, mpGlyphIds( pExtraGlyphIds)
@@ -253,7 +257,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
, mpGlyphIds( rCR.mpGlyphIds )
, mnRangeCount( rCR.mnRangeCount )
, mnCharCount( 0 )
-, mnRefCount( 1 )
+, mnRefCount( 0 )
{
const sal_uInt32* pRangePtr = mpRangeCodes;
for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 )
@@ -264,7 +268,8 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
}
}
-static ImplFontCharMap* pDefaultImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL;
static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0};
static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100};
@@ -285,44 +290,60 @@ ImplFontCharMap::~ImplFontCharMap()
delete[] mpRangeCodes;
delete[] mpStartGlyphs;
delete[] mpGlyphIds;
-}
+ }
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+namespace
{
- if( pDefaultImplFontCharMap )
- pDefaultImplFontCharMap->AddReference();
- else
+ ImplFontCharMap *GetDefaultUnicodeMap()
{
- const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
- int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
- if( bSymbols )
+ if( !pDefaultUnicodeImplFontCharMap )
{
- pRangeCodes = aDefaultSymbolRanges;
- nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
+ int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
+ pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultUnicodeImplFontCharMap->AddReference();
}
- CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 );
- pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ return pDefaultUnicodeImplFontCharMap;
}
- return pDefaultImplFontCharMap;
+ ImplFontCharMap *GetDefaultSymbolMap()
+ {
+ if( !pDefaultSymbolImplFontCharMap )
+ {
+ const sal_uInt32* pRangeCodes = aDefaultSymbolRanges;
+ int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
+ pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ pDefaultSymbolImplFontCharMap->AddReference();
+ }
+
+ return pDefaultSymbolImplFontCharMap;
+ }
+}
+
+ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+{
+ return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap();
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::AddReference()
+void ImplFontCharMap::AddReference( void ) const
{
+ // TODO: disable refcounting on the default maps?
++mnRefCount;
}
// -----------------------------------------------------------------------
-void ImplFontCharMap::DeReference()
+void ImplFontCharMap::DeReference( void ) const
{
if( --mnRefCount <= 0 )
- if( this != pDefaultImplFontCharMap )
+ if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) )
delete this;
}
@@ -607,7 +628,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
sal_uInt32* pCodePairs = NULL;
int* pStartGlyphs = NULL;
- typedef std::vector<USHORT> U16Vector;
+ typedef std::vector<sal_uInt16> U16Vector;
U16Vector aGlyphIdArray;
aGlyphIdArray.reserve( 0x1000 );
aGlyphIdArray.push_back( 0 );
@@ -645,7 +666,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
const unsigned char* pGlyphIdPtr = pOffsetBase + 2*i + nRangeOffset;
for( sal_uInt32 c = cMinChar; c <= cMaxChar; ++c, pGlyphIdPtr+=2 ) {
const int nGlyphIndex = GetUShort( pGlyphIdPtr ) + nGlyphDelta;
- aGlyphIdArray.push_back( static_cast<USHORT>(nGlyphIndex) );
+ aGlyphIdArray.push_back( static_cast<sal_uInt16>(nGlyphIndex) );
}
}
}
@@ -787,11 +808,11 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// prepare the glyphid-array if needed
// TODO: merge ranges if they are close enough?
- USHORT* pGlyphIds = NULL;
+ sal_uInt16* pGlyphIds = NULL;
if( !aGlyphIdArray.empty())
{
- pGlyphIds = new USHORT[ aGlyphIdArray.size() ];
- USHORT* pOut = pGlyphIds;
+ pGlyphIds = new sal_uInt16[ aGlyphIdArray.size() ];
+ sal_uInt16* pOut = pGlyphIds;
U16Vector::const_iterator it = aGlyphIdArray.begin();
while( it != aGlyphIdArray.end() )
*(pOut++) = *(it++);
@@ -809,7 +830,9 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
FontCharMap::FontCharMap()
: mpImpl( ImplFontCharMap::GetDefaultMap() )
-{}
+{
+ mpImpl->AddReference();
+}
// -----------------------------------------------------------------------
@@ -835,31 +858,26 @@ int FontCharMap::CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const
// -----------------------------------------------------------------------
-void FontCharMap::Reset( ImplFontCharMap* pNewMap )
+void FontCharMap::Reset( const ImplFontCharMap* pNewMap )
{
+ mpImpl->DeReference();
if( pNewMap == NULL )
- {
- mpImpl->DeReference();
mpImpl = ImplFontCharMap::GetDefaultMap();
- }
else if( pNewMap != mpImpl )
- {
- mpImpl->DeReference();
mpImpl = pNewMap;
- mpImpl->AddReference();
- }
+ mpImpl->AddReference();
}
// -----------------------------------------------------------------------
-BOOL FontCharMap::IsDefaultMap() const
+sal_Bool FontCharMap::IsDefaultMap() const
{
return mpImpl->IsDefaultMap();
}
// -----------------------------------------------------------------------
-BOOL FontCharMap::HasChar( sal_uInt32 cChar ) const
+sal_Bool FontCharMap::HasChar( sal_uInt32 cChar ) const
{
return mpImpl->HasChar( cChar );
}
diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index 4e5f50124277..c2f0d92f03c3 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -37,18 +37,18 @@
// - pMask -
// ---------
-static BYTE pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+static sal_uInt8 pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
// -------------
// - NodeCache -
// -------------
-ImpNodeCache::ImpNodeCache( const ULONG nInitSize ) :
+ImpNodeCache::ImpNodeCache( const sal_uLong nInitSize ) :
pActNode( NULL )
{
- const ULONG nSize = nInitSize + 4;
+ const sal_uLong nSize = nInitSize + 4;
- for( ULONG i = 0; i < nSize; i++ )
+ for( sal_uLong i = 0; i < nSize; i++ )
{
OctreeNode* pNewNode = new NODE;
@@ -74,7 +74,7 @@ ImpNodeCache::~ImpNodeCache()
// - Octree -
// ----------
-Octree::Octree( ULONG nColors ) :
+Octree::Octree( sal_uLong nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -86,7 +86,7 @@ Octree::Octree( ULONG nColors ) :
// ------------------------------------------------------------------------
-Octree::Octree( const BitmapReadAccess& rReadAcc, ULONG nColors ) :
+Octree::Octree( const BitmapReadAccess& rReadAcc, sal_uLong nColors ) :
nMax ( nColors ),
nLeafCount ( 0L ),
pTree ( NULL ),
@@ -167,7 +167,7 @@ void Octree::ImplCreateOctree()
void Octree::ImplDeleteOctree( PPNODE ppNode )
{
- for ( ULONG i = 0UL; i < 8UL; i++ )
+ for ( sal_uLong i = 0UL; i < 8UL; i++ )
{
if ( (*ppNode)->pChild[ i ] )
ImplDeleteOctree( &(*ppNode)->pChild[ i ] );
@@ -205,9 +205,9 @@ void Octree::ImplAdd( PPNODE ppNode )
}
else
{
- const ULONG nShift = 7 - nLevel;
- const BYTE cMask = pImplMask[ nLevel ];
- const ULONG nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const sal_uLong nShift = 7 - nLevel;
+ const sal_uInt8 cMask = pImplMask[ nLevel ];
+ const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
( ( ( pColor->GetGreen() & cMask ) >> nShift ) << 1 ) |
( ( pColor->GetBlue() & cMask ) >> nShift );
@@ -220,12 +220,12 @@ void Octree::ImplAdd( PPNODE ppNode )
void Octree::ImplReduce()
{
- ULONG i;
+ sal_uLong i;
PNODE pNode;
- ULONG nRedSum = 0L;
- ULONG nGreenSum = 0L;
- ULONG nBlueSum = 0L;
- ULONG nChilds = 0L;
+ sal_uLong nRedSum = 0L;
+ sal_uLong nGreenSum = 0L;
+ sal_uLong nBlueSum = 0L;
+ sal_uLong nChilds = 0L;
for ( i = OCTREE_BITS - 1; i && !pReduce[i]; i-- ) {}
@@ -249,7 +249,7 @@ void Octree::ImplReduce()
}
}
- pNode->bLeaf = TRUE;
+ pNode->bLeaf = sal_True;
pNode->nRed = nRedSum;
pNode->nGreen = nGreenSum;
pNode->nBlue = nBlueSum;
@@ -263,11 +263,11 @@ void Octree::CreatePalette( PNODE pNode )
if( pNode->bLeaf )
{
pNode->nPalIndex = nPalIndex;
- aPal[ nPalIndex++ ] = BitmapColor( (BYTE) ( (double) pNode->nRed / pNode->nCount ),
- (BYTE) ( (double) pNode->nGreen / pNode->nCount ),
- (BYTE) ( (double) pNode->nBlue / pNode->nCount ) );
+ aPal[ nPalIndex++ ] = BitmapColor( (sal_uInt8) ( (double) pNode->nRed / pNode->nCount ),
+ (sal_uInt8) ( (double) pNode->nGreen / pNode->nCount ),
+ (sal_uInt8) ( (double) pNode->nBlue / pNode->nCount ) );
}
- else for( ULONG i = 0UL; i < 8UL; i++ )
+ else for( sal_uLong i = 0UL; i < 8UL; i++ )
if( pNode->pChild[ i ] )
CreatePalette( pNode->pChild[ i ] );
@@ -281,9 +281,9 @@ void Octree::GetPalIndex( PNODE pNode )
nPalIndex = pNode->nPalIndex;
else
{
- const ULONG nShift = 7 - nLevel;
- const BYTE cMask = pImplMask[ nLevel++ ];
- const ULONG nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
+ const sal_uLong nShift = 7 - nLevel;
+ const sal_uInt8 cMask = pImplMask[ nLevel++ ];
+ const sal_uLong nIndex = ( ( ( pColor->GetRed() & cMask ) >> nShift ) << 2 ) |
( ( ( pColor->GetGreen() & cMask ) >> nShift ) << 1 ) |
( ( pColor->GetBlue() & cMask ) >> nShift );
@@ -298,27 +298,27 @@ void Octree::GetPalIndex( PNODE pNode )
InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
nBits( 8 - OCTREE_BITS )
{
- ULONG* cdp;
- BYTE* crgbp;
- const ULONG nColorMax = 1 << OCTREE_BITS;
- const ULONG xsqr = 1 << ( nBits << 1 );
- const ULONG xsqr2 = xsqr << 1;
- const ULONG nColors = rPal.GetEntryCount();
+ sal_uLong* cdp;
+ sal_uInt8* crgbp;
+ const sal_uLong nColorMax = 1 << OCTREE_BITS;
+ const sal_uLong xsqr = 1 << ( nBits << 1 );
+ const sal_uLong xsqr2 = xsqr << 1;
+ const sal_uLong nColors = rPal.GetEntryCount();
const long x = 1L << nBits;
const long x2 = x >> 1L;
- ULONG r, g, b;
+ sal_uLong r, g, b;
long rxx, gxx, bxx;
long rdist, gdist, bdist;
long crinc, cginc, cbinc;
ImplCreateBuffers( nColorMax );
- for( ULONG nIndex = 0; nIndex < nColors; nIndex++ )
+ for( sal_uLong nIndex = 0; nIndex < nColors; nIndex++ )
{
- const BitmapColor& rColor = rPal[ (USHORT) nIndex ];
- const BYTE cRed = rColor.GetRed();
- const BYTE cGreen = rColor.GetGreen();
- const BYTE cBlue = rColor.GetBlue();
+ const BitmapColor& rColor = rPal[ (sal_uInt16) nIndex ];
+ const sal_uInt8 cRed = rColor.GetRed();
+ const sal_uInt8 cGreen = rColor.GetGreen();
+ const sal_uInt8 cBlue = rColor.GetBlue();
rdist = cRed - x2;
gdist = cGreen - x2;
@@ -329,7 +329,7 @@ InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
cginc = ( xsqr - ( cGreen << nBits ) ) << 1L;
cbinc = ( xsqr - ( cBlue << nBits ) ) << 1L;
- cdp = (ULONG*) pBuffer;
+ cdp = (sal_uLong*) pBuffer;
crgbp = pMap;
for( r = 0, rxx = crinc; r < nColorMax; rdist += rxx, r++, rxx += xsqr2 )
@@ -340,7 +340,7 @@ InverseColorMap::InverseColorMap( const BitmapPalette& rPal ) :
if ( !nIndex || ( (long) *cdp ) > bdist )
{
*cdp = bdist;
- *crgbp = (BYTE) nIndex;
+ *crgbp = (sal_uInt8) nIndex;
}
}
}
@@ -357,15 +357,15 @@ InverseColorMap::~InverseColorMap()
// ------------------------------------------------------------------------
-void InverseColorMap::ImplCreateBuffers( const ULONG nMax )
+void InverseColorMap::ImplCreateBuffers( const sal_uLong nMax )
{
- const ULONG nCount = nMax * nMax * nMax;
- const ULONG nSize = nCount * sizeof( ULONG );
+ const sal_uLong nCount = nMax * nMax * nMax;
+ const sal_uLong nSize = nCount * sizeof( sal_uLong );
- pMap = (BYTE*) rtl_allocateMemory( nCount );
+ pMap = (sal_uInt8*) rtl_allocateMemory( nCount );
memset( pMap, 0x00, nCount );
- pBuffer = (BYTE*) rtl_allocateMemory( nSize );
+ pBuffer = (sal_uInt8*) rtl_allocateMemory( nSize );
memset( pBuffer, 0xff, nSize );
}
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 018665bf6b89..efd5484dad01 100644..100755
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -119,9 +119,9 @@ struct ImplObjStack
Point* mpRefPoint;
TextAlign meTextAlign;
RasterOp meRasterOp;
- ULONG mnTextLayoutMode;
+ sal_uLong mnTextLayoutMode;
LanguageType meTextLanguage;
- USHORT mnFlags;
+ sal_uInt16 mnFlags;
};
// -----------------------------------------------------------------------
@@ -199,10 +199,6 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
{
DBG_TESTSOLARMUTEX();
- // TODO(Q3): Change from static to plain method - everybody's
- // calling it with pOutDev=this!
- // => done, but only with minimal changes for now => TODO
- OutputDevice* const pOutDev = this;
if( !pGraphics )
{
if( !mpGraphics )
@@ -211,91 +207,8 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
pGraphics = mpGraphics;
}
- if( rRegion.HasPolyPolygon()
- && pGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
- const ::basegfx::B2DPolyPolygon& rB2DPolyPolygon = rRegion.GetB2DPolyPolygon();
- pGraphics->BeginSetClipRegion( 0 );
- pGraphics->UnionClipRegion( rB2DPolyPolygon, pOutDev );
- pGraphics->EndSetClipRegion();
- return true;
- }
-
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- ULONG nRectCount;
- ImplRegionInfo aInfo;
- BOOL bRegionRect;
- BOOL bClipRegion = TRUE;
- const BOOL bClipDeviceBounds( !pOutDev->GetPDFWriter()
- && pOutDev->GetOutDevType() != OUTDEV_PRINTER );
-
- nRectCount = rRegion.GetRectCount();
- pGraphics->BeginSetClipRegion( nRectCount );
- bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
- if( bClipDeviceBounds )
- {
- // #b6520266# Perform actual rect clip against outdev
- // dimensions, to generate empty clips whenever one of the
- // values is completely off the device.
- const long nOffX( pOutDev->mnOutOffX );
- const long nOffY( pOutDev->mnOutOffY );
- const long nDeviceWidth( pOutDev->GetOutputWidthPixel() );
- const long nDeviceHeight( pOutDev->GetOutputHeightPixel() );
- Rectangle aDeviceBounds( nOffX, nOffY,
- nOffX+nDeviceWidth-1,
- nOffY+nDeviceHeight-1 );
- while ( bRegionRect )
- {
- // #i59315# Limit coordinates passed to sal layer to actual
- // outdev dimensions - everything else bears the risk of
- // overflowing internal coordinates (e.g. the 16 bit wire
- // format of X11).
- Rectangle aTmpRect(nX,nY,nX+nWidth-1,nY+nHeight-1);
- aTmpRect.Intersection(aDeviceBounds);
-
- if( !aTmpRect.IsEmpty() )
- {
- if ( !pGraphics->UnionClipRegion( aTmpRect.Left(),
- aTmpRect.Top(),
- aTmpRect.GetWidth(),
- aTmpRect.GetHeight(),
- pOutDev ) )
- {
- bClipRegion = FALSE;
- }
- }
- else
- {
- // #i79850# Fake off-screen clip
- if ( !pGraphics->UnionClipRegion( nDeviceWidth+1,
- nDeviceHeight+1,
- 1, 1,
- pOutDev ) )
- {
- bClipRegion = FALSE;
- }
- }
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't create region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- else
- {
- // #i65720# Actually, _don't_ clip anything on printer or PDF
- // export, since output might be visible outside the specified
- // device boundaries.
- while ( bRegionRect )
- {
- if ( !pGraphics->UnionClipRegion( nX, nY, nWidth, nHeight, pOutDev ) )
- bClipRegion = FALSE;
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- pGraphics->EndSetClipRegion();
+ bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
+ OSL_ENSURE( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
return bClipRegion;
}
@@ -316,7 +229,7 @@ Polygon ImplSubdivideBezier( const Polygon& rPoly )
PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
{
- USHORT i, nPolys = rPolyPoly.Count();
+ sal_uInt16 i, nPolys = rPolyPoly.Count();
PolyPolygon aPolyPoly( nPolys );
for( i=0; i<nPolys; ++i )
aPolyPoly.Insert( ImplSubdivideBezier( rPolyPoly.GetObject(i) ) );
@@ -327,7 +240,7 @@ PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
// =======================================================================
// #100127# Extracted from OutputDevice::DrawPolyPolygon()
-void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPoly )
+void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly )
{
// AW: This crashes on empty PolyPolygons, avoid that
if(!nPoly)
@@ -335,28 +248,28 @@ void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPo
sal_uInt32 aStackAry1[OUTDEV_POLYPOLY_STACKBUF];
PCONSTSALPOINT aStackAry2[OUTDEV_POLYPOLY_STACKBUF];
- BYTE* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
+ sal_uInt8* aStackAry3[OUTDEV_POLYPOLY_STACKBUF];
sal_uInt32* pPointAry;
PCONSTSALPOINT* pPointAryAry;
- const BYTE** pFlagAryAry;
- USHORT i = 0, j = 0, last = 0;
- BOOL bHaveBezier = sal_False;
+ const sal_uInt8** pFlagAryAry;
+ sal_uInt16 i = 0, j = 0, last = 0;
+ sal_Bool bHaveBezier = sal_False;
if ( nPoly > OUTDEV_POLYPOLY_STACKBUF )
{
pPointAry = new sal_uInt32[nPoly];
pPointAryAry = new PCONSTSALPOINT[nPoly];
- pFlagAryAry = new const BYTE*[nPoly];
+ pFlagAryAry = new const sal_uInt8*[nPoly];
}
else
{
pPointAry = aStackAry1;
pPointAryAry = aStackAry2;
- pFlagAryAry = (const BYTE**)aStackAry3;
+ pFlagAryAry = (const sal_uInt8**)aStackAry3;
}
do
{
const Polygon& rPoly = rPolyPoly.GetObject( i );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if ( nSize )
{
pPointAry[j] = nSize;
@@ -460,33 +373,33 @@ OutputDevice::OutputDevice() :
mnTextLayoutMode = TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT;
meOutDevType = OUTDEV_DONTKNOW;
meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW;
- mbMap = FALSE;
- mbMapIsDefault = TRUE;
- mbClipRegion = FALSE;
- mbBackground = FALSE;
- mbOutput = TRUE;
- mbDevOutput = FALSE;
- mbOutputClipped = FALSE;
+ mbMap = sal_False;
+ mbMapIsDefault = sal_True;
+ mbClipRegion = sal_False;
+ mbBackground = sal_False;
+ mbOutput = sal_True;
+ mbDevOutput = sal_False;
+ mbOutputClipped = sal_False;
maTextColor = Color( COL_BLACK );
maOverlineColor = Color( COL_TRANSPARENT );
meTextAlign = maFont.GetAlign();
meRasterOp = ROP_OVERPAINT;
mnAntialiasing = 0;
meTextLanguage = 0; // TODO: get default from configuration?
- mbLineColor = TRUE;
- mbFillColor = TRUE;
- mbInitLineColor = TRUE;
- mbInitFillColor = TRUE;
- mbInitFont = TRUE;
- mbInitTextColor = TRUE;
- mbInitClipRegion = TRUE;
- mbClipRegionSet = FALSE;
- mbKerning = FALSE;
- mbNewFont = TRUE;
- mbTextLines = FALSE;
- mbTextSpecial = FALSE;
- mbRefPoint = FALSE;
- mbEnableRTL = FALSE; // mirroring must be explicitly allowed (typically for windows only)
+ mbLineColor = sal_True;
+ mbFillColor = sal_True;
+ mbInitLineColor = sal_True;
+ mbInitFillColor = sal_True;
+ mbInitFont = sal_True;
+ mbInitTextColor = sal_True;
+ mbInitClipRegion = sal_True;
+ mbClipRegionSet = sal_False;
+ mbKerning = sal_False;
+ mbNewFont = sal_True;
+ mbTextLines = sal_False;
+ mbTextSpecial = sal_False;
+ mbRefPoint = sal_False;
+ mbEnableRTL = sal_False; // mirroring must be explicitly allowed (typically for windows only)
// struct ImplMapRes
maMapRes.mnMapOfsX = 0;
@@ -510,7 +423,7 @@ OutputDevice::~OutputDevice()
if ( GetUnoGraphicsList() )
{
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
if ( pWrapper )
pWrapper->ReleaseAllGraphics( this );
delete mpUnoGraphicsList;
@@ -577,7 +490,7 @@ bool OutputDevice::supportsOperation( OutDevSupportType eType ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableRTL( BOOL bEnable )
+void OutputDevice::EnableRTL( sal_Bool bEnable )
{
mbEnableRTL = (bEnable != 0);
if( meOutDevType == OUTDEV_VIRDEV )
@@ -602,11 +515,11 @@ void OutputDevice::EnableRTL( BOOL bEnable )
mpAlphaVDev->EnableRTL( bEnable );
}
-BOOL OutputDevice::ImplHasMirroredGraphics()
+sal_Bool OutputDevice::ImplHasMirroredGraphics()
{
// HOTFIX for #i55719#
if( meOutDevType == OUTDEV_PRINTER )
- return FALSE;
+ return sal_False;
return ( ImplGetGraphics() && (mpGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) );
}
@@ -635,7 +548,7 @@ void OutputDevice::ImplReMirror( Region &rRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
Region aMirroredRegion;
bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -657,13 +570,13 @@ int OutputDevice::ImplGetGraphics() const
DBG_TESTSOLARMUTEX();
if ( mpGraphics )
- return TRUE;
+ return sal_True;
- mbInitLineColor = TRUE;
- mbInitFillColor = TRUE;
- mbInitFont = TRUE;
- mbInitTextColor = TRUE;
- mbInitClipRegion = TRUE;
+ mbInitLineColor = sal_True;
+ mbInitFillColor = sal_True;
+ mbInitFont = sal_True;
+ mbInitTextColor = sal_True;
+ mbInitClipRegion = sal_True;
ImplSVData* pSVData = ImplGetSVData();
if ( meOutDevType == OUTDEV_WINDOW )
@@ -687,7 +600,7 @@ int OutputDevice::ImplGetGraphics() const
{
// steal the wingraphics from the other outdev
mpGraphics = pReleaseOutDev->mpGraphics;
- pReleaseOutDev->ImplReleaseGraphics( FALSE );
+ pReleaseOutDev->ImplReleaseGraphics( sal_False );
}
else
{
@@ -797,15 +710,15 @@ int OutputDevice::ImplGetGraphics() const
{
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplReleaseGraphics( BOOL bRelease )
+void OutputDevice::ImplReleaseGraphics( sal_Bool bRelease )
{
DBG_TESTSOLARMUTEX();
@@ -961,7 +874,7 @@ void OutputDevice::ImplInvalidateViewTransform()
// -----------------------------------------------------------------------
-BOOL OutputDevice::ImplIsRecordLayout() const
+sal_Bool OutputDevice::ImplIsRecordLayout() const
{
return mpOutDevData && mpOutDevData->mpRecordLayout;
}
@@ -1002,7 +915,7 @@ void OutputDevice::ImplInitLineColor()
else
mpGraphics->SetLineColor();
- mbInitLineColor = FALSE;
+ mbInitLineColor = sal_False;
}
// -----------------------------------------------------------------------
@@ -1025,7 +938,7 @@ void OutputDevice::ImplInitFillColor()
else
mpGraphics->SetFillColor();
- mbInitFillColor = FALSE;
+ mbInitFillColor = sal_False;
}
// -----------------------------------------------------------------------
@@ -1055,43 +968,56 @@ void OutputDevice::ImplInitClipRegion()
if ( mbClipRegion )
aRegion.Intersect( ImplPixelToDevicePixel( maRegion ) );
if ( aRegion.IsEmpty() )
- mbOutputClipped = TRUE;
+ mbOutputClipped = sal_True;
else
{
- mbOutputClipped = FALSE;
+ mbOutputClipped = sal_False;
ImplSelectClipRegion( aRegion );
}
- mbClipRegionSet = TRUE;
+ mbClipRegionSet = sal_True;
}
else
{
if ( mbClipRegion )
{
if ( maRegion.IsEmpty() )
- mbOutputClipped = TRUE;
+ mbOutputClipped = sal_True;
else
{
- mbOutputClipped = FALSE;
- ImplSelectClipRegion(
- // #102532# Respect output offset also for clip region
- ImplPixelToDevicePixel( maRegion ) );
+ mbOutputClipped = sal_False;
+
+ // #102532# Respect output offset also for clip region
+ Region aRegion( ImplPixelToDevicePixel( maRegion ) );
+ const bool bClipDeviceBounds( ! GetPDFWriter()
+ && GetOutDevType() != OUTDEV_PRINTER );
+ if( bClipDeviceBounds )
+ {
+ // #b6520266# Perform actual rect clip against outdev
+ // dimensions, to generate empty clips whenever one of the
+ // values is completely off the device.
+ Rectangle aDeviceBounds( mnOutOffX, mnOutOffY,
+ mnOutOffX+GetOutputWidthPixel()-1,
+ mnOutOffY+GetOutputHeightPixel()-1 );
+ aRegion.Intersect( aDeviceBounds );
+ }
+ ImplSelectClipRegion( aRegion );
}
- mbClipRegionSet = TRUE;
+ mbClipRegionSet = sal_True;
}
else
{
if ( mbClipRegionSet )
{
mpGraphics->ResetClipRegion();
- mbClipRegionSet = FALSE;
+ mbClipRegionSet = sal_False;
}
- mbOutputClipped = FALSE;
+ mbOutputClipped = sal_False;
}
}
- mbInitClipRegion = FALSE;
+ mbInitClipRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -1105,710 +1031,27 @@ void OutputDevice::ImplSetClipRegion( const Region* pRegion )
if ( mbClipRegion )
{
maRegion = Region( REGION_NULL );
- mbClipRegion = FALSE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_False;
+ mbInitClipRegion = sal_True;
}
}
else
{
maRegion = *pRegion;
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
}
}
// -----------------------------------------------------------------------
-namespace
-{
- inline int iround( float x )
- {
- union
- {
- float f;
- sal_Int32 i;
- };
- f = x;
- sal_Int32 exponent = (127 + 31) - ((i >> 23) & 0xFF);
- sal_Int32 r = ((sal_Int32(i) << 8) | (1U << 31)) >> exponent;
- r &= ((exponent - 32) >> 31);
- sal_Int32 sign = i >> 31;
- return r = (r ^ sign) - sign;
- }
-
- inline int floorDiv(int a, int b)
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int floorMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a % b;
- int r = -a % b; // remainder
- if(r)
- r = b - r;
- return r;
- }
-
- inline int ceilDiv( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int ceilMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return (a % b) + 1 - b;
- int r = -a % b;
- if(r)
- r = b - r;
- return r + 1 - b;
- }
-
- inline int ceilFix4(int x) { return (x + 0xF) & 0xFFFFFFF0; }
-
- struct vertex
- {
- float x,y;
- inline vertex( const Point &p )
- : x((float)p.getX()),y((float)p.getY()) {}
- };
-
- template<class T> inline void swap(T &a, T &b) { T t=a; a=b; b=t; }
-
- class SpanIterator
- {
- public:
-
- SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines );
- std::pair<sal_Int32,sal_Int32> GetNextSpan( void );
- sal_Int32 GetNumRemainingScanlines( void );
- sal_Int32 GetNumEqualScanlines( void );
- SpanIterator &operator++ ();
- SpanIterator &Skip( sal_Int32 dwNumScanlines );
- sal_Int32 GetRemainingSpans( void ) const { return maNumSpans; }
-
- private:
-
- sal_Int32 *mpTable;
- sal_Int32 *mpSpanArray;
- sal_Int32 maNumSpans;
- sal_Int32 maRemainingScanlines;
- size_t maPitch;
- };
-
- inline SpanIterator::SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines )
- : mpTable(pTable),maRemainingScanlines(dwNumScanlines),maPitch(dwPitch)
- {
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- }
-
- inline SpanIterator &SpanIterator::operator++ ()
- {
- --maRemainingScanlines;
- mpTable += maPitch;
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline SpanIterator &SpanIterator::Skip( sal_Int32 dwNumScanlines )
- {
- // don't skip more scanlines than there are...
- if(dwNumScanlines > maRemainingScanlines)
- dwNumScanlines = maRemainingScanlines;
-
- // skip in one fellow swoop...
- maRemainingScanlines -= dwNumScanlines;
- mpTable += maPitch * dwNumScanlines;
-
- // initialize necessary query fields...
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline std::pair<sal_Int32,sal_Int32> SpanIterator::GetNextSpan( void )
- {
- sal_Int32 x(0);
- sal_Int32 w(0);
- if(maNumSpans)
- {
- x = *mpSpanArray++;
- w = *mpSpanArray++;
- --maNumSpans;
- }
- return std::pair<sal_Int32,sal_Int32>(x,w);
- }
-
- inline sal_Int32 SpanIterator::GetNumEqualScanlines( void )
- {
- return mpTable[1];
- }
-
- inline sal_Int32 SpanIterator::GetNumRemainingScanlines( void )
- {
- return maRemainingScanlines;
- }
-
- class ScanlineContainer
- {
-
- public:
-
- ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline );
-
- ~ScanlineContainer( void );
-
- void InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx );
-
- SpanIterator Iterate( void ) const { return SpanIterator(mpTable,maPitch,maNumScanlines); }
-
- inline sal_uInt32 GetNumSpans( void ) const { return maNumberOfSpans; }
-
- void Consolidate( void );
-
- private:
-
- // the span table will assist in determinate exactly how many clipping
- // regions [that is *spans*] we will end up with.
- // the counter for this purpose is right ahead.
- sal_uInt32 maNumberOfSpans;
-
- struct span
- {
- sal_Int32 x;
- sal_Int32 w;
- };
-
- sal_uInt32 maNumScanlines;
- sal_uInt32 maNumSpansPerScanline;
- sal_Int32 *mpTable;
- size_t maPitch;
- };
-
- ScanlineContainer::ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline ) : maNumScanlines(dwNumScanlines),
- maNumSpansPerScanline(dwNumSpansPerScanline)
- {
- // #128002# add one scanline buffer at the end, as
- // SpanIterator::Skip reads two bytes past the end.
- ++dwNumScanlines;
-
- // since each triangle could possibly add another span
- // we can calculate the upper limit by [num scanlines * num triangles].
- const sal_uInt32 dwNumPossibleRegions = dwNumScanlines*dwNumSpansPerScanline;
-
- // calculate the number of bytes the span table will consume
- const size_t dwTableSize = dwNumPossibleRegions*sizeof(span)+dwNumScanlines*(sizeof(sal_Int32)<<1);
-
- // allocate the span table [on the stack]
- mpTable = static_cast<sal_Int32 *>(rtl_allocateMemory(dwTableSize));
-
- // calculate the table pitch, that is how many int's do i need to get from a scanline to the next.
- maPitch = (dwNumSpansPerScanline*sizeof(span)/sizeof(sal_Int32))+2;
-
- // we need to initialize the table here.
- // the first *int* on each scanline tells us how many spans are on it.
- sal_Int32 *pNumSpans = mpTable;
- for(unsigned int i=0; i<dwNumScanlines; ++i)
- {
- pNumSpans[0] = 0;
- pNumSpans[1] = 0;
- pNumSpans += maPitch;
- }
-
- maNumberOfSpans = 0;
- }
-
- ScanlineContainer::~ScanlineContainer( void )
- {
- rtl_freeMemory(mpTable);
- }
-
- void ScanlineContainer::InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx )
- {
- // there's new incoming span which we need to store in the table.
- // first see if its width contributes a valid span.
- if(sal_Int32 dwSpanWidth = rx-lx)
- {
- // first select the appropriate scanline the new span.
- sal_Int32 *pNumSpans = mpTable+(y*maPitch);
- span *pSpanArray = reinterpret_cast<span *>(pNumSpans+2);
-
- // retrieve the number of already contained spans.
- sal_Int32 dwNumSpan = *pNumSpans;
-
- // since we need to sort the spans from top to bottom
- // and left to right, we need to find the correct location
- // in the table.
- sal_Int32 dwIndex = 0;
- while(dwIndex<dwNumSpan)
- {
- // since we would like to avoid unnecessary spans
- // we try to consolidate them if possible.
- // consolidate with right neighbour
- if(pSpanArray[dwIndex].x == rx)
- {
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w += dwSpanWidth;
- return;
- }
-
- // consolidate with left neighbour
- if((pSpanArray[dwIndex].x+pSpanArray[dwIndex].w) == lx)
- {
- pSpanArray[dwIndex].w += rx-lx;
- return;
- }
-
- // no consolidation possible, either this is a completely
- // seperate span or it is the first in the list.
- if(pSpanArray[dwIndex].x > lx)
- break;
-
- // forward to next element in the list.
- ++dwIndex;
- }
-
- // if we reach here, the new span needs to be stored
- // in the table, increase the number of spans in the
- // current scanline.
- *pNumSpans = dwNumSpan+1;
-
- // keep the list of spans in sorted order. 'dwIndex'
- // is where we want to store the new span. 'dwNumSpan'
- // is the number of spans already there. now we need
- // to move the offending spans out of the way.
- while(dwIndex != dwNumSpan)
- {
- pSpanArray[dwNumSpan].x = pSpanArray[dwNumSpan-1].x;
- pSpanArray[dwNumSpan].w = pSpanArray[dwNumSpan-1].w;
- --dwNumSpan;
- }
-
- // insert the new span
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w = rx-lx;
-
- // remember the total number of spans in the table.
- ++maNumberOfSpans;
- }
- }
-
- void ScanlineContainer::Consolidate( void )
- {
- sal_Int32 *pScanline = mpTable;
-
- sal_Int32 dwRemaining = maNumScanlines;
- while(dwRemaining)
- {
- sal_Int32 dwNumSpans = pScanline[0];
- sal_Int32 *pSpanArray = pScanline+2;
-
- sal_Int32 dwRest = dwRemaining-1;
- sal_Int32 *pNext = pScanline;
- while(dwRest)
- {
- pNext += maPitch;
- sal_Int32 dwNumNextSpans = pNext[0];
- sal_Int32 *pSpanArrayNext = pNext+2;
- if(dwNumSpans != dwNumNextSpans)
- break;
-
- sal_Int32 dwCompare = dwNumSpans<<1;
- while(dwCompare)
- {
- if(pSpanArray[dwCompare-1] != pSpanArrayNext[dwCompare-1])
- break;
- --dwCompare;
- }
- if(dwCompare)
- break;
-
- --dwRest;
- }
-
- const sal_Int32 dwNumEqualScanlines(dwRemaining-dwRest);
- pScanline[1] = dwNumEqualScanlines;
- pScanline += maPitch*dwNumEqualScanlines;
- dwRemaining -= dwNumEqualScanlines;
-
- // since we track the total number of spans to generate,
- // we need to account for consolidated scanlines here.
- if(dwNumEqualScanlines > 1)
- maNumberOfSpans -= dwNumSpans * (dwNumEqualScanlines-1);
- }
- }
-}
-
-// TODO: we should consider passing a basegfx b2dpolypolygon here to
-// ensure that the signature isn't misleading.
-// if we could pass a b2dpolypolygon here, we could easily triangulate it.
-void OutputDevice::ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- DBG_TESTSOLARMUTEX();
-
- if(!(IsDeviceOutputNecessary()))
- return;
- if(!(mpGraphics))
- if(!(ImplGetGraphics()))
- return;
-
- if( mpGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
- // getB2DPolyPolygon() "optimizes away" some points
- // which prevents reliable undoing of the "triangle thingy" parameter
- // so the toolspoly -> b2dpoly conversion has to be done manually
- ::basegfx::B2DPolyPolygon aB2DPolyPolygon;
- for( USHORT nPolyIdx = 0; nPolyIdx < rPolyPolygon.Count(); ++nPolyIdx )
- {
- const Polygon& rPolygon = rPolyPolygon[ nPolyIdx ];
- ::basegfx::B2DPolygon aB2DPoly;
- for( USHORT nPointIdx = 0; nPointIdx < rPolygon.GetSize(); ++nPointIdx )
- {
- const Point& rPoint = rPolygon[ nPointIdx ];
- const ::basegfx::B2DPoint aB2DPoint( rPoint.X(), rPoint.Y() );
- aB2DPoly.append( aB2DPoint );
- }
- aB2DPolyPolygon.append( aB2DPoly );
- }
-
- const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
- aB2DPolyPolygon.transform( aTransform );
-
- // the rPolyPolygon argument is a "triangle thingy"
- // so convert it to a normal polypolyon first
- ::basegfx::B2DPolyPolygon aPolyTriangle;
- const int nPolyCount = aB2DPolyPolygon.count();
- for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
- {
- const ::basegfx::B2DPolygon rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
- const int nPointCount = rPolygon.count();
- for( int nPointIdx = 0; nPointIdx+2 < nPointCount; nPointIdx +=3 )
- {
- ::basegfx::B2DPolygon aTriangle;
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+0 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+1 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+2 ) );
- aPolyTriangle.append( aTriangle );
- }
- }
-
- // now set the clip region with the real polypolygon
- mpGraphics->BeginSetClipRegion( 0 );
- mpGraphics->UnionClipRegion( aPolyTriangle, this );
- mpGraphics->EndSetClipRegion();
-
- // and mark the clip status as ready
- mbOutputClipped = FALSE;
- mbClipRegion = TRUE;
- mbClipRegionSet = TRUE;
- mbInitClipRegion = FALSE;
- return;
- }
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // first of all we need to know the upper limit
- // of the amount of possible clipping regions.
- sal_Int32 maxy = SAL_MIN_INT32;
- sal_Int32 miny = SAL_MAX_INT32;
- sal_uInt32 dwNumTriangles = 0;
- for(USHORT i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const sal_Int32 dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(USHORT j=0; j<rPoly.GetSize(); ++j)
- {
- const Point &p = rPoly.GetPoint(j);
- if(p.Y() < miny)
- miny = p.Y();
- if(p.Y() > maxy)
- maxy = p.Y();
- }
- dwNumTriangles += dwNumVertices / 3;
- }
- }
-
- const sal_uInt32 dwNumScanlines = (maxy-miny);
- if(!(dwNumScanlines))
- {
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas.
- mbOutputClipped = TRUE;
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = TRUE;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = TRUE;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = FALSE;
- return;
- }
-
- // this container provides all services we need to
- // efficiently store/retrieve spans from the table.
- const sal_uInt32 dwNumSpansPerScanline = dwNumTriangles;
- ScanlineContainer container(dwNumScanlines,dwNumSpansPerScanline);
-
- // convert the incoming polypolygon to spans, we assume that
- // the polypolygon has already been triangulated since we don't
- // want to use the basegfx-types here. this could be leveraged
- // after the tools-types had been removed.
- for(USHORT i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const USHORT dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(USHORT j=0; j<dwNumVertices; j+=3)
- {
- const Point &p0 = rPoly.GetPoint(j+0);
- const Point &p1 = rPoly.GetPoint(j+1);
- const Point &p2 = rPoly.GetPoint(j+2);
-
- // what now follows is an extremely fast triangle
- // rasterizer from which all tricky and interesting
- // parts were forcibly amputated.
- // note: top.left fill-convention
- vertex v0(p0);
- vertex v1(p1);
- vertex v2(p2);
-
- //sprintf(string,"[%f,%f] [%f,%f] [%f,%f]\n",v0.x,v0.y,v1.x,v1.y,v2.x,v2.y);
- //OSL_TRACE(string);
-
- if(v0.y > v2.y) ::swap(v0, v2);
- if(v1.y > v2.y) ::swap(v1, v2);
- if(v0.y > v1.y) ::swap(v0, v1);
-
- const float float2fixed(16.0f);
-
- // vertex coordinates of the triangle [28.4 fixed-point]
- const int i4x0 = iround(float2fixed * (v0.x - 0.5f));
- const int i4y0 = iround(float2fixed * (v0.y - 0.5f));
- const int i4x1 = iround(float2fixed * (v1.x - 0.5f));
- const int i4y1 = iround(float2fixed * (v1.y - 0.5f));
- const int i4x2 = iround(float2fixed * (v2.x - 0.5f));
- const int i4y2 = iround(float2fixed * (v2.y - 0.5f));
-
- // vertex coordinate deltas [28.4 fixed-point]
- const int i4dx12 = i4x1-i4x0;
- const int i4dy12 = i4y1-i4y0;
- const int i4dx13 = i4x2-i4x0;
- const int i4dy13 = i4y2-i4y0;
- const int i4dx23 = i4x2-i4x1;
- const int i4dy23 = i4y2-i4y1;
-
- // slope of edges [quotient,remainder]
- const int mq12 = floorDiv(i4dx12 << 4, i4dy12 << 4);
- const int mq13 = floorDiv(i4dx13 << 4, i4dy13 << 4);
- const int mq23 = floorDiv(i4dx23 << 4, i4dy23 << 4);
- const int mr12 = floorMod(i4dx12 << 4, i4dy12 << 4);
- const int mr13 = floorMod(i4dx13 << 4, i4dy13 << 4);
- const int mr23 = floorMod(i4dx23 << 4, i4dy23 << 4);
-
- // convert the vertical coordinates back to integers.
- // according to the top-left fillrule we need to step
- // the coordinates to the ceiling.
- const int y0 = (i4y0+15)>>4;
- const int y1 = (i4y1+15)>>4;
- const int y2 = (i4y2+15)>>4;
-
- // calculate the value of the horizontal coordinate
- // from the edge that 'spans' the triangle.
- const int x = ceilDiv(i4dx13*i4dy12 + i4x0*i4dy13, i4dy13);
-
- // this will hold the horizontal coordinates
- // of the seperate spans during the rasterization process.
- int lx,rx;
-
- // this pair will serve as the error accumulator while
- // we step along the edges.
- int ld,rd,lD,rD;
-
- // these are the edge and error stepping values that
- // will be used while stepping.
- int lQ,rQ,lR,rR;
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- ld = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq12;
- rQ = mq13;
- lR = mr12;
- rR = mr13;
- lD = i4dy12 << 4;
- rD = i4dy13 << 4;
- }
- else
- {
- lx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- ld = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rd = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- lQ = mq13;
- rQ = mq12;
- lR = mr13;
- rR = mr12;
- lD = i4dy13 << 4;
- rD = i4dy12 << 4;
- }
-
- for(signed int y=y0; y<y1; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- ld = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq23;
- lR = mr23;
- lD = i4dy23 << 4;
- }
- else
- {
- rx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rd = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rQ = mq23;
- rR = mr23;
- rD = i4dy23 << 4;
- }
-
- for(signed int y=y1; y<y2; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
- }
- }
- }
-
- // now try to consolidate as many scanlines as possible.
- // please note that this will probably change the number
- // of spans [at least this is why we do all this hassle].
- // so, if you use 'consolidate' you should *use* this
- // information during iteration, because the 'graphics'
- // object we tell all those regions about is a bit,
- // hm, how to say, *picky* if you supply not correctly
- // the amount of regions.
- container.Consolidate();
-
- // now forward the spantable to the graphics handler.
- SpanIterator it(container.Iterate());
- mpGraphics->BeginSetClipRegion( container.GetNumSpans() );
- while(miny < maxy)
- {
- const sal_Int32 dwNumEqual(it.GetNumEqualScanlines());
- while(it.GetRemainingSpans())
- {
- // retrieve the next span [x-coordinate, width] from the current scanline.
- std::pair<sal_Int32,sal_Int32> span(it.GetNextSpan());
-
- // now forward this to the graphics object.
- // the only part that is worth noting is that we use
- // the number of equal spanlines [the current is always the
- // first one of the equal bunch] as the height of the region.
- mpGraphics->UnionClipRegion( offset_x+span.first,
- offset_y+miny,
- span.second,
- dwNumEqual,
- this );
- }
- it.Skip(dwNumEqual);
- miny += dwNumEqual;
- }
- mpGraphics->EndSetClipRegion();
-
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas. the clip covers the whole area
- // if there's not a single region.
- mbOutputClipped = (container.GetNumSpans() == 0);
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = TRUE;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = TRUE;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = FALSE;
-}
-
-// -----------------------------------------------------------------------
-
void OutputDevice::SetClipRegion()
{
OSL_TRACE( "OutputDevice::SetClipRegion()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( Region(), FALSE ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( Region(), sal_False ) );
ImplSetClipRegion( NULL );
@@ -1825,7 +1068,7 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, TRUE ) );
+ mpMetaFile->AddAction( new MetaClipRegionAction( rRegion, sal_True ) );
if ( rRegion.GetType() == REGION_NULL )
ImplSetClipRegion( NULL );
@@ -1841,42 +1084,6 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- OSL_TRACE( "OutputDevice::SetTriangleClipRegion( rPolyPolygon )" );
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- // in case the passed polypolygon is empty, use the
- // existing SetClipRegion() method which gracefully
- // unsets any previously set clipping region.
- if(!(rPolyPolygon.Count()))
- SetClipRegion();
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // play nice with the rest of the system and provide an old-style region.
- // the rest of this method does not rely on this.
- maRegion = Region::GetRegionFromPolyPolygon( LogicToPixel(rPolyPolygon) );
- maRegion.Move(offset_x,offset_y);
-
- // feed region to metafile
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( maRegion, TRUE ) );
-
- ImplSetTriangleClipRegion( rPolyPolygon );
-
- if( mpAlphaVDev )
- mpAlphaVDev->SetTriangleClipRegion( rPolyPolygon );
-}
-
-// -----------------------------------------------------------------------
-
Region OutputDevice::GetClipRegion() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1921,7 +1128,7 @@ void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
maRegion.Move( ImplLogicWidthToDevicePixel( nHorzMove ),
ImplLogicHeightToDevicePixel( nVertMove ) );
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
}
if( mpAlphaVDev )
@@ -1940,8 +1147,8 @@ void OutputDevice::IntersectClipRegion( const Rectangle& rRect )
Rectangle aRect = LogicToPixel( rRect );
maRegion.Intersect( aRect );
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
if( mpAlphaVDev )
mpAlphaVDev->IntersectClipRegion( rRect );
@@ -1964,8 +1171,8 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
Region aRegion = LogicToPixel( rRegion );
maRegion.Intersect( aRegion );
- mbClipRegion = TRUE;
- mbInitClipRegion = TRUE;
+ mbClipRegion = sal_True;
+ mbInitClipRegion = sal_True;
}
if( mpAlphaVDev )
@@ -1974,7 +1181,7 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetDrawMode( ULONG nDrawMode )
+void OutputDevice::SetDrawMode( sal_uLong nDrawMode )
{
OSL_TRACE( "OutputDevice::SetDrawMode( %lx )", nDrawMode );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1998,7 +1205,7 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp )
if ( meRasterOp != eRasterOp )
{
meRasterOp = eRasterOp;
- mbInitLineColor = mbInitFillColor = TRUE;
+ mbInitLineColor = mbInitFillColor = sal_True;
if( mpGraphics || ImplGetGraphics() )
mpGraphics->SetXORMode( (ROP_INVERT == meRasterOp) || (ROP_XOR == meRasterOp), ROP_INVERT == meRasterOp );
@@ -2016,12 +1223,12 @@ void OutputDevice::SetLineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
if ( mbLineColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = FALSE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_False;
maLineColor = Color( COL_TRANSPARENT );
}
@@ -2054,7 +1261,7 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -2072,14 +1279,14 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
if( mpMetaFile )
- mpMetaFile->AddAction( new MetaLineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( aColor, sal_True ) );
if( ImplIsColorTransparent( aColor ) )
{
if ( mbLineColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = FALSE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_False;
maLineColor = Color( COL_TRANSPARENT );
}
}
@@ -2087,8 +1294,8 @@ void OutputDevice::SetLineColor( const Color& rColor )
{
if( maLineColor != aColor )
{
- mbInitLineColor = TRUE;
- mbLineColor = TRUE;
+ mbInitLineColor = sal_True;
+ mbLineColor = sal_True;
maLineColor = aColor;
}
}
@@ -2105,12 +1312,12 @@ void OutputDevice::SetFillColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color(), sal_False ) );
if ( mbFillColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = FALSE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_False;
maFillColor = Color( COL_TRANSPARENT );
}
@@ -2143,7 +1350,7 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_NOFILL )
@@ -2165,14 +1372,14 @@ void OutputDevice::SetFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaFillColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( aColor, sal_True ) );
if ( ImplIsColorTransparent( aColor ) )
{
if ( mbFillColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = FALSE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_False;
maFillColor = Color( COL_TRANSPARENT );
}
}
@@ -2180,8 +1387,8 @@ void OutputDevice::SetFillColor( const Color& rColor )
{
if ( maFillColor != aColor )
{
- mbInitFillColor = TRUE;
- mbFillColor = TRUE;
+ mbInitFillColor = sal_True;
+ mbFillColor = sal_True;
maFillColor = aColor;
}
}
@@ -2198,7 +1405,7 @@ void OutputDevice::SetBackground()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
maBackground = Wallpaper();
- mbBackground = FALSE;
+ mbBackground = sal_False;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground();
@@ -2214,9 +1421,9 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground )
maBackground = rBackground;
if( rBackground.GetStyle() == WALLPAPER_NULL )
- mbBackground = FALSE;
+ mbBackground = sal_False;
else
- mbBackground = TRUE;
+ mbBackground = sal_True;
if( mpAlphaVDev )
mpAlphaVDev->SetBackground( rBackground );
@@ -2230,9 +1437,9 @@ void OutputDevice::SetRefPoint()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( Point(), FALSE ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( Point(), sal_False ) );
- mbRefPoint = FALSE;
+ mbRefPoint = sal_False;
maRefPoint.X() = maRefPoint.Y() = 0L;
if( mpAlphaVDev )
@@ -2247,9 +1454,9 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, TRUE ) );
+ mpMetaFile->AddAction( new MetaRefPointAction( rRefPoint, sal_True ) );
- mbRefPoint = TRUE;
+ mbRefPoint = sal_True;
maRefPoint = rRefPoint;
if( mpAlphaVDev )
@@ -2560,7 +1767,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyLineAction( rPoly ) );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || !mbLineColor || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -2610,7 +1817,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.GetConstFlagAry();
+ const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -2658,7 +1865,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
void OutputDevice::ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo)
{
- USHORT nPoints(rPoly.GetSize());
+ sal_uInt16 nPoints(rPoly.GetSize());
if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
return;
@@ -2730,7 +1937,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || (nPoints < 2) || ImplIsRecordLayout() )
return;
@@ -2793,7 +2000,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.GetConstFlagAry();
+ const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
@@ -2820,7 +2027,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) );
- USHORT nPoly = rPolyPoly.Count();
+ sal_uInt16 nPoly = rPolyPoly.Count();
if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || !nPoly || ImplIsRecordLayout() )
return;
@@ -3137,7 +2344,21 @@ void OutputDevice::DrawPolyLine(
// -----------------------------------------------------------------------
-void OutputDevice::Push( USHORT nFlags )
+sal_uInt32 OutputDevice::GetGCStackDepth() const
+{
+ const ImplObjStack* pData = mpObjStack;
+ sal_uInt32 nDepth = 0;
+ while( pData )
+ {
+ nDepth++;
+ pData = pData->mpPrev;
+ }
+ return nDepth;
+}
+
+// -----------------------------------------------------------------------
+
+void OutputDevice::Push( sal_uInt16 nFlags )
{
OSL_TRACE( "OutputDevice::Push()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3327,7 +2548,7 @@ void OutputDevice::SetConnectMetaFile( GDIMetaFile* pMtf )
// -----------------------------------------------------------------------
-void OutputDevice::EnableOutput( BOOL bEnable )
+void OutputDevice::EnableOutput( sal_Bool bEnable )
{
mbOutput = (bEnable != 0);
@@ -3347,7 +2568,7 @@ void OutputDevice::SetSettings( const AllSettings& rSettings )
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetBitCount() const
+sal_uInt16 OutputDevice::GetBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3361,12 +2582,12 @@ USHORT OutputDevice::GetBitCount() const
return 0;
}
- return (USHORT)mpGraphics->GetBitCount();
+ return (sal_uInt16)mpGraphics->GetBitCount();
}
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetAlphaBitCount() const
+sal_uInt16 OutputDevice::GetAlphaBitCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3381,17 +2602,17 @@ USHORT OutputDevice::GetAlphaBitCount() const
// -----------------------------------------------------------------------
-ULONG OutputDevice::GetColorCount() const
+sal_uLong OutputDevice::GetColorCount() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- const USHORT nBitCount = GetBitCount();
- return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (ULONG) 1 ) << nBitCount) );
+ const sal_uInt16 nBitCount = GetBitCount();
+ return( ( nBitCount > 31 ) ? ULONG_MAX : ( ( (sal_uLong) 1 ) << nBitCount) );
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::HasAlpha()
+sal_Bool OutputDevice::HasAlpha()
{
return mpAlphaVDev != NULL;
}
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index f3eb277480fa..356542952360 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -86,17 +86,17 @@ DBG_NAMEEX( OutputDevice )
// - externals -
// -------------
-extern ULONG nVCLRLut[ 6 ];
-extern ULONG nVCLGLut[ 6 ];
-extern ULONG nVCLBLut[ 6 ];
-extern ULONG nVCLDitherLut[ 256 ];
-extern ULONG nVCLLut[ 256 ];
+extern sal_uLong nVCLRLut[ 6 ];
+extern sal_uLong nVCLGLut[ 6 ];
+extern sal_uLong nVCLBLut[ 6 ];
+extern sal_uLong nVCLDitherLut[ 256 ];
+extern sal_uLong nVCLLut[ 256 ];
// =======================================================================
-ULONG ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
+sal_uLong ImplAdjustTwoRect( TwoRect& rTwoRect, const Size& rSizePix )
{
- ULONG nMirrFlags = 0;
+ sal_uLong nMirrFlags = 0;
if ( rTwoRect.mnDestWidth < 0 )
{
@@ -388,7 +388,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
OSL_TRACE( "OutputDevice::CopyArea()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -433,7 +433,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
((Window*)this)->ImplMoveAllInvalidateRegions( aSrcRect,
aPosAry.mnDestX-aPosAry.mnSrcX,
aPosAry.mnDestY-aPosAry.mnSrcY,
- FALSE );
+ sal_False );
mpGraphics->CopyArea( aPosAry.mnDestX, aPosAry.mnDestY,
aPosAry.mnSrcX, aPosAry.mnSrcY,
@@ -463,10 +463,10 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
GDIMetaFile* pOldMetaFile = mpMetaFile;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
RasterOp eOldROP = GetRasterOp();
mpMetaFile = NULL;
- mbMap = FALSE;
+ mbMap = sal_False;
SetRasterOp( ROP_OVERPAINT );
if ( !IsDeviceOutputNecessary() )
@@ -496,7 +496,7 @@ void OutputDevice::ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, cons
ImplDrawOutDevDirect( &rOutDev, &aPosAry );
// Dafuer sorgen, das ClipRegion neu berechnet und gesetzt wird
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
SetRasterOp( eOldROP );
mbMap = bOldMap;
@@ -510,8 +510,8 @@ void OutputDevice::ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bOldMap = mbMap;
- mbMap = FALSE;
+ sal_Bool bOldMap = mbMap;
+ mbMap = sal_False;
rDev.DrawOutDev( rDevPt, rDevSize, rPt, rDevSize, *this );
mbMap = bOldMap;
}
@@ -577,7 +577,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const ULONG nAction )
+ const Bitmap& rBitmap, const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -595,7 +595,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
{
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
- BYTE cCmpVal;
+ sal_uInt8 cCmpVal;
if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
@@ -654,7 +654,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
@@ -788,7 +788,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx, const ULONG nAction )
+ const BitmapEx& rBitmapEx, const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -807,7 +807,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
if ( mnDrawMode & ( DRAWMODE_BLACKBITMAP | DRAWMODE_WHITEBITMAP ) )
{
Bitmap aColorBmp( aBmpEx.GetSizePixel(), ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 4 : 1 );
- BYTE cCmpVal;
+ sal_uInt8 cCmpVal;
if ( mnDrawMode & DRAWMODE_BLACKBITMAP )
cCmpVal = ( mnDrawMode & DRAWMODE_GHOSTEDBITMAP ) ? 0x80 : 0;
@@ -901,7 +901,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmpEx.GetSizePixel() );
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
{
@@ -1095,7 +1095,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const Bitmap& rBitmap, const Color& rMaskColor,
- const ULONG nAction )
+ const sal_uLong nAction )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1149,7 +1149,7 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
// spiegeln via Koordinaten wollen wir nicht
- const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
+ const sal_uLong nMirrFlags = ImplAdjustTwoRect( aPosAry, pImpBmp->ImplGetSize() );
// check if output is necessary
if( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
@@ -1172,7 +1172,7 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize,
// ------------------------------------------------------------------
-void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nStyle )
+void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
@@ -1209,7 +1209,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nSt
// ------------------------------------------------------------------
void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle )
+ const Image& rImage, sal_uInt16 nStyle )
{
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" );
@@ -1260,14 +1260,14 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
if ( nWidth && nHeight )
{
Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- BOOL bClipped = FALSE;
+ sal_Bool bClipped = sal_False;
// X-Koordinate ausserhalb des Bereichs?
if ( nX < mnOutOffX )
{
nWidth -= ( mnOutOffX - nX );
nX = mnOutOffX;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Y-Koordinate ausserhalb des Bereichs?
@@ -1275,21 +1275,21 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
{
nHeight -= ( mnOutOffY - nY );
nY = mnOutOffY;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Breite ausserhalb des Bereichs?
if ( (nWidth + nX) > (mnOutWidth + mnOutOffX) )
{
nWidth = mnOutOffX + mnOutWidth - nX;
- bClipped = TRUE;
+ bClipped = sal_True;
}
// Hoehe ausserhalb des Bereichs?
if ( (nHeight + nY) > (mnOutHeight + mnOutOffY) )
{
nHeight = mnOutOffY + mnOutHeight - nY;
- bClipped = TRUE;
+ bClipped = sal_True;
}
if ( bClipped )
@@ -1321,10 +1321,10 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
aBmp = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
}
else
- bClipped = FALSE;
+ bClipped = sal_False;
}
else
- bClipped = FALSE;
+ bClipped = sal_False;
}
if ( !bClipped )
@@ -1372,8 +1372,8 @@ void OutputDevice::ImplGetFrameBitmap( const Point& rDestPt, const Size& rSize,
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bOldMap = mbMap;
- ((OutputDevice*)this)->mbMap = FALSE;
+ sal_Bool bOldMap = mbMap;
+ ((OutputDevice*)this)->mbMap = sal_False;
rBitmap = GetBitmap( rDestPt, rSize );
((OutputDevice*)this)->mbMap = bOldMap;
}
@@ -1411,7 +1411,7 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color* pColors = NULL;
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
if( nSize )
{
@@ -1424,7 +1424,7 @@ Color* OutputDevice::GetPixel( const Polygon& rPts ) const
{
pColors = new Color[ nSize ];
- for( USHORT i = 0; i < nSize; i++ )
+ for( sal_uInt16 i = 0; i < nSize; i++ )
{
Color& rCol = pColors[ i ];
const Point& rPt = rPts[ i ];
@@ -1503,7 +1503,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1558,12 +1558,12 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( pColors, "OutputDevice::DrawPixel: No color array specified" );
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
if ( nSize )
{
if ( mpMetaFile )
- for ( USHORT i = 0; i < nSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSize; i++ )
mpMetaFile->AddAction( new MetaPixelAction( rPts[ i ], pColors[ i ] ) );
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
@@ -1578,7 +1578,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
if ( mbOutputClipped )
return;
- for ( USHORT i = 0; i < nSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSize; i++ )
{
const Point aPt( ImplLogicToDevicePixel( rPts[ i ] ) );
mpGraphics->DrawPixel( aPt.X(), aPt.Y(), ImplColorToSal( pColors[ i ] ), this );
@@ -1597,10 +1597,10 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
{
if( rColor != COL_TRANSPARENT && ! ImplIsRecordLayout() )
{
- const USHORT nSize = rPts.GetSize();
+ const sal_uInt16 nSize = rPts.GetSize();
Color* pColArray = new Color[ nSize ];
- for( USHORT i = 0; i < nSize; i++ )
+ for( sal_uInt16 i = 0; i < nSize; i++ )
pColArray[ i ] = rColor;
DrawPixel( rPts, pColArray );
@@ -1615,11 +1615,11 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
namespace
{
- BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor )
+ sal_uInt8 lcl_calcColor( const sal_uInt8 nSourceColor, const sal_uInt8 nSourceOpaq, const sal_uInt8 nDestColor )
{
int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) )
+ (int)nSourceOpaq * (int)nSourceColor;
- return BYTE( c / 255 );
+ return sal_uInt8( c / 255 );
}
}
@@ -1643,8 +1643,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
OSL_ENSURE(mpAlphaVDev,
"ImplBlendWithAlpha(): call me only with valid alpha VDev!" );
- BOOL bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
- mpAlphaVDev->EnableMapMode(FALSE);
+ sal_Bool bOldMapMode( mpAlphaVDev->IsMapModeEnabled() );
+ mpAlphaVDev->EnableMapMode(sal_False);
Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
BitmapWriteAccess* pAlphaW = aAlphaBitmap.AcquireWriteAccess();
@@ -1666,18 +1666,18 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
const long nMapX = pMapX[ nX ];
- const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
@@ -1686,9 +1686,9 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
+ const sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] ) );
pAlphaW->SetPixel( nY, nX, aIndex );
@@ -1715,8 +1715,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const sal_uInt8 nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
@@ -1728,7 +1728,7 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
+ const sal_uInt8 nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (sal_uInt8)nDstOpaq, nSrcOpaq );
pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) );
}
@@ -1783,11 +1783,11 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp,
for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
const long nMapX = pMapX[ nX ];
- const ULONG nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
+ const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
aDstCol = pB->GetColor( nY, nX );
- aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (BYTE) pA->GetPixel( nMapY, nMapX ) );
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (sal_uInt8) pA->GetPixel( nMapY, nMapX ) );
+ aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
@@ -1922,7 +1922,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
Point aOutPt( LogicToPixel( rDestPt ) );
Size aOutSz( LogicToPixel( rDestSize ) );
Rectangle aDstRect( aNullPt, GetOutputSizePixel() );
- const BOOL bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
+ const sal_Bool bHMirr = aOutSz.Width() < 0, bVMirr = aOutSz.Height() < 0;
if( OUTDEV_WINDOW == meOutDevType )
{
@@ -1971,7 +1971,7 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
&& !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
{
GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = NULL;
- const BOOL bOldMap = mbMap; mbMap = FALSE;
+ const sal_Bool bOldMap = mbMap; mbMap = sal_False;
Bitmap aBmp( GetBitmap( aDstRect.TopLeft(), aDstRect.GetSize() ) );
// #109044# The generated bitmap need not necessarily be
@@ -2096,7 +2096,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
if( !rBmp.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
Bitmap aPaint( rBmp ), aMask( rMask );
- ULONG nMirrFlags = 0UL;
+ sal_uLong nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2143,9 +2143,9 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
long nX, nY, nWorkX, nWorkY, nWorkWidth, nWorkHeight;
long* pMapX = new long[ nSrcWidth + 1 ];
long* pMapY = new long[ nSrcHeight + 1 ];
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- mbMap = FALSE;
+ mbMap = sal_False;
// create forward mapping tables
for( nX = 0L; nX <= nSrcWidth; nX++ )
@@ -2157,7 +2157,7 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
ImplRegionInfo aInfo;
- BOOL bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
while( bRgnRect )
{
@@ -2194,7 +2194,7 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
if( !rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height() )
{
Bitmap aMask( rMask );
- ULONG nMirrFlags = 0UL;
+ sal_uLong nMirrFlags = 0UL;
if( aMask.GetBitCount() > 1 )
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
@@ -2229,10 +2229,10 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
long* pMapX = new long[ nSrcWidth + 1 ];
long* pMapY = new long[ nSrcHeight + 1 ];
GDIMetaFile* pOldMetaFile = mpMetaFile;
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
mpMetaFile = NULL;
- mbMap = FALSE;
+ mbMap = sal_False;
Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
SetLineColor( rMaskColor );
SetFillColor( rMaskColor );
@@ -2249,7 +2249,7 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
// walk through all rectangles of mask
Region aWorkRgn( aMask.CreateRegion( COL_BLACK, Rectangle( Point(), aMask.GetSizePixel() ) ) );
ImplRegionInfo aInfo;
- BOOL bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
+ sal_Bool bRgnRect = aWorkRgn.ImplGetFirstRect( aInfo, nWorkX, nWorkY, nWorkWidth, nWorkHeight );
while( bRgnRect )
{
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 4026abb1c48e..9a3d07353fff 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -28,56 +28,57 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <cstring>
-#include <i18npool/mslangid.hxx>
-
-#include <svsys.h>
-#include <vcl/salgdi.hxx>
-#include <vcl/sallayout.hxx>
-#include <rtl/tencinfo.h>
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/impfont.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/outdata.hxx>
-#include <vcl/outfont.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <tools/poly.hxx>
-#include <vcl/outdev.h>
-#include <vcl/virdev.hxx>
-#include <vcl/print.hxx>
-#include <vcl/event.hxx>
-#include <vcl/window.h>
-#include <vcl/window.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/bmpacc.hxx>
-#include <unotools/fontcvt.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/edit.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/sysdata.hxx>
-#include <vcl/textlayout.hxx>
-#include <osl/file.h>
+
+#include "i18npool/mslangid.hxx"
+
+#include "svsys.h"
+#include "vcl/salgdi.hxx"
+#include "vcl/sallayout.hxx"
+#include "rtl/tencinfo.h"
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/metric.hxx"
+#include "vcl/impfont.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/outdata.hxx"
+#include "vcl/outfont.hxx"
+#include "basegfx/polygon/b2dpolygon.hxx"
+#include "basegfx/polygon/b2dpolypolygon.hxx"
+#include "basegfx/matrix/b2dhommatrix.hxx"
+#include "tools/poly.hxx"
+#include "vcl/outdev.h"
+#include "vcl/virdev.hxx"
+#include "vcl/print.hxx"
+#include "vcl/event.hxx"
+#include "vcl/window.h"
+#include "vcl/window.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/bmpacc.hxx"
+#include "unotools/fontcvt.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/edit.hxx"
+#include "unotools/fontcfg.hxx"
+#include "vcl/sysdata.hxx"
+#include "vcl/textlayout.hxx"
+#include "vcl/svids.hrc"
+#include "osl/file.h"
#ifdef ENABLE_GRAPHITE
-#include <vcl/graphite_features.hxx>
+#include "vcl/graphite_features.hxx"
#endif
#ifdef USE_BUILTIN_RASTERIZER
-#include <vcl/glyphcache.hxx>
+#include "vcl/glyphcache.hxx"
#endif
-#include <vcl/unohelp.hxx>
-#include <pdfwriter_impl.hxx>
-#include <vcl/controllayout.hxx>
-#include <rtl/logfile.hxx>
+#include "vcl/unohelp.hxx"
+#include "pdfwriter_impl.hxx"
+#include "vcl/controllayout.hxx"
+#include "rtl/logfile.hxx"
-#include <com/sun/star/beans/PropertyValues.hdl>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+#include "com/sun/star/beans/PropertyValues.hpp"
+#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/WordType.hpp"
+#include "com/sun/star/linguistic2/XLinguServiceManager.hpp"
#if defined UNX
#define GLYPH_FONT_HEIGHT 128
@@ -87,7 +88,7 @@
#define GLYPH_FONT_HEIGHT 256
#endif
-#include <sal/alloca.h>
+#include "sal/alloca.h"
#include <cmath>
#include <cstring>
@@ -225,7 +226,7 @@ void OutputDevice::ImplUpdateFontData( bool bNewFontLists )
if( mpFontCache && mpFontCache != pSVData->maGDIData.mpScreenFontCache )
delete mpFontCache;
mpFontList = mpPDFWriter->filterDevFontList( pSVData->maGDIData.mpScreenFontList );
- mpFontCache = new ImplFontCache( FALSE );
+ mpFontCache = new ImplFontCache( sal_False );
}
else
{
@@ -317,7 +318,7 @@ void ImplFreeOutDevFontData()
void OutputDevice::BeginFontSubstitution()
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maGDIData.mbFontSubChanged = FALSE;
+ pSVData->maGDIData.mbFontSubChanged = sal_False;
}
// -----------------------------------------------------------------------
@@ -333,7 +334,7 @@ void OutputDevice::EndFontSubstitution()
DataChangedEvent aDCEvt( DATACHANGED_FONTSUBSTITUTION );
pApp->DataChanged( aDCEvt );
pApp->NotifyAllWindows( aDCEvt );
- pSVData->maGDIData.mbFontSubChanged = FALSE;
+ pSVData->maGDIData.mbFontSubChanged = sal_False;
}
}
@@ -341,19 +342,19 @@ void OutputDevice::EndFontSubstitution()
void OutputDevice::AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDirectFontSubstitution*& rpSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !rpSubst )
rpSubst = new ImplDirectFontSubstitution();
rpSubst->AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
- ImplGetSVData()->maGDIData.mbFontSubChanged = TRUE;
+ ImplGetSVData()->maGDIData.mbFontSubChanged = sal_True;
}
// -----------------------------------------------------------------------
void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
- const String& rSubstFontName, USHORT nFlags )
+ const String& rSubstFontName, sal_uInt16 nFlags )
{
maFontSubstList.push_back( ImplFontSubstEntry( rFontName, rSubstFontName, nFlags ) );
}
@@ -361,7 +362,7 @@ void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
// -----------------------------------------------------------------------
ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
- const String& rSubstFontName, USHORT nSubstFlags )
+ const String& rSubstFontName, sal_uInt16 nSubstFlags )
: maName( rFontName )
, maReplaceName( rSubstFontName )
, mnFlags( nSubstFlags )
@@ -376,7 +377,7 @@ ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplInitOutDevData();
mpOutDevData->maDevFontSubst.AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
@@ -384,7 +385,7 @@ void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
// -----------------------------------------------------------------------
-void OutputDevice::RemoveFontSubstitute( USHORT n )
+void OutputDevice::RemoveFontSubstitute( sal_uInt16 n )
{
ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -403,21 +404,21 @@ void ImplDirectFontSubstitution::RemoveFontSubstitute( int nIndex )
// -----------------------------------------------------------------------
-USHORT OutputDevice::GetFontSubstituteCount()
+sal_uInt16 OutputDevice::GetFontSubstituteCount()
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !pSubst )
return 0;
int nCount = pSubst->GetFontSubstituteCount();
- return (USHORT)nCount;
+ return (sal_uInt16)nCount;
}
// -----------------------------------------------------------------------
-void OutputDevice::GetFontSubstitute( USHORT n,
+void OutputDevice::GetFontSubstitute( sal_uInt16 n,
XubString& rFontName,
XubString& rReplaceFontName,
- USHORT& rFlags )
+ sal_uInt16& rFlags )
{
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
@@ -427,7 +428,7 @@ void OutputDevice::GetFontSubstitute( USHORT n,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
- String& rFontName, String& rSubstFontName, USHORT& rFlags ) const
+ String& rFontName, String& rSubstFontName, sal_uInt16& rFlags ) const
{
FontSubstList::const_iterator it = maFontSubstList.begin();
for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
@@ -444,7 +445,7 @@ bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
- const String& rSearchName, USHORT nFlags ) const
+ const String& rSearchName, sal_uInt16 nFlags ) const
{
// TODO: get rid of O(N) searches
FontSubstList::const_iterator it = maFontSubstList.begin();
@@ -465,7 +466,7 @@ bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
// -----------------------------------------------------------------------
static void ImplFontSubstitute( String& rFontName,
- USHORT nFlags, ImplDirectFontSubstitution* pDevSpecific )
+ sal_uInt16 nFlags, ImplDirectFontSubstitution* pDevSpecific )
{
#ifdef DBG_UTIL
String aTempName = rFontName;
@@ -496,8 +497,8 @@ static void ImplFontSubstitute( String& rFontName,
// -----------------------------------------------------------------------
-Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
- ULONG nFlags, const OutputDevice* pOutDev )
+Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
+ sal_uLong nFlags, const OutputDevice* pOutDev )
{
OSL_TRACE( "OutputDevice::GetDefaultFont()" );
@@ -730,7 +731,7 @@ static unsigned ImplIsCJKFont( const String& rFontName )
// -----------------------------------------------------------------------
-static void ImplCalcType( ULONG& rType, FontWeight& rWeight, FontWidth& rWidth,
+static void ImplCalcType( sal_uLong& rType, FontWeight& rWeight, FontWidth& rWidth,
FontFamily eFamily, const FontNameAttr* pFontAttr )
{
if ( eFamily != FAMILY_DONTKNOW )
@@ -1322,11 +1323,11 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
"msmincho", "fzmingti", "fzheiti", "ipamincho", "sazanamimincho", "kochimincho", "",
"sunbatang", "sundotum", "baekmukdotum", "gulim", "batang", "dotum", "",
"hgmincholightj", "msunglightsc", "msunglighttc", "hymyeongjolightk", "",
- "tahoma", "dejavusans", "timesnewroman", "lucidatypewriter", "lucidasans", "nimbussansl", "",
+ "tahoma", "dejavusans", "timesnewroman", "liberationsans", "",
"shree", "mangal", "",
"raavi", "shruti", "tunga", "",
"latha", "gautami", "kartika", "vrinda", "",
- "shayyalmt", "naskmt", "",
+ "shayyalmt", "naskmt", "scheherazade", "",
"david", "nachlieli", "lucidagrande", "",
"norasi", "angsanaupc", "",
"khmerossystem", "",
@@ -1376,6 +1377,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
}
}
+#ifdef SAL_FONTENUM_STABLE_ON_PLATFORM // #i113472#
// sort the list of fonts for glyph fallback by quality (highest first)
// #i33947# keep the EUDC font at the front of the list
// an insertion sort is good enough for this short list
@@ -1391,6 +1393,7 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
break;
pFallbackList[ j+1 ] = pTestFont;
}
+#endif
mnFallbackCount = nMaxLevel;
mpFallbackList = pFallbackList;
@@ -1631,10 +1634,25 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
- break;
+ return pFoundData;
}
- return pFoundData;
+ // use known attributes from the configuration to find a matching substitute
+ const sal_uLong nSearchType = rFontAttr.Type;
+ if( nSearchType != 0 )
+ {
+ const FontWeight eSearchWeight = rFontAttr.Weight;
+ const FontWidth eSearchWidth = rFontAttr.Width;
+ const FontItalic eSearchSlant = ITALIC_DONTKNOW;
+ const FontFamily eSearchFamily = FAMILY_DONTKNOW;
+ const String aSearchName;
+ pFoundData = ImplFindByAttributes( nSearchType,
+ eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName );
+ if( pFoundData )
+ return pFoundData;
+ }
+
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -1660,20 +1678,20 @@ void ImplDevFontList::InitMatchData() const
}
//----------------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const
+ImplDevFontListData* ImplDevFontList::ImplFindByLocale( com::sun::star::lang::Locale& rLocale ) const
{
// get the default font for a specified locale
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
- String aDefault = rDefaults.getUserInterfaceFont( lc );
+ const String aDefault = rDefaults.getUserInterfaceFont( rLocale );
ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault );
if( pFontData )
return pFontData;
- return 0;
+ return NULL;
}
// -----------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
+ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchType,
FontWeight eSearchWeight, FontWidth eSearchWidth, FontFamily /*eSearchFamily*/,
FontItalic eSearchItalic, const String& rSearchFamilyName ) const
{
@@ -1691,7 +1709,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
long nTestMatch;
long nBestMatch = 40000;
- ULONG nBestType = 0;
+ sal_uLong nBestType = 0;
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
@@ -1699,7 +1717,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
ImplDevFontListData* pData = (*it).second;
// Get all information about the matching font
- ULONG nMatchType = pData->mnMatchType;
+ sal_uLong nMatchType = pData->mnMatchType;
FontWeight eMatchWeight= pData->meMatchWeight;
FontWidth eMatchWidth = pData->meMatchWidth;
@@ -2410,7 +2428,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
// test if a font in the token list is available
// substitute the font if this was requested
- USHORT nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
+ sal_uInt16 nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
if ( bPrinter )
nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY;
@@ -2539,7 +2557,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aSearchFamilyName;
FontWeight eSearchWeight = rFSD.meWeight;
FontWidth eSearchWidth = rFSD.meWidthType;
- ULONG nSearchType = 0;
+ sal_uLong nSearchType = 0;
FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
@@ -2611,7 +2629,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
String aTempShortName;
String aTempFamilyName;
- ULONG nTempType = 0;
+ sal_uLong nTempType = 0;
FontWeight eTempWeight = rFSD.meWeight;
FontWidth eTempWidth = WIDTH_DONTKNOW;
FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
@@ -2883,17 +2901,17 @@ FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( const Font& rFont )
// -----------------------------------------------------------------------
-BOOL OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
+sal_Bool OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
{
if ( !rFont.IsVertical() )
- return FALSE;
+ return sal_False;
if( (LANGUAGE_JAPANESE == rFont.GetLanguage())
|| (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()) )
// the underline is right for Japanese only
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -2908,6 +2926,18 @@ void OutputDevice::ImplInitFontList() const
mpGraphics->GetDevFontList( mpFontList );
}
}
+ if( meOutDevType == OUTDEV_WINDOW && ! mpFontList->Count() )
+ {
+ String aError( RTL_CONSTASCII_USTRINGPARAM( "Application error: no fonts and no vcl resource found on your system" ) );
+ ResMgr* pMgr = ImplGetResMgr();
+ if( pMgr )
+ {
+ String aResStr( ResId( SV_ACCESSERROR_NO_FONTS, *pMgr ) );
+ if( aResStr.Len() )
+ aError = aResStr;
+ }
+ Application::Abort( aError );
+ }
}
// =======================================================================
@@ -2946,7 +2976,7 @@ void OutputDevice::ImplInitTextColor()
if ( mbInitTextColor )
{
mpGraphics->SetTextColor( ImplColorToSal( GetTextColor() ) );
- mbInitTextColor = FALSE;
+ mbInitTextColor = sal_False;
}
}
@@ -3003,9 +3033,9 @@ bool OutputDevice::ImplNewFont() const
ImplFontEntry* pFontEntry = mpFontEntry;
// mark when lower layers need to get involved
- mbNewFont = FALSE;
+ mbNewFont = sal_False;
if( pFontEntry != pOldEntry )
- mbInitFont = TRUE;
+ mbInitFont = sal_True;
// select font when it has not been initialized yet
if ( !pFontEntry->mbInit )
@@ -3106,10 +3136,10 @@ bool OutputDevice::ImplNewFont() const
{
Size aOrigSize = maFont.GetSize();
const_cast<Font&>(maFont).SetSize( Size( nNewWidth, aSize.Height() ) );
- mbMap = FALSE;
- mbNewFont = TRUE;
+ mbMap = sal_False;
+ mbNewFont = sal_True;
ImplNewFont(); // recurse once using stretched width
- mbMap = TRUE;
+ mbMap = sal_True;
const_cast<Font&>(maFont).SetSize( aOrigSize );
}
}
@@ -3129,17 +3159,17 @@ long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth, long nHeight )
+ long nDistX, long nDistY, long nWidth, long nHeight )
{
+ long nX = nDistX;
+ long nY = nDistY;
+
short nOrientation = mpFontEntry->mnOrientation;
if ( nOrientation )
{
// Rotate rect without rounding problems for 90 degree rotations
if ( !(nOrientation % 900) )
{
- nX -= nBaseX;
- nY -= nBaseY;
-
if ( nOrientation == 900 )
{
long nTemp = nX;
@@ -3167,12 +3197,11 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
nHeight = nTemp;
nX -= nWidth;
}
-
- nX += nBaseX;
- nY += nBaseY;
}
else
{
+ nX += nBaseX;
+ nY += nBaseY;
// inflate because polygons are drawn smaller
Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
Polygon aPoly( aRect );
@@ -3182,6 +3211,8 @@ void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
}
}
+ nX += nBaseX;
+ nY += nBaseY;
mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
}
@@ -3197,12 +3228,12 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- ImplDrawTextRect( nX, nY, nX, nY-mpFontEntry->maMetric.mnAscent-mnEmphasisAscent,
+ ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent),
nWidth,
mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent );
}
@@ -3466,7 +3497,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
short nOrientation,
SalGraphics* pGraphics,
OutputDevice* pOutDev,
- BOOL bDrawPixAsRect,
+ sal_Bool bDrawPixAsRect,
long nPixWidth, long nPixHeight )
{
@@ -3487,7 +3518,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
- long nStartX, long nStartY,
+ long nDistX, long nDistY,
long nWidth, long nHeight,
long nLineWidth, short nOrientation,
const Color& rColor )
@@ -3495,11 +3526,14 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
if ( !nHeight )
return;
+ long nStartX = nBaseX + nDistX;
+ long nStartY = nBaseY + nDistY;
+
// Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben
if ( (nLineWidth == 1) && (nHeight == 1) )
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
long nEndX = nStartX+nWidth;
long nEndY = nStartY;
@@ -3509,7 +3543,6 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation );
}
mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
-
}
else
{
@@ -3523,28 +3556,28 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
long i;
long nPixWidth;
long nPixHeight;
- BOOL bDrawPixAsRect;
+ sal_Bool bDrawPixAsRect;
// Auf Druckern die Pixel per DrawRect() ausgeben
if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
{
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( rColor ) );
- mbInitFillColor = TRUE;
- bDrawPixAsRect = TRUE;
+ mbInitFillColor = sal_True;
+ bDrawPixAsRect = sal_True;
nPixWidth = nLineWidth;
nPixHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
}
else
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
nPixWidth = 1;
nPixHeight = 1;
- bDrawPixAsRect = FALSE;
+ bDrawPixAsRect = sal_False;
}
if ( !nDiffY )
@@ -3609,10 +3642,10 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- BOOL bIsAbove )
+ sal_Bool bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight;
@@ -3635,7 +3668,7 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineWidth = 1;
if ( eTextLine == UNDERLINE_BOLDWAVE )
nLineWidth *= 2;
- nLinePos += nY - (nLineHeight / 2);
+ nLinePos += nDistY - (nLineHeight / 2);
long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
if ( eTextLine == UNDERLINE_DOUBLEWAVE )
{
@@ -3656,16 +3689,16 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
nLineDY2 = 1;
nLinePos -= nLineWidthHeight-nLineDY2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
nLinePos += nLineWidthHeight+nLineDY;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
else
{
nLinePos -= nLineWidthHeight/2;
- ImplDrawWaveLine( nBaseX, nBaseY, nX, nLinePos, nWidth, nLineHeight,
+ ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
}
@@ -3673,16 +3706,18 @@ void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
- BOOL bIsAbove )
+ sal_Bool bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight = 0;
long nLinePos = 0;
long nLinePos2 = 0;
+ const long nY = nDistY;
+
if ( eTextLine > UNDERLINE_LAST )
eTextLine = UNDERLINE_SINGLE;
@@ -3745,12 +3780,12 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- long nLeft = nX;
+ long nLeft = nDistX;
switch ( eTextLine )
{
@@ -3903,7 +3938,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3912,6 +3947,8 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
long nLinePos = 0;
long nLinePos2 = 0;
+ long nY = nDistY;
+
if ( eStrikeout > STRIKEOUT_LAST )
eStrikeout = STRIKEOUT_SINGLE;
@@ -3939,12 +3976,12 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
- long nLeft = nX;
+ const long& nLeft = nDistX;
switch ( eStrikeout )
{
@@ -3965,7 +4002,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
- long nX, long nY, long nWidth,
+ long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -3999,12 +4036,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// calculate acceptable strikeout length
// allow the strikeout to be one pixel larger than the text it strikes out
- long nMaxWidth = nStrikeoutWidth / 2;
+ long nMaxWidth = nStrikeoutWidth * 3 / 4;
if ( nMaxWidth < 2 )
nMaxWidth = 2;
nMaxWidth += nWidth + 1;
- int nStrikeStrLen = (nMaxWidth + nStrikeoutWidth - 1) / nStrikeoutWidth;
+ int nStrikeStrLen = (nMaxWidth - 1) / nStrikeoutWidth;
// if the text width is smaller than the strikeout text, then do not
// strike out at all. This case requires user interaction, e.g. adding
// a space to the text
@@ -4019,10 +4056,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
if( mpFontEntry->mnOrientation )
- ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
+ ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
+ nBaseX += nDistX;
+ nBaseY += nDistY;
// strikeout text has to be left aligned
- ULONG nOrigTLM = mnTextLayoutMode;
+ sal_uLong nOrigTLM = mnTextLayoutMode;
mnTextLayoutMode = TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_COMPLEX_DISABLED;
pLayout = ImplLayout( aStrikeoutText, 0, STRING_LEN );
mnTextLayoutMode = nOrigTLM;
@@ -4035,7 +4074,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
SetTextColor( aColor );
ImplInitTextColor();
- pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY );
+ pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
pLayout->DrawText( *mpGraphics );
pLayout->Release();
@@ -4045,12 +4084,12 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextLine( long nBaseX,
- long nX, long nY, long nWidth,
+void OutputDevice::ImplDrawTextLine( long nX, long nY,
+ long nDistX, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
if ( !nWidth )
return;
@@ -4058,14 +4097,18 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
Color aStrikeoutColor = GetTextColor();
Color aUnderlineColor = GetTextLineColor();
Color aOverlineColor = GetOverlineColor();
- BOOL bStrikeoutDone = FALSE;
- BOOL bUnderlineDone = FALSE;
- BOOL bOverlineDone = FALSE;
+ sal_Bool bStrikeoutDone = sal_False;
+ sal_Bool bUnderlineDone = sal_False;
+ sal_Bool bOverlineDone = sal_False;
- // TODO: fix rotated text
if ( IsRTLEnabled() )
+ {
// --- RTL --- mirror at basex
- nX = nBaseX - nWidth - (nX - nBaseX - 1);
+ long nXAdd = nWidth - nDistX;
+ if( mpFontEntry->mnOrientation )
+ nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) );
+ nX += nXAdd - 1;
+ }
if ( !IsTextLineColor() )
aUnderlineColor = GetTextColor();
@@ -4078,70 +4121,85 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
(eUnderline == UNDERLINE_DOUBLEWAVE) ||
(eUnderline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
- bUnderlineDone = TRUE;
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ bUnderlineDone = sal_True;
}
if ( (eOverline == UNDERLINE_SMALLWAVE) ||
(eOverline == UNDERLINE_WAVE) ||
(eOverline == UNDERLINE_DOUBLEWAVE) ||
(eOverline == UNDERLINE_BOLDWAVE) )
{
- ImplDrawWaveTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
- bOverlineDone = TRUE;
+ ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
+ bOverlineDone = sal_True;
}
if ( (eStrikeout == STRIKEOUT_SLASH) ||
(eStrikeout == STRIKEOUT_X) )
{
- ImplDrawStrikeoutChar( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
- bStrikeoutDone = TRUE;
+ ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
+ bStrikeoutDone = sal_True;
}
if ( !bUnderlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
if ( !bOverlineDone )
- ImplDrawStraightTextLine( nBaseX, nY, nX, nY, nWidth, eOverline, aOverlineColor, TRUE );
+ ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
if ( !bStrikeoutDone )
- ImplDrawStrikeoutLine( nBaseX, nY, nX, nY, nWidth, eStrikeout, aStrikeoutColor );
+ ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
- FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove )
+ FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove )
{
if( bWordLine )
{
- Point aPos, aStartPt;
- sal_Int32 nWidth = 0, nAdvance=0;
+ // draw everything relative to the layout base point
+ const Point aStartPt = rSalLayout.DrawBase();
+ // calculate distance of each word from the base point
+ Point aPos;
+ sal_Int32 nDist = 0, nWidth = 0, nAdvance=0;
for( int nStart = 0;;)
{
+ // iterate through the layouted glyphs
sal_GlyphId nGlyphIndex;
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) )
break;
+ // calculate the boundaries of each word
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
{
if( !nWidth )
{
- aStartPt = aPos;//rSalLayout.DrawBase() - (aPos - rSalLayout.DrawOffset());
+ // get the distance to the base point (as projected to baseline)
+ nDist = aPos.X() - aStartPt.X();
+ if( mpFontEntry->mnOrientation )
+ {
+ const long nDY = aPos.Y() - aStartPt.Y();
+ const double fRad = mpFontEntry->mnOrientation * F_PI1800;
+ nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) );
+ }
}
+ // update the length of the textline
nWidth += nAdvance;
}
else if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ // draw the textline for each word
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
}
}
+ // draw textline for the last word
if( nWidth > 0 )
{
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4149,7 +4207,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
{
Point aStartPt = rSalLayout.GetDrawPosition();
int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
- ImplDrawTextLine( rSalLayout.DrawBase().X(), aStartPt.X(), aStartPt.Y(), nWidth,
+ ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
}
@@ -4168,18 +4226,18 @@ void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth )
nX = nBaseX - nWidth - (nX - nBaseX - 1);
}
- ImplDrawTextLine( nBaseX, nX, nY, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
+ ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, sal_False );
}
// -----------------------------------------------------------------------
-void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
+void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine,
Rectangle& rRect1, Rectangle& rRect2,
long& rYOff, long& rWidth,
FontEmphasisMark eEmphasis,
long nHeight, short /*nOrient*/ )
{
- static const BYTE aAccentPolyFlags[24] =
+ static const sal_uInt8 aAccentPolyFlags[24] =
{
0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 0, 2, 2
};
@@ -4214,7 +4272,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
rWidth = 0;
rYOff = 0;
- rPolyLine = FALSE;
+ rPolyLine = sal_False;
if ( !nHeight )
return;
@@ -4255,7 +4313,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
// BorderWidth is 15%
long nBorder = (nDotSize*150)/1000;
if ( nBorder <= 1 )
- rPolyLine = TRUE;
+ rPolyLine = sal_True;
else
{
Polygon aPoly2( Point( nRad, nRad ),
@@ -4329,7 +4387,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
- const PolyPolygon& rPolyPoly, BOOL bPolyLine,
+ const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -4380,10 +4438,10 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
{
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
FontEmphasisMark nEmphasisMark = ImplGetEmphasisMarkStyle( maFont );
PolyPolygon aPolyPoly;
@@ -4392,7 +4450,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
long nEmphasisYOff;
long nEmphasisWidth;
long nEmphasisHeight;
- BOOL bPolyLine;
+ sal_Bool bPolyLine;
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
nEmphasisHeight = mnEmphasisDescent;
@@ -4516,12 +4574,12 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
GDIMetaFile* pOldMetaFile = mpMetaFile;
long nOldOffX = mnOutOffX;
long nOldOffY = mnOutOffY;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
mnOutOffX = 0L;
mnOutOffY = 0L;
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
DrawMask( aPoint, aBmp, GetTextColor() );
@@ -4535,7 +4593,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
+void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, sal_Bool bTextLines )
{
if( mpFontEntry->mnOwnOrientation )
if( ImplDrawRotateText( rSalLayout ) )
@@ -4729,7 +4787,7 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
- USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
+ sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
@@ -4798,10 +4856,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// sal_uInt16 nWordStart = nBreakPos;
// sal_uInt16 nBreakPos_OLD = nBreakPos;
sal_uInt16 nWordStart = nPos;
- sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos;
+ sal_uInt16 nWordEnd = (sal_uInt16) aBoundary.endPos;
DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" );
- USHORT nWordLen = nWordEnd - nWordStart;
+ sal_uInt16 nWordLen = nWordEnd - nWordStart;
if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
{
// #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD
@@ -4882,7 +4940,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
else
{
// fallback to something really simple
- USHORT nSpacePos = STRING_LEN;
+ sal_uInt16 nSpacePos = STRING_LEN;
long nW = 0;
do
{
@@ -4924,7 +4982,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
}
}
#ifdef DBG_UTIL
- for ( USHORT nL = 0; nL < rLineInfo.Count(); nL++ )
+ for ( sal_uInt16 nL = 0; nL < rLineInfo.Count(); nL++ )
{
ImplTextLineInfo* pLine = rLineInfo.GetLine( nL );
String aLine( rStr, pLine->GetIndex(), pLine->GetLen() );
@@ -4938,12 +4996,12 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// =======================================================================
-void OutputDevice::SetAntialiasing( USHORT nMode )
+void OutputDevice::SetAntialiasing( sal_uInt16 nMode )
{
if ( mnAntialiasing != nMode )
{
mnAntialiasing = nMode;
- mbInitFont = TRUE;
+ mbInitFont = sal_True;
if(mpGraphics)
{
@@ -4977,7 +5035,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aTextColor.GetLuminance();
+ const sal_uInt8 cLum = aTextColor.GetLuminance();
aTextColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -4992,7 +5050,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aFont.SetColor( aTextColor );
- BOOL bTransFill = aFont.IsTransparent();
+ sal_Bool bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
Color aTextFillColor( aFont.GetFillColor() );
@@ -5003,7 +5061,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextFillColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aTextFillColor.GetLuminance();
+ const sal_uInt8 cLum = aTextFillColor.GetLuminance();
aTextFillColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5011,7 +5069,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aTextFillColor = Color( COL_TRANSPARENT );
- bTransFill = TRUE;
+ bTransFill = sal_True;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5043,12 +5101,12 @@ void OutputDevice::SetFont( const Font& rNewFont )
&& (aFont.GetColor() != maFont.GetColor() || aFont.GetColor() != maTextColor ) )
{
maTextColor = aFont.GetColor();
- mbInitTextColor = TRUE;
+ mbInitTextColor = sal_True;
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextColorAction( aFont.GetColor() ) );
}
maFont = aFont;
- mbNewFont = TRUE;
+ mbNewFont = sal_True;
if( mpAlphaVDev )
{
@@ -5069,7 +5127,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
// -----------------------------------------------------------------------
-void OutputDevice::SetLayoutMode( ULONG nTextLayoutMode )
+void OutputDevice::SetLayoutMode( sal_uLong nTextLayoutMode )
{
OSL_TRACE( "OutputDevice::SetTextLayoutMode()" );
@@ -5116,7 +5174,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5136,7 +5194,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
if ( maTextColor != aColor )
{
maTextColor = aColor;
- mbInitTextColor = TRUE;
+ mbInitTextColor = sal_True;
}
if( mpAlphaVDev )
@@ -5151,12 +5209,12 @@ void OutputDevice::SetTextFillColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), sal_False ) );
if ( maFont.GetColor() != Color( COL_TRANSPARENT ) )
maFont.SetFillColor( Color( COL_TRANSPARENT ) );
if ( !maFont.IsTransparent() )
- maFont.SetTransparent( TRUE );
+ maFont.SetTransparent( sal_True );
if( mpAlphaVDev )
mpAlphaVDev->SetTextFillColor();
@@ -5170,7 +5228,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
- BOOL bTransFill = ImplIsColorTransparent( aColor ) ? TRUE : FALSE;
+ sal_Bool bTransFill = ImplIsColorTransparent( aColor ) ? sal_True : sal_False;
if ( !bTransFill )
{
@@ -5184,7 +5242,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
@@ -5192,7 +5250,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aColor = Color( COL_TRANSPARENT );
- bTransFill = TRUE;
+ bTransFill = sal_True;
}
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
@@ -5205,7 +5263,7 @@ void OutputDevice::SetTextFillColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, sal_True ) );
if ( maFont.GetFillColor() != aColor )
maFont.SetFillColor( aColor );
@@ -5234,7 +5292,7 @@ void OutputDevice::SetTextLineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), sal_False ) );
maTextLineColor = Color( COL_TRANSPARENT );
@@ -5261,7 +5319,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5277,7 +5335,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, sal_True ) );
maTextLineColor = aColor;
@@ -5293,7 +5351,7 @@ void OutputDevice::SetOverlineColor()
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), sal_False ) );
maOverlineColor = Color( COL_TRANSPARENT );
@@ -5320,7 +5378,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
@@ -5336,7 +5394,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor )
}
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, TRUE ) );
+ mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, sal_True ) );
maOverlineColor = aColor;
@@ -5358,7 +5416,7 @@ void OutputDevice::SetTextAlign( TextAlign eAlign )
if ( maFont.GetAlign() != eAlign )
{
maFont.SetAlign( eAlign );
- mbNewFont = TRUE;
+ mbNewFont = sal_True;
}
if( mpAlphaVDev )
@@ -5371,7 +5429,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
OSL_TRACE( "OutputDevice::DrawTextLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -5406,7 +5464,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
Point aPos = ImplLogicToDevicePixel( rPos );
nWidth = ImplLogicWidthToDevicePixel( nWidth );
aPos += Point( mnTextOffX, mnTextOffY );
- ImplDrawTextLine( aPos.X(), aPos.X(), aPos.Y(), nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+ ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
if( mpAlphaVDev )
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
@@ -5414,7 +5472,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
// ------------------------------------------------------------------------
-BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
+sal_Bool OutputDevice::IsTextUnderlineAbove( const Font& rFont )
{
return ImplIsUnderlineAbove( rFont );
}
@@ -5422,7 +5480,7 @@ BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
// ------------------------------------------------------------------------
void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
OSL_TRACE( "OutputDevice::DrawWaveLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -5483,7 +5541,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
- ImplDrawWaveLine( nStartX, nStartY, nStartX, nStartY,
+ ImplDrawWaveLine( nStartX, nStartY, 0, 0,
nEndX-nStartX, nWaveHeight, 1,
nOrientation, GetLineColor() );
if( mpAlphaVDev )
@@ -5650,7 +5708,7 @@ long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
if( nIndex >= rStr.Len() )
return 0;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// do layout
@@ -5692,14 +5750,14 @@ long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry, long nLayoutWidth,
- BOOL bCellBreaking ) const
+ sal_Bool bCellBreaking ) const
{
OSL_TRACE( "OutputDevice::GetCaretPositions()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
return false;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// layout complex text
@@ -5758,7 +5816,7 @@ bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXA
// -----------------------------------------------------------------------
-void OutputDevice::DrawStretchText( const Point& rStartPt, ULONG nWidth,
+void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen )
{
@@ -5790,7 +5848,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
{
// get string length for calculating extents
xub_StrLen nEndIndex = rStr.Len();
- if( (ULONG)nMinIndex + nLen < nEndIndex )
+ if( (sal_uLong)nMinIndex + nLen < nEndIndex )
nEndIndex = nMinIndex + nLen;
// don't bother if there is nothing to do
@@ -5859,7 +5917,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
sal_UCS4 cChar = GetLocalizedChar( *pStr, meTextLanguage );
if( cChar != *pStr )
// TODO: are the localized digit surrogates?
- rStr.SetChar( static_cast<USHORT>(pStr - pBase),
+ rStr.SetChar( static_cast<sal_uInt16>(pStr - pBase),
static_cast<sal_Unicode>(cChar) );
}
}
@@ -6088,8 +6146,9 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
- ImplFontMetricData aOrigMetric(aFontSelData);
- mpGraphics->GetFontMetric(&aOrigMetric);
+ ImplFontMetricData aOrigMetric( aFontSelData );
+ // TODO: use cached metric in fontentry
+ mpGraphics->GetFontMetric( &aOrigMetric );
// when device specific font substitution may have been performed for
// the originally selected font then make sure that a fallback to that
@@ -6169,7 +6228,7 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextIsRTL(
+sal_Bool OutputDevice::GetTextIsRTL(
const String& rString,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
@@ -6178,14 +6237,14 @@ BOOL OutputDevice::GetTextIsRTL(
bool bRTL = false;
int nCharPos = -1;
aArgs.GetNextPos( &nCharPos, &bRTL );
- return (nCharPos != nIndex) ? TRUE : FALSE;
+ return (nCharPos != nIndex) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
xub_StrLen nIndex, xub_StrLen nLen,
- long nCharExtra, BOOL /*TODO: bCellBreaking*/ ) const
+ long nCharExtra, sal_Bool /*TODO: bCellBreaking*/ ) const
{
OSL_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -6279,17 +6338,17 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const String& rOrigStr, USHORT nStyle,
+ const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout& _rLayout )
{
Color aOldTextColor;
Color aOldTextFillColor;
- BOOL bRestoreFillColor = false;
+ sal_Bool bRestoreFillColor = false;
if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
{
- BOOL bHighContrastBlack = FALSE;
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bHighContrastBlack = sal_False;
+ sal_Bool bHighContrastWhite = sal_False;
const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -6309,7 +6368,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
aOldTextColor = rTargetDevice.GetTextColor();
if ( rTargetDevice.IsTextFillColor() )
{
- bRestoreFillColor = TRUE;
+ bRestoreFillColor = sal_True;
aOldTextFillColor = rTargetDevice.GetTextFillColor();
}
if( bHighContrastBlack )
@@ -6438,7 +6497,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nMnemonicWidth;
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * nLineLen );
- /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
+ /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
nIndex, nLineLen );
long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
@@ -6509,7 +6568,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
if ( nMnemonicPos != STRING_NOTFOUND )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
- /*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
+ /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
@@ -6554,7 +6613,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
void OutputDevice::AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
- USHORT nStyle,
+ sal_uInt16 nStyle,
GDIMetaFile& rMtf )
{
OSL_TRACE( "OutputDevice::AddTextRectActions( const Rectangle& )" );
@@ -6571,11 +6630,11 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// temporarily swap in passed mtf for action generation, and
// disable output generation.
- const BOOL bOutputEnabled( IsOutputEnabled() );
+ const sal_Bool bOutputEnabled( IsOutputEnabled() );
GDIMetaFile* pMtf = mpMetaFile;
mpMetaFile = &rMtf;
- EnableOutput( FALSE );
+ EnableOutput( sal_False );
// #i47157# Factored out to ImplDrawTextRect(), to be shared
// between us and DrawText()
@@ -6589,7 +6648,7 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle,
+void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout* _pTextLayout )
{
@@ -6638,7 +6697,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USH
// -----------------------------------------------------------------------
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
- const XubString& rStr, USHORT nStyle,
+ const XubString& rStr, sal_uInt16 nStyle,
TextRectInfo* pInfo,
const ::vcl::ITextLayout* _pTextLayout ) const
{
@@ -6668,7 +6727,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
nFormatLines = aMultiLineInfo.Count();
if ( !nTextHeight )
nTextHeight = 1;
- nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
+ nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight);
if ( pInfo )
pInfo->mnLineCount = nFormatLines;
if ( !nLines )
@@ -6682,13 +6741,13 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
else
{
if ( pInfo )
- pInfo->mbEllipsis = TRUE;
+ pInfo->mbEllipsis = sal_True;
nMaxWidth = nWidth;
}
}
if ( pInfo )
{
- BOOL bMaxWidth = nMaxWidth == 0;
+ sal_Bool bMaxWidth = nMaxWidth == 0;
pInfo->mnMaxWidth = 0;
for ( i = 0; i < nLines; i++ )
{
@@ -6723,7 +6782,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ELLIPSIS) )
{
if ( pInfo )
- pInfo->mbEllipsis = TRUE;
+ pInfo->mbEllipsis = sal_True;
nMaxWidth = nWidth;
}
}
@@ -6754,22 +6813,22 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
// -----------------------------------------------------------------------
-static BOOL ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
+static sal_Bool ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
{
while ( *pStr )
{
if ( *pStr == c )
- return TRUE;
+ return sal_True;
pStr++;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
- USHORT nStyle ) const
+ sal_uInt16 nStyle ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
@@ -6779,7 +6838,7 @@ String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
// -----------------------------------------------------------------------
String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rOrigStr, long nMaxWidth,
- USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
+ sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout )
{
OSL_TRACE( "OutputDevice::ImplGetEllipsisString()" );
@@ -6789,7 +6848,20 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
if ( nIndex != STRING_LEN )
{
- if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ if( (nStyle & TEXT_DRAW_CENTERELLIPSIS) == TEXT_DRAW_CENTERELLIPSIS )
+ {
+ String aTmpStr( aStr );
+ xub_StrLen nEraseChars = 4;
+ while( nEraseChars < aStr.Len() && _rLayout.GetTextWidth( aTmpStr, 0, aTmpStr.Len() ) > nMaxWidth )
+ {
+ aTmpStr = aStr;
+ xub_StrLen i = (aTmpStr.Len() - nEraseChars)/2;
+ aTmpStr.Erase( i, nEraseChars++ );
+ aTmpStr.InsertAscii( "...", i );
+ }
+ aStr = aTmpStr;
+ }
+ else if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
aStr.Erase( nIndex );
if ( nIndex > 1 )
@@ -6835,7 +6907,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
{
- USHORT nFirstContent = 0;
+ sal_uInt16 nFirstContent = 0;
while ( nFirstContent < nLastContent )
{
nFirstContent++;
@@ -6899,7 +6971,7 @@ String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, c
void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- USHORT nStyle, MetricVector* pVector, String* pDisplayText )
+ sal_uInt16 nStyle, MetricVector* pVector, String* pDisplayText )
{
OSL_TRACE( "OutputDevice::DrawCtrlText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -6918,7 +6990,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
if( nIndex >= rStr.Len() )
return;
- if( (ULONG)nIndex+nLen >= rStr.Len() )
+ if( (sal_uLong)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
XubString aStr = rStr;
@@ -6940,7 +7012,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
--nLen;
DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
}
- BOOL bInvalidPos = FALSE;
+ sal_Bool bInvalidPos = sal_False;
if( nMnemonicPos >= nLen )
{
@@ -6948,12 +7020,12 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
// may occur in BiDi-Strings: the '~' is sometimes found behind the last char
// due to some strange BiDi text editors
// ->place the underline behind the string to indicate a failure
- bInvalidPos = TRUE;
+ bInvalidPos = sal_True;
nMnemonicPos = nLen-1;
}
sal_Int32* pCaretXArray = (sal_Int32*)alloca( 2 * sizeof(sal_Int32) * nLen );
- /*BOOL bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
+ /*sal_Bool bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
long lc_x1 = pCaretXArray[ 2*(nMnemonicPos - nIndex) ];
long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ];
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
@@ -6973,9 +7045,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
{
Color aOldTextColor;
Color aOldTextFillColor;
- BOOL bRestoreFillColor;
- BOOL bHighContrastBlack = FALSE;
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bRestoreFillColor;
+ sal_Bool bHighContrastBlack = sal_False;
+ sal_Bool bHighContrastWhite = sal_False;
const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
@@ -6991,11 +7063,11 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
- bRestoreFillColor = TRUE;
+ bRestoreFillColor = sal_True;
aOldTextFillColor = GetTextFillColor();
}
else
- bRestoreFillColor = FALSE;
+ bRestoreFillColor = sal_False;
if( bHighContrastBlack )
SetTextColor( COL_GREEN );
@@ -7032,7 +7104,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
long OutputDevice::GetCtrlTextWidth( const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
- USHORT nStyle ) const
+ sal_uInt16 nStyle ) const
{
OSL_TRACE( "OutputDevice::GetCtrlTextSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7046,7 +7118,7 @@ long OutputDevice::GetCtrlTextWidth( const String& rStr,
if ( nMnemonicPos < nIndex )
nIndex--;
else if ( (nLen < STRING_LEN) &&
- (nMnemonicPos >= nIndex) && (nMnemonicPos < (ULONG)(nIndex+nLen)) )
+ (nMnemonicPos >= nIndex) && (nMnemonicPos < (sal_uLong)(nIndex+nLen)) )
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen );
@@ -7135,7 +7207,7 @@ FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
// -----------------------------------------------------------------------
-BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
+sal_Bool OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
{
OSL_TRACE( "OutputDevice::AddTempDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7143,17 +7215,17 @@ BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontNa
ImplInitFontList();
if( !mpGraphics && !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
bool bRC = mpGraphics->AddTempDevFont( mpFontList, rFileURL, rFontName );
if( !bRC )
- return FALSE;
+ return sal_False;
if( mpAlphaVDev )
mpAlphaVDev->AddTempDevFont( rFileURL, rFontName );
mpFontCache->Invalidate();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -7207,7 +7279,7 @@ Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
// -----------------------------------------------------------------------
-BOOL OutputDevice::IsFontAvailable( const String& rFontName ) const
+sal_Bool OutputDevice::IsFontAvailable( const String& rFontName ) const
{
OSL_TRACE( "OutputDevice::IsFontAvailable()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7427,7 +7499,7 @@ xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
// TODO: best is to get rid of this method completely
-ULONG OutputDevice::GetKerningPairCount() const
+sal_uLong OutputDevice::GetKerningPairCount() const
{
OSL_TRACE( "OutputDevice::GetKerningPairCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7453,7 +7525,7 @@ inline bool CmpKernData( const KerningPair& a, const KerningPair& b )
}
// TODO: best is to get rid of this method completely
-void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPairs ) const
+void OutputDevice::GetKerningPairs( sal_uLong nRequestedPairs, KerningPair* pKernPairs ) const
{
OSL_TRACE( "OutputDevice::GetKerningPairs()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7475,7 +7547,7 @@ void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPai
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
+sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
int nIndex, int nLen, int nBase, MetricVector& rVector )
{
OSL_TRACE( "OutputDevice::GetGlyphBoundRect_CTL()" );
@@ -7500,14 +7572,14 @@ BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
+sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- ULONG nLayoutWidth, const sal_Int32* pDXAry ) const
+ sal_uLong nLayoutWidth, const sal_Int32* pDXAry ) const
{
OSL_TRACE( "OutputDevice::GetTextBoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rRect.SetEmpty();
SalLayout* pSalLayout = NULL;
@@ -7571,8 +7643,8 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
// so we need a monochrome virtual device with matching font
VirtualDevice aVDev( 1 );
Font aFont( GetFont() );
- aFont.SetShadow( FALSE );
- aFont.SetOutline( FALSE );
+ aFont.SetShadow( sal_False );
+ aFont.SetOutline( sal_False );
aFont.SetRelief( RELIEF_NONE );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
@@ -7605,7 +7677,7 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
Bitmap aBmp = aVDev.GetBitmap( Point(), aOutSize );
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
if( !pAcc )
- return FALSE;
+ return sal_False;
const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
const long nW = pAcc->Width();
const long nH = pAcc->Height();
@@ -7670,17 +7742,17 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() );
aTopLeft.Y() = ImplDevicePixelToLogicHeight( aTopLeft.Y() );
rRect = Rectangle( aTopLeft, aSize );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
+sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
// the fonts need to be initialized
if( mbNewFont )
@@ -7688,9 +7760,9 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return FALSE;
+ return sal_False;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
rVector.clear();
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
@@ -7698,11 +7770,11 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
// we want to get the Rectangle in logical units, so to
// avoid rounding errors we just size the font in logical units
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
if( bOldMap )
{
- const_cast<OutputDevice&>(*this).mbMap = FALSE;
- const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
+ const_cast<OutputDevice&>(*this).mbMap = sal_False;
+ const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
}
SalLayout* pSalLayout = NULL;
@@ -7762,7 +7834,7 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
{
// restore original font size and map mode
const_cast<OutputDevice&>(*this).mbMap = bOldMap;
- const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
+ const_cast<OutputDevice&>(*this).mbNewFont = sal_True;
}
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
@@ -7809,7 +7881,7 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
pSalLayout->Release();
if( !nWidth || !nHeight )
- return TRUE;
+ return sal_True;
double fScaleX = static_cast< double >(nOrgWidth) / nWidth;
double fScaleY = static_cast< double >(nOrgHeight) / nHeight;
@@ -7866,10 +7938,10 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
else
{
// convert units to logical width
- for (USHORT j = 0; j < aPolyPoly.Count(); ++j)
+ for (sal_uInt16 j = 0; j < aPolyPoly.Count(); ++j)
{
Polygon& rPoly = aPolyPoly[j];
- for (USHORT k = 0; k < rPoly.GetSize(); ++k)
+ for (sal_uInt16 k = 0; k < rPoly.GetSize(); ++k)
{
Point& rPt = rPoly[k];
rPt -= aOffset;
@@ -7907,9 +7979,9 @@ BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
+sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex,
- xub_StrLen nLen, BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ xub_StrLen nLen, sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
rResultVector.clear();
@@ -7917,7 +7989,7 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return FALSE;
+ return sal_False;
// convert to a tool polypolygon vector
rResultVector.reserve( aB2DPolyPolyVector.size() );
@@ -7925,14 +7997,14 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
rResultVector.push_back(PolyPolygon(*aIt)); // #i76339#
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
+sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
- BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
+ sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
{
rPolyPoly.Clear();
@@ -7940,7 +8012,7 @@ BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
- return FALSE;
+ return sal_False;
// convert and merge into a tool polypolygon
::basegfx::B2DPolyPolygonVector::const_iterator aIt = aB2DPolyPolyVector.begin();
@@ -7948,7 +8020,7 @@ BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
for( unsigned int i = 0; i < aIt->count(); ++i )
rPolyPoly.Insert(Polygon((*aIt).getB2DPolygon( i ))); // #i76339#
- return TRUE;
+ return sal_True;
}
bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) const
@@ -7969,22 +8041,22 @@ bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) co
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
+sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
{
rFontCharMap.Reset();
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
if( mbNewFont )
ImplNewFont();
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
- return FALSE;
+ return sal_False;
- // a little font charmap cache helps considerably
+#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
@@ -8002,10 +8074,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
else // need to cache
+#endif // ENABLE_IFC_CACHE
{
- ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
+ const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
rFontCharMap.Reset( pNewMap );
+#ifdef ENABLE_IFC_CACHE
// manage cache round-robin and insert data
CharMapCacheItem& rItem = aCache[ nCurItem ];
rItem.mpFontData = pFontData;
@@ -8016,11 +8090,12 @@ BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
if( ++nUsedItems >= NMAXITEMS )
nUsedItems = NMAXITEMS;
+#endif // ENABLE_IFC_CACHE
}
if( rFontCharMap.IsDefaultMap() )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -8031,7 +8106,7 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
if( nIndex >= rStr.Len() )
return nIndex;
xub_StrLen nEnd = nIndex + nLen;
- if( (ULONG)nIndex+nLen > rStr.Len() )
+ if( (sal_uLong)nIndex+nLen > rStr.Len() )
nEnd = rStr.Len();
DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" );
@@ -8041,11 +8116,11 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
const Font aOrigFont = GetFont();
const_cast<OutputDevice&>(*this).SetFont( rTempFont );
FontCharMap aFontCharMap;
- BOOL bRet = GetFontCharMap( aFontCharMap );
+ sal_Bool bRet = GetFontCharMap( aFontCharMap );
const_cast<OutputDevice&>(*this).SetFont( aOrigFont );
// if fontmap is unknown assume it doesn't have the glyphs
- if( bRet == FALSE )
+ if( bRet == sal_False )
return nIndex;
const sal_Unicode* pStr = rStr.GetBuffer();
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 31dafbf1652f..94226e863de5 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -87,7 +87,7 @@ void OutputDevice::ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pCl
ImplDrawPolyPolygon( rPoly, pClipPolyPoly );
else
{
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -114,7 +114,7 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if( pPolyPoly->Count() == 1 )
{
const Polygon rPoly = pPolyPoly->GetObject( 0 );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if( nSize >= 2 )
{
@@ -124,14 +124,14 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
}
else if( pPolyPoly->Count() )
{
- USHORT nCount = pPolyPoly->Count();
+ sal_uInt16 nCount = pPolyPoly->Count();
sal_uInt32* pPointAry = new sal_uInt32[nCount];
PCONSTSALPOINT* pPointAryAry = new PCONSTSALPOINT[nCount];
- USHORT i = 0;
+ sal_uInt16 i = 0;
do
{
const Polygon& rPoly = pPolyPoly->GetObject( i );
- USHORT nSize = rPoly.GetSize();
+ sal_uInt16 nSize = rPoly.GetSize();
if ( nSize )
{
pPointAry[i] = nSize;
@@ -158,26 +158,26 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
// -----------------------------------------------------------------------
-inline UINT8 ImplGetGradientColorValue( long nValue )
+inline sal_uInt8 ImplGetGradientColorValue( long nValue )
{
if ( nValue < 0 )
return 0;
else if ( nValue > 0xFF )
return 0xFF;
else
- return (UINT8)nValue;
+ return (sal_uInt8)nValue;
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
const Gradient& rGradient,
- BOOL bMtf, const PolyPolygon* pClipPolyPoly )
+ sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
{
// rotiertes BoundRect ausrechnen
Rectangle aRect;
Point aCenter;
- USHORT nAngle = rGradient.GetAngle() % 3600;
+ sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -281,9 +281,9 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
double fScanInc = (double)aRect.GetHeight() / (double)nSteps;
// Startfarbe berechnen und setzen
- UINT8 nRed;
- UINT8 nGreen;
- UINT8 nBlue;
+ sal_uInt8 nRed;
+ sal_uInt8 nGreen;
+ sal_uInt8 nBlue;
long nSteps2;
long nStepsHalf = 0;
if ( bLinear )
@@ -291,23 +291,23 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// Um 1 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
nSteps2 = nSteps + 1;
- nRed = (UINT8)nStartRed;
- nGreen = (UINT8)nStartGreen;
- nBlue = (UINT8)nStartBlue;
+ nRed = (sal_uInt8)nStartRed;
+ nGreen = (sal_uInt8)nStartGreen;
+ nBlue = (sal_uInt8)nStartBlue;
}
else
{
// Um 2 erhoeht, um die Border innerhalb der Schleife
// zeichnen zu koennen
nSteps2 = nSteps + 2;
- nRed = (UINT8)nEndRed;
- nGreen = (UINT8)nEndGreen;
- nBlue = (UINT8)nEndBlue;
+ nRed = (sal_uInt8)nEndRed;
+ nGreen = (sal_uInt8)nEndGreen;
+ nBlue = (sal_uInt8)nEndBlue;
nStepsHalf = nSteps >> 1;
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -368,9 +368,9 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
// on.
if ( i >= nSteps )
{
- nRed = (UINT8)nEndRed;
- nGreen = (UINT8)nEndGreen;
- nBlue = (UINT8)nEndBlue;
+ nRed = (sal_uInt8)nEndRed;
+ nGreen = (sal_uInt8)nEndGreen;
+ nBlue = (sal_uInt8)nEndBlue;
}
else
{
@@ -392,7 +392,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
}
if ( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -402,7 +402,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
const Gradient& rGradient,
- BOOL bMtf, const PolyPolygon* pClipPolyPoly )
+ sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
{
// Feststellen ob Ausgabe ueber Polygon oder PolyPolygon
// Bei Rasteroperationen ungleich Overpaint immer PolyPolygone,
@@ -427,7 +427,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
long nGreenSteps = nEndGreen - nStartGreen;
long nBlueSteps = nEndBlue - nStartBlue;
long nStepCount = rGradient.GetSteps();
- USHORT nAngle = rGradient.GetAngle() % 3600;
+ sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
rGradient.GetBoundRect( rRect, aRect, aCenter );
@@ -480,11 +480,11 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
double fScanRight = aRect.Right();
double fScanBottom = aRect.Bottom();
double fScanInc = (double) nMinRect / (double) nSteps * 0.5;
- UINT8 nRed = (UINT8) nStartRed, nGreen = (UINT8) nStartGreen, nBlue = (UINT8) nStartBlue;
+ sal_uInt8 nRed = (sal_uInt8) nStartRed, nGreen = (sal_uInt8) nStartGreen, nBlue = (sal_uInt8) nStartBlue;
bool bPaintLastPolygon( false ); // #107349# Paint last polygon only if loop has generated any output
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -552,7 +552,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
// the one painted in the window outdev path below. To get
// matching colors, have to delay color setting here.
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
@@ -560,7 +560,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
{
// #107349# Set fill color _before_ geometry painting
if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
else
mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
@@ -587,7 +587,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
if( bMtf )
{
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
mpMetaFile->AddAction( new MetaPolygonAction( rPoly ) );
}
else
@@ -647,7 +647,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
@@ -707,19 +707,19 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
// calculate step count if neccessary
if ( !aGradient.GetSteps() )
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, FALSE, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, sal_False, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, FALSE, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, sal_False, NULL );
}
Pop();
@@ -795,9 +795,9 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
}
else
{
- const BOOL bOldOutput = IsOutputEnabled();
+ const sal_Bool bOldOutput = IsOutputEnabled();
- EnableOutput( FALSE );
+ EnableOutput( sal_False );
Push( PUSH_RASTEROP );
SetRasterOp( ROP_XOR );
DrawGradient( aRect, rGradient );
@@ -825,7 +825,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if ( mnDrawMode & DRAWMODE_GRAYGRADIENT )
{
- BYTE cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
+ sal_uInt8 cStartLum = aStartCol.GetLuminance(), cEndLum = aEndCol.GetLuminance();
aStartCol = Color( cStartLum, cStartLum, cStartLum );
aEndCol = Color( cEndLum, cEndLum, cEndLum );
}
@@ -872,19 +872,19 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
- mbInitLineColor = TRUE;
+ mbInitLineColor = sal_True;
}
- mbInitFillColor = TRUE;
+ mbInitFillColor = sal_True;
// calculate step count if neccessary
if ( !aGradient.GetSteps() )
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
+ ImplDrawLinearGradient( aRect, aGradient, sal_False, &aClipPolyPoly );
else
- ImplDrawComplexGradient( aRect, aGradient, FALSE, &aClipPolyPoly );
+ ImplDrawComplexGradient( aRect, aGradient, sal_False, &aClipPolyPoly );
}
}
}
@@ -926,9 +926,9 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( pVDev->SetOutputSizePixel( aDstSize) )
{
MapMode aVDevMap;
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
pVDev->DrawOutDev( Point(), aDstSize, aDstRect.TopLeft(), aDstSize, *this );
pVDev->SetRasterOp( ROP_XOR );
@@ -977,7 +977,7 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
mpMetaFile->AddAction( new MetaISectRectClipRegionAction( aRect ) );
- mpMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpMetaFile->AddAction( new MetaLineColorAction( Color(), sal_False ) );
// because we draw with no border line, we have to expand gradient
// rect to avoid missing lines on the right and bottom edge
@@ -991,9 +991,9 @@ void OutputDevice::AddGradientActions( const Rectangle& rRect, const Gradient& r
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GRADIENT_LINEAR || aGradient.GetStyle() == GRADIENT_AXIAL )
- ImplDrawLinearGradient( aRect, aGradient, TRUE, NULL );
+ ImplDrawLinearGradient( aRect, aGradient, sal_True, NULL );
else
- ImplDrawComplexGradient( aRect, aGradient, TRUE, NULL );
+ ImplDrawComplexGradient( aRect, aGradient, sal_True, NULL );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
@@ -1021,7 +1021,7 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYLINE )
{
- const UINT8 cLum = aColor.GetLuminance();
+ const sal_uInt8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
@@ -1058,17 +1058,17 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
{
PolyPolygon aPolyPoly( LogicToPixel( rPolyPoly ) );
GDIMetaFile* pOldMetaFile = mpMetaFile;
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
aHatch.SetDistance( ImplLogicWidthToDevicePixel( aHatch.GetDistance() ) );
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_LINECOLOR );
SetLineColor( aHatch.GetColor() );
ImplInitLineColor();
- ImplDrawHatch( aPolyPoly, aHatch, FALSE );
+ ImplDrawHatch( aPolyPoly, aHatch, sal_False );
Pop();
EnableMapMode( bOldMap );
mpMetaFile = pOldMetaFile;
@@ -1094,8 +1094,8 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
mpMetaFile = &rMtf;
mpMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
- mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), TRUE ) );
- ImplDrawHatch( aPolyPoly, rHatch, TRUE );
+ mpMetaFile->AddAction( new MetaLineColorAction( rHatch.GetColor(), sal_True ) );
+ ImplDrawHatch( aPolyPoly, rHatch, sal_True );
mpMetaFile->AddAction( new MetaPopAction() );
mpMetaFile = pOldMtf;
}
@@ -1103,7 +1103,7 @@ void OutputDevice::AddHatchActions( const PolyPolygon& rPolyPoly, const Hatch& r
// -----------------------------------------------------------------------
-void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, BOOL bMtf )
+void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf )
{
Rectangle aRect( rPolyPoly.GetBoundRect() );
const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
@@ -1154,7 +1154,7 @@ void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHa
// -----------------------------------------------------------------------
-void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHORT nAngle10,
+void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10,
Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 )
{
Point aRef;
@@ -1265,14 +1265,14 @@ void OutputDevice::ImplCalcHatchValues( const Rectangle& rRect, long nDist, USHO
// ------------------------------------------------------------------------
void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly,
- Point* pPtBuffer, BOOL bMtf )
+ Point* pPtBuffer, sal_Bool bMtf )
{
double fX, fY;
long nAdd, nPCounter = 0;
for( long nPoly = 0, nPolyCount = rPolyPoly.Count(); nPoly < nPolyCount; nPoly++ )
{
- const Polygon& rPoly = rPolyPoly[ (USHORT) nPoly ];
+ const Polygon& rPoly = rPolyPoly[ (sal_uInt16) nPoly ];
if( rPoly.GetSize() > 1 )
{
@@ -1280,7 +1280,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
for( long i = 1, nCount = rPoly.GetSize(); i <= nCount; i++ )
{
- aCurSegment.SetEnd( rPoly[ (USHORT)( i % nCount ) ] );
+ aCurSegment.SetEnd( rPoly[ (sal_uInt16)( i % nCount ) ] );
nAdd = 0;
if( rLine.Intersection( aCurSegment, fX, fY ) )
@@ -1288,7 +1288,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
if( ( fabs( fX - aCurSegment.GetStart().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetStart().Y() ) <= 0.0000001 ) )
{
- const Line aPrevSegment( rPoly[ (USHORT)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() );
+ const Line aPrevSegment( rPoly[ (sal_uInt16)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() );
const double fPrevDistance = rLine.GetDistance( aPrevSegment.GetStart() );
const double fCurDistance = rLine.GetDistance( aCurSegment.GetEnd() );
@@ -1301,7 +1301,7 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
else if( ( fabs( fX - aCurSegment.GetEnd().X() ) <= 0.0000001 ) &&
( fabs( fY - aCurSegment.GetEnd().Y() ) <= 0.0000001 ) )
{
- const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (USHORT)( ( i + 1 ) % nCount ) ] );
+ const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (sal_uInt16)( ( i + 1 ) % nCount ) ] );
if( ( fabs( rLine.GetDistance( aNextSegment.GetEnd() ) ) <= 0.0000001 ) &&
( rLine.GetDistance( aCurSegment.GetStart() ) > 0.0 ) )
diff --git a/vcl/source/gdi/outdev5.cxx b/vcl/source/gdi/outdev5.cxx
index 2f57a0d0555f..2df0ff86dc3e 100644
--- a/vcl/source/gdi/outdev5.cxx
+++ b/vcl/source/gdi/outdev5.cxx
@@ -49,7 +49,7 @@ DBG_NAMEEX( OutputDevice )
// =======================================================================
void OutputDevice::DrawRect( const Rectangle& rRect,
- ULONG nHorzRound, ULONG nVertRound )
+ sal_uLong nHorzRound, sal_uLong nVertRound )
{
OSL_TRACE( "OutputDevice::DrawRoundRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index df685b913b52..92898ebfdf3a 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -58,7 +58,7 @@ DBG_NAMEEX( OutputDevice )
// ------------------------------------------------------------------------
-void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags )
+void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags )
{
OSL_TRACE( "OutputDevice::DrawGrid()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -116,8 +116,8 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nF
if( mbInitFillColor )
ImplInitFillColor();
- const BOOL bOldMap = mbMap;
- EnableMapMode( FALSE );
+ const sal_Bool bOldMap = mbMap;
+ EnableMapMode( sal_False );
if( nFlags & GRID_DOTS )
{
@@ -223,7 +223,7 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
// ------------------------------------------------------------------------
void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent )
+ sal_uInt16 nTransparencePercent )
{
OSL_TRACE( "OutputDevice::DrawTransparent()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -345,7 +345,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L );
long nMove;
- const USHORT nTrans = ( nTransparencePercent < 13 ) ? 0 :
+ const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
( nTransparencePercent < 38 ) ? 25 :
( nTransparencePercent < 63 ) ? 50 :
( nTransparencePercent < 88 ) ? 75 : 100;
@@ -366,8 +366,8 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
IntersectClipRegion( rPolyPoly );
SetLineColor( GetFillColor() );
- const BOOL bOldMap = mbMap;
- EnableMapMode( FALSE );
+ const sal_Bool bOldMap = mbMap;
+ EnableMapMode( sal_False );
if(nMove)
{
@@ -454,16 +454,16 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
{
VirtualDevice aVDev( *this, 1 );
const Size aDstSz( aDstRect.GetSize() );
- const BYTE cTrans = (BYTE) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
+ const sal_uInt8 cTrans = (sal_uInt8) MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 );
if( aDstRect.Left() || aDstRect.Top() )
aPolyPoly.Move( -aDstRect.Left(), -aDstRect.Top() );
if( aVDev.SetOutputSizePixel( aDstSz ) )
{
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
aVDev.SetLineColor( COL_BLACK );
aVDev.SetFillColor( COL_BLACK );
@@ -491,25 +491,25 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( aPaint.GetBitCount() <= 8 )
{
const BitmapPalette& rPal = pW->GetPalette();
- const USHORT nCount = rPal.GetEntryCount();
- BitmapColor* pMap = (BitmapColor*) new BYTE[ nCount * sizeof( BitmapColor ) ];
+ const sal_uInt16 nCount = rPal.GetEntryCount();
+ BitmapColor* pMap = (BitmapColor*) new sal_uInt8[ nCount * sizeof( BitmapColor ) ];
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
BitmapColor aCol( rPal[ i ] );
- pMap[ i ] = BitmapColor( (BYTE) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
+ pMap[ i ] = BitmapColor( (sal_uInt8) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
}
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
{
- const BYTE cBlack = aBlack.GetIndex();
+ const sal_uInt8 cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
Scanline pWScan = pW->GetScanline( nY );
Scanline pRScan = pR->GetScanline( nY );
- BYTE cBit = 128;
+ sal_uInt8 cBit = 128;
for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan++ )
{
@@ -517,7 +517,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
cBit = 128, pRScan++;
if( ( *pRScan & cBit ) == cBlack )
- *pWScan = (BYTE) pMap[ *pWScan ].GetIndex();
+ *pWScan = (sal_uInt8) pMap[ *pWScan ].GetIndex();
}
}
}
@@ -529,20 +529,20 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
pW->SetPixel( nY, nX, pMap[ pW->GetPixel( nY, nX ).GetIndex() ] );
}
- delete[] (BYTE*) pMap;
+ delete[] (sal_uInt8*) pMap;
}
else
{
if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
pW->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR )
{
- const BYTE cBlack = aBlack.GetIndex();
+ const sal_uInt8 cBlack = aBlack.GetIndex();
for( nY = 0; nY < nHeight; nY++ )
{
Scanline pWScan = pW->GetScanline( nY );
Scanline pRScan = pR->GetScanline( nY );
- BYTE cBit = 128;
+ sal_uInt8 cBit = 128;
for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan += 3 )
{
@@ -606,9 +606,9 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( mpAlphaVDev )
{
const Color aFillCol( mpAlphaVDev->GetFillColor() );
- mpAlphaVDev->SetFillColor( Color(sal::static_int_cast<UINT8>(255*nTransparencePercent/100),
- sal::static_int_cast<UINT8>(255*nTransparencePercent/100),
- sal::static_int_cast<UINT8>(255*nTransparencePercent/100)) );
+ mpAlphaVDev->SetFillColor( Color(sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
+ sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
+ sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100)) );
mpAlphaVDev->DrawTransparent( rPolyPoly, nTransparencePercent );
@@ -723,19 +723,19 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
AlphaMask aAlpha;
MapMode aMap( GetMapMode() );
Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
- const BOOL bOldMap = mbMap;
+ const sal_Bool bOldMap = mbMap;
aMap.SetOrigin( Point( -aOutPos.X(), -aOutPos.Y() ) );
pVDev->SetMapMode( aMap );
- const BOOL bVDevOldMap = pVDev->IsMapModeEnabled();
+ const sal_Bool bVDevOldMap = pVDev->IsMapModeEnabled();
// create paint bitmap
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
aPaint = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
// create mask bitmap
pVDev->SetLineColor( COL_BLACK );
@@ -746,22 +746,22 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
( (GDIMetaFile&) rMtf ).WindStart();
( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
aMask = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( sal_True ) here!
// create alpha mask from gradient
pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
pVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
pVDev->SetDrawMode( DRAWMODE_DEFAULT );
- pVDev->EnableMapMode( FALSE );
+ pVDev->EnableMapMode( sal_False );
pVDev->DrawMask( Point(), pVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
aAlpha = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
delete pVDev;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha ) );
EnableMapMode( bOldMap );
}
@@ -785,8 +785,8 @@ void OutputDevice::ImplDrawColorWallpaper( long nX, long nY,
Color aOldFillColor = GetFillColor();
SetLineColor();
SetFillColor( rWallpaper.GetColor() );
- BOOL bMap = mbMap;
- EnableMapMode( FALSE );
+ sal_Bool bMap = mbMap;
+ EnableMapMode( sal_False );
DrawRect( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
SetLineColor( aOldLineColor );
SetFillColor( aOldFillColor );
@@ -805,10 +805,10 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
Size aSize;
GDIMetaFile* pOldMetaFile = mpMetaFile;
const WallpaperStyle eStyle = rWallpaper.GetStyle();
- const BOOL bOldMap = mbMap;
- BOOL bDrawn = FALSE;
- BOOL bDrawGradientBackground = FALSE;
- BOOL bDrawColorBackground = FALSE;
+ const sal_Bool bOldMap = mbMap;
+ sal_Bool bDrawn = sal_False;
+ sal_Bool bDrawGradientBackground = sal_False;
+ sal_Bool bDrawColorBackground = sal_False;
if( pCached )
aBmpEx = *pCached;
@@ -817,13 +817,13 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
const long nBmpWidth = aBmpEx.GetSizePixel().Width();
const long nBmpHeight = aBmpEx.GetSizePixel().Height();
- const BOOL bTransparent = aBmpEx.IsTransparent();
+ const sal_Bool bTransparent = aBmpEx.IsTransparent();
// draw background
if( bTransparent )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = TRUE;
+ bDrawGradientBackground = sal_True;
else
{
if( !pCached && !rWallpaper.GetColor().GetTransparency() )
@@ -835,15 +835,15 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
aBmpEx = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
}
- bDrawColorBackground = TRUE;
+ bDrawColorBackground = sal_True;
}
}
else if( eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE )
{
if( rWallpaper.IsGradient() )
- bDrawGradientBackground = TRUE;
+ bDrawGradientBackground = sal_True;
else
- bDrawColorBackground = TRUE;
+ bDrawColorBackground = sal_True;
}
// background of bitmap?
@@ -852,7 +852,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
else if( bDrawColorBackground && bTransparent )
{
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
- bDrawColorBackground = FALSE;
+ bDrawColorBackground = sal_False;
}
// calc pos and size
@@ -869,7 +869,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
}
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -969,7 +969,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
for( long nBmpX = nStartX; nBmpX <= nRight; nBmpX += nBmpWidth )
DrawBitmapEx( Point( nBmpX, nBmpY ), aBmpEx );
- bDrawn = TRUE;
+ bDrawn = sal_True;
}
break;
}
@@ -1044,8 +1044,8 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
{
Rectangle aBound;
GDIMetaFile* pOldMetaFile = mpMetaFile;
- const BOOL bOldMap = mbMap;
- BOOL bNeedGradient = TRUE;
+ const sal_Bool bOldMap = mbMap;
+ sal_Bool bNeedGradient = sal_True;
/*
if ( rWallpaper.IsRect() )
@@ -1055,7 +1055,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
mpMetaFile = NULL;
- EnableMapMode( FALSE );
+ EnableMapMode( sal_False );
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
@@ -1072,7 +1072,7 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
if( mnOutOffX+nWidth > gradientWidth )
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
if( mnOutOffX > gradientWidth )
- bNeedGradient = FALSE;
+ bNeedGradient = sal_False;
else
aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) );
}
@@ -1134,7 +1134,7 @@ void OutputDevice::Erase()
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( meOutDevType == OUTDEV_WINDOW )
{
Window* pWindow = static_cast<Window*>(this);
@@ -1218,7 +1218,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- (BYTE*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
+ (sal_uInt8*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
}
// else draw the substitution graphics
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index b5766c86db7d..4ac1d4610b3f 100644..100755
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -88,6 +88,10 @@ MenubarValue::~MenubarValue()
{
}
+MenupopupValue::~MenupopupValue()
+{
+}
+
PushButtonValue::~PushButtonValue()
{
}
@@ -99,14 +103,14 @@ PushButtonValue::~PushButtonValue()
// -----------------------------------------------------------------------
-BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
return( mpGraphics->IsNativeControlSupported(nType, nPart) );
}
@@ -114,18 +118,18 @@ BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar
// -----------------------------------------------------------------------
-BOOL OutputDevice::HitTestNativeControl( ControlType nType,
+sal_Bool OutputDevice::HitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
Point aWinOffs( mnOutOffX, mnOutOffY );
Rectangle screenRegion( rControlRegion );
@@ -201,14 +205,21 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im
case CTRL_GENERIC:
aResult.reset( new ImplControlValue( rVal ) );
break;
+ case CTRL_MENU_POPUP:
+ {
+ const MenupopupValue* pMVal = static_cast<const MenupopupValue*>(&rVal);
+ MenupopupValue* pNew = new MenupopupValue( *pMVal );
+ pNew->maItemRect = rDev.ImplLogicToDevicePixel( pMVal->maItemRect );
+ aResult.reset( pNew );
+ }
+ break;
default:
OSL_FAIL( "unknown ImplControlValue type !" );
break;
}
return aResult;
}
-
-BOOL OutputDevice::DrawNativeControl( ControlType nType,
+sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -216,17 +227,17 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
if ( mbInitClipRegion )
ImplInitClipRegion();
- if ( mbOutputClipped )
- return TRUE;
+ if ( mbOutputClipped || rControlRegion.IsEmpty() )
+ return sal_True;
if ( mbInitLineColor )
ImplInitLineColor();
@@ -243,7 +254,7 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
if( aTestRegion == rControlRegion )
nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed
- BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+ sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -251,7 +262,7 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
// -----------------------------------------------------------------------
-BOOL OutputDevice::DrawNativeControlText(ControlType nType,
+sal_Bool OutputDevice::DrawNativeControlText(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -259,7 +270,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
::rtl::OUString aCaption )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
@@ -281,7 +292,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
+ sal_Bool bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -289,7 +300,7 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
// -----------------------------------------------------------------------
-BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
+sal_Bool OutputDevice::GetNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -299,18 +310,18 @@ BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
Rectangle &rNativeContentRegion )
{
if( !lcl_enableNativeWidget( *this ) )
- return FALSE;
+ return sal_False;
if ( !mpGraphics )
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
// Convert the coordinates from relative to Window-absolute, so we draw
// in the correct place in platform code
boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
+ sal_Bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
aCaption, rNativeBoundingRegion,
rNativeContentRegion, this );
if( bRet )
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index d33f58d3ef14..a0b2c6521aac 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -131,7 +131,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
long nDenomHalfX = rMapRes.mnMapScDenomX / 2;
- ULONG nDenomX = rMapRes.mnMapScDenomX;
+ sal_uLong nDenomX = rMapRes.mnMapScDenomX;
long nProductX = nDPIX * rMapRes.mnMapScNumX;
if ( !nProductX )
@@ -142,9 +142,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomX )
rThresRes.mnThresPixToLogX = LONG_MAX;
else if ( nProductX >= 0 )
- rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX - (ULONG)( nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductX/2)) / nDenomX);
else
- rThresRes.mnThresPixToLogX = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductX/2)) / nDenomX);
+ rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductX/2)) / nDenomX);
}
if ( nDPIY && (LONG_MAX / nDPIY < Abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero
@@ -156,7 +156,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
{
// Schwellenwerte fuer BigInt Arithmetik berechnen
long nDenomHalfY = rMapRes.mnMapScDenomY / 2;
- ULONG nDenomY = rMapRes.mnMapScDenomY;
+ sal_uLong nDenomY = rMapRes.mnMapScDenomY;
long nProductY = nDPIY * rMapRes.mnMapScNumY;
if ( !nProductY )
@@ -167,9 +167,9 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
if ( !nDenomY )
rThresRes.mnThresPixToLogY = LONG_MAX;
else if ( nProductY >= 0 )
- rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX - (ULONG)( nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX - (sal_uLong)( nProductY/2)) / nDenomY);
else
- rThresRes.mnThresPixToLogY = (long)(((ULONG)LONG_MAX + (ULONG)(-nProductY/2)) / nDenomY);
+ rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductY/2)) / nDenomY);
}
rThresRes.mnThresLogToPixX /= 2;
@@ -600,8 +600,8 @@ Polygon OutputDevice::ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const
if ( !mbMap && !mnOutOffX && !mnOutOffY )
return rLogicPoly;
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -644,8 +644,8 @@ PolyPolygon OutputDevice::ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyP
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = ImplLogicToDevicePixel( rPoly );
@@ -725,7 +725,7 @@ Region OutputDevice::ImplPixelToDevicePixel( const Region& rRegion ) const
// -----------------------------------------------------------------------
-void OutputDevice::EnableMapMode( BOOL bEnable )
+void OutputDevice::EnableMapMode( sal_Bool bEnable )
{
mbMap = (bEnable != 0);
@@ -744,12 +744,12 @@ void OutputDevice::SetMapMode()
if ( mbMap || !maMapMode.IsDefault() )
{
- mbMap = FALSE;
+ mbMap = sal_False;
maMapMode = MapMode();
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
+ mbNewFont = sal_True;
+ mbInitFont = sal_True;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -774,7 +774,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- BOOL bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
+ sal_Bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
if ( mpMetaFile )
{
@@ -793,7 +793,7 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
mpAlphaVDev->SetMapMode( rNewMapMode );
// Ist Default-MapMode, dann bereche nichts
- BOOL bOldMap = mbMap;
+ sal_Bool bOldMap = mbMap;
mbMap = !rNewMapMode.IsDefault();
if ( mbMap )
{
@@ -849,8 +849,8 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
maMapMode = rNewMapMode;
// create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
+ mbNewFont = sal_True;
+ mbInitFont = sal_True;
if ( GetOutDevType() == OUTDEV_WINDOW )
{
if ( ((Window*)this)->mpWindowImpl->mpCursor )
@@ -1121,8 +1121,8 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly ) const
if ( !mbMap )
return rLogicPoly;
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1155,8 +1155,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly ) cons
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly );
@@ -1217,7 +1217,7 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1324,8 +1324,8 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- USHORT i;
- USHORT nPoints = rLogicPoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rLogicPoly.GetSize();
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1359,8 +1359,8 @@ PolyPolygon OutputDevice::LogicToPixel( const PolyPolygon& rLogicPolyPoly,
return rLogicPolyPoly;
PolyPolygon aPolyPoly( rLogicPolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = LogicToPixel( rPoly, rMapMode );
@@ -1415,7 +1415,7 @@ Region OutputDevice::LogicToPixel( const Region& rLogicRegion,
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rLogicRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1498,8 +1498,8 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly ) const
if ( !mbMap )
return rDevicePoly;
- USHORT i;
- USHORT nPoints = rDevicePoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1532,8 +1532,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly ) con
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly );
@@ -1585,7 +1585,7 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion ) const
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -1696,8 +1696,8 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- USHORT i;
- USHORT nPoints = rDevicePoly.GetSize();
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rDevicePoly.GetSize();
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
@@ -1731,8 +1731,8 @@ PolyPolygon OutputDevice::PixelToLogic( const PolyPolygon& rDevicePolyPoly,
return rDevicePolyPoly;
PolyPolygon aPolyPoly( rDevicePolyPoly );
- USHORT nPoly = aPolyPoly.Count();
- for( USHORT i = 0; i < nPoly; i++ )
+ sal_uInt16 nPoly = aPolyPoly.Count();
+ for( sal_uInt16 i = 0; i < nPoly; i++ )
{
Polygon& rPoly = aPolyPoly[i];
rPoly = PixelToLogic( rPoly, rMapMode );
@@ -1787,7 +1787,7 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
long nWidth;
long nHeight;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
aRegion.ImplBeginAddRect();
bRegionRect = rDeviceRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
@@ -2103,7 +2103,7 @@ Rectangle OutputDevice::LogicToLogic( const Rectangle& rRectSource,
// -----------------------------------------------------------------------
-long* OutputDevice::LogicToLogic( long* pX, USHORT nCount,
+long* OutputDevice::LogicToLogic( long* pX, sal_uInt16 nCount,
const MapMode* pMapModeSource,
const MapMode* pMapModeDest ) const
{
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 0119350063e0..2b3173c4b128 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -783,7 +783,7 @@ void PDFExtOutDevData::EndGroup()
mpPageSyncData->PushAction( mrOutDev, PDFExtOutDevDataSync::EndGroup );
}
void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
- BYTE nTransparency,
+ sal_uInt8 nTransparency,
const Rectangle& rOutputRect,
const Rectangle& rVisibleOutputRect )
{
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index fd527fb94e55..881205e0af77 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -39,9 +39,9 @@ PDFWriter::AnyWidget::~AnyWidget()
{
}
-PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext )
+PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
:
- pImplementation( new PDFWriterImpl( rContext ) )
+ pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
{
}
@@ -70,16 +70,6 @@ PDFWriter::PDFVersion PDFWriter::GetVersion() const
return ((PDFWriterImpl*)pImplementation)->getVersion();
}
-void PDFWriter::SetDocInfo( const PDFDocInfo& rInfo )
-{
- ((PDFWriterImpl*)pImplementation)->setDocInfo( rInfo );
-}
-
-const PDFDocInfo& PDFWriter::GetDocInfo() const
-{
- return ((PDFWriterImpl*)pImplementation)->getDocInfo();
-}
-
void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{
((PDFWriterImpl*)pImplementation)->setDocumentLocale( rLoc );
@@ -101,7 +91,7 @@ void PDFWriter::DrawTextLine(
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
- BOOL bUnderlineAbove )
+ sal_Bool bUnderlineAbove )
{
((PDFWriterImpl*)pImplementation)->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
@@ -118,7 +108,7 @@ void PDFWriter::DrawTextArray(
void PDFWriter::DrawStretchText(
const Point& rStartPt,
- ULONG nWidth,
+ sal_uLong nWidth,
const XubString& rStr,
xub_StrLen nIndex,
xub_StrLen nLen )
@@ -129,7 +119,7 @@ void PDFWriter::DrawStretchText(
void PDFWriter::DrawText(
const Rectangle& rRect,
const XubString& rStr,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
((PDFWriterImpl*)pImplementation)->drawText( rRect, rStr, nStyle );
}
@@ -159,7 +149,7 @@ void PDFWriter::DrawRect( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect );
}
-void PDFWriter::DrawRect( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
+void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
{
((PDFWriterImpl*)pImplementation)->drawRectangle( rRect, nHorzRound, nVertRound );
}
@@ -292,7 +282,7 @@ void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpap
((PDFWriterImpl*)pImplementation)->drawWallpaper( rRect, rWallpaper );
}
-void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent )
+void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
{
((PDFWriterImpl*)pImplementation)->drawTransparent( rPolyPoly, nTransparencePercent );
}
@@ -302,7 +292,7 @@ void PDFWriter::BeginTransparencyGroup()
((PDFWriterImpl*)pImplementation)->beginTransparencyGroup();
}
-void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, USHORT nTransparentPercent )
+void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
{
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, nTransparentPercent );
}
@@ -312,7 +302,7 @@ void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, const Bitmap& rAlp
((PDFWriterImpl*)pImplementation)->endTransparencyGroup( rRect, rAlphaMask );
}
-void PDFWriter::Push( USHORT nFlags )
+void PDFWriter::Push( sal_uInt16 nFlags )
{
((PDFWriterImpl*)pImplementation)->push( nFlags );
}
@@ -367,12 +357,12 @@ void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
((PDFWriterImpl*)pImplementation)->intersectClipRegion( rRect );
}
-void PDFWriter::SetAntialiasing( USHORT nMode )
+void PDFWriter::SetAntialiasing( sal_uInt16 nMode )
{
((PDFWriterImpl*)pImplementation)->setAntiAlias( (sal_Int32)nMode );
}
-void PDFWriter::SetLayoutMode( ULONG nMode )
+void PDFWriter::SetLayoutMode( sal_uLong nMode )
{
((PDFWriterImpl*)pImplementation)->setLayoutMode( (sal_Int32)nMode );
}
@@ -571,4 +561,18 @@ std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
return ((PDFWriterImpl*)pImplementation)->getErrors();
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
+}
+
+void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
+{
+ ((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6afa91f16c73..1373d0f9b280 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -55,6 +55,7 @@
#include <vcl/metric.hxx>
#include <vcl/fontsubset.hxx>
#include <vcl/textlayout.hxx>
+#include <vcl/cvtgrf.hxx>
#include <svsys.h>
#include <vcl/salgdi.hxx>
#include <vcl/svapp.hxx>
@@ -68,6 +69,7 @@
#include "cppuhelper/implbase1.hxx"
#include <icc/sRGB-IEC61966-2.1.hxx>
#include <vcl/lineinfo.hxx>
+#include "vcl/strhelper.hxx"
using namespace vcl;
@@ -120,12 +122,10 @@ void doTestCode()
aContext.Version = PDFWriter::PDF_1_4;
aContext.Tagged = true;
aContext.InitialPage = 2;
+ aContext.DocumentInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
+ aContext.DocumentInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
PDFWriter aWriter( aContext );
- PDFDocInfo aDocInfo;
- aDocInfo.Title = OUString( RTL_CONSTASCII_USTRINGPARAM( "PDF export test document" ) );
- aDocInfo.Producer = OUString( RTL_CONSTASCII_USTRINGPARAM( "VCL" ) );
- aWriter.SetDocInfo( aDocInfo );
aWriter.NewPage( 595, 842 );
aWriter.BeginStructureElement( PDFWriter::Document );
// set duration of 3 sec for first page
@@ -259,7 +259,7 @@ void doTestCode()
BitmapWriteAccess* pAcc = aTransMask.AcquireWriteAccess();
for( int nX = 0; nX < 256; nX++ )
for( int nY = 0; nY < 256; nY++ )
- pAcc->SetPixel( nX, nY, BitmapColor( (BYTE)((nX+nY)/2) ) );
+ pAcc->SetPixel( nX, nY, BitmapColor( (sal_uInt8)((nX+nY)/2) ) );
aTransMask.ReleaseAccess( pAcc );
aTransMask.SetPrefMapMode( MAP_MM );
aTransMask.SetPrefSize( Size( 10, 10 ) );
@@ -503,6 +503,12 @@ static inline double pixelToPoint( sal_Int32 px ) { return double(px)/fDivisor;
static inline double pixelToPoint( double px ) { return px/fDivisor; }
static inline sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); }
+const sal_uInt8 PDFWriterImpl::s_nPadString[32] =
+{
+ 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
+ 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
+};
+
static void appendHex( sal_Int8 nInt, OStringBuffer& rBuffer )
{
static const sal_Char pHexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7',
@@ -890,34 +896,44 @@ static void appendDouble( double fValue, OStringBuffer& rBuffer, sal_Int32 nPrec
}
-static void appendColor( const Color& rColor, OStringBuffer& rBuffer )
+static void appendColor( const Color& rColor, OStringBuffer& rBuffer, bool bConvertToGrey = false )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ if( bConvertToGrey )
+ {
+ sal_uInt8 cByte = rColor.GetLuminance();
+ appendDouble( (double)cByte / 255.0, rBuffer );
+ }
+ else
+ {
+ appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ }
}
}
-static void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " RG" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " G" : " RG" );
}
}
-static void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " rg" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " g" : " rg" );
}
}
@@ -1438,17 +1454,17 @@ void PDFWriterImpl::PDFPage::convertRect( Rectangle& rRect ) const
void PDFWriterImpl::PDFPage::appendPolygon( const Polygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
/*
* #108582# applications do weird things
*/
sal_uInt32 nBufLen = rBuffer.getLength();
if( nPoints > 0 )
{
- const BYTE* pFlagArray = rPoly.GetConstFlagAry();
+ const sal_uInt8* pFlagArray = rPoly.GetConstFlagAry();
appendPoint( rPoly[0], rBuffer );
rBuffer.append( " m\n" );
- for( USHORT i = 1; i < nPoints; i++ )
+ for( sal_uInt16 i = 1; i < nPoints; i++ )
{
if( pFlagArray && pFlagArray[i] == POLY_CONTROL && nPoints-i > 2 )
{
@@ -1559,8 +1575,8 @@ void PDFWriterImpl::PDFPage::appendPolygon( const basegfx::B2DPolygon& rPoly, OS
void PDFWriterImpl::PDFPage::appendPolyPolygon( const PolyPolygon& rPolyPoly, OStringBuffer& rBuffer, bool bClose ) const
{
- USHORT nPolygons = rPolyPoly.Count();
- for( USHORT n = 0; n < nPolygons; n++ )
+ sal_uInt16 nPolygons = rPolyPoly.Count();
+ for( sal_uInt16 n = 0; n < nPolygons; n++ )
appendPolygon( rPolyPoly[n], rBuffer, bClose );
}
@@ -1695,7 +1711,9 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
* class PDFWriterImpl
*/
-PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
+ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext,
+ const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc,
+ PDFWriter& i_rOuterFace)
:
m_pReferenceDevice( NULL ),
m_aMapMode( MAP_POINT, Point(), Fraction( 1L, pointToPixel(1) ), Fraction( 1L, pointToPixel(1) ) ),
@@ -1716,12 +1734,10 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_aCipher( (rtlCipher)NULL ),
m_aDigest( NULL ),
m_bEncryptThisStream( false ),
- m_aDocID( 32 ),
- m_aCreationDateString( 64 ),
- m_aCreationMetaDateString( 64 ),
m_pEncryptionBuffer( NULL ),
m_nEncryptionBufferSize( 0 ),
- m_bIsPDF_A1( false )
+ m_bIsPDF_A1( false ),
+ m_rOuterFace( i_rOuterFace )
{
#ifdef DO_TEST_PDF
static bool bOnce = true;
@@ -1760,14 +1776,37 @@ PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext )
m_bOpen = true;
-/* prepare the cypher engine, can be done in CTOR, free in DTOR */
+ // setup DocInfo
+ setupDocInfo();
+ /* prepare the cypher engine, can be done in CTOR, free in DTOR */
m_aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
m_aDigest = rtl_digest_createMD5();
-/* the size of the Codec default maximum */
+ /* the size of the Codec default maximum */
checkEncryptionBufferSize( 0x4000 );
+ if( xEnc.is() )
+ prepareEncryption( xEnc );
+
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ // sanity check
+ if( m_aContext.Encryption.OValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.UValue.size() != ENCRYPTED_PWD_SIZE ||
+ m_aContext.Encryption.EncryptionKey.size() != MAXIMUM_RC4_KEY_LENGTH
+ )
+ {
+ // the field lengths are invalid ? This was not setup by initEncryption.
+ // do not encrypt after all
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ OSL_ENSURE( 0, "encryption data failed sanity check, encryption disabled" );
+ }
+ else // setup key lengths
+ m_nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, m_nKeyLength, m_nRC4KeyLength );
+ }
+
// write header
OStringBuffer aBuffer( 20 );
aBuffer.append( "%PDF-" );
@@ -1813,139 +1852,138 @@ PDFWriterImpl::~PDFWriterImpl()
rtl_freeMemory( m_pEncryptionBuffer );
}
-void PDFWriterImpl::setDocInfo( const PDFDocInfo& rInfo )
+void PDFWriterImpl::setupDocInfo()
{
- m_aDocInfo.Title = rInfo.Title;
- m_aDocInfo.Author = rInfo.Author;
- m_aDocInfo.Subject = rInfo.Subject;
- m_aDocInfo.Keywords = rInfo.Keywords;
- m_aDocInfo.Creator = rInfo.Creator;
- m_aDocInfo.Producer = rInfo.Producer;
+ std::vector< sal_uInt8 > aId;
+ computeDocumentIdentifier( aId, m_aContext.DocumentInfo, m_aCreationDateString, m_aCreationMetaDateString );
+ if( m_aContext.Encryption.DocumentIdentifier.empty() )
+ m_aContext.Encryption.DocumentIdentifier = aId;
+}
-//build the document id
+void PDFWriterImpl::computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ )
+{
+ o_rIdentifier.clear();
+
+ //build the document id
rtl::OString aInfoValuesOut;
OStringBuffer aID( 1024 );
- if( m_aDocInfo.Title.Len() )
- appendUnicodeTextString( m_aDocInfo.Title, aID );
- if( m_aDocInfo.Author.Len() )
- appendUnicodeTextString( m_aDocInfo.Author, aID );
- if( m_aDocInfo.Subject.Len() )
- appendUnicodeTextString( m_aDocInfo.Subject, aID );
- if( m_aDocInfo.Keywords.Len() )
- appendUnicodeTextString( m_aDocInfo.Keywords, aID );
- if( m_aDocInfo.Creator.Len() )
- appendUnicodeTextString( m_aDocInfo.Creator, aID );
- if( m_aDocInfo.Producer.Len() )
- appendUnicodeTextString( m_aDocInfo.Producer, aID );
+ if( i_rDocInfo.Title.Len() )
+ appendUnicodeTextString( i_rDocInfo.Title, aID );
+ if( i_rDocInfo.Author.Len() )
+ appendUnicodeTextString( i_rDocInfo.Author, aID );
+ if( i_rDocInfo.Subject.Len() )
+ appendUnicodeTextString( i_rDocInfo.Subject, aID );
+ if( i_rDocInfo.Keywords.Len() )
+ appendUnicodeTextString( i_rDocInfo.Keywords, aID );
+ if( i_rDocInfo.Creator.Len() )
+ appendUnicodeTextString( i_rDocInfo.Creator, aID );
+ if( i_rDocInfo.Producer.Len() )
+ appendUnicodeTextString( i_rDocInfo.Producer, aID );
TimeValue aTVal, aGMT;
oslDateTime aDT;
osl_getSystemTime( &aGMT );
osl_getLocalTimeFromSystemTime( &aGMT, &aTVal );
osl_getDateTimeFromTimeValue( &aTVal, &aDT );
- m_aCreationDateString.append( "D:" );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
-//--> i59651, we fill the Metadata date string as well, if PDF/A is requested
- if( m_bIsPDF_A1 )
- {
-// according to ISO 19005-1:2005 6.7.3 the date is corrected for
-// local time zone offset UTC only, whereas Acrobat 8 seems
-// to use the localtime notation only
-// according to a raccomandation in XMP Specification (Jan 2004, page 75)
-// the Acrobat way seems the right approach
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
- m_aCreationMetaDateString.append( "-" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
- m_aCreationMetaDateString.append( "T" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
- }
+ rtl::OStringBuffer aCreationDateString(64), aCreationMetaDateString(64);
+ aCreationDateString.append( "D:" );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
+ //--> i59651, we fill the Metadata date string as well, if PDF/A is requested
+ // according to ISO 19005-1:2005 6.7.3 the date is corrected for
+ // local time zone offset UTC only, whereas Acrobat 8 seems
+ // to use the localtime notation only
+ // according to a raccomandation in XMP Specification (Jan 2004, page 75)
+ // the Acrobat way seems the right approach
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/1000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/100)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Year)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Month)%10)) );
+ aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Day)%10)) );
+ aCreationMetaDateString.append( "T" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Hours)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Minutes)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds/10)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((aDT.Seconds)%10)) );
+
sal_uInt32 nDelta = 0;
if( aGMT.Seconds > aTVal.Seconds )
{
- m_aCreationDateString.append( "-" );
+ aCreationDateString.append( "-" );
nDelta = aGMT.Seconds-aTVal.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "-" );
+ aCreationMetaDateString.append( "-" );
}
else if( aGMT.Seconds < aTVal.Seconds )
{
- m_aCreationDateString.append( "+" );
+ aCreationDateString.append( "+" );
nDelta = aTVal.Seconds-aGMT.Seconds;
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "+" );
+ aCreationMetaDateString.append( "+" );
}
else
{
- m_aCreationDateString.append( "Z" );
- if( m_bIsPDF_A1 )
- m_aCreationMetaDateString.append( "Z" );
+ aCreationDateString.append( "Z" );
+ aCreationMetaDateString.append( "Z" );
}
if( nDelta )
{
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationDateString.append( "'" );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- if( m_bIsPDF_A1 )
- {
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
- m_aCreationMetaDateString.append( ":" );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
- m_aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
- }
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationDateString.append( "'" );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
+
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/36000)%10)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/3600)%10)) );
+ aCreationMetaDateString.append( ":" );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/600)%6)) );
+ aCreationMetaDateString.append( (sal_Char)('0' + ((nDelta/60)%10)) );
}
- m_aCreationDateString.append( "'" );
- aID.append( m_aCreationDateString.getStr(), m_aCreationDateString.getLength() );
+ aCreationDateString.append( "'" );
+ aID.append( aCreationDateString.getStr(), aCreationDateString.getLength() );
aInfoValuesOut = aID.makeStringAndClear();
+ o_rCString1 = aCreationDateString.makeStringAndClear();
+ o_rCString2 = aCreationMetaDateString.makeStringAndClear();
- DBG_ASSERT( m_aDigest != NULL, "PDFWrite_Impl::setDocInfo: cannot obtain a digest object !" );
-
- m_aDocID.setLength( 0 );
- if( m_aDigest )
+ rtlDigest aDigest = rtl_digest_createMD5();
+ OSL_ENSURE( aDigest != NULL, "PDFWriterImpl::computeDocumentIdentifier: cannot obtain a digest object !" );
+ if( aDigest )
{
- osl_getSystemTime( &aGMT );
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &aGMT, sizeof( aGMT ) );
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_aContext.URL.getStr(), m_aContext.URL.getLength()*sizeof(sal_Unicode) );
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, &aGMT, sizeof( aGMT ) );
if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
+ nError = rtl_digest_updateMD5( aDigest, aInfoValuesOut.getStr(), aInfoValuesOut.getLength() );
if( nError == rtl_Digest_E_None )
{
-//the binary form of the doc id is needed for encryption stuff
- rtl_digest_getMD5( m_aDigest, m_nDocID, 16 );
- for( unsigned int i = 0; i < 16; i++ )
- appendHex( m_nDocID[i], m_aDocID );
+ o_rIdentifier = std::vector< sal_uInt8 >( 16, 0 );
+ //the binary form of the doc id is needed for encryption stuff
+ rtl_digest_getMD5( aDigest, &o_rIdentifier[0], 16 );
}
}
}
@@ -1958,7 +1996,7 @@ append the string as unicode hex, encrypted if needed
inline void PDFWriterImpl::appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, OStringBuffer& rOutBuffer )
{
rOutBuffer.append( "<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
const sal_Unicode* pStr = rInString.getStr();
sal_Int32 nLen = rInString.getLength();
@@ -1995,7 +2033,7 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( rtl::OStringBuffer& rInSt
rOutBuffer.append( "(" );
sal_Int32 nChars = rInString.getLength();
//check for encryption, if ok, encrypt the string, then convert with appndLiteralString
- if( m_aContext.Encrypt && checkEncryptionBufferSize( nChars ) )
+ if( m_aContext.Encryption.Encrypt() && checkEncryptionBufferSize( nChars ) )
{
//encrypt the string in a buffer, then append it
enableStringEncryption( nInObjectNumber );
@@ -2016,22 +2054,22 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OString& rInSt
void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc )
{
rtl::OString aBufferString( rtl::OUStringToOString( rInString, nEnc ) );
- sal_Int32 nLen = aBufferString.getLength();
- rtl::OStringBuffer aBuf( nLen );
- const sal_Char* pT = aBufferString.getStr();
+ sal_Int32 nLen = aBufferString.getLength();
+ rtl::OStringBuffer aBuf( nLen );
+ const sal_Char* pT = aBufferString.getStr();
- for( sal_Int32 i = 0; i < nLen; i++, pT++ )
+ for( sal_Int32 i = 0; i < nLen; i++, pT++ )
+ {
+ if( (*pT & 0x80) == 0 )
+ aBuf.append( *pT );
+ else
{
- if( (*pT & 0x80) == 0 )
- aBuf.append( *pT );
- else
- {
- aBuf.append( '<' );
- appendHex( *pT, aBuf );
- aBuf.append( '>' );
- }
+ aBuf.append( '<' );
+ appendHex( *pT, aBuf );
+ aBuf.append( '>' );
}
- aBufferString = aBuf.makeStringAndClear();
+ }
+ aBufferString = aBuf.makeStringAndClear();
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
@@ -2050,12 +2088,12 @@ bool PDFWriterImpl::compressStream( SvMemoryStream* pStream )
{
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
pStream->Seek( STREAM_SEEK_TO_END );
- ULONG nEndPos = pStream->Tell();
+ sal_uLong nEndPos = pStream->Tell();
pStream->Seek( STREAM_SEEK_TO_BEGIN );
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const BYTE*)pStream->GetData(), nEndPos );
+ pCodec->Write( aStream, (const sal_uInt8*)pStream->GetData(), nEndPos );
pCodec->EndCompression();
delete pCodec;
nEndPos = aStream.Tell();
@@ -2114,7 +2152,7 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes )
sal_uInt64 nWritten;
if( m_pCodec )
{
- m_pCodec->Write( *m_pMemStream, static_cast<const BYTE*>(pBuffer), (ULONG)nBytes );
+ m_pCodec->Write( *m_pMemStream, static_cast<const sal_uInt8*>(pBuffer), (sal_uLong)nBytes );
nWritten = nBytes;
}
else
@@ -2156,13 +2194,16 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
m_pReferenceDevice = pVDev;
- pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ if( m_aContext.DPIx == 0 || m_aContext.DPIy == 0 )
+ pVDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_PDF1 );
+ else
+ pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
pVDev->SetMapMode( MAP_MM );
m_pReferenceDevice->mpPDFWriter = this;
- m_pReferenceDevice->ImplUpdateFontData( TRUE );
+ m_pReferenceDevice->ImplUpdateFontData( sal_True );
}
return m_pReferenceDevice;
}
@@ -2398,9 +2439,6 @@ SalLayout* PDFWriterImpl::GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectDa
sal_Int32 PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, PDFWriter::Orientation eOrientation )
{
- if( m_aContext.Encrypt && m_aPages.empty() )
- initEncryption();
-
endPage();
m_nCurrentPage = m_aPages.size();
m_aPages.push_back( PDFPage(this, nPageWidth, nPageHeight, eOrientation ) );
@@ -2938,12 +2976,9 @@ bool PDFWriterImpl::emitTilings()
aTilingObj.setLength( 0 );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( "PDFWriterImpl::emitTilings" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitTilings" );
+ #endif
sal_Int32 nX = (sal_Int32)it->m_aRectangle.Left();
sal_Int32 nY = (sal_Int32)it->m_aRectangle.Top();
@@ -3428,10 +3463,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// now we can actually write the font stream !
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
- emitComment( aLine.getStr() );
- }
+ emitComment( " PDFWriterImpl::emitEmbeddedFont" );
#endif
OStringBuffer aLine( 512 );
nStreamObject = createObject();
@@ -3850,17 +3882,14 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding,
ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 );
SvMemoryStream aStream;
pCodec->BeginCompression();
- pCodec->Write( aStream, (const BYTE*)aContents.getStr(), aContents.getLength() );
+ pCodec->Write( aStream, (const sal_uInt8*)aContents.getStr(), aContents.getLength() );
pCodec->EndCompression();
delete pCodec;
#endif
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::createToUnicodeCMap" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::createToUnicodeCMap" );
+ #endif
OStringBuffer aLine( 40 );
aLine.append( nStream );
@@ -4047,10 +4076,7 @@ bool PDFWriterImpl::emitFonts()
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine1( " PDFWriterImpl::emitFonts" );
- emitComment( aLine1.getStr() );
- }
+ emitComment( "PDFWriterImpl::emitFonts" );
#endif
sal_Int32 nFontStream = createObject();
sal_Int32 nStreamLengthObject = createObject();
@@ -4674,7 +4700,7 @@ we check in the following sequence:
appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_WITH_CHARSET ) :
- aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
+ aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
if( aFragment.getLength() > 0 )
{
aLine.append("/D/");
@@ -5326,12 +5352,9 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
pApppearanceStream->Seek( STREAM_SEEK_TO_BEGIN );
sal_Int32 nObject = createObject();
CHECK_RETURN( updateObject( nObject ) );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitAppearances" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitAppearances" );
+ #endif
OStringBuffer aLine;
aLine.append( nObject );
@@ -5871,7 +5894,7 @@ bool PDFWriterImpl::emitCatalog()
}
// viewer preferences, if we had some, then emit
if( m_aContext.HideViewerToolbar ||
- ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
+ ( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle ) ||
m_aContext.HideViewerMenubar ||
m_aContext.HideViewerWindowControls || m_aContext.FitWindow ||
m_aContext.CenterWindow || (m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing ) ||
@@ -5888,7 +5911,7 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( "/FitWindow true\n" );
if( m_aContext.CenterWindow )
aLine.append( "/CenterWindow true\n" );
- if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aDocInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
+ if( m_aContext.Version > PDFWriter::PDF_1_3 && m_aContext.DocumentInfo.Title.Len() && m_aContext.DisplayPDFDocumentTitle )
aLine.append( "/DisplayDocTitle true\n" );
if( m_aContext.FirstPageLeft && m_aContext.PageLayout == PDFWriter::ContinuousFacing )
aLine.append( "/Direction/R2L\n" );
@@ -5992,40 +6015,40 @@ sal_Int32 PDFWriterImpl::emitInfoDict( )
aLine.append( nObject );
aLine.append( " 0 obj\n"
"<<" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
aLine.append( "/Title" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Title, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Title, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aLine.append( "/Author" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Author, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Author, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
aLine.append( "/Subject" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Subject, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Subject, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aLine.append( "/Keywords" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Keywords, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Keywords, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aLine.append( "/Creator" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Creator, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Creator, nObject, aLine );
aLine.append( "\n" );
}
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aLine.append( "/Producer" );
- appendUnicodeTextStringEncrypt( m_aDocInfo.Producer, nObject, aLine );
+ appendUnicodeTextStringEncrypt( m_aContext.DocumentInfo.Producer, nObject, aLine );
aLine.append( "\n" );
}
@@ -6271,45 +6294,45 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <pdfaid:conformance>A</pdfaid:conformance>\n" );
aMetadataStream.append( " </rdf:Description>\n" );
//... Dublin Core properties go here
- if( m_aDocInfo.Title.Len() ||
- m_aDocInfo.Author.Len() ||
- m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() ||
+ m_aContext.DocumentInfo.Author.Len() ||
+ m_aContext.DocumentInfo.Subject.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" );
- if( m_aDocInfo.Title.Len() )
+ if( m_aContext.DocumentInfo.Title.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:title>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aTitle;
- escapeStringXML( m_aDocInfo.Title, aTitle );
+ escapeStringXML( m_aContext.DocumentInfo.Title, aTitle );
aMetadataStream.append( OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
aMetadataStream.append( " </dc:title>\n" );
}
- if( m_aDocInfo.Author.Len() )
+ if( m_aContext.DocumentInfo.Author.Len() )
{
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
rtl::OUString aAuthor;
- escapeStringXML( m_aDocInfo.Author, aAuthor );
+ escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
aMetadataStream.append( OUStringToOString( aAuthor , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Seq>\n" );
aMetadataStream.append( " </dc:creator>\n" );
}
- if( m_aDocInfo.Subject.Len() )
+ if( m_aContext.DocumentInfo.Subject.Len() )
{
// this is according to PDF/A-1, technical corrigendum 1 (2007-04-01)
aMetadataStream.append( " <dc:description>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
rtl::OUString aSubject;
- escapeStringXML( m_aDocInfo.Subject, aSubject );
+ escapeStringXML( m_aContext.DocumentInfo.Subject, aSubject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -6319,24 +6342,24 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
}
//... PDF properties go here
- if( m_aDocInfo.Producer.Len() ||
- m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() ||
+ m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" );
- if( m_aDocInfo.Producer.Len() )
+ if( m_aContext.DocumentInfo.Producer.Len() )
{
aMetadataStream.append( " <pdf:Producer>" );
rtl::OUString aProducer;
- escapeStringXML( m_aDocInfo.Producer, aProducer );
+ escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
- if( m_aDocInfo.Keywords.Len() )
+ if( m_aContext.DocumentInfo.Keywords.Len() )
{
aMetadataStream.append( " <pdf:Keywords>" );
rtl::OUString aKeywords;
- escapeStringXML( m_aDocInfo.Keywords, aKeywords );
+ escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -6345,11 +6368,11 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <rdf:Description rdf:about=\"\"\n" );
aMetadataStream.append( " xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" );
- if( m_aDocInfo.Creator.Len() )
+ if( m_aContext.DocumentInfo.Creator.Len() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
rtl::OUString aCreator;
- escapeStringXML( m_aDocInfo.Creator, aCreator );
+ escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -6405,7 +6428,7 @@ bool PDFWriterImpl::emitTrailer()
sal_Int32 nSecObject = 0;
- if( m_aContext.Encrypt == true )
+ if( m_aContext.Encryption.Encrypt() )
{
//emit the security information
//must be emitted as indirect dictionary object, since
@@ -6419,16 +6442,16 @@ bool PDFWriterImpl::emitTrailer()
aLineS.append( " 0 obj\n"
"<</Filter/Standard/V " );
// check the version
- if( m_aContext.Security128bit == true )
+ if( m_aContext.Encryption.Security128bit )
aLineS.append( "2/Length 128/R 3" );
else
aLineS.append( "1/R 2" );
// emit the owner password, must not be encrypted
aLineS.append( "/O(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedOwnerPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.OValue[0], sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
aLineS.append( ")/U(" );
- appendLiteralString( (const sal_Char*)m_nEncryptedUserPassword, 32, aLineS );
+ appendLiteralString( (const sal_Char*)&m_aContext.Encryption.UValue[0], sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
aLineS.append( ")/P " );// the permission set
aLineS.append( m_nAccessPermissions );
aLineS.append( ">>\nendobj\n\n" );
@@ -6494,13 +6517,21 @@ bool PDFWriterImpl::emitTrailer()
aLine.append( nDocInfoObject );
aLine.append( " 0 R\n" );
}
- if( m_aDocID.getLength() )
+ if( ! m_aContext.Encryption.DocumentIdentifier.empty() )
{
aLine.append( "/ID [ <" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( ">\n"
"<" );
- aLine.append( m_aDocID.getStr(), m_aDocID.getLength() );
+ for( std::vector< sal_uInt8 >::const_iterator it = m_aContext.Encryption.DocumentIdentifier.begin();
+ it != m_aContext.Encryption.DocumentIdentifier.end(); ++it )
+ {
+ appendHex( sal_Int8(*it), aLine );
+ }
aLine.append( "> ]\n" );
}
if( aDocChecksum.getLength() )
@@ -6987,7 +7018,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const String& rText, bool bT
Font aSetFont = m_aCurrentPDFState.m_aFont;
aSetFont.SetRelief( RELIEF_NONE );
- aSetFont.SetShadow( FALSE );
+ aSetFont.SetShadow( sal_False );
aSetFont.SetColor( aReliefColor );
setTextLineColor( aReliefColor );
@@ -7024,8 +7055,8 @@ void PDFWriterImpl::drawShadow( SalLayout& rLayout, const String& rText, bool bT
rFont.SetColor( Color( COL_LIGHTGRAY ) );
else
rFont.SetColor( Color( COL_BLACK ) );
- rFont.SetShadow( FALSE );
- rFont.SetOutline( FALSE );
+ rFont.SetShadow( sal_False );
+ rFont.SetOutline( sal_False );
setFont( rFont );
setTextLineColor( rFont.GetColor() );
setOverlineColor( rFont.GetColor() );
@@ -7479,7 +7510,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
)
)
{
- BOOL bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
+ sal_Bool bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont );
if( m_aCurrentPDFState.m_aFont.IsWordLineMode() )
{
Point aPos, aStartPt;
@@ -7532,7 +7563,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
long nEmphYOff;
long nEmphWidth;
long nEmphHeight;
- BOOL bEmphPolyLine;
+ sal_Bool bEmphPolyLine;
FontEmphasisMark nEmphMark;
push( PUSH_ALL );
@@ -7613,7 +7644,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
}
void PDFWriterImpl::drawEmphasisMark( long nX, long nY,
- const PolyPolygon& rPolyPoly, BOOL bPolyLine,
+ const PolyPolygon& rPolyPoly, sal_Bool bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
@@ -7683,7 +7714,7 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const String& rText, const
}
}
-void PDFWriterImpl::drawStretchText( const Point& rPos, ULONG nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
+void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const String& rText, xub_StrLen nIndex, xub_StrLen nLen, bool bTextLines )
{
MARK( "drawStretchText" );
@@ -7699,7 +7730,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, ULONG nWidth, const Stri
}
}
-void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, bool bTextLines )
+void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle, bool bTextLines )
{
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
@@ -8242,17 +8273,17 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
while( m_pReferenceDevice->GetTextWidth( aStrikeout ) >= nWidth )
aStrikeout.Erase( 0, 1 );
aStrikeout.Append( aStrikeoutChar );
- BOOL bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
+ sal_Bool bShadow = m_aCurrentPDFState.m_aFont.IsShadow();
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( FALSE );
+ aFont.SetShadow( sal_False );
setFont( aFont );
updateGraphicsState();
}
// strikeout string is left aligned non-CTL text
- ULONG nOrigTLM = m_pReferenceDevice->GetLayoutMode();
+ sal_uLong nOrigTLM = m_pReferenceDevice->GetLayoutMode();
m_pReferenceDevice->SetLayoutMode( TEXT_LAYOUT_BIDI_STRONG|TEXT_LAYOUT_COMPLEX_DISABLED );
drawText( rPos, aStrikeout, 0, aStrikeout.Len(), false );
m_pReferenceDevice->SetLayoutMode( nOrigTLM );
@@ -8260,7 +8291,7 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
if ( bShadow )
{
Font aFont = m_aCurrentPDFState.m_aFont;
- aFont.SetShadow( TRUE );
+ aFont.SetShadow( sal_True );
setFont( aFont );
updateGraphicsState();
}
@@ -8927,7 +8958,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly )
{
MARK( "drawPolyLine" );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if( nPoints < 2 )
return;
@@ -9120,7 +9151,7 @@ void PDFWriterImpl::drawPolyLine( const Polygon& rPoly, const PDFWriter::ExtLine
aBoundRect.Right() += nLW;
aBoundRect.Bottom() += nLW;
}
- endTransparencyGroup( aBoundRect, (USHORT)(100.0*rInfo.m_fTransparency) );
+ endTransparencyGroup( aBoundRect, (sal_uInt16)(100.0*rInfo.m_fTransparency) );
}
}
@@ -9161,7 +9192,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
if( m_aGraphicsStack.front().m_aLineColor == Color( COL_TRANSPARENT ) && ! pColors )
return;
- USHORT nPoints = rPoints.GetSize();
+ sal_uInt16 nPoints = rPoints.GetSize();
OStringBuffer aLine( nPoints*40 );
aLine.append( "q " );
if( ! pColors )
@@ -9176,7 +9207,7 @@ void PDFWriterImpl::drawPixel( const Polygon& rPoints, const Color* pColors )
aPixel.append( ' ' );
appendDouble( 1.0/double(getReferenceDevice()->ImplGetDPIY()), aPixel );
OString aPixelStr = aPixel.makeStringAndClear();
- for( USHORT i = 0; i < nPoints; i++ )
+ for( sal_uInt16 i = 0; i < nPoints; i++ )
{
if( pColors )
{
@@ -9208,14 +9239,11 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
bool bFlateFilter = compressStream( rObject.m_pContentStream );
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_END );
- ULONG nSize = rObject.m_pContentStream->Tell();
+ sal_uLong nSize = rObject.m_pContentStream->Tell();
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_BEGIN );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeTransparentObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeTransparentObject" );
+ #endif
OStringBuffer aLine( 512 );
CHECK_RETURN( updateObject( rObject.m_nObject ) );
aLine.append( rObject.m_nObject );
@@ -9348,28 +9376,25 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
sal_Int32 nFunctionObject = createObject();
CHECK_RETURN( updateObject( nFunctionObject ) );
- OutputDevice* pRefDevice = getReferenceDevice();
- pRefDevice->Push( PUSH_ALL );
- if( rObject.m_aSize.Width() > pRefDevice->GetOutputSizePixel().Width() )
- rObject.m_aSize.Width() = pRefDevice->GetOutputSizePixel().Width();
- if( rObject.m_aSize.Height() > pRefDevice->GetOutputSizePixel().Height() )
- rObject.m_aSize.Height() = pRefDevice->GetOutputSizePixel().Height();
- pRefDevice->SetMapMode( MapMode( MAP_PIXEL ) );
- pRefDevice->DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
+ VirtualDevice aDev;
+ aDev.SetOutputSizePixel( rObject.m_aSize );
+ aDev.SetMapMode( MapMode( MAP_PIXEL ) );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ aDev.SetDrawMode( aDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ aDev.DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
- Bitmap aSample = pRefDevice->GetBitmap( Point( 0, 0 ), rObject.m_aSize );
+ Bitmap aSample = aDev.GetBitmap( Point( 0, 0 ), rObject.m_aSize );
BitmapReadAccess* pAccess = aSample.AcquireReadAccess();
AccessReleaser aReleaser( pAccess );
Size aSize = aSample.GetSizePixel();
sal_Int32 nStreamLengthObject = createObject();
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeGradientFunction" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeGradientFunction" );
+ #endif
OStringBuffer aLine( 120 );
aLine.append( nFunctionObject );
aLine.append( " 0 obj\n"
@@ -9382,6 +9407,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
aLine.append( " ]\n"
"/BitsPerSample 8\n"
"/Range[ 0 1 0 1 0 1 ]\n"
+ "/Order 3\n"
"/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n"
@@ -9397,7 +9423,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
checkAndEnableStreamEncryption( nFunctionObject );
beginCompression();
- for( int y = 0; y < aSize.Height(); y++ )
+ for( int y = aSize.Height()-1; y >= 0; y-- )
{
for( int x = 0; x < aSize.Width(); x++ )
{
@@ -9448,8 +9474,6 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
- pRefDevice->Pop();
-
return true;
}
@@ -9478,12 +9502,9 @@ bool PDFWriterImpl::writeJPG( JPGEmit& rObject )
m_aErrors.insert( PDFWriter::Warning_Transparency_Omitted_PDF13 );
}
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeJPG" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeJPG" );
+ #endif
OStringBuffer aLine(200);
aLine.append( rObject.m_nObject );
@@ -9603,26 +9624,32 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
sal_Int32 nStreamLengthObject = createObject();
sal_Int32 nMaskObject = 0;
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeBitmapObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeBitmapObject" );
+ #endif
OStringBuffer aLine(1024);
aLine.append( rObject.m_nObject );
aLine.append( " 0 obj\n"
"<</Type/XObject/Subtype/Image/Width " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
- aLine.append( " /Height " );
+ aLine.append( "/Height " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Height() );
- aLine.append( " /BitsPerComponent " );
+ aLine.append( "/BitsPerComponent " );
aLine.append( nBitsPerComponent );
- aLine.append( " /Length " );
+ aLine.append( "/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n" );
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
- aLine.append( "/Filter/FlateDecode" );
+ if( nBitsPerComponent != 1 )
+ {
+ aLine.append( "/Filter/FlateDecode" );
+ }
+ else
+ {
+ aLine.append( "/Filter/CCITTFaxDecode/DecodeParms<</K -1/BlackIs1 true/Columns " );
+ aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
+ aLine.append( ">>\n" );
+ }
#endif
if( ! bMask )
{
@@ -9646,7 +9673,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( "[ /Indexed/DeviceRGB " );
aLine.append( (sal_Int32)(pAccess->GetPaletteEntryCount()-1) );
aLine.append( "\n<" );
- if( m_aContext.Encrypt )
+ if( m_aContext.Encryption.Encrypt() )
{
enableStringEncryption( rObject.m_nObject );
//check encryption buffer size
@@ -9654,7 +9681,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
int nChar = 0;
//fill the encryption buffer
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
m_pEncryptionBuffer[nChar++] = rColor.GetRed();
@@ -9665,7 +9692,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
rtl_cipher_encodeARCFOUR( m_aCipher, m_pEncryptionBuffer, nChar, m_pEncryptionBuffer, nChar );
//now queue the data for output
nChar = 0;
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
appendHex(m_pEncryptionBuffer[nChar++], aLine );
appendHex(m_pEncryptionBuffer[nChar++], aLine );
@@ -9675,7 +9702,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
}
else //no encryption requested (PDF/A-1a program flow drops here)
{
- for( USHORT i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
+ for( sal_uInt16 i = 0; i < pAccess->GetPaletteEntryCount(); i++ )
{
const BitmapColor& rColor = pAccess->GetPaletteColor( i );
appendHex( rColor.GetRed(), aLine );
@@ -9690,7 +9717,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
if( aBitmap.GetBitCount() == 1 )
{
- aLine.append( " /ImageMask true\n" );
+ aLine.append( "/ImageMask true\n" );
sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_BLACK ) ) );
DBG_ASSERT( nBlackIndex == 0 || nBlackIndex == 1, "wrong black index" );
if( nBlackIndex )
@@ -9752,33 +9779,42 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) );
checkAndEnableStreamEncryption( rObject.m_nObject );
- beginCompression();
- if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
+#ifndef DEBUG_DISABLE_PDFCOMPRESSION
+ if( nBitsPerComponent == 1 )
{
- const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
-
- for( int i = 0; i < pAccess->Height(); i++ )
- {
- CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
- }
+ writeG4Stream( pAccess );
}
else
+#endif
{
- const int nScanLineBytes = pAccess->Width()*3;
- boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
- for( int y = 0; y < pAccess->Height(); y++ )
+ beginCompression();
+ if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
{
- for( int x = 0; x < pAccess->Width(); x++ )
+ const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
+
+ for( int i = 0; i < pAccess->Height(); i++ )
{
- BitmapColor aColor = pAccess->GetColor( y, x );
- pCol[3*x+0] = aColor.GetRed();
- pCol[3*x+1] = aColor.GetGreen();
- pCol[3*x+2] = aColor.GetBlue();
+ CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
}
- CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
}
+ else
+ {
+ const int nScanLineBytes = pAccess->Width()*3;
+ boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
+ for( int y = 0; y < pAccess->Height(); y++ )
+ {
+ for( int x = 0; x < pAccess->Width(); x++ )
+ {
+ BitmapColor aColor = pAccess->GetColor( y, x );
+ pCol[3*x+0] = aColor.GetRed();
+ pCol[3*x+1] = aColor.GetGreen();
+ pCol[3*x+2] = aColor.GetBlue();
+ }
+ CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
+ }
+ }
+ endCompression();
}
- endCompression();
disableStreamEncryption();
sal_uInt64 nEndPos = 0;
@@ -9818,8 +9854,25 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
if( ! (rSizePixel.Width() && rSizePixel.Height()) )
return;
- SvMemoryStream* pStream = new SvMemoryStream;
rDCTData.Seek( 0 );
+ if( bIsTrueColor && m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ // need to convert to grayscale;
+ // load stream to bitmap and draw the bitmap instead
+ Graphic aGraphic;
+ GraphicConverter::Import( rDCTData, aGraphic, CVT_JPG );
+ Bitmap aBmp( aGraphic.GetBitmap() );
+ if( !!rMask && rMask.GetSizePixel() == aBmp.GetSizePixel() )
+ {
+ BitmapEx aBmpEx( aBmp, rMask );
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmpEx );
+ }
+ else
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmp );
+ return;
+ }
+
+ SvMemoryStream* pStream = new SvMemoryStream;
*pStream << rDCTData;
pStream->Seek( STREAM_SEEK_TO_END );
@@ -9910,18 +9963,28 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
writeBuffer( aLine.getStr(), aLine.getLength() );
}
-const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& rBitmap, bool bDrawMask )
+const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, bool bDrawMask )
{
+ BitmapEx aBitmap( i_rBitmap );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmap.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmap.Convert( eConv );
+ }
BitmapID aID;
- aID.m_aPixelSize = rBitmap.GetSizePixel();
- aID.m_nSize = rBitmap.GetBitCount();
- aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
+ aID.m_aPixelSize = aBitmap.GetSizePixel();
+ aID.m_nSize = aBitmap.GetBitCount();
+ aID.m_nChecksum = aBitmap.GetBitmap().GetChecksum();
aID.m_nMaskChecksum = 0;
- if( rBitmap.IsAlpha() )
- aID.m_nMaskChecksum = rBitmap.GetAlpha().GetChecksum();
+ if( aBitmap.IsAlpha() )
+ aID.m_nMaskChecksum = aBitmap.GetAlpha().GetChecksum();
else
{
- Bitmap aMask = rBitmap.GetMask();
+ Bitmap aMask = aBitmap.GetMask();
if( ! aMask.IsEmpty() )
aID.m_nMaskChecksum = aMask.GetChecksum();
}
@@ -9935,7 +9998,7 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
{
m_aBitmaps.push_front( BitmapEmit() );
m_aBitmaps.front().m_aID = aID;
- m_aBitmaps.front().m_aBitmap = rBitmap;
+ m_aBitmaps.front().m_aBitmap = aBitmap;
m_aBitmaps.front().m_nObject = createObject();
m_aBitmaps.front().m_bDrawMask = bDrawMask;
it = m_aBitmaps.begin();
@@ -9998,15 +10061,16 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size&
rSize ) );
// check if we already have this gradient
std::list<GradientEmit>::iterator it;
+ // rounding to point will generally lose some pixels
+ // round up to point boundary
+ aPtSize.Width()++;
+ aPtSize.Height()++;
for( it = m_aGradients.begin(); it != m_aGradients.end(); ++it )
{
if( it->m_aGradient == rGradient )
{
- if( it->m_aSize.Width() < aPtSize.Width() )
- it->m_aSize.Width() = aPtSize.Width();
- if( it->m_aSize.Height() <= aPtSize.Height() )
- it->m_aSize.Height() = aPtSize.Height();
- break;
+ if( it->m_aSize == aPtSize )
+ break;
}
}
if( it == m_aGradients.end() )
@@ -10081,12 +10145,12 @@ void PDFWriterImpl::drawGradient( const PolyPolygon& rPolyPoly, const Gradient&
return;
}
- sal_Int32 nGradient = createGradient( rGradient, rPolyPoly.GetBoundRect().GetSize() );
+ Rectangle aBoundRect = rPolyPoly.GetBoundRect();
+ sal_Int32 nGradient = createGradient( rGradient, aBoundRect.GetSize() );
updateGraphicsState();
- Rectangle aBoundRect = rPolyPoly.GetBoundRect();
- Point aTranslate = aBoundRect.BottomLeft() + Point( 0, 1 );
+ Point aTranslate = aBoundRect.BottomLeft();
int nPolygons = rPolyPoly.Count();
OStringBuffer aLine( 80*nPolygons );
@@ -10125,7 +10189,7 @@ void PDFWriterImpl::drawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
aPolyPoly.Optimize( POLY_OPTIMIZE_NO_SAME );
push( PUSH_LINECOLOR );
setLineColor( rHatch.GetColor() );
- getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, FALSE );
+ getReferenceDevice()->ImplDrawHatch( aPolyPoly, rHatch, sal_False );
pop();
}
}
@@ -10833,7 +10897,7 @@ sal_Int32 PDFWriterImpl::setOutlineItemText( sal_Int32 nItem, const OUString& rT
if( nItem < 1 || nItem >= (sal_Int32)m_aOutline.size() )
return -1;
- m_aOutline[ nItem ].m_aTitle = rText;
+ m_aOutline[ nItem ].m_aTitle = psp::WhitespaceToSpace( rText );
return 0;
}
@@ -12032,269 +12096,6 @@ void PDFWriterImpl::addStream( const String& rMimeType, PDFOutputStream* pStream
}
}
-/*************************************************************
-begin i12626 methods
-
-Implements Algorithm 3.2, step 1 only
-*/
-void PDFWriterImpl::padPassword( rtl::OUString aPassword, sal_uInt8 *paPasswordTarget )
-{
-// get ansi-1252 version of the password string CHECKIT ! i12626
- rtl::OString aString = rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_MS_1252 );
-
-//copy the string to the target
- sal_Int32 nToCopy = ( aString.getLength() < 32 ) ? aString.getLength() : 32;
- sal_Int32 nCurrentChar;
-
- for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
- paPasswordTarget[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
-
-//pad it
- if( nCurrentChar < 32 )
- {//fill with standard byte string
- sal_Int32 i,y;
- for( i = nCurrentChar, y = 0 ; i < 32; i++, y++ )
- paPasswordTarget[i] = m_nPadString[y];
- }
-}
-
-/**********************************
-Algorithm 3.2 Compute the encryption key used
-
-step 1 should already be done before calling, the paThePaddedPassword parameter should contain
-the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
-it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
-
-TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
-
-*/
-void PDFWriterImpl::computeEncryptionKey(sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey )
-{
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, paThePaddedPassword, ENCRYPTED_PWD_SIZE );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nEncryptedOwnerPassword , sizeof( m_nEncryptedOwnerPassword ) );
-//Step 4
- sal_uInt8 nPerm[4];
-
- nPerm[0] = (sal_uInt8)m_nAccessPermissions;
- nPerm[1] = (sal_uInt8)( m_nAccessPermissions >> 8 );
- nPerm[2] = (sal_uInt8)( m_nAccessPermissions >> 16 );
- nPerm[3] = (sal_uInt8)( m_nAccessPermissions >> 24 );
-
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, nPerm , sizeof( nPerm ) );
-
-//step 5, get the document ID, binary form
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof( m_nDocID ) );
-//get the digest
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ] = {0};
- if( nError == rtl_Digest_E_None )
- {
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
-
-//step 6, only if 128 bit
- if( m_aContext.Security128bit )
- {
- for( sal_Int32 i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
- }
-//Step 7
- for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
- paEncryptionKey[i] = nMD5Sum[i];
- }
-}
-
-/**********************************
-Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
-the step numbers down here correspond to the ones in PDF v.1.4 specfication
-*/
-void PDFWriterImpl::computeODictionaryValue()
-{
-//step 1 already done, data is in m_nPaddedOwnerPassword
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, &m_nPaddedOwnerPassword, sizeof( m_nPaddedOwnerPassword ) );
- if( nError == rtl_Digest_E_None )
- {
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
-
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//step 3, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_Int32 i;
- for( i = 0; i < 50; i++ )
- {
- nError = rtl_digest_updateMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- if( nError != rtl_Digest_E_None )
- break;
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof( nMD5Sum ) );
- }
- }
-//Step 4, the key is in nMD5Sum
-//step 5 already done, data is in m_nPaddedUserPassword
-//step 6
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nMD5Sum, m_nKeyLength , NULL, 0 );
-// encrypt the user password using the key set above
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPaddedUserPassword, sizeof( m_nPaddedUserPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); //encrypted data, stored in class data member
-//Step 7, only if 128 bit
- if( m_aContext.Security128bit )
- {
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ); y++ )
- nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ), // the data to be encrypted
- m_nEncryptedOwnerPassword, sizeof( m_nEncryptedOwnerPassword ) ); // encrypted data, can be the same as the input, encrypt "in place"
-//step 8, store in class data member
- }
- }
- }
- }
-}
-
-/**********************************
-Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
-*/
-void PDFWriterImpl::computeUDictionaryValue()
-{
-//step 1, common to both 3.4 and 3.5
- computeEncryptionKey( m_nPaddedUserPassword , m_nEncryptionKey );
-
- if( m_aContext.Security128bit == false )
- {
-//3.4
-//step 2 and 3
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, 5 , // key and key length
- NULL, 0 ); //destination data area
-// encrypt the user password using the key set above, save for later use
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nPadString, sizeof( m_nPadString ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( m_nEncryptedUserPassword ) ); //encrypted data, stored in class data member
- }
- else
- {
-//or 3.5, for 128 bit security
-//step6, initilize the last 16 bytes of the encrypted user password to 0
- for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sizeof( m_nEncryptedUserPassword ); i++)
- m_nEncryptedUserPassword[i] = 0;
-//step 2
- if( m_aDigest )
- {
- rtlDigestError nError = rtl_digest_updateMD5( m_aDigest, m_nPadString, sizeof( m_nPadString ) );
-//step 3
- if( nError == rtl_Digest_E_None )
- nError = rtl_digest_updateMD5( m_aDigest, m_nDocID , sizeof(m_nDocID) );
-
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- rtl_digest_getMD5( m_aDigest, nMD5Sum, sizeof(nMD5Sum) );
-//Step 4
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- m_nEncryptionKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area
- rtl_cipher_encodeARCFOUR( m_aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
- m_nEncryptedUserPassword, sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
-//step 5
- sal_uInt32 i, y;
- sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
-
- for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
- {
- for( y = 0; y < sizeof( nLocalKey ) ; y++ )
- nLocalKey[y] = (sal_uInt8)( m_nEncryptionKey[y] ^ i );
-
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode,
- nLocalKey, SECUR_128BIT_KEY, // key and key length
- NULL, 0 ); //destination data area, on init can be NULL
- rtl_cipher_encodeARCFOUR( m_aCipher, m_nEncryptedUserPassword, SECUR_128BIT_KEY, // the data to be encrypted
- m_nEncryptedUserPassword, SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
- }
- }
- }
-}
-
-/* init the encryption engine
-1. init the document id, used both for building the document id and for building the encryption key(s)
-2. build the encryption key following algorithms described in the PDF specification
- */
-void PDFWriterImpl::initEncryption()
-{
- m_aOwnerPassword = m_aContext.OwnerPassword;
- m_aUserPassword = m_aContext.UserPassword;
-/* password stuff computing, before sending out anything */
- DBG_ASSERT( m_aCipher != NULL, "PDFWriterImpl::initEncryption: a cipher (ARCFOUR) object is not available !" );
- DBG_ASSERT( m_aDigest != NULL, "PDFWriterImpl::initEncryption: a digest (MD5) object is not available !" );
-
- if( m_aCipher && m_aDigest )
- {
-//if there is no owner password, force it to the user password
- if( m_aOwnerPassword.getLength() == 0 )
- m_aOwnerPassword = m_aUserPassword;
-
- initPadString();
-/*
-1) pad passwords
-*/
- padPassword( m_aOwnerPassword, m_nPaddedOwnerPassword );
- padPassword( m_aUserPassword, m_nPaddedUserPassword );
-/*
-2) compute the access permissions, in numerical form
-
-the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
-- for 40 bit security the unused bit must be set to 1, since they are not used
-- for 128 bit security the same bit must be preset to 0 and set later if needed
-according to the table 3.15, pdf v 1.4 */
- m_nAccessPermissions = ( m_aContext.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
-
-/* check permissions for 40 bit security case */
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintTheDocument ) ? 1 << 2 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanModifyTheContent ) ? 1 << 3 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanCopyOrExtract ) ? 1 << 4 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAddOrModify ) ? 1 << 5 : 0;
- m_nKeyLength = SECUR_40BIT_KEY;
- m_nRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
-
- if( m_aContext.Security128bit )
- {
- m_nKeyLength = SECUR_128BIT_KEY;
- m_nRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
- // permitted value is 16
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanFillInteractive ) ? 1 << 8 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanExtractForAccessibility ) ? 1 << 9 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanAssemble ) ? 1 << 10 : 0;
- m_nAccessPermissions |= ( m_aContext.AccessPermissions.CanPrintFull ) ? 1 << 11 : 0;
- }
- computeODictionaryValue();
- computeUDictionaryValue();
-
-//clear out exceding key values, prepares for generation number default to 0 as well
-// see checkAndEnableStreamEncryption in pdfwriter_impl.hxx
- sal_Int32 i, y;
- for( i = m_nKeyLength, y = 0; y < 5 ; y++ )
- m_nEncryptionKey[i++] = 0;
- }
- else //either no cipher or no digest or both, something is wrong with memory or something else
- m_aContext.Encrypt = false; //then turn the encryption off
-}
-/* end i12626 methods */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 8aacf749942e..09459e40a896 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -60,6 +60,8 @@ class ImplFontSelectData;
class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
+class EncHashTransporter;
+struct BitStreamState;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -448,7 +450,7 @@ public:
rtl::OString m_aName;
rtl::OUString m_aDescription;
rtl::OUString m_aText;
- USHORT m_nTextStyle;
+ sal_uInt16 m_nTextStyle;
rtl::OUString m_aValue;
rtl::OString m_aDAString;
rtl::OString m_aDRDict;
@@ -597,7 +599,6 @@ private:
MapMode m_aMapMode; // PDFWriterImpl scaled units
std::vector< PDFPage > m_aPages;
- PDFDocInfo m_aDocInfo;
/* maps object numbers to file offsets (needed for xref) */
std::vector< sal_uInt64 > m_aObjects;
/* contains Bitmaps until they are written to the
@@ -798,116 +799,37 @@ i12626
/* used to cipher the stream data and for password management */
rtlCipher m_aCipher;
rtlDigest m_aDigest;
-/* pad string used for password in Standard security handler */
- sal_uInt8 m_nPadString[ENCRYPTED_PWD_SIZE];
-/* the owner password, in clear text */
- rtl::OUString m_aOwnerPassword;
-/* the padded owner password */
- sal_uInt8 m_nPaddedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary owner password, according to algorithm 3.3 */
- sal_uInt8 m_nEncryptedOwnerPassword[ENCRYPTED_PWD_SIZE];
-/* the user password, in clear text */
- rtl::OUString m_aUserPassword;
-/* the padded user password */
- sal_uInt8 m_nPaddedUserPassword[ENCRYPTED_PWD_SIZE];
-/* the encryption dictionary user password, according to algorithm 3.4 or 3.5 depending on the
- security handler revision */
- sal_uInt8 m_nEncryptedUserPassword[ENCRYPTED_PWD_SIZE];
-
-/* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
- for 128 bit security */
- sal_uInt8 m_nEncryptionKey[MAXIMUM_RC4_KEY_LENGTH];
+ /* pad string used for password in Standard security handler */
+ static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE];
+
+ /* the encryption key, formed with the user password according to algorithm 3.2, maximum length is 16 bytes + 3 + 2
+ for 128 bit security */
sal_Int32 m_nKeyLength; // key length, 16 or 5
sal_Int32 m_nRC4KeyLength; // key length, 16 or 10, to be input to the algorith 3.1
-/* set to true if the following stream must be encrypted, used inside writeBuffer() */
+ /* set to true if the following stream must be encrypted, used inside writeBuffer() */
sal_Bool m_bEncryptThisStream;
-/* the numerical value of the access permissions, according to PDF spec, must be signed */
+ /* the numerical value of the access permissions, according to PDF spec, must be signed */
sal_Int32 m_nAccessPermissions;
-/* the document ID, the raw MD5 hash */
- sal_uInt8 m_nDocID[MD5_DIGEST_SIZE];
-/* string buffer to hold document ID, this is the output string */
- rtl::OStringBuffer m_aDocID;
-/* string to hold the PDF creation date */
- rtl::OStringBuffer m_aCreationDateString;
-/* string to hold the PDF creation date, for PDF/A metadata */
- rtl::OStringBuffer m_aCreationMetaDateString;
-/* the buffer where the data are encrypted, dynamically allocated */
+ /* string to hold the PDF creation date */
+ rtl::OString m_aCreationDateString;
+ /* string to hold the PDF creation date, for PDF/A metadata */
+ rtl::OString m_aCreationMetaDateString;
+ /* the buffer where the data are encrypted, dynamically allocated */
sal_uInt8 *m_pEncryptionBuffer;
-/* size of the buffer */
+ /* size of the buffer */
sal_Int32 m_nEncryptionBufferSize;
-/* check and reallocate the buffer for encryption */
- sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize )
- {
- if( m_nEncryptionBufferSize < newSize )
- {
-/* reallocate the buffer, the used function allocate as rtl_allocateMemory
- if the pointer parameter is NULL */
- m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
- if( m_pEncryptionBuffer )
- m_nEncryptionBufferSize = newSize;
- else
- m_nEncryptionBufferSize = 0;
- }
- return ( m_nEncryptionBufferSize != 0 );
- }
-/* init the internal pad string */
- void initPadString()
- {
- static const sal_uInt8 nPadString[32] =
- {
- 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
- 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A
- };
-
- for(sal_uInt32 i = 0; i < sizeof( nPadString ); i++ )
- m_nPadString[i] = nPadString[i];
-
- };
-/* initialize the encryption engine */
- void initEncryption();
-
-/* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
- void checkAndEnableStreamEncryption( register sal_Int32 nObject )
- {
- if( m_aContext.Encrypt )
- {
- m_bEncryptThisStream = true;
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- }
- };
+ /* check and reallocate the buffer for encryption */
+ sal_Bool checkEncryptionBufferSize( register sal_Int32 newSize );
+ /* this function implements part of the PDF spec algorithm 3.1 in encryption, the rest (the actual encryption) is in PDFWriterImpl::writeBuffer */
+ void checkAndEnableStreamEncryption( register sal_Int32 nObject );
void disableStreamEncryption() { m_bEncryptThisStream = false; };
-/* */
- void enableStringEncryption( register sal_Int32 nObject )
- {
- register sal_Int32 i = m_nKeyLength;
- m_nEncryptionKey[i++] = (sal_uInt8)nObject;
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
- m_nEncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
-//the other location of m_nEncryptionKey are already set to 0, our fixed generation number
-// do the MD5 hash
- sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
- // the i+2 to take into account the generation number, always zero
- rtl_digest_MD5( &m_nEncryptionKey, i+2, nMD5Sum, sizeof(nMD5Sum) );
-// initialize the RC4 with the key
-// key legth: see algoritm 3.1, step 4: (N+5) max 16
- rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
- };
+ /* */
+ void enableStringEncryption( register sal_Int32 nObject );
// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
void appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -1093,28 +1015,68 @@ i12626
bool checkEmitStructure();
/* draws an emphasis mark */
- void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, BOOL bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
+ void drawEmphasisMark( long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
/* true if PDF/A-1a or PDF/A-1b is output */
sal_Bool m_bIsPDF_A1;
-
-/*
-i12626
-methods for PDF security
-
- pad a password according algorithm 3.2, step 1 */
- void padPassword( const rtl::OUString aPassword, sal_uInt8 *paPasswordTarget );
-/* algorithm 3.2: compute an encryption key */
- void computeEncryptionKey( sal_uInt8 *paThePaddedPassword, sal_uInt8 *paEncryptionKey );
-/* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
- void computeODictionaryValue();
-/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
- void computeUDictionaryValue();
-
+ PDFWriter& m_rOuterFace;
+
+ /*
+ i12626
+ methods for PDF security
+
+ pad a password according algorithm 3.2, step 1 */
+ static void padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW );
+ /* algorithm 3.2: compute an encryption key */
+ static bool computeEncryptionKey( EncHashTransporter*,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nAccessPermissions
+ );
+ /* algorithm 3.3: computing the encryption dictionary'ss owner password value ( /O ) */
+ static bool computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword, const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ );
+ /* algorithm 3.4 or 3.5: computing the encryption dictionary's user password value ( /U ) revision 2 or 3 of the standard security handler */
+ static bool computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ );
+
+ static void computeDocumentIdentifier( std::vector< sal_uInt8 >& o_rIdentifier,
+ const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+ rtl::OString& o_rCString1,
+ rtl::OString& o_rCString2
+ );
+ static sal_Int32 computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength );
+ void setupDocInfo();
+ bool prepareEncryption( const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+
+ // helper for playMetafile
+ void implWriteGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+ void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx,
+ VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+
+ // helpers for CCITT 1bit bitmap stream
+ void putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState );
+ void putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState );
+ void writeG4Stream( BitmapReadAccess* i_pBitmap );
+
+ // color helper functions
+ void appendStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
+ void appendNonStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
public:
- PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext );
+ PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
~PDFWriterImpl();
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit );
+
/* for OutputDevice so the reference device can have a list
* that contains only suitable fonts (subsettable or builtin)
* produces a new font list
@@ -1136,6 +1098,7 @@ public:
bool emit();
std::set< PDFWriter::ErrorCode > getErrors();
void insertError( PDFWriter::ErrorCode eErr ) { m_aErrors.insert( eErr ); }
+ void playMetafile( const GDIMetaFile&, vcl::PDFExtOutDevData*, const vcl::PDFWriter::PlayMetafileContext&, VirtualDevice* pDummyDev = NULL );
Size getCurPageSize() const
{
@@ -1146,8 +1109,6 @@ public:
}
PDFWriter::PDFVersion getVersion() const { return m_aContext.Version; }
- void setDocInfo( const PDFDocInfo& rInfo );
- const PDFDocInfo& getDocInfo() const { return m_aDocInfo; }
void setDocumentLocale( const com::sun::star::lang::Locale& rLoc )
{ m_aContext.DocumentLocale = rLoc; }
@@ -1204,13 +1165,13 @@ public:
void setTextFillColor( const Color& rColor )
{
m_aGraphicsStack.front().m_aFont.SetFillColor( rColor );
- m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? TRUE : FALSE );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( ImplIsColorTransparent( rColor ) ? sal_True : sal_False );
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont;
}
void setTextFillColor()
{
m_aGraphicsStack.front().m_aFont.SetFillColor( Color( COL_TRANSPARENT ) );
- m_aGraphicsStack.front().m_aFont.SetTransparent( TRUE );
+ m_aGraphicsStack.front().m_aFont.SetTransparent( sal_True );
m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont;
}
void setTextColor( const Color& rColor )
@@ -1261,10 +1222,10 @@ public:
/* actual drawing functions */
void drawText( const Point& rPos, const String& rText, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN, bool bTextLines = true );
void drawTextArray( const Point& rPos, const String& rText, const sal_Int32* pDXArray = NULL, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN, bool bTextLines = true );
- void drawStretchText( const Point& rPos, ULONG nWidth, const String& rText,
+ void drawStretchText( const Point& rPos, sal_uLong nWidth, const String& rText,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
bool bTextLines = true );
- void drawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle, bool bTextLines = true );
+ void drawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle, bool bTextLines = true );
void drawTextLine( const Point& rPos, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, bool bUnderlineAbove );
void drawWaveTextLine( rtl::OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
void drawStraightTextLine( rtl::OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
new file mode 100644
index 000000000000..3e957d175897
--- /dev/null
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -0,0 +1,2037 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "pdfwriter_impl.hxx"
+
+#include "vcl/pdfextoutdevdata.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/bmpacc.hxx"
+#include "vcl/graph.hxx"
+#include "vcl/svdata.hxx"
+#include "unotools/streamwrap.hxx"
+#include "unotools/processfactory.hxx"
+#include "comphelper/processfactory.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/io/XSeekable.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
+
+#include "cppuhelper/implbase1.hxx"
+
+#include <rtl/digest.h>
+
+#undef USE_PDFGRADIENTS
+
+using namespace vcl;
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteGradient( const PolyPolygon& i_rPolyPoly, const Gradient& i_rGradient,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ GDIMetaFile aTmpMtf;
+
+ i_pDummyVDev->AddGradientActions( i_rPolyPoly.GetBoundRect(), i_rGradient, aTmpMtf );
+
+ m_rOuterFace.Push();
+ m_rOuterFace.IntersectClipRegion( i_rPolyPoly.getB2DPolyPolygon() );
+ playMetafile( aTmpMtf, NULL, i_rContext, i_pDummyVDev );
+ m_rOuterFace.Pop();
+}
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSize, const BitmapEx& i_rBitmapEx,
+ VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
+{
+ if ( !i_rBitmapEx.IsEmpty() && i_rSize.Width() && i_rSize.Height() )
+ {
+ BitmapEx aBitmapEx( i_rBitmapEx );
+ Point aPoint( i_rPoint );
+ Size aSize( i_rSize );
+
+ // #i19065# Negative sizes have mirror semantics on
+ // OutputDevice. BitmapEx and co. have no idea about that, so
+ // perform that _before_ doing anything with aBitmapEx.
+ sal_uLong nMirrorFlags(BMP_MIRROR_NONE);
+ if( aSize.Width() < 0 )
+ {
+ aSize.Width() *= -1;
+ aPoint.X() -= aSize.Width();
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ }
+ if( aSize.Height() < 0 )
+ {
+ aSize.Height() *= -1;
+ aPoint.Y() -= aSize.Height();
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ }
+
+ if( nMirrorFlags != BMP_MIRROR_NONE )
+ {
+ aBitmapEx.Mirror( nMirrorFlags );
+ }
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ // do downsampling if neccessary
+ const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MAP_TWIP ) );
+ const Size aBmpSize( aBitmapEx.GetSizePixel() );
+ const double fBmpPixelX = aBmpSize.Width();
+ const double fBmpPixelY = aBmpSize.Height();
+ const double fMaxPixelX = aDstSizeTwip.Width() * i_rContext.m_nMaxImageResolution / 1440.0;
+ const double fMaxPixelY = aDstSizeTwip.Height() * i_rContext.m_nMaxImageResolution / 1440.0;
+
+ // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
+ if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
+ ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
+ ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
+ {
+ // do scaling
+ Size aNewBmpSize;
+ const double fBmpWH = fBmpPixelX / fBmpPixelY;
+ const double fMaxWH = fMaxPixelX / fMaxPixelY;
+
+ if( fBmpWH < fMaxWH )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH );
+ aNewBmpSize.Height() = FRound( fMaxPixelY );
+ }
+ else if( fBmpWH > 0.0 )
+ {
+ aNewBmpSize.Width() = FRound( fMaxPixelX );
+ aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
+ }
+ if( aNewBmpSize.Width() && aNewBmpSize.Height() )
+ aBitmapEx.Scale( aNewBmpSize );
+ else
+ aBitmapEx.SetEmpty();
+ }
+ }
+
+ const Size aSizePixel( aBitmapEx.GetSizePixel() );
+ if ( aSizePixel.Width() && aSizePixel.Height() )
+ {
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmapEx.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmapEx.Convert( eConv );
+ }
+ sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression;
+ if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
+ bUseJPGCompression = sal_False;
+
+ SvMemoryStream aStrm;
+ Bitmap aMask;
+
+ bool bTrueColorJPG = true;
+ if ( bUseJPGCompression )
+ {
+ sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap
+ { // to determine if jpeg compression is usefull
+ SvMemoryStream aTemp;
+ aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
+ aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator
+ aTemp << aBitmapEx; // is capable of zlib stream compression
+ aTemp.Seek( STREAM_SEEK_TO_END );
+ nZippedFileSize = aTemp.Tell();
+ }
+ if ( aBitmapEx.IsTransparent() )
+ {
+ if ( aBitmapEx.IsAlpha() )
+ aMask = aBitmapEx.GetAlpha().GetBitmap();
+ else
+ aMask = aBitmapEx.GetMask();
+ }
+ Graphic aGraphic( aBitmapEx.GetBitmap() );
+ sal_Int32 nColorMode = 0;
+
+ Sequence< PropertyValue > aFilterData( 2 );
+ aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) );
+ aFilterData[ 0 ].Value <<= sal_Int32(i_rContext.m_nJPEGQuality);
+ aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) );
+ aFilterData[ 1 ].Value <<= nColorMode;
+
+ try
+ {
+ uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
+ uno::Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
+ uno::Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
+ OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
+ if ( xGraphicProvider.is() )
+ {
+ uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
+ uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
+ rtl::OUString aMimeType( ::rtl::OUString::createFromAscii( "image/jpeg" ) );
+ uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 );
+ aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
+ aOutMediaProperties[0].Value <<= xOut;
+ aOutMediaProperties[1].Name = ::rtl::OUString::createFromAscii( "MimeType" );
+ aOutMediaProperties[1].Value <<= aMimeType;
+ aOutMediaProperties[2].Name = ::rtl::OUString::createFromAscii( "FilterData" );
+ aOutMediaProperties[2].Value <<= aFilterData;
+ xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
+ xOut->flush();
+ if ( xSeekable->getLength() > nZippedFileSize )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ else
+ {
+ aStrm.Seek( STREAM_SEEK_TO_END );
+
+ xSeekable->seek( 0 );
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[ 0 ].Name = ::rtl::OUString::createFromAscii( "InputStream" );
+ aArgs[ 0 ].Value <<= xStream;
+ uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
+ if ( xPropSet.is() )
+ {
+ sal_Int16 nBitsPerPixel = 24;
+ if ( xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "BitsPerPixel" ) ) >>= nBitsPerPixel )
+ {
+ bTrueColorJPG = nBitsPerPixel != 8;
+ }
+ }
+ }
+ }
+ else
+ bUseJPGCompression = sal_False;
+ }
+ catch( uno::Exception& )
+ {
+ bUseJPGCompression = sal_False;
+ }
+ }
+ if ( bUseJPGCompression )
+ m_rOuterFace.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask );
+ else if ( aBitmapEx.IsTransparent() )
+ m_rOuterFace.DrawBitmapEx( aPoint, aSize, aBitmapEx );
+ else
+ m_rOuterFace.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() );
+ }
+ }
+}
+
+
+// -----------------------------------------------------------------------------
+
+void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevData* i_pOutDevData, const vcl::PDFWriter::PlayMetafileContext& i_rContext, VirtualDevice* pDummyVDev )
+{
+ bool bAssertionFired( false );
+
+ VirtualDevice* pPrivateDevice = NULL;
+ if( ! pDummyVDev )
+ {
+ pPrivateDevice = pDummyVDev = new VirtualDevice();
+ pDummyVDev->EnableOutput( sal_False );
+ pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() );
+ }
+ GDIMetaFile aMtf( i_rMtf );
+
+ for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; )
+ {
+ if ( !i_pOutDevData || !i_pOutDevData->PlaySyncPageAct( m_rOuterFace, i ) )
+ {
+ const MetaAction* pAction = aMtf.GetAction( i );
+ const sal_uInt16 nType = pAction->GetType();
+
+ switch( nType )
+ {
+ case( META_PIXEL_ACTION ):
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint(), pA->GetColor() );
+ }
+ break;
+
+ case( META_POINT_ACTION ):
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pAction;
+ m_rOuterFace.DrawPixel( pA->GetPoint() );
+ }
+ break;
+
+ case( META_LINE_ACTION ):
+ {
+ const MetaLineAction* pA = (const MetaLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() );
+ else
+ m_rOuterFace.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_RECT_ACTION ):
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect() );
+ }
+ break;
+
+ case( META_ROUNDRECT_ACTION ):
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
+ m_rOuterFace.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ }
+ break;
+
+ case( META_ELLIPSE_ACTION ):
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
+ m_rOuterFace.DrawEllipse( pA->GetRect() );
+ }
+ break;
+
+ case( META_ARC_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_PIE_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ m_rOuterFace.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_CHORD_ACTION ):
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pAction;
+ m_rOuterFace.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case( META_POLYGON_ACTION ):
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction;
+ m_rOuterFace.DrawPolygon( pA->GetPolygon() );
+ }
+ break;
+
+ case( META_POLYLINE_ACTION ):
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
+ if ( pA->GetLineInfo().IsDefault() )
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon() );
+ else
+ m_rOuterFace.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() );
+ }
+ break;
+
+ case( META_POLYPOLYGON_ACTION ):
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction;
+ m_rOuterFace.DrawPolyPolygon( pA->GetPolyPolygon() );
+ }
+ break;
+
+ case( META_GRADIENT_ACTION ):
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetRect(), pA->GetGradient() );
+ #else
+ const PolyPolygon aPolyPoly( pA->GetRect() );
+ implWriteGradient( aPolyPoly, pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ break;
+
+ case( META_GRADIENTEX_ACTION ):
+ {
+ const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetPolyPolygon(), pA->GetGradient() );
+ #else
+ implWriteGradient( pA->GetPolyPolygon(), pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
+ m_rOuterFace.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() );
+ }
+ break;
+
+ case( META_TRANSPARENT_ACTION ):
+ {
+ const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction;
+ m_rOuterFace.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() );
+ }
+ break;
+
+ case( META_FLOATTRANSPARENT_ACTION ):
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ const Point& rPos = pA->GetPoint();
+ const Size& rSize= pA->GetSize();
+ const Gradient& rTransparenceGradient = pA->GetGradient();
+
+ // special case constant alpha value
+ if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() )
+ {
+ const Color aTransCol( rTransparenceGradient.GetStartColor() );
+ const sal_uInt16 nTransPercent = aTransCol.GetLuminance() * 100 / 255;
+ m_rOuterFace.BeginTransparencyGroup();
+ playMetafile( aTmpMtf, NULL, i_rContext, pDummyVDev );
+ m_rOuterFace.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent );
+ }
+ else
+ {
+ const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MAP_TWIP ) );
+ sal_Int32 nMaxBmpDPI = i_rContext.m_bOnlyLosslessCompression ? 300 : 72;
+ if( i_rContext.m_nMaxImageResolution > 50 )
+ {
+ if ( nMaxBmpDPI > i_rContext.m_nMaxImageResolution )
+ nMaxBmpDPI = i_rContext.m_nMaxImageResolution;
+ }
+ const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0);
+ const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0);
+ if ( nPixelX && nPixelY )
+ {
+ Size aDstSizePixel( nPixelX, nPixelY );
+ VirtualDevice* pVDev = new VirtualDevice;
+ if( pVDev->SetOutputSizePixel( aDstSizePixel ) )
+ {
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ Point aPoint;
+
+ MapMode aMapMode( pDummyVDev->GetMapMode() );
+ aMapMode.SetOrigin( aPoint );
+ pVDev->SetMapMode( aMapMode );
+ Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) );
+
+ Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ if ( aMtfOrigin.X() || aMtfOrigin.Y() )
+ aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
+ double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width();
+ double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height();
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aTmpMtf.SetPrefMapMode( aMapMode );
+
+ // create paint bitmap
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+
+ pVDev->EnableMapMode( sal_False );
+ aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( sal_True );
+
+ // create mask bitmap
+ pVDev->SetLineColor( COL_BLACK );
+ pVDev->SetFillColor( COL_BLACK );
+ pVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
+ pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
+ DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ aTmpMtf.WindStart();
+ aTmpMtf.Play( pVDev, aPoint, aDstSize );
+ aTmpMtf.WindStart();
+ pVDev->EnableMapMode( sal_False );
+ aMask = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ pVDev->EnableMapMode( sal_True );
+
+ // create alpha mask from gradient
+ pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
+ pVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ pVDev->EnableMapMode( sal_False );
+ pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
+ aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel );
+ implWriteBitmapEx( rPos, rSize, BitmapEx( aPaint, aAlpha ), pDummyVDev, i_rContext );
+ }
+ delete pVDev;
+ }
+ }
+ }
+ break;
+
+ case( META_EPS_ACTION ):
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
+ const GDIMetaFile aSubstitute( pA->GetSubstitute() );
+
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+
+ MapMode aMapMode( aSubstitute.GetPrefMapMode() );
+ Size aOutSize( pDummyVDev->LogicToLogic( pA->GetSize(), pDummyVDev->GetMapMode(), aMapMode ) );
+ aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
+ aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
+ aMapMode.SetOrigin( pDummyVDev->LogicToLogic( pA->GetPoint(), pDummyVDev->GetMapMode(), aMapMode ) );
+
+ m_rOuterFace.SetMapMode( aMapMode );
+ pDummyVDev->SetMapMode( aMapMode );
+ playMetafile( aSubstitute, NULL, i_rContext, pDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_COMMENT_ACTION ):
+ if( ! i_rContext.m_bTransparenciesWereRemoved )
+ {
+ const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
+ String aSkipComment;
+
+ if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ {
+ const MetaGradientExAction* pGradAction = NULL;
+ sal_Bool bDone = sal_False;
+
+ while( !bDone && ( ++i < nCount ) )
+ {
+ pAction = aMtf.GetAction( i );
+
+ if( pAction->GetType() == META_GRADIENTEX_ACTION )
+ pGradAction = (const MetaGradientExAction*) pAction;
+ else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
+ ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
+ {
+ bDone = sal_True;
+ }
+ }
+
+ if( pGradAction )
+ {
+ #if USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient() );
+ #else
+ implWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
+ }
+ else
+ {
+ const sal_uInt8* pData = pA->GetData();
+ if ( pData )
+ {
+ SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
+ sal_Bool bSkipSequence = sal_False;
+ ByteString sSeqEnd;
+
+ if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
+ SvtGraphicStroke aStroke;
+ aMemStm >> aStroke;
+
+ Polygon aPath;
+ aStroke.getPath( aPath );
+
+ PolyPolygon aStartArrow;
+ PolyPolygon aEndArrow;
+ double fTransparency( aStroke.getTransparency() );
+ double fStrokeWidth( aStroke.getStrokeWidth() );
+ SvtGraphicStroke::DashArray aDashArray;
+
+ aStroke.getStartArrow( aStartArrow );
+ aStroke.getEndArrow( aEndArrow );
+ aStroke.getDashArray( aDashArray );
+
+ bSkipSequence = sal_True;
+ if ( aStartArrow.Count() || aEndArrow.Count() )
+ bSkipSequence = sal_False;
+ if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
+ bSkipSequence = sal_False;
+ if ( bSkipSequence )
+ {
+ PDFWriter::ExtLineInfo aInfo;
+ aInfo.m_fLineWidth = fStrokeWidth;
+ aInfo.m_fTransparency = fTransparency;
+ aInfo.m_fMiterLimit = aStroke.getMiterLimit();
+ switch( aStroke.getCapType() )
+ {
+ default:
+ case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break;
+ case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break;
+ case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break;
+ }
+ switch( aStroke.getJoinType() )
+ {
+ default:
+ case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break;
+ case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break;
+ case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break;
+ case SvtGraphicStroke::joinNone:
+ aInfo.m_eJoin = PDFWriter::joinMiter;
+ aInfo.m_fMiterLimit = 0.0;
+ break;
+ }
+ aInfo.m_aDashArray = aDashArray;
+
+ if(SvtGraphicStroke::joinNone == aStroke.getJoinType()
+ && fStrokeWidth > 0.0)
+ {
+ // emulate no edge rounding by handling single edges
+ const sal_uInt16 nPoints(aPath.GetSize());
+ const bool bCurve(aPath.HasFlags());
+
+ for(sal_uInt16 a(0); a + 1 < nPoints; a++)
+ {
+ if(bCurve
+ && POLY_NORMAL != aPath.GetFlags(a + 1)
+ && a + 2 < nPoints
+ && POLY_NORMAL != aPath.GetFlags(a + 2)
+ && a + 3 < nPoints)
+ {
+ const Polygon aSnippet(4,
+ aPath.GetConstPointAry() + a,
+ aPath.GetConstFlagAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ a += 2;
+ }
+ else
+ {
+ const Polygon aSnippet(2,
+ aPath.GetConstPointAry() + a);
+ m_rOuterFace.DrawPolyLine( aSnippet, aInfo );
+ }
+ }
+ }
+ else
+ {
+ m_rOuterFace.DrawPolyLine( aPath, aInfo );
+ }
+ }
+ }
+ else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ {
+ sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
+ SvtGraphicFill aFill;
+ aMemStm >> aFill;
+
+ if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) )
+ {
+ double fTransparency = aFill.getTransparency();
+ if ( fTransparency == 0.0 )
+ {
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+
+ bSkipSequence = sal_True;
+ m_rOuterFace.DrawPolyPolygon( aPath );
+ }
+ else if ( fTransparency == 1.0 )
+ bSkipSequence = sal_True;
+ }
+/* #i81548# removing optimization for fill textures, because most of the texture settings are not
+ exported properly. In OpenOffice 3.1 the drawing layer will support graphic primitives, then it
+ will not be a problem to optimize the filltexture export. But for wysiwyg is more important than
+ filesize.
+ else if( aFill.getFillType() == SvtGraphicFill::fillTexture && aFill.isTiling() )
+ {
+ sal_Int32 nPattern = mnCachePatternId;
+ Graphic aPatternGraphic;
+ aFill.getGraphic( aPatternGraphic );
+ bool bUseCache = false;
+ SvtGraphicFill::Transform aPatTransform;
+ aFill.getTransform( aPatTransform );
+
+ if( mnCachePatternId >= 0 )
+ {
+ SvtGraphicFill::Transform aCacheTransform;
+ maCacheFill.getTransform( aCacheTransform );
+ if( aCacheTransform.matrix[0] == aPatTransform.matrix[0] &&
+ aCacheTransform.matrix[1] == aPatTransform.matrix[1] &&
+ aCacheTransform.matrix[2] == aPatTransform.matrix[2] &&
+ aCacheTransform.matrix[3] == aPatTransform.matrix[3] &&
+ aCacheTransform.matrix[4] == aPatTransform.matrix[4] &&
+ aCacheTransform.matrix[5] == aPatTransform.matrix[5]
+ )
+ {
+ Graphic aCacheGraphic;
+ maCacheFill.getGraphic( aCacheGraphic );
+ if( aCacheGraphic == aPatternGraphic )
+ bUseCache = true;
+ }
+ }
+
+ if( ! bUseCache )
+ {
+
+ // paint graphic to metafile
+ GDIMetaFile aPattern;
+ pDummyVDev->SetConnectMetaFile( &aPattern );
+ pDummyVDev->Push();
+ pDummyVDev->SetMapMode( aPatternGraphic.GetPrefMapMode() );
+
+ aPatternGraphic.Draw( &rDummyVDev, Point( 0, 0 ) );
+ pDummyVDev->Pop();
+ pDummyVDev->SetConnectMetaFile( NULL );
+ aPattern.WindStart();
+
+ MapMode aPatternMapMode( aPatternGraphic.GetPrefMapMode() );
+ // prepare pattern from metafile
+ Size aPrefSize( aPatternGraphic.GetPrefSize() );
+ // FIXME: this magic -1 shouldn't be necessary
+ aPrefSize.Width() -= 1;
+ aPrefSize.Height() -= 1;
+ aPrefSize = m_rOuterFace.GetReferenceDevice()->
+ LogicToLogic( aPrefSize,
+ &aPatternMapMode,
+ &m_rOuterFace.GetReferenceDevice()->GetMapMode() );
+ // build bounding rectangle of pattern
+ Rectangle aBound( Point( 0, 0 ), aPrefSize );
+ m_rOuterFace.BeginPattern( aBound );
+ m_rOuterFace.Push();
+ pDummyVDev->Push();
+ m_rOuterFace.SetMapMode( aPatternMapMode );
+ pDummyVDev->SetMapMode( aPatternMapMode );
+ ImplWriteActions( m_rOuterFace, NULL, aPattern, rDummyVDev );
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+
+ nPattern = m_rOuterFace.EndPattern( aPatTransform );
+
+ // try some caching and reuse pattern
+ mnCachePatternId = nPattern;
+ maCacheFill = aFill;
+ }
+
+ // draw polypolygon with pattern fill
+ PolyPolygon aPath;
+ aFill.getPath( aPath );
+ m_rOuterFace.DrawPolyPolygon( aPath, nPattern, aFill.getFillRule() == SvtGraphicFill::fillEvenOdd );
+
+ bSkipSequence = sal_True;
+ }
+*/
+ }
+ if ( bSkipSequence )
+ {
+ while( ++i < nCount )
+ {
+ pAction = aMtf.GetAction( i );
+ if ( pAction->GetType() == META_COMMENT_ACTION )
+ {
+ ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() );
+ if ( sComment.Equals( sSeqEnd ) )
+ break;
+ }
+ // #i44496#
+ // the replacement action for stroke is a filled rectangle
+ // the set fillcolor of the replacement is part of the graphics
+ // state and must not be skipped
+ else if( pAction->GetType() == META_FILLCOLOR_ACTION )
+ {
+ const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction;
+ if( pMA->IsSetting() )
+ m_rOuterFace.SetFillColor( pMA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case( META_BMP_ACTION ):
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ if( ! ( aSize.Width() && aSize.Height() ) )
+ aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALE_ACTION ):
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPSCALEPART_ACTION ):
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmap() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEX_ACTION ):
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
+ aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) );
+ implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALE_ACTION ):
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
+ implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_BMPEXSCALEPART_ACTION ):
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
+ BitmapEx aBitmapEx( pA->GetBitmapEx() );
+ aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, pDummyVDev, i_rContext );
+ }
+ break;
+
+ case( META_MASK_ACTION ):
+ case( META_MASKSCALE_ACTION ):
+ case( META_MASKSCALEPART_ACTION ):
+ {
+ OSL_TRACE( "MetaMask...Action not supported yet" );
+ }
+ break;
+
+ case( META_TEXT_ACTION ):
+ {
+ const MetaTextAction* pA = (const MetaTextAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
+ }
+ break;
+
+ case( META_TEXTRECT_ACTION ):
+ {
+ const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
+ m_rOuterFace.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
+ }
+ break;
+
+ case( META_TEXTARRAY_ACTION ):
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
+ m_rOuterFace.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+ case( META_STRETCHTEXT_ACTION ):
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
+ m_rOuterFace.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ }
+ break;
+
+
+ case( META_TEXTLINE_ACTION ):
+ {
+ const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction;
+ m_rOuterFace.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() );
+
+ }
+ break;
+
+ case( META_CLIPREGION_ACTION ):
+ {
+ const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction;
+
+ if( pA->IsClipping() )
+ {
+ if( pA->GetRegion().IsEmpty() )
+ m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() );
+ else
+ {
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.SetClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ }
+ else
+ m_rOuterFace.SetClipRegion();
+ }
+ break;
+
+ case( META_ISECTRECTCLIPREGION_ACTION ):
+ {
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction;
+ m_rOuterFace.IntersectClipRegion( pA->GetRect() );
+ }
+ break;
+
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
+ {
+ const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction;
+ Region aReg( pA->GetRegion() );
+ m_rOuterFace.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() );
+ }
+ break;
+
+ case( META_MOVECLIPREGION_ACTION ):
+ {
+ const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction;
+ m_rOuterFace.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() );
+ }
+ break;
+
+ case( META_MAPMODE_ACTION ):
+ {
+ const_cast< MetaAction* >( pAction )->Execute( pDummyVDev );
+ m_rOuterFace.SetMapMode( pDummyVDev->GetMapMode() );
+ }
+ break;
+
+ case( META_LINECOLOR_ACTION ):
+ {
+ const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetLineColor();
+ }
+ break;
+
+ case( META_FILLCOLOR_ACTION ):
+ {
+ const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetFillColor();
+ }
+ break;
+
+ case( META_TEXTLINECOLOR_ACTION ):
+ {
+ const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextLineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextLineColor();
+ }
+ break;
+
+ case( META_OVERLINECOLOR_ACTION ):
+ {
+ const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetOverlineColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetOverlineColor();
+ }
+ break;
+
+ case( META_TEXTFILLCOLOR_ACTION ):
+ {
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction;
+
+ if( pA->IsSetting() )
+ m_rOuterFace.SetTextFillColor( pA->GetColor() );
+ else
+ m_rOuterFace.SetTextFillColor();
+ }
+ break;
+
+ case( META_TEXTCOLOR_ACTION ):
+ {
+ const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction;
+ m_rOuterFace.SetTextColor( pA->GetColor() );
+ }
+ break;
+
+ case( META_TEXTALIGN_ACTION ):
+ {
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction;
+ m_rOuterFace.SetTextAlign( pA->GetTextAlign() );
+ }
+ break;
+
+ case( META_FONT_ACTION ):
+ {
+ const MetaFontAction* pA = (const MetaFontAction*) pAction;
+ m_rOuterFace.SetFont( pA->GetFont() );
+ }
+ break;
+
+ case( META_PUSH_ACTION ):
+ {
+ const MetaPushAction* pA = (const MetaPushAction*) pAction;
+
+ pDummyVDev->Push( pA->GetFlags() );
+ m_rOuterFace.Push( pA->GetFlags() );
+ }
+ break;
+
+ case( META_POP_ACTION ):
+ {
+ pDummyVDev->Pop();
+ m_rOuterFace.Pop();
+ }
+ break;
+
+ case( META_LAYOUTMODE_ACTION ):
+ {
+ const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction;
+ m_rOuterFace.SetLayoutMode( pA->GetLayoutMode() );
+ }
+ break;
+
+ case META_TEXTLANGUAGE_ACTION:
+ {
+ const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction;
+ m_rOuterFace.SetDigitLanguage( pA->GetTextLanguage() );
+ }
+ break;
+
+ case( META_WALLPAPER_ACTION ):
+ {
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction;
+ m_rOuterFace.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() );
+ }
+ break;
+
+ case( META_RASTEROP_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ case( META_REFPOINT_ACTION ):
+ {
+ // !!! >>> we don't want to support this actions
+ }
+ break;
+
+ default:
+ // #i24604# Made assertion fire only once per
+ // metafile. The asserted actions here are all
+ // deprecated
+ if( !bAssertionFired )
+ {
+ bAssertionFired = true;
+ OSL_TRACE( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" );
+ }
+ break;
+ }
+ i++;
+ }
+ }
+
+ delete pPrivateDevice;
+}
+
+// Encryption methods
+
+/* a crutch to transport an rtlDigest safely though UNO API
+ this is needed for the PDF export dialog, which otherwise would have to pass
+ clear text passwords down till they can be used in PDFWriter. Unfortunately
+ the MD5 sum of the password (which is needed to create the PDF encryption key)
+ is not sufficient, since an rtl MD5 digest cannot be created in an arbitrary state
+ which would be needed in PDFWriterImpl::computeEncryptionKey.
+*/
+class EncHashTransporter : public cppu::WeakImplHelper1 < com::sun::star::beans::XMaterialHolder >
+{
+ rtlDigest maUDigest;
+ sal_IntPtr maID;
+ std::vector< sal_uInt8 > maOValue;
+
+ static std::map< sal_IntPtr, EncHashTransporter* > sTransporters;
+public:
+ EncHashTransporter()
+ : maUDigest( rtl_digest_createMD5() )
+ {
+ maID = reinterpret_cast< sal_IntPtr >(this);
+ while( sTransporters.find( maID ) != sTransporters.end() ) // paranoia mode
+ maID++;
+ sTransporters[ maID ] = this;
+ }
+
+ virtual ~EncHashTransporter()
+ {
+ sTransporters.erase( maID );
+ if( maUDigest )
+ rtl_digest_destroyMD5( maUDigest );
+ OSL_TRACE( "EncHashTransporter freed\n" );
+ }
+
+ rtlDigest getUDigest() const { return maUDigest; };
+ std::vector< sal_uInt8 >& getOValue() { return maOValue; }
+ void invalidate()
+ {
+ if( maUDigest )
+ {
+ rtl_digest_destroyMD5( maUDigest );
+ maUDigest = NULL;
+ }
+ }
+
+ // XMaterialHolder
+ virtual uno::Any SAL_CALL getMaterial() throw()
+ {
+ return uno::makeAny( sal_Int64(maID) );
+ }
+
+ static EncHashTransporter* getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& );
+
+};
+
+std::map< sal_IntPtr, EncHashTransporter* > EncHashTransporter::sTransporters;
+
+EncHashTransporter* EncHashTransporter::getEncHashTransporter( const uno::Reference< beans::XMaterialHolder >& xRef )
+{
+ EncHashTransporter* pResult = NULL;
+ if( xRef.is() )
+ {
+ uno::Any aMat( xRef->getMaterial() );
+ sal_Int64 nMat = 0;
+ if( aMat >>= nMat )
+ {
+ std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find( static_cast<sal_IntPtr>(nMat) );
+ if( it != sTransporters.end() )
+ pResult = it->second;
+ }
+ }
+ return pResult;
+}
+
+sal_Bool PDFWriterImpl::checkEncryptionBufferSize( register sal_Int32 newSize )
+{
+ if( m_nEncryptionBufferSize < newSize )
+ {
+ /* reallocate the buffer, the used function allocate as rtl_allocateMemory
+ if the pointer parameter is NULL */
+ m_pEncryptionBuffer = (sal_uInt8*)rtl_reallocateMemory( m_pEncryptionBuffer, newSize );
+ if( m_pEncryptionBuffer )
+ m_nEncryptionBufferSize = newSize;
+ else
+ m_nEncryptionBufferSize = 0;
+ }
+ return ( m_nEncryptionBufferSize != 0 );
+}
+
+void PDFWriterImpl::checkAndEnableStreamEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ m_bEncryptThisStream = true;
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+void PDFWriterImpl::enableStringEncryption( register sal_Int32 nObject )
+{
+ if( m_aContext.Encryption.Encrypt() )
+ {
+ sal_Int32 i = m_nKeyLength;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)nObject;
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 8 );
+ m_aContext.Encryption.EncryptionKey[i++] = (sal_uInt8)( nObject >> 16 );
+ //the other location of m_nEncryptionKey are already set to 0, our fixed generation number
+ // do the MD5 hash
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ // the i+2 to take into account the generation number, always zero
+ rtl_digest_MD5( &m_aContext.Encryption.EncryptionKey[0], i+2, nMD5Sum, sizeof(nMD5Sum) );
+ // initialize the RC4 with the key
+ // key legth: see algoritm 3.1, step 4: (N+5) max 16
+ rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum, m_nRC4KeyLength, NULL, 0 );
+ }
+}
+
+/* init the encryption engine
+1. init the document id, used both for building the document id and for building the encryption key(s)
+2. build the encryption key following algorithms described in the PDF specification
+ */
+uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ )
+{
+ uno::Reference< beans::XMaterialHolder > xResult;
+ if( i_rOwnerPassword.getLength() || i_rUserPassword.getLength() )
+ {
+ EncHashTransporter* pTransporter = new EncHashTransporter;
+ xResult = pTransporter;
+
+ // get padded passwords
+ sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE];
+ padPassword( i_rOwnerPassword.getLength() ? i_rOwnerPassword : i_rUserPassword, aPadOPW );
+ padPassword( i_rUserPassword, aPadUPW );
+ sal_Int32 nKeyLength = SECUR_40BIT_KEY;
+ if( b128Bit )
+ nKeyLength = SECUR_128BIT_KEY;
+
+ if( computeODictionaryValue( aPadOPW, aPadUPW, pTransporter->getOValue(), nKeyLength ) )
+ {
+ rtlDigest aDig = pTransporter->getUDigest();
+ if( rtl_digest_updateMD5( aDig, aPadUPW, ENCRYPTED_PWD_SIZE ) != rtl_Digest_E_None )
+ xResult.clear();
+ }
+ else
+ xResult.clear();
+
+ // trash temporary padded cleartext PWDs
+ rtl_zeroMemory( aPadOPW, sizeof(aPadOPW) );
+ rtl_zeroMemory( aPadUPW, sizeof(aPadUPW) );
+
+ }
+ return xResult;
+}
+
+bool PDFWriterImpl::prepareEncryption( const uno::Reference< beans::XMaterialHolder >& xEnc )
+{
+ bool bSuccess = false;
+ EncHashTransporter* pTransporter = EncHashTransporter::getEncHashTransporter( xEnc );
+ if( pTransporter )
+ {
+ sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
+ sal_Int32 nAccessPermissions = computeAccessPermissions( m_aContext.Encryption, nKeyLength, nRC4KeyLength );
+ m_aContext.Encryption.OValue = pTransporter->getOValue();
+ bSuccess = computeUDictionaryValue( pTransporter, m_aContext.Encryption, nKeyLength, nAccessPermissions );
+ }
+ if( ! bSuccess )
+ {
+ m_aContext.Encryption.OValue.clear();
+ m_aContext.Encryption.UValue.clear();
+ m_aContext.Encryption.EncryptionKey.clear();
+ }
+ return bSuccess;
+}
+
+sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+ sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
+{
+ /*
+ 2) compute the access permissions, in numerical form
+
+ the default value depends on the revision 2 (40 bit) or 3 (128 bit security):
+ - for 40 bit security the unused bit must be set to 1, since they are not used
+ - for 128 bit security the same bit must be preset to 0 and set later if needed
+ according to the table 3.15, pdf v 1.4 */
+ sal_Int32 nAccessPermissions = ( i_rProperties.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ;
+
+ /* check permissions for 40 bit security case */
+ nAccessPermissions |= ( i_rProperties.CanPrintTheDocument ) ? 1 << 2 : 0;
+ nAccessPermissions |= ( i_rProperties.CanModifyTheContent ) ? 1 << 3 : 0;
+ nAccessPermissions |= ( i_rProperties.CanCopyOrExtract ) ? 1 << 4 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAddOrModify ) ? 1 << 5 : 0;
+ o_rKeyLength = SECUR_40BIT_KEY;
+ o_rRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5
+
+ if( i_rProperties.Security128bit )
+ {
+ o_rKeyLength = SECUR_128BIT_KEY;
+ o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum
+ // permitted value is 16
+ nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0;
+ nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0;
+ nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0;
+ nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0;
+ }
+ return nAccessPermissions;
+}
+
+/*************************************************************
+begin i12626 methods
+
+Implements Algorithm 3.2, step 1 only
+*/
+void PDFWriterImpl::padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_pPaddedPW )
+{
+ // get ansi-1252 version of the password string CHECKIT ! i12626
+ rtl::OString aString( rtl::OUStringToOString( i_rPassword, RTL_TEXTENCODING_MS_1252 ) );
+
+ //copy the string to the target
+ sal_Int32 nToCopy = ( aString.getLength() < ENCRYPTED_PWD_SIZE ) ? aString.getLength() : ENCRYPTED_PWD_SIZE;
+ sal_Int32 nCurrentChar;
+
+ for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
+ o_pPaddedPW[nCurrentChar] = (sal_uInt8)( aString.getStr()[nCurrentChar] );
+
+ //pad it with standard byte string
+ sal_Int32 i,y;
+ for( i = nCurrentChar, y = 0 ; i < ENCRYPTED_PWD_SIZE; i++, y++ )
+ o_pPaddedPW[i] = s_nPadString[y];
+
+ // trash memory of temporary clear text password
+ rtl_zeroMemory( (sal_Char*)aString.getStr(), aString.getLength() );
+}
+
+/**********************************
+Algorithm 3.2 Compute the encryption key used
+
+step 1 should already be done before calling, the paThePaddedPassword parameter should contain
+the padded password and must be 32 byte long, the encryption key is returned into the paEncryptionKey parameter,
+it will be 16 byte long for 128 bit security; for 40 bit security only the first 5 bytes are used
+
+TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec.
+
+*/
+bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties& io_rProperties, sal_Int32 i_nAccessPermissions )
+{
+ bool bSuccess = true;
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ // transporter contains an MD5 digest with the padded user password already
+ rtlDigest aDigest = i_pTransporter->getUDigest();
+ rtlDigestError nError = rtl_Digest_E_None;
+ if( aDigest )
+ {
+ //step 3
+ if( ! io_rProperties.OValue.empty() )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.OValue[0] , sal_Int32(io_rProperties.OValue.size()) );
+ else
+ bSuccess = false;
+ //Step 4
+ sal_uInt8 nPerm[4];
+
+ nPerm[0] = (sal_uInt8)i_nAccessPermissions;
+ nPerm[1] = (sal_uInt8)( i_nAccessPermissions >> 8 );
+ nPerm[2] = (sal_uInt8)( i_nAccessPermissions >> 16 );
+ nPerm[3] = (sal_uInt8)( i_nAccessPermissions >> 24 );
+
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, nPerm , sizeof( nPerm ) );
+
+ //step 5, get the document ID, binary form
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ //get the digest
+ if( nError == rtl_Digest_E_None )
+ {
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+
+ //step 6, only if 128 bit
+ if( io_rProperties.Security128bit )
+ {
+ for( sal_Int32 i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ }
+ }
+ else
+ bSuccess = false;
+
+ i_pTransporter->invalidate();
+
+ //Step 7
+ if( bSuccess )
+ {
+ io_rProperties.EncryptionKey.resize( MAXIMUM_RC4_KEY_LENGTH );
+ for( sal_Int32 i = 0; i < MD5_DIGEST_SIZE; i++ )
+ io_rProperties.EncryptionKey[i] = nMD5Sum[i];
+ }
+ else
+ io_rProperties.EncryptionKey.clear();
+
+ return bSuccess;
+}
+
+/**********************************
+Algorithm 3.3 Compute the encryption dictionary /O value, save into the class data member
+the step numbers down here correspond to the ones in PDF v.1.4 specfication
+*/
+bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPassword,
+ const sal_uInt8* i_pPaddedUserPassword,
+ std::vector< sal_uInt8 >& io_rOValue,
+ sal_Int32 i_nKeyLength
+ )
+{
+ bool bSuccess = true;
+
+ io_rOValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher)
+ {
+ //step 1 already done, data is in i_pPaddedOwnerPassword
+ //step 2
+
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, i_pPaddedOwnerPassword, ENCRYPTED_PWD_SIZE );
+ if( nError == rtl_Digest_E_None )
+ {
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+//step 3, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_Int32 i;
+ for( i = 0; i < 50; i++ )
+ {
+ nError = rtl_digest_updateMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ if( nError != rtl_Digest_E_None )
+ {
+ bSuccess = false;
+ break;
+ }
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) );
+ }
+ }
+ //Step 4, the key is in nMD5Sum
+ //step 5 already done, data is in i_pPaddedUserPassword
+ //step 6
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nMD5Sum, i_nKeyLength , NULL, 0 );
+ // encrypt the user password using the key set above
+ rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
+ //Step 7, only if 128 bit
+ if( i_nKeyLength == SECUR_128BIT_KEY )
+ {
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ); y++ )
+ nLocalKey[y] = (sal_uInt8)( nMD5Sum[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
+ &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
+ //step 8, store in class data member
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rOValue.clear();
+ return bSuccess;
+}
+
+/**********************************
+Algorithms 3.4 and 3.5 Compute the encryption dictionary /U value, save into the class data member, revision 2 (40 bit) or 3 (128 bit)
+*/
+bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& io_rProperties,
+ sal_Int32 i_nKeyLength,
+ sal_Int32 i_nAccessPermissions
+ )
+{
+ bool bSuccess = true;
+
+ io_rProperties.UValue.resize( ENCRYPTED_PWD_SIZE );
+
+ rtlDigest aDigest = rtl_digest_createMD5();
+ rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
+ if( aDigest && aCipher )
+ {
+ //step 1, common to both 3.4 and 3.5
+ if( computeEncryptionKey( i_pTransporter, io_rProperties, i_nAccessPermissions ) )
+ {
+ // prepare encryption key for object
+ for( sal_Int32 i = i_nKeyLength, y = 0; y < 5 ; y++ )
+ io_rProperties.EncryptionKey[i++] = 0;
+
+ if( io_rProperties.Security128bit == false )
+ {
+ //3.4
+ //step 2 and 3
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], 5 , // key and key length
+ NULL, 0 ); //destination data area
+ // encrypt the user password using the key set above, save for later use
+ rtl_cipher_encodeARCFOUR( aCipher, s_nPadString, sizeof( s_nPadString ), // the data to be encrypted
+ &io_rProperties.UValue[0], sal_Int32(io_rProperties.UValue.size()) ); //encrypted data, stored in class data member
+ }
+ else
+ {
+ //or 3.5, for 128 bit security
+ //step6, initilize the last 16 bytes of the encrypted user password to 0
+ for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++)
+ io_rProperties.UValue[i] = 0;
+ //step 2
+ rtlDigestError nError = rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) );
+ //step 3
+ if( nError == rtl_Digest_E_None )
+ nError = rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) );
+ else
+ bSuccess = false;
+
+ sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
+ rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) );
+ //Step 4
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, NULL, 0 ); //destination data area
+ rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted
+ &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member
+ //step 5
+ sal_uInt32 i, y;
+ sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
+
+ for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
+ {
+ for( y = 0; y < sizeof( nLocalKey ) ; y++ )
+ nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i );
+
+ rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
+ nLocalKey, SECUR_128BIT_KEY, // key and key length
+ NULL, 0 ); //destination data area, on init can be NULL
+ rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
+ &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
+ }
+ }
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ bSuccess = false;
+
+ if( aDigest )
+ rtl_digest_destroyMD5( aDigest );
+ if( aCipher )
+ rtl_cipher_destroyARCFOUR( aCipher );
+
+ if( ! bSuccess )
+ io_rProperties.UValue.clear();
+ return bSuccess;
+}
+
+/* end i12626 methods */
+
+static const long unsetRun[256] =
+{
+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */
+};
+
+static const long setRun[256] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */
+ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */
+};
+
+inline bool isSet( const Scanline i_pLine, long i_nIndex )
+{
+ return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0;
+}
+
+long findBitRun( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet )
+{
+ if( i_nStartIndex < 0 )
+ return i_nW;
+
+ long nIndex = i_nStartIndex;
+ if( nIndex < i_nW )
+ {
+ const sal_uInt8 * pByte = static_cast<sal_uInt8*>(i_pLine) + (nIndex/8);
+ sal_uInt8 nByte = *pByte;
+
+ // run up to byte boundary
+ long nBitInByte = (nIndex & 7);
+ if( nBitInByte )
+ {
+ sal_uInt8 nMask = 0x80 >> nBitInByte;
+ while( nBitInByte != 8 )
+ {
+ if( (nByte & nMask) != (i_bSet ? nMask : 0) )
+ return nIndex < i_nW ? nIndex : i_nW;
+ nMask = nMask >> 1;
+ nBitInByte++;
+ nIndex++;
+ }
+ if( nIndex < i_nW )
+ {
+ pByte++;
+ nByte = *pByte;
+ }
+ }
+
+ sal_uInt8 nRunByte;
+ const long* pRunTable;
+ if( i_bSet )
+ {
+ nRunByte = 0xff;
+ pRunTable = setRun;
+ }
+ else
+ {
+ nRunByte = 0;
+ pRunTable = unsetRun;
+ }
+
+ while( nByte == nRunByte && nIndex < i_nW )
+ {
+ nIndex += 8;
+ pByte++;
+ nByte = *pByte;
+ }
+ if( nIndex < i_nW )
+ {
+ nIndex += pRunTable[nByte];
+ }
+ }
+ return nIndex < i_nW ? nIndex : i_nW;
+}
+
+struct BitStreamState
+{
+ sal_uInt8 mnBuffer;
+ sal_uInt32 mnNextBitPos;
+
+ BitStreamState()
+ : mnBuffer( 0 )
+ , mnNextBitPos( 8 )
+ {
+ }
+
+ const sal_uInt8* getByte() const { return &mnBuffer; }
+ void flush() { mnNextBitPos = 8; mnBuffer = 0; }
+};
+
+void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState )
+{
+ while( i_nLength > io_rState.mnNextBitPos )
+ {
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( i_nCode >> (i_nLength - io_rState.mnNextBitPos) );
+ i_nLength -= io_rState.mnNextBitPos;
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+ OSL_ASSERT( i_nLength < 9 );
+ static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( (i_nCode & msbmask[i_nLength]) << (io_rState.mnNextBitPos - i_nLength) );
+ io_rState.mnNextBitPos -= i_nLength;
+ if( io_rState.mnNextBitPos == 0 )
+ {
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+}
+
+struct PixelCode
+{
+ sal_uInt32 mnEncodedPixels;
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+};
+
+static const PixelCode WhitePixelCodes[] =
+{
+ { 0, 8, 0x35 }, // 0011 0101
+ { 1, 6, 0x7 }, // 0001 11
+ { 2, 4, 0x7 }, // 0111
+ { 3, 4, 0x8 }, // 1000
+ { 4, 4, 0xB }, // 1011
+ { 5, 4, 0xC }, // 1100
+ { 6, 4, 0xE }, // 1110
+ { 7, 4, 0xF }, // 1111
+ { 8, 5, 0x13 }, // 1001 1
+ { 9, 5, 0x14 }, // 1010 0
+ { 10, 5, 0x7 }, // 0011 1
+ { 11, 5, 0x8 }, // 0100 0
+ { 12, 6, 0x8 }, // 0010 00
+ { 13, 6, 0x3 }, // 0000 11
+ { 14, 6, 0x34 }, // 1101 00
+ { 15, 6, 0x35 }, // 1101 01
+ { 16, 6, 0x2A }, // 1010 10
+ { 17, 6, 0x2B }, // 1010 11
+ { 18, 7, 0x27 }, // 0100 111
+ { 19, 7, 0xC }, // 0001 100
+ { 20, 7, 0x8 }, // 0001 000
+ { 21, 7, 0x17 }, // 0010 111
+ { 22, 7, 0x3 }, // 0000 011
+ { 23, 7, 0x4 }, // 0000 100
+ { 24, 7, 0x28 }, // 0101 000
+ { 25, 7, 0x2B }, // 0101 011
+ { 26, 7, 0x13 }, // 0010 011
+ { 27, 7, 0x24 }, // 0100 100
+ { 28, 7, 0x18 }, // 0011 000
+ { 29, 8, 0x2 }, // 0000 0010
+ { 30, 8, 0x3 }, // 0000 0011
+ { 31, 8, 0x1A }, // 0001 1010
+ { 32, 8, 0x1B }, // 0001 1011
+ { 33, 8, 0x12 }, // 0001 0010
+ { 34, 8, 0x13 }, // 0001 0011
+ { 35, 8, 0x14 }, // 0001 0100
+ { 36, 8, 0x15 }, // 0001 0101
+ { 37, 8, 0x16 }, // 0001 0110
+ { 38, 8, 0x17 }, // 0001 0111
+ { 39, 8, 0x28 }, // 0010 1000
+ { 40, 8, 0x29 }, // 0010 1001
+ { 41, 8, 0x2A }, // 0010 1010
+ { 42, 8, 0x2B }, // 0010 1011
+ { 43, 8, 0x2C }, // 0010 1100
+ { 44, 8, 0x2D }, // 0010 1101
+ { 45, 8, 0x4 }, // 0000 0100
+ { 46, 8, 0x5 }, // 0000 0101
+ { 47, 8, 0xA }, // 0000 1010
+ { 48, 8, 0xB }, // 0000 1011
+ { 49, 8, 0x52 }, // 0101 0010
+ { 50, 8, 0x53 }, // 0101 0011
+ { 51, 8, 0x54 }, // 0101 0100
+ { 52, 8, 0x55 }, // 0101 0101
+ { 53, 8, 0x24 }, // 0010 0100
+ { 54, 8, 0x25 }, // 0010 0101
+ { 55, 8, 0x58 }, // 0101 1000
+ { 56, 8, 0x59 }, // 0101 1001
+ { 57, 8, 0x5A }, // 0101 1010
+ { 58, 8, 0x5B }, // 0101 1011
+ { 59, 8, 0x4A }, // 0100 1010
+ { 60, 8, 0x4B }, // 0100 1011
+ { 61, 8, 0x32 }, // 0011 0010
+ { 62, 8, 0x33 }, // 0011 0011
+ { 63, 8, 0x34 }, // 0011 0100
+ { 64, 5, 0x1B }, // 1101 1
+ { 128, 5, 0x12 }, // 1001 0
+ { 192, 6, 0x17 }, // 0101 11
+ { 256, 7, 0x37 }, // 0110 111
+ { 320, 8, 0x36 }, // 0011 0110
+ { 384, 8, 0x37 }, // 0011 0111
+ { 448, 8, 0x64 }, // 0110 0100
+ { 512, 8, 0x65 }, // 0110 0101
+ { 576, 8, 0x68 }, // 0110 1000
+ { 640, 8, 0x67 }, // 0110 0111
+ { 704, 9, 0xCC }, // 0110 0110 0
+ { 768, 9, 0xCD }, // 0110 0110 1
+ { 832, 9, 0xD2 }, // 0110 1001 0
+ { 896, 9, 0xD3 }, // 0110 1001 1
+ { 960, 9, 0xD4 }, // 0110 1010 0
+ { 1024, 9, 0xD5 }, // 0110 1010 1
+ { 1088, 9, 0xD6 }, // 0110 1011 0
+ { 1152, 9, 0xD7 }, // 0110 1011 1
+ { 1216, 9, 0xD8 }, // 0110 1100 0
+ { 1280, 9, 0xD9 }, // 0110 1100 1
+ { 1344, 9, 0xDA }, // 0110 1101 0
+ { 1408, 9, 0xDB }, // 0110 1101 1
+ { 1472, 9, 0x98 }, // 0100 1100 0
+ { 1536, 9, 0x99 }, // 0100 1100 1
+ { 1600, 9, 0x9A }, // 0100 1101 0
+ { 1664, 6, 0x18 }, // 0110 00
+ { 1728, 9, 0x9B }, // 0100 1101 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+static const PixelCode BlackPixelCodes[] =
+{
+ { 0, 10, 0x37 }, // 0000 1101 11
+ { 1, 3, 0x2 }, // 010
+ { 2, 2, 0x3 }, // 11
+ { 3, 2, 0x2 }, // 10
+ { 4, 3, 0x3 }, // 011
+ { 5, 4, 0x3 }, // 0011
+ { 6, 4, 0x2 }, // 0010
+ { 7, 5, 0x3 }, // 0001 1
+ { 8, 6, 0x5 }, // 0001 01
+ { 9, 6, 0x4 }, // 0001 00
+ { 10, 7, 0x4 }, // 0000 100
+ { 11, 7, 0x5 }, // 0000 101
+ { 12, 7, 0x7 }, // 0000 111
+ { 13, 8, 0x4 }, // 0000 0100
+ { 14, 8, 0x7 }, // 0000 0111
+ { 15, 9, 0x18 }, // 0000 1100 0
+ { 16, 10, 0x17 }, // 0000 0101 11
+ { 17, 10, 0x18 }, // 0000 0110 00
+ { 18, 10, 0x8 }, // 0000 0010 00
+ { 19, 11, 0x67 }, // 0000 1100 111
+ { 20, 11, 0x68 }, // 0000 1101 000
+ { 21, 11, 0x6C }, // 0000 1101 100
+ { 22, 11, 0x37 }, // 0000 0110 111
+ { 23, 11, 0x28 }, // 0000 0101 000
+ { 24, 11, 0x17 }, // 0000 0010 111
+ { 25, 11, 0x18 }, // 0000 0011 000
+ { 26, 12, 0xCA }, // 0000 1100 1010
+ { 27, 12, 0xCB }, // 0000 1100 1011
+ { 28, 12, 0xCC }, // 0000 1100 1100
+ { 29, 12, 0xCD }, // 0000 1100 1101
+ { 30, 12, 0x68 }, // 0000 0110 1000
+ { 31, 12, 0x69 }, // 0000 0110 1001
+ { 32, 12, 0x6A }, // 0000 0110 1010
+ { 33, 12, 0x6B }, // 0000 0110 1011
+ { 34, 12, 0xD2 }, // 0000 1101 0010
+ { 35, 12, 0xD3 }, // 0000 1101 0011
+ { 36, 12, 0xD4 }, // 0000 1101 0100
+ { 37, 12, 0xD5 }, // 0000 1101 0101
+ { 38, 12, 0xD6 }, // 0000 1101 0110
+ { 39, 12, 0xD7 }, // 0000 1101 0111
+ { 40, 12, 0x6C }, // 0000 0110 1100
+ { 41, 12, 0x6D }, // 0000 0110 1101
+ { 42, 12, 0xDA }, // 0000 1101 1010
+ { 43, 12, 0xDB }, // 0000 1101 1011
+ { 44, 12, 0x54 }, // 0000 0101 0100
+ { 45, 12, 0x55 }, // 0000 0101 0101
+ { 46, 12, 0x56 }, // 0000 0101 0110
+ { 47, 12, 0x57 }, // 0000 0101 0111
+ { 48, 12, 0x64 }, // 0000 0110 0100
+ { 49, 12, 0x65 }, // 0000 0110 0101
+ { 50, 12, 0x52 }, // 0000 0101 0010
+ { 51, 12, 0x53 }, // 0000 0101 0011
+ { 52, 12, 0x24 }, // 0000 0010 0100
+ { 53, 12, 0x37 }, // 0000 0011 0111
+ { 54, 12, 0x38 }, // 0000 0011 1000
+ { 55, 12, 0x27 }, // 0000 0010 0111
+ { 56, 12, 0x28 }, // 0000 0010 1000
+ { 57, 12, 0x58 }, // 0000 0101 1000
+ { 58, 12, 0x59 }, // 0000 0101 1001
+ { 59, 12, 0x2B }, // 0000 0010 1011
+ { 60, 12, 0x2C }, // 0000 0010 1100
+ { 61, 12, 0x5A }, // 0000 0101 1010
+ { 62, 12, 0x66 }, // 0000 0110 0110
+ { 63, 12, 0x67 }, // 0000 0110 0111
+ { 64, 10, 0xF }, // 0000 0011 11
+ { 128, 12, 0xC8 }, // 0000 1100 1000
+ { 192, 12, 0xC9 }, // 0000 1100 1001
+ { 256, 12, 0x5B }, // 0000 0101 1011
+ { 320, 12, 0x33 }, // 0000 0011 0011
+ { 384, 12, 0x34 }, // 0000 0011 0100
+ { 448, 12, 0x35 }, // 0000 0011 0101
+ { 512, 13, 0x6C }, // 0000 0011 0110 0
+ { 576, 13, 0x6D }, // 0000 0011 0110 1
+ { 640, 13, 0x4A }, // 0000 0010 0101 0
+ { 704, 13, 0x4B }, // 0000 0010 0101 1
+ { 768, 13, 0x4C }, // 0000 0010 0110 0
+ { 832, 13, 0x4D }, // 0000 0010 0110 1
+ { 896, 13, 0x72 }, // 0000 0011 1001 0
+ { 960, 13, 0x73 }, // 0000 0011 1001 1
+ { 1024, 13, 0x74 }, // 0000 0011 1010 0
+ { 1088, 13, 0x75 }, // 0000 0011 1010 1
+ { 1152, 13, 0x76 }, // 0000 0011 1011 0
+ { 1216, 13, 0x77 }, // 0000 0011 1011 1
+ { 1280, 13, 0x52 }, // 0000 0010 1001 0
+ { 1344, 13, 0x53 }, // 0000 0010 1001 1
+ { 1408, 13, 0x54 }, // 0000 0010 1010 0
+ { 1472, 13, 0x55 }, // 0000 0010 1010 1
+ { 1536, 13, 0x5A }, // 0000 0010 1101 0
+ { 1600, 13, 0x5B }, // 0000 0010 1101 1
+ { 1664, 13, 0x64 }, // 0000 0011 0010 0
+ { 1728, 13, 0x65 }, // 0000 0011 0010 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+
+void PDFWriterImpl::putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState )
+{
+ const PixelCode* pTable = i_bWhitePixel ? WhitePixelCodes : BlackPixelCodes;
+ // maximum encoded span is 2560 consecutive pixels
+ while( i_nSpan > 2623 )
+ {
+ // write 2560 bits, that is entry (63 + (2560 >> 6)) == 103 in the appropriate table
+ putG4Bits( pTable[103].mnCodeBits, pTable[103].mnCode, io_rState );
+ i_nSpan -= pTable[103].mnEncodedPixels;
+ }
+ // write multiples of 64 pixels up to 2560
+ if( i_nSpan > 63 )
+ {
+ sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
+ OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels == static_cast<sal_uInt32>(64*(i_nSpan >> 6)) );
+ putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
+ i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
+ }
+ putG4Bits( pTable[i_nSpan].mnCodeBits, pTable[i_nSpan].mnCode, io_rState );
+}
+
+void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap )
+{
+ long nW = i_pBitmap->Width();
+ long nH = i_pBitmap->Height();
+ if( nW <= 0 || nH <= 0 )
+ return;
+ if( i_pBitmap->GetBitCount() != 1 )
+ return;
+
+ BitStreamState aBitState;
+
+ // the first reference line is virtual and completely empty
+ const Scanline pFirstRefLine = (Scanline)rtl_allocateZeroMemory( nW/8 + 1 );
+ Scanline pRefLine = pFirstRefLine;
+ for( long nY = 0; nY < nH; nY++ )
+ {
+ const Scanline pCurLine = i_pBitmap->GetScanline( nY );
+ long nLineIndex = 0;
+ bool bRunSet = (*pCurLine & 0x80) ? true : false;
+ bool bRefSet = (*pRefLine & 0x80) ? true : false;
+ long nRunIndex1 = bRunSet ? 0 : findBitRun( pCurLine, 0, nW, bRunSet );
+ long nRefIndex1 = bRefSet ? 0 : findBitRun( pRefLine, 0, nW, bRefSet );
+ for( ; nLineIndex < nW; )
+ {
+ long nRefIndex2 = findBitRun( pRefLine, nRefIndex1, nW, isSet( pRefLine, nRefIndex1 ) );
+ if( nRefIndex2 >= nRunIndex1 )
+ {
+ long nDiff = nRefIndex1 - nRunIndex1;
+ if( -3 <= nDiff && nDiff <= 3 )
+ { // vertical coding
+ static const struct
+ {
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+ } VerticalCodes[7] = {
+ { 7, 0x03 }, // 0000 011
+ { 6, 0x03 }, // 0000 11
+ { 3, 0x03 }, // 011
+ { 1, 0x1 }, // 1
+ { 3, 0x2 }, // 010
+ { 6, 0x02 }, // 0000 10
+ { 7, 0x02 } // 0000 010
+ };
+ // convert to index
+ nDiff += 3;
+
+ // emit diff code
+ putG4Bits( VerticalCodes[nDiff].mnCodeBits, VerticalCodes[nDiff].mnCode, aBitState );
+ nLineIndex = nRunIndex1;
+ }
+ else
+ { // difference too large, horizontal coding
+ // emit horz code 001
+ putG4Bits( 3, 0x1, aBitState );
+ long nRunIndex2 = findBitRun( pCurLine, nRunIndex1, nW, isSet( pCurLine, nRunIndex1 ) );
+ bool bWhiteFirst = ( nLineIndex + nRunIndex1 == 0 || ! isSet( pCurLine, nLineIndex ) );
+ putG4Span( nRunIndex1 - nLineIndex, bWhiteFirst, aBitState );
+ putG4Span( nRunIndex2 - nRunIndex1, ! bWhiteFirst, aBitState );
+ nLineIndex = nRunIndex2;
+ }
+ }
+ else
+ { // emit pass code 0001
+ putG4Bits( 4, 0x1, aBitState );
+ nLineIndex = nRefIndex2;
+ }
+ if( nLineIndex < nW )
+ {
+ bool bSet = isSet( pCurLine, nLineIndex );
+ nRunIndex1 = findBitRun( pCurLine, nLineIndex, nW, bSet );
+ nRefIndex1 = findBitRun( pRefLine, nLineIndex, nW, ! bSet );
+ nRefIndex1 = findBitRun( pRefLine, nRefIndex1, nW, bSet );
+ }
+ }
+
+ // the current line is the reference for the next line
+ pRefLine = pCurLine;
+ }
+ // terminate strip with EOFB
+ putG4Bits( 12, 1, aBitState );
+ putG4Bits( 12, 1, aBitState );
+ if( aBitState.mnNextBitPos != 8 )
+ {
+ writeBuffer( aBitState.getByte(), 1 );
+ aBitState.flush();
+ }
+
+ rtl_freeMemory( pFirstRefLine );
+}
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 94605be2686d..66e3cd1bea1a 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -73,7 +73,7 @@ namespace vcl
// ------------------------------------------------------------------------------
-static const BYTE mpDefaultColorTable[ 256 ] =
+static const sal_uInt8 mpDefaultColorTable[ 256 ] =
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
@@ -112,11 +112,11 @@ private:
AlphaMask* mpAlphaMask;
BitmapWriteAccess* mpMaskAcc;
ZCodec* mpZCodec;
- BYTE* mpInflateInBuf; // as big as the size of a scanline + alphachannel + 1
- BYTE* mpScanPrior; // pointer to the latest scanline
- BYTE* mpTransTab; // for transparency in images with palette colortype
- BYTE* mpScanCurrent; // pointer into the current scanline
- BYTE* mpColorTable; //
+ sal_uInt8* mpInflateInBuf; // as big as the size of a scanline + alphachannel + 1
+ sal_uInt8* mpScanPrior; // pointer to the latest scanline
+ sal_uInt8* mpTransTab; // for transparency in images with palette colortype
+ sal_uInt8* mpScanCurrent; // pointer into the current scanline
+ sal_uInt8* mpColorTable; //
sal_Size mnStreamSize; // estimate of PNG file size
sal_uInt32 mnChunkType; // Type of current PNG chunk
sal_Int32 mnChunkLen; // Length of current PNG chunk
@@ -132,48 +132,48 @@ private:
sal_uInt32 mnYAdd; // the increment for input images Y coords for the current pass
int mnPreviewShift; // shift to convert orig image coords into preview image coords
int mnPreviewMask; // == ((1 << mnPreviewShift) - 1)
- USHORT mnIStmOldMode;
- USHORT mnTargetDepth; // pixel depth of target bitmap
- BYTE mnTransRed;
- BYTE mnTransGreen;
- BYTE mnTransBlue;
- BYTE mnPngDepth; // pixel depth of PNG data
- BYTE mnColorType;
- BYTE mnCompressionType;
- BYTE mnFilterType;
- BYTE mnInterlaceType;
+ sal_uInt16 mnIStmOldMode;
+ sal_uInt16 mnTargetDepth; // pixel depth of target bitmap
+ sal_uInt8 mnTransRed;
+ sal_uInt8 mnTransGreen;
+ sal_uInt8 mnTransBlue;
+ sal_uInt8 mnPngDepth; // pixel depth of PNG data
+ sal_uInt8 mnColorType;
+ sal_uInt8 mnCompressionType;
+ sal_uInt8 mnFilterType;
+ sal_uInt8 mnInterlaceType;
BitmapColor mcTranspColor; // transparency mask's transparency "color"
BitmapColor mcOpaqueColor; // transparency mask's opaque "color"
- BOOL mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel
- BOOL mbAlphaChannel; // is true for ColorType 4 and 6
- BOOL mbRGBTriple;
- BOOL mbPalette; // FALSE if we need a Palette
- BOOL mbGrayScale;
- BOOL mbzCodecInUse;
- BOOL mbStatus;
- BOOL mbIDAT; // TRUE if finished with enough IDAT chunks
- BOOL mbGamma; // TRUE if Gamma Correction available
- BOOL mbpHYs; // TRUE if pysical size of pixel available
+ sal_Bool mbTransparent; // graphic includes an tRNS Chunk or an alpha Channel
+ sal_Bool mbAlphaChannel; // is true for ColorType 4 and 6
+ sal_Bool mbRGBTriple;
+ sal_Bool mbPalette; // sal_False if we need a Palette
+ sal_Bool mbGrayScale;
+ sal_Bool mbzCodecInUse;
+ sal_Bool mbStatus;
+ sal_Bool mbIDAT; // sal_True if finished with enough IDAT chunks
+ sal_Bool mbGamma; // sal_True if Gamma Correction available
+ sal_Bool mbpHYs; // sal_True if pysical size of pixel available
sal_Bool mbIgnoreGammaChunk;
bool ReadNextChunk();
void ReadRemainingChunks();
void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor & );
- void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, BYTE nPalIndex );
- void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, BOOL bTrans );
- void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, BYTE nPalIndex, BYTE nAlpha );
- void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor&, BYTE nAlpha );
+ void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex );
+ void ImplSetTranspPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor &, sal_Bool bTrans );
+ void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex, sal_uInt8 nAlpha );
+ void ImplSetAlphaPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor&, sal_uInt8 nAlpha );
void ImplReadIDAT();
bool ImplPreparePass();
void ImplApplyFilter();
void ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd );
- BOOL ImplReadTransparent();
+ sal_Bool ImplReadTransparent();
void ImplGetGamma();
void ImplGetBackground();
- BYTE ImplScaleColor();
- BOOL ImplReadHeader( const Size& rPreviewSizeHint );
- BOOL ImplReadPalette();
+ sal_uInt8 ImplScaleColor();
+ sal_Bool ImplReadHeader( const Size& rPreviewSizeHint );
+ sal_Bool ImplReadPalette();
void ImplGetGrayPalette( sal_uInt16 );
sal_uInt32 ImplReadsal_uInt32();
@@ -204,8 +204,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
mnPass ( 0 ),
mbzCodecInUse ( sal_False ),
- mbStatus( TRUE),
- mbIDAT( FALSE ),
+ mbStatus( sal_True),
+ mbIDAT( sal_False ),
mbGamma ( sal_False ),
mbpHYs ( sal_False ),
mbIgnoreGammaChunk ( sal_False )
@@ -361,7 +361,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_gAMA : // the gamma chunk must precede
{ // the 'IDAT' and also the 'PLTE'(if available )
- if ( !mbIgnoreGammaChunk && ( mbIDAT == FALSE ) )
+ if ( !mbIgnoreGammaChunk && ( mbIDAT == sal_False ) )
ImplGetGamma();
}
break;
@@ -382,7 +382,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_bKGD : // the background chunk must appear
{
- if ( ( mbIDAT == FALSE ) && mbPalette ) // before the 'IDAT' and after the
+ if ( ( mbIDAT == sal_False ) && mbPalette ) // before the 'IDAT' and after the
ImplGetBackground(); // PLTE(if available ) chunk.
}
break;
@@ -390,7 +390,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
case PNGCHUNK_IDAT :
{
if ( !mpInflateInBuf ) // taking care that the header has properly been read
- mbStatus = FALSE;
+ mbStatus = sal_False;
else if ( !mbIDAT ) // the gfx is finished, but there may be left a zlibCRC of about 4Bytes
ImplReadIDAT();
}
@@ -463,27 +463,27 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
+sal_Bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
if( mnChunkLen < 13 )
- return FALSE;
+ return sal_False;
maOrigSize.Width() = ImplReadsal_uInt32();
maOrigSize.Height() = ImplReadsal_uInt32();
if ( !maOrigSize.Width() || !maOrigSize.Height() )
- return FALSE;
+ return sal_False;
mnPngDepth = *(maDataIter++);
mnColorType = *(maDataIter++);
mnCompressionType = *(maDataIter++);
if( mnCompressionType != 0 ) // unknown compression type
- return FALSE;
+ return sal_False;
mnFilterType = *(maDataIter++);
if( mnFilterType != 0 ) // unknown filter type
- return FALSE;
+ return sal_False;
mnInterlaceType = *(maDataIter++);
switch ( mnInterlaceType ) // filter type valid ?
@@ -495,12 +495,12 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnPass = 0;
break;
default:
- return FALSE;
+ return sal_False;
}
- mbPalette = TRUE;
- mbIDAT = mbAlphaChannel = mbTransparent = FALSE;
- mbGrayScale = mbRGBTriple = FALSE;
+ mbPalette = sal_True;
+ mbIDAT = mbAlphaChannel = mbTransparent = sal_False;
+ mbGrayScale = mbRGBTriple = sal_False;
mnTargetDepth = mnPngDepth;
sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3;
@@ -513,7 +513,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
case 2 : // 2bit target not available -> use four bits
mnTargetDepth = 4; // we have to expand the bitmap
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
case 16 :
mnTargetDepth = 8; // we have to reduce the bitmap
@@ -521,17 +521,17 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 1 :
case 4 :
case 8 :
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
case 2 : // each pixel is an RGB triple
{
- mbRGBTriple = TRUE;
+ mbRGBTriple = sal_True;
nScansize64 *= 3;
switch ( mnPngDepth )
{
@@ -540,7 +540,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnTargetDepth = 24;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
@@ -555,10 +555,10 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 1 :
case 4 :
case 8 :
- mbPalette = FALSE;
+ mbPalette = sal_False;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
@@ -566,25 +566,25 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
case 4 : // each pixel is a grayscale sample followed by an alpha sample
{
nScansize64 *= 2;
- mbAlphaChannel = TRUE;
+ mbAlphaChannel = sal_True;
switch ( mnPngDepth )
{
case 16 :
mnTargetDepth = 8; // we have to reduce the bitmap
case 8 :
- mbGrayScale = TRUE;
+ mbGrayScale = sal_True;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
case 6 : // each pixel is an RGB triple followed by an alpha sample
{
- mbRGBTriple = TRUE;
+ mbRGBTriple = sal_True;
nScansize64 *= 4;
- mbAlphaChannel = TRUE;
+ mbAlphaChannel = sal_True;
switch (mnPngDepth )
{
case 16 : // we have to reduce the bitmap
@@ -592,13 +592,13 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mnTargetDepth = 24;
break;
default :
- return FALSE;
+ return sal_False;
}
}
break;
default :
- return FALSE;
+ return sal_False;
}
mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() );
@@ -608,17 +608,17 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
nScansize64++; // each scanline includes one filterbyte
if ( nScansize64 > SAL_MAX_UINT32 )
- return FALSE;
+ return sal_False;
mnScansize = static_cast< sal_uInt32 >( nScansize64 );
// TODO: switch between both scanlines instead of copying
- mpInflateInBuf = new (std::nothrow) BYTE[ mnScansize ];
+ mpInflateInBuf = new (std::nothrow) sal_uInt8[ mnScansize ];
mpScanCurrent = mpInflateInBuf;
- mpScanPrior = new (std::nothrow) BYTE[ mnScansize ];
+ mpScanPrior = new (std::nothrow) sal_uInt8[ mnScansize ];
if ( !mpInflateInBuf || !mpScanPrior )
- return FALSE;
+ return sal_False;
// calculate target size from original size and the preview hint
if( rPreviewSizeHint.Width() || rPreviewSizeHint.Height() )
@@ -657,7 +657,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpBmp = new Bitmap( maTargetSize, mnTargetDepth );
mpAcc = mpBmp->AcquireWriteAccess();
if( !mpAcc )
- return FALSE;
+ return sal_False;
mpBmp->SetSourceSizePixel( maOrigSize );
@@ -667,7 +667,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
mpAlphaMask->Erase( 128 );
mpMaskAcc = mpAlphaMask->AcquireWriteAccess();
if( !mpMaskAcc )
- return FALSE;
+ return sal_False;
}
if ( mbGrayScale )
@@ -675,7 +675,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
ImplPreparePass();
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -695,38 +695,38 @@ void PNGReaderImpl::ImplGetGrayPalette( sal_uInt16 nBitDepth )
mpAcc->SetPaletteEntryCount( nPaletteEntryCount );
for ( sal_uInt32 i = 0, nStart = 0; nStart < 256; i++, nStart += nAdd )
- mpAcc->SetPaletteColor( (USHORT)i, BitmapColor( mpColorTable[ nStart ],
+ mpAcc->SetPaletteColor( (sal_uInt16)i, BitmapColor( mpColorTable[ nStart ],
mpColorTable[ nStart ], mpColorTable[ nStart ] ) );
}
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadPalette()
+sal_Bool PNGReaderImpl::ImplReadPalette()
{
sal_uInt16 nCount = static_cast<sal_uInt16>( mnChunkLen / 3 );
if ( ( ( mnChunkLen % 3 ) == 0 ) && ( ( 0 < nCount ) && ( nCount <= 256 ) ) && mpAcc )
{
- mbPalette = TRUE;
- mpAcc->SetPaletteEntryCount( (USHORT) nCount );
+ mbPalette = sal_True;
+ mpAcc->SetPaletteEntryCount( (sal_uInt16) nCount );
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
- BYTE nRed = mpColorTable[ *maDataIter++ ];
- BYTE nGreen = mpColorTable[ *maDataIter++ ];
- BYTE nBlue = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nRed = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nGreen = mpColorTable[ *maDataIter++ ];
+ sal_uInt8 nBlue = mpColorTable[ *maDataIter++ ];
mpAcc->SetPaletteColor( i, Color( nRed, nGreen, nBlue ) );
}
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
// ------------------------------------------------------------------------
-BOOL PNGReaderImpl::ImplReadTransparent()
+sal_Bool PNGReaderImpl::ImplReadTransparent()
{
bool bNeedAlpha = false;
@@ -765,7 +765,7 @@ BOOL PNGReaderImpl::ImplReadTransparent()
{
if ( mnChunkLen <= 256 )
{
- mpTransTab = new BYTE [ 256 ];
+ mpTransTab = new sal_uInt8 [ 256 ];
rtl_fillMemory( mpTransTab, 256, 0xff );
rtl_copyMemory( mpTransTab, &(*maDataIter), mnChunkLen );
maDataIter += mnChunkLen;
@@ -793,13 +793,13 @@ BOOL PNGReaderImpl::ImplReadTransparent()
}
mbTransparent = (mpMaskAcc != NULL);
if( !mbTransparent )
- return FALSE;
+ return sal_False;
mcOpaqueColor = BitmapColor( 0x00 );
mcTranspColor = BitmapColor( 0xFF );
mpMaskAcc->Erase( 0x00 );
}
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
@@ -815,7 +815,7 @@ void PNGReaderImpl::ImplGetGamma()
if ( fInvGamma != 1.0 )
{
- mbGamma = TRUE;
+ mbGamma = sal_True;
if ( mpColorTable == mpDefaultColorTable )
mpColorTable = new sal_uInt8[ 256 ];
@@ -838,10 +838,10 @@ void PNGReaderImpl::ImplGetBackground()
{
if ( mnChunkLen == 1 )
{
- UINT16 nCol = *maDataIter++;
+ sal_uInt16 nCol = *maDataIter++;
if ( nCol < mpAcc->GetPaletteEntryCount() )
{
- mpAcc->Erase( mpAcc->GetPaletteColor( (BYTE)nCol ) );
+ mpAcc->Erase( mpAcc->GetPaletteColor( (sal_uInt8)nCol ) );
break;
}
}
@@ -900,9 +900,9 @@ void PNGReaderImpl::ImplReadIDAT()
{
if( mnChunkLen > 0 )
{
- if ( mbzCodecInUse == FALSE )
+ if ( mbzCodecInUse == sal_False )
{
- mbzCodecInUse = TRUE;
+ mbzCodecInUse = sal_True;
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT );
}
mpZCodec->SetBreak( mnChunkLen );
@@ -915,7 +915,7 @@ void PNGReaderImpl::ImplReadIDAT()
sal_Int32 nRead = mpZCodec->ReadAsynchron( aIStrm, mpScanCurrent, nToRead );
if ( nRead < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
if ( nRead < nToRead )
@@ -946,7 +946,7 @@ void PNGReaderImpl::ImplReadIDAT()
if( mbIDAT )
{
mpZCodec->EndCompression();
- mbzCodecInUse = FALSE;
+ mbzCodecInUse = sal_False;
}
}
@@ -1021,9 +1021,9 @@ bool PNGReaderImpl::ImplPreparePass()
void PNGReaderImpl::ImplApplyFilter()
{
OSL_ASSERT( mnScansize >= mnBPP + 1 );
- const BYTE* const pScanEnd = mpInflateInBuf + mnScansize;
+ const sal_uInt8* const pScanEnd = mpInflateInBuf + mnScansize;
- BYTE nFilterType = *mpInflateInBuf; // the filter type may change each scanline
+ sal_uInt8 nFilterType = *mpInflateInBuf; // the filter type may change each scanline
switch ( nFilterType )
{
default: // unknown Scanline Filter Type
@@ -1033,26 +1033,26 @@ void PNGReaderImpl::ImplApplyFilter()
case 1: // Scanline Filter Type "Sub"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = p1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = p1;
p1 += mnBPP;
// use left pixels
do
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
while( ++p1 < pScanEnd );
}
break;
case 2: // Scanline Filter Type "Up"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
// use pixels from prior line
while( p1 < pScanEnd )
{
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
++p1;
}
}
@@ -1060,18 +1060,18 @@ void PNGReaderImpl::ImplApplyFilter()
case 3: // Scanline Filter Type "Average"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
- const BYTE* p3 = p1;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
+ const sal_uInt8* p3 = p1;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1, ++p2)
- *p1 = static_cast<BYTE>( *p1 + (*p2 >> 1) );
+ *p1 = static_cast<sal_uInt8>( *p1 + (*p2 >> 1) );
// predict by averaging the left and prior line pixels
while( p1 < pScanEnd )
{
- *p1 = static_cast<BYTE>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
+ *p1 = static_cast<sal_uInt8>( *p1 + ((*(p2++) + *(p3++)) >> 1) );
++p1;
}
}
@@ -1079,14 +1079,14 @@ void PNGReaderImpl::ImplApplyFilter()
case 4: // Scanline Filter Type "PaethPredictor"
{
- BYTE* p1 = mpInflateInBuf + 1;
- const BYTE* p2 = mpScanPrior + 1;
- const BYTE* p3 = p1;
- const BYTE* p4 = p2;
+ sal_uInt8* p1 = mpInflateInBuf + 1;
+ const sal_uInt8* p2 = mpScanPrior + 1;
+ const sal_uInt8* p3 = p1;
+ const sal_uInt8* p4 = p2;
// use one pixel from prior line
for( int n = mnBPP; --n >= 0; ++p1)
- *p1 = static_cast<BYTE>( *p1 + *(p2++) );
+ *p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
// predict by using the left and the prior line pixels
while( p1 < pScanEnd )
@@ -1111,7 +1111,7 @@ void PNGReaderImpl::ImplApplyFilter()
if( npa > npc )
na = nc;
- *p1 = static_cast<BYTE>( *p1 + na );
+ *p1 = static_cast<sal_uInt8>( *p1 + na );
++p1;
}
}
@@ -1137,7 +1137,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
// => TODO; also do this for nX here instead of in the ImplSet*Pixel() methods
const sal_uInt32 nY = mnYpos >> mnPreviewShift;
- const BYTE* pTmp = mpInflateInBuf + 1;
+ const sal_uInt8* pTmp = mpInflateInBuf + 1;
if ( mpAcc->HasPalette() ) // alphachannel is not allowed by pictures including palette entries
{
switch ( mpAcc->GetBitCount() )
@@ -1148,12 +1148,12 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nShift = 0; nX < maOrigSize.Width(); nX += nXAdd )
{
- BYTE nCol;
+ sal_uInt8 nCol;
nShift = (nShift - 1) & 7;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<BYTE>( *pTmp >> nShift );
+ nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
nCol &= 1;
ImplSetAlphaPixel( nY, nX, nCol, mpTransTab[ nCol ] );
@@ -1165,11 +1165,11 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
nShift = (nShift - 1) & 7;
- BYTE nCol;
+ sal_uInt8 nCol;
if ( nShift == 0 )
nCol = *(pTmp++);
else
- nCol = static_cast<BYTE>( *pTmp >> nShift );
+ nCol = static_cast<sal_uInt8>( *pTmp >> nShift );
nCol &= 1;
ImplSetPixel( nY, nX, nCol );
@@ -1201,7 +1201,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
{
for ( sal_Int32 nX = nXStart, nXIndex = 0; nX < maOrigSize.Width(); nX += nXAdd, nXIndex++ )
{
- BYTE nCol;
+ sal_uInt8 nCol;
switch( nXIndex & 3 )
{
case 0 :
@@ -1323,7 +1323,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
break;
default :
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -1449,7 +1449,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColo
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, BYTE nPalIndex )
+void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIndex )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1461,7 +1461,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, BYTE nPalIndex )
// ------------------------------------------------------------------------
-void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, BOOL bTrans )
+void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, sal_Bool bTrans )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1479,7 +1479,7 @@ void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const Bitm
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- BYTE nPalIndex, BYTE nAlpha )
+ sal_uInt8 nPalIndex, sal_uInt8 nAlpha )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
@@ -1493,7 +1493,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
// ------------------------------------------------------------------------
void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX,
- const BitmapColor& rBitmapColor, BYTE nAlpha )
+ const BitmapColor& rBitmapColor, sal_uInt8 nAlpha )
{
// TODO: get preview mode checks out of inner loop
if( nX & mnPreviewMask )
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 6cacfe51aed2..b87457c35054 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -89,35 +89,35 @@ private:
sal_Int32 mnCompLevel;
sal_Int32 mnInterlaced;
sal_uInt32 mnMaxChunkSize;
- BOOL mbStatus;
+ sal_Bool mbStatus;
BitmapReadAccess* mpAccess;
BitmapReadAccess* mpMaskAccess;
ZCodec* mpZCodec;
- BYTE* mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
- BYTE* mpPreviousScan; // as big as mpDeflateInBuf
- BYTE* mpCurrentScan;
- ULONG mnDeflateInSize;
-
- ULONG mnWidth, mnHeight;
- BYTE mnBitsPerPixel;
- BYTE mnFilterType; // 0 oder 4;
- ULONG mnBBP; // bytes per pixel ( needed for filtering )
- BOOL mbTrueAlpha;
- ULONG mnCRC;
+ sal_uInt8* mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
+ sal_uInt8* mpPreviousScan; // as big as mpDeflateInBuf
+ sal_uInt8* mpCurrentScan;
+ sal_uLong mnDeflateInSize;
+
+ sal_uLong mnWidth, mnHeight;
+ sal_uInt8 mnBitsPerPixel;
+ sal_uInt8 mnFilterType; // 0 oder 4;
+ sal_uLong mnBBP; // bytes per pixel ( needed for filtering )
+ sal_Bool mbTrueAlpha;
+ sal_uLong mnCRC;
long mnChunkDatSize;
- ULONG mnLastPercent;
+ sal_uLong mnLastPercent;
void ImplWritepHYs( const BitmapEx& rBitmapEx );
void ImplWriteIDAT();
- ULONG ImplGetFilter( ULONG nY, ULONG nXStart=0, ULONG nXAdd=1 );
+ sal_uLong ImplGetFilter( sal_uLong nY, sal_uLong nXStart=0, sal_uLong nXAdd=1 );
void ImplClearFirstScanline();
void ImplWriteTransparent();
- BOOL ImplWriteHeader();
+ sal_Bool ImplWriteHeader();
void ImplWritePalette();
- void ImplOpenChunk( ULONG nChunkType );
- void ImplWriteChunk( BYTE nNumb );
+ void ImplOpenChunk( sal_uLong nChunkType );
+ void ImplWriteChunk( sal_uInt8 nNumb );
void ImplWriteChunk( sal_uInt32 nNumb );
void ImplWriteChunk( unsigned char* pSource, sal_uInt32 nDatSize );
void ImplCloseChunk( void ) const;
@@ -128,7 +128,7 @@ private:
PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData ) :
mnCompLevel ( PNG_DEF_COMPRESSION ),
- mbStatus ( TRUE ),
+ mbStatus ( sal_True ),
mpAccess ( NULL ),
mpMaskAccess ( NULL ),
mpZCodec ( new ZCodec( DEFAULT_IN_BUFSIZE, DEFAULT_OUT_BUFSIZE, MAX_MEM_USAGE ) ),
@@ -161,7 +161,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
}
}
}
- mnBitsPerPixel = (BYTE)aBmp.GetBitCount();
+ mnBitsPerPixel = (sal_uInt8)aBmp.GetBitCount();
if( rBmpEx.IsTransparent() )
{
@@ -189,14 +189,14 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
else
{
- mpAccess = aBmp.AcquireReadAccess(); // TRUE RGB with alphachannel
+ mpAccess = aBmp.AcquireReadAccess(); // sal_True RGB with alphachannel
if( mpAccess )
{
- if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != FALSE )
+ if ( ( mbTrueAlpha = rBmpEx.IsAlpha() ) != sal_False )
{
AlphaMask aMask( rBmpEx.GetAlpha() );
mpMaskAccess = aMask.AcquireReadAccess();
@@ -210,7 +210,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
else
{
@@ -226,12 +226,12 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aMask.ReleaseAccess( mpMaskAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
}
else
@@ -250,7 +250,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
aBmp.ReleaseAccess( mpAccess );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if ( mbStatus )
{
@@ -309,7 +309,7 @@ std::vector< vcl::PNGWriter::ChunkData >& PNGWriterImpl::GetChunks()
// ------------------------------------------------------------------------
-BOOL PNGWriterImpl::ImplWriteHeader()
+sal_Bool PNGWriterImpl::ImplWriteHeader()
{
ImplOpenChunk(PNGCHUNK_IHDR);
ImplWriteChunk( sal_uInt32( mnWidth = mpAccess->Width() ) );
@@ -317,13 +317,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
if ( mnWidth && mnHeight && mnBitsPerPixel && mbStatus )
{
- BYTE nBitDepth = mnBitsPerPixel;
+ sal_uInt8 nBitDepth = mnBitsPerPixel;
if ( mnBitsPerPixel <= 8 )
mnFilterType = 0;
else
mnFilterType = 4;
- BYTE nColorType = 2; // colortype:
+ sal_uInt8 nColorType = 2; // colortype:
// bit 0 -> palette is used
if ( mpAccess->HasPalette() ) // bit 1 -> color is used
nColorType |= 1; // bit 2 -> alpha channel is used
@@ -335,13 +335,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
ImplWriteChunk( nBitDepth );
ImplWriteChunk( nColorType ); // colortype
- ImplWriteChunk((BYTE) 0 ); // compression type
- ImplWriteChunk((BYTE) 0 ); // filter type - is not supported in this version
- ImplWriteChunk((BYTE) mnInterlaced ); // interlace type
+ ImplWriteChunk((sal_uInt8) 0 ); // compression type
+ ImplWriteChunk((sal_uInt8) 0 ); // filter type - is not supported in this version
+ ImplWriteChunk((sal_uInt8) mnInterlaced ); // interlace type
ImplCloseChunk();
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
@@ -349,13 +349,13 @@ BOOL PNGWriterImpl::ImplWriteHeader()
void PNGWriterImpl::ImplWritePalette()
{
- const ULONG nCount = mpAccess->GetPaletteEntryCount();
- BYTE* pTempBuf = new BYTE[ nCount*3 ];
- BYTE* pTmp = pTempBuf;
+ const sal_uLong nCount = mpAccess->GetPaletteEntryCount();
+ sal_uInt8* pTempBuf = new sal_uInt8[ nCount*3 ];
+ sal_uInt8* pTmp = pTempBuf;
ImplOpenChunk( PNGCHUNK_PLTE );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
const BitmapColor& rColor = mpAccess->GetPaletteColor( i );
*pTmp++ = rColor.GetRed();
@@ -371,12 +371,12 @@ void PNGWriterImpl::ImplWritePalette()
void PNGWriterImpl::ImplWriteTransparent ()
{
- const ULONG nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
+ const sal_uLong nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS );
ImplOpenChunk( PNGCHUNK_tRNS );
- for ( ULONG n = 0UL; n <= nTransIndex; n++ )
- ImplWriteChunk( ( nTransIndex == n ) ? (BYTE) 0x0 : (BYTE) 0xff );
+ for ( sal_uLong n = 0UL; n <= nTransIndex; n++ )
+ ImplWriteChunk( ( nTransIndex == n ) ? (sal_uInt8) 0x0 : (sal_uInt8) 0xff );
ImplCloseChunk();
}
@@ -415,12 +415,12 @@ void PNGWriterImpl::ImplWriteIDAT ()
mnDeflateInSize = mnBBP * mnWidth + 1;
- mpDeflateInBuf = new BYTE[ mnDeflateInSize ];
+ mpDeflateInBuf = new sal_uInt8[ mnDeflateInSize ];
if ( mnFilterType ) // using filter type 4 we need memory for the scanline 3 times
{
- mpPreviousScan = new BYTE[ mnDeflateInSize ];
- mpCurrentScan = new BYTE[ mnDeflateInSize ];
+ mpPreviousScan = new sal_uInt8[ mnDeflateInSize ];
+ mpCurrentScan = new sal_uInt8[ mnDeflateInSize ];
ImplClearFirstScanline();
}
mpZCodec->BeginCompression( ZCODEC_PNG_DEFAULT + mnCompLevel );
@@ -428,13 +428,13 @@ void PNGWriterImpl::ImplWriteIDAT ()
SvMemoryStream aOStm;
if ( mnInterlaced == 0 )
{
- for ( ULONG nY = 0; nY < mnHeight; nY++ )
+ for ( sal_uLong nY = 0; nY < mnHeight; nY++ )
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter( nY ) );
}
else
{
// interlace mode
- ULONG nY;
+ sal_uLong nY;
for ( nY = 0; nY < mnHeight; nY+=8 ) // pass 1
mpZCodec->Write( aOStm, mpDeflateInBuf, ImplGetFilter ( nY, 0, 8 ) );
ImplClearFirstScanline();
@@ -498,9 +498,9 @@ void PNGWriterImpl::ImplWriteIDAT ()
// appends to the currently used pass
// the complete size of scanline will be returned - in interlace mode zero is possible!
-ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
+sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uLong nXAdd )
{
- BYTE* pDest;
+ sal_uInt8* pDest;
if ( mnFilterType )
pDest = mpCurrentScan;
@@ -517,16 +517,16 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
case( 1 ):
{
- ULONG nX, nXIndex;
+ sal_uLong nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+=nXAdd, nXIndex++ )
{
- ULONG nShift = ( nXIndex & 7 ) ^ 7;
+ sal_uLong nShift = ( nXIndex & 7 ) ^ 7;
if ( nShift == 7)
- *pDest = (BYTE)(mpAccess->GetPixel( nY, nX ) << nShift);
+ *pDest = (sal_uInt8)(mpAccess->GetPixel( nY, nX ) << nShift);
else if ( nShift == 0 )
- *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
else
- *pDest |= (BYTE) mpAccess->GetPixel( nY, nX ) << nShift;
+ *pDest |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift;
}
if ( ( nXIndex & 7 ) != 0 ) pDest++; // byte is not completely used, so the
} // bufferpointer is to correct
@@ -534,13 +534,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
case( 4 ):
{
- ULONG nX, nXIndex;
+ sal_uLong nX, nXIndex;
for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+= nXAdd, nXIndex++ )
{
if( nXIndex & 1 )
- *pDest++ |= (BYTE) mpAccess->GetPixel( nY, nX );
+ *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX );
else
- *pDest = (BYTE) mpAccess->GetPixel( nY, nX ) << 4;
+ *pDest = (sal_uInt8) mpAccess->GetPixel( nY, nX ) << 4;
}
if ( nXIndex & 1 ) pDest++;
}
@@ -548,13 +548,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
case( 8 ):
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
*pDest++ = mpAccess->GetPixel( nY, nX );
}
break;
default :
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -564,7 +564,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
if ( mbTrueAlpha )
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX += nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -577,7 +577,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
{
const BitmapColor aTrans( mpMaskAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -593,7 +593,7 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
}
else
{
- for ( ULONG nX = nXStart; nX < mnWidth; nX+=nXAdd )
+ for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd )
{
const BitmapColor& rColor = mpAccess->GetPixel( nY, nX );
*pDest++ = rColor.GetRed();
@@ -610,13 +610,13 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
pDest = mpDeflateInBuf;
*pDest++ = 4; // filter type
- ULONG na, nb, nc;
+ sal_uLong na, nb, nc;
long np, npa, npb, npc;
- BYTE* p1 = mpCurrentScan + 1; // Current Pixel
- BYTE* p2 = p1 - mnBBP; // left pixel
- BYTE* p3 = mpPreviousScan; // upper pixel
- BYTE* p4 = p3 - mnBBP; // upperleft Pixel;
+ sal_uInt8* p1 = mpCurrentScan + 1; // Current Pixel
+ sal_uInt8* p2 = p1 - mnBBP; // left pixel
+ sal_uInt8* p3 = mpPreviousScan; // upper pixel
+ sal_uInt8* p4 = p3 - mnBBP; // upperleft Pixel;
while ( pDest < mpDeflateInBuf + mnDeflateInSize )
{
@@ -640,9 +640,9 @@ ULONG PNGWriterImpl::ImplGetFilter ( ULONG nY, ULONG nXStart, ULONG nXAdd )
npb =-npb;
if ( npc < 0 )
npc =-npc;
- if ( ( npa <= npb ) && ( npa <= npc ) ) *pDest++ = *p1++ - (BYTE)na;
- else if ( npb <= npc ) *pDest++ = *p1++ - (BYTE)nb;
- else *pDest++ = *p1++ - (BYTE)nc;
+ if ( ( npa <= npb ) && ( npa <= npc ) ) *pDest++ = *p1++ - (sal_uInt8)na;
+ else if ( npb <= npc ) *pDest++ = *p1++ - (sal_uInt8)nb;
+ else *pDest++ = *p1++ - (sal_uInt8)nc;
p4++;
p2++;
}
@@ -664,7 +664,7 @@ void PNGWriterImpl::ImplClearFirstScanline()
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplOpenChunk ( ULONG nChunkType )
+void PNGWriterImpl::ImplOpenChunk ( sal_uLong nChunkType )
{
maChunkSeq.resize( maChunkSeq.size() + 1 );
maChunkSeq.back().nType = nChunkType;
@@ -672,7 +672,7 @@ void PNGWriterImpl::ImplOpenChunk ( ULONG nChunkType )
// ------------------------------------------------------------------------
-void PNGWriterImpl::ImplWriteChunk ( BYTE nSource )
+void PNGWriterImpl::ImplWriteChunk ( sal_uInt8 nSource )
{
maChunkSeq.back().aData.push_back( nSource );
}
diff --git a/vcl/source/gdi/polyscan.cxx b/vcl/source/gdi/polyscan.cxx
index b96591b6aa40..81d05bf33354 100644
--- a/vcl/source/gdi/polyscan.cxx
+++ b/vcl/source/gdi/polyscan.cxx
@@ -122,9 +122,9 @@ void PolyScanline::Set( long nStart, long nEnd )
// ------------------------------------------------------------------------
-BOOL PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
+sal_Bool PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
{
- BOOL bRet = GetFirstX( rSegment.mnStart );
+ sal_Bool bRet = GetFirstX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -134,9 +134,9 @@ BOOL PolyScanline::GetFirstSegment( PolyScanSegment& rSegment )
// ------------------------------------------------------------------------
-BOOL PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
+sal_Bool PolyScanline::GetNextSegment( PolyScanSegment& rSegment )
{
- BOOL bRet = GetNextX( rSegment.mnStart );
+ sal_Bool bRet = GetNextX( rSegment.mnStart );
if( bRet && !GetNextX( rSegment.mnEnd ) )
rSegment.mnEnd = rSegment.mnStart;
@@ -153,7 +153,7 @@ PolyScanner::PolyScanner( const Rectangle& rRect )
if( !rRect.IsEmpty() )
{
Rectangle aRect( rRect );
- ULONG nHeight;
+ sal_uLong nHeight;
aRect.Justify();
mnLeft = aRect.Left();
@@ -162,7 +162,7 @@ PolyScanner::PolyScanner( const Rectangle& rRect )
mnBottom = aRect.Bottom();
mpArray = new PolyScanline[ nHeight = Height() ];
- for( ULONG i = 0UL; i < nHeight; i++ )
+ for( sal_uLong i = 0UL; i < nHeight; i++ )
mpArray[ i ].Set( mnLeft, mnRight );
}
else
@@ -182,10 +182,10 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
{
long nLast = nCount - 1;
Point aFirst( rPoly[ 0 ] );
- Point aLast( rPoly[ (USHORT) nLast ] );
+ Point aLast( rPoly[ (sal_uInt16) nLast ] );
while( nLast && ( aLast == aFirst ) )
- aLast = rPoly[ (USHORT) --nLast ];
+ aLast = rPoly[ (sal_uInt16) --nLast ];
if( !nLast )
{
@@ -198,7 +198,7 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
else
{
const Rectangle aRect( rPoly.GetBoundRect() );
- ULONG nHeight;
+ sal_uLong nHeight;
mnLeft = aRect.Left();
mnTop = aRect.Top();
@@ -209,7 +209,7 @@ PolyScanner::PolyScanner( const Polygon& rPoly )
for( long i = 1L; i <= nLast; i++ )
{
- const Point& rPt = rPoly[ (USHORT) i ];
+ const Point& rPt = rPoly[ (sal_uInt16) i ];
if( rPt != aLast )
{
@@ -241,7 +241,7 @@ PolyScanner::~PolyScanner()
// ------------------------------------------------------------------------
-PolyScanline* PolyScanner::operator[]( ULONG nPos ) const
+PolyScanline* PolyScanner::operator[]( sal_uLong nPos ) const
{
DBG_ASSERT( nPos < Count(), "nPos out of range!" );
return( mpArray ? ( mpArray + nPos ) : NULL );
@@ -282,7 +282,7 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
const long nYInc = ( nStartY < nEndY ) ? 1L : -1L;
long nLastX = nStartX;
long nLastY = nStartY;
- BOOL bLast = FALSE;
+ sal_Bool bLast = sal_False;
mpArray[ nStartY - mnTop ].Insert( nStartX );
@@ -300,10 +300,10 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = FALSE;
+ bLast = sal_False;
}
else
- bLast = TRUE;
+ bLast = sal_True;
nLastX = nX;
nLastY = nY;
@@ -333,10 +333,10 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
mpArray[ nY - mnTop ].Insert( nX );
- bLast = FALSE;
+ bLast = sal_False;
}
else
- bLast = TRUE;
+ bLast = sal_True;
nLastX = nX;
nLastY = nY;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 774673de0a04..15964d9da09f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -40,6 +40,7 @@
#include <vcl/unohelp.hxx>
#include <tools/debug.hxx>
+#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <vcl/svdata.hxx>
@@ -53,11 +54,18 @@
#include <vcl/gdimtf.hxx>
#include <vcl/metaact.hxx>
#include <vcl/print.hxx>
+#include <vcl/svids.hrc>
#include <comphelper/processfactory.hxx>
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::container;
int nImplSysDialog = 0;
@@ -110,16 +118,16 @@ void ImplUpdateJobSetupPaper( JobSetup& rJobSetup )
// ------------------
PrinterOptions::PrinterOptions() :
- mbReduceTransparency( FALSE ),
+ mbReduceTransparency( sal_False ),
meReducedTransparencyMode( PRINTER_TRANSPARENCY_AUTO ),
- mbReduceGradients( FALSE ),
+ mbReduceGradients( sal_False ),
meReducedGradientsMode( PRINTER_GRADIENT_STRIPES ),
mnReducedGradientStepCount( 64 ),
- mbReduceBitmaps( FALSE ),
+ mbReduceBitmaps( sal_False ),
meReducedBitmapMode( PRINTER_BITMAP_NORMAL ),
mnReducedBitmapResolution( 200 ),
- mbReducedBitmapsIncludeTransparency( TRUE ),
- mbConvertToGreyscales( FALSE )
+ mbReducedBitmapsIncludeTransparency( sal_True ),
+ mbConvertToGreyscales( sal_False )
{
}
@@ -129,6 +137,105 @@ PrinterOptions::~PrinterOptions()
{
}
+#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceTransparency"))
+#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedTransparencyMode"))
+#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceGradients"))
+#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientMode"))
+#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedGradientStepCount"))
+#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReduceBitmaps"))
+#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapMode"))
+#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution"))
+#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency"))
+#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales"))
+
+bool PrinterOptions::ReadFromConfig( bool i_bFile )
+{
+ bool bSuccess = false;
+ // save old state in case something goes wrong
+ PrinterOptions aOldValues( *this );
+
+ // get the configuration service
+ Reference< XMultiServiceFactory > xConfigProvider;
+ Reference< XNameAccess > xConfigAccess;
+ try
+ {
+ // get service provider
+ Reference< XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() );
+ // create configuration hierachical access name
+ if( xSMgr.is() )
+ {
+ try
+ {
+ xConfigProvider = Reference< XMultiServiceFactory >(
+ xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider" ))),
+ UNO_QUERY );
+ if( xConfigProvider.is() )
+ {
+ Sequence< Any > aArgs(1);
+ PropertyValue aVal;
+ aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
+ if( i_bFile )
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/File" ) );
+ else
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Print/Option/Printer" ) );
+ aArgs.getArray()[0] <<= aVal;
+ xConfigAccess = Reference< XNameAccess >(
+ xConfigProvider->createInstanceWithArguments(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )), aArgs ),
+ UNO_QUERY );
+ if( xConfigAccess.is() )
+ {
+ Reference< XPropertySet > xSet( xConfigAccess, UNO_QUERY );
+ if( xSet.is() )
+ {
+ sal_Int32 nValue = 0;
+ sal_Bool bValue = 0;
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bValue )
+ SetReduceTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nValue )
+ SetReducedTransparencyMode( (PrinterTransparencyMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bValue )
+ SetReduceGradients( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nValue )
+ SetReducedGradientMode( (PrinterGradientMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nValue )
+ SetReducedGradientStepCount( (sal_uInt16)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bValue )
+ SetReduceBitmaps( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nValue )
+ SetReducedBitmapMode( (PrinterBitmapMode)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nValue )
+ SetReducedBitmapResolution( (sal_uInt16)nValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bValue )
+ SetReducedBitmapIncludesTransparency( bValue );
+ if( xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bValue )
+ SetConvertToGreyscales( bValue );
+
+ bSuccess = true;
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+
+ if( ! bSuccess )
+ *this = aOldValues;
+ return bSuccess;
+}
+
+void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions )
+{
+ *mpPrinterOptions = i_rOptions;
+}
+
// -------------
// - QueueInfo -
// -------------
@@ -348,24 +455,24 @@ XubString Printer::GetDefaultPrinterName()
void Printer::ImplInitData()
{
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
meOutDevType = OUTDEV_PRINTER;
- mbDefPrinter = FALSE;
+ mbDefPrinter = sal_False;
mnError = 0;
mnCurPage = 0;
mnCurPrintPage = 0;
mnPageQueueSize = 0;
mnCopyCount = 1;
- mbCollateCopy = FALSE;
- mbPrinting = FALSE;
- mbJobActive = FALSE;
- mbPrintFile = FALSE;
- mbInPrintPage = FALSE;
- mbNewJobSetup = FALSE;
+ mbCollateCopy = sal_False;
+ mbPrinting = sal_False;
+ mbJobActive = sal_False;
+ mbPrintFile = sal_False;
+ mbInPrintPage = sal_False;
+ mbNewJobSetup = sal_False;
mpInfoPrinter = NULL;
mpPrinter = NULL;
mpDisplayDev = NULL;
- mbIsQueuePrinter = FALSE;
+ mbIsQueuePrinter = sal_False;
mpPrinterOptions = new PrinterOptions;
// Printer in die Liste eintragen
@@ -430,7 +537,7 @@ void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
// Daten initialisieren
ImplUpdatePageData();
mpFontList = new ImplDevFontList();
- mpFontCache = new ImplFontCache( TRUE );
+ mpFontCache = new ImplFontCache( sal_True );
mpGraphics->GetDevFontList( mpFontList );
}
@@ -539,7 +646,7 @@ void Printer::ImplUpdatePageData()
void Printer::ImplUpdateFontList()
{
- ImplUpdateFontData( TRUE );
+ ImplUpdateFontData( sal_True );
}
// -----------------------------------------------------------------------
@@ -552,7 +659,7 @@ Printer::Printer()
{
ImplInit( pInfo );
if ( !IsDisplayPrinter() )
- mbDefPrinter = TRUE;
+ mbDefPrinter = sal_True;
}
else
ImplInitDisplay( NULL );
@@ -670,57 +777,57 @@ void Printer::Compat_OldPrinterMetrics( bool bSet )
mpInfoPrinter->m_bCompatMetrics = bSet;
// get new font data
- ImplUpdateFontData( TRUE );
+ ImplUpdateFontData( sal_True );
}
// -----------------------------------------------------------------------
-ULONG Printer::GetCapabilities( USHORT nType ) const
+sal_uLong Printer::GetCapabilities( sal_uInt16 nType ) const
{
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if( mpInfoPrinter )
return mpInfoPrinter->GetCapabilities( maJobSetup.ImplGetConstData(), nType );
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::HasSupport( PrinterSupport eFeature ) const
+sal_Bool Printer::HasSupport( PrinterSupport eFeature ) const
{
switch ( eFeature )
{
case SUPPORT_SET_ORIENTATION:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETORIENTATION );
case SUPPORT_SET_PAPERBIN:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERBIN );
case SUPPORT_SET_PAPERSIZE:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPERSIZE );
case SUPPORT_SET_PAPER:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SETPAPER );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SETPAPER );
case SUPPORT_COPY:
return (GetCapabilities( PRINTER_CAPABILITIES_COPIES ) != 0);
case SUPPORT_COLLATECOPY:
return (GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES ) != 0);
case SUPPORT_SETUPDIALOG:
- return (BOOL)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
+ return (sal_Bool)GetCapabilities( PRINTER_CAPABILITIES_SUPPORTDIALOG );
case SUPPORT_FAX:
- return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_FAX );
+ return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_FAX );
case SUPPORT_PDF:
- return (BOOL) GetCapabilities( PRINTER_CAPABILITIES_PDF );
+ return (sal_Bool) GetCapabilities( PRINTER_CAPABILITIES_PDF );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetJobSetup( const JobSetup& rSetup )
+sal_Bool Printer::SetJobSetup( const JobSetup& rSetup )
{
if ( IsDisplayPrinter() || mbInPrintPage )
- return FALSE;
+ return sal_False;
JobSetup aJobSetup = rSetup;
@@ -728,60 +835,60 @@ BOOL Printer::SetJobSetup( const JobSetup& rSetup )
if ( mpInfoPrinter->SetPrinterData( aJobSetup.ImplGetData() ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::Setup( Window* pWindow )
+sal_Bool Printer::Setup( Window* pWindow )
{
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
JobSetup aJobSetup = maJobSetup;
SalFrame* pFrame;
if ( !pWindow )
pWindow = ImplGetDefaultWindow();
if( !pWindow )
- return FALSE;
+ return sal_False;
pFrame = pWindow->ImplGetFrame();
ImplReleaseGraphics();
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mnModalMode++;
nImplSysDialog++;
- BOOL bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
+ sal_Bool bSetup = mpInfoPrinter->Setup( pFrame, aJobSetup.ImplGetData() );
pSVData->maAppData.mnModalMode--;
nImplSysDialog--;
if ( bSetup )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetPrinterProps( const Printer* pPrinter )
+sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
{
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
ImplSVData* pSVData = ImplGetSVData();
@@ -821,14 +928,14 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
mpInfoPrinter = NULL;
}
// Neuen Printer bauen
ImplInitDisplay( NULL );
- return TRUE;
+ return sal_True;
}
// Alten Printer zerstoeren?
@@ -863,8 +970,8 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
delete mpFontList;
mpFontCache = NULL;
mpFontList = NULL;
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
mpInfoPrinter = NULL;
}
@@ -882,15 +989,15 @@ BOOL Printer::SetPrinterProps( const Printer* pPrinter )
else
SetJobSetup( pPrinter->GetJobSetup() );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetOrientation( Orientation eOrientation )
+sal_Bool Printer::SetOrientation( Orientation eOrientation )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->meOrientation != eOrientation )
{
@@ -900,26 +1007,26 @@ BOOL Printer::SetOrientation( Orientation eOrientation )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -931,10 +1038,10 @@ Orientation Printer::GetOrientation() const
// -----------------------------------------------------------------------
-BOOL Printer::SetPaperBin( USHORT nPaperBin )
+sal_Bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( (maJobSetup.ImplGetConstData()->mnPaperBin != nPaperBin) &&
(nPaperBin < GetPaperBinCount()) )
@@ -945,31 +1052,31 @@ BOOL Printer::SetPaperBin( USHORT nPaperBin )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERBIN, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT Printer::GetPaperBin() const
+sal_uInt16 Printer::GetPaperBin() const
{
return maJobSetup.ImplGetConstData()->mnPaperBin;
}
@@ -1067,10 +1174,10 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
// -----------------------------------------------------------------------
-BOOL Printer::SetPaper( Paper ePaper )
+sal_Bool Printer::SetPaper( Paper ePaper )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->mePaperFormat != ePaper )
{
@@ -1086,9 +1193,9 @@ BOOL Printer::SetPaper( Paper ePaper )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
@@ -1097,30 +1204,30 @@ BOOL Printer::SetPaper( Paper ePaper )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Printer::SetPaperSizeUser( const Size& rSize )
+sal_Bool Printer::SetPaperSizeUser( const Size& rSize )
{
return SetPaperSizeUser( rSize, false );
}
-BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
+sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
Size aPixSize = LogicToPixel( rSize );
Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
@@ -1136,9 +1243,9 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
@@ -1148,17 +1255,17 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1174,6 +1281,48 @@ int Printer::GetPaperInfoCount() const
// -----------------------------------------------------------------------
+rtl::OUString Printer::GetPaperName( Paper ePaper )
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->mpPaperNames )
+ {
+ pSVData->mpPaperNames = new boost::unordered_map< int, rtl::OUString >();
+ if( ImplGetResMgr() )
+ {
+ ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
+ static const int PaperIndex[] =
+ {
+ PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5,
+ PAPER_B4_ISO, PAPER_B5_ISO, PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID,
+ PAPER_USER, PAPER_B6_ISO, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65,
+ PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN, PAPER_C, PAPER_D, PAPER_E,
+ PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL,
+ PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_KAI16,
+ PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, PAPER_B6_JIS
+ };
+ OSL_ENSURE( sal_uInt32(sizeof(PaperIndex)/sizeof(PaperIndex[0])) == aPaperStrings.Count(), "localized paper name count wrong" );
+ for( int i = 0; i < int(sizeof(PaperIndex)/sizeof(PaperIndex[0])); i++ )
+ (*pSVData->mpPaperNames)[PaperIndex[i]] = aPaperStrings.GetString(i);
+ }
+ }
+
+ boost::unordered_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
+ return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
+rtl::OUString Printer::GetPaperName( bool i_bPaperUser ) const
+{
+ Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
+ Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );
+ if( ePaper == PAPER_USER )
+ ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() );
+ return (ePaper != PAPER_USER || i_bPaperUser ) ? GetPaperName( ePaper ) : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
{
if( ! mpInfoPrinter )
@@ -1194,10 +1343,10 @@ DuplexMode Printer::GetDuplexMode() const
// -----------------------------------------------------------------------
-BOOL Printer::SetDuplexMode( DuplexMode eDuplex )
+sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex )
{
if ( mbInPrintPage )
- return FALSE;
+ return sal_False;
if ( maJobSetup.ImplGetConstData()->meDuplexMode != eDuplex )
{
@@ -1207,26 +1356,26 @@ BOOL Printer::SetDuplexMode( DuplexMode eDuplex )
if ( IsDisplayPrinter() )
{
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
- return TRUE;
+ return sal_True;
}
ImplReleaseGraphics();
if ( mpInfoPrinter->SetData( SAL_JOBSET_DUPLEXMODE, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
- mbNewJobSetup = TRUE;
+ mbNewJobSetup = sal_True;
maJobSetup = aJobSetup;
ImplUpdatePageData();
ImplUpdateFontList();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1245,17 +1394,17 @@ Paper Printer::GetPaper() const
// -----------------------------------------------------------------------
-USHORT Printer::GetPaperBinCount() const
+sal_uInt16 Printer::GetPaperBinCount() const
{
if ( IsDisplayPrinter() )
return 0;
- return (USHORT)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
+ return (sal_uInt16)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
}
// -----------------------------------------------------------------------
-XubString Printer::GetPaperBinName( USHORT nPaperBin ) const
+XubString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
{
if ( IsDisplayPrinter() )
return ImplGetSVEmptyStr();
@@ -1268,11 +1417,11 @@ XubString Printer::GetPaperBinName( USHORT nPaperBin ) const
// -----------------------------------------------------------------------
-BOOL Printer::SetCopyCount( USHORT nCopy, BOOL bCollate )
+sal_Bool Printer::SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate )
{
mnCopyCount = nCopy;
mbCollateCopy = bCollate;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1285,9 +1434,9 @@ void Printer::Error()
// -----------------------------------------------------------------------
-ULONG Printer::ImplSalPrinterErrorCodeToVCL( ULONG nError )
+sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
{
- ULONG nVCLError;
+ sal_uLong nVCLError;
switch ( nError )
{
case 0:
@@ -1308,7 +1457,7 @@ ULONG Printer::ImplSalPrinterErrorCodeToVCL( ULONG nError )
void Printer::ImplEndPrint()
{
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPrintPage = 0;
maJobName.Erase();
}
@@ -1325,15 +1474,15 @@ IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter )
// -----------------------------------------------------------------------
-BOOL Printer::EndJob()
+sal_Bool Printer::EndJob()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( !IsJobActive() )
return bRet;
DBG_ASSERT( !mbInPrintPage, "Printer::EndJob() - StartPage() without EndPage() called" );
- mbJobActive = FALSE;
+ mbJobActive = sal_False;
if ( mpPrinter )
{
@@ -1341,13 +1490,13 @@ BOOL Printer::EndJob()
mnCurPage = 0;
- bRet = TRUE;
+ bRet = sal_True;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPrintPage = 0;
maJobName.Erase();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
bRet = mpPrinter->EndJob();
// Hier den Drucker nicht asyncron zerstoeren, da es
// W95 nicht verkraftet, wenn gleichzeitig gedruckt wird
@@ -1361,34 +1510,34 @@ BOOL Printer::EndJob()
// -----------------------------------------------------------------------
-BOOL Printer::AbortJob()
+sal_Bool Printer::AbortJob()
{
// Wenn wir einen Queue-Printer haben, kann man diesen noch mit
// AbortJob() abbrechen, solange dieser noch am Drucken ist
if ( !IsJobActive() && !IsPrinting() )
- return FALSE;
+ return sal_False;
- mbJobActive = FALSE;
- mbInPrintPage = FALSE;
+ mbJobActive = sal_False;
+ mbInPrintPage = sal_False;
mpJobGraphics = NULL;
if ( mpPrinter )
{
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mnCurPage = 0;
mnCurPrintPage = 0;
maJobName.Erase();
ImplReleaseGraphics();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
mpPrinter->AbortJob();
Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter );
mpPrinter = NULL;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1406,12 +1555,12 @@ void Printer::ImplStartPage()
ImplReleaseGraphics();
mpJobGraphics = pGraphics;
}
- mbDevOutput = TRUE;
+ mbDevOutput = sal_True;
// PrintJob not aborted ???
if ( IsJobActive() )
{
- mbInPrintPage = TRUE;
+ mbInPrintPage = sal_True;
mnCurPage++;
mnCurPrintPage++;
}
@@ -1425,16 +1574,16 @@ void Printer::ImplEndPage()
if ( !IsJobActive() )
return;
- mbInPrintPage = FALSE;
+ mbInPrintPage = sal_False;
if ( mpPrinter )
{
mpPrinter->EndPage();
ImplReleaseGraphics();
- mbDevOutput = FALSE;
+ mbDevOutput = sal_False;
mpJobGraphics = NULL;
- mbNewJobSetup = FALSE;
+ mbNewJobSetup = sal_False;
}
}
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index c8be71b70a45..38c589eb12b2 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -155,7 +155,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
if( rAct.GetType() == META_TRANSPARENT_ACTION )
{
const MetaTransparentAction* pTransAct = static_cast<const MetaTransparentAction*>(&rAct);
- USHORT nTransparency( pTransAct->GetTransparence() );
+ sal_uInt16 nTransparency( pTransAct->GetTransparence() );
// #i10613# Respect transparency for draw color
if( nTransparency )
@@ -164,16 +164,16 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
// assume white background for alpha blending
Color aLineColor( rStateOutDev.GetLineColor() );
- aLineColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
- aLineColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
- aLineColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
- o_rMtf.AddAction( new MetaLineColorAction(aLineColor, TRUE) );
+ aLineColor.SetRed( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
+ aLineColor.SetGreen( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
+ aLineColor.SetBlue( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
+ o_rMtf.AddAction( new MetaLineColorAction(aLineColor, sal_True) );
Color aFillColor( rStateOutDev.GetFillColor() );
- aFillColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
- aFillColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
- aFillColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
- o_rMtf.AddAction( new MetaFillColorAction(aFillColor, TRUE) );
+ aFillColor.SetRed( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
+ aFillColor.SetGreen( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
+ aFillColor.SetBlue( static_cast<sal_uInt8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
+ o_rMtf.AddAction( new MetaFillColorAction(aFillColor, sal_True) );
}
o_rMtf.AddAction( new MetaPolyPolygonAction(pTransAct->GetPolyPolygon()) );
@@ -405,9 +405,21 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_LINE_ACTION:
- aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(),
- static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
+ {
+ const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
+ aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() );
+ aActionBounds.Justify();
+ const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_RECT_ACTION:
aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
@@ -447,8 +459,20 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_POLYLINE_ACTION:
- aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
+ {
+ const MetaPolyLineAction& rMetaPolyLineAction = static_cast<const MetaPolyLineAction&>(rAct);
+ aActionBounds = rMetaPolyLineAction.GetPolygon().GetBoundRect();
+ const long nLineWidth(rMetaPolyLineAction.GetLineInfo().GetWidth());
+ if(nLineWidth)
+ {
+ const long nHalfLineWidth((nLineWidth + 1) / 2);
+ aActionBounds.Left() -= nHalfLineWidth;
+ aActionBounds.Top() -= nHalfLineWidth;
+ aActionBounds.Right() += nHalfLineWidth;
+ aActionBounds.Bottom() += nHalfLineWidth;
+ }
break;
+ }
case META_POLYGON_ACTION:
aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();
@@ -724,7 +748,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
VirtualDevice aMapModeVDev;
aMapModeVDev.mnDPIX = mnDPIX;
aMapModeVDev.mnDPIY = mnDPIY;
- aMapModeVDev.EnableOutput(FALSE);
+ aMapModeVDev.EnableOutput(sal_False);
int nLastBgAction, nActionNum;
@@ -832,13 +856,12 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
++nActionNum;
}
- ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
+ // clean up aMapModeVDev
+ sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
- // create an OutputDevice to record mapmode changes and the like
- VirtualDevice aMapModeVDev2;
- aMapModeVDev2.mnDPIX = mnDPIX;
- aMapModeVDev2.mnDPIY = mnDPIY;
- aMapModeVDev2.EnableOutput(FALSE);
+ ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
// fast-forward until one after the last background action
// (need to reconstruct map mode vdev state)
@@ -853,7 +876,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct, nActionNum) );
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction();
++nActionNum;
}
@@ -870,10 +893,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
// cache bounds of current action
- const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev2) );
+ const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) );
// accumulate collected bounds here, initialize with current action
Rectangle aTotalBounds( aBBCurrAct ); // thus,
@@ -902,7 +925,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// not be considered for connected components,
// too. Just put each of them into a separate
// component.
- aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev2);
+ aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev);
if( !aBBCurrAct.IsEmpty() &&
!aTotalComponents.bIsFullyTransparent )
@@ -1170,7 +1193,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Size aDstSzPix;
VirtualDevice aMapVDev; // here, we record only mapmode information
- aMapVDev.EnableOutput(FALSE);
+ aMapVDev.EnableOutput(sal_False);
VirtualDevice aPaintVDev; // into this one, we render.
@@ -1201,7 +1224,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
aMapVDev.mnDPIX = aPaintVDev.mnDPIX = mnDPIX;
aMapVDev.mnDPIY = aPaintVDev.mnDPIY = mnDPIY;
- aPaintVDev.EnableOutput(FALSE);
+ aPaintVDev.EnableOutput(sal_False);
// iterate over all actions
for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
@@ -1213,10 +1236,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// the current aCCList element
// (aCurr)
if( aCCList_MemberMap[nActionNum] == &(*aCurr) )
- aPaintVDev.EnableOutput(TRUE);
+ aPaintVDev.EnableOutput(sal_True);
// but process every action
- const USHORT nType( pCurrAct->GetType() );
+ const sal_uInt16 nType( pCurrAct->GetType() );
if( META_MAPMODE_ACTION == nType )
{
@@ -1251,8 +1274,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Application::Reschedule();
}
- const BOOL bOldMap = mbMap;
- mbMap = aPaintVDev.mbMap = FALSE;
+ const sal_Bool bOldMap = mbMap;
+ mbMap = aPaintVDev.mbMap = sal_False;
Bitmap aBandBmp( aPaintVDev.GetBitmap( Point(), aDstSzPix ) );
@@ -1268,7 +1291,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( new MetaBmpScaleAction( aDstPtPix, aDstSzPix, aBandBmp ) );
rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_END" ) );
- aPaintVDev.mbMap = TRUE;
+ aPaintVDev.mbMap = sal_True;
mbMap = bOldMap;
aMapVDev.Pop();
aPaintVDev.Pop();
@@ -1288,18 +1311,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
}
}
+ // clean up aMapModeVDev
+ nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
+
//
// STAGE 4: Copy actions to output metafile
// ========================================
//
- // create an OutputDevice to record color settings, mapmode
- // changes and the like
- VirtualDevice aMapModeVDev3;
- aMapModeVDev3.mnDPIX = mnDPIX;
- aMapModeVDev3.mnDPIY = mnDPIY;
- aMapModeVDev3.EnableOutput(FALSE);
-
// iterate over all actions and duplicate the ones not in a
// special aCCList member into rOutMtf
for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
@@ -1327,7 +1348,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// given background color
ImplConvertTransparentAction(rOutMtf,
*pCurrAct,
- aMapModeVDev3,
+ aMapModeVDev,
aBackgroundComponent.aBgColor);
}
else
@@ -1336,7 +1357,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) );
}
- pCurrAct->Execute(&aMapModeVDev3);
+ pCurrAct->Execute(&aMapModeVDev);
}
}
@@ -1514,7 +1535,7 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const
( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L +
( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pOut->SetLineColor( aColor );
@@ -1557,7 +1578,7 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly,
( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L +
( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1;
- const Color aColor( (BYTE) nR, (BYTE) nG, (BYTE) nB );
+ const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB );
pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pOut->SetLineColor( aColor );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index a96804f5448f..c277d16305e7 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -146,6 +146,7 @@ public:
typedef boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
typedef boost::unordered_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+ typedef boost::unordered_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap;
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
@@ -154,6 +155,7 @@ public:
PropertyToIndexMap maPropertyToIndex;
Link maOptionChangeHdl;
ControlDependencyMap maControlDependencies;
+ ChoiceDisableMap maChoiceDisableMap;
sal_Bool mbFirstPage;
sal_Bool mbLastPage;
sal_Bool mbReversePageOrder;
@@ -182,17 +184,17 @@ public:
{}
~ImplPrinterControllerData() { delete mpProgress; }
- Size getRealPaperSize( const Size& i_rPageSize ) const
+ Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
{
if( maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0 )
return maFixedPageSize;
- if( maMultiPage.nRows * maMultiPage.nColumns > 1 )
+ if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP )
return maMultiPage.aPaperSize;
return i_rPageSize;
}
bool isFixedPageSize() const
{ return maFixedPageSize.Width() != 0 && maFixedPageSize.Height() != 0; }
- PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps );
+ PrinterController::PageSize modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP );
};
PrinterController::PrinterController()
@@ -484,18 +486,18 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
mnError = PRINTER_OK;
if ( IsDisplayPrinter() )
- return FALSE;
+ return sal_False;
if ( IsJobActive() || IsPrinting() )
- return FALSE;
+ return sal_False;
- ULONG nCopies = mnCopyCount;
+ sal_uLong nCopies = mnCopyCount;
bool bCollateCopy = mbCollateCopy;
- bool bUserCopy = FALSE;
+ bool bUserCopy = sal_False;
if ( nCopies > 1 )
{
- ULONG nDevCopy;
+ sal_uLong nDevCopy;
if ( bCollateCopy )
nDevCopy = GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES );
@@ -505,20 +507,20 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
// need to do copies by hand ?
if ( nCopies > nDevCopy )
{
- bUserCopy = TRUE;
+ bUserCopy = sal_True;
nCopies = 1;
- bCollateCopy = FALSE;
+ bCollateCopy = sal_False;
}
}
else
- bCollateCopy = FALSE;
+ bCollateCopy = sal_False;
ImplSVData* pSVData = ImplGetSVData();
mpPrinter = pSVData->mpDefInst->CreatePrinter( mpInfoPrinter );
if ( !mpPrinter )
- return FALSE;
+ return sal_False;
sal_Bool bSinglePrintJobs = sal_False;
beans::PropertyValue* pSingleValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
@@ -527,10 +529,6 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSingleValue->Value >>= bSinglePrintJobs;
}
- // remark: currently it is still possible to use EnablePrintFile and
- // SetPrintFileName to redirect printout into file
- // it can be argued that those methods should be removed in favor
- // of only using the LocalFileName property
beans::PropertyValue* pFileValue = i_pController->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalFileName" ) ) );
if( pFileValue )
{
@@ -538,7 +536,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pFileValue->Value >>= aFile;
if( aFile.getLength() )
{
- mbPrintFile = TRUE;
+ mbPrintFile = sal_True;
maPrintFile = aFile;
bSinglePrintJobs = sal_False;
}
@@ -547,14 +545,15 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
XubString* pPrintFile = NULL;
if ( mbPrintFile )
pPrintFile = &maPrintFile;
+ mpPrinterOptions->ReadFromConfig( mbPrintFile );
maJobName = i_rJobName;
mnCurPage = 1;
mnCurPrintPage = 1;
- mbPrinting = TRUE;
- if( ImplGetSVData()->maGDIData.mbPrinterPullModel )
+ mbPrinting = sal_True;
+ if( GetCapabilities( PRINTER_CAPABILITIES_USEPULLMODEL ) )
{
- mbJobActive = TRUE;
+ mbJobActive = sal_True;
// sallayer does all necessary page printing
// and also handles showing a dialog
// that also means it must call jobStarted when the dialog is finished
@@ -575,7 +574,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
mnCurPage = 0;
mnCurPrintPage = 0;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mpPrinter = NULL;
return false;
@@ -616,7 +615,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
i_pController->isDirectPrint(),
maJobSetup.ImplGetConstData() ) )
{
- mbJobActive = TRUE;
+ mbJobActive = sal_True;
i_pController->createProgressDialog();
int nPages = i_pController->getFilteredPageCount();
for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ )
@@ -653,7 +652,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
maJobName = i_rJobName;
mnCurPage = 1;
mnCurPrintPage = 1;
- mbPrinting = TRUE;
+ mbPrinting = sal_True;
}
else
bError = true;
@@ -674,7 +673,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
pSVData->mpDefInst->DestroyPrinter( mpPrinter );
mnCurPage = 0;
mnCurPrintPage = 0;
- mbPrinting = FALSE;
+ mbPrinting = sal_False;
mpPrinter = NULL;
return false;
@@ -727,6 +726,13 @@ void PrinterController::setPrinter( const boost::shared_ptr<Printer>& i_rPrinter
mpImplData->mnFixedPaperBin = -1;
}
+void PrinterController:: resetPrinterOptions( bool i_bFileOutput )
+{
+ PrinterOptions aOpt;
+ aOpt.ReadFromConfig( i_bFileOutput );
+ mpImplData->mpPrinter->SetPrinterOptions( aOpt );
+}
+
bool PrinterController::setupPrinter( Window* i_pParent )
{
bool bRet = false;
@@ -735,7 +741,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
// get old data
Size aPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- USHORT nPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ sal_uInt16 nPaperBin = mpImplData->mpPrinter->GetPaperBin();
// call driver setup
bRet = mpImplData->mpPrinter->Setup( i_pParent );
@@ -744,7 +750,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
// was papersize or bin overridden ? if so we need to take action
Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic(
mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
- USHORT nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
+ sal_uInt16 nNewPaperBin = mpImplData->mpPrinter->GetPaperBin();
if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin )
{
mpImplData->maFixedPageSize = aNewPaperSize;
@@ -761,7 +767,7 @@ bool PrinterController::setupPrinter( Window* i_pParent )
return bRet;
}
-PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps )
+PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const Sequence< PropertyValue >& i_rProps, bool bNoNUP )
{
PrinterController::PageSize aPageSize;
aPageSize.aSize = mpPrinter->GetPaperSize();
@@ -796,7 +802,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
if( aSetSize.Width && aSetSize.Height )
{
Size aSetPaperSize( aSetSize.Width, aSetSize.Height );
- Size aRealPaperSize( getRealPaperSize( aSetPaperSize ) );
+ Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
aIsSize = aSetSize;
}
@@ -806,7 +812,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
aPageSize.aSize.Width() = aIsSize.Width;
aPageSize.aSize.Height() = aIsSize.Height;
- Size aRealPaperSize( getRealPaperSize( aPageSize.aSize ) );
+ Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) );
if( aRealPaperSize != aCurSize )
mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
@@ -872,12 +878,12 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->mpPrinter->SetMapMode( aMapMode );
// modify job setup if necessary
- PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm );
+ PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true );
o_rMtf.SetPrefSize( aPageSize.aSize );
o_rMtf.SetPrefMapMode( aMapMode );
- mpImplData->mpPrinter->EnableOutput( FALSE );
+ mpImplData->mpPrinter->EnableOutput( sal_False );
o_rMtf.Record( mpImplData->mpPrinter.get() );
@@ -906,7 +912,7 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
o_rMtf.AddAction( new MetaPushAction( PUSH_ALL ) );
// clip to page rect
- o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), TRUE ) );
+ o_rMtf.AddAction( new MetaClipRegionAction( Region( i_rClipRect ), sal_True ) );
// append the subpage
io_rSubPage.WindStart();
@@ -923,8 +929,8 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
o_rMtf.AddAction( new MetaMapModeAction( MapMode( MAP_100TH_MM ) ) );
Rectangle aBorderRect( i_rClipRect );
- o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), TRUE ) );
- o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), FALSE ) );
+ o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), sal_True ) );
+ o_rMtf.AddAction( new MetaFillColorAction( Color( COL_TRANSPARENT ), sal_False ) );
o_rMtf.AddAction( new MetaRectAction( aBorderRect ) );
// restore gstate
@@ -954,7 +960,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
rMPS.nTopMargin == 0 && rMPS.nBottomMargin == 0 )
{
PrinterController::PageSize aPageSize = getPageFile( i_nFilteredPage, o_rMtf, i_bMayUseCache );
- Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize );
+ Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true );
mpImplData->mpPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
mpImplData->mpPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
if( aPaperSize != aPageSize.aSize )
@@ -976,7 +982,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
sal_Bool bIsLastPage = mpImplData->mbLastPage;
mpImplData->mbLastPage = sal_False;
- Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize ) );
+ Size aPaperSize( mpImplData->getRealPaperSize( mpImplData->maMultiPage.aPaperSize, false ) );
// multi page area: page size minus margins + one time spacing right and down
// the added spacing is so each subpage can be calculated including its spacing
@@ -1025,6 +1031,14 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
nCellX = (nSubPage / rMPS.nRows);
nCellY = (nSubPage % rMPS.nRows);
break;
+ case PrinterController::RLTB:
+ nCellX = rMPS.nColumns - 1 - (nSubPage % rMPS.nColumns);
+ nCellY = (nSubPage / rMPS.nColumns);
+ break;
+ case PrinterController::TBRL:
+ nCellX = rMPS.nColumns - 1 - (nSubPage / rMPS.nRows);
+ nCellY = (nSubPage % rMPS.nRows);
+ break;
}
// scale the metafile down to a sub page size
double fScaleX = double(aSubPageSize.Width())/double(aPageSize.aSize.Width());
@@ -1067,9 +1081,9 @@ int PrinterController::getFilteredPageCount()
return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv;
}
-ULONG PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
+sal_uLong PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
{
- ULONG nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
+ sal_uLong nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
sal_Int32 nMaxBmpDPIX = mpImplData->mpPrinter->ImplGetDPIX();
sal_Int32 nMaxBmpDPIY = mpImplData->mpPrinter->ImplGetDPIY();
@@ -1167,9 +1181,9 @@ void PrinterController::printFilteredPage( int i_nPage )
}
GDIMetaFile aCleanedFile;
- ULONG nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
+ sal_uLong nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
- mpImplData->mpPrinter->EnableOutput( TRUE );
+ mpImplData->mpPrinter->EnableOutput( sal_True );
// actually print the page
mpImplData->mpPrinter->ImplStartPage();
@@ -1334,6 +1348,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
bool bHaveProperty = false;
rtl::OUString aPropName;
vcl::ImplPrinterControllerData::ControlDependency aDep;
+ Sequence< sal_Bool > aChoicesDisabled;
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
@@ -1361,6 +1376,10 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
}
if( bHaveProperty )
{
@@ -1373,6 +1392,8 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
}
if( aDep.maDependsOnName.getLength() > 0 )
mpImplData->maControlDependencies[ aPropName ] = aDep;
+ if( aChoicesDisabled.getLength() > 0 )
+ mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled;
}
}
}
@@ -1448,6 +1469,20 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
return bEnabled;
}
+bool PrinterController::isUIChoiceEnabled( const rtl::OUString& i_rProperty, sal_Int32 i_nValue ) const
+{
+ bool bEnabled = true;
+ ImplPrinterControllerData::ChoiceDisableMap::const_iterator it =
+ mpImplData->maChoiceDisableMap.find( i_rProperty );
+ if(it != mpImplData->maChoiceDisableMap.end() )
+ {
+ const Sequence< sal_Bool >& rDisabled( it->second );
+ if( i_nValue >= 0 && i_nValue < rDisabled.getLength() )
+ bEnabled = ! rDisabled[i_nValue];
+ }
+ return bEnabled;
+}
+
rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty ) const
{
rtl::OUString aDependency;
@@ -1560,7 +1595,7 @@ void PrinterController::pushPropertiesToPrinter()
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) );
if( pVal )
pVal->Value >>= bCollate;
- mpImplData->mpPrinter->SetCopyCount( static_cast<USHORT>(nCopyCount), bCollate );
+ mpImplData->mpPrinter->SetCopyCount( static_cast<sal_uInt16>(nCopyCount), bCollate );
// duplex mode
pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DuplexMode" ) ) );
@@ -1694,7 +1729,7 @@ void PrinterOptionsHelper::appendPrintUIOptions( uno::Sequence< beans::PropertyV
}
Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpTexts,
+ const Sequence< rtl::OUString >& i_rHelpIds,
const rtl::OUString& i_rType,
const PropertyValue* i_pVal,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
@@ -1703,7 +1738,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
sal_Int32 nElements =
1 // ControlType
+ (i_rTitle.getLength() ? 1 : 0) // Text
- + (i_rHelpTexts.getLength() ? 1 : 0) // HelpText
+ + (i_rHelpIds.getLength() ? 1 : 0) // HelpId
+ (i_pVal ? 1 : 0) // Property
+ i_rControlOptions.maAddProps.getLength() // additional props
+ (i_rControlOptions.maGroupHint.getLength() ? 1 : 0) // grouping
@@ -1726,10 +1761,10 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
aCtrl[nUsed++].Value = makeAny( i_rTitle );
}
- if( i_rHelpTexts.getLength() )
+ if( i_rHelpIds.getLength() )
{
- aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
- aCtrl[nUsed++].Value = makeAny( i_rHelpTexts );
+ aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpId" ) );
+ aCtrl[nUsed++].Value = makeAny( i_rHelpIds );
}
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ControlType" ) );
aCtrl[nUsed++].Value = makeAny( i_rType );
@@ -1778,74 +1813,80 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
return makeAny( aCtrl );
}
-Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText )
+Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
}
Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Subgroup" ) ),
NULL, i_rControlOptions );
}
Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Bool i_bValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_bValue );
- return getUIControlOpt( i_rTitle, aHelpText, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
+ return getUIControlOpt( i_rTitle, aHelpId, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bool" ) ), &aVal, i_rControlOptions );
}
Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
- const Sequence< rtl::OUString >& i_rHelpText,
+ const Sequence< rtl::OUString >& i_rHelpId,
const rtl::OUString& i_rProperty,
const Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType,
+ const Sequence< sal_Bool >& i_rDisabledChoices,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
UIControlOptions aOpt( i_rControlOptions );
sal_Int32 nUsed = aOpt.maAddProps.getLength();
- aOpt.maAddProps.realloc( nUsed + 1 );
+ aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) );
aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) );
aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices );
+ if( i_rDisabledChoices.getLength() )
+ {
+ aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) );
+ aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices );
+ }
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
- return getUIControlOpt( i_rTitle, i_rHelpText, i_rType, &aVal, aOpt );
+ return getUIControlOpt( i_rTitle, i_rHelpId, i_rType, &aVal, aOpt );
}
Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
sal_Int32 i_nValue,
sal_Int32 i_nMinValue,
@@ -1864,17 +1905,17 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
aOpt.maAddProps[nUsed++].Value = makeAny( i_nMaxValue );
}
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_nValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Range" ) ),
&aVal,
aOpt
@@ -1882,23 +1923,23 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
}
Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
- const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rHelpId,
const rtl::OUString& i_rProperty,
const rtl::OUString& i_rValue,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
- Sequence< rtl::OUString > aHelpText;
- if( i_rHelpText.getLength() > 0 )
+ Sequence< rtl::OUString > aHelpId;
+ if( i_rHelpId.getLength() > 0 )
{
- aHelpText.realloc( 1 );
- *aHelpText.getArray() = i_rHelpText;
+ aHelpId.realloc( 1 );
+ *aHelpId.getArray() = i_rHelpId;
}
PropertyValue aVal;
aVal.Name = i_rProperty;
aVal.Value = makeAny( i_rValue );
return getUIControlOpt( i_rTitle,
- aHelpText,
+ aHelpId,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ),
&aVal,
i_rControlOptions
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index e22b37c0970c..21c82cd51f3a 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -64,7 +64,7 @@ ImplRegionBand::ImplRegionBand( long nTop, long nBottom )
mpPrevBand = NULL;
mpFirstSep = NULL;
mpFirstBandPoint = NULL;
- mbTouched = FALSE;
+ mbTouched = sal_False;
}
// -----------------------------------------------------------------------
@@ -213,8 +213,8 @@ void ImplRegionBand::ProcessPoints()
// generate separations from lines and process union with existing
// separations
-BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
- BOOL bEndPoint, LineType eLineType )
+sal_Bool ImplRegionBand::InsertPoint( long nX, long nLineId,
+ sal_Bool bEndPoint, LineType eLineType )
{
if ( !mpFirstBandPoint )
{
@@ -224,7 +224,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
mpFirstBandPoint->mbEndPoint = bEndPoint;
mpFirstBandPoint->meLineType = eLineType;
mpFirstBandPoint->mpNextBandPoint = NULL;
- return TRUE;
+ return sal_True;
}
// look if line allready touched the band
@@ -243,8 +243,8 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
{
// if we've only got one point => replace first point
pRegionBandPoint->mnX = nX;
- pRegionBandPoint->mbEndPoint = TRUE;
- return TRUE;
+ pRegionBandPoint->mbEndPoint = sal_True;
+ return sal_True;
}
else
{
@@ -268,7 +268,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
}
}
else
- return FALSE;
+ return sal_False;
}
// use next element
@@ -299,7 +299,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
else
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return TRUE;
+ return sal_True;
}
// use next element
@@ -318,7 +318,7 @@ BOOL ImplRegionBand::InsertPoint( long nX, long nLineId,
// connections to the new point
pLastTestedRegionBandPoint->mpNextBandPoint = pNewRegionBandPoint;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -352,7 +352,7 @@ void ImplRegionBand::ScaleX( double fHorzScale )
//
// combine overlaping sparations
-BOOL ImplRegionBand::OptimizeBand()
+sal_Bool ImplRegionBand::OptimizeBand()
{
ImplRegionBandSep* pPrevSep = 0;
ImplRegionBandSep* pSep = mpFirstSep;
@@ -390,7 +390,7 @@ BOOL ImplRegionBand::OptimizeBand()
pSep = pSep->mpNextSep;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -405,7 +405,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
mpFirstSep = new ImplRegionBandSep;
mpFirstSep->mnXLeft = nXLeft;
mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mbRemoved = sal_False;
mpFirstSep->mpNextSep = NULL;
return;
}
@@ -426,7 +426,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pNewSep->mpNextSep = pSep;
if ( pSep == mpFirstSep )
@@ -453,7 +453,7 @@ void ImplRegionBand::Union( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pSep->mpNextSep = pNewSep;
pNewSep->mpNextSep = NULL;
@@ -474,7 +474,7 @@ void ImplRegionBand::Intersect( long nXLeft, long nXRight )
DBG_ASSERT( nXLeft <= nXRight, "ImplRegionBand::Intersect(): nxLeft > nXRight" );
// band has been touched
- mbTouched = TRUE;
+ mbTouched = sal_True;
// band empty? -> nothing to do
if ( !mpFirstSep )
@@ -487,7 +487,7 @@ void ImplRegionBand::Intersect( long nXLeft, long nXRight )
// new separation completly outside? -> remove separation
if ( (nXRight < pSep->mnXLeft) || (nXLeft > pSep->mnXRight) )
// will be removed from the optimizer
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
// new separation overlaping from left? -> reduce right boundary
if ( (nXLeft <= pSep->mnXLeft) &&
@@ -521,7 +521,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
DBG_ASSERT( nXLeft <= nXRight, "ImplRegionBand::Exclude(): nxLeft > nXRight" );
// band has been touched
- mbTouched = TRUE;
+ mbTouched = sal_True;
// band empty? -> nothing to do
if ( !mpFirstSep )
@@ -533,14 +533,14 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
- BOOL bSepProcessed = FALSE;
+ sal_Bool bSepProcessed = sal_False;
// new separation completely overlapping? -> remove separation
if ( (nXLeft <= pSep->mnXLeft) && (nXRight >= pSep->mnXRight) )
{
// will be removed from the optimizer
- pSep->mbRemoved = TRUE;
- bSepProcessed = TRUE;
+ pSep->mbRemoved = sal_True;
+ bSepProcessed = sal_True;
}
// new separation overlaping from left? -> reduce boundary
@@ -549,7 +549,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
if ( (nXRight >= pSep->mnXLeft) && (nXLeft <= pSep->mnXLeft) )
{
pSep->mnXLeft = nXRight+1;
- bSepProcessed = TRUE;
+ bSepProcessed = sal_True;
}
}
@@ -559,7 +559,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
if ( (nXLeft <= pSep->mnXRight) && (nXRight > pSep->mnXRight) )
{
pSep->mnXRight = nXLeft-1;
- bSepProcessed = TRUE;
+ bSepProcessed = sal_True;
}
}
@@ -572,7 +572,7 @@ void ImplRegionBand::Exclude( long nXLeft, long nXRight )
pNewSep = new ImplRegionBandSep;
pNewSep->mnXLeft = pSep->mnXLeft;
pNewSep->mnXRight = nXLeft-1;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
pSep->mnXLeft = nXRight+1;
@@ -652,7 +652,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
mpFirstSep = new ImplRegionBandSep;
mpFirstSep->mnXLeft = nXLeft;
mpFirstSep->mnXRight = nXRight;
- mpFirstSep->mbRemoved = FALSE;
+ mpFirstSep->mbRemoved = sal_False;
mpFirstSep->mpNextSep = NULL;
return;
}
@@ -681,7 +681,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pNewSep->mpNextSep = pSep;
@@ -697,7 +697,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
else if( nXLeft == nOldLeft && nXRight == nOldRight )
{
// #3
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
pPrevSep = NULL; // do not run accidentally into the "right" case when breaking the loop
break;
}
@@ -730,7 +730,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// cannot break here, simply mark segment as removed,
// and go on with adapted nXLeft/nXRight
- pSep->mbRemoved = TRUE;
+ pSep->mbRemoved = sal_True;
}
else
{
@@ -810,7 +810,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = pSep->mpNextSep;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pSep->mpNextSep = pNewSep;
@@ -832,7 +832,7 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
pNewSep->mnXLeft = nXLeft;
pNewSep->mnXRight = nXRight;
pNewSep->mpNextSep = NULL;
- pNewSep->mbRemoved = FALSE;
+ pNewSep->mbRemoved = sal_False;
// connections from the new separation
pPrevSep->mpNextSep = pNewSep;
@@ -843,50 +843,50 @@ void ImplRegionBand::XOr( long nXLeft, long nXRight )
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsInside( long nX )
+sal_Bool ImplRegionBand::IsInside( long nX )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft <= nX) && (pSep->mnXRight >= nX) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsOver( long nLeft, long nRight )
+sal_Bool ImplRegionBand::IsOver( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft < nRight) && (pSep->mnXRight > nLeft) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::IsInside( long nLeft, long nRight )
+sal_Bool ImplRegionBand::IsInside( long nLeft, long nRight )
{
ImplRegionBandSep* pSep = mpFirstSep;
while ( pSep )
{
if ( (pSep->mnXLeft >= nLeft) && (nRight <= pSep->mnXRight) )
- return TRUE;
+ return sal_True;
pSep = pSep->mpNextSep;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -913,7 +913,7 @@ long ImplRegionBand::GetXRightBoundary() const
// -----------------------------------------------------------------------
-BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
+sal_Bool ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
{
ImplRegionBandSep* pOwnRectBandSep = mpFirstSep;
ImplRegionBandSep* pSecondRectBandSep = rRegionBand.mpFirstSep;
@@ -923,12 +923,12 @@ BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return FALSE;
+ return sal_False;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return FALSE;
+ return sal_False;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -939,9 +939,9 @@ BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const
// differnt number of separations?
if ( pOwnRectBandSep || pSecondRectBandSep )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index a00795e2e2ce..480a17a9f88b 100644..100755
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -41,6 +41,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -79,19 +81,19 @@ namespace {
bool ImplIsPolygonRectilinear (const PolyPolygon& rPolyPoly)
{
// Iterate over all polygons.
- const USHORT nPolyCount = rPolyPoly.Count();
- for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
if (nSize < 2)
continue;
Point aPoint (aPoly.GetPoint(0));
const Point aLastPoint (aPoint);
- for (USHORT nPoint = 1; nPoint < nSize; ++nPoint)
+ for (sal_uInt16 nPoint = 1; nPoint < nSize; ++nPoint)
{
const Point aNextPoint (aPoly.GetPoint(nPoint));
// When there is at least one edge that is neither vertical nor
@@ -183,20 +185,20 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
long nLineId = 0L;
// Iterate over all polygons.
- const USHORT nPolyCount = rPolyPoly.Count();
- for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly)
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for (sal_uInt16 nPoly = 0; nPoly < nPolyCount; ++nPoly)
{
const Polygon& aPoly = rPolyPoly.GetObject(nPoly);
// Iterate over all edges of the current polygon.
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
if (nSize < 2)
continue;
// Avoid fetching every point twice (each point is the start point
// of one and the end point of another edge.)
Point aStart (aPoly.GetPoint(0));
Point aEnd;
- for (USHORT nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
+ for (sal_uInt16 nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd)
{
// We take the implicit closing edge into account by mapping
// index nSize to 0.
@@ -262,7 +264,7 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
// Add the x-value as point to all bands in the nTop->nBottom range.
for (pBand=pTopBand; pBand!=NULL&&pBand->mnYTop<=nBottom; pBand=pBand->mpNextBand)
- pBand->InsertPoint(aStart.X(), nLineId++, TRUE, eLineType);
+ pBand->InsertPoint(aStart.X(), nLineId++, sal_True, eLineType);
}
}
@@ -286,19 +288,19 @@ ImplRegion* ImplGeneralPolygonToBands (
pImplRegion->CreateBandRange( rPolygonBoundingBox.Top(), rPolygonBoundingBox.Bottom() );
// insert polygons
- const USHORT nPolyCount = rPolyPoly.Count();
- for ( USHORT nPoly = 0; nPoly < nPolyCount; nPoly++ )
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
+ for ( sal_uInt16 nPoly = 0; nPoly < nPolyCount; nPoly++ )
{
// get reference to current polygon
const Polygon& aPoly = rPolyPoly.GetObject( nPoly );
- const USHORT nSize = aPoly.GetSize();
+ const sal_uInt16 nSize = aPoly.GetSize();
// not enough points ( <= 2 )? -> nothing to do!
if ( nSize <= 2 )
continue;
// band the polygon
- for ( USHORT nPoint = 1; nPoint < nSize; nPoint++ )
+ for ( sal_uInt16 nPoint = 1; nPoint < nSize; nPoint++ )
pImplRegion->InsertLine( aPoly.GetPoint(nPoint-1), aPoly.GetPoint(nPoint), nLineID++ );
// close polygon with line from first point to last point, if neccesary
@@ -338,7 +340,7 @@ const char* ImplDbgTestRegion( const void* pObj )
if ( (pImplRegion != &aImplEmptyRegion) && (pImplRegion != &aImplNullRegion) )
{
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
const ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand();
while ( pBand )
{
@@ -536,14 +538,14 @@ void ImplRegion::CreateBandRange( long nYTop, long nYBottom )
// -----------------------------------------------------------------------
-BOOL ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
+sal_Bool ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
long nLineId )
{
long nX, nY;
// lines consisting of a single point do not interest here
if ( rStartPt == rEndPt )
- return TRUE;
+ return sal_True;
LineType eLineType = (rStartPt.Y() > rEndPt.Y()) ? LINE_DESCENDING : LINE_ASCENDING;
if ( rStartPt.X() == rEndPt.X() )
@@ -620,25 +622,25 @@ BOOL ImplRegion::InsertLine( const Point& rStartPt, const Point& rEndPt,
}
// last point
- InsertPoint( Point( nEndX, nEndY ), nLineId, TRUE, eLineType );
+ InsertPoint( Point( nEndX, nEndY ), nLineId, sal_True, eLineType );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
//
// search for appropriate place for the new point
-BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
- BOOL bEndPoint, LineType eLineType )
+sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
+ sal_Bool bEndPoint, LineType eLineType )
{
DBG_ASSERT( mpFirstBand != NULL, "ImplRegion::InsertPoint - no bands available!" );
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
if ( rPoint.Y() > mpLastCheckedBand->mnYTop )
@@ -650,7 +652,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
mpLastCheckedBand = mpLastCheckedBand->mpNextBand;
@@ -667,7 +669,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
if ( rPoint.Y() == mpLastCheckedBand->mnYTop )
{
mpLastCheckedBand->InsertPoint( rPoint.X(), nLineID, bEndPoint, eLineType );
- return TRUE;
+ return sal_True;
}
mpLastCheckedBand = mpLastCheckedBand->mpPrevBand;
@@ -681,7 +683,7 @@ BOOL ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
// reinitialize pointer (should never be reached!)
mpLastCheckedBand = mpFirstBand;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -699,9 +701,9 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
}
// find/insert bands for the boundaries of the rectangle
- BOOL bTopBoundaryInserted = FALSE;
- BOOL bTop2BoundaryInserted = FALSE;
- BOOL bBottomBoundaryInserted = FALSE;
+ sal_Bool bTopBoundaryInserted = sal_False;
+ sal_Bool bTop2BoundaryInserted = sal_False;
+ sal_Bool bBottomBoundaryInserted = sal_False;
// special case: top boundary is above the first band
ImplRegionBand* pNewBand;
@@ -716,7 +718,7 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
pNewBand->mpNextBand = mpFirstBand;
mpFirstBand = pNewBand;
- bTopBoundaryInserted = TRUE;
+ bTopBoundaryInserted = sal_True;
}
// insert band(s) into the list
@@ -760,13 +762,13 @@ void ImplRegion::InsertBands( long nTop, long nBottom )
//
// create new band and insert it into the list
-BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
+sal_Bool ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
long nYBandPosition )
{
// boundary already included in band with height 1? -> nothing to do!
if ( (pBand->mnYTop == pBand->mnYBottom) &&
(nYBandPosition == pBand->mnYTop) )
- return TRUE;
+ return sal_True;
// insert single height band on top?
ImplRegionBand* pNewBand;
@@ -781,7 +783,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition;
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
// top of new rectangle within the current band? -> insert new band and copy data
@@ -808,7 +810,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
pBand->mnYBottom = nYBandPosition - 1;
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
// create new band behind the current in the list
@@ -825,7 +827,7 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
if ( nYBandPosition > pBand->mnYBottom )
@@ -835,11 +837,11 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand,
// append band to the list
pBand->mpNextBand = pNewBand;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// ------------------------------------------------------------------------
@@ -980,7 +982,7 @@ void ImplRegion::XOr( long nLeft, long nTop, long nRight, long nBottom )
//
// remove empty bands
-BOOL ImplRegion::OptimizeBandList()
+sal_Bool ImplRegion::OptimizeBandList()
{
DBG_ASSERT( (this != &aImplNullRegion) && (this != &aImplEmptyRegion),
"ImplRegion::OptimizeBandList() - Empty oder NULL-Region" );
@@ -991,7 +993,7 @@ BOOL ImplRegion::OptimizeBandList()
ImplRegionBand* pBand = mpFirstBand;
while ( pBand )
{
- const BOOL bBTEqual = pBand->mpNextBand &&
+ const sal_Bool bBTEqual = pBand->mpNextBand &&
(pBand->mnYBottom == pBand->mpNextBand->mnYTop);
// no separation? -> remove!
@@ -1199,7 +1201,7 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect )
void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly )
{
- const USHORT nPolyCount = rPolyPoly.Count();
+ const sal_uInt16 nPolyCount = rPolyPoly.Count();
if ( nPolyCount )
{
// polypolygon empty? -> empty region
@@ -1363,13 +1365,35 @@ void Region::Scale( double fScaleX, double fScaleY )
// -----------------------------------------------------------------------
-BOOL Region::Union( const Rectangle& rRect )
+sal_Bool Region::Union( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return true;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
@@ -1400,12 +1424,12 @@ BOOL Region::Union( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::Intersect( const Rectangle& rRect )
+sal_Bool Region::Intersect( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -1421,7 +1445,7 @@ BOOL Region::Intersect( const Rectangle& rRect )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return TRUE;
+ return sal_True;
}
// #103137# Avoid banding for special cases
@@ -1439,14 +1463,30 @@ BOOL Region::Intersect( const Rectangle& rRect )
// unnecessary banding
mpImplRegion->mpPolyPoly->Clip( rRect );
- return TRUE;
+ return sal_True;
+ }
+ else if( mpImplRegion->mpB2DPolyPoly )
+ {
+ // #127431# make ImplRegion unique, if not already.
+ if( mpImplRegion->mnRefCount > 1 )
+ {
+ mpImplRegion->mnRefCount--;
+ mpImplRegion = new ImplRegion( *mpImplRegion->mpB2DPolyPoly );
+ }
+
+ *mpImplRegion->mpB2DPolyPoly =
+ basegfx::tools::clipPolyPolygonOnRange( *mpImplRegion->mpB2DPolyPoly,
+ basegfx::B2DRange( rRect.Left(), rRect.Top(),
+ rRect.Right(), rRect.Bottom() ),
+ true, false );
+ return sal_True;
}
else
ImplPolyPolyRegionToBandRegion();
// is region empty? -> nothing to do!
if ( mpImplRegion == &aImplEmptyRegion )
- return TRUE;
+ return sal_True;
// get justified rectangle
long nLeft = Min( rRect.Left(), rRect.Right() );
@@ -1467,7 +1507,7 @@ BOOL Region::Intersect( const Rectangle& rRect )
mpImplRegion->mpFirstBand->Union( nLeft, nRight );
mpImplRegion->mnRectCount = 1;
- return TRUE;
+ return sal_True;
}
// no own instance data? -> make own copy!
@@ -1511,24 +1551,43 @@ BOOL Region::Intersect( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::Exclude( const Rectangle& rRect )
+sal_Bool Region::Exclude( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ return sal_True;
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
@@ -1553,18 +1612,40 @@ BOOL Region::Exclude( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL Region::XOr( const Rectangle& rRect )
+sal_Bool Region::XOr( const Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> nothing to do
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
+
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return sal_True;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
@@ -1595,21 +1676,48 @@ BOOL Region::XOr( const Rectangle& rRect )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplUnionPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
-BOOL Region::Union( const Region& rRegion )
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+
+ *this = Region( aClip );
+}
+
+sal_Bool Region::Union( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplUnionPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no instance data? -> create!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
@@ -1645,28 +1753,50 @@ BOOL Region::Union( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplIntersectWithPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
-BOOL Region::Intersect( const Region& rRegion )
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aOtherPolyPoly, aThisPolyPoly, true, false );
+ *this = Region( aClip );
+}
+
+sal_Bool Region::Intersect( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// same instance data? -> nothing to do!
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
+
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplIntersectWithPolyPolygon( rRegion );
+ return sal_True;
+ }
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
if ( mpImplRegion == &aImplEmptyRegion )
- return TRUE;
+ return sal_True;
// is region null? -> nothing to do
if ( rRegion.mpImplRegion == &aImplNullRegion )
- return TRUE;
+ return sal_True;
// is rectangle empty? -> nothing to do
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
@@ -1680,7 +1810,7 @@ BOOL Region::Intersect( const Region& rRegion )
delete mpImplRegion;
}
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
- return TRUE;
+ return sal_True;
}
// is own region NULL-region? -> copy data!
@@ -1688,7 +1818,7 @@ BOOL Region::Intersect( const Region& rRegion )
{
mpImplRegion = rRegion.mpImplRegion;
rRegion.mpImplRegion->mnRefCount++;
- return TRUE;
+ return sal_True;
}
// Wenn wir weniger Rechtecke haben, drehen wir den Intersect-Aufruf um
@@ -1708,7 +1838,7 @@ BOOL Region::Intersect( const Region& rRegion )
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
while ( pBand )
{
- pBand->mbTouched = FALSE;
+ pBand->mbTouched = sal_False;
pBand = pBand->mpNextBand;
}
@@ -1784,25 +1914,46 @@ BOOL Region::Intersect( const Region& rRegion )
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplExcludePolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ return;
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
-BOOL Region::Exclude( const Region& rRegion )
+sal_Bool Region::Exclude( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplExcludePolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no instance data? -> nothing to do
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> make own copy!
if ( mpImplRegion->mnRefCount > 1 )
@@ -1837,27 +1988,51 @@ BOOL Region::Exclude( const Region& rRegion )
pBand = pBand->mpNextBand;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
+void Region::ImplXOrPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
-BOOL Region::XOr( const Region& rRegion )
+sal_Bool Region::XOr( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplXOrPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
// is region empty or null? -> nothing to do
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return TRUE;
+ return sal_True;
// no own instance data? -> XOr = copy
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
{
*this = rRegion;
- return TRUE;
+ return sal_True;
}
// no own instance data? -> make own copy!
@@ -1890,7 +2065,7 @@ BOOL Region::XOr( const Region& rRegion )
mpImplRegion = (ImplRegion*)(&aImplEmptyRegion);
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1944,7 +2119,7 @@ Rectangle Region::GetBoundRect() const
// -----------------------------------------------------------------------
-BOOL Region::HasPolyPolygon() const
+sal_Bool Region::HasPolyPolygon() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if( !mpImplRegion )
@@ -2026,7 +2201,7 @@ basegfx::B2DPolyPolygon Region::ConvertToB2DPolyPolygon()
// -----------------------------------------------------------------------
-BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2036,11 +2211,11 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return false;
// no band in the list? -> region is empty!
if ( mpImplRegion->mpFirstBand == NULL )
- return FALSE;
+ return false;
// initialise pointer for first access
ImplRegionBand* pCurrRectBand = mpImplRegion->mpFirstBand;
@@ -2048,7 +2223,7 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
DBG_ASSERT( pCurrRectBandSep != NULL, "Erstes Band wurde nicht optimiert." );
if ( !pCurrRectBandSep )
- return FALSE;
+ return false;
// get boundaries of current rectangle
rX = pCurrRectBandSep->mnXLeft;
@@ -2060,12 +2235,12 @@ BOOL Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return TRUE;
+ return true;
}
// -----------------------------------------------------------------------
-BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2073,7 +2248,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return false;
// get last pointers
ImplRegionBand* pCurrRectBand = (ImplRegionBand*)rImplRegionInfo.mpVoidCurrRectBand;
@@ -2090,7 +2265,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no band found? -> not further rectangles!
if( !pCurrRectBand )
- return FALSE;
+ return false;
// get first separation in current band
pCurrRectBandSep = pCurrRectBand->mpFirstSep;
@@ -2106,7 +2281,7 @@ BOOL Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return TRUE;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2125,7 +2300,7 @@ RegionType Region::GetType() const
// -----------------------------------------------------------------------
-BOOL Region::IsInside( const Point& rPoint ) const
+sal_Bool Region::IsInside( const Point& rPoint ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
@@ -2138,7 +2313,7 @@ BOOL Region::IsInside( const Point& rPoint ) const
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// search band list
ImplRegionBand* pBand = mpImplRegion->mpFirstBand;
@@ -2150,30 +2325,30 @@ BOOL Region::IsInside( const Point& rPoint ) const
{
// is point within separation of the band?
if ( pBand->IsInside( rPoint.X() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
pBand = pBand->mpNextBand;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Region::IsInside( const Rectangle& rRect ) const
+sal_Bool Region::IsInside( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
// is rectangle empty? -> not inside
if ( rRect.IsEmpty() )
- return FALSE;
+ return sal_False;
// no instance data? -> not inside
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// create region from rectangle and intersect own region
Region aRegion = rRect;
@@ -2185,12 +2360,12 @@ BOOL Region::IsInside( const Rectangle& rRect ) const
// -----------------------------------------------------------------------
-BOOL Region::IsOver( const Rectangle& rRect ) const
+sal_Bool Region::IsOver( const Rectangle& rRect ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
// Can we optimize this ??? - is used in StarDraw for brushes pointers
// Why we have no IsOver for Regions ???
@@ -2287,20 +2462,20 @@ Region& Region::operator=( const Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL Region::operator==( const Region& rRegion ) const
+sal_Bool Region::operator==( const Region& rRegion ) const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
// reference to same object? -> equal!
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
if ( (rRegion.mpImplRegion == &aImplEmptyRegion) || (rRegion.mpImplRegion == &aImplNullRegion) )
- return FALSE;
+ return sal_False;
if ( rRegion.mpImplRegion->mpPolyPoly && mpImplRegion->mpPolyPoly )
return *rRegion.mpImplRegion->mpPolyPoly == *mpImplRegion->mpPolyPoly;
@@ -2311,13 +2486,13 @@ BOOL Region::operator==( const Region& rRegion ) const
// Eine der beiden Regions kann jetzt Empty sein
if ( mpImplRegion == rRegion.mpImplRegion )
- return TRUE;
+ return sal_True;
if ( mpImplRegion == &aImplEmptyRegion )
- return FALSE;
+ return sal_False;
if ( rRegion.mpImplRegion == &aImplEmptyRegion )
- return FALSE;
+ return sal_False;
}
// initialise pointers
@@ -2331,22 +2506,22 @@ BOOL Region::operator==( const Region& rRegion ) const
long nOwnXLeft = pOwnRectBandSep->mnXLeft;
long nSecondXLeft = pSecondRectBandSep->mnXLeft;
if ( nOwnXLeft != nSecondXLeft )
- return FALSE;
+ return sal_False;
long nOwnYTop = pOwnRectBand->mnYTop;
long nSecondYTop = pSecondRectBand->mnYTop;
if ( nOwnYTop != nSecondYTop )
- return FALSE;
+ return sal_False;
long nOwnXRight = pOwnRectBandSep->mnXRight;
long nSecondXRight = pSecondRectBandSep->mnXRight;
if ( nOwnXRight != nSecondXRight )
- return FALSE;
+ return sal_False;
long nOwnYBottom = pOwnRectBand->mnYBottom;
long nSecondYBottom = pSecondRectBand->mnYBottom;
if ( nOwnYBottom != nSecondYBottom )
- return FALSE;
+ return sal_False;
// get next separation from current band
pOwnRectBandSep = pOwnRectBandSep->mpNextSep;
@@ -2377,13 +2552,13 @@ BOOL Region::operator==( const Region& rRegion ) const
}
if ( pOwnRectBandSep && !pSecondRectBandSep )
- return FALSE;
+ return sal_False;
if ( !pOwnRectBandSep && pSecondRectBandSep )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2395,8 +2570,8 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
VersionCompat aCompat( rIStrm, STREAM_READ );
- UINT16 nVersion;
- UINT16 nTmp16;
+ sal_uInt16 nVersion;
+ sal_uInt16 nTmp16;
// statische Object haben RefCount von 0
if ( rRegion.mpImplRegion->mnRefCount )
@@ -2489,7 +2664,7 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
if( aCompat.GetVersion() >= 2 )
{
- BOOL bHasPolyPolygon;
+ sal_Bool bHasPolyPolygon;
rIStrm >> bHasPolyPolygon;
@@ -2513,7 +2688,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
{
DBG_CHKOBJ( &rRegion, Region, ImplDbgTestRegion );
- UINT16 nVersion = 2;
+ sal_uInt16 nVersion = 2;
VersionCompat aCompat( rOStrm, STREAM_WRITE, nVersion );
Region aTmpRegion( rRegion );
@@ -2524,7 +2699,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
rOStrm << nVersion;
// put type
- rOStrm << (UINT16)aTmpRegion.GetType();
+ rOStrm << (sal_uInt16)aTmpRegion.GetType();
// put all bands if not null or empty
if ( (aTmpRegion.mpImplRegion != &aImplEmptyRegion) && (aTmpRegion.mpImplRegion != &aImplNullRegion) )
@@ -2533,7 +2708,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pBand )
{
// put boundaries
- rOStrm << (UINT16) STREAMENTRY_BANDHEADER;
+ rOStrm << (sal_uInt16) STREAMENTRY_BANDHEADER;
rOStrm << pBand->mnYTop;
rOStrm << pBand->mnYBottom;
@@ -2542,7 +2717,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
while ( pSep )
{
// put separation
- rOStrm << (UINT16) STREAMENTRY_SEPARATION;
+ rOStrm << (sal_uInt16) STREAMENTRY_SEPARATION;
rOStrm << pSep->mnXLeft;
rOStrm << pSep->mnXRight;
@@ -2554,10 +2729,10 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
}
// put endmarker
- rOStrm << (UINT16) STREAMENTRY_END;
+ rOStrm << (sal_uInt16) STREAMENTRY_END;
// write polypolygon if available
- const BOOL bHasPolyPolygon = rRegion.HasPolyPolygon();
+ const sal_Bool bHasPolyPolygon = rRegion.HasPolyPolygon();
rOStrm << bHasPolyPolygon;
if( bHasPolyPolygon )
@@ -2594,12 +2769,12 @@ void Region::ImplBeginAddRect()
// -----------------------------------------------------------------------
-BOOL Region::ImplAddRect( const Rectangle& rRect )
+sal_Bool Region::ImplAddRect( const Rectangle& rRect )
{
// Hier kein CheckThis, da nicht alle Daten auf Stand
if ( rRect.IsEmpty() )
- return TRUE;
+ return sal_True;
// get justified rectangle
long nTop;
@@ -2659,7 +2834,7 @@ BOOL Region::ImplAddRect( const Rectangle& rRect )
mpImplRegion->mpLastCheckedBand->Union( nLeft, nRight );
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2728,14 +2903,14 @@ void Region::ImplEndAddRect()
// -----------------------------------------------------------------------
-ULONG Region::GetRectCount() const
+sal_uLong Region::GetRectCount() const
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
((Region*)this)->ImplPolyPolyRegionToBandRegion();
#ifdef DBG_UTIL
- ULONG nCount = 0;
+ sal_uLong nCount = 0;
// all bands if not null or empty
if ( (mpImplRegion != &aImplEmptyRegion) && (mpImplRegion != &aImplNullRegion) )
@@ -2781,7 +2956,7 @@ RegionHandle Region::BeginEnumRects()
ImplRegionHandle* pData = new ImplRegionHandle;
pData->mpRegion = new Region( *this );
- pData->mbFirst = TRUE;
+ pData->mbFirst = sal_True;
// save pointers
pData->mpCurrRectBand = pData->mpRegion->mpImplRegion->mpFirstBand;
@@ -2792,16 +2967,16 @@ RegionHandle Region::BeginEnumRects()
// -----------------------------------------------------------------------
-BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
+sal_Bool Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
ImplRegionHandle* pData = (ImplRegionHandle*)pVoidData;
if ( !pData )
- return FALSE;
+ return sal_False;
if ( pData->mbFirst )
- pData->mbFirst = FALSE;
+ pData->mbFirst = sal_False;
else
{
// get next separation from current band
@@ -2815,7 +2990,7 @@ BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
// no band found? -> not further rectangles!
if ( !pData->mpCurrRectBand )
- return FALSE;
+ return sal_False;
// get first separation in current band
pData->mpCurrRectBandSep = pData->mpCurrRectBand->mpFirstSep;
@@ -2827,7 +3002,7 @@ BOOL Region::GetEnumRects( RegionHandle pVoidData, Rectangle& rRect )
rRect.Bottom() = pData->mpCurrRectBand->mnYBottom;
rRect.Left() = pData->mpCurrRectBandSep->mnXLeft;
rRect.Right() = pData->mpCurrRectBandSep->mnXRight;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -2851,7 +3026,7 @@ static inline bool ImplPolygonRectTest( const Polygon& rPoly, Rectangle* pRectOu
{
bool bIsRect = false;
const Point* pPoints = rPoly.GetConstPointAry();
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if( nPoints == 4 || (nPoints == 5 && pPoints[0] == pPoints[4]) )
{
long nX1 = pPoints[0].X(), nX2 = pPoints[2].X(),
@@ -2902,7 +3077,7 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
int nPolygonRects = 0, nPolygonPolygons = 0;
int nPolygons = rPolyPoly.Count();
- for( USHORT i = 0; i < nPolygons; i++ )
+ for( sal_uInt16 i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
if( ImplPolygonRectTest( rPoly ) )
@@ -2915,7 +3090,7 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
Region aResult;
Rectangle aRect;
- for( USHORT i = 0; i < nPolygons; i++ )
+ for( sal_uInt16 i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
if( ImplPolygonRectTest( rPoly, &aRect ) )
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index ea8d10377e61..9fa4d813b2b7 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -171,7 +171,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
}
}
-BOOL SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
+sal_Bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
{
long w;
if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
@@ -244,22 +244,37 @@ BOOL SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
pPtAry2[j].mnY = pPtAry[i].mnY;
}
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
void SalGraphics::mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
{
- // mirror the bounding rect and move Region by resulting offset
- Rectangle aRect( rRgn.GetBoundRect() );
- long nWidth = aRect.GetWidth();
- long x = aRect.Left();
- long x_org = x;
+ if( rRgn.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aPolyPoly( rRgn.ConvertToB2DPolyPolygon() );
+ aPolyPoly = mirror( aPolyPoly, pOutDev, bBack );
+ rRgn = Region( aPolyPoly );
+ }
+ else
+ {
+ ImplRegionInfo aInfo;
+ bool bRegionRect;
+ Region aMirroredRegion;
+ long nX, nY, nWidth, nHeight;
- mirror( x, nWidth, pOutDev, bBack );
- rRgn.Move( x - x_org, 0 );
+ bRegionRect = rRgn.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
+ while ( bRegionRect )
+ {
+ Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
+ mirror( aRect, pOutDev, bBack );
+ aMirroredRegion.Union( aRect );
+ bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
+ }
+ rRgn = aMirroredRegion;
+ }
}
void SalGraphics::mirror( Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
@@ -357,22 +372,15 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
// ----------------------------------------------------------------------------
-BOOL SalGraphics::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+bool SalGraphics::SetClipRegion( const Region& i_rClip, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
- return unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- return false;
-}
-
-BOOL SalGraphics::UnionClipRegion( const ::basegfx::B2DPolyPolygon& rPoly, const OutputDevice* pOutDev )
-{
- (void)pOutDev;// TODO: SAL_LAYOUT_BIDI_RTL
- return unionClipRegion( rPoly );
+ {
+ Region aMirror( i_rClip );
+ mirror( aMirror, pOutDev );
+ return setClipRegion( aMirror );
+ }
+ return setClipRegion( i_rClip );
}
void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
@@ -411,12 +419,12 @@ bool SalGraphics::drawPolyLine(
return false;
}
-void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolyLine( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -424,12 +432,12 @@ void SalGraphics::DrawPolyLine( ULONG nPoints, const SalPoint* pPtAry, const Out
drawPolyLine( nPoints, pPtAry );
}
-void SalGraphics::DrawPolygon( ULONG nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolygon( sal_uLong nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
drawPolygon( nPoints, bCopied ? pPtAry2 : pPtAry );
delete [] pPtAry2;
}
@@ -443,10 +451,10 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[nPoly];
- ULONG i;
+ sal_uLong i;
for(i=0; i<nPoly; i++)
{
- ULONG nPoints = pPoints[i];
+ sal_uLong nPoints = pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
}
@@ -464,7 +472,7 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon& i_rPolyPolygon, double i_fTransparency, const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolyPolygon aMirror( mirror( i_rPolyPolygon, i_pOutDev ) );
bRet = drawPolyPolygon( aMirror, i_fTransparency );
@@ -479,13 +487,13 @@ bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT
return false;
}
-sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -494,13 +502,13 @@ sal_Bool SalGraphics::DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry,
return bResult;
}
-sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, const OutputDevice* pOutDev )
+sal_Bool SalGraphics::DrawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2 : pPtAry, pFlgAry );
delete [] pPtAry2;
}
@@ -510,17 +518,17 @@ sal_Bool SalGraphics::DrawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
}
sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
- const SalPoint* const* i_pPtAry, const BYTE* const* i_pFlgAry, const OutputDevice* i_pOutDev )
+ const SalPoint* const* i_pPtAry, const sal_uInt8* const* i_pFlgAry, const OutputDevice* i_pOutDev )
{
sal_Bool bRet = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[i_nPoly];
- ULONG i;
+ sal_uLong i;
for(i=0; i<i_nPoly; i++)
{
- ULONG nPoints = i_pPoints[i];
+ sal_uLong nPoints = i_pPoints[i];
pPtAry2[i] = new SalPoint[ nPoints ];
mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
}
@@ -541,7 +549,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin );
@@ -554,7 +562,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
void SalGraphics::CopyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT nFlags, const OutputDevice *pOutDev )
+ sal_uInt16 nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -648,12 +656,12 @@ void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInv
mirror( nX, nWidth, pOutDev );
invert( nX, nY, nWidth, nHeight, nFlags );
}
-void SalGraphics::Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
- BOOL bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
+ sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
invert( nPoints, bCopied ? pPtAry2 : pPtAry, nFlags );
delete [] pPtAry2;
}
@@ -661,15 +669,15 @@ void SalGraphics::Invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nF
invert( nPoints, pPtAry, nFlags );
}
-BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize, const OutputDevice *pOutDev )
+sal_Bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
}
-BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside, const OutputDevice *pOutDev )
+sal_Bool SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -718,7 +726,7 @@ void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const Outp
}
}
-BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -727,7 +735,7 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
+ sal_Bool bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -735,7 +743,7 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
@@ -744,7 +752,7 @@ BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, c
Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
- BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
+ sal_Bool bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
mirror( nType, aValue, pOutDev, true );
return bRet;
}
@@ -752,7 +760,7 @@ BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, c
return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+sal_Bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
{
@@ -767,12 +775,12 @@ BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart,
mirror( rNativeBoundingRegion, pOutDev, true );
mirror( rNativeContentRegion, pOutDev, true );
mirror( nType, aValue, pOutDev, true );
- return TRUE;
+ return sal_True;
}
else
{
mirror( nType, aValue, pOutDev, true );
- return FALSE;
+ return sal_False;
}
}
else
@@ -812,7 +820,7 @@ bool SalGraphics::filterText( const String&, String&, xub_StrLen, xub_StrLen&, x
void SalGraphics::AddDevFontSubstitute( OutputDevice* pOutDev,
const String& rFontName,
const String& rReplaceFontName,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
pOutDev->ImplAddDevFontSubstitute( rFontName, rReplaceFontName, nFlags );
}
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 293098496d15..3a9bd669f54f 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -102,12 +102,12 @@ static void ImplPALToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuff
BitmapColor* pColMapBuf = aColMap.ImplGetColorBuffer();
BitmapColor aIndex( 0 );
- for( USHORT i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
+ for( sal_uInt16 i = 0, nSrcCount = aColMap.GetEntryCount(), nDstCount = rDstBuffer.maPalette.GetEntryCount(); i < nSrcCount; i++ )
{
if( ( i < nDstCount ) && ( rSrcBuffer.maPalette[ i ] == rDstBuffer.maPalette[ i ] ) )
- aIndex.SetIndex( sal::static_int_cast<BYTE>(i) );
+ aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(i) );
else
- aIndex.SetIndex( sal::static_int_cast<BYTE>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
+ aIndex.SetIndex( sal::static_int_cast<sal_uInt8>(rDstBuffer.maPalette.GetBestIndex( rSrcBuffer.maPalette[ i ] )) );
pColMapBuf[ i ] = aIndex;
}
@@ -213,7 +213,7 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR )
{
BitmapColor aCol;
- BYTE* pPixel = NULL;
+ sal_uInt8* pPixel = NULL;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
@@ -254,7 +254,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
const ColorMask& rSrcMask = rSrcBuffer.maColorMask;
const ColorMask& rDstMask = rDstBuffer.maColorMask;
BitmapPalette aColMap( rSrcBuffer.maPalette.GetEntryCount() );
- BYTE* pColToPalMap = new BYTE[ TC_TO_PAL_COLORS ];
+ sal_uInt8* pColToPalMap = new sal_uInt8[ TC_TO_PAL_COLORS ];
BitmapColor aIndex( 0 );
for( long nR = 0; nR < 16; nR++ )
@@ -263,10 +263,10 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
{
for( long nB = 0; nB < 16; nB++ )
{
- BitmapColor aCol( sal::static_int_cast<BYTE>(nR << 4),
- sal::static_int_cast<BYTE>(nG << 4),
- sal::static_int_cast<BYTE>(nB << 4) );
- pColToPalMap[ ImplIndexFromColor( aCol ) ] = (BYTE) rDstBuffer.maPalette.GetBestIndex( aCol );
+ BitmapColor aCol( sal::static_int_cast<sal_uInt8>(nR << 4),
+ sal::static_int_cast<sal_uInt8>(nG << 4),
+ sal::static_int_cast<sal_uInt8>(nB << 4) );
+ pColToPalMap[ ImplIndexFromColor( aCol ) ] = (sal_uInt8) rDstBuffer.maPalette.GetBestIndex( aCol );
}
}
}
@@ -294,7 +294,7 @@ static void ImplTCToPAL( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffe
// ---------------------
BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
- ULONG nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
+ sal_uLong nDstBitmapFormat, BitmapPalette* pDstPal, ColorMask* pDstMask )
{
FncGetPixel pFncGetPixel;
FncSetPixel pFncSetPixel;
@@ -331,7 +331,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
}
// set function for setting pixels
- const ULONG nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
+ const sal_uLong nDstScanlineFormat = BMP_SCANLINE_FORMAT( nDstBitmapFormat );
switch( nDstScanlineFormat )
{
IMPL_CASE_SET_FORMAT( _1BIT_MSB_PAL, 1 );
@@ -368,7 +368,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
pDstBuffer->mnScanlineSize = AlignedWidth4Bytes( pDstBuffer->mnBitCount * pDstBuffer->mnWidth );
try
{
- pDstBuffer->mpBits = new BYTE[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
+ pDstBuffer->mpBits = new sal_uInt8[ pDstBuffer->mnScanlineSize * pDstBuffer->mnHeight ];
}
catch( const std::bad_alloc& )
{
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index 0bf74e46d3fd..cc204069c2c4 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -41,29 +41,29 @@ using ::rtl::OUString;
/*
* IsNativeControlSupported()
*
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
+sal_Bool SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
{
- return( FALSE );
+ return( sal_False );
}
/*
* HitTestNativeControl()
*
- * If the return value is TRUE, bIsInside contains information whether
+ * If the return value is sal_True, bIsInside contains information whether
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL SalGraphics::hitTestNativeControl( ControlType,
+sal_Bool SalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- BOOL& )
+ sal_Bool& )
{
- return( FALSE );
+ return( sal_False );
}
@@ -76,14 +76,14 @@ BOOL SalGraphics::hitTestNativeControl( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::drawNativeControl( ControlType,
+sal_Bool SalGraphics::drawNativeControl( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
@@ -97,22 +97,22 @@ BOOL SalGraphics::drawNativeControl( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::drawNativeControlText( ControlType,
+sal_Bool SalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
- * contains the TRUE bounding region covered by the control
+ * If the return value is sal_True, rNativeBoundingRegion
+ * contains the sal_True bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
* the borders of the control.
@@ -121,7 +121,7 @@ BOOL SalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL SalGraphics::getNativeControlRegion( ControlType,
+sal_Bool SalGraphics::getNativeControlRegion( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -130,7 +130,7 @@ BOOL SalGraphics::getNativeControlRegion( ControlType,
Rectangle &,
Rectangle & )
{
- return( FALSE );
+ return( sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/svcompat.cxx b/vcl/source/gdi/svcompat.cxx
index 8415d5bbfc39..c594dd1f93d7 100644
--- a/vcl/source/gdi/svcompat.cxx
+++ b/vcl/source/gdi/svcompat.cxx
@@ -35,7 +35,7 @@
// - ImplCompat -
// --------------
-ImplCompat::ImplCompat( SvStream& rStm, USHORT nStreamMode, USHORT nVersion ) :
+ImplCompat::ImplCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) :
mpRWStm ( &rStm ),
mnStmMode ( nStreamMode ),
mnVersion ( nVersion )
@@ -63,7 +63,7 @@ ImplCompat::~ImplCompat()
{
if( STREAM_WRITE == mnStmMode )
{
- const UINT32 nEndPos = mpRWStm->Tell();
+ const sal_uInt32 nEndPos = mpRWStm->Tell();
mpRWStm->Seek( mnCompatPos );
*mpRWStm << ( nEndPos - mnTotalSize );
@@ -71,7 +71,7 @@ ImplCompat::~ImplCompat()
}
else
{
- const UINT32 nReadSize = mpRWStm->Tell() - mnCompatPos;
+ const sal_uInt32 nReadSize = mpRWStm->Tell() - mnCompatPos;
if( mnTotalSize > nReadSize )
mpRWStm->SeekRel( mnTotalSize - nReadSize );
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 2def0fdc065d..1afa8840fcf3 100644..100755
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -110,7 +110,7 @@ namespace vcl
public:
// equivalents to the respective OutputDevice methods, which take the reference device into account
long GetTextArray( const XubString& _rText, sal_Int32* _pDXAry, xub_StrLen _nStartIndex, xub_StrLen _nLength ) const;
- Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText );
+ Rectangle DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText );
protected:
void onBeginDrawText()
@@ -310,13 +310,13 @@ namespace vcl
}
//--------------------------------------------------------------------
- Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText )
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, String* _pDisplayText )
{
if ( !_rText.Len() )
return Rectangle();
// determine text layout mode from the RTL-ness of the control whose text we render
- ULONG nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
+ sal_uLong nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
m_rReferenceDevice.SetLayoutMode( nTextLayoutMode );
m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
// TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
@@ -376,7 +376,7 @@ namespace vcl
}
//--------------------------------------------------------------------
- Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, USHORT _nStyle,
+ Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle,
MetricVector* _pVector, String* _pDisplayText )
{
return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index e08b6d820a47..981fc38b7375 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
- long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData )
+ long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
DBG_ASSERT( nBitCount <= 1,
"VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
@@ -85,7 +85,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
mnBitCount = ( nBitCount ? nBitCount : pOutDev->GetBitCount() );
mnOutWidth = nDX;
mnOutHeight = nDY;
- mbScreenComp = TRUE;
+ mbScreenComp = sal_True;
mnAlphaDepth = -1;
// #i59315# init vdev size from system object, when passed a
@@ -98,12 +98,12 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
- mbScreenComp = FALSE;
+ mbScreenComp = sal_False;
else if ( pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
mbScreenComp = ((VirtualDevice*)pOutDev)->mbScreenComp;
meOutDevType = OUTDEV_VIRDEV;
- mbDevOutput = TRUE;
+ mbDevOutput = sal_True;
mpFontList = pSVData->maGDIData.mpScreenFontList;
mpFontCache = pSVData->maGDIData.mpScreenFontCache;
mnDPIX = pOutDev->mnDPIX;
@@ -135,7 +135,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( USHORT nBitCount )
+VirtualDevice::VirtualDevice( sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -146,7 +146,7 @@ VirtualDevice::VirtualDevice( USHORT nBitCount )
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -157,7 +157,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, USHORT nAlphaBitCount )
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -171,7 +171,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, US
// -----------------------------------------------------------------------
-VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, USHORT nBitCount )
+VirtualDevice::VirtualDevice( const SystemGraphicsData *pData, sal_uInt16 nBitCount )
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
@@ -207,20 +207,20 @@ VirtualDevice::~VirtualDevice()
// -----------------------------------------------------------------------
-BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
{
OSL_TRACE( "VirtualDevice::ImplSetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
if ( !mpVirDev )
- return FALSE;
+ return sal_False;
else if ( rNewSize == GetOutputSizePixel() )
{
if ( bErase )
Erase();
- return TRUE;
+ return sal_True;
}
- BOOL bRet;
+ sal_Bool bRet;
long nNewWidth = rNewSize.Width(), nNewHeight = rNewSize.Height();
if ( nNewWidth < 1 )
@@ -249,7 +249,7 @@ BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
if ( !mpGraphics )
{
if ( !ImplGetGraphics() )
- return FALSE;
+ return sal_False;
}
pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice( mpGraphics, nNewWidth, nNewHeight, mnBitCount );
@@ -285,16 +285,16 @@ BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
mpVirDev = pNewVirDev;
mnOutWidth = rNewSize.Width();
mnOutHeight = rNewSize.Height();
- bRet = TRUE;
+ bRet = sal_True;
}
else
{
- bRet = FALSE;
+ bRet = sal_False;
pSVData->mpDefInst->DestroyVirtualDevice( pNewVirDev );
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
@@ -318,7 +318,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bErase )
{
if( ImplSetOutputSizePixel(rNewSize, bErase) )
{
@@ -347,10 +347,10 @@ BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
mpAlphaVDev->SetMapMode( GetMapMode() );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -362,7 +362,7 @@ void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode )
{
case REFDEV_NONE:
default:
- DBG_ASSERT( FALSE, "VDev::SetRefDev illegal argument!" );
+ DBG_ASSERT( sal_False, "VDev::SetRefDev illegal argument!" );
break;
case REFDEV_MODE06:
nDPIX = nDPIY = 600;
@@ -390,17 +390,17 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
mnDPIX = i_nDPIX;
mnDPIY = i_nDPIY;
- EnableOutput( FALSE ); // prevent output on reference device
- mbScreenComp = FALSE;
+ EnableOutput( sal_False ); // prevent output on reference device
+ mbScreenComp = sal_False;
// invalidate currently selected fonts
- mbInitFont = TRUE;
- mbNewFont = TRUE;
+ mbInitFont = sal_True;
+ mbNewFont = sal_True;
// avoid adjusting font lists when already in refdev mode
- BYTE nOldRefDevMode = meRefDevMode;
- BYTE nOldCompatFlag = (BYTE)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
- meRefDevMode = (BYTE)(i_eRefDevMode | nOldCompatFlag);
+ sal_uInt8 nOldRefDevMode = meRefDevMode;
+ sal_uInt8 nOldCompatFlag = (sal_uInt8)meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (sal_uInt8)(i_eRefDevMode | nOldCompatFlag);
if( (nOldRefDevMode ^ nOldCompatFlag) != REFDEV_NONE )
return;
@@ -441,7 +441,7 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
void VirtualDevice::Compat_ZeroExtleadBug()
{
- meRefDevMode = (BYTE)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
+ meRefDevMode = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 2feff9a9f5ef..600f78941cbe 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -112,7 +112,7 @@ void ImplWallpaper::ImplReleaseCachedBitmap()
SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
{
VersionCompat aCompat( rIStm, STREAM_READ );
- UINT16 nTmp16;
+ sal_uInt16 nTmp16;
delete rImplWallpaper.mpRect;
rImplWallpaper.mpRect = NULL;
@@ -130,7 +130,7 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
// version 2
if( aCompat.GetVersion() >= 2 )
{
- BOOL bRect, bGrad, bBmp, bDummy;
+ sal_Bool bRect, bGrad, bBmp, bDummy;
rIStm >> bRect >> bGrad >> bBmp >> bDummy >> bDummy >> bDummy;
@@ -155,7 +155,7 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
// version 3 (new color format)
if( aCompat.GetVersion() >= 3 )
{
- rImplWallpaper.maColor.Read( rIStm, TRUE );
+ rImplWallpaper.maColor.Read( rIStm, sal_True );
}
}
@@ -167,13 +167,13 @@ SvStream& operator>>( SvStream& rIStm, ImplWallpaper& rImplWallpaper )
SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
- BOOL bRect = ( rImplWallpaper.mpRect != NULL );
- BOOL bGrad = ( rImplWallpaper.mpGradient != NULL );
- BOOL bBmp = ( rImplWallpaper.mpBitmap != NULL );
- BOOL bDummy = FALSE;
+ sal_Bool bRect = ( rImplWallpaper.mpRect != NULL );
+ sal_Bool bGrad = ( rImplWallpaper.mpGradient != NULL );
+ sal_Bool bBmp = ( rImplWallpaper.mpBitmap != NULL );
+ sal_Bool bDummy = sal_False;
// version 1
- rOStm << rImplWallpaper.maColor << (UINT16) rImplWallpaper.meStyle;
+ rOStm << rImplWallpaper.maColor << (sal_uInt16) rImplWallpaper.meStyle;
// version 2
rOStm << bRect << bGrad << bBmp << bDummy << bDummy << bDummy;
@@ -188,14 +188,14 @@ SvStream& operator<<( SvStream& rOStm, const ImplWallpaper& rImplWallpaper )
rOStm << *rImplWallpaper.mpBitmap;
// version 3 (new color format)
- ( (Color&) rImplWallpaper.maColor ).Write( rOStm, TRUE );
+ ( (Color&) rImplWallpaper.maColor ).Write( rOStm, sal_True );
return rOStm;
}
// -----------------------------------------------------------------------
-inline void Wallpaper::ImplMakeUnique( BOOL bReleaseCache )
+inline void Wallpaper::ImplMakeUnique( sal_Bool bReleaseCache )
{
// Falls noch andere Referenzen bestehen, dann kopieren
if ( mpImplWallpaper->mnRefCount != 1 )
@@ -314,7 +314,7 @@ void Wallpaper::SetStyle( WallpaperStyle eStyle )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
if( eStyle == WALLPAPER_APPLICATIONGRADIENT )
// set a dummy gradient, the correct gradient
@@ -392,7 +392,7 @@ BitmapEx Wallpaper::GetBitmap() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsBitmap() const
+sal_Bool Wallpaper::IsBitmap() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -450,7 +450,7 @@ Gradient Wallpaper::GetGradient() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsGradient() const
+sal_Bool Wallpaper::IsGradient() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -480,7 +480,7 @@ void Wallpaper::SetRect( const Rectangle& rRect )
{
DBG_CHKTHIS( Wallpaper, NULL );
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
if ( rRect.IsEmpty() )
{
@@ -507,7 +507,7 @@ void Wallpaper::SetRect()
if ( mpImplWallpaper->mpRect )
{
- ImplMakeUnique( FALSE );
+ ImplMakeUnique( sal_False );
delete mpImplWallpaper->mpRect;
mpImplWallpaper->mpRect = NULL;
}
@@ -530,7 +530,7 @@ Rectangle Wallpaper::GetRect() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsRect() const
+sal_Bool Wallpaper::IsRect() const
{
DBG_CHKTHIS( Wallpaper, NULL );
@@ -540,26 +540,26 @@ BOOL Wallpaper::IsRect() const
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsFixed() const
+sal_Bool Wallpaper::IsFixed() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return FALSE;
+ return sal_False;
else
return (!mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient);
}
// -----------------------------------------------------------------------
-BOOL Wallpaper::IsScrollable() const
+sal_Bool Wallpaper::IsScrollable() const
{
if ( mpImplWallpaper->meStyle == WALLPAPER_NULL )
- return FALSE;
+ return sal_False;
else if ( !mpImplWallpaper->mpBitmap && !mpImplWallpaper->mpGradient )
- return TRUE;
+ return sal_True;
else if ( mpImplWallpaper->mpBitmap )
return (mpImplWallpaper->meStyle == WALLPAPER_TILE);
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -591,37 +591,37 @@ Wallpaper& Wallpaper::operator=( const Wallpaper& rWallpaper )
// -----------------------------------------------------------------------
-BOOL Wallpaper::operator==( const Wallpaper& rWallpaper ) const
+sal_Bool Wallpaper::operator==( const Wallpaper& rWallpaper ) const
{
DBG_CHKTHIS( Wallpaper, NULL );
DBG_CHKOBJ( &rWallpaper, Wallpaper, NULL );
if ( mpImplWallpaper == rWallpaper.mpImplWallpaper )
- return TRUE;
+ return sal_True;
if ( ( mpImplWallpaper->meStyle != rWallpaper.mpImplWallpaper->meStyle ) ||
( mpImplWallpaper->maColor != rWallpaper.mpImplWallpaper->maColor ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpRect != rWallpaper.mpImplWallpaper->mpRect
&& ( !mpImplWallpaper->mpRect
|| !rWallpaper.mpImplWallpaper->mpRect
|| *(mpImplWallpaper->mpRect) != *(rWallpaper.mpImplWallpaper->mpRect) ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpBitmap != rWallpaper.mpImplWallpaper->mpBitmap
&& ( !mpImplWallpaper->mpBitmap
|| !rWallpaper.mpImplWallpaper->mpBitmap
|| *(mpImplWallpaper->mpBitmap) != *(rWallpaper.mpImplWallpaper->mpBitmap) ) )
- return FALSE;
+ return sal_False;
if ( mpImplWallpaper->mpGradient != rWallpaper.mpImplWallpaper->mpGradient
&& ( !mpImplWallpaper->mpGradient
|| !rWallpaper.mpImplWallpaper->mpGradient
|| *(mpImplWallpaper->mpGradient) != *(rWallpaper.mpImplWallpaper->mpGradient) ) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 3a285e1338bc..52c80febe64b 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -314,7 +314,7 @@ const void * graphiteFontTable(const void* appFaceHandle, unsigned int name, siz
tableId.m_id = swapped.m_id;
#endif
tableId.m_c[4] = '\0';
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
const void * pTable = static_cast<const void*>(pFontInfo->GetTable(tableId.m_c, &nLength));
if (len) *len = static_cast<size_t>(nLength);
return pTable;
@@ -338,6 +338,7 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
#endif
mnFontId( nFontId ),
maDevFontAttributes( rDevFontAttributes ),
+ mpFontCharMap( NULL ),
mpChar2Glyph( NULL ),
mpGlyph2Char( NULL ),
mpExtraKernInfo( pExtraKernInfo )
@@ -355,6 +356,8 @@ FtFontInfo::FtFontInfo( const ImplDevFontAttributes& rDevFontAttributes,
FtFontInfo::~FtFontInfo()
{
+ if( mpFontCharMap )
+ mpFontCharMap->DeReference();
delete mpExtraKernInfo;
delete mpChar2Glyph;
delete mpGlyph2Char;
@@ -469,7 +472,7 @@ static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
// -----------------------------------------------------------------------
-const unsigned char* FtFontInfo::GetTable( const char* pTag, ULONG* pLength ) const
+const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
{
const unsigned char* pBuffer = mpFontFile->GetBuffer();
int nFileSize = mpFontFile->GetFileSize();
@@ -492,7 +495,7 @@ const unsigned char* FtFontInfo::GetTable( const char* pTag, ULONG* pLength ) co
{
if( p[0]==pTag[0] && p[1]==pTag[1] && p[2]==pTag[2] && p[3]==pTag[3] )
{
- ULONG nLength = GetUInt( p + 12 );
+ sal_uLong nLength = GetUInt( p + 12 );
if( pLength != NULL )
*pLength = nLength;
const unsigned char* pTable = pBuffer + GetUInt( p + 8 );
@@ -1097,7 +1100,7 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
// Check for CJK capabilities of the current font
// #107888# workaround for Asian...
// TODO: remove when ExtLeading fully implemented
- BOOL bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
+ sal_Bool bCJKCapable = ((pOS2->ulUnicodeRange2 & 0x2DF00000) != 0);
if ( bCJKCapable && (pOS2->usWinAscent || pOS2->usWinDescent) )
{
@@ -1524,7 +1527,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
// #i15743# freetype API 2.1.3 changed the FT_RENDER_MODE_MONO constant
FT_Render_Mode nRenderMode = (FT_Render_Mode)((nFTVERSION<2103) ? 1 : FT_RENDER_MODE_MONO);
- rc = FT_Glyph_To_Bitmap( &pGlyphFT, nRenderMode, NULL, TRUE );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, nRenderMode, NULL, sal_True );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1552,7 +1555,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
rRawBitmap.mnScanlineSize = rBitmapFT.pitch;
}
- const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
@@ -1578,10 +1581,10 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
}
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( ULONG x=0; x < rRawBitmap.mnScanlineSize; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnScanlineSize; x++ )
{
unsigned char nTmp = p[x] << 7;
p[x] |= (p[x] >> 1) | nLastByte;
@@ -1679,7 +1682,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
bool bEmbedded = (pGlyphFT->format == FT_GLYPH_FORMAT_BITMAP);
if( !bEmbedded )
{
- rc = FT_Glyph_To_Bitmap( &pGlyphFT, FT_RENDER_MODE_NORMAL, NULL, TRUE );
+ rc = FT_Glyph_To_Bitmap( &pGlyphFT, FT_RENDER_MODE_NORMAL, NULL, sal_True );
if( rc != FT_Err_Ok )
{
FT_Done_Glyph( pGlyphFT );
@@ -1703,7 +1706,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
}
rRawBitmap.mnScanlineSize = (rRawBitmap.mnScanlineSize + 3) & -4;
- const ULONG nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
+ const sal_uLong nNeededSize = rRawBitmap.mnScanlineSize * rRawBitmap.mnHeight;
if( rRawBitmap.mnAllocated < nNeededSize )
{
delete[] rRawBitmap.mpBits;
@@ -1743,10 +1746,10 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
{
// overlay with glyph image shifted by one left pixel
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
unsigned char nLastByte = 0;
- for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
{
unsigned char nTmp = p[x];
p[x] |= p[x] | nLastByte;
@@ -1759,9 +1762,9 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
if( !bEmbedded && mbUseGamma )
{
unsigned char* p = rRawBitmap.mpBits;
- for( ULONG y=0; y < rRawBitmap.mnHeight; y++ )
+ for( sal_uLong y=0; y < rRawBitmap.mnHeight; y++ )
{
- for( ULONG x=0; x < rRawBitmap.mnWidth; x++ )
+ for( sal_uLong x=0; x < rRawBitmap.mnWidth; x++ )
{
p[x] = aGammaTable[ p[x] ];
}
@@ -1789,16 +1792,39 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
// determine unicode ranges in font
// -----------------------------------------------------------------------
-// TODO: replace with GetFontCharMap()
-bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const
+const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
{
- rResult.mbSymbolic = mpFontInfo->IsSymbolFont();
+ const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
+ return pIFCMap;
+}
+
+const ImplFontCharMap* FtFontInfo::GetImplFontCharMap( void )
+{
+ // check if the charmap is already cached
+ if( mpFontCharMap )
+ return mpFontCharMap;
+
+ // get the charmap and cache it
+ CmapResult aCmapResult;
+ bool bOK = GetFontCodeRanges( aCmapResult );
+ if( bOK )
+ mpFontCharMap = new ImplFontCharMap( aCmapResult );
+ else
+ mpFontCharMap = ImplFontCharMap::GetDefaultMap();
+ mpFontCharMap->AddReference();
+ return mpFontCharMap;
+}
+
+// TODO: merge into method GetFontCharMap()
+bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
+{
+ rResult.mbSymbolic = IsSymbolFont();
// TODO: is the full CmapResult needed on platforms calling this?
if( FT_IS_SFNT( maFaceFT ) )
{
- ULONG nLength = 0;
- const unsigned char* pCmap = mpFontInfo->GetTable( "cmap", &nLength );
+ sal_uLong nLength = 0;
+ const unsigned char* pCmap = GetTable( "cmap", &nLength );
if( pCmap && (nLength > 0) )
if( ParseCMAP( pCmap, nLength, rResult ) )
return true;
@@ -1843,7 +1869,7 @@ bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabil
{
bool bRet = false;
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
// load GSUB table
const FT_Byte* pGSUB = mpFontInfo->GetTable("GSUB", &nLength);
if (pGSUB)
@@ -1896,7 +1922,7 @@ int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) con
// -----------------------------------------------------------------------
-ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
+sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
// if no kerning info is available in the font file
*ppKernPairs = NULL;
@@ -1922,7 +1948,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
pFTActivateSize( maSizeFT );
// first figure out which glyph pairs are involved in kerning
- ULONG nKernLength = 0;
+ sal_uLong nKernLength = 0;
const FT_Byte* const pKern = mpFontInfo->GetTable( "kern", &nKernLength );
if( !pKern )
return 0;
@@ -1940,19 +1966,19 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
aKernPair.mnKern = 0; // To prevent "is used uninitialized" warning...
const FT_Byte* pBuffer = pKern;
- ULONG nVersion = GetUShort( pBuffer+0 );
- USHORT nTableCnt = GetUShort( pBuffer+2 );
+ sal_uLong nVersion = GetUShort( pBuffer+0 );
+ sal_uInt16 nTableCnt = GetUShort( pBuffer+2 );
// Microsoft/Old TrueType style kern table
if ( nVersion == 0 )
{
pBuffer += 4;
- for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- // USHORT nSubVersion = GetUShort( pBuffer+0 );
- // USHORT nSubLength = GetUShort( pBuffer+2 );
- USHORT nSubCoverage = GetUShort( pBuffer+4 );
+ // sal_uInt16 nSubVersion = GetUShort( pBuffer+0 );
+ // sal_uInt16 nSubLength = GetUShort( pBuffer+2 );
+ sal_uInt16 nSubCoverage = GetUShort( pBuffer+4 );
pBuffer += 6;
if( (nSubCoverage&0x03) != 0x01 ) // no interest in minimum info here
continue;
@@ -1960,7 +1986,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
case 0: // version 0, kerning format 0
{
- USHORT nPairs = GetUShort( pBuffer );
+ sal_uInt16 nPairs = GetUShort( pBuffer );
pBuffer += 8; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -1977,21 +2003,21 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = pBuffer;
- //USHORT nRowWidth = GetUShort( pBuffer+0 );
- USHORT nOfsLeft = GetUShort( pBuffer+2 );
- USHORT nOfsRight = GetUShort( pBuffer+4 );
- USHORT nOfsArray = GetUShort( pBuffer+6 );
+ //sal_uInt16 nRowWidth = GetUShort( pBuffer+0 );
+ sal_uInt16 nOfsLeft = GetUShort( pBuffer+2 );
+ sal_uInt16 nOfsRight = GetUShort( pBuffer+4 );
+ sal_uInt16 nOfsArray = GetUShort( pBuffer+6 );
pBuffer += 8;
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- USHORT nFirstLeft = GetUShort( pTmp+0 );
- USHORT nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
+ sal_uInt16 nFirstLeft = GetUShort( pTmp+0 );
+ sal_uInt16 nLastLeft = GetUShort( pTmp+2 ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- USHORT nFirstRight = GetUShort( pTmp+0 );
- USHORT nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
+ sal_uInt16 nFirstRight = GetUShort( pTmp+0 );
+ sal_uInt16 nLastRight = GetUShort( pTmp+2 ) + nFirstRight - 1;
- ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2020,11 +2046,11 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
nTableCnt = NEXT_U32( pBuffer );
if ( nVersion == 0x00010000 )
{
- for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
+ for( sal_uInt16 nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
{
- /*ULONG nLength =*/ NEXT_U32( pBuffer );
- USHORT nCoverage = NEXT_U16( pBuffer );
- /*USHORT nTupleIndex =*/ NEXT_U16( pBuffer );
+ /*sal_uLong nLength =*/ NEXT_U32( pBuffer );
+ sal_uInt16 nCoverage = NEXT_U16( pBuffer );
+ /*sal_uInt16 nTupleIndex =*/ NEXT_U16( pBuffer );
// Kerning sub-table format, 0 through 3
sal_uInt8 nSubTableFormat = nCoverage & 0x00FF;
@@ -2033,7 +2059,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
{
case 0: // version 0, kerning format 0
{
- USHORT nPairs = NEXT_U16( pBuffer );
+ sal_uInt16 nPairs = NEXT_U16( pBuffer );
pBuffer += 6; // skip search hints
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
for( int i = 0; i < nPairs; ++i )
@@ -2049,20 +2075,20 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
case 2: // version 0, kerning format 2
{
const FT_Byte* pSubTable = pBuffer;
- /*USHORT nRowWidth =*/ NEXT_U16( pBuffer );
- USHORT nOfsLeft = NEXT_U16( pBuffer );
- USHORT nOfsRight = NEXT_U16( pBuffer );
- USHORT nOfsArray = NEXT_U16( pBuffer );
+ /*sal_uInt16 nRowWidth =*/ NEXT_U16( pBuffer );
+ sal_uInt16 nOfsLeft = NEXT_U16( pBuffer );
+ sal_uInt16 nOfsRight = NEXT_U16( pBuffer );
+ sal_uInt16 nOfsArray = NEXT_U16( pBuffer );
const FT_Byte* pTmp = pSubTable + nOfsLeft;
- USHORT nFirstLeft = NEXT_U16( pTmp );
- USHORT nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
+ sal_uInt16 nFirstLeft = NEXT_U16( pTmp );
+ sal_uInt16 nLastLeft = NEXT_U16( pTmp ) + nFirstLeft - 1;
pTmp = pSubTable + nOfsRight;
- USHORT nFirstRight = NEXT_U16( pTmp );
- USHORT nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
+ sal_uInt16 nFirstRight = NEXT_U16( pTmp );
+ sal_uInt16 nLastRight = NEXT_U16( pTmp ) + nFirstRight - 1;
- ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
+ sal_uLong nPairs = (sal_uLong)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
pTmp = pSubTable + nOfsArray;
@@ -2089,17 +2115,17 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
}
// now create VCL's ImplKernPairData[] format for all glyph pairs
- ULONG nKernCount = aKernGlyphVector.size();
+ sal_uLong nKernCount = aKernGlyphVector.size();
if( nKernCount )
{
// prepare glyphindex to character mapping
// TODO: this is needed to support VCL's existing kerning infrastructure,
// eliminate it up by redesigning kerning infrastructure to work with glyph indizes
- typedef boost::unordered_multimap<USHORT,sal_Unicode> Cmap;
+ typedef boost::unordered_multimap<sal_uInt16,sal_Unicode> Cmap;
Cmap aCmap;
for( sal_Unicode aChar = 0x0020; aChar < 0xFFFE; ++aChar )
{
- USHORT nGlyphIndex = GetGlyphIndex( aChar );
+ sal_uInt16 nGlyphIndex = GetGlyphIndex( aChar );
if( nGlyphIndex )
aCmap.insert( Cmap::value_type( nGlyphIndex, aChar ) );
}
@@ -2154,7 +2180,7 @@ ULONG FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
class PolyArgs
{
public:
- PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints );
+ PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints );
~PolyArgs();
void AddPoint( long nX, long nY, PolyFlags);
@@ -2167,19 +2193,19 @@ private:
PolyPolygon& mrPolyPoly;
Point* mpPointAry;
- BYTE* mpFlagAry;
+ sal_uInt8* mpFlagAry;
FT_Vector maPosition;
- USHORT mnMaxPoints;
- USHORT mnPoints;
- USHORT mnPoly;
+ sal_uInt16 mnMaxPoints;
+ sal_uInt16 mnPoints;
+ sal_uInt16 mnPoly;
long mnHeight;
bool bHasOffline;
};
// -----------------------------------------------------------------------
-PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints )
+PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints )
: mrPolyPoly(rPolyPoly),
mnMaxPoints(nMaxPoints),
mnPoints(0),
@@ -2188,7 +2214,7 @@ PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, USHORT nMaxPoints )
bHasOffline(false)
{
mpPointAry = new Point[ mnMaxPoints ];
- mpFlagAry = new BYTE [ mnMaxPoints ];
+ mpFlagAry = new sal_uInt8 [ mnMaxPoints ];
}
// -----------------------------------------------------------------------
@@ -2396,56 +2422,56 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
#define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
- typedef std::vector<ULONG> ReqFeatureTagList;
+ typedef std::vector<sal_uLong> ReqFeatureTagList;
ReqFeatureTagList aReqFeatureTagList;
if( rFSD.mbVertical )
aReqFeatureTagList.push_back( MKTAG("vert") );
- ULONG nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
- ULONG nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys?
+ sal_uLong nRequestedScript = 0; //MKTAG("hani");//### TODO: where to get script?
+ sal_uLong nRequestedLangsys = 0; //MKTAG("ZHT"); //### TODO: where to get langsys?
// TODO: request more features depending on script and language system
if( aReqFeatureTagList.size() == 0) // nothing to do
return true;
// load GSUB table into memory
- ULONG nLength = 0;
+ sal_uLong nLength = 0;
const FT_Byte* const pGsubBase = mpFontInfo->GetTable( "GSUB", &nLength );
if( !pGsubBase )
return false;
// parse GSUB header
const FT_Byte* pGsubHeader = pGsubBase;
- const USHORT nOfsScriptList = GetUShort( pGsubHeader+4 );
- const USHORT nOfsFeatureTable = GetUShort( pGsubHeader+6 );
- const USHORT nOfsLookupList = GetUShort( pGsubHeader+8 );
+ const sal_uInt16 nOfsScriptList = GetUShort( pGsubHeader+4 );
+ const sal_uInt16 nOfsFeatureTable = GetUShort( pGsubHeader+6 );
+ const sal_uInt16 nOfsLookupList = GetUShort( pGsubHeader+8 );
pGsubHeader += 10;
- typedef std::vector<USHORT> UshortList;
+ typedef std::vector<sal_uInt16> UshortList;
UshortList aFeatureIndexList;
UshortList aFeatureOffsetList;
// parse Script Table
const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
- const USHORT nCntScript = GetUShort( pScriptHeader+0 );
+ const sal_uInt16 nCntScript = GetUShort( pScriptHeader+0 );
pScriptHeader += 2;
- for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
+ for( sal_uInt16 nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
{
- const ULONG nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
- const USHORT nOfsScriptTable= GetUShort( pScriptHeader+4 );
+ const sal_uLong nScriptTag = GetUInt( pScriptHeader+0 ); // e.g. hani/arab/kana/hang
+ const sal_uInt16 nOfsScriptTable= GetUShort( pScriptHeader+4 );
pScriptHeader += 6; //###
if( (nScriptTag != nRequestedScript) && (nRequestedScript != 0) )
continue;
const FT_Byte* pScriptTable = pGsubBase + nOfsScriptList + nOfsScriptTable;
- const USHORT nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
- const USHORT nCntLangSystem = GetUShort( pScriptTable+2 );
+ const sal_uInt16 nDefaultLangsysOfs = GetUShort( pScriptTable+0 );
+ const sal_uInt16 nCntLangSystem = GetUShort( pScriptTable+2 );
pScriptTable += 4;
- USHORT nLangsysOffset = 0;
+ sal_uInt16 nLangsysOffset = 0;
- for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
+ for( sal_uInt16 nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
- const ULONG nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
- const USHORT nOffset= GetUShort( pScriptTable+4 );
+ const sal_uLong nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
+ const sal_uInt16 nOffset= GetUShort( pScriptTable+4 );
pScriptTable += 6;
if( (nTag != nRequestedLangsys) && (nRequestedLangsys != 0) )
continue;
@@ -2456,13 +2482,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
- const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
- const USHORT nCntFeature = GetUShort( pLangSys+4 );
+ const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = GetUShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2471,13 +2497,13 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
if( nLangsysOffset != 0 )
{
const FT_Byte* pLangSys = pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
- const USHORT nReqFeatureIdx = GetUShort( pLangSys+2 );
- const USHORT nCntFeature = GetUShort( pLangSys+4 );
+ const sal_uInt16 nReqFeatureIdx = GetUShort( pLangSys+2 );
+ const sal_uInt16 nCntFeature = GetUShort( pLangSys+4 );
pLangSys += 6;
aFeatureIndexList.push_back( nReqFeatureIdx );
- for( USHORT i = 0; i < nCntFeature; ++i )
+ for( sal_uInt16 i = 0; i < nCntFeature; ++i )
{
- const USHORT nFeatureIndex = GetUShort( pLangSys );
+ const sal_uInt16 nFeatureIndex = GetUShort( pLangSys );
pLangSys += 2;
aFeatureIndexList.push_back( nFeatureIndex );
}
@@ -2492,12 +2518,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Feature Table
const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
- const USHORT nCntFeature = GetUShort( pFeatureHeader );
+ const sal_uInt16 nCntFeature = GetUShort( pFeatureHeader );
pFeatureHeader += 2;
- for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
+ for( sal_uInt16 nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
{
- const ULONG nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
- const USHORT nOffset= GetUShort( pFeatureHeader+4 );
+ const sal_uLong nTag = GetUInt( pFeatureHeader+0 ); // e.g. locl/vert/trad/smpl/liga/fina/...
+ const sal_uInt16 nOffset= GetUShort( pFeatureHeader+4 );
pFeatureHeader += 6;
// short circuit some feature lookups
@@ -2512,11 +2538,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
}
const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
- const USHORT nCntLookups = GetUShort( pFeatureTable+0 );
+ const sal_uInt16 nCntLookups = GetUShort( pFeatureTable+0 );
pFeatureTable += 2;
- for( USHORT i = 0; i < nCntLookups; ++i )
+ for( sal_uInt16 i = 0; i < nCntLookups; ++i )
{
- const USHORT nLookupIndex = GetUShort( pFeatureTable );
+ const sal_uInt16 nLookupIndex = GetUShort( pFeatureTable );
pFeatureTable += 2;
aLookupIndexList.push_back( nLookupIndex );
}
@@ -2526,11 +2552,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// parse Lookup List
const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
- const USHORT nCntLookupTable = GetUShort( pLookupHeader );
+ const sal_uInt16 nCntLookupTable = GetUShort( pLookupHeader );
pLookupHeader += 2;
- for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
+ for( sal_uInt16 nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
{
- const USHORT nOffset = GetUShort( pLookupHeader );
+ const sal_uInt16 nOffset = GetUShort( pLookupHeader );
pLookupHeader += 2;
if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
aLookupOffsetList.push_back( nOffset );
@@ -2539,43 +2565,43 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
UshortList::const_iterator lookup_it = aLookupOffsetList.begin();
for(; lookup_it != aLookupOffsetList.end(); ++lookup_it )
{
- const USHORT nOfsLookupTable = *lookup_it;
+ const sal_uInt16 nOfsLookupTable = *lookup_it;
const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
- const USHORT eLookupType = GetUShort( pLookupTable+0 );
- const USHORT nCntLookupSubtable = GetUShort( pLookupTable+4 );
+ const sal_uInt16 eLookupType = GetUShort( pLookupTable+0 );
+ const sal_uInt16 nCntLookupSubtable = GetUShort( pLookupTable+4 );
pLookupTable += 6;
// TODO: switch( eLookupType )
if( eLookupType != 1 ) // TODO: once we go beyond SingleSubst
continue;
- for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
+ for( sal_uInt16 nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
{
- const USHORT nOfsSubLookupTable = GetUShort( pLookupTable );
+ const sal_uInt16 nOfsSubLookupTable = GetUShort( pLookupTable );
pLookupTable += 2;
const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
- const USHORT nFmtSubstitution = GetUShort( pSubLookup+0 );
- const USHORT nOfsCoverage = GetUShort( pSubLookup+2 );
+ const sal_uInt16 nFmtSubstitution = GetUShort( pSubLookup+0 );
+ const sal_uInt16 nOfsCoverage = GetUShort( pSubLookup+2 );
pSubLookup += 4;
- typedef std::pair<USHORT,USHORT> GlyphSubst;
+ typedef std::pair<sal_uInt16,sal_uInt16> GlyphSubst;
typedef std::vector<GlyphSubst> SubstVector;
SubstVector aSubstVector;
const FT_Byte* pCoverage = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
- const USHORT nFmtCoverage = GetUShort( pCoverage+0 );
+ const sal_uInt16 nFmtCoverage = GetUShort( pCoverage+0 );
pCoverage += 2;
switch( nFmtCoverage )
{
case 1: // Coverage Format 1
{
- const USHORT nCntGlyph = GetUShort( pCoverage );
+ const sal_uInt16 nCntGlyph = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.reserve( nCntGlyph );
- for( USHORT i = 0; i < nCntGlyph; ++i )
+ for( sal_uInt16 i = 0; i < nCntGlyph; ++i )
{
- const USHORT nGlyphId = GetUShort( pCoverage );
+ const sal_uInt16 nGlyphId = GetUShort( pCoverage );
pCoverage += 2;
aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
}
@@ -2584,16 +2610,16 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Coverage Format 2
{
- const USHORT nCntRange = GetUShort( pCoverage );
+ const sal_uInt16 nCntRange = GetUShort( pCoverage );
pCoverage += 2;
for( int i = nCntRange; --i >= 0; )
{
- const UINT32 nGlyph0 = GetUShort( pCoverage+0 );
- const UINT32 nGlyph1 = GetUShort( pCoverage+2 );
- const USHORT nCovIdx = GetUShort( pCoverage+4 );
+ const sal_uInt32 nGlyph0 = GetUShort( pCoverage+0 );
+ const sal_uInt32 nGlyph1 = GetUShort( pCoverage+2 );
+ const sal_uInt16 nCovIdx = GetUShort( pCoverage+4 );
pCoverage += 6;
- for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
+ for( sal_uInt32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<sal_uInt16>(j + nCovIdx), 0 ) );
}
}
break;
@@ -2605,7 +2631,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
{
case 1: // Single Substitution Format 1
{
- const USHORT nDeltaGlyphId = GetUShort( pSubLookup );
+ const sal_uInt16 nDeltaGlyphId = GetUShort( pSubLookup );
pSubLookup += 2;
for(; it != aSubstVector.end(); ++it )
(*it).second = (*it).first + nDeltaGlyphId;
@@ -2614,11 +2640,11 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
case 2: // Single Substitution Format 2
{
- const USHORT nCntGlyph = GetUShort( pSubLookup );
+ const sal_uInt16 nCntGlyph = GetUShort( pSubLookup );
pSubLookup += 2;
for( int i = nCntGlyph; (it != aSubstVector.end()) && (--i>=0); ++it )
{
- const USHORT nGlyphId = GetUShort( pSubLookup );
+ const sal_uInt16 nGlyphId = GetUShort( pSubLookup );
pSubLookup += 2;
(*it).second = nGlyphId;
}
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index 0313406d30ea..caf8bfab1f9c 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -82,7 +82,7 @@ public:
const ExtraKernInfo* );
~FtFontInfo();
- const unsigned char* GetTable( const char*, ULONG* pLength=0 ) const;
+ const unsigned char* GetTable( const char*, sal_uLong* pLength=0 ) const;
FT_FaceRec_* GetFaceFT();
#ifdef ENABLE_GRAPHITE
@@ -102,6 +102,9 @@ public:
int GetGlyphIndex( sal_UCS4 cChar ) const;
void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const;
+ bool GetFontCodeRanges( CmapResult& ) const;
+ const ImplFontCharMap* GetImplFontCharMap( void );
+
bool HasExtraKerning() const;
int GetExtraKernPairs( ImplKernPairData** ) const;
int GetExtraGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
@@ -119,6 +122,8 @@ private:
sal_IntPtr mnFontId;
ImplDevFontAttributes maDevFontAttributes;
+ const ImplFontCharMap* mpFontCharMap;
+
// cache unicode->glyphid mapping because looking it up is expensive
// TODO: change to boost::unordered_multimap when a use case requires a m:n mapping
typedef ::boost::unordered_map<int,int> Int2IntMap;
@@ -193,6 +198,7 @@ public:
virtual bool NeedsArtificialItalic() const { return mbArtItalic; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+ virtual const ImplFontCharMap* GetImplFontCharMap( void ) const;
virtual int GetGlyphIndex( sal_UCS4 ) const;
int GetRawGlyphIndex( sal_UCS4 ) const;
@@ -203,9 +209,9 @@ public:
virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
virtual bool GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const;
virtual int GetGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const;
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const;
- const unsigned char* GetTable( const char* pName, ULONG* pLength )
+ const unsigned char* GetTable( const char* pName, sal_uLong* pLength )
{ return mpFontInfo->GetTable( pName, pLength ); }
int GetEmUnits() const;
const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
@@ -218,7 +224,6 @@ protected:
int ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
- virtual bool GetFontCodeRanges( CmapResult& ) const;
virtual bool GetFontCapabilities(vcl::FontCapabilities &) const;
bool ApplyGSUB( const ImplFontSelectData& );
virtual ServerFontLayoutEngine* GetLayoutEngine();
diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx
index d1b99bcd85e1..63a332869664 100644..100755
--- a/vcl/source/glyphs/gcach_layout.cxx
+++ b/vcl/source/glyphs/gcach_layout.cxx
@@ -229,7 +229,7 @@ const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
pTagName[3] = (char)(nICUTableTag);
pTagName[4] = 0;
- ULONG nLength;
+ sal_uLong nLength;
const unsigned char* pBuffer = mrServerFont.GetTable( pTagName, &nLength );
#ifdef VERBOSE_DEBUG
fprintf(stderr,"IcuGetTable(\"%s\") => %p\n", pTagName, pBuffer);
diff --git a/vcl/source/glyphs/gcach_rbmp.cxx b/vcl/source/glyphs/gcach_rbmp.cxx
index f951590b4b45..161e4c6314e7 100644..100755
--- a/vcl/source/glyphs/gcach_rbmp.cxx
+++ b/vcl/source/glyphs/gcach_rbmp.cxx
@@ -172,9 +172,9 @@ static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2,
bool RawBitmap::Rotate( int nAngle )
{
- ULONG nNewScanlineSize = 0;
- ULONG nNewHeight = 0;
- ULONG nNewWidth = 0;
+ sal_uLong nNewScanlineSize = 0;
+ sal_uLong nNewHeight = 0;
+ sal_uLong nNewWidth = 0;
// do inplace rotation or prepare double buffered rotation
switch( nAngle )
diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx
index 7a090de30128..944d9aee16a3 100644
--- a/vcl/source/glyphs/gcach_vdev.cxx
+++ b/vcl/source/glyphs/gcach_vdev.cxx
@@ -138,7 +138,7 @@ void VirtDevServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
rTo.meWeight = aFSD.meWeight;
rTo.meItalic = aFSD.meItalic;
rTo.mePitch = aFSD.mePitch;
- rTo.mbDevice = FALSE;
+ rTo.mbDevice = sal_False;
}
// -----------------------------------------------------------------------
@@ -195,7 +195,7 @@ bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const
String aGlyphStr( &aChar, 1 );
// draw bitmap
- vdev.SetOutputSizePixel( aSize, TRUE );
+ vdev.SetOutputSizePixel( aSize, sal_True );
vdev.DrawText( Point(0,0)-rGD.GetMetric().GetOffset(), aGlyphStr );
// create new glyph item
@@ -223,7 +223,7 @@ int VirtDevServerFont::GetGlyphKernValue( int, int ) const
// -----------------------------------------------------------------------
-ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
+sal_uLong VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const
{
Font aFont;
aFont.SetName ( GetFontSelData().maName );
@@ -236,7 +236,7 @@ ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) cons
VirtualDevice vdev( 1 );
vdev.SetFont( aFont );
- ULONG nPairs = vdev.GetKerningPairCount();
+ sal_uLong nPairs = vdev.GetKerningPairCount();
if( nPairs > 0 )
{
KerningPair* const pKernPairs = new KerningPair[ nPairs ];
@@ -245,7 +245,7 @@ ULONG VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) cons
*ppImplKernPairs = new ImplKernPairData[ nPairs ];
ImplKernPairData* pTo = *ppImplKernPairs;
KerningPair* pFrom = pKernPairs;
- for ( ULONG n = 0; n < nPairs; n++ )
+ for ( sal_uLong n = 0; n < nPairs; n++ )
{
pTo->mnChar1 = pFrom->nChar1;
pTo->mnChar2 = pFrom->nChar2;
diff --git a/vcl/source/glyphs/gcach_vdev.hxx b/vcl/source/glyphs/gcach_vdev.hxx
index 48d602677c16..61cd02b1f9cc 100644
--- a/vcl/source/glyphs/gcach_vdev.hxx
+++ b/vcl/source/glyphs/gcach_vdev.hxx
@@ -45,7 +45,7 @@ protected:
static VirtDevServerFont* CreateFont( const ImplFontSelectData& );
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
- virtual ULONG GetKernPairs( ImplKernPairData** ) const;
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const;
virtual int GetGlyphKernValue( int, int ) const;
virtual int GetGlyphIndex( sal_Unicode ) const;
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index 6824b7d70ac8..deef658c0c56 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -85,6 +85,18 @@ GlyphCache::~GlyphCache()
void GlyphCache::InvalidateAllGlyphs()
{
+ // an application about to exit can omit garbage collecting the heap
+ // since it makes things slower and introduces risks if the heap was not perfect
+ // for debugging, for memory grinding or leak checking the env allows to force GC
+ const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" );
+ if( pEnv && (*pEnv != '0') )
+ {
+ // uncache of all glyph shapes and metrics
+ for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it )
+ delete const_cast<ServerFont*>( it->second );
+ maFontList.clear();
+ mpCurrentGCFont = NULL;
+ }
}
// -----------------------------------------------------------------------
@@ -289,9 +301,9 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
// -----------------------------------------------------------------------
-ULONG GlyphCache::CalcByteCount() const
+sal_uLong GlyphCache::CalcByteCount() const
{
- ULONG nCacheSize = sizeof(*this);
+ sal_uLong nCacheSize = sizeof(*this);
for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
{
const ServerFont* pSF = it->second;
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 9d02c5fa6b88..76db71bfb0dc 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -920,7 +920,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size()));
if (nChar2BaseJ != -1 )
{
- nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1);
+ nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1);
nLastChar = j - 1;
break;
}
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index fc15cc77dcce..3138c55b2bb5 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -66,7 +66,7 @@ namespace
}
}
-void VclCanvasBitmap::setComponentInfo( ULONG redShift, ULONG greenShift, ULONG blueShift )
+void VclCanvasBitmap::setComponentInfo( sal_uLong redShift, sal_uLong greenShift, sal_uLong blueShift )
{
// sort channels in increasing order of appearance in the pixel
// (starting with the least significant bits)
@@ -683,14 +683,14 @@ sal_Bool SAL_CALL VclCanvasBitmap::getIndex( uno::Sequence< double >& o_entry, s
{
SolarMutexGuard aGuard;
- const USHORT nCount( m_pBmpAcc ?
+ const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
if( nIndex < 0 || nIndex >= nCount )
throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Palette index out of range")),
static_cast<rendering::XBitmapPalette*>(this));
- const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<USHORT>(nIndex));
+ const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<sal_uInt16>(nIndex));
o_entry.realloc(3);
double* pColor=o_entry.getArray();
pColor[0] = aCol.GetRed();
@@ -704,7 +704,7 @@ sal_Bool SAL_CALL VclCanvasBitmap::setIndex( const uno::Sequence< double >&, sal
{
SolarMutexGuard aGuard;
- const USHORT nCount( m_pBmpAcc ?
+ const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
@@ -788,7 +788,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
*pOut++ = rendering::RGBColor(toDoubleColor(aCol.GetRed()),
@@ -837,7 +837,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -890,7 +890,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -1086,7 +1086,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co
for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel )
{
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(deviceColor[i+m_nIndexIndex]));
+ sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex]));
// TODO(F3): Convert result to sRGB color space
const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 );
@@ -1146,7 +1146,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1182,7 +1182,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1201,7 +1201,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1239,7 +1239,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1259,7 +1259,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA
{
SolarMutexGuard aGuard;
- const BYTE* pIn( reinterpret_cast<const BYTE*>(deviceColor.getConstArray()) );
+ const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel);
@@ -1298,7 +1298,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA
const BitmapColor aCol =
m_bPalette ?
m_pBmpAcc->GetPaletteColor(
- sal::static_int_cast<USHORT>(
+ sal::static_int_cast<sal_uInt16>(
m_pBmpAcc->GetPixelFromData(
pIn, i ))) :
m_pBmpAcc->GetPixelFromData(pIn, i);
@@ -1322,7 +1322,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1335,12 +1335,12 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
pColors += nNonAlphaBytes;
- *pColors++ = BYTE(255);
+ *pColors++ = sal_uInt8(255);
}
}
else
@@ -1353,7 +1353,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
@@ -1371,7 +1371,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1384,7 +1384,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
@@ -1402,7 +1402,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
@@ -1420,7 +1420,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
uno::Sequence< sal_Int8 > aRes(nNumBytes);
- BYTE* pColors=reinterpret_cast<BYTE*>(aRes.getArray());
+ sal_uInt8* pColors=reinterpret_cast<sal_uInt8*>(aRes.getArray());
if( m_aBmpEx.IsTransparent() )
{
@@ -1434,7 +1434,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
@@ -1452,7 +1452,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
const BitmapColor aCol2 =
m_bPalette ?
BitmapColor(
- sal::static_int_cast<BYTE>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
+ sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
aCol;
m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index 005d544b9e02..3bf73ca7588d 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -117,11 +117,11 @@ namespace vcl
{
RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::polygonFromPoint2DSequence()" );
- const USHORT nCurrSize( sal::static_int_cast<USHORT>(points.getLength()) );
+ const sal_uInt16 nCurrSize( sal::static_int_cast<sal_uInt16>(points.getLength()) );
::Polygon aPoly( nCurrSize );
- USHORT nCurrPoint;
+ sal_uInt16 nCurrPoint;
for( nCurrPoint=0; nCurrPoint<nCurrSize; ++nCurrPoint )
aPoly[nCurrPoint] = pointFromRealPoint2D( points[nCurrPoint] );
@@ -255,7 +255,7 @@ namespace vcl
{
const rendering::ARGBColor& rColor=aARGBColors[x];
rWriteAcc->SetPixel( aRect.Y1, x,
- (BYTE)rWriteAcc->GetBestPaletteIndex(
+ (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
BitmapColor( toByteColor(rColor.Red),
toByteColor(rColor.Green),
toByteColor(rColor.Blue))) );
@@ -287,7 +287,7 @@ namespace vcl
{
const rendering::RGBColor& rColor=aRGBColors[x];
rWriteAcc->SetPixel( aRect.Y1, x,
- (BYTE)rWriteAcc->GetBestPaletteIndex(
+ (sal_uInt8)rWriteAcc->GetBestPaletteIndex(
BitmapColor( toByteColor(rColor.Red),
toByteColor(rColor.Green),
toByteColor(rColor.Blue))) );
@@ -385,8 +385,8 @@ namespace vcl
else
nDepth = 8;
- const USHORT nPaletteEntries(
- sal::static_int_cast<USHORT>(
+ const sal_uInt16 nPaletteEntries(
+ sal::static_int_cast<sal_uInt16>(
std::min(sal_Int32(255), nEntryCount)));
// copy palette entries
@@ -395,7 +395,7 @@ namespace vcl
uno::Reference<rendering::XColorSpace> xPalColorSpace( xPalette->getColorSpace() );
uno::Sequence<double> aPaletteEntry;
- for( USHORT j=0; j<nPaletteEntries; ++j )
+ for( sal_uInt16 j=0; j<nPaletteEntries; ++j )
{
if( !xPalette->getIndex(aPaletteEntry,j) &&
nAlphaDepth == 0 )
@@ -423,14 +423,14 @@ namespace vcl
( nDepth <= 8 ) ? 8 : 24;
::Bitmap aBitmap( aPixelSize,
- sal::static_int_cast<USHORT>(nDepth),
+ sal::static_int_cast<sal_uInt16>(nDepth),
aLayout.Palette.is() ? &aPalette : NULL );
::Bitmap aAlpha;
if( nAlphaDepth )
aAlpha = ::Bitmap( aPixelSize,
- sal::static_int_cast<USHORT>(nAlphaDepth),
+ sal::static_int_cast<sal_uInt16>(nAlphaDepth),
&::Bitmap::GetGreyPalette(
- sal::static_int_cast<USHORT>(1L << nAlphaDepth)) );
+ sal::static_int_cast<sal_uInt16>(1L << nAlphaDepth)) );
{ // limit scoped access
ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(),
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index 398b8338884d..9173474af759 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -69,7 +69,7 @@ void LazyDelete::flush()
// specialized is_less function for Window
template<> bool LazyDeletor<Window>::is_less( Window* left, Window* right )
{
- return (left != right && right->IsChild( left, TRUE )) ? true : false;
+ return (left != right && right->IsChild( left, sal_True )) ? true : false;
}
// specialized is_less function for Menu
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index e708bdec9eaa..1a417417dbe4 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,7 +46,6 @@ SLOFILES=\
$(SLO)$/canvastools.obj \
$(SLO)$/xconnection.obj \
$(SLO)$/threadex.obj \
- $(SLO)$/smartid.obj \
$(SLO)$/lazydelete.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
deleted file mode 100644
index 41a4cbe814ea..000000000000
--- a/vcl/source/helper/smartid.cxx
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <vcl/smartid.hxx>
-
-struct ImplSmartIdData
-{
- String aUId;
- ULONG nUId;
- BOOL bHasStringId;
- BOOL bHasNumericId;
-};
-
-
-ImplSmartIdData* SmartId::GetSmartIdData()
-{
- if ( !mpData )
- {
- mpData = new ImplSmartIdData;
-// mpData->aUId = "";
- mpData->nUId = 0;
- mpData->bHasStringId = FALSE;
- mpData->bHasNumericId = FALSE;
- }
- return mpData;
-}
-
-
-SmartId::SmartId( const String& rId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
-}
-
-SmartId::SmartId( ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId( const String& rId, ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId()
-: mpData( NULL )
-{}
-
-SmartId::SmartId( const SmartId& rId )
-: mpData( NULL )
-{
- if ( rId.mpData )
- {
- GetSmartIdData();
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
-}
-
-SmartId& SmartId::operator = ( const SmartId& rId )
-{
- if ( rId.mpData )
- GetSmartIdData();
- else
- {
- delete mpData;
- mpData = NULL;
- }
- if ( mpData && rId.mpData )
- {
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
- return *this;
-}
-
-SmartId::~SmartId()
-{
- if ( mpData )
- delete mpData;
-#ifdef DBG_UTIL
- if ( mpData )
- mpData = (ImplSmartIdData*)0xDeadBeef;
-#endif
-}
-
-void SmartId::UpdateId( const SmartId& rId, SmartIdUpdateMode aMode )
-{
- // Check if ImplData is needed
- if ( aMode != SMART_SET_SMART || ( rId.HasString() || rId.HasNumeric() ) )
- GetSmartIdData();
-
- if ( aMode == SMART_SET_STR || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasString() ) )
- {
- GetSmartIdData()->aUId = rId.GetStr();
- GetSmartIdData()->bHasStringId = rId.HasString();
- }
- if ( aMode == SMART_SET_NUM || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasNumeric() ) )
- {
- GetSmartIdData()->nUId = rId.GetNum();
- GetSmartIdData()->bHasNumericId = rId.HasNumeric();
- }
-
- // remove ImplData when no IDs are set. This is Important because Implementation of Equals() Matches and HasAny relies on it
- if ( mpData && !mpData->bHasStringId && !mpData->bHasNumericId )
- {
- delete mpData;
- mpData = NULL;
- }
-}
-
-BOOL SmartId::HasNumeric() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasNumericId;
-}
-
-BOOL SmartId::HasString() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasStringId;
-}
-
-BOOL SmartId::HasAny() const
-{
- return mpData != NULL;
-}
-
-ULONG SmartId::GetNum() const
-{
- if ( !mpData )
- return 0;
- else
- return mpData->nUId;
-}
-
-String SmartId::GetStr() const
-{
- if ( !mpData )
- return String();
- else
- return mpData->aUId;
-}
-
-
-String SmartId::GetText() const // return String for UI usage
-{
- String aRes;
- if ( HasNumeric() )
- aRes = String::CreateFromInt64( GetNum() );
- if ( HasString() )
- {
- if ( HasNumeric() )
- aRes.AppendAscii( "/" );
- aRes.Append( GetStr() );
- }
- return aRes;
-}
-
-BOOL SmartId::Matches( const String &rId )const
-{
- if ( HasString() )
- return GetStr().EqualsIgnoreCaseAscii( rId );
- else
- return FALSE;
-}
-
-BOOL SmartId::Matches( const ULONG nId ) const
-{
- if ( HasNumeric() )
- return GetNum() == nId;
- else
- return FALSE;
-}
-
-/******************************************************************************
-If Both Ids have nither Strings nor Numbers they don't match
-If both Ids have Strings the result of Matching these is returned.
-Numbers are then Ignored.
-Else Matching Numbers is attempted.
-******************************************************************************/
-BOOL SmartId::Matches( const SmartId &rId ) const
-{
- if ( !mpData || !rId.mpData )
- return FALSE;
- else if ( HasString() && rId.HasString() )
- return Matches( rId.GetStr() );
- else
- return rId.HasNumeric() && Matches( rId.GetNum() );
-}
-
-BOOL SmartId::Equals( const SmartId &rId ) const
-{
- if ( mpData && rId.mpData )
- return mpData->aUId.EqualsIgnoreCaseAscii( rId.mpData->aUId )
- && mpData->bHasStringId == rId.mpData->bHasStringId
- && mpData->nUId == rId.mpData->nUId
- && mpData->bHasNumericId == rId.mpData->bHasNumericId;
- else if ( !mpData && !rId.mpData )
- return TRUE;
- else
- return FALSE;
-}
-
-BOOL SmartId::operator == ( const SmartId& rRight ) const
-{
- return Equals( rRight );
-}
-
-BOOL SmartId::operator < ( const SmartId& rRight ) const
-{
- if ( HasString() && rRight.HasString() && GetStr() != rRight.GetStr() )
- return GetStr() < rRight.GetStr();
- else if ( HasNumeric() && rRight.HasNumeric() && GetNum() != rRight.GetNum() )
- return GetNum() < rRight.GetNum();
- else
- { // Sort Strings to Front
- if ( HasString() )
- return rRight.HasString() && rRight.HasNumeric();
- else
- return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 7009468a02ec..c8b5cc7fbf22 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -326,7 +326,7 @@ int GetCommandLineTokenCount( const ByteString& rLine )
return nTokenCount;
}
-String WhitespaceToSpace( const String& rLine, BOOL bProtect )
+String WhitespaceToSpace( const String& rLine, sal_Bool bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
@@ -358,11 +358,11 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', TRUE );
+ CopyUntil( pLeap, pRun, '`', sal_True );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', TRUE );
+ CopyUntil( pLeap, pRun, '\'', sal_True );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', TRUE );
+ CopyUntil( pLeap, pRun, '"', sal_True );
else
{
*pLeap = *pRun;
@@ -383,7 +383,7 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
return aRet;
}
-ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
+ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
{
int nLen = rLine.Len();
if( ! nLen )
@@ -415,11 +415,11 @@ ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
pRun++;
}
else if( bProtect && *pRun == '`' )
- CopyUntil( pLeap, pRun, '`', TRUE );
+ CopyUntil( pLeap, pRun, '`', sal_True );
else if( bProtect && *pRun == '\'' )
- CopyUntil( pLeap, pRun, '\'', TRUE );
+ CopyUntil( pLeap, pRun, '\'', sal_True );
else if( bProtect && *pRun == '"' )
- CopyUntil( pLeap, pRun, '"', TRUE );
+ CopyUntil( pLeap, pRun, '"', sal_True );
else
{
*pLeap = *pRun;
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index 85ccffd34b6c..ad351410e2c2 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -112,8 +112,8 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
{
osl_resetCondition( m_aStart );
osl_resetCondition( m_aFinish );
- ULONG nSolarMutexCount = Application::ReleaseSolarMutex();
- ULONG nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
+ sal_uLong nSolarMutexCount = Application::ReleaseSolarMutex();
+ sal_uLong nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
if ( osl_cond_result_timeout == osl_waitCondition( m_aStart, _pTimeout ) )
{
m_bTimeout = true;
diff --git a/vcl/source/helper/xconnection.cxx b/vcl/source/helper/xconnection.cxx
index 0d03348e7712..d6aa0429bcf3 100644
--- a/vcl/source/helper/xconnection.cxx
+++ b/vcl/source/helper/xconnection.cxx
@@ -30,11 +30,18 @@
#include "precompiled_vcl.hxx"
#include "svsys.h"
+#include "rtl/ref.hxx"
#include "vcl/xconnection.hxx"
#include "vcl/svdata.hxx"
#include "vcl/salinst.hxx"
#include "vcl/svapp.hxx"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace osl;
using namespace vcl;
using namespace com::sun::star::uno;
@@ -44,13 +51,9 @@ using ::rtl::OUString;
DisplayConnection::DisplayConnection()
{
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpDefInst->SetEventCallback( this, dispatchEvent );
- pSVData->mpDefInst->SetErrorEventCallback( this, dispatchErrorEvent );
-
SalInstance::ConnectionIdentifierType eType;
int nBytes;
- void* pBytes = pSVData->mpDefInst->GetConnectionIdentifier( eType, nBytes );
+ void* pBytes = ImplGetSVData()->mpDefInst->GetConnectionIdentifier( eType, nBytes );
switch( eType )
{
case SalInstance::AsciiCString:
@@ -63,39 +66,54 @@ DisplayConnection::DisplayConnection()
}
DisplayConnection::~DisplayConnection()
+{}
+
+void DisplayConnection::start()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpDefInst->SetEventCallback( this );
+}
+
+void DisplayConnection::terminate()
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData )
{
- pSVData->mpDefInst->SetEventCallback( NULL, NULL );
- pSVData->mpDefInst->SetErrorEventCallback( NULL, NULL );
+ pSVData->mpDefInst->SetEventCallback( NULL );
}
-}
+ SolarMutexReleaser aRel;
+
+ MutexGuard aGuard( m_aMutex );
+ Any aEvent;
+ std::list< css::uno::Reference< XEventHandler > > aLocalList( m_aHandlers );
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
+ (*it)->handleEvent( aEvent );
+}
-void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
+void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.remove( handler );
}
-void SAL_CALL DisplayConnection::addErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::addErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aErrorHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
@@ -107,52 +125,37 @@ Any SAL_CALL DisplayConnection::getIdentifier() throw()
return m_aAny;
}
-void DisplayConnection::dispatchDowningEvent()
-{
- SolarMutexReleaser aRel;
-
- MutexGuard aGuard( m_aMutex );
- Any aEvent;
- std::list< Reference< XEventHandler > > aLocalList( m_aHandlers );
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
- (*it)->handleEvent( aEvent );
-}
-
-bool DisplayConnection::dispatchEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
return false;
}
-bool DisplayConnection::dispatchErrorEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchErrorEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aErrorHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aErrorHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
diff --git a/vcl/source/salmain/makefile.mk b/vcl/source/salmain/makefile.mk
index de085b482c4d..9c790bf28d75 100644
--- a/vcl/source/salmain/makefile.mk
+++ b/vcl/source/salmain/makefile.mk
@@ -28,11 +28,14 @@
PRJ = ..$/..
PRJNAME = vcl
TARGET = salmain
-LIBTARGET = NO
ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
OBJFILES = $(OBJ)$/salmain.obj
+LIB1TARGET=$(LB)$/vclmain.lib
+LIB1ARCHIV=$(LB)$/libvclmain.a
+LIB1FILES=$(LB)$/salmain.lib
+
.INCLUDE: target.mk
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index 871cd6af2b29..541ac34c29e7 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -38,25 +38,6 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
File = "check.png";
};
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_WINOFFSET)
-{
- File = "checkwin.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_OS2OFFSET)
-{
- File = "checkos2.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MACOFFSET)
-{
- File = "checkmac.png";
-};
-
-Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_UNIXOFFSET)
-{
- File = "checkunx.png";
-};
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
{
@@ -80,26 +61,6 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
File = "radio.png";
};
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_WINOFFSET)
-{
- File = "radiowin.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_OS2OFFSET)
-{
- File = "radioos2.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MACOFFSET)
-{
- File = "radiomac.png";
-};
-
-Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_UNIXOFFSET)
-{
- File = "radiounx.png";
-};
-
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
{
File = "radiomono.bmp";
diff --git a/vcl/source/src/makefile.mk b/vcl/source/src/makefile.mk
index 40b7d4e75dfe..2db77b7ffc74 100644
--- a/vcl/source/src/makefile.mk
+++ b/vcl/source/src/makefile.mk
@@ -44,7 +44,7 @@ SRC1FILES= images.src \
helptext.src \
units.src \
btntext.src \
- print.src
+ print.src \
RESLIB1NAME= $(RESTARGET)
RESLIB1IMAGES= $(PRJ)$/source/src
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 01d3c64f7fdb..b4f4d56029e1 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,6 +29,7 @@
ModalDialog SV_DLG_PRINT
{
+ HelpID = ".HelpID:vcl:PrintDialog:Dialog";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -44,16 +45,19 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 240, 195 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "~Print";
+ HelpID = ".HelpID:vcl:PrintDialog:OK";
};
CancelButton SV_PRINT_CANCEL
{
Pos = MAP_APPFONT( 295, 195 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Cancel";
};
HelpButton SV_PRINT_HELP
{
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 50, 15 );
+ HelpID = ".HelpID:vcl:PrintDialog:Help";
};
Window SV_PRINT_PAGE_PREVIEW
@@ -61,6 +65,7 @@ ModalDialog SV_DLG_PRINT
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 130, 130 );
Border = FALSE;
+ HelpID = ".HelpID:vcl:PrintDialog:Preview";
};
NumericField SV_PRINT_PAGE_EDIT
{
@@ -69,7 +74,7 @@ ModalDialog SV_DLG_PRINT
SVLook = TRUE;
Spin = FALSE;
Border = TRUE;
- HelpText [en-US] = "Select page to display in preview.";
+ HelpID = ".HelpID:vcl:PrintDialog:PageEdit";
};
FixedText SV_PRINT_PAGE_TXT
{
@@ -77,23 +82,25 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 30, 12 );
Text [ en-US ] = "/ %n";
VCenter = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:NumPagesText";
};
PushButton SV_PRINT_PAGE_FORWARD
{
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page forward.";
+ HelpID = ".HelpID:vcl:PrintDialog:ForwardBtn";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
- HelpText [en-US] = "Scroll one page backward.";
+ HelpID = ".HelpID:vcl:PrintDialog:BackwardBtn";
};
TabControl SV_PRINT_TABCTRL
{
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
+ HelpID = ".HelpID:vcl:PrintDialog:TabPages";
};
FixedLine SV_PRINT_BUTTONLINE
{
@@ -123,6 +130,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -132,34 +140,28 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 150, 10 );
Text [en-US] = "Layout";
};
- RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
- {
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 10 );
- Text [en-US] = "~Default";
- HelpText [en-US] = "Print one page per sheet of paper.";
- };
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:Brochure";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheet";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
- HelpText [en-US] = "Print multiple pages per sheet of paper.";
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PagesPerSheetBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
DropDown = TRUE;
CurPos = 0;
- HelpText [en-US] = "Select how many pages to print per sheet of paper.";
StringList [en-US] =
{
< "1"; 1; >;
@@ -180,6 +182,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:ColumnsBox";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -187,7 +190,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of columns.";
};
FixedText SV_PRINT_PRT_NUP_TIMES_TXT
{
@@ -198,6 +200,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:RowsBox";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -205,7 +208,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 32;
Value = 1;
- HelpText [en-US] = "Select number of rows.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT
{
@@ -215,13 +217,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:PageMarginBox";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between individual pages on each sheet of paper.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT
{
@@ -237,13 +239,13 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:SheetMarginBox";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
Border = TRUE;
Value = 0;
Unit = FUNIT_MM;
- HelpText [en-US] = "Select margin between the printed pages and paper edge.";
};
FixedText SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT
{
@@ -259,6 +261,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrientationBox";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -270,7 +273,6 @@ ModalDialog SV_DLG_PRINT
< "Portrait"; SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT; >;
< "Landscape"; SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE; >;
};
- HelpText [en-US] = "Select the orientation of the paper.";
};
FixedText SV_PRINT_PRT_NUP_ORDER_TXT
{
@@ -280,29 +282,32 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:OrderBox";
Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 10, 20 );
+ Size = MAP_APPFONT( 10, 50 );
DropDown = TRUE;
Border = TRUE;
CurPos = 0;
StringList [en-US] =
{
- < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
- < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
+ < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTB; >;
+ < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TBLR; >;
+ < "top to bottom, then left"; SV_PRINT_PRT_NUP_ORDER_TBRL; >;
+ < "right to left, then down"; SV_PRINT_PRT_NUP_ORDER_RLTB; >;
};
- HelpText [en-US] = "Select order in which pages are to be printed.";
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
+ HelpID = ".HelpID:vcl:PrintDialog:NUpPage:BorderBox";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
- HelpText [en-US] = "Check to draw a border around each page.";
};
};
TabPage SV_PRINT_TAB_JOB
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage";
Text [en-US] = "General";
Hide = TRUE;
@@ -314,18 +319,18 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:PrinterList";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
Sort = TRUE;
- HelpText [en-US] = "Select the printer to print on.";
};
CheckBox SV_PRINT_DETAILS_BTN
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:DetailsBtn";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
- HelpText [en-US] = "Show/Hide detailed information of the selected printer.";
};
FixedText SV_PRINT_STATUS_TXT
{
@@ -347,10 +352,10 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Properties";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
- HelpText [en-US] = "Call the setup dialog of the selected printer.";
};
FixedLine SV_PRINT_COPIES
{
@@ -366,6 +371,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Copies";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -373,7 +379,6 @@ ModalDialog SV_DLG_PRINT
Minimum = 1;
Maximum = 16384;
Value = 1;
- HelpText [en-US] = "Select the number of copies to be produced.";
};
FixedImage SV_PRINT_COLLATE_IMAGE
{
@@ -382,10 +387,10 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
+ HelpID = ".HelpID:vcl:PrintDialog:JobPage:Collate";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
- HelpText [en-US] = "Select whether copies should be collated or not.";
};
Image SV_PRINT_COLLATE_IMG
@@ -397,12 +402,21 @@ ModalDialog SV_DLG_PRINT
{
ImageBitmap = Bitmap { File = "ncollate.png" ; };
};
+
+ CheckBox SV_PRINT_OPT_REVERSE
+ {
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
+ Pos = MAP_APPFONT( 10, 50 );
+ Size = MAP_APPFONT( 200, 12 );
+ Text [en-US] = "Print in ~reverse page order";
+ };
};
TabPage SV_PRINT_TAB_OPT
{
Text [en-US] = "Options";
Hide = TRUE;
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage";
FixedLine SV_PRINT_OPT_PRINT_FL
{
@@ -412,30 +426,24 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToFile";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
- HelpText [en-US] = "Check to send output to a file instead of the actual printer.";
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:SingleJobs";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
- HelpText [en-US] = "Check to not rely on the printer to create collated copies but create a print job for each copy instead.";
- };
- CheckBox SV_PRINT_OPT_REVERSE
- {
- Pos = MAP_APPFONT( 10, 50 );
- Size = MAP_APPFONT( 200, 12 );
- Text [en-US] = "Print in ~reverse page order";
- HelpText [en-US] = "Check to print pages in reverse order.";
};
};
};
ModelessDialog SV_DLG_PRINT_PROGRESS
{
+ HelpID = "vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS";
Text [en-US] = "Printing";
Closeable = FALSE;
Sizeable = FALSE;
@@ -478,5 +486,51 @@ StringArray SV_PRINT_NATIVE_STRINGS
< "Page number"; >;
< "Number of pages"; >;
< "More"; >;
+ < "Print selection only"; >;
+ };
+};
+
+StringArray RID_STR_PAPERNAMES
+{
+ ItemList [en-US] =
+ {
+ < "A0"; >;
+ < "A1"; >;
+ < "A2"; >;
+ < "A3"; >;
+ < "A4"; >;
+ < "A5"; >;
+ < "B4 (ISO)"; >;
+ < "B5 (ISO)"; >;
+ < "Letter"; >;
+ < "Legal"; >;
+ < "Tabloid"; >;
+ < "User Defined"; >;
+ < "B6 (ISO)"; >;
+ < "C4 Envelope"; >;
+ < "C5 Envelope"; >;
+ < "C6 Envelope"; >;
+ < "C6/5 Envelope"; >;
+ < "DL Envelope"; >;
+ < "Dia Slide"; >;
+ < "Screen"; >;
+ < "C"; >;
+ < "D"; >;
+ < "E"; >;
+ < "Executive"; >;
+ < "Long Bond"; >;
+ < "#8 (Monarch) Envelope"; >;
+ < "#6 3/4 (Personal) Envelope"; >;
+ < "#9 Envelope"; >;
+ < "#10 Envelope"; >;
+ < "#11 Envelope"; >;
+ < "#12 Envelope"; >;
+ < "16 Kai"; >;
+ < "32 Kai"; >;
+ < "Big 32 Kai"; >;
+ < "B4 (JIS)"; >;
+ < "B5 (JIS)"; >;
+ < "B6 (JIS)"; >;
};
};
+
diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src
index 2c6574220a5f..1b95f7bb1d72 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -101,6 +101,11 @@ String SV_ACCESSERROR_TURNAROUND_MSG
Text [ en-US ] = "The Java Access Bridge could not be started.";
};
+String SV_ACCESSERROR_NO_FONTS
+{
+ Text [ en-US ] = "No fonts could be found on the system.";
+};
+
String SV_STDTEXT_ABOUT
{
Text [ en-US ] = "About %PRODUCTNAME";
diff --git a/vcl/source/src/throbber.src b/vcl/source/src/throbber.src
new file mode 100755
index 000000000000..d3c5ea44035c
--- /dev/null
+++ b/vcl/source/src/throbber.src
@@ -0,0 +1,114 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// TODO: we need a mechanism to add images to images.zip, *without*
+// referring them in resource files. The below resources are never loaded
+// at runtime, instead, the images in images.zip are accessed via
+// private:graphicrepository/* URLs.
+
+Resource 1000
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-16-06.png"; }; };
+};
+
+Resource 1001
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-06.png"; }; };
+};
+
+Resource 1002
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-32-12.png"; }; };
+};
+
+Resource 1003
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-12.png"; }; };
+};
+
+Resource 1004
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-64-12.png"; }; };
+};
+
+Resource 1005
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-12.png"; }; };
+};
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 22287a42ffca..50d288b71686 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -42,7 +42,7 @@
DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
typedef ::std::vector< ImplAccelEntry* > ImplAccelList;
-#define ACCELENTRY_NOTFOUND ((USHORT)0xFFFF)
+#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
// =======================================================================
@@ -59,14 +59,14 @@ DBG_NAME( Accelerator )
// =======================================================================
-USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
- USHORT* pIndex = NULL )
+sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
+ sal_uInt16* pIndex = NULL )
{
size_t nLow;
size_t nHigh;
size_t nMid;
size_t nCount = pList->size();
- USHORT nCompareId;
+ sal_uInt16 nCompareId;
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
if ( !nCount || (nId < (*pList)[ 0 ]->mnId) )
@@ -90,7 +90,7 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( nId > nCompareId )
nLow = nMid + 1;
else
- return (USHORT)nMid;
+ return (sal_uInt16)nMid;
}
}
while ( nLow <= nHigh );
@@ -98,9 +98,9 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
if ( pIndex )
{
if ( nId > nCompareId )
- *pIndex = (USHORT)(nMid+1);
+ *pIndex = (sal_uInt16)(nMid+1);
else
- *pIndex = (USHORT)nMid;
+ *pIndex = (sal_uInt16)nMid;
}
return ACCELENTRY_NOTFOUND;
@@ -110,8 +110,8 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId,
static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
{
- USHORT nInsIndex;
- USHORT nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
+ sal_uInt16 nInsIndex;
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
@@ -145,9 +145,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
// -----------------------------------------------------------------------
-static USHORT ImplAccelEntryGetFirstPos( ImplAccelList* pList, USHORT nId )
+static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId )
{
- USHORT nIndex = ImplAccelEntryGetIndex( pList, nId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
while ( nIndex )
@@ -170,7 +170,7 @@ void Accelerator::ImplInit()
{
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
mpDel = NULL;
}
@@ -199,7 +199,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
else
pEntry->mpAutoAccel = NULL;
- mpData->maKeyTable.Insert( (ULONG)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
+ mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
mpData->maIdList.push_back( pEntry );
}
}
@@ -221,18 +221,18 @@ void Accelerator::ImplDeleteData()
// -----------------------------------------------------------------------
-void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
- BOOL bEnable, Accelerator* pAutoAccel )
+void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
+ sal_Bool bEnable, Accelerator* pAutoAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" );
if ( rKeyCode.IsFunction() )
{
- USHORT nCode1;
- USHORT nCode2;
- USHORT nCode3;
- USHORT nCode4;
+ sal_uInt16 nCode1;
+ sal_uInt16 nCode2;
+ sal_uInt16 nCode3;
+ sal_uInt16 nCode4;
ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 );
if ( nCode1 )
ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel );
@@ -260,7 +260,7 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
pEntry->mbEnabled = bEnable;
// Ab in die Tabellen
- ULONG nCode = rKeyCode.GetFullKeyCode();
+ sal_uLong nCode = rKeyCode.GetFullKeyCode();
if ( !nCode )
{
OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
@@ -319,9 +319,9 @@ void Accelerator::ImplLoadRes( const ResId& rResId )
GetRes( rResId );
maHelpStr = ReadStringRes();
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -336,7 +336,7 @@ Accelerator::~Accelerator()
// AccelManager benachrichtigen, das Accelrator geloescht wurde
if ( mpDel )
- *mpDel = TRUE;
+ *mpDel = sal_True;
ImplDeleteData();
delete mpData;
@@ -365,9 +365,9 @@ void Accelerator::Select()
// -----------------------------------------------------------------------
-void Accelerator::InsertItem( USHORT nItemId, const KeyCode& rKeyCode )
+void Accelerator::InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode )
{
- ImplInsertAccel( nItemId, rKeyCode, TRUE, NULL );
+ ImplInsertAccel( nItemId, rKeyCode, sal_True, NULL );
}
// -----------------------------------------------------------------------
@@ -376,15 +376,15 @@ void Accelerator::InsertItem( const ResId& rResId )
{
DBG_CHKTHIS( Accelerator, NULL );
- ULONG nObjMask;
- USHORT nAccelKeyId;
- USHORT bDisable;
+ sal_uLong nObjMask;
+ sal_uInt16 nAccelKeyId;
+ sal_uInt16 bDisable;
KeyCode aKeyCode;
Accelerator* pAutoAccel = NULL;
GetRes( rResId.SetRT( RSC_ACCELITEM ) );
nObjMask = ReadLongRes();
- nAccelKeyId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nAccelKeyId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
bDisable = ReadShortRes();
if ( nObjMask & ACCELITEM_KEY )
@@ -407,15 +407,15 @@ void Accelerator::InsertItem( const ResId& rResId )
// -----------------------------------------------------------------------
-void Accelerator::RemoveItem( USHORT nItemId )
+void Accelerator::RemoveItem( sal_uInt16 nItemId )
{
DBG_CHKTHIS( Accelerator, NULL );
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
@@ -450,8 +450,8 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode )
if ( pEntry )
{
// Aus der Id-Liste entfernen
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId );
+ sal_uInt16 nItemCount = GetItemCount();
do
{
if ( mpData->maIdList[ nIndex ] == pEntry )
@@ -486,16 +486,16 @@ void Accelerator::Clear()
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemCount() const
+sal_uInt16 Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
- return (USHORT)mpData->maIdList.size();
+ return (sal_uInt16)mpData->maIdList.size();
}
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( USHORT nPos ) const
+sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -508,7 +508,7 @@ USHORT Accelerator::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
+KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -521,7 +521,7 @@ KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
+sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -534,11 +534,11 @@ USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const
// -----------------------------------------------------------------------
-KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
+KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->maKeyCode;
else
@@ -547,17 +547,17 @@ KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::IsIdValid( USHORT nItemId ) const
+sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
return (nIndex != ACCELENTRY_NOTFOUND);
}
// -----------------------------------------------------------------------
-BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -567,7 +567,7 @@ BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const
// -----------------------------------------------------------------------
-BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -576,7 +576,7 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
{
if ( pEntry->mbEnabled )
{
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
mnCurId = pEntry->mnId;
maCurKeyCode = rKeyCode;
mnCurRepeat = nRepeat;
@@ -589,23 +589,23 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat )
mnCurRepeat = 0;
}
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
+void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -621,11 +621,11 @@ void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel )
// -----------------------------------------------------------------------
-Accelerator* Accelerator::GetAccel( USHORT nItemId ) const
+Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mpAccel;
else
@@ -653,19 +653,19 @@ Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mpAccel;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
+void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
{
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nItemCount = GetItemCount();
do
{
ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
@@ -681,20 +681,20 @@ void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( USHORT nItemId ) const
+sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
+ sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
return mpData->maIdList[ nIndex ]->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
+void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable )
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -705,7 +705,7 @@ void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
+sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
{
DBG_CHKTHIS( Accelerator, NULL );
@@ -713,7 +713,7 @@ BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const
if ( pEntry )
return pEntry->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -728,7 +728,7 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel )
maCurKeyCode = KeyCode();
mnCurId = 0;
mnCurRepeat = 0;
- mbIsCancel = FALSE;
+ mbIsCancel = sal_False;
// Tabellen loeschen und kopieren
ImplDeleteData();
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index b45020460c08..c8b1e42c5ed1 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -50,20 +50,20 @@ ImplAccelManager::~ImplAccelManager()
// -----------------------------------------------------------------------
-BOOL ImplAccelManager::InsertAccel( Accelerator* pAccel )
+sal_Bool ImplAccelManager::InsertAccel( Accelerator* pAccel )
{
if ( !mpAccelList ) {
mpAccelList = new ImplAccelList;
} else {
for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) {
if ( (*mpAccelList)[ i ] == pAccel ) {
- return FALSE;
+ return sal_False;
}
}
}
mpAccelList->insert( mpAccelList->begin(), pAccel );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -79,7 +79,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
//we're removing an accelerator that a sub-accelerator which is in the
//sequence list, throw away the entire sequence
if ( mpSequenceList ) {
- for (USHORT i = 0; i < pAccel->GetItemCount(); ++i) {
+ for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i) {
Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) );
for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) {
if ( (*mpSequenceList)[ j ] == pSubAccel ) {
@@ -105,7 +105,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
// -----------------------------------------------------------------------
-void ImplAccelManager::EndSequence( BOOL bCancel )
+void ImplAccelManager::EndSequence( sal_Bool bCancel )
{
// Sind wir ueberhaupt in einer Sequenz ?
if ( !mpSequenceList )
@@ -115,13 +115,13 @@ void ImplAccelManager::EndSequence( BOOL bCancel )
for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i )
{
Accelerator* pTempAccel = (*mpSequenceList)[ i ];
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pTempAccel->mbIsCancel = bCancel;
pTempAccel->mpDel = &bDel;
pTempAccel->Deactivate();
if ( !bDel )
{
- pTempAccel->mbIsCancel = FALSE;
+ pTempAccel->mbIsCancel = sal_False;
pTempAccel->mpDel = NULL;
}
}
@@ -133,15 +133,15 @@ void ImplAccelManager::EndSequence( BOOL bCancel )
// -----------------------------------------------------------------------
-BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
+sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat )
{
Accelerator* pAccel;
// Haben wir ueberhaupt Acceleratoren ??
if ( !mpAccelList )
- return FALSE;
+ return sal_False;
if ( mpAccelList->empty() )
- return FALSE;
+ return sal_False;
// Sind wir in einer Sequenz ?
if ( mpSequenceList )
@@ -154,7 +154,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
{
// Sequenz abbrechen
FlushAccel();
- return FALSE;
+ return sal_False;
}
// Ist der Eintrag da drin ?
@@ -172,7 +172,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return TRUE;
+ return sal_True;
}
else
{
@@ -184,7 +184,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -201,14 +201,14 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
pAccel->mpDel = NULL;
}
- return TRUE;
+ return sal_True;
}
else
{
// Sequenz abbrechen, weil Acceleraor disabled
// Taste wird weitergeleitet (ans System)
FlushAccel();
- return FALSE;
+ return sal_False;
}
}
}
@@ -216,7 +216,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
{
// Sequenz abbrechen wegen falscher Taste
FlushAccel();
- return FALSE;
+ return sal_False;
}
}
@@ -245,7 +245,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
- return TRUE;
+ return sal_True;
}
else
{
@@ -258,7 +258,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
// Dem Accelerator das aktuelle Item setzen
// und Handler rufen
- BOOL bDel = FALSE;
+ sal_Bool bDel = sal_False;
pAccel->maCurKeyCode = rKeyCode;
pAccel->mnCurId = pEntry->mnId;
pAccel->mnCurRepeat = nRepeat;
@@ -275,15 +275,15 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat )
pAccel->mpDel = NULL;
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
}
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index 88e9af2b9f1c..28e0d8ae65fe 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -30,15 +30,37 @@
#include "vcl/arrange.hxx"
#include "vcl/edit.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
#include "osl/diagnose.h"
using namespace vcl;
+using namespace com::sun::star;
// ----------------------------------------
// vcl::WindowArranger
//-----------------------------------------
+long WindowArranger::getDefaultBorder()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ long nResult = pSVData->maAppData.mnDefaultLayoutBorder;
+ if( nResult < 0 )
+ {
+ OutputDevice* pDefDev = Application::GetDefaultDevice();
+ if( pDefDev )
+ {
+ Size aBorder( pDefDev->LogicToPixel( Size( 3, 3 ), MapMode( MAP_APPFONT ) ) );
+ nResult = pSVData->maAppData.mnDefaultLayoutBorder = aBorder.Height();
+ }
+ }
+ return nResult > 0 ? nResult : 0;
+}
+
WindowArranger::~WindowArranger()
{}
@@ -157,16 +179,26 @@ Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const
Size aResult;
if( ! m_bHidden )
{
+ bool bVisible = false;
if( m_pElement && m_pElement->IsVisible() )
+ {
aResult = m_pElement->GetOptimalSize( i_eType );
- else if( m_pChild )
+ bVisible = true;
+ }
+ else if( m_pChild && m_pChild->isVisible() )
+ {
aResult = m_pChild->getOptimalSize( i_eType );
- if( aResult.Width() < m_aMinSize.Width() )
- aResult.Width() = m_aMinSize.Width();
- if( aResult.Height() < m_aMinSize.Height() )
- aResult.Height() = m_aMinSize.Height();
- aResult.Width() += m_nLeftBorder + m_nRightBorder;
- aResult.Height() += m_nTopBorder + m_nBottomBorder;
+ bVisible = true;
+ }
+ if( bVisible )
+ {
+ if( aResult.Width() < m_aMinSize.Width() )
+ aResult.Width() = m_aMinSize.Width();
+ if( aResult.Height() < m_aMinSize.Height() )
+ aResult.Height() = m_aMinSize.Height();
+ aResult.Width() += getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aResult.Height() += getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
+ }
}
return aResult;
@@ -176,16 +208,74 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi
{
Point aPoint( i_rPos );
Size aSize( i_rSize );
- aPoint.X() += m_nLeftBorder;
- aPoint.Y() += m_nTopBorder;
- aSize.Width() -= m_nLeftBorder + m_nRightBorder;
- aSize.Height() -= m_nTopBorder + m_nBottomBorder;
+ aPoint.X() += getBorderValue( m_nLeftBorder );
+ aPoint.Y() += getBorderValue( m_nTopBorder );
+ aSize.Width() -= getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder );
+ aSize.Height() -= getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder );
if( m_pElement )
m_pElement->SetPosSizePixel( aPoint, aSize );
else if( m_pChild )
m_pChild->setManagedArea( Rectangle( aPoint, aSize ) );
}
+uno::Sequence< beans::PropertyValue > WindowArranger::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aRet( 3 );
+ aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OuterBorder" ) );
+ aRet[0].Value = uno::makeAny( sal_Int32( getBorderValue( m_nOuterBorder ) ) );
+ aRet[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ManagedArea" ) );
+ awt::Rectangle aArea( m_aManagedArea.getX(), m_aManagedArea.getY(), m_aManagedArea.getWidth(), m_aManagedArea.getHeight() );
+ aRet[1].Value = uno::makeAny( aArea );
+ aRet[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aRet[2].Value = uno::makeAny( sal_Bool( isVisible() ) );
+ return aRet;
+}
+
+void WindowArranger::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pProps = i_rProps.getConstArray();
+ bool bResize = false;
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pProps[i].Name.equalsAscii( "OuterBorder" ) )
+ {
+ sal_Int32 nVal = 0;
+ if( pProps[i].Value >>= nVal )
+ {
+ if( getBorderValue( m_nOuterBorder ) != nVal )
+ {
+ m_nOuterBorder = nVal;
+ bResize = true;
+ }
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "ManagedArea" ) )
+ {
+ awt::Rectangle aArea( 0, 0, 0, 0 );
+ if( pProps[i].Value >>= aArea )
+ {
+ m_aManagedArea.setX( aArea.X );
+ m_aManagedArea.setY( aArea.Y );
+ m_aManagedArea.setWidth( aArea.Width );
+ m_aManagedArea.setHeight( aArea.Height );
+ bResize = true;
+ }
+ }
+ else if( pProps[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_False;
+ if( pProps[i].Value >>= bVal )
+ {
+ show( bVal, false );
+ bResize = true;
+ }
+ }
+ }
+ if( bResize )
+ resize();
+}
+
+
// ----------------------------------------
// vcl::RowOrColumn
//-----------------------------------------
@@ -202,6 +292,7 @@ RowOrColumn::~RowOrColumn()
Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
Size aRet( 0, 0 );
+ long nDistance = getBorderValue( m_nBorderWidth );
for( std::vector< WindowArranger::Element >::const_iterator it = m_aElements.begin();
it != m_aElements.end(); ++it )
{
@@ -212,7 +303,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
if( m_bColumn )
{
// add the distance between elements
- aRet.Height() += m_nBorderWidth;
+ aRet.Height() += nDistance;
// check if the width needs adjustment
if( aRet.Width() < aElementSize.Width() )
aRet.Width() = aElementSize.Width();
@@ -221,7 +312,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
else
{
// add the distance between elements
- aRet.Width() += m_nBorderWidth;
+ aRet.Width() += nDistance;
// check if the height needs adjustment
if( aRet.Height() < aElementSize.Height() )
aRet.Height() = aElementSize.Height();
@@ -234,13 +325,14 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const
{
// subtract the border for the first element
if( m_bColumn )
- aRet.Height() -= m_nBorderWidth;
+ aRet.Height() -= nDistance;
else
- aRet.Width() -= m_nBorderWidth;
+ aRet.Width() -= nDistance;
// add the outer border
- aRet.Width() += 2*m_nOuterBorder;
- aRet.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ aRet.Width() += 2*nOuterBorder;
+ aRet.Height() += 2*nOuterBorder;
}
return aRet;
@@ -345,7 +437,9 @@ void RowOrColumn::resize()
size_t nElements = m_aElements.size();
// get all element sizes for sizing
std::vector<Size> aElementSizes( nElements );
- long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0);
+ long nDistance = getBorderValue( m_nBorderWidth );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0);
for( size_t i = 0; i < nElements; i++ )
{
if( m_aElements[i].isVisible() )
@@ -353,13 +447,13 @@ void RowOrColumn::resize()
aElementSizes[i] = m_aElements[i].getOptimalSize( eType );
if( m_bColumn )
{
- aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth;
+ aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Height() + nDistance;
}
else
{
- aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder;
- nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth;
+ aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder;
+ nUsedWidth += aElementSizes[i].Width() + nDistance;
}
}
}
@@ -376,8 +470,8 @@ void RowOrColumn::resize()
// get starting position
Point aElementPos( m_aManagedArea.TopLeft() );
// outer border
- aElementPos.X() += m_nOuterBorder;
- aElementPos.Y() += m_nOuterBorder;
+ aElementPos.X() += nOuterBorder;
+ aElementPos.Y() += nOuterBorder;
// position managed windows
for( size_t i = 0; i < nElements; i++ )
@@ -387,27 +481,27 @@ void RowOrColumn::resize()
{
m_aElements[i].setPosSize( aElementPos, aElementSizes[i] );
if( m_bColumn )
- aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height();
+ aElementPos.Y() += nDistance + aElementSizes[i].Height();
else
- aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width();
+ aElementPos.X() += nDistance + aElementSizes[i].Width();
}
}
}
-size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, size_t i_nIndex )
+size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex )
{
size_t nIndex = i_nIndex;
if( i_nIndex >= m_aElements.size() )
{
nIndex = m_aElements.size();
- m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
std::vector< WindowArranger::Element >::iterator it = m_aElements.begin();
while( i_nIndex-- )
++it;
- m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
return nIndex;
}
@@ -480,14 +574,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const
if( m_nLabelColumnWidth != 0 )
aRet.Width() = m_nLabelColumnWidth;
else
- aRet.Width() += m_nDistance;
+ aRet.Width() += getBorderValue( m_nDistance );
}
Size aElementSize( m_aElement.getOptimalSize( i_eType ) );
aRet.Width() += aElementSize.Width();
if( aElementSize.Height() > aRet.Height() )
aRet.Height() = aElementSize.Height();
if( aRet.Height() != 0 )
- aRet.Height() += 2*m_nOuterBorder;
+ aRet.Height() += 2 * getBorderValue( m_nOuterBorder );
return aRet;
}
@@ -496,23 +590,25 @@ void LabeledElement::resize()
{
Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) );
- if( m_nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
+ long nDistance = getBorderValue( m_nDistance );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() )
aElementSize = m_aElement.getOptimalSize( WINDOWSIZE_MINIMUM );
// align label and element vertically in LabeledElement
- long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2;
+ long nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aLabelSize.Height()) / 2;
Point aPos( m_aManagedArea.Left(),
- m_aManagedArea.Top() + m_nOuterBorder + nYOff );
+ m_aManagedArea.Top() + nOuterBorder + nYOff );
Size aSize( aLabelSize );
if( m_nLabelColumnWidth != 0 )
aSize.Width() = m_nLabelColumnWidth;
m_aLabel.setPosSize( aPos, aSize );
- aPos.X() += aSize.Width() + m_nDistance;
- nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2;
- aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff;
+ aPos.X() += aSize.Width() + nDistance;
+ nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2;
+ aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff;
aSize.Width() = aElementSize.Width();
- aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder;
+ aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder;
// label style
// 0: position left and right
@@ -579,18 +675,22 @@ long LabelColumn::getLabelWidth() const
if( pLW )
{
Size aLabSize( pLW->GetOptimalSize( WINDOWSIZE_MINIMUM ) );
+ long nLB = 0;
+ pLabel->getBorders(0, &nLB);
+ aLabSize.Width() += getBorderValue( nLB );
if( aLabSize.Width() > nWidth )
nWidth = aLabSize.Width();
}
}
}
}
- return nWidth + getBorderWidth();
+ return nWidth + getBorderValue( getBorderWidth() );
}
Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
{
long nWidth = getLabelWidth();
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
Size aColumnSize;
// every child is a LabeledElement
@@ -623,19 +723,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const
}
if( aElementSize.Width() )
{
- aElementSize.Width() += 2*m_nOuterBorder;
+ aElementSize.Width() += 2*nOuterBorder;
if( aElementSize.Width() > aColumnSize.Width() )
aColumnSize.Width() = aElementSize.Width();
}
if( aElementSize.Height() )
{
- aColumnSize.Height() += getBorderWidth() + aElementSize.Height();
+ aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height();
}
}
if( nEle > 0 && aColumnSize.Height() )
{
- aColumnSize.Height() -= getBorderWidth(); // for the first element
- aColumnSize.Height() += 2*m_nOuterBorder;
+ aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element
+ aColumnSize.Height() += 2*nOuterBorder;
}
return aColumnSize;
}
@@ -668,12 +768,13 @@ size_t LabelColumn::addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger>
return nIndex;
}
-size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent )
+size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent, const Size& i_rElementMinSize )
{
boost::shared_ptr< LabeledElement > xLabel( new LabeledElement( this, 1 ) );
xLabel->setLabel( i_pLabel );
xLabel->setBorders( 0, i_nIndent, 0, 0, 0 );
xLabel->setElement( i_pElement );
+ xLabel->setMinimumSize( 1, i_rElementMinSize );
size_t nIndex = addChild( xLabel );
resize();
return nIndex;
@@ -691,19 +792,23 @@ Indenter::~Indenter()
Size Indenter::getOptimalSize( WindowSizeType i_eType ) const
{
Size aSize( m_aElement.getOptimalSize( i_eType ) );
- aSize.Width() += 2*m_nOuterBorder + m_nIndent;
- aSize.Height() += 2*m_nOuterBorder;
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
+ aSize.Width() += 2*nOuterBorder + nIndent;
+ aSize.Height() += 2*nOuterBorder;
return aSize;
}
void Indenter::resize()
{
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ long nIndent = getBorderValue( m_nIndent );
Point aPt( m_aManagedArea.TopLeft() );
- aPt.X() += m_nOuterBorder + m_nIndent;
- aPt.Y() += m_nOuterBorder;
+ aPt.X() += nOuterBorder + nIndent;
+ aPt.Y() += nOuterBorder;
Size aSz( m_aManagedArea.GetSize() );
- aSz.Width() -= 2*m_nOuterBorder + m_nIndent;
- aSz.Height() -= 2*m_nOuterBorder;
+ aSz.Width() -= 2*nOuterBorder + nIndent;
+ aSz.Height() -= 2*nOuterBorder;
m_aElement.setPosSize( aPt, aSz );
}
@@ -729,9 +834,13 @@ MatrixArranger::~MatrixArranger()
{
}
-Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const
+Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
+ std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+ std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+ ) const
{
- Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
+ Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder );
// first find out the current number of rows and columns
sal_uInt32 nRows = 0, nColumns = 0;
@@ -747,6 +856,8 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
// now allocate row and column depth vectors
o_rColumnWidths = std::vector< long >( nColumns, 0 );
o_rRowHeights = std::vector< long >( nRows, 0 );
+ o_rColumnPrio = std::vector< sal_Int32 >( nColumns, 0 );
+ o_rRowPrio = std::vector< sal_Int32 >( nRows, 0 );
// get sizes an allocate them into rows/columns
for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin();
@@ -757,18 +868,24 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
o_rColumnWidths[ it->m_nX ] = aSize.Width();
if( aSize.Height() > o_rRowHeights[ it->m_nY ] )
o_rRowHeights[ it->m_nY ] = aSize.Height();
+ if( it->m_nExpandPriority > o_rColumnPrio[ it->m_nX ] )
+ o_rColumnPrio[ it->m_nX ] = it->m_nExpandPriority;
+ if( it->m_nExpandPriority > o_rRowPrio[ it->m_nY ] )
+ o_rRowPrio[ it->m_nY ] = it->m_nExpandPriority;
}
// add up sizes
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
for( sal_uInt32 i = 0; i < nColumns; i++ )
- aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX;
+ aMatrixSize.Width() += o_rColumnWidths[i] + nDistanceX;
if( nColumns > 0 )
- aMatrixSize.Width() -= m_nBorderX;
+ aMatrixSize.Width() -= nDistanceX;
for( sal_uInt32 i = 0; i < nRows; i++ )
- aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY;
+ aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY;
if( nRows > 0 )
- aMatrixSize.Height() -= m_nBorderY;
+ aMatrixSize.Height() -= nDistanceY;
return aMatrixSize;
}
@@ -776,9 +893,48 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>&
Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const
{
std::vector<long> aColumnWidths, aRowHeights;
- return getOptimalSize( i_eType, aColumnWidths, aRowHeights );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ return getOptimalSize( i_eType, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio );
}
+void MatrixArranger::distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth )
+{
+ if( ! io_rSizes.empty() && io_rSizes.size() == i_rPrios.size() ) // sanity check
+ {
+ // find all elements with the highest expand priority
+ size_t nElements = io_rSizes.size();
+ std::vector< size_t > aIndices;
+ sal_Int32 nHighPrio = 0;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ sal_Int32 nCurPrio = i_rPrios[ i ];
+ if( nCurPrio > nHighPrio )
+ {
+ aIndices.clear();
+ nHighPrio = nCurPrio;
+ }
+ if( nCurPrio == nHighPrio )
+ aIndices.push_back( i );
+ }
+
+ // distribute extra space evenly among collected elements
+ nElements = aIndices.size();
+ if( nElements > 0 )
+ {
+ long nDelta = i_nExtraWidth / nElements;
+ for( size_t i = 0; i < nElements; i++ )
+ {
+ io_rSizes[ aIndices[i] ] += nDelta;
+ i_nExtraWidth -= nDelta;
+ }
+ // add the last pixels to the last row element
+ if( i_nExtraWidth > 0 && nElements > 0 )
+ io_rSizes[aIndices.back()] += i_nExtraWidth;
+ }
+ }
+}
+
+
void MatrixArranger::resize()
{
// assure that we have at least one row and column
@@ -787,30 +943,44 @@ void MatrixArranger::resize()
// check if we can get optimal size, else fallback to minimal size
std::vector<long> aColumnWidths, aRowHeights;
- Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) );
+ std::vector<sal_Int32> aColumnPrio, aRowPrio;
+ Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) );
if( aOptSize.Height() > m_aManagedArea.GetHeight() ||
aOptSize.Width() > m_aManagedArea.GetWidth() )
{
std::vector<long> aMinColumnWidths, aMinRowHeights;
- getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights );
+ getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio );
if( aOptSize.Height() > m_aManagedArea.GetHeight() )
aRowHeights = aMinRowHeights;
if( aOptSize.Width() > m_aManagedArea.GetWidth() )
aColumnWidths = aMinColumnWidths;
}
- // FIXME: distribute extra space available
+ // distribute extra space available
+ long nExtraSize = m_aManagedArea.GetWidth();
+ for( size_t i = 0; i < aColumnWidths.size(); ++i )
+ nExtraSize -= aColumnWidths[i] + m_nBorderX;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aColumnWidths, aColumnPrio, nExtraSize );
+ nExtraSize = m_aManagedArea.GetHeight();
+ for( size_t i = 0; i < aRowHeights.size(); ++i )
+ nExtraSize -= aRowHeights[i] + m_nBorderY;
+ if( nExtraSize > 0 )
+ distributeExtraSize( aRowHeights, aRowPrio, nExtraSize );
// prepare offsets
+ long nDistanceX = getBorderValue( m_nBorderX );
+ long nDistanceY = getBorderValue( m_nBorderY );
+ long nOuterBorder = getBorderValue( m_nOuterBorder );
std::vector<long> aColumnX( aColumnWidths.size() );
- aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder;
+ aColumnX[0] = m_aManagedArea.Left() + nOuterBorder;
for( size_t i = 1; i < aColumnX.size(); i++ )
- aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX;
+ aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX;
std::vector<long> aRowY( aRowHeights.size() );
- aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder;
+ aRowY[0] = m_aManagedArea.Top() + nOuterBorder;
for( size_t i = 1; i < aRowY.size(); i++ )
- aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY;
+ aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY;
// now iterate over the elements and assign their positions
for( std::vector< MatrixElement >::iterator it = m_aElements.begin();
@@ -822,7 +992,7 @@ void MatrixArranger::resize()
}
}
-size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio )
+size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize )
{
sal_uInt64 nMapValue = getMap( i_nX, i_nY );
std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue );
@@ -830,7 +1000,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
if( it == m_aMatrixMap.end() )
{
m_aMatrixMap[ nMapValue ] = nIndex = m_aElements.size();
- m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) );
+ m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) );
}
else
{
@@ -838,6 +1008,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32
rEle.m_pElement = i_pWindow;
rEle.m_pChild.reset();
rEle.m_nExpandPriority = i_nExpandPrio;
+ rEle.m_aMinSize = i_rMinSize;
rEle.m_nX = i_nX;
rEle.m_nY = i_nY;
nIndex = it->second;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index ebb63f07b11b..a71aadc3cdad 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::uno;
// =======================================================================
-static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage )
+static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool bPinIn, Image& rImage )
{
// ImageListe laden, wenn noch nicht vorhanden
ImplSVData* pSVData = ImplGetSVData();
@@ -71,7 +71,7 @@ static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage )
}
// Image ermitteln und zurueckgeben
- USHORT nId;
+ sal_uInt16 nId;
if ( nStyle & BUTTON_DRAW_PRESSED )
{
if ( bPinIn )
@@ -126,9 +126,9 @@ static void ImplDrawBrdWinSymbol( OutputDevice* pDev,
static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
const Rectangle& rRect,
- SymbolType eSymbol, USHORT nState )
+ SymbolType eSymbol, sal_uInt16 nState )
{
- BOOL bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
+ sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
nState &= ~BUTTON_DRAW_HIGHLIGHT;
Rectangle aTempRect;
@@ -141,8 +141,8 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
pWin->SetFillColor( pDev->GetSettings().GetStyleSettings().GetWindowColor() );
pWin->SetLineColor();
pWin->DrawRect( rRect );
- pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? TRUE : FALSE,
- TRUE, FALSE );
+ pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? sal_True : sal_False,
+ sal_True, sal_False );
}
aTempRect = rRect;
aTempRect.nLeft+=3;
@@ -171,23 +171,23 @@ ImplBorderWindowView::~ImplBorderWindowView()
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::MouseMove( const MouseEvent& )
+sal_Bool ImplBorderWindowView::MouseMove( const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
+sal_Bool ImplBorderWindowView::MouseButtonDown( const MouseEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::Tracking( const TrackingEvent& )
+sal_Bool ImplBorderWindowView::Tracking( const TrackingEvent& )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -242,7 +242,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
// -----------------------------------------------------------------------
-USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
+sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -321,15 +321,15 @@ USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Poin
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+sal_Bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
- USHORT oldCloseState = pData->mnCloseState;
- USHORT oldMenuState = pData->mnMenuState;
+ sal_uInt16 oldCloseState = pData->mnCloseState;
+ sal_uInt16 oldMenuState = pData->mnMenuState;
pData->mnCloseState &= ~BUTTON_DRAW_HIGHLIGHT;
pData->mnMenuState &= ~BUTTON_DRAW_HIGHLIGHT;
Point aMousePos = rMEvt.GetPosPixel();
- USHORT nHitTest = ImplHitTest( pData, aMousePos );
+ sal_uInt16 nHitTest = ImplHitTest( pData, aMousePos );
PointerStyle ePtrStyle = POINTER_ARROW;
if ( nHitTest & BORDERWINDOW_HITTEST_LEFT )
ePtrStyle = POINTER_WINDOW_WSIZE;
@@ -358,12 +358,12 @@ BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const Mous
if( pData->mnMenuState != oldMenuState )
pData->mpBorderWindow->Invalidate( pData->maMenuRect );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
+sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
@@ -371,11 +371,11 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
{
pData->maMouseOff = rMEvt.GetPosPixel();
pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff );
- USHORT nDragFullTest = 0;
+ sal_uInt16 nDragFullTest = 0;
if ( pData->mnHitTest )
{
- BOOL bTracking = TRUE;
- BOOL bHitTest = TRUE;
+ sal_Bool bTracking = sal_True;
+ sal_Bool bHitTest = sal_True;
if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE )
{
@@ -440,18 +440,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
}
else
{
- bTracking = FALSE;
+ bTracking = sal_False;
if ( (pData->mnHitTest & BORDERWINDOW_DRAW_TITLE) &&
((rMEvt.GetClicks() % 2) == 0) )
{
pData->mnHitTest = 0;
- bHitTest = FALSE;
+ bHitTest = sal_False;
if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() )
{
SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow());
- if ( TRUE /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required
+ if ( sal_True /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required
pClientWindow->TitleButtonClick( TITLE_BUTTON_DOCKING );
else if ( pBorderWindow->GetStyle() & WB_ROLLABLE )
{
@@ -468,9 +468,9 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
if ( bTracking )
{
- pData->mbDragFull = FALSE;
+ pData->mbDragFull = sal_False;
if ( nDragFullTest )
- pData->mbDragFull = TRUE; // always fulldrag for proper docking, ignore system settings
+ pData->mbDragFull = sal_True; // always fulldrag for proper docking, ignore system settings
pBorderWindow->StartTracking();
}
else if ( bHitTest )
@@ -478,18 +478,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
+sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
if ( rTEvt.IsTrackingEnded() )
{
- USHORT nHitTest = pData->mnHitTest;
+ sal_uInt16 nHitTest = pData->mnHitTest;
pData->mnHitTest = 0;
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
@@ -931,7 +931,7 @@ BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -940,9 +940,9 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData,
const Point& rPos,
Rectangle& rHelpRect )
{
- USHORT nHelpId = 0;
+ sal_uInt16 nHelpId = 0;
String aHelpStr;
- USHORT nHitTest = ImplHitTest( pData, rPos );
+ sal_uInt16 nHitTest = ImplHitTest( pData, rPos );
if ( nHitTest )
{
if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE )
@@ -1062,7 +1062,7 @@ long ImplNoBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplNoBorderWindowView::DrawWindow( USHORT, OutputDevice*, const Point* )
+void ImplNoBorderWindowView::DrawWindow( sal_uInt16, OutputDevice*, const Point* )
{
}
@@ -1088,7 +1088,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
mnHeight = nHeight;
mbNWFBorder = false;
- USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
+ sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
{
mnLeftBorder = 0;
@@ -1164,16 +1164,16 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( mnWidth && mnHeight )
{
- mpBorderWindow->SetPaintTransparent( TRUE );
+ mpBorderWindow->SetPaintTransparent( sal_True );
mpBorderWindow->SetBackground();
- pCtrl->SetPaintTransparent( TRUE );
+ pCtrl->SetPaintTransparent( sal_True );
Window* pCompoundParent = NULL;
if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() )
pCompoundParent = pWin->GetParent();
if( pCompoundParent )
- pCompoundParent->SetPaintTransparent( TRUE );
+ pCompoundParent->SetPaintTransparent( sal_True );
if( mnWidth < aBounds.GetWidth() || mnHeight < aBounds.GetHeight() )
{
@@ -1196,7 +1196,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( ! mbNWFBorder )
{
- USHORT nStyle = FRAME_DRAW_NODRAW;
+ sal_uInt16 nStyle = FRAME_DRAW_NODRAW;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
@@ -1237,13 +1237,13 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, const Point* )
+void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*, const Point* )
{
- USHORT nBorderStyle = mpBorderWindow->GetBorderStyle();
+ sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
return;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
// for native widget drawing we must find out what
// control this border belongs to
Window *pWin = NULL, *pCtrl = NULL;
@@ -1334,9 +1334,9 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
nState |= CTRL_STATE_FOCUSED;
}
- BOOL bMouseOver = FALSE;
+ sal_Bool bMouseOver = sal_False;
Window *pCtrlChild = pCtrl->GetWindow( WINDOW_FIRSTCHILD );
- while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == FALSE )
+ while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == sal_False )
pCtrlChild = pCtrlChild->GetWindow( WINDOW_NEXT );
if( bMouseOver )
@@ -1385,7 +1385,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
}
else
{
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
@@ -1417,7 +1417,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow )
{
maFrameData.mpBorderWindow = pBorderWindow;
- maFrameData.mbDragFull = FALSE;
+ maFrameData.mbDragFull = sal_False;
maFrameData.mnHitTest = 0;
maFrameData.mnPinState = 0;
maFrameData.mnCloseState = 0;
@@ -1444,21 +1444,21 @@ ImplStdBorderWindowView::~ImplStdBorderWindowView()
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
+sal_Bool ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt )
{
return ImplMouseMove( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
+sal_Bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt )
{
return ImplMouseButtonDown( &maFrameData, rMEvt );
}
// -----------------------------------------------------------------------
-BOOL ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
+sal_Bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt )
{
return ImplTracking( &maFrameData, rTEvt );
}
@@ -1654,7 +1654,7 @@ long ImplStdBorderWindowView::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
+void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset )
{
ImplBorderFrameData* pData = &maFrameData;
OutputDevice* pDev = pOutDev ? pOutDev : pData->mpOutDev;
@@ -1666,7 +1666,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
Color aFaceColor( rStyleSettings.GetFaceColor() );
Color aFrameColor( aFaceColor );
- aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255));
+ aFrameColor.DecreaseContrast( (sal_uInt8) (0.50 * 255));
// Draw Frame
if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
@@ -1762,7 +1762,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
if ( pOffset )
aInRect.Move( pOffset->X(), pOffset->Y() );
- USHORT nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
+ sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
// must show tooltip ?
TextRectInfo aInfo;
@@ -1852,14 +1852,14 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
// =======================================================================
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& )
{
ImplInit( pParent, nStyle, nTypeStyle, NULL );
}
void ImplBorderWindow::ImplInit( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
SystemParentData* pSystemParentData
)
{
@@ -1870,44 +1870,44 @@ void ImplBorderWindow::ImplInit( Window* pParent,
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
- mpWindowImpl->mbBorderWin = TRUE;
- mbSmallOutBorder = FALSE;
+ mpWindowImpl->mbBorderWin = sal_True;
+ mbSmallOutBorder = sal_False;
if ( nTypeStyle & BORDERWINDOW_STYLE_FRAME )
{
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = FALSE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = sal_False;
}
else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? FALSE : TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? sal_False : sal_True;
}
else
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
- mbFrameBorder = FALSE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
+ mbFrameBorder = sal_False;
// closeable windows may have a border as well, eg. system floating windows without caption
if ( (nOrgStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE/* | WB_CLOSEABLE*/)) == WB_BORDER )
- mbSmallOutBorder = TRUE;
+ mbSmallOutBorder = sal_True;
}
}
else if ( nTypeStyle & BORDERWINDOW_STYLE_OVERLAP )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mbFrameBorder = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mbFrameBorder = sal_True;
}
else
- mbFrameBorder = FALSE;
+ mbFrameBorder = sal_False;
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
- mbFloatWindow = TRUE;
+ mbFloatWindow = sal_True;
else
- mbFloatWindow = FALSE;
+ mbFloatWindow = sal_False;
Window::ImplInit( pParent, nStyle, pSystemParentData );
SetBackground();
@@ -1920,13 +1920,13 @@ void ImplBorderWindow::ImplInit( Window* pParent,
mnMaxHeight = SHRT_MAX;
mnRollHeight = 0;
mnOrgMenuHeight = 0;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbMenuHide = FALSE;
- mbDockBtn = FALSE;
- mbMenuBtn = FALSE;
- mbHideBtn = FALSE;
- mbHelpBtn = FALSE;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbMenuHide = sal_False;
+ mbDockBtn = sal_False;
+ mbMenuBtn = sal_False;
+ mbHideBtn = sal_False;
+ mbHelpBtn = sal_False;
mbDisplayActive = IsActive();
if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT )
@@ -1941,7 +1941,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
ImplBorderWindow::ImplBorderWindow( Window* pParent,
SystemParentData* pSystemParentData,
- WinBits nStyle, USHORT nTypeStyle
+ WinBits nStyle, sal_uInt16 nTypeStyle
) : Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData );
@@ -1950,14 +1950,14 @@ ImplBorderWindow::ImplBorderWindow( Window* pParent,
// -----------------------------------------------------------------------
ImplBorderWindow::ImplBorderWindow( Window* pParent, WinBits nStyle ,
- USHORT nTypeStyle ) :
+ sal_uInt16 nTypeStyle ) :
Window( WINDOW_BORDERWINDOW )
{
ImplInit( pParent, nStyle, nTypeStyle, ::com::sun::star::uno::Any() );
}
ImplBorderWindow::ImplBorderWindow( Window* pParent,
- WinBits nStyle, USHORT nTypeStyle,
+ WinBits nStyle, sal_uInt16 nTypeStyle,
const ::com::sun::star::uno::Any& aSystemToken ) :
Window( WINDOW_BORDERWINDOW )
{
@@ -2008,7 +2008,7 @@ void ImplBorderWindow::Draw( const Rectangle&, OutputDevice* pOutDev, const Poin
void ImplBorderWindow::Activate()
{
- SetDisplayActive( TRUE );
+ SetDisplayActive( sal_True );
Window::Activate();
}
@@ -2019,7 +2019,7 @@ void ImplBorderWindow::Deactivate()
// Fenster die immer Active sind, nehmen wir von dieser Regel aus,
// genauso, wenn ein Menu aktiv wird, ignorieren wir das Deactivate
if ( GetActivateMode() && !ImplGetSVData()->maWinData.mbNoDeactivate )
- SetDisplayActive( FALSE );
+ SetDisplayActive( sal_False );
Window::Deactivate();
}
@@ -2133,7 +2133,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
- UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( sal_True, ImplGetWindow()->GetOutputSizePixel() );
}
Window::DataChanged( rDCEvt );
@@ -2162,7 +2162,7 @@ void ImplBorderWindow::InitView()
// -----------------------------------------------------------------------
-void ImplBorderWindow::UpdateView( BOOL bNewView, const Size& rNewOutSize )
+void ImplBorderWindow::UpdateView( sal_Bool bNewView, const Size& rNewOutSize )
{
sal_Int32 nLeftBorder;
sal_Int32 nTopBorder;
@@ -2238,7 +2238,7 @@ void ImplBorderWindow::InvalidateBorder()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDisplayActive( BOOL bActive )
+void ImplBorderWindow::SetDisplayActive( sal_Bool bActive )
{
if ( mbDisplayActive != bActive )
{
@@ -2250,26 +2250,26 @@ void ImplBorderWindow::SetDisplayActive( BOOL bActive )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetTitleType( USHORT nTitleType, const Size& rSize )
+void ImplBorderWindow::SetTitleType( sal_uInt16 nTitleType, const Size& rSize )
{
mnTitleType = nTitleType;
- UpdateView( FALSE, rSize );
+ UpdateView( sal_False, rSize );
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetBorderStyle( USHORT nStyle )
+void ImplBorderWindow::SetBorderStyle( sal_uInt16 nStyle )
{
if ( !mbFrameBorder && (mnBorderStyle != nStyle) )
{
mnBorderStyle = nStyle;
- UpdateView( FALSE, ImplGetWindow()->GetOutputSizePixel() );
+ UpdateView( sal_False, ImplGetWindow()->GetOutputSizePixel() );
}
}
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetPin( BOOL bPin )
+void ImplBorderWindow::SetPin( sal_Bool bPin )
{
mbPined = bPin;
InvalidateBorder();
@@ -2277,11 +2277,11 @@ void ImplBorderWindow::SetPin( BOOL bPin )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetRollUp( BOOL bRollUp, const Size& rSize )
+void ImplBorderWindow::SetRollUp( sal_Bool bRollUp, const Size& rSize )
{
mbRollUp = bRollUp;
mnRollHeight = rSize.Height();
- UpdateView( FALSE, rSize );
+ UpdateView( sal_False, rSize );
}
// -----------------------------------------------------------------------
@@ -2296,7 +2296,7 @@ void ImplBorderWindow::SetCloser()
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetDockButton( BOOL bDockButton )
+void ImplBorderWindow::SetDockButton( sal_Bool bDockButton )
{
mbDockBtn = bDockButton;
Size aSize = GetOutputSizePixel();
@@ -2306,7 +2306,7 @@ void ImplBorderWindow::SetDockButton( BOOL bDockButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHideButton( BOOL bHideButton )
+void ImplBorderWindow::SetHideButton( sal_Bool bHideButton )
{
mbHideBtn = bHideButton;
Size aSize = GetOutputSizePixel();
@@ -2316,7 +2316,7 @@ void ImplBorderWindow::SetHideButton( BOOL bHideButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetHelpButton( BOOL bHelpButton )
+void ImplBorderWindow::SetHelpButton( sal_Bool bHelpButton )
{
mbHelpBtn = bHelpButton;
Size aSize = GetOutputSizePixel();
@@ -2326,7 +2326,7 @@ void ImplBorderWindow::SetHelpButton( BOOL bHelpButton )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuButton( BOOL bMenuButton )
+void ImplBorderWindow::SetMenuButton( sal_Bool bMenuButton )
{
mbMenuBtn = bMenuButton;
Size aSize = GetOutputSizePixel();
@@ -2353,7 +2353,7 @@ void ImplBorderWindow::SetMenuBarWindow( Window* pWindow )
// -----------------------------------------------------------------------
-void ImplBorderWindow::SetMenuBarMode( BOOL bHide )
+void ImplBorderWindow::SetMenuBarMode( sal_Bool bHide )
{
mbMenuHide = bHide;
UpdateMenuHeight();
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index c5f329f11c38..cf9697b4f602 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -40,7 +40,7 @@ typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator;
struct ImplBtnDlgItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
bool mbOwnButton;
bool mbDummyAlign;
long mnSepSize;
@@ -52,7 +52,7 @@ void ButtonDialog::ImplInitButtonDialogData()
mnButtonSize = 0;
mnCurButtonId = 0;
mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
ButtonDialog::ButtonDialog( WindowType nType ) :
@@ -86,7 +86,7 @@ ButtonDialog::~ButtonDialog()
}
}
-PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags )
+PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
{
PushButton* pBtn;
WinBits nStyle = 0;
@@ -108,7 +108,7 @@ PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags )
return pBtn;
}
-ImplBtnDlgItem* ButtonDialog::ImplGetItem( USHORT nId ) const
+ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const
{
for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
@@ -223,7 +223,7 @@ void ButtonDialog::ImplPosControls()
SetOutputSizePixel( aDlgSize );
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn )
@@ -281,13 +281,13 @@ void ButtonDialog::Click()
maClickHdl.Call( this );
}
-void ButtonDialog::AddButton( const XubString& rText, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = TRUE;
+ pItem->mbOwnButton = sal_True;
pItem->mnSepSize = nSepPixel;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
@@ -299,16 +299,16 @@ void ButtonDialog::AddButton( const XubString& rText, USHORT nId,
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = TRUE;
+ pItem->mbOwnButton = sal_True;
pItem->mnSepSize = nSepPixel;
if ( eType == BUTTON_OK )
@@ -333,16 +333,16 @@ void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId,
maItemList.push_back(pItem);
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId,
- USHORT nBtnFlags, long nSepPixel )
+void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId,
+ sal_uInt16 nBtnFlags, long nSepPixel )
{
// PageItem anlegen
ImplBtnDlgItem* pItem = new ImplBtnDlgItem;
pItem->mnId = nId;
- pItem->mbOwnButton = FALSE;
+ pItem->mbOwnButton = sal_False;
pItem->mnSepSize = nSepPixel;
pItem->mpPushButton = pBtn;
@@ -351,10 +351,10 @@ void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId,
maItemList.push_back(pItem);
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-void ButtonDialog::RemoveButton( USHORT nId )
+void ButtonDialog::RemoveButton( sal_uInt16 nId )
{
btn_iterator it;
for (it = maItemList.begin(); it != maItemList.end(); ++it)
@@ -367,7 +367,6 @@ void ButtonDialog::RemoveButton( USHORT nId )
delete it->mpPushButton;
maItemList.erase(it);
- mbFormat = TRUE;
break;
}
}
@@ -387,15 +386,15 @@ void ButtonDialog::Clear()
}
maItemList.clear();
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
-USHORT ButtonDialog::GetButtonCount() const
+sal_uInt16 ButtonDialog::GetButtonCount() const
{
- return (USHORT)maItemList.size();
+ return (sal_uInt16)maItemList.size();
}
-USHORT ButtonDialog::GetButtonId( USHORT nButton ) const
+sal_uInt16 ButtonDialog::GetButtonId( sal_uInt16 nButton ) const
{
if ( nButton < maItemList.size() )
return maItemList[nButton].mnId;
@@ -403,7 +402,7 @@ USHORT ButtonDialog::GetButtonId( USHORT nButton ) const
return BUTTONDIALOG_BUTTON_NOTFOUND;
}
-PushButton* ButtonDialog::GetPushButton( USHORT nId ) const
+PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -413,18 +412,18 @@ PushButton* ButtonDialog::GetPushButton( USHORT nId ) const
return NULL;
}
-void ButtonDialog::SetButtonText( USHORT nId, const XubString& rText )
+void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
{
pItem->mpPushButton->SetText( rText );
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
}
-XubString ButtonDialog::GetButtonText( USHORT nId ) const
+XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -434,7 +433,7 @@ XubString ButtonDialog::GetButtonText( USHORT nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText )
+void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -442,7 +441,7 @@ void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText )
pItem->mpPushButton->SetHelpText( rText );
}
-XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
+XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -452,22 +451,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
return ImplGetSVEmptyStr();
}
-void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
+void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( nHelpId );
+ pItem->mpPushButton->SetHelpId( rHelpId );
}
-ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
+rtl::OString ButtonDialog::GetButtonHelpId( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- if ( pItem )
- return pItem->mpPushButton->GetHelpId();
- else
- return 0;
+ return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx
index ae5b765909ba..1fa77a3621cd 100644
--- a/vcl/source/window/cmdevt.cxx
+++ b/vcl/source/window/cmdevt.cxx
@@ -42,24 +42,24 @@ CommandExtTextInputData::CommandExtTextInputData()
mnDeltaStart = 0;
mnOldTextLen = 0;
mnCursorFlags = 0;
- mbOnlyCursor = FALSE;
+ mbOnlyCursor = sal_False;
}
// -----------------------------------------------------------------------
CommandExtTextInputData::CommandExtTextInputData( const XubString& rText,
- const USHORT* pTextAttr,
+ const sal_uInt16* pTextAttr,
xub_StrLen nCursorPos,
- USHORT nCursorFlags,
+ sal_uInt16 nCursorFlags,
xub_StrLen nDeltaStart,
xub_StrLen nOldTextLen,
- BOOL bOnlyCursor ) :
+ sal_Bool bOnlyCursor ) :
maText( rText )
{
if ( pTextAttr && maText.Len() )
{
- mpTextAttr = new USHORT[maText.Len()];
- memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(USHORT) );
+ mpTextAttr = new sal_uInt16[maText.Len()];
+ memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
@@ -77,8 +77,8 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData&
{
if ( rData.mpTextAttr && maText.Len() )
{
- mpTextAttr = new USHORT[maText.Len()];
- memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(USHORT) );
+ mpTextAttr = new sal_uInt16[maText.Len()];
+ memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) );
}
else
mpTextAttr = NULL;
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 21ef136ad663..318529dcc7d9 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -48,8 +48,8 @@ struct ImplCursorData
long mnPixSlant; // Pixel-Slant
short mnOrientation; // Pixel-Orientation
unsigned char mnDirection; // indicates writing direction
- USHORT mnStyle; // Cursor-Style
- BOOL mbCurVisible; // Ist Cursor aktuell sichtbar
+ sal_uInt16 mnStyle; // Cursor-Style
+ sal_Bool mbCurVisible; // Ist Cursor aktuell sichtbar
Window* mpWindow; // Zugeordnetes Windows
};
@@ -58,9 +58,9 @@ struct ImplCursorData
static void ImplCursorInvert( ImplCursorData* pData )
{
Window* pWindow = pData->mpWindow;
- BOOL bMapMode = pWindow->IsMapModeEnabled();
- pWindow->EnableMapMode( FALSE );
- USHORT nInvertStyle;
+ sal_Bool bMapMode = pWindow->IsMapModeEnabled();
+ pWindow->EnableMapMode( sal_False );
+ sal_uInt16 nInvertStyle;
if ( pData->mnStyle & CURSOR_SHADOW )
nInvertStyle = INVERT_50;
else
@@ -155,7 +155,7 @@ void Cursor::ImplDraw()
// Ausgabeflaeche berechnen und ausgeben
ImplCursorInvert( mpData );
- mpData->mbCurVisible = TRUE;
+ mpData->mbCurVisible = sal_True;
}
}
@@ -166,13 +166,13 @@ void Cursor::ImplRestore()
if ( mpData && mpData->mbCurVisible )
{
ImplCursorInvert( mpData );
- mpData->mbCurVisible = FALSE;
+ mpData->mbCurVisible = sal_False;
}
}
// -----------------------------------------------------------------------
-void Cursor::ImplShow( BOOL bDrawDirect )
+void Cursor::ImplShow( sal_Bool bDrawDirect )
{
if ( mbVisible )
{
@@ -194,7 +194,7 @@ void Cursor::ImplShow( BOOL bDrawDirect )
if ( !mpData )
{
mpData = new ImplCursorData;
- mpData->mbCurVisible = FALSE;
+ mpData->mbCurVisible = sal_False;
mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, ImplTimerHdl ) );
}
@@ -269,7 +269,7 @@ Cursor::Cursor()
mnOrientation = 0;
mnDirection = 0;
mnStyle = 0;
- mbVisible = FALSE;
+ mbVisible = sal_False;
}
// -----------------------------------------------------------------------
@@ -302,7 +302,7 @@ Cursor::~Cursor()
// -----------------------------------------------------------------------
-void Cursor::SetStyle( USHORT nStyle )
+void Cursor::SetStyle( sal_uInt16 nStyle )
{
if ( mnStyle != nStyle )
{
@@ -317,7 +317,7 @@ void Cursor::Show()
{
if ( !mbVisible )
{
- mbVisible = TRUE;
+ mbVisible = sal_True;
ImplShow();
}
}
@@ -328,7 +328,7 @@ void Cursor::Hide()
{
if ( mbVisible )
{
- mbVisible = FALSE;
+ mbVisible = sal_False;
ImplHide();
}
}
@@ -449,7 +449,7 @@ Cursor& Cursor::operator=( const Cursor& rCursor )
// -----------------------------------------------------------------------
-BOOL Cursor::operator==( const Cursor& rCursor ) const
+sal_Bool Cursor::operator==( const Cursor& rCursor ) const
{
if ( (maPos == rCursor.maPos) &&
(maSize == rCursor.maSize) &&
@@ -457,9 +457,9 @@ BOOL Cursor::operator==( const Cursor& rCursor ) const
(mnOrientation == rCursor.mnOrientation) &&
(mnDirection == rCursor.mnDirection) &&
(mbVisible == rCursor.mbVisible) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 0cb89a025f5d..125c927bf673 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -45,71 +45,6 @@
// =======================================================================
-void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect,
- USHORT nStyle, BOOL bClose )
-{
- DecorationView aView( pDev );
- const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
- Rectangle aRect = rRect;
- Color aColor1;
- Color aColor2;
-
- pDev->SetFillColor();
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- {
- aColor1 = rStyleSettings.GetShadowColor();
- aColor2 = rStyleSettings.GetLightColor();
- }
- else
- {
- aColor1 = rStyleSettings.GetLightColor();
- aColor2 = rStyleSettings.GetShadowColor();
- }
- aView.DrawFrame( aRect, aColor1, aColor2 );
-
- aRect.Left() += 2;
- aRect.Top() += 2;
- aRect.Right() -= 2;
- aRect.Bottom() -= 2;
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- if ( bClose )
- {
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ),
- Point( aRect.Right()-1, aRect.Top()+2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
- pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) );
- }
-
- if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) )
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- else
- pDev->SetLineColor( rStyleSettings.GetLightColor() );
- if ( bClose )
- {
- pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ),
- Point( aRect.Left()+1, aRect.Bottom()-2 ) );
- }
- else
- {
- pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() );
- pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() );
- }
-}
-
-// =======================================================================
-
static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
SymbolType eType )
{
@@ -509,7 +444,7 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
case SYMBOL_CHECKMARK:
{
// #106953# never mirror checkmarks
- BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ sal_Bool bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
Point aPos1( bRTL ? rRect.Right() : rRect.Left(),
rRect.Bottom() - rRect.GetHeight() / 3 );
Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3,
@@ -631,57 +566,22 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
pDev->DrawRect( aRect );
}
break;
-
- case SYMBOL_OS2CLOSE:
- {
- Rectangle aRect( nCenterX-n2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- ImplDrawOS2Symbol( pDev, aRect, 0, TRUE );
- }
- break;
-
- case SYMBOL_OS2FLOAT:
- {
- Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4,
- nCenterX+n2-4, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- DecorationView aDecoView( pDev );
- Rectangle aRect2( nCenterX-n2, nCenterY-n2,
- nCenterX-n2+2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect2,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- Rectangle aRect3( nCenterX+n2-2, nCenterY-n2,
- nCenterX+n2, nCenterY+n2 );
- aDecoView.DrawFrame( aRect3,
- pDev->GetSettings().GetStyleSettings().GetLightColor(),
- pDev->GetSettings().GetStyleSettings().GetShadowColor() );
- }
- break;
-
- case SYMBOL_OS2HIDE:
- {
- Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3,
- nCenterX+n2-3, nCenterY+n2-3 );
- ImplDrawOS2Symbol( pDev, aRect, 0, FALSE );
- }
- break;
}
}
// -----------------------------------------------------------------------
void DecorationView::DrawSymbol( const Rectangle& rRect, SymbolType eType,
- const Color& rColor, USHORT nStyle )
+ const Color& rColor, sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
mpOutDev->SetLineColor();
mpOutDev->SetFillColor( rColor );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(mpOutDev->GetOutDevType() == OUTDEV_PRINTER) )
@@ -725,8 +625,8 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
Rectangle aRect = mpOutDev->LogicToPixel( rRect );
Color aOldLineColor = mpOutDev->GetLineColor();
Color aOldFillColor = mpOutDev->GetFillColor();
- BOOL bOldMapMode = mpOutDev->IsMapModeEnabled();
- mpOutDev->EnableMapMode( FALSE );
+ sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled();
+ mpOutDev->EnableMapMode( sal_False );
mpOutDev->SetLineColor();
mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor );
mpOutDev->SetLineColor( aOldLineColor );
@@ -737,7 +637,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
// =======================================================================
void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Color aLightColor = rStyleSettings.GetLightColor();
@@ -787,7 +687,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
// =======================================================================
static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
- const Color* pColor, BOOL bRound = FALSE )
+ const Color* pColor, sal_Bool bRound = sal_False )
{
long nLineWidth = pDev->ImplGetDPIX()/300;
long nLineHeight = pDev->ImplGetDPIY()/300;
@@ -836,10 +736,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
// =======================================================================
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
// mask menu style
- BOOL bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? TRUE : FALSE;
+ sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
nStyle &= ~FRAME_DRAW_MENU;
Window *pWin = NULL;
@@ -850,7 +750,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// menus may use different border colors (eg on XP)
// normal frames will be drawn using the shadow color
// whereas window frame borders will use black
- BOOL bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
+ sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
// no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
// will not affect frame windows (like dropdowns)
@@ -859,13 +759,13 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// check for formcontrol, i.e., a control without NWF enabled
Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) );
if( pControl && pControl->IsNativeWidgetEnabled() )
- bFlatBorders = TRUE;
+ bFlatBorders = sal_True;
else
- bFlatBorders = FALSE;
+ bFlatBorders = sal_False;
}
// no round corners for window frame borders
- BOOL bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
+ sal_Bool bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER));
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) ||
@@ -874,7 +774,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if ( nStyle & FRAME_DRAW_NODRAW )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -889,7 +789,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
ImplDrawDPILineRect( pDev, rRect, NULL, bRound );
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
@@ -919,7 +819,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
{
if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) )
{
- USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
+ sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
@@ -956,7 +856,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE;
+ sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE;
if ( nFrameStyle == FRAME_DRAW_GROUP )
{
pDev->SetFillColor();
@@ -1031,7 +931,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rRect.Right()--;
rRect.Bottom()--;
- BOOL bDrawn = TRUE;
+ sal_Bool bDrawn = sal_True;
if ( nFrameStyle == FRAME_DRAW_DOUBLEIN )
{
if( bFlatBorders ) // no 3d effect
@@ -1051,7 +951,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
rStyleSettings.GetLightColor(),
rStyleSettings.GetShadowColor() );
else
- bDrawn = FALSE;
+ bDrawn = sal_False;
}
if( bDrawn )
{
@@ -1068,14 +968,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )
@@ -1104,7 +1004,7 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle )
// =======================================================================
static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
- const StyleSettings& rStyleSettings, USHORT nStyle )
+ const StyleSettings& rStyleSettings, sal_uInt16 nStyle )
{
Rectangle aFillRect = rRect;
@@ -1317,14 +1217,14 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
// -----------------------------------------------------------------------
-Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle )
+Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 nStyle )
{
Rectangle aRect = rRect;
- BOOL bOldMap = mpOutDev->IsMapModeEnabled();
+ sal_Bool bOldMap = mpOutDev->IsMapModeEnabled();
if ( bOldMap )
{
aRect = mpOutDev->LogicToPixel( aRect );
- mpOutDev->EnableMapMode( FALSE );
+ mpOutDev->EnableMapMode( sal_False );
}
if ( !rRect.IsEmpty() )
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 63da028e82d2..7e2725e07023 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -73,24 +73,24 @@ static ByteString ImplGetDialogText( Dialog* pDialog )
// =======================================================================
-static BOOL ImplIsMnemonicCtrl( Window* pWindow )
+static sal_Bool ImplIsMnemonicCtrl( Window* pWindow )
{
if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() )
- return FALSE;
+ return sal_False;
if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) ||
(pWindow->GetType() == WINDOW_CHECKBOX) ||
(pWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pWindow->GetType() == WINDOW_PUSHBUTTON) )
- return TRUE;
+ return sal_True;
if ( pWindow->GetType() == WINDOW_FIXEDTEXT )
{
if ( pWindow->GetStyle() & (WB_INFO | WB_NOLABEL) )
- return FALSE;
+ return sal_False;
Window* pNextWindow = pWindow->GetWindow( WINDOW_NEXT );
if ( !pNextWindow )
- return FALSE;
+ return sal_False;
pNextWindow = pNextWindow->GetWindow( WINDOW_CLIENT );
if ( !(pNextWindow->GetStyle() & WB_TABSTOP) ||
(pNextWindow->GetType() == WINDOW_FIXEDTEXT) ||
@@ -99,12 +99,12 @@ static BOOL ImplIsMnemonicCtrl( Window* pWindow )
(pNextWindow->GetType() == WINDOW_CHECKBOX) ||
(pNextWindow->GetType() == WINDOW_TRISTATEBOX) ||
(pNextWindow->GetType() == WINDOW_PUSHBUTTON) )
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -215,7 +215,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog )
static void ImplMouseAutoPos( Dialog* pDialog )
{
- ULONG nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions();
+ sal_uLong nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions();
if ( nMouseOptions & MOUSE_OPTION_AUTOCENTERPOS )
{
Size aSize = pDialog->GetOutputSizePixel();
@@ -250,13 +250,13 @@ struct DialogImpl
void Dialog::ImplInitDialogData()
{
- mpWindowImpl->mbDialog = TRUE;
+ mpWindowImpl->mbDialog = sal_True;
mpDialogParent = NULL;
mpPrevExecuteDlg = NULL;
- mbInExecute = FALSE;
- mbOldSaveBack = FALSE;
- mbInClose = FALSE;
- mbModalMode = FALSE;
+ mbInExecute = sal_False;
+ mbOldSaveBack = sal_False;
+ mbInClose = sal_False;
+ mbModalMode = sal_False;
mnMousePositioned = 0;
mpDialogImpl = new DialogImpl;
}
@@ -265,7 +265,7 @@ void Dialog::ImplInitDialogData()
void Dialog::ImplInit( Window* pParent, WinBits nStyle )
{
- USHORT nSysWinMode = Application::GetSystemWindowMode();
+ sal_uInt16 nSysWinMode = Application::GetSystemWindowMode();
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
@@ -291,7 +291,7 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
while ( pExeDlg )
{
// Nur wenn er sichtbar und enabled ist
- if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, TRUE ) &&
+ if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, sal_True ) &&
pExeDlg->IsReallyVisible() &&
pExeDlg->IsEnabled() && pExeDlg->IsInputEnabled() && !pExeDlg->IsInModalMode() )
{
@@ -341,8 +341,8 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
}
else
{
- mpWindowImpl->mbFrame = TRUE;
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = sal_True;
+ mpWindowImpl->mbOverlapWin = sal_True;
SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, NULL );
// Now set all style bits
mpWindowImpl->mnStyle = nStyle;
@@ -374,7 +374,7 @@ void Dialog::ImplInitSettings()
else if( IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG ) )
{
mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
// fallback to settings color
else
@@ -467,7 +467,7 @@ long Dialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_ESCAPE) &&
((GetStyle() & WB_CLOSEABLE) || ImplGetCancelButton( this ) || ImplGetOKButton( this )) )
@@ -477,7 +477,7 @@ long Dialog::Notify( NotifyEvent& rNEvt )
// post this Close asynchronous so we can leave our key handler before
// we get destroyed
PostUserEvent( LINK( this, Dialog, ImplAsyncCloseHdl ), this );
- return TRUE;
+ return sal_True;
}
}
else if ( rNEvt.GetType() == EVENT_GETFOCUS )
@@ -488,8 +488,8 @@ long Dialog::Notify( NotifyEvent& rNEvt )
if( mbInExecute && mbModalMode )
{
// do not change modal counter (pSVData->maAppData.mnModalDialog)
- SetModalInputMode( FALSE );
- SetModalInputMode( TRUE );
+ SetModalInputMode( sal_False );
+ SetModalInputMode( sal_True );
// #93022# def-button might have changed after show
if( !mnMousePositioned )
@@ -554,7 +554,7 @@ void Dialog::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-BOOL Dialog::Close()
+sal_Bool Dialog::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
@@ -567,21 +567,21 @@ BOOL Dialog::Close()
// ( Note: ) this used to work ( something changes somewhere )
if (mnCancelClose != 0)
{
- return FALSE;
+ return sal_False;
}
//liuchen 2009-7-22
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && !IsInExecute() )
- return FALSE;
+ return sal_False;
- mbInClose = TRUE;
+ mbInClose = sal_True;
if ( !(GetStyle() & WB_CLOSEABLE) )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
ImplAddDel( &aDelData );
PushButton* pButton = ImplGetCancelButton( this );
if ( pButton )
@@ -592,30 +592,30 @@ BOOL Dialog::Close()
if ( pButton )
pButton->Click();
else
- bRet = FALSE;
+ bRet = sal_False;
}
if ( aDelData.IsDelete() )
- return TRUE;
+ return sal_True;
ImplRemoveDel( &aDelData );
return bRet;
}
if ( IsInExecute() )
{
- EndDialog( FALSE );
- mbInClose = FALSE;
- return TRUE;
+ EndDialog( sal_False );
+ mbInClose = sal_False;
+ return sal_True;
}
else
{
- mbInClose = FALSE;
+ mbInClose = sal_False;
return SystemWindow::Close();
}
}
// -----------------------------------------------------------------------
-BOOL Dialog::ImplStartExecuteModal()
+sal_Bool Dialog::ImplStartExecuteModal()
{
if ( mbInExecute )
{
@@ -624,7 +624,7 @@ BOOL Dialog::ImplStartExecuteModal()
aErrorStr += ImplGetDialogText( this );
OSL_FAIL( aErrorStr.GetBuffer() );
#endif
- return FALSE;
+ return sal_False;
}
if ( Application::IsDialogCancelEnabled() )
@@ -634,7 +634,7 @@ BOOL Dialog::ImplStartExecuteModal()
aErrorStr += ImplGetDialogText( this );
OSL_FAIL( aErrorStr.GetBuffer() );
#endif
- return FALSE;
+ return sal_False;
}
#ifdef DBG_UTIL
@@ -663,15 +663,15 @@ BOOL Dialog::ImplStartExecuteModal()
pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_CANCEL );
if ( pSVData->maWinData.mpCaptureWin )
pSVData->maWinData.mpCaptureWin->ReleaseMouse();
- EnableInput( TRUE, TRUE );
+ EnableInput( sal_True, sal_True );
if ( GetParent() )
{
NotifyEvent aNEvt( EVENT_EXECUTEDIALOG, this );
GetParent()->Notify( aNEvt );
}
- mbInExecute = TRUE;
- SetModalInputMode( TRUE );
+ mbInExecute = sal_True;
+ SetModalInputMode( sal_True );
mbOldSaveBack = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -681,7 +681,7 @@ BOOL Dialog::ImplStartExecuteModal()
Show();
pSVData->maAppData.mnModalMode++;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -753,7 +753,7 @@ void Dialog::StartExecuteModal( const Link& rEndDialogHdl )
// -----------------------------------------------------------------------
-BOOL Dialog::IsStartedModal() const
+sal_Bool Dialog::IsStartedModal() const
{
return mpDialogImpl->mbStartedModal;
}
@@ -764,7 +764,7 @@ void Dialog::EndDialog( long nResult )
{
if ( mbInExecute )
{
- SetModalInputMode( FALSE );
+ SetModalInputMode( sal_False );
// Dialog aus der Kette der Dialoge die in Execute stehen entfernen
ImplSVData* pSVData = ImplGetSVData();
@@ -812,7 +812,7 @@ void Dialog::EndDialog( long nResult )
mpDialogImpl->mbStartedModal = false;
mpDialogImpl->mnResult = -1;
}
- mbInExecute = FALSE;
+ mbInExecute = sal_False;
}
}
@@ -833,9 +833,9 @@ void Dialog::EndAllDialogs( Window* pParent )
while ( pModDialog )
{
pTempModDialog = pModDialog->mpPrevExecuteDlg;
- if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, TRUE ) ) )
+ if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, sal_True ) ) )
{
- pModDialog->EndDialog( FALSE );
+ pModDialog->EndDialog( sal_False );
pModDialog->PostUserEvent( Link() );
}
pModDialog = pTempModDialog;
@@ -844,7 +844,7 @@ void Dialog::EndAllDialogs( Window* pParent )
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( BOOL bModal )
+void Dialog::SetModalInputMode( sal_Bool bModal )
{
if ( bModal == mbModalMode )
return;
@@ -858,8 +858,8 @@ void Dialog::SetModalInputMode( BOOL bModal )
// Diable the prev Modal Dialog, because our dialog must close at first,
// before the other dialog can be closed (because the other dialog
// is on stack since our dialog returns)
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
- mpPrevExecuteDlg->EnableInput( FALSE, TRUE, TRUE, this );
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) )
+ mpPrevExecuteDlg->EnableInput( sal_False, sal_True, sal_True, this );
// determine next overlap dialog parent
Window* pParent = GetParent();
@@ -886,20 +886,20 @@ void Dialog::SetModalInputMode( BOOL bModal )
}
// Enable the prev Modal Dialog
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) )
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) )
{
- mpPrevExecuteDlg->EnableInput( TRUE, TRUE, TRUE, this );
+ mpPrevExecuteDlg->EnableInput( sal_True, sal_True, sal_True, this );
// ensure continued modality of prev dialog
// do not change modality counter
- mpPrevExecuteDlg->SetModalInputMode( FALSE );
- mpPrevExecuteDlg->SetModalInputMode( TRUE );
+ mpPrevExecuteDlg->SetModalInputMode( sal_False );
+ mpPrevExecuteDlg->SetModalInputMode( sal_True );
}
}
}
// -----------------------------------------------------------------------
-void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs )
+void Dialog::SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs )
{
if ( bSubModalDialogs )
{
@@ -908,7 +908,7 @@ void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs )
while ( pOverlap )
{
if ( pOverlap->IsDialog() )
- ((Dialog*)pOverlap)->SetModalInputMode( bModal, TRUE );
+ ((Dialog*)pOverlap)->SetModalInputMode( bModal, sal_True );
pOverlap = pOverlap->mpWindowImpl->mpNext;
}
}
@@ -943,7 +943,7 @@ void Dialog::GrabFocusToFirstControl()
!pFocusControl->IsVisible() ||
!pFocusControl->IsEnabled() || !pFocusControl->IsInputEnabled() )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
pFocusControl = ImplGetDlgWindow( n, DLGWINDOW_FIRST );
}
if ( pFocusControl )
@@ -955,13 +955,13 @@ void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
ImplBorderWindow aImplWin( (Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
// aImplWin.SetText( GetText() );
// aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
-// aImplWin.SetDisplayActive( TRUE );
+// aImplWin.SetDisplayActive( sal_True );
// aImplWin.InitView();
aImplWin.GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder );
}
-void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG )
+void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
@@ -987,7 +987,7 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULO
ImplBorderWindow aImplWin( this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP );
aImplWin.SetText( GetText() );
aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() );
- aImplWin.SetDisplayActive( TRUE );
+ aImplWin.SetDisplayActive( sal_True );
aImplWin.InitView();
aImplWin.Draw( Rectangle( aPos, aSize ), pDev, aPos );
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index a1e8d3219d33..ce7b6dca8119 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -45,7 +45,7 @@ using namespace ::com::sun::star;
// =======================================================================
-static BOOL ImplHasIndirectTabParent( Window* pWindow )
+static sal_Bool ImplHasIndirectTabParent( Window* pWindow )
{
// The window has inderect tab parent if it is included in tab hierarchy
// of the indirect parent window
@@ -75,7 +75,7 @@ static Window* ImplGetTopParentOfTabHierarchy( Window* pParent )
// -----------------------------------------------------------------------
-static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex )
+static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex )
{
Window* pTabPage = NULL;
Window* pFoundWindow = NULL;
@@ -151,7 +151,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex
// -----------------------------------------------------------------------
-static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
+static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
{
pParent = ImplGetTopParentOfTabHierarchy( pParent );
@@ -159,7 +159,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO
Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex );
if ( bTestEnable )
{
- USHORT n2 = nIndex;
+ sal_uInt16 n2 = nIndex;
while ( pWindow && (!pWindow->IsEnabled() || !pWindow->IsInputEnabled()) )
{
n2 = nIndex+1;
@@ -185,7 +185,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO
// -----------------------------------------------------------------------
-static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable )
+static Window* ImplGetNextWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable )
{
Window* pWindow = ImplGetChildWindow( pParent, n+1, nIndex, bTestEnable );
if ( n == nIndex )
@@ -198,17 +198,17 @@ static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOO
// -----------------------------------------------------------------------
-Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
- USHORT nFormStart, USHORT nFormEnd,
- USHORT* pIndex )
+Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType,
+ sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
+ sal_uInt16* pIndex )
{
DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd),
"Window::ImplGetDlgWindow() - nIndex not in Form" );
Window* pWindow = NULL;
- USHORT i;
- USHORT nTemp;
- USHORT nStartIndex;
+ sal_uInt16 i;
+ sal_uInt16 nTemp;
+ sal_uInt16 nStartIndex;
if ( nType == DLGWINDOW_PREV )
{
@@ -219,7 +219,7 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
i--;
else
i = nFormEnd;
- pWindow = ImplGetChildWindow( this, i, nTemp, TRUE );
+ pWindow = ImplGetChildWindow( this, i, nTemp, sal_True );
if ( !pWindow )
break;
if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) )
@@ -239,19 +239,19 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
{
if ( i < nFormEnd )
{
- pWindow = ImplGetNextWindow( this, i, i, TRUE );
+ pWindow = ImplGetNextWindow( this, i, i, sal_True );
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
}
else
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
}
if ( i <= nFormEnd )
{
// 2ten Index mitfuehren, falls alle Controls disablte
- USHORT nStartIndex2 = i;
- USHORT nOldIndex = i+1;
+ sal_uInt16 nStartIndex2 = i;
+ sal_uInt16 nOldIndex = i+1;
do
{
@@ -264,9 +264,9 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
}
nOldIndex = i;
if ( (i > nFormEnd) || (i < nFormStart) )
- pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True );
else
- pWindow = ImplGetNextWindow( this, i, i, TRUE );
+ pWindow = ImplGetNextWindow( this, i, i, sal_True );
}
while ( (i != nStartIndex) && (i != nStartIndex2) );
@@ -304,20 +304,20 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType,
// -----------------------------------------------------------------------
-static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex,
- USHORT& rFormStart, USHORT& rFormEnd )
+static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt16& rIndex,
+ sal_uInt16& rFormStart, sal_uInt16& rFormEnd )
{
Window* pSWindow;
Window* pSecondWindow = NULL;
Window* pTempWindow = NULL;
- USHORT i;
- USHORT nSecond_i = 0;
- USHORT nFormStart = 0;
- USHORT nSecondFormStart = 0;
- USHORT nFormEnd;
+ sal_uInt16 i;
+ sal_uInt16 nSecond_i = 0;
+ sal_uInt16 nFormStart = 0;
+ sal_uInt16 nSecondFormStart = 0;
+ sal_uInt16 nFormEnd;
// Focus-Fenster in der Child-Liste suchen
- Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE );
+ Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, sal_False );
if( pWindow == NULL )
pWindow = pSWindow;
@@ -340,7 +340,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
break;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
if ( !i )
pSWindow = NULL;
}
@@ -370,7 +370,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
do
{
nFormEnd = i;
- pTempWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pTempWindow = ImplGetNextWindow( pParent, i, i, sal_False );
// the DialogControlStart mark is only accepted for the direct children
if ( !i
@@ -388,7 +388,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
if ( nIteration >= 2 )
{
// this is an unexpected scenario
- DBG_ASSERT( FALSE, "It seems to be an endless loop!" );
+ DBG_ASSERT( sal_False, "It seems to be an endless loop!" );
rFormStart = 0;
break;
}
@@ -402,16 +402,16 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT&
// -----------------------------------------------------------------------
-static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode,
- USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE )
+static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Unicode cCharCode,
+ sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_Bool bCheckEnable = sal_True )
{
DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd),
"Window::ImplFindAccelWindow() - rIndex not in Form" );
xub_Unicode cCompareChar;
- USHORT nStart = rIndex;
- USHORT i = rIndex;
- int bSearch = TRUE;
+ sal_uInt16 nStart = rIndex;
+ sal_uInt16 i = rIndex;
+ int bSearch = sal_True;
Window* pWindow;
// MT: Where can we keep the CharClass?!
@@ -423,13 +423,13 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0];
if ( i < nFormEnd )
- pWindow = ImplGetNextWindow( pParent, i, i, TRUE );
+ pWindow = ImplGetNextWindow( pParent, i, i, sal_True );
else
- pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE );
+ pWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_True );
while( bSearch && pWindow )
{
const XubString aStr = pWindow->GetText();
- USHORT nPos = aStr.Search( '~' );
+ sal_uInt16 nPos = aStr.Search( '~' );
while ( nPos != STRING_NOTFOUND )
{
cCompareChar = aStr.GetChar( nPos+1 );
@@ -453,9 +453,9 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
// children checked for accelerators
if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 )
{
- USHORT nChildIndex;
- USHORT nChildFormStart;
- USHORT nChildFormEnd;
+ sal_uInt16 nChildIndex;
+ sal_uInt16 nChildFormStart;
+ sal_uInt16 nChildFormEnd;
// get form start and end
::ImplFindDlgCtrlWindow( pWindow, NULL,
@@ -485,14 +485,14 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode
// -----------------------------------------------------------------------
-void Window::ImplControlFocus( USHORT nFlags )
+void Window::ImplControlFocus( sal_uInt16 nFlags )
{
if ( nFlags & GETFOCUS_MNEMONIC )
{
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
+ ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -505,8 +505,8 @@ void Window::ImplControlFocus( USHORT nFlags )
((CheckBox*)this)->ImplCheck();
else if ( mpWindowImpl->mbPushButton )
{
- ((PushButton*)this)->SetPressed( TRUE );
- ((PushButton*)this)->SetPressed( FALSE );
+ ((PushButton*)this)->SetPressed( sal_True );
+ ((PushButton*)this)->SetPressed( sal_False );
((PushButton*)this)->Click();
}
}
@@ -517,7 +517,7 @@ void Window::ImplControlFocus( USHORT nFlags )
if ( GetType() == WINDOW_RADIOBUTTON )
{
if ( !((RadioButton*)this)->IsChecked() )
- ((RadioButton*)this)->ImplCallClick( TRUE, nFlags );
+ ((RadioButton*)this)->ImplCallClick( sal_True, nFlags );
else
ImplGrabFocus( nFlags );
}
@@ -528,32 +528,32 @@ void Window::ImplControlFocus( USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
+sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
Window* pSWindow;
Window* pTempWindow;
Window* pButtonWindow;
- USHORT i;
- USHORT iButton;
- USHORT iButtonStart;
- USHORT iTemp;
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
- USHORT nDlgCtrlFlags;
+ sal_uInt16 i;
+ sal_uInt16 iButton;
+ sal_uInt16 iButtonStart;
+ sal_uInt16 iTemp;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
+ sal_uInt16 nDlgCtrlFlags;
// Ohne Focus-Window koennen wir auch keine Steuerung uebernehmen
Window* pFocusWindow = Application::GetFocusWindow();
if ( !pFocusWindow || !ImplIsWindowOrChild( pFocusWindow ) )
- return FALSE;
+ return sal_False;
// Focus-Fenster in der Child-Liste suchen
pSWindow = ::ImplFindDlgCtrlWindow( this, pFocusWindow,
nIndex, nFormStart, nFormEnd );
if ( !pSWindow )
- return FALSE;
+ return sal_False;
i = nIndex;
nDlgCtrlFlags = 0;
@@ -572,7 +572,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( nKeyCode == KEY_RETURN )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
iButtonStart = iButton;
while ( pButtonWindow )
{
@@ -580,17 +580,17 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pButtonWindow->mpWindowImpl->mbPushButton )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) )
{
- USHORT nType;
- USHORT nGetFocusFlags = GETFOCUS_TAB;
- USHORT nNewIndex;
- USHORT iStart;
+ sal_uInt16 nType;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
+ sal_uInt16 nNewIndex;
+ sal_uInt16 iStart;
if ( aKeyCode.IsShift() )
{
nType = DLGWINDOW_PREV;
@@ -619,7 +619,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pTempWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
else
{
@@ -641,21 +641,21 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return TRUE;
+ return sal_True;
}
}
}
else if ( nKeyCode == KEY_ESCAPE )
{
// Wir suchen zuerst nach einem DefPushButton/CancelButton
- pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE );
+ pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True );
iButtonStart = iButton;
while ( pButtonWindow )
{
if ( pButtonWindow->GetType() == WINDOW_CANCELBUTTON )
break;
- pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE );
+ pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True );
if ( (iButton <= iButtonStart) || (iButton > nFormEnd) )
pButtonWindow = NULL;
}
@@ -664,9 +664,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- return TRUE;
+ return sal_True;
}
}
}
@@ -677,10 +677,10 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
// keine Alt-Taste abfangen, wegen Windows
if ( !aKeyCode.IsMod2() )
{
- USHORT nType;
- USHORT nGetFocusFlags = GETFOCUS_TAB;
- USHORT nNewIndex;
- BOOL bFormular = FALSE;
+ sal_uInt16 nType;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
+ sal_uInt16 nNewIndex;
+ sal_Bool bFormular = sal_False;
// Bei Ctrl-Tab erstmal testen, ob zwischen Formularen
// gesprungen werden soll
@@ -689,7 +689,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
// Gruppe suchen
Window* pFormularFirstWindow = NULL;
Window* pLastFormularFirstWindow = NULL;
- pTempWindow = ImplGetChildWindow( this, 0, iTemp, FALSE );
+ pTempWindow = ImplGetChildWindow( this, 0, iTemp, sal_False );
Window* pPrevFirstFormularFirstWindow = NULL;
Window* pFirstFormularFirstWindow = pTempWindow;
while ( pTempWindow )
@@ -697,7 +697,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() )
{
if ( iTemp != 0 )
- bFormular = TRUE;
+ bFormular = sal_True;
if ( aKeyCode.IsShift() )
{
if ( iTemp <= nIndex )
@@ -712,7 +712,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pLastFormularFirstWindow = pTempWindow;
}
- pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, FALSE );
+ pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, sal_False );
if ( !iTemp )
pTempWindow = NULL;
}
@@ -727,9 +727,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pFormularFirstWindow = pFirstFormularFirstWindow;
}
- USHORT nFoundFormStart = 0;
- USHORT nFoundFormEnd = 0;
- USHORT nTempIndex = 0;
+ sal_uInt16 nFoundFormStart = 0;
+ sal_uInt16 nFoundFormEnd = 0;
+ sal_uInt16 nTempIndex = 0;
if ( ::ImplFindDlgCtrlWindow( this, pFormularFirstWindow, nTempIndex,
nFoundFormStart, nFoundFormEnd ) )
{
@@ -738,7 +738,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pFormularFirstWindow )
{
pFormularFirstWindow->ImplControlFocus();
- return TRUE;
+ return sal_True;
}
}
}
@@ -774,7 +774,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( !ImplCallPreNotify( aNEvt2 ) )
pSWindow->GetFocus();
pSWindow->mpWindowImpl->mnGetFocusFlags = 0;
- return TRUE;
+ return sal_True;
}
else if ( pWindow )
{
@@ -790,7 +790,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
nGetFocusFlags |= GETFOCUS_AROUND;
}
pWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
}
}
@@ -813,7 +813,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( pWindow != pSWindow )
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return TRUE;
+ return sal_True;
}
if ( nStyle & WB_GROUP )
@@ -840,7 +840,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
if ( pWindow->IsVisible() && pWindow->IsEnabled() && pWindow->IsInputEnabled() )
{
pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD );
- return TRUE;
+ return sal_True;
}
pWindow = pWindow->GetWindow( WINDOW_NEXT );
@@ -854,11 +854,11 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd );
if ( pSWindow )
{
- USHORT nGetFocusFlags = GETFOCUS_MNEMONIC;
+ sal_uInt16 nGetFocusFlags = GETFOCUS_MNEMONIC;
if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) )
nGetFocusFlags |= GETFOCUS_UNIQUEMNEMONIC;
pSWindow->ImplControlFocus( nGetFocusFlags );
- return TRUE;
+ return sal_True;
}
}
}
@@ -870,30 +870,30 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow) )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
- ((PushButton*)pButtonWindow)->SetPressed( TRUE );
+ ((PushButton*)pButtonWindow)->SetPressed( sal_True );
mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow;
}
else if ( mpWindowImpl->mpDlgCtrlDownWindow == pButtonWindow )
{
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
- ((PushButton*)pButtonWindow)->SetPressed( FALSE );
+ ((PushButton*)pButtonWindow)->SetPressed( sal_False );
((PushButton*)pButtonWindow)->Click();
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
// checks if this window has dialog control
-BOOL Window::ImplHasDlgCtrl()
+sal_Bool Window::ImplHasDlgCtrl()
{
Window* pDlgCtrlParent;
@@ -905,9 +905,9 @@ BOOL Window::ImplHasDlgCtrl()
pDlgCtrlParent = pDlgCtrlParent->ImplGetParent();
if ( !pDlgCtrlParent || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
void Window::ImplDlgCtrlNextWindow()
@@ -915,9 +915,9 @@ void Window::ImplDlgCtrlNextWindow()
Window* pDlgCtrlParent;
Window* pDlgCtrl;
Window* pSWindow;
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// lookup window for dialog control
pDlgCtrl = this;
@@ -944,14 +944,14 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G
// -----------------------------------------------------------------------
static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
- BOOL bGetFocus )
+ sal_Bool bGetFocus )
{
PushButton* pOldDefButton = NULL;
PushButton* pNewDefButton = NULL;
Window* pSWindow;
- USHORT i;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 i;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// Formular suchen
pSWindow = ::ImplFindDlgCtrlWindow( pParent, pFocusWindow, i, nFormStart, nFormEnd );
@@ -961,7 +961,7 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
nFormEnd = 0xFFFF;
}
- pSWindow = ImplGetChildWindow( pParent, nFormStart, i, FALSE );
+ pSWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_False );
while ( pSWindow )
{
if ( pSWindow->ImplIsPushButton() )
@@ -975,14 +975,14 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
pNewDefButton = pPushButton;
}
- pSWindow = ImplGetNextWindow( pParent, i, i, FALSE );
+ pSWindow = ImplGetNextWindow( pParent, i, i, sal_False );
if ( !i || (i > nFormEnd) )
pSWindow = NULL;
}
if ( !bGetFocus )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
Window* pNewFocusWindow = Application::GetFocusWindow();
if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) )
pNewDefButton = NULL;
@@ -994,19 +994,19 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow,
if ( pOldDefButton != pNewDefButton )
{
if ( pOldDefButton )
- pOldDefButton->ImplSetDefButton( FALSE );
+ pOldDefButton->ImplSetDefButton( sal_False );
if ( pNewDefButton )
- pNewDefButton->ImplSetDefButton( TRUE );
+ pNewDefButton->ImplSetDefButton( sal_True );
}
}
// -----------------------------------------------------------------------
-void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus )
+void Window::ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus )
{
if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus )
{
- ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE );
+ ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False );
mpWindowImpl->mpDlgCtrlDownWindow = NULL;
}
@@ -1017,9 +1017,9 @@ void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus )
Window* Window::ImplFindDlgCtrlWindow( Window* pWindow )
{
- USHORT nIndex;
- USHORT nFormStart;
- USHORT nFormEnd;
+ sal_uInt16 nIndex;
+ sal_uInt16 nFormStart;
+ sal_uInt16 nFormEnd;
// Focus-Fenster in der Child-Liste suchen und zurueckgeben
return ::ImplFindDlgCtrlWindow( this, pWindow, nIndex, nFormStart, nFormEnd );
@@ -1045,7 +1045,7 @@ Window* Window::GetParentLabeledBy( const Window* ) const
static sal_Unicode getAccel( const String& rStr )
{
sal_Unicode nChar = 0;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
do
{
nPos = rStr.Search( '~', nPos );
@@ -1067,10 +1067,10 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
{
// #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
// See tools/options/print for example.
- BOOL bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
+ sal_Bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
Window* pSWindow = NULL;
// get index, form start and form end
- USHORT nIndex=0, nFormStart=0, nFormEnd=0;
+ sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0;
pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabel,
nIndex,
@@ -1084,7 +1084,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
nAccel,
nFormStart,
nFormEnd,
- FALSE );
+ sal_False );
}
else
{
@@ -1096,7 +1096,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nIndex,
nIndex,
- FALSE );
+ sal_False );
if( pSWindow && pSWindow->IsVisible() && ! (pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
@@ -1119,11 +1119,15 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
return pWindow;
}
-Window* Window::GetLabelFor() const
+Window* Window::GetAccessibleRelationLabelFor() const
{
if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabelForWindow;
+
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1161,7 +1165,7 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
// is directly before the control
// get form start and form end and index of this control
- USHORT nIndex, nFormStart, nFormEnd;
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
pLabeled,
nIndex,
@@ -1176,13 +1180,13 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
{
nFormStart = nIndex-1;
}
- for( USHORT nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
{
- USHORT nFoundIndex = 0;
+ sal_uInt16 nFoundIndex = 0;
pSWindow = ::ImplGetChildWindow( pFrameWindow,
nSearchIndex,
nFoundIndex,
- FALSE );
+ sal_False );
if( pSWindow && pSWindow->IsVisible() && !(pSWindow->GetStyle() & WB_NOLABEL) )
{
WindowType nType = pSWindow->GetType();
@@ -1204,11 +1208,14 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
return pWindow;
}
-Window* Window::GetLabeledBy() const
+Window* Window::GetAccessibleRelationLabeledBy() const
{
if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1237,6 +1244,62 @@ Window* Window::GetLabeledBy() const
return pWindow;
}
+Window* Window::GetAccessibleRelationMemberOf() const
+{
+ Window* pWindow = NULL;
+ Window* pFrameWindow = GetParent();
+ if ( !pFrameWindow )
+ {
+ pFrameWindow = ImplGetFrameWindow();
+ }
+ // if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+ if( !( GetType() == WINDOW_FIXEDLINE ||
+ GetType() == WINDOW_GROUPBOX ) )
+ {
+ // search for a control that makes member of this window
+ // it is considered the last fixed line or group box
+ // that comes before this control; with the exception of push buttons
+ // which are labeled only if the fixed line or group box
+ // is directly before the control
+ // get form start and form end and index of this control
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
+ Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
+ const_cast<Window*>(this),
+ nIndex,
+ nFormStart,
+ nFormEnd );
+ if( pSWindow && nIndex != nFormStart )
+ {
+ if( GetType() == WINDOW_PUSHBUTTON ||
+ GetType() == WINDOW_HELPBUTTON ||
+ GetType() == WINDOW_OKBUTTON ||
+ GetType() == WINDOW_CANCELBUTTON )
+ {
+ nFormStart = nIndex-1;
+ }
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ {
+ sal_uInt16 nFoundIndex = 0;
+ pSWindow = ::ImplGetChildWindow( pFrameWindow,
+ nSearchIndex,
+ nFoundIndex,
+ sal_False );
+ if( pSWindow && pSWindow->IsVisible() &&
+ ( pSWindow->GetType() == WINDOW_FIXEDLINE ||
+ pSWindow->GetType() == WINDOW_GROUPBOX ) )
+ {
+ pWindow = pSWindow;
+ break;
+ }
+ if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
+ break;
+ }
+ }
+ }
+ return pWindow;
+}
+//-----IAccessibility2 Implementation 2009
+
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
@@ -1246,20 +1309,24 @@ KeyEvent Window::GetActivationKey() const
sal_Unicode nAccel = getAccel( GetText() );
if( ! nAccel )
{
- Window* pWindow = GetLabeledBy();
+ Window* pWindow = GetAccessibleRelationLabeledBy();
if( pWindow )
nAccel = getAccel( pWindow->GetText() );
}
if( nAccel )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( nAccel >= 'a' && nAccel <= 'z' )
nCode = KEY_A + (nAccel-'a');
else if( nAccel >= 'A' && nAccel <= 'Z' )
nCode = KEY_A + (nAccel-'A');
else if( nAccel >= '0' && nAccel <= '9' )
nCode = KEY_0 + (nAccel-'0');
- KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE );
+ else if( nAccel == '.' )
+ nCode = KEY_POINT;
+ else if( nAccel == '-' )
+ nCode = KEY_SUBTRACT;
+ KeyCode aKeyCode( nCode, sal_False, sal_False, sal_True, sal_False );
aKeyEvent = KeyEvent( nAccel, aKeyCode );
}
return aKeyEvent;
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 231f17759b86..ded887c59933 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -127,7 +127,7 @@ void DockingAreaWindow::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-BOOL DockingAreaWindow::IsHorizontal() const
+sal_Bool DockingAreaWindow::IsHorizontal() const
{
return ( mpImplData->meAlign == WINDOWALIGN_TOP || mpImplData->meAlign == WINDOWALIGN_BOTTOM );
}
@@ -150,7 +150,7 @@ WindowAlign DockingAreaWindow::GetAlign() const
void DockingAreaWindow::Paint( const Rectangle& )
{
- EnableNativeWidget( TRUE ); // only required because the toolkit curently switches this flag off
+ EnableNativeWidget( sal_True ); // only required because the toolkit curently switches this flag off
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
ToolbarValue aControlValue;
@@ -159,7 +159,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
{
// give NWF a hint that this dockingarea is adjacent to the menubar
// useful for special gradient effects that should cover both windows
- aControlValue.mbIsTopDockingArea = TRUE;
+ aControlValue.mbIsTopDockingArea = sal_True;
}
ControlState nState = CTRL_STATE_ENABLED;
@@ -173,8 +173,8 @@ void DockingAreaWindow::Paint( const Rectangle& )
aCtrlRegion, nState, aControlValue, rtl::OUString() );
// each toolbar gets a thin border to better recognize its borders on the homogeneous docking area
- USHORT nChildren = GetChildCount();
- for( USHORT n = 0; n < nChildren; n++ )
+ sal_uInt16 nChildren = GetChildCount();
+ for( sal_uInt16 n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
if ( pChild->IsVisible() )
@@ -198,8 +198,8 @@ void DockingAreaWindow::Paint( const Rectangle& )
// create map to find toolbar lines
Size aOutSz = GetOutputSizePixel();
std::map< int, int > ranges;
- USHORT nChildren = GetChildCount();
- for( USHORT n = 0; n < nChildren; n++ )
+ sal_uInt16 nChildren = GetChildCount();
+ for( sal_uInt16 n = 0; n < nChildren; n++ )
{
Window* pChild = GetChild( n );
Point aPos = pChild->GetPosPixel();
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index ee8e584ac234..017fdc5390db 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -59,13 +59,13 @@ class ImplDockFloatWin2 : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockWin;
- ULONG mnLastTicks;
+ sal_uLong mnLastTicks;
Timer maDockTimer;
Timer maEndDockTimer;
Point maDockPos;
Rectangle maDockRect;
- BOOL mbInMove;
- ULONG mnLastUserEvent;
+ sal_Bool mbInMove;
+ sal_uLong mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin2* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin2* );
@@ -77,18 +77,18 @@ public:
virtual void Move();
virtual void Resize();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
using Window::SetPosSizePixel;
virtual void SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags = WINDOW_POSSIZE_ALL );
+ sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
- ULONG GetLastTicks() const { return mnLastTicks; }
+ sal_uLong GetLastTicks() const { return mnLastTicks; }
};
// =======================================================================
@@ -98,16 +98,16 @@ ImplDockFloatWin2::ImplDockFloatWin2( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( FALSE ),
+ mbInMove( sal_False ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetWindow()->GetSettings() );
- Enable( pDockingWin->GetWindow()->IsEnabled(), FALSE );
- EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), FALSE );
- AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), FALSE );
+ Enable( pDockingWin->GetWindow()->IsEnabled(), sal_False );
+ EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), sal_False );
+ AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), sal_False );
EnableAlwaysOnTop( pDockingWin->GetWindow()->IsAlwaysOnTopEnabled() );
SetActivateMode( pDockingWin->GetWindow()->GetActivateMode() );
}
@@ -147,7 +147,7 @@ IMPL_LINK( ImplDockFloatWin2, DockTimerHdl, ImplDockFloatWin2*, EMPTYARG )
else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, FALSE );
+ mpDockWin->EndDocking( maDockRect, sal_False );
}
else
{
@@ -167,7 +167,7 @@ IMPL_LINK( ImplDockFloatWin2, EndDockTimerHdl, ImplDockFloatWin2*, EMPTYARG )
if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
}
else
{
@@ -186,7 +186,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
Window *pDockingArea = mpDockWin->GetWindow()->GetParent();
PointerState aState = pDockingArea->GetPointerState();
- BOOL bRealMove = TRUE;
+ sal_Bool bRealMove = sal_True;
if( GetStyle() & WB_OWNERDRAWDECORATION )
{
// for windows with ownerdraw decoration
@@ -207,9 +207,9 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
PointerState aBorderState = pBorder->GetPointerState();
if( aBorderRect.IsInside( aBorderState.maPos ) )
- bRealMove = TRUE;
+ bRealMove = sal_True;
else
- bRealMove = FALSE;
+ bRealMove = sal_False;
}
}
@@ -229,7 +229,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
if( ! mpDockWin->IsDocking() )
mpDockWin->StartDocking( aMousePos, maDockRect );
- BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
if( ! bFloatMode )
{
@@ -247,7 +247,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG )
EndDockTimerHdl( this );
}
}
- mbInMove = FALSE;
+ mbInMove = sal_False;
return 0;
}
// -----------------------------------------------------------------------
@@ -257,7 +257,7 @@ void ImplDockFloatWin2::Move()
if( mbInMove )
return;
- mbInMove = TRUE;
+ mbInMove = sal_True;
FloatingWindow::Move();
mpDockWin->GetWindow()->Move();
@@ -289,7 +289,7 @@ void ImplDockFloatWin2::Resize()
void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
}
@@ -297,7 +297,7 @@ void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY,
// -----------------------------------------------------------------------
-void ImplDockFloatWin2::TitleButtonClick( USHORT nButton )
+void ImplDockFloatWin2::TitleButtonClick( sal_uInt16 nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -337,7 +337,7 @@ void ImplDockFloatWin2::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-BOOL ImplDockFloatWin2::Close()
+sal_Bool ImplDockFloatWin2::Close()
{
return mpDockWin->Close();
}
@@ -373,33 +373,33 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const Window
return NULL;
}
-BOOL DockingManager::IsDockable( const Window *pWindow )
+sal_Bool DockingManager::IsDockable( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
/*
if( pWindow->HasDockingHandler() )
- return TRUE;
+ return sal_True;
*/
return (pWrapper != NULL);
}
-BOOL DockingManager::IsFloating( const Window *pWindow )
+sal_Bool DockingManager::IsFloating( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
return pWrapper->IsFloatingMode();
else
- return FALSE;
+ return sal_False;
}
-BOOL DockingManager::IsLocked( const Window *pWindow )
+sal_Bool DockingManager::IsLocked( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsLocked() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
void DockingManager::Lock( const Window *pWindow )
@@ -416,14 +416,14 @@ void DockingManager::Unlock( const Window *pWindow )
pWrapper->Unlock();
}
-void DockingManager::SetFloatingMode( const Window *pWindow, BOOL bFloating )
+void DockingManager::SetFloatingMode( const Window *pWindow, sal_Bool bFloating )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
pWrapper->SetFloatingMode( bFloating );
}
-void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, ULONG nFlags )
+void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, sal_uLong nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -438,13 +438,13 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWin
FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE );
}
-BOOL DockingManager::IsInPopupMode( const Window *pWindow )
+sal_Bool DockingManager::IsInPopupMode( const Window *pWindow )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper && pWrapper->IsInPopupMode() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -488,7 +488,7 @@ void DockingManager::RemoveWindow( const Window *pWindow )
void DockingManager::SetPosSizePixel( Window *pWindow, long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow );
if( pWrapper )
@@ -529,8 +529,8 @@ class ImplPopupFloatWin : public FloatingWindow
{
private:
ImplDockingWindowWrapper* mpDockingWin;
- BOOL mbHighlight;
- BOOL mbMoving;
+ sal_Bool mbHighlight;
+ sal_Bool mbMoving;
bool mbTrackingEnabled;
Point maDelta;
Point maTearOffPosition;
@@ -563,13 +563,13 @@ public:
ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) :
FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW)
{
- mpWindowImpl->mbToolbarFloatingWindow = TRUE; // indicate window type, required for accessibility
+ mpWindowImpl->mbToolbarFloatingWindow = sal_True; // indicate window type, required for accessibility
// which should not see this window as a toplevel window
mpDockingWin = pDockingWin;
- mbHighlight = FALSE;
- mbMoving = FALSE;
- mbTrackingEnabled = FALSE;
- mbGripAtBottom = TRUE;
+ mbHighlight = sal_False;
+ mbMoving = sal_False;
+ mbTrackingEnabled = sal_False;
+ mbGripAtBottom = sal_True;
mbHasGrip = bHasGrip;
ImplSetBorder();
@@ -679,9 +679,9 @@ void ImplPopupFloatWin::DrawBorder()
void ImplPopupFloatWin::DrawGrip()
{
- BOOL bLinecolor = IsLineColor();
+ sal_Bool bLinecolor = IsLineColor();
Color aLinecolor = GetLineColor();
- BOOL bFillcolor = IsFillColor();
+ sal_Bool bFillcolor = IsFillColor();
Color aFillcolor = GetFillColor();
// draw background
@@ -694,7 +694,7 @@ void ImplPopupFloatWin::DrawGrip()
if( mbHighlight )
{
Erase( aRect );
- DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE );
+ DrawSelectionBackground( aRect, 2, sal_False, sal_True, sal_False );
}
else
{
@@ -781,18 +781,18 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt )
if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) )
{
// start window move
- mbMoving = TRUE;
+ mbMoving = sal_True;
StartTracking( STARTTRACK_NOKEYCANCEL );
return;
}
if( !mbHighlight && GetDragRect().IsInside( aMousePos ) )
{
- mbHighlight = TRUE;
+ mbHighlight = sal_True;
DrawGrip();
}
if( mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) )
{
- mbHighlight = FALSE;
+ mbHighlight = sal_False;
DrawGrip();
}
}
@@ -829,7 +829,7 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbMoving = FALSE;
+ mbMoving = sal_False;
EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
}
else if ( !rTEvt.GetMouseEvent().IsSynthetic() )
@@ -853,39 +853,39 @@ ImplDockingWindowWrapper::ImplDockingWindowWrapper( const Window *pWindow )
mpDockingWindow = (Window*) pWindow;
mpParent = pWindow->GetParent();
- mbDockable = TRUE;
- mbLocked = FALSE;
+ mbDockable = sal_True;
+ mbLocked = sal_False;
mnFloatBits = WB_BORDER | WB_CLOSEABLE | WB_SIZEABLE | (pWindow->GetStyle() & DOCKWIN_FLOATSTYLES);
DockingWindow *pDockWin = dynamic_cast< DockingWindow* > ( mpDockingWindow );
if( pDockWin )
mnFloatBits = pDockWin->GetFloatStyle();
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
ImplDockingWindowWrapper::~ImplDockingWindowWrapper()
{
if ( IsFloatingMode() )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( FALSE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( sal_False );
}
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
+sal_Bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return FALSE;
+ return sal_False;
if( !mbStartDockingEnabled )
- return FALSE;
+ return sal_False;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = TRUE;
+ mbDocking = sal_True;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -929,7 +929,7 @@ BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos )
GetWindow()->ImplGetFrameWindow()->ImplUpdateAll();
GetWindow()->StartTracking( STARTTRACK_KEYMOD );
- return TRUE;
+ return sal_True;
}
// =======================================================================
@@ -938,15 +938,15 @@ void ImplDockingWindowWrapper::ImplInitData()
{
mpDockingWindow = NULL;
- //GetWindow()->mpWindowImpl->mbDockWin = TRUE; // TODO: must be eliminated
+ //GetWindow()->mpWindowImpl->mbDockWin = sal_True; // TODO: must be eliminated
mpFloatWin = NULL;
- mbDockCanceled = FALSE;
- mbFloatPrevented = FALSE;
- mbDocking = FALSE;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
+ mbDockCanceled = sal_False;
+ mbFloatPrevented = sal_False;
+ mbDocking = sal_False;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
}
@@ -959,13 +959,13 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = FALSE;
+ mbDocking = sal_False;
GetWindow()->HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = TRUE;
+ mbDockCanceled = sal_True;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = FALSE;
+ mbDockCanceled = sal_False;
}
else
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
@@ -993,9 +993,9 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
aPos.X() += maMouseOff.X();
aPos.Y() += maMouseOff.Y();
- BOOL bFloatMode = Docking( aPos, aTrackRect );
+ sal_Bool bFloatMode = Docking( aPos, aTrackRect );
- mbFloatPrevented = FALSE;
+ mbFloatPrevented = sal_False;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -1018,7 +1018,7 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt )
mbLastFloatMode = bFloatMode;
}
- USHORT nTrackStyle;
+ sal_uInt16 nTrackStyle;
if ( bFloatMode )
nTrackStyle = SHOWTRACK_OBJECT;
else
@@ -1055,12 +1055,12 @@ void ImplDockingWindowWrapper::StartDocking( const Point& rPoint, Rectangle& rRe
DockingData data( rPoint, rRect, IsFloatingMode() );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_STARTDOCKING, &data );
- mbDocking = TRUE;
+ mbDocking = sal_True;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
+sal_Bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
{
DockingData data( rPoint, rRect, IsFloatingMode() );
@@ -1071,18 +1071,18 @@ BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect )
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
Rectangle aRect( rRect );
if ( !IsDockingCanceled() )
{
- BOOL bShow = FALSE;
+ sal_Bool bShow = sal_False;
if ( bFloatMode != IsFloatingMode() )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = TRUE;
+ bShow = sal_True;
if ( bFloatMode )
{
// #i44800# always use outputsize - as in all other places
@@ -1098,30 +1098,30 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMo
}
if ( bShow )
- GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
}
EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_ENDDOCKING, &data );
- mbDocking = FALSE;
+ mbDocking = sal_False;
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::PrepareToggleFloatingMode()
+sal_Bool ImplDockingWindowWrapper::PrepareToggleFloatingMode()
{
- BOOL bFloating = TRUE;
+ sal_Bool bFloating = sal_True;
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_PREPARETOGGLEFLOATING, &bFloating );
return bFloating;
}
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::Close()
+sal_Bool ImplDockingWindowWrapper::Close()
{
// TODO: send event
/*
@@ -1129,15 +1129,15 @@ BOOL ImplDockingWindowWrapper::Close()
ImplAddDel( &aDelData );
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
*/
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1154,12 +1154,12 @@ void ImplDockingWindowWrapper::ToggleFloatingMode()
GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_TOGGLEFLOATING );
// must be enabled in Window::Notify to prevent permanent docking during mouse move
- mbStartDockingEnabled = FALSE;
+ mbStartDockingEnabled = sal_False;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::TitleButtonClick( USHORT nType )
+void ImplDockingWindowWrapper::TitleButtonClick( sal_uInt16 nType )
{
if( nType == TITLE_BUTTON_MENU )
{
@@ -1208,7 +1208,7 @@ void ImplDockingWindowWrapper::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -1223,7 +1223,7 @@ void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool ImplDockingWindowWrapper::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -1238,13 +1238,13 @@ BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nFlags )
+void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLong nFlags )
{
// do nothing if window is floating
if( IsFloatingMode() )
return;
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// prepare reparenting
Window* pRealParent = GetWindow()->GetWindow( WINDOW_PARENT );
@@ -1301,7 +1301,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nF
IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// set parameter for handler before destroying floating window
ImplPopupFloatWin *pPopupFloatWin = (ImplPopupFloatWin*) mpFloatWin;
@@ -1332,17 +1332,17 @@ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG )
}
-BOOL ImplDockingWindowWrapper::IsInPopupMode() const
+sal_Bool ImplDockingWindowWrapper::IsInPopupMode() const
{
if( GetFloatingWindow() )
return GetFloatingWindow()->IsInPopupMode();
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
+void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode )
{
// do nothing if window is docked and locked
if( !IsFloatingMode() && IsLocked() )
@@ -1352,11 +1352,11 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
{
if ( PrepareToggleFloatingMode() )
{
- BOOL bVisible = GetWindow()->IsVisible();
+ sal_Bool bVisible = GetWindow()->IsVisible();
if ( bFloatMode )
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
maDockPos = GetWindow()->GetPosPixel();
@@ -1422,13 +1422,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode )
mpFloatWin = pWin;
if ( bVisible )
- GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
ToggleFloatingMode();
}
else
{
- GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE );
// FloatingDaten wird im FloatingWindow speichern
maFloatPos = mpFloatWin->GetPosPixel();
@@ -1493,7 +1493,7 @@ void ImplDockingWindowWrapper::SetTabStop()
void ImplDockingWindowWrapper::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
if ( mpFloatWin )
mpFloatWin->SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
@@ -1561,14 +1561,14 @@ Point ImplDockingWindowWrapper::GetFloatingPos() const
// old inlines from DockingWindow
// -----------------------------------------------------------------------
-void ImplDockingWindowWrapper::SetPin( BOOL bPin )
+void ImplDockingWindowWrapper::SetPin( sal_Bool bPin )
{
if ( mpFloatWin )
mpFloatWin->SetPin( bPin );
mbPined = bPin;
}
-BOOL ImplDockingWindowWrapper::IsPined() const
+sal_Bool ImplDockingWindowWrapper::IsPined() const
{
if ( mpFloatWin )
return mpFloatWin->IsPined();
@@ -1579,17 +1579,17 @@ void ImplDockingWindowWrapper::RollUp()
{
if ( mpFloatWin )
mpFloatWin->RollUp();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
}
void ImplDockingWindowWrapper::RollDown()
{
if ( mpFloatWin )
mpFloatWin->RollDown();
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
}
-BOOL ImplDockingWindowWrapper::IsRollUp() const
+sal_Bool ImplDockingWindowWrapper::IsRollUp() const
{
if ( mpFloatWin )
return mpFloatWin->IsRollUp();
@@ -1646,7 +1646,7 @@ void ImplDockingWindowWrapper::SetFloatingPos( const Point& rNewPos )
maFloatPos = rNewPos;
}
-BOOL ImplDockingWindowWrapper::IsFloatingMode() const
+sal_Bool ImplDockingWindowWrapper::IsFloatingMode() const
{
return (mpFloatWin != NULL);
}
@@ -1664,7 +1664,7 @@ Rectangle ImplDockingWindowWrapper::GetDragArea() const
void ImplDockingWindowWrapper::Lock()
{
- mbLocked = TRUE;
+ mbLocked = sal_True;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
@@ -1673,14 +1673,14 @@ void ImplDockingWindowWrapper::Lock()
void ImplDockingWindowWrapper::Unlock()
{
- mbLocked = FALSE;
+ mbLocked = sal_False;
// only toolbars support locking
ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() );
if( pToolBox )
pToolBox->Lock( mbLocked );
}
-BOOL ImplDockingWindowWrapper::IsLocked() const
+sal_Bool ImplDockingWindowWrapper::IsLocked() const
{
return mbLocked;
}
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index a176f97d88d5..c9b71b01f78e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -79,12 +79,12 @@ class ImplDockFloatWin : public FloatingWindow
{
private:
DockingWindow* mpDockWin;
- ULONG mnLastTicks;
+ sal_uLong mnLastTicks;
Timer maDockTimer;
Point maDockPos;
Rectangle maDockRect;
- BOOL mbInMove;
- ULONG mnLastUserEvent;
+ sal_Bool mbInMove;
+ sal_uLong mnLastUserEvent;
DECL_LINK( DockingHdl, ImplDockFloatWin* );
DECL_LINK( DockTimerHdl, ImplDockFloatWin* );
@@ -95,14 +95,14 @@ public:
virtual void Move();
virtual void Resize();
- virtual void TitleButtonClick( USHORT nButton );
+ virtual void TitleButtonClick( sal_uInt16 nButton );
virtual void Pin();
virtual void Roll();
virtual void PopupModeEnd();
virtual void Resizing( Size& rSize );
- virtual BOOL Close();
+ virtual sal_Bool Close();
- ULONG GetLastTicks() const { return mnLastTicks; }
+ sal_uLong GetLastTicks() const { return mnLastTicks; }
};
@@ -111,16 +111,16 @@ ImplDockFloatWin::ImplDockFloatWin( Window* pParent, WinBits nWinBits,
FloatingWindow( pParent, nWinBits ),
mpDockWin( pDockingWin ),
mnLastTicks( Time::GetSystemTicks() ),
- mbInMove( FALSE ),
+ mbInMove( sal_False ),
mnLastUserEvent( 0 )
{
// Daten vom DockingWindow uebernehmen
if ( pDockingWin )
{
SetSettings( pDockingWin->GetSettings() );
- Enable( pDockingWin->IsEnabled(), FALSE );
- EnableInput( pDockingWin->IsInputEnabled(), FALSE );
- AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), FALSE );
+ Enable( pDockingWin->IsEnabled(), sal_False );
+ EnableInput( pDockingWin->IsInputEnabled(), sal_False );
+ AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), sal_False );
EnableAlwaysOnTop( pDockingWin->IsAlwaysOnTopEnabled() );
SetActivateMode( pDockingWin->GetActivateMode() );
}
@@ -152,14 +152,14 @@ IMPL_LINK( ImplDockFloatWin, DockTimerHdl, ImplDockFloatWin*, EMPTYARG )
{
// i43499 CTRL disables docking now
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
if( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) )
maDockTimer.Start();
}
else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
- mpDockWin->EndDocking( maDockRect, FALSE );
+ mpDockWin->EndDocking( maDockRect, sal_False );
}
else
{
@@ -190,7 +190,7 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
// mouse pos also in screen pixels
Point aMousePos = mpDockWin->GetParent()->OutputToScreenPixel( aState.maPos );
- BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
+ sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
if( ! bFloatMode )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW );
@@ -200,10 +200,10 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG )
{
mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
maDockTimer.Stop();
- mpDockWin->EndDocking( maDockRect, TRUE );
+ mpDockWin->EndDocking( maDockRect, sal_True );
}
}
- mbInMove = FALSE;
+ mbInMove = sal_False;
return 0;
}
// -----------------------------------------------------------------------
@@ -213,7 +213,7 @@ void ImplDockFloatWin::Move()
if( mbInMove )
return;
- mbInMove = TRUE;
+ mbInMove = sal_True;
FloatingWindow::Move();
mpDockWin->Move();
@@ -241,7 +241,7 @@ void ImplDockFloatWin::Resize()
// -----------------------------------------------------------------------
-void ImplDockFloatWin::TitleButtonClick( USHORT nButton )
+void ImplDockFloatWin::TitleButtonClick( sal_uInt16 nButton )
{
FloatingWindow::TitleButtonClick( nButton );
mpDockWin->TitleButtonClick( nButton );
@@ -281,21 +281,21 @@ void ImplDockFloatWin::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-BOOL ImplDockFloatWin::Close()
+sal_Bool ImplDockFloatWin::Close()
{
return mpDockWin->Close();
}
// =======================================================================
-BOOL DockingWindow::ImplStartDocking( const Point& rPos )
+sal_Bool DockingWindow::ImplStartDocking( const Point& rPos )
{
if ( !mbDockable )
- return FALSE;
+ return sal_False;
maMouseOff = rPos;
maMouseStart = maMouseOff;
- mbDocking = TRUE;
+ mbDocking = sal_True;
mbLastFloatMode = IsFloatingMode();
mbStartFloat = mbLastFloatMode;
@@ -328,17 +328,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos )
if ( GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_DOCKING &&
!( mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) ) // no full drag when migrating to system window
- mbDragFull = TRUE;
+ mbDragFull = sal_True;
else
{
StartDocking();
- mbDragFull = FALSE;
+ mbDragFull = sal_False;
ImplUpdateAll();
ImplGetFrameWindow()->ImplUpdateAll();
}
StartTracking( STARTTRACK_KEYMOD );
- return TRUE;
+ return sal_True;
}
// =======================================================================
@@ -346,17 +346,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos )
void DockingWindow::ImplInitDockingWindowData()
{
mpImplData = new ImplData;
- mpWindowImpl->mbDockWin = TRUE;
+ mpWindowImpl->mbDockWin = sal_True;
mpFloatWin = NULL;
- mbDockCanceled = FALSE;
- mbDockPrevented = FALSE;
- mbFloatPrevented = FALSE;
- mbDocking = FALSE;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
+ mbDockCanceled = sal_False;
+ mbDockPrevented = sal_False;
+ mbFloatPrevented = sal_False;
+ mbDocking = sal_False;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
}
// -----------------------------------------------------------------------
@@ -405,7 +405,7 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
{
Window::ImplLoadRes( rResId );
- ULONG nMask = ReadLongRes();
+ sal_uLong nMask = ReadLongRes();
if ( (RSC_DOCKINGWINDOW_XYMAPMODE | RSC_DOCKINGWINDOW_X |
RSC_DOCKINGWINDOW_Y) & nMask )
@@ -434,8 +434,8 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
if ( nMask & RSC_DOCKINGWINDOW_FLOATING )
{
- if ( (BOOL)ReadShortRes() )
- SetFloatingMode( TRUE );
+ if ( (sal_Bool)ReadShortRes() )
+ SetFloatingMode( sal_True );
}
}
@@ -477,8 +477,8 @@ DockingWindow::~DockingWindow()
{
if ( IsFloatingMode() )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
- SetFloatingMode( FALSE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
+ SetFloatingMode( sal_False );
}
delete mpImplData;
}
@@ -494,7 +494,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbDocking = FALSE;
+ mbDocking = sal_False;
if ( mbDragFull )
{
// Bei Abbruch alten Zustand wieder herstellen
@@ -510,9 +510,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
HideTracking();
if ( rTEvt.IsTrackingCanceled() )
{
- mbDockCanceled = TRUE;
+ mbDockCanceled = sal_True;
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
- mbDockCanceled = FALSE;
+ mbDockCanceled = sal_False;
}
else
EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode );
@@ -542,9 +542,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
aFramePos.Y() += maMouseOff.Y();
if ( mbDragFull )
StartDocking();
- BOOL bFloatMode = Docking( aFramePos, aTrackRect );
- mbDockPrevented = FALSE;
- mbFloatPrevented = FALSE;
+ sal_Bool bFloatMode = Docking( aFramePos, aTrackRect );
+ mbDockPrevented = sal_False;
+ mbFloatPrevented = sal_False;
if ( mbLastFloatMode != bFloatMode )
{
if ( bFloatMode )
@@ -582,7 +582,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt )
}
else
{
- USHORT nTrackStyle;
+ sal_uInt16 nTrackStyle;
if ( bFloatMode )
nTrackStyle = SHOWTRACK_BIG;
else
@@ -622,7 +622,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) )
{
SetFloatingMode( !IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
else if ( pMEvt->GetClicks() == 1 )
{
@@ -640,7 +640,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
}
ImplStartDocking( aPos );
}
- return TRUE;
+ return sal_True;
}
}
}
@@ -651,7 +651,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
rKey.IsShift() && rKey.IsMod1() )
{
SetFloatingMode( !IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
}
}
@@ -663,28 +663,28 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
void DockingWindow::StartDocking()
{
- mbDocking = TRUE;
+ mbDocking = sal_True;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::Docking( const Point&, Rectangle& )
+sal_Bool DockingWindow::Docking( const Point&, Rectangle& )
{
return IsFloatingMode();
}
// -----------------------------------------------------------------------
-void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
if ( !IsDockingCanceled() )
{
- BOOL bShow = FALSE;
+ sal_Bool bShow = sal_False;
if ( bFloatMode != IsFloatingMode() )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
SetFloatingMode( bFloatMode );
- bShow = TRUE;
+ bShow = sal_True;
if ( bFloatMode && mpFloatWin )
mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
}
@@ -698,32 +698,32 @@ void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
if ( bShow )
Show();
}
- mbDocking = FALSE;
+ mbDocking = sal_False;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::PrepareToggleFloatingMode()
+sal_Bool DockingWindow::PrepareToggleFloatingMode()
{
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL DockingWindow::Close()
+sal_Bool DockingWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
- Show( FALSE, SHOW_NOFOCUSCHANGE );
- return TRUE;
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -734,7 +734,7 @@ void DockingWindow::ToggleFloatingMode()
// -----------------------------------------------------------------------
-void DockingWindow::TitleButtonClick( USHORT )
+void DockingWindow::TitleButtonClick( sal_uInt16 )
{
}
@@ -791,7 +791,7 @@ void DockingWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void DockingWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( mpFloatWin )
mpFloatWin->ShowTitleButton( nButton, bVisible );
@@ -806,7 +806,7 @@ void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool DockingWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( mpFloatWin )
return mpFloatWin->IsTitleButtonVisible( nButton );
@@ -821,7 +821,7 @@ BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void DockingWindow::SetFloatingMode( BOOL bFloatMode )
+void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -833,11 +833,11 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode )
{
if ( PrepareToggleFloatingMode() ) // changes to floating mode can be vetoed
{
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
if ( bFloatMode )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
maDockPos = Window::GetPosPixel();
@@ -886,7 +886,7 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode )
}
else
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
// FloatingDaten wird im FloatingWindow speichern
maFloatPos = mpFloatWin->GetPosPixel();
@@ -967,7 +967,7 @@ void DockingWindow::SetTabStop()
void DockingWindow::SetPosSizePixel( long nX, long nY,
long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
@@ -1093,7 +1093,7 @@ Point DockingWindow::GetFloatingPos() const
return maFloatPos;
}
-BOOL DockingWindow::IsFloatingMode() const
+sal_Bool DockingWindow::IsFloatingMode() const
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 9896333174ce..2c21ec7a83d1 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -75,9 +75,9 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
{
mpImplData = new ImplData;
- mpWindowImpl->mbFloatWin = TRUE;
- mbInCleanUp = FALSE;
- mbGrabFocus = FALSE;
+ mpWindowImpl->mbFloatWin = sal_True;
+ mbInCleanUp = sal_False;
+ mbGrabFocus = sal_False;
DBG_ASSERT( pParent, "FloatWindow::FloatingWindow(): - pParent == NULL!" );
@@ -89,7 +89,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
// no Border, then we dont need a border window
if ( !nStyle )
{
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
nStyle |= WB_DIALOGCONTROL;
SystemWindow::ImplInit( pParent, nStyle, NULL );
}
@@ -104,14 +104,14 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
WinBits nFloatWinStyle = nStyle;
// #99154# floaters are not closeable by default anymore, eg fullscreen floater
// nFloatWinStyle |= WB_CLOSEABLE;
- mpWindowImpl->mbFrame = TRUE;
- mpWindowImpl->mbOverlapWin = TRUE;
+ mpWindowImpl->mbFrame = sal_True;
+ mpWindowImpl->mbOverlapWin = sal_True;
SystemWindow::ImplInit( pParent, nFloatWinStyle & ~WB_BORDER, NULL );
}
else
{
ImplBorderWindow* pBorderWin;
- USHORT nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT;
+ sal_uInt16 nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT;
if( nStyle & WB_OWNERDRAWDECORATION ) nBorderStyle |= BORDERWINDOW_STYLE_FRAME;
else nBorderStyle |= BORDERWINDOW_STYLE_OVERLAP;
@@ -125,7 +125,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL );
pBorderWin->mpWindowImpl->mpClientWindow = this;
pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
- pBorderWin->SetDisplayActive( TRUE );
+ pBorderWin->SetDisplayActive( sal_True );
mpWindowImpl->mpBorderWindow = pBorderWin;
mpWindowImpl->mpRealParent = pParent;
}
@@ -138,11 +138,11 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
mnOldTitle = mnTitle;
mnPopupModeFlags = 0;
- mbInPopupMode = FALSE;
- mbPopupMode = FALSE;
- mbPopupModeCanceled = FALSE;
- mbPopupModeTearOff = FALSE;
- mbMouseDown = FALSE;
+ mbInPopupMode = sal_False;
+ mbPopupMode = sal_False;
+ mbPopupModeCanceled = sal_False;
+ mbPopupModeTearOff = sal_False;
+ mbMouseDown = sal_False;
ImplInitSettings();
}
@@ -191,7 +191,7 @@ void FloatingWindow::ImplLoadRes( const ResId& rResId )
{
SystemWindow::ImplLoadRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if ( (RSC_FLOATINGWINDOW_WHMAPMODE | RSC_FLOATINGWINDOW_WIDTH |
RSC_FLOATINGWINDOW_HEIGHT) & nObjMask )
@@ -237,7 +237,7 @@ FloatingWindow::~FloatingWindow()
// -----------------------------------------------------------------------
-Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex )
+Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex )
{
return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex );
}
@@ -245,8 +245,8 @@ Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rR
// -----------------------------------------------------------------------
Point FloatingWindow::ImplCalcPos( Window* pWindow,
- const Rectangle& rRect, ULONG nFlags,
- USHORT& rArrangeIndex )
+ const Rectangle& rRect, sal_uLong nFlags,
+ sal_uInt16& rArrangeIndex )
{
// Fenster-Position ermitteln
Point aPos;
@@ -262,7 +262,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Rectangle normRect( rRect ); // rRect is already relative to top-level window
normRect.SetPos( pW->ScreenToOutputPixel( normRect.TopLeft() ) );
- BOOL bRTL = Application::GetSettings().GetLayoutRTL();
+ sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ),
pW->OutputToAbsoluteScreenPixel( normRect.BottomRight() ) );
@@ -276,9 +276,9 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Application::GetBestScreen( bRTL ? devRectRTL : devRect ) );
- USHORT nArrangeAry[5];
- USHORT nArrangeIndex;
- BOOL bBreak;
+ sal_uInt16 nArrangeAry[5];
+ sal_uInt16 nArrangeIndex;
+ sal_Bool bBreak;
Point e1,e2; // the common edge between the item rect and the floating window
if ( nFlags & FLOATWIN_POPUPMODE_LEFT )
@@ -320,7 +320,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
for ( ; nArrangeIndex < 5; nArrangeIndex++ )
{
- bBreak = TRUE;
+ bBreak = sal_True;
switch ( nArrangeAry[nArrangeIndex] )
{
@@ -331,12 +331,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
else
{
if ( aPos.X() < aScreenRect.Left() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
if( bBreak )
{
@@ -355,12 +355,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( bRTL ) // --- RTL --- we're comparing screen coordinates here
{
if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
else
{
if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
- bBreak = FALSE;
+ bBreak = sal_False;
}
if( bBreak )
{
@@ -377,7 +377,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
aPos.X() = devRect.Left();
aPos.Y() = devRect.Top()-aSize.Height()+1;
if ( aPos.Y() < aScreenRect.Top() )
- bBreak = FALSE;
+ bBreak = sal_False;
if( bBreak )
{
e1 = devRect.TopLeft();
@@ -392,7 +392,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
case FLOATWIN_POPUPMODE_DOWN:
aPos = devRect.BottomLeft();
if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
- bBreak = FALSE;
+ bBreak = sal_False;
if( bBreak )
{
e1 = devRect.BottomLeft();
@@ -463,7 +463,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
// -----------------------------------------------------------------------
-FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest )
+FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest )
{
FloatingWindow* pWin = this;
@@ -538,20 +538,20 @@ FloatingWindow* FloatingWindow::ImplFindLastLevelFloat()
// -----------------------------------------------------------------------
-BOOL FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
+sal_Bool FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow )
{
FloatingWindow* pWin = this;
do
{
if ( pWin->mpFirstPopupModeWin == pWindow )
- return TRUE;
+ return sal_True;
pWin = pWin->mpNextFloat;
}
while ( pWin );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -560,7 +560,7 @@ IMPL_LINK( FloatingWindow, ImplEndPopupModeHdl, void*, EMPTYARG )
{
mnPostId = 0;
mnPopupModeFlags = 0;
- mbPopupMode = FALSE;
+ mbPopupMode = sal_False;
PopupModeEnd();
return 0;
}
@@ -577,12 +577,12 @@ long FloatingWindow::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if ( (nKeyCode == KEY_ESCAPE) && (GetStyle() & WB_CLOSEABLE) )
{
Close();
- return TRUE;
+ return sal_True;
}
}
}
@@ -622,7 +622,7 @@ void FloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
void FloatingWindow::ImplCallPopupModeEnd()
{
// PopupMode wurde beendet
- mbInPopupMode = FALSE;
+ mbInPopupMode = sal_False;
// Handler asyncron rufen
if ( !mnPostId )
@@ -638,13 +638,13 @@ void FloatingWindow::PopupModeEnd()
// -----------------------------------------------------------------------
-void FloatingWindow::SetTitleType( USHORT nTitle )
+void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
{
if ( (mnTitle != nTitle) && mpWindowImpl->mpBorderWindow )
{
mnTitle = nTitle;
Size aOutSize = GetOutputSizePixel();
- USHORT nTitleStyle;
+ sal_uInt16 nTitleStyle;
if ( nTitle == FLOATWIN_TITLE_NORMAL )
nTitleStyle = BORDERWINDOW_TITLE_SMALL;
else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
@@ -660,11 +660,11 @@ void FloatingWindow::SetTitleType( USHORT nTitle )
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
+void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
{
// avoid flickering
if ( IsVisible() )
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
if ( IsRollUp() )
RollDown();
@@ -688,7 +688,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
// compute window position according to flags and arrangement
- USHORT nArrangeIndex;
+ sal_uInt16 nArrangeIndex;
SetPosPixel( ImplCalcPos( this, rRect, nFlags, nArrangeIndex ) );
// set data and display window
@@ -709,11 +709,11 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
maFloatRect.Right() += 2;
maFloatRect.Bottom() += 2;
mnPopupModeFlags = nFlags;
- mbInPopupMode = TRUE;
- mbPopupMode = TRUE;
- mbPopupModeCanceled = FALSE;
- mbPopupModeTearOff = FALSE;
- mbMouseDown = FALSE;
+ mbInPopupMode = sal_True;
+ mbPopupMode = sal_True;
+ mbPopupModeCanceled = sal_False;
+ mbPopupModeTearOff = sal_False;
+ mbMouseDown = sal_False;
mbOldSaveBackMode = IsSaveBackgroundEnabled();
EnableSaveBackground();
@@ -725,22 +725,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS )
{
// force key input even without focus (useful for menues)
- mbGrabFocus = TRUE;
+ mbGrabFocus = sal_True;
}
- Show( TRUE, SHOW_NOACTIVATE );
+ Show( sal_True, SHOW_NOACTIVATE );
}
// -----------------------------------------------------------------------
-void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
+void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags )
{
// get selected button
- USHORT nItemId = pBox->GetDownItemId();
+ sal_uInt16 nItemId = pBox->GetDownItemId();
if ( !nItemId )
return;
mpImplData->mpBox = pBox;
- pBox->ImplFloatControl( TRUE, this );
+ pBox->ImplFloatControl( sal_True, this );
// retrieve some data from the ToolBox
Rectangle aRect = pBox->GetItemRect( nItemId );
@@ -779,14 +779,14 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
// -----------------------------------------------------------------------
-void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
+void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId )
{
if ( !mbInPopupMode )
return;
ImplSVData* pSVData = ImplGetSVData();
- mbInCleanUp = TRUE; // prevent killing this window due to focus change while working with it
+ mbInCleanUp = sal_True; // prevent killing this window due to focus change while working with it
// Bei allen nachfolgenden PopupMode-Fenster den Modus auch beenden
while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat != this )
@@ -797,13 +797,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
pSVData->maWinData.mpFirstFloat = mpNextFloat;
mpNextFloat = NULL;
- ULONG nPopupModeFlags = mnPopupModeFlags;
+ sal_uLong nPopupModeFlags = mnPopupModeFlags;
// Wenn nicht abgerissen wurde, dann Fenster wieder Hiden
if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) ||
!(nPopupModeFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) )
{
- Show( FALSE, SHOW_NOFOCUSCHANGE );
+ Show( sal_False, SHOW_NOFOCUSCHANGE );
// Focus evt. auf ein entsprechendes FloatingWindow weiterschalten
if ( nFocusId )
@@ -811,13 +811,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
else if ( pSVData->maWinData.mpFocusWin && pSVData->maWinData.mpFirstFloat &&
ImplIsWindowOrChild( pSVData->maWinData.mpFocusWin ) )
pSVData->maWinData.mpFirstFloat->GrabFocus();
- mbPopupModeTearOff = FALSE;
+ mbPopupModeTearOff = sal_False;
}
else
{
- mbPopupModeTearOff = TRUE;
+ mbPopupModeTearOff = sal_True;
if ( nFocusId )
- Window::EndSaveFocus( nFocusId, FALSE );
+ Window::EndSaveFocus( nFocusId, sal_False );
}
EnableSaveBackground( mbOldSaveBackMode );
@@ -829,7 +829,7 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
// ToolBox wieder auf normal schalten
if ( mpImplData->mpBox )
{
- mpImplData->mpBox->ImplFloatControl( FALSE, this );
+ mpImplData->mpBox->ImplFloatControl( sal_False, this );
mpImplData->mpBox = NULL;
}
@@ -850,12 +850,12 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
}
}
- mbInCleanUp = FALSE;
+ mbInCleanUp = sal_False;
}
// -----------------------------------------------------------------------
-void FloatingWindow::EndPopupMode( USHORT nFlags )
+void FloatingWindow::EndPopupMode( sal_uInt16 nFlags )
{
ImplEndPopupMode( nFlags );
}
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index 3b26e92829a7..1f15019999e5 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -3,10 +3,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: javachild.cxx,v $
+ * $Revision: 1.12 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -29,30 +32,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
-#ifdef SOLAR_JAVA
-#include <jni.h>
-#endif
-#include <comphelper/processfactory.hxx>
-
-#include <vcl/unohelp.hxx>
-#include <rtl/process.h>
-#include <rtl/ref.hxx>
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#include <svsys.h>
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-#include <vcl/window.hxx>
-#include <vcl/salobj.hxx>
#include <vcl/javachild.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/sysdata.hxx>
-
-using namespace ::com::sun::star;
// -------------------
// - JavaChildWindow -
@@ -78,131 +58,9 @@ JavaChildWindow::~JavaChildWindow()
// -----------------------------------------------------------------------
-void JavaChildWindow::implTestJavaException( void* pEnv )
-{
-#ifdef SOLAR_JAVA
- JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
- jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
-
- if( jtThrowable )
- { // is it a java exception ?
-#if OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionDescribe();
-#endif // OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionClear();
-
- jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
- jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
- jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
- ::rtl::OUString ouMessage;
-
- if(jsMessage)
- {
- const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
- ouMessage = ::rtl::OUString(jcMessage);
- pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
- }
-
- throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
- }
-#endif // SOLAR_JAVA
-}
-
-// -----------------------------------------------------------------------
-
sal_IntPtr JavaChildWindow::getParentWindowHandleForJava()
{
- sal_IntPtr nRet = 0;
-
-#if defined WNT
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
-#elif defined QUARTZ
- // FIXME: this is wrong
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
-#elif defined UNX
-#ifdef SOLAR_JAVA
- uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
-
- if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
- {
- try
- {
- ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
- uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
- uno::Sequence< sal_Int8 > aProcessID( 17 );
-
- rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
- aProcessID[ 16 ] = 0;
- OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
- sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
- xJavaVM->getJavaVM(aProcessID) >>= nPointer;
- xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
-
- if( xVM.is() )
- {
- try
- {
- ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
- JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
-
- jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
- implTestJavaException(pEnv);
-
- jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
- implTestJavaException(pEnv);
-
- pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
- implTestJavaException(pEnv);
-
- jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
- if( pEnv->ExceptionOccurred() )
- {
- pEnv->ExceptionClear();
-
- jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
- implTestJavaException(pEnv);
- }
-
- jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
- implTestJavaException(pEnv);
-
- jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
- implTestJavaException(pEnv);
-
- jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
- implTestJavaException(pEnv);
-
- pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
- implTestJavaException(pEnv);
-
- jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
- implTestJavaException(pEnv);
-
- const Size aSize( GetOutputSizePixel() );
- jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
- GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
- implTestJavaException(pEnv);
-
- nRet = static_cast< sal_IntPtr >( ji_widget );
- }
- catch( uno::RuntimeException& )
- {
- }
-
- if( !nRet )
- nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
- }
- }
- catch( ... )
- {
- }
- }
-#endif // SOLAR_JAVA
-#else // WNT || QUARTZ || UNX
- // TBD
-#endif
-
- return nRet;
+ return SystemChildWindow::GetParentWindowHandle( sal_True );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 575b8022b739..05370f3a029f 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -41,7 +41,7 @@
// =======================================================================
-static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
+static sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
{
0, 0, 0, 0, // KEYFUNC_DONTKNOW
KEY_N | KEY_MOD1, 0, 0, 0, // KEYFUNC_NEW
@@ -66,9 +66,9 @@ static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
// -----------------------------------------------------------------------
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 )
+void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 )
{
- USHORT nIndex = (USHORT)eFunc;
+ sal_uInt16 nIndex = (sal_uInt16)eFunc;
nIndex *= 4;
rCode1 = aImplKeyFuncTab[nIndex];
rCode2 = aImplKeyFuncTab[nIndex+1];
@@ -80,7 +80,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT&
KeyCode::KeyCode( KeyFuncType eFunction )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy );
eFunc = eFunction;
}
@@ -96,18 +96,18 @@ KeyCode::KeyCode( const ResId& rResId )
{
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
- ULONG nKeyCode = pResMgr->ReadLong();
- ULONG nModifier = pResMgr->ReadLong();
- ULONG nKeyFunc = pResMgr->ReadLong();
+ sal_uLong nKeyCode = pResMgr->ReadLong();
+ sal_uLong nModifier = pResMgr->ReadLong();
+ sal_uLong nKeyFunc = pResMgr->ReadLong();
eFunc = (KeyFuncType)nKeyFunc;
if ( eFunc != KEYFUNC_DONTKNOW )
{
- USHORT nDummy;
+ sal_uInt16 nDummy;
ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy );
}
else
- nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier);
+ nCode = sal::static_int_cast<sal_uInt16>(nKeyCode | nModifier);
}
}
@@ -136,15 +136,15 @@ KeyFuncType KeyCode::GetFunction() const
if ( eFunc != KEYFUNC_DONTKNOW )
return eFunc;
- USHORT nCompCode = GetModifier() | GetCode();
+ sal_uInt16 nCompCode = GetModifier() | GetCode();
if ( nCompCode )
{
- for ( USHORT i = (USHORT)KEYFUNC_NEW; i < (USHORT)KEYFUNC_FRONT; i++ )
+ for ( sal_uInt16 i = (sal_uInt16)KEYFUNC_NEW; i < (sal_uInt16)KEYFUNC_FRONT; i++ )
{
- USHORT nKeyCode1;
- USHORT nKeyCode2;
- USHORT nKeyCode3;
- USHORT nKeyCode4;
+ sal_uInt16 nKeyCode1;
+ sal_uInt16 nKeyCode2;
+ sal_uInt16 nKeyCode3;
+ sal_uInt16 nKeyCode4;
ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 );
if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) )
return (KeyFuncType)i;
diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx
index 2677c31cc100..db8144c3d648 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -75,8 +75,8 @@ KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
{
KeyEvent aClone(*this);
- USHORT nCode = maKeyCode.GetCode();
- USHORT nMod = maKeyCode.GetAllModifier();
+ sal_uInt16 nCode = maKeyCode.GetCode();
+ sal_uInt16 nMod = maKeyCode.GetAllModifier();
switch (eMode)
{
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 82ce26f8e78e..1c63376dfda5 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -85,6 +85,8 @@ SLOFILES= \
$(SLO)$/winproc.obj \
$(SLO)$/window2.obj \
$(SLO)$/window3.obj \
+ $(SLO)$/window4.obj \
+ $(SLO)$/wpropset.obj \
$(SLO)$/wrkwin.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 6d76050623cd..6ab9dda55fc2 100644..100755
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,3 +1,4 @@
+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
@@ -80,9 +81,9 @@ namespace vcl
struct MenuLayoutData : public ControlLayoutData
{
- std::vector< USHORT > m_aLineItemIds;
- std::vector< USHORT > m_aLineItemPositions;
- std::map< USHORT, Rectangle > m_aVisibleItemBoundRects;
+ std::vector< sal_uInt16 > m_aLineItemIds;
+ std::vector< sal_uInt16 > m_aLineItemPositions;
+ std::map< sal_uInt16, Rectangle > m_aVisibleItemBoundRects;
};
}
@@ -96,6 +97,7 @@ DBG_NAME( Menu )
#define EXTRASPACEY 2
#define EXTRAITEMHEIGHT 4
+#define GUTTERBORDER 8
// document closer
#define IID_DOCUMENTCLOSE 1
@@ -104,32 +106,32 @@ DBG_NAME( Menu )
#include <xwphook.h>
-// return TRUE if hilite should be executed: left mouse button down
+// return sal_True if hilite should be executed: left mouse button down
// or xwp mouse hook enabled
-static BOOL ImplHilite( const MouseEvent& rMEvt )
+static sal_Bool ImplHilite( const MouseEvent& rMEvt )
{
- static BOOL init = FALSE;
+ static sal_Bool init = sal_False;
static HOOKCONFIG hc;
// read XWP settings at program startup
- if (init == FALSE) {
- BOOL rc;
- ULONG cb = sizeof(HOOKCONFIG);
+ if (init == sal_False) {
+ sal_Bool rc;
+ sal_uLong cb = sizeof(HOOKCONFIG);
memset(&hc, 0, sizeof(HOOKCONFIG));
rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG,
&hc, &cb);
- init = TRUE;
+ init = sal_True;
}
// check mouse left button
if (rMEvt.GetButtons() == MOUSE_LEFT)
- return TRUE;
+ return sal_True;
// return xwp flag
return hc.fSlidingMenus;
}
#endif
-static BOOL ImplAccelDisabled()
+static sal_Bool ImplAccelDisabled()
{
// display of accelerator strings may be suppressed via configuration
static int nAccelDisabled = -1;
@@ -142,12 +144,12 @@ static BOOL ImplAccelDisabled()
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuppressAccelerators" ) ) );
nAccelDisabled = aStr.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
}
- return (nAccelDisabled == 1) ? TRUE : FALSE;
+ return (nAccelDisabled == 1) ? sal_True : sal_False;
}
struct MenuItemData
{
- USHORT nId; // SV Id
+ sal_uInt16 nId; // SV Id
MenuItemType eType; // MenuItem-Type
MenuItemBits nBits; // MenuItem-Bits
Menu* pSubMenu; // Pointer auf das SubMenu
@@ -157,15 +159,15 @@ struct MenuItemData
XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- ULONG nHelpId; // Help-Id
- ULONG nUserValue; // User value
+ rtl::OString aHelpId; // Help-Id
+ sal_uLong nUserValue; // User value
Image aImage; // Image
KeyCode aAccelKey; // Accelerator-Key
- BOOL bChecked; // Checked
- BOOL bEnabled; // Enabled
- BOOL bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true)
- BOOL bIsTemporary; // Temporary inserted ('No selection possible')
- BOOL bMirrorMode;
+ sal_Bool bChecked; // Checked
+ sal_Bool bEnabled; // Enabled
+ sal_Bool bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true)
+ sal_Bool bIsTemporary; // Temporary inserted ('No selection possible')
+ sal_Bool bMirrorMode;
long nItemImageAngle;
Size aSz; // nur temporaer gueltig
XubString aAccessibleName; // accessible name
@@ -210,22 +212,22 @@ public:
MenuItemList() : List( 16, 4 ) {}
~MenuItemList();
- MenuItemData* Insert( USHORT nId, MenuItemType eType, MenuItemBits nBits,
+ MenuItemData* Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, USHORT nPos );
- void InsertSeparator( USHORT nPos );
- void Remove( USHORT nPos );
+ Menu* pMenu, sal_uInt16 nPos );
+ void InsertSeparator( sal_uInt16 nPos );
+ void Remove( sal_uInt16 nPos );
- MenuItemData* GetData( USHORT nSVId, USHORT& rPos ) const;
- MenuItemData* GetData( USHORT nSVId ) const
- { USHORT nTemp; return GetData( nSVId, nTemp ); }
- MenuItemData* GetDataFromPos( ULONG nPos ) const
+ MenuItemData* GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const;
+ MenuItemData* GetData( sal_uInt16 nSVId ) const
+ { sal_uInt16 nTemp; return GetData( nSVId, nTemp ); }
+ MenuItemData* GetDataFromPos( sal_uLong nPos ) const
{ return (MenuItemData*)List::GetObject( nPos ); }
- MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const;
- USHORT GetItemCount( xub_Unicode cSelectChar ) const;
- USHORT GetItemCount( KeyCode aKeyCode ) const;
+ MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const;
+ sal_uInt16 GetItemCount( xub_Unicode cSelectChar ) const;
+ sal_uInt16 GetItemCount( KeyCode aKeyCode ) const;
uno::Reference< i18n::XCharacterClassification > GetCharClass() const;
};
@@ -234,17 +236,17 @@ public:
MenuItemList::~MenuItemList()
{
- for ( ULONG n = Count(); n; )
+ for ( sal_uLong n = Count(); n; )
{
MenuItemData* pData = GetDataFromPos( --n );
delete pData;
}
}
-MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
+MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType,
MenuItemBits nBits,
const XubString& rStr, const Image& rImage,
- Menu* pMenu, USHORT nPos )
+ Menu* pMenu, sal_uInt16 nPos )
{
MenuItemData* pData = new MenuItemData( rStr, rImage );
pData->nId = nId;
@@ -252,13 +254,12 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
pData->nBits = nBits;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
- pData->bChecked = FALSE;
- pData->bEnabled = TRUE;
- pData->bVisible = TRUE;
- pData->bIsTemporary = FALSE;
- pData->bMirrorMode = FALSE;
+ pData->bChecked = sal_False;
+ pData->bEnabled = sal_True;
+ pData->bVisible = sal_True;
+ pData->bIsTemporary = sal_False;
+ pData->bMirrorMode = sal_False;
pData->nItemImageAngle = 0;
SalItemParams aSalMIData;
@@ -276,7 +277,7 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
return pData;
}
-void MenuItemList::InsertSeparator( USHORT nPos )
+void MenuItemList::InsertSeparator( sal_uInt16 nPos )
{
MenuItemData* pData = new MenuItemData;
pData->nId = 0;
@@ -284,13 +285,12 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->nBits = 0;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
- pData->bChecked = FALSE;
- pData->bEnabled = TRUE;
- pData->bVisible = TRUE;
- pData->bIsTemporary = FALSE;
- pData->bMirrorMode = FALSE;
+ pData->bChecked = sal_False;
+ pData->bEnabled = sal_True;
+ pData->bVisible = sal_True;
+ pData->bIsTemporary = sal_False;
+ pData->bMirrorMode = sal_False;
pData->nItemImageAngle = 0;
SalItemParams aSalMIData;
@@ -307,14 +307,14 @@ void MenuItemList::InsertSeparator( USHORT nPos )
List::Insert( (void*)pData, nPos );
}
-void MenuItemList::Remove( USHORT nPos )
+void MenuItemList::Remove( sal_uInt16 nPos )
{
- MenuItemData* pData = (MenuItemData*)List::Remove( (ULONG)nPos );
+ MenuItemData* pData = (MenuItemData*)List::Remove( (sal_uLong)nPos );
if ( pData )
delete pData;
}
-MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const
+MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const
{
rPos = 0;
MenuItemData* pData = (MenuItemData*)GetObject( rPos );
@@ -330,11 +330,11 @@ MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const
return NULL;
}
-MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const
+MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const
{
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- USHORT nListCount = (USHORT)Count();
+ sal_uInt16 nListCount = (sal_uInt16)Count();
// try character code first
nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates
@@ -367,7 +367,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
MenuItemData* pData = GetDataFromPos( rPos );
if ( pData->bEnabled )
{
- USHORT n = pData->aText.Search( '~' );
+ sal_uInt16 n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
@@ -391,13 +391,13 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod
return NULL;
}
-USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
+sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
{
// returns number of entries with same mnemonic
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper();
- USHORT nItems = 0, nPos;
- for ( nPos = (USHORT)Count(); nPos; )
+ sal_uInt16 nItems = 0, nPos;
+ for ( nPos = (sal_uInt16)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) )
@@ -407,7 +407,7 @@ USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const
return nItems;
}
-USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const
+sal_uInt16 MenuItemList::GetItemCount( KeyCode aKeyCode ) const
{
// returns number of entries with same mnemonic
// uses key codes instead of character codes
@@ -416,13 +416,13 @@ USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const
if( aKeyCode.GetCode() >= KEY_A && aKeyCode.GetCode() <= KEY_Z )
ascii = sal::static_int_cast<char>('A' + (aKeyCode.GetCode() - KEY_A));
- USHORT nItems = 0, nPos;
- for ( nPos = (USHORT)Count(); nPos; )
+ sal_uInt16 nItems = 0, nPos;
+ for ( nPos = (sal_uInt16)Count(); nPos; )
{
MenuItemData* pData = GetDataFromPos( --nPos );
if ( pData->bEnabled )
{
- USHORT n = pData->aText.Search( '~' );
+ sal_uInt16 n = pData->aText.Search( '~' );
if ( n != STRING_NOTFOUND )
{
KeyCode mnKeyCode;
@@ -464,21 +464,21 @@ private:
Timer aHighlightChangedTimer;
Timer aSubmenuCloseTimer;
Timer aScrollTimer;
- ULONG nSaveFocusId;
+ sal_uLong nSaveFocusId;
// long nStartY;
- USHORT nHighlightedItem; // gehighlightetes/selektiertes Item
- USHORT nMBDownPos;
- USHORT nScrollerHeight;
- USHORT nFirstEntry;
- USHORT nBorder;
- USHORT nPosInParent;
- BOOL bInExecute;
-
- BOOL bScrollMenu;
- BOOL bScrollUp;
- BOOL bScrollDown;
- BOOL bIgnoreFirstMove;
- BOOL bKeyInput;
+ sal_uInt16 nHighlightedItem; // gehighlightetes/selektiertes Item
+ sal_uInt16 nMBDownPos;
+ sal_uInt16 nScrollerHeight;
+ sal_uInt16 nFirstEntry;
+ sal_uInt16 nBorder;
+ sal_uInt16 nPosInParent;
+ sal_Bool bInExecute;
+
+ sal_Bool bScrollMenu;
+ sal_Bool bScrollUp;
+ sal_Bool bScrollDown;
+ sal_Bool bIgnoreFirstMove;
+ sal_Bool bKeyInput;
DECL_LINK( PopupEnd, FloatingWindow* );
DECL_LINK( HighlightChanged, Timer* );
@@ -489,16 +489,16 @@ private:
void StateChanged( StateChangedType nType );
void DataChanged( const DataChangedEvent& rDCEvt );
protected:
- Region ImplCalcClipRegion( BOOL bIncludeLogo = TRUE ) const;
+ Region ImplCalcClipRegion( sal_Bool bIncludeLogo = sal_True ) const;
void ImplInitClipRegion();
- void ImplDrawScroller( BOOL bUp );
+ void ImplDrawScroller( sal_Bool bUp );
using Window::ImplScroll;
void ImplScroll( const Point& rMousePos );
- void ImplScroll( BOOL bUp );
- void ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd = FALSE );
- void ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown );
+ void ImplScroll( sal_Bool bUp );
+ void ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd = sal_False );
+ void ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown );
long ImplGetStartY() const;
- Rectangle ImplGetItemRect( USHORT nPos );
+ Rectangle ImplGetItemRect( sal_uInt16 nPos );
public:
MenuFloatingWindow( Menu* pMenu, Window* pParent, WinBits nStyle );
@@ -515,27 +515,27 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void Resize();
- void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
- ULONG GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong GetFocusId() const { return nSaveFocusId; }
- void EnableScrollMenu( BOOL b );
- BOOL IsScrollMenu() const { return bScrollMenu; }
- USHORT GetScrollerHeight() const { return nScrollerHeight; }
+ void EnableScrollMenu( sal_Bool b );
+ sal_Bool IsScrollMenu() const { return bScrollMenu; }
+ sal_uInt16 GetScrollerHeight() const { return nScrollerHeight; }
void Execute();
- void StopExecute( ULONG nFocusId = 0 );
+ void StopExecute( sal_uLong nFocusId = 0 );
void EndExecute();
- void EndExecute( USHORT nSelectId );
+ void EndExecute( sal_uInt16 nSelectId );
PopupMenu* GetActivePopup() const { return pActivePopup; }
void KillActivePopup( PopupMenu* pThisOnly = NULL );
- void HighlightItem( USHORT nPos, BOOL bHighlight );
- void ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer );
- USHORT GetHighlightedItem() const { return nHighlightedItem; }
+ void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight );
+ void ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer );
+ sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
- void SetPosInParent( USHORT nPos ) { nPosInParent = nPos; }
- USHORT GetPosInParent() const { return nPosInParent; }
+ void SetPosInParent( sal_uInt16 nPos ) { nPosInParent = nPos; }
+ sal_uInt16 GetPosInParent() const { return nPosInParent; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
};
@@ -606,10 +606,10 @@ void DecoToolBox::calcMinSize()
}
else
{
- USHORT nItems = GetItemCount();
- for( USHORT i = 0; i < nItems; i++ )
+ sal_uInt16 nItems = GetItemCount();
+ for( sal_uInt16 i = 0; i < nItems; i++ )
{
- USHORT nId = GetItemId( i );
+ sal_uInt16 nId = GetItemId( i );
aTbx.InsertItem( nId, GetItemImage( nId ) );
}
}
@@ -670,7 +670,7 @@ class MenuBarWindow : public Window
private:
struct AddButtonEntry
{
- USHORT m_nId;
+ sal_uInt16 m_nId;
Link m_aSelectLink;
Link m_aHighlightLink;
@@ -679,25 +679,25 @@ private:
Menu* pMenu;
PopupMenu* pActivePopup;
- USHORT nHighlightedItem;
- ULONG nSaveFocusId;
- BOOL mbAutoPopup;
- BOOL bIgnoreFirstMove;
- BOOL bStayActive;
+ sal_uInt16 nHighlightedItem;
+ sal_uLong nSaveFocusId;
+ sal_Bool mbAutoPopup;
+ sal_Bool bIgnoreFirstMove;
+ sal_Bool bStayActive;
DecoToolBox aCloser;
PushButton aFloatBtn;
PushButton aHideBtn;
- std::map< USHORT, AddButtonEntry > m_aAddButtons;
+ std::map< sal_uInt16, AddButtonEntry > m_aAddButtons;
- void HighlightItem( USHORT nPos, BOOL bHighlight );
- void ChangeHighlightItem( USHORT n, BOOL bSelectPopupEntry, BOOL bAllowRestoreFocus = TRUE, BOOL bDefaultToDocument = TRUE );
+ void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight );
+ void ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectPopupEntry, sal_Bool bAllowRestoreFocus = sal_True, sal_Bool bDefaultToDocument = sal_True );
- USHORT ImplFindEntry( const Point& rMousePos ) const;
- void ImplCreatePopup( BOOL bPreSelectFirst );
- BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE );
- Rectangle ImplGetItemRect( USHORT nPos );
+ sal_uInt16 ImplFindEntry( const Point& rMousePos ) const;
+ void ImplCreatePopup( sal_Bool bPreSelectFirst );
+ sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
+ Rectangle ImplGetItemRect( sal_uInt16 nPos );
void ImplInitStyleSettings();
@@ -716,7 +716,7 @@ public:
MenuBarWindow( Window* pParent );
~MenuBarWindow();
- void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide );
+ void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
@@ -726,26 +726,26 @@ public:
virtual void Resize();
virtual void RequestHelp( const HelpEvent& rHEvt );
- void SetFocusId( ULONG nId ) { nSaveFocusId = nId; }
- ULONG GetFocusId() const { return nSaveFocusId; }
+ void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong GetFocusId() const { return nSaveFocusId; }
void SetMenu( MenuBar* pMenu );
void KillActivePopup();
PopupMenu* GetActivePopup() const { return pActivePopup; }
void PopupClosed( Menu* pMenu );
- USHORT GetHighlightedItem() const { return nHighlightedItem; }
+ sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- void SetAutoPopup( BOOL bAuto ) { mbAutoPopup = bAuto; }
+ void SetAutoPopup( sal_Bool bAuto ) { mbAutoPopup = bAuto; }
void ImplLayoutChanged();
Size MinCloseButtonSize();
// add an arbitrary button to the menubar (will appear next to closer)
- USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos );
- void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& );
- Rectangle GetMenuBarButtonRectPixel( USHORT nId );
- void RemoveMenuBarButton( USHORT nId );
- bool HandleMenuButtonEvent( USHORT i_nButtonId );
+ sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos );
+ void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
+ Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
+ void RemoveMenuBarButton( sal_uInt16 nId );
+ bool HandleMenuButtonEvent( sal_uInt16 i_nButtonId );
};
static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValue )
@@ -775,24 +775,24 @@ static void ImplSetMenuItemData( MenuItemData* pData )
pData->eType = MENUITEM_STRINGIMAGE;
}
-static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow )
+static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, Window *pWindow )
{
AllSettings aAllSettings( pWindow->GetSettings() );
HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() );
- ULONG nRet = aHelpSettings.GetTipTimeout();
+ sal_uLong nRet = aHelpSettings.GetTipTimeout();
aHelpSettings.SetTipTimeout( nTimeout );
aAllSettings.SetHelpSettings( aHelpSettings );
pWindow->SetSettings( aAllSettings );
return nRet;
}
-static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
+static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect )
{
if( ! pMenu )
- return FALSE;
+ return sal_False;
- BOOL bDone = FALSE;
- USHORT nId = 0;
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nId = 0;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -815,23 +815,23 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
else
{
// give user a chance to read the full filename
- ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
// call always, even when strlen==0 to correctly remove tip
Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) );
ImplChangeTipTimeout( oldTimeout, pMenuWindow );
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( ( rHEvt.GetMode() & HELPMODE_QUICK ) && pMenuWindow )
{
Point aPos = rHEvt.GetMousePosPixel();
Rectangle aRect( aPos, Size() );
// give user a chance to read the full filename
- ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
+ sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow );
// call always, even when strlen==0 to correctly remove tip
Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) );
ImplChangeTipTimeout( oldTimeout, pMenuWindow );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
{
@@ -842,16 +842,16 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- ULONG nHelpId = pMenu->GetHelpId( nId );
+ rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
+ if( ! aHelpId.getLength() )
+ aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
- else if ( nHelpId )
- pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( OOO_HELP_INDEX, NULL );
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -861,7 +861,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
// find docking area that is top aligned and return its height
// note: dockingareas are direct children of the SystemWindow
int height=0;
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if( pWindow->ImplGetFrameWindow() )
{
Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild;
@@ -875,7 +875,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin );
if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP )
{
- bDone = TRUE;
+ bDone = sal_True;
if( pDockingArea->IsVisible() )
height = pDockingArea->GetOutputSizePixel().Height();
}
@@ -894,13 +894,13 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
Menu::Menu()
{
DBG_CTOR( Menu, NULL );
- bIsMenuBar = FALSE;
+ bIsMenuBar = sal_False;
ImplInit();
}
// this constructor makes sure we're creating the native menu
// with the correct type (ie, MenuBar vs. PopupMenu)
-Menu::Menu( BOOL bMenubar )
+Menu::Menu( sal_Bool bMenubar )
{
DBG_CTOR( Menu, NULL );
bIsMenuBar = bMenubar;
@@ -944,7 +944,7 @@ Menu::~Menu()
pDelData = pDelData->mpNext;
}
- bKilled = TRUE;
+ bKilled = sal_True;
delete pItemList;
delete pLogo;
@@ -965,20 +965,20 @@ void Menu::ImplInit()
mpSalMenu = NULL;
nMenuFlags = 0;
nDefaultItem = 0;
- //bIsMenuBar = FALSE; // this is now set in the ctor, must not be changed here!!!
+ //bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!!
nSelectedId = 0;
pItemList = new MenuItemList;
pLogo = NULL;
pStartedFrom = NULL;
pWindow = NULL;
nEventId = 0;
- bCanceled = FALSE;
- bInCallback = FALSE;
- bKilled = FALSE;
+ bCanceled = sal_False;
+ bInCallback = sal_False;
+ bKilled = sal_False;
mpLayoutData = NULL;
mpFirstDel = NULL; // Dtor notification list
// Native-support: returns NULL if not supported
- mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar );
+ mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
}
Menu* Menu::ImplGetStartedFrom() const
@@ -995,13 +995,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
rResId.SetRT( RSC_MENU );
GetRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if( nObjMask & RSC_MENU_ITEMS )
{
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
// MenuItems einfuegen
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
@@ -1016,13 +1016,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
aTitleText = ReadStringRes();
}
if( nObjMask & RSC_MENU_DEFAULTITEMID )
- SetDefaultItem( sal::static_int_cast<USHORT>(ReadLongRes()) );
+ SetDefaultItem( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
}
void Menu::CreateAutoMnemonics()
{
MnemonicGenerator aMnemonicGenerator;
- ULONG n;
+ sal_uLong n;
for ( n = 0; n < pItemList->Count(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos(n);
@@ -1039,7 +1039,7 @@ void Menu::CreateAutoMnemonics()
void Menu::Activate()
{
- bInCallback = TRUE;
+ bInCallback = sal_True;
ImplMenuDelData aDelData( this );
@@ -1054,27 +1054,27 @@ void Menu::Activate()
Menu* pStartMenu = ImplGetStartMenu();
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = TRUE;
+ pStartMenu->bInCallback = sal_True;
// MT 11/01: Call EventListener here? I don't know...
pStartMenu->aActivateHdl.Call( this );
- pStartMenu->bInCallback = FALSE;
+ pStartMenu->bInCallback = sal_False;
}
}
}
- bInCallback = FALSE;
+ bInCallback = sal_False;
}
}
void Menu::Deactivate()
{
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
if ( pData->bIsTemporary )
pItemList->Remove( n );
}
- bInCallback = TRUE;
+ bInCallback = sal_True;
ImplMenuDelData aDelData( this );
@@ -1089,9 +1089,9 @@ void Menu::Deactivate()
{
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = TRUE;
+ pStartMenu->bInCallback = sal_True;
pStartMenu->aDeactivateHdl.Call( this );
- pStartMenu->bInCallback = FALSE;
+ pStartMenu->bInCallback = sal_False;
}
}
}
@@ -1099,7 +1099,7 @@ void Menu::Deactivate()
if( !aDelData.isDeleted() )
{
- bInCallback = FALSE;
+ bInCallback = sal_False;
}
}
@@ -1120,11 +1120,11 @@ void Menu::ImplSelect()
MenuItemData* pData = GetItemList()->GetData( nSelectedId );
if ( pData && (pData->nBits & MIB_AUTOCHECK) )
{
- BOOL bChecked = IsItemChecked( nSelectedId );
+ sal_Bool bChecked = IsItemChecked( nSelectedId );
if ( pData->nBits & MIB_RADIOCHECK )
{
if ( !bChecked )
- CheckItem( nSelectedId, TRUE );
+ CheckItem( nSelectedId, sal_True );
}
else
CheckItem( nSelectedId, !bChecked );
@@ -1170,7 +1170,7 @@ void Menu::RequestHelp( const HelpEvent& )
{
}
-void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos )
+void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
{
ImplMenuDelData aDelData( this );
@@ -1224,14 +1224,14 @@ void Menu::RemoveEventListener( const Link& rEventListener )
// mpDummy4_WindowChildEventListeners->remove( rEventListener );
//}
-void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItemBits, USHORT nPos )
+void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == MENU_ITEM_NOTFOUND,
"Menu::InsertItem(): ItemId already exists" );
// if Position > ItemCount, append
- if ( nPos >= (USHORT)pItemList->Count() )
+ if ( nPos >= (sal_uInt16)pItemList->Count() )
nPos = MENU_APPEND;
// put Item in MenuItemList
@@ -1253,39 +1253,39 @@ void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItem
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::InsertItem( USHORT nItemId, const Image& rImage,
- MenuItemBits nItemBits, USHORT nPos )
+void Menu::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ MenuItemBits nItemBits, sal_uInt16 nPos )
{
InsertItem( nItemId, ImplGetSVEmptyStr(), nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( USHORT nItemId,
+void Menu::InsertItem( sal_uInt16 nItemId,
const XubString& rStr, const Image& rImage,
- MenuItemBits nItemBits, USHORT nPos )
+ MenuItemBits nItemBits, sal_uInt16 nPos )
{
InsertItem( nItemId, rStr, nItemBits, nPos );
SetItemImage( nItemId, rImage );
}
-void Menu::InsertItem( const ResId& rResId, USHORT nPos )
+void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
{
ResMgr* pMgr = rResId.GetResMgr();
if( ! pMgr )
return;
- ULONG nObjMask;
+ sal_uLong nObjMask;
GetRes( rResId.SetRT( RSC_MENUITEM ) );
nObjMask = ReadLongRes();
- BOOL bSep = FALSE;
+ sal_Bool bSep = sal_False;
if ( nObjMask & RSC_MENUITEM_SEPARATOR )
- bSep = (BOOL)ReadShortRes();
+ bSep = (sal_Bool)ReadShortRes();
- USHORT nItemId = 1;
+ sal_uInt16 nItemId = 1;
if ( nObjMask & RSC_MENUITEM_ID )
- nItemId = sal::static_int_cast<USHORT>(ReadLongRes());
+ nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
MenuItemBits nStatus = 0;
if ( nObjMask & RSC_MENUITEM_STATUS )
@@ -1321,15 +1321,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
SetHelpText( nItemId, aHelpText );
}
- ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- nHelpId = ReadLongRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
if ( !bSep )
- SetHelpId( nItemId, nHelpId );
+ SetHelpId( nItemId, aHelpId );
}
- if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
+ if( !bSep )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1341,12 +1340,12 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
if( nObjMask & RSC_MENUITEM_CHECKED )
{
if ( !bSep )
- CheckItem( nItemId, (BOOL)ReadShortRes() );
+ CheckItem( nItemId, (sal_Bool)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_DISABLE )
{
if ( !bSep )
- EnableItem( nItemId, !(BOOL)ReadShortRes() );
+ EnableItem( nItemId, !(sal_Bool)ReadShortRes() );
}
if ( nObjMask & RSC_MENUITEM_COMMAND )
{
@@ -1373,21 +1372,21 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
delete mpLayoutData, mpLayoutData = NULL;
}
-void Menu::InsertSeparator( USHORT nPos )
+void Menu::InsertSeparator( sal_uInt16 nPos )
{
// do nothing if its a menu bar
if ( bIsMenuBar )
return;
// if position > ItemCount, append
- if ( nPos >= (USHORT)pItemList->Count() )
+ if ( nPos >= (sal_uInt16)pItemList->Count() )
nPos = MENU_APPEND;
// put separator in item list
pItemList->InsertSeparator( nPos );
// update native menu
- USHORT itemPos = nPos != MENU_APPEND ? nPos : (USHORT)pItemList->Count() - 1;
+ sal_uInt16 itemPos = nPos != MENU_APPEND ? nPos : (sal_uInt16)pItemList->Count() - 1;
MenuItemData *pData = pItemList->GetDataFromPos( itemPos );
if( ImplGetSalMenu() && pData && pData->pSalMenuItem )
ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos );
@@ -1397,9 +1396,9 @@ void Menu::InsertSeparator( USHORT nPos )
ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos );
}
-void Menu::RemoveItem( USHORT nPos )
+void Menu::RemoveItem( sal_uInt16 nPos )
{
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
if ( nPos < GetItemCount() )
{
@@ -1408,7 +1407,7 @@ void Menu::RemoveItem( USHORT nPos )
ImplGetSalMenu()->RemoveItem( nPos );
pItemList->Remove( nPos );
- bRemove = TRUE;
+ bRemove = sal_True;
}
Window* pWin = ImplGetWindow();
@@ -1424,8 +1423,8 @@ void Menu::RemoveItem( USHORT nPos )
ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos );
}
-void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
- USHORT nMode = 0 )
+void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos,
+ sal_uInt16 nMode = 0 )
{
MenuItemType eType = rMenu.GetItemType( nPos );
@@ -1436,7 +1435,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->InsertSeparator( nNewPos );
else
{
- USHORT nId = rMenu.GetItemId( nPos );
+ sal_uInt16 nId = rMenu.GetItemId( nPos );
DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND,
"Menu::CopyItem(): ItemId already exists" );
@@ -1451,10 +1450,10 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->InsertItem( nId, pData->aImage, pData->nBits, nNewPos );
if ( rMenu.IsItemChecked( nId ) )
- pThis->CheckItem( nId, TRUE );
+ pThis->CheckItem( nId, sal_True );
if ( !rMenu.IsItemEnabled( nId ) )
- pThis->EnableItem( nId, FALSE );
- pThis->SetHelpId( nId, pData->nHelpId );
+ pThis->EnableItem( nId, sal_False );
+ pThis->SetHelpId( nId, pData->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -1476,26 +1475,26 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
}
}
-void Menu::CopyItem( const Menu& rMenu, USHORT nPos, USHORT nNewPos )
+void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos )
{
ImplCopyItem( this, rMenu, nPos, nNewPos );
}
void Menu::Clear()
{
- for ( USHORT i = GetItemCount(); i; i-- )
+ for ( sal_uInt16 i = GetItemCount(); i; i-- )
RemoveItem( 0 );
}
-USHORT Menu::GetItemCount() const
+sal_uInt16 Menu::GetItemCount() const
{
- return (USHORT)pItemList->Count();
+ return (sal_uInt16)pItemList->Count();
}
-USHORT Menu::ImplGetVisibleItemCount() const
+sal_uInt16 Menu::ImplGetVisibleItemCount() const
{
- USHORT nItems = 0;
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ sal_uInt16 nItems = 0;
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
if ( ImplIsVisible( --n ) )
nItems++;
@@ -1503,9 +1502,9 @@ USHORT Menu::ImplGetVisibleItemCount() const
return nItems;
}
-USHORT Menu::ImplGetFirstVisible() const
+sal_uInt16 Menu::ImplGetFirstVisible() const
{
- for ( USHORT n = 0; n < pItemList->Count(); n++ )
+ for ( sal_uInt16 n = 0; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1513,9 +1512,9 @@ USHORT Menu::ImplGetFirstVisible() const
return ITEMPOS_INVALID;
}
-USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const
+sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const
{
- for ( USHORT n = nPos; n; )
+ for ( sal_uInt16 n = nPos; n; )
{
if ( n && ImplIsVisible( --n ) )
return n;
@@ -1523,9 +1522,9 @@ USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const
return ITEMPOS_INVALID;
}
-USHORT Menu::ImplGetNextVisible( USHORT nPos ) const
+sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const
{
- for ( USHORT n = nPos+1; n < pItemList->Count(); n++ )
+ for ( sal_uInt16 n = nPos+1; n < pItemList->Count(); n++ )
{
if ( ImplIsVisible( n ) )
return n;
@@ -1533,7 +1532,7 @@ USHORT Menu::ImplGetNextVisible( USHORT nPos ) const
return ITEMPOS_INVALID;
}
-USHORT Menu::GetItemId( USHORT nPos ) const
+sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1543,9 +1542,9 @@ USHORT Menu::GetItemId( USHORT nPos ) const
return 0;
}
-USHORT Menu::GetItemPos( USHORT nItemId ) const
+sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1554,7 +1553,7 @@ USHORT Menu::GetItemPos( USHORT nItemId ) const
return MENU_ITEM_NOTFOUND;
}
-MenuItemType Menu::GetItemType( USHORT nPos ) const
+MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const
{
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
@@ -1564,19 +1563,19 @@ MenuItemType Menu::GetItemType( USHORT nPos ) const
return MENUITEM_DONTKNOW;
}
-USHORT Menu::GetCurItemId() const
+sal_uInt16 Menu::GetCurItemId() const
{
return nSelectedId;
}
-void Menu::SetItemBits( USHORT nItemId, MenuItemBits nBits )
+void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nBits = nBits;
}
-MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
+MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const
{
MenuItemBits nBits = 0;
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1585,22 +1584,22 @@ MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
return nBits;
}
-void Menu::SetUserValue( USHORT nItemId, ULONG nValue )
+void Menu::SetUserValue( sal_uInt16 nItemId, sal_uLong nValue )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nUserValue = nValue;
}
-ULONG Menu::GetUserValue( USHORT nItemId ) const
+sal_uLong Menu::GetUserValue( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
return pData ? pData->nUserValue : 0;
}
-void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu )
+void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
// Item does not exist -> return NULL
@@ -1630,7 +1629,7 @@ void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu )
ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos );
}
-PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const
+PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1640,9 +1639,9 @@ PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const
return NULL;
}
-void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode )
+void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1658,7 +1657,7 @@ void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode )
ImplGetSalMenu()->SetAccelerator( nPos, pData->pSalMenuItem, rKeyCode, rKeyCode.GetName() );
}
-KeyCode Menu::GetAccelKey( USHORT nItemId ) const
+KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1668,16 +1667,16 @@ KeyCode Menu::GetAccelKey( USHORT nItemId ) const
return KeyCode();
}
-KeyEvent Menu::GetActivationKey( USHORT nItemId ) const
+KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const
{
KeyEvent aRet;
MenuItemData* pData = pItemList->GetData( nItemId );
if( pData )
{
- USHORT nPos = pData->aText.Search( '~' );
+ sal_uInt16 nPos = pData->aText.Search( '~' );
if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
sal_Unicode cAccel = pData->aText.GetChar( nPos+1 );
if( cAccel >= 'a' && cAccel <= 'z' )
nCode = KEY_A + (cAccel-'a');
@@ -1693,9 +1692,9 @@ KeyEvent Menu::GetActivationKey( USHORT nItemId ) const
return aRet;
}
-void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
+void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData || pData->bChecked == bCheck )
@@ -1706,9 +1705,9 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
(pData->nBits & MIB_RADIOCHECK) )
{
MenuItemData* pGroupData;
- USHORT nGroupPos;
- USHORT nItemCount = GetItemCount();
- BOOL bFound = FALSE;
+ sal_uInt16 nGroupPos;
+ sal_uInt16 nItemCount = GetItemCount();
+ sal_Bool bFound = sal_False;
nGroupPos = nPos;
while ( nGroupPos )
@@ -1718,8 +1717,8 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, FALSE );
- bFound = TRUE;
+ CheckItem( pGroupData->nId, sal_False );
+ bFound = sal_True;
break;
}
}
@@ -1738,7 +1737,7 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, FALSE );
+ CheckItem( pGroupData->nId, sal_False );
break;
}
}
@@ -1758,20 +1757,20 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos );
}
-BOOL Menu::IsItemChecked( USHORT nItemId ) const
+sal_Bool Menu::IsItemChecked( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return FALSE;
+ return sal_False;
return pData->bChecked;
}
-void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
+void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pItemData = pItemList->GetData( nItemId, nPos );
if ( pItemData && ( pItemData->bEnabled != bEnable ) )
@@ -1783,8 +1782,8 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
{
DBG_ASSERT( bIsMenuBar, "Menu::EnableItem - Popup visible!" );
long nX = 0;
- ULONG nCount = pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -1803,20 +1802,20 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable )
}
}
-BOOL Menu::IsItemEnabled( USHORT nItemId ) const
+sal_Bool Menu::IsItemEnabled( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
- return FALSE;
+ return sal_False;
return pData->bEnabled;
}
-void Menu::ShowItem( USHORT nItemId, BOOL bVisible )
+void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
DBG_ASSERT( !bIsMenuBar, "Menu::ShowItem - ignored for menu bar entries!" );
@@ -1838,9 +1837,9 @@ void Menu::ShowItem( USHORT nItemId, BOOL bVisible )
}
}
-void Menu::SetItemText( USHORT nItemId, const XubString& rStr )
+void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1867,9 +1866,9 @@ void Menu::SetItemText( USHORT nItemId, const XubString& rStr )
}
}
-XubString Menu::GetItemText( USHORT nItemId ) const
+XubString Menu::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1878,9 +1877,9 @@ XubString Menu::GetItemText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetItemImage( USHORT nItemId, const Image& rImage )
+void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( !pData )
@@ -1904,9 +1903,9 @@ static inline Image ImplRotImage( const Image& rImage, long nAngle10 )
return Image( aBmpEx );
}
-void Menu::SetItemImageAngle( USHORT nItemId, long nAngle10 )
+void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1931,9 +1930,9 @@ static inline Image ImplMirrorImage( const Image& rImage )
return Image( aBmpEx );
}
-void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
+void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData )
@@ -1949,7 +1948,7 @@ void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
}
}
-Image Menu::GetItemImage( USHORT nItemId ) const
+Image Menu::GetItemImage( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1959,7 +1958,7 @@ Image Menu::GetItemImage( USHORT nItemId ) const
return Image();
}
-long Menu::GetItemImageAngle( USHORT nItemId ) const
+long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1969,17 +1968,17 @@ long Menu::GetItemImageAngle( USHORT nItemId ) const
return 0;
}
-BOOL Menu::GetItemImageMirrorMode( USHORT nItemId ) const
+sal_Bool Menu::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
return pData->bMirrorMode;
else
- return FALSE;
+ return sal_False;
}
-void Menu::SetItemCommand( USHORT nItemId, const String& rCommand )
+void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1987,7 +1986,7 @@ void Menu::SetItemCommand( USHORT nItemId, const String& rCommand )
pData->aCommandStr = rCommand;
}
-const XubString& Menu::GetItemCommand( USHORT nItemId ) const
+const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -1997,7 +1996,7 @@ const XubString& Menu::GetItemCommand( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr )
+void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2005,7 +2004,7 @@ void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr )
pData->aHelpCommandStr = rStr;
}
-const XubString& Menu::GetHelpCommand( USHORT nItemId ) const
+const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2015,7 +2014,7 @@ const XubString& Menu::GetHelpCommand( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpText( USHORT nItemId, const XubString& rStr )
+void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2023,14 +2022,14 @@ void Menu::SetHelpText( USHORT nItemId, const XubString& rStr )
pData->aHelpText = rStr;
}
-const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
+const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
+ (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2038,8 +2037,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->nHelpId )
- pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
+ if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2049,12 +2048,12 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-const XubString& Menu::GetHelpText( USHORT nItemId ) const
+const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const
{
return ImplGetHelpText( nItemId );
}
-void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr )
+void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2062,7 +2061,7 @@ void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr )
pData->aTipHelpText = rStr;
}
-const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
+const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2072,22 +2071,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void Menu::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->nHelpId = nHelpId;
+ pData->aHelpId = rHelpId;
}
-ULONG Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const
{
+ rtl::OString aRet;
+
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- return pData->nHelpId;
- else
- return 0;
+ {
+ if ( pData->aHelpId.getLength() )
+ aRet = pData->aHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
Menu& Menu::operator=( const Menu& rMenu )
@@ -2096,8 +2102,8 @@ Menu& Menu::operator=( const Menu& rMenu )
Clear();
// Items kopieren
- USHORT nCount = rMenu.GetItemCount();
- for ( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = rMenu.GetItemCount();
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
ImplCopyItem( this, rMenu, i, MENU_APPEND, 1 );
nDefaultItem = rMenu.nDefaultItem;
@@ -2111,24 +2117,24 @@ Menu& Menu::operator=( const Menu& rMenu )
return *this;
}
-BOOL Menu::ImplIsVisible( USHORT nPos ) const
+sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const
{
- BOOL bVisible = TRUE;
+ sal_Bool bVisible = sal_True;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if( pData && !pData->bVisible )
- bVisible = FALSE;
+ bVisible = sal_False;
if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR )
{
if( nPos == 0 ) // no separator should be shown at the very beginning
- bVisible = FALSE;
+ bVisible = sal_False;
else
{
// always avoid adjacent separators
- USHORT nCount = (USHORT) pItemList->Count();
- USHORT n;
+ sal_uInt16 nCount = (sal_uInt16) pItemList->Count();
+ sal_uInt16 n;
MenuItemData* pNextData = NULL;
// search next visible item
for( n = nPos + 1; n < nCount; n++ )
@@ -2141,10 +2147,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
}
}
if( n == nCount ) // no next visible item
- bVisible = FALSE;
+ bVisible = sal_False;
// check for separator
if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR )
- bVisible = FALSE;
+ bVisible = sal_False;
if( bVisible )
{
@@ -2158,7 +2164,7 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
}
}
if( n == 0 ) // no previous visible item
- bVisible = FALSE;
+ bVisible = sal_False;
}
}
}
@@ -2169,10 +2175,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
!( nMenuFlags & MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ) )
{
if( !pData ) // e.g. nPos == ITEMPOS_INVALID
- bVisible = FALSE;
+ bVisible = sal_False;
else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above
{
- // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( TRUE ) );
+ // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( sal_True ) );
bVisible = pData->bEnabled; // SubMenus nicht pruefen, weil sie ggf. erst im Activate() gefuellt werden.
}
}
@@ -2180,34 +2186,34 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
return bVisible;
}
-BOOL Menu::IsItemVisible( USHORT nItemId ) const
+sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const
{
return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) );
}
-BOOL Menu::IsItemPosVisible( USHORT nItemPos ) const
+sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const
{
return IsMenuVisible() && ImplIsVisible( nItemPos );
}
-BOOL Menu::IsMenuVisible() const
+sal_Bool Menu::IsMenuVisible() const
{
return pWindow && pWindow->IsReallyVisible();
}
-BOOL Menu::ImplIsSelectable( USHORT nPos ) const
+sal_Bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const
{
- BOOL bSelectable = TRUE;
+ sal_Bool bSelectable = sal_True;
MenuItemData* pData = pItemList->GetDataFromPos( nPos );
// check general visibility first
if ( pData && ( pData->nBits & MIB_NOSELECT ) )
- bSelectable = FALSE;
+ bSelectable = sal_False;
return bSelectable;
}
-void Menu::SelectItem( USHORT nItemId )
+void Menu::SelectItem( sal_uInt16 nItemId )
{
if( bIsMenuBar )
static_cast<MenuBar*>(this)->SelectEntry( nItemId );
@@ -2362,7 +2368,7 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( rSettings.GetUseImagesInMenus() )
{
nMinMenuItemHeight = 16;
- for ( USHORT i = (USHORT)pItemList->Count(); i; )
+ for ( sal_uInt16 i = (sal_uInt16)pItemList->Count(); i; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --i );
if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )))
@@ -2380,7 +2386,7 @@ Size Menu::ImplCalcSize( Window* pWin )
}
}
- for ( USHORT n = (USHORT)pItemList->Count(); n; )
+ for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
@@ -2478,8 +2484,18 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
- USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
- nCheckPos = (USHORT)nExtra;
+ // popup menus should not be wider than half the screen
+ // except on rather small screens
+ // TODO: move GetScreenNumber from SystemWindow to Window ?
+ // currently we rely on internal privileges
+ unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber;
+ Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) );
+ long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800;
+ if( nMaxWidth > nScreenWidth/2 )
+ nMaxWidth = nScreenWidth/2;
+
+ sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
+ nCheckPos = (sal_uInt16)nExtra;
if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
{
long nImgOrChkWidth = 0;
@@ -2489,12 +2505,12 @@ Size Menu::ImplCalcSize( Window* pWin )
else // non NWF case
nImgOrChkWidth = nFontHeight/2 + gfxExtra;
nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
- nTextPos = (USHORT)(nImagePos + nImgOrChkWidth);
+ nTextPos = (sal_uInt16)(nImagePos + nImgOrChkWidth);
}
else
{
nImagePos = nCheckPos;
- nTextPos = (USHORT)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
+ nTextPos = (sal_uInt16)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth ));
}
nTextPos = nTextPos + gfxExtra;
@@ -2507,7 +2523,7 @@ Size Menu::ImplCalcSize( Window* pWin )
}
else
{
- nTextPos = (USHORT)(2*nExtra);
+ nTextPos = (sal_uInt16)(2*nExtra);
aSz.Height() = nFontHeight+6;
// get menubar height from native methods if supported
@@ -2549,7 +2565,7 @@ Size Menu::ImplCalcSize( Window* pWin )
static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
@@ -2567,11 +2583,31 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
{
const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() );
- i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor );
+ i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor );
+ }
+}
+
+static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_nMaxWidth )
+{
+ xub_StrLen nPos = STRING_NOTFOUND;
+ String aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) );
+ aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS );
+ // re-insert mnemonic
+ if( nPos != STRING_NOTFOUND )
+ {
+ if( nPos < aNonMnem.Len() && i_rLong.GetChar(nPos+1) == aNonMnem.GetChar(nPos) )
+ {
+ rtl::OUStringBuffer aBuf( i_rLong.Len() );
+ aBuf.append( aNonMnem.GetBuffer(), nPos );
+ aBuf.append( sal_Unicode('~') );
+ aBuf.append( aNonMnem.GetBuffer()+nPos );
+ aNonMnem = aBuf.makeStringAndClear();
+ }
}
+ return aNonMnem;
}
-void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
+void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemData* pThisItemOnly, sal_Bool bHighlighted, bool bLayout ) const
{
// Fuer Symbole: nFontHeight x nFontHeight
long nFontHeight = pWin->GetTextHeight();
@@ -2597,10 +2633,10 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
}
Size aOutSz = pWin->GetOutputSizePixel();
- USHORT nCount = (USHORT)pItemList->Count();
+ sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
if( bLayout )
mpLayoutData->m_aVisibleItemBoundRects.clear();
- for ( USHORT n = 0; n < nCount; n++ )
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( ImplIsVisible( n ) && ( !pThisItemOnly || ( pData == pThisItemOnly ) ) )
@@ -2617,9 +2653,9 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2);
if( bIsMenuBar )
nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
- USHORT nTextStyle = 0;
- USHORT nSymbolStyle = 0;
- USHORT nImageStyle = 0;
+ sal_uInt16 nTextStyle = 0;
+ sal_uInt16 nSymbolStyle = 0;
+ sal_uInt16 nImageStyle = 0;
// SubMenus ohne Items werden nicht mehr disablte dargestellt,
// wenn keine Items enthalten sind, da die Anwendung selber
// darauf achten muss. Ansonsten gibt es Faelle, wo beim
@@ -2634,14 +2670,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
// Separator
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
- aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
- pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- aTmpPos.Y()++;
- pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- pWin->SetLineColor();
+ bool bNativeOk = false;
+ if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
+ PART_MENU_SEPARATOR ) )
+ {
+ ControlState nState = 0;
+ if ( pData->bEnabled )
+ nState |= CTRL_STATE_ENABLED;
+ if ( bHighlighted )
+ nState |= CTRL_STATE_SELECTED;
+ Size aSz( pData->aSz );
+ aSz.Width() = aOutSz.Width() - 2*nOuterSpace;
+ Rectangle aItemRect( aPos, aSz );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect );
+ bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR,
+ aItemRect,
+ nState,
+ aVal,
+ OUString() );
+ }
+ if( ! bNativeOk )
+ {
+ aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
+ aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
+ pWin->SetLineColor( rSettings.GetShadowColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ aTmpPos.Y()++;
+ pWin->SetLineColor( rSettings.GetLightColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ pWin->SetLineColor();
+ }
}
Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) );
@@ -2686,10 +2744,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
- ImplControlValue(),
+ aVal,
OUString() );
}
else if ( pData->bChecked ) // by default do nothing for unchecked items
@@ -2737,7 +2796,7 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.X() = aPos.X() + nTextPos;
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
if ( pData->bIsTemporary )
nStyle |= TEXT_DRAW_DISABLE;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
@@ -2761,7 +2820,19 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
pWin->GetSettings().GetStyleSettings().GetMenuColor();
pWin->SetBackground( Wallpaper( aBg ) );
}
- pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText );
+ // how much space is there for the text ?
+ long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpace;
+ if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
+ {
+ XubString aAccText = pData->aAccelKey.GetName();
+ nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra;
+ }
+ if( !bIsMenuBar && pData->pSubMenu )
+ {
+ nMaxItemTextWidth -= nFontHeight - nExtra;
+ }
+ String aItemText( getShortenedString( pData->aText, pWin, nMaxItemTextWidth ) );
+ pWin->DrawCtrlText( aTmpPos, aItemText, 0, aItemText.Len(), nStyle, pVector, pDisplayText );
if( bSetTmpBackground )
pWin->SetBackground();
}
@@ -2797,16 +2868,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aDecoView.DrawSymbol(
Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ),
SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle );
-// if ( pData->nBits & MIB_POPUPSELECT )
-// {
-// aTmpPos.Y() += nFontHeight/2 ;
-// pWin->SetLineColor( rSettings.GetShadowColor() );
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor( rSettings.GetLightColor() );
-// aTmpPos.Y()++;
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor();
-// }
}
if ( pThisItemOnly && bHighlighted )
@@ -2869,7 +2930,7 @@ Menu* Menu::ImplGetStartMenu()
return pStart;
}
-void Menu::ImplCallHighlight( USHORT nHighlightedItem )
+void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem )
{
ImplMenuDelData aDelData( this );
@@ -2897,7 +2958,7 @@ Menu* Menu::ImplFindSelectMenu()
{
Menu* pSelMenu = nEventId ? this : NULL;
- for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2908,11 +2969,11 @@ Menu* Menu::ImplFindSelectMenu()
return pSelMenu;
}
-Menu* Menu::ImplFindMenu( USHORT nItemId )
+Menu* Menu::ImplFindMenu( sal_uInt16 nItemId )
{
Menu* pSelMenu = NULL;
- for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2925,25 +2986,25 @@ Menu* Menu::ImplFindMenu( USHORT nItemId )
return pSelMenu;
}
-void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
+void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPopups )
{
- for ( USHORT n = 0; n < GetItemCount(); n++ )
+ for ( sal_uInt16 n = 0; n < GetItemCount(); n++ )
{
- BOOL bRemove = FALSE;
+ sal_Bool bRemove = sal_False;
MenuItemData* pItem = pItemList->GetDataFromPos( n );
if ( pItem->eType == MENUITEM_SEPARATOR )
{
if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) )
- bRemove = TRUE;
+ bRemove = sal_True;
}
else
bRemove = !pItem->bEnabled;
if ( bCheckPopups && pItem->pSubMenu )
{
- pItem->pSubMenu->RemoveDisabledEntries( TRUE );
+ pItem->pSubMenu->RemoveDisabledEntries( sal_True );
if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() )
- bRemove = TRUE;
+ bRemove = sal_True;
}
if ( bRemove )
@@ -2952,7 +3013,7 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
if ( GetItemCount() )
{
- USHORT nLast = GetItemCount() - 1;
+ sal_uInt16 nLast = GetItemCount() - 1;
MenuItemData* pItem = pItemList->GetDataFromPos( nLast );
if ( pItem->eType == MENUITEM_SEPARATOR )
RemoveItem( nLast );
@@ -2960,19 +3021,19 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups )
delete mpLayoutData, mpLayoutData = NULL;
}
-BOOL Menu::HasValidEntries( BOOL bCheckPopups )
+sal_Bool Menu::HasValidEntries( sal_Bool bCheckPopups )
{
- BOOL bValidEntries = FALSE;
- USHORT nCount = GetItemCount();
- for ( USHORT n = 0; !bValidEntries && ( n < nCount ); n++ )
+ sal_Bool bValidEntries = sal_False;
+ sal_uInt16 nCount = GetItemCount();
+ for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ )
{
MenuItemData* pItem = pItemList->GetDataFromPos( n );
if ( pItem->bEnabled && ( pItem->eType != MENUITEM_SEPARATOR ) )
{
if ( bCheckPopups && pItem->pSubMenu )
- bValidEntries = pItem->pSubMenu->HasValidEntries( TRUE );
+ bValidEntries = pItem->pSubMenu->HasValidEntries( sal_True );
else
- bValidEntries = TRUE;
+ bValidEntries = sal_True;
}
}
return bValidEntries;
@@ -3010,12 +3071,12 @@ void Menu::ImplFillLayoutData() const
mpLayoutData = new MenuLayoutData();
if( bIsMenuBar )
{
- ImplPaint( pWindow, 0, 0, 0, FALSE, true );
+ ImplPaint( pWindow, 0, 0, 0, sal_False, true );
}
else
{
MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow;
- ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, FALSE, true );
+ ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, sal_False, true );
}
}
}
@@ -3027,7 +3088,7 @@ String Menu::GetDisplayText() const
return mpLayoutData ? mpLayoutData->m_aDisplayText : String();
}
-Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const
+Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpLayoutData )
@@ -3047,7 +3108,7 @@ Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const
}
-long Menu::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
+long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -3085,7 +3146,7 @@ Pair Menu::GetLineStartEnd( long nLine ) const
return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
}
-Pair Menu::GetItemStartEnd( USHORT nItem ) const
+Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const
{
if( ! mpLayoutData )
ImplFillLayoutData();
@@ -3097,9 +3158,9 @@ Pair Menu::GetItemStartEnd( USHORT nItem ) const
return Pair( -1, -1 );
}
-USHORT Menu::GetDisplayItemId( long nLine ) const
+sal_uInt16 Menu::GetDisplayItemId( long nLine ) const
{
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if( ! mpLayoutData )
ImplFillLayoutData();
if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) )
@@ -3107,19 +3168,19 @@ USHORT Menu::GetDisplayItemId( long nLine ) const
return nItemId;
}
-BOOL Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
+sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( pWindow && pReferenceWindow )
{
rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint );
rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const
+Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const
{
Rectangle aRet;
@@ -3127,16 +3188,16 @@ Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const
ImplFillLayoutData();
if( mpLayoutData )
{
- std::map< USHORT, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
+ std::map< sal_uInt16, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos );
if( it != mpLayoutData->m_aVisibleItemBoundRects.end() )
aRet = it->second;
}
return aRet;
}
-void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr )
+void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
if ( pData && !rStr.Equals( pData->aAccessibleName ) )
@@ -3146,7 +3207,7 @@ void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr )
}
}
-XubString Menu::GetAccessibleName( USHORT nItemId ) const
+XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3156,7 +3217,7 @@ XubString Menu::GetAccessibleName( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr )
+void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3164,7 +3225,7 @@ void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr )
pData->aAccessibleDescription = rStr;
}
-XubString Menu::GetAccessibleDescription( USHORT nItemId ) const
+XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -3181,19 +3242,19 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
mpSalMenu = pSalMenu;
}
-BOOL Menu::GetSystemMenuData( SystemMenuData* pData ) const
+sal_Bool Menu::GetSystemMenuData( SystemMenuData* pData ) const
{
Menu* pMenu = (Menu*)this;
if( pData && pMenu->ImplGetSalMenu() )
{
pMenu->ImplGetSalMenu()->GetSystemMenuData( pData );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-bool Menu::IsHighlighted( USHORT nItemPos ) const
+bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const
{
bool bRet = false;
@@ -3208,19 +3269,19 @@ bool Menu::IsHighlighted( USHORT nItemPos ) const
return bRet;
}
-void Menu::HighlightItem( USHORT nItemPos )
+void Menu::HighlightItem( sal_uInt16 nItemPos )
{
if ( pWindow )
{
if ( bIsMenuBar )
{
MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow );
- pMenuWin->SetAutoPopup( FALSE );
- pMenuWin->ChangeHighlightItem( nItemPos, FALSE );
+ pMenuWin->SetAutoPopup( sal_False );
+ pMenuWin->ChangeHighlightItem( nItemPos, sal_False );
}
else
{
- static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, FALSE );
+ static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, sal_False );
}
}
}
@@ -3229,54 +3290,54 @@ void Menu::HighlightItem( USHORT nItemPos )
// - MenuBar -
// -----------
-MenuBar::MenuBar() : Menu( TRUE )
+MenuBar::MenuBar() : Menu( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
}
-MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( TRUE )
+MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
*this = rMenu;
- bIsMenuBar = TRUE;
+ bIsMenuBar = sal_True;
}
-MenuBar::MenuBar( const ResId& rResId ) : Menu ( TRUE )
+MenuBar::MenuBar( const ResId& rResId ) : Menu ( sal_True )
{
- mbDisplayable = TRUE;
- mbCloserVisible = FALSE;
- mbFloatBtnVisible = FALSE;
- mbHideBtnVisible = FALSE;
+ mbDisplayable = sal_True;
+ mbCloserVisible = sal_False;
+ mbFloatBtnVisible = sal_False;
+ mbHideBtnVisible = sal_False;
ImplLoadRes( rResId );
}
MenuBar::~MenuBar()
{
- ImplDestroy( this, TRUE );
+ ImplDestroy( this, sal_True );
}
-void MenuBar::ShowCloser( BOOL bShow )
+void MenuBar::ShowCloser( sal_Bool bShow )
{
ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible );
}
-void MenuBar::ShowFloatButton( BOOL bShow )
+void MenuBar::ShowFloatButton( sal_Bool bShow )
{
ShowButtons( mbCloserVisible, bShow, mbHideBtnVisible );
}
-void MenuBar::ShowHideButton( BOOL bShow )
+void MenuBar::ShowHideButton( sal_Bool bShow )
{
ShowButtons( mbCloserVisible, mbFloatBtnVisible, bShow );
}
-void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
+void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
{
if ( (bClose != mbCloserVisible) ||
(bFloat != mbFloatBtnVisible) ||
@@ -3290,7 +3351,7 @@ void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
}
}
-void MenuBar::SetDisplayable( BOOL bDisplayable )
+void MenuBar::SetDisplayable( sal_Bool bDisplayable )
{
if( bDisplayable != mbDisplayable )
{
@@ -3321,7 +3382,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
return pWindow;
}
-void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete )
+void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete )
{
MenuBarWindow* pWindow = (MenuBarWindow*) pMenu->ImplGetWindow();
if ( pWindow && bDelete )
@@ -3332,9 +3393,9 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete )
pMenu->pWindow = NULL;
}
-BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
+sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
// No keyboard processing when system handles the menu or our menubar is invisible
if( !IsDisplayable() ||
@@ -3350,7 +3411,7 @@ BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
// -----------------------------------------------------------------------
-void MenuBar::SelectEntry( USHORT nId )
+void MenuBar::SelectEntry( sal_uInt16 nId )
{
MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow();
@@ -3360,14 +3421,14 @@ void MenuBar::SelectEntry( USHORT nId )
nId = GetItemPos( nId );
// #99705# popup the selected menu
- pMenuWin->SetAutoPopup( TRUE );
+ pMenuWin->SetAutoPopup( sal_True );
if( ITEMPOS_INVALID != pMenuWin->nHighlightedItem )
{
pMenuWin->KillActivePopup();
- pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
if( nId != ITEMPOS_INVALID )
- pMenuWin->ChangeHighlightItem( nId, FALSE );
+ pMenuWin->ChangeHighlightItem( nId, sal_False );
}
}
@@ -3375,38 +3436,38 @@ void MenuBar::SelectEntry( USHORT nId )
// handler for native menu selection and command events
-BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
+sal_Bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Activate();
if( !aDelData.isDeleted() )
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
+sal_Bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
if( !aDelData.isDeleted() )
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
- return TRUE;
+ return sal_True;
}
-BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) const
+sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId );
@@ -3424,13 +3485,13 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId )
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos );
}
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) const
+sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const
{
if( !pMenu )
pMenu = ((Menu*) this)->ImplFindMenu( nCommandEventId );
@@ -3439,47 +3500,47 @@ BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) cons
pMenu->nSelectedId = nCommandEventId;
pMenu->pStartedFrom = (Menu*)this;
pMenu->ImplSelect();
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, USHORT i_nPos )
+sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, sal_uInt16 i_nPos )
{
return AddMenuBarButton( i_rImage, i_rLink, String(), i_nPos );
}
-USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
+sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->AddMenuBarButton( i_rImage, i_rLink, i_rToolTip, i_nPos ) : 0;
}
-void MenuBar::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
+void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->SetMenuBarButtonHighlightHdl( nId, rLink );
}
-Rectangle MenuBar::GetMenuBarButtonRectPixel( USHORT nId )
+Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId )
{
return pWindow ? static_cast<MenuBarWindow*>(pWindow)->GetMenuBarButtonRectPixel( nId ) : Rectangle();
}
-void MenuBar::RemoveMenuBarButton( USHORT nId )
+void MenuBar::RemoveMenuBarButton( sal_uInt16 nId )
{
if( pWindow )
static_cast<MenuBarWindow*>(pWindow)->RemoveMenuBarButton( nId );
}
-BOOL MenuBar::HandleMenuButtonEvent( Menu *, USHORT i_nButtonId ) const
+sal_Bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) const
{
return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId );
}
// -----------------------------------------------------------------------
-// BOOL PopupMenu::bAnyPopupInExecute = FALSE;
+// sal_Bool PopupMenu::bAnyPopupInExecute = sal_False;
PopupMenu::PopupMenu()
{
@@ -3504,9 +3565,9 @@ PopupMenu::~PopupMenu()
*pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData
}
-BOOL PopupMenu::IsInExecute()
+sal_Bool PopupMenu::IsInExecute()
{
- return GetActivePopupMenu() ? TRUE : FALSE;
+ return GetActivePopupMenu() ? sal_True : sal_False;
}
PopupMenu* PopupMenu::GetActivePopupMenu()
@@ -3515,22 +3576,22 @@ PopupMenu* PopupMenu::GetActivePopupMenu()
return pSVData->maAppData.mpActivePopupMenu;
}
-void PopupMenu::EndExecute( USHORT nSelectId )
+void PopupMenu::EndExecute( sal_uInt16 nSelectId )
{
if ( ImplGetWindow() )
ImplGetFloatingWindow()->EndExecute( nSelectId );
}
-void PopupMenu::SelectEntry( USHORT nId )
+void PopupMenu::SelectEntry( sal_uInt16 nId )
{
if ( ImplGetWindow() )
{
if( nId != ITEMPOS_INVALID )
{
- USHORT nPos;
+ sal_uInt16 nPos;
MenuItemData* pData = GetItemList()->GetData( nId, nPos );
if ( pData->pSubMenu )
- ImplGetFloatingWindow()->ChangeHighlightItem( nPos, TRUE );
+ ImplGetFloatingWindow()->ChangeHighlightItem( nPos, sal_True );
else
ImplGetFloatingWindow()->EndExecute( nId );
}
@@ -3538,7 +3599,7 @@ void PopupMenu::SelectEntry( USHORT nId )
{
MenuFloatingWindow* pFloat = ImplGetFloatingWindow();
pFloat->GrabFocus();
- USHORT nPos;
+ sal_uInt16 nPos;
for( nPos = 0; nPos < GetItemList()->Count(); nPos++ )
{
MenuItemData* pData = (MenuItemData*)GetItemList()->GetObject( nPos );
@@ -3547,27 +3608,27 @@ void PopupMenu::SelectEntry( USHORT nId )
pFloat->KillActivePopup();
}
}
- pFloat->ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ pFloat->ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
}
}
-void PopupMenu::SetSelectedEntry( USHORT nId )
+void PopupMenu::SetSelectedEntry( sal_uInt16 nId )
{
nSelectedId = nId;
}
-USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
+sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos )
{
return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN );
}
-USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT nFlags )
+sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags )
{
ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 );
- ULONG nPopupModeFlags = 0;
+ sal_uLong nPopupModeFlags = 0;
if ( nFlags & POPUPMENU_EXECUTE_DOWN )
nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
else if ( nFlags & POPUPMENU_EXECUTE_UP )
@@ -3582,10 +3643,10 @@ USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT n
if (nFlags & POPUPMENU_NOMOUSEUPCLOSE ) // allow popup menus to stay open on mouse button up
nPopupModeFlags |= FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE; // useful if the menu was opened on mousebutton down (eg toolbox configuration)
- return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, FALSE );
+ return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, sal_False );
}
-USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst )
+sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst )
{
if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
return 0;
@@ -3596,15 +3657,15 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
pStartedFrom = pSFrom;
nSelectedId = 0;
- bCanceled = FALSE;
+ bCanceled = sal_False;
- ULONG nFocusId = 0;
- BOOL bRealExecute = FALSE;
+ sal_uLong nFocusId = 0;
+ sal_Bool bRealExecute = sal_False;
if ( !pStartedFrom )
{
- pSVData->maWinData.mbNoDeactivate = TRUE;
+ pSVData->maWinData.mbNoDeactivate = sal_True;
nFocusId = Window::SaveFocus();
- bRealExecute = TRUE;
+ bRealExecute = sal_True;
}
else
{
@@ -3631,9 +3692,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
ImplDelData aDelData;
pW->ImplAddDel( &aDelData );
- bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
+ bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
Activate();
- bInCallback = FALSE;
+ bInCallback = sal_False;
if ( aDelData.IsDelete() )
return 0; // Error
@@ -3659,7 +3720,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
nMenuFlags |= MENU_FLAG_HIDEDISABLEDENTRIES;
- USHORT nVisibleEntries = ImplGetVisibleItemCount();
+ sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount();
if ( !nVisibleEntries )
{
ResMgr* pResMgr = ImplGetResMgr();
@@ -3668,7 +3729,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) );
MenuItemData* pData = pItemList->Insert(
0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF );
- pData->bIsTemporary = TRUE;
+ pData->bIsTemporary = sal_True;
}
}
else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) )
@@ -3703,9 +3764,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
nMaxHeight -= nTop+nBottom;
if ( aSz.Height() > nMaxHeight )
{
- pWin->EnableScrollMenu( TRUE );
- USHORT nStart = ImplGetFirstVisible();
- USHORT nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
+ pWin->EnableScrollMenu( sal_True );
+ sal_uInt16 nStart = ImplGetFirstVisible();
+ sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart );
aSz.Height() = ImplCalcHeight( nEntries );
}
@@ -3720,7 +3781,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
if ( GetItemCount() )
{
SalMenu* pMenu = ImplGetSalMenu();
- if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
+ if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) )
{
pWin->StopExecute(0);
pWin->doShutdown();
@@ -3734,7 +3795,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
if( pSFrom )
{
- USHORT aPos;
+ sal_uInt16 aPos;
if( pSFrom->bIsMenuBar )
aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem();
else
@@ -3746,14 +3807,14 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
if ( bPreSelectFirst )
{
- USHORT nCount = (USHORT)pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( ( pData->bEnabled || !Application::GetSettings().GetStyleSettings().GetSkipDisabledInMenus() )
&& ( pData->eType != MENUITEM_SEPARATOR ) && ImplIsVisible( n ) && ImplIsSelectable( n ) )
{
- pWin->ChangeHighlightItem( n, FALSE );
+ pWin->ChangeHighlightItem( n, sal_False );
break;
}
}
@@ -3783,7 +3844,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
if ( nFocusId )
{
pWin->SetFocusId( 0 );
- pSVData->maWinData.mbNoDeactivate = FALSE;
+ pSVData->maWinData.mbNoDeactivate = sal_False;
}
pWin->ImplEndPopupMode( 0, nFocusId );
@@ -3814,18 +3875,18 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
return bRealExecute ? nSelectedId : 0;
}
-USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHORT* pLastVisible ) const
+sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const
{
nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight();
long nHeight = 0;
- USHORT nEntries = (USHORT) pItemList->Count();
- USHORT nVisEntries = 0;
+ sal_uInt16 nEntries = (sal_uInt16) pItemList->Count();
+ sal_uInt16 nVisEntries = 0;
if ( pLastVisible )
*pLastVisible = 0;
- for ( USHORT n = nStartEntry; n < nEntries; n++ )
+ for ( sal_uInt16 n = nStartEntry; n < nEntries; n++ )
{
if ( ImplIsVisible( n ) )
{
@@ -3842,14 +3903,14 @@ USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHOR
return nVisEntries;
}
-long PopupMenu::ImplCalcHeight( USHORT nEntries ) const
+long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const
{
long nHeight = 0;
- USHORT nFound = 0;
- for ( USHORT n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
+ sal_uInt16 nFound = 0;
+ for ( sal_uInt16 n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ )
{
- if ( ImplIsVisible( (USHORT) n ) )
+ if ( ImplIsVisible( (sal_uInt16) n ) )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
nHeight += pData->aSz.Height();
@@ -3863,7 +3924,7 @@ long PopupMenu::ImplCalcHeight( USHORT nEntries ) const
}
-static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
+static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar )
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
@@ -3880,7 +3941,7 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
Wallpaper aWallpaper;
aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT );
pWin->SetBackground( aWallpaper );
- pWin->SetPaintTransparent( FALSE );
+ pWin->SetPaintTransparent( sal_False );
pWin->SetParentClipMode( 0 );
}
}
@@ -3905,12 +3966,12 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar )
MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) :
FloatingWindow( pParent, nStyle )
{
- mpWindowImpl->mbMenuFloatingWindow= TRUE;
+ mpWindowImpl->mbMenuFloatingWindow= sal_True;
pMenu = pMen;
pActivePopup = 0;
nSaveFocusId = 0;
- bInExecute = FALSE;
- bScrollMenu = FALSE;
+ bInExecute = sal_False;
+ bScrollMenu = sal_False;
nHighlightedItem = ITEMPOS_INVALID;
nMBDownPos = ITEMPOS_INVALID;
nPosInParent = ITEMPOS_INVALID;
@@ -3918,13 +3979,13 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt
// nStartY = 0;
nBorder = EXTRASPACEY;
nFirstEntry = 0;
- bScrollUp = FALSE;
- bScrollDown = FALSE;
- bIgnoreFirstMove = TRUE;
- bKeyInput = FALSE;
+ bScrollUp = sal_False;
+ bScrollDown = sal_False;
+ bIgnoreFirstMove = sal_True;
+ bKeyInput = sal_False;
EnableSaveBackground();
- ImplInitMenuWindow( this, TRUE, FALSE );
+ ImplInitMenuWindow( this, sal_True, sal_False );
SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
@@ -3950,7 +4011,7 @@ void MenuFloatingWindow::doShutdown()
{
// #102461# remove highlight in parent
MenuItemData* pData;
- USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
+ sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -3961,7 +4022,7 @@ void MenuFloatingWindow::doShutdown()
{
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin )
- pPWin->HighlightItem( i, FALSE );
+ pPWin->HighlightItem( i, sal_False );
}
}
@@ -3997,13 +4058,13 @@ long MenuFloatingWindow::ImplGetStartY() const
long nY = 0;
if( pMenu )
{
- for ( USHORT n = 0; n < nFirstEntry; n++ )
+ for ( sal_uInt16 n = 0; n < nFirstEntry; n++ )
nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height();
}
return -nY;
}
-Region MenuFloatingWindow::ImplCalcClipRegion( BOOL bIncludeLogo ) const
+Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const
{
Size aOutSz = GetOutputSizePixel();
Point aPos;
@@ -4033,7 +4094,7 @@ void MenuFloatingWindow::ImplInitClipRegion()
}
}
-void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown )
+void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown )
{
if( ! pMenu )
return;
@@ -4043,10 +4104,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
Size aOutSz = GetOutputSizePixel();
if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) )
{
- BOOL bHighlighted = FALSE;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
+ sal_Bool bHighlighted = sal_False;
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
nY += ImplGetStartY(); // ggf. gescrollt.
- for ( USHORT n = 0; !bHighlighted && ( n < nCount ); n++ )
+ for ( sal_uInt16 n = 0; !bHighlighted && ( n < nCount ); n++ )
{
if ( pMenu->ImplIsVisible( n ) )
{
@@ -4055,7 +4116,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
nY += pItemData->aSz.Height();
if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) )
{
- BOOL bPopupArea = TRUE;
+ sal_Bool bPopupArea = sal_True;
if ( pItemData->nBits & MIB_POPUPSELECT )
{
// Nur wenn ueber dem Pfeil geklickt wurde...
@@ -4068,10 +4129,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (USHORT)n, FALSE );
+ ChangeHighlightItem( (sal_uInt16)n, sal_False );
}
- BOOL bAllowNewPopup = TRUE;
+ sal_Bool bAllowNewPopup = sal_True;
if ( pActivePopup )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
@@ -4089,7 +4150,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
{
if ( n != nHighlightedItem )
{
- ChangeHighlightItem( (USHORT)n, TRUE );
+ ChangeHighlightItem( (sal_uInt16)n, sal_True );
}
else if ( pItemData->nBits & MIB_POPUPSELECT )
{
@@ -4097,17 +4158,17 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow
HighlightChanged( NULL );
}
}
- bHighlighted = TRUE;
+ bHighlighted = sal_True;
}
}
}
if ( !bHighlighted )
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
}
else
{
ImplScroll( rMEvt.GetPosPixel() );
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
}
}
@@ -4121,12 +4182,12 @@ IMPL_LINK( MenuFloatingWindow, PopupEnd, FloatingWindow*, EMPTYARG )
{
//DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" );
KillActivePopup(); // should be ok to just remove it
- //pActivePopup->bCanceled = TRUE;
+ //pActivePopup->bCanceled = sal_True;
}
- bInExecute = FALSE;
- pMenu->bInCallback = TRUE;
+ bInExecute = sal_False;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
- pMenu->bInCallback = FALSE;
+ pMenu->bInCallback = sal_False;
}
else
{
@@ -4176,7 +4237,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
{
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
- ULONG nOldFlags = GetPopupModeFlags();
+ sal_uLong nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
KillActivePopup();
SetPopupModeFlags( nOldFlags );
@@ -4186,7 +4247,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nY = nScrollerHeight+ImplGetStartY();
MenuItemData* pData = 0;
- for ( ULONG n = 0; n < nHighlightedItem; n++ )
+ for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->pItemList->GetDataFromPos( n );
nY += pData->aSz.Height();
@@ -4217,9 +4278,9 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
// die lange im Activate Rescheduled haben und jetzt schon nicht mehr
// angezeigt werden sollen.
Menu* pTest = pActivePopup;
- ULONG nOldFlags = GetPopupModeFlags();
+ sal_uLong nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
- USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE );
+ sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? sal_False : sal_True );
SetPopupModeFlags( nOldFlags );
// nRet != 0, wenn es waerend Activate() abgeschossen wurde...
@@ -4254,11 +4315,11 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent )
return 0;
}
-void MenuFloatingWindow::EnableScrollMenu( BOOL b )
+void MenuFloatingWindow::EnableScrollMenu( sal_Bool b )
{
bScrollMenu = b;
- nScrollerHeight = b ? (USHORT) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
- bScrollDown = TRUE;
+ nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
+ bScrollDown = sal_True;
ImplInitClipRegion();
}
@@ -4268,8 +4329,8 @@ void MenuFloatingWindow::Execute()
pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu;
- bInExecute = TRUE;
-// bCallingSelect = FALSE;
+ bInExecute = sal_True;
+// bCallingSelect = sal_False;
while ( bInExecute )
Application::Yield();
@@ -4280,24 +4341,24 @@ void MenuFloatingWindow::Execute()
// Application::Yield();
}
-void MenuFloatingWindow::StopExecute( ULONG nFocusId )
+void MenuFloatingWindow::StopExecute( sal_uLong nFocusId )
{
// Focus wieder herstellen
// (kann schon im Select wieder hergestellt wurden sein)
if ( nSaveFocusId )
{
- Window::EndSaveFocus( nFocusId, FALSE );
+ Window::EndSaveFocus( nFocusId, sal_False );
nFocusId = nSaveFocusId;
if ( nFocusId )
{
nSaveFocusId = 0;
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
}
}
ImplEndPopupMode( 0, nFocusId );
aHighlightChangedTimer.Stop();
- bInExecute = FALSE;
+ bInExecute = sal_False;
if ( pActivePopup )
{
KillActivePopup();
@@ -4315,15 +4376,15 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() )
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = TRUE;
+ pActivePopup->bCanceled = sal_True;
// Vor allen Aktionen schon pActivePopup = 0, falls z.B.
// PopupModeEndHdl des zu zerstoerenden Popups mal synchron gerufen wird.
PopupMenu* pPopup = pActivePopup;
pActivePopup = NULL;
- pPopup->bInCallback = TRUE;
+ pPopup->bInCallback = sal_True;
pPopup->Deactivate();
- pPopup->bInCallback = FALSE;
+ pPopup->bInCallback = sal_False;
if ( pPopup->ImplGetWindow() )
{
pPopup->ImplGetFloatingWindow()->StopExecute();
@@ -4339,14 +4400,14 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
void MenuFloatingWindow::EndExecute()
{
Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL;
- ULONG nFocusId = 0;
+ sal_uLong nFocusId = 0;
if ( pStart && pStart->bIsMenuBar )
{
nFocusId = ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->GetFocusId();
if ( nFocusId )
{
((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->SetFocusId( 0 );
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
}
}
@@ -4363,7 +4424,7 @@ void MenuFloatingWindow::EndExecute()
// Dies Fenster wird gleich zerstoert => Daten lokal merken...
Menu* pM = pMenu;
- USHORT nItem = nHighlightedItem;
+ sal_uInt16 nItem = nHighlightedItem;
pCleanUpFrom->StopExecute( nFocusId );
@@ -4381,9 +4442,9 @@ void MenuFloatingWindow::EndExecute()
}
}
-void MenuFloatingWindow::EndExecute( USHORT nId )
+void MenuFloatingWindow::EndExecute( sal_uInt16 nId )
{
- USHORT nPos;
+ sal_uInt16 nPos;
if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) )
nHighlightedItem = nPos;
else
@@ -4400,7 +4461,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt )
//if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup )
// pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS );
- ImplHighlightItem( rMEvt, TRUE );
+ ImplHighlightItem( rMEvt, sal_True );
nMBDownPos = nHighlightedItem;
}
@@ -4410,7 +4471,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt )
MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL;
// nMBDownPos in lokaler Variable merken und gleich zuruecksetzen,
// weil nach EndExecute zu spaet
- USHORT _nMBDownPos = nMBDownPos;
+ sal_uInt16 _nMBDownPos = nMBDownPos;
nMBDownPos = ITEMPOS_INVALID;
if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) )
{
@@ -4448,7 +4509,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start();
if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) )
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
#ifdef OS2
}
#endif
@@ -4463,13 +4524,13 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt )
{
aSubmenuCloseTimer.Stop();
if( bIgnoreFirstMove )
- bIgnoreFirstMove = FALSE;
+ bIgnoreFirstMove = sal_False;
else
- ImplHighlightItem( rMEvt, FALSE );
+ ImplHighlightItem( rMEvt, sal_False );
}
}
-void MenuFloatingWindow::ImplScroll( BOOL bUp )
+void MenuFloatingWindow::ImplScroll( sal_Bool bUp )
{
KillActivePopup();
Update();
@@ -4477,7 +4538,7 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if( ! pMenu )
return;
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplKillLayoutData();
@@ -4492,17 +4553,17 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if ( !bScrollDown )
{
- bScrollDown = TRUE;
- ImplDrawScroller( FALSE );
+ bScrollDown = sal_True;
+ ImplDrawScroller( sal_False );
}
if ( pMenu->ImplGetPrevVisible( nFirstEntry ) == ITEMPOS_INVALID )
{
- bScrollUp = FALSE;
- ImplDrawScroller( TRUE );
+ bScrollUp = sal_False;
+ ImplDrawScroller( sal_True );
}
- Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
}
else if ( bScrollDown && !bUp )
{
@@ -4514,24 +4575,24 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if ( !bScrollUp )
{
- bScrollUp = TRUE;
- ImplDrawScroller( TRUE );
+ bScrollUp = sal_True;
+ ImplDrawScroller( sal_True );
}
long nHeight = GetOutputSizePixel().Height();
- USHORT nLastVisible;
+ sal_uInt16 nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible );
if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID )
{
- bScrollDown = FALSE;
- ImplDrawScroller( FALSE );
+ bScrollDown = sal_False;
+ ImplDrawScroller( sal_False );
}
// nStartY -= nEntryHeight;
- Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP );
+ Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP );
}
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
}
void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
@@ -4544,12 +4605,12 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
if ( bScrollUp && ( nMouseY < nY ) )
{
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
nDelta = nY - nMouseY;
}
else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
nDelta = nMouseY - ( aOutSz.Height() - nY );
}
@@ -4571,7 +4632,7 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos )
aScrollTimer.Start();
}
}
-void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
+void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer )
{
// #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert.
// #65750# Dann verzichten wir lieber auf den schmalen Streifen Hintergrundsicherung.
@@ -4586,11 +4647,11 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (USHORT)n;
+ nHighlightedItem = (sal_uInt16)n;
DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" );
if( nHighlightedItem != ITEMPOS_INVALID )
{
@@ -4598,7 +4659,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
{
// #102461# make sure parent entry is highlighted as well
MenuItemData* pData;
- USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count();
+ sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count();
for(i = 0; i < nCount; i++)
{
pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
@@ -4610,12 +4671,12 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin && pPWin->nHighlightedItem != i )
{
- pPWin->HighlightItem( i, TRUE );
+ pPWin->HighlightItem( i, sal_True );
pPWin->nHighlightedItem = i;
}
}
}
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
pMenu->ImplCallHighlight( nHighlightedItem );
}
else
@@ -4634,7 +4695,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer )
}
}
-void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
+void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
{
if( ! pMenu )
return;
@@ -4650,8 +4711,8 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder;
nY += nOuterSpace;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4659,7 +4720,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" );
if ( pData->eType != MENUITEM_SEPARATOR )
{
- BOOL bRestoreLineColor = FALSE;
+ sal_Bool bRestoreLineColor = sal_False;
Color oldLineColor;
bool bDrawItemRect = true;
@@ -4676,19 +4737,20 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
+ MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
aCtrlRect,
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
if( bHighlight &&
IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
{
bDrawItemRect = false;
- if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
+ if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
- ImplControlValue(),
+ aVal,
OUString() ) )
{
bDrawItemRect = bHighlight;
@@ -4709,7 +4771,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
SetFillColor();
oldLineColor = GetLineColor();
SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- bRestoreLineColor = TRUE;
+ bRestoreLineColor = sal_True;
}
}
else
@@ -4728,7 +4790,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
}
}
-Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
+Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
{
if( ! pMenu )
return Rectangle();
@@ -4742,8 +4804,8 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
if ( pMenu->pLogo )
nX = pMenu->pLogo->aBitmap.GetSizePixel().Width();
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -4766,14 +4828,14 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
}
-void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
+void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd )
{
if( ! pMenu )
return;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- USHORT n = nHighlightedItem;
+ sal_uInt16 n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( bUp )
@@ -4782,7 +4844,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
n = pMenu->GetItemCount()-1;
}
- USHORT nLoop = n;
+ sal_uInt16 nLoop = n;
if( bHomeEnd )
{
@@ -4794,7 +4856,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
}
else
{
- n = (USHORT)-1;
+ n = (sal_uInt16)-1;
nLoop = n+1;
}
}
@@ -4830,21 +4892,21 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
// Selektion noch im sichtbaren Bereich?
if ( IsScrollMenu() )
{
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
while ( n < nFirstEntry )
- ImplScroll( TRUE );
+ ImplScroll( sal_True );
Size aOutSz = GetOutputSizePixel();
- USHORT nLastVisible;
+ sal_uInt16 nLastVisible;
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
while ( n > nLastVisible )
{
- ImplScroll( FALSE );
+ ImplScroll( sal_False );
((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible );
}
}
- ChangeHighlightItem( n, FALSE );
+ ChangeHighlightItem( n, sal_False );
break;
}
} while ( n != nLoop );
@@ -4855,8 +4917,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
ImplDelData aDelData;
ImplAddDel( &aDelData );
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
- bKeyInput = TRUE;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
+ bKeyInput = sal_True;
switch ( nCode )
{
case KEY_UP:
@@ -4868,7 +4930,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
case KEY_END:
case KEY_HOME:
{
- ImplCursorUpDown( nCode == KEY_END, TRUE );
+ ImplCursorUpDown( nCode == KEY_END, sal_True );
}
break;
case KEY_F6:
@@ -4924,14 +4986,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
{
if( pMenu )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( nHighlightedItem != ITEMPOS_INVALID )
{
MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem );
if ( pData && pData->pSubMenu )
{
HighlightChanged( 0 );
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -4979,14 +5041,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
default:
{
xub_Unicode nCharCode = rKEvent.GetCharCode();
- USHORT nPos = 0;
- USHORT nDuplicates = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nDuplicates = 0;
MenuItemData* pData = (nCharCode && pMenu) ? pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem ) : NULL;
if ( pData )
{
if ( pData->pSubMenu || nDuplicates > 1 )
{
- ChangeHighlightItem( nPos, FALSE );
+ ChangeHighlightItem( nPos, sal_False );
HighlightChanged( 0 );
}
else
@@ -5008,7 +5070,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
if ( !aDelData.IsDelete() )
{
ImplRemoveDel( &aDelData );
- bKeyInput = FALSE;
+ bKeyInput = sal_False;
}
}
@@ -5023,25 +5085,26 @@ void MenuFloatingWindow::Paint( const Rectangle& )
long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0;
Size aPxSize( GetOutputSizePixel() );
aPxSize.Width() -= nX;
+ ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
Rectangle( Point( nX, 0 ), aPxSize ),
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
ImplInitClipRegion();
}
if ( IsScrollMenu() )
{
- ImplDrawScroller( TRUE );
- ImplDrawScroller( FALSE );
+ ImplDrawScroller( sal_True );
+ ImplDrawScroller( sal_False );
}
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
}
-void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
+void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp )
{
if( ! pMenu )
return;
@@ -5056,7 +5119,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
DecorationView aDecoView( this );
SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) )
nStyle |= SYMBOL_DRAW_DISABLE;
@@ -5067,7 +5130,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp )
void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nId = nHighlightedItem;
+ sal_uInt16 nId = nHighlightedItem;
Menu* pM = pMenu;
Window* pW = this;
@@ -5091,7 +5154,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, FALSE, FALSE );
+ ImplInitMenuWindow( this, sal_False, sal_False );
Invalidate();
}
}
@@ -5105,7 +5168,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- ImplInitMenuWindow( this, FALSE, FALSE );
+ ImplInitMenuWindow( this, sal_False, sal_False );
Invalidate();
}
}
@@ -5145,10 +5208,10 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
pActivePopup = NULL;
nSaveFocusId = 0;
nHighlightedItem = ITEMPOS_INVALID;
- mbAutoPopup = TRUE;
+ mbAutoPopup = sal_True;
nSaveFocusId = 0;
- bIgnoreFirstMove = TRUE;
- bStayActive = FALSE;
+ bIgnoreFirstMove = sal_True;
+ bStayActive = sal_False;
ResMgr* pResMgr = ImplGetResMgr();
@@ -5159,7 +5222,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT );
aCloser.SetBackground();
- aCloser.SetPaintTransparent( TRUE );
+ aCloser.SetPaintTransparent( sal_True );
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 );
@@ -5192,7 +5255,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
pMenu = pMen;
KillActivePopup();
nHighlightedItem = ITEMPOS_INVALID;
- ImplInitMenuWindow( this, TRUE, TRUE );
+ ImplInitMenuWindow( this, sal_True, sal_True );
if ( pMen )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() );
@@ -5212,7 +5275,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
}
}
-void MenuBarWindow::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
+void MenuBarWindow::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide )
{
aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose );
aCloser.Show( bClose || ! m_aAddButtons.empty() );
@@ -5240,7 +5303,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG )
}
else
{
- std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
+ std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -5266,10 +5329,10 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent )
aArg.nId = aCloser.GetHighlightItemId();
else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF )
{
- USHORT nPos = static_cast< USHORT >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
+ sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData()));
aArg.nId = aCloser.GetItemId( nPos );
}
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId );
if( it != m_aAddButtons.end() )
{
it->second.m_aHighlightLink.Call( &aArg );
@@ -5299,12 +5362,12 @@ IMPL_LINK( MenuBarWindow, HideHdl, PushButton*, EMPTYARG )
return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0;
}
-void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
+void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst )
{
MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL;
if ( pItemData )
{
- bIgnoreFirstMove = TRUE;
+ bIgnoreFirstMove = sal_True;
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
KillActivePopup();
@@ -5314,7 +5377,7 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
pActivePopup = (PopupMenu*)pItemData->pSubMenu;
long nX = 0;
MenuItemData* pData = 0;
- for ( ULONG n = 0; n < nHighlightedItem; n++ )
+ for ( sal_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->GetItemList()->GetDataFromPos( n );
nX += pData->aSz.Width();
@@ -5361,11 +5424,11 @@ void MenuBarWindow::KillActivePopup()
return; // kill it later
if ( pActivePopup->bInCallback )
- pActivePopup->bCanceled = TRUE;
+ pActivePopup->bCanceled = sal_True;
- pActivePopup->bInCallback = TRUE;
+ pActivePopup->bInCallback = sal_True;
pActivePopup->Deactivate();
- pActivePopup->bInCallback = FALSE;
+ pActivePopup->bInCallback = sal_False;
// Abfrage auf pActivePopup, falls im Deactivate abgeschossen...
if ( pActivePopup && pActivePopup->ImplGetWindow() )
{
@@ -5383,22 +5446,22 @@ void MenuBarWindow::PopupClosed( Menu* pPopup )
if ( pPopup == pActivePopup )
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, sal_False );
}
}
void MenuBarWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbAutoPopup = TRUE;
- USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ mbAutoPopup = sal_True;
+ sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
if ( ( nEntry != ITEMPOS_INVALID ) && ( nEntry != nHighlightedItem ) )
{
- ChangeHighlightItem( nEntry, FALSE );
+ ChangeHighlightItem( nEntry, sal_False );
}
else
{
KillActivePopup();
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
}
}
@@ -5414,20 +5477,20 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt )
if( bIgnoreFirstMove )
{
- bIgnoreFirstMove = FALSE;
+ bIgnoreFirstMove = sal_False;
return;
}
- USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
+ sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() );
if ( ( nEntry != ITEMPOS_INVALID )
#ifdef OS2
&& ( ImplHilite(rMEvt) )
#endif
&& ( nEntry != nHighlightedItem ) )
- ChangeHighlightItem( nEntry, FALSE );
+ ChangeHighlightItem( nEntry, sal_False );
}
-void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllowRestoreFocus, BOOL bDefaultToDocument)
+void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sal_Bool bAllowRestoreFocus, sal_Bool bDefaultToDocument)
{
if( ! pMenu )
return;
@@ -5438,21 +5501,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
KillActivePopup(); // pActivePopup ggf. ohne pWin, wenn in Activate() Rescheduled wurde
// Activate am MenuBar immer nur einmal pro Vorgang...
- BOOL bJustActivated = FALSE;
+ sal_Bool bJustActivated = sal_False;
if ( ( nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) )
{
- ImplGetSVData()->maWinData.mbNoDeactivate = TRUE;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_True;
if( !bStayActive )
{
// #105406# avoid saving the focus when we already have the focus
- BOOL bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
+ sal_Bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin );
if( nSaveFocusId )
{
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
// we didn't clean up last time
- Window::EndSaveFocus( nSaveFocusId, FALSE ); // clean up
+ Window::EndSaveFocus( nSaveFocusId, sal_False ); // clean up
nSaveFocusId = 0;
if( !bNoSaveFocus )
nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated
@@ -5468,21 +5531,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
}
}
else
- bStayActive = FALSE;
- pMenu->bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen
+ bStayActive = sal_False;
+ pMenu->bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen
pMenu->Activate();
- pMenu->bInCallback = FALSE;
- bJustActivated = TRUE;
+ pMenu->bInCallback = sal_False;
+ bJustActivated = sal_True;
}
else if ( ( nHighlightedItem != ITEMPOS_INVALID ) && ( n == ITEMPOS_INVALID ) )
{
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
- pMenu->bInCallback = FALSE;
- ImplGetSVData()->maWinData.mbNoDeactivate = FALSE;
+ pMenu->bInCallback = sal_False;
+ ImplGetSVData()->maWinData.mbNoDeactivate = sal_False;
if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
{
- ULONG nTempFocusId = nSaveFocusId;
+ sal_uLong nTempFocusId = nSaveFocusId;
nSaveFocusId = 0;
Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus );
// #105406# restore focus to document if we could not save focus before
@@ -5493,13 +5556,13 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
if ( nHighlightedItem != ITEMPOS_INVALID )
{
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem );
}
- nHighlightedItem = (USHORT)n;
+ nHighlightedItem = (sal_uInt16)n;
DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" );
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
pMenu->ImplCallHighlight( nHighlightedItem );
if( mbAutoPopup )
@@ -5510,14 +5573,14 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo
GrabFocus();
}
-void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
+void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
{
if( ! pMenu )
return;
long nX = 0;
- ULONG nCount = pMenu->pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5588,14 +5651,14 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
}
}
-Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos )
+Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos )
{
Rectangle aRect;
if( pMenu )
{
long nX = 0;
- ULONG nCount = pMenu->pItemList->Count();
- for ( ULONG n = 0; n < nCount; n++ )
+ sal_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5618,16 +5681,16 @@ void MenuBarWindow::KeyInput( const KeyEvent& rKEvent )
Window::KeyInput( rKEvent );
}
-BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
+sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu )
{
if( ! pMenu )
- return FALSE;
+ return sal_False;
if ( pMenu->bInCallback )
- return TRUE; // schlucken
+ return sal_True; // schlucken
- BOOL bDone = FALSE;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
if( GetParent() )
{
@@ -5636,7 +5699,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT );
if( pSysWin->GetTaskPaneList() )
if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) )
- return TRUE;
+ return sal_True;
}
}
@@ -5645,22 +5708,22 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
mbAutoPopup = ImplGetSVData()->maNWFData.mbOpenMenuOnF10;
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- ChangeHighlightItem( 0, FALSE );
+ ChangeHighlightItem( 0, sal_False );
GrabFocus();
}
else
{
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
nSaveFocusId = 0;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( bFromMenu )
{
if ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) ||
( nCode == KEY_HOME ) || ( nCode == KEY_END ) )
{
- USHORT n = nHighlightedItem;
+ sal_uInt16 n = nHighlightedItem;
if ( n == ITEMPOS_INVALID )
{
if ( nCode == KEY_LEFT)
@@ -5680,10 +5743,10 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID);
}
- USHORT nLoop = n;
+ sal_uInt16 nLoop = n;
if( nCode == KEY_HOME )
- { n = (USHORT)-1; nLoop = n+1; }
+ { n = (sal_uInt16)-1; nLoop = n+1; }
if( nCode == KEY_END )
{ n = pMenu->GetItemCount(); nLoop = n-1; }
@@ -5706,14 +5769,14 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n );
if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) )
{
- BOOL bDoSelect = TRUE;
+ sal_Bool bDoSelect = sal_True;
if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 )
bDoSelect = bWasHighlight;
ChangeHighlightItem( n, bDoSelect );
break;
}
} while ( n != nLoop );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( nCode == KEY_RETURN )
{
@@ -5721,36 +5784,36 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
else
if ( !mbAutoPopup )
{
- ImplCreatePopup( TRUE );
- mbAutoPopup = TRUE;
+ ImplCreatePopup( sal_True );
+ mbAutoPopup = sal_True;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( ( nCode == KEY_UP ) || ( nCode == KEY_DOWN ) )
{
if ( !mbAutoPopup )
{
- ImplCreatePopup( TRUE );
- mbAutoPopup = TRUE;
+ ImplCreatePopup( sal_True );
+ mbAutoPopup = sal_True;
}
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( nCode == KEY_ESCAPE || ( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) )
{
if( pActivePopup )
{
// bring focus to menu bar without any open popup
- mbAutoPopup = FALSE;
- USHORT n = nHighlightedItem;
+ mbAutoPopup = sal_False;
+ sal_uInt16 n = nHighlightedItem;
nHighlightedItem = ITEMPOS_INVALID;
- bStayActive = TRUE;
- ChangeHighlightItem( n, FALSE );
- bStayActive = FALSE;
+ bStayActive = sal_True;
+ ChangeHighlightItem( n, sal_False );
+ bStayActive = sal_False;
KillActivePopup();
GrabFocus();
}
else
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False );
if( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() )
{
@@ -5758,7 +5821,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
GrabFocusToDocument();
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
@@ -5767,19 +5830,19 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
xub_Unicode nCharCode = rKEvent.GetCharCode();
if ( nCharCode )
{
- USHORT nEntry, nDuplicates;
+ sal_uInt16 nEntry, nDuplicates;
MenuItemData* pData = pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nEntry, nDuplicates, nHighlightedItem );
if ( pData && (nEntry != ITEMPOS_INVALID) )
{
- mbAutoPopup = TRUE;
- ChangeHighlightItem( nEntry, TRUE );
- bDone = TRUE;
+ mbAutoPopup = sal_True;
+ ChangeHighlightItem( nEntry, sal_True );
+ bDone = sal_True;
}
else
{
// Wegen Systemmenu und anderen System-HotKeys, nur
// eigenstaendige Character-Kombinationen auswerten
- USHORT nKeyCode = rKEvent.GetKeyCode().GetCode();
+ sal_uInt16 nKeyCode = rKEvent.GetKeyCode().GetCode();
if ( ((nKeyCode >= KEY_A) && (nKeyCode <= KEY_Z)) )
Sound::Beep();
}
@@ -5814,7 +5877,7 @@ void MenuBarWindow::Paint( const Rectangle& )
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
pMenu->ImplPaint( this, 0 );
if ( nHighlightedItem != ITEMPOS_INVALID )
- HighlightItem( nHighlightedItem, TRUE );
+ HighlightItem( nHighlightedItem, sal_True );
// in high contrast mode draw a separating line on the lower edge
if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) &&
@@ -5866,20 +5929,20 @@ void MenuBarWindow::Resize()
Invalidate();
}
-USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
+sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
{
if( pMenu )
{
long nX = 0;
- USHORT nCount = (USHORT)pMenu->pItemList->Count();
- for ( USHORT n = 0; n < nCount; n++ )
+ sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count();
+ for ( sal_uInt16 n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( pMenu->ImplIsVisible( n ) )
{
nX += pData->aSz.Width();
if ( nX > rMousePos.X() )
- return (USHORT)n;
+ return (sal_uInt16)n;
}
}
}
@@ -5888,9 +5951,9 @@ USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const
void MenuBarWindow::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nId = nHighlightedItem;
+ sal_uInt16 nId = nHighlightedItem;
if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) )
- ChangeHighlightItem( ITEMPOS_INVALID, TRUE );
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_True );
Rectangle aHighlightRect( ImplGetItemRect( nHighlightedItem ) );
if( !ImplHandleHelpEvent( this, pMenu, nId, rHEvt, aHighlightRect ) )
@@ -5904,7 +5967,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) ||
( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
{
- ImplInitMenuWindow( this, FALSE, TRUE );
+ ImplInitMenuWindow( this, sal_False, sal_True );
Invalidate();
}
else if( pMenu )
@@ -5916,7 +5979,7 @@ void MenuBarWindow::ImplLayoutChanged()
{
if( pMenu )
{
- ImplInitMenuWindow( this, TRUE, TRUE );
+ ImplInitMenuWindow( this, sal_True, sal_True );
// Falls sich der Font geaendert hat.
long nHeight = pMenu->ImplCalcSize( this ).Height();
@@ -5968,16 +6031,16 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
void MenuBarWindow::LoseFocus()
{
- if ( !HasChildPathFocus( TRUE ) )
- ChangeHighlightItem( ITEMPOS_INVALID, FALSE, FALSE );
+ if ( !HasChildPathFocus( sal_True ) )
+ ChangeHighlightItem( ITEMPOS_INVALID, sal_False, sal_False );
}
void MenuBarWindow::GetFocus()
{
if ( nHighlightedItem == ITEMPOS_INVALID )
{
- mbAutoPopup = FALSE; // do not open menu when activated by focus handling like taskpane cycling
- ChangeHighlightItem( 0, FALSE );
+ mbAutoPopup = sal_False; // do not open menu when activated by focus handling like taskpane cycling
+ ChangeHighlightItem( 0, sal_False );
}
}
@@ -5991,13 +6054,13 @@ void MenuBarWindow::GetFocus()
return xAcc;
}
-USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos )
+sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos )
{
// find first free button id
- USHORT nId = IID_DOCUMENTCLOSE;
- std::map< USHORT, AddButtonEntry >::const_iterator it;
+ sal_uInt16 nId = IID_DOCUMENTCLOSE;
+ std::map< sal_uInt16, AddButtonEntry >::const_iterator it;
if( i_nPos > m_aAddButtons.size() )
- i_nPos = static_cast<USHORT>(m_aAddButtons.size());
+ i_nPos = static_cast<sal_uInt16>(m_aAddButtons.size());
do
{
nId++;
@@ -6020,14 +6083,14 @@ USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLi
return nId;
}
-void MenuBarWindow::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink )
+void MenuBarWindow::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink )
{
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( nId );
if( it != m_aAddButtons.end() )
it->second.m_aHighlightLink = rLink;
}
-Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId )
+Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId )
{
Rectangle aRect;
if( m_aAddButtons.find( nId ) != m_aAddButtons.end() )
@@ -6052,9 +6115,9 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId )
return aRect;
}
-void MenuBarWindow::RemoveMenuBarButton( USHORT nId )
+void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId )
{
- USHORT nPos = aCloser.GetItemPos( nId );
+ sal_uInt16 nPos = aCloser.GetItemPos( nId );
aCloser.RemoveItem( nPos );
m_aAddButtons.erase( nId );
aCloser.calcMinSize();
@@ -6064,9 +6127,9 @@ void MenuBarWindow::RemoveMenuBarButton( USHORT nId )
pMenu->mpSalMenu->RemoveMenuBarButton( nId );
}
-bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
+bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId )
{
- std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
+ std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId );
if( it != m_aAddButtons.end() )
{
MenuBar::MenuBarButtonCallbackArg aArg;
@@ -6075,7 +6138,7 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
return it->second.m_aSelectLink.Call( &aArg );
}
- return FALSE;
+ return sal_False;
}
ImplMenuDelData::ImplMenuDelData( const Menu* pMenu )
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 3b61abb81bee..ca8bcf3c2917 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -49,9 +49,9 @@ MnemonicGenerator::MnemonicGenerator()
// -----------------------------------------------------------------------
-USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
+sal_uInt16 MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
{
- static USHORT const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] =
+ static sal_uInt16 const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] =
{
MNEMONIC_RANGE_1_START, MNEMONIC_RANGE_1_END,
MNEMONIC_RANGE_2_START, MNEMONIC_RANGE_2_END,
@@ -59,8 +59,8 @@ USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c )
MNEMONIC_RANGE_4_START, MNEMONIC_RANGE_4_END
};
- USHORT nMnemonicIndex = 0;
- for ( USHORT i = 0; i < MNEMONIC_RANGES; i++ )
+ sal_uInt16 nMnemonicIndex = 0;
+ for ( sal_uInt16 i = 0; i < MNEMONIC_RANGES; i++ )
{
if ( (c >= aImplMnemonicRangeTab[i*2]) &&
(c <= aImplMnemonicRangeTab[i*2+1]) )
@@ -107,7 +107,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
sal_Unicode cMnemonic = ImplFindMnemonic( aKey );
if ( cMnemonic )
{
- USHORT nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic );
+ sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic );
if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
maMnemonics[nMnemonicIndex] = 0;
}
@@ -119,7 +119,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
{
sal_Unicode c = aKey.GetChar( nIndex );
- USHORT nMnemonicIndex = ImplGetMnemonicIndex( c );
+ sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( c );
if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
{
if ( maMnemonics[nMnemonicIndex] && (maMnemonics[nMnemonicIndex] < 0xFF) )
@@ -133,24 +133,24 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey )
// -----------------------------------------------------------------------
-BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
+sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
if ( !rKey.Len() || ImplFindMnemonic( rKey ) )
- return FALSE;
+ return sal_False;
const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale();
uno::Reference < i18n::XCharacterClassification > xCharClass = GetCharClass();
// Don't crash even when we don't have access to i18n service
if ( !xCharClass.is() )
- return FALSE;
+ return sal_False;
XubString aKey = xCharClass->toUpper( rKey, 0, rKey.Len(), rLocale );
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
xub_StrLen nLen = aKey.Len();
- BOOL bCJK = FALSE;
+ sal_Bool bCJK = sal_False;
switch( Application::GetSettings().GetUILanguage() )
{
case LANGUAGE_JAPANESE:
@@ -161,7 +161,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
case LANGUAGE_CHINESE_MACAU:
case LANGUAGE_KOREAN:
case LANGUAGE_KOREAN_JOHAB:
- bCJK = TRUE;
+ bCJK = sal_True;
break;
default:
break;
@@ -173,8 +173,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// #110720#, avoid CJK-style mnemonics for latin-only strings that do not contain useful mnemonic chars
if( bCJK )
{
- BOOL bLatinOnly = TRUE;
- BOOL bMnemonicIndexFound = FALSE;
+ sal_Bool bLatinOnly = sal_True;
+ sal_Bool bMnemonicIndexFound = sal_False;
sal_Unicode c;
xub_StrLen nIndex;
@@ -184,19 +184,19 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
if ( ((c >= 0x3000) && (c <= 0xD7FF)) || // cjk
((c >= 0xFF61) && (c <= 0xFFDC)) ) // halfwidth forms
{
- bLatinOnly = FALSE;
+ bLatinOnly = sal_False;
break;
}
if( ImplGetMnemonicIndex( c ) != MNEMONIC_INDEX_NOTFOUND )
- bMnemonicIndexFound = TRUE;
+ bMnemonicIndexFound = sal_True;
}
if( bLatinOnly && !bMnemonicIndexFound )
- return FALSE;
+ return sal_False;
}
int nCJK = 0;
- USHORT nMnemonicIndex;
+ sal_uInt16 nMnemonicIndex;
sal_Unicode c;
xub_StrLen nIndex = 0;
if( !bCJK )
@@ -226,7 +226,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
break;
}
}
@@ -247,8 +247,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// 2) search for a unique/uncommon character
if ( !bChanged )
{
- USHORT nBestCount = 0xFFFF;
- USHORT nBestMnemonicIndex = 0;
+ sal_uInt16 nBestCount = 0xFFFF;
+ sal_uInt16 nBestMnemonicIndex = 0;
xub_StrLen nBestIndex = 0;
nIndex = 0;
do
@@ -278,7 +278,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
{
maMnemonics[nBestMnemonicIndex] = 0;
rKey.Insert( MNEMONIC_CHAR, nBestIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
}
@@ -326,7 +326,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
nIndex--;
}
rKey.Insert( aStr, nIndex );
- bChanged = TRUE;
+ bChanged = sal_True;
break;
}
}
@@ -351,7 +351,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
// {
// maMnemonics[nMnemonicIndex] = 0;
// rKey.Insert( MNEMONIC_CHAR, nIndex );
-// bChanged = TRUE;
+// bChanged = sal_True;
// break;
// }
//
diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx
index f76c29e5ba9c..1ca9f2c22d57 100644
--- a/vcl/source/window/mnemonicengine.cxx
+++ b/vcl/source/window/mnemonicengine.cxx
@@ -103,7 +103,7 @@ namespace vcl
//--------------------------------------------------------------------
bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt )
{
- BOOL bAccelKey = _rKEvt.GetKeyCode().IsMod2();
+ sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2();
if ( !bAccelKey )
return false;
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index 4dbb7385f94f..2e76750e1cf5 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -39,7 +39,7 @@
MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
: maPos( rEvent.X, rEvent.Y )
, mnMode( 0 )
-, mnClicks( static_cast< USHORT >( rEvent.ClickCount ) )
+, mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) )
, mnCode( 0 )
{
if( rEvent.Modifiers )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 07eafcac357a..ae4c148d5807 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -70,10 +70,10 @@ void MessBox::ImplInitMessBoxData()
mpFixedText = NULL;
mpFixedImage = NULL;
mnSoundType = 0;
- mbHelpBtn = FALSE;
- mbSound = TRUE;
+ mbHelpBtn = sal_False;
+ mbSound = sal_True;
mpCheckBox = NULL;
- mbCheck = FALSE;
+ mbCheck = sal_False;
}
// -----------------------------------------------------------------------
@@ -81,11 +81,11 @@ void MessBox::ImplInitMessBoxData()
void MessBox::ImplInitButtons()
{
WinBits nStyle = GetStyle();
- USHORT nOKFlags = BUTTONDIALOG_OKBUTTON;
- USHORT nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
- USHORT nRetryFlags = 0;
- USHORT nYesFlags = 0;
- USHORT nNoFlags = 0;
+ sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON;
+ sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON;
+ sal_uInt16 nRetryFlags = 0;
+ sal_uInt16 nYesFlags = 0;
+ sal_uInt16 nNoFlags = 0;
if ( nStyle & WB_OK_CANCEL )
{
@@ -133,8 +133,8 @@ void MessBox::ImplInitButtons()
}
else if ( nStyle & WB_ABORT_RETRY_IGNORE )
{
- USHORT nAbortFlags = 0;
- USHORT nIgnoreFlags = 0;
+ sal_uInt16 nAbortFlags = 0;
+ sal_uInt16 nIgnoreFlags = 0;
if ( nStyle & WB_DEF_CANCEL )
nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON;
@@ -186,16 +186,15 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
ImplInitMessBoxData();
GetRes( rResId.SetRT( RSC_MESSBOX ) );
- USHORT nHiButtons = ReadShortRes();
- USHORT nLoButtons = ReadShortRes();
- USHORT nHiDefButton = ReadShortRes();
- USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
- /* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
- WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
- (((ULONG)nHiDefButton << 16) + nLoDefButton);
+ sal_uInt16 nHiButtons = ReadShortRes();
+ sal_uInt16 nLoButtons = ReadShortRes();
+ sal_uInt16 nHiDefButton = ReadShortRes();
+ sal_uInt16 nLoDefButton = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
+ /* sal_uInt16 bSysModal = */ ReadShortRes();
+ SetHelpId( aHelpId );
+ WinBits nBits = (((sal_uLong)nHiButtons << 16) + nLoButtons) |
+ (((sal_uLong)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
ImplLoadRes( rResId );
@@ -227,12 +226,12 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 );
- mbHelpBtn = TRUE;
+ mbHelpBtn = sal_True;
}
}
else
@@ -240,7 +239,7 @@ void MessBox::ImplPosControls()
if ( mbHelpBtn )
{
RemoveButton( BUTTONID_HELP );
- mbHelpBtn = FALSE;
+ mbHelpBtn = sal_False;
}
}
@@ -258,7 +257,7 @@ void MessBox::ImplPosControls()
long nMaxLineWidth;
long nWidth;
WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO;
- USHORT nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
+ sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
if ( mpFixedText )
delete mpFixedText;
@@ -277,7 +276,7 @@ void MessBox::ImplPosControls()
// Message-Text um Tabs bereinigen
XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
while ( nIndex != STRING_NOTFOUND )
nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex );
@@ -414,6 +413,8 @@ void MessBox::ImplPosControls()
}
mpFixedText = new FixedText( this, nWinStyle );
+ if( mpFixedText->GetStyle() & WB_EXTRAOFFSET ) // TODO: use CalcMinimumSize() instead
+ aFixedSize.Width() += 2;
mpFixedText->SetPosSizePixel( aTextPos, aFixedSize );
mpFixedText->SetText( aMessText );
mpFixedText->Show();
@@ -435,14 +436,14 @@ void MessBox::StateChanged( StateChangedType nType )
// -----------------------------------------------------------------------
-BOOL MessBox::GetCheckBoxState() const
+sal_Bool MessBox::GetCheckBoxState() const
{
return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck;
}
// -----------------------------------------------------------------------
-void MessBox::SetCheckBoxState( BOOL bCheck )
+void MessBox::SetCheckBoxState( sal_Bool bCheck )
{
if( mpCheckBox ) mpCheckBox->Check( bCheck );
mbCheck = bCheck;
@@ -459,10 +460,10 @@ void MessBox::SetDefaultCheckBoxText()
// -----------------------------------------------------------------------
-BOOL MessBox::SetModeImage( const Image& rImage )
+sal_Bool MessBox::SetModeImage( const Image& rImage )
{
SetImage( rImage );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -494,7 +495,7 @@ void InfoBox::ImplInitInfoBoxData()
SetText( Application::GetDisplayName() );
SetImage( InfoBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_INFO)+1;
+ mnSoundType = ((sal_uInt16)SOUND_INFO)+1;
}
// -----------------------------------------------------------------------
@@ -530,7 +531,7 @@ void WarningBox::ImplInitWarningBoxData()
SetText( Application::GetDisplayName() );
SetImage( WarningBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_WARNING)+1;
+ mnSoundType = ((sal_uInt16)SOUND_WARNING)+1;
}
// -----------------------------------------------------------------------
@@ -576,7 +577,7 @@ void ErrorBox::ImplInitErrorBoxData()
SetText( Application::GetDisplayName() );
SetImage( ErrorBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_ERROR)+1;
+ mnSoundType = ((sal_uInt16)SOUND_ERROR)+1;
}
// -----------------------------------------------------------------------
@@ -613,7 +614,7 @@ void QueryBox::ImplInitQueryBoxData()
SetText( Application::GetDisplayName() );
SetImage( QueryBox::GetStandardImage() );
- mnSoundType = ((USHORT)SOUND_QUERY)+1;
+ mnSoundType = ((sal_uInt16)SOUND_QUERY)+1;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 4932b689a9c2..40b80e234ff3 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -47,7 +47,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/ustrbuf.hxx"
+#include "rtl/strbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,19 +61,23 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
-#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) )
-#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) )
-
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
, maOrigSize( 10, 10 )
, maPageVDev( *this )
, maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) )
+ , mbGreyscale( false )
+ , maHorzDim( this, WB_HORZ | WB_CENTER )
+ , maVertDim( this, WB_VERT | WB_VCENTER )
{
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
maPageVDev.SetBackground( Color( COL_WHITE ) );
+ maHorzDim.Show();
+ maVertDim.Show();
+
+ maHorzDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
+ maVertDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
}
PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
@@ -93,9 +97,10 @@ void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDC
void PrintDialog::PrintPreviewWindow::Resize()
{
Size aNewSize( GetSizePixel() );
+ long nTextHeight = maHorzDim.GetTextHeight();
// leave small space for decoration
- aNewSize.Width() -= 2;
- aNewSize.Height() -= 2;
+ aNewSize.Width() -= nTextHeight + 2;
+ aNewSize.Height() -= nTextHeight + 2;
Size aScaledSize;
double fScale = 1.0;
@@ -136,17 +141,29 @@ void PrintDialog::PrintPreviewWindow::Resize()
fZoom /= 2.0;
}
- maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
+ maPageVDev.SetOutputSizePixel( aScaledSize, sal_False );
+
+ // position dimension lines
+ Point aRef( nTextHeight + (aNewSize.Width() - maPreviewSize.Width())/2,
+ nTextHeight + (aNewSize.Height() - maPreviewSize.Height())/2 );
+ maHorzDim.SetPosSizePixel( Point( aRef.X(), aRef.Y() - nTextHeight ),
+ Size( maPreviewSize.Width(), nTextHeight ) );
+ maVertDim.SetPosSizePixel( Point( aRef.X() - nTextHeight, aRef.Y() ),
+ Size( nTextHeight, maPreviewSize.Height() ) );
+
}
void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
+ long nTextHeight = maHorzDim.GetTextHeight();
Size aSize( GetSizePixel() );
+ aSize.Width() -= nTextHeight;
+ aSize.Height() -= nTextHeight;
if( maReplacementString.getLength() != 0 )
{
// replacement is active
Push();
- Rectangle aTextRect( Point( 0, 0 ), aSize );
+ Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize );
DecorationView aVw( this );
aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
aTextRect.Left() += 2;
@@ -164,8 +181,8 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
GDIMetaFile aMtf( maMtf );
- Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
- (aSize.Height() - maPreviewSize.Height()) / 2 );
+ Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight,
+ (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight );
Size aVDevSize( maPageVDev.GetOutputSizePixel() );
const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
@@ -180,6 +197,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
maPageVDev.Erase();
maPageVDev.Push();
maPageVDev.SetMapMode( MAP_100TH_MM );
+ sal_uLong nOldDrawMode = maPageVDev.GetDrawMode();
+ if( mbGreyscale )
+ maPageVDev.SetDrawMode( maPageVDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();
@@ -189,6 +211,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
SetMapMode( MAP_PIXEL );
maPageVDev.SetMapMode( MAP_PIXEL );
DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev );
+ maPageVDev.SetDrawMode( nOldDrawMode );
DecorationView aVw( this );
Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) );
@@ -218,27 +241,50 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview,
const Size& i_rOrigSize,
+ const rtl::OUString& i_rPaperName,
const rtl::OUString& i_rReplacement,
sal_Int32 i_nDPIX,
- sal_Int32 i_nDPIY
+ sal_Int32 i_nDPIY,
+ bool i_bGreyscale
)
{
rtl::OUStringBuffer aBuf( 256 );
aBuf.append( maToolTipString );
- #if OSL_DEBUG_LEVEL > 0
- aBuf.appendAscii( "\n---\nPageSize: " );
- aBuf.append( sal_Int32( i_rOrigSize.Width()/100) );
- aBuf.appendAscii( "mm x " );
- aBuf.append( sal_Int32( i_rOrigSize.Height()/100) );
- aBuf.appendAscii( "mm" );
- #endif
SetQuickHelpText( aBuf.makeStringAndClear() );
maMtf = i_rNewPreview;
maOrigSize = i_rOrigSize;
maReplacementString = i_rReplacement;
+ mbGreyscale = i_bGreyscale;
maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
- maPageVDev.EnableOutput( TRUE );
+ maPageVDev.EnableOutput( sal_True );
+
+ // use correct measurements
+ const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() );
+ MapUnit eUnit = MAP_MM;
+ int nDigits = 0;
+ if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
+ {
+ eUnit = MAP_100TH_INCH;
+ nDigits = 2;
+ }
+ Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) );
+ String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ if( i_rPaperName.getLength() )
+ {
+ aBuf.appendAscii( " (" );
+ aBuf.append( i_rPaperName );
+ aBuf.append( sal_Unicode(')') );
+ }
+ maHorzDim.SetText( aBuf.makeStringAndClear() );
+
+ aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
+ aBuf.append( aNumText );
+ aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ maVertDim.SetText( aBuf.makeStringAndClear() );
+
Resize();
Invalidate();
}
@@ -291,12 +337,18 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect )
int nX = 0, nY = 0;
switch( mnOrderMode )
{
- case SV_PRINT_PRT_NUP_ORDER_LRTD:
+ case SV_PRINT_PRT_NUP_ORDER_LRTB:
nX = (i % mnColumns); nY = (i / mnColumns);
break;
- case SV_PRINT_PRT_NUP_ORDER_TDLR:
+ case SV_PRINT_PRT_NUP_ORDER_TBLR:
nX = (i / mnRows); nY = (i % mnRows);
break;
+ case SV_PRINT_PRT_NUP_ORDER_RLTB:
+ nX = mnColumns - 1 - (i % mnColumns); nY = (i / mnColumns);
+ break;
+ case SV_PRINT_PRT_NUP_ORDER_TBRL:
+ nX = mnColumns - 1 - (i / mnRows); nY = (i % mnRows);
+ break;
}
Size aTextSize( GetTextWidth( aPageText ), nTextHeight );
int nDeltaX = (aSubSize.Width() - aTextSize.Width()) / 2;
@@ -336,13 +388,13 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
FreeResource();
maNupOrderWin.Show();
- maPagesBtn.Check( TRUE );
- maBrochureBtn.Show( FALSE );
+ maPagesBtn.Check( sal_True );
+ maBrochureBtn.Show( sal_False );
// setup field units for metric fields
const LocaleDataWrapper& rLocWrap( maPageMarginEdt.GetLocaleDataWrapper() );
FieldUnit eUnit = FUNIT_MM;
- USHORT nDigits = 0;
+ sal_uInt16 nDigits = 0;
if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
{
eUnit = FUNIT_INCH;
@@ -356,28 +408,6 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId )
maPageMarginEdt.SetDecimalDigits( nDigits );
maSheetMarginEdt.SetDecimalDigits( nDigits );
- SMHID1( "NUpPage" );
- maNupLine.SMHID2("NUpPage", "Layout");
- maBrochureBtn.SMHID2("NUpPage", "Brochure" );
- maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" );
- maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" );
- maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" );
- maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" );
- maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" );
- maNupTimesTxt.SMHID2( "NUpPage", "Rows" );
- maNupRowsEdt.SMHID2( "NUpPage", "RowsBox" );
- maPageMarginTxt1.SMHID2( "NUpPage", "PageMargin" );
- maPageMarginEdt.SMHID2( "NUpPage", "PageMarginBox" );
- maPageMarginTxt2.SMHID2( "NUpPage", "PageMarginCont" );
- maSheetMarginTxt1.SMHID2( "NUpPage", "SheetMargin" );
- maSheetMarginEdt.SMHID2( "NUpPage", "SheetMarginBox" );
- maSheetMarginTxt2.SMHID2( "NUpPage", "SheetMarginCont" );
- maNupOrientationTxt.SMHID2( "NUpPage", "Orientation" );
- maNupOrientationBox.SMHID2( "NUpPage", "OrientationBox" );
- maNupOrderTxt.SMHID2( "NUpPage", "Order" );
- maNupOrderBox.SMHID2( "NUpPage", "OrderBox" );
- maBorderCB.SMHID2( "NUpPage", "BorderBox" );
-
setupLayout();
}
@@ -387,7 +417,7 @@ PrintDialog::NUpTabPage::~NUpTabPage()
void PrintDialog::NUpTabPage::enableNupControls( bool bEnable )
{
- maNupPagesBox.Enable( TRUE );
+ maNupPagesBox.Enable( sal_True );
maNupNumPagesTxt.Enable( bEnable );
maNupColEdt.Enable( bEnable );
maNupTimesTxt.Enable( bEnable );
@@ -420,22 +450,21 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow )
maSheetMarginTxt2.Show( i_bShow );
maNupOrientationTxt.Show( i_bShow );
maNupOrientationBox.Show( i_bShow );
- maLayout.resize();
+ getLayout()->resize();
}
void PrintDialog::NUpTabPage::setupLayout()
{
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) );
/* According to OOo style guide, the horizontal indentation of child
elements to their parent element should always be 6 map units. */
long nIndent = aBorder.Width();
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
-
- maLayout.addWindow( &maNupLine );
- boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xRow );
+ xLayout->addWindow( &maNupLine );
+ boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRow );
boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) );
xRow->addChild( xIndent );
@@ -471,7 +500,7 @@ void PrintDialog::NUpTabPage::setupLayout()
xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent );
xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 );
- xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) );
+ xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) );
xMainCol->addChild( xSpacer );
xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) );
@@ -483,11 +512,6 @@ void PrintDialog::NUpTabPage::setupLayout()
showAdvancedControls( false );
}
-void PrintDialog::NUpTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
-}
-
void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS )
{
maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM );
@@ -523,30 +547,13 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) )
, maCollateBox( this, VclResId( SV_PRINT_COLLATE ) )
, maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) )
+ , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
, maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
, mnCollateUIMode( 0 )
- , maLayout( NULL, true )
{
FreeResource();
- SMHID1( "JobPage" );
- maPrinterFL.SMHID2( "JobPage", "Printer" );
- maPrinters.SMHID2( "JobPage", "PrinterList" );
- maDetailsBtn.SMHID2( "JobPage", "DetailsBtn" );
- maStatusLabel.SMHID2( "JobPage", "StatusLabel" );
- maStatusTxt.SMHID2( "JobPage", "StatusText" );
- maLocationLabel.SMHID2( "JobPage", "LocationLabel" );
- maLocationTxt.SMHID2( "JobPage", "LocationText" );
- maCommentLabel.SMHID2( "JobPage", "CommentLabel" );
- maCommentTxt.SMHID2( "JobPage", "CommentText" );
- maSetupButton.SMHID2( "JobPage", "Properties" );
- maCopies.SMHID2( "JobPage", "CopiesLine" );
- maCopySpacer.SMHID2( "JobPage", "CopySpacer" );
- maCopyCount.SMHID2( "JobPage", "CopiesText" );
- maCopyCountField.SMHID2( "JobPage", "Copies" );
- maCollateBox.SMHID2( "JobPage", "Collate" );
- maCollateImage.SMHID2( "JobPage", "CollateImage" );
maCopySpacer.Show();
maStatusTxt.Show();
@@ -566,39 +573,37 @@ void PrintDialog::JobTabPage::setupLayout()
// sets the results of GetOptimalSize in a normal ListBox
maPrinters.SetDropDownLineCount( 4 );
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
// add printer fixed line
- maLayout.addWindow( &maPrinterFL );
+ xLayout->addWindow( &maPrinterFL );
// add print LB
- maLayout.addWindow( &maPrinters, 3 );
+ xLayout->addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
- boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
- maLayout.addChild( xDetRow );
+ boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xDetRow );
xDetRow->addWindow( &maDetailsBtn );
xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) );
xDetRow->addWindow( &maSetupButton );
// create an indent for details
- boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) );
- maLayout.addChild( xIndent );
+ boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xLayout.get() ) );
+ xLayout->addChild( xIndent );
// remember details controls
mxDetails = xIndent;
// create a column for the details
- boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) );
+ boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) );
xIndent->setChild( xLabelCol );
xLabelCol->addRow( &maStatusLabel, &maStatusTxt );
xLabelCol->addRow( &maLocationLabel, &maLocationTxt );
xLabelCol->addRow( &maCommentLabel, &maCommentTxt );
// add print range and copies columns
- maLayout.addWindow( &maCopies );
- boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) );
- maLayout.addChild( xRangeRow );
+ xLayout->addWindow( &maCopies );
+ boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) );
+ xLayout->addChild( xRangeRow );
// create print range and add to range row
mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) );
@@ -632,8 +637,8 @@ void PrintDialog::JobTabPage::readFromSettings()
if( aValue.equalsIgnoreAsciiCaseAscii( "alwaysoff" ) )
{
mnCollateUIMode = 1;
- maCollateBox.Check( FALSE );
- maCollateBox.Enable( FALSE );
+ maCollateBox.Check( sal_False );
+ maCollateBox.Enable( sal_False );
}
else
{
@@ -657,24 +662,13 @@ void PrintDialog::JobTabPage::storeToSettings()
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
-void PrintDialog::JobTabPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
: TabPage( i_pParent, i_rResId )
, maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) )
, maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) )
, maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) )
- , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
{
FreeResource();
- SMHID1( "OptPage" );
- maOptionsLine.SMHID2( "OptPage", "Options" );
- maToFileBox.SMHID2( "OptPage", "ToFile" );
- maCollateSingleJobsBox.SMHID2( "OptPage", "SingleJobs" );
- maReverseOrderBox.SMHID2( "OptPage", "Reverse" );
setupLayout();
}
@@ -685,20 +679,17 @@ PrintDialog::OutputOptPage::~OutputOptPage()
void PrintDialog::OutputOptPage::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- maLayout.setParentWindow( this );
- maLayout.setOuterBorder( aBorder.Width() );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- maLayout.addWindow( &maOptionsLine );
- boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( &maLayout, aBorder.Width() ) );
- maLayout.addChild( xIndent );
- boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get(), aBorder.Height() ) );
+ xLayout->addWindow( &maOptionsLine );
+ boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) );
+ xLayout->addChild( xIndent );
+ boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) );
xIndent->setChild( xCol );
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
xCol->addWindow( &maCollateSingleJobsBox );
- xCol->addWindow( &maReverseOrderBox );
}
void PrintDialog::OutputOptPage::readFromSettings()
@@ -714,12 +705,6 @@ void PrintDialog::OutputOptPage::storeToSettings()
: rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
-void PrintDialog::OutputOptPage::Resize()
-{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
-}
-
-
PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController )
: ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) )
, maOKButton( this, VclResId( SV_PRINT_OK ) )
@@ -759,16 +744,14 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// set symbols on forward and backward button
maBackwardBtn.SetSymbol( SYMBOL_PREV );
maForwardBtn.SetSymbol( SYMBOL_NEXT );
- maBackwardBtn.ImplSetSmallSymbol( TRUE );
- maForwardBtn.ImplSetSmallSymbol( TRUE );
+ maBackwardBtn.ImplSetSmallSymbol( sal_True );
+ maForwardBtn.ImplSetSmallSymbol( sal_True );
maPageStr = maNumPagesText.GetText();
// init reverse print
- maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() );
+ maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() );
- // get the first page
- preparePreview( true, true );
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
@@ -800,6 +783,12 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( Printer::GetDefaultPrinterName() ) ) );
}
}
+ // not printing to file
+ maPController->resetPrinterOptions( false );
+
+ // get the first page
+ preparePreview( true, true );
+
// update the text fields for the printer
updatePrinterText();
@@ -835,7 +824,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
- maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
+ maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
@@ -887,18 +876,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
}
}
- // set HelpIDs
- SMHID1( "Dialog" );
- maOKButton.SMHID1( "OK" );
- maCancelButton.SMHID1( "Cancel" );
- maHelpButton.SMHID1( "Help" );
- maPreviewWindow.SMHID1( "Preview" );
- maNumPagesText.SMHID1( "NumPagesText" );
- maPageEdit.SMHID1( "PageEdit" );
- maForwardBtn.SMHID1( "ForwardBtn" );
- maBackwardBtn.SMHID1( "BackwardBtn" );
- maTabCtrl.SMHID1( "TabPages" );
-
// append further tab pages
if( mbShowLayoutPage )
{
@@ -927,13 +904,14 @@ PrintDialog::~PrintDialog()
void PrintDialog::setupLayout()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
+ boost::shared_ptr<vcl::RowOrColumn> xLayout =
+ boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
+ xLayout->setOuterBorder( 0 );
- maLayout.setParentWindow( this );
- boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( &maLayout, false ) );
- size_t nIndex = maLayout.addChild( xPreviewAndTab, 5 );
- maLayout.setBorders( nIndex, aBorder.Width(), aBorder.Width(), aBorder.Width(), 0 );
+ boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) );
+ size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 );
+ xLayout->setBorders( nIndex, -1, -1, -1, 0 );
// setup column for preview and sub controls
boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) );
@@ -957,12 +935,12 @@ void PrintDialog::setupLayout()
xPreviewAndTab->addWindow( &maTabCtrl );
// add the button line
- maLayout.addWindow( &maButtonLine );
+ xLayout->addWindow( &maButtonLine );
// add the row for the buttons
- boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &maLayout, false ) );
- nIndex = maLayout.addChild( xButtons );
- maLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() );
+ boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
+ nIndex = xLayout->addChild( xButtons );
+ xLayout->setBorders( nIndex, -1, 0, -1, -1 );
Size aMinSize( maCancelButton.GetSizePixel() );
// insert help button
@@ -984,10 +962,10 @@ void PrintDialog::readFromSettings()
SettingsConfigItem* pItem = SettingsConfigItem::get();
rtl::OUString aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ) );
- USHORT nCount = maTabCtrl.GetPageCount();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = maTabCtrl.GetPageCount();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
- USHORT nPageId = maTabCtrl.GetPageId( i );
+ sal_uInt16 nPageId = maTabCtrl.GetPageId( i );
if( aValue.equals( maTabCtrl.GetPageText( nPageId ) ) )
{
maTabCtrl.SelectTabPage( nPageId );
@@ -995,6 +973,11 @@ void PrintDialog::readFromSettings()
}
}
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
+ if( maOptionsPage.maToFileBox.IsChecked() )
+ {
+ maPController->resetPrinterOptions( true );
+ preparePreview( true, true );
+ }
}
void PrintDialog::storeToSettings()
@@ -1027,7 +1010,7 @@ int PrintDialog::getCopyCount()
bool PrintDialog::isCollate()
{
- return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : FALSE;
+ return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : sal_False;
}
bool PrintDialog::isSingleJobs()
@@ -1035,35 +1018,18 @@ bool PrintDialog::isSingleJobs()
return maOptionsPage.maCollateSingleJobsBox.IsChecked();
}
-static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
+void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex )
{
- rtl::OUStringBuffer aBuf( 256 );
- aBuf.appendAscii( HELPID_PREFIX );
- if( i_rPropName.getLength() )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_rPropName );
- }
- if( i_pType )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.appendAscii( i_pType );
- }
- if( i_nId >= 0 )
- {
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_nId );
- }
- i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
+ if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() )
+ i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) );
}
-static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
+static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex )
{
// without a help text set and the correct smartID,
// help texts will be retrieved from the online help system
-
- // passed help texts for optional UI is used only for native dialogs which currently
- // cannot access the same (rather implicit) mechanism
+ if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
+ i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
}
void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1076,17 +1042,15 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
void PrintDialog::setupOptionalUI()
{
- Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
-
- std::vector<vcl::RowOrColumn*> aDynamicColumns;
- vcl::RowOrColumn* pCurColumn = 0;
+ std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns;
+ boost::shared_ptr< vcl::RowOrColumn > pCurColumn;
Window* pCurParent = 0, *pDynamicPageParent = 0;
- USHORT nOptPageId = 9, nCurSubGroup = 0;
+ sal_uInt16 nOptPageId = 9, nCurSubGroup = 0;
bool bOnStaticPage = false;
bool bSubgroupOnStaticPage = false;
- std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap;
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap;
const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() );
for( int i = 0; i < rOptions.getLength(); i++ )
@@ -1099,7 +1063,9 @@ void PrintDialog::setupOptionalUI()
rtl::OUString aText;
rtl::OUString aPropertyName;
Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
Sequence< rtl::OUString > aHelpTexts;
+ Sequence< rtl::OUString > aHelpIds;
sal_Int64 nMinValue = 0, nMaxValue = 0;
sal_Int32 nCurHelpText = 0;
rtl::OUString aGroupingHint;
@@ -1122,6 +1088,10 @@ void PrintDialog::setupOptionalUI()
{
rEntry.Value >>= aChoices;
}
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ChoicesDisabled" ) ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
{
PropertyValue aVal;
@@ -1169,6 +1139,18 @@ void PrintDialog::setupOptionalUI()
}
}
}
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HelpId" ) ) )
+ {
+ if( ! (rEntry.Value >>= aHelpIds ) )
+ {
+ rtl::OUString aHelpId;
+ if( (rEntry.Value >>= aHelpId) )
+ {
+ aHelpIds.realloc( 1 );
+ *aHelpIds.getArray() = aHelpId;
+ }
+ }
+ }
else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HintNoLayoutPage" ) ) )
{
sal_Bool bNoLayoutPage = sal_False;
@@ -1190,37 +1172,40 @@ void PrintDialog::setupOptionalUI()
{
// restore to dynamic
pCurParent = pDynamicPageParent;
- pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back();
+ if( ! aDynamicColumns.empty() )
+ pCurColumn = aDynamicColumns.back();
+ else
+ pCurColumn.reset();
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
{
- pCurColumn = maJobPage.mxPrintRange.get();
+ pCurColumn = maJobPage.mxPrintRange;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPage" ) ) )
{
- pCurColumn = &maOptionsPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPageOptGroup" ) ) )
{
- pCurColumn = maOptionsPage.mxOptGroup.get();
+ pCurColumn = maOptionsPage.mxOptGroup;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) )
{
- pCurColumn = &maNUpPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
else if( aGroupingHint.getLength() )
{
- pCurColumn = &maJobPage.maLayout;
+ pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
@@ -1238,17 +1223,16 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetTabPage( nOptPageId, pNewGroup );
// set help id
- setSmartId( pNewGroup, "TabPage", nOptPageId );
+ setHelpId( pNewGroup, aHelpIds, 0 );
// set help text
setHelpText( pNewGroup, aHelpTexts, 0 );
// reset subgroup counter
nCurSubGroup = 0;
- aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) );
+ aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) );
pCurColumn = aDynamicColumns.back();
pCurColumn->setParentWindow( pNewGroup );
- pCurColumn->setOuterBorder( aBorder.Width() );
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
@@ -1270,7 +1254,7 @@ void PrintDialog::setupOptionalUI()
pNewSub->Show();
// set help id
- setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) );
+ setHelpId( pNewSub, aHelpIds, 0 );
// set help text
setHelpText( pNewSub, aHelpTexts, 0 );
// add group to current column
@@ -1278,10 +1262,10 @@ void PrintDialog::setupOptionalUI()
}
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pCurColumn = new vcl::RowOrColumn( pIndent );
+ pCurColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pCurColumn );
}
// EVIL
@@ -1305,17 +1289,17 @@ void PrintDialog::setupOptionalUI()
maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn );
maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName;
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) );
}
else
{
- vcl::RowOrColumn* pSaveCurColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn );
if( bUseDependencyRow )
{
// find the correct dependency row (if any)
- std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator,
- std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange;
+ std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator,
+ std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange;
aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName );
if( aDepRange.first != aDepRange.second )
{
@@ -1350,20 +1334,20 @@ void PrintDialog::setupOptionalUI()
maControlToPropertyMap[pNewBox] = aPropertyName;
// set help id
- setSmartId( pNewBox, "CheckBox", -1, aPropertyName );
+ setHelpId( pNewBox, aHelpIds, 0 );
// set help text
setHelpText( pNewBox, aHelpTexts, 0 );
- vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
{
- vcl::RowOrColumn* pRadioColumn = pCurColumn;
+ boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
if( aText.getLength() )
{
// add a FixedText:
@@ -1373,16 +1357,17 @@ void PrintDialog::setupOptionalUI()
pHeading->Show();
// set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
+ setHelpId( pHeading, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pHeading, aHelpTexts, nCurHelpText++ );
+ setHelpText( pHeading, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add fixed text to current column
pCurColumn->addWindow( pHeading );
// add an indent to the current column
- vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 );
+ vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 );
pCurColumn->addChild( pIndent );
// and create a column inside the indent
- pRadioColumn = new vcl::RowOrColumn( pIndent );
+ pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) );
pIndent->setChild( pRadioColumn );
}
// iterate options
@@ -1392,26 +1377,29 @@ void PrintDialog::setupOptionalUI()
pVal->Value >>= nSelectVal;
for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
{
- boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 1 ) );
+ boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) );
pRadioColumn->addChild( pLabel );
boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) );
pLabel->setElement( pDependencyRow );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) );
RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 );
maControls.push_front( pBtn );
pBtn->SetText( aChoices[m] );
pBtn->Check( m == nSelectVal );
pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) );
+ if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True )
+ pBtn->Enable( sal_False );
pBtn->Show();
maPropertyToWindowMap[ aPropertyName ].push_back( pBtn );
maControlToPropertyMap[pBtn] = aPropertyName;
maControlToNumValMap[pBtn] = m;
// set help id
- setSmartId( pBtn, "RadioButton", m, aPropertyName );
+ setHelpId( pBtn, aHelpIds, nCurHelpText );
// set help text
- setHelpText( pBtn, aHelpTexts, nCurHelpText++ );
+ setHelpText( pBtn, aHelpTexts, nCurHelpText );
+ nCurHelpText++;
// add the radio button to the column
pLabel->setLabel( pBtn );
}
@@ -1422,9 +1410,9 @@ void PrintDialog::setupOptionalUI()
) && pCurParent )
{
// create a row in the current column
- vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false );
+ boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) );
pCurColumn->addChild( pFieldColumn );
- aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) );
+ aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
vcl::LabeledElement* pLabel = NULL;
if( aText.getLength() )
@@ -1435,11 +1423,9 @@ void PrintDialog::setupOptionalUI()
pHeading->SetText( aText );
pHeading->Show();
- // set help id
- setSmartId( pHeading, "FixedText", -1, aPropertyName );
// add to row
- pLabel = new vcl::LabeledElement( pFieldColumn, 2 );
+ pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
@@ -1458,13 +1444,13 @@ void PrintDialog::setupOptionalUI()
PropertyValue* pVal = maPController->getValue( aPropertyName );
if( pVal && pVal->Value.hasValue() )
pVal->Value >>= nSelectVal;
- pList->SelectEntryPos( static_cast<USHORT>(nSelectVal) );
+ pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) );
pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) );
- pList->SetDropDownLineCount( static_cast<USHORT>(aChoices.getLength()) );
+ pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) );
pList->Show();
// set help id
- setSmartId( pList, "ListBox", -1, aPropertyName );
+ setHelpId( pList, aHelpIds, 0 );
// set help text
setHelpText( pList, aHelpTexts, 0 );
@@ -1497,7 +1483,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "NumericField", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1524,7 +1510,7 @@ void PrintDialog::setupOptionalUI()
pField->Show();
// set help id
- setSmartId( pField, "Edit", -1, aPropertyName );
+ setHelpId( pField, aHelpIds, 0 );
// set help text
setHelpText( pField, aHelpTexts, 0 );
@@ -1554,9 +1540,9 @@ void PrintDialog::setupOptionalUI()
if( maNUpPage.mxPagesBtnLabel.get() )
{
maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() );
- maNUpPage.maPagesBoxTitleTxt.Show( TRUE );
+ maNUpPage.maPagesBoxTitleTxt.Show( sal_True );
maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt );
- maNUpPage.maPagesBtn.Show( FALSE );
+ maNUpPage.maPagesBtn.Show( sal_False );
}
}
@@ -1567,18 +1553,28 @@ void PrintDialog::setupOptionalUI()
if( maJobPage.mxPrintRange->countElements() == 0 )
{
maJobPage.mxPrintRange->show( false, false );
- maJobPage.maCopySpacer.Show( FALSE );
+ maJobPage.maCopySpacer.Show( sal_False );
+ maJobPage.maReverseOrderBox.Show( sal_False );
+ }
+ else
+ {
+ // add an indent to the current column
+ vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 );
+ maJobPage.mxPrintRange->addChild( pIndent );
+ // and create a column inside the indent
+ pIndent->setWindow( &maJobPage.maReverseOrderBox );
+ maJobPage.maReverseOrderBox.Show( sal_True );
}
#ifdef WNT
// FIXME: the GetNativeControlRegion call on Windows has some issues
// (which skew the results of GetOptimalSize())
// however fixing this thoroughly needs to take interaction with paint into
- // acoount, making the right fix less simple. Fix this the right way
+ // account, making the right fix less simple. Fix this the right way
// at some point. For now simply add some space at the lowest element
- size_t nIndex = maJobPage.maLayout.countElements();
+ size_t nIndex = maJobPage.getLayout()->countElements();
if( nIndex > 0 ) // sanity check
- maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
+ maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 );
#endif
// create auto mnemomnics now so they can be calculated in layout
@@ -1588,13 +1584,13 @@ void PrintDialog::setupOptionalUI()
ImplWindowAutoMnemonic( this );
// calculate job page
- Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
+ Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
- updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
// and options page
- updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
+ updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize );
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
+ for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin();
it != aDynamicColumns.end(); ++it )
{
Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -1622,19 +1618,8 @@ void PrintDialog::setupOptionalUI()
maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() );
}
- // and finally arrange controls
- for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin();
- it != aDynamicColumns.end(); ++it )
- {
- (*it)->setManagedArea( Rectangle( Point(), aTabSize ) );
- delete *it;
- *it = NULL;
- }
- maJobPage.Resize();
- maNUpPage.Resize();
- maOptionsPage.Resize();
+ Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
- Size aSz = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
SetOutputSizePixel( aSz );
}
@@ -1651,7 +1636,7 @@ void PrintDialog::checkControlDependencies()
if( maJobPage.maCopyCountField.GetValue() > 1 )
maJobPage.maCollateBox.Enable( maJobPage.mnCollateUIMode == 0 );
else
- maJobPage.maCollateBox.Enable( FALSE );
+ maJobPage.maCollateBox.Enable( sal_False );
Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg );
@@ -1660,7 +1645,7 @@ void PrintDialog::checkControlDependencies()
// adjust size of image
maJobPage.maCollateImage.SetSizePixel( aImgSize );
maJobPage.maCollateImage.SetImage( aImg );
- maJobPage.maLayout.resize();
+ maJobPage.getLayout()->resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -1675,7 +1660,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Show();
- maLayout.resize();
+ getLayout()->resize();
}
}
else
@@ -1689,7 +1674,7 @@ void PrintDialog::checkControlDependencies()
aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X();
maJobPage.maPrinters.SetSizePixel( aPrinterSize );
maJobPage.maSetupButton.Hide();
- maLayout.resize();
+ getLayout()->resize();
}
}
}
@@ -1718,6 +1703,16 @@ void PrintDialog::checkOptionalControlDependencies()
}
}
+ if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first) )
+ {
+ std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first );
+ if( r_it != maControlToNumValMap.end() )
+ {
+ bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second );
+ }
+ }
+
+
bool bIsEnabled = it->first->IsEnabled();
// Enable does not do a change check first, so can be less cheap than expected
if( bShouldbeEnabled != bIsEnabled )
@@ -1806,8 +1801,11 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
}
Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
- maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr,
- aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY()
+ maPreviewWindow.setPreview( aMtf, aCurPageSize,
+ aPrt->GetPaperName( false ),
+ nPages > 0 ? rtl::OUString() : maNoPageStr,
+ aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(),
+ aPrt->GetPrinterOptions().IsConvertToGreyscales()
);
maForwardBtn.Enable( mnCurPage < nPages-1 );
@@ -1920,7 +1918,7 @@ void PrintDialog::updateNupFromPages()
if( bCustom )
{
// see if we have to enlarge the dialog to make the tab page fit
- Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) );
Size aTabSize( maTabCtrl.GetTabPageSizePixel() );
if( aTabSize.Height() < aCurSize.Height() )
{
@@ -1956,10 +1954,14 @@ void PrintDialog::updateNup()
int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData(
maNUpPage.maNupOrderBox.GetSelectEntryPos() )));
- if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD )
+ if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
aMPS.nOrder = PrinterController::LRTB;
- else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR )
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
aMPS.nOrder = PrinterController::TBLR;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_RLTB )
+ aMPS.nOrder = PrinterController::RLTB;
+ else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL )
+ aMPS.nOrder = PrinterController::TBRL;
int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData(
maNUpPage.maNupOrientationBox.GetSelectEntryPos() )));
@@ -1994,6 +1996,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox )
String aNewPrinter( pBox->GetSelectEntry() );
// set new printer
maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) );
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
// update text fields
updatePrinterText();
}
@@ -2024,8 +2027,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
Help* pHelp = Application::GetHelp();
if( pHelp )
{
- // FIXME: find out proper help URL and use here
- pHelp->Start( HID_PRINTDLG, GetParent() );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton );
}
}
else if( pButton == &maForwardBtn )
@@ -2039,7 +2041,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
else if( pButton == &maOptionsPage.maToFileBox )
{
maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText );
- maLayout.resize();
+ maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
+ getLayout()->resize();
+ preparePreview( true, true );
}
else if( pButton == &maNUpPage.maBrochureBtn )
{
@@ -2075,7 +2079,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
{
maDetailsCollapsedSize = GetOutputSizePixel();
// enlarge dialog if necessary
- Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) );
+ Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) );
Size aCurSize( maJobPage.GetSizePixel() );
if( aCurSize.Height() < aMinSize.Height() )
{
@@ -2104,9 +2108,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
makeAny( sal_Bool(isCollate()) ) );
checkControlDependencies();
}
- else if( pButton == &maOptionsPage.maReverseOrderBox )
+ else if( pButton == &maJobPage.maReverseOrderBox )
{
- sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked();
+ sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked();
maPController->setReversePrint( bChecked );
maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ),
makeAny( bChecked ) );
@@ -2212,7 +2216,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty )
ListBox* pList = dynamic_cast< ListBox* >( rWindows.front() );
if( pList )
{
- pList->SelectEntryPos( static_cast< USHORT >(nVal) );
+ pList->SelectEntryPos( static_cast< sal_uInt16 >(nVal) );
}
else if( nVal >= 0 && nVal < sal_Int32(rWindows.size() ) )
{
@@ -2349,7 +2353,7 @@ void PrintDialog::Command( const CommandEvent& rEvt )
void PrintDialog::Resize()
{
- maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ // maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
// and do the preview; however the metafile does not need to be gotten anew
preparePreview( false );
@@ -2453,6 +2457,7 @@ void PrintProgressDialog::tick()
void PrintProgressDialog::reset()
{
+ mbCanceled = false;
setProgress( 0 );
}
@@ -2477,9 +2482,9 @@ void PrintProgressDialog::Paint( const Rectangle& )
nOffset,
nWidth,
mnProgressHeight,
- static_cast<USHORT>(0),
- static_cast<USHORT>(10000*mnCur/mnMax),
- static_cast<USHORT>(10000/nMaxCount),
+ static_cast<sal_uInt16>(0),
+ static_cast<sal_uInt16>(10000*mnCur/mnMax),
+ static_cast<sal_uInt16>(10000/nMaxCount),
maProgressRect
);
Pop();
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index ab4068ac6e3d..588f4d4fa1fa 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -69,12 +69,12 @@ ImplWheelWindow::ImplWheelWindow( Window* pParent ) :
DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
const Size aSize( pParent->GetOutputSizePixel() );
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
// calculate maximum speed distance
- mnMaxWidth = (ULONG) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
+ mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
// create wheel window
SetTitleType( FLOATWIN_TITLE_NONE );
@@ -116,7 +116,7 @@ void ImplWheelWindow::ImplStop()
{
ReleaseMouse();
mpTimer->Stop();
- Show(FALSE);
+ Show(sal_False);
}
// ------------------------------------------------------------------------
@@ -148,7 +148,7 @@ void ImplWheelWindow::ImplCreateImageList()
// ------------------------------------------------------------------------
-void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode )
+void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode )
{
if( nWheelMode != mnWheelMode )
{
@@ -173,7 +173,7 @@ void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode )
void ImplWheelWindow::ImplDrawWheel()
{
- USHORT nId;
+ sal_uInt16 nId;
switch( mnWheelMode )
{
@@ -201,13 +201,13 @@ void ImplWheelWindow::ImplRecalcScrollValues()
}
else
{
- ULONG nCurTime;
+ sal_uLong nCurTime;
// calc current time
if( mnMaxWidth )
{
const double fExp = ( (double) mnActDist / mnMaxWidth ) * log10( (double) MAX_TIME / MIN_TIME );
- nCurTime = (ULONG) ( MAX_TIME / pow( 10., fExp ) );
+ nCurTime = (sal_uLong) ( MAX_TIME / pow( 10., fExp ) );
}
else
nCurTime = MAX_TIME;
@@ -251,9 +251,9 @@ void ImplWheelWindow::ImplRecalcScrollValues()
PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY )
{
PointerStyle eStyle;
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
if( bHorz || bVert )
{
@@ -331,13 +331,13 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
const long nDistX = aMousePos.X() - maCenter.X();
const long nDistY = aMousePos.Y() - maCenter.Y();
- mnActDist = (ULONG) hypot( (double) nDistX, nDistY );
+ mnActDist = (sal_uLong) hypot( (double) nDistX, nDistY );
const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY );
- const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
- const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
- const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
- const BOOL bOuter = mnActDist > WHEEL_RADIUS;
+ const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0;
+ const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0;
+ const sal_Bool bOuter = mnActDist > WHEEL_RADIUS;
if( bOuter && ( maLastMousePos != aMousePos ) )
{
@@ -389,17 +389,17 @@ IMPL_LINK( ImplWheelWindow, ImplScrollHdl, Timer*, EMPTYARG )
const Point aMousePos( pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() ) );
Point aCmdMousePos( pWindow->ImplFrameToOutput( aMousePos ) );
CommandScrollData aScrollData( mnActDeltaX, mnActDeltaY );
- CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, TRUE, &aScrollData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, sal_True, &aScrollData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
{
- const ULONG nTime = Time::GetSystemTicks();
+ const sal_uLong nTime = Time::GetSystemTicks();
ImplDelData aDel( this );
pWindow->Command( aCEvt );
if( aDel.IsDead() )
return 0;
- mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (ULONG)1 );
+ mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 );
ImplRecalcScrollValues();
}
}
diff --git a/vcl/source/window/scrwnd.hxx b/vcl/source/window/scrwnd.hxx
index 0b00d0940059..ccc38c778c99 100644
--- a/vcl/source/window/scrwnd.hxx
+++ b/vcl/source/window/scrwnd.hxx
@@ -58,12 +58,12 @@ private:
Point maLastMousePos;
Point maCenter;
Timer* mpTimer;
- ULONG mnRepaintTime;
- ULONG mnTimeout;
- ULONG mnWheelMode;
- ULONG mnMaxWidth;
- ULONG mnActWidth;
- ULONG mnActDist;
+ sal_uLong mnRepaintTime;
+ sal_uLong mnTimeout;
+ sal_uLong mnWheelMode;
+ sal_uLong mnMaxWidth;
+ sal_uLong mnActWidth;
+ sal_uLong mnActDist;
long mnActDeltaX;
long mnActDeltaY;
@@ -88,8 +88,8 @@ public:
~ImplWheelWindow();
void ImplStop();
- void ImplSetWheelMode( ULONG nWheelMode );
- ULONG ImplGetWheelMode() const { return mnWheelMode; }
+ void ImplSetWheelMode( sal_uLong nWheelMode );
+ sal_uLong ImplGetWheelMode() const { return mnWheelMode; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 0c0352893a68..b8b6735d81ca 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -37,7 +37,7 @@
-inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
+inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const
{
// return !( eSelMode == MULTIPLE_SELECTION && bModifierKey1 );
return eSelMode != MULTIPLE_SELECTION || !bModifierKey1;
@@ -53,7 +53,7 @@ inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const
*************************************************************************/
SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
- ULONG nAutoRepeatInterval ) :
+ sal_uLong nAutoRepeatInterval ) :
pWin( pWindow ),
nUpdateInterval( nAutoRepeatInterval )
{
@@ -118,7 +118,7 @@ void SelectionEngine::ActivateDragMode()
|*
*************************************************************************/
-void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 )
+void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
{
if ( !pFunctionSet )
return;
@@ -172,19 +172,19 @@ void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_CMDEVT);
if ( !pFunctionSet || !pWin )
- return FALSE;
+ return sal_False;
const bool bRightClickCursorPositioning =
rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection();
if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning )
- return FALSE;
+ return sal_False;
- USHORT nModifier = rMEvt.GetModifier() | nLockedMods;
+ sal_uInt16 nModifier = rMEvt.GetModifier() | nLockedMods;
if ( nModifier & KEY_MOD2 )
- return FALSE;
+ return sal_False;
// in SingleSelection: Control-Taste filtern (damit auch
// mit Ctrl-Click ein D&D gestartet werden kann)
if ( nModifier == KEY_MOD1 && eSelMode == SINGLE_SELECTION )
@@ -207,14 +207,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
case 0: // KEY_NO_KEY
{
- BOOL bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos );
+ sal_Bool bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos );
nFlags &= (~SELENG_IN_ADD);
if ( (nFlags & SELENG_DRG_ENAB) && bSelAtPoint )
{
nFlags |= SELENG_WAIT_UPEVT;
nFlags &= ~(SELENG_IN_SEL);
pWin->ReleaseMouse();
- return TRUE; //auf STARTDRAG-Command-Event warten
+ return sal_True; //auf STARTDRAG-Command-Event warten
}
if ( eSelMode != SINGLE_SELECTION )
{
@@ -222,14 +222,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
pFunctionSet->DeselectAll();
else
pFunctionSet->DestroyAnchor();
- nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = FALSE;
+ nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = sal_False;
}
pFunctionSet->SetCursorAtPoint( aPos );
// Sonderbehandlung Single-Selection, damit Select+Drag
// in einem Zug moeglich ist
if (eSelMode == SINGLE_SELECTION && (nFlags & SELENG_DRG_ENAB))
nFlags |= SELENG_WAIT_UPEVT;
- return TRUE;
+ return sal_True;
}
case KEY_SHIFT:
@@ -237,7 +237,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
if ( nFlags & SELENG_ADD_ALW )
nFlags |= SELENG_IN_ADD;
@@ -252,7 +252,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return TRUE;
+ return sal_True;
case KEY_MOD1:
// Control nur bei Mehrfachselektion erlaubt
@@ -260,7 +260,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_IN_SEL);
pWin->ReleaseMouse();
- return TRUE; // Mausclick verschlucken
+ return sal_True; // Mausclick verschlucken
}
if ( nFlags & SELENG_HAS_ANCH )
{
@@ -271,32 +271,32 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
if ( pFunctionSet->IsSelectionAtPoint( aPos ) )
{
pFunctionSet->DeselectAtPoint( aPos );
- pFunctionSet->SetCursorAtPoint( aPos, TRUE );
+ pFunctionSet->SetCursorAtPoint( aPos, sal_True );
}
else
{
pFunctionSet->SetCursorAtPoint( aPos );
}
- return TRUE;
+ return sal_True;
case KEY_SHIFT + KEY_MOD1:
if ( eSelMode != MULTIPLE_SELECTION )
{
pWin->ReleaseMouse();
nFlags &= (~SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
- nFlags |= SELENG_IN_ADD; //bIsInAddMode = TRUE;
+ nFlags |= SELENG_IN_ADD; //bIsInAddMode = sal_True;
if ( !(nFlags & SELENG_HAS_ANCH) )
{
pFunctionSet->CreateAnchor();
nFlags |= SELENG_HAS_ANCH;
}
pFunctionSet->SetCursorAtPoint( aPos );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -305,14 +305,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
aWTimer.Stop();
//DbgOut("Up");
if( !pFunctionSet || !pWin )
{
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return FALSE;
+ return sal_False;
}
if( !rMEvt.IsRight() )
@@ -325,7 +325,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
{
// MouseButtonDown in Sel aber kein CommandEvent eingetrudelt
// ==> deselektieren
- USHORT nModifier = aLastMove.GetModifier() | nLockedMods;
+ sal_uInt16 nModifier = aLastMove.GetModifier() | nLockedMods;
if( nModifier == KEY_MOD1 || IsAlwaysAdding() )
{
if( !(nModifier & KEY_SHIFT) )
@@ -335,7 +335,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
nFlags &= (~SELENG_HAS_ANCH); // nix Anker
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), TRUE );
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), sal_True );
}
else
{
@@ -346,7 +346,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL);
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -355,21 +355,21 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
|*
*************************************************************************/
-BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
+sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
{
if ( !pFunctionSet || !(nFlags & SELENG_IN_SEL) ||
(nFlags & (SELENG_CMDEVT | SELENG_WAIT_UPEVT)) )
- return FALSE;
+ return sal_False;
if( !(nFlags & SELENG_EXPANDONMOVE) )
- return FALSE; // auf DragEvent warten!
+ return sal_False; // auf DragEvent warten!
aLastMove = rMEvt;
// wenn die Maus ausserhalb der Area steht, dann wird die
// Frequenz des SetCursorAtPoint() nur durch den Timer bestimmt
if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
- return TRUE;
+ return sal_True;
aWTimer.SetTimeout( nUpdateInterval );
aWTimer.Start();
@@ -386,7 +386,7 @@ BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
//DbgOut("Move:SetCursor");
pFunctionSet->SetCursorAtPoint( rMEvt.GetPosPixel() );
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -456,7 +456,7 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
}
}
-void SelectionEngine::SetUpdateInterval( ULONG nInterval )
+void SelectionEngine::SetUpdateInterval( sal_uLong nInterval )
{
if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
// Set a lower threshold. On Windows, setting this value too low
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index df03cf321ce3..1d4c8bfae815 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -61,13 +61,13 @@ namespace
void Splitter::ImplInitSplitterData()
{
- ImplGetWindowImpl()->mbSplitter = TRUE;
+ ImplGetWindowImpl()->mbSplitter = sal_True;
mpRefWin = NULL;
mnSplitPos = 0;
mnLastSplitPos = 0;
mnStartSplitPos = 0;
- mbDragFull = FALSE;
- mbKbdSplitting = FALSE;
+ mbDragFull = sal_False;
+ mbKbdSplitting = sal_False;
mbInKeyEvent = 0;
mnKeyboardStepSize = SPLITTER_DEFAULTSTEPSIZE;
}
@@ -89,13 +89,13 @@ void Splitter::ImplInit( Window* pParent, WinBits nWinStyle )
if ( nWinStyle & WB_HSCROLL )
{
ePointerStyle = POINTER_HSPLIT;
- mbHorzSplit = TRUE;
+ mbHorzSplit = sal_True;
SetSizePixel( Size( nB, nA ) );
}
else
{
ePointerStyle = POINTER_VSPLIT;
- mbHorzSplit = FALSE;
+ mbHorzSplit = sal_False;
SetSizePixel( Size( nA, nB ) );
}
@@ -218,11 +218,11 @@ Splitter* Splitter::ImplFindSibling()
// -----------------------------------------------------------------------
-BOOL Splitter::ImplSplitterActive()
+sal_Bool Splitter::ImplSplitterActive()
{
// is splitter in document or at scrollbar handle ?
- BOOL bActive = TRUE;
+ sal_Bool bActive = sal_True;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
long nA = rSettings.GetScrollBarSize();
long nB = rSettings.GetSplitSize();
@@ -231,12 +231,12 @@ BOOL Splitter::ImplSplitterActive()
if ( mbHorzSplit )
{
if( aSize.Width() == nB && aSize.Height() == nA )
- bActive = FALSE;
+ bActive = sal_False;
}
else
{
if( aSize.Width() == nA && aSize.Height() == nB )
- bActive = FALSE;
+ bActive = sal_False;
}
return bActive;
}
@@ -352,13 +352,13 @@ void Splitter::Tracking( const TrackingEvent& rTEvt )
void Splitter::ImplKbdTracking( KeyCode aKeyCode )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( nCode == KEY_ESCAPE || nCode == KEY_RETURN )
{
if( !mbKbdSplitting )
return;
else
- mbKbdSplitting = FALSE;
+ mbKbdSplitting = sal_False;
if ( nCode != KEY_ESCAPE )
{
@@ -553,7 +553,7 @@ void Splitter::ImplStartKbdSplitting()
if( mbKbdSplitting )
return;
- mbKbdSplitting = TRUE;
+ mbKbdSplitting = sal_True;
StartSplit();
@@ -625,7 +625,7 @@ void Splitter::LoseFocus()
{
KeyCode aReturnKey( KEY_RETURN );
ImplKbdTracking( aReturnKey );
- mbKbdSplitting = FALSE;
+ mbKbdSplitting = sal_False;
}
Invalidate();
}
@@ -641,7 +641,7 @@ void Splitter::KeyInput( const KeyEvent& rKEvt )
Splitter *pSibling = ImplFindSibling();
KeyCode aKeyCode = rKEvt.GetKeyCode();
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
switch ( nCode )
{
case KEY_UP:
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 3cf2af7bacc8..d0bf60b6412c 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -46,7 +46,8 @@
// =======================================================================
-// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird
+// Attention: Must not contain non-PODs because array is enlarged/copied
+// with the use of memmove/memcpy.
struct ImplSplitItem
{
long mnSize;
@@ -64,10 +65,14 @@ struct ImplSplitItem
ImplSplitSet* mpSet;
Window* mpWindow;
Window* mpOrgParent;
- USHORT mnId;
+ sal_uInt16 mnId;
SplitWindowItemBits mnBits;
- BOOL mbFixed;
- BOOL mbSubSize;
+ sal_Bool mbFixed;
+ sal_Bool mbSubSize;
+ /// Minimal width or height of the item. -1 means no restriction.
+ long mnMinSize;
+ /// Maximal width or height of the item. -1 means no restriction.
+ long mnMaxSize;
};
struct ImplSplitSet
@@ -77,25 +82,47 @@ struct ImplSplitSet
Bitmap* mpBitmap;
long mnLastSize;
long mnSplitSize;
- USHORT mnItems;
- USHORT mnId;
- BOOL mbCalcPix;
+ sal_uInt16 mnItems;
+ sal_uInt16 mnId;
+ sal_Bool mbCalcPix;
};
+
+
+/** Check whether the given size is inside the valid range defined by
+ [rItem.mnMinSize,rItem.mnMaxSize]. When it is not inside it then return
+ the upper or lower bound, respectively. Otherwise return the given size
+ unmodified.
+ Note that either mnMinSize and/or mnMaxSize can be -1 in which case the
+ size has not lower or upper bound.
+*/
+namespace {
+ long ValidateSize (const long nSize, const ImplSplitItem rItem)
+ {
+ if (rItem.mnMinSize>=0 && nSize<rItem.mnMinSize)
+ return rItem.mnMinSize;
+ else if (rItem.mnMaxSize>0 && nSize>rItem.mnMaxSize)
+ return rItem.mnMaxSize;
+ else
+ return nSize;
+ }
+}
+
+
#define SPLITWIN_SPLITSIZE 3
#define SPLITWIN_SPLITSIZEEX 4
#define SPLITWIN_SPLITSIZEEXLN 6
#define SPLITWIN_SPLITSIZEAUTOHIDE 36
#define SPLITWIN_SPLITSIZEFADE 36
-#define SPLIT_HORZ ((USHORT)0x0001)
-#define SPLIT_VERT ((USHORT)0x0002)
-#define SPLIT_WINDOW ((USHORT)0x0004)
-#define SPLIT_NOSPLIT ((USHORT)0x8000)
+#define SPLIT_HORZ ((sal_uInt16)0x0001)
+#define SPLIT_VERT ((sal_uInt16)0x0002)
+#define SPLIT_WINDOW ((sal_uInt16)0x0004)
+#define SPLIT_NOSPLIT ((sal_uInt16)0x8000)
// =======================================================================
-static void ImplCalcBorder( WindowAlign eAlign, BOOL bNoAlign,
+static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign,
long& rLeft, long& rTop,
long& rRight, long& rBottom )
{
@@ -250,13 +277,13 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId )
+static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId )
{
if ( pSet->mnId == nId )
return pSet;
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -280,10 +307,10 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId )
// -----------------------------------------------------------------------
-static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos )
+static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt16& rPos )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -310,10 +337,10 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos
// -----------------------------------------------------------------------
-static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
+static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -324,7 +351,7 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
{
if ( pItems[i].mpSet )
{
- USHORT nId = ImplFindItem( pItems[i].mpSet, pWindow );
+ sal_uInt16 nId = ImplFindItem( pItems[i].mpSet, pWindow );
if ( nId )
return nId;
}
@@ -336,11 +363,11 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow )
// -----------------------------------------------------------------------
-static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
- BOOL bRows, BOOL bDown = TRUE )
+static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -386,8 +413,8 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos,
static void ImplDeleteSet( ImplSplitSet* pSet )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -411,7 +438,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet )
static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
{
pSet->mnSplitSize = nNewSize;
- for ( USHORT i = 0; i < pSet->mnItems; i++ )
+ for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mpSet )
ImplSetSplitSize( pSet->mpItems[i].mpSet, nNewSize );
@@ -423,18 +450,18 @@ static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize )
static void ImplCalcSet( ImplSplitSet* pSet,
long nSetLeft, long nSetTop,
long nSetWidth, long nSetHeight,
- BOOL bRows, BOOL bDown = TRUE )
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
if ( !pSet->mpItems )
return;
- USHORT i;
- USHORT j;
- USHORT nMins;
- USHORT nCalcItems;
- USHORT nItems = pSet->mnItems;
- USHORT nVisItems;
- USHORT nAbsItems;
+ sal_uInt16 i;
+ sal_uInt16 j;
+ sal_uInt16 nMins;
+ sal_uInt16 nCalcItems;
+ sal_uInt16 nItems = pSet->mnItems;
+ sal_uInt16 nVisItems;
+ sal_uInt16 nAbsItems;
long nCalcSize;
long nSizeDelta;
long nCurSize;
@@ -448,7 +475,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
long nMaxPos;
long* pSize;
ImplSplitItem* pItems = pSet->mpItems;
- BOOL bEmpty;
+ sal_Bool bEmpty;
// Anzahl sichtbarer Items ermitteln
nVisItems = 0;
@@ -528,7 +555,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
nCurSize += pItems[i].mnPixSize;
}
- pSet->mbCalcPix = FALSE;
+ pSet->mbCalcPix = sal_False;
pSet->mnLastSize = nCalcSize;
// Fenster einpassen
@@ -552,7 +579,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
}
// Rundungsfehler werden hier nicht ausgelichen
- if ( (nAbsItems < (USHORT)(Abs( nSizeDelta ))) && nSizeWinSize )
+ if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize )
{
for ( i = 0; i < nItems; i++ )
{
@@ -579,10 +606,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbSubSize = FALSE;
+ pItems[i].mbSubSize = sal_False;
if ( j >= 2 )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
else
{
if ( !(pItems[i].mnBits & SWIB_INVISIBLE) )
@@ -590,11 +617,11 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( (nSizeDelta > 0) || pItems[i].mnPixSize )
{
if ( j >= 1 )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
else
{
if ( (j == 0) && (pItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE)) )
- pItems[i].mbSubSize = TRUE;
+ pItems[i].mbSubSize = sal_True;
}
}
}
@@ -691,20 +718,20 @@ static void ImplCalcSet( ImplSplitSet* pSet,
pItems[i].mnOldHeight = pItems[i].mnHeight;
if ( pItems[i].mnBits & SWIB_INVISIBLE )
- bEmpty = TRUE;
+ bEmpty = sal_True;
else
{
- bEmpty = FALSE;
+ bEmpty = sal_False;
if ( bDown )
{
if ( nPos+pItems[i].mnPixSize > nMaxPos )
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
else
{
nPos -= pItems[i].mnPixSize;
if ( nPos < nMaxPos )
- bEmpty = TRUE;
+ bEmpty = sal_True;
}
}
@@ -775,9 +802,9 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// Fixed setzen
for ( i = 0; i < nItems; i++ )
{
- pItems[i].mbFixed = FALSE;
+ pItems[i].mbFixed = sal_False;
if ( pItems[i].mnBits & SWIB_FIXED )
- pItems[i].mbFixed = TRUE;
+ pItems[i].mbFixed = sal_True;
else
{
// Wenn Child-Set vorhanden, ist dieses Item auch Fixed, wenn
@@ -788,7 +815,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
{
if ( pItems[i].mpSet->mpItems[j].mbFixed )
{
- pItems[i].mbFixed = TRUE;
+ pItems[i].mbFixed = sal_True;
break;
}
}
@@ -799,11 +826,11 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide,
- BOOL bRows, BOOL /*bDown*/ )
+void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide,
+ sal_Bool bRows, sal_Bool /*bDown*/ )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
if ( pWindow->IsReallyVisible() && pWindow->IsUpdateMode() && pWindow->mbInvalidate )
@@ -873,9 +900,9 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b
{
if ( pItems[i].mpSet )
{
- BOOL bTempHide = bHide;
+ sal_Bool bTempHide = bHide;
if ( !pItems[i].mnWidth || !pItems[i].mnHeight )
- bTempHide = TRUE;
+ bTempHide = sal_True;
ImplCalcSet2( pWindow, pItems[i].mpSet, bTempHide,
((pItems[i].mnBits & SWIB_COLSET) == 0) );
}
@@ -902,10 +929,10 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b
// -----------------------------------------------------------------------
-static void ImplCalcLogSize( ImplSplitItem* pItems, USHORT nItems )
+static void ImplCalcLogSize( ImplSplitItem* pItems, sal_uInt16 nItems )
{
// Original-Groessen updaten
- USHORT i;
+ sal_uInt16 i;
long nRelSize = 0;
long nPerSize = 0;
for ( i = 0; i < nItems; i++ )
@@ -970,8 +997,8 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect,
void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
{
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
ImplSplitItem* pItems = pSet->mpItems;
// Beim Mainset auch den Hintergrund zeichnen
@@ -1013,20 +1040,20 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet )
// -----------------------------------------------------------------------
static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
- BOOL bRows, BOOL bDown = TRUE )
+ sal_Bool bRows, sal_Bool bDown = sal_True )
{
if ( !pSet->mpItems )
return;
- USHORT i;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nItems = pSet->mnItems;
long nPos;
long nTop;
long nBottom;
ImplSplitItem* pItems = pSet->mpItems;
const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
- BOOL bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
+ sal_Bool bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW;
for ( i = 0; i < nItems-1; i++ )
{
@@ -1107,16 +1134,16 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet,
// -----------------------------------------------------------------------
-USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos,
- BOOL bRows, BOOL /*bDown*/ )
+sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos,
+ sal_Bool bRows, sal_Bool /*bDown*/ )
{
if ( !pSet->mpItems )
return 0;
- USHORT i;
- USHORT nSplitTest;
- USHORT nItems = pSet->mnItems;
+ sal_uInt16 i;
+ sal_uInt16 nSplitTest;
+ sal_uInt16 nItems = pSet->mnItems;
long nMPos1;
long nMPos2;
long nPos;
@@ -1187,8 +1214,8 @@ USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos,
// -----------------------------------------------------------------------
-USHORT SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
- long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos )
+sal_uInt16 SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos,
+ long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos )
{
// Resizeable SplitWindow muss anders behandelt werden
if ( pWindow->mnWinStyle & WB_SIZEABLE )
@@ -1300,7 +1327,7 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle )
pNewSet->mnItems = 0;
pNewSet->mnId = 0;
pNewSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
mpMainSet = pNewSet;
mpBaseSet = pNewSet;
@@ -1321,29 +1348,29 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle )
mnMouseModifier = 0;
mnMStartPos = 0;
mnMSplitPos = 0;
- mbDragFull = FALSE;
- mbHorz = TRUE;
- mbBottomRight = FALSE;
- mbCalc = FALSE;
- mbRecalc = TRUE;
- mbInvalidate = TRUE;
- mbAutoHide = FALSE;
- mbFadeIn = FALSE;
- mbFadeOut = FALSE;
- mbAutoHideIn = FALSE;
- mbAutoHideDown = FALSE;
- mbFadeInDown = FALSE;
- mbFadeOutDown = FALSE;
- mbAutoHidePressed = FALSE;
- mbFadeInPressed = FALSE;
- mbFadeOutPressed = FALSE;
- mbFadeNoButtonMode = FALSE;
- mbNoAlign = FALSE;
+ mbDragFull = sal_False;
+ mbHorz = sal_True;
+ mbBottomRight = sal_False;
+ mbCalc = sal_False;
+ mbRecalc = sal_True;
+ mbInvalidate = sal_True;
+ mbAutoHide = sal_False;
+ mbFadeIn = sal_False;
+ mbFadeOut = sal_False;
+ mbAutoHideIn = sal_False;
+ mbAutoHideDown = sal_False;
+ mbFadeInDown = sal_False;
+ mbFadeOutDown = sal_False;
+ mbAutoHidePressed = sal_False;
+ mbFadeInPressed = sal_False;
+ mbFadeOutPressed = sal_False;
+ mbFadeNoButtonMode = sal_False;
+ mbNoAlign = sal_False;
if ( nStyle & WB_NOSPLITDRAW )
{
pNewSet->mnSplitSize -= 2;
- mbInvalidate = FALSE;
+ mbInvalidate = sal_False;
}
if ( nStyle & WB_BORDER )
@@ -1476,7 +1503,7 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
{
long nCurSize;
long nCalcSize = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1544,7 +1571,7 @@ void SplitWindow::ImplCalcLayout()
{
long nCurSize;
long nCalcSize = 0;
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mpMainSet->mnItems; i++ )
{
@@ -1563,9 +1590,9 @@ void SplitWindow::ImplCalcLayout()
nCurSize -= nSplitSize;
nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize;
- mbRecalc = FALSE;
+ mbRecalc = sal_False;
ImplSetWindowSize( nCalcSize-nCurSize );
- mbRecalc = TRUE;
+ mbRecalc = sal_True;
}
}
@@ -1606,15 +1633,15 @@ void SplitWindow::ImplCalcLayout()
// Sets rekursiv berechnen
ImplCalcSet( mpMainSet, nL, nT, nW, nH, mbHorz, !mbBottomRight );
- ImplCalcSet2( this, mpMainSet, FALSE, mbHorz, !mbBottomRight );
- mbCalc = FALSE;
+ ImplCalcSet2( this, mpMainSet, sal_False, mbHorz, !mbBottomRight );
+ mbCalc = sal_False;
}
// -----------------------------------------------------------------------
void SplitWindow::ImplUpdate()
{
- mbCalc = TRUE;
+ mbCalc = sal_True;
if ( IsReallyShown() && IsUpdateMode() && mbRecalc )
{
@@ -1654,7 +1681,7 @@ void SplitWindow::ImplUpdateSet( ImplSplitSet* pSet )
else
{
ImplSplitItem* pItem;
- USHORT nPos;
+ sal_uInt16 nPos;
pSet = ImplFindItem( mpMainSet, pSet->mnId, nPos );
pItem = &(pSet->mpItems[nPos]);
@@ -1694,7 +1721,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos )
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const
+void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const
{
long nSplitSize = mpMainSet->mnSplitSize-2;
if ( mbAutoHide || mbFadeOut || mbFadeIn )
@@ -1767,7 +1794,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) co
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const
+void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest ) const
{
Rectangle aRect;
@@ -1784,7 +1811,7 @@ void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const
+void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest ) const
{
Rectangle aRect;
@@ -1796,12 +1823,12 @@ void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const
// -----------------------------------------------------------------------
-void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, BOOL ) const
+void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, sal_Bool ) const
{
Rectangle aRect;
if ( mbFadeOut )
- ImplGetButtonRect( aRect, 0, FALSE );
+ ImplGetButtonRect( aRect, 0, sal_False );
rRect = aRect;
}
@@ -1876,7 +1903,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
+void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint )
{
if ( mbAutoHide )
{
@@ -1921,7 +1948,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
}
// Image ermitteln und zurueckgeben
- USHORT nId;
+ sal_uInt16 nId;
if ( mbAutoHidePressed )
{
if ( mbAutoHideIn )
@@ -1953,7 +1980,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft )
+void SplitWindow::ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -2009,14 +2036,14 @@ void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft )
}
}
-void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft )
+void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( rRect.IsInside( GetPointerPosPixel() ) )
{
DrawWallpaper( rRect, Wallpaper( Color( COL_WHITE ) ) );
- DrawSelectionBackground( rRect, 2, FALSE, FALSE, FALSE );
+ DrawSelectionBackground( rRect, 2, sal_False, sal_False, sal_False );
}
if( bHorz )
@@ -2067,7 +2094,7 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft )
}
}
-void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
+void SplitWindow::ImplDrawFadeIn( sal_Bool bInPaint )
{
if ( mbFadeIn )
{
@@ -2075,17 +2102,17 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
Image aImage;
ImplGetFadeInRect( aTempRect );
- BOOL bLeft;
+ sal_Bool bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = TRUE;
+ bLeft = sal_True;
else
- bLeft = TRUE;
+ bLeft = sal_True;
if ( !bInPaint )
Erase( aTempRect );
@@ -2096,7 +2123,7 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint )
// -----------------------------------------------------------------------
-void SplitWindow::ImplDrawFadeOut( BOOL bInPaint )
+void SplitWindow::ImplDrawFadeOut( sal_Bool bInPaint )
{
if ( mbFadeOut )
{
@@ -2104,17 +2131,17 @@ void SplitWindow::ImplDrawFadeOut( BOOL bInPaint )
Image aImage;
ImplGetFadeOutRect( aTempRect );
- BOOL bLeft;
+ sal_Bool bLeft;
if ( meAlign == WINDOWALIGN_TOP )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_BOTTOM )
- bLeft = FALSE;
+ bLeft = sal_False;
else if ( meAlign == WINDOWALIGN_LEFT )
- bLeft = TRUE;
+ bLeft = sal_True;
else if ( meAlign == WINDOWALIGN_RIGHT )
- bLeft = FALSE;
+ bLeft = sal_False;
else
- bLeft = TRUE;
+ bLeft = sal_True;
if ( !bInPaint )
Erase( aTempRect );
@@ -2133,15 +2160,15 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
{
ImplSplitItem* pSplitItem;
long nCurMaxSize;
- USHORT nTemp;
- BOOL bDown;
- BOOL bPropSmaller;
+ sal_uInt16 nTemp;
+ sal_Bool bDown;
+ sal_Bool bPropSmaller;
mnMouseModifier = rMEvt.GetModifier();
if ( !(mnMouseModifier & KEY_SHIFT) || (mnSplitPos+1 >= mpSplitSet->mnItems) )
- bPropSmaller = FALSE;
+ bPropSmaller = sal_False;
else
- bPropSmaller = TRUE;
+ bPropSmaller = sal_True;
// Hier kann noch die maximale Groesse gesetzt werden
StartSplit();
@@ -2159,9 +2186,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
if ( mpSplitSet->mpItems )
{
- bDown = TRUE;
+ bDown = sal_True;
if ( (mpSplitSet == mpMainSet) && mbBottomRight )
- bDown = FALSE;
+ bDown = sal_False;
pSplitItem = &(mpSplitSet->mpItems[mnSplitPos]);
maDragRect.Left() = pSplitItem->mnLeft;
@@ -2292,9 +2319,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
else
{
ImplSplitItem* pItems = mpSplitSet->mpItems;
- USHORT nItems = mpSplitSet->mnItems;
+ sal_uInt16 nItems = mpSplitSet->mnItems;
mpLastSizes = new long[nItems*2];
- for ( USHORT i = 0; i < nItems; i++ )
+ for ( sal_uInt16 i = 0; i < nItems; i++ )
{
mpLastSizes[i*2] = pItems[i].mnSize;
mpLastSizes[i*2+1] = pItems[i].mnPixSize;
@@ -2369,35 +2396,35 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt )
Point aMousePosPixel = rMEvt.GetPosPixel();
Rectangle aTestRect;
- mbFadeNoButtonMode = FALSE;
- ImplGetAutoHideRect( aTestRect, TRUE );
+ mbFadeNoButtonMode = sal_False;
+ ImplGetAutoHideRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbAutoHideDown = TRUE;
- mbAutoHidePressed = TRUE;
- ImplDrawAutoHide( FALSE );
+ mbAutoHideDown = sal_True;
+ mbAutoHidePressed = sal_True;
+ ImplDrawAutoHide( sal_False );
}
else
{
- ImplGetFadeOutRect( aTestRect, TRUE );
+ ImplGetFadeOutRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeOutDown = TRUE;
- mbFadeOutPressed = TRUE;
- ImplDrawFadeOut( FALSE );
+ mbFadeOutDown = sal_True;
+ mbFadeOutPressed = sal_True;
+ ImplDrawFadeOut( sal_False );
}
else
{
- ImplGetFadeInRect( aTestRect, TRUE );
+ ImplGetFadeInRect( aTestRect, sal_True );
if ( aTestRect.IsInside( aMousePosPixel ) )
{
- mbFadeInDown = TRUE;
- mbFadeInPressed = TRUE;
- ImplDrawFadeIn( FALSE );
+ mbFadeInDown = sal_True;
+ mbFadeInPressed = sal_True;
+ ImplDrawFadeIn( sal_False );
}
else if ( !aTestRect.IsEmpty() && !(mnWinStyle & WB_SIZEABLE) )
{
- mbFadeNoButtonMode = TRUE;
+ mbFadeNoButtonMode = sal_True;
FadeIn();
return;
}
@@ -2419,8 +2446,8 @@ void SplitWindow::MouseMove( const MouseEvent& rMEvt )
Point aPos = rMEvt.GetPosPixel();
long nTemp;
ImplSplitSet* pTempSplitSet;
- USHORT nTempSplitPos;
- USHORT nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
+ sal_uInt16 nTempSplitPos;
+ sal_uInt16 nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos );
PointerStyle eStyle = POINTER_ARROW;
Rectangle aAutoHideRect;
Rectangle aFadeInRect;
@@ -2457,30 +2484,30 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbAutoHideDown = FALSE;
+ mbAutoHideDown = sal_False;
if ( mbAutoHidePressed )
{
- mbAutoHidePressed = FALSE;
+ mbAutoHidePressed = sal_False;
if ( !rTEvt.IsTrackingCanceled() )
{
mbAutoHideIn = !mbAutoHideIn;
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
AutoHide();
}
else
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
}
}
else
{
Rectangle aTestRect;
- ImplGetAutoHideRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetAutoHideRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbAutoHidePressed )
{
mbAutoHidePressed = bNewPressed;
- ImplDrawAutoHide( FALSE );
+ ImplDrawAutoHide( sal_False );
}
}
}
@@ -2488,11 +2515,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeInDown = FALSE;
+ mbFadeInDown = sal_False;
if ( mbFadeInPressed )
{
- mbFadeInPressed = FALSE;
- ImplDrawFadeIn( FALSE );
+ mbFadeInPressed = sal_False;
+ ImplDrawFadeIn( sal_False );
if ( !rTEvt.IsTrackingCanceled() )
FadeIn();
@@ -2501,12 +2528,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeInRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ ImplGetFadeInRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
if ( bNewPressed != mbFadeInPressed )
{
mbFadeInPressed = bNewPressed;
- ImplDrawFadeIn( FALSE );
+ ImplDrawFadeIn( sal_False );
}
}
}
@@ -2514,11 +2541,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
{
if ( rTEvt.IsTrackingEnded() )
{
- mbFadeOutDown = FALSE;
+ mbFadeOutDown = sal_False;
if ( mbFadeOutPressed )
{
- mbFadeOutPressed = FALSE;
- ImplDrawFadeOut( FALSE );
+ mbFadeOutPressed = sal_False;
+ ImplDrawFadeOut( sal_False );
if ( !rTEvt.IsTrackingCanceled() )
FadeOut();
@@ -2527,12 +2554,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
Rectangle aTestRect;
- ImplGetFadeOutRect( aTestRect, TRUE );
- BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel );
- if ( bNewPressed == FALSE )
+ ImplGetFadeOutRect( aTestRect, sal_True );
+ sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel );
+ if ( bNewPressed == sal_False )
{
mbFadeOutPressed = bNewPressed;
- ImplDrawFadeOut( FALSE );
+ ImplDrawFadeOut( sal_False );
// We need a mouseevent with a position inside the button for the
// ImplStartSplit function!
@@ -2542,14 +2569,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
aOrgMEvt.GetModifier() );
ImplStartSplit( aNewMEvt );
- mbFadeOutDown = FALSE;
+ mbFadeOutDown = sal_False;
}
}
}
else
{
ImplSplitMousePos( aMousePosPixel );
- BOOL bSplit = TRUE;
+ sal_Bool bSplit = sal_True;
if ( mbDragFull )
{
if ( rTEvt.IsTrackingEnded() )
@@ -2557,8 +2584,8 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
if ( rTEvt.IsTrackingCanceled() )
{
ImplSplitItem* pItems = mpSplitSet->mpItems;
- USHORT nItems = mpSplitSet->mnItems;
- for ( USHORT i = 0; i < nItems; i++ )
+ sal_uInt16 nItems = mpSplitSet->mnItems;
+ for ( sal_uInt16 i = 0; i < nItems; i++ )
{
pItems[i].mnSize = mpLastSizes[i*2];
pItems[i].mnPixSize = mpLastSizes[i*2+1];
@@ -2566,7 +2593,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
ImplUpdate();
Split();
}
- bSplit = FALSE;
+ bSplit = sal_False;
}
}
else
@@ -2579,14 +2606,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
else
{
ImplDrawSplitTracking( this, aMousePosPixel );
- bSplit = FALSE;
+ bSplit = sal_False;
}
}
if ( bSplit )
{
- BOOL bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? TRUE : FALSE;
- BOOL bPropGreater = (mnMouseModifier & KEY_MOD1) ? TRUE : FALSE;
+ sal_Bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? sal_True : sal_False;
+ sal_Bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? sal_True : sal_False;
long nDelta = mnMSplitPos-mnMStartPos;
if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems )
@@ -2670,9 +2697,9 @@ void SplitWindow::Paint( const Rectangle& )
ImplDrawBorder( this );
ImplDrawBorderLine( this );
- ImplDrawFadeOut( TRUE );
- ImplDrawFadeIn( TRUE );
- ImplDrawAutoHide( TRUE );
+ ImplDrawFadeOut( sal_True );
+ ImplDrawFadeIn( sal_True );
+ ImplDrawAutoHide( sal_True );
// FrameSet-Hintergruende zeichnen
ImplDrawBack( this, mpMainSet );
@@ -2710,9 +2737,9 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
{
Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
Rectangle aHelpRect;
- USHORT nHelpResId = 0;
+ sal_uInt16 nHelpResId = 0;
- ImplGetAutoHideRect( aHelpRect, TRUE );
+ ImplGetAutoHideRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
{
if ( mbAutoHideIn )
@@ -2722,12 +2749,12 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- ImplGetFadeInRect( aHelpRect, TRUE );
+ ImplGetFadeInRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEIN;
else
{
- ImplGetFadeOutRect( aHelpRect, TRUE );
+ ImplGetFadeOutRect( aHelpRect, sal_True );
if ( aHelpRect.IsInside( aMousePosPixel ) )
nHelpResId = SV_HELPTEXT_FADEOUT;
}
@@ -2798,17 +2825,17 @@ void SplitWindow::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
- USHORT nPos, USHORT nSetId,
+void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize,
+ sal_uInt16 nPos, sal_uInt16 nSetId,
SplitWindowItemBits nBits )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindSet( mpMainSet, nSetId ), "SplitWindow::InsertItem() - Set not exists" );
DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" );
#endif
- // Size muss min. 1 sein
+ // Size has to be at least 1.
if ( nSize < 1 )
nSize = 1;
@@ -2816,7 +2843,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
ImplSplitSet* pNewSet;
ImplSplitItem* pItem;
- // Platz fuer neues Item schaffen
+ // Make room for the new item.
if ( nPos > pSet->mnItems )
nPos = pSet->mnItems;
ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1];
@@ -2827,21 +2854,23 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
delete[] pSet->mpItems;
pSet->mpItems = pNewItems;
pSet->mnItems++;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
- // Item anlegen und erweitern
+ // Create and initialize item.
pItem = &(pSet->mpItems[nPos]);
memset( pItem, 0, sizeof( ImplSplitItem ) );
pItem->mnSize = nSize;
pItem->mnId = nId;
pItem->mnBits = nBits;
+ pItem->mnMinSize=-1;
+ pItem->mnMaxSize=-1;
if ( pWindow )
{
pItem->mpWindow = pWindow;
pItem->mpOrgParent = pWindow->GetParent();
- // Window mit SplitWindow verbinden
+ // Attach window to SplitWindow.
pWindow->Hide();
pWindow->SetParent( this );
}
@@ -2855,7 +2884,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
pNewSet->mnItems = 0;
pNewSet->mnId = nId;
pNewSet->mnSplitSize = pSet->mnSplitSize;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
pItem->mpSet = pNewSet;
}
@@ -2865,8 +2894,8 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::InsertItem( USHORT nId, long nSize,
- USHORT nPos, USHORT nSetId,
+void SplitWindow::InsertItem( sal_uInt16 nId, long nSize,
+ sal_uInt16 nPos, sal_uInt16 nSetId,
SplitWindowItemBits nBits )
{
InsertItem( nId, NULL, nSize, nPos, nSetId, nBits );
@@ -2874,15 +2903,15 @@ void SplitWindow::InsertItem( USHORT nId, long nSize,
// -----------------------------------------------------------------------
-void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
+void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::MoveItem() - Id not found" );
DBG_ASSERT( ImplFindSet( mpMainSet, nNewSetId ), "SplitWindow::MoveItem() - Set not exists" );
#endif
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId );
ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
ImplSplitItem aTempItem;
@@ -2915,7 +2944,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
nNewPos = pNewSet->mnItems;
memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) );
pSet->mnItems--;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -2937,7 +2966,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
delete[] pNewSet->mpItems;
pNewSet->mpItems = pNewItems;
pNewSet->mnItems++;
- pNewSet->mbCalcPix = TRUE;
+ pNewSet->mbCalcPix = sal_True;
memcpy( &(pNewSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) );
ImplUpdate();
}
@@ -2945,15 +2974,15 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
// -----------------------------------------------------------------------
-void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
+void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide )
{
#ifdef DBG_UTIL
- USHORT nDbgDummy;
+ sal_uInt16 nDbgDummy;
DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::RemoveItem() - Id not found" );
#endif
// Set suchen
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos );
ImplSplitItem* pItem = &(pSet->mpItems[nPos]);
Window* pWindow = pItem->mpWindow;
@@ -2965,7 +2994,7 @@ void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
// Item entfernen
pSet->mnItems--;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
if ( pSet->mnItems )
{
memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1,
@@ -3007,7 +3036,7 @@ void SplitWindow::Clear()
mpMainSet->mnItems = 0;
mpMainSet->mnId = 0;
mpMainSet->mnSplitSize = SPLITWIN_SPLITSIZE;
- mpMainSet->mbCalcPix = TRUE;
+ mpMainSet->mbCalcPix = sal_True;
if ( mnWinStyle & WB_NOSPLITDRAW )
mpMainSet->mnSplitSize -= 2;
mpBaseSet = mpMainSet;
@@ -3018,22 +3047,22 @@ void SplitWindow::Clear()
// -----------------------------------------------------------------------
-void SplitWindow::SetBaseSet( USHORT nSetId )
+void SplitWindow::SetBaseSet( sal_uInt16 nSetId )
{
mpBaseSet = ImplFindSet( mpMainSet, nSetId );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetBaseSet() const
+sal_uInt16 SplitWindow::GetBaseSet() const
{
return mpBaseSet->mnId;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize,
- BOOL bWithChilds )
+void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize,
+ sal_Bool bWithChilds )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3048,7 +3077,7 @@ void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize,
// -----------------------------------------------------------------------
-long SplitWindow::GetSplitSize( USHORT nSetId ) const
+long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
@@ -3059,7 +3088,7 @@ long SplitWindow::GetSplitSize( USHORT nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( USHORT nSetId )
+void SplitWindow::SetItemBackground( sal_uInt16 nSetId )
{
Wallpaper aWall;
SetItemBackground( nSetId, aWall );
@@ -3067,13 +3096,13 @@ void SplitWindow::SetItemBackground( USHORT nSetId )
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper )
+void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( rWallpaper.GetStyle() == WALLPAPER_NULL )
{
@@ -3083,12 +3112,12 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper
pSet->mpWallpaper = NULL;
}
else
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = TRUE;
+ mbInvalidate = sal_True;
if ( !pSet->mpWallpaper )
pSet->mpWallpaper = new Wallpaper( rWallpaper );
@@ -3107,7 +3136,7 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper
// -----------------------------------------------------------------------
-Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const
+Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3122,25 +3151,25 @@ Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const
// -----------------------------------------------------------------------
-BOOL SplitWindow::IsItemBackground( USHORT nSetId ) const
+sal_Bool SplitWindow::IsItemBackground( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet && pSet->mpWallpaper )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
+void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap )
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
if ( pSet )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( !rBitmap )
{
@@ -3150,12 +3179,12 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
pSet->mpBitmap = NULL;
}
else
- bUpdate = FALSE;
+ bUpdate = sal_False;
}
else
{
// Ab jetzt muss immer invalidiert werden
- mbInvalidate = TRUE;
+ mbInvalidate = sal_True;
if ( !pSet->mpBitmap )
pSet->mpBitmap = new Bitmap( rBitmap );
@@ -3174,7 +3203,7 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const
+Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId );
@@ -3189,15 +3218,15 @@ Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const
// -----------------------------------------------------------------------
-void SplitWindow::SplitItem( USHORT nId, long nNewSize,
- BOOL bPropSmall, BOOL bPropGreat )
+void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize,
+ sal_Bool bPropSmall, sal_Bool bPropGreat )
{
- USHORT nItems;
- USHORT nPos;
- USHORT nMin;
- USHORT nMax;
- USHORT i;
- USHORT n;
+ sal_uInt16 nItems;
+ sal_uInt16 nPos;
+ sal_uInt16 nMin;
+ sal_uInt16 nMax;
+ sal_uInt16 i;
+ sal_uInt16 n;
long nDelta;
long nTempDelta;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
@@ -3209,6 +3238,10 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
nItems = pSet->mnItems;
pItems = pSet->mpItems;
+ // When there is an explicit minimum or maximum size then move nNewSize
+ // into that range (when it is not yet already in it.)
+ nNewSize = ValidateSize(nNewSize, pItems[nPos]);
+
if ( mbCalc )
{
pItems[nPos].mnSize = nNewSize;
@@ -3234,8 +3267,8 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
}
// Wenn das Fenster sizeable ist, wird das TopSet anders behandelt
- BOOL bSmall = TRUE;
- BOOL bGreat = TRUE;
+ sal_Bool bSmall = sal_True;
+ sal_Bool bGreat = sal_True;
if ( (pSet == mpMainSet) && (mnWinStyle & WB_SIZEABLE) )
{
if ( nPos < pSet->mnItems-1 )
@@ -3245,29 +3278,29 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
((nDelta < 0) && bPropGreat)) )
{
if ( nDelta < 0 )
- bGreat = FALSE;
+ bGreat = sal_False;
else
- bSmall = FALSE;
+ bSmall = sal_False;
}
}
else
{
if ( nDelta < 0 )
- bGreat = FALSE;
+ bGreat = sal_False;
else
- bSmall = FALSE;
+ bSmall = sal_False;
}
}
else if ( nPos >= nMax )
{
- bSmall = FALSE;
- bGreat = FALSE;
+ bSmall = sal_False;
+ bGreat = sal_False;
}
else if ( nPos && (nPos >= pSet->mnItems-1) )
{
nPos--;
nDelta *= -1;
- BOOL bTemp = bPropSmall;
+ sal_Bool bTemp = bPropSmall;
bPropSmall = bPropGreat;
bPropGreat = bTemp;
}
@@ -3420,9 +3453,9 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize,
// -----------------------------------------------------------------------
-void SplitWindow::SetItemSize( USHORT nId, long nNewSize )
+void SplitWindow::SetItemSize( sal_uInt16 nId, long nNewSize )
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
ImplSplitItem* pItem;
@@ -3435,16 +3468,16 @@ void SplitWindow::SetItemSize( USHORT nId, long nNewSize )
{
// Neue Groesse setzen und neu durchrechnen
pItem->mnSize = nNewSize;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( USHORT nId ) const
+long SplitWindow::GetItemSize( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3455,9 +3488,9 @@ long SplitWindow::GetItemSize( USHORT nId ) const
// -----------------------------------------------------------------------
-long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
+long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3471,9 +3504,9 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
long nRelSize = 0;
long nPerSize = 0;
ImplSplitItem* pItems;
- USHORT nItems;
+ sal_uInt16 nItems;
SplitWindowItemBits nTempBits;
- USHORT i;
+ sal_uInt16 i;
nItems = pSet->mnItems;
pItems = pSet->mpItems;
for ( i = 0; i < nItems; i++ )
@@ -3510,11 +3543,41 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const
return 0;
}
+
+
+
+void SplitWindow::SetItemSizeRange (sal_uInt16 nId, const Range aRange)
+{
+ sal_uInt16 nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ {
+ pSet->mpItems[nPos].mnMinSize = aRange.Min();
+ pSet->mpItems[nPos].mnMaxSize = aRange.Max();
+ }
+}
+
+
+
+
+Range SplitWindow::GetItemSizeRange (sal_uInt16 nId) const
+{
+ sal_uInt16 nPos;
+ ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos);
+
+ if (pSet != NULL)
+ return Range (pSet->mpItems[nPos].mnMinSize, pSet->mpItems[nPos].mnMaxSize);
+ else
+ return Range(-1,-1);
+}
+
+
// -----------------------------------------------------------------------
-void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
+void SplitWindow::SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits )
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
ImplSplitItem* pItem;
@@ -3529,16 +3592,16 @@ void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits )
{
// Neue Bits setzen und neu durchrechnen
pItem->mnBits = nNewBits;
- pSet->mbCalcPix = TRUE;
+ pSet->mbCalcPix = sal_True;
ImplUpdate();
}
}
// -----------------------------------------------------------------------
-SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const
+SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3549,9 +3612,9 @@ SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const
// -----------------------------------------------------------------------
-Window* SplitWindow::GetItemWindow( USHORT nId ) const
+Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3562,9 +3625,9 @@ Window* SplitWindow::GetItemWindow( USHORT nId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetSet( USHORT nId ) const
+sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
@@ -3575,55 +3638,55 @@ USHORT SplitWindow::GetSet( USHORT nId ) const
// -----------------------------------------------------------------------
-BOOL SplitWindow::GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) const
+sal_Bool SplitWindow::GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const
{
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, rPos );
if ( pSet )
{
rSetId = pSet->mnId;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL SplitWindow::IsItemValid( USHORT nId ) const
+sal_Bool SplitWindow::IsItemValid( sal_uInt16 nId ) const
{
- USHORT nPos;
+ sal_uInt16 nPos;
ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos );
if ( pSet )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( Window* pWindow ) const
+sal_uInt16 SplitWindow::GetItemId( Window* pWindow ) const
{
return ImplFindItem( mpBaseSet, pWindow );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( const Point& rPos ) const
+sal_uInt16 SplitWindow::GetItemId( const Point& rPos ) const
{
return ImplFindItem( mpBaseSet, rPos, mbHorz, !mbBottomRight );
}
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
- USHORT nPos = SPLITWINDOW_ITEM_NOTFOUND;
+ sal_uInt16 nPos = SPLITWINDOW_ITEM_NOTFOUND;
if ( pSet )
{
- for ( USHORT i = 0; i < pSet->mnItems; i++ )
+ for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ )
{
if ( pSet->mpItems[i].mnId == nId )
{
@@ -3638,7 +3701,7 @@ USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet && (nPos < pSet->mnItems) )
@@ -3649,7 +3712,7 @@ USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const
// -----------------------------------------------------------------------
-USHORT SplitWindow::GetItemCount( USHORT nSetId ) const
+sal_uInt16 SplitWindow::GetItemCount( sal_uInt16 nSetId ) const
{
ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId );
if ( pSet )
@@ -3664,28 +3727,28 @@ void SplitWindow::ImplNewAlign()
{
if ( mbNoAlign )
{
- mbHorz = FALSE;
- mbBottomRight = FALSE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_TOP )
{
- mbHorz = TRUE;
- mbBottomRight = FALSE;
+ mbHorz = sal_True;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_BOTTOM )
{
- mbHorz = TRUE;
- mbBottomRight = TRUE;
+ mbHorz = sal_True;
+ mbBottomRight = sal_True;
}
else if ( meAlign == WINDOWALIGN_LEFT )
{
- mbHorz = FALSE;
- mbBottomRight = FALSE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_False;
}
else if ( meAlign == WINDOWALIGN_RIGHT )
{
- mbHorz = FALSE;
- mbBottomRight = TRUE;
+ mbHorz = sal_False;
+ mbBottomRight = sal_True;
}
if ( mnWinStyle & WB_BORDER )
@@ -3701,7 +3764,7 @@ void SplitWindow::ImplNewAlign()
// -----------------------------------------------------------------------
-void SplitWindow::SetNoAlign( BOOL bNoAlign )
+void SplitWindow::SetNoAlign( sal_Bool bNoAlign )
{
bNoAlign = bNoAlign != 0;
if ( mbNoAlign != bNoAlign )
@@ -3725,7 +3788,7 @@ void SplitWindow::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
- WinBits nWinStyle, BOOL bExtra )
+ WinBits nWinStyle, sal_Bool bExtra )
{
long nLeft;
long nTop;
@@ -3733,7 +3796,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
long nBottom;
Size aSize = rSize;
- ImplCalcBorder( eAlign, FALSE, nLeft, nTop, nRight, nBottom );
+ ImplCalcBorder( eAlign, sal_False, nLeft, nTop, nRight, nBottom );
aSize.Width() += nLeft+nRight;
aSize.Height() += nTop+nBottom;
@@ -3758,7 +3821,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign,
// -----------------------------------------------------------------------
-void SplitWindow::ShowAutoHideButton( BOOL bShow )
+void SplitWindow::ShowAutoHideButton( sal_Bool bShow )
{
mbAutoHide = bShow;
ImplUpdate();
@@ -3766,7 +3829,7 @@ void SplitWindow::ShowAutoHideButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeInHideButton( BOOL bShow )
+void SplitWindow::ShowFadeInHideButton( sal_Bool bShow )
{
mbFadeIn = bShow;
ImplUpdate();
@@ -3774,7 +3837,7 @@ void SplitWindow::ShowFadeInHideButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::ShowFadeOutButton( BOOL bShow )
+void SplitWindow::ShowFadeOutButton( sal_Bool bShow )
{
mbFadeOut = bShow;
ImplUpdate();
@@ -3782,7 +3845,7 @@ void SplitWindow::ShowFadeOutButton( BOOL bShow )
// -----------------------------------------------------------------------
-void SplitWindow::SetAutoHideState( BOOL bAutoHide )
+void SplitWindow::SetAutoHideState( sal_Bool bAutoHide )
{
mbAutoHideIn = bAutoHide;
if ( IsReallyVisible() )
@@ -3812,7 +3875,7 @@ long SplitWindow::GetFadeInSize() const
Rectangle SplitWindow::GetAutoHideRect() const
{
Rectangle aRect;
- ImplGetAutoHideRect( aRect, TRUE );
+ ImplGetAutoHideRect( aRect, sal_True );
return aRect;
}
@@ -3821,7 +3884,7 @@ Rectangle SplitWindow::GetAutoHideRect() const
Rectangle SplitWindow::GetFadeInRect() const
{
Rectangle aRect;
- ImplGetFadeInRect( aRect, TRUE );
+ ImplGetFadeInRect( aRect, sal_True );
return aRect;
}
@@ -3830,7 +3893,7 @@ Rectangle SplitWindow::GetFadeInRect() const
Rectangle SplitWindow::GetFadeOutRect() const
{
Rectangle aRect;
- ImplGetFadeOutRect( aRect, TRUE );
+ ImplGetFadeOutRect( aRect, sal_True );
return aRect;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 924cb837545c..9280bb25b80c 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -78,7 +78,7 @@ StatusBar::ImplData::~ImplData()
struct ImplStatusItem
{
- USHORT mnId;
+ sal_uInt16 mnId;
StatusBarItemBits mnBits;
long mnWidth;
long mnOffset;
@@ -87,16 +87,16 @@ struct ImplStatusItem
XubString maText;
XubString maHelpText;
XubString maQuickHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
void* mpUserData;
- BOOL mbVisible;
+ sal_Bool mbVisible;
XubString maAccessibleName;
XubString maCommand;
};
// =======================================================================
-inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
+inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize )
{
return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2));
}
@@ -104,7 +104,7 @@ inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
// -----------------------------------------------------------------------
static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
long nX;
long nY;
@@ -124,12 +124,12 @@ static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize,
// -----------------------------------------------------------------------
-BOOL StatusBar::ImplIsItemUpdate()
+sal_Bool StatusBar::ImplIsItemUpdate()
{
if ( !mbProgressMode && mbVisibleItems && IsReallyVisible() && IsUpdateMode() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -148,11 +148,11 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle )
mpItemList = new ImplStatusItemList;
mpImplData->mpVirDev = new VirtualDevice( *this );
mnCurItemId = 0;
- mbFormat = TRUE;
- mbVisibleItems = TRUE;
- mbProgressMode = FALSE;
- mbInUserDraw = FALSE;
- mbBottomBorder = FALSE;
+ mbFormat = sal_True;
+ mbVisibleItems = sal_True;
+ mbProgressMode = sal_False;
+ mbInUserDraw = sal_False;
+ mbBottomBorder = sal_False;
mnItemsWidth = STATUSBAR_OFFSET_X;
mnDX = 0;
mnDY = 0;
@@ -160,7 +160,7 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle )
mnItemY = STATUSBAR_OFFSET_Y;
mnTextY = STATUSBAR_OFFSET_TEXTY;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
SetLineColor();
SetOutputSizePixel( CalcWindowSizePixel() );
@@ -205,8 +205,8 @@ StatusBar::~StatusBar()
// -----------------------------------------------------------------------
-void StatusBar::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void StatusBar::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -253,7 +253,7 @@ void StatusBar::ImplInitSettings( BOOL bFont,
IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) )
{
ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW;
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
}
}
@@ -266,7 +266,7 @@ void StatusBar::ImplFormat()
long nExtraWidth;
long nExtraWidth2;
long nX;
- USHORT nAutoSizeItems = 0;
+ sal_uInt16 nAutoSizeItems = 0;
// Breiten zusammenrechnen
mnItemsWidth = STATUSBAR_OFFSET_X;
@@ -309,6 +309,8 @@ void StatusBar::ImplFormat()
nExtraWidth2 = 0;
}
nX = STATUSBAR_OFFSET_X;
+ if( ImplHasMirroredGraphics() && IsRTLEnabled() )
+ nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
}
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
@@ -329,12 +331,12 @@ void StatusBar::ImplFormat()
}
}
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
-Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
+Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
{
Rectangle aRect;
ImplStatusItem* pItem;
@@ -357,7 +359,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::ImplGetFirstVisiblePos() const
+sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
{
ImplStatusItem* pItem;
@@ -367,7 +369,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const
if ( pItem )
{
if ( pItem->mbVisible )
- return USHORT(nPos);
+ return sal_uInt16(nPos);
}
}
@@ -376,7 +378,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
+void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth )
{
// Das ueberschreiben der Item-Box verhindern
Rectangle aTextRect;
@@ -390,7 +392,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
{
// Position ermitteln
XubString aStr = GetText();
- USHORT nPos = aStr.Search( _LF );
+ sal_uInt16 nPos = aStr.Search( _LF );
if ( nPos != STRING_NOTFOUND )
aStr.Erase( nPos );
@@ -413,7 +415,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame )
+void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame )
{
Rectangle aRect = ImplGetItemRectPos( nPos );
@@ -455,12 +457,12 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
{
if ( bOffScreen )
{
- mbInUserDraw = TRUE;
+ mbInUserDraw = sal_True;
mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() );
UserDrawEvent aODEvt( mpImplData->mpVirDev, Rectangle( Point(), aTextRectSize ), pItem->mnId );
UserDraw( aODEvt );
- mpImplData->mpVirDev->EnableRTL( FALSE );
- mbInUserDraw = FALSE;
+ mpImplData->mpVirDev->EnableRTL( sal_False );
+ mbInUserDraw = sal_False;
}
else
{
@@ -481,7 +483,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
{
if( !(pItem->mnBits & SIB_FLAT) )
{
- USHORT nStyle;
+ sal_uInt16 nStyle;
if ( pItem->mnBits & SIB_IN )
nStyle = FRAME_DRAW_IN;
@@ -515,7 +517,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
void DrawProgress( Window* pWindow, const Point& rPos,
long nOffset, long nPrgsWidth, long nPrgsHeight,
- USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
const Rectangle& rFramePosSize
)
{
@@ -553,7 +555,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
pWindow->Push( PUSH_CLIPREGION );
pWindow->IntersectClipRegion( rFramePosSize );
}
- BOOL bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
+ sal_Bool bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString() );
if( bNeedErase )
pWindow->Pop();
@@ -565,8 +567,8 @@ void DrawProgress( Window* pWindow, const Point& rPos,
}
// Werte vorberechnen
- USHORT nPerc1 = nPercent1 / nPercentCount;
- USHORT nPerc2 = nPercent2 / nPercentCount;
+ sal_uInt16 nPerc1 = nPercent1 / nPercentCount;
+ sal_uInt16 nPerc2 = nPercent2 / nPercentCount;
if ( nPerc1 > nPerc2 )
{
@@ -631,8 +633,8 @@ void DrawProgress( Window* pWindow, const Point& rPos,
// -----------------------------------------------------------------------
-void StatusBar::ImplDrawProgress( BOOL bPaint,
- USHORT nPercent1, USHORT nPercent2 )
+void StatusBar::ImplDrawProgress( sal_Bool bPaint,
+ sal_uInt16 nPercent1, sal_uInt16 nPercent2 )
{
bool bNative = IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL );
// bPaint: draw text also, else only update progress
@@ -675,7 +677,7 @@ void StatusBar::ImplCalcProgressRect()
// calculate size of progress rects
mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2);
- USHORT nMaxPercent = STATUSBAR_PRGS_COUNT;
+ sal_uInt16 nMaxPercent = STATUSBAR_PRGS_COUNT;
long nMaxWidth = mnDX-STATUSBAR_OFFSET-1;
@@ -690,7 +692,7 @@ void StatusBar::ImplCalcProgressRect()
// save the divisor for later
mnPercentCount = 10000 / nMaxPercent;
- BOOL bNativeOK = FALSE;
+ sal_Bool bNativeOK = sal_False;
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
@@ -698,7 +700,7 @@ void StatusBar::ImplCalcProgressRect()
Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) ) != sal_False )
{
long nProgressHeight = aNativeControlRegion.GetHeight();
if( nProgressHeight > maPrgsFrameRect.GetHeight() )
@@ -730,7 +732,7 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
{
ImplStatusItem* pItem = (*mpItemList)[ i ];
// Ist es dieses Item
- if ( ImplGetItemRectPos( USHORT(i) ).IsInside( aMousePos ) )
+ if ( ImplGetItemRectPos( sal_uInt16(i) ).IsInside( aMousePos ) )
{
mnCurItemId = pItem->mnId;
if ( rMEvt.GetClicks() == 2 )
@@ -760,22 +762,22 @@ void StatusBar::Paint( const Rectangle& )
if ( mbFormat )
ImplFormat();
- USHORT nItemCount = USHORT( mpItemList->size() );
+ sal_uInt16 nItemCount = sal_uInt16( mpItemList->size() );
if ( mbProgressMode )
- ImplDrawProgress( TRUE, 0, mnPercent );
+ ImplDrawProgress( sal_True, 0, mnPercent );
else
{
// Text zeichen
if ( !mbVisibleItems || (GetStyle() & WB_RIGHT) )
- ImplDrawText( FALSE, 0 );
+ ImplDrawText( sal_False, 0 );
// Items zeichnen
if ( mbVisibleItems )
{
// Items zeichnen
- for ( USHORT i = 0; i < nItemCount; i++ )
- ImplDrawItem( FALSE, i, TRUE, TRUE );
+ for ( sal_uInt16 i = 0; i < nItemCount; i++ )
+ ImplDrawItem( sal_False, i, sal_True, sal_True );
}
}
@@ -812,7 +814,7 @@ void StatusBar::Resize()
{
// Breite und Hoehe abfragen und merken
Size aSize = GetOutputSizePixel();
- mnDX = aSize.Width();
+ mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
mnDY = aSize.Height();
mnCalcHeight = mnDY;
// subtract border
@@ -829,7 +831,7 @@ void StatusBar::Resize()
mnTextY += 2;
// Formatierung neu ausloesen
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( mbProgressMode )
ImplCalcProgressRect();
@@ -845,7 +847,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
if( rHEvt.KeyboardActivated() )
return;
- USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( nItemId )
{
@@ -883,9 +885,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -893,8 +895,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -917,18 +919,18 @@ void StatusBar::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, FALSE, FALSE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
}
@@ -947,8 +949,8 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt )
)
)
{
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
long nFudge = GetTextHeight() / 4;
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
@@ -990,9 +992,9 @@ void StatusBar::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
+void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
StatusBarItemBits nBits,
- long nOffset, USHORT nPos )
+ long nOffset, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "StatusBar::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == STATUSBAR_ITEM_NOTFOUND,
@@ -1011,9 +1013,8 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
pItem->mnBits = nBits;
pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
pItem->mnOffset = nOffset;
- pItem->mnHelpId = 0;
pItem->mpUserData = 0;
- pItem->mbVisible = TRUE;
+ pItem->mbVisible = sal_True;
// Item in die Liste einfuegen
if ( nPos < mpItemList->size() ) {
@@ -1022,7 +1023,7 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
mpItemList->push_back( pItem );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1031,15 +1032,15 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
// -----------------------------------------------------------------------
-void StatusBar::RemoveItem( USHORT nItemId )
+void StatusBar::RemoveItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
delete (*mpItemList)[ nPos ];
mpItemList->erase( mpItemList->begin() + nPos );
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1049,18 +1050,18 @@ void StatusBar::RemoveItem( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::ShowItem( USHORT nItemId )
+void StatusBar::ShowItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( !pItem->mbVisible )
{
- pItem->mbVisible = TRUE;
+ pItem->mbVisible = sal_True;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1071,18 +1072,18 @@ void StatusBar::ShowItem( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::HideItem( USHORT nItemId )
+void StatusBar::HideItem( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mbVisible )
{
- pItem->mbVisible = FALSE;
+ pItem->mbVisible = sal_False;
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1093,14 +1094,14 @@ void StatusBar::HideItem( USHORT nItemId )
// -----------------------------------------------------------------------
-BOOL StatusBar::IsItemVisible( USHORT nItemId ) const
+sal_Bool StatusBar::IsItemVisible( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mbVisible;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1109,7 +1110,7 @@ void StatusBar::ShowItems()
{
if ( !mbVisibleItems )
{
- mbVisibleItems = TRUE;
+ mbVisibleItems = sal_True;
if ( !mbProgressMode )
Invalidate();
@@ -1123,7 +1124,7 @@ void StatusBar::HideItems()
{
if ( mbVisibleItems )
{
- mbVisibleItems = FALSE;
+ mbVisibleItems = sal_False;
if ( !mbProgressMode )
Invalidate();
@@ -1146,7 +1147,7 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar )
mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
}
@@ -1161,7 +1162,7 @@ void StatusBar::Clear()
}
mpItemList->clear();
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( ImplIsItemUpdate() )
Invalidate();
@@ -1170,14 +1171,14 @@ void StatusBar::Clear()
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemCount() const
+sal_uInt16 StatusBar::GetItemCount() const
{
- return (USHORT)mpItemList->size();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemId( USHORT nPos ) const
+sal_uInt16 StatusBar::GetItemId( sal_uInt16 nPos ) const
{
if ( nPos < mpItemList->size() )
return (*mpItemList)[ nPos ]->mnId;
@@ -1186,11 +1187,11 @@ USHORT StatusBar::GetItemId( USHORT nPos ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemPos( USHORT nItemId ) const
+sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const
{
for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
if ( (*mpItemList)[ i ]->mnId == nItemId ) {
- return USHORT( i );
+ return sal_uInt16( i );
}
}
@@ -1199,12 +1200,12 @@ USHORT StatusBar::GetItemPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-USHORT StatusBar::GetItemId( const Point& rPos ) const
+sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const
{
if ( AreItemsVisible() && !mbFormat )
{
- USHORT nItemCount = GetItemCount();
- USHORT nPos;
+ sal_uInt16 nItemCount = GetItemCount();
+ sal_uInt16 nPos;
for ( nPos = 0; nPos < nItemCount; nPos++ )
{
// Rechteck holen
@@ -1219,13 +1220,13 @@ USHORT StatusBar::GetItemId( const Point& rPos ) const
// -----------------------------------------------------------------------
-Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
+Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const
{
Rectangle aRect;
if ( AreItemsVisible() && !mbFormat )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen und Rahmen abziehen
@@ -1244,11 +1245,11 @@ Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
// -----------------------------------------------------------------------
-Point StatusBar::GetItemTextPos( USHORT nItemId ) const
+Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const
{
if ( !mbFormat )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen
@@ -1274,9 +1275,9 @@ Point StatusBar::GetItemTextPos( USHORT nItemId ) const
// -----------------------------------------------------------------------
-ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
+sal_uLong StatusBar::GetItemWidth( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnWidth;
@@ -1286,9 +1287,9 @@ ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
// -----------------------------------------------------------------------
-StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
+StatusBarItemBits StatusBar::GetItemBits( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnBits;
@@ -1298,9 +1299,9 @@ StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-long StatusBar::GetItemOffset( USHORT nItemId ) const
+long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mnOffset;
@@ -1310,9 +1311,9 @@ long StatusBar::GetItemOffset( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1338,7 +1339,7 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
if ( pItem->mbVisible && !mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( TRUE, nPos, TRUE, FALSE );
+ ImplDrawItem( sal_True, nPos, sal_True, sal_False );
Flush();
}
}
@@ -1347,9 +1348,9 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemText( USHORT nItemId ) const
+const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maText;
@@ -1359,9 +1360,9 @@ const XubString& StatusBar::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
+void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1374,9 +1375,9 @@ void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetItemCommand( USHORT nItemId )
+const XubString& StatusBar::GetItemCommand( sal_uInt16 nItemId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maCommand;
@@ -1386,9 +1387,9 @@ const XubString& StatusBar::GetItemCommand( USHORT nItemId )
// -----------------------------------------------------------------------
-void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
+void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1400,7 +1401,7 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
!mbFormat && ImplIsItemUpdate() )
{
Update();
- ImplDrawItem( TRUE, nPos, FALSE, FALSE );
+ ImplDrawItem( sal_True, nPos, sal_False, sal_False );
Flush();
}
}
@@ -1408,9 +1409,9 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* StatusBar::GetItemData( USHORT nItemId ) const
+void* StatusBar::GetItemData( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->mpUserData;
@@ -1420,9 +1421,9 @@ void* StatusBar::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maHelpText = rText;
@@ -1430,22 +1431,22 @@ void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
+const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1457,9 +1458,9 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
+void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
(*mpItemList)[ nPos ]->maQuickHelpText = rText;
@@ -1467,9 +1468,9 @@ void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
+const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1482,24 +1483,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void StatusBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG StatusBar::GetHelpId( USHORT nItemId ) const
+rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return (*mpItemList)[ nPos ]->mnHelpId;
+ {
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
+ }
- return 0;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1516,11 +1524,11 @@ void StatusBar::ImplCalcBorder( )
}
if ( IsBottomBorder() )
mnCalcHeight -= 2;
- mbFormat = TRUE;
+ mbFormat = sal_True;
Invalidate();
}
-void StatusBar::SetBottomBorder( BOOL bBottomBorder )
+void StatusBar::SetBottomBorder( sal_Bool bBottomBorder )
{
if ( mbBottomBorder != bBottomBorder )
{
@@ -1529,7 +1537,7 @@ void StatusBar::SetBottomBorder( BOOL bBottomBorder )
}
}
-void StatusBar::SetTopBorder( BOOL bTopBorder )
+void StatusBar::SetTopBorder( sal_Bool bTopBorder )
{
if ( mpImplData->mbTopBorder != static_cast<bool>(bTopBorder) )
{
@@ -1538,7 +1546,7 @@ void StatusBar::SetTopBorder( BOOL bTopBorder )
}
}
-BOOL StatusBar::IsTopBorder() const
+sal_Bool StatusBar::IsTopBorder() const
{
return mpImplData->mbTopBorder;
}
@@ -1549,7 +1557,7 @@ void StatusBar::StartProgressMode( const XubString& rText )
{
DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" );
- mbProgressMode = TRUE;
+ mbProgressMode = sal_True;
mnPercent = 0;
maPrgsTxt = rText;
@@ -1573,7 +1581,7 @@ void StatusBar::StartProgressMode( const XubString& rText )
// -----------------------------------------------------------------------
-void StatusBar::SetProgressValue( USHORT nNewPercent )
+void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
{
DBG_ASSERT( mbProgressMode, "StatusBar::SetProgressValue(): no progrss mode" );
DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
@@ -1584,7 +1592,7 @@ void StatusBar::SetProgressValue( USHORT nNewPercent )
{
Update();
SetLineColor();
- ImplDrawProgress( FALSE, mnPercent, nNewPercent );
+ ImplDrawProgress( sal_False, mnPercent, nNewPercent );
Flush();
}
mnPercent = nNewPercent;
@@ -1596,7 +1604,7 @@ void StatusBar::EndProgressMode()
{
DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" );
- mbProgressMode = FALSE;
+ mbProgressMode = sal_False;
maPrgsTxt.Erase();
// Paint neu ausloesen um StatusBar wieder herzustellen
@@ -1643,7 +1651,7 @@ void StatusBar::SetText( const XubString& rText )
Update();
long nOldTextWidth = GetTextWidth( GetText() );
Window::SetText( rText );
- ImplDrawText( TRUE, nOldTextWidth );
+ ImplDrawText( sal_True, nOldTextWidth );
Flush();
}
}
@@ -1727,9 +1735,9 @@ Size StatusBar::CalcWindowSizePixel() const
// -----------------------------------------------------------------------
-void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
+void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
@@ -1745,9 +1753,9 @@ void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
// -----------------------------------------------------------------------
-const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
+const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
return (*mpItemList)[ nPos ]->maAccessibleName;
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index a1a33b905cdf..6d9de205dfce 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -30,23 +30,38 @@
#include "precompiled_vcl.hxx"
#include <svsys.h>
+#include <rtl/process.h>
+#include <rtl/ref.hxx>
+#include <tools/rc.h>
+#include <vcl/window.h>
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
#include <vcl/window.hxx>
#include <vcl/salobj.hxx>
-
-#include <tools/rc.h>
#include <vcl/svdata.hxx>
-#include <vcl/window.h>
+#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
+#include <vcl/unohelp.hxx>
+
+#ifdef SOLAR_JAVA
+#include <jni.h>
+#endif
+
+#include <comphelper/processfactory.hxx>
+#include <jvmaccess/virtualmachine.hxx>
+#include <com/sun/star/java/XJavaVM.hpp>
+#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <vcl/syschild.hxx>
+using namespace ::com::sun::star;
// =======================================================================
long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
- USHORT nEvent, const void* /* pEvent */ )
+ sal_uInt16 nEvent, const void* /* pEvent */ )
{
SystemChildWindow* pWindow = (SystemChildWindow*)pInst;
long nRet = 0;
@@ -58,33 +73,33 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// Focus holen und zwar so, das alle Handler gerufen
// werden, als ob dieses Fenster den Focus bekommt,
// ohne das der Frame den Focus wieder klaut
- pWindow->ImplGetFrameData()->mbSysObjFocus = TRUE;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = sal_True;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
pWindow->ToTop( TOTOP_NOGRABFOCUS );
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_True;
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = FALSE;
+ pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_False;
break;
case SALOBJ_EVENT_LOSEFOCUS:
// Hintenrum einen LoseFocus ausloesen, das der Status
// der Fenster dem entsprechenden Activate-Status
// entspricht
- pWindow->ImplGetFrameData()->mbSysObjFocus = FALSE;
+ pWindow->ImplGetFrameData()->mbSysObjFocus = sal_False;
if ( !pWindow->ImplGetFrameData()->mnFocusId )
{
- pWindow->ImplGetFrameData()->mbStartFocusState = TRUE;
+ pWindow->ImplGetFrameData()->mbStartFocusState = sal_True;
Application::PostUserEvent( pWindow->ImplGetFrameData()->mnFocusId, LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) );
}
break;
case SALOBJ_EVENT_TOTOP:
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True;
if ( !Application::GetFocusWindow() || pWindow->HasChildPathFocus() )
pWindow->ToTop( TOTOP_NOGRABFOCUS );
else
@@ -94,7 +109,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
pWindow->GrabFocus();
if( aDogTag.IsDead() )
break;
- pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE;
+ pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False;
break;
}
@@ -103,7 +118,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// =======================================================================
-void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow )
+void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow )
{
mpWindowImpl->mpSysObj = ImplGetSVData()->mpDefInst->CreateObject( pParent->ImplGetFrame(), pData, bShow );
@@ -128,7 +143,7 @@ SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle ) :
// -----------------------------------------------------------------------
-SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow ) :
+SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow ) :
Window( WINDOW_SYSTEMCHILDWINDOW )
{
ImplInitSysChild( pParent, nStyle, pData, bShow );
@@ -172,24 +187,161 @@ const SystemEnvData* SystemChildWindow::GetSystemData() const
// -----------------------------------------------------------------------
-void SystemChildWindow::EnableEraseBackground( BOOL bEnable )
+void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable )
{
if ( mpWindowImpl->mpSysObj )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
-BOOL SystemChildWindow::IsEraseBackgroundEnabled()
+// -----------------------------------------------------------------------
+
+sal_Bool SystemChildWindow::IsEraseBackgroundEnabled()
{
if ( mpWindowImpl->mpSysObj )
return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled();
else
- return FALSE;
+ return sal_False;
+}
+
+// -----------------------------------------------------------------------
+
+void SystemChildWindow::ImplTestJavaException( void* pEnv )
+{
+#ifdef SOLAR_JAVA
+ JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
+ jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
+
+ if( jtThrowable )
+ { // is it a java exception ?
+#if OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionDescribe();
+#endif // OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionClear();
+
+ jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
+ jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
+ jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
+ ::rtl::OUString ouMessage;
+
+ if(jsMessage)
+ {
+ const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
+ ouMessage = ::rtl::OUString(jcMessage);
+ pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
+ }
+
+ throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
+ }
+#endif // SOLAR_JAVA
}
-void SystemChildWindow::SetForwardKey( BOOL bEnable )
+void SystemChildWindow::SetForwardKey( sal_Bool bEnable )
+{
+ if ( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
+}
+
+// -----------------------------------------------------------------------
+
+sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
{
- if ( mpWindowImpl->mpSysObj )
- mpWindowImpl->mpSysObj->SetForwardKey( bEnable );
+ sal_IntPtr nRet = 0;
+
+#if defined WNT
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
+#elif defined QUARTZ
+ // FIXME: this is wrong
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
+#elif defined UNX
+ if( !bUseJava )
+ {
+ nRet = (sal_IntPtr) GetSystemData()->aWindow;
+ }
+#ifdef SOLAR_JAVA
+ else
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+
+ if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
+ {
+ try
+ {
+ ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
+ uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
+ uno::Sequence< sal_Int8 > aProcessID( 17 );
+
+ rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
+ aProcessID[ 16 ] = 0;
+ OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
+ sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
+ xJavaVM->getJavaVM(aProcessID) >>= nPointer;
+ xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
+
+ if( xVM.is() )
+ {
+ try
+ {
+ ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
+ JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
+
+ jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
+ ImplTestJavaException(pEnv);
+
+ jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
+ if( pEnv->ExceptionOccurred() )
+ {
+ pEnv->ExceptionClear();
+
+ jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
+ ImplTestJavaException(pEnv);
+ }
+
+ jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
+ ImplTestJavaException(pEnv);
+
+ jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
+ ImplTestJavaException(pEnv);
+
+ const Size aSize( GetOutputSizePixel() );
+ jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
+ GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
+ ImplTestJavaException(pEnv);
+
+ nRet = static_cast< sal_IntPtr >( ji_widget );
+ }
+ catch( uno::RuntimeException& )
+ {
+ }
+
+ if( !nRet )
+ nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
+ }
+ }
+ catch( ... )
+ {
+ }
+ }
+ }
+#endif // SOLAR_JAVA
+#else // WNT || QUARTZ || UNX
+#endif
+
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index fe3b6f5a585b..3343779f632b 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -79,16 +79,16 @@ SystemWindow::SystemWindow( WindowType nType ) :
Window( nType )
{
mpImplData = new ImplData;
- mpWindowImpl->mbSysWin = TRUE;
+ mpWindowImpl->mbSysWin = sal_True;
mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
mpMenuBar = NULL;
- mbPined = FALSE;
- mbRollUp = FALSE;
- mbRollFunc = FALSE;
- mbDockBtn = FALSE;
- mbHideBtn = FALSE;
- mbSysChild = FALSE;
+ mbPined = sal_False;
+ mbRollUp = sal_False;
+ mbRollFunc = sal_False;
+ mbDockBtn = sal_False;
+ mbHideBtn = sal_False;
+ mbSysChild = sal_False;
mnMenuBarMode = MENUBAR_MODE_NORMAL;
mnIcon = 0;
}
@@ -113,8 +113,8 @@ long SystemWindow::Notify( NotifyEvent& rNEvt )
if( pWin && pWin->IsSystemWindow() )
pMBar = ((SystemWindow*)pWin)->GetMenuBar();
}
- if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), FALSE ) )
- return TRUE;
+ if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), sal_False ) )
+ return sal_True;
}
return Window::Notify( rNEvt );
@@ -133,7 +133,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
{
// Ctrl-F6 goes directly to the document
GrabFocusToDocument();
- return TRUE;
+ return sal_True;
}
else
{
@@ -158,7 +158,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt )
pTList = pSysWin->mpImplData->mpTaskPaneList;
}
if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
- return TRUE;
+ return sal_True;
}
}
return Window::PreNotify( rNEvt );
@@ -188,17 +188,17 @@ TaskPaneList* SystemWindow::GetTaskPaneList()
// -----------------------------------------------------------------------
-BOOL SystemWindow::Close()
+sal_Bool SystemWindow::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
ImplRemoveDel( &aDelData );
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
- return FALSE;
+ return sal_False;
// Is Window not closeable, ignore close
Window* pBorderWin = ImplGetBorderWindow();
@@ -210,17 +210,17 @@ BOOL SystemWindow::Close()
if ( !(nStyle & WB_CLOSEABLE) )
{
Sound::Beep( SOUND_DISABLE, this );
- return FALSE;
+ return sal_False;
}
Hide();
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void SystemWindow::TitleButtonClick( USHORT )
+void SystemWindow::TitleButtonClick( sal_uInt16 )
{
}
@@ -244,14 +244,14 @@ void SystemWindow::Resizing( Size& )
// -----------------------------------------------------------------------
-void SystemWindow::SetZLevel( BYTE nLevel )
+void SystemWindow::SetZLevel( sal_uInt8 nLevel )
{
Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
pWindow = pWindow->mpWindowImpl->mpBorderWindow;
if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame )
{
- BYTE nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
+ sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel;
// Wenn der neue Level groesser als der alte ist, schieben
// wir das Fenster nach hinten
@@ -297,7 +297,7 @@ const rtl::OUString& SystemWindow::GetRepresentedURL() const
// -----------------------------------------------------------------------
-void SystemWindow::SetIcon( USHORT nIcon )
+void SystemWindow::SetIcon( sal_uInt16 nIcon )
{
if ( mnIcon == nIcon )
return;
@@ -317,7 +317,7 @@ void SystemWindow::SetIcon( USHORT nIcon )
// -----------------------------------------------------------------------
-BYTE SystemWindow::GetZLevel() const
+sal_uInt8 SystemWindow::GetZLevel() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -325,12 +325,12 @@ BYTE SystemWindow::GetZLevel() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SystemWindow::EnableSaveBackground( BOOL bSave )
+void SystemWindow::EnableSaveBackground( sal_Bool bSave )
{
if( ImplGetSVData()->maWinData.mbNoSaveBackground )
bSave = false;
@@ -348,7 +348,7 @@ void SystemWindow::EnableSaveBackground( BOOL bSave )
// -----------------------------------------------------------------------
-BOOL SystemWindow::IsSaveBackgroundEnabled() const
+sal_Bool SystemWindow::IsSaveBackgroundEnabled() const
{
const Window* pWindow = this;
while ( pWindow->mpWindowImpl->mpBorderWindow )
@@ -356,12 +356,12 @@ BOOL SystemWindow::IsSaveBackgroundEnabled() const
if ( pWindow->mpWindowImpl->mpOverlapData )
return pWindow->mpWindowImpl->mpOverlapData->mbSaveBack;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
+void SystemWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible )
{
if ( nButton == TITLE_BUTTON_DOCKING )
{
@@ -392,7 +392,7 @@ void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible )
// -----------------------------------------------------------------------
-BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const
+sal_Bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const
{
if ( nButton == TITLE_BUTTON_DOCKING )
return mbDockBtn;
@@ -402,7 +402,7 @@ BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const
// -----------------------------------------------------------------------
-void SystemWindow::SetPin( BOOL bPin )
+void SystemWindow::SetPin( sal_Bool bPin )
{
if ( bPin != mbPined )
{
@@ -419,16 +419,16 @@ void SystemWindow::RollUp()
if ( !mbRollUp )
{
maOrgSize = GetOutputSizePixel();
- mbRollFunc = TRUE;
+ mbRollFunc = sal_True;
Size aSize = maRollUpOutSize;
if ( !aSize.Width() )
aSize.Width() = GetOutputSizePixel().Width();
- mbRollUp = TRUE;
+ mbRollUp = sal_True;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( TRUE, aSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_True, aSize );
else
SetOutputSizePixel( aSize );
- mbRollFunc = FALSE;
+ mbRollFunc = sal_False;
}
}
@@ -438,9 +438,9 @@ void SystemWindow::RollDown()
{
if ( mbRollUp )
{
- mbRollUp = FALSE;
+ mbRollUp = sal_False;
if ( mpWindowImpl->mpBorderWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( FALSE, maOrgSize );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_False, maOrgSize );
else
SetOutputSizePixel( maOrgSize );
}
@@ -502,7 +502,7 @@ Size SystemWindow::GetResizeOutputSizePixel() const
static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr )
{
- ULONG nValidMask = 0;
+ sal_uLong nValidMask = 0;
xub_StrLen nIndex = 0;
ByteString aTokenStr;
@@ -555,7 +555,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- ULONG nState = (ULONG)aTokenStr.ToInt32();
+ sal_uLong nState = (sal_uLong)aTokenStr.ToInt32();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rData.SetState( nState );
nValidMask |= WINDOWSTATE_MASK_STATE;
@@ -617,7 +617,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS
static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr )
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -637,7 +637,7 @@ static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr
{
// #94144# allow Minimize again, should be masked out when read from configuration
// 91625 - ignore Minimize
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
//nState &= ~(WINDOWSTATE_STATE_MINIMIZED);
rStr.Append( ByteString::CreateFromInt32( (long)nState ) );
}
@@ -717,7 +717,7 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo
void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -730,7 +730,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if ( pWindow->mpWindowImpl->mbFrame )
{
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
SalFrameState aState;
aState.mnMask = rData.GetMask();
aState.mnX = rData.GetX();
@@ -769,7 +769,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
Window *pWin = pSVData->maWinData.mpFirstFrame;
- BOOL bWrapped = FALSE;
+ sal_Bool bWrapped = sal_False;
while( pWin )
{
if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
@@ -790,7 +790,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom )
break; // further displacement not possible -> break
// avoid endless testing
- bWrapped = TRUE;
+ bWrapped = sal_True;
}
else
{
@@ -827,7 +827,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
}
else
{
- USHORT nPosSize = 0;
+ sal_uInt16 nPosSize = 0;
if ( nValidMask & WINDOWSTATE_MASK_X )
nPosSize |= WINDOW_POSSIZE_X;
if ( nValidMask & WINDOWSTATE_MASK_Y )
@@ -859,7 +859,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
// 91625 - ignore Minimize
if ( nValidMask & WINDOWSTATE_MASK_STATE )
{
- ULONG nState = rData.GetState();
+ sal_uLong nState = rData.GetState();
if ( nState & WINDOWSTATE_STATE_ROLLUP )
RollUp();
else
@@ -872,7 +872,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
- ULONG nValidMask = rData.GetMask();
+ sal_uLong nValidMask = rData.GetMask();
if ( !nValidMask )
return;
@@ -934,7 +934,7 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const
{
Point aPos = GetPosPixel();
Size aSize = GetSizePixel();
- ULONG nState = 0;
+ sal_uLong nState = 0;
if ( IsRollUp() )
{
@@ -969,7 +969,7 @@ void SystemWindow::SetWindowState( const ByteString& rStr )
// -----------------------------------------------------------------------
-ByteString SystemWindow::GetWindowState( ULONG nMask ) const
+ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const
{
WindowStateData aData;
aData.SetMask( nMask );
@@ -1013,7 +1013,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
ImplToBottomChild();
if ( pOldMenuBar )
{
- BOOL bDelete = (pMenuBar == 0) ? TRUE : FALSE;
+ sal_Bool bDelete = (pMenuBar == 0) ? sal_True : sal_False;
if( bDelete && pOldWindow )
{
if( mpImplData->mpTaskPaneList )
@@ -1046,7 +1046,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar )
// -----------------------------------------------------------------------
-void SystemWindow::SetMenuBarMode( USHORT nMode )
+void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
{
if ( mnMenuBarMode != nMode )
{
@@ -1054,20 +1054,20 @@ void SystemWindow::SetMenuBarMode( USHORT nMode )
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
{
if ( nMode == MENUBAR_MODE_HIDE )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_True );
else
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( FALSE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_False );
}
}
}
// -----------------------------------------------------------------------
-BOOL SystemWindow::ImplIsInTaskPaneList( Window* pWin )
+sal_Bool SystemWindow::ImplIsInTaskPaneList( Window* pWin )
{
if( mpImplData && mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList->IsInList( pWin );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 54985a3a36e2..32e8a0dcec92 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -42,7 +42,7 @@ void TabDialog::ImplInitTabDialogData()
mpFixedLine = NULL;
mpViewWindow = NULL;
meViewAlign = WINDOWALIGN_LEFT;
- mbPosControls = TRUE;
+ mbPosControls = sal_True;
}
// -----------------------------------------------------------------------
@@ -104,7 +104,7 @@ void TabDialog::ImplPosControls()
long nViewOffY = 0;
long nViewWidth = 0;
long nViewHeight = 0;
- USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS;
Size aViewSize = mpViewWindow->GetSizePixel();
if ( meViewAlign == WINDOWALIGN_TOP )
{
@@ -152,7 +152,7 @@ void TabDialog::ImplPosControls()
pTabControl->SetPosPixel( aTabOffset );
// Alle anderen Childs positionieren
- BOOL bTabCtrl = FALSE;
+ sal_Bool bTabCtrl = sal_False;
int nLines = 0;
long nX;
long nY = aDlgSize.Height();
@@ -170,7 +170,7 @@ void TabDialog::ImplPosControls()
if ( pChild2->IsVisible() && (pChild2 != mpViewWindow) )
{
if ( pChild2 == pTabControl )
- bTabCtrl = TRUE;
+ bTabCtrl = sal_True;
else if ( bTabCtrl )
{
if ( !nLines )
@@ -212,7 +212,7 @@ void TabDialog::ImplPosControls()
mpFixedLine->Show();
}
- mbPosControls = FALSE;
+ mbPosControls = sal_False;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index cccd315d7189..f109f2079a4c 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -57,7 +57,7 @@ void TabPage::ImplInit( Window* pParent, WinBits nStyle )
// if the tabpage is drawn (ie filled) by a native widget, make sure all contols will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
}
// -----------------------------------------------------------------------
@@ -67,16 +67,16 @@ void TabPage::ImplInitSettings()
Window* pParent = GetParent();
if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
{
- EnableChildTransparentMode( TRUE );
+ EnableChildTransparentMode( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetBackground();
}
else
{
- EnableChildTransparentMode( FALSE );
+ EnableChildTransparentMode( sal_False );
SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
@@ -166,7 +166,7 @@ void TabPage::Paint( const Rectangle& )
}
// -----------------------------------------------------------------------
-void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG )
+void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong )
{
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index f705609306a1..56bd9d799cce 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -140,7 +140,7 @@ void TaskPaneList::AddWindow( Window *pWindow )
}
mTaskPanes.insert( insertionPos, pWindow );
- pWindow->ImplIsInTaskPaneList( TRUE );
+ pWindow->ImplIsInTaskPaneList( sal_True );
}
}
@@ -153,25 +153,25 @@ void TaskPaneList::RemoveWindow( Window *pWindow )
if( p != mTaskPanes.end() )
{
mTaskPanes.erase( p );
- pWindow->ImplIsInTaskPaneList( FALSE );
+ pWindow->ImplIsInTaskPaneList( sal_False );
}
}
// --------------------------------------------------
-BOOL TaskPaneList::IsInList( Window *pWindow )
+sal_Bool TaskPaneList::IsInList( Window *pWindow )
{
::std::vector< Window* >::iterator p;
p = ::std::find( mTaskPanes.begin(), mTaskPanes.end(), pWindow );
if( p != mTaskPanes.end() )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// --------------------------------------------------
-BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
+sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
// F6 cycles through everything and works always
@@ -183,11 +183,11 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
//
// Since the design of Ctrl-Tab looks to be inconsistent ( non-modal dialogs are not reachable
// and the shortcut conflicts with tab-control shortcut ), it is no more supported
- BOOL bSplitterOnly = FALSE;
- BOOL bFocusInList = FALSE;
+ sal_Bool bSplitterOnly = sal_False;
+ sal_Bool bFocusInList = sal_False;
KeyCode aKeyCode = aKeyEvent.GetKeyCode();
- BOOL bForward = !aKeyCode.IsShift();
- if( aKeyCode.GetCode() == KEY_F6 ) // F6
+ sal_Bool bForward = !aKeyCode.IsShift();
+ if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6
{
bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift();
@@ -196,43 +196,43 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
while( p != mTaskPanes.end() )
{
Window *pWin = *p;
- if( pWin->HasChildPathFocus( TRUE ) )
+ if( pWin->HasChildPathFocus( sal_True ) )
{
- bFocusInList = TRUE;
+ bFocusInList = sal_True;
// Ctrl-F6 goes directly to the document
if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() )
{
pWin->GrabFocusToDocument();
- return TRUE;
+ return sal_True;
}
// activate next task pane
Window *pNextWin = NULL;
if( bSplitterOnly )
- pNextWin = FindNextSplitter( *p, TRUE );
+ pNextWin = FindNextSplitter( *p, sal_True );
else
pNextWin = FindNextFloat( *p, bForward );
if( pNextWin != pWin )
{
- ImplGetSVData()->maWinData.mbNoSaveFocus = TRUE;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = sal_True;
ImplTaskPaneListGrabFocus( pNextWin );
- ImplGetSVData()->maWinData.mbNoSaveFocus = FALSE;
+ ImplGetSVData()->maWinData.mbNoSaveFocus = sal_False;
}
else
{
// forward key if no splitter found
if( bSplitterOnly )
- return FALSE;
+ return sal_False;
// we did not find another taskpane, so
// put focus back into document
pWin->GrabFocusToDocument();
}
- return TRUE;
+ return sal_True;
}
else
p++;
@@ -243,24 +243,24 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
{
Window *pWin;
if( bSplitterOnly )
- pWin = FindNextSplitter( NULL, TRUE );
+ pWin = FindNextSplitter( NULL, sal_True );
else
pWin = FindNextFloat( NULL, bForward );
if( pWin )
{
ImplTaskPaneListGrabFocus( pWin );
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
// --------------------------------------------------
// returns next valid pane
-Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -295,7 +295,7 @@ Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward )
// --------------------------------------------------
// returns next splitter
-Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
@@ -334,7 +334,7 @@ Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward )
// --------------------------------------------------
// returns first valid item (regardless of type) if pWindow==0, otherwise returns next valid float
-Window* TaskPaneList::FindNextFloat( Window *pWindow, BOOL bForward )
+Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward )
{
if( bForward )
::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index d8698966d14e..0eae498111ab 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -108,24 +108,24 @@ DBG_NAMEEX( Window )
#define TB_MAX_GROUPS 100
-#define DOCK_LINEHSIZE ((USHORT)0x0001)
-#define DOCK_LINEVSIZE ((USHORT)0x0002)
-#define DOCK_LINERIGHT ((USHORT)0x1000)
-#define DOCK_LINEBOTTOM ((USHORT)0x2000)
-#define DOCK_LINELEFT ((USHORT)0x4000)
-#define DOCK_LINETOP ((USHORT)0x8000)
+#define DOCK_LINEHSIZE ((sal_uInt16)0x0001)
+#define DOCK_LINEVSIZE ((sal_uInt16)0x0002)
+#define DOCK_LINERIGHT ((sal_uInt16)0x1000)
+#define DOCK_LINEBOTTOM ((sal_uInt16)0x2000)
+#define DOCK_LINELEFT ((sal_uInt16)0x4000)
+#define DOCK_LINETOP ((sal_uInt16)0x8000)
#define DOCK_LINEOFFSET 3
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow );
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow );
// -----------------------------------------------------------------------
struct ImplToolSize
{
long mnWidth;
long mnHeight;
- USHORT mnLines;
+ sal_uInt16 mnLines;
};
struct ImplToolSizeArray
@@ -153,12 +153,12 @@ private:
Accelerator maAccel;
long mnMinWidth;
long mnMaxWidth;
- USHORT mnLineMode;
- USHORT mnStartLines;
+ sal_uInt16 mnLineMode;
+ sal_uInt16 mnStartLines;
void* mpCustomizeData;
- BOOL mbCustomizeMode;
- BOOL mbResizeMode;
- BOOL mbShowDragRect;
+ sal_Bool mbCustomizeMode;
+ sal_Bool mbResizeMode;
+ sal_Bool mbShowDragRect;
public:
ImplTBDragMgr();
@@ -182,18 +182,18 @@ public:
void StartDragging( ToolBox* pDragBox,
const Point& rPos, const Rectangle& rRect,
- USHORT nLineMode, BOOL bResizeItem,
+ sal_uInt16 nLineMode, sal_Bool bResizeItem,
void* pData = NULL );
void Dragging( const Point& rPos );
- void EndDragging( BOOL bOK = TRUE );
+ void EndDragging( sal_Bool bOK = sal_True );
void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); }
void UpdateDragRect();
DECL_LINK( SelectHdl, Accelerator* );
void StartCustomizeMode();
void EndCustomizeMode();
- BOOL IsCustomizeMode() { return mbCustomizeMode; }
- BOOL IsResizeMode() { return mbResizeMode; }
+ sal_Bool IsCustomizeMode() { return mbCustomizeMode; }
+ sal_Bool IsResizeMode() { return mbResizeMode; }
};
// -----------------------------------------------------------------------
@@ -338,7 +338,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis )
// execute pending paint requests
ImplCheckUpdate( pThis );
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT ) )
{
ToolbarValue aToolbarValue;
@@ -422,7 +422,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
g.SetStartColor( startCol );
g.SetEndColor( endCol );
- BOOL bLineColor = pThis->IsLineColor();
+ sal_Bool bLineColor = pThis->IsLineColor();
Color aOldCol = pThis->GetLineColor();
pThis->SetLineColor( pThis->GetSettings().GetStyleSettings().GetShadowColor() );
@@ -512,7 +512,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
if( pThis->mbHorz )
{
long y = 0;
- BOOL bDrawSep = FALSE; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
+ sal_Bool bDrawSep = sal_False; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING );
pThis->DrawGradient( Rectangle( 0, y, aTopLineSz.Width(), y+aTopLineSz.Height()), g );
y += aTopLineSz.Height();
@@ -554,7 +554,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
}
-BOOL ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
+sal_Bool ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
{
// use NWF
Point aPt;
@@ -578,7 +578,7 @@ void ToolBox::ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegi
pThis->mpData->mbIsPaintLocked = bOldPaintLock;
}
-void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode )
+void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode )
{
// draw a constant color
if( !bIsInPopupMode )
@@ -599,7 +599,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
ImplCheckUpdate( pThis );
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pThis );
- BOOL bIsInPopupMode = pThis->ImplIsInPopupMode();
+ sal_Bool bIsInPopupMode = pThis->ImplIsInPopupMode();
Region aPaintRegion( rRect );
@@ -624,7 +624,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
// toolbars known to the dockingmanager will be drawn using NWF or a gradient
// docked toolbars are transparent and NWF is already used in the docking area which is their common background
// so NWF is used here for floating toolbars only
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( pThis->ImplIsFloatingMode() && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) )
bNativeOk = ImplDrawNativeBackground( pThis, aPaintRegion );
@@ -644,7 +644,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect )
pThis->Pop();
}
-void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight, BOOL bHasOpenPopup )
+void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight, sal_Bool bHasOpenPopup )
{
// the background of non NWF buttons is painted in a constant color
// to have the same highlight color (transparency in DrawSelectionBackground())
@@ -763,7 +763,7 @@ const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode )
+Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode )
{
long nMax;
long nLeft = 0;
@@ -772,45 +772,45 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal
long nBottom = 0;
Size aSize;
WindowAlign eOldAlign = pThis->meAlign;
- BOOL bOldHorz = pThis->mbHorz;
- BOOL bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
- BOOL bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
+ sal_Bool bOldHorz = pThis->mbHorz;
+ sal_Bool bOldAssumeDocked = pThis->mpData->mbAssumeDocked;
+ sal_Bool bOldAssumeFloating = pThis->mpData->mbAssumeFloating;
if ( nCalcMode )
{
- BOOL bOldFloatingMode = pThis->ImplIsFloatingMode();
+ sal_Bool bOldFloatingMode = pThis->ImplIsFloatingMode();
- pThis->mpData->mbAssumeDocked = FALSE;
- pThis->mpData->mbAssumeFloating = FALSE;
+ pThis->mpData->mbAssumeDocked = sal_False;
+ pThis->mpData->mbAssumeFloating = sal_False;
if ( nCalcMode == TB_CALCMODE_HORZ )
{
- pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = TRUE;
+ ((ToolBox*)pThis)->mbHorz = sal_True;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
else if ( nCalcMode == TB_CALCMODE_VERT )
{
- pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = FALSE;
+ ((ToolBox*)pThis)->mbHorz = sal_False;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_LEFT;
}
else if ( nCalcMode == TB_CALCMODE_FLOAT )
{
- pThis->mpData->mbAssumeFloating = TRUE; // force non-floating mode during calculation
+ pThis->mpData->mbAssumeFloating = sal_True; // force non-floating mode during calculation
nLeft = nTop = nRight = nBottom = 0;
- ((ToolBox*)pThis)->mbHorz = TRUE;
+ ((ToolBox*)pThis)->mbHorz = sal_True;
if ( pThis->mbHorz != bOldHorz )
((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
}
if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) ||
(pThis->ImplIsFloatingMode() != bOldFloatingMode ) )
- ((ToolBox*)pThis)->mbCalc = TRUE;
+ ((ToolBox*)pThis)->mbCalc = sal_True;
}
else
ImplCalcBorder( pThis->meAlign, nLeft, nTop, nRight, nBottom, pThis );
@@ -872,7 +872,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal
{
((ToolBox*)pThis)->meAlign = eOldAlign;
((ToolBox*)pThis)->mbHorz = bOldHorz;
- ((ToolBox*)pThis)->mbCalc = TRUE;
+ ((ToolBox*)pThis)->mbCalc = sal_True;
}
}
@@ -918,13 +918,13 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// calc an upper bound for ImplCalcBreaks below
long upperBoundWidth = nCalcSize * pThis->mpData->m_aItems.size();
- USHORT i;
- USHORT nLines;
- USHORT nCalcLines;
- USHORT nTempLines;
+ sal_uInt16 i;
+ sal_uInt16 nLines;
+ sal_uInt16 nCalcLines;
+ sal_uInt16 nTempLines;
long nHeight;
long nMaxLineWidth;
- nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
+ nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
pThis->mpFloatSizeAry = new ImplToolSizeArray;
pThis->mpFloatSizeAry->mpSize = new ImplToolSize[nCalcLines];
@@ -946,7 +946,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
do
{
nCalcSize += pThis->mnMaxItemWidth;
- nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE );
+ nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True );
}
while ( (nCalcSize < upperBoundWidth) && (nLines < nTempLines) && (nTempLines != 1) );
if ( nTempLines < nLines )
@@ -958,7 +958,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis )
// -----------------------------------------------------------------------
-Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines )
+Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines )
{
ImplCalcFloatSizes( pThis );
@@ -969,7 +969,7 @@ Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines )
rLines = pThis->mnLines;
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < pThis->mpFloatSizeAry->mnLastEntry &&
rLines < pThis->mpFloatSizeAry->mpSize[i].mnLines )
i++;
@@ -988,7 +988,7 @@ void ToolBox::ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMa
{
ImplCalcFloatSizes( pThis );
- USHORT i = 0;
+ sal_uInt16 i = 0;
rMinSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight );
rMaxSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight );
while ( ++i <= pThis->mpFloatSizeAry->mnLastEntry )
@@ -1014,7 +1014,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
{
pWrapper->SetMinOutputSizePixel( aMinSize );
pWrapper->SetMaxOutputSizePixel( aMaxSize );
- pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False );
}
else
{
@@ -1027,7 +1027,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis )
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
+sal_uInt16 ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
{
long nLineHeight;
@@ -1055,12 +1055,12 @@ USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize )
if( nLines < 1 )
nLines = 1;
- return static_cast<USHORT>(nLines);
+ return static_cast<sal_uInt16>(nLines);
}
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
+sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
{
if ( !pThis->ImplIsFloatingMode() &&
(!pThis->mbScroll || (pThis->mnLines > 1) || (pThis->mnCurLines > pThis->mnVisLines)) )
@@ -1095,9 +1095,9 @@ USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos )
// -----------------------------------------------------------------------
void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect,
- USHORT nLineMode )
+ sal_uInt16 nLineMode )
{
- BOOL mbHorz;
+ sal_Bool mbHorz;
long nOneLineSize;
long nCurSize;
long nMaxSize;
@@ -1107,31 +1107,31 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
if ( nLineMode & DOCK_LINERIGHT )
{
nCurSize = rPos.X() - rRect.Left();
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
else if ( nLineMode & DOCK_LINEBOTTOM )
{
nCurSize = rPos.Y() - rRect.Top();
- mbHorz = TRUE;
+ mbHorz = sal_True;
}
else if ( nLineMode & DOCK_LINELEFT )
{
nCurSize = rRect.Right() - rPos.X();
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
else if ( nLineMode & DOCK_LINETOP )
{
nCurSize = rRect.Bottom() - rPos.Y();
- mbHorz = TRUE;
+ mbHorz = sal_True;
}
else {
OSL_FAIL( "ImplLineSizing: Trailing else" );
nCurSize = 0;
- mbHorz = FALSE;
+ mbHorz = sal_False;
}
Size aWinSize = pThis->GetSizePixel();
- USHORT nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
+ sal_uInt16 nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines;
if ( nMaxLines > TB_MAXLINES )
nMaxLines = TB_MAXLINES;
if ( mbHorz )
@@ -1149,7 +1149,7 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
nMaxSize = aWinSize.Width();
}
- USHORT i = 1;
+ sal_uInt16 i = 1;
if ( nCurSize <= nOneLineSize )
nSize = nOneLineSize;
else
@@ -1190,9 +1190,9 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
+sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
{
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
long nLast = 0;
Point aPos = rPos;
Size aSize( pBox->mnDX, pBox->mnDY );
@@ -1259,9 +1259,9 @@ ImplTBDragMgr::ImplTBDragMgr()
mpBoxList = new ImplTBList();
mnLineMode = 0;
mnStartLines = 0;
- mbCustomizeMode = FALSE;
- mbResizeMode = FALSE;
- mbShowDragRect = FALSE;
+ mbCustomizeMode = sal_False;
+ mbResizeMode = sal_False;
+ mbShowDragRect = sal_False;
mpDragBox = NULL;
maAccel.InsertItem( KEY_RETURN, KeyCode( KEY_RETURN ) );
@@ -1311,12 +1311,12 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
const Point& rPos, const Rectangle& rRect,
- USHORT nDragLineMode, BOOL bResizeItem,
+ sal_uInt16 nDragLineMode, sal_Bool bResizeItem,
void* pData )
{
mpDragBox = pToolBox;
pToolBox->CaptureMouse();
- pToolBox->mbDragging = TRUE;
+ pToolBox->mbDragging = sal_True;
Application::InsertAccel( &maAccel );
if ( nDragLineMode )
@@ -1348,7 +1348,7 @@ void ImplTBDragMgr::StartDragging( ToolBox* pToolBox,
maMouseOff.Y() = rRect.Top() - rPos.Y();
maRect = rRect;
maStartRect = rRect;
- mbShowDragRect = TRUE;
+ mbShowDragRect = sal_True;
pToolBox->ShowTracking( maRect );
}
@@ -1388,12 +1388,12 @@ void ImplTBDragMgr::Dragging( const Point& rPos )
// -----------------------------------------------------------------------
-void ImplTBDragMgr::EndDragging( BOOL bOK )
+void ImplTBDragMgr::EndDragging( sal_Bool bOK )
{
mpDragBox->HideTracking();
mpDragBox->ReleaseMouse();
- mpDragBox->mbDragging = FALSE;
- mbShowDragRect = FALSE;
+ mpDragBox->mbDragging = sal_False;
+ mbShowDragRect = sal_False;
Application::RemoveAccel( &maAccel );
if ( mnLineMode )
@@ -1401,16 +1401,16 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
if ( !bOK )
{
mpDragBox->mnDockLines = mnStartLines;
- mpDragBox->EndDocking( maStartRect, FALSE );
+ mpDragBox->EndDocking( maStartRect, sal_False );
}
else
- mpDragBox->EndDocking( maRect, FALSE );
+ mpDragBox->EndDocking( maRect, sal_False );
mnLineMode = 0;
mnStartLines = 0;
}
else
{
- USHORT nTempItem = mpDragBox->mnConfigItem;
+ sal_uInt16 nTempItem = mpDragBox->mnConfigItem;
if ( nTempItem )
{
mpDragBox->mnConfigItem = 0;
@@ -1428,7 +1428,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
pItem->mpWindow->SetSizePixel( aSize );
// ToolBox neu brechnen und neu ausgeben
- mpDragBox->ImplInvalidate( TRUE );
+ mpDragBox->ImplInvalidate( sal_True );
mpDragBox->Customize( ToolBoxCustomizeEvent( mpDragBox, nTempItem,
TOOLBOX_CUSTOMIZE_RESIZE,
mpCustomizeData ) );
@@ -1455,7 +1455,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
}
aPos = pDropBox->ScreenToOutputPixel( aPos );
- USHORT nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
+ sal_uInt16 nPos = ToolBox::ImplFindItemPos( pDropBox, aPos );
mpDragBox->Customize( ToolBoxCustomizeEvent( pDropBox, nTempItem,
nPos, mpCustomizeData ) );
}
@@ -1467,7 +1467,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK )
}
}
mpCustomizeData = NULL;
- mbResizeMode = FALSE;
+ mbResizeMode = sal_False;
mpDragBox->Deactivate();
}
@@ -1490,18 +1490,18 @@ void ImplTBDragMgr::UpdateDragRect()
IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel )
{
if ( pAccel->GetCurItemId() == KEY_ESCAPE )
- EndDragging( FALSE );
+ EndDragging( sal_False );
else
- EndDragging( TRUE );
+ EndDragging( sal_True );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
void ImplTBDragMgr::StartCustomizeMode()
{
- mbCustomizeMode = TRUE;
+ mbCustomizeMode = sal_True;
for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
(*mpBoxList)[ i ]->ImplStartCustomizeMode();
@@ -1512,7 +1512,7 @@ void ImplTBDragMgr::StartCustomizeMode()
void ImplTBDragMgr::EndCustomizeMode()
{
- mbCustomizeMode = FALSE;
+ mbCustomizeMode = sal_False;
for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
(*mpBoxList)[ i ]->ImplEndCustomizeMode();
@@ -1523,7 +1523,7 @@ void ImplTBDragMgr::EndCustomizeMode()
static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect,
- USHORT nStyle )
+ sal_uInt16 nStyle )
{
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
Color aShadowColor = rStyleSettings.GetShadowColor();
@@ -1571,7 +1571,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
{
// Variablen initialisieren
- ImplGetWindowImpl()->mbToolBox = TRUE;
+ ImplGetWindowImpl()->mbToolBox = sal_True;
mpBtnDev = NULL;
mpFloatSizeAry = NULL;
mpData = new ImplToolBoxPrivateData;
@@ -1602,25 +1602,25 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mnConfigItem = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- mbDrag = FALSE;
- mbSelection = FALSE;
- mbCommandDrag = FALSE;
- mbUpper = FALSE;
- mbLower = FALSE;
- mbNextTool = FALSE;
- mbIn = FALSE;
- mbCalc = TRUE;
- mbFormat = FALSE;
- mbFullPaint = FALSE;
- mbHorz = TRUE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
+ mbCommandDrag = sal_False;
+ mbUpper = sal_False;
+ mbLower = sal_False;
+ mbNextTool = sal_False;
+ mbIn = sal_False;
+ mbCalc = sal_True;
+ mbFormat = sal_False;
+ mbFullPaint = sal_False;
+ mbHorz = sal_True;
mbScroll = (nStyle & WB_SCROLL) != 0;
- mbCustomize = FALSE;
- mbCustomizeMode = FALSE;
- mbDragging = FALSE;
- mbMenuStrings = FALSE;
- mbIsShift = FALSE;
- mbIsKeyEvent = FALSE;
- mbChangingHighlight = FALSE;
+ mbCustomize = sal_False;
+ mbCustomizeMode = sal_False;
+ mbDragging = sal_False;
+ mbMenuStrings = sal_False;
+ mbIsShift = sal_False;
+ mbIsKeyEvent = sal_False;
+ mbChangingHighlight = sal_False;
meButtonType = BUTTON_SYMBOL;
meAlign = WINDOWALIGN_TOP;
meLastStyle = POINTER_ARROW;
@@ -1647,13 +1647,13 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
ImplGetWindowImpl()->mnStyle &= ~WB_DIALOGCONTROL;
}
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
// -----------------------------------------------------------------------
-void ToolBox::ImplInitSettings( BOOL bFont,
- BOOL bForeground, BOOL bBackground )
+void ToolBox::ImplInitSettings( sal_Bool bFont,
+ sal_Bool bForeground, sal_Bool bBackground )
{
mpData->mbNativeButtons = IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
@@ -1687,7 +1687,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
{
aColor = GetControlBackground();
SetBackground( aColor );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
SetParentClipMode( 0 );
}
else
@@ -1695,7 +1695,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
SetBackground();
- SetPaintTransparent( TRUE );
+ SetPaintTransparent( sal_True );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() );
}
@@ -1707,7 +1707,7 @@ void ToolBox::ImplInitSettings( BOOL bFont,
aColor = rStyleSettings.GetWindowColor();
SetBackground( aColor );
- SetPaintTransparent( FALSE );
+ SetPaintTransparent( sal_False );
SetParentClipMode( 0 );
ImplUpdateImageList();
@@ -1726,7 +1726,7 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
DockingWindow::ImplLoadRes( rResId );
- ULONG nObjMask;
+ sal_uLong nObjMask;
nObjMask = ReadLongRes();
@@ -1737,17 +1737,17 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
SetAlign( (WindowAlign)ReadLongRes() );
if ( nObjMask & RSC_TOOLBOX_LINECOUNT )
- SetLineCount( sal::static_int_cast<USHORT>(ReadLongRes()) );
+ SetLineCount( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
if ( nObjMask & RSC_TOOLBOX_CUSTOMIZE )
{
- BOOL bCust = (BOOL)ReadShortRes();
+ sal_Bool bCust = (sal_Bool)ReadShortRes();
EnableCustomize( bCust );
}
if ( nObjMask & RSC_TOOLBOX_MENUSTRINGS )
{
- BOOL bCust = (BOOL)ReadShortRes();
+ sal_Bool bCust = (sal_Bool)ReadShortRes();
EnableMenuStrings( bCust );
}
@@ -1762,10 +1762,10 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
if ( nObjMask & RSC_TOOLBOX_ITEMLIST )
{
- ULONG nEle = ReadLongRes();
+ sal_uLong nEle = ReadLongRes();
// Item hinzufuegen
- for ( ULONG i = 0; i < nEle; i++ )
+ for ( sal_uLong i = 0; i < nEle; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
@@ -1796,7 +1796,7 @@ ToolBox::ToolBox( Window* pParent, const ResId& rResId ) :
// Groesse des FloatingWindows berechnen und umschalten, wenn die
// ToolBox initial im FloatingModus ist
if ( ImplIsFloatingMode() )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
Resize();
@@ -1847,7 +1847,7 @@ ToolBox::~ToolBox()
// -----------------------------------------------------------------------
-ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const
+ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
{
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
@@ -1861,7 +1861,7 @@ ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const
}
// -----------------------------------------------------------------------
-static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle, BOOL bNativeButtons )
+static void ImplAddButtonBorder( long &rWidth, long& rHeight, sal_uInt16 aOutStyle, sal_Bool bNativeButtons )
{
if ( aOutStyle & TOOLBOX_STYLE_OUTBUTTON )
{
@@ -1884,13 +1884,13 @@ static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle,
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplCalcItem()
+sal_Bool ToolBox::ImplCalcItem()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
// recalc required ?
if ( !mbCalc )
- return FALSE;
+ return sal_False;
ImplDisableFlatButtons();
@@ -1982,27 +1982,27 @@ BOOL ToolBox::ImplCalcItem()
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while ( it != mpData->m_aItems.end() )
{
- BOOL bImage;
- BOOL bText;
+ sal_Bool bImage;
+ sal_Bool bText;
- it->mbVisibleText = FALSE; // indicates if text will definitely be drawn, influences dropdown pos
+ it->mbVisibleText = sal_False; // indicates if text will definitely be drawn, influences dropdown pos
if ( it->meType == TOOLBOXITEM_BUTTON )
{
// check if image and/or text exists
if ( !(it->maImage) )
- bImage = FALSE;
+ bImage = sal_False;
else
- bImage = TRUE;
+ bImage = sal_True;
if ( !it->maText.Len() )
- bText = FALSE;
+ bText = sal_False;
else
- bText = TRUE;
+ bText = sal_True;
ButtonType tmpButtonType = determineButtonType( &(*it), meButtonType ); // default to toolbox setting
if ( bImage || bText )
{
- it->mbEmptyBtn = FALSE;
+ it->mbEmptyBtn = sal_False;
if ( tmpButtonType == BUTTON_SYMBOL )
{
@@ -2015,7 +2015,7 @@ BOOL ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = TRUE;
+ it->mbVisibleText = sal_True;
}
}
else if ( tmpButtonType == BUTTON_TEXT )
@@ -2025,7 +2025,7 @@ BOOL ToolBox::ImplCalcItem()
{
it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET,
GetTextHeight() );
- it->mbVisibleText = TRUE;
+ it->mbVisibleText = sal_True;
}
else
{
@@ -2053,7 +2053,7 @@ BOOL ToolBox::ImplCalcItem()
else
{ // no image and no text
it->maItemSize = Size( nDefWidth, nDefHeight );
- it->mbEmptyBtn = TRUE;
+ it->mbEmptyBtn = sal_True;
}
// Gegebenenfalls die Fensterhoehe mit beruecksichtigen
@@ -2133,8 +2133,8 @@ BOOL ToolBox::ImplCalcItem()
nMaxWidth = nFixedWidth;
}
- mbCalc = FALSE;
- mbFormat = TRUE;
+ mbCalc = sal_False;
+ mbFormat = sal_True;
// do we have to recalc the sizes ?
if ( (nMaxWidth != mnMaxItemWidth) || (nMaxHeight != mnMaxItemHeight) )
@@ -2142,25 +2142,25 @@ BOOL ToolBox::ImplCalcItem()
mnMaxItemWidth = nMaxWidth;
mnMaxItemHeight = nMaxHeight;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz )
+sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz )
{
- ULONG nLineStart = 0;
- ULONG nGroupStart = 0;
+ sal_uLong nLineStart = 0;
+ sal_uLong nGroupStart = 0;
long nLineWidth = 0;
long nCurWidth;
long nLastGroupLineWidth = 0;
long nMaxLineWidth = 0;
- USHORT nLines = 1;
- BOOL bWindow;
- BOOL bBreak = FALSE;
+ sal_uInt16 nLines = 1;
+ sal_Bool bWindow;
+ sal_Bool bBreak = sal_False;
long nWidthTotal = nWidth;
// when docked the menubutton will be in the first line
@@ -2172,12 +2172,12 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
while ( it != mpData->m_aItems.end() )
{
it->mbBreak = bBreak;
- bBreak = FALSE;
+ bBreak = sal_False;
if ( it->mbVisible )
{
- bWindow = FALSE;
- bBreak = FALSE;
+ bWindow = sal_False;
+ bBreak = sal_False;
nCurWidth = 0;
if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE )
@@ -2193,7 +2193,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
if ( !mbScroll || (nWinItemWidth <= nWidthTotal) )
{
nCurWidth = nWinItemWidth;
- bWindow = TRUE;
+ bWindow = sal_True;
}
else
{
@@ -2206,13 +2206,13 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
// check for line break
if ( (nLineWidth+nCurWidth > nWidthTotal) && mbScroll )
- bBreak = TRUE;
+ bBreak = sal_True;
}
else if ( it->meType == TOOLBOXITEM_SEPARATOR )
nCurWidth = it->mnSepSize;
// treat breaks as separators, except when using old style toolbars (ie. no menu button)
else if ( (it->meType == TOOLBOXITEM_BREAK) && !IsMenuEnabled() )
- bBreak = TRUE;
+ bBreak = sal_True;
if ( bBreak )
{
@@ -2228,8 +2228,8 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
nLineWidth = 0;
nLineStart = it - mpData->m_aItems.begin();
nGroupStart = nLineStart;
- it->mbBreak = TRUE;
- bBreak = FALSE;
+ it->mbBreak = sal_True;
+ bBreak = sal_False;
}
else
{
@@ -2293,7 +2293,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz
// -----------------------------------------------------------------------
namespace
{
- BOOL ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
+ sal_Bool ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd )
{
std::vector< ImplToolItem >::iterator aLookup = _aSeparator;
while ( ++aLookup != _aEnd )
@@ -2302,9 +2302,9 @@ namespace
return ImplFollowedByVisibleButton( aLookup, _aEnd );
if ( ( aLookup->meType == TOOLBOXITEM_BUTTON ) && aLookup->mbVisible )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
}
@@ -2324,7 +2324,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
if( eMode == FSMODE_AUTO || eMode == FSMODE_FAVOURHEIGHT )
{
// calc number of floating lines for current window height
- USHORT nFloatLinesHeight = ImplCalcLines( this, mnDY );
+ sal_uInt16 nFloatLinesHeight = ImplCalcLines( this, mnDY );
// calc window size according to this number
aSize1 = ImplCalcFloatSize( this, nFloatLinesHeight );
@@ -2340,9 +2340,9 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder + 2*mnBorderY;
Size aSz( aCurrentSize );
long maxX;
- USHORT nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
+ sal_uInt16 nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
- USHORT manyLines = 1000;
+ sal_uInt16 manyLines = 1000;
Size aMinimalFloatSize = ImplCalcFloatSize( this, manyLines );
aSz.Height() = nBorderY + nLineHeight * nLines;
@@ -2379,7 +2379,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
}
-void ToolBox::ImplFormat( BOOL bResize )
+void ToolBox::ImplFormat( sal_Bool bResize )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -2399,15 +2399,15 @@ void ToolBox::ImplFormat( BOOL bResize )
long nMax; // width of layoutarea in pixels
long nX;
long nY;
- USHORT nFormatLine;
- BOOL bMustFullPaint;
- BOOL bLastSep;
+ sal_uInt16 nFormatLine;
+ sal_Bool bMustFullPaint;
+ sal_Bool bLastSep;
std::vector< ImplToolItem >::iterator it;
std::vector< ImplToolItem >::iterator temp_it;
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
- BOOL bIsInPopupMode = ImplIsInPopupMode();
+ sal_Bool bIsInPopupMode = ImplIsInPopupMode();
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
@@ -2426,9 +2426,9 @@ void ToolBox::ImplFormat( BOOL bResize )
ImplUpdateDragArea( this );
if ( ImplCalcItem() )
- bMustFullPaint = TRUE;
+ bMustFullPaint = sal_True;
else
- bMustFullPaint = FALSE;
+ bMustFullPaint = sal_False;
// calculate new size during interactive resize or
@@ -2571,7 +2571,7 @@ void ToolBox::ImplFormat( BOOL bResize )
nX = nLeft; // top-left offset
nY = nTop;
nFormatLine = 1;
- bLastSep = TRUE;
+ bLastSep = sal_True;
// save old scroll rectangles and reset them
Rectangle aOldLowerRect = maLowerRect;
@@ -2705,7 +2705,7 @@ void ToolBox::ImplFormat( BOOL bResize )
// hide double separators
if ( it->meType == TOOLBOXITEM_SEPARATOR )
{
- it->mbVisible = FALSE;
+ it->mbVisible = sal_False;
if ( !bLastSep )
{
// check if any visible items have to appear behind it
@@ -2716,18 +2716,18 @@ void ToolBox::ImplFormat( BOOL bResize )
((temp_it->meType == TOOLBOXITEM_BUTTON) &&
temp_it->mbVisible) )
{
- it->mbVisible = TRUE;
+ it->mbVisible = sal_True;
break;
}
++temp_it;
}
}
- bLastSep = TRUE;
+ bLastSep = sal_True;
}
else if ( it->mbVisible )
- bLastSep = FALSE;
+ bLastSep = sal_False;
- it->mbShowWindow = FALSE;
+ it->mbShowWindow = sal_False;
// check for line break and advance nX/nY accordingly
if ( it->mbBreak )
@@ -2908,7 +2908,7 @@ void ToolBox::ImplFormat( BOOL bResize )
}
// indicate formatting is done
- mbFormat = FALSE;
+ mbFormat = sal_False;
}
// -----------------------------------------------------------------------
@@ -2919,7 +2919,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
(mpData->m_aItems[ mnCurPos ].mnBits & TIB_DROPDOWN)
)
{
- mpData->mbDropDownByKeyboard = FALSE;
+ mpData->mbDropDownByKeyboard = sal_False;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -2928,7 +2928,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -2956,7 +2956,7 @@ IMPL_LINK( ToolBox, ImplUpdateHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL bSetColor, BOOL bRotate )
+static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, sal_Bool bSetColor, sal_Bool bRotate )
{
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
@@ -3011,10 +3011,10 @@ static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL b
pBox->SetLineColor( aOldLineColor );
}
-static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, BOOL bSetColor, BOOL bRotate )
+static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, sal_Bool bSetColor, sal_Bool bRotate )
{
- BOOL bLineColor = pBox->IsLineColor();
- BOOL bFillColor = pBox->IsFillColor();
+ sal_Bool bLineColor = pBox->IsLineColor();
+ sal_Bool bFillColor = pBox->IsFillColor();
Color aOldFillColor = pBox->GetFillColor();
Color aOldLineColor = pBox->GetLineColor();
pBox->SetLineColor();
@@ -3064,8 +3064,8 @@ static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect
pBox->SetLineColor( );
}
-void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform,
- BOOL bLeft, BOOL bTop, long nSize )
+void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform,
+ sal_Bool bLeft, sal_Bool bTop, long nSize )
{
Color aOldFillColor = pBox->GetFillColor();
WindowAlign eAlign = pBox->meAlign;
@@ -3160,7 +3160,7 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, B
}
void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
- BOOL bLeft, BOOL bTop, long nSize )
+ sal_Bool bLeft, sal_Bool bTop, long nSize )
{
WindowAlign eAlign = pBox->meAlign;
long nHalfSize;
@@ -3215,7 +3215,7 @@ void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY,
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
+void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight )
{
if( !pThis->mpData->maMenubuttonItem.maRect.IsEmpty() )
{
@@ -3226,11 +3226,11 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
// execute pending paint requests
ImplCheckUpdate( pThis );
- BOOL bFillColor = pThis->IsFillColor();
- BOOL bLineColor = pThis->IsLineColor();
+ sal_Bool bFillColor = pThis->IsFillColor();
+ sal_Bool bLineColor = pThis->IsLineColor();
Color aOldFillCol = pThis->GetFillColor();
Color aOldLineCol = pThis->GetLineColor();
- BOOL bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
+ sal_Bool bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON );
Rectangle aInnerRect( pThis->mpData->maMenubuttonItem.maRect );
if( pThis->mpData->mnMenuButtonWidth > TB_MENUBUTTON_SIZE )
@@ -3270,9 +3270,9 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
if( bHighlight )
{
if( bNativeButtons )
- ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, FALSE, TRUE, FALSE );
+ ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, sal_False, sal_True, sal_False );
else
- pThis->DrawSelectionBackground( aInnerRect, 2, FALSE, FALSE, FALSE );
+ pThis->DrawSelectionBackground( aInnerRect, 2, sal_False, sal_False, sal_False );
}
else
{
@@ -3294,7 +3294,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
aRect.Left() = aRect.Right() - aRect.getWidth()/3;
if( pThis->mpData->maMenuType & TOOLBOX_MENUTYPE_CUSTOMIZE )
- ImplDrawDropdownArrow( pThis, aRect, TRUE, !pThis->mbHorz );
+ ImplDrawDropdownArrow( pThis, aRect, sal_True, !pThis->mbHorz );
if( pThis->ImplHasClippedItems() )
{
@@ -3304,7 +3304,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
else
aRect.Right() = aRect.Left() + aRect.getWidth()/3;
- ImplDrawMoreIndicator( pThis, aRect, TRUE, !pThis->mbHorz );
+ ImplDrawMoreIndicator( pThis, aRect, sal_True, !pThis->mbHorz );
}
// store highlight state
@@ -3324,30 +3324,30 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn )
+void ToolBox::ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bTmpUpper;
- BOOL bTmpLower;
+ sal_Bool bTmpUpper;
+ sal_Bool bTmpLower;
if ( maUpperRect.IsEmpty() || maLowerRect.IsEmpty() )
return;
if ( mnCurLine > 1 )
- bTmpUpper = TRUE;
+ bTmpUpper = sal_True;
else
- bTmpUpper = FALSE;
+ bTmpUpper = sal_False;
if ( mnCurLine+mnVisLines-1 < mnCurLines )
- bTmpLower = TRUE;
+ bTmpLower = sal_True;
else
- bTmpLower = FALSE;
+ bTmpLower = sal_False;
if ( !IsEnabled() )
{
- bTmpUpper = FALSE;
- bTmpLower = FALSE;
+ bTmpUpper = sal_False;
+ bTmpLower = sal_False;
}
ImplDrawSpinButton( this, maUpperRect, maLowerRect,
@@ -3356,7 +3356,7 @@ void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn )
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawNext( BOOL bIn )
+void ToolBox::ImplDrawNext( sal_Bool bIn )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3368,7 +3368,7 @@ void ToolBox::ImplDrawNext( BOOL bIn )
// Button malen
long nX = SMALLBUTTON_OFF_NORMAL_X;
long nY = SMALLBUTTON_OFF_NORMAL_Y;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
if ( bIn == 1 )
{
nStyle |= BUTTON_DRAW_PRESSED;
@@ -3378,17 +3378,17 @@ void ToolBox::ImplDrawNext( BOOL bIn )
aDecoView.DrawButton( maNextToolRect, nStyle );
// Inhalt ausgeben
- BOOL bLeft = FALSE;
- BOOL bTop = FALSE;
+ sal_Bool bLeft = sal_False;
+ sal_Bool bTop = sal_False;
if ( mbHorz )
{
- bLeft = TRUE;
+ bLeft = sal_True;
nX += (maNextToolRect.GetWidth()-6)/2-4;
nY += (maNextToolRect.GetHeight()-6)/2-6;
}
else
{
- bTop = TRUE;
+ bTop = sal_True;
nY += (maNextToolRect.GetHeight()-6)/2-4;
nX += (maNextToolRect.GetWidth()-6)/2-6;
}
@@ -3397,14 +3397,14 @@ void ToolBox::ImplDrawNext( BOOL bIn )
nY += maNextToolRect.Top();
SetLineColor();
SetFillColor( COL_LIGHTBLUE );
- ImplDrawToolArrow( this, nX, nY, TRUE, FALSE, bLeft, bTop, 10 );
+ ImplDrawToolArrow( this, nX, nY, sal_True, sal_False, bLeft, bTop, 10 );
}
// -----------------------------------------------------------------------
-void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect )
+void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect )
{
- BOOL bNativeOk = FALSE;
+ bool bNativeOk = false;
ImplToolItem* pItem = &mpData->m_aItems[nPos];
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_SEPARATOR ) )
@@ -3450,12 +3450,12 @@ void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect )
// -----------------------------------------------------------------------
-static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow )
+static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow )
{
// draws toolbar button background either native or using a coloured selection
- // if bIsWindow is TRUE, the corresponding item is a control and only a selection border will be drawn
+ // if bIsWindow is sal_True, the corresponding item is a control and only a selection border will be drawn
- BOOL bNativeOk = FALSE;
+ sal_Bool bNativeOk = sal_False;
if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
@@ -3473,10 +3473,10 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
}
if( !bNativeOk )
- pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL );
+ pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, sal_True, bIsWindow, 2, NULL, NULL );
}
-void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout )
+void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPaint, sal_Bool bLayout )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3494,6 +3494,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
+ bHighlight = bHighlight && pItem->mbEnabled;
+
// Falls Rechteck ausserhalb des sichbaren Bereichs liegt
if ( pItem->maRect.IsEmpty() )
return;
@@ -3501,13 +3503,13 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
// no gradient background for items that have a popup open
- BOOL bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
+ sal_Bool bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId);
- BOOL bHighContrastWhite = FALSE;
+ sal_Bool bHighContrastWhite = sal_False;
// check the face color as highcontrast indicator
// because the toolbox itself might have a gradient
if( rStyleSettings.GetFaceColor() == Color( COL_WHITE ) )
- bHighContrastWhite = TRUE;
+ bHighContrastWhite = sal_True;
// Compute buttons area.
Size aBtnSize = pItem->maRect.GetSize();
@@ -3534,7 +3536,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
long nImageOffY = 0;
long nTextOffX = 0;
long nTextOffY = 0;
- USHORT nStyle = 0;
+ sal_uInt16 nStyle = 0;
// draw separators in flat style only
if ( !bLayout &&
@@ -3577,18 +3579,18 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
Size aSize( GetCtrlTextWidth( pItem->maText ), GetTextHeight() );
Point aPos( pItem->maRect.Left()+2, pItem->maRect.Top() );
aPos.Y() += (pItem->maRect.GetHeight()-aSize.Height())/2;
- BOOL bClip;
+ sal_Bool bClip;
if ( (aSize.Width() > pItem->maRect.GetWidth()-2) ||
(aSize.Height() > pItem->maRect.GetHeight()-2) )
{
- bClip = TRUE;
+ bClip = sal_True;
Rectangle aTempRect( pItem->maRect.Left()+1, pItem->maRect.Top()+1,
pItem->maRect.Right()-1, pItem->maRect.Bottom()-1 );
Region aTempRegion( aTempRect );
SetClipRegion( aTempRegion );
}
else
- bClip = FALSE;
+ bClip = sal_False;
if( bLayout )
{
mpData->m_pLayoutData->m_aLineIndices.push_back( mpData->m_pLayoutData->m_aDisplayText.Len() );
@@ -3656,8 +3658,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
nOffY += pItem->maRect.Top();
// determine what has to be drawn on the button: image, text or both
- BOOL bImage;
- BOOL bText;
+ sal_Bool bImage;
+ sal_Bool bText;
ButtonType tmpButtonType = determineButtonType( pItem, meButtonType ); // default to toolbox setting
pItem->DetermineButtonDrawStyle( tmpButtonType, bImage, bText );
@@ -3676,7 +3678,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if ( bImage && ! bLayout )
{
const Image* pImage;
- if ( bHighlight && (!(pItem->maHighImage)) == FALSE )
+ if ( bHighlight && (!(pItem->maHighImage)) == sal_False )
pImage = &(pItem->maHighImage);
else
pImage = &(pItem->maImage);
@@ -3684,7 +3686,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
aImageSize = pImage->GetSizePixel();
// determine drawing flags
- USHORT nImageStyle = 0;
+ sal_uInt16 nImageStyle = 0;
if ( !pItem->mbEnabled || !IsEnabled() )
nImageStyle |= IMAGE_DRAW_DISABLE;
@@ -3715,7 +3717,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
+ ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
if( bHighlight )
{
@@ -3727,7 +3729,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
}
// draw the text
- BOOL bRotate = FALSE;
+ sal_Bool bRotate = sal_False;
if ( bText )
{
nTextOffX = nOffX;
@@ -3738,7 +3740,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( pItem->mbVisibleText && !ImplIsFloatingMode() &&
((meAlign == WINDOWALIGN_LEFT) || (meAlign == WINDOWALIGN_RIGHT)) )
{
- bRotate = TRUE;
+ bRotate = sal_True;
Font aRotateFont = aOldFont;
/*
@@ -3781,10 +3783,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE );
+ ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False );
}
- USHORT nTextStyle = 0;
+ sal_uInt16 nTextStyle = 0;
if ( !pItem->mbEnabled )
nTextStyle |= TEXT_DRAW_DISABLE;
if( bLayout )
@@ -3806,10 +3808,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if ( pItem->mnBits & TIB_DROPDOWN )
{
Rectangle aDropDownRect( pItem->GetDropDownRect( mbHorz ) );
- BOOL bSetColor = TRUE;
+ sal_Bool bSetColor = sal_True;
if ( !pItem->mbEnabled || !IsEnabled() )
{
- bSetColor = FALSE;
+ bSetColor = sal_False;
SetFillColor( rStyleSettings.GetShadowColor() );
}
@@ -3823,7 +3825,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
if( bHasOpenPopup )
ImplDrawFloatwinBorder( pItem );
else
- ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), FALSE );
+ ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False );
}
}
ImplDrawDropdownArrow( this, aDropDownRect, bSetColor, bRotate );
@@ -3838,7 +3840,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
void ToolBox::ImplStartCustomizeMode()
{
- mbCustomizeMode = TRUE;
+ mbCustomizeMode = sal_True;
mpData->ImplClearLayoutData();
@@ -3857,7 +3859,7 @@ void ToolBox::ImplStartCustomizeMode()
}
}
-void ToolBox::SetCustomizeMode( BOOL bSet )
+void ToolBox::SetCustomizeMode( sal_Bool bSet )
{
if ( bSet )
ImplStartCustomizeMode();
@@ -3869,7 +3871,7 @@ void ToolBox::SetCustomizeMode( BOOL bSet )
void ToolBox::ImplEndCustomizeMode()
{
- mbCustomizeMode = FALSE;
+ mbCustomizeMode = sal_False;
mpData->ImplClearLayoutData();
@@ -3925,7 +3927,7 @@ void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem )
}
}
-void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
+void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -3934,9 +3936,9 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
mpFloatWin = pFloatWindow;
// redraw item, to trigger drawing of a special border
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
- mbDrag = FALSE;
+ mbDrag = sal_False;
EndTracking();
ReleaseMouse();
}
@@ -3946,7 +3948,7 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
// if focus is still in this toolbox, then the floater was opened by keyboard
// draw current item with highlight and keep old state
- BOOL bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
+ sal_Bool bWasKeyboardActivate = mpData->mbDropDownByKeyboard;
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
@@ -3966,15 +3968,15 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow )
// -----------------------------------------------------------------------
-void ToolBox::ShowLine( BOOL bNext )
+void ToolBox::ShowLine( sal_Bool bNext )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- mbFormat = TRUE;
+ mbFormat = sal_True;
if ( mpData->mbPageScroll )
{
- USHORT delta = mnVisLines;
+ sal_uInt16 delta = mnVisLines;
if ( bNext )
{
mnCurLine = mnCurLine + delta;
@@ -4002,7 +4004,7 @@ void ToolBox::ShowLine( BOOL bNext )
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
+sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat )
{
Point aMousePos = rMEvt.GetPosPixel();
@@ -4015,7 +4017,7 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
{
if ( !mnCurItemId )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
mnCurItemId = pItem->mnId;
Highlight();
}
@@ -4034,48 +4036,48 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat )
}
}
- return TRUE;
+ return sal_True;
}
if ( mbUpper )
{
- BOOL bNewIn = maUpperRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maUpperRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( mbIn, FALSE );
+ ImplDrawSpin( mbIn, sal_False );
}
- return TRUE;
+ return sal_True;
}
if ( mbLower )
{
- BOOL bNewIn = maLowerRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maLowerRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
- ImplDrawSpin( FALSE, mbIn );
+ ImplDrawSpin( sal_False, mbIn );
}
- return TRUE;
+ return sal_True;
}
if ( mbNextTool )
{
- BOOL bNewIn = maNextToolRect.IsInside( aMousePos );
+ sal_Bool bNewIn = maNextToolRect.IsInside( aMousePos );
if ( bNewIn != mbIn )
{
mbIn = bNewIn;
ImplDrawNext( mbIn );
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
+sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel )
{
ImplDisableFlatButtons();
@@ -4099,12 +4101,12 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
Deactivate();
if ( mbDrag )
- mbDrag = FALSE;
+ mbDrag = sal_False;
else
{
- mbSelection = FALSE;
+ mbSelection = sal_False;
if ( mnCurPos == TOOLBOX_ITEM_NOTFOUND )
- return TRUE;
+ return sal_True;
}
// Wurde Maus ueber dem Item losgelassen
@@ -4142,7 +4144,7 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
ImplAddDel( &aDelData );
Select();
if ( aDelData.IsDelete() )
- return TRUE;
+ return sal_True;
ImplRemoveDel( &aDelData );
}
}
@@ -4154,11 +4156,11 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
// Items nicht geloescht, im Select-Handler
if ( mnCurItemId )
{
- BOOL bHighlight;
+ sal_Bool bHighlight;
if ( (mnCurItemId == mnHighItemId) && (mnOutStyle & TOOLBOX_STYLE_FLAT) )
bHighlight = 2;
else
- bHighlight = FALSE;
+ bHighlight = sal_False;
// Get current pos for the case that items are inserted/removed
// in the toolBox
mnCurPos = GetItemPos( mnCurItemId );
@@ -4176,28 +4178,28 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel )
mnDownItemId = 0;
mnMouseClicks = 0;
mnMouseModifier = 0;
- return TRUE;
+ return sal_True;
}
else if ( mbUpper || mbLower )
{
if ( mbIn )
ShowLine( !mbUpper );
- mbUpper = FALSE;
- mbLower = FALSE;
- mbIn = FALSE;
- ImplDrawSpin( FALSE, FALSE );
- return TRUE;
+ mbUpper = sal_False;
+ mbLower = sal_False;
+ mbIn = sal_False;
+ ImplDrawSpin( sal_False, sal_False );
+ return sal_True;
}
else if ( mbNextTool )
{
- mbNextTool = FALSE;
- mbIn = FALSE;
- ImplDrawNext( FALSE );
+ mbNextTool = sal_False;
+ mbIn = sal_False;
+ ImplDrawNext( sal_False );
NextToolBox();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -4219,10 +4221,10 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
// only highlight when the focus is not inside a child window of a toolbox
// eg, in a edit control
// and do not hilight when focus is in a different toolbox
- BOOL bDrawHotSpot = TRUE;
+ sal_Bool bDrawHotSpot = sal_True;
Window *pWin = Application::GetFocusWindow();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox && pWin != this )
- bDrawHotSpot = FALSE;
+ bDrawHotSpot = sal_False;
/*
else
if( pWin && !pWin->ImplGetWindowImpl()->mbToolBox )
@@ -4231,7 +4233,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
pWin = pWin->GetParent();
if( pWin && pWin->ImplGetWindowImpl()->mbToolBox )
{
- bDrawHotSpot = FALSE;
+ bDrawHotSpot = sal_False;
break;
}
}
@@ -4239,8 +4241,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mbSelection && bDrawHotSpot )
{
- USHORT i = 0;
- USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 i = 0;
+ sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4283,7 +4285,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
{
mnCurItemId = mnHighItemId = it->mnId;
- ImplDrawItem( mnCurPos, 2 /*TRUE*/ ); // always use shadow effect (2)
+ ImplDrawItem( mnCurPos, 2 /*sal_True*/ ); // always use shadow effect (2)
}
else
mnCurItemId = mnHighItemId = 0;
@@ -4311,7 +4313,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE )
{
- USHORT nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
+ sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() );
if ( nLinePtr & DOCK_LINEHSIZE )
{
if ( meAlign == WINDOWALIGN_LEFT )
@@ -4354,7 +4356,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( bDrawHotSpot && ( ((eStyle == POINTER_ARROW) && (mnOutStyle & TOOLBOX_STYLE_HANDPOINTER)) ||
(mnOutStyle & TOOLBOX_STYLE_FLAT) || !mnOutStyle ) )
{
- BOOL bClearHigh = TRUE;
+ sal_Bool bClearHigh = sal_True;
if ( !rMEvt.IsLeaveWindow() && (mnCurPos == TOOLBOX_ITEM_NOTFOUND) )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4366,21 +4368,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) )
{
- bClearHigh = FALSE;
+ bClearHigh = sal_False;
if ( mnHighItemId != it->mnId )
{
- USHORT nTempPos = sal::static_int_cast<USHORT>(it - mpData->m_aItems.begin());
+ sal_uInt16 nTempPos = sal::static_int_cast<sal_uInt16>(it - mpData->m_aItems.begin());
if ( mnHighItemId )
{
ImplHideFocus();
- USHORT nPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nPos = GetItemPos( mnHighItemId );
ImplDrawItem( nPos );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
mnHighItemId = it->mnId;
ImplDrawItem( nTempPos, 2 );
@@ -4399,21 +4401,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
// only clear highlight when focus is not in toolbar
- BOOL bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
+ sal_Bool bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos );
if ( bClearHigh || bMenuButtonHit )
{
if ( !bMenuButtonHit && mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
if( mnHighItemId )
{
- USHORT nClearPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nClearPos = GetItemPos( mnHighItemId );
if ( nClearPos != TOOLBOX_ITEM_NOTFOUND )
{
- ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? TRUE : FALSE );
+ ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? sal_True : sal_False );
if( nClearPos != mnCurPos )
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) );
}
@@ -4423,7 +4425,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if( bMenuButtonHit )
{
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
}
}
@@ -4458,8 +4460,8 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
}
Point aMousePos = rMEvt.GetPosPixel();
- USHORT i = 0;
- USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 i = 0;
+ sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND;
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -4494,12 +4496,12 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
Rectangle aItemRect = GetItemRect( it->mnId );
mnConfigItem = it->mnId;
- BOOL bResizeItem;
+ sal_Bool bResizeItem;
if ( mbCustomizeMode && it->mbShowWindow &&
(it->maRect.Right()-TB_RESIZE_OFFSET <= aMousePos.X()) )
- bResizeItem = TRUE;
+ bResizeItem = sal_True;
else
- bResizeItem = FALSE;
+ bResizeItem = sal_False;
pMgr->StartDragging( this, aMousePos, aItemRect, 0, bResizeItem );
return;
}
@@ -4513,7 +4515,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Aktuelle Daten setzen
- USHORT nTrackFlags = 0;
+ sal_uInt16 nTrackFlags = 0;
mnCurPos = i;
mnCurItemId = it->mnId;
mnDownItemId = mnCurItemId;
@@ -4525,13 +4527,13 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbSelection )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Highlight();
}
else
{
// Hier schon bDrag setzen, da in EndSelection ausgewertet wird
- mbDrag = TRUE;
+ mbDrag = sal_True;
// Bei Doppelklick nur den Handler rufen, aber bevor der
// Button gehiltet wird, da evt. in diesem Handler der
@@ -4542,7 +4544,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbDrag )
{
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Highlight();
}
@@ -4554,7 +4556,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// dropdownonly always triggers the dropdown handler, over the whole button area
// the drop down arrow should not trigger the item action
- mpData->mbDropDownByKeyboard = FALSE;
+ mpData->mbDropDownByKeyboard = sal_False;
GetDropdownClickHdl().Call( this );
// do not reset data if the dropdown handler opened a floating window
@@ -4563,7 +4565,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// no floater was opened
Deactivate();
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
@@ -4613,9 +4615,9 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine > 1 )
{
StartTracking();
- mbUpper = TRUE;
- mbIn = TRUE;
- ImplDrawSpin( TRUE, FALSE );
+ mbUpper = sal_True;
+ mbIn = sal_True;
+ ImplDrawSpin( sal_True, sal_False );
}
return;
}
@@ -4624,25 +4626,25 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( mnCurLine+mnVisLines-1 < mnCurLines )
{
StartTracking();
- mbLower = TRUE;
- mbIn = TRUE;
- ImplDrawSpin( FALSE, TRUE );
+ mbLower = sal_True;
+ mbIn = sal_True;
+ ImplDrawSpin( sal_False, sal_True );
}
return;
}
if ( maNextToolRect.IsInside( aMousePos ) )
{
StartTracking();
- mbNextTool = TRUE;
- mbIn = TRUE;
- ImplDrawNext( TRUE );
+ mbNextTool = sal_True;
+ mbIn = sal_True;
+ ImplDrawNext( sal_True );
return;
}
// Linesizing testen
if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING )
{
- USHORT nLineMode = ImplTestLineSize( this, aMousePos );
+ sal_uInt16 nLineMode = ImplTestLineSize( this, aMousePos );
if ( nLineMode )
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
@@ -4657,7 +4659,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
// Dragging starten
pMgr->StartDragging( this, aMousePos, Rectangle( aPos, aSize ),
- nLineMode, FALSE );
+ nLineMode, sal_False );
return;
}
}
@@ -4686,7 +4688,7 @@ void ToolBox::MouseButtonUp( const MouseEvent& rMEvt )
pMgr->EndDragging();
return;
}
- mbCommandDrag = FALSE;
+ mbCommandDrag = sal_False;
DockingWindow::MouseButtonUp( rMEvt );
}
@@ -4717,9 +4719,9 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if( mpData->mbIsPaintLocked )
return;
if ( rPaintRect == Rectangle( 0, 0, mnDX-1, mnDY-1 ) )
- mbFullPaint = TRUE;
+ mbFullPaint = sal_True;
ImplFormat();
- mbFullPaint = FALSE;
+ mbFullPaint = sal_False;
ImplDrawBackground( this, rPaintRect );
@@ -4736,28 +4738,28 @@ void ToolBox::Paint( const Rectangle& rPaintRect )
if ( mnWinStyle & WB_SCROLL )
{
if ( mnCurLines > mnLines )
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
}
// NextButton zeichnen
- ImplDrawNext( FALSE );
+ ImplDrawNext( sal_False );
// Buttons zeichnen
- USHORT nHighPos;
+ sal_uInt16 nHighPos;
if ( mnHighItemId )
nHighPos = GetItemPos( mnHighItemId );
else
nHighPos = TOOLBOX_ITEM_NOTFOUND;
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
ImplToolItem* pItem = &mpData->m_aItems[i];
// Nur malen, wenn Rechteck im PaintRectangle liegt
if ( !pItem->maRect.IsEmpty() && rPaintRect.IsOver( pItem->maRect ) )
{
- BOOL bHighlight = FALSE;
+ sal_Bool bHighlight = sal_False;
if ( i == mnCurPos )
bHighlight = 1;
else if ( i == nHighPos )
@@ -4800,9 +4802,9 @@ void ToolBox::Resize()
{
if ( !mbFormat )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
if( IsReallyVisible() )
- ImplFormat( TRUE );
+ ImplFormat( sal_True );
}
}
@@ -4834,21 +4836,21 @@ void ToolBox::Resize()
}
// -----------------------------------------------------------------------
-const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
+const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4862,7 +4864,7 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
- USHORT nItemId;
+ sal_uInt16 nItemId;
Point aHelpPos;
if( !rHEvt.KeyboardActivated() )
@@ -4914,9 +4916,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4924,8 +4926,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -4963,20 +4965,20 @@ long ToolBox::Notify( NotifyEvent& rNEvt )
{
KeyEvent aKEvt = *rNEvt.GetKeyEvent();
KeyCode aKeyCode = aKEvt.GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
switch( nKeyCode )
{
case KEY_TAB:
{
// internal TAB cycling only if parent is not a dialog or if we are the ony child
// otherwise the dialog control will take over
- BOOL bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL &&
+ sal_Bool bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL &&
ImplGetParent()->GetChildCount() != 1 );
if( bNoTabCycling && ! (GetStyle() & WB_FORCETABCYCLE) )
return DockingWindow::Notify( rNEvt );
- else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? TRUE : FALSE , bNoTabCycling ) )
- return FALSE;
+ else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? sal_True : sal_False , bNoTabCycling ) )
+ return sal_False;
else
return DockingWindow::Notify( rNEvt );
}
@@ -4997,9 +4999,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt )
}
else if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB))
// Shift-TAB was pressed in the parent
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
mnLastFocusItemId = 0;
@@ -5064,7 +5066,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
// dann mache nichts
if ( (it->meType == TOOLBOXITEM_BUTTON) &&
!it->mbShowWindow )
- mbCommandDrag = TRUE;
+ mbCommandDrag = sal_True;
break;
}
@@ -5088,10 +5090,10 @@ void ToolBox::Command( const CommandEvent& rCEvt )
if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
{
if ( (mnCurLine > 1) && (pData->GetDelta() > 0) )
- ShowLine( FALSE );
+ ShowLine( sal_False );
else if ( (mnCurLine+mnVisLines-1 < mnCurLines) && (pData->GetDelta() < 0) )
- ShowLine( TRUE );
- ImplDrawSpin( FALSE, FALSE );
+ ShowLine( sal_True );
+ ImplDrawSpin( sal_False, sal_False );
return;
}
}
@@ -5118,19 +5120,19 @@ void ToolBox::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
- ImplInitSettings( TRUE, FALSE, FALSE );
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_False, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE ); // font, foreground, background
+ ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background
Invalidate();
}
}
@@ -5147,16 +5149,16 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbCalc = sal_True;
+ mbFormat = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
Invalidate();
}
}
// -----------------------------------------------------------------------
-BOOL ToolBox::PrepareToggleFloatingMode()
+sal_Bool ToolBox::PrepareToggleFloatingMode()
{
return DockingWindow::PrepareToggleFloatingMode();
}
@@ -5167,27 +5169,27 @@ void ToolBox::ToggleFloatingMode()
{
DockingWindow::ToggleFloatingMode();
- BOOL mbOldHorz = mbHorz;
+ sal_Bool mbOldHorz = mbHorz;
if ( ImplIsFloatingMode() )
{
- mbHorz = TRUE;
+ mbHorz = sal_True;
meAlign = WINDOWALIGN_TOP;
- mbScroll = TRUE;
+ mbScroll = sal_True;
if( mbOldHorz != mbHorz )
- mbCalc = TRUE; // orientation was changed !
+ mbCalc = sal_True; // orientation was changed !
ImplSetMinMaxFloatSize( this );
SetOutputSizePixel( ImplCalcFloatSize( this, mnFloatLines ) );
}
else
{
- mbScroll = (mnWinStyle & WB_SCROLL) ? TRUE : FALSE;
+ mbScroll = (mnWinStyle & WB_SCROLL) ? sal_True : sal_False;
if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) )
- mbHorz = TRUE;
+ mbHorz = sal_True;
else
- mbHorz = FALSE;
+ mbHorz = sal_False;
// set focus back to document
ImplGetFrameWindow()->GetWindow( WINDOW_CLIENT )->GrabFocus();
@@ -5197,11 +5199,11 @@ void ToolBox::ToggleFloatingMode()
{
// if orientation changes, the toolbox has to be initialized again
// to update the direction of the gradient
- mbCalc = TRUE;
- ImplInitSettings( TRUE, TRUE, TRUE );
+ mbCalc = sal_True;
+ ImplInitSettings( sal_True, sal_True, sal_True );
}
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
}
@@ -5217,13 +5219,13 @@ void ToolBox::StartDocking()
// -----------------------------------------------------------------------
-BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
+sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect )
{
// Wenn Dragging, dann nicht machen, da vorher schon berechnet
if ( mbDragging )
- return FALSE;
+ return sal_False;
- BOOL bFloatMode = FALSE;
+ sal_Bool bFloatMode = sal_False;
DockingWindow::Docking( rPos, rRect );
@@ -5236,7 +5238,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// to get a floating mode as result - switch to floating size
// so the calculation only depends on the position of the rectangle, not the current
// docking state of the window
- USHORT nTemp = 0;
+ sal_uInt16 nTemp = 0;
aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) );
// in this mode docking is never done by keyboard, so it's OK to use the mouse position
@@ -5271,7 +5273,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// FloatWindow werden
Rectangle aIntersect = aInRect.GetIntersection( aDockingRect );
if ( aIntersect == aDockingRect )
- bFloatMode = TRUE;
+ bFloatMode = sal_True;
else
{
// docking rectangle is in the "sensible area"
@@ -5325,14 +5327,14 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
}
}
else
- bFloatMode = TRUE;
+ bFloatMode = sal_True;
if ( bFloatMode )
{
meDockAlign = meAlign;
if ( !mbLastFloatMode )
{
- USHORT nTemp = 0;
+ sal_uInt16 nTemp = 0;
aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) );
}
}
@@ -5345,7 +5347,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect )
// -----------------------------------------------------------------------
-void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+void ToolBox::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode )
{
if ( !IsDockingCanceled() )
{
@@ -5362,8 +5364,8 @@ void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
void ToolBox::Resizing( Size& rSize )
{
- USHORT nCalcLines;
- USHORT nTemp;
+ sal_uInt16 nCalcLines;
+ sal_uInt16 nTemp;
// Alle Floatinggroessen berechnen
ImplCalcFloatSizes( this );
@@ -5399,20 +5401,20 @@ void ToolBox::Resizing( Size& rSize )
// -----------------------------------------------------------------------
-Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines ) const
+Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const
{
return ImplCalcSize( this, nCalcLines );
}
-Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const
+Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const
{
return ImplCalcSize( this, nCalcLines,
(eAlign == WINDOWALIGN_TOP || eAlign == WINDOWALIGN_BOTTOM) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT );
}
-USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
+sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
{
- USHORT nLines = 0;
+ sal_uInt16 nLines = 0;
std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
@@ -5427,19 +5429,19 @@ USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
Size ToolBox::CalcPopupWindowSizePixel() const
{
// count number of breaks and calc corresponding floating window size
- USHORT nLines = ImplCountLineBreaks( this );
+ sal_uInt16 nLines = ImplCountLineBreaks( this );
if( nLines )
++nLines; // add the first line
else
{
// no breaks found: use quadratic layout
- nLines = (USHORT) ceil( sqrt( (double) GetItemCount() ) );
+ nLines = (sal_uInt16) ceil( sqrt( (double) GetItemCount() ) );
}
- BOOL bPopup = mpData->mbAssumePopupMode;
+ sal_Bool bPopup = mpData->mbAssumePopupMode;
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumePopupMode = TRUE;
+ pThis->mpData->mbAssumePopupMode = sal_True;
Size aSize = CalcFloatingWindowSizePixel( nLines );
@@ -5449,24 +5451,24 @@ Size ToolBox::CalcPopupWindowSizePixel() const
Size ToolBox::CalcFloatingWindowSizePixel() const
{
- USHORT nLines = ImplCountLineBreaks( this );
+ sal_uInt16 nLines = ImplCountLineBreaks( this );
++nLines; // add the first line
return CalcFloatingWindowSizePixel( nLines );
}
-Size ToolBox::CalcFloatingWindowSizePixel( USHORT nCalcLines ) const
+Size ToolBox::CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const
{
- BOOL bFloat = mpData->mbAssumeFloating;
- BOOL bDocking = mpData->mbAssumeDocked;
+ sal_Bool bFloat = mpData->mbAssumeFloating;
+ sal_Bool bDocking = mpData->mbAssumeDocked;
// simulate floating mode and force reformat before calculating
ToolBox *pThis = (ToolBox*) this;
- pThis->mpData->mbAssumeFloating = TRUE;
- pThis->mpData->mbAssumeDocked = FALSE;
+ pThis->mpData->mbAssumeFloating = sal_True;
+ pThis->mpData->mbAssumeDocked = sal_False;
Size aSize = ImplCalcFloatSize( (ToolBox*) this, nCalcLines );
- pThis->mbFormat = TRUE;
+ pThis->mbFormat = sal_True;
pThis->mpData->mbAssumeFloating = bFloat;
pThis->mpData->mbAssumeDocked = bDocking;
@@ -5518,7 +5520,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
// -----------------------------------------------------------------------
-void ToolBox::EnableCustomize( BOOL bEnable )
+void ToolBox::EnableCustomize( sal_Bool bEnable )
{
if ( bEnable != mbCustomize )
{
@@ -5548,7 +5550,7 @@ void ToolBox::StartCustomize( const Rectangle& rRect, void* pData )
aMousePos = ScreenToOutputPixel( aPos );
Pointer aPtr;
SetPointer( aPtr );
- pMgr->StartDragging( this, aMousePos, aRect, 0, FALSE, pData );
+ pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData );
}
// -----------------------------------------------------------------------
@@ -5569,7 +5571,7 @@ void ToolBox::EndCustomizeMode()
// -----------------------------------------------------------------------
-BOOL ToolBox::IsCustomizeMode()
+sal_Bool ToolBox::IsCustomizeMode()
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
return pMgr->IsCustomizeMode();
@@ -5586,7 +5588,7 @@ void ToolBox::GetFocus()
void ToolBox::LoseFocus()
{
- ImplChangeHighlight( NULL, TRUE );
+ ImplChangeHighlight( NULL, sal_True );
DockingWindow::LoseFocus();
}
@@ -5594,10 +5596,10 @@ void ToolBox::LoseFocus()
// -----------------------------------------------------------------------
// performs the action associated with an item, ie simulates clicking the item
-void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl )
+void ToolBox::TriggerItem( sal_uInt16 nItemId, sal_Bool bShift, sal_Bool bCtrl )
{
mnHighItemId = nItemId;
- USHORT nModifier = 0;
+ sal_uInt16 nModifier = 0;
if( bShift )
nModifier |= KEY_SHIFT;
if( bCtrl )
@@ -5609,24 +5611,24 @@ void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl )
// -----------------------------------------------------------------------
// calls the button's action handler
-// returns TRUE if action was called
-BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
+// returns sal_True if action was called
+sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if( mnHighItemId )
{
ImplToolItem *pToolItem = ImplGetItem( mnHighItemId );
// #107712#, activate can also be called for disabled entries
if( pToolItem && !pToolItem->mbEnabled )
- return TRUE;
+ return sal_True;
if( pToolItem && pToolItem->mpWindow && HasFocus() )
{
ImplHideFocus();
- mbChangingHighlight = TRUE; // avoid focus change due to loose focus
+ mbChangingHighlight = sal_True; // avoid focus change due to loose focus
pToolItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
}
else
{
@@ -5648,7 +5650,7 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
}
}
mnMouseModifier = aKeyCode.GetModifier();
- mbIsKeyEvent = TRUE;
+ mbIsKeyEvent = sal_True;
Activate();
Click();
@@ -5661,18 +5663,18 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
ImplRemoveDel( &aDelData );
Deactivate();
- mbIsKeyEvent = FALSE;
+ mbIsKeyEvent = sal_False;
mnMouseModifier = 0;
}
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// -----------------------------------------------------------------------
-BOOL ImplCloseLastPopup( Window *pParent )
+sal_Bool ImplCloseLastPopup( Window *pParent )
{
// close last popup toolbox (see also:
// ImplHandleMouseFloatMode(...) in winproc.cxx )
@@ -5684,23 +5686,23 @@ BOOL ImplCloseLastPopup( Window *pParent )
if( pLastLevelFloat && pLastLevelFloat != pParent )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
// opens a drop down toolbox item
-// returns TRUE if item was opened
-BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode )
+// returns sal_True if item was opened
+sal_Bool ToolBox::ImplOpenItem( KeyCode aKeyCode )
{
- USHORT nCode = aKeyCode.GetCode();
- BOOL bRet = TRUE;
+ sal_uInt16 nCode = aKeyCode.GetCode();
+ sal_Bool bRet = sal_True;
// arrow keys should work only in the opposite direction of alignment (to not break cursor travelling)
if ( ((nCode == KEY_LEFT || nCode == KEY_RIGHT) && IsHorizontal())
|| ((nCode == KEY_UP || nCode == KEY_DOWN) && !IsHorizontal()) )
- return FALSE;
+ return sal_False;
if( IsMenuEnabled() && mpData->mbMenubuttonSelected )
{
@@ -5720,19 +5722,19 @@ BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode )
mnCurPos = GetItemPos( mnCurItemId );
mnLastFocusItemId = mnCurItemId; // save item id for possible later focus restore
mnMouseModifier = aKeyCode.GetModifier();
- mbIsShift = TRUE;
- mbIsKeyEvent = TRUE;
+ mbIsShift = sal_True;
+ mbIsKeyEvent = sal_True;
Activate();
- mpData->mbDropDownByKeyboard = TRUE;
+ mpData->mbDropDownByKeyboard = sal_True;
GetDropdownClickHdl().Call( this );
- mbIsKeyEvent = FALSE;
- mbIsShift = FALSE;
+ mbIsKeyEvent = sal_False;
+ mbIsShift = sal_False;
mnMouseModifier = 0;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
@@ -5743,10 +5745,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
mnKeyModifier = aKeyCode.GetModifier();
- USHORT nCode = aKeyCode.GetCode();
- BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
- BOOL bForwardKey = FALSE;
- BOOL bGrabFocusToDocument = FALSE;
+ sal_uInt16 nCode = aKeyCode.GetCode();
+ sal_Bool bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
+ sal_Bool bForwardKey = sal_False;
+ sal_Bool bGrabFocusToDocument = sal_False;
// #107776# we might be destroyed in the keyhandler
ImplDelData aDelData;
@@ -5760,7 +5762,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
else
ImplOpenItem( aKeyCode );
}
@@ -5770,7 +5772,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
else
ImplOpenItem( aKeyCode );
}
@@ -5780,7 +5782,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( !IsHorizontal() )
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
ImplOpenItem( aKeyCode );
}
@@ -5790,7 +5792,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( aKeyCode.GetModifier() ) // allow only pure cursor keys
break;
if( IsHorizontal() )
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
else
ImplOpenItem( aKeyCode );
}
@@ -5802,9 +5804,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine - mnVisLines;
else
mnCurLine = 1;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
@@ -5815,22 +5817,22 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
mnCurLine = mnCurLine + mnVisLines;
else
mnCurLine = mnCurLines;
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
- ImplDrawSpin( FALSE, FALSE );
+ ImplDrawSpin( sal_False, sal_False );
ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) );
}
break;
case KEY_END:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( FALSE );
+ ImplChangeHighlightUpDn( sal_False );
}
break;
case KEY_HOME:
{
ImplChangeHighlight( NULL );
- ImplChangeHighlightUpDn( TRUE );
+ ImplChangeHighlightUpDn( sal_True );
}
break;
case KEY_ESCAPE:
@@ -5863,7 +5865,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
if( !pItem->mbEnabled )
{
Sound::Beep( SOUND_DISABLE, this );
- bGrabFocusToDocument = TRUE;
+ bGrabFocusToDocument = sal_True;
}
}
if( !bGrabFocusToDocument )
@@ -5872,7 +5874,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
break;
default:
{
- USHORT aKeyGroup = aKeyCode.GetGroup();
+ sal_uInt16 aKeyGroup = aKeyCode.GetGroup();
ImplToolItem *pItem = NULL;
if( mnHighItemId )
pItem = ImplGetItem( mnHighItemId );
@@ -5881,9 +5883,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
Window *pFocusWindow = Application::GetFocusWindow();
ImplHideFocus();
- mbChangingHighlight = TRUE; // avoid focus change due to loose focus
+ mbChangingHighlight = sal_True; // avoid focus change due to loose focus
pItem->mpWindow->ImplControlFocus( GETFOCUS_TAB );
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
if( pFocusWindow != Application::GetFocusWindow() )
Application::GetFocusWindow()->KeyInput( rKEvt );
}
@@ -5893,7 +5895,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// while the toolbox has the focus
// just forward function and special keys and combinations with Alt-key
if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() )
- bForwardKey = TRUE;
+ bForwardKey = sal_True;
}
}
}
@@ -5905,7 +5907,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// #107251# move focus away if this toolbox was disabled during keyinput
if( HasFocus() && mpData->mbKeyInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL)
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFocusControl && pFocusControl != this )
pFocusControl->ImplControlFocus( GETFOCUS_INIT );
@@ -5927,10 +5929,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
// -----------------------------------------------------------------------
// returns the current toolbox line of the item
-USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
+sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
{
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
- USHORT nLine = 1;
+ sal_uInt16 nLine = 1;
while( it != mpData->m_aItems.end() )
{
if ( it->mbBreak )
@@ -5943,7 +5945,7 @@ USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
}
// returns the first displayable item in the given line
-ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine )
+ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -5975,7 +5977,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine )
}
// returns the last displayable item in the given line
-ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine )
+ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine )
{
if( !nLine || nLine > mnCurLines )
return NULL;
@@ -6009,11 +6011,11 @@ ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine )
// -----------------------------------------------------------------------
-USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
+sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList )
{
if( pItem )
{
- USHORT nPos;
+ sal_uInt16 nPos;
for( nPos = 0; nPos < rList.size(); ++nPos )
if( &rList[ nPos ] == pItem )
return nPos;
@@ -6021,34 +6023,34 @@ USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< I
return TOOLBOX_ITEM_NOTFOUND;
}
-void ToolBox::ChangeHighlight( USHORT nPos )
+void ToolBox::ChangeHighlight( sal_uInt16 nPos )
{
if ( nPos < GetItemCount() ) {
ImplGrabFocus( 0 );
- ImplChangeHighlight ( ImplGetItem ( GetItemId ( (USHORT) nPos ) ), FALSE );
+ ImplChangeHighlight ( ImplGetItem ( GetItemId ( (sal_uInt16) nPos ) ), sal_False );
}
}
-void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
+void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus )
{
// avoid recursion due to focus change
if( mbChangingHighlight )
return;
- mbChangingHighlight = TRUE;
+ mbChangingHighlight = sal_True;
ImplToolItem* pOldItem = NULL;
if ( mnHighItemId )
{
ImplHideFocus();
- USHORT nPos = GetItemPos( mnHighItemId );
+ sal_uInt16 nPos = GetItemPos( mnHighItemId );
pOldItem = ImplGetItem( mnHighItemId );
// #i89962# ImplDrawItem can cause Invalidate/Update
// which will in turn ImplShowFocus again
// set mnHighItemId to 0 already to prevent this hen/egg problem
mnHighItemId = 0;
- ImplDrawItem( nPos, FALSE );
+ ImplDrawItem( nPos, sal_False );
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) );
}
@@ -6060,21 +6062,21 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
if( pItem )
{
- USHORT aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
+ sal_uInt16 aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems );
if( aPos != TOOLBOX_ITEM_NOTFOUND)
{
// check for line breaks
- USHORT nLine = ImplGetItemLine( pItem );
+ sal_uInt16 nLine = ImplGetItemLine( pItem );
if( nLine >= mnCurLine + mnVisLines )
{
mnCurLine = nLine - mnVisLines + 1;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
else if ( nLine < mnCurLine )
{
mnCurLine = nLine;
- mbFormat = TRUE;
+ mbFormat = sal_True;
}
if( mbFormat )
@@ -6099,23 +6101,23 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus )
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
- mbChangingHighlight = FALSE;
+ mbChangingHighlight = sal_False;
}
// -----------------------------------------------------------------------
// check for keyboard accessible items
-static BOOL ImplIsValidItem( const ImplToolItem* pItem, BOOL bNotClipped )
+static sal_Bool ImplIsValidItem( const ImplToolItem* pItem, sal_Bool bNotClipped )
{
- BOOL bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
+ sal_Bool bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
if( bValid && bNotClipped && pItem->IsClipped() )
- bValid = FALSE;
+ bValid = sal_False;
return bValid;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
+sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle )
{
ImplToolItem* pToolItem = ImplGetItem( mnHighItemId );
@@ -6132,13 +6134,13 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), TRUE ) )
+ if ( ImplIsValidItem( &(*it), sal_True ) )
{
pItem = &(*it);
break;
}
}
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
ImplChangeHighlight( pItem );
}
else
@@ -6147,17 +6149,17 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), TRUE ) )
+ if ( ImplIsValidItem( &(*it), sal_True ) )
break;
++it;
}
if( it != mpData->m_aItems.end() )
{
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
ImplChangeHighlight( &(*it) );
}
}
- return TRUE;
+ return sal_True;
}
if( bUp )
@@ -6166,7 +6168,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
- if ( ImplIsValidItem( &(*it), FALSE ) )
+ if ( ImplIsValidItem( &(*it), sal_False ) )
break;
++it;
}
@@ -6175,11 +6177,11 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( (it != mpData->m_aItems.end() && &(*it) == ImplGetFirstClippedItem( this )) && IsMenuEnabled() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else
ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : NULL );
- return TRUE;
+ return sal_True;
}
else
{
@@ -6189,7 +6191,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else
{
@@ -6198,7 +6200,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
while( it != mpData->m_aItems.begin() )
{
--it;
- if ( ImplIsValidItem( &(*it), FALSE ) )
+ if ( ImplIsValidItem( &(*it), sal_False ) )
{
pItem = &(*it);
break;
@@ -6206,16 +6208,16 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
}
ImplChangeHighlight( pItem );
}
- return TRUE;
+ return sal_True;
}
}
if( pToolItem )
{
- ULONG pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
- ULONG nCount = mpData->m_aItems.size();
+ sal_uLong pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems );
+ sal_uLong nCount = mpData->m_aItems.size();
- ULONG i=0;
+ sal_uLong i=0;
do
{
if( bUp )
@@ -6223,14 +6225,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( !pos-- )
{
if( bNoCycle )
- return FALSE;
+ return sal_False;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
- return TRUE;
+ ImplDrawMenubutton( this, sal_True );
+ return sal_True;
}
else
pos = nCount-1;
@@ -6241,14 +6243,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
if( ++pos >= nCount )
{
if( bNoCycle )
- return FALSE;
+ return sal_False;
// highlight the menu button if it is the last item
if( IsMenuEnabled() && !ImplIsFloatingMode() )
{
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
- return TRUE;
+ ImplDrawMenubutton( this, sal_True );
+ return sal_True;
}
else
pos = 0;
@@ -6257,7 +6259,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
pToolItem = &mpData->m_aItems[pos];
- if ( ImplIsValidItem( pToolItem, FALSE ) )
+ if ( ImplIsValidItem( pToolItem, sal_False ) )
break;
} while( ++i < nCount);
@@ -6266,14 +6268,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle )
{
// select the menu button if a clipped item would be selected
ImplChangeHighlight( NULL );
- ImplDrawMenubutton( this, TRUE );
+ ImplDrawMenubutton( this, sal_True );
}
else if( i != nCount )
ImplChangeHighlight( pToolItem );
else
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -6286,7 +6288,7 @@ void ToolBox::ImplShowFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = TRUE;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_True;
pWin->Invalidate( 0 );
}
}
@@ -6302,7 +6304,7 @@ void ToolBox::ImplHideFocus()
if( pItem->mpWindow )
{
Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
- pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = FALSE;
+ pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_False;
pWin->Invalidate( 0 );
}
}
@@ -6310,7 +6312,7 @@ void ToolBox::ImplHideFocus()
if ( mpData->mbMenubuttonSelected )
{
// remove highlight from menubutton
- ImplDrawMenubutton( this, FALSE );
+ ImplDrawMenubutton( this, sal_False );
}
}
@@ -6330,7 +6332,7 @@ void ToolBox::ImplDisableFlatButtons()
&hkey) )
{
DWORD dwType = 0;
- WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
DWORD cbData = sizeof(Data);
if( ERROR_SUCCESS == RegQueryValueEx(hkey, "DisableFlatToolboxButtons",
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index f17c7d0ef87e..37650232fd7f 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -72,17 +72,17 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() :
mnMenuButtonWidth = TB_MENUBUTTON_SIZE;
- mbIsLocked = FALSE;
- mbNativeButtons = FALSE;
- mbIsPaintLocked = FALSE;
- mbAssumeDocked = FALSE;
- mbAssumePopupMode = FALSE;
- mbAssumeFloating = FALSE;
- mbKeyInputDisabled = FALSE;
- mbMenubuttonSelected = FALSE;
- mbPageScroll = FALSE;
- mbWillUsePopupMode = FALSE;
- mbDropDownByKeyboard = FALSE;
+ mbIsLocked = sal_False;
+ mbNativeButtons = sal_False;
+ mbIsPaintLocked = sal_False;
+ mbAssumeDocked = sal_False;
+ mbAssumePopupMode = sal_False;
+ mbAssumeFloating = sal_False;
+ mbKeyInputDisabled = sal_False;
+ mbMenubuttonSelected = sal_False;
+ mbPageScroll = sal_False;
+ mbWillUsePopupMode = sal_False;
+ mbDropDownByKeyboard = sal_False;
}
ImplToolBoxPrivateData::~ImplToolBoxPrivateData()
@@ -98,40 +98,38 @@ ImplToolItem::ImplToolItem()
mnId = 0;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = 0;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = TRUE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_True;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
- mbMirrorMode = FALSE;
- mbVisibleText = FALSE;
+ mbMirrorMode = sal_False;
+ mbVisibleText = sal_False;
}
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
ToolBoxItemBits nItemBits ) :
maImage( rImage )
{
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -141,22 +139,21 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const XubString& rText,
ToolBoxItemBits nItemBits ) :
maText( rText )
{
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -166,7 +163,7 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
// -----------------------------------------------------------------------
-ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
+ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText, ToolBoxItemBits nItemBits ) :
maImage( rImage ),
maText( rText )
@@ -174,15 +171,14 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
- mbEnabled = TRUE;
- mbVisible = TRUE;
- mbEmptyBtn = FALSE;
- mbShowWindow = FALSE;
- mbBreak = FALSE;
+ mbEnabled = sal_True;
+ mbVisible = sal_True;
+ mbEmptyBtn = sal_False;
+ mbShowWindow = sal_False;
+ mbBreak = sal_False;
mnSepSize = TB_SEP_SIZE;
mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
mnImageAngle = 0;
@@ -203,7 +199,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
maQuickHelpText ( rItem.maQuickHelpText ),
maHelpText ( rItem.maHelpText ),
maCommandStr ( rItem.maCommandStr ),
- mnHelpId ( rItem.mnHelpId ),
+ maHelpId ( rItem.maHelpId ),
maRect ( rItem.maRect ),
maCalcRect ( rItem.maCalcRect ),
maItemSize ( rItem.maItemSize ),
@@ -242,7 +238,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
maQuickHelpText = rItem.maQuickHelpText;
maHelpText = rItem.maHelpText;
maCommandStr = rItem.maCommandStr;
- mnHelpId = rItem.mnHelpId;
+ maHelpId = rItem.maHelpId;
maRect = rItem.maRect;
maCalcRect = rItem.maCalcRect;
mnSepSize = rItem.mnSepSize;
@@ -263,7 +259,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
// -----------------------------------------------------------------------
-Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, const Size& rDefaultSize )
+Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize )
{
Size aSize( rDefaultSize ); // the size of 'standard' toolbox items
// non-standard items are eg windows or buttons with text
@@ -275,13 +271,13 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons
if ( mpWindow && bHorz )
{
// get size of item window and check if it fits
- // no windows in vertical toolbars (the default is mbShowWindow=FALSE)
+ // no windows in vertical toolbars (the default is mbShowWindow=sal_False)
Size aWinSize = mpWindow->GetSizePixel();
if ( !bCheckMaxWidth || (aWinSize.Width() <= maxWidth) )
{
aSize.Width() = aWinSize.Width();
aSize.Height() = aWinSize.Height();
- mbShowWindow = TRUE;
+ mbShowWindow = sal_True;
}
else
{
@@ -317,27 +313,27 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons
// -----------------------------------------------------------------------
-void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const
+void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const
{
if ( meType != TOOLBOXITEM_BUTTON )
{
// no button -> draw nothing
- rbImage = rbText = FALSE;
+ rbImage = rbText = sal_False;
return;
}
- BOOL bHasImage;
- BOOL bHasText;
+ sal_Bool bHasImage;
+ sal_Bool bHasText;
// check for image and/or text
if ( !(maImage) )
- bHasImage = FALSE;
+ bHasImage = sal_False;
else
- bHasImage = TRUE;
+ bHasImage = sal_True;
if ( !maText.Len() )
- bHasText = FALSE;
+ bHasText = sal_False;
else
- bHasText = TRUE;
+ bHasText = sal_True;
// prefer images if symbolonly buttons are drawn
// prefer texts if textonly buttons are dreawn
@@ -346,38 +342,38 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbIma
{
if( bHasImage || !bHasText )
{
- rbImage = TRUE;
- rbText = FALSE;
+ rbImage = sal_True;
+ rbText = sal_False;
}
else
{
- rbImage = FALSE;
- rbText = TRUE;
+ rbImage = sal_False;
+ rbText = sal_True;
}
}
else if ( eButtonType == BUTTON_TEXT ) // drawing text only
{
if( bHasText || !bHasImage )
{
- rbImage = FALSE;
- rbText = TRUE;
+ rbImage = sal_False;
+ rbText = sal_True;
}
else
{
- rbImage = TRUE;
- rbText = FALSE;
+ rbImage = sal_True;
+ rbText = sal_False;
}
}
else // drawing icons and text both
{
- rbImage = TRUE;
- rbText = TRUE;
+ rbImage = sal_True;
+ rbText = sal_True;
}
}
// -----------------------------------------------------------------------
-Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const
+Rectangle ImplToolItem::GetDropDownRect( sal_Bool bHorz ) const
{
Rectangle aRect;
if( (mnBits & TIB_DROPDOWN) && !maRect.IsEmpty() )
@@ -395,7 +391,7 @@ Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const
// -----------------------------------------------------------------------
-BOOL ImplToolItem::IsClipped() const
+sal_Bool ImplToolItem::IsClipped() const
{
return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() );
}
@@ -414,16 +410,16 @@ const XubString& ToolBox::ImplConvertMenuString( const XubString& rStr )
// -----------------------------------------------------------------------
-void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
+void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint )
{
ImplUpdateInputEnable();
if ( bNewCalc )
- mbCalc = TRUE;
+ mbCalc = sal_True;
if ( bFullPaint )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -437,7 +433,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
{
if ( !mbFormat )
{
- mbFormat = TRUE;
+ mbFormat = sal_True;
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -451,7 +447,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint )
// -----------------------------------------------------------------------
-void ToolBox::ImplUpdateItem( USHORT nIndex )
+void ToolBox::ImplUpdateItem( sal_uInt16 nIndex )
{
// Muss ueberhaupt eine neue Ausgabe erfolgen
if ( IsReallyVisible() && IsUpdateMode() )
@@ -558,10 +554,10 @@ void ToolBox::UserDraw( const UserDrawEvent& )
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
+void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
{
- ULONG nObjMask;
- BOOL bImage = FALSE; // Wurde Image gesetzt
+ sal_uLong nObjMask;
+ sal_Bool bImage = sal_False; // Wurde Image gesetzt
// Item anlegen
ImplToolItem aItem;
@@ -570,7 +566,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
nObjMask = ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_ID )
- aItem.mnId = sal::static_int_cast<USHORT>(ReadLongRes());
+ aItem.mnId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
else
aItem.mnId = 1;
@@ -581,7 +577,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.mnHelpId = ReadLongRes();
+ aItem.maHelpId = ReadByteStringRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -596,22 +592,22 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
Bitmap aBmp = Bitmap( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
aItem.maImage = Image( aBmp, IMAGE_STDBTN_COLOR );
- bImage = TRUE;
+ bImage = sal_True;
}
if ( nObjMask & RSC_TOOLBOXITEM_IMAGE )
{
aItem.maImage = Image( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
- bImage = TRUE;
+ bImage = sal_True;
}
if ( nObjMask & RSC_TOOLBOXITEM_DISABLE )
- aItem.mbEnabled = !(BOOL)ReadShortRes();
+ aItem.mbEnabled = !(sal_Bool)ReadShortRes();
if ( nObjMask & RSC_TOOLBOXITEM_STATE )
aItem.meState = (TriState)ReadLongRes();
if ( nObjMask & RSC_TOOLBOXITEM_HIDE )
- aItem.mbVisible = !((BOOL)ReadShortRes());
+ aItem.mbVisible = !((sal_Bool)ReadShortRes());
if ( nObjMask & RSC_TOOLBOXITEM_COMMAND )
aItem.maCommandStr = ReadStringRes();
@@ -622,15 +618,15 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.maImage = maImageList.GetImage( aItem.mnId );
// Wenn es sich um ein ButtonItem handelt, die ID ueberpruefen
- BOOL bNewCalc;
+ sal_Bool bNewCalc;
if ( aItem.meType != TOOLBOXITEM_BUTTON )
{
- bNewCalc = FALSE;
+ bNewCalc = sal_False;
aItem.mnId = 0;
}
else
{
- bNewCalc = TRUE;
+ bNewCalc = sal_True;
DBG_ASSERT( aItem.mnId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( aItem.mnId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -645,14 +641,14 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
ImplInvalidate( bNewCalc );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -662,18 +658,18 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >(nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
+void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText,
- ToolBoxItemBits nBits, USHORT nPos )
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -683,17 +679,17 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, ImplConvertMenuString( rText ), nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertItem( sal_uInt16 nItemId, const XubString& rText,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -703,17 +699,17 @@ void ToolBox::InsertItem( USHORT nItemId, const XubString& rText,
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, ImplConvertMenuString( rText ), nBits ) );
mpData->ImplClearLayoutData();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
- ToolBoxItemBits nBits, USHORT nPos )
+void ToolBox::InsertWindow( sal_uInt16 nItemId, Window* pWindow,
+ ToolBoxItemBits nBits, sal_uInt16 nPos )
{
DBG_ASSERT( nItemId, "ToolBox::InsertWindow(): ItemId == 0" );
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
@@ -731,80 +727,80 @@ void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow,
if ( pWindow )
pWindow->Hide();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSpace( USHORT nPos )
+void ToolBox::InsertSpace( sal_uInt16 nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SPACE;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertSeparator( USHORT nPos, USHORT nPixSize )
+void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SEPARATOR;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
if ( nPixSize )
aItem.mnSepSize = nPixSize;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::InsertBreak( USHORT nPos )
+void ToolBox::InsertBreak( sal_uInt16 nPos )
{
// Item anlegen und in die Liste einfuegen
ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_BREAK;
- aItem.mbEnabled = FALSE;
+ aItem.mbEnabled = sal_False;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
+ sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
}
// -----------------------------------------------------------------------
-void ToolBox::RemoveItem( USHORT nPos )
+void ToolBox::RemoveItem( sal_uInt16 nPos )
{
if( nPos < mpData->m_aItems.size() )
{
- BOOL bMustCalc;
+ sal_Bool bMustCalc;
if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON )
- bMustCalc = TRUE;
+ bMustCalc = sal_True;
else
- bMustCalc = FALSE;
+ bMustCalc = sal_False;
if ( mpData->m_aItems[nPos].mpWindow )
mpData->m_aItems[nPos].mpWindow->Hide();
@@ -830,9 +826,9 @@ void ToolBox::RemoveItem( USHORT nPos )
// -----------------------------------------------------------------------
-void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
+void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos == nNewPos )
return;
@@ -850,14 +846,14 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
mpData->ImplClearLayoutData();
// ToolBox neu ausgeben
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) );
else
{
- USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -865,13 +861,13 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos )
// -----------------------------------------------------------------------
-void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
- USHORT nNewPos )
+void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId,
+ sal_uInt16 nNewPos )
{
DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
"ToolBox::CopyItem(): ItemId already exists" );
- USHORT nPos = rToolBox.GetItemPos( nItemId );
+ sal_uInt16 nPos = rToolBox.GetItemPos( nItemId );
// Existiert Item
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -880,15 +876,15 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId,
ImplToolItem aNewItem = rToolBox.mpData->m_aItems[nPos];
// Bestimme Daten zuruecksetzen
aNewItem.mpWindow = NULL;
- aNewItem.mbShowWindow = FALSE;
+ aNewItem.mbShowWindow = sal_False;
mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aNewItem );
mpData->ImplClearLayoutData();
// ToolBox neu ausgeben
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
// Notify
- USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
+ sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos);
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) );
}
}
@@ -907,10 +903,10 @@ void ToolBox::CopyItems( const ToolBox& rToolBox )
it != mpData->m_aItems.end(); ++it )
{
it->mpWindow = NULL;
- it->mbShowWindow = FALSE;
+ it->mbShowWindow = sal_False;
}
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -927,7 +923,7 @@ void ToolBox::Clear()
mnCurItemId = 0;
mnHighItemId = 0;
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
// Notify
ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED );
@@ -943,7 +939,7 @@ void ToolBox::SetButtonType( ButtonType eNewType )
// Hier besser alles neu ausgeben, da es ansonsten zu Problemen
// mit den per CopyBits kopierten Bereichen geben kann
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
}
}
@@ -954,8 +950,8 @@ void ToolBox::SetToolboxButtonSize( ToolBoxButtonSize eSize )
if( mpData->meButtonSize != eSize )
{
mpData->meButtonSize = eSize;
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
}
}
@@ -970,10 +966,10 @@ const Size& ToolBox::GetDefaultImageSize() const
{
static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE );
- static ULONG s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
+ static sal_uLong s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT;
static Size aLargeButtonSize( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE );
- ULONG nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
+ sal_uLong nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle();
if ( s_nSymbolsStyle != nSymbolsStyle )
{
s_nSymbolsStyle = nSymbolsStyle;
@@ -1008,13 +1004,13 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
{
// Setzen, ob Items horizontal oder vertikal angeordnet werden sollen
if ( (eNewAlign == WINDOWALIGN_LEFT) || (eNewAlign == WINDOWALIGN_RIGHT) )
- mbHorz = FALSE;
+ mbHorz = sal_False;
else
- mbHorz = TRUE;
+ mbHorz = sal_True;
// Hier alles neu ausgeben, da sich Border auch aendert
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1023,7 +1019,7 @@ void ToolBox::SetAlign( WindowAlign eNewAlign )
// -----------------------------------------------------------------------
-void ToolBox::SetLineCount( USHORT nNewLines )
+void ToolBox::SetLineCount( sal_uInt16 nNewLines )
{
if ( !nNewLines )
nNewLines = 1;
@@ -1034,18 +1030,18 @@ void ToolBox::SetLineCount( USHORT nNewLines )
// Hier besser alles neu ausgeben, da es ansonsten zu Problemen
// mit den per CopyBits kopierten Bereichen geben kann
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
}
}
// -----------------------------------------------------------------------
-void ToolBox::SetPageScroll( BOOL b )
+void ToolBox::SetPageScroll( sal_Bool b )
{
mpData->mbPageScroll = b;
}
-BOOL ToolBox::GetPageScroll()
+sal_Bool ToolBox::GetPageScroll()
{
return mpData->mbPageScroll;
}
@@ -1054,45 +1050,45 @@ BOOL ToolBox::GetPageScroll()
void ToolBox::SetNextToolBox( const XubString& rStr )
{
- BOOL bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
+ sal_Bool bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len());
maNextToolBoxStr = rStr;
if ( bCalcNew )
- ImplInvalidate( TRUE, FALSE );
+ ImplInvalidate( sal_True, sal_False );
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemCount() const
+sal_uInt16 ToolBox::GetItemCount() const
{
- return (USHORT)mpData->m_aItems.size();
+ return (sal_uInt16)mpData->m_aItems.size();
}
// -----------------------------------------------------------------------
-ToolBoxItemType ToolBox::GetItemType( USHORT nPos ) const
+ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : TOOLBOXITEM_DONTKNOW;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemPos( USHORT nItemId ) const
+sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const
{
int nCount = mpData->m_aItems.size();
for( int nPos = 0; nPos < nCount; nPos++ )
if( mpData->m_aItems[nPos].mnId == nItemId )
- return (USHORT)nPos;
+ return (sal_uInt16)nPos;
return TOOLBOX_ITEM_NOTFOUND;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemPos( const Point& rPos ) const
+sal_uInt16 ToolBox::GetItemPos( const Point& rPos ) const
{
// search the item position on the given point
- USHORT nRet = TOOLBOX_ITEM_NOTFOUND;
- USHORT nPos = 0;
+ sal_uInt16 nRet = TOOLBOX_ITEM_NOTFOUND;
+ sal_uInt16 nPos = 0;
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
while( it != mpData->m_aItems.end() )
{
@@ -1112,14 +1108,14 @@ USHORT ToolBox::GetItemPos( const Point& rPos ) const
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemId( USHORT nPos ) const
+sal_uInt16 ToolBox::GetItemId( sal_uInt16 nPos ) const
{
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].mnId : 0;
}
// -----------------------------------------------------------------------
-USHORT ToolBox::GetItemId( const Point& rPos ) const
+sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
{
// Item suchen, das geklickt wurde
std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin();
@@ -1197,25 +1193,25 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize )
}
-Point ToolBox::GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const
+Point ToolBox::GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const
{
return ImplGetPopupPosition( GetItemRect( nItemId ), rSize );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemRect( USHORT nItemId ) const
+Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
return GetItemPosRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const
+Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1227,18 +1223,18 @@ Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemDropDownRect( USHORT nItemId ) const
+Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
return GetItemPosDropDownRect( nPos );
}
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetItemPosDropDownRect( USHORT nPos ) const
+Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
@@ -1256,24 +1252,24 @@ Rectangle ToolBox::GetMenubuttonRect() const
return mpData->maMenubuttonItem.maRect;
}
-BOOL ToolBox::ImplHasExternalMenubutton()
+sal_Bool ToolBox::ImplHasExternalMenubutton()
{
// check if the borderwindow (i.e. the decoration) provides the menu button
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( ImplIsFloatingMode() )
{
// custom menu is placed in the decoration
ImplBorderWindow *pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( WINDOW_BORDER ) );
if( pBorderWin && !pBorderWin->GetMenuRect().IsEmpty() )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits )
+void ToolBox::SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1282,15 +1278,15 @@ void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits )
nBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN;
nOldBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN;
// trigger reformat when the item width has changed (dropdown arrow)
- BOOL bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
+ sal_Bool bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN);
if ( nBits != nOldBits )
- ImplInvalidate( TRUE, bFormat );
+ ImplInvalidate( sal_True, bFormat );
}
}
// -----------------------------------------------------------------------
-ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const
+ToolBoxItemBits ToolBox::GetItemBits( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1302,9 +1298,9 @@ ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemData( USHORT nItemId, void* pNewData )
+void ToolBox::SetItemData( sal_uInt16 nItemId, void* pNewData )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
{
@@ -1315,7 +1311,7 @@ void ToolBox::SetItemData( USHORT nItemId, void* pNewData )
// -----------------------------------------------------------------------
-void* ToolBox::GetItemData( USHORT nItemId ) const
+void* ToolBox::GetItemData( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1327,9 +1323,9 @@ void* ToolBox::GetItemData( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage )
+void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1340,7 +1336,7 @@ void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage )
Size aOldSize = pItem->maImage.GetSizePixel();
pItem->maImage = rImage;
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1355,8 +1351,8 @@ void ToolBox::SetImageList( const ImageList& rImageList )
{
maImageList = rImageList;
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
Image aImage;
if ( mpData->m_aItems[i].mnId )
@@ -1378,9 +1374,9 @@ static Image ImplRotImage( const Image& rImage, long nAngle10 )
return Image( aRotBitmapEx );
}
-void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 )
+void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1402,7 +1398,7 @@ void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 )
if ( !mbCalc )
{
if ( aOldSize != pItem->maImage.GetSizePixel() )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1421,9 +1417,9 @@ static Image ImplMirrorImage( const Image& rImage )
return Image( aMirrBitmapEx );
}
-void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
+void ToolBox::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1449,7 +1445,7 @@ void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror )
// -----------------------------------------------------------------------
-Image ToolBox::GetItemImage( USHORT nItemId ) const
+Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1461,7 +1457,7 @@ Image ToolBox::GetItemImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-long ToolBox::GetItemImageAngle( USHORT nItemId ) const
+long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1473,32 +1469,32 @@ long ToolBox::GetItemImageAngle( USHORT nItemId ) const
// -----------------------------------------------------------------------
-BOOL ToolBox::GetItemImageMirrorMode( USHORT nItemId ) const
+sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbMirrorMode;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemHighImage( USHORT nItemId, const Image& rImage )
+void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
{
DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) ||
- ((!rImage) == TRUE), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
+ ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" );
pItem->maHighImage = rImage;
}
}
// -----------------------------------------------------------------------
-Image ToolBox::GetItemHighImage( USHORT nItemId ) const
+Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1510,9 +1506,9 @@ Image ToolBox::GetItemHighImage( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1525,7 +1521,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
pItem->maText = ImplConvertMenuString( rText );
mpData->ImplClearLayoutData();
if ( nOldWidth != GetCtrlTextWidth( pItem->maText ) )
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
else
ImplUpdateItem( nPos );
}
@@ -1542,7 +1538,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemText( USHORT nItemId ) const
+const XubString& ToolBox::GetItemText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1554,9 +1550,9 @@ const XubString& ToolBox::GetItemText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow )
+void ToolBox::SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1564,14 +1560,14 @@ void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow )
pItem->mpWindow = pNewWindow;
if ( pNewWindow )
pNewWindow->Hide();
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED, reinterpret_cast< void* >( nPos ) );
}
}
// -----------------------------------------------------------------------
-Window* ToolBox::GetItemWindow( USHORT nItemId ) const
+Window* ToolBox::GetItemWindow( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1590,7 +1586,7 @@ void ToolBox::StartSelection()
if ( !mbSelection )
{
- mbSelection = TRUE;
+ mbSelection = sal_True;
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
mnCurItemId = 0;
Activate();
@@ -1601,13 +1597,13 @@ void ToolBox::StartSelection()
void ToolBox::EndSelection()
{
- mbCommandDrag = FALSE;
+ mbCommandDrag = sal_False;
if ( mbDrag || mbSelection )
{
// Daten zuruecksetzen
- mbDrag = FALSE;
- mbSelection = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND )
ImplDrawItem( mnCurPos );
EndTracking();
@@ -1624,9 +1620,9 @@ void ToolBox::EndSelection()
// -----------------------------------------------------------------------
-void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
+void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1635,7 +1631,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
if ( nPos != mnCurPos )
{
mnCurPos = nPos;
- ImplDrawItem( mnCurPos, TRUE );
+ ImplDrawItem( mnCurPos, sal_True );
Flush();
}
}
@@ -1643,7 +1639,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
{
if ( nPos == mnCurPos )
{
- ImplDrawItem( mnCurPos, FALSE );
+ ImplDrawItem( mnCurPos, sal_False );
Flush();
mnCurPos = TOOLBOX_ITEM_NOTFOUND;
}
@@ -1653,8 +1649,8 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
{
if ( mbDrag || mbSelection )
{
- mbDrag = FALSE;
- mbSelection = FALSE;
+ mbDrag = sal_False;
+ mbSelection = sal_False;
EndTracking();
ReleaseMouse();
Deactivate();
@@ -1670,21 +1666,21 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease )
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemDown( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
return (nPos == mnCurPos);
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::SetItemState( USHORT nItemId, TriState eState )
+void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
@@ -1698,8 +1694,8 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState )
(pItem->mnBits & TIB_RADIOCHECK) )
{
ImplToolItem* pGroupItem;
- USHORT nGroupPos;
- USHORT nItemCount = GetItemCount();
+ sal_uInt16 nGroupPos;
+ sal_uInt16 nItemCount = GetItemCount();
nGroupPos = nPos;
while ( nGroupPos )
@@ -1744,7 +1740,7 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState )
// -----------------------------------------------------------------------
-TriState ToolBox::GetItemState( USHORT nItemId ) const
+TriState ToolBox::GetItemState( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1756,15 +1752,15 @@ TriState ToolBox::GetItemState( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable )
+void ToolBox::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
{
ImplToolItem* pItem = &mpData->m_aItems[nPos];
if ( bEnable )
- bEnable = TRUE;
+ bEnable = sal_True;
if ( pItem->mbEnabled != bEnable )
{
pItem->mbEnabled = bEnable;
@@ -1788,21 +1784,21 @@ void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable )
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemEnabled( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemEnabled( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbEnabled;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible )
+void ToolBox::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible )
{
- USHORT nPos = GetItemPos( nItemId );
+ sal_uInt16 nPos = GetItemPos( nItemId );
mpData->ImplClearLayoutData();
if ( nPos != TOOLBOX_ITEM_NOTFOUND )
@@ -1811,36 +1807,36 @@ void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible )
if ( pItem->mbVisible != bVisible )
{
pItem->mbVisible = bVisible;
- ImplInvalidate( FALSE );
+ ImplInvalidate( sal_False );
}
}
}
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemVisible( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemVisible( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
return pItem->mbVisible;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const
+sal_Bool ToolBox::IsItemReallyVisible( sal_uInt16 nItemId ) const
{
// is the item on the visible area of the toolbox?
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Rectangle aRect( mnLeftBorder, mnTopBorder, mnDX-mnRightBorder, mnDY-mnBottomBorder );
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem && pItem->mbVisible &&
!pItem->maRect.IsEmpty() && aRect.IsOver( pItem->maRect ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
@@ -1848,7 +1844,7 @@ BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand )
+void ToolBox::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1858,7 +1854,7 @@ void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const
+const XubString& ToolBox::GetItemCommand( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1870,7 +1866,7 @@ const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1880,7 +1876,7 @@ void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const
+const XubString& ToolBox::GetQuickHelpText( sal_uInt16 nItemId ) const
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1892,7 +1888,7 @@ const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText )
+void ToolBox::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
@@ -1902,31 +1898,38 @@ void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText )
// -----------------------------------------------------------------------
-const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
+const XubString& ToolBox::GetHelpText( sal_uInt16 nItemId ) const
{
return ImplGetHelpText( nItemId );
}
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void ToolBox::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG ToolBox::GetHelpId( USHORT nItemId ) const
+rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const
{
+ rtl::OString aRet;
+
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ {
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1936,12 +1939,12 @@ void ToolBox::SetBorder( long nX, long nY )
mnBorderX = nX;
mnBorderY = nY;
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
}
// -----------------------------------------------------------------------
-void ToolBox::SetOutStyle( USHORT nNewStyle )
+void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
{
// always force flat looking toolbars since NWF
nNewStyle |= TOOLBOX_STYLE_FLAT;
@@ -1958,7 +1961,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle )
mnMaxItemHeight = 1;
}
- ImplInvalidate( TRUE, TRUE );
+ ImplInvalidate( sal_True, sal_True );
}
}
@@ -1966,7 +1969,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle )
void ToolBox::RecalcItems()
{
- ImplInvalidate( TRUE );
+ ImplInvalidate( sal_True );
}
// -----------------------------------------------------------------------
@@ -1981,11 +1984,11 @@ void ToolBox::ImplUpdateInputEnable()
if( it->mbEnabled )
{
// at least one useful entry
- mpData->mbKeyInputDisabled = FALSE;
+ mpData->mbKeyInputDisabled = sal_False;
return;
}
}
- mpData->mbKeyInputDisabled = TRUE;
+ mpData->mbKeyInputDisabled = sal_True;
}
// -----------------------------------------------------------------------
@@ -1994,14 +1997,14 @@ void ToolBox::ImplFillLayoutData() const
{
mpData->m_pLayoutData = new ToolBoxLayoutData();
- USHORT nCount = (USHORT)mpData->m_aItems.size();
- for( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
ImplToolItem* pItem = &mpData->m_aItems[i];
// Nur malen, wenn Rechteck im PaintRectangle liegt
if ( !pItem->maRect.IsEmpty() )
- const_cast<ToolBox*>(this)->ImplDrawItem( i, FALSE, FALSE, TRUE );
+ const_cast<ToolBox*>(this)->ImplDrawItem( i, sal_False, sal_False, sal_True );
}
}
@@ -2016,14 +2019,14 @@ String ToolBox::GetDisplayText() const
// -----------------------------------------------------------------------
-Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const
+Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const
{
long nItemIndex = -1;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
if( mpData->m_pLayoutData )
{
- for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
+ for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ )
{
if( mpData->m_pLayoutData->m_aLineItemIds[i] == nItemID )
{
@@ -2037,7 +2040,7 @@ Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const
// -----------------------------------------------------------------------
-long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
+long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const
{
long nIndex = -1;
rItemID = 0;
@@ -2046,7 +2049,7 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const
if( mpData->m_pLayoutData )
{
nIndex = mpData->m_pLayoutData->GetIndexForPoint( rPoint );
- for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ )
+ for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ )
{
if( mpData->m_pLayoutData->m_aLineIndices[i] <= nIndex &&
(i == mpData->m_pLayoutData->m_aLineIndices.size()-1 || mpData->m_pLayoutData->m_aLineIndices[i+1] > nIndex) )
@@ -2079,12 +2082,12 @@ Pair ToolBox::GetTextStartEnd( long nText ) const
// -----------------------------------------------------------------------
-USHORT ToolBox::GetDisplayItemId( long nText ) const
+sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const
{
- USHORT nItemId = 0;
+ sal_uInt16 nItemId = 0;
if( ! mpData->m_pLayoutData )
ImplFillLayoutData();
- if( mpData->m_pLayoutData && nText >= 0 && (ULONG)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
+ if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() )
nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText];
return nItemId;
}
@@ -2104,7 +2107,7 @@ const Link& ToolBox::GetDropdownClickHdl() const
// -----------------------------------------------------------------------
-void ToolBox::SetMenuType( USHORT aType )
+void ToolBox::SetMenuType( sal_uInt16 aType )
{
if( aType != mpData->maMenuType )
{
@@ -2114,9 +2117,9 @@ void ToolBox::SetMenuType( USHORT aType )
// the menu button may have to be moved into the decoration which changes the layout
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( pWrapper )
- pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE );
+ pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False );
- mbFormat = TRUE;
+ mbFormat = sal_True;
ImplFormat();
ImplSetMinMaxFloatSize( this );
}
@@ -2129,12 +2132,12 @@ void ToolBox::SetMenuType( USHORT aType )
}
}
-USHORT ToolBox::GetMenuType() const
+sal_uInt16 ToolBox::GetMenuType() const
{
return mpData->maMenuType;
}
-BOOL ToolBox::IsMenuEnabled() const
+sal_Bool ToolBox::IsMenuEnabled() const
{
return mpData->maMenuType != TOOLBOX_MENUTYPE_NONE;
}
@@ -2156,7 +2159,7 @@ const Link& ToolBox::GetMenuButtonHdl() const
// -----------------------------------------------------------------------
-BOOL ToolBox::ImplHasClippedItems()
+sal_Bool ToolBox::ImplHasClippedItems()
{
// are any items currently clipped ?
ImplFormat();
@@ -2164,10 +2167,10 @@ BOOL ToolBox::ImplHasClippedItems()
while ( it != mpData->m_aItems.end() )
{
if( it->IsClipped() )
- return TRUE;
+ return sal_True;
++it;
}
- return FALSE;
+ return sal_False;
}
void ToolBox::ImplUpdateCustomMenu()
@@ -2178,7 +2181,7 @@ void ToolBox::ImplUpdateCustomMenu()
PopupMenu *pMenu = GetMenu();
- USHORT i = 0;
+ sal_uInt16 i = 0;
// remove old entries
while( i < pMenu->GetItemCount() )
{
@@ -2199,7 +2202,7 @@ void ToolBox::ImplUpdateCustomMenu()
{
if( it->IsClipped() )
{
- USHORT id = it->mnId + TOOLBOX_MENUITEM_START;
+ sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
pMenu->InsertItem( id, it->maText, it->maImage, 0, 0 );
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem( id, it->meState == STATE_CHECK );
@@ -2212,9 +2215,9 @@ IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent*, pEvent )
{
if( pEvent->GetMenu() == GetMenu() && pEvent->GetId() == VCLEVENT_MENU_SELECT )
{
- USHORT id = GetMenu()->GetItemId( pEvent->GetItemPos() );
+ sal_uInt16 id = GetMenu()->GetItemId( pEvent->GetItemPos() );
if( id >= TOOLBOX_MENUITEM_START )
- TriggerItem( id - TOOLBOX_MENUITEM_START, FALSE, FALSE );
+ TriggerItem( id - TOOLBOX_MENUITEM_START, sal_False, sal_False );
}
return 0;
}
@@ -2262,7 +2265,7 @@ void ToolBox::ImplExecuteCustomMenu()
}
}
- USHORT uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
+ sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE );
if ( aDelData.IsDelete() )
@@ -2299,24 +2302,24 @@ void ToolBox::ExecuteCustomMenu()
// -----------------------------------------------------------------------
// checks override first, useful during calculation of sizes
-BOOL ToolBox::ImplIsFloatingMode() const
+sal_Bool ToolBox::ImplIsFloatingMode() const
{
DBG_ASSERT( !(mpData->mbAssumeDocked && mpData->mbAssumeFloating),
"ToolBox::ImplIsFloatingMode(): cannot assume docked and floating" );
if( mpData->mbAssumeDocked )
- return FALSE;
+ return sal_False;
else if( mpData->mbAssumeFloating )
- return TRUE;
+ return sal_True;
else
return IsFloatingMode();
}
// checks override first, useful during calculation of sizes
-BOOL ToolBox::ImplIsInPopupMode() const
+sal_Bool ToolBox::ImplIsInPopupMode() const
{
if( mpData->mbAssumePopupMode )
- return TRUE;
+ return sal_True;
else
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
@@ -2326,7 +2329,7 @@ BOOL ToolBox::ImplIsInPopupMode() const
// -----------------------------------------------------------------------
-void ToolBox::Lock( BOOL bLock )
+void ToolBox::Lock( sal_Bool bLock )
{
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
if( !pWrapper )
@@ -2336,8 +2339,8 @@ void ToolBox::Lock( BOOL bLock )
mpData->mbIsLocked = bLock;
if( !ImplIsFloatingMode() )
{
- mbCalc = TRUE;
- mbFormat = TRUE;
+ mbCalc = sal_True;
+ mbFormat = sal_True;
SetSizePixel( CalcWindowSizePixel(1) );
Invalidate();
}
@@ -2346,7 +2349,7 @@ void ToolBox::Lock( BOOL bLock )
// -----------------------------------------------------------------------
-BOOL ToolBox::AlwaysLocked()
+sal_Bool ToolBox::AlwaysLocked()
{
// read config item to determine toolbox behaviour, used for subtoolbars
@@ -2362,35 +2365,35 @@ BOOL ToolBox::AlwaysLocked()
if ( aNode.isValid() )
{
// feature enabled ?
- BOOL bStatesEnabled = BOOL();
+ sal_Bool bStatesEnabled = sal_Bool();
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("StatesEnabled")) );
if( aValue >>= bStatesEnabled )
{
- if( bStatesEnabled == TRUE )
+ if( bStatesEnabled == sal_True )
{
// now read the locking state
utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States")) ); // note: case sensisitive !
- BOOL bLocked = BOOL();
+ sal_Bool bLocked = sal_Bool();
::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Locked")) );
if( aValue2 >>= bLocked )
- nAlwaysLocked = (bLocked == TRUE) ? 1 : 0;
+ nAlwaysLocked = (bLocked == sal_True) ? 1 : 0;
}
}
}
}
- return nAlwaysLocked == 1 ? TRUE : FALSE;
+ return nAlwaysLocked == 1 ? sal_True : sal_False;
}
-BOOL ToolBox::WillUsePopupMode() const
+sal_Bool ToolBox::WillUsePopupMode() const
{
return mpData->mbWillUsePopupMode;
}
-void ToolBox::WillUsePopupMode( BOOL b )
+void ToolBox::WillUsePopupMode( sal_Bool b )
{
mpData->mbWillUsePopupMode = b;
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b20a82d1dc7b..5a5379da2ffa 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -34,14 +34,12 @@
#include "vcl/salinst.hxx"
#include "vcl/salgtype.hxx"
#include "vcl/salgdi.hxx"
-#include "vcl/salctrlhandle.hxx"
#include "vcl/unohelp.hxx"
#include "tools/time.hxx"
#include "tools/debug.hxx"
#include "tools/rc.h"
#include "vcl/svdata.hxx"
-#include "vcl/windata.hxx"
#include "vcl/dbggui.hxx"
#include "vcl/outfont.hxx"
#include "vcl/outdev.h"
@@ -65,6 +63,7 @@
#include "unotools/fontcfg.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
+#include "vcl/salctype.hxx"
#include "vcl/button.hxx" // Button::GetStandardText
#include "vcl/taskpanelist.hxx"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -87,7 +86,6 @@
#include "vcl/unowrap.hxx"
#include "vcl/dndlcon.hxx"
#include "vcl/dndevdis.hxx"
-#include "vcl/impbmpconv.hxx"
#include "unotools/confignode.hxx"
#include "vcl/gdimtf.hxx"
#include <sal/macros.h>
@@ -114,12 +112,12 @@ DBG_NAME( Window )
// =======================================================================
-#define IMPL_PAINT_PAINT ((USHORT)0x0001)
-#define IMPL_PAINT_PAINTALL ((USHORT)0x0002)
-#define IMPL_PAINT_PAINTALLCHILDS ((USHORT)0x0004)
-#define IMPL_PAINT_PAINTCHILDS ((USHORT)0x0008)
-#define IMPL_PAINT_ERASE ((USHORT)0x0010)
-#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020)
+#define IMPL_PAINT_PAINT ((sal_uInt16)0x0001)
+#define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002)
+#define IMPL_PAINT_PAINTALLCHILDS ((sal_uInt16)0x0004)
+#define IMPL_PAINT_PAINTCHILDS ((sal_uInt16)0x0008)
+#define IMPL_PAINT_ERASE ((sal_uInt16)0x0010)
+#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020)
// -----------------------------------------------------------------------
@@ -134,25 +132,21 @@ struct ImplCalcToTopData
Region* mpInvalidateRegion;
};
-struct ImplAccessibleInfos
+ImplAccessibleInfos::ImplAccessibleInfos()
{
- USHORT nAccessibleRole;
- String* pAccessibleName;
- String* pAccessibleDescription;
-
- ImplAccessibleInfos()
- {
- nAccessibleRole = 0xFFFF;
- pAccessibleName = NULL;
- pAccessibleDescription = NULL;
- }
+ nAccessibleRole = 0xFFFF;
+ pAccessibleName = NULL;
+ pAccessibleDescription = NULL;
+ pLabeledByWindow = NULL;
+ pLabelForWindow = NULL;
+ pMemberOfWindow = NULL;
+}
- ~ImplAccessibleInfos()
- {
- delete pAccessibleName;
- delete pAccessibleDescription;
- }
-};
+ImplAccessibleInfos::~ImplAccessibleInfos()
+{
+ delete pAccessibleName;
+ delete pAccessibleDescription;
+}
// -----------------------------------------------------------------------
@@ -268,29 +262,53 @@ bool Window::ImplCheckUIFont( const Font& rFont )
if( ImplGetSVData()->maGDIData.mbNativeFontConfig )
return true;
+ // create a text string using the localized text of important buttons
String aTestText;
- aTestText.Append( Button::GetStandardText( BUTTON_OK ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CANCEL ) );
- aTestText.Append( Button::GetStandardText( BUTTON_YES ) );
- aTestText.Append( Button::GetStandardText( BUTTON_NO ) );
- aTestText.Append( Button::GetStandardText( BUTTON_RETRY ) );
- aTestText.Append( Button::GetStandardText( BUTTON_HELP ) );
- aTestText.Append( Button::GetStandardText( BUTTON_CLOSE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_MORE ) );
- aTestText.Append( Button::GetStandardText( BUTTON_LESS ) );
- aTestText.Append( Button::GetStandardText( BUTTON_ABORT ) );
+ static const StandardButtonType aTestButtons[] =
+ {
+ BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT,
+ BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_IGNORE,
+ BUTTON_RETRY, BUTTON_HELP
+ };
+
+ const int nTestButtonCount = sizeof(aTestButtons)/sizeof(*aTestButtons);
+ for( int n = 0; n < nTestButtonCount; ++n )
+ {
+ String aButtonStr = Button::GetStandardText( aTestButtons[n] );
+ // #i115432# ignore mnemonic+accelerator part of each string
+ // TODO: use a string filtering method when it becomes available
+ const int nLen = aButtonStr.Len();
+ bool bInside = false;
+ for( int i = 0; i < nLen; ++i ) {
+ const sal_Unicode c = aButtonStr.GetChar( i );
+ if( (c == '('))
+ bInside = true;
+ if( (c == ')'))
+ bInside = false;
+ if( (c == '~')
+ || (c == '(') || (c == ')')
+ || ((c >= 'A') && (c <= 'Z') && bInside) )
+ aButtonStr.SetChar( i, ' ' );
+ }
+ // append sanitized button text to test string
+ aTestText.Append( aButtonStr );
+ }
- return HasGlyphs( rFont, aTestText ) >= aTestText.Len();
+ const int nFirstChar = HasGlyphs( rFont, aTestText );
+ const bool bUIFontOk = (nFirstChar >= aTestText.Len());
+ return bUIFontOk;
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
+void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl )
{
StyleSettings aTmpSt( rSettings.GetStyleSettings() );
- aTmpSt.SetHighContrastMode( FALSE );
+ aTmpSt.SetHighContrastMode( sal_False );
rSettings.SetStyleSettings( aTmpSt );
ImplGetFrame()->UpdateSettings( rSettings );
+ // reset default border width for layouters
+ ImplGetSVData()->maAppData.mnDefaultLayoutBorder = -1;
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
@@ -490,7 +508,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
|| rSettings.GetStyleSettings().GetWindowColor().IsDark() )
{
aStyleSettings = rSettings.GetStyleSettings();
- aStyleSettings.SetHighContrastMode( TRUE );
+ aStyleSettings.SetHighContrastMode( sal_True );
aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -500,7 +518,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
static const char* pEnvHC = getenv( "SAL_FORCE_HC" );
if( pEnvHC && *pEnvHC )
{
- aStyleSettings.SetHighContrastMode( TRUE );
+ aStyleSettings.SetHighContrastMode( sal_True );
aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -595,6 +613,7 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mpDlgCtrlDownWindow = NULL; // window for dialog control
mpWindowImpl->mpFirstDel = NULL; // Dtor notification list
mpWindowImpl->mpUserData = NULL; // user data
+ mpWindowImpl->mpExtImpl = NULL; // extended implementation data
mpWindowImpl->mpCursor = NULL; // cursor
mpWindowImpl->mpControlFont = NULL; // font propertie
mpWindowImpl->mpVCLXWindow = NULL;
@@ -608,8 +627,6 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnX = 0; // X-Position to Parent
mpWindowImpl->mnY = 0; // Y-Position to Parent
mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
- mpWindowImpl->mnHelpId = 0; // help id
- mpWindowImpl->mnUniqId = 0; // unique id
mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren
mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion
mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow)
@@ -625,83 +642,83 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnDlgCtrlFlags = 0; // DialogControl-Flags
mpWindowImpl->mnLockCount = 0; // LockCount
mpWindowImpl->meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
- mpWindowImpl->mbFrame = FALSE; // TRUE: Window is a frame window
- mpWindowImpl->mbBorderWin = FALSE; // TRUE: Window is a border window
- mpWindowImpl->mbOverlapWin = FALSE; // TRUE: Window is a overlap window
- mpWindowImpl->mbSysWin = FALSE; // TRUE: SystemWindow is the base class
- mpWindowImpl->mbDialog = FALSE; // TRUE: Dialog is the base class
- mpWindowImpl->mbDockWin = FALSE; // TRUE: DockingWindow is the base class
- mpWindowImpl->mbFloatWin = FALSE; // TRUE: FloatingWindow is the base class
- mpWindowImpl->mbPushButton = FALSE; // TRUE: PushButton is the base class
- mpWindowImpl->mbToolBox = FALSE; // TRUE: ToolBox is the base class
- mpWindowImpl->mbMenuFloatingWindow= FALSE; // TRUE: MenuFloatingWindow is the base class
- mpWindowImpl->mbToolbarFloatingWindow= FALSE; // TRUE: ImplPopupFloatWin is the base class, used for subtoolbars
- mpWindowImpl->mbSplitter = FALSE; // TRUE: Splitter is the base class
- mpWindowImpl->mbVisible = FALSE; // TRUE: Show( true ) called
- mpWindowImpl->mbOverlapVisible = FALSE; // TRUE: Hide called for visible window from ImplHideAllOverlapWindow()
- mpWindowImpl->mbDisabled = FALSE; // TRUE: Enable( FALSE ) called
- mpWindowImpl->mbInputDisabled = FALSE; // TRUE: EnableInput( FALSE ) called
- mpWindowImpl->mbDropDisabled = FALSE; // TRUE: Drop is enabled
- mpWindowImpl->mbNoUpdate = FALSE; // TRUE: SetUpdateMode( FALSE ) called
- mpWindowImpl->mbNoParentUpdate = FALSE; // TRUE: SetParentUpdateMode( FALSE ) called
- mpWindowImpl->mbActive = FALSE; // TRUE: Window Active
- mpWindowImpl->mbParentActive = FALSE; // TRUE: OverlapActive from Parent
- mpWindowImpl->mbReallyVisible = FALSE; // TRUE: this and all parents to an overlaped window are visible
- mpWindowImpl->mbReallyShown = FALSE; // TRUE: this and all parents to an overlaped window are shown
- mpWindowImpl->mbInInitShow = FALSE; // TRUE: we are in InitShow
- mpWindowImpl->mbChildNotify = FALSE; // TRUE: ChildNotify
- mpWindowImpl->mbChildPtrOverwrite = FALSE; // TRUE: PointerStyle overwrites Child-Pointer
- mpWindowImpl->mbNoPtrVisible = FALSE; // TRUE: ShowPointer( FALSE ) called
- mpWindowImpl->mbMouseMove = FALSE; // TRUE: BaseMouseMove called
- mpWindowImpl->mbPaintFrame = FALSE; // TRUE: Paint is visible, but not painted
- mpWindowImpl->mbInPaint = FALSE; // TRUE: Inside PaintHdl
- mpWindowImpl->mbMouseButtonDown = FALSE; // TRUE: BaseMouseButtonDown called
- mpWindowImpl->mbMouseButtonUp = FALSE; // TRUE: BaseMouseButtonUp called
- mpWindowImpl->mbKeyInput = FALSE; // TRUE: BaseKeyInput called
- mpWindowImpl->mbKeyUp = FALSE; // TRUE: BaseKeyUp called
- mpWindowImpl->mbCommand = FALSE; // TRUE: BaseCommand called
- mpWindowImpl->mbDefPos = TRUE; // TRUE: Position is not Set
- mpWindowImpl->mbDefSize = TRUE; // TRUE: Size is not Set
- mpWindowImpl->mbCallMove = TRUE; // TRUE: Move must be called by Show
- mpWindowImpl->mbCallResize = TRUE; // TRUE: Resize must be called by Show
- mpWindowImpl->mbWaitSystemResize = TRUE; // TRUE: Wait for System-Resize
- mpWindowImpl->mbInitWinClipRegion = TRUE; // TRUE: Calc Window Clip Region
- mpWindowImpl->mbInitChildRegion = FALSE; // TRUE: InitChildClipRegion
- mpWindowImpl->mbWinRegion = FALSE; // TRUE: Window Region
- mpWindowImpl->mbClipChildren = FALSE; // TRUE: Child-Fenster muessen evt. geclippt werden
- mpWindowImpl->mbClipSiblings = FALSE; // TRUE: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden
- mpWindowImpl->mbChildTransparent = FALSE; // TRUE: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN)
- mpWindowImpl->mbPaintTransparent = FALSE; // TRUE: Paints muessen auf Parent ausgeloest werden
- mpWindowImpl->mbMouseTransparent = FALSE; // TRUE: Window is transparent for Mouse
- mpWindowImpl->mbDlgCtrlStart = FALSE; // TRUE: Ab hier eigenes Dialog-Control
- mpWindowImpl->mbFocusVisible = FALSE; // TRUE: Focus Visible
- mpWindowImpl->mbUseNativeFocus = FALSE;
- mpWindowImpl->mbNativeFocusVisible= FALSE; // TRUE: native Focus Visible
- mpWindowImpl->mbInShowFocus = FALSE; // prevent recursion
- mpWindowImpl->mbInHideFocus = FALSE; // prevent recursion
- mpWindowImpl->mbTrackVisible = FALSE; // TRUE: Tracking Visible
- mpWindowImpl->mbControlForeground = FALSE; // TRUE: Foreground-Property set
- mpWindowImpl->mbControlBackground = FALSE; // TRUE: Background-Property set
- mpWindowImpl->mbAlwaysOnTop = FALSE; // TRUE: immer vor allen anderen normalen Fenstern sichtbar
- mpWindowImpl->mbCompoundControl = FALSE; // TRUE: Zusammengesetztes Control => Listener...
- mpWindowImpl->mbCompoundControlHasFocus = FALSE; // TRUE: Zusammengesetztes Control hat irgendwo den Focus
- mpWindowImpl->mbPaintDisabled = FALSE; // TRUE: Paint soll nicht ausgefuehrt werden
- mpWindowImpl->mbAllResize = FALSE; // TRUE: Auch ResizeEvents mit 0,0 schicken
- mpWindowImpl->mbInDtor = FALSE; // TRUE: Wir befinden uns im Window-Dtor
- mpWindowImpl->mbExtTextInput = FALSE; // TRUE: ExtTextInput-Mode is active
- mpWindowImpl->mbInFocusHdl = FALSE; // TRUE: Innerhalb vom GetFocus-Handler
- mpWindowImpl->mbCreatedWithToolkit = FALSE;
- mpWindowImpl->mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events
- mpWindowImpl->mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection
- mpWindowImpl->mbIsInTaskPaneList = FALSE; // TRUE: window was added to the taskpanelist in the topmost system window
+ mpWindowImpl->mbFrame = sal_False; // sal_True: Window is a frame window
+ mpWindowImpl->mbBorderWin = sal_False; // sal_True: Window is a border window
+ mpWindowImpl->mbOverlapWin = sal_False; // sal_True: Window is a overlap window
+ mpWindowImpl->mbSysWin = sal_False; // sal_True: SystemWindow is the base class
+ mpWindowImpl->mbDialog = sal_False; // sal_True: Dialog is the base class
+ mpWindowImpl->mbDockWin = sal_False; // sal_True: DockingWindow is the base class
+ mpWindowImpl->mbFloatWin = sal_False; // sal_True: FloatingWindow is the base class
+ mpWindowImpl->mbPushButton = sal_False; // sal_True: PushButton is the base class
+ mpWindowImpl->mbToolBox = sal_False; // sal_True: ToolBox is the base class
+ mpWindowImpl->mbMenuFloatingWindow= sal_False; // sal_True: MenuFloatingWindow is the base class
+ mpWindowImpl->mbToolbarFloatingWindow= sal_False; // sal_True: ImplPopupFloatWin is the base class, used for subtoolbars
+ mpWindowImpl->mbSplitter = sal_False; // sal_True: Splitter is the base class
+ mpWindowImpl->mbVisible = sal_False; // sal_True: Show( sal_True ) called
+ mpWindowImpl->mbOverlapVisible = sal_False; // sal_True: Hide called for visible window from ImplHideAllOverlapWindow()
+ mpWindowImpl->mbDisabled = sal_False; // sal_True: Enable( sal_False ) called
+ mpWindowImpl->mbInputDisabled = sal_False; // sal_True: EnableInput( sal_False ) called
+ mpWindowImpl->mbDropDisabled = sal_False; // sal_True: Drop is enabled
+ mpWindowImpl->mbNoUpdate = sal_False; // sal_True: SetUpdateMode( sal_False ) called
+ mpWindowImpl->mbNoParentUpdate = sal_False; // sal_True: SetParentUpdateMode( sal_False ) called
+ mpWindowImpl->mbActive = sal_False; // sal_True: Window Active
+ mpWindowImpl->mbParentActive = sal_False; // sal_True: OverlapActive from Parent
+ mpWindowImpl->mbReallyVisible = sal_False; // sal_True: this and all parents to an overlaped window are visible
+ mpWindowImpl->mbReallyShown = sal_False; // sal_True: this and all parents to an overlaped window are shown
+ mpWindowImpl->mbInInitShow = sal_False; // sal_True: we are in InitShow
+ mpWindowImpl->mbChildNotify = sal_False; // sal_True: ChildNotify
+ mpWindowImpl->mbChildPtrOverwrite = sal_False; // sal_True: PointerStyle overwrites Child-Pointer
+ mpWindowImpl->mbNoPtrVisible = sal_False; // sal_True: ShowPointer( sal_False ) called
+ mpWindowImpl->mbMouseMove = sal_False; // sal_True: BaseMouseMove called
+ mpWindowImpl->mbPaintFrame = sal_False; // sal_True: Paint is visible, but not painted
+ mpWindowImpl->mbInPaint = sal_False; // sal_True: Inside PaintHdl
+ mpWindowImpl->mbMouseButtonDown = sal_False; // sal_True: BaseMouseButtonDown called
+ mpWindowImpl->mbMouseButtonUp = sal_False; // sal_True: BaseMouseButtonUp called
+ mpWindowImpl->mbKeyInput = sal_False; // sal_True: BaseKeyInput called
+ mpWindowImpl->mbKeyUp = sal_False; // sal_True: BaseKeyUp called
+ mpWindowImpl->mbCommand = sal_False; // sal_True: BaseCommand called
+ mpWindowImpl->mbDefPos = sal_True; // sal_True: Position is not Set
+ mpWindowImpl->mbDefSize = sal_True; // sal_True: Size is not Set
+ mpWindowImpl->mbCallMove = sal_True; // sal_True: Move must be called by Show
+ mpWindowImpl->mbCallResize = sal_True; // sal_True: Resize must be called by Show
+ mpWindowImpl->mbWaitSystemResize = sal_True; // sal_True: Wait for System-Resize
+ mpWindowImpl->mbInitWinClipRegion = sal_True; // sal_True: Calc Window Clip Region
+ mpWindowImpl->mbInitChildRegion = sal_False; // sal_True: InitChildClipRegion
+ mpWindowImpl->mbWinRegion = sal_False; // sal_True: Window Region
+ mpWindowImpl->mbClipChildren = sal_False; // sal_True: Child-Fenster muessen evt. geclippt werden
+ mpWindowImpl->mbClipSiblings = sal_False; // sal_True: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden
+ mpWindowImpl->mbChildTransparent = sal_False; // sal_True: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN)
+ mpWindowImpl->mbPaintTransparent = sal_False; // sal_True: Paints muessen auf Parent ausgeloest werden
+ mpWindowImpl->mbMouseTransparent = sal_False; // sal_True: Window is transparent for Mouse
+ mpWindowImpl->mbDlgCtrlStart = sal_False; // sal_True: Ab hier eigenes Dialog-Control
+ mpWindowImpl->mbFocusVisible = sal_False; // sal_True: Focus Visible
+ mpWindowImpl->mbUseNativeFocus = sal_False;
+ mpWindowImpl->mbNativeFocusVisible= sal_False; // sal_True: native Focus Visible
+ mpWindowImpl->mbInShowFocus = sal_False; // prevent recursion
+ mpWindowImpl->mbInHideFocus = sal_False; // prevent recursion
+ mpWindowImpl->mbTrackVisible = sal_False; // sal_True: Tracking Visible
+ mpWindowImpl->mbControlForeground = sal_False; // sal_True: Foreground-Property set
+ mpWindowImpl->mbControlBackground = sal_False; // sal_True: Background-Property set
+ mpWindowImpl->mbAlwaysOnTop = sal_False; // sal_True: immer vor allen anderen normalen Fenstern sichtbar
+ mpWindowImpl->mbCompoundControl = sal_False; // sal_True: Zusammengesetztes Control => Listener...
+ mpWindowImpl->mbCompoundControlHasFocus = sal_False; // sal_True: Zusammengesetztes Control hat irgendwo den Focus
+ mpWindowImpl->mbPaintDisabled = sal_False; // sal_True: Paint soll nicht ausgefuehrt werden
+ mpWindowImpl->mbAllResize = sal_False; // sal_True: Auch ResizeEvents mit 0,0 schicken
+ mpWindowImpl->mbInDtor = sal_False; // sal_True: Wir befinden uns im Window-Dtor
+ mpWindowImpl->mbExtTextInput = sal_False; // sal_True: ExtTextInput-Mode is active
+ mpWindowImpl->mbInFocusHdl = sal_False; // sal_True: Innerhalb vom GetFocus-Handler
+ mpWindowImpl->mbCreatedWithToolkit = sal_False;
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_False; // sal_True: do not send any accessibility events
+ mpWindowImpl->mbDrawSelectionBackground = sal_False; // sal_True: draws transparent window background to indicate (toolbox) selection
+ mpWindowImpl->mbIsInTaskPaneList = sal_False; // sal_True: window was added to the taskpanelist in the topmost system window
mpWindowImpl->mnNativeBackground = 0; // initialize later, depends on type
- mpWindowImpl->mbCallHandlersDuringInputDisabled = FALSE; // TRUE: call event handlers even if input is disabled
- mpWindowImpl->mbDisableAccessibleLabelForRelation = FALSE; // TRUE: do not set LabelFor relation on accessible objects
- mpWindowImpl->mbDisableAccessibleLabeledByRelation = FALSE; // TRUE: do not set LabeledBy relation on accessible objects
- mpWindowImpl->mbHelpTextDynamic = FALSE; // TRUE: append help id in HELP_DEBUG case
- mpWindowImpl->mbFakeFocusSet = FALSE; // TRUE: pretend as if the window has focus.
+ mpWindowImpl->mbCallHandlersDuringInputDisabled = sal_False; // sal_True: call event handlers even if input is disabled
+ mpWindowImpl->mbDisableAccessibleLabelForRelation = sal_False; // sal_True: do not set LabelFor relation on accessible objects
+ mpWindowImpl->mbDisableAccessibleLabeledByRelation = sal_False; // sal_True: do not set LabeledBy relation on accessible objects
+ mpWindowImpl->mbHelpTextDynamic = sal_False; // sal_True: append help id in HELP_DEBUG case
+ mpWindowImpl->mbFakeFocusSet = sal_False; // sal_True: pretend as if the window has focus.
- mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
+ mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
}
// -----------------------------------------------------------------------
@@ -728,7 +745,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow
&& (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
{
- USHORT nBorderTypeStyle = 0;
+ sal_uInt16 nBorderTypeStyle = 0;
if( (nStyle & WB_SYSTEMCHILDWINDOW) )
{
// handle WB_SYSTEMCHILDWINDOW
@@ -746,8 +763,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
else if( !mpWindowImpl->mbFrame && ! pParent )
{
- mpWindowImpl->mbOverlapWin = TRUE;
- mpWindowImpl->mbFrame = TRUE;
+ mpWindowImpl->mbOverlapWin = sal_True;
+ mpWindowImpl->mbFrame = sal_True;
}
// insert window in list
@@ -762,7 +779,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL;
mpWindowImpl->mpOverlapData->mpNextBackWin = NULL;
mpWindowImpl->mpOverlapData->mnSaveBackSize = 0;
- mpWindowImpl->mpOverlapData->mbSaveBack = FALSE;
+ mpWindowImpl->mpOverlapData->mbSaveBack = sal_False;
mpWindowImpl->mpOverlapData->mnTopLevel = 1;
}
@@ -773,7 +790,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
if ( mpWindowImpl->mbFrame )
{
// create frame
- ULONG nFrameStyle = 0;
+ sal_uLong nFrameStyle = 0;
if ( nStyle & WB_MOVEABLE )
nFrameStyle |= SAL_FRAME_STYLE_MOVEABLE;
@@ -879,21 +896,21 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
mpWindowImpl->mpFrameData->mnMouseCode = 0;
mpWindowImpl->mpFrameData->mnMouseMode = 0;
mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL;
- mpWindowImpl->mpFrameData->mbHasFocus = FALSE;
- mpWindowImpl->mpFrameData->mbInMouseMove = FALSE;
- mpWindowImpl->mpFrameData->mbMouseIn = FALSE;
- mpWindowImpl->mpFrameData->mbStartDragCalled = FALSE;
- mpWindowImpl->mpFrameData->mbNeedSysWindow = FALSE;
- mpWindowImpl->mpFrameData->mbMinimized = FALSE;
- mpWindowImpl->mpFrameData->mbStartFocusState = FALSE;
- mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = FALSE;
- mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = FALSE;
- mpWindowImpl->mpFrameData->mbSysObjFocus = FALSE;
+ mpWindowImpl->mpFrameData->mbHasFocus = sal_False;
+ mpWindowImpl->mpFrameData->mbInMouseMove = sal_False;
+ mpWindowImpl->mpFrameData->mbMouseIn = sal_False;
+ mpWindowImpl->mpFrameData->mbStartDragCalled = sal_False;
+ mpWindowImpl->mpFrameData->mbNeedSysWindow = sal_False;
+ mpWindowImpl->mpFrameData->mbMinimized = sal_False;
+ mpWindowImpl->mpFrameData->mbStartFocusState = sal_False;
+ mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = sal_False;
+ mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = sal_False;
+ mpWindowImpl->mpFrameData->mbSysObjFocus = sal_False;
mpWindowImpl->mpFrameData->maPaintTimer.SetTimeout( 30 );
mpWindowImpl->mpFrameData->maPaintTimer.SetTimeoutHdl( LINK( this, Window, ImplHandlePaintHdl ) );
mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 );
mpWindowImpl->mpFrameData->maResizeTimer.SetTimeoutHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) );
- mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = FALSE;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_False;
if ( pRealParent && IsTopWindow() )
{
@@ -938,7 +955,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
// side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
OutputDevice::SetSettings( *pSVData->maAppData.mpSettings );
- pSVData->maAppData.mbSettingsInit = TRUE;
+ pSVData->maAppData.mbSettingsInit = sal_True;
}
// If we create a Window with default size, query this
@@ -964,7 +981,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
}
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
+ sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
maFont = rStyleSettings.GetAppFont();
@@ -1025,7 +1042,7 @@ void Window::ImplInsertWindow( Window* pParent )
mpWindowImpl->mpFrameData = pFrameParent->mpWindowImpl->mpFrameData;
mpWindowImpl->mpFrame = pFrameParent->mpWindowImpl->mpFrame;
mpWindowImpl->mpFrameWindow = pFrameParent;
- mpWindowImpl->mbFrame = FALSE;
+ mpWindowImpl->mbFrame = sal_False;
// search overlap window and insert window in list
if ( ImplIsOverlapWindow() )
@@ -1064,7 +1081,7 @@ void Window::ImplInsertWindow( Window* pParent )
// -----------------------------------------------------------------------
-void Window::ImplRemoveWindow( BOOL bRemoveFrameData )
+void Window::ImplRemoveWindow( sal_Bool bRemoveFrameData )
{
// Fenster aus den Listen austragen
if ( !mpWindowImpl->mbFrame )
@@ -1117,7 +1134,7 @@ void Window::ImplRemoveWindow( BOOL bRemoveFrameData )
void Window::ImplCallResize()
{
- mpWindowImpl->mbCallResize = FALSE;
+ mpWindowImpl->mbCallResize = sal_False;
if( GetBackground().IsGradient() )
Invalidate();
@@ -1127,13 +1144,15 @@ void Window::ImplCallResize()
// #88419# Most classes don't call the base class in Resize() and Move(),
// => Call ImpleResize/Move instead of Resize/Move directly...
ImplCallEventListeners( VCLEVENT_WINDOW_RESIZE );
+
+ ImplExtResize();
}
// -----------------------------------------------------------------------
void Window::ImplCallMove()
{
- mpWindowImpl->mbCallMove = FALSE;
+ mpWindowImpl->mbCallMove = sal_False;
if( mpWindowImpl->mbFrame )
{
@@ -1175,20 +1194,14 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static ULONG ImplAutoHelpID( ResMgr* pResMgr )
+static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
{
- if ( !Application::IsAutoHelpIdEnabled() )
- return 0;
+ rtl::OString aRet;
- ULONG nHID = 0;
+ if( pResMgr && Application::IsAutoHelpIdEnabled() )
+ aRet = pResMgr->GetAutoHelpId();
- DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
- if( ! pResMgr )
- return 0;
-
- nHID = pResMgr->GetAutoHelpId();
-
- return nHID;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1208,25 +1221,26 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- // newer move this line after IncrementRes
- char* pRes = (char*)GetClassRes();
- pRes += 12;
- sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes );
- if ( !nHelpId )
- nHelpId = ImplAutoHelpID( rResId.GetResMgr() );
- SetHelpId( nHelpId );
+ sal_uLong nObjMask = ReadLongRes();
- ULONG nObjMask = ReadLongRes();
+ // we need to calculate auto helpids before the resource gets closed
+ // if the resource only contains flags, it will be closed before we try to read a help id
+ // so we always create an auto help id that might be overwritten later
+ // HelpId
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
// ResourceStyle
- ULONG nRSStyle = ReadLongRes();
+ sal_uLong nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
- // HelpId
- ReadLongRes();
- BOOL bPos = FALSE;
- BOOL bSize = FALSE;
+ if( nObjMask & WINDOW_HELPID )
+ aHelpId = ReadByteStringRes();
+
+ SetHelpId( aHelpId );
+
+ sal_Bool bPos = sal_False;
+ sal_Bool bSize = sal_False;
Point aPos;
Size aSize;
@@ -1235,7 +1249,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit ePosMap = MAP_PIXEL;
- bPos = TRUE;
+ bPos = sal_True;
if ( nObjMask & WINDOW_XYMAPMODE )
ePosMap = (MapUnit)ReadLongRes();
@@ -1250,7 +1264,7 @@ void Window::ImplLoadRes( const ResId& rResId )
// Groessenangabe aus der Resource verwenden
MapUnit eSizeMap = MAP_PIXEL;
- bSize = TRUE;
+ bSize = sal_True;
if ( nObjMask & WINDOW_WHMAPMODE )
eSizeMap = (MapUnit)ReadLongRes();
@@ -1276,14 +1290,14 @@ void Window::ImplLoadRes( const ResId& rResId )
SetSizePixel( aSize );
if ( nRSStyle & RSWND_DISABLED )
- Enable( FALSE );
+ Enable( sal_False );
if ( nObjMask & WINDOW_TEXT )
SetText( ReadStringRes() );
if ( nObjMask & WINDOW_HELPTEXT )
{
SetHelpText( ReadStringRes() );
- mpWindowImpl->mbHelpTextDynamic = TRUE;
+ mpWindowImpl->mbHelpTextDynamic = sal_True;
}
if ( nObjMask & WINDOW_QUICKTEXT )
SetQuickHelpText( ReadStringRes() );
@@ -1293,11 +1307,11 @@ void Window::ImplLoadRes( const ResId& rResId )
SetData( (void*)nRes );
}
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( (ULONG)ReadLongRes() );
+ SetUniqueId( ReadByteStringRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
- USHORT nBorderStyle = (USHORT)ReadLongRes();
+ sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes();
SetBorderStyle( nBorderStyle );
}
}
@@ -1318,11 +1332,9 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mpFocusRect = NULL;
mpWindowImpl->mpWinData->mpTrackRect = NULL;
mpWindowImpl->mpWinData->mnTrackFlags = 0;
- mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
- mpWindowImpl->mpWinData->mbMouseOver = FALSE;
- mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API
- mpWindowImpl->mpWinData->mpSmartHelpId = NULL;
- mpWindowImpl->mpWinData->mpSmartUniqueId = NULL;
+ mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
+ mpWindowImpl->mpWinData->mbMouseOver = sal_False;
+ mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? sal_False : sal_True; // sal_True: try to draw this control with native theme API
}
return mpWindowImpl->mpWinData;
@@ -1333,7 +1345,7 @@ ImplWinData* Window::ImplGetWinData() const
SalGraphics* Window::ImplGetFrameGraphics() const
{
if ( mpWindowImpl->mpFrameWindow->mpGraphics )
- mpWindowImpl->mpFrameWindow->mbInitClipRegion = TRUE;
+ mpWindowImpl->mpFrameWindow->mbInitClipRegion = sal_True;
else
mpWindowImpl->mpFrameWindow->ImplGetGraphics();
mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion();
@@ -1363,7 +1375,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
if ( !mpWindowImpl->mbVisible )
return NULL;
- USHORT nHitTest = ImplHitTest( rFramePos );
+ sal_uInt16 nHitTest = ImplHitTest( rFramePos );
if ( nHitTest & WINDOW_HITTEST_INSIDE )
{
// und danach gehen wir noch alle Child-Fenster durch
@@ -1387,7 +1399,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos )
// -----------------------------------------------------------------------
-USHORT Window::ImplHitTest( const Point& rFramePos )
+sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
{
Point aFramePos( rFramePos );
if( ImplIsAntiparallel() )
@@ -1407,7 +1419,7 @@ USHORT Window::ImplHitTest( const Point& rFramePos )
return 0;
}
- USHORT nHitTest = WINDOW_HITTEST_INSIDE;
+ sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE;
if ( mpWindowImpl->mbMouseTransparent )
nHitTest |= WINDOW_HITTEST_TRANSPARENT;
return nHitTest;
@@ -1415,22 +1427,22 @@ USHORT Window::ImplHitTest( const Point& rFramePos )
// -----------------------------------------------------------------------
-BOOL Window::ImplIsRealParentPath( const Window* pWindow ) const
+sal_Bool Window::ImplIsRealParentPath( const Window* pWindow ) const
{
pWindow = pWindow->GetParent();
while ( pWindow )
{
if ( pWindow == this )
- return TRUE;
+ return sal_True;
pWindow = pWindow->GetParent();
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
do
{
@@ -1440,19 +1452,19 @@ BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return TRUE;
+ return sal_True;
}
while ( pWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
if ( this == pWindow )
- return TRUE;
+ return sal_True;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -1482,15 +1494,15 @@ int Window::ImplTestMousePointerSet()
{
// Wenn Mouse gecaptured ist, dann soll MousePointer umgeschaltet werden
if ( IsMouseCaptured() )
- return TRUE;
+ return sal_True;
// Wenn sich Mouse ueber dem Fenster befindet, dann soll MousePointer
// umgeschaltet werden
Rectangle aClientRect( Point( 0, 0 ), GetOutputSizePixel() );
if ( aClientRect.IsInside( GetPointerPosPixel() ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1498,7 +1510,7 @@ int Window::ImplTestMousePointerSet()
PointerStyle Window::ImplGetMousePointer() const
{
PointerStyle ePointerStyle;
- BOOL bWait = FALSE;
+ sal_Bool bWait = sal_False;
if ( IsEnabled() && IsInputEnabled() && ! IsInModalMode() )
ePointerStyle = GetPointer().GetStyle();
@@ -1518,7 +1530,7 @@ PointerStyle Window::ImplGetMousePointer() const
if ( pWindow->mpWindowImpl->mnWaitCount )
{
ePointerStyle = POINTER_WAIT;
- bWait = TRUE;
+ bWait = sal_True;
}
else
{
@@ -1541,11 +1553,11 @@ PointerStyle Window::ImplGetMousePointer() const
void Window::ImplResetReallyVisible()
{
- BOOL bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
+ sal_Bool bBecameReallyInvisible = mpWindowImpl->mbReallyVisible;
- mbDevOutput = FALSE;
- mpWindowImpl->mbReallyVisible = FALSE;
- mpWindowImpl->mbReallyShown = FALSE;
+ mbDevOutput = sal_False;
+ mpWindowImpl->mbReallyVisible = sal_False;
+ mpWindowImpl->mbReallyShown = sal_False;
// the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
// For this, the data member of the event must not be NULL.
@@ -1582,11 +1594,11 @@ void Window::ImplSetReallyVisible()
if( !mpWindowImpl->mbReallyShown )
ImplCallInitShow();
- BOOL bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
+ sal_Bool bBecameReallyVisible = !mpWindowImpl->mbReallyVisible;
- mbDevOutput = TRUE;
- mpWindowImpl->mbReallyVisible = TRUE;
- mpWindowImpl->mbReallyShown = TRUE;
+ mbDevOutput = sal_True;
+ mpWindowImpl->mbReallyVisible = sal_True;
+ mpWindowImpl->mbReallyShown = sal_True;
// the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
// For this, the data member of the event must not be NULL.
@@ -1618,10 +1630,10 @@ void Window::ImplSetReallyVisible()
void Window::ImplCallInitShow()
{
- mpWindowImpl->mbReallyShown = TRUE;
- mpWindowImpl->mbInInitShow = TRUE;
+ mpWindowImpl->mbReallyShown = sal_True;
+ mpWindowImpl->mbInInitShow = sal_True;
StateChanged( STATE_CHANGE_INITSHOW );
- mpWindowImpl->mbInInitShow = FALSE;
+ mpWindowImpl->mbInInitShow = sal_False;
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
@@ -1677,7 +1689,7 @@ void Window::ImplInitResolutionSettings()
if ( mpWindowImpl->mbFrame )
{
const StyleSettings& rStyleSettings = maSettings.GetStyleSettings();
- USHORT nScreenZoom = rStyleSettings.GetScreenZoom();
+ sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
SetPointFont( rStyleSettings.GetAppFont() );
@@ -1703,7 +1715,7 @@ void Window::ImplInitResolutionSettings()
void Window::ImplPointToLogic( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( aSize.Width() )
{
@@ -1730,7 +1742,7 @@ void Window::ImplPointToLogic( Font& rFont ) const
void Window::ImplLogicToPoint( Font& rFont ) const
{
Size aSize = rFont.GetSize();
- USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
+ sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom();
if ( IsMapModeEnabled() )
aSize = LogicToPixel( aSize );
@@ -1754,9 +1766,9 @@ void Window::ImplLogicToPoint( Font& rFont ) const
// -----------------------------------------------------------------------
-BOOL Window::ImplSysObjClip( const Region* pOldRegion )
+sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( mpWindowImpl->mpSysObj )
{
@@ -1781,7 +1793,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
Region aRegion = *pWinChildClipRegion;
Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
Region aWinRectRegion( aWinRect );
- USHORT nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
+ sal_uInt16 nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType();
if ( aRegion == aWinRectRegion )
mpWindowImpl->mpSysObj->ResetClipRegion();
@@ -1800,9 +1812,9 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
long nY;
long nWidth;
long nHeight;
- ULONG nRectCount;
+ sal_uLong nRectCount;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
nRectCount = aRegion.GetRectCount();
mpWindowImpl->mpSysObj->BeginSetClipRegion( nRectCount );
@@ -1816,7 +1828,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion )
}
}
else
- bVisibleState = FALSE;
+ bVisibleState = sal_False;
}
// Visible-Status updaten
@@ -1880,31 +1892,31 @@ void Window::ImplUpdateSysObjClip()
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller )
{
- BOOL bUpdate = TRUE;
+ sal_Bool bUpdate = sal_True;
if ( mpWindowImpl->mpSysObj )
{
Region* pOldRegion = NULL;
if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion )
pOldRegion = new Region( mpWindowImpl->maWinClipRegion );
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
if ( !ImplSysObjClip( pOldRegion ) )
{
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
- bUpdate = FALSE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
+ bUpdate = sal_False;
}
if ( pOldRegion )
@@ -1912,14 +1924,14 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
}
else
{
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInitWinClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInitWinClipRegion = sal_True;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -1928,15 +1940,15 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller )
{
- BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pWindow = mpWindowImpl->mpFirstOverlap;
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
@@ -1945,18 +1957,18 @@ BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller )
// -----------------------------------------------------------------------
-BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller )
+sal_Bool Window::ImplSetClipFlag( sal_Bool bSysObjOnlySmaller )
{
if ( !ImplIsOverlapWindow() )
{
- BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
+ sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller );
Window* pParent = ImplGetParent();
if ( pParent &&
((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP)) )
{
- pParent->mbInitClipRegion = TRUE;
- pParent->mpWindowImpl->mbInitChildRegion = TRUE;
+ pParent->mbInitClipRegion = sal_True;
+ pParent->mpWindowImpl->mbInitChildRegion = sal_True;
}
// Schwestern muessen ihre ClipRegion auch neu berechnen
@@ -1966,7 +1978,7 @@ BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller )
while ( pWindow )
{
if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) )
- bUpdate = FALSE;
+ bUpdate = sal_False;
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2046,7 +2058,7 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps )
+void Window::ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps )
{
if ( bThis )
ImplIntersectWindowClipRegion( rRegion );
@@ -2081,21 +2093,21 @@ void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps )
// -----------------------------------------------------------------------
-BOOL Window::ImplClipChilds( Region& rRegion )
+sal_Bool Window::ImplClipChilds( Region& rRegion )
{
- BOOL bOtherClip = FALSE;
+ sal_Bool bOtherClip = sal_False;
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
if ( pWindow->mpWindowImpl->mbReallyVisible )
{
// ParentClipMode-Flags auswerten
- USHORT nClipMode = pWindow->GetParentClipMode();
+ sal_uInt16 nClipMode = pWindow->GetParentClipMode();
if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) &&
((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) )
pWindow->ImplExcludeWindowRegion( rRegion );
else
- bOtherClip = TRUE;
+ bOtherClip = sal_True;
}
pWindow = pWindow->mpWindowImpl->mpNext;
@@ -2149,13 +2161,13 @@ void Window::ImplInitWinClipRegion()
ImplClipSiblings( mpWindowImpl->maWinClipRegion );
// Clip Parent Boundaries
- ImplClipBoundaries( mpWindowImpl->maWinClipRegion, FALSE, TRUE );
+ ImplClipBoundaries( mpWindowImpl->maWinClipRegion, sal_False, sal_True );
// Clip Children
if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren )
- mpWindowImpl->mbInitChildRegion = TRUE;
+ mpWindowImpl->mbInitChildRegion = sal_True;
- mpWindowImpl->mbInitWinClipRegion = FALSE;
+ mpWindowImpl->mbInitWinClipRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -2180,7 +2192,7 @@ void Window::ImplInitWinChildClipRegion()
ImplClipChilds( *mpWindowImpl->mpChildClipRegion );
}
- mpWindowImpl->mbInitChildRegion = FALSE;
+ mpWindowImpl->mbInitChildRegion = sal_False;
}
// -----------------------------------------------------------------------
@@ -2261,7 +2273,7 @@ void Window::ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region&
// -----------------------------------------------------------------------
void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
- BOOL bChilds, BOOL bParent, BOOL bSiblings )
+ sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings )
{
Region aRegion( rSourceRect );
if ( mpWindowImpl->mbWinRegion )
@@ -2333,13 +2345,13 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio
// -----------------------------------------------------------------------
-void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
+void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags )
{
// call PrePaint. PrePaint may add to the invalidate region as well as
// other parameters used below.
PrePaint();
- mpWindowImpl->mbPaintFrame = FALSE;
+ mpWindowImpl->mbPaintFrame = sal_False;
if ( nPaintFlags & IMPL_PAINT_PAINTALLCHILDS )
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALLCHILDS | (nPaintFlags & IMPL_PAINT_PAINTALL);
@@ -2393,8 +2405,8 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplHide();
- mbInitClipRegion = TRUE;
- mpWindowImpl->mbInPaint = TRUE;
+ mbInitClipRegion = sal_True;
+ mpWindowImpl->mbInPaint = sal_True;
// Paint-Region zuruecksetzen
Region aPaintRegion( mpWindowImpl->maInvalidateRegion );
@@ -2434,11 +2446,11 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
if ( mpWindowImpl->mbFocusVisible )
ImplInvertFocus( *(mpWindowImpl->mpWinData->mpFocusRect) );
}
- mpWindowImpl->mbInPaint = FALSE;
- mbInitClipRegion = TRUE;
+ mpWindowImpl->mbInPaint = sal_False;
+ mbInitClipRegion = sal_True;
mpWindowImpl->mpPaintRegion = NULL;
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( FALSE );
+ mpWindowImpl->mpCursor->ImplShow( sal_False );
}
}
else
@@ -2464,7 +2476,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
// #98943# draw toolbox selection
if( !aSelectionRect.IsEmpty() )
- DrawSelectionBackground( aSelectionRect, 3, FALSE, TRUE, FALSE );
+ DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False );
if ( pChildRegion )
delete pChildRegion;
@@ -2531,14 +2543,14 @@ IMPL_LINK( Window, ImplHandleResizeTimerHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------
-void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags )
+void Window::ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
{
// PAINTCHILDS bei allen Parent-Fenster bis zum ersten OverlapWindow
// setzen
if ( !ImplIsOverlapWindow() )
{
Window* pTempWindow = this;
- USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
+ sal_uInt16 nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
do
{
pTempWindow = pTempWindow->ImplGetParent();
@@ -2596,7 +2608,7 @@ void Window::ImplInvalidateOverlapFrameRegion( const Region& rRegion )
{
Region aRegion = rRegion;
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
@@ -2626,7 +2638,7 @@ void Window::ImplInvalidateParentFrameRegion( Region& rRegion )
// -----------------------------------------------------------------------
-void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
+void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags )
{
// Hintergrund-Sicherung zuruecksetzen
@@ -2634,7 +2646,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
ImplInvalidateAllOverlapBackgrounds();
// Feststellen, was neu ausgegeben werden muss
- BOOL bInvalidateAll = !pRegion;
+ sal_Bool bInvalidateAll = !pRegion;
// Transparent-Invalidate beruecksichtigen
Window* pOpaqueWindow = this;
@@ -2647,7 +2659,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
{
pOpaqueWindow = pTempWindow;
nFlags |= INVALIDATE_CHILDREN;
- bInvalidateAll = FALSE;
+ bInvalidateAll = sal_False;
break;
}
@@ -2659,7 +2671,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
}
// Region zusammenbauen
- USHORT nOrgFlags = nFlags;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (INVALIDATE_CHILDREN | INVALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2668,7 +2680,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
nFlags |= INVALIDATE_CHILDREN;
}
if ( (nFlags & INVALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bInvalidateAll = FALSE;
+ bInvalidateAll = sal_False;
if ( bInvalidateAll )
ImplInvalidateFrameRegion( NULL, nFlags );
else
@@ -2687,7 +2699,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
else
aRegion.Intersect( *pRegion );
}
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( nFlags & INVALIDATE_NOCHILDREN )
{
nFlags &= ~INVALIDATE_CHILDREN;
@@ -2714,7 +2726,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags )
void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- BOOL bChilds )
+ sal_Bool bChilds )
{
if ( (mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALL)) == IMPL_PAINT_PAINT )
{
@@ -2729,7 +2741,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
Window* pWindow = mpWindowImpl->mpFirstChild;
while ( pWindow )
{
- pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, TRUE );
+ pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, sal_True );
pWindow = pWindow->mpWindowImpl->mpNext;
}
}
@@ -2739,7 +2751,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect,
void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
long nHorzScroll, long nVertScroll,
- BOOL bChilds )
+ sal_Bool bChilds )
{
// Paint-Region auch verschieben, wenn noch Paints anstehen
ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, bChilds );
@@ -2767,7 +2779,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
if ( !aPaintAllRegion.IsEmpty() )
{
aPaintAllRegion.Move( nHorzScroll, nVertScroll );
- USHORT nPaintFlags = 0;
+ sal_uInt16 nPaintFlags = 0;
if ( bChilds )
mpWindowImpl->mnPaintFlags |= INVALIDATE_CHILDREN;
ImplInvalidateFrameRegion( &aPaintAllRegion, nPaintFlags );
@@ -2777,7 +2789,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
// -----------------------------------------------------------------------
-void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags )
+void Window::ImplValidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags )
{
if ( !pRegion )
mpWindowImpl->maInvalidateRegion.SetEmpty();
@@ -2822,11 +2834,11 @@ void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
+void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags )
{
// Region zusammenbauen
- BOOL bValidateAll = !pRegion;
- USHORT nOrgFlags = nFlags;
+ sal_Bool bValidateAll = !pRegion;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (VALIDATE_CHILDREN | VALIDATE_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2835,7 +2847,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
nFlags |= VALIDATE_CHILDREN;
}
if ( (nFlags & VALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
- bValidateAll = FALSE;
+ bValidateAll = sal_False;
if ( bValidateAll )
ImplValidateFrameRegion( NULL, nFlags );
else
@@ -2844,7 +2856,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
Region aRegion( aRect );
if ( pRegion )
aRegion.Intersect( *pRegion );
- ImplClipBoundaries( aRegion, TRUE, TRUE );
+ ImplClipBoundaries( aRegion, sal_True, sal_True );
if ( nFlags & VALIDATE_NOCHILDREN )
{
nFlags &= ~VALIDATE_CHILDREN;
@@ -2864,7 +2876,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags )
// -----------------------------------------------------------------------
void Window::ImplScroll( const Rectangle& rRect,
- long nHorzScroll, long nVertScroll, USHORT nFlags )
+ long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
{
if ( !IsDeviceOutputNecessary() )
return;
@@ -2882,7 +2894,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplHide();
- USHORT nOrgFlags = nFlags;
+ sal_uInt16 nOrgFlags = nFlags;
if ( !(nFlags & (SCROLL_CHILDREN | SCROLL_NOCHILDREN)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
@@ -2892,14 +2904,14 @@ void Window::ImplScroll( const Rectangle& rRect,
}
Region aInvalidateRegion;
- BOOL bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
- BOOL bErase = (nFlags & SCROLL_NOERASE) == 0;
+ sal_Bool bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0;
+ sal_Bool bErase = (nFlags & SCROLL_NOERASE) == 0;
if ( !mpWindowImpl->mpFirstChild )
- bScrollChilds = FALSE;
+ bScrollChilds = sal_False;
// --- RTL --- check if this window requires special action
- BOOL bReMirror = ( ImplIsAntiparallel() );
+ sal_Bool bReMirror = ( ImplIsAntiparallel() );
Rectangle aRectMirror( rRect );
if( bReMirror )
@@ -2914,7 +2926,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !(nFlags & SCROLL_NOINVALIDATE) )
{
- ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, TRUE, FALSE );
+ ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, sal_True, sal_False );
// --- RTL ---
// if the scrolling on the device is performed in the opposite direction
@@ -2924,7 +2936,7 @@ void Window::ImplScroll( const Rectangle& rRect,
if ( !aInvalidateRegion.IsEmpty() )
{
aInvalidateRegion.Move( bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll );
- bErase = TRUE;
+ bErase = sal_True;
}
if ( !(nFlags & SCROLL_NOWINDOWINVALIDATE) )
{
@@ -2946,7 +2958,7 @@ void Window::ImplScroll( const Rectangle& rRect,
aRegion.Exclude( aInvalidateRegion );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !bScrollChilds )
{
if ( nOrgFlags & SCROLL_NOCHILDREN )
@@ -2997,7 +3009,7 @@ void Window::ImplScroll( const Rectangle& rRect,
// so it has to be re-mirrored before calling the Paint-handler
mpWindowImpl->mnPaintFlags |= IMPL_PAINT_CHECKRTL;
- USHORT nPaintFlags = INVALIDATE_CHILDREN;
+ sal_uInt16 nPaintFlags = INVALIDATE_CHILDREN;
if ( !bErase )
nPaintFlags |= INVALIDATE_NOERASE;
if ( !bScrollChilds )
@@ -3027,24 +3039,24 @@ void Window::ImplScroll( const Rectangle& rRect,
Update();
if ( mpWindowImpl->mpCursor )
- mpWindowImpl->mpCursor->ImplShow( FALSE );
+ mpWindowImpl->mpCursor->ImplShow( sal_False );
}
// -----------------------------------------------------------------------
-void Window::ImplUpdateAll( BOOL bOverlapWindows )
+void Window::ImplUpdateAll( sal_Bool bOverlapWindows )
{
if ( !mpWindowImpl->mbReallyVisible )
return;
- BOOL bFlush = FALSE;
+ sal_Bool bFlush = sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
{
Point aPoint( 0, 0 );
Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) );
ImplInvalidateOverlapFrameRegion( aRegion );
if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) )
- bFlush = TRUE;
+ bFlush = sal_True;
}
// Ein Update wirkt immer auf das OverlapWindow, damit bei spaeteren
@@ -3103,9 +3115,9 @@ void Window::ImplUpdateWindowPtr()
// -----------------------------------------------------------------------
-void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
+void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
{
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
Show( false );
ImplRemoveWindow( bNewFrame );
Window* pRealParent = mpWindowImpl->mpRealParent;
@@ -3132,9 +3144,9 @@ void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame )
// -----------------------------------------------------------------------
-BOOL Window::ImplUpdatePos()
+sal_Bool Window::ImplUpdatePos()
{
- BOOL bSysChild = FALSE;
+ sal_Bool bSysChild = sal_False;
if ( ImplIsOverlapWindow() )
{
@@ -3153,12 +3165,12 @@ BOOL Window::ImplUpdatePos()
while ( pChild )
{
if ( pChild->ImplUpdatePos() )
- bSysChild = TRUE;
+ bSysChild = sal_True;
pChild = pChild->mpWindowImpl->mpNext;
}
if ( mpWindowImpl->mpSysObj )
- bSysChild = TRUE;
+ bSysChild = sal_True;
return bSysChild;
}
@@ -3180,11 +3192,11 @@ void Window::ImplUpdateSysObjPos()
// -----------------------------------------------------------------------
void Window::ImplPosSizeWindow( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags )
+ long nWidth, long nHeight, sal_uInt16 nFlags )
{
- BOOL bNewPos = FALSE;
- BOOL bNewSize = FALSE;
- BOOL bCopyBits = FALSE;
+ sal_Bool bNewPos = sal_False;
+ sal_Bool bNewSize = sal_False;
+ sal_Bool bCopyBits = sal_False;
long nOldOutOffX = mnOutOffX;
long nOldOutOffY = mnOutOffY;
long nOldOutWidth = mnOutWidth;
@@ -3206,17 +3218,17 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mnOutWidth && mnOutHeight && !mpWindowImpl->mbPaintTransparent &&
!mpWindowImpl->mbInitWinClipRegion && !mpWindowImpl->maWinClipRegion.IsEmpty() &&
!HasPaintEvent() )
- bCopyBits = TRUE;
+ bCopyBits = sal_True;
}
- BOOL bnXRecycled = FALSE; // avoid duplicate mirroring in RTL case
+ sal_Bool bnXRecycled = sal_False; // avoid duplicate mirroring in RTL case
if ( nFlags & WINDOW_POSSIZE_WIDTH )
{
if(!( nFlags & WINDOW_POSSIZE_X ))
{
nX = mpWindowImpl->mnX;
nFlags |= WINDOW_POSSIZE_X;
- bnXRecycled = TRUE; // we're using a mnX which was already mirrored in RTL case
+ bnXRecycled = sal_True; // we're using a mnX which was already mirrored in RTL case
}
if ( nWidth < 0 )
@@ -3224,8 +3236,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nWidth != mnOutWidth )
{
mnOutWidth = nWidth;
- bNewSize = TRUE;
- bCopyBits = FALSE;
+ bNewSize = sal_True;
+ bCopyBits = sal_False;
}
}
if ( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -3235,8 +3247,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( nHeight != mnOutHeight )
{
mnOutHeight = nHeight;
- bNewSize = TRUE;
- bCopyBits = FALSE;
+ bNewSize = sal_True;
+ bCopyBits = sal_False;
}
}
@@ -3286,12 +3298,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, FALSE, TRUE, TRUE );
+ *pOverlapRegion, sal_False, sal_True, sal_True );
}
mpWindowImpl->mnX = nX;
mpWindowImpl->maPos.X() = nOrgX;
mpWindowImpl->mnAbsScreenX = aPtDev.X(); // --- RTL --- (store real screen pos)
- bNewPos = TRUE;
+ bNewPos = sal_True;
}
}
if ( nFlags & WINDOW_POSSIZE_Y )
@@ -3304,11 +3316,11 @@ void Window::ImplPosSizeWindow( long nX, long nY,
pOverlapRegion = new Region();
ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ),
Size( mnOutWidth, mnOutHeight ) ),
- *pOverlapRegion, FALSE, TRUE, TRUE );
+ *pOverlapRegion, sal_False, sal_True, sal_True );
}
mpWindowImpl->mnY = nY;
mpWindowImpl->maPos.Y() = nY;
- bNewPos = TRUE;
+ bNewPos = sal_True;
}
}
@@ -3324,7 +3336,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
*/
if ( bNewPos || bNewSize )
{
- BOOL bUpdateSysObjPos = FALSE;
+ sal_Bool bUpdateSysObjPos = sal_False;
if ( bNewPos )
bUpdateSysObjPos = ImplUpdatePos();
@@ -3351,7 +3363,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
else
{
- mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = TRUE;
+ mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = sal_True;
}
}
}
@@ -3377,12 +3389,12 @@ void Window::ImplPosSizeWindow( long nX, long nY,
else
{
if ( bNewPos )
- mpWindowImpl->mbCallMove = TRUE;
+ mpWindowImpl->mbCallMove = sal_True;
if ( bNewSize )
- mpWindowImpl->mbCallResize = TRUE;
+ mpWindowImpl->mbCallResize = sal_True;
}
- BOOL bUpdateSysObjClip = FALSE;
+ sal_Bool bUpdateSysObjClip = sal_False;
if ( IsReallyVisible() )
{
if ( bNewPos || bNewSize )
@@ -3393,7 +3405,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if ( mpWindowImpl->mpFrameData->mpFirstBackWin )
ImplInvalidateAllOverlapBackgrounds();
// Clip-Flag neu setzen
- bUpdateSysObjClip = !ImplSetClipFlag( TRUE );
+ bUpdateSysObjClip = !ImplSetClipFlag( sal_True );
}
// Fensterinhalt invalidieren ?
@@ -3401,8 +3413,8 @@ void Window::ImplPosSizeWindow( long nX, long nY,
{
if ( bNewPos )
{
- BOOL bInvalidate = FALSE;
- BOOL bParentPaint = TRUE;
+ sal_Bool bInvalidate = sal_False;
+ sal_Bool bParentPaint = sal_True;
if ( !ImplIsOverlapWindow() )
bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled();
if ( bCopyBits && bParentPaint && !HasPaintEvent() )
@@ -3412,7 +3424,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Size( mnOutWidth, mnOutHeight ) ) );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !pOverlapRegion->IsEmpty() )
{
pOverlapRegion->Move( mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY );
@@ -3424,7 +3436,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
ImplMoveAllInvalidateRegions( Rectangle( Point( nOldOutOffX, nOldOutOffY ),
Size( nOldOutWidth, nOldOutHeight ) ),
mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY,
- TRUE );
+ sal_True );
SalGraphics* pGraphics = ImplGetFrameGraphics();
if ( pGraphics )
{
@@ -3437,10 +3449,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
SAL_COPYAREA_WINDOWINVALIDATE, this );
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
if ( !bInvalidate )
{
if ( !pOverlapRegion->IsEmpty() )
@@ -3448,10 +3460,10 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
}
else
- bInvalidate = TRUE;
+ bInvalidate = sal_True;
if ( bInvalidate )
ImplInvalidateFrameRegion( NULL, INVALIDATE_CHILDREN );
}
@@ -3463,7 +3475,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
aRegion.Exclude( *pOldRegion );
if ( mpWindowImpl->mbWinRegion )
aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !aRegion.IsEmpty() )
ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN );
}
@@ -3476,7 +3488,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
Region aRegion( *pOldRegion );
if ( !mpWindowImpl->mbPaintTransparent )
ImplExcludeWindowRegion( aRegion );
- ImplClipBoundaries( aRegion, FALSE, TRUE );
+ ImplClipBoundaries( aRegion, sal_False, sal_True );
if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow )
ImplInvalidateParentFrameRegion( aRegion );
}
@@ -3567,7 +3579,7 @@ void Window::ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData )
// -----------------------------------------------------------------------
-void Window::ImplToTop( USHORT nFlags )
+void Window::ImplToTop( sal_uInt16 nFlags )
{
DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" );
@@ -3584,7 +3596,7 @@ void Window::ImplToTop( USHORT nFlags )
// do not bring floating windows on the client to top
if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) )
{
- USHORT nSysFlags = 0;
+ sal_uInt16 nSysFlags = 0;
if ( nFlags & TOTOP_RESTOREWHENMIN )
nSysFlags |= SAL_FRAME_TOTOP_RESTOREWHENMIN;
if ( nFlags & TOTOP_FOREGROUNDTASK )
@@ -3607,7 +3619,7 @@ void Window::ImplToTop( USHORT nFlags )
mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev;
// AlwaysOnTop beruecksichtigen
- BOOL bOnTop = IsAlwaysOnTopEnabled();
+ sal_Bool bOnTop = IsAlwaysOnTopEnabled();
Window* pNextWin = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
if ( !bOnTop )
{
@@ -3620,7 +3632,7 @@ void Window::ImplToTop( USHORT nFlags )
}
// TopLevel abpruefen
- BYTE nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
+ sal_uInt8 nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel;
while ( pNextWin )
{
if ( (bOnTop != pNextWin->IsAlwaysOnTopEnabled()) ||
@@ -3661,7 +3673,7 @@ void Window::ImplToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplStartToTop( USHORT nFlags )
+void Window::ImplStartToTop( sal_uInt16 nFlags )
{
ImplCalcToTopData aStartData;
ImplCalcToTopData* pCurData;
@@ -3716,7 +3728,7 @@ void Window::ImplStartToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible )
+void Window::ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible )
{
// Soll Focus auch geholt werden?
if ( !(nFlags & TOTOP_NOGRABFOCUS) )
@@ -3735,7 +3747,7 @@ void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible )
pFocusWindow = pFocusWindow->ImplGetParent();
}
if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) &&
- !pFocusWindow->HasChildPathFocus( TRUE ) )
+ !pFocusWindow->HasChildPathFocus( sal_True ) )
pFocusWindow->GrabFocus();
}
@@ -3753,7 +3765,7 @@ void Window::ImplShowAllOverlaps()
if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
{
pOverlapWindow->Show( true, SHOW_NOACTIVATE );
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = FALSE;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_False;
}
pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -3769,7 +3781,7 @@ void Window::ImplHideAllOverlaps()
{
if ( pOverlapWindow->IsVisible() )
{
- pOverlapWindow->mpWindowImpl->mbOverlapVisible = TRUE;
+ pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_True;
pOverlapWindow->Show( false );
}
@@ -3779,24 +3791,24 @@ void Window::ImplHideAllOverlaps()
// -----------------------------------------------------------------------
-void Window::ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged )
+void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged )
{
if ( mpWindowImpl->mpFrameData->mbMouseIn && mpWindowImpl->mpFrameWindow->mpWindowImpl->mbReallyVisible )
{
- ULONG nTime = Time::GetSystemTicks();
+ sal_uLong nTime = Time::GetSystemTicks();
long nX = mpWindowImpl->mpFrameData->mnLastMouseX;
long nY = mpWindowImpl->mpFrameData->mnLastMouseY;
- USHORT nCode = nMouseCode;
- USHORT nMode = mpWindowImpl->mpFrameData->mnMouseMode;
- BOOL bLeave;
+ sal_uInt16 nCode = nMouseCode;
+ sal_uInt16 nMode = mpWindowImpl->mpFrameData->mnMouseMode;
+ sal_Bool bLeave;
// Auf MouseLeave testen
if ( ((nX < 0) || (nY < 0) ||
(nX >= mpWindowImpl->mpFrameWindow->mnOutWidth) ||
(nY >= mpWindowImpl->mpFrameWindow->mnOutHeight)) &&
!ImplGetSVData()->maWinData.mpCaptureWin )
- bLeave = TRUE;
+ bLeave = sal_True;
else
- bLeave = FALSE;
+ bLeave = sal_False;
nMode |= MOUSE_SYNTHETIC;
if ( bModChanged )
nMode |= MOUSE_MODIFIERCHANGED;
@@ -3843,8 +3855,8 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
Window* pNewRealWindow;
Window* pOldRealWindow;
Window* pLastRealWindow;
- BOOL bCallActivate = TRUE;
- BOOL bCallDeactivate = TRUE;
+ sal_Bool bCallActivate = sal_True;
+ sal_Bool bCallDeactivate = sal_True;
pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
@@ -3855,7 +3867,7 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
!pNewRealWindow->GetActivateMode() )
{
pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
- bCallDeactivate = FALSE;
+ bCallDeactivate = sal_False;
}
}
else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
@@ -3864,15 +3876,15 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
if ( pSVData->maWinData.mpLastDeacWin )
{
if ( pSVData->maWinData.mpLastDeacWin == pNewOverlapWindow )
- bCallActivate = FALSE;
+ bCallActivate = sal_False;
else
{
pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow();
- pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = FALSE;
+ pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = sal_False;
pSVData->maWinData.mpLastDeacWin->Deactivate();
if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin )
{
- pLastRealWindow->mpWindowImpl->mbActive = TRUE;
+ pLastRealWindow->mpWindowImpl->mbActive = sal_True;
pLastRealWindow->Activate();
}
}
@@ -3884,14 +3896,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( pOldOverlapWindow->mpWindowImpl->mbActive )
{
- pOldOverlapWindow->mpWindowImpl->mbActive = FALSE;
+ pOldOverlapWindow->mpWindowImpl->mbActive = sal_False;
pOldOverlapWindow->Deactivate();
}
if ( pOldRealWindow != pOldOverlapWindow )
{
if( pOldRealWindow->mpWindowImpl->mbActive )
{
- pOldRealWindow->mpWindowImpl->mbActive = FALSE;
+ pOldRealWindow->mpWindowImpl->mbActive = sal_False;
pOldRealWindow->Deactivate();
}
}
@@ -3900,14 +3912,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
{
if( ! pNewOverlapWindow->mpWindowImpl->mbActive )
{
- pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
+ pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
pNewOverlapWindow->Activate();
}
if ( pNewRealWindow != pNewOverlapWindow )
{
if( ! pNewRealWindow->mpWindowImpl->mbActive )
{
- pNewRealWindow->mpWindowImpl->mbActive = TRUE;
+ pNewRealWindow->mpWindowImpl->mbActive = sal_True;
pNewRealWindow->Activate();
}
}
@@ -3929,7 +3941,7 @@ static bool IsWindowFocused(const WindowImpl& rWinImpl)
}
// -----------------------------------------------------------------------
-void Window::ImplGrabFocus( USHORT nFlags )
+void Window::ImplGrabFocus( sal_uInt16 nFlags )
{
// #143570# no focus for destructing windows
if( mpWindowImpl->mbInDtor )
@@ -3987,13 +3999,13 @@ void Window::ImplGrabFocus( USHORT nFlags )
// which is done using ToTop
ImplSVData* pSVData = ImplGetSVData();
- BOOL bAsyncFocusWaiting = FALSE;
+ sal_Bool bAsyncFocusWaiting = sal_False;
Window *pFrame = pSVData->maWinData.mpFirstFrame;
while( pFrame )
{
if( pFrame != mpWindowImpl->mpFrameWindow && pFrame->mpWindowImpl->mpFrameData->mnFocusId )
{
- bAsyncFocusWaiting = TRUE;
+ bAsyncFocusWaiting = sal_True;
break;
}
pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4001,7 +4013,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
bool bHasFocus = IsWindowFocused(*mpWindowImpl);
- BOOL bMustNotGrabFocus = FALSE;
+ sal_Bool bMustNotGrabFocus = sal_False;
// #100242#, check parent hierarchy if some floater prohibits grab focus
Window *pParent = this;
@@ -4011,7 +4023,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// otherwise we cannot set the focus in a floating toolbox
if( ( (pParent->mpWindowImpl->mbFloatWin && ((FloatingWindow*)pParent)->GrabsFocus()) || ( pParent->GetStyle() & WB_SYSTEMFLOATWIN ) ) && !( pParent->GetStyle() & WB_MOVEABLE ) )
{
- bMustNotGrabFocus = TRUE;
+ bMustNotGrabFocus = sal_True;
break;
}
pParent = pParent->mpWindowImpl->mpParent;
@@ -4072,11 +4084,11 @@ void Window::ImplGrabFocus( USHORT nFlags )
{
Window* pNewOverlapWindow = ImplGetFirstOverlapWindow();
Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
- pNewOverlapWindow->mpWindowImpl->mbActive = TRUE;
+ pNewOverlapWindow->mpWindowImpl->mbActive = sal_True;
pNewOverlapWindow->Activate();
if ( pNewRealWindow != pNewOverlapWindow )
{
- pNewRealWindow->mpWindowImpl->mbActive = TRUE;
+ pNewRealWindow->mpWindowImpl->mbActive = sal_True;
pNewRealWindow->Activate();
}
}
@@ -4106,7 +4118,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
{
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplShow();
- mpWindowImpl->mbInFocusHdl = TRUE;
+ mpWindowImpl->mbInFocusHdl = sal_True;
mpWindowImpl->mnGetFocusFlags = nFlags;
// if we're changing focus due to closing a popup floating window
// notify the new focus window so it can restore the inner focus
@@ -4123,7 +4135,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
if( !aDogTag.IsDelete() )
{
mpWindowImpl->mnGetFocusFlags = 0;
- mpWindowImpl->mbInFocusHdl = FALSE;
+ mpWindowImpl->mbInFocusHdl = sal_False;
}
}
}
@@ -4243,6 +4255,8 @@ namespace
Window::~Window()
{
+ ImplFreeExtWindowImpl();
+
vcl::LazyDeletor<Window>::Undelete( this );
DBG_DTOR( Window, ImplDbgCheckWindow );
@@ -4254,7 +4268,7 @@ Window::~Window()
// Dispose of the canvas implementation (which, currently, has an
// own wrapper window as a child to this one.
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
if( xCanvas.is() )
{
uno::Reference < lang::XComponent > xCanvasComponent( xCanvas,
@@ -4263,7 +4277,7 @@ Window::~Window()
xCanvasComponent->dispose();
}
- mpWindowImpl->mbInDtor = TRUE;
+ mpWindowImpl->mbInDtor = sal_True;
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
@@ -4299,12 +4313,12 @@ Window::~Window()
// deregister drop target listener
if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
{
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->removeDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
@@ -4312,7 +4326,7 @@ Window::~Window()
}
// shutdown drag and drop for this frame window
- Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
+ uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
// DNDEventDispatcher does not hold a reference of the DropTarget,
// so it's ok if it does not support XComponent
@@ -4326,7 +4340,7 @@ Window::~Window()
}
}
- UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE );
+ UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False );
if ( pWrapper )
pWrapper->WindowDestroyed( this );
@@ -4362,16 +4376,16 @@ Window::~Window()
pSVData->maWinData.mpDefDialogParent = NULL;
#ifdef DBG_UTIL
- if ( TRUE ) // always perform these tests in non-pro versions
+ if ( sal_True ) // always perform these tests in non-pro versions
{
ByteString aErrorStr;
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = TRUE;
+ bError = sal_True;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpNextOverlap;
@@ -4386,13 +4400,13 @@ Window::~Window()
GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed!
}
- bError = FALSE;
+ bError = sal_False;
pTempWin = pSVData->maWinData.mpFirstFrame;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
{
- bError = TRUE;
+ bError = sal_True;
lcl_appendWindowInfo( aErrorStr, *pTempWin );
}
pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -4499,11 +4513,11 @@ Window::~Window()
}
// check if the focus window is our child
- BOOL bHasFocussedChild = FALSE;
+ sal_Bool bHasFocussedChild = sal_False;
if( pSVData->maWinData.mpFocusWin && ImplIsRealParentPath( pSVData->maWinData.mpFocusWin ) )
{
// #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below
- bHasFocussedChild = TRUE;
+ bHasFocussedChild = sal_True;
#ifdef DBG_UTIL
ByteString aTempStr( "Window (" );
aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 );
@@ -4589,18 +4603,18 @@ Window::~Window()
ImplDelData* pDelData = mpWindowImpl->mpFirstDel;
while ( pDelData )
{
- pDelData->mbDel = TRUE;
+ pDelData->mbDel = sal_True;
pDelData->mpWindow = NULL; // #112873# pDel is not associated with a Window anymore
pDelData = pDelData->mpNext;
}
// Fenster aus den Listen austragen
- ImplRemoveWindow( TRUE );
+ ImplRemoveWindow( sal_True );
// de-register as "top window child" at our parent, if necessary
if ( mpWindowImpl->mbFrame )
{
- BOOL bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
+ sal_Bool bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
if ( mpWindowImpl->mpRealParent && bIsTopWindow )
{
ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData();
@@ -4626,10 +4640,6 @@ Window::~Window()
delete mpWindowImpl->mpWinData->mpFocusRect;
if ( mpWindowImpl->mpWinData->mpTrackRect )
delete mpWindowImpl->mpWinData->mpTrackRect;
- if ( mpWindowImpl->mpWinData->mpSmartHelpId )
- delete mpWindowImpl->mpWinData->mpSmartHelpId;
- if ( mpWindowImpl->mpWinData->mpSmartUniqueId )
- delete mpWindowImpl->mpWinData->mpSmartUniqueId;
delete mpWindowImpl->mpWinData;
}
@@ -4683,17 +4693,24 @@ void Window::doLazyDelete()
vcl::LazyDeletor<Window>::Delete( this );
}
-USHORT Window::GetIndicatorState() const
+sal_uInt16 Window::GetIndicatorState() const
{
return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
}
-void Window::SimulateKeyPress( USHORT nKeyCode ) const
+void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const
{
mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
}
// -----------------------------------------------------------------------
+void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ if( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->InterceptChildWindowKeyDown( bIntercept );
+}
+
+// -----------------------------------------------------------------------
void Window::MouseMove( const MouseEvent& rMEvt )
{
@@ -4703,7 +4720,7 @@ void Window::MouseMove( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEMOVE, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseMove = TRUE;
+ mpWindowImpl->mbMouseMove = sal_True;
}
// -----------------------------------------------------------------------
@@ -4716,7 +4733,7 @@ void Window::MouseButtonDown( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONDOWN, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonDown = TRUE;
+ mpWindowImpl->mbMouseButtonDown = sal_True;
}
// -----------------------------------------------------------------------
@@ -4729,7 +4746,7 @@ void Window::MouseButtonUp( const MouseEvent& rMEvt )
NotifyEvent aNEvt( EVENT_MOUSEBUTTONUP, this, &rMEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbMouseButtonUp = TRUE;
+ mpWindowImpl->mbMouseButtonUp = sal_True;
}
// -----------------------------------------------------------------------
@@ -4742,7 +4759,7 @@ void Window::KeyInput( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYINPUT, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyInput = TRUE;
+ mpWindowImpl->mbKeyInput = sal_True;
}
// -----------------------------------------------------------------------
@@ -4755,7 +4772,7 @@ void Window::KeyUp( const KeyEvent& rKEvt )
NotifyEvent aNEvt( EVENT_KEYUP, this, &rKEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbKeyUp = TRUE;
+ mpWindowImpl->mbKeyUp = sal_True;
}
// -----------------------------------------------------------------------
@@ -4777,7 +4794,13 @@ void Window::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------
-void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG )
+void Window::PostPaint()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void Window::Draw( OutputDevice*, const Point&, const Size&, sal_uLong )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -4881,29 +4904,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
-
- if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() )
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.Len() == 0 && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
- if ( !nNumHelpId && aStrHelpId.Len() == 0 )
- nNumHelpId = OOO_HELP_INDEX;
-
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if( aStrHelpId.Len() > 0 )
pHelp->Start( aStrHelpId, this );
else
- pHelp->Start( nNumHelpId, this );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
}
}
}
@@ -4921,7 +4933,7 @@ void Window::Command( const CommandEvent& rCEvt )
NotifyEvent aNEvt( EVENT_COMMAND, this, &rCEvt );
if ( !Notify( aNEvt ) )
- mpWindowImpl->mbCommand = TRUE;
+ mpWindowImpl->mbCommand = sal_True;
}
// -----------------------------------------------------------------------
@@ -4937,7 +4949,7 @@ void Window::Tracking( const TrackingEvent& rTEvt )
// -----------------------------------------------------------------------
-void Window::UserEvent( ULONG, void* )
+void Window::UserEvent( sal_uLong, void* )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
@@ -5065,7 +5077,7 @@ long Window::PreNotify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long bDone = FALSE;
+ long bDone = sal_False;
if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() )
bDone = mpWindowImpl->mpParent->PreNotify( rNEvt );
@@ -5073,11 +5085,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
{
if( rNEvt.GetType() == EVENT_GETFOCUS )
{
- BOOL bCompoundFocusChanged = FALSE;
+ sal_Bool bCompoundFocusChanged = sal_False;
if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = TRUE;
- bCompoundFocusChanged = TRUE;
+ mpWindowImpl->mbCompoundControlHasFocus = sal_True;
+ bCompoundFocusChanged = sal_True;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5085,11 +5097,11 @@ long Window::PreNotify( NotifyEvent& rNEvt )
}
else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
{
- BOOL bCompoundFocusChanged = FALSE;
+ sal_Bool bCompoundFocusChanged = sal_False;
if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() )
{
- mpWindowImpl->mbCompoundControlHasFocus = FALSE ;
- bCompoundFocusChanged = TRUE;
+ mpWindowImpl->mbCompoundControlHasFocus = sal_False ;
+ bCompoundFocusChanged = sal_True;
}
if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) )
@@ -5112,7 +5124,7 @@ long Window::Notify( NotifyEvent& rNEvt )
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
}
- long nRet = FALSE;
+ long nRet = sal_False;
// check for docking window
// but do nothing if window is docked and locked
@@ -5122,27 +5134,27 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
if ( pMEvt->IsLeft() )
{
if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) )
{
// ctrl double click toggles floating mode
pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() );
- return TRUE;
+ return sal_True;
}
else if ( pMEvt->GetClicks() == 1 && bHit)
{
// allow start docking during mouse move
pWrapper->ImplEnableStartDocking();
- return TRUE;
+ return sal_True;
}
}
}
else if ( rNEvt.GetType() == EVENT_MOUSEMOVE )
{
const MouseEvent* pMEvt = rNEvt.GetMouseEvent();
- BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
+ sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() );
if ( pMEvt->IsLeft() )
{
// check if a single click initiated this sequence ( ImplStartDockingEnabled() )
@@ -5159,7 +5171,7 @@ long Window::Notify( NotifyEvent& rNEvt )
}
pWrapper->ImplStartDocking( aPos );
}
- return TRUE;
+ return sal_True;
}
}
else if( rNEvt.GetType() == EVENT_KEYINPUT )
@@ -5177,7 +5189,7 @@ long Window::Notify( NotifyEvent& rNEvt )
*/
if( pWrapper->IsFloatingMode() )
ToTop( TOTOP_GRABFOCUSONLY );
- return TRUE;
+ return sal_True;
}
}
}
@@ -5200,7 +5212,7 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == EVENT_GETFOCUS) &&
!(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
Window* pFirstChild = ImplGetDlgWindow( n, DLGWINDOW_FIRST );
if ( pFirstChild )
pFirstChild->ImplControlFocus();
@@ -5219,7 +5231,7 @@ long Window::Notify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-void Window::ImplCallEventListeners( ULONG nEvent, void* pData )
+void Window::ImplCallEventListeners( sal_uLong nEvent, void* pData )
{
// The implementation was moved to CallEventListeners(),
// because derived classes in svtools must be able to
@@ -5232,7 +5244,7 @@ void Window::ImplCallEventListeners( ULONG nEvent, void* pData )
// -----------------------------------------------------------------------
-void Window::CallEventListeners( ULONG nEvent, void* pData )
+void Window::CallEventListeners( sal_uLong nEvent, void* pData )
{
VclWindowEvent aEvent( this, nEvent, pData );
@@ -5302,25 +5314,25 @@ void Window::RemoveChildEventListener( const Link& rEventListener )
// -----------------------------------------------------------------------
-ULONG Window::PostUserEvent( ULONG nEvent, void* pEventData )
+sal_uLong Window::PostUserEvent( sal_uLong nEvent, void* pEventData )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, nEvent, pEventData );
return nEventId;
}
// -----------------------------------------------------------------------
-ULONG Window::PostUserEvent( const Link& rLink, void* pCaller )
+sal_uLong Window::PostUserEvent( const Link& rLink, void* pCaller )
{
- ULONG nEventId;
+ sal_uLong nEventId;
PostUserEvent( nEventId, rLink, pCaller );
return nEventId;
}
// -----------------------------------------------------------------------
-BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
+sal_Bool Window::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5329,23 +5341,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData )
pSVEvent->mpData = pEventData;
pSVEvent->mpLink = NULL;
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = TRUE;
+ pSVEvent->mbCall = sal_True;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (ULONG)pSVEvent;
+ rEventId = (sal_uLong)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
+sal_Bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5354,23 +5366,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller )
pSVEvent->mpData = pCaller;
pSVEvent->mpLink = new Link( rLink );
pSVEvent->mpWindow = this;
- pSVEvent->mbCall = TRUE;
+ pSVEvent->mbCall = sal_True;
ImplAddDel( &(pSVEvent->maDelData) );
- rEventId = (ULONG)pSVEvent;
+ rEventId = (sal_uLong)pSVEvent;
if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
- return TRUE;
+ return sal_True;
else
{
rEventId = 0;
ImplRemoveDel( &(pSVEvent->maDelData) );
delete pSVEvent;
- return FALSE;
+ return sal_False;
}
}
// -----------------------------------------------------------------------
-void Window::RemoveUserEvent( ULONG nUserEvent )
+void Window::RemoveUserEvent( sal_uLong nUserEvent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5387,14 +5399,14 @@ void Window::RemoveUserEvent( ULONG nUserEvent )
pSVEvent->mpWindow = NULL;
}
- pSVEvent->mbCall = FALSE;
+ pSVEvent->mbCall = sal_False;
}
// -----------------------------------------------------------------------
IMPL_LINK( Window, ImplAsyncStateChangedHdl, void*, pState )
{
- StateChanged( (StateChangedType)(ULONG)pState );
+ StateChanged( (StateChangedType)(sal_uLong)pState );
return 0;
}
@@ -5404,28 +5416,28 @@ void Window::PostStateChanged( StateChangedType nState )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(ULONG)nState );
+ PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(sal_uLong)nState );
}
// -----------------------------------------------------------------------
-BOOL Window::IsLocked( BOOL bChilds ) const
+sal_Bool Window::IsLocked( sal_Bool bChilds ) const
{
if ( mpWindowImpl->mnLockCount != 0 )
- return TRUE;
+ return sal_True;
if ( bChilds || mpWindowImpl->mbChildNotify )
{
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
- if ( pChild->IsLocked( TRUE ) )
- return TRUE;
+ if ( pChild->IsLocked( sal_True ) )
+ return sal_True;
pChild = pChild->mpWindowImpl->mpNext;
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -5483,7 +5495,7 @@ SystemWindow* Window::GetSystemWindow() const
// -----------------------------------------------------------------------
-void Window::SetBorderStyle( USHORT nBorderStyle )
+void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5526,7 +5538,7 @@ void Window::SetBorderStyle( USHORT nBorderStyle )
// -----------------------------------------------------------------------
-USHORT Window::GetBorderStyle() const
+sal_uInt16 Window::GetBorderStyle() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5574,7 +5586,7 @@ long Window::CalcTitleWidth() const
// -----------------------------------------------------------------------
-void Window::EnableClipSiblings( BOOL bClipSiblings )
+void Window::EnableClipSiblings( sal_Bool bClipSiblings )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5586,7 +5598,7 @@ void Window::EnableClipSiblings( BOOL bClipSiblings )
// -----------------------------------------------------------------------
-void Window::SetMouseTransparent( BOOL bTransparent )
+void Window::SetMouseTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5601,7 +5613,7 @@ void Window::SetMouseTransparent( BOOL bTransparent )
// -----------------------------------------------------------------------
-void Window::SetPaintTransparent( BOOL bTransparent )
+void Window::SetPaintTransparent( sal_Bool bTransparent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5628,7 +5640,7 @@ void Window::SetInputContext( const InputContext& rInputContext )
// -----------------------------------------------------------------------
-void Window::EndExtTextInput( USHORT nFlags )
+void Window::EndExtTextInput( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5686,24 +5698,24 @@ long Window::GetCursorExtTextInputWidth() const
// -----------------------------------------------------------------------
void Window::SetSettings( const AllSettings& rSettings )
{
- SetSettings( rSettings, FALSE );
+ SetSettings( rSettings, sal_False );
}
-void Window::SetSettings( const AllSettings& rSettings, BOOL bChild )
+void Window::SetSettings( const AllSettings& rSettings, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->SetSettings( rSettings, FALSE );
+ mpWindowImpl->mpBorderWindow->SetSettings( rSettings, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, sal_True );
}
AllSettings aOldSettings = maSettings;
OutputDevice::SetSettings( rSettings );
- ULONG nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
+ sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( rSettings );
// AppFont-Aufloesung und DPI-Aufloesung neu berechnen
ImplInitResolutionSettings();
@@ -5727,20 +5739,20 @@ void Window::SetSettings( const AllSettings& rSettings, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::UpdateSettings( const AllSettings& rSettings, BOOL bChild )
+void Window::UpdateSettings( const AllSettings& rSettings, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, FALSE );
+ mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, sal_True );
}
AllSettings aOldSettings = maSettings;
- ULONG nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings );
+ sal_uLong nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings );
nChangeFlags |= SETTINGS_IN_UPDATE_SETTINGS; // Set this flag so the receiver of the data changed
// event can distinguish between the changing of global
// setting and a local change ( with SetSettings )
@@ -5830,7 +5842,7 @@ Font Window::GetPointFont() const
// -----------------------------------------------------------------------
-void Window::SetParentClipMode( USHORT nMode )
+void Window::SetParentClipMode( sal_uInt16 nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5842,14 +5854,14 @@ void Window::SetParentClipMode( USHORT nMode )
{
mpWindowImpl->mnParentClipMode = nMode;
if ( nMode & PARENTCLIPMODE_CLIP )
- mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = TRUE;
+ mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = sal_True;
}
}
}
// -----------------------------------------------------------------------
-USHORT Window::GetParentClipMode() const
+sal_uInt16 Window::GetParentClipMode() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5870,7 +5882,7 @@ void Window::SetWindowRegionPixel()
else if( mpWindowImpl->mbFrame )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL);
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
mpWindowImpl->mpFrame->ResetClipRegion();
}
else
@@ -5878,7 +5890,7 @@ void Window::SetWindowRegionPixel()
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
ImplSetClipFlag();
if ( IsReallyVisible() )
@@ -5917,9 +5929,9 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
long nY;
long nWidth;
long nHeight;
- ULONG nRectCount;
+ sal_uLong nRectCount;
ImplRegionInfo aInfo;
- BOOL bRegionRect;
+ sal_Bool bRegionRect;
nRectCount = mpWindowImpl->maWinRegion.GetRectCount();
mpWindowImpl->mpFrame->BeginSetClipRegion( nRectCount );
@@ -5944,14 +5956,14 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
if ( mpWindowImpl->mbWinRegion )
{
mpWindowImpl->maWinRegion = Region( REGION_NULL );
- mpWindowImpl->mbWinRegion = FALSE;
+ mpWindowImpl->mbWinRegion = sal_False;
ImplSetClipFlag();
}
}
else
{
mpWindowImpl->maWinRegion = rRegion;
- mpWindowImpl->mbWinRegion = TRUE;
+ mpWindowImpl->mbWinRegion = sal_True;
ImplSetClipFlag();
}
@@ -5983,7 +5995,7 @@ const Region& Window::GetWindowRegionPixel() const
// -----------------------------------------------------------------------
-BOOL Window::IsWindowRegionPixel() const
+sal_Bool Window::IsWindowRegionPixel() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -5995,7 +6007,7 @@ BOOL Window::IsWindowRegionPixel() const
// -----------------------------------------------------------------------
-Region Window::GetWindowClipRegionPixel( USHORT nFlags ) const
+Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6066,7 +6078,7 @@ void Window::ExpandPaintClipRegion( const Region& rRegion )
if( ! aDevPixRegion.IsEmpty() )
{
mpWindowImpl->mpPaintRegion->Union( aDevPixRegion );
- mbInitClipRegion = TRUE;
+ mbInitClipRegion = sal_True;
}
}
}
@@ -6101,13 +6113,13 @@ void Window::SetParent( Window* pNewParent )
// check if the taskpanelist would change and move the window pointer accordingly
SystemWindow *pSysWin = ImplGetLastSystemWindow(this);
SystemWindow *pNewSysWin = NULL;
- BOOL bChangeTaskPaneList = FALSE;
+ sal_Bool bChangeTaskPaneList = sal_False;
if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) )
{
pNewSysWin = ImplGetLastSystemWindow( pNewParent );
if( pNewSysWin && pNewSysWin != pSysWin )
{
- bChangeTaskPaneList = TRUE;
+ bChangeTaskPaneList = sal_True;
pSysWin->GetTaskPaneList()->RemoveWindow( this );
}
}
@@ -6136,7 +6148,7 @@ void Window::SetParent( Window* pNewParent )
if ( mpWindowImpl->mbFrame )
mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
- BOOL bVisible = IsVisible();
+ sal_Bool bVisible = IsVisible();
Show( false, SHOW_NOFOCUSCHANGE );
// Testen, ob sich das Overlap-Window aendert
@@ -6154,9 +6166,9 @@ void Window::SetParent( Window* pNewParent )
}
// Fenster in der Hirachie umsetzen
- BOOL bFocusOverlapWin = HasChildPathFocus( TRUE );
- BOOL bFocusWin = HasChildPathFocus();
- BOOL bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
+ sal_Bool bFocusOverlapWin = HasChildPathFocus( sal_True );
+ sal_Bool bFocusWin = HasChildPathFocus();
+ sal_Bool bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow;
if ( bNewFrame )
{
if ( mpWindowImpl->mpFrameData->mpFocusWin )
@@ -6178,7 +6190,7 @@ void Window::SetParent( Window* pNewParent )
ImplRemoveWindow( bNewFrame );
ImplInsertWindow( pNewParent );
if ( mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP )
- pNewParent->mpWindowImpl->mbClipChildren = TRUE;
+ pNewParent->mpWindowImpl->mbClipChildren = sal_True;
ImplUpdateWindowPtr();
if ( ImplUpdatePos() )
ImplUpdateSysObjPos();
@@ -6217,7 +6229,7 @@ void Window::SetParent( Window* pNewParent )
}
// Activate-Status beim naechsten Overlap-Window updaten
- if ( HasChildPathFocus( TRUE ) )
+ if ( HasChildPathFocus( sal_True ) )
ImplCallFocusChangeActivate( pNewOverlapWindow, pOldOverlapWindow );
}
@@ -6258,7 +6270,7 @@ void Window::SetParent( Window* pNewParent )
// -----------------------------------------------------------------------
-void Window::Show( BOOL bVisible, USHORT nFlags )
+void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6267,7 +6279,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
ImplDelData aDogTag( this );
- BOOL bRealVisibilityChanged = FALSE;
+ sal_Bool bRealVisibilityChanged = sal_False;
mpWindowImpl->mbVisible = (bVisible != 0);
if ( !bVisible )
@@ -6280,14 +6292,14 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
{
bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
if ( mpWindowImpl->mbNoParentUpdate )
- mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = TRUE;
+ mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = sal_True;
mpWindowImpl->mpBorderWindow->Show( false, nFlags );
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
}
else if ( mpWindowImpl->mbFrame )
{
- mpWindowImpl->mbSuppressAccessibilityEvents = TRUE;
- mpWindowImpl->mpFrame->Show( FALSE, FALSE );
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_True;
+ mpWindowImpl->mpFrame->Show( sal_False, sal_False );
}
StateChanged( STATE_CHANGE_VISIBLE );
@@ -6295,12 +6307,12 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( mpWindowImpl->mbReallyVisible )
{
Region aInvRegion( REGION_EMPTY );
- BOOL bSaveBack = FALSE;
+ sal_Bool bSaveBack = sal_False;
if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame )
{
if ( ImplRestoreOverlapBackground( aInvRegion ) )
- bSaveBack = TRUE;
+ bSaveBack = sal_True;
}
if ( !bSaveBack )
@@ -6395,7 +6407,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) )
{
ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 );
- ImplFocusToTop( 0, FALSE );
+ ImplFocusToTop( 0, sal_False );
}
// Hintergrund sichern
@@ -6410,7 +6422,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( !mpWindowImpl->mbFrame )
{
- USHORT nInvalidateFlags = INVALIDATE_CHILDREN;
+ sal_uInt16 nInvalidateFlags = INVALIDATE_CHILDREN;
if( ! IsPaintTransparent() )
nInvalidateFlags |= INVALIDATE_NOTRANSPARENT;
ImplInvalidate( NULL, nInvalidateFlags );
@@ -6437,11 +6449,11 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
}
//DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
- mpWindowImpl->mbSuppressAccessibilityEvents = FALSE;
+ mpWindowImpl->mbSuppressAccessibilityEvents = sal_False;
- mpWindowImpl->mbPaintFrame = TRUE;
- BOOL bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? TRUE : FALSE;
- mpWindowImpl->mpFrame->Show( TRUE, bNoActivate );
+ mpWindowImpl->mbPaintFrame = sal_True;
+ sal_Bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? sal_True : sal_False;
+ mpWindowImpl->mpFrame->Show( sal_True, bNoActivate );
if( aDogTag.IsDelete() )
return;
@@ -6562,10 +6574,10 @@ void Window::Enable( bool bEnable, bool bChild )
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->Enable( bEnable, FALSE );
+ mpWindowImpl->mpBorderWindow->Enable( bEnable, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, sal_True );
}
// #i56102# restore app focus win in case the
@@ -6607,7 +6619,7 @@ void Window::Enable( bool bEnable, bool bChild )
void Window::SetCallHandlersOnInputDisabled( bool bCall )
{
- mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? TRUE : FALSE;
+ mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? sal_True : sal_False;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
@@ -6626,17 +6638,17 @@ bool Window::IsCallHandlersOnInputDisabled() const
// -----------------------------------------------------------------------
-void Window::EnableInput( BOOL bEnable, BOOL bChild )
+void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
+ sal_Bool bNotify = (bEnable != mpWindowImpl->mbInputDisabled);
if ( mpWindowImpl->mpBorderWindow )
{
- mpWindowImpl->mpBorderWindow->EnableInput( bEnable, FALSE );
+ mpWindowImpl->mpBorderWindow->EnableInput( bEnable, sal_False );
if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) &&
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow )
- ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, TRUE );
+ ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, sal_True );
}
if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) ||
@@ -6694,7 +6706,7 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
+void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
const Window* pExcludeWindow )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6710,11 +6722,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
while ( pSysWin )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, sal_True ) )
pSysWin->EnableInput( bEnable, bChild );
}
pSysWin = pSysWin->mpWindowImpl->mpNextOverlap;
@@ -6727,11 +6739,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
if( pFrameWin->ImplIsFloatingWindow() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, sal_True ) )
pFrameWin->EnableInput( bEnable, bChild );
}
}
@@ -6746,11 +6758,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
while( p != rList.end() )
{
// Is Window in the path from this window
- if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), TRUE ) )
+ if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), sal_True ) )
{
// Is Window not in the exclude window path or not the
// exclude window, than change the status
- if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), TRUE ) )
+ if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), sal_True ) )
(*p)->EnableInput( bEnable, bChild );
}
p++;
@@ -6761,19 +6773,19 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin,
// -----------------------------------------------------------------------
-void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild )
+void Window::AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, FALSE );
+ mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, sal_False );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled;
if ( bAlways )
- EnableInput( TRUE, FALSE );
+ EnableInput( sal_True, sal_False );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled )
{
@@ -6793,19 +6805,19 @@ void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild )
+void Window::AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, FALSE );
+ mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, sal_False );
if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled )
{
mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled;
if ( bAlways )
- EnableInput( FALSE, FALSE );
+ EnableInput( sal_False, sal_False );
}
else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled )
{
@@ -6825,7 +6837,7 @@ void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild )
// -----------------------------------------------------------------------
-void Window::SetActivateMode( USHORT nMode )
+void Window::SetActivateMode( sal_uInt16 nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6840,9 +6852,9 @@ void Window::SetActivateMode( USHORT nMode )
if ( mpWindowImpl->mnActivateMode )
{
if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) &&
- !HasChildPathFocus( TRUE ) )
+ !HasChildPathFocus( sal_True ) )
{
- mpWindowImpl->mbActive = FALSE;
+ mpWindowImpl->mbActive = sal_False;
Deactivate();
}
}
@@ -6850,7 +6862,7 @@ void Window::SetActivateMode( USHORT nMode )
{
if ( !mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW) )
{
- mpWindowImpl->mbActive = TRUE;
+ mpWindowImpl->mbActive = sal_True;
Activate();
}
}
@@ -6859,7 +6871,7 @@ void Window::SetActivateMode( USHORT nMode )
// -----------------------------------------------------------------------
-void Window::ToTop( USHORT nFlags )
+void Window::ToTop( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6869,7 +6881,7 @@ void Window::ToTop( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
+void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6987,7 +6999,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
if ( mpWindowImpl->mbInitWinClipRegion || !mpWindowImpl->maWinClipRegion.IsEmpty() )
{
- BOOL bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
+ sal_Bool bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion;
ImplSetClipFlag();
// Wenn ClipRegion noch nicht initalisiert wurde, dann
@@ -7046,7 +7058,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::EnableAlwaysOnTop( BOOL bEnable )
+void Window::EnableAlwaysOnTop( sal_Bool bEnable )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7064,16 +7076,16 @@ void Window::EnableAlwaysOnTop( BOOL bEnable )
// -----------------------------------------------------------------------
void Window::SetPosSizePixel( long nX, long nY,
- long nWidth, long nHeight, USHORT nFlags )
+ long nWidth, long nHeight, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bHasValidSize = !mpWindowImpl->mbDefSize;
+ sal_Bool bHasValidSize = !mpWindowImpl->mbDefSize;
if ( nFlags & WINDOW_POSSIZE_POS )
- mpWindowImpl->mbDefPos = FALSE;
+ mpWindowImpl->mbDefPos = sal_False;
if ( nFlags & WINDOW_POSSIZE_SIZE )
- mpWindowImpl->mbDefSize = FALSE;
+ mpWindowImpl->mbDefSize = sal_False;
// Oberstes BorderWindow ist das Window, welches positioniert werden soll
Window* pWindow = this;
@@ -7093,7 +7105,7 @@ void Window::SetPosSizePixel( long nX, long nY,
nHeight = pWindow->mnOutHeight;
- USHORT nSysFlags=0;
+ sal_uInt16 nSysFlags=0;
if( nFlags & WINDOW_POSSIZE_WIDTH )
nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
if( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -7307,18 +7319,18 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR
Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) const
{
// with decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, sal_False );
}
Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) const
{
// without decoration
- return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE );
+ return ImplGetWindowExtentsRelative( pRelativeWindow, sal_True );
}
// -----------------------------------------------------------------------
-Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const
+Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const
{
SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry();
// make sure we use the extent of our border window,
@@ -7348,7 +7360,7 @@ Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bC
// -----------------------------------------------------------------------
-void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
+void Window::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7360,7 +7372,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
// -----------------------------------------------------------------------
void Window::Scroll( long nHorzScroll, long nVertScroll,
- const Rectangle& rRect, USHORT nFlags )
+ const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7372,7 +7384,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll,
// -----------------------------------------------------------------------
-void Window::Invalidate( USHORT nFlags )
+void Window::Invalidate( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7384,7 +7396,7 @@ void Window::Invalidate( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Rectangle& rRect, USHORT nFlags )
+void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7401,7 +7413,7 @@ void Window::Invalidate( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invalidate( const Region& rRegion, USHORT nFlags )
+void Window::Invalidate( const Region& rRegion, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7420,7 +7432,7 @@ void Window::Invalidate( const Region& rRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( USHORT nFlags )
+void Window::Validate( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7432,7 +7444,7 @@ void Window::Validate( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Rectangle& rRect, USHORT nFlags )
+void Window::Validate( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7449,7 +7461,7 @@ void Window::Validate( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Validate( const Region& rRegion, USHORT nFlags )
+void Window::Validate( const Region& rRegion, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7468,18 +7480,18 @@ void Window::Validate( const Region& rRegion, USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::HasPaintEvent() const
+sal_Bool Window::HasPaintEvent() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !mpWindowImpl->mbReallyVisible )
- return FALSE;
+ return sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
- return TRUE;
+ return sal_True;
if ( mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINT )
- return TRUE;
+ return sal_True;
if ( !ImplIsOverlapWindow() )
{
@@ -7488,12 +7500,12 @@ BOOL Window::HasPaintEvent() const
{
pTempWindow = pTempWindow->ImplGetParent();
if ( pTempWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINTCHILDS | IMPL_PAINT_PAINTALLCHILDS) )
- return TRUE;
+ return sal_True;
}
while ( !pTempWindow->ImplIsOverlapWindow() );
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -7511,14 +7523,14 @@ void Window::Update()
if ( !mpWindowImpl->mbReallyVisible )
return;
- BOOL bFlush = FALSE;
+ sal_Bool bFlush = sal_False;
if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame )
{
Point aPoint( 0, 0 );
Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) );
ImplInvalidateOverlapFrameRegion( aRegion );
if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) )
- bFlush = TRUE;
+ bFlush = sal_True;
}
// Zuerst muessen wir alle Fenster ueberspringen, die Paint-Transparent
@@ -7587,7 +7599,7 @@ void Window::Sync()
// -----------------------------------------------------------------------
-void Window::SetUpdateMode( BOOL bUpdate )
+void Window::SetUpdateMode( sal_Bool bUpdate )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7606,7 +7618,7 @@ void Window::GrabFocus()
// -----------------------------------------------------------------------
-BOOL Window::HasFocus() const
+sal_Bool Window::HasFocus() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7648,7 +7660,7 @@ void Window::SetFakeFocus( bool bFocus )
// -----------------------------------------------------------------------
-BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const
+sal_Bool Window::HasChildPathFocus( sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7664,7 +7676,7 @@ BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const
Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin;
if ( pFocusWin )
return ImplIsWindowOrChild( pFocusWin, bSystemWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -7685,7 +7697,7 @@ void Window::CaptureMouse()
if ( pSVData->maWinData.mpCaptureWin != this )
{
pSVData->maWinData.mpCaptureWin = this;
- mpWindowImpl->mpFrame->CaptureMouse( TRUE );
+ mpWindowImpl->mpFrame->CaptureMouse( sal_True );
}
}
@@ -7703,14 +7715,14 @@ void Window::ReleaseMouse()
if ( pSVData->maWinData.mpCaptureWin == this )
{
pSVData->maWinData.mpCaptureWin = NULL;
- mpWindowImpl->mpFrame->CaptureMouse( FALSE );
+ mpWindowImpl->mpFrame->CaptureMouse( sal_False );
ImplGenerateMouseMove();
}
}
// -----------------------------------------------------------------------
-BOOL Window::IsMouseCaptured() const
+sal_Bool Window::IsMouseCaptured() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7735,7 +7747,7 @@ void Window::SetPointer( const Pointer& rPointer )
// -----------------------------------------------------------------------
-void Window::EnableChildPointerOverwrite( BOOL bOverwrite )
+void Window::EnableChildPointerOverwrite( sal_Bool bOverwrite )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7805,7 +7817,7 @@ Point Window::GetLastPointerPosPixel()
// -----------------------------------------------------------------------
-void Window::ShowPointer( BOOL bVisible )
+void Window::ShowPointer( sal_Bool bVisible )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -7844,7 +7856,7 @@ Window::PointerState Window::GetPointerState()
// -----------------------------------------------------------------------
-BOOL Window::IsMouseOver()
+sal_Bool Window::IsMouseOver()
{
return ImplGetWinData()->mbMouseOver;
}
@@ -7922,7 +7934,7 @@ void Window::SetText( const XubString& rStr )
// name change.
if ( IsReallyVisible() )
{
- Window* pWindow = GetLabelFor();
+ Window* pWindow = GetAccessibleRelationLabelFor();
if ( pWindow && pWindow != this )
pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
}
@@ -7982,32 +7994,22 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
+ if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( bStrHelpId )
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- else
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
- mpWindowImpl->mbHelpTextDynamic = FALSE;
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
+ mpWindowImpl->mbHelpTextDynamic = sal_False;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
+ else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8015,13 +8017,10 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- if( bStrHelpId )
- aTxt.append( rtl::OUString( aStrHelpId ) );
- else
- aTxt.append( sal_Int32( nNumHelpId ) );
+ aTxt.append( rtl::OUString( aStrHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
- mpWindowImpl->mbHelpTextDynamic = FALSE;
+ mpWindowImpl->mbHelpTextDynamic = sal_False;
}
return mpWindowImpl->maHelpText;
@@ -8039,11 +8038,11 @@ Window* Window::FindWindow( const Point& rPos ) const
// -----------------------------------------------------------------------
-USHORT Window::GetChildCount() const
+sal_uInt16 Window::GetChildCount() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nChildCount = 0;
+ sal_uInt16 nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8056,11 +8055,11 @@ USHORT Window::GetChildCount() const
// -----------------------------------------------------------------------
-Window* Window::GetChild( USHORT nChild ) const
+Window* Window::GetChild( sal_uInt16 nChild ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nChildCount = 0;
+ sal_uInt16 nChildCount = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
@@ -8075,7 +8074,7 @@ Window* Window::GetChild( USHORT nChild ) const
// -----------------------------------------------------------------------
-Window* Window::GetWindow( USHORT nType ) const
+Window* Window::GetWindow( sal_uInt16 nType ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8167,7 +8166,7 @@ Window* Window::GetWindow( USHORT nType ) const
// -----------------------------------------------------------------------
-BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::IsChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
@@ -8180,22 +8179,22 @@ BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const
pWindow = pWindow->ImplGetParent();
if ( pWindow == this )
- return TRUE;
+ return sal_True;
}
while ( pWindow );
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-BOOL Window::IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const
+sal_Bool Window::IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow );
if ( this == pWindow )
- return TRUE;
+ return sal_True;
return ImplIsChild( pWindow, bSystemWindow );
}
@@ -8234,7 +8233,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( BOOL bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate )
{
if ( !mpWindowImpl->mxWindowPeer.is() && bCreate )
{
@@ -8331,7 +8330,7 @@ void Window::ImplStartDnd()
// -----------------------------------------------------------------------
-Reference< XDropTarget > Window::GetDropTarget()
+uno::Reference< XDropTarget > Window::GetDropTarget()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8344,7 +8343,7 @@ Reference< XDropTarget > Window::GetDropTarget()
if( ! mpWindowImpl->mpFrameData->mxDropTarget.is() )
{
// initialization is done in GetDragSource
- Reference< XDragSource > xDragSource = GetDragSource();
+ uno::Reference< XDragSource > xDragSource = GetDragSource();
}
if( mpWindowImpl->mpFrameData->mxDropTarget.is() )
@@ -8360,16 +8359,16 @@ Reference< XDropTarget > Window::GetDropTarget()
mpWindowImpl->mpFrameData->mxDropTarget->addDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
// register also as drag gesture listener if directly supported by drag source
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->addDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
else
- mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = TRUE;
+ mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True;
}
@@ -8388,12 +8387,12 @@ Reference< XDropTarget > Window::GetDropTarget()
}
// this object is located in the same process, so there will be no runtime exception
- return Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
+ return uno::Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XDragSource > Window::GetDragSource()
+uno::Reference< XDragSource > Window::GetDragSource()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8403,7 +8402,7 @@ Reference< XDragSource > Window::GetDragSource()
{
try
{
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
if ( xFactory.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
@@ -8437,10 +8436,10 @@ Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
- mpWindowImpl->mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
if( aDropTargetSN.getLength() )
- mpWindowImpl->mpFrameData->mxDropTarget = Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
}
@@ -8457,12 +8456,12 @@ Reference< XDragSource > Window::GetDragSource()
return mpWindowImpl->mpFrameData->mxDragSource;
}
- return Reference< XDragSource > ();
+ return uno::Reference< XDragSource > ();
}
// -----------------------------------------------------------------------
-void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Reference< XDropTarget > &xDropTarget )
+void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource, uno::Reference< XDropTarget > &xDropTarget )
// only for RVP transmission
{
if( mpWindowImpl->mpFrameData )
@@ -8480,14 +8479,14 @@ void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Refe
// -----------------------------------------------------------------------
-Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
+uno::Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
{
- return Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
+ return uno::Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetClipboard()
+uno::Reference< XClipboard > Window::GetClipboard()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8497,19 +8496,19 @@ Reference< XClipboard > Window::GetClipboard()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
if( mpWindowImpl->mpFrameData->mxClipboard.is() )
{
- Reference< XInitialization > xInit = Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+ uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
if( xInit.is() )
{
@@ -8541,7 +8540,7 @@ Reference< XClipboard > Window::GetClipboard()
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetPrimarySelection()
+uno::Reference< XClipboard > Window::GetPrimarySelection()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8551,7 +8550,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
@@ -8561,16 +8560,16 @@ Reference< XClipboard > Window::GetPrimarySelection()
aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("PRIMARY")) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")), aArgumentList ), UNO_QUERY );
# else
- static Reference< XClipboard > s_xSelection;
+ static uno::Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
@@ -8595,7 +8594,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
// Accessibility
// -----------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( BOOL bCreate )
+::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( sal_Bool bCreate )
{
// do not optimize hierarchy for the top level border win (ie, when there is no parent)
/* // do not optimize accessible hierarchy at all to better reflect real VCL hierarchy
@@ -8615,7 +8614,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::CreateAccessible()
{
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( TRUE ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( sal_True ), ::com::sun::star::uno::UNO_QUERY );
return xAcc;
}
@@ -8625,46 +8624,46 @@ void Window::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::
}
// skip all border windows that are no top level frames
-BOOL Window::ImplIsAccessibleCandidate() const
+sal_Bool Window::ImplIsAccessibleCandidate() const
{
if( !mpWindowImpl->mbBorderWin )
- return TRUE;
+ return sal_True;
else
// #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable
if( mpWindowImpl->mbFrame && mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
-BOOL Window::ImplIsAccessibleNativeFrame() const
+sal_Bool Window::ImplIsAccessibleNativeFrame() const
{
if( mpWindowImpl->mbFrame )
// #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable
if( (mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE)) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
else
- return FALSE;
+ return sal_False;
}
-USHORT Window::ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const
+sal_uInt16 Window::ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const
{
- USHORT nChildren = 0;
+ sal_uInt16 nChildren = 0;
Window* pChild = GetWindow( nFirstWindowType );
while ( pChild )
{
if( pChild->ImplIsAccessibleCandidate() )
nChildren++;
else
- nChildren = sal::static_int_cast<USHORT>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
+ nChildren = sal::static_int_cast<sal_uInt16>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ));
pChild = pChild->mpWindowImpl->mpNext;
}
return nChildren;
}
-Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel ) const
+Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8677,7 +8676,7 @@ Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCo
Window *pTmpChild = pChild;
if( !pChild->ImplIsAccessibleCandidate() )
- pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, FALSE );
+ pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, sal_False );
if ( nChild == rChildCount )
return pTmpChild;
@@ -8730,9 +8729,9 @@ Window* Window::GetAccessibleParentWindow() const
}
/*
-USHORT Window::GetAccessibleChildWindowCount()
+sal_uInt16 Window::GetAccessibleChildWindowCount()
{
- USHORT nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
+ sal_uInt16 nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD );
// Search also for SystemWindows.
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
@@ -8742,9 +8741,9 @@ USHORT Window::GetAccessibleChildWindowCount()
}
*/
-USHORT Window::GetAccessibleChildWindowCount()
+sal_uInt16 Window::GetAccessibleChildWindowCount()
{
- USHORT nChildren = 0;
+ sal_uInt16 nChildren = 0;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8790,21 +8789,21 @@ USHORT Window::GetAccessibleChildWindowCount()
}
/*
-Window* Window::GetAccessibleChildWindow( USHORT n )
+Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
{
- USHORT nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
- Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, TRUE );
+ sal_uInt16 nChildCount; // will be set in ImplGetAccessibleCandidateChild(...)
+ Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, sal_True );
if ( !pChild && ( n >= nChildCount ) )
{
Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, FALSE );
+ pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, sal_False );
}
return pChild;
}
*/
-Window* Window::GetAccessibleChildWindow( USHORT n )
+Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
{
// report the menubarwindow as a the first child of THE workwindow
if( GetType() == WINDOW_WORKWINDOW && ((WorkWindow *) this)->GetMenuBar() )
@@ -8820,7 +8819,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
// transform n to child number including invisible children
- USHORT nChildren = n;
+ sal_uInt16 nChildren = n;
Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
@@ -8868,7 +8867,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
-void Window::SetAccessibleRole( USHORT nRole )
+void Window::SetAccessibleRole( sal_uInt16 nRole )
{
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
@@ -8877,11 +8876,11 @@ void Window::SetAccessibleRole( USHORT nRole )
mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
}
-USHORT Window::GetAccessibleRole() const
+sal_uInt16 Window::GetAccessibleRole() const
{
using namespace ::com::sun::star;
- USHORT nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
+ sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
if ( nRole == 0xFFFF )
{
switch ( GetType() )
@@ -8983,6 +8982,7 @@ USHORT Window::GetAccessibleRole() const
case WINDOW_HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break;
+ case WINDOW_RULER: nRole = accessibility::AccessibleRole::RULER; break;
case WINDOW_WINDOW:
case WINDOW_CONTROL:
case WINDOW_BORDERWINDOW:
@@ -9009,7 +9009,7 @@ void Window::SetAccessibleName( const String& rName )
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName, "AccessibleName already set!" );
+ DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" );
delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName );
}
@@ -9050,9 +9050,9 @@ String Window::GetAccessibleName() const
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
-
+ case WINDOW_METRICBOX:
{
- Window *pLabel = GetLabeledBy();
+ Window *pLabel = GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != this )
aAccessibleName = pLabel->GetText();
}
@@ -9111,7 +9111,28 @@ String Window::GetAccessibleDescription() const
return aAccessibleDescription;
}
-BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
+void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
+}
+
+void Window::SetAccessibleRelationLabelFor( Window* pLabelFor )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
+}
+
+void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pMemberOfWindow = pMemberOfWin;
+}
+
+sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath )
{
if( !bTraverseParentPath )
return mpWindowImpl->mbSuppressAccessibilityEvents;
@@ -9121,14 +9142,19 @@ BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
while ( pParent && pParent->mpWindowImpl)
{
if( pParent->mpWindowImpl->mbSuppressAccessibilityEvents )
- return TRUE;
+ return sal_True;
else
pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames
}
- return FALSE;
+ return sal_False;
}
}
+void Window::SetAccessibilityEventsSuppressed(sal_Bool bSuppressed)
+{
+ mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed;
+}
+
void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
{
if( ! mpOutDevData )
@@ -9145,9 +9171,9 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle&
// returns background color used in this control
// false: could not determine color
-BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
+sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol )
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch ( GetType() )
{
@@ -9165,7 +9191,7 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
if( !aWall.IsGradient() && !aWall.IsBitmap() )
rCol = aWall.GetColor();
else
- bRet = FALSE;
+ bRet = sal_False;
}
else
rCol = GetSettings().GetStyleSettings().GetFaceColor();
@@ -9174,21 +9200,21 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
return bRet;
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly )
+void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL );
}
-void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor )
+void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor )
{
DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL );
}
void Window::DrawSelectionBackground( const Rectangle& rRect,
- USHORT highlight,
- BOOL bChecked,
- BOOL bDrawBorder,
- BOOL bDrawExtBorderOnly,
+ sal_uInt16 highlight,
+ sal_Bool bChecked,
+ sal_Bool bDrawBorder,
+ sal_Bool bDrawExtBorderOnly,
long nCornerRadius,
Color* pSelectionTextColor,
Color* pPaintColor
@@ -9206,8 +9232,8 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
- BOOL bDark = rStyles.GetFaceColor().IsDark();
- BOOL bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
+ sal_Bool bDark = rStyles.GetFaceColor().IsDark();
+ sal_Bool bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) );
int c1 = aSelectionBorderCol.GetLuminance();
int c2 = GetDisplayBackground().GetColor().GetLuminance();
@@ -9215,7 +9241,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) )
{
// constrast too low
- USHORT h,s,b;
+ sal_uInt16 h,s,b;
aSelectionFillCol.RGBtoHSB( h, s, b );
if( b > 50 ) b -= 40;
else b += 40;
@@ -9247,13 +9273,13 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
else
SetLineColor();
- USHORT nPercent = 0;
+ sal_uInt16 nPercent = 0;
if( !highlight )
{
if( bDark )
aSelectionFillCol = COL_BLACK;
else
- nPercent = bRoundEdges ? 90 : 80; // just checked (light)
+ nPercent = 80; // just checked (light)
}
else
{
@@ -9268,7 +9294,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 40 : 20; // selected, pressed or checked ( very dark )
}
else if( bChecked || highlight == 1 )
{
@@ -9281,7 +9307,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 60 : 35; // selected, pressed or checked ( very dark )
}
else
{
@@ -9297,7 +9323,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
nPercent = 0;
}
else
- nPercent = bRoundEdges ? 80 : 70; // selected ( dark )
+ nPercent = 70; // selected ( dark )
}
}
@@ -9367,7 +9393,7 @@ Window* Window::GetPreferredKeyInputWindow()
}
-BOOL Window::IsScrollable() const
+sal_Bool Window::IsScrollable() const
{
// check for scrollbars
Window *pChild = mpWindowImpl->mpFirstChild;
@@ -9381,24 +9407,24 @@ BOOL Window::IsScrollable() const
return false;
}
-BOOL Window::IsTopWindow() const
+sal_Bool Window::IsTopWindow() const
{
if ( mpWindowImpl->mbInDtor )
- return FALSE;
+ return sal_False;
// topwindows must be frames or they must have a borderwindow which is a frame
if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || (mpWindowImpl->mpBorderWindow && !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) )
- return FALSE;
+ return sal_False;
ImplGetWinData();
- if( mpWindowImpl->mpWinData->mnIsTopWindow == (USHORT)~0) // still uninitialized
+ if( mpWindowImpl->mpWinData->mnIsTopWindow == (sal_uInt16)~0) // still uninitialized
{
// #113722#, cache result of expensive queryInterface call
Window *pThisWin = (Window*)this;
- Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
+ uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
}
- return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? TRUE : FALSE;
+ return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? sal_True : sal_False;
}
void Window::ImplMirrorFramePos( Point &pt ) const
@@ -9407,7 +9433,7 @@ void Window::ImplMirrorFramePos( Point &pt ) const
}
// frame based modal counter (dialogs are not modal to the whole application anymore)
-BOOL Window::IsInModalMode() const
+sal_Bool Window::IsInModalMode() const
{
return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
}
@@ -9439,16 +9465,16 @@ void Window::ImplDecModalCount()
pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow : NULL;
}
}
-BOOL Window::ImplIsInTaskPaneList()
+sal_Bool Window::ImplIsInTaskPaneList()
{
return mpWindowImpl->mbIsInTaskPaneList;
}
-void Window::ImplIsInTaskPaneList( BOOL mbIsInTaskList )
+void Window::ImplIsInTaskPaneList( sal_Bool mbIsInTaskList )
{
mpWindowImpl->mbIsInTaskPaneList = mbIsInTaskList;
}
-void Window::ImplNotifyIconifiedState( BOOL bIconified )
+void Window::ImplNotifyIconifiedState( sal_Bool bIconified )
{
mpWindowImpl->mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
// #109206# notify client window as well to have toolkit topwindow listeners notified
@@ -9456,15 +9482,15 @@ void Window::ImplNotifyIconifiedState( BOOL bIconified )
mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE );
}
-BOOL Window::HasActiveChildFrame()
+sal_Bool Window::HasActiveChildFrame()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
Window *pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame;
while( pFrameWin )
{
if( pFrameWin != mpWindowImpl->mpFrameWindow )
{
- BOOL bDecorated = FALSE;
+ sal_Bool bDecorated = sal_False;
Window *pChildFrame = pFrameWin->ImplGetWindow();
// #i15285# unfortunately WB_MOVEABLE is the same as WB_TABSTOP which can
// be removed for ToolBoxes to influence the keyboard accessibility
@@ -9476,9 +9502,9 @@ BOOL Window::HasActiveChildFrame()
if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
{
- if( ImplIsChild( pChildFrame, TRUE ) )
+ if( ImplIsChild( pChildFrame, sal_True ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -9493,11 +9519,11 @@ LanguageType Window::GetInputLanguage() const
return mpWindowImpl->mpFrame->GetInputLanguage();
}
-void Window::EnableNativeWidget( BOOL bEnable )
+void Window::EnableNativeWidget( sal_Bool bEnable )
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
if( pNoNWF && *pNoNWF )
- bEnable = FALSE;
+ bEnable = sal_False;
if( bEnable != ImplGetWinData()->mbEnableNativeWidget )
{
@@ -9522,7 +9548,7 @@ void Window::EnableNativeWidget( BOOL bEnable )
}
}
-BOOL Window::IsNativeWidgetEnabled() const
+sal_Bool Window::IsNativeWidgetEnabled() const
{
return ImplGetWinData()->mbEnableNativeWidget;
}
@@ -9531,12 +9557,12 @@ BOOL Window::IsNativeWidgetEnabled() const
#include <salframe.h>
#endif
-Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
+uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
bool bFullscreen,
bool bSpriteCanvas ) const
{
// try to retrieve hard reference from weak member
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
// canvas still valid? Then we're done.
if( xCanvas.is() )
@@ -9575,21 +9601,24 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) );
aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? sal_True : sal_False );
- aArg[ 4 ] = makeAny( Reference< awt::XWindow >(
+ aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >(
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
// Create canvas instance with window handle
// =========================================
if ( xFactory.is() )
{
- static Reference<lang::XMultiServiceFactory> xCanvasFactory(
- xFactory->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star."
- "rendering.CanvasFactory") ) ), UNO_QUERY );
+ static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
+ uno::Reference<lang::XMultiServiceFactory>(
+ xFactory->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.rendering.CanvasFactory") ) ),
+ UNO_QUERY ));
+ uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+
if(xCanvasFactory.is())
{
#ifdef WNT
@@ -9635,37 +9664,37 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
return xCanvas;
}
-Reference< rendering::XCanvas > Window::GetCanvas() const
+uno::Reference< rendering::XCanvas > Window::GetCanvas() const
{
return ImplGetCanvas( Size(), false, false );
}
-Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
+uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
-Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
+uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( rFullscreenSize, true, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rPos )
{
- BOOL bRVisible = mpWindowImpl->mbReallyVisible;
+ sal_Bool bRVisible = mpWindowImpl->mbReallyVisible;
mpWindowImpl->mbReallyVisible = mpWindowImpl->mbVisible;
- BOOL bDevOutput = mbDevOutput;
- mbDevOutput = TRUE;
+ sal_Bool bDevOutput = mbDevOutput;
+ mbDevOutput = sal_True;
long nOldDPIX = ImplGetDPIX();
long nOldDPIY = ImplGetDPIY();
mnDPIX = i_pTargetOutDev->ImplGetDPIX();
mnDPIY = i_pTargetOutDev->ImplGetDPIY();
- BOOL bOutput = IsOutputEnabled();
+ sal_Bool bOutput = IsOutputEnabled();
EnableOutput();
DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" );
@@ -9795,8 +9824,8 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
Hide();
}
- BOOL bVisible = mpWindowImpl->mbVisible;
- mpWindowImpl->mbVisible = TRUE;
+ sal_Bool bVisible = mpWindowImpl->mbVisible;
+ mpWindowImpl->mbVisible = sal_True;
if( mpWindowImpl->mpBorderWindow )
mpWindowImpl->mpBorderWindow->ImplPaintToDevice( pDev, rPos );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e183e54fad83..e98d51d252c9 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -71,7 +71,7 @@ struct ImplFocusDelData : public ImplDelData
// =======================================================================
-BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
+sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_CHKOBJ( pTestWindow, Window, ImplDbgCheckWindow );
@@ -81,11 +81,11 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
const Window* pTempWindow = pTestWindow;
const Window* pThisWindow = ImplGetFirstOverlapWindow();
if ( pTempWindow == pThisWindow )
- return FALSE;
+ return sal_False;
do
{
if ( pTempWindow == pThisWindow )
- return TRUE;
+ return sal_True;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -95,7 +95,7 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pTestWindow )
- return FALSE;
+ return sal_False;
if ( pTempWindow->mpWindowImpl->mbFrame )
break;
pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow;
@@ -105,8 +105,8 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
// Fenster auf gleiche Ebene bringen
if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow )
{
- USHORT nThisLevel = 0;
- USHORT nTestLevel = 0;
+ sal_uInt16 nThisLevel = 0;
+ sal_uInt16 nTestLevel = 0;
pTempWindow = pThisWindow;
do
{
@@ -153,12 +153,12 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const
do
{
if ( pTempWindow == pThisWindow )
- return TRUE;
+ return sal_True;
pTempWindow = pTempWindow->mpWindowImpl->mpNext;
}
while ( pTempWindow );
- return FALSE;
+ return sal_False;
}
// =======================================================================
@@ -169,7 +169,7 @@ void Window::ImplSaveOverlapBackground()
if ( !mpWindowImpl->mbFrame )
{
- ULONG nSaveBackSize = mnOutWidth*mnOutHeight;
+ sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight;
if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE )
{
if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE )
@@ -204,7 +204,7 @@ void Window::ImplSaveOverlapBackground()
// -----------------------------------------------------------------------
-BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion )
+sal_Bool Window::ImplRestoreOverlapBackground( Region& rInvRegion )
{
if ( mpWindowImpl->mpOverlapData->mpSaveBackDev )
{
@@ -234,10 +234,10 @@ BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion )
ImplDeleteOverlapBackground();
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -306,7 +306,7 @@ void Window::ImplInvalidateAllOverlapBackgrounds()
// =======================================================================
-Bitmap Window::SnapShot( BOOL bBorder ) const
+Bitmap Window::SnapShot( sal_Bool bBorder ) const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -348,7 +348,7 @@ void Window::ShowFocus( const Rectangle& rRect )
if( mpWindowImpl->mbInShowFocus )
return;
- mpWindowImpl->mbInShowFocus = TRUE;
+ mpWindowImpl->mbInShowFocus = sal_True;
ImplWinData* pWinData = ImplGetWinData();
@@ -362,7 +362,7 @@ void Window::ShowFocus( const Rectangle& rRect )
{
if ( *(pWinData->mpFocusRect) == rRect )
{
- mpWindowImpl->mbInShowFocus = FALSE;
+ mpWindowImpl->mbInShowFocus = sal_False;
return;
}
@@ -375,18 +375,18 @@ void Window::ShowFocus( const Rectangle& rRect )
pWinData->mpFocusRect = new Rectangle( rRect );
else
*(pWinData->mpFocusRect) = rRect;
- mpWindowImpl->mbFocusVisible = TRUE;
+ mpWindowImpl->mbFocusVisible = sal_True;
}
else
{
if( ! mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = TRUE;
+ mpWindowImpl->mbNativeFocusVisible = sal_True;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInShowFocus = FALSE;
+ mpWindowImpl->mbInShowFocus = sal_False;
}
// -----------------------------------------------------------------------
@@ -397,7 +397,7 @@ void Window::HideFocus()
if( mpWindowImpl->mbInHideFocus )
return;
- mpWindowImpl->mbInHideFocus = TRUE;
+ mpWindowImpl->mbInHideFocus = sal_True;
// native themeing can suggest not to use focus rects
if( ! ( mpWindowImpl->mbUseNativeFocus &&
@@ -405,29 +405,29 @@ void Window::HideFocus()
{
if ( !mpWindowImpl->mbFocusVisible )
{
- mpWindowImpl->mbInHideFocus = FALSE;
+ mpWindowImpl->mbInHideFocus = sal_False;
return;
}
if ( !mpWindowImpl->mbInPaint )
ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) );
- mpWindowImpl->mbFocusVisible = FALSE;
+ mpWindowImpl->mbFocusVisible = sal_False;
}
else
{
if( mpWindowImpl->mbNativeFocusVisible )
{
- mpWindowImpl->mbNativeFocusVisible = FALSE;
+ mpWindowImpl->mbNativeFocusVisible = sal_False;
if ( !mpWindowImpl->mbInPaint )
Invalidate();
}
}
- mpWindowImpl->mbInHideFocus = FALSE;
+ mpWindowImpl->mbInHideFocus = sal_False;
}
// -----------------------------------------------------------------------
-void Window::Invert( const Rectangle& rRect, USHORT nFlags )
+void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -463,14 +463,14 @@ void Window::Invert( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::Invert( const Polygon& rPoly, USHORT nFlags )
+void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
if ( !IsDeviceOutputNecessary() )
return;
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -501,7 +501,7 @@ void Window::Invert( const Polygon& rPoly, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags )
+void Window::ShowTracking( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -526,7 +526,7 @@ void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags )
else
*(pWinData->mpTrackRect) = rRect;
pWinData->mnTrackFlags = nFlags;
- mpWindowImpl->mbTrackVisible = TRUE;
+ mpWindowImpl->mbTrackVisible = sal_True;
}
// -----------------------------------------------------------------------
@@ -540,13 +540,13 @@ void Window::HideTracking()
ImplWinData* pWinData = ImplGetWinData();
if ( !mpWindowImpl->mbInPaint || !(pWinData->mnTrackFlags & SHOWTRACK_WINDOW) )
InvertTracking( *(pWinData->mpTrackRect), pWinData->mnTrackFlags );
- mpWindowImpl->mbTrackVisible = FALSE;
+ mpWindowImpl->mbTrackVisible = sal_False;
}
}
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
+void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -587,12 +587,12 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, FALSE, FALSE );
+ ImplClipBoundaries( aRegion, sal_False, sal_False );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
- USHORT nStyle = nFlags & SHOWTRACK_STYLE;
+ sal_uInt16 nStyle = nFlags & SHOWTRACK_STYLE;
if ( nStyle == SHOWTRACK_OBJECT )
pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_INVERT_TRACKFRAME, this );
else if ( nStyle == SHOWTRACK_SPLIT )
@@ -611,11 +611,11 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
+void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nPoints = rPoly.GetSize();
if ( nPoints < 2 )
return;
@@ -653,7 +653,7 @@ void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
Point aPoint( mnOutOffX, mnOutOffY );
Region aRegion( Rectangle( aPoint,
Size( mnOutWidth, mnOutHeight ) ) );
- ImplClipBoundaries( aRegion, FALSE, FALSE );
+ ImplClipBoundaries( aRegion, sal_False, sal_False );
ImplSelectClipRegion( aRegion, pGraphics );
}
}
@@ -690,7 +690,7 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer )
// -----------------------------------------------------------------------
-void Window::StartTracking( USHORT nFlags )
+void Window::StartTracking( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -721,7 +721,7 @@ void Window::StartTracking( USHORT nFlags )
// -----------------------------------------------------------------------
-void Window::EndTracking( USHORT nFlags )
+void Window::EndTracking( sal_uInt16 nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -764,7 +764,7 @@ void Window::EndTracking( USHORT nFlags )
// -----------------------------------------------------------------------
-BOOL Window::IsTracking() const
+sal_Bool Window::IsTracking() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -773,7 +773,7 @@ BOOL Window::IsTracking() const
// -----------------------------------------------------------------------
-void Window::StartAutoScroll( USHORT nFlags )
+void Window::StartAutoScroll( sal_uInt16 nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -810,7 +810,7 @@ void Window::EndAutoScroll()
// -----------------------------------------------------------------------
-BOOL Window::IsAutoScroll() const
+sal_Bool Window::IsAutoScroll() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -836,13 +836,13 @@ void Window::SaveBackground( const Point& rPos, const Size& rSize,
{
const Region aOldClip( rSaveDevice.GetClipRegion() );
const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) );
- const BOOL bMap = rSaveDevice.IsMapModeEnabled();
+ const sal_Bool bMap = rSaveDevice.IsMapModeEnabled();
// move clip region to have the same distance to DestOffset
aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() );
// set pixel clip region
- rSaveDevice.EnableMapMode( FALSE );
+ rSaveDevice.EnableMapMode( sal_False );
rSaveDevice.SetClipRegion( aClip );
rSaveDevice.EnableMapMode( bMap );
rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this );
@@ -871,13 +871,13 @@ sal_uIntPtr Window::SaveFocus()
// -----------------------------------------------------------------------
-BOOL Window::EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore )
+sal_Bool Window::EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore )
{
if ( !nSaveId )
- return FALSE;
+ return sal_False;
else
{
- BOOL bOK = TRUE;
+ sal_Bool bOK = sal_True;
ImplFocusDelData* pDelData = (ImplFocusDelData*)(void*)nSaveId;
if ( !pDelData->IsDelete() )
{
@@ -940,7 +940,7 @@ void Window::SetZoomedPointFont( const Font& rFont )
long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() );
if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) )
{
- USHORT nType;
+ sal_uInt16 nType;
if ( aMetric.GetPitch() == PITCH_FIXED )
nType = DEFAULTFONT_FIXED;
else
@@ -1033,7 +1033,7 @@ void Window::SetControlForeground()
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = FALSE;
+ mpWindowImpl->mbControlForeground = sal_False;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1049,7 +1049,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->mbControlForeground )
{
mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlForeground = FALSE;
+ mpWindowImpl->mbControlForeground = sal_False;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1058,7 +1058,7 @@ void Window::SetControlForeground( const Color& rColor )
if ( mpWindowImpl->maControlForeground != rColor )
{
mpWindowImpl->maControlForeground = rColor;
- mpWindowImpl->mbControlForeground = TRUE;
+ mpWindowImpl->mbControlForeground = sal_True;
StateChanged( STATE_CHANGE_CONTROLFOREGROUND );
}
}
@@ -1073,7 +1073,7 @@ void Window::SetControlBackground()
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = FALSE;
+ mpWindowImpl->mbControlBackground = sal_False;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1089,7 +1089,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->mbControlBackground )
{
mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT );
- mpWindowImpl->mbControlBackground = FALSE;
+ mpWindowImpl->mbControlBackground = sal_False;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1098,7 +1098,7 @@ void Window::SetControlBackground( const Color& rColor )
if ( mpWindowImpl->maControlBackground != rColor )
{
mpWindowImpl->maControlBackground = rColor;
- mpWindowImpl->mbControlBackground = TRUE;
+ mpWindowImpl->mbControlBackground = sal_True;
StateChanged( STATE_CHANGE_CONTROLBACKGROUND );
}
}
@@ -1162,12 +1162,12 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const
// -----------------------------------------------------------------------
-BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
+sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd,
ScrollBar* pHScrl, ScrollBar* pVScrl )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( pHScrl || pVScrl )
{
@@ -1175,7 +1175,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
{
case COMMAND_STARTAUTOSCROLL:
{
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( pHScrl )
{
if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) &&
@@ -1192,7 +1192,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( nFlags )
{
StartAutoScroll( nFlags );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -1203,7 +1203,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
if ( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) )
{
- ULONG nScrollLines = pData->GetScrollLines();
+ sal_uLong nScrollLines = pData->GetScrollLines();
long nLines;
if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
{
@@ -1220,7 +1220,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
0L,
pData->IsHorz() ? pHScrl : pVScrl,
nLines );
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
@@ -1233,7 +1233,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd,
{
ImplHandleScroll( pHScrl, pData->GetDeltaX(),
pVScrl, pData->GetDeltaY() );
- bRet = TRUE;
+ bRet = sal_True;
}
}
break;
@@ -1303,7 +1303,7 @@ DockingManager* Window::GetDockingManager()
return ImplGetDockingManager();
}
-void Window::EnableDocking( BOOL bEnable )
+void Window::EnableDocking( sal_Bool bEnable )
{
// update list of dockable windows
if( bEnable )
@@ -1327,115 +1327,31 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId
-void Window::SetHelpId( ULONG nHelpId )
+void Window::SetHelpId( const rtl::OString& rHelpId )
{
- SetSmartHelpId(SmartId(nHelpId));
+ mpWindowImpl->maHelpId = rHelpId;
}
-ULONG Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
- return mpWindowImpl->mnHelpId;
+ return mpWindowImpl->maHelpId;
}
-void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
+void Window::SetUniqueId( const rtl::OString& rUniqueId )
{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- {
- mpWindowImpl->mnHelpId = aId.GetNum();
- }
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- {
- if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartHelpId;
- }
- else
- {
- if ( mpWindowImpl->mnHelpId )
- return SmartId( mpWindowImpl->mnHelpId );
- else
- return SmartId();
- }
-}
-
-
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId
-void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; }
-ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; }
-
-
-void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode )
-{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- mpWindowImpl->mnUniqId = aId.GetNum();
+ mpWindowImpl->maUniqId = rUniqueId;
}
-SmartId Window::GetSmartUniqueId() const
+const rtl::OString& Window::GetUniqueId() const
{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- {
- if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartUniqueId;
- }
- else
- {
- if ( mpWindowImpl->mnUniqId )
- return SmartId( mpWindowImpl->mnUniqId );
- else
- return SmartId();
- }
+ return mpWindowImpl->maUniqId;
}
-SmartId Window::GetSmartUniqueOrHelpId() const
+const rtl::OString& Window::GetUniqueOrHelpId() const
{
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId )
- {
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId )
- {
- SmartId aTemp = GetSmartHelpId();
- aTemp.UpdateId( GetSmartUniqueId() );
- return aTemp;
- }
- else
- return GetSmartHelpId();
- }
- else
- return GetSmartUniqueId();
+ return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
}
-
-
-
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
@@ -1492,47 +1408,47 @@ Window* Window::ImplGetFrameWindow() const
return mpWindowImpl->mpFrameWindow;
}
-BOOL Window::ImplIsDockingWindow() const
+sal_Bool Window::ImplIsDockingWindow() const
{
return mpWindowImpl->mbDockWin;
}
-BOOL Window::ImplIsFloatingWindow() const
+sal_Bool Window::ImplIsFloatingWindow() const
{
return mpWindowImpl->mbFloatWin;
}
-BOOL Window::ImplIsToolbox() const
+sal_Bool Window::ImplIsToolbox() const
{
return mpWindowImpl->mbToolBox;
}
-BOOL Window::ImplIsSplitter() const
+sal_Bool Window::ImplIsSplitter() const
{
return mpWindowImpl->mbSplitter;
}
-BOOL Window::ImplIsPushButton() const
+sal_Bool Window::ImplIsPushButton() const
{
return mpWindowImpl->mbPushButton;
}
-BOOL Window::ImplIsOverlapWindow() const
+sal_Bool Window::ImplIsOverlapWindow() const
{
return mpWindowImpl->mbOverlapWin;
}
-void Window::ImplSetActive( BOOL bActive )
+void Window::ImplSetActive( sal_Bool bActive )
{
mpWindowImpl->mbActive = bActive;
}
-BOOL Window::ImplIsMouseTransparent() const
+sal_Bool Window::ImplIsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-void Window::ImplSetMouseTransparent( BOOL bTransparent )
+void Window::ImplSetMouseTransparent( sal_Bool bTransparent )
{
mpWindowImpl->mbMouseTransparent = bTransparent;
}
@@ -1563,7 +1479,7 @@ void Window::ImplFrameToOutput( Rectangle& rRect )
rRect.Bottom()-=mnOutOffY;
}
-void Window::SetCompoundControl( BOOL bCompound )
+void Window::SetCompoundControl( sal_Bool bCompound )
{
mpWindowImpl->mbCompoundControl = bCompound;
}
@@ -1607,77 +1523,77 @@ WindowType Window::GetType() const
{
return mpWindowImpl->mnType;
}
-BOOL Window::IsSystemWindow() const
+sal_Bool Window::IsSystemWindow() const
{
return mpWindowImpl->mbSysWin;
}
-BOOL Window::IsDialog() const
+sal_Bool Window::IsDialog() const
{
return mpWindowImpl->mbDialog;
}
-BOOL Window::IsMenuFloatingWindow() const
+sal_Bool Window::IsMenuFloatingWindow() const
{
return mpWindowImpl->mbMenuFloatingWindow;
}
-BOOL Window::IsToolbarFloatingWindow() const
+sal_Bool Window::IsToolbarFloatingWindow() const
{
return mpWindowImpl->mbToolbarFloatingWindow;
}
-void Window::EnableAllResize( BOOL bEnable )
+void Window::EnableAllResize( sal_Bool bEnable )
{
mpWindowImpl->mbAllResize = bEnable;
}
-BOOL Window::IsAllResizeEnabled() const
+sal_Bool Window::IsAllResizeEnabled() const
{
return mpWindowImpl->mbAllResize;
}
-BOOL Window::IsClipSiblingsEnabled() const
+sal_Bool Window::IsClipSiblingsEnabled() const
{
return mpWindowImpl->mbClipSiblings;
}
-void Window::EnableChildTransparentMode( BOOL bEnable )
+void Window::EnableChildTransparentMode( sal_Bool bEnable )
{
mpWindowImpl->mbChildTransparent = bEnable;
}
-BOOL Window::IsChildTransparentModeEnabled() const
+sal_Bool Window::IsChildTransparentModeEnabled() const
{
return mpWindowImpl->mbChildTransparent;
}
-BOOL Window::IsMouseTransparent() const
+sal_Bool Window::IsMouseTransparent() const
{
return mpWindowImpl->mbMouseTransparent;
}
-BOOL Window::IsPaintTransparent() const
+sal_Bool Window::IsPaintTransparent() const
{
return mpWindowImpl->mbPaintTransparent;
}
-void Window::SetDialogControlStart( BOOL bStart )
+void Window::SetDialogControlStart( sal_Bool bStart )
{
mpWindowImpl->mbDlgCtrlStart = bStart;
}
-BOOL Window::IsDialogControlStart() const
+sal_Bool Window::IsDialogControlStart() const
{
return mpWindowImpl->mbDlgCtrlStart;
}
-void Window::SetDialogControlFlags( USHORT nFlags )
+void Window::SetDialogControlFlags( sal_uInt16 nFlags )
{
mpWindowImpl->mnDlgCtrlFlags = nFlags;
}
-USHORT Window::GetDialogControlFlags() const
+sal_uInt16 Window::GetDialogControlFlags() const
{
return mpWindowImpl->mnDlgCtrlFlags;
}
@@ -1687,22 +1603,22 @@ const InputContext& Window::GetInputContext() const
return mpWindowImpl->maInputContext;
}
-BOOL Window::IsExtTextInput() const
+sal_Bool Window::IsExtTextInput() const
{
return mpWindowImpl->mbExtTextInput;
}
-void Window::EnableChildNotify( BOOL bEnable )
+void Window::EnableChildNotify( sal_Bool bEnable )
{
mpWindowImpl->mbChildNotify = bEnable;
}
-BOOL Window::IsChildNotify() const
+sal_Bool Window::IsChildNotify() const
{
return mpWindowImpl->mbChildNotify;
}
-BOOL Window::IsControlFont() const
+sal_Bool Window::IsControlFont() const
{
return (mpWindowImpl->mpControlFont != 0);
}
@@ -1712,7 +1628,7 @@ Color Window::GetControlForeground() const
return mpWindowImpl->maControlForeground;
}
-BOOL Window::IsControlForeground() const
+sal_Bool Window::IsControlForeground() const
{
return mpWindowImpl->mbControlForeground;
}
@@ -1722,12 +1638,12 @@ Color Window::GetControlBackground() const
return mpWindowImpl->maControlBackground;
}
-BOOL Window::IsControlBackground() const
+sal_Bool Window::IsControlBackground() const
{
return mpWindowImpl->mbControlBackground;
}
-BOOL Window::IsInPaint() const
+sal_Bool Window::IsInPaint() const
{
return mpWindowImpl->mbInPaint;
}
@@ -1737,128 +1653,128 @@ Window* Window::GetParent() const
return mpWindowImpl->mpRealParent;
}
-BOOL Window::IsVisible() const
+sal_Bool Window::IsVisible() const
{
return mpWindowImpl->mbVisible;
}
-BOOL Window::IsReallyVisible() const
+sal_Bool Window::IsReallyVisible() const
{
return mpWindowImpl->mbReallyVisible;
}
-BOOL Window::IsParentPathVisible() const
+sal_Bool Window::IsParentPathVisible() const
{
return mpWindowImpl->mbReallyVisible;
}
-BOOL Window::IsReallyShown() const
+sal_Bool Window::IsReallyShown() const
{
return mpWindowImpl->mbReallyShown;
}
-BOOL Window::IsInInitShow() const
+sal_Bool Window::IsInInitShow() const
{
return mpWindowImpl->mbInInitShow;
}
-BOOL Window::IsEnabled() const
+sal_Bool Window::IsEnabled() const
{
return !mpWindowImpl->mbDisabled;
}
-BOOL Window::IsInputEnabled() const
+sal_Bool Window::IsInputEnabled() const
{
return !mpWindowImpl->mbInputDisabled;
}
-BOOL Window::IsAlwaysEnableInput() const
+sal_Bool Window::IsAlwaysEnableInput() const
{
return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
}
-BOOL Window::IsAlwaysDisableInput() const
+sal_Bool Window::IsAlwaysDisableInput() const
{
return mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled;
}
-USHORT Window::GetActivateMode() const
+sal_uInt16 Window::GetActivateMode() const
{
return mpWindowImpl->mnActivateMode;
}
-BOOL Window::IsAlwaysOnTopEnabled() const
+sal_Bool Window::IsAlwaysOnTopEnabled() const
{
return mpWindowImpl->mbAlwaysOnTop;
}
-BOOL Window::IsDefaultPos() const
+sal_Bool Window::IsDefaultPos() const
{
return mpWindowImpl->mbDefPos;
}
-BOOL Window::IsDefaultSize() const
+sal_Bool Window::IsDefaultSize() const
{
return mpWindowImpl->mbDefSize;
}
-void Window::EnablePaint( BOOL bEnable )
+void Window::EnablePaint( sal_Bool bEnable )
{
mpWindowImpl->mbPaintDisabled = !bEnable;
}
-BOOL Window::IsPaintEnabled() const
+sal_Bool Window::IsPaintEnabled() const
{
return !mpWindowImpl->mbPaintDisabled;
}
-BOOL Window::IsUpdateMode() const
+sal_Bool Window::IsUpdateMode() const
{
return !mpWindowImpl->mbNoUpdate;
}
-void Window::SetParentUpdateMode( BOOL bUpdate )
+void Window::SetParentUpdateMode( sal_Bool bUpdate )
{
mpWindowImpl->mbNoParentUpdate = !bUpdate;
}
-BOOL Window::IsParentUpdateMode() const
+sal_Bool Window::IsParentUpdateMode() const
{
return !mpWindowImpl->mbNoParentUpdate;
}
-BOOL Window::IsActive() const
+sal_Bool Window::IsActive() const
{
return mpWindowImpl->mbActive;
}
-USHORT Window::GetGetFocusFlags() const
+sal_uInt16 Window::GetGetFocusFlags() const
{
return mpWindowImpl->mnGetFocusFlags;
}
-BOOL Window::IsCompoundControl() const
+sal_Bool Window::IsCompoundControl() const
{
return mpWindowImpl->mbCompoundControl;
}
-BOOL Window::HasCompoundControlFocus() const
+sal_Bool Window::HasCompoundControlFocus() const
{
return mpWindowImpl->mbCompoundControlHasFocus;
}
-BOOL Window::IsChildPointerOverwrite() const
+sal_Bool Window::IsChildPointerOverwrite() const
{
return mpWindowImpl->mbChildPtrOverwrite;
}
-BOOL Window::IsPointerVisible() const
+sal_Bool Window::IsPointerVisible() const
{
return !mpWindowImpl->mbNoPtrVisible;
}
-BOOL Window::IsWait() const
+sal_Bool Window::IsWait() const
{
return (mpWindowImpl->mnWaitCount != 0);
}
@@ -1873,7 +1789,7 @@ const Fraction& Window::GetZoom() const
return mpWindowImpl->maZoom;
}
-BOOL Window::IsZoom() const
+sal_Bool Window::IsZoom() const
{
return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
}
@@ -1881,7 +1797,7 @@ BOOL Window::IsZoom() const
void Window::SetHelpText( const XubString& rHelpText )
{
mpWindowImpl->maHelpText = rHelpText;
- mpWindowImpl->mbHelpTextDynamic = TRUE;
+ mpWindowImpl->mbHelpTextDynamic = sal_True;
}
void Window::SetQuickHelpText( const XubString& rHelpText )
@@ -1904,12 +1820,12 @@ void* Window::GetData() const
return mpWindowImpl->mpUserData;
}
-BOOL Window::IsCreatedWithToolkit() const
+sal_Bool Window::IsCreatedWithToolkit() const
{
return mpWindowImpl->mbCreatedWithToolkit;
}
-void Window::SetCreatedWithToolkit( BOOL b )
+void Window::SetCreatedWithToolkit( sal_Bool b )
{
mpWindowImpl->mbCreatedWithToolkit = b;
diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx
new file mode 100644
index 000000000000..577a573c2015
--- /dev/null
+++ b/vcl/source/window/window4.cxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/window.hxx"
+#include "vcl/window.h"
+#include "vcl/svdata.hxx"
+#include "vcl/arrange.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+
+#include <map>
+#include <vector>
+
+using namespace com::sun::star;
+
+namespace vcl
+{
+ struct ExtWindowImpl
+ {
+ ExtWindowImpl()
+ : mbOwnedByParent( false )
+ {}
+ ~ExtWindowImpl()
+ {}
+
+ boost::shared_ptr< WindowArranger > mxLayout;
+ bool mbOwnedByParent;
+ rtl::OUString maIdentifier;
+ };
+}
+
+void Window::ImplDeleteOwnedChildren()
+{
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pDeleteCandidate = pChild;
+ pChild = pChild->mpWindowImpl->mpNext;
+ vcl::ExtWindowImpl* pDelImpl = pDeleteCandidate->ImplGetExtWindowImpl();
+ if( pDelImpl && pDelImpl->mbOwnedByParent )
+ delete pDeleteCandidate;
+ }
+}
+
+void Window::ImplFreeExtWindowImpl()
+{
+ ImplDeleteOwnedChildren();
+ if( mpWindowImpl )
+ {
+ delete mpWindowImpl->mpExtImpl;
+ mpWindowImpl->mpExtImpl = NULL;
+ }
+}
+
+vcl::ExtWindowImpl* Window::ImplGetExtWindowImpl() const
+{
+ vcl::ExtWindowImpl* pImpl = NULL;
+ if( mpWindowImpl )
+ {
+ if( ! mpWindowImpl->mpExtImpl && ! mpWindowImpl->mbInDtor )
+ mpWindowImpl->mpExtImpl = new vcl::ExtWindowImpl();
+ pImpl = mpWindowImpl->mpExtImpl;
+ }
+ return pImpl;
+}
+
+void Window::ImplExtResize()
+{
+ if( mpWindowImpl && mpWindowImpl->mpExtImpl )
+ {
+ if( mpWindowImpl->mpExtImpl->mxLayout.get() )
+ mpWindowImpl->mpExtImpl->mxLayout->setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ }
+}
+
+boost::shared_ptr< vcl::WindowArranger > Window::getLayout()
+{
+ boost::shared_ptr< vcl::WindowArranger > xRet;
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ if( ! pImpl->mxLayout.get() )
+ {
+ pImpl->mxLayout.reset( new vcl::LabelColumn() );
+ pImpl->mxLayout->setParentWindow( this );
+ pImpl->mxLayout->setOuterBorder( -1 );
+ }
+ xRet = pImpl->mxLayout;
+ }
+
+ return xRet;
+}
+
+void Window::addWindow( Window* i_pWin, bool i_bTakeOwnership )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl && i_pWin )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ i_pWin->SetParent( this );
+ pChildImpl->mbOwnedByParent = i_bTakeOwnership;
+ }
+ }
+}
+
+Window* Window::removeWindow( Window* i_pWin, Window* i_pNewParent )
+{
+ Window* pRet = NULL;
+ if( i_pWin )
+ {
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ {
+ vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl();
+ if( pChildImpl )
+ {
+ if( ! i_pNewParent )
+ pChildImpl->mbOwnedByParent = false;
+ i_pWin->SetParent( i_pNewParent );
+ pRet = i_pWin;
+ }
+ }
+ }
+ return pRet;
+}
+
+Window* Window::findWindow( const rtl::OUString& i_rIdentifier ) const
+{
+ if( getIdentifier() == i_rIdentifier )
+ return const_cast<Window*>(this);
+
+ Window* pChild = mpWindowImpl->mpFirstChild;
+ while ( pChild )
+ {
+ Window* pResult = pChild->findWindow( i_rIdentifier );
+ if( pResult )
+ return pResult;
+ pChild = pChild->mpWindowImpl->mpNext;
+ }
+
+ return NULL;
+}
+
+const rtl::OUString& Window::getIdentifier() const
+{
+ static rtl::OUString aEmptyStr;
+
+ return (mpWindowImpl && mpWindowImpl->mpExtImpl) ? mpWindowImpl->mpExtImpl->maIdentifier : aEmptyStr;
+}
+
+void Window::setIdentifier( const rtl::OUString& i_rIdentifier )
+{
+ vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl();
+ if( pImpl )
+ pImpl->maIdentifier = i_rIdentifier;
+}
+
+void Window::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps )
+{
+ const beans::PropertyValue* pVals = i_rProps.getConstArray();
+ for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ )
+ {
+ if( pVals[i].Name.equalsAscii( "Enabled" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Enable( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Visible" ) )
+ {
+ sal_Bool bVal = sal_True;
+ if( pVals[i].Value >>= bVal )
+ Show( bVal );
+ }
+ else if( pVals[i].Name.equalsAscii( "Text" ) )
+ {
+ rtl::OUString aText;
+ if( pVals[i].Value >>= aText )
+ SetText( aText );
+ }
+ }
+}
+
+uno::Sequence< beans::PropertyValue > Window::getProperties() const
+{
+ uno::Sequence< beans::PropertyValue > aProps( 3 );
+ aProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) );
+ aProps[0].Value = uno::makeAny( sal_Bool( IsEnabled() ) );
+ aProps[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) );
+ aProps[1].Value = uno::makeAny( sal_Bool( IsVisible() ) );
+ aProps[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
+ aProps[2].Value = uno::makeAny( rtl::OUString( GetText() ) );
+
+ return aProps;
+}
+
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a7d09cb6dd20..2892bcb00c38 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -38,7 +38,6 @@
#include <unotools/localedatawrapper.hxx>
#include <vcl/svdata.hxx>
#include <vcl/dbggui.hxx>
-#include <vcl/windata.hxx>
#include <vcl/timer.hxx>
#include <vcl/event.hxx>
#include <vcl/sound.hxx>
@@ -129,9 +128,9 @@ long ImplCallEvent( NotifyEvent& rEvt )
// =======================================================================
-static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
- USHORT nCode, USHORT nSVEvent,
- BOOL bMouseLeave )
+static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
+ sal_uInt16 nCode, sal_uInt16 nSVEvent,
+ sal_Bool bMouseLeave )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -142,21 +141,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
* #93895# since floats are system windows, coordinates have
* to be converted to float relative for the hittest
*/
- USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest );
FloatingWindow* pLastLevelFloat;
- ULONG nPopupFlags;
+ sal_uLong nPopupFlags;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
if ( bMouseLeave )
- return TRUE;
+ return sal_True;
if ( !pFloat || (nHitTest & IMPL_FLOATWIN_HITTEST_RECT) )
{
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
ImplDestroyHelpWindow( true );
pChild->ImplGetFrame()->SetPointer( POINTER_ARROW );
- return TRUE;
+ return sal_True;
}
}
else
@@ -172,15 +171,15 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
// Erstmal ausgebaut als Hack fuer Bug 53378
// if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK )
-// return FALSE;
+// return sal_False;
// else
- return TRUE;
+ return sal_True;
}
else if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT )
{
if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) )
pFloat->ImplSetMouseDown();
- return TRUE;
+ return sal_True;
}
}
else
@@ -191,7 +190,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
{
if ( pFloat->ImplIsMouseDown() )
pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
- return TRUE;
+ return sal_True;
}
}
else
@@ -201,7 +200,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
- return TRUE;
+ return sal_True;
}
}
}
@@ -216,21 +215,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
{
if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) &&
(nSVEvent == EVENT_MOUSEBUTTONUP) )
- return TRUE;
+ return sal_True;
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK )
- return FALSE;
+ return sal_False;
else
- return TRUE;
+ return sal_True;
}
else
- return TRUE;
+ return sal_True;
}
}
}
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -242,7 +241,7 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
!( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
{
- USHORT nHelpMode = 0;
+ sal_uInt16 nHelpMode = 0;
if ( pSVData->maHelpData.mbQuickHelp )
nHelpMode = HELPMODE_QUICK;
if ( pSVData->maHelpData.mbBalloonHelp )
@@ -252,9 +251,9 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
if ( pChild->IsInputEnabled() && ! pChild->IsInModalMode() )
{
HelpEvent aHelpEvent( rMousePos, nHelpMode );
- pSVData->maHelpData.mbRequestingHelp = TRUE;
+ pSVData->maHelpData.mbRequestingHelp = sal_True;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbRequestingHelp = FALSE;
+ pSVData->maHelpData.mbRequestingHelp = sal_False;
}
// #104172# do not kill keyboard activated tooltips
else if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp)
@@ -278,8 +277,8 @@ static void ImplSetMousePointer( Window* pChild )
// -----------------------------------------------------------------------
-static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
- BOOL bMouse = FALSE, Point* pPos = NULL )
+static sal_Bool ImplCallCommand( Window* pChild, sal_uInt16 nEvt, void* pData = NULL,
+ sal_Bool bMouse = sal_False, Point* pPos = NULL )
{
Point aPos;
if ( pPos )
@@ -299,24 +298,24 @@ static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
CommandEvent aCEvt( aPos, nEvt, bMouse, pData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pChild, &aCEvt );
ImplDelData aDelData( pChild );
- BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( !bPreNotify )
{
- pChild->ImplGetWindowImpl()->mbCommand = FALSE;
+ pChild->ImplGetWindowImpl()->mbCommand = sal_False;
pChild->Command( aCEvt );
if( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
pChild->ImplNotifyKeyMouseCommandEventListeners( aNCmdEvt );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( pChild->ImplGetWindowImpl()->mbCommand )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -339,24 +338,24 @@ static long ContextMenuEventLink( void* pCEvent, void* )
if( ! pEv->aDelData.IsDelete() )
{
pEv->pWindow->ImplRemoveDel( &pEv->aDelData );
- ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, TRUE, &pEv->aChildPos );
+ ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, sal_True, &pEv->aChildPos );
}
delete pEv;
return 0;
}
-long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
- long nX, long nY, ULONG nMsgTime,
- USHORT nCode, USHORT nMode )
+long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave,
+ long nX, long nY, sal_uLong nMsgTime,
+ sal_uInt16 nCode, sal_uInt16 nMode )
{
ImplSVData* pSVData = ImplGetSVData();
Point aMousePos( nX, nY );
Window* pChild;
long nRet;
- USHORT nClicks;
+ sal_uInt16 nClicks;
ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData();
- USHORT nOldCode = pWinFrameData->mnMouseCode;
+ sal_uInt16 nOldCode = pWinFrameData->mnMouseCode;
// we need a mousemove event, befor we get a mousebuttondown or a
// mousebuttonup event
@@ -379,7 +378,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( (pWinFrameData->mnLastMouseX != nX) ||
(pWinFrameData->mnLastMouseY != nY) )
{
- ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE, nX, nY, nMsgTime, nCode, nMode );
+ ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False, nX, nY, nMsgTime, nCode, nMode );
}
}
@@ -392,7 +391,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
pWinFrameData->mnMouseMode = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED);
if ( bMouseLeave )
{
- pWinFrameData->mbMouseIn = FALSE;
+ pWinFrameData->mbMouseIn = sal_False;
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
{
ImplDelData aDelData( pWindow );
@@ -404,7 +403,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
}
else
- pWinFrameData->mbMouseIn = TRUE;
+ pWinFrameData->mbMouseIn = sal_True;
DBG_ASSERT( !pSVData->maWinData.mpTrackWin ||
(pSVData->maWinData.mpTrackWin == pSVData->maWinData.mpCaptureWin),
@@ -557,7 +556,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
!(((nMouseY-nDragH) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) &&
((nMouseY+nDragH) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
{
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
// Check if drag source provides it's own recognizer
if( pMouseDownWin->ImplGetFrameData()->mbInternalDragGestureRecognizer )
@@ -588,7 +587,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
nClicks,
sal_False );
- ULONG nCount = Application::ReleaseSolarMutex();
+ sal_uLong nCount = Application::ReleaseSolarMutex();
// FIXME: where do I get Action from ?
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > xDragSource = pMouseDownWin->GetDragSource();
@@ -606,7 +605,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
}
else
- pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
// test for mouseleave and mouseenter
@@ -620,8 +619,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt );
ImplDelData aDelData;
ImplDelData aDelData2;
- pWinFrameData->mbInMouseMove = TRUE;
- pMouseMoveWin->ImplGetWinData()->mbMouseOver = FALSE;
+ pWinFrameData->mbInMouseMove = sal_True;
+ pMouseMoveWin->ImplGetWinData()->mbMouseOver = sal_False;
pMouseMoveWin->ImplAddDel( &aDelData );
// Durch MouseLeave kann auch dieses Fenster zerstoert
// werden
@@ -636,7 +635,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
pWinFrameData->mpMouseMoveWin = NULL;
- pWinFrameData->mbInMouseMove = FALSE;
+ pWinFrameData->mbInMouseMove = sal_False;
if ( pChild )
{
@@ -654,7 +653,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
pWinFrameData->mpMouseMoveWin = pChild;
if( pChild )
- pChild->ImplGetWinData()->mbMouseOver = TRUE;
+ pChild->ImplGetWinData()->mbMouseOver = sal_True;
// MouseLeave
if ( !pChild )
@@ -666,7 +665,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
{
const MouseSettings& rMSettings = pChild->GetSettings().GetMouseSettings();
- ULONG nDblClkTime = rMSettings.GetDoubleClickTime();
+ sal_uLong nDblClkTime = rMSettings.GetDoubleClickTime();
long nDblClkW = rMSettings.GetDoubleClickWidth();
long nDblClkH = rMSettings.GetDoubleClickHeight();
//long nMouseX = nX;
@@ -683,7 +682,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
((nMouseY+nDblClkH) >= pChild->ImplGetFrameData()->mnFirstMouseY) )
{
pChild->ImplGetFrameData()->mnClickCount++;
- pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
else
{
@@ -722,7 +721,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( !aDelData.IsDelete() )
{
pChild->ImplRemoveDel( &aDelData );
- pChild->ImplGetFrameData()->mbStartDragCalled = TRUE;
+ pChild->ImplGetFrameData()->mbStartDragCalled = sal_True;
}
return 1;
}
@@ -731,15 +730,15 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
// call handler
- BOOL bDrag = FALSE;
- BOOL bCallHelpRequest = TRUE;
+ sal_Bool bDrag = sal_False;
+ sal_Bool bCallHelpRequest = sal_True;
DBG_ASSERT( pChild, "ImplHandleMouseEvent: pChild is NULL" );
ImplDelData aDelData;
NotifyEvent aNEvt( nSVEvent, pChild, &aMEvt );
pChild->ImplAddDel( &aDelData );
if ( nSVEvent == EVENT_MOUSEMOVE )
- pChild->ImplGetFrameData()->mbInMouseMove = TRUE;
+ pChild->ImplGetFrameData()->mbInMouseMove = sal_True;
// bring window into foreground on mouseclick
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
@@ -769,7 +768,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
(pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) )
pSVData->maWinData.mpTrackTimer->Start();
}
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
nRet = 1;
}
else
@@ -780,16 +779,16 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
pChild->ToTop( TOTOP_NOGRABFOCUS );
if( aDelData.IsDelete() )
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
else
{
// if the MouseMove handler changes the help window's visibility
// the HelpRequest handler should not be called anymore
Window* pOldHelpTextWin = pSVData->maHelpData.mpHelpWin;
- pChild->ImplGetWindowImpl()->mbMouseMove = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseMove = sal_False;
pChild->MouseMove( aMEvt );
if ( pOldHelpTextWin != pSVData->maHelpData.mpHelpWin )
- bCallHelpRequest = FALSE;
+ bCallHelpRequest = sal_False;
}
}
}
@@ -800,7 +799,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
nRet = 1;
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonDown = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseButtonDown = sal_False;
pChild->MouseButtonDown( aMEvt );
}
}
@@ -813,7 +812,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
}
else
{
- pChild->ImplGetWindowImpl()->mbMouseButtonUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbMouseButtonUp = sal_False;
pChild->MouseButtonUp( aMEvt );
}
}
@@ -828,7 +827,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( nSVEvent == EVENT_MOUSEMOVE )
- pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = FALSE;
+ pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = sal_False;
if ( nSVEvent == EVENT_MOUSEMOVE )
{
@@ -866,11 +865,11 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( /*(nRet == 0) &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) &&
(nCode == MOUSE_MIDDLE) )
{
- USHORT nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
+ sal_uInt16 nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction();
if ( nMiddleAction == MOUSE_MIDDLE_AUTOSCROLL )
- nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, TRUE, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, sal_True, &aChildPos );
else if ( nMiddleAction == MOUSE_MIDDLE_PASTESELECTION )
- nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, TRUE, &aChildPos );
+ nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, sal_True, &aChildPos );
}
else
{
@@ -879,7 +878,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
if ( (nCode == rMSettings.GetContextMenuCode()) &&
(nClicks == rMSettings.GetContextMenuClicks()) )
{
- BOOL bContextMenu;
+ sal_Bool bContextMenu;
if ( rMSettings.GetContextMenuDown() )
bContextMenu = (nSVEvent == EVENT_MOUSEBUTTONDOWN);
else
@@ -903,7 +902,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
Application::PostUserEvent( Link( pEv, ContextMenuEventLink ) );
}
else
- nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, TRUE, &aChildPos );
+ nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_True, &aChildPos );
}
}
}
@@ -958,20 +957,20 @@ static Window* ImplGetKeyInputWindow( Window* pWindow )
// -----------------------------------------------------------------------
-static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
- USHORT nKeyCode, USHORT nCharCode, USHORT nRepeat, BOOL bForward )
+static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent,
+ sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, sal_Bool bForward )
{
ImplSVData* pSVData = ImplGetSVData();
KeyCode aKeyCode( nKeyCode, nKeyCode );
- USHORT nEvCode = aKeyCode.GetCode();
+ sal_uInt16 nEvCode = aKeyCode.GetCode();
// allow application key listeners to remove the key event
- // but make sure we're not forwarding external KeyEvents, (ie where bForward is FALSE)
+ // but make sure we're not forwarding external KeyEvents, (ie where bForward is sal_False)
// becasue those are coming back from the listener itself and MUST be processed
KeyEvent aKeyEvent( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
if( bForward )
{
- USHORT nVCLEvent;
+ sal_uInt16 nVCLEvent;
switch( nSVEvent )
{
case EVENT_KEYINPUT:
@@ -994,11 +993,11 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() )
{
String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() );
- nCharCode = (USHORT) aSep.GetChar(0);
+ nCharCode = (sal_uInt16) aSep.GetChar(0);
}
}
- BOOL bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
+ sal_Bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1();
// determine last input time
pSVData->maAppData.mnLastInputTime = Time::GetSystemTicks();
@@ -1034,7 +1033,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
if ( pSVData->maWinData.mpTrackWin )
{
- USHORT nOrigCode = aKeyCode.GetCode();
+ sal_uInt16 nOrigCode = aKeyCode.GetCode();
if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) )
{
@@ -1044,7 +1043,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- USHORT nEscCode = aKeyCode.GetCode();
+ sal_uInt16 nEscCode = aKeyCode.GetCode();
if ( nEscCode == KEY_ESCAPE )
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1067,7 +1066,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
if ( (nCode == KEY_ESCAPE) || bCtrlF6)
{
@@ -1102,19 +1101,19 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
KeyEvent aKeyEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt );
- BOOL bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
+ sal_Bool bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0);
long nRet = 1;
if ( !bKeyPreNotify && !aDelData.IsDelete() )
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
pChild->KeyInput( aKeyEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
pChild->KeyUp( aKeyEvt );
}
// #82968#
@@ -1131,10 +1130,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyInput )
{
- USHORT nCode = aKeyCode.GetCode();
+ sal_uInt16 nCode = aKeyCode.GetCode();
// #101999# is focus in or below toolbox
- BOOL bToolboxFocus=FALSE;
+ sal_Bool bToolboxFocus=sal_False;
if( (nCode == KEY_F1) && aKeyCode.IsShift() )
{
Window *pWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
@@ -1142,7 +1141,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if( pWin->ImplGetWindowImpl()->mbToolBox )
{
- bToolboxFocus = TRUE;
+ bToolboxFocus = sal_True;
break;
}
else
@@ -1152,7 +1151,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
// ContextMenu
if ( (nCode == KEY_CONTEXTMENU) || ((nCode == KEY_F10) && aKeyCode.IsShift() && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) )
- nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, FALSE );
+ nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_False );
else if ( ( (nCode == KEY_F2) && aKeyCode.IsShift() ) || ( (nCode == KEY_F1) && aKeyCode.IsMod1() ) ||
// #101999# no active help when focus in toolbox, simulate BallonHelp instead
( (nCode == KEY_F1) && aKeyCode.IsShift() && bToolboxFocus ) )
@@ -1165,10 +1164,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
aPos = pChild->OutputToScreenPixel( aPos );
HelpEvent aHelpEvent( aPos, HELPMODE_BALLOON );
- aHelpEvent.SetKeyboardActivated( TRUE );
- pSVData->maHelpData.mbSetKeyboardHelp = TRUE;
+ aHelpEvent.SetKeyboardActivated( sal_True );
+ pSVData->maHelpData.mbSetKeyboardHelp = sal_True;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbSetKeyboardHelp = FALSE;
+ pSVData->maHelpData.mbSetKeyboardHelp = sal_False;
}
else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) )
{
@@ -1215,7 +1214,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
ImplDelData aChildDelData( pChild );
KeyEvent aKEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat );
NotifyEvent aNEvt( nSVEvent, pChild, &aKEvt );
- BOOL bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNEvt ) != 0);
if ( aChildDelData.IsDelete() )
return 1;
@@ -1223,12 +1222,12 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
{
if ( nSVEvent == EVENT_KEYINPUT )
{
- pChild->ImplGetWindowImpl()->mbKeyInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyInput = sal_False;
pChild->KeyInput( aKEvt );
}
else
{
- pChild->ImplGetWindowImpl()->mbKeyUp = FALSE;
+ pChild->ImplGetWindowImpl()->mbKeyUp = sal_False;
pChild->KeyUp( aKEvt );
}
// #82968#
@@ -1249,8 +1248,8 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent,
static long ImplHandleExtTextInput( Window* pWindow,
const XubString& rText,
- const USHORT* pTextAttr,
- ULONG nCursorPos, USHORT nCursorFlags )
+ const sal_uInt16* pTextAttr,
+ sal_uLong nCursorPos, sal_uInt16 nCursorFlags )
{
ImplSVData* pSVData = ImplGetSVData();
Window* pChild = NULL;
@@ -1275,7 +1274,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( !pChild->ImplGetWindowImpl()->mbExtTextInput )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = TRUE;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = sal_True;
if ( !pWinData->mpExtOldText )
pWinData->mpExtOldText = new UniString;
else
@@ -1294,7 +1293,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
return 0;
// Test for changes
- BOOL bOnlyCursor = FALSE;
+ sal_Bool bOnlyCursor = sal_False;
xub_StrLen nMinLen = Min( pWinData->mpExtOldText->Len(), rText.Len() );
xub_StrLen nDeltaStart = 0;
while ( nDeltaStart < nMinLen )
@@ -1323,7 +1322,7 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( (nDeltaStart >= nMinLen) &&
(pWinData->mpExtOldText->Len() == rText.Len()) )
- bOnlyCursor = TRUE;
+ bOnlyCursor = sal_True;
// Call Event and store the information
CommandExtTextInputData aData( rText, pTextAttr,
@@ -1338,8 +1337,8 @@ static long ImplHandleExtTextInput( Window* pWindow,
}
if ( pTextAttr )
{
- pWinData->mpExtOldAttrAry = new USHORT[rText.Len()];
- memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( USHORT ) );
+ pWinData->mpExtOldAttrAry = new sal_uInt16[rText.Len()];
+ memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( sal_uInt16 ) );
}
return !ImplCallCommand( pChild, COMMAND_EXTTEXTINPUT, &aData );
}
@@ -1354,7 +1353,7 @@ static long ImplHandleEndExtTextInput( Window* /* pWindow */ )
if ( pChild )
{
- pChild->ImplGetWindowImpl()->mbExtTextInput = FALSE;
+ pChild->ImplGetWindowImpl()->mbExtTextInput = sal_False;
pSVData->maWinData.mpExtTextInputWin = NULL;
ImplWinData* pWinData = pChild->ImplGetWinData();
if ( pWinData->mpExtOldText )
@@ -1431,26 +1430,26 @@ static long ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang
// -----------------------------------------------------------------------
-static BOOL ImplCallWheelCommand( Window* pWindow, const Point& rPos,
+static sal_Bool ImplCallWheelCommand( Window* pWindow, const Point& rPos,
const CommandWheelData* pWheelData )
{
Point aCmdMousePos = pWindow->ImplFrameToOutput( rPos );
- CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, TRUE, pWheelData );
+ CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, sal_True, pWheelData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
ImplDelData aDelData( pWindow );
- BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
+ sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0);
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( !bPreNotify )
{
- pWindow->ImplGetWindowImpl()->mbCommand = FALSE;
+ pWindow->ImplGetWindowImpl()->mbCommand = sal_False;
pWindow->Command( aCEvt );
if ( aDelData.IsDelete() )
- return FALSE;
+ return sal_False;
if ( pWindow->ImplGetWindowImpl()->mbCommand )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1467,8 +1466,8 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if( aDogTag.IsDelete() )
return 0;
- USHORT nMode;
- USHORT nCode = rEvt.mnCode;
+ sal_uInt16 nMode;
+ sal_uInt16 nCode = rEvt.mnCode;
bool bHorz = rEvt.mbHorz;
bool bPixel = rEvt.mbDeltaIsPixel;
if ( nCode & KEY_MOD1 )
@@ -1485,7 +1484,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
CommandWheelData aWheelData( rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz, bPixel );
Point aMousePos( rEvt.mnX, rEvt.mnY );
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
// first check any floating window ( eg. drop down listboxes)
bool bIsFloat = false;
@@ -1493,7 +1492,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin &&
!pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pWindow ) )
{
- USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
+ sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
pMouseWindow = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pWindow, aMousePos, nHitTest );
}
// then try the window directly beneath the mouse
@@ -1547,7 +1546,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
if( pLastLevelFloat )
{
- ULONG nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
+ sal_uLong nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
if ( nPopupFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE )
{
pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1559,7 +1558,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
}
// -----------------------------------------------------------------------
-#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020)
+#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020)
static void ImplHandlePaint( Window* pWindow, const Rectangle& rBoundRect, bool bImmediateUpdate )
{
@@ -1598,7 +1597,7 @@ static void KillOwnPopups( Window* pWindow )
ImplSVData* pSVData = ImplGetSVData();
Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow;
Window *pChild = pSVData->maWinData.mpFirstFloat;
- if ( pChild && pParent->ImplIsWindowOrChild( pChild, TRUE ) )
+ if ( pChild && pParent->ImplIsWindowOrChild( pChild, sal_True ) )
{
if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
@@ -1625,7 +1624,7 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
{
pWindow->mnOutWidth = nNewWidth;
pWindow->mnOutHeight = nNewHeight;
- pWindow->ImplGetWindowImpl()->mbWaitSystemResize = FALSE;
+ pWindow->ImplGetWindowImpl()->mbWaitSystemResize = sal_False;
if ( pWindow->IsReallyVisible() )
pWindow->ImplSetClipFlag();
if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize ||
@@ -1656,13 +1655,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->ImplCallResize(); // otherwise menues cannot be positioned
}
else
- pWindow->ImplGetWindowImpl()->mbCallResize = TRUE;
+ pWindow->ImplGetWindowImpl()->mbCallResize = sal_True;
}
}
pWindow->ImplGetWindowImpl()->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) ||
(nNewHeight < IMPL_MIN_NEEDSYSWIN);
- BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ sal_Bool bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
if( bMinimized != pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized )
pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized = bMinimized;
@@ -1688,7 +1687,7 @@ static void ImplHandleMove( Window* pWindow )
if ( pWindow->IsVisible() )
pWindow->ImplCallMove();
else
- pWindow->ImplGetWindowImpl()->mbCallMove = TRUE; // make sure the framepos will be updated on the next Show()
+ pWindow->ImplGetWindowImpl()->mbCallMove = sal_True; // make sure the framepos will be updated on the next Show()
if ( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplGetWindowImpl()->mpClientWindow )
pWindow->ImplGetWindowImpl()->mpClientWindow->ImplCallMove(); // notify client to update geometry
@@ -1705,7 +1704,7 @@ static void ImplHandleMoveResize( Window* pWindow, long nNewWidth, long nNewHeig
// -----------------------------------------------------------------------
-static void ImplActivateFloatingWindows( Window* pWindow, BOOL bActive )
+static void ImplActivateFloatingWindows( Window* pWindow, sal_Bool bActive )
{
// Zuerst alle ueberlappenden Fenster ueberpruefen
Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
@@ -1733,7 +1732,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
// Wenn Status erhalten geblieben ist, weil wir den Focus in der
// zwischenzeit schon wiederbekommen haben, brauchen wir auch
// nichts machen
- BOOL bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
+ sal_Bool bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus;
// Dann die zeitverzoegerten Funktionen ausfuehren
if ( bHasFocus )
@@ -1744,21 +1743,21 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin )
{
- BOOL bHandled = FALSE;
+ sal_Bool bHandled = sal_False;
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInputEnabled() &&
! ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInModalMode() )
{
if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsEnabled() )
{
ImplGetWindowImpl()->mpFrameData->mpFocusWin->GrabFocus();
- bHandled = TRUE;
+ bHandled = sal_True;
}
else if( ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplHasDlgCtrl() )
{
// #109094# if the focus is restored to a disabled dialog control (was disabled meanwhile)
// try to move it to the next control
ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplDlgCtrlNextWindow();
- bHandled = TRUE;
+ bHandled = sal_True;
}
}
if ( !bHandled )
@@ -1799,11 +1798,11 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
Window* pOldOverlapWindow = pOldFocusWindow->ImplGetFirstOverlapWindow();
Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
- pOldOverlapWindow->ImplGetWindowImpl()->mbActive = FALSE;
+ pOldOverlapWindow->ImplGetWindowImpl()->mbActive = sal_False;
pOldOverlapWindow->Deactivate();
if ( pOldRealWindow != pOldOverlapWindow )
{
- pOldRealWindow->ImplGetWindowImpl()->mbActive = FALSE;
+ pOldRealWindow->ImplGetWindowImpl()->mbActive = sal_False;
pOldRealWindow->Deactivate();
}
}
@@ -1839,7 +1838,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
static void ImplHandleGetFocus( Window* pWindow )
{
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = TRUE;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_True;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -1883,7 +1882,7 @@ static void ImplHandleLoseFocus( Window* pWindow )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
}
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = FALSE;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_False;
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
@@ -2004,9 +2003,9 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent )
// =======================================================================
-static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent )
+static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent )
{
- USHORT nMode = 0;
+ sal_uInt16 nMode = 0;
if ( !pEvent->mnCode )
nMode |= MOUSE_SIMPLEMOVE;
if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) )
@@ -2018,9 +2017,9 @@ static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent )
// -----------------------------------------------------------------------
-static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent )
+static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent )
{
- USHORT nMode = 0;
+ sal_uInt16 nMode = 0;
if ( pEvent->mnButton == MOUSE_LEFT )
nMode |= MOUSE_SIMPLECLICK;
if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) )
@@ -2038,7 +2037,7 @@ static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent )
inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, TRUE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_True,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2048,7 +2047,7 @@ inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime, pEvent->mnCode,
ImplGetMouseMoveMode( pEvent ) );
@@ -2058,7 +2057,7 @@ inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent )
inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2073,7 +2072,7 @@ inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent
inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
{
- return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, FALSE,
+ return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, sal_False,
pEvent->mnX, pEvent->mnY,
pEvent->mnTime,
#ifdef MACOSX
@@ -2088,12 +2087,12 @@ inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent )
static long ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, USHORT nEvent )
+static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
{
// Find SystemWindow and its Menubar and let it dispatch the command
long nRet = 0;
@@ -2143,11 +2142,11 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent )
if ( pTrackWin )
pWindow = pTrackWin;
#ifdef MACOSX
- USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
+ sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3);
#else
- USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
+ sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
#endif
- USHORT nNewCode = pEvent->mnCode;
+ sal_uInt16 nNewCode = pEvent->mnCode;
if ( nOldCode != nNewCode )
{
#ifdef MACOSX
@@ -2155,7 +2154,7 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent )
#else
nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2);
#endif
- pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, TRUE );
+ pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, sal_True );
}
// #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc.
@@ -2187,7 +2186,7 @@ static void ImplHandleInputLanguageChange( Window* pWindow )
// -----------------------------------------------------------------------
-static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
+static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
{
// Application Notification werden nur fuer das erste Window ausgeloest
ImplSVData* pSVData = ImplGetSVData();
@@ -2207,7 +2206,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
}
else
{
- USHORT nType;
+ sal_uInt16 nType;
switch ( nEvent )
{
case SALEVENT_VOLUMECHANGED:
@@ -2221,7 +2220,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent )
nType = DATACHANGED_DISPLAY;
break;
case SALEVENT_FONTCHANGED:
- OutputDevice::ImplUpdateAllFontData( TRUE );
+ OutputDevice::ImplUpdateAllFontData( sal_True );
nType = DATACHANGED_FONTS;
break;
case SALEVENT_DATETIMECHANGED:
@@ -2271,7 +2270,7 @@ static void ImplHandleSalExtTextInputPos( Window* pWindow, SalExtTextInputPosEve
static long ImplHandleShowDialog( Window* pWindow, int nDialogId )
{
if( ! pWindow )
- return FALSE;
+ return sal_False;
if( pWindow->GetType() == WINDOW_BORDERWINDOW )
{
@@ -2335,8 +2334,8 @@ static void ImplHandleSalSurroundingTextRequest( Window *pWindow,
// -----------------------------------------------------------------------
static void ImplHandleSurroundingTextSelectionChange( Window *pWindow,
- ULONG nStart,
- ULONG nEnd )
+ sal_uLong nStart,
+ sal_uLong nEnd )
{
Window* pChild = ImplGetKeyInputWindow( pWindow );
if( pChild )
@@ -2358,7 +2357,7 @@ static void ImplHandleStartReconversion( Window *pWindow )
// -----------------------------------------------------------------------
long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
- USHORT nEvent, const void* pEvent )
+ sal_uInt16 nEvent, const void* pEvent )
{
DBG_TESTSOLARMUTEX();
@@ -2433,28 +2432,28 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
}
break;
case SALEVENT_EXTERNALKEYINPUT:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
}
break;
case SALEVENT_KEYUP:
{
SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE );
+ pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True );
}
break;
case SALEVENT_EXTERNALKEYUP:
{
KeyEvent* pKeyEvt = (KeyEvent*) pEvent;
nRet = ImplHandleKey( pWindow, EVENT_KEYUP,
- pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE );
+ pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False );
}
break;
case SALEVENT_KEYMODCHANGE:
@@ -2541,15 +2540,15 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
{
// Message-Schleife beenden
Application::Quit();
- return FALSE;
+ return sal_False;
}
else
{
bInQueryExit = false;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
case SALEVENT_SETTINGSCHANGED:
@@ -2605,7 +2604,7 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
break;
#ifdef DBG_UTIL
default:
- OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (ULONG)nEvent );
+ OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (sal_uLong)nEvent );
break;
#endif
}
diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx
new file mode 100644
index 000000000000..fcb0c560291e
--- /dev/null
+++ b/vcl/source/window/wpropset.cxx
@@ -0,0 +1,346 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/wpropset.hxx"
+#include "vcl/window.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/svdata.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyContainer.hpp"
+#include "com/sun/star/beans/XPropertyAccess.hpp"
+
+#include "cppuhelper/basemutex.hxx"
+#include "cppuhelper/compbase1.hxx"
+
+#include <map>
+
+using namespace vcl;
+using namespace com::sun::star;
+
+/*
+
+TODO:
+- release solarmutex during outside UNO calls
+- in ChildEventListener protect against reentry by using PostUserEvent
+
+*/
+
+class vcl::WindowPropertySetListener :
+ public cppu::BaseMutex,
+ public cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >,
+ private boost::noncopyable
+{
+ WindowPropertySet* mpParent;
+ bool mbSuspended;
+public:
+ WindowPropertySetListener( WindowPropertySet* pParent )
+ : cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >( m_aMutex )
+ , mpParent( pParent )
+ , mbSuspended( false )
+ {}
+
+ virtual ~WindowPropertySetListener()
+ {
+ }
+
+ using cppu::WeakComponentImplHelperBase::disposing;
+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw()
+ {
+ }
+
+ virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& i_rEvent ) throw()
+ {
+ if( ! mbSuspended )
+ mpParent->propertyChange( i_rEvent );
+ }
+
+ void suspend( bool i_bSuspended )
+ {
+ mbSuspended = i_bSuspended;
+ }
+};
+
+class vcl::WindowPropertySetData
+{
+public:
+
+ struct PropertyMapEntry
+ {
+ Window* mpWindow;
+ boost::shared_ptr<WindowArranger> mpLayout;
+ uno::Sequence< beans::PropertyValue > maSavedValues;
+
+ PropertyMapEntry( Window* i_pWindow = NULL,
+ const boost::shared_ptr<WindowArranger>& i_pLayout = boost::shared_ptr<WindowArranger>() )
+ : mpWindow( i_pWindow )
+ , mpLayout( i_pLayout )
+ {}
+
+ uno::Sequence< beans::PropertyValue > getProperties() const
+ {
+ if( mpWindow )
+ return mpWindow->getProperties();
+ else if( mpLayout.get() )
+ return mpLayout->getProperties();
+ return uno::Sequence< beans::PropertyValue >();
+ }
+
+ void setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) const
+ {
+ if( mpWindow )
+ mpWindow->setProperties( i_rProps );
+ else if( mpLayout.get() )
+ mpLayout->setProperties( i_rProps );
+ }
+ };
+
+ Window* mpTopWindow;
+ bool mbOwner;
+ std::map< rtl::OUString, PropertyMapEntry > maProperties;
+ uno::Reference< beans::XPropertySet > mxPropSet;
+ uno::Reference< beans::XPropertyAccess > mxPropSetAccess;
+ uno::Reference< beans::XPropertyChangeListener > mxListener;
+ vcl::WindowPropertySetListener* mpListener;
+
+ WindowPropertySetData()
+ : mpTopWindow( NULL )
+ , mbOwner( false )
+ , mpListener( NULL )
+ {}
+
+ ~WindowPropertySetData()
+ {
+ // release layouters, possibly interface properties before destroying
+ // the involved parent to be on the safe side
+ maProperties.clear();
+ if( mbOwner )
+ delete mpTopWindow;
+ }
+};
+
+static rtl::OUString getIdentifiedPropertyName( const rtl::OUString& i_rIdentifier, const rtl::OUString& i_rName )
+{
+ rtl::OUStringBuffer aBuf( i_rIdentifier.getLength() + 1 + i_rName.getLength() );
+ aBuf.append( i_rIdentifier );
+ aBuf.append( sal_Unicode( '#' ) );
+ aBuf.append( i_rName );
+ return aBuf.makeStringAndClear();
+}
+
+static void spliceIdentifiedPropertyName( const rtl::OUString& i_rIdentifiedPropName,
+ rtl::OUString& o_rIdentifier,
+ rtl::OUString& o_rPropName )
+{
+ sal_Int32 nIndex = 0;
+ o_rIdentifier = i_rIdentifiedPropName.getToken( 0, sal_Unicode( '#' ), nIndex );
+ if( nIndex != -1 )
+ o_rPropName = i_rIdentifiedPropName.copy( nIndex );
+ else
+ o_rPropName = rtl::OUString();
+}
+
+WindowPropertySet::WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership )
+: mpImpl( new vcl::WindowPropertySetData )
+{
+ mpImpl->mpTopWindow = i_pTopWindow;
+ mpImpl->mbOwner = i_bTakeOwnership;
+
+ mpImpl->mpTopWindow->AddChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ mpImpl->mxPropSet = uno::Reference< beans::XPropertySet >(
+ ImplGetSVData()->maAppData.mxMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ) ),
+ uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not create instance of com.sun.star.beans.PropertyBag" );
+ mpImpl->mxPropSetAccess = uno::Reference< beans::XPropertyAccess >( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( mpImpl->mxPropSet.is(), "could not query XPropertyAccess interface" );
+ if( ! mpImpl->mxPropSetAccess.is() )
+ mpImpl->mxPropSet.clear();
+
+ addWindowToSet( i_pTopWindow );
+
+ setupProperties();
+
+ if( mpImpl->mxPropSet.is() )
+ {
+ mpImpl->mxListener.set( mpImpl->mpListener = new WindowPropertySetListener( this ) );
+ }
+}
+
+WindowPropertySet::~WindowPropertySet()
+{
+ mpImpl->mpTopWindow->RemoveChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) );
+
+ delete mpImpl;
+ mpImpl = NULL;
+}
+
+uno::Reference< beans::XPropertySet > WindowPropertySet::getPropertySet() const
+{
+ return mpImpl->mxPropSet;
+}
+
+void WindowPropertySet::addLayoutToSet( const boost::shared_ptr< WindowArranger >& i_pLayout )
+{
+ if( i_pLayout.get() )
+ {
+ if( i_pLayout->getIdentifier().getLength() )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pLayout->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted layout has duplicate name" );
+ rEntry.mpWindow = NULL;
+ rEntry.mpLayout = i_pLayout;
+ rEntry.maSavedValues = i_pLayout->getProperties();
+ }
+ // insert child layouts
+ size_t nChildren = i_pLayout->countElements();
+ for( size_t i = 0; i < nChildren; i++ )
+ addLayoutToSet( i_pLayout->getChild( i ) );
+ }
+}
+
+void WindowPropertySet::addWindowToSet( Window* i_pWindow )
+{
+ if( i_pWindow->getIdentifier().getLength() ) // no name, no properties
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pWindow->getIdentifier() ];
+ OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted window has duplicate name" );
+ rEntry.mpWindow = i_pWindow;
+ rEntry.mpLayout.reset();
+ rEntry.maSavedValues = i_pWindow->getProperties();
+ }
+ addLayoutToSet( i_pWindow->getLayout() );
+
+ Window* pWin = i_pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ while( pWin )
+ {
+ addWindowToSet( pWin );
+ pWin = pWin->GetWindow( WINDOW_NEXT );
+ }
+}
+
+void WindowPropertySet::setupProperties()
+{
+ uno::Reference< beans::XPropertyContainer > xCont( mpImpl->mxPropSet, uno::UNO_QUERY );
+ OSL_ENSURE( xCont.is(), "could not get XPropertyContainer interface" );
+ if( ! xCont.is() )
+ return;
+
+ for( std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.begin(); it != mpImpl->maProperties.end(); ++it )
+ {
+ uno::Sequence< beans::PropertyValue > aOutsideValues( it->second.maSavedValues );
+ beans::PropertyValue* pVal = aOutsideValues.getArray();
+ for( sal_Int32 i = 0; i < aOutsideValues.getLength(); i++ )
+ {
+ pVal[i].Name = getIdentifiedPropertyName( it->first, pVal[i].Name );
+ xCont->addProperty( pVal[i].Name,
+ beans::PropertyAttribute::BOUND | beans:: PropertyAttribute::CONSTRAINED,
+ pVal[i].Value
+ );
+ }
+ }
+}
+
+void WindowPropertySet::propertyChange( const beans::PropertyChangeEvent& i_rEvent )
+{
+ rtl::OUString aIdentifier, aProperty;
+ spliceIdentifiedPropertyName( i_rEvent.PropertyName, aIdentifier, aProperty );
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it =
+ mpImpl->maProperties.find( aIdentifier );
+ if( it != mpImpl->maProperties.end() )
+ {
+ uno::Sequence< beans::PropertyValue > aSet( 1 );
+ aSet[0].Name = aProperty;
+ aSet[0].Value = i_rEvent.NewValue;
+ it->second.setProperties( aSet );
+ }
+}
+
+IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent )
+{
+ // find window in our properties
+ std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it
+ = mpImpl->maProperties.find( pEvent->GetWindow()->getIdentifier() );
+ if( it != mpImpl->maProperties.end() ) // this is valid, some unnamed child may have sent an event
+ {
+ sal_uLong nId = pEvent->GetId();
+ // check if anything interesting happened
+ if(
+ // general windowy things
+ nId == VCLEVENT_WINDOW_SHOW ||
+ nId == VCLEVENT_WINDOW_HIDE ||
+ nId == VCLEVENT_WINDOW_ENABLED ||
+ nId == VCLEVENT_WINDOW_DISABLED ||
+ // button thingies
+ nId == VCLEVENT_BUTTON_CLICK ||
+ nId == VCLEVENT_PUSHBUTTON_TOGGLE ||
+ nId == VCLEVENT_RADIOBUTTON_TOGGLE ||
+ nId == VCLEVENT_CHECKBOX_TOGGLE ||
+ // listbox
+ nId == VCLEVENT_LISTBOX_SELECT ||
+ // edit
+ nId == VCLEVENT_EDIT_MODIFY
+ )
+ {
+ WindowPropertySetData::PropertyMapEntry& rEntry = it->second;
+ // collect changes
+ uno::Sequence< beans::PropertyValue > aNewProps( rEntry.getProperties() );
+ uno::Sequence< beans::PropertyValue > aNewPropsOut( aNewProps );
+
+ // translate to identified properties
+ beans::PropertyValue* pValues = aNewPropsOut.getArray();
+ for( sal_Int32 i = 0; i < aNewPropsOut.getLength(); i++ )
+ pValues[i].Name = getIdentifiedPropertyName( it->first, pValues[i].Name );
+
+ // broadcast changes
+ bool bWasVeto = false;
+ mpImpl->mpListener->suspend( true );
+ try
+ {
+ mpImpl->mxPropSetAccess->setPropertyValues( aNewPropsOut );
+ }
+ catch( beans::PropertyVetoException& )
+ {
+ bWasVeto = true;
+ }
+ mpImpl->mpListener->suspend( false );
+
+ if( ! bWasVeto ) // changes accepted ?
+ rEntry.maSavedValues = rEntry.getProperties();
+ else // no, reset
+ rEntry.setProperties( rEntry.maSavedValues );
+ }
+ }
+
+ return 0;
+}
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 72887ce0f577..38d78fbc9723 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -45,8 +45,8 @@
// =======================================================================
-#define WORKWIN_WINDOWSTATE_FULLSCREEN ((ULONG)0x00010000)
-#define WORKWIN_WINDOWSTATE_ALL ((ULONG)0x00FF0000)
+#define WORKWIN_WINDOWSTATE_FULLSCREEN ((sal_uLong)0x00010000)
+#define WORKWIN_WINDOWSTATE_ALL ((sal_uLong)0x00FF0000)
// =======================================================================
@@ -55,17 +55,17 @@ void WorkWindow::ImplInitWorkWindowData()
mnIcon = 0; // Should be removed in the next top level update - now in SystemWindow
mnPresentationFlags = 0;
- mbPresentationMode = FALSE;
- mbPresentationVisible = FALSE;
- mbPresentationFull = FALSE;
- mbFullScreenMode = FALSE;
+ mbPresentationMode = sal_False;
+ mbPresentationVisible = sal_False;
+ mbPresentationFull = sal_False;
+ mbFullScreenMode = sal_False;
}
// -----------------------------------------------------------------------
void WorkWindow::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
- USHORT nFrameStyle = BORDERWINDOW_STYLE_FRAME;
+ sal_uInt16 nFrameStyle = BORDERWINDOW_STYLE_FRAME;
if ( nStyle & WB_APP )
nFrameStyle |= BORDERWINDOW_STYLE_APP;
@@ -138,7 +138,7 @@ WorkWindow::WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSyst
SystemWindow( WINDOW_WORKWINDOW )
{
ImplInitWorkWindowData();
- mbSysChild = TRUE;
+ mbSysChild = sal_True;
ImplInit( pParent, nStyle, aSystemWorkWindowToken );
}
@@ -148,7 +148,7 @@ WorkWindow::WorkWindow( SystemParentData* pParent ) :
SystemWindow( WINDOW_WORKWINDOW )
{
ImplInitWorkWindowData();
- mbSysChild = TRUE;
+ mbSysChild = sal_True;
ImplInit( NULL, 0, pParent );
}
@@ -177,7 +177,7 @@ WorkWindow::~WorkWindow()
// -----------------------------------------------------------------------
-void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay )
+void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDisplay )
{
if ( !mbFullScreenMode == !bFullScreenMode )
return;
@@ -203,34 +203,34 @@ void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay )
xCanvasComponent->dispose();
}
- mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = TRUE;
+ mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = sal_True;
ImplGetFrame()->ShowFullScreen( bFullScreenMode, nDisplay );
}
}
// -----------------------------------------------------------------------
-void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_Int32 nDisplay )
+void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplay )
{
if ( !bPresentation == !mbPresentationMode )
return;
if ( bPresentation )
{
- mbPresentationMode = TRUE;
+ mbPresentationMode = sal_True;
mbPresentationVisible = IsVisible();
mbPresentationFull = mbFullScreenMode;
mnPresentationFlags = nFlags;
if ( !(mnPresentationFlags & PRESENTATION_NOFULLSCREEN) )
- ShowFullScreenMode( TRUE, nDisplay );
+ ShowFullScreenMode( sal_True, nDisplay );
if ( !mbSysChild )
{
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( TRUE );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_True );
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
ToTop();
- mpWindowImpl->mpFrame->StartPresentation( TRUE );
+ mpWindowImpl->mpFrame->StartPresentation( sal_True );
}
if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) )
@@ -241,22 +241,22 @@ void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_I
Show( mbPresentationVisible );
if ( !mbSysChild )
{
- mpWindowImpl->mpFrame->StartPresentation( FALSE );
+ mpWindowImpl->mpFrame->StartPresentation( sal_False );
if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS )
- mpWindowImpl->mpFrame->SetAlwaysOnTop( FALSE );
+ mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_False );
}
ShowFullScreenMode( mbPresentationFull, nDisplay );
- mbPresentationMode = FALSE;
- mbPresentationVisible = FALSE;
- mbPresentationFull = FALSE;
+ mbPresentationMode = sal_False;
+ mbPresentationVisible = sal_False;
+ mbPresentationFull = sal_False;
mnPresentationFlags = 0;
}
}
// -----------------------------------------------------------------------
-BOOL WorkWindow::IsMinimized() const
+sal_Bool WorkWindow::IsMinimized() const
{
//return mpWindowImpl->mpFrameData->mbMinimized;
SalFrameState aState;
@@ -266,15 +266,15 @@ BOOL WorkWindow::IsMinimized() const
// -----------------------------------------------------------------------
-BOOL WorkWindow::SetPluginParent( SystemParentData* pParent )
+sal_Bool WorkWindow::SetPluginParent( SystemParentData* pParent )
{
DBG_ASSERT( ! mbPresentationMode && ! mbFullScreenMode, "SetPluginParent in fullscreen or presentation mode !" );
bool bWasDnd = Window::ImplStopDnd();
- BOOL bShown = IsVisible();
- Show( FALSE );
- BOOL bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
+ sal_Bool bShown = IsVisible();
+ Show( sal_False );
+ sal_Bool bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent );
Show( bShown );
if( bWasDnd )
@@ -283,7 +283,7 @@ BOOL WorkWindow::SetPluginParent( SystemParentData* pParent )
return bRet;
}
-void WorkWindow::ImplSetFrameState( ULONG aFrameState )
+void WorkWindow::ImplSetFrameState( sal_uLong aFrameState )
{
SalFrameState aState;
aState.mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -302,9 +302,9 @@ void WorkWindow::Restore()
ImplSetFrameState( SAL_FRAMESTATE_NORMAL );
}
-BOOL WorkWindow::Close()
+sal_Bool WorkWindow::Close()
{
- BOOL bCanClose = SystemWindow::Close();
+ sal_Bool bCanClose = SystemWindow::Close();
// Ist es das Applikationsfenster, dann beende die Applikation
if ( bCanClose && ( ImplGetSVData()->maWinData.mpAppWin == this ) )
@@ -313,14 +313,14 @@ BOOL WorkWindow::Close()
return bCanClose;
}
-void WorkWindow::Maximize( BOOL bMaximize )
+void WorkWindow::Maximize( sal_Bool bMaximize )
{
ImplSetFrameState( bMaximize ? SAL_FRAMESTATE_MAXIMIZED : SAL_FRAMESTATE_NORMAL );
}
-BOOL WorkWindow::IsMaximized() const
+sal_Bool WorkWindow::IsMaximized() const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SalFrameState aState;
if( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
@@ -328,7 +328,7 @@ BOOL WorkWindow::IsMaximized() const
if( aState.mnState & (SAL_FRAMESTATE_MAXIMIZED |
SAL_FRAMESTATE_MAXIMIZED_HORZ |
SAL_FRAMESTATE_MAXIMIZED_VERT ) )
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
diff --git a/vcl/test/canvasbitmaptest.cxx b/vcl/test/canvasbitmaptest.cxx
index 94807c051e59..3763fb5b9d02 100644
--- a/vcl/test/canvasbitmaptest.cxx
+++ b/vcl/test/canvasbitmaptest.cxx
@@ -115,7 +115,7 @@ class TestApp : public Application
{
public:
virtual void Main();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
};
class TestWindow : public Dialog
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index d748998df102..57380897c71e 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -572,7 +572,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
try
{
Menu* pMenu = pEvent->GetMenu();
- USHORT nPos = pEvent->GetItemPos();
+ sal_uInt16 nPos = pEvent->GetItemPos();
if( pMenu && nPos != 0xFFFF)
{
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index c265f79585e8..1b84026dd281 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -79,7 +79,7 @@ init_from_window( AtkObject *accessible, Window *pWindow )
*/
case AccessibleRole::WINDOW:
{
- USHORT type = WINDOW_WINDOW;
+ sal_uInt16 type = WINDOW_WINDOW;
bool parentIsMenuFloatingWindow = false;
Window *pParent = pWindow->GetParent();
diff --git a/vcl/unx/gtk/a11y/makefile.mk b/vcl/unx/gtk/a11y/makefile.mk
index 14d3014ddf11..30c6d5e7cfb3 100644
--- a/vcl/unx/gtk/a11y/makefile.mk
+++ b/vcl/unx/gtk/a11y/makefile.mk
@@ -31,10 +31,6 @@ PRJNAME=vcl
TARGET=gtka11y
ENABLE_EXCEPTIONS=TRUE
-# workaround for makedepend hang
-MKDEPENDSOLVER=
-NO_DEFAULT_STL=YES
-
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index da042c00bdfc..bd038cc55966 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -246,14 +246,15 @@ extern "C"
int GtkSalDisplay::GetDefaultMonitorNumber() const
{
+ int n = 0;
GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
#if GTK_CHECK_VERSION(2,20,0)
- return m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+ n = gdk_screen_get_primary_monitor(pScreen);
#else
static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
- return m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor(pScreen)];
+ n = sym_gdk_screen_get_primary_monitor( pScreen );
#if GTK_CHECK_VERSION(2,14,0)
//gdk_screen_get_primary_monitor unavailable, take the first laptop monitor
//as the default
@@ -266,6 +267,9 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
#endif
return 0;
#endif
+ if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
+ n = m_aXineramaScreenIndexMap[n];
+ return n;
}
void GtkSalDisplay::initScreen( int nScreen ) const
@@ -539,7 +543,7 @@ public:
YieldFunc handle );
virtual void Remove( int fd );
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
@@ -739,7 +743,7 @@ gboolean GtkXLib::timeoutFn(gpointer data)
return FALSE;
}
-void GtkXLib::StartTimer( ULONG nMS )
+void GtkXLib::StartTimer( sal_uLong nMS )
{
m_nTimeoutMS = nMS; // for restarting
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 159820ec3dbd..abaf97c2a00f 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -40,6 +40,8 @@
#include <rtl/strbuf.hxx>
+#include <rtl/uri.hxx>
+
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -64,7 +66,7 @@ void GtkHookedYieldMutex::ThreadsEnter()
acquire();
if( !aYieldStack.empty() )
{ /* Previously called ThreadsLeave() */
- ULONG nCount = aYieldStack.front();
+ sal_uLong nCount = aYieldStack.front();
aYieldStack.pop_front();
while( nCount-- > 1 )
acquire();
@@ -187,19 +189,19 @@ GtkInstance::~GtkInstance()
DeInitAtkBridge();
}
-SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
+SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
{
return new GtkSalFrame( pParent, nStyle );
}
-SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, ULONG )
+SalFrame* GtkInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong )
{
SalFrame* pFrame = new GtkSalFrame( pParentData );
return pFrame;
}
-SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
// there is no method to set a visual for a GtkWidget
// so we need the X11SalObject in that case
@@ -217,9 +219,25 @@ extern "C"
void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
{
+ rtl::OString sGtkURL;
+ rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding();
+ if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) != 0))
+ sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8);
+ else
+ {
+ //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
+ //Decode %XX components
+ rtl::OUString sDecodedUri = rtl::Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ //Convert back to system locale encoding
+ rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
+ //Encode to an escaped ASCII-encoded URI
+ gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL);
+ sGtkURL = rtl::OString(g_uri);
+ g_free(g_uri);
+ }
#if GTK_CHECK_VERSION(2,10,0)
GtkRecentManager *manager = gtk_recent_manager_get_default ();
- gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+ gtk_recent_manager_add_item (manager, sGtkURL);
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
@@ -228,10 +246,7 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
static addItemFnc sym_gtk_recent_manager_add_item =
(addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
- {
- sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
- rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
+ sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index bb3e878abe06..553ec6c85e0f 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -49,11 +49,11 @@
typedef struct _cairo_font_options cairo_font_options_t;
// initialize statics
-BOOL GtkSalGraphics::bThemeChanged = TRUE;
-BOOL GtkSalGraphics::bNeedPixmapPaint = FALSE;
-BOOL GtkSalGraphics::bGlobalNeedPixmapPaint = FALSE;
-BOOL GtkSalGraphics::bToolbarGripWorkaround = FALSE;
-BOOL GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = FALSE;
+sal_Bool GtkSalGraphics::bThemeChanged = sal_True;
+sal_Bool GtkSalGraphics::bNeedPixmapPaint = sal_False;
+sal_Bool GtkSalGraphics::bGlobalNeedPixmapPaint = sal_False;
+sal_Bool GtkSalGraphics::bToolbarGripWorkaround = sal_False;
+sal_Bool GtkSalGraphics::bNeedButtonStyleAsEditBackgroundWorkaround = sal_False;
GtkSalGraphics::~GtkSalGraphics()
{
@@ -271,7 +271,7 @@ public:
{ delete [] pData; m_idx = 0; m_size = n; pData = new NWPixmapCacheData[m_size]; }
int GetSize() const { return m_size; }
- BOOL Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
+ sal_Bool Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap );
void Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap );
void ThemeChanged();
@@ -324,7 +324,7 @@ void NWPixmapCache::ThemeChanged()
pData[i].SetPixmap( NULL );
}
-BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
+sal_Bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
{
aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag
int i;
@@ -337,10 +337,10 @@ BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectang
pData[i].m_pixmap != NULL )
{
*pPixmap = pData[i].m_pixmap;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void NWPixmapCache::Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap* pPixmap )
@@ -485,30 +485,13 @@ void GtkSalGraphics::ResetClipRegion()
X11SalGraphics::ResetClipRegion();
}
-void GtkSalGraphics::BeginSetClipRegion( ULONG nCount )
-{
- m_aClipRegion.SetNull();
- X11SalGraphics::BeginSetClipRegion( nCount );
-}
-
-BOOL GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- m_aClipRegion.Union( aRect );
- return X11SalGraphics::unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool GtkSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void GtkSalGraphics::EndSetClipRegion()
+bool GtkSalGraphics::setClipRegion( const Region& i_rClip )
{
+ m_aClipRegion = i_rClip;
+ bool bRet = X11SalGraphics::setClipRegion( m_aClipRegion );
if( m_aClipRegion.IsEmpty() )
m_aClipRegion.SetNull();
- X11SalGraphics::EndSetClipRegion();
+ return bRet;
}
void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
@@ -539,10 +522,10 @@ void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
/*
* IsNativeControlSupported()
*
- * Returns TRUE if the platform supports native
+ * Returns sal_True if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
if (
((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
@@ -613,25 +596,25 @@ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
)
)
)
- return( TRUE );
- return( FALSE );
+ return( sal_True );
+ return( sal_False );
}
/*
* HitTestNativeControl()
*
- * bIsInside is set to TRUE if aPos is contained within the
+ * bIsInside is set to sal_True if aPos is contained within the
* given part of the control, whose bounding region is
* given by rControlRegion (in VCL frame coordinates).
*
* returns whether bIsInside was really set.
*/
-BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
+sal_Bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
const Point& aPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if ( ( nType == CTRL_SCROLLBAR ) &&
( ( nPart == PART_BUTTON_UP ) ||
@@ -654,7 +637,7 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
Rectangle aForward;
Rectangle aBackward;
- rIsInside = FALSE;
+ rIsInside = sal_False;
ControlPart nCounterPart = 0;
if ( nPart == PART_BUTTON_UP )
@@ -713,17 +696,17 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
if ( has_forward2 )
rIsInside |= aForward.IsInside( aPos );
}
- return ( TRUE );
+ return ( sal_True );
}
if( IsNativeControlSupported(nType, nPart) )
{
rIsInside = rControlRegion.IsInside( aPos );
- return( TRUE );
+ return( sal_True );
}
else
{
- return( FALSE );
+ return( sal_False );
}
}
@@ -737,22 +720,16 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
+sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
{
- if( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) &&
- aValue.getTristateVal() == BUTTONVALUE_MIXED )
- {
- return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
- BOOL returnVal = FALSE;
+ sal_Bool returnVal = sal_False;
// get a GC with current clipping region set
- SelectFont();
+ GetFontGC();
// theme changed ?
@@ -762,7 +739,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
for( unsigned int i = 0; i < gWidgetData.size(); i++ )
if( gWidgetData[i].gNWPixmapCacheList )
gWidgetData[i].gNWPixmapCacheList->ThemeChanged();
- GtkSalGraphics::bThemeChanged = FALSE;
+ GtkSalGraphics::bThemeChanged = sal_False;
}
Rectangle aCtrlRect( rControlRegion );
@@ -789,7 +766,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
Size( aCtrlRect.GetWidth()+2, aCtrlRect.GetHeight()+2) );
pixmap = NWGetPixmapFromScreen( aPixmapRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
gdkDrawable = GDK_DRAWABLE( pixmap );
aCtrlRect = Rectangle( Point(1,1), aCtrlRect.GetSize() );
aClip.push_back( aCtrlRect );
@@ -850,7 +827,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) )
{
if ( nType == CTRL_TAB_BODY )
- returnVal = TRUE;
+ returnVal = sal_True;
else
returnVal = NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption);
}
@@ -907,61 +884,6 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
return( returnVal );
}
-BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
- ControlPart nPart,
- const Rectangle& rControlRegion,
- ControlState nState,
- const ImplControlValue& aValue,
- const OUString& rCaption )
-{
- // need to emulate something for mixed state
-
- // do this via pixmap since some themes don't care for regions
- bool bOldNeedPixmapPaint = bNeedPixmapPaint;
- bNeedPixmapPaint = true;
-
- Rectangle aCtrlRect = rControlRegion;
- BOOL returnVal = FALSE;
- SelectFont();
-
- // draw upper half in off state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_OFF );
- XLIB_Region aRegion = XCreateRegion();
- XRectangle aXRect =
- {
- static_cast<short>(aCtrlRect.Left()),
- static_cast<short>(aCtrlRect.Top()),
- static_cast<unsigned short>(aCtrlRect.GetWidth()),
- static_cast<unsigned short>(aCtrlRect.GetHeight())
- };
- const unsigned short nH = aXRect.height/2;
- aXRect.height -= nH;
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
-
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
-
- if( returnVal )
- {
- // draw lower half in on state
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_ON );
- aXRect.y += nH;
- aRegion = XCreateRegion();
- XUnionRectWithRegion( &aXRect, aRegion, aRegion );
- SetClipRegion( pFontGC_, aRegion );
- XDestroyRegion( aRegion );
- returnVal = drawNativeControl( nType, nPart, rControlRegion, nState, aValue, rCaption );
- }
-
- // clean up
- bNeedPixmapPaint = bOldNeedPixmapPaint;
- const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_MIXED );
- SetClipRegion( pFontGC_ );
- return returnVal;
-}
-
-
/*
* DrawNativeControlText()
*
@@ -972,22 +894,22 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::drawNativeControlText( ControlType,
+sal_Bool GtkSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
{
- return( FALSE );
+ return( sal_False );
}
/*
* GetNativeControlRegion()
*
- * If the return value is TRUE, rNativeBoundingRegion
- * contains the TRUE bounding region covered by the control
+ * If the return value is sal_True, rNativeBoundingRegion
+ * contains the true bounding region covered by the control
* including any adornment, while rNativeContentRegion contains the area
* within the control that can be safely drawn into without drawing over
* the borders of the control.
@@ -996,7 +918,7 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
-BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
+sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1005,7 +927,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- BOOL returnVal = FALSE;
+ sal_Bool returnVal = sal_False;
if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)
&& (rControlRegion.GetWidth() > 16)
@@ -1015,7 +937,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
nState, aValue, rCaption );
rNativeContentRegion = rControlRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1023,7 +945,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1032,7 +954,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
@@ -1040,7 +962,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_TOOLBAR) &&
((nPart==PART_DRAW_BACKGROUND_HORZ) ||
@@ -1052,7 +974,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
{
rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
(nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) )
@@ -1066,7 +988,6 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
if (!rNativeContentRegion.GetHeight())
rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
- returnVal = TRUE;
}
if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) )
{
@@ -1078,7 +999,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aMenuBarRect.GetWidth(), aReq.height+1 ) );
rNativeBoundingRegion = aMenuBarRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_MENU_POPUP) )
{
@@ -1098,7 +1019,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
}
if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) )
@@ -1117,7 +1038,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
rNativeContentRegion = aIndicatorRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL )
{
@@ -1131,7 +1052,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
Size( aEditRect.GetWidth(), nHeight ) );
rNativeBoundingRegion = aEditRect;
rNativeContentRegion = rNativeBoundingRegion;
- returnVal = TRUE;
+ returnVal = sal_True;
}
if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
{
@@ -1155,7 +1076,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aRect.Right() = aRect.Left() + slider_width - 1;
}
rNativeBoundingRegion = rNativeContentRegion = aRect;
- returnVal = TRUE;
+ returnVal = sal_True;
}
return( returnVal );
@@ -1165,7 +1086,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
/************************************************************************
* Individual control drawing functions
************************************************************************/
-BOOL GtkSalGraphics::NWPaintGTKButton(
+sal_Bool GtkSalGraphics::NWPaintGTKButton(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -1178,7 +1099,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
gboolean interiorFocus;
gint focusWidth;
gint focusPad;
- BOOL bDrawFocus = TRUE;
+ sal_Bool bDrawFocus = sal_True;
gint x, y, w, h;
GtkBorder aDefBorder;
GtkBorder* pBorder;
@@ -1209,7 +1130,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
// If the button is too small, don't ever draw focus or grab more space
if ( (w < 16) || (h < 16) )
- bDrawFocus = FALSE;
+ bDrawFocus = sal_False;
NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
@@ -1256,7 +1177,7 @@ BOOL GtkSalGraphics::NWPaintGTKButton(
}
}
- return( TRUE );
+ return( sal_True );
}
static Rectangle NWGetButtonArea( int nScreen,
@@ -1268,7 +1189,7 @@ static Rectangle NWGetButtonArea( int nScreen,
gint focusPad;
GtkBorder aDefBorder;
GtkBorder * pBorder;
- BOOL bDrawFocus = TRUE;
+ sal_Bool bDrawFocus = sal_True;
Rectangle aRect;
gint x, y, w, h;
@@ -1295,7 +1216,7 @@ static Rectangle NWGetButtonArea( int nScreen,
// If the button is too small, don't ever draw focus or grab more space
if ( (w < 16) || (h < 16) )
- bDrawFocus = FALSE;
+ bDrawFocus = sal_False;
if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus )
{
@@ -1312,7 +1233,7 @@ static Rectangle NWGetButtonArea( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1322,7 +1243,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
{
GtkStateType stateType;
GtkShadowType shadowType;
- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+ sal_Bool isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
gint x, y;
GdkRectangle clipRect;
@@ -1350,7 +1271,7 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
// intermediate states between active/inactive. Let's hope that
// GtkToggleButtone stays binary compatible.
if (!isChecked)
- GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = TRUE;
+ GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidgetSibling)->active = sal_True;
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gRadioWidget)->active = isChecked;
for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
@@ -1365,12 +1286,12 @@ BOOL GtkSalGraphics::NWPaintGTKRadio( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( TRUE );
+ return( sal_True );
}
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1380,7 +1301,8 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
{
GtkStateType stateType;
GtkShadowType shadowType;
- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+ bool isChecked = (aValue.getTristateVal() == BUTTONVALUE_ON);
+ bool isInconsistent = (aValue.getTristateVal() == BUTTONVALUE_MIXED);
GdkRectangle clipRect;
gint x,y;
@@ -1395,7 +1317,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
y = rControlRectangle.Top() + (rControlRectangle.GetHeight()-indicator_size)/2;
// Set the shadow based on if checked or not so we get a checkmark.
- shadowType = isChecked ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
+ shadowType = isChecked ? GTK_SHADOW_IN : isInconsistent ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_OUT;
NWSetWidgetState( gWidgetData[m_nScreen].gCheckWidget, nState, stateType );
GTK_TOGGLE_BUTTON(gWidgetData[m_nScreen].gCheckWidget)->active = isChecked;
@@ -1411,7 +1333,7 @@ BOOL GtkSalGraphics::NWPaintGTKCheck( GdkDrawable* gdkDrawable,
x, y, indicator_size, indicator_size );
}
- return( TRUE );
+ return( sal_True );
}
//-------------------------------------
@@ -1427,7 +1349,7 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
) );
}
-BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
+sal_Bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -1482,7 +1404,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
scrollbarRect = pixmapRect;
if ( (scrollbarRect.GetWidth() <= 1) || (scrollbarRect.GetHeight() <= 1) )
- return( TRUE );
+ return( sal_True );
// Grab some button style attributes
gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget,
@@ -1594,7 +1516,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 );
}
- BOOL has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
+ sal_Bool has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 );
scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
if ( scrollbarValues == NULL )
@@ -1619,7 +1541,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// painting them directly to the window flickers
pixmap = NWGetPixmapFromScreen( pixmapRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
x = y = 0;
w = pixmapRect.GetWidth();
@@ -1677,7 +1599,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button11BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1692,7 +1614,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 1
NWCalcArrowRect( button12BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1708,7 +1630,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button21BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1723,7 +1645,7 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
// ----------------- ARROW 2
NWCalcArrowRect( button22BoundRect, arrowRect );
gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
- gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+ gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, sal_True,
x+hShim+arrowRect.Left(), y+vShim+arrowRect.Top(),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -1731,11 +1653,11 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( FALSE );
+ return( sal_False );
}
g_object_unref( pixmap );
- return( TRUE );
+ return( sal_True );
}
//---
@@ -1823,7 +1745,7 @@ static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangl
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -1848,7 +1770,7 @@ BOOL GtkSalGraphics::NWPaintGTKEditBox( GdkDrawable* gdkDrawable,
NWPaintOneEditBox( m_nScreen, gdkDrawable, &clipRect, nType, nPart, pixmapRect, nState, aValue, rCaption );
}
- return( TRUE );
+ return( sal_True );
}
@@ -1957,7 +1879,7 @@ static void NWPaintOneEditBox( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+sal_Bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -2008,7 +1930,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
pixmap = NWGetPixmapFromScreen( pixmapRect );
if ( !pixmap )
- return( FALSE );
+ return( sal_False );
upBtnRect = NWGetSpinButtonRect( m_nScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption );
downBtnRect = NWGetSpinButtonRect( m_nScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption );
@@ -2044,11 +1966,11 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
if( !NWRenderPixmapToScreen(pixmap, pixmapRect) )
{
g_object_unref( pixmap );
- return( FALSE );
+ return( sal_False );
}
g_object_unref( pixmap );
- return( TRUE );
+ return( sal_True );
}
//---
@@ -2131,7 +2053,7 @@ static void NWPaintOneSpinButton( int nScreen,
arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1);
gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[nScreen].gSpinButtonWidget,
- "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, TRUE,
+ "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, sal_True,
(arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -2139,7 +2061,7 @@ static void NWPaintOneSpinButton( int nScreen,
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2207,12 +2129,12 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
buttonRect.GetWidth(), buttonRect.GetHeight() );
gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType,
- &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
+ &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, sal_True,
x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()),
arrowRect.GetWidth(), arrowRect.GetHeight() );
}
- return( TRUE );
+ return( sal_True );
}
//----
@@ -2272,7 +2194,7 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen,
-BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
+sal_Bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const Rectangle& rControlRectangle,
const clipList&,
ControlState nState,
@@ -2403,14 +2325,14 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
else
aCachePage.Fill( nType, nState, pixmapRect, pixmap );
- BOOL bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
+ sal_Bool bSuccess = NWRenderPixmapToScreen(pixmap, pixmapRect);
g_object_unref( pixmap );
return bSuccess;
}
//-------------------------------------
-BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
+sal_Bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
@@ -2501,10 +2423,10 @@ BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKToolbar(
+sal_Bool GtkSalGraphics::NWPaintGTKToolbar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2576,12 +2498,18 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
{
pButtonWidget = gWidgetData[m_nScreen].gToolbarToggleWidget;
shadowType = GTK_SHADOW_IN;
+ stateType = GTK_STATE_ACTIVE;
// special case stateType value for depressed toggle buttons
// cf. gtk+/gtk/gtktogglebutton.c (gtk_toggle_button_update_state)
- if( ! (nState & (CTRL_STATE_PRESSED|CTRL_STATE_ROLLOVER)) )
- stateType = GTK_STATE_ACTIVE;
+ if( (nState & (CTRL_STATE_ROLLOVER|CTRL_STATE_PRESSED)) )
+ {
+ stateType = GTK_STATE_PRELIGHT;
+ shadowType = GTK_SHADOW_OUT;
+ }
bPaintButton = true;
}
+ else
+ stateType = GTK_STATE_PRELIGHT; // only for bPaintButton = true, in which case always rollver is meant
NWSetWidgetState( pButtonWidget, nState, stateType );
gtk_widget_ensure_style( pButtonWidget );
@@ -2659,12 +2587,12 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
}
}
- return( TRUE );
+ return( sal_True );
}
//----
-BOOL GtkSalGraphics::NWPaintGTKMenubar(
+sal_Bool GtkSalGraphics::NWPaintGTKMenubar(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2747,10 +2675,10 @@ BOOL GtkSalGraphics::NWPaintGTKMenubar(
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
+sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -2762,7 +2690,7 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
// even crashes) in very old (Fedora Core 4 vintage) gtk's
if (gtk_major_version <= 2 && gtk_minor_version <= 8 &&
nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
- return TRUE;
+ return sal_True;
GtkStateType stateType;
GtkShadowType shadowType;
@@ -2878,10 +2806,10 @@ BOOL GtkSalGraphics::NWPaintGTKPopupMenu(
}
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKTooltip(
+sal_Bool GtkSalGraphics::NWPaintGTKTooltip(
GdkDrawable* gdkDrawable,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2916,10 +2844,10 @@ BOOL GtkSalGraphics::NWPaintGTKTooltip(
x, y, w, h );
}
- return( TRUE );
+ return( sal_True );
}
-BOOL GtkSalGraphics::NWPaintGTKListNode(
+sal_Bool GtkSalGraphics::NWPaintGTKListNode(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2955,7 +2883,7 @@ BOOL GtkSalGraphics::NWPaintGTKListNode(
GdkPixmap* pixmap = NWGetPixmapFromScreen( aRect );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
gtk_paint_expander( gWidgetData[m_nScreen].gTreeView->style,
@@ -2967,13 +2895,13 @@ BOOL GtkSalGraphics::NWPaintGTKListNode(
w/2, h/2,
eStyle );
- BOOL bRet = NWRenderPixmapToScreen( pixmap, aRect );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, aRect );
g_object_unref( pixmap );
return bRet;
}
-BOOL GtkSalGraphics::NWPaintGTKProgress(
+sal_Bool GtkSalGraphics::NWPaintGTKProgress(
GdkDrawable*,
ControlType, ControlPart,
const Rectangle& rControlRectangle,
@@ -2991,7 +2919,7 @@ BOOL GtkSalGraphics::NWPaintGTKProgress(
GdkPixmap* pixmap = NWGetPixmapFromScreen( Rectangle( Point( 0, 0 ), Size( w, h ) ) );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
@@ -3031,13 +2959,13 @@ BOOL GtkSalGraphics::NWPaintGTKProgress(
}
}
- BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
}
-BOOL GtkSalGraphics::NWPaintGTKSlider(
+sal_Bool GtkSalGraphics::NWPaintGTKSlider(
GdkDrawable*,
ControlType, ControlPart nPart,
const Rectangle& rControlRectangle,
@@ -3056,7 +2984,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider(
GdkPixmap* pixmap = NWGetPixmapFromScreen( rControlRectangle );
if( ! pixmap )
- return FALSE;
+ return sal_False;
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA)
@@ -3121,7 +3049,7 @@ BOOL GtkSalGraphics::NWPaintGTKSlider(
}
- BOOL bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
+ sal_Bool bRet = NWRenderPixmapToScreen( pixmap, rControlRectangle );
g_object_unref( pixmap );
return bRet;
@@ -3370,9 +3298,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
else
{
Color aColor2 = aStyleSet.GetLightColor();
- Color aCheck( (BYTE)(((USHORT)aBackColor.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBackColor.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBackColor.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ Color aCheck( (sal_uInt8)(((sal_uInt16)aBackColor.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (sal_uInt8)(((sal_uInt16)aBackColor.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (sal_uInt8)(((sal_uInt16)aBackColor.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
);
aStyleSet.SetCheckedColor( aCheck );
}
@@ -3408,7 +3336,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetInactiveTabColor( aSelectedBackColor );
// menu disabled entries handling
- aStyleSet.SetSkipDisabledInMenus( TRUE );
+ aStyleSet.SetSkipDisabledInMenus( sal_True );
// menu colors
GtkStyle* pMenuStyle = gtk_widget_get_style( gWidgetData[m_nScreen].gMenuWidget );
GtkStyle* pMenuItemStyle = gtk_rc_get_style( gWidgetData[m_nScreen].gMenuItemMenuWidget );
@@ -3694,17 +3622,18 @@ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
* Copy an alpha pixmap to screen using a gc with clipping
************************************************************************/
-BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
+sal_Bool GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect )
{
// The GC can't be null, otherwise we'd have no clip region
- if( SelectFont() == NULL )
+ GC aFontGC = GetFontGC();
+ if( aFontGC == NULL )
{
std::fprintf(stderr, "salnativewidgets.cxx: no valid GC\n" );
- return( FALSE );
+ return( sal_False );
}
if ( !pPixmap )
- return( FALSE );
+ return( sal_False );
// Copy the background of the screen into a composite pixmap
CopyScreenArea( GetXDisplay(),
@@ -3712,10 +3641,10 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe
gdk_screen_get_number( gdk_drawable_get_screen( GDK_DRAWABLE(pPixmap) ) ),
gdk_drawable_get_depth( GDK_DRAWABLE(pPixmap) ),
GetDrawable(), m_nScreen, GetVisual().GetDepth(),
- SelectFont(),
+ aFontGC,
0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() );
- return( TRUE );
+ return( sal_True );
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 776e90d8daff..2ae761aaa1a4 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -85,9 +85,9 @@ using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
-static USHORT GetKeyModCode( guint state )
+static sal_uInt16 GetKeyModCode( guint state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( (state & GDK_SHIFT_MASK) )
nCode |= KEY_SHIFT;
if( (state & GDK_CONTROL_MASK) )
@@ -102,9 +102,9 @@ static USHORT GetKeyModCode( guint state )
return nCode;
}
-static USHORT GetMouseModCode( guint state )
+static sal_uInt16 GetMouseModCode( guint state )
{
- USHORT nCode = GetKeyModCode( state );
+ sal_uInt16 nCode = GetKeyModCode( state );
if( (state & GDK_BUTTON1_MASK) )
nCode |= MOUSE_LEFT;
if( (state & GDK_BUTTON2_MASK) )
@@ -115,9 +115,9 @@ static USHORT GetMouseModCode( guint state )
return nCode;
}
-static USHORT GetKeyCode( guint keyval )
+static sal_uInt16 GetKeyCode( guint keyval )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( keyval >= GDK_0 && keyval <= GDK_9 )
nCode = KEY_0 + (keyval-GDK_0);
else if( keyval >= GDK_KP_0 && keyval <= GDK_KP_9 )
@@ -302,14 +302,14 @@ static USHORT GetKeyCode( guint keyval )
// in the independent part.
struct KeyAlternate
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const USHORT nKeyCode )
+GetAlternateKeyCode( const sal_uInt16 nKeyCode )
{
KeyAlternate aAlternate;
@@ -397,7 +397,7 @@ GtkSalFrame::GraphicsHolder::~GraphicsHolder()
delete pGraphics;
}
-GtkSalFrame::GtkSalFrame( SalFrame* pParent, ULONG nStyle )
+GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle )
{
m_nScreen = getDisplay()->GetDefaultScreenNumber();
getDisplay()->registerFrame( this );
@@ -572,7 +572,7 @@ void GtkSalFrame::InitCommon()
m_ePointerStyle = 0xffff;
m_bSetFocusOnMap = false;
- gtk_widget_set_app_paintable( m_pWindow, TRUE );
+ gtk_widget_set_app_paintable( m_pWindow, sal_True );
gtk_widget_set_double_buffered( m_pWindow, FALSE );
gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE );
gtk_widget_add_events( m_pWindow,
@@ -759,7 +759,7 @@ GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow )
return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" );
}
-void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
+void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
{
if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style
{
@@ -829,7 +829,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, true );
bNoDecor = true;
}
else if( (nStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) )
@@ -873,9 +873,9 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
if( bDecoHandling )
{
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? sal_True : FALSE );
if( ( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ) )
- lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false );
+ lcl_set_accept_focus( GTK_WINDOW(m_pWindow), sal_False, false );
}
}
@@ -1019,10 +1019,10 @@ void GtkSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
}
}
-BOOL GtkSalFrame::PostEvent( void* pData )
+sal_Bool GtkSalFrame::PostEvent( void* pData )
{
getDisplay()->SendInternalEvent( this, pData );
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::SetTitle( const String& rTitle )
@@ -1032,8 +1032,8 @@ void GtkSalFrame::SetTitle( const String& rTitle )
gtk_window_set_title( GTK_WINDOW(m_pWindow), rtl::OUStringToOString( rTitle, RTL_TEXTENCODING_UTF8 ).getStr() );
}
-static inline BYTE *
-getRow( BitmapBuffer *pBuffer, ULONG nRow )
+static inline sal_uInt8 *
+getRow( BitmapBuffer *pBuffer, sal_uLong nRow )
{
if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN )
return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize;
@@ -1047,11 +1047,11 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
g_return_val_if_fail( pSalBitmap != NULL, NULL );
g_return_val_if_fail( pSalAlpha != NULL, NULL );
- BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( TRUE );
+ BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( sal_True );
g_return_val_if_fail( pBitmap != NULL, NULL );
g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL );
- BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( TRUE );
+ BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( sal_True );
g_return_val_if_fail( pAlpha != NULL, NULL );
g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL );
@@ -1064,8 +1064,8 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
for( nY = 0; nY < pBitmap->mnHeight; nY++ )
{
- BYTE *pData = getRow( pBitmap, nY );
- BYTE *pAlphaData = getRow( pAlpha, nY );
+ sal_uInt8 *pData = getRow( pBitmap, nY );
+ sal_uInt8 *pAlphaData = getRow( pAlpha, nY );
for( nX = 0; nX < pBitmap->mnWidth; nX++ )
{
@@ -1086,18 +1086,18 @@ bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
}
}
- pSalBitmap->ReleaseBuffer( pBitmap, TRUE );
- pSalAlpha->ReleaseBuffer( pAlpha, TRUE );
+ pSalBitmap->ReleaseBuffer( pBitmap, sal_True );
+ pSalAlpha->ReleaseBuffer( pAlpha, sal_True );
return gdk_pixbuf_new_from_data( pPixbufData,
- GDK_COLORSPACE_RGB, TRUE, 8,
+ GDK_COLORSPACE_RGB, sal_True, 8,
aSize.Width(), aSize.Height(),
aSize.Width() * 4,
(GdkPixbufDestroyNotify) g_free,
NULL );
}
-void GtkSalFrame::SetIcon( USHORT nIcon )
+void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
{
if( (m_nStyle & (SAL_FRAME_STYLE_PLUG|SAL_FRAME_STYLE_SYSTEMCHILD|SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_INTRO|SAL_FRAME_STYLE_OWNERDRAWDECORATION))
|| ! m_pWindow )
@@ -1109,10 +1109,10 @@ void GtkSalFrame::SetIcon( USHORT nIcon )
GdkPixbuf *pBuf;
GList *pIcons = NULL;
- USHORT nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
- USHORT nIndex;
+ sal_uInt16 nOffsets[2] = { SV_ICON_SMALL_START, SV_ICON_LARGE_START };
+ sal_uInt16 nIndex;
- for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(USHORT); nIndex++ )
+ for( nIndex = 0; nIndex < sizeof(nOffsets)/ sizeof(sal_uInt16); nIndex++ )
{
// #i44723# workaround gcc temporary problem
ResId aResId( nOffsets[nIndex] + nIcon, *ImplGetResMgr() );
@@ -1131,7 +1131,7 @@ void GtkSalFrame::SetIcon( USHORT nIcon )
{
case TRANSPARENT_NONE:
{
- BYTE nTrans = 0;
+ sal_uInt8 nTrans = 0;
aMask = AlphaMask( aBmp.GetSizePixel(), &nTrans );
}
break;
@@ -1271,7 +1271,7 @@ static void initClientId()
}
}
-void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void GtkSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( m_pWindow )
{
@@ -1305,7 +1305,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* showing the float (cannot grab it to the float
* before show).
*/
- m_pParent->grabPointer( TRUE, TRUE );
+ m_pParent->grabPointer( sal_True, sal_True );
}
guint32 nUserTime = 0;
@@ -1352,7 +1352,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
m_nFloats++;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
- grabPointer( TRUE, TRUE );
+ grabPointer( sal_True, sal_True );
// #i44068# reset parent's IM context
if( m_pParent )
m_pParent->EndExtTextInput(0);
@@ -1366,7 +1366,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
{
m_nFloats--;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0)
- grabPointer( FALSE );
+ grabPointer( sal_False );
}
gtk_widget_hide( m_pWindow );
if( m_pIMHandler )
@@ -1379,7 +1379,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
}
-void GtkSalFrame::Enable( BOOL /*bEnable*/ )
+void GtkSalFrame::Enable( sal_Bool /*bEnable*/ )
{
// Not implemented by X11SalFrame either
}
@@ -1430,6 +1430,12 @@ void GtkSalFrame::setMinMaxSize()
aHints |= GDK_HINT_MAX_SIZE;
}
}
+ if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
+ {
+ aGeo.max_width = m_aMaxSize.Width();
+ aGeo.max_height = m_aMaxSize.Height();
+ aHints |= GDK_HINT_MAX_SIZE;
+ }
if( aHints )
gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
NULL,
@@ -1463,7 +1469,7 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
}
}
-void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( !m_pWindow || isChild( true, false ) )
return;
@@ -1578,7 +1584,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
if( ! m_pWindow || ! pState || isChild( true, false ) )
return;
- const ULONG nMaxGeometryMask =
+ const sal_uLong nMaxGeometryMask =
SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT |
SAL_FRAMESTATE_MASK_MAXIMIZED_X | SAL_FRAMESTATE_MASK_MAXIMIZED_Y |
@@ -1606,7 +1612,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
else if( pState->mnMask & (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_Y |
SAL_FRAMESTATE_MASK_WIDTH | SAL_FRAMESTATE_MASK_HEIGHT ) )
{
- USHORT nPosSizeFlags = 0;
+ sal_uInt16 nPosSizeFlags = 0;
long nX = pState->mnX - (m_pParent ? m_pParent->maGeometry.nX : 0);
long nY = pState->mnY - (m_pParent ? m_pParent->maGeometry.nY : 0);
if( pState->mnMask & SAL_FRAMESTATE_MASK_X )
@@ -1645,7 +1651,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
}
}
-BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool GtkSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
pState->mnMask = SAL_FRAMESTATE_MASK_STATE;
@@ -1681,7 +1687,7 @@ BOOL GtkSalFrame::GetWindowState( SalFrameState* pState )
SAL_FRAMESTATE_MASK_WIDTH |
SAL_FRAMESTATE_MASK_HEIGHT;
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::moveToScreen( int nScreen )
@@ -1745,13 +1751,13 @@ void GtkSalFrame::SetScreenNumber( unsigned int nNewScreen )
Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top());
createNewWindow( None, false, m_nScreen );
gtk_window_move( GTK_WINDOW(m_pWindow), maGeometry.nX, maGeometry.nY );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < pDisp->GetScreenCount() )
@@ -1797,7 +1803,7 @@ void GtkSalFrame::SetApplicationID( const rtl::OUString &rWMClass )
}
}
-void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
+void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
{
if( m_pWindow && ! isChild() )
{
@@ -1811,7 +1817,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
Size( maGeometry.nWidth, maGeometry.nHeight ) );
bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
Rectangle aNewPosSize;
@@ -1834,11 +1840,11 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
{
if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) )
- gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
+ gtk_window_set_resizable( GTK_WINDOW(m_pWindow), sal_True );
gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) );
}
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
else
{
@@ -1846,7 +1852,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
m_nStyle &= ~SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
createNewWindow( None, false, m_nScreen );
if( ! m_aRestorePosSize.IsEmpty() )
@@ -1860,7 +1866,7 @@ void GtkSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
m_aRestorePosSize = Rectangle();
}
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
}
else
@@ -2029,7 +2035,7 @@ dbus_uninhibit_gsm (guint cookie)
}
#endif
-void GtkSalFrame::StartPresentation( BOOL bStart )
+void GtkSalFrame::StartPresentation( sal_Bool bStart )
{
Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
@@ -2066,11 +2072,11 @@ void GtkSalFrame::StartPresentation( BOOL bStart )
}
}
-void GtkSalFrame::SetAlwaysOnTop( BOOL /*bOnTop*/ )
+void GtkSalFrame::SetAlwaysOnTop( sal_Bool /*bOnTop*/ )
{
}
-void GtkSalFrame::ToTop( USHORT nFlags )
+void GtkSalFrame::ToTop( sal_uInt16 nFlags )
{
if( m_pWindow )
{
@@ -2120,13 +2126,13 @@ void GtkSalFrame::SetPointer( PointerStyle ePointerStyle )
// #i80791# use grabPointer the same way as CaptureMouse, respective float grab
if( getDisplay()->MouseCaptured( this ) )
- grabPointer( TRUE, FALSE );
+ grabPointer( sal_True, sal_False );
else if( m_nFloats > 0 )
- grabPointer( TRUE, TRUE );
+ grabPointer( sal_True, sal_True );
}
}
-void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents )
+void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents )
{
static const char* pEnv = getenv( "SAL_NO_MOUSEGRABS" );
@@ -2188,7 +2194,7 @@ void GtkSalFrame::grabPointer( BOOL bGrab, BOOL bOwnerEvents )
}
}
-void GtkSalFrame::CaptureMouse( BOOL bCapture )
+void GtkSalFrame::CaptureMouse( sal_Bool bCapture )
{
getDisplay()->CaptureMouse( bCapture ? this : NULL );
}
@@ -2233,12 +2239,12 @@ void GtkSalFrame::Sync()
gdk_display_sync( getGdkDisplay() );
}
-String GtkSalFrame::GetSymbolKeyName( const String&, USHORT nKeyCode )
+String GtkSalFrame::GetSymbolKeyName( const String&, sal_uInt16 nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
-String GtkSalFrame::GetKeyName( USHORT nKeyCode )
+String GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
return getDisplay()->GetKeyName( nKeyCode );
}
@@ -2272,7 +2278,7 @@ SalFrame::SalIndicatorState GtkSalFrame::GetIndicatorState()
return aState;
}
-void GtkSalFrame::SimulateKeyPress( USHORT nKeyCode )
+void GtkSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
@@ -2291,16 +2297,16 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext )
m_pIMHandler->setInputContext( pContext );
}
-void GtkSalFrame::EndExtTextInput( USHORT nFlags )
+void GtkSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
if( m_pIMHandler )
m_pIMHandler->endExtTextInput( nFlags );
}
-BOOL GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool GtkSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return FALSE;
+ return sal_False;
}
LanguageType GtkSalFrame::GetInputLanguage()
@@ -2378,7 +2384,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
{
bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow);
if( bWasVisible )
- Show( FALSE );
+ Show( sal_False );
if( nScreen < 0 || nScreen >= getDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2458,7 +2464,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
SetTitle( m_aTitle );
if( bWasVisible )
- Show( TRUE );
+ Show( sal_True );
std::list< GtkSalFrame* > aChildren = m_aChildren;
m_aChildren.clear();
@@ -2482,7 +2488,7 @@ void GtkSalFrame::ResetClipRegion()
gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 );
}
-void GtkSalFrame::BeginSetClipRegion( ULONG )
+void GtkSalFrame::BeginSetClipRegion( sal_uLong )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -2575,7 +2581,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
GdkEventFocus aEvent;
aEvent.type = GDK_FOCUS_CHANGE;
aEvent.window = m_pWindow->window;
- aEvent.send_event = TRUE;
+ aEvent.send_event = sal_True;
aEvent.in = (pEvent->xclient.data.l[1] == 1);
signalFocus( m_pWindow, &aEvent, this );
}
@@ -2629,7 +2635,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
{
GtkSalFrame* pThis = (GtkSalFrame*)frame;
SalMouseEvent aEvent;
- USHORT nEventType = 0;
+ sal_uInt16 nEventType = 0;
switch( pEvent->type )
{
case GDK_BUTTON_PRESS:
@@ -2639,14 +2645,14 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
nEventType = SALEVENT_MOUSEBUTTONUP;
break;
default:
- return FALSE;
+ return sal_False;
}
switch( pEvent->button )
{
case 1: aEvent.mnButton = MOUSE_LEFT; break;
case 2: aEvent.mnButton = MOUSE_MIDDLE; break;
case 3: aEvent.mnButton = MOUSE_RIGHT; break;
- default: return FALSE;
+ default: return sal_False;
}
aEvent.mnTime = pEvent->time;
aEvent.mnX = (long)pEvent->x_root - pThis->maGeometry.nX;
@@ -2714,7 +2720,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
}
}
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame )
@@ -2722,7 +2728,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
GtkSalFrame* pThis = (GtkSalFrame*)frame;
GdkEventScroll* pSEvent = (GdkEventScroll*)pEvent;
- static ULONG nLines = 0;
+ static sal_uLong nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -2734,8 +2740,8 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
bool bNeg = (pSEvent->direction == GDK_SCROLL_DOWN || pSEvent->direction == GDK_SCROLL_RIGHT );
SalWheelMouseEvent aEvent;
aEvent.mnTime = pSEvent->time;
- aEvent.mnX = (ULONG)pSEvent->x;
- aEvent.mnY = (ULONG)pSEvent->y;
+ aEvent.mnX = (sal_uLong)pSEvent->x;
+ aEvent.mnY = (sal_uLong)pSEvent->y;
aEvent.mnDelta = bNeg ? -120 : 120;
aEvent.mnNotchDelta = bNeg ? -1 : 1;
aEvent.mnScrollLines = nLines;
@@ -2750,7 +2756,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer frame )
@@ -2795,7 +2801,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
}
}
- return TRUE;
+ return sal_True;
}
gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpointer frame )
@@ -2811,7 +2817,7 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
GTK_YIELD_GRAB();
pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
- return TRUE;
+ return sal_True;
}
@@ -2824,7 +2830,7 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_PAINT, &aEvent );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer frame )
@@ -2861,7 +2867,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
if( m_nFloats == 0 )
pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, NULL );
- return FALSE;
+ return sal_False;
}
IMPL_LINK( GtkSalFrame, ImplDelayedFullScreenHdl, void*, EMPTYARG )
@@ -2933,7 +2939,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
@@ -2943,7 +2949,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame )
@@ -2963,7 +2969,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
*/
if( (pThis->m_nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) &&
pThis->getDisplay()->GetCaptureFrame() == pThis )
- return FALSE;
+ return sal_False;
// in child case the coordinates are not root coordinates,
@@ -3032,7 +3038,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
else if( bSized )
pThis->CallCallback( SALEVENT_RESIZE, NULL );
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame )
@@ -3044,7 +3050,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pThis->m_pIMHandler )
{
if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
- return TRUE;
+ return sal_True;
}
GTK_YIELD_GRAB();
@@ -3057,7 +3063,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
{
SalKeyModEvent aModEvt;
- USHORT nModCode = GetKeyModCode( pEvent->state );
+ sal_uInt16 nModCode = GetKeyModCode( pEvent->state );
aModEvt.mnModKeyCode = 0; // emit no MODKEYCHANGE events
if( pEvent->type == GDK_KEY_PRESS && !pThis->m_nKeyModifiers )
@@ -3070,8 +3076,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
pThis->m_nKeyModifiers = 0;
}
- USHORT nExtModMask = 0;
- USHORT nModMask = 0;
+ sal_uInt16 nExtModMask = 0;
+ sal_uInt16 nModMask = 0;
// pressing just the ctrl key leads to a keysym of XK_Control but
// the event state does not contain ControlMask. In the release
// event its the other way round: it does contain the Control mask.
@@ -3149,7 +3155,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( !aDel.isDeleted() && pThis->m_pIMHandler )
pThis->m_pIMHandler->updateIMSpotLocation();
- return TRUE;
+ return sal_True;
}
gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
@@ -3159,7 +3165,7 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
pThis->CallCallback( SALEVENT_CLOSE, NULL );
- return TRUE;
+ return sal_True;
}
void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame )
@@ -3198,7 +3204,7 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
{
// signalize theme changed for NWF caches
// FIXME: should be called only once for a style change
- GtkSalGraphics::bThemeChanged = TRUE;
+ GtkSalGraphics::bThemeChanged = sal_True;
}
}
@@ -3226,7 +3232,7 @@ gboolean GtkSalFrame::signalState( GtkWidget*, GdkEvent* pEvent, gpointer frame
}
#endif
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent, gpointer frame )
@@ -3234,7 +3240,7 @@ gboolean GtkSalFrame::signalVisibility( GtkWidget*, GdkEventVisibility* pEvent,
GtkSalFrame* pThis = (GtkSalFrame*)frame;
pThis->m_nVisibility = pEvent->state;
- return FALSE;
+ return sal_False;
}
void GtkSalFrame::signalDestroy( GtkObject* pObj, gpointer frame )
@@ -3324,7 +3330,9 @@ void GtkSalFrame::IMHandler::updateIMSpotLocation()
aArea.y = aPosEvent.mnY;
aArea.width = aPosEvent.mnWidth;
aArea.height = aPosEvent.mnHeight;
+ m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true );
gtk_im_context_set_cursor_location( m_pIMContext, &aArea );
+ m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel();
}
void GtkSalFrame::IMHandler::setInputContext( SalInputContext* )
@@ -3348,7 +3356,7 @@ void GtkSalFrame::IMHandler::sendEmptyCommit()
m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, NULL );
}
-void GtkSalFrame::IMHandler::endExtTextInput( USHORT /*nFlags*/ )
+void GtkSalFrame::IMHandler::endExtTextInput( sal_uInt16 /*nFlags*/ )
{
gtk_im_context_reset ( m_pIMContext );
@@ -3625,7 +3633,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pThis->m_aInputEvent.mnDeltaStart = 0;
pThis->m_aInputEvent.mbOnlyCursor = False;
- pThis->m_aInputFlags = std::vector<USHORT>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
+ pThis->m_aInputFlags = std::vector<sal_uInt16>( std::max( 1, (int)pThis->m_aInputEvent.maText.Len() ), 0 );
PangoAttrIterator *iter = pango_attr_list_get_iterator (pAttrs);
do
@@ -3765,15 +3773,15 @@ gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pCon
sal_uInt32 nPosition = xText->getCaretPosition();
rtl::OUString sAllText = xText->getText();
if (!sAllText.getLength())
- return FALSE;
+ return sal_False;
rtl::OString sUTF = rtl::OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8);
rtl::OUString sCursorText(sAllText, nPosition);
gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(),
rtl::OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength());
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint offset, gint nchars,
@@ -3795,10 +3803,10 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
nDeleteEnd = xText->getCharacterCount();
xText->deleteText(nDeletePos, nDeleteEnd);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index e3d8dd2d2ce0..0853e956b48f 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -40,7 +40,7 @@
#include <plugins/gtk/gtkdata.hxx>
#include <plugins/gtk/gtkinst.hxx>
-GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow )
+GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
: m_pSocket( NULL ),
m_pRegion( NULL )
{
@@ -111,12 +111,12 @@ void GtkSalObject::ResetClipRegion()
gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 );
}
-USHORT GtkSalObject::GetClipRegionType()
+sal_uInt16 GtkSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
-void GtkSalObject::BeginSetClipRegion( ULONG )
+void GtkSalObject::BeginSetClipRegion( sal_uLong )
{
if( m_pRegion )
gdk_region_destroy( m_pRegion );
@@ -151,7 +151,7 @@ void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
}
}
-void GtkSalObject::Show( BOOL bVisible )
+void GtkSalObject::Show( sal_Bool bVisible )
{
if( m_pSocket )
{
@@ -162,7 +162,7 @@ void GtkSalObject::Show( BOOL bVisible )
}
}
-void GtkSalObject::Enable( BOOL )
+void GtkSalObject::Enable( sal_Bool )
{
}
@@ -217,7 +217,7 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
}
}
-void GtkSalObject::SetForwardKey( BOOL bEnable )
+void GtkSalObject::SetForwardKey( sal_Bool bEnable )
{
printf ("GtkSalObject::SetForwardKey\n");
if( bEnable )
@@ -226,4 +226,8 @@ void GtkSalObject::SetForwardKey( BOOL bEnable )
gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) );
}
+void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx
index 39f74e742550..2d8309af5eba 100644
--- a/vcl/unx/headless/svpbmp.cxx
+++ b/vcl/unx/headless/svpbmp.cxx
@@ -44,7 +44,7 @@ SvpSalBitmap::~SvpSalBitmap()
}
bool SvpSalBitmap::Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPalette )
{
sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT;
@@ -112,7 +112,7 @@ bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/,
}
bool SvpSalBitmap::Create( const SalBitmap& /*rSalBmp*/,
- USHORT /*nNewBitCount*/ )
+ sal_uInt16 /*nNewBitCount*/ )
{
return false;
}
@@ -139,9 +139,9 @@ Size SvpSalBitmap::GetSize() const
return aSize;
}
-USHORT SvpSalBitmap::GetBitCount() const
+sal_uInt16 SvpSalBitmap::GetBitCount() const
{
- USHORT nDepth = 0;
+ sal_uInt16 nDepth = 0;
if( m_aBitmap.get() )
nDepth = getBitCountFromScanlineFormat( m_aBitmap->getScanlineFormat() );
return nDepth;
@@ -153,7 +153,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
if( m_aBitmap.get() )
{
pBuf = new BitmapBuffer();
- USHORT nBitCount = 1;
+ sal_uInt16 nBitCount = 1;
switch( m_aBitmap->getScanlineFormat() )
{
case Format::ONE_BIT_MSB_GREY:
@@ -222,7 +222,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool )
pBuf->mnHeight = aSize.getY();
pBuf->mnScanlineSize = m_aBitmap->getScanlineStride();
pBuf->mnBitCount = nBitCount;
- pBuf->mpBits = (BYTE*)m_aBitmap->getBuffer().get();
+ pBuf->mpBits = (sal_uInt8*)m_aBitmap->getBuffer().get();
if( nBitCount <= 8 )
{
if( m_aBitmap->getScanlineFormat() == Format::EIGHT_BIT_GREY ||
@@ -261,7 +261,7 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
{
// palette might have changed, clone device (but recycle
// memory)
- USHORT nBitCount = 0;
+ sal_uInt16 nBitCount = 0;
switch( m_aBitmap->getScanlineFormat() )
{
case Format::ONE_BIT_MSB_GREY:
diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx
index 5ce5f5bff770..695d7226b0f0 100644
--- a/vcl/unx/headless/svpbmp.hxx
+++ b/vcl/unx/headless/svpbmp.hxx
@@ -47,19 +47,19 @@ public:
// SalBitmap
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmp );
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount );
+ sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
virtual void Destroy();
virtual Size GetSize() const;
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx
index 37c92faf92c9..3bf1a4da9cc0 100644
--- a/vcl/unx/headless/svpdummies.cxx
+++ b/vcl/unx/headless/svpdummies.cxx
@@ -51,17 +51,18 @@ SvpSalObject::~SvpSalObject()
}
void SvpSalObject::ResetClipRegion() {}
-USHORT SvpSalObject::GetClipRegionType() { return 0; }
-void SvpSalObject::BeginSetClipRegion( ULONG ) {}
+sal_uInt16 SvpSalObject::GetClipRegionType() { return 0; }
+void SvpSalObject::BeginSetClipRegion( sal_uLong ) {}
void SvpSalObject::UnionClipRegion( long, long, long, long ) {}
void SvpSalObject::EndSetClipRegion() {}
void SvpSalObject::SetPosSize( long, long, long, long ) {}
-void SvpSalObject::Show( BOOL ) {}
-void SvpSalObject::Enable( BOOL ) {}
+void SvpSalObject::Show( sal_Bool ) {}
+void SvpSalObject::Enable( sal_Bool ) {}
void SvpSalObject::GrabFocus() {}
void SvpSalObject::SetBackground() {}
void SvpSalObject::SetBackground( SalColor ) {}
const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; }
+void SvpSalObject::InterceptChildWindowKeyDown( sal_Bool ) {}
// SalI18NImeStatus
SvpImeStatus::~SvpImeStatus() {}
diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx
index 98cf2f5ebb92..86a9382adb96 100644
--- a/vcl/unx/headless/svpdummies.hxx
+++ b/vcl/unx/headless/svpdummies.hxx
@@ -45,20 +45,22 @@ public:
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
class SvpImeStatus : public SalI18NImeStatus
diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx
index ab86c3d851b2..1b8455557fac 100644
--- a/vcl/unx/headless/svpframe.cxx
+++ b/vcl/unx/headless/svpframe.cxx
@@ -40,7 +40,7 @@ SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL;
SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- ULONG nSalFrameStyle,
+ sal_uLong nSalFrameStyle,
SystemParentData* ) :
m_pInstance( pInstance ),
m_pParent( static_cast<SvpSalFrame*>(pParent) ),
@@ -147,10 +147,10 @@ void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
delete pSvpGraphics;
}
-BOOL SvpSalFrame::PostEvent( void* pData )
+sal_Bool SvpSalFrame::PostEvent( void* pData )
{
m_pInstance->PostEvent( this, pData, SALEVENT_USEREVENT );
- return TRUE;
+ return sal_True;
}
void SvpSalFrame::PostPaint() const
@@ -166,7 +166,7 @@ void SvpSalFrame::SetTitle( const XubString& )
{
}
-void SvpSalFrame::SetIcon( USHORT )
+void SvpSalFrame::SetIcon( sal_uInt16 )
{
}
@@ -182,7 +182,7 @@ void SvpSalFrame::SetExtendedFrameStyle( SalExtStyle )
{
}
-void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void SvpSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( bVisible && ! m_bVisible )
{
@@ -199,7 +199,7 @@ void SvpSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
}
-void SvpSalFrame::Enable( BOOL )
+void SvpSalFrame::Enable( sal_Bool )
{
}
@@ -215,7 +215,7 @@ void SvpSalFrame::SetMaxClientSize( long nWidth, long nHeight )
m_nMaxHeight = nHeight;
}
-void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( (nFlags & SAL_FRAME_POSSIZE_X) != 0 )
maGeometry.nX = nX;
@@ -312,7 +312,7 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState )
}
}
-BOOL SvpSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool SvpSalFrame::GetWindowState( SalFrameState* pState )
{
pState->mnState = SAL_FRAMESTATE_NORMAL;
pState->mnX = maGeometry.nX;
@@ -321,24 +321,24 @@ BOOL SvpSalFrame::GetWindowState( SalFrameState* pState )
pState->mnHeight = maGeometry.nHeight;
pState->mnMask = _FRAMESTATE_MASK_GEOMETRY | SAL_FRAMESTATE_MASK_STATE;
- return TRUE;
+ return sal_True;
}
-void SvpSalFrame::ShowFullScreen( BOOL, sal_Int32 )
+void SvpSalFrame::ShowFullScreen( sal_Bool, sal_Int32 )
{
SetPosSize( 0, 0, VIRTUAL_DESKTOP_WIDTH, VIRTUAL_DESKTOP_HEIGHT,
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
-void SvpSalFrame::StartPresentation( BOOL )
+void SvpSalFrame::StartPresentation( sal_Bool )
{
}
-void SvpSalFrame::SetAlwaysOnTop( BOOL )
+void SvpSalFrame::SetAlwaysOnTop( sal_Bool )
{
}
-void SvpSalFrame::ToTop( USHORT )
+void SvpSalFrame::ToTop( sal_uInt16 )
{
GetFocus();
}
@@ -347,7 +347,7 @@ void SvpSalFrame::SetPointer( PointerStyle )
{
}
-void SvpSalFrame::CaptureMouse( BOOL )
+void SvpSalFrame::CaptureMouse( sal_Bool )
{
}
@@ -367,23 +367,23 @@ void SvpSalFrame::SetInputContext( SalInputContext* )
{
}
-void SvpSalFrame::EndExtTextInput( USHORT )
+void SvpSalFrame::EndExtTextInput( sal_uInt16 )
{
}
-String SvpSalFrame::GetKeyName( USHORT )
+String SvpSalFrame::GetKeyName( sal_uInt16 )
{
return String();
}
-String SvpSalFrame::GetSymbolKeyName( const XubString&, USHORT )
+String SvpSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 )
{
return String();
}
-BOOL SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
+sal_Bool SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, KeyCode& )
{
- return FALSE;
+ return sal_False;
}
LanguageType SvpSalFrame::GetInputLanguage()
@@ -423,7 +423,7 @@ SalFrame::SalIndicatorState SvpSalFrame::GetIndicatorState()
return aState;
}
-void SvpSalFrame::SimulateKeyPress( USHORT /*nKeyCode*/ )
+void SvpSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
{
}
@@ -447,7 +447,7 @@ void SvpSalFrame::ResetClipRegion()
{
}
-void SvpSalFrame::BeginSetClipRegion( ULONG )
+void SvpSalFrame::BeginSetClipRegion( sal_uLong )
{
}
diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx
index a552eff871b4..be160626957a 100644
--- a/vcl/unx/headless/svpframe.hxx
+++ b/vcl/unx/headless/svpframe.hxx
@@ -41,9 +41,9 @@ class SvpSalGraphics;
class SvpSalFrame : public SalFrame, public SvpElement
{
SvpSalInstance* m_pInstance;
- SvpSalFrame* m_pParent; // pointer to parent frame
+ SvpSalFrame* m_pParent; // pointer to parent frame
std::list< SvpSalFrame* > m_aChildren; // List of child frames
- ULONG m_nStyle;
+ sal_uLong m_nStyle;
bool m_bVisible;
long m_nMinWidth;
long m_nMinHeight;
@@ -59,7 +59,7 @@ class SvpSalFrame : public SalFrame, public SvpElement
public:
SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
- ULONG nSalFrameStyle,
+ sal_uLong nSalFrameStyle,
SystemParentData* pSystemParent = NULL );
virtual ~SvpSalFrame();
@@ -74,39 +74,39 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -114,12 +114,12 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 9f4df0d29775..8c9a4e42a65a 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -30,6 +30,7 @@
#include "svpbmp.hxx"
#include <vcl/sysdata.hxx>
+#include <vcl/region.h>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -132,7 +133,7 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIX = rDPIY = 96;
}
-USHORT SvpSalGraphics::GetBitCount() const
+sal_uInt16 SvpSalGraphics::GetBitCount() const
{
return SvpElement::getBitCountFromScanlineFormat( m_aDevice->getScanlineFormat() );
}
@@ -153,11 +154,16 @@ void SvpSalGraphics::ResetClipRegion()
m_aClipMap.reset();
}
-void SvpSalGraphics::BeginSetClipRegion( ULONG n )
+bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
{
- if( n <= 1 )
+ if( i_rClip.IsEmpty() )
+ m_aClipMap.reset();
+ else if( i_rClip.GetRectCount() == 1 )
{
m_aClipMap.reset();
+ Rectangle aBoundRect( i_rClip.GetBoundRect() );
+ m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
+ basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) );
}
else
{
@@ -165,34 +171,22 @@ void SvpSalGraphics::BeginSetClipRegion( ULONG n )
B2IVector aSize = m_aDevice->getSize();
m_aClipMap = createBitmapDevice( aSize, false, Format::ONE_BIT_MSB_GREY );
m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) );
- }
-}
-BOOL SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( m_aClipMap )
- {
- B2DPolyPolygon aFull;
- aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ) );
- m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
- }
- else
- {
- m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
- basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) );
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ B2DPolyPolygon aFull;
+ aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nW, nY+nH ) ) );
+ m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
}
-
- return TRUE;
-}
-
-bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void SvpSalGraphics::EndSetClipRegion()
-{
+ return true;
}
void SvpSalGraphics::SetLineColor()
@@ -310,13 +304,13 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( m_bUseLineColor && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
aPoly.setClosed( false );
m_aDevice->drawPolygon( aPoly, m_aLineColor, m_aDrawMode, m_aClipMap );
@@ -324,13 +318,13 @@ void SvpSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
dbgOut( m_aDevice );
}
-void SvpSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void SvpSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( ( m_bUseLineColor || m_bUseFillColor ) && nPoints )
{
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
if( m_bUseFillColor )
{
@@ -361,7 +355,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
PCONSTSALPOINT pPoints = pPtAry[nPolygon];
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPoints->mnX, pPoints->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uInt32 i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPoints[i].mnX, pPoints[i].mnY ) );
aPolyPoly.append( aPoly );
@@ -389,16 +383,16 @@ bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTrans
return false;
}
-sal_Bool SvpSalGraphics::drawPolyLineBezier( ULONG,
+sal_Bool SvpSalGraphics::drawPolyLineBezier( sal_uLong,
const SalPoint*,
- const BYTE* )
+ const sal_uInt8* )
{
return sal_False;
}
-sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG,
+sal_Bool SvpSalGraphics::drawPolygonBezier( sal_uLong,
const SalPoint*,
- const BYTE* )
+ const sal_uInt8* )
{
return sal_False;
}
@@ -406,7 +400,7 @@ sal_Bool SvpSalGraphics::drawPolygonBezier( ULONG,
sal_Bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32,
const sal_uInt32*,
const SalPoint* const*,
- const BYTE* const* )
+ const sal_uInt8* const* )
{
return sal_False;
}
@@ -423,7 +417,7 @@ void SvpSalGraphics::copyArea( long nDestX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT /*nFlags*/ )
+ sal_uInt16 /*nFlags*/ )
{
B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
@@ -539,21 +533,21 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
dbgOut( m_aDevice );
}
-void SvpSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ )
+void SvpSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert /*nFlags*/ )
{
// FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME
B2DPolygon aPoly;
aPoly.append( B2DPoint( pPtAry->mnX, pPtAry->mnY ), nPoints );
- for( ULONG i = 1; i < nPoints; i++ )
+ for( sal_uLong i = 1; i < nPoints; i++ )
aPoly.setB2DPoint( i, B2DPoint( pPtAry[i].mnX, pPtAry[i].mnY ) );
aPoly.setClosed( true );
m_aDevice->fillPolyPolygon( B2DPolyPolygon(aPoly), basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap );
dbgOut( m_aDevice );
}
-BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG )
+sal_Bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
{
- return FALSE;
+ return sal_False;
}
SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index b385d3f35b45..0489606e9fce 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -65,20 +65,17 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
virtual void SetFillColor();
- virtual void SetFillColor( SalColor nSalColor );
+ virtual void SetFillColor( SalColor nSalColor );
virtual void SetXORMode( bool bSet, bool );
@@ -86,15 +83,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -113,8 +110,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -124,21 +121,21 @@ public:
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
@@ -146,7 +143,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -163,9 +160,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index 10faf81434ba..f4fe1dbdc649 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -39,7 +39,7 @@
#include <vcl/salframe.hxx>
#include <vcl/svdata.hxx>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <vcl/saldatabasic.hxx>
#include <vcl/solarmutex.hxx>
#include <sal/types.h>
@@ -124,7 +124,7 @@ SvpSalInstance::~SvpSalInstance()
osl_destroyMutex( m_aEventGuard );
}
-void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent )
+void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( m_aEventGuard ) )
{
@@ -134,7 +134,7 @@ void SvpSalInstance::PostEvent( const SalFrame* pFrame, void* pData, USHORT nEve
Wakeup();
}
-void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent )
+void SvpSalInstance::CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( m_aEventGuard ) )
{
@@ -194,7 +194,7 @@ inline int operator >= ( const timeval &t1, const timeval &t2 )
return t1.tv_usec >= t2.tv_usec;
return t1.tv_sec > t2.tv_sec;
}
-inline timeval &operator += ( timeval &t1, ULONG t2 )
+inline timeval &operator += ( timeval &t1, sal_uLong t2 )
{
t1.tv_sec += t2 / 1000;
t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500;
@@ -237,12 +237,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
return bRet;
}
-SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, ULONG nStyle )
+SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle )
{
return new SvpSalFrame( this, NULL, nStyle, pParent );
}
-SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, ULONG nStyle )
+SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle )
{
return new SvpSalFrame( this, pParent, nStyle );
}
@@ -252,7 +252,7 @@ void SvpSalInstance::DestroyFrame( SalFrame* pFrame )
delete pFrame;
}
-SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, BOOL )
+SalObject* SvpSalInstance::CreateObject( SalFrame*, SystemWindowData*, sal_Bool )
{
return new SvpSalObject();
}
@@ -264,7 +264,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
SalVirtualDevice* SvpSalInstance::CreateVirtualDevice( SalGraphics*,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData* )
+ sal_uInt16 nBitCount, const SystemGraphicsData* )
{
SvpSalVirtualDevice* pNew = new SvpSalVirtualDevice( nBitCount );
pNew->SetSize( nDX, nDY );
@@ -301,13 +301,13 @@ osl::SolarMutex* SvpSalInstance::GetYieldMutex()
return &m_aYieldMutex;
}
-ULONG SvpSalInstance::ReleaseYieldMutex()
+sal_uLong SvpSalInstance::ReleaseYieldMutex()
{
if ( m_aYieldMutex.GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = m_aYieldMutex.GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = m_aYieldMutex.GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
m_aYieldMutex.release();
@@ -320,7 +320,7 @@ ULONG SvpSalInstance::ReleaseYieldMutex()
return 0;
}
-void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
+void SvpSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
while ( nCount )
{
@@ -329,13 +329,25 @@ void SvpSalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+bool SvpSalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ if ( m_aYieldMutex.GetThreadId() != ::osl::Thread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{
// first, check for already queued events.
// release yield mutex
std::list< SalUserEvent > aEvents;
- ULONG nAcquireCount = ReleaseYieldMutex();
+ sal_uLong nAcquireCount = ReleaseYieldMutex();
if( osl_acquireMutex( m_aEventGuard ) )
{
if( ! m_aUserEvents.empty() )
@@ -414,31 +426,13 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
}
}
-bool SvpSalInstance::AnyInput( USHORT nType )
+bool SvpSalInstance::AnyInput( sal_uInt16 nType )
{
if( (nType & INPUT_TIMER) != 0 )
return CheckTimeout( false );
return false;
}
-SalMenu* SvpSalInstance::CreateMenu( BOOL )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenu( SalMenu* )
-{
-}
-
-SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL;
-}
-
-void SvpSalInstance::DestroyMenuItem( SalMenuItem* )
-{
-}
-
SalSession* SvpSalInstance::CreateSalSession()
{
return NULL;
@@ -504,7 +498,7 @@ void SvpSalInstance::StopTimer()
m_nTimeoutMS = 0;
}
-void SvpSalInstance::StartTimer( ULONG nMS )
+void SvpSalInstance::StartTimer( sal_uLong nMS )
{
timeval Timeout (m_aTimeout); // previous timeout.
gettimeofday (&m_aTimeout, 0);
@@ -532,7 +526,7 @@ void SvpSalTimer::Stop()
m_pInstance->StopTimer();
}
-void SvpSalTimer::Start( ULONG nMS )
+void SvpSalTimer::Start( sal_uLong nMS )
{
m_pInstance->StartTimer( nMS );
}
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index 622eda072e41..eaffc99978d6 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -52,7 +52,7 @@
class SvpSalYieldMutex : public ::vcl::SolarMutexObject
{
protected:
- ULONG mnCount;
+ sal_uLong mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -62,7 +62,7 @@ public:
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uLong GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -78,7 +78,7 @@ public:
virtual ~SvpSalTimer();
// overload all pure virtual methods
- virtual void Start( ULONG nMS );
+ virtual void Start( sal_uLong nMS );
virtual void Stop();
};
@@ -89,7 +89,7 @@ class SvpSalFrame;
class SvpSalInstance : public SalInstance
{
timeval m_aTimeout;
- ULONG m_nTimeoutMS;
+ sal_uLong m_nTimeoutMS;
int m_pTimeoutFDS[2];
SvpSalYieldMutex m_aYieldMutex;
@@ -98,9 +98,9 @@ class SvpSalInstance : public SalInstance
{
const SalFrame* m_pFrame;
void* m_pData;
- USHORT m_nEvent;
+ sal_uInt16 m_nEvent;
- SalUserEvent( const SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -120,10 +120,10 @@ public:
SvpSalInstance();
virtual ~SvpSalInstance();
- void PostEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
- void CancelEvent( const SalFrame* pFrame, void* pData, USHORT nEvent );
+ void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
+ void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
- void StartTimer( ULONG nMS );
+ void StartTimer( sal_uLong nMS );
void StopTimer();
void Wakeup();
@@ -134,12 +134,12 @@ public:
bool CheckTimeout( bool bExecuteTimers = true );
// Frame
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
// Object (System Child Window)
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
// VirtualDevice
@@ -148,7 +148,7 @@ public:
// pData allows for using a system dependent graphics or device context
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
// Printer
@@ -177,20 +177,15 @@ public:
// YieldMutex
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uLong ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uLong nCount );
+ virtual bool CheckYieldMutex();
// wait next event and dispatch
// must returned by UserEvent (SalFrame::PostEvent)
// and timer
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
-
- // Menues
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
+ virtual bool AnyInput( sal_uInt16 nType );
// may return NULL to disable session management
virtual SalSession* CreateSalSession();
diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx
index dbbfdd8e312e..35ca451e432c 100644
--- a/vcl/unx/headless/svpprn.cxx
+++ b/vcl/unx/headless/svpprn.cxx
@@ -162,7 +162,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
}
else
{
@@ -302,9 +302,9 @@ String SvpSalInstance::GetDefaultPrinter()
// -----------------------------------------------------------------------
-BOOL SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
+sal_Bool SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
{
- return FALSE;
+ return sal_False;
}
/*
diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx
index 17a1d32915d9..52e8fbad4f54 100644
--- a/vcl/unx/headless/svpprn.hxx
+++ b/vcl/unx/headless/svpprn.hxx
@@ -40,7 +40,7 @@ class PspGraphics;
class SvpSalInfoPrinter : public PspSalInfoPrinter
{
public:
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
};
class SvpSalPrinter : public PspSalPrinter
@@ -48,8 +48,8 @@ class SvpSalPrinter : public PspSalPrinter
public:
SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {}
- virtual BOOL StartJob( const XubString* pFileName, const XubString& rJobName,
- const XubString& rAppName, ULONG nCopies, bool bCollate,
+ virtual sal_Bool StartJob( const XubString* pFileName, const XubString& rJobName,
+ const XubString& rAppName, sal_uLong nCopies, bool bCollate,
bool /*bDirect*/, ImplJobSetup* pSetupData )
{
return SvpSalPrinter::StartJob( pFileName, rJobName, rAppName, nCopies, bCollate, false, pSetupData );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index cc2e2c9e20ac..7200019db9d2 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -44,6 +44,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include "basegfx/vector/b2ivector.hxx"
#include "basegfx/point/b2ipoint.hxx"
@@ -205,7 +206,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-USHORT PspGraphics::GetBitCount() const
+sal_uInt16 PspGraphics::GetBitCount() const
{
return m_pPrinterGfx->GetBitCount();
}
@@ -217,28 +218,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( ULONG n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
-
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
@@ -306,12 +306,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
@@ -330,13 +330,13 @@ bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTranspar
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -345,10 +345,10 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry )
+ const sal_uInt8* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
return sal_True;
}
@@ -358,13 +358,13 @@ bool PspGraphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double /*fTra
return false;
}
-void PspGraphics::invert( ULONG /*nPoints*/,
+void PspGraphics::invert( sal_uLong /*nPoints*/,
const SalPoint* /*pPtAry*/,
SalInvert /*nFlags*/ )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -378,7 +378,7 @@ void PspGraphics::copyBits( const SalTwoRect* /*pPosAry*/,
void PspGraphics::copyArea ( long /*nDestX*/, long /*nDestY*/,
long /*nSrcX*/, long /*nSrcY*/,
long /*nSrcWidth*/, long /*nSrcHeight*/,
- USHORT /*nFlags*/ )
+ sal_uInt16 /*nFlags*/ )
{
OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
}
@@ -684,16 +684,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -703,7 +700,7 @@ bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabiliti
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
}
-USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -828,10 +825,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
}
}
-ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- ULONG nHavePairs = rPairs.size();
+ sal_uLong nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -850,38 +847,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
return nHavePairs;
}
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -906,7 +903,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-BOOL PspGraphics::CreateFontSubset(
+sal_Bool PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1292,9 +1289,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- USHORT nPos;
- USHORT nStart = 0;
- USHORT nStop = rLen;
+ sal_uInt16 nPos;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nStop = rLen;
String aPhone = rOrig.Copy( nIndex, rLen );
if( ! m_bPhoneCollectionActive )
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 676e86b32f20..78f36f85295e 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -87,14 +87,11 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -105,15 +102,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -132,8 +129,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -141,23 +138,23 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uLong nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
@@ -165,7 +162,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -182,9 +179,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
virtual SystemGraphicsData GetGraphicsData() const;
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index 07e6497d839a..18e2f4af8c90 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -203,7 +203,7 @@ void PspKernInfo::Initialize() const
// ===========================================================================
-USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
+sal_uInt16 SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
{
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -253,15 +253,15 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
// ---------------------------------------------------------------------------
-ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
- ULONG nGotPairs = 0;
+ sal_uLong nGotPairs = 0;
if( m_pServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs = NULL;
nGotPairs = m_pServerFont[0]->GetKernPairs( &pTmpKernPairs );
- for( ULONG i = 0; i < nPairs && i < nGotPairs; ++i )
+ for( sal_uLong i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
}
@@ -271,15 +271,13 @@ ULONG SvpSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// ---------------------------------------------------------------------------
-ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
{
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool SvpSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -348,7 +346,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*,
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::CreateFontSubset(
+sal_Bool SvpSalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -431,39 +429,39 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
-BOOL SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
+sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
const ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
// ---------------------------------------------------------------------------
diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx
index 2bf9894a1e23..8477da7b3bfc 100644
--- a/vcl/unx/headless/svpvd.cxx
+++ b/vcl/unx/headless/svpvd.cxx
@@ -55,7 +55,7 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
delete pGraphics;
}
-BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
+sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
{
B2IVector aDevSize( nNewDX, nNewDY );
if( aDevSize.getX() == 0 )
diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx
index b30b83642293..c6dde57abd38 100644
--- a/vcl/unx/headless/svpvd.hxx
+++ b/vcl/unx/headless/svpvd.hxx
@@ -38,12 +38,12 @@ class SvpSalGraphics;
class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement
{
- USHORT m_nBitCount;
+ sal_uInt16 m_nBitCount;
basebmp::BitmapDeviceSharedPtr m_aDevice;
std::list< SvpSalGraphics* > m_aGraphics;
public:
- SvpSalVirtualDevice( USHORT nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
+ SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {}
virtual ~SvpSalVirtualDevice();
// SvpElement
@@ -53,7 +53,7 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx
index b6f7aa4b9350..010a0417d89b 100644
--- a/vcl/unx/inc/dtint.hxx
+++ b/vcl/unx/inc/dtint.hxx
@@ -32,19 +32,12 @@
#include <tools/string.hxx>
#include <tools/color.hxx>
#include <vcl/font.hxx>
+#include "svunx.h"
class SalBitmap;
class SalDisplay;
class AllSettings;
-#if !defined(_XLIB_H_) && !defined(_X11_XLIB_H_)
-// forwards from X
-struct Display;
-struct XEvent;
-#define Atom UINT32
-#define XLIB_Window UINT32
-#endif
-
enum DtType {
DtGeneric,
DtCDE
diff --git a/vcl/unx/inc/i18n_cb.hxx b/vcl/unx/inc/i18n_cb.hxx
index 358538390a8d..22aee5aeb41a 100644
--- a/vcl/unx/inc/i18n_cb.hxx
+++ b/vcl/unx/inc/i18n_cb.hxx
@@ -90,7 +90,7 @@ typedef struct {
preedit_status_t eState;
preedit_text_t aText;
SalExtTextInputEvent aInputEv;
- std::vector< USHORT > aInputFlags;
+ std::vector< sal_uInt16 > aInputFlags;
} preedit_data_t;
#endif /* _SAL_I18N_CALLBACK_HXX */
diff --git a/vcl/unx/inc/i18n_ic.hxx b/vcl/unx/inc/i18n_ic.hxx
index e7382ef6ebd8..b038d179f4a2 100644
--- a/vcl/unx/inc/i18n_ic.hxx
+++ b/vcl/unx/inc/i18n_ic.hxx
@@ -76,7 +76,7 @@ public:
void HandleDestroyIM();
int HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused
- void EndExtTextInput( USHORT nFlags ); // unused
+ void EndExtTextInput( sal_uInt16 nFlags ); // unused
int CommitStringCallback( sal_Unicode* pText, sal_Size nLength );
int CommitKeyEvent( sal_Unicode* pText, sal_Size nLength );
int UpdateSpotLocation();
diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx
index cca69a3de223..92931ec6353e 100644
--- a/vcl/unx/inc/i18n_im.hxx
+++ b/vcl/unx/inc/i18n_im.hxx
@@ -57,10 +57,6 @@ public:
Bool FilterEvent( XEvent *pEvent, XLIB_Window window );
Bool AddConnectionWatch (Display *pDisplay, void *pConnectionHandler);
- #ifdef _USE_PRINT_EXTENSION_
- void Invalidate() { mbUseable = False; }
- #endif
-
SalI18N_InputMethod();
~SalI18N_InputMethod();
};
diff --git a/vcl/unx/inc/kde_headers.h b/vcl/unx/inc/kde_headers.h
new file mode 100644
index 000000000000..7ec45fdc383d
--- /dev/null
+++ b/vcl/unx/inc/kde_headers.h
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_VCL_KDE_HEADERS_H
+#define INCLUDED_VCL_KDE_HEADERS_H
+
+/* ********* Suppress warnings if needed */
+#include "sal/config.h"
+
+#include <cstddef>
+
+#if defined __GNUC__
+#pragma GCC system_header
+#endif
+
+
+/* ********* Hack, but needed because of conflicting types... */
+#define Region QtXRegion
+
+
+/* ********* Qt headers */
+#include <qaccessible.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qfont.h>
+#include <qframe.h>
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qmainwindow.h>
+#include <qmenudata.h>
+#include <qpaintdevice.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qrangecontrol.h>
+#include <qstring.h>
+#include <qtabbar.h>
+#include <qtabwidget.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qwidget.h>
+#include <qprogressbar.h>
+
+/* ********* See hack on top of this file */
+#undef Region
+
+
+/* ********* KDE base headers */
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kemailsettings.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kmenubar.h>
+#include <kprotocolmanager.h>
+#include <kstartupinfo.h>
+#include <kstyle.h>
+
+
+/* ********* KDE address book connectivity headers */
+#include <kabc/addressbook.h>
+#include <kabc/addressee.h>
+#include <kabc/field.h>
+#include <kabc/stdaddressbook.h>
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index 4f02ea7c5ecf..e4a1bb5e9527 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -60,6 +60,8 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
+ std::vector< int > m_aXineramaScreenIndexMap;
+
GdkCursor* getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
public:
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index f63f02bcda0f..010844ec3c78 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -136,7 +136,7 @@ class GtkSalFrame : public SalFrame
bool m_bFocused;
bool m_bPreeditJustChanged;
SalExtTextInputEvent m_aInputEvent;
- std::vector< USHORT > m_aInputFlags;
+ std::vector< sal_uInt16 > m_aInputFlags;
IMHandler( GtkSalFrame* );
~IMHandler();
@@ -145,7 +145,7 @@ class GtkSalFrame : public SalFrame
void deleteIMContext();
void updateIMSpotLocation();
void setInputContext( SalInputContext* pContext );
- void endExtTextInput( USHORT nFlags );
+ void endExtTextInput( sal_uInt16 nFlags );
bool handleKeyEvent( GdkEventKey* pEvent );
void focusChanged( bool bFocusIn );
@@ -169,7 +169,7 @@ class GtkSalFrame : public SalFrame
GdkWindow* m_pForeignTopLevel;
GdkNativeWindow m_aForeignTopLevelWindow;
Pixmap m_hBackgroundPixmap;
- ULONG m_nStyle;
+ sal_uLong m_nStyle;
SalExtStyle m_nExtStyle;
GtkFixed* m_pFixedContainer;
GtkSalFrame* m_pParent;
@@ -177,7 +177,7 @@ class GtkSalFrame : public SalFrame
GdkWindowState m_nState;
SystemEnvData m_aSystemData;
GraphicsHolder m_aGraphics[ nMaxGraphics ];
- USHORT m_nKeyModifiers;
+ sal_uInt16 m_nKeyModifiers;
GdkCursor *m_pCurrentCursor;
GdkVisibilityState m_nVisibility;
PointerStyle m_ePointerStyle;
@@ -201,7 +201,7 @@ class GtkSalFrame : public SalFrame
GdkRegion* m_pRegion;
- void Init( SalFrame* pParent, ULONG nStyle );
+ void Init( SalFrame* pParent, sal_uLong nStyle );
void Init( SystemParentData* pSysData );
void InitCommon();
@@ -253,7 +253,7 @@ class GtkSalFrame : public SalFrame
bool isChild( bool bPlug = true, bool bSysChild = true )
{
- ULONG nMask = 0;
+ sal_uLong nMask = 0;
if( bPlug )
nMask |= SAL_FRAME_STYLE_PLUG;
if( bSysChild )
@@ -274,14 +274,14 @@ class GtkSalFrame : public SalFrame
DECL_LINK( ImplDelayedFullScreenHdl, void* );
public:
- GtkSalFrame( SalFrame* pParent, ULONG nStyle );
+ GtkSalFrame( SalFrame* pParent, sal_uLong nStyle );
GtkSalFrame( SystemParentData* pSysData );
// dispatches an event, returns true if dispatched
// and false else; if true was returned the event should
// be swallowed
bool Dispatch( const XEvent* pEvent );
- void grabPointer( BOOL bGrab, BOOL bOwnerEvents = FALSE );
+ void grabPointer( sal_Bool bGrab, sal_Bool bOwnerEvents = sal_False );
GtkSalDisplay* getDisplay();
GdkDisplay* getGdkDisplay();
@@ -308,41 +308,41 @@ public:
// Event must be destroyed, when Frame is destroyed
// When Event is called, SalInstance::Yield() must be returned
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu *pSalMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
// Before the window is visible, a resize event
// must be sent with the correct size
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
// Set ClientSize and Center the Window to the desktop
// and send/post a resize message
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
// Enable/Disable ScreenSaver, SystemAgents, ...
- virtual void StartPresentation( BOOL bStart );
+ virtual void StartPresentation( sal_Bool bStart );
// Show Window over all other Windows
- virtual void SetAlwaysOnTop( BOOL bOnTop );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
// Window to top and grab focus
- virtual void ToTop( USHORT nFlags );
+ virtual void ToTop( sal_uInt16 nFlags );
// this function can call with the same
// pointer style
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
// flush output buffer
@@ -352,11 +352,11 @@ public:
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
// returns the input language used for the last key stroke
// may be LANGUAGE_DONTKNOW if not supported by the OS
@@ -377,7 +377,7 @@ public:
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
// set new parent window
virtual void SetParent( SalFrame* pNewParent );
@@ -395,7 +395,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uLong nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 209ba99cd875..4f7d66712ac7 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -56,34 +56,31 @@ public:
// will be set when UI theme was changed
- static BOOL bThemeChanged;
- static BOOL bNeedPixmapPaint;
- static BOOL bGlobalNeedPixmapPaint;
- static BOOL bToolbarGripWorkaround;
- static BOOL bNeedButtonStyleAsEditBackgroundWorkaround;
+ static sal_Bool bThemeChanged;
+ static sal_Bool bNeedPixmapPaint;
+ static sal_Bool bGlobalNeedPixmapPaint;
+ static sal_Bool bToolbarGripWorkaround;
+ static sal_Bool bNeedButtonStyleAsEditBackgroundWorkaround;
// native widget methods
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& rCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
//helper methods for frame's UpdateSettings
void updateSettings( AllSettings& rSettings );
+ virtual bool setClipRegion( const Region& );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
// some themes set the background pixmap of our window EVERY time
// a control is painted; but presentation effects need
@@ -96,93 +93,89 @@ protected:
typedef std::list< Rectangle > clipList;
GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
- BOOL NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
+ sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
- BOOL NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKButton( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKRadio( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKCheck( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKEditBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKTabItem( ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKMenubar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKPopupMenu( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKTooltip( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKProgress( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKSlider( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ sal_Bool NWPaintGTKListNode( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
-
- BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue& aValue,
- const rtl::OUString& rCaption );
};
#endif // _VCL_GTKGDI_HXX
diff --git a/vcl/unx/inc/plugins/gtk/gtkinst.hxx b/vcl/unx/inc/plugins/gtk/gtkinst.hxx
index 325bf54f7998..07549776e9cf 100644
--- a/vcl/unx/inc/plugins/gtk/gtkinst.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkinst.hxx
@@ -64,7 +64,7 @@ class GtkHookedYieldMutex : public GtkYieldMutex
{
virtual int Grab() { return 0; };
virtual void Ungrab(int ) {};
- std::list<ULONG> aYieldStack;
+ std::list<sal_uLong> aYieldStack;
public:
GtkHookedYieldMutex();
virtual void acquire();
@@ -85,9 +85,9 @@ public:
{}
virtual ~GtkInstance();
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual SalSystem* CreateSalSystem();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
};
diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
index 143f9a2d19a9..72b33b0e5c3b 100644
--- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
@@ -45,28 +45,29 @@ class GtkSalObject : public SalObject
static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
static void signalDestroy( GtkObject*, gpointer );
public:
- GtkSalObject( GtkSalFrame* pParent, BOOL bShow = TRUE );
+ GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow = sal_True );
virtual ~GtkSalObject();
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uLong nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
- virtual void SetForwardKey( BOOL bEnable );
+ virtual void SetForwardKey( sal_Bool bEnable );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx
index 458685ea58b0..9125b33f1b20 100644
--- a/vcl/unx/inc/plugins/kde/kdedata.hxx
+++ b/vcl/unx/inc/plugins/kde/kdedata.hxx
@@ -68,14 +68,14 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, ULONG nStyle );
+ KDESalFrame( SalFrame* pParent, sal_uLong );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
- virtual void Show( BOOL bVisible, BOOL bNoActivate );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate );
};
class KDESalInstance : public X11SalInstance
@@ -84,7 +84,7 @@ public:
KDESalInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
};
class KDEXLib : public SalXLib
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 1c7c3d51a785..80d1f5fb92cc 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -84,14 +84,11 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -102,15 +99,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -129,8 +126,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -138,30 +135,30 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin);
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -178,9 +175,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
virtual bool drawAlphaBitmap( const SalTwoRect&,
diff --git a/vcl/unx/inc/salbmp.h b/vcl/unx/inc/salbmp.h
index 1f2dc420cb72..f72f77b9909f 100644
--- a/vcl/unx/inc/salbmp.h
+++ b/vcl/unx/inc/salbmp.h
@@ -52,7 +52,7 @@ class VCL_DLLPUBLIC X11SalBitmap : public SalBitmap
private:
static BitmapBuffer* ImplCreateDIB( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
static BitmapBuffer* ImplCreateDIB( Drawable aDrawable,
int nScreen,
@@ -64,7 +64,7 @@ private:
public:
static ImplSalBitmapCache* mpCache;
- static ULONG mnCacheInstCount;
+ static sal_uIntPtr mnCacheInstCount;
static void ImplCreateCache();
static void ImplDestroyCache();
@@ -106,13 +106,13 @@ public:
// overload pure virtual methods
virtual bool Create( const Size& rSize,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmp );
virtual bool Create( const SalBitmap& rSalBmp,
SalGraphics* pGraphics );
virtual bool Create( const SalBitmap& rSalBmp,
- USHORT nNewBitCount );
+ sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -120,7 +120,7 @@ public:
virtual void Destroy();
virtual Size GetSize() const;
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
@@ -167,7 +167,7 @@ public:
long ImplGetWidth() const { return maTwoRect.mnDestWidth; }
long ImplGetHeight() const { return maTwoRect.mnDestHeight; }
long ImplGetDepth() const { return mnDepth; }
- ULONG ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
+ sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); }
int ImplGetScreen() const { return mnScreen; }
bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const;
@@ -184,14 +184,14 @@ class ImplSalBitmapCache
private:
List maBmpList;
- ULONG mnTotalSize;
+ sal_uIntPtr mnTotalSize;
public:
ImplSalBitmapCache();
~ImplSalBitmapCache();
- void ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize = 0UL, ULONG nFlags = 0UL );
+ void ImplAdd( X11SalBitmap* pBmp, sal_uIntPtr nMemSize = 0UL, sal_uIntPtr nFlags = 0UL );
void ImplRemove( X11SalBitmap* pBmp );
void ImplClear();
};
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index 9544491137fb..e967b0f7e4d0 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -56,11 +56,12 @@ typedef unsigned int pthread_t;
class VCL_DLLPUBLIC X11SalData : public SalData
{
protected:
- BOOL bNoExceptions_;
+ sal_Bool bNoExceptions_;
SalXLib *pXLib_;
SalDisplay *m_pSalDisplay;
pthread_t hMainThread_;
rtl::OUString maLocalHostName;
+ rtl::OUString maUnicodeAccumulator;
public:
X11SalData();
@@ -82,11 +83,12 @@ public:
inline SalXLib* GetLib() const { return pXLib_; }
inline pthread_t GetMainThread() const { return hMainThread_; }
- void StartTimer( ULONG nMS );
+ void StartTimer( sal_uLong nMS );
inline void StopTimer();
void Timeout() const;
const rtl::OUString& GetLocalHostName();
+ rtl::OUString& GetUnicodeAccumulator() { return maUnicodeAccumulator; }
static int XErrorHdl( Display*, XErrorEvent* );
static int XIOErrorHdl( Display* );
@@ -109,7 +111,7 @@ inline void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const
class YieldMutexReleaser
{
- ULONG m_nYieldCount;
+ sal_uLong m_nYieldCount;
public:
inline YieldMutexReleaser();
inline ~YieldMutexReleaser();
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx
index 64eb16a1b313..895f4513800e 100644
--- a/vcl/unx/inc/saldisp.hxx
+++ b/vcl/unx/inc/saldisp.hxx
@@ -149,8 +149,8 @@ public:
Pixel GetTCPixel( SalColor nColor ) const;
SalColor GetTCColor( Pixel nPixel ) const;
- BOOL Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit
- BOOL Convert( int &n0, int &n1, int &n2 ); // 24bit
+ sal_Bool Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit
+ sal_Bool Convert( int &n0, int &n1, int &n2 ); // 24bit
};
// -=-= SalColormap =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -160,7 +160,7 @@ class SalColormap
Colormap m_hColormap;
std::vector<SalColor> m_aPalette; // Pseudocolor
SalVisual m_aVisual;
- std::vector<USHORT> m_aLookupTable; // Pseudocolor: 12bit reduction
+ std::vector<sal_uInt16> m_aLookupTable; // Pseudocolor: 12bit reduction
Pixel m_nWhitePixel;
Pixel m_nBlackPixel;
Pixel m_nUsed; // Pseudocolor
@@ -173,7 +173,7 @@ public:
Colormap hColormap,
int nScreen );
SalColormap( const BitmapPalette &rpPalette );
- SalColormap( USHORT nDepth );
+ SalColormap( sal_uInt16 nDepth );
SalColormap();
~SalColormap();
@@ -188,11 +188,11 @@ public:
inline int GetClass() const { return m_aVisual.GetClass(); }
inline int GetScreenNumber() const { return m_nScreen; }
- BOOL GetXPixels( XColor &rColor,
+ sal_Bool GetXPixels( XColor &rColor,
int r,
int g,
int b ) const;
- inline BOOL GetXPixel( XColor &rColor,
+ inline sal_Bool GetXPixel( XColor &rColor,
int r,
int g,
int b ) const;
@@ -209,7 +209,7 @@ class VCL_DLLPUBLIC SalXLib
{
protected:
timeval m_aTimeout;
- ULONG m_nTimeoutMS;
+ sal_uLong m_nTimeoutMS;
int m_pTimeoutFDS[2];
bool m_bHaveSystemChildFrames;
@@ -251,7 +251,7 @@ public:
void PushXErrorLevel( bool bIgnore );
void PopXErrorLevel();
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
bool CheckTimeout( bool bExecuteTimers = true );
@@ -266,15 +266,10 @@ public:
class SalI18N_InputMethod;
class SalI18N_KeyboardExtension;
-class XlfdStorage;
-class ExtendedFontStruct;
-class ExtendedXlfd;
class AttributeProvider;
class SalUnicodeConverter;
class SalConverterCache;
-typedef ::std::vector< ExtendedFontStruct* > SalFontCache;
-
extern "C" {
struct SnDisplay;
struct SnLauncheeContext;
@@ -331,9 +326,9 @@ public:
{
SalFrame* m_pFrame;
void* m_pData;
- USHORT m_nEvent;
+ sal_uInt16 m_nEvent;
- SalUserEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -346,8 +341,6 @@ protected:
SalI18N_KeyboardExtension *mpKbdExtension;
AttributeProvider *mpFactory;
- XlfdStorage *mpFontList;
- const ExtendedXlfd *mpFallbackFactory;
Display *pDisp_; // X Display
int m_nDefaultScreen; // XDefaultScreen
@@ -355,14 +348,14 @@ protected:
ScreenData m_aInvalidScreenData;
Pair aResolution_; // [dpi]
bool mbExactResolution;
- ULONG nMaxRequestSize_; // [byte]
+ sal_uLong nMaxRequestSize_; // [byte]
srv_vendor_t meServerVendor;
SalWM eWindowManager_;
- ULONG nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
- BOOL bLocal_; // Server==Client? Init
+ sal_uLong nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE
+ sal_Bool bLocal_; // Server==Client? Init
// in SalDisplay::IsLocal()
- BOOL mbLocalIsValid; // bLocal_ is valid ?
+ sal_Bool mbLocalIsValid; // bLocal_ is valid ?
// until x bytes
oslMutex hEventGuard_;
@@ -371,10 +364,8 @@ protected:
XLIB_Cursor aPointerCache_[POINTER_COUNT];
SalFrame* m_pCapture;
- mutable SalFontCache* m_pFontCache;
-
// Keyboard
- BOOL bNumLockFromXS_; // Num Lock handled by X Server
+ sal_Bool bNumLockFromXS_; // Num Lock handled by X Server
int nNumLockIndex_; // modifier index in modmap
int nNumLockMask_; // keyevent state mask for
KeySym nShiftKeySym_; // first shift modifier
@@ -395,7 +386,6 @@ protected:
mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access
- void DestroyFontCache();
virtual long Dispatch( XEvent *pEvent ) = 0;
void InitXinerama();
void InitRandR( XLIB_Window aRoot ) const;
@@ -406,7 +396,7 @@ protected:
void addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight );
public:
static SalDisplay *GetSalDisplay( Display* display );
- static BOOL BestVisual( Display *pDisp,
+ static sal_Bool BestVisual( Display *pDisp,
int nScreen,
XVisualInfo &rVI );
@@ -424,30 +414,22 @@ public:
void Init();
- void SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent = SALEVENT_USEREVENT );
- void CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent );
+ void SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT );
+ void CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
bool DispatchInternalEvent();
void PrintInfo() const;
void PrintEvent( const ByteString &rComment,
XEvent *pEvent ) const;
- XlfdStorage* GetXlfdList() const;
- ExtendedFontStruct*
- GetFont( const ExtendedXlfd *pFont,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- const ExtendedXlfd*
- GetFallbackFactory()
- { return mpFallbackFactory; }
-
void Beep() const;
void ModifierMapping();
- void SimulateKeyPress( USHORT nKeyCode );
- USHORT GetIndicatorState() const;
+ void SimulateKeyPress( sal_uInt16 nKeyCode );
+ sal_uInt16 GetIndicatorState() const;
String GetKeyNameFromKeySym( KeySym keysym ) const;
- XubString GetKeyName( USHORT nKeyCode ) const;
- USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const;
+ XubString GetKeyName( sal_uInt16 nKeyCode ) const;
+ sal_uInt16 GetKeyCode( KeySym keysym, char*pcPrintable ) const;
KeySym GetKeySym( XKeyEvent *pEvent,
unsigned char *pPrintable,
int *pLen,
@@ -458,7 +440,7 @@ public:
XLIB_Cursor GetPointer( int ePointerStyle );
virtual int CaptureMouse( SalFrame *pCapture );
- BOOL IsLocal();
+ sal_Bool IsLocal();
void Remove( XEvent *pEvent );
@@ -479,27 +461,27 @@ public:
const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
srv_vendor_t GetServerVendor() const { return meServerVendor; }
void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
- BOOL IsDisplay() const { return !!pXLib_; }
+ sal_Bool IsDisplay() const { return !!pXLib_; }
GC GetMonoGC( int nScreen ) const { return getDataForScreen(nScreen).m_aMonoGC; }
GC GetCopyGC( int nScreen ) const { return getDataForScreen(nScreen).m_aCopyGC; }
GC GetAndInvertedGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndInvertedGC; }
GC GetAndGC( int nScreen ) const { return getDataForScreen(nScreen).m_aAndGC; }
GC GetOrGC( int nScreen ) const { return getDataForScreen(nScreen).m_aOrGC; }
GC GetStippleGC( int nScreen ) const { return getDataForScreen(nScreen).m_aStippleGC; }
- GC GetGC( USHORT nDepth, int nScreen ) const;
+ GC GetGC( sal_uInt16 nDepth, int nScreen ) const;
Pixmap GetInvert50( int nScreen ) const { return getDataForScreen(nScreen).m_hInvert50; }
const SalColormap& GetColormap( int nScreen ) const { return getDataForScreen(nScreen).m_aColormap; }
const SalVisual& GetVisual( int nScreen ) const { return getDataForScreen(nScreen).m_aVisual; }
RenderEntryMap& GetRenderEntries( int nScreen ) const { return getDataForScreen(nScreen).m_aRenderData; }
const Pair &GetResolution() const { return aResolution_; }
bool GetExactResolution() const { return mbExactResolution; }
- ULONG GetProperties() const { return nProperties_; }
- ULONG GetMaxRequestSize() const { return nMaxRequestSize_; }
+ sal_uLong GetProperties() const { return nProperties_; }
+ sal_uLong GetMaxRequestSize() const { return nMaxRequestSize_; }
XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const;
bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const;
- BOOL MouseCaptured( const SalFrame *pFrameData ) const
+ sal_Bool MouseCaptured( const SalFrame *pFrameData ) const
{ return m_pCapture == pFrameData; }
SalFrame* GetCaptureFrame() const
{ return m_pCapture; }
@@ -525,14 +507,14 @@ public:
const std::list< SalFrame* >& getFrames() const
{ return m_aFrames; }
- BOOL IsNumLockFromXS() const { return bNumLockFromXS_; }
+ sal_Bool IsNumLockFromXS() const { return bNumLockFromXS_; }
std::list< SalObject* >& getSalObjects() { return m_aSalObjects; }
};
// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-inline GC SalDisplay::GetGC( USHORT nDepth, int nScreen ) const
+inline GC SalDisplay::GetGC( sal_uInt16 nDepth, int nScreen ) const
{ return 1 == nDepth
? GetMonoGC( nScreen )
: getDataForScreen(nScreen).m_aVisual.GetDepth() == nDepth
@@ -551,7 +533,7 @@ public:
virtual long Dispatch( XEvent *pEvent );
virtual void Yield();
- BOOL IsEvent();
+ sal_Bool IsEvent();
};
/*----------------------------------------------------------
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index 5ec3f04355a0..0025afce2ad6 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -88,23 +88,23 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame
X11SalGraphics *pFreeGraphics_; // first free frame graphics
XLIB_Time nReleaseTime_; // timestamp of last key release
- USHORT nKeyCode_; // last key code
- USHORT nKeyState_; // last key state
+ sal_uInt16 nKeyCode_; // last key code
+ sal_uInt16 nKeyState_; // last key state
int nCompose_; // compose state
bool mbSendExtKeyModChange;
- USHORT mnExtKeyMod;
+ sal_uInt16 mnExtKeyMod;
int nShowState_; // show state
int nWidth_; // client width
int nHeight_; // client height
Rectangle maRestorePosSize;
- ULONG nStyle_;
+ sal_uIntPtr nStyle_;
SalExtStyle mnExtStyle;
- BOOL bAlwaysOnTop_;
- BOOL bViewable_;
- BOOL bMapped_;
- BOOL mbInShow;
- BOOL bDefaultPosition_; // client is centered initially
+ sal_Bool bAlwaysOnTop_;
+ sal_Bool bViewable_;
+ sal_Bool bMapped_;
+ sal_Bool mbInShow;
+ sal_Bool bDefaultPosition_; // client is centered initially
bool m_bXEmbed;
int nVisibility_;
int m_nWorkArea;
@@ -177,11 +177,11 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame
void updateWMClass();
public:
- X11SalFrame( SalFrame* pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent = NULL );
+ X11SalFrame( SalFrame* pParent, sal_uIntPtr nSalFrameStyle, SystemParentData* pSystemParent = NULL );
virtual ~X11SalFrame();
long Dispatch( XEvent *pEvent );
- void Init( ULONG nSalFrameStyle, int nScreen = -1,
+ void Init( sal_uIntPtr nSalFrameStyle, int nScreen = -1,
SystemParentData* pParentData = NULL, bool bUseGeometry = false );
SalDisplay* GetDisplay() const { return pDisplay_; }
@@ -194,10 +194,10 @@ public:
XLIB_Window GetStackingWindow() const { return mhStackingWindow; }
long ShutDown() const { return CallCallback( SALEVENT_SHUTDOWN, 0 ); }
long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); }
- ULONG GetStyle() const { return nStyle_; }
+ sal_uIntPtr GetStyle() const { return nStyle_; }
inline XLIB_Cursor GetCursor() const { return hCursor_; }
- inline BOOL IsCaptured() const { return nCaptured_ == 1; }
+ inline sal_Bool IsCaptured() const { return nCaptured_ == 1; }
#if !defined(__synchronous_extinput__)
void HandleExtTextEvent (XClientMessageEvent *pEvent);
void PostExtTextEvent (sal_uInt16 nExtTextEventType,
@@ -213,6 +213,10 @@ public:
bool isMapped() const { return bMapped_; }
bool hasFocus() const { return mbInputFocus; }
+ void beginUnicodeSequence();
+ bool appendUnicodeSequence( sal_Unicode );
+ bool endUnicodeSequence();
+
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
@@ -220,39 +224,39 @@ public:
// call with false to setup graphics with window (GetWindow())
virtual void updateGraphics( bool bClear );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nMonitor );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nMonitor );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -260,7 +264,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* pBitmap );
@@ -272,7 +276,7 @@ public:
// set clip region to none (-> rectangular windows, normal state)
virtual void ResetClipRegion();
// start setting the clipregion consisting of nRects rectangles
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
// add a rectangle to the clip region
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
// done setting up the clipregion
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 4a9cd11f394d..ab8607aa523c 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -29,18 +29,15 @@
#ifndef _SV_SALGDI_H
#define _SV_SALGDI_H
-
-// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-class SalFontCacheItem;
-
// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "salstd.hxx"
#include "vcl/salgdi.hxx"
#include "vcl/salgtype.hxx"
#include "tools/fract.hxx"
#include "vcl/dllapi.h"
+#include <vcl/vclenum.hxx>
+#include <vcl/sallayout.hxx>
#include <deque>
-#include "xfont.hxx"
// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
struct ImplFontMetricData;
@@ -94,21 +91,20 @@ protected:
CairoFontsCache m_aCairoFontsCache;
XLIB_Region pPaintRegion_;
- XLIB_Region pClipRegion_;
+ XLIB_Region mpClipRegion;
GC pPenGC_; // Pen attributes
SalColor nPenColor_;
Pixel nPenPixel_;
GC pFontGC_; // Font attributes
- ExtendedFontStructRef mXFont[ MAX_FALLBACK ];
ServerFont* mpServerFont[ MAX_FALLBACK ];
SalColor nTextColor_;
Pixel nTextPixel_;
- BOOL bFontVertical_;
+ sal_Bool bFontVertical_;
- BOOL bDisableGraphite_;
+ sal_Bool bDisableGraphite_;
GC pBrushGC_; // Brush attributes
SalColor nBrushColor_;
@@ -123,21 +119,22 @@ protected:
GC pStippleGC_;
GC pTrackingGC_;
- BOOL bWindow_ : 1; // is Window
- BOOL bPrinter_ : 1; // is Printer
- BOOL bVirDev_ : 1; // is VirDev
- BOOL bPenGC_ : 1; // is Pen GC valid
- BOOL bFontGC_ : 1; // is Font GC valid
- BOOL bBrushGC_ : 1; // is Brush GC valid
- BOOL bMonoGC_ : 1; // is Mono GC valid
- BOOL bCopyGC_ : 1; // is Copy GC valid
- BOOL bInvertGC_ : 1; // is Invert GC valid
- BOOL bInvert50GC_ : 1; // is Invert50 GC valid
- BOOL bStippleGC_ : 1; // is Stipple GC valid
- BOOL bTrackingGC_ : 1; // is Tracking GC valid
+ sal_Bool bWindow_ : 1; // is Window
+ sal_Bool bPrinter_ : 1; // is Printer
+ sal_Bool bVirDev_ : 1; // is VirDev
+ sal_Bool bPenGC_ : 1; // is Pen GC valid
+ sal_Bool bFontGC_ : 1; // is Font GC valid
+ sal_Bool bBrushGC_ : 1; // is Brush GC valid
+ sal_Bool bMonoGC_ : 1; // is Mono GC valid
+ sal_Bool bCopyGC_ : 1; // is Copy GC valid
+ sal_Bool bInvertGC_ : 1; // is Invert GC valid
+ sal_Bool bInvert50GC_ : 1; // is Invert50 GC valid
+ sal_Bool bStippleGC_ : 1; // is Stipple GC valid
+ sal_Bool bTrackingGC_ : 1; // is Tracking GC valid
bool bXORMode_ : 1; // is ROP XOR Mode set
- BOOL bDitherBrush_ : 1; // is solid or tile
+ sal_Bool bDitherBrush_ : 1; // is solid or tile
+ using SalGraphics::SetClipRegion;
void SetClipRegion( GC pGC,
XLIB_Region pXReg = NULL ) const;
@@ -148,12 +145,12 @@ protected:
unsigned long nMask = GCGraphicsExposures );
GC SelectPen();
GC SelectBrush();
- void DrawLines( ULONG nPoints,
+ void DrawLines( sal_uIntPtr nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
);
- BOOL GetDitherPixmap ( SalColor nSalColor );
+ sal_Bool GetDitherPixmap ( SalColor nSalColor );
inline GC GetMonoGC( Pixmap hPixmap );
inline GC GetCopyGC();
@@ -186,7 +183,7 @@ protected:
const SalBitmap &rTransparentBitmap,
SalColor nTransparentColor );
- GC SelectFont();
+ GC GetFontGC();
bool setFont( const ImplFontSelectData* pEntry, int nFallbackLevel );
void drawMaskedBitmap( const SalTwoRect* pPosAry,
@@ -194,9 +191,6 @@ protected:
const SalBitmap& rTransparentBitmap );
protected:
- void DrawStringUCS2MB( ExtendedFontStruct& rFont, const Point&,
- const sal_Unicode* pStr, int nLength );
-
void DrawPrinterString( const SalLayout& );
void DrawServerFontString( const ServerFontLayout& );
@@ -231,15 +225,12 @@ public:
// overload all pure virtual methods
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
virtual long GetGraphicsWidth() const;
virtual long GetGraphicsHeight() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nCount );
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
@@ -253,15 +244,15 @@ public:
virtual void SetROPFillColor( SalROPColor nROPColor );
virtual void SetTextColor( SalColor nSalColor );
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual sal_uLong GetKernPairs( sal_uLong nMaxPairs, ImplKernPairData* );
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -280,8 +271,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
@@ -289,9 +280,9 @@ public:
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry, bool bClose );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry, bool bClose );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
PCONSTSALPOINT* pPtAry );
@@ -300,16 +291,16 @@ public:
virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
#if 1 // TODO: remove these obselete methods
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints,
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints,
+ const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints,
const SalPoint* pPtAry,
- const BYTE* pFlgAry );
+ const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry );
+ const sal_uInt8* const* pFlgAry );
#endif
virtual void copyArea( long nDestX,
@@ -318,7 +309,7 @@ public:
long nSrcY,
long nSrcWidth,
long nSrcHeight,
- USHORT nFlags );
+ sal_uInt16 nFlags );
virtual void copyBits( const SalTwoRect* pPosAry,
SalGraphics* pSrcGraphics );
virtual void drawBitmap( const SalTwoRect* pPosAry,
@@ -335,9 +326,9 @@ public:
virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
virtual SalColor getPixel( long nX, long nY );
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags );
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
@@ -388,19 +379,8 @@ inline Pixel X11SalGraphics::GetPixel( SalColor nSalColor ) const
#ifdef DBG_UTIL
#define stderr0( s ) fprintf( stderr, s )
-#define stderr1( s, a ) fprintf( stderr, s, a )
-#define stderr2( s, a, b ) fprintf( stderr, s, a, b )
-#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c )
-#define stdass0( b ) (void)( !(b) \
- ? fprintf( stderr, "\"%s\" (%s line %d)\n", \
- #b, __FILE__, __LINE__ ) \
- : 0 )
#else
#define stderr0( s ) ;
-#define stderr1( s, a ) ;
-#define stderr2( s, a, b ) ;
-#define stderr3( s, a, b, c ) ;
-#define stdass0( b ) ;
#endif
#endif // _SV_SALGDI_H
diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h
index 0739902548bd..a571303333b3 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -39,7 +39,7 @@
class VCL_DLLPUBLIC SalYieldMutex : public vcl::SolarMutexObject
{
protected:
- ULONG mnCount;
+ sal_uIntPtr mnCount;
oslThreadIdentifier mnThreadId;
public:
@@ -49,7 +49,7 @@ public:
virtual void release();
virtual sal_Bool tryToAcquire();
- ULONG GetAcquireCount() const { return mnCount; }
+ sal_uIntPtr GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
@@ -67,16 +67,16 @@ public:
{}
virtual ~X11SalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData = NULL );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -97,15 +97,12 @@ public:
virtual SalSession* CreateSalSession();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uIntPtr ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uIntPtr nCount );
+ virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
- virtual void DestroyMenu( SalMenu* pMenu);
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
- virtual void DestroyMenuItem( SalMenuItem* pItem );
+ virtual bool AnyInput( sal_uInt16 nType );
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h
index 2a09222c365c..577a3675fa3d 100644
--- a/vcl/unx/inc/salobj.h
+++ b/vcl/unx/inc/salobj.h
@@ -42,16 +42,16 @@ public:
SalClipRegion();
~SalClipRegion();
- void BeginSetClipRegion( ULONG nRects );
+ void BeginSetClipRegion( sal_uIntPtr nRects );
void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
XRectangle *EndSetClipRegion() {
return ClipRectangleList; }
void ResetClipRegion() {
numClipRectangles = 0; }
- USHORT GetClipRegionType() {
+ sal_uInt16 GetClipRegionType() {
return nClipRegionType; }
- void SetClipRegionType( USHORT nType ) {
+ void SetClipRegionType( sal_uInt16 nType ) {
nClipRegionType = nType; }
int GetRectangleCount() {
return numClipRectangles; }
@@ -61,7 +61,7 @@ private:
XRectangle* ClipRectangleList;
int numClipRectangles;
int maxClipRectangles;
- USHORT nClipRegionType;
+ sal_uInt16 nClipRegionType;
};
@@ -74,24 +74,24 @@ public:
XLIB_Window maSecondary;
Colormap maColormap;
SalClipRegion maClipRegion;
- BOOL mbVisible;
+ sal_Bool mbVisible;
static VCL_DLLPUBLIC long Dispatch( XEvent* pEvent );
- static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ static VCL_DLLPUBLIC X11SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
X11SalObject();
virtual ~X11SalObject();
// overload all pure virtual methods
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
@@ -99,6 +99,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index 97776d931f6a..b39a4034fa4b 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -49,16 +49,16 @@ public:
// overload all pure virtual methods
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
+ virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
@@ -72,11 +72,12 @@ public:
bool m_bFax:1;
bool m_bPdf:1;
bool m_bSwallowFaxNo:1;
+ bool m_bIsPDFWriterJob:1;
PspGraphics* m_pGraphics;
psp::PrinterJob m_aPrintJob;
psp::JobData m_aJobData;
psp::PrinterGfx m_aPrinterGfx;
- ULONG m_nCopies;
+ sal_uIntPtr m_nCopies;
bool m_bCollate;
SalInfoPrinter* m_pInfoPrinter;
@@ -85,18 +86,23 @@ public:
// overload all pure virtual methods
using SalPrinter::StartJob;
- virtual BOOL StartJob( const XubString* pFileName,
+ virtual sal_Bool StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uIntPtr nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool StartJob( const String*,
+ const String&,
+ const String&,
+ ImplJobSetup*,
+ vcl::PrinterController& i_rController );
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uIntPtr GetErrorCode();
};
#endif // _SV_SALPRN_H
diff --git a/vcl/unx/inc/saltimer.h b/vcl/unx/inc/saltimer.h
index 7442f307c2c7..9820ba32d40c 100644
--- a/vcl/unx/inc/saltimer.h
+++ b/vcl/unx/inc/saltimer.h
@@ -38,7 +38,7 @@ public:
virtual ~X11SalTimer();
// overload all pure virtual methods
- void Start( ULONG nMS );
+ void Start( sal_uIntPtr nMS );
void Stop();
};
diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h
index c0620d812f63..1c331d06b9e8 100644
--- a/vcl/unx/inc/salunx.h
+++ b/vcl/unx/inc/salunx.h
@@ -70,7 +70,7 @@ inline int operator == ( const timeval &t1, const timeval &t2 )
{
if( t1.tv_sec == t2.tv_sec )
return t1.tv_usec == t2.tv_usec;
- return FALSE;
+ return sal_False;
}
inline timeval &operator -= ( timeval &t1, const timeval &t2 )
@@ -97,7 +97,7 @@ inline timeval &operator += ( timeval &t1, const timeval &t2 )
return t1;
}
-inline timeval &operator += ( timeval &t1, ULONG t2 )
+inline timeval &operator += ( timeval &t1, sal_uIntPtr t2 )
{
t1.tv_sec += t2 / 1000;
t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500;
@@ -115,7 +115,7 @@ inline timeval operator + ( const timeval &t1, const timeval &t2 )
return t0 += t2;
}
-inline timeval operator + ( const timeval &t1, ULONG t2 )
+inline timeval operator + ( const timeval &t1, sal_uIntPtr t2 )
{
timeval t0 = t1;
return t0 += t2;
diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h
index e1c2b91d1627..9add5c261bbd 100644
--- a/vcl/unx/inc/salvd.h
+++ b/vcl/unx/inc/salvd.h
@@ -49,17 +49,17 @@ class X11SalVirtualDevice : public SalVirtualDevice
int nDX_;
int nDY_;
- USHORT nDepth_;
- BOOL bGraphics_; // is Graphics used
- BOOL bExternPixmap_;
+ sal_uInt16 nDepth_;
+ sal_Bool bGraphics_; // is Graphics used
+ sal_Bool bExternPixmap_;
public:
X11SalVirtualDevice();
virtual ~X11SalVirtualDevice();
- BOOL Init( SalDisplay *pDisplay,
+ sal_Bool Init( SalDisplay *pDisplay,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
int nScreen,
Pixmap hDrawable = None,
XRenderPictFormat* pXRenderFormat = NULL );
@@ -67,9 +67,9 @@ public:
inline Display *GetXDisplay() const;
inline SalDisplay *GetDisplay() const;
- inline BOOL IsDisplay() const;
+ inline sal_Bool IsDisplay() const;
inline Pixmap GetDrawable() const { return hDrawable_; }
- inline USHORT GetDepth() const { return nDepth_; }
+ inline sal_uInt16 GetDepth() const { return nDepth_; }
int GetWidth() const { return nDX_; }
int GetHeight() const { return nDY_; }
int GetScreenNumber() const { return m_nScreen; }
@@ -78,7 +78,7 @@ public:
virtual void ReleaseGraphics( SalGraphics* pGraphics );
// Set new size, without saving the old contents
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
@@ -93,7 +93,7 @@ inline Display *X11SalVirtualDevice::GetXDisplay() const
inline SalDisplay *X11SalVirtualDevice::GetDisplay() const
{ return pDisplay_; }
-inline BOOL X11SalVirtualDevice::IsDisplay() const
+inline sal_Bool X11SalVirtualDevice::IsDisplay() const
{ return pDisplay_->IsDisplay(); }
#endif
diff --git a/vcl/unx/inc/soicon.hxx b/vcl/unx/inc/soicon.hxx
index bf1810640b54..cb3302cb777b 100644
--- a/vcl/unx/inc/soicon.hxx
+++ b/vcl/unx/inc/soicon.hxx
@@ -32,8 +32,8 @@ class SalDisplay;
class SalBitmap;
class Bitmap;
-BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
- USHORT nIcon, USHORT iconSize,
+sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,
+ sal_uInt16 nIcon, sal_uInt16 iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask );
#endif
diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx
index 23235e479e75..c6ef6d98bca8 100644
--- a/vcl/unx/inc/wmadaptor.hxx
+++ b/vcl/unx/inc/wmadaptor.hxx
@@ -164,6 +164,8 @@ protected:
bool m_bLegacyPartialFullscreen;
int m_nWinGravity;
int m_nInitWinGravity;
+ bool m_bWMshouldSwitchWorkspace;
+ bool m_bWMshouldSwitchWorkspaceInit;
WMAdaptor( SalDisplay * )
;
@@ -176,6 +178,7 @@ protected:
*/
virtual bool isValid() const;
+ bool getWMshouldSwitchWorkspace() const;
public:
virtual ~WMAdaptor();
@@ -213,8 +216,9 @@ public:
/*
* attemp to switch the desktop to a certain workarea
+ * if bConsiderWM is true, then on some WMs the call will not result in any action
*/
- void switchToWorkArea( int nWorkArea ) const;
+ void switchToWorkArea( int nWorkArea, bool bConsiderWM = true ) const;
/*
* sets window title
diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx
deleted file mode 100644
index 8fc118808ae3..000000000000
--- a/vcl/unx/inc/xfont.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef EXTENDED_FONTSTRUCT_HXX
-#define EXTENDED_FONTSTRUCT_HXX
-
-#ifndef _XLIB_H_
-#include <tools/prex.h>
-#include <X11/Xlib.h>
-#include <tools/postx.h>
-#endif
-#include <tools/ref.hxx>
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-#include <vcl/sallayout.hxx>
-
-typedef unsigned short sal_MultiByte;
-
-class ImplFontMetricData;
-class ExtendedXlfd;
-
-struct VerticalTextItem
-{
- BOOL mbFixed;
- XFontStruct* mpXFontStruct;
- const sal_Unicode* mpString;
- int mnLength;
- int mnTransX;
- int mnTransY;
- int mnFixedAdvance;
- int* mpAdvanceAry;
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int nFixedAdvance )
- : mbFixed( TRUE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mnFixedAdvance( nFixedAdvance )
- {}
-
- VerticalTextItem( XFontStruct* pXFontStruct,
- const sal_Unicode* pString,
- int nLength,
- int nTransX,
- int nTransY,
- int* pAdvanceAry )
- : mbFixed( FALSE ),
- mpXFontStruct( pXFontStruct ),
- mpString( pString ),
- mnLength( nLength ),
- mnTransX( nTransX ),
- mnTransY( nTransY ),
- mpAdvanceAry( pAdvanceAry )
- {}
-
- ~VerticalTextItem()
- {
- if (!mbFixed)
- {
- delete( mpAdvanceAry );
- }
- }
-};
-
-class ExtendedFontStruct : public SvRefBase
-{
- private:
- Display* mpDisplay;
- Size maPixelSize;
- float mfXScale;
- float mfYScale;
- sal_Size mnDefaultWidth;
- sal_Bool mbVertical;
- rtl_TextEncoding mnCachedEncoding;
- rtl_TextEncoding mnAsciiEncoding;
-
- ExtendedXlfd* mpXlfd;
- XFontStruct** mpXFontStruct;
-
- // unicode range cache
- mutable sal_uInt32* mpRangeCodes;
- mutable int mnRangeCount;
-
- int LoadEncoding( rtl_TextEncoding nEncoding );
- FontPitch GetSpacing( rtl_TextEncoding nEncoding );
- bool GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent ) ;
-
- sal_Size GetDefaultWidth();
- sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray,
- rtl_TextEncoding nEncoding );
- sal_Size GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray );
- sal_Size GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32 *pWidthArray, ExtendedFontStruct *pFallback );
- public:
- ExtendedFontStruct( Display* pDisplay,
- const Size& rPixelSize, sal_Bool bVertical,
- ExtendedXlfd* pXlfd );
- ~ExtendedFontStruct();
- bool Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const;
- XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding );
- XFontStruct* GetFontStruct( sal_Unicode nChar,
- rtl_TextEncoding *pEncoding );
- bool ToImplFontMetricData( ImplFontMetricData *pMetric );
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- sal_Size GetCharWidth( sal_Unicode,
- sal_Int32* pPhysWidth, sal_Int32* pLogWidth );
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
- bool HasUnicodeChar( sal_Unicode ) const;
-};
-
-// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting
-// to ExtendedFontStruct (it's not possible to separate decl and impl into
-// a separate source file: all ref member functions are inline
-SV_DECL_IMPL_REF( ExtendedFontStruct );
-
-class X11FontLayout : public GenericSalLayout
-{
-public:
- X11FontLayout( ExtendedFontStruct& );
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
- virtual void DrawText( SalGraphics& ) const;
-
-private:
- ExtendedFontStruct& mrFont;
-};
-
-#endif /* EXTENDED_FONTSTRUCT_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index 881f63db1ffc..b87e7a0aea5b 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALDATA_CXX
-#include <shell/kde_headers.h>
+#include <kde_headers.h>
#include <unistd.h>
#include <fcntl.h>
@@ -135,7 +135,7 @@ void KDEXLib::Init()
"http://artax.karlin.mff.cuni.cz/~kendy" );
m_nFakeCmdLineArgs = 1;
- USHORT nIdx;
+ sal_uInt16 nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
rtl::OUString aParam, aBin;
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 0c7e66ff5282..bf080084ed5b 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -30,7 +30,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALNATIVEWIDGETS_KDE_CXX
-#include <shell/kde_headers.h>
+#include <kde_headers.h>
#include <salunx.h>
#include <saldata.hxx>
@@ -239,7 +239,7 @@ class WidgetPainter
@param gc
The graphics context.
*/
- BOOL drawStyledWidget( QWidget *pWidget,
+ sal_Bool drawStyledWidget( QWidget *pWidget,
ControlState nState, const ImplControlValue& aValue,
Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
ControlPart nPart = PART_ENTIRE_CONTROL );
@@ -252,7 +252,7 @@ class WidgetPainter
@return valid push button.
*/
- QPushButton *pushButton( const Rectangle& rControlRegion, BOOL bDefault );
+ QPushButton *pushButton( const Rectangle& rControlRegion, sal_Bool bDefault );
/** 'Get' method for radio button.
@@ -273,7 +273,7 @@ class WidgetPainter
@see pushButton(), m_pEditableComboBox
*/
- QComboBox *comboBox( const Rectangle& rControlRegion, BOOL bEditable );
+ QComboBox *comboBox( const Rectangle& rControlRegion, sal_Bool bEditable );
/** 'Get' method for line edit box.
@@ -310,13 +310,13 @@ class WidgetPainter
@see pushButton()
*/
QScrollBar *scrollBar( const Rectangle& rControlRegion,
- BOOL bHorizontal, const ImplControlValue& aValue );
+ sal_Bool bHorizontal, const ImplControlValue& aValue );
/** 'Get' method for tool bar.
@see pushButton()
*/
- QToolBar *toolBar( const Rectangle& rControlRegion, BOOL bHorizontal );
+ QToolBar *toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal );
/** 'Get' method for tool button.
@@ -431,13 +431,13 @@ WidgetPainter::~WidgetPainter( void )
delete m_pProgressBar, m_pProgressBar = NULL;
}
-BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
+sal_Bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
ControlState nState, const ImplControlValue& aValue,
Display *dpy, XLIB_Window drawable, int nScreen, int nDepth, GC gc,
ControlPart nPart )
{
if ( !pWidget )
- return FALSE;
+ return sal_False;
// Normalize the widget
QPoint qWidgetPos( pWidget->pos() );
@@ -592,7 +592,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
pTab = m_pTabMiddle;
}
if ( !pTab )
- return FALSE;
+ return sal_False;
pTab->setRect( qRect );
@@ -780,7 +780,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
pWidget->colorGroup(), nStyle );
}
else
- return FALSE;
+ return sal_False;
// Bitblt it to the screen
X11SalGraphics::CopyScreenArea( dpy,
@@ -793,11 +793,11 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
// Restore widget's position
pWidget->move( qWidgetPos );
- return TRUE;
+ return sal_True;
}
QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
- BOOL bDefault )
+ sal_Bool bDefault )
{
if ( !m_pPushButton )
m_pPushButton = new QPushButton( NULL, "push_button" );
@@ -892,7 +892,7 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion )
}
QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion,
- BOOL bEditable )
+ sal_Bool bEditable )
{
QComboBox *pComboBox = NULL;
if ( bEditable )
@@ -1005,7 +1005,7 @@ QListView *WidgetPainter::listView( const Rectangle& rControlRegion )
}
QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
- BOOL bHorizontal, const ImplControlValue& aValue )
+ sal_Bool bHorizontal, const ImplControlValue& aValue )
{
if ( !m_pScrollBar )
{
@@ -1032,7 +1032,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
return m_pScrollBar;
}
-QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, BOOL bHorizontal )
+QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, sal_Bool bHorizontal )
{
if ( !m_pMainWindow )
m_pMainWindow = new QMainWindow( NULL, "main_window" );
@@ -1173,19 +1173,19 @@ class KDESalGraphics : public X11SalGraphics
public:
KDESalGraphics() {}
virtual ~KDESalGraphics() {}
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart,
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& aPos,
- BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart,
+ sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption,
@@ -1200,10 +1200,10 @@ class KDESalGraphics : public X11SalGraphics
@param nPart
Specification of the widget's part if it consists of more than one.
- @return TRUE if the platform supports native drawing of the widget nType
+ @return sal_True if the platform supports native drawing of the widget nType
defined by nPart.
*/
-BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
return
( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) ||
@@ -1235,21 +1235,21 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
/** Test whether the position is in the native widget.
- If the return value is TRUE, bIsInside contains information whether
+ If the return value is sal_True, bIsInside contains information whether
aPos was or was not inside the native widget specified by the
nType/nPart combination.
*/
-BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& rPos,
- BOOL& rIsInside )
+ sal_Bool& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
// make position relative to rControlRegion
Point aPos = rPos - rControlRegion.TopLeft();
- rIsInside = FALSE;
+ rIsInside = sal_False;
- BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
+ sal_Bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
bHorizontal, ImplControlValue() );
@@ -1259,10 +1259,10 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarAddLine );
// There are 2 buttons on the right/bottom side of the scrollbar
- BOOL bTwoSubButtons = FALSE;
+ sal_Bool bTwoSubButtons = sal_False;
// It is a Platinum style scroll bar
- BOOL bPlatinumStyle = FALSE;
+ sal_Bool bPlatinumStyle = sal_False;
// Workaround for Platinum and 3 button style scroll bars.
// It makes the right/down button bigger.
@@ -1272,9 +1272,9 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).right() + 1 );
if ( qRectAddLine.width() > qRectSubLine.width() )
- bTwoSubButtons = TRUE;
+ bTwoSubButtons = sal_True;
if ( qRectSubLine.left() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).left() )
- bPlatinumStyle = TRUE;
+ bPlatinumStyle = sal_True;
}
else
{
@@ -1282,16 +1282,16 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
QStyle::CC_ScrollBar, pScrollBar,
QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
if ( qRectAddLine.height() > qRectSubLine.height() )
- bTwoSubButtons = TRUE;
+ bTwoSubButtons = sal_True;
if ( qRectSubLine.top() > kapp->style().querySubControlMetrics( QStyle::CC_ScrollBar, pScrollBar, QStyle::SC_ScrollBarSubPage ).top() )
- bPlatinumStyle = TRUE;
+ bPlatinumStyle = sal_True;
}
switch ( nPart )
{
case PART_BUTTON_LEFT:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = TRUE;
+ rIsInside = sal_True;
else if ( bTwoSubButtons )
{
qRectAddLine.setWidth( qRectAddLine.width() / 2 );
@@ -1301,7 +1301,7 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
case PART_BUTTON_UP:
if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
- rIsInside = TRUE;
+ rIsInside = sal_True;
else if ( bTwoSubButtons )
{
qRectAddLine.setHeight( qRectAddLine.height() / 2 );
@@ -1325,13 +1325,13 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
// cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA
default:
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
@@ -1346,12 +1346,12 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& )
{
- BOOL bReturn = FALSE;
+ sal_Bool bReturn = sal_False;
Display *dpy = GetXDisplay();
XLIB_Window drawable = GetDrawable();
@@ -1381,7 +1381,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, TRUE ),
+ pWidgetPainter->comboBox( rControlRegion, sal_True ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1395,7 +1395,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) )
{
bReturn = pWidgetPainter->drawStyledWidget(
- pWidgetPainter->comboBox( rControlRegion, FALSE ),
+ pWidgetPainter->comboBox( rControlRegion, sal_False ),
nState, aValue,
dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
}
@@ -1488,17 +1488,17 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
+sal_Bool KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
const Rectangle&, ControlState,
const ImplControlValue&,
const OUString& )
{
- return FALSE;
+ return sal_False;
}
/** Check if the bounding regions match.
- If the return value is TRUE, rNativeBoundingRegion
+ If the return value is sal_True, rNativeBoundingRegion
contains the true bounding region covered by the control
including any adornment, while rNativeContentRegion contains the area
within the control that can be safely drawn into without drawing over
@@ -1513,13 +1513,13 @@ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
@param aCaption
A caption or title string (like button text etc.)
*/
-BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
+sal_Bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue&,
const OUString&,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
- BOOL bReturn = FALSE;
+ sal_Bool bReturn = sal_False;
QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion );
QRect qRect;
@@ -1541,7 +1541,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
QStyle::PM_ButtonDefaultIndicator, pWidget );
qBoundingRect.addCoords( -nIndicatorSize, -nIndicatorSize,
nIndicatorSize, nIndicatorSize );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
}
@@ -1556,7 +1556,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
@@ -1569,7 +1569,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.setWidth( kapp->style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) );
qRect.setHeight( kapp->style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) );
- bReturn = TRUE;
+ bReturn = sal_True;
}
break;
@@ -1586,14 +1586,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
QStyle::CC_ComboBox, pWidget,
QStyle::SC_ComboBoxEditField ).right() + 1 );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
case PART_SUB_EDIT:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1606,14 +1606,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
case PART_BUTTON_UP:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp );
- bReturn = TRUE;
+ bReturn = sal_True;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
case PART_BUTTON_DOWN:
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown );
- bReturn = TRUE;
+ bReturn = sal_True;
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
break;
@@ -1621,7 +1621,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect = kapp->style().querySubControlMetrics(
QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField );
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1663,7 +1663,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
case PART_BUTTON_RIGHT:
@@ -1684,7 +1684,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
- bReturn = TRUE;
+ bReturn = sal_True;
break;
}
break;
@@ -1711,12 +1711,12 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
// KDESalFrame implementation
// -----------------------------------------------------------------------
-KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nStyle ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nStyle ) :
X11SalFrame( pParent, nStyle )
{
}
-void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void KDESalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
{
@@ -1931,9 +1931,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = aStyleSettings.GetLightColor();
aStyleSettings.
- SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ SetCheckedColor( Color( (sal_uInt8)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (sal_uInt8)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
) );
}
@@ -1968,7 +1968,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
qMainWindow.createGUI( "/dev/null" ); // hack
// Menu
- aStyleSettings.SetSkipDisabledInMenus( TRUE );
+ aStyleSettings.SetSkipDisabledInMenus( sal_True );
KMenuBar *pMenuBar = qMainWindow.menuBar();
if ( pMenuBar )
{
@@ -2089,7 +2089,7 @@ KDESalFrame::GraphicsHolder::~GraphicsHolder()
// -----------------------------------------------------------------------
SalFrame *
-KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nStyle )
+KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nStyle )
{
return new KDESalFrame( pParent, nStyle );
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 107a2a2757b8..4aac0e144af0 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -57,7 +57,7 @@
#include <stdio.h>
#endif
-KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
+KDESalFrame::KDESalFrame( SalFrame* pParent, sal_uLong nState ) :
X11SalFrame( pParent, nState )
{
}
@@ -275,9 +275,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
{
Color aColor2 = style.GetLightColor();
style.
- SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
- (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
- (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
+ SetCheckedColor( Color( (BYTE)(((sal_uInt16)aBack.GetRed()+(sal_uInt16)aColor2.GetRed())/2),
+ (BYTE)(((sal_uInt16)aBack.GetGreen()+(sal_uInt16)aColor2.GetGreen())/2),
+ (BYTE)(((sal_uInt16)aBack.GetBlue()+(sal_uInt16)aColor2.GetBlue())/2)
) );
}
diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx
index 2d9c7f8a7aa0..0ee879f044d4 100644
--- a/vcl/unx/kde4/KDESalFrame.hxx
+++ b/vcl/unx/kde4/KDESalFrame.hxx
@@ -48,7 +48,7 @@ class KDESalFrame : public X11SalFrame
GraphicsHolder m_aGraphics[ nMaxGraphics ];
public:
- KDESalFrame( SalFrame* pParent, ULONG nStyle );
+ KDESalFrame( SalFrame* pParent, sal_uLong nStyle );
virtual ~KDESalFrame();
virtual SalGraphics* GetGraphics();
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 1a0e547ead04..26c104c90262 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -859,7 +859,7 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
if( part == PART_BORDER )
{
int nFrameWidth = getFrameWidth();
- USHORT nStyle = val.getNumericVal();
+ sal_uInt16 nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
{
// in this case the question is: how thick would a frame be
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index 302d20ca9bc4..c63d328e29c3 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -30,7 +30,7 @@
#include "KDESalFrame.hxx"
-SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
+SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState )
{
return new KDESalFrame( pParent, nState );
}
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index c42fea68ddcf..9f35557061bb 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -38,7 +38,7 @@ class KDESalInstance : public X11SalInstance
public:
KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 13c39528b3ae..ce4ea14dadb5 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -131,7 +131,7 @@ void KDEXLib::Init()
//kAboutData->setProgramIconName("OpenOffice");
m_nFakeCmdLineArgs = 2;
- USHORT nIdx;
+ sal_uInt16 nIdx;
int nParams = osl_getCommandArgCount();
rtl::OString aDisplay;
@@ -345,7 +345,7 @@ bool KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
return wasEvent;
}
-void KDEXLib::StartTimer( ULONG nMS )
+void KDEXLib::StartTimer( sal_uLong nMS )
{
if( eventLoopType == LibreOfficeEventLoop )
return SalXLib::StartTimer( nMS );
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 21a5a45c4628..72848ed4084c 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -83,7 +83,7 @@ class KDEXLib : public QObject, public SalXLib
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual void Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle );
virtual void Remove( int fd );
- virtual void StartTimer( ULONG nMS );
+ virtual void StartTimer( sal_uLong nMS );
virtual void StopTimer();
virtual void Wakeup();
virtual void PostUserEvent();
diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx
index f8f4f57da043..fbbb6eeabbf1 100644
--- a/vcl/unx/source/app/i18n_cb.cxx
+++ b/vcl/unx/source/app/i18n_cb.cxx
@@ -282,12 +282,12 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback* feedback,
// Convert the XIM feedback values into appropriate VCL
// SAL_EXTTEXTINPUT_ATTR values
// returns an allocate list of attributes, which must be freed by caller
-USHORT*
-Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<USHORT>& rSalAttr )
+sal_uInt16*
+Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uInt16>& rSalAttr )
{
- USHORT *psalattr;
- USHORT nval;
- USHORT noldval = 0;
+ sal_uInt16 *psalattr;
+ sal_uInt16 nval;
+ sal_uInt16 noldval = 0;
XIMFeedback nfeedback;
// only work with reasonable length
@@ -297,7 +297,7 @@ Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<USHORT>
psalattr = &rSalAttr[0];
}
else
- return (USHORT*)NULL;
+ return (sal_uInt16*)NULL;
for (int npos = 0; npos < nlength; npos++)
{
diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx
index fc43e7b81d0b..9b30ba6a6546 100644
--- a/vcl/unx/source/app/i18n_ic.cxx
+++ b/vcl/unx/source/app/i18n_ic.cxx
@@ -184,7 +184,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
maClientData.aInputEv.mnCursorPos = 0;
maClientData.aInputEv.mnDeltaStart = 0;
maClientData.aInputEv.mnCursorFlags = 0;
- maClientData.aInputEv.mbOnlyCursor = FALSE;
+ maClientData.aInputEv.mbOnlyCursor = sal_False;
SalI18N_InputMethod *pInputMethod;
pInputMethod = GetX11SalData()->GetDisplay()->GetInputMethod();
@@ -760,7 +760,7 @@ SalI18N_InputContext::SetLanguage(LanguageType)
}
void
-SalI18N_InputContext::EndExtTextInput( USHORT /*nFlags*/ )
+SalI18N_InputContext::EndExtTextInput( sal_uInt16 /*nFlags*/ )
{
if ( mbUseable && (maContext != NULL) && maClientData.pFrame )
{
diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx
index b609081cc68c..bfea280dc687 100644
--- a/vcl/unx/source/app/i18n_status.cxx
+++ b/vcl/unx/source/app/i18n_status.cxx
@@ -102,7 +102,7 @@ class XIMStatusWindow : public StatusWindow
// for delayed showing
bool m_bDelayedShow;
I18NStatus::ShowReason m_eDelayedReason;
- ULONG m_nDelayedEvent;
+ sal_uLong m_nDelayedEvent;
// for toggling
bool m_bOn;
@@ -165,7 +165,7 @@ void XIMStatusWindow::layout()
m_aStatusText.SetPosSizePixel( Point( 1, 1 ), aControlSize );
m_aStatusText.SetFont( aFont );
- m_aStatusText.Show( TRUE );
+ m_aStatusText.Show( sal_True );
if (m_bAnchoredAtRight && IsVisible())
{
@@ -257,7 +257,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent )
{
setText( String() );
m_pLastParent = pParent;
- Show( FALSE, SHOW_NOACTIVATE );
+ Show( sal_False, SHOW_NOACTIVATE );
}
if( IsVisible() )
{
@@ -359,7 +359,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
m_aStatusBtn.SetSelectHdl( LINK( this, IIIMPStatusWindow, SelectHdl ) );
m_aStatusBtn.SetPopupMenu( &m_aMenu );
- m_aStatusBtn.Show( TRUE );
+ m_aStatusBtn.Show( sal_True );
const ::std::vector< I18NStatus::ChoiceData >& rChoices( I18NStatus::get().getChoices() );
int i = 1;
@@ -384,7 +384,7 @@ IIIMPStatusWindow::IIIMPStatusWindow( SalFrame* pParent, bool bOn ) :
else
fprintf( stderr, "Warning: could not reposition status window since no frame\n" );
#endif
- EnableAlwaysOnTop( TRUE );
+ EnableAlwaysOnTop( sal_True );
}
IIIMPStatusWindow::~IIIMPStatusWindow()
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index c2dcb090cfc4..d8d54ddcc081 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -410,7 +410,7 @@ void SalXLib::Init()
sal_uInt32 nParams = osl_getCommandArgCount();
rtl::OUString aParam;
rtl::OString aDisplay;
- for (USHORT i=0; i<nParams; i++)
+ for (sal_uInt16 i=0; i<nParams; i++)
{
osl_getCommandArg(i, &aParam.pData);
if (aParam.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("-display")))
@@ -427,8 +427,8 @@ void SalXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
- osl_setEnvironment(envVar.pData, aParam.pData);
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ osl_setEnvironment(envVar.pData, aParam.pData);
}
break;
}
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index 4bc379846edf..3ba82446c13e 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -213,7 +213,7 @@ static int sal_significantBits( Pixel nMask )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static BOOL sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
+static sal_Bool sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
{
int nInfos;
XVisualInfo aTemplate;
@@ -223,25 +223,25 @@ static BOOL sal_GetVisualInfo( Display *pDisplay, XID nVID, XVisualInfo &rVI )
pInfos = XGetVisualInfo( pDisplay, VisualIDMask, &aTemplate, &nInfos );
if( !pInfos )
- return FALSE;
+ return sal_False;
rVI = *pInfos;
XFree( pInfos );
DBG_ASSERT( rVI.visualid == nVID,
"sal_GetVisualInfo: could not get correct visual by visualId" );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
// check wether displaystring is in format N.M or N. or just N
// with N and M beeing natural numbers
-static BOOL
+static sal_Bool
sal_IsDisplayNumber( const char *pDisplayString )
{
if ( ! isdigit(*pDisplayString) )
- return FALSE;
+ return sal_False;
while ( isdigit(*(++pDisplayString)) )
; /* do nothing */
@@ -255,12 +255,12 @@ sal_IsDisplayNumber( const char *pDisplayString )
}
// check whether host1 and host2 point to the same ip address
-static BOOL
+static sal_Bool
sal_EqualHosts( const OUString& Host1, const OUString& Host2)
{
oslSocketAddr pHostAddr1;
oslSocketAddr pHostAddr2;
- BOOL bEqualAddress = FALSE;
+ sal_Bool bEqualAddress = sal_False;
if ( Host1.toChar() >= '0' && Host1.toChar() <= '9' )
pHostAddr1 = osl_createInetSocketAddr( Host1.pData, 0 );
@@ -273,7 +273,7 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
pHostAddr2 = osl_resolveHostname( Host2.pData );
if( pHostAddr1 && pHostAddr2 )
- bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? TRUE : FALSE;
+ bEqualAddress = osl_isEqualSocketAddr( pHostAddr1, pHostAddr2 ) ? sal_True : sal_False;
if( pHostAddr1 )
osl_destroySocketAddr( pHostAddr1 );
@@ -283,14 +283,14 @@ sal_EqualHosts( const OUString& Host1, const OUString& Host2)
return bEqualAddress;
}
-static BOOL
+static sal_Bool
sal_IsLocalDisplay( Display *pDisplay )
{
const char *pDisplayString = DisplayString( pDisplay );
// no string, no idea
if ( pDisplayString == NULL || pDisplayString[ 0 ] == '\0')
- return FALSE;
+ return sal_False;
// check for ":x.y"
if ( pDisplayString[ 0 ] == ':' )
@@ -314,7 +314,7 @@ sal_IsLocalDisplay( Display *pDisplay )
// compare local hostname to displaystring, both may be ip address or
// hostname
- BOOL bEqual = FALSE;
+ sal_Bool bEqual = sal_False;
char *pDisplayHost = strdup( pDisplayString );
char *pPtr = strrchr( pDisplayHost, ':' );
@@ -339,14 +339,14 @@ sal_IsLocalDisplay( Display *pDisplay )
// since it is not called very often and sal_IsLocalDisplay() is relative
// expensive bLocal_ is initialized on first call
-BOOL SalDisplay::IsLocal()
+sal_Bool SalDisplay::IsLocal()
{
if ( ! mbLocalIsValid )
{
bLocal_ = sal_IsLocalDisplay( pDisp_ );
- mbLocalIsValid = TRUE;
+ mbLocalIsValid = sal_True;
}
- return (BOOL)bLocal_;
+ return (sal_Bool)bLocal_;
}
// ---------------------------------------------------------------------------
@@ -375,11 +375,6 @@ sal_GetServerVendor( Display *p_display )
{ vendor_none, NULL, 0 },
};
-#ifdef _USE_PRINT_EXTENSION_
- if ( ! XSalIsDisplay( p_display ) )
- return vendor_xprinter;
-#endif
-
// handle regular server vendors
char *p_name = ServerVendor( p_display );
vendor_t *p_vendor;
@@ -411,7 +406,7 @@ static sal_Bool sal_IsTrustedSolaris (Display *p_display)
// -=-= SalDisplay -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL SalDisplay::BestVisual( Display *pDisplay,
+sal_Bool SalDisplay::BestVisual( Display *pDisplay,
int nScreen,
XVisualInfo &rVI )
{
@@ -436,51 +431,51 @@ BOOL SalDisplay::BestVisual( Display *pDisplay,
int i;
for( i = 0; i < nVisuals; i++ )
{
- BOOL bUsable = FALSE;
+ sal_Bool bUsable = sal_False;
int nTrueColor = 1;
if ( pVInfos[i].screen != nScreen )
{
- bUsable = FALSE;
+ bUsable = sal_False;
}
else
if( pVInfos[i].c_class == TrueColor )
{
nTrueColor = 2048;
if( pVInfos[i].depth == 24 )
- bUsable = TRUE;
-#ifdef TRUECOLOR8
+ bUsable = sal_True;
+#ifdef sal_TrueCOLOR8
else if( pVInfos[i].depth == 8 )
{
nTrueColor = -1; // strongly discourage 8 bit true color
- bUsable = TRUE;
+ bUsable = sal_True;
}
#endif
-#ifdef TRUECOLOR15
+#ifdef sal_TrueCOLOR15
else if( pVInfos[i].depth == 15 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
-#ifdef TRUECOLOR16
+#ifdef sal_TrueCOLOR16
else if( pVInfos[i].depth == 16 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
-#ifdef TRUECOLOR32
+#ifdef sal_TrueCOLOR32
else if( pVInfos[i].depth == 32 )
{
nTrueColor = 256;
// we do not have use for an alpha channel
// better use a 24 or 16 bit truecolor visual if possible
- bUsable = TRUE;
+ bUsable = sal_True;
}
#endif
}
else if( pVInfos[i].c_class == PseudoColor )
{
if( pVInfos[i].depth <= 8 )
- bUsable = TRUE;
+ bUsable = sal_True;
#ifdef PSEUDOCOLOR12
else if( pVInfos[i].depth == 12 )
- bUsable = TRUE;
+ bUsable = sal_True;
#endif
}
pWeight[ i ] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
@@ -508,7 +503,6 @@ BOOL SalDisplay::BestVisual( Display *pDisplay,
SalDisplay::SalDisplay( Display *display ) :
mpInputMethod( NULL ),
- mpFallbackFactory ( NULL ),
pDisp_( display ),
m_pWMAdaptor( NULL ),
m_pDtIntegrator( NULL ),
@@ -557,7 +551,6 @@ void SalDisplay::doDestruct()
m_pDtIntegrator = NULL;
X11SalBitmap::ImplDestroyCache();
X11SalGraphics::releaseGlyphPeer();
- DestroyFontCache();
if( IsDisplay() )
{
@@ -650,7 +643,7 @@ fd
GetSalData()->m_pInstance->GetYieldMutex()->acquire();
pDisplay->Yield();
GetSalData()->m_pInstance->GetYieldMutex()->release();
- return TRUE;
+ return sal_True;
}
SalX11Display::SalX11Display( Display *display )
@@ -818,8 +811,6 @@ void SalDisplay::Init()
eWindowManager_ = otherwm;
nProperties_ = PROPERTY_DEFAULT;
hEventGuard_ = NULL;
- m_pFontCache = NULL;
- mpFontList = (XlfdStorage*)NULL;
mpFactory = (AttributeProvider*)NULL;
m_pCapture = NULL;
m_bXinerama = false;
@@ -859,9 +850,9 @@ void SalDisplay::Init()
X11SalBitmap::ImplCreateCache();
hEventGuard_ = osl_createMutex();
- bLocal_ = FALSE; /* dont care, initialize later by
+ bLocal_ = sal_False; /* dont care, initialize later by
calling SalDisplay::IsLocal() */
- mbLocalIsValid = FALSE; /* bLocal_ is not yet initialized */
+ mbLocalIsValid = sal_False; /* bLocal_ is not yet initialized */
// - - - - - - - - - - Synchronize - - - - - - - - - - - - -
if( getenv( "SAL_SYNCHRONIZE" ) )
@@ -1079,7 +1070,7 @@ unsigned int GetKeySymMask(Display* dpy, KeySym nKeySym)
}
-void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
+void SalDisplay::SimulateKeyPress( sal_uInt16 nKeyCode )
{
if (nKeyCode == KEY_CAPSLOCK)
{
@@ -1098,10 +1089,10 @@ void SalDisplay::SimulateKeyPress( USHORT nKeyCode )
}
}
-USHORT SalDisplay::GetIndicatorState() const
+sal_uInt16 SalDisplay::GetIndicatorState() const
{
unsigned int _state = 0;
- USHORT nState = 0;
+ sal_uInt16 nState = 0;
XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
if ((_state & 0x00000001))
@@ -1182,7 +1173,7 @@ void SalDisplay::ModifierMapping()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
+XubString SalDisplay::GetKeyName( sal_uInt16 nKeyCode ) const
{
String aStrMap;
String aCustomKeyName;
@@ -1383,27 +1374,27 @@ XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const
#define IsISOKey( n ) (0x0000FE00==((n)&0xFFFFFF00))
#endif
-USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
+sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
{
- USHORT nKey = 0;
+ sal_uInt16 nKey = 0;
if( XK_a <= keysym && XK_z >= keysym )
- nKey = (USHORT)(KEY_A + (keysym - XK_a));
+ nKey = (sal_uInt16)(KEY_A + (keysym - XK_a));
else if( XK_A <= keysym && XK_Z >= keysym )
- nKey = (USHORT)(KEY_A + (keysym - XK_A));
+ nKey = (sal_uInt16)(KEY_A + (keysym - XK_A));
else if( XK_0 <= keysym && XK_9 >= keysym )
- nKey = (USHORT)(KEY_0 + (keysym - XK_0));
+ nKey = (sal_uInt16)(KEY_0 + (keysym - XK_0));
else if( IsModifierKey( keysym ) )
;
else if( IsKeypadKey( keysym ) )
{
if( (keysym >= XK_KP_0) && (keysym <= XK_KP_9) )
{
- nKey = (USHORT)(KEY_0 + (keysym - XK_KP_0));
+ nKey = (sal_uInt16)(KEY_0 + (keysym - XK_KP_0));
*pcPrintable = '0' + nKey - KEY_0;
}
else if( IsPFKey( keysym ) )
- nKey = (USHORT)(KEY_F1 + (keysym - XK_KP_F1));
+ nKey = (sal_uInt16)(KEY_F1 + (keysym - XK_KP_F1));
else switch( keysym )
{
case XK_KP_Space:
@@ -1482,7 +1473,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
if( bNumLockFromXS_ )
{
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
+ nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
}
else switch( keysym )
{
@@ -1551,7 +1542,7 @@ USHORT SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
break;
default:
if( keysym >= XK_F1 && keysym <= XK_F26 )
- nKey = (USHORT)(KEY_F1 + keysym - XK_F1);
+ nKey = (sal_uInt16)(KEY_F1 + keysym - XK_F1);
break;
}
}
@@ -2258,7 +2249,7 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
// Events
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
+void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2274,7 +2265,7 @@ void SalDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent
}
}
-void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEvent )
+void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
{
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2301,29 +2292,29 @@ void SalDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, USHORT nEve
}
}
-BOOL SalX11Display::IsEvent()
+sal_Bool SalX11Display::IsEvent()
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( osl_acquireMutex( hEventGuard_ ) )
{
if( m_aUserEvents.begin() != m_aUserEvents.end() )
- bRet = TRUE;
+ bRet = sal_True;
osl_releaseMutex( hEventGuard_ );
}
if( bRet || XEventsQueued( pDisp_, QueuedAlready ) )
- return TRUE;
+ return sal_True;
XFlush( pDisp_ );
- return FALSE;
+ return sal_False;
}
bool SalDisplay::DispatchInternalEvent()
{
SalFrame* pFrame = NULL;
void* pData = NULL;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( osl_acquireMutex( hEventGuard_ ) )
{
@@ -2676,6 +2667,7 @@ void SalDisplay::PrintInfo() const
fprintf( stderr, "\tProperties \t0x%lX\n", GetProperties() );
if( eWindowManager_ != otherwm )
fprintf( stderr, "\tWindowmanager \t%d\n", eWindowManager_ );
+ fprintf( stderr, "\tWMName \t%s\n", rtl::OUStringToOString( getWMAdaptor()->getWindowManagerName(), osl_getThreadTextEncoding() ).getStr() );
}
fprintf( stderr, "Screen\n" );
fprintf( stderr, "\tResolution/Size \t%ld*%ld %ld*%ld %.1lf\"\n",
@@ -2957,14 +2949,14 @@ SalVisual::~SalVisual()
#define SALCOLOR RGB
#define SALCOLORREVERSE BGR
-BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
+sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
{
int n;
switch( GetMode() )
{
case other:
- return FALSE;
+ return sal_False;
case SALCOLOR:
break;
case SALCOLORREVERSE:
@@ -2989,17 +2981,17 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return TRUE;
+ return sal_True;
}
-BOOL SalVisual::Convert( int &n0, int &n1, int &n2 )
+sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 )
{
int n;
switch( GetMode() )
{
case other:
- return FALSE;
+ return sal_False;
case SALCOLOR:
break;
case RBG:
@@ -3033,7 +3025,7 @@ BOOL SalVisual::Convert( int &n0, int &n1, int &n2 )
fprintf( stderr, "SalVisual::Convert %d\n", GetMode() );
abort();
}
- return TRUE;
+ return sal_True;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -3200,7 +3192,7 @@ SalColormap::SalColormap()
}
// TrueColor
-SalColormap::SalColormap( USHORT nDepth )
+SalColormap::SalColormap( sal_uInt16 nDepth )
: m_pDisplay( GetX11SalData()->GetDisplay() ),
m_hColormap( None ),
m_nWhitePixel( (1 << nDepth) - 1 ),
@@ -3350,14 +3342,14 @@ void SalColormap::GetPalette()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static USHORT sal_Lookup( const std::vector<SalColor>& rPalette,
+static sal_uInt16 sal_Lookup( const std::vector<SalColor>& rPalette,
int r, int g, int b,
Pixel nUsed )
{
- USHORT nPixel = 0;
+ sal_uInt16 nPixel = 0;
int nBest = ColorDiff( rPalette[0], r, g, b );
- for( USHORT i = 1; i < nUsed; i++ )
+ for( sal_uInt16 i = 1; i < nUsed; i++ )
{
int n = ColorDiff( rPalette[i], r, g, b );
@@ -3375,7 +3367,7 @@ static USHORT sal_Lookup( const std::vector<SalColor>& rPalette,
void SalColormap::GetLookupTable()
{
- m_aLookupTable = std::vector<USHORT>(16*16*16);
+ m_aLookupTable = std::vector<sal_uInt16>(16*16*16);
int i = 0;
for( int r = 0; r < 256; r += 17 )
@@ -3425,7 +3417,7 @@ SalColor SalColormap::GetColor( Pixel nPixel ) const
return MAKE_SALCOLOR( aColor.red>>8, aColor.green>>8, aColor.blue>>8 );
}
-inline BOOL SalColormap::GetXPixel( XColor &rColor,
+inline sal_Bool SalColormap::GetXPixel( XColor &rColor,
int r,
int g,
int b ) const
@@ -3436,15 +3428,15 @@ inline BOOL SalColormap::GetXPixel( XColor &rColor,
return XAllocColor( GetXDisplay(), m_hColormap, &rColor );
}
-BOOL SalColormap::GetXPixels( XColor &rColor,
+sal_Bool SalColormap::GetXPixels( XColor &rColor,
int r,
int g,
int b ) const
{
if( !GetXPixel( rColor, r, g, b ) )
- return FALSE;
+ return sal_False;
if( rColor.pixel & 1 )
- return TRUE;
+ return sal_True;
return GetXPixel( rColor, r^0xFF, g^0xFF, b^0xFF );
}
@@ -3532,9 +3524,9 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
}
// Colormatching ueber Palette
- USHORT r = SALCOLOR_RED ( nSalColor );
- USHORT g = SALCOLOR_GREEN( nSalColor );
- USHORT b = SALCOLOR_BLUE ( nSalColor );
+ sal_uInt16 r = SALCOLOR_RED ( nSalColor );
+ sal_uInt16 g = SALCOLOR_GREEN( nSalColor );
+ sal_uInt16 b = SALCOLOR_BLUE ( nSalColor );
return m_aLookupTable[ (((r+8)/17) << 8)
+ (((g+8)/17) << 4)
+ ((b+8)/17) ];
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 57f8d891a8a6..9b83ceb45413 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -46,7 +46,7 @@
#include "sm.hxx"
#include "vcl/salwtype.hxx"
-#include "vcl/salatype.hxx"
+#include "vcl/apptypes.hxx"
#include "vcl/helper.hxx"
#include <tools/solarmutex.hxx>
#include "osl/mutex.hxx"
@@ -151,8 +151,8 @@ X11SalInstance::~X11SalInstance()
struct PredicateReturn
{
- USHORT nType;
- BOOL bRet;
+ sal_uInt16 nType;
+ sal_Bool bRet;
};
extern "C" {
@@ -163,7 +163,7 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
if ( pPre->bRet )
return False;
- USHORT nType;
+ sal_uInt16 nType;
switch( pEvent->type )
{
@@ -189,29 +189,29 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
}
if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) )
- pPre->bRet = TRUE;
+ pPre->bRet = sal_True;
return False;
}
}
-bool X11SalInstance::AnyInput(USHORT nType)
+bool X11SalInstance::AnyInput(sal_uInt16 nType)
{
X11SalData *pSalData = GetX11SalData();
Display *pDisplay = pSalData->GetDisplay()->GetDisplay();
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if( (nType & INPUT_TIMER) &&
pSalData->GetDisplay()->GetXLib()->CheckTimeout( false ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
else if (XPending(pDisplay) )
{
PredicateReturn aInput;
XEvent aEvent;
- aInput.bRet = FALSE;
+ aInput.bRet = sal_False;
aInput.nType = nType;
XCheckIfEvent(pDisplay, &aEvent, ImplPredicateEvent,
@@ -229,14 +229,14 @@ osl::SolarMutex* X11SalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG X11SalInstance::ReleaseYieldMutex()
+sal_uLong X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
osl::Thread::getCurrentIdentifier() )
{
- ULONG nCount = pYieldMutex->GetAcquireCount();
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount();
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -251,7 +251,7 @@ ULONG X11SalInstance::ReleaseYieldMutex()
// -----------------------------------------------------------------------
-void X11SalInstance::AcquireYieldMutex( ULONG nCount )
+void X11SalInstance::AcquireYieldMutex( sal_uLong nCount )
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
while ( nCount )
@@ -261,6 +261,23 @@ void X11SalInstance::AcquireYieldMutex( ULONG nCount )
}
}
+// -----------------------------------------------------------------------
+
+bool X11SalInstance::CheckYieldMutex()
+{
+ bool bRet = true;
+
+ SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+ if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier() )
+ {
+ bRet = false;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
void X11SalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
{ GetX11SalData()->GetLib()->Yield( bWait, bHandleAllCurrentEvents ); }
@@ -272,14 +289,14 @@ void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
return pDisplay ? (void*)pDisplay : (void*)"";
}
-SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, ULONG nSalFrameStyle )
+SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, sal_uLong nSalFrameStyle )
{
SalFrame *pFrame = new X11SalFrame( pParent, nSalFrameStyle );
return pFrame;
}
-SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, ULONG nStyle )
+SalFrame* X11SalInstance::CreateChildFrame( SystemParentData* pParentData, sal_uLong nStyle )
{
SalFrame* pFrame = new X11SalFrame( NULL, nStyle, pParentData );
diff --git a/vcl/unx/source/app/salsys.cxx b/vcl/unx/source/app/salsys.cxx
index 8024e35cdb12..0b4ca3e84f0e 100644
--- a/vcl/unx/source/app/salsys.cxx
+++ b/vcl/unx/source/app/salsys.cxx
@@ -153,13 +153,13 @@ int X11SalSystem::ShowNativeDialog( const String& rTitle, const String& rMessage
aWarn.SetText( rTitle );
aWarn.Clear();
- USHORT nButton = 0;
+ sal_uInt16 nButton = 0;
for( std::list< String >::const_iterator it = rButtons.begin(); it != rButtons.end(); ++it )
{
- aWarn.AddButton( *it, nButton+1, nButton == (USHORT)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
+ aWarn.AddButton( *it, nButton+1, nButton == (sal_uInt16)nDefButton ? BUTTONDIALOG_DEFBUTTON : 0 );
nButton++;
}
- aWarn.SetFocusButton( (USHORT)nDefButton+1 );
+ aWarn.SetFocusButton( (sal_uInt16)nDefButton+1 );
nRet = ((int)aWarn.Execute()) - 1;
diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx
index b02ced3a6411..885aeb7c38e7 100644
--- a/vcl/unx/source/app/saltimer.cxx
+++ b/vcl/unx/source/app/saltimer.cxx
@@ -59,7 +59,7 @@ void SalXLib::StopTimer()
m_nTimeoutMS = 0;
}
-void SalXLib::StartTimer( ULONG nMS )
+void SalXLib::StartTimer( sal_uLong nMS )
{
timeval Timeout (m_aTimeout); // previous timeout.
gettimeofday (&m_aTimeout, 0);
@@ -90,7 +90,7 @@ void X11SalTimer::Stop()
GetX11SalData()->GetLib()->StopTimer();
}
-void X11SalTimer::Start( ULONG nMS )
+void X11SalTimer::Start( sal_uLong nMS )
{
GetX11SalData()->GetLib()->StartTimer( nMS );
}
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index 6e2b2a3babfa..6bfd09fc4f5d 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -151,7 +151,7 @@ extern "C" void SAL_CALL ICEConnectionWorker( void* );
class ICEConnectionObserver
{
friend void SAL_CALL ICEConnectionWorker(void*);
- static BOOL bIsWatching;
+ static sal_Bool bIsWatching;
static void ICEWatchProc( IceConn connection, IcePointer client_data,
Bool opening, IcePointer* watch_data );
@@ -177,7 +177,7 @@ public:
SmcConn SessionManagerClient::aSmcConnection = NULL;
ByteString SessionManagerClient::aClientID;
-BOOL ICEConnectionObserver::bIsWatching = FALSE;
+sal_Bool ICEConnectionObserver::bIsWatching = sal_False;
struct pollfd* ICEConnectionObserver::pFilehandles = NULL;
IceConn* ICEConnectionObserver::pConnections = NULL;
int ICEConnectionObserver::nConnections = 0;
@@ -609,7 +609,7 @@ void ICEConnectionObserver::activate()
{
nWakeupFiles[0] = nWakeupFiles[1] = 0;
ICEMutex = osl_createMutex();
- bIsWatching = TRUE;
+ bIsWatching = sal_True;
#ifdef USE_SM_EXTENSION
/*
* Default handlers call exit, we don't care that strongly if something
@@ -627,7 +627,7 @@ void ICEConnectionObserver::deactivate()
if( bIsWatching )
{
lock();
- bIsWatching = FALSE;
+ bIsWatching = sal_False;
#ifdef USE_SM_EXTENSION
IceRemoveConnectionWatch( ICEWatchProc, NULL );
IceSetErrorHandler( origErrorHandler );
diff --git a/vcl/unx/source/app/soicon.cxx b/vcl/unx/source/app/soicon.cxx
index 21e4eabedfb8..54240f8eef45 100644
--- a/vcl/unx/source/app/soicon.cxx
+++ b/vcl/unx/source/app/soicon.cxx
@@ -42,13 +42,13 @@
#include <salbmp.h>
#include <vcl/svids.hrc>
-BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT iconSize,
+sal_Bool SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,sal_uInt16 nIcon, sal_uInt16 iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask)
{
if( ! ImplGetResMgr() )
- return FALSE;
+ return sal_False;
- USHORT nIconSizeOffset;
+ sal_uInt16 nIconSizeOffset;
if( iconSize >= 48 )
nIconSizeOffset = SV_ICON_SIZE48_START;
@@ -57,11 +57,11 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT
else if( iconSize >= 16 )
nIconSizeOffset = SV_ICON_SIZE16_START;
else
- return FALSE;
+ return sal_False;
BitmapEx aIcon( ResId(nIconSizeOffset + nIcon, *ImplGetResMgr()));
- if( TRUE == aIcon.IsEmpty() )
- return FALSE;
+ if( sal_True == aIcon.IsEmpty() )
+ return sal_False;
SalTwoRect aRect;
aRect.mnSrcX = 0; aRect.mnSrcY = 0;
@@ -109,7 +109,7 @@ BOOL SelectAppIconPixmap( SalDisplay *pDisplay, int nScreen,USHORT nIcon, USHORT
XFreeGC( pDisplay->GetDisplay(), aMonoGC );
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx
index 725ec7d65733..e03f357998ce 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -32,22 +32,23 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sal/alloca.h>
-#include <wmadaptor.hxx>
-#include <saldisp.hxx>
-#include <saldata.hxx>
-#include <salframe.h>
-#include <vcl/salgdi.hxx>
-#include <osl/thread.h>
-#include <rtl/locale.h>
-#include <osl/process.h>
+#include "sal/alloca.h"
+#include "wmadaptor.hxx"
+#include "saldisp.hxx"
+#include "saldata.hxx"
+#include "salframe.h"
+#include "vcl/salgdi.hxx"
+#include "osl/thread.h"
+#include "rtl/locale.h"
+#include "osl/process.h"
#include <sal/macros.h>
+#include "vcl/configsettings.hxx"
-#include <tools/prex.h>
+#include "tools/prex.h"
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>
-#include <tools/postx.h>
+#include "tools/postx.h"
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
@@ -240,7 +241,9 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) :
m_bEnableAlwaysOnTopWorks( false ),
m_bLegacyPartialFullscreen( false ),
m_nWinGravity( StaticGravity ),
- m_nInitWinGravity( StaticGravity )
+ m_nInitWinGravity( StaticGravity ),
+ m_bWMshouldSwitchWorkspace( true ),
+ m_bWMshouldSwitchWorkspaceInit( false )
{
Atom aRealType = None;
int nFormat = 8;
@@ -967,6 +970,30 @@ bool WMAdaptor::getNetWmName()
return bNetWM;
}
+bool WMAdaptor::getWMshouldSwitchWorkspace() const
+{
+ if( ! m_bWMshouldSwitchWorkspaceInit )
+ {
+ WMAdaptor * pWMA = const_cast<WMAdaptor*>(this);
+
+ pWMA->m_bWMshouldSwitchWorkspace = true;
+ vcl::SettingsConfigItem* pItem = vcl::SettingsConfigItem::get();
+ rtl::OUString aSetting( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WM" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShouldSwitchWorkspace" ) ) ) );
+ if( aSetting.getLength() == 0 )
+ {
+ if( m_aWMName.EqualsAscii( "awesome" ) )
+ {
+ pWMA->m_bWMshouldSwitchWorkspace = false;
+ }
+ }
+ else
+ pWMA->m_bWMshouldSwitchWorkspace = aSetting.toBoolean();
+ pWMA->m_bWMshouldSwitchWorkspaceInit = true;
+ }
+ return m_bWMshouldSwitchWorkspace;
+}
+
/*
* WMAdaptor::isValid()
*/
@@ -2340,8 +2367,11 @@ int WMAdaptor::getWindowWorkArea( XLIB_Window aWindow ) const
* WMAdaptor::getCurrentWorkArea
*/
// fixme: multi screen case
-void WMAdaptor::switchToWorkArea( int nWorkArea ) const
+void WMAdaptor::switchToWorkArea( int nWorkArea, bool bConsiderWM ) const
{
+ if( bConsiderWM && ! getWMshouldSwitchWorkspace() )
+ return;
+
if( m_aWMAtoms[ NET_CURRENT_DESKTOP ] )
{
XEvent aEvent;
diff --git a/vcl/unx/source/dtrans/X11_clipboard.hxx b/vcl/unx/source/dtrans/X11_clipboard.hxx
index ed493a33ba2e..73240d8715e6 100644
--- a/vcl/unx/source/dtrans/X11_clipboard.hxx
+++ b/vcl/unx/source/dtrans/X11_clipboard.hxx
@@ -51,12 +51,12 @@ namespace x11 {
>,
public SelectionAdaptor
{
- Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
- Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
SelectionManager& m_rSelectionManager;
- Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
Atom m_aSelection;
protected:
@@ -97,12 +97,12 @@ namespace x11 {
* XClipboard
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw(RuntimeException);
virtual void SAL_CALL setContents(
- const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(RuntimeException);
virtual ::rtl::OUString SAL_CALL getName()
@@ -119,27 +119,27 @@ namespace x11 {
* XClipboardNotifier
*/
virtual void SAL_CALL addClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
virtual void SAL_CALL removeClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
/*
* SelectionAdaptor
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
virtual void clearTransferable();
virtual void fireContentsChanged();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
};
// ------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL X11Clipboard_getSupportedServiceNames();
- Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
+ com::sun::star::uno::Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx
index 5c47e6a465a2..bca708eb24c7 100644
--- a/vcl/unx/source/dtrans/X11_dndcontext.hxx
+++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx
@@ -52,7 +52,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDropContext();
@@ -71,7 +71,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDragContext();
@@ -89,7 +89,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DragSourceContext();
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index 06dbcc62282e..23584694cad2 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -82,6 +82,12 @@
EnterWindowMask |\
LeaveWindowMask
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::dnd;
using namespace com::sun::star::lang;
@@ -283,7 +289,8 @@ SelectionManager::SelectionManager() :
m_nXdndActionMove( None ),
m_nXdndActionLink( None ),
m_nXdndActionAsk( None ),
- m_nXdndActionPrivate( None )
+ m_nXdndActionPrivate( None ),
+ m_bShutDown( false )
{
m_aDropEnterEvent.data.l[0] = None;
m_aDragRunning.reset();
@@ -625,7 +632,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
// ------------------------------------------------------------------------
bool SelectionManager::convertData(
- const Reference< XTransferable >& xTransferable,
+ const css::uno::Reference< XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int& rFormat,
@@ -1515,7 +1522,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "trying bitmap conversion\n" );
#endif
- Reference<XBitmap> xBM( new BmpTransporter( aData ) );
+ css::uno::Reference<XBitmap> xBM( new BmpTransporter( aData ) );
Sequence<Any> aArgs(2), aOutArgs;
Sequence<sal_Int16> aOutIndex;
aArgs.getArray()[0] = makeAny( xBM );
@@ -1662,7 +1669,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
if( pAdaptor &&
XGetSelectionOwner( m_pDisplay, rRequest.selection ) == m_aWindow )
{
- Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
+ css::uno::Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
if( rRequest.target == m_nTARGETSAtom )
{
// someone requests our types
@@ -1831,7 +1838,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
}
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
if( xListener.is() )
@@ -2352,7 +2359,7 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = getUserDragAction();
dsde.DropSuccess = bSuccess;
- Reference< XDragSourceListener > xListener = m_xDragSourceListener;
+ css::uno::Reference< XDragSourceListener > xListener = m_xDragSourceListener;
m_xDragSourceListener.clear();
aGuard.clear();
@@ -2436,7 +2443,7 @@ void SelectionManager::sendDragStatus( Atom nDropAction )
dsde.DropAction = m_nSourceActions;
dsde.UserAction = getUserDragAction();
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
// caution: do not change anything after this
aGuard.clear();
if( xListener.is() )
@@ -2697,7 +2704,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = m_nTargetAcceptAction;
dsde.DropSuccess = m_bDropSuccess;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2763,7 +2770,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2889,7 +2896,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
m_nDropTimeout = time( NULL );
// HACK :-)
aGuard.clear();
- static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
+ static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, css::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
aGuard.reset();
bCancel = false;
}
@@ -2904,7 +2911,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -3058,7 +3065,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
osl::ResettableMutexGuard aGuard( m_aMutex );
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_nLastDragX = nX;
m_nLastDragY = nY;
@@ -3218,8 +3225,8 @@ void SelectionManager::startDrag(
sal_Int8 sourceActions,
sal_Int32,
sal_Int32,
- const Reference< XTransferable >& transferable,
- const Reference< XDragSourceListener >& listener
+ const css::uno::Reference< XTransferable >& transferable,
+ const css::uno::Reference< XDragSourceListener >& listener
) throw()
{
#if OSL_DEBUG_LEVEL > 1
@@ -3503,8 +3510,8 @@ void SelectionManager::dragDoDispatch()
{
osl::ClearableMutexGuard aGuard(m_aMutex);
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
- Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
m_xDragSourceListener.clear();
m_xDragSourceTransferable.clear();
@@ -3774,10 +3781,10 @@ void SelectionManager::run( void* pThis )
timeval aLast;
gettimeofday( &aLast, 0 );
- Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
if( xFact.is() )
{
- Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
if( xDesktop.is() )
xDesktop->addTerminateListener(This);
}
@@ -3792,7 +3799,7 @@ void SelectionManager::run( void* pThis )
if( (aNow.tv_sec - aLast.tv_sec) > 0 )
{
osl::ClearableMutexGuard aGuard(This->m_aMutex);
- std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList;
+ std::list< std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > > aChangeList;
for( boost::unordered_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
{
@@ -3802,7 +3809,7 @@ void SelectionManager::run( void* pThis )
if( aOwner != it->second->m_aLastOwner )
{
it->second->m_aLastOwner = aOwner;
- std::pair< SelectionAdaptor*, Reference< XInterface > >
+ std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > >
aKeep( it->second->m_pAdaptor, it->second->m_pAdaptor->getReference() );
aChangeList.push_back( aKeep );
}
@@ -3825,6 +3832,11 @@ void SelectionManager::run( void* pThis )
void SelectionManager::shutdown() throw()
{
osl::ResettableMutexGuard aGuard(m_aMutex);
+ if( m_bShutDown )
+ {
+ return;
+ }
+ m_bShutDown = true;
// stop dispatching
if( m_aThread )
{
@@ -3914,7 +3926,7 @@ void SAL_CALL SelectionManager::queryTermination( const ::com::sun::star::lang::
void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang::EventObject& rEvent )
throw( ::com::sun::star::uno::RuntimeException )
{
- Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
#if OSL_DEBUG_LEVEL > 1
@@ -4047,7 +4059,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -4058,7 +4070,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
* SelectionAdaptor
*/
-Reference< XTransferable > SelectionManager::getTransferable() throw()
+css::uno::Reference< XTransferable > SelectionManager::getTransferable() throw()
{
return m_xDragSourceTransferable;
}
@@ -4078,9 +4090,9 @@ void SelectionManager::fireContentsChanged() throw()
// ------------------------------------------------------------------------
-Reference< XInterface > SelectionManager::getReference() throw()
+css::uno::Reference< XInterface > SelectionManager::getReference() throw()
{
- return Reference< XInterface >( static_cast<OWeakObject*>(this) );
+ return css::uno::Reference< XInterface >( static_cast<OWeakObject*>(this) );
}
// ------------------------------------------------------------------------
@@ -4111,7 +4123,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
{
@@ -4146,8 +4158,8 @@ sal_Int32 SelectionManagerHolder::getDefaultCursor( sal_Int8 dragAction ) throw(
void SelectionManagerHolder::startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const css::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw()
{
if( m_xRealDragSource.is() )
diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx
index 28ff488c5627..42158e99802b 100644
--- a/vcl/unx/source/dtrans/X11_selection.hxx
+++ b/vcl/unx/source/dtrans/X11_selection.hxx
@@ -65,10 +65,10 @@ namespace x11 {
class SelectionAdaptor
{
public:
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
virtual void clearTransferable() = 0;
virtual void fireContentsChanged() = 0;
- virtual Reference< XInterface > getReference() = 0;
+ virtual com::sun::star::uno::Reference< XInterface > getReference() = 0;
// returns a reference that will keep the SelectionAdaptor alive until the
// refernce is released
};
@@ -86,9 +86,9 @@ namespace x11 {
sal_Int8 m_nDefaultActions;
XLIB_Window m_aTargetWindow;
class SelectionManager* m_pSelectionManager;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
m_aListeners;
DropTarget();
@@ -104,8 +104,8 @@ namespace x11 {
virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
// XDropTarget
- virtual void SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
- virtual void SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL addDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL removeDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
virtual sal_Bool SAL_CALL isActive() throw();
virtual void SAL_CALL setActive( sal_Bool active ) throw();
virtual sal_Int8 SAL_CALL getDefaultActions() throw();
@@ -126,7 +126,7 @@ namespace x11 {
>
{
::osl::Mutex m_aMutex;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xRealDragSource;
public:
SelectionManagerHolder();
@@ -147,8 +147,8 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
};
@@ -259,9 +259,9 @@ namespace x11 {
oslThread m_aDragExecuteThread;
::osl::Condition m_aDragRunning;
XLIB_Window m_aWindow;
- Reference< ::com::sun::star::awt::XDisplayConnection >
+ com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection >
m_xDisplayConnection;
- Reference< com::sun::star::script::XInvocation >
+ com::sun::star::uno::Reference< com::sun::star::script::XInvocation >
m_xBitmapConverter;
sal_Int32 m_nSelectionTimeout;
XLIB_Time m_nSelectionTimestamp;
@@ -284,7 +284,7 @@ namespace x11 {
XLIB_Time m_nDropTime;
sal_Int8 m_nLastDropAction;
// XTransferable for Xdnd with foreign drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDropTransferable;
int m_nLastX, m_nLastY;
XLIB_Time m_nDropTimestamp;
@@ -302,9 +302,9 @@ namespace x11 {
XLIB_Window m_aDropProxy;
XLIB_Window m_aDragSourceWindow;
// XTransferable for Xdnd when we are drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDragSourceTransferable;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
m_xDragSourceListener;
// root coordinates
int m_nLastDragX, m_nLastDragY;
@@ -382,6 +382,7 @@ namespace x11 {
// since this leads to deadlocks in different Xlib implentations
// (XFree as well as Xsun) use an own mutex instead
::osl::Mutex m_aMutex;
+ bool m_bShutDown;
SelectionManager();
~SelectionManager();
@@ -408,7 +409,7 @@ namespace x11 {
bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData );
// returns true if conversion was successful
- bool convertData( const Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
+ bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int & rFormat,
@@ -493,15 +494,15 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
// SelectionAdaptor for XdndSelection Drag (we are drag source)
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
virtual void clearTransferable() throw();
virtual void fireContentsChanged() throw();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/vcl/unx/source/dtrans/X11_service.cxx b/vcl/unx/source/dtrans/X11_service.cxx
index 215fb1a20011..7397f25e2c76 100644
--- a/vcl/unx/source/dtrans/X11_service.cxx
+++ b/vcl/unx/source/dtrans/X11_service.cxx
@@ -40,6 +40,12 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/compbase1.hxx>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace cppu;
using namespace com::sun::star::lang;
using namespace com::sun::star::datatransfer::clipboard;
@@ -71,7 +77,7 @@ Sequence< OUString > SAL_CALL x11::Xdnd_dropTarget_getSupportedServiceNames()
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
+css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
{
static boost::unordered_map< OUString, ::boost::unordered_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
@@ -82,7 +88,7 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// by SelectionManager.initialize() if no display connection is given.
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
@@ -109,8 +115,8 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
nSelection = rManager.getAtom( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
}
- ::boost::unordered_map< Atom, Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
- ::boost::unordered_map< Atom, Reference< XClipboard > >::iterator it = rMap.find( nSelection );
+ ::boost::unordered_map< Atom, css::uno::Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
+ ::boost::unordered_map< Atom, css::uno::Reference< XClipboard > >::iterator it = rMap.find( nSelection );
if( it != rMap.end() )
return it->second;
@@ -122,16 +128,16 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDragSource()
+css::uno::Reference< XInterface > X11SalInstance::CreateDragSource()
{
- return Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
}
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDropTarget()
+css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget()
{
- return Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
}
diff --git a/vcl/unx/source/dtrans/X11_transferable.hxx b/vcl/unx/source/dtrans/X11_transferable.hxx
index cff20e52fe48..683faa0a7f87 100644
--- a/vcl/unx/source/dtrans/X11_transferable.hxx
+++ b/vcl/unx/source/dtrans/X11_transferable.hxx
@@ -43,10 +43,10 @@ namespace x11 {
::osl::Mutex m_aMutex;
SelectionManager& m_rManager;
- Reference< XInterface > m_xCreator;
+ com::sun::star::uno::Reference< XInterface > m_xCreator;
Atom m_aSelection;
public:
- X11Transferable( SelectionManager& rManager, const Reference< XInterface >& xCreator, Atom selection = None );
+ X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
virtual ~X11Transferable();
/*
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 602a82430cdb..bcf0e14e9160 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -133,16 +133,20 @@ class FontCfgWrapper
FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
void (*m_pFcDefaultSubstitute)(FcPattern *);
FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);
+ FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);
FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
-
FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+
+ FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*);
FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
+ FcBool (*m_pFcPatternDel)(FcPattern*,const char*);
+
FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face);
@@ -249,8 +253,13 @@ public:
{ m_pFcDefaultSubstitute( pPattern ); }
FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
{ return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
+ FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
+ { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
{ return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+
+ FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
+ { return m_pFcPatternDuplicate( pPattern ); }
FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
{ return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
@@ -261,6 +270,9 @@ public:
{ return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
{ return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
+ FcBool FcPatternDel(FcPattern* pPattern, const char* object)
+ { return m_pFcPatternDel( pPattern, object); }
+
FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
{ return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
FcBool FcPatternAddFTFace( FcPattern* pPattern, const char* pObject, const FT_Face nValue )
@@ -366,8 +378,13 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcDefaultSubstitute" );
m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
loadSymbol( "FcFontSetMatch" );
+ m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
+ loadSymbol( "FcFontMatch" );
m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
loadSymbol( "FcConfigSubstitute" );
+
+ m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
+ loadSymbol( "FcPatternDuplicate" );
m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
loadSymbol( "FcPatternAddInteger" );
m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
@@ -378,6 +395,9 @@ FontCfgWrapper::FontCfgWrapper()
loadSymbol( "FcPatternAddCharSet" );
m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
loadSymbol( "FcPatternAddString" );
+ m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
+ loadSymbol( "FcPatternDel" );
+
m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
loadSymbol( "FcFreeTypeCharIndex" );
m_pFcPatternAddFTFace = (FcBool(*)(FcPattern*,const char*,const FT_Face))
@@ -422,13 +442,16 @@ FontCfgWrapper::FontCfgWrapper()
m_pFcConfigAppFontAddFile &&
m_pFcConfigAppFontAddDir &&
m_pFcConfigParseAndLoad &&
+ m_pFcFontMatch &&
m_pFcDefaultSubstitute &&
m_pFcConfigSubstitute &&
+ m_pFcPatternDuplicate &&
m_pFcPatternAddInteger &&
m_pFcPatternAddDouble &&
m_pFcPatternAddCharSet &&
m_pFcPatternAddBool &&
- m_pFcPatternAddString
+ m_pFcPatternAddString &&
+ m_pFcPatternDel
) )
{
osl_unloadModule( (oslModule)m_pLib );
@@ -459,18 +482,44 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
if( !pOrig )
return;
+ // filter the font sets to remove obsolete or duplicate faces
for( int i = 0; i < pOrig->nfont; ++i )
{
- FcBool outline = false;
- FcPattern *pOutlinePattern = pOrig->fonts[i];
- FcResult eOutRes =
- FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
- if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
+ FcPattern* pOrigPattern = pOrig->fonts[i];
+ // #i115131# ignore non-outline fonts
+ FcBool bOutline = FcFalse;
+ FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
continue;
- FcPatternReference(pOutlinePattern);
- FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
+ // create a pattern to find eventually better alternatives
+ FcPattern* pBetterPattern = pOrigPattern;
+ if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions
+ {
+ FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+ FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+ // TODO: ignore all attributes that are not interesting for finding dupes
+ // e.g. by using pattern->ImplFontAttr->pattern conversion
+ FcPatternDel( pTestPattern, FC_FONTVERSION );
+ FcPatternDel( pTestPattern, FC_CHARSET );
+ FcPatternDel( pTestPattern, FC_FILE );
+ // find the font face for the dupe-search pattern
+ FcResult eFcResult = FcResultMatch;
+ pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+ FcPatternDestroy( pTestPattern );
+ if( eFcResult != FcResultMatch )
+ continue;
+ // #i115131# double check results and eventually ignore them
+ eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ continue;
+ }
+ // insert best found pattern for the dupe-search pattern
+ // TODO: skip inserting patterns that are already known in the target fontset
+ FcPatternReference( pBetterPattern );
+ FcFontSetAdd( m_pOutlineSet, pBetterPattern );
}
- // TODO: FcFontSetDestroy( pOrig );
+
+ // TODO?: FcFontSetDestroy( pOrig );
#else
(void)eSetName; // prevent compiler warning about unused parameter
#endif
@@ -750,7 +799,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
);
#endif
- OSL_ASSERT(eOutRes != FcResultMatch || outline);
+// OSL_ASSERT(eOutRes != FcResultMatch || outline);
// only outline fonts are usable to psprint anyway
if( eOutRes == FcResultMatch && ! outline )
@@ -780,7 +829,10 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i
#endif
}
if( aFonts.empty() )
+ {
+ // TODO: remove fonts unusable to psprint from fontset
continue;
+ }
int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True );
PrintFont* pUpdate = aFonts.front();
@@ -1127,6 +1179,7 @@ ImplFontOptions* PrintFontManager::getFontOptions(
const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const
{
#ifndef ENABLE_FONTCONFIG
+ (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
return NULL;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 9292fe12531d..cd5fbda449e0 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -90,6 +90,12 @@
#define PRINTER_METRICDIR "fontmetric"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace vcl;
using namespace utl;
using namespace psp;
@@ -3968,10 +3974,10 @@ bool PrintFontManager::readOverrideMetrics()
if( ! m_aOverrideFonts.empty() )
return false;
- Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
if( !xFact.is() )
return false;
- Reference< XMaterialHolder > xMat(
+ css::uno::Reference< XMaterialHolder > xMat(
xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ),
UNO_QUERY );
if( !xMat.is() )
diff --git a/vcl/unx/source/gdi/cdeint.cxx b/vcl/unx/source/gdi/cdeint.cxx
index 5c7b092d5fd5..fd81e05c0644 100644
--- a/vcl/unx/source/gdi/cdeint.cxx
+++ b/vcl/unx/source/gdi/cdeint.cxx
@@ -232,9 +232,9 @@ void CDEIntegrator::GetSystemLook( AllSettings& rSettings )
{
// calculate Checked color
Color aColor2 = aStyleSettings.GetLightColor();
- BYTE nRed = (BYTE)(((USHORT)aColors[1].GetRed() + (USHORT)aColor2.GetRed())/2);
- BYTE nGreen = (BYTE)(((USHORT)aColors[1].GetGreen() + (USHORT)aColor2.GetGreen())/2);
- BYTE nBlue = (BYTE)(((USHORT)aColors[1].GetBlue() + (USHORT)aColor2.GetBlue())/2);
+ sal_uInt8 nRed = (sal_uInt8)(((sal_uInt16)aColors[1].GetRed() + (sal_uInt16)aColor2.GetRed())/2);
+ sal_uInt8 nGreen = (sal_uInt8)(((sal_uInt16)aColors[1].GetGreen() + (sal_uInt16)aColor2.GetGreen())/2);
+ sal_uInt8 nBlue = (sal_uInt8)(((sal_uInt16)aColors[1].GetBlue() + (sal_uInt16)aColor2.GetBlue())/2);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
}
diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx
index a0ac583cb39d..8cbf67ffe6dc 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.cxx
@@ -466,13 +466,13 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR
if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) )
{
// #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163
- ULONG nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
+ sal_uLong nPixmapWidth = 8 * maRawBitmap.mnScanlineSize - 1;
nPixmapWidth = Max( nPixmapWidth, maRawBitmap.mnWidth );
rGlyphData.SetSize( Size( nPixmapWidth, maRawBitmap.mnHeight ) );
rGlyphData.SetOffset( +maRawBitmap.mnXOffset, +maRawBitmap.mnYOffset );
- const ULONG nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
+ const sal_uLong nBytes = maRawBitmap.mnHeight * maRawBitmap.mnScanlineSize;
if( nBytes > 0 )
{
// conversion table LSB<->MSB (for XCreatePixmapFromData)
@@ -622,7 +622,7 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex )
GlyphSet aGlyphSet = GetGlyphSet( rServerFont, -1 );
aGlyphId = nGlyphIndex & 0x00FFFFFF;
- const ULONG nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
+ const sal_uLong nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
XRenderPeer::GetInstance().AddGlyph( aGlyphSet, aGlyphId,
aGlyphInfo, (char*)maRawBitmap.mpBits, nBytes );
mnBytesUsed += nBytes;
diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk
index 8afbcec8224c..ef5a8726fedc 100644
--- a/vcl/unx/source/gdi/makefile.mk
+++ b/vcl/unx/source/gdi/makefile.mk
@@ -47,42 +47,25 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)$/dtint.obj \
- $(SLO)$/gcach_xpeer.obj \
- $(SLO)$/pspgraphics.obj \
+ $(SLO)$/salgdi2.obj \
$(SLO)$/salbmp.obj \
- $(SLO)$/salcvt.obj \
$(SLO)$/salgdi.obj \
- $(SLO)$/salgdi2.obj \
- $(SLO)$/salgdi3.obj \
$(SLO)$/salvd.obj \
- $(SLO)$/xfont.obj \
- $(SLO)$/xlfd_attr.obj \
- $(SLO)$/xlfd_extd.obj \
- $(SLO)$/xlfd_smpl.obj \
- $(SLO)$/xrender_peer.obj
-
-EXCEPTIONSFILES=\
$(SLO)$/dtint.obj \
- $(SLO)$/gcach_xpeer.obj \
- $(SLO)$/pspgraphics.obj \
- $(SLO)$/salbmp.obj \
$(SLO)$/salcvt.obj \
+ $(SLO)$/salgdi3.obj \
+ $(SLO)$/gcach_xpeer.obj \
+ $(SLO)$/xrender_peer.obj \
+ $(SLO)$/pspgraphics.obj
+
+EXCEPTIONSFILES=\
$(SLO)$/salgdi.obj \
- $(SLO)$/salgdi2.obj \
+ $(SLO)$/salbmp.obj \
$(SLO)$/salgdi3.obj \
- $(SLO)$/salvd.obj \
- $(SLO)$/xfont.obj \
- $(SLO)$/xlfd_attr.obj \
- $(SLO)$/xlfd_extd.obj
-
-.IF "$(USE_XPRINT)" == "TRUE"
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-SLOFILES+=$(SLO)$/xprintext.obj
-.ELSE
+ $(SLO)$/salcvt.obj
+
SLOFILES+=$(SLO)$/salprnpsp.obj
EXCEPTIONSFILES+=$(SLO)$/salprnpsp.obj
-.ENDIF
.IF "$(OS)"=="SOLARIS"
SLOFILES+=$(SLO)$/cdeint.obj
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 5fe67ec32e26..a4289496fa14 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -42,6 +42,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include <stdlib.h>
#include <unistd.h>
@@ -281,7 +282,7 @@ void PspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
}
}
-USHORT PspGraphics::GetBitCount() const
+sal_uInt16 PspGraphics::GetBitCount() const
{
return m_pPrinterGfx->GetBitCount();
}
@@ -293,28 +294,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( ULONG n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-BOOL PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (BOOL)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
-
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
@@ -382,12 +382,12 @@ void PspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void PspGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void PspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
}
-void PspGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void PspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
@@ -412,13 +412,13 @@ bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTransparen
return false;
}
-sal_Bool PspGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
}
-sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool PspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
{
m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
return sal_True;
@@ -427,20 +427,20 @@ sal_Bool PspGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry,
sal_Bool PspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
- const BYTE* const* pFlgAry )
+ const sal_uInt8* const* pFlgAry )
{
// Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
- m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (BYTE**)pFlgAry);
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
return sal_True;
}
-void PspGraphics::invert( ULONG,
+void PspGraphics::invert( sal_uLong,
const SalPoint*,
SalInvert )
{
DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
}
-BOOL PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool PspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
}
@@ -451,7 +451,7 @@ void PspGraphics::copyBits( const SalTwoRect*,
OSL_FAIL( "Error: PrinterGfx::CopyBits() not implemented" );
}
-void PspGraphics::copyArea ( long,long,long,long,long,long,USHORT )
+void PspGraphics::copyArea ( long,long,long,long,long,long,sal_uInt16 )
{
OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
}
@@ -770,16 +770,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
DrawPrinterLayout( rLayout, *m_pPrinterGfx, true );
}
-ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* PspGraphics::GetImplFontCharMap() const
{
- // TODO: get ImplFontCharMap directly from fonts
if( !m_pServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
@@ -789,7 +786,7 @@ bool PspGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabiliti
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
}
-USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
@@ -920,10 +917,10 @@ void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
}
}
-ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
const ::std::list< ::psp::KernPair >& rPairs( m_pPrinterGfx->getKernPairs() );
- ULONG nHavePairs = rPairs.size();
+ sal_uLong nHavePairs = rPairs.size();
if( pKernPairs && nPairs )
{
::std::list< ::psp::KernPair >::const_iterator it;
@@ -942,38 +939,38 @@ ULONG PspGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
return nHavePairs;
}
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = m_pServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
@@ -1008,7 +1005,7 @@ SalLayout* PspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel
//--------------------------------------------------------------------------
-BOOL PspGraphics::CreateFontSubset(
+sal_Bool PspGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1403,9 +1400,9 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
bool bRet = false;
bool bStarted = false;
bool bStopped = false;
- USHORT nPos;
- USHORT nStart = 0;
- USHORT nStop = rLen;
+ sal_uInt16 nPos;
+ sal_uInt16 nStart = 0;
+ sal_uInt16 nStop = rLen;
String aPhone = rOrig.Copy( nIndex, rLen );
if( ! m_bPhoneCollectionActive )
diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx
index 134a4f80b1a9..c60192b8466e 100644
--- a/vcl/unx/source/gdi/salbmp.cxx
+++ b/vcl/unx/source/gdi/salbmp.cxx
@@ -66,7 +66,7 @@ SalBitmap* X11SalInstance::CreateSalBitmap()
}
ImplSalBitmapCache* X11SalBitmap::mpCache = NULL;
-ULONG X11SalBitmap::mnCacheInstCount = 0;
+sal_uLong X11SalBitmap::mnCacheInstCount = 0;
// -----------------------------------------------------------------------------
@@ -112,7 +112,7 @@ void X11SalBitmap::ImplRemovedFromCache()
// -----------------------------------------------------------------------------
-BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
DBG_ASSERT( nBitCount == 1 || nBitCount == 4 || nBitCount == 8 || nBitCount == 16 || nBitCount == 24, "Unsupported BitCount!" );
@@ -131,7 +131,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount,
if( pDIB )
{
- const USHORT nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
+ const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
pDIB->mnFormat = BMP_FORMAT_BOTTOM_UP;
@@ -172,7 +172,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBitCount,
try
{
- pDIB->mpBits = new BYTE[ pDIB->mnScanlineSize * pDIB->mnHeight ];
+ pDIB->mpBits = new sal_uInt8[ pDIB->mnScanlineSize * pDIB->mnHeight ];
}
catch(std::bad_alloc&)
{
@@ -218,7 +218,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
{
const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight };
BitmapBuffer aSrcBuf;
- ULONG nDstFormat = BMP_FORMAT_BOTTOM_UP;
+ sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP;
const BitmapPalette* pDstPal = NULL;
aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN;
@@ -226,7 +226,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
aSrcBuf.mnHeight = nHeight;
aSrcBuf.mnBitCount = pImage->bits_per_pixel;
aSrcBuf.mnScanlineSize = pImage->bytes_per_line;
- aSrcBuf.mpBits = (BYTE*) pImage->data;
+ aSrcBuf.mpBits = (sal_uInt8*) pImage->data;
pImage->red_mask = pSalDisp->GetVisual( nScreen ).red_mask;
pImage->green_mask = pSalDisp->GetVisual( nScreen ).green_mask;
@@ -310,7 +310,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
rPal.SetEntryCount( 256 );
pDstPal = &rPal;
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rBmpCol = rPal[ i ];
@@ -323,12 +323,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable,
else if( aSrcBuf.mnBitCount <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << nDrawableDepth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) );
rPal.SetEntryCount( nCols );
pDstPal = &rPal;
- for( USHORT i = 0; i < nCols; i++ )
+ for( sal_uInt16 i = 0; i < nCols; i++ )
{
const SalColor nColor( rColMap.GetColor( i ) );
BitmapColor& rBmpCol = rPal[ i ];
@@ -383,7 +383,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
if( pImage )
{
BitmapBuffer* pDstBuf;
- ULONG nDstFormat = BMP_FORMAT_TOP_DOWN;
+ sal_uLong nDstFormat = BMP_FORMAT_TOP_DOWN;
BitmapPalette* pPal = NULL;
ColorMask* pMask = NULL;
@@ -451,7 +451,7 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
{
pPal = new BitmapPalette( 256 );
- for( USHORT i = 0; i < 256; i++ )
+ for( sal_uInt16 i = 0; i < 256; i++ )
{
BitmapColor& rBmpCol = (*pPal)[ i ];
@@ -464,11 +464,11 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long
else if( pImage->depth <= 8 )
{
const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
- const USHORT nCols = Min( (ULONG)rColMap.GetUsed(), (ULONG)(1 << pImage->depth) );
+ const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) );
pPal = new BitmapPalette( nCols );
- for( USHORT i = 0; i < nCols; i++ )
+ for( sal_uInt16 i = 0; i < nCols; i++ )
{
const SalColor nColor( rColMap.GetColor( i ) );
BitmapColor& rBmpCol = (*pPal)[ i ];
@@ -718,7 +718,7 @@ void X11SalBitmap::ImplDraw( Drawable aDrawable,
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+bool X11SalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
Destroy();
mpDIB = ImplCreateDIB( rSize, nBitCount, rPal );
@@ -741,7 +741,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
// TODO: get rid of this when BitmapBuffer gets copy constructor
try
{
- mpDIB->mpBits = new BYTE[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
+ mpDIB->mpBits = new sal_uInt8[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
}
catch( std::bad_alloc& )
{
@@ -767,14 +767,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
-bool X11SalBitmap::Create( const SalBitmap&, USHORT )
+bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 )
{
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------------
@@ -837,9 +837,9 @@ Size X11SalBitmap::GetSize() const
// -----------------------------------------------------------------------------
-USHORT X11SalBitmap::GetBitCount() const
+sal_uInt16 X11SalBitmap::GetBitCount() const
{
- USHORT nBitCount;
+ sal_uInt16 nBitCount;
if( mpDIB )
nBitCount = mpDIB->mnBitCount;
@@ -1016,7 +1016,7 @@ ImplSalDDB::~ImplSalDDB()
bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
- bool bRet = FALSE;
+ bool bRet = sal_False;
if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen)
{
@@ -1025,7 +1025,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight )
{
// absolutely indentically
- bRet = TRUE;
+ bRet = sal_True;
}
else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight &&
maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight &&
@@ -1033,7 +1033,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) &&
( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) )
{
- bRet = TRUE;
+ bRet = sal_True;
}
}
@@ -1080,10 +1080,10 @@ void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth,
struct ImplBmpObj
{
X11SalBitmap* mpBmp;
- ULONG mnMemSize;
- ULONG mnFlags;
+ sal_uLong mnMemSize;
+ sal_uLong mnFlags;
- ImplBmpObj( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags ) :
+ ImplBmpObj( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) :
mpBmp( pBmp ), mnMemSize( nMemSize ), mnFlags( nFlags ) {}
};
@@ -1103,14 +1103,14 @@ ImplSalBitmapCache::~ImplSalBitmapCache()
// -----------------------------------------------------------------------------
-void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, ULONG nMemSize, ULONG nFlags )
+void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags )
{
ImplBmpObj* pObj;
- bool bFound = FALSE;
+ bool bFound = sal_False;
for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() )
if( pObj->mpBmp == pBmp )
- bFound = TRUE;
+ bFound = sal_True;
mnTotalSize += nMemSize;
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 38c760af2661..4d3141fc9ded 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -41,6 +41,7 @@
#include "vcl/printergfx.hxx"
#include "vcl/jobdata.hxx"
+#include "vcl/region.h"
#include "tools/debug.hxx"
@@ -68,21 +69,21 @@ class SalPolyLine
XPoint Points_[STATIC_POINTS];
XPoint *pFirst_;
public:
- inline SalPolyLine( ULONG nPoints );
- inline SalPolyLine( ULONG nPoints, const SalPoint *p );
+ inline SalPolyLine( sal_uLong nPoints );
+ inline SalPolyLine( sal_uLong nPoints, const SalPoint *p );
inline ~SalPolyLine();
- inline XPoint &operator [] ( ULONG n ) const
+ inline XPoint &operator [] ( sal_uLong n ) const
{ return pFirst_[n]; }
};
-inline SalPolyLine::SalPolyLine( ULONG nPoints )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{}
-inline SalPolyLine::SalPolyLine( ULONG nPoints, const SalPoint *p )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{
- for( ULONG i = 0; i < nPoints; i++ )
+ for( sal_uLong i = 0; i < nPoints; i++ )
{
pFirst_[i].x = (short)p[i].mnX;
pFirst_[i].y = (short)p[i].mnY;
@@ -105,7 +106,7 @@ X11SalGraphics::X11SalGraphics()
m_aXRenderPicture = 0;
m_pXRenderFormat = NULL;
- pClipRegion_ = NULL;
+ mpClipRegion = NULL;
pPaintRegion_ = NULL;
pPenGC_ = NULL;
@@ -114,10 +115,7 @@ X11SalGraphics::X11SalGraphics()
pFontGC_ = NULL;
for( int i = 0; i < MAX_FALLBACK; ++i )
- {
- mXFont[i] = NULL;
mpServerFont[i] = NULL;
- }
nTextPixel_ = 0;
nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
@@ -125,7 +123,7 @@ X11SalGraphics::X11SalGraphics()
#ifdef ENABLE_GRAPHITE
// check if graphite fonts have been disabled
static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" );
- bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : FALSE;
+ bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : sal_False;
#endif
pBrushGC_ = NULL;
@@ -141,20 +139,20 @@ X11SalGraphics::X11SalGraphics()
pStippleGC_ = NULL;
pTrackingGC_ = NULL;
- bWindow_ = FALSE;
- bPrinter_ = FALSE;
- bVirDev_ = FALSE;
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
- bXORMode_ = FALSE;
- bDitherBrush_ = FALSE;
+ bWindow_ = sal_False;
+ bPrinter_ = sal_False;
+ bVirDev_ = sal_False;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+ bXORMode_ = sal_False;
+ bDitherBrush_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -171,7 +169,7 @@ void X11SalGraphics::freeResources()
Display *pDisplay = GetXDisplay();
DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" );
- if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None;
+ if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None;
if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
@@ -230,7 +228,7 @@ void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen )
m_nScreen = nScreen;
SetDrawable( aTarget, nScreen );
- bWindow_ = TRUE;
+ bWindow_ = sal_True;
m_pFrame = pFrame;
m_pVDev = NULL;
}
@@ -249,8 +247,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
int n = 0;
XLIB_Region Regions[3];
- if( pClipRegion_ )
- Regions[n++] = pClipRegion_;
+ if( mpClipRegion )
+ Regions[n++] = mpClipRegion;
if( pXReg && !XEmptyRegion( pXReg ) )
Regions[n++] = pXReg;
@@ -292,7 +290,7 @@ GC X11SalGraphics::SelectPen()
XSetForeground( pDisplay, pPenGC_, nPenPixel_ );
XSetFunction ( pDisplay, pPenGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pPenGC_ );
- bPenGC_ = TRUE;
+ bPenGC_ = sal_True;
}
return pPenGC_;
@@ -323,13 +321,8 @@ GC X11SalGraphics::SelectBrush()
{
XSetFillStyle ( pDisplay, pBrushGC_, FillSolid );
XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ );
- #if defined(_USE_PRINT_EXTENSION_)
- XSetBackground( pDisplay, pBrushGC_,
- WhitePixel(pDisplay, DefaultScreen(pDisplay)) );
- #else
if( bPrinter_ )
XSetTile( pDisplay, pBrushGC_, None );
- #endif
}
else
{
@@ -344,7 +337,7 @@ GC X11SalGraphics::SelectBrush()
XSetFunction ( pDisplay, pBrushGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pBrushGC_ );
- bBrushGC_ = TRUE;
+ bBrushGC_ = sal_True;
}
return pBrushGC_;
@@ -376,26 +369,26 @@ GC X11SalGraphics::GetTrackingGC()
if( !bTrackingGC_ )
{
SetClipRegion( pTrackingGC_ );
- bTrackingGC_ = TRUE;
+ bTrackingGC_ = sal_True;
}
return pTrackingGC_;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::DrawLines( ULONG nPoints,
+void X11SalGraphics::DrawLines( sal_uLong nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
)
{
// errechne wie viele Linien XWindow auf einmal zeichnen kann
- ULONG nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
+ sal_uLong nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
/ sizeof(xPoint);
if( nMaxLines > nPoints ) nMaxLines = nPoints;
// gebe alle Linien aus, die XWindows zeichnen kann.
- ULONG n;
+ sal_uLong n;
for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 )
XDrawLines( GetXDisplay(),
GetDrawable(),
@@ -439,24 +432,24 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
// test for correct depth (8bit)
if( GetColormap().GetVisual().GetDepth() != 8 )
- return FALSE;
+ return sal_False;
char pBits[64];
char *pBitsPtr = pBits;
// Set the pallette-entries for the dithering tile
- UINT8 nSalColorRed = SALCOLOR_RED ( nSalColor );
- UINT8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
- UINT8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
+ sal_uInt8 nSalColorRed = SALCOLOR_RED ( nSalColor );
+ sal_uInt8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
+ sal_uInt8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
for( int nY = 0; nY < 8; nY++ )
{
for( int nX = 0; nX < 8; nX++ )
{
short nMagic = nOrdDither8Bit[nY][nX];
- UINT8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
- UINT8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
- UINT8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
+ sal_uInt8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
+ sal_uInt8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
+ sal_uInt8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
*pBitsPtr++ = GetColormap().GetPixel( MAKE_SALCOLOR( nR, nG, nB ) );
}
@@ -496,7 +489,7 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
pImage->data = NULL;
XDestroyImage( pImage );
- return TRUE;
+ return sal_True;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -531,7 +524,7 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-USHORT X11SalGraphics::GetBitCount() const
+sal_uInt16 X11SalGraphics::GetBitCount() const
{
return GetVisual().GetDepth();
}
@@ -561,73 +554,64 @@ long X11SalGraphics::GetGraphicsHeight() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::ResetClipRegion()
{
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = NULL;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = NULL;
}
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::BeginSetClipRegion( ULONG )
-{
- if( pClipRegion_ )
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = XCreateRegion();
-}
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
+bool X11SalGraphics::setClipRegion( const Region& i_rClip )
{
- if (!nDX || !nDY)
- return TRUE;
-
- XRectangle aRect;
- aRect.x = (short)nX;
- aRect.y = (short)nY;
- aRect.width = (unsigned short)nDX;
- aRect.height = (unsigned short)nDY;
-
- XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ );
-
- return TRUE;
-}
+ if( mpClipRegion )
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = XCreateRegion();
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ XRectangle aRect;
+ aRect.x = (short)nX;
+ aRect.y = (short)nY;
+ aRect.width = (unsigned short)nW;
+ aRect.height = (unsigned short)nH;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::EndSetClipRegion()
-{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- if( XEmptyRegion( pClipRegion_ ) )
+ // done, invalidate GCs
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ if( XEmptyRegion( mpClipRegion ) )
{
- XDestroyRegion( pClipRegion_ );
- pClipRegion_= NULL;
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion= NULL;
}
+ return true;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -636,7 +620,7 @@ void X11SalGraphics::SetLineColor()
if( nPenColor_ != SALCOLOR_NONE )
{
nPenColor_ = SALCOLOR_NONE;
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -647,7 +631,7 @@ void X11SalGraphics::SetLineColor( SalColor nSalColor )
{
nPenColor_ = nSalColor;
nPenPixel_ = GetPixel( nSalColor );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -656,9 +640,9 @@ void X11SalGraphics::SetFillColor()
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = SALCOLOR_NONE;
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -667,7 +651,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
{
if( nBrushColor_ != nSalColor )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = nSalColor;
nBrushPixel_ = GetPixel( nSalColor );
if( TrueColor != GetColormap().GetVisual().GetClass()
@@ -689,7 +673,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0x00 ) // light brown
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ) )
bDitherBrush_ = GetDitherPixmap(nSalColor);
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -709,7 +693,7 @@ void X11SalGraphics::SetROPLineColor( SalROPColor nROPColor )
break;
}
nPenColor_ = GetColormap().GetColor( nPenPixel_ );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -727,9 +711,9 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor )
nBrushPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1;
break;
}
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = GetColormap().GetColor( nBrushPixel_ );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -738,14 +722,15 @@ void X11SalGraphics::SetXORMode( bool bSet, bool )
if( !bXORMode_ == bSet )
{
bXORMode_ = bSet;
- bPenGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
}
}
@@ -821,13 +806,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
drawPolyLine( nPoints, pPtAry, false );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool bClose )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry, bool bClose )
{
if( nPenColor_ != 0xFFFFFFFF )
{
@@ -838,7 +823,7 @@ void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool b
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( nPoints == 0 )
return;
@@ -911,7 +896,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- ULONG i, n;
+ sal_uInt32 i, n;
XLIB_Region pXRegA = NULL;
for( i = 0; i < nPoly; i++ ) {
@@ -938,7 +923,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
GC pGC = SelectBrush();
SetClipRegion( pGC, pXRegA ); // ??? doppelt
XDestroyRegion( pXRegA );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
XFillRectangle( GetXDisplay(),
GetDrawable(),
@@ -948,20 +933,20 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
}
if( nPenColor_ != SALCOLOR_NONE )
- for( ULONG i = 0; i < nPoly; i++ )
+ for( sal_uInt32 i = 0; i < nPoly; i++ )
drawPolyLine( pPoints[i], pPtAry[i], true );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolyLineBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolygonBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
@@ -976,7 +961,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::invert( ULONG nPoints,
+void X11SalGraphics::invert( sal_uLong nPoints,
const SalPoint* pPtAry,
SalInvert nFlags )
{
@@ -1003,9 +988,9 @@ void X11SalGraphics::invert( ULONG nPoints,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG )
+BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uLong )
{
- return FALSE;
+ return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1067,22 +1052,22 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly
// nothing to do for empty polypolygons
const int nOrigPolyCount = rOrigPolyPoly.count();
if( nOrigPolyCount <= 0 )
- return TRUE;
+ return sal_True;
// nothing to do if everything is transparent
if( (nBrushColor_ == SALCOLOR_NONE)
&& (nPenColor_ == SALCOLOR_NONE) )
- return TRUE;
+ return sal_True;
// cannot handle pencolor!=brushcolor yet
if( (nPenColor_ != SALCOLOR_NONE)
&& (nPenColor_ != nBrushColor_) )
- return FALSE;
+ return sal_False;
// TODO: remove the env-variable when no longer needed
static const char* pRenderEnv = getenv( "SAL_DISABLE_RENDER_POLY" );
if( pRenderEnv )
- return FALSE;
+ return sal_False;
// snap to raster if requested
basegfx::B2DPolyPolygon aPolyPoly = rOrigPolyPoly;
@@ -1165,8 +1150,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
// set clipping
// TODO: move into GetXRenderPicture?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// render the trapezoids
const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
@@ -1213,14 +1198,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
// draw tesselation result
- const int nTrapCount = aB2DTrapVector.size();
- if( !nTrapCount )
- return true;
- const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
+ if( ! aB2DTrapVector.empty() )
+ {
+ const int nTrapCount = aB2DTrapVector.size();
+ const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
- // restore the original brush GC
- nBrushColor_ = aKeepBrushColor;
- return bDrawOk;
+ // restore the original brush GC
+ nBrushColor_ = aKeepBrushColor;
+ return bDrawOk;
+ }
+ else
+ return true;
}
// get the area polygon for the line polygon
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index 7e8b4abc5905..7e3735d8acd6 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -136,7 +136,7 @@ inline GC X11SalGraphics::GetMonoGC( Pixmap hPixmap )
if( !bMonoGC_ )
{
SetClipRegion( pMonoGC_ );
- bMonoGC_ = TRUE;
+ bMonoGC_ = sal_True;
}
return pMonoGC_;
@@ -153,7 +153,7 @@ inline GC X11SalGraphics::GetCopyGC()
if( !bCopyGC_ )
{
SetClipRegion( pCopyGC_ );
- bCopyGC_ = TRUE;
+ bCopyGC_ = sal_True;
}
return pCopyGC_;
}
@@ -171,7 +171,7 @@ GC X11SalGraphics::GetInvertGC()
if( !bInvertGC_ )
{
SetClipRegion( pInvertGC_ );
- bInvertGC_ = TRUE;
+ bInvertGC_ = sal_True;
}
return pInvertGC_;
}
@@ -219,7 +219,7 @@ GC X11SalGraphics::GetInvert50GC()
if( !bInvert50GC_ )
{
SetClipRegion( pInvert50GC_ );
- bInvert50GC_ = TRUE;
+ bInvert50GC_ = sal_True;
}
return pInvert50GC_;
}
@@ -237,7 +237,7 @@ inline GC X11SalGraphics::GetStippleGC()
{
XSetFunction( GetXDisplay(), pStippleGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pStippleGC_ );
- bStippleGC_ = TRUE;
+ bStippleGC_ = sal_True;
}
return pStippleGC_;
@@ -294,8 +294,8 @@ int X11SalGraphics::Clip( int &nX,
&& RectangleOut == Clip( pPaintRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
- if( pClipRegion_
- && RectangleOut == Clip( pClipRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
+ if( mpClipRegion
+ && RectangleOut == Clip( mpClipRegion, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
int nPaint;
@@ -309,9 +309,9 @@ int X11SalGraphics::Clip( int &nX,
nPaint = RectangleIn;
int nClip;
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- nClip = XRectInRegion( pClipRegion_, nX, nY, nDX, nDY );
+ nClip = XRectInRegion( mpClipRegion, nX, nY, nDX, nDY );
if( RectangleOut == nClip )
return RectangleOut;
}
@@ -594,7 +594,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry,
void X11SalGraphics::copyArea ( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT )
+ sal_uInt16 )
{
SalTwoRect aPosAry;
@@ -647,11 +647,11 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
DBG_ASSERT( !bPrinter_, "Drawing of transparent bitmaps on printer devices is strictly forbidden" );
// decide if alpha masking or transparency masking is needed
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( TRUE );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( sal_True );
if( pAlphaBuffer != NULL )
{
int nMaskFormat = pAlphaBuffer->mnFormat;
- const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE );
+ const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, sal_True );
if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap );
}
@@ -672,7 +672,7 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
// figure work mode depth. If this is a VDev Drawable, use its
// bitdepth to create pixmaps for, otherwise, XCopyArea will
// refuse to work.
- const USHORT nDepth( m_pVDev ?
+ const sal_uInt16 nDepth( m_pVDev ?
m_pVDev->GetDepth() :
pSalDisp->GetVisual( m_nScreen ).GetDepth() );
Pixmap aFG( XCreatePixmap( pXDisp, aDrawable, pPosAry->mnDestWidth,
@@ -731,8 +731,8 @@ void X11SalGraphics::drawMaskedBitmap( const SalTwoRect* pPosAry,
DBG_TESTTRANS( aBG );
// #105055# Disable XOR temporarily
- BOOL bOldXORMode( bXORMode_ );
- bXORMode_ = FALSE;
+ sal_Bool bOldXORMode( bXORMode_ );
+ bXORMode_ = sal_False;
// copy pixmap #2 (result) to background
XCopyArea( pXDisp, aBG, aDrawable, GetCopyGC(),
@@ -820,7 +820,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
// TODO: use SalX11Bitmap functionality and caching for the Alpha Pixmap
// problem is that they don't provide an 8bit Pixmap on a non-8bit display
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( TRUE );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( sal_True );
// an XImage needs its data top_down
// TODO: avoid wrongly oriented images in upper layers!
@@ -865,7 +865,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
if( pAlphaBits != (char*)pAlphaBuffer->mpBits )
delete[] pAlphaBits;
- const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE );
+ const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, sal_True );
XRenderPictureAttributes aAttr;
aAttr.repeat = true;
@@ -874,8 +874,8 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
return false;
// set clipping
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// paint source * mask over destination picture
rPeer.CompositePicture( PictOpOver, aSrcPic, aAlphaPic, aDstPic,
@@ -1031,7 +1031,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
}
X11SalBitmap* pSalBitmap = new X11SalBitmap;
- USHORT nBitCount = GetBitCount();
+ sal_uInt16 nBitCount = GetBitCount();
if( &GetDisplay()->GetColormap( m_nScreen ) != &GetColormap() )
nBitCount = 1;
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 5dacaf8022d7..342bd99de324 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -47,11 +47,7 @@
#include "salgdi.h"
#include "pspgraphics.h"
#include "salvd.h"
-#include "xfont.hxx"
#include <vcl/sysdata.hxx>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
#include "salcvt.hxx"
#include "vcl/printergfx.hxx"
@@ -112,385 +108,6 @@ struct _XRegion
BOX extents;
};
using ::rtl::OUString;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-// ----------------------------------------------------------------------------
-//
-// manage X11 fonts and self rastered fonts
-//
-// ----------------------------------------------------------------------------
-
-#ifndef _USE_PRINT_EXTENSION_
-
-class FontLookup
-{
- public:
-
- struct hash;
- struct equal;
- typedef ::boost::unordered_set< FontLookup,
- FontLookup::hash,
- FontLookup::equal > fl_hashset;
-
- private:
-
- rtl::OString maName;
- FontWeight mnWeight;
- FontItalic mnItalic;
- sal_Bool mbDisplay;
-
- public:
-
- FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr );
- FontLookup (const Xlfd& rFont);
- FontLookup (const FontLookup &rRef) :
- maName (rRef.maName),
- mnWeight (rRef.mnWeight),
- mnItalic (rRef.mnItalic),
- mbDisplay(rRef.mbDisplay)
- {}
- ~FontLookup ()
- {}
-
- static void BuildSet (fl_hashset& rSet);
- static bool InSet (const fl_hashset& rSet, const Xlfd& rXfld);
- bool InSet (const fl_hashset& rSet) const;
-
- bool operator== (const FontLookup &rRef) const
- {
- return (abs(mnWeight - rRef.mnWeight) < 2)
- && (mnItalic == rRef.mnItalic)
- && (maName == rRef.maName)
- && (mbDisplay== rRef.mbDisplay);
- }
- FontLookup& operator= (const FontLookup &rRef)
- {
- mnWeight = rRef.mnWeight;
- mnItalic = rRef.mnItalic;
- maName = rRef.maName;
- mbDisplay= rRef.mbDisplay;
-
- return *this;
- }
- size_t Hash() const
- {
- return maName.hashCode ();
- }
-
- struct equal
- {
- bool operator()(const FontLookup &r1, const FontLookup &r2) const
- {
- return r1 == r2;
- }
- };
- struct hash
- {
- size_t operator()(const FontLookup &rArg) const
- {
- return rArg.Hash();
- }
- };
-};
-
-FontLookup::FontLookup ( ::std::list< psp::fontID >::iterator& it,
- const psp::PrintFontManager& rMgr )
-{
- psp::FastPrintFontInfo aInfo;
- if (rMgr.getFontFastInfo (*it, aInfo))
- {
- mnItalic = PspGraphics::ToFontItalic (aInfo.m_eItalic);
- mnWeight = PspGraphics::ToFontWeight (aInfo.m_eWeight);
- mbDisplay= aInfo.m_eType == psp::fonttype::Builtin
- || aInfo.m_eType == psp::fonttype::Unknown ? False : True;
- maName = rtl::OUStringToOString
- ( aInfo.m_aFamilyName,
- RTL_TEXTENCODING_ISO_8859_1).toAsciiLowerCase();
-
- sal_Int32 n_length = maName.getLength();
- const sal_Char* p_from = maName.getStr();
- sal_Char* p_to = (sal_Char*)alloca (n_length + 1);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < n_length; i++)
- {
- if ( p_from[i] != ' ' )
- p_to[j++] = p_from[i];
- }
- maName = rtl::OString (p_to, j);
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
- }
- else
- {
- mnItalic = ITALIC_DONTKNOW;
- mnWeight = WEIGHT_DONTKNOW;
- mbDisplay= False;
- }
-}
-
-FontLookup::FontLookup (const Xlfd& rFont)
-{
- AttributeProvider* pFactory = rFont.mpFactory;
- Attribute* pAttr;
-
- pAttr = pFactory->RetrieveSlant (rFont.mnSlant);
- mnItalic = (FontItalic)pAttr->GetValue();
- pAttr = pFactory->RetrieveWeight (rFont.mnWeight);
- mnWeight = (FontWeight)pAttr->GetValue();
- pAttr = pFactory->RetrieveFamily (rFont.mnFamily);
- maName = pAttr->GetKey();
-
- if (mnItalic == ITALIC_OBLIQUE)
- mnItalic = ITALIC_NORMAL;
-
- mbDisplay = True;
-}
-
-void
-FontLookup::BuildSet (FontLookup::fl_hashset &rSet)
-{
- ::std::list< psp::fontID > aIdList;
-
- psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
- rMgr.getFontList( aIdList, NULL, false );
-
- ::std::list< psp::fontID >::iterator it;
- for (it = aIdList.begin(); it != aIdList.end(); ++it)
- {
- FontLookup aItem (it, rMgr);
- rSet.insert (aItem);
- }
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet) const
-{
- fl_hashset::const_iterator it = rSet.find(*this);
- return it == rSet.end() ? false : true;
-}
-
-bool
-FontLookup::InSet (const FontLookup::fl_hashset& rSet, const Xlfd& rXlfd)
-{
- FontLookup aNeedle (rXlfd);
- return aNeedle.InSet (rSet);
-}
-
-#endif
-
-// ----------------------------------------------------------------------------
-//
-// SalDisplay
-//
-// ----------------------------------------------------------------------------
-
-XlfdStorage*
-SalDisplay::GetXlfdList() const
-{
- if ( mpFontList != NULL )
- {
- return mpFontList;
- }
- else
- {
- const_cast<SalDisplay*>(this)->mpFactory = new AttributeProvider;
- const_cast<SalDisplay*>(this)->mpFontList = new XlfdStorage;
- const_cast<SalDisplay*>(this)->mpFallbackFactory = new VirtualXlfd;
-
- int i, nFontCount;
- const int nMaxCount = 64 * 1024 - 1;
- Display *pDisplay = GetDisplay();
- char **ppFontList = XListFonts(pDisplay, "-*", nMaxCount, &nFontCount);
-
- //
- // create a list of simple Xlfd font information
- //
-
- Xlfd *pXlfdList = (Xlfd*)malloc( nFontCount * sizeof(Xlfd) );
- int nXlfdCount = 0;
-
- for ( i = 0; i < nFontCount; i++ )
- {
- if ( pXlfdList[ nXlfdCount ].FromString(ppFontList[i], mpFactory) )
- ++nXlfdCount;
- }
-
- XFreeFontNames( ppFontList );
-
- mpFactory->AddClassification();
- // add some pretty print description
- mpFactory->AddAnnotation();
- // misc feature checking
- mpFactory->TagFeature();
-
- // sort according to font style
- qsort( pXlfdList, nXlfdCount, sizeof(Xlfd), XlfdCompare );
-
-#ifndef _USE_PRINT_EXTENSION_
- // create a list of fonts already managed by the fontmanager
- FontLookup::fl_hashset aSet;
- FontLookup::BuildSet (aSet);
-#endif
-
- //
- // create a font list with merged encoding information
- //
-
- BitmapXlfdStorage aBitmapList;
- ScalableXlfd *pScalableFont = NULL;
-
- int nFrom = 0;
- for ( i = 0; i < nXlfdCount; i++ )
- {
- // exclude openlook glyph and cursor
- Attribute *pAttr = mpFactory->RetrieveFamily(pXlfdList[i].mnFamily);
- if ( pAttr->HasFeature( XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR) )
- continue;
- // exclude fonts with unknown encoding
- if ( pXlfdList[i].GetEncoding() == RTL_TEXTENCODING_DONTKNOW )
- continue;
- // exclude "interface system" and "interface user"
- if (pAttr->HasFeature( XLFD_FEATURE_APPLICATION_FONT ) )
- continue;
- // exclude fonts already managed by fontmanager, anyway keep
- // gui fonts: they are candidates for GetInterfaceFont ()
- if (pXlfdList[i].Fonttype() == eTypeScalable)
- ((VirtualXlfd*)mpFallbackFactory)->FilterInterfaceFont (pXlfdList + i);
-#ifndef _USE_PRINT_EXTENSION_
- if (FontLookup::InSet (aSet, pXlfdList[i]))
- continue;
-#endif
- Bool bSameOutline = pXlfdList[i].SameFontoutline(pXlfdList + nFrom);
- XlfdFonttype eType = pXlfdList[i].Fonttype();
-
- // flush the old merged font list if the name doesn't match any more
- if ( !bSameOutline )
- {
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- pScalableFont = NULL;
- aBitmapList.Reset();
- }
-
- // merge the font or generate a new one
- switch( eType )
- {
- case eTypeScalable:
- if ( pScalableFont == NULL )
- pScalableFont = new ScalableXlfd;
- pScalableFont->AddEncoding(pXlfdList + i);
- break;
-
- case eTypeBitmap:
- aBitmapList.AddBitmapFont( pXlfdList + i );
- break;
-
- case eTypeScalableBitmap:
- // ignore scaled X11 bitmap fonts because they look too ugly
- default:
- break;
- }
-
- nFrom = i;
- }
-
- // flush the merged list into the global list
- mpFontList->Add( pScalableFont );
- mpFontList->Add( &aBitmapList );
- if (mpFallbackFactory->NumEncodings() > 0)
- mpFontList->Add( mpFallbackFactory );
- // cleanup the list of simple font information
- if ( pXlfdList != NULL )
- free( pXlfdList );
-
- return mpFontList;
- }
-}
-
-// ---------------------------------------------------------------------------
-
-ExtendedFontStruct*
-SalDisplay::GetFont( const ExtendedXlfd *pRequestedFont,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- // TODO: either get rid of X11 fonts or get rid of the non-hashmapped cache
- if( !m_pFontCache )
- {
- m_pFontCache = new SalFontCache();
- }
- else
- {
- ExtendedFontStruct *pItem;
- for ( size_t i = 0, n = m_pFontCache->size(); i < n; ++i )
- {
- pItem = (*m_pFontCache)[ i ];
- if ( pItem->Match(pRequestedFont, rPixelSize, bVertical) )
- {
- if( i > 0 )
- {
- m_pFontCache->erase( m_pFontCache->begin() + i );
- m_pFontCache->insert( m_pFontCache->begin(), pItem );
- }
- return pItem;
- }
- }
- }
-
- // before we expand the cache, we look for very old and unused items
- if( m_pFontCache->size() >= 64 )
- {
- ExtendedFontStruct *pItem;
- for ( size_t i = m_pFontCache->size(); i > 0; )
- {
- pItem = (*m_pFontCache)[ --i ];
- if( 1 == pItem->GetRefCount() )
- {
- m_pFontCache->erase( m_pFontCache->begin() + i );
- pItem->ReleaseRef();
- if( m_pFontCache->size() < 64 )
- break;
- }
- }
- }
-
- ExtendedFontStruct *pItem = new ExtendedFontStruct( GetDisplay(),
- rPixelSize, bVertical,
- const_cast<ExtendedXlfd*>(pRequestedFont) );
- m_pFontCache->insert( m_pFontCache->begin(), pItem );
- pItem->AddRef();
-
- return pItem;
-}
-
-// ---------------------------------------------------------------------------
-
-void
-SalDisplay::DestroyFontCache()
-{
- if( m_pFontCache )
- {
- for ( size_t i = 0, n = m_pFontCache->size(); i < n; ++i ) {
- delete (*m_pFontCache)[ i ];
- }
- }
- if( mpFontList )
- {
- mpFontList->Dispose();
- delete mpFontList;
- }
- if ( mpFactory )
- {
- delete mpFactory;
- }
-
- m_pFontCache = (SalFontCache*)NULL;
- mpFontList = (XlfdStorage*)NULL;
- mpFactory = (AttributeProvider*)NULL;
-}
-
// ===========================================================================
// PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#)
@@ -530,7 +147,7 @@ void PspKernInfo::Initialize() const
// ----------------------------------------------------------------------------
GC
-X11SalGraphics::SelectFont()
+X11SalGraphics::GetFontGC()
{
Display *pDisplay = GetXDisplay();
@@ -541,24 +158,16 @@ X11SalGraphics::SelectFont()
values.fill_rule = EvenOddRule; // Pict import/ Gradient
values.graphics_exposures = False;
values.foreground = nTextPixel_;
-#ifdef _USE_PRINT_EXTENSION_
- values.background = xColormap_->GetWhitePixel();
- pFontGC_ = XCreateGC( pDisplay, hDrawable_,
- GCSubwindowMode | GCFillRule
- | GCGraphicsExposures | GCBackground | GCForeground,
- &values );
-#else
pFontGC_ = XCreateGC( pDisplay, hDrawable_,
GCSubwindowMode | GCFillRule
| GCGraphicsExposures | GCForeground,
&values );
-#endif
}
if( !bFontGC_ )
{
XSetForeground( pDisplay, pFontGC_, nTextPixel_ );
SetClipRegion( pFontGC_ );
- bFontGC_ = TRUE;
+ bFontGC_ = sal_True;
}
return pFontGC_;
@@ -571,8 +180,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
{
- mXFont[i] = NULL; // ->ReleaseRef()
-
if( mpServerFont[i] != NULL )
{
// old server side font is no longer referenced
@@ -591,18 +198,6 @@ bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLev
if( !pEntry->mpFontData )
return false;
- // handle the request for a native X11-font
- if( ImplX11FontData::CheckFontData( *pEntry->mpFontData ) )
- {
- const ImplX11FontData* pRequestedFont = static_cast<const ImplX11FontData*>( pEntry->mpFontData );
- const ExtendedXlfd& rX11Font = pRequestedFont->GetExtendedXlfd();
-
- Size aReqSize( pEntry->mnWidth, pEntry->mnHeight );
- mXFont[ nFallbackLevel ] = GetDisplay()->GetFont( &rX11Font, aReqSize, bFontVertical_ );
- bFontGC_ = FALSE;
- return true;
- }
-
// handle the request for a non-native X11-font => use the GlyphCache
ServerFont* pServerFont = GlyphCache::GetInstance().CacheFont( *pEntry );
if( pServerFont != NULL )
@@ -650,83 +245,6 @@ void ImplServerFontEntry::HandleFontOptions( void )
//--------------------------------------------------------------------------
-inline sal_Unicode SwapBytes( const sal_Unicode nIn )
-{
- return ((nIn >> 8) & 0x00ff) | ((nIn & 0x00ff) << 8);
-}
-
-// draw string in a specific multibyte encoding
-static void
-ConvertTextItem16( XTextItem16* pTextItem, rtl_TextEncoding nEncoding )
-{
- if ( (pTextItem == NULL) || (pTextItem->nchars <= 0) )
- return;
-
- SalConverterCache* pCvt = SalConverterCache::GetInstance();
- // convert the string into the font encoding
- sal_Size nSize;
- sal_Size nBufferSize = pTextItem->nchars * 2;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferSize );
-
- nSize = pCvt->ConvertStringUTF16( (sal_Unicode*)pTextItem->chars, pTextItem->nchars,
- pBuffer, nBufferSize, nEncoding);
-
- sal_Char *pTextChars = (sal_Char*)pTextItem->chars;
- unsigned int n = 0, m = 0;
-
- if ( nEncoding == RTL_TEXTENCODING_GB_2312
- || nEncoding == RTL_TEXTENCODING_GBT_12345
- || nEncoding == RTL_TEXTENCODING_GBK
- || nEncoding == RTL_TEXTENCODING_BIG5 )
- {
- // GB and Big5 needs special treatment since chars can be single or
- // double byte: encoding is
- // [ 0x00 - 0x7f ] | [ 0x81 - 0xfe ] [ 0x40 - 0x7e 0x80 - 0xfe ]
- while ( n < nSize )
- {
- if ( (unsigned char)pBuffer[ n ] < 0x80 )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- else
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- }
- pTextItem->nchars = m / 2;
- }
- else
- if ( pCvt->IsSingleByteEncoding(nEncoding) )
- {
- // Single Byte encoding has to be padded
- while ( n < nSize )
- {
- pTextChars[ m++ ] = 0x0;
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize;
- }
- else
- {
- while ( n < nSize )
- {
- pTextChars[ m++ ] = pBuffer[ n++ ];
- }
- pTextItem->nchars = nSize / 2;
- }
-
- // XXX FIXME
- if ( (nEncoding == RTL_TEXTENCODING_GB_2312)
- || (nEncoding == RTL_TEXTENCODING_EUC_KR) )
- {
- for (unsigned int n_char = 0; n_char < m; n_char++ )
- pTextChars[ n_char ] &= 0x7F;
- }
-}
-
-//--------------------------------------------------------------------------
namespace {
class CairoWrapper
@@ -993,16 +511,16 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
rCairo.set_font_options( cr, pOptions);
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- {
- for (long i = 0; i < pClipRegion_->numRects; ++i)
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
+ for (long i = 0; i < mpClipRegion->numRects; ++i)
+ {
rCairo.rectangle(cr,
- pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y1,
- pClipRegion_->rects[i].x2 - pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y2 - pClipRegion_->rects[i].y1);
- }
+ mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y1,
+ mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
+ }
rCairo.clip(cr);
}
@@ -1091,8 +609,8 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout )
// set clipping
// TODO: move into GetXRenderPicture()?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
ServerFont& rFont = rLayout.GetServerFont();
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
@@ -1175,10 +693,10 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
else if( m_pVDev )
nWidth = m_pVDev->GetWidth(), nHeight = m_pVDev->GetHeight();
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
// get bounding box
- XClipBox( pClipRegion_, &aXRect );
+ XClipBox( mpClipRegion, &aXRect );
// clip with window
if( aXRect.x < 0 ) aXRect.x = 0;
@@ -1271,7 +789,7 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
}
// prepare context
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
XGetGCValues( pDisplay, nGC, GCForeground, &aGCVal );
@@ -1358,7 +876,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
+ GC nGC = GetFontGC();
XGCValues aGCVal;
aGCVal.fill_style = FillStippled;
@@ -1421,71 +939,13 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
//--------------------------------------------------------------------------
-void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont,
- const Point& rPoint, const sal_Unicode* pStr, int nLength )
+const ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
{
- Display* pDisplay = GetXDisplay();
- GC nGC = SelectFont();
-
- if( rFont.GetAsciiEncoding() == RTL_TEXTENCODING_UNICODE )
- {
- // plain Unicode, can handle all chars and can be handled straight forward
- XFontStruct* pFontStruct = rFont.GetFontStruct( RTL_TEXTENCODING_UNICODE );
- if( !pFontStruct )
- return;
-
- XSetFont( pDisplay, nGC, pFontStruct->fid );
-
- #ifdef OSL_LITENDIAN
- sal_Unicode *pBuffer = (sal_Unicode*)alloca( nLength * sizeof(sal_Unicode) );
- for ( int i = 0; i < nLength; i++ )
- pBuffer[ i ] = SwapBytes(pStr[ i ]) ;
- #else
- sal_Unicode *pBuffer = const_cast<sal_Unicode*>(pStr);
- #endif
-
- XDrawString16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), (XChar2b*)pBuffer, nLength );
- }
- else
- {
- XTextItem16 *pTextItem = (XTextItem16*)alloca( nLength * sizeof(XTextItem16) );
- XChar2b *pMBChar = (XChar2b*)pStr;
- int nItem = 0;
-
- DBG_ASSERT( nLength<=1, "#i49902# DrawStringUCS2MB with nLength>1 => problems with XOrg6.8.[0123]");
-
- for( int nChar = 0; nChar < nLength; ++nChar )
- {
- rtl_TextEncoding nEnc;
- XFontStruct* pFontStruct = rFont.GetFontStruct( pStr[nChar], &nEnc );
- if( !pFontStruct )
- continue;
-
- pTextItem[ nItem ].chars = pMBChar + nChar;
- pTextItem[ nItem ].delta = 0;
- pTextItem[ nItem ].font = pFontStruct->fid;
- pTextItem[ nItem ].nchars = 1;
-
- ConvertTextItem16( &pTextItem[ nItem ], nEnc );
- ++nItem;
- }
-
- XDrawText16( pDisplay, hDrawable_, nGC, rPoint.X(), rPoint.Y(), pTextItem, nItem );
- }
-}
-
-//--------------------------------------------------------------------------
-
-ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const
-{
- // TODO: get ImplFontCharMap directly from fonts
if( !mpServerFont[0] )
return NULL;
- CmapResult aCmapResult;
- if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) )
- return NULL;
- return new ImplFontCharMap( aCmapResult );
+ const ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap();
+ return pIFCMap;
}
bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFontCapabilities) const
@@ -1501,9 +961,9 @@ bool X11SalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rGetImplFont
//
// ----------------------------------------------------------------------------
-USHORT X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
+sal_uInt16 X11SalGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel )
{
- USHORT nRetVal = 0;
+ sal_uInt16 nRetVal = 0;
if( !setFont( pEntry, nFallbackLevel ) )
nRetVal |= SAL_SETFONT_BADFONT;
if( bPrinter_ || (mpServerFont[ nFallbackLevel ] != NULL) )
@@ -1520,7 +980,7 @@ X11SalGraphics::SetTextColor( SalColor nSalColor )
{
nTextColor_ = nSalColor;
nTextPixel_ = GetPixel( nSalColor );
- bFontGC_ = FALSE;
+ bFontGC_ = sal_False;
}
}
@@ -1567,15 +1027,6 @@ void RegisterFontSubstitutors( ImplDevFontList* );
void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
{
- // allow disabling of native X11 fonts
- static const char* pEnableX11FontStr = getenv( "SAL_ENABLE_NATIVE_XFONTS" );
- if( pEnableX11FontStr && (pEnableX11FontStr[0] != '0') )
- {
- // announce X11 fonts
- XlfdStorage* pX11FontList = GetDisplay()->GetXlfdList();
- pX11FontList->AnnounceFonts( pList );
- }
-
// prepare the GlyphCache using psprint's font infos
X11GlyphCache& rGC = X11GlyphCache::GetInstance();
@@ -1756,25 +1207,19 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
long rDummyFactor;
mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
- else if( mXFont[nFallbackLevel] != NULL )
- {
- mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
- if ( bFontVertical_ )
- pMetric->mnOrientation = 0;
- }
}
// ---------------------------------------------------------------------------
-ULONG
-X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
+sal_uLong
+X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs )
{
if( ! bPrinter_ )
{
if( mpServerFont[0] != NULL )
{
ImplKernPairData* pTmpKernPairs;
- ULONG nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
+ sal_uLong nGotPairs = mpServerFont[0]->GetKernPairs( &pTmpKernPairs );
for( unsigned int i = 0; i < nPairs && i < nGotPairs; ++i )
pKernPairs[ i ] = pTmpKernPairs[ i ];
delete[] pTmpKernPairs;
@@ -1786,40 +1231,40 @@ X11SalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData *pKernPairs )
// ---------------------------------------------------------------------------
-BOOL X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
+sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
- return TRUE;
+ return sal_True;
}
// ---------------------------------------------------------------------------
-BOOL X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
+sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
::basegfx::B2DPolyPolygon& rPolyPoly )
{
int nLevel = nGlyphIndex >> GF_FONTSHIFT;
if( nLevel >= MAX_FALLBACK )
- return FALSE;
+ return sal_False;
ServerFont* pSF = mpServerFont[ nLevel ];
if( !pSF )
- return FALSE;
+ return sal_False;
nGlyphIndex &= ~GF_FONTMASK;
if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
//--------------------------------------------------------------------------
@@ -1842,10 +1287,6 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
#endif
pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
}
- else if( mXFont[ nFallbackLevel ] )
- pLayout = new X11FontLayout( *mXFont[ nFallbackLevel ] );
- else
- pLayout = NULL;
return pLayout;
}
@@ -1877,7 +1318,7 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const
//--------------------------------------------------------------------------
-BOOL X11SalGraphics::CreateFontSubset(
+sal_Bool X11SalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
sal_Int32* pGlyphIDs,
@@ -1909,7 +1350,6 @@ BOOL X11SalGraphics::CreateFontSubset(
const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1917,25 +1357,19 @@ const void* X11SalGraphics::GetEmbedFontData( const ImplFontData* pFont, const s
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen )
{
-#ifndef _USE_PRINT_EXTENSION_
PspGraphics::DoFreeEmbedFontData( pData, nLen );
-#endif
}
//--------------------------------------------------------------------------
const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pFont, const Ucs2OStrMap** pNonEncoded )
{
-#ifndef _USE_PRINT_EXTENSION_
// in this context the pFont->GetFontId() is a valid PSP
// font since they are the only ones left after the PDF
// export has filtered its list of subsettable fonts (for
@@ -1943,9 +1377,6 @@ const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const ImplFontData* pF
// be to have the GlyphCache search for the ImplFontData pFont
psp::fontID aFont = pFont->GetFontId();
return PspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded );
-#else
- return NULL;
-#endif
}
//--------------------------------------------------------------------------
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 6f94b5d90018..9951367d2e70 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -55,6 +55,8 @@
#include "vcl/svapp.hxx"
#include "vcl/jobset.h"
#include "vcl/print.h"
+#include "vcl/print.hxx"
+#include "vcl/pdfwriter.hxx"
#include "vcl/salptype.hxx"
#include "vcl/printerinfomanager.hxx"
@@ -62,7 +64,10 @@
#include "osl/module.h"
+#include <com/sun/star/beans/PropertyValue.hpp>
+
using namespace psp;
+using namespace com::sun::star;
using ::rtl::OUString;
using ::rtl::OUStringHash;
@@ -214,7 +219,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
}
else
{
@@ -589,15 +594,15 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
+sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
{
if( ! pFrame || ! pJobSetup )
- return FALSE;
+ return sal_False;
getPaLib();
if( ! pSetupFunction )
- return FALSE;
+ return sal_False;
PrinterInfoManager& rManager = PrinterInfoManager::get();
@@ -617,14 +622,14 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
void* pBuffer = NULL;
aInfo.getStreamBuffer( pBuffer, nBytes );
pJobSetup->mnDriverDataLen = nBytes;
- pJobSetup->mpDriverData = (BYTE*)pBuffer;
+ pJobSetup->mpDriverData = (sal_uInt8*)pBuffer;
// copy everything to job setup
copyJobDataToJobSetup( pJobSetup, aInfo );
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -634,7 +639,7 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
// data should be merged into the driver data
// If pJobSetup->mpDriverData IS NULL, then the driver defaults
// should be merged into the independent data
-BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
+sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
{
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
@@ -653,7 +658,7 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
copyJobDataToJobSetup( pJobSetup, m_aJobData );
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -662,8 +667,8 @@ BOOL PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
// and sets the new independ data in pJobSetup
// Only the data must be changed, where the bit
// in nGetDataFlags is set
-BOOL PspSalInfoPrinter::SetData(
- ULONG nSetDataFlags,
+sal_Bool PspSalInfoPrinter::SetData(
+ sal_uLong nSetDataFlags,
ImplJobSetup* pJobSetup )
{
JobData aData;
@@ -701,7 +706,7 @@ BOOL PspSalInfoPrinter::SetData(
}
if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) )
- return FALSE;
+ return sal_False;
}
// merge paperbin if necessary
@@ -761,10 +766,10 @@ BOOL PspSalInfoPrinter::SetData(
m_aJobData = aData;
copyJobDataToJobSetup( pJobSetup, aData );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -813,7 +818,7 @@ void PspSalInfoPrinter::GetPageInfo(
// -----------------------------------------------------------------------
-ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
+sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
{
if( ! pJobSetup )
return 0;
@@ -827,7 +832,7 @@ ULONG PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
// -----------------------------------------------------------------------
-String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG nPaperBin )
+String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin )
{
JobData aData;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
@@ -836,7 +841,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG
if( aData.m_pParser )
{
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
- if( ! pKey || nPaperBin >= (ULONG)pKey->countValues() )
+ if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() )
aRet = aData.m_pParser->getDefaultInputSlot();
else
{
@@ -851,7 +856,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG
// -----------------------------------------------------------------------
-ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT nType )
+sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType )
{
switch( nType )
{
@@ -885,9 +890,26 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
case PRINTER_CAPABILITIES_FAX:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "fax" ) ? 1 : 0;
case PRINTER_CAPABILITIES_PDF:
- return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) ? 1 : 0;
+ if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "pdf" ) )
+ return 1;
+ else
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
case PRINTER_CAPABILITIES_EXTERNALDIALOG:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->maPrinterName, "external_dialog" ) ? 1 : 0;
+ case PRINTER_CAPABILITIES_USEPULLMODEL:
+ {
+ // see if the PPD contains a value to set Collate to True
+ JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->maPrinterName );
+ if( pJobSetup->mpDriverData )
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
+ return aData.m_nPDFDevice > 0 ? 1 : 0;
+ }
default: break;
};
return 0;
@@ -903,6 +925,7 @@ ULONG PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, USHORT
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
+ m_bIsPDFWriterJob( false ),
m_pGraphics( NULL ),
m_nCopies( 1 ),
m_bCollate( false ),
@@ -927,11 +950,11 @@ static String getTmpName()
return aSys;
}
-BOOL PspSalPrinter::StartJob(
+sal_Bool PspSalPrinter::StartJob(
const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pJobSetup )
@@ -1007,29 +1030,35 @@ BOOL PspSalPrinter::StartJob(
}
m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
- return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? TRUE : FALSE;
+ return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::EndJob()
+sal_Bool PspSalPrinter::EndJob()
{
- BOOL bSuccess = m_aPrintJob.EndJob();
-
- if( bSuccess )
+ sal_Bool bSuccess = sal_False;
+ if( m_bIsPDFWriterJob )
+ bSuccess = sal_True;
+ else
{
- // check for fax
- if( m_bFax )
- {
+ bSuccess = m_aPrintJob.EndJob();
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- // sendAFax removes the file after use
- bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
- }
- else if( m_bPdf )
+ if( bSuccess )
{
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
- bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ // check for fax
+ if( m_bFax )
+ {
+
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ // sendAFax removes the file after use
+ bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
+ }
+ else if( m_bPdf )
+ {
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+ bSuccess = createPdf( m_aFileName, m_aTmpFile, rInfo.m_aCommand );
+ }
}
}
GetSalData()->m_pInstance->jobEndedPrinterUpdate();
@@ -1038,16 +1067,16 @@ BOOL PspSalPrinter::EndJob()
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::AbortJob()
+sal_Bool PspSalPrinter::AbortJob()
{
- BOOL bAbort = m_aPrintJob.AbortJob() ? TRUE : FALSE;
+ sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False;
GetSalData()->m_pInstance->jobEndedPrinterUpdate();
return bAbort;
}
// -----------------------------------------------------------------------
-SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL )
+SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool )
{
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL, m_bSwallowFaxNo, m_pInfoPrinter );
@@ -1068,20 +1097,286 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL )
// -----------------------------------------------------------------------
-BOOL PspSalPrinter::EndPage()
+sal_Bool PspSalPrinter::EndPage()
{
sal_Bool bResult = m_aPrintJob.EndPage();
m_aPrinterGfx.Clear();
- return bResult ? TRUE : FALSE;
+ return bResult ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-ULONG PspSalPrinter::GetErrorCode()
+sal_uLong PspSalPrinter::GetErrorCode()
{
return 0;
}
+// -----------------------------------------------------------------------
+
+struct PDFNewJobParameters
+{
+ Size maPageSize;
+ sal_uInt16 mnPaperBin;
+
+ PDFNewJobParameters( const Size& i_rSize = Size(),
+ sal_uInt16 i_nPaperBin = 0xffff )
+ : maPageSize( i_rSize ), mnPaperBin( i_nPaperBin ) {}
+
+ bool operator!=(const PDFNewJobParameters& rComp ) const
+ {
+ Size aCompLSSize( rComp.maPageSize.Height(), rComp.maPageSize.Width() );
+ return
+ (maPageSize != rComp.maPageSize && maPageSize != aCompLSSize)
+ || mnPaperBin != rComp.mnPaperBin
+ ;
+ }
+
+ bool operator==(const PDFNewJobParameters& rComp) const
+ {
+ return ! this->operator!=(rComp);
+ }
+};
+
+struct PDFPrintFile
+{
+ rtl::OUString maTmpURL;
+ PDFNewJobParameters maParameters;
+
+ PDFPrintFile( const rtl::OUString& i_rURL, const PDFNewJobParameters& i_rNewParameters )
+ : maTmpURL( i_rURL )
+ , maParameters( i_rNewParameters ) {}
+};
+
+sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJobName, const String& i_rAppName,
+ ImplJobSetup* i_pSetupData, vcl::PrinterController& i_rController )
+{
+ OSL_TRACE( "StartJob with controller: pFilename = %s", i_pFileName ? rtl::OUStringToOString( *i_pFileName, RTL_TEXTENCODING_UTF8 ).getStr() : "<nil>" );
+ // mark for endjob
+ m_bIsPDFWriterJob = true;
+ // reset IsLastPage
+ i_rController.setLastPage( sal_False );
+
+ // update job data
+ if( i_pSetupData )
+ JobData::constructFromStreamBuffer( i_pSetupData->mpDriverData, i_pSetupData->mnDriverDataLen, m_aJobData );
+
+ OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 );
+ m_aJobData.m_nPDFDevice = 1;
+
+ // possibly create one job for collated output
+ sal_Bool bSinglePrintJobs = sal_False;
+ beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) );
+ if( pSingleValue )
+ {
+ pSingleValue->Value >>= bSinglePrintJobs;
+ }
+
+ int nCopies = i_rController.getPrinter()->GetCopyCount();
+ bool bCollate = i_rController.getPrinter()->IsCollateCopy();
+
+ // notify start of real print job
+ i_rController.jobStarted();
+
+ // setup PDFWriter context
+ vcl::PDFWriter::PDFWriterContext aContext;
+ aContext.Version = vcl::PDFWriter::PDF_1_4;
+ aContext.Tagged = false;
+ aContext.EmbedStandardFonts = true;
+ aContext.DocumentLocale = Application::GetSettings().GetLocale();
+ aContext.ColorMode = i_rController.getPrinter()->GetPrinterOptions().IsConvertToGreyscales()
+ ? vcl::PDFWriter::DrawGreyscale : vcl::PDFWriter::DrawColor;
+
+ // prepare doc info
+ aContext.DocumentInfo.Title = i_rJobName;
+ aContext.DocumentInfo.Creator = i_rAppName;
+ aContext.DocumentInfo.Producer = i_rAppName;
+
+ // define how we handle metafiles in PDFWriter
+ vcl::PDFWriter::PlayMetafileContext aMtfContext;
+ aMtfContext.m_bOnlyLosslessCompression = true;
+
+ boost::shared_ptr<vcl::PDFWriter> pWriter;
+ std::vector< PDFPrintFile > aPDFFiles;
+ boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
+ int nAllPages = i_rController.getFilteredPageCount();
+ i_rController.createProgressDialog();
+ bool bAborted = false;
+ PDFNewJobParameters aLastParm;
+
+ aContext.DPIx = pPrinter->ImplGetDPIX();
+ aContext.DPIy = pPrinter->ImplGetDPIY();
+ for( int nPage = 0; nPage < nAllPages && ! bAborted; nPage++ )
+ {
+ if( nPage == nAllPages-1 )
+ i_rController.setLastPage( sal_True );
+
+ // get the page's metafile
+ GDIMetaFile aPageFile;
+ vcl::PrinterController::PageSize aPageSize = i_rController.getFilteredPageFile( nPage, aPageFile );
+ if( i_rController.isProgressCanceled() )
+ {
+ bAborted = true;
+ if( nPage != nAllPages-1 )
+ {
+ i_rController.createProgressDialog();
+ i_rController.setLastPage( sal_True );
+ i_rController.getFilteredPageFile( nPage, aPageFile );
+ }
+ }
+ else
+ {
+ pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetPaperSizeUser( aPageSize.aSize, true );
+ PDFNewJobParameters aNewParm( pPrinter->GetPaperSize(), pPrinter->GetPaperBin() );
+
+ // create PDF writer on demand
+ // either on first page
+ // or on paper format change - cups does not support multiple paper formats per job (yet?)
+ // so we need to start a new job to get a new paper format from the printer
+ // orientation switches (that is switch of height and width) is handled transparently by CUPS
+ if( ! pWriter ||
+ (aNewParm != aLastParm && ! i_pFileName ) )
+ {
+ if( pWriter )
+ {
+ pWriter->Emit();
+ }
+ // produce PDF file
+ OUString aPDFUrl;
+ if( i_pFileName )
+ aPDFUrl = *i_pFileName;
+ else
+ osl_createTempFile( NULL, NULL, &aPDFUrl.pData );
+ // normalize to file URL
+ if( aPDFUrl.compareToAscii( "file:", 5 ) != 0 )
+ {
+ // this is not a file URL, but it should
+ // form it into a osl friendly file URL
+ rtl::OUString aTmp;
+ osl_getFileURLFromSystemPath( aPDFUrl.pData, &aTmp.pData );
+ aPDFUrl = aTmp;
+ }
+ // save current file and paper format
+ aLastParm = aNewParm;
+ aPDFFiles.push_back( PDFPrintFile( aPDFUrl, aNewParm ) );
+ // update context
+ aContext.URL = aPDFUrl;
+
+ // create and initialize PDFWriter
+ #if defined __SUNPRO_CC
+ #pragma disable_warn
+ #endif
+ pWriter.reset( new vcl::PDFWriter( aContext, uno::Reference< beans::XMaterialHolder >() ) );
+ #if defined __SUNPRO_CC
+ #pragma enable_warn
+ #endif
+ }
+
+ pWriter->NewPage( TenMuToPt( aNewParm.maPageSize.Width() ),
+ TenMuToPt( aNewParm.maPageSize.Height() ),
+ vcl::PDFWriter::Portrait );
+
+ pWriter->PlayMetafile( aPageFile, aMtfContext, NULL );
+ }
+ }
+
+ // emit the last file
+ if( pWriter )
+ pWriter->Emit();
+
+ // handle collate, copy count and multiple jobs correctly
+ int nOuterJobs = 1;
+ if( bSinglePrintJobs )
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ else
+ {
+ if( bCollate )
+ {
+ if( aPDFFiles.size() == 1 && pPrinter->HasSupport( SUPPORT_COLLATECOPY ) )
+ {
+ m_aJobData.setCollate( true );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ else
+ {
+ nOuterJobs = nCopies;
+ m_aJobData.m_nCopies = 1;
+ }
+ }
+ else
+ {
+ m_aJobData.setCollate( false );
+ m_aJobData.m_nCopies = nCopies;
+ }
+ }
+
+ // spool files
+ if( ! i_pFileName && ! bAborted )
+ {
+ bool bFirstJob = true;
+ for( int nCurJob = 0; nCurJob < nOuterJobs; nCurJob++ )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ oslFileHandle pFile = NULL;
+ osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
+ if( pFile )
+ {
+ osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
+ std::vector< char > buffer( 0x10000, 0 );
+ // update job data with current page size
+ Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
+ m_aJobData.setPaper( TenMuToPt( aPageSize.Width() ), TenMuToPt( aPageSize.Height() ) );
+ // update job data with current paperbin
+ m_aJobData.setPaperBin( aPDFFiles[i].maParameters.mnPaperBin );
+
+ // spool current file
+ FILE* fp = PrinterInfoManager::get().startSpool( pPrinter->GetName(), i_rController.isDirectPrint() );
+ if( fp )
+ {
+ sal_uInt64 nBytesRead = 0;
+ do
+ {
+ osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ if( nBytesRead > 0 )
+ fwrite( &buffer[0], 1, nBytesRead, fp );
+ } while( nBytesRead == buffer.size() );
+ rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 );
+ aBuf.append( i_rJobName );
+ if( i > 0 || nCurJob > 0 )
+ {
+ aBuf.append( sal_Unicode(' ') );
+ aBuf.append( sal_Int32( i + nCurJob * aPDFFiles.size() ) );
+ }
+ PrinterInfoManager::get().endSpool( pPrinter->GetName(), aBuf.makeStringAndClear(), fp, m_aJobData, bFirstJob );
+ bFirstJob = false;
+ }
+ }
+ osl_closeFile( pFile );
+ }
+ }
+ }
+
+ // job has been spooled
+ i_rController.setJobState( bAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED );
+
+ // clean up the temporary PDF files
+ if( ! i_pFileName || bAborted )
+ {
+ for( size_t i = 0; i < aPDFFiles.size(); i++ )
+ {
+ osl_removeFile( aPDFFiles[i].maTmpURL.pData );
+ OSL_TRACE( "removed print PDF file %s\n", rtl::OUStringToOString( aPDFFiles[i].maTmpURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+
+ return sal_True;
+}
+
+
namespace x11
{
class PrinterUpdate
diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx
index ce8421f14f49..c6797cc6418c 100644
--- a/vcl/unx/source/gdi/salvd.cxx
+++ b/vcl/unx/source/gdi/salvd.cxx
@@ -45,7 +45,7 @@
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData )
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData )
{
X11SalVirtualDevice *pVDev = new X11SalVirtualDevice();
if( !nBitCount && pGraphics )
@@ -127,14 +127,14 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap,
m_pFrame = NULL;
bWindow_ = pDisplay->IsDisplay();
- bVirDev_ = TRUE;
+ bVirDev_ = sal_True;
}
// -=-= SalVirDevData / SalVirtualDevice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
+sal_Bool X11SalVirtualDevice::Init( SalDisplay *pDisplay,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
int nScreen,
Pixmap hDrawable,
XRenderPictFormat* pXRenderFormat )
@@ -171,12 +171,12 @@ BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
else
{
hDrawable_ = hDrawable;
- bExternPixmap_ = TRUE;
+ bExternPixmap_ = sal_True;
}
pGraphics_->Init( this, pColormap, bDeleteColormap );
- return hDrawable_ != None ? TRUE : FALSE;
+ return hDrawable_ != None ? sal_True : sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -188,8 +188,8 @@ X11SalVirtualDevice::X11SalVirtualDevice()
nDX_ = 0;
nDY_ = 0;
nDepth_ = 0;
- bGraphics_ = FALSE;
- bExternPixmap_ = FALSE;
+ bGraphics_ = sal_False;
+ bExternPixmap_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -209,18 +209,18 @@ SalGraphics* X11SalVirtualDevice::GetGraphics()
return NULL;
if( pGraphics_ )
- bGraphics_ = TRUE;
+ bGraphics_ = sal_True;
return pGraphics_;
}
void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* )
-{ bGraphics_ = FALSE; }
+{ bGraphics_ = sal_False; }
-BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool X11SalVirtualDevice::SetSize( long nDX, long nDY )
{
if( bExternPixmap_ )
- return FALSE;
+ return sal_False;
// #144688#
// the X protocol request CreatePixmap puts an upper bound
@@ -230,7 +230,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
// 16 bit truncation here without noticing.
if( nDX < 0 || nDX > 65535 ||
nDY < 0 || nDY > 65535 )
- return FALSE;
+ return sal_False;
if( !nDX ) nDX = 1;
if( !nDY ) nDY = 1;
@@ -249,7 +249,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
nDX_ = 1;
nDY_ = 1;
}
- return FALSE;
+ return sal_False;
}
if( GetDrawable() )
@@ -262,7 +262,7 @@ BOOL X11SalVirtualDevice::SetSize( long nDX, long nDY )
if( pGraphics_ )
InitGraphics( this );
- return TRUE;
+ return sal_True;
}
void X11SalVirtualDevice::GetSize( long& rWidth, long& rHeight )
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
deleted file mode 100644
index 0408a4ab7511..000000000000
--- a/vcl/unx/source/gdi/xfont.cxx
+++ /dev/null
@@ -1,763 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-#include <salunx.h>
-#include "xfont.hxx"
-#include "xlfd_extd.hxx"
-#include "salcvt.hxx"
-#include <tools/string.hxx>
-#include <vcl/outfont.hxx>
-#include <saldisp.hxx>
-#include <salgdi.h>
-
-// for GetMirroredChar
-#include <vcl/svapp.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-#include <cstdio>
-#endif
-
-#include <algorithm>
-
-#define VCLASS_ROTATE 0
-#define VCLASS_ROTATE_REVERSE 1
-#define VCLASS_TRANSFORM1 2
-#define VCLASS_TRANSFORM2 3
-#define VCLASS_CJK 4
-#define VCLASS_DONTKNOW 5
-#define VCLASS_FONT_NUM 2 // Other than rotate and rotate_reverse,
- // don't have spacial font
-
-// Select the max size of a font, which is token for real
-// This routine is (and should be) called only once, the result should be
-// stored in some static variable
-
-static int GetMaxFontHeight()
-{
- static int nMaxFontHeight = 0;
- if( nMaxFontHeight <= 0 )
- {
- const char *pFontHeight = getenv ("SAL_MAXFONTHEIGHT");
- if( pFontHeight )
- nMaxFontHeight = atoi( pFontHeight );
- static const int DEFAULT_MAXFONTHEIGHT = 250;
- if (nMaxFontHeight <= 20)
- nMaxFontHeight = DEFAULT_MAXFONTHEIGHT;
- }
-
- return nMaxFontHeight;
-}
-
-
-ExtendedFontStruct::ExtendedFontStruct( Display* pDisplay, const Size& rPixelSize,
- sal_Bool bVertical, ExtendedXlfd* pXlfd ) :
- mpDisplay( pDisplay ),
- maPixelSize( rPixelSize ),
- mfXScale(1.0), mfYScale(1.0),
- mbVertical( bVertical ),
- mnCachedEncoding( RTL_TEXTENCODING_DONTKNOW ),
- mpXlfd( pXlfd ),
- mpRangeCodes(NULL),
- mnRangeCount(-1)
-{
- if( !maPixelSize.Width() )
- maPixelSize.Width() = maPixelSize.Height();
- mnAsciiEncoding = GetAsciiEncoding (NULL);
- mnDefaultWidth = GetDefaultWidth();
-
- mpXFontStruct = (XFontStruct**)calloc( mpXlfd->NumEncodings(),
- sizeof(XFontStruct*) );
-}
-
-ExtendedFontStruct::~ExtendedFontStruct()
-{
- delete[] mpRangeCodes;
-
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[nIdx] != NULL )
- XFreeFont( mpDisplay, mpXFontStruct[nIdx] );
-
- free(mpXFontStruct);
-}
-
-rtl_TextEncoding
-ExtendedFontStruct::GetAsciiEncoding( int *pAsciiRange ) const
-{
- return mpXlfd->GetAsciiEncoding( pAsciiRange );
-}
-
-FontPitch
-ExtendedFontStruct::GetSpacing( rtl_TextEncoding nEncoding )
-{
- return mpXlfd->GetPitch( nEncoding );
-}
-
-static XFontStruct*
-LoadXFont (Display* pDisplay, const char* pFontName)
-{
- XFontStruct* pFont = XLoadQueryFont (pDisplay, pFontName);
- if ((pFont != NULL) && (pFont->fid == 0))
- pFont->fid = XLoadFont(pDisplay, pFontName);
-
- return pFont;
-}
-
-int
-ExtendedFontStruct::LoadEncoding( rtl_TextEncoding nEncoding )
-{
- int nIdx = mpXlfd->GetEncodingIdx( nEncoding );
- if ( (nIdx < 0) || (mpXFontStruct[ nIdx ] != NULL) )
- return nIdx;
-
- // limit font height that gets requested from the XServer
- int nReqPixelHeight = maPixelSize.Height();
- if( nReqPixelHeight > GetMaxFontHeight() )
- nReqPixelHeight = GetMaxFontHeight();
- else if( nReqPixelHeight < 2 )
- nReqPixelHeight = 2;
-
- // get the X11 font from a matching XLFD
- ByteString aFontName;
- mpXlfd->ToString( aFontName, nReqPixelHeight, nEncoding );
- mpXFontStruct[ nIdx ] = LoadXFont( mpDisplay, aFontName.GetBuffer() );
- if (mpXFontStruct[nIdx] == NULL)
- mpXFontStruct[nIdx] = LoadXFont( mpDisplay, "fixed" );
-
- // calculate correction factors to improve matching
- // the selected font size to the used bitmap font
- int nRealPixelSize = mpXlfd->GetPixelSize();
- if( !nRealPixelSize ) // check for scalable mpXlfd
- nRealPixelSize = nReqPixelHeight;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Width()) )
- mfXScale = (float)maPixelSize.Width() / nRealPixelSize;
- if( nRealPixelSize && (nRealPixelSize != maPixelSize.Height()) )
- mfYScale = (float)maPixelSize.Height() / nRealPixelSize;
-
- return nIdx;
-}
-
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( rtl_TextEncoding nEncoding )
-{
- int nIdx = LoadEncoding( nEncoding );
- return nIdx < 0 ? NULL : mpXFontStruct[nIdx] ;
-}
-
-bool
-ExtendedFontStruct::GetFontBoundingBox( XCharStruct *pCharStruct,
- int *pAscent, int *pDescent )
-{
- pCharStruct->lbearing = 0;
- pCharStruct->rbearing = 0;
- pCharStruct->width = 0;
- pCharStruct->ascent = 0;
- pCharStruct->descent = 0;
-
- *pAscent = 0;
- *pDescent = 0;
-
- int nIdx;
-
- // check if there is at least one encoding already loaded
- bool bEmpty = true;
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- bEmpty &= (mpXFontStruct[nIdx] == NULL);
- if ( bEmpty )
- LoadEncoding( mpXlfd->GetAsciiEncoding() );
-
- // get the max bounding box from all font structs
- for ( nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- if ( mpXFontStruct[ nIdx ] != NULL )
- {
- *pAscent = std::max( mpXFontStruct[nIdx]->ascent, *pAscent );
- *pDescent = std::max( mpXFontStruct[nIdx]->descent, *pDescent );
-
- XCharStruct* pMaxBounds = &(mpXFontStruct[nIdx]->max_bounds);
-
- pCharStruct->lbearing = std::max( pMaxBounds->lbearing,
- pCharStruct->lbearing );
- pCharStruct->rbearing = std::max( pMaxBounds->rbearing,
- pCharStruct->rbearing );
- pCharStruct->width = std::max( pMaxBounds->width,
- pCharStruct->width );
- pCharStruct->ascent = std::max( pMaxBounds->ascent,
- pCharStruct->ascent );
- pCharStruct->descent = std::max( pMaxBounds->descent,
- pCharStruct->descent );
- }
-
- // apply correction factors to better match selected size to available size
- if( mfYScale != 1.0 )
- {
- *pAscent = int(*pAscent * mfYScale);
- *pDescent = int(*pDescent * mfYScale);
- pCharStruct->ascent = (short int)(pCharStruct->ascent * mfYScale);
- pCharStruct->descent = (short int)(pCharStruct->descent * mfYScale);
- }
- if( mfXScale != 1.0 )
- {
- pCharStruct->lbearing = (short int)(pCharStruct->lbearing * mfXScale);
- pCharStruct->rbearing = (short int)(pCharStruct->rbearing * mfXScale);
- pCharStruct->width = (short int)(pCharStruct->width * mfXScale);
- }
-
- return (pCharStruct->width > 0);
-}
-
-bool
-ExtendedFontStruct::ToImplFontMetricData(ImplFontMetricData *pFontMetric)
-{
- pFontMetric->mnOrientation = 0;
- pFontMetric->mnSlant = 0;
- pFontMetric->mbDevice = true;
- pFontMetric->mbScalableFont = mpXlfd->IsScalable();
- pFontMetric->mbKernableFont = false;
- pFontMetric->mbSymbolFlag= mpXlfd->IsSymbolFont();
- pFontMetric->meFamily = mpXlfd->GetFamilyType();
- pFontMetric->meWeight = mpXlfd->GetWeight();
- pFontMetric->mePitch = mpXlfd->GetPitch();
- pFontMetric->meItalic = mpXlfd->GetSlant();
-
- int nAscent, nDescent;
- XCharStruct aBoundingBox;
- if ( GetFontBoundingBox(&aBoundingBox, &nAscent, &nDescent) )
- {
- pFontMetric->mnWidth = aBoundingBox.width;
- pFontMetric->mnAscent = aBoundingBox.ascent;
- pFontMetric->mnDescent = aBoundingBox.descent;
- pFontMetric->mnIntLeading = std::max(0, aBoundingBox.ascent - nAscent
- + aBoundingBox.descent - nDescent );
- pFontMetric->mnExtLeading = 0; // TODO!!!
- return true;
- }
- else
- {
- return false;
- }
-}
-
-bool
-ExtendedFontStruct::Match( const ExtendedXlfd *pXlfd,
- const Size& rPixelSize, sal_Bool bVertical ) const
-{
- if( mpXlfd != pXlfd )
- return false;
-
- if( bVertical != mbVertical )
- return FALSE;
-
- if( rPixelSize.Height() != maPixelSize.Height() )
- return FALSE;
-
- long nReqWidth = rPixelSize.Width();
- if( !nReqWidth )
- nReqWidth = rPixelSize.Height();
- if( nReqWidth != maPixelSize.Width() )
- return FALSE;
-
- return true;
-}
-
-// Get an appropriate x-font that contains a glyph for the given unicode
-// code point.
-// This routine is designed to be called for each character in a text.
-// It first checks the given encoding to optimize for the fact that two
-// adjacent characters in a text most probably have the same encoding
-// In the first call initialize pEncodingInOut to dontknow, this causes
-// EncodingHasChar() to fail and thus bootstraps the encoding, otherwise
-// make sure that the initial value of pFontInOut matches the encoding and
-// that the encoding is valid for the font.
-XFontStruct*
-ExtendedFontStruct::GetFontStruct( sal_Unicode nChar, rtl_TextEncoding *pEncoding )
-{
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
-
- if ( pCvt->EncodingHasChar(mnAsciiEncoding, nChar) )
- {
- *pEncoding = mnAsciiEncoding;
- return GetFontStruct (mnAsciiEncoding);
- }
- else
- if ( pCvt->EncodingHasChar(mnCachedEncoding, nChar) )
- {
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- else
- {
- for ( int nIdx = 0; nIdx < mpXlfd->NumEncodings(); nIdx++ )
- {
- rtl_TextEncoding nEnc = mpXlfd->GetEncoding(nIdx);
- if ( (nEnc != mnCachedEncoding) && (nEnc != mnAsciiEncoding)
- && pCvt->EncodingHasChar(nEnc, nChar))
- {
- mnCachedEncoding = nEnc;
- *pEncoding = mnCachedEncoding;
- return GetFontStruct (mnCachedEncoding);
- }
- }
- }
-
- *pEncoding = RTL_TEXTENCODING_DONTKNOW;
- return NULL;
-}
-
-// ---------------------------------------------------------------------------
-// utility functions to handle xfontstruct information, this is all to
-// calculate charwidth information
-// ---------------------------------------------------------------------------
-
-static bool
-CharExists( const XCharStruct* pChar )
-{
- if ( pChar == NULL )
- return false;
-
- return pChar->width
- || pChar->ascent || pChar->descent
- || pChar->lbearing || pChar->rbearing;
-}
-
-// this relies on non-null per_char information in the fontstruct
-static XCharStruct*
-GetCharinfo( const XFontStruct *pXFontStruct, sal_MultiByte nChar )
-{
- unsigned int nRow = nChar >> 8;
- unsigned int nCol = nChar & 0xFF;
-
- unsigned int nMinRow = pXFontStruct->min_byte1;
- unsigned int nMaxRow = pXFontStruct->max_byte1;
- unsigned int nMinCol = pXFontStruct->min_char_or_byte2;
- unsigned int nMaxCol = pXFontStruct->max_char_or_byte2;
-
- if ( nRow >= nMinRow && nRow <= nMaxRow
- && nCol >= nMinCol && nCol <= nMaxCol )
- {
- return &pXFontStruct->per_char[
- (nRow-nMinRow) * (nMaxCol-nMinCol+1) + (nCol-nMinCol) ];
- }
-
- return NULL;
-}
-
-static sal_Size
-QueryCharWidth16( Display* pDisplay, XLIB_Font nFontID, sal_MultiByte nChar,
- sal_Size nDefaultWidth )
-{
- int nDirection, nFontAscent, nFontDescent;
- XCharStruct aBoundingBox;
-
- XQueryTextExtents16( pDisplay, nFontID, (XChar2b*)&nChar, 1,
- &nDirection, &nFontAscent, &nFontDescent, &aBoundingBox );
-
- return CharExists( &aBoundingBox ) ? aBoundingBox.width : nDefaultWidth;
-}
-
-sal_Size
-ExtendedFontStruct::GetDefaultWidth()
-{
- return (maPixelSize.Width() + 1) / 2;
-}
-
-// Handle single byte fonts which do not require conversion, this exploits
-// the fact that unicode equals latin1 or ansi1252 in the range [0..0xff] and
-// is compatible with iso8859-X at least in the range to 0x7f
-sal_Size
-ExtendedFontStruct::GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, rtl_TextEncoding nEncoding )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( nEncoding );
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // fixed width font
- for ( int nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // variable width font
- int nMinChar = pXFontStruct->min_char_or_byte2;
- int nMaxChar = pXFontStruct->max_char_or_byte2;
-
- int nIdx = nFrom;
-
- for ( ; nIdx < std::min((int)nTo, nMinChar); nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- for ( ; nIdx <= std::min((int)nTo, nMaxChar); nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = &(pXFontStruct->per_char[nIdx - nMinChar]);
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- for ( ; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = mnDefaultWidth;
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// Handle utf16 encoded fonts, which do not require conversion
-sal_Size
-ExtendedFontStruct::GetCharWidthUTF16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray )
-{
- if ( !(nFrom <= nTo) )
- return 0;
-
- XFontStruct* pXFontStruct = GetFontStruct( RTL_TEXTENCODING_UNICODE );
- FontPitch nSpacing = mpXlfd->GetPitch( RTL_TEXTENCODING_UNICODE );
-
- if ( pXFontStruct == NULL )
- return 0;
-
- // query the font metrics
- if ( nSpacing == PITCH_VARIABLE
- && pXFontStruct->per_char == NULL)
- {
- // get per_char information from the server
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = QueryCharWidth16( mpDisplay, pXFontStruct->fid,
- nIdx, mnDefaultWidth );
- }
- else
- if ( (pXFontStruct->max_bounds.width == pXFontStruct->min_bounds.width)
- || (pXFontStruct->per_char == NULL) )
- {
- // really a fixed width font
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- *pWidthArray = pXFontStruct->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- for ( sal_Int32 nIdx = nFrom; nIdx <= nTo; nIdx++, pWidthArray++ )
- {
- XCharStruct* pChar = GetCharinfo( pXFontStruct, nIdx );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-// handle non unicode fonts that are converted into encoding matching the
-// font in fontstruct, 8 and 16 bit fonts are handled the same way
-sal_Size
-ExtendedFontStruct::GetCharWidth16( sal_Unicode nFrom, sal_Unicode nTo,
- sal_Int32* pWidthArray, ExtendedFontStruct *pFallback )
-{
- if ( nFrom > nTo )
- return 0;
-
- sal_Char pBuffer[64];
-
- SalConverterCache *pCvt = SalConverterCache::GetInstance();
- for ( sal_Int32 nIdx = nFrom ; nIdx <= nTo ; nIdx++, pWidthArray++ )
- {
- FontPitch nSpacing;
- sal_Size nSize;
- sal_Unicode nUniIdx = (sal_Unicode)nIdx;
-
- // get a matching fontstruct
- rtl_TextEncoding nEnc;
- XFontStruct *pFont;
-
- if ( (pFont = GetFontStruct(nUniIdx, &nEnc)) != NULL )
- {
- nSpacing = GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx, &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- if ( (pFallback != NULL)
- && ((pFont = pFallback->GetFontStruct(nUniIdx = '?', &nEnc)) != NULL) )
- {
- nSpacing = pFallback->GetSpacing( nEnc );
- }
- else
- {
- // TODO What should the default value be?
- nSpacing = PITCH_FIXED;
- }
-
- if ( pFont )
- {
- nSize = pCvt->ConvertStringUTF16(&nUniIdx, 1, pBuffer, sizeof(pBuffer), nEnc);
- // XXX FIXME
- if ((nEnc == RTL_TEXTENCODING_GB_2312) || (nEnc == RTL_TEXTENCODING_EUC_KR))
- {
- for (unsigned int n_char = 0; n_char < nSize; n_char++ )
- pBuffer[ n_char ] &= 0x7F;
- }
- }
-
- // query font metrics
- if ( pFont && (nSize == 1 || nSize == 2) )
- {
- sal_MultiByte nChar = (nSize == 1) ? (unsigned char)pBuffer[0] :
- ((sal_MultiByte)pBuffer[0] << 8) + (sal_MultiByte)pBuffer[1];
-
- if ( nSpacing == PITCH_VARIABLE
- && pFont->per_char == NULL)
- {
- // get per_char information from the x-server
- *pWidthArray = QueryCharWidth16( mpDisplay, pFont->fid,
- nChar, mnDefaultWidth );
- }
- else
- if ( (pFont->max_bounds.width == pFont->min_bounds.width)
- || (pFont->per_char == NULL) )
- {
- // fixed width font
- *pWidthArray = pFont->max_bounds.width;
- }
- else
- {
- // get per_char information from the xfontstruct
- XCharStruct* pChar = GetCharinfo( pFont, nChar );
- *pWidthArray = CharExists(pChar) ? pChar->width : mnDefaultWidth;
- }
- }
- else
- {
- // conversion error
- *pWidthArray = mnDefaultWidth;
- }
- }
-
- // return amount of handled chars
- return nTo - nFrom + 1;
-}
-
-sal_Size
-ExtendedFontStruct::GetCharWidth( sal_Unicode cChar, sal_Int32 *pPhysicalWidth,
- sal_Int32 *pLogicalWidth )
-{
- sal_Size nConverted = 0;
-
- // dispatch querying of metrics to most promising encoding candidate
- int nAsciiRange;
- rtl_TextEncoding nEncoding = mpXlfd->GetAsciiEncoding(&nAsciiRange);
- if ( nEncoding == RTL_TEXTENCODING_UNICODE )
- {
- // if we have a unicode encoded system font than we get the charwidth
- // straight forward
- nConverted = GetCharWidthUTF16( cChar, cChar, pPhysicalWidth );
- }
- else
- {
- if ( cChar < nAsciiRange )
- {
- // optimize the most frequent case, requesting only the latin1
- // chars which are mappable to a single encoding
- nConverted = GetCharWidth8( cChar, cChar, pPhysicalWidth, nEncoding );
- }
-
- // if further requests are pending, then the according unicode
- // codepoint has to be dispatched to one of the system fonts and
- // converted to this fonts encoding
- nConverted += GetCharWidth16( cChar + nConverted, cChar,
- pPhysicalWidth + nConverted, NULL );
- }
-
- // convert physical width to logical width, apply correction factor if needed
- *pLogicalWidth = *pPhysicalWidth;
- if( mfXScale != 1.0 )
- *pLogicalWidth = sal_Int32(*pLogicalWidth * mfXScale);
-
- return nConverted;
-}
-
-bool ExtendedFontStruct::HasUnicodeChar( sal_Unicode cChar ) const
-{
- // #i18818# return false if there are no known encodings
- if( !mnRangeCount )
- return false;
-
- // init unicode range cache if needed
- if( mnRangeCount < 0 )
- {
- mnRangeCount = mpXlfd->GetFontCodeRanges( NULL );
- if( !mnRangeCount )
- return false;
- mpRangeCodes = new sal_uInt32[ 2*mnRangeCount ];
- mpXlfd->GetFontCodeRanges( mpRangeCodes );
- // TODO: make sure everything is sorted
- }
-
- // binary search in unicode ranges
- int nLower = 0;
- int nMid = mnRangeCount;
- int nUpper = 2 * mnRangeCount - 1;
- while( nLower < nUpper )
- {
- if( cChar >= mpRangeCodes[ nMid ] )
- nLower = nMid;
- else
- nUpper = nMid - 1;
- nMid = (nLower + nUpper + 1) / 2;
- }
- if( (nMid == 0) && (cChar < mpRangeCodes[0]) )
- return false;
- return (nMid & 1) ? false: true;
-}
-
-int ExtendedFontStruct::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- // make sure unicode range cache is initialized
- HasUnicodeChar(0);
-
- // transfer range pairs if requested
- if( pCodePairs )
- {
- for( int i = 0; i < 2*mnRangeCount; ++i )
- pCodePairs[i] = mpRangeCodes[i];
- }
-
- return mnRangeCount;
-}
-
-// =======================================================================
-
-X11FontLayout::X11FontLayout( ExtendedFontStruct& rFont )
-: mrFont( rFont )
-{}
-
-// -----------------------------------------------------------------------
-
-bool X11FontLayout::LayoutText( ImplLayoutArgs& rArgs )
-{
- Point aNewPos( 0, 0 );
- bool bRightToLeft;
- int nCharPos;
-
- for( nCharPos = -1; rArgs.GetNextPos( &nCharPos, &bRightToLeft ); )
- {
- sal_UCS4 cChar = rArgs.mpStr[ nCharPos ];
- if( bRightToLeft )
- cChar = GetMirroredChar( cChar );
- int nGlyphIndex = cChar | GF_ISCHAR;
-
- // check if the font supports the char
- if( !mrFont.HasUnicodeChar( cChar ) )
- {
- // try to replace the failing char using the same font
- const char* pApproxUTF8 = GetAutofallback( cChar );
- cChar = 0;
- if( pApproxUTF8 )
- {
- String aApproxStr( pApproxUTF8, RTL_TEXTENCODING_UTF8 );
- if( aApproxStr.Len() == 1 )
- {
- // TODO: support Autofallback for len>1
- sal_Unicode cApprox = aApproxStr.GetChar( 0 );
- if( mrFont.HasUnicodeChar( cApprox ) )
- nGlyphIndex = (cChar = cApprox) | GF_ISCHAR;
- }
- }
- // request fallback glyph if necessary
- if( !cChar )
- {
- rArgs.NeedFallback( nCharPos, bRightToLeft );
- if( rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK )
- nGlyphIndex = 0; // drop NotDef fallback glyphs
- }
- }
-
- sal_Int32 nPhysGlyphWidth, nLogGlyphWidth;
- mrFont.GetCharWidth( cChar, &nPhysGlyphWidth, &nLogGlyphWidth );
- int nGlyphFlags = (nPhysGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER;
- if( bRightToLeft )
- nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nPhysGlyphWidth );
- aGI.mnNewWidth = nLogGlyphWidth;
- AppendGlyph( aGI );
-
- aNewPos.X() += nLogGlyphWidth;
- }
-
- return (nCharPos >= 0);
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
-{
- GenericSalLayout::AdjustLayout( rArgs );
- SetOrientation( 0 ); // X11 fonts are to be rotated in upper layers
-}
-
-// -----------------------------------------------------------------------
-
-void X11FontLayout::DrawText( SalGraphics& rSalGraphics ) const
-{
- static const int MAXGLYPHS = 160;
- int nMaxGlyphs = GetOrientation() ? 1 : MAXGLYPHS;
-
- // workaround for #i49902# similar to #b6228733 with XDrawText items
- // => output each item separately for non-unicode font encodings!
- // this is done here instead of in DrawStringUCS2MB() because
- // it needs the item positions and they are easily available here
- if( mrFont.GetAsciiEncoding() != RTL_TEXTENCODING_UNICODE )
- nMaxGlyphs = 1;
-
- Point aPos;
- sal_GlyphId aGlyphAry[ MAXGLYPHS ];
- sal_Unicode pStr[ MAXGLYPHS ];
- for( int nStart=0;;)
- {
- int nGlyphCount = GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart );
- if( !nGlyphCount )
- break;
-
- for( int i = 0; i < nGlyphCount; ++i )
- pStr[ i ] = aGlyphAry[ i ] & GF_IDXMASK;
-
- static_cast<X11SalGraphics&>(rSalGraphics).DrawStringUCS2MB( mrFont, aPos, pStr, nGlyphCount );
- }
-}
-
-// =======================================================================
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_attr.cxx b/vcl/unx/source/gdi/xlfd_attr.cxx
deleted file mode 100644
index f8b2adab0456..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.cxx
+++ /dev/null
@@ -1,698 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <memory>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sal/alloca.h>
-#include <sal/macros.h>
-#include "xlfd_attr.hxx"
-#include <rtl/tencinfo.h>
-#include <vcl/vclenum.hxx>
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute is a container for simple name value pairs
-// eg. ( "times", FAMILY_ROMAN ) or ( "demi bold", WEIGHT_SEMIBOLD )
-// enriched with an annotation which is a pretty-printed version of the
-// string, i.e. "itc avant garde" would get an annotation of "Itc Avant Garde"
-//
-//
-// ---------------------------------------------------------------------------
-
-// release the stored string
-void
-Attribute::Release()
-{
- if ( mpAnnotation != NULL )
- delete mpAnnotation;
- if ( mpKeyName != NULL )
- delete mpKeyName;
- if ( mpName != NULL )
- free( (void*)mpName );
-}
-
-// get a private copy of the given argument
-void
-Attribute::SetName( const char *p, int nLen )
-{
- mpName = (char*)malloc( nLen + 1 );
- mnLength = nLen;
- memcpy( (void*)mpName, p, mnLength );
- ((char*)mpName)[ mnLength ] = '\0';
-}
-
-// Compare whether two strings a equal for the first nLen bytes
-// i.e. arial == arialnarrow
-int
-Attribute::Compare( const char *p, int nLen )
-{
- return strncmp( mpName, p, nLen );
-}
-
-// Get a all lowercase name with all blanks removed
-const rtl::OString&
-Attribute::GetKey ()
-{
- static rtl::OString aEmptyStr;
-
- if (mpKeyName != NULL)
- return *mpKeyName;
- if (mnLength == 0)
- return aEmptyStr;
-
- sal_Char* pBuffer = (sal_Char*)alloca (mnLength);
-
- sal_Int32 i, j;
- for (i = 0, j = 0; i < mnLength; i++)
- {
- if ( mpName[i] != ' ' )
- pBuffer[j++] = mpName[i];
- }
- mpKeyName = new rtl::OString(pBuffer, j);
-
- return *mpKeyName;
-}
-
-void
-Attribute::InitKey ()
-{
- mpKeyName = NULL;
-}
-
-// Compare two strings, they have to be equal for nLen bytes, after nLen
-// bytes both strings have to be terminated either by '\0' or by '-'
-// this is for comparing a string being a substring in a Xlfd with a
-// zeroterminated string
-Bool
-Attribute::ExactMatch( const char *p, int nLen )
-{
- Bool bMatch;
- if ( nLen > 0 )
- bMatch = Compare( p, nLen ) == 0;
- else
- bMatch = True;
- if ( bMatch )
- {
- char c1 = p[ nLen ];
- char c2 = mpName[ nLen ];
- bMatch = (c1 == '-' || c1 == '\0') && (c2 == '-' || c2 == '\0');
- }
-
- return bMatch;
-}
-
-void
-Attribute::TagFeature( unsigned short nFeature )
-{
- if ( (nFeature & XLFD_FEATURE_NARROW)
- && (strstr(mpName, "narrow") != NULL) )
- {
- mnFeature |= XLFD_FEATURE_NARROW;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_CURSOR)
- && (strcmp(mpName, "open look cursor") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_CURSOR;
- }
-
- if ( (nFeature & XLFD_FEATURE_OL_GLYPH)
- && (strcmp(mpName, "open look glyph") == 0) )
- {
- mnFeature |= XLFD_FEATURE_OL_GLYPH;
- }
-
- if ( (nFeature & XLFD_FEATURE_APPLICATION_FONT)
- && ( (strcmp(mpName, "interface user") == 0)
- || (strcmp(mpName, "interface system") == 0)))
- {
- mnFeature |= XLFD_FEATURE_APPLICATION_FONT;
- }
-
- if (nFeature & XLFD_FEATURE_INTERFACE_FONT)
- {
- // european
- if (strcmp(mpName, "arial") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ | XLFD_FEATURE_MQ);
- else
- if (strcmp(mpName, "helvetica") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_HQ);
- else
- if ( (strcmp(mpName, "lucidux sans") == 0)
- || (strcmp(mpName, "luxi sans") == 0))
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ | XLFD_FEATURE_LQ);
- else
- if (strcmp(mpName, "charter") == 0)
- mnFeature |= (XLFD_FEATURE_INTERFACE_FONT | XLFD_FEATURE_MQ);
- else
- // japanese
- if ( (strcmp(mpName, "hg mincho l") == 0) /* Solaris: jisx0208 jisx0201 */
- || (strcmp(mpName, "heiseimin") == 0) /* Solaris: jisx0212 */
- || (strcmp(mpName, "minchol") == 0) /* TurboLinux */
- || (strcmp(mpName, "mincho") == 0)) /* Redhat 6.2 JP */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // chinese
- if ( (strcmp(mpName, "kai") == 0) /* Solaris */
- || (strcmp(mpName, "ar pl mingti2l big5") == 0)) /* TurboLinux */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- else
- // korean
- if ( (strcmp(mpName, "myeongjo") == 0)) /* Solaris */
- {
- mnFeature |= XLFD_FEATURE_INTERFACE_FONT;
- }
- }
-
- if ( nFeature & XLFD_FEATURE_REDUNDANTSTYLE )
- {
- switch ( mpName[0] )
- {
- case '\0':
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'b':
- if ( (strcmp(mpName, "bold") == 0)
- || (strcmp(mpName, "bold italic") == 0)
- || (strcmp(mpName, "bold sans") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'd':
- if ( (strcmp(mpName, "demi") == 0)
- || (strcmp(mpName, "demi italic") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 'i':
- if ( strcmp(mpName, "italic") == 0 )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
-
- case 's':
- if ( (strcmp(mpName, "sans") == 0)
- || (strcmp(mpName, "serif") == 0) )
- mnFeature |= XLFD_FEATURE_REDUNDANTSTYLE;
- break;
- }
- }
-}
-
-// given Attribute classifications, strings have to be in alphabetical
-// order, since they are treated by binary search algorithm
-
-#define InitializeAttributeWith( p, a ) p, sizeof(p) - 1, a, 0, NULL, NULL
-
-const Attribute pFamilyAttribute[] = {
- { InitializeAttributeWith( "arial", FAMILY_SWISS ) },
- { InitializeAttributeWith( "arioso", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "avant garde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "avantgarde", FAMILY_SWISS ) },
- { InitializeAttributeWith( "bembo", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "bookman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "conga", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "courier", FAMILY_MODERN ) },
- { InitializeAttributeWith( "curl", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "fixed", FAMILY_MODERN ) },
- { InitializeAttributeWith( "gill", FAMILY_SWISS ) },
- { InitializeAttributeWith( "helmet", FAMILY_MODERN ) },
- { InitializeAttributeWith( "helvetica", FAMILY_SWISS ) },
- { InitializeAttributeWith( "international", FAMILY_MODERN ) },
- { InitializeAttributeWith( "lucida", FAMILY_SWISS ) },
- { InitializeAttributeWith( "new century schoolbook", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "palatino", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "roman", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "sans serif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "sansserif", FAMILY_SWISS ) },
- { InitializeAttributeWith( "serf", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "serif", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "times", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "utopia", FAMILY_ROMAN ) },
- { InitializeAttributeWith( "zapf chancery", FAMILY_SCRIPT ) },
- { InitializeAttributeWith( "zapfchancery", FAMILY_SCRIPT ) }
-};
-
-const Attribute pWeightAttribute[] = {
- { InitializeAttributeWith( "black", WEIGHT_BLACK ) },
- { InitializeAttributeWith( "bold", WEIGHT_BOLD ) },
- { InitializeAttributeWith( "book", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "demi", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demi bold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "demibold", WEIGHT_SEMIBOLD ) },
- { InitializeAttributeWith( "light", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "medium", WEIGHT_MEDIUM ) },
- { InitializeAttributeWith( "normal", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "regular", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "roman", WEIGHT_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WEIGHT_LIGHT ) },
- { InitializeAttributeWith( "ultrabold", WEIGHT_ULTRABOLD ) }
-};
-
-const Attribute pSlantAttribute[] = {
- { InitializeAttributeWith( "i", ITALIC_NORMAL ) },
- { InitializeAttributeWith( "o", ITALIC_OBLIQUE ) },
- { InitializeAttributeWith( "r", ITALIC_NONE ) }
-};
-
-const Attribute pSetwidthAttribute[] = {
- { InitializeAttributeWith( "bold", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "condensed", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "double wide", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "expanded", WIDTH_EXPANDED ) },
- { InitializeAttributeWith( "extracondensed", WIDTH_EXTRA_CONDENSED ) },
- { InitializeAttributeWith( "extraexpanded", WIDTH_EXTRA_EXPANDED ) },
- { InitializeAttributeWith( "medium", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "narrow", WIDTH_CONDENSED ) },
- { InitializeAttributeWith( "normal", WIDTH_NORMAL ) },
- { InitializeAttributeWith( "semicondensed", WIDTH_SEMI_CONDENSED ) },
- { InitializeAttributeWith( "semiexpanded", WIDTH_SEMI_EXPANDED ) },
- { InitializeAttributeWith( "ultracondensed", WIDTH_ULTRA_CONDENSED ) },
- { InitializeAttributeWith( "ultraexpanded", WIDTH_ULTRA_EXPANDED ) },
- { InitializeAttributeWith( "wide", WIDTH_EXPANDED ) }
-};
-
-const Attribute pEnhancedCharsetAttribute[] = {
- { InitializeAttributeWith( "iso8859-1", RTL_TEXTENCODING_MS_1252 ) },
- { InitializeAttributeWith( "iso8859_1", RTL_TEXTENCODING_MS_1252 ) }
-};
-
-// -------------------------------------------------------------------------
-//
-// String handling utility functions
-//
-// -------------------------------------------------------------------------
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString )
-{
- if ( pAttribute == NULL )
- return ;
-
- int nLength = pAttribute->GetLength();
- char *pBuffer = (char*)alloca( nLength + 1);
-
- pBuffer[ 0 ] = '-';
- memcpy( pBuffer + 1, pAttribute->GetName(), nLength );
- rString.Append( pBuffer, nLength + 1);
-}
-
-//
-// Prettify the font name: make each leading character of a fontname
-// uppercase. For example
-// times new roman -> Times New Roman
-//
-
-static void
-ToUpper( char *pCharacter )
-{
- // replace [a,z] with [A,Z]
- if ( (*pCharacter >= 97) && (*pCharacter <= 122) )
- *pCharacter -= 32;
-}
-
-static String*
-Capitalize( const char *pStr, int nLength )
-{
- char *pCopy = (char*)alloca( nLength + 1 );
- char *pPtr = pCopy;
- memcpy( pPtr, pStr, nLength + 1 );
-
- // loop over string data and uppercase first char and all chars
- // following a space (other white space would be unexpected here)
- char nPreviousChar = ' ';
- while ( *pPtr )
- {
- if ( nPreviousChar == ' ' )
- ToUpper( pPtr );
- nPreviousChar = *pPtr++;
- }
-
- return new String( pCopy, RTL_TEXTENCODING_ISO_8859_1 );
-}
-
-String*
-AnnotateString( const Attribute& rAttribute )
-{
- return Capitalize(rAttribute.GetName(), rAttribute.GetLength());
-}
-
-String*
-AnnotateSlant( const Attribute& rAttribute )
-{
- const char* pStr = rAttribute.GetName();
- int nLen = rAttribute.GetLength();
-
- static const struct {
- const char *pFrom; const char *pTo;
- } pTranslation[] = {
- { "r", "Roman" },
- { "o", "Oblique" },
- { "i", "Italic" },
- { "ri", "Reverse Italic" },
- { "ro", "Reverse Oblique" },
- { "ot", "Other" }
- };
-
- for ( unsigned int i = 0; i < SAL_N_ELEMENTS(pTranslation); i++ )
- if ( strcmp(pStr, pTranslation[i].pFrom) == 0 )
- {
- return new String( pTranslation[i].pTo,
- RTL_TEXTENCODING_ISO_8859_1 );
- }
-
- return Capitalize(pStr, nLen);
-}
-
-String*
-AnnotateNone( const Attribute& )
-{
- return new String();
-}
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeStorage::AttributeStorage( unsigned short nDefaultValue ) :
- mpList( NULL ),
- mnSize( 0 ),
- mnCount( 0 ),
- mnLastmatch( 0 ),
- mnDefaultValue( nDefaultValue )
-{
-}
-
-AttributeStorage::~AttributeStorage()
-{
- if ( mpList != NULL )
- {
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].Release();
- free( mpList );
- }
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeStorage::Dump()
-{
- fprintf(stderr, "AttributeStorage: size=%i, used=%i\n", mnSize, mnCount);
- for ( int i = 0; i < mnCount; i++ )
- {
- ByteString aAnnotation = ByteString(
- mpList[i].GetAnnotation(),
- RTL_TEXTENCODING_ISO_8859_1 );
- fprintf(stderr, "\t%4i: <%s><len=%i><val=%i><%s>\n", i, mpList[i].GetName(),
- mpList[i].GetLength(), mpList[i].GetValue(),
- aAnnotation.GetBuffer() );
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-Attribute*
-AttributeStorage::Retrieve( unsigned short nIndex ) const
-{
- return nIndex < mnCount ? &mpList[ nIndex ] : (Attribute*)NULL ;
-}
-
-// pClassification contains a list of name-value pairs. If names in
-// the AttributeStorage match those in the pClassification then
-// the according value is copied. Matching means match for the length
-// of the string in pClassification (i.e. arial matches arialnarrow)
-// the strings in pClassification must be in alphabetical order, all
-// strings Lowercase
-void
-AttributeStorage::AddClassification( Attribute *pClassification,
- unsigned short nNum )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- unsigned int nLower = 0;
- unsigned int nUpper = nNum;
- unsigned int nCurrent;
- int nComparison = 1;
- Attribute *pHaystack = 0, *pNeedle;
-
- pNeedle = &mpList[ i ];
-
- // binary search
- while ( nLower < nUpper )
- {
- nCurrent = (nLower + nUpper) / 2;
- pHaystack = &pClassification[ nCurrent ];
- nComparison = pNeedle->Compare( pHaystack->GetName(),
- pHaystack->GetLength() );
- if (nComparison < 0)
- nUpper = nCurrent;
- else
- if (nComparison > 0)
- nLower = nCurrent + 1;
- else
- break;
- }
-
- // if there's a match store the according classification in the
- // Attribute storage, otherwise do nothing since defaults are
- // already provided in AttributeStorage::Insert()
- if ( nComparison == 0 )
- pNeedle->SetValue( pHaystack->GetValue() );
- }
-}
-
-void
-AttributeStorage::AddClassification( AttributeClassifierT Classify )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- Attribute& rCurrent = mpList[i] ;
- int nValue = Classify( rCurrent.GetName() );
- rCurrent.SetValue( nValue );
- }
-}
-
-void
-AttributeStorage::AddAnnotation( AttributeAnnotatorT Annotate )
-{
- for ( int i = 0; i < mnCount; i++ )
- {
- String* pAnnotation = Annotate( mpList[i] );
- mpList[i].SetAnnotation( pAnnotation );
- }
-}
-
-void
-AttributeStorage::TagFeature( unsigned short nFeature )
-{
- for ( int i = 0; i < mnCount; i++ )
- mpList[i].TagFeature( nFeature );
-}
-
-// Enlarge the list of Attributes
-void
-AttributeStorage::Enlarge()
-{
- if ( mnSize == 0 )
- {
- mnSize = 8;
- mpList = (Attribute*) malloc( mnSize * sizeof(Attribute) );
- }
- else
- {
- mnSize = mnSize < 32768 ? (mnSize * 2) : 65535;
- Attribute* pTemp;
- pTemp = (Attribute*) realloc( mpList, mnSize * sizeof(Attribute) );
- if (pTemp)
- {
- mpList = pTemp;
- }
- else
- {
- throw std::bad_alloc();
- }
- }
-}
-
-// nLength is the length as it would be reported by strlen(3)
-// for an null-terminated string. if a string is part of a Xlfd
-// the field separator '-' is taken as '\0'
-// the AttributeStorage itself is NOT sorted to make sure that the
-// leased keys are still valid
-unsigned short
-AttributeStorage::Insert( const char *pString, int nLength )
-{
- // check whether the last match is still equal to the current
- // string since XListFonts lists fonts in sets of similar fontnames
- if ( mnLastmatch < mnCount )
- {
- if ( mpList[mnLastmatch].ExactMatch(pString, nLength) )
- return mnLastmatch;
- }
-
- // otherwise search in list
- for ( int i = 0; i < mnCount; i++ )
- {
- if ( mpList[i].ExactMatch(pString, nLength) )
- return mnLastmatch = i;
- }
-
- // if still not found we have to Insert the new string
- if ( mnSize == mnCount )
- Enlarge();
- mpList[mnCount].SetName( pString, nLength );
- mpList[mnCount].SetValue( mnDefaultValue );
- mpList[mnCount].SetAnnotation( NULL );
- mpList[mnCount].SetFeature( XLFD_FEATURE_NONE );
- mpList[mnCount].InitKey( );
- mnLastmatch = mnCount;
- mnCount = mnCount < 65535 ? mnCount + 1 : mnCount;
-
- return mnLastmatch;
-}
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages.
-//
-//
-// ---------------------------------------------------------------------------
-
-AttributeProvider::AttributeProvider ()
-{
- mpField[eXLFDFoundry ] = new AttributeStorage(0);
- mpField[eXLFDFamilyName ] = new AttributeStorage(FAMILY_DONTKNOW);
- mpField[eXLFDWeightName ] = new AttributeStorage(WEIGHT_NORMAL);
- mpField[eXLFDSlant ] = new AttributeStorage(ITALIC_NONE);
- mpField[eXLFDSetwidthName] = new AttributeStorage(WIDTH_NORMAL);
- mpField[eXLFDAddstyleName] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
- mpField[eXLFDCharset ] = new AttributeStorage(RTL_TEXTENCODING_DONTKNOW);
-}
-
-AttributeProvider::~AttributeProvider()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- delete mpField[ i ];
-}
-
-#if OSL_DEBUG_LEVEL > 1
-void
-AttributeProvider::Dump()
-{
- for ( int i = 0; i < eXLFDMaxEntry; i++ )
- mpField[ i ]->Dump();
-}
-#endif
-
-extern "C" rtl_TextEncoding
-GetTextEncodingFromAddStylename( const sal_Char *pAddStylename )
-{
- int nBufferLength = strlen( pAddStylename ) + 1;
- sal_Char *pBuffer = (sal_Char*)alloca( nBufferLength );
- for ( int i = 0; i < nBufferLength; i++ )
- pBuffer[i] = pAddStylename[i] == '_' ? '-' : pAddStylename[i] ;
-
- return rtl_getTextEncodingFromUnixCharset( pBuffer );
-}
-
-
-// classification information is needed before sorting because of course the
-// classification is the sort criteria
-void
-AttributeProvider::AddClassification()
-{
- /* mpField[ eXLFDFoundry ] doesn't need classification */
- mpField[ eXLFDFamilyName ]->AddClassification(
- (Attribute*)pFamilyAttribute,
- SAL_N_ELEMENTS(pFamilyAttribute) );
- mpField[ eXLFDWeightName ]->AddClassification(
- (Attribute*)pWeightAttribute,
- SAL_N_ELEMENTS(pWeightAttribute) );
- mpField[ eXLFDSlant ]->AddClassification(
- (Attribute*)pSlantAttribute,
- SAL_N_ELEMENTS(pSlantAttribute) );
- mpField[ eXLFDSetwidthName ]->AddClassification(
- (Attribute*)pSetwidthAttribute,
- SAL_N_ELEMENTS(pSetwidthAttribute) );
- mpField[ eXLFDAddstyleName ]->AddClassification(
- GetTextEncodingFromAddStylename );
- mpField[ eXLFDCharset ]->AddClassification(
- rtl_getTextEncodingFromUnixCharset );
-}
-
-// add some pretty print description
-void
-AttributeProvider::AddAnnotation()
-{
- mpField[ eXLFDFoundry ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDFamilyName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDWeightName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDSlant ]->AddAnnotation( AnnotateSlant );
- mpField[ eXLFDSetwidthName ]->AddAnnotation( AnnotateString );
- mpField[ eXLFDAddstyleName ]->AddAnnotation( AnnotateNone );
- mpField[ eXLFDCharset ]->AddAnnotation( AnnotateNone );
-}
-
-// this is the misc or any section: dirty hacks for dirty xlfd usage
-void
-AttributeProvider::TagFeature()
-{
- mpField[ eXLFDFamilyName ]->TagFeature(
- XLFD_FEATURE_OL_GLYPH
- | XLFD_FEATURE_OL_CURSOR
- | XLFD_FEATURE_NARROW
- | XLFD_FEATURE_INTERFACE_FONT
- | XLFD_FEATURE_APPLICATION_FONT);
-
- mpField[ eXLFDSetwidthName ]->TagFeature(
- XLFD_FEATURE_NARROW );
-
- mpField[ eXLFDAddstyleName ]->TagFeature(
- XLFD_FEATURE_REDUNDANTSTYLE );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_attr.hxx b/vcl/unx/source/gdi/xlfd_attr.hxx
deleted file mode 100644
index 18386a314e4b..000000000000
--- a/vcl/unx/source/gdi/xlfd_attr.hxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef XLFD_ATTRIBUTE_HXX
-#define XLFD_ATTRIBUTE_HXX
-
-#include <salunx.h>
-#include <tools/string.hxx>
-
-
-struct Attribute {
-
- const char* mpName;
- unsigned short mnLength;
- unsigned short mnValue;
- unsigned short mnFeature;
- String* mpAnnotation;
- rtl::OString* mpKeyName;
-
- const char* GetName() const
- { return mpName; }
- unsigned short GetValue() const
- { return mnValue; }
- unsigned short GetLength() const
- { return mnLength; }
- Bool HasFeature( unsigned short nFeature ) const
- { return ((mnFeature & nFeature) != 0); }
- const String &GetAnnotation() const
- { return *mpAnnotation; }
- const rtl::OString&
- GetKey();
- void InitKey();
-
- void SetName( const char *p, int nLen );
- void SetValue( unsigned short nIn )
- { mnValue = nIn; }
- void SetAnnotation( String *pString )
- { mpAnnotation = pString; }
- void SetFeature( unsigned short nFeature )
- { mnFeature = nFeature; }
- void TagFeature( unsigned short nFeature );
-
- int Compare( const char *p, int nLen );
- Bool ExactMatch( const char *p, int nLen );
- void Release();
-};
-
-
-void
-AppendAttribute( Attribute *pAttribute, ByteString &rString );
-
-
-typedef String*(*AttributeAnnotatorT)(const Attribute &rAttribute);
-extern "C" {
-typedef rtl_TextEncoding(*AttributeClassifierT)(const char* pStr);
-}
-
-#define XLFD_FEATURE_NONE 0x0000
-#define XLFD_FEATURE_NARROW 0x0001
-#define XLFD_FEATURE_OL_GLYPH 0x0002
-#define XLFD_FEATURE_OL_CURSOR 0x0004
-#define XLFD_FEATURE_REDUNDANTSTYLE 0x0008
-#define XLFD_FEATURE_APPLICATION_FONT 0x0010
-
-#define XLFD_FEATURE_INTERFACE_FONT 0x0020
-#define XLFD_FEATURE_LQ 0x0040
-#define XLFD_FEATURE_MQ 0x0080
-#define XLFD_FEATURE_HQ 0x0100
-
-// ---------------------------------------------------------------------------
-//
-//
-// manage global lists of Attributes
-// since XListFonts does never list more than 64K fonts this storage does
-// handle array size and indices with unsigned short values for low
-// memory consumption
-//
-//
-// ---------------------------------------------------------------------------
-
-class AttributeStorage {
-
- private:
-
- Attribute* mpList;
- unsigned short mnSize;
- unsigned short mnCount;
- unsigned short mnLastmatch;
- unsigned short mnDefaultValue;
-
- void Enlarge();
- AttributeStorage();
-
- public:
-
- AttributeStorage( unsigned short nDefaultValue );
- ~AttributeStorage();
- unsigned short Insert( const char *pString, int nLength );
- Attribute* Retrieve( unsigned short nIndex ) const ;
- void AddClassification( Attribute *pClassification,
- unsigned short nNum );
- void AddClassification( AttributeClassifierT Classify );
- void TagFeature( unsigned short nFeature );
- void AddAnnotation( AttributeAnnotatorT Annotate );
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-};
-
-
-// ---------------------------------------------------------------------------
-//
-//
-// Attribute provider is a frame for a set of AttributeStorages. For XLFD
-// interpretation and efficient storage, AttributeStorages for foundry,
-// family_name, weight_name, slant, setwidth_name, add_style_name and combined
-// charset_registry and charset_encoding are used. pixel_size, point_size,
-// resolution_x and resolution_y are stored as numbers. please note that this
-// does not allow storage of matrix-enhanced fonts. spacing is stored as
-// a char, since only the 'm', 'c' and 'p' types are defined.
-//
-//
-// ---------------------------------------------------------------------------
-
-enum eXLFDAttributeT {
- eXLFDFoundry = 0,
- eXLFDFamilyName,
- eXLFDWeightName,
- eXLFDSlant,
- eXLFDSetwidthName,
- eXLFDAddstyleName,
- eXLFDCharset,
- eXLFDMaxEntry
-};
-
-class AttributeProvider {
-
- private:
-
- AttributeStorage* mpField[ eXLFDMaxEntry ];
-
- AttributeStorage* GetField( eXLFDAttributeT eXLFDField )
- { return mpField[ eXLFDField]; }
- public:
-
- AttributeProvider ();
- ~AttributeProvider ();
-
- void AddClassification();
- void AddAnnotation();
- void TagFeature();
- #if OSL_DEBUG_LEVEL > 1
- void Dump();
- #endif
-
- // these are just shortcuts or proxies for the most common used
- // AttributeStorage functionality
- AttributeStorage* GetFoundry()
- { return GetField(eXLFDFoundry); }
- AttributeStorage* GetFamily()
- { return GetField(eXLFDFamilyName); }
- AttributeStorage* GetWeight()
- { return GetField(eXLFDWeightName); }
- AttributeStorage* GetSlant()
- { return GetField(eXLFDSlant); }
- AttributeStorage* GetSetwidth()
- { return GetField(eXLFDSetwidthName); }
- AttributeStorage* GetAddstyle()
- { return GetField(eXLFDAddstyleName); }
- AttributeStorage* GetCharset()
- { return GetField(eXLFDCharset); }
-
- Attribute* RetrieveFoundry( unsigned short nIndex )
- { return GetFoundry()->Retrieve(nIndex); }
- Attribute* RetrieveFamily( unsigned short nIndex )
- { return GetFamily()->Retrieve(nIndex); }
- Attribute* RetrieveWeight( unsigned short nIndex )
- { return GetWeight()->Retrieve(nIndex); }
- Attribute* RetrieveSlant( unsigned short nIndex )
- { return GetSlant()->Retrieve(nIndex); }
- Attribute* RetrieveSetwidth( unsigned short nIndex )
- { return GetSetwidth()->Retrieve(nIndex); }
- Attribute* RetrieveAddstyle( unsigned short nIndex )
- { return GetAddstyle()->Retrieve(nIndex); }
- Attribute* RetrieveCharset( unsigned short nIndex )
- { return GetCharset()->Retrieve(nIndex); }
-
- unsigned short InsertFoundry( const char *pString, int nLength )
- { return GetFoundry()->Insert(pString, nLength); }
- unsigned short InsertFamily( const char *pString, int nLength )
- { return GetFamily()->Insert(pString, nLength); }
- unsigned short InsertWeight( const char *pString, int nLength )
- { return GetWeight()->Insert(pString, nLength); }
- unsigned short InsertSlant( const char *pString, int nLength )
- { return GetSlant()->Insert(pString, nLength); }
- unsigned short InsertSetwidth( const char *pString, int nLength )
- { return GetSetwidth()->Insert(pString, nLength);}
- unsigned short InsertAddstyle( const char *pString, int nLength )
- { return GetAddstyle()->Insert(pString, nLength);}
- unsigned short InsertCharset( const char *pString, int nLength )
- { return GetCharset()->Insert(pString, nLength); }
-};
-
-#endif /* XLFD_ATTRIBUTE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_extd.cxx b/vcl/unx/source/gdi/xlfd_extd.cxx
deleted file mode 100644
index 6d691de88a79..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.cxx
+++ /dev/null
@@ -1,1002 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-#include "xlfd_extd.hxx"
-#include <vcl/outfont.hxx>
-#include <rtl/alloc.h>
-
-#include <rtl/tencinfo.h>
-
-#include <set>
-
-// --------------------------------------------------------------------------
-
-ImplX11FontData::ImplX11FontData( const ExtendedXlfd& rXlfd, int nHeight )
-: ImplFontData( rXlfd, X11IFD_MAGIC ),
- mrXlfd( rXlfd )
-{
- mnHeight = nHeight;
- mnWidth = 0;
-}
-
-ImplFontEntry* ImplX11FontData::CreateFontInstance( ImplFontSelectData& rFSD ) const
-{
- ImplFontEntry* pEntry = new ImplFontEntry( rFSD );
- return pEntry;
-}
-
-sal_IntPtr ImplX11FontData::GetFontId() const
-{
- return reinterpret_cast<sal_IntPtr>(&mrXlfd);
-}
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- X -p- X )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-ExtendedXlfd::EncodingInfo&
-ExtendedXlfd::EncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mcSpacing = pXlfd->mcSpacing;
- mnResolutionX = pXlfd->mnResolutionX;
- mnResolutionY = pXlfd->mnResolutionY;
- mnAddstyle = pXlfd->mnAddstyle;
- mnCharset = pXlfd->mnCharset;
- mnEncoding = pXlfd->GetEncoding();
-
- return *this;
-}
-
-// ------ base class --------------------------------------------------------
-
-ExtendedXlfd::ExtendedXlfd( bool bScalable )
-: mbScalable( bScalable ),
- mnEncodings( 0 ),
- mnEncCapacity( 0 ),
- mpEncodingInfo( NULL )
-{
- mbOrientation = false;
- mbDevice = false;
- mbSubsettable = false;
- mbEmbeddable = false;
-
- mnQuality = -1;
-}
-
-ExtendedXlfd::~ExtendedXlfd()
-{
- if ( mnEncodings != 0 )
- rtl_freeMemory( mpEncodingInfo );
-}
-
-inline void*
-Realloc( void *pPtr, sal_Size nSize )
-{
- return rtl_reallocateMemory( pPtr, nSize );
-}
-
-int
-ExtendedXlfd::GetEncodingIdx( rtl_TextEncoding nEncoding ) const
-{
- for ( int i = 0; i < mnEncodings; i++ )
- if ( nEncoding == mpEncodingInfo[i].mnEncoding )
- return i;
- return -1;
-}
-
-bool
-ExtendedXlfd::HasEncoding( rtl_TextEncoding nEncoding ) const
-{
- return !(GetEncodingIdx( nEncoding ) < 0) ;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding( int i ) const
-{
- if ( i < mnEncodings && i >= 0 )
- return mpEncodingInfo[i].mnEncoding;
-
- return RTL_TEXTENCODING_DONTKNOW;
-}
-
-rtl_TextEncoding
-ExtendedXlfd::GetEncoding() const
-{
- return mnEncodings == 1 ? mpEncodingInfo[0].mnEncoding : RTL_TEXTENCODING_DONTKNOW;
-}
-
-// query the most unicode / Ascii compatible font: either one of the fonts
-// is utf16 encoded or there's a single byte font which is unicode
-// compatible for the first 256 chars (latin1) or for at least 128
-// chars (most latin-X encodings, cyrillic encodings)
-rtl_TextEncoding
-ExtendedXlfd::GetAsciiEncoding( int *pAsciiRange ) const
-{
- rtl_TextEncoding nBestEncoding = RTL_TEXTENCODING_DONTKNOW;
- int nLargestRange = 0x0000;
-
- for ( int i = 0; i < mnEncodings && nLargestRange < 0xffff; i++ )
- {
- rtl_TextEncoding nCurEncoding = mpEncodingInfo[i].mnEncoding;
- switch ( nCurEncoding )
- {
- case RTL_TEXTENCODING_UNICODE:
- nLargestRange = 0xffff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- nLargestRange = 0x00ff;
- nBestEncoding = nCurEncoding;
- break;
-
- case RTL_TEXTENCODING_ISO_8859_2:
- case RTL_TEXTENCODING_ISO_8859_4:
- case RTL_TEXTENCODING_ISO_8859_5:
- case RTL_TEXTENCODING_ISO_8859_6:
- case RTL_TEXTENCODING_ISO_8859_7:
- case RTL_TEXTENCODING_ISO_8859_8:
- case RTL_TEXTENCODING_ISO_8859_9:
- case RTL_TEXTENCODING_ISO_8859_13:
- case RTL_TEXTENCODING_ISO_8859_15:
- case RTL_TEXTENCODING_MS_1251:
- case RTL_TEXTENCODING_KOI8_R:
- case RTL_TEXTENCODING_JIS_X_0201:
- if ( nLargestRange < 0x0080 )
- {
- nLargestRange = 0x0080;
- nBestEncoding = nCurEncoding;
- }
- break;
-
- default:
- if ( nLargestRange == 0x0000 )
- {
- nBestEncoding = nCurEncoding;
- }
- break;
- }
- }
-
- if ( pAsciiRange != NULL )
- *pAsciiRange = nLargestRange;
-
- return nBestEncoding;
-}
-
-bool
-ExtendedXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- if ( HasEncoding(nEncoding) )
- return false;
-
- if ( mnEncodings == 0 )
- {
- // bootstrap
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
- mpFactory = pXlfd->mpFactory;
-
- Attribute *pFamilyAttr = mpFactory->RetrieveFamily( mnFamily );
- Attribute *pWeightAttr = mpFactory->RetrieveWeight( mnWeight );
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth( mnSetwidth );
- Attribute *pSlantAttr = mpFactory->RetrieveSlant( mnSlant );
-
- meFamily = GetFamilyType();
- meWeight = GetWeight();
- meItalic = GetSlant();
- meWidthType = GetWidthType();
- mbSymbolFlag= (GetEncoding() == RTL_TEXTENCODING_SYMBOL);
- mePitch = GetPitch();
-
- maName = pFamilyAttr->GetAnnotation();
-
- // the helvetica narrow hack
- if ( ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW)
- && pWidthAttr->HasFeature(XLFD_FEATURE_NARROW) )
- {
- static const String aNarrow( RTL_CONSTASCII_USTRINGPARAM(" Narrow") );
- maName += aNarrow;
- }
-
- // stylename = weight + slant + width
- // XXX Fix me: there may be a space missing between them
- if ( meWeight != WEIGHT_NORMAL )
- maStyleName += pWeightAttr->GetAnnotation();
- if ( meItalic != ITALIC_NONE )
- maStyleName += pSlantAttr->GetAnnotation();
- if ( (meWidthType != WIDTH_NORMAL)
- && (! pWidthAttr->HasFeature(XLFD_FEATURE_NARROW)) )
- maStyleName += pWidthAttr->GetAnnotation();
- }
-
- if( mnEncodings <= mnEncCapacity )
- {
- mnEncCapacity += mnEncodings + 4;
- mpEncodingInfo = (EncodingInfo*)Realloc( mpEncodingInfo, mnEncCapacity * sizeof(EncodingInfo) );
- }
-
- mpEncodingInfo[ mnEncodings ] = pXlfd;
- mnEncodings += 1;
- return true;
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-void
-ExtendedXlfd::ToString( ByteString &rString,
- unsigned short /*nPixelSize*/, char* /*pMatricsString*/, rtl_TextEncoding /*nEncoding*/ ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
-}
-
-static FontPitch GetPitchFromX11Pitch( const char cSpacing )
-{
- switch ( cSpacing )
- {
- case 'c': // fall through
- case 'm': return PITCH_FIXED;
- case 'p': return PITCH_VARIABLE;
- default: return PITCH_DONTKNOW;
- }
-}
-
-// you must not call any of the ExtendedXlfd::GetXXX() functions if the
-// ExtendedXlfd is really empty (i.e. mnEncodings is zero)
-
-FontPitch ExtendedXlfd::GetPitch() const
-{
- if( mnEncodings > 1 )
- return PITCH_VARIABLE;
- if( mnEncodings == 1 )
- return GetPitchFromX11Pitch( mpEncodingInfo[0].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontPitch ExtendedXlfd::GetPitch( rtl_TextEncoding nEncoding ) const
-{
- for ( int nIdx = 0; nIdx < mnEncodings; nIdx++ )
- if ( mpEncodingInfo[nIdx].mnEncoding == nEncoding )
- return GetPitchFromX11Pitch( mpEncodingInfo[nIdx].mcSpacing );
- return PITCH_DONTKNOW;
-}
-
-FontFamily ExtendedXlfd::GetFamilyType() const
-{
- Attribute *pFamilyAttr= mpFactory->RetrieveFamily(mnFamily);
- return (FontFamily)pFamilyAttr->GetValue();
-}
-
-FontWeight ExtendedXlfd::GetWeight() const
-{
- Attribute *pWeightAttr = mpFactory->RetrieveWeight(mnWeight);
- return (FontWeight)pWeightAttr->GetValue();
-}
-
-FontItalic ExtendedXlfd::GetSlant() const
-{
- Attribute *pSlantAttr = mpFactory->RetrieveSlant(mnSlant);
- return (FontItalic)pSlantAttr->GetValue();
-}
-
-FontWidth ExtendedXlfd::GetWidthType() const
-{
- Attribute *pWidthAttr = mpFactory->RetrieveSetwidth(mnSetwidth);
- return (FontWidth)pWidthAttr->GetValue();
-}
-
-class CodeRange
-{
-public:
- CodeRange( int nMin, int nEnd ) : mnMin( nMin ), mnEnd( nEnd ) {}
-
- sal_uInt32 GetMin() const { return mnMin; }
- sal_uInt32 GetEnd() const { return mnEnd; }
-
- bool operator<( const CodeRange& r ) const
- { return (mnMin<r.mnMin) || ((mnMin==r.mnMin) && (mnEnd<r.mnEnd)); }
-
-private:
- sal_uInt32 mnMin, mnEnd;
-};
-
-
-int ExtendedXlfd::GetFontCodeRanges( sal_uInt32* pCodePairs ) const
-{
- bool bHasUnicode = false;
- bool bHasUnknownEncoding = false;
-
- // approximate unicode ranges from encodings
- typedef std::set<CodeRange> RangeSet;
- RangeSet aRangeSet;
-
- for( unsigned short i = 0; i < mnEncodings; ++i )
- {
- // TODO: move encoding -> unicode range mapping to RTL
- // NOTE: for now only some are VERY roughly approximated
- const rtl_TextEncoding eEncoding = mpEncodingInfo[i].mnEncoding;
- switch( mpEncodingInfo[i].mnEncoding )
- {
- case RTL_TEXTENCODING_SYMBOL: // postscript symbol encoding
- aRangeSet.insert( CodeRange( 0x0020, 0x0100 ) ); // symbol aliasing
- aRangeSet.insert( CodeRange( 0xF020, 0xF100 ) );
- break;
-
- case RTL_TEXTENCODING_ISO_8859_15:
- aRangeSet.insert( CodeRange( 0x20AC, 0x20AD ) ); // Euro currency symbol
- // fall through
- case RTL_TEXTENCODING_APPLE_ROMAN:
- case RTL_TEXTENCODING_ISO_8859_1:
- case RTL_TEXTENCODING_MS_1252:
- case RTL_TEXTENCODING_IBM_437:
- case RTL_TEXTENCODING_IBM_852:
- aRangeSet.insert( CodeRange( 0x0020, 0x0080 ) );
- aRangeSet.insert( CodeRange( 0x00A0, 0x0100 ) );
- break;
-
- // Traditional, Simplified, Japanese
- case RTL_TEXTENCODING_APPLE_CHINSIMP:
- case RTL_TEXTENCODING_APPLE_CHINTRAD:
- case RTL_TEXTENCODING_APPLE_JAPANESE:
- case RTL_TEXTENCODING_SHIFT_JIS:
- case RTL_TEXTENCODING_GB_2312:
- case RTL_TEXTENCODING_GBT_12345:
- case RTL_TEXTENCODING_GBK:
- case RTL_TEXTENCODING_BIG5:
- case RTL_TEXTENCODING_EUC_JP:
- case RTL_TEXTENCODING_EUC_CN:
- case RTL_TEXTENCODING_EUC_TW:
- case RTL_TEXTENCODING_ISO_2022_JP:
- case RTL_TEXTENCODING_ISO_2022_CN:
- case RTL_TEXTENCODING_GB_18030:
- case RTL_TEXTENCODING_BIG5_HKSCS:
- case RTL_TEXTENCODING_JIS_X_0201:
- case RTL_TEXTENCODING_JIS_X_0208:
- case RTL_TEXTENCODING_JIS_X_0212:
- case RTL_TEXTENCODING_MS_932:
- case RTL_TEXTENCODING_MS_936:
- case RTL_TEXTENCODING_MS_950:
- aRangeSet.insert( CodeRange( 0x3000, 0xA000 ) );
- aRangeSet.insert( CodeRange( 0xF900, 0xFB00 ) );
- break;
-
- // Korean
- case RTL_TEXTENCODING_APPLE_KOREAN:
- case RTL_TEXTENCODING_MS_949:
- case RTL_TEXTENCODING_MS_1361:
- case RTL_TEXTENCODING_EUC_KR:
- case RTL_TEXTENCODING_ISO_2022_KR:
- aRangeSet.insert( CodeRange( 0x1100, 0x1200 ) );
- aRangeSet.insert( CodeRange( 0x3130, 0x3190 ) );
- aRangeSet.insert( CodeRange( 0xAC00, 0xD7A4 ) );
- break;
-
- // unknown encoding
- case RTL_TEXTENCODING_DONTKNOW:
- bHasUnknownEncoding = true;
- break;
-
- // Unicode
- case RTL_TEXTENCODING_UNICODE:
- case RTL_TEXTENCODING_UTF7:
- case RTL_TEXTENCODING_UTF8:
- bHasUnicode = true;
- break;
-
- // misc 8bit encodings
- default:
- if( !rtl_isOctetTextEncoding( eEncoding ) )
- bHasUnknownEncoding = true;
- else
- {
- // use the unicode converter to get the coverage of an 8bit encoding
- rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter( eEncoding );
- rtl_UnicodeToTextContext aCvtContext = rtl_createTextToUnicodeContext( aConverter );
- if( !aConverter || !aCvtContext )
- bHasUnknownEncoding = true;
- else
- {
- sal_Char cCharsInp[ 0x100 ];
- for( int j = 0x20; j < 0x080; ++j )
- cCharsInp[ j-0x20 ] = j;
- for( int j = 0xA0; j < 0x100; ++j )
- cCharsInp[ j-0x40 ] = j;
-
- sal_Unicode cCharsOut[ 0x100 ];
- sal_uInt32 nCvtInfo;
- sal_Size nSrcCvtBytes;
- int nOutLen = rtl_convertTextToUnicode(
- aConverter, aCvtContext,
- cCharsInp, 0xC0,
- cCharsOut, sizeof(cCharsOut)/sizeof(*cCharsOut),
- RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
- | RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE,
- &nCvtInfo, &nSrcCvtBytes );
-
- for( int j = 0; j < nOutLen; ++j )
- aRangeSet.insert( CodeRange( cCharsOut[j], cCharsOut[j]+1 ) );
-
- rtl_destroyTextToUnicodeConverter( aCvtContext );
- rtl_destroyTextToUnicodeConverter( aConverter );
- }
- }
- break;
- }
- }
-
- // unicode encoded fonts usually do not cover the entire unicode range
- // => only use them to determine coverage when no other encodings are available
- if( aRangeSet.empty() && (bHasUnicode || bHasUnknownEncoding) )
- {
- if( pCodePairs )
- {
- pCodePairs[0] = 0x0020;
- pCodePairs[1] = 0xD800;
- pCodePairs[2] = 0xE000;
- pCodePairs[3] = 0xFFFE;
- }
- return 2;
- }
-
- if( aRangeSet.empty() )
- return 0;
-
- // sort and merge the code pairs
- sal_uInt32* pDst = pCodePairs;
- RangeSet::const_iterator it = aRangeSet.begin();
- for( sal_uInt32 nEnd = 0; it != aRangeSet.end(); ++it )
- {
- // check overlap with to previous range
- const CodeRange& rSrc = *it;
- if( nEnd < rSrc.GetMin() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- {
- pDst[0] = rSrc.GetMin();
- pDst[1] = rSrc.GetEnd();
- }
- pDst += 2;
- }
- else
- {
- // merge overlapping ranges
- if( nEnd < rSrc.GetEnd() )
- {
- nEnd = rSrc.GetEnd();
- if( pCodePairs )
- pDst[-1] = nEnd;
- }
- }
- }
-
- int nRangeCount = (pDst - pCodePairs) / 2;
- return nRangeCount;
-}
-
-// ------ class to handle scalable bitmap fonts ------------------------------
-
-ScalableBitmapXlfd::ScalableBitmapXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableBitmapXlfd::~ScalableBitmapXlfd()
-{}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-";
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionX );
- rString += '-';
- rString += ByteString::CreateFromInt32( rInfo.mnResolutionY );
- rString += '-';
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableBitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableBitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 0;
- return pFontData;
-}
-
-// ------ class to handle true bitmap fonts ----------------------------------
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char *pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-BitmapXlfd::BitmapXlfd( )
-: ExtendedXlfd( false )
-{}
-
-BitmapXlfd::~BitmapXlfd( )
-{}
-
-bool
-BitmapXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- if ( mnEncodings == 0 )
- {
- mnPixelSize = pXlfd->mnPixelSize;
- mnPointSize = pXlfd->mnPointSize;
- mnAverageWidth = pXlfd->mnAverageWidth;
- }
-
- return ExtendedXlfd::AddEncoding( pXlfd );
-}
-
-void
-BitmapXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding );
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
- rString += '-';
- rString += ByteString::CreateFromInt32( mnPixelSize );
- rString += "-*-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* BitmapXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, mnPixelSize );
- pFontData->mnQuality= 100;
- return pFontData;
-}
-
-// ------ class to handle true scalable fonts --------------------------------
-
-ScalableXlfd::ScalableXlfd()
-: ExtendedXlfd( true )
-{}
-
-ScalableXlfd::~ScalableXlfd()
-{}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-ScalableXlfd::ToString( ByteString &rString,
- unsigned short nPixelSize, char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtendedXlfd::ToString( rString, nPixelSize, nEncoding);
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* ScalableXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
- pFontData->mnQuality= 200;
- return pFontData;
-}
-
-/* ------- virtual fonts for user interface ------------------------------- */
-
-VirtualXlfd::ExtEncodingInfo&
-VirtualXlfd::ExtEncodingInfo::operator= ( const Xlfd *pXlfd )
-{
- mnFoundry = pXlfd->mnFoundry;
- mnFamily = pXlfd->mnFamily;
- mnWeight = pXlfd->mnWeight;
- mnSlant = pXlfd->mnSlant;
- mnSetwidth = pXlfd->mnSetwidth;
-
- return *this;
-}
-
-VirtualXlfd::VirtualXlfd()
-: ExtendedXlfd( true ),
- mnExtCapacity(0),
- mpExtEncodingInfo(NULL)
-{
- mnFoundry = 0;
- mnFamily = 0;
- mnWeight = 0;
- mnSlant = 0;
- mnSetwidth = 0;
-}
-
-VirtualXlfd::~VirtualXlfd()
-{
- if ( mpExtEncodingInfo != NULL )
- rtl_freeMemory( mpExtEncodingInfo );
-}
-
-int
-VirtualXlfd::GetFontQuality (unsigned short nFamily)
-{
- Attribute *pFamily = mpFactory->RetrieveFamily(nFamily);
- int nQuality = 0;
-
- if (pFamily->HasFeature(XLFD_FEATURE_HQ))
- nQuality += 16;
- if (pFamily->HasFeature(XLFD_FEATURE_MQ))
- nQuality += 8;
- if (pFamily->HasFeature(XLFD_FEATURE_LQ))
- nQuality += 4;
- return nQuality;
-}
-
-bool
-VirtualXlfd::AddEncoding( const Xlfd *pXlfd )
-{
- // add new font
- bool bRC = ExtendedXlfd::AddEncoding( pXlfd );
-
- int nIdx;
- if( bRC )
- {
- // new encoding => append the new pXlfd
- nIdx = mnEncodings - 1;
- if( nIdx >= mnExtCapacity )
- {
- mnExtCapacity = mnEncCapacity;
- mpExtEncodingInfo = (ExtEncodingInfo*)Realloc( mpExtEncodingInfo,
- mnExtCapacity * sizeof(ExtEncodingInfo) );
- }
- }
- else
- {
- // existing encoding => check if the new pXlfd is better
- rtl_TextEncoding nEncoding = pXlfd->GetEncoding();
- nIdx = GetEncodingIdx( nEncoding );
-
- int nOldQuality = GetFontQuality( mpExtEncodingInfo[nIdx].mnFamily );
- int nNewQuality = GetFontQuality( pXlfd->mnFamily );
- if( nOldQuality >= nNewQuality )
- return false;
- }
-
- mpExtEncodingInfo[ nIdx ] = pXlfd;
- return true;
-}
-
-void
-VirtualXlfd::FilterInterfaceFont (const Xlfd *pXlfd)
-{
- Attribute *pAttr;
- AttributeProvider *pFactory = pXlfd->mpFactory;
-
- if (! pXlfd->Fonttype() == TYPE_SCALABLE)
- return;
- pAttr = pFactory->RetrieveFamily(pXlfd->mnFamily);
- if (! pAttr->HasFeature(XLFD_FEATURE_INTERFACE_FONT))
- return;
- pAttr = pFactory->RetrieveSlant(pXlfd->mnSlant);
- if (! (FontItalic)pAttr->GetValue() == ITALIC_NONE)
- return;
- pAttr = pFactory->RetrieveSetwidth(pXlfd->mnSetwidth);
- if (pAttr->HasFeature(XLFD_FEATURE_NARROW))
- return;
- pAttr = pFactory->RetrieveWeight(pXlfd->mnWeight);
- FontWeight eWeight = (FontWeight)pAttr->GetValue();
- if ((eWeight != WEIGHT_NORMAL) && (eWeight != WEIGHT_MEDIUM))
- return;
-
- AddEncoding (pXlfd);
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += '-';
- rString += ByteString::CreateFromInt32( nPixelSize );
- rString += "-0-0-0-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-0";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-void
-VirtualXlfd::ToString( ByteString &rString, unsigned short nPixelSize,
- char* pMatricsString, rtl_TextEncoding nEncoding ) const
-{
- int nIdx = GetEncodingIdx( nEncoding );
- if ( nIdx < 0 )
- return;
-
- ExtEncodingInfo &rExtInfo = mpExtEncodingInfo[ nIdx ];
-
- AppendAttribute( mpFactory->RetrieveFoundry(rExtInfo.mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(rExtInfo.mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(rExtInfo.mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(rExtInfo.mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(rExtInfo.mnSetwidth), rString );
-
- EncodingInfo& rInfo = mpEncodingInfo[ nIdx ];
- AppendAttribute( mpFactory->RetrieveAddstyle(rInfo.mnAddstyle), rString );
-
- rString += "-*-";
- char pTmp[256];
- snprintf( pTmp, sizeof(pTmp), pMatricsString, nPixelSize, nPixelSize );
- rString += pTmp;
- rString += "-*-*-";
- rString += static_cast< char >(rInfo.mcSpacing);
- rString += "-*";
-
- AppendAttribute( mpFactory->RetrieveCharset(rInfo.mnCharset), rString );
-}
-
-ImplFontData* VirtualXlfd::GetImplFontData() const
-{
- ImplX11FontData* pFontData = new ImplX11FontData( *this, 0 );
-
- // family name
- static const String aFontName( RTL_CONSTASCII_USTRINGPARAM("Interface User") );
- pFontData->maName = aFontName;
- // pFontData->maStyleName = aStyleName;
- pFontData->meFamily = FAMILY_SWISS;
- pFontData->meWeight = WEIGHT_NORMAL;
- pFontData->meItalic = ITALIC_NONE;
- pFontData->meWidthType = WIDTH_NORMAL;
- pFontData->mePitch = PITCH_VARIABLE;
-
- pFontData->mbSymbolFlag = false;
- pFontData->mbOrientation= false;
- pFontData->mbDevice = true;
- pFontData->mnQuality = 100;
-
- return pFontData;
-}
-
-// ------ font list -------------------------------------------------------
-
-XlfdStorage::XlfdStorage()
-{
- maXlfdList.reserve( 256 );
-}
-
-void
-XlfdStorage::Dispose()
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- delete *it;
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Reset()
-{
- maXlfdList.clear();
-}
-
-void
-XlfdStorage::Add( const ExtendedXlfd* pXlfd )
-{
- if ( pXlfd != NULL )
- maXlfdList.push_back( pXlfd );
-}
-
-void
-XlfdStorage::Add( const XlfdStorage* pXlfd )
-{
- if ( !pXlfd || pXlfd->maXlfdList.empty() )
- return;
-
- maXlfdList.reserve( maXlfdList.size() + pXlfd->maXlfdList.size() );
- XlfdList::const_iterator it = pXlfd->maXlfdList.begin();
- for(; it != pXlfd->maXlfdList.end(); ++it )
- maXlfdList.push_back( *it );
-}
-
-void XlfdStorage::AnnounceFonts( ImplDevFontList* pList ) const
-{
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- const ExtendedXlfd* pXlfd = *it;
- ImplFontData* pFontData = pXlfd->GetImplFontData();
- pList->Add( pFontData );
- }
-}
-
-// ------ bitmap font list --------------------------------------------------
-
-void
-BitmapXlfdStorage::AddBitmapFont( const Xlfd *pXlfd )
-{
- if ( pXlfd == NULL )
- return;
-
- int nPixelSize = pXlfd->mnPixelSize;
- XlfdList::const_iterator it = maXlfdList.begin();
- for(; it != maXlfdList.end(); ++it )
- {
- BitmapXlfd* pBitmapXlfd = (BitmapXlfd*)*it;
- if( nPixelSize == pBitmapXlfd->GetPixelSize() )
- {
- // we need to add an encoding to an existing bitmap font
- pBitmapXlfd->AddEncoding( pXlfd );
- return;
- }
- }
-
- // we have a new bitmap font
- BitmapXlfd* pBitmapXlfd = new BitmapXlfd;
- pBitmapXlfd->AddEncoding( pXlfd );
- Add( pBitmapXlfd );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_extd.hxx b/vcl/unx/source/gdi/xlfd_extd.hxx
deleted file mode 100644
index 306b9be74967..000000000000
--- a/vcl/unx/source/gdi/xlfd_extd.hxx
+++ /dev/null
@@ -1,271 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef XLFD_EXTENDED_HXX
-#define XLFD_EXTENDED_HXX
-
-#include <salunx.h>
-#include <vcl/vclenum.hxx>
-#include <vcl/outfont.hxx>
-
-#include <vector>
-
-class Xlfd;
-class AttributeProvider;
-class ImplDevFontList;
-class ByteString;
-
-// --------------------------------------------------------------------------
-//
-// classes for Xlfd handling that contain more than a single encoding.
-// Members that may vary through different encodings are stored in
-// a mpEncodingInfo member. There are three different classes:
-// true scalable fonts (truetype and type1) scalable bitmap fonts
-// (the ugly ones) and bitmap fonts. The ExtendedXlfd stores all the members
-// that are specific to a font outline
-// ( e.g. adobe-times-roman-medium-r-normal- * -p- * )
-// and specifies the interface.
-//
-// --------------------------------------------------------------------------
-
-// base class
-
-class ExtendedXlfd : public ImplDevFontAttributes
-{
- public:
- ExtendedXlfd( bool bScalable );
- virtual ~ExtendedXlfd();
- virtual bool AddEncoding( const Xlfd* );
- bool HasEncoding( rtl_TextEncoding ) const;
- int GetEncodingIdx( rtl_TextEncoding nEncoding ) const;
- unsigned short NumEncodings() const
- { return mnEncodings; }
- virtual int GetPixelSize() const
- { return 0; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const = 0;
- bool IsScalable() const { return mbScalable; }
- virtual FontFamily GetFamilyType() const;
- virtual FontWeight GetWeight() const;
- virtual FontItalic GetSlant() const;
- virtual FontWidth GetWidthType() const;
- virtual FontPitch GetPitch() const;
- virtual FontPitch GetPitch( rtl_TextEncoding ) const;
- rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const;
- rtl_TextEncoding GetEncoding() const;
- rtl_TextEncoding GetEncoding( int i ) const;
-
- int GetFontCodeRanges( sal_uInt32* pCodePairs ) const;
-
- protected:
- AttributeProvider* mpFactory;
-
- public:
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- bool mbScalable;
-
- protected:
- unsigned short mnEncodings;
- unsigned short mnEncCapacity;
- struct EncodingInfo {
- unsigned char mcSpacing;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned short mnAddstyle;
- unsigned short mnCharset;
- rtl_TextEncoding mnEncoding;
-
- EncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpEncodingInfo;
-};
-
-// class to handle scalable bitmap fonts
-
-class ScalableBitmapXlfd : public ExtendedXlfd {
-
- public:
- ScalableBitmapXlfd();
- virtual ~ScalableBitmapXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to handle true bitmap fonts
-
-class ScalableXlfd;
-
-class BitmapXlfd : public ExtendedXlfd {
-
- public:
- BitmapXlfd();
- ~BitmapXlfd();
- bool AddEncoding( const Xlfd* );
- virtual int GetPixelSize() const
- { return mnPixelSize; }
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnAverageWidth;
-};
-
-// class to handle true scalable fonts
-
-class ScalableXlfd : public ExtendedXlfd {
-
- friend class BitmapXlfd;
-
- public:
- ScalableXlfd();
- virtual ~ScalableXlfd();
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const;
-
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
- virtual ImplFontData* GetImplFontData() const ;
-};
-
-// class to maintain a list of fonts ( bitmap and scalable )
-
-class XlfdStorage {
-
- public:
- XlfdStorage();
-
- void Dispose();
- void Reset();
-
- void Add( const ExtendedXlfd *pXlfd );
- void Add( const XlfdStorage *pXlfd );
- void AnnounceFonts( ImplDevFontList* ) const;
-
- protected:
-
- typedef ::std::vector<const ExtendedXlfd*> XlfdList;
- XlfdList maXlfdList;
-};
-
-// list of fonts specific for bitmap fonts
-
-class BitmapXlfdStorage : public XlfdStorage {
-
- public:
-
- void AddBitmapFont( const Xlfd *pXlfd );
-};
-
-
-/* Virtual font for User Interface */
-
-class VirtualXlfd : public ExtendedXlfd
-{
- private:
-
- int GetFontQuality (unsigned short nFamily);
-
- public:
- VirtualXlfd();
- virtual ~VirtualXlfd();
- virtual bool AddEncoding( const Xlfd* );
- void FilterInterfaceFont (const Xlfd *pXlfd);
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- rtl_TextEncoding nEncoding ) const ;
- virtual void ToString( ByteString &rString,
- unsigned short nPixelSize,
- char* pMatricsString,
- rtl_TextEncoding nEncoding ) const;
-
- virtual ImplFontData* GetImplFontData() const ;
- protected:
-
- unsigned short mnExtCapacity;
- struct ExtEncodingInfo {
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
-
- ExtEncodingInfo& operator= ( const Xlfd *pXlfd );
- } *mpExtEncodingInfo;
-
- friend class ExtEncodingInfo;
-};
-
-
-// class to describe a X11 physically available font face
-
-class ImplX11FontData : public ImplFontData
-{
-private:
- enum { X11IFD_MAGIC = 0x111FDA1C };
- const ExtendedXlfd& mrXlfd;
-
-public:
- ImplX11FontData( const ExtendedXlfd&, int nHeight );
- const ExtendedXlfd& GetExtendedXlfd() const { return mrXlfd; }
- virtual ImplFontData* Clone() const { return new ImplX11FontData( *this ); }
- virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
- virtual sal_IntPtr GetFontId() const;
-
- static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( X11IFD_MAGIC ); }
-};
-
-#endif /* XLFD_EXTENDED_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_smpl.cxx b/vcl/unx/source/gdi/xlfd_smpl.cxx
deleted file mode 100644
index d9100a794c72..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.cxx
+++ /dev/null
@@ -1,270 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "xlfd_attr.hxx"
-#include "xlfd_smpl.hxx"
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-Xlfd::Xlfd()
-{
-}
-
-// XlfdCompare abi has to be qsort(3) compatible, the sorting result must
-// guarantee that fonts with SameFontoutline() are successive
-// XlfdCompare relies on vFrom->mpFactory eq vTo->mpFactory. Since comparing
-// Xlfd's is done by comparing attributes there is no way around this.
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo )
-{
- const Xlfd *pFrom = (Xlfd*)vFrom;
- const Xlfd *pTo = (Xlfd*)vTo;
-
- // Compare outline description
- if ( pFrom->mnFoundry != pTo->mnFoundry )
- return (int)pFrom->mnFoundry - (int)pTo->mnFoundry;
- if ( pFrom->mnFamily != pTo->mnFamily )
- return (int)pFrom->mnFamily - (int)pTo->mnFamily;
- if ( pFrom->mnWeight != pTo->mnWeight )
- return (int)pFrom->mnWeight - (int)pTo->mnWeight;
- if ( pFrom->mnSlant != pTo->mnSlant )
- return (int)pFrom->mnSlant - (int)pTo->mnSlant;
- if ( pFrom->mnSetwidth != pTo->mnSetwidth )
- return (int)pFrom->mnSetwidth - (int)pTo->mnSetwidth;
-
- // Addstyle name is futile tricky. it may contain encoding information
- // (like "ansi_1251") which Compares equal, or it may contain style
- // information (like "serif") which Compares unequal, anyway if the font
- // is "interface user" or "interface system" then compare equal anyway to
- // build fontsets as large as possible
- if ( pFrom->mnAddstyle == pTo->mnAddstyle )
- return 0;
-
- AttributeProvider *pFactory = pFrom->mpFactory;
- Attribute *pFamily = pFactory->RetrieveFamily( pFrom->mnFamily );
- if ( pFamily->HasFeature(XLFD_FEATURE_APPLICATION_FONT) )
- return 0;
-
- Attribute *pFromAddStyle = pFactory->RetrieveAddstyle( pFrom->mnAddstyle );
- Attribute *pToAddStyle = pFactory->RetrieveAddstyle( pTo->mnAddstyle );
-
- // if both addstyles denote encodings or if one denotes an
- // encoding and the other denotes a style which really
- // duplicates weight and slant information
-
- int nFromCompare = (pFromAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pFromAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pFrom->mnAddstyle;
- int nToCompare = (pToAddStyle->GetValue() != RTL_TEXTENCODING_DONTKNOW)
- || (pToAddStyle->HasFeature(XLFD_FEATURE_REDUNDANTSTYLE)) ?
- -1 : pTo->mnAddstyle;
-
- return nFromCompare - nToCompare;
-}
-
-// check whether two fonts are identical as appearance is concerned
-// this does not Compare the actual scaling of two fonts
-Bool
-Xlfd::SameFontoutline( const Xlfd* pComparedTo ) const
-{
- void* pThis = (void*)this;
- return XlfdCompare( (void*)pThis, (void*)pComparedTo ) == 0 ;
-}
-
-unsigned short
-Xlfd::GetEncoding() const
-{
- Attribute *pAddstyle = mpFactory->RetrieveAddstyle( mnAddstyle );
- if ( pAddstyle->GetValue() != RTL_TEXTENCODING_DONTKNOW )
- return pAddstyle->GetValue();
-
- Attribute *pEncoding = mpFactory->RetrieveCharset( mnCharset );
- return pEncoding->GetValue();
-}
-
-XlfdFonttype
-Xlfd::Fonttype() const
-{
- if ( (mnAverageWidth == 0) && (mnPixelSize == 0) && (mnPointSize == 0) )
- {
- return (mnResolutionX == 0)
- && (mnResolutionY == 0) ? eTypeScalable : eTypeScalableBitmap;
- }
-
- return eTypeBitmap;
-}
-
-void
-Advance( const char** pFrom, const char** pTo )
-{
- const char *pTmp = *pTo;
-
- for( ; (*pTmp != '\0') && (*pTmp++ != '-'); )
- {}
- *pFrom = *pTo;
- *pTo = pTmp;
-}
-
-Bool
-Xlfd::IsConformant (const char* pXlfd) const
-{
- // X FontNameRegistry prefix "-"
- if (*pXlfd++ != '-')
- return False;
-
- // All Xlfd FontName fields are defined
- int nNumFields = 1;
- while (*pXlfd != '\0')
- {
- if (*pXlfd++ == '-')
- nNumFields++;
- }
- // enough entries ?
- if (nNumFields != 14)
- return False;
- // and the last one is not empty as well ?
- if (*(pXlfd - 1) == '-')
- return False;
-
- return True;
-}
-
-// this is the real workhorse function. Since this is called for every font
-// in the fontpath it has to be as fast a possible
-Bool
-Xlfd::FromString( const char* pXlfdstring, AttributeProvider *pFactory )
-{
- if (!IsConformant(pXlfdstring))
- return False;
-
- const char* pFrom = pXlfdstring + 1;
- const char* pTo = pFrom;
- mpFactory = pFactory;
-
- Advance( &pFrom, &pTo ); //-foundry-*
- mnFoundry = mpFactory->InsertFoundry( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-family-*
- mnFamily = mpFactory->InsertFamily( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); // -*-*-weight-*
- mnWeight = mpFactory->InsertWeight( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-slant-*
- mnSlant = mpFactory->InsertSlant( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-setwidth-*
- mnSetwidth = mpFactory->InsertSetwidth( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-Addstyle-*
- mnAddstyle = mpFactory->InsertAddstyle( pFrom, pTo - pFrom - 1 );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-height-*
- mnPixelSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-pt height-*
- mnPointSize = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-x resolution-*
- mnResolutionX = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-y resolution-*
- mnResolutionY = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-spacing-*
- mcSpacing = pFrom == pTo ? '\0' : *pFrom;
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-average-*
- mnAverageWidth = atoi( pFrom );
-
- Advance( &pFrom, &pTo ); //-*-*-*-*-*-*-*-*-*-*-*-*-registry-encoding
- const char* pTmp = pFrom;
- Advance( &pTmp, &pTo );
- mnCharset = mpFactory->InsertCharset( pFrom, pTo - pFrom );
-
- // sanity check whether we have really found a valid XLFD, if not
- // throw away the whole font, since we have no idea what parts of
- // the XLFD contains the error.
- if ( !(pTo > pFrom) )
- return False;
-
- // a non-empty family name is essential, since otherwise the font
- // would match the "default font" #52299#
- Attribute* pFamily = mpFactory->RetrieveFamily( mnFamily );
- const char* pFamilyName = pFamily->GetName();
- if ( pFamilyName[0] == '\0' )
- return False;
-
- // well done
- return True;
-}
-
-#if OSL_DEBUG_LEVEL > 1
-// pure debug for now: this is only to inspect/pretty print a Xlfd struct
-const char*
-Xlfd::ToString( ByteString &rString ) const
-{
- AppendAttribute( mpFactory->RetrieveFoundry(mnFoundry), rString );
- AppendAttribute( mpFactory->RetrieveFamily(mnFamily), rString );
- AppendAttribute( mpFactory->RetrieveWeight(mnWeight), rString );
- AppendAttribute( mpFactory->RetrieveSlant(mnSlant), rString );
- AppendAttribute( mpFactory->RetrieveSetwidth(mnSetwidth), rString );
- AppendAttribute( mpFactory->RetrieveAddstyle(mnAddstyle), rString );
-
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPixelSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnPointSize ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionX ) );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnResolutionY ) );
- rString.Append("-"); rString.Append( (char)mcSpacing );
- rString.Append("-"); rString.Append( ByteString::CreateFromInt32( mnAverageWidth ) );
-
- AppendAttribute( mpFactory->RetrieveCharset(mnCharset), rString );
-
- return rString.GetBuffer() ;
-}
-
-void
-Xlfd::Dump() const
-{
- ByteString aString;
- fprintf(stderr, "Xlfd: %s\n", ToString(aString) );
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/gdi/xlfd_smpl.hxx b/vcl/unx/source/gdi/xlfd_smpl.hxx
deleted file mode 100644
index a412d332fd9b..000000000000
--- a/vcl/unx/source/gdi/xlfd_smpl.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef XLFD_SIMPLE_HXX
-#define XLFD_SIMPLE_HXX
-
-#include <salunx.h>
-#include <vcl/vclenum.hxx>
-#include <tools/string.hxx>
-
-class AttributeProvider;
-
-// --------------------------------------------------------------------------
-//
-//
-// broken down structure equivalent to a Xlfd string
-//
-//
-// --------------------------------------------------------------------------
-
-enum XlfdFonttype {
- eTypeUnknown = TYPE_DONTKNOW,
- eTypeBitmap = TYPE_RASTER,
- eTypeScalableBitmap = TYPE_VECTOR,
- eTypeScalable = TYPE_SCALABLE
-};
-
-class Xlfd {
-
- public:
-
- unsigned short mnFoundry;
- unsigned short mnFamily;
- unsigned short mnWeight;
- unsigned short mnSlant;
- unsigned short mnSetwidth;
- unsigned short mnAddstyle;
- unsigned short mnPixelSize;
- unsigned short mnPointSize;
- unsigned short mnResolutionX;
- unsigned short mnResolutionY;
- unsigned char mcSpacing;
- unsigned short mnAverageWidth;
- unsigned short mnCharset;
-
- // all foundry, family, weight ... information referres
- // to this factory
- AttributeProvider *mpFactory;
-
- Bool IsConformant( const char* pXlfdstring ) const;
-
- public:
- Xlfd();
- Bool FromString( const char* pXlfdstring,
- AttributeProvider *pFactory );
- Bool SameFontoutline( const Xlfd *pComparedTo ) const ;
- XlfdFonttype Fonttype() const ;
- unsigned short GetEncoding() const ;
- #if OSL_DEBUG_LEVEL > 1
- const char* ToString( ByteString &rString ) const ;
- void Dump() const;
- #endif
-};
-
-extern "C" int
-XlfdCompare( const void *vFrom, const void *vTo );
-
-#endif /* XLFD_SIMPLE_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index eecb026087e1..c27646cf1fd7 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -37,6 +37,7 @@
#include "vcl/salinst.hxx"
#include "saldata.hxx"
+#include "vcl/printerinfomanager.hxx"
#include <cstdio>
#include <unistd.h>
@@ -294,12 +295,14 @@ const OUString& SalGetDesktopEnvironment()
SalData::SalData() :
m_pInstance(NULL),
- m_pPlugin(NULL)
+ m_pPlugin(NULL),
+ m_pPIManager(NULL)
{
}
SalData::~SalData()
{
+ psp::PrinterInfoManager::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx
index 13652ae23924..655181294190 100644
--- a/vcl/unx/source/printer/cupsmgr.cxx
+++ b/vcl/unx/source/printer/cupsmgr.cxx
@@ -530,12 +530,18 @@ void CUPSManager::initialize()
// introduced in dests with 1.2
// this is needed to check for %%IncludeFeature support
// (#i65684#, #i65491#)
+ bool bUsePDF = false;
cups_dest_t* pDest = ((cups_dest_t*)m_pDests);
const char* pOpt = m_pCUPSWrapper->cupsGetOption( "printer-info",
pDest->num_options,
pDest->options );
if( pOpt )
+ {
m_bUseIncludeFeature = true;
+ bUsePDF = true;
+ if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
+ m_aGlobalDefaults.m_nPDFDevice = 1;
+ }
// do not send include JobPatch; CUPS will insert that itself
// TODO: currently unknwon which versions of CUPS insert JobPatches
// so currently it is assumed CUPS = don't insert JobPatch files
@@ -599,6 +605,8 @@ void CUPSManager::initialize()
aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
aPrinter.m_aInfo.m_aContext = c_it->second;
}
+ if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
+ aPrinter.m_aInfo.m_nPDFDevice = 1;
aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
aPrinter.m_bModified = false;
@@ -832,8 +840,15 @@ void CUPSManager::setupJobContextData(
FILE* CUPSManager::startSpool( const OUString& rPrintername, bool bQuickCommand )
{
+ OSL_TRACE( "endSpool: %s, %s",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ bQuickCommand ? "true" : "false" );
+
if( m_aCUPSDestMap.find( rPrintername ) == m_aCUPSDestMap.end() )
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::startSpool" );
return PrinterInfoManager::startSpool( rPrintername, bQuickCommand );
+ }
#ifdef ENABLE_CUPS
OUString aTmpURL, aTmpFile;
@@ -856,7 +871,7 @@ struct less_ppd_key : public ::std::binary_function<double, double, bool>
{ return left->getOrderDependency() < right->getOrderDependency(); }
};
-void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOptions, void** rOptions ) const
+void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, int& rNumOptions, void** rOptions ) const
{
rNumOptions = 0;
*rOptions = NULL;
@@ -886,10 +901,26 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, int& rNumOpt
}
}
}
+
+ if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ {
+ rtl::OString aVal( rtl::OString::valueOf( sal_Int32( rJob.m_nCopies ) ) );
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "copies", aVal.getStr(), rNumOptions, (cups_option_t**)rOptions );
+ }
+ if( ! bBanner )
+ {
+ rNumOptions = m_pCUPSWrapper->cupsAddOption( "job-sheets", "none", rNumOptions, (cups_option_t**)rOptions );
+ }
}
-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData )
+int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
{
+ OSL_TRACE( "endSpool: %s, %s, copy count = %d",
+ rtl::OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rtl::OUStringToOString( rJobTitle, RTL_TEXTENCODING_UTF8 ).getStr(),
+ rDocumentJobData.m_nCopies
+ );
+
int nJobID = 0;
osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -897,7 +928,10 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
boost::unordered_map< OUString, int, OUStringHash >::iterator dest_it =
m_aCUPSDestMap.find( rPrintername );
if( dest_it == m_aCUPSDestMap.end() )
- return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData );
+ {
+ OSL_TRACE( "defer to PrinterInfoManager::endSpool" );
+ return PrinterInfoManager::endSpool( rPrintername, rJobTitle, pFile, rDocumentJobData, bBanner );
+ }
#ifdef ENABLE_CUPS
boost::unordered_map< FILE*, OString, FPtrHash >::const_iterator it = m_aSpoolFiles.find( pFile );
@@ -909,7 +943,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
// setup cups options
int nNumOptions = 0;
cups_option_t* pOptions = NULL;
- getOptionsFromDocumentSetup( rDocumentJobData, nNumOptions, (void**)&pOptions );
+ getOptionsFromDocumentSetup( rDocumentJobData, bBanner, nNumOptions, (void**)&pOptions );
cups_dest_t* pDest = ((cups_dest_t*)m_pDests) + dest_it->second;
nJobID = m_pCUPSWrapper->cupsPrintFile( pDest->name,
diff --git a/vcl/unx/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx
index ae5dd71c43ed..0982b219bade 100644
--- a/vcl/unx/source/printer/jobdata.cxx
+++ b/vcl/unx/source/printer/jobdata.cxx
@@ -51,6 +51,7 @@ JobData& JobData::operator=(const JobData& rRight)
m_pParser = rRight.m_pParser;
m_aContext = rRight.m_aContext;
m_nPSLevel = rRight.m_nPSLevel;
+ m_nPDFDevice = rRight.m_nPDFDevice;
m_nColorDevice = rRight.m_nColorDevice;
if( ! m_pParser && m_aPrinterName.getLength() )
@@ -83,6 +84,34 @@ void JobData::setCollate( bool bCollate )
}
}
+bool JobData::setPaper( int i_nWidth, int i_nHeight )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ rtl::OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
+
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
+bool JobData::setPaperBin( int i_nPaperBin )
+{
+ bool bSuccess = false;
+ if( m_pParser )
+ {
+ const PPDKey* pKey = m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) );
+ const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : NULL;
+
+ bSuccess = pKey && pValue && m_aContext.setValue( pKey, pValue, false );
+ }
+ return bSuccess;
+}
+
bool JobData::getStreamBuffer( void*& pData, int& bytes )
{
// consistency checks
@@ -128,13 +157,17 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
aLine += ByteString::CreateFromInt32( m_nPSLevel );
aStream.WriteLine( aLine );
+ aLine = "pdfdevice=";
+ aLine += ByteString::CreateFromInt32( m_nPDFDevice );
+ aStream.WriteLine( aLine );
+
aLine = "colordevice=";
aLine += ByteString::CreateFromInt32( m_nColorDevice );
aStream.WriteLine( aLine );
// now append the PPDContext stream buffer
aStream.WriteLine( "PPDContexData" );
- ULONG nBytes;
+ sal_uLong nBytes;
void* pContextBuffer = m_aContext.getStreamableBuffer( nBytes );
if( nBytes )
aStream.Write( pContextBuffer, nBytes );
@@ -158,6 +191,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bool bColorDepth = false;
bool bColorDevice = false;
bool bPSLevel = false;
+ bool bPDFDevice = false;
while( ! aStream.IsEof() )
{
aStream.ReadLine( aLine );
@@ -202,6 +236,11 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
bPSLevel = true;
rJobData.m_nPSLevel = aLine.Copy( 8 ).ToInt32();
}
+ else if( aLine.CompareTo( "pdfdevice=", 10 ) == COMPARE_EQUAL )
+ {
+ bPDFDevice = true;
+ rJobData.m_nPDFDevice = aLine.Copy( 10 ).ToInt32();
+ }
else if( aLine.Equals( "PPDContexData" ) )
{
if( bPrinter )
@@ -222,7 +261,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx
index 22e17aa774d9..30d4598568d2 100644
--- a/vcl/unx/source/printer/ppdparser.cxx
+++ b/vcl/unx/source/printer/ppdparser.cxx
@@ -340,7 +340,7 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile )
mpFileStream->Seek( 0 );
// check for compress'ed or gzip'ed file
- ULONG nCompressMethod = 0;
+ sal_uLong nCompressMethod = 0;
if( aLine.Len() > 1 && static_cast<unsigned char>(aLine.GetChar( 0 )) == 0x1f )
{
if( static_cast<unsigned char>(aLine.GetChar( 1 )) == 0x8b ) // check for gzip
@@ -436,51 +436,53 @@ void PPDParser::scanPPDDir( const String& rDir )
PPDCache &rPPDCache = thePPDCache::get();
osl::Directory aDir( rDir );
- aDir.open();
- osl::DirectoryItem aItem;
-
- INetURLObject aPPDDir(rDir);
- while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
+ if ( aDir.open() == osl::FileBase::E_None )
{
- osl::FileStatus aStatus( FileStatusMask_FileName );
- if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ osl::DirectoryItem aItem;
+
+ INetURLObject aPPDDir(rDir);
+ while( aDir.getNextItem( aItem ) == osl::FileBase::E_None )
{
- rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
- aURLBuf.append( rDir );
- aURLBuf.append( sal_Unicode( '/' ) );
- aURLBuf.append( aStatus.getFileName() );
+ osl::FileStatus aStatus( FileStatusMask_FileName );
+ if( aItem.getFileStatus( aStatus ) == osl::FileBase::E_None )
+ {
+ rtl::OUStringBuffer aURLBuf( rDir.Len() + 64 );
+ aURLBuf.append( rDir );
+ aURLBuf.append( sal_Unicode( '/' ) );
+ aURLBuf.append( aStatus.getFileName() );
- rtl::OUString aFileURL, aFileName;
- osl::FileStatus::Type eType = osl::FileStatus::Unknown;
+ rtl::OUString aFileURL, aFileName;
+ osl::FileStatus::Type eType = osl::FileStatus::Unknown;
- if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
- {
- if( eType == osl::FileStatus::Regular )
+ if( resolveLink( aURLBuf.makeStringAndClear(), aFileURL, aFileName, eType ) == osl::FileBase::E_None )
{
- INetURLObject aPPDFile = aPPDDir;
- aPPDFile.Append( aFileName );
-
- // match extension
- for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
+ if( eType == osl::FileStatus::Regular )
{
- if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
+ INetURLObject aPPDFile = aPPDDir;
+ aPPDFile.Append( aFileName );
+
+ // match extension
+ for( int nSuffix = 0; nSuffix < nSuffixes; nSuffix++ )
{
- if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ if( aFileName.getLength() > pSuffixes[nSuffix].nSuffixLen )
{
+ if( aFileName.endsWithIgnoreAsciiCaseAsciiL( pSuffixes[nSuffix].pSuffix, pSuffixes[nSuffix].nSuffixLen ) )
+ {
(*rPPDCache.pAllPPDFiles)[ aFileName.copy( 0, aFileName.getLength() - pSuffixes[nSuffix].nSuffixLen ) ] = aPPDFile.PathToFileName();
- break;
+ break;
+ }
}
}
}
- }
- else if( eType == osl::FileStatus::Directory )
- {
- scanPPDDir( aFileURL );
+ else if( eType == osl::FileStatus::Directory )
+ {
+ scanPPDDir( aFileURL );
+ }
}
}
}
+ aDir.close();
}
- aDir.close();
}
void PPDParser::initPPDFiles()
@@ -1130,7 +1132,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale );
// eventually update query and remove from option list
- if( bQuery && pKey->m_bQueryValue == FALSE )
+ if( bQuery && pKey->m_bQueryValue == sal_False )
{
pKey->m_aQueryValue = *pValue;
pKey->m_bQueryValue = true;
@@ -1145,7 +1147,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines )
if( aLine.CompareTo( "*Default", 8 ) == COMPARE_EQUAL )
{
String aKey( aLine.Copy( 8 ), RTL_TEXTENCODING_MS_1252 );
- USHORT nPos = aKey.Search( ':' );
+ sal_uInt16 nPos = aKey.Search( ':' );
if( nPos != STRING_NOTFOUND )
{
aKey.Erase( nPos );
@@ -1433,7 +1435,7 @@ String PPDParser::getSlot( int nSlot ) const
if( nSlot > 0 && nSlot < m_pInputSlots->countValues() )
return m_pInputSlots->getValue( nSlot )->m_aOption;
else if( m_pInputSlots->countValues() > 0 )
- return m_pInputSlots->getValue( (ULONG)0 )->m_aOption;
+ return m_pInputSlots->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1446,7 +1448,7 @@ String PPDParser::getSlotCommand( int nSlot ) const
if( nSlot > 0 && nSlot < m_pInputSlots->countValues() )
return m_pInputSlots->getValue( nSlot )->m_aValue;
else if( m_pInputSlots->countValues() > 0 )
- return m_pInputSlots->getValue( (ULONG)0 )->m_aValue;
+ return m_pInputSlots->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -1473,7 +1475,7 @@ String PPDParser::getPaperDimension( int nPaperDimension ) const
if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() )
return m_pPaperDimensions->getValue( nPaperDimension )->m_aOption;
else if( m_pPaperDimensions->countValues() > 0 )
- return m_pPaperDimensions->getValue( (ULONG)0 )->m_aOption;
+ return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1486,7 +1488,7 @@ String PPDParser::getPaperDimensionCommand( int nPaperDimension ) const
if( nPaperDimension > 0 && nPaperDimension < m_pPaperDimensions->countValues() )
return m_pPaperDimensions->getValue( nPaperDimension )->m_aValue;
else if( m_pPaperDimensions->countValues() > 0 )
- return m_pPaperDimensions->getValue( (ULONG)0 )->m_aValue;
+ return m_pPaperDimensions->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -1595,7 +1597,7 @@ String PPDParser::getDuplex( int nDuplex ) const
if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() )
return m_pDuplexTypes->getValue( nDuplex )->m_aOption;
else if( m_pDuplexTypes->countValues() > 0 )
- return m_pDuplexTypes->getValue( (ULONG)0 )->m_aOption;
+ return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aOption;
return String();
}
@@ -1608,7 +1610,7 @@ String PPDParser::getDuplexCommand( int nDuplex ) const
if( nDuplex > 0 && nDuplex < m_pDuplexTypes->countValues() )
return m_pDuplexTypes->getValue( nDuplex )->m_aValue;
else if( m_pDuplexTypes->countValues() > 0 )
- return m_pDuplexTypes->getValue( (ULONG)0 )->m_aValue;
+ return m_pDuplexTypes->getValue( (sal_uLong)0 )->m_aValue;
return String();
}
@@ -2050,7 +2052,7 @@ void PPDContext::getUnconstrainedValues( const PPDKey* pKey, ::std::list< const
// -------------------------------------------------------------------
-void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const
+void* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
{
rBytes = 0;
if( ! m_aCurrentValues.size() )
@@ -2096,7 +2098,7 @@ void* PPDContext::getStreamableBuffer( ULONG& rBytes ) const
// -------------------------------------------------------------------
-void PPDContext::rebuildFromStreamBuffer( void* pBuffer, ULONG nBytes )
+void PPDContext::rebuildFromStreamBuffer( void* pBuffer, sal_uLong nBytes )
{
if( ! m_pParser )
return;
diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx
index 68223d6fdf8f..e4634ab0c8b5 100644
--- a/vcl/unx/source/printer/printerinfomanager.cxx
+++ b/vcl/unx/source/printer/printerinfomanager.cxx
@@ -36,6 +36,7 @@
#include "cupsmgr.hxx"
#include "vcl/fontmanager.hxx"
#include "vcl/strhelper.hxx"
+#include "saldata.hxx"
#include "tools/urlobj.hxx"
#include "tools/stream.hxx"
@@ -100,20 +101,28 @@ namespace psp
PrinterInfoManager& PrinterInfoManager::get()
{
- static boost::scoped_ptr<PrinterInfoManager> pManager;
+ SalData* pSalData = GetSalData();
- if (!pManager)
+ if( ! pSalData->m_pPIManager )
{
- pManager.reset(CUPSManager::tryLoadCUPS());
- if (!pManager)
- pManager.reset(new PrinterInfoManager());
- pManager->initialize();
-# if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pManager->getType() );
-# endif
+ pSalData->m_pPIManager = CUPSManager::tryLoadCUPS();
+ if( ! pSalData->m_pPIManager )
+ pSalData->m_pPIManager = new PrinterInfoManager();
+
+ pSalData->m_pPIManager->initialize();
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager::get create Manager of type %d\n", pSalData->m_pPIManager->getType() );
+#endif
}
- return *pManager;
+ return *pSalData->m_pPIManager;
+}
+
+void PrinterInfoManager::release()
+{
+ SalData* pSalData = GetSalData();
+ delete pSalData->m_pPIManager;
+ pSalData->m_pPIManager = NULL;
}
// -----------------------------------------------------------------
@@ -136,6 +145,9 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) :
PrinterInfoManager::~PrinterInfoManager()
{
delete m_pQueueInfo;
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "PrinterInfoManager: destroyed Manager of type %d\n", getType() );
+ #endif
}
// -----------------------------------------------------------------
@@ -289,6 +301,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
m_aGlobalDefaults.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ m_aGlobalDefaults.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( aValue.Len() )
{
@@ -320,7 +336,7 @@ void PrinterInfoManager::initialize()
m_aGlobalDefaults.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- TRUE );
+ sal_True );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -500,6 +516,10 @@ void PrinterInfoManager::initialize()
if( aValue.Len() )
aPrinter.m_aInfo.m_nPSLevel = aValue.ToInt32();
+ aValue = aConfig.ReadKey( "PDFDevice" );
+ if( aValue.Len() )
+ aPrinter.m_aInfo.m_nPDFDevice = aValue.ToInt32();
+
aValue = aConfig.ReadKey( "PerformFontSubstitution" );
if( ! aValue.Equals( "0" ) && ! aValue.EqualsIgnoreCaseAscii( "false" ) )
aPrinter.m_aInfo.m_bPerformFontSubstitution = true;
@@ -521,7 +541,7 @@ void PrinterInfoManager::initialize()
aPrinter.m_aInfo.m_aContext.
setValue( pKey,
aValue.Equals( "*nil" ) ? NULL : pKey->getValue( String( aValue, RTL_TEXTENCODING_ISO_8859_1 ) ),
- TRUE );
+ sal_True );
}
}
else if( aKey.Len() > 10 && aKey.CompareTo("SubstFont_", 10 ) == COMPARE_EQUAL )
@@ -630,7 +650,7 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter
static PrinterInfo aEmptyInfo;
::boost::unordered_map< OUString, Printer, OUStringHash >::const_iterator it = m_aPrinters.find( rPrinter );
- DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistant printers" );
+ DBG_ASSERT( it != m_aPrinters.end(), "Do not ask for info about nonexistent printers" );
return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo;
}
@@ -764,6 +784,7 @@ bool PrinterInfoManager::writePrinterConfig()
pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) );
pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) );
+ pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) );
pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) );
pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) );
aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust );
@@ -851,9 +872,10 @@ bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUStrin
m_aPrinters[ rPrinterName ] = aPrinter;
bSuccess = true;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "new printer %s, level = %d, colordevice = %d, depth = %d\n",
+ fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(),
m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel,
+ m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice,
m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth );
#endif
@@ -1101,7 +1123,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
return popen (aShellCommand.getStr(), "w");
}
-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/ )
+int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
{
return (0 == pclose( pFile ));
}
@@ -1172,7 +1194,11 @@ SystemQueueInfo::SystemQueueInfo() :
SystemQueueInfo::~SystemQueueInfo()
{
- terminate();
+ static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" );
+ if( ! pNoSyncDetection || !*pNoSyncDetection )
+ join();
+ else
+ terminate();
}
bool SystemQueueInfo::hasChanged() const
diff --git a/vcl/unx/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx
index 14d3a98d69b2..fc366aab838f 100644
--- a/vcl/unx/source/printergfx/common_gfx.cxx
+++ b/vcl/unx/source/printergfx/common_gfx.cxx
@@ -528,9 +528,9 @@ PrinterGfx::DrawPolyPolygon (sal_uInt32 nPoly, const sal_uInt32* pSizes, const P
*/
void
-PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
+PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
{
- const sal_uInt32 nBezString = 1024;
+ const sal_uInt32 nBezString= 1024;
sal_Char pString[nBezString];
if ( nPoints > 1 && maLineColor.Is() && pPath )
@@ -579,7 +579,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BY
}
void
-PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry)
+PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const sal_uInt8* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
@@ -635,7 +635,7 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYT
}
void
-PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const BYTE* const* pFlgAry)
+PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, const Point* const * pPtAry, const sal_uInt8* const* pFlgAry)
{
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx
index 4ca5965e5b34..7df531975c57 100644
--- a/vcl/unx/source/printergfx/printerjob.cxx
+++ b/vcl/unx/source/printergfx/printerjob.cxx
@@ -347,7 +347,8 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- removeSpoolDir (maSpoolDirName);
+ if( maSpoolDirName.getLength() )
+ removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
}
@@ -415,7 +416,7 @@ PrinterJob::StartJob (
rtl::OUString aFilterWS;
// Creator (this application)
- aFilterWS = WhitespaceToSpace( rAppName, FALSE );
+ aFilterWS = WhitespaceToSpace( rAppName, sal_False );
WritePS (mpJobHeader, "%%Creator: (");
WritePS (mpJobHeader, aFilterWS);
WritePS (mpJobHeader, ")\n");
@@ -453,14 +454,14 @@ PrinterJob::StartJob (
* use the filename, if it contains only ascii
* else omit %%Title
*/
- aFilterWS = WhitespaceToSpace( rJobName, FALSE );
+ aFilterWS = WhitespaceToSpace( rJobName, sal_False );
rtl::OUString aTitle( aFilterWS );
if( ! isAscii( aTitle ) )
{
sal_Int32 nIndex = 0;
while( nIndex != -1 )
aTitle = rFileName.getToken( 0, '/', nIndex );
- aTitle = WhitespaceToSpace( aTitle, FALSE );
+ aTitle = WhitespaceToSpace( aTitle, sal_False );
if( ! isAscii( aTitle ) )
aTitle = rtl::OUString();
}
@@ -501,6 +502,10 @@ PrinterJob::StartJob (
sal_Bool
PrinterJob::EndJob ()
{
+ // no pages ? that really means no print job
+ if( maPageList.empty() )
+ return sal_False;
+
// write document setup (done here because it
// includes the accumulated fonts
if( mpJobHeader )
@@ -616,7 +621,7 @@ PrinterJob::EndJob ()
{
PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
- maJobTitle, pDestFILE, m_aDocumentJobData ))
+ maJobTitle, pDestFILE, m_aDocumentJobData, true ))
{
bSuccess = sal_False;
}
diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk
index 808b712903f3..c5cd95ba6b1c 100644
--- a/vcl/unx/source/window/makefile.mk
+++ b/vcl/unx/source/window/makefile.mk
@@ -48,7 +48,7 @@ dummy:
.ELSE # "$(GUIBASE)"!="unx"
SLOFILES= \
- $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj
+ $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj
.ENDIF # "$(GUIBASE)"!="unx"
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 5068724f7da4..9a5d149f14fd 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -211,7 +211,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
+void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry )
{
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = GetDisplay()->GetDefaultScreenNumber();
@@ -484,8 +484,8 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa
}
nShowState_ = SHOWSTATE_UNKNOWN;
- bViewable_ = TRUE;
- bMapped_ = FALSE;
+ bViewable_ = sal_True;
+ bMapped_ = sal_False;
nVisibility_ = VisibilityFullyObscured;
mhWindow = XCreateWindow( GetXDisplay(),
aFrameParent,
@@ -647,7 +647,7 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent )
+X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent )
{
X11SalData* pSalData = GetX11SalData();
@@ -687,16 +687,16 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD
nHeight_ = 0;
nStyle_ = 0;
mnExtStyle = 0;
- bAlwaysOnTop_ = FALSE;
+ bAlwaysOnTop_ = sal_False;
- // set bViewable_ to TRUE: hack GetClientSize to report something
+ // set bViewable_ to sal_True: hack GetClientSize to report something
// different to 0/0 before first map
- bViewable_ = TRUE;
- bMapped_ = FALSE;
- bDefaultPosition_ = TRUE;
+ bViewable_ = sal_True;
+ bMapped_ = sal_False;
+ bDefaultPosition_ = sal_True;
nVisibility_ = VisibilityFullyObscured;
m_nWorkArea = 0;
- mbInShow = FALSE;
+ mbInShow = sal_False;
m_bXEmbed = false;
nScreenSaversTimeout_ = 0;
@@ -791,10 +791,10 @@ X11SalFrame::~X11SalFrame()
XSelectInput( GetXDisplay(), GetShellWindow(), 0 );
XSelectInput( GetXDisplay(), GetWindow(), 0 );
- ShowFullScreen( FALSE, 0 );
+ ShowFullScreen( sal_False, 0 );
if( bMapped_ )
- Show( FALSE );
+ Show( sal_False );
if( mpInputContext )
{
@@ -951,14 +951,14 @@ void X11SalFrame::updateGraphics( bool bClear )
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Enable( BOOL /*bEnable*/ )
+void X11SalFrame::Enable( sal_Bool /*bEnable*/ )
{
// NYI: enable/disable frame
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetIcon( USHORT nIcon )
+void X11SalFrame::SetIcon( sal_uInt16 nIcon )
{
if ( ! IsChildWindow() )
{
@@ -1060,7 +1060,7 @@ void X11SalFrame::SetIcon( USHORT nIcon )
}
pHints = &Hints;
- BOOL bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
+ sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen,
nIcon, iconSize,
pHints->icon_pixmap, pHints->icon_mask );
if ( !bOk )
@@ -1133,7 +1133,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight )
// Show + Pos (x,y,z) + Size (width,height)
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
if( ( bVisible && bMapped_ )
|| ( !bVisible && !bMapped_ ) )
@@ -1151,7 +1151,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
setXEmbedInfo();
if( bVisible )
{
- mbInShow = TRUE;
+ mbInShow = sal_True;
if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) )
{
// hide all INTRO frames
@@ -1163,12 +1163,12 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
if( pFrame->nStyle_ & SAL_FRAME_STYLE_INTRO )
{
if( pFrame->bMapped_ )
- const_cast<X11SalFrame*>(pFrame)->Show( FALSE );
+ const_cast<X11SalFrame*>(pFrame)->Show( sal_False );
}
}
}
- // update NET_WM_STATE which may have been deleted due to earlier Show(FALSE)
+ // update NET_WM_STATE which may have been deleted due to earlier Show(sal_False)
if( nShowState_ == SHOWSTATE_HIDDEN )
GetDisplay()->getWMAdaptor()->frameIsMapping( this );
@@ -1177,7 +1177,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* with the basic dialogue editor,
* which shows a frame and instantly hides it again. After that the
* editor window is shown and the WM takes this as an opportunity
- * to show our hidden transient frame also. So Show( FALSE ) must
+ * to show our hidden transient frame also. So Show( sal_False ) must
* withdraw the frame AND delete the WM_TRANSIENT_FOR property.
* In case the frame is shown again, the transient hint must be restored here.
*/
@@ -1310,7 +1310,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
* plugged windows don't necessarily get the
* focus on show because the parent may already be mapped
* and have the focus. So try to set the focus
- * to the child on Show(TRUE)
+ * to the child on Show(sal_True)
*/
if( (nStyle_ & SAL_FRAME_STYLE_PLUG) && ! m_bXEmbed )
XSetInputFocus( GetXDisplay(),
@@ -1358,7 +1358,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ToTop( USHORT nFlags )
+void X11SalFrame::ToTop( sal_uInt16 nFlags )
{
if( ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN )
&& ! ( nStyle_ & SAL_FRAME_STYLE_FLOAT )
@@ -1576,7 +1576,7 @@ void X11SalFrame::updateScreenNumber()
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags )
+void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
{
if( nStyle_ & SAL_FRAME_STYLE_PLUG )
return;
@@ -1622,7 +1622,7 @@ void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHOR
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void X11SalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
if( ! IsOverrideRedirect() )
{
@@ -1803,7 +1803,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState )
{
if( SHOWSTATE_MINIMIZED == nShowState_ )
pState->mnState = SAL_FRAMESTATE_MINIMIZED;
@@ -1842,7 +1842,7 @@ BOOL X11SalFrame::GetWindowState( SalFrameState* pState )
pState->mnMask |= _FRAMESTATE_MASK_MAXIMIZED_GEOMETRY;
}
- return TRUE;
+ return sal_True;
}
// ----------------------------------------------------------------------------
@@ -2161,22 +2161,22 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen )
Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] );
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top());
createNewWindow( None, m_nScreen );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() )
{
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, nNewScreen );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
maGeometry.nScreenNumber = nNewScreen;
}
}
@@ -2210,7 +2210,7 @@ void X11SalFrame::updateWMClass()
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
+void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
{
if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
{
@@ -2228,7 +2228,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
bool bVisible = bMapped_;
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
maGeometry.nX = aRect.Left();
maGeometry.nY = aRect.Top();
maGeometry.nWidth = aRect.GetWidth();
@@ -2241,7 +2241,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
else
GetDisplay()->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show(TRUE);
+ Show(sal_True);
}
else
@@ -2252,14 +2252,14 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
Rectangle aRect = maRestorePosSize;
maRestorePosSize = Rectangle();
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, m_nScreen );
if( !aRect.IsEmpty() )
SetPosSize( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y |
SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
}
else
@@ -2272,12 +2272,12 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen )
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, false );
if( bVisible )
- Show( FALSE );
+ Show( sal_False );
createNewWindow( None, nScreen );
if( mbFullScreen )
pDisplay_->getWMAdaptor()->showFullScreen( this, true );
if( bVisible )
- Show( TRUE );
+ Show( sal_True );
}
if( mbFullScreen == (bool)bFullScreen )
return;
@@ -2362,7 +2362,7 @@ MessageToXAutoLock( Display *p_display, int n_message )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::StartPresentation( BOOL bStart )
+void X11SalFrame::StartPresentation( sal_Bool bStart )
{
I18NStatus::get().show( !bStart, I18NStatus::presentation );
if ( bStart )
@@ -2380,7 +2380,7 @@ void X11SalFrame::StartPresentation( BOOL bStart )
static bool DPMSExtensionAvailable =
#if !defined(SOLARIS) && !defined(AIX)
(DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0);
- static XLIB_BOOL DPMSEnabled = false;
+ static sal_Bool DPMSEnabled = false;
#else
false;
bool DPMSEnabled = false;
@@ -2559,10 +2559,10 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent)
// PostEvent
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalFrame::PostEvent( void *pData )
+sal_Bool X11SalFrame::PostEvent( void *pData )
{
GetDisplay()->SendInternalEvent( this, pData );
- return TRUE;
+ return sal_True;
}
// Title
@@ -2634,7 +2634,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-void X11SalFrame::EndExtTextInput( USHORT nFlags )
+void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
if (mpInputContext != NULL)
mpInputContext->EndExtTextInput( nFlags );
@@ -2642,20 +2642,20 @@ void X11SalFrame::EndExtTextInput( USHORT nFlags )
// -----------------------------------------------------------------------
-XubString X11SalFrame::GetKeyName( USHORT nKeyCode )
+XubString X11SalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
return GetDisplay()->GetKeyName( nKeyCode );
}
-XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
-BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
+sal_Bool X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
{
// not supported yet
- return FALSE;
+ return sal_False;
}
LanguageType X11SalFrame::GetInputLanguage()
@@ -2683,7 +2683,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings )
pIntegrator->GetSystemLook( rSettings );
}
-void X11SalFrame::CaptureMouse( BOOL bCapture )
+void X11SalFrame::CaptureMouse( sal_Bool bCapture )
{
nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL );
}
@@ -2714,7 +2714,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
{
bool bWasVisible = bMapped_;
if( bWasVisible )
- Show( FALSE );
+ Show( sal_False );
if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() )
nScreen = m_nScreen;
@@ -2783,7 +2783,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
}
if( bWasVisible )
- Show( TRUE );
+ Show( sal_True );
std::list< X11SalFrame* > aChildren = maChildren;
for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it )
@@ -2819,9 +2819,9 @@ void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported
// Event Handling
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-static USHORT sal_GetCode( int state )
+static sal_uInt16 sal_GetCode( int state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( state & Button1Mask )
nCode |= MOUSE_LEFT;
@@ -2874,7 +2874,7 @@ SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState()
return aState;
}
-void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
+void X11SalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode);
}
@@ -2882,7 +2882,7 @@ void X11SalFrame::SimulateKeyPress( USHORT nKeyCode )
long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
{
SalMouseEvent aMouseEvt;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
bool bClosePopups = false;
if( nVisibleFloats && pEvent->type == EnterNotify )
@@ -3005,7 +3005,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
}
if( ! bInside )
{
- // need not take care of the XUngrabPointer in Show( FALSE )
+ // need not take care of the XUngrabPointer in Show( sal_False )
// because XUngrabPointer does not produce errors if pointer
// is not grabbed
XUngrabPointer( GetXDisplay(), CurrentTime );
@@ -3089,7 +3089,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
if( pEvent->type == ButtonRelease )
return 0;
- static ULONG nLines = 0;
+ static sal_uLong nLines = 0;
if( ! nLines )
{
char* pEnv = getenv( "SAL_WHEELLINES" );
@@ -3151,14 +3151,14 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
// in the independent part.
struct KeyAlternate
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
sal_Unicode nCharCode;
KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {}
- KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
+ KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {}
};
inline KeyAlternate
-GetAlternateKeyCode( const USHORT nKeyCode )
+GetAlternateKeyCode( const sal_uInt16 nKeyCode )
{
KeyAlternate aAlternate;
@@ -3171,6 +3171,100 @@ GetAlternateKeyCode( const USHORT nKeyCode )
return aAlternate;
}
+void X11SalFrame::beginUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ DeletionListener aDeleteWatch( this );
+
+ if( rSeq.getLength() )
+ endUnicodeSequence();
+
+ rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) );
+
+ if( ! aDeleteWatch.isDeleted() )
+ {
+ sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+}
+
+bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
+{
+ bool bRet = false;
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+ if( rSeq.getLength() > 0 )
+ {
+ // range check
+ if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) ||
+ (c >= sal_Unicode('a') && c <= sal_Unicode('f')) ||
+ (c >= sal_Unicode('A') && c <= sal_Unicode('F')) )
+ {
+ rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 );
+ aBuf.append( rSeq );
+ aBuf.append( c );
+ rSeq = aBuf.makeStringAndClear();
+ std::vector<sal_uInt16> attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE );
+
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rSeq;
+ aEv.mpTextAttr = &attribs[0];
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ bRet = true;
+ }
+ else
+ bRet = endUnicodeSequence();
+ }
+ else
+ endUnicodeSequence();
+ return bRet;
+}
+
+bool X11SalFrame::endUnicodeSequence()
+{
+ rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() );
+
+ DeletionListener aDeleteWatch( this );
+ if( rSeq.getLength() > 1 && rSeq.getLength() < 6 )
+ {
+ // cut the "u"
+ rtl::OUString aNumbers( rSeq.copy( 1 ) );
+ sal_Int32 nValue = aNumbers.toInt32( 16 );
+ if( nValue >= 32 )
+ {
+ sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE;
+ SalExtTextInputEvent aEv;
+ aEv.mnTime = 0;
+ aEv.maText = rtl::OUString( sal_Unicode(nValue) );
+ aEv.mpTextAttr = &nTextAttr;
+ aEv.mnCursorPos = 0;
+ aEv.mnDeltaStart = 0;
+ aEv.mnCursorFlags = 0;
+ aEv.mbOnlyCursor = sal_False;
+ CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv);
+ }
+ }
+ bool bWasInput = rSeq.getLength() > 0;
+ rSeq = rtl::OUString();
+ if( bWasInput && ! aDeleteWatch.isDeleted() )
+ CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL);
+ return bWasInput;
+}
+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
{
@@ -3205,8 +3299,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
}
SalKeyEvent aKeyEvt;
- USHORT nKeyCode;
- USHORT nModCode = 0;
+ sal_uInt16 nKeyCode;
+ sal_uInt16 nModCode = 0;
char aDummy;
if( pEvent->state & ShiftMask )
@@ -3216,6 +3310,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( pEvent->state & Mod1Mask )
nModCode |= KEY_MOD2;
+ if( nModCode != (KEY_SHIFT|KEY_MOD1) )
+ endUnicodeSequence();
+
if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R
|| nKeySym == XK_Control_L || nKeySym == XK_Control_R
|| nKeySym == XK_Alt_L || nKeySym == XK_Alt_R
@@ -3236,8 +3333,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
// the event state does not contain ControlMask. In the release
// event its the other way round: it does contain the Control mask.
// The modifier mode therefore has to be adapted manually.
- USHORT nExtModMask = 0;
- USHORT nModMask = 0;
+ sal_uInt16 nExtModMask = 0;
+ sal_uInt16 nModMask = 0;
switch( nKeySym )
{
case XK_Control_L:
@@ -3320,6 +3417,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( !nKeyCode && !nLen && !nKeyString)
return 0;
+ DeletionListener aDeleteWatch( this );
+
+ if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress )
+ {
+ sal_uInt16 nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy );
+ if( nSeqKeyCode == KEY_U )
+ {
+ beginUnicodeSequence();
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 )
+ {
+ if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) )
+ return 1;
+ }
+ else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F )
+ {
+ if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) )
+ return 1;
+ }
+ else
+ endUnicodeSequence();
+ }
+
+ if( aDeleteWatch.isDeleted() )
+ return 0;
+
rtl_TextEncoding nEncoding;
if (mpInputContext != NULL && mpInputContext->IsMultiLingual() )
@@ -3378,8 +3502,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
nSize = 0;
}
- DeletionListener aDeleteWatch( this );
-
if ( mpInputContext != NULL
&& mpInputContext->UseContext()
&& KeyRelease != pEvent->type
@@ -3474,9 +3596,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if( FocusIn == pEvent->type )
{
-#ifndef _USE_PRINT_EXTENSION_
GetSalData()->m_pInstance->updatePrinterUpdate();
-#endif
mbInputFocus = True;
ImplSVData* pSVData = ImplGetSVData();
@@ -3486,7 +3606,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
if ((mpParent != NULL && nStyle_ == 0)
&& pSVData->maWinData.mpFirstFloat )
{
- ULONG nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
+ sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
pSVData->maWinData.mpFirstFloat->SetPopupModeFlags(
nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE));
}
@@ -3509,7 +3629,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
{
XRectangle aRect = { 0, 0, 0, 0 };
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
if( pEvent->type == Expose )
{
@@ -3738,9 +3858,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
XLIB_Window hWM_Parent;
XLIB_Window hRoot, *Children, hDummy;
unsigned int nChildren;
- BOOL bNone = pDisplay_->GetProperties()
+ sal_Bool bNone = pDisplay_->GetProperties()
& PROPERTY_SUPPORT_WM_Parent_Pixmap_None;
- BOOL bAccessParentWindow = ! (pDisplay_->GetProperties()
+ sal_Bool bAccessParentWindow = ! (pDisplay_->GetProperties()
& PROPERTY_FEATURE_TrustedSolaris);
static const char* pDisableStackingCheck = getenv( "SAL_DISABLE_STACKING_CHECK" );
@@ -3769,8 +3889,8 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
hWM_Parent = GetShellWindow();
break;
}
- /* this sometimes happens if a Show(TRUE) is
- * immediately followed by Show(FALSE) (which is braindead anyway)
+ /* this sometimes happens if a Show(sal_True) is
+ * immediately followed by Show(sal_False) (which is braindead anyway)
*/
if( hDummy == hWM_Parent )
hDummy = hRoot;
@@ -4116,7 +4236,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
if( -1 == nCaptured_ )
{
- CaptureMouse( TRUE );
+ CaptureMouse( sal_True );
#ifdef DBG_UTIL
if( -1 != nCaptured_ )
pDisplay_->PrintEvent( "Captured", pEvent );
@@ -4187,9 +4307,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
XUnmapWindow( GetXDisplay(), GetShellWindow() );
break;
}
- bMapped_ = TRUE;
- bViewable_ = TRUE;
- nRet = TRUE;
+ bMapped_ = sal_True;
+ bViewable_ = sal_True;
+ nRet = sal_True;
if ( mpInputContext != NULL )
mpInputContext->Map( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4277,7 +4397,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
RestackChildren();
- mbInShow = FALSE;
+ mbInShow = sal_False;
m_bSetFocusOnMap = false;
}
break;
@@ -4285,9 +4405,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case UnmapNotify:
if( pEvent->xunmap.window == GetShellWindow() )
{
- bMapped_ = FALSE;
- bViewable_ = FALSE;
- nRet = TRUE;
+ bMapped_ = sal_False;
+ bViewable_ = sal_False;
+ nRet = sal_True;
if ( mpInputContext != NULL )
mpInputContext->Unmap( this );
CallCallback( SALEVENT_RESIZE, NULL );
@@ -4302,7 +4422,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
case VisibilityNotify:
nVisibility_ = pEvent->xvisibility.state;
- nRet = TRUE;
+ nRet = sal_True;
if( bAlwaysOnTop_
&& bMapped_
&& ! GetDisplay()->getWMAdaptor()->isAlwaysOnTopOK()
@@ -4401,7 +4521,7 @@ void X11SalFrame::ResetClipRegion()
op, ordering );
}
-void X11SalFrame::BeginSetClipRegion( ULONG nRects )
+void X11SalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( m_pClipRectangles )
delete [] m_pClipRectangles;
diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx
deleted file mode 100644
index a5622a48ba70..000000000000
--- a/vcl/unx/source/window/salmenu.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// X11SalInst factory methods
-
-SalMenu* X11SalInstance::CreateMenu( BOOL /*bMenuBar*/ )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
- delete pSalMenu;
-}
-
-
-SalMenuItem* X11SalInstance::CreateMenuItem( const SalItemParams* )
-{
- return NULL; // no support for native menues
-}
-
-void X11SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
- delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * X11SalMenu
- */
-
-
-X11SalMenu::~X11SalMenu()
-{
-}
-
-BOOL X11SalMenu::VisibleMenuBar()
-{
- return FALSE;
-}
-
-void X11SalMenu::SetFrame( const SalFrame* )
-{
-}
-
-void X11SalMenu::InsertItem( SalMenuItem*, unsigned )
-{
-}
-
-void X11SalMenu::RemoveItem( unsigned )
-{
-}
-
-void X11SalMenu::SetSubMenu( SalMenuItem*, SalMenu*, unsigned )
-{
-}
-
-void X11SalMenu::CheckItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::EnableItem( unsigned, BOOL )
-{
-}
-
-void X11SalMenu::SetItemImage( unsigned, SalMenuItem*, const Image& )
-{
-}
-
-void X11SalMenu::SetItemText( unsigned, SalMenuItem*, const XubString& )
-{
-}
-
-void X11SalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const XubString& )
-{
-}
-
-void X11SalMenu::GetSystemMenuData( SystemMenuData* )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-X11SalMenuItem::~X11SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx
index 6704077b1ec4..07cbcf115d5e 100644
--- a/vcl/unx/source/window/salobj.cxx
+++ b/vcl/unx/source/window/salobj.cxx
@@ -52,12 +52,12 @@
// =======================================================================
// SalInstance member to create and destroy a SalObject
-SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+SalObject* X11SalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
return X11SalObject::CreateObject( pParent, pWindowData, bShow );
}
-X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow )
+X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow )
{
int error_base, event_base;
X11SalObject* pObject = new X11SalObject();
@@ -149,7 +149,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pVisual,
CWEventMask|CWColormap, &aAttribs );
XSync( pDisp, False );
- BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -176,7 +176,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
pObjData->pAppContext = NULL;
XSync(pDisp, False);
- BOOL bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
+ sal_Bool bWasXError = pSalDisp->GetXLib()->HasXErrorOccurred();
pSalDisp->GetXLib()->PopXErrorLevel();
if( bWasXError )
{
@@ -216,7 +216,7 @@ SalClipRegion::~SalClipRegion()
void
-SalClipRegion::BeginSetClipRegion( ULONG nRects )
+SalClipRegion::BeginSetClipRegion( sal_uLong nRects )
{
if (ClipRectangleList)
delete [] ClipRectangleList;
@@ -321,7 +321,7 @@ X11SalObject::ResetClipRegion()
void
-X11SalObject::BeginSetClipRegion( ULONG nRectCount )
+X11SalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
maClipRegion.BeginSetClipRegion ( nRectCount );
}
@@ -372,7 +372,7 @@ X11SalObject::EndSetClipRegion()
}
-USHORT
+sal_uInt16
X11SalObject::GetClipRegionType()
{
return maClipRegion.GetClipRegionType();
@@ -396,7 +396,7 @@ X11SalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
void
-X11SalObject::Show( BOOL bVisible )
+X11SalObject::Show( sal_Bool bVisible )
{
if ( ! maSystemChildData.aWindow )
return;
@@ -417,7 +417,7 @@ X11SalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void X11SalObject::Enable( BOOL )
+void X11SalObject::Enable( sal_Bool )
{
}
@@ -451,9 +451,9 @@ const SystemChildData* X11SalObject::GetSystemData() const
return &maSystemChildData;
}
-static USHORT sal_GetCode( int state )
+static sal_uInt16 sal_GetCode( int state )
{
- USHORT nCode = 0;
+ sal_uInt16 nCode = 0;
if( state & Button1Mask )
nCode |= MOUSE_LEFT;
@@ -509,7 +509,7 @@ long X11SalObject::Dispatch( XEvent* pEvent )
aEvt.mnTime = pEvent->xbutton.time;
aEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
aEvt.mnButton = 0;
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
if( pEvent->type == ButtonPress ||
pEvent->type == ButtonRelease )
{
@@ -534,10 +534,10 @@ long X11SalObject::Dispatch( XEvent* pEvent )
switch( pEvent->type )
{
case UnmapNotify:
- pObject->mbVisible = FALSE;
+ pObject->mbVisible = sal_False;
return 1;
case MapNotify:
- pObject->mbVisible = TRUE;
+ pObject->mbVisible = sal_True;
return 1;
case ButtonPress:
pObject->CallCallback( SALOBJ_EVENT_TOTOP, NULL );
@@ -557,4 +557,10 @@ long X11SalObject::Dispatch( XEvent* pEvent )
return 0;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index a67095f90188..713d28a43846 100755
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -125,7 +125,6 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \
$(INC)$/vcl$/virdev.hxx \
$(INC)$/vcl$/wall.hxx \
$(INC)$/vcl$/waitobj.hxx \
- $(INC)$/vcl$/wintypes.hxx \
$(INC)$/vcl$/window.hxx \
$(INC)$/vcl$/wrkwin.hxx
@@ -306,7 +305,7 @@ SHL2STDLIBS=\
# prepare linking of Xinerama
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(OS)"=="MACOSX"
+.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX"
XINERAMALIBS=-lXinerama
.ELSE
.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg"
@@ -391,6 +390,9 @@ SHL4STDLIBS+= $(XRANDR_LIBS)
.IF "$(ENABLE_KDE)" != ""
.IF "$(KDE_ROOT)"!=""
EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
+.ENDIF
.ENDIF
LIB5TARGET=$(SLB)$/ikde_plug_
LIB5FILES=$(SLB)$/kdeplug.lib
@@ -452,3 +454,16 @@ SHL6STDLIBS+=$(KDE4_LIBS) $(KDE_GLIB_LIBS)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/vcl.component
+
+.IF "$(OS)" == "MACOSX"
+my_platform = .macosx
+.ELIF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vcl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component
diff --git a/vcl/util/target.pmk b/vcl/util/target.pmk
index 3144acc4bc05..8ec15475bc90 100644
--- a/vcl/util/target.pmk
+++ b/vcl/util/target.pmk
@@ -37,8 +37,3 @@ ONLYDLL .SETDIR=$(PRJ)$/util: $(SLOFILES)
dmake debug=t prjpch=t linkinc=t compinc=t ..$/$(OUTPATH)$/bin$/sv$(DLLPOSTFIX).dll
@echo "READY"
-.IF "$(USE_XPRINT)"!="TRUE"
-.ELSE
-CFLAGS+=-D_USE_PRINT_EXTENSION_=1
-.ENDIF
-
diff --git a/vcl/util/vcl.component b/vcl/util/vcl.component
new file mode 100644
index 000000000000..da20fc916c32
--- /dev/null
+++ b/vcl/util/vcl.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.X11ClipboardSupport">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndDropTarget">
+ <service name="com.sun.star.datatransfer.dnd.X11DropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.dnd.XdndSupport">
+ <service name="com.sun.star.datatransfer.dnd.X11DragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.macosx.component b/vcl/util/vcl.macosx.component
new file mode 100644
index 000000000000..3aabcd8c7050
--- /dev/null
+++ b/vcl/util/vcl.macosx.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDragSource_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDragSource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1">
+ <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/>
+ </implementation>
+ <implementation name="com.sun.star.datatransfer.clipboard.AquaClipboard">
+ <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
+ </implementation>
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/util/vcl.windows.component b/vcl/util/vcl.windows.component
new file mode 100644
index 000000000000..72f7ace9f251
--- /dev/null
+++ b/vcl/util/vcl.windows.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.frame.VCLSessionManagerClient">
+ <service name="com.sun.star.frame.SessionManagerClient"/>
+ </implementation>
+ <implementation name="vcl::DisplayAccess">
+ <service name="com.sun.star.awt.DisplayAccess"/>
+ </implementation>
+ <implementation name="vcl::FontIdentificator">
+ <service name="com.sun.star.awt.FontIdentificator"/>
+ </implementation>
+</component>
diff --git a/vcl/win/inc/salbmp.h b/vcl/win/inc/salbmp.h
index 466dadce0c46..9ae4b4bef2ca 100644
--- a/vcl/win/inc/salbmp.h
+++ b/vcl/win/inc/salbmp.h
@@ -50,16 +50,16 @@ private:
Size maSize;
HGLOBAL mhDIB;
HBITMAP mhDDB;
- USHORT mnBitCount;
+ sal_uInt16 mnBitCount;
public:
HGLOBAL ImplGethDIB() const { return mhDIB; }
HBITMAP ImplGethDDB() const { return mhDDB; }
- static HGLOBAL ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ static HGLOBAL ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
- static USHORT ImplGetDIBColorCount( HGLOBAL hDIB );
+ static sal_uInt16 ImplGetDIBColorCount( HGLOBAL hDIB );
static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
const Size& rSizePixel, bool bRLE4 );
@@ -71,10 +71,10 @@ public:
public:
bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
- virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
+ virtual bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
virtual bool Create( const SalBitmap& rSalBmpImpl );
virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
- virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
+ virtual bool Create( const SalBitmap& rSalBmpImpl, sal_uInt16 nNewBitCount );
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
@@ -82,7 +82,7 @@ public:
virtual void Destroy();
virtual Size GetSize() const { return maSize; }
- virtual USHORT GetBitCount() const { return mnBitCount; }
+ virtual sal_uInt16 GetBitCount() const { return mnBitCount; }
virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index 4c87484a5398..95aa8f5434f2 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -34,6 +34,8 @@
#include <vcl/salwtype.hxx>
#include <wincomp.hxx>
+#include "osl/module.h"
+
#include <set> // for hMenu validation
#include <map>
@@ -47,6 +49,8 @@ class Font;
struct HDCCache;
struct TempFontItem;
+typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(BOOL*);
+
// --------------------
// - Standard-Defines -
// --------------------
@@ -85,7 +89,7 @@ public:
void initKeyCodeMap();
// checks if the menuhandle was created by VCL
- BOOL IsKnownMenuHandle( HMENU hMenu );
+ sal_Bool IsKnownMenuHandle( HMENU hMenu );
public:
HINSTANCE mhInst; // default instance handle
@@ -98,12 +102,12 @@ public:
long* mpDitherDiff; // Dither mapping table
BYTE* mpDitherLow; // Dither mapping table
BYTE* mpDitherHigh; // Dither mapping table
- ULONG mnTimerMS; // Current Time (in MS) of the Timer
- ULONG mnTimerOrgMS; // Current Original Time (in MS)
+ sal_uLong mnTimerMS; // Current Time (in MS) of the Timer
+ sal_uLong mnTimerOrgMS; // Current Original Time (in MS)
DWORD mnNextTimerTime;
DWORD mnLastEventTime;
UINT mnTimerId; // windows timer id
- BOOL mbInTimerProc; // timer event is currently being dispatched
+ sal_Bool mbInTimerProc; // timer event is currently being dispatched
HHOOK mhSalObjMsgHook; // hook to get interesting msg for SalObject
HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message
AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test
@@ -119,25 +123,28 @@ public:
COLORREF maStockBrushColorAry[MAX_STOCKBRUSH];
HPEN mhStockPenAry[MAX_STOCKPEN];
HBRUSH mhStockBrushAry[MAX_STOCKBRUSH];
- USHORT mnStockPenCount; // count of static pens
- USHORT mnStockBrushCount; // count of static brushes
+ sal_uInt16 mnStockPenCount; // count of static pens
+ sal_uInt16 mnStockBrushCount; // count of static brushes
WPARAM mnSalObjWantKeyEvt; // KeyEvent, welcher vom SalObj-Hook verarbeitet werden soll
BYTE mnCacheDCInUse; // count of CacheDC in use
- BOOL mbObjClassInit; // is SALOBJECTCLASS initialised
- BOOL mbInPalChange; // is in WM_QUERYNEWPALETTE
+ sal_Bool mbObjClassInit; // is SALOBJECTCLASS initialised
+ sal_Bool mbInPalChange; // is in WM_QUERYNEWPALETTE
DWORD mnAppThreadId; // Id from Applikation-Thread
- WIN_BOOL mbScrSvrEnabled; // ScreenSaver enabled
+ BOOL mbScrSvrEnabled; // ScreenSaver enabled
int mnSageStatus; // status of Sage-DLL (DISABLE_AGENT == nicht vorhanden)
SysAgt_Enable_PROC mpSageEnableProc; // funktion to deactivate the system agent
SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none
TempFontItem* mpTempFontItem;
- BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ sal_Bool mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ sal_Bool mbThemeMenuSupport;
// for GdiPlus GdiplusStartup/GdiplusShutdown
ULONG_PTR gdiplusToken;
std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle()
- std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries
+ std::map< UINT,sal_uInt16 > maVKMap; // map some dynamic VK_* entries
+ oslModule maDwmLib;
+ DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
};
inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
@@ -154,8 +161,8 @@ struct SalShlData
UINT mnWheelScrollLines; // WheelScrollLines
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
- WIN_BOOL mbWXP; // Windows XP
- WIN_BOOL mbWPrinter; // true: use unicode printer functions
+ BOOL mbWXP; // Windows XP
+ BOOL mbWPrinter; // true: use unicode printer functions
// false: use anis compat printer functions
OSVERSIONINFO maVersionInfo;
};
@@ -182,8 +189,8 @@ struct HDCCache
};
void ImplClearHDCCache( SalData* pData );
-HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp = 0 );
-void ImplReleaseCachedDC( ULONG nID );
+HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp = 0 );
+void ImplReleaseCachedDC( sal_uLong nID );
bool ImplAddTempFont( SalData&, const String& rFontFileURL );
void ImplReleaseTempFonts( SalData& );
@@ -194,7 +201,7 @@ void ImplReleaseTempFonts( SalData& );
HCURSOR ImplLoadSalCursor( int nId );
HBITMAP ImplLoadSalBitmap( int nId );
-BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
+sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon );
// SALGDI.CXX
void ImplInitSalGDI();
@@ -206,11 +213,12 @@ void ImplFreeSalGDI();
// \\WIN\SOURCE\APP\SALINST.CXX
void ImplSalYieldMutexAcquireWithWait();
-BOOL ImplSalYieldMutexTryToAcquire();
+sal_Bool ImplSalYieldMutexTryToAcquire();
void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
-ULONG ImplSalReleaseYieldMutex();
-void ImplSalAcquireYieldMutex( ULONG nCount );
+sal_uLong ImplSalReleaseYieldMutex();
+void ImplSalAcquireYieldMutex( sal_uLong nCount );
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg );
// \\WIN\SOURCE\WINDOW\SALFRAME.CXX
LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
@@ -221,16 +229,16 @@ void CALLBACK SalTimerProc( HWND hWnd, UINT nMsg, UINT_PTR nId, DWORD nTime )
// \WIN\SOURCE\WINDOW\SALFRAME.CXX
void SalTestMouseLeave();
-BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall );
+sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall );
// \WIN\SOURCE\WINDOW\SALFRAME.CXX
long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam );
-BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
+sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult );
// \WIN\SOURCE\WINDOW\SALOBJ.CXX
WinSalObject* ImplFindSalObject( HWND hWndChild );
-BOOL ImplSalPreDispatchMsg( MSG* pMsg );
+sal_Bool ImplSalPreDispatchMsg( MSG* pMsg );
void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
// \WIN\SOURCE\GDI\SALGDI3.CXX
@@ -240,7 +248,7 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName );
// \WIN\SOURCE\APP\SALDATA.CXX
rtl_TextEncoding ImplSalGetSystemEncoding();
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName = FALSE );
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName = FALSE );
UniString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen = STRING_LEN );
int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
@@ -339,10 +347,10 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
// -----------------
// A/W-Wrapper
-WIN_BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
-WIN_BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
-WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax );
-WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg );
+BOOL ImplPostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
+BOOL ImplSendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
+BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax );
+BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg );
LONG ImplDispatchMessage( CONST MSG *lpMsg );
inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis )
diff --git a/vcl/win/inc/salframe.h b/vcl/win/inc/salframe.h
index 49a1b50c14e2..d3e7516f17f3 100644
--- a/vcl/win/inc/salframe.h
+++ b/vcl/win/inc/salframe.h
@@ -63,33 +63,33 @@ public:
int mnFullScreenShowState; // fullscreen restore show state
UINT mnInputLang; // current Input Language
UINT mnInputCodePage; // current Input CodePage
- ULONG mnStyle; // style
- BOOL mbGraphics; // is Graphics used
- BOOL mbCaption; // has window a caption
- BOOL mbBorder; // has window a border
- BOOL mbFixBorder; // has window a fixed border
- BOOL mbSizeBorder; // has window a sizeable border
- BOOL mbNoIcon; // is an window without an icon
- BOOL mbFloatWin; // is a FloatingWindow
- BOOL mbFullScreen; // TRUE: in full screen mode
- BOOL mbPresentation; // TRUE: Presentation Mode running
- BOOL mbInShow; // innerhalb eines Show-Aufrufs
- BOOL mbRestoreMaximize; // Restore-Maximize
- BOOL mbInMoveMsg; // Move-Message wird verarbeitet
- BOOL mbInSizeMsg; // Size-Message wird verarbeitet
- BOOL mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode
- BOOL mbDefPos; // default-position
- BOOL mbOverwriteState; // TRUE: WindowState darf umgesetzt werden
- BOOL mbIME; // TRUE: We are in IME Mode
- BOOL mbHandleIME; // TRUE: Wir handeln die IME-Messages
- BOOL mbSpezIME; // TRUE: Spez IME
- BOOL mbAtCursorIME; // TRUE: Wir behandeln nur einige IME-Messages
- BOOL mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
- static BOOL mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
+ sal_uIntPtr mnStyle; // style
+ sal_Bool mbGraphics; // is Graphics used
+ sal_Bool mbCaption; // has window a caption
+ sal_Bool mbBorder; // has window a border
+ sal_Bool mbFixBorder; // has window a fixed border
+ sal_Bool mbSizeBorder; // has window a sizeable border
+ sal_Bool mbNoIcon; // is an window without an icon
+ sal_Bool mbFloatWin; // is a FloatingWindow
+ sal_Bool mbFullScreen; // TRUE: in full screen mode
+ sal_Bool mbPresentation; // TRUE: Presentation Mode running
+ sal_Bool mbInShow; // innerhalb eines Show-Aufrufs
+ sal_Bool mbRestoreMaximize; // Restore-Maximize
+ sal_Bool mbInMoveMsg; // Move-Message wird verarbeitet
+ sal_Bool mbInSizeMsg; // Size-Message wird verarbeitet
+ sal_Bool mbFullScreenToolWin; // WS_EX_TOOLWINDOW reset in FullScreenMode
+ sal_Bool mbDefPos; // default-position
+ sal_Bool mbOverwriteState; // TRUE: WindowState darf umgesetzt werden
+ sal_Bool mbIME; // TRUE: We are in IME Mode
+ sal_Bool mbHandleIME; // TRUE: Wir handeln die IME-Messages
+ sal_Bool mbSpezIME; // TRUE: Spez IME
+ sal_Bool mbAtCursorIME; // TRUE: Wir behandeln nur einige IME-Messages
+ sal_Bool mbCandidateMode; // TRUE: Wir befinden uns im Candidate-Modus
+ static sal_Bool mbInReparent; // TRUE: ignore focus lost and gain due to reparenting
RGNDATA* mpClipRgnData;
RECT* mpNextClipRect;
- BOOL mbFirstClipRect;
+ sal_Bool mbFirstClipRect;
sal_Int32 mnDisplay; // Display used for Fullscreen, 0 is primary monitor
void updateScreenNumber();
@@ -99,37 +99,37 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL PostEvent( void* pData );
+ virtual sal_Bool PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
- virtual void SetIcon( USHORT nIcon );
+ virtual void SetIcon( sal_uInt16 nIcon );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle );
- virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
- virtual void Enable( BOOL bEnable );
+ virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = FALSE );
+ virtual void Enable( sal_Bool bEnable );
virtual void SetMinClientSize( long nWidth, long nHeight );
virtual void SetMaxClientSize( long nWidth, long nHeight );
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
- virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay );
- virtual void StartPresentation( BOOL bStart );
- virtual void SetAlwaysOnTop( BOOL bOnTop );
- virtual void ToTop( USHORT nFlags );
+ virtual sal_Bool GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+ virtual void StartPresentation( sal_Bool bStart );
+ virtual void SetAlwaysOnTop( sal_Bool bOnTop );
+ virtual void ToTop( sal_uInt16 nFlags );
virtual void SetPointer( PointerStyle ePointerStyle );
- virtual void CaptureMouse( BOOL bMouse );
+ virtual void CaptureMouse( sal_Bool bMouse );
virtual void SetPointerPos( long nX, long nY );
using SalFrame::Flush;
virtual void Flush();
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
- virtual void EndExtTextInput( USHORT nFlags );
- virtual String GetKeyName( USHORT nKeyCode );
- virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
- virtual BOOL MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
+ virtual void EndExtTextInput( sal_uInt16 nFlags );
+ virtual String GetKeyName( sal_uInt16 nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode );
+ virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode );
virtual LanguageType GetInputLanguage();
virtual SalBitmap* SnapShot();
virtual void UpdateSettings( AllSettings& rSettings );
@@ -137,14 +137,14 @@ public:
virtual const SystemEnvData* GetSystemData() const;
virtual SalPointerState GetPointerState();
virtual SalIndicatorState GetIndicatorState();
- virtual void SimulateKeyPress( USHORT nKeyCode );
+ virtual void SimulateKeyPress( sal_uInt16 nKeyCode );
virtual void SetParent( SalFrame* pNewParent );
virtual bool SetPluginParent( SystemParentData* pNewParent );
virtual void SetBackgroundBitmap( SalBitmap* );
virtual void SetScreenNumber( unsigned int );
virtual void SetApplicationID( const rtl::OUString &rApplicationID );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
};
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 951e0c8d7690..a23963f81e7b 100644
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -83,10 +83,10 @@ private:
class ImplWinFontData : public ImplFontData
{
public:
- ImplWinFontData( const ImplDevFontAttributes&,
- int nFontHeight, WIN_BYTE eWinCharSet,
- WIN_BYTE nPitchAndFamily );
- ~ImplWinFontData();
+ explicit ImplWinFontData( const ImplDevFontAttributes&,
+ int nFontHeight, BYTE eWinCharSet,
+ BYTE nPitchAndFamily );
+ virtual ~ImplWinFontData();
virtual ImplFontData* Clone() const;
virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
@@ -96,8 +96,8 @@ public:
bool HasChar( sal_uInt32 cChar ) const;
- WIN_BYTE GetCharSet() const { return meWinCharSet; }
- WIN_BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
+ BYTE GetCharSet() const { return meWinCharSet; }
+ BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; }
bool SupportsKorean() const { return mbHasKoreanRange; }
bool SupportsCJK() const { return mbHasCJKSupport; }
@@ -109,7 +109,7 @@ public:
const gr_face* GraphiteFace() const;
#endif
- ImplFontCharMap* GetImplFontCharMap() const;
+ const ImplFontCharMap* GetImplFontCharMap() const;
bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
@@ -138,8 +138,8 @@ private:
// TODO: get rid of the members below needed to work with the Win9x non-unicode API
BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning)
BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried
- WIN_BYTE meWinCharSet;
- WIN_BYTE mnPitchAndFamily;
+ BYTE meWinCharSet;
+ BYTE mnPitchAndFamily;
bool mbAliasSymbolsHigh;
bool mbAliasSymbolsLow;
private:
@@ -158,9 +158,9 @@ public:
#endif // GNG_VERT_HACK
};
-// -------------------
-// - SalGraphicsData -
-// -------------------
+// ------------------
+// - WinSalGraphics -
+// ------------------
class WinSalGraphics : public SalGraphics
{
@@ -184,24 +184,22 @@ public:
COLORREF mnTextColor; // TextColor
RGNDATA* mpClipRgnData; // ClipRegion-Data
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
- RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- BOOL mbFirstClipRect; // Flag for first cliprect to insert
LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x)
ImplFontAttrCache* mpFontAttrCache; // Cache font attributes from files in so/share/fonts
BYTE* mpFontCharSets; // All Charsets for the current font
BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried
- BOOL mbFontKernInit; // FALSE: FontKerns must be queried
+ sal_Bool mbFontKernInit; // FALSE: FontKerns must be queried
KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font
- ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font
+ sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font
int mnPenWidth; // Linienbreite
- BOOL mbStockPen; // is Pen a stockpen
- BOOL mbStockBrush; // is Brush a stcokbrush
- BOOL mbPen; // is Pen (FALSE == NULL_PEN)
- BOOL mbBrush; // is Brush (FALSE == NULL_BRUSH)
- BOOL mbPrinter; // is Printer
- BOOL mbVirDev; // is VirDev
- BOOL mbWindow; // is Window
- BOOL mbScreen; // is Screen compatible
+ sal_Bool mbStockPen; // is Pen a stockpen
+ sal_Bool mbStockBrush; // is Brush a stcokbrush
+ sal_Bool mbPen; // is Pen (FALSE == NULL_PEN)
+ sal_Bool mbBrush; // is Brush (FALSE == NULL_BRUSH)
+ sal_Bool mbPrinter; // is Printer
+ sal_Bool mbVirDev; // is VirDev
+ sal_Bool mbWindow; // is Window
+ sal_Bool mbScreen; // is Screen compatible
bool mbXORMode; // _every_ output with RasterOp XOR
// remember RGB values for SetLineColor/SetFillColor
@@ -211,29 +209,28 @@ public:
HFONT ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFontScale, HFONT& o_rOldFont );
public:
- WinSalGraphics();
+ explicit WinSalGraphics();
virtual ~WinSalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry );
+ virtual void drawPolyLine( sal_uIntPtr nPoints, const SalPoint* pPtAry );
+ virtual void drawPolygon( sal_uIntPtr nPoints, const SalPoint* pPtAry );
virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry );
virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
- virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
- virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry );
+ virtual sal_Bool drawPolyLineBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
+ virtual sal_Bool drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, USHORT nFlags );
+ long nSrcHeight, sal_uInt16 nFlags );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -254,20 +251,20 @@ protected:
// invert --> ClipRegion (only Windows or VirDevs)
virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nFlags );
+ virtual void invert( sal_uIntPtr nPoints, const SalPoint* pPtAry, SalInvert nFlags );
- virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
+ virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uIntPtr nSize );
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ const Point& aPos, sal_Bool& rIsInside );
+ virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+ virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
+ virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
@@ -282,17 +279,12 @@ public:
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
// get the depth of the device
- virtual USHORT GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
// get the width of the device
virtual long GetGraphicsWidth() const;
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
@@ -312,14 +304,14 @@ public:
// set the text color to a specific color
virtual void SetTextColor( SalColor nSalColor );
// set the font
- virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+ virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
// get the repertoire of the current font
- virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual const ImplFontCharMap* GetImplFontCharMap() const;
// get the layout capabilities of the current font
virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const;
// graphics must fill supplied font list
@@ -340,7 +332,7 @@ public:
// rInfo: additional outgoing information
// implementation note: encoding 0 with glyph id 0 should be added implicitly
// as "undefined character"
- virtual BOOL CreateFontSubset( const rtl::OUString& rToFile,
+ virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
long* pGlyphIDs,
sal_uInt8* pEncoding,
@@ -378,33 +370,33 @@ public:
Ucs2UIntMap& rUnicodeEnc );
virtual int GetMinKashidaWidth();
- virtual BOOL GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual BOOL GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
+ virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
// Query the platform layer for control support
- virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
+ virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
// Init/Deinit Graphics
-void ImplSalInitGraphics( WinSalGraphics* mpData );
-void ImplSalDeInitGraphics( WinSalGraphics* mpData );
+void ImplSalInitGraphics( WinSalGraphics* );
+void ImplSalDeInitGraphics( WinSalGraphics* );
void ImplUpdateSysColorEntries();
int ImplIsSysColorEntry( SalColor nSalColor );
-void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*,
+void ImplGetLogFontFromFontSelect( HDC, const ImplFontSelectData*,
LOGFONTW&, bool bTestVerticalAvail );
// -----------
// - Defines -
// -----------
-#define MAX_64KSALPOINTS ((((USHORT)0xFFFF)-8)/sizeof(POINTS))
+#define MAX_64KSALPOINTS ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
// -----------
// - Inlines -
@@ -431,6 +423,8 @@ inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const
cChar -= 0xF000;
else if( mbAliasSymbolsHigh && (cChar <= 0xFF) )
cChar += 0xF000;
+ else
+ return false;
return mpUnicodeMap->HasChar( cChar );
}
diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h
index 3b8c32708789..524cf3aca141 100644
--- a/vcl/win/inc/salinst.h
+++ b/vcl/win/inc/salinst.h
@@ -45,19 +45,19 @@ public:
HWND mhComWnd; // window, for communication (between threads and the main thread)
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
osl::Mutex* mpSalWaitMutex; // Sal-Wait-Mutex
- USHORT mnYieldWaitCount; // Wait-Count
+ sal_uInt16 mnYieldWaitCount; // Wait-Count
public:
WinSalInstance();
virtual ~WinSalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
- virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, BOOL bShow = TRUE );
+ virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
virtual void DestroyObject( SalObject* pObject );
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
long nDX, long nDY,
- USHORT nBitCount, const SystemGraphicsData *pData );
+ sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
@@ -74,13 +74,15 @@ public:
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
virtual osl::SolarMutex* GetYieldMutex();
- virtual ULONG ReleaseYieldMutex();
- virtual void AcquireYieldMutex( ULONG nCount );
+ virtual sal_uIntPtr ReleaseYieldMutex();
+ virtual void AcquireYieldMutex( sal_uIntPtr nCount );
+ virtual bool CheckYieldMutex();
+
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
- virtual bool AnyInput( USHORT nType );
- virtual SalMenu* CreateMenu( BOOL bMenuBar );
+ virtual bool AnyInput( sal_uInt16 nType );
+ virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* );
virtual void DestroyMenu( SalMenu* );
- virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData );
virtual void DestroyMenuItem( SalMenuItem* );
virtual SalSession* CreateSalSession();
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
@@ -93,10 +95,10 @@ public:
// - Prototypen -
// --------------
-SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
+SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, sal_uIntPtr nSalFrameStyle );
SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent );
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild );
-void ImplSalStartTimer( ULONG nMS, BOOL bMutex = FALSE );
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild );
+void ImplSalStartTimer( sal_uIntPtr nMS, sal_Bool bMutex = sal_False );
void ImplSalPrinterAbortJobAsync( HDC hPrnDC );
#endif // _SV_SALINST_H
diff --git a/vcl/win/inc/salmenu.h b/vcl/win/inc/salmenu.h
index 5e821837101f..59160dc8a8bc 100644
--- a/vcl/win/inc/salmenu.h
+++ b/vcl/win/inc/salmenu.h
@@ -39,22 +39,22 @@ class WinSalMenu : public SalMenu
public:
WinSalMenu();
virtual ~WinSalMenu();
- virtual BOOL VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
virtual void RemoveItem( unsigned nPos );
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
virtual void SetFrame( const SalFrame* pFrame );
- virtual void CheckItem( unsigned nPos, BOOL bCheck );
- virtual void EnableItem( unsigned nPos, BOOL bEnable );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage );
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
virtual void GetSystemMenuData( SystemMenuData* pData );
HMENU mhMenu; // the menu handle
- BOOL mbMenuBar; // true for menu bars
+ sal_Bool mbMenuBar; // true for menu bars
HWND mhWnd; // the window handle where the menubar is attached, may be NULL
WinSalMenu *mpParentMenu; // the parent menu
};
diff --git a/vcl/win/inc/salobj.h b/vcl/win/inc/salobj.h
index 31fb8769b959..d96b5f4a93df 100644
--- a/vcl/win/inc/salobj.h
+++ b/vcl/win/inc/salobj.h
@@ -46,7 +46,8 @@ public:
RGNDATA* mpClipRgnData; // ClipRegion-Data
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- BOOL mbFirstClipRect; // Flag for first cliprect to insert
+ sal_Bool mbFirstClipRect; // Flag for first cliprect to insert
+ sal_Bool mbInterceptChildWindowKeyDown; // Intercept the KeyDown event sent to system child window
WinSalObject* mpNextObject; // pointer to next object
@@ -54,17 +55,18 @@ public:
virtual ~WinSalObject();
virtual void ResetClipRegion();
- virtual USHORT GetClipRegionType();
- virtual void BeginSetClipRegion( ULONG nRects );
+ virtual sal_uInt16 GetClipRegionType();
+ virtual void BeginSetClipRegion( sal_uIntPtr nRects );
virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual void EndSetClipRegion();
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight );
- virtual void Show( BOOL bVisible );
- virtual void Enable( BOOL nEnable );
+ virtual void Show( sal_Bool bVisible );
+ virtual void Enable( sal_Bool nEnable );
virtual void GrabFocus();
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/win/inc/salprn.h b/vcl/win/inc/salprn.h
index 55b421a9cba9..123af2f79a90 100644
--- a/vcl/win/inc/salprn.h
+++ b/vcl/win/inc/salprn.h
@@ -37,7 +37,7 @@
// -----------------
// WNT3
-#define SAL_DRIVERDATA_SYSSIGN ((ULONG)0x574E5433)
+#define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433)
#define SAL_DRIVERDATA_VERSION_A 1
#define SAL_DRIVERDATA_VERSION_W 2
@@ -45,9 +45,9 @@
struct SalDriverData
{
- ULONG mnSysSignature;
- USHORT mnVersion;
- USHORT mnDriverOffset;
+ sal_uIntPtr mnSysSignature;
+ sal_uInt16 mnVersion;
+ sal_uInt16 mnDriverOffset;
BYTE maDriverData[1];
};
@@ -67,23 +67,23 @@ public:
XubString maDeviceName; // printer device name
XubString maPortName; // printer port name
HDC mhDC; // printer hdc
- BOOL mbGraphics; // is Graphics used
+ sal_Bool mbGraphics; // is Graphics used
public:
WinSalInfoPrinter();
virtual ~WinSalInfoPrinter();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
- virtual BOOL SetPrinterData( ImplJobSetup* pSetupData );
- virtual BOOL SetData( ULONG nFlags, ImplJobSetup* pSetupData );
+ virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData );
+ virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData );
+ virtual sal_Bool SetData( sal_uIntPtr nFlags, ImplJobSetup* pSetupData );
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
long& rOutWidth, long& rOutHeight,
long& rPageOffX, long& rPageOffY,
long& rPageWidth, long& rPageHeight );
- virtual ULONG GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType );
- virtual ULONG GetPaperBinCount( const ImplJobSetup* pSetupData );
- virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
+ virtual sal_uIntPtr GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType );
+ virtual sal_uIntPtr GetPaperBinCount( const ImplJobSetup* pSetupData );
+ virtual String GetPaperBinName( const ImplJobSetup* pSetupData, sal_uIntPtr nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
@@ -99,10 +99,10 @@ public:
WinSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter
WinSalPrinter* mpNextPrinter; // next printing printer
HDC mhDC; // printer hdc
- ULONG mnError; // Error Code
- ULONG mnCopies; // Kopien
- BOOL mbCollate; // Sortierte Kopien
- BOOL mbAbort; // Job Aborted
+ sal_uIntPtr mnError; // Error Code
+ sal_uIntPtr mnCopies; // Kopien
+ sal_Bool mbCollate; // Sortierte Kopien
+ sal_Bool mbAbort; // Job Aborted
bool mbValid;
@@ -111,18 +111,18 @@ public:
virtual ~WinSalPrinter();
using SalPrinter::StartJob;
- virtual BOOL StartJob( const XubString* pFileName,
+ virtual sal_Bool StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies,
+ sal_uIntPtr nCopies,
bool bCollate,
bool bDirect,
ImplJobSetup* pSetupData );
- virtual BOOL EndJob();
- virtual BOOL AbortJob();
- virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData );
- virtual BOOL EndPage();
- virtual ULONG GetErrorCode();
+ virtual sal_Bool EndJob();
+ virtual sal_Bool AbortJob();
+ virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData );
+ virtual sal_Bool EndPage();
+ virtual sal_uIntPtr GetErrorCode();
void markInvalid();
bool isValid() const { return mbValid; }
diff --git a/vcl/win/inc/salsys.h b/vcl/win/inc/salsys.h
index 159a6ce1a2d1..806c6b9df812 100644
--- a/vcl/win/inc/salsys.h
+++ b/vcl/win/inc/salsys.h
@@ -84,7 +84,7 @@ public:
const std::vector<DisplayMonitor>& getMonitors()
{ initMonitors(); return m_aMonitors;}
- BOOL handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
+ sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
sal_IntPtr /*HDC*/,
sal_IntPtr /*LPRECT*/ );
};
diff --git a/vcl/win/inc/saltimer.h b/vcl/win/inc/saltimer.h
index 82ec8d2f387b..41839ad2f0c2 100644
--- a/vcl/win/inc/saltimer.h
+++ b/vcl/win/inc/saltimer.h
@@ -38,7 +38,7 @@ public:
virtual ~WinSalTimer();
// overload all pure virtual methods
- void Start( ULONG nMS );
+ void Start( sal_uIntPtr nMS );
void Stop();
};
diff --git a/vcl/win/inc/salvd.h b/vcl/win/inc/salvd.h
index 6203e286ec0c..4e7416cf2b97 100644
--- a/vcl/win/inc/salvd.h
+++ b/vcl/win/inc/salvd.h
@@ -46,16 +46,16 @@ public:
HBITMAP mhDefBmp; // Default Bitmap
WinSalGraphics* mpGraphics; // current VirDev graphics
WinSalVirtualDevice* mpNext; // next VirDev
- USHORT mnBitCount; // BitCount (0 or 1)
- BOOL mbGraphics; // is Graphics used
- BOOL mbForeignDC; // uses a foreign DC instead of a bitmap
+ sal_uInt16 mnBitCount; // BitCount (0 or 1)
+ sal_Bool mbGraphics; // is Graphics used
+ sal_Bool mbForeignDC; // uses a foreign DC instead of a bitmap
WinSalVirtualDevice();
virtual ~WinSalVirtualDevice();
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual BOOL SetSize( long nNewDX, long nNewDY );
+ virtual sal_Bool SetSize( long nNewDX, long nNewDY );
virtual void GetSize( long& rWidth, long& rHeight );
};
diff --git a/vcl/win/inc/wincomp.hxx b/vcl/win/inc/wincomp.hxx
index f1d99ddd6e30..ab399453884c 100644
--- a/vcl/win/inc/wincomp.hxx
+++ b/vcl/win/inc/wincomp.hxx
@@ -128,17 +128,17 @@ inline DWORD GetWindowExStyle( HWND hWnd )
return GetWindowLong( hWnd, GWL_EXSTYLE );
}
-inline WIN_BOOL IsMinimized( HWND hWnd )
+inline BOOL IsMinimized( HWND hWnd )
{
return IsIconic( hWnd );
}
-inline WIN_BOOL IsMaximized( HWND hWnd )
+inline BOOL IsMaximized( HWND hWnd )
{
return IsZoomed( hWnd );
}
-inline void SetWindowFont( HWND hWnd, HFONT hFont, WIN_BOOL bRedraw )
+inline void SetWindowFont( HWND hWnd, HFONT hFont, BOOL bRedraw )
{
SendMessage( hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM((UINT)bRedraw,0) );
}
diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx
index 260fdd561f4f..374c7b4922b3 100644
--- a/vcl/win/source/app/saldata.cxx
+++ b/vcl/win/source/app/saldata.cxx
@@ -55,7 +55,7 @@ rtl_TextEncoding ImplSalGetSystemEncoding()
// -----------------------------------------------------------------------
-ByteString ImplSalGetWinAnsiString( const UniString& rStr, BOOL bFileName )
+ByteString ImplSalGetWinAnsiString( const UniString& rStr, sal_Bool bFileName )
{
rtl_TextEncoding eEncoding = ImplSalGetSystemEncoding();
if ( bFileName )
@@ -118,28 +118,28 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 )
// =======================================================================
-WIN_BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+BOOL ImplPostMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
return PostMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+BOOL ImplSendMessage( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
return SendMessageW( hWnd, nMsg, wParam, lParam );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
+BOOL ImplGetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
{
return GetMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax );
}
// -----------------------------------------------------------------------
-WIN_BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
+BOOL ImplPeekMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg )
{
return PeekMessageW( lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg );
}
diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx
index e25d1b8a52e4..020e555d8498 100644
--- a/vcl/win/source/app/salinfo.cxx
+++ b/vcl/win/source/app/salinfo.cxx
@@ -71,7 +71,7 @@ WinSalSystem::~WinSalSystem()
// -----------------------------------------------------------------------
-static WIN_BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
+static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
HDC hDC,
LPRECT lpRect,
LPARAM dwData )
@@ -82,7 +82,7 @@ static WIN_BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
reinterpret_cast<sal_IntPtr>(lpRect) );
}
-BOOL WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
+sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_IntPtr )
{
MONITORINFOEXW aInfo;
aInfo.cbSize = sizeof( aInfo );
@@ -107,7 +107,7 @@ BOOL WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, sal_I
m_nPrimary = it->second;
}
}
- return TRUE;
+ return sal_True;
}
void WinSalSystem::clearMonitors()
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 5e3999e83d7b..e0935a6d956a 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -48,7 +48,7 @@
#include <salobj.h>
#include <vcl/salsys.hxx>
#include <saltimer.h>
-#include <vcl/salatype.hxx>
+#include <vcl/apptypes.hxx>
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
@@ -68,12 +68,10 @@
#pragma warning( disable: 4917 )
#endif
-#define ULONG WIN_ULONG
#include <GdiPlus.h>
#include <GdiPlusEnums.h>
#include <GdiPlusColor.h>
#include <Shlobj.h>
-#undef ULONG
#if defined _MSC_VER
#pragma warning(pop)
@@ -111,7 +109,7 @@ class SalYieldMutex : public vcl::SolarMutexObject
{
public: // for ImplSalYield()
WinSalInstance* mpInstData;
- ULONG mnCount;
+ sal_uLong mnCount;
DWORD mnThreadId;
public:
@@ -121,7 +119,7 @@ public:
virtual void SAL_CALL release();
virtual sal_Bool SAL_CALL tryToAcquire();
- ULONG GetAcquireCount( ULONG nThreadId );
+ sal_uLong GetAcquireCount( sal_uLong nThreadId );
};
// -----------------------------------------------------------------------
@@ -200,7 +198,7 @@ sal_Bool SAL_CALL SalYieldMutex::tryToAcquire()
// -----------------------------------------------------------------------
-ULONG SalYieldMutex::GetAcquireCount( ULONG nThreadId )
+sal_uLong SalYieldMutex::GetAcquireCount( sal_uLong nThreadId )
{
if ( nThreadId == mnThreadId )
return mnCount;
@@ -226,7 +224,7 @@ void ImplSalYieldMutexAcquireWithWait()
{
// Wenn wir den Mutex nicht bekommen, muessen wir solange
// warten, bis wir Ihn bekommen
- BOOL bAcquire = FALSE;
+ sal_Bool bAcquire = FALSE;
do
{
if ( pInst->mpSalYieldMutex->tryToAcquire() )
@@ -259,7 +257,7 @@ void ImplSalYieldMutexAcquireWithWait()
// -----------------------------------------------------------------------
-BOOL ImplSalYieldMutexTryToAcquire()
+sal_Bool ImplSalYieldMutexTryToAcquire()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( pInst )
@@ -291,15 +289,15 @@ void ImplSalYieldMutexRelease()
// -----------------------------------------------------------------------
-ULONG ImplSalReleaseYieldMutex()
+sal_uLong ImplSalReleaseYieldMutex()
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
return 0;
SalYieldMutex* pYieldMutex = pInst->mpSalYieldMutex;
- ULONG nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount( GetCurrentThreadId() );
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -311,7 +309,7 @@ ULONG ImplSalReleaseYieldMutex()
// -----------------------------------------------------------------------
-void ImplSalAcquireYieldMutex( ULONG nCount )
+void ImplSalAcquireYieldMutex( sal_uLong nCount )
{
WinSalInstance* pInst = GetSalData()->mpFirstInstance;
if ( !pInst )
@@ -327,10 +325,9 @@ void ImplSalAcquireYieldMutex( ULONG nCount )
// -----------------------------------------------------------------------
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool WinSalInstance::CheckYieldMutex()
{
+ bool bRet = true;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
if ( pSalData->mnAppThreadId != nCurThreadId )
@@ -340,7 +337,7 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+ bRet = false;
}
}
}
@@ -351,14 +348,13 @@ void ImplDbgTestSolarMutex()
SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
if ( pYieldMutex->mnThreadId != nCurThreadId )
{
- OSL_FAIL( "SolarMutex not locked in the main thread" );
+ bRet = false;
}
}
}
+ return bRet;
}
-#endif
-
// =======================================================================
void SalData::initKeyCodeMap()
@@ -443,9 +439,12 @@ SalData::SalData()
mpFirstIcon = 0; // icon cache, points to first icon, NULL if none
mpTempFontItem = 0;
mbThemeChanged = FALSE; // true if visual theme was changed: throw away theme handles
+ mbThemeMenuSupport = FALSE;
// init with NULL
gdiplusToken = 0;
+ maDwmLib = 0;
+ mpDwmIsCompositionEnabled = 0;
initKeyCodeMap();
@@ -569,8 +568,7 @@ SalInstance* CreateSalInstance()
return NULL;
}
- HWND hComWnd;
- hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ HWND hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
pSalData->mhInst, NULL );
if ( !hComWnd )
@@ -638,14 +636,14 @@ osl::SolarMutex* WinSalInstance::GetYieldMutex()
// -----------------------------------------------------------------------
-ULONG WinSalInstance::ReleaseYieldMutex()
+sal_uLong WinSalInstance::ReleaseYieldMutex()
{
return ImplSalReleaseYieldMutex();
}
// -----------------------------------------------------------------------
-void WinSalInstance::AcquireYieldMutex( ULONG nCount )
+void WinSalInstance::AcquireYieldMutex( sal_uLong nCount )
{
ImplSalAcquireYieldMutex( nCount );
}
@@ -667,7 +665,7 @@ static void ImplSalDispatchMessage( MSG* pMsg )
// -----------------------------------------------------------------------
-void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
+void ImplSalYield( sal_Bool bWait, sal_Bool bHandleAllCurrentEvents )
{
MSG aMsg;
bool bWasMsg = false, bOneEvent = false;
@@ -677,8 +675,12 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
+
bOneEvent = bWasMsg = true;
}
else
@@ -689,8 +691,11 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplGetMessage( &aMsg, 0, 0, 0 ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
}
}
}
@@ -702,8 +707,8 @@ void WinSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
SalData* pSalData = GetSalData();
DWORD nCurThreadId = GetCurrentThreadId();
- ULONG nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
- ULONG n = nCount;
+ sal_uLong nCount = pYieldMutex->GetAcquireCount( nCurThreadId );
+ sal_uLong n = nCount;
while ( n )
{
pYieldMutex->release();
@@ -760,7 +765,7 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_THREADYIELD:
- ImplSalYield( (BOOL)wParam, (BOOL)lParam );
+ ImplSalYield( (sal_Bool)wParam, (sal_Bool)lParam );
rDef = FALSE;
break;
// If we get this message, because another GetMessage() call
@@ -775,11 +780,11 @@ LRESULT CALLBACK SalComWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
rDef = FALSE;
break;
case SAL_MSG_STARTTIMER:
- ImplSalStartTimer( (ULONG) lParam, FALSE );
+ ImplSalStartTimer( (sal_uLong) lParam, FALSE );
rDef = FALSE;
break;
case SAL_MSG_CREATEFRAME:
- nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (ULONG)wParam );
+ nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (sal_uLong)wParam );
rDef = FALSE;
break;
case SAL_MSG_RECREATEHWND:
@@ -894,7 +899,7 @@ LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPa
// -----------------------------------------------------------------------
-bool WinSalInstance::AnyInput( USHORT nType )
+bool WinSalInstance::AnyInput( sal_uInt16 nType )
{
MSG aMsg;
@@ -976,7 +981,7 @@ bool WinSalInstance::AnyInput( USHORT nType )
// -----------------------------------------------------------------------
-void SalTimer::Start( ULONG nMS )
+void SalTimer::Start( sal_uLong nMS )
{
// Um auf Main-Thread umzuschalten
SalData* pSalData = GetSalData();
@@ -993,7 +998,7 @@ void SalTimer::Start( ULONG nMS )
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, ULONG nSalFrameStyle )
+SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, sal_uLong nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
return (SalFrame*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEFRAME, nSalFrameStyle, (LPARAM)pSystemParentData->hWnd );
@@ -1001,7 +1006,7 @@ SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData,
// -----------------------------------------------------------------------
-SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, ULONG nSalFrameStyle )
+SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle )
{
// Um auf Main-Thread umzuschalten
HWND hWndParent;
@@ -1023,7 +1028,7 @@ void WinSalInstance::DestroyFrame( SalFrame* pFrame )
SalObject* WinSalInstance::CreateObject( SalFrame* pParent,
SystemWindowData* /*pWindowData*/, // SystemWindowData meaningless on Windows
- BOOL /*bShow*/ )
+ sal_Bool /*bShow*/ )
{
// Um auf Main-Thread umzuschalten
return (SalObject*)ImplSendMessage( mhComWnd, SAL_MSG_CREATEOBJECT, 0, (LPARAM)static_cast<WinSalFrame*>(pParent) );
diff --git a/vcl/win/source/app/salshl.cxx b/vcl/win/source/app/salshl.cxx
index 136474e67f73..5dcc4b67da4e 100644
--- a/vcl/win/source/app/salshl.cxx
+++ b/vcl/win/source/app/salshl.cxx
@@ -44,15 +44,15 @@ extern "C"
{
#ifdef __MINGW32__
-BOOL WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+sal_Bool WINAPI DllMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#else
#ifdef ICC
int _CRT_init(void);
#else
-WIN_BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
+BOOL WINAPI _CRT_INIT( HINSTANCE hInst, DWORD nReason, LPVOID pReserved );
#endif
-WIN_BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
+BOOL WINAPI LibMain( HINSTANCE hInst, DWORD nReason, LPVOID pReserved )
#endif
{
// Unsere DLL-Initialisierung
@@ -103,7 +103,7 @@ HBITMAP ImplLoadSalBitmap( int nId )
// -----------------------------------------------------------------------
-BOOL ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon )
+sal_Bool ImplLoadSalIcon( int nId, HICON& rIcon, HICON& rSmallIcon )
{
DBG_ASSERT( aSalShlData.mhInst, "no DLL instance handle" );
diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx
index 2f57bf810bd0..29caaef3a5c3 100644
--- a/vcl/win/source/app/saltimer.cxx
+++ b/vcl/win/source/app/saltimer.cxx
@@ -43,7 +43,7 @@
// =======================================================================
-void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
+void ImplSalStartTimer( sal_uLong nMS, sal_Bool bMutex )
{
SalData* pSalData = GetSalData();
@@ -52,7 +52,7 @@ void ImplSalStartTimer( ULONG nMS, BOOL bMutex )
if ( !bMutex )
pSalData->mnTimerOrgMS = nMS;
- // Periode darf nicht zu gross sein, da Windows mit USHORT arbeitet
+ // Periode darf nicht zu gross sein, da Windows mit sal_uInt16 arbeitet
if ( nMS > MAX_SYSPERIOD )
nMS = MAX_SYSPERIOD;
@@ -71,7 +71,7 @@ WinSalTimer::~WinSalTimer()
{
}
-void WinSalTimer::Start( ULONG nMS )
+void WinSalTimer::Start( sal_uLong nMS )
{
// switch to main thread
SalData* pSalData = GetSalData();
diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index b201bf7c19b9..4c61358d727a 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -120,7 +120,7 @@ bool WinSalBitmap::Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal )
+bool WinSalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{
bool bRet = FALSE;
@@ -213,7 +213,7 @@ bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, SalGraphics* pSGraphics )
// ------------------------------------------------------------------
-bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, USHORT nNewBitCount )
+bool WinSalBitmap::Create( const SalBitmap& rSSalBmp, sal_uInt16 nNewBitCount )
{
bool bRet = FALSE;
@@ -285,9 +285,9 @@ void WinSalBitmap::Destroy()
// ------------------------------------------------------------------
-USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
+sal_uInt16 WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
{
- USHORT nColors = 0;
+ sal_uInt16 nColors = 0;
if( hDIB )
{
@@ -299,7 +299,7 @@ USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
if( pBIH->biBitCount <= 8 )
{
if ( pBIH->biClrUsed )
- nColors = (USHORT) pBIH->biClrUsed;
+ nColors = (sal_uInt16) pBIH->biClrUsed;
else
nColors = 1 << pBIH->biBitCount;
}
@@ -315,7 +315,7 @@ USHORT WinSalBitmap::ImplGetDIBColorCount( HGLOBAL hDIB )
// ------------------------------------------------------------------
-HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const BitmapPalette& rPal )
+HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rPal )
{
DBG_ASSERT( nBits == 1 || nBits == 4 || nBits == 8 || nBits == 16 || nBits == 24, "Unsupported BitCount!" );
@@ -323,8 +323,8 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const Bitm
if ( rSize.Width() && rSize.Height() )
{
- const ULONG nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
- const USHORT nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
+ const sal_uLong nImageSize = AlignedWidth4Bytes( nBits * rSize.Width() ) * rSize.Height();
+ const sal_uInt16 nColors = ( nBits <= 8 ) ? ( 1 << nBits ) : 0;
hDIB = GlobalAlloc( GHND, sizeof( BITMAPINFOHEADER ) + nColors * sizeof( RGBQUAD ) + nImageSize );
@@ -347,7 +347,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, USHORT nBits, const Bitm
if ( nColors )
{
- const USHORT nMinCount = Min( nColors, rPal.GetEntryCount() );
+ const sal_uInt16 nMinCount = Min( nColors, rPal.GetEntryCount() );
if( nMinCount )
memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof( RGBQUAD ) );
@@ -368,7 +368,7 @@ HANDLE WinSalBitmap::ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB )
if ( bDIB && hHdl )
{
- const ULONG nSize = GlobalSize( hHdl );
+ const sal_uLong nSize = GlobalSize( hHdl );
if ( (hCopy = GlobalAlloc( GHND, nSize )) != 0 )
{
@@ -426,8 +426,8 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
{
PBITMAPINFO pNewBI = (PBITMAPINFO) GlobalLock( hNewDIB );
PBITMAPINFOHEADER pNewBIH = (PBITMAPINFOHEADER) pNewBI;
- const USHORT nColorCount = ImplGetDIBColorCount( hNewDIB );
- const ULONG nOffset = *(DWORD*) pBI + nColorCount * sizeof( RGBQUAD );
+ const sal_uInt16 nColorCount = ImplGetDIBColorCount( hNewDIB );
+ const sal_uLong nOffset = *(DWORD*) pBI + nColorCount * sizeof( RGBQUAD );
BYTE* pOldBits = (PBYTE) pBI + nOffset;
BYTE* pNewBits = (PBYTE) pNewBI + nOffset;
@@ -460,11 +460,11 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
pBuffer->mnWidth = maSize.Width();
pBuffer->mnHeight = maSize.Height();
pBuffer->mnScanlineSize = AlignedWidth4Bytes( maSize.Width() * pBIH->biBitCount );
- pBuffer->mnBitCount = (USHORT) pBIH->biBitCount;
+ pBuffer->mnBitCount = (sal_uInt16) pBIH->biBitCount;
if( pBuffer->mnBitCount <= 8 )
{
- const USHORT nPalCount = ImplGetDIBColorCount( mhDIB );
+ const sal_uInt16 nPalCount = ImplGetDIBColorCount( mhDIB );
pBuffer->maPalette.SetEntryCount( nPalCount );
memcpy( pBuffer->maPalette.ImplGetColorBuffer(), pBI->bmiColors, nPalCount * sizeof( RGBQUAD ) );
@@ -472,7 +472,7 @@ BitmapBuffer* WinSalBitmap::AcquireBuffer( bool /*bReadOnly*/ )
}
else if( ( pBIH->biBitCount == 16 ) || ( pBIH->biBitCount == 32 ) )
{
- ULONG nOffset = 0UL;
+ sal_uLong nOffset = 0UL;
if( pBIH->biCompression == BI_BITFIELDS )
{
@@ -516,9 +516,9 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly )
if( !bReadOnly && !!pBuffer->maPalette )
{
PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB );
- const USHORT nCount = pBuffer->maPalette.GetEntryCount();
-
- memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), nCount * sizeof( RGBQUAD ) );
+ const sal_uInt16 nCount = pBuffer->maPalette.GetEntryCount();
+ const sal_uInt16 nDIBColorCount = ImplGetDIBColorCount( mhDIB );
+ memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) );
GlobalUnlock( mhDIB );
}
@@ -537,12 +537,12 @@ void WinSalBitmap::ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
HPBYTE pRLE = (HPBYTE) pSrcBuf;
HPBYTE pDIB = (HPBYTE) pDstBuf;
HPBYTE pRow = (HPBYTE) pDstBuf;
- ULONG nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
+ sal_uLong nWidthAl = AlignedWidth4Bytes( rSizePixel.Width() * ( bRLE4 ? 4UL : 8UL ) );
HPBYTE pLast = pDIB + rSizePixel.Height() * nWidthAl - 1;
- ULONG nCountByte;
- ULONG nRunByte;
- ULONG nX = 0;
- ULONG i;
+ sal_uLong nCountByte;
+ sal_uLong nRunByte;
+ sal_uLong nX = 0;
+ sal_uLong i;
BYTE cTmp;
bool bEndDecoding = FALSE;
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index cac65c8c229b..1e5a4c49eba2 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -38,7 +38,10 @@
#include <tools/debug.hxx>
#include <salframe.h>
#include <tools/poly.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <rtl/strbuf.hxx>
+#include <vcl/region.h>
using ::rtl::OStringBuffer;
// =======================================================================
@@ -187,7 +190,7 @@ void ImplInitSalGDI()
HBITMAP hBmpOld = (HBITMAP) ::SelectObject( hMemDC, hMemBmp );
HBRUSH hMemBrush = ::CreateSolidBrush( PALETTERGB( 175, 171, 169 ) );
HBRUSH hBrushOld = (HBRUSH) ::SelectObject( hMemDC, hMemBrush );
- BOOL bDither16 = TRUE;
+ sal_Bool bDither16 = TRUE;
::PatBlt( hMemDC, 0, 0, 8, 8, PATCOPY );
const COLORREF aCol( ::GetPixel( hMemDC, 0, 0 ) );
@@ -238,13 +241,13 @@ void ImplInitSalGDI()
BYTE nR, nG, nB;
PALETTEENTRY* pPalEntry;
LOGPALETTE* pLogPal;
- const USHORT nDitherPalCount = DITHER_PAL_COUNT;
- ULONG nTotalCount = DITHER_MAX_SYSCOLOR + nDitherPalCount + DITHER_EXTRA_COLORS;
+ const sal_uInt16 nDitherPalCount = DITHER_PAL_COUNT;
+ sal_uLong nTotalCount = DITHER_MAX_SYSCOLOR + nDitherPalCount + DITHER_EXTRA_COLORS;
// create logical palette
pLogPal = (LOGPALETTE*) new char[ sizeof( LOGPALETTE ) + ( nTotalCount * sizeof( PALETTEENTRY ) ) ];
pLogPal->palVersion = 0x0300;
- pLogPal->palNumEntries = (USHORT) nTotalCount;
+ pLogPal->palNumEntries = (sal_uInt16) nTotalCount;
pPalEntry = pLogPal->palPalEntry;
// Standard colors
@@ -402,7 +405,7 @@ static int ImplIsPaletteEntry( BYTE nRed, BYTE nGreen, BYTE nBlue )
PALETTEENTRY* pPalEntry = aImplSalSysPalEntryAry;
// standard palette color?
- for ( USHORT i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
+ for ( sal_uInt16 i = 0; i < DITHER_MAX_SYSCOLOR; i++, pPalEntry++ )
{
if( pPalEntry->peRed == nRed && pPalEntry->peGreen == nGreen && pPalEntry->peBlue == nBlue )
return TRUE;
@@ -546,7 +549,7 @@ void ImplSalDeInitGraphics( WinSalGraphics* pData )
// =======================================================================
-HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp )
+HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp )
{
SalData* pSalData = GetSalData();
HDCCache* pC = &pSalData->mpHDCCache[ nID ];
@@ -580,7 +583,7 @@ HDC ImplGetCachedDC( ULONG nID, HBITMAP hBmp )
// =======================================================================
-void ImplReleaseCachedDC( ULONG nID )
+void ImplReleaseCachedDC( sal_uLong nID )
{
SalData* pSalData = GetSalData();
HDCCache* pC = &pSalData->mpHDCCache[ nID ];
@@ -593,7 +596,7 @@ void ImplReleaseCachedDC( ULONG nID )
void ImplClearHDCCache( SalData* pData )
{
- for( ULONG i = 0; i < CACHESIZE_HDC; i++ )
+ for( sal_uLong i = 0; i < CACHESIZE_HDC; i++ )
{
HDCCache* pC = &pData->mpHDCCache[ i ];
@@ -616,21 +619,21 @@ void ImplClearHDCCache( SalData* pData )
// might also contain bezier control points for the PolyDraw() GDI method
// Make sure pWinPointAry and pWinFlagAry are big enough
void ImplPreparePolyDraw( bool bCloseFigures,
- ULONG nPoly,
+ sal_uLong nPoly,
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
const BYTE* const* pFlgAry,
POINT* pWinPointAry,
BYTE* pWinFlagAry )
{
- ULONG nCurrPoly;
+ sal_uLong nCurrPoly;
for( nCurrPoly=0; nCurrPoly<nPoly; ++nCurrPoly )
{
const POINT* pCurrPoint = reinterpret_cast<const POINT*>( *pPtAry++ );
const BYTE* pCurrFlag = *pFlgAry++;
const sal_uInt32 nCurrPoints = *pPoints++;
const bool bHaveFlagArray( pCurrFlag );
- ULONG nCurrPoint;
+ sal_uLong nCurrPoint;
if( nCurrPoints )
{
@@ -686,11 +689,11 @@ void ImplPreparePolyDraw( bool bCloseFigures,
// =======================================================================
// #100127# draw an array of points which might also contain bezier control points
-void ImplRenderPath( HDC hdc, ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
if( nPoints )
{
- USHORT i;
+ sal_uInt16 i;
// TODO: profile whether the following options are faster:
// a) look ahead and draw consecutive bezier or line segments by PolyBezierTo/PolyLineTo resp.
// b) convert our flag array to window's and use PolyDraw
@@ -801,9 +804,9 @@ void WinSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
// -----------------------------------------------------------------------
-USHORT WinSalGraphics::GetBitCount() const
+sal_uInt16 WinSalGraphics::GetBitCount() const
{
- return (USHORT)GetDeviceCaps( mhDC, BITSPIXEL );
+ return (sal_uInt16)GetDeviceCaps( mhDC, BITSPIXEL );
}
// -----------------------------------------------------------------------
@@ -845,7 +848,7 @@ void WinSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalGraphics::BeginSetClipRegion( ULONG nRectCount )
+bool WinSalGraphics::setClipRegion( const Region& i_rClip )
{
if ( mhRegion )
{
@@ -853,123 +856,143 @@ void WinSalGraphics::BeginSetClipRegion( ULONG nRectCount )
mhRegion = 0;
}
- ULONG nRectBufSize = sizeof(RECT)*nRectCount;
- if ( nRectCount < SAL_CLIPRECT_COUNT )
+ if( i_rClip.HasPolyPolygon() )
{
- if ( !mpStdClipRgnData )
- mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
- mpClipRgnData = mpStdClipRgnData;
+ // TODO: ConvertToB2DPolyPolygon actually is kind of const, just it does not advertise it in the header
+ basegfx::B2DPolyPolygon aPolyPolygon( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ const sal_uInt32 nCount(aPolyPolygon.count());
+
+ if( nCount )
+ {
+ std::vector< POINT > aPolyPoints;
+ aPolyPoints.reserve( 1024 );
+ std::vector< INT > aPolyCounts( nCount, 0 );
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ basegfx::B2DPolygon aPoly( aPolyPolygon.getB2DPolygon(a) );
+ aPoly = basegfx::tools::adaptiveSubdivideByDistance( aPoly, 1 );
+ const sal_uInt32 nPoints = aPoly.count();
+ aPolyCounts[a] = nPoints;
+ for( sal_uInt32 b = 0; b < nPoints; b++ )
+ {
+ basegfx::B2DPoint aPt( aPoly.getB2DPoint( b ) );
+ POINT aPOINT;
+ aPOINT.x = (LONG)aPt.getX();
+ aPOINT.y = (LONG)aPt.getY();
+ aPolyPoints.push_back( aPOINT );
+ }
+ }
+ mhRegion = CreatePolyPolygonRgn( &aPolyPoints[0], &aPolyCounts[0], nCount, ALTERNATE );
+ }
}
else
- mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
- mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
- mpClipRgnData->rdh.iType = RDH_RECTANGLES;
- mpClipRgnData->rdh.nCount = nRectCount;
- mpClipRgnData->rdh.nRgnSize = nRectBufSize;
- SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
- mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
- mbFirstClipRect = TRUE;
-}
-
-
-// -----------------------------------------------------------------------
-
-BOOL WinSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if ( nWidth && nHeight )
{
- RECT* pRect = mpNextClipRect;
- RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
- long nRight = nX + nWidth;
- long nBottom = nY + nHeight;
+ sal_uLong nRectCount = i_rClip.GetRectCount();
- if ( mbFirstClipRect )
+ sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
+ if ( nRectCount < SAL_CLIPRECT_COUNT )
{
- pBoundRect->left = nX;
- pBoundRect->top = nY;
- pBoundRect->right = nRight;
- pBoundRect->bottom = nBottom;
- mbFirstClipRect = FALSE;
+ if ( !mpStdClipRgnData )
+ mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
+ mpClipRgnData = mpStdClipRgnData;
}
else
+ mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
+ mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
+ mpClipRgnData->rdh.iType = RDH_RECTANGLES;
+ mpClipRgnData->rdh.nCount = nRectCount;
+ mpClipRgnData->rdh.nRgnSize = nRectBufSize;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ SetRectEmpty( pBoundRect );
+ RECT* pNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ bool bFirstClipRect = true;
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
{
- if ( nX < pBoundRect->left )
- pBoundRect->left = (int)nX;
-
- if ( nY < pBoundRect->top )
- pBoundRect->top = (int)nY;
-
- if ( nRight > pBoundRect->right )
- pBoundRect->right = (int)nRight;
-
- if ( nBottom > pBoundRect->bottom )
- pBoundRect->bottom = (int)nBottom;
- }
-
- pRect->left = (int)nX;
- pRect->top = (int)nY;
- pRect->right = (int)nRight;
- pRect->bottom = (int)nBottom;
- mpNextClipRect++;
- }
- else
- {
- mpClipRgnData->rdh.nCount--;
- mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
- }
-
- return TRUE;
-}
+ if ( nW && nH )
+ {
+ long nRight = nX + nW;
+ long nBottom = nY + nH;
-// -----------------------------------------------------------------------
+ if ( bFirstClipRect )
+ {
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
+ bFirstClipRect = false;
+ }
+ else
+ {
+ if ( nX < pBoundRect->left )
+ pBoundRect->left = (int)nX;
-bool WinSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ if ( nY < pBoundRect->top )
+ pBoundRect->top = (int)nY;
-// -----------------------------------------------------------------------
+ if ( nRight > pBoundRect->right )
+ pBoundRect->right = (int)nRight;
-void WinSalGraphics::EndSetClipRegion()
-{
- // create clip region from ClipRgnData
- if ( mpClipRgnData->rdh.nCount == 1 )
- {
- RECT* pRect = &(mpClipRgnData->rdh.rcBound);
- mhRegion = CreateRectRgn( pRect->left, pRect->top,
- pRect->right, pRect->bottom );
- }
- else
- {
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
- mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
+ if ( nBottom > pBoundRect->bottom )
+ pBoundRect->bottom = (int)nBottom;
+ }
- // if ExtCreateRegion(...) is not supported
- if( !mhRegion )
+ pNextClipRect->left = (int)nX;
+ pNextClipRect->top = (int)nY;
+ pNextClipRect->right = (int)nRight;
+ pNextClipRect->bottom = (int)nBottom;
+ pNextClipRect++;
+ }
+ else
+ {
+ mpClipRgnData->rdh.nCount--;
+ mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ // create clip region from ClipRgnData
+ if ( mpClipRgnData->rdh.nCount == 1 )
{
- RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
+ RECT* pRect = &(mpClipRgnData->rdh.rcBound);
+ mhRegion = CreateRectRgn( pRect->left, pRect->top,
+ pRect->right, pRect->bottom );
+ }
+ else if( mpClipRgnData->rdh.nCount > 1 )
+ {
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
- if( pHeader->nCount )
+ // if ExtCreateRegion(...) is not supported
+ if( !mhRegion )
{
- RECT* pRect = (RECT*) mpClipRgnData->Buffer;
- mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- pRect++;
+ RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
- for( ULONG n = 1; n < pHeader->nCount; n++, pRect++ )
+ if( pHeader->nCount )
{
- HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
- DeleteRegion( hRgn );
+ RECT* pRect = (RECT*) mpClipRgnData->Buffer;
+ mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ pRect++;
+
+ for( sal_uLong n = 1; n < pHeader->nCount; n++, pRect++ )
+ {
+ HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
+ DeleteRegion( hRgn );
+ }
}
}
- }
- if ( mpClipRgnData != mpStdClipRgnData )
- delete [] mpClipRgnData;
+ if ( mpClipRgnData != mpStdClipRgnData )
+ delete [] mpClipRgnData;
+ }
}
- SelectClipRgn( mhDC, mhRegion );
+ if( mhRegion )
+ SelectClipRgn( mhDC, mhRegion );
+ return mhRegion != 0;
}
// -----------------------------------------------------------------------
@@ -1004,14 +1027,14 @@ void WinSalGraphics::SetLineColor( SalColor nSalColor )
SALCOLOR_GREEN( nSalColor ),
SALCOLOR_BLUE( nSalColor ) );
HPEN hNewPen = 0;
- BOOL bStockPen = FALSE;
+ sal_Bool bStockPen = FALSE;
// search for stock pen (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
SalData* pSalData = GetSalData();
- for ( USHORT i = 0; i < pSalData->mnStockPenCount; i++ )
+ for ( sal_uInt16 i = 0; i < pSalData->mnStockPenCount; i++ )
{
if ( nPenColor == pSalData->maStockPenColorAry[i] )
{
@@ -1088,13 +1111,13 @@ void WinSalGraphics::SetFillColor( SalColor nSalColor )
BYTE nBlue = SALCOLOR_BLUE( nSalColor );
COLORREF nBrushColor = PALETTERGB( nRed, nGreen, nBlue );
HBRUSH hNewBrush = 0;
- BOOL bStockBrush = FALSE;
+ sal_Bool bStockBrush = FALSE;
// search for stock brush (only screen, because printer have problems,
// when we use stock objects)
if ( !mbPrinter )
{
- for ( USHORT i = 0; i < pSalData->mnStockBrushCount; i++ )
+ for ( sal_uInt16 i = 0; i < pSalData->mnStockBrushCount; i++ )
{
if ( nBrushColor == pSalData->maStockBrushColorAry[ i ] )
{
@@ -1314,7 +1337,7 @@ void WinSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1329,7 +1352,7 @@ void WinSalGraphics::drawPolyLine( ULONG nPoints, const SalPoint* pPtAry )
// -----------------------------------------------------------------------
-void WinSalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
// Unter NT koennen wir das Array direkt weiterreichen
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
@@ -1417,7 +1440,7 @@ void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
@@ -1434,7 +1457,7 @@ sal_Bool WinSalGraphics::drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtA
// -----------------------------------------------------------------------
-sal_Bool WinSalGraphics::drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
+sal_Bool WinSalGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry )
{
#ifdef USE_GDI_BEZIERS
// Unter NT koennen wir das Array direkt weiterreichen
@@ -1494,7 +1517,7 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphics::DrawPolyPolygonBezier(): POINT != SalPoint" );
- ULONG nCurrPoly, nTotalPoints;
+ sal_uLong nCurrPoly, nTotalPoints;
const sal_uInt32* pCurrPoints = pPoints;
for( nCurrPoly=0, nTotalPoints=0; nCurrPoly<nPoly; ++nCurrPoly )
nTotalPoints += *pCurrPoints++;
@@ -1547,11 +1570,11 @@ sal_Bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
#define POSTSCRIPT_BOUNDINGSEARCH 0x1000 // we only try to get the BoundingBox
// in the first 4096 bytes
-static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, sal_uLong nComp, sal_uLong nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ sal_uLong i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -1564,9 +1587,9 @@ static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSi
return NULL;
}
-static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
+static sal_Bool ImplGetBoundingBox( double* nNumb, BYTE* pSource, sal_uLong nSize )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = FALSE;
BYTE* pDest = ImplSearchEntry( pSource, (BYTE*)"%%BoundingBox:", nSize, 14 );
if ( pDest )
{
@@ -1581,9 +1604,9 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
for ( i = 0; ( i < 4 ) && nSizeLeft; i++ )
{
int nDivision = 1;
- BOOL bDivision = FALSE;
- BOOL bNegative = FALSE;
- BOOL bValid = TRUE;
+ sal_Bool bDivision = FALSE;
+ sal_Bool bNegative = FALSE;
+ sal_Bool bValid = TRUE;
while ( ( --nSizeLeft ) && ( *pDest == ' ' ) || ( *pDest == 0x9 ) ) pDest++;
BYTE nByte = *pDest;
@@ -1626,9 +1649,9 @@ static BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
return bRetValue;
}
-BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize )
+sal_Bool WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = FALSE;
if ( mbPrinter )
{
@@ -1642,7 +1665,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
{
OStringBuffer aBuf( POSTSCRIPT_BUFSIZE );
- // reserve place for a USHORT
+ // reserve place for a sal_uInt16
aBuf.append( "aa" );
// #107797# Write out EPS encapsulation header
@@ -1720,7 +1743,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// #107797# Write out buffer
// ----------------------------------------------------------------------------------
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
@@ -1728,7 +1751,7 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// ----------------------------------------------------------------------------------
double dM11 = nWidth / ( nBoundingBox[2] - nBoundingBox[0] );
double dM22 = nHeight / (nBoundingBox[1] - nBoundingBox[3] );
- // reserve a USHORT again
+ // reserve a sal_uInt16 again
aBuf.setLength( 2 );
aBuf.append( "\n\n[" );
aBuf.append( dM11 );
@@ -1740,14 +1763,14 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
aBuf.append( nY - ( dM22 * nBoundingBox[3] ) );
aBuf.append( "] concat\n"
"%%BeginDocument:\n" );
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
// #107797# Write out actual EPS content
// ----------------------------------------------------------------------------------
- ULONG nToDo = nSize;
- ULONG nDoNow;
+ sal_uLong nToDo = nSize;
+ sal_uLong nDoNow;
while ( nToDo )
{
nDoNow = nToDo;
@@ -1755,9 +1778,9 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
nDoNow = POSTSCRIPT_BUFSIZE - 2;
// the following is based on the string buffer allocation
// of size POSTSCRIPT_BUFSIZE at construction time of aBuf
- *((USHORT*)aBuf.getStr()) = (USHORT)nDoNow;
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)nDoNow;
memcpy( (void*)(aBuf.getStr() + 2), (BYTE*)pPtr + nSize - nToDo, nDoNow );
- ULONG nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
+ sal_uLong nResult = Escape ( mhDC, nEscape, nDoNow + 2, (LPTSTR)aBuf.getStr(), 0 );
if (!nResult )
break;
nToDo -= nResult;
@@ -1766,13 +1789,13 @@ BOOL WinSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void*
// #107797# Write out EPS encapsulation footer
// ----------------------------------------------------------------------------------
- // reserve a USHORT again
+ // reserve a sal_uInt16 again
aBuf.setLength( 2 );
aBuf.append( "%%EndDocument\n"
"count op_count_salWin sub {pop} repeat\n"
"countdictstack dict_count_salWin sub {end} repeat\n"
"b4_Inc_state_salWin restore\n\n" );
- *((USHORT*)aBuf.getStr()) = (USHORT)( aBuf.getLength() - 2 );
+ *((sal_uInt16*)aBuf.getStr()) = (sal_uInt16)( aBuf.getLength() - 2 );
Escape ( mhDC, nEscape, aBuf.getLength(), (LPTSTR)aBuf.getStr(), 0 );
bRetValue = TRUE;
}
diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx
index b066258c3dac..90123100c7ee 100644
--- a/vcl/win/source/gdi/salgdi2.cxx
+++ b/vcl/win/source/gdi/salgdi2.cxx
@@ -50,6 +50,9 @@ bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
case OutDevSupport_TransparentRect:
bRet = mbVirDev || mbWindow;
break;
+ case OutDevSupport_B2DClip:
+ bRet = true;
+ break;
case OutDevSupport_B2DDraw:
bRet = bAllowForTest;
default: break;
@@ -146,7 +149,7 @@ void ImplCalcOutSideRgn( const RECT& rSrcRect,
void WinSalGraphics::copyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
bool bRestoreClipRgn = false;
HRGN hOldClipRgn = 0;
@@ -343,14 +346,14 @@ void WinSalGraphics::copyArea( long nDestX, long nDestY,
void ImplDrawBitmap( HDC hDC,
const SalTwoRect* pPosAry, const WinSalBitmap& rSalBitmap,
- BOOL bPrinter, int nDrawMode )
+ sal_Bool bPrinter, int nDrawMode )
{
if( hDC )
{
HGLOBAL hDrawDIB;
HBITMAP hDrawDDB = rSalBitmap.ImplGethDDB();
WinSalBitmap* pTmpSalBmp = NULL;
- BOOL bPrintDDB = ( bPrinter && hDrawDDB );
+ sal_Bool bPrintDDB = ( bPrinter && hDrawDDB );
if( bPrintDDB )
{
@@ -384,7 +387,7 @@ void ImplDrawBitmap( HDC hDC,
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_DRAW, hDrawDDB );
COLORREF nOldBkColor = RGB(0xFF,0xFF,0xFF);
COLORREF nOldTextColor = RGB(0,0,0);
- BOOL bMono = ( rSalBitmap.GetBitCount() == 1 );
+ sal_Bool bMono = ( rSalBitmap.GetBitCount() == 1 );
if( bMono )
{
@@ -666,7 +669,7 @@ SalBitmap* WinSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
HDC hDC = mhDC;
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- BOOL bRet;
+ sal_Bool bRet;
DWORD err = 0;
bRet = BitBlt( hBmpDC, 0, 0, (int) nDX, (int) nDY, hDC, (int) nX, (int) nY, SRCCOPY ) ? TRUE : FALSE;
@@ -753,7 +756,7 @@ void WinSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
// -----------------------------------------------------------------------
-void WinSalGraphics::invert( ULONG nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void WinSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
HPEN hPen;
HPEN hOldPen;
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 567ecc8b734b..355cae79377b 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -127,7 +127,7 @@ private:
FontAttrMap aFontAttributes;
rtl::OUString aCacheFileName;
String aBaseURL;
- BOOL bModified;
+ sal_Bool bModified;
protected:
String OptimizeURL( const String& rURL ) const;
@@ -532,9 +532,10 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
// avoid fonts with unknown CMAP subtables for glyph fallback
if( !pCharMap || pCharMap->IsDefaultMap() )
return false;
+ pCharMap->AddReference();
int nMatchCount = 0;
- // static const int nMaxMatchCount = 1; // TODO: check more missing characters?
+ // static const int nMaxMatchCount = 1; // TODO: tolerate more missing characters?
const sal_Int32 nStrLen = rMissingChars.getLength();
for( sal_Int32 nStrIdx = 0; nStrIdx < nStrLen; ++nStrIdx )
{
@@ -542,6 +543,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars( const ImplFontData* pFace,
nMatchCount += pCharMap->HasChar( uChar );
break; // for now
}
+ pCharMap->DeReference();
const bool bHasMatches = (nMatchCount > 0);
return bHasMatches;
@@ -643,7 +645,7 @@ static CharSet ImplCharSetToSal( BYTE nCharSet )
if ( nCharSet == OEM_CHARSET )
{
- UINT nCP = (USHORT)GetOEMCP();
+ UINT nCP = (sal_uInt16)GetOEMCP();
switch ( nCP )
{
// It is unclear why these two (undefined?) code page numbers are
@@ -1192,7 +1194,7 @@ const void * GrFontData::getTable(unsigned int name, size_t *len) const
#endif
ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
- int nHeight, WIN_BYTE eWinCharSet, WIN_BYTE nPitchAndFamily )
+ int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
: ImplFontData( rDFS, 0 ),
meWinCharSet( eWinCharSet ),
mnPitchAndFamily( nPitchAndFamily ),
@@ -1350,11 +1352,10 @@ bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
+const ImplFontCharMap* ImplWinFontData::GetImplFontCharMap() const
{
if( !mpUnicodeMap )
return NULL;
- mpUnicodeMap->AddReference();
return mpUnicodeMap;
}
@@ -1434,6 +1435,7 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( !mpUnicodeMap )
mpUnicodeMap = ImplFontCharMap::GetDefaultMap( bIsSymbolFont );
+ mpUnicodeMap->AddReference();
}
void ImplWinFontData::GetFontCapabilities( HDC hDC ) const
@@ -1512,8 +1514,6 @@ int CALLBACK SalEnumQueryFontProcExW( const ENUMLOGFONTEXW*,
bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
{
- bool bAvailable = false;
-
// Test, if Font available
LOGFONTW aLogFont;
memset( &aLogFont, 0, sizeof( aLogFont ) );
@@ -1525,6 +1525,7 @@ bool ImplIsFontAvailable( HDC hDC, const UniString& rName )
memcpy( aLogFont.lfFaceName, rName.GetBuffer(), nNameLen*sizeof( wchar_t ) );
aLogFont.lfFaceName[nNameLen] = 0;
+ bool bAvailable = false;
EnumFontFamiliesExW( hDC, &aLogFont, (FONTENUMPROCW)SalEnumQueryFontProcExW,
(LPARAM)(void*)&bAvailable, 0 );
@@ -1679,7 +1680,7 @@ HFONT WinSalGraphics::ImplDoSetFont( ImplFontSelectData* i_pFont, float& o_rFont
return hNewFont;
}
-USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
+sal_uInt16 WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
{
// return early if there is no new font
if( !pFont )
@@ -1868,12 +1869,12 @@ static void ImplGetAllFontCharSets( WinSalGraphics* pData )
static void ImplAddKerningPairs( WinSalGraphics* pData )
{
- ULONG nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
+ sal_uLong nPairs = ::GetKerningPairsA( pData->mhDC, 0, NULL );
if ( !nPairs )
return;
CHARSETINFO aInfo;
- if ( !TranslateCharsetInfo( (DWORD*)(ULONG)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
+ if ( !TranslateCharsetInfo( (DWORD*)(sal_uLong)GetTextCharset( pData->mhDC ), &aInfo, TCI_SRCCHARSET ) )
return;
if ( !pData->mpFontKernPairs )
@@ -1888,15 +1889,15 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
}
UINT nCP = aInfo.ciACP;
- ULONG nOldPairs = pData->mnFontKernPairCount;
+ sal_uLong nOldPairs = pData->mnFontKernPairCount;
KERNINGPAIR* pTempPair = pData->mpFontKernPairs+pData->mnFontKernPairCount;
nPairs = ::GetKerningPairsA( pData->mhDC, nPairs, pTempPair );
- for ( ULONG i = 0; i < nPairs; i++ )
+ for ( sal_uLong i = 0; i < nPairs; i++ )
{
unsigned char aBuf[2];
wchar_t nChar;
int nLen;
- BOOL bAdd = TRUE;
+ sal_Bool bAdd = TRUE;
// None-ASCII?, then we must convert the char
if ( (pTempPair->wFirst > 125) || (pTempPair->wFirst == 92) )
@@ -1940,7 +1941,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// TODO: get rid of linear search!
KERNINGPAIR* pTempPair2 = pData->mpFontKernPairs;
- for ( ULONG j = 0; j < nOldPairs; j++ )
+ for ( sal_uLong j = 0; j < nOldPairs; j++ )
{
if ( (pTempPair2->wFirst == pTempPair->wFirst) &&
(pTempPair2->wSecond == pTempPair->wSecond) )
@@ -1965,7 +1966,7 @@ static void ImplAddKerningPairs( WinSalGraphics* pData )
// -----------------------------------------------------------------------
-ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
+sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{
DBG_ASSERT( sizeof( KERNINGPAIR ) == sizeof( ImplKernPairData ),
"WinSalGraphics::GetKernPairs(): KERNINGPAIR != ImplKernPairData" );
@@ -1983,17 +1984,17 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
if( nCount )
{
-#ifdef GCP_KERN_HACK
+ #ifdef GCP_KERN_HACK
pPairs = new KERNINGPAIR[ nCount+1 ];
mpFontKernPairs = pPairs;
mnFontKernPairCount = nCount;
::GetKerningPairsW( mhDC, nCount, pPairs );
-#else // GCP_KERN_HACK
+ #else // GCP_KERN_HACK
pPairs = pKernPairs;
nCount = (nCount < nPairs) : nCount : nPairs;
::GetKerningPairsW( mhDC, nCount, pPairs );
return nCount;
-#endif // GCP_KERN_HACK
+ #endif // GCP_KERN_HACK
}
mbFontKernInit = FALSE;
@@ -2017,7 +2018,7 @@ ULONG WinSalGraphics::GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs )
// -----------------------------------------------------------------------
-ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* WinSalGraphics::GetImplFontCharMap() const
{
if( !mpWinFontData[0] )
return ImplFontCharMap::GetDefaultMap();
@@ -2393,8 +2394,8 @@ bool WinSalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
*/
ImplWinFontData* pFontData = new ImplWinFontData( aDFA, 0,
- sal::static_int_cast<WIN_BYTE>(nPreferedCharSet),
- sal::static_int_cast<WIN_BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
+ sal::static_int_cast<BYTE>(nPreferedCharSet),
+ sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData) );
pFontList->Add( pFontData );
return true;
@@ -2505,7 +2506,7 @@ void WinSalGraphics::GetDevFontSubstList( OutputDevice* )
// -----------------------------------------------------------------------
-BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
+sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
{
HDC hDC = mhDC;
@@ -2522,9 +2523,7 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
GLYPHMETRICS aGM;
aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0;
aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0;
- DWORD nSize = GDI_ERROR;
- nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
-
+ DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
if( nSize == GDI_ERROR )
return false;
@@ -2539,12 +2538,11 @@ BOOL WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
// -----------------------------------------------------------------------
-BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
+sal_Bool WinSalGraphics::GetGlyphOutline( long nIndex,
::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
rB2DPolyPoly.clear();
- BOOL bRet = FALSE;
HDC hDC = mhDC;
// use unity matrix
@@ -2558,164 +2556,160 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
nIndex &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
- DWORD nSize1 = GDI_ERROR;
- nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
-
+ const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
if( !nSize1 ) // blank glyphs are ok
- bRet = TRUE;
- else if( nSize1 != GDI_ERROR )
+ return TRUE;
+ else if( nSize1 == GDI_ERROR )
+ return FALSE;
+
+ BYTE* pData = new BYTE[ nSize1 ];
+ const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
+ &aGlyphMetrics, nSize1, pData, &aMat );
+
+ if( nSize1 != nSize2 )
+ return FALSE;
+
+ // TODO: avoid tools polygon by creating B2DPolygon directly
+ int nPtSize = 512;
+ Point* pPoints = new Point[ nPtSize ];
+ BYTE* pFlags = new BYTE[ nPtSize ];
+
+ TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
+ while( (BYTE*)pHeader < pData+nSize2 )
{
- BYTE* pData = new BYTE[ nSize1 ];
- DWORD nSize2;
- nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags,
- &aGlyphMetrics, nSize1, pData, &aMat );
+ // only outline data is interesting
+ if( pHeader->dwType != TT_POLYGON_TYPE )
+ break;
- if( nSize1 == nSize2 )
- {
- bRet = TRUE;
+ // get start point; next start points are end points
+ // of previous segment
+ sal_uInt16 nPnt = 0;
- int nPtSize = 512;
- Point* pPoints = new Point[ nPtSize ];
- BYTE* pFlags = new BYTE[ nPtSize ];
+ long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
+ long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt++ ] = POLY_NORMAL;
- TTPOLYGONHEADER* pHeader = (TTPOLYGONHEADER*)pData;
- while( (BYTE*)pHeader < pData+nSize2 )
+ bool bHasOfflinePoints = false;
+ TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
+ pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
+ while( (BYTE*)pCurve < (BYTE*)pHeader )
+ {
+ int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
+ if( nPtSize < nNeededSize )
{
- // only outline data is interesting
- if( pHeader->dwType != TT_POLYGON_TYPE )
- break;
-
- // get start point; next start points are end points
- // of previous segment
- USHORT nPnt = 0;
-
- long nX = IntTimes256FromFixed( pHeader->pfxStart.x );
- long nY = IntTimes256FromFixed( pHeader->pfxStart.y );
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt++ ] = POLY_NORMAL;
-
- bool bHasOfflinePoints = false;
- TTPOLYCURVE* pCurve = (TTPOLYCURVE*)( pHeader + 1 );
- pHeader = (TTPOLYGONHEADER*)( (BYTE*)pHeader + pHeader->cb );
- while( (BYTE*)pCurve < (BYTE*)pHeader )
+ Point* pOldPoints = pPoints;
+ BYTE* pOldFlags = pFlags;
+ nPtSize = 2 * nNeededSize;
+ pPoints = new Point[ nPtSize ];
+ pFlags = new BYTE[ nPtSize ];
+ for( sal_uInt16 i = 0; i < nPnt; ++i )
{
- int nNeededSize = nPnt + 16 + 3 * pCurve->cpfx;
- if( nPtSize < nNeededSize )
- {
- Point* pOldPoints = pPoints;
- BYTE* pOldFlags = pFlags;
- nPtSize = 2 * nNeededSize;
- pPoints = new Point[ nPtSize ];
- pFlags = new BYTE[ nPtSize ];
- for( USHORT i = 0; i < nPnt; ++i )
- {
- pPoints[ i ] = pOldPoints[ i ];
- pFlags[ i ] = pOldFlags[ i ];
- }
- delete[] pOldPoints;
- delete[] pOldFlags;
- }
+ pPoints[ i ] = pOldPoints[ i ];
+ pFlags[ i ] = pOldFlags[ i ];
+ }
+ delete[] pOldPoints;
+ delete[] pOldFlags;
+ }
- int i = 0;
- if( TT_PRIM_LINE == pCurve->wType )
+ int i = 0;
+ if( TT_PRIM_LINE == pCurve->wType )
+ {
+ while( i < pCurve->cpfx )
+ {
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ pPoints[ nPnt ] = Point( nX, nY );
+ pFlags[ nPnt ] = POLY_NORMAL;
+ ++nPnt;
+ }
+ }
+ else if( TT_PRIM_QSPLINE == pCurve->wType )
+ {
+ bHasOfflinePoints = true;
+ while( i < pCurve->cpfx )
+ {
+ // get control point of quadratic bezier spline
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+ ++i;
+ Point aControlP( nX, nY );
+
+ // calculate first cubic control point
+ // P0 = 1/3 * (PBeg + 2 * PQControl)
+ nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+0 ] = POLY_CONTROL;
+
+ // calculate endpoint of segment
+ nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
+ nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
+
+ if ( i+1 >= pCurve->cpfx )
{
- while( i < pCurve->cpfx )
- {
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- pPoints[ nPnt ] = Point( nX, nY );
- pFlags[ nPnt ] = POLY_NORMAL;
- ++nPnt;
- }
+ // endpoint is either last point in segment => advance
+ ++i;
}
- else if( TT_PRIM_QSPLINE == pCurve->wType )
+ else
{
- bHasOfflinePoints = true;
- while( i < pCurve->cpfx )
- {
- // get control point of quadratic bezier spline
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
- ++i;
- Point aControlP( nX, nY );
-
- // calculate first cubic control point
- // P0 = 1/3 * (PBeg + 2 * PQControl)
- nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+0 ] = POLY_CONTROL;
-
- // calculate endpoint of segment
- nX = IntTimes256FromFixed( pCurve->apfx[ i ].x );
- nY = IntTimes256FromFixed( pCurve->apfx[ i ].y );
-
- if ( i+1 >= pCurve->cpfx )
- {
- // endpoint is either last point in segment => advance
- ++i;
- }
- else
- {
- // or endpoint is the middle of two control points
- nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
- nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
- nX = (nX + 1) / 2;
- nY = (nY + 1) / 2;
- // no need to advance, because the current point
- // is the control point in next bezier spline
- }
-
- pPoints[ nPnt+2 ] = Point( nX, nY );
- pFlags[ nPnt+2 ] = POLY_NORMAL;
-
- // calculate second cubic control point
- // P1 = 1/3 * (PEnd + 2 * PQControl)
- nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
- nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
- pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
- pFlags[ nPnt+1 ] = POLY_CONTROL;
-
- nPnt += 3;
- }
+ // or endpoint is the middle of two control points
+ nX += IntTimes256FromFixed( pCurve->apfx[ i-1 ].x );
+ nY += IntTimes256FromFixed( pCurve->apfx[ i-1 ].y );
+ nX = (nX + 1) / 2;
+ nY = (nY + 1) / 2;
+ // no need to advance, because the current point
+ // is the control point in next bezier spline
}
- // next curve segment
- pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
- }
+ pPoints[ nPnt+2 ] = Point( nX, nY );
+ pFlags[ nPnt+2 ] = POLY_NORMAL;
- // end point is start point for closed contour
- // disabled, because Polygon class closes the contour itself
- // pPoints[nPnt++] = pPoints[0];
- // #i35928#
- // Added again, but add only when not yet closed
- if(pPoints[nPnt - 1] != pPoints[0])
- {
- if( bHasOfflinePoints )
- pFlags[nPnt] = pFlags[0];
+ // calculate second cubic control point
+ // P1 = 1/3 * (PEnd + 2 * PQControl)
+ nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X();
+ nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y();
+ pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 );
+ pFlags[ nPnt+1 ] = POLY_CONTROL;
- pPoints[nPnt++] = pPoints[0];
+ nPnt += 3;
}
+ }
- // convert y-coordinates W32 -> VCL
- for( int i = 0; i < nPnt; ++i )
- pPoints[i].Y() = -pPoints[i].Y();
+ // next curve segment
+ pCurve = (TTPOLYCURVE*)&pCurve->apfx[ i ];
+ }
- // insert into polypolygon
- Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
- // convert to B2DPolyPolygon
- // TODO: get rid of the intermediate PolyPolygon
- rB2DPolyPoly.append( aPoly.getB2DPolygon() );
- }
+ // end point is start point for closed contour
+ // disabled, because Polygon class closes the contour itself
+ // pPoints[nPnt++] = pPoints[0];
+ // #i35928#
+ // Added again, but add only when not yet closed
+ if(pPoints[nPnt - 1] != pPoints[0])
+ {
+ if( bHasOfflinePoints )
+ pFlags[nPnt] = pFlags[0];
- delete[] pPoints;
- delete[] pFlags;
+ pPoints[nPnt++] = pPoints[0];
}
- delete[] pData;
+ // convert y-coordinates W32 -> VCL
+ for( int i = 0; i < nPnt; ++i )
+ pPoints[i].Y() = -pPoints[i].Y();
+
+ // insert into polypolygon
+ Polygon aPoly( nPnt, pPoints, (bHasOfflinePoints ? pFlags : NULL) );
+ // convert to B2DPolyPolygon
+ // TODO: get rid of the intermediate PolyPolygon
+ rB2DPolyPoly.append( aPoly.getB2DPolygon() );
}
+ delete[] pPoints;
+ delete[] pFlags;
+
+ delete[] pData;
+
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
@@ -2723,7 +2717,7 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
- return bRet;
+ return TRUE;
}
// -----------------------------------------------------------------------
@@ -2786,7 +2780,7 @@ int ScopedTrueTypeFont::open(void * pBuffer, sal_uInt32 nLen,
return OpenTTFontBuffer(pBuffer, nLen, nFaceNum, &m_pFont);
}
-BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont, long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
@@ -2804,8 +2798,6 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
ImplDoSetFont( &aIFSD, fScale, hOldFont );
ImplWinFontData* pWinFontData = (ImplWinFontData*)aIFSD.mpFontData;
- pWinFontData->UpdateFromHDC( mhDC );
-/*const*/ ImplFontCharMap* pImplFontCharMap = pWinFontData->GetImplFontCharMap();
#if OSL_DEBUG_LEVEL > 1
// get font metrics
@@ -2828,6 +2820,10 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const RawFontData aRawCffData( mhDC, nCffTag );
if( aRawCffData.get() )
{
+ pWinFontData->UpdateFromHDC( mhDC );
+ const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap();
+ pCharMap->AddReference();
+
long nRealGlyphIds[ 256 ];
for( int i = 0; i < nGlyphCount; ++i )
{
@@ -2835,13 +2831,15 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly?
sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
- nGlyphIdx = pImplFontCharMap->GetGlyphIndex( nGlyphIdx );
+ nGlyphIdx = pCharMap->GetGlyphIndex( nGlyphIdx );
if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
{/*####*/}
nRealGlyphIds[i] = nGlyphIdx;
}
+ pCharMap->DeReference(); // TODO: and and use a RAII object
+
// provide a font subset from the CFF-table
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() );
@@ -2879,7 +2877,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// subset TTF-glyphs and get their properties
// take care that subset fonts require the NotDef glyph in pos 0
int nOrigCount = nGlyphCount;
- USHORT aShortIDs[ 256 ];
+ sal_uInt16 aShortIDs[ 256 ];
sal_uInt8 aTempEncs[ 256 ];
int nNotDef=-1, i;
@@ -2899,7 +2897,7 @@ BOOL WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical );
}
}
- aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
+ aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
if( !nGlyphIdx )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
@@ -2970,7 +2968,7 @@ const void* WinSalGraphics::GetEmbedFontData( const ImplFontData* pFont,
nFNLen--;
if( nFNLen == 0 )
*pDataLen = 0;
- rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<USHORT>(nFNLen) );
+ rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<sal_uInt16>(nFNLen) );
rInfo.m_nAscent = +aTm.tmAscent;
rInfo.m_nDescent = -aTm.tmDescent;
rInfo.m_aFontBBox = Rectangle( Point( -aTm.tmOverhang, -aTm.tmDescent ),
@@ -3082,8 +3080,9 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
rUnicodeEnc.clear();
}
const ImplWinFontData* pWinFont = static_cast<const ImplWinFontData*>(pFont);
- ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
+ const ImplFontCharMap* pMap = pWinFont->GetImplFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
+ pMap->AddReference();
int nCharCount = pMap->GetCharCount();
sal_uInt32 nChar = pMap->GetFirstChar();
@@ -3099,6 +3098,8 @@ void WinSalGraphics::GetGlyphWidths( const ImplFontData* pFont,
}
nChar = pMap->GetNextChar( nChar );
}
+
+ pMap->DeReference(); // TODO: and and use a RAII object
}
}
else if( pFont->IsEmbeddable() )
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 446b98892f6d..ccd378750580 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -80,7 +80,7 @@ private:
public:
VisualStylesAPI();
~VisualStylesAPI();
- BOOL IsAvailable() { return (mhModule != NULL); }
+ sal_Bool IsAvailable() { return (mhModule != NULL); }
HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );
HRESULT CloseThemeData( HTHEME hTheme );
@@ -190,6 +190,8 @@ void SalData::deInitNWF( void )
++iter;
}
aThemeMap.clear();
+ if( maDwmLib )
+ osl_unloadModule( maDwmLib );
}
static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
@@ -217,7 +219,7 @@ static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
* Returns TRUE if the platform supports native
* drawing of the control defined by nPart
*/
-BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
HTHEME hTheme = NULL;
@@ -288,6 +290,22 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL ||
+ nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -317,16 +335,16 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL WinSalGraphics::hitTestNativeControl( ControlType,
+sal_Bool WinSalGraphics::hitTestNativeControl( ControlType,
ControlPart,
const Rectangle&,
const Point&,
- BOOL& )
+ sal_Bool& )
{
return FALSE;
}
-BOOL ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
+sal_Bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
{
HRESULT hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
@@ -421,7 +439,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
// ----
-BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
+sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ControlType nType,
ControlPart nPart,
ControlState nState,
@@ -558,7 +576,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -583,7 +601,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_SPINBUTTONS )
{
const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
RECT rect;
ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect );
@@ -688,7 +706,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_RADIOBUTTON )
{
iPart = BP_RADIOBUTTON;
- BOOL bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
if( nState & CTRL_STATE_PRESSED )
iState = bChecked ? RBS_CHECKEDPRESSED : RBS_UNCHECKEDPRESSED;
@@ -834,7 +852,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nPart == PART_BUTTON )
{
iPart = TP_BUTTON;
- BOOL bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
+ sal_Bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON );
if( !(nState & CTRL_STATE_ENABLED) )
//iState = TS_DISABLED;
// disabled buttons are typically not painted at all but we need visual
@@ -869,15 +887,23 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_MENUBAR )
{
- if( nPart != PART_ENTIRE_CONTROL )
- return FALSE;
-
- if( aValue.getType() == CTRL_MENUBAR )
+ if( nPart == PART_ENTIRE_CONTROL )
{
- const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
- rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ if( aValue.getType() == CTRL_MENUBAR )
+ {
+ const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+ rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ }
+ return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
}
- return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
if( nType == CTRL_PROGRESS )
@@ -956,6 +982,69 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption );
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_ENTIRE_CONTROL )
+ {
+ RECT aGutterRC = rc;
+ aGutterRC.left += aValue.getNumericVal();
+ aGutterRC.right = aGutterRC.left+3;
+ return
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, aCaption ) &&
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption )
+ ;
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption );
+ }
+ else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ if( (nState & CTRL_STATE_PRESSED) )
+ {
+ RECT aBGRect = rc;
+ if( aValue.getType() == CTRL_MENU_POPUP )
+ {
+ const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) );
+ aBGRect.left = rMVal.maItemRect.Left();
+ aBGRect.top = rMVal.maItemRect.Top();
+ aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl
+ aBGRect.right = rMVal.getNumericVal();
+
+ // FIXME: magic
+ aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1;
+ }
+ iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED;
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
+ if( nPart == PART_MENU_ITEM_CHECK_MARK )
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED;
+ else
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption );
+ }
+ else
+ return true; // unchecked: do nothing
+ }
+ else if( nPart == PART_MENU_SEPARATOR )
+ {
+ rc.left += aValue.getNumericVal(); // adjust for gutter position
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) );
+ // center the separator inside the passed rectangle
+ long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2;
+ rc.top += nDY;
+ rc.bottom = rc.top+aRect.GetHeight()-1;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPSEPARATOR, 0, rc, aCaption );
+ }
+ }
+ }
+
return false;
}
@@ -968,14 +1057,14 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::drawNativeControl( ControlType nType,
+sal_Bool WinSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption )
{
- BOOL bOk = false;
+ sal_Bool bOk = false;
HTHEME hTheme = NULL;
switch( nType )
@@ -1029,6 +1118,11 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -1042,6 +1136,16 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
hTheme = getThemeHandle( mhWnd, L"Trackbar" );
break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR
+ )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
default:
hTheme = NULL;
break;
@@ -1085,7 +1189,7 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::drawNativeControlText( ControlType,
+sal_Bool WinSalGraphics::drawNativeControlText( ControlType,
ControlPart,
const Rectangle&,
ControlState,
@@ -1109,7 +1213,7 @@ BOOL WinSalGraphics::drawNativeControlText( ControlType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
+sal_Bool WinSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -1118,7 +1222,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
Rectangle &rNativeBoundingRegion,
Rectangle &rNativeContentRegion )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
HDC hDC = GetDC( mhWnd );
if( nType == CTRL_TOOLBAR )
@@ -1198,7 +1302,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
if( hTheme )
{
- // get borderr size
+ // get border size
Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
@@ -1227,6 +1331,29 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
}
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ HTHEME hTheme = getThemeHandle( mhWnd, L"Menu");
+ Rectangle aBoxRect( rControlRegion );
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPCHECK,
+ MC_CHECKMARKNORMAL,
+ aBoxRect ) );
+ if( aBoxRect.GetWidth() && aBoxRect.GetHeight() )
+ {
+ rNativeContentRegion = aRect;
+ rNativeBoundingRegion = rNativeContentRegion;
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+
if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) )
{
HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar");
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 16c7439fbbdd..b233f97a15ee 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -94,6 +94,7 @@
#endif
+using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ui::dialogs;
@@ -129,9 +130,9 @@ static LPDEVMODEW SAL_DEVMODE_W( const ImplJobSetup* pSetupData )
// =======================================================================
-static ULONG ImplWinQueueStatusToSal( DWORD nWinStatus )
+static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus )
{
- ULONG nStatus = 0;
+ sal_uLong nStatus = 0;
if ( nWinStatus & PRINTER_STATUS_PAUSED )
nStatus |= QUEUE_STATUS_PAUSED;
if ( nWinStatus & PRINTER_STATUS_ERROR )
@@ -193,7 +194,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
DWORD n;
DWORD nBytes = 0;
DWORD nInfoPrn2;
- BOOL bFound = FALSE;
+ sal_Bool bFound = FALSE;
PRINTER_INFO_2* pWinInfo2 = NULL;
PRINTER_INFO_2* pGetInfo2;
EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoPrn2 );
@@ -263,7 +264,7 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
pTmp = pPortName;
while ( *pTmp != ',' )
pTmp++;
- XubString aDriver( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
+ XubString aDriver( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
pPortName = pTmp;
// get port names
@@ -274,11 +275,11 @@ static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList )
while ( *pTmp && (*pTmp != ',') )
pTmp++;
- String aPortName( ImplSalGetUniString( pPortName, (USHORT)(pTmp-pPortName) ) );
+ String aPortName( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) );
// create new entry
// look up if printer was already found in first loop
- BOOL bAdd = TRUE;
+ sal_Bool bAdd = TRUE;
if ( pWinInfo2 )
{
pGetInfo2 = pWinInfo2;
@@ -447,7 +448,7 @@ void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo )
XubString WinSalInstance::GetDefaultPrinter()
{
static bool bGetDefPrtAPI = true;
- static BOOL(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
+ static sal_Bool(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL;
// try to use GetDefaultPrinter API (not available prior to W2000)
if( bGetDefPrtAPI )
{
@@ -464,7 +465,7 @@ XubString WinSalInstance::GetDefaultPrinter()
pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData );
}
- pGetDefaultPrinter = (BOOL(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
+ pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc;
}
}
if( pGetDefaultPrinter )
@@ -534,8 +535,8 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
// -----------------------------------------------------------------------
-static BOOL ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
- ImplJobSetup* pSetupData, BOOL bDelete )
+static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
+ ImplJobSetup* pSetupData, sal_Bool bDelete )
{
if ( pSetupData && pSetupData->mpDriverData )
{
@@ -659,8 +660,8 @@ static BOOL ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
// -----------------------------------------------------------------------
-static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
- BOOL bIn, WinSalFrame* pVisibleDlgParent )
+static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData,
+ sal_Bool bIn, WinSalFrame* pVisibleDlgParent )
{
ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE );
HANDLE hPrn;
@@ -683,7 +684,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
LONG nSysJobSize = -1;
HWND hWnd = 0;
DWORD nMode = DM_OUT_BUFFER;
- ULONG nDriverDataLen = 0;
+ sal_uLong nDriverDataLen = 0;
SalDriverData* pOutBuffer = NULL;
BYTE* pInBuffer = NULL;
@@ -709,7 +710,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN;
pOutBuffer->mnVersion = aSalShlData.mbWPrinter ? SAL_DRIVERDATA_VERSION_W : SAL_DRIVERDATA_VERSION_A;
// calculate driver data offset including structure padding
- pOutBuffer->mnDriverOffset = sal::static_int_cast<USHORT>(
+ pOutBuffer->mnDriverOffset = sal::static_int_cast<sal_uInt16>(
(char*)pOutBuffer->maDriverData -
(char*)pOutBuffer );
@@ -728,7 +729,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
// Release mutex, in the other case we don't get paints and so on
- ULONG nMutexCount=0;
+ sal_uLong nMutexCount=0;
if ( pVisibleDlgParent )
nMutexCount = ImplSalReleaseYieldMutex();
@@ -808,7 +809,7 @@ static BOOL ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
#define CHOOSE_DEVMODE(i)\
(pDevModeW ? pDevModeW->i : pDevModeA->i)
-static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
+static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -827,7 +828,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -836,11 +837,11 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
pSetupData->mnPaperBin = 0;
// search the right bin and assign index to mnPaperBin
- for( ULONG i = 0; i < nCount; i++ )
+ for( sal_uLong i = 0; i < nCount; i++ )
{
if( CHOOSE_DEVMODE(dmDefaultSource) == pBins[ i ] )
{
- pSetupData->mnPaperBin = (USHORT)i;
+ pSetupData->mnPaperBin = (sal_uInt16)i;
break;
}
}
@@ -859,9 +860,9 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
else
{
- ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
WORD* pPapers = NULL;
- ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
POINT* pPaperSizes = NULL;
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
{
@@ -875,7 +876,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
}
if( nPaperSizeCount == nPaperCount && pPaperSizes && pPapers )
{
- for( ULONG i = 0; i < nPaperCount; i++ )
+ for( sal_uLong i = 0; i < nPaperCount; i++ )
{
if( pPapers[ i ] == CHOOSE_DEVMODE(dmPaperSize) )
{
@@ -1076,7 +1077,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// -----------------------------------------------------------------------
-static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, ULONG nFlags )
+static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags )
{
if ( !pSetupData || !pSetupData->mpDriverData )
return;
@@ -1096,7 +1097,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
// PaperBin
if ( nFlags & SAL_JOBSET_PAPERBIN )
{
- ULONG nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
+ sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData );
if ( nCount && (nCount != GDI_ERROR) )
{
@@ -1274,9 +1275,9 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
default:
{
short nPaper = 0;
- ULONG nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
+ sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData );
WORD* pPapers = NULL;
- ULONG nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
+ sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData );
POINT* pPaperSizes = NULL;
DWORD nLandscapeAngle = ImplDeviceCaps( pPrinter, DC_ORIENTATION, NULL, pSetupData );
if ( nPaperCount && (nPaperCount != GDI_ERROR) )
@@ -1293,7 +1294,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
{
PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
// compare paper formats and select a good match
- for ( ULONG i = 0; i < nPaperCount; i++ )
+ for ( sal_uLong i = 0; i < nPaperCount; i++ )
{
if ( aInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)))
{
@@ -1308,7 +1309,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS
if ( !nPaper && nLandscapeAngle != 0 )
{
PaperInfo aRotatedInfo(pSetupData->mnPaperHeight, pSetupData->mnPaperWidth);
- for ( ULONG i = 0; i < nPaperCount; i++ )
+ for ( sal_uLong i = 0; i < nPaperCount; i++ )
{
if ( aRotatedInfo.sloppyEqual(PaperInfo(pPaperSizes[i].x*10, pPaperSizes[i].y*10)) )
{
@@ -1464,7 +1465,7 @@ static WinSalGraphics* ImplCreateSalPrnGraphics( HDC hDC )
// -----------------------------------------------------------------------
-static BOOL ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
+static sal_Bool ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData )
{
HDC hNewDC = ImplCreateSalPrnIC( pPrinter, pSetupData );
if ( !hNewDC )
@@ -1624,7 +1625,7 @@ void WinSalInfoPrinter::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
{
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, static_cast<WinSalFrame*>(pFrame) ) )
{
@@ -1637,7 +1638,7 @@ BOOL WinSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
{
if ( !ImplTestSalJobSetup( this, pSetupData, FALSE ) )
return FALSE;
@@ -1646,7 +1647,7 @@ BOOL WinSalInfoPrinter::SetPrinterData( ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-BOOL WinSalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
+sal_Bool WinSalInfoPrinter::SetData( sal_uLong nFlags, ImplJobSetup* pSetupData )
{
ImplJobSetupToDevMode( this, pSetupData, nFlags );
if ( ImplUpdateSalJobSetup( this, pSetupData, TRUE, NULL ) )
@@ -1660,7 +1661,7 @@ BOOL WinSalInfoPrinter::SetData( ULONG nFlags, ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-ULONG WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
+sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
{
DWORD nRet = ImplDeviceCaps( this, DC_BINS, NULL, pSetupData );
if ( nRet && (nRet != GDI_ERROR) )
@@ -1671,7 +1672,7 @@ ULONG WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
// -----------------------------------------------------------------------
-XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin )
+XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin )
{
XubString aPaperBinName;
@@ -1701,7 +1702,7 @@ XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, UL
// -----------------------------------------------------------------------
-ULONG WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType )
+sal_uLong WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType )
{
DWORD nRet;
@@ -1783,11 +1784,11 @@ void WinSalInstance::DestroyPrinter( SalPrinter* pPrinter )
// =======================================================================
-WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
+BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{
SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter;
- BOOL bWhile = TRUE;
+ sal_Bool bWhile = TRUE;
int i = 0;
do
@@ -1796,8 +1797,11 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -1824,19 +1828,19 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
// -----------------------------------------------------------------------
-static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, ULONG nCopies, BOOL bCollate )
+static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, sal_uLong nCopies, sal_Bool bCollate )
{
LPDEVMODEA pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEA)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(USHORT)nCopies;
+ pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
pDevMode->dmFields |= DM_COLLATE;
if ( bCollate )
pDevMode->dmCollate = DMCOLLATE_TRUE;
@@ -1847,19 +1851,19 @@ static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, ULONG nCopies, BOOL bCo
return pNewDevMode;
}
-static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, ULONG nCopies, BOOL bCollate )
+static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, sal_uLong nCopies, sal_Bool bCollate )
{
LPDEVMODEW pNewDevMode = pDevMode;
if ( pDevMode && (nCopies > 1) )
{
if ( nCopies > 32765 )
nCopies = 32765;
- ULONG nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
+ sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra;
pNewDevMode = (LPDEVMODEW)rtl_allocateMemory( nDevSize );
memcpy( pNewDevMode, pDevMode, nDevSize );
pDevMode = pNewDevMode;
pDevMode->dmFields |= DM_COPIES;
- pDevMode->dmCopies = (short)(USHORT)nCopies;
+ pDevMode->dmCopies = (short)(sal_uInt16)nCopies;
pDevMode->dmFields |= DM_COLLATE;
if ( bCollate )
pDevMode->dmCollate = DMCOLLATE_TRUE;
@@ -1952,10 +1956,10 @@ static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt )
return nRet;
}
-BOOL WinSalPrinter::StartJob( const XubString* pFileName,
+sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString&,
- ULONG nCopies,
+ sal_uLong nCopies,
bool bCollate,
bool /*bDirect*/,
ImplJobSetup* pSetupData )
@@ -2044,7 +2048,7 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
// Wegen Telocom Balloon Fax-Treiber, der uns unsere Messages
// ansonsten oefters schickt, versuchen wir vorher alle
// zu verarbeiten und dann eine Dummy-Message reinstellen
- BOOL bWhile = TRUE;
+ sal_Bool bWhile = TRUE;
int i = 0;
do
{
@@ -2052,8 +2056,12 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
+
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -2069,16 +2077,16 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
if( mpInfoPrinter->maPortName.EqualsIgnoreCaseAscii( "FILE:" ) && !(pFileName && pFileName->Len()) )
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
- Reference< XFilePicker > xFilePicker( xFactory->createInstance(
+ uno::Reference< XFilePicker > xFilePicker( xFactory->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ),
UNO_QUERY );
DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
+ uno::Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
+ uno::Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
{
Sequence< Any > aServiceType( 1 );
@@ -2172,7 +2180,7 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::EndJob()
+sal_Bool WinSalPrinter::EndJob()
{
DWORD err = 0;
HDC hDC = mhDC;
@@ -2192,7 +2200,7 @@ BOOL WinSalPrinter::EndJob()
// call, however the real solution is supposed to be the threading
// framework yet to come.
SalData* pSalData = GetSalData();
- ULONG nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
+ sal_uLong nAcquire = pSalData->mpFirstInstance->ReleaseYieldMutex();
CATCH_DRIVER_EX_BEGIN;
if( ::EndDoc( hDC ) <= 0 )
err = GetLastError();
@@ -2208,7 +2216,7 @@ BOOL WinSalPrinter::EndJob()
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::AbortJob()
+sal_Bool WinSalPrinter::AbortJob()
{
mbAbort = TRUE;
@@ -2265,7 +2273,7 @@ void ImplSalPrinterAbortJobAsync( HDC hPrnDC )
// -----------------------------------------------------------------------
-SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData )
+SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData )
{
if( ! isValid() || mhDC == 0 )
return NULL;
@@ -2320,7 +2328,7 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, BOOL bNewJobDat
// -----------------------------------------------------------------------
-BOOL WinSalPrinter::EndPage()
+sal_Bool WinSalPrinter::EndPage()
{
HDC hDC = mhDC;
if ( hDC && mpGraphics )
@@ -2350,7 +2358,7 @@ BOOL WinSalPrinter::EndPage()
// -----------------------------------------------------------------------
-ULONG WinSalPrinter::GetErrorCode()
+sal_uLong WinSalPrinter::GetErrorCode()
{
return mnError;
}
diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx
index a076409aa0ea..40b13dc9bf17 100644
--- a/vcl/win/source/gdi/salvd.cxx
+++ b/vcl/win/source/gdi/salvd.cxx
@@ -39,7 +39,7 @@
// =======================================================================
static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
- USHORT nBitCount )
+ sal_uInt16 nBitCount )
{
HBITMAP hBitmap;
@@ -79,14 +79,14 @@ static HBITMAP ImplCreateVirDevBitmap( HDC hDC, long nDX, long nDY,
SalVirtualDevice* WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
long nDX, long nDY,
- USHORT nBitCount,
+ sal_uInt16 nBitCount,
const SystemGraphicsData* pData )
{
WinSalGraphics* pGraphics = static_cast<WinSalGraphics*>(pSGraphics);
HDC hDC = NULL;
HBITMAP hBmp = NULL;
- BOOL bOk = FALSE;
+ sal_Bool bOk = FALSE;
if( pData )
{
@@ -227,7 +227,7 @@ void WinSalVirtualDevice::ReleaseGraphics( SalGraphics* )
// -----------------------------------------------------------------------
-BOOL WinSalVirtualDevice::SetSize( long nDX, long nDY )
+sal_Bool WinSalVirtualDevice::SetSize( long nDX, long nDY )
{
if( mbForeignDC || !mhBmp )
return TRUE; // ???
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index d0d71d4d100c..1c47b21d550d 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -58,11 +58,9 @@
#define USE_UNISCRIBE
#ifdef USE_UNISCRIBE
-#define ULONG WIN_ULONG
#include <Usp10.h>
#include <ShLwApi.h>
#include <winver.h>
-#undef ULONG
#endif // USE_UNISCRIBE
#include <boost/unordered_map.hpp>
@@ -245,13 +243,11 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- HFONT hHugeFont = 0;
LOGFONTW aLogFont;
::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectW( &aLogFont);
-
+ HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -661,57 +657,31 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #108267#, limit the number of glyphs to avoid paint errors
- UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
- if( mnDrawOptions )
- {
- // #108267#, break up into glyph portions of a limited size required by Win32 API
- const unsigned int maxGlyphCount = 8192;
- UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
- UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
-
- if( numGlyphPortions )
- {
- // #108267#,#109387# break up string into smaller chunks
- // the output positions will be updated by windows (SetTextAlign)
- unsigned int i,n;
- POINT oldPos;
- UINT oldTa = ::GetTextAlign( aHDC );
- ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
- ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
- for( i=n=0; n<numGlyphPortions; n++, i+=maxGlyphCount )
- ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ // #108267#, break up into glyph portions of a limited size required by Win32 API
+ const unsigned int maxGlyphCount = 8192;
+ UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
+ UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
+
+ if( numGlyphPortions )
+ {
+ // #108267#,#109387# break up string into smaller chunks
+ // the output positions will be updated by windows (SetTextAlign)
+ POINT oldPos;
+ UINT oldTa = ::GetTextAlign( aHDC );
+ ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
+ ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
+ unsigned int i = 0;
+ for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
- ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign( aHDC, oldTa );
- }
- else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
+ mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
+ ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ ::SetTextAlign( aHDC, oldTa );
}
else
- {
- // #108267#, On Win9x, we get paint errors when drawing huge strings, even when
- // split into pieces (see above), seems to be a problem in the internal text clipping
- // so we just cut off the string
- if( !mpGlyphOrigAdvs )
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs, limitedGlyphCount, NULL );
- else
- {
- // workaround for problem in #106259#
- long nXPos = mnBaseAdv;
- for( unsigned int i = 0; i < limitedGlyphCount; ++i )
- {
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs+i, 1, NULL );
- nXPos += mpGlyphAdvances[ i ];
- aPos = GetDrawPosition( Point( nXPos, 0 ) );
- }
- }
- }
+ ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
+ mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );
@@ -1240,7 +1210,7 @@ static bool InitUSP()
DWORD nHandle;
DWORD nBufSize = ::GetFileVersionInfoSizeW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), &nHandle );
char* pBuffer = (char*)alloca( nBufSize );
- WIN_BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
+ BOOL bRC = ::GetFileVersionInfoW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), nHandle, nBufSize, pBuffer );
VS_FIXEDFILEINFO* pFixedFileInfo = NULL;
UINT nFixedFileSize = 0;
if( bRC )
@@ -2061,6 +2031,13 @@ void UniscribeLayout::MoveGlyph( int nStartx8, long nNewXPos )
// move the visual item by having an offset
pVI->mnXOffset += nDelta;
}
+ // move subsequent items - this often isn't necessary because subsequent
+ // moves will correct subsequent items. However, if there is a contiguous
+ // range not involving fallback which spans items, this will be needed
+ while (++pVI - mpVisualItems < mnItemCount)
+ {
+ pVI->mnXOffset += nDelta;
+ }
}
// -----------------------------------------------------------------------
@@ -2341,6 +2318,10 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
if( rVisualItem.IsEmpty() )
continue;
+ if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)
+ {
+ nXPos = rVisualItem.mnXOffset;
+ }
// get glyph positions
// TODO: handle when rVisualItem's glyph range is only partially used
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
@@ -2374,13 +2355,17 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
}
}
- // fixup unknown character positions to neighbor
- for( i = 0; i < nMaxIdx; ++i )
+ if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
{
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
- else
- pCaretXArray[ i ] = nXPos;
+ nXPos = 0;
+ // fixup unknown character positions to neighbor
+ for( i = 0; i < nMaxIdx; ++i )
+ {
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
+ }
}
}
diff --git a/vcl/win/source/src/ase.cur b/vcl/win/source/src/ase.cur
index 7634a7d34a7b..7634a7d34a7b 100755..100644
--- a/vcl/win/source/src/ase.cur
+++ b/vcl/win/source/src/ase.cur
Binary files differ
diff --git a/vcl/win/source/src/asn.cur b/vcl/win/source/src/asn.cur
index e444e42bf37e..e444e42bf37e 100755..100644
--- a/vcl/win/source/src/asn.cur
+++ b/vcl/win/source/src/asn.cur
Binary files differ
diff --git a/vcl/win/source/src/asne.cur b/vcl/win/source/src/asne.cur
index e92cc65e7eb1..e92cc65e7eb1 100755..100644
--- a/vcl/win/source/src/asne.cur
+++ b/vcl/win/source/src/asne.cur
Binary files differ
diff --git a/vcl/win/source/src/asns.cur b/vcl/win/source/src/asns.cur
index 04d0b09c353e..04d0b09c353e 100755..100644
--- a/vcl/win/source/src/asns.cur
+++ b/vcl/win/source/src/asns.cur
Binary files differ
diff --git a/vcl/win/source/src/asnswe.cur b/vcl/win/source/src/asnswe.cur
index a0e25b16de1f..a0e25b16de1f 100755..100644
--- a/vcl/win/source/src/asnswe.cur
+++ b/vcl/win/source/src/asnswe.cur
Binary files differ
diff --git a/vcl/win/source/src/asnw.cur b/vcl/win/source/src/asnw.cur
index 20322bc97b16..20322bc97b16 100755..100644
--- a/vcl/win/source/src/asnw.cur
+++ b/vcl/win/source/src/asnw.cur
Binary files differ
diff --git a/vcl/win/source/src/ass.cur b/vcl/win/source/src/ass.cur
index 7166636a1a77..7166636a1a77 100755..100644
--- a/vcl/win/source/src/ass.cur
+++ b/vcl/win/source/src/ass.cur
Binary files differ
diff --git a/vcl/win/source/src/asse.cur b/vcl/win/source/src/asse.cur
index 8cb71234b0a9..8cb71234b0a9 100755..100644
--- a/vcl/win/source/src/asse.cur
+++ b/vcl/win/source/src/asse.cur
Binary files differ
diff --git a/vcl/win/source/src/assw.cur b/vcl/win/source/src/assw.cur
index fddaf3f57cbf..fddaf3f57cbf 100755..100644
--- a/vcl/win/source/src/assw.cur
+++ b/vcl/win/source/src/assw.cur
Binary files differ
diff --git a/vcl/win/source/src/asw.cur b/vcl/win/source/src/asw.cur
index 0ccac50f4596..0ccac50f4596 100755..100644
--- a/vcl/win/source/src/asw.cur
+++ b/vcl/win/source/src/asw.cur
Binary files differ
diff --git a/vcl/win/source/src/aswe.cur b/vcl/win/source/src/aswe.cur
index c238b7e10aef..c238b7e10aef 100755..100644
--- a/vcl/win/source/src/aswe.cur
+++ b/vcl/win/source/src/aswe.cur
Binary files differ
diff --git a/vcl/win/source/src/chain.cur b/vcl/win/source/src/chain.cur
index 02abb7ab714f..02abb7ab714f 100755..100644
--- a/vcl/win/source/src/chain.cur
+++ b/vcl/win/source/src/chain.cur
Binary files differ
diff --git a/vcl/win/source/src/chainnot.cur b/vcl/win/source/src/chainnot.cur
index 938ece03f329..938ece03f329 100755..100644
--- a/vcl/win/source/src/chainnot.cur
+++ b/vcl/win/source/src/chainnot.cur
Binary files differ
diff --git a/vcl/win/source/src/timemove.cur b/vcl/win/source/src/timemove.cur
index 319b6edc5774..319b6edc5774 100755..100644
--- a/vcl/win/source/src/timemove.cur
+++ b/vcl/win/source/src/timemove.cur
Binary files differ
diff --git a/vcl/win/source/src/timesize.cur b/vcl/win/source/src/timesize.cur
index 1ec23de05b71..1ec23de05b71 100755..100644
--- a/vcl/win/source/src/timesize.cur
+++ b/vcl/win/source/src/timesize.cur
Binary files differ
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 4548427addef..15be14eac5be 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -96,6 +96,7 @@ using ::std::max;
#include <time.h>
using ::rtl::OUString;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
@@ -120,8 +121,8 @@ void MyOutputDebugString( char *s) { OutputDebugString( s ); }
// misssing prototypes and constants for LayeredWindows
extern "C" {
- //WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
- typedef BOOL ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
+ //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
+ typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes;
};
@@ -129,7 +130,7 @@ extern "C" {
const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED");
-BOOL WinSalFrame::mbInReparent = FALSE;
+sal_Bool WinSalFrame::mbInReparent = FALSE;
// =======================================================================
@@ -160,7 +161,7 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
// Position, Groesse und Status fuer GetWindowState() merken
if ( !pFrame->mbFullScreen )
{
- BOOL bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
if ( IsIconic( pFrame->mhWnd ) )
{
pFrame->maState.mnState |= SAL_FRAMESTATE_MINIMIZED;
@@ -344,13 +345,13 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
// =======================================================================
SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
- HWND hWndParent, ULONG nSalFrameStyle )
+ HWND hWndParent, sal_uLong nSalFrameStyle )
{
WinSalFrame* pFrame = new WinSalFrame;
HWND hWnd;
DWORD nSysStyle = 0;
DWORD nExSysStyle = 0;
- BOOL bSubFrame = FALSE;
+ sal_Bool bSubFrame = FALSE;
if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands
GdiSetBatchLimit( 1 );
@@ -583,11 +584,11 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
// helper that only creates the HWND
// to allow for easy reparenting of system windows, (i.e. destroy and create new)
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild )
{
HINSTANCE hInstance = GetSalData()->mhInst;
- ULONG nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
- ULONG nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
+ sal_uLong nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
+ sal_uLong nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
if( bAsChild )
{
@@ -606,7 +607,7 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
// Uebersetzungstabelle von System-Keycodes in StarView-Keycodes
#define KEY_TAB_SIZE 146
-static USHORT aImplTranslateKeyTab[KEY_TAB_SIZE] =
+static sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] =
{
// StarView-Code System-Code Index
0, // 0
@@ -863,11 +864,11 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
+ uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
{
- Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
+ uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
{
@@ -903,7 +904,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE )
+static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, sal_Bool bAlways = FALSE )
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
{
@@ -1167,9 +1168,9 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::PostEvent( void* pData )
+sal_Bool WinSalFrame::PostEvent( void* pData )
{
- return (BOOL)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
+ return (sal_Bool)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
}
// -----------------------------------------------------------------------
@@ -1187,7 +1188,7 @@ void WinSalFrame::SetTitle( const XubString& rTitle )
// -----------------------------------------------------------------------
-void WinSalFrame::SetIcon( USHORT nIcon )
+void WinSalFrame::SetIcon( sal_uInt16 nIcon )
{
// If we have a window without an Icon (for example a dialog), ignore this call
if ( mbNoIcon )
@@ -1244,7 +1245,7 @@ SalFrame* WinSalFrame::GetParent() const
// -----------------------------------------------------------------------
-static void ImplSalShow( HWND hWnd, BOOL bVisible, BOOL bNoActivate )
+static void ImplSalShow( HWND hWnd, sal_Bool bVisible, sal_Bool bNoActivate )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
@@ -1329,7 +1330,7 @@ void WinSalFrame::SetExtendedFrameStyle( SalExtStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void WinSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
@@ -1342,7 +1343,7 @@ void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
// -----------------------------------------------------------------------
-void WinSalFrame::Enable( BOOL bEnable )
+void WinSalFrame::Enable( sal_Bool bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -1364,9 +1365,9 @@ void WinSalFrame::SetMaxClientSize( long nWidth, long nHeight )
// -----------------------------------------------------------------------
void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( !bVisible )
{
Window *pClientWin = GetWindow()->ImplGetClientWindow();
@@ -1381,7 +1382,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
ShowWindow( mhWnd, SW_RESTORE );
}
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
UINT nPosSize = 0;
RECT aClientRect, aWindowRect;
GetClientRect( mhWnd, &aClientRect ); // x,y always 0,0, but width and height without border
@@ -1533,7 +1534,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// Adjust Window in the screen
- BOOL bCheckOffScreen = TRUE;
+ sal_Bool bCheckOffScreen = TRUE;
// but don't do this for floaters or ownerdraw windows that are currently moved interactively
if( (mnStyle & SAL_FRAME_STYLE_FLOAT) && !(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
@@ -1576,7 +1577,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// -----------------------------------------------------------------------
-static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAsChild )
+static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, sal_Bool bAsChild )
{
// save hwnd, will be overwritten in WM_CREATE during createwindow
HWND hWndOld = pThis->mhWnd;
@@ -1609,8 +1610,8 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAs
pObject = pObject->mpNextObject;
}
- BOOL bNeedGraphics = pThis->mbGraphics;
- BOOL bNeedCacheDC = FALSE;
+ sal_Bool bNeedGraphics = pThis->mbGraphics;
+ sal_Bool bNeedCacheDC = FALSE;
HFONT hFont = NULL;
HPEN hPen = NULL;
@@ -1850,8 +1851,8 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
GetWindowPlacement( mhWnd, &aPlacement );
// Status setzen
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
- BOOL bUpdateHiddenFramePos = FALSE;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bUpdateHiddenFramePos = FALSE;
if ( !bVisible )
{
aPlacement.showCmd = SW_HIDE;
@@ -1932,7 +1933,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool WinSalFrame::GetWindowState( SalFrameState* pState )
{
if ( maState.mnWidth && maState.mnHeight )
{
@@ -1986,7 +1987,7 @@ void WinSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
+void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
return;
@@ -2019,7 +2020,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
{
// wenn ShowState wieder hergestellt werden muss, hiden wir zuerst
// das Fenster, damit es nicht so sehr flackert
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible && (mnShowState != mnFullScreenShowState) )
ShowWindow( mhWnd, SW_HIDE );
@@ -2051,7 +2052,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
// -----------------------------------------------------------------------
-void WinSalFrame::StartPresentation( BOOL bStart )
+void WinSalFrame::StartPresentation( sal_Bool bStart )
{
if ( mbPresentation == bStart )
return;
@@ -2106,7 +2107,7 @@ void WinSalFrame::StartPresentation( BOOL bStart )
// -----------------------------------------------------------------------
-void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void WinSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
HWND hWnd;
if ( bOnTop )
@@ -2118,7 +2119,7 @@ void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
// -----------------------------------------------------------------------
-static void ImplSalToTop( HWND hWnd, USHORT nFlags )
+static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
{
WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
@@ -2174,7 +2175,7 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::ToTop( USHORT nFlags )
+void WinSalFrame::ToTop( sal_uInt16 nFlags )
{
nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
// Post this Message to the window, because this only works
@@ -2325,7 +2326,7 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::CaptureMouse( BOOL bCapture )
+void WinSalFrame::CaptureMouse( sal_Bool bCapture )
{
// Send this Message to the window, because CaptureMouse() only work
// in the thread of the window, which has create this window
@@ -2367,7 +2368,7 @@ void WinSalFrame::Sync()
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
- BOOL bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
+ sal_Bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
if ( bIME )
{
if ( !pFrame->mbIME )
@@ -2434,7 +2435,7 @@ void WinSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
+static void ImplSalFrameEndExtTextInput( HWND hWnd, sal_uInt16 nFlags )
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
@@ -2452,7 +2453,7 @@ static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::EndExtTextInput( USHORT nFlags )
+void WinSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
// Must be called in the main thread!
ImplSendMessage( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, (WPARAM)nFlags, 0 );
@@ -2523,7 +2524,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
+XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
static const int nMaxKeyLen = 350;
sal_Unicode aKeyBuf[ nMaxKeyLen ];
@@ -2533,26 +2534,26 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if ( nKeyCode & KEY_MOD1 )
{
nSysCode = MapVirtualKey( VK_CONTROL, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Ctrl" );
}
if ( nKeyCode & KEY_MOD2 )
{
nSysCode = MapVirtualKey( VK_MENU, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Alt" );
}
if ( nKeyCode & KEY_SHIFT )
{
nSysCode = MapVirtualKey( VK_SHIFT, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Shift" );
}
- USHORT nCode = nKeyCode & 0x0FFF;
- ULONG nSysCode2 = 0;
+ sal_uInt16 nCode = nKeyCode & 0x0FFF;
+ sal_uLong nSysCode2 = 0;
sal_Char* pReplace = NULL;
sal_Unicode cSVCode = 0;
sal_Char aFBuf[4];
@@ -2591,42 +2592,42 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
{
case KEY_DOWN:
nSysCode = VK_DOWN;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Down";
break;
case KEY_UP:
nSysCode = VK_UP;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Up";
break;
case KEY_LEFT:
nSysCode = VK_LEFT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Left";
break;
case KEY_RIGHT:
nSysCode = VK_RIGHT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Right";
break;
case KEY_HOME:
nSysCode = VK_HOME;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Home";
break;
case KEY_END:
nSysCode = VK_END;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "End";
break;
case KEY_PAGEUP:
nSysCode = VK_PRIOR;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Up";
break;
case KEY_PAGEDOWN:
nSysCode = VK_NEXT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Down";
break;
case KEY_RETURN:
@@ -2651,12 +2652,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
break;
case KEY_INSERT:
nSysCode = VK_INSERT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Insert";
break;
case KEY_DELETE:
nSysCode = VK_DELETE;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Delete";
break;
@@ -2720,12 +2721,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if( !nKeyBufLen )
return XubString();
- return XubString( aKeyBuf, sal::static_int_cast< USHORT >(nKeyBufLen) );
+ return XubString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
}
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString WinSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -2803,6 +2804,29 @@ static long ImplA2I( const BYTE* pStr )
}
// -----------------------------------------------------------------------
+static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( BOOL* pOut )
+{
+ *pOut = FALSE;
+ return S_OK;
+}
+
+static BOOL ImplDwmIsCompositionEnabled()
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpDwmIsCompositionEnabled )
+ {
+ rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
+ pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ if( pSalData->maDwmLib )
+ pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
+ if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
+ pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
+ }
+ BOOL aResult = FALSE;
+ HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
+ return nError == S_OK && aResult;
+}
+
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
@@ -2828,34 +2852,30 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
- aMouseSettings.SetMenuDelay( (ULONG)ImplA2I( aValueBuf ) );
+ aMouseSettings.SetMenuDelay( (sal_uLong)ImplA2I( aValueBuf ) );
}
RegCloseKey( hRegKey );
}
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
// TODO: once those options vanish: just set bCompBorder to TRUE
// to have the system colors read
aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() );
- if ( bCompBorder )
- {
- aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
- aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
- aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
- aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
- aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
- aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
- aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
- aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
- }
+ aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
+ aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
+ aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
+ aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
+ aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
+ aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
+ aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+ aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_APPWORKSPACE ) ) );
aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
@@ -2877,37 +2897,52 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
- aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
- aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
- aStyleSettings.SetUseFlatBorders( FALSE );
- aStyleSettings.SetUseFlatMenues( FALSE );
- aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
- aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
- if ( aSalShlData.mbWXP )
+
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 0;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+ GetSalData()->mbThemeMenuSupport = FALSE;
+ aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
+ aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
+ aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
+ aStyleSettings.SetUseFlatBorders( FALSE );
+ aStyleSettings.SetUseFlatMenues( FALSE );
+ aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
+ aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
+ if ( aSalShlData.mbWXP )
+ {
+ // only xp supports a different menu bar color
+ long bFlatMenues = 0;
+ SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
+ if( bFlatMenues )
{
- // only xp supports a different menu bar color
- long bFlatMenues = 0;
- SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
- if( bFlatMenues )
- {
- aStyleSettings.SetUseFlatMenues( TRUE );
- aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
- aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
- aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
-
- // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
- // this is not active in the classic style appearance
- aStyleSettings.SetUseFlatBorders( TRUE );
- }
+ aStyleSettings.SetUseFlatMenues( TRUE );
+ aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
+ aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
+ aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+
+ // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
+ // this is not active in the classic style appearance
+ aStyleSettings.SetUseFlatBorders( TRUE );
}
}
+ // check if vista or newer runs
+ // in Aero theme (and similar ?) the menu text color does not change
+ // for selected items; also on WinXP and earlier menus are not themed
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 &&
+ ImplDwmIsCompositionEnabled()
+ )
+ {
+ // in aero menuitem highlight text is drawn in the same color as normal
+ aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 2;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+ GetSalData()->mbThemeMenuSupport = TRUE;
+ }
// Bei hellgrau geben wir die Farbe vor, damit es besser aussieht
if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY )
aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
@@ -2916,9 +2951,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// Checked-Color berechnen
Color aColor1 = aStyleSettings.GetFaceColor();
Color aColor2 = aStyleSettings.GetLightColor();
- BYTE nRed = (BYTE)(((USHORT)aColor1.GetRed() + (USHORT)aColor2.GetRed())/2);
- BYTE nGreen = (BYTE)(((USHORT)aColor1.GetGreen() + (USHORT)aColor2.GetGreen())/2);
- BYTE nBlue = (BYTE)(((USHORT)aColor1.GetBlue() + (USHORT)aColor2.GetBlue())/2);
+ BYTE nRed = (BYTE)(((sal_uInt16)aColor1.GetRed() + (sal_uInt16)aColor2.GetRed())/2);
+ BYTE nGreen = (BYTE)(((sal_uInt16)aColor1.GetGreen() + (sal_uInt16)aColor2.GetGreen())/2);
+ BYTE nBlue = (BYTE)(((sal_uInt16)aColor1.GetBlue() + (sal_uInt16)aColor2.GetBlue())/2);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
@@ -2998,10 +3033,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetInfoFont( aAppFont );
aStyleSettings.SetToolFont( aAppFont );
- WIN_BOOL bDragFull;
+ BOOL bDragFull;
if ( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, &bDragFull, 0 ) )
{
- ULONG nDragFullOptions = aStyleSettings.GetDragFullOptions();
+ sal_uLong nDragFullOptions = aStyleSettings.GetDragFullOptions();
if ( bDragFull )
nDragFullOptions |= DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT;
else
@@ -3024,7 +3059,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
if ( nType == REG_SZ )
{
- nValue = (ULONG)ImplA2I( aValueBuf );
+ nValue = (sal_uLong)ImplA2I( aValueBuf );
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
@@ -3055,7 +3090,7 @@ SalBitmap* WinSalFrame::SnapShot()
HDC hDC = GetWindowDC( mhWnd );
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- BOOL bRet;
+ sal_Bool bRet;
bRet = BitBlt( hBmpDC, 0, 0, nDX, nDY, hDC, 0, 0, SRCCOPY ) ? TRUE : FALSE;
ImplReleaseCachedDC( CACHED_HDC_1 );
@@ -3143,7 +3178,7 @@ SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
return aState;
}
-void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
+void WinSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
BYTE nVKey = 0;
switch (nKeyCode)
@@ -3175,11 +3210,11 @@ void WinSalFrame::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalFrame::BeginSetClipRegion( ULONG nRects )
+void WinSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
- ULONG nRectBufSize = sizeof(RECT)*nRects;
+ sal_uLong nRectBufSize = sizeof(RECT)*nRects;
mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
mpClipRgnData->rdh.iType = RDH_RECTANGLES;
@@ -3251,7 +3286,7 @@ void WinSalFrame::EndSetClipRegion()
}
else
{
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
}
delete [] (BYTE*)mpClipRgnData;
@@ -3296,8 +3331,8 @@ static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
}
SalMouseEvent aMouseEvt;
long nRet;
- USHORT nEvent = 0;
- BOOL bCall = TRUE;
+ sal_uInt16 nEvent = 0;
+ sal_Bool bCall = TRUE;
aMouseEvt.mnX = (short)LOWORD( lParam );
aMouseEvt.mnY = (short)HIWORD( lParam );
@@ -3531,9 +3566,9 @@ static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
// -----------------------------------------------------------------------
-static USHORT ImplSalGetKeyCode( WPARAM wParam )
+static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
// convert KeyCode
if ( wParam < KEY_TAB_SIZE )
@@ -3541,7 +3576,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
else
{
SalData* pSalData = GetSalData();
- std::map< UINT, USHORT >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
+ std::map< UINT, sal_uInt16 >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
if( it != pSalData->maVKMap.end() )
nKeyCode = it->second;
else
@@ -3555,7 +3590,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
static UINT ImplStrToNum( const sal_Char* pStr )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
// Solange es sich um eine Ziffer handelt, String umwandeln
while( (*pStr >= 48) && (*pStr <= 57) )
@@ -3572,7 +3607,7 @@ static UINT ImplStrToNum( const sal_Char* pStr )
static void ImplUpdateInputLang( WinSalFrame* pFrame )
{
- BOOL bLanguageChange = FALSE;
+ sal_Bool bLanguageChange = FALSE;
UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
if ( nLang && nLang != pFrame->mnInputLang )
{
@@ -3612,9 +3647,9 @@ LanguageType WinSalFrame::GetInputLanguage()
// -----------------------------------------------------------------------
-BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
+sal_Bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
HKL hkl = 0;
// just use the passed language identifier, do not try to load additional keyboard support
@@ -3654,14 +3689,14 @@ BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangT
static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT& rResult )
{
- static BOOL bIgnoreCharMsg = FALSE;
+ static sal_Bool bIgnoreCharMsg = FALSE;
static WPARAM nDeadChar = 0;
static WPARAM nLastVKChar = 0;
- static USHORT nLastChar = 0;
- static USHORT nLastModKeyCode = 0;
+ static sal_uInt16 nLastChar = 0;
+ static sal_uInt16 nLastModKeyCode = 0;
static bool bWaitForModKeyRelease = false;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// Key wurde evtl. durch SysChild an uns weitergeleitet und
// darf somit dann nicht doppelt verarbeitet werden
@@ -3721,11 +3756,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
SalKeyEvent aKeyEvt;
if ( (wParam >= '0') && (wParam <= '9') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_NUM + wParam - '0');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_NUM + wParam - '0');
else if ( (wParam >= 'A') && (wParam <= 'Z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'A');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'A');
else if ( (wParam >= 'a') && (wParam <= 'z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'a');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'a');
else if ( wParam == 0x0D ) // RETURN
aKeyEvt.mnCode = KEY_RETURN;
else if ( wParam == 0x1B ) // ESCAPE
@@ -3793,7 +3828,7 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
aModEvt.mnCode = nModCode;
aModEvt.mnModKeyCode = 0; // no command events will be sent if this member is 0
- USHORT tmpCode = 0;
+ sal_uInt16 tmpCode = 0;
if( GetKeyState( VK_LSHIFT ) & 0x8000 )
tmpCode |= MODKEY_LSHIFT;
if( GetKeyState( VK_RSHIFT ) & 0x8000 )
@@ -3827,11 +3862,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
else
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
+ sal_uInt16 nEvent;
MSG aCharMsg;
- WIN_BOOL bCharPeek = FALSE;
+ BOOL bCharPeek = FALSE;
UINT nCharMsg = WM_CHAR;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
nLastModKeyCode = 0; // make sure no modkey messages are sent if they belong to a hotkey (see above)
aKeyEvt.mnCharCode = 0;
@@ -3946,8 +3981,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -3960,8 +3995,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( (wParam != VK_SHIFT) && (wParam != VK_CONTROL) && (wParam != VK_MENU) )
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_uInt16 nEvent;
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
// convert KeyCode
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
@@ -3996,9 +4031,9 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
- USHORT cKeyCode = (USHORT)wParam;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
+ sal_uInt16 cKeyCode = (sal_uInt16)wParam;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -4030,7 +4065,7 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
static bool ImplHandlePaintMsg( HWND hWnd )
{
- BOOL bMutex = FALSE;
+ sal_Bool bMutex = FALSE;
if ( ImplSalYieldMutexTryToAcquire() )
bMutex = TRUE;
@@ -4386,7 +4421,7 @@ static long ImplHandleShutDownMsg( HWND hWnd )
static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
- USHORT nSalEvent = SALEVENT_SETTINGSCHANGED;
+ sal_uInt16 nSalEvent = SALEVENT_SETTINGSCHANGED;
if ( nMsg == WM_DEVMODECHANGE )
nSalEvent = SALEVENT_PRINTERCHANGED;
@@ -4482,7 +4517,7 @@ static void ImplHandleForcePalette( HWND hWnd )
// -----------------------------------------------------------------------
-static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
+static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, int& rDef )
{
SalData* pSalData = GetSalData();
@@ -4500,7 +4535,7 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
return 0;
}
- BOOL bReleaseMutex = FALSE;
+ sal_Bool bReleaseMutex = FALSE;
if ( (nMsg == WM_QUERYNEWPALETTE) || (nMsg == WM_PALETTECHANGED) )
{
// Da Windows diese Messages auch sendet, muss hier auch die
@@ -4519,8 +4554,8 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
HDC hDC;
HPALETTE hOldPal;
UINT nCols;
- BOOL bStdDC;
- BOOL bUpdate;
+ sal_Bool bStdDC;
+ sal_Bool bUpdate;
pSalData->mbInPalChange = TRUE;
@@ -4713,7 +4748,7 @@ static int ImplHandleMinMax( HWND hWnd, LPARAM lParam )
// the pointer is stored in every item, so if no position
// is specified we just use the first item (ie, pos=0)
// if bByPosition is FALSE then nPos denotes a menu id instead of a position
-static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, BOOL bByPosition=TRUE )
+static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, sal_Bool bByPosition=TRUE )
{
DWORD err=0;
@@ -4868,9 +4903,9 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
COLORREF clrPrevText, clrPrevBkgnd;
HFONT hfntOld;
HBRUSH hbrOld;
- BOOL fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
- BOOL fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
- BOOL fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
+ sal_Bool fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
+ sal_Bool fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
+ sal_Bool fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
@@ -5014,7 +5049,7 @@ static int ImplHandleMenuActivate( HWND hWnd, WPARAM wParam, LPARAM )
HMENU hMenu = (HMENU) wParam;
// WORD nPos = LOWORD (lParam);
- // BOOL bWindowMenu = (BOOL) HIWORD(lParam);
+ // sal_Bool bWindowMenu = (sal_Bool) HIWORD(lParam);
// Send activate and deactivate together, so we have not keep track of opened menues
// this will be enough to have the menues updated correctly
@@ -5049,7 +5084,7 @@ static int ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
if( !GetSalData()->IsKnownMenuHandle( hMenu ) )
return 0;
- BOOL bByPosition = FALSE;
+ sal_Bool bByPosition = FALSE;
if( nFlags & MF_POPUP )
bByPosition = TRUE;
@@ -5149,8 +5184,8 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( pFrame->mbFullScreen )
{
- WIN_BOOL bMaximize = IsZoomed( pFrame->mhWnd );
- WIN_BOOL bMinimize = IsIconic( pFrame->mhWnd );
+ BOOL bMaximize = IsZoomed( pFrame->mhWnd );
+ BOOL bMinimize = IsIconic( pFrame->mhWnd );
if ( (nCommand == SC_SIZE) ||
(!bMinimize && (nCommand == SC_MOVE)) ||
(!bMaximize && (nCommand == SC_MAXIMIZE)) ||
@@ -5214,7 +5249,7 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( ((cKeyCode >= 48) && (cKeyCode <= 57)) ||
((cKeyCode >= 97) && (cKeyCode <= 122)) )
{
- USHORT nModCode = 0;
+ sal_uInt16 nModCode = 0;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
@@ -5303,9 +5338,9 @@ static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEStartComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEStartComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5333,10 +5368,10 @@ static BOOL ImplHandleIMEStartComposition( HWND hWnd )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
+static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
HIMC hIMC, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
// Init Event
SalExtTextInputEvent aEvt;
@@ -5377,7 +5412,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
bDef = FALSE;
- USHORT* pSalAttrAry = NULL;
+ sal_uInt16* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
@@ -5386,23 +5421,23 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
delete [] pTextBuf;
- WIN_BYTE* pAttrBuf = NULL;
+ BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
if ( nAttrLen > 0 )
{
- pAttrBuf = new WIN_BYTE[nAttrLen];
+ pAttrBuf = new BYTE[nAttrLen];
ImmGetCompositionStringW( hIMC, GCS_COMPATTR, pAttrBuf, nAttrLen );
}
if ( pAttrBuf )
{
xub_StrLen nTextLen = aEvt.maText.Len();
- pSalAttrAry = new USHORT[nTextLen];
- memset( pSalAttrAry, 0, nTextLen*sizeof( USHORT ) );
+ pSalAttrAry = new sal_uInt16[nTextLen];
+ memset( pSalAttrAry, 0, nTextLen*sizeof( sal_uInt16 ) );
for ( xub_StrLen i = 0; (i < nTextLen) && (i < nAttrLen); i++ )
{
- WIN_BYTE nWinAttr = pAttrBuf[i];
- USHORT nSalAttr;
+ BYTE nWinAttr = pAttrBuf[i];
+ sal_uInt16 nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
nSalAttr = SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
@@ -5465,9 +5500,9 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
+static sal_Bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
@@ -5513,9 +5548,9 @@ static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEEndComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEEndComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5701,8 +5736,8 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
- ULONG nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
- ULONG nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
+ sal_uLong nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
+ sal_uLong nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
{
@@ -6090,11 +6125,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_TOTOP:
- ImplSalToTop( hWnd, (USHORT)wParam );
+ ImplSalToTop( hWnd, (sal_uInt16)wParam );
rDef = FALSE;
break;
case SAL_MSG_SHOW:
- ImplSalShow( hWnd, (BOOL)wParam, (BOOL)lParam );
+ ImplSalShow( hWnd, (sal_Bool)wParam, (sal_Bool)lParam );
rDef = FALSE;
break;
case SAL_MSG_SETINPUTCONTEXT:
@@ -6102,7 +6137,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_ENDEXTTEXTINPUT:
- ImplSalFrameEndExtTextInput( hWnd, (USHORT)(ULONG)(void*)wParam );
+ ImplSalFrameEndExtTextInput( hWnd, (sal_uInt16)(sal_uLong)(void*)wParam );
rDef = FALSE;
break;
@@ -6269,11 +6304,11 @@ LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
// -----------------------------------------------------------------------
-BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
+sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
{
// handle all messages concerning all frames so they get processed only once
// Must work for Unicode and none Unicode
- BOOL bResult = FALSE;
+ sal_Bool bResult = FALSE;
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
int bDef = TRUE;
@@ -6292,7 +6327,7 @@ BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LR
// -----------------------------------------------------------------------
-BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
+sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
{
static int first=1;
// if VCL_LOGFILE_ENABLED is set, Win32 API error messages can be written
@@ -6300,7 +6335,7 @@ BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
static char *logEnabled = getenv("VCL_LOGFILE_ENABLED");
if( logEnabled )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = FALSE;
static char *szTmp = getenv("TMP");
if( !szTmp || !*szTmp )
szTmp = getenv("TEMP");
diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx
index e86e3f27903d..d92039194f7a 100644
--- a/vcl/win/source/window/salmenu.cxx
+++ b/vcl/win/source/window/salmenu.cxx
@@ -48,7 +48,7 @@ static DWORD myerr=0;
// =======================================================================
-BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
+sal_Bool SalData::IsKnownMenuHandle( HMENU hMenu )
{
if( mhMenuSet.find( hMenu ) == mhMenuSet.end() )
return FALSE;
@@ -60,7 +60,7 @@ BOOL SalData::IsKnownMenuHandle( HMENU hMenu )
// WinSalInst factory methods
-SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* WinSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* )
{
WinSalMenu *pSalMenu = new WinSalMenu();
@@ -169,7 +169,7 @@ WinSalMenu::~WinSalMenu()
::DestroyMenu( mhMenu );
}
-BOOL WinSalMenu::VisibleMenuBar()
+sal_Bool WinSalMenu::VisibleMenuBar()
{
// The Win32 implementation never shows a native
// menubar. Thus, native menues are only visible
@@ -295,13 +295,13 @@ void WinSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
}
}
-void WinSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
+void WinSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
{
if( -1 != ::CheckMenuItem( mhMenu, nPos, MF_BYPOSITION|(bCheck ? MF_CHECKED : MF_UNCHECKED) ) )
ImplDrawMenuBar( this );
}
-void WinSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
+void WinSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
{
if( -1 != ::EnableMenuItem( mhMenu, nPos, MF_BYPOSITION|(bEnable ? MF_ENABLED : (MF_DISABLED|MF_GRAYED) ) ) )
ImplDrawMenuBar( this );
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index bfa365af7ba2..5e034564d4cf 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -38,10 +38,11 @@
#include <salframe.h>
#include <salobj.h>
#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
// =======================================================================
-static BOOL ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
+static sal_Bool ImplIsSysWindowOrChild( HWND hWndParent, HWND hWndChild )
{
if ( hWndParent == hWndChild )
return TRUE;
@@ -102,6 +103,46 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
// -----------------------------------------------------------------------
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg )
+{
+ sal_Bool bResult = sal_False;
+ if ( rMsg.message == WM_KEYDOWN )
+ {
+ wchar_t pClassName[10];
+ sal_Int32 nLen = GetClassNameW( rMsg.hwnd, pClassName, 10 );
+ if ( !( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) )
+ {
+ // look for the first SalObject in the parent hierarchy
+ HWND hWin = rMsg.hwnd;
+ HWND hLastOLEWindow = hWin;
+ WinSalObject* pSalObj = NULL;
+ do
+ {
+ hLastOLEWindow = hWin;
+ hWin = ::GetParent( hWin );
+ if ( hWin )
+ {
+ nLen = GetClassNameW( hWin, pClassName, 10 );
+ if ( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 )
+ pSalObj = GetSalObjWindowPtr( hWin );
+ }
+ } while( hWin && !pSalObj );
+
+ if ( pSalObj && pSalObj->mbInterceptChildWindowKeyDown && pSalObj->maSysData.hWnd )
+ {
+ bResult = ( 1 == ImplSendMessage( pSalObj->maSysData.hWnd, rMsg.message, rMsg.wParam, rMsg.lParam ) );
+ }
+ }
+ }
+
+ return bResult;
+}
+
+// -----------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------
+
LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
{
// Used for Unicode and none Unicode
@@ -160,7 +201,7 @@ LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
// -----------------------------------------------------------------------
-BOOL ImplSalPreDispatchMsg( MSG* pMsg )
+sal_Bool ImplSalPreDispatchMsg( MSG* pMsg )
{
// Used for Unicode and none Unicode
SalData* pSalData = GetSalData();
@@ -185,7 +226,7 @@ BOOL ImplSalPreDispatchMsg( MSG* pMsg )
// SysKeys werden als WM_SYSCOMMAND verarbeitet
// Char-Events verarbeiten wir nicht, da wir nur
// Accelerator relevante Keys verarbeiten wollen
- BOOL bWantedKeyCode = FALSE;
+ sal_Bool bWantedKeyCode = FALSE;
// A-Z, 0-9 nur in Verbindung mit Control-Taste
if ( ((pMsg->wParam >= 65) && (pMsg->wParam <= 90)) ||
((pMsg->wParam >= 48) && (pMsg->wParam <= 57)) )
@@ -213,13 +254,13 @@ BOOL ImplSalPreDispatchMsg( MSG* pMsg )
{
pSalData->mnSalObjWantKeyEvt = 0;
- USHORT nKeyCode = LOWORD( pMsg->wParam );
+ sal_uInt16 nKeyCode = LOWORD( pMsg->wParam );
// Nur 0-9 und A-Z
if ( ((nKeyCode >= 48) && (nKeyCode <= 57)) ||
((nKeyCode >= 65) && (nKeyCode <= 90)) ||
((nKeyCode >= 97) && (nKeyCode <= 122)) )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
ImplSalYieldMutexAcquireWithWait();
pObject = ImplFindSalObject( pMsg->hwnd );
if ( pObject )
@@ -337,7 +378,7 @@ LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
{
pSysObj = GetSalObjWindowPtr( hWnd );
HWND hFocusWnd = ::GetFocus();
- USHORT nEvent;
+ sal_uInt16 nEvent;
if ( hFocusWnd && ImplIsSysWindowOrChild( hWnd, hFocusWnd ) )
nEvent = SALOBJ_EVENT_GETFOCUS;
else
@@ -612,6 +653,7 @@ WinSalObject::WinSalObject()
mhLastFocusWnd = 0;
maSysData.nSize = sizeof( SystemEnvData );
mpStdClipRgnData = NULL;
+ mbInterceptChildWindowKeyDown = sal_False;
// Insert object in objectlist
mpNextObject = pSalData->mpFirstObject;
@@ -671,16 +713,16 @@ void WinSalObject::ResetClipRegion()
// -----------------------------------------------------------------------
-USHORT WinSalObject::GetClipRegionType()
+sal_uInt16 WinSalObject::GetClipRegionType()
{
return SAL_OBJECT_CLIP_INCLUDERECTS;
}
// -----------------------------------------------------------------------
-void WinSalObject::BeginSetClipRegion( ULONG nRectCount )
+void WinSalObject::BeginSetClipRegion( sal_uLong nRectCount )
{
- ULONG nRectBufSize = sizeof(RECT)*nRectCount;
+ sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
if ( nRectCount < SAL_CLIPRECT_COUNT )
{
if ( !mpStdClipRgnData )
@@ -752,7 +794,7 @@ void WinSalObject::EndSetClipRegion()
}
else
{
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
if ( mpClipRgnData != mpStdClipRgnData )
delete [] (BYTE*)mpClipRgnData;
@@ -766,8 +808,8 @@ void WinSalObject::EndSetClipRegion()
void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
{
- ULONG nStyle = 0;
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_uLong nStyle = 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible )
{
ShowWindow( mhWnd, SW_HIDE );
@@ -780,7 +822,7 @@ void WinSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
// -----------------------------------------------------------------------
-void WinSalObject::Show( BOOL bVisible )
+void WinSalObject::Show( sal_Bool bVisible )
{
if ( bVisible )
ShowWindow( mhWnd, SW_SHOWNORMAL );
@@ -790,7 +832,7 @@ void WinSalObject::Show( BOOL bVisible )
// -----------------------------------------------------------------------
-void WinSalObject::Enable( BOOL bEnable )
+void WinSalObject::Enable( sal_Bool bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -826,4 +868,11 @@ const SystemEnvData* WinSalObject::GetSystemData() const
return &maSysData;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+// -----------------------------------------------------------------------
+
+void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ mbInterceptChildWindowKeyDown = bIntercept;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk
index 66bca942f74c..d52737507a20 100644
--- a/vcl/workben/makefile.mk
+++ b/vcl/workben/makefile.mk
@@ -34,6 +34,8 @@ TARGETTYPE=GUI
ENABLE_EXCEPTIONS=TRUE
+my_components = i18npool i18nsearch
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
@@ -132,16 +134,18 @@ APP5STDLIBS+=-lsocket
.ENDIF
.INCLUDE : target.mk
-.IF "$(L10N_framework)"==""
-ALLTAR : $(BIN)$/applicat.rdb
+ALLTAR : $(BIN)/applicat.rdb $(BIN)/types.rdb
+$(BIN)/applicat.rdb .ERRREMOVE : $(SOLARENV)/bin/packcomponents.xslt \
+ $(MISC)/applicat.input $(my_components:^"$(SOLARXMLDIR)/":+".component")
+ $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@ \
+ $(SOLARENV)/bin/packcomponents.xslt $(MISC)/applicat.input
-$(BIN)$/applicat.rdb : makefile.mk $(UNOUCRRDB)
- rm -f $@
- $(GNUCOPY) $(UNOUCRRDB) $@
- cd $(BIN) && \
- $(REGCOMP) -register -r applicat.rdb \
- -c i18nsearch.uno$(DLLPOST) \
- -c i18npool.uno$(DLLPOST)
-.ENDIF
+$(MISC)/applicat.input :
+ echo \
+ '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+ > $@
+
+$(BIN)/types.rdb : $(SOLARBINDIR)/types.rdb
+ $(COPY) $< $@
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index 0d38ff519987..e86db3ed7821 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -75,7 +75,7 @@ class GrindApp : public Application
{
public:
virtual int Main();
- virtual USHORT Exception( USHORT nError );
+ virtual sal_uInt16 Exception( sal_uInt16 nError );
};
class TestWindow : public Dialog
@@ -154,7 +154,7 @@ void setupMethodStubs( functor_vector_type& res )
const Wallpaper aWallpaper( aWhiteColor );
GDIMetaFile aMtf;
- aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),TRUE) );
+ aMtf.AddAction( new MetaFillColorAction(Color(COL_RED),sal_True) );
aMtf.AddAction( new MetaRectAction(aRect) );
/* void DrawText( const Point& rStartPt, const XubString& rStr,
@@ -166,7 +166,7 @@ void setupMethodStubs( functor_vector_type& res )
// boost::bind(
// &OutputDevice::DrawText,
// _1,
-// aPt1, aString, (USHORT)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
+// aPt1, aString, (sal_uInt16)0, aString.Len(), (MetricVector*)0, (String*)0, (vcl::ITextLayout*)0 ));
/* void DrawTextArray( const Point& rStartPt, const XubString& rStr,
const sal_Int32* pDXAry = NULL,
@@ -178,7 +178,7 @@ void setupMethodStubs( functor_vector_type& res )
boost::bind(
&OutputDevice::DrawTextArray,
_1,
- aPt1, aString, (const sal_Int32*)0, (USHORT)0, aString.Len() ));
+ aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.Len() ));
/* void DrawPixel( const Point& rPt, const Color& rColor ); */
add(res,
@@ -257,12 +257,12 @@ void setupMethodStubs( functor_vector_type& res )
aRect ));
/* void DrawRect( const Rectangle& rRect,
- ULONG nHorzRount, ULONG nVertRound );
+ sal_uLong nHorzRount, sal_uLong nVertRound );
*/
add(res,
"DrawRect(round corners)",
boost::bind(
- (void (OutputDevice::*)( const Rectangle&, ULONG nHorzRount, ULONG nVertRound ))(
+ (void (OutputDevice::*)( const Rectangle&, sal_uLong nHorzRount, sal_uLong nVertRound ))(
&OutputDevice::DrawRect),
_1,
aRect2,
@@ -353,14 +353,14 @@ void setupMethodStubs( functor_vector_type& res )
/* void CopyArea( const Point& rDestPt,
const Point& rSrcPt, const Size& rSrcSize,
- USHORT nFlags = 0 );
+ sal_uInt16 nFlags = 0 );
*/
add(res,
"CopyArea",
boost::bind(
&OutputDevice::CopyArea,
_1,
- aPt1,aPt3,aRect2.GetSize(),(USHORT)0 ));
+ aPt1,aPt3,aRect2.GetSize(),(sal_uInt16)0 ));
/* void DrawBitmap( const Point& rDestPt,
const Bitmap& rBitmap );
@@ -697,20 +697,20 @@ void setupMethodStubs( functor_vector_type& res )
aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmap,aBlackColor ));
/* void DrawImage( const Point& rPos,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
*/
add(res,
"DrawImage",
boost::bind(
(void (OutputDevice::*)( const Point&,
const Image&,
- USHORT nStyle ))(
+ sal_uInt16 nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aImage,(USHORT)0 ));
+ aPt1,aImage,(sal_uInt16)0 ));
/* void DrawImage( const Point& rPos, const Size& rSize,
- const Image& rImage, USHORT nStyle = 0 );
+ const Image& rImage, sal_uInt16 nStyle = 0 );
*/
add(res,
"DrawImage(scaled)",
@@ -718,10 +718,10 @@ void setupMethodStubs( functor_vector_type& res )
(void (OutputDevice::*)( const Point&,
const Size&,
const Image&,
- USHORT nStyle ))(
+ sal_uInt16 nStyle ))(
&OutputDevice::DrawImage),
_1,
- aPt1,aRect.GetSize(),aImage,(USHORT)0 ));
+ aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 ));
/* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */
add(res,
@@ -757,15 +757,15 @@ void setupMethodStubs( functor_vector_type& res )
_1,
aRect2,aWallpaper ));
- /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, USHORT nStyle ); */
+ /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */
add(res,
"DrawWaveLine",
boost::bind(
&OutputDevice::DrawWaveLine,
_1,
- aPt1,aPt2,(USHORT)WAVE_NORMAL ));
+ aPt1,aPt2,(sal_uInt16)WAVE_NORMAL ));
- /* void DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nFlags ); */
+ /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
add(res,
"DrawGrid",
boost::bind(
@@ -774,15 +774,15 @@ void setupMethodStubs( functor_vector_type& res )
aRect,Size(10,20),GRID_HORZLINES|GRID_VERTLINES ));
/* void DrawTransparent( const PolyPolygon& rPolyPoly,
- USHORT nTransparencePercent );
+ sal_uInt16 nTransparencePercent );
*/
add(res,
"DrawTransparent",
boost::bind(
- (void (OutputDevice::*)( const PolyPolygon&, USHORT ))(
+ (void (OutputDevice::*)( const PolyPolygon&, sal_uInt16 ))(
&OutputDevice::DrawTransparent),
_1,
- aPoly3,(USHORT)50 ));
+ aPoly3,(sal_uInt16)50 ));
/* void DrawTransparent( const GDIMetaFile& rMtf,
const Point& rPos, const Size& rSize,
@@ -903,7 +903,7 @@ void TestWindow::Paint( const Rectangle& )
fflush( stdout );
}
-USHORT GrindApp::Exception( USHORT nError )
+sal_uInt16 GrindApp::Exception( sal_uInt16 nError )
{
switch( nError & EXC_MAJORTYPE )
{
@@ -919,7 +919,7 @@ int GrindApp::Main()
{
bool bHelp = false;
- for( USHORT i = 0; i < GetCommandLineParamCount(); i++ )
+ for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
{
::rtl::OUString aParam = GetCommandLineParam( i );
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 2067fbe696ce..4898aed1a995 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -56,7 +56,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 39f97c476051..47af3aaa8e30 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -147,7 +147,7 @@ public:
void Paint( const Rectangle& rRect );
void Resize();
- BOOL Close();
+ sal_Bool Close();
void parseList( const rtl::OString& rList );
rtl::OString processCommand( const rtl::OString& rCommand );
@@ -196,9 +196,9 @@ MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
m_aQuitButton.Show();
}
-BOOL MyWin::Close()
+sal_Bool MyWin::Close()
{
- BOOL bRet = WorkWindow::Close();
+ sal_Bool bRet = WorkWindow::Close();
if( bRet )
Application::Quit();
return bRet;
@@ -279,7 +279,7 @@ IMPL_LINK( MyWin, QuitHdl, Button*, )
IMPL_LINK( MyWin, SelectHdl, ListBox*, )
{
String aEntry = m_aSvpBitmaps.GetSelectEntry();
- USHORT nPos = aEntry.SearchAscii( ": " );
+ sal_uInt16 nPos = aEntry.SearchAscii( ": " );
if( nPos != STRING_NOTFOUND )
{
OStringBuffer aCommand( 64 );
@@ -298,7 +298,7 @@ IMPL_LINK( MyWin, SelectHdl, ListBox*, )
aFixedSize.Width() += 10;
aFixedSize.Height() += 10;
m_aImage.SetSizePixel( aFixedSize );
- m_aImage.SetBitmap( BitmapEx( aBitmap ) );
+ m_aImage.SetImage( Image( BitmapEx( aBitmap ) ) );
}
return 0;
}
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index d5c736b74450..545c2aedf6ee 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -64,7 +64,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();
@@ -191,7 +191,7 @@ static Point project( const Point& rPoint )
static Color approachColor( const Color& rFrom, const Color& rTo )
{
Color aColor;
- UINT8 nDiff;
+ sal_uInt8 nDiff;
// approach red
if( rFrom.GetRed() < rTo.GetRed() )
{
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index a4da3f11c966..547660fa1e1e 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -61,7 +61,7 @@ SAL_IMPLEMENT_MAIN()
tools::extendApplicationEnvironment();
Reference< XMultiServiceFactory > xMS;
- xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS );
::Main();